Changeset 6515 for extensions/rightClick


Ignore:
Timestamp:
06/10/10 21:43:05 (10 years ago)
Author:
vdigital
Message:

2.1.b fixes first release bugs:

  • Default user level is fixed
  • Default selectors review ( photoWidget could not be supported )
  • Lightbox, HD Shadowbox and akBookStyle are supported
  • Merge of selectors ( default and customized ) is fixed
  • jQuery generated has been reviewed and simplified
Location:
extensions/rightClick
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/rightClick/language/en_UK/description.txt

    r6502 r6515  
    11rightClick deactivates the context menu on websized pictures and more. 
    2 Picture page, akBookStyle, Lightbox, HD Shadowbox and photoWidget are protected by default. 
    3 Other valid jQuery selectors could be added to the default list. 
     2Picture page, akBookStyle, Lightbox and HD Shadowbox are protected by default. 
    43By default, webmaster and administors keep the right-click available. 
    54 
    6 Context menus are disable on main browsers.  
    7 Please, remind that rightClick is not a full secured solution against image copy.  
     5Please, remind that rightClick is not a full secured solution against image copy. 
  • extensions/rightClick/language/fr_FR/description.txt

    r6502 r6515  
    11rightClick désactive le menu contextuel sur les images de taille web et plus encore. 
    2 La page Picture, akBookStyle, Lightbox, HD Shadowbox et photoWidget sont protégés par défaut. 
    3 Tout autre selecteur jQuery valide pourrait être ajouté à cette liste par défaut. 
     2La page Picture, akBookStyle, Lightbox et HD Shadowbox sont protégés par défaut. 
    43Par défaut encore, le webmaster et les administeurs conservent l'usage du clic-droit. 
    54 
    6 Les menus contextuels sont désactivés sur les principaux navigateurs.  
    75Merci de garder à l'esprit que rightClick n'est pas une sécurité totale contre la copie des images.  
  • extensions/rightClick/main.inc.php

    r6502 r6515  
    22/* 
    33Plugin Name: rightClick 
    4 Version: 2.1.a 
     4Version: 2.1.b 
    55Description: rightClick deactivates the context menu on websized pictures and more.  
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=401 
     
    1212define('RIGHTCK_DIR' , basename(dirname(__FILE__))); 
    1313define('RIGHTCK_PATH' , PHPWG_PLUGINS_PATH . RIGHTCK_DIR . '/'); 
    14 define('RIGHTCK_VER' , '2.1.a'); 
     14define('RIGHTCK_VER' , '2.1.b'); 
    1515include_once( RIGHTCK_PATH . 'rightClick_protect.php'); 
    1616?> 
  • extensions/rightClick/rightClick_protect.php

    r6502 r6515  
    99        function  rightClick_protect() { 
    1010                global $template, $user, $conf; 
    11                 if (!isset($conf['rightClick_level'])) list ($Maxlvl) = array_slice($conf['available_permission_levels'],-1); 
     11                if (!isset($conf['rightClick_level'])) $Maxlvl = max($conf['available_permission_levels']); 
    1212                else $Maxlvl = $conf['rightClick_level']; 
    1313                if ($user['level'] >= $Maxlvl) return; 
    14                 $default = array( '#theImage img', '#photoWidget', 'img#akPicture', 'img#cboxPhoto', 'img#sb-body-inner', ); 
     14                $default = array( '#theImage img', '#akPicture', '#colorbox', '#sb-container', ); 
    1515                if (!isset($conf['rightClick_selectors'])) $conf['rightClick_selectors'] = array(); 
    16                 $conf['rightClick_selectors'] = array_unique( $default + $conf['rightClick_selectors'] ); 
     16                $conf['rightClick_selectors'] = array_unique( array_merge($default, $conf['rightClick_selectors']) ); 
    1717                 
    1818                $template->set_filenames(array( 
  • extensions/rightClick/template/rightClick_protect.tpl

    r6502 r6515  
    11{known_script id="jquery" src=$ROOT_URL|cat:"themes/default/js/jquery.packed.js"} 
    22{html_head} 
    3 <!-- Provided information by the "rightClick" plugin (version {$RIGHTCK.Version}): {$RIGHTCK.Dir}/template/rightClick_protect.tpl --> 
     3<!-- Protected images by the "rightClick" plugin (version {$RIGHTCK.Version}): {$RIGHTCK.Dir}/template/rightClick_protect.tpl --> 
    44<script type="text/javascript"> 
    5 jQuery.noConflict(); 
    6 jQuery(document).ready(function($) {*Smarty*}{ldelim} 
    7 {*Smarty*}{foreach item=selector from=$RIGHTCK.Selectors name=select} 
    8         $({*Smarty*}'{$selector}').addClass('rightClick'); 
    9 {*Smarty*}{/foreach} 
    10         $(".rightClick").each( function() {*Smarty*}{ldelim} 
    11                 $(this)[0].oncontextmenu = function() {*Smarty*}{ldelim} 
     5jQuery(document).ready(function($) {ldelim} 
     6{foreach item=selector from=$RIGHTCK.Selectors name=select} 
     7        $('{$selector}').each( function() {ldelim} 
     8                $(this)[0].oncontextmenu = function() {ldelim} 
    129                        return false; 
    1310                } 
    14         }); 
     11        });      
     12{/foreach} 
    1513}); 
    1614</script>   
Note: See TracChangeset for help on using the changeset viewer.