Skip to content

Commit

Permalink
switching libraries for removing logging statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlin committed Jul 2, 2019
1 parent fe3408e commit ac30d3c
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 149 deletions.
46 changes: 23 additions & 23 deletions app/scripts/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,30 @@ $(function()
, cachedInputValue // Track value of input field that user focused on
;

setupMetadata();
setupUI();
setupShortcutEditor();
setupSettingsPanels();
refreshShortcuts();

// Check if we opened the options page with a hash
var hash = window.location.hash;
if (hash) {
console.log('Hash:', hash);
if (hash == '#tipsLink') { // If it is #tipsLink, trigger tips
$(hash).click();
}
}


//////////////////////////////////////////////////////////
// FUNCTIONS
init();

// Setup metadata defaults
function setupMetadata()
function initialize()
{
// Setup metadata defaults
metadata[ATE_CONST.SHORTCUT_TIMEOUT_KEY] = DEFAULT_CLEAR_BUFFER_TIMEOUT;
metadata[ATE_CONST.SHORTCUT_VERSION_KEY] = ATE_CONST.APP_VERSION;

// Setup UI
setupUI();
setupShortcutEditor();
setupSettingsPanels();

// Check if we opened the options page with a hash
var hash = window.location.hash;
if (hash) {
console.log('Hash:', hash);
if (hash == '#tipsLink') { // If it is #tipsLink, trigger tips
$(hash).click();
}
}

// Reload shortcuts
refreshShortcuts();
}

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

Expand Down
4 changes: 2 additions & 2 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function html(cb) {
return gulp.src('app/*.html')
.pipe($.useref({searchPath: ['.tmp', 'app', '.']}))
.pipe($.sourcemaps.init())
.pipe($.if(/^((?!(\.min)).)*\.js$/, $.stripDebug()))
.pipe($.if(/^((?!(\.min)).)*\.js$/, $.removeLogging({methods:['log']})))
.pipe($.if(/^((?!(\.min)).)*\.js$/, $.uglify()))
.pipe($.if('*.css', $.cleanCss({compatibility: '*'})))
.pipe($.sourcemaps.write())
Expand All @@ -68,7 +68,7 @@ function chromeManifest(cb) {
}
}))
.pipe($.if('*.css', $.cleanCss({compatibility: '*'})))
.pipe($.if(/^((?!(\.min)).)*\.js$/, $.stripDebug()))
.pipe($.if(/^((?!(\.min)).)*\.js$/, $.removeLogging({methods:['log']})))
.pipe($.if(/^((?!(\.min)).)*\.js$/, $.sourcemaps.init()))
.pipe($.if(/^((?!(\.min)).)*\.js$/, $.uglify()))
.pipe($.if(/^((?!(\.min)).)*\.js$/, $.sourcemaps.write('.')))
Expand Down
174 changes: 53 additions & 121 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"es6": true
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
"ecmaVersion": 6,
"sourceType": "module"
},
"globals": {
"@babel/core": "^7.4.5",
Expand Down Expand Up @@ -47,9 +47,9 @@
"gulp-imagemin": "^6.0.0",
"gulp-livereload": "^4.0.1",
"gulp-load-plugins": "^1.6.0",
"gulp-remove-logging": "^1.2.0",
"gulp-size": "^3.0.0",
"gulp-sourcemaps": "^2.6.5",
"gulp-strip-debug": "^3.0.0",
"gulp-uglify": "^3.0.2",
"gulp-useref": "^3.1.6",
"gulp-zip": "^5.0.0",
Expand Down

0 comments on commit ac30d3c

Please sign in to comment.