j1-template 2021.3.1 → 2021.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/data/menu.html +55 -55
- data/assets/data/mmenu.html +53 -53
- data/assets/data/quicklinks.html +3 -3
- data/assets/themes/j1/adapter/js/j1.js +1 -1
- data/assets/themes/j1/core/css/animate.min.css +1 -1
- data/assets/themes/j1/core/css/icon-fonts/fontawesome.min.css +1 -1
- data/assets/themes/j1/core/css/icon-fonts/materialdesign-light.min.css +1 -1
- data/assets/themes/j1/core/css/icon-fonts/materialdesign.min.css +1 -1
- data/assets/themes/j1/core/css/icon-fonts/twemoji.min.css +1 -1
- data/assets/themes/j1/core/css/themes/bootstrap/bootstrap.min.css +1 -1
- data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.min.css +1 -1
- data/assets/themes/j1/core/css/themes/uno-light/bootstrap.min.css +23 -1
- data/assets/themes/j1/core/css/vendor.min.css +1 -1
- data/assets/themes/j1/core/js/template.js +8163 -10392
- data/assets/themes/j1/core/js/template.min.js +20 -30
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/backstretch/js/backstretch.min.js +1 -1
- data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.full.js +1 -1
- data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.js +1 -1
- data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.min.js +1 -1
- data/assets/themes/j1/modules/datatables/js/datatables.js +1 -1
- data/assets/themes/j1/modules/datatables/js/datatables.min.js +5 -5
- data/assets/themes/j1/modules/iframeResizer/examples/frame.absolute.html +3 -3
- data/assets/themes/j1/modules/iframeResizer/examples/frame.content.html +6 -6
- data/assets/themes/j1/modules/iframeResizer/examples/frame.tolerance.html +2 -2
- data/assets/themes/j1/modules/iframeResizer/js/client/iframeResizer.contentWindow.js +1 -1
- data/assets/themes/j1/modules/iframeResizer/js/client/iframeResizer.contentWindow.min.js +1 -1
- data/assets/themes/j1/modules/iframeResizer/js/resizer.min.js +1 -1
- data/assets/themes/j1/modules/jquery/js/jquery.js +2 -2
- data/assets/themes/j1/modules/jquery/js/jquery.min.js +1 -1
- data/assets/themes/j1/modules/jquery/js/jqueryUI.js +7 -7
- data/assets/themes/j1/modules/jquery/js/jqueryUI.min.js +3 -3
- data/assets/themes/j1/modules/lightGallery/js/core/j1/lightgallery-x.min.js +1 -1
- data/assets/themes/j1/modules/lightGallery/js/core/lightgallery.min.js +1 -1
- data/assets/themes/j1/modules/lightGallery/js/modules/j1/j1-video.min.js +1 -1
- data/assets/themes/j1/modules/lightGallery/js/modules/j1/j1-x-video.min.js +1 -1
- data/assets/themes/j1/modules/lightbox/js/lightbox.js +1 -1
- data/assets/themes/j1/modules/lightbox/js/lightbox.min.js +1 -1
- data/assets/themes/j1/modules/lunrSearch/js/mustache.js +1 -1
- data/assets/themes/j1/modules/lunrSearch/js/mustache.min.js +1 -1
- data/assets/themes/j1/modules/lunrSearch/js/uri.js +1 -1
- data/assets/themes/j1/modules/lunrSearch/js/uri.min.js +7 -7
- data/assets/themes/j1/modules/mdiPreviewer/js/previewer.min.js +1 -1
- data/assets/themes/j1/modules/mdilPreviewer/js/previewer.min.js +1 -1
- data/assets/themes/j1/modules/scroller/js/scroller.js +2 -2
- data/assets/themes/j1/modules/scroller/js/scroller.min.js +1 -1
- data/assets/themes/j1/modules/themeSwitcher/js/switcher.js +8 -8
- data/assets/themes/j1/modules/themeSwitcher/js/switcher.min.js +1 -431
- data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.js +1 -1
- data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.min.js +1 -1
- data/assets/themes/j1/modules/videojs/js/video.min.js +2 -2
- data/lib/j1/version.rb +3 -3
- data/lib/starter_web/Gemfile +2 -2
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_data/{private.default.yml → _defaults/private.yml} +2 -0
- data/lib/starter_web/_data/private.yml +3 -1
- data/lib/starter_web/_includes/attributes.asciidoc +1 -1
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/package.json +4 -10
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +2 -1
- metadata +3 -5
- data/lib/starter_web/_data/_defaults/j1_config.1.yml +0 -478
- data/lib/starter_web/_data/_defaults/private.default.yml +0 -119
@@ -43,7 +43,7 @@
|
|
43
43
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
44
44
|
*/
|
45
45
|
|
46
|
-
(function ($, window, document, undefined) {
|
46
|
+
;(function ($, window, document, undefined) {
|
47
47
|
|
48
48
|
var old = $.fn.bootstrapThemeSwitcher;
|
49
49
|
|
@@ -133,9 +133,9 @@
|
|
133
133
|
} else {
|
134
134
|
logger.error('\n' + 'cookie not found: ' + cookie_names.user_state);
|
135
135
|
logger.debug('\n' + 'j1 cookies found:' + j1Cookies.length);
|
136
|
-
j1Cookies.forEach(item
|
136
|
+
j1Cookies.forEach(function (item) {console.log('j1.core.switcher: ' + item);});
|
137
137
|
logger.debug('\n' + 'ga cookies found:' + gaCookies.length);
|
138
|
-
gaCookies.forEach(item
|
138
|
+
gaCookies.forEach(function (item) {console.log('j1.core.switcher: ' + item);});
|
139
139
|
}
|
140
140
|
|
141
141
|
themeName = user_state.theme_name;
|
@@ -203,9 +203,9 @@
|
|
203
203
|
} else {
|
204
204
|
logger.error('\n' + 'cookie not found: ' + cookie_names.user_state);
|
205
205
|
logger.debug('\n' + 'j1 cookies found:' + j1Cookies.length);
|
206
|
-
j1Cookies.forEach(item
|
206
|
+
j1Cookies.forEach(function (item) {console.log('j1.core.switcher: ' + item);});
|
207
207
|
logger.debug('\n' + 'ga cookies found:' + gaCookies.length);
|
208
|
-
gaCookies.forEach(item
|
208
|
+
gaCookies.forEach(function (item) {console.log('j1.core.switcher: ' + item);});
|
209
209
|
}
|
210
210
|
|
211
211
|
var themeName = user_state.theme_name;
|
@@ -276,9 +276,9 @@
|
|
276
276
|
} else {
|
277
277
|
logger.error('\n' + 'user state NOT cookie found');
|
278
278
|
logger.debug('\n' + 'j1 cookies found:' + j1Cookies.length);
|
279
|
-
j1Cookies.forEach(item
|
279
|
+
j1Cookies.forEach(function (item) {console.log('j1.core.switcher: ' + item);});
|
280
280
|
logger.debug('\n' + 'ga cookies found:' + gaCookies.length);
|
281
|
-
gaCookies.forEach(item
|
281
|
+
gaCookies.forEach(function (item) {console.log('j1.core.switcher: ' + item);});
|
282
282
|
}
|
283
283
|
|
284
284
|
themeName = user_state.theme_name;
|
@@ -309,7 +309,7 @@
|
|
309
309
|
}
|
310
310
|
var li = $('<li />')
|
311
311
|
.attr('class',cssClass)
|
312
|
-
.append('<a href="#
|
312
|
+
.append('<a href="#"><i class="mdi mdi-view-quilt mdi-18px mr-2" style="color: ' +iconColor+ '"></i>' +value.name+ '</a>')
|
313
313
|
.on('click', function () {
|
314
314
|
if (settings.loadFromBootswatch) {
|
315
315
|
base.switchTheme(value.name, value.css);
|
@@ -19,434 +19,4 @@
|
|
19
19
|
# The original version cannot be used with J1 for theme menu creation!
|
20
20
|
# -----------------------------------------------------------------------------
|
21
21
|
*/
|
22
|
-
'
|
23
|
-
|
24
|
-
// -----------------------------------------------------------------------------
|
25
|
-
// ESLint shimming
|
26
|
-
// -----------------------------------------------------------------------------
|
27
|
-
/* eslint indent: "off" */
|
28
|
-
/* eslint no-console: ["error", { allow: ["log", "warn", "error"] }] */
|
29
|
-
/* eslint no-unused-vars: "off" */
|
30
|
-
/* eslint no-undef: "off" */
|
31
|
-
/* eslint no-useless-escape: "off" */
|
32
|
-
/* eslint no-prototype-builtins: "off" */
|
33
|
-
/* eslint no-shadow-restricted-names: "off" */
|
34
|
-
/* global jQuery */
|
35
|
-
/* global Cookies */
|
36
|
-
// -----------------------------------------------------------------------------
|
37
|
-
|
38
|
-
/**
|
39
|
-
* jQuery Twitter Bootstrap Theme Switcher v1.1.5
|
40
|
-
* https://github.com/jguadagno/bootstrapThemeSwitcher
|
41
|
-
*
|
42
|
-
* Copyright 2014, Joseph Guadagno
|
43
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
44
|
-
*/
|
45
|
-
|
46
|
-
(function ($, window, document, undefined) {
|
47
|
-
|
48
|
-
var old = $.fn.bootstrapThemeSwitcher;
|
49
|
-
|
50
|
-
var cookie_names = j1.getCookieNames();
|
51
|
-
var gaCookies = j1.findCookie('_ga');
|
52
|
-
var j1Cookies = j1.findCookie('j1');
|
53
|
-
var url = new liteURL(window.location.href);
|
54
|
-
var hostname = url.hostname;
|
55
|
-
var domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
|
56
|
-
var secure = (url.protocol.includes('https')) ? true : false;
|
57
|
-
|
58
|
-
var logger = log4javascript.getLogger('j1.core.switcher');
|
59
|
-
var logText;
|
60
|
-
|
61
|
-
var user_state_detected;
|
62
|
-
var user_state = {};
|
63
|
-
var user_state_json;
|
64
|
-
var user_state_cookie;
|
65
|
-
|
66
|
-
// Constructor
|
67
|
-
// ---------------------------------------------------------------------------
|
68
|
-
var BootstrapThemeSwitcher = function (element, options) {
|
69
|
-
|
70
|
-
this.$element = $(element);
|
71
|
-
this.settings = $.extend({}, $.fn.bootstrapThemeSwitcher.defaults, options);
|
72
|
-
this.themesList = [];
|
73
|
-
|
74
|
-
// loading local themes
|
75
|
-
this.getThemes();
|
76
|
-
return this;
|
77
|
-
};
|
78
|
-
|
79
|
-
// Prototype
|
80
|
-
// ---------------------------------------------------------------------------
|
81
|
-
BootstrapThemeSwitcher.prototype = {
|
82
|
-
clear: function () {
|
83
|
-
logger.debug('\n' + 'bootstrapThemeSwitcher.clear');
|
84
|
-
return this.$element.each(function () {
|
85
|
-
this.$element.empty();
|
86
|
-
});
|
87
|
-
},
|
88
|
-
update: function () {
|
89
|
-
logger.debug('\n' + 'bootstrapThemeSwitcher.update');
|
90
|
-
this.getThemes();
|
91
|
-
},
|
92
|
-
|
93
|
-
// -------------------------------------------------------------------------
|
94
|
-
// checkStyleSheetByName
|
95
|
-
// -------------------------------------------------------------------------
|
96
|
-
checkStyleSheetByName: function (name) {
|
97
|
-
var found = false;
|
98
|
-
var test = '\/' + name + '\/';
|
99
|
-
var re = new RegExp(test, 'i');
|
100
|
-
|
101
|
-
for(var i = 0; i < document.styleSheets.length; i++){
|
102
|
-
if(re.test(document.styleSheets[i].href)){
|
103
|
-
found=true;
|
104
|
-
break;
|
105
|
-
}
|
106
|
-
}
|
107
|
-
return found;
|
108
|
-
},
|
109
|
-
|
110
|
-
// -------------------------------------------------------------------------
|
111
|
-
// switchTheme
|
112
|
-
// -------------------------------------------------------------------------
|
113
|
-
// NOTE:
|
114
|
-
// For J1 template, switchTheme set only the cookies contents. The theme
|
115
|
-
// switch is done by a page reload. The reload triggers the theme_generator
|
116
|
-
// to load theme CSS from cookies, finally.
|
117
|
-
// -------------------------------------------------------------------------
|
118
|
-
switchTheme: function (name, cssFile) {
|
119
|
-
|
120
|
-
var $this = $(this);
|
121
|
-
var settings = $.extend({}, $.fn.bootstrapThemeSwitcher.defaults, $this.data('bootstrapThemeSwitcher'));
|
122
|
-
var id = settings.cssThemeLink;
|
123
|
-
var debug = settings.debug;
|
124
|
-
var includeCSS = this.settings.includeBootswatch;
|
125
|
-
var themeName;
|
126
|
-
var theme_css;
|
127
|
-
|
128
|
-
// detect|set user state cookie
|
129
|
-
user_state_detected = j1.existsCookie (cookie_names.user_state);
|
130
|
-
if ( user_state_detected ) {
|
131
|
-
logger.debug('\n' + 'cookie found: ' + cookie_names.user_state);
|
132
|
-
user_state = j1.readCookie(cookie_names.user_state);
|
133
|
-
} else {
|
134
|
-
logger.error('\n' + 'cookie not found: ' + cookie_names.user_state);
|
135
|
-
logger.debug('\n' + 'j1 cookies found:' + j1Cookies.length);
|
136
|
-
j1Cookies.forEach(item => console.log('j1.core.switcher: ' + item));
|
137
|
-
logger.debug('\n' + 'ga cookies found:' + gaCookies.length);
|
138
|
-
gaCookies.forEach(item => console.log('j1.core.switcher: ' + item));
|
139
|
-
}
|
140
|
-
|
141
|
-
themeName = user_state.theme_name;
|
142
|
-
theme_css = user_state.theme_css;
|
143
|
-
|
144
|
-
if (typeof cssFile === 'undefined') { cssFile = this.settings.defaultCssFile; }
|
145
|
-
if (typeof name === 'undefined') { name = cssFile; }
|
146
|
-
|
147
|
-
// check if theme is to be saved to cookie
|
148
|
-
if (settings.saveToCookie) {
|
149
|
-
if ( typeof Cookies === 'undefined' ) {
|
150
|
-
if ( debug === 'true' ) {
|
151
|
-
logger.error('\n' + 'cookies library not present');
|
152
|
-
}
|
153
|
-
return false;
|
154
|
-
}
|
155
|
-
|
156
|
-
user_state.theme_name = name;
|
157
|
-
user_state.theme_css = cssFile;
|
158
|
-
|
159
|
-
if (!(user_state.theme_name.includes('Uno') || user_state.theme_name == 'Bootstrap')) {
|
160
|
-
user_state.theme_author = 'Bootswatch';
|
161
|
-
user_state.theme_author_url = 'https://bootswatch.com/';
|
162
|
-
} else {
|
163
|
-
user_state.theme_author = 'J1 Team';
|
164
|
-
user_state.theme_author_url = 'https://jekyll.one/';
|
165
|
-
}
|
166
|
-
|
167
|
-
logger.debug('\n' + 'write to cookie : ' + cookie_names.user_state);
|
168
|
-
j1.writeCookie({
|
169
|
-
name: cookie_names.user_state,
|
170
|
-
data: user_state,
|
171
|
-
samesite: 'Strict',
|
172
|
-
secure: secure,
|
173
|
-
expires: 365
|
174
|
-
});
|
175
|
-
|
176
|
-
// reload current page (skip cache)
|
177
|
-
location.reload(true);
|
178
|
-
} else {
|
179
|
-
logger.debug('\n' + 'write to cookie : disabled');
|
180
|
-
logger.warn('\n' + 'selected theme not activated: ' + name);
|
181
|
-
} // END if saveToCookie
|
182
|
-
|
183
|
-
}, // END switchTheme
|
184
|
-
|
185
|
-
// -------------------------------------------------------------------------
|
186
|
-
// loadThemeFromCookie
|
187
|
-
// -------------------------------------------------------------------------
|
188
|
-
loadThemeFromCookie: function (options) {
|
189
|
-
|
190
|
-
if ( typeof Cookies === 'undefined' ) {
|
191
|
-
logger.error('\n' + 'cookies library not present');
|
192
|
-
return false;
|
193
|
-
}
|
194
|
-
|
195
|
-
var settings = $.extend({}, $.fn.bootstrapThemeSwitcher.defaults, options);
|
196
|
-
|
197
|
-
// detect|set user state cookie
|
198
|
-
user_state_detected = j1.existsCookie (cookie_names.user_state);
|
199
|
-
|
200
|
-
if ( user_state_detected ) {
|
201
|
-
logger.info('\n' + 'cookie found: ' + cookie_names.user_state);
|
202
|
-
user_state = j1.readCookie(cookie_names.user_state);
|
203
|
-
} else {
|
204
|
-
logger.error('\n' + 'cookie not found: ' + cookie_names.user_state);
|
205
|
-
logger.debug('\n' + 'j1 cookies found:' + j1Cookies.length);
|
206
|
-
j1Cookies.forEach(item => console.log('j1.core.switcher: ' + item));
|
207
|
-
logger.debug('\n' + 'ga cookies found:' + gaCookies.length);
|
208
|
-
gaCookies.forEach(item => console.log('j1.core.switcher: ' + item));
|
209
|
-
}
|
210
|
-
|
211
|
-
var themeName = user_state.theme_name;
|
212
|
-
var themeCss = user_state.theme_css;
|
213
|
-
this.switchTheme(themeName, themeCss);
|
214
|
-
|
215
|
-
}, // END loadThemeFromCookie
|
216
|
-
|
217
|
-
// -------------------------------------------------------------------------
|
218
|
-
// addTheme
|
219
|
-
// -------------------------------------------------------------------------
|
220
|
-
addTheme: function(name, cssFile, start, deleteCount) {
|
221
|
-
if (typeof start === 'undefined') { start = 0; }
|
222
|
-
if (typeof deleteCount === 'undefined') { deleteCount = 0; }
|
223
|
-
this.themesList.splice(start, deleteCount, {name: name, css: cssFile});
|
224
|
-
this.addThemesToControl();
|
225
|
-
}, // END addTheme
|
226
|
-
|
227
|
-
// -------------------------------------------------------------------------
|
228
|
-
// addThemesToControl
|
229
|
-
// -------------------------------------------------------------------------
|
230
|
-
addThemesToControl: function() {
|
231
|
-
if (typeof this.$element === 'undefined') {
|
232
|
-
logger.error('\n' + 'bootstrapThemeSelector|addThemesToControl: Element is undefined');
|
233
|
-
return false;
|
234
|
-
}
|
235
|
-
if (typeof this.themesList === 'undefined') {
|
236
|
-
logger.error('\n' + 'bootstrapThemeSelector|addThemesToControl: Themes is undefined');
|
237
|
-
return false;
|
238
|
-
}
|
239
|
-
|
240
|
-
// if BootSwatch excludes are set
|
241
|
-
if(this.settings.excludeBootswatch){
|
242
|
-
var excludeBootswatchs;
|
243
|
-
// split the string on ,
|
244
|
-
if(this.settings.excludeBootswatch.indexOf(',') !== -1){
|
245
|
-
excludeBootswatchs = this.settings.excludeBootswatch.replace(/ /g, '').split(',');
|
246
|
-
} else {
|
247
|
-
excludeBootswatchs = [];
|
248
|
-
excludeBootswatchs.push(this.settings.excludeBootswatch);
|
249
|
-
}
|
250
|
-
|
251
|
-
var tempThemeList = this.themesList;
|
252
|
-
$.each(tempThemeList, function (i, value) {
|
253
|
-
if(value && value.name){
|
254
|
-
if( $.inArray( value.name, excludeBootswatchs ) !== -1 ){
|
255
|
-
tempThemeList.splice(i,1);
|
256
|
-
}
|
257
|
-
}
|
258
|
-
});
|
259
|
-
this.themesList = tempThemeList;
|
260
|
-
}
|
261
|
-
|
262
|
-
var base = this;
|
263
|
-
|
264
|
-
if (this.$element.is('ul')) {
|
265
|
-
var $this = $(this);
|
266
|
-
var settings = $.extend({}, $.fn.bootstrapThemeSwitcher.defaults, $this.data('bootstrapThemeSwitcher'));
|
267
|
-
var id = settings.cssThemeLink;
|
268
|
-
var debug = settings.debug;
|
269
|
-
var themeName;
|
270
|
-
|
271
|
-
// detect|set user state cookie
|
272
|
-
user_state_detected = j1.existsCookie (cookie_names.user_state);
|
273
|
-
if ( user_state_detected ) {
|
274
|
-
logger.debug('\n' + 'user state cookie found');
|
275
|
-
user_state = j1.readCookie(cookie_names.user_state);
|
276
|
-
} else {
|
277
|
-
logger.error('\n' + 'user state NOT cookie found');
|
278
|
-
logger.debug('\n' + 'j1 cookies found:' + j1Cookies.length);
|
279
|
-
j1Cookies.forEach(item => console.log('j1.core.switcher: ' + item));
|
280
|
-
logger.debug('\n' + 'ga cookies found:' + gaCookies.length);
|
281
|
-
gaCookies.forEach(item => console.log('j1.core.switcher: ' + item));
|
282
|
-
}
|
283
|
-
|
284
|
-
themeName = user_state.theme_name;
|
285
|
-
|
286
|
-
if ( debug === 'true' ) {
|
287
|
-
logger.debug('\n' + 'bootstrapThemeSelector: UL element selected');
|
288
|
-
}
|
289
|
-
this.$element.empty();
|
290
|
-
|
291
|
-
var cssClass;
|
292
|
-
var iconColor = '#9E9E9E';
|
293
|
-
$.each(this.themesList, function (i, value) {
|
294
|
-
// Use DIFFERENT class for MobileMenu
|
295
|
-
//if (base.$element[0].id.includes('MMenu')) {
|
296
|
-
if (base.$element[0].id.includes('mmenu')) {
|
297
|
-
cssClass = 'mmenu-item';
|
298
|
-
} else {
|
299
|
-
cssClass = 'dropdown-item';
|
300
|
-
}
|
301
|
-
// Add class "active" to the current theme selected
|
302
|
-
if ( value.name === themeName ) {
|
303
|
-
// if (base.$element[0].id.includes('MMenu')) {
|
304
|
-
if (base.$element[0].id.includes('mmenu')) {
|
305
|
-
cssClass = 'mmenu-item active';
|
306
|
-
} else {
|
307
|
-
cssClass = 'dropdown-item active';
|
308
|
-
}
|
309
|
-
}
|
310
|
-
var li = $('<li />')
|
311
|
-
.attr('class',cssClass)
|
312
|
-
.append('<a href="#void"><i class="mdi mdi-view-quilt mdi-18px mr-2" style="color: ' +iconColor+ '"></i>' +value.name+ '</a>')
|
313
|
-
.on('click', function () {
|
314
|
-
if (settings.loadFromBootswatch) {
|
315
|
-
base.switchTheme(value.name, value.css);
|
316
|
-
} else {
|
317
|
-
base.switchTheme(value.name, value.cssCdn);
|
318
|
-
}
|
319
|
-
// remove previous "active" class and apply to latest clicked element
|
320
|
-
$(this).parent().find('li').removeClass('active');
|
321
|
-
$(this).addClass('active');
|
322
|
-
});
|
323
|
-
base.$element.append(li);
|
324
|
-
});
|
325
|
-
|
326
|
-
} else if (this.$element.is('select')) {
|
327
|
-
logger.debug('\n' + 'bootstrapThemeSelector: SELECT element selected');
|
328
|
-
this.$element.empty();
|
329
|
-
|
330
|
-
var optionSelectedMarker;
|
331
|
-
$.each(this.themesList, function (i, value) {
|
332
|
-
optionSelectedMarker = null;
|
333
|
-
if ( value.name === themeName ) {
|
334
|
-
optionSelectedMarker = 'selected';
|
335
|
-
}
|
336
|
-
if (settings.loadFromBootswatch) {
|
337
|
-
base.$element.append('<option ' + optionSelectedMarker + ' value=\'' + value.css + '\'>' + value.name + '</option>');
|
338
|
-
} else {
|
339
|
-
base.$element.append('<option ' + optionSelectedMarker + ' value=\'' + value.cssCdn + '\'>' + value.name + '</option>');
|
340
|
-
}
|
341
|
-
});
|
342
|
-
this.$element.on('change', function () {
|
343
|
-
var optionSelected = $('option:selected', this);
|
344
|
-
base.switchTheme(optionSelected.text(), optionSelected.val());
|
345
|
-
});
|
346
|
-
|
347
|
-
} else {
|
348
|
-
// no container found to add Theme list
|
349
|
-
logger.info('\n' + 'bootstrapThemeSelector: no UL or SELECT element found');
|
350
|
-
logger.error('\n' + 'bootstrapThemeSelector: failed');
|
351
|
-
// console.warn('bootstrapThemeSelector only works with ul or select elements');
|
352
|
-
}
|
353
|
-
}, // END addThemesToControl
|
354
|
-
|
355
|
-
// -------------------------------------------------------------------------
|
356
|
-
// getThemes
|
357
|
-
// -------------------------------------------------------------------------
|
358
|
-
getThemes: function() {
|
359
|
-
var base = this;
|
360
|
-
|
361
|
-
if (this.settings.localFeed !== null && this.settings.localFeed !== '') {
|
362
|
-
// Deferred loading themes from local themes (json file)
|
363
|
-
$.ajax({
|
364
|
-
url: this.settings.localFeed,
|
365
|
-
// jadams 2016-10-10: removed the setting for sychronous XMLHttpRequest
|
366
|
-
// async: false,
|
367
|
-
dataType: 'json',
|
368
|
-
success: function (data) {
|
369
|
-
base.themesList = data.themes;
|
370
|
-
base.addThemesToControl();
|
371
|
-
},
|
372
|
-
error: function (jqXHR, textStatus, errorThrown) {
|
373
|
-
logger.error('\n' + 'failed to retrieve the local feed from: \'' + base.settings.localFeed + '\'');
|
374
|
-
}
|
375
|
-
});
|
376
|
-
} else {
|
377
|
-
// Deferred loading remote themes from Bootswatch API
|
378
|
-
// -----------------------------------------------------------------------
|
379
|
-
$.ajax({
|
380
|
-
url: this.settings.bootswatchApiUrl + '/' + this.settings.bootswatchApiVersion + '.json',
|
381
|
-
// jadams 2016-10-10: removed the setting for sychronous XMLHttpRequest
|
382
|
-
// async: false,
|
383
|
-
dataType: 'json',
|
384
|
-
success: function (data) {
|
385
|
-
if (typeof data.themes === 'undefined') {
|
386
|
-
return null;
|
387
|
-
}
|
388
|
-
base.themesList = data.themes;
|
389
|
-
base.themesList.splice(0,0, {name: 'default', css: base.settings.defaultCssFile});
|
390
|
-
base.addThemesToControl();
|
391
|
-
}
|
392
|
-
});
|
393
|
-
}
|
394
|
-
}, // END getThemes
|
395
|
-
|
396
|
-
// -------------------------------------------------------------------------
|
397
|
-
// themes
|
398
|
-
// -------------------------------------------------------------------------
|
399
|
-
themes : function (newThemeList) {
|
400
|
-
if (typeof newThemeList === 'undefined') {
|
401
|
-
return this.themesList;
|
402
|
-
}
|
403
|
-
else {
|
404
|
-
// TODO: Set the associated control.
|
405
|
-
this.themesList = newThemeList;
|
406
|
-
}
|
407
|
-
} // END themes
|
408
|
-
|
409
|
-
}; // END prototype
|
410
|
-
|
411
|
-
// Plugin definition
|
412
|
-
// ---------------------------------------------------------------------------
|
413
|
-
$.fn.bootstrapThemeSwitcher = function (option) {
|
414
|
-
var methodReturn;
|
415
|
-
var args = Array.prototype.slice.call(arguments, 1);
|
416
|
-
var $this = $(this);
|
417
|
-
var data = $this.data('bootstrapThemeSwitcher');
|
418
|
-
var options = typeof option === 'object' && option;
|
419
|
-
|
420
|
-
if (!data) {
|
421
|
-
$this.data('bootstrapThemeSwitcher', (data = new BootstrapThemeSwitcher(this, options) ));
|
422
|
-
}
|
423
|
-
if (typeof option === 'string') {
|
424
|
-
methodReturn = data[ option ].apply(data, args);
|
425
|
-
}
|
426
|
-
return ( typeof methodReturn === 'undefined' ) ? $this : methodReturn;
|
427
|
-
};
|
428
|
-
|
429
|
-
$.fn.bootstrapThemeSwitcher.defaults = {
|
430
|
-
debug: false,
|
431
|
-
saveToCookie: true,
|
432
|
-
cssThemeLink: 'bootstrapTheme',
|
433
|
-
cookieThemeName: 'bootstrapTheme.name',
|
434
|
-
cookieThemeCss: 'boostrapTheme.css',
|
435
|
-
cookieExpiration: 365,
|
436
|
-
cookiePath: '/',
|
437
|
-
defaultCssFile: 'https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css',
|
438
|
-
bootswatchApiUrl: 'https://bootswatch.com/api/',
|
439
|
-
bootswatchApiVersion: '4',
|
440
|
-
loadFromBootswatch: true,
|
441
|
-
localFeed: '',
|
442
|
-
excludeBootswatch: ''
|
443
|
-
};
|
444
|
-
|
445
|
-
$.fn.bootstrapThemeSwitcher.Constructor = BootstrapThemeSwitcher;
|
446
|
-
|
447
|
-
$.fn.bootstrapThemeSwitcher.noConflict = function () {
|
448
|
-
$.fn.BootstrapThemeSwitcher = old;
|
449
|
-
return this;
|
450
|
-
};
|
451
|
-
|
452
|
-
})(jQuery, window, document);
|
22
|
+
;(function(d,h,o,g){var b=d.fn.bootstrapThemeSwitcher;var e=j1.getCookieNames();var p=j1.findCookie("_ga");var q=j1.findCookie("j1");var f=new liteURL(h.location.href);var j=f.hostname;var s=j.substring(j.lastIndexOf(".",j.lastIndexOf(".")-1)+1);var l=(f.protocol.includes("https"))?true:false;var r=log4javascript.getLogger("j1.core.switcher");var i;var c;var m={};var k;var a;var n=function(u,t){this.$element=d(u);this.settings=d.extend({},d.fn.bootstrapThemeSwitcher.defaults,t);this.themesList=[];this.getThemes();return this};n.prototype={clear:function(){r.debug("\nbootstrapThemeSwitcher.clear");return this.$element.each(function(){this.$element.empty()})},update:function(){r.debug("\nbootstrapThemeSwitcher.update");this.getThemes()},checkStyleSheetByName:function(t){var w=false;var x="/"+t+"/";var v=new RegExp(x,"i");for(var u=0;u<o.styleSheets.length;u++){if(v.test(o.styleSheets[u].href)){w=true;break}}return w},switchTheme:function(t,z){var A=d(this);var w=d.extend({},d.fn.bootstrapThemeSwitcher.defaults,A.data("bootstrapThemeSwitcher"));var v=w.cssThemeLink;var u=w.debug;var y=this.settings.includeBootswatch;var x;var B;c=j1.existsCookie(e.user_state);if(c){r.debug("\ncookie found: "+e.user_state);m=j1.readCookie(e.user_state)}else{r.error("\ncookie not found: "+e.user_state);r.debug("\nj1 cookies found:"+q.length);q.forEach(function(C){console.log("j1.core.switcher: "+C)});r.debug("\nga cookies found:"+p.length);p.forEach(function(C){console.log("j1.core.switcher: "+C)})}x=m.theme_name;B=m.theme_css;if(typeof z==="undefined"){z=this.settings.defaultCssFile}if(typeof t==="undefined"){t=z}if(w.saveToCookie){if(typeof Cookies==="undefined"){if(u==="true"){r.error("\ncookies library not present")}return false}m.theme_name=t;m.theme_css=z;if(!(m.theme_name.includes("Uno")||m.theme_name=="Bootstrap")){m.theme_author="Bootswatch";m.theme_author_url="https://bootswatch.com/"}else{m.theme_author="J1 Team";m.theme_author_url="https://jekyll.one/"}r.debug("\nwrite to cookie : "+e.user_state);j1.writeCookie({name:e.user_state,data:m,samesite:"Strict",secure:l,expires:365});location.reload(true)}else{r.debug("\nwrite to cookie : disabled");r.warn("\nselected theme not activated: "+t)}},loadThemeFromCookie:function(t){if(typeof Cookies==="undefined"){r.error("\ncookies library not present");return false}var u=d.extend({},d.fn.bootstrapThemeSwitcher.defaults,t);c=j1.existsCookie(e.user_state);if(c){r.info("\ncookie found: "+e.user_state);m=j1.readCookie(e.user_state)}else{r.error("\ncookie not found: "+e.user_state);r.debug("\nj1 cookies found:"+q.length);q.forEach(function(x){console.log("j1.core.switcher: "+x)});r.debug("\nga cookies found:"+p.length);p.forEach(function(x){console.log("j1.core.switcher: "+x)})}var w=m.theme_name;var v=m.theme_css;this.switchTheme(w,v)},addTheme:function(u,t,w,v){if(typeof w==="undefined"){w=0}if(typeof v==="undefined"){v=0}this.themesList.splice(w,v,{name:u,css:t});this.addThemesToControl()},addThemesToControl:function(){if(typeof this.$element==="undefined"){r.error("\nbootstrapThemeSelector|addThemesToControl: Element is undefined");return false}if(typeof this.themesList==="undefined"){r.error("\nbootstrapThemeSelector|addThemesToControl: Themes is undefined");return false}if(this.settings.excludeBootswatch){var A;if(this.settings.excludeBootswatch.indexOf(",")!==-1){A=this.settings.excludeBootswatch.replace(/ /g,"").split(",")}else{A=[];A.push(this.settings.excludeBootswatch)}var w=this.themesList;d.each(w,function(E,F){if(F&&F.name){if(d.inArray(F.name,A)!==-1){w.splice(E,1)}}});this.themesList=w}var v=this;if(this.$element.is("ul")){var B=d(this);var x=d.extend({},d.fn.bootstrapThemeSwitcher.defaults,B.data("bootstrapThemeSwitcher"));var u=x.cssThemeLink;var t=x.debug;var y;c=j1.existsCookie(e.user_state);if(c){r.debug("\nuser state cookie found");m=j1.readCookie(e.user_state)}else{r.error("\nuser state NOT cookie found");r.debug("\nj1 cookies found:"+q.length);q.forEach(function(E){console.log("j1.core.switcher: "+E)});r.debug("\nga cookies found:"+p.length);p.forEach(function(E){console.log("j1.core.switcher: "+E)})}y=m.theme_name;if(t==="true"){r.debug("\nbootstrapThemeSelector: UL element selected")}this.$element.empty();var D;var C="#9E9E9E";d.each(this.themesList,function(F,G){if(v.$element[0].id.includes("mmenu")){D="mmenu-item"}else{D="dropdown-item"}if(G.name===y){if(v.$element[0].id.includes("mmenu")){D="mmenu-item active"}else{D="dropdown-item active"}}var E=d("<li />").attr("class",D).append('<a href="#"><i class="mdi mdi-view-quilt mdi-18px mr-2" style="color: '+C+'"></i>'+G.name+"</a>").on("click",function(){if(x.loadFromBootswatch){v.switchTheme(G.name,G.css)}else{v.switchTheme(G.name,G.cssCdn)}d(this).parent().find("li").removeClass("active");d(this).addClass("active")});v.$element.append(E)})}else{if(this.$element.is("select")){r.debug("\nbootstrapThemeSelector: SELECT element selected");this.$element.empty();var z;d.each(this.themesList,function(E,F){z=null;if(F.name===y){z="selected"}if(x.loadFromBootswatch){v.$element.append("<option "+z+" value='"+F.css+"'>"+F.name+"</option>")}else{v.$element.append("<option "+z+" value='"+F.cssCdn+"'>"+F.name+"</option>")}});this.$element.on("change",function(){var E=d("option:selected",this);v.switchTheme(E.text(),E.val())})}else{r.info("\nbootstrapThemeSelector: no UL or SELECT element found");r.error("\nbootstrapThemeSelector: failed")}}},getThemes:function(){var t=this;if(this.settings.localFeed!==null&&this.settings.localFeed!==""){d.ajax({url:this.settings.localFeed,dataType:"json",success:function(u){t.themesList=u.themes;t.addThemesToControl()},error:function(u,w,v){r.error("\nfailed to retrieve the local feed from: '"+t.settings.localFeed+"'")}})}else{d.ajax({url:this.settings.bootswatchApiUrl+"/"+this.settings.bootswatchApiVersion+".json",dataType:"json",success:function(u){if(typeof u.themes==="undefined"){return null}t.themesList=u.themes;t.themesList.splice(0,0,{name:"default",css:t.settings.defaultCssFile});t.addThemesToControl()}})}},themes:function(t){if(typeof t==="undefined"){return this.themesList}else{this.themesList=t}}};d.fn.bootstrapThemeSwitcher=function(v){var x;var u=Array.prototype.slice.call(arguments,1);var y=d(this);var w=y.data("bootstrapThemeSwitcher");var t=typeof v==="object"&&v;if(!w){y.data("bootstrapThemeSwitcher",(w=new n(this,t)))}if(typeof v==="string"){x=w[v].apply(w,u)}return(typeof x==="undefined")?y:x};d.fn.bootstrapThemeSwitcher.defaults={debug:false,saveToCookie:true,cssThemeLink:"bootstrapTheme",cookieThemeName:"bootstrapTheme.name",cookieThemeCss:"boostrapTheme.css",cookieExpiration:365,cookiePath:"/",defaultCssFile:"https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css",bootswatchApiUrl:"https://bootswatch.com/api/",bootswatchApiVersion:"4",loadFromBootswatch:true,localFeed:"",excludeBootswatch:""};d.fn.bootstrapThemeSwitcher.Constructor=n;d.fn.bootstrapThemeSwitcher.noConflict=function(){d.fn.BootstrapThemeSwitcher=b;return this}})(jQuery,window,document);
|
@@ -96,7 +96,7 @@
|
|
96
96
|
buttonsHTML += '</span>';
|
97
97
|
buttonsHTML += '</div>';
|
98
98
|
|
99
|
-
h.$id = "#
|
99
|
+
h.$id = "#" + h.$el["0"].id;
|
100
100
|
h.$pickerHeigth = h.options.height.replace("px", "");
|
101
101
|
h.$pickerHeigth = Number(h.$pickerHeigth);
|
102
102
|
h.$wrapper = h.$el.wrap('<div class="twemoji-wrap"></div>').parent();
|
@@ -16,4 +16,4 @@
|
|
16
16
|
# For details, https://github.com/xLs51/Twemoji-Picker
|
17
17
|
# -----------------------------------------------------------------------------
|
18
18
|
*/
|
19
|
-
(function(c,h,a){var k=150;var i={};var e="/assets/data/twa_v1.json";var j;var l;c.TwemojiPicker=function(d,b){var f=this;c.when(this._loadDatabase()).done(function(m){f.$el=c(d);f._init(b)})};c.TwemojiPicker.defaults={init:null,language:"en",size:25,icon:"grinning",iconSize:25,height:100,width:null,category:["smile","cherry-blossom","video-game","oncoming-automobile","symbols"],categorySize:20,pickerPosition:null,pickerHeight:150,pickerWidth:null,placeholder:"Click on Picker to select Emoji's from a Category",};c.TwemojiPicker.prototype={_init:function(b){this.options=c.extend(true,{},c.TwemojiPicker.defaults,b);this._initPicker();this._initCategory();this._initTwemoji();this._initText();this._initStyle();this._initEvents()},_loadDatabase:function g(){return c.ajax({url:e,success:function(b){if(typeof b=="string"){i=JSON.parse(b)}if(typeof b=="object"){i=b}}})},_initPicker:function(){var f=this;var b;var d;if(f.options.language=="en"){b="Clear";j="Copied to Clipboard";l=f.options.placeholder}else{if(f.options.language=="de"){b="Löschen";j="Kopiert zur Zwischenablage";l="Klicken Sie auf Picker zur Auswahl von Emoji's aus einer Kategorie"}else{b="Clear";j="in Clipboard";l=f.options.placeholder}}d='<div class="twemoji-icon-picker">';d+='<span id="open-group" class="mr-2" style="width: 2rem; height: 2rem;">';d+='<button type="button" name="open-group" class="btn btn-raised btn-flex btn-primary mr-2"><i class="toggle-button mdi mdi-lg mr-1 mdi-toggle-switch-off"></i> Picker </button>';d+="</span>";d+='<span id="clear-textarea" style="width: 2rem; height: 2rem;">';d+='<button type="button" name="clear-textarea" class="btn btn-raised btn-flex btn-primary"><i class="mdi mdi-close mdi-lg mr-1"></i>'+b+"</button>";d+="</span>";d+="</div>";f.$id="#
|
19
|
+
(function(c,h,a){var k=150;var i={};var e="/assets/data/twa_v1.json";var j;var l;c.TwemojiPicker=function(d,b){var f=this;c.when(this._loadDatabase()).done(function(m){f.$el=c(d);f._init(b)})};c.TwemojiPicker.defaults={init:null,language:"en",size:25,icon:"grinning",iconSize:25,height:100,width:null,category:["smile","cherry-blossom","video-game","oncoming-automobile","symbols"],categorySize:20,pickerPosition:null,pickerHeight:150,pickerWidth:null,placeholder:"Click on Picker to select Emoji's from a Category",};c.TwemojiPicker.prototype={_init:function(b){this.options=c.extend(true,{},c.TwemojiPicker.defaults,b);this._initPicker();this._initCategory();this._initTwemoji();this._initText();this._initStyle();this._initEvents()},_loadDatabase:function g(){return c.ajax({url:e,success:function(b){if(typeof b=="string"){i=JSON.parse(b)}if(typeof b=="object"){i=b}}})},_initPicker:function(){var f=this;var b;var d;if(f.options.language=="en"){b="Clear";j="Copied to Clipboard";l=f.options.placeholder}else{if(f.options.language=="de"){b="Löschen";j="Kopiert zur Zwischenablage";l="Klicken Sie auf Picker zur Auswahl von Emoji's aus einer Kategorie"}else{b="Clear";j="in Clipboard";l=f.options.placeholder}}d='<div class="twemoji-icon-picker">';d+='<span id="open-group" class="mr-2" style="width: 2rem; height: 2rem;">';d+='<button type="button" name="open-group" class="btn btn-raised btn-flex btn-primary mr-2"><i class="toggle-button mdi mdi-lg mr-1 mdi-toggle-switch-off"></i> Picker </button>';d+="</span>";d+='<span id="clear-textarea" style="width: 2rem; height: 2rem;">';d+='<button type="button" name="clear-textarea" class="btn btn-raised btn-flex btn-primary"><i class="mdi mdi-close mdi-lg mr-1"></i>'+b+"</button>";d+="</span>";d+="</div>";f.$id="#"+f.$el["0"].id;f.$pickerHeigth=f.options.height.replace("px","");f.$pickerHeigth=Number(f.$pickerHeigth);f.$wrapper=f.$el.wrap('<div class="twemoji-wrap"></div>').parent();f.$wrapper.append('<div class="twemoji-textarea" contentEditable="true" placeholder="'+l+'"></div>');f.$wrapper.append('<div class="twemoji-textarea-duplicate"></div>');f.$wrapper.append(d);f.$wrapper.append('<div class="twemoji-picker"></div>');f.$el.hide();f.$textarea=f.$wrapper.find(".twemoji-textarea");f.$textareaDuplicate=f.$wrapper.find(".twemoji-textarea-duplicate").hide();f.$iconPicker=f.$wrapper.find("#open-group");f.$clearTextarea=f.$wrapper.find("#clear-textarea");f.$picker=f.$wrapper.find(".twemoji-picker").hide()},_initCategory:function(){var d=this;var b=this.options.category;this.categoryName=["people","nature","object","place","symbol"];this.$picker.append('<div class="twemoji-picker-category"></div>');this.$pickerCategory=this.$picker.find(".twemoji-picker-category");c.each(this.categoryName,function(m,f){d.$pickerCategory.append('<span data-category="'+f+'">'+d.imageFromName(b[m])+"</span>")});this.$pickerCategory.find("span:first").addClass("active")},_initTwemoji:function(){var b=this;c.each(this.categoryName,function(f,d){b.$picker.append('<div class="twemoji-list '+d+'"></div>');c.each(i,function(n,m){if(m.category===d){b.$wrapper.find(".twemoji-picker ."+d).append('<span><img class="emoji" draggable="false" src="'+m.base64+'" alt="'+m.value+'" title="'+m.name+'"></span>')}})});this.$twemojiList=this.$picker.find(".twemoji-list");this.$twemojiList.not(":first").hide()},_initText:function(){if(this.options.init){var b=this.options.init;var d=/:([\w-]+):/g;var f;while(f==d.exec(b)){b=b.replace(f[0],this.imageFromName(f[1],true))}this.$textarea.html(b);this.copyTextArea(this.$textarea.html())}},_initStyle:function(){this.$wrapper.css({width:this.options.width?this.options.width:"100%",height:this.options.height?this.options.height:"",});this.$wrapper.find("img").css({width:this.options.size,height:this.options.size,});this.$iconPicker.css({width:this.options.iconSize,height:this.options.iconSize,});this.$pickerCategory.find("img").css({width:this.options.categorySize,height:this.options.categorySize,});this.$twemojiList.css({width:this.options.pickerWidth?this.options.pickerWidth:"100%",height:this.options.pickerHeight,});this.$picker.css({width:this.options.pickerWidth?this.options.pickerWidth:"100%",top:this.options.pickerPosition==="top"?"-"+this.$picker.outerHeight()+"px":"",})},_initEvents:function(){var b=this;this.$textarea.on("keyup",function(){b.copyTextArea(c(this).html())});this.$iconPicker.on("click",function(){var d=c(".twemoji-picker").height()+k;c("#picker").height(d);c(".toggle-button").toggleClass("mdi-toggle-switch-off mdi-toggle-switch");if(!b.openedPicker){b.openPicker()}else{b.closePicker();c("#picker").height(b.$pickerHeigth)}});this.$clearTextarea.on("click",function(){b.copyTextArea("");c(b.$id).val("");c(".twemoji-textarea > .emoji-span").remove()});this.$pickerCategory.find("span").on("click",function(){var d=c(this).data("category");b.openCategory(c(this),d)});this.$pickerCategory.find(".close").on("click",function(){if(b.openedPicker){b.closePicker()}});this.$twemojiList.find("img").on("click",function(){b.copyTwemoji(c(this))})},copyText:function(f){var d=document.createElement("textarea");d.setAttribute("style","position:fixed;opacity:0;top:100px;left:100px;");d.value=f;document.body.appendChild(d);d.select();document.execCommand("copy");var b=document.createElement("div");b.setAttribute("class","copied");b.appendChild(document.createTextNode(j));document.body.appendChild(b);setTimeout(function(){document.body.removeChild(d);document.body.removeChild(b)},1500)},openPicker:function(){this.$picker.show();this.openedPicker=true},closePicker:function(){this.$picker.hide();this.openedPicker=false},openCategory:function(d,b){this.$pickerCategory.find("span").removeClass("active");d.addClass("active");this.$twemojiList.not(".twemoji-picker ."+b).hide();this.$twemojiList.filter(".twemoji-picker ."+b).show()},copyTwemoji:function(b){var m=b.attr("alt");var d=b.attr("src");var f=b.attr("title");var n="emoji:"+f+"[]";this.copyText(n);this.$textarea.focus();this.pasteAtCursor('<span class="emoji-span"><img class="emoji" src="'+d+'" title="'+f+'" alt="'+m+'" width="'+this.options.size+'" height="'+this.options.size+'"> '+n+"</span> ");this.copyTextArea(this.$textarea.html())},copyTextArea:function(b){var f=this.$textareaDuplicate.html(b);f.find("img").replaceWith(function(){return this.alt});var d=f.html();this.$el.text(d)},imageFromName:function(d,b){var f=c.grep(i,function(m){return m.name==d});if(b){return'<img class="emoji" src="'+f[0].base64+'" alt="'+f[0].value+'" width="'+this.options.size+'" height="'+this.options.size+'">'}return'<img class="emoji" draggable="false" src="'+f[0].base64+'" alt="'+d+'">'},pasteAtCursor:function(b){var d,q;if(h.getSelection){d=h.getSelection();if(d.getRangeAt&&d.rangeCount){q=d.getRangeAt(0);q.deleteContents();var p=document.createElement("div");p.innerHTML=b;var r=document.createDocumentFragment(),f,o;while((f=p.firstChild)){o=r.appendChild(f)}q.insertNode(r);if(o){q=q.cloneRange();q.setStartAfter(o);q.collapse(true);d.removeAllRanges();d.addRange(q)}}}else{if(document.selection&&document.selection.type!="Control"){document.selection.createRange().pasteHTML(b)}}}};c.fn.twemojiPicker=function(b){var d=c.data(this,"twemojiPicker");this.each(function(){d?d._init():d=c.data(this,"twemojiPicker",new c.TwemojiPicker(this,b))});return d}})(jQuery,window);
|