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); $('\ -
    \ -

    \ -
    \ -
    \ -
    \ -
    \ - '); - + $msgBox.html('

    '); $("body").append($msgBox); $msgBox.find("._ok").click(function(){ $.xeMsgBox.fnOnOK(); @@ -1119,13 +1108,13 @@ jQuery(function($){ } $msgBox.show(); - } + }; $.xeMsgBox.alertDialog = function(htOptions){ htOptions = htOptions || {}; htOptions.bAlert = true; this.showMsgBox(htOptions); - } + }; $.xeMsgBox.alert = function(sText){ htOptions = { bAlert : true, @@ -1135,13 +1124,13 @@ jQuery(function($){ }; this.showMsgBox(htOptions); - } + }; $.xeMsgBox.confirmDialog = function(htOptions){ htOptions = htOptions || {}; htOptions.bAlert = false; this.showMsgBox(htOptions); - } + }; var $foggyLayer = $.xeMsgBox.$foggyLayer = $("
    "); $foggyLayer.css({ @@ -1168,16 +1157,16 @@ jQuery(function($){ height: $(document).height() }); }, 0); - } + }; $(window).resize($.xeMsgBox._resizeFoggy); $.xeMsgBox._resizeFoggy(); $.xeMsgBox._showFoggy = function(){ $foggyLayer.show(); - } + }; $.xeMsgBox._hideFoggy = function(){ $foggyLayer.hide(); - } + }; }); jQuery(function($){ @@ -1207,7 +1196,7 @@ jQuery(function($){ height: $(document).height() }); }, 0); - } + }; $(window).resize($.xeFoggy._resizeFoggy); $.xeFoggy._resizeFoggy(); @@ -1222,10 +1211,10 @@ jQuery(function($){ }); } $foggyLayer.show(); - } + }; $.xeFoggy.hide = function(){ $foggyLayer.hide(); - } + }; }); // Sortable table @@ -1280,7 +1269,7 @@ jQuery(function($){ .addClass('draggable') .css({ position: 'absolute', - opacity : .6, + opacity : 0.6, width : width, height : height, left : offset.left, @@ -1292,7 +1281,7 @@ jQuery(function($){ $holder .css({ position:'absolute', - opacity : .6, + opacity : 0.6, width : width, height : '10px', left : offset.left, @@ -1303,7 +1292,7 @@ jQuery(function($){ }) .appendTo($table); - $tr.css('opacity', .6); + $tr.css('opacity', 0.6); $(document) .unbind('mousedown.st mouseup.st') @@ -1349,7 +1338,7 @@ jQuery(function($){ $table.trigger('after-drag.st'); }); - }) + }); return this; }; @@ -1374,7 +1363,7 @@ jQuery(function($){ $list.find('.select') .bind('click', function(event){ var selectedImages = $('input.select_checkbox:checked'); - if(selectedImages.length == 0) { + if(selectedImages.length === 0) { var selectedImgSrc = $(this).closest('tr').find('img.filebox_item').attr('src'); if(!selectedImgSrc){ alert("None selected!"); @@ -1423,8 +1412,8 @@ jQuery(function($){ var detailBtn = $('.x .dsTg .__detail'); var tdTitle = $('.x .dsTg td.title'); tdTitle.each(function(){ - var $t = $(this) - if($t.find('p.x_alert').length==0){ + var $t = $(this); + if($t.find('p.x_alert').length === 0){ $t.addClass('tg').find('>*:not(:first-child)').hide(); } }); @@ -1838,7 +1827,7 @@ jQuery(function($){ }, on_complete); return this; - } + }; }); // Apply Multilingual UI @@ -1872,13 +1861,15 @@ jQuery(function($){ function makeUI(){ var $multilingualWindow = $('#g11n'); var width = $this.width(); + var $displayInput; if(t.tagName == 'TEXTAREA' || $this.data('type') == 'textarea'){ - var $displayInput = $('