✓ Bar
✓ A <p>Baz!</p> B
✓ <p>Foo</p> <script> a < b; </script> <span>Blam!</span>
✓ <p>Foo</p> <script type='text/javascript'> a < b || c > d; </script> <span>Blam!</span>
✓ D <p>Foo</p> <script type='text/javascript'>$('body').append('<' + 'script> a < b; <' + '/script>');</script> <span>Blam!</span> F <b>O</b>
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
(function () | |
{ | |
if (!Function.prototype.inherit) | |
{ | |
Function.prototype.inherit = function (p_parent) | |
{ | |
if (p_parent.constructor == Function) | |
{ | |
// Normal Inheritance | |
this.prototype = new p_parent(); |
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
window.fbAsyncInit = -> | |
FB.init | |
appId: '0123456789' # App ID | |
channelUrl: "//#{ window.location.hostname }/channel.html" # Channel File | |
status: true # Check login status | |
cookie: true # Enable cookies to allow the server to access the session | |
xfbml: true # parse XFBML | |
frictionlessRequests: true # Enable frictionless Request dialogs | |
# Application-specific initialization code goes here |
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 = angular.module 'FacebookPluginDirectives', [] | |
createDirective = (name) -> | |
module.directive name, -> | |
restrict: 'C' | |
link: (scope, element, attributes) -> | |
FB?.XFBML.parse(element.parent()[0]) | |
createDirective pluginName for pluginName in ['fbActivity', 'fbComments', 'fbFacepile', 'fbLike', 'fbLikeBox', 'fbLiveStream', 'fbLoginButton', 'fbName', 'fbProfilePic', 'fbRecommendations'] |
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 |
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
<head> | |
<!-- Rest of the <head> content here --> | |
<!-- Include jQuery --> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
</head> | |
<body> | |
<!-- Rest of the <body> content here --> |
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
toRad = (p_angle) -> | |
return (p_angle - 90) * Math.PI / 180 | |
for method in ["drawArc", "drawRoundRect", "drawSlice"] | |
if PIXI.Graphics.prototype[method]? then console.warn "PixiJS already has an #{method} method defined. It's recommended that you update your code to use the official implementation." | |
PIXI.Graphics.prototype.drawArc = (p_x, p_y, p_radius, p_startAngle, p_endAngle) -> | |
totalAngle = p_endAngle - p_startAngle | |
segments = Math.ceil Math.abs(Math.sqrt(1 - Math.pow (1 - Math.min(p_radius / 60, 1)), 2) * totalAngle * p_radius * 0.01) | |
anglePerSegment = totalAngle / segments |
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
# Adjust device pixel ratio | |
setMaximumPixelRatio = (p_maximumRatio=1) -> | |
canvas = document.createElement('canvas') | |
context = canvas.getContext('2d') | |
devicePixelRatio = window.devicePixelRatio || 1 | |
backingStoreRatio = context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1 | |
pixelRatio = devicePixelRatio / backingStoreRatio | |
for className in ["HitCanvas", "SceneCanvas", "Canvas"] | |
Kinetic[className].prototype.init = ((p_method) -> (p_config={}) -> |
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: |
OlderNewer