Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor vendor javascript #5755

Merged
merged 1 commit into from Mar 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 0 additions & 34 deletions app/assets/javascripts/helpers/alert.js

This file was deleted.

6 changes: 0 additions & 6 deletions app/assets/javascripts/home.js

This file was deleted.

4 changes: 2 additions & 2 deletions app/assets/javascripts/jasmine-load-all.js
Expand Up @@ -2,10 +2,10 @@
//= require handlebars.runtime
//= require templates
//= require main
//= require home
//= require fileuploader-custom
//= require inbox
//= require mobile/mobile
//= require profile
//= require jquery.autoSuggest.custom
//= require contact-list
//= require sinon
//= require jasmine-ajax
3 changes: 0 additions & 3 deletions app/assets/javascripts/mailchimp.js

This file was deleted.

6 changes: 0 additions & 6 deletions app/assets/javascripts/profile.js

This file was deleted.

25 changes: 0 additions & 25 deletions app/assets/javascripts/view.js
@@ -1,10 +1,4 @@
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later

/* Copyright (c) 2010-2011, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
//= require mailchimp/jquery.form
var View = {
initialize: function() {
/* Buttons */
Expand All @@ -26,25 +20,6 @@ var View = {
.on('click', this.dropdowns.selector, this.dropdowns.click)
.on('keypress', this.dropdowns.selector, this.dropdowns.click);

/* Clear forms after successful submit, this is some legacy dan hanson stuff, do we still want it? */
$.fn.clearForm = function() {
return this.each(function() {
if ($(this).is('form') && !$(this).hasClass('form_do_not_clear')) {
return $(':input', this).clearForm();
}
if ($(this).hasClass('clear_on_submit') || $(this).is(':text') || $(this).is(':password') || $(this).is('textarea')) {
$(this).val('');
} else if ($(this).is(':checkbox') || $(this).is(':radio')) {
$(this).attr('checked', false);
} else if ($(this).is('select')) {
this.selectedIndex = -1;
} else if ($(this).attr('name') === 'photos[]') {
$(this).val('');
}
$(this).blur();
});
};

$(document).on('ajax:success', 'form[data-remote]', function () {
$(this).clearForm();
$(this).focusout();
Expand Down
@@ -1,3 +1,5 @@
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later

/* Clear form plugin - called using $("elem").clearForm(); */
$.fn.clearForm = function() {
return this.each(function() {
Expand All @@ -16,4 +18,4 @@ $.fn.clearForm = function() {
$(this).blur();
});
};

// @license-end
30 changes: 0 additions & 30 deletions spec/javascripts/alert-spec.js

This file was deleted.