Shortcodes Ultimate - Version 5.9.1

Version Description

Download this release

Release Info

Developer gn_themes
Plugin Icon 128x128 Shortcodes Ultimate
Version 5.9.1
Comparing to
See all releases

Code changes from version 5.9.0 to 5.9.1

changelog.txt CHANGED
@@ -1,3 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ### 5.8.1
2
 
3
  **What's new**
1
+ ### 5.9.0
2
+
3
+ **Important changes**
4
+
5
+ Slider and Carousel shortcodes are marked as deprecated. These shortcodes will disappaer from the *Available shortcodes* page and from the *Insert shortcode* window. Deprecated shortcodes will continue to work, but you'll not be able to insert them.
6
+
7
+ You can enable deprecated shortcodes from *Dashboard → Shortcodes → Settings → Advanced settings* screen, but that's not recommended.
8
+
9
+ Use [su_image_carousel](https://getshortcodes.com/docs/image-carousel/) instead, it has more options, and much more reliable.
10
+
11
+ **What's new**
12
+
13
+ - `[su_image_carousel]` now supports media taxonomies
14
+ - New options `min_width` and `max_width` for `[su_lightbox_content]` shortcode
15
+
16
+ **Fixes**
17
+
18
+ - Fixed fatal errors `WP_Error` in `[su_slider]` and `[su_custom_gallery]`
19
+ - Fixed PHP notice `undefined variable` in `[su_post]` shortcode
20
+ - Fixed PHP notice `top_link` in `[su_divider]` shortcode
21
+ - Fixed PHP notice `filter_content` in `[su_post]` shortcode
22
+ - Fixed `related` option in `[su_dailymotion]` shortcode
23
+ - Fixed non-working *Slide Link* issue with `[su_custom_gallery]`
24
+ - Minor improvement to `[su_image_carousel]`
25
+ - Minor UI improvements
26
+
27
+
28
  ### 5.8.1
29
 
30
  **What's new**
inc/core/assets.php CHANGED
@@ -87,7 +87,6 @@ class Su_Assets {
87
  'presets_prompt_msg' => __( 'Please enter a name for new preset', 'shortcodes-ultimate' ),
88
  'presets_prompt_value' => __( 'New preset', 'shortcodes-ultimate' ),
89
  'last_used' => __( 'Last used settings', 'shortcodes-ultimate' ),
90
- 'hotkey' => get_option( 'su_option_hotkey' )
91
  ) );
92
  // Shortcodes stylesheets
93
  wp_register_style( 'su-shortcodes', plugins_url( 'includes/css/shortcodes.css', SU_PLUGIN_FILE ), false, SU_PLUGIN_VERSION, 'all' );
87
  'presets_prompt_msg' => __( 'Please enter a name for new preset', 'shortcodes-ultimate' ),
88
  'presets_prompt_value' => __( 'New preset', 'shortcodes-ultimate' ),
89
  'last_used' => __( 'Last used settings', 'shortcodes-ultimate' ),
 
90
  ) );
91
  // Shortcodes stylesheets
92
  wp_register_style( 'su-shortcodes', plugins_url( 'includes/css/shortcodes.css', SU_PLUGIN_FILE ), false, SU_PLUGIN_VERSION, 'all' );
includes/class-shortcodes-ultimate-activator.php CHANGED
@@ -91,13 +91,7 @@ class Shortcodes_Ultimate_Activator {
91
  $defaults = su_get_config( 'default-settings' );
92
 
93
  foreach ( $defaults as $option => $value ) {
94
-
95
- if ( get_option( $option, 0 ) !== 0 ) {
96
- continue;
97
- }
98
-
99
- update_option( $option, $value, false );
100
-
101
  }
102
 
103
  }
91
  $defaults = su_get_config( 'default-settings' );
92
 
93
  foreach ( $defaults as $option => $value ) {
94
+ add_option( $option, $value );
 
 
 
 
 
 
95
  }
96
 
97
  }
includes/class-shortcodes-ultimate-upgrade.php CHANGED
@@ -67,6 +67,7 @@ final class Shortcodes_Ultimate_Upgrade {
67
  $this->maybe_upgrade_to( '5.2.0' );
68
  $this->maybe_upgrade_to( '5.4.0' );
69
  $this->maybe_upgrade_to( '5.6.0' );
 
70
 
71
  $this->update_saved_version();
72
 
@@ -80,7 +81,7 @@ final class Shortcodes_Ultimate_Upgrade {
80
  */
81
  private function maybe_upgrade_to( $version ) {
82
 
83
- if ( ! $this->is_saved_version_less_than( $version ) ) {
84
  return;
85
  }
86
 
@@ -114,17 +115,17 @@ final class Shortcodes_Ultimate_Upgrade {
114
  * @return boolean True if plugin was updated, False otherwise.
115
  */
116
  private function is_version_changed() {
117
- return $this->is_saved_version_less_than( $this->current_version );
118
  }
119
 
120
  /**
121
- * Conditional check if previous version of the plugin less than passed one.
122
  *
123
  * @since 5.0.0
124
  * @access private
125
- * @return boolean True if previous version of the plugin less than passed one, False otherwise.
126
  */
127
- private function is_saved_version_less_than( $version ) {
128
 
129
  return version_compare(
130
  get_option( $this->saved_version_option, 0 ),
67
  $this->maybe_upgrade_to( '5.2.0' );
68
  $this->maybe_upgrade_to( '5.4.0' );
69
  $this->maybe_upgrade_to( '5.6.0' );
70
+ $this->maybe_upgrade_to( '5.9.1' );
71
 
72
  $this->update_saved_version();
73
 
81
  */
82
  private function maybe_upgrade_to( $version ) {
83
 
84
+ if ( ! $this->is_saved_version_lower_than( $version ) ) {
85
  return;
86
  }
87
 
115
  * @return boolean True if plugin was updated, False otherwise.
116
  */
117
  private function is_version_changed() {
118
+ return $this->is_saved_version_lower_than( $this->current_version );
119
  }
120
 
121
  /**
122
+ * Conditional check if previous version of the plugin lower than passed one.
123
  *
124
  * @since 5.0.0
125
  * @access private
126
+ * @return boolean True if previous version of the plugin lower than passed one, False otherwise.
127
  */
128
+ private function is_saved_version_lower_than( $version ) {
129
 
130
  return version_compare(
131
  get_option( $this->saved_version_option, 0 ),
includes/js/generator/index.js CHANGED
@@ -1,2 +1,2 @@
1
- !function s(o,i,u){function c(t,e){if(!i[t]){if(!o[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(l)return l(t,!0);var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}var a=i[t]={exports:{}};o[t][0].call(a.exports,function(e){return c(o[t][1][e]||e)},a,a.exports,s,o,i,u)}return i[t].exports}for(var l="function"==typeof require&&require,e=0;e<u.length;e++)c(u[e]);return c}({1:[function(e,t,r){"use strict";function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var p,o,i,u,n,c,l,g,d,a,f,h;window.SUG={},window.SUG.App=(p=jQuery,o=p("#su-generator"),i=p("#su-generator-search"),u=p("#su-generator-filter"),n=u.children("a"),c=p("#su-generator-choices"),l=c.find("span"),g=p("#su-generator-settings"),d=p("#su-compatibility-mode-prefix"),a=p("#su-generator-result"),f=p("#su-generator-selected"),(h={state:{mceSelection:"",target:"",wpActiveEditor:null,context:"",insertArgs:"",preview:{timer:null,request:null}}}).el={body:p("body")},h.init=function(){var a;n.click(function(e){var t=p(this).data("filter");if("all"===t)l.css({opacity:1}).removeClass("su-generator-choice-first");else{var r=new RegExp(t,"gi");l.css({opacity:.2}),l.each(function(){null!==p(this).data("group").match(r)&&p(this).css({opacity:1}).removeClass("su-generator-choice-first")})}e.preventDefault()}),p("#su-generator").on("click",".su-generator-home",function(e){i.val(""),g.html("").hide(),o.removeClass("su-generator-narrow"),u.show(),c.show(),l.show(),h.state.mceSelection="",i.focus(),e.preventDefault()}),p("#su-generator").on("click",".su-generator-close",function(e){p.magnificPopup.close(),e.preventDefault()}),i.on({focus:function(){p(this).val(""),g.html("").hide(),o.removeClass("su-generator-narrow"),c.show(),l.css({opacity:1}).removeClass("su-generator-choice-first"),u.show()},blur:function(){},keyup:function(e){var t=p(".su-generator-choice-first:first"),n=p(this).val(),a=new RegExp(n,"gi"),s=0;13===e.keyCode&&0<t.length&&(e.preventDefault(),p(this).val("").blur(),t.trigger("click")),l.css({opacity:.2}).removeClass("su-generator-choice-first"),l.each(function(){var e=p(this).data(),t=e.shortcode,r=[t,e.name,e.desc,e.group].join(" ").match(a);null!==r&&(p(this).css({opacity:1}),n===t?(l.removeClass("su-generator-choice-first"),p(this).addClass("su-generator-choice-first"),s=999):r.length>s&&(l.removeClass("su-generator-choice-first"),p(this).addClass("su-generator-choice-first"),s=r.length))}),""===n&&l.removeClass("su-generator-choice-first")}}),l.on("click",function(e){var r=p(this).data("shortcode");p.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_settings",shortcode:r},beforeSend:function(){p("#su-generator-preview").hide(),c.hide(),g.addClass("su-generator-loading").show(),o.addClass("su-generator-narrow"),u.hide()},success:function(e){g.removeClass("su-generator-loading"),g.html(e);var t=p("#su-generator-content");void 0!==h.state.mceSelection&&""!==h.state.mceSelection&&"hidden"!==t.attr("type")&&t.val(h.state.mceSelection),p(".su-generator-range-picker").each(function(e){var t=p(this).find("input"),r=t.attr("min"),n=t.attr("max"),a=t.attr("step");t.simpleSlider({snap:!0,step:a,range:[r,n]}),t.show(),t.on("keyup blur",function(e){t.simpleSlider("setValue",t.val())})}),p(".su-generator-select-color").each(function(e){p(this).find(".su-generator-select-color-wheel").filter(":first").farbtastic(".su-generator-select-color-value:eq("+e+")"),p(this).find(".su-generator-select-color-value").focus(function(){p(".su-generator-select-color-wheel:eq("+e+")").show()}),p(this).find(".su-generator-select-color-value").blur(function(){p(".su-generator-select-color-wheel:eq("+e+")").hide()})}),p(".su-generator-isp").each(function(){function n(){var e="none",t="",r=i.val();if("media"===r){var n=[];u.find("span").each(function(e){n[e]=p(this).data("id")}),0<n.length&&(t=n.join(","))}else if("category"===r){var a=c.val()||[];0<a.length&&(t=a.join(","))}else if("taxonomy"===r){var s=l.val()||"",o=g.val()||[];"0"!==s&&0<o.length&&(e="taxonomy: "+s+"/"+o.join(","))}else e="0"===r?"none":r;""!==t&&(e=r+": "+t),d.val(e).trigger("change")}var t,r=p(this),i=r.find(".su-generator-isp-sources"),a=r.find(".su-generator-isp-source"),e=r.find(".su-generator-isp-add-media"),u=r.find(".su-generator-isp-images"),c=r.find(".su-generator-isp-categories"),l=r.find(".su-generator-isp-taxonomies"),g=p(".su-generator-isp-terms"),d=r.find(".su-generator-attr");i.on("change",function(e){var t=p(this).val();e.preventDefault(),a.removeClass("su-generator-isp-source-open"),-1===t.indexOf(":")&&r.find(".su-generator-isp-source-"+t).addClass("su-generator-isp-source-open"),n()}),u.on("click","span i",function(){p(this).parent("span").css("border-color","#f03").fadeOut(300,function(){p(this).remove(),n()})}),e.click(function(e){e.preventDefault(),void 0!==t&&t.close(),(t=wp.media.frames.su_media_frame_1=wp.media({title:SUGL10n.isp_media_title,library:{type:"image"},button:{text:SUGL10n.isp_media_insert},multiple:!0})).on("open",function(){p(".mfp-wrap").addClass("hidden")}),t.on("close",function(){p(".mfp-wrap").removeClass("hidden")}),t.on("select",function(){var e=t.state().get("selection").toJSON();u.find("em").remove(),p.each(e,function(e){u.append('<span data-id="'+this.id+'" title="'+this.title+'"><img src="'+this.url+'" alt="" /><i class="sui sui-times"></i></span>')}),n()}).open()}),u.sortable({revert:200,containment:r,tolerance:"pointer",stop:function(){n()}}),c.on("change",n),g.on("change",n),l.on("change",function(){var t=p(this).parents(".su-generator-isp-source"),e=p(this).val();if(g.hide().find("option").remove(),n(),"0"!==e)var r=p.ajax({url:ajaxurl,type:"post",dataType:"html",data:{action:"su_generator_get_terms",tax:e,class:"su-generator-isp-terms",multiple:!0,size:10},beforeSend:function(){"object"===s(r)&&r.abort(),g.html("").attr("disabled",!0).hide(),t.addClass("su-generator-loading")},success:function(e){g.html(e).attr("disabled",!1).show(),t.removeClass("su-generator-loading")}})})}),p(".su-generator-upload-button").each(function(){var t,e=p(this),r=p(this).parents(".su-generator-attr-container").find("input:text");e.on("click",function(e){e.preventDefault(),e.stopPropagation(),void 0!==t&&t.close(),(t=wp.media.frames.su_media_frame_2=wp.media({title:SUGL10n.upload_title,button:{text:SUGL10n.upload_insert},multiple:!1})).on("select",function(){var e=t.state().get("selection").first().toJSON();r.val(e.url).trigger("change")}),t.on("open",function(){p(".mfp-wrap").addClass("hidden")}),t.on("close",function(){p(".mfp-wrap").removeClass("hidden")}),t.open()})}),p(".su-generator-icon-picker-button").each(function(){var e=p(this),t=p(this).parents(".su-generator-attr-container"),n=t.find(".su-generator-attr"),a=t.find(".su-generator-icon-picker"),s=a.find("input:text");e.click(function(e){a.toggleClass("su-generator-icon-picker-visible"),s.val("").trigger("keyup"),a.hasClass("su-generator-icon-picker-loaded")||(p.ajax({type:"post",url:ajaxurl,data:{action:"su_generator_get_icons"},dataType:"html",beforeSend:function(){a.addClass("su-generator-loading"),a.addClass("su-generator-icon-picker-loaded")},success:function(e){a.append(e);var r=a.children("i");r.click(function(e){n.val("icon: "+p(this).attr("title")),a.removeClass("su-generator-icon-picker-visible"),n.trigger("change"),e.preventDefault()}),s.on({keyup:function(){var e=p(this).val(),t=new RegExp(e,"gi");r.hide(),r.each(function(){null!==p(this).attr("title").match(t)&&p(this).show()})},focus:function(){p(this).val(""),r.show()}}),a.removeClass("su-generator-loading")}}),e.preventDefault())})}),p(".su-generator-switch").click(function(e){var t=p(this).parent().children("input");"yes"===t.val()?t.val("no").trigger("change"):t.val("yes").trigger("change"),e.preventDefault()}),p(".su-generator-switch-value").on("change",function(){var e=p(this),t=e.parent().children(".su-generator-switch"),r=e.val();"yes"===r?t.removeClass("su-generator-switch-no").addClass("su-generator-switch-yes"):"no"===r&&t.removeClass("su-generator-switch-yes").addClass("su-generator-switch-no")}),p("select#su-generator-attr-taxonomy_1").on("change",function(){var e=p(this).val(),t=p("select#su-generator-attr-tax_terms_1");window.su_generator_get_terms=p.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_get_terms",tax:e,noselect:!0},dataType:"html",beforeSend:function(){"object"===s(window.su_generator_get_terms)&&window.su_generator_get_terms.abort(),t.parent().addClass("su-generator-loading")},success:function(e){t.find("option").remove(),t.append(e),t.parent().removeClass("su-generator-loading")}})}),p(".su-generator-shadow-picker").each(function(e){var t=p(this),r=t.find(".su-generator-shadow-picker-field input"),n=t.find(".su-generator-sp-hoff"),a=t.find(".su-generator-sp-voff"),s=t.find(".su-generator-sp-blur"),o={cnt:t.find(".su-generator-shadow-picker-color"),value:t.find(".su-generator-shadow-picker-color-value"),wheel:t.find(".su-generator-shadow-picker-color-wheel")},i=t.find(".su-generator-attr");o.wheel.farbtastic(o.value),o.value.focus(function(){o.wheel.show()}),o.value.blur(function(){o.wheel.hide()}),r.on("change blur keyup",function(){i.val(n.val()+"px "+a.val()+"px "+s.val()+"px "+o.value.val()).trigger("change")}),i.on("keyup",function(){var e=p(this).val().split(" ");4===e.length&&(n.val(e[0].replace("px","")),a.val(e[1].replace("px","")),s.val(e[2].replace("px","")),o.value.val(e[3]),r.trigger("keyup"))})}),p(".su-generator-border-picker").each(function(e){var t=p(this),r=t.find(".su-generator-border-picker-field input, .su-generator-border-picker-field select"),n=t.find(".su-generator-bp-width"),a=t.find(".su-generator-bp-style"),s={cnt:t.find(".su-generator-border-picker-color"),value:t.find(".su-generator-border-picker-color-value"),wheel:t.find(".su-generator-border-picker-color-wheel")},o=t.find(".su-generator-attr");s.wheel.farbtastic(s.value),s.value.focus(function(){s.wheel.show()}),s.value.blur(function(){s.wheel.hide()}),r.on("change blur keyup",function(){o.val(n.val()+"px "+a.val()+" "+s.value.val()).trigger("change")}),o.on("keyup",function(){var e=p(this).val().split(" ");3===e.length&&(n.val(e[0].replace("px","")),a.val(e[1]),s.value.val(e[2]),r.trigger("keyup"))})}),g.find(".su-generator-attr").on("change keyup blur",function(){var e=p(this).parents(".su-generator-attr-container"),t=e.data("default");p(this).val()!=t?e.removeClass("su-generator-skip"):e.addClass("su-generator-skip")}),p(".su-generator-set-value").click(function(e){p(this).parents(".su-generator-attr-container").find("input").val(p(this).text()).trigger("change")}),f.val(r),p.ajax({type:"GET",url:ajaxurl,data:{action:"su_generator_get_preset",id:"last_used",shortcode:r},beforeSend:function(){},success:function(e){h.setSettings(e);var t=p("#su-generator-content");void 0!==h.state.mceSelection&&""!==h.state.mceSelection&&"hidden"!==t.attr("type")&&t.val(h.state.mceSelection)},dataType:"json"})},dataType:"html"})}),p("#su-generator").on("click",".su-generator-insert",h.insertShortcode),p("#su-generator").on("click",".su-generator-toggle-preview",function(e){var t=p("#su-generator-preview");p(this).hide(),t.addClass("su-generator-loading").show(),g.find("input, textarea, select").on("change keyup blur",function(){h.updatePreview()}),h.updatePreview(!0),e.preventDefault()}),p("#su-generator").on("mouseenter click",".su-generator-presets",function(){clearTimeout(a),p(".su-gp-popup").show()}),p("#su-generator").on("mouseleave",".su-generator-presets",function(){a=window.setTimeout(function(){p(".su-gp-popup").fadeOut(200)},600)}),p("#su-generator").on("click",".su-gp-new",function(e){p(this).parents(".su-generator-presets");var t=p(".su-gp-list"),r=(new Date).getTime(),n=prompt(SUGL10n.presets_prompt_msg,SUGL10n.presets_prompt_value);""!==n&&null!==n&&(t.find("b").hide(),t.append('<span data-id="'+r+'"><em>'+n+'</em><i class="sui sui-times"></i></span>'),h.addPreset(r,n))}),p("#su-generator").on("click",".su-gp-list span",function(e){var t=p(".su-generator-presets").data("shortcode"),r=p(this).data("id"),n=p(".su-generator-insert");p(".su-gp-popup").hide(),clearTimeout(a),p.ajax({type:"GET",url:ajaxurl,data:{action:"su_generator_get_preset",id:r,shortcode:t},beforeSend:function(){n.addClass("button-primary-disabled").attr("disabled",!0)},success:function(e){n.removeClass("button-primary-disabled").attr("disabled",!1),h.setSettings(e)},dataType:"json"}),e.preventDefault(),e.stopPropagation()}),p("#su-generator").on("click",".su-gp-list i",function(e){var t=p(this).parents(".su-gp-list"),r=p(this).parent("span"),n=r.data("id");r.remove(),t.find("span").length<1&&t.find("b").show(),h.removePreset(n),e.stopPropagation(),e.preventDefault()})},h.addPreset=function(e,t){var r=p(".su-generator-presets").data("shortcode"),n=h.getSettings();p.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_add_preset",id:e,name:t,shortcode:r,settings:n}})},h.removePreset=function(e){var t=p(".su-generator-presets").data("shortcode");p.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_remove_preset",id:e,shortcode:t}})},h.parseSettings=function(){var e="on"===p("#su-generator-option-skip").val()?"#su-generator-settings .su-generator-attr-container:not(.su-generator-skip) .su-generator-attr":"#su-generator-settings .su-generator-attr-container .su-generator-attr",t=f.val(),r=d.val(),n=p(e),a=p("textarea#su-generator-content"),s=a.length?a.val():"false",o=new String("");return o+="["+r+t,n.each(function(){var e=p(this),t="";null==(t=e.is("select")?e.find("option:selected").val():e.val())?t="":"array"==typeof t&&(t=t.join(",")),""!==t&&(o+=" "+p(this).attr("name")+'="'+p(this).val().toString().replace(/"/gi,"'")+'"')}),o+="]","false"!=s&&(o+=s+"[/"+r+t+"]"),o},h.getSettings=function(){f.val();var e=p("#su-generator-settings .su-generator-attr"),t=p("textarea#su-generator-content"),r=t.length?t.val():"false",a={};return e.each(function(e){var t=p(this),r="",n=t.attr("name");null==(r=t.is("select")?t.find("option:selected").val():t.val())&&(r=""),a[n]=r}),a.content=r.toString(),a},h.setSettings=function(r){var e=p("#su-generator-settings .su-generator-attr"),t=p("#su-generator-content");e.each(function(){var e=p(this),t=e.attr("name");r.hasOwnProperty(t)&&(e.val(r[t]),e.trigger("keyup").trigger("change").trigger("blur"))}),r.hasOwnProperty("content")&&t.val(r.content).trigger("keyup").trigger("change").trigger("blur"),h.updatePreview()},h.updatePreview=function(e){var t=p("#su-generator-preview"),r=h.parseSettings(),n=a.text();e=e||!1,t.is(":visible")&&(r===n&&!e||(window.clearTimeout(h.state.preview.timer),h.state.preview.timer=window.setTimeout(function(){h.state.preview.request=p.ajax({type:"POST",url:ajaxurl,cache:!1,data:{action:"su_generator_preview",shortcode:r},beforeSend:function(){h.state.preview.request&&h.state.preview.request.abort(),t.addClass("su-generator-loading").html("")},success:function(e){t.html(e).removeClass("su-generator-loading")},dataType:"html"})},300),a.text(r)))},h.insert=function(e,t){if("string"==typeof e&&"object"===s(t)){h.state.context=e;var r=(h.state.insertArgs=t).shortcode||"",n={type:"inline",alignTop:!0,closeOnBgClick:!1,mainClass:"su-generator-mfp",items:{src:"#su-generator"},callbacks:{}};n.callbacks.open=function(){r?l.filter('[data-shortcode="'.concat(r,'"]')).trigger("click"):window.setTimeout(function(){return i.focus()},200),"undefined"!=typeof tinyMCE&&null!=tinyMCE.activeEditor&&tinyMCE.activeEditor.hasOwnProperty("selection")&&(h.state.mceSelection=tinyMCE.activeEditor.selection.getContent({format:"text"}))},n.callbacks.close=function(){i.val(""),g.html("").hide(),o.removeClass("su-generator-narrow"),u.show(),c.show(),l.show(),h.state.mceSelection=""},p.magnificPopup.open(n)}},h.insertShortcode=function(){var e=h.parseSettings();if(h.addPreset("last_used",SUGL10n.last_used),p.magnificPopup.close(),a.text(e),"classic"===h.state.context)h.state.wpActiveEditor=window.wpActiveEditor,window.wpActiveEditor=h.state.insertArgs.editorID,window.wp.media.editor.insert(e),window.wpActiveEditor=h.state.wpActiveEditor;else if("block"===h.state.context){var t=h.state.insertArgs.props;if(t.attributes.hasOwnProperty("content"))t.setAttributes({content:t.attributes.content+e});else if("core/shortcode"===t.name){var r=t.attributes.hasOwnProperty("text")?t.attributes.text:"";t.setAttributes({text:r+e})}}},h.insertAtCaret=function(e,t){var r=e.selectionStart;e.selectionEnd,e.value=e.value.substring(0,r)+t+e.value.substring(r),e.focus(),e.selectionStart=r+t.length},{init:h.init,insert:h.insert}),jQuery(document).ready(window.SUG.App.init)},{}]},{},[1]);
2
  //# sourceMappingURL=index.js.map
1
+ !function s(o,i,u){function c(t,e){if(!i[t]){if(!o[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(l)return l(t,!0);var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}var a=i[t]={exports:{}};o[t][0].call(a.exports,function(e){return c(o[t][1][e]||e)},a,a.exports,s,o,i,u)}return i[t].exports}for(var l="function"==typeof require&&require,e=0;e<u.length;e++)c(u[e]);return c}({1:[function(e,t,r){"use strict";function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var p,o,i,u,n,c,l,g,d,a,f,h;window.SUG={},window.SUG.App=(p=jQuery,o=p("#su-generator"),i=p("#su-generator-search"),u=p("#su-generator-filter"),n=u.children("a"),c=p("#su-generator-choices"),l=c.find("span"),g=p("#su-generator-settings"),d=p("#su-compatibility-mode-prefix"),a=p("#su-generator-result"),f=p("#su-generator-selected"),(h={state:{mceSelection:"",target:"",wpActiveEditor:null,context:"",insertArgs:"",preview:{timer:null,request:null}}}).el={body:p("body")},h.init=function(){var a;n.click(function(e){var t=p(this).data("filter");if("all"===t)l.css({opacity:1}).removeClass("su-generator-choice-first");else{var r=new RegExp(t,"gi");l.css({opacity:.2}),l.each(function(){null!==p(this).data("group").match(r)&&p(this).css({opacity:1}).removeClass("su-generator-choice-first")})}e.preventDefault()}),p("#su-generator").on("click",".su-generator-home",function(e){i.val(""),g.html("").hide(),o.removeClass("su-generator-narrow"),u.show(),c.show(),l.show(),h.state.mceSelection="",i.focus(),e.preventDefault()}),p("#su-generator").on("click",".su-generator-close",function(e){p.magnificPopup.close(),e.preventDefault()}),i.on({focus:function(){p(this).val(""),g.html("").hide(),o.removeClass("su-generator-narrow"),c.show(),l.css({opacity:1}).removeClass("su-generator-choice-first"),u.show()},blur:function(){},keyup:function(e){var t=p(".su-generator-choice-first:first"),n=p(this).val(),a=new RegExp(n,"gi"),s=0;13===e.keyCode&&0<t.length&&(e.preventDefault(),p(this).val("").blur(),t.trigger("click")),l.css({opacity:.2}).removeClass("su-generator-choice-first"),l.each(function(){var e=p(this).data(),t=e.shortcode,r=[t,e.name,e.desc,e.group].join(" ").match(a);null!==r&&(p(this).css({opacity:1}),n===t?(l.removeClass("su-generator-choice-first"),p(this).addClass("su-generator-choice-first"),s=999):r.length>s&&(l.removeClass("su-generator-choice-first"),p(this).addClass("su-generator-choice-first"),s=r.length))}),""===n&&l.removeClass("su-generator-choice-first")}}),l.on("click",function(e){var r=p(this).data("shortcode");p.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_settings",shortcode:r},beforeSend:function(){p("#su-generator-preview").hide(),c.hide(),g.addClass("su-generator-loading").show(),o.addClass("su-generator-narrow"),u.hide()},success:function(e){g.removeClass("su-generator-loading"),g.html(e);var t=p("#su-generator-content");void 0!==h.state.mceSelection&&""!==h.state.mceSelection&&"hidden"!==t.attr("type")&&t.val(h.state.mceSelection),p(".su-generator-range-picker").each(function(e){var t=p(this).find("input"),r=t.attr("min"),n=t.attr("max"),a=t.attr("step");t.simpleSlider({snap:!0,step:a,range:[r,n]}),t.show(),t.on("keyup blur",function(e){t.simpleSlider("setValue",t.val())})}),p(".su-generator-select-color").each(function(e){p(this).find(".su-generator-select-color-wheel").filter(":first").farbtastic(".su-generator-select-color-value:eq("+e+")"),p(this).find(".su-generator-select-color-value").focus(function(){p(".su-generator-select-color-wheel:eq("+e+")").show()}),p(this).find(".su-generator-select-color-value").blur(function(){p(".su-generator-select-color-wheel:eq("+e+")").hide()})}),p(".su-generator-isp").each(function(){function n(){var e="none",t="",r=i.val();if("media"===r){var n=[];u.find("span").each(function(e){n[e]=p(this).data("id")}),0<n.length&&(t=n.join(","))}else if("category"===r){var a=c.val()||[];0<a.length&&(t=a.join(","))}else if("taxonomy"===r){var s=l.val()||"",o=g.val()||[];"0"!==s&&0<o.length&&(e="taxonomy: "+s+"/"+o.join(","))}else e="0"===r?"none":r;""!==t&&(e=r+": "+t),d.val(e).trigger("change")}var t,r=p(this),i=r.find(".su-generator-isp-sources"),a=r.find(".su-generator-isp-source"),e=r.find(".su-generator-isp-add-media"),u=r.find(".su-generator-isp-images"),c=r.find(".su-generator-isp-categories"),l=r.find(".su-generator-isp-taxonomies"),g=p(".su-generator-isp-terms"),d=r.find(".su-generator-attr");i.on("change",function(e){var t=p(this).val();e.preventDefault(),a.removeClass("su-generator-isp-source-open"),-1===t.indexOf(":")&&r.find(".su-generator-isp-source-"+t).addClass("su-generator-isp-source-open"),n()}),u.on("click","span i",function(){p(this).parent("span").css("border-color","#f03").fadeOut(300,function(){p(this).remove(),n()})}),e.click(function(e){e.preventDefault(),void 0!==t&&t.close(),(t=wp.media.frames.su_media_frame_1=wp.media({title:SUGL10n.isp_media_title,library:{type:"image"},button:{text:SUGL10n.isp_media_insert},multiple:!0})).on("open",function(){p(".mfp-wrap").addClass("hidden")}),t.on("close",function(){p(".mfp-wrap").removeClass("hidden")}),t.on("select",function(){var e=t.state().get("selection").toJSON();u.find("em").remove(),p.each(e,function(e){u.append('<span data-id="'+this.id+'" title="'+this.title+'"><img src="'+this.url+'" alt="" /><i class="sui sui-times"></i></span>')}),n()}).open()}),u.sortable({revert:200,containment:r,tolerance:"pointer",stop:function(){n()}}),c.on("change",n),g.on("change",n),l.on("change",function(){var t=p(this).parents(".su-generator-isp-source"),e=p(this).val();if(g.hide().find("option").remove(),n(),"0"!==e)var r=p.ajax({url:ajaxurl,type:"post",dataType:"html",data:{action:"su_generator_get_terms",tax:e,class:"su-generator-isp-terms",multiple:!0,size:10},beforeSend:function(){"object"===s(r)&&r.abort(),g.html("").attr("disabled",!0).hide(),t.addClass("su-generator-loading")},success:function(e){g.html(e).attr("disabled",!1).show(),t.removeClass("su-generator-loading")}})})}),p(".su-generator-upload-button").each(function(){var t,e=p(this),r=p(this).parents(".su-generator-attr-container").find("input:text");e.on("click",function(e){e.preventDefault(),e.stopPropagation(),void 0!==t&&t.close(),(t=wp.media.frames.su_media_frame_2=wp.media({title:SUGL10n.upload_title,button:{text:SUGL10n.upload_insert},multiple:!1})).on("select",function(){var e=t.state().get("selection").first().toJSON();r.val(e.url).trigger("change")}),t.on("open",function(){p(".mfp-wrap").addClass("hidden")}),t.on("close",function(){p(".mfp-wrap").removeClass("hidden")}),t.open()})}),p(".su-generator-icon-picker-button").each(function(){var e=p(this),t=p(this).parents(".su-generator-attr-container"),n=t.find(".su-generator-attr"),a=t.find(".su-generator-icon-picker"),s=a.find("input:text");e.click(function(e){a.toggleClass("su-generator-icon-picker-visible"),s.val("").trigger("keyup"),a.hasClass("su-generator-icon-picker-loaded")||(p.ajax({type:"post",url:ajaxurl,data:{action:"su_generator_get_icons"},dataType:"html",beforeSend:function(){a.addClass("su-generator-loading"),a.addClass("su-generator-icon-picker-loaded")},success:function(e){a.append(e);var r=a.children("i");r.click(function(e){n.val("icon: "+p(this).attr("title")),a.removeClass("su-generator-icon-picker-visible"),n.trigger("change"),e.preventDefault()}),s.on({keyup:function(){var e=p(this).val(),t=new RegExp(e,"gi");r.hide(),r.each(function(){null!==p(this).attr("title").match(t)&&p(this).show()})},focus:function(){p(this).val(""),r.show()}}),a.removeClass("su-generator-loading")}}),e.preventDefault())})}),p(".su-generator-switch").click(function(e){var t=p(this).parent().children("input");"yes"===t.val()?t.val("no").trigger("change"):t.val("yes").trigger("change"),e.preventDefault()}),p(".su-generator-switch-value").on("change",function(){var e=p(this),t=e.parent().children(".su-generator-switch"),r=e.val();"yes"===r?t.removeClass("su-generator-switch-no").addClass("su-generator-switch-yes"):"no"===r&&t.removeClass("su-generator-switch-yes").addClass("su-generator-switch-no")}),p("select#su-generator-attr-taxonomy").on("change",function(){var e=p(this).val(),t=p("select#su-generator-attr-tax_term");window.su_generator_get_terms=p.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_get_terms",tax:e,noselect:!0},dataType:"html",beforeSend:function(){"object"===s(window.su_generator_get_terms)&&window.su_generator_get_terms.abort(),t.parent().addClass("su-generator-loading")},success:function(e){t.find("option").remove(),t.append(e),t.parent().removeClass("su-generator-loading")}})}),p(".su-generator-shadow-picker").each(function(e){var t=p(this),r=t.find(".su-generator-shadow-picker-field input"),n=t.find(".su-generator-sp-hoff"),a=t.find(".su-generator-sp-voff"),s=t.find(".su-generator-sp-blur"),o={cnt:t.find(".su-generator-shadow-picker-color"),value:t.find(".su-generator-shadow-picker-color-value"),wheel:t.find(".su-generator-shadow-picker-color-wheel")},i=t.find(".su-generator-attr");o.wheel.farbtastic(o.value),o.value.focus(function(){o.wheel.show()}),o.value.blur(function(){o.wheel.hide()}),r.on("change blur keyup",function(){i.val(n.val()+"px "+a.val()+"px "+s.val()+"px "+o.value.val()).trigger("change")}),i.on("keyup",function(){var e=p(this).val().split(" ");4===e.length&&(n.val(e[0].replace("px","")),a.val(e[1].replace("px","")),s.val(e[2].replace("px","")),o.value.val(e[3]),r.trigger("keyup"))})}),p(".su-generator-border-picker").each(function(e){var t=p(this),r=t.find(".su-generator-border-picker-field input, .su-generator-border-picker-field select"),n=t.find(".su-generator-bp-width"),a=t.find(".su-generator-bp-style"),s={cnt:t.find(".su-generator-border-picker-color"),value:t.find(".su-generator-border-picker-color-value"),wheel:t.find(".su-generator-border-picker-color-wheel")},o=t.find(".su-generator-attr");s.wheel.farbtastic(s.value),s.value.focus(function(){s.wheel.show()}),s.value.blur(function(){s.wheel.hide()}),r.on("change blur keyup",function(){o.val(n.val()+"px "+a.val()+" "+s.value.val()).trigger("change")}),o.on("keyup",function(){var e=p(this).val().split(" ");3===e.length&&(n.val(e[0].replace("px","")),a.val(e[1]),s.value.val(e[2]),r.trigger("keyup"))})}),g.find(".su-generator-attr").on("change keyup blur",function(){var e=p(this).parents(".su-generator-attr-container"),t=e.data("default");p(this).val()!=t?e.removeClass("su-generator-skip"):e.addClass("su-generator-skip")}),p(".su-generator-set-value").click(function(e){p(this).parents(".su-generator-attr-container").find("input").val(p(this).text()).trigger("change")}),f.val(r),p.ajax({type:"GET",url:ajaxurl,data:{action:"su_generator_get_preset",id:"last_used",shortcode:r},beforeSend:function(){},success:function(e){h.setSettings(e);var t=p("#su-generator-content");void 0!==h.state.mceSelection&&""!==h.state.mceSelection&&"hidden"!==t.attr("type")&&t.val(h.state.mceSelection)},dataType:"json"})},dataType:"html"})}),p("#su-generator").on("click",".su-generator-insert",h.insertShortcode),p("#su-generator").on("click",".su-generator-toggle-preview",function(e){var t=p("#su-generator-preview");p(this).hide(),t.addClass("su-generator-loading").show(),g.find("input, textarea, select").on("change keyup blur",function(){h.updatePreview()}),h.updatePreview(!0),e.preventDefault()}),p("#su-generator").on("mouseenter click",".su-generator-presets",function(){clearTimeout(a),p(".su-gp-popup").show()}),p("#su-generator").on("mouseleave",".su-generator-presets",function(){a=window.setTimeout(function(){p(".su-gp-popup").fadeOut(200)},600)}),p("#su-generator").on("click",".su-gp-new",function(e){p(this).parents(".su-generator-presets");var t=p(".su-gp-list"),r=(new Date).getTime(),n=prompt(SUGL10n.presets_prompt_msg,SUGL10n.presets_prompt_value);""!==n&&null!==n&&(t.find("b").hide(),t.append('<span data-id="'+r+'"><em>'+n+'</em><i class="sui sui-times"></i></span>'),h.addPreset(r,n))}),p("#su-generator").on("click",".su-gp-list span",function(e){var t=p(".su-generator-presets").data("shortcode"),r=p(this).data("id"),n=p(".su-generator-insert");p(".su-gp-popup").hide(),clearTimeout(a),p.ajax({type:"GET",url:ajaxurl,data:{action:"su_generator_get_preset",id:r,shortcode:t},beforeSend:function(){n.addClass("button-primary-disabled").attr("disabled",!0)},success:function(e){n.removeClass("button-primary-disabled").attr("disabled",!1),h.setSettings(e)},dataType:"json"}),e.preventDefault(),e.stopPropagation()}),p("#su-generator").on("click",".su-gp-list i",function(e){var t=p(this).parents(".su-gp-list"),r=p(this).parent("span"),n=r.data("id");r.remove(),t.find("span").length<1&&t.find("b").show(),h.removePreset(n),e.stopPropagation(),e.preventDefault()})},h.addPreset=function(e,t){var r=p(".su-generator-presets").data("shortcode"),n=h.getSettings();p.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_add_preset",id:e,name:t,shortcode:r,settings:n}})},h.removePreset=function(e){var t=p(".su-generator-presets").data("shortcode");p.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_remove_preset",id:e,shortcode:t}})},h.parseSettings=function(){var e="on"===p("#su-generator-option-skip").val()?"#su-generator-settings .su-generator-attr-container:not(.su-generator-skip) .su-generator-attr":"#su-generator-settings .su-generator-attr-container .su-generator-attr",t=f.val(),r=d.val(),n=p(e),a=p("textarea#su-generator-content"),s=a.length?a.val():"false",o=new String("");return o+="["+r+t,n.each(function(){var e=p(this),t="";null==(t=e.is("select")?e.find("option:selected").val():e.val())?t="":"array"==typeof t&&(t=t.join(",")),""!==t&&(o+=" "+p(this).attr("name")+'="'+p(this).val().toString().replace(/"/gi,"'")+'"')}),o+="]","false"!=s&&(o+=s+"[/"+r+t+"]"),o},h.getSettings=function(){f.val();var e=p("#su-generator-settings .su-generator-attr"),t=p("textarea#su-generator-content"),r=t.length?t.val():"false",a={};return e.each(function(e){var t=p(this),r="",n=t.attr("name");null==(r=t.is("select")?t.find("option:selected").val():t.val())&&(r=""),a[n]=r}),a.content=r.toString(),a},h.setSettings=function(r){var e=p("#su-generator-settings .su-generator-attr"),t=p("#su-generator-content");e.each(function(){var e=p(this),t=e.attr("name");r.hasOwnProperty(t)&&(e.val(r[t]),e.trigger("keyup").trigger("change").trigger("blur"))}),r.hasOwnProperty("content")&&t.val(r.content).trigger("keyup").trigger("change").trigger("blur"),h.updatePreview()},h.updatePreview=function(e){var t=p("#su-generator-preview"),r=h.parseSettings(),n=a.text();e=e||!1,t.is(":visible")&&(r===n&&!e||(window.clearTimeout(h.state.preview.timer),h.state.preview.timer=window.setTimeout(function(){h.state.preview.request=p.ajax({type:"POST",url:ajaxurl,cache:!1,data:{action:"su_generator_preview",shortcode:r},beforeSend:function(){h.state.preview.request&&h.state.preview.request.abort(),t.addClass("su-generator-loading").html("")},success:function(e){t.html(e).removeClass("su-generator-loading")},dataType:"html"})},300),a.text(r)))},h.insert=function(e,t){if("string"==typeof e&&"object"===s(t)){h.state.context=e;var r=(h.state.insertArgs=t).shortcode||"",n={type:"inline",alignTop:!0,closeOnBgClick:!1,mainClass:"su-generator-mfp",items:{src:"#su-generator"},callbacks:{}};n.callbacks.open=function(){r?l.filter('[data-shortcode="'.concat(r,'"]')).trigger("click"):window.setTimeout(function(){return i.focus()},200),"undefined"!=typeof tinyMCE&&null!=tinyMCE.activeEditor&&tinyMCE.activeEditor.hasOwnProperty("selection")&&(h.state.mceSelection=tinyMCE.activeEditor.selection.getContent({format:"text"}))},n.callbacks.close=function(){i.val(""),g.html("").hide(),o.removeClass("su-generator-narrow"),u.show(),c.show(),l.show(),h.state.mceSelection=""},p.magnificPopup.open(n)}},h.insertShortcode=function(){var e=h.parseSettings();if(h.addPreset("last_used",SUGL10n.last_used),p.magnificPopup.close(),a.text(e),"classic"===h.state.context)h.state.wpActiveEditor=window.wpActiveEditor,window.wpActiveEditor=h.state.insertArgs.editorID,window.wp.media.editor.insert(e),window.wpActiveEditor=h.state.wpActiveEditor;else if("block"===h.state.context){var t=h.state.insertArgs.props;if(t.attributes.hasOwnProperty("content"))t.setAttributes({content:t.attributes.content+e});else if("core/shortcode"===t.name){var r=t.attributes.hasOwnProperty("text")?t.attributes.text:"";t.setAttributes({text:r+e})}}},h.insertAtCaret=function(e,t){var r=e.selectionStart;e.selectionEnd,e.value=e.value.substring(0,r)+t+e.value.substring(r),e.focus(),e.selectionStart=r+t.length},{init:h.init,insert:h.insert}),jQuery(document).ready(window.SUG.App.init)},{}]},{},[1]);
2
  //# sourceMappingURL=index.js.map
includes/js/generator/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["includes/js/generator/node_modules/browser-pack/_prelude.js","includes/js/generator/includes/js/generator/src/index.js"],"names":["r","e","n","t","o","i","f","c","require","u","a","Error","code","p","exports","call","length","1","module","$","$generator","$search","$filter","$filters","$choices","$choice","$settings","$prefix","$result","$selected","self","window","SUG","App","jQuery","children","find","state","mceSelection","target","wpActiveEditor","context","insertArgs","preview","timer","request","el","body","init","gp_hover_timer","click","filter","this","data","css","opacity","removeClass","regex","RegExp","each","match","preventDefault","on","val","html","hide","show","focus","magnificPopup","close","blur","keyup","$first","best","keyCode","trigger","id","shortcode","matches","name","desc","group","join","addClass","ajax","type","url","ajaxurl","action","beforeSend","success","$content","attr","index","$val","min","max","step","simpleSlider","snap","range","farbtastic","update","ids","source","$sources","images","$images","categories","$cats","tax","$taxes","terms","$terms","frame","$picker","$source","$addMedia","indexOf","parent","fadeOut","remove","wp","media","frames","su_media_frame_1","title","SUGL10n","isp_media_title","library","button","text","isp_media_insert","multiple","files","get","toJSON","append","open","sortable","revert","containment","tolerance","stop","$cont","parents","ajaxTermSelect","dataType","class","size","_typeof","abort","file","$button","stopPropagation","su_media_frame_2","upload_title","upload_insert","attachment","first","$field","toggleClass","hasClass","$icons","$value","$switch","value","su_generator_get_terms","noselect","$fields","$hoff","$voff","$blur","$color","cnt","wheel","split","replace","$width","$style","$cnt","_default","setSettings","insertShortcode","$preview","updatePreview","clearTimeout","setTimeout","$list","Date","getTime","prompt","presets_prompt_msg","presets_prompt_value","addPreset","$insert","$preset","removePreset","settings","getSettings","parseSettings","settingsSelector","query","prefix","content","result","String","$this","is","toString","hasOwnProperty","forced","previous","cache","insert","args","preSelectedShortcode","mfpOptions","alignTop","closeOnBgClick","mainClass","items","src","callbacks","concat","tinyMCE","activeEditor","selection","getContent","format","last_used","editorID","editor","props","attributes","setAttributes","originalText","insertAtCaret","field","start","selectionStart","selectionEnd","substring","document","ready"],"mappings":"CAAA,SAAAA,EAAAC,EAAAC,EAAAC,GAAA,SAAAC,EAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,IAAAE,EAAA,mBAAAC,SAAAA,QAAA,IAAAF,GAAAC,EAAA,OAAAA,EAAAF,GAAA,GAAA,GAAAI,EAAA,OAAAA,EAAAJ,GAAA,GAAA,IAAAK,EAAA,IAAAC,MAAA,uBAAAN,EAAA,KAAA,MAAAK,EAAAE,KAAA,mBAAAF,EAAA,IAAAG,EAAAX,EAAAG,GAAA,CAAAS,QAAA,IAAAb,EAAAI,GAAA,GAAAU,KAAAF,EAAAC,QAAA,SAAAd,GAAA,OAAAI,EAAAH,EAAAI,GAAA,GAAAL,IAAAA,IAAAa,EAAAA,EAAAC,QAAAd,EAAAC,EAAAC,EAAAC,GAAA,OAAAD,EAAAG,GAAAS,QAAA,IAAA,IAAAL,EAAA,mBAAAD,SAAAA,QAAAH,EAAA,EAAAA,EAAAF,EAAAa,OAAAX,IAAAD,EAAAD,EAAAE,IAAA,OAAAD,EAAA,CAAA,CAAAa,EAAA,CAAA,SAAAT,EAAAU,EAAAJ,qPCIkB,IAACK,EACbC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAEAC,EAdNC,OAAOC,IAAM,GAEbD,OAAOC,IAAIC,KAAQd,EA8sChBe,OA7sCGd,EAAaD,EAAE,iBAC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O,MAAMC,aAAe,IAK5BnB,EAAEiD,cAAcsE,KAAK+E,KAGvB3L,EAAKyJ,gBAAkB,WACrB,IAAI1G,EAAY/C,EAAK0K,gBAQrB,GANA1K,EAAKoK,UAAU,YAAanE,QAAQuG,WAEpCnN,EAAEiD,cAAcC,QAEhBzC,EAAQuG,KAAKtD,GAEc,YAAvB/C,EAAKO,MAAMI,QACbX,EAAKO,MAAMG,eAAiBT,OAAOS,eACnCT,OAAOS,eAAiBV,EAAKO,MAAMK,WAAW6L,SAC9CxM,OAAO2F,GAAGC,MAAM6G,OAAOlB,OAAOzI,GAC9B9C,OAAOS,eAAiBV,EAAKO,MAAMG,oBAC9B,GAA2B,UAAvBV,EAAKO,MAAMI,QAAqB,CACzC,IAAIgM,EAAQ3M,EAAKO,MAAMK,WAAW+L,MAElC,GAAIA,EAAMC,WAAWxB,eAAe,WAClCuB,EAAME,cAAc,CAAE/B,QAAS6B,EAAMC,WAAW9B,QAAU/H,SACrD,GAAmB,mBAAf4J,EAAM1J,KAA2B,CAC1C,IAAI6J,EAAeH,EAAMC,WAAWxB,eAAe,QAC/CuB,EAAMC,WAAWvG,KACjB,GAEJsG,EAAME,cAAc,CAAExG,KAAMyG,EAAe/J,OAQjD/C,EAAK+M,cAAgB,SAACC,EAAO3G,GAC3B,IAAI4G,EAAQD,EAAME,eACRF,EAAMG,aAEhBH,EAAMxE,MAAQwE,EAAMxE,MAAM4E,UAAU,EAAGH,GAAS5G,EAAO2G,EAAMxE,MAAM4E,UAAUH,GAE7ED,EAAM3K,QAEN2K,EAAME,eAAiBD,EAAQ5G,EAAKnH,QAG/B,CACLgC,KAAMlB,EAAKkB,KACXsK,OAAQxL,EAAKwL,SAIjBpL,OAAOiN,UAAUC,MAAMrN,OAAOC,IAAIC,IAAIe","file":"index.js","sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()","/* global jQuery, wp, ajaxurl, SUGL10n */\n\nwindow.SUG = {}\n\nwindow.SUG.App = (($) => {\n var $generator = $('#su-generator')\n var $search = $('#su-generator-search')\n var $filter = $('#su-generator-filter')\n var $filters = $filter.children('a')\n var $choices = $('#su-generator-choices')\n var $choice = $choices.find('span')\n var $settings = $('#su-generator-settings')\n var $prefix = $('#su-compatibility-mode-prefix')\n var $result = $('#su-generator-result')\n var $selected = $('#su-generator-selected')\n\n var self = {}\n\n self.state = {\n mceSelection: '',\n target: '',\n wpActiveEditor: null,\n context: '',\n insertArgs: '',\n preview: {\n timer: null,\n request: null\n }\n }\n\n self.el = {\n body: $('body')\n }\n\n self.init = () => {\n $filters.click(\n function (e) {\n // Prepare data\n var filter = $(this).data('filter')\n // If filter All, show all choices\n if (filter === 'all') {\n $choice.css(\n {\n opacity: 1\n }\n ).removeClass('su-generator-choice-first')\n } else { // Else run search\n var regex = new RegExp(filter, 'gi')\n // Hide all choices\n $choice.css({ opacity: 0.2 })\n // Find searched choices and show\n $choice.each(\n function () {\n // Get shortcode name\n var group = $(this).data('group')\n // Show choice if matched\n if (group.match(regex) !== null) {\n $(this)\n .css({ opacity: 1 })\n .removeClass('su-generator-choice-first')\n }\n }\n )\n }\n e.preventDefault()\n }\n )\n // Go to home link\n $('#su-generator').on(\n 'click',\n '.su-generator-home',\n function (e) {\n // Clear search field\n $search.val('')\n // Hide settings\n $settings.html('').hide()\n // Remove narrow class\n $generator.removeClass('su-generator-narrow')\n // Show filters\n $filter.show()\n // Show choices panel\n $choices.show()\n $choice.show()\n // Clear selection\n self.state.mceSelection = ''\n // Focus search field\n $search.focus()\n e.preventDefault()\n }\n )\n // Generator close button\n $('#su-generator').on(\n 'click',\n '.su-generator-close',\n function (e) {\n // Close popup\n $.magnificPopup.close()\n // Prevent default action\n e.preventDefault()\n }\n )\n // Search field\n $search.on(\n {\n focus: function () {\n // Clear field\n $(this).val('')\n // Hide settings\n $settings.html('').hide()\n // Remove narrow class\n $generator.removeClass('su-generator-narrow')\n // Show choices panel\n $choices.show()\n $choice.css(\n {\n opacity: 1\n }\n ).removeClass('su-generator-choice-first')\n // Show filters\n $filter.show()\n },\n blur: function () {},\n keyup: function (e) {\n // Prepare vars\n var $first = $('.su-generator-choice-first:first')\n var val = $(this).val()\n var regex = new RegExp(val, 'gi')\n var best = 0\n // Hotkey action\n if (e.keyCode === 13 && $first.length > 0) {\n e.preventDefault()\n $(this).val('').blur()\n $first.trigger('click')\n }\n // Hide all choices\n $choice.css(\n {\n opacity: 0.2\n }\n ).removeClass('su-generator-choice-first')\n // Loop and highlight choices\n $choice.each(\n function () {\n // Get choice data\n var data = $(this).data()\n var id = data.shortcode\n var name = data.name\n var desc = data.desc\n var group = data.group\n var matches = ([id, name, desc, group].join(' ')).match(regex)\n // Highlight choice if matched\n if (matches !== null) {\n // Highlight current choice\n $(this).css(\n {\n opacity: 1\n }\n )\n // Check for exact match\n if (val === id) {\n // Remove primary class from all choices\n $choice.removeClass('su-generator-choice-first')\n // Add primary class to the current choice\n $(this).addClass('su-generator-choice-first')\n // Prevent selecting by matches number\n best = 999\n } else if (matches.length > best) { // Check matches length\n // Remove primary class from all choices\n $choice.removeClass('su-generator-choice-first')\n // Add primary class to the current choice\n $(this).addClass('su-generator-choice-first')\n // Save the score\n best = matches.length\n }\n }\n }\n )\n // Remove primary class if search field is empty\n if (val === '') {\n $choice.removeClass('su-generator-choice-first')\n }\n }\n }\n )\n // Click on shortcode choice\n $choice.on(\n 'click',\n function (e) {\n // Prepare data\n var shortcode = $(this).data('shortcode')\n // Load shortcode options\n $.ajax(\n {\n type: 'POST',\n url: ajaxurl,\n data: {\n action: 'su_generator_settings',\n shortcode: shortcode\n },\n beforeSend: function () {\n // Hide preview box\n $('#su-generator-preview').hide()\n // Hide choices panel\n $choices.hide()\n // Show loading animation\n $settings.addClass('su-generator-loading').show()\n // Add narrow class\n $generator.addClass('su-generator-narrow')\n // Hide filters\n $filter.hide()\n },\n success: function (data) {\n // Hide loading animation\n $settings.removeClass('su-generator-loading')\n // Insert new HTML\n $settings.html(data)\n // Apply selected text to the content field\n var $content = $('#su-generator-content')\n if (typeof self.state.mceSelection !== 'undefined' && self.state.mceSelection !== '' && $content.attr('type') !== 'hidden') {\n $content.val(self.state.mceSelection)\n }\n // Init range pickers\n $('.su-generator-range-picker').each(\n function (index) {\n var $picker = $(this)\n var $val = $picker.find('input')\n var min = $val.attr('min')\n var max = $val.attr('max')\n var step = $val.attr('step')\n // Apply noUIslider\n $val.simpleSlider(\n {\n snap: true,\n step: step,\n range: [min, max]\n }\n )\n $val.show()\n $val.on(\n 'keyup blur',\n function (e) {\n $val.simpleSlider('setValue', $val.val())\n }\n )\n }\n )\n // Init color pickers\n $('.su-generator-select-color').each(\n function (index) {\n $(this).find('.su-generator-select-color-wheel').filter(':first').farbtastic('.su-generator-select-color-value:eq(' + index + ')')\n $(this).find('.su-generator-select-color-value').focus(\n function () {\n $('.su-generator-select-color-wheel:eq(' + index + ')').show()\n }\n )\n $(this).find('.su-generator-select-color-value').blur(\n function () {\n $('.su-generator-select-color-wheel:eq(' + index + ')').hide()\n }\n )\n }\n )\n // Init image sourse pickers\n $('.su-generator-isp').each(\n function () {\n var $picker = $(this)\n var $sources = $picker.find('.su-generator-isp-sources')\n var $source = $picker.find('.su-generator-isp-source')\n var $addMedia = $picker.find('.su-generator-isp-add-media')\n var $images = $picker.find('.su-generator-isp-images')\n var $cats = $picker.find('.su-generator-isp-categories')\n var $taxes = $picker.find('.su-generator-isp-taxonomies')\n var $terms = $('.su-generator-isp-terms')\n var $val = $picker.find('.su-generator-attr')\n var frame\n // Update hidden value\n var update = function () {\n var val = 'none'\n var ids = ''\n var source = $sources.val()\n // Media library\n if (source === 'media') {\n var images = []\n $images.find('span').each(\n function (i) {\n images[i] = $(this).data('id')\n }\n )\n if (images.length > 0) {\n ids = images.join(',')\n }\n }\n // Category\n else if (source === 'category') {\n var categories = $cats.val() || []\n if (categories.length > 0) {\n ids = categories.join(',')\n }\n }\n // Taxonomy\n else if (source === 'taxonomy') {\n var tax = $taxes.val() || ''\n var terms = $terms.val() || []\n if (tax !== '0' && terms.length > 0) {\n val = 'taxonomy: ' + tax + '/' + terms.join(',')\n }\n }\n // Deselect\n else if (source === '0') {\n val = 'none'\n }\n // Other options\n else {\n val = source\n }\n if (ids !== '') {\n val = source + ': ' + ids\n }\n $val.val(val).trigger('change')\n }\n // Switch source\n $sources.on(\n 'change',\n function (e) {\n var source = $(this).val()\n e.preventDefault()\n $source.removeClass('su-generator-isp-source-open')\n if (source.indexOf(':') === -1) {\n $picker.find('.su-generator-isp-source-' + source).addClass('su-generator-isp-source-open')\n }\n update()\n }\n )\n // Remove image\n $images.on(\n 'click',\n 'span i',\n function () {\n $(this).parent('span').css('border-color', '#f03').fadeOut(\n 300,\n function () {\n $(this).remove()\n update()\n }\n )\n }\n )\n // Add image\n $addMedia.click(\n function (e) {\n e.preventDefault()\n if (typeof (frame) !== 'undefined') {\n frame.close()\n }\n frame = wp.media.frames.su_media_frame_1 = wp.media(\n {\n title: SUGL10n.isp_media_title,\n library: {\n type: 'image'\n },\n button: {\n text: SUGL10n.isp_media_insert\n },\n multiple: true\n }\n )\n frame.on('open', function () {\n $('.mfp-wrap').addClass('hidden')\n })\n frame.on('close', function () {\n $('.mfp-wrap').removeClass('hidden')\n })\n frame.on(\n 'select',\n function () {\n var files = frame.state().get('selection').toJSON()\n $images.find('em').remove()\n $.each(\n files,\n function (i) {\n $images.append('<span data-id=\"' + this.id + '\" title=\"' + this.title + '\"><img src=\"' + this.url + '\" alt=\"\" /><i class=\"sui sui-times\"></i></span>')\n }\n )\n update()\n }\n ).open()\n }\n )\n // Sort images\n $images.sortable(\n {\n revert: 200,\n containment: $picker,\n tolerance: 'pointer',\n stop: function () {\n update()\n }\n }\n )\n // Select categories and terms\n $cats.on('change', update)\n $terms.on('change', update)\n // Select taxonomy\n $taxes.on(\n 'change',\n function () {\n var $cont = $(this).parents('.su-generator-isp-source')\n var tax = $(this).val()\n // Remove terms\n $terms.hide().find('option').remove()\n update()\n // Taxonomy is not selected\n if (tax === '0') {\n\n } else { // Taxonomy selected\n var ajaxTermSelect = $.ajax(\n {\n url: ajaxurl,\n type: 'post',\n dataType: 'html',\n data: {\n action: 'su_generator_get_terms',\n tax: tax,\n class: 'su-generator-isp-terms',\n multiple: true,\n size: 10\n },\n beforeSend: function () {\n if (typeof ajaxTermSelect === 'object') {\n ajaxTermSelect.abort()\n }\n $terms.html('').attr('disabled', true).hide()\n $cont.addClass('su-generator-loading')\n },\n success: function (data) {\n $terms.html(data).attr('disabled', false).show()\n $cont.removeClass('su-generator-loading')\n }\n }\n )\n }\n }\n )\n }\n )\n // Init media buttons\n $('.su-generator-upload-button').each(\n function () {\n var $button = $(this)\n var $val = $(this).parents('.su-generator-attr-container').find('input:text')\n var file\n $button.on(\n 'click',\n function (e) {\n e.preventDefault()\n e.stopPropagation()\n // If the frame already exists, reopen it\n if (typeof (file) !== 'undefined') {\n file.close()\n }\n // Create WP media frame.\n file = wp.media.frames.su_media_frame_2 = wp.media(\n {\n // Title of media manager frame\n title: SUGL10n.upload_title,\n button: {\n // Button text\n text: SUGL10n.upload_insert\n },\n // Do not allow multiple files, if you want multiple, set true\n multiple: false\n }\n )\n // callback for selected image\n file.on(\n 'select',\n function () {\n var attachment = file.state().get('selection').first().toJSON()\n $val.val(attachment.url).trigger('change')\n }\n )\n file.on('open', function () {\n $('.mfp-wrap').addClass('hidden')\n })\n file.on('close', function () {\n $('.mfp-wrap').removeClass('hidden')\n })\n // Open modal\n file.open()\n }\n )\n }\n )\n // Init icon pickers\n $('.su-generator-icon-picker-button').each(\n function () {\n var $button = $(this)\n var $field = $(this).parents('.su-generator-attr-container')\n var $val = $field.find('.su-generator-attr')\n var $picker = $field.find('.su-generator-icon-picker')\n var $filter = $picker.find('input:text')\n $button.click(\n function (e) {\n $picker.toggleClass('su-generator-icon-picker-visible')\n $filter.val('').trigger('keyup')\n if ($picker.hasClass('su-generator-icon-picker-loaded')) {\n return\n }\n // Load icons\n $.ajax(\n {\n type: 'post',\n url: ajaxurl,\n data: {\n action: 'su_generator_get_icons'\n },\n dataType: 'html',\n beforeSend: function () {\n // Show loading animation\n $picker.addClass('su-generator-loading')\n // Add loaded class\n $picker.addClass('su-generator-icon-picker-loaded')\n },\n success: function (data) {\n $picker.append(data)\n var $icons = $picker.children('i')\n $icons.click(\n function (e) {\n $val.val('icon: ' + $(this).attr('title'))\n $picker.removeClass('su-generator-icon-picker-visible')\n $val.trigger('change')\n e.preventDefault()\n }\n )\n $filter.on(\n {\n keyup: function () {\n var val = $(this).val()\n var regex = new RegExp(val, 'gi')\n // Hide all choices\n $icons.hide()\n // Find searched choices and show\n $icons.each(\n function () {\n // Get shortcode name\n var name = $(this).attr('title')\n // Show choice if matched\n if (name.match(regex) !== null) {\n $(this).show()\n }\n }\n )\n },\n focus: function () {\n $(this).val('')\n $icons.show()\n }\n }\n )\n $picker.removeClass('su-generator-loading')\n }\n }\n )\n e.preventDefault()\n }\n )\n }\n )\n // Init switches\n $('.su-generator-switch').click(\n function (e) {\n // Prepare data\n var $switch = $(this)\n var $value = $switch.parent().children('input')\n var isOn = $value.val() === 'yes'\n // Disable\n if (isOn) {\n // Change value\n $value.val('no').trigger('change')\n } else { // Enable\n // Change value\n $value.val('yes').trigger('change')\n }\n e.preventDefault()\n }\n )\n $('.su-generator-switch-value').on(\n 'change',\n function () {\n // Prepare data\n var $value = $(this)\n var $switch = $value.parent().children('.su-generator-switch')\n var value = $value.val()\n // Disable\n if (value === 'yes') {\n $switch.removeClass('su-generator-switch-no').addClass('su-generator-switch-yes')\n } else if (value === 'no') { // Enable\n $switch.removeClass('su-generator-switch-yes').addClass('su-generator-switch-no')\n }\n }\n )\n // Init tax_term selects\n $('select#su-generator-attr-taxonomy_1').on(\n 'change',\n function () {\n var $taxonomy = $(this)\n var tax = $taxonomy.val()\n var $terms = $('select#su-generator-attr-tax_terms_1')\n // Load new options\n window.su_generator_get_terms = $.ajax(\n {\n type: 'POST',\n url: ajaxurl,\n data: {\n action: 'su_generator_get_terms',\n tax: tax,\n noselect: true\n },\n dataType: 'html',\n beforeSend: function () {\n // Check previous requests\n if (typeof window.su_generator_get_terms === 'object') {\n window.su_generator_get_terms.abort()\n }\n // Show loading animation\n $terms.parent().addClass('su-generator-loading')\n },\n success: function (data) {\n // Remove previous options\n $terms.find('option').remove()\n // Append new options\n $terms.append(data)\n // Hide loading animation\n $terms.parent().removeClass('su-generator-loading')\n }\n }\n )\n }\n )\n // Init shadow pickers\n $('.su-generator-shadow-picker').each(\n function (index) {\n var $picker = $(this)\n var $fields = $picker.find('.su-generator-shadow-picker-field input')\n var $hoff = $picker.find('.su-generator-sp-hoff')\n var $voff = $picker.find('.su-generator-sp-voff')\n var $blur = $picker.find('.su-generator-sp-blur')\n var $color = {\n cnt: $picker.find('.su-generator-shadow-picker-color'),\n value: $picker.find('.su-generator-shadow-picker-color-value'),\n wheel: $picker.find('.su-generator-shadow-picker-color-wheel')\n }\n var $val = $picker.find('.su-generator-attr')\n // Init color picker\n $color.wheel.farbtastic($color.value)\n $color.value.focus(\n function () {\n $color.wheel.show()\n }\n )\n $color.value.blur(\n function () {\n $color.wheel.hide()\n }\n )\n // Handle text fields\n $fields.on(\n 'change blur keyup',\n function () {\n $val.val($hoff.val() + 'px ' + $voff.val() + 'px ' + $blur.val() + 'px ' + $color.value.val()).trigger('change')\n }\n )\n $val.on(\n 'keyup',\n function () {\n var value = $(this).val().split(' ')\n // Value is correct\n if (value.length === 4) {\n $hoff.val(value[0].replace('px', ''))\n $voff.val(value[1].replace('px', ''))\n $blur.val(value[2].replace('px', ''))\n $color.value.val(value[3])\n $fields.trigger('keyup')\n }\n }\n )\n }\n )\n // Init border pickers\n $('.su-generator-border-picker').each(\n function (index) {\n var $picker = $(this)\n var $fields = $picker.find('.su-generator-border-picker-field input, .su-generator-border-picker-field select')\n var $width = $picker.find('.su-generator-bp-width')\n var $style = $picker.find('.su-generator-bp-style')\n var $color = {\n cnt: $picker.find('.su-generator-border-picker-color'),\n value: $picker.find('.su-generator-border-picker-color-value'),\n wheel: $picker.find('.su-generator-border-picker-color-wheel')\n }\n var $val = $picker.find('.su-generator-attr')\n // Init color picker\n $color.wheel.farbtastic($color.value)\n $color.value.focus(\n function () {\n $color.wheel.show()\n }\n )\n $color.value.blur(\n function () {\n $color.wheel.hide()\n }\n )\n // Handle text fields\n $fields.on(\n 'change blur keyup',\n function () {\n $val.val($width.val() + 'px ' + $style.val() + ' ' + $color.value.val()).trigger('change')\n }\n )\n $val.on(\n 'keyup',\n function () {\n var value = $(this).val().split(' ')\n // Value is correct\n if (value.length === 3) {\n $width.val(value[0].replace('px', ''))\n $style.val(value[1])\n $color.value.val(value[2])\n $fields.trigger('keyup')\n }\n }\n )\n }\n )\n // Remove skip class when setting is changed\n $settings.find('.su-generator-attr').on(\n 'change keyup blur',\n function () {\n var $cnt = $(this).parents('.su-generator-attr-container')\n var _default = $cnt.data('default')\n var val = $(this).val()\n // Value is changed\n if (val != _default) {\n $cnt.removeClass('su-generator-skip')\n } else {\n $cnt.addClass('su-generator-skip')\n }\n }\n )\n // Init value setters\n $('.su-generator-set-value').click(\n function (e) {\n $(this).parents('.su-generator-attr-container').find('input').val($(this).text()).trigger('change')\n }\n )\n // Save selected value\n $selected.val(shortcode)\n // Load last used preset\n $.ajax(\n {\n type: 'GET',\n url: ajaxurl,\n data: {\n action: 'su_generator_get_preset',\n id: 'last_used',\n shortcode: shortcode\n },\n beforeSend: function () {\n // Show loading animation\n // $settings.addClass('su-generator-loading');\n },\n success: function (data) {\n // Remove loading animation\n // $settings.removeClass('su-generator-loading');\n // Set new settings\n self.setSettings(data)\n // Apply selected text to the content field\n var $content = $('#su-generator-content')\n if (typeof self.state.mceSelection !== 'undefined' && self.state.mceSelection !== '' && $content.attr('type') !== 'hidden') {\n $content.val(self.state.mceSelection)\n }\n },\n dataType: 'json'\n }\n )\n },\n dataType: 'html'\n }\n )\n }\n )\n // Insert shortcode\n $('#su-generator').on('click', '.su-generator-insert', self.insertShortcode)\n // Preview shortcode\n $('#su-generator').on(\n 'click',\n '.su-generator-toggle-preview',\n function (e) {\n // Prepare data\n var $preview = $('#su-generator-preview')\n var $button = $(this)\n // Hide button\n $button.hide()\n // Show preview box\n $preview.addClass('su-generator-loading').show()\n // Bind updating on settings changes\n $settings.find('input, textarea, select').on(\n 'change keyup blur',\n function () {\n self.updatePreview()\n }\n )\n // Update preview box\n self.updatePreview(true)\n // Prevent default action\n e.preventDefault()\n }\n )\n var gp_hover_timer\n // Presets manager - mouseenter\n $('#su-generator').on(\n 'mouseenter click',\n '.su-generator-presets',\n function () {\n clearTimeout(gp_hover_timer)\n $('.su-gp-popup').show()\n }\n )\n // Presets manager - mouseleave\n $('#su-generator').on(\n 'mouseleave',\n '.su-generator-presets',\n function () {\n gp_hover_timer = window.setTimeout(\n function () {\n $('.su-gp-popup').fadeOut(200)\n },\n 600\n )\n }\n )\n // Presets manager - add new preset\n $('#su-generator').on(\n 'click',\n '.su-gp-new',\n function (e) {\n // Prepare data\n var $container = $(this).parents('.su-generator-presets')\n var $list = $('.su-gp-list')\n var id = new Date().getTime()\n // Ask for preset name\n var name = prompt(SUGL10n.presets_prompt_msg, SUGL10n.presets_prompt_value)\n // Name is entered\n if (name !== '' && name !== null) {\n // Hide default text\n $list.find('b').hide()\n // Add new option\n $list.append('<span data-id=\"' + id + '\"><em>' + name + '</em><i class=\"sui sui-times\"></i></span>')\n // Perform AJAX request\n self.addPreset(id, name)\n }\n }\n )\n // Presets manager - load preset\n $('#su-generator').on(\n 'click',\n '.su-gp-list span',\n function (e) {\n // Prepare data\n var shortcode = $('.su-generator-presets').data('shortcode')\n var id = $(this).data('id')\n var $insert = $('.su-generator-insert')\n // Hide popup\n $('.su-gp-popup').hide()\n // Disable hover timer\n clearTimeout(gp_hover_timer)\n // Get the preset\n $.ajax(\n {\n type: 'GET',\n url: ajaxurl,\n data: {\n action: 'su_generator_get_preset',\n id: id,\n shortcode: shortcode\n },\n beforeSend: function () {\n // Disable insert button\n $insert.addClass('button-primary-disabled').attr('disabled', true)\n },\n success: function (data) {\n // Enable insert button\n $insert.removeClass('button-primary-disabled').attr('disabled', false)\n // Set new settings\n self.setSettings(data)\n },\n dataType: 'json'\n }\n )\n // Prevent default action\n e.preventDefault()\n e.stopPropagation()\n }\n )\n // Presets manager - remove preset\n $('#su-generator').on(\n 'click',\n '.su-gp-list i',\n function (e) {\n // Prepare data\n var $list = $(this).parents('.su-gp-list')\n var $preset = $(this).parent('span')\n var id = $preset.data('id')\n // Remove DOM element\n $preset.remove()\n // Show default text if last preset was removed\n if ($list.find('span').length < 1) {\n $list.find('b').show()\n }\n // Perform ajax request\n self.removePreset(id)\n // Prevent <span> action\n e.stopPropagation()\n // Prevent default action\n e.preventDefault()\n }\n )\n }\n\n /**\n\t * Create new preset with specified name from current settings\n\t */\n self.addPreset = function (id, name) {\n // Prepare shortcode name and current settings\n var shortcode = $('.su-generator-presets').data('shortcode')\n var settings = self.getSettings()\n // Perform AJAX request\n $.ajax(\n {\n type: 'POST',\n url: ajaxurl,\n data: {\n action: 'su_generator_add_preset',\n id: id,\n name: name,\n shortcode: shortcode,\n settings: settings\n }\n }\n )\n }\n /**\n\t * Remove preset by ID\n\t */\n self.removePreset = function (id) {\n // Get current shortcode name\n var shortcode = $('.su-generator-presets').data('shortcode')\n // Perform AJAX request\n $.ajax(\n {\n type: 'POST',\n url: ajaxurl,\n data: {\n action: 'su_generator_remove_preset',\n id: id,\n shortcode: shortcode\n }\n }\n )\n }\n\n self.parseSettings = function () {\n var settingsSelector = $('#su-generator-option-skip').val() === 'on'\n ? '#su-generator-settings .su-generator-attr-container:not(.su-generator-skip) .su-generator-attr'\n : '#su-generator-settings .su-generator-attr-container .su-generator-attr'\n // Prepare data\n var query = $selected.val()\n var prefix = $prefix.val()\n var $settings = $(settingsSelector)\n var $content = $('textarea#su-generator-content')\n var content = $content.length ? $content.val() : 'false'\n var result = new String('')\n // Open shortcode\n result += '[' + prefix + query\n // Add shortcode attributes\n $settings.each(\n function () {\n // Prepare field and value\n var $this = $(this)\n var value = ''\n // Selects\n if ($this.is('select')) {\n value = $this.find('option:selected').val()\n }\n // Other fields\n else {\n value = $this.val()\n }\n // Check that value is not empty\n if (value == null) {\n value = ''\n } else if (typeof value === 'array') {\n value = value.join(',')\n }\n // Add attribute\n if (value !== '') {\n result += ' ' + $(this).attr('name') + '=\"' + $(this).val().toString().replace(/\"/gi, \"'\") + '\"'\n }\n }\n )\n // End of opening tag\n result += ']'\n // Wrap shortcode if content presented\n if (content != 'false') {\n result += content + '[/' + prefix + query + ']'\n }\n // Return result\n return result\n }\n\n self.getSettings = function () {\n // Prepare data\n var query = $selected.val()\n var $settings = $('#su-generator-settings .su-generator-attr')\n var $content = $('textarea#su-generator-content')\n var content = $content.length ? $content.val() : 'false'\n var data = {}\n // Add shortcode attributes\n $settings.each(\n function (i) {\n // Prepare field and value\n var $this = $(this)\n var value = ''\n var name = $this.attr('name')\n // Selects\n if ($this.is('select')) {\n value = $this.find('option:selected').val()\n }\n // Other fields\n else {\n value = $this.val()\n }\n // Check that value is not empty\n if (value == null) {\n value = ''\n }\n // Save value\n data[name] = value\n }\n )\n // Add content\n data.content = content.toString()\n // Return data\n return data\n }\n\n self.setSettings = function (data) {\n // Prepare data\n var $settings = $('#su-generator-settings .su-generator-attr')\n var $content = $('#su-generator-content')\n // Loop through settings\n $settings.each(\n function () {\n var $this = $(this)\n var name = $this.attr('name')\n // Data contains value for this field\n if (data.hasOwnProperty(name)) {\n // Set new value\n $this.val(data[name])\n $this.trigger('keyup').trigger('change').trigger('blur')\n }\n }\n )\n // Set content\n if (data.hasOwnProperty('content')) {\n $content.val(data.content).trigger('keyup').trigger('change').trigger('blur')\n }\n // Update preview\n self.updatePreview()\n }\n\n self.updatePreview = function (forced) {\n // Prepare data\n var $preview = $('#su-generator-preview')\n var shortcode = self.parseSettings()\n var previous = $result.text()\n // Check forced mode\n forced = forced || false\n // Break if preview box is hidden (preview isn't enabled)\n if (!$preview.is(':visible')) {\n return\n }\n // Check shortcode is changed is this is not a forced mode\n if (shortcode === previous && !forced) {\n return\n }\n // Run timer to filter often calls\n window.clearTimeout(self.state.preview.timer)\n self.state.preview.timer = window.setTimeout(\n function () {\n self.state.preview.request = $.ajax(\n {\n type: 'POST',\n url: ajaxurl,\n cache: false,\n data: {\n action: 'su_generator_preview',\n shortcode: shortcode\n },\n beforeSend: function () {\n // Abort previous requests\n if (self.state.preview.request) {\n self.state.preview.request.abort()\n }\n // Show loading animation\n $preview.addClass('su-generator-loading').html('')\n },\n success: function (data) {\n // Hide loading animation and set new HTML\n $preview.html(data).removeClass('su-generator-loading')\n },\n dataType: 'html'\n }\n )\n },\n 300\n )\n // Save shortcode to div\n $result.text(shortcode)\n }\n\n self.insert = function (context, args) {\n if (typeof context !== 'string' || typeof args !== 'object') {\n return\n }\n\n self.state.context = context\n self.state.insertArgs = args\n\n var preSelectedShortcode = args.shortcode || ''\n\n var mfpOptions = {\n type: 'inline',\n alignTop: true,\n closeOnBgClick: false,\n mainClass: 'su-generator-mfp',\n items: {\n src: '#su-generator'\n },\n callbacks: {}\n }\n\n mfpOptions.callbacks.open = () => {\n if (preSelectedShortcode) {\n $choice.filter(`[data-shortcode=\"${preSelectedShortcode}\"]`).trigger('click')\n } else {\n window.setTimeout(() => $search.focus(), 200)\n }\n\n // self.el.body.addClass( 'su-mfp-shown' );\n\n if (\n typeof tinyMCE !== 'undefined' &&\n\t\t\t\ttinyMCE.activeEditor != null &&\n\t\t\t\ttinyMCE.activeEditor.hasOwnProperty('selection')\n ) {\n self.state.mceSelection = tinyMCE.activeEditor.selection.getContent({ format: 'text' })\n }\n }\n\n mfpOptions.callbacks.close = () => {\n $search.val('')\n $settings.html('').hide()\n $generator.removeClass('su-generator-narrow')\n $filter.show()\n $choices.show()\n $choice.show()\n\n self.state.mceSelection = ''\n\n // self.el.body.removeClass( 'su-mfp-shown' );\n }\n\n $.magnificPopup.open(mfpOptions)\n }\n\n self.insertShortcode = function () {\n var shortcode = self.parseSettings()\n\n self.addPreset('last_used', SUGL10n.last_used)\n\n $.magnificPopup.close()\n\n $result.text(shortcode)\n\n if (self.state.context === 'classic') {\n self.state.wpActiveEditor = window.wpActiveEditor\n window.wpActiveEditor = self.state.insertArgs.editorID\n window.wp.media.editor.insert(shortcode)\n window.wpActiveEditor = self.state.wpActiveEditor\n } else if (self.state.context === 'block') {\n var props = self.state.insertArgs.props\n\n if (props.attributes.hasOwnProperty('content')) {\n props.setAttributes({ content: props.attributes.content + shortcode })\n } else if (props.name === 'core/shortcode') {\n var originalText = props.attributes.hasOwnProperty('text')\n ? props.attributes.text\n : ''\n\n props.setAttributes({ text: originalText + shortcode })\n\n // var textarea = document.querySelector( `#block-${props.clientId} textarea` );\n // self.insertAtCaret( textarea, shortcode );\n }\n }\n }\n\n self.insertAtCaret = (field, text) => {\n var start = field.selectionStart\n var end = field.selectionEnd\n\n field.value = field.value.substring(0, start) + text + field.value.substring(start)\n\n field.focus()\n\n field.selectionStart = start + text.length\n }\n\n return {\n init: self.init,\n insert: self.insert\n }\n})(jQuery)\n\njQuery(document).ready(window.SUG.App.init)\n"]}
1
+ {"version":3,"sources":["includes/js/generator/node_modules/browser-pack/_prelude.js","includes/js/generator/includes/js/generator/src/index.js"],"names":["r","e","n","t","o","i","f","c","require","u","a","Error","code","p","exports","call","length","1","module","$","$generator","$search","$filter","$filters","$choices","$choice","$settings","$prefix","$result","$selected","self","window","SUG","App","jQuery","children","find","state","mceSelection","target","wpActiveEditor","context","insertArgs","preview","timer","request","el","body","init","gp_hover_timer","click","filter","this","data","css","opacity","removeClass","regex","RegExp","each","match","preventDefault","on","val","html","hide","show","focus","magnificPopup","close","blur","keyup","$first","best","keyCode","trigger","id","shortcode","matches","name","desc","group","join","addClass","ajax","type","url","ajaxurl","action","beforeSend","success","$content","attr","index","$val","min","max","step","simpleSlider","snap","range","farbtastic","update","ids","source","$sources","images","$images","categories","$cats","tax","$taxes","terms","$terms","frame","$picker","$source","$addMedia","indexOf","parent","fadeOut","remove","wp","media","frames","su_media_frame_1","title","SUGL10n","isp_media_title","library","button","text","isp_media_insert","multiple","files","get","toJSON","append","open","sortable","revert","containment","tolerance","stop","$cont","parents","ajaxTermSelect","dataType","class","size","_typeof","abort","file","$button","stopPropagation","su_media_frame_2","upload_title","upload_insert","attachment","first","$field","toggleClass","hasClass","$icons","$value","$switch","value","su_generator_get_terms","noselect","$fields","$hoff","$voff","$blur","$color","cnt","wheel","split","replace","$width","$style","$cnt","_default","setSettings","insertShortcode","$preview","updatePreview","clearTimeout","setTimeout","$list","Date","getTime","prompt","presets_prompt_msg","presets_prompt_value","addPreset","$insert","$preset","removePreset","settings","getSettings","parseSettings","settingsSelector","query","prefix","content","result","String","$this","is","toString","hasOwnProperty","forced","previous","cache","insert","args","preSelectedShortcode","mfpOptions","alignTop","closeOnBgClick","mainClass","items","src","callbacks","concat","tinyMCE","activeEditor","selection","getContent","format","last_used","editorID","editor","props","attributes","setAttributes","originalText","insertAtCaret","field","start","selectionStart","selectionEnd","substring","document","ready"],"mappings":"CAAA,SAAAA,EAAAC,EAAAC,EAAAC,GAAA,SAAAC,EAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,IAAAE,EAAA,mBAAAC,SAAAA,QAAA,IAAAF,GAAAC,EAAA,OAAAA,EAAAF,GAAA,GAAA,GAAAI,EAAA,OAAAA,EAAAJ,GAAA,GAAA,IAAAK,EAAA,IAAAC,MAAA,uBAAAN,EAAA,KAAA,MAAAK,EAAAE,KAAA,mBAAAF,EAAA,IAAAG,EAAAX,EAAAG,GAAA,CAAAS,QAAA,IAAAb,EA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EAAME,cAAc,CAAExG,KAAMyG,EAAe/J,OAQjD/C,EAAK+M,cAAgB,SAACC,EAAO3G,GAC3B,IAAI4G,EAAQD,EAAME,eACRF,EAAMG,aAEhBH,EAAMxE,MAAQwE,EAAMxE,MAAM4E,UAAU,EAAGH,GAAS5G,EAAO2G,EAAMxE,MAAM4E,UAAUH,GAE7ED,EAAM3K,QAEN2K,EAAME,eAAiBD,EAAQ5G,EAAKnH,QAG/B,CACLgC,KAAMlB,EAAKkB,KACXsK,OAAQxL,EAAKwL,SAIjBpL,OAAOiN,UAAUC,MAAMrN,OAAOC,IAAIC,IAAIe","file":"index.js","sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()","/* global jQuery, wp, ajaxurl, SUGL10n */\n\nwindow.SUG = {}\n\nwindow.SUG.App = (($) => {\n var $generator = $('#su-generator')\n var $search = $('#su-generator-search')\n var $filter = $('#su-generator-filter')\n var $filters = $filter.children('a')\n var $choices = $('#su-generator-choices')\n var $choice = $choices.find('span')\n var $settings = $('#su-generator-settings')\n var $prefix = $('#su-compatibility-mode-prefix')\n var $result = $('#su-generator-result')\n var $selected = $('#su-generator-selected')\n\n var self = {}\n\n self.state = {\n mceSelection: '',\n target: '',\n wpActiveEditor: null,\n context: '',\n insertArgs: '',\n preview: {\n timer: null,\n request: null\n }\n }\n\n self.el = {\n body: $('body')\n }\n\n self.init = () => {\n $filters.click(\n function (e) {\n // Prepare data\n var filter = $(this).data('filter')\n // If filter All, show all choices\n if (filter === 'all') {\n $choice.css(\n {\n opacity: 1\n }\n ).removeClass('su-generator-choice-first')\n } else { // Else run search\n var regex = new RegExp(filter, 'gi')\n // Hide all choices\n $choice.css({ opacity: 0.2 })\n // Find searched choices and show\n $choice.each(\n function () {\n // Get shortcode name\n var group = $(this).data('group')\n // Show choice if matched\n if (group.match(regex) !== null) {\n $(this)\n .css({ opacity: 1 })\n .removeClass('su-generator-choice-first')\n }\n }\n )\n }\n e.preventDefault()\n }\n )\n // Go to home link\n $('#su-generator').on(\n 'click',\n '.su-generator-home',\n function (e) {\n // Clear search field\n $search.val('')\n // Hide settings\n $settings.html('').hide()\n // Remove narrow class\n $generator.removeClass('su-generator-narrow')\n // Show filters\n $filter.show()\n // Show choices panel\n $choices.show()\n $choice.show()\n // Clear selection\n self.state.mceSelection = ''\n // Focus search field\n $search.focus()\n e.preventDefault()\n }\n )\n // Generator close button\n $('#su-generator').on(\n 'click',\n '.su-generator-close',\n function (e) {\n // Close popup\n $.magnificPopup.close()\n // Prevent default action\n e.preventDefault()\n }\n )\n // Search field\n $search.on(\n {\n focus: function () {\n // Clear field\n $(this).val('')\n // Hide settings\n $settings.html('').hide()\n // Remove narrow class\n $generator.removeClass('su-generator-narrow')\n // Show choices panel\n $choices.show()\n $choice.css(\n {\n opacity: 1\n }\n ).removeClass('su-generator-choice-first')\n // Show filters\n $filter.show()\n },\n blur: function () {},\n keyup: function (e) {\n // Prepare vars\n var $first = $('.su-generator-choice-first:first')\n var val = $(this).val()\n var regex = new RegExp(val, 'gi')\n var best = 0\n // Hotkey action\n if (e.keyCode === 13 && $first.length > 0) {\n e.preventDefault()\n $(this).val('').blur()\n $first.trigger('click')\n }\n // Hide all choices\n $choice.css(\n {\n opacity: 0.2\n }\n ).removeClass('su-generator-choice-first')\n // Loop and highlight choices\n $choice.each(\n function () {\n // Get choice data\n var data = $(this).data()\n var id = data.shortcode\n var name = data.name\n var desc = data.desc\n var group = data.group\n var matches = ([id, name, desc, group].join(' ')).match(regex)\n // Highlight choice if matched\n if (matches !== null) {\n // Highlight current choice\n $(this).css(\n {\n opacity: 1\n }\n )\n // Check for exact match\n if (val === id) {\n // Remove primary class from all choices\n $choice.removeClass('su-generator-choice-first')\n // Add primary class to the current choice\n $(this).addClass('su-generator-choice-first')\n // Prevent selecting by matches number\n best = 999\n } else if (matches.length > best) { // Check matches length\n // Remove primary class from all choices\n $choice.removeClass('su-generator-choice-first')\n // Add primary class to the current choice\n $(this).addClass('su-generator-choice-first')\n // Save the score\n best = matches.length\n }\n }\n }\n )\n // Remove primary class if search field is empty\n if (val === '') {\n $choice.removeClass('su-generator-choice-first')\n }\n }\n }\n )\n // Click on shortcode choice\n $choice.on(\n 'click',\n function (e) {\n // Prepare data\n var shortcode = $(this).data('shortcode')\n // Load shortcode options\n $.ajax(\n {\n type: 'POST',\n url: ajaxurl,\n data: {\n action: 'su_generator_settings',\n shortcode: shortcode\n },\n beforeSend: function () {\n // Hide preview box\n $('#su-generator-preview').hide()\n // Hide choices panel\n $choices.hide()\n // Show loading animation\n $settings.addClass('su-generator-loading').show()\n // Add narrow class\n $generator.addClass('su-generator-narrow')\n // Hide filters\n $filter.hide()\n },\n success: function (data) {\n // Hide loading animation\n $settings.removeClass('su-generator-loading')\n // Insert new HTML\n $settings.html(data)\n // Apply selected text to the content field\n var $content = $('#su-generator-content')\n if (typeof self.state.mceSelection !== 'undefined' && self.state.mceSelection !== '' && $content.attr('type') !== 'hidden') {\n $content.val(self.state.mceSelection)\n }\n // Init range pickers\n $('.su-generator-range-picker').each(\n function (index) {\n var $picker = $(this)\n var $val = $picker.find('input')\n var min = $val.attr('min')\n var max = $val.attr('max')\n var step = $val.attr('step')\n // Apply noUIslider\n $val.simpleSlider(\n {\n snap: true,\n step: step,\n range: [min, max]\n }\n )\n $val.show()\n $val.on(\n 'keyup blur',\n function (e) {\n $val.simpleSlider('setValue', $val.val())\n }\n )\n }\n )\n // Init color pickers\n $('.su-generator-select-color').each(\n function (index) {\n $(this).find('.su-generator-select-color-wheel').filter(':first').farbtastic('.su-generator-select-color-value:eq(' + index + ')')\n $(this).find('.su-generator-select-color-value').focus(\n function () {\n $('.su-generator-select-color-wheel:eq(' + index + ')').show()\n }\n )\n $(this).find('.su-generator-select-color-value').blur(\n function () {\n $('.su-generator-select-color-wheel:eq(' + index + ')').hide()\n }\n )\n }\n )\n // Init image sourse pickers\n $('.su-generator-isp').each(\n function () {\n var $picker = $(this)\n var $sources = $picker.find('.su-generator-isp-sources')\n var $source = $picker.find('.su-generator-isp-source')\n var $addMedia = $picker.find('.su-generator-isp-add-media')\n var $images = $picker.find('.su-generator-isp-images')\n var $cats = $picker.find('.su-generator-isp-categories')\n var $taxes = $picker.find('.su-generator-isp-taxonomies')\n var $terms = $('.su-generator-isp-terms')\n var $val = $picker.find('.su-generator-attr')\n var frame\n // Update hidden value\n var update = function () {\n var val = 'none'\n var ids = ''\n var source = $sources.val()\n // Media library\n if (source === 'media') {\n var images = []\n $images.find('span').each(\n function (i) {\n images[i] = $(this).data('id')\n }\n )\n if (images.length > 0) {\n ids = images.join(',')\n }\n }\n // Category\n else if (source === 'category') {\n var categories = $cats.val() || []\n if (categories.length > 0) {\n ids = categories.join(',')\n }\n }\n // Taxonomy\n else if (source === 'taxonomy') {\n var tax = $taxes.val() || ''\n var terms = $terms.val() || []\n if (tax !== '0' && terms.length > 0) {\n val = 'taxonomy: ' + tax + '/' + terms.join(',')\n }\n }\n // Deselect\n else if (source === '0') {\n val = 'none'\n }\n // Other options\n else {\n val = source\n }\n if (ids !== '') {\n val = source + ': ' + ids\n }\n $val.val(val).trigger('change')\n }\n // Switch source\n $sources.on(\n 'change',\n function (e) {\n var source = $(this).val()\n e.preventDefault()\n $source.removeClass('su-generator-isp-source-open')\n if (source.indexOf(':') === -1) {\n $picker.find('.su-generator-isp-source-' + source).addClass('su-generator-isp-source-open')\n }\n update()\n }\n )\n // Remove image\n $images.on(\n 'click',\n 'span i',\n function () {\n $(this).parent('span').css('border-color', '#f03').fadeOut(\n 300,\n function () {\n $(this).remove()\n update()\n }\n )\n }\n )\n // Add image\n $addMedia.click(\n function (e) {\n e.preventDefault()\n if (typeof (frame) !== 'undefined') {\n frame.close()\n }\n frame = wp.media.frames.su_media_frame_1 = wp.media(\n {\n title: SUGL10n.isp_media_title,\n library: {\n type: 'image'\n },\n button: {\n text: SUGL10n.isp_media_insert\n },\n multiple: true\n }\n )\n frame.on('open', function () {\n $('.mfp-wrap').addClass('hidden')\n })\n frame.on('close', function () {\n $('.mfp-wrap').removeClass('hidden')\n })\n frame.on(\n 'select',\n function () {\n var files = frame.state().get('selection').toJSON()\n $images.find('em').remove()\n $.each(\n files,\n function (i) {\n $images.append('<span data-id=\"' + this.id + '\" title=\"' + this.title + '\"><img src=\"' + this.url + '\" alt=\"\" /><i class=\"sui sui-times\"></i></span>')\n }\n )\n update()\n }\n ).open()\n }\n )\n // Sort images\n $images.sortable(\n {\n revert: 200,\n containment: $picker,\n tolerance: 'pointer',\n stop: function () {\n update()\n }\n }\n )\n // Select categories and terms\n $cats.on('change', update)\n $terms.on('change', update)\n // Select taxonomy\n $taxes.on(\n 'change',\n function () {\n var $cont = $(this).parents('.su-generator-isp-source')\n var tax = $(this).val()\n // Remove terms\n $terms.hide().find('option').remove()\n update()\n // Taxonomy is not selected\n if (tax === '0') {\n\n } else { // Taxonomy selected\n var ajaxTermSelect = $.ajax(\n {\n url: ajaxurl,\n type: 'post',\n dataType: 'html',\n data: {\n action: 'su_generator_get_terms',\n tax: tax,\n class: 'su-generator-isp-terms',\n multiple: true,\n size: 10\n },\n beforeSend: function () {\n if (typeof ajaxTermSelect === 'object') {\n ajaxTermSelect.abort()\n }\n $terms.html('').attr('disabled', true).hide()\n $cont.addClass('su-generator-loading')\n },\n success: function (data) {\n $terms.html(data).attr('disabled', false).show()\n $cont.removeClass('su-generator-loading')\n }\n }\n )\n }\n }\n )\n }\n )\n // Init media buttons\n $('.su-generator-upload-button').each(\n function () {\n var $button = $(this)\n var $val = $(this).parents('.su-generator-attr-container').find('input:text')\n var file\n $button.on(\n 'click',\n function (e) {\n e.preventDefault()\n e.stopPropagation()\n // If the frame already exists, reopen it\n if (typeof (file) !== 'undefined') {\n file.close()\n }\n // Create WP media frame.\n file = wp.media.frames.su_media_frame_2 = wp.media(\n {\n // Title of media manager frame\n title: SUGL10n.upload_title,\n button: {\n // Button text\n text: SUGL10n.upload_insert\n },\n // Do not allow multiple files, if you want multiple, set true\n multiple: false\n }\n )\n // callback for selected image\n file.on(\n 'select',\n function () {\n var attachment = file.state().get('selection').first().toJSON()\n $val.val(attachment.url).trigger('change')\n }\n )\n file.on('open', function () {\n $('.mfp-wrap').addClass('hidden')\n })\n file.on('close', function () {\n $('.mfp-wrap').removeClass('hidden')\n })\n // Open modal\n file.open()\n }\n )\n }\n )\n // Init icon pickers\n $('.su-generator-icon-picker-button').each(\n function () {\n var $button = $(this)\n var $field = $(this).parents('.su-generator-attr-container')\n var $val = $field.find('.su-generator-attr')\n var $picker = $field.find('.su-generator-icon-picker')\n var $filter = $picker.find('input:text')\n $button.click(\n function (e) {\n $picker.toggleClass('su-generator-icon-picker-visible')\n $filter.val('').trigger('keyup')\n if ($picker.hasClass('su-generator-icon-picker-loaded')) {\n return\n }\n // Load icons\n $.ajax(\n {\n type: 'post',\n url: ajaxurl,\n data: {\n action: 'su_generator_get_icons'\n },\n dataType: 'html',\n beforeSend: function () {\n // Show loading animation\n $picker.addClass('su-generator-loading')\n // Add loaded class\n $picker.addClass('su-generator-icon-picker-loaded')\n },\n success: function (data) {\n $picker.append(data)\n var $icons = $picker.children('i')\n $icons.click(\n function (e) {\n $val.val('icon: ' + $(this).attr('title'))\n $picker.removeClass('su-generator-icon-picker-visible')\n $val.trigger('change')\n e.preventDefault()\n }\n )\n $filter.on(\n {\n keyup: function () {\n var val = $(this).val()\n var regex = new RegExp(val, 'gi')\n // Hide all choices\n $icons.hide()\n // Find searched choices and show\n $icons.each(\n function () {\n // Get shortcode name\n var name = $(this).attr('title')\n // Show choice if matched\n if (name.match(regex) !== null) {\n $(this).show()\n }\n }\n )\n },\n focus: function () {\n $(this).val('')\n $icons.show()\n }\n }\n )\n $picker.removeClass('su-generator-loading')\n }\n }\n )\n e.preventDefault()\n }\n )\n }\n )\n // Init switches\n $('.su-generator-switch').click(\n function (e) {\n // Prepare data\n var $switch = $(this)\n var $value = $switch.parent().children('input')\n var isOn = $value.val() === 'yes'\n // Disable\n if (isOn) {\n // Change value\n $value.val('no').trigger('change')\n } else { // Enable\n // Change value\n $value.val('yes').trigger('change')\n }\n e.preventDefault()\n }\n )\n $('.su-generator-switch-value').on(\n 'change',\n function () {\n // Prepare data\n var $value = $(this)\n var $switch = $value.parent().children('.su-generator-switch')\n var value = $value.val()\n // Disable\n if (value === 'yes') {\n $switch.removeClass('su-generator-switch-no').addClass('su-generator-switch-yes')\n } else if (value === 'no') { // Enable\n $switch.removeClass('su-generator-switch-yes').addClass('su-generator-switch-no')\n }\n }\n )\n // Init tax_term selects\n $('select#su-generator-attr-taxonomy').on(\n 'change',\n function () {\n var $taxonomy = $(this)\n var tax = $taxonomy.val()\n var $terms = $('select#su-generator-attr-tax_term')\n // Load new options\n window.su_generator_get_terms = $.ajax(\n {\n type: 'POST',\n url: ajaxurl,\n data: {\n action: 'su_generator_get_terms',\n tax: tax,\n noselect: true\n },\n dataType: 'html',\n beforeSend: function () {\n // Check previous requests\n if (typeof window.su_generator_get_terms === 'object') {\n window.su_generator_get_terms.abort()\n }\n // Show loading animation\n $terms.parent().addClass('su-generator-loading')\n },\n success: function (data) {\n // Remove previous options\n $terms.find('option').remove()\n // Append new options\n $terms.append(data)\n // Hide loading animation\n $terms.parent().removeClass('su-generator-loading')\n }\n }\n )\n }\n )\n // Init shadow pickers\n $('.su-generator-shadow-picker').each(\n function (index) {\n var $picker = $(this)\n var $fields = $picker.find('.su-generator-shadow-picker-field input')\n var $hoff = $picker.find('.su-generator-sp-hoff')\n var $voff = $picker.find('.su-generator-sp-voff')\n var $blur = $picker.find('.su-generator-sp-blur')\n var $color = {\n cnt: $picker.find('.su-generator-shadow-picker-color'),\n value: $picker.find('.su-generator-shadow-picker-color-value'),\n wheel: $picker.find('.su-generator-shadow-picker-color-wheel')\n }\n var $val = $picker.find('.su-generator-attr')\n // Init color picker\n $color.wheel.farbtastic($color.value)\n $color.value.focus(\n function () {\n $color.wheel.show()\n }\n )\n $color.value.blur(\n function () {\n $color.wheel.hide()\n }\n )\n // Handle text fields\n $fields.on(\n 'change blur keyup',\n function () {\n $val.val($hoff.val() + 'px ' + $voff.val() + 'px ' + $blur.val() + 'px ' + $color.value.val()).trigger('change')\n }\n )\n $val.on(\n 'keyup',\n function () {\n var value = $(this).val().split(' ')\n // Value is correct\n if (value.length === 4) {\n $hoff.val(value[0].replace('px', ''))\n $voff.val(value[1].replace('px', ''))\n $blur.val(value[2].replace('px', ''))\n $color.value.val(value[3])\n $fields.trigger('keyup')\n }\n }\n )\n }\n )\n // Init border pickers\n $('.su-generator-border-picker').each(\n function (index) {\n var $picker = $(this)\n var $fields = $picker.find('.su-generator-border-picker-field input, .su-generator-border-picker-field select')\n var $width = $picker.find('.su-generator-bp-width')\n var $style = $picker.find('.su-generator-bp-style')\n var $color = {\n cnt: $picker.find('.su-generator-border-picker-color'),\n value: $picker.find('.su-generator-border-picker-color-value'),\n wheel: $picker.find('.su-generator-border-picker-color-wheel')\n }\n var $val = $picker.find('.su-generator-attr')\n // Init color picker\n $color.wheel.farbtastic($color.value)\n $color.value.focus(\n function () {\n $color.wheel.show()\n }\n )\n $color.value.blur(\n function () {\n $color.wheel.hide()\n }\n )\n // Handle text fields\n $fields.on(\n 'change blur keyup',\n function () {\n $val.val($width.val() + 'px ' + $style.val() + ' ' + $color.value.val()).trigger('change')\n }\n )\n $val.on(\n 'keyup',\n function () {\n var value = $(this).val().split(' ')\n // Value is correct\n if (value.length === 3) {\n $width.val(value[0].replace('px', ''))\n $style.val(value[1])\n $color.value.val(value[2])\n $fields.trigger('keyup')\n }\n }\n )\n }\n )\n // Remove skip class when setting is changed\n $settings.find('.su-generator-attr').on(\n 'change keyup blur',\n function () {\n var $cnt = $(this).parents('.su-generator-attr-container')\n var _default = $cnt.data('default')\n var val = $(this).val()\n // Value is changed\n if (val != _default) {\n $cnt.removeClass('su-generator-skip')\n } else {\n $cnt.addClass('su-generator-skip')\n }\n }\n )\n // Init value setters\n $('.su-generator-set-value').click(\n function (e) {\n $(this).parents('.su-generator-attr-container').find('input').val($(this).text()).trigger('change')\n }\n )\n // Save selected value\n $selected.val(shortcode)\n // Load last used preset\n $.ajax(\n {\n type: 'GET',\n url: ajaxurl,\n data: {\n action: 'su_generator_get_preset',\n id: 'last_used',\n shortcode: shortcode\n },\n beforeSend: function () {\n // Show loading animation\n // $settings.addClass('su-generator-loading');\n },\n success: function (data) {\n // Remove loading animation\n // $settings.removeClass('su-generator-loading');\n // Set new settings\n self.setSettings(data)\n // Apply selected text to the content field\n var $content = $('#su-generator-content')\n if (typeof self.state.mceSelection !== 'undefined' && self.state.mceSelection !== '' && $content.attr('type') !== 'hidden') {\n $content.val(self.state.mceSelection)\n }\n },\n dataType: 'json'\n }\n )\n },\n dataType: 'html'\n }\n )\n }\n )\n // Insert shortcode\n $('#su-generator').on('click', '.su-generator-insert', self.insertShortcode)\n // Preview shortcode\n $('#su-generator').on(\n 'click',\n '.su-generator-toggle-preview',\n function (e) {\n // Prepare data\n var $preview = $('#su-generator-preview')\n var $button = $(this)\n // Hide button\n $button.hide()\n // Show preview box\n $preview.addClass('su-generator-loading').show()\n // Bind updating on settings changes\n $settings.find('input, textarea, select').on(\n 'change keyup blur',\n function () {\n self.updatePreview()\n }\n )\n // Update preview box\n self.updatePreview(true)\n // Prevent default action\n e.preventDefault()\n }\n )\n var gp_hover_timer\n // Presets manager - mouseenter\n $('#su-generator').on(\n 'mouseenter click',\n '.su-generator-presets',\n function () {\n clearTimeout(gp_hover_timer)\n $('.su-gp-popup').show()\n }\n )\n // Presets manager - mouseleave\n $('#su-generator').on(\n 'mouseleave',\n '.su-generator-presets',\n function () {\n gp_hover_timer = window.setTimeout(\n function () {\n $('.su-gp-popup').fadeOut(200)\n },\n 600\n )\n }\n )\n // Presets manager - add new preset\n $('#su-generator').on(\n 'click',\n '.su-gp-new',\n function (e) {\n // Prepare data\n var $container = $(this).parents('.su-generator-presets')\n var $list = $('.su-gp-list')\n var id = new Date().getTime()\n // Ask for preset name\n var name = prompt(SUGL10n.presets_prompt_msg, SUGL10n.presets_prompt_value)\n // Name is entered\n if (name !== '' && name !== null) {\n // Hide default text\n $list.find('b').hide()\n // Add new option\n $list.append('<span data-id=\"' + id + '\"><em>' + name + '</em><i class=\"sui sui-times\"></i></span>')\n // Perform AJAX request\n self.addPreset(id, name)\n }\n }\n )\n // Presets manager - load preset\n $('#su-generator').on(\n 'click',\n '.su-gp-list span',\n function (e) {\n // Prepare data\n var shortcode = $('.su-generator-presets').data('shortcode')\n var id = $(this).data('id')\n var $insert = $('.su-generator-insert')\n // Hide popup\n $('.su-gp-popup').hide()\n // Disable hover timer\n clearTimeout(gp_hover_timer)\n // Get the preset\n $.ajax(\n {\n type: 'GET',\n url: ajaxurl,\n data: {\n action: 'su_generator_get_preset',\n id: id,\n shortcode: shortcode\n },\n beforeSend: function () {\n // Disable insert button\n $insert.addClass('button-primary-disabled').attr('disabled', true)\n },\n success: function (data) {\n // Enable insert button\n $insert.removeClass('button-primary-disabled').attr('disabled', false)\n // Set new settings\n self.setSettings(data)\n },\n dataType: 'json'\n }\n )\n // Prevent default action\n e.preventDefault()\n e.stopPropagation()\n }\n )\n // Presets manager - remove preset\n $('#su-generator').on(\n 'click',\n '.su-gp-list i',\n function (e) {\n // Prepare data\n var $list = $(this).parents('.su-gp-list')\n var $preset = $(this).parent('span')\n var id = $preset.data('id')\n // Remove DOM element\n $preset.remove()\n // Show default text if last preset was removed\n if ($list.find('span').length < 1) {\n $list.find('b').show()\n }\n // Perform ajax request\n self.removePreset(id)\n // Prevent <span> action\n e.stopPropagation()\n // Prevent default action\n e.preventDefault()\n }\n )\n }\n\n /**\n\t * Create new preset with specified name from current settings\n\t */\n self.addPreset = function (id, name) {\n // Prepare shortcode name and current settings\n var shortcode = $('.su-generator-presets').data('shortcode')\n var settings = self.getSettings()\n // Perform AJAX request\n $.ajax(\n {\n type: 'POST',\n url: ajaxurl,\n data: {\n action: 'su_generator_add_preset',\n id: id,\n name: name,\n shortcode: shortcode,\n settings: settings\n }\n }\n )\n }\n /**\n\t * Remove preset by ID\n\t */\n self.removePreset = function (id) {\n // Get current shortcode name\n var shortcode = $('.su-generator-presets').data('shortcode')\n // Perform AJAX request\n $.ajax(\n {\n type: 'POST',\n url: ajaxurl,\n data: {\n action: 'su_generator_remove_preset',\n id: id,\n shortcode: shortcode\n }\n }\n )\n }\n\n self.parseSettings = function () {\n var settingsSelector = $('#su-generator-option-skip').val() === 'on'\n ? '#su-generator-settings .su-generator-attr-container:not(.su-generator-skip) .su-generator-attr'\n : '#su-generator-settings .su-generator-attr-container .su-generator-attr'\n // Prepare data\n var query = $selected.val()\n var prefix = $prefix.val()\n var $settings = $(settingsSelector)\n var $content = $('textarea#su-generator-content')\n var content = $content.length ? $content.val() : 'false'\n var result = new String('')\n // Open shortcode\n result += '[' + prefix + query\n // Add shortcode attributes\n $settings.each(\n function () {\n // Prepare field and value\n var $this = $(this)\n var value = ''\n // Selects\n if ($this.is('select')) {\n value = $this.find('option:selected').val()\n }\n // Other fields\n else {\n value = $this.val()\n }\n // Check that value is not empty\n if (value == null) {\n value = ''\n } else if (typeof value === 'array') {\n value = value.join(',')\n }\n // Add attribute\n if (value !== '') {\n result += ' ' + $(this).attr('name') + '=\"' + $(this).val().toString().replace(/\"/gi, \"'\") + '\"'\n }\n }\n )\n // End of opening tag\n result += ']'\n // Wrap shortcode if content presented\n if (content != 'false') {\n result += content + '[/' + prefix + query + ']'\n }\n // Return result\n return result\n }\n\n self.getSettings = function () {\n // Prepare data\n var query = $selected.val()\n var $settings = $('#su-generator-settings .su-generator-attr')\n var $content = $('textarea#su-generator-content')\n var content = $content.length ? $content.val() : 'false'\n var data = {}\n // Add shortcode attributes\n $settings.each(\n function (i) {\n // Prepare field and value\n var $this = $(this)\n var value = ''\n var name = $this.attr('name')\n // Selects\n if ($this.is('select')) {\n value = $this.find('option:selected').val()\n }\n // Other fields\n else {\n value = $this.val()\n }\n // Check that value is not empty\n if (value == null) {\n value = ''\n }\n // Save value\n data[name] = value\n }\n )\n // Add content\n data.content = content.toString()\n // Return data\n return data\n }\n\n self.setSettings = function (data) {\n // Prepare data\n var $settings = $('#su-generator-settings .su-generator-attr')\n var $content = $('#su-generator-content')\n // Loop through settings\n $settings.each(\n function () {\n var $this = $(this)\n var name = $this.attr('name')\n // Data contains value for this field\n if (data.hasOwnProperty(name)) {\n // Set new value\n $this.val(data[name])\n $this.trigger('keyup').trigger('change').trigger('blur')\n }\n }\n )\n // Set content\n if (data.hasOwnProperty('content')) {\n $content.val(data.content).trigger('keyup').trigger('change').trigger('blur')\n }\n // Update preview\n self.updatePreview()\n }\n\n self.updatePreview = function (forced) {\n // Prepare data\n var $preview = $('#su-generator-preview')\n var shortcode = self.parseSettings()\n var previous = $result.text()\n // Check forced mode\n forced = forced || false\n // Break if preview box is hidden (preview isn't enabled)\n if (!$preview.is(':visible')) {\n return\n }\n // Check shortcode is changed is this is not a forced mode\n if (shortcode === previous && !forced) {\n return\n }\n // Run timer to filter often calls\n window.clearTimeout(self.state.preview.timer)\n self.state.preview.timer = window.setTimeout(\n function () {\n self.state.preview.request = $.ajax(\n {\n type: 'POST',\n url: ajaxurl,\n cache: false,\n data: {\n action: 'su_generator_preview',\n shortcode: shortcode\n },\n beforeSend: function () {\n // Abort previous requests\n if (self.state.preview.request) {\n self.state.preview.request.abort()\n }\n // Show loading animation\n $preview.addClass('su-generator-loading').html('')\n },\n success: function (data) {\n // Hide loading animation and set new HTML\n $preview.html(data).removeClass('su-generator-loading')\n },\n dataType: 'html'\n }\n )\n },\n 300\n )\n // Save shortcode to div\n $result.text(shortcode)\n }\n\n self.insert = function (context, args) {\n if (typeof context !== 'string' || typeof args !== 'object') {\n return\n }\n\n self.state.context = context\n self.state.insertArgs = args\n\n var preSelectedShortcode = args.shortcode || ''\n\n var mfpOptions = {\n type: 'inline',\n alignTop: true,\n closeOnBgClick: false,\n mainClass: 'su-generator-mfp',\n items: {\n src: '#su-generator'\n },\n callbacks: {}\n }\n\n mfpOptions.callbacks.open = () => {\n if (preSelectedShortcode) {\n $choice.filter(`[data-shortcode=\"${preSelectedShortcode}\"]`).trigger('click')\n } else {\n window.setTimeout(() => $search.focus(), 200)\n }\n\n // self.el.body.addClass( 'su-mfp-shown' );\n\n if (\n typeof tinyMCE !== 'undefined' &&\n\t\t\t\ttinyMCE.activeEditor != null &&\n\t\t\t\ttinyMCE.activeEditor.hasOwnProperty('selection')\n ) {\n self.state.mceSelection = tinyMCE.activeEditor.selection.getContent({ format: 'text' })\n }\n }\n\n mfpOptions.callbacks.close = () => {\n $search.val('')\n $settings.html('').hide()\n $generator.removeClass('su-generator-narrow')\n $filter.show()\n $choices.show()\n $choice.show()\n\n self.state.mceSelection = ''\n\n // self.el.body.removeClass( 'su-mfp-shown' );\n }\n\n $.magnificPopup.open(mfpOptions)\n }\n\n self.insertShortcode = function () {\n var shortcode = self.parseSettings()\n\n self.addPreset('last_used', SUGL10n.last_used)\n\n $.magnificPopup.close()\n\n $result.text(shortcode)\n\n if (self.state.context === 'classic') {\n self.state.wpActiveEditor = window.wpActiveEditor\n window.wpActiveEditor = self.state.insertArgs.editorID\n window.wp.media.editor.insert(shortcode)\n window.wpActiveEditor = self.state.wpActiveEditor\n } else if (self.state.context === 'block') {\n var props = self.state.insertArgs.props\n\n if (props.attributes.hasOwnProperty('content')) {\n props.setAttributes({ content: props.attributes.content + shortcode })\n } else if (props.name === 'core/shortcode') {\n var originalText = props.attributes.hasOwnProperty('text')\n ? props.attributes.text\n : ''\n\n props.setAttributes({ text: originalText + shortcode })\n\n // var textarea = document.querySelector( `#block-${props.clientId} textarea` );\n // self.insertAtCaret( textarea, shortcode );\n }\n }\n }\n\n self.insertAtCaret = (field, text) => {\n var start = field.selectionStart\n var end = field.selectionEnd\n\n field.value = field.value.substring(0, start) + text + field.value.substring(start)\n\n field.focus()\n\n field.selectionStart = start + text.length\n }\n\n return {\n init: self.init,\n insert: self.insert\n }\n})(jQuery)\n\njQuery(document).ready(window.SUG.App.init)\n"]}
includes/shortcodes/posts.php CHANGED
@@ -427,6 +427,7 @@ function su_shortcode_posts_locate_template( $template ) {
427
  foreach ( $locations as $base ) {
428
 
429
  $base = untrailingslashit( $base );
 
430
 
431
  $path = path_join( $base, $template );
432
  $path = realpath( $path );
427
  foreach ( $locations as $base ) {
428
 
429
  $base = untrailingslashit( $base );
430
+ $base = realpath( $base );
431
 
432
  $path = path_join( $base, $template );
433
  $path = realpath( $path );
includes/shortcodes/qrcode.php CHANGED
@@ -109,6 +109,8 @@ function su_shortcode_qrcode( $atts = null, $content = null ) {
109
  if ( ! $atts['data'] ) {
110
  return su_error_message( 'QR code', __( 'please specify the data', 'shortcodes-ultimate' ) );
111
  }
 
 
112
  // Prepare link
113
  $href = ( $atts['link'] ) ? ' href="' . $atts['link'] . '"' : '';
114
  // Prepare clickable class
109
  if ( ! $atts['data'] ) {
110
  return su_error_message( 'QR code', __( 'please specify the data', 'shortcodes-ultimate' ) );
111
  }
112
+ $atts['data'] = su_do_attribute( $atts['data'] );
113
+ $atts['data'] = sanitize_text_field( $atts['data'] );
114
  // Prepare link
115
  $href = ( $atts['link'] ) ? ' href="' . $atts['link'] . '"' : '';
116
  // Prepare clickable class
includes/upgrade/5.9.1.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * 1. Add autoload to plugin options
5
+ */
6
+
7
+ $options = su_get_config( 'default-settings' );
8
+
9
+ foreach ( $options as $option => $default ) {
10
+
11
+ if ( ! add_option( $option, $default ) ) {
12
+
13
+ $value = get_option( $option );
14
+
15
+ delete_option( $option );
16
+ add_option( $option, $value );
17
+
18
+ }
19
+
20
+ }
languages/shortcodes-ultimate.pot CHANGED
@@ -312,36 +312,36 @@ msgstr ""
312
  msgid "Last used settings"
313
  msgstr ""
314
 
315
- #: inc/core/assets.php:118
316
  msgid "This shortcode doesn't work in live preview. Please insert it into editor and preview on the site."
317
  msgstr ""
318
 
319
- #: inc/core/assets.php:120
320
  msgid "Close (Esc)"
321
  msgstr ""
322
 
323
- #: inc/core/assets.php:121
324
  msgid "Loading..."
325
  msgstr ""
326
 
327
- #: inc/core/assets.php:122
328
  msgid "Previous (Left arrow key)"
329
  msgstr ""
330
 
331
- #: inc/core/assets.php:123
332
  msgid "Next (Right arrow key)"
333
  msgstr ""
334
 
335
  #. translators: %1$s of %2$s represents image counter in lightbox, will be replaced with "1 of 5"
336
- #: inc/core/assets.php:125
337
  msgid "%1$s of %2$s"
338
  msgstr ""
339
 
340
- #: inc/core/assets.php:126
341
  msgid "Failed to load content."
342
  msgstr ""
343
 
344
- #: inc/core/assets.php:126
345
  msgid "Open link"
346
  msgstr ""
347
 
312
  msgid "Last used settings"
313
  msgstr ""
314
 
315
+ #: inc/core/assets.php:117
316
  msgid "This shortcode doesn't work in live preview. Please insert it into editor and preview on the site."
317
  msgstr ""
318
 
319
+ #: inc/core/assets.php:119
320
  msgid "Close (Esc)"
321
  msgstr ""
322
 
323
+ #: inc/core/assets.php:120
324
  msgid "Loading..."
325
  msgstr ""
326
 
327
+ #: inc/core/assets.php:121
328
  msgid "Previous (Left arrow key)"
329
  msgstr ""
330
 
331
+ #: inc/core/assets.php:122
332
  msgid "Next (Right arrow key)"
333
  msgstr ""
334
 
335
  #. translators: %1$s of %2$s represents image counter in lightbox, will be replaced with "1 of 5"
336
+ #: inc/core/assets.php:124
337
  msgid "%1$s of %2$s"
338
  msgstr ""
339
 
340
+ #: inc/core/assets.php:125
341
  msgid "Failed to load content."
342
  msgstr ""
343
 
344
+ #: inc/core/assets.php:125
345
  msgid "Open link"
346
  msgstr ""
347
 
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: shortcode, toggle, columns, button, slider
6
  Requires at least: 4.6
7
  Tested up to: 5.5
8
  Requires PHP: 5.3
9
- Stable tag: 5.9.0
10
 
11
  A comprehensive collection of visual components for your site
12
 
@@ -146,26 +146,18 @@ First, visit the [Help Center](https://getshortcodes.com/support/). If you get s
146
  ## Changelog
147
 
148
 
149
- ### 5.9.0
150
-
151
- **Important changes**
152
-
153
- `[su_slider]` and `[su_carousel]` shortcodes are marked as deprecated. These shortcodes will disappaer from the *Available shortcodes* page and from the *Insert shortcode* window. Deprecated shortcodes will continue to work, but you'll not be able to insert them. You can enable deprecated shortcodes under *Dashboard → Shortcodes → Settings → Advanced settings*, but that's not recommended.
154
-
155
- Use [su_image_carousel](https://getshortcodes.com/docs/image-carousel/) instead, it has more options, and much more reliable.
156
 
157
  **What's new**
158
 
159
- - `[su_image_carousel]` now supports media taxonomies
160
- - New options `min_width` and `max_width` for `[su_lightbox_content]` shortcode
161
 
162
  **Fixes**
163
 
164
- - Fixed fatal errors `WP_Error` in `[su_slider]` and `[su_custom_gallery]`
165
- - Fixed PHP notice `undefined variable` in `[su_post]` shortcode
166
- - Fixed PHP notice `top_link` in `[su_divider]` shortcode
167
- - Fixed PHP notice `filter_content` in `[su_post]` shortcode
168
- - Fixed `related` option in `[su_dailymotion]` shortcode
169
- - Fixed non-working *Slide Link* issue with `[su_custom_gallery]`
170
- - Minor improvement to `[su_image_carousel]`
171
- - Minor UI improvements
6
  Requires at least: 4.6
7
  Tested up to: 5.5
8
  Requires PHP: 5.3
9
+ Stable tag: 5.9.1
10
 
11
  A comprehensive collection of visual components for your site
12
 
146
  ## Changelog
147
 
148
 
149
+ ### 5.9.1
 
 
 
 
 
 
150
 
151
  **What's new**
152
 
153
+ - `[su_qrcode]` now supports nested shortcodes in the `data` attribute
154
+ - Improved performance by reducing the number of DB queries
155
 
156
  **Fixes**
157
 
158
+ - Fixed issue in the Insert Shortcode tool with Taxonomy and Tax terms fields
159
+ - Fixed error `Posts: invalid template name` on some installations
160
+
161
+
162
+ ---
163
+ [Older changelog entries](https://plugins.trac.wordpress.org/browser/shortcodes-ultimate/trunk/changelog.txt).
 
 
shortcodes-ultimate.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Shortcodes Ultimate
4
  * Plugin URI: https://getshortcodes.com/
5
- * Version: 5.9.0
6
  * Author: Vladimir Anokhin
7
  * Author URI: https://vanokhin.com/
8
  * Description: A comprehensive collection of visual components for WordPress
@@ -14,7 +14,7 @@
14
  * Define plugin constants.
15
  */
16
  define( 'SU_PLUGIN_FILE', __FILE__ );
17
- define( 'SU_PLUGIN_VERSION', '5.9.0' );
18
 
19
  /**
20
  * Load dependencies.
2
  /**
3
  * Plugin Name: Shortcodes Ultimate
4
  * Plugin URI: https://getshortcodes.com/
5
+ * Version: 5.9.1
6
  * Author: Vladimir Anokhin
7
  * Author URI: https://vanokhin.com/
8
  * Description: A comprehensive collection of visual components for WordPress
14
  * Define plugin constants.
15
  */
16
  define( 'SU_PLUGIN_FILE', __FILE__ );
17
+ define( 'SU_PLUGIN_VERSION', '5.9.1' );
18
 
19
  /**
20
  * Load dependencies.