Recent posts by rainworm

Subscribe to Recent posts by rainworm 31 posts found

Mar 10, 2008
rainworm 31 posts

Topic: Script development / gm_setValue problems

Yes I was refering to that post.

 
Mar 10, 2008
rainworm 31 posts

Topic: Script development / gm_setValue problems

descriptor: your solution does work. Thank you.

 
Mar 9, 2008
rainworm 31 posts

Topic: Script development / gm_setValue problems

descriptor: I tried as you said... but I'm not sure that i did correct as this is still not working;

Now I have this code (I added some comments for easier help);

function ustvari_piskotek(name, value){
GM_setValue(name, encodeURIComponent(value));
}

function preberi_piskotek(name){
return decodeURIComponent(GM_getValue(name, ""));
}

//i get the value from textarea
vsebina = document.getElementById('vsebina').value;

//I alert it to the screen
alert('vsebina1: '+vsebina);
//i get: vsebina1: preentered value from textarea

//I then alert the following
alert('piskotek: '+preberi_piskotek('HTvsebina'));
//since the value has not been set I get: piskotek: undefined

//the I check that "piskotek" is not '' and not undefinet..
if (preberi_piskotek('HTvsebina') != '' && preberi_piskotek('HTvsebina') != 'undefined') {
//If it's not.. I read the value from "piskotek" and variable vsebina gets it's value
vsebina = preberi_piskotek('HTvsebina');
}

//I alert "vsebina" to screen
alert('vsebina2: '+vsebina);
//and the firt time I get: vsebina2: preentered value from textarea (this is OK)
//the second time I get: vsebina2: new value1 (this is OK)
//the third time I get: vsebina2: new value1 (this is not OK... I should get 'vsebina2: new value2' as 'vsebina2: new value2' was the textarea value when I clicked the button)

//I then enter the new value to textarea
document.getElementById('vsebina').value = vsebina;

//this is the button with event listener.. by clicking it the value of textarea should be set as new value
document.getElementById('gumb').addEventListener('click', function() {ustvari_piskotek('HTvsebina',document.getElementById('vsebina').value); alert('Notes are saved!');})

so once again;
value for 'HTvsebina' is set only the first time I press the button..

Descriptor: can you please be more specific about the solution to my problem.. perhaps you can provide the correction of my source?

 
Mar 9, 2008
rainworm 31 posts

Topic: Script development / gm_setValue problems

gollum: I did that (was mentioned in the post) but itdidn't help.

 
Mar 9, 2008
rainworm 31 posts

Topic: Script development / gm_setValue problems

Thank you The dot for reply but this isn't helping. The result is the same.

So the question still remains;
Why the GM_setValue called for the second time for the same value name with different value doesn't work.
The value is as it was set for the first time the GM_setValue was used.

 
Mar 8, 2008
rainworm 31 posts

Topic: Script development / gm_setValue problems

I have this two functions..

function ustvari_piskotek(name, value){
GM_setValue(name, encodeURIComponent(value));
}

function preberi_piskotek(name){
return decodeURIComponent(GM_getValue(name, ""));
}

and when I set the value with

vsebina = document.getElementById('vsebina').innerHTML;
if (preberi_piskotek('HTvsebina') != '') {
vsebina = preberi_piskotek('HTvsebina');
}
document.getElementById('vsebina').innerHTML=vsebina;

document.getElementById('gumb').addEventListener('click', function() { ustvari_piskotek('HTvsebina',document.getElementById('vsebina').innerHTML); alert('Notes are saved!');}, 0);

The value is set only for the first time...
When I try to set the value for the second time, the value from the first time is still there..

I tried reseting the variable value with about:config but didn't help.

I sthere some kind of gm_clearValue(name)?
Or what is the solution for my problem?

 
Mar 8, 2008
rainworm 31 posts

Topic: Script development / removing complete table row without specefic class

what about something like;

all_tds = document.getElementsByTagName('td');
for (i=0;i<all_tds>
if (all_td[i].indexOf('class="PhorumListSubjPrefix">Sticky')>-1) {
all_tds[i].style.display = 'none';
}
}

 
Mar 3, 2008
rainworm 31 posts

Topic: Script development / Pictures - how to?

even shorter example;

<img src="http://www.hattrick.org/Common/Images/Faces/bg.gif" style="z-index: 0; position: absolute;">
<img src="http://www.hattrick.org/Common/Images/Faces/RA01/faces/FA02HU01HA03HC03FH02.gif" style="z-index: 1; position: absolute;">
<img src="http://www.hattrick.org/Common/Images/Faces/RA01/eyes/EY07.gif" style="z-index: 2; position: absolute;">
<img src="http://www.hattrick.org/Common/Images/Faces/RA01/noses/NO08.gif" style="z-index: 3; position: absolute;">
<img src="http://www.hattrick.org/Common/Images/Faces/RA01/mouths/MO04HC00.gif" style="z-index: 4; position: absolute;">

 
Mar 3, 2008
rainworm 31 posts

Topic: Script development / Pictures - how to?

Thank you. This is what I call a good hint.

here is source if anyone will ever have the same problem;

<div id="d1" style="width:47; height:49; position:absolute; )!">
<img src="http://www.hattrick.org/Common/Images/Faces/bg.gif" style="z-index: 0;">
</div>
<div id="d2" style="width:47; height:49; position:absolute;)!">
<img src="http://www.hattrick.org/Common/Images/Faces/RA01/faces/FA02HU01HA03HC03FH02.gif" style="z-index: 1;">
</div>
<div id="d3" style="width:47; height:49; position:absolute;)!">
<img src="http://www.hattrick.org/Common/Images/Faces/RA01/eyes/EY07.gif" style="z-index: 2;">
</div>
<div id="d4" style="width:47; height:49; position:absolute;)!">
<img src="http://www.hattrick.org/Common/Images/Faces/RA01/noses/NO08.gif" style="z-index: 3;">
</div>
<div id="d5" style="width:47; height:49; position:absolute;)!">
<img src="http://www.hattrick.org/Common/Images/Faces/RA01/mouths/MO04HC00.gif" style="z-index: 4;">
</div>

 
Mar 3, 2008
rainworm 31 posts

Topic: Script development / Pictures - how to?

Hello,

I am trying to modify my script a little bit.. and have stumbled into a problem to which I can't find an answer myself and am therefore bugging you here.

Long story short;
I have 5 gifs..
Here are the links to those .gifs
http://www.hattrick.org/Common/Images/Faces/bg.gif (background)
http://www.hattrick.org/Common/Images/Faces/RA0... (face)
http://www.hattrick.org/Common/Images/Faces/RA0... (eyes)
http://www.hattrick.org/Common/Images/Faces/RA0... (nose)
http://www.hattrick.org/Common/Images/Faces/RA0... (mouth)

Now I would like to put those pictures on top one another so I could get one whole picture.
(I need to do this programmable not with graphic program).

Can somebody please help me/provide the source/give me a hint ?

 
Feb 28, 2008
rainworm 31 posts

Topic: Script development / Help with personal script?

You simulate the button press by submitting the form.

 
Feb 28, 2008
rainworm 31 posts

Topic: Script development / Help with personal script?

Here is simple confirmation dialog you can use;

if (confirm("Are you sure you want to restart?")) {
document.form.submit();
}

I hope this helps.

 
Feb 28, 2008
rainworm 31 posts

Topic: Userscripts.org discussion / Subscribing Comments

I wouldn't want to recieve any mail for new comments..
I think monitored posts do their job.
But it would be nice if people could choose :)

 
Feb 28, 2008
rainworm 31 posts

Topic: Script development / frames

OK, I'll do that

 
Feb 27, 2008
rainworm 31 posts

Topic: Userscripts.org discussion / how to stop monitoring monitored posts?

OK, thanks

 
Feb 27, 2008
rainworm 31 posts

Topic: Userscripts.org discussion / how to stop monitoring monitored posts?

Is there bug or is it only me who can't stop monitoring monitored posts and has a feelng that checkbox doesn't seem to work?

 
Feb 26, 2008
rainworm 31 posts

Topic: Script development / Can somebody please help me

My team isn't doing well either. We were 5th in our league last season. But we won't give up and neither should you ;)

 
Feb 26, 2008
rainworm 31 posts

Topic: Script development / frames

Hello,

OK.. now that I have written my very first greasemonkey script, I would like to extend it a little more.
And here I came across a question;

If the site where script is running, is using frames and one of many functions in script could be used in another frame is there any possability for me to include only that part of script?
Is there some @include_function or something like that?

 
Feb 26, 2008
rainworm 31 posts

Topic: Userscripts.org discussion / Problems with the server?

There is no need for you to be sorry. You helped a lot.
I'm not sure I would like to see the monkey pants off:)

 
Feb 26, 2008
rainworm 31 posts

Topic: Script development / Can somebody please help me

You don't have to.. let it be written in the history :)

 
Feb 26, 2008
rainworm 31 posts

Topic: Script development / Can somebody please help me

ha! I even corrected the mistake now ;)

 
Feb 26, 2008
rainworm 31 posts

Topic: Userscripts.org discussion / Problems with the server?

You were wright... it's the ANSI that gives the server problems.
I saved the script as UTF-8 and no problems uploading.

 
Feb 26, 2008
rainworm 31 posts

Topic: Userscripts.org discussion / Problems with the server?

I use no such security program. But it is strange that only I get this error since the 500 Internal Server Error is a very general HTTP status code that means something has gone wrong on the web site's server but the server could not be more specific on what the exact problem is.
The server log would probably show more details on what went wrong.

 
Feb 26, 2008
rainworm 31 posts

Topic: Userscripts.org discussion / Problems with the server?

I now tried to enter the script manualy and it was successfuly added.
It looks like only upload from file doesn't work.

 
Feb 26, 2008
rainworm 31 posts

Topic: Userscripts.org discussion / Problems with the server?

I also tried using IE and I got the same result.