User talk:Rob Linden/GeSHI Test: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
Strife Onizuka (talk | contribs)
New page: There are two things that need to be done. #Remove the LSL_ prefix from the autolinking. That is left over from the dark ages and no new articles use this. None of the constants use this ...
 
Strife Onizuka (talk | contribs)
No edit summary
Line 2: Line 2:


#Remove the LSL_ prefix from the autolinking. That is left over from the dark ages and no new articles use this. None of the constants use this so despite there being a page for TRUE, the highlighter doesn't think there is one.
#Remove the LSL_ prefix from the autolinking. That is left over from the dark ages and no new articles use this. None of the constants use this so despite there being a page for TRUE, the highlighter doesn't think there is one.
#Set the class attribute for the links and turn off the underlining with CSS.
#Add some CSS to hide the underlining. <code>pre.code A{ text-decoration:none; }</code>
#*Give them a class like "lsllink" then add to the css, <code>a.lsllink { text-decoration:none; }</code>
 
--[[User:Strife Onizuka|Strife Onizuka]] 03:46, 30 November 2007 (PST)
Little GM script I wrote that does both of these.
<javascript>// ==UserScript==
// @name          LSL Style
// @namespace      http://home.comcast.net/~mailerdaemon/
// @include        https://wiki.secondlife.com/*
// @include        http://wiki.secondlife.com/*
// ==/UserScript==
 
GM_addStyle("pre.code a{ text-decoration:none; }")
var regex = /LSL_/;
var res = document.evaluate("//pre[@class='code']/a", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for (i = 0; link = res.snapshotItem(i); ++i) {
var t = link.attributes.getNamedItem("href");
t.value = t.value.replace(regex, "");
}</javascript>
-- [[User:Strife Onizuka|Strife Onizuka]] 05:12, 30 November 2007 (PST)

Revision as of 06:12, 30 November 2007

There are two things that need to be done.

  1. Remove the LSL_ prefix from the autolinking. That is left over from the dark ages and no new articles use this. None of the constants use this so despite there being a page for TRUE, the highlighter doesn't think there is one.
  2. Add some CSS to hide the underlining. pre.code A{ text-decoration:none; }

Little GM script I wrote that does both of these. <javascript>// ==UserScript== // @name LSL Style // @namespace http://home.comcast.net/~mailerdaemon/ // @include https://wiki.secondlife.com/* // @include http://wiki.secondlife.com/* // ==/UserScript==

GM_addStyle("pre.code a{ text-decoration:none; }") var regex = /LSL_/; var res = document.evaluate("//pre[@class='code']/a", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (i = 0; link = res.snapshotItem(i); ++i) { var t = link.attributes.getNamedItem("href"); t.value = t.value.replace(regex, ""); }</javascript> -- Strife Onizuka 05:12, 30 November 2007 (PST)