diff --git a/.sass-cache/53c0ce4446c54bca21eabbfde8aea9e680be8c1a/jquery.plupload.queue.scssc b/.sass-cache/53c0ce4446c54bca21eabbfde8aea9e680be8c1a/jquery.plupload.queue.scssc
new file mode 100644
index 0000000..f8a7c61
Binary files /dev/null and b/.sass-cache/53c0ce4446c54bca21eabbfde8aea9e680be8c1a/jquery.plupload.queue.scssc differ
diff --git a/.sass-cache/fb46dcf1b33fcd526ffc989de0c2b6e51630b35f/jquery.plupload.queue.scssc b/.sass-cache/fb46dcf1b33fcd526ffc989de0c2b6e51630b35f/jquery.plupload.queue.scssc
new file mode 100644
index 0000000..df4cc05
Binary files /dev/null and b/.sass-cache/fb46dcf1b33fcd526ffc989de0c2b6e51630b35f/jquery.plupload.queue.scssc differ
diff --git a/.sass-cache/fb46dcf1b33fcd526ffc989de0c2b6e51630b35f/jquery.ui.plupload.scssc b/.sass-cache/fb46dcf1b33fcd526ffc989de0c2b6e51630b35f/jquery.ui.plupload.scssc
new file mode 100644
index 0000000..a9d253b
Binary files /dev/null and b/.sass-cache/fb46dcf1b33fcd526ffc989de0c2b6e51630b35f/jquery.ui.plupload.scssc differ
diff --git a/Gemfile b/Gemfile
index f6443f7..d6c1456 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,29 +2,37 @@ source 'http://rubygems.org'
gem 'rails', '3.2.6'
-gem 'authlogic'
-
gem 'mime-types', :require => 'mime/types'
gem 'carrierwave', '0.6.2'
gem 'dynamic_form'
gem 'princely'
gem 'jquery-rails'
gem 'jquery-ui-rails'
+gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
+gem 'configatron', :git => 'git://github.com/markbates/configatron.git'
+gem 'plupload-rails', :git => 'git://github.com/bryanmig/plupload-rails.git'
+gem 'sequel', :git => 'git://github.com/jeremyevans/sequel.git'
gem 'russian', :git => 'git://github.com/yaroslav/russian.git'
-# -- Heroku
-#gem 'heroku'
-#gem 'pg'
+gem "devise_omniauth_engine", :git=>"git://github.com/greendog/devise_omniauth_engine.git"
+gem 'omniauth-twitter'
+gem 'omniauth-facebook'
+gem 'omniauth-openid'
+gem 'omniauth-google-apps'
+gem 'omniauth-vkontakte', :git => 'git://github.com/mamantoha/omniauth-vkontakte.git'
+gem 'cancan'
-# -- Database
-# SQLite:
-group :development do
- gem 'sqlite3-ruby'
+group :assets do
+ gem 'sass-rails'
+ gem 'coffee-rails'
+ gem 'uglifier'
+end
+
+group :development do
+ gem 'sqlite3'
+ gem 'ffaker'
+ gem 'machinist'
end
-# MySQL:
-#gem 'mysql2'
-# PostgreSQL:
-#gem 'pg'
# -- Cloud storage
# AWS S3 support. Can be disabled if using local file system instead of cloud storage.
diff --git a/Gemfile.lock b/Gemfile.lock
index df83b35..3de58f5 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,3 +1,51 @@
+GIT
+ remote: git://github.com/bryanmig/plupload-rails.git
+ revision: 6d07d0f7e05d0b3fdc9b03b49d3a7c3aa1cd703b
+ specs:
+ plupload-rails (1.0.6)
+ rails (~> 3.1)
+
+GIT
+ remote: git://github.com/greendog/devise_omniauth_engine.git
+ revision: c46d449222133f709b5f0cafc31a57f1ae208f06
+ specs:
+ devise_omniauth_engine (1.0.0)
+ devise
+ omniauth
+ yettings
+
+GIT
+ remote: git://github.com/jeremyevans/sequel.git
+ revision: 4b3396b47fdec748a4ed8fae8f6745d2fb5f1f71
+ specs:
+ sequel (3.37.0)
+
+GIT
+ remote: git://github.com/mamantoha/omniauth-vkontakte.git
+ revision: 1d7fc5bdb3b90db2f51a9f3d5f4e6a14b97a2b41
+ specs:
+ omniauth-vkontakte (1.0.7)
+ multi_json
+ omniauth (~> 1.1.0)
+ omniauth-oauth2 (~> 1.0)
+
+GIT
+ remote: git://github.com/markbates/configatron.git
+ revision: 7a81defa5e1fb032b5ed62754d7e6d7bfecf07a2
+ specs:
+ configatron (2.9.1)
+ yamler (>= 0.1.0)
+
+GIT
+ remote: git://github.com/seyhunak/twitter-bootstrap-rails.git
+ revision: 087c17e4294ce10aeb80d31fe7388a2a524460dd
+ specs:
+ twitter-bootstrap-rails (2.1.1)
+ actionpack (>= 3.1)
+ less-rails (~> 2.2.3)
+ railties (>= 3.1)
+ therubyracer (= 0.10.1)
+
GIT
remote: git://github.com/yaroslav/russian.git
revision: e2dde13672bcee176f8b0be364a55ac256913231
@@ -36,16 +84,33 @@ GEM
i18n (~> 0.6)
multi_json (~> 1.0)
arel (3.0.2)
- authlogic (3.1.3)
- activerecord (>= 3.0.0)
- activesupport (>= 3.0.0)
+ bcrypt-ruby (3.0.1)
builder (3.0.0)
+ cancan (1.6.8)
carrierwave (0.6.2)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
+ coffee-rails (3.2.2)
+ coffee-script (>= 2.2.0)
+ railties (~> 3.2.0)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.3.3)
+ commonjs (0.2.6)
+ devise (2.1.2)
+ bcrypt-ruby (~> 3.0)
+ orm_adapter (~> 0.1)
+ railties (~> 3.1)
+ warden (~> 1.2.1)
dynamic_form (1.1.4)
erubis (2.7.0)
excon (0.14.3)
+ execjs (1.4.0)
+ multi_json (~> 1.0)
+ faraday (0.8.1)
+ multipart-post (~> 1.1)
+ ffaker (1.15.0)
fog (1.4.0)
builder
excon (~> 0.14.0)
@@ -57,7 +122,9 @@ GEM
nokogiri (~> 1.5.0)
ruby-hmac
formatador (0.2.3)
+ hashie (1.2.0)
hike (1.2.1)
+ httpauth (0.1)
i18n (0.6.0)
journey (1.0.4)
jquery-rails (2.0.2)
@@ -67,6 +134,15 @@ GEM
jquery-rails
railties (>= 3.1.0)
json (1.7.3)
+ jwt (0.1.5)
+ multi_json (>= 1.0)
+ less (2.2.1)
+ commonjs (~> 0.2.6)
+ less-rails (2.2.3)
+ actionpack (>= 3.1)
+ less (~> 2.2.0)
+ libv8 (3.3.10.4)
+ machinist (2.0)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
@@ -76,15 +152,48 @@ GEM
mini_magick (3.4)
subexec (~> 0.2.1)
multi_json (1.3.6)
+ multipart-post (1.1.5)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
net-ssh (2.5.2)
nokogiri (1.5.5)
+ oauth (0.4.6)
+ oauth2 (0.8.0)
+ faraday (~> 0.8)
+ httpauth (~> 0.1)
+ jwt (~> 0.1.4)
+ multi_json (~> 1.0)
+ rack (~> 1.2)
+ omniauth (1.1.0)
+ hashie (~> 1.2)
+ rack
+ omniauth-facebook (1.4.1)
+ omniauth-oauth2 (~> 1.1.0)
+ omniauth-google-apps (0.0.2)
+ omniauth (~> 1.0)
+ omniauth-openid (~> 1.0)
+ ruby-openid-apps-discovery (~> 1.2.0)
+ omniauth-oauth (1.0.1)
+ oauth
+ omniauth (~> 1.0)
+ omniauth-oauth2 (1.1.0)
+ oauth2 (~> 0.8.0)
+ omniauth (~> 1.0)
+ omniauth-openid (1.0.1)
+ omniauth (~> 1.0)
+ rack-openid (~> 1.3.1)
+ omniauth-twitter (0.0.12)
+ multi_json (~> 1.3)
+ omniauth-oauth (~> 1.0)
+ orm_adapter (0.4.0)
polyglot (0.3.3)
princely (1.2.5)
rack (1.4.1)
rack-cache (1.2)
rack (>= 0.4)
+ rack-openid (1.3.1)
+ rack (>= 1.1.0)
+ ruby-openid (>= 2.1.8)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
@@ -108,35 +217,65 @@ GEM
rdoc (3.12)
json (~> 1.4)
ruby-hmac (0.4.0)
+ ruby-openid (2.2.0)
+ ruby-openid-apps-discovery (1.2.0)
+ ruby-openid (>= 2.1.7)
+ sass (3.1.20)
+ sass-rails (3.2.5)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.6)
- sqlite3-ruby (1.3.3)
- sqlite3 (>= 1.3.3)
subexec (0.2.2)
+ therubyracer (0.10.1)
+ libv8 (~> 3.3.10)
thor (0.15.4)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.33)
+ uglifier (1.2.6)
+ execjs (>= 0.3.0)
+ multi_json (~> 1.3)
+ warden (1.2.1)
+ rack (>= 1.0)
+ yamler (0.1.0)
+ yettings (0.1.1)
PLATFORMS
ruby
DEPENDENCIES
- authlogic
+ cancan
carrierwave (= 0.6.2)
+ coffee-rails
+ configatron!
+ devise_omniauth_engine!
dynamic_form
+ ffaker
fog
jquery-rails
jquery-ui-rails
+ machinist
mime-types
mini_exiftool
mini_magick
+ omniauth-facebook
+ omniauth-google-apps
+ omniauth-openid
+ omniauth-twitter
+ omniauth-vkontakte!
+ plupload-rails!
princely
rails (= 3.2.6)
russian!
- sqlite3-ruby
+ sass-rails
+ sequel!
+ sqlite3
+ twitter-bootstrap-rails!
+ uglifier
diff --git a/Rakefile b/Rakefile
index 34cf696..2465485 100644
--- a/Rakefile
+++ b/Rakefile
@@ -4,4 +4,4 @@
require File.expand_path('../config/application', __FILE__)
require 'rake'
-Balder::Application.load_tasks
+Photomix::Application.load_tasks
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
new file mode 100644
index 0000000..87ab0a9
--- /dev/null
+++ b/app/assets/javascripts/application.js
@@ -0,0 +1,18 @@
+// This is a manifest file that'll be compiled into including all the files listed below.
+// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
+// be included in the compiled file accessible from http://example.com/assets/application.js
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+//= require jquery
+//= require jquery_ujs
+//= require twitter/bootstrap
+//= require plupload
+//= require jquery.plupload.queue
+//= require plupload.flash
+//= require plupload.silverlight
+//= require plupload.html4
+//= require plupload.html5
+//= require plupload.gears
+//= require plupload.browserplus
+//= require_tree .
diff --git a/app/assets/javascripts/bootstrap.js.coffee b/app/assets/javascripts/bootstrap.js.coffee
new file mode 100644
index 0000000..c9404a8
--- /dev/null
+++ b/app/assets/javascripts/bootstrap.js.coffee
@@ -0,0 +1,4 @@
+jQuery ->
+ $("a[rel=popover]").popover()
+ $(".tooltip").tooltip()
+ $("a[rel=tooltip]").tooltip()
\ No newline at end of file
diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css
index bee6c61..424cc96 100644
--- a/app/assets/stylesheets/application.css
+++ b/app/assets/stylesheets/application.css
@@ -1,248 +1,6 @@
-/* @override
- http://localhost:3000/stylesheets/application.css
- http://photos.inspired.no/stylesheets/application.css?1316927557
-*/
-
-/* @group Reset */
-
-html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;}
-body {line-height:1.5;}
-table {border-collapse:separate;border-spacing:0;}
-caption, th, td {text-align:left;font-weight:normal;}
-table, td, th {vertical-align:middle;}
-blockquote:before, blockquote:after, q:before, q:after {content:"";}
-blockquote, q {quotes:"" "";}
-a img {border:none;}
-
-
-
-/* @end */
-
-/* @group Typography */
-
-body {font-size:75%;color:#222;background:#fff;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;}
-h1, h2, h3, h4, h5, h6 {font-weight:normal;}
-h1 {font-size:3em;line-height:1;margin-bottom:0.5em;}
-h2 {font-size:2em;margin-bottom:0.75em;}
-h3 {font-size:1.5em;line-height:1;margin-bottom:1em;}
-h4 {font-size:1.2em;line-height:1.25;margin-bottom:1.25em;}
-h5 {font-size:1em;font-weight:bold;margin-bottom:1.5em;}
-h6 {font-size:1em;font-weight:bold;}
-h1 img, h2 img, h3 img, h4 img, h5 img, h6 img {margin:0;}
-p {margin:0 0 1.5em;}
-p img.left {float:left;margin:1.5em 1.5em 1.5em 0;padding:0;}
-p img.right {float:right;margin:1.5em 0 1.5em 1.5em;}
-a:focus, a:hover {color:#000;}
-a {color:#009;text-decoration:underline;}
-blockquote {margin:1.5em;color:#666;font-style:italic;}
-strong {font-weight:bold;}
-em, dfn {font-style:italic;}
-dfn {font-weight:bold;}
-sup, sub {line-height:0;}
-abbr, acronym {border-bottom:1px dotted #666;}
-address {margin:0 0 1.5em;font-style:italic;}
-del {color:#666;}
-pre {margin:1.5em 0;white-space:pre;}
-pre, code, tt {font:1em 'andale mono', 'lucida console', monospace;line-height:1.5;}
-li ul, li ol {margin:0 1.5em;}
-ul, ol {margin:0 1.5em 1.5em 1.5em;}
-ul {list-style-type:disc;}
-ol {list-style-type:decimal;}
-dl {margin:0 0 1.5em 0;}
-dl dt {font-weight:bold;}
-dd {margin-left:1.5em;}
-table {margin-bottom:1.4em;width:100%;}
-th {font-weight:bold;}
-thead th {background:#c3d9ff;}
-th, td, caption {padding:4px 10px 4px 5px;}
-tr.even td {background:#e5ecf9;}
-tfoot {font-style:italic;}
-caption {background:#eee;}
-.small {font-size:.8em;margin-bottom:1.875em;line-height:1.875em;}
-.large {font-size:1.2em;line-height:2.5em;margin-bottom:1.25em;}
-.hide {display:none;}
-.quiet {color:#666;}
-.loud {color:#000;}
-.highlight {background:#ff0;}
-.added {background:#060;color:#fff;}
-.removed {background:#900;color:#fff;}
-.first {margin-left:0;padding-left:0;}
-.last {margin-right:0;padding-right:0;}
-.top {margin-top:0;padding-top:0;}
-.bottom {margin-bottom:0;padding-bottom:0;}
-.clear {
- clear: both;
-}
-
-
-
-/* @end */
-
-#container {
- width: 950px;
- margin: 0 auto;
-}
-
-div#header h1 {
- text-transform: uppercase;
- font-weight: bold;
- letter-spacing: 10px;
- margin: 10px 0 0 0;
- float: left;
- clear: left;
-}
-
-div#header h1 a, div#header h1 a:visited, div#header h1 a:active, div#header h1 a:hover {
- text-decoration: none;
- color: #222;
-}
-
-div#header {
- padding: 10px 0;
-}
-div#content {
- clear: both;
-}
-div#footer {
- clear: both;
-}
-form#search {
- margin: 5px 0;
- padding: 5px 10px;
- float: right;
-}
-form#search input {
- padding: 5px 5px 5px;
- font-size: 13px;
-}
-form#search input.textfield {
- width: 400px;
- border: 1px solid black;
-}
-p.links {
- margin: 5px 0;
- text-transform: uppercase;
-}
-p.links a {
- text-decoration: none;
-}
-p.links a:hover {
- text-decoration: underline;
-}
-hr.seperator {
- clear: both;
- border: none;
- background-color: #ddd;
- height: 1px;
-}
-div.thumb {
- background-color: #eee;
- float: left;
- padding: 10px;
- margin-right: 10px;
- margin-bottom: 10px;
-}
-div.thumb h3 {
- text-transform: uppercase;
- font-weight: bold;
- font-size: 13px;
-}
-div.thumb h3 a {
- color: black;
- text-decoration: none;
-}
-div.thumb h3 a:hover {
- border-bottom: 1px solid #999;}
-div.thumb img {
- width: 200px;
- height: 200px;
-}
-div.thumb p {
- text-align: center;
- margin: 0;
-}
-.row {
- clear: both;
- padding-bottom: 40px;
-}
-
-img {
-
-
-}
-.row div.image {
- margin: 10px 0 0;
- float: left;
-}
-.row div.image img {
- margin: 0 0 0 10px;
-}
-div.title {
- margin: 10px 0 0;
- border-right: 1px solid #bbb;
- display: block;
- float: left;
- width: 240px;
-}
-.row div.title img, .row div.image img {
- width: 100px;
- height: 100px;
-}
-div.title img {
- float: right;
- padding-right: 10px;
- width: 100px;
-}
-div.title p {
- font-weight: bold;
- font-size: 18px;
-}
-div#header h1 p {
- display: inline;
- font-size: 12px;
- letter-spacing: normal;
- font-weight: normal;
-}
-
-DIV#map_canvas {
- width: 500px;
- height: 300px;
- float:right;
- border:4px solid black;
- display: none;
-}
-
-DIV#breadcrumb {
- float: left;
-}
-
-DIV#action_links {
- float: right;
- clear: right;
-}
-
-td {
- vertical-align: bottom;
-}
-p#notice {
- color: green;
-}
-
-DIV#collection_albums {
- width: 710px;
- clear: both;
-}
-DIV#collection_albums span {
- position: relative;
- display: block;
- float: left;
- padding: 5px;
-}
-DIV#collection_albums IMG.delete {
- display: block;
- vertical-align: top;
- position: absolute;
- cursor: pointer;
- right: 8px;
- top: 8px;
-}
\ No newline at end of file
+/*
+ *= require_self
+ *= require_tree .
+ *= require jquery.plupload.queue
+ *= require bootstrap_and_overrides
+ */
\ No newline at end of file
diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less
new file mode 100644
index 0000000..14bf301
--- /dev/null
+++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less
@@ -0,0 +1,32 @@
+@import "twitter/bootstrap/bootstrap";
+body {
+ padding-top: 60px;
+}
+
+@import "twitter/bootstrap/responsive";
+
+// Set the correct sprite paths
+@iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png');
+@iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png');
+
+// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
+// Note: If you use asset_path() here, your compiled boostrap_and_overrides.css will not
+// have the proper paths. So for now we use the absolute path.
+@fontAwesomeEotPath: '/assets/fontawesome-webfont.eot';
+@fontAwesomeWoffPath: '/assets/fontawesome-webfont.woff';
+@fontAwesomeTtfPath: '/assets/fontawesome-webfont.ttf';
+@fontAwesomeSvgPath: '/assets/fontawesome-webfont.svg';
+
+// Font Awesome
+@import "fontawesome";
+
+// Your custom LESS stylesheets goes here
+//
+// Since bootstrap was imported above you have access to its mixins which
+// you may use and inherit here
+//
+// If you'd like to override bootstrap's own variables, you can do so here as well
+// See http://twitter.github.com/bootstrap/less.html for their names and documentation
+//
+// Example:
+// @linkColor: #ff0000;
diff --git a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/css/jquery.plupload.queue.css b/app/assets/stylesheets/jquery.plupload.queue.scss
similarity index 79%
rename from vendor/assets/javascripts/plupload/js/jquery.plupload.queue/css/jquery.plupload.queue.css
rename to app/assets/stylesheets/jquery.plupload.queue.scss
index 8581fdd..8c7093c 100644
--- a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/css/jquery.plupload.queue.css
+++ b/app/assets/stylesheets/jquery.plupload.queue.scss
@@ -11,7 +11,7 @@
border: 1px solid #bababa;
padding: 2px 8px 3px 20px;
margin-right: 4px;
- background: #f3f3f3 url('../img/buttons.png') no-repeat 0 center;
+ background: #f3f3f3 url(asset_path("buttons.png")) no-repeat 0 center;
outline: 0;
/* Optional rounded corners for browsers that support it */
@@ -29,7 +29,7 @@
.plupload_disabled, a.plupload_disabled:hover {
color: #737373;
border-color: #c5c5c5;
- background: #ededed url('../img/buttons-disabled.png') no-repeat 0 center;
+ background: #ededed url(asset_path('buttons-disabled.png')) no-repeat 0 center;
cursor: default;
}
@@ -44,7 +44,7 @@
.plupload_container {
padding: 8px;
- background: url('../img/transp50.png');
+ background: url(asset_path('transp50.png'));
/*-moz-border-radius: 5px;*/
}
@@ -54,9 +54,9 @@
width: 98%;
}
-.plupload_header {background: #2A2C2E url('../img/backgrounds.gif') repeat-x;}
+.plupload_header {background: #2A2C2E url(asset_path('backgrounds.gif')) repeat-x;}
.plupload_header_content {
- background: url('../img/backgrounds.gif') no-repeat 0 -317px;
+ background: url(asset_path('backgrounds.gif')) no-repeat 0 -317px;
min-height: 56px;
padding-left: 60px;
color: #FFF;
@@ -83,7 +83,7 @@
.plupload_filelist li {
padding: 10px 8px;
- background: #F5F5F5 url('../img/backgrounds.gif') repeat-x 0 -156px;
+ background: #F5F5F5 url(asset_path('backgrounds.gif')) repeat-x 0 -156px;
border-bottom: 1px solid #DDD;
}
@@ -122,20 +122,20 @@
height: 16px;
}
-li.plupload_uploading {background: #ECF3DC url('../img/backgrounds.gif') repeat-x 0 -238px;}
+li.plupload_uploading {background: #ECF3DC url(asset_path('backgrounds.gif')) repeat-x 0 -238px;}
li.plupload_done {color:#AAA}
li.plupload_delete a {
- background: url('../img/delete.gif');
+ background: url(asset_path('delete.gif'));
}
li.plupload_failed a {
- background: url('../img/error.gif');
+ background: url(asset_path('error.gif'));
cursor: default;
}
li.plupload_done a {
- background: url('../img/done.gif');
+ background: url(asset_path('done.gif'));
cursor: default;
}
diff --git a/vendor/assets/javascripts/plupload/js/jquery.ui.plupload/css/jquery.ui.plupload.css b/app/assets/stylesheets/jquery.ui.plupload.scss
similarity index 90%
rename from vendor/assets/javascripts/plupload/js/jquery.ui.plupload/css/jquery.ui.plupload.css
rename to app/assets/stylesheets/jquery.ui.plupload.scss
index a819fff..2aa9dd3 100644
--- a/vendor/assets/javascripts/plupload/js/jquery.ui.plupload/css/jquery.ui.plupload.css
+++ b/app/assets/stylesheets/jquery.ui.plupload.scss
@@ -20,14 +20,14 @@ div.plupload div.plupload_header {border-width: 0 0 1px 0; position: relative;}
}
.plupload_header_content {
- background-image: url('../img/plupload.png');
+ background-image: url(asset_path('plupload.png'));
background-repeat: no-repeat;
background-position: 8px center;
min-height: 56px;
padding-left: 60px;
position:relative;
}
-.plupload_header_content_bw {background-image: url('../img/plupload-bw.png');}
+.plupload_header_content_bw {background-image: url(asset_path('plupload-bw.png'));}
.plupload_header_title {
font: normal 18px sans-serif;
padding: 6px 0 3px;
@@ -61,7 +61,6 @@ div.plupload div.plupload_header {border-width: 0 0 1px 0; position: relative;}
max-height: 180px;
min-height: 168px;
_height: 168px;
- overflow-y: auto;
}
.plupload_file_size, .plupload_file_status {text-align: right;}
diff --git a/app/controllers/admin/application_controller.rb b/app/controllers/admin/application_controller.rb
deleted file mode 100644
index 99a9d86..0000000
--- a/app/controllers/admin/application_controller.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-class Admin::ApplicationController < ApplicationController
-
- before_filter :require_role_admin
-
-end
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb
deleted file mode 100644
index 9ca0051..0000000
--- a/app/controllers/admin/users_controller.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-class Admin::UsersController < Admin::ApplicationController
-
- def index
- @users = User.find(:all, :order => "Name, email")
- end
-
- def show
- @user = User.find(params[:id])
- end
-
- def new
- @user = User.new
- end
-
- def create
- @user = User.new(params[:user])
- if @user.save
- flash[:notice] = "Account registered!"
- redirect_to @user
- else
- render :action => :new
- end
- end
-
- def edit
- @user = User.find(params[:id])
- end
-
- def update
- @user = User.find(params[:id])
- if @user.update_attributes(params[:user])
- flash[:notice] = "Account updated!"
- redirect_to @user
- else
- render :action => :edit
- end
- end
-
- def destroy
- @user = User.find(params[:id])
- if @user.destroy
- redirect_to users_path
- else
- redirect_to @user
- end
- end
-end
diff --git a/app/controllers/albums_controller.rb b/app/controllers/albums_controller.rb
index 7cfda39..831c8c8 100644
--- a/app/controllers/albums_controller.rb
+++ b/app/controllers/albums_controller.rb
@@ -1,10 +1,10 @@
class AlbumsController < ApplicationController
before_filter :check_public_access
- before_filter :require_role_admin, :only => [:untouched, :new, :create, :edit, :update, :destroy]
+ skip_before_filter :authenticate_user!, :only => [:index, :show]
def index
if params[:tag_id]
- @albums = Album.find(:all, :conditions => [ "id IN ( SELECT DISTINCT photos.album_id FROM photos WHERE photos.id IN ( SELECT photo_id FROM photo_tags WHERE photo_tags.tag_id = :q) )", { :q => Tag.find( params[:tag_id] ).id } ], :order => 'title')
+ @albums = Album.where(:conditions => [ "id IN ( SELECT DISTINCT photos.album_id FROM photos WHERE photos.id IN ( SELECT photo_id FROM photo_tags WHERE photo_tags.tag_id = :q) )", { :q => Tag.find( params[:tag_id] ).id } ]).order('title')
elsif params[:q]
#search = params[:q]
#search = search.split("AND").map{|q|q.strip}
@@ -20,7 +20,7 @@ class AlbumsController < ApplicationController
end
}
else
- @albums = Album.find(:all, :order => 'title')
+ @albums = Album.order('albums.title')
end
respond_to do |format|
format.html
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 46867fc..fd82122 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -2,86 +2,33 @@
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
+ layout 'bootstrap'
helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection for details
- helper_method :current_user, :current_user_session
-
+ before_filter :authenticate_user!, :set_current_user
before_filter :setup
-
private
-
- def setup
- redirect_to new_account_path if User.all.length == 0
- end
-
- def check_public_access
- require_user if ENV['PRIVATE'] == 'true'
- end
+ # This hack is needed to access the current user in models. See http://rails-bestpractices.com/posts/47-fetch-current-user-in-models
+ def set_current_user
+ User.current = current_user
+ end
- def current_user_session
- return @current_user_session if defined?(@current_user_session)
- @current_user_session = UserSession.find
- end
+ def setup
+ redirect_to new_account_path if User.all.size == 0
+ end
- def current_user
- return @current_user if defined?(@current_user)
- @current_user = current_user_session && current_user_session.user
- end
+ def check_public_access
+ require_user if ENV['PRIVATE'] == 'true'
+ end
- def require_role(roles = [])
- unless current_user && current_user.in_role?(*roles)
- store_location
- flash[:notice] = "You must have permission to access this page"
- redirect_to account_path
- return false
- end
- return true
- end
+ def store_location
+ session[:return_to] = request.fullpath
+ end
- def require_role_admin
- return false if !require_user
- return require_role("admin")
- end
-
- def require_permission(permissions = [])
- return false if !require_user
- unless current_user && current_user.has_permission?(*permissions)
- store_location
- flash[:notice] = "You must have permission to access this page"
- redirect_to account_path
- return false
- end
- return true
- end
-
- def require_user
- unless current_user
- store_location
- flash[:notice] = "You must be logged in to access this page"
- redirect_to login_path
- return false
- end
- return true
- end
-
- def require_no_user
- if current_user
- store_location
- flash[:notice] = "Already logged in. Please logout"
- redirect_to account_path
- return false
- end
- return true
- end
-
- def store_location
- session[:return_to] = request.fullpath
- end
-
- def redirect_back_or_default(default)
- redirect_to(session[:return_to] || default)
- session[:return_to] = nil
- end
+ def redirect_back_or_default(default)
+ redirect_to(session[:return_to] || default)
+ session[:return_to] = nil
+ end
end
diff --git a/app/controllers/collections_controller.rb b/app/controllers/collections_controller.rb
index bd67f8e..18d300e 100644
--- a/app/controllers/collections_controller.rb
+++ b/app/controllers/collections_controller.rb
@@ -1,9 +1,10 @@
class CollectionsController < ApplicationController
before_filter :check_public_access
- before_filter :require_role_admin, :only => [:new, :create, :edit, :update, :destroy]
+ skip_before_filter :authenticate_user!, :only => [:index, :show]
+
def index
- @collections = Collection.find(:all, :order => 'title')
+ @collections = Collection.joins(:albums => :photos).group_for.order('collections.title')
respond_to do |format|
format.html
format.json { render :json => @collections }
@@ -13,7 +14,7 @@ class CollectionsController < ApplicationController
def show
@collection = Collection.find( params[:id] )
- @albums = @collection.albums.find(:all, :order => 'title')
+ @albums = @collection.albums.order('title')
respond_to do |format|
format.html
format.json { render :json => @collection }
diff --git a/app/controllers/locale_controller.rb b/app/controllers/locale_controller.rb
new file mode 100644
index 0000000..60bfc78
--- /dev/null
+++ b/app/controllers/locale_controller.rb
@@ -0,0 +1,14 @@
+class LocaleController < ApplicationController
+ def set
+ if request.referer && request.referer.starts_with?('http://' + request.host)
+ session['return_to'] = request.referer
+ end
+ if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym)
+ session[:locale] = I18n.locale = params[:locale].to_sym
+ flash.notice = t(:locale_changed)
+ else
+ flash[:error] = t(:locale_not_changed)
+ end
+ redirect_back_or_default(root_path)
+ end
+end
diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb
index 909d157..ad698d7 100644
--- a/app/controllers/photos_controller.rb
+++ b/app/controllers/photos_controller.rb
@@ -1,17 +1,17 @@
class PhotosController < ApplicationController
before_filter :check_public_access
- before_filter :require_role_admin, :only => [:untouched, :upload, :new, :create, :edit, :update, :destroy, :scan]
+ skip_before_filter :authenticate_user!, :only => [:index, :show]
def index
if params[:tag_id] && params[:album_id]
@tag = Tag.find_by_title!( params[:tag_id] )
- @photos = @tag.photos.find(:all, :conditions => ['photos.album_id = :album', {:album => Album.find(params[:album_id] ) } ], :order => "photos.id ASC")
+ @photos = @tag.photos.where(:conditions => ['photos.album_id = :album', {:album => Album.find(params[:album_id] ) } ]).order("photos.id ASC")
elsif params[:tag_id]
@tag = Tag.find_by_title!( params[:tag_id] )
- @photos = @tag.photos.find(:all, :order => "photos.id ASC")
+ @photos = @tag.photos.order("photos.id ASC")
elsif params[:album_id]
@album = Album.find( params[:album_id])
- @photos = @album.photos.find(:all, :order => "photos.id ASC")
+ @photos = @album.photos.order("photos.id ASC")
elsif params[:q]
#search = params[:q]
#search = search.split("AND").map{|q|q.strip}
@@ -25,7 +25,7 @@ class PhotosController < ApplicationController
end
}
else
- @photos = Photo.find(:all, :order => "photos.id ASC")
+ @photos = Photo.order("photos.id ASC")
end
respond_to do |format|
format.html
@@ -77,10 +77,10 @@ class PhotosController < ApplicationController
def create
@photo = Photo.new(params[:photo])
- @photo.file = params[:file]
+ @photo.attachment = params[:file]
respond_to do |format|
if @photo.save
- format.html { render :text => "FILEID:" + @photo.file.album.url }
+ format.html { render :text => "FILEID:" + @photo.attachment.album.url }
format.xml { render :nothing => true }
else
format.html { render :text => "ERRORS:" + @photo.errors.full_messages.join(" "), :status => 500 }
@@ -91,7 +91,7 @@ class PhotosController < ApplicationController
def edit
@photo = Photo.find( params[:id])
- @tags = Tag.find(:all).map { |tag| tag.title }.join('\',\'')
+ @tags = Tag.all.map { |tag| tag.title }.join('\',\'')
end
def edit_multiple
diff --git a/app/controllers/user_sessions_controller.rb b/app/controllers/user_sessions_controller.rb
deleted file mode 100644
index acc3e57..0000000
--- a/app/controllers/user_sessions_controller.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-class UserSessionsController < ApplicationController
- before_filter :require_no_user, :only => [:new, :create]
- before_filter :require_user, :only => :destroy
-
- def new
- @user_session = UserSession.new
- end
-
- def create
- @user_session = UserSession.new(params[:user_session])
- if @user_session.save
- flash[:notice] = "Login successful!"
- redirect_back_or_default account_path
- else
- render :new
- end
- end
-
- def destroy
- current_user_session.destroy
- flash[:notice] = "Logout successful!"
- redirect_to root_path
- end
-end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index a7cb18d..8843607 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1,7 +1,6 @@
class UsersController < ApplicationController
before_filter :check_public_access
- before_filter :require_no_user, :only => [:new, :create]
- before_filter :require_user, :only => [:show, :edit, :update, :destroy]
+ skip_before_filter :authenticate_user!, :only => [:new, :create]
skip_filter :setup
def new
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb
index 1062f12..44e7820 100644
--- a/app/helpers/users_helper.rb
+++ b/app/helpers/users_helper.rb
@@ -1,9 +1,3 @@
module UsersHelper
- def has_permission?(permissions = [])
- return current_user && current_user.has_permission?(permissions)
- end
-
- def has_role?(roles = [])
- return current_user && current_user.in_role?(roles)
- end
+
end
diff --git a/app/models/ability.rb b/app/models/ability.rb
new file mode 100644
index 0000000..1064327
--- /dev/null
+++ b/app/models/ability.rb
@@ -0,0 +1,63 @@
+class Ability
+ include CanCan::Ability
+
+ def initialize(user)
+ self.clear_aliased_actions
+
+ alias_action :edit, :to => :update
+ alias_action :new, :to => :create
+ alias_action :new_action, :to => :create
+ alias_action :show, :to => :read
+
+ if user.has_role? 'admin'
+ can :manage, :all
+ else
+ #############################
+ can :read, User do |resource|
+ resource == user
+ end
+ can :update, User do |resource|
+ resource == user
+ end
+ can :create, User
+ ##############################
+ can :read, Profile do |resource|
+ resource == user
+ end
+ can :update, Profile do |resource|
+ resource == user
+ end
+ can :create, Profile
+ ###############################
+ can :read, Link do |resource|
+ resource == user
+ end
+ can :update, Link do |resource|
+ resource == user
+ end
+ can :create, Link
+ end
+ # Define abilities for the passed in user here. For example:
+ #
+ # user ||= User.new # guest user (not logged in)
+ # if user.admin?
+ # can :manage, :all
+ # else
+ # can :read, :all
+ # end
+ #
+ # The first argument to `can` is the action you are giving the user permission to do.
+ # If you pass :manage it will apply to every action. Other common actions here are
+ # :read, :create, :update and :destroy.
+ #
+ # The second argument is the resource the user can perform the action on. If you pass
+ # :all it will apply to every resource. Otherwise pass a Ruby class of the resource.
+ #
+ # The third argument is an optional hash of conditions to further filter the objects.
+ # For example, here the user can only update published articles.
+ #
+ # can :update, Article, :published => true
+ #
+ # See the wiki for details: https://github.com/ryanb/cancan/wiki/Defining-Abilities
+ end
+end
diff --git a/app/models/album.rb b/app/models/album.rb
index d88c06c..3f0728f 100644
--- a/app/models/album.rb
+++ b/app/models/album.rb
@@ -1,4 +1,6 @@
class Album < ActiveRecord::Base
+ extend Ext::GroupFor
+
has_many :photos, :dependent => :destroy
has_many :collection_albums
has_many :collections, :through => :collection_albums
@@ -12,7 +14,7 @@ class Album < ActiveRecord::Base
attr_accessor :tags
#attr_protected :path
-
+
scope :untouched, where("albums.id IN ( SELECT DISTINCT photos.album_id FROM photos WHERE photos.description IS NULL AND photos.id NOT IN ( SELECT photo_id FROM photo_tags) )").order('title')
scope :unused, where("albums.id NOT IN (SELECT album_id FROM collection_albums)")
scope :used, where("albums.id IN (SELECT album_id FROM collection_albums)")
diff --git a/app/models/collection.rb b/app/models/collection.rb
index 926a7f7..666248f 100644
--- a/app/models/collection.rb
+++ b/app/models/collection.rb
@@ -1,10 +1,13 @@
class Collection < ActiveRecord::Base
+ extend Ext::GroupFor
+
has_many :collection_albums
has_many :albums, :through => :collection_albums
attr_accessor :album_list
validates :title, :presence => true
+
def to_param
"#{id}-#{title.parameterize}"
end
diff --git a/app/models/permission.rb b/app/models/permission.rb
deleted file mode 100644
index c2951ff..0000000
--- a/app/models/permission.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-class Permission < ActiveRecord::Base
- # uncomment any of the following lines which is relevant to your application,
- # or create your own with the name of the model which acts_as_permissible.
- belongs_to :user
-
- belongs_to :role
-
- belongs_to :permissible, :polymorphic => true, :dependent => :destroy
-
- validates_presence_of :permissible_id, :permissible_type, :action
- validates_format_of :action, :with => /^[a-z_]+$/
- validates_numericality_of :permissible_id
- validates_uniqueness_of :action, :scope => [:permissible_id,:permissible_type]
-
- def to_hash
- self.new_record? ? {} : {self.action => self.granted}
- end
-
-end
\ No newline at end of file
diff --git a/app/models/photo.rb b/app/models/photo.rb
index 652fb6d..552ab39 100644
--- a/app/models/photo.rb
+++ b/app/models/photo.rb
@@ -1,17 +1,16 @@
class Photo < ActiveRecord::Base
- # TODO: path not used? it should be removed from the DB
+ extend Ext::GroupFor
belongs_to :album
has_many :photo_tags, :dependent => :destroy
has_many :tags, :through => :photo_tags
- mount_uploader :file, FileUploader
+ mount_uploader :attachment, FileUploader
- validates :title, :presence => true
-
- before_validation :set_title
+
before_create :exif_read
- #before_update :exif_write
+ before_update :exif_write
+ after_create :set_title
attr_accessor :tag_list
@@ -39,7 +38,7 @@ class Photo < ActiveRecord::Base
end
def tag_list
- return self.tags.find(:all, :order => 'title').map{ |t| t.title }.sort.join(" ")
+ return self.tags.order('title').map{ |t| t.title }.sort.join(" ")
end
def tag_list=(tags)
@@ -58,11 +57,13 @@ class Photo < ActiveRecord::Base
private
def set_title
- self.title = self.file.file.basename.titleize unless self.title
+ a=self.attachment.file.basename
+ update_attribute(:title, a.titleize)
+ self.title = self.attachment.file.basename.titleize unless self.title
end
def exif_read
- photo = MiniExiftool.new(self.file.file.file)
+ photo = MiniExiftool.new(self.attachment.file.file)
self.longitude = photo.GPSLongitude if self.longitude.nil?
self.latitude = photo.GPSLatitude if self.latitude.nil?
self.title = photo.DocumentName if self.title.nil?
@@ -72,7 +73,7 @@ class Photo < ActiveRecord::Base
def exif_write
# should only write if tags are changed as images can be large and thus ExifTool will take a while to write to the file
- photo = MiniExiftool.new(self.file.file.file)
+ photo = MiniExiftool.new(self.attachment.file.file)
photo.GPSLongitude = self.longitude
photo.GPSLatitude = self.latitude
photo.DocumentName = self.title
diff --git a/app/models/role.rb b/app/models/role.rb
index 8fbb325..a213fdf 100644
--- a/app/models/role.rb
+++ b/app/models/role.rb
@@ -1,12 +1,5 @@
class Role < ActiveRecord::Base
- has_many :role_memberships, :as => :roleable, :dependent => :destroy
- has_many :roles, :through => :role_memberships, :source => :role
-
- has_many :roleables, :class_name => "RoleMembership", :foreign_key => "role_id", :dependent => :destroy
- has_many :subroles, :through => :roleables, :source => :roleable, :source_type => 'Role'
- has_many :users, :through => :roleables, :source => :roleable, :source_type => 'User'
-
- validates :name, :presence => true, :uniqueness => true
-
- acts_as_permissible
-end
\ No newline at end of file
+ attr_accessible :name
+
+ has_and_belongs_to_many :users
+end
diff --git a/app/models/role_membership.rb b/app/models/role_membership.rb
deleted file mode 100644
index 9ebcbe2..0000000
--- a/app/models/role_membership.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-class RoleMembership < ActiveRecord::Base
- belongs_to :user
- belongs_to :role
- belongs_to :roleable, :polymorphic => true
-
- validates_presence_of :roleable_id, :roleable_type, :role_id
- validates_uniqueness_of :role_id, :scope => [:roleable_id, :roleable_type]
- validates_numericality_of :roleable_id, :role_id
- validates_format_of :roleable_type, :with => /^[A-Z]{1}[a-z0-9]+([A-Z]{1}[a-z0-9]+)*$/
- validate :role_does_not_belong_to_itself_in_a_loop
-
- protected
- def role_does_not_belong_to_itself_in_a_loop
- if roleable_type == "Role"
- if role_id == roleable_id
- errors.add_to_base("A role cannot belong to itself.")
- else
- if belongs_to_itself_through_other?(roleable_id, role_id)
- errors.add_to_base("A role cannot belong to a role which belongs to it.")
- end
- end
- end
- end
-
- def belongs_to_itself_through_other?(original_roleable_id, current_role_id)
- if self.class.find(:first, :select => "id", :conditions => ["roleable_id=? AND roleable_type='Role' AND role_id=?",current_role_id,original_roleable_id])
- return true
- else
- memberships = self.class.find(:all, :select => "role_id", :conditions => ["roleable_id=? AND roleable_type='Role'",current_role_id])
- if memberships.any? {|membership| belongs_to_itself_through_other?(original_roleable_id,membership.role_id)}
- return true
- end
- end
- return false
- end
-end
\ No newline at end of file
diff --git a/app/models/user.rb b/app/models/user.rb
index d1d3345..780cc4e 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,4 +1,43 @@
class User < ActiveRecord::Base
- acts_as_authentic
- acts_as_permissible
+ devise :database_authenticatable, :registerable, :confirmable, :token_authenticatable,
+ :recoverable, :rememberable, :trackable, :validatable, :omniauthable, :lockable
+
+ attr_accessible :id, :name, :second_name, :surname, :email, :password, :password_confirmation, :remember_me, :userpic
+
+ mount_uploader :userpic, UserpicUploader
+
+ has_and_belongs_to_many :roles
+
+ def small_url
+ userpic.url(:small)
+ end
+
+ alias_method :avatar, :small_url
+
+ def thumb_url
+ userpic.url(:thumb)
+ end
+
+ def original_url
+ userpic.url(:original)
+ end
+
+ ##########################################################
+ # This hack is needed to access the current user in models.
+ #See http://rails-bestpractices.com/posts/47-fetch-current-user-in-models
+ def self.current
+ Thread.current[:user]
+ end
+
+ def self.current=(user)
+ Thread.current[:user] = user
+ end
+
+ def self.admin_created?
+ User.admin.count > 0
+ end
+
+ def has_role?(role_in_question)
+ roles.any? { |role| role.name == role_in_question.to_s }
+ end
end
diff --git a/app/models/user_session.rb b/app/models/user_session.rb
deleted file mode 100644
index ec55ada..0000000
--- a/app/models/user_session.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-class UserSession < Authlogic::Session::Base
- # configuration here, see documentation for sub modules of Authlogic::Session
- def to_key
- new_record? ? nil : [ self.send(self.class.primary_key) ]
- end
-end
diff --git a/app/uploaders/file_uploader.rb b/app/uploaders/file_uploader.rb
index f429525..e38b330 100644
--- a/app/uploaders/file_uploader.rb
+++ b/app/uploaders/file_uploader.rb
@@ -2,6 +2,9 @@
class FileUploader < CarrierWave::Uploader::Base
+ @@generate_file_name = ''
+ @@original_filename = ''
+
# Include RMagick or ImageScience support
# include CarrierWave::RMagick
# include CarrierWave::ImageScience
@@ -21,7 +24,15 @@ class FileUploader < CarrierWave::Uploader::Base
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
#{}"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
- ENV['STORAGE_PATH'] + "/files/#{model.album.path}"
+ ENV['STORAGE_PATH'] + "/files/#{model.album.path}/#{model.id}"
+ end
+
+ def filename
+ unless @@original_filename == original_filename
+ @@original_filename = original_filename
+ @@generate_file_name = "#{::SecureRandom.hex(8)}#{File.extname(original_filename).downcase}" if original_filename
+ end
+ @@generate_file_name
end
# Provide a default URL as a default if there hasn't been a file uploaded
@@ -38,31 +49,34 @@ class FileUploader < CarrierWave::Uploader::Base
# Create different versions of your uploaded files
version :collection do
- process :resize_to_fill => [200, 200]
+ process :resize_to_fill => [260, 180]
def store_dir
- ENV['STORAGE_PATH'] + "/thumbs/#{model.album.path}"
+ ENV['STORAGE_PATH'] + "/thumbs/#{model.album.path}/#{model.id}"
end
end
+
version :album do
process :resize_to_fill => [100, 100]
def store_dir
- ENV['STORAGE_PATH'] + "/thumbs/#{model.album.path}"
+ ENV['STORAGE_PATH'] + "/thumbs/#{model.album.path}/#{model.id}"
end
end
+
version :preview do
process :resize_to_fit => [210, 210]
def store_dir
- ENV['STORAGE_PATH'] + "/thumbs/#{model.album.path}"
+ ENV['STORAGE_PATH'] + "/thumbs/#{model.album.path}/#{model.id}"
end
end
+
version :single do
process :resize_to_limit => [950, 950]
def store_dir
- ENV['STORAGE_PATH'] + "/thumbs/#{model.album.path}"
+ ENV['STORAGE_PATH'] + "/thumbs/#{model.album.path}/#{model.id}"
end
end
@@ -71,10 +85,4 @@ class FileUploader < CarrierWave::Uploader::Base
def extension_white_list
%w(jpg jpeg gif png bmp tiff)
end
-
- # Override the filename of the uploaded files
- # def filename
- # "something.jpg" if original_filename
- # end
-
end
diff --git a/app/uploaders/userpic_uploader.rb b/app/uploaders/userpic_uploader.rb
new file mode 100644
index 0000000..888b822
--- /dev/null
+++ b/app/uploaders/userpic_uploader.rb
@@ -0,0 +1,21 @@
+class UserpicUploader < CarrierWave::Uploader::Base
+ include CarrierWave::MiniMagick
+
+ def store_dir
+ "#{ENV['STORAGE_PATH']}/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}/original"
+ end
+
+ def filename
+ "#{::SecureRandom.hex(8)}#{File.extname(original_filename).downcase}" if original_filename
+ end
+
+
+ version :small do
+ process :resize_to_fit => [100, 100]
+
+ def store_dir
+ "#{ENV['STORAGE_PATH']}/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}/small"
+ end
+ end
+
+end
\ No newline at end of file
diff --git a/app/views/admin/users/_form.html.erb b/app/views/admin/users/_form.html.erb
deleted file mode 100644
index b70ae04..0000000
--- a/app/views/admin/users/_form.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-<%= form.label :name, 'Display name' %>
-<%= form.text_field :name %>
-
-<%= form.label :email %>
-<%= form.text_field :email %>
-
-<%= form.label :password %>
-<%= form.password_field :password %>
-
-<%= form.label :password_confirmation %>
-<%= form.password_field :password_confirmation %>
-
diff --git a/app/views/admin/users/edit.html.erb b/app/views/admin/users/edit.html.erb
deleted file mode 100644
index 4092d1c..0000000
--- a/app/views/admin/users/edit.html.erb
+++ /dev/null
@@ -1,15 +0,0 @@
-
- Name: - <%=h @user.name %> -
- -- Email: - <%=h @user.email %> -
- - -- Login count: - <%=h @user.login_count %> -
- -- Last request at: - <%=h @user.last_request_at %> -
- -- Last login at: - <%=h @user.last_login_at %> -
- -- Current login at: - <%=h @user.current_login_at %> -
- -- Last login ip: - <%=h @user.last_login_ip %> -
- -- Current login ip: - <%=h @user.current_login_ip %> -
- - -<%= content_for :action_links do %> -<%= link_to 'Edit', edit_user_path(@user) %> -<% end %> \ No newline at end of file diff --git a/app/views/albums/show.html.erb b/app/views/albums/show.html.erb index 84a5cf7..8fb9819 100644 --- a/app/views/albums/show.html.erb +++ b/app/views/albums/show.html.erb @@ -6,7 +6,7 @@ <% for photo in @album.photos.find(:all, :order => "Id ASC") %> <% count += 1%> <% if count == 1 || ( (count-1) / 4.0 == ( (count-1) / 4.0).to_i ) %>Welcome <%= @resource.email %>!
+ +You can confirm your account email through the link below:
+ +<%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %>
diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb new file mode 100644 index 0000000..ae9e888 --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.html.erb @@ -0,0 +1,8 @@ +Hello <%= @resource.email %>!
+ +Someone has requested a link to change your password, and you can do this through the link below.
+ +<%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %>
+ +If you didn't request this, please ignore this email.
+Your password won't change until you access the link above and create a new one.
diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb new file mode 100644 index 0000000..2263c21 --- /dev/null +++ b/app/views/devise/mailer/unlock_instructions.html.erb @@ -0,0 +1,7 @@ +Hello <%= @resource.email %>!
+ +Your account has been locked due to an excessive amount of unsuccessful sign in attempts.
+ +Click the link below to unlock your account:
+ +<%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %>
diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb new file mode 100644 index 0000000..5f7bcf8 --- /dev/null +++ b/app/views/devise/passwords/edit.html.erb @@ -0,0 +1,16 @@ +Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.
+ +<%= link_to "Back", :back %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb new file mode 100644 index 0000000..f5136f1 --- /dev/null +++ b/app/views/devise/registrations/new.html.erb @@ -0,0 +1,18 @@ +This is a template for a simple marketing or informational website. It includes a large callout called the hero + unit and three supporting pieces of content. Use it as a starting point to create something more unique.
+ +On disk: ~/<%= @photo.file.path %>
\ No newline at end of file +On disk: ~/<%= @photo.attachment.path %>
\ No newline at end of file diff --git a/app/views/photos/_photo.pdf.erb b/app/views/photos/_photo.pdf.erb index 00259fe..6b065fd 100644 --- a/app/views/photos/_photo.pdf.erb +++ b/app/views/photos/_photo.pdf.erb @@ -1 +1 @@ -<%= image_tag photo.file.single.url %>-<%= f.fields_for photo, :index => photo.id do |p|%> - <%= p.check_box :_delete %> - <%= render :partial => "photos/thumb", :locals => {:photo => photo } %> - <%= p.text_field :title %> - <%= p.text_field :tags, :value => photo.tag_list %> -<% end%> -
-<% end%> -<%= f.submit "Submit" %>
+<%= form_for :photos, :url => update_multiple_photos_path, :html => {:method => :put} do |f| %> + <% for photo in @photos %> ++ <%= f.fields_for photo, :index => photo.id do |p| %> + <%= p.check_box :_delete %> + <%= render :partial => "photos/thumb", :locals => {:photo => photo} %> + <%= p.text_field :title %> + <%= p.text_field :tags, :value => photo.tag_list %> + <% end %> +
+ <% end %> +<%= f.submit "Submit" %>
<% end %> -<%= link_to_if @next, image_tag(@photo.file.single.url ), [ @photo.album.collections.first, @photo.album, @next] %>
+ +<%= link_to_if @next, image_tag(@photo.attachment.single.url), [@photo.album.collections.first, @photo.album, @next] %>
<%= @photo.description %>
-Tagged with: -<% for tag in @photo.tags.map{|tag|tag.title}.sort %> -<%= link_to tag, tag_photos_path(tag) %> -<% end %> +
Tagged with: + <% for tag in @photo.tags.map { |tag| tag.title }.sort %> + <%= link_to tag, tag_photos_path(tag) %> + <% end %> -<%= content_for :action_links do %> -<% if has_role?("admin") %> -<% if params[:collection_id] %> -<%= link_to "Edit photo", edit_collection_album_photo_path(params[:collection_id], params[:album_id], @photo) %> -<% else %> -<%= link_to "Edit photo", edit_photo_path(@photo) %> -<% end %> -<% end %> + <%= content_for :action_links do %> + <% if current_user and current_user.has_role?("admin") %> + <% if params[:collection_id] %> + <%= link_to "Edit photo", edit_collection_album_photo_path(params[:collection_id], params[:album_id], @photo) %> + <% else %> + <%= link_to "Edit photo", edit_photo_path(@photo) %> + <% end %> + <% end %> <% end %> \ No newline at end of file diff --git a/app/views/photos/untouched.html.erb b/app/views/photos/untouched.html.erb index 3b1424c..ebb5c22 100644 --- a/app/views/photos/untouched.html.erb +++ b/app/views/photos/untouched.html.erb @@ -1,12 +1,12 @@ -<%= form_for :photos, :url => update_multiple_photos_path, :html => { :method => :put } do |f| %> -<% for photo in @photos %> -
-<%= f.fields_for photo do |p|%> - <%= render :partial => "photos/thumb", :locals => {:photo => photo } %> - <%= p.text_field :title, :index => photo.id %> - <%= p.text_field :tags, :index => photo.id, :value => photo.tag_list %> -<% end%> -
-<% end%> -<%= f.submit "Submit" %>
+<%= form_for :photos, :url => update_multiple_photos_path, :html => {:method => :put} do |f| %> + <% for photo in @photos %> ++ <%= f.fields_for photo do |p| %> + <%= render :partial => "photos/thumb", :locals => {:photo => photo} %> + <%= p.text_field :title, :index => photo.id %> + <%= p.text_field :tags, :index => photo.id, :value => photo.tag_list %> + <% end %> +
+ <% end %> +<%= f.submit "Submit" %>
<% end %> \ No newline at end of file diff --git a/app/views/photos/upload.html.erb b/app/views/photos/upload.html.erb index 407d84b..a473b90 100644 --- a/app/views/photos/upload.html.erb +++ b/app/views/photos/upload.html.erb @@ -1,13 +1,7 @@ <%= content_for :javascript do %> - - <%= javascript_include_tag "plupload/js/plupload.full.js" -%> - <%= javascript_include_tag "plupload/js/jquery.plupload.queue/jquery.plupload.queue.js" -%> - + + +<%= stylesheet_link_tag "application", :media => "all" %> +<%= javascript_include_tag "application" %> + + +<%= favicon_link_tag 'images/apple-touch-icon-144x144-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '144x144' %> + + + +<%= favicon_link_tag 'images/apple-touch-icon-114x114-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '114x114' %> + + + +<%= favicon_link_tag 'images/apple-touch-icon-72x72-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '72x72' %> + + + +<%= favicon_link_tag 'images/apple-touch-icon-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png' %> + + + +<%= favicon_link_tag 'images/favicon.ico', :rel => 'shortcut icon' %> + +<%= yield :head %> +<%= yield :javascript %> \ No newline at end of file diff --git a/app/views/shared/_nav_bar.html.erb b/app/views/shared/_nav_bar.html.erb new file mode 100644 index 0000000..498673c --- /dev/null +++ b/app/views/shared/_nav_bar.html.erb @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/app/views/shared/_user_links.html.erb b/app/views/shared/_user_links.html.erb new file mode 100644 index 0000000..994aea6 --- /dev/null +++ b/app/views/shared/_user_links.html.erb @@ -0,0 +1,14 @@ +<% if current_user %> + +<% end %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index eb934ed..16ea68b 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,44 +1,42 @@Name: - <%=h @user.name %> + <%= @user.first_name %> +
++ Second Name: + <%= @user.second_name %>
-Email: - <%=h @user.email %> + <%= @user.email %>
Login count: - <%=h @user.login_count %> + <%= @user.sign_in_count %>
- -- Last request at: - <%=h @user.last_request_at %> -
- +Last login at: - <%=h @user.last_login_at %> + <%= @user.last_sign_in_at %>
- +Current login at: - <%=h @user.current_login_at %> + <%= @user.current_sign_in_at %>
- +Last login ip: - <%=h @user.last_login_ip %> + <%= @user.last_sign_in_ip %>
- +Current login ip: - <%=h @user.current_login_ip %> + <%= @user.current_sign_in_ip %>
- - + + <%= link_to 'Edit', edit_account_path %> <%= link_to 'Logout', logout_path %> \ No newline at end of file diff --git a/config.ru b/config.ru index 5812564..d32a263 100644 --- a/config.ru +++ b/config.ru @@ -1,4 +1,4 @@ # This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) -run Balder::Application +run Photomix::Application diff --git a/config/application.rb b/config/application.rb index 61f1ca1..f23ebb4 100644 --- a/config/application.rb +++ b/config/application.rb @@ -6,7 +6,7 @@ require 'rails/all' # you've limited to :test, :development, or :production. Bundler.require(:default, Rails.env) if defined?(Bundler) -module Balder +module Photomix class Application < Rails::Application # Custom directories with classes and modules you want to be autoloadable. @@ -16,6 +16,9 @@ module Balder config.encoding = "utf-8" config.i18n.default_locale = :ru config.time_zone = 'Moscow' + config.active_support.escape_html_entities_in_json = true + config.assets.enabled = true + config.assets.version = '1.0' # Configure sensitive parameters which will be filtered from the log file. config.filter_parameters += [:password, :password_confirmation] diff --git a/config/application_config.rb b/config/application_config.rb new file mode 100644 index 0000000..96ddab0 --- /dev/null +++ b/config/application_config.rb @@ -0,0 +1,55 @@ +configuration = { + :app_host => "example.com", + :site_name => "PhotoMix", + :site_description => "The Best Site!", + :support_email => "support@example.com", + :meta_description => 'A description of your site for use in META tags.', + :meta_keywords => 'keywords for use in META tags', + + :userpic => { + :paperclip_options => { + :default_url => "http://lorempixel.com/87/86/people/", + :styles => { + :thumb => "100x100>", + :small => "80x80>" + }, + :url => "/system/:class/:attachment/:id/:style/:filename", + :path => "public/system/:class/:attachment/:id/:style/:filename" + }, + :validation_options => { + :max_size => 1, + :content_type => ['image/jpg', 'image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png'] + } + }, + + :terms => 'Penatibus pulvinar nisi vel sed placerat tincidunt est scelerisque velit est dictumst. + Aenean diam, scelerisque in cum eros? Dignissim phasellus phasellus pellentesque rhoncus risus tempor + a ut nunc, sed porta hac porttitor auctor purus risus platea, tempor tortor, mus tincidunt vel magna. + Tristique mid purus sit mattis elit, vut nunc turpis elementum scelerisque augue aenean magnis, eros magna placerat. + Et urna nascetur, elementum porttitor egestas a amet tincidunt rhoncus porta sit lundium, enim, ut augue tortor + ultricies magnis tristique sed egestas urna cum rhoncus penatibus porttitor tortor. Velit scelerisque odio! Adipiscing, + dolor habitasse tincidunt dolor lundium, augue integer odio, ut, mauris integer, natoque placerat velit, velit, duis in, + enim turpis, cursus magna lundium risus odio dignissim arcu porta urna? Enim. + + Tincidunt proin, ultrices ridiculus! Proin. Placerat et? Ut aenean, parturient porttitor? + Duis egestas magnis montes, turpis, cursus, pulvinar diam, parturient placerat sociis turpis. + Enim mid? Ultricies mauris sagittis facilisis adipiscing lectus pellentesque porttitor. Vel tincidunt, non ridiculus, + in aenean aliquet dictumst pellentesque duis et massa diam tincidunt. Elementum? Odio, pid. Habitasse, urna, + nascetur cursus magna facilisis mauris facilisis montes. Adipiscing egestas urna magna dignissim ac, pellentesque + lectus. Porta adipiscing amet. Porta placerat montes mus, proin, sit cum vut et, elementum mid ut, dignissim + natoque rhoncus urna dolor ridiculus? Egestas, enim pellentesque magna augue placerat eros? Urna dignissim lorem, + mattis elementum. Integer porttitor pulvinar. Aenean ridiculus urna scelerisque et et quis purus duis aliquam eu eu + nec dictumst, sagittis! Aliquam. + + Ac eu eros! Sed tincidunt, mattis etiam? Odio odio dignissim integer? Ut dictumst porttitor. Lectus turpis turpis + in porta. Aenean ut diam mauris augue mattis ultricies est? Habitasse. Turpis? Parturient dictumst ut facilisis sit? + Dapibus, dolor odio augue elementum porttitor eu nunc cras hac non dapibus facilisis? Pellentesque nec vut purus + dignissim turpis, vut elementum? Ridiculus amet urna vel! Sed, in montes, dignissim rhoncus habitasse, parturient turpis? + Natoque turpis sociis tortor, dignissim platea placerat, eu lundium duis amet cursus, tincidunt velit, rhoncus elementum, + proin ut mus purus! Mid eros enim eros sed mid penatibus. A, sed sit. A ultrices ac eu! Tortor turpis aliquet odio, + pellentesque vut sit dictumst nunc adipiscing. Augue amet aliquam rhoncus enim arcu velit sit.' + + +} + +configatron.configure_from_hash(configuration) \ No newline at end of file diff --git a/config/database.example.yml b/config/database.example.yml index 225da3b..dc429f5 100644 --- a/config/database.example.yml +++ b/config/database.example.yml @@ -6,19 +6,19 @@ development: development_mysql_osx: adapter: mysql2 encoding: utf8 - username: balder + username: photomix password: changeme - database: balder_development + database: photomix_development socket: /tmp/mysql.sock production: adapter: mysql2 encoding: utf8 - username: balder + username: photomix password: changeme - database: balder_production + database: photomix_production socket: /var/run/mysqld/mysqld.sock test: &TEST adapter: postgresql database: gallery_test - username: balder + username: photomix password: changeme \ No newline at end of file diff --git a/config/environment.rb b/config/environment.rb index b6e391d..c83d518 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -2,8 +2,8 @@ require File.expand_path('../application', __FILE__) # Load app vars from local file -balder_env = File.join(Rails.root, 'config', 'balder.rb') -load(balder_env) if File.exists?(balder_env) +photomix_env = File.join(Rails.root, 'config', 'photomix.rb') +load(photomix_env) if File.exists?(photomix_env) # Initialize the rails application -Balder::Application.initialize! \ No newline at end of file +Photomix::Application.initialize! \ No newline at end of file diff --git a/config/environments/development.rb b/config/environments/development.rb index 6726ae0..8b16f80 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,9 +1,9 @@ -Balder::Application.configure do - # Settings specified here will take precedence over those in config/environment.rb +Photomix::Application.configure do + # Settings specified here will take precedence over those in config/application.rb # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development - # since you don't have to restart the webserver when you make code changes. + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. config.cache_classes = false # Log error messages when you accidentally call methods on nil. @@ -21,7 +21,20 @@ Balder::Application.configure do # Only use best-standards-support built into browsers config.action_dispatch.best_standards_support = :builtin - + + # Raise exception on mass assignment protection for Active Record models + config.active_record.mass_assignment_sanitizer = :strict + + # Log the query plan for queries taking more than this (works + # with SQLite, MySQL, and PostgreSQL) + config.active_record.auto_explain_threshold_in_seconds = 0.5 + + # Do not compress assets + config.assets.compress = false + + # Expands the lines which load the assets + config.assets.debug = true + config.action_mailer.default_url_options = { :host => 'localhost:3000' } ENV["RAILS_ASSET_ID"] = "" end diff --git a/config/environments/production.rb b/config/environments/production.rb index ce74866..9106759 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,7 +1,6 @@ -Balder::Application.configure do - # Settings specified here will take precedence over those in config/environment.rb +Photomix::Application.configure do + # Settings specified here will take precedence over those in config/application.rb - # The production environment is meant for finished, "live" apps. # Code is not reloaded between requests config.cache_classes = true @@ -9,31 +8,46 @@ Balder::Application.configure do config.consider_all_requests_local = false config.action_controller.perform_caching = true + # Disable Rails's static asset server (Apache or nginx will already do this) + config.serve_static_assets = false + + # Compress JavaScripts and CSS + config.assets.compress = true + + # Don't fallback to assets pipeline if a precompiled asset is missed + config.assets.compile = false + + # Generate digests for assets URLs + config.assets.digest = true + + # Defaults to Rails.root.join("public/assets") + # config.assets.manifest = YOUR_PATH + # Specifies the header that your server uses for sending files - config.action_dispatch.x_sendfile_header = "X-Sendfile" + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx - # For nginx: - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' - - # If you have no front-end server that supports something like X-Sendfile, - # just comment this out and Rails will serve the files + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true # See everything in the log (default is :info) # config.log_level = :debug + # Prepend all log lines with the following tags + # config.log_tags = [ :subdomain, :uuid ] + # Use a different logger for distributed setups - # config.logger = SyslogLogger.new + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) # Use a different cache store in production # config.cache_store = :mem_cache_store - # Disable Rails's static asset server - # In production, Apache or nginx will already do this - config.serve_static_assets = false - - # Enable serving of images, stylesheets, and javascripts from an asset server + # Enable serving of images, stylesheets, and JavaScripts from an asset server # config.action_controller.asset_host = "http://assets.example.com" + # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) + config.assets.precompile += %w( front.js front_preloader.js ) + # Disable delivery errors, bad email addresses will be ignored # config.action_mailer.raise_delivery_errors = false @@ -46,4 +60,8 @@ Balder::Application.configure do # Send deprecation notices to registered listeners config.active_support.deprecation = :notify + + # Log the query plan for queries taking more than this (works + # with SQLite, MySQL, and PostgreSQL) + # config.active_record.auto_explain_threshold_in_seconds = 0.5 end diff --git a/config/environments/test.rb b/config/environments/test.rb index f37dba9..de24bf3 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,4 +1,4 @@ -Balder::Application.configure do +Photomix::Application.configure do # Settings specified here will take precedence over those in config/environment.rb # The test environment is used exclusively to run your application's diff --git a/config/initializers/carrier_wave.rb b/config/initializers/carrier_wave.rb new file mode 100644 index 0000000..e131437 --- /dev/null +++ b/config/initializers/carrier_wave.rb @@ -0,0 +1 @@ +CarrierWave::SanitizedFile.sanitize_regexp = /[^[:word:]\.\-\+]/ \ No newline at end of file diff --git a/config/initializers/configatron.rb b/config/initializers/configatron.rb new file mode 100644 index 0000000..e72b71b --- /dev/null +++ b/config/initializers/configatron.rb @@ -0,0 +1,2 @@ +require 'configatron' +require Rails.root.join('config','application_config.rb') \ No newline at end of file diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb new file mode 100644 index 0000000..b7dbeac --- /dev/null +++ b/config/initializers/devise.rb @@ -0,0 +1,232 @@ +# Use this hook to configure devise mailer, warden hooks and so forth. +# Many of these configuration options can be set straight in your model. +Devise.setup do |config| + # ==> Mailer Configuration + # Configure the e-mail address which will be shown in Devise::Mailer, + # note that it will be overwritten if you use your own mailer class with default "from" parameter. + config.mailer_sender = "robot@example.com" + + # Configure the class responsible to send e-mails. + # config.mailer = "Devise::Mailer" + + # ==> ORM configuration + # Load and configure the ORM. Supports :active_record (default) and + # :mongoid (bson_ext recommended) by default. Other ORMs may be + # available as additional gems. + require 'devise/orm/active_record' + + # ==> Configuration for any authentication mechanism + # Configure which keys are used when authenticating a user. The default is + # just :email. You can configure it to use [:username, :subdomain], so for + # authenticating a user, both parameters are required. Remember that those + # parameters are used only when authenticating and not when retrieving from + # session. If you need permissions, you should implement that in a before filter. + # You can also supply a hash where the value is a boolean determining whether + # or not authentication should be aborted when the value is not present. + # config.authentication_keys = [ :email ] + + # Configure parameters from the request object used for authentication. Each entry + # given should be a request method and it will automatically be passed to the + # find_for_authentication method and considered in your model lookup. For instance, + # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. + # The same considerations mentioned for authentication_keys also apply to request_keys. + # config.request_keys = [] + + # Configure which authentication keys should be case-insensitive. + # These keys will be downcased upon creating or modifying a user and when used + # to authenticate or find a user. Default is :email. + config.case_insensitive_keys = [ :email ] + + # Configure which authentication keys should have whitespace stripped. + # These keys will have whitespace before and after removed upon creating or + # modifying a user and when used to authenticate or find a user. Default is :email. + config.strip_whitespace_keys = [ :email ] + + # Tell if authentication through request.params is enabled. True by default. + # It can be set to an array that will enable params authentication only for the + # given strategies, for example, `config.params_authenticatable = [:database]` will + # enable it only for database (email + password) authentication. + # config.params_authenticatable = true + + # Tell if authentication through HTTP Basic Auth is enabled. False by default. + # It can be set to an array that will enable http authentication only for the + # given strategies, for example, `config.http_authenticatable = [:token]` will + # enable it only for token authentication. + # config.http_authenticatable = false + + # If http headers should be returned for AJAX requests. True by default. + # config.http_authenticatable_on_xhr = true + + # The realm used in Http Basic Authentication. "Application" by default. + # config.http_authentication_realm = "Application" + + # It will change confirmation, password recovery and other workflows + # to behave the same regardless if the e-mail provided was right or wrong. + # Does not affect registerable. + # config.paranoid = true + + # By default Devise will store the user in session. You can skip storage for + # :http_auth and :token_auth by adding those symbols to the array below. + # Notice that if you are skipping storage for all authentication paths, you + # may want to disable generating routes to Devise's sessions controller by + # passing :skip => :sessions to `devise_for` in your config/routes.rb + config.skip_session_storage = [:http_auth] + + # ==> Configuration for :database_authenticatable + # For bcrypt, this is the cost for hashing the password and defaults to 10. If + # using other encryptors, it sets how many times you want the password re-encrypted. + # + # Limiting the stretches to just one in testing will increase the performance of + # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use + # a value less than 10 in other environments. + config.stretches = Rails.env.test? ? 1 : 10 + + # Setup a pepper to generate the encrypted password. + # config.pepper = "8464ad45498829424d5220a93af12ced3d7d656e5be3dac9fc15a47a8837c421ee476980a5d030b9c0cd589143e6108a21c5abc912b688a848baa8e1409aaa7d" + + # ==> Configuration for :confirmable + # A period that the user is allowed to access the website even without + # confirming his account. For instance, if set to 2.days, the user will be + # able to access the website for two days without confirming his account, + # access will be blocked just in the third day. Default is 0.days, meaning + # the user cannot access the website without confirming his account. + # config.allow_unconfirmed_access_for = 2.days + + # If true, requires any email changes to be confirmed (exactly the same way as + # initial account confirmation) to be applied. Requires additional unconfirmed_email + # db field (see migrations). Until confirmed new email is stored in + # unconfirmed email column, and copied to email column on successful confirmation. + config.reconfirmable = true + + # Defines which key will be used when confirming an account + # config.confirmation_keys = [ :email ] + + # ==> Configuration for :rememberable + # The time the user will be remembered without asking for credentials again. + # config.remember_for = 2.weeks + + # If true, extends the user's remember period when remembered via cookie. + # config.extend_remember_period = false + + # Options to be passed to the created cookie. For instance, you can set + # :secure => true in order to force SSL only cookies. + # config.rememberable_options = {} + + # ==> Configuration for :validatable + # Range for password length. Default is 6..128. + # config.password_length = 6..128 + + # Email regex used to validate email formats. It simply asserts that + # an one (and only one) @ exists in the given string. This is mainly + # to give user feedback and not to assert the e-mail validity. + # config.email_regexp = /\A[^@]+@[^@]+\z/ + + # ==> Configuration for :timeoutable + # The time you want to timeout the user session without activity. After this + # time the user will be asked for credentials again. Default is 30 minutes. + # config.timeout_in = 30.minutes + + # If true, expires auth token on session timeout. + # config.expire_auth_token_on_timeout = false + + # ==> Configuration for :lockable + # Defines which strategy will be used to lock an account. + # :failed_attempts = Locks an account after a number of failed attempts to sign in. + # :none = No lock strategy. You should handle locking by yourself. + # config.lock_strategy = :failed_attempts + + # Defines which key will be used when locking and unlocking an account + # config.unlock_keys = [ :email ] + + # Defines which strategy will be used to unlock an account. + # :email = Sends an unlock link to the user email + # :time = Re-enables login after a certain amount of time (see :unlock_in below) + # :both = Enables both strategies + # :none = No unlock strategy. You should handle unlocking by yourself. + # config.unlock_strategy = :both + + # Number of authentication tries before locking an account if lock_strategy + # is failed attempts. + # config.maximum_attempts = 20 + + # Time interval to unlock the account if :time is enabled as unlock_strategy. + # config.unlock_in = 1.hour + + # ==> Configuration for :recoverable + # + # Defines which key will be used when recovering the password for an account + # config.reset_password_keys = [ :email ] + + # Time interval you can reset your password with a reset password key. + # Don't put a too small interval or your users won't have the time to + # change their passwords. + config.reset_password_within = 6.hours + + # ==> Configuration for :encryptable + # Allow you to use another encryption algorithm besides bcrypt (default). You can use + # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, + # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) + # and :restful_authentication_sha1 (then you should set stretches to 10, and copy + # REST_AUTH_SITE_KEY to pepper) + # config.encryptor = :sha512 + + # ==> Configuration for :token_authenticatable + # Defines name of the authentication token params key + # config.token_authentication_key = :auth_token + + # ==> Scopes configuration + # Turn scoped views on. Before rendering "sessions/new", it will first check for + # "users/sessions/new". It's turned off by default because it's slower if you + # are using only default views. + # config.scoped_views = false + + # Configure the default scope given to Warden. By default it's the first + # devise role declared in your routes (usually :user). + # config.default_scope = :user + + # Set this configuration to false if you want /users/sign_out to sign out + # only the current scope. By default, Devise signs out all scopes. + # config.sign_out_all_scopes = true + + # ==> Navigation configuration + # Lists the formats that should be treated as navigational. Formats like + # :html, should redirect to the sign in page when the user does not have + # access, but formats like :xml or :json, should return 401. + # + # If you have any extra navigational formats, like :iphone or :mobile, you + # should add them to the navigational formats lists. + # + # The "*/*" below is required to match Internet Explorer requests. + # config.navigational_formats = ["*/*", :html] + + # The default HTTP method used to sign out a resource. Default is :delete. + config.sign_out_via = :delete + + # ==> OmniAuth + # Add a new OmniAuth provider. Check the wiki for more information on setting + # up on your models and hooks. + # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo' + + # ==> Warden configuration + # If you want to use other strategies, that are not supported by Devise, or + # change the failure app, you can configure them inside the config.warden block. + # + # config.warden do |manager| + # manager.intercept_401 = false + # manager.default_strategies(:scope => :user).unshift :some_external_strategy + # end + + # ==> Mountable engine configurations + # When using Devise inside an engine, let's call it `MyEngine`, and this engine + # is mountable, there are some extra configurations to be taken into account. + # The following options are available, assuming the engine is mounted as: + # + # mount MyEngine, at: "/my_engine" + # + # The router that invoked `devise_for`, in the example above, would be: + # config.router_name = :my_engine + # + # When using omniauth, Devise cannot automatically set Omniauth path, + # so you need to do it manually. For the users scope, it would be: + # config.omniauth_path_prefix = "/my_engine/users/auth" +end \ No newline at end of file diff --git a/config/initializers/hack.rb b/config/initializers/hack.rb new file mode 100644 index 0000000..182ef9c --- /dev/null +++ b/config/initializers/hack.rb @@ -0,0 +1 @@ +LIKE = ActiveRecord::Base.connection.adapter_name == 'PostgreSQL' ? 'ILIKE' : 'LIKE' \ No newline at end of file diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 9e8b013..5d8d9be 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -8,3 +8,8 @@ # inflect.irregular 'person', 'people' # inflect.uncountable %w( fish sheep ) # end +# +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index 72aca7e..6eba1b9 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -2,4 +2,5 @@ # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf -# Mime::Type.register_alias "text/html", :iphone +#Mime::Type.register_alias "text/html", :iphone +Mime::Type.register "image/svg+xml", :svg diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index b5c3869..aa94ce3 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -4,4 +4,4 @@ # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. -Balder::Application.config.secret_token = '23aabccbfd8e48ab8b96104ba699a1603e6bad13a125317be3ed9963c18cd24b9afa725d218688202f3752fd693cc8358f522c0f18c42a5a0b8ce3c84a8b89a2' +Photomix::Application.config.secret_token = '23aabccbfd8e48ab8b96104ba699a1603e6bad13a125317be3ed9963c18cd24b9afa725d218688202f3752fd693cc8358f522c0f18c42a5a0b8ce3c84a8b89a2' diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index dad7062..be062c2 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,6 +1,6 @@ # Be sure to restart your server when you modify this file. -Balder::Application.config.session_store :cookie_store, :key => '_balder_session' +Photomix::Application.config.session_store :cookie_store, :key => '_photomix_session' Rails.application.config.middleware.insert_before( Rails.application.config.session_store, @@ -11,4 +11,4 @@ Rails.application.config.middleware.insert_before( # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information # (create the session table with "rake db:sessions:create") -# Balder::Application.config.session_store :active_record_store +# Photomix::Application.config.session_store :active_record_store diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml new file mode 100644 index 0000000..7783a74 --- /dev/null +++ b/config/locales/devise.en.yml @@ -0,0 +1,58 @@ +# Additional translations at https://github.com/plataformatec/devise/wiki/I18n + +en: + errors: + messages: + expired: "has expired, please request a new one" + not_found: "not found" + already_confirmed: "was already confirmed, please try signing in" + not_locked: "was not locked" + not_saved: + one: "1 error prohibited this %{resource} from being saved:" + other: "%{count} errors prohibited this %{resource} from being saved:" + + devise: + failure: + already_authenticated: 'You are already signed in.' + unauthenticated: 'You need to sign in or sign up before continuing.' + unconfirmed: 'You have to confirm your account before continuing.' + locked: 'Your account is locked.' + invalid: 'Invalid email or password.' + invalid_token: 'Invalid authentication token.' + timeout: 'Your session expired, please sign in again to continue.' + inactive: 'Your account was not activated yet.' + sessions: + signed_in: 'Signed in successfully.' + signed_out: 'Signed out successfully.' + passwords: + send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.' + updated: 'Your password was changed successfully. You are now signed in.' + updated_not_active: 'Your password was changed successfully.' + send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." + no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." + confirmations: + send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.' + send_paranoid_instructions: 'If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes.' + confirmed: 'Your account was successfully confirmed. You are now signed in.' + registrations: + signed_up: 'Welcome! You have signed up successfully.' + signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.' + signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.' + signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.' + updated: 'You updated your account successfully.' + update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address." + destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.' + unlocks: + send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.' + unlocked: 'Your account has been unlocked successfully. Please sign in to continue.' + send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.' + omniauth_callbacks: + success: 'Successfully authenticated from %{kind} account.' + failure: 'Could not authenticate you from %{kind} because "%{reason}".' + mailer: + confirmation_instructions: + subject: 'Confirmation instructions' + reset_password_instructions: + subject: 'Reset password instructions' + unlock_instructions: + subject: 'Unlock Instructions' diff --git a/config/balder.rb b/config/photomix.rb similarity index 100% rename from config/balder.rb rename to config/photomix.rb diff --git a/config/routes.rb b/config/routes.rb index 20761dc..ec5ec57 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,8 +1,17 @@ -Balder::Application.routes.draw do +Photomix::Application.routes.draw do + mount DeviseOmniauthEngine::Engine => "/", :as => "devise_omniauth" + + devise_scope :user do + get '/login' => 'devise/sessions#new', :as => :login + get '/signup' => 'devise/registrations#new', :as => :signup + get '/logout' => 'devise/sessions#destroy', :as => :logout + resource :account, :controller => :users, :as => :user_root + end + + devise_for :users, :controllers => {:omniauth_callbacks => "users/omniauth_callbacks"}, + :path_names => {:sign_out => 'logout'} + resource :account, :controller => :users - match "login", :to => "user_sessions#new", :as => :login - match "authenticate", :to => "user_sessions#create", :as => :authenticate - match "logout", :to => "user_sessions#destroy", :as => :logout resources :photos do collection do @@ -45,14 +54,14 @@ Balder::Application.routes.draw do end end end - + resources :tags, :shallow => true do resources :photos resources :albums end - - resources :users, :controller => "admin/users" - + + match '/locale' => "locale#set" + root :to => "collections#index" end diff --git a/config/yettings/devise_omniauth_engine.yml b/config/yettings/devise_omniauth_engine.yml new file mode 100644 index 0000000..bdab8ea --- /dev/null +++ b/config/yettings/devise_omniauth_engine.yml @@ -0,0 +1,15 @@ +development: + twitter_key: Uaqi5HXJlxVPKrQD0Rytw + twitter_secret: RCxKqgsjqNxmjd2YDLEjOn6emhMOjwy3yWPvLO06i0 + facebook_key: 237456219689843 + facebook_secret: ffec0c5a132bb83473084c31a6bd27ed + vkontakte_key: 2951707 + vkontakte_secret: CWOzbZrfFagKmtdMb1ZC + +production: + twitter_key: LY7PGBLsvSF0Z4rK30a9cA + twitter_secret: PvyYVDQRysLGy8Vvvj6RcFewdLmpdmnvUzKm6IqrBY + facebook_key: 310467435688958 + facebook_secret: a95127a3842bc45a82199e3eceb9b837 + vkontakte_key: 2936461 + vkontakte_secret: xx2ZqujGSztHH09NYKbU \ No newline at end of file diff --git a/db/migrate/20090520165238_create_photos.rb b/db/migrate/20090520165238_create_photos.rb index 743a57c..a586066 100644 --- a/db/migrate/20090520165238_create_photos.rb +++ b/db/migrate/20090520165238_create_photos.rb @@ -1,7 +1,7 @@ class CreatePhotos < ActiveRecord::Migration def self.up create_table :photos do |t| - t.string :title, :length => 250, :null => false + t.string :title, :length => 250 t.text :description t.references :album t.timestamps diff --git a/db/migrate/20090522131931_create_users.rb b/db/migrate/20090522131931_create_users.rb index d18f33b..492c606 100644 --- a/db/migrate/20090522131931_create_users.rb +++ b/db/migrate/20090522131931_create_users.rb @@ -1,26 +1,53 @@ class CreateUsers < ActiveRecord::Migration - def self.up - create_table :users do |t| - t.string :email, :null => false # optional, you can use login instead, or both - t.string :crypted_password, :null => false # optional, see below - t.string :password_salt, :null => false # optional, but highly recommended - t.string :persistence_token, :null => false # required - t.string :single_access_token, :null => false # optional, see Authlogic::Session::Params - t.string :perishable_token, :null => false # optional, see Authlogic::Session::Perishability + def change + create_table(:users) do |t| + ## Database authenticatable + t.string :email, :null => false, :default => "" + t.string :encrypted_password, :null => false, :default => "" + + ## Recoverable + t.string :reset_password_token + t.datetime :reset_password_sent_at + + ## Rememberable + t.datetime :remember_created_at + + ## Trackable + t.integer :sign_in_count, :default => 0 + t.datetime :current_sign_in_at + t.datetime :last_sign_in_at + t.string :current_sign_in_ip + t.string :last_sign_in_ip + + ## Encryptable + t.string :password_salt + + # Confirmable + t.string :confirmation_token + t.datetime :confirmed_at + t.datetime :confirmation_sent_at + t.string :unconfirmed_email # Only if using reconfirmable + + # Lockable + t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts + t.string :unlock_token # Only if unlock strategy is :email or :both + t.datetime :locked_at + + # Token authenticatable + t.string :authentication_token + + t.string :first_name + t.string :second_name + t.string :surname + t.string :userpic - # Magic columns, just like ActiveRecord's created_at and updated_at. These are automatically maintained by Authlogic if they are present. - t.integer :login_count, :null => false, :default => 0 # optional, see Authlogic::Session::MagicColumns - t.integer :failed_login_count, :null => false, :default => 0 # optional, see Authlogic::Session::MagicColumns - t.datetime :last_request_at # optional, see Authlogic::Session::MagicColumns - t.datetime :current_login_at # optional, see Authlogic::Session::MagicColumns - t.datetime :last_login_at # optional, see Authlogic::Session::MagicColumns - t.string :current_login_ip # optional, see Authlogic::Session::MagicColumns - t.string :last_login_ip # optional, see Authlogic::Session::MagicColumns t.timestamps end + + add_index User.table_name, :email, :unique => true + add_index User.table_name, :reset_password_token, :unique => true + add_index User.table_name, :confirmation_token, :unique => true + add_index User.table_name, :unlock_token, :unique => true + add_index User.table_name, :authentication_token, :unique => true end - - def self.down - drop_table :users - end -end +end \ No newline at end of file diff --git a/db/migrate/20090528152114_add_name_to_user.rb b/db/migrate/20090528152114_add_name_to_user.rb deleted file mode 100644 index fdd3b19..0000000 --- a/db/migrate/20090528152114_add_name_to_user.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddNameToUser < ActiveRecord::Migration - def self.up - add_column :users, :name, :string - end - - def self.down - remove_column :users, :name - end -end diff --git a/db/migrate/20090604202928_create_permissions.rb b/db/migrate/20090604202928_create_permissions.rb deleted file mode 100644 index 9cdbb7b..0000000 --- a/db/migrate/20090604202928_create_permissions.rb +++ /dev/null @@ -1,16 +0,0 @@ -class CreatePermissions < ActiveRecord::Migration - def self.up - create_table "permissions", :force => true do |t| - t.integer :permissible_id - t.string :permissible_type - t.string :action - t.boolean :granted - - t.timestamps - end - end - - def self.down - drop_table "permissions" - end -end \ No newline at end of file diff --git a/db/migrate/20090604202929_create_role_memberships.rb b/db/migrate/20090604202929_create_role_memberships.rb deleted file mode 100644 index dc3d053..0000000 --- a/db/migrate/20090604202929_create_role_memberships.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateRoleMemberships < ActiveRecord::Migration - def self.up - create_table :role_memberships do |t| - t.integer :roleable_id - t.string :roleable_type - t.integer :role_id - - t.timestamps - end - end - - def self.down - drop_table :role_memberships - end -end \ No newline at end of file diff --git a/db/migrate/20090604202930_create_roles.rb b/db/migrate/20090604202930_create_roles.rb index 8b34d74..701d6f8 100644 --- a/db/migrate/20090604202930_create_roles.rb +++ b/db/migrate/20090604202930_create_roles.rb @@ -1,13 +1,18 @@ class CreateRoles < ActiveRecord::Migration - def self.up + def change create_table :roles do |t| t.string :name t.timestamps end + + create_table :roles_users, :id => false, :force => true do |t| + t.references :role + t.references :user + end + + add_index :roles_users, :role_id, :name => 'index_roles_users_on_role_id' + add_index :roles_users, :user_id, :name => 'index_roles_users_on_user_id' end - def self.down - drop_table :roles - end end \ No newline at end of file diff --git a/db/migrate/20100412220801_add_file_to_photo.rb b/db/migrate/20100412220801_add_file_to_photo.rb index 131153e..380ec20 100644 --- a/db/migrate/20100412220801_add_file_to_photo.rb +++ b/db/migrate/20100412220801_add_file_to_photo.rb @@ -1,9 +1,9 @@ class AddFileToPhoto < ActiveRecord::Migration def self.up - add_column :photos, :file, :string + add_column :photos, :attachment, :string end def self.down - remove_column :photos, :file + remove_column :photos, :attachment end end diff --git a/db/schema.rb b/db/schema.rb index f95ca4f..b04cbb6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -46,15 +46,6 @@ ActiveRecord::Schema.define(:version => 20100412220801) do add_index "collections", ["id"], :name => "index_collections_on_id", :unique => true - create_table "permissions", :force => true do |t| - t.integer "permissible_id" - t.string "permissible_type" - t.string "action" - t.boolean "granted" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "photo_tags", :force => true do |t| t.integer "tag_id" t.integer "photo_id" @@ -66,7 +57,7 @@ ActiveRecord::Schema.define(:version => 20100412220801) do add_index "photo_tags", ["tag_id"], :name => "index_photo_tags_on_tag_id" create_table "photos", :force => true do |t| - t.string "title", :null => false + t.string "title" t.text "description" t.integer "album_id" t.datetime "created_at", :null => false @@ -74,26 +65,26 @@ ActiveRecord::Schema.define(:version => 20100412220801) do t.text "path" t.float "longitude" t.float "latitude" - t.string "file" + t.string "attachment" end add_index "photos", ["album_id"], :name => "index_photos_on_album_id" add_index "photos", ["id"], :name => "index_photos_on_id", :unique => true - create_table "role_memberships", :force => true do |t| - t.integer "roleable_id" - t.string "roleable_type" - t.integer "role_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "roles", :force => true do |t| t.string "name" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false end + create_table "roles_users", :id => false, :force => true do |t| + t.integer "role_id" + t.integer "user_id" + end + + add_index "roles_users", ["role_id"], :name => "index_roles_users_on_role_id" + add_index "roles_users", ["user_id"], :name => "index_roles_users_on_user_id" + create_table "tags", :force => true do |t| t.string "title", :null => false t.datetime "created_at", :null => false @@ -103,22 +94,37 @@ ActiveRecord::Schema.define(:version => 20100412220801) do add_index "tags", ["id"], :name => "index_tags_on_id", :unique => true create_table "users", :force => true do |t| - t.string "email", :null => false - t.string "crypted_password", :null => false - t.string "password_salt", :null => false - t.string "persistence_token", :null => false - t.string "single_access_token", :null => false - t.string "perishable_token", :null => false - t.integer "login_count", :default => 0, :null => false - t.integer "failed_login_count", :default => 0, :null => false - t.datetime "last_request_at" - t.datetime "current_login_at" - t.datetime "last_login_at" - t.string "current_login_ip" - t.string "last_login_ip" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "name" + t.string "email", :default => "", :null => false + t.string "encrypted_password", :default => "", :null => false + t.string "reset_password_token" + t.datetime "reset_password_sent_at" + t.datetime "remember_created_at" + t.integer "sign_in_count", :default => 0 + t.datetime "current_sign_in_at" + t.datetime "last_sign_in_at" + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" + t.string "password_salt" + t.string "confirmation_token" + t.datetime "confirmed_at" + t.datetime "confirmation_sent_at" + t.string "unconfirmed_email" + t.integer "failed_attempts", :default => 0 + t.string "unlock_token" + t.datetime "locked_at" + t.string "authentication_token" + t.string "first_name" + t.string "second_name" + t.string "surname" + t.string "userpic" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end + add_index "users", ["authentication_token"], :name => "index_users_on_authentication_token", :unique => true + add_index "users", ["confirmation_token"], :name => "index_users_on_confirmation_token", :unique => true + add_index "users", ["email"], :name => "index_users_on_email", :unique => true + add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true + add_index "users", ["unlock_token"], :name => "index_users_on_unlock_token", :unique => true + end diff --git a/db/seeds.rb b/db/seeds.rb index 664d8c7..c965c85 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,7 +1,22 @@ -# This file should contain all the record creation needed to seed the database with its default values. -# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). -# -# Examples: -# -# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) -# Mayor.create(:name => 'Daley', :city => cities.first) +#coding: utf-8 +require_relative "../test/blueprints" +require 'fileutils' + +@user_role = Role.make! name: 'user' + +FileUtils.rm_rf "#{Rails.root}/public/uploads" +FileUtils.mkdir_p "#{Rails.root}/tmp/attachments" + +user = User.make! email: 'test@example.com', password: 'password', password_confirmation: 'password', + first_name: 'Username', second_name: 'Secondname', surname: 'Surname', confirmed_at: Time.now, + confirmation_sent_at: (Time.now+3) + +user.roles << Role.make!(name: 'admin') + +20.times.map { User.make! } +20.times.map { Collection.make! } +20.times.map { Album.make! } +20.times.map { Photo.make! } +10.times.map { CollectionAlbum.make! } + +FileUtils.rm_rf "#{Rails.root}/tmp/attachments" diff --git a/lib/acts_as_permissible.rb b/lib/acts_as_permissible.rb deleted file mode 100644 index 994b310..0000000 --- a/lib/acts_as_permissible.rb +++ /dev/null @@ -1,106 +0,0 @@ -# ActsAsPermissible -module NoamBenAri - module Acts #:nodoc: - module Permissible #:nodoc: - - def self.included(base) - base.extend ClassMethods - end - - module ClassMethods - def acts_as_permissible - has_many :permissions, :as => :permissible, :dependent => :destroy - - has_many :role_memberships, :as => :roleable, :dependent => :destroy - has_many :roles, :through => :role_memberships, :source => :role - - include NoamBenAri::Acts::Permissible::InstanceMethods - extend NoamBenAri::Acts::Permissible::SingletonMethods - - alias_method :full_permissions_hash, :permissions_hash - end - end - - # This module contains class methods - module SingletonMethods - - # Helper method to lookup for permissions for a given object. - # This method is equivalent to obj.permissions. - def find_permissions_for(obj) - permissible = ActiveRecord::Base.send(:class_name_of_active_record_descendant, self).to_s - - Permission.find(:all, - :conditions => ["permissible_id = ? and permissible_type = ?", obj.id, permissible] - ) - end - end - - # This module contains instance methods - module InstanceMethods - - # returns permissions in hash form - # from all levels recursively - def permissions_hash - @permissions_hash ||= lambda do - @permissions_hash = permissions.inject({}) { |hsh,perm| hsh.merge(perm.to_hash) }.symbolize_keys! - roles.each do |role| - merge_permissions!(role.permissions_hash) - end - @permissions_hash - end.call() - end - - # accepts a permission identifier string or an array of permission identifier strings - # and return true if the user has all of the permissions given by the parameters - # false if not. - def has_permission?(*perms) - perms.all? {|perm| permissions_hash.include?(perm.to_sym) && (permissions_hash[perm.to_sym] == true) } - end - - # accepts a permission identifier string or an array of permission identifier strings - # and return true if the user has any of the permissions given by the parameters - # false if none. - def has_any_permission?(*perms) - perms.any? {|perm| permissions_hash.include?(perm.to_sym) && (permissions_hash[perm.to_sym] == true) } - end - - # Merges another permissible object's permissions into this permissible's permissions hash - # In the case of identical keys, a false value wins over a true value. - def merge_permissions!(other_permissions_hash) - permissions_hash.merge!(other_permissions_hash) {|key,oldval,newval| oldval.nil? ? newval : oldval && newval} - end - - # Resets permissions and then loads them. - def reload_permissions! - reset_permissions! - permissions_hash - end - - def roles_list - list = [] - roles.inject(list) do |list,role| - list << role.name - role.roles_list.inject(list) {|list,role| list << role} - end - list.uniq - end - - def in_role?(*role_names) - role_names.all? {|role| roles_list.include?(role) } - end - - def in_any_role?(*role_names) - role_names.any? {|role| roles_list.include?(role) } - end - - - private - # Nilifies permissions_hash instance variable. - def reset_permissions! - @permissions_hash = nil - end - - end - end - end -end diff --git a/lib/ext/group_for.rb b/lib/ext/group_for.rb new file mode 100644 index 0000000..88c42a0 --- /dev/null +++ b/lib/ext/group_for.rb @@ -0,0 +1,13 @@ +module Ext + module GroupFor + def self.extended(base) + if (ActiveRecord::Base.connection.adapter_name == 'PostgreSQL') + if base.table_exists? + base.scope :group_for, {:group => base.column_names.map { |col_name| "#{base.table_name}.#{col_name}" }} + end + else + base.scope :group_for, {:group => "#{base.quoted_table_name}.id"} + end + end + end +end \ No newline at end of file diff --git a/lib/scan.rb b/lib/scan.rb index 6b0bd08..7fb3b23 100644 --- a/lib/scan.rb +++ b/lib/scan.rb @@ -46,7 +46,7 @@ module ScanFiles end def self.RecreateThumbnails - Photo.find(:all).each {|photo| + Photo.all.each {|photo| photo.file.recreate_versions! } end diff --git a/vendor/plugins/acts_as_permissible/lib/.gitignore b/lib/tasks/.gitkeep similarity index 100% rename from vendor/plugins/acts_as_permissible/lib/.gitignore rename to lib/tasks/.gitkeep diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake new file mode 100644 index 0000000..0848f55 --- /dev/null +++ b/lib/tasks/db.rake @@ -0,0 +1,11 @@ +namespace :db do + desc 'Remove and install new database from scratch' + task :install => :environment do + ActiveRecord::Base.connection.tables.each do |x| + ActiveRecord::Base.connection.drop_table x + end + + Rake::Task['db:migrate'].invoke + Rake::Task['db:seed'].invoke + end +end \ No newline at end of file diff --git a/test/blueprints.rb b/test/blueprints.rb new file mode 100644 index 0000000..6a53ffc --- /dev/null +++ b/test/blueprints.rb @@ -0,0 +1,71 @@ +#coding: utf-8 +require 'machinist/active_record' +require 'open-uri' + +def random_str + (0...8).map { 65.+(rand(25)).chr }.join +end + +Role.blueprint { + name { 'user' } +} + +User.blueprint { + rand(2) == 0 ? sex = :female : sex = :male + email { "#{random_str}@example.com" } + password { 'password' } + password_confirmation { 'password' } + first_name { Faker::NameRU.first_name(sex) } + second_name { Faker::NameRU.patronymic(sex) } + surname { Faker::NameRU.last_name(sex) } + confirmed_at { Time.now + rand(1..4) } + confirmation_sent_at { Time.now + rand(5..9) } + # TODO migrate from paperclip to carrier_wave + userpic { + file_name = ::SecureRandom.hex(8) + file = open("http://lorempixel.com/800/500/abstract/") + if file.kind_of? Tempfile + name = File.basename(file.path) + FileUtils.move(file.path, "#{Rails.root}/tmp/attachments/#{name}.jpeg") + file = File.open("#{Rails.root}/tmp/attachments/#{name}.jpeg") + end + + file.original_filename = "#{file_name}.jpeg" if file.kind_of? StringIO + file + } +} + +Album.blueprint { + title { Faker::Lorem.sentence(rand(3)) } + description { Faker::Lorem.sentence } + path { "my_album_#{sn}" } +} + +Collection.blueprint { + title { Faker::Lorem.sentence(rand(3)) } + description { Faker::Lorem.sentence } +} + +CollectionAlbum.blueprint { + album { Album.find(rand(1..20)) } + collection { Collection.find(rand(1..20)) } +} + +Photo.blueprint { + title { Faker::Lorem.sentence(rand(3)) } + description { Faker::Lorem.sentence } + album { Album.find(rand(1..20)) } + attachment { + file_name = ::SecureRandom.hex(8) + file = open("http://lorempixel.com/800/500/abstract/") + if file.kind_of? Tempfile + name = File.basename(file.path) + FileUtils.move(file.path, "#{Rails.root}/tmp/attachments/#{name}.jpeg") + file = File.open("#{Rails.root}/tmp/attachments/#{name}.jpeg") + end + + file.original_filename = "#{file_name}.jpeg" if file.kind_of? StringIO + file + } +} + diff --git a/vendor/assets/javascripts/plupload/changelog.txt b/vendor/assets/javascripts/plupload/changelog.txt deleted file mode 100644 index a47fc5a..0000000 --- a/vendor/assets/javascripts/plupload/changelog.txt +++ /dev/null @@ -1,218 +0,0 @@ -Version 1.5.4 (2012-04-12) - Flash: Disable scripting if swf was loaded from another domain. -Version 1.5.3 (2012-04-05) - HTML5: Check if xhr object is initialized, before calling abort() on it. - HTML4: Postpone form removal until uploaders state changes, to avoid error on resuming stopped uploads. - BrowserPlus: Fix mechanical typo, that caused error during mime type check. - BrowserPlus: browserPlus.Uploader.Cancel() has two required parameters, dies with the error if not passed. - Flash: Improve runtime's behaviour during upload cancellation. - Flash: Survive the case when GPSVersionID contains unexpected value. - Flash: Fix random freeze in Chrome's bundled Flash Player. - Flash: Avoid the silent break when URLStream not yet open, but close is called on it. - Flash: Move Destroy handler out of Flash:Init handler, since it might be called not only after Flash:Init but also before it. - Flash: Avoid warning during build with mxmlc. - Try removeEventListener first in IE and only if it fails - detachEvent. - Fix plupload.getPos to return proper value in IE8+. - Do not initiate plupload.STARTED state, if file queue is empty. - Additional language packs: Estonian, Polish, Korean, French-Canadian, Greek, Persian/Farsi. -Version 1.5.2 (2012-01-06) - UI Widget: Do not show UI if no runtime can be initialized. - UI Widget: Timely update file size and total size if resize in action. - UI Widget: Constrain renaming feature to queued files only. - UI Widget: Disable Add button properly, if requested, rather then just hide. - HTML4/HTML5/BrowserPlus: Avoid adding mime type twice to dialog trigger. - HTML5: fix regression, when unresized images were failing on FF3.6. - HTML5: Constrain Gecko 2,5,6 workaround to multipart mode only. - HTML5/Flash: Take into account weird possibilities of ExifVersion being a string, rather then standard Undefined. - Flash: Simplify event dispatching in BitmapDataUnlimited class, in order to avoid freezing on resizing in FP11. - Add ability to disable file dialog trigger on request (uploader.disableBrowse(true/false)). - Support for immediate abort of upload process, be it chunked upload or regular one. - Abort all activity, before destroying uploader. - Revive temporary file removal logic in upload.php. - Fix potential vulnerability in dump.php and upload.php. - Additional MIME types: application/vnd.openxmlformats-officedocument.*, application/x-javascript, application/json, text/css,css, application/vnd.oasis.opendocument.formula-templat. - Additional language packs: Hungarian, Croatian, Serbian, Romanian. -Version 1.5.1.1 (2011-09-27) - HTML5: Fix mechanical typo, that successfully broke drag and drop, wherever could. -Version 1.5.1 (2011-09-26) - HTML4: Add support for server responses in HTML format. - HTML5: Disable multiple file selection in Safari 5.x for Windows (see #363). - HTML5: Gecko 2/5/6 should upload chunks as binary strings when in chunking mode and client side resize is requested. - Flash: Enforce URLStream mode when custom headers are passed. - Flash: Fix embedding problems in IE9 (and all other IEs). - Flash/Gears/BrowserPlus/SilverLight: Expose multi_selection feature, to be used in required_features (mainly to overcome Safari for Windows problem). - SilverLight: Properly handle custom and null headers. - UploadComplete moved to fire after the last StateChanged event. - Additional language packs: Finnish. -Version 1.5b (2011-09-11) - UI Widget: Fix sortable logic. - UI Widget: Fix bug, when message was displayed simultaneously across all Plupload UI instances on the page. - UI Widget: notify() method is now public - users can throw their own messages into the widget header. - HTML4/HTML5: Revise input[type=file] placement logic to support cursor styling on Geko 2+. - HTML5: Revise Drag'n'Drop detection logic. - HTML5: Make Exif and GPS information available to user, introduce two new events: ExifData and GpsData. - HTML5: Add support for File.prototype.slice() method (mozSlice/webkitSlice) in order to be able to upload files in chunks without preloading. - HTML5: Remove any JPEG headers before restoring them, 'cause user agent (like Chrome), might be inserting it's own. - Flash: Remove a limit on the depth of image header check, since it still fails in some cases and performance gain is negligible. - Flash: Fix regression, when runtime hanged when not images where passed in as images. - SilverLight: Fix bug, when JSON serializer was failing on null. - SilverLight: Remove cast to integer for chunk boundary, which resulted in a wrong size for last chunks on huge files. - SilverLight: Increase read buffer, add disposal of ImageStream and FileStream, optimize for performance. - Updated build.xml to include language packs in release package under js/ folder. - Gears/BrowserPlus: Add support for * file filter. - BeforeUpload now can cancel upload if required. - Additional MIME types: text/csv, image/photoshop, video/x-ms-wmv, video/avi, video/webm support - Additional language packs: Japanese - Cleaned examples. -Version 1.4.3.2 (2011-04-13) - Fixed bug in HTML5 runtime, when was reduced by a factor of 100 after every upload. -Version 1.4.3.1 (2011-04-12) - Fixed build script, mistakenly populating jquery.plupload.queue directory from jquery.ui.plupload sources. - Fixed script urls in all examples, build script now will alter them automatically from dev to release when needed. - Fixed isEmptyObj undefined error in HTML4 runtime. - Fixed bug in UI Widget preventing UploadComplete from triggering. -Version 1.4.3 (2011-04-11) - Added Latvian language pack and updated French. - Fixed bug in Flash runtime when JPEG header was not investigated deep enough to reach SOFn marker in large images. - Fixed bug, when PNGs were cropped to width in Flash runtimes, rather then resized. - Fixed Flash to allow multiple uploading of the same file, with different settings. - Fixed Flash runtime to clean anonymous listeners properly. - Fixed HTML5 runtime to resolve to mimeType in case-insensitive way. - Fixed HTML5/Flash/SilverLight/Gears runtimes for inconsistency in naming of chunks feature, comparing to other runtimes. - Fixed HTML4/HTML5 runtimes for input[type=file] to outsize contaner effectively enough to fill the whole click area. - Fixed all runtimes to preserve position (relative/absolute) rule on containers that already have it. - Fixed SilverLight runtime to support large files (over 2GB). - Restructured the examples, src and build scripts to make it more clear that jQuery is optional. - Added support for *.* filter. - Added support for preserving ICC and IPTC headers when resizing JPEGs. - Added Image.onerror/onabort handlers to HTML5 in order to gracefully bypass faulty images. - Added ability to drop image size (by lowering quality), while preserving original dimension (HTML5/Flash/Gears). - Ported EXIF, ICC, IPTC preservation code to Flash runtime. -Version 1.4.2 (2011-02-20) - Added Brazilian Portuguese, German, Russian and Spanish translations. - Added support for file_data_name option to SilverLight runtime. - Added support for better quality image resizing to Flash runtime. - Added support for properly handling images with dimensions up to 8191x8191 pixels to Flash runtime. - Added 'updatelist' event to UI Widget, which will be triggered every time file list will get redrawn. - Added support for dynamically changing options to UI Widget. - Fixed HTML4 runtime bug, when UploadFile handler was attached twice. - Fixed HTML5 to use FileReader.readAsBinaryString() instead of File.getAsBinary() on newer WebKit browsers (like Chrome 9). - Fixed Flash runtime from sending duplicate Filename param, when using FileReference.upload(). - Updated S3 example to illustrate support for a proper progress indication. -Version 1.4.1 (2011-02-01) - Added an example on how to use Plupload with Amazon S3 written in PHP but can easily be ported to other languages. - Fixed bug where hidden input elements wasn't created when the multiple_queues option wasn't used. - Fixed bug where FF4 would produce an exception about missing BlobBuilder. -Version 1.4.0 (2011-01-26) - Added removeEvent and removeAllEvents methods and modified addEvent accordingly, in order to support dynamic unload. - Added unbindAll method. - Added UploadComplete event, which fires when internal iterator reaches the end of the queue. - Added public destroy method to plupload object, new event - Destroy, and corresponding handlers to all runtimes. - Added Czech, Italian, French, Dutch translations. - Added support for translatable error messages. - Added two new options: browse_button_hover and browse_button_active, in order to support browse_button interactivity. - Added support for 'multi_selection: false' to Silverlight runtime. - Added support for video/mp4, video/x-m4v and audio/mp4 MIME Types. - Added artificial sendAsBinary method to XMLHttpRequest.prototype for browsers that have support for BlobBuilder and typed arrays. - Added version tracking variable into plupload object and version comment to the header of every file. - Fixed measurements of browse_button element in order to size and position input[type=file] element to fit it fully. - Fixed Flash runtime behavior for multiple_select=false and other simpleUpload usage cases: basically new FileReference has to be created for every select dialog. - Fixed browser sniffer to match only Safari, for fakeSafariDragDrop (seems like Safari on Mac doesn't require it either). - Fixed so that ExternalInterface escapes strings properly, before passing them to JS. - Fixed eventual reinitialization of flash/silverlight runtimes, especially for cases when object wrapper needed to be programmatically hidden and then shown again. - Fixed so that Plupload will now ignore files with duplicate names when adding to the queue, in one set. Mainly introduced to work around Safari on Windows bug (https://bugs.webkit.org/show_bug.cgi?id=37957). - Fixed bug, when final UploadProgress was firing after FileUploaded for Flash simpleUpload. - Fixed bug where upload would fail if an error was produced inside the FilesAdded event. - Fixed bug in Flash runtime when it used a wrong size when resizing, but not chunking. - Fixed bug in Silverlight runtime that would keep sending 0 byte packages when a picture was chunked before resized. - Disabled blur filter (is going to be replaced with some bilinear resampling in next release). - Completely revised UI Widget, to be more jQuery UI oriented. Optionally depends on UI Button, UI Sortable, UI ProgressBar. -Version 1.3.0 (2010-11-24) - Added new jQuery UI widget that supports jQuery UI themes. - Added new multiple_queues option that enables you to upload multiple times in the queue widgets. - Added support for crossdomain loading of the XAP and SWF files and crossdomain upload. - Added new multiple_queues option that enables you to upload multiple times in the queue widgets. - Added support for crossdomain loading of the XAP and SWF files and crossdomain upload. - Added preinit/init options to to ease up the binding of custom events to queueWidget and the Uploader class. - Added drag/drop support for Safari until they fix the broken drag/drop support on Windows. - Added events example file that show how to bind all events and display event specific data. - Added support for retaining Exif data on images when they where resized using the HTML5 runtime. - Fixed logic issue with the upload.php example file. Chunking wasn't working correctly. - Fixed issue with HTML4 not handling the form encoding correctly on older IE versions. Patch contributed by jinxdone. - Fixed so the HTML4 runtime only submits the defined multipart_params arguments. - Fixes issue where it wasn't possible to dynamically override url or mutlipart_params for the HTML4 runtime. - Fixed so all runtimes pass the name, chunk and chunks parameters as multipart parameters instead of querystring parameters. - Fixed so files are read using the newer FileReader class if it's available if not it tries the older getAsXXX on Gecko. - Fixed bug where IE 9 beta 1 wouldn't render Silverlight properly. - Fixed bug where Flash would do extra empty requests if images below a specific size would be uploaded. - Fixed bug where Google Gears would resize and re-encode images even if the it wasn't changed in scale. - Fixed bug where the HTML5 runtime wouldn't free memory after each request on Gecko. -Version 1.2.4 (2010-09-08) - Added new BeforeUpload event to make it easier to override settings before a file is uploaded. - Added new automatic usage of FileReference in Flash if it's possible. Contributed by Marcel Jackwerth. - Added new chunking support for Chrome 5 and Firefox 3.6 using the HTML 5 runtime. - Added new multipart upload support for WebKit using the HTML 5 runtime and the FormData object. - Added new image scaling method for the Flash runtime contributed by rcoopman. - Added new alert error message if the user selected invalid files. - Added new automatic unique name generation to the example.php script. Contributed by Brandon Kelly. - Changed so the default upload method is multipart and the default chunk size is 0. - Fixed progress issue with the HTML5 runtime running on Gecko. - Fixed so longer extensions can be used such as .tar.gz. - Fixed so the file extension is retained when using the unique_names option. -Version 1.2.3 (2010-05-27) - Added new drag/drop support for HTML5 running on Chrome beta. - Added new multipart state for the features object. It's now possible to detect multipart support. - Added new getFeatures function to all runtime. Basic concept by Javier Martinez Fernandez. - Fixed bug where runtimes where initialized even if they didn't match the required_features setting. -Version 1.2.2.1 (2010-05-04) - Added new headers option, enables you to set custom headers for the upload requests. - Fixed bug where the file extension checking was case sensitive. -Version 1.2.2 (2010-04-26) - Added new file_data_name option that enables you to set the multipart file data param. Patch contributed by Alex Ganov. - Added new FILE_SIZE_ERROR type that will be triggered if the user selected a file that is to large or zero bytes. - Added new FILE_EXTENSION_ERROR type that will be triggered if you add a file with an invalid file extension. - Added new required_features setting, enables you to specify a list of required features that the runtime must have. - Fixed so the plupload.buildUrl function uses the UTF compatible encodeURIComponent method instead of escape. - Fixed so that all file types can be selected if you don't specify a filter setting. - Fixed so more valid HTTP status codes are accepted as valid responses. - Fixed so all runtimes fills the features object with available features. - Fixed some issues with the HTML4 runtime if there wasn't any existing forms on the page. - Fixed some conflict issues with HTML4 runtime and forms with the input names of action or target. - Fixed bug where some Gecko versions would produce exceptions when checking the HTTP status of a XHR. -Version 1.2.1 (2010-03-22) - Fixed bug with incorrect aspect ratio in Flash image scaling. - Fixed bug where chunked uploads could get scrambled in the Flash runtime. Patch contributed by Grady Werner. - Fixed bug where a beta version of Chrome wouldn't handle drag/drop correctly because of missing drag effect. - Fixed so the HTML 4 runtime displays N/A for file sizes and the progress is based on uploaded files instead of bytes. - Fixed so chunking can be disabled properly in Flash but that will affect the progress bar. - Fixed so queue widget displays the drag/drop message if file queue is emptied. - Fixed small files are uploaded as one single chunk and not forced into 4 chunks in the Flash runtime. -Version 1.2 (2010-03-09) - Added new rename file support for jQuery queue widget, click on a file name to rename it if it's enabled. - Added official ChunkUploaded event, it similar to FileUploaded but executed for each chunk. - Added bytes per second support to total queue progress. - Added better error handling to core API using the new Error event. - Added better error handling to jQuery queue widget. - Fixed so chunking uploads is dispatch from JS not from inside Flash/Silverlight. -Version 1.1.1 (2010-02-25) - Added new setup setting to queue widget. Makes it easier to bind custom events to uploader instance. - Fixed so it's possible to disable chunking compleatly. It's now disabled by default. - Fixed bug where multipart mode was enabled all the time in the Flash runtime. - Fixed bug where chunked uploading in Silverlight would fail. - Fixed bug where the delete button was visible while uploading. - Fixed bug where unique_names setting wasn't working when the core API was used. - Fixed bug where the queue widget wouldn't display the currently uploaded file if the unique_names was enabled. -Version 1.1 (2010-02-24) - Added new multipart and multipart_params support. - Added new container option, enables you to specify where flash/silverlight objects would be added. - Added chunking support to BrowserPlus runtime, contributed by Steve Spencer. - Added FileUploaded event that fires when a file is uploaded. - Added more easily understandable buttons to queue widget. - Added html4 runtime, contributed by Ryan Demmer. - Fixed issues with i18n support and added a Swedish and Danish language pack. - Fixed bug where the Flash runtime could do empty requests if the image was scaled down. - Fixed bug where uploading small images in Silverlight would produce an exception. - Fixed so the runtime list can include whitespace or missing runtimes. Patch contributed by Řyvind Sean Kinsey. - Fixed so to large files are ignored and never dispatched to the FilesAdded event. -Version 1.0 (2010-02-03) - First official release of Plupload. diff --git a/vendor/assets/javascripts/plupload/js/i18n/cs.js b/vendor/assets/javascripts/plupload/js/i18n/cs.js deleted file mode 100644 index 1ee5d5f..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/cs.js +++ /dev/null @@ -1,14 +0,0 @@ -// .po file like language pack -plupload.addI18n({ - 'Select files' : 'Vyberte soubory', - 'Add files to the upload queue and click the start button.' : 'PĹ™idejte soubory do fronty a pak spusĹĄte nahrávánĂ.', - 'Filename' : 'Název souboru', - 'Status' : 'Status', - 'Size' : 'Velikost', - 'Add Files' : 'PĹ™idat soubory', - 'Stop current upload' : 'Zastavit nahrávánĂ', - 'Start uploading queue' : 'Spustit frontu nahrávánĂ', - 'Drag files here.' : 'Sem pĹ™etáhnÄ›te soubory.', - 'Start Upload': 'Spustit nahrávánĂ', - 'Uploaded %d/%d files': 'Nahráno %d/%d souborĹŻ' -}); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/i18n/da.js b/vendor/assets/javascripts/plupload/js/i18n/da.js deleted file mode 100644 index fc95896..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/da.js +++ /dev/null @@ -1,12 +0,0 @@ -// .po file like language pack -plupload.addI18n({ - 'Select files' : 'Vælg filer', - 'Add files to the upload queue and click the start button.' : 'Tilføj filer til køen, og tryk pĂĄ start.', - 'Filename' : 'Filnavn', - 'Status' : 'Status', - 'Size' : 'Størrelse', - 'Add files' : 'Tilføj filer', - 'Stop current upload' : 'Stop upload', - 'Start uploading queue' : 'Start upload', - 'Drag files here.' : 'Træk filer her.' -}); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/i18n/de.js b/vendor/assets/javascripts/plupload/js/i18n/de.js deleted file mode 100644 index 4c4de07..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/de.js +++ /dev/null @@ -1,24 +0,0 @@ -// German -plupload.addI18n({ - 'Select files' : 'Dateien hochladen', - 'Add files to the upload queue and click the start button.' : 'Dateien hinzufügen und auf \'Hochladen\' klicken.', - 'Filename' : 'Dateiname', - 'Status' : 'Status', - 'Size' : 'Größe', - 'Add files' : 'Dateien', // hinzufügen', - 'Stop current upload' : 'Aktuelles Hochladen stoppen', - 'Start uploading queue' : 'Hochladen starten', - 'Uploaded %d/%d files': '%d/%d Dateien sind hochgeladen', - 'N/A' : 'Nicht verfügbar', - 'Drag files here.' : 'Ziehen Sie die Dateien hier hin', - 'File extension error.': 'Fehler bei Dateiendung', - 'File size error.': 'Fehler bei DateigröĂźe', - 'Init error.': 'Initialisierungsfehler', - 'HTTP Error.': 'HTTP-Fehler', - 'Security error.': 'Sicherheitsfehler', - 'Generic error.': 'Typischer Fehler', - 'IO error.': 'Ein/Ausgabe-Fehler', - 'Stop Upload': 'Hochladen stoppen', - 'Start upload': 'Hochladen', - '%d files queued': '%d Dateien in der Warteschlange' -}); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/i18n/el.js b/vendor/assets/javascripts/plupload/js/i18n/el.js deleted file mode 100644 index aafbaf1..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/el.js +++ /dev/null @@ -1,14 +0,0 @@ -// Greek -plupload.addI18n({ - 'Select files' : 'ΕπιλÎξτε ΑĎχεία', - 'Add files to the upload queue and click the start button.' : 'Î ĎÎżĎθήκη αĎχείων Ďτην ουĎά μεταφόĎτωĎης', - 'Filename' : 'Όνομα αĎχείου', - 'Status' : 'ΚατάĎταĎη', - 'Size' : 'ÎśÎγεθος', - 'Add Files' : 'Î ĎÎżĎθÎĎτε αĎχεία', - 'Stop current upload' : 'Διακοπή Ď„ĎÎχουĎας μεταφόĎτωĎης', - 'Start uploading queue' : 'ΕκκίνηĎη μεταφόĎτωĎης ουĎάς αĎχείων', - 'Drag files here.' : 'ÎŁĎŤĎετε αĎχεία εδώ', - 'Start Upload': 'ΕκκίνηĎη μεταφόĎτωĎης', - 'Uploaded %d/%d files': 'ΑνÎβηκαν %d/%d αĎχεία' -}); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/i18n/es.js b/vendor/assets/javascripts/plupload/js/i18n/es.js deleted file mode 100644 index 2379421..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/es.js +++ /dev/null @@ -1,25 +0,0 @@ -// Spanish -plupload.addI18n({ - 'Select files' : 'Elija archivos:', - 'Add files to the upload queue and click the start button.' : 'Agregue archivos a la cola de subida y haga click en el boton de iniciar.', - 'Filename' : 'Nombre de archivo', - 'Status' : 'Estado', - 'Size' : 'Tamaño', - 'Add files' : 'Agregue archivos', - 'Stop current upload' : 'Detener subida actual', - 'Start uploading queue' : 'Iniciar subida de cola', - 'Uploaded %d/%d files': 'Subidos %d/%d archivos', - 'N/A' : 'No disponible', - 'Drag files here.' : 'Arrastre archivos aquí', - 'File extension error.': 'Error de extensión de archivo.', - 'File size error.': 'Error de tamaño de archivo.', - 'Init error.': 'Error de inicialización.', - 'HTTP Error.': 'Error de HTTP.', - 'Security error.': 'Error de seguridad.', - 'Generic error.': 'Error genérico.', - 'IO error.': 'Error de entrada/salida.', - 'Stop Upload': 'Detener Subida.', - 'Add Files': 'Agregar Archivos', - 'Start Upload': 'Comenzar Subida.', - '%d files queued': '%d archivos en cola.' -}); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/i18n/et.js b/vendor/assets/javascripts/plupload/js/i18n/et.js deleted file mode 100644 index a4a5e3a..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/et.js +++ /dev/null @@ -1,33 +0,0 @@ -// Estonian translation, et.js -plupload.addI18n({ - 'Select files' : 'Vali faile', - 'Add files to the upload queue and click the start button.' : 'Lisa failid ĂĽleslaadimise järjekorda ja klõpsa alustamise nupule.', - 'Filename' : 'Failinimi', - 'Status' : 'Olek', - 'Size' : 'Suurus', - 'Add files' : 'Lisa faile', - 'Stop current upload' : 'Praeguse ĂĽleslaadimise peatamine', - 'Start uploading queue' : 'Järjekorras ootavate failide ĂĽleslaadimise alustamine', - 'Drag files here.' : 'Lohista failid siia.', - 'Start upload' : 'Alusta ĂĽleslaadimist', - 'Uploaded %d/%d files': 'Ăśles laaditud %d/%d', - 'Stop upload': 'Peata ĂĽleslaadimine', - 'Start upload': 'Alusta ĂĽleslaadimist', - '%d files queued': 'Järjekorras on %d faili', - 'File: %s': 'Fail: %s', - 'Close': 'Sulge', - 'Using runtime: ': 'Kasutatakse varianti: ', - 'File: %f, size: %s, max file size: %m': 'Fail: %f, suurus: %s, suurim failisuurus: %m', - 'Upload element accepts only %d file(s) at a time. Extra files were stripped.': 'Ăśleslaadimise element saab vastu võtta ainult %d faili ĂĽhe korraga. Ăślejäänud failid jäetakse laadimata.', - 'Upload URL might be wrong or doesn\'t exist': 'Ăśleslaadimise URL võib olla vale või seda pole', - 'Error: File too large: ': 'Viga: fail on liiga suur: ', - 'Error: Invalid file extension: ': 'Viga: sobimatu faililaiend: ', - 'File extension error.': 'Faililaiendi viga.', - 'File size error.': 'Failisuuruse viga.', - 'File count error.': 'Failide arvu viga.', - 'Init error.': 'Lähtestamise viga.', - 'HTTP Error.': 'HTTP ĂĽhenduse viga.', - 'Security error.': 'Turvaviga.', - 'Generic error.': 'Ăśldine viga.', - 'IO error.': 'S/V (I/O) viga.' -}); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/i18n/fa.js b/vendor/assets/javascripts/plupload/js/i18n/fa.js deleted file mode 100644 index af36e22..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/fa.js +++ /dev/null @@ -1,37 +0,0 @@ -// Persian -plupload.addI18n({ - 'Select files' : 'انتخاب Ůایل', - 'Add files to the upload queue and click the start button.' : 'اضاŮه کنید Ůایل ها را به ص٠آپلŮŘŻ ٠دکمه شرŮŘą را Ú©Ů„ŰŚÚ© کنید.', - 'Filename' : 'نام Ůایل', - 'Status' : 'Ůضعیت', - 'Size' : 'سایز', - 'Add Files' : 'اŮزŮدن Ůایل', - 'Stop Upload' : 'ŘŞŮق٠انتقال', - 'Start Upload' : 'شرŮŘą انتقال', - 'Add files' : 'اŮزŮدن Ůایل', - 'Add files.' : 'اŮزŮدن Ůایل', - 'Stop current upload' : 'ŘŞŮق٠انتقال جاری', - 'Start uploading queue' : 'شرŮŘą ص٠انتقال', - 'Stop upload' : 'ŘŞŮق٠انتقال', - 'Start upload' : 'شرŮŘą انتقال', - 'Uploaded %d/%d files': 'منتقل Ř´ŘŻ %d/%d از Ůایلها', - 'N/A' : 'N/A', - 'Drag files here.' : 'بکشید Ůایل ها ر٠به اینجا', - 'File extension error.': 'خطا پیشŮند Ůایل', - 'File size error.': 'خطای سایز Ůایل', - 'File count error.': 'خطای تعداد Ůایل', - 'Init error.': 'خطا در استارت اسکریپت', - 'HTTP Error.': 'HTTP خطای', - 'Security error.': 'خطای امنیتی', - 'Generic error.': 'خطای عمŮŮ…ŰŚ', - 'IO error.': 'IO خطای', - 'File: %s': ' Ůایل ها : %s', - 'Close': 'بستن', - '%d files queued': '%d Ůایل در صŮ', - 'Using runtime: ': 'استŮاده میکنید از : ', - 'File: %f, size: %s, max file size: %m': Ůایل: %f, سایز: %s, بزرگترین سایز Ůایل: %m', - 'Upload element accepts only %d file(s) at a time. Extra files were stripped.': 'عنصر بارگذار ŮŮ‚Ř· %d Ůایل ر٠در ŰŚÚ© زمان Ů…ŰŚ پذیرد. سایر Ůایل ها مجرد از این Ů…ŮضŮŘą هستند.', - 'Upload URL might be wrong or doesn\'t exist': 'آدرس آپلŮŘŻ اشتباه Ů…ŰŚ باشد یا ŮجŮŘŻ ندارد', - 'Error: File too large: ': 'خطا: Ůایل Řجیم است :: ', - 'Error: Invalid file extension: ': 'خطا پسŮند Ůایل معتبر نمی باشد : ' -}); diff --git a/vendor/assets/javascripts/plupload/js/i18n/fi.js b/vendor/assets/javascripts/plupload/js/i18n/fi.js deleted file mode 100644 index 12a639e..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/fi.js +++ /dev/null @@ -1,33 +0,0 @@ -// .fi file like language pack -plupload.addI18n({ - 'Select files' : 'Valitse tiedostoja', - 'Add files to the upload queue and click the start button.' : 'Lisää tiedostoja latausjonoon ja klikkaa aloita-nappia.', - 'Filename' : 'Tiedostonimi', - 'Status' : 'Tila', - 'Size' : 'Koko', - 'Add files' : 'Lisää tiedostoja', - 'Stop current upload' : 'Pysäytä nykyinen lataus', - 'Start uploading queue' : 'Aloita jonon lataus', - 'Drag files here.' : 'Raahaa tiedostot tänne.', - 'Start upload' : 'Aloita lataus', - 'Uploaded %d/%d files': 'Ladattu %d/%d tiedostoa', - 'Stop upload': 'Pysäytä lataus', - 'Start upload': 'Aloita lataus', - '%d files queued': '%d tiedostoa jonossa', - 'File: %s': 'Tiedosto: %s', - 'Close': 'Sulje', - 'Using runtime: ': 'Käytetään ajonaikaista: ', - 'File: %f, size: %s, max file size: %m': 'Tiedosto: %f, koko: %s, maksimi tiedostokoko: %m', - 'Upload element accepts only %d file(s) at a time. Extra files were stripped.': 'Latauselementti sallii ladata vain %d tiedosto(a) kerrallaan. Ylimääräiset tiedostot ohitettiin.', - 'Upload URL might be wrong or doesn\'t exist': 'Lataus URL saattaa olla väärin tai ei ole olemassa', - 'Error: File too large: ': 'Virhe: Tiedosto liian suuri: ', - 'Error: Invalid file extension: ': 'Virhe: Kelpaamaton tiedostopääte: ', - 'File extension error.': 'Tiedostopäätevirhe.', - 'File size error.': 'Tiedostokokovirhe.', - 'File count error.': 'Tiedostolaskentavirhe.', - 'Init error.': 'Init virhe.', - 'HTTP Error.': 'HTTP virhe.', - 'Security error.': 'Tietoturvavirhe.', - 'Generic error.': 'Yleinen virhe.', - 'IO error.': 'I/O virhe.' -}); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/i18n/fr-ca.js b/vendor/assets/javascripts/plupload/js/i18n/fr-ca.js deleted file mode 100644 index 61aba23..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/fr-ca.js +++ /dev/null @@ -1,35 +0,0 @@ -// French-Canadian -plupload.addI18n({ - 'Select files' : 'SĂ©lectionnez les fichiers', - 'Add files to the upload queue and click the start button.' : 'Ajoutez des fichiers Ă la file d\'attente et appuyez sur le bouton dĂ©marrer.', - 'Filename' : 'Nom du fichier', - 'Status' : 'Statut', - 'Size' : 'Taille', - 'Add files' : 'Ajouter Fichiers', - 'Stop current upload' : 'ArrĂŞter le tĂ©lĂ©versement actuel', - 'Start uploading queue' : 'DĂ©marrer le tĂ©lĂ©versement', - 'Uploaded %d/%d files': '%d/%d fichiers envoyĂ©s', - 'N/A' : 'Non applicable', - 'Drag files here.' : 'Glisser-dĂ©poser les fichiers ici', - 'File extension error.': 'Erreur d\'extension de fichier', - 'File size error.': 'Erreur de taille de fichier', - 'Init error.': 'Erreur d\'initialisation', - 'HTTP Error.': 'Erreur HTTP', - 'Security error.': 'Erreur de sĂ©curitĂ©', - 'Generic error.': 'Erreur commune', - 'IO error.': 'Erreur E/S', - 'Stop Upload': 'ArrĂŞter le tĂ©lĂ©versement', - 'Add Files': 'Ajouter des fichiers', - 'Start upload': 'DĂ©marrer le tĂ©lĂ©versement', - '%d files queued': '%d fichiers en attente', - 'File: %s':'Fichier: %s', - 'Close':'Fermer', - 'Using runtime:':'Moteur logiciel:', - 'File: %f, size: %s, max file size: %m':'Fichier: %f, poids: %s, poids maximal: %m', - 'Upload element accepts only %d file(s) at a time. Extra files were stripped.':'La file accepte %d fichier(s) Ă la fois. Les fichiers en trop sont ignorĂ©s', - 'Upload URL might be wrong or doesn\'t exist':'L\'URL de tĂ©lĂ©versement est erronĂ© ou inexistant', - 'Error: File to large: ':'Fichier trop volumineux: ', - 'Error: Invalid file extension: ':'Extension de fichier invalide: ', - 'File size error.':'Erreur de taile de fichier', - 'File count error.':'Erreur de dĂ©compte des fichiers' -}); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/i18n/fr.js b/vendor/assets/javascripts/plupload/js/i18n/fr.js deleted file mode 100644 index 53dbe28..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/fr.js +++ /dev/null @@ -1,25 +0,0 @@ -// French -plupload.addI18n({ - 'Select files' : 'SĂ©lectionnez les fichiers', - 'Add files to the upload queue and click the start button.' : 'Ajoutez des fichiers Ă la file et appuyez sur le bouton dĂ©marrer.', - 'Filename' : 'Nom de fichier', - 'Status' : 'Status', - 'Size' : 'Taille', - 'Add files' : 'Ajouter Fichiers', - 'Stop current upload' : 'ArrĂŞter l\'envoi en cours', - 'Start uploading queue' : 'DĂ©marrer l\'envoi', - 'Uploaded %d/%d files': '%d/%d fichiers envoyĂ©s', - 'N/A' : 'Non applicable', - 'Drag files here.' : 'DĂ©poser les fichiers ici.', - 'File extension error.': 'Erreur extension fichier', - 'File size error.': 'Erreur taille fichier.', - 'Init error.': 'Erreur d\'initialisation.', - 'HTTP Error.': 'Erreur HTTP.', - 'Security error.': 'Erreur de sĂ©curitĂ©.', - 'Generic error.': 'Erreur gĂ©nĂ©rique.', - 'IO error.': 'Erreur E/S.', - 'Stop Upload': 'ArrĂŞter les envois.', - 'Add Files': 'Ajouter des fichiers', - 'Start Upload': 'DĂ©marrer les envois.', - '%d files queued': '%d fichiers en attente.' -}); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/i18n/hr.js b/vendor/assets/javascripts/plupload/js/i18n/hr.js deleted file mode 100644 index 084be51..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/hr.js +++ /dev/null @@ -1,25 +0,0 @@ -// Croatian -plupload.addI18n({ - 'Select files': 'Izaberite datoteke:', - 'Add files to the upload queue and click the start button.': 'Dodajte datoteke u listu i kliknite Upload.', - 'Filename': 'Ime datoteke', - 'Status': 'Status', - 'Size': 'VeliÄŤina', - 'Add files': 'Dodajte datoteke', - 'Stop current upload': 'Zaustavi trenutan upload', - 'Start uploading queue': 'Pokreni Upload', - 'Uploaded %d/%d files': 'Uploadano %d/%d datoteka', - 'N/A': 'N/A', - 'Drag files here.': 'Dovucite datoteke ovdje', - 'File extension error.': 'Greška ekstenzije datoteke.', - 'File size error.': 'Greška veliÄŤine datoteke.', - 'Init error.': 'Greška inicijalizacije.', - 'HTTP Error.': 'HTTP greška.', - 'Security error.': 'Sigurnosna greška.', - 'Generic error.': 'GeneriÄŤka greška.', - 'IO error.': 'I/O greška.', - 'Stop Upload': 'Zaustavi upload.', - 'Add Files': 'Dodaj datoteke', - 'Start Upload': 'Pokreni upload.', - '%d files queued': '%d datoteka na ÄŤekanju.' -}); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/i18n/hu.js b/vendor/assets/javascripts/plupload/js/i18n/hu.js deleted file mode 100644 index 87070ba..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/hu.js +++ /dev/null @@ -1,33 +0,0 @@ -// Hungarian -plupload.addI18n({ - 'Select files' : 'Fájlok kiválasztása', - 'Add files to the upload queue and click the start button.' : 'Válaszd ki a fájlokat, majd kattints az IndĂtás gombra.', - 'Filename' : 'FájlnĂ©v', - 'Status' : 'Ăllapot', - 'Size' : 'MĂ©ret', - 'Add files' : 'Hozzáadás', - 'Stop current upload' : 'Jelenlegi feltöltĂ©s megszakĂtása', - 'Start uploading queue' : 'Várakozási sor feltöltĂ©sĂ©nek indĂtása', - 'Uploaded %d/%d files': 'Feltöltött fájlok: %d/%d', - 'N/A': 'Nem elĂ©rhetĹ‘', - 'Drag files here.' : 'HĂşzd ide a fájlokat.', - 'Stop upload': 'FeltöltĂ©s megszakĂtása', - 'Start upload': 'IndĂtás', - '%d files queued': '%d fájl sorbaállĂtva', - 'File: %s': 'Fájl: %s', - 'Close': 'Bezárás', - 'Using runtime: ': 'Használt runtime: ', - 'File: %f, size: %s, max file size: %m': 'Fájl: %f, mĂ©ret: %s, maximális fájlmĂ©ret: %m', - 'Upload element accepts only %d file(s) at a time. Extra files were stripped.': 'A feltöltĂ©s egyszerre csak %d fájlt fogad el, a többi fájl nem lesz feltöltve.', - 'Upload URL might be wrong or doesn\'t exist': 'A megadott URL hibás vagy nem lĂ©tezik', - 'Error: File too large: ': 'Hiba: A fájl tĂşl nagy: ', - 'Error: Invalid file extension: ': 'Hiba: ÉrvĂ©nytelen fájlkiterjesztĂ©s: ', - 'File extension error.': 'Hibás fájlkiterjesztĂ©s.', - 'File size error.': 'Hibás fájlmĂ©ret.', - 'File count error.': 'A fájlok számával kapcsolatos hiba.', - 'Init error.': 'Init hiba.', - 'HTTP Error.': 'HTTP hiba.', - 'Security error.': 'Biztonsági hiba.', - 'Generic error.': 'Ăltalános hiba.', - 'IO error.': 'I/O hiba.' -}); diff --git a/vendor/assets/javascripts/plupload/js/i18n/it.js b/vendor/assets/javascripts/plupload/js/i18n/it.js deleted file mode 100644 index 891e4fb..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/it.js +++ /dev/null @@ -1,24 +0,0 @@ -// Italian -plupload.addI18n({ - 'Select files' : 'Seleziona i files', - 'Add files to the upload queue and click the start button.' : 'Aggiungi i file alla coda di caricamento e clicca il pulsante di avvio.', - 'Filename' : 'Nome file', - 'Status' : 'Stato', - 'Size' : 'Dimensione', - 'Add Files' : 'Aggiungi file', - 'Stop current upload' : 'Interrompi il caricamento', - 'Start uploading queue' : 'Avvia il caricamento', - 'Uploaded %d/%d files': 'Caricati %d/%d file', - 'N/A' : 'N/D', - 'Drag files here.' : 'Trascina i file qui.', - 'File extension error.': 'Errore estensione file.', - 'File size error.': 'Errore dimensione file.', - 'Init error.': 'Errore inizializzazione.', - 'HTTP Error.': 'Errore HTTP.', - 'Security error.': 'Errore sicurezza.', - 'Generic error.': 'Errore generico.', - 'IO error.': 'Errore IO.', - 'Stop Upload': 'Ferma Upload', - 'Start Upload': 'Inizia Upload', - '%d files queued': '%d file in lista' -}); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/i18n/ja.js b/vendor/assets/javascripts/plupload/js/i18n/ja.js deleted file mode 100644 index 02c85ae..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/ja.js +++ /dev/null @@ -1,37 +0,0 @@ -// Japanese -plupload.addI18n({ - 'Select files' : 'ă•ă‚ˇă‚¤ă«é¸ćŠž', - 'Add files to the upload queue and click the start button.' : 'ă•ă‚ˇă‚¤ă«ă‚’アăă—ăăĽă‰ă‚ăĄăĽă«čż˝ĺŠ ă—ă¦ă‚ąă‚żăĽăăśă‚żăłă‚’ă‚ŻăŞăă‚Żă—ă¦ăŹă ă•ă„', - 'Filename' : 'ă•ă‚ˇă‚¤ă«ĺŤ', - 'Status' : 'ă‚ąă†ăĽă‚żă‚ą', - 'Size' : 'サイズ', - 'Add Files' : 'ă•ă‚ˇă‚¤ă«ă‚’čż˝ĺŠ ', - 'Stop Upload' : 'アăă—ăăĽă‰ĺść˘', - 'Start Upload' : 'アăă—ăăĽă‰', - 'Add files' : 'ă•ă‚ˇă‚¤ă«ă‚’čż˝ĺŠ ', - 'Add files.' : 'ă•ă‚ˇă‚¤ă«ă‚’čż˝ĺŠ ', - 'Stop current upload' : '現在ă®ă‚˘ăă—ăăĽă‰ă‚’ĺść˘', - 'Start uploading queue' : 'アăă—ăăĽă‰', - 'Stop upload' : 'アăă—ăăĽă‰ĺść˘', - 'Start upload' : 'アăă—ăăĽă‰', - 'Uploaded %d/%d files': 'アăă—ăăĽă‰ä¸ %d/%d ă•ă‚ˇă‚¤ă«', - 'N/A' : 'N/A', - 'Drag files here.' : 'ă“ă“ă«ă•ă‚ˇă‚¤ă«ă‚’ă‰ă©ăă‚°', - 'File extension error.': 'ă•ă‚ˇă‚¤ă«ć‹ˇĺĽµĺエă©ăĽ', - 'File size error.': 'ă•ă‚ˇă‚¤ă«ă‚µă‚¤ă‚şă‚¨ă©ăĽ', - 'File count error.': 'ă•ă‚ˇă‚¤ă«ć•°ă‚¨ă©ăĽ', - 'Init error.': 'イă‹ă‚·ăŁă©ă‚¤ă‚şă‚¨ă©ăĽ', - 'HTTP Error.': 'HTTP エă©ăĽ', - 'Security error.': 'ă‚»ă‚ăĄăŞă†ă‚Łă‚¨ă©ăĽ', - 'Generic error.': 'エă©ăĽ', - 'IO error.': 'IO エă©ăĽ', - 'File: %s': 'ă•ă‚ˇă‚¤ă«: %s', - 'Close': 'é–‰ăă‚‹', - '%d files queued': '%d ă•ă‚ˇă‚¤ă«ăŚčż˝ĺŠ ă•ă‚Śăľă—ăź', - 'Using runtime: ': 'ă˘ăĽă‰: ', - 'File: %f, size: %s, max file size: %m': 'ă•ă‚ˇă‚¤ă«: %f, サイズ: %s, 最大ă•ă‚ˇă‚¤ă«ă‚µă‚¤ă‚ş: %m', - 'Upload element accepts only %d file(s) at a time. Extra files were stripped.': 'アăă—ăăĽă‰ĺŹŻč˝ăŞă•ă‚ˇă‚¤ă«ć•°ăŻ %d ă§ă™ă€‚ä˝™ĺ†ăŞă•ă‚ˇă‚¤ă«ăŻĺ‰Šé™¤ă•ă‚Śăľă—ăź', - 'Upload URL might be wrong or doesn\'t exist': 'アăă—ăăĽă‰ĺ…ă® URL ăŚĺ在ă—ăľă›ă‚“', - 'Error: File too large: ': 'エă©ăĽ: サイズăŚĺ¤§ăŤă™ăŽăľă™: ', - 'Error: Invalid file extension: ': 'エă©ăĽ: 拡張ĺăŚč¨±ĺŹŻă•ă‚Śă¦ă„ăľă›ă‚“: ' -}); diff --git a/vendor/assets/javascripts/plupload/js/i18n/ko.js b/vendor/assets/javascripts/plupload/js/i18n/ko.js deleted file mode 100644 index a2c5e66..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/ko.js +++ /dev/null @@ -1,36 +0,0 @@ -// Republic of Korea -plupload.addI18n({ - 'Select files' : '파일 ě„ íť', - 'Add files to the upload queue and click the start button.' : '파일을 업로드 íě— ě¶”ę°€í•ě—¬ ě‹śěž‘ 버튼을 í´ë¦í•ě‹ě‹śě¤.', - 'Filename' : '파일 이름', - 'Status' : 'ěíś', - 'Size' : 'í¬ę¸°', - 'Add Files' : '파일 추가', - 'Stop Upload': '업로드 중지', - 'Start Upload': '업로드', - 'Add files': '파일 추가', - 'Stop current upload': 'í„재 업로드를 ě •ě§€', - 'Start uploading queue': '업로드', - 'Stop upload': '업로드 중지', - 'Start upload': '업로드', - 'Uploaded % d / % d files': '업로드 중 % d / % d 파일', - 'N / A': 'N / A', - 'Drag files here': 'ě—¬ę¸°ě— íŚŚěťĽěť„ ë“śëžę·¸', - 'File extension error': '파일 í™•ěžĄěž ě¤ëĄ', - 'File size error': '파일 í¬ę¸° ě¤ëĄ', - 'File count error': '이미지 : ě¤ëĄ', - 'Init error': 'ě´ę¸°í™” ě¤ëĄ', - 'HTTP Error': 'HTTP ě¤ëĄ', - 'Security error': 'ëł´ě• ě¤ëĄ', - 'Generic error': 'ě¤ëĄ', - 'IO error': 'IO ě¤ëĄ', - 'File : % s': '파일 % s', - 'Close': '닫기', - '% d files queued': '% d 파일이 추가ëě—습ë‹ë‹¤', - 'Using runtime :': '모드', - 'File : % f, size : % s, max file size : % m': '파일 : % f, í¬ę¸° : % s, 최대 파일 í¬ę¸° : % m', - 'Upload element accepts only % d file (s) at a time. Extra files were stripped': '업로드 가능한 íŚŚěťĽěť ě는 % děž…ë‹ë‹¤. ë¶í•„요한 파일은 ě‚ě śëě—습ë‹ë‹¤ ', - 'Upload URL might be wrong or doesn \'t exist ':'ě—…ëˇśë“śí• URLěť´ 존재í•ě§€ 않습ë‹ë‹¤ ', - 'Error : File too large :': 'ě¤ëĄ : í¬ę¸°ę°€ ë„무 í˝ë‹ë‹¤', - 'Error : Invalid file extension :': 'ě¤ëĄ : 확장ěžę°€ í—ěš©ë지 않습ë‹ë‹¤ :' -}); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/i18n/lv.js b/vendor/assets/javascripts/plupload/js/i18n/lv.js deleted file mode 100644 index 2a04045..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/lv.js +++ /dev/null @@ -1,33 +0,0 @@ -// .lv file like language pack -plupload.addI18n({ - 'Select files' : 'IzvÄ“lieties failus', - 'Add files to the upload queue and click the start button.' : 'Pieveinojiet failus rindai un klikšķiniet uz "SÄkt augšupielÄdi" pogas.', - 'Filename' : 'Faila nosaukums', - 'Status' : 'Statuss', - 'Size' : 'IzmÄ“rs', - 'Add files' : 'Pievienot failus', - 'Stop current upload' : 'ApturÄ“t pašreizÄ“jo augšupielÄdi', - 'Start uploading queue' : 'SÄkt augšupielÄdi', - 'Drag files here.' : 'Ievelciet failus šeit', - 'Start upload' : 'SÄkt augšupielÄdi', - 'Uploaded %d/%d files': 'AugšupielÄdÄ“ti %d/%d faili', - 'Stop upload': 'PÄrtraukt augšupielÄdi', - 'Start upload': 'SÄkt augšupielÄdi', - '%d files queued': '%d faili pievienoti rindai', - 'File: %s': 'Fails: %s', - 'Close': 'AizvÄ“rt', - 'Using runtime: ': 'Lieto saskarni: ', - 'File: %f, size: %s, max file size: %m': 'Fails: %f, izmÄ“rs: %s, maksimÄlais faila izmÄ“rs: %m', - 'Upload element accepts only %d file(s) at a time. Extra files were stripped.': 'IespÄ“jams ielÄdÄ“t tikai %d failus vienÄ reizÄ“. Atlikušie faili netika pievienoti', - 'Upload URL might be wrong or doesn\'t exist': 'AugšupielÄdes URL varÄ“tu bĹ«t nepareizs vai neeksistÄ“', - 'Error: File too large: ': 'KÄĽĹ«da: Fails pÄrÄk liels: ', - 'Error: Invalid file extension: ': 'KÄĽĹ«da: Nekorekts faila paplašinÄjums:', - 'File extension error.': 'Faila paplašinÄjuma kÄĽĹ«da.', - 'File size error.': 'Faila izmÄ“ra kÄĽĹ«da.', - 'File count error.': 'Failu skaita kÄĽĹ«da', - 'Init error.': 'InicializÄcijas kÄĽĹ«da.', - 'HTTP Error.': 'HTTP kÄĽĹ«da.', - 'Security error.': 'Drošības kÄĽĹ«da.', - 'Generic error.': 'VispÄrÄ“ja rakstura kÄĽĹ«da.', - 'IO error.': 'Ievades/Izvades kÄĽĹ«da.' -}); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/i18n/nl.js b/vendor/assets/javascripts/plupload/js/i18n/nl.js deleted file mode 100644 index 8372c88..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/nl.js +++ /dev/null @@ -1,21 +0,0 @@ -// Dutch -plupload.addI18n({ - 'Select files' : 'Selecteer bestand(en):', - 'Add files to the upload queue and click the start button.' : 'Voeg bestanden toe aan de wachtrij en druk op \'Start\'.', - 'Filename' : 'Bestandsnaam', - 'Status' : 'Status', - 'Size' : 'Grootte', - 'Add files' : 'Voeg bestanden toe', - 'Stop current upload' : 'Stop upload', - 'Start uploading queue' : 'Start upload', - 'Uploaded %d/%d files': '%d/%d bestanden ge-upload', - 'N/A' : 'Niet beschikbaar', - 'Drag files here.' : 'Sleep bestanden hierheen.', - 'File extension error.': 'Ongeldig bestandstype.', - 'File size error.': 'Bestandsgrootte Error.', - 'Init error.': 'Initialisatie error.', - 'HTTP Error.': 'HTTP Error.', - 'Security error.': 'Beveiliging error.', - 'Generic error.': 'Onbekende error.', - 'IO error.': 'IO error.' -}); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/i18n/pl.js b/vendor/assets/javascripts/plupload/js/i18n/pl.js deleted file mode 100644 index 3d1b9be..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/pl.js +++ /dev/null @@ -1,24 +0,0 @@ -plupload.addI18n({ -'Select files' : 'Wybierz pliki:', -'Add files to the upload queue and click the start button.' : 'Dodaj pliki i kliknij \'Rozpocznij transfer\'.', -'Filename' : 'Nazwa pliku', -'Status' : 'Status', -'Size' : 'Rozmiar', -'Add files' : 'Dodaj pliki', -'Stop current upload' : 'Przerwij aktualny transfer', -'Start uploading queue' : 'Rozpocznij wysyĹ‚anie', -'Uploaded %d/%d files': 'WysĹ‚ano %d/%d plikĂłw', -'N/A' : 'Nie dostÄ™pne', -'Drag files here.' : 'PrzeciÄ…gnij tu pliki', -'File extension error.': 'NieobsĹ‚ugiwany format pliku.', -'File size error.': 'Plik jest zbyt duĹĽy.', -'Init error.': 'BĹ‚Ä…d inicjalizacji.', -'HTTP Error.': 'BĹ‚Ä…d HTTP.', -'Security error.': 'BĹ‚Ä…d bezpieczeĹ„stwa.', -'Generic error.': 'BĹ‚Ä…d ogĂłlny.', -'IO error.': 'BĹ‚Ä…d IO.', -'Stop Upload': 'Przerwij transfer.', -'Add Files': 'Dodaj pliki', -'Start upload': 'Rozpocznij transfer.', -'%d files queued': '%d plikĂłw w kolejce.' -}); diff --git a/vendor/assets/javascripts/plupload/js/i18n/pt-br.js b/vendor/assets/javascripts/plupload/js/i18n/pt-br.js deleted file mode 100644 index 9f34a64..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/pt-br.js +++ /dev/null @@ -1,35 +0,0 @@ -// Brazilian Portuguese -plupload.addI18n({ - 'Select files' : 'Escolha os arquivos', - 'Add files to the upload queue and click the start button.' : 'Adicione os arquivos abaixo e clique no botĂŁo "Iniciar o envio".', - 'Filename' : 'Nome do arquivo', - 'Status' : 'Status', - 'Size' : 'Tamanho', - 'Add Files' : 'Adicionar arquivo(s)', - 'Stop Upload' : 'Parar o envio', - 'Start Upload' : 'Iniciar o envio', - 'Add files' : 'Adicionar arquivo(s)', - 'Add files.' : 'Adicionar arquivo(s)', - 'Stop upload' : 'Parar o envio', - 'Start upload' : 'Iniciar o envio', - 'Uploaded %d/%d files': 'Enviado(s) %d/%d arquivo(s)', - 'N/A' : 'N/D', - 'Drag files here.' : 'Arraste os arquivos pra cá', - 'File extension error.': 'Tipo de arquivo nĂŁo permitido.', - 'File size error.': 'Tamanho de arquivo nĂŁo permitido.', - 'File count error.': 'Erro na contagem dos arquivos', - 'Init error.': 'Erro inicializando.', - 'HTTP Error.': 'Erro HTTP.', - 'Security error.': 'Erro de segurança.', - 'Generic error.': 'Erro genĂ©rico.', - 'IO error.': 'Erro de E/S.', - 'File: %s': 'Arquivo: %s', - 'Close': 'Fechar', - '%d files queued': '%d arquivo(s)', - 'Using runtime: ': 'Usando: ', - 'File: %f, size: %s, max file size: %m': 'Arquivo: %f, tamanho: %s, máximo: %m', - 'Upload element accepts only %d file(s) at a time. Extra files were stripped.': 'SĂł sĂŁo aceitos %d arquivos por vez. O que passou disso foi descartado.', - 'Upload URL might be wrong or doesn\'t exist': 'URL de envio está errada ou nĂŁo existe', - 'Error: File too large: ': 'Erro: Arquivo muito grande: ', - 'Error: Invalid file extension: ': 'Erro: Tipo de arquivo nĂŁo permitido: ' -}); diff --git a/vendor/assets/javascripts/plupload/js/i18n/ro.js b/vendor/assets/javascripts/plupload/js/i18n/ro.js deleted file mode 100644 index fd198f0..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/ro.js +++ /dev/null @@ -1,24 +0,0 @@ -// Romanian -plupload.addI18n({ - 'Select files' : 'Selectare fiĹźiere', - 'Add files to the upload queue and click the start button.' : 'AdaugÄ fiĹźiere Ă®n lista apoi apasÄ butonul \'ĂŽncepe Ă®ncÄrcare\'.', - 'Filename' : 'Nume fiĹźier', - 'Status' : 'Stare', - 'Size' : 'MÄrime', - 'Add files' : 'AdÄugare fiĹźiere', - 'Stop current upload' : 'ĂŽntrerupe Ă®ncÄrcarea curentÄ', - 'Start uploading queue' : 'ĂŽncepe incÄrcarea', - 'Uploaded %d/%d files': 'FiĹźiere Ă®ncÄrcate %d/%d', - 'N/A' : 'N/A', - 'Drag files here.' : 'Trage aici fiĹźierele', - 'File extension error.': 'Extensie fiĹźier eronatÄ', - 'File size error.': 'Eroare dimensiune fiĹźier', - 'Init error.': 'Eroare iniĹŁializare', - 'HTTP Error.': 'Eroare HTTP', - 'Security error.': 'Eroare securitate', - 'Generic error.': 'Eroare genericÄ', - 'IO error.': 'Eroare Intrare/IeĹźire', - 'Stop Upload': 'Oprire Ă®ncÄrcare', - 'Start upload': 'ĂŽncepe Ă®ncÄrcare', - '%d files queued': '%d fiĹźiere listate' -}); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/i18n/ru.js b/vendor/assets/javascripts/plupload/js/i18n/ru.js deleted file mode 100644 index a78af8e..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/ru.js +++ /dev/null @@ -1,21 +0,0 @@ -// Russian -plupload.addI18n({ - 'Select files' : 'Выберите файлы', - 'Add files to the upload queue and click the start button.' : 'Добавьте файлы в очередь и нажмите ĐşĐ˝ĐľĐżĐşŃ "ЗагрŃзить файлы".', - 'Filename' : 'ĐĐĽŃŹ файла', - 'Status' : 'СтатŃŃ', - 'Size' : 'Размер', - 'Add files' : 'Добавить файлы', - 'Stop current upload' : 'ĐžŃтановить загрŃĐ·ĐşŃ', - 'Start uploading queue' : 'ЗагрŃзить файлы', - 'Uploaded %d/%d files': 'ЗагрŃжено %d из %d файлов', - 'N/A' : 'N/D', - 'Drag files here.' : 'Перетащите файлы ŃŃŽĐ´Đ°.', - 'File extension error.': 'Неправильное раŃŃирение файла.', - 'File size error.': 'Неправильный размер файла.', - 'Init error.': 'ĐžŃибка инициализации.', - 'HTTP Error.': 'ĐžŃибка HTTP.', - 'Security error.': 'ĐžŃибка безопаŃноŃти.', - 'Generic error.': 'Общая ĐľŃибка.', - 'IO error.': 'ĐžŃибка ввода-вывода.' -}); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/i18n/sr.js b/vendor/assets/javascripts/plupload/js/i18n/sr.js deleted file mode 100644 index 59dc0a9..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/sr.js +++ /dev/null @@ -1,14 +0,0 @@ -// Serbian -plupload.addI18n({ - 'Select files' : 'Izaberite fajlove', - 'Add files to the upload queue and click the start button.' : 'Dodajte fajlove u listu i kliknite na dugme Start.', - 'Filename' : 'Naziv fajla', - 'Status' : 'Status', - 'Size' : 'VeliÄŤina', - 'Add Files' : 'Dodaj fajlove', - 'Stop current upload' : 'Zaustavi upload', - 'Start uploading queue' : 'PoÄŤni upload', - 'Drag files here.' : 'Prevucite fajlove ovde.', - 'Start Upload': 'PoÄŤni upload', - 'Uploaded %d/%d files': 'Snimljeno %d/%d fajlova' -}); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/i18n/sv.js b/vendor/assets/javascripts/plupload/js/i18n/sv.js deleted file mode 100644 index 11c7524..0000000 --- a/vendor/assets/javascripts/plupload/js/i18n/sv.js +++ /dev/null @@ -1,12 +0,0 @@ -// .po file like language pack -plupload.addI18n({ - 'Select files' : 'Välj filer', - 'Add files to the upload queue and click the start button.' : 'Lägg till filer till kön och tryck pĂĄ start.', - 'Filename' : 'Filnamn', - 'Status' : 'Status', - 'Size' : 'Storlek', - 'Add files' : 'Lägg till filer', - 'Stop current upload' : 'Stoppa uppladdningen', - 'Start uploading queue' : 'Starta uppladdningen', - 'Drag files here.' : 'Dra filer hit' -}); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/backgrounds.gif b/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/backgrounds.gif deleted file mode 100644 index 39e33eb..0000000 Binary files a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/backgrounds.gif and /dev/null differ diff --git a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/buttons-disabled.png b/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/buttons-disabled.png deleted file mode 100644 index afa11af..0000000 Binary files a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/buttons-disabled.png and /dev/null differ diff --git a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/buttons.png b/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/buttons.png deleted file mode 100644 index 153e738..0000000 Binary files a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/buttons.png and /dev/null differ diff --git a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/delete.gif b/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/delete.gif deleted file mode 100644 index 78ca8b3..0000000 Binary files a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/delete.gif and /dev/null differ diff --git a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/done.gif b/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/done.gif deleted file mode 100644 index 29f3ed7..0000000 Binary files a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/done.gif and /dev/null differ diff --git a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/error.gif b/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/error.gif deleted file mode 100644 index 4682b63..0000000 Binary files a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/error.gif and /dev/null differ diff --git a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/throbber.gif b/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/throbber.gif deleted file mode 100644 index 4ae8b16..0000000 Binary files a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/throbber.gif and /dev/null differ diff --git a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/transp50.png b/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/transp50.png deleted file mode 100644 index eb0efe1..0000000 Binary files a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/img/transp50.png and /dev/null differ diff --git a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/jquery.plupload.queue.js b/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/jquery.plupload.queue.js deleted file mode 100644 index 6df6e4d..0000000 --- a/vendor/assets/javascripts/plupload/js/jquery.plupload.queue/jquery.plupload.queue.js +++ /dev/null @@ -1 +0,0 @@ -(function(c){var d={};function a(e){return plupload.translate(e)||e}function b(f,e){e.contents().each(function(g,h){h=c(h);if(!h.is(".plupload")){h.remove()}});e.prepend('1073741824){return Math.round(o/1073741824,1)+" GB"}if(o>1048576){return Math.round(o/1048576,1)+" MB"}if(o>1024){return Math.round(o/1024,1)+" KB"}return o+" b"},getPos:function(p,t){var u=0,s=0,w,v=document,q,r;p=p;t=t||v.body;function o(C){var A,B,z=0,D=0;if(C){B=C.getBoundingClientRect();A=v.compatMode==="CSS1Compat"?v.documentElement:v.body;z=B.left+A.scrollLeft;D=B.top+A.scrollTop}return{x:z,y:D}}if(p&&p.getBoundingClientRect&&((navigator.userAgent.indexOf("MSIE")>0)&&(v.documentMode<8))){q=o(p);r=o(t);return{x:q.x-r.x,y:q.y-r.y}}w=p;while(w&&w!=t&&w.nodeType){u+=w.offsetLeft||0;s+=w.offsetTop||0;w=w.offsetParent}w=p.parentNode;while(w&&w!=t&&w.nodeType){u-=w.scrollLeft||0;s-=w.scrollTop||0;w=w.parentNode}return{x:u,y:s}},getSize:function(o){return{w:o.offsetWidth||o.clientWidth,h:o.offsetHeight||o.clientHeight}},parseSize:function(o){var p;if(typeof(o)=="string"){o=/^([0-9]+)([mgk]?)$/.exec(o.toLowerCase().replace(/[^0-9mkg]/g,""));p=o[2];o=+o[1];if(p=="g"){o*=1073741824}if(p=="m"){o*=1048576}if(p=="k"){o*=1024}}return o},xmlEncode:function(o){return o?(""+o).replace(m,function(p){return a[p]?"&"+a[p]+";":p}):o},toArray:function(q){var p,o=[];for(p=0;p=0;p--){if(r[p].key===q||r[p].orig===u){if(t.removeEventListener){t.removeEventListener(o,r[p].func,false)}else{if(t.detachEvent){t.detachEvent("on"+o,r[p].func)}}r[p].orig=null;r[p].func=null;r.splice(p,1);if(u!==b){break}}}if(!r.length){delete d[t[e]][o]}if(g.isEmptyObj(d[t[e]])){delete d[t[e]];try{delete t[e]}catch(s){t[e]=b}}},removeAllEvents:function(p){var o=arguments[1];if(p[e]===b||!p[e]){return}g.each(d[p[e]],function(r,q){g.removeEvent(p,q,o)})}};g.Uploader=function(s){var p={},v,u=[],r,q=false;v=new g.QueueProgress();s=g.extend({chunk_size:0,multipart:true,multi_selection:true,file_data_name:"file",filters:[]},s);function t(){var x,y=0,w;if(this.state==g.STARTED){for(w=0;w 0?Math.ceil(v.uploaded/u.length*100):0}else{v.bytesPerSec=Math.ceil(v.loaded/((+new Date()-r||1)/1000));v.percent=v.size>0?Math.ceil(v.loaded/v.size*100):0}}g.extend(this,{state:g.STOPPED,runtime:"",features:{},files:u,settings:s,total:v,id:g.guid(),init:function(){var B=this,C,y,x,A=0,z;if(typeof(s.preinit)=="function"){s.preinit(B)}else{g.each(s.preinit,function(E,D){B.bind(D,E)})}s.page_url=s.page_url||document.location.pathname.replace(/\/[^\/]+$/g,"/");if(!/^(\w+:\/\/|\/)/.test(s.url)){s.url=s.page_url+s.url}s.chunk_size=g.parseSize(s.chunk_size);s.max_file_size=g.parseSize(s.max_file_size);B.bind("FilesAdded",function(D,G){var F,E,I=0,J,H=s.filters;if(H&&H.length){J=[];g.each(H,function(K){g.each(K.extensions.split(/,/),function(L){if(/^\s*\*\s*$/.test(L)){J.push("\\.*")}else{J.push("\\."+L.replace(new RegExp("["+("/^$.*+?|()[]{}\\".replace(/./g,"\\$&"))+"]","g"),"\\$&"))}})});J=new RegExp(J.join("|")+"$","i")}for(F=0;F s.max_file_size){D.trigger("Error",{code:g.FILE_SIZE_ERROR,message:g.translate("File size error."),file:E});continue}u.push(E);I++}if(I){c(function(){B.trigger("QueueChanged");B.refresh()},1)}else{return false}});if(s.unique_names){B.bind("UploadFile",function(D,E){var G=E.name.match(/\.([^.]+)$/),F="tmp";if(G){F=G[1]}E.target_name=E.id+"."+F})}B.bind("UploadProgress",function(D,E){E.percent=E.size>0?Math.ceil(E.loaded/E.size*100):100;o()});B.bind("StateChanged",function(D){if(D.state==g.STARTED){r=(+new Date())}else{if(D.state==g.STOPPED){for(C=D.files.length-1;C>=0;C--){if(D.files[C].status==g.UPLOADING){D.files[C].status=g.QUEUED;o()}}}}});B.bind("QueueChanged",o);B.bind("Error",function(D,E){if(E.file){E.file.status=g.FAILED;o();if(D.state==g.STARTED){c(function(){t.call(B)},1)}}});B.bind("FileUploaded",function(D,E){E.status=g.DONE;E.loaded=E.size;D.trigger("UploadProgress",E);c(function(){t.call(B)},1)});if(s.runtimes){y=[];z=s.runtimes.split(/\s?,\s?/);for(C=0;C =0;w--){if(u[w].id===x){return u[w]}}},removeFile:function(x){var w;for(w=u.length-1;w>=0;w--){if(u[w].id===x.id){return this.splice(w,1)[0]}}},splice:function(y,w){var x;x=u.splice(y===b?0:y,w===b?u.length:w);this.trigger("FilesRemoved",x);this.trigger("QueueChanged");return x},trigger:function(x){var z=p[x.toLowerCase()],y,w;if(z){w=Array.prototype.slice.call(arguments);w[0]=this;for(y=0;y =0;x--){if(z[x].func===y){z.splice(x,1);break}}}else{z=[]}if(!z.length){delete p[w]}}},unbindAll:function(){var w=this;g.each(p,function(y,x){w.unbind(x)})},destroy:function(){this.stop();this.trigger("Destroy");this.unbindAll()}})};g.File=function(r,p,q){var o=this;o.id=r;o.name=p;o.size=q;o.loaded=0;o.percent=0;o.status=0};g.Runtime=function(){this.getFeatures=function(){};this.init=function(o,p){}};g.QueueProgress=function(){var o=this;o.size=0;o.loaded=0;o.uploaded=0;o.failed=0;o.queued=0;o.percent=0;o.bytesPerSec=0;o.reset=function(){o.size=o.loaded=o.uploaded=o.failed=o.queued=o.percent=o.bytesPerSec=0}};g.runtimes={};window.plupload=g})();(function(){if(window.google&&google.gears){return}var a=null;if(typeof GearsFactory!="undefined"){a=new GearsFactory()}else{try{a=new ActiveXObject("Gears.Factory");if(a.getBuildInfo().indexOf("ie_mobile")!=-1){a.privateSetGlobalObject(this)}}catch(b){if((typeof navigator.mimeTypes!="undefined")&&navigator.mimeTypes["application/x-googlegears"]){a=document.createElement("object");a.style.display="none";a.width=0;a.height=0;a.type="application/x-googlegears";document.documentElement.appendChild(a)}}}if(!a){return}if(!window.google){window.google={}}if(!google.gears){google.gears={factory:a}}})();(function(e,b,c,d){var f={};function a(h,k,m){var g,j,l,o;j=google.gears.factory.create("beta.canvas");try{j.decode(h);if(!k.width){k.width=j.width}if(!k.height){k.height=j.height}o=Math.min(width/j.width,height/j.height);if(o<1||(o===1&&m==="image/jpeg")){j.resize(Math.round(j.width*o),Math.round(j.height*o));if(k.quality){return j.encode(m,{quality:k.quality/100})}return j.encode(m)}}catch(n){}return h}c.runtimes.Gears=c.addRuntime("gears",{getFeatures:function(){return{dragdrop:true,jpgresize:true,pngresize:true,chunks:true,progress:true,multipart:true,multi_selection:true}},init:function(l,n){var m,h,g=false;if(!e.google||!google.gears){return n({success:false})}try{m=google.gears.factory.create("beta.desktop")}catch(k){return n({success:false})}function j(q){var p,o,r=[],s;for(o=0;o 0;v=Math.ceil(r.size/s);if(!o){s=r.size;v=1}function p(){var C,y=u.settings.multipart,x=0,B={name:r.target_name||r.name},z=u.settings.url;function A(E){var D,J="----pluploadboundary"+c.guid(),G="--",I="\r\n",F,H;if(y){h.setRequestHeader("Content-Type","multipart/form-data; boundary="+J);D=google.gears.factory.create("beta.blobbuilder");c.each(c.extend(B,u.settings.multipart_params),function(L,K){D.append(G+J+I+'Content-Disposition: form-data; name="'+K+'"'+I+I);D.append(L+I)});H=c.mimeTypes[r.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream";D.append(G+J+I+'Content-Disposition: form-data; name="'+u.settings.file_data_name+'"; filename="'+r.name+'"'+I+"Content-Type: "+H+I+I);D.append(E);D.append(I+G+J+G+I);F=D.getAsBlob();x=F.length-E.length;E=F}h.send(E)}if(r.status==c.DONE||r.status==c.FAILED||u.state==c.STOPPED){return}if(o){B.chunk=w;B.chunks=v}C=Math.min(s,r.size-(w*s));if(!y){z=c.buildUrl(u.settings.url,B)}h=google.gears.factory.create("beta.httprequest");h.open("POST",z);if(!y){h.setRequestHeader("Content-Disposition",'attachment; filename="'+r.name+'"');h.setRequestHeader("Content-Type","application/octet-stream")}c.each(u.settings.headers,function(E,D){h.setRequestHeader(D,E)});h.upload.onprogress=function(D){r.loaded=t+D.loaded-x;u.trigger("UploadProgress",r)};h.onreadystatechange=function(){var D;if(h.readyState==4&&u.state!==c.STOPPED){if(h.status==200){D={chunk:w,chunks:v,response:h.responseText,status:h.status};u.trigger("ChunkUploaded",r,D);if(D.cancelled){r.status=c.FAILED;return}t+=C;if(++w>=v){r.status=c.DONE;u.trigger("FileUploaded",r,{response:h.responseText,status:h.status})}else{p()}}else{u.trigger("Error",{code:c.HTTP_ERROR,message:c.translate("HTTP Error."),file:r,chunk:w,chunks:v,status:h.status})}}};if(w 3){l.pop()}while(l.length<4){l.push(0)}m=s.split(".");while(m.length>4){m.pop()}do{u=parseInt(m[q],10);n=parseInt(l[q],10);q++}while(q 8?"":0.01});o.className="plupload silverlight";if(p.settings.container){k=b.getElementById(p.settings.container);if(d.getStyle(k,"position")==="static"){k.style.position="relative"}}k.appendChild(o);for(l=0;l ';function j(){return b.getElementById(p.id+"_silverlight").content.Upload}p.bind("Silverlight:Init",function(){var r,s={};if(h[p.id]){return}h[p.id]=true;p.bind("Silverlight:StartSelectFiles",function(t){r=[]});p.bind("Silverlight:SelectFile",function(t,w,u,v){var x;x=d.guid();s[x]=w;s[w]=x;r.push(new d.File(x,u,v))});p.bind("Silverlight:SelectSuccessful",function(){if(r.length){p.trigger("FilesAdded",r)}});p.bind("Silverlight:UploadChunkError",function(t,w,u,x,v){p.trigger("Error",{code:d.IO_ERROR,message:"IO Error.",details:v,file:t.getFile(s[w])})});p.bind("Silverlight:UploadFileProgress",function(t,x,u,w){var v=t.getFile(s[x]);if(v.status!=d.FAILED){v.size=w;v.loaded=u;t.trigger("UploadProgress",v)}});p.bind("Refresh",function(t){var u,v,w;u=b.getElementById(t.settings.browse_button);if(u){v=d.getPos(u,b.getElementById(t.settings.container));w=d.getSize(u);d.extend(b.getElementById(t.id+"_silverlight_container").style,{top:v.y+"px",left:v.x+"px",width:w.w+"px",height:w.h+"px"})}});p.bind("Silverlight:UploadChunkSuccessful",function(t,w,u,z,y){var x,v=t.getFile(s[w]);x={chunk:u,chunks:z,response:y};t.trigger("ChunkUploaded",v,x);if(v.status!=d.FAILED&&t.state!==d.STOPPED){j().UploadNextChunk()}if(u==z-1){v.status=d.DONE;t.trigger("FileUploaded",v,{response:y})}});p.bind("Silverlight:UploadSuccessful",function(t,w,u){var v=t.getFile(s[w]);v.status=d.DONE;t.trigger("FileUploaded",v,{response:u})});p.bind("FilesRemoved",function(t,v){var u;for(u=0;u ';if(d.ua.ie){r=b.createElement("div");m.appendChild(r);r.outerHTML=q;r=null}else{m.innerHTML=q}}());function o(){return b.getElementById(n.id+"_flash")}function k(){if(h++>5000){p({success:false});return}if(g[n.id]===false){setTimeout(k,1)}}k();l=m=null;n.bind("Destroy",function(q){var r;d.removeAllEvents(b.body,q.id);delete g[q.id];delete a[q.id];r=b.getElementById(q.id+"_flash_container");if(r){j.removeChild(r)}});n.bind("Flash:Init",function(){var s={},r;try{o().setFileFilters(n.settings.filters,n.settings.multi_selection)}catch(q){p({success:false});return}if(g[n.id]){return}g[n.id]=true;n.bind("UploadFile",function(t,v){var w=t.settings,u=n.settings.resize||{};o().uploadFile(s[v.id],w.url,{name:v.target_name||v.name,mime:d.mimeTypes[v.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream",chunk_size:w.chunk_size,width:u.width,height:u.height,quality:u.quality,multipart:w.multipart,multipart_params:w.multipart_params||{},file_data_name:w.file_data_name,format:/\.(jpg|jpeg)$/i.test(v.name)?"jpg":"png",headers:w.headers,urlstream_upload:w.urlstream_upload})});n.bind("CancelUpload",function(){o().cancelUpload()});n.bind("Flash:UploadProcess",function(u,t){var v=u.getFile(s[t.id]);if(v.status!=d.FAILED){v.loaded=t.loaded;v.size=t.size;u.trigger("UploadProgress",v)}});n.bind("Flash:UploadChunkComplete",function(t,v){var w,u=t.getFile(s[v.id]);w={chunk:v.chunk,chunks:v.chunks,response:v.text};t.trigger("ChunkUploaded",u,w);if(u.status!==d.FAILED&&t.state!==d.STOPPED){o().uploadNextChunk()}if(v.chunk==v.chunks-1){u.status=d.DONE;t.trigger("FileUploaded",u,{response:v.text})}});n.bind("Flash:SelectFiles",function(t,w){var v,u,x=[],y;for(u=0;u 0){s(++u,w)}else{l.status=a.DONE;o.trigger("FileUploaded",l,{response:y.value.body,status:x});if(x>=400){o.trigger("Error",{code:a.HTTP_ERROR,message:a.translate("HTTP Error."),file:l,status:x})}}}else{o.trigger("Error",{code:a.GENERIC_ERROR,message:a.translate("Generic Error."),file:l,details:y.error})}})}function r(u){l.size=u.size;if(m){e.FileAccess.chunk({file:u,chunkSize:m},function(x){if(x.success){var y=x.value,v=y.length;p=Array(v);for(var w=0;w ";G.scrollTop=100;E=k.getElementById(p.id+"_html5");if(w.features.triggerDialog){j.extend(E.style,{position:"absolute",width:"100%",height:"100%"})}else{j.extend(E.style,{cssFloat:"right",styleFloat:"right"})}E.onchange=function(){o(this.files);this.value=""};F=k.getElementById(w.settings.browse_button);if(F){var z=w.settings.browse_button_hover,A=w.settings.browse_button_active,x=w.features.triggerDialog?F:G;if(z){j.addEvent(x,"mouseover",function(){j.addClass(F,z)},w.id);j.addEvent(x,"mouseout",function(){j.removeClass(F,z)},w.id)}if(A){j.addEvent(x,"mousedown",function(){j.addClass(F,A)},w.id);j.addEvent(k.body,"mouseup",function(){j.removeClass(F,A)},w.id)}if(w.features.triggerDialog){j.addEvent(F,"click",function(H){var y=k.getElementById(w.id+"_html5");if(y&&!y.disabled){y.click()}H.preventDefault()},w.id)}}});p.bind("PostInit",function(){var s=k.getElementById(p.settings.drop_element);if(s){if(g){j.addEvent(s,"dragenter",function(w){var v,t,u;v=k.getElementById(p.id+"_drop");if(!v){v=k.createElement("input");v.setAttribute("type","file");v.setAttribute("id",p.id+"_drop");v.setAttribute("multiple","multiple");j.addEvent(v,"change",function(){o(this.files);j.removeEvent(v,"change",p.id);v.parentNode.removeChild(v)},p.id);s.appendChild(v)}t=j.getPos(s,k.getElementById(p.settings.container));u=j.getSize(s);if(j.getStyle(s,"position")==="static"){j.extend(s.style,{position:"relative"})}j.extend(v.style,{position:"absolute",display:"block",top:0,left:0,width:u.w+"px",height:u.h+"px",opacity:0})},p.id);return}j.addEvent(s,"dragover",function(t){t.preventDefault()},p.id);j.addEvent(s,"drop",function(u){var t=u.dataTransfer;if(t&&t.files){o(t.files)}u.preventDefault()},p.id)}});p.bind("Refresh",function(s){var t,u,v,x,w;t=k.getElementById(p.settings.browse_button);if(t){u=j.getPos(t,k.getElementById(s.settings.container));v=j.getSize(t);x=k.getElementById(p.id+"_html5_container");j.extend(x.style,{top:u.y+"px",left:u.x+"px",width:v.w+"px",height:v.h+"px"});if(p.features.triggerDialog){if(j.getStyle(t,"position")==="static"){j.extend(t.style,{position:"relative"})}w=parseInt(j.getStyle(t,"z-index"),10);if(isNaN(w)){w=0}j.extend(t.style,{zIndex:w});j.extend(x.style,{zIndex:w-1})}}});p.bind("DisableBrowse",function(s,u){var t=k.getElementById(s.id+"_html5");if(t){t.disabled=u}});p.bind("CancelUpload",function(){if(q&&q.abort){q.abort()}});p.bind("UploadFile",function(s,u){var v=s.settings,y,t;function x(A,D,z){var B;if(File.prototype.slice){try{A.slice();return A.slice(D,z)}catch(C){return A.slice(D,z-D)}}else{if(B=File.prototype.webkitSlice||File.prototype.mozSlice){return B.call(A,D,z)}else{return null}}}function w(A){var D=0,C=0,z=("FileReader" in h)?new FileReader:null;function B(){var I,M,K,L,H,J,F,E=s.settings.url;function G(V){var T=0,N="----pluploadboundary"+j.guid(),O,P="--",U="\r\n",R="";q=new XMLHttpRequest;if(q.upload){q.upload.onprogress=function(W){u.loaded=Math.min(u.size,C+W.loaded-T);s.trigger("UploadProgress",u)}}q.onreadystatechange=function(){var W,Y;if(q.readyState==4&&s.state!==j.STOPPED){try{W=q.status}catch(X){W=0}if(W>=400){s.trigger("Error",{code:j.HTTP_ERROR,message:j.translate("HTTP Error."),file:u,status:W})}else{if(K){Y={chunk:D,chunks:K,response:q.responseText,status:W};s.trigger("ChunkUploaded",u,Y);C+=J;if(Y.cancelled){u.status=j.FAILED;return}u.loaded=Math.min(u.size,(D+1)*H)}else{u.loaded=u.size}s.trigger("UploadProgress",u);V=I=O=R=null;if(!K||++D>=K){u.status=j.DONE;s.trigger("FileUploaded",u,{response:q.responseText,status:W})}else{B()}}}};if(s.settings.multipart&&n.multipart){L.name=u.target_name||u.name;q.open("post",E,true);j.each(s.settings.headers,function(X,W){q.setRequestHeader(W,X)});if(typeof(V)!=="string"&&!!h.FormData){O=new FormData();j.each(j.extend(L,s.settings.multipart_params),function(X,W){O.append(W,X)});O.append(s.settings.file_data_name,V);q.send(O);return}if(typeof(V)==="string"){q.setRequestHeader("Content-Type","multipart/form-data; boundary="+N);j.each(j.extend(L,s.settings.multipart_params),function(X,W){R+=P+N+U+'Content-Disposition: form-data; name="'+W+'"'+U+U;R+=unescape(encodeURIComponent(X))+U});F=j.mimeTypes[u.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream";R+=P+N+U+'Content-Disposition: form-data; name="'+s.settings.file_data_name+'"; filename="'+unescape(encodeURIComponent(u.name))+'"'+U+"Content-Type: "+F+U+U+V+U+P+N+P+U;T=R.length-V.length;V=R;if(q.sendAsBinary){q.sendAsBinary(V)}else{if(n.canSendBinary){var S=new Uint8Array(V.length);for(var Q=0;Q v.chunk_size&&(n.chunks||typeof(A)=="string")){H=v.chunk_size;K=Math.ceil(u.size/H);J=Math.min(H,u.size-(D*H));if(typeof(A)=="string"){I=A.substring(D*H,D*H+J)}else{I=x(A,D*H,D*H+J)}L.chunk=D;L.chunks=K}else{J=u.size;I=A}if(s.settings.multipart&&n.multipart&&typeof(I)!=="string"&&z&&n.cantSendBlobInFormData&&n.chunks&&s.settings.chunk_size){z.onload=function(){G(z.result)};z.readAsBinaryString(I)}else{G(I)}}B()}y=c[u.id];if(n.jpgresize&&s.settings.resize&&/\.(png|jpg|jpeg)$/i.test(u.name)){d.call(s,u,s.settings.resize,/\.png$/i.test(u.name)?"image/png":"image/jpeg",function(z){if(z.success){u.size=z.data.length;w(z.data)}else{if(n.chunks){w(y)}else{l(y,w)}}})}else{if(!n.chunks&&n.jpgresize){l(y,w)}else{w(y)}}});p.bind("Destroy",function(s){var u,v,t=k.body,w={inputContainer:s.id+"_html5_container",inputFile:s.id+"_html5",browseButton:s.settings.browse_button,dropElm:s.settings.drop_element};for(u in w){v=k.getElementById(w[u]);if(v){j.removeAllEvents(v,s.id)}}j.removeAllEvents(k.body,s.id);if(s.settings.container){t=k.getElementById(s.settings.container)}t.removeChild(k.getElementById(w.inputContainer))});r({success:true})}});function b(){var q=false,o;function r(t,v){var s=q?0:-8*(v-1),w=0,u;for(u=0;u >Math.abs(s+v*8))&255)}n(x,t,w)}return{II:function(s){if(s===e){return q}else{q=s}},init:function(s){q=false;o=s},SEGMENT:function(s,u,t){switch(arguments.length){case 1:return o.substr(s,o.length-s-1);case 2:return o.substr(s,u);case 3:n(t,s,u);break;default:return o}},BYTE:function(s){return r(s,1)},SHORT:function(s){return r(s,2)},LONG:function(s,t){if(t===e){return r(s,4)}else{p(s,t,4)}},SLONG:function(s){var t=r(s,4);return(t>2147483647?t-4294967296:t)},STRING:function(s,t){var u="";for(t+=s;s =65488&&p<=65495){n+=2;continue}if(p===65498||p===65497){break}q=r.SHORT(n+2)+2;if(u[p]&&r.STRING(n+4,u[p].signature.length)===u[p].signature){t.push({hex:p,app:u[p].app.toUpperCase(),name:u[p].name.toUpperCase(),start:n,length:q,segment:r.SEGMENT(n,q)})}n+=q}r.init(null);return{headers:t,restore:function(y){r.init(y);var w=new f(y);if(!w.headers){return false}for(var x=w.headers.length;x>0;x--){var z=w.headers[x-1];r.SEGMENT(z.start,z.length,"")}w.purge();n=r.SHORT(2)==65504?4+r.SHORT(4):2;for(var x=0,v=t.length;x =z.length){break}}},purge:function(){t=[];r.init(null)}}}function a(){var q,n,o={},t;q=new b();n={tiff:{274:"Orientation",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"}};t={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire.",1:"Flash fired.",5:"Strobe return light not detected.",7:"Strobe return light detected.",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}};function p(u,C){var w=q.SHORT(u),z,F,G,B,A,v,x,D,E=[],y={};for(z=0;z 4){x=q.LONG(x)+o.tiffHeader}for(F=0;F4){x=q.LONG(x)+o.tiffHeader}y[G]=q.STRING(x,A-1);continue;case 3:if(A>2){x=q.LONG(x)+o.tiffHeader}for(F=0;F1){x=q.LONG(x)+o.tiffHeader}for(F=0;F';n=y.firstChild;j.appendChild(n);b.addEvent(n,"load",function(D){var E=D.target,C,A;if(!k){return}try{C=E.contentWindow.document||E.contentDocument||d.frames[E.id].document}catch(B){p.trigger("Error",{code:b.SECURITY_ERROR,message:b.translate("Security error."),file:k});return}A=C.body.innerHTML;if(A){k.status=b.DONE;k.loaded=1025;k.percent=100;p.trigger("UploadProgress",k);p.trigger("FileUploaded",k,{response:A})}},p.id)}if(p.settings.container){j=e(p.settings.container);if(b.getStyle(j,"position")==="static"){j.style.position="relative"}}p.bind("UploadFile",function(y,B){var C,A;if(B.status==b.DONE||B.status==b.FAILED||y.state==b.STOPPED){return}C=e("form_"+B.id);A=e("input_"+B.id);A.setAttribute("name",y.settings.file_data_name);C.setAttribute("action",y.settings.url);b.each(b.extend({name:B.target_name||B.name},y.settings.multipart_params),function(F,D){var E=a.createElement("input");b.extend(E,{type:"hidden",name:D,value:F});C.insertBefore(E,C.firstChild)});k=B;e("form_"+q).style.top=-1048575+"px";C.submit()});p.bind("FileUploaded",function(y){y.refresh()});p.bind("StateChanged",function(y){if(y.state==b.STARTED){u()}else{if(y.state==b.STOPPED){d.setTimeout(function(){b.removeEvent(n,"load",y.id);if(n.parentNode){n.parentNode.removeChild(n)}},0)}}b.each(y.files,function(B,A){if(B.status===b.DONE||B.status===b.FAILED){var C=e("form_"+B.id);if(C){C.parentNode.removeChild(C)}}})});p.bind("Refresh",function(A){var G,B,C,D,y,H,I,F,E;G=e(A.settings.browse_button);if(G){y=b.getPos(G,e(A.settings.container));H=b.getSize(G);I=e("form_"+q);F=e("input_"+q);b.extend(I.style,{top:y.y+"px",left:y.x+"px",width:H.w+"px",height:H.h+"px"});if(A.features.triggerDialog){if(b.getStyle(G,"position")==="static"){b.extend(G.style,{position:"relative"})}E=parseInt(G.style.zIndex,10);if(isNaN(E)){E=0}b.extend(G.style,{zIndex:E});b.extend(I.style,{zIndex:E-1})}C=A.settings.browse_button_hover;D=A.settings.browse_button_active;B=A.features.triggerDialog?G:I;if(C){b.addEvent(B,"mouseover",function(){b.addClass(G,C)},A.id);b.addEvent(B,"mouseout",function(){b.removeClass(G,C)},A.id)}if(D){b.addEvent(B,"mousedown",function(){b.addClass(G,D)},A.id);b.addEvent(a.body,"mouseup",function(){b.removeClass(G,D)},A.id)}}});f.bind("FilesRemoved",function(y,B){var A,C;for(A=0;A 0;u=Math.ceil(q.size/r);if(!n){r=q.size;u=1}function o(){var B,x=t.settings.multipart,w=0,A={name:q.target_name||q.name},y=t.settings.url;function z(D){var C,I="----pluploadboundary"+c.guid(),F="--",H="\r\n",E,G;if(x){h.setRequestHeader("Content-Type","multipart/form-data; boundary="+I);C=google.gears.factory.create("beta.blobbuilder");c.each(c.extend(A,t.settings.multipart_params),function(K,J){C.append(F+I+H+'Content-Disposition: form-data; name="'+J+'"'+H+H);C.append(K+H)});G=c.mimeTypes[q.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream";C.append(F+I+H+'Content-Disposition: form-data; name="'+t.settings.file_data_name+'"; filename="'+q.name+'"'+H+"Content-Type: "+G+H+H);C.append(D);C.append(H+F+I+F+H);E=C.getAsBlob();w=E.length-D.length;D=E}h.send(D)}if(q.status==c.DONE||q.status==c.FAILED||t.state==c.STOPPED){return}if(n){A.chunk=v;A.chunks=u}B=Math.min(r,q.size-(v*r));if(!x){y=c.buildUrl(t.settings.url,A)}h=google.gears.factory.create("beta.httprequest");h.open("POST",y);if(!x){h.setRequestHeader("Content-Disposition",'attachment; filename="'+q.name+'"');h.setRequestHeader("Content-Type","application/octet-stream")}c.each(t.settings.headers,function(D,C){h.setRequestHeader(C,D)});h.upload.onprogress=function(C){q.loaded=s+C.loaded-w;t.trigger("UploadProgress",q)};h.onreadystatechange=function(){var C;if(h.readyState==4&&t.state!==c.STOPPED){if(h.status==200){C={chunk:v,chunks:u,response:h.responseText,status:h.status};t.trigger("ChunkUploaded",q,C);if(C.cancelled){q.status=c.FAILED;return}s+=B;if(++v>=u){q.status=c.DONE;t.trigger("FileUploaded",q,{response:h.responseText,status:h.status})}else{o()}}else{t.trigger("Error",{code:c.HTTP_ERROR,message:c.translate("HTTP Error."),file:q,chunk:v,chunks:u,status:h.status})}}};if(v';n=i.firstChild;j.appendChild(n);b.addEvent(n,"load",function(C){var D=C.target,B,y;if(!k){return}try{B=D.contentWindow.document||D.contentDocument||d.frames[D.id].document}catch(A){p.trigger("Error",{code:b.SECURITY_ERROR,message:b.translate("Security error."),file:k});return}y=B.body.innerHTML;if(y){k.status=b.DONE;k.loaded=1025;k.percent=100;p.trigger("UploadProgress",k);p.trigger("FileUploaded",k,{response:y})}},p.id)}if(p.settings.container){j=e(p.settings.container);if(b.getStyle(j,"position")==="static"){j.style.position="relative"}}p.bind("UploadFile",function(i,A){var B,y;if(A.status==b.DONE||A.status==b.FAILED||i.state==b.STOPPED){return}B=e("form_"+A.id);y=e("input_"+A.id);y.setAttribute("name",i.settings.file_data_name);B.setAttribute("action",i.settings.url);b.each(b.extend({name:A.target_name||A.name},i.settings.multipart_params),function(E,C){var D=a.createElement("input");b.extend(D,{type:"hidden",name:C,value:E});B.insertBefore(D,B.firstChild)});k=A;e("form_"+q).style.top=-1048575+"px";B.submit()});p.bind("FileUploaded",function(i){i.refresh()});p.bind("StateChanged",function(i){if(i.state==b.STARTED){u()}else{if(i.state==b.STOPPED){d.setTimeout(function(){b.removeEvent(n,"load",i.id);if(n.parentNode){n.parentNode.removeChild(n)}},0)}}b.each(i.files,function(A,y){if(A.status===b.DONE||A.status===b.FAILED){var B=e("form_"+A.id);if(B){B.parentNode.removeChild(B)}}})});p.bind("Refresh",function(y){var F,A,B,C,i,G,H,E,D;F=e(y.settings.browse_button);if(F){i=b.getPos(F,e(y.settings.container));G=b.getSize(F);H=e("form_"+q);E=e("input_"+q);b.extend(H.style,{top:i.y+"px",left:i.x+"px",width:G.w+"px",height:G.h+"px"});if(y.features.triggerDialog){if(b.getStyle(F,"position")==="static"){b.extend(F.style,{position:"relative"})}D=parseInt(F.style.zIndex,10);if(isNaN(D)){D=0}b.extend(F.style,{zIndex:D});b.extend(H.style,{zIndex:D-1})}B=y.settings.browse_button_hover;C=y.settings.browse_button_active;A=y.features.triggerDialog?F:H;if(B){b.addEvent(A,"mouseover",function(){b.addClass(F,B)},y.id);b.addEvent(A,"mouseout",function(){b.removeClass(F,B)},y.id)}if(C){b.addEvent(A,"mousedown",function(){b.addClass(F,C)},y.id);b.addEvent(a.body,"mouseup",function(){b.removeClass(F,C)},y.id)}}});f.bind("FilesRemoved",function(y,B){var A,C;for(A=0;A ";G.scrollTop=100;E=k.getElementById(p.id+"_html5");if(w.features.triggerDialog){j.extend(E.style,{position:"absolute",width:"100%",height:"100%"})}else{j.extend(E.style,{cssFloat:"right",styleFloat:"right"})}E.onchange=function(){o(this.files);this.value=""};F=k.getElementById(w.settings.browse_button);if(F){var z=w.settings.browse_button_hover,A=w.settings.browse_button_active,x=w.features.triggerDialog?F:G;if(z){j.addEvent(x,"mouseover",function(){j.addClass(F,z)},w.id);j.addEvent(x,"mouseout",function(){j.removeClass(F,z)},w.id)}if(A){j.addEvent(x,"mousedown",function(){j.addClass(F,A)},w.id);j.addEvent(k.body,"mouseup",function(){j.removeClass(F,A)},w.id)}if(w.features.triggerDialog){j.addEvent(F,"click",function(H){var y=k.getElementById(w.id+"_html5");if(y&&!y.disabled){y.click()}H.preventDefault()},w.id)}}});p.bind("PostInit",function(){var s=k.getElementById(p.settings.drop_element);if(s){if(g){j.addEvent(s,"dragenter",function(w){var v,t,u;v=k.getElementById(p.id+"_drop");if(!v){v=k.createElement("input");v.setAttribute("type","file");v.setAttribute("id",p.id+"_drop");v.setAttribute("multiple","multiple");j.addEvent(v,"change",function(){o(this.files);j.removeEvent(v,"change",p.id);v.parentNode.removeChild(v)},p.id);s.appendChild(v)}t=j.getPos(s,k.getElementById(p.settings.container));u=j.getSize(s);if(j.getStyle(s,"position")==="static"){j.extend(s.style,{position:"relative"})}j.extend(v.style,{position:"absolute",display:"block",top:0,left:0,width:u.w+"px",height:u.h+"px",opacity:0})},p.id);return}j.addEvent(s,"dragover",function(t){t.preventDefault()},p.id);j.addEvent(s,"drop",function(u){var t=u.dataTransfer;if(t&&t.files){o(t.files)}u.preventDefault()},p.id)}});p.bind("Refresh",function(s){var t,u,v,x,w;t=k.getElementById(p.settings.browse_button);if(t){u=j.getPos(t,k.getElementById(s.settings.container));v=j.getSize(t);x=k.getElementById(p.id+"_html5_container");j.extend(x.style,{top:u.y+"px",left:u.x+"px",width:v.w+"px",height:v.h+"px"});if(p.features.triggerDialog){if(j.getStyle(t,"position")==="static"){j.extend(t.style,{position:"relative"})}w=parseInt(j.getStyle(t,"z-index"),10);if(isNaN(w)){w=0}j.extend(t.style,{zIndex:w});j.extend(x.style,{zIndex:w-1})}}});p.bind("DisableBrowse",function(s,u){var t=k.getElementById(s.id+"_html5");if(t){t.disabled=u}});p.bind("CancelUpload",function(){if(q&&q.abort){q.abort()}});p.bind("UploadFile",function(s,u){var v=s.settings,y,t;function x(A,D,z){var B;if(File.prototype.slice){try{A.slice();return A.slice(D,z)}catch(C){return A.slice(D,z-D)}}else{if(B=File.prototype.webkitSlice||File.prototype.mozSlice){return B.call(A,D,z)}else{return null}}}function w(A){var D=0,C=0,z=("FileReader" in h)?new FileReader:null;function B(){var I,M,K,L,H,J,F,E=s.settings.url;function G(V){var T=0,N="----pluploadboundary"+j.guid(),O,P="--",U="\r\n",R="";q=new XMLHttpRequest;if(q.upload){q.upload.onprogress=function(W){u.loaded=Math.min(u.size,C+W.loaded-T);s.trigger("UploadProgress",u)}}q.onreadystatechange=function(){var W,Y;if(q.readyState==4&&s.state!==j.STOPPED){try{W=q.status}catch(X){W=0}if(W>=400){s.trigger("Error",{code:j.HTTP_ERROR,message:j.translate("HTTP Error."),file:u,status:W})}else{if(K){Y={chunk:D,chunks:K,response:q.responseText,status:W};s.trigger("ChunkUploaded",u,Y);C+=J;if(Y.cancelled){u.status=j.FAILED;return}u.loaded=Math.min(u.size,(D+1)*H)}else{u.loaded=u.size}s.trigger("UploadProgress",u);V=I=O=R=null;if(!K||++D>=K){u.status=j.DONE;s.trigger("FileUploaded",u,{response:q.responseText,status:W})}else{B()}}}};if(s.settings.multipart&&n.multipart){L.name=u.target_name||u.name;q.open("post",E,true);j.each(s.settings.headers,function(X,W){q.setRequestHeader(W,X)});if(typeof(V)!=="string"&&!!h.FormData){O=new FormData();j.each(j.extend(L,s.settings.multipart_params),function(X,W){O.append(W,X)});O.append(s.settings.file_data_name,V);q.send(O);return}if(typeof(V)==="string"){q.setRequestHeader("Content-Type","multipart/form-data; boundary="+N);j.each(j.extend(L,s.settings.multipart_params),function(X,W){R+=P+N+U+'Content-Disposition: form-data; name="'+W+'"'+U+U;R+=unescape(encodeURIComponent(X))+U});F=j.mimeTypes[u.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream";R+=P+N+U+'Content-Disposition: form-data; name="'+s.settings.file_data_name+'"; filename="'+unescape(encodeURIComponent(u.name))+'"'+U+"Content-Type: "+F+U+U+V+U+P+N+P+U;T=R.length-V.length;V=R;if(q.sendAsBinary){q.sendAsBinary(V)}else{if(n.canSendBinary){var S=new Uint8Array(V.length);for(var Q=0;Q v.chunk_size&&(n.chunks||typeof(A)=="string")){H=v.chunk_size;K=Math.ceil(u.size/H);J=Math.min(H,u.size-(D*H));if(typeof(A)=="string"){I=A.substring(D*H,D*H+J)}else{I=x(A,D*H,D*H+J)}L.chunk=D;L.chunks=K}else{J=u.size;I=A}if(s.settings.multipart&&n.multipart&&typeof(I)!=="string"&&z&&n.cantSendBlobInFormData&&n.chunks&&s.settings.chunk_size){z.onload=function(){G(z.result)};z.readAsBinaryString(I)}else{G(I)}}B()}y=c[u.id];if(n.jpgresize&&s.settings.resize&&/\.(png|jpg|jpeg)$/i.test(u.name)){d.call(s,u,s.settings.resize,/\.png$/i.test(u.name)?"image/png":"image/jpeg",function(z){if(z.success){u.size=z.data.length;w(z.data)}else{if(n.chunks){w(y)}else{l(y,w)}}})}else{if(!n.chunks&&n.jpgresize){l(y,w)}else{w(y)}}});p.bind("Destroy",function(s){var u,v,t=k.body,w={inputContainer:s.id+"_html5_container",inputFile:s.id+"_html5",browseButton:s.settings.browse_button,dropElm:s.settings.drop_element};for(u in w){v=k.getElementById(w[u]);if(v){j.removeAllEvents(v,s.id)}}j.removeAllEvents(k.body,s.id);if(s.settings.container){t=k.getElementById(s.settings.container)}t.removeChild(k.getElementById(w.inputContainer))});r({success:true})}});function b(){var q=false,o;function r(t,v){var s=q?0:-8*(v-1),w=0,u;for(u=0;u >Math.abs(s+v*8))&255)}n(x,t,w)}return{II:function(s){if(s===e){return q}else{q=s}},init:function(s){q=false;o=s},SEGMENT:function(s,u,t){switch(arguments.length){case 1:return o.substr(s,o.length-s-1);case 2:return o.substr(s,u);case 3:n(t,s,u);break;default:return o}},BYTE:function(s){return r(s,1)},SHORT:function(s){return r(s,2)},LONG:function(s,t){if(t===e){return r(s,4)}else{p(s,t,4)}},SLONG:function(s){var t=r(s,4);return(t>2147483647?t-4294967296:t)},STRING:function(s,t){var u="";for(t+=s;s =65488&&p<=65495){n+=2;continue}if(p===65498||p===65497){break}q=r.SHORT(n+2)+2;if(u[p]&&r.STRING(n+4,u[p].signature.length)===u[p].signature){t.push({hex:p,app:u[p].app.toUpperCase(),name:u[p].name.toUpperCase(),start:n,length:q,segment:r.SEGMENT(n,q)})}n+=q}r.init(null);return{headers:t,restore:function(y){r.init(y);var w=new f(y);if(!w.headers){return false}for(var x=w.headers.length;x>0;x--){var z=w.headers[x-1];r.SEGMENT(z.start,z.length,"")}w.purge();n=r.SHORT(2)==65504?4+r.SHORT(4):2;for(var x=0,v=t.length;x =z.length){break}}},purge:function(){t=[];r.init(null)}}}function a(){var q,n,o={},t;q=new b();n={tiff:{274:"Orientation",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"}};t={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire.",1:"Flash fired.",5:"Strobe return light not detected.",7:"Strobe return light detected.",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}};function p(u,C){var w=q.SHORT(u),z,F,G,B,A,v,x,D,E=[],y={};for(z=0;z 4){x=q.LONG(x)+o.tiffHeader}for(F=0;F4){x=q.LONG(x)+o.tiffHeader}y[G]=q.STRING(x,A-1);continue;case 3:if(A>2){x=q.LONG(x)+o.tiffHeader}for(F=0;F1){x=q.LONG(x)+o.tiffHeader}for(F=0;F":"gt","&":"amp",'"':"quot","'":"#39"},l=/[<>&\"\']/g,b,c=window.setTimeout,d={},e;function h(){this.returnValue=false}function j(){this.cancelBubble=true}(function(n){var o=n.split(/,/),p,r,q;for(p=0;p 0){g.each(o,function(r,q){n[q]=r})}});return n},cleanName:function(n){var o,p;p=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"];for(o=0;o 0?"&":"?")+p}return o},each:function(q,r){var p,o,n;if(q){p=q.length;if(p===b){for(o in q){if(q.hasOwnProperty(o)){if(r(q[o],o)===false){return}}}}else{for(n=0;n 1073741824){return Math.round(n/1073741824,1)+" GB"}if(n>1048576){return Math.round(n/1048576,1)+" MB"}if(n>1024){return Math.round(n/1024,1)+" KB"}return n+" b"},getPos:function(o,s){var t=0,r=0,v,u=document,p,q;o=o;s=s||u.body;function n(B){var z,A,w=0,C=0;if(B){A=B.getBoundingClientRect();z=u.compatMode==="CSS1Compat"?u.documentElement:u.body;w=A.left+z.scrollLeft;C=A.top+z.scrollTop}return{x:w,y:C}}if(o&&o.getBoundingClientRect&&((navigator.userAgent.indexOf("MSIE")>0)&&(u.documentMode<8))){p=n(o);q=n(s);return{x:p.x-q.x,y:p.y-q.y}}v=o;while(v&&v!=s&&v.nodeType){t+=v.offsetLeft||0;r+=v.offsetTop||0;v=v.offsetParent}v=o.parentNode;while(v&&v!=s&&v.nodeType){t-=v.scrollLeft||0;r-=v.scrollTop||0;v=v.parentNode}return{x:t,y:r}},getSize:function(n){return{w:n.offsetWidth||n.clientWidth,h:n.offsetHeight||n.clientHeight}},parseSize:function(n){var o;if(typeof(n)=="string"){n=/^([0-9]+)([mgk]?)$/.exec(n.toLowerCase().replace(/[^0-9mkg]/g,""));o=n[2];n=+n[1];if(o=="g"){n*=1073741824}if(o=="m"){n*=1048576}if(o=="k"){n*=1024}}return n},xmlEncode:function(n){return n?(""+n).replace(l,function(o){return a[o]?"&"+a[o]+";":o}):n},toArray:function(p){var o,n=[];for(o=0;o
=0;o--){if(q[o].key===p||q[o].orig===t){if(s.removeEventListener){s.removeEventListener(n,q[o].func,false)}else{if(s.detachEvent){s.detachEvent("on"+n,q[o].func)}}q[o].orig=null;q[o].func=null;q.splice(o,1);if(t!==b){break}}}if(!q.length){delete d[s[e]][n]}if(g.isEmptyObj(d[s[e]])){delete d[s[e]];try{delete s[e]}catch(r){s[e]=b}}},removeAllEvents:function(o){var n=arguments[1];if(o[e]===b||!o[e]){return}g.each(d[o[e]],function(q,p){g.removeEvent(o,p,n)})}};g.Uploader=function(r){var o={},u,t=[],q,p=false;u=new g.QueueProgress();r=g.extend({chunk_size:0,multipart:true,multi_selection:true,file_data_name:"file",filters:[]},r);function s(){var w,x=0,v;if(this.state==g.STARTED){for(v=0;v 0?Math.ceil(u.uploaded/t.length*100):0}else{u.bytesPerSec=Math.ceil(u.loaded/((+new Date()-q||1)/1000));u.percent=u.size>0?Math.ceil(u.loaded/u.size*100):0}}g.extend(this,{state:g.STOPPED,runtime:"",features:{},files:t,settings:r,total:u,id:g.guid(),init:function(){var A=this,B,x,w,z=0,y;if(typeof(r.preinit)=="function"){r.preinit(A)}else{g.each(r.preinit,function(D,C){A.bind(C,D)})}r.page_url=r.page_url||document.location.pathname.replace(/\/[^\/]+$/g,"/");if(!/^(\w+:\/\/|\/)/.test(r.url)){r.url=r.page_url+r.url}r.chunk_size=g.parseSize(r.chunk_size);r.max_file_size=g.parseSize(r.max_file_size);A.bind("FilesAdded",function(C,F){var E,D,H=0,I,G=r.filters;if(G&&G.length){I=[];g.each(G,function(J){g.each(J.extensions.split(/,/),function(K){if(/^\s*\*\s*$/.test(K)){I.push("\\.*")}else{I.push("\\."+K.replace(new RegExp("["+("/^$.*+?|()[]{}\\".replace(/./g,"\\$&"))+"]","g"),"\\$&"))}})});I=new RegExp(I.join("|")+"$","i")}for(E=0;E r.max_file_size){C.trigger("Error",{code:g.FILE_SIZE_ERROR,message:g.translate("File size error."),file:D});continue}t.push(D);H++}if(H){c(function(){A.trigger("QueueChanged");A.refresh()},1)}else{return false}});if(r.unique_names){A.bind("UploadFile",function(C,D){var F=D.name.match(/\.([^.]+)$/),E="tmp";if(F){E=F[1]}D.target_name=D.id+"."+E})}A.bind("UploadProgress",function(C,D){D.percent=D.size>0?Math.ceil(D.loaded/D.size*100):100;n()});A.bind("StateChanged",function(C){if(C.state==g.STARTED){q=(+new Date())}else{if(C.state==g.STOPPED){for(B=C.files.length-1;B>=0;B--){if(C.files[B].status==g.UPLOADING){C.files[B].status=g.QUEUED;n()}}}}});A.bind("QueueChanged",n);A.bind("Error",function(C,D){if(D.file){D.file.status=g.FAILED;n();if(C.state==g.STARTED){c(function(){s.call(A)},1)}}});A.bind("FileUploaded",function(C,D){D.status=g.DONE;D.loaded=D.size;C.trigger("UploadProgress",D);c(function(){s.call(A)},1)});if(r.runtimes){x=[];y=r.runtimes.split(/\s?,\s?/);for(B=0;B =0;v--){if(t[v].id===w){return t[v]}}},removeFile:function(w){var v;for(v=t.length-1;v>=0;v--){if(t[v].id===w.id){return this.splice(v,1)[0]}}},splice:function(x,v){var w;w=t.splice(x===b?0:x,v===b?t.length:v);this.trigger("FilesRemoved",w);this.trigger("QueueChanged");return w},trigger:function(w){var y=o[w.toLowerCase()],x,v;if(y){v=Array.prototype.slice.call(arguments);v[0]=this;for(x=0;x =0;w--){if(y[w].func===x){y.splice(w,1);break}}}else{y=[]}if(!y.length){delete o[v]}}},unbindAll:function(){var v=this;g.each(o,function(x,w){v.unbind(w)})},destroy:function(){this.stop();this.trigger("Destroy");this.unbindAll()}})};g.File=function(q,o,p){var n=this;n.id=q;n.name=o;n.size=p;n.loaded=0;n.percent=0;n.status=0};g.Runtime=function(){this.getFeatures=function(){};this.init=function(n,o){}};g.QueueProgress=function(){var n=this;n.size=0;n.loaded=0;n.uploaded=0;n.failed=0;n.queued=0;n.percent=0;n.bytesPerSec=0;n.reset=function(){n.size=n.loaded=n.uploaded=n.failed=n.queued=n.percent=n.bytesPerSec=0}};g.runtimes={};window.plupload=g})(); \ No newline at end of file diff --git a/vendor/assets/javascripts/plupload/js/plupload.silverlight.js b/vendor/assets/javascripts/plupload/js/plupload.silverlight.js deleted file mode 100644 index d333a2b..0000000 --- a/vendor/assets/javascripts/plupload/js/plupload.silverlight.js +++ /dev/null @@ -1 +0,0 @@ -(function(g,b,d,e){var a={},h={};function c(o){var n,m=typeof o,j,l,k;if(o===e||o===null){return"null"}if(m==="string"){n="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(q,p){var i=n.indexOf(p);if(i+1){return"\\"+n.charAt(i+1)}q=p.charCodeAt().toString(16);return"\\u"+"0000".substring(q.length)+q})+'"'}if(m=="object"){j=o.length!==e;n="";if(j){for(l=0;l 3){k.pop()}while(k.length<4){k.push(0)}l=r.split(".");while(l.length>4){l.pop()}do{t=parseInt(l[p],10);m=parseInt(k[p],10);p++}while(p 8?"":0.01});o.className="plupload silverlight";if(p.settings.container){k=b.getElementById(p.settings.container);if(d.getStyle(k,"position")==="static"){k.style.position="relative"}}k.appendChild(o);for(l=0;l ';function j(){return b.getElementById(p.id+"_silverlight").content.Upload}p.bind("Silverlight:Init",function(){var i,r={};if(h[p.id]){return}h[p.id]=true;p.bind("Silverlight:StartSelectFiles",function(s){i=[]});p.bind("Silverlight:SelectFile",function(s,v,t,u){var w;w=d.guid();r[w]=v;r[v]=w;i.push(new d.File(w,t,u))});p.bind("Silverlight:SelectSuccessful",function(){if(i.length){p.trigger("FilesAdded",i)}});p.bind("Silverlight:UploadChunkError",function(s,v,t,w,u){p.trigger("Error",{code:d.IO_ERROR,message:"IO Error.",details:u,file:s.getFile(r[v])})});p.bind("Silverlight:UploadFileProgress",function(s,w,t,v){var u=s.getFile(r[w]);if(u.status!=d.FAILED){u.size=v;u.loaded=t;s.trigger("UploadProgress",u)}});p.bind("Refresh",function(s){var t,u,v;t=b.getElementById(s.settings.browse_button);if(t){u=d.getPos(t,b.getElementById(s.settings.container));v=d.getSize(t);d.extend(b.getElementById(s.id+"_silverlight_container").style,{top:u.y+"px",left:u.x+"px",width:v.w+"px",height:v.h+"px"})}});p.bind("Silverlight:UploadChunkSuccessful",function(s,v,t,y,x){var w,u=s.getFile(r[v]);w={chunk:t,chunks:y,response:x};s.trigger("ChunkUploaded",u,w);if(u.status!=d.FAILED&&s.state!==d.STOPPED){j().UploadNextChunk()}if(t==y-1){u.status=d.DONE;s.trigger("FileUploaded",u,{response:x})}});p.bind("Silverlight:UploadSuccessful",function(s,v,t){var u=s.getFile(r[v]);u.status=d.DONE;s.trigger("FileUploaded",u,{response:t})});p.bind("FilesRemoved",function(s,u){var t;for(t=0;t - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/vendor/assets/javascripts/plupload/readme.md b/vendor/assets/javascripts/plupload/readme.md deleted file mode 100644 index 85f8111..0000000 --- a/vendor/assets/javascripts/plupload/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -Plupload - Cross browser and platform uploader API -=================================================== - -What is Plupload ------------------ -Plupload is a JavaScript API for dealing with file uploads it supports features like multiple file selection, file type filtering, -request chunking, client side image scaling and it uses different runtimes to achieve this such as HTML 5, Silverlight, Flash, Gears and BrowserPlus. - -What you need to build Plupload -------------------------------- -* Install the Java JDK or JRE packages you can find it at: [http://java.sun.com/javase/downloads/index.jsp](http://java.sun.com/javase/downloads/index.jsp) -* Install Apache Ant you can find it at: [http://ant.apache.org/](http://ant.apache.org/) -* Add Apache Ant to your systems path environment variable, this is not required but makes it easier to issue commands to Ant without having to type the full path for it. - -How to build Plupload ----------------------- - -In the root directory of Plupload where the build.xml file is you can run ant against different targets. - -`ant` - -Will combine, preprocess and minify the Plupload classes into the js directory. It will not build the Silverlight and Flash .xap and .swf files. - -`ant moxiedoc` - -Will generate API Documentation for the project using the Moxiedoc tool. The docs will be generated to the docs/api directory. - -`ant release` - -Will produce release packages. The release packages will be placed in the tmp directory. - -How to build Flash runtime ---------------------------- -The Flash runtime uses a .swf file that can be built using the Flex SDK. This SDK can be downloaded from Adobe. [http://www.adobe.com/products/flex/flexdownloads/](http://www.adobe.com/products/flex/flexdownloads/) - -How to build Silverlight runtime ---------------------------------- -The Silverlight runtime uses a .xap file that can be built using the Silverlight SDK or Visual Studio. [http://silverlight.net/getstarted/](http://silverlight.net/getstarted/) - -Running the development version --------------------------------- -The unminified development version of the javascript files can be executed by opening the examples/queue_widget_dev.html file running on a Web Server. - -Contributing to the Plupload project -------------------------------------- -You can read more about how to contribute to this project at [http://www.plupload.com/contributing](http://www.plupload.com/contributing) diff --git a/vendor/plugins/acts_as_permissible/.gitignore b/vendor/plugins/acts_as_permissible/.gitignore deleted file mode 100644 index 496ee2c..0000000 --- a/vendor/plugins/acts_as_permissible/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.DS_Store \ No newline at end of file diff --git a/vendor/plugins/acts_as_permissible/MIT-LICENSE b/vendor/plugins/acts_as_permissible/MIT-LICENSE deleted file mode 100644 index 8eaf6db..0000000 --- a/vendor/plugins/acts_as_permissible/MIT-LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2008 [name of plugin creator] - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/plugins/acts_as_permissible/README b/vendor/plugins/acts_as_permissible/README deleted file mode 100644 index 061a979..0000000 --- a/vendor/plugins/acts_as_permissible/README +++ /dev/null @@ -1,68 +0,0 @@ -ActsAsPermissible -================= - -Source: -http://github.com/NoamB/acts_as_permissible/tree/master -More information at: -http://github.com/NoamB/acts_as_permissible/wikis - -This plugin enables any activerecord model to have permissions. -It provides a set of methods for querying the model's permissions. -In addition, the plugin can generate roles support, which turns in into a full RBAC (Role Based Access Control) solution. - -Any model which includes the line "acts_as_permissible" can have permissions, and with roles support it can also have roles which in turn have their own permissions. -Roles can also belong to roles, which creates a sort of inheritance hierarchy. -When permissions are calculated, the model's permissions are merged with the model's role permissions (if any), which in turn are merged with the role's roles permissions, until a finite permissions hash is generated. - -In the case of identical keys, a false value overrides a true value, A true value overrides a nil value, and a nil value is false. - -Setup -===== -script/generate permissible [RoleModelName] - -The role model name is optional. If you do not want the roles support generated, use the --skip-roles option. - -examples: script/generate permissible Permission Role - script/generate permissible Permission Group - script/generate permissible Allowance --skip-roles - -use --skip-migration if you don't want a migration created for the permissions model. - -use --rspec to force rspec tests installed (currenty these are the only ones available). - -Add any permissions you want to your permissions table. -Add any roles you want to your roles table. -Add user->role relationships in your roles_memberships table. -Add role->role relationships in your roles_memberships table. - -Usage -===== - - class User < Activerecord::Base - acts_as_permissible - end - -Now a user will have the following methods: - - @user.permissions_hash() # => {:view_something => true, :delete_something => false} - - @user.has_permission?("view_something") # => true - @user.has_permission?("view_something", "delete_something") # => false - @user.has_permission?("delete_something") # => false - @user.has_permission?("create_something") # => false - - @user.permissions_hash() # => {:view_something => true, :delete_something => false} - @user.permissions << Permission.new(:action => "new_thing", :granted => true) - @user.permissions_hash() # => {:view_something => true, :delete_something => false} - @user.reload_permissions!() # => {:view_something => true, :delete_something => false, :new_thing => true} - @user.permissions_hash() # => {:view_something => true, :delete_something => false, :new_thing => true} - # this is useful for getting the hash again into memory after the permissions table was updated. - -And with roles support: - - @user.in_role?("publisher") # => true - @user.in_role?("publisher","advertiser") # => false - @user.in_any_role?("publisher","advertiser") => true - @user.full_permissions_hash() # will return a merged hash of user and roles permissions. - -Copyright (c) 2008 Noam Ben-Ari, released under the MIT license \ No newline at end of file diff --git a/vendor/plugins/acts_as_permissible/Rakefile b/vendor/plugins/acts_as_permissible/Rakefile deleted file mode 100644 index c03c468..0000000 --- a/vendor/plugins/acts_as_permissible/Rakefile +++ /dev/null @@ -1,22 +0,0 @@ -require 'rake' -require 'rake/testtask' -require 'rake/rdoctask' - -desc 'Default: run unit tests.' -task :default => :test - -desc 'Test the acts_as_permissible plugin.' -Rake::TestTask.new(:test) do |t| - t.libs << 'lib' - t.pattern = 'test/**/*_test.rb' - t.verbose = true -end - -desc 'Generate documentation for the acts_as_permissible plugin.' -Rake::RDocTask.new(:rdoc) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'ActsAsPermissible' - rdoc.options << '--line-numbers' << '--inline-source' - rdoc.rdoc_files.include('README') - rdoc.rdoc_files.include('lib/**/*.rb') -end diff --git a/vendor/plugins/acts_as_permissible/generators/permissible/USAGE b/vendor/plugins/acts_as_permissible/generators/permissible/USAGE deleted file mode 100644 index bd6a692..0000000 --- a/vendor/plugins/acts_as_permissible/generators/permissible/USAGE +++ /dev/null @@ -1 +0,0 @@ -./script/generate permissible [RolesModelName | --skip-roles] [--skip-migrations] [--rspec] \ No newline at end of file diff --git a/vendor/plugins/acts_as_permissible/generators/permissible/permissible_generator.rb b/vendor/plugins/acts_as_permissible/generators/permissible/permissible_generator.rb deleted file mode 100644 index c879f3b..0000000 --- a/vendor/plugins/acts_as_permissible/generators/permissible/permissible_generator.rb +++ /dev/null @@ -1,154 +0,0 @@ -#require 'acts_as_permissible/rails_commands' -class PermissibleGenerator < Rails::Generator::NamedBase - default_options :skip_migrations => false, :skip_timestamps => false - - attr_reader :role_model_name - attr_reader :role_model_file_name - attr_reader :role_membership_model_name - attr_reader :role_membership_model_file_name - - def initialize(runtime_args, runtime_options = {}) - super - - unless options[:skip_roles] - if @args.first.blank? - puts "No Roles model name supplied! Please use --skip-roles if you do not want roles support generated." - exit() - end - @role_model_name = @args.first - @role_model_file_name = role_model_name.underscore - @role_membership_model_name = role_model_name + "Membership" - @role_membership_model_file_name = role_membership_model_name.underscore - end - - @rspec = has_rspec? - end - - def manifest - recorded_session = record do |m| - m.directory File.join('app/models', class_path) - - if @rspec - m.directory File.join('spec/models', class_path) - m.directory File.join('spec/fixtures', class_path) - # else - # m.directory File.join('test/unit', class_path) - end - - m.template 'model.rb', - File.join('app/models', - class_path, - "#{file_name}.rb") - m.template 'acts_as_permissible.rb', - File.join('lib', - "acts_as_permissible.rb") - # m.template 'initializer.rb', - # File.join('config/initializers', - # "acts_as_permissible_init.rb") - unless options[:skip_roles] - m.template 'role_model.rb', - File.join('app/models', - "#{role_model_file_name}.rb") - m.template 'role_membership_model.rb', - File.join('app/models', - "#{role_membership_model_file_name}.rb") - end - - if @rspec - m.template 'model_spec.rb', - File.join('spec/models', - class_path, - "#{file_name}_spec.rb") - m.template 'fixtures.yml', - File.join('spec/fixtures', - "#{table_name}.yml") - m.template 'acts_as_permissible_spec.rb', - File.join('spec/models', - "acts_as_permissible_spec.rb") - unless options[:skip_roles] - m.template 'role_model_spec.rb', - File.join('spec/models', - "#{role_model_file_name}_spec.rb") - m.template 'role_membership_model_spec.rb', - File.join('spec/models', - "#{role_model_file_name}_membership_spec.rb") - m.template 'role_model_fixtures.yml', - File.join('spec/fixtures', - "#{role_model_file_name.pluralize}.yml") - m.template 'role_membership_model_fixtures.yml', - File.join('spec/fixtures', - "#{role_membership_model_file_name.pluralize}.yml") - end - # else - # m.template 'unit_test.rb', - # File.join('test/unit', - # class_path, - # "#{file_name}_test.rb") - # m.template 'fixtures.yml', - # File.join('test/fixtures', - # "#{table_name}.yml") - end - - unless options[:skip_migrations] - m.migration_template 'migration.rb', 'db/migrate', :assigns => { - :migration_name => "Create#{class_name.pluralize.gsub(/::/, '')}" - }, :migration_file_name => "create_#{file_name.pluralize}" - unless options[:skip_roles] - m.migration_template 'role_migration.rb', 'db/migrate', :assigns => { - :migration_name => "Create#{role_model_name.pluralize.gsub(/::/, '')}" - }, :migration_file_name => "create_#{role_model_file_name.pluralize}" - m.migration_template 'role_membership_migration.rb', 'db/migrate', :assigns => { - :migration_name => "Create#{role_membership_model_name.pluralize.gsub(/::/, '')}" - }, :migration_file_name => "create_#{role_membership_model_file_name.pluralize}" - end - end - end - - action = nil - action = $0.split("/")[1] - case action - when "generate" - puts - puts ("-" * 70) - puts - puts "acts_as_permissible" - puts - puts ("-" * 70) - puts - when "destroy" - puts - puts ("-" * 70) - puts - puts "Thanks for using acts_as_permissible" - puts - puts ("-" * 70) - puts - else - puts - end - - recorded_session - end - - def has_rspec? - options[:rspec] || (File.exist?('spec') && File.directory?('spec')) - end - - protected - def banner - "Usage: #{$0} permissible [RoleModelName]" - end - - def add_options!(opt) - opt.separator '' - opt.separator 'Options:' - opt.on("--skip-roles", - "Don't generate roles support") { |v| options[:skip_roles] = v } - opt.on("--skip-migrations", - "Don't generate migration files for these models") { |v| options[:skip_migrations] = v } - opt.on("--skip-timestamps", - "Don't add timestamps to the migration file for this model") { |v| options[:skip_timestamps] = v } - opt.on("--rspec", - "Force rspec mode (checks for RAILS_ROOT/spec by default)") { |v| options[:rspec] = true } - end -end \ No newline at end of file diff --git a/vendor/plugins/acts_as_permissible/generators/permissible/templates/acts_as_permissible.rb b/vendor/plugins/acts_as_permissible/generators/permissible/templates/acts_as_permissible.rb deleted file mode 100644 index c53af14..0000000 --- a/vendor/plugins/acts_as_permissible/generators/permissible/templates/acts_as_permissible.rb +++ /dev/null @@ -1,106 +0,0 @@ -# ActsAsPermissible -module NoamBenAri - module Acts #:nodoc: - module Permissible #:nodoc: - - def self.included(base) - base.extend ClassMethods - end - - module ClassMethods - def acts_as_permissible - has_many :<%= table_name %>, :as => :permissible, :dependent => :destroy - <% unless options[:skip_roles] %> - has_many :<%= role_membership_model_file_name.pluralize %>, :as => :roleable, :dependent => :destroy - has_many :<%= role_model_file_name.pluralize %>, :through => :<%= role_membership_model_file_name.pluralize %>, :source => :<%= role_model_file_name %> - <% end %> - include NoamBenAri::Acts::Permissible::InstanceMethods - extend NoamBenAri::Acts::Permissible::SingletonMethods - - alias_method :full_permissions_hash, :permissions_hash - end - end - - # This module contains class methods - module SingletonMethods - - # Helper method to lookup for permissions for a given object. - # This method is equivalent to obj.permissions. - def find_permissions_for(obj) - permissible = ActiveRecord::Base.send(:class_name_of_active_record_descendant, self).to_s - - <%= class_name %>.find(:all, - :conditions => ["permissible_id = ? and permissible_type = ?", obj.id, permissible] - ) - end - end - - # This module contains instance methods - module InstanceMethods - - # returns permissions in hash form - # from all levels recursively - def permissions_hash - @permissions_hash ||= lambda do - @permissions_hash = <%= table_name %>.inject({}) { |hsh,perm| hsh.merge(perm.to_hash) }.symbolize_keys! - <% unless options[:skip_roles] -%><%= role_model_file_name %>s.each do |<%= role_model_file_name %>| - merge_permissions!(<%= role_model_file_name %>.permissions_hash) - end - <% end -%>@permissions_hash - end.call() - end - - # accepts a permission identifier string or an array of permission identifier strings - # and return true if the user has all of the permissions given by the parameters - # false if not. - def has_permission?(*perms) - perms.all? {|perm| permissions_hash.include?(perm.to_sym) && (permissions_hash[perm.to_sym] == true) } - end - - # accepts a permission identifier string or an array of permission identifier strings - # and return true if the user has any of the permissions given by the parameters - # false if none. - def has_any_permission?(*perms) - perms.any? {|perm| permissions_hash.include?(perm.to_sym) && (permissions_hash[perm.to_sym] == true) } - end - - # Merges another permissible object's permissions into this permissible's permissions hash - # In the case of identical keys, a false value wins over a true value. - def merge_permissions!(other_permissions_hash) - permissions_hash.merge!(other_permissions_hash) {|key,oldval,newval| oldval.nil? ? newval : oldval && newval} - end - - # Resets permissions and then loads them. - def reload_permissions! - reset_permissions! - permissions_hash - end - <% unless options[:skip_roles] %> - def <%= role_model_file_name %>s_list - list = [] - <%= role_model_file_name %>s.inject(list) do |list,<%= role_model_file_name %>| - list << <%= role_model_file_name %>.name - <%= role_model_file_name %>.<%= role_model_file_name.pluralize %>_list.inject(list) {|list,<%= role_model_file_name %>| list << <%= role_model_file_name %>} - end - list.uniq - end - - def in_<%= role_model_file_name %>?(*<%= role_model_file_name %>_names) - <%= role_model_file_name %>_names.all? {|<%= role_model_file_name %>| <%= role_model_file_name %>s_list.include?(<%= role_model_file_name %>) } - end - - def in_any_<%= role_model_file_name %>?(*<%= role_model_file_name %>_names) - <%= role_model_file_name %>_names.any? {|<%= role_model_file_name %>| <%= role_model_file_name %>s_list.include?(<%= role_model_file_name %>) } - end - - <% end %> - private - # Nilifies permissions_hash instance variable. - def reset_permissions! - @permissions_hash = nil - end - - end - end - end -end diff --git a/vendor/plugins/acts_as_permissible/generators/permissible/templates/acts_as_permissible_spec.rb b/vendor/plugins/acts_as_permissible/generators/permissible/templates/acts_as_permissible_spec.rb deleted file mode 100644 index 46bcb3f..0000000 --- a/vendor/plugins/acts_as_permissible/generators/permissible/templates/acts_as_permissible_spec.rb +++ /dev/null @@ -1,208 +0,0 @@ -require File.dirname(__FILE__) + '/../spec_helper' - -class <%= class_name %> < ActiveRecord::Base - acts_as_permissible -end - -describe "acts_as_permissible" do - fixtures :<%= table_name %> - - before(:each) do - @perm = <%= table_name %>(:perm) - end - - describe "class methods" do - it "should find_permissions_for(obj) correctly" do - <%= class_name %>.find_permissions_for(@perm).size.should == 2 - <%= class_name %>.find_permissions_for(@perm).first.action.should == "view_something" - <%= class_name %>.find_permissions_for(@perm).last.action.should == "delete_something" - end - end - - describe "permissions_hash" do - it "should return the correct permissions_hash" do - @perm.permissions_hash.should == {:view_something => true, :delete_something => false} - end - end - - describe "has_permission?" do - it "should return true if permission found" do - @perm.has_permission?("view_something").should == true - end - - it "should return false if permission not found" do - @perm.has_permission?("create_something").should == false - end - - it "should return false if permission found and is denied" do - @perm.has_permission?("delete_something").should == false - end - end - - describe "merge_permissions!" do - before(:each) do - @perm2 = <%= table_name %>(:perm2) - @merged_permissions = @perm.merge_permissions!(@perm2.permissions_hash) - # {:update_something=>true, :view_something=>true, :delete_something=>false, :create_something=>false} - end - - it "should include all keys from both hashes" do - @merged_permissions.keys.should == - (@perm.permissions_hash.keys + @perm2.permissions_hash.keys).uniq - end - - it "should override identical keys with false value" do - @merged_permissions[:delete_something].should == false - end - end - - describe "reload_permissions!" do - before(:each) do - @original_hash = @perm.permissions_hash - @perm.<%= table_name %> << <%= class_name %>.new(:action => "add_something", :granted => true) - end - - it "should catch-up with database changes" do - @perm.permissions_hash.should == @original_hash - reloaded_hash = @perm.reload_permissions! - reloaded_hash.should_not == @original_hash - end - - it "should get the changes correctly" do - reloaded_hash = @perm.reload_permissions! - reloaded_hash.keys.should include(:add_something) - end - end - <% unless options[:skip_roles] %> - describe "<%= role_model_file_name.pluralize %>_list" do - before(:each) do - @perm.<%= role_model_file_name.pluralize %>_list.should == [] - @mutables = <%= role_model_name %>.new(:name => "mutables") - @mutables.save! - @wierdos = <%= role_model_name %>.new(:name => "wierdos") - @wierdos.save! - @mutables.<%= role_model_file_name.pluralize %> << @wierdos - end - - after(:each) do - @mutables.destroy - @wierdos.destroy - @perm.<%= role_model_file_name.pluralize %>.reset - @perm.<%= role_model_file_name.pluralize %>_list.should == [] - end - - it "should return the correct list" do - @perm.<%= role_model_file_name.pluralize %> << @wierdos - @perm.<%= role_model_file_name.pluralize %>_list.size.should == 1 - @perm.<%= role_model_file_name.pluralize %>_list.should include("wierdos") - end - - it "should return the correct list including parent <%= role_model_file_name.pluralize %> of <%= role_model_file_name.pluralize %> recursively." do - @perm.<%= role_model_file_name.pluralize %> << @mutables - @perm.<%= role_model_file_name.pluralize %>_list.size.should == 2 - @perm.<%= role_model_file_name.pluralize %>_list.should include("mutables") - @perm.<%= role_model_file_name.pluralize %>_list.should include("wierdos") - end - end - - describe "in_<%= role_model_file_name %>?" do - before(:each) do - @mutables = <%= role_model_name %>.new(:name => "mutables") - @mutables.save! - @immutables = <%= role_model_name %>.new(:name => "immutables") - @immutables.save! - end - - after(:each) do - @mutables.destroy - @immutables.destroy - @perm.<%= role_model_file_name.pluralize %>.reset - end - - it "should return true if member of one" do - @perm.<%= role_model_file_name.pluralize %> << @mutables - @perm.in_<%= role_model_file_name %>?("mutables").should == true - end - - it "should return false if not a member" do - @perm.in_<%= role_model_file_name %>?("mutables").should == false - end - - it "should return true if member of all" do - @perm.<%= role_model_file_name.pluralize %> << @mutables - @perm.<%= role_model_file_name.pluralize %> << @immutables - @perm.in_<%= role_model_file_name %>?("mutables","immutables").should == true - end - - it "should return false if member of some" do - @perm.<%= role_model_file_name.pluralize %> << @mutables - @perm.in_<%= role_model_file_name %>?("mutables","immutables").should == false - end - end - - describe "in_any_<%= role_model_file_name %>?" do - before(:each) do - @mutables = <%= role_model_name %>.new(:name => "mutables") - @mutables.save! - @immutables = <%= role_model_name %>.new(:name => "immutables") - @immutables.save! - end - - it "should return true if member of one" do - @perm.<%= role_model_file_name.pluralize %> << @mutables - @perm.in_any_<%= role_model_file_name %>?("mutables","immutables").should == true - end - - it "should return false if not a member" do - @perm.in_any_<%= role_model_file_name %>?("mutables","immutables").should == false - end - - it "should return true if member of all" do - @perm.<%= role_model_file_name.pluralize %> << @mutables - @perm.<%= role_model_file_name.pluralize %> << @immutables - @perm.in_any_<%= role_model_file_name %>?("mutables","immutables").should == true - end - end - - describe "full_permissions_hash" do - before(:each) do - @mutables = <%= role_model_name %>.new(:name => "mutables") - @mutables.save! - @mutable_permission = <%= class_name %>.new(:permissible_id => @mutables.id, :permissible_type => @mutables.class.to_s, :action => "view_something", :granted => false) - @mutable_permission.save! - @immutables = <%= role_model_name %>.new(:name => "immutables") - @immutables.save! - @immutable_permission = <%= class_name %>.new(:permissible_id => @immutables.id, :permissible_type => @immutables.class.to_s, :action => "download_something", :granted => true) - @immutable_permission.save! - end - - it "should return the correct hash if object doesn't belong to <%= role_model_file_name.pluralize %>" do - @perm.<%= role_model_file_name.pluralize %>.should == [] - @perm.full_permissions_hash.should == {:view_something=>true, :delete_something=>false} - end - - it "should return the correct hash if object belongs to one <%= role_model_file_name %>" do - @perm.<%= role_model_file_name.pluralize %> << @mutables - @perm.full_permissions_hash.should == {:view_something=>false, :delete_something=>false} - end - - it "should return the correct hash if object belongs to one <%= role_model_file_name %> which belongs to another <%= role_model_file_name %>" do - @mutables.<%= role_model_file_name.pluralize %> << @immutables - @perm.<%= role_model_file_name.pluralize %> << @mutables - @perm.full_permissions_hash.should == {:view_something=>false, :delete_something=>false, :download_something=>true} - end - - it "should return the correct hash if object belongs to 2 <%= role_model_file_name.pluralize %>" do - @perm.<%= role_model_file_name.pluralize %> << @immutables - @perm.<%= role_model_file_name.pluralize %> << @mutables - @perm.full_permissions_hash.should == {:view_something=>false, :delete_something=>false, :download_something=>true} - end - - after(:each) do - @mutables.destroy - @immutables.destroy - @perm.<%= role_model_file_name.pluralize %>.reset - end - end - <% end %> -end diff --git a/vendor/plugins/acts_as_permissible/generators/permissible/templates/fixtures.yml b/vendor/plugins/acts_as_permissible/generators/permissible/templates/fixtures.yml deleted file mode 100644 index 91b8af4..0000000 --- a/vendor/plugins/acts_as_permissible/generators/permissible/templates/fixtures.yml +++ /dev/null @@ -1,48 +0,0 @@ -one: - id: 1 - permissible_id: 7 - permissible_type: "<%= class_name %>" - action: "view_something" - granted: 1 -two: - id: 2 - permissible_id: 7 - permissible_type: "<%= class_name %>" - action: "delete_something" - granted: 0 -three: - id: 3 - permissible_id: 8 - permissible_type: "<%= class_name %>" - action: "view_something" - granted: 1 -four: - id: 4 - permissible_id: 8 - permissible_type: "<%= class_name %>" - action: "delete_something" - granted: 1 -five: - id: 5 - permissible_id: 8 - permissible_type: "<%= class_name %>" - action: "update_something" - granted: 1 -six: - id: 6 - permissible_id: 8 - permissible_type: "<%= class_name %>" - action: "create_something" - granted: 0 -perm: - id: 7 - permissible_id: 47 - permissible_type: "User" - action: "non_important" - granted: 1 -perm2: - id: 8 - permissible_id: 48 - permissible_type: "User" - action: "non_important" - granted: 1 \ No newline at end of file diff --git a/vendor/plugins/acts_as_permissible/generators/permissible/templates/initializer.rb b/vendor/plugins/acts_as_permissible/generators/permissible/templates/initializer.rb deleted file mode 100644 index 45e3480..0000000 --- a/vendor/plugins/acts_as_permissible/generators/permissible/templates/initializer.rb +++ /dev/null @@ -1,2 +0,0 @@ -require 'lib/acts_as_permissible' -ActiveRecord::Base.send(:include, NoamBenAri::Acts::Permissible) \ No newline at end of file diff --git a/vendor/plugins/acts_as_permissible/generators/permissible/templates/migration.rb b/vendor/plugins/acts_as_permissible/generators/permissible/templates/migration.rb deleted file mode 100644 index b7e798c..0000000 --- a/vendor/plugins/acts_as_permissible/generators/permissible/templates/migration.rb +++ /dev/null @@ -1,16 +0,0 @@ -class <%= migration_name %> < ActiveRecord::Migration - def self.up - create_table "<%= table_name %>", :force => true do |t| - t.integer :permissible_id - t.string :permissible_type - t.string :action - t.boolean :granted - - <% unless options[:skip_timestamps] %>t.timestamps<% end %> - end - end - - def self.down - drop_table "<%= table_name %>" - end -end \ No newline at end of file diff --git a/vendor/plugins/acts_as_permissible/generators/permissible/templates/model.rb b/vendor/plugins/acts_as_permissible/generators/permissible/templates/model.rb deleted file mode 100644 index e7f841c..0000000 --- a/vendor/plugins/acts_as_permissible/generators/permissible/templates/model.rb +++ /dev/null @@ -1,19 +0,0 @@ -class <%= class_name %> < ActiveRecord::Base - # uncomment any of the following lines which is relevant to your application, - # or create your own with the name of the model which acts_as_permissible. - #belongs_to :user - <% unless options[:skip_roles] %> - belongs_to :<%= role_model_file_name %> - <% end %> - belongs_to :permissible, :polymorphic => true - - validates_presence_of :permissible_id, :permissible_type, :action - validates_format_of :action, :with => /^[a-z_]+$/ - validates_numericality_of :permissible_id - validates_uniqueness_of :action, :scope => [:permissible_id,:permissible_type] - - def to_hash - self.new_record? ? {} : {self.action => self.granted} - end - -end \ No newline at end of file diff --git a/vendor/plugins/acts_as_permissible/generators/permissible/templates/model_spec.rb b/vendor/plugins/acts_as_permissible/generators/permissible/templates/model_spec.rb deleted file mode 100644 index 03853f5..0000000 --- a/vendor/plugins/acts_as_permissible/generators/permissible/templates/model_spec.rb +++ /dev/null @@ -1,51 +0,0 @@ -require File.dirname(__FILE__) + '/../spec_helper' - -describe <%= class_name %>, "to_hash" do - before(:each) do - @permission = <%= class_name %>.new(:permissible_id => 1, :permissible_type => "User", :action => "some_action", :granted => 1) - end - - it "to_hash returns {} if new record" do - @permission.to_hash.should == {} - end - - it "to_hash returns {action => granted}" do - @permission.save - @permission.to_hash.should == {"some_action" => true} - end - -end - -describe <%= class_name %>, "validations" do - before(:each) do - @permission = <%= class_name %>.new(:permissible_id => 1, :permissible_type => "User", :action => "some_action", :granted => 1) - end - - it "should be valid" do - @permission.should be_valid - end - - it "action should be unique to a permissible id and type" do - @permission.save - @permission2 = <%= class_name %>.new(:permissible_id => 1, :permissible_type => "User", :action => "some_action", :granted => 0) - @permission2.should_not be_valid - end - - it "must have a permissible_id" do - @permission.permissible_id = nil - @permission.should_not be_valid - end - - it "must have a permissible_type" do - @permission.permissible_type = nil - @permission.should_not be_valid - end - - it "must have an action" do - @permission.action = nil - @permission.should_not be_valid - @permission.action = "" - @permission.should_not be_valid - end - -end diff --git a/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_membership_migration.rb b/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_membership_migration.rb deleted file mode 100644 index b2239ec..0000000 --- a/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_membership_migration.rb +++ /dev/null @@ -1,15 +0,0 @@ -class <%= migration_name %> < ActiveRecord::Migration - def self.up - create_table :<%= role_membership_model_file_name %>s do |t| - t.integer :roleable_id - t.string :roleable_type - t.integer :<%= role_model_file_name %>_id - - <% unless options[:skip_timestamps] %>t.timestamps<% end %> - end - end - - def self.down - drop_table :<%= role_membership_model_file_name %>s - end -end \ No newline at end of file diff --git a/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_membership_model.rb b/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_membership_model.rb deleted file mode 100644 index e16a0d9..0000000 --- a/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_membership_model.rb +++ /dev/null @@ -1,36 +0,0 @@ -class <%= role_membership_model_name %> < ActiveRecord::Base - #belongs_to :user - belongs_to :<%= role_model_file_name %> - belongs_to :roleable, :polymorphic => true - - validates_presence_of :roleable_id, :roleable_type, :<%= role_model_file_name %>_id - validates_uniqueness_of :<%= role_model_file_name %>_id, :scope => [:roleable_id, :roleable_type] - validates_numericality_of :roleable_id, :<%= role_model_file_name %>_id - validates_format_of :roleable_type, :with => /^[A-Z]{1}[a-z0-9]+([A-Z]{1}[a-z0-9]+)*$/ - validate :<%= role_model_file_name %>_does_not_belong_to_itself_in_a_loop - - protected - def <%= role_model_file_name %>_does_not_belong_to_itself_in_a_loop - if roleable_type == "<%= role_model_name %>" - if <%= role_model_file_name %>_id == roleable_id - errors.add_to_base("A <%= role_model_file_name %> cannot belong to itself.") - else - if belongs_to_itself_through_other?(roleable_id, <%= role_model_file_name %>_id) - errors.add_to_base("A <%= role_model_file_name %> cannot belong to a <%= role_model_file_name %> which belongs to it.") - end - end - end - end - - def belongs_to_itself_through_other?(original_roleable_id, current_<%= role_model_file_name %>_id) - if self.class.find(:first, :select => "id", :conditions => ["roleable_id=? AND roleable_type='<%= role_model_name %>' AND <%= role_model_file_name %>_id=?",current_<%= role_model_file_name %>_id,original_roleable_id]) - return true - else - memberships = self.class.find(:all, :select => "<%= role_model_file_name %>_id", :conditions => ["roleable_id=? AND roleable_type='<%= role_model_name %>'",current_<%= role_model_file_name %>_id]) - if memberships.any? {|membership| belongs_to_itself_through_other?(original_roleable_id,membership.<%= role_model_file_name %>_id)} - return true - end - end - return false - end -end \ No newline at end of file diff --git a/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_membership_model_fixtures.yml b/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_membership_model_fixtures.yml deleted file mode 100644 index e9b1b31..0000000 --- a/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_membership_model_fixtures.yml +++ /dev/null @@ -1,25 +0,0 @@ -publishers_to_customers: - id: 1 - roleable_id: 1 - roleable_type: "<%= role_model_name %>" - <%= role_model_file_name %>_id: 3 -advertisers_to_customers: - id: 2 - roleable_id: 2 - roleable_type: "<%= role_model_name %>" - <%= role_model_file_name %>_id: 3 -admins_to_company: - id: 3 - roleable_id: 5 - roleable_type: "<%= role_model_name %>" - <%= role_model_file_name %>_id: 4 -company_to_admins: - id: 4 - roleable_id: 4 - roleable_type: "<%= role_model_name %>" - <%= role_model_file_name %>_id: 5 -publishers_to_company: - id: 5 - roleable_id: 1 - roleable_type: "<%= role_model_name %>" - <%= role_model_file_name %>_id: 4 \ No newline at end of file diff --git a/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_membership_model_spec.rb b/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_membership_model_spec.rb deleted file mode 100644 index 779217f..0000000 --- a/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_membership_model_spec.rb +++ /dev/null @@ -1,100 +0,0 @@ -require File.dirname(__FILE__) + '/../spec_helper' - -describe "<%= role_membership_model_name %>" do - - describe "validations" do - before(:all) do - @<%= role_model_file_name.pluralize %> = [] - @<%= role_model_file_name.pluralize %>[0] = <%= role_model_name %>.new(:name => "<%= role_model_file_name %>0") - @<%= role_model_file_name.pluralize %>[1] = <%= role_model_name %>.new(:name => "<%= role_model_file_name %>1") - @<%= role_model_file_name.pluralize %>[2] = <%= role_model_name %>.new(:name => "<%= role_model_file_name %>2") - @<%= role_model_file_name.pluralize %>[3] = <%= role_model_name %>.new(:name => "<%= role_model_file_name %>3") - @<%= role_model_file_name.pluralize %>[4] = <%= role_model_name %>.new(:name => "<%= role_model_file_name %>4") - @<%= role_model_file_name.pluralize %>[5] = <%= role_model_name %>.new(:name => "<%= role_model_file_name %>5") - @<%= role_model_file_name.pluralize %>[6] = <%= role_model_name %>.new(:name => "<%= role_model_file_name %>6") - @<%= role_model_file_name.pluralize %>[7] = <%= role_model_name %>.new(:name => "<%= role_model_file_name %>7") - @<%= role_model_file_name.pluralize %>[8] = <%= role_model_name %>.new(:name => "<%= role_model_file_name %>8") - @<%= role_model_file_name.pluralize %>[9] = <%= role_model_name %>.new(:name => "<%= role_model_file_name %>9") - @<%= role_model_file_name.pluralize %>[10] = <%= role_model_name %>.new(:name => "<%= role_model_file_name %>10") - @<%= role_model_file_name.pluralize %>[11] = <%= role_model_name %>.new(:name => "<%= role_model_file_name %>11") - @<%= role_model_file_name.pluralize %>.each {|<%= role_model_file_name %>| <%= role_model_file_name %>.save!} - end - - before(:each) do - @membership = <%= role_membership_model_name %>.new(:roleable_id => @<%= role_model_file_name.pluralize %>[0].id, :roleable_type => "<%= role_model_name %>", :<%= role_model_file_name %>_id => @<%= role_model_file_name.pluralize %>[1].id) - end - - it "should be valid" do - @membership.should be_valid - end - - # roleable_id - it "should have a roleable_id" do - @membership.roleable_id = nil - @membership.should_not be_valid - end - - it "roleable_id should be an integer" do - @membership.roleable_id = "asd" - @membership.should_not be_valid - end - - # roleable_type - it "should have a roleable_type" do - @membership.roleable_type = nil - @membership.should_not be_valid - end - - it "roleable_type should be a string" do - @membership.roleable_type = 123 - @membership.should_not be_valid - end - - it "roleable_type should have a class name format" do - @membership.roleable_type = "asd" - @membership.should_not be_valid - @membership.roleable_type = "User" - @membership.should be_valid - @membership.roleable_type = "Some95WierdClassN4m3" - @membership.should be_valid - end - - # <%= role_model_file_name %>_id - it "should have a <%= role_model_file_name %>_id" do - @membership.<%= role_model_file_name %>_id = nil - @membership.should_not be_valid - end - - it "<%= role_model_file_name %>_id should be an integer" do - @membership.<%= role_model_file_name %>_id = "asd" - @membership.should_not be_valid - end - - it "should not allow a <%= role_model_file_name %> to belong to itself" do - @membership.<%= role_model_file_name %>_id = @<%= role_model_file_name.pluralize %>[0].id - @membership.should_not be_valid - end - - # <%= role_model_file_name.pluralize %> cannot belong to each other in a loop - it "should not a allow a <%= role_model_file_name %> to belong to a <%= role_model_file_name %> which belongs to it in a loop" do - @<%= role_model_file_name.pluralize %>[0].<%= role_model_file_name.pluralize %> << @<%= role_model_file_name.pluralize %>[1] - @<%= role_model_file_name.pluralize %>[1].<%= role_model_file_name.pluralize %> << @<%= role_model_file_name.pluralize %>[2] - @<%= role_model_file_name.pluralize %>[2].<%= role_model_file_name.pluralize %> << @<%= role_model_file_name.pluralize %>[3] - @<%= role_model_file_name.pluralize %>[2].<%= role_model_file_name.pluralize %> << @<%= role_model_file_name.pluralize %>[4] - @<%= role_model_file_name.pluralize %>[2].<%= role_model_file_name.pluralize %> << @<%= role_model_file_name.pluralize %>[5] - @<%= role_model_file_name.pluralize %>[3].<%= role_model_file_name.pluralize %> << @<%= role_model_file_name.pluralize %>[6] - @<%= role_model_file_name.pluralize %>[1].<%= role_model_file_name.pluralize %> << @<%= role_model_file_name.pluralize %>[7] - @<%= role_model_file_name.pluralize %>[3].<%= role_model_file_name.pluralize %> << @<%= role_model_file_name.pluralize %>[8] - @<%= role_model_file_name.pluralize %>[4].<%= role_model_file_name.pluralize %> << @<%= role_model_file_name.pluralize %>[9] - @<%= role_model_file_name.pluralize %>[4].<%= role_model_file_name.pluralize %> << @<%= role_model_file_name.pluralize %>[10] - @<%= role_model_file_name.pluralize %>[5].<%= role_model_file_name.pluralize %> << @<%= role_model_file_name.pluralize %>[11] - @membership3 = <%= role_membership_model_name %>.new(:roleable_id => @<%= role_model_file_name.pluralize %>[11].id, :roleable_type => "<%= role_model_name %>", :<%= role_model_file_name %>_id => @<%= role_model_file_name.pluralize %>[0].id) - @membership3.should_not be_valid - @membership3.errors.full_messages.should include("A <%= role_model_file_name %> cannot belong to a <%= role_model_file_name %> which belongs to it.") - end - - after(:all) do - @<%= role_model_file_name.pluralize %>.each {|<%= role_model_file_name %>| <%= role_model_file_name %>.destroy} - end - end -end \ No newline at end of file diff --git a/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_migration.rb b/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_migration.rb deleted file mode 100644 index 51a521c..0000000 --- a/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_migration.rb +++ /dev/null @@ -1,13 +0,0 @@ -class <%= migration_name %> < ActiveRecord::Migration - def self.up - create_table :<%= role_model_file_name %>s do |t| - t.string :name - - <% unless options[:skip_timestamps] %>t.timestamps<% end %> - end - end - - def self.down - drop_table :<%= role_model_file_name %>s - end -end \ No newline at end of file diff --git a/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_model.rb b/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_model.rb deleted file mode 100644 index 80ebade..0000000 --- a/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_model.rb +++ /dev/null @@ -1,12 +0,0 @@ -class <%= role_model_name %> < ActiveRecord::Base - has_many :<%= role_membership_model_file_name %>s, :as => :roleable, :dependent => :destroy - has_many :<%= role_model_file_name %>s, :through => :<%= role_membership_model_file_name %>s, :source => :<%= role_model_file_name %> - - has_many :roleables, :class_name => "<%= role_membership_model_name %>", :foreign_key => "<%= role_model_file_name %>_id", :dependent => :destroy - has_many :sub<%= role_model_file_name %>s, :through => :roleables, :source => :roleable, :source_type => '<%= role_model_name %>' - #has_many :users, :through => :roleables, :source => :roleable, :source_type => 'User' - - validates_uniqueness_of :name - - acts_as_permissible -end \ No newline at end of file diff --git a/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_model_fixtures.yml b/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_model_fixtures.yml deleted file mode 100644 index 36843a3..0000000 --- a/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_model_fixtures.yml +++ /dev/null @@ -1,15 +0,0 @@ -publishers: - id: 1 - name: "Publishers" -advertisers: - id: 2 - name: "Advertisers" -customers: - id: 3 - name: "Customers" -company: - id: 4 - name: "Company" -admins: - id: 5 - name: "Admins" \ No newline at end of file diff --git a/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_model_spec.rb b/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_model_spec.rb deleted file mode 100644 index 4ea2f1d..0000000 --- a/vendor/plugins/acts_as_permissible/generators/permissible/templates/role_model_spec.rb +++ /dev/null @@ -1,53 +0,0 @@ -require File.dirname(__FILE__) + '/../spec_helper' - -describe "<%= role_model_name %>" do - - describe "validations" do - before(:each) do - @<%= role_model_file_name %> = <%= role_model_name %>.new(:name => "Hunters") - end - - it "should be valid" do - @<%= role_model_file_name %>.should be_valid - end - - it "should have a unique name" do - @<%= role_model_file_name %>.save - @<%= role_model_file_name %>2 = <%= role_model_name %>.new(:name => "Hunters") - @<%= role_model_file_name %>2.should_not be_valid - end - end - - describe "associations" do - fixtures :<%= role_model_file_name %>s, :<%= role_membership_model_file_name %>s - - it "should get subgroups correctly" do - <%= role_model_file_name %>s(:company).sub<%= role_model_file_name %>s.size.should == 2 - arr = [] - arr << <%= role_model_file_name %>s(:publishers) - arr << <%= role_model_file_name %>s(:admins) - <%= role_model_file_name %>s(:company).sub<%= role_model_file_name %>s.should include(arr.first) - <%= role_model_file_name %>s(:company).sub<%= role_model_file_name %>s.should include(arr.last) - - <%= role_model_file_name %>s(:customers).sub<%= role_model_file_name %>s.size.should == 2 - arr = [] - arr << <%= role_model_file_name %>s(:publishers) - arr << <%= role_model_file_name %>s(:advertisers) - <%= role_model_file_name %>s(:customers).sub<%= role_model_file_name %>s.should include(arr.first) - <%= role_model_file_name %>s(:customers).sub<%= role_model_file_name %>s.should include(arr.last) - end - - it "should get <%= role_model_file_name %>s correctly" do - <%= role_model_file_name %>s(:publishers).<%= role_model_file_name %>s.size.should == 2 - arr = [] - arr << <%= role_model_file_name %>s(:customers) - arr << <%= role_model_file_name %>s(:company) - <%= role_model_file_name %>s(:publishers).<%= role_model_file_name %>s.should == arr - - <%= role_model_file_name %>s(:admins).<%= role_model_file_name %>s.size.should == 1 - arr = [] - arr << <%= role_model_file_name %>s(:company) - <%= role_model_file_name %>s(:admins).<%= role_model_file_name %>s.should == arr - end - end -end \ No newline at end of file diff --git a/vendor/plugins/acts_as_permissible/init.rb b/vendor/plugins/acts_as_permissible/init.rb deleted file mode 100644 index d672ff1..0000000 --- a/vendor/plugins/acts_as_permissible/init.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Include hook code here -begin - require "#{Rails.root.to_s}/lib/acts_as_permissible" - ActiveRecord::Base.send(:include, NoamBenAri::Acts::Permissible) -rescue MissingSourceFile => m - -end \ No newline at end of file diff --git a/vendor/plugins/acts_as_permissible/install.rb b/vendor/plugins/acts_as_permissible/install.rb deleted file mode 100644 index bd23f1b..0000000 --- a/vendor/plugins/acts_as_permissible/install.rb +++ /dev/null @@ -1 +0,0 @@ -puts IO.read(File.join(File.dirname(__FILE__), 'README')) diff --git a/vendor/plugins/acts_as_permissible/lib/tasks/acts_as_permissible_tasks.rake b/vendor/plugins/acts_as_permissible/lib/tasks/acts_as_permissible_tasks.rake deleted file mode 100644 index 525689c..0000000 --- a/vendor/plugins/acts_as_permissible/lib/tasks/acts_as_permissible_tasks.rake +++ /dev/null @@ -1,4 +0,0 @@ -# desc "Explaining what the task does" -# task :acts_as_permissible do -# # Task goes here -# end diff --git a/vendor/plugins/acts_as_permissible/test/acts_as_permissible_test.rb b/vendor/plugins/acts_as_permissible/test/acts_as_permissible_test.rb deleted file mode 100644 index 0099037..0000000 --- a/vendor/plugins/acts_as_permissible/test/acts_as_permissible_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'test/unit' - -class ActsAsPermissibleTest < Test::Unit::TestCase - # Replace this with your real tests. - def test_this_plugin - flunk - end -end diff --git a/vendor/plugins/acts_as_permissible/uninstall.rb b/vendor/plugins/acts_as_permissible/uninstall.rb deleted file mode 100644 index 9738333..0000000 --- a/vendor/plugins/acts_as_permissible/uninstall.rb +++ /dev/null @@ -1 +0,0 @@ -# Uninstall hook code here