Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

Stinky666

Stinky666 Avatar

****
Senior Member

422


December 2009
Is there no way to make it so that, when you highlight lines of text and you then click to use the "Insert List" UBBC, it automatically adds a [/li][li] per line?

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
You'd have better luck getting PB itself to implement that. :P

Stinky666

Stinky666 Avatar

****
Senior Member

422


December 2009
Chris Avatar
You'd have better luck getting PB itself to implement that. :P


And how would one suggest I go about asking/telling/suggesting it to them?
Unless someone else can do it ;D

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Support board. :P they probably aren't gonna add it to v4.5 though.

Stinky666

Stinky666 Avatar

****
Senior Member

422


December 2009
You can suggest stuff via the Support board?

Eric

Eric Avatar



1,442


November 2005
Chris meant like an actual feature request.

Stinky666

Stinky666 Avatar

****
Senior Member

422


December 2009
Yeah, a code request wouldn't really help.
I really doubt Chris would add a code made by someone else, on here, SZ.

Lucifer

Lucifer Avatar

*******
Mythical Studio Member

Eunuch
5,665


August 2005
xmsteel Avatar
Eric Avatar
Chris meant like an actual feature request.



I figured that, but that was the only thing I could find that was close... LOL


I also laughed out loud...






...LOL

Andrew McGivery

Andrew McGivery Avatar
Formerly Fredy

******
Legendary Studio Member

Male
5,742


September 2005
I just wrote a greasemonkey script to do this. However, I currently don't have a host available, so here is the code XD

Maybe chris will be nice enough to host it xP


// ==UserScript==
// @name           Proboards UBBC Mod
// @namespace      Andrew McGivery
// @description    modifies the proboards ubbc to work with highlighted text.
// @include        *proboards*
// @include        *forum.sz-ex.com*
// ==/UserScript==

if(location.href.match(/action=post/)){
function listFunction(){
var textarea = document.getElementsByTagName('textarea');
var selectedText;
for(i=0;i<textarea.length;i++){
if(textarea[i].name=="message"){
var startPos = textarea[i].selectionStart;
var endPos = textarea[i].selectionEnd;
selectedText = textarea[i].value.substring(startPos, endPos)
if(selectedText != ""){
newText = selectedText.replace(new RegExp( "\\n", "g" ),'\n[/li][li]');
newText = "[ul]\n[li]"+newText+"\n[/li][/ul]";
textarea[i].value = textarea[i].value.replace(selectedText,newText);
} else {
textarea[i].value = textarea[i].value.replace(selectedText,'[ul]\n[li]\n[/li][li]\n[/li][li]\n[/li][/ul]');
//add("[ul]\n[li]","\n[/li][li]\n[/li][li]\n[/li][/ul]")
}
}
}
}

var images = document.getElementsByTagName('img');
for(i=0;i<images.length;i++){
if(images[i].title=="Insert List"){
images[i].addEventListener('click',listFunction,false);
images[i].parentNode.href = "javascript: void('0')";
break;
}
}
}


ps: if you don't use firefox, but you use chrome, grease monkey scripts will also work in chrome. :P
k

Stinky666

Stinky666 Avatar

****
Senior Member

422


December 2009
Today is mine and your unlucky day, because I use Opera. :P

Andrew McGivery

Andrew McGivery Avatar
Formerly Fredy

******
Legendary Studio Member

Male
5,742


September 2005
k

Stinky666

Stinky666 Avatar

****
Senior Member

422


December 2009
Right I think I'm just retarded but, I don't see where it is etc.
I saved that in a notepad file (nto sure if you're meant to?) and named it NAME.user.js, stuck that in a folder and in the Tools ? preferences > etc for Opera, I chose that folder for the directory. If that's all correct, where should the script be located in Opera?

I've most likely done all of it wrong, but I have no clue so it was all guess work :P

Andrew McGivery

Andrew McGivery Avatar
Formerly Fredy

******
Legendary Studio Member

Male
5,742


September 2005
I just followed the same set of instructions on my opera, and the script works :P

to test, to to reply, make like 3 lines of text, highlight, and click the list button :P

should work if you did it right :P

note: You don't have to activate the script or anything. It just worked as soon as you install it :P


Last Edit: Feb 11, 2011 12:00:35 GMT by Andrew McGivery
k

Stinky666

Stinky666 Avatar

****
Senior Member

422


December 2009
I really did something wrong then. Doesn't work for me haha.

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Stinky666 Avatar
I really did something wrong then. Doesn't work for me haha.


Typical Stinky. [/trolling]

newBookmarkLockedFalling