NewKaskus Simple Reply

Simple post reply interface on LiveBeta Gan

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name            NewKaskus Simple Reply
// @author          Ndilallah
// @description     Simple post reply interface on LiveBeta Gan
// @license         Creative Commons Attribution License
// @icon            http://s3.amazonaws.com/uso_ss/icon/127557/large.jpg?1332108198
// @version	    1.4
// @released        2012-03-05
// @compatible      Greasemonkey
// @include         http://www.kaskus.co.id/post_reply/*
// @include         http://kaskus.co.id/group/reply_discussion/*
// @namespace https://greasyfork.org/users/5529
// ==/UserScript==
     
    
    (function () {
           
    // Removes all occurences of elements whose XPath is provided from the document.
    function removeElement(ElementXpath)
    {
            var alltags = document.evaluate(ElementXpath,document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
            for (i=0; i<alltags.snapshotLength; i++)
            {
            element = alltags.snapshotItem(i);
            element.parentNode.removeChild(element); // Remove this element from its parent.
            }
    }
     
    // Set an attribute for all elements in an XPath
    function setAttributeOfElement(attributeName,attributeValue,ElementXpath)
    {
            var alltags = document.evaluate(ElementXpath,document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
            for (i=0; i<alltags.snapshotLength; i++)
                    alltags.snapshotItem(i).setAttribute(attributeName, attributeValue)
    }
     
    //Do the dirty work
    try
    {
            //Totally delete elements 
            //and fix that simple interface 
			removeElement ('.//HEADER[@id="site-header"]/DIV[1]');
            removeElement ('.//DIV[@id="edit"]/DIV[2]/FIELDSET/DIV[1]/LABEL');
			removeElement ('.//DIV[@id="edit"]/DIV[2]/FIELDSET/DIV[2]/LABEL');
			removeElement ('.//DIV[@id="edit"]/DIV[2]/FIELDSET/DIV[3]');
			removeElement ('.//DIV[@id="edit"]/DIV[2]/FIELDSET/DIV[3]/LABEL');
			removeElement ('.//DIV[@id="edit"]/DIV[2]/FIELDSET/DIV[4]/LABEL');
			removeElement ('.//DIV[@id="edit"]/DIV[2]/FIELDSET/DIV[5]');
			removeElement ('.//DIV[@id="edit"]/DIV[2]/FIELDSET/DIV[5]/LABEL');
			removeElement ('.//DIV[@id="edit"]/DIV[2]/FIELDSET/DIV[5]/H4');
			removeElement ('.//DIV[@id="edit"]/DIV[2]/DIV');
			removeElement ('.//SELECT[@name="emailupdate"]');
			removeElement ('.//SELECT[@name="folderid"]');
			removeElement ('.//DIV[@id="edit"]/DIV[2]/FIELDSET/DIV[5]/DIV[1]');
			removeElement ('.//DIV[@id="edit"]/DIV[2]/FIELDSET/DIV[5]/DIV[2]');
			removeElement ('.//FOOTER[@id="site-footer"]');
			removeElement ('.//DIV[@class="bottom-frame"]');
			removeElement ('.//DIV[@class="post-icon input"]');
			setAttributeOfElement ('style', 'width:470px', ".//INPUT[@id='form-title']");
			setAttributeOfElement ('style', 'top:5px', ".//DIV[@class='smiley-wrapper']");
			setAttributeOfElement ('style', 'margin-left:0px', ".//DIV[@class='input']");
			setAttributeOfElement ('style', 'margin-left:0px', ".//DIV[@class='capctha']");
			setAttributeOfElement ('style', 'width:735px;margin:0 auto', ".//DIV[@id='edit']");
    }   
	
    catch (e)
    {
            alert("UserScript exception:\n" + e);
    }
     
    })();
	GM_addStyle (".reply-form .clearfix{padding:4px 0px;margin:0px}");
/* Ndilallah */