Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
listenToEvents() {
this.view.collection.startListening();
// Show note form on "c" keybinding
this.listenTo(Radio.channel('utils/Keybindings'), 'appCreateNote',
this.navigateForm);
// Show note form if add buttons in the navbar is clicked
this.listenTo(Radio.channel('components/navbar'), 'show:form',
this.navigateForm);
// Open a note on model:navigate event
this.listenTo(this.view.collection.channel, 'model:navigate',
_.debounce(this.navigateModel, 420));
// Destroy itself if the view is destroyed
this.listenTo(this.view, 'destroy', this.destroy);
}
function initialize() {
Radio.channel('components/importExport')
.reply({
import : (...args) => new Import(...args).init(),
importEvernote : (...args) => new ImportEvernote(...args).init(),
export : (...args) => new Export(...args).init(),
});
Radio.request('utils/Initializer', 'add', {
name : 'App:last',
callback : () => new Migrate().init(),
});
}
index: function() {
var chan = Radio.channel('root');
var model = new AccessToken();
var view = new SubmitTokenView({
model: model,
});
chan.command('set:content', {backboneView: view});
}
};
find(options) {
const sortField = Radio.channel('collections/Configs').request(
'findConfig', {name: 'sortnotes'}
);
const opt = _.extend({sortField}, options);
return super.find(opt);
}
_initChannel: function () {
this.channelName = _.result(this, 'channelName') || 'global';
this.channel = _.result(this, 'channel') ||
Radio.channel(this.channelName);
},
var $ = require('jquery');
var Backbone = require('backbone');
Backbone.$ = $;
var _ = require('lodash');
var Radio = require('backbone.radio');
var React = require('react');
var SnapDetailsView = require('../views/snap-details.js');
var DeviceInfo = require('../models/device-info.js');
var Snap = require('../models/snap.js');
var SnapTools = require('../common/snaps.js')
var snapChannel = Radio.channel('snap');
var rootChannel = Radio.channel('root');
var byteSizeToString = function(s) {
var suffixes = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB'];
for (var i in suffixes) {
if (s < 1000) {
return s.toFixed(2) + suffixes[i];
}
s /= 1000;
}
return s;
};
var showSnapView = function(snap, deviceInfo) {
var size = snap.get('installed_size')
|| snap.get('download_size');
get channel() {
return Radio.channel('components/importExport');
}
get channel() {
return Radio.channel('components/notebooks');
}
get channel() {
return Radio.channel('components/navbar');
}
get channel() {
return Radio.channel('components/importExport');
}