This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if isHappy then cheer() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (isHappy) { | |
cheer(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (isHappy) { cheer(); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Example from SwitchyOmega/omega-target-chromium-extension/src/coffee/background.coffee: | |
168 | state = new OmegaTargetCurrent.BrowserStorage(localStorage, 'omega.local.') | |
169 | | |
> 170 | if chrome?.storage?.sync or browser?.storage?.sync | |
| ^^^^^^ | |
171 | syncStorage = new OmegaTargetCurrent.Storage('sync') | |
172 | sync = new OmegaTargetCurrent.OptionsSync(syncStorage) | |
Example from SwitchyOmega/omega-target-chromium-extension/src/coffee/background.coffee: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function assertResultsEqual(jadeResult: string, reactResult: string, name: string): void { | |
const normalizedJade = jadeResult | |
// React needs defaultChecked instead of checked and puts it at the end, and renders it as | |
// `checked=""`. Jade renders it as `checked="checked"`. Reposition and rewrite Jade checked | |
// attributes to match React. | |
.replace(/<([^>]*) checked="checked"([^>]*)\/>/g, '<$1$2 checked=""/>') | |
// Same with defaultValue/value. | |
.replace(/<([^>]*) value="([^"]*)"([^>]*)\/>/g, '<$1$3 value="$2"/>') | |
// Similar to "checked", some other boolean attributes render differently. | |
.replace(/disabled="disabled"/g, 'disabled=""') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
span | |
span.ownable-owner= owner_handle | |
if !writable | |
span.glyphicon.glyphicon-eye-open | |
| | |
= name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
td.mono= name | |
td | |
div.swatch(style='background-color: ' + color + ';') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ActiveEnzymeTemplate from './templates/activeenzyme.jade'; | |
... | |
class ActiveEnzymeItemView extends Backbone.View { | |
static initClass() { | |
this.prototype.tagName = 'tr'; | |
this.prototype.events = { | |
click: 'removeEnzyme', | |
}; | |
} | |
removeEnzyme() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface ActiveEnzymeProps { | |
color: string; | |
name: string; | |
onRemove: () => void; | |
} | |
export default function ActiveEnzyme({color, name, onRemove}: ActiveEnzymeProps): JSX.Element { | |
return ( | |
<tr onClick={onRemove}> | |
<td className="mono">{name}</td> | |
<td> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function template(locals) { | |
var buf = []; | |
var jade_mixins = {}; | |
var jade_interp; | |
;var locals_for_with = (locals || {});(function (color, name) { | |
buf.push("<td class=\"mono\">" + (jade.escape(null == (jade_interp = name) ? "" : jade_interp)) + "</td><td>"); | |
if ( color) | |
{ | |
buf.push("<div" + (jade.attr("style", 'background-color:' + color, true, false)) + " class=\"swatch\"></div>"); | |
} |