diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..ef55553 --- /dev/null +++ b/.htaccess @@ -0,0 +1,536 @@ +# Apache configuration file +# httpd.apache.org/docs/2.2/mod/quickreference.html + +# Note .htaccess files are an overhead, this logic should be in your Apache config if possible +# httpd.apache.org/docs/2.2/howto/htaccess.html + +# Techniques in here adapted from all over, including: +# Kroc Camen: camendesign.com/.htaccess +# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/ +# Sample .htaccess file of CMS MODx: modxcms.com + + +### +### If you run a webserver other than Apache, consider: +### github.com/h5bp/server-configs +### + + + +# ---------------------------------------------------------------------- +# Better website experience for IE users +# ---------------------------------------------------------------------- + +# Force the latest IE version, in various cases when it may fall back to IE7 mode +# github.com/rails/rails/commit/123eb25#commitcomment-118920 +# Use ChromeFrame if it's installed for a better experience for the poor IE folk + + + Header set X-UA-Compatible "IE=Edge,chrome=1" + # mod_headers can't match by content-type, but we don't want to send this header on *everything*... + + Header unset X-UA-Compatible + + + + +# ---------------------------------------------------------------------- +# Cross-domain AJAX requests +# ---------------------------------------------------------------------- + +# Serve cross-domain Ajax requests, disabled by default. +# enable-cors.org +# code.google.com/p/html5security/wiki/CrossOriginRequestSecurity + +# +# Header set Access-Control-Allow-Origin "*" +# + + +# ---------------------------------------------------------------------- +# CORS-enabled images (@crossorigin) +# ---------------------------------------------------------------------- + +# Send CORS headers if browsers request them; enabled by default for images. +# developer.mozilla.org/en/CORS_Enabled_Image +# blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html +# hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/ +# wiki.mozilla.org/Security/Reviews/crossoriginAttribute + + + + # mod_headers, y u no match by Content-Type?! + + SetEnvIf Origin ":" IS_CORS + Header set Access-Control-Allow-Origin "*" env=IS_CORS + + + + + +# ---------------------------------------------------------------------- +# Webfont access +# ---------------------------------------------------------------------- + +# Allow access from all domains for webfonts. +# Alternatively you could only whitelist your +# subdomains like "subdomain.example.com". + + + + Header set Access-Control-Allow-Origin "*" + + + + + +# ---------------------------------------------------------------------- +# Proper MIME type for all files +# ---------------------------------------------------------------------- + + +# JavaScript +# Normalize to standard type (it's sniffed in IE anyways) +# tools.ietf.org/html/rfc4329#section-7.2 +AddType application/javascript js + +# Audio +AddType audio/ogg oga ogg +AddType audio/mp4 m4a + +# Video +AddType video/ogg ogv +AddType video/mp4 mp4 m4v +AddType video/webm webm + +# SVG +# Required for svg webfonts on iPad +# twitter.com/FontSquirrel/status/14855840545 +AddType image/svg+xml svg svgz +AddEncoding gzip svgz + +# Webfonts +AddType application/vnd.ms-fontobject eot +AddType application/x-font-ttf ttf ttc +AddType font/opentype otf +AddType application/x-font-woff woff + +# Assorted types +AddType image/x-icon ico +AddType image/webp webp +AddType text/cache-manifest appcache manifest +AddType text/x-component htc +AddType application/x-chrome-extension crx +AddType application/x-opera-extension oex +AddType application/x-xpinstall xpi +AddType application/octet-stream safariextz +AddType application/x-web-app-manifest+json webapp +AddType text/x-vcard vcf + + + +# ---------------------------------------------------------------------- +# Allow concatenation from within specific js and css files +# ---------------------------------------------------------------------- + +# e.g. Inside of script.combined.js you could have +# +# +# and they would be included into this single file. + +# This is not in use in the boilerplate as it stands. You may +# choose to name your files in this way for this advantage or +# concatenate and minify them manually. +# Disabled by default. + +# +# Options +Includes +# AddOutputFilterByType INCLUDES application/javascript application/json +# SetOutputFilter INCLUDES +# +# +# Options +Includes +# AddOutputFilterByType INCLUDES text/css +# SetOutputFilter INCLUDES +# + + +# ---------------------------------------------------------------------- +# Gzip compression +# ---------------------------------------------------------------------- + + + + # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/ + + + SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding + RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding + + + + # HTML, TXT, CSS, JavaScript, JSON, XML, HTC: + + FilterDeclare COMPRESS + FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html + FilterProvider COMPRESS DEFLATE resp=Content-Type $text/css + FilterProvider COMPRESS DEFLATE resp=Content-Type $text/plain + FilterProvider COMPRESS DEFLATE resp=Content-Type $text/xml + FilterProvider COMPRESS DEFLATE resp=Content-Type $text/x-component + FilterProvider COMPRESS DEFLATE resp=Content-Type $application/javascript + FilterProvider COMPRESS DEFLATE resp=Content-Type $application/json + FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xml + FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xhtml+xml + FilterProvider COMPRESS DEFLATE resp=Content-Type $application/rss+xml + FilterProvider COMPRESS DEFLATE resp=Content-Type $application/atom+xml + FilterProvider COMPRESS DEFLATE resp=Content-Type $application/vnd.ms-fontobject + FilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xml + FilterProvider COMPRESS DEFLATE resp=Content-Type $image/x-icon + FilterProvider COMPRESS DEFLATE resp=Content-Type $application/x-font-ttf + FilterProvider COMPRESS DEFLATE resp=Content-Type $font/opentype + FilterChain COMPRESS + FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no + + + + # Legacy versions of Apache + AddOutputFilterByType DEFLATE text/html text/plain text/css application/json + AddOutputFilterByType DEFLATE application/javascript + AddOutputFilterByType DEFLATE text/xml application/xml text/x-component + AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml + AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype + + + + + +# ---------------------------------------------------------------------- +# Expires headers (for better cache control) +# ---------------------------------------------------------------------- + +# These are pretty far-future expires headers. +# They assume you control versioning with cachebusting query params like +# + + + + + + + + + + + +
+ +
+
+ + +

node.js boilerplate using express, socket.io, mongooose, jquery.mobile & html 5

+
{#articles}

{title}


{date}
{body}{/articles}
+
+ + + + + + \ No newline at end of file diff --git a/node.html5.boilerplate/public/views/account.html b/node.html5.boilerplate/public/views/account.html new file mode 100644 index 0000000..4f69a7a --- /dev/null +++ b/node.html5.boilerplate/public/views/account.html @@ -0,0 +1,47 @@ + + + + + + + + + {title} + + + + + + + + + + + + + + + +
+ +
+
+ + +

My Account logout

+
{#articles}

{title}


{date}
{body}{/articles}
+
+ + + + + + \ No newline at end of file diff --git a/node.html5.boilerplate/public/views/contact.html b/node.html5.boilerplate/public/views/contact.html new file mode 100644 index 0000000..9c98ecb --- /dev/null +++ b/node.html5.boilerplate/public/views/contact.html @@ -0,0 +1,47 @@ + + + + + + + + + {title} + + + + + + + + + + + + + + + +
+ +
+
+ + +

contact us here {contact.email}

+
{#articles}

{title}


{date}
{body}{/articles}
+
+ + + + + + \ No newline at end of file diff --git a/node.html5.boilerplate/public/views/github.html b/node.html5.boilerplate/public/views/github.html new file mode 100644 index 0000000..bb139ea --- /dev/null +++ b/node.html5.boilerplate/public/views/github.html @@ -0,0 +1,47 @@ + + + + + + + + + {title} + + + + + + + + + + + + + + + +
+ +
+
+ + +

download {title} here

+
{#articles}

{title}


{date}
{body}{/articles}
+
+ + + + + + \ No newline at end of file diff --git a/node.html5.boilerplate/public/views/home.html b/node.html5.boilerplate/public/views/home.html new file mode 100644 index 0000000..25f6bf9 --- /dev/null +++ b/node.html5.boilerplate/public/views/home.html @@ -0,0 +1,47 @@ + + + + + + + + + {title} + + + + + + + + + + + + + + + +
+ +
+
+ + +

node.js boilerplate using express, socket.io, mongooose, jquery.mobile & html 5

+
{#articles}

{title}


{date}
{body}{/articles}
+
+ + + + + + \ No newline at end of file diff --git a/node.html5.boilerplate/public/views/login.html b/node.html5.boilerplate/public/views/login.html new file mode 100644 index 0000000..938ea6d --- /dev/null +++ b/node.html5.boilerplate/public/views/login.html @@ -0,0 +1,58 @@ + + + + + + + + + {title} + + + + + + + + + + + + + + + +
+ +
+
+ + +

complete the below to login/register

+
+
+ + +
+
+ + +
+ +
+
{#articles}

{title}


{date}
{body}{/articles}
+
+ + + + + + \ No newline at end of file diff --git a/node.jquery.mobile/public/views/about.html b/node.jquery.mobile/public/views/about.html new file mode 100644 index 0000000..c4f380e --- /dev/null +++ b/node.jquery.mobile/public/views/about.html @@ -0,0 +1,61 @@ + + + + + + + + {title} + + + + + + + + + + + + + + + + + +
+ +
+

{title}

+ +

node.js boilerplate using express, socket.io, mongooose, jquery.mobile & html 5

+ +
+ +
+ + \ No newline at end of file diff --git a/node.jquery.mobile/public/views/account.html b/node.jquery.mobile/public/views/account.html new file mode 100644 index 0000000..29e5681 --- /dev/null +++ b/node.jquery.mobile/public/views/account.html @@ -0,0 +1,61 @@ + + + + + + + + {title} + + + + + + + + + + + + + + + + + +
+ +
+

{title}

+ + My Account logout + +
+ +
+ + \ No newline at end of file diff --git a/node.jquery.mobile/public/views/contact.html b/node.jquery.mobile/public/views/contact.html new file mode 100644 index 0000000..9fcdcce --- /dev/null +++ b/node.jquery.mobile/public/views/contact.html @@ -0,0 +1,61 @@ + + + + + + + + {title} + + + + + + + + + + + + + + + + + +
+ +
+

{title}

+ +

contact us here {contact.email}

+ +
+ +
+ + diff --git a/node.jquery.mobile/public/views/github.html b/node.jquery.mobile/public/views/github.html new file mode 100644 index 0000000..d61dda6 --- /dev/null +++ b/node.jquery.mobile/public/views/github.html @@ -0,0 +1,61 @@ + + + + + + + + {title} + + + + + + + + + + + + + + + + + +
+ +
+

{title}

+ +

download {title} here

+ +
+ +
+ + diff --git a/node.jquery.mobile/public/views/home.html b/node.jquery.mobile/public/views/home.html new file mode 100644 index 0000000..b70d321 --- /dev/null +++ b/node.jquery.mobile/public/views/home.html @@ -0,0 +1,64 @@ + + + + + + + + {title} + + + + + + + + + + + + + + + + + +
+ +
+

{title}

+ + + + +
+ +
+ + \ No newline at end of file diff --git a/node.jquery.mobile/public/views/login.html b/node.jquery.mobile/public/views/login.html new file mode 100644 index 0000000..8c18ea5 --- /dev/null +++ b/node.jquery.mobile/public/views/login.html @@ -0,0 +1,69 @@ + + + + + + + + {title} + + + + + + + + + + + + + + + + + +
+ +
+

{title}

+ +

complete the below to login/register

+
+
+ + +
+
+ + +
+ +
+
+ +
+ + \ No newline at end of file diff --git a/node.jquery.mobile/public/views/partials/about.html b/node.jquery.mobile/public/views/partials/about.html new file mode 100644 index 0000000..a60d4bf --- /dev/null +++ b/node.jquery.mobile/public/views/partials/about.html @@ -0,0 +1,18 @@ +
+ +
+

{title}

+ +

node.js boilerplate using express, socket.io, mongooose, jquery.mobile & html 5

+ +
+ +
\ No newline at end of file diff --git a/node.jquery.mobile/public/views/partials/account.html b/node.jquery.mobile/public/views/partials/account.html new file mode 100644 index 0000000..7f813ad --- /dev/null +++ b/node.jquery.mobile/public/views/partials/account.html @@ -0,0 +1,18 @@ +
+ +
+

{title}

+ + My Account logout + +
+ +
\ No newline at end of file diff --git a/node.jquery.mobile/public/views/partials/compiled_0_0_1/about_0_0_1.js b/node.jquery.mobile/public/views/partials/compiled_0_0_1/about_0_0_1.js new file mode 100644 index 0000000..cd319f1 --- /dev/null +++ b/node.jquery.mobile/public/views/partials/compiled_0_0_1/about_0_0_1.js @@ -0,0 +1 @@ +(function(){dust.register("about",body_0);function body_0(chk,ctx){return chk.write("
Back

").reference(ctx.get("title"),ctx,"h").write("

").reference(ctx.get("title"),ctx,"h").write("

node.js boilerplate using express, socket.io, mongooose, jquery.mobile & html 5

@2012 ").reference(ctx.get("title"),ctx,"h").write("

");}function body_1(chk,ctx){return chk.write("
  • ").reference(ctx.get("text"),ctx,"h").write("
  • ");}return body_0;})(); \ No newline at end of file diff --git a/node.jquery.mobile/public/views/partials/compiled_0_0_1/account_0_0_1.js b/node.jquery.mobile/public/views/partials/compiled_0_0_1/account_0_0_1.js new file mode 100644 index 0000000..98f7ece --- /dev/null +++ b/node.jquery.mobile/public/views/partials/compiled_0_0_1/account_0_0_1.js @@ -0,0 +1 @@ +(function(){dust.register("account",body_0);function body_0(chk,ctx){return chk.write("
    Back

    ").reference(ctx.get("title"),ctx,"h").write("

    ").reference(ctx.get("title"),ctx,"h").write("

    My Account logout

    @2012 ").reference(ctx.get("title"),ctx,"h").write("

    ");}function body_1(chk,ctx){return chk.write("
  • ").reference(ctx.get("text"),ctx,"h").write("
  • ");}return body_0;})(); \ No newline at end of file diff --git a/node.jquery.mobile/public/views/partials/compiled_0_0_1/contact_0_0_1.js b/node.jquery.mobile/public/views/partials/compiled_0_0_1/contact_0_0_1.js new file mode 100644 index 0000000..b6f95a1 --- /dev/null +++ b/node.jquery.mobile/public/views/partials/compiled_0_0_1/contact_0_0_1.js @@ -0,0 +1 @@ +(function(){dust.register("contact",body_0);function body_0(chk,ctx){return chk.write("
    Back

    ").reference(ctx.get("title"),ctx,"h").write("

    ").reference(ctx.get("title"),ctx,"h").write("

    contact us here ").reference(ctx.getPath(false,["contact","email"]),ctx,"h").write("

    @2012 ").reference(ctx.get("title"),ctx,"h").write("

    ");}function body_1(chk,ctx){return chk.write("
  • ").reference(ctx.get("text"),ctx,"h").write("
  • ");}return body_0;})(); \ No newline at end of file diff --git a/node.jquery.mobile/public/views/partials/compiled_0_0_1/github_0_0_1.js b/node.jquery.mobile/public/views/partials/compiled_0_0_1/github_0_0_1.js new file mode 100644 index 0000000..431d89e --- /dev/null +++ b/node.jquery.mobile/public/views/partials/compiled_0_0_1/github_0_0_1.js @@ -0,0 +1 @@ +(function(){dust.register("github",body_0);function body_0(chk,ctx){return chk.write("
    Back

    ").reference(ctx.get("title"),ctx,"h").write("

    ").reference(ctx.get("title"),ctx,"h").write("

    download ").reference(ctx.get("title"),ctx,"h").write(" here

    @2012 ").reference(ctx.get("title"),ctx,"h").write("

    ");}function body_1(chk,ctx){return chk.write("
  • ").reference(ctx.get("text"),ctx,"h").write("
  • ");}return body_0;})(); \ No newline at end of file diff --git a/node.jquery.mobile/public/views/partials/compiled_0_0_1/home_0_0_1.js b/node.jquery.mobile/public/views/partials/compiled_0_0_1/home_0_0_1.js new file mode 100644 index 0000000..762bc54 --- /dev/null +++ b/node.jquery.mobile/public/views/partials/compiled_0_0_1/home_0_0_1.js @@ -0,0 +1 @@ +(function(){dust.register("home",body_0);function body_0(chk,ctx){return chk.write("
    Back

    ").reference(ctx.get("title"),ctx,"h").write("

    ").reference(ctx.get("title"),ctx,"h").write("

    node.js boilerplate using express, socket.io, mongooose, jquery.mobile & html 5

    @2012 ").reference(ctx.get("title"),ctx,"h").write("

    ");}function body_1(chk,ctx){return chk.write("
  • ").reference(ctx.get("title"),ctx,"h").reference(ctx.get("date"),ctx,"h").reference(ctx.get("body"),ctx,"h").write("
  • ");}function body_2(chk,ctx){return chk.write("
  • ").reference(ctx.get("text"),ctx,"h").write("
  • ");}return body_0;})(); \ No newline at end of file diff --git a/node.jquery.mobile/public/views/partials/compiled_0_0_1/login_0_0_1.js b/node.jquery.mobile/public/views/partials/compiled_0_0_1/login_0_0_1.js new file mode 100644 index 0000000..8af3f41 --- /dev/null +++ b/node.jquery.mobile/public/views/partials/compiled_0_0_1/login_0_0_1.js @@ -0,0 +1 @@ +(function(){dust.register("login",body_0);function body_0(chk,ctx){return chk.write("
    Back

    ").reference(ctx.get("title"),ctx,"h").write("

    ").reference(ctx.get("title"),ctx,"h").write("

    complete the below to login/register

    @2012 ").reference(ctx.get("title"),ctx,"h").write("

    ");}return body_0;})(); \ No newline at end of file diff --git a/node.jquery.mobile/public/views/partials/contact.html b/node.jquery.mobile/public/views/partials/contact.html new file mode 100644 index 0000000..49dbad9 --- /dev/null +++ b/node.jquery.mobile/public/views/partials/contact.html @@ -0,0 +1,18 @@ +
    + +
    +

    {title}

    + +

    contact us here {contact.email}

    + +
    + +
    \ No newline at end of file diff --git a/node.jquery.mobile/public/views/partials/github.html b/node.jquery.mobile/public/views/partials/github.html new file mode 100644 index 0000000..2755497 --- /dev/null +++ b/node.jquery.mobile/public/views/partials/github.html @@ -0,0 +1,18 @@ +
    + +
    +

    {title}

    + +

    download {title} here

    + +
    + +
    \ No newline at end of file diff --git a/node.jquery.mobile/public/views/partials/home.html b/node.jquery.mobile/public/views/partials/home.html new file mode 100644 index 0000000..9b2bc4a --- /dev/null +++ b/node.jquery.mobile/public/views/partials/home.html @@ -0,0 +1,23 @@ +
    + +
    +

    {title}

    + + + +

    node.js boilerplate using express, socket.io, mongooose, jquery.mobile & html 5

    + +
    + + +
    \ No newline at end of file diff --git a/node.jquery.mobile/public/views/partials/login.html b/node.jquery.mobile/public/views/partials/login.html new file mode 100644 index 0000000..117e69d --- /dev/null +++ b/node.jquery.mobile/public/views/partials/login.html @@ -0,0 +1,26 @@ +
    + +
    +

    {title}

    + +

    complete the below to login/register

    +
    +
    + + +
    +
    + + +
    + +
    +
    + +
    \ No newline at end of file diff --git a/npm b/npm new file mode 100644 index 0000000..5fbcd3b --- /dev/null +++ b/npm @@ -0,0 +1,6 @@ +#!/bin/sh +if [ -x "`dirname "$0"`/node.exe" ]; then + "`dirname "$0"`/node.exe" "`dirname "$0"`/node_modules/npm/bin/npm-cli.js" "$@" +else + node "`dirname "$0"`/node_modules/npm/bin/npm-cli.js" "$@" +fi diff --git a/package.json b/package.json new file mode 100644 index 0000000..22cd196 --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "questience" + , "version": "0.0.1" + , "description": "A task manager designed in the form of an RPG" + , "keywords": ["questience"] + , "author": "Donniel Thomas " + , "repository": { "type": "git", "url": "git@github.com:donnielrt/questience.git" } + , "main": "./server.js" + , "dependencies": { + "express": "2.4.3", + "ejs": ">= 0.4.3", + "mongoose": ">= 2.4.1", + "socket.io": ">=0.7.7", + "konphyg": ">=1.0.4", + "connect" : "2.x", + "session-konphyg": ">=0.0.1", + "consolidate": ">=0.3.0", + "dust": "*", + "dustjs-linkedin": "*" + } +} \ No newline at end of file diff --git a/public/images/logo.png b/public/images/logo.png new file mode 100644 index 0000000..5e26f6e Binary files /dev/null and b/public/images/logo.png differ diff --git a/public/javascripts/WebSocketMain.swf b/public/javascripts/WebSocketMain.swf new file mode 100644 index 0000000..20a451f Binary files /dev/null and b/public/javascripts/WebSocketMain.swf differ diff --git a/public/javascripts/WebSocketMainInsecure.swf b/public/javascripts/WebSocketMainInsecure.swf new file mode 100644 index 0000000..5949ff3 Binary files /dev/null and b/public/javascripts/WebSocketMainInsecure.swf differ diff --git a/public/javascripts/backbone-min.js b/public/javascripts/backbone-min.js new file mode 100644 index 0000000..c1c0d4f --- /dev/null +++ b/public/javascripts/backbone-min.js @@ -0,0 +1,38 @@ +// Backbone.js 0.9.2 + +// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc. +// Backbone may be freely distributed under the MIT license. +// For all details and documentation: +// http://backbonejs.org +(function(){var l=this,y=l.Backbone,z=Array.prototype.slice,A=Array.prototype.splice,g;g="undefined"!==typeof exports?exports:l.Backbone={};g.VERSION="0.9.2";var f=l._;!f&&"undefined"!==typeof require&&(f=require("underscore"));var i=l.jQuery||l.Zepto||l.ender;g.setDomLibrary=function(a){i=a};g.noConflict=function(){l.Backbone=y;return this};g.emulateHTTP=!1;g.emulateJSON=!1;var p=/\s+/,k=g.Events={on:function(a,b,c){var d,e,f,g,j;if(!b)return this;a=a.split(p);for(d=this._callbacks||(this._callbacks= +{});e=a.shift();)f=(j=d[e])?j.tail:{},f.next=g={},f.context=c,f.callback=b,d[e]={tail:g,next:j?j.next:f};return this},off:function(a,b,c){var d,e,h,g,j,q;if(e=this._callbacks){if(!a&&!b&&!c)return delete this._callbacks,this;for(a=a?a.split(p):f.keys(e);d=a.shift();)if(h=e[d],delete e[d],h&&(b||c))for(g=h.tail;(h=h.next)!==g;)if(j=h.callback,q=h.context,b&&j!==b||c&&q!==c)this.on(d,j,q);return this}},trigger:function(a){var b,c,d,e,f,g;if(!(d=this._callbacks))return this;f=d.all;a=a.split(p);for(g= +z.call(arguments,1);b=a.shift();){if(c=d[b])for(e=c.tail;(c=c.next)!==e;)c.callback.apply(c.context||this,g);if(c=f){e=c.tail;for(b=[b].concat(g);(c=c.next)!==e;)c.callback.apply(c.context||this,b)}}return this}};k.bind=k.on;k.unbind=k.off;var o=g.Model=function(a,b){var c;a||(a={});b&&b.parse&&(a=this.parse(a));if(c=n(this,"defaults"))a=f.extend({},c,a);b&&b.collection&&(this.collection=b.collection);this.attributes={};this._escapedAttributes={};this.cid=f.uniqueId("c");this.changed={};this._silent= +{};this._pending={};this.set(a,{silent:!0});this.changed={};this._silent={};this._pending={};this._previousAttributes=f.clone(this.attributes);this.initialize.apply(this,arguments)};f.extend(o.prototype,k,{changed:null,_silent:null,_pending:null,idAttribute:"id",initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.get(a);return this._escapedAttributes[a]=f.escape(null== +b?"":""+b)},has:function(a){return null!=this.get(a)},set:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c||(c={});if(!d)return this;d instanceof o&&(d=d.attributes);if(c.unset)for(e in d)d[e]=void 0;if(!this._validate(d,c))return!1;this.idAttribute in d&&(this.id=d[this.idAttribute]);var b=c.changes={},h=this.attributes,g=this._escapedAttributes,j=this._previousAttributes||{};for(e in d){a=d[e];if(!f.isEqual(h[e],a)||c.unset&&f.has(h,e))delete g[e],(c.silent?this._silent: +b)[e]=!0;c.unset?delete h[e]:h[e]=a;!f.isEqual(j[e],a)||f.has(h,e)!=f.has(j,e)?(this.changed[e]=a,c.silent||(this._pending[e]=!0)):(delete this.changed[e],delete this._pending[e])}c.silent||this.change(c);return this},unset:function(a,b){(b||(b={})).unset=!0;return this.set(a,null,b)},clear:function(a){(a||(a={})).unset=!0;return this.set(f.clone(this.attributes),a)},fetch:function(a){var a=a?f.clone(a):{},b=this,c=a.success;a.success=function(d,e,f){if(!b.set(b.parse(d,f),a))return!1;c&&c(b,d)}; +a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},save:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c=c?f.clone(c):{};if(c.wait){if(!this._validate(d,c))return!1;e=f.clone(this.attributes)}a=f.extend({},c,{silent:!0});if(d&&!this.set(d,c.wait?a:c))return!1;var h=this,i=c.success;c.success=function(a,b,e){b=h.parse(a,e);if(c.wait){delete c.wait;b=f.extend(d||{},b)}if(!h.set(b,c))return false;i?i(h,a):h.trigger("sync",h,a,c)};c.error=g.wrapError(c.error, +h,c);b=this.isNew()?"create":"update";b=(this.sync||g.sync).call(this,b,this,c);c.wait&&this.set(e,a);return b},destroy:function(a){var a=a?f.clone(a):{},b=this,c=a.success,d=function(){b.trigger("destroy",b,b.collection,a)};if(this.isNew())return d(),!1;a.success=function(e){a.wait&&d();c?c(b,e):b.trigger("sync",b,e,a)};a.error=g.wrapError(a.error,b,a);var e=(this.sync||g.sync).call(this,"delete",this,a);a.wait||d();return e},url:function(){var a=n(this,"urlRoot")||n(this.collection,"url")||t(); +return this.isNew()?a:a+("/"==a.charAt(a.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(a){a||(a={});var b=this._changing;this._changing=!0;for(var c in this._silent)this._pending[c]=!0;var d=f.extend({},a.changes,this._silent);this._silent={};for(c in d)this.trigger("change:"+c,this,this.get(c),a);if(b)return this;for(;!f.isEmpty(this._pending);){this._pending= +{};this.trigger("change",this,a);for(c in this.changed)!this._pending[c]&&!this._silent[c]&&delete this.changed[c];this._previousAttributes=f.clone(this.attributes)}this._changing=!1;return this},hasChanged:function(a){return!arguments.length?!f.isEmpty(this.changed):f.has(this.changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?f.clone(this.changed):!1;var b,c=!1,d=this._previousAttributes,e;for(e in a)if(!f.isEqual(d[e],b=a[e]))(c||(c={}))[e]=b;return c},previous:function(a){return!arguments.length|| +!this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},_validate:function(a,b){if(b.silent||!this.validate)return!0;var a=f.extend({},this.attributes,a),c=this.validate(a,b);if(!c)return!0;b&&b.error?b.error(this,c,b):this.trigger("error",this,c,b);return!1}});var r=g.Collection=function(a,b){b||(b={});b.model&&(this.model=b.model);b.comparator&&(this.comparator=b.comparator); +this._reset();this.initialize.apply(this,arguments);a&&this.reset(a,{silent:!0,parse:b.parse})};f.extend(r.prototype,k,{model:o,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},add:function(a,b){var c,d,e,g,i,j={},k={},l=[];b||(b={});a=f.isArray(a)?a.slice():[a];c=0;for(d=a.length;c=b))this.iframe=i('