Skip to content

Commit ac30d3c

Browse files
switching libraries for removing logging statements
1 parent fe3408e commit ac30d3c

File tree

4 files changed

+81
-149
lines changed

4 files changed

+81
-149
lines changed

app/scripts/options.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,30 @@ $(function()
3737
, cachedInputValue // Track value of input field that user focused on
3838
;
3939

40-
setupMetadata();
41-
setupUI();
42-
setupShortcutEditor();
43-
setupSettingsPanels();
44-
refreshShortcuts();
45-
46-
// Check if we opened the options page with a hash
47-
var hash = window.location.hash;
48-
if (hash) {
49-
console.log('Hash:', hash);
50-
if (hash == '#tipsLink') { // If it is #tipsLink, trigger tips
51-
$(hash).click();
52-
}
53-
}
54-
55-
56-
//////////////////////////////////////////////////////////
57-
// FUNCTIONS
40+
init();
5841

59-
// Setup metadata defaults
60-
function setupMetadata()
42+
function initialize()
6143
{
44+
// Setup metadata defaults
6245
metadata[ATE_CONST.SHORTCUT_TIMEOUT_KEY] = DEFAULT_CLEAR_BUFFER_TIMEOUT;
6346
metadata[ATE_CONST.SHORTCUT_VERSION_KEY] = ATE_CONST.APP_VERSION;
47+
48+
// Setup UI
49+
setupUI();
50+
setupShortcutEditor();
51+
setupSettingsPanels();
52+
53+
// Check if we opened the options page with a hash
54+
var hash = window.location.hash;
55+
if (hash) {
56+
console.log('Hash:', hash);
57+
if (hash == '#tipsLink') { // If it is #tipsLink, trigger tips
58+
$(hash).click();
59+
}
60+
}
61+
62+
// Reload shortcuts
63+
refreshShortcuts();
6464
}
6565

6666
// Set various dynamic UI fields: version, omnibar keyword, etc.
@@ -269,10 +269,10 @@ $(function()
269269
if (shortcutVersion && shortcutVersion != metadata[ATE_CONST.SHORTCUT_VERSION_KEY])
270270
{
271271
// Warn user that their shortcuts aren't synced yet, they should refresh
272-
console.log(chrome.i18n.getMessage('WARNING_SHORTCUT_VERSION_MISMATCH'));
272+
console.error(chrome.i18n.getMessage('WARNING_SHORTCUT_VERSION_MISMATCH'));
273273
alert(chrome.i18n.getMessage('WARNING_SHORTCUT_VERSION_MISMATCH'));
274-
console.log('Database version:', shortcutVersion);
275-
console.log('Extension version:', metadata[ATE_CONST.SHORTCUT_VERSION_KEY]);
274+
console.error('Database version:', shortcutVersion);
275+
console.error('Extension version:', metadata[ATE_CONST.SHORTCUT_VERSION_KEY]);
276276
}
277277
}
278278

gulpfile.babel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function html(cb) {
4848
return gulp.src('app/*.html')
4949
.pipe($.useref({searchPath: ['.tmp', 'app', '.']}))
5050
.pipe($.sourcemaps.init())
51-
.pipe($.if(/^((?!(\.min)).)*\.js$/, $.stripDebug()))
51+
.pipe($.if(/^((?!(\.min)).)*\.js$/, $.removeLogging({methods:['log']})))
5252
.pipe($.if(/^((?!(\.min)).)*\.js$/, $.uglify()))
5353
.pipe($.if('*.css', $.cleanCss({compatibility: '*'})))
5454
.pipe($.sourcemaps.write())
@@ -68,7 +68,7 @@ function chromeManifest(cb) {
6868
}
6969
}))
7070
.pipe($.if('*.css', $.cleanCss({compatibility: '*'})))
71-
.pipe($.if(/^((?!(\.min)).)*\.js$/, $.stripDebug()))
71+
.pipe($.if(/^((?!(\.min)).)*\.js$/, $.removeLogging({methods:['log']})))
7272
.pipe($.if(/^((?!(\.min)).)*\.js$/, $.sourcemaps.init()))
7373
.pipe($.if(/^((?!(\.min)).)*\.js$/, $.uglify()))
7474
.pipe($.if(/^((?!(\.min)).)*\.js$/, $.sourcemaps.write('.')))

package-lock.json

Lines changed: 53 additions & 121 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"es6": true
1616
},
1717
"parserOptions": {
18-
"ecmaVersion": 6,
19-
"sourceType": "module"
18+
"ecmaVersion": 6,
19+
"sourceType": "module"
2020
},
2121
"globals": {
2222
"@babel/core": "^7.4.5",
@@ -47,9 +47,9 @@
4747
"gulp-imagemin": "^6.0.0",
4848
"gulp-livereload": "^4.0.1",
4949
"gulp-load-plugins": "^1.6.0",
50+
"gulp-remove-logging": "^1.2.0",
5051
"gulp-size": "^3.0.0",
5152
"gulp-sourcemaps": "^2.6.5",
52-
"gulp-strip-debug": "^3.0.0",
5353
"gulp-uglify": "^3.0.2",
5454
"gulp-useref": "^3.1.6",
5555
"gulp-zip": "^5.0.0",

0 commit comments

Comments
 (0)