Talk:Bookmarklets Discussion View history

(Created section)
 
(first viewable code entered)
Line 1: Line 1:
== Expanded views ==
These expanded view scripts serve as the source for the scripts on [[Bookmarklets]]. Be sure when updating any of the scripts on that page that the update is first done with this code and then pass the code through the a Javascript compressor like [http://javascriptcompressor.com/ this one] and then paste that result into the main page.
=== Display user's Wiki contributions ===
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word;">
javascript:(function(){
    var s = "";
    if (window.getSelection) {
        s = window.getSelection();
    } else if (document.getSelection) {
        s = document.getSelection();
    } else if (document.selection) {
        s = document.selection.createRange().text;
    }
    if (s == "") {
        var s = prompt("Enter Username for Wiki contributions (or highlight name before selecting bookmarklet).");
    }
    if ((s != "") && (s != null)) {
        window.location.href="http://wiki.waze.com/wiki/Special:Contributions/"+s;
    }
})();
</pre>
== Links for evaluation ==
== Links for evaluation ==


[http://javascriptcompressor.com/ Javascript Compressor] - takes formatted javascript and compresses it to remove unnecessary spaces.
[http://javascriptcompressor.com/ Javascript Compressor] - takes formatted javascript and compresses it to remove unnecessary spaces.

Revision as of 18:08, 5 June 2014

Expanded views

These expanded view scripts serve as the source for the scripts on Bookmarklets. Be sure when updating any of the scripts on that page that the update is first done with this code and then pass the code through the a Javascript compressor like this one and then paste that result into the main page.

Display user's Wiki contributions

javascript:(function(){
    var s = "";
    if (window.getSelection) {
        s = window.getSelection();
    } else if (document.getSelection) {
        s = document.getSelection();
    } else if (document.selection) {
        s = document.selection.createRange().text;
    }
    if (s == "") {
        var s = prompt("Enter Username for Wiki contributions (or highlight name before selecting bookmarklet).");
    }
    if ((s != "") && (s != null)) {
        window.location.href="http://wiki.waze.com/wiki/Special:Contributions/"+s;
    }
})();


Links for evaluation

Javascript Compressor - takes formatted javascript and compresses it to remove unnecessary spaces.