|
1 | 1 | //* TITLE XKit Patches **// |
2 | | -//* VERSION 6.8.10 **// |
| 2 | +//* VERSION 6.8.11 **// |
3 | 3 | //* DESCRIPTION Patches framework **// |
4 | 4 | //* DEVELOPER new-xkit **// |
5 | 5 |
|
@@ -2435,6 +2435,61 @@ XKit.extensions.xkit_patches = new Object({ |
2435 | 2435 | } |
2436 | 2436 | }; |
2437 | 2437 |
|
| 2438 | + // Expedited fix for #1509; revert after updated XKit extension has been widely installed. |
| 2439 | + XKit.download.github_fetch = function(path, callback) { |
| 2440 | + var url = 'https://new-xkit.github.io/XKit/Extensions/dist/' + path; |
| 2441 | + GM_xmlhttpRequest({ |
| 2442 | + method: "GET", |
| 2443 | + url: url, |
| 2444 | + onerror: function(response) { |
| 2445 | + XKit.console.add("Unable to download '" + path + "'"); |
| 2446 | + callback({errors: true, server_down: true}); |
| 2447 | + }, |
| 2448 | + onload: function(response) { |
| 2449 | + // We are done! |
| 2450 | + var mdata = {}; |
| 2451 | + try { |
| 2452 | + mdata = jQuery.parseJSON(response.responseText); |
| 2453 | + } catch (e) { |
| 2454 | + // Server returned bad thingy. |
| 2455 | + XKit.console.add("Unable to download '" + path + |
| 2456 | + "', server returned non-json object." + e.message); |
| 2457 | + callback({errors: true, server_down: true}); |
| 2458 | + return; |
| 2459 | + } |
| 2460 | + callback(mdata); |
| 2461 | + } |
| 2462 | + }); |
| 2463 | + }; |
| 2464 | + XKit.download.extension = function(extension_id, callback) { |
| 2465 | + XKit.download.github_fetch(extension_id + '.json', callback); |
| 2466 | + }; |
| 2467 | + XKit.download.page = function(page, callback) { |
| 2468 | + if (page === 'list.php') { |
| 2469 | + XKit.download.github_fetch('page/list.json', callback); |
| 2470 | + return; |
| 2471 | + } |
| 2472 | + if (page === 'gallery.php') { |
| 2473 | + XKit.download.github_fetch('page/gallery.json', callback); |
| 2474 | + return; |
| 2475 | + } |
| 2476 | + if (page === 'themes/index.php') { |
| 2477 | + XKit.download.github_fetch('page/themes.json', callback); |
| 2478 | + return; |
| 2479 | + } |
| 2480 | + if (page === 'paperboy/index.php') { |
| 2481 | + XKit.download.github_fetch('page/paperboy.json', callback); |
| 2482 | + return; |
| 2483 | + } |
| 2484 | + if (page === 'framework_version.php') { |
| 2485 | + XKit.download.github_fetch('page/framework_version.json', callback); |
| 2486 | + return; |
| 2487 | + } |
| 2488 | + }; |
| 2489 | + delete XKit.servers; |
| 2490 | + delete XKit.download.try_count; |
| 2491 | + delete XKit.download.max_try_count; |
| 2492 | + |
2438 | 2493 | }, |
2439 | 2494 |
|
2440 | 2495 | /** |
|
0 commit comments