From: naoki hirata Date: Wed, 8 Jan 2014 12:41:51 +0000 (+0900) Subject: コンテキストメニュー用のjQueryプラグインのパックなし版を追加。 X-Git-Tag: v2.7.24~1 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2d2696dd00428d1c5dc796cfee29c148a4e5f9bb;p=magic3%2Fmagic3.git コンテキストメニュー用のjQueryプラグインのパックなし版を追加。 --- diff --git a/include/common/scriptLibInfo.php b/include/common/scriptLibInfo.php index 326642cf..96ed37ef 100644 --- a/include/common/scriptLibInfo.php +++ b/include/common/scriptLibInfo.php @@ -124,7 +124,8 @@ class ScriptLibInfo const JQUERY_EASING_FILENAME = 'jquery/jquery.easing.1.3.js'; //const JQUERY_JCAROUSEL_FILENAME = 'jquery/jquery.jcarousel.0.2.4.min.js'; // jQuery1.4.2対応版 const JQUERY_JCAROUSEL_FILENAME = 'jquery/jquery.jcarousel.0.2.8.min.js'; // jQuery1.4.2対応版 - const JQUERY_CONTEXTMENU_FILENAME = 'jquery/jquery.contextmenu.r2.packed.js'; +// const JQUERY_CONTEXTMENU_FILENAME = 'jquery/jquery.contextmenu.r2.packed.js'; + const JQUERY_CONTEXTMENU_FILENAME = 'jquery/jquery.contextmenu.r2.js'; const JQUERY_THICKBOX_FILENAME = 'jquery/thickbox3.1.js'; const JQUERY_THICKBOX_CSS = 'jquery/thickbox.css'; // const JQUERY_JSHOTKEYS_FILENAME = 'jquery/jquery.hotkeys.js'; diff --git a/include/manager/pageManager.php b/include/manager/pageManager.php index fae4a395..62e416d9 100644 --- a/include/manager/pageManager.php +++ b/include/manager/pageManager.php @@ -2075,7 +2075,7 @@ class PageManager extends Core // ヘルプシステムはすべての初期処理完了後に実行する // ヘルプシステムは、「span」タグで埋め込み、「title」属性を使用する if ($this->useHelp){ // ヘルプ表示のとき - $initScript .= M3_INDENT_SPACE . '$(\'span.m3help\').cluetip({splitTitle: \'|\'});' . M3_NL; + $initScript .= M3_INDENT_SPACE . '$(\'span.m3help\').cluetip({splitTitle: \'|\', cluezIndex: 2000});' . M3_NL; } else { // ヘルプ非表示のときは、title属性をクリアする $initScript .= M3_INDENT_SPACE . '$(\'span.m3help\').attr(\'title\', \'\');' . M3_NL; } diff --git a/scripts/jquery/jquery.contextmenu.r2.js b/scripts/jquery/jquery.contextmenu.r2.js new file mode 100644 index 00000000..779578f5 --- /dev/null +++ b/scripts/jquery/jquery.contextmenu.r2.js @@ -0,0 +1,144 @@ +/* + * ContextMenu - jQuery plugin for right-click context menus + * + * Author: Chris Domigan + * Contributors: Dan G. Switzer, II + * Parts of this plugin are inspired by Joern Zaefferer's Tooltip plugin + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * Version: r2 + * Date: 16 July 2007 + * + * For documentation visit http://www.trendskitchens.co.nz/jquery/contextmenu/ + * + */ + +(function($) { + + var menu, shadow, trigger, content, hash, currentTarget; + var defaults = { + menuStyle: { + listStyle: 'none', + padding: '1px', + margin: '0px', + backgroundColor: '#fff', + border: '1px solid #999', + width: '100px' + }, + itemStyle: { + margin: '0px', + color: '#000', + display: 'block', + cursor: 'default', + padding: '3px', + border: '1px solid #fff', + backgroundColor: 'transparent' + }, + itemHoverStyle: { + border: '1px solid #0a246a', + backgroundColor: '#b6bdd2' + }, + eventPosX: 'pageX', + eventPosY: 'pageY', + shadow : true, + onContextMenu: null, + onShowMenu: null + }; + + $.fn.contextMenu = function(id, options) { + if (!menu) { // Create singleton menu + menu = $('
') + .hide() + .css({position:'absolute', zIndex:'500'}) + .appendTo('body') + .bind('click', function(e) { + e.stopPropagation(); + }); + } + if (!shadow) { + shadow = $('
') + .css({backgroundColor:'#000',position:'absolute',opacity:0.2,zIndex:499}) + .appendTo('body') + .hide(); + } + hash = hash || []; + hash.push({ + id : id, + menuStyle: $.extend({}, defaults.menuStyle, options.menuStyle || {}), + itemStyle: $.extend({}, defaults.itemStyle, options.itemStyle || {}), + itemHoverStyle: $.extend({}, defaults.itemHoverStyle, options.itemHoverStyle || {}), + bindings: options.bindings || {}, + shadow: options.shadow || options.shadow === false ? options.shadow : defaults.shadow, + onContextMenu: options.onContextMenu || defaults.onContextMenu, + onShowMenu: options.onShowMenu || defaults.onShowMenu, + eventPosX: options.eventPosX || defaults.eventPosX, + eventPosY: options.eventPosY || defaults.eventPosY + }); + + var index = hash.length - 1; + $(this).bind('contextmenu', function(e) { + // Check if onContextMenu() defined + var bShowContext = (!!hash[index].onContextMenu) ? hash[index].onContextMenu(e) : true; + if (bShowContext) display(index, this, e, options); + return false; + }); + return this; + }; + + function display(index, trigger, e, options) { + var cur = hash[index]; + content = $('#'+cur.id).find('ul:first').clone(true); + content.css(cur.menuStyle).find('li').css(cur.itemStyle).hover( + function() { + $(this).css(cur.itemHoverStyle); + }, + function(){ + $(this).css(cur.itemStyle); + } + ).find('img').css({verticalAlign:'middle',paddingRight:'2px'}); + + // Send the content to the menu + menu.html(content); + + // if there's an onShowMenu, run it now -- must run after content has been added + // if you try to alter the content variable before the menu.html(), IE6 has issues + // updating the content + if (!!cur.onShowMenu) menu = cur.onShowMenu(e, menu); + + $.each(cur.bindings, function(id, func) { + $('#'+id, menu).bind('click', function(e) { + hide(); + func(trigger, currentTarget); + }); + }); + + menu.css({'left':e[cur.eventPosX],'top':e[cur.eventPosY]}).show(); + if (cur.shadow) shadow.css({width:menu.width(),height:menu.height(),left:e.pageX+2,top:e.pageY+2}).show(); + $(document).one('click', hide); + } + + function hide() { + menu.hide(); + shadow.hide(); + } + + // Apply defaults + $.contextMenu = { + defaults : function(userDefaults) { + $.each(userDefaults, function(i, val) { + if (typeof val == 'object' && defaults[i]) { + $.extend(defaults[i], val); + } + else defaults[i] = val; + }); + } + }; + +})(jQuery); + +$(function() { + $('div.contextMenu').hide(); +}); \ No newline at end of file