/    Sign up×
Community /Pin to ProfileBookmark

Some javascript help please

Ok… I basically edited a javascript script that i picked from somewhere and put it on userscripts so others could use it too..

However, lately, it has either broken down or the original page changed codes..

This is the original code of the script:

[CODE]// ==UserScript==
// @name Rapidshare Collectors Zone Tweak
// @namespace rapidshare
// @description Rapidshare Collectors Zone Tweak
// @include https://ssl.rapidshare.com/cgi-bin/collectorszone.cgi*
// @include https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi*
// ==/UserScript==

// Add jQuery
var GM_JQ = document.createElement(‘script’);
GM_JQ.src = ‘http://jquery.com/src/jquery-latest.js’;
GM_JQ.type = ‘text/javascript’;
document.getElementsByTagName(‘head’)[0].appendChild(GM_JQ);

// Check if jQuery’s loaded
function GM_wait(){
if (typeof unsafeWindow.jQuery == ‘undefined’) {
window.setTimeout(GM_wait, 100);
}
else {
$ = unsafeWindow.jQuery;
main();
}
}

GM_wait();

// All your GM code must be inside this function
function main(){

$(‘h1’).text( $(‘h1’).text() + ‘ [Improved]’).attr(“style”,”color: teal;”);

/************* MAIN PAGE ***************/
if (document.location.href == ‘https://ssl.rapidshare.com/cgi-bin/collectorszone.cgi’)
if (document.location.href == ‘https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi’) {
$(“center”).attr(“style”,”text-align:left; margin-left: 250px;”);
$(“<div id=’dl_list’ style=’position: fixed; width: 240px; font-size:10px; overflow: auto; top: 0px; height: 100%; left: 0px; background-color: #000000; color: #ffffff; border-right: 5px solid #ccc;’></div>”).appendTo(“body”).fadeTo(0, 0.7);
$(‘div.fliste td a:nth-child(1)’).each(function(){
$(“#dl_list”).append($(this).attr(“href”) + “<br/>”);
});
}

/************* MAIN PAGE:END ***************/

/************* REMOTE UPLOAD PAGE ***************/
if (document.location.href != ‘https://ssl.rapidshare.com/cgi-bin/collectorszone.cgi?remotegets=1’)
if (document.location.href != ‘https://ssl.rapidshare.com/cgi-bin/collectorszone.cgi?urls=&remotegets=1’)
if (document.location.href != ‘https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi?remotegets=1’)
if (document.location.href != ‘https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi?urls=&remotegets=1’)
return; // Not remote upload page, do not continue
// Mass delete
$(“input[@type=’button’]”).parent(‘div’).prepend($(“<button id=’tw_massdel’>Delete All</button>”));
$(‘button#tw_massdel’).click(function(){
if (confirm(“Are you sure you want to delete all the jobs?”)) {
$(“button”).attr(“disabled”, “disabled”);

$(“.dtabelle a”).each(function(i, a){
var self = $(this);
var id = $(this).attr(‘href’).split(“‘”)[1];
var param = “remotegets=1&killjobs=1&killjob-” + id + “=1”;
$.ajax({
type: “POST”,
data: param,
success: function(html){ // Let’s parse the response!
self.parents(‘tr’).empty();
}
});

});
}
});

/************* REMOTE UPLOAD PAGE:END ***************/

}[/CODE]

And this is the new page where it is trying to ‘integrate’

[CODE]<script type=”text/javascript”>
<!–
function formsenden(name)
{
document.getElementById(“fh_feld”).name = name;
document.getElementById(“fh”).submit();
return false;
}
//–>
</script>
<form id=”fh” action=”https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi” method=post>
<input id=”fh_feld” type=”hidden” value=1 name=”” />
</form>

<h1>Premium-Zone
| Remote-Uploads</h1>
<div class=”klappbox”>
<p>With Remote Upload you can copy files quickly and easily from other servers directly into your Premium sector.</p>
<h2>Add Link</h2>

<p>You have currently saved <b>0</b> of up to 30 copy jobs. A file should not be larger than 210,000,000 bytes (200 Megabytes).</p>
<form method=”post”>
<input type=”hidden” name=”remotegets” value=”1″>
Link (http:// or ftp://):<br />
<textarea name=”urls” cols=70 rows=10></textarea>
<div style=”text-align:right;padding-top:5px;”><input type=”submit” value=”Add”></div>
</form>
<h2>Remote Upload list</h2>

<div style=”text-align:right;padding-bottom:20px;”><input type=”button” onclick=”window.location.href=’?urls=&remotegets=1′” value=”Refresh page”></div>
<table class=”dtabelle” width=”100%”>
<tr>
<th>Link</th>
<th>Status</th>
<th width=70 style=”text-align:center;”>Size</th>
<th width=70></th>
</tr>
<tr><td colspan=4 style=”border-top:1px solid black;”></td>

</table>
<form id=”formular” method=”post”>
</form>
<script type=”text/javascript”>
<!–
function loeschfragen(id, status)
{
if (status == 0 || status == 1 || status == 4) {
alert(“This entry cannot yet be deleted”);
} else {
if(confirm(“Are you sure you want to delete?”)) {
var elem = document.getElementById(“formular”);
elem.innerHTML += “<input type=’hidden’ name=’remotegets’ value=’1′>”;
elem.innerHTML += “<input type=’hidden’ name=’killjobs’ value=’1′>”;
elem.innerHTML += “<input type=’hidden’ name=’killjob-“+id+”‘ value=’1’>”;
elem.submit();
}
}
}
//–>[/CODE]

Basically, the script is trying to append a button ‘Delete All’ in the host page.. but it is not working anymore… any idea why?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@MrNobodyJan 18.2009 — I see nothing coded to execute your JavaScript functions.
Copy linkTweet thisAlerts:
@lifetalkauthorJan 18.2009 — Actually this script is a greasemonkey script from userscripts.org

and as such, is meant to automatically execute once the page defined within the script is loaded..
×

Success!

Help @lifetalk spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...