wagn 1.19.0 → 1.19.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/attach.feature +2 -2
- data/features/step_definitions/wagn_steps.rb +1 -1
- data/lib/wagn/application.rb +4 -1
- data/lib/wagn/commands.rb +2 -1
- data/lib/wagn/generators/wagn/templates/Gemfile +4 -2
- data/lib/wagn/generators/wagn/templates/config/application.rb +27 -0
- data/lib/wagn/tasks/wagn.rake +9 -23
- data/rails/engine-routes.rb +2 -2
- metadata +5 -10
- data/app/assets/javascripts/application.js +0 -25
- data/app/assets/javascripts/jquery.autosize.js +0 -254
- data/app/assets/javascripts/jquery.fileupload.js +0 -1111
- data/app/assets/javascripts/jquery.iframe-transport.js +0 -156
- data/app/assets/javascripts/jquery.ui.autocomplete.html.js +0 -40
@@ -1,156 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* jQuery Iframe Transport Plugin 1.2.5
|
3
|
-
* https://github.com/blueimp/jQuery-File-Upload
|
4
|
-
*
|
5
|
-
* Copyright 2011, Sebastian Tschan
|
6
|
-
* https://blueimp.net
|
7
|
-
*
|
8
|
-
* Licensed under the MIT license:
|
9
|
-
* http://creativecommons.org/licenses/MIT/
|
10
|
-
*/
|
11
|
-
|
12
|
-
/*jslint unparam: true, nomen: true */
|
13
|
-
/*global jQuery, document */
|
14
|
-
|
15
|
-
(function ($) {
|
16
|
-
'use strict';
|
17
|
-
|
18
|
-
// Helper variable to create unique names for the transport iframes:
|
19
|
-
var counter = 0;
|
20
|
-
|
21
|
-
// The iframe transport accepts three additional options:
|
22
|
-
// options.fileInput: a jQuery collection of file input fields
|
23
|
-
// options.paramName: the parameter name for the file form data,
|
24
|
-
// overrides the name property of the file input field(s)
|
25
|
-
// options.formData: an array of objects with name and value properties,
|
26
|
-
// equivalent to the return data of .serializeArray(), e.g.:
|
27
|
-
// [{name: 'a', value: 1}, {name: 'b', value: 2}]
|
28
|
-
$.ajaxTransport('iframe', function (options) {
|
29
|
-
if (options.async && (options.type === 'POST' || options.type === 'GET')) {
|
30
|
-
var form,
|
31
|
-
iframe;
|
32
|
-
return {
|
33
|
-
send: function (_, completeCallback) {
|
34
|
-
form = $('<form style="display:none;"></form>');
|
35
|
-
// javascript:false as initial iframe src
|
36
|
-
// prevents warning popups on HTTPS in IE6.
|
37
|
-
// IE versions below IE8 cannot set the name property of
|
38
|
-
// elements that have already been added to the DOM,
|
39
|
-
// so we set the name along with the iframe HTML markup:
|
40
|
-
iframe = $(
|
41
|
-
'<iframe src="javascript:false;" name="iframe-transport-' +
|
42
|
-
(counter += 1) + '"></iframe>'
|
43
|
-
).bind('load', function () {
|
44
|
-
var fileInputClones;
|
45
|
-
iframe
|
46
|
-
.unbind('load')
|
47
|
-
.bind('load', function () {
|
48
|
-
var response;
|
49
|
-
// Wrap in a try/catch block to catch exceptions thrown
|
50
|
-
// when trying to access cross-domain iframe contents:
|
51
|
-
try {
|
52
|
-
response = iframe.contents();
|
53
|
-
// Google Chrome and Firefox do not throw an
|
54
|
-
// exception when calling iframe.contents() on
|
55
|
-
// cross-domain requests, so we unify the response:
|
56
|
-
if (!response.length || !response[0].firstChild) {
|
57
|
-
throw new Error();
|
58
|
-
}
|
59
|
-
} catch (e) {
|
60
|
-
response = undefined;
|
61
|
-
}
|
62
|
-
// The complete callback returns the
|
63
|
-
// iframe content document as response object:
|
64
|
-
completeCallback(
|
65
|
-
200,
|
66
|
-
'success',
|
67
|
-
{'iframe': response}
|
68
|
-
);
|
69
|
-
// Fix for IE endless progress bar activity bug
|
70
|
-
// (happens on form submits to iframe targets):
|
71
|
-
$('<iframe src="javascript:false;"></iframe>')
|
72
|
-
.appendTo(form);
|
73
|
-
form.remove();
|
74
|
-
});
|
75
|
-
form
|
76
|
-
.prop('target', iframe.prop('name'))
|
77
|
-
.prop('action', options.url)
|
78
|
-
.prop('method', options.type);
|
79
|
-
if (options.formData) {
|
80
|
-
$.each(options.formData, function (index, field) {
|
81
|
-
$('<input type="hidden"/>')
|
82
|
-
.prop('name', field.name)
|
83
|
-
.val(field.value)
|
84
|
-
.appendTo(form);
|
85
|
-
});
|
86
|
-
}
|
87
|
-
if (options.fileInput && options.fileInput.length &&
|
88
|
-
options.type === 'POST') {
|
89
|
-
fileInputClones = options.fileInput.clone();
|
90
|
-
// Insert a clone for each file input field:
|
91
|
-
options.fileInput.after(function (index) {
|
92
|
-
return fileInputClones[index];
|
93
|
-
});
|
94
|
-
if (options.paramName) {
|
95
|
-
options.fileInput.each(function () {
|
96
|
-
$(this).prop('name', options.paramName);
|
97
|
-
});
|
98
|
-
}
|
99
|
-
// Appending the file input fields to the hidden form
|
100
|
-
// removes them from their original location:
|
101
|
-
form
|
102
|
-
.append(options.fileInput)
|
103
|
-
.prop('enctype', 'multipart/form-data')
|
104
|
-
// enctype must be set as encoding for IE:
|
105
|
-
.prop('encoding', 'multipart/form-data');
|
106
|
-
}
|
107
|
-
form.submit();
|
108
|
-
// Insert the file input fields at their original location
|
109
|
-
// by replacing the clones with the originals:
|
110
|
-
if (fileInputClones && fileInputClones.length) {
|
111
|
-
options.fileInput.each(function (index, input) {
|
112
|
-
var clone = $(fileInputClones[index]);
|
113
|
-
$(input).prop('name', clone.prop('name'));
|
114
|
-
clone.replaceWith(input);
|
115
|
-
});
|
116
|
-
}
|
117
|
-
});
|
118
|
-
form.append(iframe).appendTo(document.body);
|
119
|
-
},
|
120
|
-
abort: function () {
|
121
|
-
if (iframe) {
|
122
|
-
// javascript:false as iframe src aborts the request
|
123
|
-
// and prevents warning popups on HTTPS in IE6.
|
124
|
-
// concat is used to avoid the "Script URL" JSLint error:
|
125
|
-
iframe
|
126
|
-
.unbind('load')
|
127
|
-
.prop('src', 'javascript'.concat(':false;'));
|
128
|
-
}
|
129
|
-
if (form) {
|
130
|
-
form.remove();
|
131
|
-
}
|
132
|
-
}
|
133
|
-
};
|
134
|
-
}
|
135
|
-
});
|
136
|
-
|
137
|
-
// The iframe transport returns the iframe content document as response.
|
138
|
-
// The following adds converters from iframe to text, json, html, and script:
|
139
|
-
$.ajaxSetup({
|
140
|
-
converters: {
|
141
|
-
'iframe text': function (iframe) {
|
142
|
-
return $(iframe[0].body).text();
|
143
|
-
},
|
144
|
-
'iframe json': function (iframe) {
|
145
|
-
return $.parseJSON($(iframe[0].body).text());
|
146
|
-
},
|
147
|
-
'iframe html': function (iframe) {
|
148
|
-
return $(iframe[0].body).html();
|
149
|
-
},
|
150
|
-
'iframe script': function (iframe) {
|
151
|
-
return $.globalEval($(iframe[0].body).text());
|
152
|
-
}
|
153
|
-
}
|
154
|
-
});
|
155
|
-
|
156
|
-
}(jQuery));
|
@@ -1,40 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* jQuery UI Autocomplete HTML Extension
|
3
|
-
*
|
4
|
-
* Copyright 2010, Scott González (http://scottgonzalez.com)
|
5
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
6
|
-
*
|
7
|
-
* http://github.com/scottgonzalez/jquery-ui-extensions
|
8
|
-
*/
|
9
|
-
(function( $ ) {
|
10
|
-
|
11
|
-
var proto = $.ui.autocomplete.prototype,
|
12
|
-
initSource = proto._initSource;
|
13
|
-
|
14
|
-
function filter( array, term ) {
|
15
|
-
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );
|
16
|
-
return $.grep( array, function(value) {
|
17
|
-
return matcher.test( $( "<div>" ).html( value.label || value.value || value ).text() );
|
18
|
-
});
|
19
|
-
}
|
20
|
-
|
21
|
-
$.extend( proto, {
|
22
|
-
_initSource: function() {
|
23
|
-
if ( this.options.html && $.isArray(this.options.source) ) {
|
24
|
-
this.source = function( request, response ) {
|
25
|
-
response( filter( this.options.source, request.term ) );
|
26
|
-
};
|
27
|
-
} else {
|
28
|
-
initSource.call( this );
|
29
|
-
}
|
30
|
-
},
|
31
|
-
|
32
|
-
_renderItem: function( ul, item) {
|
33
|
-
return $( "<li></li>" )
|
34
|
-
.data( "item.autocomplete", item )
|
35
|
-
.append( $( "<a></a>" )[ this.options.html ? "html" : "text" ]( item.label ) )
|
36
|
-
.appendTo( ul );
|
37
|
-
}
|
38
|
-
});
|
39
|
-
|
40
|
-
})( jQuery );
|