Show
Ignore:
Timestamp:
11/23/10 15:19:53 (2 years ago)
Author:
p_lindheimer
Message:

fixes #4453 and fixes #4563 javascript running too long with many dial patterns, did not use pageination patch provided in #4563, insteady, only the first 50 entries have toggleval applied to them, all the others will be updated onmouseover to see what the filed it so if you scroll down past 50 entries, they will simply be blank if not filled in

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.9/core/page.routing.php

    r10159 r10611  
    534534  $mp_tit = _("match pattern"); 
    535535  $ci_tit = _("CallerId"); 
     536 
     537  $dpt_title_class = 'dpt-title dpt-display'; 
    536538  foreach ($dialpattern_array as $idx => $pattern) { 
    537539    $tabindex++; 
    538     $dpt_class = $pattern['prepend_digits'] == '' ? 'dpt-title' : 'dpt-value'; 
     540    if ($idx == 50) { 
     541      $dpt_title_class = 'dpt-title dpt-nodisplay'; 
     542    } 
     543    $dpt_class = $pattern['prepend_digits'] == '' ? $dpt_title_class : 'dpt-value'; 
    539544    echo <<< END 
    540545    <tr> 
     
    543548END; 
    544549    $tabindex++; 
    545     $dpt_class = $pattern['match_pattern_prefix'] == '' ? 'dpt-title' : 'dpt-value'; 
     550    $dpt_class = $pattern['match_pattern_prefix'] == '' ? $dpt_title_class : 'dpt-value'; 
    546551    echo <<< END 
    547552        <input title="$pf_tit" type="text" size="6" id="pattern_prefix_$idx" name="pattern_prefix[$idx]" class="$dpt_class" value="{$pattern['match_pattern_prefix']}" tabindex="$tabindex"> | 
    548553END; 
    549554    $tabindex++; 
    550     $dpt_class = $pattern['match_pattern_pass'] == '' ? 'dpt-title' : 'dpt-value'; 
     555    $dpt_class = $pattern['match_pattern_pass'] == '' ? $dpt_title_class : 'dpt-value'; 
    551556    echo <<< END 
    552557        [<input title="$mp_tit" type="text" size="16" id="pattern_pass_$idx" name="pattern_pass[$idx]" class="$dpt_class" value="{$pattern['match_pattern_pass']}" tabindex="$tabindex"> / 
    553558END; 
    554559    $tabindex++; 
    555     $dpt_class = $pattern['match_cid'] == '' ? 'dpt-title' : 'dpt-value'; 
     560    $dpt_class = $pattern['match_cid'] == '' ? $dpt_title_class : 'dpt-value'; 
    556561    echo <<< END 
    557562        <input title="$ci_tit" type="text" size="10" id="match_cid_$idx" name="match_cid[$idx]" class="$dpt_class" value="{$pattern['match_cid']}" tabindex="$tabindex">] 
     
    567572    <tr> 
    568573      <td colspan="2"> 
    569         (<input title="<?php echo $pp_tit?>" type="text" size="8" id="prepend_digit_<?php echo $next_idx?>" name="prepend_digit[<?php echo $next_idx?>]" class="dial-pattern dpt-title" value="" tabindex="<?php echo ++$tabindex;?>">) + 
    570         <input title="<?php echo $pf_tit?>" type="text" size="6" id="pattern_prefix_<?php echo $next_idx?>" name="pattern_prefix[<?php echo $next_idx?>]" class="dpt-title" value="" tabindex="<?php echo ++$tabindex;?>"> | 
    571         [<input title="<?php echo $mp_tit?>" type="text" size="16" id="pattern_pass_<?php echo $next_idx?>" name="pattern_pass[<?php echo $next_idx?>]" class="dpt-title" value="" tabindex="<?php echo ++$tabindex;?>"> / 
    572         <input title="<?php echo $ci_tit?>" type="text" size="10" id="match_cid_<?php echo $next_idx?>" name="match_cid[<?php echo $next_idx?>]" class="dpt-title" value="" tabindex="<?php echo ++$tabindex;?>">] 
     574        (<input title="<?php echo $pp_tit?>" type="text" size="8" id="prepend_digit_<?php echo $next_idx?>" name="prepend_digit[<?php echo $next_idx?>]" class="dial-pattern dpt-title dpt-display" value="" tabindex="<?php echo ++$tabindex;?>">) + 
     575        <input title="<?php echo $pf_tit?>" type="text" size="6" id="pattern_prefix_<?php echo $next_idx?>" name="pattern_prefix[<?php echo $next_idx?>]" class="dpt-title dpt-display" value="" tabindex="<?php echo ++$tabindex;?>"> | 
     576        [<input title="<?php echo $mp_tit?>" type="text" size="16" id="pattern_pass_<?php echo $next_idx?>" name="pattern_pass[<?php echo $next_idx?>]" class="dpt-title dpt-display" value="" tabindex="<?php echo ++$tabindex;?>"> / 
     577        <input title="<?php echo $ci_tit?>" type="text" size="10" id="match_cid_<?php echo $next_idx?>" name="match_cid[<?php echo $next_idx?>]" class="dpt-title dpt-display" value="" tabindex="<?php echo ++$tabindex;?>">] 
    573578        <img src="images/trash.png" style="float:none; margin-left:0px; margin-bottom:-3px;cursor:pointer;" alt="<?php echo _("remove")?>" title="<?php echo _("Click here to remove this pattern")?>" onclick="patternsRemove(<?php echo _("$next_idx") ?>)"> 
    574579 
     
    777782    addCustomField('','','',''); 
    778783  }); 
    779   $(".dpt-title").toggleVal({ 
     784  $(".dpt-display").toggleVal({ 
    780785    populateFrom: "title", 
    781786    changedClass: "text-normal", 
    782787    focusClass: "text-normal" 
     788  }); 
     789  $(".dpt-nodisplay").mouseover(function(){ 
     790    $(this).toggleVal({ 
     791      populateFrom: "title", 
     792      changedClass: "text-normal", 
     793      focusClass: "text-normal" 
     794    }).removeClass('dpt-nodisplay').addClass('dpt-display').unbind('mouseover'); 
    783795  }); 
    784796});  
     
    795807  var tabindex2 = tabindex + 3; 
    796808  var tabindex3 = tabindex + 4; 
    797   var dpt_prepend_digit = prepend_digit == '' ? 'dpt-title' : 'dpt-value'; 
    798   var dpt_pattern_prefix = pattern_prefix == '' ? 'dpt-title' : 'dpt-value'; 
    799   var dpt_pattern_pass = pattern_pass == '' ? 'dpt-title' : 'dpt-value'; 
    800   var dpt_match_cid = match_cid == '' ? 'dpt-title' : 'dpt-value'; 
     809  var dpt_title = 'dpt-title dpt-display'; 
     810  var dpt_prepend_digit = prepend_digit == '' ? dpt_title : 'dpt-value'; 
     811  var dpt_pattern_prefix = pattern_prefix == '' ? dpt_title : 'dpt-value'; 
     812  var dpt_pattern_pass = pattern_pass == '' ? dpt_title : 'dpt-value'; 
     813  var dpt_match_cid = match_cid == '' ? dpt_title : 'dpt-value'; 
    801814 
    802815  var new_insert = $("#last_row").before('\ 
     
    880893 
    881894function clearPatterns() { 
    882   $(".dpt-title").each(function() { 
     895  $(".dpt-display").each(function() { 
    883896    if($(this).val() == $(this).data("defText")) { 
    884897      $(this).val(""); 
     
    894907  defaultEmptyOK = false; 
    895908 
    896   $(".dpt-title, .dpt-value").each(function() { 
     909  $(".dpt-display, .dpt-value").each(function() { 
    897910    if ($.trim($(this).val()) == '') { 
    898911    } else if (!isDialpattern($(this).val())) { 
     
    913926    // now we have to put it back... 
    914927    // do I have to turn it off first though? 
    915     $(".dpt-title").each(function() { 
     928    $(".dpt-display").each(function() { 
    916929      if ($.trim($(this).val()) == '') { 
    917930        $(this).toggleVal({ 
  • modules/branches/2.9/core/page.trunks.php

    r10454 r10611  
    571571  $pf_tit = _("prefix"); 
    572572  $mp_tit = _("match pattern"); 
     573  $dpt_title_class = 'dpt-title dpt-display'; 
    573574  foreach ($dialpattern_array as $idx => $pattern) { 
    574575    $tabindex++; 
    575     $dpt_class = $pattern['prepend_digits'] == '' ? 'dpt-title' : 'dpt-value'; 
     576    if ($idx == 50) { 
     577      $dpt_title_class = 'dpt-title dpt-nodisplay'; 
     578    } 
     579    $dpt_class = $pattern['prepend_digits'] == '' ? $dpt_title_class : 'dpt-value'; 
    576580    echo <<< END 
    577581    <tr> 
     
    580584END; 
    581585    $tabindex++; 
    582     $dpt_class = $pattern['match_pattern_prefix'] == '' ? 'dpt-title' : 'dpt-value'; 
     586    $dpt_class = $pattern['match_pattern_prefix'] == '' ? $dpt_title_class : 'dpt-value'; 
    583587    echo <<< END 
    584588        <input title="$pf_tit" type="text" size="6" id="pattern_prefix_$idx" name="pattern_prefix[$idx]" class="dp-prefix $dpt_class" value="{$pattern['match_pattern_prefix']}" tabindex="$tabindex"> | 
    585589END; 
    586590    $tabindex++; 
    587     $dpt_class = $pattern['match_pattern_pass'] == '' ? 'dpt-title' : 'dpt-value'; 
     591    $dpt_class = $pattern['match_pattern_pass'] == '' ? $dpt_title_class : 'dpt-value'; 
    588592    echo <<< END 
    589593        <input title="$mp_tit" type="text" size="16" id="pattern_pass_$idx" name="pattern_pass[$idx]" class="dp-match $dpt_class" value="{$pattern['match_pattern_pass']}" tabindex="$tabindex"> 
     
    599603    <tr> 
    600604      <td colspan="2"> 
    601         (<input title="<?php echo $pp_tit?>" type="text" size="10" id="prepend_digit_<?php echo $next_idx?>" name="prepend_digit[<?php echo $next_idx?>]" class="dp-prepend dial-pattern dpt-title" value="" tabindex="<?php echo ++$tabindex;?>">) + 
    602         <input title="<?php echo $pf_tit?>" type="text" size="6" id="pattern_prefix_<?php echo $next_idx?>" name="pattern_prefix[<?php echo $next_idx?>]" class="dp-prefix dpt-title" value="" tabindex="<?php echo ++$tabindex;?>"> | 
    603         <input title="<?php echo $mp_tit?>" type="text" size="16" id="pattern_pass_<?php echo $next_idx?>" name="pattern_pass[<?php echo $next_idx?>]" class="dp-match dpt-title" value="" tabindex="<?php echo ++$tabindex;?>"> 
     605        (<input title="<?php echo $pp_tit?>" type="text" size="10" id="prepend_digit_<?php echo $next_idx?>" name="prepend_digit[<?php echo $next_idx?>]" class="dp-prepend dial-pattern dpt-title dpt-display" value="" tabindex="<?php echo ++$tabindex;?>">) + 
     606        <input title="<?php echo $pf_tit?>" type="text" size="6" id="pattern_prefix_<?php echo $next_idx?>" name="pattern_prefix[<?php echo $next_idx?>]" class="dp-prefix dpt-title dpt-display" value="" tabindex="<?php echo ++$tabindex;?>"> | 
     607        <input title="<?php echo $mp_tit?>" type="text" size="16" id="pattern_pass_<?php echo $next_idx?>" name="pattern_pass[<?php echo $next_idx?>]" class="dp-match dpt-title dpt-display" value="" tabindex="<?php echo ++$tabindex;?>"> 
    604608        <img src="images/trash.png" style="cursor:pointer; float:none; margin-left:0px; margin-bottom:-3px;" alt="<?php echo _("remove")?>" title="<?php echo _("Click here to remove this pattern")?>" onclick="patternsRemove(<?php echo _("$next_idx") ?>)"> 
    605609 
     
    918922    clearAllPatterns(); 
    919923  }); 
    920   $(".dpt-title").toggleVal({ 
     924  $(".dpt-display").toggleVal({ 
    921925    populateFrom: "title", 
    922926    changedClass: "text-normal", 
    923927    focusClass: "text-normal" 
     928  }); 
     929  $(".dpt-nodisplay").mouseover(function(){ 
     930    $(this).toggleVal({ 
     931      populateFrom: "title", 
     932      changedClass: "text-normal", 
     933      focusClass: "text-normal" 
     934    }).removeClass('dpt-nodisplay').addClass('dpt-display').unbind('mouseover'); 
    924935  }); 
    925936});  
     
    935946  var tabindex1 = tabindex + 2; 
    936947  var tabindex2 = tabindex + 3; 
    937   var dpt_prepend_digit = prepend_digit == '' ? 'dpt-title' : 'dpt-value'; 
    938   var dpt_pattern_prefix = pattern_prefix == '' ? 'dpt-title' : 'dpt-value'; 
    939   var dpt_pattern_pass = pattern_pass == '' ? 'dpt-title' : 'dpt-value'; 
     948  var dpt_title = 'dpt-title dpt-display'; 
     949  var dpt_prepend_digit = prepend_digit == '' ? dpt_title : 'dpt-value'; 
     950  var dpt_pattern_prefix = pattern_prefix == '' ? dpt_title : 'dpt-value'; 
     951  var dpt_pattern_pass = pattern_pass == '' ? dpt_title : 'dpt-value'; 
    940952 
    941953  var new_insert = $("#last_row").before('\ 
     
    960972 
    961973function clearPatterns() { 
    962   $(".dpt-title").each(function() { 
     974  $(".dpt-display").each(function() { 
    963975    if($(this).val() == $(this).data("defText")) { 
    964976      $(this).val(""); 
     
    969981 
    970982function clearAllPatterns() { 
    971   $(".dpt-value").addClass('dpt-title').removeClass('dpt-value'); 
    972   $(".dpt-title").each(function() { 
     983 
     984  $(".dpt-value").addClass('dpt-title dpt-nodisplay').removeClass('dpt-value').mouseover(function(){ 
     985    $(this).toggleVal({ 
     986      populateFrom: "title", 
     987      changedClass: "text-normal", 
     988      focusClass: "text-normal" 
     989    }).removeClass('dpt-nodisplay').addClass('dpt-display').unbind('mouseover'); 
     990  }).each(function(){ 
    973991    $(this).val(""); 
    974992  }); 
    975   $(".dpt-title").toggleVal({ 
    976     populateFrom: "title", 
    977     changedClass: "text-normal", 
    978     focusClass: "text-normal" 
    979   }); 
     993 
    980994  return true; 
    981995} 
     
    10291043    // now we have to put it back... 
    10301044    // do I have to turn it off first though? 
    1031     $(".dpt-title").each(function() { 
     1045    $(".dpt-display").each(function() { 
    10321046      if ($.trim($(this).val()) == '') { 
    10331047        $(this).toggleVal({