[wp-trac] [WordPress Trac] #23497: Revisions Rewrite using JS/Backbone

WordPress Trac noreply at wordpress.org
Mon Feb 18 02:45:57 UTC 2013


#23497: Revisions Rewrite using JS/Backbone
-------------------------------------------------+-------------------------
 Reporter:  adamsilverstein                      |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Revisions                            |  Review
 Severity:  normal                               |     Version:  3.5.1
 Keywords:  has-patch needs-refresh dev-         |  Resolution:
  feedback                                       |
-------------------------------------------------+-------------------------

Comment (by adamsilverstein):

 thanks, i'll integrate that - i'm new to backbone and templates have only
 tested in firefox so far (like i said its a proof-of-concept); also
 noticed two issues, there is no 'cancel' button and the current version is
 not shown. maybe just need a button 'Cancel Restore keep Current Version'


 Replying to [comment:1 wonderboymusic]:
 > Dang. Looks cool.
 >
 > If you are going to use Backbone templates, you need to not use ASP-
 style tags, which are allowed by PHP config, which is lame. Koop set up a
 template function for media but didn't expose it globally, so you need to
 do something like:
 >
 > {{{
 > template = _.memoize(function (id) {
 >       var compiled, options = {
 >               evaluate : /<#([\s\S]+?)#>/g,
 >               interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
 >               escape: /\{\{([^\}]+?)\}\}(?!\})/g,
 >               variable: 'data'
 >       };
 >
 >       return function (data) {
 >               compiled = compiled || _.template($('#tmpl-' + id).html(),
 null, options);
 >               return compiled(data);
 >       };
 > });
 > }}}
 >
 > I think the script tags also have to be set to text/html for some weird
 IE reason.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23497#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list