Created
January 12, 2011 09:02
-
-
Save koni/775903 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 使い方 | |
// 検索結果ページで以下をアドレスバーにコピーアンドペースする。 | |
// javascript:(function(){d=document;s=d.createElement('script');s.setAttribute('src','https://gist.github.com/raw/775903/replacingCollection.js');d.documentElement.appendChild(s);}()) | |
document.body.appendChild((function(){ | |
var s = document.createElement("script"); | |
s.type = "text/javascript"; | |
s.src = "http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; | |
s.onload = function() { | |
window.jQuery.noConflict(); | |
document.body.appendChild((function(){ | |
var css_settings={"float":"right", | |
"padding":"10px", | |
"background-color":"#fafafa", | |
"cursor":"pointer" | |
}; | |
var s = document.createElement("script"); | |
s.type = "text/javascript"; | |
s.src = "https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"; | |
s.onload = function (){ | |
jQuery(".ArMainSeparator01,.ArMainSeparator04").remove(); | |
jQuery(".LyMainInner > *") | |
.css("border-bottom","2px solid #eeeeee") | |
.css("border-top","1px solid #dddddd"); | |
jQuery(".LyMainInner") | |
.sortable({items:">*:not(.ArMainSeparator01)"}); | |
jQuery("<div/>") | |
.text("+") | |
.css(css_settings) | |
.prependTo(".LyMainInner>*:not(.ArCatReal):visible") | |
.click(function(event){ | |
//追加 | |
var tmp=jQuery(this).parent().find(".MdSRList01>ul>li:first ,.MdSRList02>ul>li:first,.MdSRList04:first,.MdSRList05:first,.MdSRList06>ul>li:first") | |
.clone() | |
.removeClass("firstChild") | |
.show(); | |
jQuery(this).parent().find(".MdSRList01>ul ,.MdSRList02>ul,.arMain04BodyInner,.arMain05BodyInner,.MdSRList06>ul").append(tmp); | |
}); | |
jQuery("<div/>") | |
.text("-") | |
.css(css_settings) | |
.prependTo(".LyMainInner>*:not(.ArCatReal):visible") | |
.click(function(event){ | |
if(jQuery(this).parent().find(".MdSRList01>ul>li ,.MdSRList02>ul>li,.MdSRList04,.MdSRList05,.MdSRList06>ul>li").size()>1){ | |
jQuery(this).parent().find(".MdSRList01>ul>li:last,.MdSRList02>ul>li:last,.MdSRList04:last,.MdSRList05:last,.MdSRList06>ul>li:last").remove(); | |
} | |
}); | |
}; | |
return s; | |
})()); | |
}; | |
return s; | |
})()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment