Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2011-10-25 17:14:28

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#14 2011-10-25 18:16:32

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#15 2012-08-09 15:30:33

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#16 2012-08-09 15:51:34

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#17 2012-08-09 16:36:38

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#18 2012-08-09 16:53:07

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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 ;)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#19 2012-08-09 17:00:16

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#20 2012-08-10 01:59:56

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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

#21 2012-08-10 02:43:54

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#22 2012-08-10 16:01:17

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#23 2012-08-10 16:59:21

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#24 2012-08-11 05:23:35

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

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

Board footer

Powered by FluxBB