WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #19910, comment 11


Ignore:
Timestamp:
02/26/2012 08:00:56 PM (8 years ago)
Author:
nacin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #19910, comment 11

    initial v1  
    66> This code can't run on the front-end, wouldn't it be better to be in wp-admin, not in wp-content.
    77
    8 Yes it can. And in fact, it does, due to how the preview iframe works. There is no actual harm to placing JS in wp-includes over wp-admin. The rule of thumb I have used is that if it is a library of sorts, or decoupled nicely to the admin, or something that could be employed on the frontend (like pointers), it should go into wp-includes. The only things that should go into wp-admin is code intrinsically tied to the admin interface.
     8Yes it can. And in fact, it does, due to how the preview iframe works. There is no actual harm to placing JS in wp-includes over wp-admin. The rule of thumb I have used is that if it is a library of sorts, or decoupled nicely from the admin, or something that could be employed on the frontend (like pointers), it should go into wp-includes. The only things that should go into wp-admin is code intrinsically tied to the admin interface.
    99
    1010> Why do we need another JS framework on top of jQuery to handle this? It only makes the code harder to read/understand, brings a lot of complexity and a lot of unneeded features (for example how many instances of the classes and subclasses would we need to show a preview?).