Improved JS

This commit is contained in:
James Brooks
2015-01-01 16:57:33 +00:00
parent cedfdf57e4
commit 9a66945fb5
4 changed files with 25 additions and 25 deletions

View File

@@ -32,14 +32,14 @@ $(function() {
Messenger.options = {
extraClasses: 'messenger-fixed messenger-on-top',
theme: 'air'
}
};
// App setup
window.CachetHQ = {};
CachetHQ.Notifier = function () {
window.CachetHQ.Notifier = function () {
this.notify = function (message, type, options) {
type = (typeof type === 'undefined' || type == 'error') ? 'error' : type;
type = (typeof type === 'undefined' || type === 'error') ? 'error' : type;
var defaultOptions = {
message: message,
@@ -47,7 +47,7 @@ $(function() {
showCloseButton: true
};
var options = _.extend(defaultOptions, options);
options = _.extend(defaultOptions, options);
Messenger().post(options);
};
@@ -90,7 +90,7 @@ $(function() {
type: 'POST',
data: $('form[name=componentList]').serializeObject(),
success: function() {
(new CachetHQ.Notifier).notify('Components updated.', 'success');
(new CachetHQ.Notifier()).notify('Components updated.', 'success');
}
});
}
@@ -104,14 +104,14 @@ $(function() {
$.ajax({
async: true,
url: '/dashboard/api/components/' + formData['component_id'],
url: '/dashboard/api/components/' + formData.component_id,
type: 'POST',
data: formData,
success: function(component) {
(new CachetHQ.Notifier).notify($form.data('messenger'), 'success');
(new CachetHQ.Notifier()).notify($form.data('messenger'), 'success');
},
error: function(a, b, c) {
(new CachetHQ.Notifier).notify('Something went wrong updating the component.');
(new CachetHQ.Notifier()).notify('Something went wrong updating the component.');
}
});
});

View File

@@ -12394,14 +12394,14 @@ $(function() {
Messenger.options = {
extraClasses: 'messenger-fixed messenger-on-top',
theme: 'air'
}
};
// App setup
window.CachetHQ = {};
CachetHQ.Notifier = function () {
window.CachetHQ.Notifier = function () {
this.notify = function (message, type, options) {
type = (typeof type === 'undefined' || type == 'error') ? 'error' : type;
type = (typeof type === 'undefined' || type === 'error') ? 'error' : type;
var defaultOptions = {
message: message,
@@ -12409,7 +12409,7 @@ $(function() {
showCloseButton: true
};
var options = _.extend(defaultOptions, options);
options = _.extend(defaultOptions, options);
Messenger().post(options);
};
@@ -12452,7 +12452,7 @@ $(function() {
type: 'POST',
data: $('form[name=componentList]').serializeObject(),
success: function() {
(new CachetHQ.Notifier).notify('Components updated.', 'success');
(new CachetHQ.Notifier()).notify('Components updated.', 'success');
}
});
}
@@ -12466,14 +12466,14 @@ $(function() {
$.ajax({
async: true,
url: '/dashboard/api/components/' + formData['component_id'],
url: '/dashboard/api/components/' + formData.component_id,
type: 'POST',
data: formData,
success: function(component) {
(new CachetHQ.Notifier).notify($form.data('messenger'), 'success');
(new CachetHQ.Notifier()).notify($form.data('messenger'), 'success');
},
error: function(a, b, c) {
(new CachetHQ.Notifier).notify('Something went wrong updating the component.');
(new CachetHQ.Notifier()).notify('Something went wrong updating the component.');
}
});
});

View File

@@ -12394,14 +12394,14 @@ $(function() {
Messenger.options = {
extraClasses: 'messenger-fixed messenger-on-top',
theme: 'air'
}
};
// App setup
window.CachetHQ = {};
CachetHQ.Notifier = function () {
window.CachetHQ.Notifier = function () {
this.notify = function (message, type, options) {
type = (typeof type === 'undefined' || type == 'error') ? 'error' : type;
type = (typeof type === 'undefined' || type === 'error') ? 'error' : type;
var defaultOptions = {
message: message,
@@ -12409,7 +12409,7 @@ $(function() {
showCloseButton: true
};
var options = _.extend(defaultOptions, options);
options = _.extend(defaultOptions, options);
Messenger().post(options);
};
@@ -12452,7 +12452,7 @@ $(function() {
type: 'POST',
data: $('form[name=componentList]').serializeObject(),
success: function() {
(new CachetHQ.Notifier).notify('Components updated.', 'success');
(new CachetHQ.Notifier()).notify('Components updated.', 'success');
}
});
}
@@ -12466,14 +12466,14 @@ $(function() {
$.ajax({
async: true,
url: '/dashboard/api/components/' + formData['component_id'],
url: '/dashboard/api/components/' + formData.component_id,
type: 'POST',
data: formData,
success: function(component) {
(new CachetHQ.Notifier).notify($form.data('messenger'), 'success');
(new CachetHQ.Notifier()).notify($form.data('messenger'), 'success');
},
error: function(a, b, c) {
(new CachetHQ.Notifier).notify('Something went wrong updating the component.');
(new CachetHQ.Notifier()).notify('Something went wrong updating the component.');
}
});
});

View File

@@ -1,4 +1,4 @@
{
"css/all.css": "css/all-c5b65085.css",
"js/all.js": "js/all-215df44c.js"
"js/all.js": "js/all-5dbf816c.js"
}