Fix indentations

This commit is contained in:
Yukai Huang 2017-03-28 20:38:31 +08:00
parent b711ecfadb
commit a938cac42a

View file

@ -491,7 +491,7 @@ $(window).resize(function () {
}) })
// when page unload // when page unload
$(window).on('unload', function () { $(window).on('unload', function () {
// updateHistoryInner(); // updateHistoryInner();
}) })
$(window).on('error', function () { $(window).on('error', function () {
// setNeedRefresh(); // setNeedRefresh();
@ -1895,10 +1895,6 @@ function initMarkAndCheckGutter (mark, author, timestamp) {
} }
return mark return mark
} }
var gutterStylePrefix = 'border-left: 3px solid '
var gutterStylePostfix = '; height: ' + defaultTextHeight + 'px; margin-left: 3px;'
var textMarkderStylePrefix = 'background-image: linear-gradient(to top, '
var textMarkderStylePostfix = ' 1px, transparent 1px);'
var addStyleRule = (function () { var addStyleRule = (function () {
var added = {} var added = {}
var styleElement = document.createElement('style') var styleElement = document.createElement('style')
@ -2015,11 +2011,11 @@ function updateAuthorshipInner () {
for (let i = 0; i < addTextMarkers.length; i++) { for (let i = 0; i < addTextMarkers.length; i++) {
let textMarker = addTextMarkers[i] let textMarker = addTextMarkers[i]
let author = authors[textMarker.userid] let author = authors[textMarker.userid]
var rgbcolor = hex2rgb(author.color) const rgbcolor = hex2rgb(author.color)
var colorString = 'rgba(' + rgbcolor.red + ',' + rgbcolor.green + ',' + rgbcolor.blue + ',0.7)' const colorString = `rgba(${rgbcolor.red},${rgbcolor.green},${rgbcolor.blue},0.7)`
var styleString = textMarkderStylePrefix + colorString + textMarkderStylePostfix const styleString = `background-image: linear-gradient(to top, ${colorString} 1px, transparent 1px);`
let className = 'authorship-inline-' + author.color.substr(1) let className = `authorship-inline-${author.color.substr(1)}`
var rule = '.' + className + '{' + styleString + '}' const rule = `.${className} { ${styleString} }`
addStyleRule(rule) addStyleRule(rule)
editor.markText(textMarker.pos[0], textMarker.pos[1], { editor.markText(textMarker.pos[0], textMarker.pos[1], {
className: 'authorship-inline ' + className, className: 'authorship-inline ' + className,
@ -2033,12 +2029,12 @@ function iterateLine (line) {
var author = currMark ? authors[currMark.gutter.userid] : null var author = currMark ? authors[currMark.gutter.userid] : null
if (currMark && author) { if (currMark && author) {
let className = 'authorship-gutter-' + author.color.substr(1) let className = 'authorship-gutter-' + author.color.substr(1)
var gutters = line.gutterMarkers const gutters = line.gutterMarkers
if (!gutters || !gutters['authorship-gutters'] || if (!gutters || !gutters['authorship-gutters'] ||
!gutters['authorship-gutters'].className || !gutters['authorship-gutters'].className ||
!gutters['authorship-gutters'].className.indexOf(className) < 0) { !gutters['authorship-gutters'].className.indexOf(className) < 0) {
var styleString = gutterStylePrefix + author.color + gutterStylePostfix const styleString = `border-left: 3px solid ${author.color}; height: ${defaultTextHeight}px; margin-left: 3px;`
var rule = '.' + className + '{' + styleString + '}' const rule = `.${className} { ${styleString} }`
addStyleRule(rule) addStyleRule(rule)
var gutter = $('<div>', { var gutter = $('<div>', {
class: 'authorship-gutter ' + className, class: 'authorship-gutter ' + className,