更换后台UI,使用adminlteUI
This commit is contained in:
261
public/static/admin/js/backend.js
Normal file
261
public/static/admin/js/backend.js
Normal file
@@ -0,0 +1,261 @@
|
||||
define(['jquery', 'sent', 'adminlte'], function($, sent, AdminLTE){
|
||||
//Create the new tab
|
||||
var tab_pane = $("<div />", {
|
||||
"id": "control-sidebar-theme-demo-options-tab",
|
||||
"class": "tab-pane active"
|
||||
});
|
||||
|
||||
//Create the tab button
|
||||
var tab_button = $("<li />", {"class": "active"})
|
||||
.html("<a href='#control-sidebar-theme-demo-options-tab' data-toggle='tab'>"
|
||||
+ "<i class='fa fa-wrench'></i>"
|
||||
+ "</a>");
|
||||
|
||||
//Create the menu
|
||||
var demo_settings = $("<div />");
|
||||
|
||||
//Layout options
|
||||
demo_settings.append(
|
||||
"<h4 class='control-sidebar-heading'>"
|
||||
+ "布局配置"
|
||||
+ "</h4>"
|
||||
//Fixed layout
|
||||
+ "<div class='form-group'>"
|
||||
+ "<label class='control-sidebar-subheading'>"
|
||||
+ "<input type='checkbox' data-layout='fixed' class='pull-right'/> "
|
||||
+ "固定布局"
|
||||
+ "</label>"
|
||||
+ "</div>"
|
||||
//Boxed layout
|
||||
+ "<div class='form-group'>"
|
||||
+ "<label class='control-sidebar-subheading'>"
|
||||
+ "<input type='checkbox' data-layout='layout-boxed'class='pull-right'/> "
|
||||
+ "盒式布局"
|
||||
+ "</label>"
|
||||
+ "</div>"
|
||||
//Sidebar Toggle
|
||||
+ "<div class='form-group'>"
|
||||
+ "<label class='control-sidebar-subheading'>"
|
||||
+ "<input type='checkbox' data-layout='sidebar-collapse' class='pull-right'/> "
|
||||
+ "切换边栏"
|
||||
+ "</label>"
|
||||
+ "</div>"
|
||||
//Sidebar mini expand on hover toggle
|
||||
+ "<div class='form-group'>"
|
||||
+ "<label class='control-sidebar-subheading'>"
|
||||
+ "<input type='checkbox' data-enable='expandOnHover' class='pull-right'/> "
|
||||
+ "悬停边栏展开"
|
||||
+ "</label>"
|
||||
+ "</div>"
|
||||
//Control Sidebar Skin Toggle
|
||||
+ "<div class='form-group'>"
|
||||
+ "<label class='control-sidebar-subheading'>"
|
||||
+ "<input type='checkbox' data-sidebarskin='toggle' class='pull-right'/> "
|
||||
+ "切换右侧边栏皮肤"
|
||||
+ "</label>"
|
||||
+ "</div>"
|
||||
);
|
||||
var skins_list = $("<ul />", {"class": 'list-unstyled clearfix'});
|
||||
|
||||
//Dark sidebar skins
|
||||
var skin_blue =
|
||||
$("<li />", {style: "float:left; width: 33.33333%; padding: 5px;"})
|
||||
.append("<a href='javascript:void(0);' data-skin='skin-blue' style='display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)' class='clearfix full-opacity-hover'>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 7px; background: #367fa9;'></span><span class='bg-light-blue' style='display:block; width: 80%; float: left; height: 7px;'></span></div>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 20px; background: #222d32;'></span><span style='display:block; width: 80%; float: left; height: 20px; background: #f4f5f7;'></span></div>"
|
||||
+ "</a>"
|
||||
+ "<p class='text-center no-margin'>蓝色</p>");
|
||||
skins_list.append(skin_blue);
|
||||
var skin_black =
|
||||
$("<li />", {style: "float:left; width: 33.33333%; padding: 5px;"})
|
||||
.append("<a href='javascript:void(0);' data-skin='skin-black' style='display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)' class='clearfix full-opacity-hover'>"
|
||||
+ "<div style='box-shadow: 0 0 2px rgba(0,0,0,0.1)' class='clearfix'><span style='display:block; width: 20%; float: left; height: 7px; background: #fefefe;'></span><span style='display:block; width: 80%; float: left; height: 7px; background: #fefefe;'></span></div>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 20px; background: #222;'></span><span style='display:block; width: 80%; float: left; height: 20px; background: #f4f5f7;'></span></div>"
|
||||
+ "</a>"
|
||||
+ "<p class='text-center no-margin'>黑色</p>");
|
||||
skins_list.append(skin_black);
|
||||
var skin_purple =
|
||||
$("<li />", {style: "float:left; width: 33.33333%; padding: 5px;"})
|
||||
.append("<a href='javascript:void(0);' data-skin='skin-purple' style='display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)' class='clearfix full-opacity-hover'>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 7px;' class='bg-purple-active'></span><span class='bg-purple' style='display:block; width: 80%; float: left; height: 7px;'></span></div>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 20px; background: #222d32;'></span><span style='display:block; width: 80%; float: left; height: 20px; background: #f4f5f7;'></span></div>"
|
||||
+ "</a>"
|
||||
+ "<p class='text-center no-margin'>紫色</p>");
|
||||
skins_list.append(skin_purple);
|
||||
var skin_green =
|
||||
$("<li />", {style: "float:left; width: 33.33333%; padding: 5px;"})
|
||||
.append("<a href='javascript:void(0);' data-skin='skin-green' style='display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)' class='clearfix full-opacity-hover'>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 7px;' class='bg-green-active'></span><span class='bg-green' style='display:block; width: 80%; float: left; height: 7px;'></span></div>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 20px; background: #222d32;'></span><span style='display:block; width: 80%; float: left; height: 20px; background: #f4f5f7;'></span></div>"
|
||||
+ "</a>"
|
||||
+ "<p class='text-center no-margin'>绿色</p>");
|
||||
skins_list.append(skin_green);
|
||||
var skin_red =
|
||||
$("<li />", {style: "float:left; width: 33.33333%; padding: 5px;"})
|
||||
.append("<a href='javascript:void(0);' data-skin='skin-red' style='display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)' class='clearfix full-opacity-hover'>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 7px;' class='bg-red-active'></span><span class='bg-red' style='display:block; width: 80%; float: left; height: 7px;'></span></div>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 20px; background: #222d32;'></span><span style='display:block; width: 80%; float: left; height: 20px; background: #f4f5f7;'></span></div>"
|
||||
+ "</a>"
|
||||
+ "<p class='text-center no-margin'>红色</p>");
|
||||
skins_list.append(skin_red);
|
||||
var skin_yellow =
|
||||
$("<li />", {style: "float:left; width: 33.33333%; padding: 5px;"})
|
||||
.append("<a href='javascript:void(0);' data-skin='skin-yellow' style='display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)' class='clearfix full-opacity-hover'>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 7px;' class='bg-yellow-active'></span><span class='bg-yellow' style='display:block; width: 80%; float: left; height: 7px;'></span></div>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 20px; background: #222d32;'></span><span style='display:block; width: 80%; float: left; height: 20px; background: #f4f5f7;'></span></div>"
|
||||
+ "</a>"
|
||||
+ "<p class='text-center no-margin'>黄色</p>");
|
||||
skins_list.append(skin_yellow);
|
||||
|
||||
//Light sidebar skins
|
||||
var skin_blue_light =
|
||||
$("<li />", {style: "float:left; width: 33.33333%; padding: 5px;"})
|
||||
.append("<a href='javascript:void(0);' data-skin='skin-blue-light' style='display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)' class='clearfix full-opacity-hover'>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 7px; background: #367fa9;'></span><span class='bg-light-blue' style='display:block; width: 80%; float: left; height: 7px;'></span></div>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 20px; background: #f9fafc;'></span><span style='display:block; width: 80%; float: left; height: 20px; background: #f4f5f7;'></span></div>"
|
||||
+ "</a>"
|
||||
+ "<p class='text-center no-margin' style='font-size: 12px'>亮蓝</p>");
|
||||
skins_list.append(skin_blue_light);
|
||||
var skin_black_light =
|
||||
$("<li />", {style: "float:left; width: 33.33333%; padding: 5px;"})
|
||||
.append("<a href='javascript:void(0);' data-skin='skin-black-light' style='display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)' class='clearfix full-opacity-hover'>"
|
||||
+ "<div style='box-shadow: 0 0 2px rgba(0,0,0,0.1)' class='clearfix'><span style='display:block; width: 20%; float: left; height: 7px; background: #fefefe;'></span><span style='display:block; width: 80%; float: left; height: 7px; background: #fefefe;'></span></div>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 20px; background: #f9fafc;'></span><span style='display:block; width: 80%; float: left; height: 20px; background: #f4f5f7;'></span></div>"
|
||||
+ "</a>"
|
||||
+ "<p class='text-center no-margin' style='font-size: 12px'>亮</p>");
|
||||
skins_list.append(skin_black_light);
|
||||
var skin_purple_light =
|
||||
$("<li />", {style: "float:left; width: 33.33333%; padding: 5px;"})
|
||||
.append("<a href='javascript:void(0);' data-skin='skin-purple-light' style='display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)' class='clearfix full-opacity-hover'>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 7px;' class='bg-purple-active'></span><span class='bg-purple' style='display:block; width: 80%; float: left; height: 7px;'></span></div>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 20px; background: #f9fafc;'></span><span style='display:block; width: 80%; float: left; height: 20px; background: #f4f5f7;'></span></div>"
|
||||
+ "</a>"
|
||||
+ "<p class='text-center no-margin' style='font-size: 12px'>亮紫</p>");
|
||||
skins_list.append(skin_purple_light);
|
||||
var skin_green_light =
|
||||
$("<li />", {style: "float:left; width: 33.33333%; padding: 5px;"})
|
||||
.append("<a href='javascript:void(0);' data-skin='skin-green-light' style='display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)' class='clearfix full-opacity-hover'>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 7px;' class='bg-green-active'></span><span class='bg-green' style='display:block; width: 80%; float: left; height: 7px;'></span></div>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 20px; background: #f9fafc;'></span><span style='display:block; width: 80%; float: left; height: 20px; background: #f4f5f7;'></span></div>"
|
||||
+ "</a>"
|
||||
+ "<p class='text-center no-margin' style='font-size: 12px'>亮绿</p>");
|
||||
skins_list.append(skin_green_light);
|
||||
var skin_red_light =
|
||||
$("<li />", {style: "float:left; width: 33.33333%; padding: 5px;"})
|
||||
.append("<a href='javascript:void(0);' data-skin='skin-red-light' style='display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)' class='clearfix full-opacity-hover'>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 7px;' class='bg-red-active'></span><span class='bg-red' style='display:block; width: 80%; float: left; height: 7px;'></span></div>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 20px; background: #f9fafc;'></span><span style='display:block; width: 80%; float: left; height: 20px; background: #f4f5f7;'></span></div>"
|
||||
+ "</a>"
|
||||
+ "<p class='text-center no-margin' style='font-size: 12px'>亮红</p>");
|
||||
skins_list.append(skin_red_light);
|
||||
var skin_yellow_light =
|
||||
$("<li />", {style: "float:left; width: 33.33333%; padding: 5px;"})
|
||||
.append("<a href='javascript:void(0);' data-skin='skin-yellow-light' style='display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)' class='clearfix full-opacity-hover'>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 7px;' class='bg-yellow-active'></span><span class='bg-yellow' style='display:block; width: 80%; float: left; height: 7px;'></span></div>"
|
||||
+ "<div><span style='display:block; width: 20%; float: left; height: 20px; background: #f9fafc;'></span><span style='display:block; width: 80%; float: left; height: 20px; background: #f4f5f7;'></span></div>"
|
||||
+ "</a>"
|
||||
+ "<p class='text-center no-margin' style='font-size: 12px;'>亮黄</p>");
|
||||
skins_list.append(skin_yellow_light);
|
||||
|
||||
demo_settings.append("<h4 class='control-sidebar-heading'>皮肤</h4>");
|
||||
demo_settings.append(skins_list);
|
||||
|
||||
tab_pane.append(demo_settings);
|
||||
$("#control-sidebar-content").append(tab_pane);
|
||||
var backend = {
|
||||
/**
|
||||
* List of all the available skins
|
||||
*
|
||||
* @type Array
|
||||
*/
|
||||
mySkins: ['skin-blue', 'skin-black', 'skin-red', 'skin-yellow', 'skin-purple', 'skin-green', 'skin-blue-light', 'skin-black-light', 'skin-red-light', 'skin-yellow-light', 'skin-purple-light', 'skin-green-light'],
|
||||
|
||||
change_layout: function(cls){
|
||||
$("body").toggleClass(cls);
|
||||
AdminLTE.layout.fixSidebar();
|
||||
//Fix the problem with right sidebar and layout boxed
|
||||
if (cls == "layout-boxed")
|
||||
AdminLTE.controlSidebar._fix($(".control-sidebar-bg"));
|
||||
if ($('body').hasClass('fixed') && cls == 'fixed') {
|
||||
AdminLTE.pushMenu.expandOnHover();
|
||||
AdminLTE.layout.activate();
|
||||
}
|
||||
AdminLTE.controlSidebar._fix($(".control-sidebar-bg"));
|
||||
AdminLTE.controlSidebar._fix($(".control-sidebar"));
|
||||
},
|
||||
change_skin: function(cls){
|
||||
$.each(backend.mySkins, function (i) {
|
||||
$('body').removeClass(backend.mySkins[i])
|
||||
})
|
||||
|
||||
$('body').addClass(cls)
|
||||
sent.store.set({name:'skin', content:cls})
|
||||
return false
|
||||
},
|
||||
init: function(){
|
||||
var tmp = sent.store.get({name:'skin'});
|
||||
if (tmp && $.inArray(tmp, backend.my_skins))
|
||||
backend.change_skin(tmp);
|
||||
|
||||
//Add the change skin listener
|
||||
$("[data-skin]").on('click', function (e) {
|
||||
if($(this).hasClass('knob'))
|
||||
return;
|
||||
e.preventDefault();
|
||||
backend.change_skin($(this).data('skin'));
|
||||
});
|
||||
|
||||
//Add the layout manager
|
||||
$("[data-layout]").on('click', function () {
|
||||
backend.change_layout($(this).data('layout'));
|
||||
});
|
||||
|
||||
$("[data-controlsidebar]").on('click', function () {
|
||||
backend.change_layout($(this).data('controlsidebar'));
|
||||
var slide = !AdminLTE.options.controlSidebarOptions.slide;
|
||||
AdminLTE.options.controlSidebarOptions.slide = slide;
|
||||
if (!slide)
|
||||
$('.control-sidebar').removeClass('control-sidebar-open');
|
||||
});
|
||||
|
||||
$("[data-sidebarskin='toggle']").on('click', function () {
|
||||
var sidebar = $(".control-sidebar");
|
||||
if (sidebar.hasClass("control-sidebar-dark")) {
|
||||
sidebar.removeClass("control-sidebar-dark")
|
||||
sidebar.addClass("control-sidebar-light")
|
||||
} else {
|
||||
sidebar.removeClass("control-sidebar-light")
|
||||
sidebar.addClass("control-sidebar-dark")
|
||||
}
|
||||
});
|
||||
|
||||
$("[data-enable='expandOnHover']").on('click', function () {
|
||||
$(this).attr('disabled', true);
|
||||
AdminLTE.pushMenu.expandOnHover();
|
||||
if (!$('body').hasClass('sidebar-collapse'))
|
||||
$("[data-layout='sidebar-collapse']").click();
|
||||
});
|
||||
|
||||
// Reset options
|
||||
if ($('body').hasClass('fixed')) {
|
||||
$("[data-layout='fixed']").attr('checked', 'checked');
|
||||
}
|
||||
if ($('body').hasClass('layout-boxed')) {
|
||||
$("[data-layout='layout-boxed']").attr('checked', 'checked');
|
||||
}
|
||||
if ($('body').hasClass('sidebar-collapse')) {
|
||||
$("[data-layout='sidebar-collapse']").attr('checked', 'checked');
|
||||
}
|
||||
|
||||
if ($('.editable').size() > 0) {
|
||||
require(['bootstrap-editable'], function(){
|
||||
$.fn.editable.defaults.mode = 'popup';
|
||||
$('.editable').editable();
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
backend.init();
|
||||
return backend;
|
||||
})
|
||||
139
public/static/admin/js/main.js
Normal file
139
public/static/admin/js/main.js
Normal file
@@ -0,0 +1,139 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// 当前资源URL目录
|
||||
var baseRoot = (function () {
|
||||
var scripts = document.scripts, src = scripts[0].src;
|
||||
return src.substring(0, src.lastIndexOf("/") - 9) + '/';
|
||||
})();
|
||||
|
||||
// 配置参数
|
||||
require.config({
|
||||
waitSeconds: 60,
|
||||
packages: [{
|
||||
name: 'moment',
|
||||
location: 'plugins/moment',
|
||||
main: 'moment'
|
||||
}
|
||||
],
|
||||
baseUrl: baseRoot,
|
||||
map: {'*': {css: baseRoot + 'plugins/require/require.css.js'}},
|
||||
paths: {
|
||||
'sent': ['common/js/sent'],
|
||||
'form': ['common/js/require-form'],
|
||||
'upload': 'common/js/require-upload',
|
||||
'validator': 'common/js/require-validator',
|
||||
'message': ['plugins/messager/messager'],
|
||||
'sortable': 'plugins/Sortable/Sortable.min',
|
||||
'template': ['plugins/art-template/template'],
|
||||
'webupload': ['plugins/webuploader/webuploader.min'],
|
||||
'pcasunzips': ['plugins/jquery/pcasunzips'],
|
||||
// openSource
|
||||
'layer': ['plugins/layer/layer'],
|
||||
'base64': ['plugins/jquery/base64.min'],
|
||||
'angular': ['plugins/angular/angular.min'],
|
||||
'cxselect': ['plugins/cxselect/jquery.cxselect.min'],
|
||||
'websocket': ['plugins/socket/websocket'],
|
||||
// jQuery
|
||||
'jquery': ['plugins/jquery/jquery.min'],
|
||||
'json': ['plugins/jquery/json2.min'],
|
||||
'jquery.ztree': ['plugins/ztree/jquery.ztree.all.min'],
|
||||
'jquery.masonry': ['plugins/jquery/masonry.min'],
|
||||
'jquery.cookies': ['plugins/jquery/jquery.cookie'],
|
||||
// bootstrap
|
||||
'bootstrap': ['plugins/bootstrap/js/bootstrap.min'],
|
||||
'bootstrap.typeahead': ['plugins/bootstrap/js/bootstrap3-typeahead.min'],
|
||||
'bootstrap.multiselect': ['plugins/bootstrap-multiselect/bootstrap-multiselect'],
|
||||
'bootstrap-select': 'plugins/bootstrap-select/js/bootstrap-select.min',
|
||||
'bootstrap-select-lang': 'plugins/bootstrap-select/js/i18n/defaults-zh_CN',
|
||||
'bootstrap-editable': 'plugins/bootstrap-editable/js/bootstrap-editable.min',
|
||||
'bootstrap-datetimepicker': 'plugins/eonasdan-bootstrap-datetimepicker/js/bootstrap-datetimepicker.min',
|
||||
'bootstrap-daterangepicker': 'plugins/bootstrap-daterangepicker/daterangepicker',
|
||||
// distpicker
|
||||
'distpicker': ['plugins/distpicker/distpicker'],
|
||||
|
||||
'validator-core': 'plugins/nice-validator/jquery.validator',
|
||||
'validator-lang': 'plugins/nice-validator/local/zh-CN',
|
||||
|
||||
'NKeditor': 'plugins/NKeditor/NKeditor-all-min',
|
||||
|
||||
//adminlte
|
||||
'adminlte': ['plugins/adminlte/js/adminlte.min'],
|
||||
|
||||
// nanoscroller
|
||||
'slimscroll': 'plugins/jquery-slimscroll/jquery.slimscroll',
|
||||
},
|
||||
shim: {
|
||||
'message': {deps: ['css!'+'plugins/messager/css/style.css']},
|
||||
'board': {deps: ['css!'+'plugins/board/board.min.css']},
|
||||
// open-source
|
||||
'websocket': {deps: [baseRoot + 'plugins/socket/swfobject.min.js']},
|
||||
// jquery
|
||||
'jquery.ztree': {deps: ['css!' + baseRoot + 'plugins/ztree/zTreeStyle/zTreeStyle.css']},
|
||||
// bootstrap
|
||||
'bootstrap':{deps: ['jquery']},
|
||||
'bootstrap.typeahead': {deps: ['bootstrap']},
|
||||
'bootstrap.multiselect': {deps: ['bootstrap', 'css!' + baseRoot + 'plugins/bootstrap-multiselect/bootstrap-multiselect.css']},
|
||||
'bootstrap-select-lang': ['bootstrap-select'],
|
||||
'bootstrap-editable': {deps:['bootstrap', 'css!'+baseRoot+'plugins/bootstrap-editable/css/bootstrap-editable.css'], exports:'$.fn.editable'},
|
||||
'distpicker': {deps: [baseRoot + 'plugins/distpicker/distpicker.data.js']},
|
||||
'bootstrap-daterangepicker': [
|
||||
'moment/locale/zh-cn'
|
||||
],
|
||||
'bootstrap-datetimepicker': [
|
||||
'moment/locale/zh-cn',
|
||||
'css!'+baseRoot+'plugins/eonasdan-bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css',
|
||||
],
|
||||
|
||||
'validator-lang': ['validator-core'],
|
||||
|
||||
'slimscroll': {deps: ['jquery'],exports: '$.fn.extend'},
|
||||
'adminlte': {deps: ['bootstrap', 'slimscroll'],exports: '$.AdminLTE'},
|
||||
|
||||
'webupload': {deps: ['jquery', 'css!'+baseRoot+'plugins/webuploader/theme/webuploader.css', 'css!'+baseRoot+'/plugins/webuploader/theme/app.css']},
|
||||
|
||||
'layer': {deps: ['jquery', 'css!'+baseRoot+'plugins/layer/theme/default/layer.css']},
|
||||
'layui':{exports: "layui"}
|
||||
},
|
||||
deps: ['json'],
|
||||
// 开启debug模式,不缓存资源
|
||||
urlArgs: "ver=" + (new Date()).getTime()
|
||||
});
|
||||
|
||||
// 注册jquery到require模块
|
||||
require(['jquery', 'bootstrap', 'message', 'adminlte'], function ($) {
|
||||
//初始配置
|
||||
var Config = requirejs.s.contexts._.config.config;
|
||||
//将Config渲染到全局
|
||||
window.Config = Config;
|
||||
// 配置语言包的路径
|
||||
var paths = {}; // 避免目录冲突
|
||||
paths['backend/'] = 'backend/';
|
||||
require.config({paths: paths});
|
||||
$(function(){
|
||||
require(['sent'], function(sent){
|
||||
require(['admin/js/backend'], function(backend){
|
||||
//加载相应模块
|
||||
if (Config.jsname) {
|
||||
require([Config.jsname], function (Controller) {
|
||||
if (Controller.hasOwnProperty(Config.actionname)) {
|
||||
Controller[Config.actionname]();
|
||||
} else {
|
||||
if (Controller.hasOwnProperty("_empty")) {
|
||||
Controller._empty();
|
||||
}
|
||||
}
|
||||
}, function (e) {
|
||||
console.error(e);
|
||||
// 这里可捕获模块加载的错误
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
});
|
||||
Reference in New Issue
Block a user