diff jiku-chu-direct-link.js @ 3:7687bbda0bb4

(none)
author Edho Arief <me@myconan.net>
date Sun, 03 May 2015 04:23:06 +0000
parents ce30c81f3f0c
children 59084566b064
line wrap: on
line diff
--- a/jiku-chu-direct-link.js	Sun May 03 04:21:46 2015 +0000
+++ b/jiku-chu-direct-link.js	Sun May 03 04:23:06 2015 +0000
@@ -1,7 +1,7 @@
 // ==UserScript==
 // @name         Jiku-Chu direct link
 // @namespace    https://myconan.net
-// @version      2.0
+// @version      2.1
 // @description  Make proper link on Jiku-Chu pages
 // @author       nanaya
 // @match        http://www.jiku-chu.com/products/list.php?*
@@ -9,14 +9,14 @@
 // ==/UserScript==
 
 ;(function() {
-  console.log("hi")
-  var
-    links = document.querySelectorAll(".title a, .photo a")
-  Array.prototype.forEach.call(links, function(el) {
-    var
-      productId = el.getAttribute("onclick").replace(/.*product_id=(\d+).*/, "$1"),
-      url = "/products/detail.php?product_id=" + productId
-    el.setAttribute("href", url)
-    el.setAttribute("onclick", "")
-  })
+  Array.prototype.forEach.call(
+    document.querySelectorAll(".title a, .photo a"),
+    function(el) {
+      var
+        productId = el.getAttribute("onclick").replace(/.*product_id=(\d+).*/, "$1"),
+        url = "/products/detail.php?product_id=" + productId
+      el.setAttribute("href", url)
+      el.setAttribute("onclick", "")
+    }
+  )
 }).call();
\ No newline at end of file