umlaut 3.0.0alpha5 → 3.0.0alpha6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/app/assets/javascripts/umlaut/update_html.js +21 -0
  2. data/app/assets/javascripts/umlaut_ui.js +15 -0
  3. data/app/helpers/resolve_helper.rb +14 -4
  4. data/app/views/resolve/api.xml.builder +10 -14
  5. data/lib/#Untitled-1# +14 -0
  6. data/lib/umlaut/routes.rb +14 -1
  7. data/lib/umlaut/version.rb +1 -1
  8. data/lib/umlaut.rb +12 -9
  9. data/test/dummy/tmp/cache/assets/C5F/340/sprockets%2F99692920160b7a279b86a80415b79db7 +0 -0
  10. data/test/dummy/tmp/cache/assets/C70/4D0/sprockets%2F034ad2036e623081bd352800786dfe80 +0 -0
  11. data/test/dummy/tmp/cache/assets/CBB/9C0/sprockets%2F706f28923fb754cad04b9107c89986a1 +31 -0
  12. data/test/dummy/tmp/cache/assets/CBF/B60/sprockets%2F08ca89671549936265dcb673bf02e36f +0 -0
  13. data/test/dummy/tmp/cache/assets/CC9/9F0/sprockets%2F306166316e2cafd13c15e62b51a2339d +0 -0
  14. data/test/dummy/tmp/cache/assets/CF7/2B0/sprockets%2F25a7c73655bd3598173b39d9f98bcd46 +880 -0
  15. data/test/dummy/tmp/cache/assets/CFE/080/sprockets%2F37fe9f4255baddbd549a659914929398 +0 -0
  16. data/test/dummy/tmp/cache/assets/D0B/E10/sprockets%2F1444763abc4444a8e129efdb9a43235f +378 -0
  17. data/test/dummy/tmp/cache/assets/D1F/830/sprockets%2Fe6a7a907a8e9b43780a80fe69a92913d +11773 -0
  18. data/test/dummy/tmp/cache/assets/D22/060/sprockets%2F9aec77b768e91a802d284271c58e2f7e +21361 -0
  19. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  20. data/test/dummy/tmp/cache/assets/D33/6D0/sprockets%2F500129c57f1146e556ec3aacd6cd38c1 +158 -0
  21. data/test/dummy/tmp/cache/assets/D50/7B0/sprockets%2F6df95fb9a4189df351c1c88546c84a1d +394 -0
  22. data/test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +877 -0
  23. data/test/dummy/tmp/cache/assets/D69/820/sprockets%2F55a4f1a7c4918d71c0d4fb5b7dd4c055 +9272 -0
  24. data/test/dummy/tmp/cache/assets/D71/6B0/sprockets%2Fde558b71b494cf09b1bf055c8dff0353 +53 -0
  25. data/test/dummy/tmp/cache/assets/D72/610/sprockets%2Fa8c708eeb30ef93de34d755d4f45d023 +864 -0
  26. data/test/dummy/tmp/cache/assets/D76/AD0/sprockets%2Fe2158cde93188cf5ab6457bc6d6602ec +41 -0
  27. data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +21744 -0
  28. data/test/dummy/tmp/cache/assets/D9B/770/sprockets%2F8aacf02eb7dbb0949704b28f27b87e0b +39 -0
  29. data/test/dummy/tmp/cache/assets/DD0/140/sprockets%2F1656d1d8f4c13fe42aff6553c6cdcda7 +11789 -0
  30. data/test/dummy/tmp/cache/assets/DE8/790/sprockets%2Fd1333bde2b9aafcc712d11dd09ab35d8 +0 -0
  31. data/test/dummy/tmp/cache/assets/DF1/AA0/sprockets%2Fedd37b0fdb6157fccb2297a8a10acc90 +9288 -0
  32. data/test/dummy/tmp/cache/assets/E03/570/sprockets%2F493bdc0ac14cd4f57fdfe4253f992bde +14 -0
  33. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  34. data/test/dummy/tmp/cache/assets/E5F/960/sprockets%2Fdc007b6cad5c7ef08e33ec28cfff0ef6 +0 -0
  35. metadata +200 -98
  36. data/test/dummy/config/database-jhu.yml +0 -44
  37. data/test/dummy/config/database.yml +0 -53
@@ -0,0 +1,378 @@
1
+ o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1325695618.028008: @value{ I" length:EFi�;I" digest;
2
+ F"%2caafa0c2617f9985c1a0b07ebaefadfI" source;
3
+ FI"�;(function($, undefined) {
4
+
5
+ /**
6
+ * Unobtrusive scripting adapter for jQuery
7
+ *
8
+ * Requires jQuery 1.6.0 or later.
9
+ * https://github.com/rails/jquery-ujs
10
+
11
+ * Uploading file using rails.js
12
+ * =============================
13
+ *
14
+ * By default, browsers do not allow files to be uploaded via AJAX. As a result, if there are any non-blank file fields
15
+ * in the remote form, this adapter aborts the AJAX submission and allows the form to submit through standard means.
16
+ *
17
+ * The `ajax:aborted:file` event allows you to bind your own handler to process the form submission however you wish.
18
+ *
19
+ * Ex:
20
+ * $('form').live('ajax:aborted:file', function(event, elements){
21
+ * // Implement own remote file-transfer handler here for non-blank file inputs passed in `elements`.
22
+ * // Returning false in this handler tells rails.js to disallow standard form submission
23
+ * return false;
24
+ * });
25
+ *
26
+ * The `ajax:aborted:file` event is fired when a file-type input is detected with a non-blank value.
27
+ *
28
+ * Third-party tools can use this hook to detect when an AJAX file upload is attempted, and then use
29
+ * techniques like the iframe method to upload the file instead.
30
+ *
31
+ * Required fields in rails.js
32
+ * ===========================
33
+ *
34
+ * If any blank required inputs (required="required") are detected in the remote form, the whole form submission
35
+ * is canceled. Note that this is unlike file inputs, which still allow standard (non-AJAX) form submission.
36
+ *
37
+ * The `ajax:aborted:required` event allows you to bind your own handler to inform the user of blank required inputs.
38
+ *
39
+ * !! Note that Opera does not fire the form's submit event if there are blank required inputs, so this event may never
40
+ * get fired in Opera. This event is what causes other browsers to exhibit the same submit-aborting behavior.
41
+ *
42
+ * Ex:
43
+ * $('form').live('ajax:aborted:required', function(event, elements){
44
+ * // Returning false in this handler tells rails.js to submit the form anyway.
45
+ * // The blank required inputs are passed to this function in `elements`.
46
+ * return ! confirm("Would you like to submit the form with missing info?");
47
+ * });
48
+ */
49
+
50
+ // Shorthand to make it a little easier to call public rails functions from within rails.js
51
+ var rails;
52
+
53
+ $.rails = rails = {
54
+ // Link elements bound by jquery-ujs
55
+ linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]',
56
+
57
+ // Select elements bound by jquery-ujs
58
+ inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',
59
+
60
+ // Form elements bound by jquery-ujs
61
+ formSubmitSelector: 'form',
62
+
63
+ // Form input elements bound by jquery-ujs
64
+ formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not(button[type])',
65
+
66
+ // Form input elements disabled during form submission
67
+ disableSelector: 'input[data-disable-with], button[data-disable-with], textarea[data-disable-with]',
68
+
69
+ // Form input elements re-enabled after form submission
70
+ enableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled',
71
+
72
+ // Form required input elements
73
+ requiredInputSelector: 'input[name][required]:not([disabled]),textarea[name][required]:not([disabled])',
74
+
75
+ // Form file input elements
76
+ fileInputSelector: 'input:file',
77
+
78
+ // Link onClick disable selector with possible reenable after remote submission
79
+ linkDisableSelector: 'a[data-disable-with]',
80
+
81
+ // Make sure that every Ajax request sends the CSRF token
82
+ CSRFProtection: function(xhr) {
83
+ var token = $('meta[name="csrf-token"]').attr('content');
84
+ if (token) xhr.setRequestHeader('X-CSRF-Token', token);
85
+ },
86
+
87
+ // Triggers an event on an element and returns false if the event result is false
88
+ fire: function(obj, name, data) {
89
+ var event = $.Event(name);
90
+ obj.trigger(event, data);
91
+ return event.result !== false;
92
+ },
93
+
94
+ // Default confirm dialog, may be overridden with custom confirm dialog in $.rails.confirm
95
+ confirm: function(message) {
96
+ return confirm(message);
97
+ },
98
+
99
+ // Default ajax function, may be overridden with custom function in $.rails.ajax
100
+ ajax: function(options) {
101
+ return $.ajax(options);
102
+ },
103
+
104
+ // Submits "remote" forms and links with ajax
105
+ handleRemote: function(element) {
106
+ var method, url, data,
107
+ crossDomain = element.data('cross-domain') || null,
108
+ dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType),
109
+ options;
110
+
111
+ if (rails.fire(element, 'ajax:before')) {
112
+
113
+ if (element.is('form')) {
114
+ method = element.attr('method');
115
+ url = element.attr('action');
116
+ data = element.serializeArray();
117
+ // memoized value from clicked submit button
118
+ var button = element.data('ujs:submit-button');
119
+ if (button) {
120
+ data.push(button);
121
+ element.data('ujs:submit-button', null);
122
+ }
123
+ } else if (element.is(rails.inputChangeSelector)) {
124
+ method = element.data('method');
125
+ url = element.data('url');
126
+ data = element.serialize();
127
+ if (element.data('params')) data = data + "&" + element.data('params');
128
+ } else {
129
+ method = element.data('method');
130
+ url = element.attr('href');
131
+ data = element.data('params') || null;
132
+ }
133
+
134
+ options = {
135
+ type: method || 'GET', data: data, dataType: dataType, crossDomain: crossDomain,
136
+ // stopping the "ajax:beforeSend" event will cancel the ajax request
137
+ beforeSend: function(xhr, settings) {
138
+ if (settings.dataType === undefined) {
139
+ xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
140
+ }
141
+ return rails.fire(element, 'ajax:beforeSend', [xhr, settings]);
142
+ },
143
+ success: function(data, status, xhr) {
144
+ element.trigger('ajax:success', [data, status, xhr]);
145
+ },
146
+ complete: function(xhr, status) {
147
+ element.trigger('ajax:complete', [xhr, status]);
148
+ },
149
+ error: function(xhr, status, error) {
150
+ element.trigger('ajax:error', [xhr, status, error]);
151
+ }
152
+ };
153
+ // Only pass url to `ajax` options if not blank
154
+ if (url) { options.url = url; }
155
+
156
+ return rails.ajax(options);
157
+ } else {
158
+ return false;
159
+ }
160
+ },
161
+
162
+ // Handles "data-method" on links such as:
163
+ // <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a>
164
+ handleMethod: function(link) {
165
+ var href = link.attr('href'),
166
+ method = link.data('method'),
167
+ target = link.attr('target'),
168
+ csrf_token = $('meta[name=csrf-token]').attr('content'),
169
+ csrf_param = $('meta[name=csrf-param]').attr('content'),
170
+ form = $('<form method="post" action="' + href + '"></form>'),
171
+ metadata_input = '<input name="_method" value="' + method + '" type="hidden" />';
172
+
173
+ if (csrf_param !== undefined && csrf_token !== undefined) {
174
+ metadata_input += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />';
175
+ }
176
+
177
+ if (target) { form.attr('target', target); }
178
+
179
+ form.hide().append(metadata_input).appendTo('body');
180
+ form.submit();
181
+ },
182
+
183
+ /* Disables form elements:
184
+ - Caches element value in 'ujs:enable-with' data store
185
+ - Replaces element text with value of 'data-disable-with' attribute
186
+ - Sets disabled property to true
187
+ */
188
+ disableFormElements: function(form) {
189
+ form.find(rails.disableSelector).each(function() {
190
+ var element = $(this), method = element.is('button') ? 'html' : 'val';
191
+ element.data('ujs:enable-with', element[method]());
192
+ element[method](element.data('disable-with'));
193
+ element.prop('disabled', true);
194
+ });
195
+ },
196
+
197
+ /* Re-enables disabled form elements:
198
+ - Replaces element text with cached value from 'ujs:enable-with' data store (created in `disableFormElements`)
199
+ - Sets disabled property to false
200
+ */
201
+ enableFormElements: function(form) {
202
+ form.find(rails.enableSelector).each(function() {
203
+ var element = $(this), method = element.is('button') ? 'html' : 'val';
204
+ if (element.data('ujs:enable-with')) element[method](element.data('ujs:enable-with'));
205
+ element.prop('disabled', false);
206
+ });
207
+ },
208
+
209
+ /* For 'data-confirm' attribute:
210
+ - Fires `confirm` event
211
+ - Shows the confirmation dialog
212
+ - Fires the `confirm:complete` event
213
+
214
+ Returns `true` if no function stops the chain and user chose yes; `false` otherwise.
215
+ Attaching a handler to the element's `confirm` event that returns a `falsy` value cancels the confirmation dialog.
216
+ Attaching a handler to the element's `confirm:complete` event that returns a `falsy` value makes this function
217
+ return false. The `confirm:complete` event is fired whether or not the user answered true or false to the dialog.
218
+ */
219
+ allowAction: function(element) {
220
+ var message = element.data('confirm'),
221
+ answer = false, callback;
222
+ if (!message) { return true; }
223
+
224
+ if (rails.fire(element, 'confirm')) {
225
+ answer = rails.confirm(message);
226
+ callback = rails.fire(element, 'confirm:complete', [answer]);
227
+ }
228
+ return answer && callback;
229
+ },
230
+
231
+ // Helper function which checks for blank inputs in a form that match the specified CSS selector
232
+ blankInputs: function(form, specifiedSelector, nonBlank) {
233
+ var inputs = $(), input,
234
+ selector = specifiedSelector || 'input,textarea';
235
+ form.find(selector).each(function() {
236
+ input = $(this);
237
+ // Collect non-blank inputs if nonBlank option is true, otherwise, collect blank inputs
238
+ if (nonBlank ? input.val() : !input.val()) {
239
+ inputs = inputs.add(input);
240
+ }
241
+ });
242
+ return inputs.length ? inputs : false;
243
+ },
244
+
245
+ // Helper function which checks for non-blank inputs in a form that match the specified CSS selector
246
+ nonBlankInputs: function(form, specifiedSelector) {
247
+ return rails.blankInputs(form, specifiedSelector, true); // true specifies nonBlank
248
+ },
249
+
250
+ // Helper function, needed to provide consistent behavior in IE
251
+ stopEverything: function(e) {
252
+ $(e.target).trigger('ujs:everythingStopped');
253
+ e.stopImmediatePropagation();
254
+ return false;
255
+ },
256
+
257
+ // find all the submit events directly bound to the form and
258
+ // manually invoke them. If anyone returns false then stop the loop
259
+ callFormSubmitBindings: function(form, event) {
260
+ var events = form.data('events'), continuePropagation = true;
261
+ if (events !== undefined && events['submit'] !== undefined) {
262
+ $.each(events['submit'], function(i, obj){
263
+ if (typeof obj.handler === 'function') return continuePropagation = obj.handler(event);
264
+ });
265
+ }
266
+ return continuePropagation;
267
+ },
268
+
269
+ // replace element's html with the 'data-disable-with' after storing original html
270
+ // and prevent clicking on it
271
+ disableElement: function(element) {
272
+ element.data('ujs:enable-with', element.html()); // store enabled state
273
+ element.html(element.data('disable-with')); // set to disabled state
274
+ element.bind('click.railsDisable', function(e) { // prevent further clicking
275
+ return rails.stopEverything(e)
276
+ });
277
+ },
278
+
279
+ // restore element to its original state which was disabled by 'disableElement' above
280
+ enableElement: function(element) {
281
+ if (element.data('ujs:enable-with') !== undefined) {
282
+ element.html(element.data('ujs:enable-with')); // set to old enabled state
283
+ // this should be element.removeData('ujs:enable-with')
284
+ // but, there is currently a bug in jquery which makes hyphenated data attributes not get removed
285
+ element.data('ujs:enable-with', false); // clean up cache
286
+ }
287
+ element.unbind('click.railsDisable'); // enable element
288
+ }
289
+
290
+ };
291
+
292
+ $.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }});
293
+
294
+ $(document).delegate(rails.linkDisableSelector, 'ajax:complete', function() {
295
+ rails.enableElement($(this));
296
+ });
297
+
298
+ $(document).delegate(rails.linkClickSelector, 'click.rails', function(e) {
299
+ var link = $(this), method = link.data('method'), data = link.data('params');
300
+ if (!rails.allowAction(link)) return rails.stopEverything(e);
301
+
302
+ if (link.is(rails.linkDisableSelector)) rails.disableElement(link);
303
+
304
+ if (link.data('remote') !== undefined) {
305
+ if ( (e.metaKey || e.ctrlKey) && (!method || method === 'GET') && !data ) { return true; }
306
+
307
+ if (rails.handleRemote(link) === false) { rails.enableElement(link); }
308
+ return false;
309
+
310
+ } else if (link.data('method')) {
311
+ rails.handleMethod(link);
312
+ return false;
313
+ }
314
+ });
315
+
316
+ $(document).delegate(rails.inputChangeSelector, 'change.rails', function(e) {
317
+ var link = $(this);
318
+ if (!rails.allowAction(link)) return rails.stopEverything(e);
319
+
320
+ rails.handleRemote(link);
321
+ return false;
322
+ });
323
+
324
+ $(document).delegate(rails.formSubmitSelector, 'submit.rails', function(e) {
325
+ var form = $(this),
326
+ remote = form.data('remote') !== undefined,
327
+ blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector),
328
+ nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector);
329
+
330
+ if (!rails.allowAction(form)) return rails.stopEverything(e);
331
+
332
+ // skip other logic when required values are missing or file upload is present
333
+ if (blankRequiredInputs && form.attr("novalidate") == undefined && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) {
334
+ return rails.stopEverything(e);
335
+ }
336
+
337
+ if (remote) {
338
+ if (nonBlankFileInputs) {
339
+ return rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]);
340
+ }
341
+
342
+ // If browser does not support submit bubbling, then this live-binding will be called before direct
343
+ // bindings. Therefore, we should directly call any direct bindings before remotely submitting form.
344
+ if (!$.support.submitBubbles && $().jquery < '1.7' && rails.callFormSubmitBindings(form, e) === false) return rails.stopEverything(e);
345
+
346
+ rails.handleRemote(form);
347
+ return false;
348
+
349
+ } else {
350
+ // slight timeout so that the submit button gets properly serialized
351
+ setTimeout(function(){ rails.disableFormElements(form); }, 13);
352
+ }
353
+ });
354
+
355
+ $(document).delegate(rails.formInputClickSelector, 'click.rails', function(event) {
356
+ var button = $(this);
357
+
358
+ if (!rails.allowAction(button)) return rails.stopEverything(event);
359
+
360
+ // register the pressed submit button
361
+ var name = button.attr('name'),
362
+ data = name ? {name:name, value:button.val()} : null;
363
+
364
+ button.closest('form').data('ujs:submit-button', data);
365
+ });
366
+
367
+ $(document).delegate(rails.formSubmitSelector, 'ajax:beforeSend.rails', function(event) {
368
+ if (this == event.target) rails.disableFormElements($(this));
369
+ });
370
+
371
+ $(document).delegate(rails.formSubmitSelector, 'ajax:complete.rails', function(event) {
372
+ if (this == event.target) rails.enableFormElements($(this));
373
+ });
374
+
375
+ })( jQuery );
376
+ ;
377
+ FI"
378
+ F"%38b60d4d32b4009c6d62176a75903c4c