diff --git a/.gitignore b/.gitignore index d1fcb303..78d01d79 100755 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ /.idea /.vscode /vendor -/viewold *.log .env composer.lock \ No newline at end of file diff --git a/addons/syslogin/view/admin/setting.html b/addons/syslogin/view/admin/setting.html index 7011c926..b2f3639d 100644 --- a/addons/syslogin/view/admin/setting.html +++ b/addons/syslogin/view/admin/setting.html @@ -1 +1,6 @@ -{extend name="../../../view/base"/} \ No newline at end of file +{extend name="../../../view/addon"/} +{block name="body"} +
Email is sending...
').fadeIn() ); - } - }).done(function(data){ - form_status.html('' + data.message + '
').delay(3000).fadeOut(); - }); - }); - - - //goto top - $('.gototop').click(function(event) { - event.preventDefault(); - $('html, body').animate({ - scrollTop: $("body").offset().top - }, 500); - }); - - //Pretty Photo - $("a[rel^='prettyPhoto']").prettyPhoto({ - social_tools: false - }); -}); \ No newline at end of file diff --git a/public/static/common/js/messager.js b/public/static/common/js/messager.js deleted file mode 100644 index d30cd336..00000000 --- a/public/static/common/js/messager.js +++ /dev/null @@ -1,290 +0,0 @@ -/* ======================================================================== - * ZUI: string.js - * http://zui.sexy - * ======================================================================== - * Copyright (c) 2014 cnezsoft.com; Licensed MIT - * ======================================================================== */ -(function() -{ - 'use strict'; - $.extend({ - callEvent: function(func, event, proxy) - { - if ($.isFunction(func)) - { - if (typeof proxy != 'undefined') - { - func = $.proxy(func, proxy); - } - event.result = func(event); - return !(event.result !== undefined && (!event.result)); - } - return 1; - }, - }); - String.prototype.format = function(args) - { - var result = this; - if (arguments.length > 0) - { - var reg; - if (arguments.length == 1 && typeof(args) == "object") - { - for (var key in args) - { - if (args[key] !== undefined) - { - reg = new RegExp("({" + key + "})", "g"); - result = result.replace(reg, args[key]); - } - } - } - else - { - for (var i = 0; i < arguments.length; i++) - { - if (arguments[i] !== undefined) - { - reg = new RegExp("({[" + i + "]})", "g"); - result = result.replace(reg, arguments[i]); - } - } - } - } - return result; - }; - - - $.fn.callEvent = function(name, event, model) - { - var $this = $(this); - var dotIndex = name.indexOf('.sent.'); - var shortName = name; - if (dotIndex < 0 && model && model.name) - { - name += '.' + model.name; - } - else - { - shortName = name.substring(0, dotIndex); - } - var e = $.Event(name, event); - - // var result = $this.trigger(e); - - if ((typeof model === 'undefined') && dotIndex > 0) - { - model = $this.data(name.substring(dotIndex + 1)); - } - - if (model && model.options) - { - var func = model.options[shortName]; - if ($.isFunction(func)) - { - $.callEvent(model.options[shortName], e, model); - } - } - return e; - }; - - /** - * Judge the string is a integer number - * - * @access public - * @return bool - */ - String.prototype.isNum = function(s) - { - if (s !== null) - { - var r, re; - re = /\d*/i; - r = s.match(re); - return (r == s) ? true : false; - } - return false; - }; -})(); - -/* ======================================================================== - * ZUI: messager.js - * http://zui.sexy - * ======================================================================== - * Copyright (c) 2014 cnezsoft.com; Licensed MIT - * ======================================================================== */ - - -(function($, window) -{ - 'use strict'; - - var id = 0; - var template = ''; - var defaultOptions = - { - type: 'default', - placement: 'top', - time: 4000, - parent: 'body', - // clear: false, - icon: null, - close: true, - fade: true, - scale: true - }; - var lastMessager; - - var Messager = function(message, options) - { - var that = this; - that.id = id++; - options = that.options = $.extend({}, defaultOptions, options); - that.message = (options.icon ? ' ' : '') + message; - - that.$ = $(template.format(options)).toggleClass('fade', options.fade).toggleClass('scale', options.scale).attr('id', 'messager-' + that.id); - if(!options.close) - { - that.$.find('.close').remove(); - } - else - { - that.$.on('click', '.close', function() - { - that.hide(); - }); - } - - that.$.find('.messager-content').html(that.message); - - - that.$.data('sent.messager', that); - }; - - Messager.prototype.show = function(message) - { - var that = this, options = this.options; - - if(lastMessager) - { - if(lastMessager.id == that.id) - { - that.$.removeClass('in'); - } - else if(lastMessager.isShow) - { - lastMessager.hide(); - } - } - - if(that.hiding) - { - clearTimeout(that.hiding); - that.hiding = null; - } - - if(message) - { - that.message = (options.icon ? ' ' : '') + message; - that.$.find('.messager-content').html(that.message); - } - - that.$.appendTo(options.parent).show(); - - if (options.placement === 'top' || options.placement === 'bottom' || options.placement === 'center') - { - that.$.css('left', ($(window).width() - that.$.width() - 50) / 2); - } - - if (options.placement === 'left' || options.placement === 'right' || options.placement === 'center') - { - that.$.css('top', ($(window).height() - that.$.height() - 50) / 2); - } - - that.$.addClass('in'); - - if(options.time) - { - that.hiding = setTimeout(function(){that.hide();}, options.time); - } - - that.isShow = true; - lastMessager = that; - }; - - Messager.prototype.hide = function() - { - var that = this; - if(that.$.hasClass('in')) - { - that.$.removeClass('in'); - setTimeout(function(){that.$.remove();}, 200); - } - - that.isShow = false; - }; - - $.Messager = Messager; - var noConflictMessager = window.Messager; - window.Messager = $.Messager; - window.Messager.noConflict = function() - { - window.Messager = noConflictMessager; - }; - - $.showMessage = function(message, options) - { - if(typeof options === 'string') - { - options = {type: options}; - } - var msg = new Messager(message, options); - msg.show(); - return msg; - }; - - var getOptions = function(options) - { - return (typeof options === 'string') ? {placement: options} : options; - }; - - $.messager = - { - show: $.showMessage, - primary: function(message, options) - { - return $.showMessage(message, $.extend({type: 'primary'}, getOptions(options))); - }, - success: function(message, options) - { - return $.showMessage(message, $.extend({type: 'success', icon: 'ok-sign'}, getOptions(options))); - }, - info: function(message, options) - { - return $.showMessage(message, $.extend({type: 'info', icon: 'info-sign'}, getOptions(options))); - }, - warning: function(message, options) - { - return $.showMessage(message, $.extend({type: 'warning', icon: 'warning-sign'}, getOptions(options))); - }, - danger: function(message, options) - { - return $.showMessage(message, $.extend({type: 'danger', icon: 'exclamation-sign'}, getOptions(options))); - }, - important: function(message, options) - { - return $.showMessage(message, $.extend({type: 'important'}, getOptions(options))); - }, - special: function(message, options) - { - return $.showMessage(message, $.extend({type: 'special'}, getOptions(options))); - } - }; - - var noConflict = window.messager; - window.messager = $.messager; - window.messager.noConflict = function() - { - window.messager = noConflict; - }; -}(jQuery, window)); \ No newline at end of file diff --git a/public/static/common/js/require-form.js b/public/static/common/js/require-form.js index 3fe0d850..c5ce3587 100644 --- a/public/static/common/js/require-form.js +++ b/public/static/common/js/require-form.js @@ -93,6 +93,18 @@ define(['jquery', 'bootstrap', 'validator'], function ($, undefined, Validator) }) } }, + board: function (form){ + if ($('.boards', form).size() > 0) { + require(['board'], function(){ + $('.boards', form).boards({ + drop: function(e){ + var group = e.target.closest('.board').find('.board-list').attr('data-group'); + e.element.find('input').attr('name','addons[' + group + '][]') + } + }) + }) + } + }, selectpicker: function (form) { //绑定select元素事件 if ($(".selectpicker", form).size() > 0) { @@ -235,7 +247,7 @@ define(['jquery', 'bootstrap', 'validator'], function ($, undefined, Validator) type: 2, shade: false, area: ['60%', '440px'], - title: $(this).text(), //不显示标题 + title: type == 'image' ? '图片' : '文件', //不显示标题 content: ['/'+Config.module+'/upload/index?name='+name+'&type='+type+'&limit='+limit, 'no'], }); }) @@ -493,6 +505,7 @@ define(['jquery', 'bootstrap', 'validator'], function ($, undefined, Validator) events.bindevent(form); events.validator(form, success, error, submit); events.editor(form); + events.board(form); events.selectpicker(form); events.daterangepicker(form); events.selectpage(form); diff --git a/public/static/common/js/droppable.js b/public/static/plugins/droppable/droppable.js similarity index 100% rename from public/static/common/js/droppable.js rename to public/static/plugins/droppable/droppable.js diff --git a/view/base.html b/view/addon/base.html similarity index 100% rename from view/base.html rename to view/addon/base.html diff --git a/view/addon/edit.html b/view/addon/edit.html new file mode 100644 index 00000000..506bd4c8 --- /dev/null +++ b/view/addon/edit.html @@ -0,0 +1,64 @@ +{extend name="../../../view/addon/base"/} +{block name="body"} +