From 7f7d716d2b274145def36444daa920461c9a69c3 Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Tue, 5 Feb 2013 15:08:02 +0100 Subject: [PATCH] auto linkify links in comments --- README.md | 1 + code/boot.js | 3 ++- code/chat.js | 2 +- total-conversion-build.user.js | 7 ++++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index beb1ecfe..c922934d 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ Attribution & License This project is licensed under the permissive ISC license. Parts imported from other projects remain under their respective licenses: - [load.js by Chris O'Hara; MIT](https://github.com/chriso/load.js) +- [autolink-js by Bryan Woods; MIT](https://github.com/bryanwoods/autolink-js) - [leaflet.js; custom license (but appears free)](http://leafletjs.com/) - `leaflet_google.js`; unknown - StackOverflow-CopyPasta is attributed in the source; [CC-Wiki](https://creativecommons.org/licenses/by-sa/3.0/) diff --git a/code/boot.js b/code/boot.js index 4c5c87b8..07f05f72 100644 --- a/code/boot.js +++ b/code/boot.js @@ -170,6 +170,7 @@ function asyncLoadScript(a){return function(b,c){var d=document.createElement("s var LLGMAPS = 'http://breunigs.github.com/ingress-intel-total-conversion/leaflet_google.js'; var JQUERY = 'https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js'; var LEAFLET = 'http://cdn.leafletjs.com/leaflet-0.5/leaflet.js'; +var AUTOLINK = 'https://raw.github.com/bryanwoods/autolink-js/master/autolink.js'; // after all scripts have loaded, boot the actual app -load(JQUERY, LEAFLET).then(LLGMAPS).thenRun(boot); +load(JQUERY, LEAFLET, AUTOLINK).then(LLGMAPS).thenRun(boot); diff --git a/code/chat.js b/code/chat.js index 3189a0d5..9324b04a 100644 --- a/code/chat.js +++ b/code/chat.js @@ -365,7 +365,7 @@ window.chat.renderPlayerMsgsTo = function(isFaction, data, isOldMsgs, dupCheckAr window.setPlayerName(pguid, nick); // free nick name resolves } - if(markup[0] === 'TEXT') msg = markup[1].plain; + if(markup[0] === 'TEXT') msg = markup[1].plain.autoLink(); if(!isFaction && markup[0] === 'SECURE') { nick = null; diff --git a/total-conversion-build.user.js b/total-conversion-build.user.js index 645d3050..4052b339 100644 --- a/total-conversion-build.user.js +++ b/total-conversion-build.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @id ingress-intel-total-conversion@breunigs // @name intel map total conversion -// @version 0.2-2013-02-05-142635 +// @version 0.2-2013-02-05-150753 // @namespace https://github.com/breunigs/ingress-intel-total-conversion // @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/total-conversion-build.user.js // @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/total-conversion-build.user.js @@ -863,9 +863,10 @@ function asyncLoadScript(a){return function(b,c){var d=document.createElement("s var LLGMAPS = 'http://breunigs.github.com/ingress-intel-total-conversion/leaflet_google.js'; var JQUERY = 'https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js'; var LEAFLET = 'http://cdn.leafletjs.com/leaflet-0.5/leaflet.js'; +var AUTOLINK = 'https://raw.github.com/bryanwoods/autolink-js/master/autolink.js'; // after all scripts have loaded, boot the actual app -load(JQUERY, LEAFLET).then(LLGMAPS).thenRun(boot); +load(JQUERY, LEAFLET, AUTOLINK).then(LLGMAPS).thenRun(boot); window.chat = function() {}; @@ -1235,7 +1236,7 @@ window.chat.renderPlayerMsgsTo = function(isFaction, data, isOldMsgs, dupCheckAr window.setPlayerName(pguid, nick); // free nick name resolves } - if(markup[0] === 'TEXT') msg = markup[1].plain; + if(markup[0] === 'TEXT') msg = markup[1].plain.autoLink(); if(!isFaction && markup[0] === 'SECURE') { nick = null;