🤷♂️
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
var glob = require('glob') | |
, fs = require('fs') | |
, cheerio = require('cheerio') | |
, _ = require('lodash') | |
, contentful = require('contentful') | |
, htmlFilePath = './page.html' | |
, htmlFile = fs.readFileSync(htmlFilePath); | |
; |
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
FormHelper = { | |
getFormData: function(event, allowEmpty) { | |
var allowEmpty = 'boolean' === typeof allowEmpty ? allowEmpty : true; | |
var form = event.target ? $(event.target) : event; | |
var data = {}; | |
form.find('input[type="hidden"][name], input[type="text"][name], input[name]:checked, textarea[name], select[name]').each(function(i) { | |
var keys = $(this).attr('name').replace(/\]/g, '').split('['); | |
var marker; | |
for (var i = 0; i < keys.length; i++) { |
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
addressbook_autocomplete: function() { | |
if ($('input[data-bind="addressbook-autocomplete"]').length > 0) { | |
$('input[data-bind="addressbook-autocomplete"]').autocomplete('destroy'); | |
$('input[data-bind="addressbook-autocomplete"]').show(); | |
function aao_handle_select(that, label, address) { | |
var div = document.createElement('div'); | |
$('div[data-handle-for="' + $(that).attr('name') + '"]').remove(); |
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
var data = {} | |
, fields = [ | |
'earth[africa][sudan][lion]' | |
, 'earth[africa][sudan][girafe]' | |
, 'earth[africa][sudan][monkeys][lemur]' | |
, 'earth[africa][zimbabwee][elephants]' | |
, 'earth[africa][zimbabwee][elephants]' | |
, 'earth[africa][zimbabwee][elephants]' | |
, 'earth[europe][switzerland][chocolate]' | |
, 'pluto[isnt][a][planet]' |
NewerOlder