Changeset 1443643
- Timestamp:
- 06/26/2016 02:05:20 PM (10 years ago)
- Location:
- improved-save-button
- Files:
-
- 40 added
- 3 deleted
- 21 edited
-
tags/1.1.1 (added)
-
tags/1.1.1/COPYING.txt (added)
-
tags/1.1.1/actions (added)
-
tags/1.1.1/actions/class-lb-save-and-then-action-list.php (added)
-
tags/1.1.1/actions/class-lb-save-and-then-action-new.php (added)
-
tags/1.1.1/actions/class-lb-save-and-then-action-next.php (added)
-
tags/1.1.1/actions/class-lb-save-and-then-action-previous.php (added)
-
tags/1.1.1/actions/class-lb-save-and-then-action-view-popup.php (added)
-
tags/1.1.1/actions/class-lb-save-and-then-action-view.php (added)
-
tags/1.1.1/css (added)
-
tags/1.1.1/css/post-edit-rtl.css (added)
-
tags/1.1.1/css/post-edit.css (added)
-
tags/1.1.1/improved-save-button.php (added)
-
tags/1.1.1/js (added)
-
tags/1.1.1/js/backward-compatibility (added)
-
tags/1.1.1/js/backward-compatibility/post-edit.pre-4.2.js (added)
-
tags/1.1.1/js/backward-compatibility/post-edit.pre-4.2.min.js (added)
-
tags/1.1.1/js/post-edit.js (added)
-
tags/1.1.1/js/post-edit.min.js (added)
-
tags/1.1.1/js/settings-page.js (added)
-
tags/1.1.1/js/settings-page.min.js (added)
-
tags/1.1.1/languages (added)
-
tags/1.1.1/languages/improved-save-button-fr_FR.mo (added)
-
tags/1.1.1/languages/improved-save-button-fr_FR.po (added)
-
tags/1.1.1/languages/improved-save-button.pot (added)
-
tags/1.1.1/lib (added)
-
tags/1.1.1/lib/class-lb-save-and-then-action.php (added)
-
tags/1.1.1/lib/class-lb-save-and-then-actions.php (added)
-
tags/1.1.1/lib/class-lb-save-and-then-messages.php (added)
-
tags/1.1.1/lib/class-lb-save-and-then-post-edit.php (added)
-
tags/1.1.1/lib/class-lb-save-and-then-post-save.php (added)
-
tags/1.1.1/lib/class-lb-save-and-then-settings.php (added)
-
tags/1.1.1/lib/class-lb-save-and-then-utils.php (added)
-
tags/1.1.1/readme.txt (added)
-
tags/1.1.1/scss (added)
-
tags/1.1.1/scss/post-edit.scss (added)
-
tags/1.1.1/uninstall.php (added)
-
trunk/actions/class-lb-save-and-then-action-list.php (modified) (4 diffs)
-
trunk/actions/class-lb-save-and-then-action-new.php (modified) (4 diffs)
-
trunk/actions/class-lb-save-and-then-action-next.php (modified) (5 diffs)
-
trunk/actions/class-lb-save-and-then-action-previous.php (modified) (5 diffs)
-
trunk/actions/class-lb-save-and-then-action-view-popup.php (modified) (6 diffs)
-
trunk/actions/class-lb-save-and-then-action-view.php (modified) (5 diffs)
-
trunk/improved-save-button.php (modified) (1 diff)
-
trunk/js/backward-compatibility/post-edit.pre-4.2.js (modified) (1 diff)
-
trunk/js/post-edit.js (modified) (1 diff)
-
trunk/js/post-edit.min.js (modified) (1 diff)
-
trunk/js/settings-page.js (modified) (1 diff)
-
trunk/languages/improved-save-button-fr_FR.mo (added)
-
trunk/languages/improved-save-button-fr_FR.po (added)
-
trunk/languages/improved-save-button.pot (added)
-
trunk/languages/lb-save-and-then-fr_FR.mo (deleted)
-
trunk/languages/lb-save-and-then-fr_FR.po (deleted)
-
trunk/languages/lb-save-and-then.pot (deleted)
-
trunk/lib/class-lb-save-and-then-action.php (modified) (1 diff)
-
trunk/lib/class-lb-save-and-then-actions.php (modified) (1 diff)
-
trunk/lib/class-lb-save-and-then-messages.php (modified) (1 diff)
-
trunk/lib/class-lb-save-and-then-post-edit.php (modified) (1 diff)
-
trunk/lib/class-lb-save-and-then-post-save.php (modified) (1 diff)
-
trunk/lib/class-lb-save-and-then-settings.php (modified) (8 diffs)
-
trunk/lib/class-lb-save-and-then-utils.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/scss/post-edit.scss (modified) (1 diff)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
improved-save-button/trunk/actions/class-lb-save-and-then-action-list.php
r1267552 r1443643 2 2 3 3 /** 4 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)4 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 5 5 * 6 6 * This file is part of the "Improved Save Button" … … 68 68 */ 69 69 function get_name() { 70 return __('Save and List', ' lb-save-and-then');70 return __('Save and List', 'improved-save-button'); 71 71 } 72 72 … … 82 82 */ 83 83 function get_description() { 84 return __('Shows the <strong>posts list</strong> after save.', ' lb-save-and-then');84 return __('Shows the <strong>posts list</strong> after save.', 'improved-save-button'); 85 85 } 86 86 … … 89 89 */ 90 90 function get_button_label_pattern( $post ) { 91 return __('%s and List', ' lb-save-and-then');91 return __('%s and List', 'improved-save-button'); 92 92 } 93 93 -
improved-save-button/trunk/actions/class-lb-save-and-then-action-new.php
r1267552 r1443643 2 2 3 3 /** 4 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)4 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 5 5 * 6 6 * This file is part of the "Improved Save Button" … … 32 32 */ 33 33 function get_name() { 34 return __('Save and New', ' lb-save-and-then');34 return __('Save and New', 'improved-save-button'); 35 35 } 36 36 … … 46 46 */ 47 47 function get_description() { 48 return __('Shows the <strong>new post</strong> form after save.', ' lb-save-and-then');48 return __('Shows the <strong>new post</strong> form after save.', 'improved-save-button'); 49 49 } 50 50 … … 53 53 */ 54 54 function get_button_label_pattern( $post ) { 55 return __('%s and New', ' lb-save-and-then');55 return __('%s and New', 'improved-save-button'); 56 56 } 57 57 -
improved-save-button/trunk/actions/class-lb-save-and-then-action-next.php
r1267552 r1443643 2 2 3 3 /** 4 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)4 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 5 5 * 6 6 * This file is part of the "Improved Save Button" … … 34 34 */ 35 35 function get_name() { 36 return __('Save and Next', ' lb-save-and-then');36 return __('Save and Next', 'improved-save-button'); 37 37 } 38 38 … … 48 48 */ 49 49 function get_description() { 50 return __('Shows the <strong>next post</strong> edit form after save.', ' lb-save-and-then');50 return __('Shows the <strong>next post</strong> edit form after save.', 'improved-save-button'); 51 51 } 52 52 … … 55 55 */ 56 56 function get_button_label_pattern( $post ) { 57 return __('%s and Next', ' lb-save-and-then');57 return __('%s and Next', 'improved-save-button'); 58 58 } 59 59 … … 81 81 function get_button_title( $post ) { 82 82 if( ! $this->is_enabled( $post ) ) { 83 return __('You are at the last post', ' lb-save-and-then');83 return __('You are at the last post', 'improved-save-button'); 84 84 } else { 85 85 $next_post = LB_Save_And_Then_Utils::get_adjacent_post( $post, 'next' ); 86 return sprintf( __('Next post is "%s"', ' lb-save-and-then'), $next_post->post_title );86 return sprintf( __('Next post is "%s"', 'improved-save-button'), $next_post->post_title ); 87 87 } 88 88 } -
improved-save-button/trunk/actions/class-lb-save-and-then-action-previous.php
r1267552 r1443643 2 2 3 3 /** 4 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)4 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 5 5 * 6 6 * This file is part of the "Improved Save Button" … … 34 34 */ 35 35 function get_name() { 36 return __('Save and Previous', ' lb-save-and-then');36 return __('Save and Previous', 'improved-save-button'); 37 37 } 38 38 … … 48 48 */ 49 49 function get_description() { 50 return __('Shows the <strong>previous post</strong> edit form after save.', ' lb-save-and-then');50 return __('Shows the <strong>previous post</strong> edit form after save.', 'improved-save-button'); 51 51 } 52 52 … … 55 55 */ 56 56 function get_button_label_pattern( $post ) { 57 return __('%s and Previous', ' lb-save-and-then');57 return __('%s and Previous', 'improved-save-button'); 58 58 } 59 59 … … 81 81 function get_button_title( $post ) { 82 82 if( ! $this->is_enabled( $post ) ) { 83 return __('You are at the first post', ' lb-save-and-then');83 return __('You are at the first post', 'improved-save-button'); 84 84 } else { 85 85 $previous_post = LB_Save_And_Then_Utils::get_adjacent_post( $post, 'previous' ); 86 return sprintf( __('Previous post is "%s"', ' lb-save-and-then'), $previous_post->post_title );86 return sprintf( __('Previous post is "%s"', 'improved-save-button'), $previous_post->post_title ); 87 87 } 88 88 } -
improved-save-button/trunk/actions/class-lb-save-and-then-action-view-popup.php
r1267552 r1443643 2 2 3 3 /** 4 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)4 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 5 5 * 6 6 * This file is part of the "Improved Save Button" … … 103 103 popupWindow = window.open( '', '<?php echo $js_window_name; ?>' ); 104 104 popupWindow.document.open(); 105 popupWindow.document.write("<?php _e('Please wait while the post is being saved. This window will refresh automatically.', ' lb-save-and-then'); ?>");105 popupWindow.document.write("<?php _e('Please wait while the post is being saved. This window will refresh automatically.', 'improved-save-button'); ?>"); 106 106 popupWindow.document.close(); 107 107 }); … … 119 119 */ 120 120 function get_name() { 121 return sprintf( __('Save and View %s (new window)', ' lb-save-and-then'), self::HTML_ICON );121 return sprintf( __('Save and View %s (new window)', 'improved-save-button'), self::HTML_ICON ); 122 122 } 123 123 … … 133 133 */ 134 134 function get_description() { 135 return __('Shows the <strong>post itself in a new window</strong> after save.', ' lb-save-and-then');135 return __('Shows the <strong>post itself in a new window</strong> after save.', 'improved-save-button'); 136 136 } 137 137 … … 141 141 function get_button_label_pattern( $post ) { 142 142 // The first %s must be escaped, because it is not replaced by this sprintf 143 return sprintf( __('%%s and View %s', ' lb-save-and-then'), self::HTML_ICON );143 return sprintf( __('%%s and View %s', 'improved-save-button'), self::HTML_ICON ); 144 144 } 145 145 … … 152 152 */ 153 153 function get_button_title( $post ) { 154 return __('Post will be shown in a new window', ' lb-save-and-then');154 return __('Post will be shown in a new window', 'improved-save-button'); 155 155 } 156 156 -
improved-save-button/trunk/actions/class-lb-save-and-then-action-view.php
r1267552 r1443643 2 2 3 3 /** 4 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)4 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 5 5 * 6 6 * This file is part of the "Improved Save Button" … … 32 32 */ 33 33 function get_name() { 34 return __('Save and View', ' lb-save-and-then');34 return __('Save and View', 'improved-save-button'); 35 35 } 36 36 … … 46 46 */ 47 47 function get_description() { 48 return __('Shows the <strong>post itself</strong> after save. The same window is used.', ' lb-save-and-then');48 return __('Shows the <strong>post itself</strong> after save. The same window is used.', 'improved-save-button'); 49 49 } 50 50 … … 53 53 */ 54 54 function get_button_label_pattern( $post ) { 55 return __('%s and View', ' lb-save-and-then');55 return __('%s and View', 'improved-save-button'); 56 56 } 57 57 … … 64 64 */ 65 65 function get_button_title( $post ) { 66 return __('Post will be shown in this window', ' lb-save-and-then');66 return __('Post will be shown in this window', 'improved-save-button'); 67 67 } 68 68 -
improved-save-button/trunk/improved-save-button.php
r1267552 r1443643 4 4 Description: Adds a new "Save" button to the Post Edit screen that saves the post and immediately redirects to one of the common screens: the Posts List, the New Post screen, the previous or next post's Edit screen or the post's frontend page. 5 5 Author: Label Blanc 6 Version: 1.1 6 Version: 1.1.1 7 7 Author URI: http://www.labelblanc.ca 8 8 Domain Path: /languages/ 9 Text Domain: lb-save-and-then9 Text Domain: improved-save-button 10 10 */ 11 11 12 12 /** 13 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)13 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 14 14 * 15 15 * This file is part of the "Improved Save Button" -
improved-save-button/trunk/js/backward-compatibility/post-edit.pre-4.2.js
r1150608 r1443643 1 1 /** 2 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)2 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 3 3 * 4 4 * This file is part of the "Improved Save Button" -
improved-save-button/trunk/js/post-edit.js
r1267552 r1443643 1 1 /** 2 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)2 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 3 3 * 4 4 * This file is part of the "Improved Save Button" -
improved-save-button/trunk/js/post-edit.min.js
r1267552 r1443643 1 1 /* Generated from JavaScript source files. Do not modify directly. */ 2 window.LabelBlanc=window.LabelBlanc||{},window.LabelBlanc.SaveAndThen=window.LabelBlanc.SaveAndThen||{},function(a){var b=window.LabelBlanc.SaveAndThen;a(function(){var c=b.config,d=a("#post");c&&d.length&&new b.PostEditForm(d,c)}),b.PostEditForm=function(a,c){if(c.actions&&0!==c.actions.length){this.$form=a,this.config=c,this.action=null;var d=this.getDefaultAction();1!==c.actions.length||c.actions[0].enabled||(this.config.newButtonSetIsDummy=!0,d=c.actions[0]),this.$actionInput=this.createActionInput(),this.$originalPublishButton=this.getOriginalPublishButton(),this.newPublishButtonSet=new b.PublishButtonSet(this),this.$spinner=this.$form.find("#publishing-action .spinner"),this.setupForm(),this.setupOriginalPublishButton(),this.newPublishButtonSet.setAction(d),this.setupFormListeners(),this.setupWordpressListeners(),this.newPublishButtonSet.hideMenu(),this.insertNewPublishButtonSet(),this.setupSpinner(),this.config.newButtonSetIsDummy&&this.newPublishButtonSet.disable(!0)}},b.PostEditForm.LAST_USED_COOKIE_NAME="lb-sat-last-used-action",b.PostEditForm.prototype={getOriginalPublishButton:function(){return this.$form.find("#publish")},setupSpinner:function(){this.$spinner.addClass("lb-sat-spinner"),this.$originalPublishButton.before(this.$spinner)},insertNewPublishButtonSet:function(){var b=this.newPublishButtonSet.$container,c=a('<div class="lb-sat-separator"></div>');this.config.setAsDefault?this.$originalPublishButton.after(b).after(c):this.$originalPublishButton.before(b).before(c)},createActionInput:function(){return a('<input type="hidden" name="'+b.HTTP_PARAM_ACTION+'" />')},setupForm:function(){this.$form.prepend(this.$actionInput)},setupOriginalPublishButton:function(){this.config.setAsDefault&&!this.config.newButtonSetIsDummy&&this.$originalPublishButton.removeClass("button-primary").removeAttr("accesskey")},setAction:function(a){this.action=a,wpCookies.set(b.PostEditForm.LAST_USED_COOKIE_NAME,a.id,31536e3),this.$actionInput.val(a.id)},getAction:function(){return this.action},submit:function(){this.setAction(this.newPublishButtonSet.getAction());var b=a.Event("lb-save-and-then:submit");this.$form.trigger(b,this),b.isDefaultPrevented()||(this.$form.data("lbsat-button-submitted",!0),this.getOriginalPublishButton().click())},setupFormListeners:function(){var a=this;this.$form.on("submit.lbsat-post-edit",function(b){var c=a.$form.data("lbsat-button-submitted");a.$form.removeData("lbsat-button-submitted"),b.isDefaultPrevented()||c===!0&&a.newPublishButtonSet.$container.before(a.$spinner)})},getDefaultAction:function(){var c,d=this.config.defaultActionId,e=null;if(a.each(this.config.actions,function(a,b){return b.enabled?(c=b,!1):void 0}),!d)return c;if(b.ACTION_LAST_ID===d){var f=wpCookies.get(b.PostEditForm.LAST_USED_COOKIE_NAME);if(!f)return c;d=f}return e=this.getActionFromId(d),e&&e.enabled||(e=c),e},getActionFromId:function(b){var c=null;return a.each(this.config.actions,function(a,d){return d.id===b?(c=d,!1):void 0}),c},setupWordpressListeners:function(){var b=this;this.$form.on("click.lbsat-post-edit",":submit, a.submitdelete, #post-preview",function( ){var c=a(this);c.hasClass("disabled")||c.hasClass("submitdelete")||c.is("#post-preview")||b.$form.one("submit.lbsat-post-edit",function(a){a.isDefaultPrevented()||b.newPublishButtonSet.disable(!0)})}),a(document).on("autosave-disable-buttons.edit-post",function(){b.newPublishButtonSet.disable(!0)}).on("autosave-enable-buttons.edit-post",function(){wp.heartbeat&&wp.heartbeat.hasConnectionError()||b.config.newButtonSetIsDummy||b.newPublishButtonSet.disable(!1)}),this.$form.on("click","#post-visibility-select .cancel-post-visibility,#post-visibility-select .save-post-visibility,#timestampdiv .cancel-timestamp,#timestampdiv .save-timestamp,#post-status-select .save-post-status,#post-status-select .cancel-post-status",function(){b.newPublishButtonSet.updateLabels()})}},b.PublishButtonSet=function(a){this.postEditForm=a,this.config=this.postEditForm.config,this.action=null,this.$mainButton=this.createMainButton(),this.$dropdownButton=this.createDropdownButton(),this.$dropdownMenu=this.createDropdownMenu(),this.$container=this.createContainer(),this.setupDocumentClickListener(),this.setupMainButtonListeners(),this.setupDropdownButtonListeners(),this.setupDropdownMenuListeners()},b.PublishButtonSet.prototype={createMainButton:function(){var b=a('<button type="button"/>');return b.attr("class","button button-large lb-sat-main-button"),this.config.setAsDefault&&!this.config.newButtonSetIsDummy?b.addClass("button-primary"):b.removeAttr("accesskey"),b},createDropdownButton:function(){var b=a('<input type="button" value="" />');return b.attr("class",this.$mainButton.attr("class")),b.removeClass("lb-sat-main-button").addClass("lb-sat-dropdown-button"),b},createDropdownMenu:function(){var b=a('<ul class="lb-sat-dropdown-menu"></ul>'),c=this;return a.each(this.config.actions,function(d,e){var f=a('<li data-lb-sat-value="'+e.id+'">'+c.generateButtonLabel(e.buttonLabelPattern)+"</li>");e.title&&f.attr("title",e.title),e.enabled?f.data("lbSatActionData",e):f.addClass("disabled"),b.append(f)}),b},createContainer:function(){var b=a('<span class="lb-sat-container"></span>');return b.append(this.$mainButton),this.config.actions.length>1&&b.addClass("lb-sat-with-dropdown").append(this.$dropdownButton).append(this.$dropdownMenu),this.config.setAsDefault&&b.addClass("lb-sat-set-as-default"),b},setupDocumentClickListener:function(){var b=this;a(document).click(function(){b.menuShown()&&b.hideMenu()})},setupMainButtonListeners:function(){var b=this;this.$mainButton.click(function(){a(this).hasClass("disabled")||b.config.newButtonSetIsDummy||b.postEditForm.submit()})},setupDropdownButtonListeners:function(){var a=this;this.$dropdownButton.click(function(b){a.menuShown()||(a.showMenu(),b.stopPropagation())})},setupDropdownMenuListeners:function(){var b=this;this.$dropdownMenu.on("click","li",function(){a(this).hasClass("disabled")||b.config.newButtonSetIsDummy||(b.setAction(a(this).data("lbSatActionData")),b.$mainButton.click())})},menuShown:function(){return this.$container.hasClass("lb-sat-dropdown-menu-shown")},showMenu:function(){this.$container.addClass("lb-sat-dropdown-menu-shown")},hideMenu:function(){this.$container.removeClass("lb-sat-dropdown-menu-shown")},setAction:function(a){this.action=a,this.updateLabels()},getAction:function(){return this.action},updateLabels:function(){var b=this;this.$mainButton.html(this.generateButtonLabel(this.action.buttonLabelPattern)),this.$mainButton.attr("title",this.action.title?this.action.title:""),a.each(this.config.actions,function(a,c){var d=b.$dropdownMenu.find('[data-lb-sat-value="'+c.id+'"]');d.html(b.generateButtonLabel(c.buttonLabelPattern))})},generateButtonLabel:function(a){return a.replace("%s",this.postEditForm.$originalPublishButton.val())},disable:function(a){this.$mainButton.toggleClass("disabled",a),this.$dropdownButton.toggleClass("disabled",a)}}}(jQuery);2 window.LabelBlanc=window.LabelBlanc||{},window.LabelBlanc.SaveAndThen=window.LabelBlanc.SaveAndThen||{},function(a){var b=window.LabelBlanc.SaveAndThen;a(function(){var c=b.config,d=a("#post");c&&d.length&&new b.PostEditForm(d,c)}),b.PostEditForm=function(a,c){if(c.actions&&0!==c.actions.length){this.$form=a,this.config=c,this.action=null;var d=this.getDefaultAction();1!==c.actions.length||c.actions[0].enabled||(this.config.newButtonSetIsDummy=!0,d=c.actions[0]),this.$actionInput=this.createActionInput(),this.$originalPublishButton=this.getOriginalPublishButton(),this.newPublishButtonSet=new b.PublishButtonSet(this),this.$spinner=this.$form.find("#publishing-action .spinner"),this.setupForm(),this.setupOriginalPublishButton(),this.newPublishButtonSet.setAction(d),this.setupFormListeners(),this.setupWordpressListeners(),this.newPublishButtonSet.hideMenu(),this.insertNewPublishButtonSet(),this.setupSpinner(),this.config.newButtonSetIsDummy&&this.newPublishButtonSet.disable(!0)}},b.PostEditForm.LAST_USED_COOKIE_NAME="lb-sat-last-used-action",b.PostEditForm.prototype={getOriginalPublishButton:function(){return this.$form.find("#publish")},setupSpinner:function(){this.$spinner.addClass("lb-sat-spinner"),this.$originalPublishButton.before(this.$spinner)},insertNewPublishButtonSet:function(){var b=this.newPublishButtonSet.$container,c=a('<div class="lb-sat-separator"></div>');this.config.setAsDefault?this.$originalPublishButton.after(b).after(c):this.$originalPublishButton.before(b).before(c)},createActionInput:function(){return a('<input type="hidden" name="'+b.HTTP_PARAM_ACTION+'" />')},setupForm:function(){this.$form.prepend(this.$actionInput)},setupOriginalPublishButton:function(){this.config.setAsDefault&&!this.config.newButtonSetIsDummy&&this.$originalPublishButton.removeClass("button-primary").removeAttr("accesskey")},setAction:function(a){this.action=a,wpCookies.set(b.PostEditForm.LAST_USED_COOKIE_NAME,a.id,31536e3),this.$actionInput.val(a.id)},getAction:function(){return this.action},submit:function(){this.setAction(this.newPublishButtonSet.getAction());var b=a.Event("lb-save-and-then:submit");this.$form.trigger(b,this),b.isDefaultPrevented()||(this.$form.data("lbsat-button-submitted",!0),this.getOriginalPublishButton().click())},setupFormListeners:function(){var a=this;this.$form.on("submit.lbsat-post-edit",function(b){var c=a.$form.data("lbsat-button-submitted");a.$form.removeData("lbsat-button-submitted"),b.isDefaultPrevented()||c===!0&&a.newPublishButtonSet.$container.before(a.$spinner)})},getDefaultAction:function(){var c,d=this.config.defaultActionId,e=null;if(a.each(this.config.actions,function(a,b){return b.enabled?(c=b,!1):void 0}),!d)return c;if(b.ACTION_LAST_ID===d){var f=wpCookies.get(b.PostEditForm.LAST_USED_COOKIE_NAME);if(!f)return c;d=f}return e=this.getActionFromId(d),e&&e.enabled||(e=c),e},getActionFromId:function(b){var c=null;return a.each(this.config.actions,function(a,d){return d.id===b?(c=d,!1):void 0}),c},setupWordpressListeners:function(){var b=this;this.$form.on("click.lbsat-post-edit",":submit, a.submitdelete, #post-preview",function(c){var d=a(this);d.hasClass("disabled")||d.hasClass("submitdelete")||d.is("#post-preview")||b.$form.one("submit.lbsat-post-edit",function(a){a.isDefaultPrevented()||b.newPublishButtonSet.disable(!0)})}),a(document).on("autosave-disable-buttons.edit-post",function(){b.newPublishButtonSet.disable(!0)}).on("autosave-enable-buttons.edit-post",function(){wp.heartbeat&&wp.heartbeat.hasConnectionError()||b.config.newButtonSetIsDummy||b.newPublishButtonSet.disable(!1)}),this.$form.on("click","#post-visibility-select .cancel-post-visibility,#post-visibility-select .save-post-visibility,#timestampdiv .cancel-timestamp,#timestampdiv .save-timestamp,#post-status-select .save-post-status,#post-status-select .cancel-post-status",function(){b.newPublishButtonSet.updateLabels()})}},b.PublishButtonSet=function(a){this.postEditForm=a,this.config=this.postEditForm.config,this.action=null,this.$mainButton=this.createMainButton(),this.$dropdownButton=this.createDropdownButton(),this.$dropdownMenu=this.createDropdownMenu(),this.$container=this.createContainer(),this.setupDocumentClickListener(),this.setupMainButtonListeners(),this.setupDropdownButtonListeners(),this.setupDropdownMenuListeners()},b.PublishButtonSet.prototype={createMainButton:function(){var b=a('<button type="button"/>');return b.attr("class","button button-large lb-sat-main-button"),this.config.setAsDefault&&!this.config.newButtonSetIsDummy?b.addClass("button-primary"):b.removeAttr("accesskey"),b},createDropdownButton:function(){var b=a('<input type="button" value="" />');return b.attr("class",this.$mainButton.attr("class")),b.removeClass("lb-sat-main-button").addClass("lb-sat-dropdown-button"),b},createDropdownMenu:function(){var b=a('<ul class="lb-sat-dropdown-menu"></ul>'),c=this;return a.each(this.config.actions,function(d,e){var f=a('<li data-lb-sat-value="'+e.id+'">'+c.generateButtonLabel(e.buttonLabelPattern)+"</li>");e.title&&f.attr("title",e.title),e.enabled?f.data("lbSatActionData",e):f.addClass("disabled"),b.append(f)}),b},createContainer:function(){var b=a('<span class="lb-sat-container"></span>');return b.append(this.$mainButton),this.config.actions.length>1&&b.addClass("lb-sat-with-dropdown").append(this.$dropdownButton).append(this.$dropdownMenu),this.config.setAsDefault&&b.addClass("lb-sat-set-as-default"),b},setupDocumentClickListener:function(){var b=this;a(document).click(function(){b.menuShown()&&b.hideMenu()})},setupMainButtonListeners:function(){var b=this;this.$mainButton.click(function(){a(this).hasClass("disabled")||b.config.newButtonSetIsDummy||b.postEditForm.submit()})},setupDropdownButtonListeners:function(){var a=this;this.$dropdownButton.click(function(b){a.menuShown()||(a.showMenu(),b.stopPropagation())})},setupDropdownMenuListeners:function(){var b=this;this.$dropdownMenu.on("click","li",function(){a(this).hasClass("disabled")||b.config.newButtonSetIsDummy||(b.setAction(a(this).data("lbSatActionData")),b.$mainButton.click())})},menuShown:function(){return this.$container.hasClass("lb-sat-dropdown-menu-shown")},showMenu:function(){this.$container.addClass("lb-sat-dropdown-menu-shown")},hideMenu:function(){this.$container.removeClass("lb-sat-dropdown-menu-shown")},setAction:function(a){this.action=a,this.updateLabels()},getAction:function(){return this.action},updateLabels:function(){var b=this;this.$mainButton.html(this.generateButtonLabel(this.action.buttonLabelPattern)),this.$mainButton.attr("title",this.action.title?this.action.title:""),a.each(this.config.actions,function(a,c){var d=b.$dropdownMenu.find('[data-lb-sat-value="'+c.id+'"]');d.html(b.generateButtonLabel(c.buttonLabelPattern))})},generateButtonLabel:function(a){return a.replace("%s",this.postEditForm.$originalPublishButton.val())},disable:function(a){this.$mainButton.toggleClass("disabled",a),this.$dropdownButton.toggleClass("disabled",a)}}}(jQuery); -
improved-save-button/trunk/js/settings-page.js
r1267552 r1443643 1 1 /** 2 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)2 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 3 3 * 4 4 * This file is part of the "Improved Save Button" -
improved-save-button/trunk/lib/class-lb-save-and-then-action.php
r1267552 r1443643 2 2 3 3 /** 4 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)4 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 5 5 * 6 6 * This file is part of the "Improved Save Button" -
improved-save-button/trunk/lib/class-lb-save-and-then-actions.php
r1267552 r1443643 2 2 3 3 /** 4 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)4 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 5 5 * 6 6 * This file is part of the "Improved Save Button" -
improved-save-button/trunk/lib/class-lb-save-and-then-messages.php
r1267552 r1443643 2 2 3 3 /** 4 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)4 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 5 5 * 6 6 * This file is part of the "Improved Save Button" -
improved-save-button/trunk/lib/class-lb-save-and-then-post-edit.php
r1267552 r1443643 2 2 3 3 /** 4 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)4 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 5 5 * 6 6 * This file is part of the "Improved Save Button" -
improved-save-button/trunk/lib/class-lb-save-and-then-post-save.php
r1267552 r1443643 2 2 3 3 /** 4 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)4 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 5 5 * 6 6 * This file is part of the "Improved Save Button" -
improved-save-button/trunk/lib/class-lb-save-and-then-settings.php
r1267552 r1443643 2 2 3 3 /** 4 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)4 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 5 5 * 6 6 * This file is part of the "Improved Save Button" … … 109 109 add_settings_field( 110 110 'lb-save-and-then-set-as-default', 111 __('Display button as default', ' lb-save-and-then'),111 __('Display button as default', 'improved-save-button'), 112 112 array( get_called_class(), 'create_setting_field' ), 113 113 self::MENU_SLUG, … … 118 118 add_settings_field( 119 119 'lb-save-and-then-actions', 120 __('Actions to show', ' lb-save-and-then'),120 __('Actions to show', 'improved-save-button'), 121 121 array( get_called_class(), 'create_setting_field' ), 122 122 self::MENU_SLUG, … … 127 127 add_settings_field( 128 128 'lb-save-and-then-default-action', 129 __('Default action', ' lb-save-and-then'),129 __('Default action', 'improved-save-button'), 130 130 array( get_called_class(), 'create_setting_field' ), 131 131 self::MENU_SLUG, … … 141 141 static function create_administration_menu() { 142 142 add_options_page( 143 sprintf( __('%s Settings', ' lb-save-and-then'), LB_Save_And_Then::get_localized_name() ),144 __('Improved Save Button', ' lb-save-and-then'),143 sprintf( __('%s Settings', 'improved-save-button'), LB_Save_And_Then::get_localized_name() ), 144 __('Improved Save Button', 'improved-save-button'), 145 145 'manage_options', 146 146 self::MENU_SLUG, … … 158 158 ?> 159 159 <div class="wrap"> 160 <h1><?php printf( __('<em>%s</em> Settings', ' lb-save-and-then'), LB_Save_And_Then::get_localized_name() ); ?></h1>160 <h1><?php printf( __('<em>%s</em> Settings', 'improved-save-button'), LB_Save_And_Then::get_localized_name() ); ?></h1> 161 161 <form method="post" action="options.php" data-lb-sat-settings="form"> 162 162 <?php settings_fields( self::OPTION_GROUP ); ?> … … 188 188 case 'set-as-default': 189 189 $html .= '<fieldset><label><input type="checkbox" name="' . $option_field_name. '" value="1"' . checked( 1, $option_value, false ) . '/>'; 190 $html .= '<span>' . __('Display the new save button as the default one', ' lb-save-and-then') . '</span></label></fieldset>';190 $html .= '<span>' . __('Display the new save button as the default one', 'improved-save-button') . '</span></label></fieldset>'; 191 191 break; 192 192 … … 225 225 226 226 $action_id = LB_Save_And_Then_Actions::ACTION_LAST; 227 $action_name = '<em>' . __('Last used', ' lb-save-and-then') . '</em>';228 $action_description = __('The last action that was used', ' lb-save-and-then');227 $action_name = '<em>' . __('Last used', 'improved-save-button') . '</em>'; 228 $action_description = __('The last action that was used', 'improved-save-button'); 229 229 230 230 } else { -
improved-save-button/trunk/lib/class-lb-save-and-then-utils.php
r1267552 r1443643 2 2 3 3 /** 4 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)4 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 5 5 * 6 6 * This file is part of the "Improved Save Button" -
improved-save-button/trunk/readme.txt
r1443446 r1443643 4 4 Requires at least: 3.5 5 5 Tested up to: 4.5.3 6 Stable tag: 1.1 6 Stable tag: 1.1.1 7 7 License: GPLv3 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 50 50 == Changelog == 51 51 52 = 1.1.1 = 53 Release Date: June 25, 2016 54 55 * Misc: code updated to allow Wordpress Translation service (text domain changed to the plugin's slug) 56 52 57 = 1.1 = 53 58 Release Date: October 17, 2015 -
improved-save-button/trunk/scss/post-edit.scss
r1267552 r1443643 1 1 /** 2 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)2 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 3 3 * 4 4 * This file is part of the "Improved Save Button" -
improved-save-button/trunk/uninstall.php
r1094802 r1443643 2 2 3 3 /** 4 * Copyright 201 5Label Blanc (http://www.labelblanc.ca/)4 * Copyright 2016 Label Blanc (http://www.labelblanc.ca/) 5 5 * 6 6 * This file is part of the "Improved Save Button"
Note: See TracChangeset
for help on using the changeset viewer.