User:Qzekrom/js/copynotice.js

From Uncyclopedia, the content-free encyclopedia
Jump to navigation Jump to search

Note: After saving, you have to bypass your browser's cache to see the changes.

  • Internet Explorer: hold down the Ctrl key and click the Refresh or Reload button, or press Ctrl+F5.
  • Firefox: hold down the Shift key while clicking Reload; alternatively press Ctrl+F5 or Ctrl-Shift-R.
  • Opera, Konqueror and Safari users can just click the Reload button.
  • Chrome: press Ctrl+F5 or Shift+F5
/**
 * Inserts a custom copyright notice at the bottom of each page.
 * The named copyright holder is "Uncyclopedia", or if the page is in the userspace, the respective user.
 *
 * The format is defined as follows:
 *  - the sequence \C generates the English word "Copyright"
 *  - the sequence \c generates the copyright symbol
 *  - the sequence \y generates the current year
 *  - the sequence \u generates the name of the copyright holder. If the current page is in 
 *    the User: or User talk: namespaces, this will be the username. Otherwise, it will be
 *    "Uncyclopedia".
 *
 * Note that you do have to escape the backslashes.
 *
 * The copyright notice is inserted by adding to your personal JavaScript file: copynotice(format);
 *
 * ===========
 * (C) Qzekrom
 */

function copynotice(format) {

    format = format.replace("\\C", "Copyright").replace("\\c", "©").replace("\\y", new Date().getFullYear());

    var user;
    // TODO get the namespace and/or username

    var para = document.createElement("p");
}