@innovastudio/contentbuilder 1.1.12 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/license.txt +79 -79
- package/package.json +1 -1
- package/public/contentbuilder/config.js +6 -6
- package/public/contentbuilder/contentbuilder.esm.js +31 -3
- package/public/contentbuilder/contentbuilder.min.js +1 -1
- package/public/contentbuilder/lang/en.js +337 -337
- package/public/contentbuilder/lang/fr.js +337 -337
- package/public/contentbuilder/plugins/buttoneditor/plugin.js +1600 -1600
- package/public/contentbuilder/plugins/buttoneditor/readme.txt +6 -6
- package/public/contentbuilder/plugins/helloworld/plugin.js +15 -15
- package/public/contentbuilder/plugins/helloworld/readme.txt +23 -23
- package/public/contentbuilder/plugins/preview/plugin.js +339 -339
- package/public/contentbuilder/plugins/preview/readme.txt +23 -23
- package/public/contentbuilder/plugins/searchreplace/plugin.js +459 -459
- package/public/contentbuilder/plugins/searchreplace/readme.txt +23 -23
- package/public/contentbuilder/plugins/searchreplace/searchreplace.html +264 -264
- package/public/contentbuilder/plugins/showgrid/plugin.js +74 -74
- package/public/contentbuilder/plugins/showgrid/readme.txt +23 -23
- package/public/contentbuilder/plugins/symbols/plugin.js +2876 -2876
- package/public/contentbuilder/plugins/symbols/readme.txt +23 -23
- package/public/contentbuilder/plugins/wordcount/plugin.js +76 -76
- package/public/contentbuilder/plugins/wordcount/readme.txt +23 -23
- package/readme.txt +25 -25
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Show Grid Plugin
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
(function () {
|
|
6
|
-
if(typeof _cb === 'undefined') return;
|
|
7
|
-
|
|
8
|
-
var icon_html = '<svg width="0" height="0" style="position:absolute;display:none;">' +
|
|
9
|
-
'<defs>' +
|
|
10
|
-
'<symbol viewBox="0 0 512 512" id="ion-ios-grid-view-outline"><path d="M448 192v-16H336V64h-16v112H192V64h-16v112H64v16h112v128H64v16h112v112h16V336h128v112h16V336h112v-16H336V192h112zM320 320H192V192h128v128z"></path></symbol>' +
|
|
11
|
-
'</defs>' +
|
|
12
|
-
'</svg>';
|
|
13
|
-
|
|
14
|
-
_cb.addHtml(icon_html);
|
|
15
|
-
|
|
16
|
-
var css = '<style>' +
|
|
17
|
-
'.container.showgrid > div > div {outline: 1px solid rgba(132, 132, 132, 0.27); outline-offset: 1px;}' +
|
|
18
|
-
'</style>';
|
|
19
|
-
|
|
20
|
-
_cb.addCss(css);
|
|
21
|
-
|
|
22
|
-
var button_html = '<button id="btnShowGrid" title="Grid Outline">' +
|
|
23
|
-
'<svg class="is-icon-flex" style="fill:rgba(0, 0, 0, 0.7);width:14px;height:14px;"><use xlink:href="#ion-ios-grid-view-outline"></use></svg>' +
|
|
24
|
-
'</button>';
|
|
25
|
-
|
|
26
|
-
_cb.addButton('showgrid', button_html, '#btnShowGrid', function () {
|
|
27
|
-
|
|
28
|
-
showGrid();
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
_cb.addButton2('showgrid', button_html, '#btnShowGrid', function () {
|
|
33
|
-
|
|
34
|
-
showGrid();
|
|
35
|
-
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
function showGrid() {
|
|
39
|
-
|
|
40
|
-
// Get all editable areas
|
|
41
|
-
const areas = document.querySelectorAll('.container');
|
|
42
|
-
Array.prototype.forEach.call(areas, function(area){
|
|
43
|
-
|
|
44
|
-
if(hasClass(area,'showgrid')){
|
|
45
|
-
removeClass(area, 'showgrid');
|
|
46
|
-
} else {
|
|
47
|
-
addClass(area, 'showgrid');
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function addClass(element, classname) {
|
|
53
|
-
if(!element) return;
|
|
54
|
-
if(hasClass(element,classname)) return;
|
|
55
|
-
if(element.classList.length===0) element.className = classname;
|
|
56
|
-
else element.className = element.className + ' ' + classname;
|
|
57
|
-
element.className = element.className.replace(/ +/g, ' ');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function removeClass(element, classname) {
|
|
61
|
-
if(!element) return;
|
|
62
|
-
if(element.classList.length>0) {
|
|
63
|
-
element.className = element.className.replace(new RegExp('\\b'+ classname+'\\b', 'g'), '');
|
|
64
|
-
element.className = element.className.replace(/ +/g, ' ');
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function hasClass(element, classname) {
|
|
69
|
-
if(!element) return false;
|
|
70
|
-
return element.classList ? element.classList.contains(classname) : new RegExp('\\b'+ classname+'\\b').test(element.className);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
})();
|
|
74
|
-
|
|
1
|
+
/*
|
|
2
|
+
Show Grid Plugin
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
(function () {
|
|
6
|
+
if(typeof _cb === 'undefined') return;
|
|
7
|
+
|
|
8
|
+
var icon_html = '<svg width="0" height="0" style="position:absolute;display:none;">' +
|
|
9
|
+
'<defs>' +
|
|
10
|
+
'<symbol viewBox="0 0 512 512" id="ion-ios-grid-view-outline"><path d="M448 192v-16H336V64h-16v112H192V64h-16v112H64v16h112v128H64v16h112v112h16V336h128v112h16V336h112v-16H336V192h112zM320 320H192V192h128v128z"></path></symbol>' +
|
|
11
|
+
'</defs>' +
|
|
12
|
+
'</svg>';
|
|
13
|
+
|
|
14
|
+
_cb.addHtml(icon_html);
|
|
15
|
+
|
|
16
|
+
var css = '<style>' +
|
|
17
|
+
'.container.showgrid > div > div {outline: 1px solid rgba(132, 132, 132, 0.27); outline-offset: 1px;}' +
|
|
18
|
+
'</style>';
|
|
19
|
+
|
|
20
|
+
_cb.addCss(css);
|
|
21
|
+
|
|
22
|
+
var button_html = '<button id="btnShowGrid" title="Grid Outline">' +
|
|
23
|
+
'<svg class="is-icon-flex" style="fill:rgba(0, 0, 0, 0.7);width:14px;height:14px;"><use xlink:href="#ion-ios-grid-view-outline"></use></svg>' +
|
|
24
|
+
'</button>';
|
|
25
|
+
|
|
26
|
+
_cb.addButton('showgrid', button_html, '#btnShowGrid', function () {
|
|
27
|
+
|
|
28
|
+
showGrid();
|
|
29
|
+
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
_cb.addButton2('showgrid', button_html, '#btnShowGrid', function () {
|
|
33
|
+
|
|
34
|
+
showGrid();
|
|
35
|
+
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
function showGrid() {
|
|
39
|
+
|
|
40
|
+
// Get all editable areas
|
|
41
|
+
const areas = document.querySelectorAll('.container');
|
|
42
|
+
Array.prototype.forEach.call(areas, function(area){
|
|
43
|
+
|
|
44
|
+
if(hasClass(area,'showgrid')){
|
|
45
|
+
removeClass(area, 'showgrid');
|
|
46
|
+
} else {
|
|
47
|
+
addClass(area, 'showgrid');
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function addClass(element, classname) {
|
|
53
|
+
if(!element) return;
|
|
54
|
+
if(hasClass(element,classname)) return;
|
|
55
|
+
if(element.classList.length===0) element.className = classname;
|
|
56
|
+
else element.className = element.className + ' ' + classname;
|
|
57
|
+
element.className = element.className.replace(/ +/g, ' ');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function removeClass(element, classname) {
|
|
61
|
+
if(!element) return;
|
|
62
|
+
if(element.classList.length>0) {
|
|
63
|
+
element.className = element.className.replace(new RegExp('\\b'+ classname+'\\b', 'g'), '');
|
|
64
|
+
element.className = element.className.replace(/ +/g, ' ');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function hasClass(element, classname) {
|
|
69
|
+
if(!element) return false;
|
|
70
|
+
return element.classList ? element.classList.contains(classname) : new RegExp('\\b'+ classname+'\\b').test(element.className);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
})();
|
|
74
|
+
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
Show Grid Plugin
|
|
2
|
-
|
|
3
|
-
To install the plugin, modify config file (contentbuilder\config.js) as follow:
|
|
4
|
-
|
|
5
|
-
_cb.settings.plugins = ['showgrid'];
|
|
6
|
-
|
|
7
|
-
This plugin will add a 'show grid outline' button on the 'More' popup on toolbar (click the 'More' button).
|
|
8
|
-
|
|
9
|
-
You can also add the "showgrid" button on the buttons or buttonsMore parameters:
|
|
10
|
-
|
|
11
|
-
var obj = $.contentbuilder({
|
|
12
|
-
...
|
|
13
|
-
buttons: [..., "showgrid", ...]
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
or
|
|
17
|
-
|
|
18
|
-
var obj = $.contentbuilder({
|
|
19
|
-
...
|
|
20
|
-
buttonsMore: [..., "showgrid", ...]
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
For more info about buttons or buttonsMore parameters, please check the ContentBuilder.js readme.txt.
|
|
1
|
+
Show Grid Plugin
|
|
2
|
+
|
|
3
|
+
To install the plugin, modify config file (contentbuilder\config.js) as follow:
|
|
4
|
+
|
|
5
|
+
_cb.settings.plugins = ['showgrid'];
|
|
6
|
+
|
|
7
|
+
This plugin will add a 'show grid outline' button on the 'More' popup on toolbar (click the 'More' button).
|
|
8
|
+
|
|
9
|
+
You can also add the "showgrid" button on the buttons or buttonsMore parameters:
|
|
10
|
+
|
|
11
|
+
var obj = $.contentbuilder({
|
|
12
|
+
...
|
|
13
|
+
buttons: [..., "showgrid", ...]
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
or
|
|
17
|
+
|
|
18
|
+
var obj = $.contentbuilder({
|
|
19
|
+
...
|
|
20
|
+
buttonsMore: [..., "showgrid", ...]
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
For more info about buttons or buttonsMore parameters, please check the ContentBuilder.js readme.txt.
|