Greasemonkey Coppermine support script Greasemonkey Coppermine support script
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Greasemonkey Coppermine support script

Started by Nibbler, May 18, 2005, 03:47:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nibbler

This is a user script for the greasemonkey firefox extension. It adds the cpg version number and links to reset the theme+lang into the standard coppermine footer to save messing around with the source and adding things into the address bar.


// ==UserScript==
// @name          Coppermine Support script
// @description   Provides the version number of the Coppermine Gallery you are viewing, plus some misc support/debug tools.
// ==/UserScript==

(function() {
window.addEventListener("load", function(e) {
version = document.body.innerHTML.match(/<\!--Coppermine Photo Gallery (.*)-->/);

if (version){
divs = document.getElementsByTagName("div");
for (var i = divs.length-1 ; i >= 0; i--){
if (divs[i].className == 'footer') {
divs[i].innerHTML +=
'<p>Version: ' + version[1] + '</p>'
+ '<p>Theme & language: <a href="index.php?lang=xxx&theme=xxx">[Defaults]</a>'
+ '<a href="index.php?lang=english&theme=classic">[English + Classic]</a>';
return true;
}
}
}
  }, true);
})();


Suggestions welcome for further use of greasemonkey with coppermine.