/*! * ZUI: 看板 - v1.9.2 - 2020-07-09 * http://openzui.com * GitHub: https://github.com/easysoft/zui.git * Copyright (c) 2020 cnezsoft.com; Licensed MIT */ /* ======================================================================== * ZUI: boards.js * http://openzui.com * ======================================================================== * Copyright (c) 2014-2016 cnezsoft.com; Licensed MIT * ======================================================================== */ (function($) { 'use strict'; if(!$.fn.droppable) throw new Error('Droppable requires for boards'); var NAME = 'zui.boards'; var Boards = function(element, options) { this.$ = $(element); this.options = this.getOptions(options); this.getLang(); this.init(); }; Boards.DEFAULTS = { lang: 'en', langs: { 'zh_cn': { append2end: '移动到末尾' }, 'zh_tw': { append2end: '移动到末尾' }, 'en': { append2end: 'Move to the end.' } } }; // default options Boards.prototype.getOptions = function(options) { options = $.extend({}, Boards.DEFAULTS, this.$.data(), options); return options; }; Boards.prototype.getLang = function() { var options = this.options; this.langName = options.lang || $.zui.clientLang(); this.lang = $.zui.getLangData(NAME, this.langName, options.langs); }; Boards.prototype.init = function() { var idSeed = 1; var lang = this.lang; this.$.find('.board-item:not(".disable-drop"), .board:not(".disable-drop")').each(function() { var $this = $(this); if($this.attr('id')) { $this.attr('data-id', $this.attr('id')); } else if(!$this.attr('data-id')) { $this.attr('data-id', 'board' + (idSeed++)); } if($this.hasClass('board')) { $this.find('.board-list').append('