#protip: type an element ID into Safari (possibly chrome+others) dev console and get a reference to that element
Need to use require.js to load a bunch of scripts compiled via assetic into a PHP file, annoyed by auto-append of .js, don’t want to set up irritating routing? Add a ? to the URL, require.js will add a .js to the query string, loading the file correctly.
cssquirrel Zepto is nice for browser extensions, where the browser will always be modern and capable
cssquirrel even the if/else is redundant ;)
function awesomeWorkday(tasks) {
return (tasks instanceof coolJsonStuff || tasks instanceof coolApiStuff) ? true : false;
}
Cross-browser selection UI injection flow:
mouseup
on body
window.getSelection()
s.isCollapsed === false
, returns.getRangeAt(0)
r.surroundContents(e)
e.innerHTML
and e.textContent
now return useful values, and e’s coordinates can be used to inject UI into the pageTo resolve: what element should e be? Or more accurately, what display property should it have? Possibly inline-block
(inline mucks up if selection is across block elements, block mucks up selections within text nodes)
r.surroundContent
, namely that it does not handle partial element selections. See MDNs explanation and solution.
Twitter’s typeahead.js looks like a great base for #indieweb #autosuggest — it certainly has better UX than my current technique #bookmark #js
Glenn Jones I can highly recommend kangoextensions.com as an open source framework for cross-browser extensions. I’m using it for indieweb reply and own-your-comments
Pushed lots of note UI updates to #taproot today, including porting almost all the #js to Backbone. Still #todo:
Updates to IndieWeb Reply mean that it is now cross browser using the exact same codebase courtesy of kangoextensions.com!
Trying out kangoextensions.com for cross-browser extension building. I kinda feel this is something vendors should have figured out already :/
Current status: hacking Aaron Parecki’s IndieWeb Twitter Reply Extension into something more structured and extendable. #webactions in action!
Writing a jQuery plugin. I have become my own worst enemy. But all the other in-place edit plugins are either horrible or try to be a REST syncing service too.
Aral Balkan perhaps noscript should add “get theonion articles free” to their feature list
Aral Balkan #idea for browser extension: site-specific js disabling. If you disable js on theOnion the paywall goes away :/
Learning #angularjs. The documentation is so very much better than #emberjs. I am purposefully not checking out each step of the tutorial, instead writing it myself.
Jack Way netbeans is certainly the best IDE for php I’ve used so far. Angular.js looks nice, I’m trying to learn ember at the mo but the docs are rather inadequate.