מדיה ויקי:Gadget-HotCat.js: הבדלים בין גרסאות בדף

אין תקציר עריכה
getting rid of hotcat_last_v in hotcat_show_suggestions
שורה 554: שורה 554:


   var first_title = titles.shift () ;
   var first_title = titles.shift () ;
   if ( first_title == hotcat_last_v ) return ;
  var v = text.value.ucFirst() ;
   if ( first_title == v ) return ;


   // Put the first entry of the title list into the text field, and select the
   // Put the first entry of the title list into the text field, and select the
שורה 562: שורה 563:
   // again differently from the two versions previously implemented.
   // again differently from the two versions previously implemented.
   // Lupo, 2008-01-20
   // Lupo, 2008-01-20
   if (text.setSelectionRange ||
   // Only put first entry into the list if the user hasn't typed something
      text.createTextRange ||
  // conflicting yet Dschwen 2008-02-18
      typeof (text.selectionStart) != 'undefined' &&
  if ( ( text.setSelectionRange ||
      typeof (text.selectionEnd) != 'undefined')
        text.createTextRange ||
        typeof (text.selectionStart) != 'undefined' &&
        typeof (text.selectionEnd) != 'undefined' ) &&
        v == first_title.substr(0,v.length) )
   {
   {
     var nosel = hotcat_last_v.length ;
    // taking hotcat_last_v was a major annoyance,
    // since it constantly killed text that was typed in
    // _since_ the last AJAX request was fired! Dschwen 2008-02-18
     var nosel = v.length ;
    
    
     text.value = first_title ;
     text.value = first_title ;