diff --git a/Gruntfile.js b/Gruntfile.js index 5f88aad4e..9a124b940 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -68,8 +68,12 @@ module.exports = function(grunt) { 'modules/admin/tpl/js/admin.min.js': ['modules/admin/tpl/js/admin.js'], 'modules/admin/tpl/js/config.min.js': ['modules/admin/tpl/js/config.js'], 'modules/admin/tpl/js/menu_setup.min.js': ['modules/admin/tpl/js/menu_setup.js'], - 'modules/admin/tpl/js/sitemap.min.js': ['modules/admin/tpl/js/sitemap.js'], - 'modules/admin/tpl/js/theme.min.js': ['modules/admin/tpl/js/theme.js'], + //module/board + 'modules/board/tpl/js/board.min.js': ['modules/board/tpl/js/board.js'], + 'modules/board/tpl/js/board_admin.min.js': ['modules/board/tpl/js/board_admin.js'], + 'modules/board/skins/default/board.default.min.js': ['modules/board/skins/default/board.default.js'], + 'modules/board/m.skins/default/js/mboard.min.js': ['modules/board/m.skins/default/js/mboard.js'], + 'modules/board/m.skins/simpleGray/js/mboard.min.js': ['modules/board/m.skins/simpleGray/js/mboard.js'], // editor-component-multimedia-link 'modules/editor/components/multimedia_link/tpl/popup.min.js': ['modules/editor/components/multimedia_link/tpl/popup.js'], // editor-component-image-gallery @@ -90,25 +94,6 @@ module.exports = function(grunt) { 'addons/oembed/oembed.min.js': ['addons/oembed/oembed.js'], } }, - 'module-board': { - 'common': { - files: { - 'modules/board/tpl/js/board.min.js': ['modules/board/tpl/js/board.js'], - 'modules/board/tpl/js/board_admin.min.js': ['modules/board/tpl/js/board_admin.js'] - } - }, - 'skin': { - files: { - 'modules/board/skins/default/board.default.min.js': ['modules/board/skins/default/board.default.js'], - } - }, - 'm.skin': { - files: { - 'modules/board/m.skins/default/js/mboard.min.js': ['modules/board/m.skins/default/js/mboard.js'], - 'modules/board/m.skins/simpleGray/js/mboard.min.js': ['modules/board/m.skins/simpleGray/js/mboard.js'] - } - }, - } }, cssmin: { 'common-css': { @@ -156,26 +141,22 @@ module.exports = function(grunt) { } }, 'module-board': { - 'skin': { - files: { - 'modules/board/skins/default/board.default.min.css': ['modules/board/skins/default/board.default.css'], - } - }, - 'm.skin': { - files: { - 'modules/board/m.skins/default/css/mboard.min.css': ['modules/board/m.skins/default/css/mboard.css'], - 'modules/board/m.skins/simpleGray/css/mboard.min.css': ['modules/board/m.skins/simpleGray/css/mboard.css'] - } - }, + files: { + 'modules/board/skins/default/board.default.min.css': ['modules/board/skins/default/board.default.css'], + 'modules/board/m.skins/default/css/mboard.min.css': ['modules/board/m.skins/default/css/mboard.css'], + 'modules/board/m.skins/simpleGray/css/mboard.min.css': ['modules/board/m.skins/simpleGray/css/mboard.css'] + } } }, jshint: { files: [ 'Gruntfile.js', 'common/js/*.js', '!common/js/html5.js', '!common/js/jquery.js', '!common/js/x.js', '!common/js/xe.js', + 'modules/admin/tpl/js/*.js', 'modules/board/tpl/js/*.js', - 'modules/widget/tpl/js/*.js', 'modules/editor/tpl/js/*.js', + 'modules/menu/tpl/js/*.js', + 'modules/widget/tpl/js/*.js', ], options : { globalstrict: false, diff --git a/modules/admin/tpl/js/admin.js b/modules/admin/tpl/js/admin.js index 2384aefca..d17301ec9 100644 --- a/modules/admin/tpl/js/admin.js +++ b/modules/admin/tpl/js/admin.js @@ -1,21 +1,21 @@ /* NAVER (developers@xpressengine.com) */ // install module function doInstallModule(module) { - var params = new Array(); - params['module_name'] = module; - exec_xml('install','procInstallAdminInstall',params, completeInstallModule); + var params = []; + params.module_name = module; + exec_xml('install','procInstallAdminInstall',params, completeInstallModule); } // upgrade module function doUpdateModule(module) { - var params = new Array(); - params['module_name'] = module; - exec_xml('install','procInstallAdminUpdate',params, completeInstallModule); + var params = []; + params.module_name = module; + exec_xml('install','procInstallAdminUpdate',params, completeInstallModule); } function completeInstallModule(ret_obj) { - alert(ret_obj['message']); - location.reload(); + alert(ret_obj.message); + location.reload(); } jQuery(function($){ @@ -73,7 +73,8 @@ jQuery(function($){ }); }); $('.x .x_tab-content>.x_tab-pane:not(".x_active")').hide(); - } + }; + $('.x .x_tabbable').xeTabbable(); $(document.body).on('click', '.x .x_nav-tabs>li>a[href^="#"]', function(){ var $this = $(this); @@ -337,7 +338,7 @@ jQuery(function($){ // Modal Window jQuery(function($){ var ESC = 27; - var xeModalStack = new Array(); + var xeModalStack = []; var xeModalInitailZIndex = 1040; // modal backdrop @@ -376,8 +377,8 @@ jQuery(function($){ if(!$modal.parent('body').length) { $btnClose = $(''); - $btnClose.click(function(){ $modal.data('anchor').trigger('close.mw') }); - $modal.find('[data-hide]').click(function(){ $modal.data('anchor').trigger('close.mw') }); + $btnClose.click(function(){ $modal.data('anchor').trigger('close.mw'); }); + $modal.find('[data-hide]').click(function(){ $modal.data('anchor').trigger('close.mw'); }); $('body').append($modal); $modal.prepend($btnClose); // prepend close button } @@ -399,7 +400,7 @@ jQuery(function($){ $modal.data('state', 'showing'); // after event trigger - function after(){ $this.trigger('after-open.mw') }; + function after(){ $this.trigger('after-open.mw'); } $(document).bind('keydown.mw', function(event){ if(event.which == ESC) { @@ -448,7 +449,7 @@ jQuery(function($){ $modal.data('state', 'hiding'); // after event trigger - function after(){ $this.trigger('after-close.mw') }; + function after(){ $this.trigger('after-close.mw'); } $modal.fadeOut(duration, after); $('body').css('overflow','auto'); @@ -487,7 +488,7 @@ jQuery(function($){ $layer.hide() .not('.xe-toggling-content') .addClass('xe-toggling-content') - .mousedown(function(event){ dont_close_this_time = true }) + .mousedown(function(event){ dont_close_this_time = true; }) .focusout(function(event){ setTimeout(function(){ if(!dont_close_this_time && !$layer.find(':focus').length && $layer.data('state') == 'showing') $anchor.trigger('close.tc'); @@ -552,7 +553,7 @@ jQuery(function($){ ); // triggering after - function trigger_after(){ $this.trigger('after-open.tc') } + function trigger_after(){ $this.trigger('after-open.tc'); } switch(effect) { case 'slide': @@ -595,7 +596,7 @@ jQuery(function($){ $this.trigger('before-close.tc'); // triggering after - function trigger_after(){ $this.trigger('after-close.tc') }; + function trigger_after(){ $this.trigger('after-close.tc'); } // close this layer switch(effect) { @@ -649,7 +650,7 @@ jQuery(function($){ $li = $('
').appendTo($ul); $('').text(list[i].domain).data('site_srl', list[i].site_srl).appendTo($li); } - }; + } $.exec_json('admin.getSiteAllList', {domain:val}, on_complete); }) @@ -680,7 +681,7 @@ jQuery(function($){ }) .trigger('show'); } - }; + } $finder.find('a.tgAnchor.findsite').trigger('close.tc'); @@ -758,6 +759,7 @@ jQuery(function($){ var sDomain; var rxFilter = new RegExp(sFilter, "ig"); var list = aSiteListData; + var replaceHighlight = function(sKeyword){ return ''+sKeyword+''; }; $siteList.empty(); @@ -765,9 +767,8 @@ jQuery(function($){ sDomain = list[i].domain; if(sFilter){ if(!sDomain.match(rxFilter)) continue; - sDomain = sDomain.replace(rxFilter, function(sKeyword){ - return ''+sKeyword+''; - }); + + sDomain = sDomain.replace(rxFilter, replaceHighlight); } $li = $('').appendTo($siteList); @@ -814,7 +815,7 @@ jQuery(function($){ setSiteList($siteFinder.val()); $siteFinder.focus(); - }; + } $siteList.empty(); $instanceList.empty(); @@ -849,7 +850,7 @@ jQuery(function($){ $siteList.find('li').removeClass('x_active'); $this.parent('li').addClass('x_active'); - }; + } $moduleList.empty(); $instanceListDiv.hide(); @@ -948,7 +949,7 @@ jQuery(function($){ }); return this; - } + }; }); jQuery(function($){ @@ -969,7 +970,7 @@ jQuery(function($){ } return _hide.apply(this, arguments); - } + }; var _show = $.fn.show; $.fn.show = function(speed, easing, callback, htOpt) { @@ -989,11 +990,10 @@ jQuery(function($){ var $this = $(this); // elem. display not yet... using setTimeout... - setTimeout(function(){$this.trigger('after-show', [htOpt]) }, 0); + setTimeout(function(){$this.trigger('after-show', [htOpt]); }, 0); return rst; - } - + }; }); jQuery(function($){ @@ -1003,18 +1003,7 @@ jQuery(function($){ //xe.cmd_cancel = "{$lang->cmd_cancel}"; //xe.cmd_confirm = "{$lang->cmd_confirm}"; var $msgBox = $.xeMsgBox.$msgBox = $("").addClass("x_modal _common x").hide().css('z-index', 9999); - $msgBox.html('\ -