Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: msd_minibar: Adds a Microsoft Office style "minibar" to the Write tab
Oh shoot. Looks like I’ve lost the source at some point when I restored my site from a backup. Sorry. If someone has it send it to me and I can restore the download link.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: msd_minibar: Adds a Microsoft Office style "minibar" to the Write tab
Version 0.5 has been restored thanks to Uli. Sorry, I don’t remember what changed in version 0.6 which i apparently had at somepoint.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: msd_minibar: Adds a Microsoft Office style "minibar" to the Write tab
Thanks for this one, Matt.
Here is a little change that makes it more usable when the textarea is very large (for example, when using rah_expanding, which auto-grows textareas).
...
echo "$('#msd_".$msd_menu_items[$row]["tag"]."').click(function(e) {"."\n";
echo ' e.preventDefault();'."\n";
...
This helps by avoiding the browser scroll jumping back to top.
Offline
Re: msd_minibar: Adds a Microsoft Office style "minibar" to the Write tab
Reporting an issue between msd_minibar and latest Txp 4.5 Beta (from SVN): forum.textpattern.com/viewtopic.php?pid=264308#p264308
Offline
Re: msd_minibar: Adds a Microsoft Office style "minibar" to the Write tab
Maniqui, I wasn’t able to recreate this behavior. Do you have any custom buttons you’ve added?
Steps I took to try and reproduce:
- Highlighted text in existing article and used one of the mini_bar buttons to modify it.
- Clicked Save
- Saw “Article Saved” message
- Created new article
- Highlighted text in new article and used one of the mini_bar buttons to modify it.
- Clicked Publish
- Saw “Article Published” message
I tried this using both the Classic theme and Hive on 4.5.0-beta (r4033). I only tested using IE8 (because I’m at work shhhhh).
Last edited by MattD (2012-08-09 16:38:05)
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: msd_minibar: Adds a Microsoft Office style "minibar" to the Write tab
Hi Matt. Thanks for the prompt reply & for taking the time of doing a test.
I’ve more info about this issue (which I’m not sure it will get covered by the warranty ;) ): I’m using the plugin from the plugin cache dir. I’ve just tried installing it directly on the DB (as any good Txp citizen would do) and it worked flawlessly. :D
Now, I wonder if there is any solution for us, badasses who run plugins from plugin cache dir ;)
Offline
Re: msd_minibar: Adds a Microsoft Office style "minibar" to the Write tab
No idea on why that would cause any difference. There aren’t any lifecycle events that take place on install for this plugin or anything complicated going on.
Maybe diff the html source of the write page with the plugin loaded each way and see if something is different?
Also compare the output of http://yoursite.com/textpattern/?msd_minibar_js=jquery.caret.js
and http://yoursite.com/textpattern/?msd_minibar_js=msd_minibar.css
with the plugin loaded each way.
I can do this later this evening if needed.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: msd_minibar: Adds a Microsoft Office style "minibar" to the Write tab
maniqui wrote:
Now, I wonder if there is any solution for us, badasses who run plugins from plugin cache dir
Plugin’s in the cache directory are loaded globally, and as such, will cause issues. For instance these plugins that add markup to the admin-pages interface, will be active on the async ajax responses too. These response pages have same callback events available and a plugin that inject markup to the admin-side interface, will inject it’s markup to the response script too, making it invalid and causing the issue you are describing.
MattD wrote:
No idea on why that would cause any difference. There aren’t any lifecycle events that take place on install for this plugin or anything complicated going on.
Difference is where the plugin is loaded when the plugin cache directory is used. There is nothing wrong with your plugin, and I would say you do not really have to do any changes to it. The code itself is very much fine. Anyways, the line that is causing the mentioned issue is:
register_callback("msd_minibar", "article");
The above line will add msd_minibar function’s output to the script response when plugin is loaded using the wrong type (i.e. using plugin cache directory). To remedy the issue, you could change that callback event to a one that isn’t ran on the ajax script responses. For instance the admin_side.head_end is safe to use. E.g.
register_callback("msd_minibar", "admin_side", "head_end");
You can then prevent the script from running on all admin-side panels by adding something like this to the top of the msd_minibar function:
global $event;
if($event !== 'article') {
return;
}
Last edited by Gocom (2012-08-10 02:10:53)
Offline
Re: msd_minibar: Adds a Microsoft Office style "minibar" to the Write tab
Thanks for the follow up, Gocom.
I’ve applied the changes you suggested Matt, but so far, it doesn’t seem it has made any difference: the alert message is still popping up after saving. If you have any other suggestion, let me know & I’ll test it.
Offline
Re: msd_minibar: Adds a Microsoft Office style "minibar" to the Write tab
I’ve taken Gocom’s suggestions and updated the plugin. Maniqui, give version 0.6 a try.
For now it still loads on every page.
Last edited by MattD (2012-08-10 16:14:31)
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: msd_minibar: Adds a Microsoft Office style "minibar" to the Write tab
I’m running v0.6 from plugin cache dir and it seems to be working flawlessly (no more alert message).
Many thanks, Matt & Gocom!
Offline
Re: msd_minibar: Adds a Microsoft Office style "minibar" to the Write tab
Gocom wrote:
Plugin’s in the cache directory are loaded globally, and as such, will cause issues.
Somebody should really fix this issue. There’s even a thread for this.
While I don’t expect an immediate solution in core a plugin cache loader plugin would be a nice community contribution to flesh out a proper method (hint, hint).
I don’t think that relying on every individual plugin author to adapt her plugins for our current naive cache method is a sustainable tactic.
Last edited by wet (2012-08-11 05:25:12)
Offline