From 9d459f3db7d19ae3832d6517eed4fca59a73379d Mon Sep 17 00:00:00 2001 From: Nathaniel Taintor Date: Wed, 29 Mar 2017 13:17:58 -0700 Subject: [PATCH 01/18] Warn on activation if no supported shortcodes Adds an admin notice on activation warning if no shortcodes with UI are available. --- inc/class-shortcode-ui.php | 32 ++++++++++++++++++++++++++++++++ shortcode-ui.php | 11 +++++++++++ 2 files changed, 43 insertions(+) diff --git a/inc/class-shortcode-ui.php b/inc/class-shortcode-ui.php index c1fd8ffe..a7f337e1 100644 --- a/inc/class-shortcode-ui.php +++ b/inc/class-shortcode-ui.php @@ -73,6 +73,7 @@ private function __construct() { * Setup plugin actions. */ private function setup_actions() { + add_action( 'admin_notices', array( $this, 'action_admin_notices' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'action_admin_enqueue_scripts' ) ); add_action( 'wp_enqueue_editor', array( $this, 'action_wp_enqueue_editor' ) ); add_action( 'media_buttons', array( $this, 'action_media_buttons' ) ); @@ -80,6 +81,37 @@ private function setup_actions() { add_filter( 'wp_editor_settings', array( $this, 'filter_wp_editor_settings' ), 10, 2 ); } + /** + * Display an admin notice on activation. + * + * If no shortcodes with Shortcake UI are registered, this Will display a link to the plugin's wiki for examples. + * If there are already plugins with UI registered, will just display a success message. + * + * @return void + */ + public function action_admin_notices() { + if ( ! get_option( 'shortcode_ui_activation_notice' ) ) { + return; + } + + $shortcodes_with_ui = $this->get_shortcodes(); + + if ( empty( $shortcodes_with_ui ) ) { + echo '

'. + sprintf( + __( 'The Shortcode UI plugin will not do anything unless UI is registered for shortcodes through a theme or plugins. For examples, see here.', 'shortcode-ui' ), + 'https://github.com/wp-shortcake/shortcake/wiki/Shortcode-UI-Examples' + ) . + '

' . "\n"; + } else { + echo '

'. + esc_html__( 'That\'s all! Try out the shortcode UI through the "Add Post element" button in the post edit screen.', 'shortcode-ui' ) . + '

' . "\n"; + } + + delete_option( 'shortcode_ui_activation_notice' ); + } + /** * When a WP_Editor is initialized on a page, call the 'register_shortcode_ui' action. * diff --git a/shortcode-ui.php b/shortcode-ui.php index 56062e53..f183a9e2 100644 --- a/shortcode-ui.php +++ b/shortcode-ui.php @@ -110,6 +110,17 @@ function shortcode_ui_register_for_shortcode( $shortcode_tag, $args = array() ) Shortcode_UI::get_instance()->register_shortcode_ui( $shortcode_tag, $args ); } +/** + * Display an admin notice on activating the plugin if no shortcodes with UI are available. + * + * @return void + */ +function shortcode_ui_activation_notice() { + update_option( 'shortcode_ui_activation_notice', true ); +} + +register_activation_hook( __FILE__, 'shortcode_ui_activation_notice' ); + /** * Get register UI args by shortcode tag * From 4420a9e3b569110417d0b0c743dcefee5ff91c21 Mon Sep 17 00:00:00 2001 From: Nathaniel Taintor Date: Wed, 29 Mar 2017 13:24:38 -0700 Subject: [PATCH 02/18] Disable the media button if no shortcodes are registered The "Add post element" button does nothing if no shortcode UIs are registered. This prevents it from being attached to the editor if no shortcodes are available to be inserted through it. (Note that because `register_shortcode_ui` has access to the editor ID as context, it's possible for shortcodes to be registered in some editor contexts and not others. This handles that sort of... to the same degree that `register_shortcode_ui` does, at least.) --- inc/class-shortcode-ui.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/inc/class-shortcode-ui.php b/inc/class-shortcode-ui.php index a7f337e1..812556b9 100644 --- a/inc/class-shortcode-ui.php +++ b/inc/class-shortcode-ui.php @@ -94,9 +94,7 @@ public function action_admin_notices() { return; } - $shortcodes_with_ui = $this->get_shortcodes(); - - if ( empty( $shortcodes_with_ui ) ) { + if ( ! $this->has_shortcodes() ) { echo '

'. sprintf( __( 'The Shortcode UI plugin will not do anything unless UI is registered for shortcodes through a theme or plugins. For examples, see here.', 'shortcode-ui' ), @@ -213,6 +211,15 @@ public function get_shortcodes() { return $shortcodes; } + /** + * Whether any shortcodes with UI are registered + * + * @return bool + */ + public function has_shortcodes() { + return ! empty( $this->get_shortcodes() ); + } + /** * Get UI configuration parameters for a given shortcode. * @@ -337,6 +344,10 @@ public function action_wp_enqueue_editor() { * Output an "Add Post Element" button with the media buttons. */ public function action_media_buttons( $editor_id ) { + if ( ! $this->has_shortcodes() ) { + return; + } + printf( '', From 07b145e0db8fc57525d3ace8425673fd8a5c83df Mon Sep 17 00:00:00 2001 From: Nathaniel Taintor Date: Wed, 29 Mar 2017 14:17:46 -0700 Subject: [PATCH 03/18] Fix some codesniff issues, better escaping --- inc/class-shortcode-ui.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/inc/class-shortcode-ui.php b/inc/class-shortcode-ui.php index 812556b9..8206845f 100644 --- a/inc/class-shortcode-ui.php +++ b/inc/class-shortcode-ui.php @@ -95,14 +95,23 @@ public function action_admin_notices() { } if ( ! $this->has_shortcodes() ) { - echo '

'. + echo '

' . sprintf( - __( 'The Shortcode UI plugin will not do anything unless UI is registered for shortcodes through a theme or plugins. For examples, see here.', 'shortcode-ui' ), + wp_kses( + /* Translators: link to plugin wiki page with examples of shortcodes supporting Shortcake UI */ + __( 'The Shortcode UI plugin will not do anything unless UI is registered for shortcodes through a theme or plugins. For examples, see here.', 'shortcode-ui' ), + array( + 'a' => array( + 'href' => array(), + 'target' => array(), + ), + ) + ), 'https://github.com/wp-shortcake/shortcake/wiki/Shortcode-UI-Examples' ) . '

' . "\n"; } else { - echo '

'. + echo '

' . esc_html__( 'That\'s all! Try out the shortcode UI through the "Add Post element" button in the post edit screen.', 'shortcode-ui' ) . '

' . "\n"; } From 55eff2df32ccf13fa7fed1315750801803886159 Mon Sep 17 00:00:00 2001 From: Nathaniel Taintor Date: Wed, 26 Apr 2017 13:23:46 -0700 Subject: [PATCH 04/18] Avoide fatals in PHP 5.2 Prevent throwing fatals in PHP 5.2 by casting to bool rather than checking if $this->get_shortcodes is empty(). --- inc/class-shortcode-ui.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/class-shortcode-ui.php b/inc/class-shortcode-ui.php index 8206845f..c1315052 100644 --- a/inc/class-shortcode-ui.php +++ b/inc/class-shortcode-ui.php @@ -226,7 +226,7 @@ public function get_shortcodes() { * @return bool */ public function has_shortcodes() { - return ! empty( $this->get_shortcodes() ); + return ( bool ) $this->get_shortcodes(); } /** From cc6c2884bf44212ff2602f03bc3d1d65fa3326d6 Mon Sep 17 00:00:00 2001 From: Nathaniel Taintor Date: Wed, 26 Apr 2017 13:30:58 -0700 Subject: [PATCH 05/18] Whitespace fix for code linting --- inc/class-shortcode-ui.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/class-shortcode-ui.php b/inc/class-shortcode-ui.php index c1315052..114ead2a 100644 --- a/inc/class-shortcode-ui.php +++ b/inc/class-shortcode-ui.php @@ -226,7 +226,7 @@ public function get_shortcodes() { * @return bool */ public function has_shortcodes() { - return ( bool ) $this->get_shortcodes(); + return (bool) $this->get_shortcodes(); } /** From c71ab6ff81172e0838b1aecc408073a273c3c2f1 Mon Sep 17 00:00:00 2001 From: Matthew Haines-Young Date: Thu, 27 Apr 2017 17:58:02 +0100 Subject: [PATCH 06/18] Fix bug where router shows uneccesarily --- js/src/controllers/media-controller.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/src/controllers/media-controller.js b/js/src/controllers/media-controller.js index 2dca659e..b3285ae7 100644 --- a/js/src/controllers/media-controller.js +++ b/js/src/controllers/media-controller.js @@ -15,9 +15,15 @@ var MediaController = wp.media.controller.State.extend({ }); this.props.on( 'change:action', this.refresh, this ); + this.on( 'activate', this.activate, this ); }, + activate: function() { + var $el = this.frame.$el; + _.defer( function() { $el.addClass( 'hide-router' ); } ); + }, + refresh: function() { if ( this.frame && this.frame.toolbar ) { this.frame.toolbar.get().refresh(); From b30b9e240b96d050540a34bb41076ad773277e20 Mon Sep 17 00:00:00 2001 From: Matthew Haines-Young Date: Thu, 27 Apr 2017 17:58:15 +0100 Subject: [PATCH 07/18] Ensure state is reset on close --- js/src/shortcode-ui.js | 7 ++----- js/src/utils/shortcode-view-constructor.js | 6 ++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/js/src/shortcode-ui.js b/js/src/shortcode-ui.js index 8bfcec02..fb1e9fe6 100644 --- a/js/src/shortcode-ui.js +++ b/js/src/shortcode-ui.js @@ -49,11 +49,8 @@ $(document).ready(function(){ // Make sure to reset state when closed. frame.once( 'close submit', function() { - frame.state().props.set('currentShortcode', false); - var menuItem = frame.menu.get().get('shortcode-ui'); - menuItem.options.text = shortcodeUIData.strings.media_frame_title; - menuItem.render(); - frame.setState( 'insert' ); + frame.mediaController.reset(); + frame.mediaController.resetState(); } ); } ); diff --git a/js/src/utils/shortcode-view-constructor.js b/js/src/utils/shortcode-view-constructor.js index ac598c3b..19bc5cdd 100644 --- a/js/src/utils/shortcode-view-constructor.js +++ b/js/src/utils/shortcode-view-constructor.js @@ -183,6 +183,12 @@ var shortcodeViewConstructor = { update( shortcode.formatShortcode() ); } ); + // Make sure to reset state when closed. + frame.once( 'close submit', function() { + frame.mediaController.reset(); + frame.mediaController.resetState(); + } ); + /* Trigger render_edit */ /* * Action run after an edit shortcode overlay is rendered. From e8f25d379e20694d6f8069a41a5c92e7c8d76edb Mon Sep 17 00:00:00 2001 From: Matthew Haines-Young Date: Thu, 27 Apr 2017 17:58:50 +0100 Subject: [PATCH 08/18] Compile --- js/build/shortcode-ui.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/js/build/shortcode-ui.js b/js/build/shortcode-ui.js index cdb4f689..a989ab81 100644 --- a/js/build/shortcode-ui.js +++ b/js/build/shortcode-ui.js @@ -52,9 +52,15 @@ var MediaController = wp.media.controller.State.extend({ }); this.props.on( 'change:action', this.refresh, this ); + this.on( 'activate', this.activate, this ); }, + activate: function() { + var $el = this.frame.$el; + _.defer( function() { $el.addClass( 'hide-router' ); } ); + }, + refresh: function() { if ( this.frame && this.frame.toolbar ) { this.frame.toolbar.get().refresh(); @@ -366,11 +372,8 @@ $(document).ready(function(){ // Make sure to reset state when closed. frame.once( 'close submit', function() { - frame.state().props.set('currentShortcode', false); - var menuItem = frame.menu.get().get('shortcode-ui'); - menuItem.options.text = shortcodeUIData.strings.media_frame_title; - menuItem.render(); - frame.setState( 'insert' ); + frame.mediaController.reset(); + frame.mediaController.resetState(); } ); } ); @@ -679,6 +682,12 @@ var shortcodeViewConstructor = { update( shortcode.formatShortcode() ); } ); + // Make sure to reset state when closed. + frame.once( 'close submit', function() { + frame.mediaController.reset(); + frame.mediaController.resetState(); + } ); + /* Trigger render_edit */ /* * Action run after an edit shortcode overlay is rendered. From 0a52f0dca5a26652a90f3ae4b626a5ae62336b60 Mon Sep 17 00:00:00 2001 From: Matthew Haines-Young Date: Wed, 3 May 2017 23:06:59 +0100 Subject: [PATCH 09/18] Consolidate reset and resetState --- js/src/controllers/media-controller.js | 4 +--- js/src/shortcode-ui.js | 1 - js/src/utils/shortcode-view-constructor.js | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/js/src/controllers/media-controller.js b/js/src/controllers/media-controller.js index b3285ae7..f99b5b85 100644 --- a/js/src/controllers/media-controller.js +++ b/js/src/controllers/media-controller.js @@ -48,7 +48,6 @@ var MediaController = wp.media.controller.State.extend({ } this.reset(); - this.resetState(); this.frame.close(); }, @@ -61,12 +60,11 @@ var MediaController = wp.media.controller.State.extend({ this.props.set( 'currentShortcode', null ); this.props.set( 'search', null ); this.props.set( 'insertCallback', this.insertCallback ); - }, - resetState: function() { var menuItem = this.frame.menu.get().get('shortcode-ui'); menuItem.options.text = shortcodeUIData.strings.media_frame_title; menuItem.render(); + this.frame.setState( 'insert' ); }, diff --git a/js/src/shortcode-ui.js b/js/src/shortcode-ui.js index fb1e9fe6..03c13ffe 100644 --- a/js/src/shortcode-ui.js +++ b/js/src/shortcode-ui.js @@ -50,7 +50,6 @@ $(document).ready(function(){ // Make sure to reset state when closed. frame.once( 'close submit', function() { frame.mediaController.reset(); - frame.mediaController.resetState(); } ); } ); diff --git a/js/src/utils/shortcode-view-constructor.js b/js/src/utils/shortcode-view-constructor.js index 19bc5cdd..e74ec52a 100644 --- a/js/src/utils/shortcode-view-constructor.js +++ b/js/src/utils/shortcode-view-constructor.js @@ -186,7 +186,6 @@ var shortcodeViewConstructor = { // Make sure to reset state when closed. frame.once( 'close submit', function() { frame.mediaController.reset(); - frame.mediaController.resetState(); } ); /* Trigger render_edit */ From 680be2b436accafaf30edc81c9e0d1397398ff1c Mon Sep 17 00:00:00 2001 From: Matthew Haines-Young Date: Wed, 3 May 2017 23:08:18 +0100 Subject: [PATCH 10/18] Recompile --- js/build/shortcode-ui.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/js/build/shortcode-ui.js b/js/build/shortcode-ui.js index a989ab81..3ffa6b64 100644 --- a/js/build/shortcode-ui.js +++ b/js/build/shortcode-ui.js @@ -85,7 +85,6 @@ var MediaController = wp.media.controller.State.extend({ } this.reset(); - this.resetState(); this.frame.close(); }, @@ -98,12 +97,11 @@ var MediaController = wp.media.controller.State.extend({ this.props.set( 'currentShortcode', null ); this.props.set( 'search', null ); this.props.set( 'insertCallback', this.insertCallback ); - }, - resetState: function() { var menuItem = this.frame.menu.get().get('shortcode-ui'); menuItem.options.text = shortcodeUIData.strings.media_frame_title; menuItem.render(); + this.frame.setState( 'insert' ); }, @@ -373,7 +371,6 @@ $(document).ready(function(){ // Make sure to reset state when closed. frame.once( 'close submit', function() { frame.mediaController.reset(); - frame.mediaController.resetState(); } ); } ); @@ -685,7 +682,6 @@ var shortcodeViewConstructor = { // Make sure to reset state when closed. frame.once( 'close submit', function() { frame.mediaController.reset(); - frame.mediaController.resetState(); } ); /* Trigger render_edit */ From f5480f3d43040e24d1d94ea433c3dc0599a84dfa Mon Sep 17 00:00:00 2001 From: Nathaniel Taintor Date: Wed, 3 May 2017 16:35:42 -0700 Subject: [PATCH 11/18] More clear, less informal, notice language "That's all" is unclear in this context. Better to give some context as to what the activation notice is actually referring to. --- inc/class-shortcode-ui.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/class-shortcode-ui.php b/inc/class-shortcode-ui.php index 114ead2a..4a2c9592 100644 --- a/inc/class-shortcode-ui.php +++ b/inc/class-shortcode-ui.php @@ -112,7 +112,7 @@ public function action_admin_notices() { '

' . "\n"; } else { echo '

' . - esc_html__( 'That\'s all! Try out the shortcode UI through the "Add Post element" button in the post edit screen.', 'shortcode-ui' ) . + esc_html__( 'Shortcode UI is installed. Try out the shortcode UI through the "Add Post element" button in the post edit screen.', 'shortcode-ui' ) . '

' . "\n"; } From fee48dc2b378f60966ba34fa8b5cec0bca26aa8f Mon Sep 17 00:00:00 2001 From: Martin Folkeseth Date: Mon, 8 May 2017 13:53:23 +0200 Subject: [PATCH 12/18] updated norwegian translation --- languages/shortcode-ui-nb_NO.mo | Bin 2788 -> 3076 bytes languages/shortcode-ui-nb_NO.po | 171 +++++++++++++++++++++----------- 2 files changed, 112 insertions(+), 59 deletions(-) diff --git a/languages/shortcode-ui-nb_NO.mo b/languages/shortcode-ui-nb_NO.mo index 5470a140e1467c83e0373e9da950949b3f053e37..627c9bcba1bde5c37f18e6e0edc07267aca1abe3 100644 GIT binary patch literal 3076 zcmZ{lO>7)B6vtgC6c%V9K+9Lb1p+P2Og1T{WuhFKG-*TACS*4)A3~8crOK|2H$cNh%nv=VyED_vPoe zKlN?B%ofzA4{ylIz#_xl){!?%-con=4{I2|dqvRjpgP8vZ#EL@GMAnUjXj`-z|9=q_}(n&VXNn+raJEO#64@ zMRD0(j(xBnrf^7|W*;(Hy$kNt=jOklr&wC{KDG4L<&47dxy zBe^L^`<6hm=N*vz`T+F6k3sy{^>Y3P5UI&-fTZ_VkmUXbBDHgw9Hi$VG)nX5X;3~- zb~_;1PdZ3W_koxqzrg3ZlOWkd`A<1d`Y30*55<*Y(vL=GNcl>>Jc~xT_W~N_IK`8m z{b+Pn-REg^5Eix@?NPL6(CB#>jbcX+oelXtfJSkpm_3fh`Yk^yok)~rN1}+&rq=NZ zCEHRvc0?ty-rNh=5$8nMEM|M%o{TXOwzx~VN~~k!i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MExxlSVUjZItye( zSstN9b!b!dqzPg+LsqFpb*M!dp7yt}Y0wbcMqn#oD>bF*Z+9JaCt5Kc3aCrxXf%9+ zZcscx)5v@6=mA8NkKXV_RY3~7D3Y*kVxRZlGf-@)_ks|CwS5FeIV0EeK(WRC_U33% zri5{`n951M(H^4ofhfDO9HfBOSslUa0{mQ5{Gdc?HXqr9laf_B$HXD*mY`8lxK&_B-xSOgEXHZwd@}+zu{y6 diff --git a/languages/shortcode-ui-nb_NO.po b/languages/shortcode-ui-nb_NO.po index f8084340..c0a15034 100644 --- a/languages/shortcode-ui-nb_NO.po +++ b/languages/shortcode-ui-nb_NO.po @@ -1,19 +1,27 @@ +# Copyright (C) 2017 Fusion Engineering and community +# This file is distributed under the GPL v2 or later. msgid "" msgstr "" -"Project-Id-Version: \n" +"Project-Id-Version: Shortcake (Shortcode UI) 0.7.2\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/shortcode-" "ui\n" -"POT-Creation-Date: 2017-03-07 12:35+0100\n" -"PO-Revision-Date: 2017-03-07 12:47+0100\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: nb\n" +"POT-Creation-Date: 2017-05-08 13:39+0200\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.8.12\n" -"X-Poedit-Basepath: .\n" +"PO-Revision-Date: 2017-05-08 13:50+0200\n" +"Language-Team: \n" +"X-Generator: Poedit 2.0.1\n" +"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" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-Basepath: ..\n" +"X-Textdomain-Support: yes\n" +"Last-Translator: \n" +"Language: nb\n" +"X-Poedit-SearchPath-0: .\n" #: dev.php:68 msgid "" @@ -35,137 +43,182 @@ msgstr "Vedlegg" msgid "Select Image" msgstr "Velg bilde" -#: dev.php:173 +#: dev.php:175 +msgid "You can select multiple images." +msgstr "Du kan velge felre bilder." + +#: dev.php:183 msgid "Citation Source" msgstr "Kilde" -#: dev.php:178 +#: dev.php:188 msgid "Test placeholder" -msgstr "Test placeholder" +msgstr "Text placeholder" -#: dev.php:183 +#: dev.php:193 msgid "Select Page" msgstr "Velg Side" -#: dev.php:190 -msgid "Background Color" -msgstr "Bagrunnsfarge" +#: dev.php:200 +msgid "Select Term" +msgstr "Bakgrunnsfarge" + +#: dev.php:207 +msgid "User Select" +msgstr "Velg bruker" + +#: dev.php:213 +msgid "Color" +msgstr "Farge" -#: dev.php:195 +#: dev.php:218 msgid "Hex color code" -msgstr "Fargens hex kode verdi" +msgstr "Hex fargekode" -#: dev.php:199 +#: dev.php:222 msgid "Alignment" msgstr "Justering" -#: dev.php:200 +#: dev.php:223 msgid "" "Whether the quotation should be displayed as pull-left, pull-right, or " "neither." -msgstr "Om sitat skal vises som venstre, høyre eller ingen av de." +msgstr "" -#: dev.php:204 +#: dev.php:227 msgid "None" msgstr "Ingen" -#: dev.php:205 +#: dev.php:228 dev.php:233 msgid "Pull Left" -msgstr "Ventrejuster" +msgstr "Juster venstre" -#: dev.php:206 +#: dev.php:229 dev.php:234 msgid "Pull Right" -msgstr "Høyrejuster" +msgstr "Juster høyre" -#: dev.php:210 +#: dev.php:240 msgid "Year" msgstr "År" -#: dev.php:211 +#: dev.php:241 msgid "Optional. The year the quotation is from." -msgstr "Valgfri. Året sitatet er fra." +msgstr "Valgfri. År for sitat" -#: dev.php:230 +#: dev.php:260 msgid "Shortcake Dev" -msgstr "Shortcake Dev" +msgstr "" -#: dev.php:249 +#: dev.php:279 msgid "Quote" msgstr "Sitat" -#: dev.php:250 +#: dev.php:280 msgid "Include a statement from someone famous." -msgstr "Inkluder påstand fra noen berømt." +msgstr "Inkluder sitat fra noen berømt" -#: dev.php:288 +#: dev.php:352 msgid "Content:" msgstr "Innhold:" -#: dev.php:289 +#: dev.php:356 msgid "Source:" msgstr "Kilde:" -#: dev.php:290 +#: dev.php:360 msgid "Image:" msgstr "Bilde:" -#: inc/class-shortcode-ui.php:109 +#: dev.php:364 +msgid "Gallery:" +msgstr "Galleri:" + +#: dev.php:372 +msgid "Pages:" +msgstr "Sider:" + +#: dev.php:376 +msgid "Terms:" +msgstr "Betingelser:" + +#: dev.php:380 +msgid "Users:" +msgstr "Brukere:" + +#: dev.php:384 +msgid "Color:" +msgstr "Farge:" + +#: dev.php:388 +msgid "Alignment:" +msgstr "Justering:" + +#: dev.php:392 +msgid "Year:" +msgstr "År:" + +#: inc/class-shortcode-ui.php:118 msgid "Inner Content" -msgstr "Indre innhold:" +msgstr "Indre Innhold" -#: inc/class-shortcode-ui.php:236 inc/class-shortcode-ui.php:237 +#: inc/class-shortcode-ui.php:262 inc/class-shortcode-ui.php:263 msgid "Insert Post Element" -msgstr "Sett inn Innlegg-element" +msgstr "Sett inn innleggselement" -#: inc/class-shortcode-ui.php:238 +#. Translators: Ignore placeholder. This is replaced with the Shortcode name +#. string in JS +#: inc/class-shortcode-ui.php:265 msgid "%s Details" -msgstr "%s Detaljer" +msgstr "% Detaljer" -#: inc/class-shortcode-ui.php:239 +#: inc/class-shortcode-ui.php:266 msgid "Insert Element" msgstr "Sett inn element" -#: inc/class-shortcode-ui.php:240 +#: inc/class-shortcode-ui.php:267 msgid "Update" msgstr "Oppdater" -#: inc/class-shortcode-ui.php:241 +#: inc/class-shortcode-ui.php:268 msgid "There are no attributes to configure for this Post Element." msgstr "" -"Det er ingen attributter for å konfigurere dette Innleggselementet." -#: inc/class-shortcode-ui.php:242 +#: inc/class-shortcode-ui.php:269 msgid "Failed to load preview" msgstr "Fikk ikke lastet forhåndsvisning" -#: inc/class-shortcode-ui.php:243 +#: inc/class-shortcode-ui.php:270 msgid "Search" msgstr "Søk" -#: inc/class-shortcode-ui.php:244 +#: inc/class-shortcode-ui.php:271 msgid "Insert Content" msgstr "Sett inn innhold" -#: inc/class-shortcode-ui.php:339 +#: inc/class-shortcode-ui.php:312 +msgid "Add Post Element" +msgstr "Sett inn innleggselement" + +#: inc/class-shortcode-ui.php:380 msgid "Something's rotten in the state of Denmark" -msgstr "Noe er rottent i Dannmark" +msgstr "" -#: inc/fields/class-field-attachment.php:79 -#: inc/fields/class-field-attachment.php:80 +#: inc/fields/class-shortcode-ui-field-attachment.php:79 +#: inc/fields/class-shortcode-ui-field-attachment.php:80 msgid "Select Attachment" msgstr "Velg vedlegg" -#: inc/fields/class-field-attachment.php:104 -msgid "Thumbnail Details" -msgstr "Thumbnail detaljer" +#: inc/fields/class-shortcode-ui-field-attachment.php:138 +msgid "Attachment Details" +msgstr "Vedleggsdetaljer" -#: inc/fields/class-field-attachment.php:109 +#: inc/fields/class-shortcode-ui-field-attachment.php:145 msgid "Edit Attachment" msgstr "Endre vedlegg" #: inc/templates/edit-form.tpl.php:3 msgid "Back to list" -msgstr "Tilbake til listen" +msgstr "Tilbake til oversikten" #. Plugin Name of the plugin/theme msgid "Shortcake (Shortcode UI)" @@ -173,7 +226,7 @@ msgstr "" #. Description of the plugin/theme msgid "User Interface for adding shortcodes." -msgstr "Brukergrensesnitt for å legge til shortcodes." +msgstr "Brukergrensesnitt for å legge inn shortcodes" #. Author of the plugin/theme msgid "Fusion Engineering and community" From 7c64424d27146814060f6c7e337ef16c22b2427a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Mon, 8 May 2017 14:10:50 +0200 Subject: [PATCH 13/18] Fix composer config The name changed to lowercase. --- composer.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index fefd5b0b..be729193 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,9 @@ { - "name": "fusioneng/Shortcake", + "name": "fusioneng/shortcake", "description": "Shortcake makes using WordPress shortcodes a piece of cake.", "type": "wordpress-plugin", "homepage": "https://github.com/fusioneng/Shortcake", + "license": "GPL-2.0+", "authors": [ { "name": "Fusion", @@ -11,7 +12,7 @@ } ], "require-dev": { - "squizlabs/php_codesniffer": "2.x-dev", + "squizlabs/php_codesniffer": "2.9.*", "wp-coding-standards/wpcs": "dev-develop" }, "scripts": { From e53449d933e587a519493d5812e0663c395dcfce Mon Sep 17 00:00:00 2001 From: Paul Sowden Date: Fri, 12 May 2017 21:42:50 -0700 Subject: [PATCH 14/18] Render thumbnails for non-image attachments This is similar to how the wordpress media browser renders attachments; if a non-image attachment has specified a thumbnail meta item use it as the thumbnail. https://github.com/WordPress/WordPress/blob/31d4d81039226aa8d3f5229af874ee5b9e2a9482/wp-includes/media-template.php#L462 --- inc/fields/class-shortcode-ui-field-attachment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/fields/class-shortcode-ui-field-attachment.php b/inc/fields/class-shortcode-ui-field-attachment.php index 135b71c2..36fe97a4 100644 --- a/inc/fields/class-shortcode-ui-field-attachment.php +++ b/inc/fields/class-shortcode-ui-field-attachment.php @@ -106,7 +106,7 @@ public function action_shortcode_ui_loaded_editor() { - <# if ( data.type === 'image' && data.sizes && data.sizes.thumbnail ) { #> + <# if ( data.sizes && data.sizes.thumbnail ) { #>
From 51dbe8ace74999378f6234bf6f2714d6403ab5e9 Mon Sep 17 00:00:00 2001 From: Matt Viggiano Date: Thu, 18 May 2017 15:32:51 -0500 Subject: [PATCH 15/18] Fixed issue with menu click event not being delegated for Post Media Frame --- css/shortcode-ui.css | 1 - css/shortcode-ui.css.map | 2 +- js-tests/build/specs.js | 26 ++++---------------------- js/build/shortcode-ui.js | 11 +++++------ js/src/views/media-frame.js | 11 +++++------ 5 files changed, 15 insertions(+), 36 deletions(-) diff --git a/css/shortcode-ui.css b/css/shortcode-ui.css index c638d480..5da2cdc5 100644 --- a/css/shortcode-ui.css +++ b/css/shortcode-ui.css @@ -82,7 +82,6 @@ background-color: #fff; color: #333; outline: none; - -webkit-transition: 0.05s border-color ease-in-out; transition: 0.05s border-color ease-in-out; max-width: 100%; } .edit-shortcode-form input[type="range"] { diff --git a/css/shortcode-ui.css.map b/css/shortcode-ui.css.map index 48d69048..f54c6e55 100644 --- a/css/shortcode-ui.css.map +++ b/css/shortcode-ui.css.map @@ -1 +1 @@ -{"version":3,"sources":["sass/shortcode-ui.scss","sass/_field-image.scss","sass/_select2-fields.scss"],"names":[],"mappings":"AAAA;EACC,mBAAmB,EACnB;;AAED;EAGE,iBAAiB;EACjB,kBAAkB;EAClB,aAAa,EACb;;AANF;EASE,UAAU,EACV;;AAIF;EACC,gBAAgB,EAuDhB;EAxDD;IAIE,aAAa;IACb,YAAY;IAEZ,kFAAqE;IACrE,iBAAiB;IACjB,gBAAgB;IAChB,mBAAmB;IACnB,mBAAmB;IACnB,aAAa;IACb,cAAc,EAyCd;IAtDF;MAgBG,mBAAmB;MACnB,cAAc;MACd,gBAAgB,EAgBhB;MAlCH;;QAsBI,mBAAmB;QACnB,SAAS;QACT,UAAU;QACV,yCAAoB;gBAApB,iCAAoB;QACpB,mBAAmB;QACnB,qBAAqB;QACrB,YAAY;QACZ,aAAa;QACb,eAAe;QACf,gBAAgB,EAChB;IAhCJ;MAqCG,uBAAuB;MACvB,mBAAmB;MACnB,UAAU;MACV,QAAQ;MACR,YAAY;MACZ,UAAU;MACV,iBAAiB;MACjB,aAAa;MACb,iBAAiB;MACjB,iBAAiB;MACjB,sBAAsB;MACtB,mBAAmB;MACnB,kBAAkB;MAClB,qCAAgB;MAEhB,gDAAgC,EAChC;;AAKH;EAEE,aAAa;EACb,qBAAqB,EACrB;;AAJF;EAOE,cAAc;EACd,2BAA2B,EAC3B;;AATF;EAYE,8BAA8B,EAC9B;;AAbF;EAgBE,mBAAmB;EACnB,aAAa,EACb;;AAGF;EAEC,kBAAkB,EA2DlB;EA7DD;IAKE,eAAe;IACf,YAAY,EACZ;EAPF;;IAWE,uBAAuB;IAEvB,gDAA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zFJ;IA2FI,YAAY;IACZ,YAAY;IACZ,iBAAiB;IACjB,8BAA8B;IAC9B,qBAAqB,EAWrB;IA1GJ;MAkGK,0BAA0B;MAC1B,oBAAoB;MACpB,YAAY;MACZ,YAAY;MACZ,eAAe;MACf,sEAAsE;MACtE,8DAA8D,EAC9D;EAzGL;IA8GG,mBACA,EAAC;;AAMJ;EACC,cAAc,EAKd;EAND;IAIE,eAAe,EACf;;AAGF;EACC;IACC,mBAAmB,EAAA;EAEpB;IACC,kBAAkB,EAAA,EAAA;;AAIpB;EACC;IACC,mBAAmB,EAAA;EAEpB;IACC,kBAAkB,EAAA,EAAA;;AC3IpB;EAEE,iBAAiB,EACjB;;AAHF;EAME,iBAAiB;EACjB,yBAAyB,EACzB;;AARF;EAWE,gBAAgB,EAChB;;AAZF;EAeE,UAAU,EACV;;AAhBF;EAmBE,oBAAoB,EACpB;;AApBF;EAuBE,gBAAgB,EAChB;;AAxBF;EA2BE,iBAAiB;EACjB,mBAAmB;EACnB,gDAAgC;EAChC,uBAAuB;EACvB,YAAY;EACZ,cAAc,EACd;;AAjCF;EAoCE,sBAAsB;EACtB,4CAAwB,EACxB;;AAIF;EACC,gBAAgB;EAChB,iBAAiB,EACjB;;AAED;EACC,UAAU,EACV","file":"shortcode-ui.css"} \ No newline at end of file +{"version":3,"sources":["sass/shortcode-ui.scss","sass/_field-image.scss","sass/_select2-fields.scss"],"names":[],"mappings":"AAAA;EACC,mBAAmB,EACnB;;AAED;EAGE,iBAAiB;EACjB,kBAAkB;EAClB,aAAa,EACb;;AANF;EASE,UAAU,EACV;;AAIF;EACC,gBAAgB,EAuDhB;EAxDD;IAIE,aAAa;IACb,YAAY;IAEZ,kFAAqE;IACrE,iBAAiB;IACjB,gBAAgB;IAChB,mBAAmB;IACnB,mBAAmB;IACnB,aAAa;IACb,cAAc,EAyCd;IAtDF;MAgBG,mBAAmB;MACnB,cAAc;MACd,gBAAgB,EAgBhB;MAlCH;;QAsBI,mBAAmB;QACnB,SA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EACZ,cAAc,EACd;;AAjCF;EAoCE,sBAAsB;EACtB,4CAAwB,EACxB;;AAIF;EACC,gBAAgB;EAChB,iBAAiB,EACjB;;AAED;EACC,UAAU,EACV","file":"shortcode-ui.css"} \ No newline at end of file diff --git a/js-tests/build/specs.js b/js-tests/build/specs.js index 92a8c1ca..a4f5d3a5 100644 --- a/js-tests/build/specs.js +++ b/js-tests/build/specs.js @@ -840,7 +840,7 @@ Shortcode = Backbone.Model.extend({ // Encode textareas incase HTML if ( attr.get( 'encode' ) ) { - attr.set( 'value', encodeURIComponent( decodeURIComponent( attr.get( 'value' ).replace( "%", "%" ) ) ), { silent: true } ); + attr.set( 'value', encodeURIComponent( decodeURIComponent( attr.get( 'value' ).replace( /%/g, "%" ) ) ), { silent: true } ); } attrs.push( attr.get( 'attr' ) + '="' + attr.get( 'value' ) + '"' ); @@ -1160,7 +1160,7 @@ var shortcodeViewConstructor = { * * @param {string} shortcodeString String representation of the shortcode */ - edit: function( shortcodeString ) { + edit: function( shortcodeString, update ) { var currentShortcode = this.parseShortcodeString( shortcodeString ); @@ -1179,28 +1179,10 @@ var shortcodeViewConstructor = { }); } - // Make sure to reset state when closed. - frame.once( 'close submit', function() { - frame.state().props.set('currentShortcode', false); - var menuItem = frame.menu.get().get('shortcode-ui'); - menuItem.options.text = shortcodeUIData.strings.media_frame_title; - menuItem.render(); - frame.setState( 'insert' ); + frame.mediaController.props.set( 'insertCallback', function( shortcode ) { + update( shortcode.formatShortcode() ); } ); - /* Trigger render_edit */ - /* - * Action run after an edit shortcode overlay is rendered. - * - * Called as `shortcode-ui.render_edit`. - * - * @param shortcodeModel (object) - * Reference to the shortcode model used in this overlay. - */ - var hookName = 'shortcode-ui.render_edit'; - var shortcodeModel = this.shortcodeModel; - wp.shortcake.hooks.doAction( hookName, shortcodeModel ); - } }, diff --git a/js/build/shortcode-ui.js b/js/build/shortcode-ui.js index e5fd55be..c0daade7 100644 --- a/js/build/shortcode-ui.js +++ b/js/build/shortcode-ui.js @@ -1536,6 +1536,11 @@ var wp = (typeof window !== "undefined" ? window['wp'] : typeof global !== "unde var postMediaFrame = wp.media.view.MediaFrame.Post; var mediaFrame = postMediaFrame.extend( { + events: _.extend( {}, postMediaFrame.prototype.events, { + 'click .media-menu-item' : 'resetMediaController', + } + ), + initialize: function() { postMediaFrame.prototype.initialize.apply( this, arguments ); @@ -1566,12 +1571,6 @@ var mediaFrame = postMediaFrame.extend( { }, - events: function() { - return _.extend( {}, postMediaFrame.prototype.events, { - 'click .media-menu-item' : 'resetMediaController', - } ); - }, - resetMediaController: function( event ) { if ( this.state() && 'undefined' !== typeof this.state().props && this.state().props.get('currentShortcode') ) { this.mediaController.reset(); diff --git a/js/src/views/media-frame.js b/js/src/views/media-frame.js index db46b23e..7a9b7d2b 100644 --- a/js/src/views/media-frame.js +++ b/js/src/views/media-frame.js @@ -7,6 +7,11 @@ var wp = require('wp'), var postMediaFrame = wp.media.view.MediaFrame.Post; var mediaFrame = postMediaFrame.extend( { + events: _.extend( {}, postMediaFrame.prototype.events, { + 'click .media-menu-item' : 'resetMediaController', + } + ), + initialize: function() { postMediaFrame.prototype.initialize.apply( this, arguments ); @@ -37,12 +42,6 @@ var mediaFrame = postMediaFrame.extend( { }, - events: function() { - return _.extend( {}, postMediaFrame.prototype.events, { - 'click .media-menu-item' : 'resetMediaController', - } ); - }, - resetMediaController: function( event ) { if ( this.state() && 'undefined' !== typeof this.state().props && this.state().props.get('currentShortcode') ) { this.mediaController.reset(); From 93276411faf4c8725b1672468071b7d1cc378588 Mon Sep 17 00:00:00 2001 From: Nathaniel Taintor Date: Wed, 31 May 2017 10:59:04 -0700 Subject: [PATCH 16/18] Re-run js build for tests (The specs.js file hadn't been updated after some of the latest changes in this branch.) --- js-tests/build/specs.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js-tests/build/specs.js b/js-tests/build/specs.js index a4f5d3a5..c6155080 100644 --- a/js-tests/build/specs.js +++ b/js-tests/build/specs.js @@ -1183,6 +1183,10 @@ var shortcodeViewConstructor = { update( shortcode.formatShortcode() ); } ); + // Make sure to reset state when closed. + frame.once( 'close submit', function() { + frame.mediaController.reset(); + } ); } }, From c8037c877ee389b70e5117653f89a8e1781477a2 Mon Sep 17 00:00:00 2001 From: Gabriel Chi Hong Lee Date: Wed, 7 Jun 2017 07:05:30 +0800 Subject: [PATCH 17/18] Update zh_CN and create zh_TW translations Updated zh_CN (Chinese Simplified) translations to latest version and created zh_TW (Chinese Traditional) translations. --- languages/shortcode-ui-zh_CN.mo | Bin 1913 -> 3658 bytes languages/shortcode-ui-zh_CN.po | 237 ++++++++++++++++++++++++------- languages/shortcode-ui-zh_TW.mo | Bin 0 -> 3658 bytes languages/shortcode-ui-zh_TW.po | 240 ++++++++++++++++++++++++++++++++ 4 files changed, 430 insertions(+), 47 deletions(-) create mode 100644 languages/shortcode-ui-zh_TW.mo create mode 100644 languages/shortcode-ui-zh_TW.po diff --git a/languages/shortcode-ui-zh_CN.mo b/languages/shortcode-ui-zh_CN.mo index ce7633bea6d9c1be6ccc83fba39484b643efff47..649caae28b306f53716aec03d063200707bd9603 100644 GIT binary patch literal 3658 zcma)-TWlOx8OIN$v|z$5<<IKF{|`oc?}iiD8z06Vk0AXJd3gj8|)e=}!& z2_SJaXMX4Uo$q#LZm+z1h@q@U{W9w0hZx%qwtpBel>FU{)qw{1Y0v{d2KLGE0m*aV zN{o+#E5Ir6Q{da+N5FT%d%)j;9|eCe=l=wL9{mqM4z9#vnqLoo5_|-teUF1{z)tWJ z;E&~ezvNl)K8#-hA&Sj_Yr$WFwEvGF>HSxb?D+u1!|uT(&9A`gGvIw7>AxEMIGB=r z6#OFk-vjA<9VCAp0(XPYgZF~BK|CzPi~RLxuo?WP99OYuHTs)DlAi-!&|5o;A4q!j zg5Lm-gV@5Zfwb=ym;`?X(v|p|9RE8=cHD&|rMRpDadn~`ruf#QQvB#%QC@x%^((0B zP-!3KJn8#2RFX?)twN;&*F`o_K9cXre>jdkfJ!BWx;APpzDP$Z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pK(wpQ}s^1*b+zbEnGJF0=5} zu{e)nRjLQ{uFsd}u9LSS&B$Bf`N?qj27^MS>F47tEZ?|P9-YN1N~RMx%R?vO z&&acp&*D+qfypS+kz<4DGqJzlo5lK(VBifj!V|-#sj*6LU-jr*Y3fvXc7o&}R#Xu$ c+FqK&;t4o_LNIm?YEaV5j>vHQ-~Wn#1EfBPa{vGU delta 1034 zcmb8sUr19?90%}I{+nBw8d#{offB=-Z8~ku3eB_v9|md!L2z+5cWb+MY*$SZRMOJ^ z(4V75X)^7PMl>^q5;iU9DSD{Kdhj9Iy&Js+KKNktJ=@-*hYmaEb9T=;zxzAC`>}XE zr*}0!eUzYWM=wSXqwhj*+Jph^9W=uCa0~nd)8SWG09PS}Yj7(p*i1+c+>^2r^4P~< z7Ca3z;W?N`NG}mF;eoqg861E$a1Qc~KVb>{1^2?8X@tZuuY=k6UxrQmybbdGbr|yD zNl4*Y$k%&P4yPQ0`FKBhj0t{ZA!P*e10SFPet|r(Z?F_*;2M|`Gc1BO$P;ry6oDYO zM8$YDctf7Vl$a%MoS5+nCR!s#9xMZ$--c(7IDfTVJmF>JjVH$w<7M84PD%o7F1;YF z!6mWvbO*bfQJdxTi=C3##Y~w+)o#VFwka-=ww@x*idR(KlH6VzpngSFMVU%6Rox;D zsDdg|p>hpB?1j71{x>4DhH5W8h6EEHrH#R+eREUDc@yL~S@_%wQTFdBNpew%jm>fvDO zp*D6+e-TVBkz@d(-I>tC( DA`ciH diff --git a/languages/shortcode-ui-zh_CN.po b/languages/shortcode-ui-zh_CN.po index ebe8e48b..c02d5984 100644 --- a/languages/shortcode-ui-zh_CN.po +++ b/languages/shortcode-ui-zh_CN.po @@ -1,97 +1,240 @@ -# Copyright (C) 2015 Fusion Engineering and community +# Copyright (C) 2017 Fusion Engineering and community # This file is distributed under the GPL v2 or later. msgid "" msgstr "" -"Project-Id-Version: Shortcode UI v0.3-alpha\n" -"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/" -"shortcode-ui\n" -"POT-Creation-Date: 2015-04-22 16:48:40+00:00\n" +"Project-Id-Version: Shortcake (Shortcode UI) 0.7.2\n" +"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/shortcode-ui\n" +"POT-Creation-Date: 2017-04-26 19:49:27+00:00\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" +"Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2015-04-28 09:58+0800\n" -"X-Generator: Poedit 1.7.5\n" -"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" +"PO-Revision-Date: 2017-06-06 23:04+0800\n" +"Last-Translator: Gabriel Chi Hong Lee \n" +"Language-Team: \n" +"X-Generator: grunt-wp-i18n 0.5.4\n" +"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" "Language: zh_CN\n" -"Plural-Forms: nplurals=1; plural=0;\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-Country: United States\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-Basepath: ../\n" -"X-Textdomain-Support: yes\n" -"Last-Translator: Amos Lee \n" -"Language-Team: Amos Lee \n" "X-Poedit-SearchPath-0: .\n" +"X-Poedit-Bookmarks: \n" +"X-Textdomain-Support: yes\n" + +#: dev.php:68 +msgid "" +"Shortcode UI plugin must be active for Shortcode UI Example plugin to " +"function." +msgstr "" +"请启用 Shortcode UI 以容许 Shortcode UI Example plugin " +"函数." + +#: dev.php:119 +msgid "Shortcake With No Attributes" +msgstr "没有属性的 Shortcake" + +#: dev.php:159 +msgid "Attachment" +msgstr "附件" + +#: dev.php:169 dev.php:170 +msgid "Select Image" +msgstr "挑选图片" + +#: dev.php:175 +msgid "You can select multiple images." +msgstr "你可以选多于一张图片" + +#: dev.php:183 +msgid "Citation Source" +msgstr "引用来源" + +#: dev.php:188 +msgid "Test placeholder" +msgstr "测试占位符" + +#: dev.php:193 +msgid "Select Page" +msgstr "选择页面" + +#: dev.php:200 +msgid "Select Term" +msgstr "选择团队" + +#: dev.php:207 +msgid "User Select" +msgstr "选择用户" + +#: dev.php:213 +msgid "Color" +msgstr "颜色" + +#: dev.php:218 +msgid "Hex color code" +msgstr "Hex 颜色代码" + +#: dev.php:222 +msgid "Alignment" +msgstr "对准" + +#: dev.php:223 +msgid "" +"Whether the quotation should be displayed as pull-left, pull-right, or " +"neither." +msgstr "" +"引文应靠左,靠右,或" +"两者都不是。" + +#: dev.php:227 +msgid "None" +msgstr "没有" + +#: dev.php:228 dev.php:233 +msgid "Pull Left" +msgstr "靠左" + +#: dev.php:229 dev.php:234 +msgid "Pull Right" +msgstr "靠右" -#: inc/class-shortcode-ui.php:40 +#: dev.php:240 +msgid "Year" +msgstr "年" + +#: dev.php:241 +msgid "Optional. The year the quotation is from." +msgstr "可选的。引文的年份。" + +#: dev.php:260 +msgid "Shortcake Dev" +msgstr "Shortcake 开发" + +#: dev.php:279 +msgid "Quote" +msgstr "引文" + +#: dev.php:280 +msgid "Include a statement from someone famous." +msgstr "加入一句名人名言。" + +#: dev.php:352 +msgid "Content:" +msgstr "内容:" + +#: dev.php:356 +msgid "Source:" +msgstr "来源:" + +#: dev.php:360 +msgid "Image:" +msgstr "图片:" + +#: dev.php:364 +msgid "Gallery:" +msgstr "图库:" + +#: dev.php:372 +msgid "Pages:" +msgstr "页面:" + +#: dev.php:376 +msgid "Terms:" +msgstr "Terms:" + +#: dev.php:380 +msgid "Users:" +msgstr "用户:" + +#: dev.php:384 +msgid "Color:" +msgstr "颜色:" + +#: dev.php:388 +msgid "Alignment:" +msgstr "对准:" + +#: dev.php:392 +msgid "Year:" +msgstr "年份:" + +#: inc/class-shortcode-ui.php:118 msgid "Inner Content" -msgstr "插入内容" +msgstr "内文:" -#: inc/class-shortcode-ui.php:101 inc/class-shortcode-ui.php:102 +#: inc/class-shortcode-ui.php:262 inc/class-shortcode-ui.php:263 msgid "Insert Post Element" -msgstr "插入文章内容" +msgstr "插入帖子元件" -#: inc/class-shortcode-ui.php:103 +#: inc/class-shortcode-ui.php:265 +#. Translators: Ignore placeholder. This is replaced with the Shortcode name +#. string in JS msgid "%s Details" msgstr "%s 详情" -#: inc/class-shortcode-ui.php:104 +#: inc/class-shortcode-ui.php:266 msgid "Insert Element" -msgstr "插入元素" +msgstr "插入元件" -#: inc/class-shortcode-ui.php:105 +#: inc/class-shortcode-ui.php:267 msgid "Update" msgstr "更新" -#: inc/class-shortcode-ui.php:106 +#: inc/class-shortcode-ui.php:268 msgid "There are no attributes to configure for this Post Element." -msgstr "此文章元素没有属性需要设置" - -#: inc/class-shortcode-ui.php:107 -msgid "Edit" -msgstr "编辑" +msgstr "此元件没有需要设置的属性。" -#: inc/class-shortcode-ui.php:108 -msgid "Preview" -msgstr "预览" - -#: inc/class-shortcode-ui.php:109 +#: inc/class-shortcode-ui.php:269 msgid "Failed to load preview" -msgstr "加载预览失败" +msgstr "预览载入失败" -#: inc/class-shortcode-ui.php:110 +#: inc/class-shortcode-ui.php:270 msgid "Search" -msgstr "搜索" +msgstr "搜寻" -#: inc/class-shortcode-ui.php:111 +#: inc/class-shortcode-ui.php:271 msgid "Insert Content" msgstr "插入内容" -#: inc/class-shortcode-ui.php:205 +#: inc/class-shortcode-ui.php:312 +msgid "Add Post Element" +msgstr "加入帖子元件" + +#: inc/class-shortcode-ui.php:380 msgid "Something's rotten in the state of Denmark" -msgstr "Something's rotten in the state of Denmark" +msgstr "" -#: inc/fields/class-field-attachment.php:47 -#: inc/fields/class-field-attachment.php:48 +#: inc/fields/class-shortcode-ui-field-attachment.php:79 +#: inc/fields/class-shortcode-ui-field-attachment.php:80 msgid "Select Attachment" msgstr "选择附件" +#: inc/fields/class-shortcode-ui-field-attachment.php:138 +msgid "Attachment Details" +msgstr "附件详情" + +#: inc/fields/class-shortcode-ui-field-attachment.php:145 +msgid "Edit Attachment" +msgstr "编辑附件" + #: inc/templates/edit-form.tpl.php:3 msgid "Back to list" msgstr "返回列表" #. Plugin Name of the plugin/theme -msgid "Shortcode UI" -msgstr "简码UI" +msgid "Shortcake (Shortcode UI)" +msgstr "Shortcake (Shortcode UI)" #. Description of the plugin/theme msgid "User Interface for adding shortcodes." -msgstr "添加简码的用户界面" +msgstr "用于加入簡碼的用户界面。" #. Author of the plugin/theme msgid "Fusion Engineering and community" -msgstr "Fusion Engineering and community" +msgstr "Fusion Engineering 及其社区" #. Author URI of the plugin/theme msgid "http://next.fusion.net/tag/shortcode-ui/" -msgstr "http://next.fusion.net/tag/shortcode-ui/" +msgstr "http://next.fusion.net/tag/shortcode-ui/" \ No newline at end of file diff --git a/languages/shortcode-ui-zh_TW.mo b/languages/shortcode-ui-zh_TW.mo new file mode 100644 index 0000000000000000000000000000000000000000..314a776e93e23cc2c969bc08f81cd967c79f70f9 GIT binary patch literal 3658 zcma)-dvFz39mkJtZEHlW)K{z4LzNaJdvkNahHgqLgaEOj#BdRqaV9Q%Pwrj1clWXn zn$&-SG=@N9B9fG*sSOoEn1%ucX~+Year%${^shSOIKv-$ckjJAPIbo4IMea*{q3Hc z2kMMx_Uz|8f9Ll)ySG-}HOx@fqkakX+D91M4z}Kj7fS9f#%e$VybtuikAb~%d{A-} zT#4~>;0kaW{1o^O_)+jZ@NV#T;Jx7Q<@}$(&!PVz$ibCZO!Mo(Pl8W?wC`zf4cHET z0{p(5@0UCc-jDI~AVjfQa4q;tkoNx(B)$I%l06@Sc-Y;Tr1=$ieHy$UB>h)|9|u#C zPl8`S|63rPuY=^TL*Op(N8ml+Ef5b2@gjfy8EgdqDaTbTT8;i@kmP4UTJM4+=XsFy z|20VZ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$A_H-8w;46(|Y!E*mw60|+&Js-SzgIcAxC(Cn} zs^Z3n$`kYDxqdqT?3Hl%rT_K^3I>k{z1K@;Zw3QBEEpRJX5Ju4^aqL$D$f3_^!gl4 zmHPXl<06ZS(>=l9xnO9ZI5UHHd9vpZJwG5-!jWiIICzrIjZ|aRPGr99EcHnE*2!?J zp9O=LDo3VEqc1=dOok-1gB#b1v-2dpGJd4;>g%LJ<<;@v?THA3SIIkA%EFB{KwCBKgU`G={DoG86K$6`%`D^p?5c__E|&0^&@ zP6WfRAxz7EBE{Kr2u^wO%JSjc{w+b@d^kLvU~!1a#OTLDjc|IZd|{$Ef2ue?P@0-x z;l;CY9>uCu#(K&VN6M2IOY?7%w<68RTj49$!ja1i3WXzcaTb;?pFt?GiUyBeFAcv4 ze@32-d=`&JJC0qCA{{w4?CX#H{r()*j|YQS(Fl)?1icr^J-wBq^Tp|b@bo2;gIG~T dyl8uI9*Zx*0ThC>qfmpAX71-Q9RK&f;@@C-h=u?F literal 0 HcmV?d00001 diff --git a/languages/shortcode-ui-zh_TW.po b/languages/shortcode-ui-zh_TW.po new file mode 100644 index 00000000..6270fa49 --- /dev/null +++ b/languages/shortcode-ui-zh_TW.po @@ -0,0 +1,240 @@ +# Copyright (C) 2017 Fusion Engineering and community +# This file is distributed under the GPL v2 or later. +msgid "" +msgstr "" +"Project-Id-Version: Shortcake (Shortcode UI) 0.7.2\n" +"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/shortcode-ui\n" +"POT-Creation-Date: 2017-04-26 19:49:27+00:00\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"PO-Revision-Date: 2017-06-06 23:04+0800\n" +"Last-Translator: Gabriel Chi Hong Lee \n" +"Language-Team: \n" +"X-Generator: grunt-wp-i18n 0.5.4\n" +"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" +"Language: zh_TW\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-Country: United States\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-Basepath: ../\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-Bookmarks: \n" +"X-Textdomain-Support: yes\n" + +#: dev.php:68 +msgid "" +"Shortcode UI plugin must be active for Shortcode UI Example plugin to " +"function." +msgstr "" +"請啟用 Shortcode UI 以容許 Shortcode UI Example plugin " +"函數." + +#: dev.php:119 +msgid "Shortcake With No Attributes" +msgstr "沒有屬性的 Shortcake" + +#: dev.php:159 +msgid "Attachment" +msgstr "附件" + +#: dev.php:169 dev.php:170 +msgid "Select Image" +msgstr "挑選圖片" + +#: dev.php:175 +msgid "You can select multiple images." +msgstr "你可以選多於一張圖片" + +#: dev.php:183 +msgid "Citation Source" +msgstr "引用來源" + +#: dev.php:188 +msgid "Test placeholder" +msgstr "測試佔位符" + +#: dev.php:193 +msgid "Select Page" +msgstr "選擇頁面" + +#: dev.php:200 +msgid "Select Term" +msgstr "選擇團隊" + +#: dev.php:207 +msgid "User Select" +msgstr "選擇用戶" + +#: dev.php:213 +msgid "Color" +msgstr "顏色" + +#: dev.php:218 +msgid "Hex color code" +msgstr "Hex 顏色代碼" + +#: dev.php:222 +msgid "Alignment" +msgstr "對準" + +#: dev.php:223 +msgid "" +"Whether the quotation should be displayed as pull-left, pull-right, or " +"neither." +msgstr "" +"引文應靠左,靠右,或" +"兩者都不是。" + +#: dev.php:227 +msgid "None" +msgstr "沒有" + +#: dev.php:228 dev.php:233 +msgid "Pull Left" +msgstr "靠左" + +#: dev.php:229 dev.php:234 +msgid "Pull Right" +msgstr "靠右" + +#: dev.php:240 +msgid "Year" +msgstr "年" + +#: dev.php:241 +msgid "Optional. The year the quotation is from." +msgstr "可選的。引文的年份。" + +#: dev.php:260 +msgid "Shortcake Dev" +msgstr "Shortcake 開發" + +#: dev.php:279 +msgid "Quote" +msgstr "引文" + +#: dev.php:280 +msgid "Include a statement from someone famous." +msgstr "加入一句名人名言。" + +#: dev.php:352 +msgid "Content:" +msgstr "內容:" + +#: dev.php:356 +msgid "Source:" +msgstr "來源:" + +#: dev.php:360 +msgid "Image:" +msgstr "圖片:" + +#: dev.php:364 +msgid "Gallery:" +msgstr "圖庫:" + +#: dev.php:372 +msgid "Pages:" +msgstr "頁面:" + +#: dev.php:376 +msgid "Terms:" +msgstr "Terms:" + +#: dev.php:380 +msgid "Users:" +msgstr "用戶:" + +#: dev.php:384 +msgid "Color:" +msgstr "顏色:" + +#: dev.php:388 +msgid "Alignment:" +msgstr "對準:" + +#: dev.php:392 +msgid "Year:" +msgstr "年份:" + +#: inc/class-shortcode-ui.php:118 +msgid "Inner Content" +msgstr "內文:" + +#: inc/class-shortcode-ui.php:262 inc/class-shortcode-ui.php:263 +msgid "Insert Post Element" +msgstr "插入帖子元件" + +#: inc/class-shortcode-ui.php:265 +#. Translators: Ignore placeholder. This is replaced with the Shortcode name +#. string in JS +msgid "%s Details" +msgstr "%s 詳情" + +#: inc/class-shortcode-ui.php:266 +msgid "Insert Element" +msgstr "插入元件" + +#: inc/class-shortcode-ui.php:267 +msgid "Update" +msgstr "更新" + +#: inc/class-shortcode-ui.php:268 +msgid "There are no attributes to configure for this Post Element." +msgstr "此元件沒有需要設置的屬性。" + +#: inc/class-shortcode-ui.php:269 +msgid "Failed to load preview" +msgstr "預覽載入失敗" + +#: inc/class-shortcode-ui.php:270 +msgid "Search" +msgstr "搜尋" + +#: inc/class-shortcode-ui.php:271 +msgid "Insert Content" +msgstr "插入內容" + +#: inc/class-shortcode-ui.php:312 +msgid "Add Post Element" +msgstr "加入帖子元件" + +#: inc/class-shortcode-ui.php:380 +msgid "Something's rotten in the state of Denmark" +msgstr "" + +#: inc/fields/class-shortcode-ui-field-attachment.php:79 +#: inc/fields/class-shortcode-ui-field-attachment.php:80 +msgid "Select Attachment" +msgstr "選擇附件" + +#: inc/fields/class-shortcode-ui-field-attachment.php:138 +msgid "Attachment Details" +msgstr "附件詳情" + +#: inc/fields/class-shortcode-ui-field-attachment.php:145 +msgid "Edit Attachment" +msgstr "編輯附件" + +#: inc/templates/edit-form.tpl.php:3 +msgid "Back to list" +msgstr "返回列表" + +#. Plugin Name of the plugin/theme +msgid "Shortcake (Shortcode UI)" +msgstr "Shortcake (Shortcode UI)" + +#. Description of the plugin/theme +msgid "User Interface for adding shortcodes." +msgstr "用於加入簡碼的用戶界面。" + +#. Author of the plugin/theme +msgid "Fusion Engineering and community" +msgstr "Fusion Engineering 及其社區" + +#. Author URI of the plugin/theme +msgid "http://next.fusion.net/tag/shortcode-ui/" +msgstr "http://next.fusion.net/tag/shortcode-ui/" \ No newline at end of file From 0440ceed210dd578c00024064a1df7186588cffd Mon Sep 17 00:00:00 2001 From: Matthew Haines-Young Date: Tue, 20 Jun 2017 10:03:06 +0100 Subject: [PATCH 18/18] Fix select issue (#745) * Ensure data value is an array before filtering During work in #707 to improve support for multi-select fields, handling of comma separated strings was removed as it may have been confusing if an option value had commas in it. See 9894162ab8bf02941e9611766d5cc3d63d337e96 After this change, string values for single select elements are filtered as if they were arrays. This causes only the first character of a string to be compared to the select value. This in turn results in all select fields set to first option because nothing is seen as selected. We can accept arrays, but also `split()` with no separator to turn strings into an array so that everything is parsed the same. * Use _.contains instead of filter/empty * Split on comma rather than just casting to array --- inc/templates/edit-form.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/templates/edit-form.tpl.php b/inc/templates/edit-form.tpl.php index 1e84d6b6..50a7874e 100644 --- a/inc/templates/edit-form.tpl.php +++ b/inc/templates/edit-form.tpl.php @@ -54,11 +54,11 @@ <# if ( 'options' in option && 'label' in option ) { #> <# _.each( option.options, function( optgroupOption ) { #> - + <# }); #> <# } else { #> - + <# } #> <# }); #>