qhub_ask_widget = new Object(); qhub_ask_widget.title = typeof qhub_ask_title == 'string' ? unescape(qhub_ask_title) : 'Poser une question'; qhub_ask_widget.width = typeof qhub_ask_width == 'string' ? qhub_ask_width : '200px'; qhub_ask_widget.header_col = typeof qhub_ask_header_col == 'string' ? qhub_ask_header_col : '#000'; qhub_ask_widget.background = typeof qhub_ask_background == 'string' ? qhub_ask_background : '#fff'; qhub_ask_widget.border = typeof qhub_ask_border == 'string' ? qhub_ask_border : '#e0e0e0'; qhub_ask_widget.hard_link = typeof qhub_ask_css_name == 'string' ? qhub_ask_css_name : 'u2france_qhub_com'; document.write(''); document.write(''); document.write('
'); document.write(''); document.write('
'); document.write(''); document.write('

'); document.write(''); document.write(' Poser une question

'); document.write(''); document.write('

'); document.write(''); document.write(' sur U2 QHub'); document.write(''); document.write('

'); document.write(''); document.write('
'); document.write(''); document.write('
'); document.write(''); document.write(' '); document.write(''); document.write('
'); document.write(''); document.write('
'); document.write(''); document.write(' '); document.write(''); document.write('
'); document.write(''); document.write('
'); document.write(''); document.write('

'); document.write(''); document.write(' '); document.write(''); document.write('

'); document.write(''); document.write('
'); document.write(''); document.write('
 
'); document.write(''); document.write('
'); document.write(''); document.write('
'); document.write(''); document.write(''); (function($) { var width_parsed = parseInt(qhub_ask_widget.width); width_parsed = width_parsed - 18; if (width_parsed <= 335) { tag_width = width_parsed - 35 } else { tag_width = 300 } var textbox_width = width_parsed - 10; var scalewidth = Math.min(width_parsed,300); var scale = scalewidth / 250 + 0.2; var header = Math.round(scale*16); var bodysize = Math.round(scale*12); var tagsize = Math.min(bodysize,13); var bodysize = Math.min(bodysize,20); var container_div = $('div#qhub_ask_widget_container_142281'); container_div .css({'width': width_parsed+'px', 'background-color': qhub_ask_widget.background, 'border': '1px solid '+qhub_ask_widget.border}); container_div.find('p#qhub_ask_header') .html(qhub_ask_widget.title) .css({'color': qhub_ask_widget.header_col, 'font-size': header+'px'}); container_div.find('p#qhub_ask_subheader') .css({'color': qhub_ask_widget.header_col, 'font-size': tagsize+'px'}); container_div.find('p#qhub_ask_subheader a') .css({'color': qhub_ask_widget.header_col, 'font-size': tagsize+'px'}); container_div.find('textarea#qhub_ask_question') .css({'width': textbox_width+'px', 'font-size': bodysize+'px'}); container_div.find('input#tags_142281') .css({'width': tag_width+'px', 'font-size': tagsize+'px'}); container_div.find('button#qhub_ask_btn') .css('font-size', tagsize+'px'); var hard_link = $('#'+qhub_ask_widget.hard_link+'_link'); if (hard_link) { hard_link.css('width', qhub_ask_widget.width) } $(document).ready(function() { var hub_tags_cnt = {"Tagger cette question":"9","Tag this question":"9","Tourn\u00e9e 2010":"2","Artificial Horizon":"2","Array":"2","questions":"2","parking":"2","Tagger\u00a0cette\u00a0question":"2","concert":"2","St\u00e9ph":"1","Abcdzzz":"1","guitare":"1","qhub":"1","france":"1","aide imprime document":"1","Chris":"1","place concert proche de la scene":"1","m":"1","pierre.lhomme2@hotmail.fr":"1","r\u00e9f\u00e9rence":"1","r\u00e9ception ticket":"1","1 45t des u2":"1","Chanson pr\u00e9f\u00e9r\u00e9e de U2":"1","Traduction de documents u2":"1","discographie":"1","d\u00e9buts du groupe":"1","faq":"1","place de parking":"1","steph":"1","resto":"1"}; var hub_tags = ["Tagger cette question","Tag this question","Tourn\u00e9e 2010","Artificial Horizon","Array","questions","parking","Tagger\u00a0cette\u00a0question","concert","St\u00e9ph","Abcdzzz","guitare","qhub","france","aide imprime document","Chris","place concert proche de la scene","m","pierre.lhomme2@hotmail.fr","r\u00e9f\u00e9rence","r\u00e9ception ticket","1 45t des u2","Chanson pr\u00e9f\u00e9r\u00e9e de U2","Traduction de documents u2","discographie","d\u00e9buts du groupe","faq","place de parking","steph","resto"]; function qhub_trim (str) { return str.replace(/^\s+|\s+$/g,""); } container_div.find('ul#qhub_tags_autosuggest_142281 li').live("click",function() { qhub_input = container_div.find('input#tags_142281'); $(this).find('strong').remove(); qhub_txt=""; qhub_tags = qhub_input.val().split(','); qhub_tags.pop(); qhub_tags.push($(this).html()); for(i=0;i < qhub_tags.length;i++) { qhub_txt += qhub_trim(qhub_tags[i])+", "; } qhub_input.val(qhub_txt).focus(); $(this).parent().html(' '); return false; }); function qhub_showSuggestions(txt) { if(!hub_tags.length) return ''; if(!txt) return ''; html = ''; currentTags = txt.split(','); currentTag = qhub_trim(currentTags.pop()); if(!currentTag) return html; currentLetter = currentTag.charAt(currentTag.length-1); currentLength = currentTag.length; matches = new Array(); /** * Search hub_tags for text */ myregexp = new RegExp('^'+currentTag,'i'); for (i = 0; i < hub_tags.length; i++) { _tag = hub_tags[i]; mymatch = myregexp.test(_tag); if(mymatch) { match = true; for (key in currentTags) { if (currentTags[key] == _tag) match = false; } if(match) matches.push(_tag); } } /** * Display matches */ end = (matches.length > 4)?5:matches.length; for (i = 0; i < end; i++) { liclass = i==end-1?' class="last"':''; html += ''+hub_tags_cnt[matches[i]]+'' + matches[i] + ''; } return html; } $.fn.qhub_tag_suggest = function(ev) { ul =''; switch(ev.keyCode) { case 59: case 107: case 109: case 188: case 190: case 191: case 192: case 219: case 220: case 221: case 222: html = ''; break; default: id = 'ul#qhub_tags_autosuggest_142281'; if(!$(id).length) { this.after(''); } ul = $(id); ul.addClass('autosuggest'); txt = this.attr('value'); html = qhub_showSuggestions(txt); break; } if(ul.length) ul.html(html).show(); } container_div.find('input#tags_142281') .unbind().keyup(function(event) { $(this).qhub_tag_suggest(event); }) .blur(function() { $('ul#qhub_tags_autosuggest_142281') .animate({ display:'none' },500); }); }); })(jQuery);