@innovastudio/contentbox 1.5.52 → 1.5.54
Sign up to get free protection for your applications and to get access to all the features.
@@ -14437,466 +14437,466 @@ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof win
|
|
14437
14437
|
|
14438
14438
|
var rangyCore = {exports: {}};
|
14439
14439
|
|
14440
|
-
/**
|
14441
|
-
* Rangy, a cross-browser JavaScript range and selection library
|
14442
|
-
* https://github.com/timdown/rangy
|
14443
|
-
*
|
14444
|
-
* Copyright
|
14445
|
-
* Licensed under the MIT license.
|
14446
|
-
* Version: 1.3.
|
14447
|
-
* Build date:
|
14440
|
+
/**
|
14441
|
+
* Rangy, a cross-browser JavaScript range and selection library
|
14442
|
+
* https://github.com/timdown/rangy
|
14443
|
+
*
|
14444
|
+
* Copyright 2022, Tim Down
|
14445
|
+
* Licensed under the MIT license.
|
14446
|
+
* Version: 1.3.1
|
14447
|
+
* Build date: 17 August 2022
|
14448
14448
|
*/
|
14449
14449
|
|
14450
14450
|
(function (module, exports) {
|
14451
|
-
(function(factory, root) {
|
14452
|
-
{
|
14453
|
-
// Node/CommonJS style
|
14454
|
-
module.exports = factory();
|
14455
|
-
}
|
14456
|
-
})(function() {
|
14457
|
-
|
14458
|
-
var OBJECT = "object", FUNCTION = "function", UNDEFINED = "undefined";
|
14459
|
-
|
14460
|
-
// Minimal set of properties required for DOM Level 2 Range compliance. Comparison constants such as START_TO_START
|
14461
|
-
// are omitted because ranges in KHTML do not have them but otherwise work perfectly well. See issue 113.
|
14462
|
-
var domRangeProperties = ["startContainer", "startOffset", "endContainer", "endOffset", "collapsed",
|
14463
|
-
"commonAncestorContainer"];
|
14464
|
-
|
14465
|
-
// Minimal set of methods required for DOM Level 2 Range compliance
|
14466
|
-
var domRangeMethods = ["setStart", "setStartBefore", "setStartAfter", "setEnd", "setEndBefore",
|
14467
|
-
"setEndAfter", "collapse", "selectNode", "selectNodeContents", "compareBoundaryPoints", "deleteContents",
|
14468
|
-
"extractContents", "cloneContents", "insertNode", "surroundContents", "cloneRange", "toString", "detach"];
|
14469
|
-
|
14470
|
-
var textRangeProperties = ["boundingHeight", "boundingLeft", "boundingTop", "boundingWidth", "htmlText", "text"];
|
14471
|
-
|
14472
|
-
// Subset of TextRange's full set of methods that we're interested in
|
14473
|
-
var textRangeMethods = ["collapse", "compareEndPoints", "duplicate", "moveToElementText", "parentElement", "select",
|
14474
|
-
"setEndPoint", "getBoundingClientRect"];
|
14475
|
-
|
14476
|
-
/*----------------------------------------------------------------------------------------------------------------*/
|
14477
|
-
|
14478
|
-
// Trio of functions taken from Peter Michaux's article:
|
14479
|
-
// http://peter.michaux.ca/articles/feature-detection-state-of-the-art-browser-scripting
|
14480
|
-
function isHostMethod(o, p) {
|
14481
|
-
var t = typeof o[p];
|
14482
|
-
return t == FUNCTION || (!!(t == OBJECT && o[p])) || t == "unknown";
|
14483
|
-
}
|
14484
|
-
|
14485
|
-
function isHostObject(o, p) {
|
14486
|
-
return !!(typeof o[p] == OBJECT && o[p]);
|
14487
|
-
}
|
14488
|
-
|
14489
|
-
function isHostProperty(o, p) {
|
14490
|
-
return typeof o[p] != UNDEFINED;
|
14491
|
-
}
|
14492
|
-
|
14493
|
-
// Creates a convenience function to save verbose repeated calls to tests functions
|
14494
|
-
function createMultiplePropertyTest(testFunc) {
|
14495
|
-
return function(o, props) {
|
14496
|
-
var i = props.length;
|
14497
|
-
while (i--) {
|
14498
|
-
if (!testFunc(o, props[i])) {
|
14499
|
-
return false;
|
14500
|
-
}
|
14501
|
-
}
|
14502
|
-
return true;
|
14503
|
-
};
|
14504
|
-
}
|
14505
|
-
|
14506
|
-
// Next trio of functions are a convenience to save verbose repeated calls to previous two functions
|
14507
|
-
var areHostMethods = createMultiplePropertyTest(isHostMethod);
|
14508
|
-
var areHostObjects = createMultiplePropertyTest(isHostObject);
|
14509
|
-
var areHostProperties = createMultiplePropertyTest(isHostProperty);
|
14510
|
-
|
14511
|
-
function isTextRange(range) {
|
14512
|
-
return range && areHostMethods(range, textRangeMethods) && areHostProperties(range, textRangeProperties);
|
14513
|
-
}
|
14514
|
-
|
14515
|
-
function getBody(doc) {
|
14516
|
-
return isHostObject(doc, "body") ? doc.body : doc.getElementsByTagName("body")[0];
|
14517
|
-
}
|
14518
|
-
|
14519
|
-
var forEach = [].forEach ?
|
14520
|
-
function(arr, func) {
|
14521
|
-
arr.forEach(func);
|
14522
|
-
} :
|
14523
|
-
function(arr, func) {
|
14524
|
-
for (var i = 0, len = arr.length; i < len; ++i) {
|
14525
|
-
func(arr[i], i);
|
14526
|
-
}
|
14527
|
-
};
|
14528
|
-
|
14529
|
-
var modules = {};
|
14530
|
-
|
14531
|
-
var isBrowser = (typeof window != UNDEFINED && typeof document != UNDEFINED);
|
14532
|
-
|
14533
|
-
var util = {
|
14534
|
-
isHostMethod: isHostMethod,
|
14535
|
-
isHostObject: isHostObject,
|
14536
|
-
isHostProperty: isHostProperty,
|
14537
|
-
areHostMethods: areHostMethods,
|
14538
|
-
areHostObjects: areHostObjects,
|
14539
|
-
areHostProperties: areHostProperties,
|
14540
|
-
isTextRange: isTextRange,
|
14541
|
-
getBody: getBody,
|
14542
|
-
forEach: forEach
|
14543
|
-
};
|
14544
|
-
|
14545
|
-
var api = {
|
14546
|
-
version: "1.3.
|
14547
|
-
initialized: false,
|
14548
|
-
isBrowser: isBrowser,
|
14549
|
-
supported: true,
|
14550
|
-
util: util,
|
14551
|
-
features: {},
|
14552
|
-
modules: modules,
|
14553
|
-
config: {
|
14554
|
-
alertOnFail: false,
|
14555
|
-
alertOnWarn: false,
|
14556
|
-
preferTextRange: false,
|
14557
|
-
autoInitialize: (typeof rangyAutoInitialize == UNDEFINED) ? true : rangyAutoInitialize
|
14558
|
-
}
|
14559
|
-
};
|
14560
|
-
|
14561
|
-
function consoleLog(msg) {
|
14562
|
-
if (typeof console != UNDEFINED && isHostMethod(console, "log")) {
|
14563
|
-
console.log(msg);
|
14564
|
-
}
|
14565
|
-
}
|
14566
|
-
|
14567
|
-
function alertOrLog(msg, shouldAlert) {
|
14568
|
-
if (isBrowser && shouldAlert) {
|
14569
|
-
alert(msg);
|
14570
|
-
} else {
|
14571
|
-
consoleLog(msg);
|
14572
|
-
}
|
14573
|
-
}
|
14574
|
-
|
14575
|
-
function fail(reason) {
|
14576
|
-
api.initialized = true;
|
14577
|
-
api.supported = false;
|
14578
|
-
alertOrLog("Rangy is not supported in this environment. Reason: " + reason, api.config.alertOnFail);
|
14579
|
-
}
|
14580
|
-
|
14581
|
-
api.fail = fail;
|
14582
|
-
|
14583
|
-
function warn(msg) {
|
14584
|
-
alertOrLog("Rangy warning: " + msg, api.config.alertOnWarn);
|
14585
|
-
}
|
14586
|
-
|
14587
|
-
api.warn = warn;
|
14588
|
-
|
14589
|
-
// Add utility extend() method
|
14590
|
-
var extend;
|
14591
|
-
if ({}.hasOwnProperty) {
|
14592
|
-
util.extend = extend = function(obj, props, deep) {
|
14593
|
-
var o, p;
|
14594
|
-
for (var i in props) {
|
14595
|
-
if (props.hasOwnProperty(i)) {
|
14596
|
-
o = obj[i];
|
14597
|
-
p = props[i];
|
14598
|
-
if (deep && o !== null && typeof o == "object" && p !== null && typeof p == "object") {
|
14599
|
-
extend(o, p, true);
|
14600
|
-
}
|
14601
|
-
obj[i] = p;
|
14602
|
-
}
|
14603
|
-
}
|
14604
|
-
// Special case for toString, which does not show up in for...in loops in IE <= 8
|
14605
|
-
if (props.hasOwnProperty("toString")) {
|
14606
|
-
obj.toString = props.toString;
|
14607
|
-
}
|
14608
|
-
return obj;
|
14609
|
-
};
|
14610
|
-
|
14611
|
-
util.createOptions = function(optionsParam, defaults) {
|
14612
|
-
var options = {};
|
14613
|
-
extend(options, defaults);
|
14614
|
-
if (optionsParam) {
|
14615
|
-
extend(options, optionsParam);
|
14616
|
-
}
|
14617
|
-
return options;
|
14618
|
-
};
|
14619
|
-
} else {
|
14620
|
-
fail("hasOwnProperty not supported");
|
14621
|
-
}
|
14622
|
-
|
14623
|
-
// Test whether we're in a browser and bail out if not
|
14624
|
-
if (!isBrowser) {
|
14625
|
-
fail("Rangy can only run in a browser");
|
14626
|
-
}
|
14627
|
-
|
14628
|
-
// Test whether Array.prototype.slice can be relied on for NodeLists and use an alternative toArray() if not
|
14629
|
-
(function() {
|
14630
|
-
var toArray;
|
14631
|
-
|
14632
|
-
if (isBrowser) {
|
14633
|
-
var el = document.createElement("div");
|
14634
|
-
el.appendChild(document.createElement("span"));
|
14635
|
-
var slice = [].slice;
|
14636
|
-
try {
|
14637
|
-
if (slice.call(el.childNodes, 0)[0].nodeType == 1) {
|
14638
|
-
toArray = function(arrayLike) {
|
14639
|
-
return slice.call(arrayLike, 0);
|
14640
|
-
};
|
14641
|
-
}
|
14642
|
-
} catch (e) {}
|
14643
|
-
}
|
14644
|
-
|
14645
|
-
if (!toArray) {
|
14646
|
-
toArray = function(arrayLike) {
|
14647
|
-
var arr = [];
|
14648
|
-
for (var i = 0, len = arrayLike.length; i < len; ++i) {
|
14649
|
-
arr[i] = arrayLike[i];
|
14650
|
-
}
|
14651
|
-
return arr;
|
14652
|
-
};
|
14653
|
-
}
|
14654
|
-
|
14655
|
-
util.toArray = toArray;
|
14656
|
-
})();
|
14657
|
-
|
14658
|
-
// Very simple event handler wrapper function that doesn't attempt to solve issues such as "this" handling or
|
14659
|
-
// normalization of event properties
|
14660
|
-
var addListener;
|
14661
|
-
if (isBrowser) {
|
14662
|
-
if (isHostMethod(document, "addEventListener")) {
|
14663
|
-
addListener = function(obj, eventType, listener) {
|
14664
|
-
obj.addEventListener(eventType, listener, false);
|
14665
|
-
};
|
14666
|
-
} else if (isHostMethod(document, "attachEvent")) {
|
14667
|
-
addListener = function(obj, eventType, listener) {
|
14668
|
-
obj.attachEvent("on" + eventType, listener);
|
14669
|
-
};
|
14670
|
-
} else {
|
14671
|
-
fail("Document does not have required addEventListener or attachEvent method");
|
14672
|
-
}
|
14673
|
-
|
14674
|
-
util.addListener = addListener;
|
14675
|
-
}
|
14676
|
-
|
14677
|
-
var initListeners = [];
|
14678
|
-
|
14679
|
-
function getErrorDesc(ex) {
|
14680
|
-
return ex.message || ex.description || String(ex);
|
14681
|
-
}
|
14682
|
-
|
14683
|
-
// Initialization
|
14684
|
-
function init() {
|
14685
|
-
if (!isBrowser || api.initialized) {
|
14686
|
-
return;
|
14687
|
-
}
|
14688
|
-
var testRange;
|
14689
|
-
var implementsDomRange = false, implementsTextRange = false;
|
14690
|
-
|
14691
|
-
// First, perform basic feature tests
|
14692
|
-
|
14693
|
-
if (isHostMethod(document, "createRange")) {
|
14694
|
-
testRange = document.createRange();
|
14695
|
-
if (areHostMethods(testRange, domRangeMethods) && areHostProperties(testRange, domRangeProperties)) {
|
14696
|
-
implementsDomRange = true;
|
14697
|
-
}
|
14698
|
-
}
|
14699
|
-
|
14700
|
-
var body = getBody(document);
|
14701
|
-
if (!body || body.nodeName.toLowerCase() != "body") {
|
14702
|
-
fail("No body element found");
|
14703
|
-
return;
|
14704
|
-
}
|
14705
|
-
|
14706
|
-
if (body && isHostMethod(body, "createTextRange")) {
|
14707
|
-
testRange = body.createTextRange();
|
14708
|
-
if (isTextRange(testRange)) {
|
14709
|
-
implementsTextRange = true;
|
14710
|
-
}
|
14711
|
-
}
|
14712
|
-
|
14713
|
-
if (!implementsDomRange && !implementsTextRange) {
|
14714
|
-
fail("Neither Range nor TextRange are available");
|
14715
|
-
return;
|
14716
|
-
}
|
14717
|
-
|
14718
|
-
api.initialized = true;
|
14719
|
-
api.features = {
|
14720
|
-
implementsDomRange: implementsDomRange,
|
14721
|
-
implementsTextRange: implementsTextRange
|
14722
|
-
};
|
14723
|
-
|
14724
|
-
// Initialize modules
|
14725
|
-
var module, errorMessage;
|
14726
|
-
for (var moduleName in modules) {
|
14727
|
-
if ( (module = modules[moduleName]) instanceof Module ) {
|
14728
|
-
module.init(module, api);
|
14729
|
-
}
|
14730
|
-
}
|
14731
|
-
|
14732
|
-
// Call init listeners
|
14733
|
-
for (var i = 0, len = initListeners.length; i < len; ++i) {
|
14734
|
-
try {
|
14735
|
-
initListeners[i](api);
|
14736
|
-
} catch (ex) {
|
14737
|
-
errorMessage = "Rangy init listener threw an exception. Continuing. Detail: " + getErrorDesc(ex);
|
14738
|
-
consoleLog(errorMessage);
|
14739
|
-
}
|
14740
|
-
}
|
14741
|
-
}
|
14742
|
-
|
14743
|
-
function deprecationNotice(deprecated, replacement, module) {
|
14744
|
-
if (module) {
|
14745
|
-
deprecated += " in module " + module.name;
|
14746
|
-
}
|
14747
|
-
api.warn("DEPRECATED: " + deprecated + " is deprecated. Please use " +
|
14748
|
-
replacement + " instead.");
|
14749
|
-
}
|
14750
|
-
|
14751
|
-
function createAliasForDeprecatedMethod(owner, deprecated, replacement, module) {
|
14752
|
-
owner[deprecated] = function() {
|
14753
|
-
deprecationNotice(deprecated, replacement, module);
|
14754
|
-
return owner[replacement].apply(owner, util.toArray(arguments));
|
14755
|
-
};
|
14756
|
-
}
|
14757
|
-
|
14758
|
-
util.deprecationNotice = deprecationNotice;
|
14759
|
-
util.createAliasForDeprecatedMethod = createAliasForDeprecatedMethod;
|
14760
|
-
|
14761
|
-
// Allow external scripts to initialize this library in case it's loaded after the document has loaded
|
14762
|
-
api.init = init;
|
14763
|
-
|
14764
|
-
// Execute listener immediately if already initialized
|
14765
|
-
api.addInitListener = function(listener) {
|
14766
|
-
if (api.initialized) {
|
14767
|
-
listener(api);
|
14768
|
-
} else {
|
14769
|
-
initListeners.push(listener);
|
14770
|
-
}
|
14771
|
-
};
|
14772
|
-
|
14773
|
-
var shimListeners = [];
|
14774
|
-
|
14775
|
-
api.addShimListener = function(listener) {
|
14776
|
-
shimListeners.push(listener);
|
14777
|
-
};
|
14778
|
-
|
14779
|
-
function shim(win) {
|
14780
|
-
win = win || window;
|
14781
|
-
init();
|
14782
|
-
|
14783
|
-
// Notify listeners
|
14784
|
-
for (var i = 0, len = shimListeners.length; i < len; ++i) {
|
14785
|
-
shimListeners[i](win);
|
14786
|
-
}
|
14787
|
-
}
|
14788
|
-
|
14789
|
-
if (isBrowser) {
|
14790
|
-
api.shim = api.createMissingNativeApi = shim;
|
14791
|
-
createAliasForDeprecatedMethod(api, "createMissingNativeApi", "shim");
|
14792
|
-
}
|
14793
|
-
|
14794
|
-
function Module(name, dependencies, initializer) {
|
14795
|
-
this.name = name;
|
14796
|
-
this.dependencies = dependencies;
|
14797
|
-
this.initialized = false;
|
14798
|
-
this.supported = false;
|
14799
|
-
this.initializer = initializer;
|
14800
|
-
}
|
14801
|
-
|
14802
|
-
Module.prototype = {
|
14803
|
-
init: function() {
|
14804
|
-
var requiredModuleNames = this.dependencies || [];
|
14805
|
-
for (var i = 0, len = requiredModuleNames.length, requiredModule, moduleName; i < len; ++i) {
|
14806
|
-
moduleName = requiredModuleNames[i];
|
14807
|
-
|
14808
|
-
requiredModule = modules[moduleName];
|
14809
|
-
if (!requiredModule || !(requiredModule instanceof Module)) {
|
14810
|
-
throw new Error("required module '" + moduleName + "' not found");
|
14811
|
-
}
|
14812
|
-
|
14813
|
-
requiredModule.init();
|
14814
|
-
|
14815
|
-
if (!requiredModule.supported) {
|
14816
|
-
throw new Error("required module '" + moduleName + "' not supported");
|
14817
|
-
}
|
14818
|
-
}
|
14819
|
-
|
14820
|
-
// Now run initializer
|
14821
|
-
this.initializer(this);
|
14822
|
-
},
|
14823
|
-
|
14824
|
-
fail: function(reason) {
|
14825
|
-
this.initialized = true;
|
14826
|
-
this.supported = false;
|
14827
|
-
throw new Error(reason);
|
14828
|
-
},
|
14829
|
-
|
14830
|
-
warn: function(msg) {
|
14831
|
-
api.warn("Module " + this.name + ": " + msg);
|
14832
|
-
},
|
14833
|
-
|
14834
|
-
deprecationNotice: function(deprecated, replacement) {
|
14835
|
-
api.warn("DEPRECATED: " + deprecated + " in module " + this.name + " is deprecated. Please use " +
|
14836
|
-
replacement + " instead");
|
14837
|
-
},
|
14838
|
-
|
14839
|
-
createError: function(msg) {
|
14840
|
-
return new Error("Error in Rangy " + this.name + " module: " + msg);
|
14841
|
-
}
|
14842
|
-
};
|
14843
|
-
|
14844
|
-
function createModule(name, dependencies, initFunc) {
|
14845
|
-
var newModule = new Module(name, dependencies, function(module) {
|
14846
|
-
if (!module.initialized) {
|
14847
|
-
module.initialized = true;
|
14848
|
-
try {
|
14849
|
-
initFunc(api, module);
|
14850
|
-
module.supported = true;
|
14851
|
-
} catch (ex) {
|
14852
|
-
var errorMessage = "Module '" + name + "' failed to load: " + getErrorDesc(ex);
|
14853
|
-
consoleLog(errorMessage);
|
14854
|
-
if (ex.stack) {
|
14855
|
-
consoleLog(ex.stack);
|
14856
|
-
}
|
14857
|
-
}
|
14858
|
-
}
|
14859
|
-
});
|
14860
|
-
modules[name] = newModule;
|
14861
|
-
return newModule;
|
14862
|
-
}
|
14863
|
-
|
14864
|
-
api.createModule = function(name) {
|
14865
|
-
// Allow 2 or 3 arguments (second argument is an optional array of dependencies)
|
14866
|
-
var initFunc, dependencies;
|
14867
|
-
if (arguments.length == 2) {
|
14868
|
-
initFunc = arguments[1];
|
14869
|
-
dependencies = [];
|
14870
|
-
} else {
|
14871
|
-
initFunc = arguments[2];
|
14872
|
-
dependencies = arguments[1];
|
14873
|
-
}
|
14874
|
-
|
14875
|
-
var module = createModule(name, dependencies, initFunc);
|
14876
|
-
|
14877
|
-
// Initialize the module immediately if the core is already initialized
|
14878
|
-
if (api.initialized && api.supported) {
|
14879
|
-
module.init();
|
14880
|
-
}
|
14881
|
-
};
|
14882
|
-
|
14883
|
-
api.createCoreModule = function(name, dependencies, initFunc) {
|
14884
|
-
createModule(name, dependencies, initFunc);
|
14885
|
-
};
|
14886
|
-
|
14887
|
-
/*----------------------------------------------------------------------------------------------------------------*/
|
14888
|
-
|
14889
|
-
// Ensure rangy.rangePrototype and rangy.selectionPrototype are available immediately
|
14890
|
-
|
14891
|
-
function RangePrototype() {}
|
14892
|
-
api.RangePrototype = RangePrototype;
|
14893
|
-
api.rangePrototype = new RangePrototype();
|
14894
|
-
|
14895
|
-
function SelectionPrototype() {}
|
14896
|
-
api.selectionPrototype = new SelectionPrototype();
|
14897
|
-
|
14898
|
-
/*----------------------------------------------------------------------------------------------------------------*/
|
14899
|
-
|
14451
|
+
(function(factory, root) {
|
14452
|
+
{
|
14453
|
+
// Node/CommonJS style
|
14454
|
+
module.exports = factory();
|
14455
|
+
}
|
14456
|
+
})(function() {
|
14457
|
+
|
14458
|
+
var OBJECT = "object", FUNCTION = "function", UNDEFINED = "undefined";
|
14459
|
+
|
14460
|
+
// Minimal set of properties required for DOM Level 2 Range compliance. Comparison constants such as START_TO_START
|
14461
|
+
// are omitted because ranges in KHTML do not have them but otherwise work perfectly well. See issue 113.
|
14462
|
+
var domRangeProperties = ["startContainer", "startOffset", "endContainer", "endOffset", "collapsed",
|
14463
|
+
"commonAncestorContainer"];
|
14464
|
+
|
14465
|
+
// Minimal set of methods required for DOM Level 2 Range compliance
|
14466
|
+
var domRangeMethods = ["setStart", "setStartBefore", "setStartAfter", "setEnd", "setEndBefore",
|
14467
|
+
"setEndAfter", "collapse", "selectNode", "selectNodeContents", "compareBoundaryPoints", "deleteContents",
|
14468
|
+
"extractContents", "cloneContents", "insertNode", "surroundContents", "cloneRange", "toString", "detach"];
|
14469
|
+
|
14470
|
+
var textRangeProperties = ["boundingHeight", "boundingLeft", "boundingTop", "boundingWidth", "htmlText", "text"];
|
14471
|
+
|
14472
|
+
// Subset of TextRange's full set of methods that we're interested in
|
14473
|
+
var textRangeMethods = ["collapse", "compareEndPoints", "duplicate", "moveToElementText", "parentElement", "select",
|
14474
|
+
"setEndPoint", "getBoundingClientRect"];
|
14475
|
+
|
14476
|
+
/*----------------------------------------------------------------------------------------------------------------*/
|
14477
|
+
|
14478
|
+
// Trio of functions taken from Peter Michaux's article:
|
14479
|
+
// http://peter.michaux.ca/articles/feature-detection-state-of-the-art-browser-scripting
|
14480
|
+
function isHostMethod(o, p) {
|
14481
|
+
var t = typeof o[p];
|
14482
|
+
return t == FUNCTION || (!!(t == OBJECT && o[p])) || t == "unknown";
|
14483
|
+
}
|
14484
|
+
|
14485
|
+
function isHostObject(o, p) {
|
14486
|
+
return !!(typeof o[p] == OBJECT && o[p]);
|
14487
|
+
}
|
14488
|
+
|
14489
|
+
function isHostProperty(o, p) {
|
14490
|
+
return typeof o[p] != UNDEFINED;
|
14491
|
+
}
|
14492
|
+
|
14493
|
+
// Creates a convenience function to save verbose repeated calls to tests functions
|
14494
|
+
function createMultiplePropertyTest(testFunc) {
|
14495
|
+
return function(o, props) {
|
14496
|
+
var i = props.length;
|
14497
|
+
while (i--) {
|
14498
|
+
if (!testFunc(o, props[i])) {
|
14499
|
+
return false;
|
14500
|
+
}
|
14501
|
+
}
|
14502
|
+
return true;
|
14503
|
+
};
|
14504
|
+
}
|
14505
|
+
|
14506
|
+
// Next trio of functions are a convenience to save verbose repeated calls to previous two functions
|
14507
|
+
var areHostMethods = createMultiplePropertyTest(isHostMethod);
|
14508
|
+
var areHostObjects = createMultiplePropertyTest(isHostObject);
|
14509
|
+
var areHostProperties = createMultiplePropertyTest(isHostProperty);
|
14510
|
+
|
14511
|
+
function isTextRange(range) {
|
14512
|
+
return range && areHostMethods(range, textRangeMethods) && areHostProperties(range, textRangeProperties);
|
14513
|
+
}
|
14514
|
+
|
14515
|
+
function getBody(doc) {
|
14516
|
+
return isHostObject(doc, "body") ? doc.body : doc.getElementsByTagName("body")[0];
|
14517
|
+
}
|
14518
|
+
|
14519
|
+
var forEach = [].forEach ?
|
14520
|
+
function(arr, func) {
|
14521
|
+
arr.forEach(func);
|
14522
|
+
} :
|
14523
|
+
function(arr, func) {
|
14524
|
+
for (var i = 0, len = arr.length; i < len; ++i) {
|
14525
|
+
func(arr[i], i);
|
14526
|
+
}
|
14527
|
+
};
|
14528
|
+
|
14529
|
+
var modules = {};
|
14530
|
+
|
14531
|
+
var isBrowser = (typeof window != UNDEFINED && typeof document != UNDEFINED);
|
14532
|
+
|
14533
|
+
var util = {
|
14534
|
+
isHostMethod: isHostMethod,
|
14535
|
+
isHostObject: isHostObject,
|
14536
|
+
isHostProperty: isHostProperty,
|
14537
|
+
areHostMethods: areHostMethods,
|
14538
|
+
areHostObjects: areHostObjects,
|
14539
|
+
areHostProperties: areHostProperties,
|
14540
|
+
isTextRange: isTextRange,
|
14541
|
+
getBody: getBody,
|
14542
|
+
forEach: forEach
|
14543
|
+
};
|
14544
|
+
|
14545
|
+
var api = {
|
14546
|
+
version: "1.3.1",
|
14547
|
+
initialized: false,
|
14548
|
+
isBrowser: isBrowser,
|
14549
|
+
supported: true,
|
14550
|
+
util: util,
|
14551
|
+
features: {},
|
14552
|
+
modules: modules,
|
14553
|
+
config: {
|
14554
|
+
alertOnFail: false,
|
14555
|
+
alertOnWarn: false,
|
14556
|
+
preferTextRange: false,
|
14557
|
+
autoInitialize: (typeof rangyAutoInitialize == UNDEFINED) ? true : rangyAutoInitialize
|
14558
|
+
}
|
14559
|
+
};
|
14560
|
+
|
14561
|
+
function consoleLog(msg) {
|
14562
|
+
if (typeof console != UNDEFINED && isHostMethod(console, "log")) {
|
14563
|
+
console.log(msg);
|
14564
|
+
}
|
14565
|
+
}
|
14566
|
+
|
14567
|
+
function alertOrLog(msg, shouldAlert) {
|
14568
|
+
if (isBrowser && shouldAlert) {
|
14569
|
+
alert(msg);
|
14570
|
+
} else {
|
14571
|
+
consoleLog(msg);
|
14572
|
+
}
|
14573
|
+
}
|
14574
|
+
|
14575
|
+
function fail(reason) {
|
14576
|
+
api.initialized = true;
|
14577
|
+
api.supported = false;
|
14578
|
+
alertOrLog("Rangy is not supported in this environment. Reason: " + reason, api.config.alertOnFail);
|
14579
|
+
}
|
14580
|
+
|
14581
|
+
api.fail = fail;
|
14582
|
+
|
14583
|
+
function warn(msg) {
|
14584
|
+
alertOrLog("Rangy warning: " + msg, api.config.alertOnWarn);
|
14585
|
+
}
|
14586
|
+
|
14587
|
+
api.warn = warn;
|
14588
|
+
|
14589
|
+
// Add utility extend() method
|
14590
|
+
var extend;
|
14591
|
+
if ({}.hasOwnProperty) {
|
14592
|
+
util.extend = extend = function(obj, props, deep) {
|
14593
|
+
var o, p;
|
14594
|
+
for (var i in props) {
|
14595
|
+
if (props.hasOwnProperty(i)) {
|
14596
|
+
o = obj[i];
|
14597
|
+
p = props[i];
|
14598
|
+
if (deep && o !== null && typeof o == "object" && p !== null && typeof p == "object") {
|
14599
|
+
extend(o, p, true);
|
14600
|
+
}
|
14601
|
+
obj[i] = p;
|
14602
|
+
}
|
14603
|
+
}
|
14604
|
+
// Special case for toString, which does not show up in for...in loops in IE <= 8
|
14605
|
+
if (props.hasOwnProperty("toString")) {
|
14606
|
+
obj.toString = props.toString;
|
14607
|
+
}
|
14608
|
+
return obj;
|
14609
|
+
};
|
14610
|
+
|
14611
|
+
util.createOptions = function(optionsParam, defaults) {
|
14612
|
+
var options = {};
|
14613
|
+
extend(options, defaults);
|
14614
|
+
if (optionsParam) {
|
14615
|
+
extend(options, optionsParam);
|
14616
|
+
}
|
14617
|
+
return options;
|
14618
|
+
};
|
14619
|
+
} else {
|
14620
|
+
fail("hasOwnProperty not supported");
|
14621
|
+
}
|
14622
|
+
|
14623
|
+
// Test whether we're in a browser and bail out if not
|
14624
|
+
if (!isBrowser) {
|
14625
|
+
fail("Rangy can only run in a browser");
|
14626
|
+
}
|
14627
|
+
|
14628
|
+
// Test whether Array.prototype.slice can be relied on for NodeLists and use an alternative toArray() if not
|
14629
|
+
(function() {
|
14630
|
+
var toArray;
|
14631
|
+
|
14632
|
+
if (isBrowser) {
|
14633
|
+
var el = document.createElement("div");
|
14634
|
+
el.appendChild(document.createElement("span"));
|
14635
|
+
var slice = [].slice;
|
14636
|
+
try {
|
14637
|
+
if (slice.call(el.childNodes, 0)[0].nodeType == 1) {
|
14638
|
+
toArray = function(arrayLike) {
|
14639
|
+
return slice.call(arrayLike, 0);
|
14640
|
+
};
|
14641
|
+
}
|
14642
|
+
} catch (e) {}
|
14643
|
+
}
|
14644
|
+
|
14645
|
+
if (!toArray) {
|
14646
|
+
toArray = function(arrayLike) {
|
14647
|
+
var arr = [];
|
14648
|
+
for (var i = 0, len = arrayLike.length; i < len; ++i) {
|
14649
|
+
arr[i] = arrayLike[i];
|
14650
|
+
}
|
14651
|
+
return arr;
|
14652
|
+
};
|
14653
|
+
}
|
14654
|
+
|
14655
|
+
util.toArray = toArray;
|
14656
|
+
})();
|
14657
|
+
|
14658
|
+
// Very simple event handler wrapper function that doesn't attempt to solve issues such as "this" handling or
|
14659
|
+
// normalization of event properties because we don't need this.
|
14660
|
+
var addListener;
|
14661
|
+
if (isBrowser) {
|
14662
|
+
if (isHostMethod(document, "addEventListener")) {
|
14663
|
+
addListener = function(obj, eventType, listener) {
|
14664
|
+
obj.addEventListener(eventType, listener, false);
|
14665
|
+
};
|
14666
|
+
} else if (isHostMethod(document, "attachEvent")) {
|
14667
|
+
addListener = function(obj, eventType, listener) {
|
14668
|
+
obj.attachEvent("on" + eventType, listener);
|
14669
|
+
};
|
14670
|
+
} else {
|
14671
|
+
fail("Document does not have required addEventListener or attachEvent method");
|
14672
|
+
}
|
14673
|
+
|
14674
|
+
util.addListener = addListener;
|
14675
|
+
}
|
14676
|
+
|
14677
|
+
var initListeners = [];
|
14678
|
+
|
14679
|
+
function getErrorDesc(ex) {
|
14680
|
+
return ex.message || ex.description || String(ex);
|
14681
|
+
}
|
14682
|
+
|
14683
|
+
// Initialization
|
14684
|
+
function init() {
|
14685
|
+
if (!isBrowser || api.initialized) {
|
14686
|
+
return;
|
14687
|
+
}
|
14688
|
+
var testRange;
|
14689
|
+
var implementsDomRange = false, implementsTextRange = false;
|
14690
|
+
|
14691
|
+
// First, perform basic feature tests
|
14692
|
+
|
14693
|
+
if (isHostMethod(document, "createRange")) {
|
14694
|
+
testRange = document.createRange();
|
14695
|
+
if (areHostMethods(testRange, domRangeMethods) && areHostProperties(testRange, domRangeProperties)) {
|
14696
|
+
implementsDomRange = true;
|
14697
|
+
}
|
14698
|
+
}
|
14699
|
+
|
14700
|
+
var body = getBody(document);
|
14701
|
+
if (!body || body.nodeName.toLowerCase() != "body") {
|
14702
|
+
fail("No body element found");
|
14703
|
+
return;
|
14704
|
+
}
|
14705
|
+
|
14706
|
+
if (body && isHostMethod(body, "createTextRange")) {
|
14707
|
+
testRange = body.createTextRange();
|
14708
|
+
if (isTextRange(testRange)) {
|
14709
|
+
implementsTextRange = true;
|
14710
|
+
}
|
14711
|
+
}
|
14712
|
+
|
14713
|
+
if (!implementsDomRange && !implementsTextRange) {
|
14714
|
+
fail("Neither Range nor TextRange are available");
|
14715
|
+
return;
|
14716
|
+
}
|
14717
|
+
|
14718
|
+
api.initialized = true;
|
14719
|
+
api.features = {
|
14720
|
+
implementsDomRange: implementsDomRange,
|
14721
|
+
implementsTextRange: implementsTextRange
|
14722
|
+
};
|
14723
|
+
|
14724
|
+
// Initialize modules
|
14725
|
+
var module, errorMessage;
|
14726
|
+
for (var moduleName in modules) {
|
14727
|
+
if ( (module = modules[moduleName]) instanceof Module ) {
|
14728
|
+
module.init(module, api);
|
14729
|
+
}
|
14730
|
+
}
|
14731
|
+
|
14732
|
+
// Call init listeners
|
14733
|
+
for (var i = 0, len = initListeners.length; i < len; ++i) {
|
14734
|
+
try {
|
14735
|
+
initListeners[i](api);
|
14736
|
+
} catch (ex) {
|
14737
|
+
errorMessage = "Rangy init listener threw an exception. Continuing. Detail: " + getErrorDesc(ex);
|
14738
|
+
consoleLog(errorMessage);
|
14739
|
+
}
|
14740
|
+
}
|
14741
|
+
}
|
14742
|
+
|
14743
|
+
function deprecationNotice(deprecated, replacement, module) {
|
14744
|
+
if (module) {
|
14745
|
+
deprecated += " in module " + module.name;
|
14746
|
+
}
|
14747
|
+
api.warn("DEPRECATED: " + deprecated + " is deprecated. Please use " +
|
14748
|
+
replacement + " instead.");
|
14749
|
+
}
|
14750
|
+
|
14751
|
+
function createAliasForDeprecatedMethod(owner, deprecated, replacement, module) {
|
14752
|
+
owner[deprecated] = function() {
|
14753
|
+
deprecationNotice(deprecated, replacement, module);
|
14754
|
+
return owner[replacement].apply(owner, util.toArray(arguments));
|
14755
|
+
};
|
14756
|
+
}
|
14757
|
+
|
14758
|
+
util.deprecationNotice = deprecationNotice;
|
14759
|
+
util.createAliasForDeprecatedMethod = createAliasForDeprecatedMethod;
|
14760
|
+
|
14761
|
+
// Allow external scripts to initialize this library in case it's loaded after the document has loaded
|
14762
|
+
api.init = init;
|
14763
|
+
|
14764
|
+
// Execute listener immediately if already initialized
|
14765
|
+
api.addInitListener = function(listener) {
|
14766
|
+
if (api.initialized) {
|
14767
|
+
listener(api);
|
14768
|
+
} else {
|
14769
|
+
initListeners.push(listener);
|
14770
|
+
}
|
14771
|
+
};
|
14772
|
+
|
14773
|
+
var shimListeners = [];
|
14774
|
+
|
14775
|
+
api.addShimListener = function(listener) {
|
14776
|
+
shimListeners.push(listener);
|
14777
|
+
};
|
14778
|
+
|
14779
|
+
function shim(win) {
|
14780
|
+
win = win || window;
|
14781
|
+
init();
|
14782
|
+
|
14783
|
+
// Notify listeners
|
14784
|
+
for (var i = 0, len = shimListeners.length; i < len; ++i) {
|
14785
|
+
shimListeners[i](win);
|
14786
|
+
}
|
14787
|
+
}
|
14788
|
+
|
14789
|
+
if (isBrowser) {
|
14790
|
+
api.shim = api.createMissingNativeApi = shim;
|
14791
|
+
createAliasForDeprecatedMethod(api, "createMissingNativeApi", "shim");
|
14792
|
+
}
|
14793
|
+
|
14794
|
+
function Module(name, dependencies, initializer) {
|
14795
|
+
this.name = name;
|
14796
|
+
this.dependencies = dependencies;
|
14797
|
+
this.initialized = false;
|
14798
|
+
this.supported = false;
|
14799
|
+
this.initializer = initializer;
|
14800
|
+
}
|
14801
|
+
|
14802
|
+
Module.prototype = {
|
14803
|
+
init: function() {
|
14804
|
+
var requiredModuleNames = this.dependencies || [];
|
14805
|
+
for (var i = 0, len = requiredModuleNames.length, requiredModule, moduleName; i < len; ++i) {
|
14806
|
+
moduleName = requiredModuleNames[i];
|
14807
|
+
|
14808
|
+
requiredModule = modules[moduleName];
|
14809
|
+
if (!requiredModule || !(requiredModule instanceof Module)) {
|
14810
|
+
throw new Error("required module '" + moduleName + "' not found");
|
14811
|
+
}
|
14812
|
+
|
14813
|
+
requiredModule.init();
|
14814
|
+
|
14815
|
+
if (!requiredModule.supported) {
|
14816
|
+
throw new Error("required module '" + moduleName + "' not supported");
|
14817
|
+
}
|
14818
|
+
}
|
14819
|
+
|
14820
|
+
// Now run initializer
|
14821
|
+
this.initializer(this);
|
14822
|
+
},
|
14823
|
+
|
14824
|
+
fail: function(reason) {
|
14825
|
+
this.initialized = true;
|
14826
|
+
this.supported = false;
|
14827
|
+
throw new Error(reason);
|
14828
|
+
},
|
14829
|
+
|
14830
|
+
warn: function(msg) {
|
14831
|
+
api.warn("Module " + this.name + ": " + msg);
|
14832
|
+
},
|
14833
|
+
|
14834
|
+
deprecationNotice: function(deprecated, replacement) {
|
14835
|
+
api.warn("DEPRECATED: " + deprecated + " in module " + this.name + " is deprecated. Please use " +
|
14836
|
+
replacement + " instead");
|
14837
|
+
},
|
14838
|
+
|
14839
|
+
createError: function(msg) {
|
14840
|
+
return new Error("Error in Rangy " + this.name + " module: " + msg);
|
14841
|
+
}
|
14842
|
+
};
|
14843
|
+
|
14844
|
+
function createModule(name, dependencies, initFunc) {
|
14845
|
+
var newModule = new Module(name, dependencies, function(module) {
|
14846
|
+
if (!module.initialized) {
|
14847
|
+
module.initialized = true;
|
14848
|
+
try {
|
14849
|
+
initFunc(api, module);
|
14850
|
+
module.supported = true;
|
14851
|
+
} catch (ex) {
|
14852
|
+
var errorMessage = "Module '" + name + "' failed to load: " + getErrorDesc(ex);
|
14853
|
+
consoleLog(errorMessage);
|
14854
|
+
if (ex.stack) {
|
14855
|
+
consoleLog(ex.stack);
|
14856
|
+
}
|
14857
|
+
}
|
14858
|
+
}
|
14859
|
+
});
|
14860
|
+
modules[name] = newModule;
|
14861
|
+
return newModule;
|
14862
|
+
}
|
14863
|
+
|
14864
|
+
api.createModule = function(name) {
|
14865
|
+
// Allow 2 or 3 arguments (second argument is an optional array of dependencies)
|
14866
|
+
var initFunc, dependencies;
|
14867
|
+
if (arguments.length == 2) {
|
14868
|
+
initFunc = arguments[1];
|
14869
|
+
dependencies = [];
|
14870
|
+
} else {
|
14871
|
+
initFunc = arguments[2];
|
14872
|
+
dependencies = arguments[1];
|
14873
|
+
}
|
14874
|
+
|
14875
|
+
var module = createModule(name, dependencies, initFunc);
|
14876
|
+
|
14877
|
+
// Initialize the module immediately if the core is already initialized
|
14878
|
+
if (api.initialized && api.supported) {
|
14879
|
+
module.init();
|
14880
|
+
}
|
14881
|
+
};
|
14882
|
+
|
14883
|
+
api.createCoreModule = function(name, dependencies, initFunc) {
|
14884
|
+
createModule(name, dependencies, initFunc);
|
14885
|
+
};
|
14886
|
+
|
14887
|
+
/*----------------------------------------------------------------------------------------------------------------*/
|
14888
|
+
|
14889
|
+
// Ensure rangy.rangePrototype and rangy.selectionPrototype are available immediately
|
14890
|
+
|
14891
|
+
function RangePrototype() {}
|
14892
|
+
api.RangePrototype = RangePrototype;
|
14893
|
+
api.rangePrototype = new RangePrototype();
|
14894
|
+
|
14895
|
+
function SelectionPrototype() {}
|
14896
|
+
api.selectionPrototype = new SelectionPrototype();
|
14897
|
+
|
14898
|
+
/*----------------------------------------------------------------------------------------------------------------*/
|
14899
|
+
|
14900
14900
|
// DOM utility methods used by Rangy
|
14901
14901
|
api.createCoreModule("DomUtil", [], function(api, module) {
|
14902
14902
|
var UNDEF = "undefined";
|
@@ -15395,10 +15395,10 @@ var rangyCore = {exports: {}};
|
|
15395
15395
|
};
|
15396
15396
|
|
15397
15397
|
api.DOMException = DOMException;
|
15398
|
-
});
|
15399
|
-
|
15400
|
-
/*----------------------------------------------------------------------------------------------------------------*/
|
15401
|
-
|
15398
|
+
});
|
15399
|
+
|
15400
|
+
/*----------------------------------------------------------------------------------------------------------------*/
|
15401
|
+
|
15402
15402
|
// Pure JavaScript implementation of DOM Range
|
15403
15403
|
api.createCoreModule("DomRange", ["DomUtil"], function(api, module) {
|
15404
15404
|
var dom = api.dom;
|
@@ -15736,6 +15736,7 @@ var rangyCore = {exports: {}};
|
|
15736
15736
|
var getDocumentOrFragmentContainer = createAncestorFinder( [9, 11] );
|
15737
15737
|
var getReadonlyAncestor = createAncestorFinder(readonlyNodeTypes);
|
15738
15738
|
var getDocTypeNotationEntityAncestor = createAncestorFinder( [6, 10, 12] );
|
15739
|
+
var getElementAncestor = createAncestorFinder( [1] );
|
15739
15740
|
|
15740
15741
|
function assertNoDocTypeNotationEntityAncestor(node, allowSelf) {
|
15741
15742
|
if (getDocTypeNotationEntityAncestor(node, allowSelf)) {
|
@@ -15798,7 +15799,7 @@ var rangyCore = {exports: {}};
|
|
15798
15799
|
var htmlParsingConforms = false;
|
15799
15800
|
try {
|
15800
15801
|
styleEl.innerHTML = "<b>x</b>";
|
15801
|
-
htmlParsingConforms = (styleEl.firstChild.nodeType == 3); // Opera incorrectly creates an element node
|
15802
|
+
htmlParsingConforms = (styleEl.firstChild.nodeType == 3); // Pre-Blink Opera incorrectly creates an element node
|
15802
15803
|
} catch (e) {
|
15803
15804
|
// IE 6 and 7 throw
|
15804
15805
|
}
|
@@ -16399,6 +16400,12 @@ var rangyCore = {exports: {}};
|
|
16399
16400
|
break;
|
16400
16401
|
}
|
16401
16402
|
|
16403
|
+
assertNoDocTypeNotationEntityAncestor(sc, true);
|
16404
|
+
assertValidOffset(sc, so);
|
16405
|
+
|
16406
|
+
assertNoDocTypeNotationEntityAncestor(ec, true);
|
16407
|
+
assertValidOffset(ec, eo);
|
16408
|
+
|
16402
16409
|
boundaryUpdater(this, sc, so, ec, eo);
|
16403
16410
|
},
|
16404
16411
|
|
@@ -16561,6 +16568,12 @@ var rangyCore = {exports: {}};
|
|
16561
16568
|
assertNoDocTypeNotationEntityAncestor(node, true);
|
16562
16569
|
assertValidOffset(node, offset);
|
16563
16570
|
this.setStartAndEnd(node, offset);
|
16571
|
+
},
|
16572
|
+
|
16573
|
+
parentElement: function() {
|
16574
|
+
assertRangeValid(this);
|
16575
|
+
var parentNode = this.commonAncestorContainer;
|
16576
|
+
return parentNode ? getElementAncestor(this.commonAncestorContainer, true) : null;
|
16564
16577
|
}
|
16565
16578
|
});
|
16566
16579
|
|
@@ -16582,17 +16595,11 @@ var rangyCore = {exports: {}};
|
|
16582
16595
|
range.endContainer = endContainer;
|
16583
16596
|
range.endOffset = endOffset;
|
16584
16597
|
range.document = dom.getDocument(startContainer);
|
16585
|
-
|
16586
16598
|
updateCollapsedAndCommonAncestor(range);
|
16587
16599
|
}
|
16588
16600
|
|
16589
16601
|
function Range(doc) {
|
16590
|
-
this
|
16591
|
-
this.startOffset = 0;
|
16592
|
-
this.endContainer = doc;
|
16593
|
-
this.endOffset = 0;
|
16594
|
-
this.document = doc;
|
16595
|
-
updateCollapsedAndCommonAncestor(this);
|
16602
|
+
updateBoundaries(this, doc, 0, doc, 0);
|
16596
16603
|
}
|
16597
16604
|
|
16598
16605
|
createPrototypeRange(Range, updateBoundaries);
|
@@ -16614,10 +16621,10 @@ var rangyCore = {exports: {}};
|
|
16614
16621
|
});
|
16615
16622
|
|
16616
16623
|
api.DomRange = Range;
|
16617
|
-
});
|
16618
|
-
|
16619
|
-
/*----------------------------------------------------------------------------------------------------------------*/
|
16620
|
-
|
16624
|
+
});
|
16625
|
+
|
16626
|
+
/*----------------------------------------------------------------------------------------------------------------*/
|
16627
|
+
|
16621
16628
|
// Wrappers for the browser's native DOM Range and/or TextRange implementation
|
16622
16629
|
api.createCoreModule("WrappedRange", ["DomRange"], function(api, module) {
|
16623
16630
|
var WrappedRange, WrappedTextRange;
|
@@ -17220,12 +17227,12 @@ var rangyCore = {exports: {}};
|
|
17220
17227
|
}
|
17221
17228
|
doc = win = null;
|
17222
17229
|
});
|
17223
|
-
});
|
17224
|
-
|
17225
|
-
/*----------------------------------------------------------------------------------------------------------------*/
|
17226
|
-
|
17230
|
+
});
|
17231
|
+
|
17232
|
+
/*----------------------------------------------------------------------------------------------------------------*/
|
17233
|
+
|
17227
17234
|
// This module creates a selection object wrapper that conforms as closely as possible to the Selection specification
|
17228
|
-
// in the
|
17235
|
+
// in the W3C Selection API spec (https://www.w3.org/TR/selection-api)
|
17229
17236
|
api.createCoreModule("WrappedSelection", ["DomRange", "WrappedRange"], function(api, module) {
|
17230
17237
|
api.config.checkSelectionRanges = true;
|
17231
17238
|
|
@@ -17333,6 +17340,10 @@ var rangyCore = {exports: {}};
|
|
17333
17340
|
var selectionHasExtend = isHostMethod(testSelection, "extend");
|
17334
17341
|
features.selectionHasExtend = selectionHasExtend;
|
17335
17342
|
|
17343
|
+
// Test for existence of native selection setBaseAndExtent() method
|
17344
|
+
var selectionHasSetBaseAndExtent = isHostMethod(testSelection, "setBaseAndExtent");
|
17345
|
+
features.selectionHasSetBaseAndExtent = selectionHasSetBaseAndExtent;
|
17346
|
+
|
17336
17347
|
// Test if rangeCount exists
|
17337
17348
|
var selectionHasRangeCount = (typeof testSelection.rangeCount == NUMBER);
|
17338
17349
|
features.selectionHasRangeCount = selectionHasRangeCount;
|
@@ -17357,7 +17368,7 @@ var rangyCore = {exports: {}};
|
|
17357
17368
|
// performed on the current document's selection. See issue 109.
|
17358
17369
|
|
17359
17370
|
// Note also that if a selection previously existed, it is wiped and later restored by these tests. This
|
17360
|
-
// will result in the selection direction
|
17371
|
+
// will result in the selection direction being reversed if the original selection was backwards and the
|
17361
17372
|
// browser does not support setting backwards selections (Internet Explorer, I'm looking at you).
|
17362
17373
|
var sel = window.getSelection();
|
17363
17374
|
if (sel) {
|
@@ -17472,6 +17483,11 @@ var rangyCore = {exports: {}};
|
|
17472
17483
|
sel.rangeCount = 0;
|
17473
17484
|
sel.isCollapsed = true;
|
17474
17485
|
sel._ranges.length = 0;
|
17486
|
+
updateType(sel);
|
17487
|
+
}
|
17488
|
+
|
17489
|
+
function updateType(sel) {
|
17490
|
+
sel.type = (sel.rangeCount == 0) ? "None" : (selectionIsCollapsed(sel) ? "Caret" : "Range");
|
17475
17491
|
}
|
17476
17492
|
|
17477
17493
|
function getNativeRange(range) {
|
@@ -17521,6 +17537,7 @@ var rangyCore = {exports: {}};
|
|
17521
17537
|
updateAnchorAndFocusFromRange(sel, wrappedRange, false);
|
17522
17538
|
sel.rangeCount = 1;
|
17523
17539
|
sel.isCollapsed = wrappedRange.collapsed;
|
17540
|
+
updateType(sel);
|
17524
17541
|
}
|
17525
17542
|
|
17526
17543
|
function updateControlSelection(sel) {
|
@@ -17545,6 +17562,7 @@ var rangyCore = {exports: {}};
|
|
17545
17562
|
}
|
17546
17563
|
sel.isCollapsed = sel.rangeCount == 1 && sel._ranges[0].collapsed;
|
17547
17564
|
updateAnchorAndFocusFromRange(sel, sel._ranges[sel.rangeCount - 1], false);
|
17565
|
+
updateType(sel);
|
17548
17566
|
}
|
17549
17567
|
}
|
17550
17568
|
}
|
@@ -17614,6 +17632,7 @@ var rangyCore = {exports: {}};
|
|
17614
17632
|
sel.win = sel.anchorNode = sel.focusNode = sel._ranges = null;
|
17615
17633
|
sel.rangeCount = sel.anchorOffset = sel.focusOffset = 0;
|
17616
17634
|
sel.detached = true;
|
17635
|
+
updateType(sel);
|
17617
17636
|
}
|
17618
17637
|
|
17619
17638
|
var cachedRangySelections = [];
|
@@ -17740,6 +17759,7 @@ var rangyCore = {exports: {}};
|
|
17740
17759
|
this._ranges[this.rangeCount - 1] = range;
|
17741
17760
|
updateAnchorAndFocusFromRange(this, range, selectionIsBackward(this.nativeSelection));
|
17742
17761
|
this.isCollapsed = selectionIsCollapsed(this);
|
17762
|
+
updateType(this);
|
17743
17763
|
} else {
|
17744
17764
|
// The range was not added successfully. The simplest thing is to refresh
|
17745
17765
|
this.refresh();
|
@@ -17808,6 +17828,7 @@ var rangyCore = {exports: {}};
|
|
17808
17828
|
this.rangeCount = 1;
|
17809
17829
|
this.isCollapsed = this._ranges[0].collapsed;
|
17810
17830
|
updateAnchorAndFocusFromRange(this, range, false);
|
17831
|
+
updateType(this);
|
17811
17832
|
}
|
17812
17833
|
};
|
17813
17834
|
|
@@ -17866,6 +17887,7 @@ var rangyCore = {exports: {}};
|
|
17866
17887
|
}
|
17867
17888
|
updateAnchorAndFocusFromRange(sel, sel._ranges[sel.rangeCount - 1], selectionIsBackward(sel.nativeSelection));
|
17868
17889
|
sel.isCollapsed = selectionIsCollapsed(sel);
|
17890
|
+
updateType(sel);
|
17869
17891
|
} else {
|
17870
17892
|
updateEmptySelection(sel);
|
17871
17893
|
}
|
@@ -17880,6 +17902,7 @@ var rangyCore = {exports: {}};
|
|
17880
17902
|
sel.rangeCount = 1;
|
17881
17903
|
updateAnchorAndFocusFromNativeSelection(sel);
|
17882
17904
|
sel.isCollapsed = selectionIsCollapsed(sel);
|
17905
|
+
updateType(sel);
|
17883
17906
|
} else {
|
17884
17907
|
updateEmptySelection(sel);
|
17885
17908
|
}
|
@@ -17998,6 +18021,12 @@ var rangyCore = {exports: {}};
|
|
17998
18021
|
}
|
17999
18022
|
}
|
18000
18023
|
|
18024
|
+
function assertValidOffset(node, offset) {
|
18025
|
+
if (offset < 0 || offset > (dom.isCharacterDataNode(node) ? node.length : node.childNodes.length)) {
|
18026
|
+
throw new DOMException("INDEX_SIZE_ERR");
|
18027
|
+
}
|
18028
|
+
}
|
18029
|
+
|
18001
18030
|
// No current browser conforms fully to the spec for this method, so Rangy's own method is always used
|
18002
18031
|
selProto.collapse = function(node, offset) {
|
18003
18032
|
assertNodeInSameDocument(this, node);
|
@@ -18034,6 +18063,28 @@ var rangyCore = {exports: {}};
|
|
18034
18063
|
this.setSingleRange(range);
|
18035
18064
|
};
|
18036
18065
|
|
18066
|
+
if (selectionHasSetBaseAndExtent) {
|
18067
|
+
selProto.setBaseAndExtent = function(anchorNode, anchorOffset, focusNode, focusOffset) {
|
18068
|
+
this.nativeSelection.setBaseAndExtent(anchorNode, anchorOffset, focusNode, focusOffset);
|
18069
|
+
this.refresh();
|
18070
|
+
};
|
18071
|
+
} else if (selectionHasExtend) {
|
18072
|
+
selProto.setBaseAndExtent = function(anchorNode, anchorOffset, focusNode, focusOffset) {
|
18073
|
+
assertValidOffset(anchorNode, anchorOffset);
|
18074
|
+
assertValidOffset(focusNode, focusOffset);
|
18075
|
+
assertNodeInSameDocument(this, anchorNode);
|
18076
|
+
assertNodeInSameDocument(this, focusNode);
|
18077
|
+
var range = api.createRange(node);
|
18078
|
+
var isBackwards = (dom.comparePoints(anchorNode, anchorOffset, focusNode, focusOffset) == -1);
|
18079
|
+
if (isBackwards) {
|
18080
|
+
range.setStartAndEnd(focusNode, focusOffset, anchorNode, anchorOffset);
|
18081
|
+
} else {
|
18082
|
+
range.setStartAndEnd(anchorNode, anchorOffset, focusNode, focusOffset);
|
18083
|
+
}
|
18084
|
+
this.setSingleRange(range, isBackwards);
|
18085
|
+
};
|
18086
|
+
}
|
18087
|
+
|
18037
18088
|
selProto.deleteFromDocument = function() {
|
18038
18089
|
// Sepcial behaviour required for IE's control selections
|
18039
18090
|
if (implementsControlRange && implementsDocSelection && this.docSelection.type == CONTROL) {
|
@@ -18243,256 +18294,42 @@ var rangyCore = {exports: {}};
|
|
18243
18294
|
win = null;
|
18244
18295
|
});
|
18245
18296
|
});
|
18246
|
-
|
18247
|
-
|
18248
|
-
/*----------------------------------------------------------------------------------------------------------------*/
|
18249
|
-
|
18250
|
-
// Wait for document to load before initializing
|
18251
|
-
var docReady = false;
|
18252
|
-
|
18253
|
-
var loadHandler = function(e) {
|
18254
|
-
if (!docReady) {
|
18255
|
-
docReady = true;
|
18256
|
-
if (!api.initialized && api.config.autoInitialize) {
|
18257
|
-
init();
|
18258
|
-
}
|
18259
|
-
}
|
18260
|
-
};
|
18261
|
-
|
18262
|
-
if (isBrowser) {
|
18263
|
-
// Test whether the document has already been loaded and initialize immediately if so
|
18264
|
-
if (document.readyState == "complete") {
|
18265
|
-
loadHandler();
|
18266
|
-
} else {
|
18267
|
-
if (isHostMethod(document, "addEventListener")) {
|
18268
|
-
document.addEventListener("DOMContentLoaded", loadHandler, false);
|
18269
|
-
}
|
18270
|
-
|
18271
|
-
// Add a fallback in case the DOMContentLoaded event isn't supported
|
18272
|
-
addListener(window, "load", loadHandler);
|
18273
|
-
}
|
18274
|
-
}
|
18275
|
-
|
18276
|
-
return api;
|
18297
|
+
|
18298
|
+
|
18299
|
+
/*----------------------------------------------------------------------------------------------------------------*/
|
18300
|
+
|
18301
|
+
// Wait for document to load before initializing
|
18302
|
+
var docReady = false;
|
18303
|
+
|
18304
|
+
var loadHandler = function(e) {
|
18305
|
+
if (!docReady) {
|
18306
|
+
docReady = true;
|
18307
|
+
if (!api.initialized && api.config.autoInitialize) {
|
18308
|
+
init();
|
18309
|
+
}
|
18310
|
+
}
|
18311
|
+
};
|
18312
|
+
|
18313
|
+
if (isBrowser) {
|
18314
|
+
// Test whether the document has already been loaded and initialize immediately if so
|
18315
|
+
if (document.readyState == "complete") {
|
18316
|
+
loadHandler();
|
18317
|
+
} else {
|
18318
|
+
if (isHostMethod(document, "addEventListener")) {
|
18319
|
+
document.addEventListener("DOMContentLoaded", loadHandler, false);
|
18320
|
+
}
|
18321
|
+
|
18322
|
+
// Add a fallback in case the DOMContentLoaded event isn't supported
|
18323
|
+
addListener(window, "load", loadHandler);
|
18324
|
+
}
|
18325
|
+
}
|
18326
|
+
|
18327
|
+
return api;
|
18277
18328
|
});
|
18278
18329
|
}(rangyCore));
|
18279
18330
|
|
18280
18331
|
var rangy = rangyCore.exports;
|
18281
18332
|
|
18282
|
-
/*
|
18283
|
-
import font_arial from './fonts/arial.png';
|
18284
|
-
import font_courier from './fonts/courier.png';
|
18285
|
-
import font_georgia from './fonts/georgia.png';
|
18286
|
-
import font_monospace from './fonts/monospace.png';
|
18287
|
-
import font_sans_serif from './fonts/sans_serif.png';
|
18288
|
-
import font_serif from './fonts/serif.png';
|
18289
|
-
import font_abel from './fonts/abel.png';
|
18290
|
-
import font_abril_fatface from './fonts/abril_fatface.png';
|
18291
|
-
import font_advent_pro from './fonts/advent_pro.png';
|
18292
|
-
import font_aladin from './fonts/aladin.png';
|
18293
|
-
import font_alegreya from './fonts/alegreya.png';
|
18294
|
-
import font_alegreya_sans_sc from './fonts/alegreya_sans_sc.png';
|
18295
|
-
import font_alegreya_sc from './fonts/alegreya_sc.png';
|
18296
|
-
import font_alice from './fonts/alice.png';
|
18297
|
-
import font_allerta_stencil from './fonts/allerta_stencil.png';
|
18298
|
-
import font_allura from './fonts/allura.png';
|
18299
|
-
import font_almendra_display from './fonts/almendra_display.png';
|
18300
|
-
import font_amatic_sc from './fonts/amatic_sc.png';
|
18301
|
-
import font_andika from './fonts/andika.png';
|
18302
|
-
import font_anonymous_pro from './fonts/anonymous_pro.png';
|
18303
|
-
import font_architects_daughter from './fonts/architects_daughter.png';
|
18304
|
-
import font_arimo from './fonts/arimo.png';
|
18305
|
-
import font_arsenal from './fonts/arsenal.png';
|
18306
|
-
import font_assistant from './fonts/assistant.png';
|
18307
|
-
import font_aubrey from './fonts/aubrey.png';
|
18308
|
-
import font_anton from './fonts/anton.png';
|
18309
|
-
import font_archivo_narrow from './fonts/archivo_narrow.png';
|
18310
|
-
import font_bad_script from './fonts/bad_script.png';
|
18311
|
-
import font_benchNine from './fonts/benchNine.png';
|
18312
|
-
import font_bevan from './fonts/bevan.png';
|
18313
|
-
import font_bigelow_rules from './fonts/bigelow_rules.png';
|
18314
|
-
import font_bilbo from './fonts/bilbo.png';
|
18315
|
-
import font_bonbon from './fonts/bonbon.png';
|
18316
|
-
import font_bowlby_one_sc from './fonts/bowlby_one_sc.png';
|
18317
|
-
import font_cabin_condensed from './fonts/cabin_condensed.png';
|
18318
|
-
import font_carrois_gothic_sc from './fonts/carrois_gothic_sc.png';
|
18319
|
-
import font_caveat from './fonts/caveat.png';
|
18320
|
-
import font_chewy from './fonts/chewy.png';
|
18321
|
-
import font_cinzel from './fonts/cinzel.png';
|
18322
|
-
import font_comfortaa from './fonts/comfortaa.png';
|
18323
|
-
import font_concert_one from './fonts/concert_one.png';
|
18324
|
-
import font_cormorant from './fonts/cormorant.png';
|
18325
|
-
import font_cormorant_garamond from './fonts/cormorant_garamond.png';
|
18326
|
-
import font_cormorant_infant from './fonts/cormorant_infant.png';
|
18327
|
-
import font_cormorant_sc from './fonts/cormorant_sc.png';
|
18328
|
-
import font_cormorant_unicase from './fonts/cormorant_unicase.png';
|
18329
|
-
import font_cousine from './fonts/cousine.png';
|
18330
|
-
import font_crafty_girls from './fonts/crafty_girls.png';
|
18331
|
-
import font_cuprum from './fonts/cuprum.png';
|
18332
|
-
import font_cutive_mono from './fonts/cutive_mono.png';
|
18333
|
-
import font_devonshire from './fonts/devonshire.png';
|
18334
|
-
import font_didact_gothic from './fonts/didact_gothic.png';
|
18335
|
-
import font_diplomata_sc from './fonts/diplomata_sc.png';
|
18336
|
-
import font_dosis from './fonts/dosis.png';
|
18337
|
-
import font_eb_garamond from './fonts/eb_garamond.png';
|
18338
|
-
import font_el_messiri from './fonts/el_messiri.png';
|
18339
|
-
import font_elsie from './fonts/elsie.png';
|
18340
|
-
import font_encode_sans from './fonts/encode_sans.png';
|
18341
|
-
import font_exo from './fonts/exo.png';
|
18342
|
-
import font_exo_2 from './fonts/exo_2.png';
|
18343
|
-
import font_felipa from './fonts/felipa.png';
|
18344
|
-
import font_fira_code from './fonts/fira_code.png';
|
18345
|
-
import font_fira_mono from './fonts/fira_mono.png';
|
18346
|
-
import font_fira_sans from './fonts/fira_sans.png';
|
18347
|
-
import font_fira_sans_condensed from './fonts/fira_sans_condensed.png';
|
18348
|
-
import font_fira_sans_extra_condensed from './fonts/fira_sans_extra_condensed.png';
|
18349
|
-
import font_fjalla_one from './fonts/fjalla_one.png';
|
18350
|
-
import font_forum from './fonts/forum.png';
|
18351
|
-
import font_frank_ruhl_libre from './fonts/frank_ruhl_libre.png';
|
18352
|
-
import font_fredericka_the_great from './fonts/fredericka_the_great.png';
|
18353
|
-
import font_gabriela from './fonts/gabriela.png';
|
18354
|
-
import font_gilda_display from './fonts/gilda_display.png';
|
18355
|
-
import font_give_you_glory from './fonts/give_you_glory.png';
|
18356
|
-
import font_gruppo from './fonts/gruppo.png';
|
18357
|
-
import font_handlee from './fonts/handlee.png';
|
18358
|
-
import font_happy_monkey from './fonts/happy_monkey.png';
|
18359
|
-
import font_hind from './fonts/hind.png';
|
18360
|
-
import font_ibm_plex_mono from './fonts/ibm_plex_mono.png';
|
18361
|
-
import font_ibm_plex_sans from './fonts/ibm_plex_sans.png';
|
18362
|
-
import font_ibm_plex_serif from './fonts/ibm_plex_serif.png';
|
18363
|
-
import font_iceland from './fonts/iceland.png';
|
18364
|
-
import font_inconsolata from './fonts/inconsolata.png';
|
18365
|
-
import font_josefin_sans from './fonts/josefin_sans.png';
|
18366
|
-
import font_istok_web from './fonts/istok_web.png';
|
18367
|
-
import font_julee from './fonts/julee.png';
|
18368
|
-
import font_julius_sans_one from './fonts/julius_sans_one.png';
|
18369
|
-
import font_junge from './fonts/junge.png';
|
18370
|
-
import font_jura from './fonts/jura.png';
|
18371
|
-
import font_just_me_again_down_here from './fonts/just_me_again_down_here.png';
|
18372
|
-
import font_kaushan_script from './fonts/kaushan_script.png';
|
18373
|
-
import font_kelly_slab from './fonts/kelly_slab.png';
|
18374
|
-
import font_kite_one from './fonts/kite_one.png';
|
18375
|
-
import font_kosugi from './fonts/kosugi.png';
|
18376
|
-
import font_kosugi_maru from './fonts/kosugi_maru.png';
|
18377
|
-
import font_kurale from './fonts/kurale.png';
|
18378
|
-
import font_lato from './fonts/lato.png';
|
18379
|
-
import font_ledger from './fonts/ledger.png';
|
18380
|
-
import font_lekton from './fonts/lekton.png';
|
18381
|
-
import font_life_savers from './fonts/life_savers.png';
|
18382
|
-
import font_literata from './fonts/literata.png';
|
18383
|
-
import font_lobster from './fonts/lobster.png';
|
18384
|
-
import font_lobster_two from './fonts/lobster_two.png';
|
18385
|
-
import font_londrina_shadow from './fonts/londrina_shadow.png';
|
18386
|
-
import font_lora from './fonts/lora.png';
|
18387
|
-
import font_lovers_quarrel from './fonts/lovers_quarrel.png';
|
18388
|
-
import font_m_plus_1p from './fonts/m_plus_1p.png';
|
18389
|
-
import font_m_plus_rounded_1c from './fonts/m_plus_rounded_1c.png';
|
18390
|
-
import font_macondo from './fonts/macondo.png';
|
18391
|
-
import font_marcellus_sc from './fonts/marcellus_sc.png';
|
18392
|
-
import font_marck_script from './fonts/marck_script.png';
|
18393
|
-
import font_martel from './fonts/martel.png';
|
18394
|
-
import font_maven_pro from './fonts/maven_pro.png';
|
18395
|
-
import font_merriweather from './fonts/merriweather.png';
|
18396
|
-
import font_merriweather_sans from './fonts/merriweather_sans.png';
|
18397
|
-
import font_mogra from './fonts/mogra.png';
|
18398
|
-
import font_monoton from './fonts/monoton.png';
|
18399
|
-
import font_montez from './fonts/montez.png';
|
18400
|
-
import font_montserrat from './fonts/montserrat.png';
|
18401
|
-
import font_montserrat_alternates from './fonts/montserrat_alternates.png';
|
18402
|
-
import font_montserrat_subrayada from './fonts/montserrat_subrayada.png';
|
18403
|
-
import font_neucha from './fonts/neucha.png';
|
18404
|
-
import font_neuton from './fonts/neuton.png';
|
18405
|
-
import font_nixie_one from './fonts/nixie_one.png';
|
18406
|
-
import font_nothing_you_could_do from './fonts/nothing_you_could_do.png';
|
18407
|
-
import font_noto_sans from './fonts/noto_sans.png';
|
18408
|
-
import font_noto_sans_sc from './fonts/noto_sans_sc.png';
|
18409
|
-
import font_noto_serif from './fonts/noto_serif.png';
|
18410
|
-
import font_noto_serif_tc from './fonts/noto_serif_tc.png';
|
18411
|
-
import font_nunito from './fonts/nunito.png';
|
18412
|
-
import font_old_standard_tt from './fonts/old_standard_tt.png';
|
18413
|
-
import font_open_sans from './fonts/open_sans.png';
|
18414
|
-
import font_open_sans_condensed from './fonts/open_sans_condensed.png';
|
18415
|
-
import font_oranienbaum from './fonts/oranienbaum.png';
|
18416
|
-
import font_oswald from './fonts/oswald.png';
|
18417
|
-
import font_oxygen from './fonts/oxygen.png';
|
18418
|
-
import font_pacifico from './fonts/pacifico.png';
|
18419
|
-
import font_pangolin from './fonts/pangolin.png';
|
18420
|
-
import font_passion_one from './fonts/passion_one.png';
|
18421
|
-
import font_pathway_gothic_one from './fonts/pathway_gothic_one.png';
|
18422
|
-
import font_pattaya from './fonts/pattaya.png';
|
18423
|
-
import font_petit_formal_script from './fonts/petit_formal_script.png';
|
18424
|
-
import font_philosopher from './fonts/philosopher.png';
|
18425
|
-
import font_play from './fonts/play.png';
|
18426
|
-
import font_playfair_display from './fonts/playfair_display.png';
|
18427
|
-
import font_playfair_display_sc from './fonts/playfair_display_sc.png';
|
18428
|
-
import font_podkova from './fonts/podkova.png';
|
18429
|
-
import font_poiret_one from './fonts/poiret_one.png';
|
18430
|
-
import font_pompiere from './fonts/pompiere.png';
|
18431
|
-
import font_poppins from './fonts/poppins.png';
|
18432
|
-
import font_prata from './fonts/prata.png';
|
18433
|
-
import font_press_start_2p from './fonts/press_start_2p.png';
|
18434
|
-
import font_prosto_one from './fonts/prosto_one.png';
|
18435
|
-
import font_pt_mono from './fonts/pt_mono.png';
|
18436
|
-
import font_pt_sans from './fonts/pt_sans.png';
|
18437
|
-
import font_pt_sans_caption from './fonts/pt_sans_caption.png';
|
18438
|
-
import font_pt_sans_narrow from './fonts/pt_sans_narrow.png';
|
18439
|
-
import font_pt_serif from './fonts/pt_serif.png';
|
18440
|
-
import font_pt_serif_caption from './fonts/pt_serif_caption.png';
|
18441
|
-
import font_quattrocento_sans from './fonts/quattrocento_sans.png';
|
18442
|
-
import font_quattrocento from './fonts/quattrocento.png';
|
18443
|
-
import font_quicksand from './fonts/quicksand.png';
|
18444
|
-
import font_qwigley from './fonts/qwigley.png';
|
18445
|
-
import font_raleway from './fonts/raleway.png';
|
18446
|
-
import font_raleway_dots from './fonts/raleway_dots.png';
|
18447
|
-
import font_redressed from './fonts/redressed.png';
|
18448
|
-
import font_ribeye_marrow from './fonts/ribeye_marrow.png';
|
18449
|
-
import font_righteous from './fonts/righteous.png';
|
18450
|
-
import font_roboto from './fonts/roboto.png';
|
18451
|
-
import font_roboto_condensed from './fonts/roboto_condensed.png';
|
18452
|
-
import font_roboto_mono from './fonts/roboto_mono.png';
|
18453
|
-
import font_roboto_slab from './fonts/roboto_slab.png';
|
18454
|
-
import font_rochester from './fonts/rochester.png';
|
18455
|
-
import font_rouge_script from './fonts/rouge_script.png';
|
18456
|
-
import font_rubik from './fonts/rubik.png';
|
18457
|
-
import font_rubik_mono_one from './fonts/rubik_mono_one.png';
|
18458
|
-
import font_ruslan_display from './fonts/ruslan_display.png';
|
18459
|
-
import font_russo_one from './fonts/russo_one.png';
|
18460
|
-
import font_sacramento from './fonts/sacramento.png';
|
18461
|
-
import font_sanchez from './fonts/sanchez.png';
|
18462
|
-
import font_satisfy from './fonts/satisfy.png';
|
18463
|
-
import font_sawarabi_gothic from './fonts/sawarabi_gothic.png';
|
18464
|
-
import font_scada from './fonts/scada.png';
|
18465
|
-
import font_seaweed_script from './fonts/seaweed_script.png';
|
18466
|
-
import font_seymour_one from './fonts/seymour_one.png';
|
18467
|
-
import font_shadows_into_light_two from './fonts/shadows_into_light_two.png';
|
18468
|
-
import font_six_caps from './fonts/six_caps.png';
|
18469
|
-
import font_snowburst_one from './fonts/snowburst_one.png';
|
18470
|
-
import font_source_code_pro from './fonts/source_code_pro.png';
|
18471
|
-
import font_source_sans_pro from './fonts/source_sans_pro.png';
|
18472
|
-
import font_special_elite from './fonts/special_elite.png';
|
18473
|
-
import font_spectral from './fonts/spectral.png';
|
18474
|
-
import font_spectral_sc from './fonts/spectral_sc.png';
|
18475
|
-
import font_squada_one from './fonts/squada_one.png';
|
18476
|
-
import font_stalinist_one from './fonts/stalinist_one.png';
|
18477
|
-
import font_stint_ultra_expanded from './fonts/stint_ultra_expanded.png';
|
18478
|
-
import font_syncopate from './fonts/syncopate.png';
|
18479
|
-
import font_tangerine from './fonts/tangerine.png';
|
18480
|
-
import font_tenor_sans from './fonts/tenor_sans.png';
|
18481
|
-
import font_tinos from './fonts/tinos.png';
|
18482
|
-
import font_ubuntu from './fonts/ubuntu.png';
|
18483
|
-
import font_ubuntu_condensed from './fonts/ubuntu_condensed.png';
|
18484
|
-
import font_ubuntu_mono from './fonts/ubuntu_mono.png';
|
18485
|
-
import font_underdog from './fonts/underdog.png';
|
18486
|
-
import font_unifrakturmaguntia from './fonts/unifrakturmaguntia.png';
|
18487
|
-
import font_vast_shadow from './fonts/vast_shadow.png';
|
18488
|
-
import font_viga from './fonts/viga.png';
|
18489
|
-
import font_vollkorn from './fonts/vollkorn.png';
|
18490
|
-
import font_vollkorn_sc from './fonts/vollkorn_sc.png';
|
18491
|
-
import font_voltaire from './fonts/voltaire.png';
|
18492
|
-
import font_wire_one from './fonts/wire_one.png';
|
18493
|
-
import font_yanone_kaffeesatz from './fonts/yanone_kaffeesatz.png';
|
18494
|
-
import font_yeseva_one from './fonts/yeseva_one.png';
|
18495
|
-
*/
|
18496
18333
|
class Util$1 {
|
18497
18334
|
constructor(builder) {
|
18498
18335
|
this.builder = builder;
|
@@ -18950,6 +18787,25 @@ class Util$1 {
|
|
18950
18787
|
});
|
18951
18788
|
}
|
18952
18789
|
|
18790
|
+
removeColClasses(cell) {
|
18791
|
+
cell.classList.remove('full');
|
18792
|
+
cell.classList.remove('two-third');
|
18793
|
+
cell.classList.remove('two-fourth');
|
18794
|
+
cell.classList.remove('two-fifth');
|
18795
|
+
cell.classList.remove('two-sixth');
|
18796
|
+
cell.classList.remove('half');
|
18797
|
+
cell.classList.remove('third');
|
18798
|
+
cell.classList.remove('fourth');
|
18799
|
+
cell.classList.remove('fifth');
|
18800
|
+
cell.classList.remove('sixth');
|
18801
|
+
cell.classList.remove('seventh');
|
18802
|
+
cell.classList.remove('eighth');
|
18803
|
+
cell.classList.remove('ninth');
|
18804
|
+
cell.classList.remove('tenth');
|
18805
|
+
cell.classList.remove('eleventh');
|
18806
|
+
cell.classList.remove('twelfth');
|
18807
|
+
}
|
18808
|
+
|
18953
18809
|
fixLayout(row) {
|
18954
18810
|
const dom = this.dom; // if(this.builder.opts.enableDragResize) {
|
18955
18811
|
// Array.from(row.children).map((item) => {
|
@@ -18992,6 +18848,25 @@ class Util$1 {
|
|
18992
18848
|
row.classList.remove('md-autofit');
|
18993
18849
|
}
|
18994
18850
|
|
18851
|
+
if (this.builder.useDefaultGrid) {
|
18852
|
+
const cols = dom.elementChildren(row);
|
18853
|
+
cols.forEach(col => {
|
18854
|
+
if (dom.hasClass(col, 'is-row-tool') || dom.hasClass(col, 'is-col-tool') || dom.hasClass(col, 'is-rowadd-tool') || dom.hasClass(col, 'is-row-overlay')) return;
|
18855
|
+
this.removeColClasses(col);
|
18856
|
+
}); // Refresh Module
|
18857
|
+
|
18858
|
+
Array.from(row.children).map(item => {
|
18859
|
+
if (item.classList.contains('is-row-tool')) return;
|
18860
|
+
if (item.classList.contains('is-rowadd-tool')) return;
|
18861
|
+
if (item.classList.contains('is-col-tool')) return;
|
18862
|
+
|
18863
|
+
if (item.getAttribute('data-module')) {
|
18864
|
+
this.refreshModuleLayout(item);
|
18865
|
+
}
|
18866
|
+
});
|
18867
|
+
return;
|
18868
|
+
}
|
18869
|
+
|
18995
18870
|
let num = 3; //is-row-tool, is-col-tool & is-rowadd-tool
|
18996
18871
|
|
18997
18872
|
if (row.querySelector('.is-row-overlay')) {
|
@@ -20233,6 +20108,7 @@ class Util$1 {
|
|
20233
20108
|
}
|
20234
20109
|
|
20235
20110
|
this.colTool = row.querySelector('.is-col-tool');
|
20111
|
+
if (!this.colTool) return; // when drag block as a new section
|
20236
20112
|
|
20237
20113
|
if (!col.parentNode) {
|
20238
20114
|
// when column has just been deleted
|
@@ -32098,7 +31974,7 @@ const renderQuickAdd = builder => {
|
|
32098
31974
|
if (elm) dom.addEventListener(elm, 'click', () => {
|
32099
31975
|
const mode = quickadd.getAttribute('data-mode');
|
32100
31976
|
let html = `<div>
|
32101
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 text-black leading-
|
31977
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 text-black leading-14 rounded border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Read More</a>
|
32102
31978
|
</div>`;
|
32103
31979
|
|
32104
31980
|
if (builder.opts.emailMode) {
|
@@ -32111,8 +31987,8 @@ const renderQuickAdd = builder => {
|
|
32111
31987
|
if (elm) dom.addEventListener(elm, 'click', () => {
|
32112
31988
|
const mode = quickadd.getAttribute('data-mode');
|
32113
31989
|
let html = `<div>
|
32114
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 text-black leading-
|
32115
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 border-current hover:border-current font-normal leading-
|
31990
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 text-black leading-14 rounded border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Read More</a>
|
31991
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 border-current hover:border-current font-normal leading-14 rounded tracking-wide">Get Started</a>
|
32116
31992
|
</div>`;
|
32117
31993
|
|
32118
31994
|
if (builder.opts.emailMode) {
|
@@ -32561,24 +32437,275 @@ class Grid {
|
|
32561
32437
|
});
|
32562
32438
|
}
|
32563
32439
|
|
32440
|
+
removeColClasses(cell) {
|
32441
|
+
cell.classList.remove('full');
|
32442
|
+
cell.classList.remove('two-third');
|
32443
|
+
cell.classList.remove('two-fourth');
|
32444
|
+
cell.classList.remove('two-fifth');
|
32445
|
+
cell.classList.remove('two-sixth');
|
32446
|
+
cell.classList.remove('half');
|
32447
|
+
cell.classList.remove('third');
|
32448
|
+
cell.classList.remove('fourth');
|
32449
|
+
cell.classList.remove('fifth');
|
32450
|
+
cell.classList.remove('sixth');
|
32451
|
+
cell.classList.remove('seventh');
|
32452
|
+
cell.classList.remove('eighth');
|
32453
|
+
cell.classList.remove('ninth');
|
32454
|
+
cell.classList.remove('tenth');
|
32455
|
+
cell.classList.remove('eleventh');
|
32456
|
+
cell.classList.remove('twelfth');
|
32457
|
+
}
|
32458
|
+
|
32459
|
+
getAllColumns(cell) {
|
32460
|
+
let arrCells = [];
|
32461
|
+
let dom = this.dom;
|
32462
|
+
const cols = dom.elementChildren(cell.parentNode);
|
32463
|
+
cols.forEach(col => {
|
32464
|
+
if (dom.hasClass(col, 'is-row-tool') || dom.hasClass(col, 'is-col-tool') || dom.hasClass(col, 'is-rowadd-tool') || dom.hasClass(col, 'is-row-overlay')) return;
|
32465
|
+
|
32466
|
+
if (cell !== col) {
|
32467
|
+
arrCells.push(col);
|
32468
|
+
}
|
32469
|
+
});
|
32470
|
+
const newArray = [cell].concat(arrCells);
|
32471
|
+
return newArray;
|
32472
|
+
}
|
32473
|
+
|
32474
|
+
getCellWidth(cell) {
|
32475
|
+
if (cell.classList.contains('two-third')) {
|
32476
|
+
return 66.666;
|
32477
|
+
}
|
32478
|
+
|
32479
|
+
if (cell.classList.contains('two-fourth')) {
|
32480
|
+
return 75;
|
32481
|
+
}
|
32482
|
+
|
32483
|
+
if (cell.classList.contains('two-fifth')) {
|
32484
|
+
return 80;
|
32485
|
+
}
|
32486
|
+
|
32487
|
+
if (cell.classList.contains('two-sixth')) {
|
32488
|
+
return 83.333;
|
32489
|
+
}
|
32490
|
+
|
32491
|
+
if (cell.classList.contains('half')) {
|
32492
|
+
return 50;
|
32493
|
+
}
|
32494
|
+
|
32495
|
+
if (cell.classList.contains('third')) {
|
32496
|
+
return 33.333;
|
32497
|
+
}
|
32498
|
+
|
32499
|
+
if (cell.classList.contains('fourth')) {
|
32500
|
+
return 25;
|
32501
|
+
}
|
32502
|
+
|
32503
|
+
if (cell.classList.contains('fifth')) {
|
32504
|
+
return 20;
|
32505
|
+
}
|
32506
|
+
|
32507
|
+
if (cell.classList.contains('sixth')) {
|
32508
|
+
return 16.666;
|
32509
|
+
}
|
32510
|
+
|
32511
|
+
if (cell.classList.contains('seventh')) {
|
32512
|
+
return 14.2857;
|
32513
|
+
}
|
32514
|
+
|
32515
|
+
if (cell.classList.contains('eighth')) {
|
32516
|
+
return 12.5;
|
32517
|
+
}
|
32518
|
+
|
32519
|
+
if (cell.classList.contains('ninth')) {
|
32520
|
+
return 11.111;
|
32521
|
+
}
|
32522
|
+
|
32523
|
+
if (cell.classList.contains('tenth')) {
|
32524
|
+
return 10;
|
32525
|
+
}
|
32526
|
+
|
32527
|
+
if (cell.classList.contains('eleventh')) {
|
32528
|
+
return 9.09;
|
32529
|
+
}
|
32530
|
+
|
32531
|
+
if (cell.classList.contains('twelfth')) {
|
32532
|
+
return 8.333;
|
32533
|
+
}
|
32534
|
+
|
32535
|
+
return false;
|
32536
|
+
}
|
32537
|
+
|
32538
|
+
resizeColumn(cell, increase, num) {
|
32539
|
+
let cellWidth = this.getCellWidth(cell);
|
32540
|
+
|
32541
|
+
if (!cellWidth) {
|
32542
|
+
let cellW = parseFloat(window.getComputedStyle(cell).getPropertyValue('width'));
|
32543
|
+
let rowW = parseFloat(window.getComputedStyle(cell.parentNode).getPropertyValue('width'));
|
32544
|
+
cellWidth = cellW / rowW * 100;
|
32545
|
+
}
|
32546
|
+
|
32547
|
+
if (increase) {
|
32548
|
+
if (num === 3) {
|
32549
|
+
if (cellWidth >= 28 && cellWidth <= 30) {
|
32550
|
+
return '33.333%';
|
32551
|
+
} else if (cellWidth > 30 && cellWidth < 38) {
|
32552
|
+
return '40%';
|
32553
|
+
} //max 80%
|
32554
|
+
|
32555
|
+
|
32556
|
+
if (cellWidth >= 68 && cellWidth <= 90) {
|
32557
|
+
return '75%';
|
32558
|
+
}
|
32559
|
+
}
|
32560
|
+
|
32561
|
+
if (num === 4) {
|
32562
|
+
//max 70%
|
32563
|
+
if (cellWidth >= 48 && cellWidth <= 90) {
|
32564
|
+
return '60%';
|
32565
|
+
}
|
32566
|
+
}
|
32567
|
+
|
32568
|
+
if (num === 5) {
|
32569
|
+
//max 50%
|
32570
|
+
if (cellWidth >= 38 && cellWidth <= 90) {
|
32571
|
+
return '50%';
|
32572
|
+
}
|
32573
|
+
}
|
32574
|
+
|
32575
|
+
if (num === 6) {
|
32576
|
+
if (cellWidth >= 10 && cellWidth < 13) {
|
32577
|
+
return '16.666%';
|
32578
|
+
} //max 40%
|
32579
|
+
|
32580
|
+
|
32581
|
+
if (cellWidth >= 28 && cellWidth <= 90) {
|
32582
|
+
return '40%';
|
32583
|
+
}
|
32584
|
+
}
|
32585
|
+
|
32586
|
+
if (num === 7) {
|
32587
|
+
//max 30%
|
32588
|
+
if (cellWidth >= 23 && cellWidth <= 90) {
|
32589
|
+
return '30%';
|
32590
|
+
}
|
32591
|
+
}
|
32592
|
+
|
32593
|
+
if (num === 8) {
|
32594
|
+
//max 20%
|
32595
|
+
if (cellWidth >= 13 && cellWidth <= 90) {
|
32596
|
+
return '20%';
|
32597
|
+
}
|
32598
|
+
}
|
32599
|
+
|
32600
|
+
if (cellWidth >= 78 && cellWidth <= 90) {
|
32601
|
+
return '90%';
|
32602
|
+
} else if (cellWidth >= 73 && cellWidth < 78) {
|
32603
|
+
return '80%';
|
32604
|
+
} else if (cellWidth >= 68 && cellWidth < 73) {
|
32605
|
+
return '75%';
|
32606
|
+
} else if (cellWidth >= 58 && cellWidth < 68) {
|
32607
|
+
return '70%';
|
32608
|
+
} else if (cellWidth >= 48 && cellWidth < 58) {
|
32609
|
+
return '60%';
|
32610
|
+
} else if (cellWidth >= 38 && cellWidth < 48) {
|
32611
|
+
return '50%';
|
32612
|
+
} else if (cellWidth >= 28 && cellWidth < 38) {
|
32613
|
+
return '40%';
|
32614
|
+
} else if (cellWidth >= 23 && cellWidth < 28) {
|
32615
|
+
return '30%';
|
32616
|
+
} else if (cellWidth >= 18 && cellWidth < 23) {
|
32617
|
+
return '25%';
|
32618
|
+
} else if (cellWidth >= 13 && cellWidth < 18) {
|
32619
|
+
return '20%';
|
32620
|
+
} else if (cellWidth >= 10 && cellWidth < 13) {
|
32621
|
+
return '15%';
|
32622
|
+
}
|
32623
|
+
} else {
|
32624
|
+
// decrease
|
32625
|
+
if (num === 3) {
|
32626
|
+
if (cellWidth > 35 && cellWidth <= 43) {
|
32627
|
+
return '33.333%';
|
32628
|
+
}
|
32629
|
+
|
32630
|
+
if (cellWidth > 33 && cellWidth <= 35) {
|
32631
|
+
return '30%';
|
32632
|
+
}
|
32633
|
+
}
|
32634
|
+
|
32635
|
+
if (num === 6) {
|
32636
|
+
if (cellWidth > 18 && cellWidth <= 23) {
|
32637
|
+
return '16.666%';
|
32638
|
+
}
|
32639
|
+
}
|
32640
|
+
|
32641
|
+
if (cellWidth > 93 && cellWidth <= 100) {
|
32642
|
+
return '90%';
|
32643
|
+
} else if (cellWidth > 83 && cellWidth <= 93) {
|
32644
|
+
return '80%';
|
32645
|
+
} else if (cellWidth > 78 && cellWidth <= 83) {
|
32646
|
+
return '75%';
|
32647
|
+
} else if (cellWidth > 73 && cellWidth <= 78) {
|
32648
|
+
return '70%';
|
32649
|
+
} else if (cellWidth > 63 && cellWidth <= 73) {
|
32650
|
+
return '60%';
|
32651
|
+
} else if (cellWidth > 53 && cellWidth <= 63) {
|
32652
|
+
return '50%';
|
32653
|
+
} else if (cellWidth > 43 && cellWidth <= 53) {
|
32654
|
+
return '40%';
|
32655
|
+
} else if (cellWidth > 33 && cellWidth <= 43) {
|
32656
|
+
return '30%';
|
32657
|
+
} else if (cellWidth > 28 && cellWidth <= 33) {
|
32658
|
+
return '25%';
|
32659
|
+
} else if (cellWidth > 23 && cellWidth <= 28) {
|
32660
|
+
return '20%';
|
32661
|
+
} else if (cellWidth > 18 && cellWidth <= 23) {
|
32662
|
+
return '15%';
|
32663
|
+
} else if (cellWidth >= 10 && cellWidth <= 18) {
|
32664
|
+
return '10%';
|
32665
|
+
}
|
32666
|
+
}
|
32667
|
+
|
32668
|
+
return false;
|
32669
|
+
}
|
32670
|
+
|
32564
32671
|
increaseColumn() {
|
32565
32672
|
let builder = this.builder;
|
32566
32673
|
let util = this.util;
|
32567
32674
|
let dom = this.dom;
|
32568
|
-
|
32675
|
+
let cell = util.cellSelected();
|
32569
32676
|
if (!cell) return;
|
32570
|
-
let cellnext = util.cellNext(cell);
|
32571
|
-
let cellnext2;
|
32572
32677
|
|
32573
|
-
if (
|
32574
|
-
|
32575
|
-
|
32576
|
-
|
32577
|
-
|
32578
|
-
|
32579
|
-
|
32678
|
+
if (this.builder.useDefaultGrid) {
|
32679
|
+
let arrColumns = this.getAllColumns(cell);
|
32680
|
+
|
32681
|
+
for (let i = 1; i < arrColumns.length; i++) {
|
32682
|
+
let cellNext = arrColumns[i]; // cellNext.style.width = '100%';
|
32683
|
+
|
32684
|
+
cellNext.style.width = '';
|
32685
|
+
cellNext.style.flex = '';
|
32686
|
+
this.removeColClasses(cellNext);
|
32687
|
+
}
|
32688
|
+
|
32689
|
+
if (arrColumns.length > 1 && arrColumns.length < 9) {
|
32690
|
+
this.builder.uo.saveForUndo();
|
32691
|
+
let w = this.resizeColumn(cell, true, arrColumns.length);
|
32692
|
+
|
32693
|
+
if (w) {
|
32694
|
+
cell.style.width = w;
|
32695
|
+
cell.style.flex = '0 0 auto';
|
32696
|
+
this.removeColClasses(cell);
|
32697
|
+
}
|
32698
|
+
|
32699
|
+
this.builder.opts.onChange();
|
32700
|
+
}
|
32701
|
+
|
32702
|
+
return;
|
32580
32703
|
}
|
32581
32704
|
|
32705
|
+
let cellnext, cellnext2;
|
32706
|
+
let arrColumns = this.getAllColumns(cell);
|
32707
|
+
if (arrColumns[1]) cellnext = arrColumns[1];
|
32708
|
+
if (arrColumns[2]) cellnext2 = arrColumns[2];
|
32582
32709
|
const rowClass = builder.opts.row;
|
32583
32710
|
let colClass = builder.opts.cols;
|
32584
32711
|
const colSizes = builder.opts.colsizes;
|
@@ -32739,18 +32866,38 @@ class Grid {
|
|
32739
32866
|
let dom = this.dom;
|
32740
32867
|
const cell = util.cellSelected();
|
32741
32868
|
if (!cell) return;
|
32742
|
-
let cellnext = util.cellNext(cell);
|
32743
|
-
let cellnext2;
|
32744
32869
|
|
32745
|
-
if (
|
32746
|
-
|
32747
|
-
|
32748
|
-
|
32749
|
-
|
32750
|
-
|
32751
|
-
|
32870
|
+
if (this.builder.useDefaultGrid) {
|
32871
|
+
let arrColumns = this.getAllColumns(cell);
|
32872
|
+
|
32873
|
+
for (let i = 1; i < arrColumns.length; i++) {
|
32874
|
+
let cellNext = arrColumns[i]; // cellNext.style.width = '100%';
|
32875
|
+
|
32876
|
+
cellNext.style.width = '';
|
32877
|
+
cellNext.style.flex = '';
|
32878
|
+
this.removeColClasses(cellNext);
|
32879
|
+
}
|
32880
|
+
|
32881
|
+
if (arrColumns.length > 1 && arrColumns.length < 9) {
|
32882
|
+
this.builder.uo.saveForUndo();
|
32883
|
+
let w = this.resizeColumn(cell, false, arrColumns.length);
|
32884
|
+
|
32885
|
+
if (w) {
|
32886
|
+
cell.style.width = w;
|
32887
|
+
cell.style.flex = '0 0 auto';
|
32888
|
+
this.removeColClasses(cell);
|
32889
|
+
}
|
32890
|
+
|
32891
|
+
this.builder.opts.onChange();
|
32892
|
+
}
|
32893
|
+
|
32894
|
+
return;
|
32752
32895
|
}
|
32753
32896
|
|
32897
|
+
let cellnext, cellnext2;
|
32898
|
+
let arrColumns = this.getAllColumns(cell);
|
32899
|
+
if (arrColumns[1]) cellnext = arrColumns[1];
|
32900
|
+
if (arrColumns[2]) cellnext2 = arrColumns[2];
|
32754
32901
|
const rowClass = builder.opts.row;
|
32755
32902
|
let colClass = builder.opts.cols;
|
32756
32903
|
const colSizes = builder.opts.colsizes;
|
@@ -36673,7 +36820,7 @@ const renderSnippetPanel = builder => {
|
|
36673
36820
|
|
36674
36821
|
for (let i = 0; i < builder.opts.emailSnippetCategories.length; i++) {
|
36675
36822
|
// catoptions += '<div role="button" tabindex="0" data-value="' + builder.opts.emailSnippetCategories[i][0] + '">' + builder.opts.emailSnippetCategories[i][1] + '</div>';
|
36676
|
-
catitems += '<li role="option" tabindex="0" data-value="' + builder.opts.emailSnippetCategories[i][0] + '">' + builder.opts.emailSnippetCategories[i][1] + '</li>';
|
36823
|
+
catitems += '<li role="option" tabindex="0" data-value="' + builder.opts.emailSnippetCategories[i][0] + '">' + util.out(builder.opts.emailSnippetCategories[i][1]) + '</li>';
|
36677
36824
|
if (builder.opts.emailSnippetCategories[i][0] === builder.opts.defaultEmailSnippetCategory) defaultcat = builder.opts.emailSnippetCategories[i][1];
|
36678
36825
|
}
|
36679
36826
|
} else {
|
@@ -36681,12 +36828,12 @@ const renderSnippetPanel = builder => {
|
|
36681
36828
|
|
36682
36829
|
for (let i = 0; i < builder.opts.snippetCategories.length; i++) {
|
36683
36830
|
// catoptions += '<div role="button" tabindex="0" data-value="' + builder.opts.snippetCategories[i][0] + '">' + builder.opts.snippetCategories[i][1] + '</div>';
|
36684
|
-
catitems += '<li role="option" tabindex="0" data-value="' + builder.opts.snippetCategories[i][0] + '">' + builder.opts.snippetCategories[i][1] + '</li>';
|
36831
|
+
catitems += '<li role="option" tabindex="0" data-value="' + builder.opts.snippetCategories[i][0] + '">' + util.out(builder.opts.snippetCategories[i][1]) + '</li>';
|
36685
36832
|
if (builder.opts.snippetCategories[i][0] === builder.opts.defaultSnippetCategory) defaultcat = builder.opts.snippetCategories[i][1];
|
36686
36833
|
}
|
36687
36834
|
}
|
36688
36835
|
|
36689
|
-
let html_snippets = '' + '<div class="is-dropdown selectsnippet" style="position:absolute;top:0;right:0;padding: 0;width:100%;z-index:2;">' + '<button tabindex="0" class="dropdown-toggle no-outline" title="' + util.out('Snippet Categories') + '" type="button" aria-haspopup="true" data-value="' + defaultcatval + '">' + '<span>' + defaultcat + '</span>' + '</button>' + '<ul class="dropdown-menu" role="listbox" title="' + util.out('Snippets') + '" aria-expanded="false">' + catitems + '</ul>' + '</div>' + (sidePanel === 'right' ? '<div id="divSnippetScrollUp" role="button" tabindex="-1" style="top:calc(50% - 27px);right:25px;">▲</div>' + '<div id="divSnippetScrollDown" role="button" tabindex="-1" style="top:calc(50% + 27px);right:25px;">▼</div>' + '<div id="divSnippetHandle" role="button" tabindex="-1" title="' + util.out('Snippets') + '" data-title="' + util.out('Snippets') + '" style="' + hideHandle + '">' + '<svg class="is-icon-flex"><use xlink:href="#ion-ios-arrow-left"></use></svg>' + '</div>' : '<div id="divSnippetScrollUp" role="button" tabindex="-1" style="top:calc(50% - 27px);left:10px;">▲</div>' + '<div id="divSnippetScrollDown" role="button" tabindex="-1" style="top:calc(50% + 27px);left:10px;">▼</div>' + '<div id="divSnippetHandle" role="button" tabindex="-1" title="' + util.out('Snippets') + '" data-title="' + util.out('Snippets') + '" style="' + hideHandle + '">' + '<svg class="is-icon-flex"><use xlink:href="#ion-ios-arrow-right"></use></svg>' + '</div>') + '<div class="is-design-list" tabindex="0">' + '</div>';
|
36836
|
+
let html_snippets = '' + '<div class="is-dropdown selectsnippet" style="position:absolute;top:0;right:0;padding: 0;width:100%;z-index:2;">' + '<button tabindex="0" class="dropdown-toggle no-outline" title="' + util.out('Snippet Categories') + '" type="button" aria-haspopup="true" data-value="' + defaultcatval + '">' + '<span>' + util.out(defaultcat) + '</span>' + '</button>' + '<ul class="dropdown-menu" role="listbox" title="' + util.out('Snippets') + '" aria-expanded="false">' + catitems + '</ul>' + '</div>' + (sidePanel === 'right' ? '<div id="divSnippetScrollUp" role="button" tabindex="-1" style="top:calc(50% - 27px);right:25px;">▲</div>' + '<div id="divSnippetScrollDown" role="button" tabindex="-1" style="top:calc(50% + 27px);right:25px;">▼</div>' + '<div id="divSnippetHandle" role="button" tabindex="-1" title="' + util.out('Snippets') + '" data-title="' + util.out('Snippets') + '" style="' + hideHandle + '">' + '<svg class="is-icon-flex"><use xlink:href="#ion-ios-arrow-left"></use></svg>' + '</div>' : '<div id="divSnippetScrollUp" role="button" tabindex="-1" style="top:calc(50% - 27px);left:10px;">▲</div>' + '<div id="divSnippetScrollDown" role="button" tabindex="-1" style="top:calc(50% + 27px);left:10px;">▼</div>' + '<div id="divSnippetHandle" role="button" tabindex="-1" title="' + util.out('Snippets') + '" data-title="' + util.out('Snippets') + '" style="' + hideHandle + '">' + '<svg class="is-icon-flex"><use xlink:href="#ion-ios-arrow-right"></use></svg>' + '</div>') + '<div class="is-design-list" tabindex="0">' + '</div>';
|
36690
36837
|
let snippetPanel = document.querySelector(builder.opts.snippetList);
|
36691
36838
|
dom.appendHtml(snippetPanel, html_snippets);
|
36692
36839
|
const dropDown = new Select(snippetPanel.querySelector('.selectsnippet'));
|
@@ -66905,89 +67052,89 @@ class ButtonEditor {
|
|
66905
67052
|
/* rounded */
|
66906
67053
|
{
|
66907
67054
|
html: `
|
66908
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-7 border-current hover:border-current font-normal leading-
|
67055
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-7 border-current hover:border-current font-normal leading-14 rounded-full tracking-wide">Read More</a>
|
66909
67056
|
`
|
66910
67057
|
}, {
|
66911
67058
|
html: `
|
66912
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-7 text-black leading-
|
67059
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-7 text-black leading-14 rounded-full border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Get Started</a>
|
66913
67060
|
`
|
66914
67061
|
}, {
|
66915
67062
|
html: `
|
66916
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-
|
67063
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-14 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(255, 127, 0);">Get Started</a>
|
66917
67064
|
`
|
66918
67065
|
}, {
|
66919
67066
|
html: `
|
66920
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-
|
67067
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-14 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(83,98,208);">Get Started</a>
|
66921
67068
|
`
|
66922
67069
|
}, {
|
66923
67070
|
html: `
|
66924
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-
|
67071
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-14 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Get Started</a>
|
66925
67072
|
`
|
66926
67073
|
}, {
|
66927
67074
|
html: `
|
66928
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-7 border-current hover:border-current font-normal leading-
|
67075
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-7 border-current hover:border-current font-normal leading-14 tracking-wide rounded-full" style="color: rgb(255, 255, 255);">Get Started</a>
|
66929
67076
|
`
|
66930
67077
|
},
|
66931
67078
|
/* colors */
|
66932
67079
|
{
|
66933
67080
|
html: `
|
66934
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-
|
67081
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-14 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(0, 200, 218);">Get Started</a>
|
66935
67082
|
`
|
66936
67083
|
}, {
|
66937
67084
|
html: `
|
66938
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-
|
67085
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-14 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(55, 148, 59);">Get Started</a>
|
66939
67086
|
`
|
66940
67087
|
}, {
|
66941
67088
|
html: `
|
66942
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-
|
67089
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-14 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(233,2,0);">Get Started</a>
|
66943
67090
|
`
|
66944
67091
|
}, {
|
66945
67092
|
html: `
|
66946
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-
|
67093
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-14 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(0, 0, 0); background-color: rgb(254, 222, 76);">Get Started</a>
|
66947
67094
|
`
|
66948
67095
|
},
|
66949
67096
|
/* square */
|
66950
67097
|
{
|
66951
67098
|
html: `
|
66952
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 border-current hover:border-current font-normal leading-
|
67099
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 border-current hover:border-current font-normal leading-14 rounded tracking-wide">Read More</a>
|
66953
67100
|
`
|
66954
67101
|
}, {
|
66955
67102
|
html: `
|
66956
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 text-black leading-
|
67103
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 text-black leading-14 rounded border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Get Started</a>
|
66957
67104
|
`
|
66958
67105
|
}, {
|
66959
67106
|
html: `
|
66960
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-
|
67107
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-14 border-transparent rounded size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(255, 127, 0);">Get Started</a>
|
66961
67108
|
`
|
66962
67109
|
}, {
|
66963
67110
|
html: `
|
66964
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-
|
67111
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-14 border-transparent rounded size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(83,98,208);">Get Started</a>
|
66965
67112
|
`
|
66966
67113
|
}, {
|
66967
67114
|
html: `
|
66968
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-
|
67115
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-14 border-transparent rounded size-17 tracking-wide hover:border-transparent" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Get Started</a>
|
66969
67116
|
`
|
66970
67117
|
}, {
|
66971
67118
|
html: `
|
66972
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 border-current hover:border-current font-normal leading-
|
67119
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 border-current hover:border-current font-normal leading-14 tracking-wide rounded" style="color: rgb(255, 255, 255);">Get Started</a>
|
66973
67120
|
`
|
66974
67121
|
},
|
66975
67122
|
/* colors */
|
66976
67123
|
{
|
66977
67124
|
html: `
|
66978
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-
|
67125
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-14 border-transparent rounded size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(0, 200, 218);">Get Started</a>
|
66979
67126
|
`
|
66980
67127
|
}, {
|
66981
67128
|
html: `
|
66982
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-
|
67129
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-14 border-transparent rounded size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(55, 148, 59);">Get Started</a>
|
66983
67130
|
`
|
66984
67131
|
}, {
|
66985
67132
|
html: `
|
66986
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-
|
67133
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-14 border-transparent rounded size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(233,2,0);">Get Started</a>
|
66987
67134
|
`
|
66988
67135
|
}, {
|
66989
67136
|
html: `
|
66990
|
-
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-
|
67137
|
+
<a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-14 border-transparent rounded ml-0 mt-1 size-17 tracking-wide hover:border-transparent" style="color: rgb(0, 0, 0); background-color: rgb(254, 222, 76);">Get Started</a>
|
66991
67138
|
`
|
66992
67139
|
},
|
66993
67140
|
/* MEDIUM */
|
@@ -73904,27 +74051,30 @@ class ColumnTool {
|
|
73904
74051
|
dom.addEventListener(elm, 'click', () => {
|
73905
74052
|
const cell = util.cellSelected();
|
73906
74053
|
if (!cell) return;
|
73907
|
-
const row = cell.parentNode;
|
74054
|
+
const row = cell.parentNode;
|
73908
74055
|
|
73909
|
-
|
73910
|
-
|
73911
|
-
|
73912
|
-
if (item.classList.contains('is-rowadd-tool')) return;
|
73913
|
-
if (item.classList.contains('is-col-tool')) return;
|
73914
|
-
if (item.style.width) needed = true;
|
73915
|
-
});
|
73916
|
-
|
73917
|
-
if (needed) {
|
74056
|
+
if (!this.builder.useDefaultGrid) {
|
74057
|
+
// Check if reset needed (reset will remove inline width, etc)
|
74058
|
+
let needed = false;
|
73918
74059
|
Array.from(row.children).map(item => {
|
73919
74060
|
if (item.classList.contains('is-row-tool')) return;
|
73920
74061
|
if (item.classList.contains('is-rowadd-tool')) return;
|
73921
74062
|
if (item.classList.contains('is-col-tool')) return;
|
73922
|
-
item.style.width =
|
73923
|
-
item.style.flex = '';
|
73924
|
-
item.style.height = '';
|
73925
|
-
item.style.minHeight = '';
|
74063
|
+
if (item.style.width) needed = true;
|
73926
74064
|
});
|
73927
|
-
|
74065
|
+
|
74066
|
+
if (needed) {
|
74067
|
+
Array.from(row.children).map(item => {
|
74068
|
+
if (item.classList.contains('is-row-tool')) return;
|
74069
|
+
if (item.classList.contains('is-rowadd-tool')) return;
|
74070
|
+
if (item.classList.contains('is-col-tool')) return;
|
74071
|
+
item.style.width = '';
|
74072
|
+
item.style.flex = '';
|
74073
|
+
item.style.height = '';
|
74074
|
+
item.style.minHeight = '';
|
74075
|
+
});
|
74076
|
+
util.fixLayout(row);
|
74077
|
+
}
|
73928
74078
|
}
|
73929
74079
|
|
73930
74080
|
this.grid.increaseColumn(); // Refresh Module
|
@@ -73944,27 +74094,30 @@ class ColumnTool {
|
|
73944
74094
|
dom.addEventListener(elm, 'click', () => {
|
73945
74095
|
const cell = util.cellSelected();
|
73946
74096
|
if (!cell) return;
|
73947
|
-
const row = cell.parentNode;
|
73948
|
-
|
73949
|
-
let needed = false;
|
73950
|
-
Array.from(row.children).map(item => {
|
73951
|
-
if (item.classList.contains('is-row-tool')) return;
|
73952
|
-
if (item.classList.contains('is-rowadd-tool')) return;
|
73953
|
-
if (item.classList.contains('is-col-tool')) return;
|
73954
|
-
if (item.style.width) needed = true;
|
73955
|
-
});
|
74097
|
+
const row = cell.parentNode;
|
73956
74098
|
|
73957
|
-
if (
|
74099
|
+
if (!this.builder.useDefaultGrid) {
|
74100
|
+
// Check if reset needed (reset will remove inline width, etc)
|
74101
|
+
let needed = false;
|
73958
74102
|
Array.from(row.children).map(item => {
|
73959
74103
|
if (item.classList.contains('is-row-tool')) return;
|
73960
74104
|
if (item.classList.contains('is-rowadd-tool')) return;
|
73961
74105
|
if (item.classList.contains('is-col-tool')) return;
|
73962
|
-
item.style.width =
|
73963
|
-
item.style.flex = '';
|
73964
|
-
item.style.height = '';
|
73965
|
-
item.style.minHeight = '';
|
74106
|
+
if (item.style.width) needed = true;
|
73966
74107
|
});
|
73967
|
-
|
74108
|
+
|
74109
|
+
if (needed) {
|
74110
|
+
Array.from(row.children).map(item => {
|
74111
|
+
if (item.classList.contains('is-row-tool')) return;
|
74112
|
+
if (item.classList.contains('is-rowadd-tool')) return;
|
74113
|
+
if (item.classList.contains('is-col-tool')) return;
|
74114
|
+
item.style.width = '';
|
74115
|
+
item.style.flex = '';
|
74116
|
+
item.style.height = '';
|
74117
|
+
item.style.minHeight = '';
|
74118
|
+
});
|
74119
|
+
util.fixLayout(row);
|
74120
|
+
}
|
73968
74121
|
}
|
73969
74122
|
|
73970
74123
|
this.grid.decreaseColumn(); // Refresh Module
|
@@ -83479,11 +83632,15 @@ class Rte {
|
|
83479
83632
|
|
83480
83633
|
for (j = 0; j < builder.opts.defaultFontSizes.length; j++) {
|
83481
83634
|
html_fontsizes += `<button title="${builder.opts.defaultFontSizes[j]}px" data-value="${builder.opts.defaultFontSizes[j]}">${builder.opts.defaultFontSizes[j]}</button>`;
|
83482
|
-
}
|
83635
|
+
}
|
83636
|
+
|
83637
|
+
let html_leading = '';
|
83638
|
+
this.builder.leadingPreset.forEach(val => {
|
83639
|
+
html_leading += `<button title="${val}" data-value="${val}">${val}</button>`;
|
83640
|
+
}); // <div class="is-draggable" style="width: 5px;height: 45pxpx;background:#fff;cursor: move;"></div>
|
83483
83641
|
// <div style="height:55px;background:#fff;border-top:#f5f5f5 1px solid;">
|
83484
83642
|
// </div>
|
83485
83643
|
|
83486
|
-
|
83487
83644
|
let html = `<div class="is-rte-tool" style="position:fixed;flex-direction:column;display:none;">
|
83488
83645
|
<div class="rte-for-text" style="display:flex">
|
83489
83646
|
${html_rte}
|
@@ -83529,12 +83686,13 @@ class Rte {
|
|
83529
83686
|
|
83530
83687
|
<div class="rte-paragraph-options is-rte-pop" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
|
83531
83688
|
<ul>
|
83532
|
-
<li title="${util.out('Heading 1')}" data-block="h1" tabindex="0"><h1>Heading 1</h1></li>
|
83533
|
-
<li title="${util.out('Heading 2')}" data-block="h2" tabindex="0"><h2>Heading 2</h2></li>
|
83534
|
-
<li title="${util.out('Heading 3')}" data-block="h3" tabindex="0"><h3>Heading 3</h3></li>
|
83535
|
-
<li title="${util.out('Heading 4')}" data-block="h4" tabindex="0"><h4>Heading 4</h4></li>
|
83536
|
-
<li title="${util.out('Paragraph')}" data-block="p" tabindex="0"><p>Paragraph</p></li>
|
83537
|
-
<li title="${util.out('
|
83689
|
+
<li style="height:58px" title="${util.out('Heading 1')}" data-block="h1" tabindex="0"><h1>Heading 1</h1></li>
|
83690
|
+
<li style="height:50px" title="${util.out('Heading 2')}" data-block="h2" tabindex="0"><h2>Heading 2</h2></li>
|
83691
|
+
<li style="height:45px" title="${util.out('Heading 3')}" data-block="h3" tabindex="0"><h3>Heading 3</h3></li>
|
83692
|
+
<li style="height:40px" title="${util.out('Heading 4')}" data-block="h4" tabindex="0"><h4>Heading 4</h4></li>
|
83693
|
+
<li style="height:28px" title="${util.out('Paragraph')}" data-block="p" tabindex="0"><p>Paragraph</p></li>
|
83694
|
+
<li style="height:28px" title="${util.out('DIV')}" data-block="div" tabindex="0"><p>div</p></li>
|
83695
|
+
<li style="height:28px" title="${util.out('Preformatted')}" data-block="pre" tabindex="0"><p style="font-family:courier, monospace;">Preformatted</p></li>
|
83538
83696
|
</ul>
|
83539
83697
|
</div>
|
83540
83698
|
|
@@ -83575,13 +83733,9 @@ class Rte {
|
|
83575
83733
|
</div>
|
83576
83734
|
<div class="is-label separator">${util.out('Line Spacing')}</div>
|
83577
83735
|
<div class="rte-lineheight-options" style="display: flex;flex-flow: wrap;">
|
83578
|
-
|
83579
|
-
|
83580
|
-
|
83581
|
-
<button title="1.6" data-value="1.6">1.6</button>
|
83582
|
-
<button title="1.8" data-value="1.8">1.8</button>
|
83583
|
-
<button title="2" data-value="2">2</button>
|
83584
|
-
<button title="2.2" data-value="2.2">2.2</button>
|
83736
|
+
|
83737
|
+
${html_leading}
|
83738
|
+
|
83585
83739
|
<button title="${util.out('Decrease')}" data-value="-" style="font-size:13px">-</button>
|
83586
83740
|
<button title="${util.out('Increase')}" data-value="+" style="font-size:13px">+</button>
|
83587
83741
|
<button title="${util.out('Clear')}" data-value=""><svg class="is-icon-flex" style="width:18px;height:18px;margin-top: 2px;"><use xlink:href="#ion-ios-close-empty"></use></svg></button>
|
@@ -83857,7 +84011,10 @@ class Rte {
|
|
83857
84011
|
}); // Custom Tags
|
83858
84012
|
|
83859
84013
|
const setTagValue = btn => {
|
83860
|
-
this.builder.uo.saveForUndo();
|
84014
|
+
this.builder.uo.saveForUndo(); //restore selection
|
84015
|
+
|
84016
|
+
util.restoreSelection(); //a must
|
84017
|
+
|
83861
84018
|
const tag = btn.getAttribute('data-value');
|
83862
84019
|
util.pasteHtmlAtCaret(tag, true);
|
83863
84020
|
this.util.hideRtePop(this.rteCustomTagOptions);
|
@@ -83908,6 +84065,8 @@ class Rte {
|
|
83908
84065
|
let btnRteTags = builderStuff.querySelectorAll('button.rte-tags');
|
83909
84066
|
btnRteTags.forEach(btn => {
|
83910
84067
|
btn.addEventListener('click', () => {
|
84068
|
+
//save selection
|
84069
|
+
util.saveSelection();
|
83911
84070
|
const pop = this.rteCustomTagOptions;
|
83912
84071
|
|
83913
84072
|
if (!dom.hasClass(pop, 'active')) {
|
@@ -84002,7 +84161,7 @@ class Rte {
|
|
84002
84161
|
}
|
84003
84162
|
|
84004
84163
|
if (!container) return;
|
84005
|
-
let element = container.closest('h1') || container.closest('h2') || container.closest('h3') || container.closest('h4') || container.closest('h5') || container.closest('h6') || container.closest('pre') || container.closest('p');
|
84164
|
+
let element = container.closest('h1') || container.closest('h2') || container.closest('h3') || container.closest('h4') || container.closest('h5') || container.closest('h6') || container.closest('pre') || container.closest('p') || container.closest('div');
|
84006
84165
|
|
84007
84166
|
if (element) {
|
84008
84167
|
// const tagName = element.tagName.toLowerCase();
|
@@ -84222,6 +84381,8 @@ class Rte {
|
|
84222
84381
|
let btnRteIcons = builderStuff.querySelectorAll('button.rte-icon');
|
84223
84382
|
btnRteIcons.forEach(btn => {
|
84224
84383
|
btn.addEventListener('click', e => {
|
84384
|
+
//save selection
|
84385
|
+
util.saveSelection();
|
84225
84386
|
this.openIcon(e);
|
84226
84387
|
});
|
84227
84388
|
}); // Color
|
@@ -85652,18 +85813,34 @@ class Rte {
|
|
85652
85813
|
}
|
85653
85814
|
}
|
85654
85815
|
} else {
|
85655
|
-
if (num === '
|
85816
|
+
if (num === '0.8') {
|
85817
|
+
newClassName = classes.leading_8;
|
85818
|
+
} else if (num === '0.9') {
|
85819
|
+
newClassName = classes.leading_9;
|
85820
|
+
} else if (num === '1') {
|
85656
85821
|
newClassName = classes.leading_10;
|
85822
|
+
} else if (num === '1.1') {
|
85823
|
+
newClassName = classes.leading_11;
|
85657
85824
|
} else if (num === '1.2') {
|
85658
85825
|
newClassName = classes.leading_12;
|
85826
|
+
} else if (num === '1.3') {
|
85827
|
+
newClassName = classes.leading_13;
|
85659
85828
|
} else if (num === '1.4') {
|
85660
85829
|
newClassName = classes.leading_14;
|
85830
|
+
} else if (num === '1.5') {
|
85831
|
+
newClassName = classes.leading_15;
|
85661
85832
|
} else if (num === '1.6') {
|
85662
85833
|
newClassName = classes.leading_16;
|
85834
|
+
} else if (num === '1.7') {
|
85835
|
+
newClassName = classes.leading_17;
|
85663
85836
|
} else if (num === '1.8') {
|
85664
85837
|
newClassName = classes.leading_18;
|
85838
|
+
} else if (num === '1.9') {
|
85839
|
+
newClassName = classes.leading_19;
|
85665
85840
|
} else if (num === '2') {
|
85666
85841
|
newClassName = classes.leading_20;
|
85842
|
+
} else if (num === '2.1') {
|
85843
|
+
newClassName = classes.leading_21;
|
85667
85844
|
} else if (num === '2.2') {
|
85668
85845
|
newClassName = classes.leading_22;
|
85669
85846
|
}
|
@@ -86826,7 +87003,7 @@ class Rte {
|
|
86826
87003
|
if (block === 'heading 4') block = 'h4';
|
86827
87004
|
if (block === 'formatted') block = 'pre';
|
86828
87005
|
|
86829
|
-
if (block === 'p' || block === 'h1' || block === 'h2' || block === 'h3' || block === 'h4' || block === 'pre') {
|
87006
|
+
if (block === 'p' || block === 'h1' || block === 'h2' || block === 'h3' || block === 'h4' || block === 'div' || block === 'pre') {
|
86830
87007
|
dom.addClass(this.rteParagraphOptions.querySelector('[data-block="' + block + '"]'), 'on');
|
86831
87008
|
}
|
86832
87009
|
}
|
@@ -86918,12 +87095,20 @@ class Rte {
|
|
86918
87095
|
Array.prototype.forEach.call(btns, btn => {
|
86919
87096
|
let num = btn.getAttribute('data-value');
|
86920
87097
|
let val;
|
87098
|
+
if (className === classes.leading_8) val = '0.8';
|
87099
|
+
if (className === classes.leading_9) val = '0.9';
|
86921
87100
|
if (className === classes.leading_10) val = '1';
|
87101
|
+
if (className === classes.leading_11) val = '1.1';
|
86922
87102
|
if (className === classes.leading_12) val = '1.2';
|
87103
|
+
if (className === classes.leading_13) val = '1.3';
|
86923
87104
|
if (className === classes.leading_14) val = '1.4';
|
87105
|
+
if (className === classes.leading_15) val = '1.5';
|
86924
87106
|
if (className === classes.leading_16) val = '1.6';
|
87107
|
+
if (className === classes.leading_17) val = '1.7';
|
86925
87108
|
if (className === classes.leading_18) val = '1.8';
|
87109
|
+
if (className === classes.leading_19) val = '1.9';
|
86926
87110
|
if (className === classes.leading_20) val = '2';
|
87111
|
+
if (className === classes.leading_21) val = '2.1';
|
86927
87112
|
if (className === classes.leading_22) val = '2.2';
|
86928
87113
|
|
86929
87114
|
if (num === val) {
|
@@ -92377,7 +92562,7 @@ class ContentBuilder {
|
|
92377
92562
|
// snippetSampleImage: 'uploads/office2.png', // if enabled, will be used to insert image block
|
92378
92563
|
// snippetSampleVideo: 'uploads/person1.mp4', // if enabled, will be used to insert video block
|
92379
92564
|
// snippetSampleAudio: 'uploads/intro.mp4', // if enabled, will be used to insert audio block
|
92380
|
-
snippetCategories: [[120, 'Basic'], [118, 'Article'], [101, 'Headline'], [119, 'Buttons'], [102, 'Photos'], [103, 'Profile'], [116, 'Contact'], [104, 'Products'], [105, 'Features'], [
|
92565
|
+
snippetCategories: [[120, 'Basic'], [118, 'Article'], [101, 'Headline'], [119, 'Buttons'], [102, 'Photos'], [103, 'Profile'], [116, 'Contact'], [104, 'Products, Services'], [105, 'Features'], [108, 'Skills'], [109, 'Achievements'], [106, 'Process'], [107, 'Pricing'], [110, 'Quotes'], [111, 'Partners'], [112, 'As Featured On'], [113, 'Page Not Found'], [114, 'Coming Soon'], [115, 'Help, FAQ']],
|
92381
92566
|
defaultSnippetCategory: 120,
|
92382
92567
|
snippetHandle: true,
|
92383
92568
|
sidePanel: 'right',
|
@@ -92532,11 +92717,11 @@ class ContentBuilder {
|
|
92532
92717
|
imageRenameOnEdit: true,
|
92533
92718
|
disableAutoEmbedVideo: false,
|
92534
92719
|
sectionTemplate: `
|
92535
|
-
<div class="is-section is-box is-section-100 type-
|
92720
|
+
<div class="is-section is-box is-section-100 type-opensans">
|
92536
92721
|
<div class="is-overlay"></div>
|
92537
92722
|
<div class="is-boxes">
|
92538
92723
|
<div class="is-box-centered">
|
92539
|
-
<div class="is-container is-content-
|
92724
|
+
<div class="is-container is-content-1100 v2 size-17 leading-13">
|
92540
92725
|
[%CONTENT%]
|
92541
92726
|
</div>
|
92542
92727
|
</div>
|
@@ -92607,7 +92792,10 @@ class ContentBuilder {
|
|
92607
92792
|
],
|
92608
92793
|
*/
|
92609
92794
|
colHeight: [300, 350, 400, 450, 500, 550, 600, 650, 700],
|
92610
|
-
|
92795
|
+
maxColumns: 6,
|
92796
|
+
// leadingPreset: [0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 2],
|
92797
|
+
// leadingPreset: [1, 1.1, 1.2, 1.3, 1.4, 1.6, 2],
|
92798
|
+
leadingPreset: [1, 1.2, 1.4, 1.6, 1.8, 2, 2.2],
|
92611
92799
|
cssClasses: {
|
92612
92800
|
fontWeight: {
|
92613
92801
|
thin: 'font-thin',
|
@@ -93024,10 +93212,12 @@ class ContentBuilder {
|
|
93024
93212
|
// If framework param is not used
|
93025
93213
|
if (this.opts.row !== '' && this.opts.cols.length > 0) ; else {
|
93026
93214
|
if (this.opts.cellFormat === '' && this.opts.rowFormat === '') {
|
93215
|
+
this.useDefaultGrid = true; // used in columntool.js, grid.js & util.js
|
93027
93216
|
// DEFAULT: Built-in simple css grid
|
93217
|
+
|
93028
93218
|
this.opts.row = 'row'; //row clrfx
|
93029
93219
|
|
93030
|
-
this.opts.cols = ['column twelfth', 'column eleventh', 'column tenth', 'column ninth', 'column eighth', 'column seventh', 'column sixth', 'column fifth', 'column fourth', 'column third', 'column half', 'column two-third', 'column two-fourth', 'column two-fifth', 'column two-sixth', 'column
|
93220
|
+
this.opts.cols = ['column twelfth', 'column eleventh', 'column tenth', 'column ninth', 'column eighth', 'column seventh', 'column sixth', 'column fifth', 'column fourth', 'column third', 'column half', 'column two-third', 'column two-fourth', 'column two-fifth', 'column two-sixth', 'column'];
|
93031
93221
|
this.opts.colequal = [['column twelfth', 'column twelfth', 'column twelfth', 'column twelfth', 'column twelfth', 'column twelfth', 'column twelfth', 'column twelfth', 'column twelfth', 'column twelfth', 'column twelfth', 'column twelfth'], ['column eleventh', 'column eleventh', 'column eleventh', 'column eleventh', 'column eleventh', 'column eleventh', 'column eleventh', 'column eleventh', 'column eleventh', 'column eleventh', 'column eleventh'], ['column tenth', 'column tenth', 'column tenth', 'column tenth', 'column tenth', 'column tenth', 'column tenth', 'column tenth', 'column tenth', 'column tenth'], ['column ninth', 'column ninth', 'column ninth', 'column ninth', 'column ninth', 'column ninth', 'column ninth', 'column ninth', 'column ninth'], ['column eighth', 'column eighth', 'column eighth', 'column eighth', 'column eighth', 'column eighth', 'column eighth', 'column eighth'], ['column seventh', 'column seventh', 'column seventh', 'column seventh', 'column seventh', 'column seventh', 'column seventh'], ['column sixth', 'column sixth', 'column sixth', 'column sixth', 'column sixth', 'column sixth'], ['column fifth', 'column fifth', 'column fifth', 'column fifth', 'column fifth'], ['column fourth', 'column fourth', 'column fourth', 'column fourth'], ['column third', 'column third', 'column third'], ['column half', 'column half']];
|
93032
93222
|
this.opts.colsizes = [//needed for columns in which the size increment is not constant.
|
93033
93223
|
[//increment for 3 columns
|
@@ -94882,6 +95072,14 @@ class ContentBuilder {
|
|
94882
95072
|
return area;
|
94883
95073
|
}
|
94884
95074
|
|
95075
|
+
saveSelection() {
|
95076
|
+
this.util.saveSelection();
|
95077
|
+
}
|
95078
|
+
|
95079
|
+
restoreSelection() {
|
95080
|
+
this.util.restoreSelection();
|
95081
|
+
}
|
95082
|
+
|
94885
95083
|
pasteHtmlAtCaret(html, selectPastedContent) {
|
94886
95084
|
this.util.pasteHtmlAtCaret(html, selectPastedContent);
|
94887
95085
|
}
|
@@ -105060,7 +105258,7 @@ class ContentBox {
|
|
105060
105258
|
}, {
|
105061
105259
|
id: 1,
|
105062
105260
|
designId: 2,
|
105063
|
-
name: '
|
105261
|
+
name: 'Hero'
|
105064
105262
|
}, {
|
105065
105263
|
id: 2,
|
105066
105264
|
designId: 2,
|
@@ -105068,7 +105266,7 @@ class ContentBox {
|
|
105068
105266
|
}, {
|
105069
105267
|
id: 3,
|
105070
105268
|
designId: 2,
|
105071
|
-
name: '
|
105269
|
+
name: 'Showcase'
|
105072
105270
|
}],
|
105073
105271
|
defaultCategory: {
|
105074
105272
|
id: 1,
|
@@ -105229,11 +105427,11 @@ class ContentBox {
|
|
105229
105427
|
livePreviewAlwaysReload: false,
|
105230
105428
|
livePreviewReloadEvery: 30,
|
105231
105429
|
sectionTemplate: `
|
105232
|
-
<div class="is-section is-box is-section-100 type-
|
105430
|
+
<div class="is-section is-box is-section-100 box-autofit type-opensans">
|
105233
105431
|
<div class="is-overlay"></div>
|
105234
105432
|
<div class="is-boxes">
|
105235
105433
|
<div class="is-box-centered">
|
105236
|
-
<div class="is-container is-content-
|
105434
|
+
<div class="is-container is-content-1000 v2 size-18 leading-14">
|
105237
105435
|
[%CONTENT%]
|
105238
105436
|
</div>
|
105239
105437
|
</div>
|
@@ -109006,6 +109204,33 @@ class ContentBox {
|
|
109006
109204
|
e.stopImmediatePropagation();
|
109007
109205
|
});
|
109008
109206
|
*/
|
109207
|
+
// Make box selectable when there is an iframe (eg. map) => use div.ovl
|
109208
|
+
|
109209
|
+
const boxOverlay = box.querySelector('.is-overlay-content');
|
109210
|
+
|
109211
|
+
if (boxOverlay) {
|
109212
|
+
let divs = boxOverlay.querySelectorAll('iframe');
|
109213
|
+
Array.prototype.forEach.call(divs, div => {
|
109214
|
+
let overlay = div.querySelector('.ovl');
|
109215
|
+
|
109216
|
+
if (!overlay) {
|
109217
|
+
boxOverlay.insertAdjacentHTML('beforeend', '<div class="ovl" style="position:absolute;background:#fff;opacity:0.01;cursor:pointer;top:0;left:0px;width:100%;height:100%;z-index:1"></div>');
|
109218
|
+
overlay = boxOverlay.querySelector('.ovl');
|
109219
|
+
overlay.addEventListener('click', () => {
|
109220
|
+
// show iframe overlay to make it clickable => for others
|
109221
|
+
let ovls = document.querySelectorAll('.ovl');
|
109222
|
+
Array.prototype.forEach.call(ovls, ovl => {
|
109223
|
+
ovl.style.display = 'block';
|
109224
|
+
});
|
109225
|
+
setTimeout(() => {
|
109226
|
+
overlay.style.display = 'none'; // use timeout because ContentBuilder will set the display=block (util.js 1450)
|
109227
|
+
|
109228
|
+
boxOverlay.parentNode.style.zIndex = 1; // because .is-overlay is set -1 if box is selected
|
109229
|
+
}, 200);
|
109230
|
+
});
|
109231
|
+
}
|
109232
|
+
});
|
109233
|
+
}
|
109009
109234
|
|
109010
109235
|
box.addEventListener('mouseenter', () => {
|
109011
109236
|
this.positionTool(box);
|