Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function name() { // anonymous function wrapper, used for error checking to end execution
- 'use strict';
- // declare variables
- var admin, scriptID, extra, div, i;
- if(window.self !== window.top) return; // end execution if in a frame
- // get the "Admin" link's href
- admin = document.evaluate("//a[.='Admin' and @class='admin']/@href", document, null, 2, null).stringValue;
- // quit if the admin link is not found
- if(admin === "") return;
- // grab the script's ID
- scriptID = admin.match(/\/(\d+)/)[1];
- // define the new links to be added
- extra = {
- 'Edit Metadata' : '/scripts/edit/' ,
- 'Edit Code' : '/scripts/edit_src/',
- 'Upload New Version' : '/scripts/upload/' ,
- 'Screenshots & Icon' : '/scripts/images/' ,
- }
- // create a holder for the links
- div = document.createElement('div');
- div.setAttribute('style', 'color: #00f; margin-top: 6px;');
- div.innerHTML = '<b>Admin:</b> ';
- // add the new links to the holder
- for (i in extra) {
- div.innerHTML += '• <a href="'+ extra[i] + scriptID + '" style="text-decoration: none !important; color: #c00; margin-right: 6px;">' + i + '</a> ';
- }
- // add the holder containing the links to the page
- document.getElementById('details').appendChild(div);
- })(); // end of anonymous function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement