Browse Source

User script to redirect old layouts to ddlayout.co.uk

master
Chris Smith 12 years ago
parent
commit
d39c6d32f3
1 changed files with 17 additions and 0 deletions
  1. 17
    0
      replacelinks.user.js

+ 17
- 0
replacelinks.user.js View File

@@ -0,0 +1,17 @@
1
+// ==UserScript==
2
+// @name ddlayout.co.uk link replacer
3
+// @namespace http://www.ddlayout.co.uk/
4
+// @include *
5
+// ==/UserScript==
6
+
7
+var oldPrefix = 'http://html5.cubicleninja.com/cubicleninja/html5/dd/index.htm?layout=';
8
+var newPrefix = 'http://www.ddlayout.co.uk/#';
9
+
10
+var links = document.evaluate("//a[contains(@href, '" + oldPrefix + "')]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
11
+
12
+for (var i = 0; i < links.snapshotLength; i++) {
13
+ var link = links.snapshotItem(i);
14
+ link.href = link.href.replace(oldPrefix, newPrefix);
15
+}
16
+
17
+

Loading…
Cancel
Save