inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,024
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Dec 3, 2014 19:28:29 GMT -8
Jaguar thanks for the vote of confidence but keep in mind that the reason I release them in the thread prior to committing to the online library is to weed out any bugs that I may have missed during in my own testing.
|
|
inherit
namaste
197894
0
Nov 15, 2013 13:06:18 GMT -8
Jaguar
Fear does not stop death. It stops life.
7,151
August 2013
sugilite
|
Post by Jaguar on Dec 3, 2014 19:32:35 GMT -8
Oh yes I know about that, no worries. I like hunting bugs.
|
|
Former Member
inherit
guest@proboards.com
177794
0
Dec 2, 2024 16:43:44 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Dec 4, 2014 9:23:56 GMT -8
Hello!
Is there a way to have certain buttons show up on just one board?
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,024
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Dec 4, 2014 13:23:49 GMT -8
Hello! Is there a way to have certain buttons show up on just one board? Tentatively releasing version 0.9.2 (basic) with the following changes:- added support for restricting custom made buttons to only appear for specific groups or only in specific boards- added support for protocol agnostic button image urls (SSL friendly) - added a rudimentary api with an addButton method for use by other plugins and codes (window.eton.wysiwyg.addButton)
|
|
inherit
206056
0
Oct 22, 2024 12:06:59 GMT -8
adminabp
378
February 2014
adminabp
|
Post by adminabp on Dec 5, 2014 5:41:37 GMT -8
Chris, I've got a problem. I'm not sure when or why it started. I have the nightly build version 0.8.825 because I like the level of organization and customization. This is what I have for my custom twitter button: tag: twitter name: Twitter attributes: noendtag=1|id= But when I try to insert, say, 12345678 I get: [twitter noendtag="1" id="12345678"][/twitter] I tried the pragma_noendtag=1|id= instead with the same result. I don't think the nightly build even has pragma support. Any idea what I can do to fix this? If you need to, you can see what it's doing on my test forum: abptestforum.boards.net/ Unfortunately the advanced Control Freak version hasn't been updated in over a year so would not have those pragma_* capabilities but I am pleasantly surprised to hear someone is actually using it since it's been described as "too complicated" to me on several occasions. That used to be the feature test bed for the basic version but soon became another project I had effectively written off as being a waste of time since the perception was nobody liked it or was even using it but for you adminabp I will make a special update this weekend. If you've noticed any bugs or want to see other features added then, by all means, please post them here Woo-who! *VIP treatment right here!* Thank you so much! Really, I don't see a substantial difference between the two versions of the plugin as far as the level of complication. I realized as I started to add more customs button and had buttons added by other plugins, that it would be helpful to be able to completely define my own groups, what was in them and arrange them accordingly. Or course, as soon as I installed the "nightly", and saw it was called "Control Freak", I knew I'd made the right choice in plugin. No bugs I can think of. As for features...I swear I feel just like that kid in A Christmas Story who gets to Santa and then draws a blank on what he wants for Christmas. One thing I would definitely want is something from the latest update for the other version: Right now on the Control Freak version you can fully arrange the default buttons, and you can arrange the order of the custom buttons and what group they go in, but you can't integrate them in with the default buttons, they still get lumped at the end of a group. I am assuming the above does that? I would definitely want that. Otherwise...Wormopolis has a plugin called Hashtag in Posts, that works by creating a click-able search link with a bit of custom BBcode. You post a word with a hashtag in brackets before it: [#]example and when you click post, it converts briefly to [hash]example then resolves to #example, a click-able search-link for the word "example". I'd like to make a custom button for that. I'm trying to figure out the particulars of the how that would basically work. I would want when you click the button it would pop up a box where you would type the word you wanted to hashtag, and then it would add it to the post with the [#] already in front of it. I know that probably seems too simple to need a button for it, but I find people are far more likely to use a BBCode if there is a button to do 90% of the work for them, and it is also a good and easy way to inform people of what BBCode you have for your site and how it works. Otherwise...not really a feature request, but Wormopolis(again) has a plugin called ColorSmear, that adds a custom BBCode button that I would love to corral and put where I want, but I can't seem to manage to do it. I did that with the insertSoundCloud button just fine, but am at a loss for how to do that with his button. That's all I can think of regarding this plugin, and thank you again for the coming update!
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,024
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Dec 5, 2014 10:06:37 GMT -8
Woo-who! *VIP treatment right here!* Thank you so much! Really, I don't see a substantial difference between the two versions of the plugin as far as the level of complication. I realized as I started to add more customs button and had buttons added by other plugins, that it would be helpful to be able to completely define my own groups, what was in them and arrange them accordingly. Or course, as soon as I installed the "nightly", and saw it was called "Control Freak", I knew I'd made the right choice in plugin. That's what I love to hear, it warms my heart when I see proof that there are still people out there willing to accept and even embrace something beyond a single-click solution. That opens so many more paths to explore solutions that just isn't possible in a dumbed-down interface. No bugs I can think of. As for features...I swear I feel just like that kid in A Christmas Story who gets to Santa and then draws a blank on what he wants for Christmas. One thing I would definitely want is something from the latest update for the other version: Right now on the Control Freak version you can fully arrange the default buttons, and you can arrange the order of the custom buttons and what group they go in, but you can't integrate them in with the default buttons, they still get lumped at the end of a group. I am assuming the above does that? I would definitely want that. Noted! Since the freak version obliterates the system's default buttons and grouping and then rebuilds from scratch this would mean the button being targeted would need to be a button you've allowed to be shown and not just any button from the standard set of default Proboards buttons. Otherwise...Wormopolis has a plugin called Hashtag in Posts, that works by creating a click-able search link with a bit of custom BBcode. You post a word with a hashtag in brackets before it: [#]example and when you click post, it converts briefly to [hash]example then resolves to #example, a click-able search-link for the word "example". I'd like to make a custom button for that. I'm trying to figure out the particulars of the how that would basically work. I would want when you click the button it would pop up a box where you would type the word you wanted to hashtag, and then it would add it to the post with the [#] already in front of it. I know that probably seems too simple to need a button for it, but I find people are far more likely to use a BBCode if there is a button to do 90% of the work for them, and it is also a good and easy way to inform people of what BBCode you have for your site and how it works. What you won't get is a popup asking for a word since this is not an attribute on the tag and since this is a tag without a corresponding ending tag there isn't even the option to add it as content within the tag. A workaround however would be to wrap it in a span tag which then would allow the ability to set content : - tag: span
- image: imgur.com/...
- attributes: pragma_content=
would produce a prompt similar to this Definitely not ideal since the "pragma_content" being shown might be confusing to the user but unlike regular attributes that can be aliased, the pragma_* attributes were never meant to be shown to the user so never got that ability, I'll address that in the next release. By the way, if you're unaware of how aliasing attributes works, basically it allows asking for something more user friendly. For example if your custom button has an attribute of href= it would popup asking for a value for "href:" which might be confusing so that attribute can be aliased by using href(Article URL)= which would then ask the user for "Article URL:". I'm not sure if that feature is even included in the freak version but if it isn't I'll also add that. Wormopolis could also make use of the new API added in the recent version from within his own plugin to accomplish this. $(document).ready(function () { if (window.eton && window.eton.wysiwyg) { var btnData = window.eton.wysiwyg.addButton( 'span', 'http://images.proboards.com/v5/icons/hashtag.png', { title: 'Hashtag', attributes : 'pragma_content=' }); }else{ //plugin not running so do other stuff here } })
* I did discover a small bug when I tried it though, tags with no attributes (i.e pragma_noendtag doesn't appear on the tag but instead used for instructing what to do) get a space before the closing bracket: e.g. "[hash ]" instead of "[hash]". That will be fixed in the next update I've also overlooked the fact that a plugin might want to modify the final tag before it is inserted so I'll define a new "callback" option that allows passing in a function that can be called each time a button is clicked. Currently the caller of the api addButton function gets back an object which contains a buttons property containing a jquery collection of all the buttons added by that call. The caller could then use that to add a click handler and suppress event bubbling but that requires intimate knowledge of the WYSIWYG and as Wormo and I (re)discovered, click events destroy selections in the ancient city of IE. Otherwise...not really a feature request, but Wormopolis(again) has a plugin called ColorSmear, that adds a custom BBCode button that I would love to corral and put where I want, but I can't seem to manage to do it. I did that with the insertSoundCloud button just fine, but am at a loss for how to do that with his button. That's all I can think of regarding this plugin, and thank you again for the coming update! The button created by that plugin is what I call a squatter in my own source code and what that means simply is it doesn't register itself with the WYSIWYG to make the system, and therefore anybody else utilizing the system, aware that the button is available. This is mostly my fault though since I've been dragging my feet regarding releasing an API (which I finally did) that is capable of acting as a go-between for other plugins and the system allowing a simplified process of registering any plugin generated button not just my own. In this particular case however the bbtag invented by that plugin uses an unconventional structure. By that I mean it doesn't have the traditional [tag attribute1="value1" attribute2="value2"][/tag] pattern which can be seen in HTML and markdowns languages such as bbcode based on the SGML pattern. The "system" is setup to use and output that pattern especially since it runs in a browser environment which also adheres to that pattern. The bbcode plugin uses that system to do most of the heavy lifting so it is completely incompatible with the structure of that tag which uses something like (pretty sure this is not accurate) [smear:color1:color2]blah[/smear:more stuff]. In order for that to be compatible it would need to convert to the format [smear color1="value1" color2="value2" other="more stuff"]blah[/smear]
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Dec 5, 2014 10:15:55 GMT -8
The colorsmear button is on my list to fix someday. I had most of it done but couldnt get the selection part to work in all browsers and got frustrated. which led me to move on to a different project. once I had it actualy working I was going to change it to register with WYSIWYG.
I never put in a button for hashtag because I didnt think it really needed one since its just putting [#] in front of a word
|
|
inherit
206056
0
Oct 22, 2024 12:06:59 GMT -8
adminabp
378
February 2014
adminabp
|
Post by adminabp on Dec 5, 2014 23:35:06 GMT -8
Woo-who! *VIP treatment right here!* Thank you so much! Really, I don't see a substantial difference between the two versions of the plugin as far as the level of complication. I realized as I started to add more customs button and had buttons added by other plugins, that it would be helpful to be able to completely define my own groups, what was in them and arrange them accordingly. Or course, as soon as I installed the "nightly", and saw it was called "Control Freak", I knew I'd made the right choice in plugin. That's what I love to hear, it warms my heart when I see proof that there are still people out there willing to accept and even embrace something beyond a single-click solution. That opens so many more paths to explore solutions that just isn't possible in a dumbed-down interface. No bugs I can think of. As for features...I swear I feel just like that kid in A Christmas Story who gets to Santa and then draws a blank on what he wants for Christmas. One thing I would definitely want is something from the latest update for the other version: Right now on the Control Freak version you can fully arrange the default buttons, and you can arrange the order of the custom buttons and what group they go in, but you can't integrate them in with the default buttons, they still get lumped at the end of a group. I am assuming the above does that? I would definitely want that. Noted! Since the freak version obliterates the system's default buttons and grouping and then rebuilds from scratch this would mean the button being targeted would need to be a button you've allowed to be shown and not just any button from the standard set of default Proboards buttons. Otherwise...Wormopolis has a plugin called Hashtag in Posts, that works by creating a click-able search link with a bit of custom BBcode. You post a word with a hashtag in brackets before it: [#]example and when you click post, it converts briefly to [hash]example then resolves to #example, a click-able search-link for the word "example". I'd like to make a custom button for that. I'm trying to figure out the particulars of the how that would basically work. I would want when you click the button it would pop up a box where you would type the word you wanted to hashtag, and then it would add it to the post with the [#] already in front of it. I know that probably seems too simple to need a button for it, but I find people are far more likely to use a BBCode if there is a button to do 90% of the work for them, and it is also a good and easy way to inform people of what BBCode you have for your site and how it works. What you won't get is a popup asking for a word since this is not an attribute on the tag and since this is a tag without a corresponding ending tag there isn't even the option to add it as content within the tag. A workaround however would be to wrap it in a span tag which then would allow the ability to set content : - tag: span
- image: imgur.com/...
- attributes: pragma_content=
would produce a prompt similar to this Definitely not ideal since the "pragma_content" being shown might be confusing to the user but unlike regular attributes that can be aliased, the pragma_* attributes were never meant to be shown to the user so never got that ability, I'll address that in the next release. By the way, if you're unaware of how aliasing attributes works, basically it allows asking for something more user friendly. For example if your custom button has an attribute of href= it would popup asking for a value for "href:" which might be confusing so that attribute can be aliased by using href(Article URL)= which would then ask the user for "Article URL:". I'm not sure if that feature is even included in the freak version but if it isn't I'll also add that. Wormopolis could also make use of the new API added in the recent version from within his own plugin to accomplish this. $(document).ready(function () { if (window.eton && window.eton.wysiwyg) { var btnData = window.eton.wysiwyg.addButton( 'span', 'http://images.proboards.com/v5/icons/hashtag.png', { title: 'Hashtag', attributes : 'pragma_content=' }); }else{ //plugin not running so do other stuff here } })
* I did discover a small bug when I tried it though, tags with no attributes (i.e pragma_noendtag doesn't appear on the tag but instead used for instructing what to do) get a space before the closing bracket: e.g. "[hash ]" instead of "[hash]". That will be fixed in the next update I've also overlooked the fact that a plugin might want to modify the final tag before it is inserted so I'll define a new "callback" option that allows passing in a function that can be called each time a button is clicked. Currently the caller of the api addButton function gets back an object which contains a buttons property containing a jquery collection of all the buttons added by that call. The caller could then use that to add a click handler and suppress event bubbling but that requires intimate knowledge of the WYSIWYG and as Wormo and I (re)discovered, click events destroy selections in the ancient city of IE. Otherwise...not really a feature request, but Wormopolis(again) has a plugin called ColorSmear, that adds a custom BBCode button that I would love to corral and put where I want, but I can't seem to manage to do it. I did that with the insertSoundCloud button just fine, but am at a loss for how to do that with his button. That's all I can think of regarding this plugin, and thank you again for the coming update! The button created by that plugin is what I call a squatter in my own source code and what that means simply is it doesn't register itself with the WYSIWYG to make the system, and therefore anybody else utilizing the system, aware that the button is available. This is mostly my fault though since I've been dragging my feet regarding releasing an API (which I finally did) that is capable of acting as a go-between for other plugins and the system allowing a simplified process of registering any plugin generated button not just my own. In this particular case however the bbtag invented by that plugin uses an unconventional structure. By that I mean it doesn't have the traditional [tag attribute1="value1" attribute2="value2"][/tag] pattern which can be seen in HTML and markdowns languages such as bbcode based on the SGML pattern. The "system" is setup to use and output that pattern especially since it runs in a browser environment which also adheres to that pattern. The bbcode plugin uses that system to do most of the heavy lifting so it is completely incompatible with the structure of that tag which uses something like (pretty sure this is not accurate) [smear:color1:color2]blah[/smear:more stuff]. In order for that to be compatible it would need to convert to the format [smear color1="value1" color2="value2" other="more stuff"]blah[/smear]Wow, this feels like Christmas...Thank you for all of that! Yeah, I figure if I don't understand something, I'll just learn. When I created my forum here back in February of this year the only HTML I knew was a little text formating, new nothing at all of CSS and JavaScript scared me too much to even want to touch it. In the past month I've written CSS on the fly and reworked someone else's script to work better and more suit my own needs. I actually got up the nerve to edit the build of one of your plugins to tweak a few things(thanks for being one of the coders that leaves their plugins editable like that, btw) Do I completely know everything I am doing? No, I end up skipping over learning basic stuff to learn more complex things I need to know to solve a particular problem or pull something cool off, but I am gradually filling in those gaps and learning more every day! I just wanted a cool place to chat with some friends, I didn't realize being an admin on a forum was going to be such a learning experience for me. Thanks again, Brian. The colorsmear button is on my list to fix someday. I had most of it done but couldnt get the selection part to work in all browsers and got frustrated. which led me to move on to a different project. once I had it actualy working I was going to change it to register with WYSIWYG. I never put in a button for hashtag because I didnt think it really needed one since its just putting [#] in front of a word I agree hashag doesn't need a button, but I've noticed people are far more likely to use a BBCode when it has a button for it than not, regardless of how simple it is. Part of it is probably just a comfort-level thing. The presence of a BBCode button for something also serves the multi-purpose of helping make people aware the feature exists, reminding them it's there for their use, and demonstrates how to use it; all without having to have a permanent announcement or have a lot of instructions typed out in the reply section. Loving using hashtags on my forum, by the way, a very cool plugin!
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,024
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Dec 6, 2014 2:01:48 GMT -8
No bugs I can think of. As for features...I swear I feel just like that kid in A Christmas Story who gets to Santa and then draws a blank on what he wants for Christmas. One thing I would definitely want is something from the latest update for the other version: Right now on the Control Freak version you can fully arrange the default buttons, and you can arrange the order of the custom buttons and what group they go in, but you can't integrate them in with the default buttons, they still get lumped at the end of a group. I am assuming the above does that? I would definitely want that. Noted! Since the freak version obliterates the system's default buttons and grouping and then rebuilds from scratch this would mean the button being targeted would need to be a button you've allowed to be shown and not just any button from the standard set of default Proboards buttons. Hmmm, I just checked since Freak already has its own mechanism for ordering buttons (the sequence field) which is more versatile than what the basic version has and it does indeed govern the order of all buttons, including custom buttons, added to the group. If you've linked a custom button to a group by placing the name of that control group into the index field of the custom button then simply add the name you gave to that custom button back to the sequence field of the group to which you've linked it along with the names of any other standard or custom buttons whose ordering you wish to dictate. If you list a few buttons in that sequence field but not all of the buttons then keep in mind that buttons that are not explicitly listed will appear at the end of the group after those that were listed. If that is not working for you as advertised then that would be a bug that needs to be investigated further. In this image the "color" in the sequence field refers to the name of a custom button that was added to that group. Additionally since only two buttons are listed in the sequence field then only those buttons will be ordered and the rest will be "lumped in" at whatever order they happen to be.
|
|
inherit
206056
0
Oct 22, 2024 12:06:59 GMT -8
adminabp
378
February 2014
adminabp
|
Post by adminabp on Dec 6, 2014 9:00:27 GMT -8
No bugs I can think of. As for features...I swear I feel just like that kid in A Christmas Story who gets to Santa and then draws a blank on what he wants for Christmas. One thing I would definitely want is something from the latest update for the other version: Right now on the Control Freak version you can fully arrange the default buttons, and you can arrange the order of the custom buttons and what group they go in, but you can't integrate them in with the default buttons, they still get lumped at the end of a group. I am assuming the above does that? I would definitely want that. Noted! Since the freak version obliterates the system's default buttons and grouping and then rebuilds from scratch this would mean the button being targeted would need to be a button you've allowed to be shown and not just any button from the standard set of default Proboards buttons. Hmmm, I just checked since Freak already has its own mechanism for ordering buttons (the sequence field) which is more versatile than what the basic version has and it does indeed govern the order of all buttons, including custom buttons, added to the group. If you've linked a custom button to a group by placing the name of that control group into the index field of the custom button then simply add the name you gave to that custom button back to the sequence field of the group to which you've linked it along with the names of any other standard or custom buttons whose ordering you wish to dictate. If you list a few buttons in that sequence field but not all of the buttons then keep in mind that buttons that are not explicitly listed will appear at the end of the group after those that were listed. If that is not working for you as advertised then that would be a bug that needs to be investigated further. In this image the "color" in the sequence field refers to the name of a custom button that was added to that group. Additionally since only two buttons are listed in the sequence field then only those buttons will be ordered and the rest will be "lumped in" at whatever order they happen to be. Hmm. This might just be a communication issue. Here and in the plugin itself you say to put the name of the button in the sequence list. I just put the name in the same as I had before to no effect, so on impulse I just tried something different, the tag itself, and that worked. Example: for the Highlight button you have automatically included; putting the name of the button, Highlight, in the list does nothing, but if I put the tag span in the list, it works perfectly. Maybe tweak the instructions for the sequence in the plugin? Unless you intended for it to sort by name and not tag, then you have a bug.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,024
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Dec 6, 2014 9:22:49 GMT -8
Tag isn't really specific enough, one could have 20 custom buttons all using the span tag but with different attributes for different effects. Name on the other hand should be unique for each button, if you indeed gave the custom button a name then entered that name in the sequence field (with matching capitalizations: e.g. "Highlight" instead of "highlight") and that had no effect then that is indeed a bug although I am unable to replicate that since I was able to move a custom button up and down in the order simply by moving the position of its name (not tag) in the sequence field.
I believe I may have coded in a fallback to (first encountered) tag if no button with that name was found but not 100% sure.
|
|
inherit
206056
0
Oct 22, 2024 12:06:59 GMT -8
adminabp
378
February 2014
adminabp
|
Post by adminabp on Dec 6, 2014 9:37:09 GMT -8
Tag isn't really specific enough, one could have 20 custom buttons all using the span tag but with different attributes for different effects. Name on the other hand should be unique for each button, if you indeed gave the custom button a name then entered that name in the sequence field (with matching capitalizations: e.g. "Highlight" instead of "highlight") and that had no effect then that is indeed a bug although I am unable to replicate that since I was able to move a custom button up and down in the order simply by moving the position of its name (not tag) in the sequence field. I believe I may have coded in a fallback to (first encountered) tag if no button with that name was found but not 100% sure. It's a bug then. Highlight with matching capitalization does nothing, while span works. Likewise Blockquote with matching capitalization both places does nothing, but blockquote which matches the tag works.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,024
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Dec 7, 2014 7:39:54 GMT -8
Tag isn't really specific enough, one could have 20 custom buttons all using the span tag but with different attributes for different effects. Name on the other hand should be unique for each button, if you indeed gave the custom button a name then entered that name in the sequence field (with matching capitalizations: e.g. "Highlight" instead of "highlight") and that had no effect then that is indeed a bug although I am unable to replicate that since I was able to move a custom button up and down in the order simply by moving the position of its name (not tag) in the sequence field. I believe I may have coded in a fallback to (first encountered) tag if no button with that name was found but not 100% sure. It's a bug then. Highlight with matching capitalization does nothing, while span works. Likewise Blockquote with matching capitalization both places does nothing, but blockquote which matches the tag works. OK adminabp, I was able to reproduce the bug using the above examples and identified the bug's hiding place and even discovered another potential bug during that search. I've also come to the conclusion that it's about time the code gets a rebuild from the ground up since it has turned into spaghetti with all the additions and subtractions over the years that even I was having trouble following. It'll probably be 2 to 4 days before I will have anytime to revisit this so bear with me until I can get that done. I appreciate you taking the time to get the ball rolling again so thanks for that as well.
|
|
inherit
206056
0
Oct 22, 2024 12:06:59 GMT -8
adminabp
378
February 2014
adminabp
|
Post by adminabp on Dec 8, 2014 6:22:32 GMT -8
It's a bug then. Highlight with matching capitalization does nothing, while span works. Likewise Blockquote with matching capitalization both places does nothing, but blockquote which matches the tag works. OK adminabp, I was able to reproduce the bug using the above examples and identified the bug's hiding place and even discovered another potential bug during that search. I've also come to the conclusion that it's about time the code gets a rebuild from the ground up since it has turned into spaghetti with all the additions and subtractions over the years that even I was having trouble following. It'll probably be 2 to 4 days before I will have anytime to revisit this so bear with me until I can get that done. I appreciate you taking the time to get the ball rolling again so thanks for that as well. No worries. I'm just glad you found the problem, and another potential one besides. Congrats on the successful bug hunt! The only thing not currently working to an acceptable capacity is the Twitter embed, and if need be I can simply put the code somewhere for people to copy/paste until the rebuild is done, so don't feel pressured to rush on my account. And thank you again for doing this.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,024
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Dec 10, 2014 14:59:25 GMT -8
I'll first post the update to the basic version which is now set to version 0.9.4 . An update to the advanced version bringing it back in alignment with the added features of the basic version is coming as well but requires some refactoring due to the lack of regular maintenance afforded the basic version. This update deals almost exclusively with the newly added API which allows other plugins to detect if the UBBC Buttons plugin is installed and use it to create a custom button. The advantages of course being the user then gets some control over that button depending on which version of the UBBC plugin they have installed and the API consumer also gets access to some of those features as well. This update comes with the following changes: - added "create", "addtag" and "insert" callbacks for API consumers
- added feature detect so API consumers are able to distinguish between differing plugin versions going forward without having to know the intimate details of which feature is supported by a particular version and resorting to plugin version sniffing
The following is an example of the features supported and how they are exposed through the hasFeature API method now included for an API consumer to use for feature detection and hopefully degrade gracefully perhaps informing the forum staff that they should upgrade their plugin version
var features = { "title" : true, //allows users to see the specified text in a tooltip when hovering over the button "index" : true, //chooses into which group of buttons to drop this new button "groups" : true, //allows limiting this button to be seen only by groups listed in the array (numeric group id expected in the array) "boards" : true, //allows limiting this button to be seen only in boards listed in the array (numeric board id expected in the array) "id" : true, //allows your button to target a specific button to increase placement precision (before or after). This overrides index and uses it to determine placement: 1 == after and -1 == before "attributes" : true, //allows adding attributes to your tag with the option to prompt the user for values to fill those attributes if any values for those attributes are left blank "editor" : true, //specifies to which editor(s) this button will attach (left undefined and all editors are assumed) "create" : true, //specifies a callback function that will receive a parameter that references the created button. "addtag" : true, //specifies a function to replace the default function provided by the plugin to add tags to the editor(s) "insert" : true, //specifies a function that gets called before a tag is inserted allowing modifications to the final attributes which is passed as a hash map param "pragma_noendtag" : true, //allows a bbcode tag to have no closing tag "pragma_content" : true, //specifies text (including additional bbcode) to place inside this tag "protocol_relative" : true, //button image urls no longer need the "http:" or "https:" part to be considered valid image urls (to avoid mixed content secuity warnings) "attributes_alias" : true //allows providing alternate text to show instead of the attribute name in a prompt by placing the desired text in parentheses immediately following the attribute name. }
window.eton.wysiwyg = { addButton : function(tag,image,opts){ return addButton.call(wysiwyg_this, tag, image, opts); }, hasFeature : function (feature_name){ //feature_name can be a string or an array of strings if checking multiple features if("string" == typeof feature_name){ feature_name = $.trim(feature_name); if(/\s/.test(feature_name)){ //a space separated list of features to check feature_name = feature_name.split(/\s+/); }else{ feature_name = [feature_name]; } }else if (!$.isArray(feature_name)){ return false; } var available = []; $.each(feature_name, function(i,e){ available.push(features[$.trim(''+e)] === true ? "1" : "0"); }) /* one feature failing causes all to fail */ return !/0/.test(available.join("")) }, "plugin": { "version" : "0.9.4", "name" : "Quick Reply BBcode Buttons", "name_internal" : "Proboards V5 Controls Manager (Basic Version)", "id" : "eton_quick_reply_bbbutton" } }
$(document).ready(function () { if (window.eton && eton.wysiwyg && eton.wysiwyg.hasFeature("pragma_content attributes_alias title attributes create insert")) { //make sure features we need are supported var btnData = eton.wysiwyg.addButton( 'span', '//imgur.proboards.com/v5/icons/hashtag.png', { title: 'Insert Hashtag', attributes : 'pragma_content(Enter an hashtag)=', create: function(opts){ console.log('My button(s) has an id of %o and here they are! : %o', opts.button_id, opts.buttons) }, insert: function(bbcode){ if(!/^#/.test(bbcode.attrs.pragma_content)){ bbcode.attrs.pragma_content = "#" + bbcode.attrs.pragma_content; } console.log('An hashtag of %o is about to be inserted into the editor', bbcode.attrs.pragma_content); } }); }else{ //plugin not running or is older version lacking support for needed options so do other stuff here } })
since the addButton method can be called before or after the WYSIWYG has finished creating all its buttons this callback format allows for that event to first occur. Code in that callback function is therefore guaranteed that the WYSIWYG or an approximation of the WYSIWYG (such as the simple editor created by this plugin on quick reply) is fully loaded. Think of this as being analogous to the $(document).ready() call employed in jQuery but for WYSIWYG readiness. The return value from the addButton call can either be false (something wasn't right), true (button is waiting to be created[added v0.9.5]) or a string id of the created button.
In each of these callbacks the this JavaScript keyword will be a reference to the WYSIWYG api object populated with all the properties and methods for that API. Two [bugfix] that will be of concern to all users have to do with...
- attribute aliases (see this post): a missing index on an array look-up caused this feature to stop working and has been restored to its former glory. - The other has to do with titles set on a button being ignored and the name or tag being used instead, full lordship status has been restored so these buttons can once again be addressed with their proper title and given the respect to which they have grown accustomed. (my best impression of one of those enjoyable Tim Camara bug fix updates) Update: adminabp, I've somehow managed to allow a version of the Control Freak that addresses the "tag instead of name" bug along with added support for the pragma_* attributes to escape the coding pen. I might lose my job over this so keep it on the hush-hush, but if it comes to that then oh well, C'est la vie. I'm still in the process of rejiggering the code so it is easier to understand thus maintain but for the points we visited previously in this thread I wanted to release something that you could use. See the "nightly" download link at the bottom of the first post in this thread to get the newest release
|
|