Make WordPress Core

Changes between Version 2 and Version 3 of Ticket #31701, comment 14


Ignore:
Timestamp:
03/23/2015 03:46:43 AM (10 years ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31701, comment 14

    v2 v3  
    22- Maybe we can use only one "settings" filter. No need to filter each setting separately (`emoji_url`, `emoji_ext`, etc.). Combine them in an array and pass it through one?
    33- Sometimes widow.load fires much later than expected. Can take up to 5-10 sec. etc. Usually caused by a slow loading image or script. Would it be better to run the emoji JS on DOM ready? Seems that `DOMContentLoaded` is supported in all browsers that also support addEventListener, i.e. all except IE8 and older: http://caniuse.com/#feat=domcontentloaded, https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded.
    4 - If the wp-emoji and twemoji scripts are concatenated together (which is a good idea), we won't need to wait for loading. In theory we can load late in the footer and run as soon as the file is loaded. In practice we can set a var from in wp-emoji-loader.js on DOM ready, then when wp-emoji.js loads, we can check that var and either bind to DOMContentLoaded or window.load, or run if that has already fired.
     4- If the wp-emoji and twemoji scripts are concatenated together (which is a good idea), we won't need to wait for loading. In theory we can load late in the footer and run as soon as the file is loaded. In practice we can set a var in wp-emoji-loader.js on DOM ready, then when wp-emoji.js loads, we can check that var and either bind to DOMContentLoaded or window.load, or run if that has already fired.
    55- May be missing something but looks like `waitForTwemoji()` inserts another script node every 50ms while waiting.