skywalk wrote:Hey, I have a dumb question...
Is there a way to select the Code portion of a post without having to manually select everything?
I see buttons for this in other forums, just curious why it is not available on a coder's forum?
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
skywalk wrote:How to edit the "rs.pbf.codefold.user.js" script to copy the selection directly to the ClipBoard?
This is a security risk and not supported
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
In a later version, could it be possible to change the coloring system so we can just paste our color preferences from the IDE into the script?
Run the second code and you'll get your color settings of the IDE. Then just copy the result into the script file (edit it with rightclick in the script manager).
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
c4s wrote:One question though: When I saved the modified source code GreaseMonkey said something about "all scripts should use @grant". Is this important?
PureBasic 6.10 LTS (Windows x86/x64) | Windows10 Pro x64 | Asus TUF X570 Gaming Plus | R9 5900X | 64GB RAM | GeForce RTX 3080 TI iChill X4 | HAF XF Evo | build by vannicom
English is not my native language... (I often use DeepL to translate my texts.)
function PureBasicSyntaxHighlighting()
{
// Anwenden der Syntaxhervorhebung auf alle Elemente mit der Klasse codecontent
// apply the syntax highlighting on all the elements with class codecontent
var allMy_dl = document.getElementsByTagName('dl');
for(var i = 0; i < allMy_dl.length; i++)
{
if (allMy_dl[i].className == 'codebox')
{
var aCodeBox = allMy_dl[i].getElementsByTagName('code')[0];
if (PBSH_Highlight['EditorFontName'])
aCodeBox.style.font = PBSH_Highlight['EditorFontStyle']+" "+PBSH_Highlight['EditorFontSize']+"pt "+PBSH_Highlight['EditorFontName'];
if (PBSH_Highlight['BackgroundColor'])
aCodeBox.style.backgroundColor = PBSH_Highlight['BackgroundColor'];
if (PBSH_Highlight['NormalTextColor'])
aCodeBox.style.color = PBSH_Highlight['NormalTextColor'];
var code = ' '+aCodeBox.innerHTML+'\r';
code = code.replace(/<br>/gi, '\r\n');
code = code.replace(/ /gi, '\t');
code = code.replace(/<\/?[^<>]*>/gi, '');
code = code.replace(PBSH_Syntax, PBSH_Replace);
code = code.replace(/\t/gi, ' ');
code = code.replace(/\r\n/gi, '<br>');
aCodeBox.innerHTML = code;
}
}
}
I updated flaith's code for PB5.20 by adding "DeclareModule", "EndDeclareModule", "EndModule", "Module" and "Runtime". Furthermore I properly sorted the keywords and removed about 20 duplicates:
ts-soft wrote:With Firefox, if you have installed Greasemonkey, simple download the file. Firefox will prompt for installation.
Ok, so I installed GreaseMonkey (in Firefox), and installed the script. Nothing. I restarted FF. Still none of the code is highlighted. Am I missing something?
Here a complete pack of all required script.
Put this files in your gm_scripts dir of the greasemonkey-plugin (in Appdata/Modzilla/...).
It should show you all PB-Sources in blue-style , PB5.20 is supported.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
There are a long time, i use this super JS on my chome for select all the code in one clic http://www.purebasic.fr/english/viewtop ... 96#p347396
Now i try to install it another time and chrome disable it, and say to me contact the developper.
He must inscribe his code in Chrome Web Store for be sure it's not a malware
Decidedly..the more time passes, the more difficult it is to do what you want in my own explorer
Kwai chang caine wrote:He must inscribe his code in Chrome Web Store for be sure it's not a malware
Then do this, or use firefox.
If no one do this, i can't do this. I haven't chrome installed.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.