Changeset 2207 for branches/branch-1_7


Ignore:
Timestamp:
Feb 13, 2008, 2:25:07 AM (17 years ago)
Author:
rvelices
Message:

merge revisions 2205 and 2206 from trunk to branch-1_7
feature 803: Implement keyboard navigation (left/right arrows) on the picture page
fix: non-image elements without representative and without mime type icon default to thumbnail if possible

Location:
branches/branch-1_7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1_7/include/functions_picture.inc.php

    r1903 r2207  
    150150      $path = get_themeconf('mime_icon_dir');
    151151      $path.= strtolower($ext).'.png';
     152      if ( !file_exists(PHPWG_ROOT_PATH.$path)
     153          and !empty($element_info['tn_ext']) )
     154      {
     155        $path = get_thumbnail_location($element_info);
     156      }
    152157    }
    153158
  • branches/branch-1_7/template/yoga/picture.tpl

    r1965 r2207  
    213213</div>
    214214<!-- END comments -->
     215
     216<script type="text/javascript">
     217<!-- BEGIN next -->
     218var nextUrl = "{next.U_IMG}".replace( "&amp;", "&" );
     219<!-- END next -->
     220<!-- BEGIN previous -->
     221var prevUrl = "{previous.U_IMG}".replace( "&amp;", "&" );
     222<!-- END previous -->
     223function keypress(e)
     224{
     225    if(!e) var e=window.event;
     226    if (e.altKey) return true;
     227    var target = e.target || e.srcElement;
     228    if (target && target.type) return true; //an input editable element
     229    var keyCode=e.keyCode || e.which;
     230    var docElem = document.documentElement;
     231    switch(keyCode) {
     232        case 63235: case 39: if (nextUrl && (e.ctrlKey || docElem.scrollLeft==docElem.scrollWidth-docElem.clientWidth) ){window.location=nextUrl; return false; } break;
     233        case 63234: case 37: if (prevUrl && (e.ctrlKey || docElem.scrollLeft==0) ){ window.location=prevUrl; return false; } break;
     234    }
     235    return true;
     236}
     237document.onkeydown = keypress;
     238</script>
Note: See TracChangeset for help on using the changeset viewer.