// ==UserScript==// @name Soylent Upgrade// @match http://soylentnews.org/submit.pl// @match https://soylentnews.org/submit.pl// @match http://soylentnews.org/submit.pl?op=viewsub&subid=*// @match https://soylentnews.org/submit.pl?op=viewsub&subid=*// @match http://soylentnews.org/admin.pl// @match https://soylentnews.org/admin.pl// @match http://soylentnews.org/admin.pl?op=edit&sid=*// @match https://soylentnews.org/admin.pl?op=edit&sid=*// @match http://soylentnews.org/comments.pl*// ==/UserScript==var simplifyChars = true;var boxes = document.getElementsByTagName("textarea");for (var x=0; x<boxes.length; x++){ if (boxes[x].name == "introtext" || boxes[x].name == "bodytext") { var temp = boxes[x].value; temp = temp.replace(/<\/p><p>/g,"<\/p>\n\n<p>"); temp = temp.replace(/<br>\s?<br>/g,"<\/p>\n\n<p>"); temp = temp.replace(/<\/blockquote><p>/g,"<\/blockquote>\n\n<p>"); temp = temp.replace(/<\/p><blockquote>/g,"<\/p>\n\n<blockquote>"); temp = temp.replace(/<blockquote><div><p>/g,"<blockquote><div>\n\n<p>"); temp = temp.replace(/<\/p><\/div><\/blockquote>/g,"<\/p>\n\n<\/div><\/blockquote>"); temp = temp.replace(/<\/blockquote><blockquote>/g,"<\/blockquote>\n\n<blockquote>"); temp = temp.replace(/<p class="byline">\s/i,"<p class=\"byline\">"); temp = temp.replace(/<p>\s/g,"<p>"); temp = temp.replace(/\s<\/p>/g,"<\/p>"); temp = temp.replace(/<\/li><li>/g,"<\/li>\n<li>"); temp = temp.replace(/<\/li><\/ul>/g,"<\/li>\n<\/ul>"); temp = temp.replace(/<\/p><ul>/g,"<\/p>\n\n<ul>"); temp = temp.replace(/ /g," "); if (simplifyChars) { temp = temp.replace(/\u2018/g,"'"); temp = temp.replace(/\u2019/g,"'"); temp = temp.replace(/\u201C/g,"\""); temp = temp.replace(/\u201D/g,"\""); temp = temp.replace(/\u2026/g,"..."); // ellipsis } boxes[x].value = temp; boxes[x].rows = 32; } var toolbar = document.createElement("div"); var tempbutton = document.createElement("input"); tempbutton.setAttribute("type","button"); tempbutton.setAttribute("value","Blockquote"); tempbutton.setAttribute("onmousedown","addBlockquote(document.getElementsByTagName('textarea')["+x+"]);"); toolbar.appendChild(tempbutton); boxes[x].parentNode.insertBefore(toolbar, boxes[x].nextSibling);}var temp = document.createElement("script");temp.appendChild(document.createTextNode("function addBlockquote(area) { var sel = getSelection(); if (sel.length != 0) { area.value = area.value.replace(sel,'<blockquote>'+sel+'<\/blockquote>'); } }"));document.getElementsByTagName('head')[0].appendChild(temp);function getSelection() { return (!!document.getSelection) ? document.getSelection() : (!!window.getSelection) ? window.getSelection() : document.selection.createRange().text;}
// ==UserScript==// @name Soylent Upgrade// @match http://soylentnews.org/submit.pl// @match https://soylentnews.org/submit.pl// @match http://soylentnews.org/submit.pl?op=viewsub&subid=*// @match https://soylentnews.org/submit.pl?op=viewsub&subid=*// @match http://soylentnews.org/admin.pl// @match https://soylentnews.org/admin.pl// @match http://soylentnews.org/admin.pl?op=edit&sid=*// @match https://soylentnews.org/admin.pl?op=edit&sid=*// @match http://soylentnews.org/comments.pl*// ==/UserScript==
var simplifyChars = true;
var boxes = document.getElementsByTagName("textarea");for (var x=0; x<boxes.length; x++){ if (boxes[x].name == "introtext" || boxes[x].name == "bodytext") { var temp = boxes[x].value; temp = temp.replace(/<\/p><p>/g,"<\/p>\n\n<p>"); temp = temp.replace(/<br>\s?<br>/g,"<\/p>\n\n<p>"); temp = temp.replace(/<\/blockquote><p>/g,"<\/blockquote>\n\n<p>"); temp = temp.replace(/<\/p><blockquote>/g,"<\/p>\n\n<blockquote>"); temp = temp.replace(/<blockquote><div><p>/g,"<blockquote><div>\n\n<p>"); temp = temp.replace(/<\/p><\/div><\/blockquote>/g,"<\/p>\n\n<\/div><\/blockquote>"); temp = temp.replace(/<\/blockquote><blockquote>/g,"<\/blockquote>\n\n<blockquote>"); temp = temp.replace(/<p class="byline">\s/i,"<p class=\"byline\">"); temp = temp.replace(/<p>\s/g,"<p>"); temp = temp.replace(/\s<\/p>/g,"<\/p>"); temp = temp.replace(/<\/li><li>/g,"<\/li>\n<li>"); temp = temp.replace(/<\/li><\/ul>/g,"<\/li>\n<\/ul>"); temp = temp.replace(/<\/p><ul>/g,"<\/p>\n\n<ul>"); temp = temp.replace(/ /g," "); if (simplifyChars) { temp = temp.replace(/\u2018/g,"'"); temp = temp.replace(/\u2019/g,"'"); temp = temp.replace(/\u201C/g,"\""); temp = temp.replace(/\u201D/g,"\""); temp = temp.replace(/\u2026/g,"..."); // ellipsis } boxes[x].value = temp; boxes[x].rows = 32; } var toolbar = document.createElement("div"); var tempbutton = document.createElement("input"); tempbutton.setAttribute("type","button"); tempbutton.setAttribute("value","Blockquote"); tempbutton.setAttribute("onmousedown","addBlockquote(document.getElementsByTagName('textarea')["+x+"]);"); toolbar.appendChild(tempbutton); boxes[x].parentNode.insertBefore(toolbar, boxes[x].nextSibling);}
var temp = document.createElement("script");temp.appendChild(document.createTextNode("function addBlockquote(area) { var sel = getSelection(); if (sel.length != 0) { area.value = area.value.replace(sel,'<blockquote>'+sel+'<\/blockquote>'); } }"));document.getElementsByTagName('head')[0].appendChild(temp);
function getSelection() { return (!!document.getSelection) ? document.getSelection() : (!!window.getSelection) ? window.getSelection() : document.selection.createRange().text;}
Nick
Password
Name
Subject
Comment
Plain Old Text HTML Formatted Extrans (html tags to text) Code
Allowed HTML <b|i|p|br|a|ol|ul|li|dl|dt|dd|em|strong|tt|blockquote|div|ecode|quote|sup|sub|abbr|sarc|sarcasm|user|spoiler|del>
URLs <URL:http://example.com/> will auto-link a URL
<URL:http://example.com/>
Important Stuff
If you are having a problem with accounts or comment posting, please yell for help.
Soylent Upgrade user extension for Chrome
Post Comment