// ==UserScript== // @name KLDP Point position change // @namespace http://kldp.org // @description KLDP Point position change // @include http://kldp.org/* // @include http://www.kldp.org/* // ==/UserScript== var CustomizeKLDP = { // add arbitrary CSS styles to page addGlobalStyle: function(css) { style = document.createElement("style"); style.type = "text/css"; style.innerHTML = css; document.getElementsByTagName('head')[0].appendChild(style); }, changePoint: function() { /* // tags to hide var hideme = new Array('iframe'); // loop thru the hidden tags array for ( x = 0; x < hideme.length; x++ ) { // get all tags of that name var tags = document.getElementsByTagName(hideme[x]); // loop thru those tags and set them not to show for ( y = 0; y < tags.length; y++ ) { if (tags[y].src.indexOf('http://nv') != -1) { tags[y].style['display'] = 'none'; continue; } } } */ // this.addGlobalStyle('#block-block-5 { display: none }'); // this.addGlobalStyle('.content { display: none }'); // this.addGlobalStyle('.vote-up-down-widget { float: right; xdisplay: none; background-color : #FFCC00;}'); // this.addGlobalStyle('.links span .vote-points { display: none }'); // this.addGlobalStyle('.links span { float:right; position:relative; margin-top: -79px ; xdisplay: none; }'); // this.addGlobalStyle('.vote-up-act, .vote-up-inact, .vote-down-act, .vote-down-inact, .up-inact, .down-inact { display: inline; width: 15px; height: 16px;}'); /* this.addGlobalStyle('.vote-up-act, .vote-up-inact:hover { background: url(a_up_act.png) no-repeat 0px 0px; }'); this.addGlobalStyle('.vote-up-inact, .up-inact { background: url(a_up_inact.png) no-repeat 0px 0px; }'); this.addGlobalStyle('.vote-down-act, .vote-down-inact:hover { background: url(a_down_act.png) no-repeat 0px 0px; }'); this.addGlobalStyle('.vote-down-inact, .down-inact { background: url(a_down_inact.png) no-repeat 0px 0px; }'); this.addGlobalStyle('.vote-up-down-widget-alt .vote-up-inact:hover { background: url(plus_act.png) no-repeat center 3px; }'); this.addGlobalStyle('.vote-up-down-widget-alt .up-inact {background: url(plus_inact.png) no-repeat center 3px;}'); */ // this.addGlobalStyle('.vote-up-act, .vote-up-inact:hover { background: url(http://wiki.kldp.org/pds/1day1/a_up_act2.png) no-repeat 0px 0px; }'); this.addGlobalStyle('.vote-up-inact, .up-inact { background: url(http://wiki.kldp.org/pds/1day1/a_up_inact2.png) no-repeat 0px 0px; }'); this.addGlobalStyle('.vote-up-act, .vote-up-inact:hover { background: url(http://digg.com/img/c-digg.png) no-repeat 0px 0px; }'); // this.addGlobalStyle('.vote-down-act, .vote-down-inact:hover { background: url(http://wiki.kldp.org/pds/1day1/a_down_act2.png) no-repeat 0px 0px; }'); this.addGlobalStyle('.vote-down-inact, .down-inact { background: url(http://wiki.kldp.org/pds/1day1/a_down_inact2.png) no-repeat 0px 0px; }'); this.addGlobalStyle('.vote-down-act, .vote-down-inact:hover { background: url(http://digg.com/img/c-bury.png) no-repeat 0px 0px; }'); // this.addGlobalStyle('.vote-up-down-widget-alt .vote-up-inact:hover { background: url(plus_act.png) no-repeat center 3px; }'); // this.addGlobalStyle('.vote-up-down-widget-alt .up-inact {background: url(plus_inact.png) no-repeat center 3px;}'); // "//div[@class='links']", // var allDivs, thisDiv , thisDiv2 , thisDiv3 , newDiv , voteDivs; linkDivs = document.evaluate( "//div[@class='links']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); allDivs = document.evaluate( "//span[@class='vote-points']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); voteDivs = document.evaluate( "//div[@class='vote-up-down-widget']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < allDivs.snapshotLength; i++) { thisDiv = allDivs.snapshotItem(i); // do something with thisDiv // thisDiv.style['float'] = 'left'; thisDiv.style['display'] = 'block'; thisDiv.style['width'] = '88px'; thisDiv.style['height'] = '36px'; thisDiv.style['font-size'] = '20pt'; thisDiv.style['marginRight'] = '10px'; // thisDiv.style['marginLeft'] = '2px'; // thisDiv.style['paddingLeft'] = '2px'; thisDiv.style['padding'] = '2px'; thisDiv.style['float'] = 'right'; thisDiv.style['border'] = '1px solid #CC0000'; thisDiv.style['backgroundColor'] = '#FFCC00'; } for (var i = 0; i < voteDivs.snapshotLength; i++) { thisDiv2 = voteDivs.snapshotItem(i); // do something with thisDiv // thisDiv2.style['float'] = 'left'; thisDiv2.style['clear'] = 'none'; thisDiv2.style['display'] = 'block'; thisDiv2.style['marginLeft'] = '2px'; // thisDiv2.style['position'] = 'relative'; thisDiv2.style['backgroundColor'] = '#FFFFFF'; // newElement = document.createElement('hr'); // thisDiv.parentNode.insertBefore(thisDiv2, thisDiv); // thisDiv = allDivs.snapshotItem(i); // thisDiv2.parentNode.insertBefore(thisDiv, thisDiv2); } for (var i = 0; i < linkDivs.snapshotLength; i++) { thisDiv3 = linkDivs.snapshotItem(i); thisDiv2 = voteDivs.snapshotItem(i); thisDiv = allDivs.snapshotItem(i); thisDiv3.style['float'] = 'left'; // thisDiv3.style['display'] = 'block'; thisDiv3.style['marginBottom'] = '2px'; // 20px // newDiv = document.createElement("div"); // thisDiv3.appendChild(newDiv); // newDiv.parentNode.insertBefore(thisDiv2, newDiv); // newDiv.parentNode.insertBefore(thisDiv, newDiv); // thisDiv3.parentNode.insertBefore(thisDiv2, thisDiv3.nextSibling); // thisDiv3.parentNode.insertBefore(thisDiv, thisDiv3.nextSibling); thisDiv3.parentNode.insertBefore(thisDiv2, thisDiv3); thisDiv3.parentNode.insertBefore(thisDiv, thisDiv3); // thisDiv3.parentNode.insertBefore(newDiv, thisDiv3); } /* //