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

WordPress Trac noreply at wordpress.org
Mon Feb 18 02:35:22 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 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:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list