@stratusjs/angular 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular.bundle.js +810 -800
- package/dist/angular.bundle.min.js +1 -1
- package/package.json +1 -1
- package/src/selector/selector-autocomplete.component.html +4 -4
- package/src/selector/selector-autocomplete.component.min.html +1 -1
- package/src/selector/selector.component.html +12 -12
- package/src/selector/selector.component.js +11 -1
- package/src/selector/selector.component.js.map +1 -1
- package/src/selector/selector.component.min.html +1 -1
- package/src/selector/selector.component.min.js +1 -1
- package/src/selector/selector.component.ts +12 -0
- package/src/tree/tree-dialog.component.js.map +1 -1
- package/src/tree/tree-dialog.component.ts +1 -1
package/dist/angular.bundle.js
CHANGED
|
@@ -123523,7 +123523,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
123523
123523
|
this.styled = true;
|
|
123524
123524
|
this.refresh().then();
|
|
123525
123525
|
});
|
|
123526
|
-
this.hydrate(elementRef, sanitizer, ["title", "uid", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "type", "property", "endpoint", "ignorePriority", "get", "has", "log", "Stratus", "selectCtrl", "registry", "fetched", "data", "collection", "model", "dataSub", "onChange", "subscriber", "svgIcons", "styled", "empty", "iconRegistry", "sanitizer", "ref", "elementRef", "drop", "goToUrl", "toggleStatus", "remove", "fetchData", "dataDefer", "dataRef", "onDataChange", "prioritize", "getSvg", "addSvgIcon", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
|
|
123526
|
+
this.hydrate(elementRef, sanitizer, ["title", "uid", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "type", "property", "endpoint", "ignorePriority", "get", "has", "log", "Stratus", "selectCtrl", "registry", "fetched", "data", "collection", "model", "dataSub", "onChange", "subscriber", "svgIcons", "styled", "empty", "iconRegistry", "sanitizer", "ref", "elementRef", "drop", "goToUrl", "toggleStatus", "remove", "fetchData", "dataDefer", "dataRef", "getString", "onDataChange", "prioritize", "getSvg", "addSvgIcon", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
|
|
123527
123527
|
this.fetchData()
|
|
123528
123528
|
.then(data => {
|
|
123529
123529
|
if (!data || !(data instanceof EventManager$1)) {
|
|
@@ -123648,6 +123648,16 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
123648
123648
|
}
|
|
123649
123649
|
return models;
|
|
123650
123650
|
}
|
|
123651
|
+
getString(object, property) {
|
|
123652
|
+
if (!isObject$2(object)) {
|
|
123653
|
+
return null;
|
|
123654
|
+
}
|
|
123655
|
+
const variable = get(object, property);
|
|
123656
|
+
if (!isString(variable)) {
|
|
123657
|
+
return null;
|
|
123658
|
+
}
|
|
123659
|
+
return variable;
|
|
123660
|
+
}
|
|
123651
123661
|
onDataChange() {
|
|
123652
123662
|
this.prioritize();
|
|
123653
123663
|
this.dataDefer(this.subscriber);
|
|
@@ -161350,6 +161360,90 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
161350
161360
|
})
|
|
161351
161361
|
.catch(err => console.error('@stratusjs/angular failed to initialize!', err));
|
|
161352
161362
|
|
|
161363
|
+
System.register(["quill", "@stratusjs/core/environment"], function (exports_1, context_1) {
|
|
161364
|
+
var quill_1, environment_1, Break, Embed, QuillBreak;
|
|
161365
|
+
context_1 && context_1.id;
|
|
161366
|
+
return {
|
|
161367
|
+
setters: [
|
|
161368
|
+
function (quill_1_1) {
|
|
161369
|
+
quill_1 = quill_1_1;
|
|
161370
|
+
},
|
|
161371
|
+
function (environment_1_1) {
|
|
161372
|
+
environment_1 = environment_1_1;
|
|
161373
|
+
}
|
|
161374
|
+
],
|
|
161375
|
+
execute: function () {
|
|
161376
|
+
Break = quill_1.default.import('blots/break');
|
|
161377
|
+
Embed = quill_1.default.import('blots/embed');
|
|
161378
|
+
QuillBreak = class QuillBreak extends Break {
|
|
161379
|
+
length() {
|
|
161380
|
+
return 1;
|
|
161381
|
+
}
|
|
161382
|
+
value() {
|
|
161383
|
+
return '\n';
|
|
161384
|
+
}
|
|
161385
|
+
insertInto(parent, ref) {
|
|
161386
|
+
if (environment_1.cookie('env')) {
|
|
161387
|
+
console.log('insertInto:', parent, ref);
|
|
161388
|
+
}
|
|
161389
|
+
Embed.prototype.insertInto.call(this, parent, ref);
|
|
161390
|
+
}
|
|
161391
|
+
};
|
|
161392
|
+
exports_1("QuillBreak", QuillBreak);
|
|
161393
|
+
QuillBreak.blotName = 'break';
|
|
161394
|
+
QuillBreak.tagName = 'BR';
|
|
161395
|
+
}
|
|
161396
|
+
};
|
|
161397
|
+
});
|
|
161398
|
+
|
|
161399
|
+
System.register(["quill"], function (exports_1, context_1) {
|
|
161400
|
+
var quill_1, BaseImage, ATTRIBUTES, QuillImageFormatPlugin;
|
|
161401
|
+
context_1 && context_1.id;
|
|
161402
|
+
return {
|
|
161403
|
+
setters: [
|
|
161404
|
+
function (quill_1_1) {
|
|
161405
|
+
quill_1 = quill_1_1;
|
|
161406
|
+
}
|
|
161407
|
+
],
|
|
161408
|
+
execute: function () {
|
|
161409
|
+
BaseImage = quill_1.default.import('formats/image');
|
|
161410
|
+
ATTRIBUTES = [
|
|
161411
|
+
'alt',
|
|
161412
|
+
'height',
|
|
161413
|
+
'width',
|
|
161414
|
+
'stratus-src',
|
|
161415
|
+
'stratusSrc'
|
|
161416
|
+
];
|
|
161417
|
+
QuillImageFormatPlugin = class QuillImageFormatPlugin extends BaseImage {
|
|
161418
|
+
constructor() {
|
|
161419
|
+
super(...arguments);
|
|
161420
|
+
this.blotName = 'imageCustom';
|
|
161421
|
+
this.tagName = 'IMG';
|
|
161422
|
+
}
|
|
161423
|
+
format(name, value) {
|
|
161424
|
+
console.log('format:', name, value, this.domNode.getAttribute('src'));
|
|
161425
|
+
if (ATTRIBUTES.indexOf(name) === -1) {
|
|
161426
|
+
super.format(name, value);
|
|
161427
|
+
return;
|
|
161428
|
+
}
|
|
161429
|
+
if (!value) {
|
|
161430
|
+
this.domNode.removeAttribute(name);
|
|
161431
|
+
return;
|
|
161432
|
+
}
|
|
161433
|
+
if (name === 'stratus-src') {
|
|
161434
|
+
console.log('stratus-src:', value);
|
|
161435
|
+
}
|
|
161436
|
+
if (name === 'stratusSrc') {
|
|
161437
|
+
console.log('stratusSrc:', value);
|
|
161438
|
+
}
|
|
161439
|
+
this.domNode.setAttribute(name, value);
|
|
161440
|
+
}
|
|
161441
|
+
};
|
|
161442
|
+
exports_1("QuillImageFormatPlugin", QuillImageFormatPlugin);
|
|
161443
|
+
}
|
|
161444
|
+
};
|
|
161445
|
+
});
|
|
161446
|
+
|
|
161353
161447
|
System.register(["quill"], function (exports_1, context_1) {
|
|
161354
161448
|
var quill_1, debug, Logger, QuillHtmlEditPlugin;
|
|
161355
161449
|
context_1 && context_1.id;
|
|
@@ -161509,90 +161603,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
161509
161603
|
};
|
|
161510
161604
|
});
|
|
161511
161605
|
|
|
161512
|
-
System.register(["quill", "@stratusjs/core/environment"], function (exports_1, context_1) {
|
|
161513
|
-
var quill_1, environment_1, Break, Embed, QuillBreak;
|
|
161514
|
-
context_1 && context_1.id;
|
|
161515
|
-
return {
|
|
161516
|
-
setters: [
|
|
161517
|
-
function (quill_1_1) {
|
|
161518
|
-
quill_1 = quill_1_1;
|
|
161519
|
-
},
|
|
161520
|
-
function (environment_1_1) {
|
|
161521
|
-
environment_1 = environment_1_1;
|
|
161522
|
-
}
|
|
161523
|
-
],
|
|
161524
|
-
execute: function () {
|
|
161525
|
-
Break = quill_1.default.import('blots/break');
|
|
161526
|
-
Embed = quill_1.default.import('blots/embed');
|
|
161527
|
-
QuillBreak = class QuillBreak extends Break {
|
|
161528
|
-
length() {
|
|
161529
|
-
return 1;
|
|
161530
|
-
}
|
|
161531
|
-
value() {
|
|
161532
|
-
return '\n';
|
|
161533
|
-
}
|
|
161534
|
-
insertInto(parent, ref) {
|
|
161535
|
-
if (environment_1.cookie('env')) {
|
|
161536
|
-
console.log('insertInto:', parent, ref);
|
|
161537
|
-
}
|
|
161538
|
-
Embed.prototype.insertInto.call(this, parent, ref);
|
|
161539
|
-
}
|
|
161540
|
-
};
|
|
161541
|
-
exports_1("QuillBreak", QuillBreak);
|
|
161542
|
-
QuillBreak.blotName = 'break';
|
|
161543
|
-
QuillBreak.tagName = 'BR';
|
|
161544
|
-
}
|
|
161545
|
-
};
|
|
161546
|
-
});
|
|
161547
|
-
|
|
161548
|
-
System.register(["quill"], function (exports_1, context_1) {
|
|
161549
|
-
var quill_1, BaseImage, ATTRIBUTES, QuillImageFormatPlugin;
|
|
161550
|
-
context_1 && context_1.id;
|
|
161551
|
-
return {
|
|
161552
|
-
setters: [
|
|
161553
|
-
function (quill_1_1) {
|
|
161554
|
-
quill_1 = quill_1_1;
|
|
161555
|
-
}
|
|
161556
|
-
],
|
|
161557
|
-
execute: function () {
|
|
161558
|
-
BaseImage = quill_1.default.import('formats/image');
|
|
161559
|
-
ATTRIBUTES = [
|
|
161560
|
-
'alt',
|
|
161561
|
-
'height',
|
|
161562
|
-
'width',
|
|
161563
|
-
'stratus-src',
|
|
161564
|
-
'stratusSrc'
|
|
161565
|
-
];
|
|
161566
|
-
QuillImageFormatPlugin = class QuillImageFormatPlugin extends BaseImage {
|
|
161567
|
-
constructor() {
|
|
161568
|
-
super(...arguments);
|
|
161569
|
-
this.blotName = 'imageCustom';
|
|
161570
|
-
this.tagName = 'IMG';
|
|
161571
|
-
}
|
|
161572
|
-
format(name, value) {
|
|
161573
|
-
console.log('format:', name, value, this.domNode.getAttribute('src'));
|
|
161574
|
-
if (ATTRIBUTES.indexOf(name) === -1) {
|
|
161575
|
-
super.format(name, value);
|
|
161576
|
-
return;
|
|
161577
|
-
}
|
|
161578
|
-
if (!value) {
|
|
161579
|
-
this.domNode.removeAttribute(name);
|
|
161580
|
-
return;
|
|
161581
|
-
}
|
|
161582
|
-
if (name === 'stratus-src') {
|
|
161583
|
-
console.log('stratus-src:', value);
|
|
161584
|
-
}
|
|
161585
|
-
if (name === 'stratusSrc') {
|
|
161586
|
-
console.log('stratusSrc:', value);
|
|
161587
|
-
}
|
|
161588
|
-
this.domNode.setAttribute(name, value);
|
|
161589
|
-
}
|
|
161590
|
-
};
|
|
161591
|
-
exports_1("QuillImageFormatPlugin", QuillImageFormatPlugin);
|
|
161592
|
-
}
|
|
161593
|
-
};
|
|
161594
|
-
});
|
|
161595
|
-
|
|
161596
161606
|
System.register(["@stratusjs/runtime/stratus", "lodash", "quill"], function (exports_1, context_1) {
|
|
161597
161607
|
var stratus_1, lodash_1, quill_1, QuillInputButtonPlugin;
|
|
161598
161608
|
context_1 && context_1.id;
|
|
@@ -161730,382 +161740,430 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
161730
161740
|
};
|
|
161731
161741
|
});
|
|
161732
161742
|
|
|
161733
|
-
|
|
161734
|
-
|
|
161735
|
-
|
|
161736
|
-
|
|
161737
|
-
|
|
161738
|
-
|
|
161739
|
-
|
|
161740
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
161741
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
161742
|
-
};
|
|
161743
|
-
var FroalaEditorDirective_1, forms_1, core_1, froala_editor_1, FroalaEditorDirective;
|
|
161743
|
+
/*!
|
|
161744
|
+
* froala_editor v3.2.3 (https://www.froala.com/wysiwyg-editor)
|
|
161745
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
|
161746
|
+
* Copyright 2014-2020 Froala Labs
|
|
161747
|
+
*/
|
|
161748
|
+
System.register(["froala-editor"], function (exports_1, context_1) {
|
|
161749
|
+
var froala_editor_1;
|
|
161744
161750
|
context_1 && context_1.id;
|
|
161745
161751
|
return {
|
|
161746
161752
|
setters: [
|
|
161747
|
-
function (forms_1_1) {
|
|
161748
|
-
forms_1 = forms_1_1;
|
|
161749
|
-
},
|
|
161750
|
-
function (core_1_1) {
|
|
161751
|
-
core_1 = core_1_1;
|
|
161752
|
-
},
|
|
161753
161753
|
function (froala_editor_1_1) {
|
|
161754
161754
|
froala_editor_1 = froala_editor_1_1;
|
|
161755
161755
|
}
|
|
161756
161756
|
],
|
|
161757
161757
|
execute: function () {
|
|
161758
|
-
|
|
161759
|
-
|
|
161760
|
-
|
|
161761
|
-
|
|
161762
|
-
|
|
161763
|
-
|
|
161764
|
-
|
|
161765
|
-
|
|
161766
|
-
|
|
161767
|
-
|
|
161768
|
-
|
|
161769
|
-
|
|
161770
|
-
|
|
161771
|
-
|
|
161772
|
-
|
|
161773
|
-
|
|
161774
|
-
|
|
161775
|
-
|
|
161776
|
-
|
|
161777
|
-
|
|
161778
|
-
|
|
161779
|
-
|
|
161780
|
-
|
|
161781
|
-
this.zone = zone;
|
|
161782
|
-
}
|
|
161783
|
-
set froalaEditor(opts) {
|
|
161784
|
-
this._opts = this.clone(opts || this._opts);
|
|
161785
|
-
this._opts = Object.assign({}, this._opts);
|
|
161786
|
-
}
|
|
161787
|
-
set froalaModel(content) {
|
|
161788
|
-
this.updateEditor(content);
|
|
161789
|
-
}
|
|
161790
|
-
writeValue(content) {
|
|
161791
|
-
this.updateEditor(content);
|
|
161792
|
-
}
|
|
161793
|
-
registerOnChange(fn) {
|
|
161794
|
-
this.onChange = fn;
|
|
161795
|
-
}
|
|
161796
|
-
registerOnTouched(fn) {
|
|
161797
|
-
this.onTouched = fn;
|
|
161798
|
-
}
|
|
161799
|
-
clone(item) {
|
|
161800
|
-
const me = this;
|
|
161801
|
-
if (!item) {
|
|
161802
|
-
return item;
|
|
161758
|
+
/*!
|
|
161759
|
+
* froala_editor v3.2.3 (https://www.froala.com/wysiwyg-editor)
|
|
161760
|
+
* License https://froala.com/wysiwyg-editor/terms/
|
|
161761
|
+
* Copyright 2014-2020 Froala Labs
|
|
161762
|
+
*/
|
|
161763
|
+
if (((froala_editor_1.default && froala_editor_1.default.hasOwnProperty('default') ? froala_editor_1.default.default : froala_editor_1.default),
|
|
161764
|
+
Object.assign(froala_editor_1.default.DEFAULTS, {
|
|
161765
|
+
imageManagerLoadURL: 'https://i.froala.com/load-files',
|
|
161766
|
+
imageManagerLoadMethod: 'get',
|
|
161767
|
+
imageManagerLoadParams: {},
|
|
161768
|
+
imageManagerPreloader: null,
|
|
161769
|
+
imageManagerDeleteURL: '',
|
|
161770
|
+
imageManagerDeleteMethod: 'post',
|
|
161771
|
+
imageManagerDeleteParams: {},
|
|
161772
|
+
imageManagerPageSize: 12,
|
|
161773
|
+
imageManagerScrollOffset: 20,
|
|
161774
|
+
imageManagerToggleTags: !0,
|
|
161775
|
+
}),
|
|
161776
|
+
(froala_editor_1.default.PLUGINS.imageManagerCustom = (s) => {
|
|
161777
|
+
let g, l, i, o, d, m, c, f, u, p, h, v = s.$, M = 'image_manager', e = 10, b = 11, w = 12, C = 13, L = 14, D = 15, t = 21, r = 22, n = {};
|
|
161778
|
+
function y() {
|
|
161779
|
+
let e = v(window).outerWidth();
|
|
161780
|
+
return e < 768 ? 2 : e < 1200 ? 3 : 4;
|
|
161803
161781
|
}
|
|
161804
|
-
|
|
161805
|
-
|
|
161806
|
-
|
|
161807
|
-
|
|
161808
|
-
result = type(item);
|
|
161809
|
-
}
|
|
161810
|
-
});
|
|
161811
|
-
if (typeof result === 'undefined') {
|
|
161812
|
-
if (Object.prototype.toString.call(item) === '[object Array]') {
|
|
161813
|
-
result = [];
|
|
161814
|
-
item.forEach((child, index, array) => {
|
|
161815
|
-
result[index] = me.clone(child);
|
|
161816
|
-
});
|
|
161782
|
+
function I() {
|
|
161783
|
+
d.empty();
|
|
161784
|
+
for (let e = 0; e < h; e++) {
|
|
161785
|
+
d.append('<div class="fr-list-column"></div>');
|
|
161817
161786
|
}
|
|
161818
|
-
|
|
161819
|
-
|
|
161820
|
-
|
|
161787
|
+
}
|
|
161788
|
+
function P() {
|
|
161789
|
+
if (u < c.length
|
|
161790
|
+
&& (d.outerHeight() <= i.outerHeight() + s.opts.imageManagerScrollOffset
|
|
161791
|
+
|| i.scrollTop() + s.opts.imageManagerScrollOffset > d.outerHeight() - i.outerHeight())) {
|
|
161792
|
+
f++;
|
|
161793
|
+
for (let e = s.opts.imageManagerPageSize * (f - 1); e < Math.min(c.length, s.opts.imageManagerPageSize * f); e++) {
|
|
161794
|
+
a(c[e]);
|
|
161821
161795
|
}
|
|
161822
|
-
|
|
161823
|
-
|
|
161824
|
-
|
|
161796
|
+
}
|
|
161797
|
+
}
|
|
161798
|
+
function a(n) {
|
|
161799
|
+
let i = new Image(), o = v(document.createElement('div'))
|
|
161800
|
+
.attr('class', 'fr-image-container fr-empty fr-image-' + p++)
|
|
161801
|
+
.attr('data-loading', s.language.translate('Loading') + '..')
|
|
161802
|
+
.attr('data-deleting', s.language.translate('Deleting') + '..');
|
|
161803
|
+
R(!1),
|
|
161804
|
+
(i.onload = function () {
|
|
161805
|
+
o.height(Math.floor((o.width() / i.width) * i.height));
|
|
161806
|
+
let t = v(document.createElement('img'));
|
|
161807
|
+
if (n.thumb) {
|
|
161808
|
+
t.attr('src', n.thumb);
|
|
161825
161809
|
}
|
|
161826
161810
|
else {
|
|
161827
|
-
|
|
161828
|
-
|
|
161829
|
-
result[i] = me.clone(item[i]);
|
|
161811
|
+
if ((O(L, n), !n.url)) {
|
|
161812
|
+
return O(D, n), !1;
|
|
161830
161813
|
}
|
|
161814
|
+
t.attr('src', n.url);
|
|
161831
161815
|
}
|
|
161832
|
-
|
|
161833
|
-
|
|
161834
|
-
|
|
161835
|
-
|
|
161816
|
+
if ((n.url && t.attr('data-url', n.url), n.tag)) {
|
|
161817
|
+
if ((l.find('.fr-modal-more.fr-not-available').removeClass('fr-not-available'), l.find('.fr-modal-tags').show(), 0 <= n.tag.indexOf(','))) {
|
|
161818
|
+
for (let e = n.tag.split(','), a = 0; a < e.length; a++) {
|
|
161819
|
+
(e[a] =
|
|
161820
|
+
e[a].trim()), 0 === m.find('a[title="'.concat(e[a], '"]')).length && m.append('<a role="button" title="'.concat(e[a], '">').concat(e[a], '</a>'));
|
|
161821
|
+
}
|
|
161822
|
+
t.attr('data-tag', e.join());
|
|
161823
|
+
}
|
|
161824
|
+
else {
|
|
161825
|
+
0 === m.find('a[title="'.concat(n.tag.trim(), '"]')).length && m.append('<a role="button" title="'.concat(n.tag.trim(), '">').concat(n.tag.trim(), '</a>')), t.attr('data-tag', n.tag.trim());
|
|
161826
|
+
}
|
|
161836
161827
|
}
|
|
161837
|
-
|
|
161838
|
-
|
|
161839
|
-
|
|
161840
|
-
|
|
161841
|
-
|
|
161828
|
+
for (let r in (n.name && t.attr('alt', n.name), n)) {
|
|
161829
|
+
n.hasOwnProperty(r) && 'thumb' !== r && 'url' !== r && 'tag' !== r && t.attr('data-'.concat(r), n[r]);
|
|
161830
|
+
}
|
|
161831
|
+
o
|
|
161832
|
+
.append(t)
|
|
161833
|
+
.append(v(s.icon.create('imageManagerDelete')).addClass('fr-delete-img').attr('title', s.language.translate('Delete')))
|
|
161834
|
+
.append(v(s.icon.create('imageManagerInsert')).addClass('fr-insert-img').attr('title', s.language.translate('Insert'))),
|
|
161835
|
+
m.find('.fr-selected-tag').each(function (e, a) {
|
|
161836
|
+
j(t, a.text) || o.hide();
|
|
161837
|
+
}),
|
|
161838
|
+
t.on('load', function () {
|
|
161839
|
+
o.removeClass('fr-empty'),
|
|
161840
|
+
o.height('auto'),
|
|
161841
|
+
u++,
|
|
161842
|
+
E(T(parseInt(t
|
|
161843
|
+
.parent()
|
|
161844
|
+
.attr('class')
|
|
161845
|
+
.match(/fr-image-(\d+)/)[1], 10) + 1)),
|
|
161846
|
+
R(!1),
|
|
161847
|
+
u % s.opts.imageManagerPageSize === 0 && P();
|
|
161848
|
+
}),
|
|
161849
|
+
s.events.trigger('imageManager.imageLoaded', [t]);
|
|
161850
|
+
}),
|
|
161851
|
+
(i.onerror = () => {
|
|
161852
|
+
u++,
|
|
161853
|
+
o.remove(),
|
|
161854
|
+
E(T(parseInt(o.attr('class').match(/fr-image-(\d+)/)[1], 10) + 1)),
|
|
161855
|
+
O(e, n),
|
|
161856
|
+
u % s.opts.imageManagerPageSize === 0 && P();
|
|
161857
|
+
}),
|
|
161858
|
+
(i.src = n.thumb || n.url),
|
|
161859
|
+
S().append(o);
|
|
161842
161860
|
}
|
|
161843
|
-
|
|
161844
|
-
|
|
161845
|
-
|
|
161846
|
-
|
|
161847
|
-
|
|
161861
|
+
function S() {
|
|
161862
|
+
let r, n;
|
|
161863
|
+
return (d.find('.fr-list-column').each((e, a) => {
|
|
161864
|
+
let t = v(a);
|
|
161865
|
+
0 === e ? ((n = t.outerHeight()), (r = t)) : t.outerHeight() < n && ((n = t.outerHeight()), (r = t));
|
|
161866
|
+
}),
|
|
161867
|
+
r);
|
|
161848
161868
|
}
|
|
161849
|
-
|
|
161850
|
-
|
|
161869
|
+
function T(e) {
|
|
161870
|
+
e === undefined && (e = 0);
|
|
161871
|
+
for (let a = [], t = p - 1; e <= t; t--) {
|
|
161872
|
+
let r = d.find('.fr-image-'.concat(t));
|
|
161873
|
+
r.length && (a.push(r), v(document.createElement('div')).attr('id', 'fr-image-hidden-container').append(r), d.find('.fr-image-'.concat(t)).remove());
|
|
161874
|
+
}
|
|
161875
|
+
return a;
|
|
161851
161876
|
}
|
|
161852
|
-
|
|
161853
|
-
|
|
161877
|
+
function E(e) {
|
|
161878
|
+
for (let a = e.length - 1; 0 <= a; a--) {
|
|
161879
|
+
S().append(e[a]);
|
|
161880
|
+
}
|
|
161854
161881
|
}
|
|
161855
|
-
|
|
161856
|
-
if (!
|
|
161857
|
-
|
|
161882
|
+
function R(e) {
|
|
161883
|
+
if ((e === undefined && (e = !0), !g.isVisible())) {
|
|
161884
|
+
return !0;
|
|
161858
161885
|
}
|
|
161859
|
-
|
|
161860
|
-
|
|
161886
|
+
let a = y();
|
|
161887
|
+
if (a !== h) {
|
|
161888
|
+
h = a;
|
|
161889
|
+
let t = T();
|
|
161890
|
+
I(), E(t);
|
|
161861
161891
|
}
|
|
161892
|
+
s.modals.resize(M), e && P();
|
|
161862
161893
|
}
|
|
161863
|
-
|
|
161864
|
-
|
|
161865
|
-
|
|
161866
|
-
}
|
|
161867
|
-
else {
|
|
161868
|
-
this.setContent();
|
|
161894
|
+
function U(e) {
|
|
161895
|
+
for (let a, t = e[0].attributes, r = t.length, n = {}; r--;) {
|
|
161896
|
+
t[r] && 'src' !== (a = t[r].name) && (n[a] = t[r].value);
|
|
161869
161897
|
}
|
|
161898
|
+
return n;
|
|
161870
161899
|
}
|
|
161871
|
-
|
|
161872
|
-
|
|
161873
|
-
|
|
161874
|
-
|
|
161875
|
-
if (this._hasSpecialTag) {
|
|
161876
|
-
const attributeNodes = this._element.attributes;
|
|
161877
|
-
const attrs = {};
|
|
161878
|
-
for (let i = 0; i < attributeNodes.length; i++) {
|
|
161879
|
-
const attrName = attributeNodes[i].name;
|
|
161880
|
-
if (this._opts.angularIgnoreAttrs && this._opts.angularIgnoreAttrs.indexOf(attrName) != -1) {
|
|
161881
|
-
continue;
|
|
161882
|
-
}
|
|
161883
|
-
attrs[attrName] = attributeNodes[i].value;
|
|
161884
|
-
}
|
|
161885
|
-
if (this._element.innerHTML) {
|
|
161886
|
-
attrs[this.INNER_HTML_ATTR] = this._element.innerHTML;
|
|
161887
|
-
}
|
|
161888
|
-
modelContent = attrs;
|
|
161900
|
+
function x(e) {
|
|
161901
|
+
let a = v(e.currentTarget).siblings('img'), t = g.data('instance') || s, r = g.data('current-image');
|
|
161902
|
+
if ((s.modals.hide(M), t.image.showProgressBar(), r)) {
|
|
161903
|
+
r.data('fr-old-src', r.attr('src')), r.trigger('click');
|
|
161889
161904
|
}
|
|
161890
161905
|
else {
|
|
161891
|
-
|
|
161892
|
-
|
|
161893
|
-
|
|
161894
|
-
}
|
|
161895
|
-
}
|
|
161896
|
-
if (this._oldModel !== modelContent) {
|
|
161897
|
-
this._oldModel = modelContent;
|
|
161898
|
-
this.froalaModelChange.emit(modelContent);
|
|
161899
|
-
this.onChange(modelContent);
|
|
161906
|
+
t.events.focus(!0), t.selection.restore();
|
|
161907
|
+
let n = t.position.getBoundingRect(), i = n.left + n.width / 2 + v(s.doc).scrollLeft(), o = n.top + n.height + v(s.doc).scrollTop();
|
|
161908
|
+
t.popups.setContainer('image.insert', s.$sc), t.popups.show('image.insert', i, o);
|
|
161900
161909
|
}
|
|
161901
|
-
|
|
161902
|
-
}
|
|
161903
|
-
registerEvent(eventName, callback) {
|
|
161904
|
-
if (!eventName || !callback) {
|
|
161905
|
-
return;
|
|
161910
|
+
t.image.insert(a.data('url'), !1, U(a), r);
|
|
161906
161911
|
}
|
|
161907
|
-
|
|
161908
|
-
|
|
161912
|
+
function H(e) {
|
|
161913
|
+
let i = v(e.currentTarget).siblings('img'), a = s.language.translate('Are you sure? Image will be deleted.');
|
|
161914
|
+
confirm(a) &&
|
|
161915
|
+
(s.opts.imageManagerDeleteURL
|
|
161916
|
+
? !1 !== s.events.trigger('imageManager.beforeDeleteImage', [i]) &&
|
|
161917
|
+
(i.parent().addClass('fr-image-deleting'),
|
|
161918
|
+
v(this).ajax({
|
|
161919
|
+
method: s.opts.imageManagerDeleteMethod,
|
|
161920
|
+
url: s.opts.imageManagerDeleteURL,
|
|
161921
|
+
data: Object.assign(Object.assign({ src: i.attr('src') }, U(i)), s.opts.imageManagerDeleteParams),
|
|
161922
|
+
crossDomain: s.opts.requestWithCORS,
|
|
161923
|
+
withCredentials: s.opts.requestWithCredentials,
|
|
161924
|
+
headers: s.opts.requestHeaders,
|
|
161925
|
+
done(e, a, t) {
|
|
161926
|
+
s.events.trigger('imageManager.imageDeleted', [e]);
|
|
161927
|
+
let r = T(parseInt(i
|
|
161928
|
+
.parent()
|
|
161929
|
+
.attr('class')
|
|
161930
|
+
.match(/fr-image-(\d+)/)[1], 10) + 1);
|
|
161931
|
+
i.parent().remove(),
|
|
161932
|
+
E(r),
|
|
161933
|
+
(function n() {
|
|
161934
|
+
g.find('#fr-modal-tags > a').each(function () {
|
|
161935
|
+
0 === g.find('#fr-image-list [data-tag*="'.concat(v(this).text(), '"]')).length && v(this).removeClass('fr-selected-tag').hide();
|
|
161936
|
+
}),
|
|
161937
|
+
_();
|
|
161938
|
+
})(),
|
|
161939
|
+
R(!0);
|
|
161940
|
+
},
|
|
161941
|
+
fail(e) {
|
|
161942
|
+
O(t, e.response || e.responseText);
|
|
161943
|
+
},
|
|
161944
|
+
}))
|
|
161945
|
+
: O(r));
|
|
161909
161946
|
}
|
|
161910
|
-
|
|
161911
|
-
|
|
161912
|
-
|
|
161913
|
-
|
|
161914
|
-
|
|
161915
|
-
|
|
161916
|
-
|
|
161917
|
-
});
|
|
161918
|
-
this._editor.events.on('mousedown', function () {
|
|
161919
|
-
setTimeout(function () {
|
|
161920
|
-
self.onTouched();
|
|
161921
|
-
}, 0);
|
|
161922
|
-
});
|
|
161923
|
-
if (this._opts.immediateAngularModelUpdate) {
|
|
161924
|
-
this._editor.events.on('keyup', function () {
|
|
161925
|
-
setTimeout(function () {
|
|
161926
|
-
self.updateModel();
|
|
161927
|
-
}, 0);
|
|
161928
|
-
});
|
|
161929
|
-
}
|
|
161930
|
-
}
|
|
161931
|
-
this._editorInitialized = true;
|
|
161932
|
-
}
|
|
161933
|
-
createEditor() {
|
|
161934
|
-
if (this._editorInitialized) {
|
|
161935
|
-
return;
|
|
161936
|
-
}
|
|
161937
|
-
this.setContent(true);
|
|
161938
|
-
this.zone.runOutsideAngular(() => {
|
|
161939
|
-
if (!this._opts.events) {
|
|
161940
|
-
this._opts.events = {};
|
|
161941
|
-
}
|
|
161942
|
-
this.registerEvent('initialized', this._opts.events && this._opts.events.initialized);
|
|
161943
|
-
const existingInitCallback = this._opts.events.initialized;
|
|
161944
|
-
if (!this._opts.events.initialized || !this._opts.events.initialized.overridden) {
|
|
161945
|
-
this._opts.events.initialized = () => {
|
|
161946
|
-
this.initListeners();
|
|
161947
|
-
existingInitCallback && existingInitCallback.call(this._editor, this);
|
|
161948
|
-
};
|
|
161949
|
-
this._opts.events.initialized.overridden = true;
|
|
161950
|
-
}
|
|
161951
|
-
this._editor = new froala_editor_1.default(this._element, this._opts);
|
|
161952
|
-
});
|
|
161953
|
-
}
|
|
161954
|
-
setHtml() {
|
|
161955
|
-
this._editor.html.set(this._model || '');
|
|
161956
|
-
this._editor.undo.reset();
|
|
161957
|
-
this._editor.undo.saveStep();
|
|
161958
|
-
}
|
|
161959
|
-
setContent(firstTime = false) {
|
|
161960
|
-
const self = this;
|
|
161961
|
-
if (this._model || this._model === '') {
|
|
161962
|
-
this._oldModel = this._model;
|
|
161963
|
-
if (this._hasSpecialTag) {
|
|
161964
|
-
const tags = this._model;
|
|
161965
|
-
if (tags) {
|
|
161966
|
-
for (const attr in tags) {
|
|
161967
|
-
if (tags.hasOwnProperty(attr) && attr != this.INNER_HTML_ATTR) {
|
|
161968
|
-
this._element.setAttribute(attr, tags[attr]);
|
|
161969
|
-
}
|
|
161970
|
-
}
|
|
161971
|
-
if (tags.hasOwnProperty(this.INNER_HTML_ATTR)) {
|
|
161972
|
-
this._element.innerHTML = tags[this.INNER_HTML_ATTR];
|
|
161973
|
-
}
|
|
161974
|
-
}
|
|
161975
|
-
}
|
|
161976
|
-
else {
|
|
161977
|
-
if (firstTime) {
|
|
161978
|
-
this.registerEvent('initialized', function () {
|
|
161979
|
-
self.setHtml();
|
|
161980
|
-
});
|
|
161981
|
-
}
|
|
161982
|
-
else {
|
|
161983
|
-
self.setHtml();
|
|
161984
|
-
}
|
|
161985
|
-
}
|
|
161947
|
+
function O(e, a) {
|
|
161948
|
+
10 <= e && e < 20
|
|
161949
|
+
? o.hide()
|
|
161950
|
+
: 20 <= e && e < 30 && v('.fr-image-deleting').removeClass('fr-image-deleting'), s.events.trigger('imageManager.error', [
|
|
161951
|
+
{ code: e, message: n[e] },
|
|
161952
|
+
a
|
|
161953
|
+
]);
|
|
161986
161954
|
}
|
|
161987
|
-
|
|
161988
|
-
|
|
161989
|
-
|
|
161990
|
-
|
|
161991
|
-
|
|
161955
|
+
function q() {
|
|
161956
|
+
let e = l.find('.fr-modal-head-line').outerHeight(), a = m.outerHeight();
|
|
161957
|
+
l.toggleClass('fr-show-tags'), l.hasClass('fr-show-tags')
|
|
161958
|
+
? (l.css('height', e + a), i.css('marginTop', e + a), m.find('a').css('opacity', 1))
|
|
161959
|
+
: (l.css('height', e), i.css('marginTop', e), m.find('a').css('opacity', 0));
|
|
161992
161960
|
}
|
|
161993
|
-
|
|
161994
|
-
|
|
161995
|
-
|
|
161996
|
-
|
|
161961
|
+
function _() {
|
|
161962
|
+
let e = m.find('.fr-selected-tag');
|
|
161963
|
+
0 < e.length
|
|
161964
|
+
? (d.find('img').parents().show(),
|
|
161965
|
+
e.each((e, r) => {
|
|
161966
|
+
d.find('img').each(function (e, a) {
|
|
161967
|
+
let t = v(a);
|
|
161968
|
+
j(t, r.text) || t.parent().hide();
|
|
161969
|
+
});
|
|
161970
|
+
}))
|
|
161971
|
+
: d.find('img').parents().show(),
|
|
161972
|
+
E(T()),
|
|
161973
|
+
P();
|
|
161997
161974
|
}
|
|
161998
|
-
|
|
161999
|
-
|
|
162000
|
-
|
|
162001
|
-
|
|
162002
|
-
initialize: this.createEditor.bind(this),
|
|
162003
|
-
destroy: this.destroyEditor.bind(this),
|
|
162004
|
-
getEditor: this.getEditor.bind(this),
|
|
162005
|
-
};
|
|
162006
|
-
this.froalaInit.emit(controls);
|
|
162007
|
-
}
|
|
162008
|
-
ngAfterViewInit() {
|
|
162009
|
-
if (!this.froalaInit.observers.length) {
|
|
162010
|
-
this.createEditor();
|
|
161975
|
+
function k(e) {
|
|
161976
|
+
e.preventDefault();
|
|
161977
|
+
let a = v(e.currentTarget);
|
|
161978
|
+
a.toggleClass('fr-selected-tag'), s.opts.imageManagerToggleTags && a.siblings('a').removeClass('fr-selected-tag'), _();
|
|
162011
161979
|
}
|
|
162012
|
-
|
|
162013
|
-
|
|
161980
|
+
function j(e, a) {
|
|
161981
|
+
for (let t = (e.attr('data-tag') || '').split(','), r = 0; r < t.length; r++) {
|
|
161982
|
+
if (t[r] === a) {
|
|
161983
|
+
return !0;
|
|
161984
|
+
}
|
|
161985
|
+
}
|
|
161986
|
+
return !1;
|
|
162014
161987
|
}
|
|
162015
|
-
|
|
162016
|
-
|
|
162017
|
-
|
|
162018
|
-
|
|
162019
|
-
|
|
162020
|
-
|
|
162021
|
-
|
|
162022
|
-
|
|
162023
|
-
__metadata("design:paramtypes", [Object])
|
|
162024
|
-
], FroalaEditorDirective.prototype, "froalaEditor", null);
|
|
162025
|
-
__decorate([
|
|
162026
|
-
core_1.Input(),
|
|
162027
|
-
__metadata("design:type", Object),
|
|
162028
|
-
__metadata("design:paramtypes", [Object])
|
|
162029
|
-
], FroalaEditorDirective.prototype, "froalaModel", null);
|
|
162030
|
-
__decorate([
|
|
162031
|
-
core_1.Output(),
|
|
162032
|
-
__metadata("design:type", core_1.EventEmitter)
|
|
162033
|
-
], FroalaEditorDirective.prototype, "froalaModelChange", void 0);
|
|
162034
|
-
__decorate([
|
|
162035
|
-
core_1.Output(),
|
|
162036
|
-
__metadata("design:type", core_1.EventEmitter)
|
|
162037
|
-
], FroalaEditorDirective.prototype, "froalaInit", void 0);
|
|
162038
|
-
FroalaEditorDirective = FroalaEditorDirective_1 = __decorate([
|
|
162039
|
-
core_1.Directive({
|
|
162040
|
-
selector: '[froalaEditor]',
|
|
162041
|
-
exportAs: 'froalaEditor',
|
|
162042
|
-
providers: [
|
|
161988
|
+
return ((n[e] = 'Image cannot be loaded from the passed link.'),
|
|
161989
|
+
(n[b] = 'Error during load images request.'),
|
|
161990
|
+
(n[w] = 'Missing imageManagerLoadURL option.'),
|
|
161991
|
+
(n[C] = 'Parsing load response failed.'),
|
|
161992
|
+
(n[L] = 'Missing image thumb.'),
|
|
161993
|
+
(n[D] = 'Missing image URL.'),
|
|
161994
|
+
(n[t] = 'Error during delete image request.'),
|
|
161995
|
+
(n[r] = 'Missing imageManagerDeleteURL option.'),
|
|
162043
161996
|
{
|
|
162044
|
-
|
|
162045
|
-
|
|
162046
|
-
|
|
162047
|
-
|
|
161997
|
+
require: ['image'],
|
|
161998
|
+
_init: function z() {
|
|
161999
|
+
if (!s.$wp && 'IMG' !== s.el.tagName) {
|
|
162000
|
+
return !1;
|
|
162001
|
+
}
|
|
162002
|
+
},
|
|
162003
|
+
show: function G() {
|
|
162004
|
+
if (!g) {
|
|
162005
|
+
let e, a = '<button class="fr-command fr-btn fr-modal-more fr-not-available" id="fr-modal-more-'
|
|
162006
|
+
.concat(s.sid, '"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24""><path d="')
|
|
162007
|
+
.concat(froala_editor_1.default.SVG.tags, '"/></svg></button><h4 data-text="true">')
|
|
162008
|
+
.concat(s.language.translate('Manage Images'), '</h4></div>\n <div class="fr-modal-tags" id="fr-modal-tags">');
|
|
162009
|
+
(e = s.opts.imageManagerPreloader
|
|
162010
|
+
? '<img class="fr-preloader" id="fr-preloader" alt="'.concat(s.language.translate('Loading'), '.." src="').concat(s.opts.imageManagerPreloader, '" style="display: none;">')
|
|
162011
|
+
: '<span class="fr-preloader" id="fr-preloader" style="display: none;">'.concat(s.language.translate('Loading'), '</span>')),
|
|
162012
|
+
(e += '<div class="fr-image-list" id="fr-image-list"></div>');
|
|
162013
|
+
let t = s.modals.create(M, a, e);
|
|
162014
|
+
(g = t.$modal), (l = t.$head), (i = t.$body);
|
|
162015
|
+
}
|
|
162016
|
+
g.data('current-image', s.image.get()),
|
|
162017
|
+
s.modals.show(M),
|
|
162018
|
+
o ||
|
|
162019
|
+
(function r() {
|
|
162020
|
+
(o = g.find('#fr-preloader')),
|
|
162021
|
+
(d = g.find('#fr-image-list')),
|
|
162022
|
+
(m = g.find('#fr-modal-tags')),
|
|
162023
|
+
(h = y()),
|
|
162024
|
+
I(),
|
|
162025
|
+
l.css('height', l.find('.fr-modal-head-line').outerHeight()),
|
|
162026
|
+
s.events.$on(v(s.o_win), 'resize', () => {
|
|
162027
|
+
R(!!c);
|
|
162028
|
+
}),
|
|
162029
|
+
s.events.bindClick(d, '.fr-insert-img', x),
|
|
162030
|
+
s.events.bindClick(d, '.fr-delete-img', H),
|
|
162031
|
+
s.helpers.isMobile() &&
|
|
162032
|
+
(s.events.bindClick(d, 'div.fr-image-container', (e) => {
|
|
162033
|
+
g.find('.fr-mobile-selected').removeClass('fr-mobile-selected'),
|
|
162034
|
+
v(e.currentTarget).addClass('fr-mobile-selected');
|
|
162035
|
+
}),
|
|
162036
|
+
g.on(s._mousedown, () => {
|
|
162037
|
+
g.find('.fr-mobile-selected').removeClass('fr-mobile-selected');
|
|
162038
|
+
})),
|
|
162039
|
+
g.on(s._mousedown + ' ' + s._mouseup, (e) => {
|
|
162040
|
+
e.stopPropagation();
|
|
162041
|
+
}),
|
|
162042
|
+
g.on(s._mousedown, '*', () => {
|
|
162043
|
+
s.events.disableBlur();
|
|
162044
|
+
}),
|
|
162045
|
+
i.on('scroll', P),
|
|
162046
|
+
s.events.bindClick(g, 'button#fr-modal-more-'.concat(s.sid), q),
|
|
162047
|
+
s.events.bindClick(m, 'a', k);
|
|
162048
|
+
})(),
|
|
162049
|
+
(function n() {
|
|
162050
|
+
o.show(),
|
|
162051
|
+
d.find('.fr-list-column').empty(),
|
|
162052
|
+
s.opts.imageManagerLoadURL
|
|
162053
|
+
? v(this).ajax({
|
|
162054
|
+
url: s.opts.imageManagerLoadURL,
|
|
162055
|
+
method: s.opts.imageManagerLoadMethod,
|
|
162056
|
+
data: s.opts.imageManagerLoadParams,
|
|
162057
|
+
crossDomain: s.opts.requestWithCORS,
|
|
162058
|
+
withCredentials: s.opts.requestWithCredentials,
|
|
162059
|
+
headers: s.opts.requestHeaders,
|
|
162060
|
+
done(e, a, t) {
|
|
162061
|
+
s.events.trigger('imageManager.imagesLoaded', [e]),
|
|
162062
|
+
(function r(e, a) {
|
|
162063
|
+
try {
|
|
162064
|
+
d.find('.fr-list-column').empty(), (p = u = f = 0), (c = JSON.parse(e)), P();
|
|
162065
|
+
}
|
|
162066
|
+
catch (t) {
|
|
162067
|
+
O(C, a);
|
|
162068
|
+
}
|
|
162069
|
+
})(e, t.response),
|
|
162070
|
+
o.hide();
|
|
162071
|
+
},
|
|
162072
|
+
fail(e) {
|
|
162073
|
+
O(b, e.response || e.responseText);
|
|
162074
|
+
},
|
|
162075
|
+
})
|
|
162076
|
+
: O(w);
|
|
162077
|
+
})();
|
|
162078
|
+
},
|
|
162079
|
+
hide: function N() {
|
|
162080
|
+
s.modals.hide(M);
|
|
162081
|
+
},
|
|
162082
|
+
});
|
|
162048
162083
|
}),
|
|
162049
|
-
|
|
162050
|
-
|
|
162051
|
-
|
|
162084
|
+
!froala_editor_1.default.PLUGINS.image)) {
|
|
162085
|
+
throw new Error('Image manager plugin requires image plugin.');
|
|
162086
|
+
}
|
|
162087
|
+
froala_editor_1.default.DEFAULTS.imageInsertButtons.push('imageManagerCustom'),
|
|
162088
|
+
froala_editor_1.default.RegisterCommand('imageManagerCustom', {
|
|
162089
|
+
title: 'Browse',
|
|
162090
|
+
undo: !1,
|
|
162091
|
+
focus: !1,
|
|
162092
|
+
modal: !0,
|
|
162093
|
+
callback() {
|
|
162094
|
+
this.imageManagerCustom.show();
|
|
162095
|
+
},
|
|
162096
|
+
plugin: 'imageManagerCustom',
|
|
162097
|
+
}),
|
|
162098
|
+
froala_editor_1.default.DefineIcon('imageManagerCustom', { NAME: 'folder', SVG_KEY: 'imageManager' }),
|
|
162099
|
+
froala_editor_1.default.DefineIcon('imageManagerCustomInsert', { NAME: 'plus', SVG_KEY: 'add' }),
|
|
162100
|
+
froala_editor_1.default.DefineIcon('imageManagerCustomDelete', { NAME: 'trash', SVG_KEY: 'remove' });
|
|
162052
162101
|
}
|
|
162053
162102
|
};
|
|
162054
162103
|
});
|
|
162055
162104
|
|
|
162056
|
-
|
|
162057
|
-
|
|
162058
|
-
|
|
162059
|
-
|
|
162060
|
-
|
|
162061
|
-
|
|
162062
|
-
|
|
162063
|
-
|
|
162064
|
-
|
|
162065
|
-
|
|
162066
|
-
|
|
162067
|
-
|
|
162068
|
-
|
|
162069
|
-
|
|
162070
|
-
|
|
162071
|
-
|
|
162072
|
-
}
|
|
162073
|
-
],
|
|
162074
|
-
execute: function () {
|
|
162075
|
-
FroalaEditorModule = FroalaEditorModule_1 = class FroalaEditorModule {
|
|
162076
|
-
static forRoot() {
|
|
162077
|
-
return { ngModule: FroalaEditorModule_1, providers: [] };
|
|
162078
|
-
}
|
|
162079
|
-
};
|
|
162080
|
-
FroalaEditorModule = FroalaEditorModule_1 = __decorate([
|
|
162081
|
-
core_1.NgModule({
|
|
162082
|
-
declarations: [froala_editor_directive_1.FroalaEditorDirective],
|
|
162083
|
-
exports: [froala_editor_directive_1.FroalaEditorDirective]
|
|
162084
|
-
})
|
|
162085
|
-
], FroalaEditorModule);
|
|
162086
|
-
exports_1("FroalaEditorModule", FroalaEditorModule);
|
|
162105
|
+
FroalaEditor.DEFAULTS = Object.assign(FroalaEditor.DEFAULTS, {});
|
|
162106
|
+
FroalaEditor.PLUGINS.menuButton = function menuButton(editor) {
|
|
162107
|
+
let inputButton;
|
|
162108
|
+
const debug = false;
|
|
162109
|
+
function _init() {
|
|
162110
|
+
inputButton = new InputButtonPlugin({
|
|
162111
|
+
name: 'Menu Button',
|
|
162112
|
+
eventName: 'menu-button',
|
|
162113
|
+
editor,
|
|
162114
|
+
debug
|
|
162115
|
+
});
|
|
162116
|
+
}
|
|
162117
|
+
function onClick() {
|
|
162118
|
+
if (!editor.el) {
|
|
162119
|
+
console.warn('menuButton.onClick(): unable to find element');
|
|
162120
|
+
return;
|
|
162087
162121
|
}
|
|
162122
|
+
inputButton.onClick(editor.el);
|
|
162123
|
+
}
|
|
162124
|
+
return {
|
|
162125
|
+
_init,
|
|
162126
|
+
onClick
|
|
162088
162127
|
};
|
|
162128
|
+
};
|
|
162129
|
+
if (FroalaEditor.DEFAULTS) {
|
|
162130
|
+
if (typeof FroalaEditor.DEFAULTS.menuButtons === 'undefined') {
|
|
162131
|
+
FroalaEditor.DEFAULTS.menuButtons = [];
|
|
162132
|
+
}
|
|
162133
|
+
FroalaEditor.DEFAULTS.menuButtons.push('menuButton');
|
|
162134
|
+
}
|
|
162135
|
+
FroalaEditor.RegisterCommand('menuButton', {
|
|
162136
|
+
title: 'Insert from Menu Button',
|
|
162137
|
+
undo: false,
|
|
162138
|
+
focus: false,
|
|
162139
|
+
modal: false,
|
|
162140
|
+
refreshAfterCallback: true,
|
|
162141
|
+
callback() {
|
|
162142
|
+
this.menuButton.onClick();
|
|
162143
|
+
},
|
|
162144
|
+
plugin: 'menuButton',
|
|
162089
162145
|
});
|
|
162090
|
-
|
|
162091
|
-
|
|
162092
|
-
|
|
162093
|
-
|
|
162094
|
-
|
|
162095
|
-
|
|
162096
|
-
|
|
162097
|
-
|
|
162098
|
-
|
|
162099
|
-
|
|
162100
|
-
|
|
162101
|
-
|
|
162102
|
-
|
|
162103
|
-
|
|
162104
|
-
|
|
162105
|
-
|
|
162106
|
-
|
|
162146
|
+
FroalaEditor.DefineIcon('menuButton', { NAME: 'folder', SVG_KEY: 'imageManager' });
|
|
162147
|
+
FroalaEditor.DefineIcon('menuButtonInsert', { NAME: 'plus', SVG_KEY: 'add' });
|
|
162148
|
+
FroalaEditor.DefineIcon('menuButtonDelete', { NAME: 'trash', SVG_KEY: 'remove' });
|
|
162149
|
+
FroalaEditor.RegisterQuickInsertButton('menu', {
|
|
162150
|
+
icon: 'menuButton',
|
|
162151
|
+
title: 'Insert from Menu Button',
|
|
162152
|
+
callback: function menuButtonCallback() {
|
|
162153
|
+
const debug = false;
|
|
162154
|
+
const inputButton = new InputButtonPlugin({
|
|
162155
|
+
name: 'Menu Button',
|
|
162156
|
+
eventName: 'menu-button',
|
|
162157
|
+
editor: this,
|
|
162158
|
+
debug
|
|
162159
|
+
});
|
|
162160
|
+
if (!this.el) {
|
|
162161
|
+
console.warn('menuButton.onClick(): unable to find element');
|
|
162162
|
+
return;
|
|
162107
162163
|
}
|
|
162108
|
-
|
|
162164
|
+
inputButton.onClick(this.el);
|
|
162165
|
+
},
|
|
162166
|
+
undo: true
|
|
162109
162167
|
});
|
|
162110
162168
|
|
|
162111
162169
|
System.register(["@angular/core"], function (exports_1, context_1) {
|
|
@@ -162210,428 +162268,380 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
162210
162268
|
};
|
|
162211
162269
|
});
|
|
162212
162270
|
|
|
162213
|
-
|
|
162214
|
-
|
|
162215
|
-
|
|
162216
|
-
|
|
162217
|
-
|
|
162218
|
-
|
|
162219
|
-
name: 'Menu Button',
|
|
162220
|
-
eventName: 'menu-button',
|
|
162221
|
-
editor,
|
|
162222
|
-
debug
|
|
162223
|
-
});
|
|
162224
|
-
}
|
|
162225
|
-
function onClick() {
|
|
162226
|
-
if (!editor.el) {
|
|
162227
|
-
console.warn('menuButton.onClick(): unable to find element');
|
|
162228
|
-
return;
|
|
162229
|
-
}
|
|
162230
|
-
inputButton.onClick(editor.el);
|
|
162231
|
-
}
|
|
162232
|
-
return {
|
|
162233
|
-
_init,
|
|
162234
|
-
onClick
|
|
162271
|
+
System.register(["@angular/forms", "@angular/core", "froala-editor"], function (exports_1, context_1) {
|
|
162272
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
162273
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
162274
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
162275
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
162276
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
162235
162277
|
};
|
|
162236
|
-
|
|
162237
|
-
|
|
162238
|
-
|
|
162239
|
-
|
|
162240
|
-
}
|
|
162241
|
-
FroalaEditor.DEFAULTS.menuButtons.push('menuButton');
|
|
162242
|
-
}
|
|
162243
|
-
FroalaEditor.RegisterCommand('menuButton', {
|
|
162244
|
-
title: 'Insert from Menu Button',
|
|
162245
|
-
undo: false,
|
|
162246
|
-
focus: false,
|
|
162247
|
-
modal: false,
|
|
162248
|
-
refreshAfterCallback: true,
|
|
162249
|
-
callback() {
|
|
162250
|
-
this.menuButton.onClick();
|
|
162251
|
-
},
|
|
162252
|
-
plugin: 'menuButton',
|
|
162253
|
-
});
|
|
162254
|
-
FroalaEditor.DefineIcon('menuButton', { NAME: 'folder', SVG_KEY: 'imageManager' });
|
|
162255
|
-
FroalaEditor.DefineIcon('menuButtonInsert', { NAME: 'plus', SVG_KEY: 'add' });
|
|
162256
|
-
FroalaEditor.DefineIcon('menuButtonDelete', { NAME: 'trash', SVG_KEY: 'remove' });
|
|
162257
|
-
FroalaEditor.RegisterQuickInsertButton('menu', {
|
|
162258
|
-
icon: 'menuButton',
|
|
162259
|
-
title: 'Insert from Menu Button',
|
|
162260
|
-
callback: function menuButtonCallback() {
|
|
162261
|
-
const debug = false;
|
|
162262
|
-
const inputButton = new InputButtonPlugin({
|
|
162263
|
-
name: 'Menu Button',
|
|
162264
|
-
eventName: 'menu-button',
|
|
162265
|
-
editor: this,
|
|
162266
|
-
debug
|
|
162267
|
-
});
|
|
162268
|
-
if (!this.el) {
|
|
162269
|
-
console.warn('menuButton.onClick(): unable to find element');
|
|
162270
|
-
return;
|
|
162271
|
-
}
|
|
162272
|
-
inputButton.onClick(this.el);
|
|
162273
|
-
},
|
|
162274
|
-
undo: true
|
|
162275
|
-
});
|
|
162276
|
-
|
|
162277
|
-
/*!
|
|
162278
|
-
* froala_editor v3.2.3 (https://www.froala.com/wysiwyg-editor)
|
|
162279
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
|
162280
|
-
* Copyright 2014-2020 Froala Labs
|
|
162281
|
-
*/
|
|
162282
|
-
System.register(["froala-editor"], function (exports_1, context_1) {
|
|
162283
|
-
var froala_editor_1;
|
|
162278
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
162279
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
162280
|
+
};
|
|
162281
|
+
var FroalaEditorDirective_1, forms_1, core_1, froala_editor_1, FroalaEditorDirective;
|
|
162284
162282
|
context_1 && context_1.id;
|
|
162285
162283
|
return {
|
|
162286
162284
|
setters: [
|
|
162285
|
+
function (forms_1_1) {
|
|
162286
|
+
forms_1 = forms_1_1;
|
|
162287
|
+
},
|
|
162288
|
+
function (core_1_1) {
|
|
162289
|
+
core_1 = core_1_1;
|
|
162290
|
+
},
|
|
162287
162291
|
function (froala_editor_1_1) {
|
|
162288
162292
|
froala_editor_1 = froala_editor_1_1;
|
|
162289
162293
|
}
|
|
162290
162294
|
],
|
|
162291
162295
|
execute: function () {
|
|
162292
|
-
|
|
162293
|
-
|
|
162294
|
-
|
|
162295
|
-
|
|
162296
|
-
|
|
162297
|
-
|
|
162298
|
-
|
|
162299
|
-
|
|
162300
|
-
|
|
162301
|
-
|
|
162302
|
-
|
|
162303
|
-
|
|
162304
|
-
|
|
162305
|
-
|
|
162306
|
-
|
|
162307
|
-
|
|
162308
|
-
|
|
162309
|
-
|
|
162310
|
-
|
|
162311
|
-
|
|
162312
|
-
|
|
162313
|
-
let e = v(window).outerWidth();
|
|
162314
|
-
return e < 768 ? 2 : e < 1200 ? 3 : 4;
|
|
162315
|
-
}
|
|
162316
|
-
function I() {
|
|
162317
|
-
d.empty();
|
|
162318
|
-
for (let e = 0; e < h; e++) {
|
|
162319
|
-
d.append('<div class="fr-list-column"></div>');
|
|
162320
|
-
}
|
|
162296
|
+
FroalaEditorDirective = FroalaEditorDirective_1 = class FroalaEditorDirective {
|
|
162297
|
+
constructor(el, zone) {
|
|
162298
|
+
this.zone = zone;
|
|
162299
|
+
this._opts = {
|
|
162300
|
+
immediateAngularModelUpdate: false,
|
|
162301
|
+
angularIgnoreAttrs: null
|
|
162302
|
+
};
|
|
162303
|
+
this.SPECIAL_TAGS = ['img', 'button', 'input', 'a'];
|
|
162304
|
+
this.INNER_HTML_ATTR = 'innerHTML';
|
|
162305
|
+
this._hasSpecialTag = false;
|
|
162306
|
+
this._editorInitialized = false;
|
|
162307
|
+
this._oldModel = null;
|
|
162308
|
+
this.froalaModelChange = new core_1.EventEmitter();
|
|
162309
|
+
this.froalaInit = new core_1.EventEmitter();
|
|
162310
|
+
this.onChange = (_) => {
|
|
162311
|
+
};
|
|
162312
|
+
this.onTouched = () => {
|
|
162313
|
+
};
|
|
162314
|
+
const element = el.nativeElement;
|
|
162315
|
+
if (this.SPECIAL_TAGS.indexOf(element.tagName.toLowerCase()) != -1) {
|
|
162316
|
+
this._hasSpecialTag = true;
|
|
162321
162317
|
}
|
|
162322
|
-
|
|
162323
|
-
|
|
162324
|
-
|
|
162325
|
-
|
|
162326
|
-
|
|
162327
|
-
|
|
162328
|
-
|
|
162329
|
-
|
|
162330
|
-
|
|
162318
|
+
this._element = element;
|
|
162319
|
+
this.zone = zone;
|
|
162320
|
+
}
|
|
162321
|
+
set froalaEditor(opts) {
|
|
162322
|
+
this._opts = this.clone(opts || this._opts);
|
|
162323
|
+
this._opts = Object.assign({}, this._opts);
|
|
162324
|
+
}
|
|
162325
|
+
set froalaModel(content) {
|
|
162326
|
+
this.updateEditor(content);
|
|
162327
|
+
}
|
|
162328
|
+
writeValue(content) {
|
|
162329
|
+
this.updateEditor(content);
|
|
162330
|
+
}
|
|
162331
|
+
registerOnChange(fn) {
|
|
162332
|
+
this.onChange = fn;
|
|
162333
|
+
}
|
|
162334
|
+
registerOnTouched(fn) {
|
|
162335
|
+
this.onTouched = fn;
|
|
162336
|
+
}
|
|
162337
|
+
clone(item) {
|
|
162338
|
+
const me = this;
|
|
162339
|
+
if (!item) {
|
|
162340
|
+
return item;
|
|
162331
162341
|
}
|
|
162332
|
-
|
|
162333
|
-
|
|
162334
|
-
|
|
162335
|
-
|
|
162336
|
-
|
|
162337
|
-
|
|
162338
|
-
|
|
162339
|
-
|
|
162340
|
-
|
|
162341
|
-
|
|
162342
|
-
|
|
162342
|
+
const types = [Number, String, Boolean];
|
|
162343
|
+
let result;
|
|
162344
|
+
types.forEach((type) => {
|
|
162345
|
+
if (item instanceof type) {
|
|
162346
|
+
result = type(item);
|
|
162347
|
+
}
|
|
162348
|
+
});
|
|
162349
|
+
if (typeof result === 'undefined') {
|
|
162350
|
+
if (Object.prototype.toString.call(item) === '[object Array]') {
|
|
162351
|
+
result = [];
|
|
162352
|
+
item.forEach((child, index, array) => {
|
|
162353
|
+
result[index] = me.clone(child);
|
|
162354
|
+
});
|
|
162355
|
+
}
|
|
162356
|
+
else if (typeof item === 'object') {
|
|
162357
|
+
if (item.nodeType && typeof item.cloneNode === 'function') {
|
|
162358
|
+
result = item.cloneNode(true);
|
|
162359
|
+
}
|
|
162360
|
+
else if (!item.prototype) {
|
|
162361
|
+
if (item instanceof Date) {
|
|
162362
|
+
result = new Date(item);
|
|
162343
162363
|
}
|
|
162344
162364
|
else {
|
|
162345
|
-
|
|
162346
|
-
|
|
162347
|
-
|
|
162348
|
-
t.attr('src', n.url);
|
|
162349
|
-
}
|
|
162350
|
-
if ((n.url && t.attr('data-url', n.url), n.tag)) {
|
|
162351
|
-
if ((l.find('.fr-modal-more.fr-not-available').removeClass('fr-not-available'), l.find('.fr-modal-tags').show(), 0 <= n.tag.indexOf(','))) {
|
|
162352
|
-
for (let e = n.tag.split(','), a = 0; a < e.length; a++) {
|
|
162353
|
-
(e[a] =
|
|
162354
|
-
e[a].trim()), 0 === m.find('a[title="'.concat(e[a], '"]')).length && m.append('<a role="button" title="'.concat(e[a], '">').concat(e[a], '</a>'));
|
|
162355
|
-
}
|
|
162356
|
-
t.attr('data-tag', e.join());
|
|
162357
|
-
}
|
|
162358
|
-
else {
|
|
162359
|
-
0 === m.find('a[title="'.concat(n.tag.trim(), '"]')).length && m.append('<a role="button" title="'.concat(n.tag.trim(), '">').concat(n.tag.trim(), '</a>')), t.attr('data-tag', n.tag.trim());
|
|
162365
|
+
result = {};
|
|
162366
|
+
for (const i in item) {
|
|
162367
|
+
result[i] = me.clone(item[i]);
|
|
162360
162368
|
}
|
|
162361
162369
|
}
|
|
162362
|
-
|
|
162363
|
-
|
|
162370
|
+
}
|
|
162371
|
+
else {
|
|
162372
|
+
{
|
|
162373
|
+
result = item;
|
|
162364
162374
|
}
|
|
162365
|
-
|
|
162366
|
-
|
|
162367
|
-
|
|
162368
|
-
|
|
162369
|
-
|
|
162370
|
-
j(t, a.text) || o.hide();
|
|
162371
|
-
}),
|
|
162372
|
-
t.on('load', function () {
|
|
162373
|
-
o.removeClass('fr-empty'),
|
|
162374
|
-
o.height('auto'),
|
|
162375
|
-
u++,
|
|
162376
|
-
E(T(parseInt(t
|
|
162377
|
-
.parent()
|
|
162378
|
-
.attr('class')
|
|
162379
|
-
.match(/fr-image-(\d+)/)[1], 10) + 1)),
|
|
162380
|
-
R(!1),
|
|
162381
|
-
u % s.opts.imageManagerPageSize === 0 && P();
|
|
162382
|
-
}),
|
|
162383
|
-
s.events.trigger('imageManager.imageLoaded', [t]);
|
|
162384
|
-
}),
|
|
162385
|
-
(i.onerror = () => {
|
|
162386
|
-
u++,
|
|
162387
|
-
o.remove(),
|
|
162388
|
-
E(T(parseInt(o.attr('class').match(/fr-image-(\d+)/)[1], 10) + 1)),
|
|
162389
|
-
O(e, n),
|
|
162390
|
-
u % s.opts.imageManagerPageSize === 0 && P();
|
|
162391
|
-
}),
|
|
162392
|
-
(i.src = n.thumb || n.url),
|
|
162393
|
-
S().append(o);
|
|
162375
|
+
}
|
|
162376
|
+
}
|
|
162377
|
+
else {
|
|
162378
|
+
result = item;
|
|
162379
|
+
}
|
|
162394
162380
|
}
|
|
162395
|
-
|
|
162396
|
-
|
|
162397
|
-
|
|
162398
|
-
|
|
162399
|
-
|
|
162400
|
-
}),
|
|
162401
|
-
r);
|
|
162381
|
+
return result;
|
|
162382
|
+
}
|
|
162383
|
+
updateEditor(content) {
|
|
162384
|
+
if (JSON.stringify(this._oldModel) === JSON.stringify(content)) {
|
|
162385
|
+
return;
|
|
162402
162386
|
}
|
|
162403
|
-
|
|
162404
|
-
|
|
162405
|
-
for (let a = [], t = p - 1; e <= t; t--) {
|
|
162406
|
-
let r = d.find('.fr-image-'.concat(t));
|
|
162407
|
-
r.length && (a.push(r), v(document.createElement('div')).attr('id', 'fr-image-hidden-container').append(r), d.find('.fr-image-'.concat(t)).remove());
|
|
162408
|
-
}
|
|
162409
|
-
return a;
|
|
162387
|
+
if (!this._hasSpecialTag) {
|
|
162388
|
+
this._oldModel = content;
|
|
162410
162389
|
}
|
|
162411
|
-
|
|
162412
|
-
|
|
162413
|
-
S().append(e[a]);
|
|
162414
|
-
}
|
|
162390
|
+
else {
|
|
162391
|
+
this._model = content;
|
|
162415
162392
|
}
|
|
162416
|
-
|
|
162417
|
-
if (
|
|
162418
|
-
|
|
162393
|
+
if (this._editorInitialized) {
|
|
162394
|
+
if (!this._hasSpecialTag) {
|
|
162395
|
+
this._editor.html.set(content);
|
|
162419
162396
|
}
|
|
162420
|
-
|
|
162421
|
-
|
|
162422
|
-
h = a;
|
|
162423
|
-
let t = T();
|
|
162424
|
-
I(), E(t);
|
|
162397
|
+
else {
|
|
162398
|
+
this.setContent();
|
|
162425
162399
|
}
|
|
162426
|
-
s.modals.resize(M), e && P();
|
|
162427
162400
|
}
|
|
162428
|
-
|
|
162429
|
-
|
|
162430
|
-
|
|
162401
|
+
else {
|
|
162402
|
+
if (!this._hasSpecialTag) {
|
|
162403
|
+
this._element.innerHTML = content || '';
|
|
162404
|
+
}
|
|
162405
|
+
else {
|
|
162406
|
+
this.setContent();
|
|
162431
162407
|
}
|
|
162432
|
-
return n;
|
|
162433
162408
|
}
|
|
162434
|
-
|
|
162435
|
-
|
|
162436
|
-
|
|
162437
|
-
|
|
162409
|
+
}
|
|
162410
|
+
updateModel() {
|
|
162411
|
+
this.zone.run(() => {
|
|
162412
|
+
let modelContent = null;
|
|
162413
|
+
if (this._hasSpecialTag) {
|
|
162414
|
+
const attributeNodes = this._element.attributes;
|
|
162415
|
+
const attrs = {};
|
|
162416
|
+
for (let i = 0; i < attributeNodes.length; i++) {
|
|
162417
|
+
const attrName = attributeNodes[i].name;
|
|
162418
|
+
if (this._opts.angularIgnoreAttrs && this._opts.angularIgnoreAttrs.indexOf(attrName) != -1) {
|
|
162419
|
+
continue;
|
|
162420
|
+
}
|
|
162421
|
+
attrs[attrName] = attributeNodes[i].value;
|
|
162422
|
+
}
|
|
162423
|
+
if (this._element.innerHTML) {
|
|
162424
|
+
attrs[this.INNER_HTML_ATTR] = this._element.innerHTML;
|
|
162425
|
+
}
|
|
162426
|
+
modelContent = attrs;
|
|
162438
162427
|
}
|
|
162439
162428
|
else {
|
|
162440
|
-
|
|
162441
|
-
|
|
162442
|
-
|
|
162429
|
+
const returnedHtml = this._editor.html.get();
|
|
162430
|
+
if (typeof returnedHtml === 'string') {
|
|
162431
|
+
modelContent = returnedHtml;
|
|
162432
|
+
}
|
|
162443
162433
|
}
|
|
162444
|
-
|
|
162445
|
-
|
|
162446
|
-
|
|
162447
|
-
|
|
162448
|
-
|
|
162449
|
-
|
|
162450
|
-
|
|
162451
|
-
|
|
162452
|
-
|
|
162453
|
-
|
|
162454
|
-
url: s.opts.imageManagerDeleteURL,
|
|
162455
|
-
data: Object.assign(Object.assign({ src: i.attr('src') }, U(i)), s.opts.imageManagerDeleteParams),
|
|
162456
|
-
crossDomain: s.opts.requestWithCORS,
|
|
162457
|
-
withCredentials: s.opts.requestWithCredentials,
|
|
162458
|
-
headers: s.opts.requestHeaders,
|
|
162459
|
-
done(e, a, t) {
|
|
162460
|
-
s.events.trigger('imageManager.imageDeleted', [e]);
|
|
162461
|
-
let r = T(parseInt(i
|
|
162462
|
-
.parent()
|
|
162463
|
-
.attr('class')
|
|
162464
|
-
.match(/fr-image-(\d+)/)[1], 10) + 1);
|
|
162465
|
-
i.parent().remove(),
|
|
162466
|
-
E(r),
|
|
162467
|
-
(function n() {
|
|
162468
|
-
g.find('#fr-modal-tags > a').each(function () {
|
|
162469
|
-
0 === g.find('#fr-image-list [data-tag*="'.concat(v(this).text(), '"]')).length && v(this).removeClass('fr-selected-tag').hide();
|
|
162470
|
-
}),
|
|
162471
|
-
_();
|
|
162472
|
-
})(),
|
|
162473
|
-
R(!0);
|
|
162474
|
-
},
|
|
162475
|
-
fail(e) {
|
|
162476
|
-
O(t, e.response || e.responseText);
|
|
162477
|
-
},
|
|
162478
|
-
}))
|
|
162479
|
-
: O(r));
|
|
162480
|
-
}
|
|
162481
|
-
function O(e, a) {
|
|
162482
|
-
10 <= e && e < 20
|
|
162483
|
-
? o.hide()
|
|
162484
|
-
: 20 <= e && e < 30 && v('.fr-image-deleting').removeClass('fr-image-deleting'), s.events.trigger('imageManager.error', [
|
|
162485
|
-
{ code: e, message: n[e] },
|
|
162486
|
-
a
|
|
162487
|
-
]);
|
|
162434
|
+
if (this._oldModel !== modelContent) {
|
|
162435
|
+
this._oldModel = modelContent;
|
|
162436
|
+
this.froalaModelChange.emit(modelContent);
|
|
162437
|
+
this.onChange(modelContent);
|
|
162438
|
+
}
|
|
162439
|
+
});
|
|
162440
|
+
}
|
|
162441
|
+
registerEvent(eventName, callback) {
|
|
162442
|
+
if (!eventName || !callback) {
|
|
162443
|
+
return;
|
|
162488
162444
|
}
|
|
162489
|
-
|
|
162490
|
-
|
|
162491
|
-
l.toggleClass('fr-show-tags'), l.hasClass('fr-show-tags')
|
|
162492
|
-
? (l.css('height', e + a), i.css('marginTop', e + a), m.find('a').css('opacity', 1))
|
|
162493
|
-
: (l.css('height', e), i.css('marginTop', e), m.find('a').css('opacity', 0));
|
|
162445
|
+
if (!this._opts.events) {
|
|
162446
|
+
this._opts.events = {};
|
|
162494
162447
|
}
|
|
162495
|
-
|
|
162496
|
-
|
|
162497
|
-
|
|
162498
|
-
|
|
162499
|
-
|
|
162500
|
-
|
|
162501
|
-
|
|
162502
|
-
|
|
162503
|
-
|
|
162504
|
-
|
|
162505
|
-
|
|
162506
|
-
|
|
162507
|
-
|
|
162448
|
+
this._opts.events[eventName] = callback;
|
|
162449
|
+
}
|
|
162450
|
+
initListeners() {
|
|
162451
|
+
const self = this;
|
|
162452
|
+
if (this._editor.events) {
|
|
162453
|
+
this._editor.events.on('contentChanged', function () {
|
|
162454
|
+
self.updateModel();
|
|
162455
|
+
});
|
|
162456
|
+
this._editor.events.on('mousedown', function () {
|
|
162457
|
+
setTimeout(function () {
|
|
162458
|
+
self.onTouched();
|
|
162459
|
+
}, 0);
|
|
162460
|
+
});
|
|
162461
|
+
if (this._opts.immediateAngularModelUpdate) {
|
|
162462
|
+
this._editor.events.on('keyup', function () {
|
|
162463
|
+
setTimeout(function () {
|
|
162464
|
+
self.updateModel();
|
|
162465
|
+
}, 0);
|
|
162466
|
+
});
|
|
162467
|
+
}
|
|
162508
162468
|
}
|
|
162509
|
-
|
|
162510
|
-
|
|
162511
|
-
|
|
162512
|
-
|
|
162469
|
+
this._editorInitialized = true;
|
|
162470
|
+
}
|
|
162471
|
+
createEditor() {
|
|
162472
|
+
if (this._editorInitialized) {
|
|
162473
|
+
return;
|
|
162513
162474
|
}
|
|
162514
|
-
|
|
162515
|
-
|
|
162516
|
-
|
|
162517
|
-
|
|
162475
|
+
this.setContent(true);
|
|
162476
|
+
this.zone.runOutsideAngular(() => {
|
|
162477
|
+
if (!this._opts.events) {
|
|
162478
|
+
this._opts.events = {};
|
|
162479
|
+
}
|
|
162480
|
+
this.registerEvent('initialized', this._opts.events && this._opts.events.initialized);
|
|
162481
|
+
const existingInitCallback = this._opts.events.initialized;
|
|
162482
|
+
if (!this._opts.events.initialized || !this._opts.events.initialized.overridden) {
|
|
162483
|
+
this._opts.events.initialized = () => {
|
|
162484
|
+
this.initListeners();
|
|
162485
|
+
existingInitCallback && existingInitCallback.call(this._editor, this);
|
|
162486
|
+
};
|
|
162487
|
+
this._opts.events.initialized.overridden = true;
|
|
162488
|
+
}
|
|
162489
|
+
this._editor = new froala_editor_1.default(this._element, this._opts);
|
|
162490
|
+
});
|
|
162491
|
+
}
|
|
162492
|
+
setHtml() {
|
|
162493
|
+
this._editor.html.set(this._model || '');
|
|
162494
|
+
this._editor.undo.reset();
|
|
162495
|
+
this._editor.undo.saveStep();
|
|
162496
|
+
}
|
|
162497
|
+
setContent(firstTime = false) {
|
|
162498
|
+
const self = this;
|
|
162499
|
+
if (this._model || this._model === '') {
|
|
162500
|
+
this._oldModel = this._model;
|
|
162501
|
+
if (this._hasSpecialTag) {
|
|
162502
|
+
const tags = this._model;
|
|
162503
|
+
if (tags) {
|
|
162504
|
+
for (const attr in tags) {
|
|
162505
|
+
if (tags.hasOwnProperty(attr) && attr != this.INNER_HTML_ATTR) {
|
|
162506
|
+
this._element.setAttribute(attr, tags[attr]);
|
|
162507
|
+
}
|
|
162508
|
+
}
|
|
162509
|
+
if (tags.hasOwnProperty(this.INNER_HTML_ATTR)) {
|
|
162510
|
+
this._element.innerHTML = tags[this.INNER_HTML_ATTR];
|
|
162511
|
+
}
|
|
162512
|
+
}
|
|
162513
|
+
}
|
|
162514
|
+
else {
|
|
162515
|
+
if (firstTime) {
|
|
162516
|
+
this.registerEvent('initialized', function () {
|
|
162517
|
+
self.setHtml();
|
|
162518
|
+
});
|
|
162519
|
+
}
|
|
162520
|
+
else {
|
|
162521
|
+
self.setHtml();
|
|
162518
162522
|
}
|
|
162519
162523
|
}
|
|
162520
|
-
return !1;
|
|
162521
162524
|
}
|
|
162522
|
-
|
|
162523
|
-
|
|
162524
|
-
|
|
162525
|
-
(
|
|
162526
|
-
|
|
162527
|
-
|
|
162528
|
-
|
|
162529
|
-
|
|
162525
|
+
}
|
|
162526
|
+
destroyEditor() {
|
|
162527
|
+
if (this._editorInitialized) {
|
|
162528
|
+
this._editor.destroy();
|
|
162529
|
+
this._editorInitialized = false;
|
|
162530
|
+
}
|
|
162531
|
+
}
|
|
162532
|
+
getEditor() {
|
|
162533
|
+
if (this._element) {
|
|
162534
|
+
return this._editor;
|
|
162535
|
+
}
|
|
162536
|
+
return null;
|
|
162537
|
+
}
|
|
162538
|
+
generateManualController() {
|
|
162539
|
+
const controls = {
|
|
162540
|
+
initialize: this.createEditor.bind(this),
|
|
162541
|
+
destroy: this.destroyEditor.bind(this),
|
|
162542
|
+
getEditor: this.getEditor.bind(this),
|
|
162543
|
+
};
|
|
162544
|
+
this.froalaInit.emit(controls);
|
|
162545
|
+
}
|
|
162546
|
+
ngAfterViewInit() {
|
|
162547
|
+
if (!this.froalaInit.observers.length) {
|
|
162548
|
+
this.createEditor();
|
|
162549
|
+
}
|
|
162550
|
+
else {
|
|
162551
|
+
this.generateManualController();
|
|
162552
|
+
}
|
|
162553
|
+
}
|
|
162554
|
+
ngOnDestroy() {
|
|
162555
|
+
this.destroyEditor();
|
|
162556
|
+
}
|
|
162557
|
+
};
|
|
162558
|
+
__decorate([
|
|
162559
|
+
core_1.Input(),
|
|
162560
|
+
__metadata("design:type", Object),
|
|
162561
|
+
__metadata("design:paramtypes", [Object])
|
|
162562
|
+
], FroalaEditorDirective.prototype, "froalaEditor", null);
|
|
162563
|
+
__decorate([
|
|
162564
|
+
core_1.Input(),
|
|
162565
|
+
__metadata("design:type", Object),
|
|
162566
|
+
__metadata("design:paramtypes", [Object])
|
|
162567
|
+
], FroalaEditorDirective.prototype, "froalaModel", null);
|
|
162568
|
+
__decorate([
|
|
162569
|
+
core_1.Output(),
|
|
162570
|
+
__metadata("design:type", core_1.EventEmitter)
|
|
162571
|
+
], FroalaEditorDirective.prototype, "froalaModelChange", void 0);
|
|
162572
|
+
__decorate([
|
|
162573
|
+
core_1.Output(),
|
|
162574
|
+
__metadata("design:type", core_1.EventEmitter)
|
|
162575
|
+
], FroalaEditorDirective.prototype, "froalaInit", void 0);
|
|
162576
|
+
FroalaEditorDirective = FroalaEditorDirective_1 = __decorate([
|
|
162577
|
+
core_1.Directive({
|
|
162578
|
+
selector: '[froalaEditor]',
|
|
162579
|
+
exportAs: 'froalaEditor',
|
|
162580
|
+
providers: [
|
|
162530
162581
|
{
|
|
162531
|
-
|
|
162532
|
-
|
|
162533
|
-
|
|
162534
|
-
|
|
162535
|
-
}
|
|
162536
|
-
},
|
|
162537
|
-
show: function G() {
|
|
162538
|
-
if (!g) {
|
|
162539
|
-
let e, a = '<button class="fr-command fr-btn fr-modal-more fr-not-available" id="fr-modal-more-'
|
|
162540
|
-
.concat(s.sid, '"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24""><path d="')
|
|
162541
|
-
.concat(froala_editor_1.default.SVG.tags, '"/></svg></button><h4 data-text="true">')
|
|
162542
|
-
.concat(s.language.translate('Manage Images'), '</h4></div>\n <div class="fr-modal-tags" id="fr-modal-tags">');
|
|
162543
|
-
(e = s.opts.imageManagerPreloader
|
|
162544
|
-
? '<img class="fr-preloader" id="fr-preloader" alt="'.concat(s.language.translate('Loading'), '.." src="').concat(s.opts.imageManagerPreloader, '" style="display: none;">')
|
|
162545
|
-
: '<span class="fr-preloader" id="fr-preloader" style="display: none;">'.concat(s.language.translate('Loading'), '</span>')),
|
|
162546
|
-
(e += '<div class="fr-image-list" id="fr-image-list"></div>');
|
|
162547
|
-
let t = s.modals.create(M, a, e);
|
|
162548
|
-
(g = t.$modal), (l = t.$head), (i = t.$body);
|
|
162549
|
-
}
|
|
162550
|
-
g.data('current-image', s.image.get()),
|
|
162551
|
-
s.modals.show(M),
|
|
162552
|
-
o ||
|
|
162553
|
-
(function r() {
|
|
162554
|
-
(o = g.find('#fr-preloader')),
|
|
162555
|
-
(d = g.find('#fr-image-list')),
|
|
162556
|
-
(m = g.find('#fr-modal-tags')),
|
|
162557
|
-
(h = y()),
|
|
162558
|
-
I(),
|
|
162559
|
-
l.css('height', l.find('.fr-modal-head-line').outerHeight()),
|
|
162560
|
-
s.events.$on(v(s.o_win), 'resize', () => {
|
|
162561
|
-
R(!!c);
|
|
162562
|
-
}),
|
|
162563
|
-
s.events.bindClick(d, '.fr-insert-img', x),
|
|
162564
|
-
s.events.bindClick(d, '.fr-delete-img', H),
|
|
162565
|
-
s.helpers.isMobile() &&
|
|
162566
|
-
(s.events.bindClick(d, 'div.fr-image-container', (e) => {
|
|
162567
|
-
g.find('.fr-mobile-selected').removeClass('fr-mobile-selected'),
|
|
162568
|
-
v(e.currentTarget).addClass('fr-mobile-selected');
|
|
162569
|
-
}),
|
|
162570
|
-
g.on(s._mousedown, () => {
|
|
162571
|
-
g.find('.fr-mobile-selected').removeClass('fr-mobile-selected');
|
|
162572
|
-
})),
|
|
162573
|
-
g.on(s._mousedown + ' ' + s._mouseup, (e) => {
|
|
162574
|
-
e.stopPropagation();
|
|
162575
|
-
}),
|
|
162576
|
-
g.on(s._mousedown, '*', () => {
|
|
162577
|
-
s.events.disableBlur();
|
|
162578
|
-
}),
|
|
162579
|
-
i.on('scroll', P),
|
|
162580
|
-
s.events.bindClick(g, 'button#fr-modal-more-'.concat(s.sid), q),
|
|
162581
|
-
s.events.bindClick(m, 'a', k);
|
|
162582
|
-
})(),
|
|
162583
|
-
(function n() {
|
|
162584
|
-
o.show(),
|
|
162585
|
-
d.find('.fr-list-column').empty(),
|
|
162586
|
-
s.opts.imageManagerLoadURL
|
|
162587
|
-
? v(this).ajax({
|
|
162588
|
-
url: s.opts.imageManagerLoadURL,
|
|
162589
|
-
method: s.opts.imageManagerLoadMethod,
|
|
162590
|
-
data: s.opts.imageManagerLoadParams,
|
|
162591
|
-
crossDomain: s.opts.requestWithCORS,
|
|
162592
|
-
withCredentials: s.opts.requestWithCredentials,
|
|
162593
|
-
headers: s.opts.requestHeaders,
|
|
162594
|
-
done(e, a, t) {
|
|
162595
|
-
s.events.trigger('imageManager.imagesLoaded', [e]),
|
|
162596
|
-
(function r(e, a) {
|
|
162597
|
-
try {
|
|
162598
|
-
d.find('.fr-list-column').empty(), (p = u = f = 0), (c = JSON.parse(e)), P();
|
|
162599
|
-
}
|
|
162600
|
-
catch (t) {
|
|
162601
|
-
O(C, a);
|
|
162602
|
-
}
|
|
162603
|
-
})(e, t.response),
|
|
162604
|
-
o.hide();
|
|
162605
|
-
},
|
|
162606
|
-
fail(e) {
|
|
162607
|
-
O(b, e.response || e.responseText);
|
|
162608
|
-
},
|
|
162609
|
-
})
|
|
162610
|
-
: O(w);
|
|
162611
|
-
})();
|
|
162612
|
-
},
|
|
162613
|
-
hide: function N() {
|
|
162614
|
-
s.modals.hide(M);
|
|
162615
|
-
},
|
|
162616
|
-
});
|
|
162582
|
+
provide: forms_1.NG_VALUE_ACCESSOR, useExisting: core_1.forwardRef(() => FroalaEditorDirective_1),
|
|
162583
|
+
multi: true
|
|
162584
|
+
}
|
|
162585
|
+
]
|
|
162617
162586
|
}),
|
|
162618
|
-
|
|
162619
|
-
|
|
162587
|
+
__metadata("design:paramtypes", [core_1.ElementRef, core_1.NgZone])
|
|
162588
|
+
], FroalaEditorDirective);
|
|
162589
|
+
exports_1("FroalaEditorDirective", FroalaEditorDirective);
|
|
162590
|
+
}
|
|
162591
|
+
};
|
|
162592
|
+
});
|
|
162593
|
+
|
|
162594
|
+
System.register(["@angular/core", "@stratusjs/angular/froala/editor/froala-editor.directive"], function (exports_1, context_1) {
|
|
162595
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
162596
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
162597
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
162598
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
162599
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
162600
|
+
};
|
|
162601
|
+
var FroalaEditorModule_1, core_1, froala_editor_directive_1, FroalaEditorModule;
|
|
162602
|
+
context_1 && context_1.id;
|
|
162603
|
+
return {
|
|
162604
|
+
setters: [
|
|
162605
|
+
function (core_1_1) {
|
|
162606
|
+
core_1 = core_1_1;
|
|
162607
|
+
},
|
|
162608
|
+
function (froala_editor_directive_1_1) {
|
|
162609
|
+
froala_editor_directive_1 = froala_editor_directive_1_1;
|
|
162620
162610
|
}
|
|
162621
|
-
|
|
162622
|
-
|
|
162623
|
-
|
|
162624
|
-
|
|
162625
|
-
|
|
162626
|
-
|
|
162627
|
-
|
|
162628
|
-
|
|
162629
|
-
|
|
162630
|
-
|
|
162631
|
-
|
|
162632
|
-
|
|
162633
|
-
|
|
162634
|
-
|
|
162611
|
+
],
|
|
162612
|
+
execute: function () {
|
|
162613
|
+
FroalaEditorModule = FroalaEditorModule_1 = class FroalaEditorModule {
|
|
162614
|
+
static forRoot() {
|
|
162615
|
+
return { ngModule: FroalaEditorModule_1, providers: [] };
|
|
162616
|
+
}
|
|
162617
|
+
};
|
|
162618
|
+
FroalaEditorModule = FroalaEditorModule_1 = __decorate([
|
|
162619
|
+
core_1.NgModule({
|
|
162620
|
+
declarations: [froala_editor_directive_1.FroalaEditorDirective],
|
|
162621
|
+
exports: [froala_editor_directive_1.FroalaEditorDirective]
|
|
162622
|
+
})
|
|
162623
|
+
], FroalaEditorModule);
|
|
162624
|
+
exports_1("FroalaEditorModule", FroalaEditorModule);
|
|
162625
|
+
}
|
|
162626
|
+
};
|
|
162627
|
+
});
|
|
162628
|
+
|
|
162629
|
+
System.register(["@stratusjs/angular/froala/editor/froala-editor.directive", "@stratusjs/angular/froala/editor/froala-editor.module"], function (exports_1, context_1) {
|
|
162630
|
+
context_1 && context_1.id;
|
|
162631
|
+
return {
|
|
162632
|
+
setters: [
|
|
162633
|
+
function (froala_editor_directive_1_1) {
|
|
162634
|
+
exports_1({
|
|
162635
|
+
"FroalaEditorDirective": froala_editor_directive_1_1["FroalaEditorDirective"]
|
|
162636
|
+
});
|
|
162637
|
+
},
|
|
162638
|
+
function (froala_editor_module_1_1) {
|
|
162639
|
+
exports_1({
|
|
162640
|
+
"FroalaEditorModule": froala_editor_module_1_1["FroalaEditorModule"]
|
|
162641
|
+
});
|
|
162642
|
+
}
|
|
162643
|
+
],
|
|
162644
|
+
execute: function () {
|
|
162635
162645
|
}
|
|
162636
162646
|
};
|
|
162637
162647
|
});
|