Skip to content

Commit ba001cc

Browse files
author
Carlin
committed
converted options.js to module pattern
1 parent ac30d3c commit ba001cc

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

.atom-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cmd: gulp

app/scripts/options.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
'use strict';
22

3-
// Document ready
4-
$(function()
3+
// Options module, passed jQuery object by doc ready
4+
var ateOptionsModule = (function($)
55
{
66
// Constants
7-
var FIRST_RUN_KEY = 'autoTextExpanderFirstRun' // Local key to check for first run
7+
var FIRST_RUN_KEY = 'autoTextExpanderFirstRun' // Check for first run
8+
89
, DATE_MACRO_DEMO_FORMAT = 'MMMM Do YYYY'
910

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

40-
init();
4141

42-
function initialize()
42+
function init()
4343
{
4444
// Setup metadata defaults
4545
metadata[ATE_CONST.SHORTCUT_TIMEOUT_KEY] = DEFAULT_CLEAR_BUFFER_TIMEOUT;
@@ -957,4 +957,13 @@ $(function()
957957
}
958958
});
959959
}
960+
961+
return {
962+
init: init,
963+
showCrouton: showCrouton,
964+
showCrouton: showModalPopup,
965+
};
960966
});
967+
968+
// Document ready
969+
$(ateOptionsModule.init);

0 commit comments

Comments
 (0)