This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
def archive_to_bytes(archive): | |
def to_seconds(s): | |
SECONDS_IN_A = { | |
's': 1, | |
'm': 1 * 60, | |
'h': 1 * 60 * 60, |
This file contains 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
const tu = require('../tu'); // tu == test utils | |
const expect = tu.expect; | |
const withDocument = tu.withDocument; | |
const componentHtmlAndScript = { | |
html: ` | |
<textarea id="editableArea"></textarea> | |
<div id="counter"></div> | |
`, | |
// load the JS module under test |
This file contains 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
const path = require('path'); | |
const _ = require('lodash'); | |
const AssertionError = require('assertion-error'); | |
const chai = require('chai'); | |
const chaiAsPromised = require('chai-as-promised'); | |
const jsdom = require('jsdom'); | |
const Q = require('q'); | |
const sinonChai = require('sinon-chai'); |
This file contains 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
const tu = require('../tu'); | |
const expect = tu.expect; | |
const withDocument = tu.withDocument; | |
const ratingStarsJspAndScript = { | |
jsp: 'include/editableRatingStars', | |
hopModules: 'Hop/components/editable-rating-stars', | |
attributes: { | |
param: {path: 'someRadioInput'} | |
} |
This file contains 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
<%@ page contentType="text/html;charset=UTF-8" language="java" %> | |
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> | |
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> | |
<div class="no-mg editable-rating-stars"> | |
<div class="stars"> | |
<ul class="inline-list no-lstyle"> | |
<c:forEach begin="1" end="5" var="rate"> | |
<li class="star"> |
This file contains 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
// skipped: 17 lines to define webpackBootstrap and __webpack_require__... | |
webpackBootstrap({ | |
0: function(module, exports, __webpack_require__) { | |
var helloTemplate = __webpack_require__(371); | |
console.log(helloTemplate({name: 'John'})); | |
}, | |
188: function(module, exports) { module.exports = Handlebars; }, | |
371: function(module, exports, __webpack_require__) { |
This file contains 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
<%@ taglib prefix="hbs" uri="http://www.hopwork.com/jsp/jstl/handlebars" %> | |
<%-- preferred form: all needed data are computed outside of the view and put into ${headerData} --%> | |
<hbs:render template="common/header" context="${headerData}"/> | |
<%-- sometimes, it's still useful to tweak the view independently of the data --%> | |
<hbs:render template="some/other/template"> | |
<hbs:contextProperty name="someCondition" value="true"/> | |
<hbs:contextProperty name="someConfigProperty" value="SOME_CONFIG_VALUE"/> | |
<hbs:contextProperty name="data" value="${someData}"/> |
This file contains 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
jspackConfiguration.module.loaders.push({ | |
test: /\.hbs$/, | |
loader: 'handlebars-loader' + | |
// Tell handlebars-loader where our custom helpers are to be found. | |
// Note: helpers' names are derived from their file name. | |
'?helperDirs[]=' + __dirname + '/handlebars-helpers' + | |
// Force handlebars-loader not to include Handlebars runtime, | |
// since it is already included in our common bundle. |
OlderNewer