commit - 7dc1039c56f1f1a35707aea31b6bf10028f6c20e
commit + 91d7daeb58076d2ddf3a378fc851ed3b3e3f8176
blob - /dev/null
blob + 3fcedfdf6ce9f5b27d4a6e4391348326a029b711 (mode 755)
--- /dev/null
+++ contrib/8225.user.js
+// RtBoard Kill Announcement Greasemonkey script, v 0.0.2, 2007-April-02
+// Released under the GPL license: http://www.gnu.org/copyleft/gpl.html
+// Changelog:
+// 0.0.1 2007-03-29 -- Original release.
+// 0.0.2 2007-04-02 implementation based on styles
+// --------------------------------------------------------------------
+// This is a Greasemonkey user script.
+//
+// To install, you need Greasemonkey: https://addons.mozilla.org/firefox/748/
+// Then restart Firefox and revisit this script.
+// Under Tools, there will be a new menu item to "Install User Script".
+// Accept the default configuration and install.
+//
+// To uninstall, go to Tools/Manage User Scripts, select this script,
+// and click Uninstall.
+// --------------------------------------------------------------------
+// ==UserScript==
+// @name RtBoard Kill Announcement
+// @namespace tag:point.zero.two.euro.cents@gmail.com,2007-03-29:greasemonkey/RtBoard/Kill/Announcement
+// @description Kills announcements on RtBoard
+// @include http://board.rt.mipt.ru/?index*
+// @include http://zlo.rt.mipt.ru/?index*
+// ==/UserScript==
+
+// kill all elements defined by xpath
+function kill_elements(xpath) {
+ // populate elements
+ var elements = document.evaluate(xpath, document, null,
+ XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
+ // kill elements
+ var e;
+ for (var i = 0; (e = elements.snapshotItem(i)); i++) {
+//debug e.parentNode.removeChild(e);
+ e.style.display = "none";
+ }
+}
+
+// kill announcements
+function onloadKill() {
+ kill_elements("//div[@class='an']");
+ kill_elements("//a[starts-with(@href, '?rann=')]");
+}
+
+//
+window.addEventListener('load', onloadKill, false);
+
+
+
+
+
+
blob - /dev/null
blob + 1eb2eee65a9863fb9bcb0eff012264d794c66507 (mode 755)
--- /dev/null
+++ contrib/ban.txt
+
+$ban_list = "../data/banned.txt";
+$edit_url = "ban.cgi";
+
+read(STDIN,$string,$ENV{'CONTENT_LENGTH'});
+@pairs = split(/&/,$string);
+foreach $pair (@pairs) {
+ ($keyword,$value) = split(/=/,$pair);
+ $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/ge;
+ $keyword =~ tr/+/ /;
+ $value =~ tr/+/ /;
+ $input{$keyword} = $value;
+
+ }
+ print "Content-type: text/html\n\n";
+
+open (BAN_LIST, "$ban_list") || print "Can\'t open ban list $ban_list \n";
+@ban_list=<BAN_LIST>;
+close BAN_LIST;
+
+&init;
+if ($ENV{'QUERY_STRING'} =~ /edit/i) {&edit;}
+elsif ($ENV{'QUERY_STRING'} =~ /save/i) {&save;}
+else {&view;}
+&footer;
+
+
+
+sub init{
+ print "<html><head><title>ban-list</title>\n";
+ print "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=windows-1251\">";
+ print "<style> TD.under {font-family: arial, helvetica, sans-serif;font-size: 7pt;font-weight: bold;vertical-align: top;} .underhref {font-size: 7pt;} BIG {font-size: 14pt;font-weight: bold;} /* name */ NOBR B {font-size: 12pt;color: #207025;} /* ip,counter */ EM {font-size: 9pt;font-style: normal;} /* + for new */ A EM.emplus, EM.emplus {color: #cc0000;font-weight: bold;font-size: 13pt;} DIV {PADDING-LEFT: 25px;} DD DL{margin-left:-15px;} A:link {text-decoration: none;} A:visited {text-decoration: none;} A:active {text-decoration: none;} A:hover {text-decoration: none;} </STYLE>";
+ print "<meta http-equiv=\"Pragma\" content=\"no-cache\">";
+ print "</head><body BGCOlOR=\"#f0f0f0\" TEXT=\"#000000\" vlink=\"#000088\">";
+# print "<center><map name=\"topnav1\"><area shape=rect coords=\"654,8,738,30\" href=\"http://www.rt.mipt.ru/\"></map><map name=\"topnav2\"><area shape=rect coords=\"140,0,229,14\" href=\"http://www.rt.mipt.ru/cgi-bin/people/index.cgi\" alt=\"Пользователи\"><area shape=rect coords=\"233,0,264,14\" href=\"http://www.rt.mipt.ru/net.shtml\" alt=\"Сеть\"><area shape=rect coords=\"269,0,324,14\" href=\"http://www.rt.mipt.ru/res.html\" alt=\"Ресурсы\"><area shape=rect coords=\"327,0,406,14\" href=\"/\" alt=\"Конференция\"><area shape=rect coords=\"409,0,449,14\" href=\"http://www.rt.mipt.ru/study.html\" alt=\"Учеба\"><area shape=rect coords=\"452,0,493,14\" href=\"http://games.mipt.ru/\" alt=\"Игры\"><area shape=rect coords=\"497,0,550,14\" href=\"http://www.rt.mipt.ru/~dean/news/\" alt=\"Деканат\"><area shape=rect coords=\"555,0,604,14\" href=\"http://www.rt.mipt.ru/links.html\" alt=\"Ссылки\"></map><map name=\"botnav1\"><area shape=rect coords=\"29,0,48,18\" href=\"http://www.rt.mipt.ru/\" alt=\"Home\"><area shape=rect coords=\"59,0,82,18\" href=\"http://train.mipt.ru/\"><area shape=rect coords=\"91,0,110,18\" href=\"http://www.rt.mipt.ru/smap.html\"><area shape=rect coords=\"118,0,140,18\" href=\"http://www.rt.mipt.ru/metro.html\"><area shape=rect coords=\"195,3,264,16\" href=\"http://www.rt.mipt.ru/cgi-bin/people/index.cgi\" alt=\"Пользователи\"><area shape=rect coords=\"268,3,293,16\" href=\"http://www.rt.mipt.ru/net.shtml\" alt=\"Сеть\"><area shape=rect coords=\"296,3,340,16\" href=\"http://www.rt.mipt.ru/res.html\" alt=\"Ресурсы\"><area shape=rect coords=\"343,3,403,16\" href=\"/\" alt=\"Конференция\"><area shape=rect coords=\"407,3,437,16\" href=\"http://www.rt.mipt.ru/study.html\" alt=\"Учеба\"><area shape=rect coords=\"441,3,472,16\" href=\"http://games.mipt.ru/\" alt=\"Игры\"><area shape=rect coords=\"476,3,517,16\" href=\"http://www.rt.mipt.ru/~dean/news/\" alt=\"Деканат\"><area shape=rect coords=\"520,3,560,16\" href=\"http://www.rt.mipt.ru/links.html\" alt=\"Ссылки\"><area shape=rect coords=\"626,0,719,18\" href=\"mailto:bbsadmin\@rt.mipt.ru\"></map>";
+# print "<img src=\"/images/1board.gif\" border=0 width=750 height=35 usemap=#topnav1><br><img src=\"/images/subline.gif\" border=0 width=750 height=20 usemap=#topnav2><br>";
+# print "<table BORDER=0 CELLSPACING=0 CELLPADDING=1 BGCOLOR=\"#dfdfdf\"><tr><td ALIGN=CENTER><small>[ <a HREF=\"/?form\">Новое сообщение</a> | <a HREF=\"/?search=form\">Поиск</a> | <a HREF=\"/?configure=form\">Настройки</a> | <a HREF=\"/?resetnew\">Убрать все плюсы</a> | <a HREF=\"/?register=form\">Ваш профайл</a> | <a HREF=\"/?userlist\">Пользователи</a> | <a HREF=\"/?help\">Справка</a> | <a HREF=\"/rules.html\" target=_blank>Правила</a> | <a HREF=\"/?persmsg\">Приват</a> | <a HREF=\"/?globann=form\">Добавить анонс</a> ]</small></td></tr></table><br><br><br></center>";
+
+
+}
+
+sub footer{
+ print "<center><img src=\"/images/botnav.gif\" border=0 width=750 height=23 usemap=#botnav1><br><table width=750 border=0><tr><td align=left class=under>Сервер создан студентами ФРТК.</td>";
+ print "<td align=center class=under>PT Форум создан на движке <a STYLE=\"text-decoration:underline;\" href=\"http://2ka.mipt.ru/~www/\" TARGET=\"_blank\">WWWConf 2.0 PRE BETA2</a>, поддерживается и модерируется группой <a STYLE=\"text-decoration:underline;\" href=\"http://board.rt.mipt.ru/authors.html\">энтузиастов</a>.</td>";
+ print "<td align=right class=under>Apache inside!</td></tr></table></center>";
+ print "</body></html>\n";
+}
+
+
+sub view{
+ print "<center><H4>КОГДА БАНИТЕ ПИШИТЕ ДАТУ !!!</H4><table width=\"80%\"><tr><td align=\"center\">";
+ print "<form action=\"$edit_url?save\" method=post>\n";
+ if ( $input{action} == 'edit' ){
+ print "<textarea name=banlist rows=30 cols=70 wrap=soft>\n";
+ foreach $line (@ban_list){
+ print $line;
+ }
+ print "</textarea><br><INPUT type=submit name=submit value=Save> \n";
+ print "<br></td></tr></table></center> \n";
+ }
+
+}
+
+sub save{
+ if ($input{banlist}){
+ open (BAN_LIST, ">$ban_list") || print "Can\'t open ban list $ban_list \n";
+ print BAN_LIST $input{banlist};
+ close BAN_LIST;
+ print "<center><table width=\"80%\"><tr><td>";
+ print "<pre> $input{banlist} </pre><br><h2>Saved....</h2></td></tr>";
+ print "<tr><td align=center><form action=\"$edit_url\" method=post>\n";
+ print "<br><INPUT type=submit name=submit value=Edit></td></tr>";
+ print "</table></center> \n";
+ }else{
+ print "<h2><center>sent list is empty...mmm...mistake?!... not saved...</center><h2>";
+ }
+}
blob - /dev/null
blob + 74c2c2dfe9e499652b6528b9e20455e52645c378 (mode 755)
--- /dev/null
+++ contrib/rtboardreply.user.js
+// RTboard quick reply script
+// Based on LJ Instant Comment (below)
+// Version 0.2 2005-12-13
+// Ported by demon
+//
+//
+// LJ Instant Comment
+// version 0.6
+// 2005-08-23
+// Copyright (c) 2005, Tim Babych
+// Homepage: http://clear.com.ua/projects/firefox/instant_comment
+// Released under the GPL license
+// http://www.gnu.org/copyleft/gpl.html
+//
+// --------------------------------------------------------------------
+//
+// This is a Greasemonkey user script.
+//
+// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/
+// Then restart Firefox and revisit this script.
+// Under Tools, there will be a new menu item to "Install User Script".
+// Accept the default configuration and install.
+//
+// To uninstall, go to Tools/Manage User Scripts,
+// select "Ctrl+Enter Submits", and click Uninstall.
+//
+// --------------------------------------------------------------------
+//
+// ==UserScript==
+// @name RtBoard Reply
+// @description Allows replying on rtboard
+// @include http://board.rt.mipt.ru/*
+// @include http://zlo.rt.mipt.ru/*
+// ==/UserScript==
+
+ // cyrillic quotes
+ _smart_quotes_regexp = '$1\u00ab$2\u00bb$3'
+
+ // latin quotes
+// _smart_quotes_regexp = '$1\u201c$2\u201d$3'
+
+//================================
+// WORKHORSES
+//================================
+
+// triggerd by clicking Instant Comment link
+function want_reply(){
+
+
+
+ dd = document.getElementById('quick_reply')
+
+ if (dd.getAttribute('caller_entry_id') == this.id) // hide-unhide
+ if (dd.style.display == 'block' ) {
+ hide_div(dd)
+ return
+ } else
+ dd.style.display = 'block'
+ else {
+ // insert it in da new place
+ Xwidth = 350
+ Xshift = 170
+ Xcoord = findPosX(this)
+ Xwindow = document.body.clientWidth
+
+ dd.style.left = (Xcoord - Xshift) + "px"
+ if(Xcoord < Xshift) dd.style.left = 0
+ if(Xcoord + Xwidth - Xshift > Xwindow) dd.style.left = (Xwindow - Xwidth - 20) + "px"
+
+
+ dd.style.top = (findPosY(this) + 20) + "px"
+ dd.setAttribute('caller_entry_id', this.id)
+ dd.firstChild.value = ''
+ dd.style.display = 'block'
+ }
+
+ // workaround near firefox 1.0 bug with focus()
+ hScroll = window.pageXOffset; vScroll = window.pageYOffset
+ dd.firstChild.focus()
+ window.scrollTo(hScroll, vScroll)
+}
+
+// triggered when user presses Ctrl+Enter
+function trigger_submit_on_ctrl_enter(e) {
+ //hide on Esc
+ if (e.keyCode==27) {
+ hide_div(this.parentNode)
+ }
+
+ // not enter and (ctrl or alt)
+ if (! (e.keyCode==13 && (e.ctrlKey || e.altKey)))
+ return
+
+
+ qsubj = document.getElementById('quick_subj')
+ msgsubj = zakavych(qsubj.value)
+ msgsubj = EscapeToWin(msgsubj)
+ qsubj.value = ''
+
+ qbody = document.getElementById('quick_body')
+ msgbody = zakavych(qbody.value)
+ msgbody = EscapeToWin(msgbody)
+ qbody.value = ''
+
+
+ reply = document.getElementById(this.parentNode.getAttribute('caller_entry_id'))
+ reply.style.border = "3px solid rgb(0,250,0)"
+ reply.style.padding = "3px"
+ reply.setAttribute('mycolor', 200)
+ reply.setAttribute('step', -5)
+
+
+ fading = function(){
+ elem = reply
+ mycolor = parseInt(elem.getAttribute('mycolor'))
+ step = parseInt(elem.getAttribute('step'))
+ if ( mycolor> 250)
+ step -= 5
+ if ( mycolor < 50)
+ step += 5
+ mycolor += step
+ elem.style.borderColor = "rgb("+mycolor+", 250,"+mycolor+")"
+ elem.setAttribute('mycolor', mycolor)
+ reply.setAttribute('step', step)
+ //GM_log("rgb("+mycolor+", 250,"+mycolor+")")
+ }
+
+
+ anim = window.setInterval(fading, 15)
+ hide_div(this.parentNode)
+
+
+ GM_xmlhttpRequest({
+ method: 'POST',
+ url: 'http://' + window.location.hostname + '/?xpost=' + reply.getAttribute('msgid'),
+ headers: {
+ 'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
+ 'Content-type': 'application/x-www-form-urlencoded; charset=cp1251',
+ 'Referer' : 'http://' + window.location.hostname + '/?read=' + reply.getAttribute('msgid')
+ },
+ data: 'jpost=post&subject=' + msgsubj + '&body=' + msgbody ,
+ onload: function() {
+ window.clearInterval(anim);
+ reply.style.borderColor="green"
+ }
+ });
+
+}
+
+// hide input div, return focus to page
+function hide_div(div){
+ div.style.display = 'none'
+ div.firstChild.blur()
+}
+
+
+//================================
+// INIT
+//================================
+
+d = document.createElement('DIV')
+d.id = "quick_reply"
+d.setAttribute('caller_entry_id', false)
+d.innerHTML = "<input name='quick_subj' id='quick_subj' maxlength='99' /><br />" +
+ "<textarea name='quick_body' id='quick_body'></textarea><br />"+
+ "<small>Ctrl+Enter to post</small>"
+
+d.firstChild.addEventListener("keydown", trigger_submit_on_ctrl_enter, false);
+document.body.appendChild(d)
+
+document.getElementById('quick_body').addEventListener("keydown", trigger_submit_on_ctrl_enter, false);
+//--------------------------------------------------------
+
+get_itemid_regexp = /.*read=(\d+)/
+
+var allReplies
+allReplies = document.evaluate(
+ "//a[contains(@href, '?read=')]",
+ document,
+ null,
+ XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
+ null);
+for (var i = 0; i < allReplies.snapshotLength; i++) {
+ thisOne = allReplies.snapshotItem(i);
+
+ params = get_itemid_regexp.exec(thisOne.href)
+
+ a = document.createElement('a')
+
+ a.href = 'javascript:void(0)'
+ a.addEventListener("click", want_reply, false);
+ a.setAttribute('msgid', params[1])
+ a.id = 'reply_'+params[1]
+ linktxt = document.createTextNode('(r)')
+ a.appendChild(linktxt)
+
+ t = document.createTextNode(' -- ')
+
+ thisOne.parentNode.insertBefore(t, thisOne.nextSibling);
+ t.parentNode.insertBefore(a, t.nextSibling);
+}
+//-----------------------------------------------------------------------
+addGlobalStyle(
+"#quick_reply { position: absolute; display: none; border: 1px solid #999;"+
+" background: #ececec; padding: 1px; text-align: center; z-index:99}"+
+"#quick_reply textarea { width:350px; height:100px; min-height: 10px;"+
+" margin: 1px; border:1px solid #999; padding-left: 3px; background: white; }"+
+"#quick_reply textarea:focus { border:1px solid black; }"+
+"#quick_reply small { color:#999; font: 10px Arial }"+
+"#quick_reply input { width:350px;"+
+" margin: 1px; border:1px solid #999; padding-left: 3px; background: white; }"+
+"#quick_reply input:focus { border:1px solid black; }"
+
+)
+//-----------------------------------------------------------------------
+get_user_from_cookie = /RTBB=name(\w+)|.*|seq=(\w+).*/
+if (matches = get_user_from_cookie.exec(document.cookie))
+ cookieuser = matches[1]
+else
+ cookieuser = false
+
+//====================================
+// ROUTINES
+//====================================
+
+function findPosX(obj) {
+ var curleft = 0;
+ if (obj.offsetParent) {
+ while (obj.offsetParent) {
+ curleft += obj.offsetLeft
+ obj = obj.offsetParent;
+ }
+ }
+ return curleft;
+}
+
+function findPosY(obj) {
+ var curtop = 0;
+ if (obj.offsetParent) {
+ while (obj.offsetParent) {
+ curtop += obj.offsetTop
+ obj = obj.offsetParent;
+ }
+ }
+ return curtop;
+}
+
+function addGlobalStyle(css) {
+ style = document.createElement('STYLE');
+ style.type = 'text/css';
+ style.innerHTML = css;
+ document.body.appendChild(style);
+}
+
+function zakavych(text) {
+
+ replacements = [
+
+
+
+ ];
+
+ s = text
+ for( i=0; i < replacements.length; i++) {
+ s = s.replace(replacements[i][0], replacements[i][1])
+ }
+
+ return s
+}
+
+ var Letters=new Array('%C0','%C1','%C2','%C3','%C4','%C5','%C6','%C7','%C8','%C9','%CA','%CB','%CC','%CD','%CE','%CF',
+ '%D0','%D1','%D2','%D3','%D4','%D5','%D6','%D7','%D8','%D9','%DA','%DB','%DC','%DD','%DE','%DF','%E0','%E1',
+ '%E2','%E3','%E4','%E5','%E6','%E7','%E8','%E9','%EA','%EB','%EC','%ED','%EE','%EF','%F0','%F1','%F2','%F3',
+ '%F4','%F5','%F6','%F7','%F8','%F9','%FA','%FB','%FC','%FD','%FE','%FF','%A8','%B8');
+
+
+function EscapeToWin(AStr){
+
+ var Result='';
+ for(var i=0;i<AStr.length;i++)
+
+ if(AStr.charCodeAt(i) >= 1040 && AStr.charCodeAt(i) <= 1103)
+ Result+=Letters[AStr.charCodeAt(i)-0x0410];
+ else if(AStr.charCodeAt(i)==1105)
+ Result+=Letters[65];
+ else if(AStr.charCodeAt(i)== 1025)
+ Result+=Letters[64];
+ else if(AStr.charAt(i)=='=')
+ Result+='%3D';
+ else if(AStr.charAt(i)=='&')
+ Result+='%26';
+ else if(AStr.charAt(i)=='\n')
+ Result+='%0A%0D';
+ else if(AStr.charAt(i)=='+')
+ Result+='%2B';
+ else if(AStr.charAt(i)=='%')
+ Result+='%25';
+ else
+ Result+=AStr.charAt(i);
+ return Result;
+}//EscapeToWin
+