Changeset 2700 for trunk/template/yoga


Ignore:
Timestamp:
Oct 10, 2008, 3:11:31 PM (16 years ago)
Author:
rvelices
Message:
  • replace a preg_match with simple comparison (faster)
  • try to get rid of some JS strict warnings in FF (hope it's fixed)
  • template.class.php is included from functions.inc.php instead of common,upgrade,install (maybe later I will try to see the perf impact of compacting/compiling functions.inc.php together with the included files from itself)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/template/yoga/picture_nav_buttons.tpl

    r2478 r2700  
    6363  </div>
    6464
    65 <script type="text/javascript">
     65<script type="text/javascript">// <![CDATA[
    6666{literal}
    6767function keyboardNavigation(e)
    6868{
    69   if(!e) var e=window.event;
    70   if (e.altKey) return true;
    71   var target = e.target || e.srcElement;
    72   if (target && target.type) return true; //an input editable element
    73   var keyCode=e.keyCode || e.which;
    74   var docElem = document.documentElement;
    75   switch(keyCode) {
     69        if(!e) e=window.event;
     70        if (e.altKey) return true;
     71        var target = e.target || e.srcElement;
     72        if (target && target.type) return true; //an input editable element
     73        var keyCode=e.keyCode || e.which;
     74        var docElem = document.documentElement;
     75        switch(keyCode) {
    7676{/literal}
    7777{if isset($next)}
    78   case 63235: case 39: if (e.ctrlKey || docElem.scrollLeft==docElem.scrollWidth-docElem.clientWidth ){ldelim}window.location="{$next.U_IMG}".replace( "&amp;", "&" ); return false; } break;
     78        case 63235: case 39: if (e.ctrlKey || docElem.scrollLeft==docElem.scrollWidth-docElem.clientWidth ){ldelim}window.location="{$next.U_IMG}".replace( "&amp;", "&" ); return false; } break;
    7979{/if}
    8080{if isset($previous)}
    81   case 63234: case 37: if (e.ctrlKey || docElem.scrollLeft==0){ldelim}window.location="{$previous.U_IMG|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
     81        case 63234: case 37: if (e.ctrlKey || docElem.scrollLeft==0){ldelim}window.location="{$previous.U_IMG|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
    8282{/if}
    8383{if isset($first)}
    84   /*Home*/case 36: if (e.ctrlKey){ldelim}window.location="{$first.U_IMG|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
     84        /*Home*/case 36: if (e.ctrlKey){ldelim}window.location="{$first.U_IMG|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
    8585{/if}
    8686{if isset($last)}
    87   /*End*/case 35: if (e.ctrlKey){ldelim}window.location="{$last.U_IMG|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
     87        /*End*/case 35: if (e.ctrlKey){ldelim}window.location="{$last.U_IMG|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
    8888{/if}
    8989{if isset($U_UP) and !isset($slideshow)}
    90   /*Up*/case 38: if (e.ctrlKey){ldelim}window.location="{$U_UP|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
     90        /*Up*/case 38: if (e.ctrlKey){ldelim}window.location="{$U_UP|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
    9191{/if}
    9292
    9393{if isset($slideshow.U_START_PLAY)}
    94   /*Pause*/case 32: {ldelim}window.location="{$slideshow.U_START_PLAY|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
     94        /*Pause*/case 32: {ldelim}window.location="{$slideshow.U_START_PLAY|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
    9595{/if}
    9696{if isset($slideshow.U_STOP_PLAY)}
    97   /*Play*/case 32: {ldelim}window.location="{$slideshow.U_STOP_PLAY|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
     97        /*Play*/case 32: {ldelim}window.location="{$slideshow.U_STOP_PLAY|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
    9898{/if}
    99   }
    100   return true;
     99        }
     100        return true;
    101101}
    102102document.onkeydown=keyboardNavigation;
    103 </script>
     103// ]]></script>
Note: See TracChangeset for help on using the changeset viewer.