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
// atma-class | |
// common node.js and browser | |
var Article = Class('Article', { | |
Base: Class.Serializable({ | |
date: Date | |
}), | |
_id: null, | |
date: null, | |
body: '', |
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 obj_normalize = (function() { | |
function runNormalizer(currentValue, normalizer) { | |
if (typeof normalizer === 'function') | |
return normalizer(currentValue); | |
// other types of normalization, like Regexp-Replace | |
return currentValue.replace(normalizer[0], normalizer[1]); |
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
RegExp.fromString = function(str, flags) { | |
return new RegExp(str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), flags); | |
}; |
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 view = ko.views.manager.currentView, | |
scimoz = view.scimoz, | |
selection = scimoz.selText, | |
result = null, | |
log = function() { | |
var message = ''; | |
for (var i = 0; i < arguments.length; i++) { | |
message += arguments[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
var view = ko.views.manager.currentView, | |
scimoz = view.scimoz, | |
selection = scimoz.selText || scimoz.text, | |
service = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService), | |
log = function() { | |
var message = ''; | |
for (var i = 0; i < arguments.length; i++) { | |
message += arguments[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
function Deferred(){} | |
(function(){ | |
Deferred.prototype = { | |
_isAsync: true, | |
_done: null, | |
_fail: null, | |
_always: null, |
NewerOlder