From b4724f76dc2638b28292f2a873d4bb330dcca550 Mon Sep 17 00:00:00 2001 From: fkloft Date: Sun, 8 Feb 2015 00:00:43 +0100 Subject: [PATCH 1/2] Revert "Use unminified source for chain.js" This reverts commit 507ec8c8eeef5d42b3ac21eb9c27277b7ae3713e. (Bug was found and fixed) --- external/load.js | 154 +---------------------------------------------- 1 file changed, 1 insertion(+), 153 deletions(-) diff --git a/external/load.js b/external/load.js index 27aacf19..ed4381da 100644 --- a/external/load.js +++ b/external/load.js @@ -1,159 +1,7 @@ /* Copyright (c) 2010 Chris O'Hara . MIT Licensed */ //Include the chain.js microframework (http://github.com/chriso/chain.js) -(function(exports) { - - exports = exports || {}; - - var handlers = {}, createChain, add; - - createChain = function (context, stack, lastMethod) { - - var inHandler = context.halt = false; - - //The default error handler - context.error = function (e) { - throw e; - }; - - //Run the next method in the chain - context.next = function (exit) { - if (exit) { - inHandler = false; - } - if (!context.halt && stack && stack.length) { - var args = stack.shift(), method = args.shift(); - inHandler = true; - try { - handlers[method].apply(context, [args, args.length, method]); - } catch (e) { - context.error(e); - } - } - return context; - }; - - //Bind each method to the context - for (var alias in handlers) { - if (typeof context[alias] === 'function') { - continue; - } - (function (alias) { - context[alias] = function () { - var args = Array.prototype.slice.call(arguments); - if (alias === 'onError') { - if (stack) { - handlers.onError.apply(context, [args, args.length]); - return context; - } - - var new_context = {}; - handlers.onError.apply(new_context, [args, args.length]); - return createChain(new_context, null, 'onError'); - } - args.unshift(alias); - if (!stack) { - return createChain({}, [args], alias); - } - context.then = context[alias]; - stack.push(args); - return inHandler ? context : context.next(); - }; - }(alias)); - } - - //'then' is an alias for the last method that was called - if (lastMethod) { - context.then = context[lastMethod]; - } - - //Used to call run(), chain() or another existing method when defining a new method - //See load.js (https://github.com/chriso/load.js/blob/master/load.js) for an example - context.call = function (method, args) { - args.unshift(method); - stack.unshift(args); - context.next(true); - }; - - return context.next(); - }; - - //Add a custom method/handler (see below) - add = exports.addMethod = function (method /*, alias1, alias2, ..., callback */) { - var args = Array.prototype.slice.call(arguments), - handler = args.pop(); - for (var i = 0, len = args.length; i < len; i++) { - if (typeof args[i] === 'string') { - handlers[args[i]] = handler; - } - } - //When no aliases have been defined, automatically add 'then' - //e.g. adding 'run' also adds 'thenRun' as a method - if (!--len) { - handlers['then' + method.substr(0,1).toUpperCase() + method.substr(1)] = handler; - } - createChain(exports); - }; - - //chain() - Run each function sequentially - add('chain', function (args) { - var self = this, next = function () { - if (self.halt) { - return; - } else if (!args.length) { - return self.next(true); - } - try { - if (null != args.shift().call(self, next, self.error)) { - next(); - } - } catch (e) { - self.error(e); - } - }; - next(); - }); - - //run() - Run each function in parallel and progress once all functions are complete - add('run', function (args, arg_len) { - var self = this, chain = function () { - if (self.halt) { - return; - } else if (!--arg_len) { - self.next(true); - } - }; - var error = function (e) { - self.error(e); - }; - for (var i = 0, len = arg_len; !self.halt && i < len; i++) { - if (null != args[i].call(self, chain, error)) { - chain(); - } - } - }); - - //defer() - Defer execution of the next method - add('defer', function (args) { - var self = this; - setTimeout(function () { - self.next(true); - }, args.shift()); - }); - - //onError() - Attach an error handler - add('onError', function (args, arg_len) { - var self = this; - this.error = function (err) { - self.halt = true; - for (var i = 0; i < arg_len; i++) { - args[i].call(self, err); - } - }; - }); - -}(this)); - +(function(a){a=a||{};var b={},c,d;c=function(a,d,e){var f=a.halt=!1;a.error=function(a){throw a},a.next=function(c){c&&(f=!1);if(!a.halt&&d&&d.length){var e=d.shift(),g=e.shift();f=!0;try{b[g].apply(a,[e,e.length,g])}catch(h){a.error(h)}}return a};for(var g in b){if(typeof a[g]==="function")continue;(function(e){a[e]=function(){var g=Array.prototype.slice.call(arguments);if(e==="onError"){if(d){b.onError.apply(a,[g,g.length]);return a}var h={};b.onError.apply(h,[g,g.length]);return c(h,null,"onError")}g.unshift(e);if(!d)return c({},[g],e);a.then=a[e],d.push(g);return f?a:a.next()}})(g)}e&&(a.then=a[e]),a.call=function(b,c){c.unshift(b),d.unshift(c),a.next(!0)};return a.next()},d=a.addMethod=function(d){var e=Array.prototype.slice.call(arguments),f=e.pop();for(var g=0,h=e.length;g Date: Sun, 8 Feb 2015 17:50:42 +0100 Subject: [PATCH 2/2] [link-show-direction] new style: static highlighting near origin --- plugins/link-show-direction.user.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/link-show-direction.user.js b/plugins/link-show-direction.user.js index cadbff70..b972082e 100644 --- a/plugins/link-show-direction.user.js +++ b/plugins/link-show-direction.user.js @@ -2,7 +2,7 @@ // @id iitc-plugin-link-show-direction // @name IITC plugin: Show the direction of links on the map // @category Tweaks -// @version 0.2.0.@@DATETIMEVERSION@@ +// @version 0.2.1.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ @@ -25,7 +25,12 @@ window.plugin.linkShowDirection.ANIMATE_UPDATE_TIME = 1000; // 1000ms = 1s window.plugin.linkShowDirection.styles = { 'Disabled': [null], - 'Static *': ['30,5,15,5,15,5,2,5,2,5,2,5,2,5,30,0'], + 'Static *': [ + '30,5,15,5,15,5,2,5,2,5,2,5,2,5,30,0', + ], + 'Static near origin': [ + '10,5,5,5,5,5,5,5,100%', + ], 'Animate near origin': [ '10,5,5,5,5,5,5,5,100%', '12,5,5,5,5,5,5,3,100%', @@ -125,7 +130,7 @@ window.plugin.linkShowDirection.showDialog = function() { }); div.appendChild(document.createTextNode( - ' * Static: 5 segments will indicate each link\'s direction. ' + + ' * Static: six segments will indicate each link\'s direction. ' + 'Two long segments are on the origin\'s side, follow by four short segments on the destination\'s side.')); if(window.plugin.drawTools) {