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
# coding=utf-8 | |
from __future__ import absolute_import, print_function, unicode_literals | |
from pprint import pprint | |
from bson import ObjectId, SON | |
from pymongo import MongoClient | |
from pymongo.collection import Collection | |
from key_escaper import DeterministicKeyEscaper |
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($) { | |
$.extend($.fn, { | |
serializeJson: function() { | |
var payload = {}, | |
regex = /^(\w+)\[(\d*)\]$/; | |
$.each($(this).serializeArray(), function(i, input) { | |
var res = input.name.match(regex); | |
if(res) { | |
if(! (res[1] in payload)) { |
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
/** Shows or hides a Bootstrap 3 modal and returns a Promise object. | |
* | |
* Bootstrap's modal functions return before the modal is shown/ | |
* hidden, which can cause glitches if subsequent code doesn't | |
* expect that. | |
* | |
* Unfortunately, there is no built-in way to defer an | |
* operation until after the modal is shown/hidden, so | |
* this function does a little monkey-patching to make | |
* it work. |
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
/* ... snip ... */ | |
/** Load and parse .properties files */ | |
function loadAndParseFile(filename, settings) { | |
/* If we are making a cross-domain request, switch to JSONP mode. */ | |
var dataType = 'text'; | |
if( /^(https?:)?\/\//.test(filename) ) { | |
dataType = 'jsonp'; | |
} |