Fix lint errors
This commit is contained in:
@@ -91,7 +91,7 @@ define([
|
|||||||
};
|
};
|
||||||
}());
|
}());
|
||||||
|
|
||||||
var getHeadingText = function () {
|
exp.getHeadingText = function () {
|
||||||
var lines = editor.getValue().split(/\n/);
|
var lines = editor.getValue().split(/\n/);
|
||||||
|
|
||||||
var text = '';
|
var text = '';
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ define(function () {
|
|||||||
module.create = function (UserList, Title, cfg) {
|
module.create = function (UserList, Title, cfg) {
|
||||||
var exp = {};
|
var exp = {};
|
||||||
|
|
||||||
var updateMetadata = exp.update = function (shjson) {
|
exp.update = function (shjson) {
|
||||||
// Extract the user list (metadata) from the hyperjson
|
// Extract the user list (metadata) from the hyperjson
|
||||||
var json = (!shjson || typeof shjson !== "string") ? "" : JSON.parse(shjson);
|
var json = (!shjson || typeof shjson !== "string") ? "" : JSON.parse(shjson);
|
||||||
var titleUpdated = false;
|
var titleUpdated = false;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ define(function () {
|
|||||||
var $title;
|
var $title;
|
||||||
exp.setToolbar = function (toolbar) {
|
exp.setToolbar = function (toolbar) {
|
||||||
$title = toolbar && toolbar.title;
|
$title = toolbar && toolbar.title;
|
||||||
}
|
};
|
||||||
|
|
||||||
exp.getTitle = function () { return exp.title; };
|
exp.getTitle = function () { return exp.title; };
|
||||||
var isDefaultTitle = exp.isDefaultTitle = function (){return exp.title === exp.defaultTitle;};
|
var isDefaultTitle = exp.isDefaultTitle = function (){return exp.title === exp.defaultTitle;};
|
||||||
@@ -73,7 +73,7 @@ define(function () {
|
|||||||
onRename: renameCb,
|
onRename: renameCb,
|
||||||
suggestName: suggestTitle,
|
suggestName: suggestTitle,
|
||||||
defaultName: exp.defaultTitle
|
defaultName: exp.defaultTitle
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
return exp;
|
return exp;
|
||||||
|
|||||||
@@ -430,7 +430,7 @@ define([
|
|||||||
|
|
||||||
var exportFile = function () {
|
var exportFile = function () {
|
||||||
var html = getHTML();
|
var html = getHTML();
|
||||||
var suggestion = suggestName('cryptpad-document');
|
var suggestion = Title.suggestTitle('cryptpad-document');
|
||||||
Cryptpad.prompt(Messages.exportPrompt,
|
Cryptpad.prompt(Messages.exportPrompt,
|
||||||
Cryptpad.fixFileName(suggestion) + '.html', function (filename) {
|
Cryptpad.fixFileName(suggestion) + '.html', function (filename) {
|
||||||
if (!(typeof(filename) === 'string' && filename)) { return; }
|
if (!(typeof(filename) === 'string' && filename)) { return; }
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ define([
|
|||||||
if (!DEBUG) {
|
if (!DEBUG) {
|
||||||
debug = function() {};
|
debug = function() {};
|
||||||
}
|
}
|
||||||
var error = console.error;
|
|
||||||
|
|
||||||
Cryptpad.addLoadingScreen();
|
Cryptpad.addLoadingScreen();
|
||||||
var onConnectError = function () {
|
var onConnectError = function () {
|
||||||
|
|||||||
@@ -81,22 +81,12 @@ define([
|
|||||||
|
|
||||||
Slide.setModal(APP, $modal, $content, $pad, ifrw, slideOptions, initialState);
|
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) {
|
var enterPresentationMode = function (shouldLog) {
|
||||||
Slide.show(true, editor.getValue());
|
Slide.show(true, editor.getValue());
|
||||||
if (shouldLog) {
|
if (shouldLog) {
|
||||||
Cryptpad.log(Messages.presentSuccess);
|
Cryptpad.log(Messages.presentSuccess);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var leavePresentationMode = function () {
|
|
||||||
setStyleState(false);
|
|
||||||
Slide.show(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
if (presentMode) {
|
if (presentMode) {
|
||||||
enterPresentationMode(true);
|
enterPresentationMode(true);
|
||||||
@@ -170,20 +160,6 @@ define([
|
|||||||
};
|
};
|
||||||
|
|
||||||
var metadataCfg = {
|
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) {
|
slideOptions: function (newOpt) {
|
||||||
if (stringify(newOpt) !== stringify(slideOptions)) {
|
if (stringify(newOpt) !== stringify(slideOptions)) {
|
||||||
$.extend(slideOptions, newOpt);
|
$.extend(slideOptions, newOpt);
|
||||||
@@ -191,7 +167,21 @@ define([
|
|||||||
Slide.updateOptions();
|
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 createPrintDialog = function () {
|
||||||
var slideOptionsTmp = {
|
var slideOptionsTmp = {
|
||||||
@@ -494,8 +484,8 @@ define([
|
|||||||
|
|
||||||
editor.setValue(newDoc || initialState);
|
editor.setValue(newDoc || initialState);
|
||||||
|
|
||||||
if (Cryptpad.initialName && APP.title === defaultName) {
|
if (Cryptpad.initialName && Title.isDefaultTitle()) {
|
||||||
updateTitle(Cryptpad.initialName);
|
Title.updateTitle(Cryptpad.initialName);
|
||||||
onLocal();
|
onLocal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user