PluginProbe
Comments Extra Fields For Post,Pages and CPT / 4.4
Comments Extra Fields For Post,Pages and CPT v4.4
trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 2.2 2.3 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 5.0 5.1 5.2
wp-comment-fields / js / admin / pre-load.js

pre-load.js in Comments Extra Fields For Post,Pages and CPT 4.4, at js/admin/pre-load.js

37 lines 997 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /* Image loader */
2 function addListener(element, type, expression, bubbling) {
3 bubbling = bubbling || false;
4 if (window.addEventListener) { // Standard
5 element.addEventListener(type, expression, bubbling);
6 return true;
7 } else if (window.attachEvent) { // IE
8 element.attachEvent('on' + type, expression);
9 return true;
10 } else return false;
11 }
12
13
14 var ImageLoader = function (url) {
15 this.url = url;
16 this.image = null;
17 this.loadEvent = null;
18 };
19
20 ImageLoader.prototype = {
21 load: function () {
22 this.image = document.createElement('img');
23 var url = this.url;
24 var image = this.image;
25 var loadEvent = this.loadEvent;
26 addListener(this.image, 'load', function (e) {
27 if (loadEvent != null) {
28 loadEvent(url, image);
29 }
30 }, false);
31 this.image.src = this.url;
32 },
33 getImage: function () {
34 return this.image;
35 }
36 };
37 /* End of image loader */