$(function () { var dataBinder = new DataEntity({ Title: "#sysName", Footer: "#sysFoot" }); $('button[data-method]').on('click', function (e) { var $this = $(this); var data = {}; switch ($this.attr('data-method')) { case 'footer': data = dataBinder.get(); $.bc({ url: Settings.url, data: { name: '网站页脚', code: data.Footer, category: '网站设置' }, title: '保存网站页脚', method: "post", callback: function (result) { if (result) $('#websiteFooter').text(data.Footer); } }); break; case 'title': data = dataBinder.get(); $.bc({ url: Settings.url, data: { name: '网站标题', code: data.Title, category: '网站设置' }, title: '保存网站标题', method: "post", callback: function (result) { if (result) $('#websiteTitle').text(data.Title); } }); break; case 'css': var cssDefine = $css.val(); $.bc({ url: Settings.url, data: { name: '使用样式', code: cssDefine, category: '当前样式' }, title: '保存网站样式', method: "post", callback: function (result) { if (result) { window.setTimeout(function () { window.location.reload(true); }, 1000); } } }); break; } }); var $sortable = $('#sortable'); var $refresh = $('a[data-method="refresh"]'); var listCacheUrl = function (options) { $refresh.addClass('fa-spin'); options = $.extend({ clear: false }, options); $sortable.html(''); $.bc({ url: Settings.url, autoFooter: true, callback: function (urls) { if (urls && $.isArray(urls)) { $.each(urls, function (index, item) { if (options.clear) options.url = item.Url + "?cacheKey=*"; else options.url = item.Url; $.bc({ url: options.url, cors: !item.Self, autoFooter: true, callback: function (result) { if ($.isArray(result)) { var html = '