[wp-hackers] WP Ideas: API for adding simple buttons to TinyMCE

Enej Bajgoirc enej.bajgoric at gmail.com
Fri Mar 19 23:56:12 UTC 2010


I really like this idea as well. I think one way to approach it would be to extend the shortcode_api in a way that would make it easy for developers to add a the TinyMCE buttons right there, as well as have a place to have Shortcode documentation. 

Just an idea...

Enej


On 2010-03-19, at 4:47 PM, wp-hackers-request at lists.automattic.com wrote:

> Send wp-hackers mailing list submissions to
> 	wp-hackers at lists.automattic.com
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://lists.automattic.com/mailman/listinfo/wp-hackers
> or, via email, send a message with subject or body 'help' to
> 	wp-hackers-request at lists.automattic.com
> 
> You can reach the person managing the list at
> 	wp-hackers-owner at lists.automattic.com
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of wp-hackers digest..."
> 
> 
> Today's Topics:
> 
>   1. Re: Closing Mysql connections (Andrew Gray)
>   2. Re: GSoc -Proposal (scribu)
>   3. WP Ideas: API for adding simple buttons to TinyMCE (Jeremy Clarke)
>   4. Re: WP Ideas: API for adding simple buttons to TinyMCE (Otto)
>   5. GSoc - here we go ! (Perro Hunter)
>   6. Re: GSoc -Proposal (Alex Hempton-Smith)
>   7. Re: WP Ideas: API for adding simple buttons to TinyMCE
>      (Mike Schinkel)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Fri, 19 Mar 2010 11:19:37 -0400
> From: Andrew Gray <andrew at graymerica.com>
> Subject: Re: [wp-hackers] Closing Mysql connections
> To: wp-hackers at lists.automattic.com
> Message-ID: <236FA028-0FE7-4DE4-B924-ED03A206AD02 at graymerica.com>
> Content-Type: text/plain; charset=us-ascii
> 
> thanks,
> 
> that is perfect.
> On Mar 19, 2010, at 10:33 AM, Otto wrote:
> 
>> On Fri, Mar 19, 2010 at 7:57 AM, Dion Hulse (dd32) <wordpress at dd32.id.au> wrote:
>>> The reason for this is quite simple. WordPress uses the database throughout
>>> the execution of the script, It's needed until shutdown as you'd expect.
>> 
>> Yes. As it says here: http://php.net/mysql_close
>> 
>> "Using mysql_close() isn't usually necessary, as non-persistent open
>> links are automatically closed at the end of the script's execution.
>> See also freeing resources."
>> 
>> Now, that being said, I have seen odd setups freak out on this before,
>> but those setups are rare. If you're really paranoid about this sort
>> of thing:
>> 
>> add_action('shutdown_action_hook','close_up_shop');
>> function close_up_shop() {
>> @mysql_close();
>> }
>> 
>> You can try it and see if you see a difference. I doubt that there will be any.
>> 
>> -Otto
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Fri, 19 Mar 2010 17:44:28 +0200
> From: scribu <scribu at gmail.com>
> Subject: Re: [wp-hackers] GSoc -Proposal
> To: wp-hackers at lists.automattic.com
> Message-ID:
> 	<349fe48b1003190844ica6c907q9e213a2677e26dbf at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
> 
> Well, first of all, you'll have to choose one of them in that list and come
> up with a concrete idea to implement. Having that, we can give you feedback.
> 
> 
> -- 
> http://scribu.net
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Fri, 19 Mar 2010 13:01:23 -0400
> From: Jeremy Clarke <jer at simianuprising.com>
> Subject: [wp-hackers] WP Ideas: API for adding simple buttons to
> 	TinyMCE
> To: wp-hackers at lists.automattic.com
> Message-ID:
> 	<e1202cb11003191001k6b00799fq6307196cbcb954e at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Basic idea: Add a wrapper function to WP that can be called in a
> theme's functions.php (or a plugin) to add simple buttons to the
> Visual Editor. Things like <p class="translation">  or <p
> class="update"> that correspond with classes in the theme CSS. There
> are a lot of times when a button just needs to wrap a tag around a bit
> of text and it seems to me a general function that sets the before and
> after text (i.e. <p class="..."> and </p>) would be useful to almost
> every site with carefully considered CSS styles for posts.
> 
> It's possible to add buttons like this to TinyMCE yourself manually in
> a plugin but its really, really complicated. Last time I checked it
> involved creating several files and basically becoming skilled at the
> TinyMCE API, something most theme/plugin devs would obviously rather
> avoid. For this reason I think it would make sense for WP to have a
> built-in way of adding simple buttons with only PHP. I am no good at
> javascript so I won't be the one to add it but someone out there who
> knows how to add buttons already could probably do it relatively
> easily.
> 
> I posted about this on the Ideas Forum about a year ago:
> http://wordpress.org/extend/ideas/topic/create-easy-api-for-adding-simple-html-tag-buttons-to-tinymce
> 
> Jane is cleaning out the ideas and will delete this one unless it gets
> some more traction so if you think its a good idea please go vote or
> leave a comment about it. I suppose if it gets enough votes in the
> next little while I'll create a Trac ticket out of it and we can deal
> with it in that format instead, otherwise we can delete it from ideas
> and let it fade into the annals of features that time forgot.
> 
> -- 
> Jeremy Clarke | http://jeremyclarke.org
> Code and Design | http://globalvoicesonline.org
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Fri, 19 Mar 2010 13:09:38 -0500
> From: Otto <otto at ottodestruct.com>
> Subject: Re: [wp-hackers] WP Ideas: API for adding simple buttons to
> 	TinyMCE
> To: wp-hackers at lists.automattic.com
> Message-ID:
> 	<161617691003191109m456e9c70vc0cfb5960c168b17 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> If you don't want to go the full tinyMCE plugin route, you could use
> the "setup" trick to add simple button code:
> http://tinymce.moxiecode.com/examples/example_20.php
> 
> To do this in a WP plugin, you'd hook to mce_buttons_2 (or 3, or 4) to
> add your button to the list. Then you'd hook up a filter on
> tiny_mce_before_init to add your javascript code to the
> $initArray['setup']. That should be pretty much that, really.
> 
> 
> -Otto
> 
> 
> 
> On Fri, Mar 19, 2010 at 12:01 PM, Jeremy Clarke <jer at simianuprising.com> wrote:
>> Basic idea: Add a wrapper function to WP that can be called in a
>> theme's functions.php (or a plugin) to add simple buttons to the
>> Visual Editor. Things like <p class="translation"> ?or <p
>> class="update"> that correspond with classes in the theme CSS. There
>> are a lot of times when a button just needs to wrap a tag around a bit
>> of text and it seems to me a general function that sets the before and
>> after text (i.e. <p class="..."> and </p>) would be useful to almost
>> every site with carefully considered CSS styles for posts.
>> 
>> It's possible to add buttons like this to TinyMCE yourself manually in
>> a plugin but its really, really complicated. Last time I checked it
>> involved creating several files and basically becoming skilled at the
>> TinyMCE API, something most theme/plugin devs would obviously rather
>> avoid. For this reason I think it would make sense for WP to have a
>> built-in way of adding simple buttons with only PHP. I am no good at
>> javascript so I won't be the one to add it but someone out there who
>> knows how to add buttons already could probably do it relatively
>> easily.
>> 
>> I posted about this on the Ideas Forum about a year ago:
>> http://wordpress.org/extend/ideas/topic/create-easy-api-for-adding-simple-html-tag-buttons-to-tinymce
>> 
>> Jane is cleaning out the ideas and will delete this one unless it gets
>> some more traction so if you think its a good idea please go vote or
>> leave a comment about it. I suppose if it gets enough votes in the
>> next little while I'll create a Trac ticket out of it and we can deal
>> with it in that format instead, otherwise we can delete it from ideas
>> and let it fade into the annals of features that time forgot.
>> 
>> --
>> Jeremy Clarke | http://jeremyclarke.org
>> Code and Design | http://globalvoicesonline.org
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>> 
> 
> 
> ------------------------------
> 
> Message: 5
> Date: Fri, 19 Mar 2010 13:03:07 -0600
> From: Perro Hunter <perro.hunter at gmail.com>
> Subject: [wp-hackers] GSoc - here we go !
> To: wp-hackers-request at lists.automattic.com
> Message-ID: <90E4EF88-6C9B-46E3-B75E-2D693A04D54D at gmail.com>
> Content-Type: text/plain; charset=us-ascii
> 
> Hey there everyone !
> 
> I'm a computer science engineer student from Mexico 
> and this is the first year I'll try out for GSoc
> 
> I'm really exited on getting a chance to contribute 
> with wordpress since it's a really popular piece of software :) 
> 
> I think i've got some ideas to develop some of the ideas
> that you proposed this year and I'd love to hear some feedback from
> you. While reading them the first 2 that got my attention were the
> Blog Import/Export feature and the Moving Wordpress feature since
> I've already had to move a wordpress installation before and I know it
> was sorta uncomfortable, from those experience I think I can start
> something, let me know what you think :)
> 
> Blog Import/Export idea:
> 
> The thing here is that we not only need to move a huge number of post
> we also need to move comments, pages, tags, categories and links current
> import/export feature would give you a dump of XML that you can take to a 
> new wordpress installation and upload it yourself. This sometimes is nasty if 
> the xml dump is huge, also this dump doesn't help you export/import the media
> those post are using which is a problem since most of the users don't know how
> to deal with FTPs and they should't have to deal with downloading everything to
> their PC's and uploading it to the new server.
> 
> For this I propose a Plugin that would be needed to be installed on both wordpress
> , I'm not sure yet wheter we should attack the next problem from the original
> installation or from the target installation.
> 
> If we were doing this from the source installation we'd need to first make sure
> the plugin is ON on the target installation, we would use the admin user and password
> to authenticate remotely.
> 
> I know we have to move a great number of post-objects (posts,comments,categories,etc)
> for this one we are going to create a queue of things that are going to be exported, this
> could latter allow users to personalize what are the elements that they'd like to move only, then
> we'd run a quick scan on each of the queued elements to see the media they are using
> and queue those file on the table too, I'm using this queue table first so when we start
> moving the elements and files from one installation to another if the script timeouts we can
> restart the process and take off where it stopped last time ;)
> 
> Once the queue is ready to go, we even got a way to calculate percentage ( 1/3000 elements to move = 0.03%)
> we'd start calling the move method, on the user interface we could have an ajax call
> that refresh the status of the script every X seconds or minutes, it could get a new percentage
> number to display and even reactive the moving script if it already timed out. Every time
> an element was successfully moved it'd be mark as it on the queue, we could move
> a large number of post-objects (posts,comments) using curl from one server to another,
> I know server to server bandwidth is way better than home-bandwidth, on the target
> installation the plugin would be receiving all the elements and inserting them in to the db
> with their proper category, tags and everything.
> 
> We could use the same procedure when moving medie if the max post value of the target
> server allow us to send these files via post, or we could use FTP so after moving successfully
> a file we'd notify the target installation plugin about the new file so i can work is the way it want's
> (we'd FTP to a tmp folder)
> 
> For small blogs this process could take less than a minute, for huge blogs it could take a couple
> of hours I don't know we'd need to benchmark this a little, but I think this is the best way to
> Import/export wordpress without having to get your hands dirty :P
> 
> this could also be extended to be compatible with old versions of WP
> 
> What do you think?
> 
> Now, this very same algorithm could be used for the next idea:
> 
> Moving a Wordpress installation from one domain to another:
> 
> For this one we would definitively need FTP to move the basic installation, the target server DB name, user and password, and after moving the essentials of the installation we could start doing the rest with the old procedure(queue items, start cleaning the items periodically)
> 
> Two features could be archived with this same idea, please tell me if you think there's something missing
> or your thoughts
> 
> Cheers ! :D 
> 
> P.S. I also posted this to http://blog.perrohunter.com/ideas-for-wp-at-gsoc/ :)
> 
> -perrohunter
> 
> ------------------------------
> 
> Message: 6
> Date: Fri, 19 Mar 2010 23:41:45 +0000
> From: Alex Hempton-Smith <hempsworth at googlemail.com>
> Subject: Re: [wp-hackers] GSoc -Proposal
> To: wp-hackers at lists.automattic.com
> Message-ID:
> 	<5a1dad881003191641s79e778a5y68a38c9cd6d0a4c0 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Perhaps you could elaborate on what each of those proposals would
> include? Then we could help recommend which one has more mileage.
> 
> -- Alex (Hempsworth)
> 
> On Friday, March 19, 2010, Neerav Mehta <coolneerav4u at gmail.com> wrote:
>> Hello,
>> ? ?I am Neerav UG student from India, I want to work for wordpress in Gsoc
>> this year.
>> I am having some ideas & wish to implement them like:
>> 1. Advance User Menu.
>> 2. Custom user templates.
>> 3. Organising themes in better way.
>> 3. Using Back-end templates.
>> 
>> I am wishing to implement some of these ideas ...
>> Will someone help me where to start...
>> --
>> Neerav Mehta
>> B-Tech Part IV
>> Electronics Engg.
>> I.T. BHU
>> Varanasi
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>> 
> 
> -- 
> -- Alex  (Hempsworth)
> 
> 
> ------------------------------
> 
> Message: 7
> Date: Fri, 19 Mar 2010 17:51:48 -0400
> From: Mike Schinkel <mikeschinkel at newclarity.net>
> Subject: Re: [wp-hackers] WP Ideas: API for adding simple buttons to
> 	TinyMCE
> To: wp-hackers at lists.automattic.com
> Message-ID: <3D29E345-5F58-4CCD-8024-608800431971 at newclarity.net>
> Content-Type: text/plain; charset=us-ascii
> 
> Literally 30 seconds before I read your email I was thinking about how I needed to add a editor button but how I was loathe to have to figure out how. So yes, very interested.
> 
> -Mike
> 
> On Mar 19, 2010, at 1:01 PM, Jeremy Clarke wrote:
> 
>> Basic idea: Add a wrapper function to WP that can be called in a
>> theme's functions.php (or a plugin) to add simple buttons to the
>> Visual Editor. Things like <p class="translation">  or <p
>> class="update"> that correspond with classes in the theme CSS. There
>> are a lot of times when a button just needs to wrap a tag around a bit
>> of text and it seems to me a general function that sets the before and
>> after text (i.e. <p class="..."> and </p>) would be useful to almost
>> every site with carefully considered CSS styles for posts.
>> 
>> It's possible to add buttons like this to TinyMCE yourself manually in
>> a plugin but its really, really complicated. Last time I checked it
>> involved creating several files and basically becoming skilled at the
>> TinyMCE API, something most theme/plugin devs would obviously rather
>> avoid. For this reason I think it would make sense for WP to have a
>> built-in way of adding simple buttons with only PHP. I am no good at
>> javascript so I won't be the one to add it but someone out there who
>> knows how to add buttons already could probably do it relatively
>> easily.
>> 
>> I posted about this on the Ideas Forum about a year ago:
>> http://wordpress.org/extend/ideas/topic/create-easy-api-for-adding-simple-html-tag-buttons-to-tinymce
>> 
>> Jane is cleaning out the ideas and will delete this one unless it gets
>> some more traction so if you think its a good idea please go vote or
>> leave a comment about it. I suppose if it gets enough votes in the
>> next little while I'll create a Trac ticket out of it and we can deal
>> with it in that format instead, otherwise we can delete it from ideas
>> and let it fade into the annals of features that time forgot.
>> 
>> -- 
>> Jeremy Clarke | http://jeremyclarke.org
>> Code and Design | http://globalvoicesonline.org
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 
> 
> End of wp-hackers Digest, Vol 62, Issue 59
> ******************************************



More information about the wp-hackers mailing list