From f89c566abb5e00f1dc62a1127bce19b5a661d1b1 Mon Sep 17 00:00:00 2001 From: Serge Titov Date: Sun, 26 Mar 2017 13:15:11 +0300 Subject: [PATCH] micro code style fix --- ps.jsx | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/ps.jsx b/ps.jsx index 68620eb..ac9061b 100644 --- a/ps.jsx +++ b/ps.jsx @@ -893,8 +893,7 @@ function LogItem(src, error) { LogItem.prototype = { - addMain: function(src, alt) - { + addMain: function(src, alt) { this.src = src || ''; this.alt = (alt || '').trim(); @@ -906,20 +905,17 @@ LogItem.prototype = { this.text = this.alt.substr(this.altTitle.length).trim(); }, - addPreview: function(src, width, height) - { + addPreview: function(src, width, height) { this.preview = src || ''; this.width = width; this.height = height; }, - _relativePath: function(path, logPath, logPathLen) - { + _relativePath: function(path, logPath, logPathLen) { return path.toLowerCase().indexOf(logPath.toLowerCase()) == 0 ? ('./' + path.substring(logPathLen+1)).replace(/\\/gi, '/') : path; }, - toHTML: function(logPath, pathLen) - { + toHTML: function(logPath, pathLen) { var res = ''; var head = ''; var tail = ''; @@ -927,14 +923,12 @@ LogItem.prototype = { if (this.error != '') return 'Error: ' + this.error + ' ' + (this.src ||''); - if (this.src != '') - { + if (this.src != '') { head = ''; tail = ''; } - if (this.preview != '') - { + if (this.preview != '') { res = '\n\t\n\t\t\t' + head + res + tail + alt + '\n\t\n'; }, - imageListItem: function(logPath, pathLen) - { + imageListItem: function(logPath, pathLen) { if (this.alt == '' || this.src == '') return null; return String.format('{0} {2}', String.toHTML(this.altTitle), this._relativePath(this.src, logPath, pathLen), String.toHTML(this.text)); }, - purikovItem: function() - { + purikovItem: function() { if (this.src == '') return ''; var pos = this.src.lastIndexOf('\\'); - var name = pos >= 0 ? this.src.substring(pos+1) : this.src; + var name = pos >= 0 ? this.src.substring(pos + 1) : this.src; pos = name.lastIndexOf('.'); if (pos >= 0) name = name.substring(0, pos);