Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).on('ajaxError', function (event, xhr) {
console.log(arguments);
var resp = xhr.responseJSON;
if (xhr.status == 401 && resp.error == "invalid_token") {
// TODO refresh token
alert(resp.error_description);
location.href = "logout";
}
if (xhr.status == 403) {
if (_.isArray(resp.details)) {
Backbone.trigger('exception', resp.details[0]);
}
}
});
var init = function() {
Backbone.trigger('extend:Model', {
key: 'safe',
extension: Safe,
initialize: function () {
this.trigger('after:initialize');
}
});
Backbone.trigger('extend:Collection', {
key: 'safe',
extension: Safe,
initialize: function () {
this.trigger('after:initialize');
}
});
};
storageChanged(e) {
if (!e.newValue) {
return;
}
if (e.key === LocalStorageKeyName && e.newValue !== instanceKey) {
SingleInstanceChecker.setKey(
LocalStorageResponseKeyName,
instanceKey + Math.random().toString()
);
} else if (e.key === LocalStorageResponseKeyName && e.newValue.indexOf(instanceKey) < 0) {
window.removeEventListener('storage', SingleInstanceChecker.storageChanged);
Backbone.trigger('second-instance');
}
},
onClick: function (e) {
e.stopPropagation();
e.preventDefault();
if (this.model.isDragged) {
return;
}
var cord = this.$el.offset();
Backbone.trigger('showWidgetHover', this.model.cid, cord);
}
});
var placeProfileLink = $('<a data-place-id="' + place._id + '" class="map-popup-link" href="#">' + place.name + '</a>').click(function(e){
Backbone.trigger('map:popup-click', $(e.target).data('placeId'));
})[0];
var init = function() {
Backbone.trigger('extend:View', {
key: 'switcher',
extension: Switcher,
initialize: function () {
this.trigger('after:initialize');
}
});
};
<a href="#"> Backbone.trigger('pp:logout')}>
Logout</a>
getFormattedContents: function () {
var body = this.get('contents');
if (body) {
switch (this.get('format')) {
case 'md':
{
body = marked(this.get('contents'));
break;
}
case 'rst':
{
Backbone.trigger('exception', {
message: '"rst" is not supported yet!'
});
break;
}
}
}
return body;
},
appendContents: function (append) {
<a href="#"> Backbone.trigger('pp:login-with-persona')}>
with Email</a>
onClickSettings: function(e) {
e.stopPropagation();
e.preventDefault();
Backbone.trigger('setupWidget', this.model.cid);
},