Fix lint errors

pull/1/head
yflory 8 years ago
parent 50c8a859e6
commit ff16084719

@ -91,7 +91,7 @@ define([
};
}());
var getHeadingText = function () {
exp.getHeadingText = function () {
var lines = editor.getValue().split(/\n/);
var text = '';

@ -4,7 +4,7 @@ define(function () {
module.create = function (UserList, Title, cfg) {
var exp = {};
var updateMetadata = exp.update = function (shjson) {
exp.update = function (shjson) {
// Extract the user list (metadata) from the hyperjson
var json = (!shjson || typeof shjson !== "string") ? "" : JSON.parse(shjson);
var titleUpdated = false;

@ -24,7 +24,7 @@ define(function () {
var $title;
exp.setToolbar = function (toolbar) {
$title = toolbar && toolbar.title;
}
};
exp.getTitle = function () { return exp.title; };
var isDefaultTitle = exp.isDefaultTitle = function (){return exp.title === exp.defaultTitle;};
@ -73,7 +73,7 @@ define(function () {
onRename: renameCb,
suggestName: suggestTitle,
defaultName: exp.defaultTitle
}
};
};
return exp;

@ -430,7 +430,7 @@ define([
var exportFile = function () {
var html = getHTML();
var suggestion = suggestName('cryptpad-document');
var suggestion = Title.suggestTitle('cryptpad-document');
Cryptpad.prompt(Messages.exportPrompt,
Cryptpad.fixFileName(suggestion) + '.html', function (filename) {
if (!(typeof(filename) === 'string' && filename)) { return; }

@ -32,7 +32,6 @@ define([
if (!DEBUG) {
debug = function() {};
}
var error = console.error;
Cryptpad.addLoadingScreen();
var onConnectError = function () {

@ -81,22 +81,12 @@ define([
Slide.setModal(APP, $modal, $content, $pad, ifrw, slideOptions, initialState);
var setStyleState = function (state) {
$pad.contents().find('#print, #content').find('style').each(function (i, el) {
el.disabled = !state;
});
};
var enterPresentationMode = function (shouldLog) {
Slide.show(true, editor.getValue());
if (shouldLog) {
Cryptpad.log(Messages.presentSuccess);
}
};
var leavePresentationMode = function () {
setStyleState(false);
Slide.show(false);
};
if (presentMode) {
enterPresentationMode(true);
@ -170,20 +160,6 @@ define([
};
var metadataCfg = {
slideColors: function (text, back) {
if (text) {
textColor = text;
$modal.css('color', text);
$modal.css('border-color', text);
$pad.contents().find('#' + SLIDE_COLOR_ID).css('color', text);
}
if (back) {
backColor = back;
$modal.css('background-color', back);
$pad.contents().find('#' + SLIDE_COLOR_ID).css('background', back);
$pad.contents().find('#' + SLIDE_BACKCOLOR_ID).css('color', back);
}
},
slideOptions: function (newOpt) {
if (stringify(newOpt) !== stringify(slideOptions)) {
$.extend(slideOptions, newOpt);
@ -191,7 +167,21 @@ define([
Slide.updateOptions();
}
}
}
};
var updateColors = metadataCfg.slideColors = function (text, back) {
if (text) {
textColor = text;
$modal.css('color', text);
$modal.css('border-color', text);
$pad.contents().find('#' + SLIDE_COLOR_ID).css('color', text);
}
if (back) {
backColor = back;
$modal.css('background-color', back);
$pad.contents().find('#' + SLIDE_COLOR_ID).css('background', back);
$pad.contents().find('#' + SLIDE_BACKCOLOR_ID).css('color', back);
}
};
var createPrintDialog = function () {
var slideOptionsTmp = {
@ -494,8 +484,8 @@ define([
editor.setValue(newDoc || initialState);
if (Cryptpad.initialName && APP.title === defaultName) {
updateTitle(Cryptpad.initialName);
if (Cryptpad.initialName && Title.isDefaultTitle()) {
Title.updateTitle(Cryptpad.initialName);
onLocal();
}

Loading…
Cancel
Save