PluginProbe ʕ •ᴥ•ʔ
YITH WooCommerce Wishlist / 3.18.0
YITH WooCommerce Wishlist v3.18.0
4.16.0 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.10 2.2.11 2.2.12 2.2.13 2.2.14 2.2.15 2.2.16 2.2.17 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 3.0.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.17 3.0.18 3.0.19 3.0.2 3.0.20 3.0.21 3.0.22 3.0.23 3.0.25 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.10.0 3.11.0 3.12.0 3.13.0 3.14.0 3.15.0 3.16.0 3.17.0 3.18.0 3.19.0 3.2.0 3.20.0 3.21.0 3.22.0 3.23.0 3.24.0 3.25.0 3.26.0 3.27.0 3.28.0 3.29.0 3.3.0 3.30.0 3.31.0 3.32.0 3.33.0 3.34.0 3.35.0 3.36.0 3.37.0 3.38.0 3.4.0 3.5.0 3.6.0 3.7.0 3.8.0 3.9.0 4.0.0 4.0.1 4.1.0 4.10.0 4.10.1 4.10.2 4.11.0 4.12.0 4.13.0 4.14.0 4.15.0 4.2.0 4.3.0 4.4.0 4.5.0 4.6.0 4.7.0 4.8.0 4.9.0
yith-woocommerce-wishlist / plugin-fw / assets / js / multisite-updater.js
yith-woocommerce-wishlist / plugin-fw / assets / js Last commit date
codemirror 4 years ago jquery-tiptip 5 years ago select2 5 years ago how-to.js 8 years ago how-to.min.js 6 years ago jquery.colorbox.js 8 years ago jquery.colorbox.min.js 6 years ago metabox.js 4 years ago metabox.min.js 4 years ago multisite-updater.js 6 years ago multisite-updater.min.js 6 years ago welcome-modal.js 3 years ago welcome-modal.min.js 3 years ago wp-pages.js 4 years ago wp-pages.min.js 4 years ago yit-cpt-unlimited.js 6 years ago yit-cpt-unlimited.min.js 6 years ago yit-plugin-panel.js 3 years ago yit-plugin-panel.min.js 3 years ago yit-wp-pointer.js 5 years ago yit-wp-pointer.min.js 5 years ago yith-bh-onboarding.js 3 years ago yith-bh-onboarding.min.js 3 years ago yith-colorpicker.min.js 5 years ago yith-dashboard.js 7 years ago yith-dashboard.min.js 6 years ago yith-date-format.js 5 years ago yith-date-format.min.js 5 years ago yith-enhanced-select-wc-2.6.js 5 years ago yith-enhanced-select-wc-2.6.min.js 5 years ago yith-enhanced-select.js 3 years ago yith-enhanced-select.min.js 3 years ago yith-fields.js 4 years ago yith-fields.min.js 4 years ago yith-promo.js 7 years ago yith-promo.min.js 6 years ago yith-system-info.js 3 years ago yith-system-info.min.js 3 years ago yith-ui.js 4 years ago yith-ui.min.js 4 years ago yith-update-plugins.js 7 years ago yith-update-plugins.min.js 6 years ago
multisite-updater.js
223 lines
1 /**
2 * This file belongs to the YIT Framework.
3 *
4 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
5 * that is bundled with this package in the file LICENSE.txt.
6 * It is also available through the world-wide-web at this URL:
7 * http://www.gnu.org/licenses/gpl-3.0.txt
8 */
9 (function ( $ ) {
10
11 var plugins_menu_item = $( '#menu-plugins' ),
12 update = plugins_menu_item.find( '.update-plugins' ),
13 count = update.find( ".plugin-count" ).text(),
14 registered = plugins.registered,
15 activated = plugins.activated;
16
17 if ( count == 0 || count == '' ) {
18 var update_row = '<span class="update-plugins"><span class="plugin-count"></span></span>';
19 count = 0;
20 plugins_menu_item.find( '.wp-menu-name' ).append( update_row );
21 }
22
23 /**
24 * Add the plugin update rows for old plugins
25 */
26 update_plugins_row( registered, activated, count, plugins );
27
28 /**
29 *
30 * Add the update plugin rows for old plugin
31 *
32 * @author Andrea Grillo <andrea.grillo@yithemes.com>
33 *
34 * @param registered Registred plugins
35 * @param activated Activated plugins
36 * @param count Number of old plugins
37 * @param localize Localize strings array
38 *
39 * @return void
40 */
41 function update_plugins_row( registered, activated, count, localize ) {
42 for ( var init in registered ) {
43 var plugin = registered[ init ];
44 for ( var headers in plugin ) {
45
46 if ( headers == 'slug' || version_compare( plugin[ headers ].Version, plugin[ headers ].Latest, '=' ) ) {
47 continue;
48 }
49
50 count = parseInt( count ) + 1;
51 $( ".plugin-count" ).empty().html( count );
52
53 var regex = new RegExp( ' ', 'g' ),
54 info = plugin[ headers ],
55 name = '' + info.Name,
56 id = name.replace( regex, '-' ).trim(),
57 row = '*[data-slug="' + id.toLowerCase() + '"]';
58
59 $( row ).addClass( "update" );
60
61 var html = '<tr class="plugin-update-tr">' +
62 '<td colspan="3" class="plugin-update colspanchange">' +
63 '<div class="update-message notice inline notice-warning notice-alt">' + localize.strings.new_version.replace( '%plugin_name%', name ) +
64 '<a class="thickbox open-plugin-details-modal" href="' + localize.details_url[ init ] + '">' + localize.strings.latest.replace( '%latest%', plugin[ headers ].Latest ) + '</a>';
65
66 if ( typeof activated[ init ] == "undefined" ) {
67
68 html = html +
69 ' <em>' + localize.strings.unavailable + '</em>' +
70 localize.strings.activate.replace( '%activate_link%', localize.licence_activation_url ).replace( '%plugin_name%', name );
71 } else {
72 html = html +
73 '. <a href="' + localize.update_url[ init ] + '">' + localize.strings.update_now + '</a>';
74 }
75
76 if( version_compare( plugin[ headers ].Version, plugin[ headers ].Latest, '>' ) ){
77 html = html + localize.strings.version_issue.replace( '%plugin_name%', name )
78 }
79
80 html = html +
81 '</div>' +
82 '</td>' +
83 '</tr>';
84
85 $( html ).insertAfter( row );
86 }
87 }
88 }
89
90 /**
91 *
92 * @param v1 Version 1
93 * @param v2 Version 2
94 * @param operator Compare type
95 * @returns bool
96 *
97 * @see php.js library http://phpjs.org/
98 */
99 function version_compare( v1, v2, operator ) {
100 // discuss at: http://phpjs.org/functions/version_compare/
101 // original by: Philippe Jausions (http://pear.php.net/user/jausions)
102 // original by: Aidan Lister (http://aidanlister.com/)
103 // reimplemented by: Kankrelune (http://www.webfaktory.info/)
104 // improved by: Brett Zamir (http://brett-zamir.me)
105 // improved by: Scott Baker
106 // improved by: Theriault
107 // example 1: version_compare('8.2.5rc', '8.2.5a');
108 // returns 1: 1
109 // example 2: version_compare('8.2.50', '8.2.52', '<');
110 // returns 2: true
111 // example 3: version_compare('5.3.0-dev', '5.3.0');
112 // returns 3: -1
113 // example 4: version_compare('4.1.0.52','4.01.0.51');
114 // returns 4: 1
115
116 this.php_js = this.php_js || {};
117 this.php_js.ENV = this.php_js.ENV || {};
118 // END REDUNDANT
119 // Important: compare must be initialized at 0.
120 var i = 0,
121 x = 0,
122 compare = 0,
123 // vm maps textual PHP versions to negatives so they're less than 0.
124 // PHP currently defines these as CASE-SENSITIVE. It is important to
125 // leave these as negatives so that they can come before numerical versions
126 // and as if no letters were there to begin with.
127 // (1alpha is < 1 and < 1.1 but > 1dev1)
128 // If a non-numerical value can't be mapped to this table, it receives
129 // -7 as its value.
130 vm = {
131 'dev' : -6,
132 'alpha': -5,
133 'a' : -5,
134 'beta' : -4,
135 'b' : -4,
136 'RC' : -3,
137 'rc' : -3,
138 '#' : -2,
139 'p' : 1,
140 'pl' : 1
141 },
142 // This function will be called to prepare each version argument.
143 // It replaces every _, -, and + with a dot.
144 // It surrounds any nonsequence of numbers/dots with dots.
145 // It replaces sequences of dots with a single dot.
146 // version_compare('4..0', '4.0') == 0
147 // Important: A string of 0 length needs to be converted into a value
148 // even less than an unexisting value in vm (-7), hence [-8].
149 // It's also important to not strip spaces because of this.
150 // version_compare('', ' ') == 1
151 prepVersion = function ( v ) {
152 v = ('' + v)
153 .replace( /[_\-+]/g, '.' );
154 v = v.replace( /([^.\d]+)/g, '.$1.' )
155 .replace( /\.{2,}/g, '.' );
156 return (!v.length ? [ -8 ] : v.split( '.' ));
157 };
158 // This converts a version component to a number.
159 // Empty component becomes 0.
160 // Non-numerical component becomes a negative number.
161 // Numerical component becomes itself as an integer.
162 numVersion = function ( v ) {
163 return !v ? 0 : (isNaN( v ) ? vm[ v ] || -7 : parseInt( v, 10 ));
164 };
165 v1 = prepVersion( v1 );
166 v2 = prepVersion( v2 );
167 x = Math.max( v1.length, v2.length );
168 for ( i = 0; i < x; i++ ) {
169 if ( v1[ i ] == v2[ i ] ) {
170 continue;
171 }
172 v1[ i ] = numVersion( v1[ i ] );
173 v2[ i ] = numVersion( v2[ i ] );
174 if ( v1[ i ] < v2[ i ] ) {
175 compare = -1;
176 break;
177 } else if ( v1[ i ] > v2[ i ] ) {
178 compare = 1;
179 break;
180 }
181 }
182 if ( !operator ) {
183 return compare;
184 }
185
186 // Important: operator is CASE-SENSITIVE.
187 // "No operator" seems to be treated as "<."
188 // Any other values seem to make the function return null.
189 switch ( operator ) {
190 case '>':
191 case 'gt':
192 return (compare > 0);
193 case '>=':
194 case 'ge':
195 return (compare >= 0);
196 case '<=':
197 case 'le':
198 return (compare <= 0);
199 case '==':
200 case '=':
201 case 'eq':
202 return (compare === 0);
203 case '<>':
204 case '!=':
205 case 'ne':
206 return (compare !== 0);
207 case '':
208 case '<':
209 case 'lt':
210 return (compare < 0);
211 default:
212 return null;
213 }
214 }
215
216 // fix ThickBox issue (width-height) when opening a changelog
217 $( 'body' ).on( 'click', '.yit-changelog-button', function () {
218 $( '#TB_window' ).remove();
219 } );
220
221
222 })( jQuery );
223