refinerycms-photo-gallery 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/Changelog.md +11 -0
- data/Gemfile +35 -17
- data/Gemfile.lock +301 -0
- data/LICENSE.md +0 -0
- data/README.md +63 -13
- data/Rakefile +3 -2
- data/app/assets/images/refinery/photo_gallery/admin/chosen-sprite.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/album.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/album_add.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/album_edit.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/cog.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/down.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/folder.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/folder_add.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/folder_edit.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/loading.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/page_copy.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/photo.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/photo_add.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/photo_edit.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/up.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/backgrounds.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/buttons-disabled.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/buttons.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/delete.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/done.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/error.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/throbber.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/transp50.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/plupload-bw.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/plupload.png +0 -0
- data/app/assets/images/refinery/photo_gallery/fancybox/blank.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/fancybox/fancybox_loading.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/fancybox/fancybox_sprite.png +0 -0
- data/app/assets/images/refinery/photo_gallery/fancybox/helpers/fancybox_buttons.png +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/jquery.chosen.min.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/photo_gallery.js.erb +46 -46
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/Moxie.swf +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/Moxie.xap +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/changelog.txt +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ar.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/az.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/bg.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/bs.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ca.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/cs.js +2 -14
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/cy.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/da.js +2 -12
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/de.js +2 -24
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/el.js +2 -14
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/en.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/es.js +2 -25
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/et.js +2 -33
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fa.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fi.js +2 -33
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fr-ca.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fr.js +2 -25
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/he.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/hr.js +2 -25
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/hu.js +2 -33
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/hy.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/id.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/it.js +2 -24
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ja.js +2 -37
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ka.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/kk.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/km.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ko.js +2 -36
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ku_IQ.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/lt.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/lv.js +2 -33
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ms.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/nl.js +2 -21
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/pl.js +2 -24
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/pt-br.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/pt.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/pt_BR.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ro.js +2 -24
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ru.js +2 -21
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sk.js +2 -37
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sl.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sq.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sr.js +2 -14
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sv.js +2 -12
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/th_TH.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/tr.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/uk_UA.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/vi.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/zh_CN.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/zh_TW.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/css/jquery.plupload.queue.css +185 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/img/backgrounds.gif +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/img/buttons-disabled.png +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/img/buttons.png +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/img/delete.gif +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/img/done.gif +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/img/error.gif +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/img/throbber.gif +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/img/transp50.png +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/jquery.plupload.queue.js +428 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/jquery.plupload.queue.min.js +1 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.ui.plupload.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/css/jquery.ui.plupload.css +375 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/img/loading.gif +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/img/plupload.png +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/jquery.ui.plupload.js +1343 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/jquery.ui.plupload.min.js +1 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/license.txt +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/moxie.js +11158 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/moxie.min.js +16 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.browserplus.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.dev.js +2381 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.flash.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.flash.swf +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.full.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.full.js.default +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.full.min.js +29 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.gears.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.html4.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.html5.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.html5.js.default +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.min.js +13 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.silverlight.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.silverlight.xap +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/readme.md +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/CHANGELOG.md +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/README.md +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-buttons.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-media.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-thumbs.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/jquery.fancybox.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/jquery.fancybox.pack.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/lib/jquery.mousewheel-3.0.6.pack.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/photo_gallery.js +0 -0
- data/app/assets/stylesheets/refinery/photo_gallery/admin/chosen.css.scss +262 -262
- data/app/assets/stylesheets/refinery/photo_gallery/admin/photo_gallery.css.scss +1 -13
- data/app/assets/stylesheets/refinery/photo_gallery/admin/plupload/jquery.plupload.queue.css.scss +0 -0
- data/app/assets/stylesheets/refinery/photo_gallery/admin/plupload/jquery.ui.plupload.css.scss +0 -0
- data/app/assets/stylesheets/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-buttons.css.scss +0 -0
- data/app/assets/stylesheets/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-thumbs.css +0 -0
- data/app/assets/stylesheets/refinery/photo_gallery/fancybox/jquery.fancybox.css.scss +0 -0
- data/app/controllers/refinery/photo_gallery/admin/albums_controller.rb +10 -3
- data/app/controllers/refinery/photo_gallery/admin/collections_controller.rb +8 -0
- data/app/controllers/refinery/photo_gallery/admin/photos_controller.rb +19 -8
- data/app/helpers/refinery/photo_gallery/admin/photos_helper.rb +5 -1
- data/app/helpers/refinery/photo_gallery/albums_helper.rb +0 -0
- data/app/helpers/refinery/photo_gallery/photo_gallery_helper.rb +0 -0
- data/app/models/refinery/album_page.rb +0 -1
- data/app/models/refinery/photo_gallery/album.rb +0 -2
- data/app/models/refinery/photo_gallery/collection.rb +0 -2
- data/app/models/refinery/photo_gallery/collection_album.rb +0 -0
- data/app/models/refinery/photo_gallery/photo.rb +14 -16
- data/app/sweepers/refinery/admin/album_page_sweeper.rb +0 -0
- data/app/sweepers/refinery/photo_gallery/admin/album_sweeper.rb +0 -0
- data/app/sweepers/refinery/photo_gallery/admin/photo_sweeper.rb +0 -0
- data/app/uploaders/refinery/photo_gallery/admin/file_uploader.rb +7 -1
- data/app/views/refinery/admin/pages/tabs/_form.html.erb +0 -0
- data/app/views/refinery/admin/pages/tabs/_photo_gallery.html.erb +0 -0
- data/app/views/refinery/admin/pages/tabs/_photo_pages_bar.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/_submenu.html.erb +4 -30
- data/app/views/refinery/photo_gallery/admin/albums/_album.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/albums/_albums.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/albums/_form.html.erb +1 -2
- data/app/views/refinery/photo_gallery/admin/albums/edit.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/albums/index.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/albums/new.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/collections/_collection.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/collections/_collections.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/collections/_form.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/collections/edit.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/collections/index.html.erb +1 -0
- data/app/views/refinery/photo_gallery/admin/collections/new.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/photos/_destroy.js.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/photos/_form.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/photos/_form_actions.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/photos/_form_fields.html.erb +1 -0
- data/app/views/refinery/photo_gallery/admin/photos/_form_fields_actions.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/photos/edit_multiple.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/photos/upload.html.erb +4 -3
- data/app/views/refinery/photo_gallery/albums/_photos.html.erb +6 -2
- data/app/views/refinery/photo_gallery/albums/_photos.js.erb +0 -0
- data/app/views/refinery/photo_gallery/albums/_show.html.erb +0 -0
- data/config/initializers/carrierwave.rb +0 -0
- data/config/initializers/form_builder.rb +0 -0
- data/config/initializers/refinery/core.rb +0 -0
- data/config/initializers/s3.rb +0 -0
- data/config/locales/en.yml +2 -2
- data/config/locales/pl.yml +110 -0
- data/config/locales/sk.yml +2 -2
- data/config/routes.rb +0 -0
- data/db/migrate/20120804063842_create_albums.rb +0 -0
- data/db/migrate/20120805131321_create_collections.rb +0 -0
- data/db/migrate/20120805131547_create_collection_albums.rb +0 -0
- data/db/migrate/20120805165238_create_photos.rb +0 -0
- data/db/migrate/20120805222125_add_indexes.rb +2 -2
- data/db/migrate/20120805222126_create_album_pages.rb +0 -0
- data/db/migrate/20130127175559_add_url_to_photos.rb +5 -0
- data/db/migrate/20130128173800_add_css_styles_and_show_original_fields_to_photos.rb +6 -0
- data/db/seeds.rb +0 -0
- data/lib/generators/refinery/photo_gallery_generator.rb +5 -2
- data/lib/generators/refinery/templates/config/initializers/refinery/photo_gallery.rb.erb +3 -2
- data/lib/refinery/photo_gallery.rb +0 -1
- data/lib/refinery/photo_gallery/configuration.rb +7 -1
- data/lib/refinery/photo_gallery/engine.rb +0 -1
- data/lib/refinery/photo_gallery/extensions/pages_controller_extension.rb +0 -0
- data/lib/refinery/photo_gallery/extensions/pages_extension.rb +4 -12
- data/lib/refinery/photo_gallery/version.rb +2 -2
- data/lib/refinerycms-photo-gallery.rb +0 -0
- data/refinerycms-photo-gallery.gemspec +2 -3
- data/spec/factories/album_photos.rb +5 -0
- data/spec/factories/albums.rb +23 -0
- data/spec/factories/collections.rb +6 -0
- data/spec/factories/photos.rb +12 -0
- data/spec/factories/user.rb +27 -0
- data/spec/features/manage_albums_spec.rb +93 -0
- data/spec/features/manage_collections_spec.rb +62 -0
- data/spec/features/manage_photos_spec.rb +47 -0
- data/spec/spec_helper.rb +32 -0
- data/spec/support/images/refinery-logo-trans.png +0 -0
- data/tasks/rspec.rake +6 -0
- data/tasks/testing.rake +8 -0
- metadata +110 -63
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/img/done.gif
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,428 @@
|
|
1
|
+
/**
|
2
|
+
* jquery.plupload.queue.js
|
3
|
+
*
|
4
|
+
* Copyright 2009, Moxiecode Systems AB
|
5
|
+
* Released under GPL License.
|
6
|
+
*
|
7
|
+
* License: http://www.plupload.com/license
|
8
|
+
* Contributing: http://www.plupload.com/contributing
|
9
|
+
*/
|
10
|
+
|
11
|
+
/* global jQuery:true, alert:true */
|
12
|
+
|
13
|
+
/**
|
14
|
+
jQuery based implementation of the Plupload API - multi-runtime file uploading API.
|
15
|
+
|
16
|
+
To use the widget you must include _jQuery_. It is not meant to be extended in any way and is provided to be
|
17
|
+
used as it is.
|
18
|
+
|
19
|
+
@example
|
20
|
+
<!-- Instantiating: -->
|
21
|
+
<div id="uploader">
|
22
|
+
<p>Your browser doesn't have Flash, Silverlight or HTML5 support.</p>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<script>
|
26
|
+
$('#uploader').pluploadQueue({
|
27
|
+
url : '../upload.php',
|
28
|
+
filters : [
|
29
|
+
{title : "Image files", extensions : "jpg,gif,png"}
|
30
|
+
],
|
31
|
+
rename: true,
|
32
|
+
flash_swf_url : '../../js/Moxie.swf',
|
33
|
+
silverlight_xap_url : '../../js/Moxie.xap',
|
34
|
+
});
|
35
|
+
</script>
|
36
|
+
|
37
|
+
@example
|
38
|
+
// Retrieving a reference to plupload.Uploader object
|
39
|
+
var uploader = $('#uploader').pluploadQueue();
|
40
|
+
|
41
|
+
uploader.bind('FilesAdded', function() {
|
42
|
+
|
43
|
+
// Autostart
|
44
|
+
setTimeout(uploader.start, 1); // "detach" from the main thread
|
45
|
+
});
|
46
|
+
|
47
|
+
@class pluploadQueue
|
48
|
+
@constructor
|
49
|
+
@param {Object} settings For detailed information about each option check documentation.
|
50
|
+
@param {String} settings.url URL of the server-side upload handler.
|
51
|
+
@param {Number|String} [settings.chunk_size=0] Chunk size in bytes to slice the file into. Shorcuts with b, kb, mb, gb, tb suffixes also supported. `e.g. 204800 or "204800b" or "200kb"`. By default - disabled.
|
52
|
+
@param {String} [settings.file_data_name="file"] Name for the file field in Multipart formated message.
|
53
|
+
@param {Array} [settings.filters=[]] Set of file type filters, each one defined by hash of title and extensions. `e.g. {title : "Image files", extensions : "jpg,jpeg,gif,png"}`. Dispatches `plupload.FILE_EXTENSION_ERROR`
|
54
|
+
@param {String} [settings.flash_swf_url] URL of the Flash swf.
|
55
|
+
@param {Object} [settings.headers] Custom headers to send with the upload. Hash of name/value pairs.
|
56
|
+
@param {Number|String} [settings.max_file_size] Maximum file size that the user can pick, in bytes. Optionally supports b, kb, mb, gb, tb suffixes. `e.g. "10mb" or "1gb"`. By default - not set. Dispatches `plupload.FILE_SIZE_ERROR`.
|
57
|
+
@param {Number} [settings.max_retries=0] How many times to retry the chunk or file, before triggering Error event.
|
58
|
+
@param {Boolean} [settings.multipart=true] Whether to send file and additional parameters as Multipart formated message.
|
59
|
+
@param {Object} [settings.multipart_params] Hash of key/value pairs to send with every file upload.
|
60
|
+
@param {Boolean} [settings.multi_selection=true] Enable ability to select multiple files at once in file dialog.
|
61
|
+
@param {Boolean} [settings.prevent_duplicates=false] Do not let duplicates into the queue. Dispatches `plupload.FILE_DUPLICATE_ERROR`.
|
62
|
+
@param {String|Object} [settings.required_features] Either comma-separated list or hash of required features that chosen runtime should absolutely possess.
|
63
|
+
@param {Object} [settings.resize] Enable resizng of images on client-side. Applies to `image/jpeg` and `image/png` only. `e.g. {width : 200, height : 200, quality : 90, crop: true}`
|
64
|
+
@param {Number} [settings.resize.width] If image is bigger, it will be resized.
|
65
|
+
@param {Number} [settings.resize.height] If image is bigger, it will be resized.
|
66
|
+
@param {Number} [settings.resize.quality=90] Compression quality for jpegs (1-100).
|
67
|
+
@param {Boolean} [settings.resize.crop=false] Whether to crop images to exact dimensions. By default they will be resized proportionally.
|
68
|
+
@param {String} [settings.runtimes="html5,flash,silverlight,html4"] Comma separated list of runtimes, that Plupload will try in turn, moving to the next if previous fails.
|
69
|
+
@param {String} [settings.silverlight_xap_url] URL of the Silverlight xap.
|
70
|
+
@param {Boolean} [settings.unique_names=false] If true will generate unique filenames for uploaded files.
|
71
|
+
|
72
|
+
@param {Boolean} [settings.dragdrop=true] Enable ability to add file to the queue by drag'n'dropping them from the desktop.
|
73
|
+
@param {Boolean} [settings.rename=false] Enable ability to rename files in the queue.
|
74
|
+
@param {Boolean} [settings.multiple_queues=true] Re-activate the widget after each upload procedure.
|
75
|
+
*/
|
76
|
+
;(function($, o) {
|
77
|
+
var uploaders = {};
|
78
|
+
|
79
|
+
function _(str) {
|
80
|
+
return plupload.translate(str) || str;
|
81
|
+
}
|
82
|
+
|
83
|
+
function renderUI(id, target) {
|
84
|
+
// Remove all existing non plupload items
|
85
|
+
target.contents().each(function(i, node) {
|
86
|
+
node = $(node);
|
87
|
+
|
88
|
+
if (!node.is('.plupload')) {
|
89
|
+
node.remove();
|
90
|
+
}
|
91
|
+
});
|
92
|
+
|
93
|
+
target.prepend(
|
94
|
+
'<div class="plupload_wrapper plupload_scroll">' +
|
95
|
+
'<div id="' + id + '_container" class="plupload_container">' +
|
96
|
+
'<div class="plupload">' +
|
97
|
+
'<div class="plupload_header">' +
|
98
|
+
'<div class="plupload_header_content">' +
|
99
|
+
'<div class="plupload_header_title">' + _('Select files') + '</div>' +
|
100
|
+
'<div class="plupload_header_text">' + _('Add files to the upload queue and click the start button.') + '</div>' +
|
101
|
+
'</div>' +
|
102
|
+
'</div>' +
|
103
|
+
|
104
|
+
'<div class="plupload_content">' +
|
105
|
+
'<div class="plupload_filelist_header">' +
|
106
|
+
'<div class="plupload_file_name">' + _('Filename') + '</div>' +
|
107
|
+
'<div class="plupload_file_action"> </div>' +
|
108
|
+
'<div class="plupload_file_status"><span>' + _('Status') + '</span></div>' +
|
109
|
+
'<div class="plupload_file_size">' + _('Size') + '</div>' +
|
110
|
+
'<div class="plupload_clearer"> </div>' +
|
111
|
+
'</div>' +
|
112
|
+
|
113
|
+
'<ul id="' + id + '_filelist" class="plupload_filelist"></ul>' +
|
114
|
+
|
115
|
+
'<div class="plupload_filelist_footer">' +
|
116
|
+
'<div class="plupload_file_name">' +
|
117
|
+
'<div class="plupload_buttons">' +
|
118
|
+
'<a href="#" class="plupload_button plupload_add" id="' + id + '_browse">' + _('Add Files') + '</a>' +
|
119
|
+
'<a href="#" class="plupload_button plupload_start">' + _('Start Upload') + '</a>' +
|
120
|
+
'</div>' +
|
121
|
+
'<span class="plupload_upload_status"></span>' +
|
122
|
+
'</div>' +
|
123
|
+
'<div class="plupload_file_action"></div>' +
|
124
|
+
'<div class="plupload_file_status"><span class="plupload_total_status">0%</span></div>' +
|
125
|
+
'<div class="plupload_file_size"><span class="plupload_total_file_size">0 b</span></div>' +
|
126
|
+
'<div class="plupload_progress">' +
|
127
|
+
'<div class="plupload_progress_container">' +
|
128
|
+
'<div class="plupload_progress_bar"></div>' +
|
129
|
+
'</div>' +
|
130
|
+
'</div>' +
|
131
|
+
'<div class="plupload_clearer"> </div>' +
|
132
|
+
'</div>' +
|
133
|
+
'</div>' +
|
134
|
+
'</div>' +
|
135
|
+
'</div>' +
|
136
|
+
'<input type="hidden" id="' + id + '_count" name="' + id + '_count" value="0" />' +
|
137
|
+
'</div>'
|
138
|
+
);
|
139
|
+
}
|
140
|
+
|
141
|
+
$.fn.pluploadQueue = function(settings) {
|
142
|
+
if (settings) {
|
143
|
+
this.each(function() {
|
144
|
+
var uploader, target, id, contents_bak;
|
145
|
+
|
146
|
+
target = $(this);
|
147
|
+
id = target.attr('id');
|
148
|
+
|
149
|
+
if (!id) {
|
150
|
+
id = plupload.guid();
|
151
|
+
target.attr('id', id);
|
152
|
+
}
|
153
|
+
|
154
|
+
contents_bak = target.html();
|
155
|
+
renderUI(id, target);
|
156
|
+
|
157
|
+
settings = $.extend({
|
158
|
+
dragdrop : true,
|
159
|
+
browse_button : id + '_browse',
|
160
|
+
container : id
|
161
|
+
}, settings);
|
162
|
+
|
163
|
+
// Enable drag/drop (see PostInit handler as well)
|
164
|
+
if (settings.dragdrop) {
|
165
|
+
settings.drop_element = id + '_filelist';
|
166
|
+
}
|
167
|
+
|
168
|
+
uploader = new plupload.Uploader(settings);
|
169
|
+
|
170
|
+
uploaders[id] = uploader;
|
171
|
+
|
172
|
+
function handleStatus(file) {
|
173
|
+
var actionClass;
|
174
|
+
|
175
|
+
if (file.status == plupload.DONE) {
|
176
|
+
actionClass = 'plupload_done';
|
177
|
+
}
|
178
|
+
|
179
|
+
if (file.status == plupload.FAILED) {
|
180
|
+
actionClass = 'plupload_failed';
|
181
|
+
}
|
182
|
+
|
183
|
+
if (file.status == plupload.QUEUED) {
|
184
|
+
actionClass = 'plupload_delete';
|
185
|
+
}
|
186
|
+
|
187
|
+
if (file.status == plupload.UPLOADING) {
|
188
|
+
actionClass = 'plupload_uploading';
|
189
|
+
}
|
190
|
+
|
191
|
+
var icon = $('#' + file.id).attr('class', actionClass).find('a').css('display', 'block');
|
192
|
+
if (file.hint) {
|
193
|
+
icon.attr('title', file.hint);
|
194
|
+
}
|
195
|
+
}
|
196
|
+
|
197
|
+
function updateTotalProgress() {
|
198
|
+
$('span.plupload_total_status', target).html(uploader.total.percent + '%');
|
199
|
+
$('div.plupload_progress_bar', target).css('width', uploader.total.percent + '%');
|
200
|
+
$('span.plupload_upload_status', target).html(
|
201
|
+
o.sprintf(_('Uploaded %d/%d files'), uploader.total.uploaded, uploader.files.length)
|
202
|
+
);
|
203
|
+
}
|
204
|
+
|
205
|
+
function updateList() {
|
206
|
+
var fileList = $('ul.plupload_filelist', target).html(''), inputCount = 0, inputHTML;
|
207
|
+
|
208
|
+
$.each(uploader.files, function(i, file) {
|
209
|
+
inputHTML = '';
|
210
|
+
|
211
|
+
if (file.status == plupload.DONE) {
|
212
|
+
if (file.target_name) {
|
213
|
+
inputHTML += '<input type="hidden" name="' + id + '_' + inputCount + '_tmpname" value="' + plupload.xmlEncode(file.target_name) + '" />';
|
214
|
+
}
|
215
|
+
|
216
|
+
inputHTML += '<input type="hidden" name="' + id + '_' + inputCount + '_name" value="' + plupload.xmlEncode(file.name) + '" />';
|
217
|
+
inputHTML += '<input type="hidden" name="' + id + '_' + inputCount + '_status" value="' + (file.status == plupload.DONE ? 'done' : 'failed') + '" />';
|
218
|
+
|
219
|
+
inputCount++;
|
220
|
+
|
221
|
+
$('#' + id + '_count').val(inputCount);
|
222
|
+
}
|
223
|
+
|
224
|
+
fileList.append(
|
225
|
+
'<li id="' + file.id + '">' +
|
226
|
+
'<div class="plupload_file_name"><span>' + file.name + '</span></div>' +
|
227
|
+
'<div class="plupload_file_action"><a href="#"></a></div>' +
|
228
|
+
'<div class="plupload_file_status">' + file.percent + '%</div>' +
|
229
|
+
'<div class="plupload_file_size">' + plupload.formatSize(file.size) + '</div>' +
|
230
|
+
'<div class="plupload_clearer"> </div>' +
|
231
|
+
inputHTML +
|
232
|
+
'</li>'
|
233
|
+
);
|
234
|
+
|
235
|
+
handleStatus(file);
|
236
|
+
|
237
|
+
$('#' + file.id + '.plupload_delete a').click(function(e) {
|
238
|
+
$('#' + file.id).remove();
|
239
|
+
uploader.removeFile(file);
|
240
|
+
|
241
|
+
e.preventDefault();
|
242
|
+
});
|
243
|
+
});
|
244
|
+
|
245
|
+
$('span.plupload_total_file_size', target).html(plupload.formatSize(uploader.total.size));
|
246
|
+
|
247
|
+
if (uploader.total.queued === 0) {
|
248
|
+
$('span.plupload_add_text', target).html(_('Add Files'));
|
249
|
+
} else {
|
250
|
+
$('span.plupload_add_text', target).html(o.sprintf(_('%d files queued'), uploader.total.queued));
|
251
|
+
}
|
252
|
+
|
253
|
+
$('a.plupload_start', target).toggleClass('plupload_disabled', uploader.files.length == (uploader.total.uploaded + uploader.total.failed));
|
254
|
+
|
255
|
+
// Scroll to end of file list
|
256
|
+
fileList[0].scrollTop = fileList[0].scrollHeight;
|
257
|
+
|
258
|
+
updateTotalProgress();
|
259
|
+
|
260
|
+
// Re-add drag message if there is no files
|
261
|
+
if (!uploader.files.length && uploader.features.dragdrop && uploader.settings.dragdrop) {
|
262
|
+
$('#' + id + '_filelist').append('<li class="plupload_droptext">' + _("Drag files here.") + '</li>');
|
263
|
+
}
|
264
|
+
}
|
265
|
+
|
266
|
+
function destroy() {
|
267
|
+
delete uploaders[id];
|
268
|
+
uploader.destroy();
|
269
|
+
target.html(contents_bak);
|
270
|
+
uploader = target = contents_bak = null;
|
271
|
+
}
|
272
|
+
|
273
|
+
uploader.bind("UploadFile", function(up, file) {
|
274
|
+
$('#' + file.id).addClass('plupload_current_file');
|
275
|
+
});
|
276
|
+
|
277
|
+
uploader.bind('Init', function(up, res) {
|
278
|
+
// Enable rename support
|
279
|
+
if (!settings.unique_names && settings.rename) {
|
280
|
+
target.on('click', '#' + id + '_filelist div.plupload_file_name span', function(e) {
|
281
|
+
var targetSpan = $(e.target), file, parts, name, ext = "";
|
282
|
+
|
283
|
+
// Get file name and split out name and extension
|
284
|
+
file = up.getFile(targetSpan.parents('li')[0].id);
|
285
|
+
name = file.name;
|
286
|
+
parts = /^(.+)(\.[^.]+)$/.exec(name);
|
287
|
+
if (parts) {
|
288
|
+
name = parts[1];
|
289
|
+
ext = parts[2];
|
290
|
+
}
|
291
|
+
|
292
|
+
// Display input element
|
293
|
+
targetSpan.hide().after('<input type="text" />');
|
294
|
+
targetSpan.next().val(name).focus().blur(function() {
|
295
|
+
targetSpan.show().next().remove();
|
296
|
+
}).keydown(function(e) {
|
297
|
+
var targetInput = $(this);
|
298
|
+
|
299
|
+
if (e.keyCode == 13) {
|
300
|
+
e.preventDefault();
|
301
|
+
|
302
|
+
// Rename file and glue extension back on
|
303
|
+
file.name = targetInput.val() + ext;
|
304
|
+
targetSpan.html(file.name);
|
305
|
+
targetInput.blur();
|
306
|
+
}
|
307
|
+
});
|
308
|
+
});
|
309
|
+
}
|
310
|
+
|
311
|
+
$('#' + id + '_container').attr('title', 'Using runtime: ' + res.runtime);
|
312
|
+
|
313
|
+
$('a.plupload_start', target).click(function(e) {
|
314
|
+
if (!$(this).hasClass('plupload_disabled')) {
|
315
|
+
uploader.start();
|
316
|
+
}
|
317
|
+
|
318
|
+
e.preventDefault();
|
319
|
+
});
|
320
|
+
|
321
|
+
$('a.plupload_stop', target).click(function(e) {
|
322
|
+
e.preventDefault();
|
323
|
+
uploader.stop();
|
324
|
+
});
|
325
|
+
|
326
|
+
$('a.plupload_start', target).addClass('plupload_disabled');
|
327
|
+
});
|
328
|
+
|
329
|
+
uploader.bind("Error", function(up, err) {
|
330
|
+
var file = err.file, message;
|
331
|
+
|
332
|
+
if (file) {
|
333
|
+
message = err.message;
|
334
|
+
|
335
|
+
if (err.details) {
|
336
|
+
message += " (" + err.details + ")";
|
337
|
+
}
|
338
|
+
|
339
|
+
if (err.code == plupload.FILE_SIZE_ERROR) {
|
340
|
+
alert(_("Error: File too large:") + " " + file.name);
|
341
|
+
}
|
342
|
+
|
343
|
+
if (err.code == plupload.FILE_EXTENSION_ERROR) {
|
344
|
+
alert(_("Error: Invalid file extension:") + " " + file.name);
|
345
|
+
}
|
346
|
+
|
347
|
+
file.hint = message;
|
348
|
+
$('#' + file.id).attr('class', 'plupload_failed').find('a').css('display', 'block').attr('title', message);
|
349
|
+
}
|
350
|
+
|
351
|
+
if (err.code === plupload.INIT_ERROR) {
|
352
|
+
setTimeout(function() {
|
353
|
+
destroy();
|
354
|
+
}, 1);
|
355
|
+
}
|
356
|
+
});
|
357
|
+
|
358
|
+
uploader.bind("PostInit", function(up) {
|
359
|
+
// features are populated only after input components are fully instantiated
|
360
|
+
if (up.settings.dragdrop && up.features.dragdrop) {
|
361
|
+
$('#' + id + '_filelist').append('<li class="plupload_droptext">' + _("Drag files here.") + '</li>');
|
362
|
+
}
|
363
|
+
});
|
364
|
+
|
365
|
+
uploader.init();
|
366
|
+
|
367
|
+
uploader.bind('StateChanged', function() {
|
368
|
+
if (uploader.state === plupload.STARTED) {
|
369
|
+
$('li.plupload_delete a,div.plupload_buttons', target).hide();
|
370
|
+
uploader.disableBrowse(true);
|
371
|
+
|
372
|
+
$('span.plupload_upload_status,div.plupload_progress,a.plupload_stop', target).css('display', 'block');
|
373
|
+
$('span.plupload_upload_status', target).html('Uploaded ' + uploader.total.uploaded + '/' + uploader.files.length + ' files');
|
374
|
+
|
375
|
+
if (settings.multiple_queues) {
|
376
|
+
$('span.plupload_total_status,span.plupload_total_file_size', target).show();
|
377
|
+
}
|
378
|
+
} else {
|
379
|
+
updateList();
|
380
|
+
$('a.plupload_stop,div.plupload_progress', target).hide();
|
381
|
+
$('a.plupload_delete', target).css('display', 'block');
|
382
|
+
|
383
|
+
if (settings.multiple_queues && uploader.total.uploaded + uploader.total.failed == uploader.files.length) {
|
384
|
+
$(".plupload_buttons,.plupload_upload_status", target).css("display", "inline");
|
385
|
+
uploader.disableBrowse(false);
|
386
|
+
|
387
|
+
$(".plupload_start", target).addClass("plupload_disabled");
|
388
|
+
$('span.plupload_total_status,span.plupload_total_file_size', target).hide();
|
389
|
+
}
|
390
|
+
}
|
391
|
+
});
|
392
|
+
|
393
|
+
uploader.bind('FilesAdded', updateList);
|
394
|
+
|
395
|
+
uploader.bind('FilesRemoved', function() {
|
396
|
+
// since the whole file list is redrawn for every change in the queue
|
397
|
+
// we need to scroll back to the file removal point to avoid annoying
|
398
|
+
// scrolling to the bottom bug (see #926)
|
399
|
+
var scrollTop = $('#' + id + '_filelist').scrollTop();
|
400
|
+
updateList();
|
401
|
+
$('#' + id + '_filelist').scrollTop(scrollTop);
|
402
|
+
});
|
403
|
+
|
404
|
+
uploader.bind('FileUploaded', function(up, file) {
|
405
|
+
handleStatus(file);
|
406
|
+
});
|
407
|
+
|
408
|
+
uploader.bind("UploadProgress", function(up, file) {
|
409
|
+
// Set file specific progress
|
410
|
+
$('#' + file.id + ' div.plupload_file_status', target).html(file.percent + '%');
|
411
|
+
|
412
|
+
handleStatus(file);
|
413
|
+
updateTotalProgress();
|
414
|
+
});
|
415
|
+
|
416
|
+
// Call setup function
|
417
|
+
if (settings.setup) {
|
418
|
+
settings.setup(uploader);
|
419
|
+
}
|
420
|
+
});
|
421
|
+
|
422
|
+
return this;
|
423
|
+
} else {
|
424
|
+
// Get uploader instance for specified element
|
425
|
+
return uploaders[$(this[0]).attr('id')];
|
426
|
+
}
|
427
|
+
};
|
428
|
+
})(jQuery, mOxie);
|
@@ -0,0 +1 @@
|
|
1
|
+
;(function(e,t){function r(e){return plupload.translate(e)||e}function i(t,n){n.contents().each(function(t,n){n=e(n),n.is(".plupload")||n.remove()}),n.prepend('<div class="plupload_wrapper plupload_scroll"><div id="'+t+'_container" class="plupload_container">'+'<div class="plupload">'+'<div class="plupload_header">'+'<div class="plupload_header_content">'+'<div class="plupload_header_title">'+r("Select files")+"</div>"+'<div class="plupload_header_text">'+r("Add files to the upload queue and click the start button.")+"</div>"+"</div>"+"</div>"+'<div class="plupload_content">'+'<div class="plupload_filelist_header">'+'<div class="plupload_file_name">'+r("Filename")+"</div>"+'<div class="plupload_file_action"> </div>'+'<div class="plupload_file_status"><span>'+r("Status")+"</span></div>"+'<div class="plupload_file_size">'+r("Size")+"</div>"+'<div class="plupload_clearer"> </div>'+"</div>"+'<ul id="'+t+'_filelist" class="plupload_filelist"></ul>'+'<div class="plupload_filelist_footer">'+'<div class="plupload_file_name">'+'<div class="plupload_buttons">'+'<a href="#" class="plupload_button plupload_add" id="'+t+'_browse">'+r("Add Files")+"</a>"+'<a href="#" class="plupload_button plupload_start">'+r("Start Upload")+"</a>"+"</div>"+'<span class="plupload_upload_status"></span>'+"</div>"+'<div class="plupload_file_action"></div>'+'<div class="plupload_file_status"><span class="plupload_total_status">0%</span></div>'+'<div class="plupload_file_size"><span class="plupload_total_file_size">0 b</span></div>'+'<div class="plupload_progress">'+'<div class="plupload_progress_container">'+'<div class="plupload_progress_bar"></div>'+"</div>"+"</div>"+'<div class="plupload_clearer"> </div>'+"</div>"+"</div>"+"</div>"+"</div>"+'<input type="hidden" id="'+t+'_count" name="'+t+'_count" value="0" />'+"</div>")}var n={};e.fn.pluploadQueue=function(s){return s?(this.each(function(){function c(t){var n;t.status==plupload.DONE&&(n="plupload_done"),t.status==plupload.FAILED&&(n="plupload_failed"),t.status==plupload.QUEUED&&(n="plupload_delete"),t.status==plupload.UPLOADING&&(n="plupload_uploading");var r=e("#"+t.id).attr("class",n).find("a").css("display","block");t.hint&&r.attr("title",t.hint)}function h(){e("span.plupload_total_status",a).html(u.total.percent+"%"),e("div.plupload_progress_bar",a).css("width",u.total.percent+"%"),e("span.plupload_upload_status",a).html(t.sprintf(r("Uploaded %d/%d files"),u.total.uploaded,u.files.length))}function p(){var n=e("ul.plupload_filelist",a).html(""),i=0,s;e.each(u.files,function(t,r){s="",r.status==plupload.DONE&&(r.target_name&&(s+='<input type="hidden" name="'+f+"_"+i+'_tmpname" value="'+plupload.xmlEncode(r.target_name)+'" />'),s+='<input type="hidden" name="'+f+"_"+i+'_name" value="'+plupload.xmlEncode(r.name)+'" />',s+='<input type="hidden" name="'+f+"_"+i+'_status" value="'+(r.status==plupload.DONE?"done":"failed")+'" />',i++,e("#"+f+"_count").val(i)),n.append('<li id="'+r.id+'">'+'<div class="plupload_file_name"><span>'+r.name+"</span></div>"+'<div class="plupload_file_action"><a href="#"></a></div>'+'<div class="plupload_file_status">'+r.percent+"%</div>"+'<div class="plupload_file_size">'+plupload.formatSize(r.size)+"</div>"+'<div class="plupload_clearer"> </div>'+s+"</li>"),c(r),e("#"+r.id+".plupload_delete a").click(function(t){e("#"+r.id).remove(),u.removeFile(r),t.preventDefault()})}),e("span.plupload_total_file_size",a).html(plupload.formatSize(u.total.size)),u.total.queued===0?e("span.plupload_add_text",a).html(r("Add Files")):e("span.plupload_add_text",a).html(t.sprintf(r("%d files queued"),u.total.queued)),e("a.plupload_start",a).toggleClass("plupload_disabled",u.files.length==u.total.uploaded+u.total.failed),n[0].scrollTop=n[0].scrollHeight,h(),!u.files.length&&u.features.dragdrop&&u.settings.dragdrop&&e("#"+f+"_filelist").append('<li class="plupload_droptext">'+r("Drag files here.")+"</li>")}function d(){delete n[f],u.destroy(),a.html(l),u=a=l=null}var u,a,f,l;a=e(this),f=a.attr("id"),f||(f=plupload.guid(),a.attr("id",f)),l=a.html(),i(f,a),s=e.extend({dragdrop:!0,browse_button:f+"_browse",container:f},s),s.dragdrop&&(s.drop_element=f+"_filelist"),u=new plupload.Uploader(s),n[f]=u,u.bind("UploadFile",function(t,n){e("#"+n.id).addClass("plupload_current_file")}),u.bind("Init",function(t,n){!s.unique_names&&s.rename&&a.on("click","#"+f+"_filelist div.plupload_file_name span",function(n){var r=e(n.target),i,s,o,u="";i=t.getFile(r.parents("li")[0].id),o=i.name,s=/^(.+)(\.[^.]+)$/.exec(o),s&&(o=s[1],u=s[2]),r.hide().after('<input type="text" />'),r.next().val(o).focus().blur(function(){r.show().next().remove()}).keydown(function(t){var n=e(this);t.keyCode==13&&(t.preventDefault(),i.name=n.val()+u,r.html(i.name),n.blur())})}),e("#"+f+"_container").attr("title","Using runtime: "+n.runtime),e("a.plupload_start",a).click(function(t){e(this).hasClass("plupload_disabled")||u.start(),t.preventDefault()}),e("a.plupload_stop",a).click(function(e){e.preventDefault(),u.stop()}),e("a.plupload_start",a).addClass("plupload_disabled")}),u.bind("Error",function(t,n){var i=n.file,s;i&&(s=n.message,n.details&&(s+=" ("+n.details+")"),n.code==plupload.FILE_SIZE_ERROR&&alert(r("Error: File too large:")+" "+i.name),n.code==plupload.FILE_EXTENSION_ERROR&&alert(r("Error: Invalid file extension:")+" "+i.name),i.hint=s,e("#"+i.id).attr("class","plupload_failed").find("a").css("display","block").attr("title",s)),n.code===plupload.INIT_ERROR&&setTimeout(function(){d()},1)}),u.bind("PostInit",function(t){t.settings.dragdrop&&t.features.dragdrop&&e("#"+f+"_filelist").append('<li class="plupload_droptext">'+r("Drag files here.")+"</li>")}),u.init(),u.bind("StateChanged",function(){u.state===plupload.STARTED?(e("li.plupload_delete a,div.plupload_buttons",a).hide(),u.disableBrowse(!0),e("span.plupload_upload_status,div.plupload_progress,a.plupload_stop",a).css("display","block"),e("span.plupload_upload_status",a).html("Uploaded "+u.total.uploaded+"/"+u.files.length+" files"),s.multiple_queues&&e("span.plupload_total_status,span.plupload_total_file_size",a).show()):(p(),e("a.plupload_stop,div.plupload_progress",a).hide(),e("a.plupload_delete",a).css("display","block"),s.multiple_queues&&u.total.uploaded+u.total.failed==u.files.length&&(e(".plupload_buttons,.plupload_upload_status",a).css("display","inline"),u.disableBrowse(!1),e(".plupload_start",a).addClass("plupload_disabled"),e("span.plupload_total_status,span.plupload_total_file_size",a).hide()))}),u.bind("FilesAdded",p),u.bind("FilesRemoved",function(){var t=e("#"+f+"_filelist").scrollTop();p(),e("#"+f+"_filelist").scrollTop(t)}),u.bind("FileUploaded",function(e,t){c(t)}),u.bind("UploadProgress",function(t,n){e("#"+n.id+" div.plupload_file_status",a).html(n.percent+"%"),c(n),h()}),s.setup&&s.setup(u)}),this):n[e(this[0]).attr("id")]}})(jQuery,mOxie);
|
File without changes
|
@@ -0,0 +1,375 @@
|
|
1
|
+
/*
|
2
|
+
Plupload
|
3
|
+
------------------------------------------------------------------- */
|
4
|
+
|
5
|
+
.plupload_wrapper * {
|
6
|
+
box-sizing: content-box;
|
7
|
+
}
|
8
|
+
|
9
|
+
.plupload_button {
|
10
|
+
cursor: pointer;
|
11
|
+
outline: none;
|
12
|
+
}
|
13
|
+
|
14
|
+
.plupload_wrapper {
|
15
|
+
font: normal 11px Verdana,sans-serif;
|
16
|
+
width: 100%;
|
17
|
+
min-width: 520px;
|
18
|
+
line-height: 12px;
|
19
|
+
}
|
20
|
+
|
21
|
+
.plupload_container {
|
22
|
+
_height: 300px;
|
23
|
+
min-height: 300px;
|
24
|
+
position: relative;
|
25
|
+
}
|
26
|
+
|
27
|
+
.plupload_filelist_footer {border-width: 1px 0 0 0}
|
28
|
+
.plupload_file {border-width: 0 0 1px 0}
|
29
|
+
.plupload_container .plupload_header {border-width: 0 0 1px 0; position: relative;}
|
30
|
+
|
31
|
+
.plupload_delete .ui-icon,
|
32
|
+
.plupload_done .ui-icon,
|
33
|
+
.plupload_failed .ui-icon {
|
34
|
+
cursor:pointer;
|
35
|
+
}
|
36
|
+
|
37
|
+
.plupload_header_content {
|
38
|
+
height: 56px;
|
39
|
+
padding: 0 160px 0 60px;
|
40
|
+
position: relative;
|
41
|
+
}
|
42
|
+
|
43
|
+
.plupload_logo {
|
44
|
+
width: 40px;
|
45
|
+
height: 40px;
|
46
|
+
background: url('../img/plupload.png') no-repeat 0 0;
|
47
|
+
position: absolute;
|
48
|
+
top: 8px;
|
49
|
+
left: 8px;
|
50
|
+
}
|
51
|
+
|
52
|
+
.plupload_header_content_bw .plupload_logo {
|
53
|
+
background-position: -40px 0;
|
54
|
+
}
|
55
|
+
|
56
|
+
.plupload_header_title {
|
57
|
+
font: normal 18px sans-serif;
|
58
|
+
line-height: 19px;
|
59
|
+
padding: 6px 0 3px;
|
60
|
+
}
|
61
|
+
|
62
|
+
.plupload_header_text {
|
63
|
+
font: normal 12px sans-serif;
|
64
|
+
}
|
65
|
+
|
66
|
+
.plupload_view_switch {
|
67
|
+
position: absolute;
|
68
|
+
right: 16px;
|
69
|
+
bottom: 8px;
|
70
|
+
margin: 0;
|
71
|
+
display: none;
|
72
|
+
}
|
73
|
+
|
74
|
+
.plupload_view_switch .ui-button {
|
75
|
+
margin-right: -0.31em;
|
76
|
+
}
|
77
|
+
|
78
|
+
.plupload_content {
|
79
|
+
position: absolute;
|
80
|
+
top: 86px;
|
81
|
+
bottom: 44px;
|
82
|
+
left: 0;
|
83
|
+
right: 0;
|
84
|
+
overflow-y: auto;
|
85
|
+
width: 100%;
|
86
|
+
}
|
87
|
+
|
88
|
+
.plupload_filelist {
|
89
|
+
border-collapse: collapse;
|
90
|
+
border-left: none;
|
91
|
+
border-right: none;
|
92
|
+
margin: 0;
|
93
|
+
padding: 0;
|
94
|
+
width: 100%;
|
95
|
+
-moz-user-select: none;
|
96
|
+
-webkit-user-select: none;
|
97
|
+
user-select: none;
|
98
|
+
}
|
99
|
+
|
100
|
+
.plupload_filelist_content {
|
101
|
+
padding: 0;
|
102
|
+
margin: 0;
|
103
|
+
}
|
104
|
+
|
105
|
+
.plupload_cell {padding: 8px 6px;}
|
106
|
+
|
107
|
+
.plupload_file {
|
108
|
+
list-style: none;
|
109
|
+
display: block;
|
110
|
+
position: relative;
|
111
|
+
overflow: hidden;
|
112
|
+
line-height: 12px;
|
113
|
+
}
|
114
|
+
|
115
|
+
.plupload_file_thumb {
|
116
|
+
position: relative;
|
117
|
+
background-image: none;
|
118
|
+
background-color: #eee;
|
119
|
+
}
|
120
|
+
|
121
|
+
.plupload_thumb_loading {
|
122
|
+
background: #eee url(../img/loading.gif) center no-repeat;
|
123
|
+
}
|
124
|
+
|
125
|
+
.plupload_thumb_loading .plupload_file_dummy,
|
126
|
+
.plupload_thumb_embedded .plupload_file_dummy {
|
127
|
+
display: none;
|
128
|
+
}
|
129
|
+
|
130
|
+
.plupload_file_name {
|
131
|
+
overflow: hidden;
|
132
|
+
text-overflow: ellipsis;
|
133
|
+
white-space: nowrap;
|
134
|
+
}
|
135
|
+
|
136
|
+
.plupload_filelist_header {
|
137
|
+
border-top: none;
|
138
|
+
}
|
139
|
+
|
140
|
+
.plupload_filelist_footer {
|
141
|
+
position: absolute;
|
142
|
+
bottom: 0;
|
143
|
+
left: 0;
|
144
|
+
right: 0;
|
145
|
+
}
|
146
|
+
|
147
|
+
.plupload_buttons {
|
148
|
+
position: relative;
|
149
|
+
}
|
150
|
+
|
151
|
+
/* list view */
|
152
|
+
.plupload_view_list .plupload_file {
|
153
|
+
border-left: none;
|
154
|
+
border-right: none;
|
155
|
+
border-top: none;
|
156
|
+
height: 29px;
|
157
|
+
width: 100% !important;
|
158
|
+
/* fix IE6 vertical white-space bug */
|
159
|
+
_float: left;
|
160
|
+
_clear: left;
|
161
|
+
}
|
162
|
+
|
163
|
+
.plupload_view_list div.plupload_file_size,
|
164
|
+
.plupload_view_list div.plupload_file_status,
|
165
|
+
.plupload_view_list div.plupload_file_action {
|
166
|
+
padding: 8px 6px;
|
167
|
+
position: absolute;
|
168
|
+
top: 0;
|
169
|
+
right: 0;
|
170
|
+
}
|
171
|
+
|
172
|
+
.plupload_view_list div.plupload_file_name {
|
173
|
+
margin-right: 156px;
|
174
|
+
padding: 8px 6px;
|
175
|
+
_width: 75%;
|
176
|
+
}
|
177
|
+
|
178
|
+
.plupload_view_list div.plupload_file_size {
|
179
|
+
right: 28px;
|
180
|
+
}
|
181
|
+
|
182
|
+
.plupload_view_list div.plupload_file_status {
|
183
|
+
right: 82px;
|
184
|
+
}
|
185
|
+
|
186
|
+
.plupload_view_list .plupload_file_rename {
|
187
|
+
margin-left: -2px;
|
188
|
+
}
|
189
|
+
|
190
|
+
.plupload_view_list .plupload_file_size,
|
191
|
+
.plupload_view_list .plupload_file_status,
|
192
|
+
.plupload_filelist_footer .plupload_file_size,
|
193
|
+
.plupload_filelist_footer .plupload_file_status {
|
194
|
+
text-align: right;
|
195
|
+
width: 52px;
|
196
|
+
}
|
197
|
+
|
198
|
+
.plupload_view_list .plupload_file_thumb {
|
199
|
+
position: absolute;
|
200
|
+
top: -999px;
|
201
|
+
}
|
202
|
+
|
203
|
+
.plupload_view_list .plupload_file_progress {
|
204
|
+
display: none;
|
205
|
+
}
|
206
|
+
|
207
|
+
|
208
|
+
/* thumbs view */
|
209
|
+
.plupload_view_thumbs .plupload_content {
|
210
|
+
top: 57px;
|
211
|
+
}
|
212
|
+
|
213
|
+
.plupload_view_thumbs .plupload_filelist_header {
|
214
|
+
display: none;
|
215
|
+
}
|
216
|
+
|
217
|
+
.plupload_view_thumbs .plupload_file {
|
218
|
+
padding: 6px;
|
219
|
+
margin: 10px;
|
220
|
+
border: 1px solid #fff;
|
221
|
+
float: left;
|
222
|
+
}
|
223
|
+
|
224
|
+
.plupload_view_thumbs .plupload_file_thumb,
|
225
|
+
.plupload_view_thumbs .plupload_file_dummy {
|
226
|
+
text-align: center;
|
227
|
+
overflow: hidden;
|
228
|
+
}
|
229
|
+
|
230
|
+
.plupload_view_thumbs .plupload_file_dummy {
|
231
|
+
font-size: 21px;
|
232
|
+
font-weight: bold;
|
233
|
+
text-transform: lowercase;
|
234
|
+
overflow: hidden;
|
235
|
+
border: none;
|
236
|
+
position: absolute;
|
237
|
+
top: 0;
|
238
|
+
left: 0;
|
239
|
+
width: 100%;
|
240
|
+
height: 100%;
|
241
|
+
}
|
242
|
+
|
243
|
+
.plupload_view_thumbs div.plupload_file_action {
|
244
|
+
position: absolute;
|
245
|
+
top: 0;
|
246
|
+
right: 0;
|
247
|
+
}
|
248
|
+
|
249
|
+
.plupload_view_thumbs div.plupload_file_name {
|
250
|
+
padding: 0;
|
251
|
+
font-weight: bold;
|
252
|
+
}
|
253
|
+
|
254
|
+
.plupload_view_thumbs .plupload_file_rename {
|
255
|
+
padding: 1px 0;
|
256
|
+
width: 100% !important;
|
257
|
+
}
|
258
|
+
|
259
|
+
.plupload_view_thumbs div.plupload_file_size {
|
260
|
+
font-size: 0.8em;
|
261
|
+
font-weight: normal;
|
262
|
+
}
|
263
|
+
|
264
|
+
.plupload_view_thumbs div.plupload_file_status {
|
265
|
+
position: relative;
|
266
|
+
height: 3px;
|
267
|
+
overflow: hidden;
|
268
|
+
text-indent: -999px;
|
269
|
+
margin-bottom: 3px;
|
270
|
+
}
|
271
|
+
|
272
|
+
.plupload_view_thumbs div.plupload_file_progress {
|
273
|
+
border: none;
|
274
|
+
height: 100%;
|
275
|
+
}
|
276
|
+
|
277
|
+
.plupload .ui-sortable-helper,
|
278
|
+
.plupload .ui-sortable .plupload_file {
|
279
|
+
cursor:move;
|
280
|
+
}
|
281
|
+
|
282
|
+
.plupload_file_action {width: 16px;}
|
283
|
+
.plupload_file_name {
|
284
|
+
overflow: hidden;
|
285
|
+
padding-left: 10px;
|
286
|
+
}
|
287
|
+
|
288
|
+
.plupload_file_rename {
|
289
|
+
border: none;
|
290
|
+
font: normal 11px Verdana, sans-serif;
|
291
|
+
padding: 1px 2px;
|
292
|
+
line-height: 11px;
|
293
|
+
height: 11px;
|
294
|
+
}
|
295
|
+
|
296
|
+
.plupload_progress {width: 60px;}
|
297
|
+
.plupload_progress_container {padding: 1px;}
|
298
|
+
|
299
|
+
|
300
|
+
/* Floats */
|
301
|
+
|
302
|
+
.plupload_right {float: right;}
|
303
|
+
.plupload_left {float: left;}
|
304
|
+
.plupload_clear,.plupload_clearer {clear: both;}
|
305
|
+
.plupload_clearer, .plupload_progress_bar {
|
306
|
+
display: block;
|
307
|
+
font-size: 0;
|
308
|
+
line-height: 0;
|
309
|
+
}
|
310
|
+
.plupload_clearer {height: 0;}
|
311
|
+
|
312
|
+
/* Misc */
|
313
|
+
.plupload_hidden {display: none !important;}
|
314
|
+
|
315
|
+
.plupload_droptext {
|
316
|
+
position: absolute;
|
317
|
+
top: 0;
|
318
|
+
left: 0;
|
319
|
+
right: 0;
|
320
|
+
bottom: 0;
|
321
|
+
background: transparent;
|
322
|
+
text-align: center;
|
323
|
+
vertical-align: middle;
|
324
|
+
border: 0;
|
325
|
+
line-height: 160px;
|
326
|
+
display: none;
|
327
|
+
}
|
328
|
+
|
329
|
+
.plupload_dropbox .plupload_droptext {
|
330
|
+
display: block;
|
331
|
+
}
|
332
|
+
|
333
|
+
.plupload_buttons, .plupload_upload_status {float: left}
|
334
|
+
|
335
|
+
.plupload_message {
|
336
|
+
position: absolute;
|
337
|
+
top: -1px;
|
338
|
+
left: -1px;
|
339
|
+
height: 100%;
|
340
|
+
width: 100%;
|
341
|
+
}
|
342
|
+
|
343
|
+
.plupload_message p {
|
344
|
+
padding:0.7em;
|
345
|
+
margin:0;
|
346
|
+
}
|
347
|
+
|
348
|
+
.plupload_message strong {
|
349
|
+
font-weight: bold;
|
350
|
+
}
|
351
|
+
|
352
|
+
.plupload_message i {
|
353
|
+
font-style: italic;
|
354
|
+
}
|
355
|
+
|
356
|
+
.plupload_message p span.ui-icon {
|
357
|
+
float: left;
|
358
|
+
margin-right: 0.3em;
|
359
|
+
}
|
360
|
+
|
361
|
+
.plupload_header_content .ui-state-error,
|
362
|
+
.plupload_header_content .ui-state-highlight {
|
363
|
+
border:none;
|
364
|
+
}
|
365
|
+
|
366
|
+
.plupload_message_close {
|
367
|
+
position:absolute;
|
368
|
+
top:5px;
|
369
|
+
right:5px;
|
370
|
+
cursor:pointer;
|
371
|
+
}
|
372
|
+
|
373
|
+
.plupload .ui-sortable-placeholder {
|
374
|
+
height:35px;
|
375
|
+
}
|