components.js 79 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117
  1. /**
  2. * UI v1.1.0
  3. * Copyright 2017-2018 Muyao
  4. * Licensed under the Muyao License 1.0
  5. */
  6. (function (window, document, $) {
  7. 'use strict';
  8. $.components.register("ace", {
  9. mode: "init",
  10. defaults: {},
  11. init: function (context, iframe) {
  12. var ace = (iframe && iframe.ace) ? iframe.ace : window.ace, iframe$;
  13. if (typeof ace === "undefined") {
  14. return;
  15. }
  16. iframe$ = iframe ? iframe.$ : $;
  17. //ace.config.set("themePath", "../theme");
  18. ace.config.loadModule("ace/ext/language_tools");
  19. $('[data-plugin="ace"]', context).each(function () {
  20. var id = $(this).attr("id"),
  21. mode = $(this).data("mode", iframe$),
  22. theme = $(this).data("theme", iframe$),
  23. editor = ace.edit(id);
  24. editor.container.style.opacity = "";
  25. if (mode) {
  26. editor.session.setMode("ace/mode/" + mode);
  27. }
  28. if (theme) {
  29. editor.setTheme("ace/theme/" + theme);
  30. }
  31. editor.setOption("maxLines", 40);
  32. editor.setAutoScrollEditorIntoView(true);
  33. ace.config.loadModule("ace/ext/language_tools", function () {
  34. editor.setOptions({
  35. enableSnippets: true,
  36. enableBasicAutocompletion: true
  37. });
  38. });
  39. });
  40. }
  41. });
  42. })(window, document, jQuery);
  43. (function (window, document, $) {
  44. "use strict";
  45. $.components.register("animate-list", {
  46. mode: 'init',
  47. defaults: {
  48. child: '.panel',
  49. duration: 250,
  50. delay: 50,
  51. animate: 'scale-up',
  52. fill: 'backwards'
  53. },
  54. init: function (context, iframe) {
  55. var self = this,
  56. iframe$ = iframe ? iframe.$ : $;
  57. $('[data-plugin="animateList"]', context).each(function () {
  58. var $this = $(this),
  59. options = $.extend({}, self.defaults, $this.data(iframe$), true);
  60. var animatedBox = function ($el, opts) {
  61. this.options = opts;
  62. this.$children = $el.find(opts.child);
  63. this.$children.addClass('animation-' + opts.animate);
  64. this.$children.css('animation-fill-mode', opts.fill);
  65. this.$children.css('animation-duration', opts.duration + 'ms');
  66. var delay = 0,
  67. self = this;
  68. this.$children.each(function () {
  69. $(this).css('animation-delay', delay + 'ms');
  70. delay += self.options.delay;
  71. });
  72. };
  73. animatedBox.prototype = {
  74. run: function (type) {
  75. var self = this;
  76. this.$children.removeClass('animation-' + this.options.animate);
  77. if (typeof type !== 'undefined') {
  78. this.options.animate = type;
  79. }
  80. setTimeout(function () {
  81. self.$children.addClass('animation-' + self.options.animate);
  82. }, 0);
  83. }
  84. };
  85. $this.data('animateList', new animatedBox($this, options), iframe$);
  86. });
  87. }
  88. });
  89. })(window, document, jQuery);
  90. (function(window, document, $){
  91. "use strict";
  92. $.components.register("colorpicker", {
  93. defaults: {},
  94. mode: "default"
  95. });
  96. })(window, document, jQuery);
  97. (function(window, document, $){
  98. "use strict";
  99. $.components.register("datepicker", {
  100. mode: "default",
  101. defaults: {
  102. autoclose: true
  103. }
  104. });
  105. })(window, document, jQuery);
  106. (function (window, document, $) {
  107. "use strict";
  108. $.components.register("daterangepicker", {
  109. defaults: {
  110. "locale": {
  111. "format": "YYYY-MM-DD",
  112. "separator": " 至 ",
  113. "applyLabel": "确定",
  114. "cancelLabel": "取消",
  115. "fromLabel": "从",
  116. "toLabel": "到",
  117. "customRangeLabel": "自定义",
  118. "weekLabel": "W",
  119. "daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
  120. "monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
  121. "firstDay": 1
  122. },
  123. // "parentEl": "#admui-pageContent > .page",
  124. "alwaysShowCalendars": true
  125. },
  126. init: function (context, iframe) {
  127. var iframe$ = iframe ? iframe.$ : $,
  128. moment = iframe ? iframe.moment : moment,
  129. defaults, defaults_ranges;
  130. if (!iframe$.fn.daterangepicker) {
  131. return;
  132. }
  133. defaults = $.components.getDefaults("daterangepicker");
  134. defaults_ranges = {
  135. ranges: {
  136. '今天': [moment(), moment()],
  137. '昨天': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
  138. '最近7天': [moment().subtract(6, 'days'), moment()],
  139. '最近30天': [moment().subtract(29, 'days'), moment()],
  140. '本月': [moment().startOf('month'), moment().endOf('month')],
  141. '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  142. }
  143. };
  144. $('[data-plugin="daterangepicker"]', context).each(function () {
  145. var options = $.extend(true, {}, defaults, defaults_ranges, $(this).data(iframe$));
  146. iframe$(this).daterangepicker(options);
  147. });
  148. }
  149. });
  150. })(window, document, jQuery);
  151. (function(window, document, $){
  152. "use strict";
  153. $.components.register("maxlength", {
  154. mode: "default",
  155. defaults: {}
  156. });
  157. })(window, document, jQuery);
  158. (function (window, document, $) {
  159. "use strict";
  160. $.components.register("markdown", {
  161. mode: "init",
  162. defaults: {
  163. autofocus: false,
  164. savable: false,
  165. language: 'zh'
  166. },
  167. init: function (context, iframe) {
  168. var iframe$ = iframe ? iframe.$ : $, defaults;
  169. if (!iframe$.fn.markdown) {
  170. return;
  171. }
  172. defaults = this.defaults;
  173. $('textarea[data-plugin="markdown"]', context).each(function () {
  174. var options = $.extend(true, {}, defaults, $(this).data(iframe$));
  175. iframe$(this).markdown(options);
  176. });
  177. }
  178. });
  179. })(window, document, jQuery);
  180. (function(window, document, $){
  181. "use strict";
  182. $.components.register("selectpicker", {
  183. mode: "default",
  184. defaults: {
  185. noneSelectedText: '没有选中任何项',
  186. noneResultsText: '没有找到匹配项',
  187. countSelectedText: '已选中{1}项中的{0}项',
  188. maxOptionsText: ['超出限制 (最多选择{n}项)', '组选择超出限制(最多选择{n}组)'],
  189. selectAllText: '选择全部',
  190. deselectAllText: '取消全部选择',
  191. doneButtonText: '关闭',
  192. style: "btn-select",
  193. iconBase: "icon",
  194. tickIcon: "wb-check"
  195. }
  196. });
  197. })(window, document, jQuery);
  198. (function(window, document, $){
  199. "use strict";
  200. $.components.register("bootstrapSlider", {
  201. defaults: {},
  202. mode: "default"
  203. });
  204. })(window, document, jQuery);
  205. (function(window, document, $){
  206. "use strict";
  207. $.components.register("tagsinput", {
  208. defaults: {
  209. tagClass: "label label-default"
  210. },
  211. mode: "default"
  212. });
  213. })(window, document, jQuery);
  214. (function(window, document, $){
  215. "use strict";
  216. $.components.register("tokenfield", {
  217. mode: "default",
  218. defaults: {}
  219. });
  220. })(window, document, jQuery);
  221. (function(window, document, $){
  222. "use strict";
  223. $.components.register("TouchSpin", {
  224. mode: "default",
  225. defaults: {
  226. verticalupclass: "wb-plus",
  227. verticaldownclass: "wb-minus",
  228. buttondown_class: "btn btn-outline btn-default",
  229. buttonup_class: "btn btn-outline btn-default"
  230. }
  231. });
  232. })(window, document, jQuery);
  233. (function (window, document, $) {
  234. "use strict";
  235. $.components.register("buttons", {
  236. mode: "api",
  237. defaults: {},
  238. api: function (context, iframe) {
  239. var iframe$ = iframe ? iframe.$ : $;
  240. $(context).on('click.site.loading', '[data-loading-text]', function () {
  241. var $btn = $(this),
  242. text = $btn.text(),
  243. i = 20,
  244. loadingText = $btn.data('loadingText', iframe$);
  245. $btn.text(loadingText + '(' + i + ')').css('opacity', '.6');
  246. var timeout = setInterval(function () {
  247. $btn.text(loadingText + '(' + (--i) + ')');
  248. if (i === 0) {
  249. clearInterval(timeout);
  250. $btn.text(text).css('opacity', '1');
  251. }
  252. }, 1000);
  253. });
  254. $(context).on('click.site.morebutton', '[data-more]', function () {
  255. var $target = $($(this).data('more', iframe$));
  256. $target.toggleClass('show');
  257. });
  258. }
  259. });
  260. })(window, document, jQuery);
  261. (function (window, document, $) {
  262. "use strict";
  263. $.components.register("card", {
  264. mode: "init",
  265. defaults: {},
  266. init: function (context, iframe) {
  267. var iframe$ = iframe ? iframe.$ : $, defaults;
  268. if (!iframe$.fn.card) {
  269. return;
  270. }
  271. defaults = $.components.getDefaults("card");
  272. $('[data-plugin="card"]', context).each(function () {
  273. var options = $.extend({}, defaults, $(this).data(iframe$));
  274. if (options.target) {
  275. options.container = iframe$(options.target);
  276. }
  277. iframe$(this).card(options);
  278. });
  279. }
  280. });
  281. })(window, document, jQuery);
  282. (function(window, document, $){
  283. "use strict";
  284. $.components.register("clockpicker", {
  285. mode: "default"
  286. });
  287. })(window, document, jQuery);
  288. (function (window, document, $) {
  289. "use strict";
  290. $.components.register("dataTable", {
  291. defaults: {
  292. responsive: true,
  293. dom: "<'row'<'col-xs-6'<'hidden-xs'l>><'col-xs-6'f>>" + "<'row'<'col-xs-12'tr>>" + "<'row'<'col-sm-5'i><'col-sm-7'p>>",
  294. language: {
  295. "sSearchPlaceholder": "快速查找",
  296. "lengthMenu": "每页显示 _MENU_ 条",
  297. "search": "_INPUT_",
  298. "info": "第 _START_ 至 _END_ 项,共 _TOTAL_ 项",
  299. "infoEmpty": "共 0 项",
  300. "emptyTable": "无数据",
  301. "zeroRecords": "抱歉,没有找到符合条件的记录",
  302. "sInfoFiltered": "(从 _MAX_ 条记录中查找)",
  303. "loadingRecords": "加载中,请稍后…",
  304. "processing": "正在处理,请稍后…",
  305. "paginate": {
  306. "first": "第一页",
  307. "last": "最后一页",
  308. "previous": '<i class="icon wb-chevron-left-mini"></i>',
  309. "next": '<i class="icon wb-chevron-right-mini"></i>'
  310. },
  311. "aria": {
  312. "sortAscending": "升序排列",
  313. "sortDescending": "降序排列"
  314. }
  315. }
  316. },
  317. init: function (context, iframe) {
  318. var iframe$ = iframe ? iframe.$ : $, defaults;
  319. if (!iframe$.fn.dataTable) {
  320. return;
  321. }
  322. defaults = this.defaults;
  323. $('[data-plugin="dataTable"]', context).each(function () {
  324. var options = $.extend(true, {}, defaults, $(this).data(iframe$));
  325. iframe$(this).dataTable(options);
  326. });
  327. }
  328. });
  329. })(window, document, jQuery);
  330. (function(window, document, $){
  331. "use strict";
  332. $.components.register("datepair", {
  333. mode: "default",
  334. defaults: {
  335. startClass: 'datepair-start',
  336. endClass: 'datepair-end',
  337. timeClass: 'datepair-time',
  338. dateClass: 'datepair-date'
  339. }
  340. });
  341. })(window, document, jQuery);
  342. (function(window, document, $){
  343. "use strict";
  344. $.components.register("dropify", {
  345. mode: "default",
  346. defaults: {
  347. messages: {
  348. 'default': '单击或直接拖动需要上传的文件到此处',
  349. 'replace': '将文件拖放到此处或单击此处替换',
  350. 'remove': '移除',
  351. 'error': '出错了…'
  352. },
  353. error: {
  354. 'fileSize': '文件大小超出限制(文件大小不能超过{{ value }})。',
  355. 'minWidth': '图片宽度太小(不能小于{{ value }}}px)。',
  356. 'maxWidth': '图片宽度太大(不能大于{{ value }}}px)。',
  357. 'minHeight': '图片高度太小(不能小于{{ value }}}px)。',
  358. 'maxHeight': '图片高度太大(不能大于{{ value }}px)。',
  359. 'imageFormat': '图片格式不支持(允许的格式为:{{ value }})。'
  360. }
  361. }
  362. });
  363. })(window, document, jQuery);
  364. (function(window, document, $){
  365. "use strict";
  366. $.components.register("editableTable", {
  367. mode: "init",
  368. init: function (context, iframe) {
  369. var ifaram$ = iframe ? iframe.$ : $, defaults;
  370. if (!ifaram$.fn.editableTableWidget) {
  371. return;
  372. }
  373. defaults = $.components.getDefaults("editableTable");
  374. $('[data-plugin="editableTable"]', context).each(function () {
  375. var options = $.extend(true, {}, defaults, $(this).data(ifaram$));
  376. ifaram$(this).editableTableWidget(options);
  377. });
  378. }
  379. });
  380. })(window, document, jQuery);
  381. (function (window, document, $) {
  382. "use strict";
  383. $.components.register("filterable", {
  384. mode: "init",
  385. defaults: {
  386. animationOptions: {
  387. duration: 750,
  388. easing: 'linear',
  389. queue: false
  390. }
  391. },
  392. init: function (context, iframe) {
  393. var iframe$ = iframe ? iframe.$ : $,
  394. _window = iframe ? iframe : window, defaults, callback;
  395. if (typeof iframe$.fn.isotope === "undefined") {
  396. return;
  397. }
  398. defaults = $.components.getDefaults('filterable');
  399. callback = function () {
  400. $('[data-filterable]', context).each(function () {
  401. var $this = iframe$(this);
  402. var options = $.extend(true, {}, defaults, $this.data(), {
  403. filter: '*'
  404. });
  405. $this.isotope(options);
  406. });
  407. $('[data-filter]', context).click(function (e) {
  408. var $this = $(this),
  409. target = $this.data('target', iframe$),
  410. $li = $this.parent('li'), $list, filter;
  411. if (!target) {
  412. target = $this.attr('href');
  413. target = target && target.replace(/.*(?=#[^\s]*$)/, '');
  414. }
  415. $li.siblings('.active').each(function () {
  416. $(this).find('a').attr('aria-expanded', false);
  417. $(this).removeClass('active');
  418. });
  419. $li.addClass('active');
  420. $this.attr('aria-expanded', true);
  421. $list = iframe$(target, context);
  422. filter = $this.attr('data-filter');
  423. if (filter !== '*') {
  424. filter = '[data-type="' + filter + '"]';
  425. }
  426. $list.isotope({
  427. filter: filter
  428. });
  429. e.preventDefault();
  430. });
  431. };
  432. if (context !== document) {
  433. callback();
  434. } else {
  435. $(_window).on('load', function () {
  436. callback();
  437. });
  438. }
  439. }
  440. });
  441. })(window, document, jQuery);
  442. (function(window, document, $){
  443. "use strict";
  444. $.components.register("iconpicker", {
  445. mode: "default",
  446. defaults: {
  447. fullClassFormatter: function(value) {
  448. return "icon " + value;
  449. },
  450. templates: {
  451. popover: '<div class="iconpicker-popover popover"><div class="arrow"></div>' + '<div class="popover-title"></div><div class="popover-content"></div></div>',
  452. footer: '<div class="popover-footer"></div>',
  453. buttons: '<button class="iconpicker-btn iconpicker-btn-cancel btn btn-default btn-sm">取消</button>' + ' <button class="iconpicker-btn iconpicker-btn-accept btn btn-primary btn-sm">确认</button>',
  454. search: '<input type="search" class="form-control iconpicker-search" placeholder="查找图标">',
  455. iconpicker: '<div class="iconpicker"><div class="iconpicker-items"></div></div>',
  456. iconpickerItem: '<a role="button" href="#" class="iconpicker-item"><i></i></a>'
  457. },
  458. icons: ["fa-adjust", "fa-anchor", "fa-archive", "fa-area-chart", "fa-arrows", "fa-arrows-h", "fa-arrows-v", "fa-asterisk", "fa-at", "fa-automobile", "fa-ban", "fa-bank", "fa-bar-chart", "fa-bar-chart-o", "fa-barcode", "fa-bars", "fa-bed", "fa-beer", "fa-bell", "fa-bell-o", "fa-bell-slash", "fa-bell-slash-o", "fa-bicycle", "fa-binoculars", "fa-birthday-cake", "fa-bolt", "fa-bomb", "fa-book", "fa-bookmark", "fa-bookmark-o", "fa-briefcase", "fa-bug", "fa-building", "fa-building-o", "fa-bullhorn", "fa-bullseye", "fa-bus", "fa-cab", "fa-calculator", "fa-calendar", "fa-calendar-o", "fa-camera", "fa-camera-retro", "fa-car", "fa-caret-square-o-down", "fa-caret-square-o-left", "fa-caret-square-o-right", "fa-caret-square-o-up", "fa-cart-arrow-down", "fa-cart-plus", "fa-cc", "fa-certificate", "fa-check", "fa-check-circle", "fa-check-circle-o", "fa-check-square", "fa-check-square-o", "fa-child", "fa-circle", "fa-circle-o", "fa-circle-o-notch", "fa-circle-thin", "fa-clock-o", "fa-close", "fa-cloud", "fa-cloud-download", "fa-cloud-upload", "fa-code", "fa-code-fork", "fa-coffee", "fa-cog", "fa-cogs", "fa-comment", "fa-comment-o", "fa-comments", "fa-comments-o", "fa-compass", "fa-copyright", "fa-credit-card", "fa-crop", "fa-crosshairs", "fa-cube", "fa-cubes", "fa-cutlery", "fa-dashboard", "fa-database", "fa-desktop", "fa-diamond", "fa-dot-circle-o", "fa-download", "fa-edit", "fa-ellipsis-h", "fa-ellipsis-v", "fa-envelope", "fa-envelope-o", "fa-envelope-square", "fa-eraser", "fa-exchange", "fa-exclamation", "fa-exclamation-circle", "fa-exclamation-triangle", "fa-external-link", "fa-external-link-square", "fa-eye", "fa-eye-slash", "fa-eyedropper", "fa-fax", "fa-female", "fa-fighter-jet", "fa-file-archive-o", "fa-file-audio-o", "fa-file-code-o", "fa-file-excel-o", "fa-file-image-o", "fa-file-movie-o", "fa-file-pdf-o", "fa-file-photo-o", "fa-file-picture-o", "fa-file-powerpoint-o", "fa-file-sound-o", "fa-file-video-o", "fa-file-word-o", "fa-file-zip-o", "fa-film", "fa-filter", "fa-fire", "fa-fire-extinguisher", "fa-flag", "fa-flag-checkered", "fa-flag-o", "fa-flash", "fa-flask", "fa-folder", "fa-folder-o", "fa-folder-open", "fa-folder-open-o", "fa-frown-o", "fa-futbol-o", "fa-gamepad", "fa-gavel", "fa-gear", "fa-gears", "fa-genderless", "fa-gift", "fa-glass", "fa-globe", "fa-graduation-cap", "fa-group", "fa-hdd-o", "fa-headphones", "fa-heart", "fa-heart-o", "fa-heartbeat", "fa-history", "fa-home", "fa-hotel", "fa-image", "fa-inbox", "fa-info", "fa-info-circle", "fa-institution", "fa-key", "fa-keyboard-o", "fa-language", "fa-laptop", "fa-leaf", "fa-legal", "fa-lemon-o", "fa-level-down", "fa-level-up", "fa-life-bouy", "fa-life-buoy", "fa-life-ring", "fa-life-saver", "fa-lightbulb-o", "fa-line-chart", "fa-location-arrow", "fa-lock", "fa-magic", "fa-magnet", "fa-mail-forward", "fa-mail-reply", "fa-mail-reply-all", "fa-male", "fa-map-marker", "fa-meh-o", "fa-microphone", "fa-microphone-slash", "fa-minus", "fa-minus-circle", "fa-minus-square", "fa-minus-square-o", "fa-mobile", "fa-mobile-phone", "fa-money", "fa-moon-o", "fa-mortar-board", "fa-motorcycle", "fa-music", "fa-navicon", "fa-newspaper-o", "fa-paint-brush", "fa-paper-plane", "fa-paper-plane-o", "fa-paw", "fa-pencil", "fa-pencil-square", "fa-pencil-square-o", "fa-phone", "fa-phone-square", "fa-photo", "fa-picture-o", "fa-pie-chart", "fa-plane", "fa-plug", "fa-plus", "fa-plus-circle", "fa-plus-square", "fa-plus-square-o", "fa-power-off", "fa-print", "fa-puzzle-piece", "fa-qrcode", "fa-question", "fa-question-circle", "fa-quote-left", "fa-quote-right", "fa-random", "fa-recycle", "fa-refresh", "fa-remove", "fa-reorder", "fa-reply", "fa-reply-all", "fa-retweet", "fa-road", "fa-rocket", "fa-rss", "fa-rss-square", "fa-search", "fa-search-minus", "fa-search-plus", "fa-send", "fa-send-o", "fa-server", "fa-share", "fa-share-alt", "fa-share-alt-square", "fa-share-square", "fa-share-square-o", "fa-shield", "fa-ship", "fa-shopping-cart", "fa-sign-in", "fa-sign-out", "fa-signal", "fa-sitemap", "fa-sliders", "fa-smile-o", "fa-soccer-ball-o", "fa-sort", "fa-sort-alpha-asc", "fa-sort-alpha-desc", "fa-sort-amount-asc", "fa-sort-amount-desc", "fa-sort-asc", "fa-sort-desc", "fa-sort-down", "fa-sort-numeric-asc", "fa-sort-numeric-desc", "fa-sort-up", "fa-space-shuttle", "fa-spinner", "fa-spoon", "fa-square", "fa-square-o", "fa-star", "fa-star-half", "fa-star-half-empty", "fa-star-half-full", "fa-star-half-o", "fa-star-o", "fa-street-view", "fa-suitcase", "fa-sun-o", "fa-support", "fa-tablet", "fa-tachometer", "fa-tag", "fa-tags", "fa-tasks", "fa-taxi", "fa-terminal", "fa-thumb-tack", "fa-thumbs-down", "fa-thumbs-o-down", "fa-thumbs-o-up", "fa-thumbs-up", "fa-ticket", "fa-times", "fa-times-circle", "fa-times-circle-o", "fa-tint", "fa-toggle-down", "fa-toggle-left", "fa-toggle-off", "fa-toggle-on", "fa-toggle-right", "fa-toggle-up", "fa-trash", "fa-trash-o", "fa-tree", "fa-trophy", "fa-truck", "fa-tty", "fa-umbrella", "fa-university", "fa-unlock", "fa-unlock-alt", "fa-unsorted", "fa-upload", "fa-user", "fa-user-plus", "fa-user-secret", "fa-user-times", "fa-users", "fa-video-camera", "fa-volume-down", "fa-volume-off", "fa-volume-up", "fa-warning", "fa-wheelchair", "fa-wifi", "fa-wrench", "fa-ambulance", "fa-subway", "fa-train", "fa-mars", "fa-mars-double", "fa-mars-stroke", "fa-mars-stroke-h", "fa-mars-stroke-v", "fa-mercury", "fa-neuter", "fa-transgender", "fa-transgender-alt", "fa-venus", "fa-venus-double", "fa-venus-mars", "fa-file", "fa-file-o", "fa-file-text", "fa-file-text-o", "fa-cc-amex", "fa-cc-discover", "fa-cc-mastercard", "fa-cc-paypal", "fa-cc-stripe", "fa-cc-visa", "fa-google-wallet", "fa-paypal", "fa-bitcoin", "fa-btc", "fa-cny", "fa-dollar", "fa-eur", "fa-euro", "fa-gbp", "fa-ils", "fa-inr", "fa-jpy", "fa-krw", "fa-rmb", "fa-rouble", "fa-rub", "fa-ruble", "fa-rupee", "fa-shekel", "fa-sheqel", "fa-try", "fa-turkish-lira", "fa-usd", "fa-won", "fa-yen", "fa-align-center", "fa-align-justify", "fa-align-left", "fa-align-right", "fa-bold", "fa-chain", "fa-chain-broken", "fa-clipboard", "fa-columns", "fa-copy", "fa-cut", "fa-dedent", "fa-files-o", "fa-floppy-o", "fa-font", "fa-header", "fa-indent", "fa-italic", "fa-link", "fa-list", "fa-list-alt", "fa-list-ol", "fa-list-ul", "fa-outdent", "fa-paperclip", "fa-paragraph", "fa-paste", "fa-repeat", "fa-rotate-left", "fa-rotate-right", "fa-save", "fa-scissors", "fa-strikethrough", "fa-subscript", "fa-superscript", "fa-table", "fa-text-height", "fa-text-width", "fa-th", "fa-th-large", "fa-th-list", "fa-underline", "fa-undo", "fa-unlink", "fa-angle-double-down", "fa-angle-double-left", "fa-angle-double-right", "fa-angle-double-up", "fa-angle-down", "fa-angle-left", "fa-angle-right", "fa-angle-up", "fa-arrow-circle-down", "fa-arrow-circle-left", "fa-arrow-circle-o-down", "fa-arrow-circle-o-left", "fa-arrow-circle-o-right", "fa-arrow-circle-o-up", "fa-arrow-circle-right", "fa-arrow-circle-up", "fa-arrow-down", "fa-arrow-left", "fa-arrow-right", "fa-arrow-up", "fa-arrows-alt", "fa-caret-down", "fa-caret-left", "fa-caret-right", "fa-caret-up", "fa-chevron-circle-down", "fa-chevron-circle-left", "fa-chevron-circle-right", "fa-chevron-circle-up", "fa-chevron-down", "fa-chevron-left", "fa-chevron-right", "fa-chevron-up", "fa-hand-o-down", "fa-hand-o-left", "fa-hand-o-right", "fa-hand-o-up", "fa-long-arrow-down", "fa-long-arrow-left", "fa-long-arrow-right", "fa-long-arrow-up", "fa-backward", "fa-compress", "fa-eject", "fa-expand", "fa-fast-backward", "fa-fast-forward", "fa-forward", "fa-pause", "fa-play", "fa-play-circle", "fa-play-circle-o", "fa-step-backward", "fa-step-forward", "fa-stop", "fa-youtube-play", "fa-adn", "fa-android", "fa-angellist", "fa-apple", "fa-behance", "fa-behance-square", "fa-bitbucket", "fa-bitbucket-square", "fa-buysellads", "fa-codepen", "fa-connectdevelop", "fa-css3", "fa-dashcube", "fa-delicious", "fa-deviantart", "fa-digg", "fa-dribbble", "fa-dropbox", "fa-drupal", "fa-empire", "fa-facebook", "fa-facebook-f", "fa-facebook-official", "fa-facebook-square", "fa-flickr", "fa-forumbee", "fa-foursquare", "fa-ge", "fa-git", "fa-git-square", "fa-github", "fa-github-alt", "fa-github-square", "fa-gittip", "fa-google", "fa-google-plus", "fa-google-plus-square", "fa-gratipay", "fa-hacker-news", "fa-html5", "fa-instagram", "fa-ioxhost", "fa-joomla", "fa-jsfiddle", "fa-lastfm", "fa-lastfm-square", "fa-leanpub", "fa-linkedin", "fa-linkedin-square", "fa-linux", "fa-maxcdn", "fa-meanpath", "fa-medium", "fa-openid", "fa-pagelines", "fa-pied-piper", "fa-pied-piper-alt", "fa-pinterest", "fa-pinterest-p", "fa-pinterest-square", "fa-qq", "fa-ra", "fa-rebel", "fa-reddit", "fa-reddit-square", "fa-renren", "fa-sellsy", "fa-shirtsinbulk", "fa-simplybuilt", "fa-skyatlas", "fa-skype", "fa-slack", "fa-slideshare", "fa-soundcloud", "fa-spotify", "fa-stack-exchange", "fa-stack-overflow", "fa-steam", "fa-steam-square", "fa-stumbleupon", "fa-stumbleupon-circle", "fa-tencent-weibo", "fa-trello", "fa-tumblr", "fa-tumblr-square", "fa-twitch", "fa-twitter", "fa-twitter-square", "fa-viacoin", "fa-vimeo-square", "fa-vine", "fa-vk", "fa-wechat", "fa-weibo", "fa-weixin", "fa-whatsapp", "fa-windows", "fa-wordpress", "fa-xing", "fa-xing-square", "fa-yahoo", "fa-yelp", "fa-youtube", "fa-youtube-square", "fa-h-square", "fa-hospital-o", "fa-medkit", "fa-stethoscope", "fa-user-md"]
  459. }
  460. });
  461. $.components.register("iconpickerWb", {
  462. mode: "default",
  463. defaults: {
  464. fullClassFormatter: function(value) {
  465. return "icon " + value;
  466. },
  467. templates: {
  468. popover: '<div class="iconpicker-popover popover"><div class="arrow"></div>' + '<div class="popover-title"></div><div class="popover-content"></div></div>',
  469. footer: '<div class="popover-footer"></div>',
  470. buttons: '<button class="iconpicker-btn iconpicker-btn-cancel btn btn-default btn-sm">取消</button>' + ' <button class="iconpicker-btn iconpicker-btn-accept btn btn-primary btn-sm">确认</button>',
  471. search: '<input type="search" class="form-control iconpicker-search" placeholder="查找图标">',
  472. iconpicker: '<div class="iconpicker"><div class="iconpicker-items"></div></div>',
  473. iconpickerItem: '<a role="button" href="#" class="iconpicker-item"><i></i></a>'
  474. },
  475. icons: ["wb-dashboard","wb-inbox","wb-cloud","wb-bell","wb-book","wb-bookmark","wb-tag","wb-library","wb-share","wb-reply","wb-refresh","wb-move","wb-chat","wb-chat-working","wb-chat-text","wb-chat-group","wb-envelope","wb-envelope-open","wb-user","wb-user-circle","wb-users","wb-user-add","wb-grid-9","wb-grid-4","wb-menu","wb-layout","wb-fullscreen","wb-fullscreen-exit","wb-expand","wb-contract","wb-arrow-expand","wb-arrow-shrink","wb-desktop","wb-mobile","wb-signal","wb-power","wb-more-horizontal","wb-more-vertical","wb-globe","wb-map","wb-flag","wb-pie-chart","wb-stats-bars","wb-pluse","wb-home","wb-shopping-cart","wb-payment","wb-briefcase","wb-search","wb-zoom-in","wb-zoom-out","wb-download","wb-upload","wb-sort-asc","wb-sort-des","wb-graph-up","wb-graph-down","wb-replay","wb-edit","wb-pencil","wb-rubber","wb-crop","wb-eye","wb-eye-close","wb-image","wb-gallery","wb-video","wb-camera","wb-folder","wb-clipboard","wb-order","wb-file","wb-copy","wb-add-file","wb-print","wb-calendar","wb-time","wb-trash","wb-plugin","wb-extension","wb-memory","wb-settings","wb-scissor","wb-wrench","wb-hammer","wb-lock","wb-unlock","wb-volume-low","wb-volume-high","wb-volume-off","wb-pause","wb-play","wb-stop","wb-musical","wb-random","wb-reload","wb-loop","wb-text","wb-bold","wb-italic","wb-underline","wb-format-clear","wb-text-type","wb-table","wb-attach-file","wb-paperclip","wb-link-intact","wb-link","wb-link-broken","wb-indent-increase","wb-indent-decrease","wb-align-justify","wb-align-left","wb-align-center","wb-align-right","wb-list-numbered","wb-list-bulleted","wb-list","wb-emoticon","wb-quote-right","wb-code","wb-code-working","wb-code-unfold","wb-chevron-right","wb-chevron-left","wb-chevron-left-mini","wb-chevron-right-mini","wb-chevron-up","wb-chevron-down","wb-chevron-up-mini","wb-chevron-down-mini","wb-arrow-left","wb-arrow-right","wb-arrow-up","wb-arrow-down","wb-dropdown","wb-dropup","wb-dropright","wb-dropleft","wb-sort-vertical","wb-triangle-left","wb-triangle-right","wb-triangle-down","wb-triangle-up","wb-check-circle","wb-check","wb-check-mini","wb-close","wb-close-mini","wb-plus-circle","wb-plus","wb-minus-circle","wb-minus","wb-alert-circle","wb-alert","wb-help-circle","wb-help","wb-info-circle","wb-info","wb-warning","wb-heart","wb-heart-outline","wb-star","wb-star-half","wb-star-outline","wb-thumb-up","wb-thumb-down","wb-small-point","wb-medium-point","wb-large-point"]
  476. }
  477. });
  478. })(window, document, jQuery);
  479. (function(window, document, $){
  480. "use strict";
  481. $.components.register("formatter", {
  482. mode: "init",
  483. defaults: {
  484. persistent: true
  485. },
  486. init: function (context, iframe) {
  487. var iframe$ = iframe ? iframe.$ : $;
  488. if (!iframe$.fn.formatter) {
  489. return;
  490. }
  491. var defaults = $.components.getDefaults("formatter"),
  492. browserName = navigator.userAgent.toLowerCase(),
  493. ieOptions;
  494. if (/msie/i.test(browserName) && !/opera/.test(browserName)) {
  495. ieOptions = {
  496. persistent: false
  497. };
  498. } else {
  499. ieOptions = {};
  500. }
  501. $('[data-plugin="formatter"]', context).each(function () {
  502. var options = $.extend({}, defaults, ieOptions, $(this).data(iframe$));
  503. if (options.pattern) {
  504. options.pattern = options.pattern.replace(/\[\[/g, '{{').replace(/\]\]/g, '}}');
  505. }
  506. iframe$(this).formatter(options);
  507. });
  508. }
  509. });
  510. })(window, document, jQuery);
  511. (function(window, document, $){
  512. "use strict";
  513. $.components.register("formValidation", {
  514. mode: "default",
  515. defaults: {
  516. locale:'zh_CN',
  517. framework: 'bootstrap',
  518. excluded: ':disabled',
  519. icon: {
  520. valid: 'icon wb-check',
  521. invalid: 'icon wb-close',
  522. validating: 'icon wb-refresh'
  523. }
  524. }
  525. });
  526. })(window, document, jQuery);
  527. (function (window, document, $) {
  528. "use strict";
  529. $.components.register("gauge", {
  530. mode: "init",
  531. defaults: {
  532. lines: 12,
  533. angle: 0.12,
  534. lineWidth: 0.4,
  535. pointer: {
  536. length: 0.68,
  537. strokeWidth: 0.03,
  538. color: $.colors("blue-grey", 400)
  539. },
  540. limitMax: true,
  541. colorStart: $.colors("blue-grey", 200),
  542. colorStop: $.colors("blue-grey", 200),
  543. strokeColor: $.colors("purple", 500),
  544. generateGradient: true
  545. },
  546. init: function (context, iframe) {
  547. var iframe$ = iframe ? iframe.$ : $, Gauge = (iframe && iframe.Gauge) ? iframe.Gauge : window.Gauge, defaults;
  548. if (typeof Gauge === undefined) {
  549. return;
  550. }
  551. defaults = $.components.getDefaults("gauge");
  552. $('[data-plugin="gauge"]', context).each(function () {
  553. var $this = $(this),
  554. options = $this.data(iframe$),
  555. $text = $this.find('.gauge-label'),
  556. $canvas = $this.find("canvas");
  557. options = $.extend(true, {}, defaults, options);
  558. if ($canvas.length === 0) {
  559. return;
  560. }
  561. var gauge = new Gauge($canvas[0]).setOptions(options);
  562. $this.data("gauge", gauge, iframe$);
  563. gauge.animationSpeed = 50;
  564. gauge.maxValue = $this.data('max-value', iframe$);
  565. gauge.set($this.data("value", iframe$));
  566. if ($text.length > 0) {
  567. gauge.setTextField($text[0]);
  568. }
  569. });
  570. }
  571. });
  572. $.components.register("donut", {
  573. mode: "init",
  574. defaults: {
  575. lines: 12,
  576. angle: 0.3,
  577. lineWidth: 0.08,
  578. pointer: {
  579. length: 0.9,
  580. strokeWidth: 0.035,
  581. color: $.colors("blue-grey", 400)
  582. },
  583. limitMax: false, // If true, the pointer will not go past the end of the gauge
  584. colorStart: $.colors("blue-grey", 200),
  585. colorStop: $.colors("blue-grey", 200),
  586. strokeColor: $.colors("purple", 500),
  587. generateGradient: true
  588. },
  589. init: function (context, iframe) {
  590. var iframe$ = iframe ? iframe.$ : $, Donut = (iframe && iframe.Donut) ? iframe.Donut : window.Donut, defaults;
  591. if (typeof Donut === undefined) {
  592. return;
  593. }
  594. defaults = $.components.getDefaults("donut");
  595. $('[data-plugin="donut"]', context).each(function () {
  596. var $this = $(this),
  597. options = $this.data(iframe$),
  598. $text = $this.find('.donut-label'),
  599. $canvas = $this.find("canvas");
  600. options = $.extend(true, {}, defaults, options);
  601. if ($canvas.length === 0) {
  602. return;
  603. }
  604. var donut = new Donut($canvas[0]).setOptions(options);
  605. $this.data("donut", donut, iframe$);
  606. donut.animationSpeed = 50;
  607. donut.maxValue = $this.data('max-value', iframe$);
  608. donut.set($this.data("value", iframe$));
  609. if ($text.length > 0) {
  610. donut.setTextField($text[0]);
  611. }
  612. });
  613. }
  614. });
  615. })(window, document, jQuery);
  616. (function (window, document, $) {
  617. "use strict";
  618. $.components.register("gridstack", {
  619. mode: "init",
  620. defaults: {
  621. cellHeight: 80,
  622. verticalMargin: 20
  623. },
  624. init: function (context, iframe) {
  625. var iframe$ = iframe ? iframe.$ : $;
  626. if (!iframe$.fn.gridstack) {
  627. return;
  628. }
  629. var defaults = $.components.getDefaults("gridstack");
  630. $('[data-plugin="gridstack"]', context).each(function () {
  631. var options = $.extend(true, {}, defaults, $(this).data(iframe$));
  632. iframe$(this).gridstack(options);
  633. });
  634. }
  635. });
  636. })(window, document, jQuery);
  637. (function(window, document, $){
  638. "use strict";
  639. $.components.register("highlight", {
  640. mode: "init",
  641. defaults: {},
  642. init: function (context, iframe) {
  643. var hljs = (iframe && iframe. hljs) ? iframe.hljs : window.hljs;
  644. if (typeof hljs === "undefined") {
  645. return;
  646. }
  647. $('[data-plugin="highlight"]', context).each(function (i, block) {
  648. hljs.highlightBlock(block);
  649. });
  650. }
  651. });
  652. })(window, document, jQuery);
  653. (function(window, document, $){
  654. "use strict";
  655. $.components.register("sortable", {
  656. defaults: {},
  657. mode: "default"
  658. });
  659. })(window, document, jQuery);
  660. (function(window, document, $){
  661. "use strict";
  662. $.components.register("iCheck", {
  663. mode: "default",
  664. defaults: {}
  665. });
  666. })(window, document, jQuery);
  667. (function (window, document, $) {
  668. "use strict";
  669. $.components.register("input-group-file", {
  670. api: function (context) {
  671. $(context).on("change", ".input-group-file [type=file]", function () {
  672. var $this = $(this),
  673. $text = $(this).parents('.input-group-file').find('.form-control'), value = "";
  674. $.each($this[0].files, function (i, file) {
  675. value += file.name + ", ";
  676. });
  677. value = value.substring(0, value.length - 2);
  678. $text.val(value);
  679. });
  680. }
  681. });
  682. })(window, document, jQuery);
  683. (function (window, document, $) {
  684. "use strict";
  685. $.components.register("isotope", {
  686. mode: "init",
  687. defaults: {},
  688. init: function (context, iframe) {
  689. var iframe$ = iframe ? iframe.$ : $,
  690. _window = iframe ? iframe : window, defaults;
  691. if (typeof iframe$.fn.isotope === "undefined") {
  692. return;
  693. }
  694. defaults = $.components.getDefaults('isotope');
  695. var callback = function () {
  696. $('[data-plugin="isotope"]', context).each(function () {
  697. var $this = iframe$(this),
  698. options = $.extend(true, {}, defaults, $this.data());
  699. $this.isotope(options);
  700. });
  701. };
  702. if (context !== document) {
  703. callback();
  704. } else {
  705. $(_window).on('load', function () {
  706. callback();
  707. });
  708. }
  709. }
  710. });
  711. })(window, document, jQuery);
  712. (function(window, document, $){
  713. "use strict";
  714. $.components.register("appear", {
  715. defaults: {},
  716. api: function (context, iframe) {
  717. var iframe$ = iframe ? iframe.$ : $;
  718. if (!iframe$.fn.appear) {
  719. return;
  720. }
  721. iframe$(context).on("appear", '[data-plugin="appear"]', function () {
  722. var $item = $(this),
  723. animate = $item.data("animate", iframe$);
  724. if ($item.hasClass('appear-no-repeat')) {
  725. return;
  726. }
  727. $item.removeClass("invisible").addClass('animation-' + animate);
  728. if ($item.data("repeat") === false) {
  729. $item.addClass('appear-no-repeat');
  730. }
  731. });
  732. iframe$(context).on("disappear", '[data-plugin="appear"]', function () {
  733. var $item = $(this),
  734. animate = $item.data("animate", iframe$);
  735. if ($item.hasClass('appear-no-repeat')) {
  736. return;
  737. }
  738. $item.addClass("invisible").removeClass('animation-' + animate);
  739. });
  740. },
  741. init: function (context, iframe) {
  742. var iframe$ = iframe ? iframe.$ : $;
  743. if (!iframe$.fn.appear) {
  744. return;
  745. }
  746. var defaults = $.components.getDefaults("appear");
  747. iframe$('[data-plugin="appear"]', context).appear(defaults);
  748. iframe$('[data-plugin="appear"]', context).not(':appeared').addClass("invisible");
  749. }
  750. });
  751. })(window, document, jQuery);
  752. (function(window, document, $){
  753. "use strict";
  754. $.components.register("knob", {
  755. mode: "default",
  756. defaults: {
  757. min: -50,
  758. max: 50,
  759. width: 120,
  760. height: 120,
  761. thickness: ".1"
  762. }
  763. });
  764. })(window, document, jQuery);
  765. (function(window, document, $){
  766. "use strict";
  767. $.components.register("labelauty", {
  768. mode: "default",
  769. defaults: {
  770. same_width: true,
  771. checked_label: "选中",
  772. unchecked_label: "未选中"
  773. }
  774. });
  775. })(window, document, jQuery);
  776. (function(window, document, $){
  777. "use strict";
  778. $.components.register("strength", {
  779. mode: "default",
  780. defaults: {
  781. showMeter: true,
  782. showToggle: false,
  783. templates: {
  784. toggle: '<div class="checkbox-custom checkbox-primary show-password-wrap"><input type="checkbox" class="{toggleClass}" title="显示/隐藏密码" id="show_password" /><label for="show_password">显示密码</label></div>',
  785. meter: '<div class="{meterClass}">{score}</div>',
  786. score: '<div class="{scoreClass}"></div>',
  787. main: '<div class="{containerClass}">{input}{meter}{toggle}</div>'
  788. },
  789. classes: {
  790. container: 'strength-container',
  791. status: 'strength-{status}',
  792. input: 'strength-input',
  793. toggle: 'strength-toggle',
  794. meter: 'strength-meter',
  795. score: 'strength-score'
  796. },
  797. scoreLables: {
  798. invalid: 'Invalid',
  799. weak: 'Weak',
  800. good: 'Good',
  801. strong: 'Strong'
  802. },
  803. scoreClasses: {
  804. invalid: 'strength-invalid',
  805. weak: 'strength-weak',
  806. good: 'strength-good',
  807. strong: 'strength-strong'
  808. }
  809. }
  810. });
  811. })(window, document, jQuery);
  812. (function(window, document, $){
  813. "use strict";
  814. $.components.register("treegrid", {
  815. mode: "default",
  816. defaults: {
  817. expanderExpandedClass: 'icon wb-triangle-down',
  818. expanderCollapsedClass: 'icon wb-triangle-right'
  819. }
  820. });
  821. })(window, document, jQuery);
  822. (function(window, document, $){
  823. "use strict";
  824. $.components.register("wizard", {
  825. mode: "default",
  826. defaults: {
  827. step: ".steps .step, .pearls .pearl",
  828. buttonLabels:{
  829. back:'上一步',
  830. next:'下一步',
  831. finish:'完成'
  832. },
  833. templates: {
  834. buttons: function () {
  835. var options = this.options;
  836. return '<div class="wizard-buttons">' +
  837. '<a class="btn btn-default btn-outline" href="#' + this.id + '" data-wizard="back" role="button">' + options.buttonLabels.back + '</a>' +
  838. '<a class="btn btn-primary btn-outline pull-right" href="#' + this.id + '" data-wizard="next" role="button">' + options.buttonLabels.next + '</a>' +
  839. '<a class="btn btn-success btn-outline pull-right" href="#' + this.id + '" data-wizard="finish" role="button">' + options.buttonLabels.finish + '</a>' +
  840. '</div>';
  841. }
  842. }
  843. }
  844. });
  845. })(window, document, jQuery);
  846. (function(window, document, $){
  847. "use strict";
  848. $.components.register("jstree", {
  849. mode: "default",
  850. defaults: {}
  851. });
  852. })(window, document, jQuery);
  853. (function(window, document, $){
  854. "use strict";
  855. $.components.register("timepicker", {
  856. mode: "default",
  857. defaults: {
  858. lang: {
  859. am: '上午',
  860. pm: '下午',
  861. AM: '上午',
  862. PM: '下午',
  863. decimal: '.',
  864. mins: '分钟',
  865. hr: '小时',
  866. hrs: '小时'
  867. },
  868. timeFormat: 'ag:i'
  869. }
  870. });
  871. })(window, document, jQuery);
  872. (function (window, document, $) {
  873. "use strict";
  874. $.components.register("ladda", {
  875. mode: "init",
  876. defaults: {
  877. timeout: 2000
  878. },
  879. init: function (context, iframe) {
  880. var Ladda = (iframe && iframe.Ladda) ? iframe.Ladda : window.Ladda, defaults;
  881. if (typeof Ladda === "undefined") {
  882. return;
  883. }
  884. defaults = $.components.getDefaults("ladda");
  885. Ladda.bind('[data-plugin="ladda"]', defaults);
  886. }
  887. });
  888. $.components.register("laddaProgress", {
  889. mode: "init",
  890. defaults: {},
  891. init: function (context, iframe) {
  892. var Ladda = (iframe && iframe.Ladda) ? iframe.Ladda : window.Ladda, defaults, options;
  893. if (typeof Ladda === 'undefined') {
  894. return;
  895. }
  896. defaults = $.components.getDefaults("laddaProgress");
  897. options = $.extend({}, defaults, {
  898. callback: function (instance) {
  899. var progress = 0;
  900. var interval = setInterval(function () {
  901. progress = Math.min(progress + Math.random() * 0.1, 1);
  902. instance.setProgress(progress);
  903. if (progress === 1) {
  904. instance.stop();
  905. clearInterval(interval);
  906. }
  907. }, 300);
  908. }
  909. });
  910. Ladda.bind('[data-plugin="laddaProgress"]', options);
  911. }
  912. });
  913. })(window, document, jQuery);
  914. (function (window, document, $) {
  915. "use strict";
  916. $.components.register("layer", {
  917. mode: 'init',
  918. defaults: {
  919. target: 'parent',
  920. confirmBtn: ['确认', '取消'],
  921. prompt:1
  922. },
  923. init: function (context, iframe) {
  924. var result = (iframe && iframe.layer),
  925. layer = result ? iframe.layer : window.layer, iframe$, defaults;
  926. if (typeof layer === 'undefined') {
  927. return;
  928. }
  929. iframe$ = iframe ? iframe.$ : $;
  930. defaults = this.defaults;
  931. $(context).on('click.site.layer', '[data-plugin="layer"]', function () {
  932. var $this = iframe$(this),
  933. options = $.extend(true, {}, defaults, $this.data());
  934. if(options.target === 'self'){
  935. if(!result){
  936. return console.error('您在当前页面还没有引入layer插件');
  937. }
  938. layer = iframe.layer;
  939. }else{
  940. layer = result ? window.layer : layer;
  941. }
  942. switch (options.type) {
  943. case "alert":
  944. layer.alert(options.message);
  945. break;
  946. case "msg":
  947. layer.msg(options.message);
  948. break;
  949. case "confirm":
  950. layer.confirm(options.title, {
  951. btn: options.confirmBtn
  952. },function () {
  953. layer.msg(options.successMessage);
  954. }, function () {
  955. layer.msg(options.cancelMessage);
  956. });
  957. break;
  958. case "prompt":
  959. layer.prompt({title:options.title, formType: options.prompt}, function (text, index) {
  960. layer.close(index);
  961. layer.msg(options.message);
  962. });
  963. break;
  964. case "tips":
  965. layer.tips(options.message, $this);
  966. break;
  967. case "load":
  968. layer.load(options.style, {time:options.time});
  969. break;
  970. }
  971. });
  972. }
  973. });
  974. })(window, document, jQuery);
  975. (function(window, document, $){
  976. "use strict";
  977. $.components.register("masonry", {
  978. mode: "init",
  979. defaults: {
  980. itemSelector: ".masonry-item"
  981. },
  982. init: function (context, iframe) {
  983. var iframe$ = iframe ? iframe.$ : $, defaults;
  984. if (typeof iframe$.fn.masonry === "undefined") {
  985. return;
  986. }
  987. defaults = $.components.getDefaults('masonry');
  988. $('[data-plugin="masonry"]', context).each(function () {
  989. var $this = iframe$(this),
  990. options = $.extend(true, {}, defaults, $this.data());
  991. $this.masonry(options);
  992. });
  993. }
  994. });
  995. })(window, document, jQuery);
  996. (function(window, document, $){
  997. "use strict";
  998. $.components.register("matchHeight", {
  999. mode: "init",
  1000. defaults: {},
  1001. init: function (context, iframe) {
  1002. var iframe$ = iframe ? iframe.$ : $, defaults;
  1003. if (typeof iframe$.fn.matchHeight === "undefined") {
  1004. return;
  1005. }
  1006. defaults = $.components.getDefaults('matchHeight');
  1007. $('[data-plugin="matchHeight"]', context).each(function () {
  1008. var $this = iframe$(this),
  1009. options = $.extend(true, {}, defaults, $this.data()),
  1010. matchSelector = $this.data('matchSelector');
  1011. if (matchSelector) {
  1012. $this.find(matchSelector).matchHeight(options);
  1013. } else {
  1014. $this.children().matchHeight(options);
  1015. }
  1016. });
  1017. }
  1018. });
  1019. })(window, document, jQuery);
  1020. (function(window, document, $){
  1021. "use strict";
  1022. $.components.register("material", {
  1023. init: function (context, iframe) {
  1024. $('.form-material', context).each(function () {
  1025. var $this = $(this), iframe$ = iframe ? iframe.$ : $, $control;
  1026. if ($this.data('material', iframe$) === true) {
  1027. return;
  1028. }
  1029. $control = $this.find('.form-control');
  1030. // Add hint label if required
  1031. if ($control.attr("data-hint")) {
  1032. $control.after("<div class=hint>" + $control.attr("data-hint") + "</div>");
  1033. }
  1034. if ($this.hasClass("floating")) {
  1035. // Add floating label if required
  1036. if ($control.hasClass("floating-label")) {
  1037. var placeholder = $control.attr("placeholder");
  1038. $control.attr("placeholder", null).removeClass("floating-label");
  1039. $control.after("<div class=floating-label>" + placeholder + "</div>");
  1040. }
  1041. // Set as empty if is empty
  1042. if ($control.val() === null || $control.val() === "undefined" || $control.val() === "") {
  1043. $control.addClass("empty");
  1044. }
  1045. }
  1046. // Support for file input
  1047. if ($control.next().is("[type=file]")) {
  1048. $this.addClass('form-material-file');
  1049. }
  1050. $this.data('material', true, iframe$);
  1051. });
  1052. },
  1053. api: function (context) {
  1054. function _isChar(e) {
  1055. if (typeof e.which === "undefined") {
  1056. return true;
  1057. } else if (typeof e.which === "number" && e.which > 0) {
  1058. return !e.ctrlKey && !e.metaKey && !e.altKey && e.which !== 8 && e.which !== 9;
  1059. }
  1060. return false;
  1061. }
  1062. $(context).on("keydown.site.material paste.site.material", ".form-control", function (e) {
  1063. if (_isChar(e)) {
  1064. $(this).removeClass("empty");
  1065. }
  1066. }).on("keyup.site.material change.site.material", ".form-control", function () {
  1067. var $this = $(this);
  1068. if ($this.val() === "" && (typeof $this[0].checkValidity !== "undefined" && $this[0].checkValidity())) {
  1069. $this.addClass("empty");
  1070. } else {
  1071. $this.removeClass("empty");
  1072. }
  1073. }).on("focus", ".form-material-file", function () {
  1074. $(this).find("input").addClass("focus");
  1075. })
  1076. .on("blur", ".form-material-file", function () {
  1077. $(this).find("input").removeClass("focus");
  1078. })
  1079. .on("change", ".form-material-file [type=file]", function () {
  1080. var $this = $(this);
  1081. var value = "";
  1082. $.each($this[0].files, function (i, file) {
  1083. value += file.name + ", ";
  1084. });
  1085. value = value.substring(0, value.length - 2);
  1086. if (value) {
  1087. $this.prev().removeClass("empty");
  1088. } else {
  1089. $this.prev().addClass("empty");
  1090. }
  1091. $this.prev().val(value);
  1092. });
  1093. }
  1094. });
  1095. })(window, document, jQuery);
  1096. (function(window, document, $){
  1097. "use strict";
  1098. $.components.register("multiSelect", {
  1099. mode: "default",
  1100. defaults: {}
  1101. });
  1102. })(window, document, jQuery);
  1103. (function(window, document, $){
  1104. "use strict";
  1105. $.components.register("nestable", {
  1106. mode: "default",
  1107. defaults: {}
  1108. });
  1109. })(window, document, jQuery);
  1110. (function(window, document, $){
  1111. "use strict";
  1112. $.components.register("nprogress", {
  1113. mode: "init",
  1114. defaults: {
  1115. minimum: 0.15,
  1116. trickleRate: 0.07,
  1117. trickleSpeed: 360,
  1118. showSpinner: false,
  1119. template: '<div class="bar" role="bar"></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'
  1120. },
  1121. init: function (context, iframe) {
  1122. var NProgress = (iframe && iframe.NProgress) ? iframe.NProgress : window.NProgress;
  1123. if (typeof NProgress === "undefined") {
  1124. return;
  1125. }
  1126. NProgress.configure(this.defaults);
  1127. }
  1128. });
  1129. })(window, document, jQuery);
  1130. (function(window, document, $){
  1131. "use strict";
  1132. $.components.register("owlCarousel", {
  1133. mode: "default",
  1134. defaults: {
  1135. loop: true,
  1136. nav: true,
  1137. dots: false,
  1138. dotsClass: "owl-dots owl-dots-fall",
  1139. responsive: {
  1140. 0: {
  1141. items: 1
  1142. },
  1143. 600: {
  1144. items: 3
  1145. }
  1146. }
  1147. }
  1148. });
  1149. })(window, document, jQuery);
  1150. (function(window, document, $){
  1151. "use strict";
  1152. $.components.register("panel", {
  1153. api: function (context, iframe) {
  1154. var $doc = $(context), iframe$ = iframe ? iframe.$ : $,
  1155. _window = iframe ? iframe : window;
  1156. $doc.off('click.site.panel');
  1157. $doc.on('click.site.panel', '[data-toggle="panel-fullscreen"]', function (e) {
  1158. e.preventDefault();
  1159. var $this = $(this),
  1160. $panel = $this.closest('.panel');
  1161. var api = $panel.data('panel-api', iframe$);
  1162. api.toggleFullscreen();
  1163. });
  1164. $doc.on('click.site.panel', '[data-toggle="panel-collapse"]', function (e) {
  1165. e.preventDefault();
  1166. var $this = $(this),
  1167. $panel = $this.closest('.panel');
  1168. var api = $panel.data('panel-api', iframe$);
  1169. api.toggleContent();
  1170. });
  1171. $doc.on('click.site.panel', '[data-toggle="panel-close"]', function (e) {
  1172. e.preventDefault();
  1173. var $this = $(this),
  1174. $panel = $this.closest('.panel');
  1175. var api = $panel.data('panel-api', iframe$);
  1176. api.close();
  1177. });
  1178. $doc.on('click.site.panel', '[data-toggle="panel-refresh"]', function (e) {
  1179. e.preventDefault();
  1180. var $this = $(this);
  1181. var $panel = $this.closest('.panel');
  1182. var api = $panel.data('panel-api', iframe$);
  1183. var callback = $this.data('loadCallback', iframe$);
  1184. if ($.isFunction(_window[callback])) {
  1185. api.load(_window[callback]);
  1186. } else {
  1187. api.load();
  1188. }
  1189. });
  1190. },
  1191. init: function (context, iframe) {
  1192. /*
  1193. * 这里所能触发的自定义事件仅为统一和frame中的。父级无法触发子级自定义事件
  1194. * */
  1195. var iframe$ = iframe ? iframe.$ : $;
  1196. $('.panel', context).each(function () {
  1197. var $this = $(this);
  1198. var isFullscreen = false;
  1199. var isClose = false;
  1200. var isCollapse = false;
  1201. var isLoading = false;
  1202. var $fullscreen = $this.find('[data-toggle="panel-fullscreen"]');
  1203. var $collapse = $this.find('[data-toggle="panel-collapse"]');
  1204. var $loading;
  1205. var self = this;
  1206. if ($this.hasClass('is-collapse')) {
  1207. isCollapse = true;
  1208. }
  1209. var api = {
  1210. load: function (callback) {
  1211. var type = $this.data('loader-type', iframe$);
  1212. if (!type) {
  1213. type = 'default';
  1214. }
  1215. $loading = $('<div class="panel-loading">' +
  1216. '<div class="loader loader-' + type + '"></div>' +
  1217. '</div>');
  1218. $loading.appendTo($this);
  1219. $this.addClass('is-loading');
  1220. $this.trigger('loading.uikit.panel');
  1221. isLoading = true;
  1222. if ($.isFunction(callback)) {
  1223. callback.call(self, this.done);
  1224. }
  1225. },
  1226. done: function () {
  1227. if (isLoading === true) {
  1228. $loading.remove();
  1229. $this.removeClass('is-loading');
  1230. $this.trigger('loading.done.uikit.panel');
  1231. }
  1232. },
  1233. toggleContent: function () {
  1234. if (isCollapse) {
  1235. this.showContent();
  1236. } else {
  1237. this.hideContent();
  1238. }
  1239. },
  1240. showContent: function () {
  1241. if (isCollapse !== false) {
  1242. $this.removeClass('is-collapse');
  1243. if ($collapse.hasClass('wb-plus')) {
  1244. $collapse.removeClass('wb-plus').addClass('wb-minus');
  1245. }
  1246. $this.trigger('shown.uikit.panel');
  1247. isCollapse = false;
  1248. }
  1249. },
  1250. hideContent: function () {
  1251. if (isCollapse !== true) {
  1252. $this.addClass('is-collapse');
  1253. if ($collapse.hasClass('wb-minus')) {
  1254. $collapse.removeClass('wb-minus').addClass('wb-plus');
  1255. }
  1256. $this.trigger('hidden.uikit.panel');
  1257. isCollapse = true;
  1258. }
  1259. },
  1260. toggleFullscreen: function () {
  1261. if (isFullscreen) {
  1262. this.leaveFullscreen();
  1263. } else {
  1264. this.enterFullscreen();
  1265. }
  1266. },
  1267. enterFullscreen: function () {
  1268. if (isFullscreen !== true) {
  1269. $this.addClass('is-fullscreen');
  1270. if ($fullscreen.hasClass('wb-expand')) {
  1271. $fullscreen.removeClass('wb-expand').addClass('wb-contract');
  1272. }
  1273. $this.trigger('enter.fullscreen.uikit.panel');
  1274. isFullscreen = true;
  1275. }
  1276. },
  1277. leaveFullscreen: function () {
  1278. if (isFullscreen !== false) {
  1279. $this.removeClass('is-fullscreen');
  1280. if ($fullscreen.hasClass('wb-contract')) {
  1281. $fullscreen.removeClass('wb-contract').addClass('wb-expand');
  1282. }
  1283. $this.trigger('leave.fullscreen.uikit.panel');
  1284. isFullscreen = false;
  1285. }
  1286. },
  1287. toggle: function () {
  1288. if (isClose) {
  1289. this.open();
  1290. } else {
  1291. this.close();
  1292. }
  1293. },
  1294. open: function () {
  1295. $this.on('open.uikit.panel', function () {
  1296. var $that = $(this);
  1297. if($that.siblings().length){
  1298. $that.show();
  1299. }else{
  1300. $that.parent().show();
  1301. }
  1302. });
  1303. if (isClose !== false) {
  1304. $this.removeClass('is-close');
  1305. $this.trigger('open.uikit.panel');
  1306. isClose = false;
  1307. }
  1308. },
  1309. close: function () {
  1310. $this.on('close.uikit.panel', function () {
  1311. var $that = $(this);
  1312. if($that.siblings().length){
  1313. $that.hide();
  1314. }else{
  1315. $that.parent().hide();
  1316. }
  1317. });
  1318. if (isClose !== true) {
  1319. $this.addClass('is-close');
  1320. $this.trigger('close.uikit.panel');
  1321. isClose = true;
  1322. }
  1323. }
  1324. };
  1325. $this.data('panel-api', api, iframe$);
  1326. });
  1327. }
  1328. });
  1329. })(window, document, jQuery);
  1330. (function (window, document, $) {
  1331. "use strict";
  1332. $.components.register("peityBar", {
  1333. mode: "init",
  1334. defaults: {
  1335. delimiter: ",",
  1336. fill: [$.colors("purple", 400)],
  1337. height: 18,
  1338. max: null,
  1339. min: 0,
  1340. padding: 0.1,
  1341. width: 44
  1342. },
  1343. init: function (context, iframe) {
  1344. var iframe$ = iframe ? iframe.$ : $, defaults;
  1345. if (!iframe$.fn.peity) {
  1346. return;
  1347. }
  1348. defaults = $.components.getDefaults("peityBar");
  1349. $('[data-plugin="peityBar"]', context).each(function () {
  1350. var $this = iframe$(this),
  1351. options = $this.data();
  1352. if (options.skin) {
  1353. if ($.colors(options.skin)) {
  1354. var skinColors = $.colors(options.skin);
  1355. defaults.fill = [skinColors[400]];
  1356. }
  1357. }
  1358. options = $.extend(true, {}, defaults, options);
  1359. $this.peity('bar', options);
  1360. });
  1361. }
  1362. });
  1363. $.components.register("peityDonut", {
  1364. mode: "init",
  1365. defaults: {
  1366. delimiter: null,
  1367. fill: [$.colors("purple", 700), $.colors("purple", 400), $.colors("purple", 200)],
  1368. height: null,
  1369. innerRadius: null,
  1370. radius: 11,
  1371. width: null
  1372. },
  1373. init: function (context, iframe) {
  1374. var iframe$ = iframe ? iframe.$ : $, defaults;
  1375. if (!iframe$.fn.peity) {
  1376. return;
  1377. }
  1378. defaults = $.components.getDefaults("peityDonut");
  1379. $('[data-plugin="peityDonut"]', context).each(function () {
  1380. var $this = iframe$(this),
  1381. options = $this.data();
  1382. if (options.skin) {
  1383. if ($.colors(options.skin)) {
  1384. var skinColors = $.colors(options.skin);
  1385. defaults.fill = [skinColors[700], skinColors[400], skinColors[200]];
  1386. }
  1387. }
  1388. options = $.extend(true, {}, defaults, options);
  1389. $this.peity('donut', options);
  1390. });
  1391. }
  1392. });
  1393. $.components.register("peityLine", {
  1394. mode: "init",
  1395. defaults: {
  1396. delimiter: ",",
  1397. fill: [$.colors("purple", 200)],
  1398. height: 18,
  1399. max: null,
  1400. min: 0,
  1401. stroke: $.colors("purple", 600),
  1402. strokeWidth: 1,
  1403. width: 44
  1404. },
  1405. init: function (context, iframe) {
  1406. var iframe$ = iframe ? iframe.$ : $, defaults;
  1407. if (!iframe$.fn.peity) {
  1408. return;
  1409. }
  1410. defaults = $.components.getDefaults("peityLine");
  1411. $('[data-plugin="peityLine"]', context).each(function () {
  1412. var $this = iframe$(this),
  1413. options = $this.data();
  1414. if (options.skin) {
  1415. if ($.colors(options.skin)) {
  1416. var skinColors = $.colors(options.skin);
  1417. defaults.fill = [skinColors[200]];
  1418. defaults.stroke = skinColors[600];
  1419. }
  1420. }
  1421. options = $.extend(true, {}, defaults, options);
  1422. $this.peity('line', options);
  1423. });
  1424. }
  1425. });
  1426. $.components.register("peityPie", {
  1427. mode: "init",
  1428. defaults: {
  1429. delimiter: null,
  1430. fill: [$.colors("purple", 700), $.colors("purple", 400), $.colors("purple", 200)],
  1431. height: null,
  1432. radius: 11,
  1433. width: null
  1434. },
  1435. init: function (context, iframe) {
  1436. var iframe$ = iframe ? iframe.$ : $, defaults;
  1437. if (!iframe$.fn.peity) {
  1438. return;
  1439. }
  1440. defaults = $.components.getDefaults("peityPie");
  1441. $('[data-plugin="peityPie"]', context).each(function () {
  1442. var $this = iframe$(this),
  1443. options = $this.data();
  1444. if (options.skin) {
  1445. if ($.colors(options.skin)) {
  1446. var skinColors = $.colors(options.skin);
  1447. defaults.fill = [skinColors[700], skinColors[400], skinColors[200]];
  1448. }
  1449. }
  1450. options = $.extend(true, {}, defaults, options);
  1451. $this.peity('pie', options);
  1452. });
  1453. }
  1454. });
  1455. })(window, document, jQuery);
  1456. (function(window, document, $){
  1457. "use strict";
  1458. $.components.register("plyr", {
  1459. mode: "init",
  1460. default: {
  1461. i18n: {
  1462. restart: "重新开始",
  1463. rewind: "向后 {seektime} 秒",
  1464. play: "播放",
  1465. pause: "暂停",
  1466. forward: "向前 {seektime} 秒",
  1467. buffered: "缓冲",
  1468. currentTime: "当前时间",
  1469. duration: "持续时间",
  1470. volume: "声音",
  1471. toggleMute: "切换静音",
  1472. toggleCaptions: "切换字幕",
  1473. toggleFullscreen: "切换全屏"
  1474. }
  1475. },
  1476. init: function (context, iframe) {
  1477. var plyr = (iframe && iframe.plyr) ? iframe.plyr : window.plyr;
  1478. if (typeof plyr === "undefined") {
  1479. return;
  1480. }
  1481. (function (d, u) {
  1482. var a = new XMLHttpRequest(),
  1483. b = d.body;
  1484. // Check for CORS support
  1485. if ("withCredentials" in a) {
  1486. a.open("GET", u, true);
  1487. a.send();
  1488. a.onload = function () {
  1489. var c = d.createElement("div");
  1490. c.style.display = "none";
  1491. c.innerHTML = a.responseText;
  1492. b.insertBefore(c, b.childNodes[0]);
  1493. };
  1494. }
  1495. })(context, "https://cdn.plyr.io/1.1.5/sprite.svg");
  1496. plyr.setup();
  1497. }
  1498. });
  1499. })(window, document, jQuery);
  1500. (function(window, document, $){
  1501. "use strict";
  1502. $.components.register("rating", {
  1503. mode: "init",
  1504. defaults: {
  1505. targetKeep: true,
  1506. icon: "font",
  1507. starType: "i",
  1508. starOff: "icon wb-star",
  1509. starOn: "icon wb-star orange-600",
  1510. cancelOff: "icon wb-minus-circle",
  1511. cancelOn: "icon wb-minus-circle orange-600",
  1512. starHalf: "icon wb-star-half orange-500",
  1513. cancelHint: '取消评分',
  1514. hints: ['很差', '差', '一般', '好', '非常好']
  1515. },
  1516. init: function (context, iframe) {
  1517. var iframe$ = iframe ? iframe.$ : $;
  1518. if (!iframe$.fn.raty) {
  1519. return;
  1520. }
  1521. var defaults = this.defaults;
  1522. $('[data-plugin="rating"]', context).each(function () {
  1523. var $this = iframe$(this);
  1524. var options = $.extend(true, {}, defaults, $this.data());
  1525. if (options.hints && typeof options.hints === 'string') {
  1526. options.hints = options.hints.split(',');
  1527. }
  1528. $this.raty(options);
  1529. });
  1530. }
  1531. });
  1532. })(window, document, jQuery);
  1533. (function(window, document, $){
  1534. "use strict";
  1535. $.components.register("select2", {
  1536. mode: "default",
  1537. defaults: {
  1538. width: "style",
  1539. language: "zh-CN"
  1540. }
  1541. });
  1542. })(window, document, jQuery);
  1543. (function(window, document, $){
  1544. "use strict";
  1545. $.components.register("selectable", {
  1546. mode: "init",
  1547. defaults: {
  1548. allSelector: '.selectable-all',
  1549. itemSelector: '.selectable-item',
  1550. rowSelector: 'tr',
  1551. rowSelectable: false,
  1552. rowActiveClass: 'active',
  1553. onChange: null
  1554. },
  1555. init: function (context, iframe) {
  1556. var iframe$ = iframe ? iframe.$ : $, defaults;
  1557. if (!iframe$.fn.asSelectable) {
  1558. return;
  1559. }
  1560. defaults = $.components.getDefaults('selectable');
  1561. $('[data-plugin="selectable"], [data-selectable="selectable"]', context).each(function () {
  1562. var options = $.extend({}, defaults, $(this).data(iframe$));
  1563. iframe$(this).asSelectable(options);
  1564. });
  1565. }
  1566. });
  1567. })(window, document, jQuery);
  1568. (function(window, document, $){
  1569. "use strict";
  1570. $.components.register("slidePanel", {
  1571. mode: "manual",
  1572. defaults: {
  1573. closeSelector: '.slidePanel-close',
  1574. mouseDragHandler: '.slidePanel-handler',
  1575. loading: {
  1576. template: function (options) {
  1577. return '<div class="' + options.classes.loading + '">' +
  1578. '<div class="loader loader-default"></div>' +
  1579. '</div>';
  1580. },
  1581. showCallback: function (options) {
  1582. this.$el.addClass(options.classes.loading + '-show');
  1583. },
  1584. hideCallback: function (options) {
  1585. this.$el.removeClass(options.classes.loading + '-show');
  1586. }
  1587. }
  1588. }
  1589. });
  1590. })(window, document, jQuery);
  1591. (function (window, document, $) {
  1592. "use strict";
  1593. $.components.register("slimScroll", {
  1594. mode: "default",
  1595. defaults: {
  1596. height : '100%',
  1597. size : '4px',
  1598. color: $.configs.colors['blue-grey']['500'],
  1599. position : 'right',
  1600. distance : '1px',
  1601. railVisible : true,
  1602. railColor : $.configs.colors['blue-grey']['300'],
  1603. railOpacity : 0.1,
  1604. railDraggable : true,
  1605. wheelStep : 15,
  1606. borderRadius: '4px',
  1607. railBorderRadius : '4px'
  1608. }
  1609. });
  1610. })(window, document, jQuery);
  1611. (function(window, document, $){
  1612. "use strict";
  1613. $.components.register("summernote", {
  1614. mode: "default",
  1615. defaults: {
  1616. height: 300
  1617. }
  1618. });
  1619. })(window, document, jQuery);
  1620. (function(window, document, $){
  1621. "use strict";
  1622. $.components.register("switchery", {
  1623. mode: "init",
  1624. defaults: {
  1625. color: $.colors("purple", 600)
  1626. },
  1627. init: function (context, iframe) {
  1628. var Switchery = (iframe && iframe.Switchery) ? iframe.Switchery : window.Switchery,
  1629. iframe$ = iframe ? iframe.$ : $, defaults;
  1630. if (typeof Switchery === "undefined") {
  1631. return;
  1632. }
  1633. defaults = $.components.getDefaults("switchery");
  1634. $('[data-plugin="switchery"]', context).each(function () {
  1635. var options = $.extend({}, defaults, $(this).data(iframe$));
  1636. new Switchery(this, options);
  1637. });
  1638. }
  1639. });
  1640. })(window, document, jQuery);
  1641. (function(window, document, $){
  1642. "use strict";
  1643. $.components.register("table", {
  1644. mode: "api",
  1645. api: function (context) {
  1646. var touch = typeof context.ontouchstart !== 'undefined',
  1647. type = 'click';
  1648. if (touch) {
  1649. type = 'touchstart';
  1650. }
  1651. $(context).on(type, '.table-section', function (e) {
  1652. if ("checkbox" !== e.target.type && "button" !== e.target.type && "a" !== e.target.tagName.toLowerCase() && !$(e.target).parent("div.checkbox-custom").length) {
  1653. if ($(this).hasClass("active")) {
  1654. $(this).removeClass("active");
  1655. } else {
  1656. $(this).siblings('.table-section').removeClass("active");
  1657. $(this).addClass("active");
  1658. }
  1659. }
  1660. });
  1661. }
  1662. });
  1663. })(window, document, jQuery);
  1664. (function(window, document, $){
  1665. "use strict";
  1666. $.components.register("verticalTab", {
  1667. mode: "init",
  1668. init: function (context, iframe) {
  1669. var iframe$ = iframe ? iframe.$ : $;
  1670. if (!iframe$.fn.matchHeight) {
  1671. return;
  1672. }
  1673. $('.nav-tabs-vertical', context).each(function () {
  1674. iframe$(this).children().matchHeight();
  1675. });
  1676. }
  1677. });
  1678. $.components.register("horizontalTab", {
  1679. mode: "init",
  1680. init: function (context,iframe) {
  1681. var iframe$ = iframe ? iframe.$ : $, $nav;
  1682. if (!iframe$.fn.responsiveHorizontalTabs) {
  1683. return;
  1684. }
  1685. $nav = $('[data-approve="nav-tabs"]', context);
  1686. $nav.each(function () {
  1687. var $item = iframe$(this),
  1688. options = $.extend(true, {}, $item.data());
  1689. $item.responsiveHorizontalTabs(options);
  1690. });
  1691. }
  1692. });
  1693. })(window, document, jQuery);
  1694. (function(window, document, $){
  1695. "use strict";
  1696. $.components.register("taskList", {
  1697. mode: "api",
  1698. api: function (context) {
  1699. $(context).on('change.site.task', '[data-role="task"]', function () {
  1700. var $list = $(this),
  1701. $checkbox = $list.find('[type="checkbox"]');
  1702. if ($checkbox.is(':checked')) {
  1703. $list.addClass('task-done');
  1704. } else {
  1705. $list.removeClass('task-done');
  1706. }
  1707. });
  1708. $('[data-role="task"]').trigger('change.site.task');
  1709. }
  1710. });
  1711. })(window, document, jQuery);
  1712. (function (window, document, $) {
  1713. "use strict";
  1714. $.components.register("toastr", {
  1715. mode: "api",
  1716. defaults: {},
  1717. api: function (context, iframe) {
  1718. var toastr = (iframe && iframe.toastr) ? iframe.toastr : window.toastr,
  1719. iframe$ = iframe ? iframe.$ : $, defaults;
  1720. if (typeof toastr === "undefined") {
  1721. return;
  1722. }
  1723. defaults = $.components.getDefaults("toastr");
  1724. $(context).on('click.site.toastr', '[data-plugin="toastr"]', function (e) {
  1725. e.preventDefault();
  1726. var $this = $(this),
  1727. options = $.extend(true, {}, defaults, $this.data(iframe$)),
  1728. message = options.message || '',
  1729. type = options.type || "info",
  1730. title = options.title || undefined;
  1731. switch (type) {
  1732. case "success":
  1733. toastr.success(message, title, options);
  1734. break;
  1735. case "warning":
  1736. toastr.warning(message, title, options);
  1737. break;
  1738. case "error":
  1739. toastr.error(message, title, options);
  1740. break;
  1741. case "info":
  1742. toastr.info(message, title, options);
  1743. break;
  1744. default:
  1745. toastr.info(message, title, options);
  1746. }
  1747. });
  1748. }
  1749. });
  1750. })(window, document, jQuery);
  1751. (function(window, document, $){
  1752. "use strict";
  1753. $.components.register("toolbar", {
  1754. mode: "init",
  1755. defaults: {
  1756. adjustment: 15,
  1757. zIndex:1900
  1758. },
  1759. init: function (context, iframe) {
  1760. var iframe$ = iframe ? iframe.$ : $, defaults;
  1761. if (!iframe$.fn.toolbar) {
  1762. return;
  1763. }
  1764. defaults = $.components.getDefaults("toolbar");
  1765. $('[data-plugin="toolbar"]', context).each(function () {
  1766. var $this = iframe$(this);
  1767. var content = $this.data("toolbar");
  1768. var options = $.extend(true, {}, defaults);
  1769. if (content) {
  1770. options.content = content;
  1771. }
  1772. $this.toolbar(options);
  1773. });
  1774. }
  1775. });
  1776. })(window, document, jQuery);
  1777. (function(window, document, $){
  1778. "use strict";
  1779. $.components.register("twbsPagination", {
  1780. mode: "default",
  1781. defaults: {
  1782. first: '<span class="icon fa-angle-double-left" title="第一页"></span>',
  1783. prev: '<span class="icon fa-angle-left" title="上一页"></span>',
  1784. next: '<span class="icon fa-angle-right" title="下一页"></span>',
  1785. last: '<span class="icon fa-angle-double-right" title="最后一页"></span>'
  1786. }
  1787. });
  1788. })(window, document, jQuery);
  1789. (function(window, document, $){
  1790. "use strict";
  1791. $.components.register("webuiPopover", {
  1792. mode: "default",
  1793. defaults: {
  1794. trigger: "click",
  1795. width: 320,
  1796. multi: true,
  1797. cloaseable: false,
  1798. style: "",
  1799. delay: 300,
  1800. padding: true
  1801. }
  1802. });
  1803. })(window, document, jQuery);