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
/** | |
* JavaScript implementation of a Proxy class. | |
**/ | |
function Proxy(p_target) | |
{ | |
var self = this; | |
self.target = p_target; | |
// Access target's properties | |
self.get = function (p_property) |
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
module.exports = (grunt) -> | |
config = | |
browserify: | |
development: | |
options: | |
transform: ["coffeeify"] | |
debug: true | |
files: | |
"./public/scripts/editor.js": ["./frontend/scripts/editor.coffee"] | |
uglify: |
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
# Create a deep copy of an object. - CoffeeScript conversion of @cederberg's deepClone implementation https://github.com/documentcloud/underscore/pull/595 | |
deepClone = (obj) -> | |
if !_.isObject(obj) or _.isFunction(obj) then return obj | |
if _.isDate obj then return new Date do obj.getTime | |
if _.isRegExp obj then return new RegExp obj.source, obj.toString().replace(/.*\//, "") | |
isArr = _.isArray obj or _.isArguments obj | |
func = (memo, value, key) -> | |
if isArr then memo.push deepClone value |
OlderNewer