Skip to content

Commit

Permalink
converted options.js to module pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlin committed Jul 2, 2019
1 parent ac30d3c commit ba001cc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions .atom-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cmd: gulp
19 changes: 14 additions & 5 deletions app/scripts/options.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use strict';

// Document ready
$(function()
// Options module, passed jQuery object by doc ready
var ateOptionsModule = (function($)
{
// Constants
var FIRST_RUN_KEY = 'autoTextExpanderFirstRun' // Local key to check for first run
var FIRST_RUN_KEY = 'autoTextExpanderFirstRun' // Check for first run

, DATE_MACRO_DEMO_FORMAT = 'MMMM Do YYYY'

, DEFAULT_SHORTCUT_FILLER = 'Shortcut'
Expand Down Expand Up @@ -37,9 +38,8 @@ $(function()
, cachedInputValue // Track value of input field that user focused on
;

init();

function initialize()
function init()
{
// Setup metadata defaults
metadata[ATE_CONST.SHORTCUT_TIMEOUT_KEY] = DEFAULT_CLEAR_BUFFER_TIMEOUT;
Expand Down Expand Up @@ -957,4 +957,13 @@ $(function()
}
});
}

return {
init: init,
showCrouton: showCrouton,
showCrouton: showModalPopup,
};
});

// Document ready
$(ateOptionsModule.init);

0 comments on commit ba001cc

Please sign in to comment.