j1-template 2021.2.7 → 2021.2.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/blocks/footer/boxes/contacts_box.proc +1 -1
  3. data/_includes/themes/j1/layouts/content_generator_article_navigator.html +2 -2
  4. data/_includes/themes/j1/layouts/content_generator_blog_archive.html +2 -2
  5. data/_includes/themes/j1/layouts/content_generator_news_panel_posts.html +2 -2
  6. data/_includes/themes/j1/modules/boards/news_pin_board.html +10 -10
  7. data/_includes/themes/j1/modules/connectors/translators/google-translator.html +20 -4
  8. data/_includes/themes/j1/modules/navigator/generator.html +6 -6
  9. data/_includes/themes/j1/procedures/posts/collate_calendar.proc +3 -3
  10. data/_includes/themes/j1/procedures/posts/create_series_header.proc +1 -1
  11. data/_includes/themes/j1/procedures/posts/pager.proc +1 -1
  12. data/assets/data/gallery_customizer.html +1 -1
  13. data/assets/data/menu.html +17 -17
  14. data/assets/data/mmenu.html +17 -17
  15. data/assets/data/quicklinks.html +3 -3
  16. data/assets/data/translator.html +2 -2
  17. data/assets/themes/j1/adapter/js/cookieConsent.js +4 -3
  18. data/assets/themes/j1/adapter/js/j1.js +1 -1
  19. data/assets/themes/j1/adapter/js/translator.js +84 -125
  20. data/assets/themes/j1/modules/backstretch/js/backstretch.min.js +1 -1
  21. data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.full.js +1 -1
  22. data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.js +1 -1
  23. data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.min.js +1 -1
  24. data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +70 -10
  25. data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js +1 -1
  26. data/assets/themes/j1/modules/datatables/js/datatables.js +1 -1
  27. data/assets/themes/j1/modules/datatables/js/datatables.min.js +5 -5
  28. data/assets/themes/j1/modules/iframeResizer/examples/frame.absolute.html +3 -3
  29. data/assets/themes/j1/modules/iframeResizer/examples/frame.content.html +6 -6
  30. data/assets/themes/j1/modules/iframeResizer/examples/frame.tolerance.html +2 -2
  31. data/assets/themes/j1/modules/iframeResizer/js/client/iframeResizer.contentWindow.js +1 -1
  32. data/assets/themes/j1/modules/iframeResizer/js/client/iframeResizer.contentWindow.min.js +1 -1
  33. data/assets/themes/j1/modules/iframeResizer/js/resizer.min.js +1 -1
  34. data/assets/themes/j1/modules/j1Deepl/js/j1deepl.min.js +1 -1
  35. data/assets/themes/j1/modules/j1Scroll/js/j1scroll.js +1 -1
  36. data/assets/themes/j1/modules/j1Scroll/js/j1scroll.min.js +1 -1
  37. data/assets/themes/j1/modules/jquery/js/jquery.js +2 -2
  38. data/assets/themes/j1/modules/jquery/js/jquery.min.js +1 -1
  39. data/assets/themes/j1/modules/jquery/js/jqueryUI.js +7 -7
  40. data/assets/themes/j1/modules/jquery/js/jqueryUI.min.js +3 -3
  41. data/assets/themes/j1/modules/lightGallery/js/core/j1/lightgallery-x.min.js +1 -1
  42. data/assets/themes/j1/modules/lightGallery/js/core/lightgallery.min.js +1 -1
  43. data/assets/themes/j1/modules/lightGallery/js/modules/j1/j1-video.min.js +1 -1
  44. data/assets/themes/j1/modules/lightGallery/js/modules/j1/j1-x-video.min.js +1 -1
  45. data/assets/themes/j1/modules/lightbox/js/lightbox.js +1 -1
  46. data/assets/themes/j1/modules/lightbox/js/lightbox.min.js +1 -1
  47. data/assets/themes/j1/modules/lunrSearch/js/mustache.js +1 -1
  48. data/assets/themes/j1/modules/lunrSearch/js/mustache.min.js +1 -1
  49. data/assets/themes/j1/modules/lunrSearch/js/uri.js +1 -1
  50. data/assets/themes/j1/modules/lunrSearch/js/uri.min.js +7 -7
  51. data/assets/themes/j1/modules/mdiPreviewer/js/previewer.min.js +1 -1
  52. data/assets/themes/j1/modules/mdilPreviewer/js/previewer.min.js +1 -1
  53. data/assets/themes/j1/modules/themeSwitcher/js/switcher.js +1 -1
  54. data/assets/themes/j1/modules/themeSwitcher/js/switcher.min.js +1 -1
  55. data/assets/themes/j1/modules/translator/js/translator.js +14 -9
  56. data/assets/themes/j1/modules/translator/js/translator.min.js +1 -1
  57. data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.js +1 -1
  58. data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.min.js +1 -1
  59. data/assets/themes/j1/modules/videojs/js/video.min.js +2 -2
  60. data/lib/j1/version.rb +1 -1
  61. data/lib/starter_web/Gemfile +1 -1
  62. data/lib/starter_web/_config.yml +1 -1
  63. data/lib/starter_web/_data/apps/carousel.yml +4 -4
  64. data/lib/starter_web/_data/blocks/defaults/footer.yml +2 -2
  65. data/lib/starter_web/_data/blocks/footer.yml +2 -2
  66. data/lib/starter_web/_data/modules/attics.yml +1 -1
  67. data/lib/starter_web/_data/modules/cookieconsent.yml +0 -1
  68. data/lib/starter_web/_data/modules/defaults/attics.yml +2 -2
  69. data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +3 -1
  70. data/lib/starter_web/_data/modules/defaults/translator.yml +2 -1
  71. data/lib/starter_web/_data/modules/translator.yml +3 -0
  72. data/lib/starter_web/_includes/attributes.asciidoc +1 -1
  73. data/lib/starter_web/_plugins/lunr_index.rb +1 -1
  74. data/lib/starter_web/package.json +1 -1
  75. data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +2 -2
  76. data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +3 -3
  77. data/lib/starter_web/pages/public/previewer/preview_bootstrap_theme.adoc +85 -85
  78. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  79. data/lib/starter_web/utilsrv/package.json +1 -1
  80. metadata +2 -2
@@ -317,8 +317,10 @@ function Translator(props) {
317
317
  } else {
318
318
  // set translation language for auto detection
319
319
  if (self.props.translationLanguage === 'auto') {
320
- navigator_language = navigator.language || navigator.userLanguage;
321
- translation_language = navigator_language.split('-')[0];
320
+ navigator_language = navigator.language || navigator.userLanguage;
321
+ translation_language = navigator_language.split('-')[0];
322
+ } else {
323
+ translation_language = self.props.translationLanguage;
322
324
  }
323
325
 
324
326
  // set translation language for the dropdown
@@ -467,16 +469,17 @@ function Translator(props) {
467
469
 
468
470
  // ---------------------------------------------------------------------------
469
471
  // agreeAll()
470
- // process current settings from checkboxes for button `agreeAll`
472
+ // process current settings from checkboxes for button 'agreeAll'
473
+ // On 'agreeAll', enable ALL settings required for translation
471
474
  // ---------------------------------------------------------------------------
472
475
  function agreeAll() {
473
- var settings;
474
- var consentSettings = {};
476
+ var translationSettings = gatherOptions(true);
477
+ var consentSettings = {};
475
478
 
476
- settings = gatherOptions();
479
+ // enable and write all settings required for translation (consent cookie)
477
480
  consentSettings = JSON.parse(Cookie.get(self.props.cookieConsentName));
478
- consentSettings.analysis = settings.analysis;
479
- consentSettings.personalization = settings.personalization;
481
+ consentSettings.analysis = translationSettings.analysis;
482
+ consentSettings.personalization = translationSettings.personalization;
480
483
 
481
484
  Cookie.set(
482
485
  self.props.cookieConsentName,
@@ -485,9 +488,11 @@ function Translator(props) {
485
488
  self.props.sameSite,
486
489
  self.props.secure
487
490
  );
491
+
492
+ // enable and write all settings required for translation (translation cookie)
488
493
  Cookie.set(
489
494
  self.props.cookieName,
490
- JSON.stringify(gatherOptions(true)),
495
+ JSON.stringify(translationSettings),
491
496
  self.props.cookieStorageDays,
492
497
  self.props.sameSite,
493
498
  self.props.secure
@@ -12,4 +12,4 @@
12
12
  # See: https://github.com/jekyll-one/J1 Template/blob/master/LICENSE
13
13
  # -----------------------------------------------------------------------------
14
14
  */
15
- function Translator(d){var p=this;var u=log4javascript.getLogger("j1.core.translator");var l=new liteURL(window.location.href);var c=(l.protocol.includes("https"))?true:false;var q=false;var g;var s;this.props={contentURL:"/assets/data/translator",cookieName:"j1.user.state",cookieConsentName:"j1.user.consent",cookieStorageDays:365,cookieSameSite:"Strict",cookieSecure:c,translationEnabled:false,disableLanguageSelector:false,translatorName:"google",translationLanguages:"all",translationLanguage:"auto",translateAllPages:true,hideSuggestionBox:true,hidePoweredBy:true,hideTopFrame:true,dialogLanguage:"content",dialogLanguages:["en","de"],dialogContainerID:"translator-modal",xhrDataElement:"",postSelectionCallback:"",};for(var e in d){this.props[e]=d[e]}if(this.props.dialogLanguage.indexOf("-")!==-1){this.props.dialogLanguage=this.props.dialogLanguage.split("-")[0]}if(!this.props.dialogLanguages.includes(this.props.dialogLanguage)){this.props.dialogLanguage=this.props.dialogLanguages[0]}this.props.xhrDataElement=this.props.xhrDataElement+"-"+this.props.dialogLanguage;u.info("\ninitializing core module: started");u.info("\nstate: started");var f={set:function(x,z,C,y,A){var B=window.btoa(z);var v="";if(C){var w=new Date();w.setTime(w.getTime()+(C*24*60*60*1000));v="; expires="+w.toUTCString()}if(A){document.cookie=x+"="+(B||"")+v+"; Path=/; SameSite="+y+"; secure="+A+";"}else{document.cookie=x+"="+(B||"")+v+"; Path=/; SameSite="+y+";"}},get:function(w){var z=w+"=";var v=document.cookie.split(";");for(var x=0;x<v.length;x++){var B=v[x];while(B.charAt(0)===" "){B=B.substring(1,B.length)}if(B.indexOf(z)===0){var A=B.substring(z.length,B.length);var y=window.atob(A);return y}}return undefined}};var n={documentReady:function(v){if(document.readyState!=="loading"){v()}else{document.addEventListener("DOMContentLoaded",v)}}};function t(){var v={};var w=false;var x=0;var y=arguments.length;if(Object.prototype.toString.call(arguments[0])==="[object Boolean]"){w=arguments[0];x++}var A=function(B){for(var C in B){if(Object.prototype.hasOwnProperty.call(B,C)){if(w&&Object.prototype.toString.call(B[C])==="[object Object]"){v[C]=t(true,v[C],B[C])}else{v[C]=B[C]}}}};for(;x<y;x++){var z=arguments[x];A(z)}return v}function h(A,x){var v=Array.prototype.slice.call(arguments,2);var z=A.split(".");var y=z.pop();for(var w=0;w<z.length;w++){x=x[z[w]]}return x[y].apply(x,v)}function j(w){var v;var x=t({size:0,width:250,multiple:false,selectedIndex:1,enableAutoFilter:false,visibleRows:null,},w);v="#"+x.selector;$.ajax({url:x.url,dataType:"json",success:function(A){var z=[];if(p.props.translationLanguages.includes("all")){z=A[x.elm]}else{for(var y=0;y<A[x.elm].length;y++){if(p.props.translationLanguages.includes(A[x.elm][y].value)){z.push(A[x.elm][y])}}}if(x.visibleRows>z.length){x.visibleRows=z.length}MsDropdown.make(v,{byJson:{data:z,name:x.name,size:x.size,width:x.width,multiple:x.multiple,},enableAutoFilter:x.enableAutoFilter,visibleRows:x.visibleRows,})},error:function(y,A,z){u.error("\nfailed to retrieve JSON data from: "+x.url)}})}function m(){n.documentReady(function(){p.modal=document.getElementById(p.props.dialogContainerID);if(!p.modal){u.info("\nload consent modal");p.modal=document.createElement("div");p.modal.id=p.props.dialogContainerID;p.modal.setAttribute("class","modal fade");p.modal.setAttribute("tabindex","-1");p.modal.setAttribute("role","dialog");p.modal.setAttribute("aria-labelledby",p.props.dialogContainerID);document.body.append(p.modal);p.$modal=$(p.modal);p.$modal.on("show.bs.modal",function(){var w;var x;u.info("\nshow.bs.modal: entered");$.when(j({url:"/assets/data/iso-639-language-codes-flags.json",elm:"iso-639-languages",selector:"dropdownJSON",width:400,visibleRows:8,})).then(function(y){u.info("\ncreating msDropdown from JSON data: finished")})});p.$modal.on("shown.bs.modal",function(){var w=document.getElementById("dropdownJSON").msDropdown;if(!w.length){u.error("\nno msDropdown found in translation dialog");p.$modal.hide()}else{if(p.props.translationLanguage==="auto"){g=navigator.language||navigator.userLanguage;s=g.split("-")[0]}w.selectedIndex=$("#dropdownJSON option[value="+s+"]").index();if(p.props.disableLanguageSelector){w.disabled=true}$("#dropdownJSON").show();$("body").addClass("stop-scrolling")}});p.$modal.on("hidden.bs.modal",function(){$("body").removeClass("stop-scrolling");h(p.props.postSelectionCallback,window)});var v=p.props.contentURL+"/index.html";$.get(v).done(function(w){u.info("\nloading consent modal: successfully");p.modal.innerHTML=w;p.modal.innerHTML=$("#"+p.props.xhrDataElement).eq(0).html();$(p.modal).modal({backdrop:"static",keyboard:false});p.$buttonDoNotAgree=$("#translator-buttonDoNotAgree");p.$buttonAgree=$("#translator-buttonAgree");p.$buttonSave=$("#translator-buttonSave");p.$buttonAgreeAll=$("#translator-buttonAgreeAll");u.info("\nload/initialze options from cookie");k();i();$("#google-options").on("hide.bs.collapse",function(){q=false;k()}).on("show.bs.collapse",function(){q=true;k()});u.info("\ninitialze button event handler");p.$buttonDoNotAgree.click(function(){b()});p.$buttonAgree.click(function(){o()});p.$buttonSave.click(function(){$("#google-options").collapse("hide");r();i()});p.$buttonAgreeAll.click(function(){$("#google-options").collapse("hide");o()})}).fail(function(){u.error("\nloading translator dialog (modal): failed");u.warn("\nprobably no|wrong `contentURL` set")})}else{p.$modal.modal("show")}}.bind(this))}function i(){var x=p.getSettings();if(x){for(var w in x){var v=p.$modal.find("#google-options .translator-option[data-name="+w+'] input[type="checkbox"]');v.prop("checked",x[w])}}}function k(){if(q){p.$buttonDoNotAgree.hide();p.$buttonAgree.hide();p.$buttonSave.show();p.$buttonAgreeAll.show()}else{p.$buttonDoNotAgree.show();p.$buttonAgree.show();p.$buttonSave.hide();p.$buttonAgreeAll.hide()}}function a(w){var v=p.$modal.find("#google-options .translator-option");var y={};for(var z=0;z<v.length;z++){var B=v[z];var x=B.getAttribute("data-name");if(x==="necessary"){y[x]=true}else{if(w===undefined){var A=$(B).find('input[type="checkbox"]');y[x]=A.prop("checked")}else{y[x]=!!w}}}return y}function o(){var w;var v={};w=a();v=JSON.parse(f.get(p.props.cookieConsentName));v.analysis=w.analysis;v.personalization=w.personalization;f.set(p.props.cookieConsentName,JSON.stringify(v),p.props.cookieStorageDays,p.props.sameSite,p.props.secure);f.set(p.props.cookieName,JSON.stringify(a(true)),p.props.cookieStorageDays,p.props.sameSite,p.props.secure);p.$modal.modal("hide")}function b(){var v=a();v.translationEnabled=false;f.set(p.props.cookieName,JSON.stringify(v),p.props.cookieStorageDays,p.props.sameSite,p.props.secure);p.$modal.modal("hide")}function r(){var w;var v={};w=a();v=JSON.parse(f.get(p.props.cookieConsentName));v.analysis=w.analysis;v.personalization=w.personalization;f.set(p.props.cookieConsentName,JSON.stringify(v),p.props.cookieStorageDays,p.props.sameSite,p.props.secure);f.set(p.props.cookieName,JSON.stringify(a()),p.props.cookieStorageDays,p.props.sameSite,p.props.secure);p.$modal.modal("hide")}this.showDialog=function(){m()};this.getSettings=function(w){var v=f.get(p.props.cookieName);if(v){var x=JSON.parse(f.get(p.props.cookieName));if(w===undefined){return x}else{if(x){return x[w]}else{return false}}}else{return undefined}};u.info("\ninitializing core module finished");u.info("\nstate: finished")};
15
+ function Translator(o){function e(){var o={},t=!1,n=0,a=arguments.length;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(t=arguments[0],n++);for(var i=function(n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t&&"[object Object]"===Object.prototype.toString.call(n[a])?o[a]=e(!0,o[a],n[a]):o[a]=n[a])};a>n;n++){var s=arguments[n];i(s)}return o}function t(o,e){for(var t=Array.prototype.slice.call(arguments,2),n=o.split("."),a=n.pop(),i=0;i<n.length;i++)e=e[n[i]];return e[a].apply(e,t)}function n(o){var t,n=e({size:0,width:250,multiple:!1,selectedIndex:1,enableAutoFilter:!1,visibleRows:null},o);t="#"+n.selector,$.ajax({url:n.url,dataType:"json",success:function(o){var e=[];if(u.props.translationLanguages.includes("all"))e=o[n.elm];else for(var a=0;a<o[n.elm].length;a++)u.props.translationLanguages.includes(o[n.elm][a].value)&&e.push(o[n.elm][a]);n.visibleRows>e.length&&(n.visibleRows=e.length),MsDropdown.make(t,{byJson:{data:e,name:n.name,size:n.size,width:n.width,multiple:n.multiple},enableAutoFilter:n.enableAutoFilter,visibleRows:n.visibleRows})},error:function(o,e,t){m.error("\nfailed to retrieve JSON data from: "+n.url)}})}function a(){k.documentReady(function(){if(u.modal=document.getElementById(u.props.dialogContainerID),u.modal)u.$modal.modal("show");else{m.info("\nload consent modal"),u.modal=document.createElement("div"),u.modal.id=u.props.dialogContainerID,u.modal.setAttribute("class","modal fade"),u.modal.setAttribute("tabindex","-1"),u.modal.setAttribute("role","dialog"),u.modal.setAttribute("aria-labelledby",u.props.dialogContainerID),document.body.append(u.modal),u.$modal=$(u.modal),u.$modal.on("show.bs.modal",function(){m.info("\nshow.bs.modal: entered"),$.when(n({url:"/assets/data/iso-639-language-codes-flags.json",elm:"iso-639-languages",selector:"dropdownJSON",width:400,visibleRows:8})).then(function(o){m.info("\ncreating msDropdown from JSON data: finished")})}),u.$modal.on("shown.bs.modal",function(){var o=document.getElementById("dropdownJSON").msDropdown;o.length?("auto"===u.props.translationLanguage?(p=navigator.language||navigator.userLanguage,g=p.split("-")[0]):g=u.props.translationLanguage,o.selectedIndex=$("#dropdownJSON option[value="+g+"]").index(),u.props.disableLanguageSelector&&(o.disabled=!0),$("#dropdownJSON").show(),$("body").addClass("stop-scrolling")):(m.error("\nno msDropdown found in translation dialog"),u.$modal.hide())}),u.$modal.on("hidden.bs.modal",function(){$("body").removeClass("stop-scrolling"),t(u.props.postSelectionCallback,window)});var o=u.props.contentURL+"/index.html";$.get(o).done(function(o){m.info("\nloading consent modal: successfully"),u.modal.innerHTML=o,u.modal.innerHTML=$("#"+u.props.xhrDataElement).eq(0).html(),$(u.modal).modal({backdrop:"static",keyboard:!1}),u.$buttonDoNotAgree=$("#translator-buttonDoNotAgree"),u.$buttonAgree=$("#translator-buttonAgree"),u.$buttonSave=$("#translator-buttonSave"),u.$buttonAgreeAll=$("#translator-buttonAgreeAll"),m.info("\nload/initialze options from cookie"),s(),i(),$("#google-options").on("hide.bs.collapse",function(){b=!1,s()}).on("show.bs.collapse",function(){b=!0,s()}),m.info("\ninitialze button event handler"),u.$buttonDoNotAgree.click(function(){d()}),u.$buttonAgree.click(function(){l()}),u.$buttonSave.click(function(){$("#google-options").collapse("hide"),c(),i()}),u.$buttonAgreeAll.click(function(){$("#google-options").collapse("hide"),l()})}).fail(function(){m.error("\nloading translator dialog (modal): failed"),m.warn("\nprobably no|wrong `contentURL` set")})}}.bind(this))}function i(){var o=u.getSettings();if(o)for(var e in o){var t=u.$modal.find("#google-options .translator-option[data-name="+e+'] input[type="checkbox"]');t.prop("checked",o[e])}}function s(){b?(u.$buttonDoNotAgree.hide(),u.$buttonAgree.hide(),u.$buttonSave.show(),u.$buttonAgreeAll.show()):(u.$buttonDoNotAgree.show(),u.$buttonAgree.show(),u.$buttonSave.hide(),u.$buttonAgreeAll.hide())}function r(o){for(var e=u.$modal.find("#google-options .translator-option"),t={},n=0;n<e.length;n++){var a=e[n],i=a.getAttribute("data-name");if("necessary"===i)t[i]=!0;else if(void 0===o){var s=$(a).find('input[type="checkbox"]');t[i]=s.prop("checked")}else t[i]=!!o}return t}function l(){var o=r(!0),e={};e=JSON.parse(v.get(u.props.cookieConsentName)),e.analysis=o.analysis,e.personalization=o.personalization,v.set(u.props.cookieConsentName,JSON.stringify(e),u.props.cookieStorageDays,u.props.sameSite,u.props.secure),v.set(u.props.cookieName,JSON.stringify(o),u.props.cookieStorageDays,u.props.sameSite,u.props.secure),u.$modal.modal("hide")}function d(){var o=r();o.translationEnabled=!1,v.set(u.props.cookieName,JSON.stringify(o),u.props.cookieStorageDays,u.props.sameSite,u.props.secure),u.$modal.modal("hide")}function c(){var o,e={};o=r(),e=JSON.parse(v.get(u.props.cookieConsentName)),e.analysis=o.analysis,e.personalization=o.personalization,v.set(u.props.cookieConsentName,JSON.stringify(e),u.props.cookieStorageDays,u.props.sameSite,u.props.secure),v.set(u.props.cookieName,JSON.stringify(r()),u.props.cookieStorageDays,u.props.sameSite,u.props.secure),u.$modal.modal("hide")}var p,g,u=this,m=log4javascript.getLogger("j1.core.translator"),h=new liteURL(window.location.href),f=h.protocol.includes("https")?!0:!1,b=!1;this.props={contentURL:"/assets/data/translator",cookieName:"j1.user.state",cookieConsentName:"j1.user.consent",cookieStorageDays:365,cookieSameSite:"Strict",cookieSecure:f,translationEnabled:!1,disableLanguageSelector:!1,translatorName:"google",translationLanguages:"all",translationLanguage:"auto",translateAllPages:!0,hideSuggestionBox:!0,hidePoweredBy:!0,hideTopFrame:!0,dialogLanguage:"content",dialogLanguages:["en","de"],dialogContainerID:"translator-modal",xhrDataElement:"",postSelectionCallback:""};for(var S in o)this.props[S]=o[S];-1!==this.props.dialogLanguage.indexOf("-")&&(this.props.dialogLanguage=this.props.dialogLanguage.split("-")[0]),this.props.dialogLanguages.includes(this.props.dialogLanguage)||(this.props.dialogLanguage=this.props.dialogLanguages[0]),this.props.xhrDataElement=this.props.xhrDataElement+"-"+this.props.dialogLanguage,m.info("\ninitializing core module: started"),m.info("\nstate: started");var v={set:function(o,e,t,n,a){var i=window.btoa(e),s="";if(t){var r=new Date;r.setTime(r.getTime()+24*t*60*60*1e3),s="; expires="+r.toUTCString()}a?document.cookie=o+"="+(i||"")+s+"; Path=/; SameSite="+n+"; secure="+a+";":document.cookie=o+"="+(i||"")+s+"; Path=/; SameSite="+n+";"},get:function(o){for(var e=o+"=",t=document.cookie.split(";"),n=0;n<t.length;n++){for(var a=t[n];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(e)){var i=a.substring(e.length,a.length),s=window.atob(i);return s}}return void 0}},k={documentReady:function(o){"loading"!==document.readyState?o():document.addEventListener("DOMContentLoaded",o)}};this.showDialog=function(){a()},this.getSettings=function(o){var e=v.get(u.props.cookieName);if(e){var t=JSON.parse(v.get(u.props.cookieName));return void 0===o?t:t?t[o]:!1}return void 0},m.info("\ninitializing core module finished"),m.info("\nstate: finished")}
@@ -96,7 +96,7 @@
96
96
  buttonsHTML += '</span>';
97
97
  buttonsHTML += '</div>';
98
98
 
99
- h.$id = "#" + h.$el["0"].id;
99
+ h.$id = "#void" + 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="#"+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);
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="#void"+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);