Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
####### # # Old e-scripts on JavaScript. The new ones are in js.e. # # Note 1: use the eev command (defined in eev.el) and the # ee alias (in my .zshrc) to execute parts of this file. # Executing this file as a whole makes no sense. # An introduction to eev can be found here: # # (find-eev-quick-intro) # http://angg.twu.net/eev-intros/find-eev-quick-intro.html # # Note 2: be VERY careful and make sure you understand what # you're doing. # # Note 3: If you use a shell other than zsh things like |& # and the for loops may not work. # # Note 4: I always run as root. # # Note 5: some parts are too old and don't work anymore. Some # never worked. # # Note 6: the definitions for the find-xxxfile commands are on my # .emacs. # # Note 7: if you see a strange command check my .zshrc -- it may # be defined there as a function or an alias. # # Note 8: the sections without dates are always older than the # sections with dates. # # This file is at <http://angg.twu.net/e/javascript.e> # or at <http://angg.twu.net/e/javascript.e.html>. # See also <http://angg.twu.net/emacs.html>, # <http://angg.twu.net/.emacs[.html]>, # <http://angg.twu.net/.zshrc[.html]>, # <http://angg.twu.net/escripts.html>, # and <http://angg.twu.net/>. # ####### # «.mozrepl» (to "mozrepl") # «.mozrepl-swf» (to "mozrepl-swf") # «.handling-other-protocols» (to "handling-other-protocols") # «.mozrepl-2011» (to "mozrepl-2011") # «.mozrepl-2020» (to "mozrepl-2020") # «.blogme» (to "blogme") # «.url-parts» (to "url-parts") # «.regexps» (to "regexps") # «.flipbooks» (to "flipbooks") # «.romai» (to "romai") # «.textarea-eval» (to "textarea-eval") # «.org-info-js» (to "org-info-js") # «.js-at-10-years» (to "js-at-10-years") # «.spidermonkey» (to "spidermonkey") # «.rafael» (to "rafael") # «.how-to-obtain-the-class» (to "how-to-obtain-the-class") # «.numbers-are-not-objects» (to "numbers-are-not-objects") # «.tostring-in-js» (to "tostring-in-js") # «.crockford» (to "crockford") # «.crockford-survey» (to "crockford-survey") # «.jslint» (to "jslint") # «.cookies» (to "cookies") # «.svg-edit» (to "svg-edit") # «.svg-basic» (to "svg-basic") # «.tetris-in-svg» (to "tetris-in-svg") # «.rebound» (to "rebound") # «.named-anchors» (to "named-anchors") # «.rhino» (to "rhino") # «.file-objects» (to "file-objects") # «.jquery» (to "jquery") # «.infovis» (to "infovis") # «.protovis» (to "protovis") # «.raphael» (to "raphael") # «.flot» (to "flot") # «.flot-lua» (to "flot-lua") # «.processing» (to "processing") # «.fresno» (to "fresno") # «.styleswitcher» (to "styleswitcher") # «.zen» (to "zen") # «.npmjs» (to "npmjs") # «.nodejs» (to "nodejs") # «.noesc» (to "noesc") # «.node.js-tutorials» (to "node.js-tutorials") # «.nodejs-wheezy» (to "nodejs-wheezy") # «.swank-js» (to "swank-js") # «.fetch» (to "fetch") # «.XMLHttpRequest» (to "XMLHttpRequest") # «.audio-api» (to "audio-api") # «.audio-buffering» (to "audio-buffering") # «.asm.js» (to "asm.js") # «.font-selector» (to "font-selector") # «.google-fonts» (to "google-fonts") # «.apolinario-passos» (to "apolinario-passos") # «.hatnote» (to "hatnote") # «.add-links-to-PRE» (to "add-links-to-PRE") # «.youtube-activate» (to "youtube-activate") # «.underscore.js» (to "underscore.js") # «.addeventlistener» (to "addeventlistener") # «.settimeout» (to "settimeout") # «.location» (to "location") # «.oncut-oncopy-onpaste» (to "oncut-oncopy-onpaste") # «.yarn» (to "yarn") # «.yarn-mode» (to "yarn-mode") # «.bower» (to "bower") # «.easy6502» (to "easy6502") # «.jscategory» (to "jscategory") ##### # # MozRepl # 2007nov02 # ##### # «mozrepl» (to ".mozrepl") # (find-angg ".emacs" "eepitch-moz") # (find-angg ".emacs" "firefox") # (find-angg ".emacs" "mozrepl") http://hyperstruct.net/projects/mozlab/news Important news, please read carefully! MozLab has been split into separate packages for MozRepl and MozUnit. The MozLab package will no longer be updated. http://wiki.github.com/bard/mozrepl/home # http://hyperstruct.net/projects # http://wiki.github.com/bard/mozrepl/emacs-integration # http://wiki.github.com/bard/mozrepl/techniques # http://wiki.github.com/bard/mozrepl/tutorial # http://wiki.github.com/bard/mozrepl/command-dom-grabber-3 # http://wiki.github.com/bard/mozrepl/command-simple-dom-grabber # http://wiki.github.com/bard/mozrepl/command-printstructure # http://wiki.github.com/bard/mozrepl/command-getwindows # http://people.internetconnection.net/2009/02/interactive-html-development-in-emacs/ # http://hyperstruct.net/projects/mozrepl/ # http://hyperstruct.net/projects/mozrepl/emacs-integration # http://hyperstruct.net/projects/mozrepl/tutorial # (find-anggfile "elisp/moz.el") # (find-anggfile "elisp/javascript.el") # 2009: # http://wiki.github.com/bard/mozrepl # http://wiki.github.com/bard/mozrepl/emacs-integration # http://people.internetconnection.net/2009/02/interactive-html-development-in-emacs/ # (find-fline "~/.mozilla/firefox/ftc9fs06.default/extensions/[email protected]/chrome/content/") ;; 2009may05: ;; http://wiki.github.com/bard/mozrepl/emacs-integration (autoload 'moz-minor-mode "moz" "Mozilla Minor and Inferior Mozilla Modes" t) (add-hook 'espresso-mode-hook 'espresso-custom-setup) (defun espresso-custom-setup () (moz-minor-mode 1)) # Tools -> MozRepl -> Start # Tools -> MozRepl -> activate on startup # (require 'moz) # (inferior-moz-process) # (find-efunction 'inferior-moz-process) # (inferior-moz-switch-to-mozilla) # (defun eepitch-moz () (interactive) (eepitch '(inferior-moz-switch-to-mozilla nil))) # (find-angg ".emacs" "eepitch-moz") * (eepitch-mozrepl) * (eepitch-kill) * (eepitch-mozrepl) repl.whereAmI() repl.look() title title = 'REPL-powered Firefox' document.getElementById('toolbar-menubar').hidden = true document.getElementById('toolbar-menubar').hidden = false var c = document.getElementById('urlbar-container') repl.enter(c) firstChild repl.doc(firstChild) repl.back() repl.home() content.location.href = 'http://maps.google.com' repl.enter(content) repl.whereAmI() repl.look() repl.search(/app/i) repl.doc(gApplication) repl.enter(gApplication) repl.look() repl.search(/get/) repl.doc(getPageUrl) getPageUrl() repl.home(); var scratch = {} repl.enter(scratch) repl.look() var x = 2 var y = 'hello' x y repl.look() repl.back() x y scratch.x scratch.y repl.enter(repl) function sayHello() { this.print('hello from repl!') } sayHello.doc = 'just say hello' repl.back() repl.doc(repl.sayHello) repl.sayHello() repl.inspect(repl) repl.doc(repl.print) repl.quit() (add-to-list 'auto-mode-alist '("\\.js\\'" . javascript-mode)) (autoload 'javascript-mode "javascript" nil t) (autoload 'moz-minor-mode "moz" "Mozilla Minor and Inferior Mozilla Modes" t) Tools -> MozRepl -> Start Tools -> MozRepl -> activate on startup Note: this is out of date. Use chrome://mozlab/content/mozrepl/javascript.el together with moz.el, instead of js-mode.el as reported below. After you install MozLab, grab chrome://mozlab/content/mozrepl/moz.el put it somewhere in Emacs' load-path. moz.el contains: * a major mode for direct interaction in a buffer (as with telnet); * a minor mode for sending code portions or whole files from other buffers. Assuming you want to use java-mode to edit Javascript files, enter the following in your .emacs initialization file: (add-to-list 'auto-mode-alist '("\\.js$" . java-mode)) (autoload 'moz-minor-mode "moz" "Mozilla Minor and Inferior Mozilla Modes" t) (add-hook 'java-mode-hook 'java-custom-setup) (defun java-custom-setup () (moz-minor-mode 1)) Other modes suitable for editing Javascript are js-mode (in chrome://mozlab/content/mozrepl/js-mode.el) and c++-mode. The provided js-mode will only work with Emacs22. Restart Emacs, and every time you open a Javascript file, you will now have the following keybindings available: * C-c C-s: open a Mozilla interaction buffer and switch to it * C-c C-l: save the current buffer and load it in Mozilla * C-M-x: send the current function (as recognized by c-mark-function) to Mozilla * C-c C-c: send the current function to Mozilla and switch to the interaction buffer * C-c C-r: send the current region to Mozilla In the interaction buffer: * C-c c: insert the current name of the REPL plus the dot operator (usually repl.) The predictive abbreviation mode is very useful when working in Javascript source buffers (and most other kinds of buffer, actually). ##### # # Code from the mozrepl .swf # 2009oct16 # ##### # «mozrepl-swf» (to ".mozrepl-swf") # http://hyperstruct.net/files/mozrepl.swf # http://www.emacswiki.org/emacs/PredictiveMode # http://www.emacswiki.org/emacs/PredictiveAbbreviation * (eepitch-moz) * (eepitch-kill) * (eepitch-moz) window.alert('Hello from inside :-)') repl.whereAmI() c = document.getElementById('urlbar-container') repl.enter(c) repl.whereAmI() firstChild firstChild.nodename repl.doc(firstChild) repl.enter firstChild.addEventListener('click', function(event) {event.target.value = 'taking control of he urlbar'}, false) repl.enter(firstChild) repl.search(/val/) value repl.home() repl.whereAmI() content.document.location.href = 'http://maps.google.com' repl.whereAmI() document.getElementById('title') repl.enter(content) document.getElementById('title').textContent document.getElementById('title').textContent = 'knock knock, Neo' repl.search(/app/) repl.search(/app/i) repl.enter(gApplication) repl.look() repl.doc(getPageUrl) getPageUrl getPageUrl() repl.home() repl.greet() // hmmmm... let's teach this REPL some manners ?? ?? function greet (name) { window.alert('Hello, ' + name + '!'); } greet.doc = "Just greet someone." repl.search(/greet/) repl.doc(greet) repl.back() repl.greet('Ladies and Gentlemen, thanks for watching.\nMozLab & MozRepl can be found at http://dev.hyperstruct.net/mozlab.\nEnjoy' ##### # # handling other protocols # 2007dec19 # ##### # «handling-other-protocols» (to ".handling-other-protocols") # (find-angg ".emacs" "eepitch-moz") # http://kb.mozillazine.org/Network.protocol-handler.expose-all # http://kb.mozillazine.org/Network.protocol-handler.app.(protocol) # (find-firefox "about:config") # (find-dotfirefoxfile "prefs.js") # (find-dotfirefoxfile "user.js") user_pref("network.protocol-handler.app.gomanet", "/home/andre/bin/edit.sh"); user_pref("network.protocol-handler.expose.gomanet", true); user_pref("network.protocol-handler.warn-external.gomanet", false); # (find-angg "bin/edit-pr.sh") # (find-angg "bin/edit.sh") # http://www.mozilla.org/unix/customizing.html#prefs Normal prefs are kept in prefs.js in the user's profile directory (which is overwritten by Mozilla every time a pref is changed), but here's a tip: prefs or other JavaScript that you don't want overwritten (e.g. comments) can be put in a file called user.js in the same directory, which is under the user's control and is read but never written by Mozilla. * (eepitch-moz) * (eepitch-kill) * (eepitch-moz) user_pref("network.protocol-handler.app.pspage", "/tmp/pspage.sh"); user_pref("network.protocol-handler.expose.pspage", true); user_pref("network.protocol-handler.warn-external.pspage", false); #* # (eev-bounded) cat > /tmp/pspage.sh <<'%%%' #!/bin/sh echo "Running: $0" date echo "Arguments: $*" %%% chmod 755 /tmp/pspage.sh #* #* [# (eeblogme-now-bounded) # file:///tmp/ee.html #] [R pspage:foo] #* ##### # # MozRepl 2011 # 2011nov03 # ##### # «mozrepl-2011» (to ".mozrepl-2011") # (find-angg ".emacs" "mozrepl") # https://github.com/bard/mozrepl/wiki/tutorial # https://github.com/bard/mozrepl/wiki/_pages # https://github.com/bard/mozrepl/wiki/inspecting-objects-withought-entering-them # http://repo.hyperstruct.net/mozrepl/devel/mozrepl.xpi # http://www.emacswiki.org/emacs/MozRepl # http://www.codediesel.com/tools/peeking-inside-firefox-using-mozrepl/ # https://addons.mozilla.org/en-US/firefox/addon/mozrepl/ # https://addons.mozilla.org/en-US/firefox/addon/mozrepl/versions/?page=1#version-1.1beta2 * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) telnet localhost 4242 1+2; * (eepitch-mozrepl) * (eepitch-kill) * (eepitch-mozrepl) // (find-angg ".emacs" "mozrepl") repl.whereAmI() repl.look() document.title document.title = 'REPL-powered Firefox' document.getElementById('toolbar-menubar').hidden = true var c = document.getElementById('urlbar-container') repl.enter(c) firstChild repl.doc(firstChild) repl.back() repl.home() content.location.href = 'http://maps.google.com' repl.enter(content) // for Firefox 3 you'll need: repl.enter(content.wrappedJSObject) repl.whereAmI() repl.look() repl.search(/app/i) repl.doc(gApplication) repl.enter(gApplication) repl.look() repl.search(/get/) repl.doc(getPageUrl) getPageUrl() repl.home(); var scratch = {} repl.enter(scratch) repl.look() var x = 2 var y = 'hello' x y repl.look() repl.back() x y scratch.x scratch.y repl.enter(repl) function sayHello() { this.print('hello from repl!') } sayHello.doc = 'just say hello' repl.back() repl.doc(repl.sayHello) repl.sayHello() repl.inspect(repl) repl.doc(repl.print) repl.inspect(repl) repl.doc(repl.print) repl.quit() ##### # # mozrepl-2020 # 2020aug13 # ##### # «mozrepl-2020» (to ".mozrepl-2020") # https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-08/msg01062.html MozRepl support is/will be no longer useful # https://www.palemoon.org/ # http://www.basilisk-browser.org/ # https://perlgerl.wordpress.com/2014/06/15/pale-moon-rising/ ##### # # Writing javascript with blogme # 2008aug30 # ##### # «blogme» (to ".blogme") # (find-blogme3 "anggdefs.lua" "javascript") # (find-angg ".emacs" "eeblogme-now") # # http://www.cs.brown.edu/courses/bridge/1998/res/javascript/javascript-tutorial.html # http://www.wdvl.com/Authoring/JavaScript/Tutorial/embedding.html # http://www.wdvl.com/Authoring/JavaScript/Tutorial/functions.html # http://www.webteacher.com/javascript/ # http://javascript-reference.info/ # http://www.w3schools.com/htmldom/prop_anchor_innerhtml.asp # http://www.w3schools.com/js/tryit.asp?filename=try_dom_anchor_href # http://www.howtocreate.co.uk/tutorials/javascript/writing # http://www.howtocreate.co.uk/tutorials/javascript/functions # http://www.javascriptmall.com/learn/lesson11.htm # http://www.javascriptmall.com/learn/lesson5.htm#varscope # http://www.javascriptmall.com/learn/lab2.htm #* [# (eeblogme-now-bounded) #] [JS document.write("Hello World!"); ] [JS function colorstr(c, s) { return '<font color="'+c+'">'+s+'_</font>'; } function colorwrite(c, s) { document.write(colorstr(c, s)); } colorwrite("red", "foo"); colorwrite("green", "bar"); ] #* [# (eeblogme-now-bounded) #] <span id="mytext">Foo</span> [JS document.getElementById('mytext').innerHTML = "Bar";] #* [# (eeblogme-now-bounded) # In this demo we write a paragraph whose contents are: # <p>Foo: Foo</p> # but the first "Foo:" is generated by a document.write, # and the second "Foo" is in a span with id "mytext" - # which allows us to change it afterwards - first to "Bar", # and then to numbers. #] [P [JS document.write("Foo:")] <span id="mytext">Foo</span>] [JS // Change the second "Foo", above, to "Bar". // The paragraph above becomes this: "Foo: Bar". document.getElementById('mytext').innerHTML = "Bar"; ] [JS function myset(i) { document.getElementById('mytext').innerHTML = i; } function incr(i) { myset(i); } // overridden by the next definition var n = 32; function incr(i) { n = n + i; myset(n); } ] [P [JSR myset(200)] [JSR myset(0)] [JSR myset(n=20)]] [P [JSR incr(-1)] [JSR incr(+1)]] #* ##### # # URL parts # 2008sep01 # ##### # «url-parts» (to ".url-parts") #* [# (eeblogme-now-bounded) # http://www.javascriptmall.com/learn/lesson11.htm # http://www.javascriptmall.com/learn/lab2.htm #] [JS function pw(obj) { document.write("<p>" + obj + "</p>"); } pw("location: " + window.location) pw("hash: " + window.location.hash) pw("href: " + window.location.href) pw("pathname: " + window.location.pathname) pw("search: " + window.location.search) pw("...: " + window.location.search.substr(1)) pw("...: " + parseInt(window.location.search.substr(1), 10)) pw("...: " + ("0000000" + 9).substr(-3)) ] [P [R ee.html] [R ee.html#foo] [R ee.html?bar] [R ee.html?020]] #* ##### # # regexps # 2008aug31 # ##### # «regexps» (to ".regexps") # http://www.javascriptkit.com/jsref/regexp.shtml # http://www.webreference.com/js/column5/ #* [# (eeblogme-now-bounded) #] [JS function pw(obj) { document.write("<p>" + obj + "</p>"); } re = /^\?[0-9]{3}$/; pw("re: " + re); pw("test: " + re.test("?234")); pw("test: " + re.test("?23")); pw("test: " + re.test("a?234")); pw("test: " + re.test("a?2345")); pw("min: " + min(20, 10)); pw("max: " + max(20, 10)); ] #* ##### # # flipbooks # 2008aug30 # ##### # «flipbooks» (to ".flipbooks") # (find-TH "emacs" "flipbooks") # (find-eevfile "eev-sshot.el" "wget") # http://angg.twu.net/flipbooks/eesteps.tgz * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) mkdir -p /tmp/flipbooks/ cd /tmp/flipbooks/ tar -xvzf $S/http/angg.twu.net/flipbooks/eesteps.tgz # (require 'eev-sshot) # (find-sshot "/tmp/flipbooks/eesteps" 1) # (find-fline "/tmp/flipbooks/eesteps_001.png") # (find-fline "/tmp/flipbooks/eesteps_002.png") # file:///tmp/flipbooks/eesteps_001.png # (find-fline "/tmp/ee.html") # (find-twusfile "flipbooks/") # (find-twusfile "flipbooks/eesteps_js.html") # http://angg.twu.net/flipbooks/eesteps.html # http://angg.twu.net/flipbooks/eesteps_js.html # http://angg.twu.net/flipbooks/eesteps_js.html?006 #* [# (eeblogme-now-bounded) #] [JS imgstem = "file:///tmp/flipbooks/eesteps"; jsstem = "file:///tmp/ee.html"; max = 12; n = 1; s = "001"; function dw(s) { document.write(s); } function pw(s) { document.write("<p>" + s + "</p>"); } function to3s(n) { return ("000"+n).substr(-3); } function ton(s) { return parseInt(s, 10); } function img() { return document.getElementById('img'); } function prv() { return document.getElementById('prv'); } function ths() { return document.getElementById('ths'); } function nxt() { return document.getElementById('nxt'); } function imgurl(s) { return imgstem + "_" + s + ".png"; } function pageurl(s) { return jsstem + "?" + s; } function setimg(s) { img().src = imgurl(s); } function setprv(s) { prv().innerHTML = "←"+s; } function setnxt(s) { nxt().innerHTML = s+"→"; } function setths(s) { ths().innerHTML = s; ths().href = pageurl(s); } function splus(s,d) { return to3s(ton(s) + d); } function setall(s) { setimg(s); setprv(splus(s,-1)); setths(s); setnxt(splus(s,1)); } function setn_(newn) { n = newn; s = to3s(n); setall(s); } function sets_(news) { s = news; n = ton(s); setall(s); } function query() { return window.location.search; } function goodq(q) { return /^\?[0-9][0-9][0-9]$/.test(q); } function goodn(n) { return 1 <= n && n <= max; } function setn(n) { if (goodn(n)) { setn_(n); return true; } } function sets(s) { return setn(ton(s)); } function setq(q) { if (goodq(q)) return sets(q.substr(1)); } function prev() { setn(n - 1); } function next() { setn(n + 1); } // dw(ton("020")); ] <p><img id="img" src="file:///tmp/flipbooks/eesteps_001.png" border=0> <p> <p><a id="prv" href="javascript:prev();">←003</a> <a id="ths" href="javascript:this();">004</a> <a id="nxt" href="javascript:next();">005→</a> <p> [JS setq(query()) || setn(1); ] #* ##### # # Brainstorm com o Romai # 2010sep09 # ##### # «romai» (to ".romai") # (find-es "html" "wdg-upstream") # (find-wdg40w3m "forms/textarea.html") #* [# (eeblogme-now-bounded) #] <form name="form"> [P Texto: <input name=textbox type=textbox>] [P <textarea name=input cols=80 rows=10 value="bla"></textarea> <a name=exec href="javascript:dostuff();">dostuff()</a> <a name=exec href="javascript:docopy();">docopy()</a> <a name=exec href="javascript:doeval();">doeval()</a> ] [P <textarea name=output width=80 height=10></textarea>] </form> [JS function textbox() { return document.getElementById('textbox'); } function input() { return document.getElementById('input'); } // function exec() { return document.getElementById('exec'); } function exec() { return document.exec; } function output() { return document.getElementById('output'); } // function dostuff () { exec().innerHTML = "foo"; } // function dostuff () { document.e = "foo"; } function docopy () { document.form.output.value = document.form.input.value; } function dostuff () { document.form.output.value = "foo"; } function doeval () { document.form.output.value = eval(document.form.input.value); } ] [JS imgstem = "file:///tmp/flipbooks/eesteps"; jsstem = "file:///tmp/ee.html"; max = 12; n = 1; s = "001"; function dw(s) { document.write(s); } function pw(s) { document.write("<p>" + s + "</p>"); } function to3s(n) { return ("000"+n).substr(-3); } function ton(s) { return parseInt(s, 10); } function img() { return document.getElementById('img'); } function prv() { return document.getElementById('prv'); } function ths() { return document.getElementById('ths'); } function nxt() { return document.getElementById('nxt'); } function imgurl(s) { return imgstem + "_" + s + ".png"; } function pageurl(s) { return jsstem + "?" + s; } function setimg(s) { img().src = imgurl(s); } function setprv(s) { prv().innerHTML = "←"+s; } function setnxt(s) { nxt().innerHTML = s+"→"; } function setths(s) { ths().innerHTML = s; ths().href = pageurl(s); } function splus(s,d) { return to3s(ton(s) + d); } function setall(s) { setimg(s); setprv(splus(s,-1)); setths(s); setnxt(splus(s,1)); } function setn_(newn) { n = newn; s = to3s(n); setall(s); } function sets_(news) { s = news; n = ton(s); setall(s); } function query() { return window.location.search; } function goodq(q) { return /^\?[0-9][0-9][0-9]$/.test(q); } function goodn(n) { return 1 <= n && n <= max; } function setn(n) { if (goodn(n)) { setn_(n); return true; } } function sets(s) { return setn(ton(s)); } function setq(q) { if (goodq(q)) return sets(q.substr(1)); } function prev() { setn(n - 1); } function next() { setn(n + 1); } // dw(ton("020")); ] <p><img id="img" src="file:///tmp/flipbooks/eesteps_001.png" border=0> <p> <p><a id="prv" href="javascript:prev();">←003</a> <a id="ths" href="javascript:this();">004</a> <a id="nxt" href="javascript:next();">005→</a> <p> [JS setq(query()) || setn(1); ] #* * (eepitch-moz) * (eepitch-kill) * (eepitch-moz) "22" + 3 "22" + "" "22".toString() print("22") document.dostuff.tostring() repl repl.toString() eval("1 + 22") 0 + "22". + 3 repl.whereAmI() // repl.look() // (find-books "__comp/__comp.el" "crockford") // (find-crockfordw3m "index.html") // (find-crockfordw3m "statements.html") // (find-crockfordw3m "eval.html") // http://reference.sitepoint.com/javascript/Document/getElementById content.location.href = 'file:///tmp/ee.html' 1 + 2 // 2 + 3 input document.getElementById('textbox') var textbox = document.getElementById('textbox') var input = document.getElementById('input') var output = document.getElementById('output') textbox input document.setn document setn document.setn document.setn(4) repl.enter(content) content.location.href = 'http://maps.google.com' document.getElementById title title = 'REPL-powered Firefox' document.getElementById('toolbar-menubar').hidden = true document.getElementById('toolbar-menubar').hidden = false var c = document.getElementById('urlbar-container') repl.enter(c) firstChild repl.doc(firstChild) repl.back() repl.home() content.location.href = 'http://maps.google.com' repl.enter(content) repl.whereAmI() repl.look() repl.search(/app/i) repl.doc(gApplication) repl.enter(gApplication) repl.look() repl.search(/get/) repl.doc(getPageUrl) getPageUrl() repl.home(); var scratch = {} repl.enter(scratch) repl.look() var x = 2 var y = 'hello' x y repl.look() repl.back() x y scratch.x scratch.y repl.enter(repl) function sayHello() { this.print('hello from repl!') } sayHello.doc = 'just say hello' repl.back() repl.doc(repl.sayHello) repl.sayHello() repl.inspect(repl) repl.doc(repl.print) repl.quit() ##### # # Evaluating the contents of a textarea # 2011jan03 # ##### # «textarea-eval» (to ".textarea-eval") # (find-blogme3 "anggdefs.lua" "javascript") # http://www.bookmarklets.com/tools/design/index.phtml # http://www.bookmarklets.com/about/make/encaps.html #* [# (eeblogme-now-bounded) #] [JS function docopy (df) { df.output.value = df.input.value; } function doeval (df) { df.output.value = eval(df.input.value); } ] [JS function doeval (df) { try { df.output.value = eval(df.input.value); } catch(e) { df.output.value = "ERROR: " + e } } ] [P [TEXTAREAEVALRUN form1 40 3 2 1 + 2 + 3 + 4]] [P [TEXTAREAEVAL form2 30 3 2 1 + 2 + 3 + 4 + 5]] #* <form name="form"> [P <textarea name=input cols=80 rows=10> 1 + 2 + 3 + 4 </textarea> [BR] <a href="javascript:docopy();">docopy()</a> <a href="javascript:doeval();">doeval()</a> [BR] <a href="javascript:document.form.output.value=document.form.input.value;nil;">docopy()</a> <a href="javascript:document.form.output.value=eval(document.form.input.value);nil;">doeval()</a> [BR] <a href="javascript:doccopy(document.form);">doccopy()</a> <a href="javascript:doceval(document.form);">doceval()</a> [BR] <textarea name=output cols=80 rows=10></textarea> ] </form> [JS function docopy () { document.form.output.value = document.form.input.value; } function doeval () { document.form.output.value = eval(document.form.input.value); } function doccopy (df) { df.output.value = df.input.value; } function doceval (df) { df.output.value = eval(df.input.value); } ] #* [# (eeblogme-now-bounded) # http://www.bookmarklets.com/tools/design/index.phtml # http://www.bookmarklets.com/about/make/encaps.html #] [JS function docopy (df) { df.output.value = df.input.value; } function doeval (df) { df.output.value = eval(df.input.value); } ] <form name="form"> <textarea name="input" cols=80 rows=10> 1 + 2 + 3 + 4 </textarea> <br> <a href="javascript:docopy(document.form);">docopy()</a> <a href="javascript:doeval(document.form);">doeval()</a> <br> <textarea name="output" cols=80 rows=10> </textarea> </form> #* [# (eeblogme-now-bounded) # http://www.bookmarklets.com/tools/design/index.phtml # http://www.bookmarklets.com/about/make/encaps.html #] [lua: -- (find-angg "LUA/lua50init.lua" "ee_template") ] #* <form name="form"> [P <textarea name=input cols=80 rows=10> 1 + 2 + 3 + 4 </textarea> [BR] <a href="javascript:docopy(document.form);">docopy()</a> <a href="javascript:doeval(document.form);">doeval()</a> [BR] <textarea name=output cols=80 rows=10> </textarea> ] </form> ##### # # org-info-js # 2009jan20 # ##### # «org-info-js» (to ".org-info-js") # http://orgmode.org/worg/code/org-info-js/ # http://orgmode.org/worg/code/org-info-js/index.html # http://orgmode.org/worg/code/org-info-js/org-info.js # http://orgmode.org/worg/code/org-info-js/stylesheet.css # http://lists.gnu.org/archive/html/bug-texinfo/2009-01/msg00032.html // Some notes taken from I-don't-remember-where: // // function raiseP(x,y) // { total=1; // for (j=0; j<y; j++) // { total*=x; } // return total; //result of x raised to y power // } // // clearPage(); // // what is "var"? What is the default for local/global? Stuff from allmusic.com: function setPicture(i) { var NewPictureURL = 'http://image.allmusic.com/00/amg/pic200/dr' + Pictures[i].substr(0,2) + '00/' + Pictures[i].substr(0,4) + '/' + Pictures[i] + '.jpg'; document.getElementById('Picture').src = NewPictureURL; if(Credits[i]) { var NewPictureCredits = 'Photo by <span>' + Credits[i] + '</span>'; document.getElementById('PictureCredits').style.visibility = "visible"; document.getElementById('PictureCredits').innerHTML = NewPictureCredits; } else { document.getElementById('PictureCredits').style.visibility = "hidden"; } } function nextPicture() { i++; if ( i > Pictures.length -1 ) { i = 0; } setPicture(i); } function previousPicture() { i--; if ( i < 0 ) { i = Pictures.length -1; } setPicture(i); } function randomPicture() { i = Math.floor(Math.random() * (Pictures.length)); setPicture(i); } Pictures = new Array("P21852UTL10", "P16024W28Y1"); Credits = new Array("Anton Corbijn", "Stpehanie Chernikowski"); var i = 0 <td class="credits" id="PictureCredits">Photo by <span>Anton Corbijn</span></td> <!--Begin Page Photo--> <table cellpadding="0" cellspacing="0"><tbody><tr><td valign="top"> <a href="javascript:nextPicture();"> <img src="rem_files/p21852utl10.jpg" id="Picture" border="0"> </a></td></tr><tr> <td class="credits" id="PictureCredits">Photo by <span>Anton Corbijn</span></td></tr></tbody></table> ##### # # "JavaScript at Ten Years" - Brendan Eich # 2008apr04 # ##### # «js-at-10-years» (to ".js-at-10-years") # http://www.mozilla.org/js/language/ICFP-Keynote.ppt (560K PPT) JavaScript in Two Slides ======================== Objects map strings to values (properties): var obj = new Object; obj["prop"] = 42; => obj.prop obj["0"] = "hello"; => obj[0] Functions are first-class objects: function fact(n) { return (n <= 2) ? n : n * fact(n-1); } fact.desc = "Factorial function"; JS in Two Slides (2) ==================== So methods are function-valued properties: obj.frob = function (n) { this.prop += n; }; obj.frob(6); => obj.prop == 48 Permissiveness throughout. Oops. grob = obj.frob; => var not necessary grob(6); => undefined + 6 == NaN prop = "hello"; => reset global prop grob(6); => prop == "hello6" Full Lexical Closures ====================== function Y(g) { return function (f) {return f(f);}( function (f) {return g(function (x) { return f(f)(x); }); }); } var fact = Y(function (fact) { return function (n) { return (n <= 2) ? n : n * fact(n-1); } }); alert(fact(5)); => 120 JS Is Self-ish ============== All functions can construct: function Car(make, model) { this.make = make, this.model = model; } myCar = new Car("Porsche", "Boxster"); All functions have a prototype property: Car.prototype.color = "black"; => default color old = new Car("Ford", "T"); => black Model T myCar.color = "silver"; => my override Powerful when combined with closures ##### # # SpiderMonkey # 2012mar16 # ##### # «spidermonkey» (to ".spidermonkey") # https://developer.mozilla.org/en/About_JavaScript # https://developer.mozilla.org/en/SpiderMonkey # https://developer.mozilla.org/En/SpiderMonkey/Introduction_to_the_JavaScript_shell # https://developer.mozilla.org/en/JavaScript/Shells # https://wiki.mozilla.org/JavaScript:New_to_SpiderMonkey # (find-status "spidermonkey-bin") # (find-vldifile "spidermonkey-bin.list") # (find-udfile "spidermonkey-bin/") # https://developer.mozilla.org/En/SpiderMonkey/JSAPI_User_Guide # https://developer.mozilla.org/en/How_to_embed_the_JavaScript_engine # https://wiki.mozilla.org/JavaScript:New_to_SpiderMonkey # http://javalikescript.free.fr/ # http://javalikescript.free.fr/demo.php # http://gluescript.sourceforge.net/ # https://developer.mozilla.org/en-US/docs/SpiderMonkey/Shell_global_objects * (eepitch-smjs) * (eepitch-kill) * (eepitch-smjs) 1 + 2 var obj = new Object; obj["prop"] = 42; obj["0"] = "hello"; function fact(n) { return (n <= 2) ? n : n * fact(n-1); } fact.desc = "Factorial function"; obj.frob = function (n) { this.prop += n; }; obj.frob(6); grob = obj.frob; grob(6); prop = "hello"; grob(6); function Y(g) { return function (f) {return f(f);}( function (f) {return g(function (x) { return f(f)(x); }); }); } var fact = Y(function (fact) { return function (n) { return (n <= 2) ? n : n * fact(n-1); } }); alert(fact(5)); function Car(make, model) { this.make = make, this.model = model; } myCar = new Car("Porsche", "Boxster"); Car.prototype.color = "black"; old = new Car("Ford", "T"); myCar.color = "silver"; * (eepitch-smjs) * (eepitch-kill) * (eepitch-smjs) T = new Object; a = ['foo', 'bar'] a a.push('plic') a a[1] a[0] a.join('\n') a a[200]='ploft' a a[200]='' a delete a[200] a var a = function(){}; ten = function(){ return 10 }; ten() k = function(){ return this }; k k() a() a = ['foo', 'bar'] a() typeof(a) ##### # # Rafael, 2012oct24 # 2012oct24 # ##### # «rafael» (to ".rafael") * (eepitch-smjs) * (eepitch-kill) * (eepitch-smjs) fact = function (a) { return a+b; } fact fact.prototype typeof(fact) typeof(fact.prototype) b = 22 fact(33) new fact() j = {a : 22, b : 33} k = {c : 44, d : 55} k.prototype = j k k.c k.prototype.a k.protype = Object.create(j) k.c = 44 k.c = 55 +-function----------------------------+ fact -> | code : function (a) { return a+b; } | +-------------------------------------+ ^ | +-P-object-+ j -> | "a" : 22 | | "b" : 33 | +----------+ j = {a : 22, b : 33} typeof(j) j j.a j.b // (find-books "__comp/__comp.el" "javascript") // (find-crockfordw3m "objects.html") // http://en.wikipedia.org/wiki/ECMAScript ##### # # How can I obtain the "class" of an object? # 2012apr18 # ##### # «how-to-obtain-the-class» (to ".how-to-obtain-the-class") # http://angg.twu.net/dednat5/eoo.lua.html#box-diagram * (eepitch-smjs) * (eepitch-kill) * (eepitch-smjs) a = {foo : 'FOO', bar : 'BAR'} // [object Object] a.foo // FOO a.bar // BAR a // [object Object] a() // TypeError: a is not a function typeof(a) // object typeof(typeof(a)) // string b = function(){ return 22 } // function () { return 22; } b.foo = 'FOO' // FOO b.bar = 'BAR' // BAR b // function () { return 22; } b() // 22 typeof(b) // function typeof(typeof(b)) // string ##### # # toString in javascript # 2012apr18 # ##### # «tostring-in-js» (to ".tostring-in-js") # http://www.jspatterns.com/self-executing-functions/ # https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/call # http://www.quirksmode.org/js/this.html # (find-crockfordw3m "toc.html" "Chapter 3. Objects") # (find-crockfordw3m "toc.html" "Section 3.5. Prototype") # (find-crockfordw3m "prototype.html") # (find-crockfordw3m "toc.html" "Section 5.3. Prototypal") # (find-crockfordw3m "prototypal.html") # (find-crockfordw3m "toc.html" "Section 4.3. Invocation") # (find-crockfordw3m "invocation.html") # (find-crockfordw3m "invocation.html" "4.3.3." "Constructor Invocation") * (eepitch-smjs) * (eepitch-kill) * (eepitch-smjs) a = {foo : 'FOO'} b = {} b.prototype = a b.foo my_beget = function (o) { var F = function () {}; F.prototype = o; return new F(); }; my_beget({}) my_beget(function(){}) // Function.prototype.toString called on incompatible object ##### # # Numbers are not objects # 2012apr18 # ##### # «numbers-are-not-objects» (to ".numbers-are-not-objects") * (eepitch-smjs) * (eepitch-kill) * (eepitch-smjs) a = {}; a.b = 22; a.b // 22 a = 5; a.b = 22; a.b // a = Number(5); a.b = 22; a.b // a = new Number(5); a.b = 22; a.b // 22 a = "foo"; a.b = 22; a.b // a = String("foo"); a.b = 22; a.b // a = new String("foo"); a.b = 22; a.b // 22 x = 5 ; x.a = 'foo'; [x == 5, x.a] // true, x = new Number(5); x.a = 'foo'; [x == 5, x.a] // true,foo pr = function (o) { print(typeof(o), o) } pr({}) pr({foo : 'FOO'}) pr(['FOO', 'BAR']) pr([]) <Agamemnus> >> (typeof new(String)) <ecmabot> Agamemnus: (string) 'object' <Agamemnus> >> (typeof new(Number)) <ecmabot> Agamemnus: (string) 'object' <hughfdjackson> >> var a = new Number; a.b = 3; a.b <ecmabot> hughfdjackson: (number) 3 <xivix> hughfdjackson: That's not a string, that's a String object. a.prototype.toString Object Object.prototype Object.beget typeof Object.beget undefined if (typeof Object.beget !== 'function') { Object.beget = function (o) { var F = function () {}; F.prototype = o; return new F(); }; } var another_stooge = Object.beget(stooge); a.prototype = b a['prototype'] = b // Dynasty's hint: Array.prototype Array.prototype.join (function() { var oldJoin = Array.prototype.join; Array.prototype.join = function(separator) { if (separator === undefined) { separator = '\n'; } return oldJoin.call(this, separator); }; }()); T = new Array(); Array; arraypush arrayPush; arrayPush(T, "foo"); wT; ##### # # Douglas Crockford: "Javascript - The Good Parts" # 2009oct10 # ##### # «crockford» (to ".crockford") # (find-books "__comp/__comp.el" "crockford") # (find-angg ".emacs.papers" "javascript") # (code-c-d "crockford" "~/usrc/crockford/final/") # (find-crockfordw3m "toc.html") # (find-crockfordw3m "a_simple_testing_ground.html") # (find-crockfordw3m "prototype.html") # (find-crockfordw3m "reflection.html") # (find-crockfordw3m "enumeration.html") # (find-crockfordw3m "augmenting_types.html") * (eepitch-moz) * (eepitch-kill) * (eepitch-moz) document.writeln('Hello, world!'); writeln('Hello, world!'); Function.prototype.method = function (name, func) { this.prototype[name] = func; return this; }; # «crockford-survey» (to ".crockford-survey") # (find-angg ".emacs.papers" "javascript") # http://javascript.crockford.com/ # http://javascript.crockford.com/survey.html # http://javascript.crockford.com/tdop/tdop.html # http://javascript.crockford.com/little.html # http://javascript.crockford.com/prototypal.html # http://javascript.crockford.com/inheritance.html * (eepitch-smjs) * (eepitch-kill) * (eepitch-smjs) 'This is a string.' "Isn't this a string? Yes!" 'A' // The character A "" // An empty string var s = "Hello World!"; s.length == 12 Math.PI // Math.PI.int() = ... var myHashtable = {}; myHashtable["name"] = "Carl Hollywood"; myHashtable.city = "Anytown"; // var myHashtable = new Object(); for (var n in myHashtable) { if (myHashtable.hasOwnProperty(n)) { document.writeln("<p>" + n + ": " + myHashtable[n] + "</p>"); } } // <p>name: Carl Hollywood</p> // <p>city: Anytown</p> this.div = document.body.children[document.body.children.length - 1]; var myObject = {name: "Jack B. Nimble", 'goto': 'Jail', grade: 'A', level: 3}; return { event: event, op: event.type, to: event.srcElement, x: event.clientX + document.body.scrollLeft, y: event.clientY + document.body.scrollTop}; emptyObject = {}; myObject.nickname = 'Jackie the Bee'; var myArray = []; var myArray = new Array(); myList = ['oats', 'peas', 'beans', 'barley']; emptyArray = []; month_lengths = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; slides = [ {url: 'slide0001.html', title: 'Looking Ahead'}, {url: 'slide0008.html', title: 'Forecast'}, {url: 'slide0021.html', title: 'Summary'} ]; a[i + j] = f(a[i], a[j]); function sum() { // Take any number of parameters and return the sum var total = 0; for (var i = 0; i < arguments.length; ++i) { total += arguments[i]; } return total; } var name = function name (argumentlist) block ; function name(argumentlist) block ##### # # JSLint # 2009oct16 # ##### # «jslint» (to ".jslint") # (find-crockfordw3m "toc.html") # (find-crockfordw3m "toc.html" "Appendix C. JSLint") # http://www.jslint.com/ # http://www.jslint.com/jslint.html # http://www.jslint.com/lint.html # http://www.jslint.com/webjslint.js # http://www.jslint.com/jslint.js # http://www.jslint.com/fulljslint.js # http://www.jslint.com/json2.js # http://www.jslint.com/adsafe.js # http://www.jslint.com/intercept.js # http://www.jslint.com/widget.js # http://www.jslint.com/rhino.js # http://www.jslint.com/wsh.js ##### # # Cookies # 2009oct15 # ##### # «cookies» (to ".cookies") # (find-es "firefox" "cookies") # http://www.quirksmode.org/js/cookies.html # http://www.braemoor.co.uk/software/cookies.shtml # http://www.paulspages.co.uk/pcp/cookielib/quickprimer.htm # http://www.javascriptworld.com/chap10-1.html # http://www.javascriptworld.com/chap10-2.html # http://www.javascriptworld.com/chap10-3.html # http://www.javascriptworld.com/chap10-4.html # http://www.javascriptworld.com/chap10-5.html # http://www.javascriptworld.com/chap10-6.html ##### # # svg-edit # 2010jul05 # ##### # «svg-edit» (to ".svg-edit") # http://code.google.com/p/svg-edit/ # http://svg-edit.googlecode.com/files/svg-edit-2.5.zip # http://code.google.com/p/svg-edit/wiki/FrequentlyAskedQuestions # http://code.google.com/p/svg-edit/wiki/Roadmap # http://code.google.com/p/svg-edit/issues/detail?id=582 #* rm -Rv ~/usrc/svg-edit-2.5/ unzip -d ~/usrc/ $S/http/svg-edit.googlecode.com/files/svg-edit-2.5.zip #* # (code-c-d "svgedit" "~/usrc/svg-edit-2.5/") # (find-svgeditfile "") ##### # # SVG: basic commands # 2010oct23 # ##### # «svg-basic» (to ".svg-basic") # http://www.carto.net/papers/svg/manipulating_svg_with_dom_ecmascript/ # http://www.learnsvg.com/html/bitmap/chapter10/page10-1.htm # http://objjob.phrogz.net/objects.asp?langID=1 # http://www.intmath.com/Functions-and-graphs/graphs-using-svg.php # http://www1.chapman.edu/~jipsen/svg/asciisvg.html # http://www1.chapman.edu/~jipsen/svg/asciisvgcommands.html ##### # # Tetris in SVG + JavaScript # 2010oct25 # ##### # «tetris-in-svg» (to ".tetris-in-svg") # http://www.codedread.com/yastframe.php # http://www.codedread.com/yastgame.php # http://www.codedread.com/yast.js ##### # # Felix Klock's "rebound" game and named anchors bookmarklet # 2010sep11 # ##### # «rebound» (to ".rebound") # http://www.ccs.neu.edu/home/pnkfelix/rebound.html # http://www.ccs.neu.edu/home/pnkfelix/paddle.gif # http://www.ccs.neu.edu/home/pnkfelix/ball.gif # «named-anchors» (to ".named-anchors") # http://www.ccs.neu.edu/home/pnkfelix/bookmarklets.html ##### # # Rhino # 2010sep09 # ##### # «rhino» (to ".rhino") # (find-status "rhino") # (find-vldifile "rhino.list") # (find-udfile "rhino/") # (find-vldifile "rhino.postinst" "/usr/bin/js") # (find-status "rhino-doc") # (find-vldifile "rhino-doc.list") # (find-udfile "rhino-doc/") # (find-status "librhino-java") # (find-vldifile "librhino-java.list") # (find-udfile "librhino-java/") # (find-status "librhino-java-doc") # (find-vldifile "librhino-java-doc.list") # (find-udfile "librhino-java-doc/") # (find-udfile "librhino-java-doc/examples/") # (find-udfile "librhino-java-doc/examples/File.java.gz") # (find-fline "/usr/share/doc/rhino/api") update-alternatives: using /usr/bin/rhino to provide /usr/bin/js (js) in auto mode # (find-man "1 rhino") * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) rhino ##### # # File objects in JS # 2015jan03 # ##### # «file-objects» (to ".file-objects") # https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/File_object # (find-udfile "librhino-java-doc/examples/File.java.gz") ##### # # ECMAScript for Guile # 2009oct16 # ##### # (find-es "scheme" "guile-1.8") # http://wingolog.org/archives/2009/02/22/ecmascript-for-guile ##### # # jQuery # 2011jan03 # ##### # «jquery» (to ".jquery") # http://en.wikipedia.org/wiki/JQuery # http://jquery.com/ # http://code.jquery.com/jquery-1.4.4.js # (find-fline "/usr/share/javascript/jquery/") # (find-zsh "availabledebs | sort | grep jquery") # (find-zsh "dmissing usr/share/javascript/jquery") # (find-zsh "dmissing usr/share/javascript") # (find-zsh "dmissing usr/share/javascript | awk '{print $2}'") # (find-zsh "dmissing usr/share/javascript | awk '{print $2}' | sort | uniq") # (find-zsh "availabledebs | sort | grep jquery") # (find-status "libjs-jquery") # (find-vldifile "libjs-jquery.list") # (find-udfile "libjs-jquery/") # (find-udfile "libjs-jquery/README.Debian" "src=") # (find-status "libjs-jquery-ui") # (find-vldifile "libjs-jquery-ui.list") # (find-udfile "libjs-jquery-ui/") # (find-status "libjs-jquery-ui-docs") # (find-vldifile "libjs-jquery-ui-docs.list") # (find-udfile "libjs-jquery-ui-docs/") # file:///usr/share/doc/libjs-jquery-ui-docs/examples/index.html # (find-fline "/usr/share/javascript/jquery/jquery.js") ##### # # JavaScript InfoVis Toolkit # 2011jan05 # ##### # «infovis» (to ".infovis") # http://thejit.org/ # http://thejit.org/static/v20/Jit/Examples/Spacetree/example1.html # http://thejit.org/static/v20/Jit/Examples/Spacetree/example1.code.html # http://thejit.org/static/v20/Jit/Examples/Spacetree/example1.js # http://thejit.org/downloads/Jit-2.0.0b.zip #* rm -Rv ~/usrc/Jit/ unzip -d ~/usrc/ $S/http/thejit.org/downloads/Jit-2.0.0b.zip cd ~/usrc/Jit/ #* # (code-c-d "infovis" "~/usrc/Jit/") # (find-infovisfile "") ##### # # ProtoVis # 2011jan05 # ##### # «protovis» (to ".protovis") # http://vis.stanford.edu/protovis/ # http://protovis-js.googlecode.com/files/protovis-3.2.zip #* rm -Rv ~/usrc/protovis-3.2/ unzip -d ~/usrc/ $S/http/protovis-js.googlecode.com/files/protovis-3.2.zip rm -Rv ~/usrc/__MACOSX/ cd ~/usrc/protovis-3.2/ #* # (code-c-d "protovis" "~/usrc/protovis-3.2/") # (find-protovisfile "") ##### # # RaphaelJS # 2011jan05 # ##### # «raphael» (to ".raphael") # http://raphaeljs.com/ # http://raphaeljs.com/reference.html # http://github.com/DmitryBaranovskiy/raphael/raw/master/raphael.js ##### # # Flot (and flot-lua) # 2012dec27 # ##### # «flot» (to ".flot") # «flot-lua» (to ".flot-lua") # http://www.flotcharts.org/ # http://stevedonovan.github.com/lua-flot/flot-lua.html # http://code.google.com/p/flot/ # (find-man "unzip") * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) # (find-fline "~/tmp/flot-flot-v0.7-0-g3c1e90b.zip") # (find-fline "~/usrc/flot/") rm -Rv ~/usrc/flot* unzip ~/tmp/flot-flot-v0.7-0-g3c1e90b.zip -d ~/usrc/ cd ~/usrc/ mv flot-flot-f0e78fc flot cd ~/usrc/flot/ # (find-fline "~/usrc/flot/") ##### # # Processing (used by the people at #labmacambira) # 2012sep30 # ##### # «processing» (to ".processing") # (find-TH "processing") # http://processingjs.org/ # http://processingjs.org/articles/PomaxGuide.html # http://li7e.org/ddd2 # http://li7e.org/ddd3/edit # http://www.pulapirata.com/skills/vivace/ # http://labmacambira.sourceforge.net/ # http://processingjs.org/download/ # https://raw.github.com/processing-js/processing-js/v1.4.8/processing.js # https://raw.github.com/processing-js/processing-js/v1.4.8/processing.min.js # http://processingjs.org/articles/jsQuickStart.html # http://processingjs.org/articles/p5QuickStart.html # http://processingjs.org/articles/PomaxGuide.html # http://processingjs.org/learning/ *** # Srinivas: # http://beard-coded.tumblr.com/ ##### # # Fresno (a complement to MozRepl) # 2011jan05 # ##### # «fresno» (to ".fresno") # http://simile.mit.edu/wiki/Fresno #* rm -Rfv ~/usrc/fresno/ mkdir ~/usrc/fresno/ cd ~/usrc/ svn co http://simile.mit.edu/repository/fresno/trunk fresno tar -cvzf ~/tmp/fresno.tgz fresno/ cd ~/usrc/fresno/ #* rm -Rfv ~/usrc/fresno/ tar -C ~/usrc/ -xvzf ~/tmp/fresno.tgz fresno/ cd ~/usrc/fresno/ # (code-c-d "fresno" "~/usrc/fresno/") # (find-fresnofile "") # (find-fresnofile "README") ##### # # StyleSwitcher # 2012jun13 # ##### # «styleswitcher» (to ".styleswitcher") # http://rgruet.free.fr/bin/styleswitcher.js ##### # # Zen # 2012aug26 # ##### # «zen» (to ".zen") # http://tomelam.com/ (Zen tech) # http://tomelam.blogspot.com/ (Zen "marketing", err, non-tech) # http://thomaselam.wordpress.com/ (Bit Reset blog) # http://zen-rails.heroku.com/ # http://zen-rails.heroku.com/doc/javascript.html # http://zen-rails.heroku.com/doc/design.html # http://zen-rails.heroku.com/doc/features.html # https://mail.google.com/mail/ca/u/0/#inbox/1396423444c5cc43 # http://doc.mashweb.club/zen/docs/whitepaper/ # http://www.youtube.com/watch?v=3c3Rt6QbHDw A demonstration of the first web browser # https://www.pivotaltracker.com/projects/70151 ##### # # npmjs / nodejs # 2012aug29 # ##### # «npmjs» (to ".npmjs") # https://npmjs.org/ # http://nodejs.org/ # (code-c-d "nodejs" "~/usrc/node/") # (find-nodejsfile "") # (find-nodejsfile "README.md") # http://joyeur.com/2010/12/10/installing-node-and-npm/ # https://gist.github.com/579814 * (eepitch-shell2) * (eepitch-kill) * (eepitch-shell2) rm -Rv ~/usrc/node/ cd ~/usrc/ git clone git://github.com/joyent/node.git cd ~/usrc/node ./configure --prefix=~/local make install |& tee omi cd ~/usrc/ git clone git://github.com/isaacs/npm.git cd ~/usrc/npm export PATH=$HOME/local/bin:$PATH make install |& tee omi # or `make link` for bleeding edge # (find-fline "~/usrc/node/") # (find-fline "~/usrc/npm/") # (find-fline "~/usrc/npm/onigs") # (find-fline "~/local/") # (find-fline "~/local/bin/") # (find-fline "~/usrc/node/omi") npm install -g swank-js |& tee onigs # http://lists.gnu.org/archive/html/emacs-orgmode/2013-01/msg00023.html ##### # # nodejs # 2019oct01 # ##### # «nodejs» (to ".nodejs") # (find-zsh "installeddebs | sort | grep node") # (find-zsh "availabledebs | sort | grep node") # https://nodejs.org/en/ # https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions # (find-status "nodejs") # (find-vldifile "nodejs.list") # (find-udfile "nodejs/") # (find-man "1 nodejs") * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) # https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions # Using Debian, as root cd /tmp/ curl -sL https://deb.nodesource.com/setup_14.x | sudo bash - sudo apt-get install -y nodejs # (find-sh "nodejs -v") * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) node -v node # (find-eevfile "eepitch.el" ";; JavaScript") * (eepitch-nodejs) * (eepitch-kill) * (eepitch-nodejs) .help ##### # # noesc # 2019oct01 # ##### # «noesc» (to ".noesc") # https://no-color.org/ # https://stackoverflow.com/questions/45399992/node-js-how-to-disable-colors-in-the-console # https://github.com/nodejs/node/issues/26187 # https://github.com/nodejs/node/issues/26187#issuecomment-464791709 * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) cd /tmp/ cat > noesc.c <<'%%%' #include <stdio.h> #include <ctype.h> void throw_away() { for(int ch = fgetc(stdin); !feof(stdin) && !isalpha(ch); ch = fgetc(stdin)); } main() { setbuf(stdin, NULL); setbuf(stdout, NULL); while(!feof(stdin)) { int ch = fgetc(stdin); if(ch == '\033') throw_away(); else fputc(ch, stdout); } } %%% gcc -o noesc noesc.c * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) echo $TERM # export FORCE_COLOR=0 # nodejs nodejs | /tmp/noesc ##### # # node.js tutorials # 2012oct14 # ##### # «node.js-tutorials» (to ".node.js-tutorials") # (find-youtubedl-links "/sda5/videos/node.js/" "Nodejs_Tutorial_-_1_-_Creating_a_HTTP_web_server" "RUH1y6H55Ao" ".mp4" "nodejs1") # (find-youtubedl-links "/sda5/videos/node.js/" "Nodejs_Express_Tutorial_-_1_-_Hello_World_in_Express" "ol684TJ71BI" ".mp4" "nodejse1") # (find-youtubedl-links "/sda5/videos/node.js/" "Nodejs_Express_Tutorial_-_2_-_Working_with_the_Express_Framework" "CZfD5ligNTw" ".mp4" "nodejse2") # (find-youtubedl-links "/sda5/videos/node.js/" "Introduction_to_Node_js_in_under_5_minutes" "A2pl650qe0I" ".mp4" "nodejsu5") # (code-mplayer "nodejs1video" "/sda5/videos/node.js/Nodejs_Tutorial_-_1_-_Creating_a_HTTP_web_server-RUH1y6H55Ao.mp4") # (code-mplayer "nodejse1video" "/sda5/videos/node.js/Nodejs_Express_Tutorial_-_1_-_Hello_World_in_Express-ol684TJ71BI.mp4") # (code-mplayer "nodejse2video" "/sda5/videos/node.js/Nodejs_Express_Tutorial_-_2_-_Working_with_the_Express_Framework-CZfD5ligNTw.mp4") # (code-mplayer "nodejsu5video" "/sda5/videos/node.js/Introduction_to_Node_js_in_under_5_minutes-A2pl650qe0I.mp4") # (find-nodejs1video) # (find-nodejs1video "4:35" "app.js") # (find-nodejse1video) # (find-nodejse1video "2:45" "app.js") # (find-nodejse2video) # (find-nodejsu5video) * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) export PATH=$HOME/local/bin:$PATH cd /tmp/ cat > app.js <<'%%%' var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World!\n'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/'); %%% node app.js # http://127.0.0.1:1337/ ##### # # node.js # 2014aug21 # ##### # «nodejs-wheezy» (to ".nodejs-wheezy") # (find-zsh "installeddebs | sort | grep node") # (find-zsh "availabledebs | sort | grep node") # https://github.com/joyent/node/wiki/installing-node.js-via-package-manager # https://deb.nodesource.com/ # https://deb.nodesource.com/setup # https://deb.nodesource.com/node/dists/ # https://deb.nodesource.com/node/dists/wheezy/ # (find-es "apt" "add-apt-repository") * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) cd /tmp/ R apt-get install curl lsb-release curl -sL https://deb.nodesource.com/setup | bash - # (find-status "lsb-release") # (find-vldifile "lsb-release.list") # (find-udfile "lsb-release/") # (find-man "1 lsb_release") # http://nodejs.org/ # http://nodejs.org/dist/v0.10.31/node-v0.10.31.tar.gz # http://blog.modulus.io/absolute-beginners-guide-to-nodejs # http://nodeguide.com/beginner.html # http://stackoverflow.com/questions/2353818/how-do-i-get-started-with-node-js # http://antler.co.za/2014/04/install-node-js-npm-on-debian-stable-wheezy-7/ # http://backports.debian.org/Instructions/ # deb http://http.debian.net/debian wheezy-backports main # (find-status "nodejs") # (find-vldifile "nodejs.list") # (find-udfile "nodejs/") # (find-udfile "nodejs/api/") # file:///usr/share/doc/nodejs/api/repl.html # (find-man "1 nodejs") # https://www.npmjs.org/ # https://www.npmjs.org/install.sh * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) sudo rm -v /usr/local/bin/node laf /usr/local/bin/node sudo ln -s /usr/bin/nodejs /usr/local/bin/node laf /usr/local/bin/node cd /tmp/ curl https://www.npmjs.org/install.sh | sudo sh nodejs -v npm -v * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) export NODE_DISABLE_COLORS=1 export NODE_NO_READLINE=1 nodejs ##### # # Swank-js # 2012aug27 # ##### # «swank-js» (to ".swank-js") # http://www.google.com/search?q=swank-js # https://github.com/swank-js/swank-js # http://emacsrocks.com/e11.html # (find-youtubedl-links "/sda5/videos/" "Emacs_Rocks_Episode_11_swank-js" "qwtVtcQQfqc" ".mp4" "emacsrocks11") # (code-mplayer "emacsrocks11video" "/sda5/videos/Emacs_Rocks_Episode_11_swank-js-qwtVtcQQfqc.mp4") # (eev-avadj-mode 0) # (eev-avadj-mode 1) # (find-emacsrocks11video) # (find-emacsrocks11video "1:32" "ball.vy = -400;") # http://npmjs.org/ # https://npmjs.org/package/swank-js # https://npmjs.org/package/swank-js http://www.youtube.com/watch?v=qwtVtcQQfqc Emacs Rocks! Episode 11: swank-js ##### # # Fetch ee.js # 2012nov29 # ##### # «fetch» (to ".fetch") # http://angg.twu.net/javascript.html # file:///home/edrx/TH/L/javascript.html # http://www.javascriptkit.com/dhtmltutors/ajaxgetpost.shtml ##### # # XMLHttpRequest (thanks to Alonso Leonardo) # 2012dec01 # ##### # «XMLHttpRequest» (to ".XMLHttpRequest") # (find-debpkg-links "jquery") # (find-google-links "xmlhttprequest") # http://www.google.com/search?q=xmlhttprequest # http://en.wikipedia.org/wiki/XMLHttpRequest # http://en.wikipedia.org/wiki/Same_origin_policy # http://www.w3.org/TR/XMLHttpRequest/ # http://www.w3.org/TR/XMLHttpRequest/#introduction # http://www.w3.org/TR/XMLHttpRequest/#the-open-method # http://www.w3.org/TR/XMLHttpRequest/#the-send-method #* cat > /var/www/copyFile.html <<'%%%' <html> <script type="text/javascript"> // http://localhost/copyFile.html // file:///var/www/copyFile.html function copyFile(serverPage) { var request = new XMLHttpRequest(); request.open("GET", serverPage); request.send(null); request.onreadystatechange = function() { if (request.readyState == 4) { document.form1.input.value = request.responseText; } } } </script> <a href="#" onclick="copyFile('hello.txt')">copyFile('hello.txt')</a><br> <a href="#" onclick="copyFile('ee.js')">copyFile('ee.js')</a><br> <p> <form name="form1"> <textarea name="input" cols=60 rows=6> 1 + 2 + 3 + 4 </textarea> </form> </body> </html> %%% echo 'HELLO' > /var/www/hello.txt echo 'a =99; b=200;' > /var/www/ee.js #* # (find-fline "/var/www/copyFile.html") # http://localhost/copyFile.html # file:///var/www/copyFile.html ##### # # The Javascript Audio API # 2012dec15 # ##### # «audio-api» (to ".audio-api") # (find-es "html" "html5-audio") # http://www.google.com/search?q=html5+audio+api # http://www.google.com/search?q=javascript+audio+api # http://chromium.googlecode.com/svn/trunk/samples/audio/samples.html # http://en.wikipedia.org/wiki/HTML5_Audio # http://labs.echonest.com/Uploader/index.html?trid=TRIOCHX13AFD0DF411 # http://musicmachinery.com/2012/11/12/the-infinite-jukebox/ # http://stackoverflow.com/questions/8358624/comprehensive-html5-audio-api # http://stackoverflow.com/questions/9563887/setting-html5-audio-position # http://www.createjs.com/#!/SoundJS # http://www.html5audio.org/ # http://www.html5laboratory.com/audio-test.html # http://www.html5laboratory.com/f/anyone-there.ogg # http://www.html5laboratory.com/j/browserdetect.js # http://www.html5laboratory.com/playing-with-audio-files.php # http://www.html5rocks.com/en/tutorials/webaudio/intro/ # http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#the-audio-element # https://wiki.mozilla.org/Audio_Data_API#JavaScript_Audio_Libraries http://areweplayingyet.org/property-currentTime http://html5doctor.com/html5-audio-the-state-of-play/ http://stackoverflow.com/questions/4993097/html5-display-audio-currenttime http://stackoverflow.com/questions/5932412/html5-audio-how-to-play-only-a-selected-portion-of-an-audio-file-audio-sprite # (find-sh "locate '.ogg'") # (find-file "/sda6/CDs/zoe_keating_natoma/2/") # (find-file "/sda6/CDs/zoe_keating_natoma/2/01._Sun_Will_Set.ogg") * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) cp -v ~/NICOTINE/Faith/08._faith.mp3 /tmp/foo.mp3 cp -v /sda6/CDs/zoe_keating_natoma/2/01._Sun_Will_Set.ogg /tmp/foo.ogg cat > /tmp/foo.html <<'%%%' <!DOCTYPE html> <html> <head> <title>html5 audio test</title> </head> <body> <script language="JavaScript"> function init () { audio = document.getElementsByTagName("audio")[0]; } function seekto (secs) { init(); audio.currentTime = secs; audio.play(); } function pause () { init(); audio.pause(); } </script> <h1>Audio file</h1> <audio autobuffer controls> <source src='foo.mp3'> <source src='foo.ogg'> </audio> <a href="javascript:seekto(30)">seekto(30)</a> <a href="javascript:seekto(60)">seekto(60)</a> <a href="javascript:pause()">pause()</a> </body> </html> %%% # file:///tmp/foo.html ##### # # audio buffering # 2016mar15 # ##### # «audio-buffering» (to ".audio-buffering") https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/251997709&color=ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false ##### # # asm.js # 2013feb24 # ##### # «asm.js» (to ".asm.js") # http://asmjs.org/spec/latest/ ##### # # Font Selector # 2013jun15 # ##### # «font-selector» (to ".font-selector") # (find-es "html" "css-fonts") # http://lindekleiv.bitbucket.org/fontselector/ # https://bitbucket.org/lindekleiv/jquery-ui-fontselector # http://en.wikipedia.org/wiki/Font_family_(HTML) # http://en.wikipedia.org/wiki/Core_fonts_for_the_Web # http://csstxt.com/ ##### # # Google fonts # 2013jun15 # ##### # «google-fonts» (to ".google-fonts") # (find-es "html" "google-fonts") # http://www.google.com/fonts/ # https://developers.google.com/fonts/docs/getting_started # https://developers.google.com/fonts/docs/webfont_loader # http://en.wikipedia.org/wiki/Woff # http://en.wikipedia.org/wiki/Web_typography # http://en.wikiversity.org/wiki/Web_Design # http://en.wikipedia.org/wiki/Font_family_(HTML) # http://en.wikipedia.org/wiki/HTML_element#Presentational_markup <link href='http://fonts.googleapis.com/css?family=Averia+Sans+Libre|Lustria|Lilita+One|Glegoo|Dosis|Galindo|Gilda+Display|Fredericka+the+Great|Poiret+One|Erica+One|Quicksand|Glass+Antiqua|Josefin+Sans|Gentium+Basic|Life+Savers|Sniglet:800|Ovo|Exo|Yanone+Kaffeesatz|Merriweather+Sans|Cinzel|Cinzel+Decorative|Gabriela|Quando|Quattrocento|Averia+Libre|Righteous|Titan+One' rel='stylesheet' type='text/css'> font-family: 'Averia Libre', cursive; font-family: 'Averia Sans Libre', cursive; font-family: 'Cinzel Decorative', cursive; font-family: 'Cinzel', serif; font-family: 'Dosis', sans-serif; font-family: 'Erica One', cursive; font-family: 'Exo', sans-serif; font-family: 'Fredericka the Great', cursive; font-family: 'Gabriela', serif; font-family: 'Galindo', cursive; font-family: 'Gentium Basic', serif; font-family: 'Gilda Display', serif; font-family: 'Glass Antiqua', cursive; font-family: 'Glegoo', serif; font-family: 'Josefin Sans', sans-serif; font-family: 'Life Savers', cursive; font-family: 'Lilita One', cursive; font-family: 'Lustria', serif; font-family: 'Merriweather Sans', sans-serif; font-family: 'Ovo', serif; font-family: 'Poiret One', cursive; font-family: 'Quando', serif; font-family: 'Quattrocento', serif; font-family: 'Quicksand', sans-serif; font-family: 'Righteous', cursive; font-family: 'Sniglet', cursive; font-family: 'Titan One', cursive; font-family: 'Yanone Kaffeesatz', sans-serif; http://www.squarefree.com/shell/ http://www.squarefree.com/shell/shell.html http://www.squarefree.com/jsenv/ <link href='http://fonts.googleapis.com/css?family=Stint+Ultra+Condensed&subset=latin,latin-ext' rel='stylesheet' type='text/css'> src: local('Stint Ultra Condensed'), local('StintUltraCondensed-Regular'), url(http://themes.googleusercontent.com/static/fonts/stintultracondensed/v2/8DqLK6-YSClFZt3u3EgOUaUJG7Ig7aTS4T8tAkfaVMs.woff) format('woff'); * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) cd /tmp/ wget http://themes.googleusercontent.com/static/fonts/stintultracondensed/v2/8DqLK6-YSClFZt3u3EgOUaUJG7Ig7aTS4T8tAkfaVMs.woff # (find-fline "~/SCRIBUS/") http://www.youtube.com/watch?v=v78HRi-J2ek MozRepl http://repo.hyperstruct.net/mozrepl/devel/mozrepl.xpi http://www.webdesignbooth.com/9-useful-javascript-syntax-highlighting-scripts/ http://developer.mozilla.org/presentations/xtech2006/javascript/ http://technomancy.us/ http://research.sun.com/projects/lively/tutorial/index.htm http://mxr.mozilla.org/mozilla/source/js/narcissus/ One thing you might look at is Firefox's Javascript engine. In Javascript, calling toString() on a function object returns a prettified version of the function's code. For an example, paste this (all one line) into the Firefox Error Console (Tools -> Error Console): * (eepitch-moz) (function () { var i=0; for(i=0;i<10;i++) doSomething(); doSomethingElse(); }).toString() -- http://lua-users.org/lists/lua-l/2008-05/msg00778.html http://steve-yegge.blogspot.com/2008/10/universal-design-pattern.html http://steve-yegge.blogspot.com/2008/10/universal-design-pattern.html#JavaScript http://www.crockford.com/javascript/little.html # (find-zsh "availabledebs | sort | grep jquery") # (find-zsh "availabledebs | sort | grep -i ecmascript") http://en.wikipedia.org/wiki/Prototype-based_programming http://elinks.or.cz/documentation/manual.html http://lanyrd.com/2012/jsconf-us/sqxbg/ http://mrdoob.com/projects/voxels/#A/ ##### # # Design tosco genial # 2013jun15 # ##### # «apolinario-passos» (to ".apolinario-passos") # http://www.apolinariopassos.com.br/ # http://www.apolinariopassos.com.br/placascopa/ # http://apolinariopassos.com.br/ # http://www.facebook.com/apolinariosteps ##### # # hatnote # 2013aug23 # ##### # «hatnote» (to ".hatnote") # http://listen.hatnote.com/ # http://listen.hatnote.com/#nowelcomes,en # http://blog.hatnote.com/ ##### # # Adding links to PRE blocks # 2013sep23 # ##### # «add-links-to-PRE» (to ".add-links-to-PRE") # (find-angg "HTML/local-videos.js") # (find-THfile "html5-audio.blogme" "activated automatically") ##### # # Activate links to youtube (with the local files trick) # 2013sep26 # ##### # «youtube-activate» (to ".youtube-activate") # (find-blogme3 "local-videos.js") * (eepitch-smjs) * (eepitch-kill) * (eepitch-smjs) run("../blogme3/local-videos.js") run("/home/edrx/blogme3/local-videos.js") * (eepitch-blogme3) * (eepitch-kill) * (eepitch-blogme3) = blogmedir js = readfile(blogmedir.."local-videos.js") = js JS0(blogmedir) ##### # # underscore.js # 2013oct02 # ##### # «underscore.js» (to ".underscore.js") # http://underscorejs.org/ # http://underscorejs.org/docs/underscore.html # http://underscorejs.org/underscore.js (code-c-d "underscorejs" "$S/http/underscorejs.org/") # (find-underscorejsfile "") # (find-underscorejsfile "underscore.js") # (find-underscorejsfile "underscore.js" "escape:") # (find-efunction 'url-insert-entities-in-string) # (find-efunction 'url-insert-entities-in-string "& ==> &") ##### # # addeventlistener # 2013dec16 # ##### # «addeventlistener» (to ".addeventlistener") # http://stackoverflow.com/questions/14135126/onclick-vs-addeventlistener # http://stackoverflow.com/questions/15255801/javascript-addeventlistener-function # http://www.w3.org/TR/DOM-Level-2-Events/events.html # https://developer.mozilla.org/en-US/docs/Web/API/EventTarget.addEventListener *** # (find-fline "~/LOGS/2013dec16.javascript") hi... I am really intrigued by a trick that the DOM uses, can anyone explain to me how it is implemented in JavaScript? In short: in order to bind the space and enter keys in the textboxes in http://angg.twu.net/2013-petropolis.html I had to generate HTML code like this for them: <input size=8 value="1:23" onkeydown="kpla()"> but then when a keydown event happens in a textbox the function kpla in onkeydown="kpla()" is called WITH AN EXTRA ARGUMENT, like this: kpla(event) when I friend (who is a bit of a cut-and-paste programmer) showed me that I had to write onkeydown="kpla()", and that onkeydown="kpla" would not work, I of course told him that of course not, anyone who implemented that in that way would be fired and cursed forever... the only not-to-ugly way to implement that would be for the DOM to do some string processing on the "kpla()" of onkeydown="kpla()" and REWRITING IT to something like "kpla(event)" BEFORE evaluating it... anyone has any pointers about that? thanks in advance, and sorry for this not being a 100%-javascript and 0%-DOM question... ##### # # setTimeout # 2013dec25 # ##### # «settimeout» (to ".settimeout") // youtube_activate("corpo"); window.setTimeout(function () { youtube_activate("corpo"); }, 1000) ##### # # location # 2014feb13 # ##### # «location» (to ".location") # https://developer.mozilla.org/en-US/docs/Web/API/Location # https://developer.mozilla.org/en-US/docs/Web/API/Document.location # https://developer.mozilla.org/en-US/docs/Web/API/Window.location # (find-fline "~/LOGS/2014feb12.javascript") location_t = function () { var A = window.location.hash.match(/[?#]t=([^&])/); if (A) { return A[1]; } } ##### # # oncut, oncopy, onpaste # 2014dec29 # ##### # «oncut-oncopy-onpaste» (to ".oncut-oncopy-onpaste") # http://tiagomadeira.com/2014/04/como-copiar-textos-da-folha-e-outros-sites-que-nao-deixam/ # http://tiagomadeira.com/2013/07/como-ler-noticias-ilimitadas-de-folha-estadao-e-globo-sem-cadastro/ # javascript:all=document.querySelectorAll('*');for(i=0;i<all.length;i++)all[i].oncopy=function(e){e.stopPropagation();return true};void(0) ##### # # yarn # 2019oct01 # ##### # «yarn» (to ".yarn") # (find-zsh "installeddebs | sort | grep yarn") # (find-zsh "availabledebs | sort | grep yarn") # https://en.wikipedia.org/wiki/Npm_(software)#Alternatives Yarn # https://blog.npmjs.org/post/151660845210/hello-yarn # https://github.com/yarnpkg/yarn # https://yarnpkg.com/ # https://yarnpkg.com/lang/en/ ##### # # yarn-mode # 2020jan02 # ##### # «yarn-mode» (to ".yarn-mode") # https://github.com/anachronic/yarn-mode/blob/master/.travis.yml # https://github.com/anachronic/yarn-mode/ ##### # # bower # 2019nov17 # ##### # «bower» (to ".bower") # https://libraries.io/bower/ # https://bower.io/ * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) npm install -g bower # WARN deprecated [email protected]: We don't recommend using Bower for new projects # Please consider Yarn and Webpack or Parcel. # You can read how to migrate legacy project here: # https://bower.io/blog/2017/how-to-migrate-away-from-bower/ ##### # # easy6502 # 2019dec08 # ##### # «easy6502» (to ".easy6502") # http://skilldrick.github.io/easy6502/ # https://github.com/skilldrick/6502js # (find-git-links "https://github.com/skilldrick/6502js" "6502js") # https://en.wikipedia.org/wiki/Color_Graphics_Adapter#Standard_text_modes * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) # rm -Rfv ~/usrc/6502js/ cd ~/usrc/ git clone https://github.com/skilldrick/6502js cd ~/usrc/6502js/ git branch --list -a git for-each-ref PAGER=cat git log --oneline --graph --all -20 # (find-fline "~/usrc/") # (find-fline "~/usrc/6502js/") # (find-gitk "~/usrc/6502js/") # (code-c-d "6502js" "~/usrc/6502js/") # (find-6502jsfile "") ##### # # Mike Stay's series about CT in JavaScript # 2020apr14 # ##### # «jscategory» (to ".jscategory") https://jscategory.wordpress.com/ https://www.youtube.com/playlist?list=PLwuUlC2HlHGe7vmItFmrdBLn6p0AS8ALX https://monster6502.com/ asdf http://mirven.github.io/underscore.lua/ http://www.amazon.com/gp/product/B00D624AQO Functional JavaScript: Introducing Functional Programming with Underscore.js http://www.amazon.com/Testable-JavaScript-Mark-Ethan-Trostler-ebook/dp/B00B1WLE92/ COMO SELECIONAR TODOS OS SEUS AMIGOS DO FACEBOOK COM APENAS UM CLIQUE (ATUALIZADO) Obs.: Funciona apenas no navegador Google Chrome! 1 - Clicar na opção de convidar amigos e desce a barra de rolagem até correr a lista toda. 2 - Copie e cole o seguinte código na barra de endereços: javascript:elms=document.getElementsByName("checkableitems[]");for (i=0;i<elms.length;i++){if (elms[i].type="checkbox" )elms[i].click()} 3 - Retire o espaço entre a palavra "java" e a palavra "script" e dê Enter 4 - Clique em salvar para enviar os convites. http://ngm.nationalgeographic.com/2013/04/125-mammoth-tusks/larmer-text (9 videos) http://dorey.github.io/JavaScript-Equality-Table/ http://www.reddit.com/r/programming/comments/21ezh3/javascript_equality_table/ https://kristopolous.github.io/BOOTSTRA.386/index.html http://www.stuartmcmillen.com/comics_en/rat-park/ https://www.websocket.org/demos.html http://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/ http://thibaultlaurens.github.io/javascript/2013/04/29/how-the-v8-engine-works/ https://read.acloud.guru/six-months-of-serverless-lessons-learned-f6da86a73526 https://blog.sessionstack.com/how-javascript-works-deep-dive-into-call-apply-and-bind-415f6729c902 https://news.ycombinator.com/item?id=28073383 Kid Pix as a JavaScript App (kidpix.app) https://news.ycombinator.com/item?id=23546706 No Paint https://news.ycombinator.com/item?id=29857074 Proposed bill in New Hampshire would enshrine free software into law (libreboot.org) - javascript https://github.com/xuchunyang/marionette.el https://mathiasbynens.be/notes/globalthis https://www.json.org/json-en.html json railroad diagrams # Local Variables: # coding: utf-8-unix # End: