/* *  This program is free software: you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation, either version 3 of the License, or *  (at your option) any later version. * *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * * You should have received a copy of the GNU General Public License *  along with this program.  If not, see <http://www.gnu.org/licenses/>. */
String.prototype.tr = function(from, to) {	var fromChars = from.split("");	var toChars = to.split("");	var mapTable = {};	for(i = 0; i < fromChars.length; i++) {
		var c = i < toChars.length ? toChars[i] : "";
		mapTable[fromChars[i]] = c;	}
	var str = this;	var re = new RegExp("[" + fromChars.join("") + "]", "g");	str = str.replace(re, function(c) {		return mapTable[c];	});
	return str;
};
var show_blip = function(b) {	var blipre=new RegExp("(http://blip.pl/s/\\d+)", "g");	var linkre=new RegExp("(http://rdir.pl/[A-Za-z0-9]+)", "g");	var tagre=new RegExp("#[a-z0-9ąćęłńóśźż\-]+", "gi");	var nickre=new RegExp("\\^([a-z0-9]+)", "gi");	var blipblock=document.getElementById('blipcontent');	var blipentries=document.createElement('ul');	for (var i=0; i < b.length; i++) {		var body=b[i].body;		body=body.replace(tagre, function(t) {			t=t.substr(1);			var plt = t.tr("ąćęłńóśźż", "acelnoszz");			return '<a href="http://blip.pl/tags/'+ plt +'">#'+ t +'</a>';		});		body=body.replace(nickre, '<a href="http://$1.blip.pl">^$1</a>');		body=body.replace(blipre, '<a href="$1">[blip]</a>');		body=body.replace(linkre, '<a href="$1">[link]</a>');        var li = document.createElement('li');		li.setAttribute('id', b[i].id);        li.setAttribute('class', 'blipstatus');
        dateel = document.createElement('span');        dateel.innerHTML = b[i].created_at;        dateel.setAttribute('class','statusdate');        contentel = document.createElement('span');        contentel.innerHTML = body;        contentel.setAttribute('class','statuscontent');        li.appendChild(dateel);        li.appendChild(contentel);		blipentries.appendChild(li);	}	blipblock.appendChild(blipentries);};
