I("Insert", editing mode)
$(non-editing mode)A("Append", editing mode)
| define([ | |
| 'template', | |
| ], function(tmpl) { | |
| 'use strict'; | |
| /*! | |
| * Tooltip Module | |
| * Assumes use of JavaScript templating library. | |
| * |
| # set aliases | |
| DIST = \ | |
| ~/Dropbox\ \(Company\)/Public/www | |
| DIRS = \ | |
| css/ js/ less/ | |
| # copy files & directories (exluding lib) | |
| copy: | |
| cp *.html $(DIST)/project-name/ |
| // | |
| // Arrow Mixins | |
| // -------------------------------------------------- | |
| .pct-arrow (@dir, @width, @color: @arrow-green) when (@dir = up) { | |
| border-bottom: @width solid @color; | |
| border-left: @width solid transparent; | |
| border-right: @width solid transparent; | |
| } |
| // | |
| // Mixins: Flexbox | |
| // -------------------------------------------------- | |
| .flex() { | |
| display: -webkit-flex; | |
| display: -ms-flexbox; | |
| display: flex; | |
| } |
| // Alternative JavaScript Syntax | |
| Person = :(name, address) { @name!, @address! } | |
| Person::inspect = :{ <: "{@name} lives at {@address}" } | |
| tj := Person('TJ', '314 Bessborough ave') | |
| bob := Person('Bob', 'Some place') | |
| [tj, bob].each(:(person){ print(person.inspect()) }) |
| <snippet> | |
| <content><![CDATA[ | |
| <% $1 %> | |
| ]]></content> | |
| <tabTrigger>%</tabTrigger> | |
| <description>ERB Tag</description> | |
| <scope>source.erb</scope> | |
| </snippet> |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Spotify Artist Search</title> | |
| <link rel="stylesheet" type="text/css" href="https://developer.spotify.com/web-api/static/css/cached.css"> | |
| <style> | |
| body { | |
| padding: 20px; | |
| } |
| let swapHeaderImage = (() => { | |
| const hero = document.querySelector('.hero'); | |
| let current = 1; | |
| let next = 2; | |
| function init() { | |
| hero.classList.remove(Array.from(hero.classList).pop()); | |
| hero.classList.add(`artist-banner-${current}`); | |
| } |