diff --git a/.bowerrc b/.bowerrc index f7a6eae9187ba84ca0a79b8cf9a267680bf9fd4a..16ec5d0d5f7cc670b4691c450cf3183ba7459076 100644 --- a/.bowerrc +++ b/.bowerrc @@ -1,3 +1,3 @@ { - "directory": "core/static/libs" + "directory": "static/libs" } diff --git a/.gitignore b/.gitignore index fd366074139323365a2792e923d4c5b5b2e75e49..33c8265536cd9652fb41c2eb6f53e4d93fbc8afd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,46 +1,22 @@ *.sqlite3 celerybeat-* core/static/libs/* -memopol/config.json -# SASS Cache -.sass-cache +# libs +static/libs +node_modules -CACHE/* +# compiled css +static/stylesheets/*.min.css -# Emacs backup -# From https://github.com/github/gitignore/blob/master/Python.gitignore +# settings +memopol/config.json # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -venv/ -ve/ -build/ -var/ - # Installer logs pip-log.txt pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.cache -nosetests.xml -coverage.xml - -# Translations -*.mo -*.pot -# Django stuff: -*.log diff --git a/core/static/.gitignore b/core/static/.gitignore deleted file mode 100644 index a93e887bab171f1c7098c52ed2a40c7165cf450d..0000000000000000000000000000000000000000 --- a/core/static/.gitignore +++ /dev/null @@ -1 +0,0 @@ -libs diff --git a/core/static/css/base.css b/core/static/css/base.css deleted file mode 100644 index 96967e8865397e34f6fb70913920cfbf5a5a4ec4..0000000000000000000000000000000000000000 --- a/core/static/css/base.css +++ /dev/null @@ -1,188 +0,0 @@ -@font-face{ - font-family: 'propagandaregular'; - src: url('../font/propagan-webfont.eot'); - src: url('../font/propagan-webfont.eot?#iefix') format('embedded-opentype'), url('../font/propagan-webfont.woff') format('woff'), url('../font/propagan-webfont.ttf') format('truetype'), url('../font/propagan-webfont.svg#propagandaregular') format('svg'); - font-weight: normal; - font-style: normal; -} -@font-face{ - font-family: 'sansus_webissimoitalic'; - src: url('../font/sansus_webissimo-italic-webfont-webfont.eot'); - src: url('../font/sansus_webissimo-italic-webfont-webfont.eot?#iefix') format('embedded-opentype'), url('../font/sansus_webissimo-italic-webfont-webfont.woff') format('woff'), url('../font/sansus_webissimo-italic-webfont-webfont.ttf') format('truetype'), url('../font/sansus_webissimo-italic-webfont-webfont.svg#sansus_webissimoitalic') format('svg'); - font-weight: normal; - font-style: normal; -} -@font-face{ - font-family: 'sansus_webissimoregular'; - src: url('../font/sansus_webissimo-regular-webfont-webfont.eot'); - src: url('../font/sansus_webissimo-regular-webfont-webfont.eot?#iefix') format('embedded-opentype'), url('../font/sansus_webissimo-regular-webfont-webfont.woff') format('woff'), url('../font/sansus_webissimo-regular-webfont-webfont.ttf') format('truetype'), url('../font/sansus_webissimo-regular-webfont-webfont.svg#sansus_webissimoregular') format('svg'); - font-weight: normal; - font-style: normal; -} - -td { - vertical-align: middle; -} - -body { - background-color: #E5E5E5; - font-family: "Helvetica Neue","Helvetica",Helvetica,Arial,sans-serif; - font-size: 14px; - line-height: 1; -} - -#header { - padding: 0px 20px; - height: 78px; - line-height: 45px; -} - -.row { - width: 940px; - max-width: 100%; - min-width: 768px; - margin: 0px auto; -} - -#header, #footer { - background: none repeat scroll 0px 0px #5B8EDC; - color: #FFF; - vertical-align: middle; -} - -#header img { - float: left; - width: 74px; -} - -#header h1 { - margin: 0px; -} - -h1 { -font-size: 44px; -} - -#header h1 a { - line-height: 10px; - font-family: propagandaregular; - font-size: 26px; -} - -#header a { - color: #FFF; - text-decoration: none; -} - -#header p { - font-style: italic; - padding-left: 20px; - margin-bottom: 17px; -} - -p { - font-family: "Helvetica Neue","Helvetica",Helvetica,Arial,sans-serif; - font-weight: normal; - font-size: 14px; - line-height: 1.6; - margin-bottom: 17px; -} - -.nav-bar { - margin-top: 0px; - background-color: #FFF; - border-bottom: 1px solid #EEE; - height: 30px; - line-height: 30px; - height: 40px; - padding: 0px; -} - -.nav-bar > li { - float: left; - display: block; - position: relative; - padding: 0px; - margin: 0px; - line-height: 38px; -} - -.nav-bar > li > a { - padding: 0px 20px; - font-size: 14px; - text-decoration: none; - color: #000; -} - -li { - text-decoration: none; - list-style: inside; -} - -.panel. { - background: none repeat scroll 0% 0% #5B8EDC; - color: #FFF; - border-color: #2284A1; - box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.5) inset; -} -.panel { - background: none repeat scroll 0% 0% #F2F2F2; - border: 1px solid #E6E6E6; - margin: 0px 20px 22px; - padding: 20px; -} - -h1, h2, h3, h4, h5, h6 { - font-family: "Helvetica Neue","Helvetica",Helvetica,Arial,sans-serif; - font-weight: bold; - color: #222; - text-rendering: optimizelegibility; - line-height: 1.1; - margin-bottom: 14px; - margin-top: 14px; -} - -h2, h3, h4 { - font-family: sansus_webissimoregular; -} - -h2 { font-size: 2em; } -h3 { font-size: 1.5em; } -h3 small { font-size: 0.6em; } - -.column, .columns { - float: left; - min-height: 1px; - padding: 0px 0px; - position: relative; -} - -.large-12.main { - background: white; - padding: 10px; - width: 920px; -} - -.large-8 { - width: 66.6667%; -} .large-4 { - width: 33.3333%; -} - -#footer { - padding: 20px 0px; - text-align: center; - line-height: 20px; - font-size: 14px; -} - -#footer ul { - margin-bottom: 11px; -} -#footer li { - display: inline; -} -#footer a { - color: #FFF; - text-decoration: underline; -} diff --git a/core/static/css/reset.css b/core/static/css/reset.css deleted file mode 100644 index 509f6e4a01fd6280e69c4bb6ef14c388aa83d7dd..0000000000000000000000000000000000000000 --- a/core/static/css/reset.css +++ /dev/null @@ -1 +0,0 @@ -html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outline:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0} diff --git a/core/templates/core/home.haml b/core/templates/core/home.haml index 87a8607a1d5d47b00c3322b580dc77910f4df156..c864751ec091e52c5d5253706bf35a1633a8c8c3 100644 --- a/core/templates/core/home.haml +++ b/core/templates/core/home.haml @@ -1,13 +1,25 @@ - extends "base.html" - block content .row - .large-8.columns + .col-md-8 %p - Actually Memopol is reachable only in reduced functionality mode. - By the way, you could access to the actual list of MEPs. + Memopol is reachable only in reduced functionality mode. + By the way, you could access to + the list of MEPs. %p You can help on building the new Memopol by coding, translating, de signing, funding, etc.... - %p - Memopol Blog is available as well as the new bugtracking system - .large-4.columns - - include "core/blocks/what_is_memopol.html" + .col-md-4 + .panel.panel-default + .panel-body + %p + Memopol Blog is available as well as the new + + bugtracking system + %h3 + What is memopol? + %p + Political Memory is a tool designed by La Quadrature du Net to help + European citizens to reach members of European Parliament (MEPs) and + track their voting records on issues related to fundamental + freedoms online. More... + diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000000000000000000000000000000000000..5f3e8f2809e0ee3988221acfe17898961176a163 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,41 @@ +var gulp = require('gulp'); +var less = require('gulp-less'); +var watch = require('gulp-watch'); +var minifycss = require('gulp-minify-css'); +var rename = require('gulp-rename'); +var gzip = require('gulp-gzip'); +var livereload = require('gulp-livereload'); + +var gzip_options = { + threshold: '1kb', + gzipOptions: { + level: 9 + } +}; + +var less_src = 'static/less/*.less'; + +/* Compile Our Sass */ +gulp.task('less', function() { + return gulp.src(less_src) + .pipe(less()) + .pipe(gulp.dest('static/stylesheets')) + .pipe(rename({suffix: '.min'})) + .pipe(minifycss()) + .pipe(gulp.dest('static/stylesheets')) + // .pipe(gzip(gzip_options)) + // .pipe(gulp.dest('static/stylesheets')) + .pipe(livereload()); +}); + +/* Watch Files For Changes */ +gulp.task('watch', function() { + livereload.listen(); + gulp.watch(less_src, ['less']); + + /* Trigger a live reload on any Django template changes */ + gulp.watch('**/templates/*').on('change', livereload.changed); + +}); + +gulp.task('default', ['less', 'watch']); diff --git a/memopol/settings.py b/memopol/settings.py index a5e17495735264fb6c706a2d6aaed227f65e55f3..1131604f5e1addb73c260caee7538673aa097b8d 100644 --- a/memopol/settings.py +++ b/memopol/settings.py @@ -163,10 +163,13 @@ COMPRESS_ROOT = 'static/' STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', - # other finders.. + # Compressor finder 'compressor.finders.CompressorFinder', ) +# Use compressor even in debug +COMPRESS_ENABLED = True + COMPRESS_PRECOMPILERS = ( # ('text/coffeescript', 'coffee --compile --stdio'), ('text/less', 'lessc {infile} {outfile}'), diff --git a/static/coffeescript/home.coffee b/static/coffeescript/home.coffee deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/core/static/font/propagan-webfont.eot b/static/fonts/propagan-webfont.eot similarity index 100% rename from core/static/font/propagan-webfont.eot rename to static/fonts/propagan-webfont.eot diff --git a/core/static/font/propagan-webfont.svg b/static/fonts/propagan-webfont.svg similarity index 100% rename from core/static/font/propagan-webfont.svg rename to static/fonts/propagan-webfont.svg diff --git a/core/static/font/propagan-webfont.ttf b/static/fonts/propagan-webfont.ttf similarity index 100% rename from core/static/font/propagan-webfont.ttf rename to static/fonts/propagan-webfont.ttf diff --git a/core/static/font/propagan-webfont.woff b/static/fonts/propagan-webfont.woff similarity index 100% rename from core/static/font/propagan-webfont.woff rename to static/fonts/propagan-webfont.woff diff --git a/core/static/font/sansus_webissimo-italic-webfont-webfont.eot b/static/fonts/sansus_webissimo-italic-webfont-webfont.eot similarity index 100% rename from core/static/font/sansus_webissimo-italic-webfont-webfont.eot rename to static/fonts/sansus_webissimo-italic-webfont-webfont.eot diff --git a/core/static/font/sansus_webissimo-italic-webfont-webfont.svg b/static/fonts/sansus_webissimo-italic-webfont-webfont.svg similarity index 100% rename from core/static/font/sansus_webissimo-italic-webfont-webfont.svg rename to static/fonts/sansus_webissimo-italic-webfont-webfont.svg diff --git a/core/static/font/sansus_webissimo-italic-webfont-webfont.ttf b/static/fonts/sansus_webissimo-italic-webfont-webfont.ttf similarity index 100% rename from core/static/font/sansus_webissimo-italic-webfont-webfont.ttf rename to static/fonts/sansus_webissimo-italic-webfont-webfont.ttf diff --git a/core/static/font/sansus_webissimo-italic-webfont-webfont.woff b/static/fonts/sansus_webissimo-italic-webfont-webfont.woff similarity index 100% rename from core/static/font/sansus_webissimo-italic-webfont-webfont.woff rename to static/fonts/sansus_webissimo-italic-webfont-webfont.woff diff --git a/core/static/font/sansus_webissimo-regular-webfont-webfont.eot b/static/fonts/sansus_webissimo-regular-webfont-webfont.eot similarity index 100% rename from core/static/font/sansus_webissimo-regular-webfont-webfont.eot rename to static/fonts/sansus_webissimo-regular-webfont-webfont.eot diff --git a/core/static/font/sansus_webissimo-regular-webfont-webfont.svg b/static/fonts/sansus_webissimo-regular-webfont-webfont.svg similarity index 100% rename from core/static/font/sansus_webissimo-regular-webfont-webfont.svg rename to static/fonts/sansus_webissimo-regular-webfont-webfont.svg diff --git a/core/static/font/sansus_webissimo-regular-webfont-webfont.ttf b/static/fonts/sansus_webissimo-regular-webfont-webfont.ttf similarity index 100% rename from core/static/font/sansus_webissimo-regular-webfont-webfont.ttf rename to static/fonts/sansus_webissimo-regular-webfont-webfont.ttf diff --git a/core/static/font/sansus_webissimo-regular-webfont-webfont.woff b/static/fonts/sansus_webissimo-regular-webfont-webfont.woff similarity index 100% rename from core/static/font/sansus_webissimo-regular-webfont-webfont.woff rename to static/fonts/sansus_webissimo-regular-webfont-webfont.woff diff --git a/static/images/foundation/orbit/bullets.jpg b/static/images/foundation/orbit/bullets.jpg deleted file mode 100644 index f3c734f0b3d2aecb59957d8abdfbf5bb7a8a0abb..0000000000000000000000000000000000000000 Binary files a/static/images/foundation/orbit/bullets.jpg and /dev/null differ diff --git a/static/images/foundation/orbit/left-arrow-small.png b/static/images/foundation/orbit/left-arrow-small.png deleted file mode 100644 index b3ff033150dff204a48a69835b0ffbd08806e426..0000000000000000000000000000000000000000 Binary files a/static/images/foundation/orbit/left-arrow-small.png and /dev/null differ diff --git a/static/images/foundation/orbit/left-arrow.png b/static/images/foundation/orbit/left-arrow.png deleted file mode 100644 index 7e3f2d62d929662159e348e77965c9e50e2fce9a..0000000000000000000000000000000000000000 Binary files a/static/images/foundation/orbit/left-arrow.png and /dev/null differ diff --git a/static/images/foundation/orbit/loading.gif b/static/images/foundation/orbit/loading.gif deleted file mode 100644 index 969f50597a35944c2b347a1a3c1786915b7f85f6..0000000000000000000000000000000000000000 Binary files a/static/images/foundation/orbit/loading.gif and /dev/null differ diff --git a/static/images/foundation/orbit/mask-black.png b/static/images/foundation/orbit/mask-black.png deleted file mode 100644 index 02f3fbab28597dfc981bb8a5ba787c6e09630cb8..0000000000000000000000000000000000000000 Binary files a/static/images/foundation/orbit/mask-black.png and /dev/null differ diff --git a/static/images/foundation/orbit/pause-black.png b/static/images/foundation/orbit/pause-black.png deleted file mode 100644 index 5fb087545b00210e8f8198829d2ebd120eebcab0..0000000000000000000000000000000000000000 Binary files a/static/images/foundation/orbit/pause-black.png and /dev/null differ diff --git a/static/images/foundation/orbit/right-arrow-small.png b/static/images/foundation/orbit/right-arrow-small.png deleted file mode 100644 index e4c95330eba85b31aaa87b8cd4281a67693d9f09..0000000000000000000000000000000000000000 Binary files a/static/images/foundation/orbit/right-arrow-small.png and /dev/null differ diff --git a/static/images/foundation/orbit/right-arrow.png b/static/images/foundation/orbit/right-arrow.png deleted file mode 100644 index 7c3199a7728b55cbe6a1c2abeece7fc01202326b..0000000000000000000000000000000000000000 Binary files a/static/images/foundation/orbit/right-arrow.png and /dev/null differ diff --git a/static/images/foundation/orbit/rotator-black.png b/static/images/foundation/orbit/rotator-black.png deleted file mode 100644 index 8df4d31af3b7fbc573ac4d75b233de4a2ded79b1..0000000000000000000000000000000000000000 Binary files a/static/images/foundation/orbit/rotator-black.png and /dev/null differ diff --git a/static/images/foundation/orbit/timer-black.png b/static/images/foundation/orbit/timer-black.png deleted file mode 100644 index 02f3fbab28597dfc981bb8a5ba787c6e09630cb8..0000000000000000000000000000000000000000 Binary files a/static/images/foundation/orbit/timer-black.png and /dev/null differ diff --git a/static/images/logo.png b/static/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..e3b08d2b5a8905711381c153391d118a8e90f521 Binary files /dev/null and b/static/images/logo.png differ diff --git a/static/javascripts/app.js b/static/javascripts/app.js deleted file mode 100644 index 379c0de87a628029973fc910426d31182d03a150..0000000000000000000000000000000000000000 --- a/static/javascripts/app.js +++ /dev/null @@ -1,40 +0,0 @@ -(function($){ - $(function(){ - $(document).foundationMediaQueryViewer(); - - $(document).foundationAlerts(); - $(document).foundationAccordion(); - $(document).tooltips(); - $('input, textarea').placeholder(); - - - - $(document).foundationButtons(); - - - - $(document).foundationNavigation(); - - - - $(document).foundationCustomForms(); - - - - - $(document).foundationTabs({callback:$.foundation.customForms.appendCustomMarkup}); - - - - - $("#featured").orbit(); - - - // UNCOMMENT THE LINE YOU WANT BELOW IF YOU WANT IE8 SUPPORT AND ARE USING .block-grids - // $('.block-grid.two-up>li:nth-child(2n+1)').css({clear: 'left'}); - // $('.block-grid.three-up>li:nth-child(3n+1)').css({clear: 'left'}); - // $('.block-grid.four-up>li:nth-child(4n+1)').css({clear: 'left'}); - // $('.block-grid.five-up>li:nth-child(5n+1)').css({clear: 'left'}); - }); - -})(jQuery); diff --git a/static/javascripts/backbone-min.js b/static/javascripts/backbone-min.js deleted file mode 100644 index c1c0d4fff28ffcc865d0d47397f284f0ccdcc516..0000000000000000000000000000000000000000 --- a/static/javascripts/backbone-min.js +++ /dev/null @@ -1,38 +0,0 @@ -// 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('