Changeset 1842894
- Timestamp:
- 03/19/2018 03:48:40 PM (7 years ago)
- Location:
- playbuzz
- Files:
-
- 78 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
playbuzz/trunk/js/pb-global.js
r1623912 r1842894 19 19 //normalize the global object 20 20 this.normalize(this.global); 21 22 this.global.setItemId = function setItemId(itemId) { 23 window.pb.itemId = itemId; 24 }; 21 25 22 26 return this.global; -
playbuzz/trunk/js/story-creator/_pb-story-creator.js
r1623912 r1842894 1 (function (Globals, $) { 2 Globals.pbInitStoryCreator = function (Globals, $) { 1 3 2 (function (window, $) { 4 var pbGlobal = new Globals.PbGlobal(Globals.pb, $, Globals.pbSettings), 3 5 4 var pbGlobal = new window.PbGlobal(window.pb, $, window.pbSettings),6 pbStoryCreatorModel = new Globals.PbStoryCreatorModel($, Globals.PbCreator, Globals.PbApi, pbGlobal), 5 7 6 pbStoryCreatorModel = new window.PbStoryCreatorModel($, window.PbCreator, window.PbApi, pbGlobal),8 pbStoryCreatorView = new Globals.PbStoryCreatorView($, Globals.PbEvent), 7 9 8 pbStoryCreatorView = new window.PbStoryCreatorView($, window.PbEvent),10 pbStoryCreatorController = new Globals.PbStoryCreatorController(pbStoryCreatorModel, pbStoryCreatorView, $, Globals.PbAlert, Globals.wp, Globals.pbLogger); 9 11 10 pbStoryCreatorController = new window.PbStoryCreatorController(pbStoryCreatorModel, pbStoryCreatorView, $, window.PbAlert, window.wp, window.pbLogger ); 12 pbStoryCreatorController.init(); 13 }; 11 14 12 13 pbStoryCreatorController.init(); 15 Globals.pbInitStoryCreator(Globals, $); 14 16 15 17 })(window, window.jQuery); 16 17 18 19 -
playbuzz/trunk/js/story-creator/pb-story-creator-controller.js
r1829135 r1842894 62 62 _this.actionRunning(sender.pb); 63 63 64 _this.model.savePost(sender.wp).then(_this.postSuccessHandler.bind(_this), _this.errorHandler.bind(_this));64 _this.model.savePost( sender.wp ).then( _this.refreshCreator.bind( _this ), _this.errorHandler.bind( _this ) ); 65 65 66 66 }); … … 295 295 }; 296 296 297 297 PbStoryCreatorController.prototype.refreshCreator = function(){ 298 this.postSuccessHandler(); 299 this.view.removePbElements(); 300 this.$('#pb-story-creator').empty(); 301 window.pbInitStoryCreator(window, this.$); 302 }; 298 303 299 304 -
playbuzz/trunk/js/story-creator/pb-story-creator-model.js
r1623912 r1842894 30 30 31 31 32 if(environment && environment !== ""){ options.environment = environment; } 32 if (environment && environment !== "") { 33 options.environment = environment; 34 } 33 35 34 36 … … 59 61 _this.data.itemId = res.itemId; 60 62 61 return _this.api.post(_this.data, {action: _this.savePostAction, url: _this.url}); 63 // keep the item id for future refreshing of the creator 64 _this.global.setItemId(res.itemId); 65 66 return _this.api.post( _this.data, {action: _this.savePostAction, url: _this.url} ); 62 67 63 68 }) … … 173 178 }; 174 179 175 176 180 window.PbStoryCreatorModel = PbStoryCreatorModel; -
playbuzz/trunk/js/story-creator/pb-story-creator-view.js
r1623912 r1842894 4 4 function PbStoryCreatorView(jQuery, PbEvent){ 5 5 6 varelementsToCreate = ['#save-post', '#post-preview', '#publish'];6 this.elementsToCreate = ['#save-post', '#post-preview', '#publish']; 7 7 var elementsToBind = ['#title']; 8 8 9 this.$= jQuery;10 this.newElements = this.generateElements(elementsToCreate, true);11 this.elements = this.generateElements(elementsToBind);12 this.Event= PbEvent;9 this.$ = jQuery; 10 this.newElements = this.generateElements( this.elementsToCreate, true ); 11 this.elements = this.generateElements( elementsToBind ); 12 this.Event = PbEvent; 13 13 14 14 this.init(); … … 31 31 var wp = _this.$(elements[i]); 32 32 33 var pb = createNewElement ? wp.clone().prependTo(wp.parent()).attr('id', 'pb-' + element) : null; 33 var idWithPbPrefix = 'pb-' + element; 34 var pb = createNewElement ? wp.clone().prependTo( wp.parent() ).attr( 'id', idWithPbPrefix ) : null; 34 35 35 36 _elements[element] = { … … 86 87 }; 87 88 89 PbStoryCreatorView.prototype.removePbElements = function removePbElements() { 90 this.elementsToCreate.forEach(function(elementId){ 91 var pbButtonsId = '#pb-' + elementId.substring(1); 92 this.$(pbButtonsId).remove(); 93 }) 94 }; 88 95 89 96 window.PbStoryCreatorView = PbStoryCreatorView; -
playbuzz/trunk/playbuzz.php
r1839779 r1842894 4 4 Plugin URI: https://www.playbuzz.com/ 5 5 Description: Embed customized playful content from Playbuzz.com into your WordPress site 6 Version: 1.0. 76 Version: 1.0.8 7 7 Author: Playbuzz 8 8 Author URI: https://www.playbuzz.com/ -
playbuzz/trunk/readme.txt
r1839779 r1842894 4 4 Requires at least: 3.9 5 5 Tested up to: 4.7.1 6 Stable tag: 1.0. 76 Stable tag: 1.0.8 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 112 112 113 113 == Changelog == 114 115 = 1.0.8 (2018-03-19) = 116 * Bug fix - save draft didn't work without refreshing 117 114 118 = 1.0.7 (2018-03-14) = 115 119 * Playbuzz embed code is transformed to short code after paste
Note: See TracChangeset
for help on using the changeset viewer.