Changeset 823750
- Timestamp:
- 12/17/2013 09:07:37 AM (12 years ago)
- Location:
- prettypress
- Files:
-
- 19 added
- 7 edited
-
tags/0.2 (added)
-
tags/0.2/assets (added)
-
tags/0.2/assets/index.php (added)
-
tags/0.2/assets/screenshot-1.png (added)
-
tags/0.2/bootstrap.php (added)
-
tags/0.2/index.php (added)
-
tags/0.2/lib (added)
-
tags/0.2/lib/config.php (added)
-
tags/0.2/lib/hooks.php (added)
-
tags/0.2/lib/index.php (added)
-
tags/0.2/lib/settings.php (added)
-
tags/0.2/license.txt (added)
-
tags/0.2/prettypress.php (added)
-
tags/0.2/readme.txt (added)
-
tags/0.2/view (added)
-
tags/0.2/view/edit.php (added)
-
tags/0.2/view/index.php (added)
-
tags/0.2/view/metabox.php (added)
-
tags/0.2/view/prettypress-settings.php (added)
-
trunk/assets/css/prettypress.css (modified) (1 diff)
-
trunk/assets/js/prettypress.js (modified) (7 diffs)
-
trunk/assets/js/prettypress_hooks.js (modified) (1 diff)
-
trunk/assets/js/prettypress_resize.js (modified) (1 diff)
-
trunk/prettypress.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/view/edit.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
prettypress/trunk/assets/css/prettypress.css
r820608 r823750 164 164 165 165 .prettypress_nav { 166 padding: 0 0 .5em;166 padding: 0 0 0 0.5em; 167 167 height: 32px; 168 168 line-height: 32px; 169 width: 4 0.75%;169 width: 41%; 170 170 } 171 171 -
prettypress/trunk/assets/js/prettypress.js
r820608 r823750 28 28 //Set the status. 29 29 this.status = 0; 30 this.hooked_tinymce = "no"; 31 this.hooked_text = "no"; 30 32 31 33 this.toggle = function() { 34 32 35 //Toggles the visibility of preview window. 33 36 if (this.status === 0) { … … 35 38 //Make sure we have a URL to preview. 36 39 if (this.findpageurl() === 1) { 40 37 41 jQuery("#wp-content-wrap").addClass("prettypress_entry_field"); 38 42 jQuery("#titlewrap").addClass("prettypress_title"); … … 50 54 this.status = 1; 51 55 prettypress.resize(); 56 52 57 } else { 58 53 59 //No url visible. 54 60 //Need to "save" draft? 55 61 this.error("Couldn't find any page to draw original theme from. You may need to press 'save' if you have just created this post.", 5000); 62 56 63 } 57 64 } else { … … 64 71 this.status = 0; 65 72 } 73 66 74 } 67 75 68 76 this.resize = function() { 77 69 78 //Resizes the PrettyPress preview window to fit parent container. 70 79 //Firefox causes issues with this in native CSS. 71 80 var padding = jQuery("#prettypress_wrapper").css("padding-top").replace(/[A-Za-z$-]/g, ""); 72 81 padding = parseInt(padding) * 2; 82 73 83 var new_height = jQuery("#prettypress_wrapper").css("height").replace(/[A-Za-z$-]/g, ""); 74 84 new_height = parseInt(new_height) - padding; 85 75 86 var editor_height = new_height - 230; 76 87 new_height = new_height + padding; 88 77 89 //Fix the preview window size. 78 90 jQuery("#prettypress_iframe").css("width", jQuery("#prettypress_preview_container").css("width")); 79 91 jQuery("#prettypress_iframe").css("height", new_height + "px"); 92 80 93 //Fix the editor size. 81 94 jQuery("#content_ifr").css("height", editor_height + "px"); 95 96 82 97 } 83 98 … … 150 165 151 166 this.updatepreviewcontent = function(type) { 167 152 168 var iframe = jQuery("#prettypress_iframe"); 153 169 if (prettypress.status === 1) { 170 154 171 //Only update for valid requests. 155 172 if (type === "title") { … … 162 179 } 163 180 } else if (type === "content") { 164 var tmp_content = t inymce.activeEditor.getContent();181 var tmp_content = this.getactivecontent(); 165 182 if (tmp_content != this.current_content) { 166 183 //Update the content. … … 169 186 } 170 187 } 171 } 188 189 } 190 191 } 192 193 this.getactivecontent = function() { 194 195 //Find the active editor, and pull the value from it. 196 //Is the raw text editor visible? 197 198 if ( jQuery("textarea#content").css("display") === "none" ) { 199 //TinyMCE is active. 200 return tinymce.activeEditor.getContent(); 201 } else { 202 //Raw text editor is active. 203 return jQuery("textarea#content").val(); 204 } 205 206 } 207 208 209 this.hooktinymce = function() { 210 211 //Hook TinyMCE. 212 //Do not call this unless you have verified TinyMCE is active. 213 214 tinymce.activeEditor.onKeyUp.add(function(activeEditor, l) { 215 prettypress.updatepreviewcontent("content"); 216 }); 217 218 tinymce.activeEditor.onChange.add(function(activeEditor, l) { 219 prettypress.updatepreviewcontent("content"); 220 }); 221 222 } 223 224 this.bootuphooks = function() { 225 226 //Hook tinymce / textarea at startup. 227 //This lets the "live update" feature work. 228 229 if ( tinymce.activeEditor != null ) { 230 prettypress.hooktinymce(); 231 prettypress.hooked_tinymce = "yes"; 232 } 233 234 //Hook textarea. 235 jQuery("textarea#content").keyup(function(){ 236 prettypress.updatepreviewcontent("content"); 237 }); 238 prettypress.hooked_text = "yes"; 239 240 } 241 242 this.recursivehooks = function() { 243 244 //This function is called every half a second on the chance the bootup hooks had an error. 245 //This occurs when a user had tinymce disabled / inactive by default. 246 //This allows PP to hook TinyMCE once its active. 247 248 if ( prettypress.hooked_tinymce === "yes" && prettypress.hooked_text === "yes" ) { 249 clearInterval(prettypress.recursinghnd); 250 return false; 251 } else { 252 253 if ( prettypress.hooked_tinymce === "no" ) { 254 //Attempt to hook tinymce. 255 if ( tinymce.activeEditor != null ) { 256 prettypress.hooktinymce(); 257 prettypress.hooked_tinymce = "yes"; 258 } 259 } 260 261 } 262 172 263 } 173 264 } -
prettypress/trunk/assets/js/prettypress_hooks.js
r819371 r823750 53 53 54 54 jQuery(window).load(function() { 55 tinymce.activeEditor.onKeyUp.add(function(activeEditor, l) { 56 prettypress.updatepreviewcontent("content");57 });58 tinymce.activeEditor.onChange.add(function(activeEditor, l) {59 prettypress.updatepreviewcontent("content");60 });55 56 prettypress.bootuphooks(); 57 prettypress.recursinghnd = window.setInterval( function() { 58 prettypress.recursivehooks(); 59 }, 500); 60 61 61 }); -
prettypress/trunk/assets/js/prettypress_resize.js
r820608 r823750 110 110 111 111 var new_resize_left = new_left + padding; 112 var new_resize_menu = new_resize_left - 4;113 112 114 113 jQuery(element_wp_content).css("width", new_left + "px"); 115 114 jQuery(element_title).css("width", new_left + "px"); 116 jQuery(element_prettypress_menu).css("width", new_resize_ menu+ "px");115 jQuery(element_prettypress_menu).css("width", new_resize_left + "px"); 117 116 jQuery(element_prettypress_container).css("width", new_right + "px"); 118 117 jQuery(element_prettypress_iframe).css("width", new_right + "px"); -
prettypress/trunk/prettypress.php
r820608 r823750 7 7 Plugin URI: https://github.com/evasivesoftware/PrettyPress 8 8 Description: A simple Wordpress publishing layout, focused on writing with a live preview of your future post. 9 Version: 0. 29 Version: 0.3 10 10 Author: EvasiveSoftware.com 11 11 Author URI: http://www.evasivesoftware.com/ -
prettypress/trunk/readme.txt
r820653 r823750 5 5 Requires at least: 3.5 6 6 Tested up to: 3.8 7 Stable tag: 0. 27 Stable tag: 0.3 8 8 License: MIT 9 9 License URI: http://opensource.org/licenses/MIT … … 56 56 == Changelog == 57 57 58 = 0.3 = 59 * Fixed raw text / html hooks and support 60 * Live preview should now support raw text and html 61 * Fixed bug where live preview would not execute if page was loaded without TinyMCE as default active editor 62 58 63 = 0.2 = 59 64 * Added Wordpress 3.8 style support -
prettypress/trunk/view/edit.php
r820608 r823750 48 48 <div class="prettypress_nav wp-ui-primary wp-ui-core wp-submenu" id="prettypress_menu"> 49 49 <div class="item item-left" id="prettypress_exit"></div> 50 <div class="item-left"> PrettyPress</div>50 <div class="item-left">Back to Wordpress</div> 51 51 </div> 52 52
Note: See TracChangeset
for help on using the changeset viewer.