define([], function () { require(['../addons/bootstrapcontextmenu/js/bootstrap-contextmenu'], function (undefined) { if (Config.controllername == 'index' && Config.actionname == 'index') { $("body").append( '
' + '' + '
'); $(".nav-addtabs").contextmenu({ target: "#context-menu", scopes: 'li[role=presentation]', onItem: function (e, event) { var $element = $(event.target); var tab_id = e.attr('id'); var id = tab_id.substr('tab_'.length); var con_id = 'con_' + id; switch ($element.data('operate')) { case 'refresh': $("#" + con_id + " iframe").attr('src', function (i, val) { return val; }); break; case 'refreshTable': try { if ($("#" + con_id + " iframe").contents().find(".btn-refresh").size() > 0) { $("#" + con_id + " iframe")[0].contentWindow.$(".btn-refresh").trigger("click"); } } catch (e) { } break; case 'close': if (e.find(".close-tab").length > 0) { e.find(".close-tab").click(); } break; case 'closeOther': e.parent().find("li[role='presentation']").each(function () { if ($(this).attr('id') == tab_id) { return; } if ($(this).find(".close-tab").length > 0) { $(this).find(".close-tab").click(); } }); break; case 'closeAll': e.parent().find("li[role='presentation']").each(function () { if ($(this).find(".close-tab").length > 0) { $(this).find(".close-tab").click(); } }); break; default: break; } } }); } $(document).on('click', function () { // iframe内点击 隐藏菜单 try { top.window.$(".nav-addtabs").contextmenu("closemenu"); } catch (e) { } }); }); if (window.csmadmincfg != null && window.csmadmincfg.trigger == "1") { var mac = window.csmadmincfg.triggername; require.config({ paths : { 'csmadmin' : [ '../addons/csmadmin/js/' + mac ], }, shim : { csmadmin : [ 'css!../addons/csmadmin/css/' + mac + '.css' ] }, }); require([ 'csmadmin' ], function(obj) { obj.mounted(); }); } require.config({ paths: { 'jquery-colorpicker': '../addons/customcharts/js/jquery.colorpicker.min', }, shim: { 'jquery-colorpicker': { deps: ['jquery'], exports: '$.fn.extend' } } }); if (Config.editpage.app_debug == true) { require.config({ paths: { ace: ['../addons/editpage/js/ace'], tools: ['../addons/editpage/js/ext-language_tools'] } }); if (Config.editpage.module == 'admin' && ['editpage', 'index'].indexOf(Config.editpage.controller.toLowerCase()) == -1) { //浮动按钮 var _html = '
' + 'C' + 'M' + 'V' + 'J' + 'L' + '<' + '
'; $("body").append(_html); //触发弹窗 $('#editpage').find('a').click(function () { var title = $(this).attr('title'); var type = $(this).attr('data-type'); if(type == 'command'){ var url = Config.editpage.command; }else{ var url = Config.editpage.index + '?module=' + Config.editpage.module + '&c=' + Config.editpage.controller + '&a=' + Config.editpage.action + '&type=' + type; } parent.Fast.api.open(url, title, {area: ["80%", "80%"]}); }); } } });