# HG changeset patch # User Edho Arief # Date 1430626986 0 # Node ID 7687bbda0bb4fadab2ff3c9c09de005abe506df6 # Parent ce30c81f3f0caf5f733240d8403437469c24087a diff -r ce30c81f3f0c -r 7687bbda0bb4 jiku-chu-direct-link.js --- 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