wheels 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +20 -0
- data/VERSION +1 -1
- data/app/controllers/app_configs_controller.rb +12 -0
- data/app/controllers/application_controller.rb +39 -0
- data/app/helpers/application_helper.rb +24 -2
- data/app/models/sitemap.rb +7 -0
- data/app/views/app_configs/css.css.haml +2 -0
- data/app/views/layouts/application.html.haml +21 -15
- data/app/views/pages/_form_fields.html.haml +2 -0
- data/app/views/sitemaps/index.html.haml +68 -76
- data/db/migrate/0000_devise_create_users.rb +26 -0
- data/db/migrate/0180_acts_as_taggable_on_migration.rb +28 -0
- data/lib/generators/app_layout/app_layout_generator.rb +1 -1
- data/lib/generators/{wheels/core_extensions.rb → core_extensions.rb} +42 -1
- data/lib/generators/recipes/wheels.rb +46 -0
- data/lib/generators/recipes/wheels_update.rb +18 -0
- data/lib/generators/wheels/wheels_generator.rb +3 -1
- data/lib/generators/wheels_checkout_assets/USAGE +8 -0
- data/lib/generators/wheels_checkout_assets/wheels_checkout_assets_generator.rb +9 -0
- data/lib/generators/wheels_checkout_assets_readonly/USAGE +8 -0
- data/lib/generators/wheels_checkout_assets_readonly/wheels_checkout_assets_readonly_generator.rb +10 -0
- data/lib/generators/wheels_controller/USAGE +8 -0
- data/lib/generators/wheels_controller/wheels_controller_generator.rb +14 -0
- data/lib/generators/{wheels_views → wheels_model}/USAGE +1 -1
- data/lib/generators/wheels_model/wheels_model_generator.rb +14 -0
- data/lib/generators/{update_wheels/update_wheels_generator.rb → wheels_update/wheels_update_generator.rb} +7 -13
- data/lib/generators/wheels_view/USAGE +8 -0
- data/lib/generators/wheels_view/wheels_view_generator.rb +14 -0
- data/lib/wheels/routes.rb +7 -1
- data/wheels.gemspec +44 -218
- metadata +44 -218
- data/lib/generators/app_layout/core_extensions.rb +0 -51
- data/lib/generators/update_wheels/core_extensions.rb +0 -51
- data/lib/generators/update_wheels/recipes/wheels.rb +0 -11
- data/lib/generators/update_wheels/templates/haml/app/views/layouts/application.html.haml +0 -9
- data/lib/generators/wheels/install_generator.rb +0 -25
- data/lib/generators/wheels/recipes/wheels.rb +0 -66
- data/lib/generators/wheels/templates/cancan/ability.rb +0 -13
- data/lib/generators/wheels/templates/database/postgresql.yml +0 -19
- data/lib/generators/wheels/templates/git/gitignore +0 -8
- data/lib/generators/wheels/templates/mongoid/features/step_definitions/mongoid_steps.rb +0 -4
- data/lib/generators/wheels/templates/mongoid/features/support/hooks.rb +0 -3
- data/lib/generators/wheels/views_generator.rb +0 -15
- data/lib/generators/wheels_views/LICENCE +0 -20
- data/lib/generators/wheels_views/wheels_views_generator.rb +0 -15
- data/lib/wheels/base.rb +0 -7
- data/public/404.html +0 -26
- data/public/422.html +0 -26
- data/public/500.html +0 -26
- data/public/favicon.ico +0 -0
- data/public/images/dreamy/Thumbs.db +0 -0
- data/public/images/dreamy/bg-ad-top.png +0 -0
- data/public/images/dreamy/bg-body.png +0 -0
- data/public/images/dreamy/bg-feed.gif +0 -0
- data/public/images/dreamy/bg-footer.jpg +0 -0
- data/public/images/dreamy/bg-header.jpg +0 -0
- data/public/images/dreamy/bg-menu-hover.png +0 -0
- data/public/images/dreamy/bg-menu.png +0 -0
- data/public/images/dreamy/bg-sidebar-bottom.gif +0 -0
- data/public/images/dreamy/button-feed.png +0 -0
- data/public/images/dreamy/icon-comment.png +0 -0
- data/public/images/growl/error.png +0 -0
- data/public/images/growl/growl_bottom.png +0 -0
- data/public/images/growl/growl_repeat.png +0 -0
- data/public/images/growl/growl_top.png +0 -0
- data/public/images/growl/info.png +0 -0
- data/public/images/menu/item-pointer-mover.gif +0 -0
- data/public/images/menu/item-pointer.gif +0 -0
- data/public/images/menu/lava.gif +0 -0
- data/public/images/menu/lava.png +0 -0
- data/public/images/menu/main-bg.png +0 -0
- data/public/images/menu/main-delimiter.png +0 -0
- data/public/javascripts/galleries/configure_ckeditor.js +0 -8
- data/public/javascripts/jqUrl.js +0 -28
- data/public/javascripts/jquery-validate/additional-methods.js +0 -259
- data/public/javascripts/jquery-validate/changelog.txt +0 -239
- data/public/javascripts/jquery-validate/jquery.validate.js +0 -1146
- data/public/javascripts/jquery-validate/jquery.validate.min.js +0 -16
- data/public/javascripts/jquery-validate/jquery.validate.pack.js +0 -15
- data/public/javascripts/jquery-validate/lib/jquery-1.4.2.js +0 -6240
- data/public/javascripts/jquery-validate/lib/jquery.form.js +0 -660
- data/public/javascripts/jquery-validate/lib/jquery.js +0 -4376
- data/public/javascripts/jquery-validate/lib/jquery.metadata.js +0 -122
- data/public/javascripts/jquery-validate/localization/messages_ar.js +0 -24
- data/public/javascripts/jquery-validate/localization/messages_bg.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_cn.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_cs.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_da.js +0 -20
- data/public/javascripts/jquery-validate/localization/messages_de.js +0 -20
- data/public/javascripts/jquery-validate/localization/messages_el.js +0 -24
- data/public/javascripts/jquery-validate/localization/messages_es.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_fa.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_fi.js +0 -21
- data/public/javascripts/jquery-validate/localization/messages_fr.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_he.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_hu.js +0 -20
- data/public/javascripts/jquery-validate/localization/messages_it.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_kk.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_lt.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_lv.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_nl.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_no.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_pl.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_ptbr.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_ptpt.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_ro.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_ru.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_se.js +0 -21
- data/public/javascripts/jquery-validate/localization/messages_sk.js +0 -20
- data/public/javascripts/jquery-validate/localization/messages_tr.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_tw.js +0 -23
- data/public/javascripts/jquery-validate/localization/messages_ua.js +0 -23
- data/public/javascripts/jquery-validate/localization/methods_de.js +0 -12
- data/public/javascripts/jquery-validate/localization/methods_nl.js +0 -9
- data/public/javascripts/jquery-validate/localization/methods_pt.js +0 -9
- data/public/javascripts/jquery-validate/todo +0 -172
- data/public/javascripts/jquery.cookie.js +0 -96
- data/public/javascripts/jquery.filedrop.js +0 -253
- data/public/javascripts/jquery.growl.js +0 -143
- data/public/javascripts/jquery.hotkeys.js +0 -99
- data/public/javascripts/jquery.js +0 -6240
- data/public/javascripts/jquery.jstree.js +0 -3510
- data/public/javascripts/jquery.uploadify.js +0 -26
- data/public/javascripts/jquery.validate.js +0 -1147
- data/public/javascripts/loadbehind.js +0 -0
- data/public/javascripts/menu.js +0 -247
- data/public/javascripts/sitemap_jstree.js +0 -329
- data/public/javascripts/swfobject.js +0 -4
- data/public/jstree/_demo/_dump.sql +0 -20
- data/public/jstree/_demo/_inc/__mysql_errors.log +0 -0
- data/public/jstree/_demo/_inc/class._database.php +0 -146
- data/public/jstree/_demo/_inc/class._database_i.php +0 -152
- data/public/jstree/_demo/_inc/class.tree.php +0 -602
- data/public/jstree/_demo/_install.txt +0 -6
- data/public/jstree/_demo/config.php +0 -14
- data/public/jstree/_demo/index.html +0 -262
- data/public/jstree/_demo/server.php +0 -69
- data/public/jstree/_docs/!style.css +0 -37
- data/public/jstree/_docs/_drive.png +0 -0
- data/public/jstree/_docs/_html_data.html +0 -2
- data/public/jstree/_docs/_json_data.json +0 -4
- data/public/jstree/_docs/_search_data.json +0 -6
- data/public/jstree/_docs/_search_result.json +0 -1
- data/public/jstree/_docs/_xml_flat.xml +0 -12
- data/public/jstree/_docs/_xml_nest.xml +0 -18
- data/public/jstree/_docs/checkbox.html +0 -148
- data/public/jstree/_docs/contextmenu.html +0 -120
- data/public/jstree/_docs/cookies.html +0 -96
- data/public/jstree/_docs/core.html +0 -622
- data/public/jstree/_docs/crrm.html +0 -315
- data/public/jstree/_docs/dnd.html +0 -197
- data/public/jstree/_docs/hotkeys.html +0 -81
- data/public/jstree/_docs/html_data.html +0 -174
- data/public/jstree/_docs/index.html +0 -75
- data/public/jstree/_docs/json_data.html +0 -240
- data/public/jstree/_docs/languages.html +0 -138
- data/public/jstree/_docs/search.html +0 -114
- data/public/jstree/_docs/sort.html +0 -84
- data/public/jstree/_docs/syntax/!script.js +0 -2232
- data/public/jstree/_docs/syntax/!style.css +0 -511
- data/public/jstree/_docs/syntax/clipboard.swf +0 -0
- data/public/jstree/_docs/syntax/help.png +0 -0
- data/public/jstree/_docs/syntax/magnifier.png +0 -0
- data/public/jstree/_docs/syntax/page_white_code.png +0 -0
- data/public/jstree/_docs/syntax/page_white_copy.png +0 -0
- data/public/jstree/_docs/syntax/printer.png +0 -0
- data/public/jstree/_docs/syntax/wrapping.png +0 -0
- data/public/jstree/_docs/themeroller.html +0 -98
- data/public/jstree/_docs/themes.html +0 -126
- data/public/jstree/_docs/types.html +0 -173
- data/public/jstree/_docs/ui.html +0 -188
- data/public/jstree/_docs/unique.html +0 -70
- data/public/jstree/_docs/xml_data.html +0 -214
- data/public/jstree/_lib/jquery.cookie.js +0 -96
- data/public/jstree/_lib/jquery.hotkeys.js +0 -99
- data/public/jstree/_lib/jquery.js +0 -6240
- data/public/jstree/jquery.jstree.js +0 -3510
- data/public/jstree/jstree.html +0 -237
- data/public/jstree/themes/apple/bg.jpg +0 -0
- data/public/jstree/themes/apple/d.png +0 -0
- data/public/jstree/themes/apple/dot_for_ie.gif +0 -0
- data/public/jstree/themes/apple/style.css +0 -60
- data/public/jstree/themes/apple/throbber.gif +0 -0
- data/public/jstree/themes/classic/d.png +0 -0
- data/public/jstree/themes/classic/dot_for_ie.gif +0 -0
- data/public/jstree/themes/classic/style.css +0 -59
- data/public/jstree/themes/classic/throbber.gif +0 -0
- data/public/jstree/themes/default/d.gif +0 -0
- data/public/jstree/themes/default/d.png +0 -0
- data/public/jstree/themes/default/style.css +0 -73
- data/public/jstree/themes/default/throbber.gif +0 -0
- data/public/jstree/themes/default-rtl/d.gif +0 -0
- data/public/jstree/themes/default-rtl/d.png +0 -0
- data/public/jstree/themes/default-rtl/dots.gif +0 -0
- data/public/jstree/themes/default-rtl/style.css +0 -83
- data/public/jstree/themes/default-rtl/throbber.gif +0 -0
- data/public/stylesheets/dreamy.css +0 -183
- data/public/stylesheets/menu.css +0 -101
- data/public/stylesheets/sass/dreamy.sass +0 -165
- data/public/stylesheets/sass/menu.sass +0 -139
- data/public/stylesheets/sass/uploadify.sass +0 -52
- data/public/stylesheets/sass/wheels.sass +0 -25
- data/public/stylesheets/scaffold.css +0 -56
- data/public/stylesheets/ui-lightness/images/ui-anim_basic_16x16.gif +0 -0
- data/public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/public/stylesheets/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/public/stylesheets/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/public/stylesheets/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/public/stylesheets/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/stylesheets/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/public/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/public/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/public/stylesheets/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/public/stylesheets/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/public/stylesheets/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/public/stylesheets/ui-lightness/jquery-ui-1.8.2.custom.css +0 -359
- data/public/stylesheets/ui-lightness/jquery-ui-1.8.4.custom.css +0 -549
- data/public/test.html +0 -18
- /data/lib/generators/{wheels/recipes → recipes}/cancan.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/cucumber.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/default.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/design.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/devise.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/factory_girl.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/haml.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/jquery.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/mongoid.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/postgresql.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/recipes.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/remarkable.rb +0 -0
- /data/lib/generators/{wheels/recipes → recipes}/rspec.rb +0 -0
- /data/lib/generators/{wheels/snippets → snippets}/cucumber/database_config +0 -0
- /data/lib/generators/{update_wheels/templates → templates}/cancan/ability.rb +0 -0
- /data/lib/generators/{update_wheels/templates → templates}/database/postgresql.yml +0 -0
- /data/lib/generators/{update_wheels/templates → templates}/git/gitignore +0 -0
- /data/lib/generators/{wheels/templates → templates}/haml/app/views/layouts/application.html.haml +0 -0
- /data/lib/generators/{update_wheels/templates → templates}/mongoid/features/step_definitions/mongoid_steps.rb +0 -0
- /data/lib/generators/{update_wheels/templates → templates}/mongoid/features/support/hooks.rb +0 -0
- /data/lib/generators/{update_wheels → wheels_update}/LICENCE +0 -0
- /data/lib/generators/{update_wheels → wheels_update}/USAGE +0 -0
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Default text - jQuery plugin for html5 dragging files from desktop to browser
|
|
3
|
-
*
|
|
4
|
-
* Author: Weixi Yen
|
|
5
|
-
*
|
|
6
|
-
* Email: [Firstname][Lastname]@gmail.com
|
|
7
|
-
*
|
|
8
|
-
* Copyright (c) 2010 Resopollution
|
|
9
|
-
*
|
|
10
|
-
* Licensed under the MIT license:
|
|
11
|
-
* http://www.opensource.org/licenses/mit-license.php
|
|
12
|
-
*
|
|
13
|
-
* Project home:
|
|
14
|
-
* http://www.github.com/weixiyen/jquery-filedrop
|
|
15
|
-
*
|
|
16
|
-
* Version: 0.1.0
|
|
17
|
-
*
|
|
18
|
-
* Features:
|
|
19
|
-
* Allows sending of extra parameters with file.
|
|
20
|
-
* Works with Firefox 3.6+
|
|
21
|
-
* Future-compliant with HTML5 spec (will work with Webkit browsers and IE9)
|
|
22
|
-
* Usage:
|
|
23
|
-
* See README at project homepage
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
(function($){
|
|
27
|
-
|
|
28
|
-
var opts = {},
|
|
29
|
-
default_opts = {
|
|
30
|
-
url: '',
|
|
31
|
-
refresh: 1000,
|
|
32
|
-
paramname: 'userfile',
|
|
33
|
-
maxfiles: 25,
|
|
34
|
-
maxfilesize: 1, // MBs
|
|
35
|
-
data: {},
|
|
36
|
-
drop: empty,
|
|
37
|
-
dragEnter: empty,
|
|
38
|
-
dragOver: empty,
|
|
39
|
-
dragLeave: empty,
|
|
40
|
-
docEnter: empty,
|
|
41
|
-
docOver: empty,
|
|
42
|
-
docLeave: empty,
|
|
43
|
-
error: function(err, file){alert(err);},
|
|
44
|
-
uploadStarted: empty,
|
|
45
|
-
uploadFinished: empty,
|
|
46
|
-
progressUpdated: empty,
|
|
47
|
-
speedUpdated: empty
|
|
48
|
-
},
|
|
49
|
-
errors = ["BrowserNotSupported", "TooManyFiles", "FileTooLarge"],
|
|
50
|
-
doc_leave_timer,
|
|
51
|
-
stop_loop = false;
|
|
52
|
-
|
|
53
|
-
$.fn.filedrop = function(options) {
|
|
54
|
-
opts = $.extend( {}, default_opts, options );
|
|
55
|
-
|
|
56
|
-
this.get(0).addEventListener("drop", drop, true);
|
|
57
|
-
this.bind('dragenter', dragEnter).bind('dragover', dragOver).bind('dragleave', dragLeave);
|
|
58
|
-
|
|
59
|
-
document.addEventListener("drop", docDrop, true);
|
|
60
|
-
$(document).bind('dragenter', docEnter).bind('dragover', docOver).bind('dragleave', docLeave);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
function drop(e) {
|
|
64
|
-
opts.drop(e);
|
|
65
|
-
upload(e.dataTransfer.files);
|
|
66
|
-
e.preventDefault();
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function getBuilder(filename, filedata, boundary) {
|
|
71
|
-
var dashdash = '--',
|
|
72
|
-
crlf = '\r\n',
|
|
73
|
-
builder = '';
|
|
74
|
-
|
|
75
|
-
$.each(opts.data, function(i, val) {
|
|
76
|
-
if (typeof val === 'function') val = val();
|
|
77
|
-
builder += dashdash;
|
|
78
|
-
builder += boundary;
|
|
79
|
-
builder += crlf;
|
|
80
|
-
builder += 'Content-Disposition: form-data; name="'+i+'"';
|
|
81
|
-
builder += crlf;
|
|
82
|
-
builder += val;
|
|
83
|
-
builder += crlf;
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
builder += dashdash;
|
|
87
|
-
builder += boundary;
|
|
88
|
-
builder += crlf;
|
|
89
|
-
|
|
90
|
-
builder += dashdash;
|
|
91
|
-
builder += boundary;
|
|
92
|
-
builder += crlf;
|
|
93
|
-
builder += 'Content-Disposition: form-data; name="'+opts.paramname+'"';
|
|
94
|
-
builder += '; filename="' + filename + '"';
|
|
95
|
-
builder += crlf;
|
|
96
|
-
|
|
97
|
-
builder += 'Content-Type: application/octet-stream';
|
|
98
|
-
builder += crlf;
|
|
99
|
-
builder += crlf;
|
|
100
|
-
|
|
101
|
-
builder += filedata;
|
|
102
|
-
builder += crlf;
|
|
103
|
-
|
|
104
|
-
builder += dashdash;
|
|
105
|
-
builder += boundary;
|
|
106
|
-
builder += dashdash;
|
|
107
|
-
builder += crlf;
|
|
108
|
-
return builder;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function progress(e) {
|
|
112
|
-
if (e.lengthComputable) {
|
|
113
|
-
var percentage = Math.round((e.loaded * 100) / e.total);
|
|
114
|
-
if (this.currentProgress != percentage) {
|
|
115
|
-
|
|
116
|
-
this.currentProgress = percentage;
|
|
117
|
-
opts.progressUpdated(this.index, this.file, this.currentProgress);
|
|
118
|
-
|
|
119
|
-
var elapsed = new Date().getTime();
|
|
120
|
-
var diffTime = elapsed - this.currentStart;
|
|
121
|
-
if (diffTime >= opts.refresh) {
|
|
122
|
-
var diffData = e.loaded - this.startData;
|
|
123
|
-
var speed = diffData / diffTime; // KB per second
|
|
124
|
-
opts.speedUpdated(this.index, this.file, speed);
|
|
125
|
-
this.startData = e.loaded;
|
|
126
|
-
this.currentStart = elapsed;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
function upload(files) {
|
|
135
|
-
stop_loop = false;
|
|
136
|
-
if (!files) {
|
|
137
|
-
opts.error(errors[0]);
|
|
138
|
-
return false;
|
|
139
|
-
}
|
|
140
|
-
var len = files.length;
|
|
141
|
-
|
|
142
|
-
if (len > opts.maxfiles) {
|
|
143
|
-
opts.error(errors[1]);
|
|
144
|
-
return false;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
for (var i=0; i<len; i++) {
|
|
148
|
-
if (stop_loop) return false;
|
|
149
|
-
try {
|
|
150
|
-
if (i === len) return;
|
|
151
|
-
var reader = new FileReader(),
|
|
152
|
-
max_file_size = 1048576 * opts.maxfilesize;
|
|
153
|
-
|
|
154
|
-
reader.index = i;
|
|
155
|
-
reader.file = files[i];
|
|
156
|
-
reader.len = len;
|
|
157
|
-
if (reader.file.size > max_file_size) {
|
|
158
|
-
opts.error(errors[2], reader.file);
|
|
159
|
-
return false;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
reader.addEventListener("loadend", send, false);
|
|
163
|
-
reader.readAsBinaryString(files[i]);
|
|
164
|
-
} catch(err) {
|
|
165
|
-
opts.error(errors[0]);
|
|
166
|
-
return false;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function send(e) {
|
|
171
|
-
var xhr = new XMLHttpRequest(),
|
|
172
|
-
upload = xhr.upload,
|
|
173
|
-
file = e.target.file,
|
|
174
|
-
index = e.target.index,
|
|
175
|
-
start_time = new Date().getTime(),
|
|
176
|
-
boundary = '------multipartformboundary' + (new Date).getTime(),
|
|
177
|
-
builder = getBuilder(file.name, e.target.result, boundary);
|
|
178
|
-
|
|
179
|
-
upload.index = index;
|
|
180
|
-
upload.file = file;
|
|
181
|
-
upload.downloadStartTime = start_time;
|
|
182
|
-
upload.currentStart = start_time;
|
|
183
|
-
upload.currentProgress = 0;
|
|
184
|
-
upload.startData = 0;
|
|
185
|
-
upload.addEventListener("progress", progress, false);
|
|
186
|
-
|
|
187
|
-
xhr.open("POST", opts.url, true);
|
|
188
|
-
xhr.setRequestHeader('content-type', 'multipart/form-data; boundary='
|
|
189
|
-
+ boundary);
|
|
190
|
-
|
|
191
|
-
xhr.sendAsBinary(builder);
|
|
192
|
-
|
|
193
|
-
opts.uploadStarted(index, file, e.target.len);
|
|
194
|
-
|
|
195
|
-
xhr.onload = function() {
|
|
196
|
-
if (xhr.responseText) {
|
|
197
|
-
var now = new Date().getTime(),
|
|
198
|
-
timeDiff = now - start_time,
|
|
199
|
-
result = opts.uploadFinished(index, file, eval( '[' + xhr.responseText + ']' ), timeDiff);
|
|
200
|
-
if (result === false) stop_loop = true;
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
function dragEnter(e) {
|
|
207
|
-
clearTimeout(doc_leave_timer);
|
|
208
|
-
e.preventDefault();
|
|
209
|
-
opts.dragEnter(e);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
function dragOver(e) {
|
|
213
|
-
clearTimeout(doc_leave_timer);
|
|
214
|
-
e.preventDefault();
|
|
215
|
-
opts.docOver(e);
|
|
216
|
-
opts.dragOver(e);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
function dragLeave(e) {
|
|
220
|
-
clearTimeout(doc_leave_timer);
|
|
221
|
-
opts.dragLeave(e);
|
|
222
|
-
e.stopPropagation();
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
function docDrop(e) {
|
|
226
|
-
e.preventDefault();
|
|
227
|
-
opts.docLeave(e);
|
|
228
|
-
return false;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
function docEnter(e) {
|
|
232
|
-
clearTimeout(doc_leave_timer);
|
|
233
|
-
e.preventDefault();
|
|
234
|
-
opts.docEnter(e);
|
|
235
|
-
return false;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
function docOver(e) {
|
|
239
|
-
clearTimeout(doc_leave_timer);
|
|
240
|
-
e.preventDefault();
|
|
241
|
-
opts.docOver(e);
|
|
242
|
-
return false;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
function docLeave(e) {
|
|
246
|
-
doc_leave_timer = setTimeout(function(){
|
|
247
|
-
opts.docLeave(e);
|
|
248
|
-
}, 200);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
function empty(){}
|
|
252
|
-
|
|
253
|
-
})(jQuery);
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* jQuery Growl plugin
|
|
3
|
-
* Version 1.0.2 (8/1/2009)
|
|
4
|
-
* @requires jQuery v1.3.2 or later
|
|
5
|
-
*
|
|
6
|
-
* Examples at: http://fragmentedcode.com/jquery-growl
|
|
7
|
-
* Copyright (c) 2008-2009 David Higgins
|
|
8
|
-
*
|
|
9
|
-
* Special thanks to Daniel Mota for inspiration:
|
|
10
|
-
* http://icebeat.bitacoras.com/mootools/growl/
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/*
|
|
14
|
-
USAGE:
|
|
15
|
-
|
|
16
|
-
$.growl(title, msg);
|
|
17
|
-
$.growl(title, msg, image);
|
|
18
|
-
$.growl(title, msg, image, priority);
|
|
19
|
-
|
|
20
|
-
THEME/SKIN:
|
|
21
|
-
|
|
22
|
-
You can override the default look and feel by updating these objects:
|
|
23
|
-
$.growl.settings.displayTimeout = 4000;
|
|
24
|
-
$.growl.settings.noticeTemplate = ''
|
|
25
|
-
+ '<div>'
|
|
26
|
-
+ '<div style="float: right; background-image: url(my.growlTheme/normalTop.png); position: relative; width: 259px; height: 16px; margin: 0pt;"></div>'
|
|
27
|
-
+ '<div style="float: right; background-image: url(my.growlTheme/normalBackground.png); position: relative; display: block; color: #ffffff; font-family: Arial; font-size: 12px; line-height: 14px; width: 259px; margin: 0pt;">'
|
|
28
|
-
+ ' <img style="margin: 14px; margin-top: 0px; float: left;" src="%image%" />'
|
|
29
|
-
+ ' <h3 style="margin: 0pt; margin-left: 77px; padding-bottom: 10px; font-size: 13px;">%title%</h3>'
|
|
30
|
-
+ ' <p style="margin: 0pt 14px; margin-left: 77px; font-size: 12px;">%message%</p>'
|
|
31
|
-
+ '</div>'
|
|
32
|
-
+ '<div style="float: right; background-image: url(my.growlTheme/normalBottom.png); position: relative; width: 259px; height: 16px; margin-bottom: 10px;"></div>'
|
|
33
|
-
+ '</div>';
|
|
34
|
-
$.growl.settings.noticeCss = {
|
|
35
|
-
position: 'relative'
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
To change the 'dock' look, and position:
|
|
39
|
-
|
|
40
|
-
$.growl.settings.dockTemplate = '<div></div>';
|
|
41
|
-
$.growl.settings.dockCss = {
|
|
42
|
-
position: 'absolute',
|
|
43
|
-
top: '10px',
|
|
44
|
-
right: '10px',
|
|
45
|
-
width: '300px'
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
The dockCss will allow you to 'dock' the notifications to a specific area
|
|
49
|
-
on the page, such as TopRight (the default) or TopLeft, perhaps even in a
|
|
50
|
-
smaller area with "overflow: scroll" enabled?
|
|
51
|
-
*/
|
|
52
|
-
|
|
53
|
-
(function($) {
|
|
54
|
-
|
|
55
|
-
$.growl = function(title,message,image,priority) { notify(title,message,image,priority); }
|
|
56
|
-
$.growl.version = "1.0.2";
|
|
57
|
-
|
|
58
|
-
function create(rebuild) {
|
|
59
|
-
var instance = document.getElementById('growlDock');
|
|
60
|
-
if(!instance || rebuild) {
|
|
61
|
-
instance = $(jQuery.growl.settings.dockTemplate).attr('id', 'growlDock').addClass('growl');
|
|
62
|
-
if(jQuery.growl.settings.defaultStylesheet) {
|
|
63
|
-
$('head').append('<link rel="stylesheet" type="text/css" href="' + jQuery.growl.settings.defaultStylesheet + '" />');
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
} else {
|
|
67
|
-
instance = $(instance);
|
|
68
|
-
}
|
|
69
|
-
$('body').append(instance.css(jQuery.growl.settings.dockCss));
|
|
70
|
-
return instance;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
function r(text, expr, val) {
|
|
74
|
-
while(expr.test(text)) {
|
|
75
|
-
text = text.replace(expr, val);
|
|
76
|
-
}
|
|
77
|
-
return text;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
function notify(title,message,image,priority) {
|
|
81
|
-
var instance = create();
|
|
82
|
-
var html = jQuery.growl.settings.noticeTemplate;
|
|
83
|
-
if(typeof(html) == 'object') html = $(html).html();
|
|
84
|
-
html = r(html, /%message%/, (message?message:''));
|
|
85
|
-
html = r(html, /%title%/, (title?title:''));
|
|
86
|
-
html = r(html, /%image%/, (image?image:jQuery.growl.settings.defaultImage));
|
|
87
|
-
html = r(html, /%priority%/, (priority?priority:'normal'));
|
|
88
|
-
|
|
89
|
-
var notice = $(html)
|
|
90
|
-
.hide()
|
|
91
|
-
.css(jQuery.growl.settings.noticeCss)
|
|
92
|
-
.fadeIn(jQuery.growl.settings.notice);;
|
|
93
|
-
|
|
94
|
-
$.growl.settings.noticeDisplay(notice);
|
|
95
|
-
instance.append(notice);
|
|
96
|
-
$('a[rel="close"]', notice).click(function() {
|
|
97
|
-
notice.remove();
|
|
98
|
-
});
|
|
99
|
-
if ($.growl.settings.displayTimeout > 0) {
|
|
100
|
-
setTimeout(function(){
|
|
101
|
-
jQuery.growl.settings.noticeRemove(notice, function(){
|
|
102
|
-
notice.remove();
|
|
103
|
-
});
|
|
104
|
-
}, jQuery.growl.settings.displayTimeout);
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
// default settings
|
|
110
|
-
$.growl.settings = {
|
|
111
|
-
dockTemplate: '<div></div>',
|
|
112
|
-
dockCss: {
|
|
113
|
-
position: 'fixed',
|
|
114
|
-
top: '10px',
|
|
115
|
-
right: '10px',
|
|
116
|
-
width: '300px',
|
|
117
|
-
zIndex: 50000
|
|
118
|
-
},
|
|
119
|
-
noticeTemplate:
|
|
120
|
-
'<div class="notice">' +
|
|
121
|
-
' <h3 style="margin-top: 15px"><a rel="close">%title%</a></h3>' +
|
|
122
|
-
' <p>%message%</p>' +
|
|
123
|
-
'</div>',
|
|
124
|
-
noticeCss: {
|
|
125
|
-
opacity: .75,
|
|
126
|
-
backgroundColor: '#333333',
|
|
127
|
-
color: '#ffffff'
|
|
128
|
-
},
|
|
129
|
-
noticeDisplay: function(notice) {
|
|
130
|
-
notice.css({'opacity':'0'}).fadeIn(jQuery.growl.settings.noticeFadeTimeout);
|
|
131
|
-
},
|
|
132
|
-
noticeRemove: function(notice, callback) {
|
|
133
|
-
notice.animate({opacity: '0', height: '0px'}, {duration:jQuery.growl.settings.noticeFadeTimeout, complete: callback});
|
|
134
|
-
},
|
|
135
|
-
noticeFadeTimeout: 'slow',
|
|
136
|
-
displayTimeout: 3500,
|
|
137
|
-
defaultImage: 'growl.jpg',
|
|
138
|
-
defaultStylesheet: null,
|
|
139
|
-
noticeElement: function(el) {
|
|
140
|
-
$.growl.settings.noticeTemplate = $(el);
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
})(jQuery);
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* jQuery Hotkeys Plugin
|
|
3
|
-
* Copyright 2010, John Resig
|
|
4
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
5
|
-
*
|
|
6
|
-
* Based upon the plugin by Tzury Bar Yochay:
|
|
7
|
-
* http://github.com/tzuryby/hotkeys
|
|
8
|
-
*
|
|
9
|
-
* Original idea by:
|
|
10
|
-
* Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
(function(jQuery){
|
|
14
|
-
|
|
15
|
-
jQuery.hotkeys = {
|
|
16
|
-
version: "0.8",
|
|
17
|
-
|
|
18
|
-
specialKeys: {
|
|
19
|
-
8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause",
|
|
20
|
-
20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home",
|
|
21
|
-
37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del",
|
|
22
|
-
96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7",
|
|
23
|
-
104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/",
|
|
24
|
-
112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8",
|
|
25
|
-
120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta"
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
shiftNums: {
|
|
29
|
-
"`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&",
|
|
30
|
-
"8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<",
|
|
31
|
-
".": ">", "/": "?", "\\": "|"
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
function keyHandler( handleObj ) {
|
|
36
|
-
// Only care when a possible input has been specified
|
|
37
|
-
if ( typeof handleObj.data !== "string" ) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
var origHandler = handleObj.handler,
|
|
42
|
-
keys = handleObj.data.toLowerCase().split(" ");
|
|
43
|
-
|
|
44
|
-
handleObj.handler = function( event ) {
|
|
45
|
-
// Don't fire in text-accepting inputs that we didn't directly bind to
|
|
46
|
-
if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) ||
|
|
47
|
-
event.target.type === "text") ) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Keypress represents characters, not special keys
|
|
52
|
-
var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[ event.which ],
|
|
53
|
-
character = String.fromCharCode( event.which ).toLowerCase(),
|
|
54
|
-
key, modif = "", possible = {};
|
|
55
|
-
|
|
56
|
-
// check combinations (alt|ctrl|shift+anything)
|
|
57
|
-
if ( event.altKey && special !== "alt" ) {
|
|
58
|
-
modif += "alt+";
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if ( event.ctrlKey && special !== "ctrl" ) {
|
|
62
|
-
modif += "ctrl+";
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// TODO: Need to make sure this works consistently across platforms
|
|
66
|
-
if ( event.metaKey && !event.ctrlKey && special !== "meta" ) {
|
|
67
|
-
modif += "meta+";
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if ( event.shiftKey && special !== "shift" ) {
|
|
71
|
-
modif += "shift+";
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if ( special ) {
|
|
75
|
-
possible[ modif + special ] = true;
|
|
76
|
-
|
|
77
|
-
} else {
|
|
78
|
-
possible[ modif + character ] = true;
|
|
79
|
-
possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true;
|
|
80
|
-
|
|
81
|
-
// "$" can be triggered as "Shift+4" or "Shift+$" or just "$"
|
|
82
|
-
if ( modif === "shift+" ) {
|
|
83
|
-
possible[ jQuery.hotkeys.shiftNums[ character ] ] = true;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
for ( var i = 0, l = keys.length; i < l; i++ ) {
|
|
88
|
-
if ( possible[ keys[i] ] ) {
|
|
89
|
-
return origHandler.apply( this, arguments );
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
jQuery.each([ "keydown", "keyup", "keypress" ], function() {
|
|
96
|
-
jQuery.event.special[ this ] = { add: keyHandler };
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
})( jQuery );
|