Plugin Directory

Changeset 1646035

Timestamp:
04/26/2017 08:04:24 PM (7 years ago)
Author:
goldenapples
Message:

Release version 0.7.2

Includes many bug fixes, including a major fix for WordPress 4.7.4 compatability.

Location:
shortcode-ui
Files:
24 edited
1 copied

Legend:

Unmodified
Added
Removed
  • shortcode-ui/tags/0.7.2/inc/fields/class-shortcode-ui-field-attachment.php

    r1615940 r1646035  
    136136
    137137                <div class="thumbnail-details-container has-attachment">
    138                     <strong>Thumbnail Details</strong>
     138                    <strong></strong>
    139139                    <div class="filename">{{ data.filename }}</div>
    140140                    <div class="date-formatted">{{ data.dateFormatted }}</div>
     
    143143                        <div class="dimensions">{{ data.width }} &times; {{ data.height }}</div>
    144144                    <# } #>
    145                     <div class="edit-link"><a href="{{ data.editLink }}">Edit Attachment</a></div>
     145                    <div class="edit-link"><a href="{{ data.editLink }}"></a></div>
    146146                </div>
    147147            </div>
  • shortcode-ui/tags/0.7.2/inc/templates/edit-form.tpl.php

    r1536575 r1646035  
    5555                    <optgroup label="{{ option.label }}">
    5656                        <# _.each( option.options, function( optgroupOption ) { #>
    57                             <option value="{{ optgroupOption.value }}" <# if ( optgroupOption.value === data.value ){ print('selected'); } #>>{{ optgroupOption.label }}</option>
     57                            <option value="{{ optgroupOption.value }}" <# if ( { print('selected'); } #>>{{ optgroupOption.label }}</option>
    5858                        <# }); #>
    5959                    </optgroup>
    6060                <# } else { #>
    61                     <option value="{{ option.value }}" <# if ( option.value === data.value ){ print('selected'); } #>>{{ option.label }}</option>
     61                    <option value="{{ option.value }}" <# if ( { print('selected'); } #>>{{ option.label }}</option>
    6262                <# } #>
    6363
  • shortcode-ui/tags/0.7.2/js/build/shortcode-ui.js

    r1615940 r1646035  
    4848            currentShortcode: null,
    4949            action: 'select',
    50             search: null
     50            search: null,
     51            insertCallback: this.insertCallback,
    5152        });
    5253
     
    7172
    7273    insert: function() {
    73         var shortcode = this.props.get('currentShortcode');
    74         if ( shortcode ) {
    75             send_to_editor( shortcode.formatShortcode() );
    76             this.reset();
    77             this.frame.close();
    78         }
     74        var shortcode      = this.props.get( 'currentShortcode' );
     75        var insertCallback = this.props.get( 'insertCallback' );
     76
     77        if ( shortcode && insertCallback ) {
     78            insertCallback( shortcode );
     79        }
     80
     81        this.reset();
     82        this.resetState();
     83        this.frame.close();
     84    },
     85
     86    insertCallback: function( shortcode ) {
     87        window.send_to_editor( shortcode.formatShortcode() );
    7988    },
    8089
     
    8392        this.props.set( 'currentShortcode', null );
    8493        this.props.set( 'search', null );
     94
     95
     96
     97
     98
     99
     100
     101
    85102    },
    86103
     
    255272            // Encode textareas incase HTML
    256273            if ( attr.get( 'encode' ) ) {
    257                 attr.set( 'value', encodeURIComponent( decodeURIComponent( attr.get( 'value' ).replace( "%", "&#37;" ) ) ), { silent: true } );
     274                attr.set( 'value', encodeURIComponent( decodeURIComponent( attr.get( 'value' ).replace( , "&#37;" ) ) ), { silent: true } );
    258275            }
    259276
     
    640657     * @param {string} shortcodeString String representation of the shortcode
    641658     */
    642     edit: function( shortcodeString ) {
     659    edit: function( shortcodeString ) {
    643660
    644661        var currentShortcode = this.parseShortcodeString( shortcodeString );
     
    659676            }
    660677
    661             // Make sure to reset state when closed.
    662             frame.once( 'close submit', function() {
    663                 frame.state().props.set('currentShortcode', false);
    664                 var menuItem = frame.menu.get().get('shortcode-ui');
    665                 menuItem.options.text = shortcodeUIData.strings.media_frame_title;
    666                 menuItem.render();
    667                 frame.setState( 'insert' );
     678            frame.mediaController.props.set( 'insertCallback', function( shortcode ) {
     679                update( shortcode.formatShortcode() );
    668680            } );
    669681
     
    18221834        this.preselect( $field );
    18231835
    1824                 var $fieldSelect2 = $field[ shortcodeUIData.select2_handle ]({
     1836var $fieldSelect2 = $field[ shortcodeUIData.select2_handle ]({
    18251837            placeholder: "Search",
    18261838            multiple: this.model.get( 'multiple' ),
     
    18531865                cache: true
    18541866            },
     1867
    18551868            escapeMarkup: function( markup ) { return markup; },
    18561869            minimumInputLength: 1,
     
    18881901
    18891902    destroySelect2UI: function() {
    1890                 $fieldSelect2[ shortcodeUIData.select2_handle ]( 'close' );
     1903$fieldSelect2[ shortcodeUIData.select2_handle ]( 'close' );
    18911904    }
    18921905
    18931906});
    1894 
    18951907
    18961908}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  • shortcode-ui/tags/0.7.2/js/src/controllers/media-controller.js

    r1615931 r1646035  
    1111            currentShortcode: null,
    1212            action: 'select',
    13             search: null
     13            search: null,
     14            insertCallback: this.insertCallback,
    1415        });
    1516
     
    3435
    3536    insert: function() {
    36         var shortcode = this.props.get('currentShortcode');
    37         if ( shortcode ) {
    38             send_to_editor( shortcode.formatShortcode() );
    39             this.reset();
    40             this.frame.close();
     37        var shortcode );
     38       
     39
     40       
     41            );
    4142        }
     43
     44
     45
     46
     47
     48
     49
     50
    4251    },
    4352
     
    4655        this.props.set( 'currentShortcode', null );
    4756        this.props.set( 'search', null );
     57
     58
     59
     60
     61
     62
     63
     64
    4865    },
    4966
  • shortcode-ui/tags/0.7.2/js/src/models/shortcode.js

    r1615931 r1646035  
    7676            // Encode textareas incase HTML
    7777            if ( attr.get( 'encode' ) ) {
    78                 attr.set( 'value', encodeURIComponent( decodeURIComponent( attr.get( 'value' ).replace( "%", "&#37;" ) ) ), { silent: true } );
     78                attr.set( 'value', encodeURIComponent( decodeURIComponent( attr.get( 'value' ).replace( , "&#37;" ) ) ), { silent: true } );
    7979            }
    8080
  • shortcode-ui/tags/0.7.2/js/src/utils/shortcode-view-constructor.js

    r1615931 r1646035  
    161161     * @param {string} shortcodeString String representation of the shortcode
    162162     */
    163     edit: function( shortcodeString ) {
     163    edit: function( shortcodeString ) {
    164164
    165165        var currentShortcode = this.parseShortcodeString( shortcodeString );
     
    180180            }
    181181
    182             // Make sure to reset state when closed.
    183             frame.once( 'close submit', function() {
    184                 frame.state().props.set('currentShortcode', false);
    185                 var menuItem = frame.menu.get().get('shortcode-ui');
    186                 menuItem.options.text = shortcodeUIData.strings.media_frame_title;
    187                 menuItem.render();
    188                 frame.setState( 'insert' );
     182            frame.mediaController.props.set( 'insertCallback', function( shortcode ) {
     183                update( shortcode.formatShortcode() );
    189184            } );
    190185
  • shortcode-ui/tags/0.7.2/languages/shortcode-ui-fi.po

    r1536575 r1646035  
    44"Project-Id-Version: Shortcake (Shortcode UI) 0.6.0-alpha\n"
    55"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/shortcode-ui\n"
    6 "POT-Creation-Date: 2016-03-23 17:25+0200\n"
     6"POT-Creation-Date: 2017-03-29 13:09+0300\n"
     7"PO-Revision-Date: 2017-03-29 13:11+0300\n"
     8"Last-Translator: Teemu Suoranta <teemu@aucor.fi>\n"
     9"Language-Team: \n"
     10"Language: fi\n"
    711"MIME-Version: 1.0\n"
    812"Content-Type: text/plain; charset=UTF-8\n"
    913"Content-Transfer-Encoding: 8bit\n"
    10 "PO-Revision-Date: 2016-03-23 18:03+0200\n"
    11 "Language-Team: \n"
    12 "X-Generator: Poedit 1.8.7\n"
    13 "X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c\n"
     14"0\n"
     15""
     16""
     17"esc_html_x:1,2c\n"
    1418"Plural-Forms: nplurals=2; plural=(n != 1);\n"
    1519"X-Poedit-SourceCharset: UTF-8\n"
    1620"X-Poedit-Basepath: ..\n"
    1721"X-Textdomain-Support: yes\n"
    18 "Last-Translator: Teemu Suoranta <teemu@aucor.fi>\n"
    19 "Language: fi\n"
    2022"X-Poedit-SearchPath-0: .\n"
    2123
    22 #: dev.php:75
     24#: dev.php:68
     25msgid ""
     26"Shortcode UI plugin must be active for Shortcode UI Example plugin to "
     27"function."
     28msgstr ""
     29
     30#: dev.php:119
     31msgid "Shortcake With No Attributes"
     32msgstr ""
     33
     34#: dev.php:159
    2335msgid "Attachment"
    2436msgstr "Liitetiedosto"
    2537
    26 #: dev.php:79 dev.php:80
     38#: dev.php:0
    2739msgid "Select Image"
    2840msgstr "Valitse kuva"
    2941
    30 #: dev.php:83
     42#: dev.php:175
     43msgid "You can select multiple images."
     44msgstr ""
     45
     46#: dev.php:183
    3147msgid "Citation Source"
    3248msgstr "Lainauksen lähde"
    3349
    34 #: inc/class-shortcode-ui.php:109
     50#: dev.php:188
     51msgid "Test placeholder"
     52msgstr ""
     53
     54#: dev.php:193
     55#, fuzzy
     56#| msgid "Select Image"
     57msgid "Select Page"
     58msgstr "Valitse kuva"
     59
     60#: dev.php:200
     61#, fuzzy
     62#| msgid "Select Image"
     63msgid "Select Term"
     64msgstr "Valitse kuva"
     65
     66#: dev.php:207
     67msgid "User Select"
     68msgstr ""
     69
     70#: dev.php:213
     71msgid "Color"
     72msgstr ""
     73
     74#: dev.php:218
     75msgid "Hex color code"
     76msgstr ""
     77
     78#: dev.php:222
     79msgid "Alignment"
     80msgstr ""
     81
     82#: dev.php:223
     83msgid ""
     84"Whether the quotation should be displayed as pull-left, pull-right, or "
     85"neither."
     86msgstr ""
     87
     88#: dev.php:227
     89msgid "None"
     90msgstr ""
     91
     92#: dev.php:228 dev.php:233
     93msgid "Pull Left"
     94msgstr ""
     95
     96#: dev.php:229 dev.php:234
     97msgid "Pull Right"
     98msgstr ""
     99
     100#: dev.php:240
     101msgid "Year"
     102msgstr ""
     103
     104#: dev.php:241
     105msgid "Optional. The year the quotation is from."
     106msgstr ""
     107
     108#: dev.php:260
     109msgid "Shortcake Dev"
     110msgstr ""
     111
     112#: dev.php:279
     113msgid "Quote"
     114msgstr ""
     115
     116#: dev.php:280
     117msgid "Include a statement from someone famous."
     118msgstr ""
     119
     120#: dev.php:352
     121#, fuzzy
     122#| msgid "Inner Content"
     123msgid "Content:"
     124msgstr "Sisempi sisältö"
     125
     126#: dev.php:356
     127msgid "Source:"
     128msgstr ""
     129
     130#: dev.php:360
     131msgid "Image:"
     132msgstr ""
     133
     134#: dev.php:364
     135msgid "Gallery:"
     136msgstr ""
     137
     138#: dev.php:372
     139msgid "Pages:"
     140msgstr ""
     141
     142#: dev.php:376
     143msgid "Terms:"
     144msgstr ""
     145
     146#: dev.php:380
     147msgid "Users:"
     148msgstr ""
     149
     150#: dev.php:384
     151msgid "Color:"
     152msgstr ""
     153
     154#: dev.php:388
     155msgid "Alignment:"
     156msgstr ""
     157
     158#: dev.php:392
     159msgid "Year:"
     160msgstr ""
     161
     162#: inc/class-shortcode-ui.php:110
    35163msgid "Inner Content"
    36164msgstr "Sisempi sisältö"
    37165
    38 #: inc/class-shortcode-ui.php:220 inc/class-shortcode-ui.php:221
     166#: inc/class-shortcode-ui.php:2
    39167msgid "Insert Post Element"
    40168msgstr "Lisää sisältöelementti"
    41169
    42 #: inc/class-shortcode-ui.php:222
     170#: inc/class-shortcode-ui.php:2
    43171msgid "%s Details"
    44172msgstr "%s tiedot"
    45173
    46 #: inc/class-shortcode-ui.php:223
     174#: inc/class-shortcode-ui.php:2
    47175msgid "Insert Element"
    48176msgstr "Lisää elementti"
    49177
    50 #: inc/class-shortcode-ui.php:224
     178#: inc/class-shortcode-ui.php:2
    51179msgid "Update"
    52180msgstr "Päivitä"
    53181
    54 #: inc/class-shortcode-ui.php:225
     182#: inc/class-shortcode-ui.php:2
    55183msgid "There are no attributes to configure for this Post Element."
    56184msgstr "Tässä sisältöelementissä ei ole muokattavia asetuksia."
    57185
    58 #: inc/class-shortcode-ui.php:226
     186#: inc/class-shortcode-ui.php:2
    59187msgid "Failed to load preview"
    60188msgstr "Esikatselun lataus epäonnistui"
    61189
    62 #: inc/class-shortcode-ui.php:227
     190#: inc/class-shortcode-ui.php:2
    63191msgid "Search"
    64192msgstr "Etsi"
    65193
    66 #: inc/class-shortcode-ui.php:228
     194#: inc/class-shortcode-ui.php:2
    67195msgid "Insert Content"
    68196msgstr "Lisää sisältö"
    69197
    70 #: inc/class-shortcode-ui.php:323
     198#: inc/class-shortcode-ui.php:297
     199msgid "Add Post Element"
     200msgstr "Lisää sisältöelementti"
     201
     202#: inc/class-shortcode-ui.php:365
    71203msgid "Something's rotten in the state of Denmark"
    72204msgstr "Jotain mätää Tanskanmaalla"
     
    77209msgstr "Valitse liitetiedosto"
    78210
    79 #: inc/fields/class-field-attachment.php:104
    80 msgid "Thumbnail Details"
    81 msgstr "Liitteen tiedot"
    82 
    83 #: inc/fields/class-field-attachment.php:109
    84 msgid "Edit Attachment"
    85 msgstr "Muokkaa liitetiedostoa"
    86 
    87211#: inc/templates/edit-form.tpl.php:3
    88212msgid "Back to list"
     
    104228msgid "http://next.fusion.net/tag/shortcode-ui/"
    105229msgstr "http://next.fusion.net/tag/shortcode-ui/"
     230
     231
     232
     233
     234
     235
  • shortcode-ui/tags/0.7.2/languages/shortcode-ui.pot

    r1615940 r1646035  
    1 # Copyright (C) 2016 Fusion Engineering and community
     1# Copyright (C) 201 Fusion Engineering and community
    22# This file is distributed under the GPL v2 or later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Shortcake (Shortcode UI) 0.7.1\n"
     5"Project-Id-Version: Shortcake (Shortcode UI) 0.7.\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/shortcode-ui\n"
    7 "POT-Creation-Date: 2016-12-16 22:19:41+00:00\n"
     7"POT-Creation-Date: 201+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=utf-8\n"
    1010"Content-Transfer-Encoding: 8bit\n"
    11 "PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n"
     11"PO-Revision-Date: 201-MO-DA HO:MI+ZONE\n"
    1212"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    1313"Language-Team: LANGUAGE <LL@li.org>\n"
     
    157157msgstr ""
    158158
    159 #: inc/class-shortcode-ui.php:110
     159#: inc/class-shortcode-ui.php:11
    160160msgid "Inner Content"
    161161msgstr ""
    162162
    163 #: inc/class-shortcode-ui.php:249 inc/class-shortcode-ui.php:250
     163#: inc/class-shortcode-ui.php:2
    164164msgid "Insert Post Element"
    165165msgstr ""
    166166
    167 #: inc/class-shortcode-ui.php:251
     167#: inc/class-shortcode-ui.php:265
     168#. Translators: Ignore placeholder. This is replaced with the Shortcode name
     169#. string in JS
    168170msgid "%s Details"
    169171msgstr ""
    170172
    171 #: inc/class-shortcode-ui.php:252
     173#: inc/class-shortcode-ui.php:2
    172174msgid "Insert Element"
    173175msgstr ""
    174176
    175 #: inc/class-shortcode-ui.php:253
     177#: inc/class-shortcode-ui.php:2
    176178msgid "Update"
    177179msgstr ""
    178180
    179 #: inc/class-shortcode-ui.php:254
     181#: inc/class-shortcode-ui.php:2
    180182msgid "There are no attributes to configure for this Post Element."
    181183msgstr ""
    182184
    183 #: inc/class-shortcode-ui.php:255
     185#: inc/class-shortcode-ui.php:2
    184186msgid "Failed to load preview"
    185187msgstr ""
    186188
    187 #: inc/class-shortcode-ui.php:256
     189#: inc/class-shortcode-ui.php:2
    188190msgid "Search"
    189191msgstr ""
    190192
    191 #: inc/class-shortcode-ui.php:257
     193#: inc/class-shortcode-ui.php:2
    192194msgid "Insert Content"
    193195msgstr ""
    194196
    195 #: inc/class-shortcode-ui.php:297
     197#: inc/class-shortcode-ui.php:
    196198msgid "Add Post Element"
    197199msgstr ""
    198200
    199 #: inc/class-shortcode-ui.php:365
     201#: inc/class-shortcode-ui.php:3
    200202msgid "Something's rotten in the state of Denmark"
    201203msgstr ""
    202204
    203 #: inc/fields/class-field-attachment.php:79
    204 #: inc/fields/class-field-attachment.php:80
     205#: inc/fields/class-field-attachment.php:79
     206#: inc/fields/class-field-attachment.php:80
    205207msgid "Select Attachment"
     208
     209
     210
     211
     212
     213
     214
     215
    206216msgstr ""
    207217
  • shortcode-ui/tags/0.7.2/package.json

    r1536575 r1646035  
    1919    "grunt-wp-i18n": "^0.5.0",
    2020    "grunt-wp-readme-to-markdown": "~1.0.0",
     21
    2122    "remapify": "1.4.3"
    2223  },
  • shortcode-ui/tags/0.7.2/readme.txt

    r1615947 r1646035  
    33Tags: shortcodes
    44Requires at least: 4.5
    5 Tested up to: 4.7.3
    6 Stable tag: 0.7.1
     5Tested up to: 4.7.
     6Stable tag: 0.7.
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6969== Changelog ==
    7070
    71 = 0.7.1 (December 16, 2016) =
     71= 0.7.2 (April 24, 2017) =
     72* Bug fix: Fix behavior in WordPress 4.7.4 where editing a shortcode would insert a new shortcode into the editor rather than updating the shortcode being edited.
     73* Bug fix: The replacement used to escape percent (%) characters in attributes only replaced the first appearance
     74* Bug fix: For select fields with multiple=true, allow multiple options to be selected by default
     75* Added i18n for all strings in attachment field template
     76* Added Finnish translation
     77
     78= 0.7.1 (March 16, 2017) =
    7279* Change shortcode formatting to add a space before the self-closing trailing slash.
    7380* Fix alignment of attachment previews with long filenames.
  • shortcode-ui/tags/0.7.2/shortcode-ui.php

    r1615940 r1646035  
    22/**
    33 * Plugin Name: Shortcake (Shortcode UI)
    4  * Version: 0.7.1
     4 * Version: 0.7.
    55 * Description: User Interface for adding shortcodes.
    66 * Author: Fusion Engineering and community
  • shortcode-ui/trunk/inc/fields/class-shortcode-ui-field-attachment.php

    r1615940 r1646035  
    136136
    137137                <div class="thumbnail-details-container has-attachment">
    138                     <strong>Thumbnail Details</strong>
     138                    <strong></strong>
    139139                    <div class="filename">{{ data.filename }}</div>
    140140                    <div class="date-formatted">{{ data.dateFormatted }}</div>
     
    143143                        <div class="dimensions">{{ data.width }} &times; {{ data.height }}</div>
    144144                    <# } #>
    145                     <div class="edit-link"><a href="{{ data.editLink }}">Edit Attachment</a></div>
     145                    <div class="edit-link"><a href="{{ data.editLink }}"></a></div>
    146146                </div>
    147147            </div>
  • shortcode-ui/trunk/inc/templates/edit-form.tpl.php

    r1536575 r1646035  
    5555                    <optgroup label="{{ option.label }}">
    5656                        <# _.each( option.options, function( optgroupOption ) { #>
    57                             <option value="{{ optgroupOption.value }}" <# if ( optgroupOption.value === data.value ){ print('selected'); } #>>{{ optgroupOption.label }}</option>
     57                            <option value="{{ optgroupOption.value }}" <# if ( { print('selected'); } #>>{{ optgroupOption.label }}</option>
    5858                        <# }); #>
    5959                    </optgroup>
    6060                <# } else { #>
    61                     <option value="{{ option.value }}" <# if ( option.value === data.value ){ print('selected'); } #>>{{ option.label }}</option>
     61                    <option value="{{ option.value }}" <# if ( { print('selected'); } #>>{{ option.label }}</option>
    6262                <# } #>
    6363
  • shortcode-ui/trunk/js/build/shortcode-ui.js

    r1615940 r1646035  
    4848            currentShortcode: null,
    4949            action: 'select',
    50             search: null
     50            search: null,
     51            insertCallback: this.insertCallback,
    5152        });
    5253
     
    7172
    7273    insert: function() {
    73         var shortcode = this.props.get('currentShortcode');
    74         if ( shortcode ) {
    75             send_to_editor( shortcode.formatShortcode() );
    76             this.reset();
    77             this.frame.close();
    78         }
     74        var shortcode      = this.props.get( 'currentShortcode' );
     75        var insertCallback = this.props.get( 'insertCallback' );
     76
     77        if ( shortcode && insertCallback ) {
     78            insertCallback( shortcode );
     79        }
     80
     81        this.reset();
     82        this.resetState();
     83        this.frame.close();
     84    },
     85
     86    insertCallback: function( shortcode ) {
     87        window.send_to_editor( shortcode.formatShortcode() );
    7988    },
    8089
     
    8392        this.props.set( 'currentShortcode', null );
    8493        this.props.set( 'search', null );
     94
     95
     96
     97
     98
     99
     100
     101
    85102    },
    86103
     
    255272            // Encode textareas incase HTML
    256273            if ( attr.get( 'encode' ) ) {
    257                 attr.set( 'value', encodeURIComponent( decodeURIComponent( attr.get( 'value' ).replace( "%", "&#37;" ) ) ), { silent: true } );
     274                attr.set( 'value', encodeURIComponent( decodeURIComponent( attr.get( 'value' ).replace( , "&#37;" ) ) ), { silent: true } );
    258275            }
    259276
     
    640657     * @param {string} shortcodeString String representation of the shortcode
    641658     */
    642     edit: function( shortcodeString ) {
     659    edit: function( shortcodeString ) {
    643660
    644661        var currentShortcode = this.parseShortcodeString( shortcodeString );
     
    659676            }
    660677
    661             // Make sure to reset state when closed.
    662             frame.once( 'close submit', function() {
    663                 frame.state().props.set('currentShortcode', false);
    664                 var menuItem = frame.menu.get().get('shortcode-ui');
    665                 menuItem.options.text = shortcodeUIData.strings.media_frame_title;
    666                 menuItem.render();
    667                 frame.setState( 'insert' );
     678            frame.mediaController.props.set( 'insertCallback', function( shortcode ) {
     679                update( shortcode.formatShortcode() );
    668680            } );
    669681
     
    18221834        this.preselect( $field );
    18231835
    1824                 var $fieldSelect2 = $field[ shortcodeUIData.select2_handle ]({
     1836var $fieldSelect2 = $field[ shortcodeUIData.select2_handle ]({
    18251837            placeholder: "Search",
    18261838            multiple: this.model.get( 'multiple' ),
     
    18531865                cache: true
    18541866            },
     1867
    18551868            escapeMarkup: function( markup ) { return markup; },
    18561869            minimumInputLength: 1,
     
    18881901
    18891902    destroySelect2UI: function() {
    1890                 $fieldSelect2[ shortcodeUIData.select2_handle ]( 'close' );
     1903$fieldSelect2[ shortcodeUIData.select2_handle ]( 'close' );
    18911904    }
    18921905
    18931906});
    1894 
    18951907
    18961908}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  • shortcode-ui/trunk/js/src/controllers/media-controller.js

    r1615931 r1646035  
    1111            currentShortcode: null,
    1212            action: 'select',
    13             search: null
     13            search: null,
     14            insertCallback: this.insertCallback,
    1415        });
    1516
     
    3435
    3536    insert: function() {
    36         var shortcode = this.props.get('currentShortcode');
    37         if ( shortcode ) {
    38             send_to_editor( shortcode.formatShortcode() );
    39             this.reset();
    40             this.frame.close();
     37        var shortcode );
     38       
     39
     40       
     41            );
    4142        }
     43
     44
     45
     46
     47
     48
     49
     50
    4251    },
    4352
     
    4655        this.props.set( 'currentShortcode', null );
    4756        this.props.set( 'search', null );
     57
     58
     59
     60
     61
     62
     63
     64
    4865    },
    4966
  • shortcode-ui/trunk/js/src/models/shortcode.js

    r1615931 r1646035  
    7676            // Encode textareas incase HTML
    7777            if ( attr.get( 'encode' ) ) {
    78                 attr.set( 'value', encodeURIComponent( decodeURIComponent( attr.get( 'value' ).replace( "%", "&#37;" ) ) ), { silent: true } );
     78                attr.set( 'value', encodeURIComponent( decodeURIComponent( attr.get( 'value' ).replace( , "&#37;" ) ) ), { silent: true } );
    7979            }
    8080
  • shortcode-ui/trunk/js/src/utils/shortcode-view-constructor.js

    r1615931 r1646035  
    161161     * @param {string} shortcodeString String representation of the shortcode
    162162     */
    163     edit: function( shortcodeString ) {
     163    edit: function( shortcodeString ) {
    164164
    165165        var currentShortcode = this.parseShortcodeString( shortcodeString );
     
    180180            }
    181181
    182             // Make sure to reset state when closed.
    183             frame.once( 'close submit', function() {
    184                 frame.state().props.set('currentShortcode', false);
    185                 var menuItem = frame.menu.get().get('shortcode-ui');
    186                 menuItem.options.text = shortcodeUIData.strings.media_frame_title;
    187                 menuItem.render();
    188                 frame.setState( 'insert' );
     182            frame.mediaController.props.set( 'insertCallback', function( shortcode ) {
     183                update( shortcode.formatShortcode() );
    189184            } );
    190185
  • shortcode-ui/trunk/languages/shortcode-ui-fi.po

    r1536575 r1646035  
    44"Project-Id-Version: Shortcake (Shortcode UI) 0.6.0-alpha\n"
    55"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/shortcode-ui\n"
    6 "POT-Creation-Date: 2016-03-23 17:25+0200\n"
     6"POT-Creation-Date: 2017-03-29 13:09+0300\n"
     7"PO-Revision-Date: 2017-03-29 13:11+0300\n"
     8"Last-Translator: Teemu Suoranta <teemu@aucor.fi>\n"
     9"Language-Team: \n"
     10"Language: fi\n"
    711"MIME-Version: 1.0\n"
    812"Content-Type: text/plain; charset=UTF-8\n"
    913"Content-Transfer-Encoding: 8bit\n"
    10 "PO-Revision-Date: 2016-03-23 18:03+0200\n"
    11 "Language-Team: \n"
    12 "X-Generator: Poedit 1.8.7\n"
    13 "X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c\n"
     14"0\n"
     15""
     16""
     17"esc_html_x:1,2c\n"
    1418"Plural-Forms: nplurals=2; plural=(n != 1);\n"
    1519"X-Poedit-SourceCharset: UTF-8\n"
    1620"X-Poedit-Basepath: ..\n"
    1721"X-Textdomain-Support: yes\n"
    18 "Last-Translator: Teemu Suoranta <teemu@aucor.fi>\n"
    19 "Language: fi\n"
    2022"X-Poedit-SearchPath-0: .\n"
    2123
    22 #: dev.php:75
     24#: dev.php:68
     25msgid ""
     26"Shortcode UI plugin must be active for Shortcode UI Example plugin to "
     27"function."
     28msgstr ""
     29
     30#: dev.php:119
     31msgid "Shortcake With No Attributes"
     32msgstr ""
     33
     34#: dev.php:159
    2335msgid "Attachment"
    2436msgstr "Liitetiedosto"
    2537
    26 #: dev.php:79 dev.php:80
     38#: dev.php:0
    2739msgid "Select Image"
    2840msgstr "Valitse kuva"
    2941
    30 #: dev.php:83
     42#: dev.php:175
     43msgid "You can select multiple images."
     44msgstr ""
     45
     46#: dev.php:183
    3147msgid "Citation Source"
    3248msgstr "Lainauksen lähde"
    3349
    34 #: inc/class-shortcode-ui.php:109
     50#: dev.php:188
     51msgid "Test placeholder"
     52msgstr ""
     53
     54#: dev.php:193
     55#, fuzzy
     56#| msgid "Select Image"
     57msgid "Select Page"
     58msgstr "Valitse kuva"
     59
     60#: dev.php:200
     61#, fuzzy
     62#| msgid "Select Image"
     63msgid "Select Term"
     64msgstr "Valitse kuva"
     65
     66#: dev.php:207
     67msgid "User Select"
     68msgstr ""
     69
     70#: dev.php:213
     71msgid "Color"
     72msgstr ""
     73
     74#: dev.php:218
     75msgid "Hex color code"
     76msgstr ""
     77
     78#: dev.php:222
     79msgid "Alignment"
     80msgstr ""
     81
     82#: dev.php:223
     83msgid ""
     84"Whether the quotation should be displayed as pull-left, pull-right, or "
     85"neither."
     86msgstr ""
     87
     88#: dev.php:227
     89msgid "None"
     90msgstr ""
     91
     92#: dev.php:228 dev.php:233
     93msgid "Pull Left"
     94msgstr ""
     95
     96#: dev.php:229 dev.php:234
     97msgid "Pull Right"
     98msgstr ""
     99
     100#: dev.php:240
     101msgid "Year"
     102msgstr ""
     103
     104#: dev.php:241
     105msgid "Optional. The year the quotation is from."
     106msgstr ""
     107
     108#: dev.php:260
     109msgid "Shortcake Dev"
     110msgstr ""
     111
     112#: dev.php:279
     113msgid "Quote"
     114msgstr ""
     115
     116#: dev.php:280
     117msgid "Include a statement from someone famous."
     118msgstr ""
     119
     120#: dev.php:352
     121#, fuzzy
     122#| msgid "Inner Content"
     123msgid "Content:"
     124msgstr "Sisempi sisältö"
     125
     126#: dev.php:356
     127msgid "Source:"
     128msgstr ""
     129
     130#: dev.php:360
     131msgid "Image:"
     132msgstr ""
     133
     134#: dev.php:364
     135msgid "Gallery:"
     136msgstr ""
     137
     138#: dev.php:372
     139msgid "Pages:"
     140msgstr ""
     141
     142#: dev.php:376
     143msgid "Terms:"
     144msgstr ""
     145
     146#: dev.php:380
     147msgid "Users:"
     148msgstr ""
     149
     150#: dev.php:384
     151msgid "Color:"
     152msgstr ""
     153
     154#: dev.php:388
     155msgid "Alignment:"
     156msgstr ""
     157
     158#: dev.php:392
     159msgid "Year:"
     160msgstr ""
     161
     162#: inc/class-shortcode-ui.php:110
    35163msgid "Inner Content"
    36164msgstr "Sisempi sisältö"
    37165
    38 #: inc/class-shortcode-ui.php:220 inc/class-shortcode-ui.php:221
     166#: inc/class-shortcode-ui.php:2
    39167msgid "Insert Post Element"
    40168msgstr "Lisää sisältöelementti"
    41169
    42 #: inc/class-shortcode-ui.php:222
     170#: inc/class-shortcode-ui.php:2
    43171msgid "%s Details"
    44172msgstr "%s tiedot"
    45173
    46 #: inc/class-shortcode-ui.php:223
     174#: inc/class-shortcode-ui.php:2
    47175msgid "Insert Element"
    48176msgstr "Lisää elementti"
    49177
    50 #: inc/class-shortcode-ui.php:224
     178#: inc/class-shortcode-ui.php:2
    51179msgid "Update"
    52180msgstr "Päivitä"
    53181
    54 #: inc/class-shortcode-ui.php:225
     182#: inc/class-shortcode-ui.php:2
    55183msgid "There are no attributes to configure for this Post Element."
    56184msgstr "Tässä sisältöelementissä ei ole muokattavia asetuksia."
    57185
    58 #: inc/class-shortcode-ui.php:226
     186#: inc/class-shortcode-ui.php:2
    59187msgid "Failed to load preview"
    60188msgstr "Esikatselun lataus epäonnistui"
    61189
    62 #: inc/class-shortcode-ui.php:227
     190#: inc/class-shortcode-ui.php:2
    63191msgid "Search"
    64192msgstr "Etsi"
    65193
    66 #: inc/class-shortcode-ui.php:228
     194#: inc/class-shortcode-ui.php:2
    67195msgid "Insert Content"
    68196msgstr "Lisää sisältö"
    69197
    70 #: inc/class-shortcode-ui.php:323
     198#: inc/class-shortcode-ui.php:297
     199msgid "Add Post Element"
     200msgstr "Lisää sisältöelementti"
     201
     202#: inc/class-shortcode-ui.php:365
    71203msgid "Something's rotten in the state of Denmark"
    72204msgstr "Jotain mätää Tanskanmaalla"
     
    77209msgstr "Valitse liitetiedosto"
    78210
    79 #: inc/fields/class-field-attachment.php:104
    80 msgid "Thumbnail Details"
    81 msgstr "Liitteen tiedot"
    82 
    83 #: inc/fields/class-field-attachment.php:109
    84 msgid "Edit Attachment"
    85 msgstr "Muokkaa liitetiedostoa"
    86 
    87211#: inc/templates/edit-form.tpl.php:3
    88212msgid "Back to list"
     
    104228msgid "http://next.fusion.net/tag/shortcode-ui/"
    105229msgstr "http://next.fusion.net/tag/shortcode-ui/"
     230
     231
     232
     233
     234
     235
  • shortcode-ui/trunk/languages/shortcode-ui.pot

    r1615940 r1646035  
    1 # Copyright (C) 2016 Fusion Engineering and community
     1# Copyright (C) 201 Fusion Engineering and community
    22# This file is distributed under the GPL v2 or later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Shortcake (Shortcode UI) 0.7.1\n"
     5"Project-Id-Version: Shortcake (Shortcode UI) 0.7.\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/shortcode-ui\n"
    7 "POT-Creation-Date: 2016-12-16 22:19:41+00:00\n"
     7"POT-Creation-Date: 201+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=utf-8\n"
    1010"Content-Transfer-Encoding: 8bit\n"
    11 "PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n"
     11"PO-Revision-Date: 201-MO-DA HO:MI+ZONE\n"
    1212"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    1313"Language-Team: LANGUAGE <LL@li.org>\n"
     
    157157msgstr ""
    158158
    159 #: inc/class-shortcode-ui.php:110
     159#: inc/class-shortcode-ui.php:11
    160160msgid "Inner Content"
    161161msgstr ""
    162162
    163 #: inc/class-shortcode-ui.php:249 inc/class-shortcode-ui.php:250
     163#: inc/class-shortcode-ui.php:2
    164164msgid "Insert Post Element"
    165165msgstr ""
    166166
    167 #: inc/class-shortcode-ui.php:251
     167#: inc/class-shortcode-ui.php:265
     168#. Translators: Ignore placeholder. This is replaced with the Shortcode name
     169#. string in JS
    168170msgid "%s Details"
    169171msgstr ""
    170172
    171 #: inc/class-shortcode-ui.php:252
     173#: inc/class-shortcode-ui.php:2
    172174msgid "Insert Element"
    173175msgstr ""
    174176
    175 #: inc/class-shortcode-ui.php:253
     177#: inc/class-shortcode-ui.php:2
    176178msgid "Update"
    177179msgstr ""
    178180
    179 #: inc/class-shortcode-ui.php:254
     181#: inc/class-shortcode-ui.php:2
    180182msgid "There are no attributes to configure for this Post Element."
    181183msgstr ""
    182184
    183 #: inc/class-shortcode-ui.php:255
     185#: inc/class-shortcode-ui.php:2
    184186msgid "Failed to load preview"
    185187msgstr ""
    186188
    187 #: inc/class-shortcode-ui.php:256
     189#: inc/class-shortcode-ui.php:2
    188190msgid "Search"
    189191msgstr ""
    190192
    191 #: inc/class-shortcode-ui.php:257
     193#: inc/class-shortcode-ui.php:2
    192194msgid "Insert Content"
    193195msgstr ""
    194196
    195 #: inc/class-shortcode-ui.php:297
     197#: inc/class-shortcode-ui.php:
    196198msgid "Add Post Element"
    197199msgstr ""
    198200
    199 #: inc/class-shortcode-ui.php:365
     201#: inc/class-shortcode-ui.php:3
    200202msgid "Something's rotten in the state of Denmark"
    201203msgstr ""
    202204
    203 #: inc/fields/class-field-attachment.php:79
    204 #: inc/fields/class-field-attachment.php:80
     205#: inc/fields/class-field-attachment.php:79
     206#: inc/fields/class-field-attachment.php:80
    205207msgid "Select Attachment"
     208
     209
     210
     211
     212
     213
     214
     215
    206216msgstr ""
    207217
  • shortcode-ui/trunk/package.json

    r1536575 r1646035  
    1919    "grunt-wp-i18n": "^0.5.0",
    2020    "grunt-wp-readme-to-markdown": "~1.0.0",
     21
    2122    "remapify": "1.4.3"
    2223  },
  • shortcode-ui/trunk/readme.txt

    r1615947 r1646035  
    33Tags: shortcodes
    44Requires at least: 4.5
    5 Tested up to: 4.7.3
    6 Stable tag: 0.7.1
     5Tested up to: 4.7.
     6Stable tag: 0.7.
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6969== Changelog ==
    7070
    71 = 0.7.1 (December 16, 2016) =
     71= 0.7.2 (April 24, 2017) =
     72* Bug fix: Fix behavior in WordPress 4.7.4 where editing a shortcode would insert a new shortcode into the editor rather than updating the shortcode being edited.
     73* Bug fix: The replacement used to escape percent (%) characters in attributes only replaced the first appearance
     74* Bug fix: For select fields with multiple=true, allow multiple options to be selected by default
     75* Added i18n for all strings in attachment field template
     76* Added Finnish translation
     77
     78= 0.7.1 (March 16, 2017) =
    7279* Change shortcode formatting to add a space before the self-closing trailing slash.
    7380* Fix alignment of attachment previews with long filenames.
  • shortcode-ui/trunk/shortcode-ui.php

    r1615940 r1646035  
    22/**
    33 * Plugin Name: Shortcake (Shortcode UI)
    4  * Version: 0.7.1
     4 * Version: 0.7.
    55 * Description: User Interface for adding shortcodes.
    66 * Author: Fusion Engineering and community
Note: See TracChangeset for help on using the changeset viewer.