Skip to content

Instantly share code, notes, and snippets.

@dergachev
Last active August 4, 2019 16:42
Show Gist options
  • Save dergachev/5723234 to your computer and use it in GitHub Desktop.
Save dergachev/5723234 to your computer and use it in GitHub Desktop.
I was curious how http://shortcutfoo.com was put together. Turns out it's a one page app.
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/app"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push("<div id='top'>\n <a class='brand' href='/'>\n <img src='https://d2r64hzyhllbrg.cloudfront.net/logosmall.png' style='height: 40px; margin-bottom: -10px' />\n </a>\n</div>\n<div id='notifications' style='width: 600px; margin-left: 150px'></div>\n<div id='main'>\n <div id='loadinghome' style='margin-top: 200px; margin-left: 300px;'>\n <p style='color: gray; margin-left: 40px;'>loading</p>\n <img src='https://d2r64hzyhllbrg.cloudfront.net/homeloading.gif' />\n </div>\n</div>\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/bundlelistview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push('<h1 id="choose_a_bundle">', name, ' <i class="icon-question-sign help-popover" rel="popover" title="', helpTitle, '" data-content="', helpText, "\" style='margin-top: 12px'></i></h1>\n<div id='bundle-filters' class='filters span2 pull-left' style='position:relative; top: 125px; margin-left: -50px'>\n\n</div>\n<div id=\"bundle-items\" class='span7 pull-left'>\n \n</div>\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/bundlesfilterview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push('<legend>Filter</legend>\nEditor:\n<div class="dropdown" style="font-size: 16px; margin-top: 4px; margin-bottom: 10px; width: 150px">\n <a id=\'filter-editor-choice\' class="dropdown-toggle" data-toggle="dropdown" href="#">', selectedEditor, ' <b class="caret"></b></a>\n <ul id="menu3" class="dropdown-menu">\n '), _.each(_.uniq(app.user.editors).sort(), function (e) {
__p.push("\n <li><a class='filter-editor' style='cursor: pointer'>", e, "</a></li>\n ")
}), __p.push("\n <li class=\"divider\"></li>\n <li><a id='anyz' class='filter-editor' style='cursor: pointer'>Any</a></li>\n </ul>\n</div>\nAccuracy:\n<div class=\"dropdown\" style=\"font-size: 16px; margin-top: 4px margin-bottom: 10px\">\n <a id='filter-accuracy-choice' class=\"dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">Any<b class=\"caret\"></b></a>\n <ul id=\"menu3\" class=\"dropdown-menu\">\n <li><a class='filter-accuracy' style='cursor: pointer'>Any</a></li>\n <li class=\"divider\"></li>\n <li><a class='filter-accuracy' style='cursor: pointer'><= 100%</a></li>\n <li><a class='filter-accuracy' style='cursor: pointer'><= 75%</a></li>\n <li><a class='filter-accuracy' style='cursor: pointer'><= 50%</a></li>\n <li><a class='filter-accuracy' style='cursor: pointer'><= 25%</a></li>\n <li class=\"divider\"></li>\n <li><a class='filter-accuracy' style='cursor: pointer'>N/A</a></li>\n </ul>\n</div>\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/bundleview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push(""), bundle.locked && __p.push('\n <img src="https://d2r64hzyhllbrg.cloudfront.net/locked.png" class="locked"></img>\n'), __p.push('\n<div class="bundle-name">\n ', bundle.name, '\n</div>\n<div class="bundle-details">\n <div class="bundle-accuracy bundle-info">\n ', accuracy, ' Accuracy\n </div>\n <div class="bundle-shortcut-count bundle-info">\n ', length, ' shortcuts\n </div>\n <div class="bundle-sc-divider bundle-info">\n <hr>\n </div>\n <div class="bundle-shortcut-description bundle-info">\n No shortcuts in bundle\n </div>\n <div class="bundle-shortcut-keys bundle-info">\n </div>\n</div>\n');
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/chooseeditorview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push("<h1>Welcome to shortcutFoo!</h1>\n<h2>Choose your editor</h2>\n<h6 style='margin-top: -5px; margin-bottom: 10px'>you can change this later</h6>\n<div id=\"editor-items\" class='center' style='width:100%; margin-left: 0px'>\n "), _.each(editors.sort(), function (e) {
__p.push("\n <div id='", e, "' class='span3 editor-pick'>\n <div class='editor-pick-name'>\n ", e, "\n </div>\n </div>\n ")
}), __p.push("\n</div>\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this
.JST["backbone/templates/demo"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push('<h6 style=\'position: absolute; display:none; color: #D00202; margin-left:350px; margin-top:-20px\' id=\'from-zendesk\'></h6>\n<div class="span14" style="margin-left: 40px; color: white; margin-top: 100px">\n<p id="demo-header">Work faster. Start shortcut drills now using:</p>\n<div id="demo-buttons">\n<a class="btn btn-inverse btn demo-editor btn-homepage" id="vim">Vim</a>\n<a class="btn btn-inverse btn demo-editor btn-homepage" id="sublimetext">Sublime</a>\n<a class="btn btn-inverse btn demo-editor btn-homepage" id="emacs">Emacs</a>\n<a class="btn btn-inverse btn demo-editor btn-homepage" id="textmate">TextMate</a>\n<a class="btn btn-inverse btn demo-editor btn-homepage" id="visualstudio">Visual Studio</a>\n<a class="btn btn-inverse btn demo-editor btn-homepage" id="excel">Excel</a>\n<a class="btn btn-inverse btn demo-editor btn-homepage" id="commandline">Command Line</a>\n<a class="btn btn-inverse btn demo-editor btn-homepage" id="photoshop">Photoshop</a>\n<a class="btn btn-inverse btn demo-editor btn-homepage" id="git" style="width: 30px">Git</a>\n</div>\n<div id=\'other-editors\' style=\'margin-top:15px; font-size:18px\'>\n <a id="eclipse" class=\'demo-editor\' style=\'color:black; cursor:pointer; font-size:18px\'>Eclipse</a>, <a id="resharper" class=\'demo-editor\' style=\'color:black; cursor:pointer; font-size:18px\'>ReSharper</a>, <a id="intellijidea" class=\'demo-editor\' style=\'color:black; cursor:pointer; font-size:18px\'>IntelliJ IDEA</a>, <a id="rubymine" class=\'demo-editor\' style=\'color:black; cursor:pointer; font-size:18px\'>RubyMine</a>, <a id="appcode" class=\'demo-editor\' style=\'color:black; cursor:pointer; font-size:18px\'>AppCode</a>, <a id="pycharm" class=\'demo-editor\' style=\'color:black; cursor:pointer; font-size:18px\'>PyCharm</a>, <a id="webstorm" class=\'demo-editor\' style=\'color:black; cursor:pointer; font-size:18px\'>WebStorm/PhpStorm</a> & <a id="gmail" class=\'demo-editor\' style=\'color:black; cursor:pointer; font-size:18px\'>Gmail</a>\n</div>\n</div>\n');
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/demoeditorview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push("<h2 style='text-align: center; margin-top: 30px' id=\"what_do_you_want_to_learn\">What do you want to learn?</h2>\n<div id=\"demo-editor-items\" style='margin-left: 35px; margin-top: 10px'>\n "), _.each(editors, function (e) {
__p.push("\n <a class='span2 demo-editor-pick btn' id='", e.idTag, "' style='margin-top: 20px; font-size: 16px; font-weight: bold'>\n ", e.displayName, "\n </a>\n ")
}), __p.push("\n</div>\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/demoregister"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push('<form action="/register" id="register_form" method="post" style=\'font-size: 14px; margin-top: 20px\'>\n<div class="control-group" id="email_control_group">\n<span class="help-block" id="email_help"></span>\n<div class="input-prepend">\n<span class="add-on">\n<i class="icon-envelope"></i>\n</span>\n<input style=\'width: 160px\' id="email" name="email" placeholder="Email" type="text">\n</div>\n</div>\n<div class="control-group" id="password_control_group">\n<span class="help-block" id="password_help"></span>\n<div class="input-prepend">\n<span class="add-on">\n<i class="icon-lock"></i>\n</span>\n<input style=\'width: 160px\' id="password" name="password" placeholder="Password" type="password">\n</div>\n<button class="btn btn-success btn-large" id="index-get-started" type="submit">Get Started Now</button>\n</div>\n</form>\n\n<script type="text/javascript" charset="utf-8">\n $(\'#register_form\').submit(function(){\n $(\'#invalid_email_or_pw\').html(\'\');\n var valid = true;\n\n if(!$(\'#email\').val()) {\n $(\'#email_help\').html(\'Please enter your email address\');\n $(\'#email_control_group\').addClass("error");\n valid = false;\n } else if(!validateEmail($(\'#email\').val())) {\n $(\'#email_help\').html(\'Please enter a valid email\');\n $(\'#email_control_group\').addClass("error");\n valid = false;\n } else {\n $(\'#email_help\').html(\'\');\n $(\'#email_control_group\').removeClass("error");\n }\n\n if(!$(\'#password\').val()) {\n $(\'#password_help\').html(\'Please enter a password\');\n $(\'#password_control_group\').addClass("error");\n valid = false;\n } else {\n $(\'#password_help\').html(\'\');\n $(\'#password_control_group\').removeClass("error");\n }\n\n if(!valid){\n return false;\n }\n });\n</script>\n');
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/demostartview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push("<div id=\"welcome-text\" style='margin-bottom: 40px; width: 100%; text-align: center'>\n <h2>Welcome to shortcutFoo!</h2>\n <h3 style='color: gray'>Please follow the tutorial below, or feel free to dive in with the menus above.</h3>\n</div>\n<div id='practice-options' class='filters span2 pull-left' style='position:relative; top: 60px;'>\n <div id='legend'>\n <legend style='margin-bottom:10px'>Legend</legend>\n ⇧ - Shift<br>\n "), isWin7 || __p.push("\n ⌥ - Alt<br>\n ⌃ - Control<br>\n ⌘ - Command<br>\n "), __p.push("\n ↵ - Enter\n </div>\n</div>\n\n\n<div id=\"demo-container\" style='position: relative; margin-left: 120px'>\n <h6 id='gmail-enable' style='margin-left:110px; color: #D00202; display:none'>note: To use shortcuts in Gmail, you must enable them in settings.</h6>\n <div id=\"demo-drill-shortcuts-stats\" class='span8' style='margin-top:5px'>\n <div class='span4 pull-left' style=\"margin-left: 40px; margin-top: 10px\">\n <div id=\"demo-drill-shortcuts\" style=''>\n <div id=\"demo-current-shortcut\" class=\"shortcut\">\n <div class=\"description\">\n\n </div>\n <div class=\"keys well\">\n <span class=\"key-area\"></span><span class='blinking-cursor'>|</span>\n </div>\n\n </div>\n\n <div id=\"demo-previous-shortcut\" class=\"shortcut\">\n <div class=\"description\">\n\n </div>\n <div class=\"keys\">\n\n </div>\n </div>\n </div>\n </div>\n <div class='pull-left span3' id=\"demo-drill-stats\" style='padding: 5px; margin-top: 10px; margin-bottom: 30px;'>\n <div id='demo-help' style='font-size: 20px; line-height: 24px;'></div>\n <div style='font-size: 20px; line-height: 24px' id='demo-help-footer'></div>\n </div>\n \n </div>\n</div>\n<div id=\"social\" style='margin-top: 10px; margin-left: 50px' class='span7'>\n <div id=\"google\" class='pull-right'>\n <g:plusone href='https://www.shortcutfoo.com' size='medium'></g:plusone>\n </div>\n\n <div id=\"facebook\" class='pull-right'>\n <div class='fb-like' data-font='tahoma', data-href='https://www.facebook.com/shortcutFoo', data-layout='button_count', data-send='false', data-show-faces='false', data-width='10'>\n </div>\n </div>\n <div id=\"twitter\" class='pull-right'>\n <a class='twitter-share-button' data-text='Check out shortcutFoo. A fast and effective way to learn shortcuts -', data-url='https://www.shortcutfoo.com', data-via='shortcutfoo', data-show-count='false', href='https://twitter.com/share'>Tweet</a>\n </div>\n</div>\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/drillview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push("<div id='practice-options' class='filters span2 pull-left' style='position:relative; top: 60px;'>\n <legend style='margin-bottom:10px'>Options</legend>\n <span>Keys</span>\n <div class=\"btn-group\" data-toggle=\"buttons-radio\">\n <button class=\"btn btn-small\" id='show-keys'>Show</button>\n <button class=\"btn btn-small\" id='hide-keys'>Hide</button>\n <button class=\"btn btn-small\" id='delay-keys'>Delay</button>\n </div>\n <div id='legend' style='margin-top:20px'>\n <legend style='margin-bottom:10px'>Legend</legend>\n ⇧ - Shift<br>\n "), isWin7 || __p.push("\n ⌥ - Alt<br>\n ⌃ - Control<br>\n ⌘ - Command<br>\n "), __p.push('\n ↵ - Enter\n </div>\n</div>\n\n\n\n<div id=\'drillview\' style=\'margin-left: 120px\'>\n <i class="icon-question-sign help-popover-bottom pull-right" rel="popover" title="Help" data-content="As shortcut descriptions appear to the left, type the keys corresponding to that description. Hover over other elements for more help."></i>\n <h1 id=\'drill-name\'>', name, '</h1>\n <div id="drill-shortcuts">\n <div id="current-shortcut" class="shortcut">\n <div class="description">\n \n </div>\n <div class="keys well pop-tip-left" rel="tooltip" title="Type the shortcut keys for the description above.">\n <span class="key-area"></span><span class=\'blinking-cursor\'>|</span>\n </div>\n \n </div>\n\n <div id="previous-shortcut" class="shortcut pop-tip-left" rel="tooltip" title="Correct and incorrect shortcuts typed will show here.">\n <div class="description">\n \n </div>\n <div class="keys">\n \n </div>\n </div>\n <div id=\'count-down\'>\n <span class=\'count-down-number\'>3</span>\n </div>\n </div>\n <div id="drill-timer-stats">\n <div id="timer-and-buttons">\n <a id=\'timer-up\' class="btn btn-large timer-button"><img src=\'https://d2r64hzyhllbrg.cloudfront.net/arrowup.png\'></img></a>\n <a id=\'timer-down\' class="btn btn-large timer-button"><img src=\'https://d2r64hzyhllbrg.cloudfront.net/arrowdown.png\'></img></a>\n <div id="drill-timer" class=\'well pop-tip-left\' rel="tooltip" title="Time left for drills. Elapsed time for practice mode.">\n 1:00\n </div>\n </div>\n <div id="drill-stats" class="well">\n <div id="drills-scpm" class="drill-stat pop-tip-left" rel="tooltip" title="Shortcuts per minute">SCPM: 0</div>\n <div id="drills-accuracy" class="drill-stat pop-tip-left" rel="tooltip" title="Shortcuts correct / total shortcuts typed * 100">Accuracy: N/A</div>\n <div id="drills-longest-streak" class="drill-stat pop-tip-left" rel="tooltip" title="Longest streak of shortcuts typed in a row">Longest Streak: 0</div>\n </div>\n <div id="drill-stop">\n <a id="startstop" class="btn btn-large btn-success">Start</a>\n </div>\n </div>\n\n <div id="drill-summary">\n <h1>Drill Complete</h1>\n <div id="drill-summary-stats">\n <div id="drills-summary-elapsed-time" class="drills-summary-stat">Elapsed Time: 0:00</div>\n <div id="drills-summary-total" class="drills-summary-stat">Total Shortcuts Typed: 0</div>\n <div id="drills-summary-scpm" class="drills-summary-stat">Shortcuts Per Minute: 0</div>\n <div id="drills-summary-accuracy" class="drills-summary-stat">Accuracy: N/A</div>\n <div id="drills-summary-longest-streak" class="drills-summary-stat">Longest Streak: 0</div>\n <div id="drills-summary-tweet" class="drills-summary-stat"><a href="https://twitter.com/share" class="twitter-share-button" data-url="https://www.shortcutfoo.com" data-text="', tweetText, ' -" data-via="shortcutfoo" data-size="large" data-count="none">Tweet</a></div>\n <div id="tweet-text" class="drills-summary-stat" style="font-family: \'Architects Daughter\', cursive; font-size: 18px; margin-top: -10px">\n - "', tweetText, '"\n </div>\n </div> \n <div id="drill-summary-buttons">\n <a id="home" class="btn btn-large btn-info">Home</a>\n <a id="retry" class="btn btn-large">Retry</a>\n </div>\n </div>\n</div>\n\n');
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/edit"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push("<h1>Edit ", name, "</h1>\n<form>\n <button>Save</button>\n</form>\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/editbundlesview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push('<h1 id="choose_a_bundle">Bundles <i class="icon-question-sign help-popover" rel="popover" title="Bundles" data-content="Bundles are groups of related shortcuts. Click a bundle to edit it, or click the plus to create a new one. Move your cursor over a bundle to see the shortcuts." style="margin-top: 8px"></i></h1>\n<div id="add-new-bundle" class="bundle">+</div>\n<span style="float: left; margin-left: -78px; margin-top: 85px;color: #222; text-shadow: 0px 1px 1px #555;">New Bundle</span>\n<div id=\'bundle-filters\' class=\'filters span2 pull-left\' style=\'position:relative; top: 150px; margin-left: -120px\'>\n\n</div>\n<div id="bundle-items" class=\'span7 pull-left\'>\n</div>\n');
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/editbundleview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push("<div id='bundle-shortcut-filters' class='filters span2 pull-left'>\n\n</div>\n<div id=\"edit-bundle\" class='pull-left span8'>\n"), isExistingBundle && __p.push('\n <div class="dropdown settings-toggle pull-right">\n <a class="dropdown-toggle btn" data-toggle="dropdown" href="#" style=\'width: 12px;\'><i class="icon-cog"></i></a>\n <ul id="menu3" class="dropdown-menu" style=\'margin-left: -130px;\'>\n <li><a class=\'reset-bundle-stats\' style=\'cursor: pointer;\'><i class="icon-refresh"></i> Reset Stats</a></li>\n <li><a class=\'delete-bundle\' style=\'cursor: pointer;\'><i class="icon-trash"></i> Delete</a></li>\n </ul>\n </div>\n'), __p.push('\n \n<div class="page-header">\n <h1>', pageName, '</h1>\n</div>\n<form class="form-horizontal">\n <div class="control-group" id="name-control-group">\n <label class="control-label" for="bundle-name">Name</label>\n <div class="controls">\n <input type="text" class="input-xlarge" id="bundle-name">\n <p class="help-inline input-help" id="name-help"></p>\n </div>\n </div>\n <div class=\'control-group\' id=\'editor-control-group\'>\n <label class="control-label" for="editor">Editor</label>\n <div class="controls">\n <div id="editor"></div>\n </div>\n </div>\n</form>\n<div class=\'control-group\' id=\'shortcuts-control-group\'>\n<legend>Shortcuts in this bundle <i class="icon-question-sign help-popover" rel="popover" title="Shortcuts in this bundle" data-content="Search and select shortcuts from below. Click add to move them to this list."></i></legend><span id="shortcuts-help" class="help-inline"></span>\n</div>\n<div id=\'selected-shortcuts-container\'>\n</div>\n\n<legend>Search shortcuts</legend>\n<div id=\'search-shortcuts\'>\n</div>\n\n<div id=\'bundle-save\'>\n <a id="save" class="btn btn-large btn-success">Save</a>\n</div>\n'), showChecks && __p.push('\n <br \\><br \\>\n <input type="checkbox" id="all" checked=\'checked\'> all</input>\n <br \\><br \\>\n <input type="checkbox" id="locked" checked=\'checked\'> locked</input>\n <br \\><br \\>\n <input type="checkbox" id="stay" checked=\'checked\'> stay</input>\n'), __p.push('\n</div>\n\n<div class="modal fade" id="action-modal" style="display:none">\n <div class="modal-header">\n <a class="close" data-dismiss="modal">×</a>\n <h3 id=\'action-confirmation-title\'>Confirm Delete</h3>\n </div>\n <div class="modal-body">\n <h4 id=\'action-confirmation-header\'>Are you sure you want to delete this bundle?</h4>\n <p id=\'action-confirmation-body\'>Note: Deleting the bundle will not delete it\'s shortcuts.</p>\n </div>\n <div class="modal-footer">\n <a id=\'action-confirmation-button\' class="btn btn-danger" href="#">Delete this bundle</a> <a id=\'action-confirmation-cancel\'class="btn" href="#">Cancel</a>\n \n </div>\n</div>\n');
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/editorpicker"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push('<div class="dropdown" style="font-size: 16px; margin-top: 4px">\n <a id=\'editor-choice\' class="dropdown-toggle" data-toggle="dropdown" href="#">', selectedEditor, ' <b class="caret"></b></a>\n <ul id="menu3" class="dropdown-menu">\n '), _.each(editors, function (e) {
__p.push("\n <li><a class='editor-option' style='cursor: pointer'>", e, "</a></li>\n ")
}), __p.push('\n <li class="divider"></li>\n <li><a id=\'new-editor\' style=\'cursor: pointer\' class=\'disabled\'>Add Custom Editor</a></li>\n </ul>\n</div>\n\n<div class="modal fade" id="editorModal" style="display:none">\n <div class="modal-header">\n <a class="close" data-dismiss="modal">×</a>\n <h3>Manage Editors</h3>\n </div>\n <div class="modal-body">\n <form class="form-horizontal">\n <div class="control-group" id="name-control-group" style="margin-left: -60px">\n <label class="control-label" for="editor-name">Name</label>\n <div class="controls">\n <input type="text" class="input-xlarge" id="editor-name" style: \'margin-bottom: 10px\'><a id=\'add-editor\' class="btn btn-small btn-primary" style=\'margin-left: 10px\'>Add</a>\n </div>\n </div>\n </form>\n <div style="margin-left: 20px; overflow: hidden; ">\n <ul style="list-style-type: none;">\n '), _.each(editors, function (e) {
__p.push("\n "), e != "Vim" && e != "Emacs" && e != "Command Line" && e != "Excel" && e != "TextMate" && e != "Microsoft Visual Studio" && e != "XCode" && e != "Sublime Text 2 (mac)" && e != "Sublime Text 2 (win)" && e != "Photoshop (mac)" && e != "Photoshop (win)" && e != "Eclipse (mac)" && e != "Eclipse" && e != "Gmail" && e != "Zendesk" && e != "AppCode" && e != "IntelliJ IDEA" && e != "IntelliJ IDEA (mac)" && e != "PyCharm" && e != "PyCharm (win)" && e != "ReSharper (IDEA Scheme)" && e != "ReSharper (VS Scheme)" && e != "RubyMine" && e != "RubyMine (win)" && e != "WebStorm" && e != "WebStorm (mac)" && e != "Git" && e != "WebStorm/PhpStorm (mac)" && e != "WebStorm/PhpStorm" && __p.push("\n <li style=\"margin-bottom: 5px; float: left\" class='span3'>\n <a id='", e, '\' class="btn btn-danger btn-mini remove-editor">\n <i class="icon-remove icon-white"></i></a> ', e, "\n </li>\n "), __p.push("\n ")
}), __p.push('\n </ul>\n </div>\n </div>\n <div class="modal-footer">\n <a id=\'close-editor-changes\' class="btn">Close</a>\n \n </div>\n</div>\n');
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/editshortcutsview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push('<h1 id="choose-a-shortcut">Shortcuts <i class="icon-question-sign help-popover" rel="popover" title="Shortcuts" data-content="Click a shortcut to edit it, or click plus to create a new one." style="margin-top: 8px"></i></h1>\n<div id="add-new-shortcut" class="bundle pull-left">+</div>\n<span style="float: left; margin-left: -80px; margin-top: 85px;color: #222; text-shadow: 0px 1px 1px #555;">New Shortcut</span>\n\n<div id=\'shortcut-filters\' class=\'filters span2 pull-left\' style=\'position:relative; top: 150px; margin-left: -120px\'>\n\n</div>\n\n<div id="shortcut-items" class=\'pull-left\' style=\'width: 600px; margin-left: 20px\'>\n\n</div>\n');
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/editshortcutview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push(""), isExistingShortcut && __p.push('\n<div class="dropdown settings-toggle pull-right">\n <a class="dropdown-toggle btn" data-toggle="dropdown" href="#" style=\'width: 12px;\'><i class="icon-cog"></i></a>\n <ul id="menu3" class="dropdown-menu" style=\'margin-left: -130px;\'>\n <li><a class=\'reset-stats\' style=\'cursor: pointer;\'><i class="icon-refresh"></i> Reset Stats</a></li>\n <li><a class=\'delete\' style=\'cursor: pointer;\'><i class="icon-trash"></i> Delete</a></li>\n </ul>\n</div>\n'), __p.push('\n<div class="page-header">\n <h1>', pageName, '</h1>\n</div>\n<form class="form-horizontal">\n<div class=\'control-group\' id=\'editor-control-group\'>\n <label class="control-label" for="editor">Editor</label>\n <div class="controls">\n <div id=\'editor\'></div>\n </div>\n</div>\n<div class=\'control-group\' id=\'description-control-group\'>\n <label class="control-label" for="description">Description</label>\n <div class="controls">\n <input placeholder="Shortcut description" type="text" class="input-xlarge" id="description" maxlength="50">\n <span id="description-help" class="help-inline"></span>\n </div>\n</div>\n<div class=\'control-group\' id=\'keys-control-group\'>\n <label class="control-label" for="keys">Keys</label>\n <div class="controls">\n <div id="keys">\n\n </div>\n </div>\n</div>\n<div class=\'control-group\' id=\'buttons-control-group\'>\n <label class="control-label"></label>\n <div class="controls">\n <a id="record" class="btn"><i class="icon-play-circle"></i> Record</a>\n <span id="buttons-help" class="help-inline">Press record to start typing your shortcut.</span>\n </div>\n</div>\n</form>\n\n\n<div id=\'edit-shortcut-save\'>\n <a id="save" class="btn btn-large btn-success">Save</a>\n</div>\n'), showChecks && __p.push('\n <br \\><br \\>\n <input type="checkbox" id="all" checked=\'checked\'> all</input>\n <br \\><br \\>\n <input type="checkbox" id="locked" checked=\'checked\'> locked</input>\n <br \\><br \\>\n <input type="checkbox" id="stay" checked=\'checked\'> stay</input>\n'), __p.push('\n\n<div class="modal fade" id="action-modal" style="display:none">\n <div class="modal-header">\n <a class="close" data-dismiss="modal">×</a>\n <h3 id=\'action-confirmation-title\'>Confirm Delete</h3>\n </div>\n <div class="modal-body">\n <h4 id=\'action-confirmation-header\'>Are you sure you want to delete this shortcut?</h4>\n </div>\n <div class="modal-footer">\n <a id=\'action-confirmation-button\' class="btn btn-danger" href="#">Delete this shortcut</a> <a id=\'action-confirmation-cancel\'class="btn" href="#">Cancel</a>\n \n </div>\n</div>\n');
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/enterpriseview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push("<h1 style='text-align:center; margin-bottom:20px'>Sign Up Your Team</h1>\n<div id='pricing-type-container'>\n <div id='basic-plan' class=\"span6 upgrade-top-section pricing-type\" style=\"\">\n <p class='enterprise-header'>Sign up your team. Be more productive.</p>\n <div style='margin-top:40px; color: #6083A0'>\n <p style='font-size: 20px'>Enter number of seats</p>\n <input style='width:100px; text-align:center' type=\"text\" name=\"seat-count\" value=\"1\" id=\"seat-count\">\n <p style='font-size: 18px'>Total Cost: $<span id='total-enterprise-cost'>29.99</span></p>\n </div>\n <button id='pricing-signup-enterprise' class='btn btn-info plan-button' style='width:200px'>\n <span style='font-size:14px'>Sign Up With Enterprise</span>\n </button>\n </div>\n <div id='ultimate-plan' class=\"span3 upgrade-top-section pricing-type\">\n <p class='pricing-type-header'>Enterprise</p>\n <p class='pricing-price'>$29.99</p>\n <p style='color: gray; margin-top:-7px'>one time payment per seat</p>\n <div style='text-align:left; margin-left:30px; margin-top:20px; color: #6083A0'>\n <p>• All Editors Unlocked</p>\n <p>• Unlimited Custom Editors</p>\n <p>• Unlimited Custom Bundles</p>\n <p>• Unlimited Custom Shortcuts</p>\n <p>• Unlimited Drills</p>\n <p>• Interval Training</p>\n <p>• 24/7 Support</p>\n </div>\n </div>\n <div id=\"pricing-body\" style='text-align: center;'>\n </div>\n</div>\n\n\n\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/error"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push('<div class="alert alert-error fade in">\n <a class="close" data-dismiss="alert" href="#">&times;</a>\n ', message, "\n</div>\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/guest_notification"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push('<div class="alert fade in" style="position:absolute; left:40px">\n <a class="close" data-dismiss="alert" href="#">&times;</a>\n <span>', message, "</span>\n</div>\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/home"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push('<div id="default-editor" style=\'margin-left: -60px; width: 170px\'>\n Primary Editor <i class="icon-question-sign help-popover" rel="popover" title="Primary Editor" data-content="Choose your primary editor here. This default will be applied to your home screen, new bundles, new shortcuts, and filters. You can add and remove editors by clicking on Add Custom Editor in the drop down."></i>\n <div id="editor"></div>\n <div id="unlock_editor">Unlock an Editor</div>\n</div>\n\n\n<h2 class=\'home-header\'>Quick 1 Minute Drills <i class="icon-question-sign help-popover" rel="popover" title="Quick Drills" data-content="Click on these bundles to take you directly into a 1 minute drill. Your last three drills are shown here." style=\'margin-top: 6px\'></i></h2>\n<div id="quick-drills" class="span10 center">\n</div>\n\n'), drawShortcutsThatNeedWorkTable && __p.push('\n<h2 class=\'home-header\'>Shortcuts That Need Work <i class="icon-question-sign help-popover" rel="popover" title="Need Work" data-content="These are shortcuts with < 70% accuracy. Practice, drill, or bundle these for later." style=\'margin-top: 6px\'></i></h2>\n<div id="home-shortcuts-need-work" class="span10 center">\n <div id="shortcuts-need-work-table" class="span8 home-section">\n <a id=\'shuffle-needs-work\' class=\'btn btn-small pull-right pop-tip-top\' rel="tooltip" title="Shuffle"><i class=\'icon-random\'></i></a>\n <div id="needs-work-table-view" style=\'\'></div>\n <a id="need-work-drill" class="btn btn-info home-button">Drill</a>\n <a id="need-work-practice" class="btn home-button">Practice</a>\n <a id="need-work-bundle" class="btn home-button">Bundle These</a>\n </div>\n</div>\n'), __p.push("\n"), drawToTryTable && __p.push('\n<h2 class=\'home-header\'>Shortcuts You Have Not Tried <i class="icon-question-sign help-popover" rel="popover" title="Not Tried" data-content="These are shortcuts you have not tried yet. Practice, drill, or bundle these for later." style=\'margin-top: 6px\'></i></h2>\n<div id="home-shortcuts-not-tried" class="span10 center">\n <div id="shortcuts-not-tried" class="span8 home-section">\n <a id=\'shuffle-to-try\' class=\'btn btn-small pull-right pop-tip-top\' rel="tooltip" title="Shuffle"><i class=\'icon-random\'></i></a>\n <div id="to-try-table-view" style=\'\'></div>\n <a id="not-tried-drill" class="btn btn-info home-button">Drill</a>\n <a id="not-tried-practice" class="btn home-button">Practice</a>\n <a id="not-tried-bundle" class="btn home-button">Bundle These</a>\n </div>\n</div>\n'), __p.push('\n\n<div class="modal fade" id="unlockEditorModel" style="display:none">\n <div class="modal-header">\n <a class="close" data-dismiss="modal">×</a>\n <h3>Welcome! - Unlock An Editor (<span id="unlocks-left"></span> left)</h3>\n </div>\n <div class="modal-body">\n <h4>\n Please choose which editor you\'d like to unlock:\n </h4>\n <h6>Note: This cannot be undone. Please choose carefully.</h6>\n <div style="margin-top:10px">\n <a id=\'appcode\' class=\'btn btn-info unlock-editor-btn\'>AppCode</a>\n <a id=\'commandline\' class="btn btn-info unlock-editor-btn">Command Line</a>\n <a id=\'eclipse\' class="btn btn-info unlock-editor-btn">Eclipse</a>\n <a id=\'eclipse\' class="btn btn-info unlock-editor-btn">Emacs</a>\n <a id=\'excel\' class="btn btn-info unlock-editor-btn">Excel</a>\n <a id=\'git\' class="btn btn-info unlock-editor-btn">Git</a>\n <a id=\'gmail\' class="btn btn-info unlock-editor-btn">Gmail</a>\n <a id=\'intellijidea\' class="btn btn-info unlock-editor-btn">IntelliJ IDEA</a>\n <a id=\'photoshop\' class="btn btn-info unlock-editor-btn">Photoshop</a>\n <a id=\'pycharm\' class="btn btn-info unlock-editor-btn">PyCharm</a>\n <a id=\'resharper\' class="btn btn-info unlock-editor-btn">ReSharper</a>\n <a id=\'rubyminde\' class="btn btn-info unlock-editor-btn">RubyMine</a>\n <a id=\'sublimetext\' class="btn btn-info unlock-editor-btn">Sublime Text 2</a>\n <a id=\'textmate\' class="btn btn-info unlock-editor-btn">TextMate</a>\n <a id=\'vim\' class="btn btn-info unlock-editor-btn">Vim</a>\n <a id=\'visualstudio\' class="btn btn-info unlock-editor-btn">Visual Studio</a>\n <a id=\'webstorm\' class="btn btn-info unlock-editor-btn">WebStorm/PhpStorm</a>\n <a id=\'xcode\' class="btn btn-info unlock-editor-btn">XCode</a>\n </div>\n \n </div>\n <div class="modal-footer">\n <div id=\'unlock-footer\'>\n <p style="float:left; font-size:18px; margin-left: 100px">You\'ve selected <span id="selected-unlock-editor-name">Vim</span></p>\n <a id=\'unlock-sure\' class="btn btn-success">Are you sure?</a>\n </div>\n </div>\n</div>\n');
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/index"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push("");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/index_demo_pricing"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push('<h6 style=\'position: absolute; display:none; color: #D00202; margin-left:350px; margin-top:-20px\' id=\'from-zendesk\'></h6>\n<div class="span14" style="margin-left: 40px; color: white; margin-top: 100px">\n<p id="demo-header">Work faster. Start shortcut drills now using:</p>\n<div id="demo-buttons">\n<a class="btn btn-inverse btn demo-editor btn-homepage" id="vim">Vim</a>\n<a class="btn btn-inverse btn demo-editor btn-homepage" id="sublimetext">Sublime</a>\n<a class="btn btn-inverse btn demo-editor btn-homepage" id="emacs">Emacs</a>\n<a class="btn btn-inverse btn demo-editor btn-homepage" id="textmate">TextMate</a>\n<a class="btn btn-inverse btn demo-editor btn-homepage" id="visualstudio">Visual Studio</a>\n<a class="btn btn-inverse btn demo-editor btn-homepage" id="excel">Excel</a>\n<a class="btn btn-inverse btn demo-editor btn-homepage" id="commandline">Command Line</a>\n<a class="btn btn-inverse btn demo-editor btn-homepage" id="photoshop">Photoshop</a>\n<a class="btn btn-inverse btn demo-editor btn-homepage" id="git" style="width: 30px">Git</a>\n</div>\n<div id=\'other-editors\' style=\'margin-top:15px; font-size:18px\'>\n <a id="eclipse" class=\'demo-editor\' style=\'color:black; cursor:pointer; font-size:18px\'>Eclipse</a>, <a id="resharper" class=\'demo-editor\' style=\'color:black; cursor:pointer; font-size:18px\'>ReSharper</a>, <a id="intellijidea" class=\'demo-editor\' style=\'color:black; cursor:pointer; font-size:18px\'>IntelliJ IDEA</a>, <a id="rubymine" class=\'demo-editor\' style=\'color:black; cursor:pointer; font-size:18px\'>RubyMine</a>, <a id="appcode" class=\'demo-editor\' style=\'color:black; cursor:pointer; font-size:18px\'>AppCode</a>, <a id="pycharm" class=\'demo-editor\' style=\'color:black; cursor:pointer; font-size:18px\'>PyCharm</a>, <a id="webstorm" class=\'demo-editor\' style=\'color:black; cursor:pointer; font-size:18px\'>WebStorm/PhpStorm</a> & <a id="gmail" class=\'demo-editor\' style=\'color:black; cursor:pointer; font-size:18px\'>Gmail</a>\n</div>\n</div>\n');
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/interval_trainer"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push("<div id=\"current-shortcut\" style=\"display:none\" class=\"shortcut\">\n <div class=\"description\">\n This is a shortcut\n </div>\n <div class=\"keys well pop-tip-left\" rel=\"tooltip\" title=\"Type the shortcut keys for the description above.\">\n <span class=\"key-area\"></span><span class='blinking-cursor'>|</span>\n </div>\n</div>\n\n<div id=\"rating\" style='text-align:center'>\n <div class=\"description\" style='font-size:18px; margin-bottom:15px'>\n Rate how well you did:\n </div>\n <button id='rating-1' class='btn btn-large' style='width: 97px'>1<br \\><span style='color:gray'>Try Again</span></button>\n <button id='rating-2' class='btn btn-large' style='width: 97px'>2<br \\><span style='color:gray'>Bad</span></button>\n <button id='rating-3' class='btn btn-large' style='width: 97px'>3<br \\><span style='color:gray'>Good</span></button>\n <button id='rating-4' class='btn btn-large' style='width: 97px'>4<br \\><span style='color:gray'>Awesome</span></button>\n</div>\n<div id='interval-help'>note: the first two rounds for a shortcut are practice!</div>\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/intervalscomplete"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push("<div id='intervals-not-started'>\n <span>Interval Training Complete</span>\n <br><br>\n <span>Congrats! You've completed your interval training for today. ", completedText, ".</span>\n <br><br>\n "), isGuest ? __p.push("\n <button id='intervals-go-plans' class='btn btn-info intervals-button'>\n <span style='font-size:14px'>Sign Up Now</span>\n </button>\n ") : __p.push("\n <button id='intervals-go-home' class='btn btn-info intervals-button'>\n <span style='font-size:14px'>Go back home</span>\n </button>\n "), __p.push("\n</div>\n\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/intervalsstats"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push("<a id='interval-settings' class=\"btn pull-right\" href=\"#\" style='width: 12px;'><i class=\"icon-cog\"></i></a>\n<h1 id='stats-header'>", app.user.defaultEditor, "</h1>\n<div id='intervals-stats'>\n <div class='interval-stat'><div class='interval-stat-number'>", trainedTodayCount, "</div><span class='interval-stat-description'>Shortcuts Trained Today</span></div>\n <div class='interval-stat'><div class='interval-stat-number'><span id='not-started-new-count'>", newCount, "</span></div><span class='interval-stat-description'>New Shortcuts Need Training</span></div>\n <div class='interval-stat'><div class='interval-stat-number'>", dueCount, "</div><span class='interval-stat-description'>Shortcuts Need Review</span></div>\n <div class='interval-stat'><div class='interval-stat-number'>", dueTomorrowCount, "</div><span class='interval-stat-description'>Shortcuts Due Tomorrow</span></div>\n <div class='interval-stat'><div class='interval-stat-number'>", daysLastCount, "</div><span class='interval-stat-description'>Days Since Last Training</span></div>\n <div id='no-interval-training-left' style='display: none; margin-top: 40px; margin-left: -80px; text-align: center'>Great Job! No Training Left Today For ", app.user.defaultEditor, ".</div>\n <button id='intervals-continue-training' class='btn btn-info intervals-button'>\n <span style='font-size:16px'>Continue Training</span>\n </button>\n</div>\n\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/intervalsview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push("<h1 id=\"choose_a_bundle\">Intervals <i class=\"icon-question-sign help-popover\" rel=\"popover\" title=\"Intervals\" data-content=\"Intervals use spaced repetition training to help you memorize shortcuts more efficiently. We'll show you the shortcuts you need to focus on, and tell you exactly when to practice to maximize memory recall. We will notify you via email when it's time to practice. It's that easy!\" style=\"margin-top: 8px\"></i></h1>\n<div id='practice-options' class='filters pull-left' style='position:relative; top: 40px; width: 175px'>\n <legend style='margin-bottom:10px'>What are intervals?</legend>\n <span>Intervals use spaced repetition training to help you memorize shortcuts more efficiently.</span>\n <br><br>\n <span>We'll show you the shortcuts you need to focus on, and tell you exactly when to practice to maximize memory recall.</span>\n <br><br>\n <span>We will notify you via email when it's time to practice. It's that easy!</span>\n</div>\n<div id='intervals-view' style='margin-left: 145px; height: 400px'>\n <a id='interval-settings' class=\"btn pull-right\" href=\"#\" style='width: 12px;'><i class=\"icon-cog\"></i></a>\n <div id='intervals-not-started'>\n <span>You have not started interval training for<br>", editorName, ".</span>\n <br><br>\n <span>We'll begin by working through a set of <span id='not-started-new-count'>", newCount, '</span> shortcuts.</span>\n <br><br>\n <button id=\'intervals-get-started\' class=\'btn btn-info intervals-button\'>\n <span style=\'font-size:14px\'>Let\'s Get Started</span>\n </button>\n </div>\n</div>\n\n<div class="modal fade" id="action-modal" style="display:none">\n <div class="modal-header">\n <a class="close" data-dismiss="modal">×</a>\n <h3 id=\'action-confirmation-title\'>Interval Settings</h3>\n </div>\n <div class="modal-body">\n <h4>Send email reminders when I have shortcuts ready for training?</h4>\n <div class="btn-group" data-toggle="buttons-radio" style=\'margin-top:10px; margin-bottom:20px\'>\n <button id=\'intervals-email-yes\' type="button" class="btn active" style=\'width:44px\'>Yes</button>\n <button id=\'intervals-email-no\' type="button" class="btn" style=\'width:44px\'>No</button>\n </div>\n <h4>New shortcuts to train each day? (10 recommended)</h4>\n <div id="intervals-new-btn-group" class="btn-group" data-toggle="buttons-radio" style=\'margin-top:10px; margin-bottom:20px\'>\n <button id=\'intervals-new-5\' type="button" class="btn interval-new-count" style=\'width:44px\'>5</button>\n <button id=\'intervals-new-10\' type="button" class="btn interval-new-count active " style=\'width:44px\'>10</button>\n <button id=\'intervals-new-20\' type="button" class="btn interval-new-count" style=\'width:44px\'>20</button>\n <button id=\'intervals-new-40\' type="button" class="btn interval-new-count" style=\'width:44px\'>40</button>\n <button id=\'intervals-new-80\' type="button" class="btn interval-new-count" style=\'width:44px\'>80</button>\n </div>\n <h4>Reset Interval Training For ', editorName, ' (this can not be undone!)</h4>\n <a id=\'reset-intervals\' class="btn btn-danger" href="#" data-loading-text="Resetting ', editorName, "...\" style='margin-top:10px'>Reset ", editorName, '</a>\n\n </div>\n <div class="modal-footer">\n <a id=\'save-settings\' class="btn btn-success" data-loading-text="Saving..." href="#">Save Settings</a> <a id=\'cancel-settings\'class="btn" href="#">Cancel</a>\n \n </div>\n</div>\n');
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/legend"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push(" <div id='legend'>\n <legend style='margin-bottom:10px'>Legend</legend>\n ⇧ - Shift<br>\n "), isWin7 || __p.push("\n ⌥ - Alt<br>\n ⌃ - Control<br>\n ⌘ - Command<br>\n "), __p.push("\n ↵ - Enter\n </div>\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/menuhorizontal"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push('<a id="menu-home-link">\n Home\n</a>\n<a id=\'menu-intervals-link\'>\n Intervals\n</a>\n<a id="menu-drills-link">\n Drills\n</a>\n<a id="menu-practice-link">\n Practice\n</a>\n<a id="menu-bundles-link">\n Bundles\n</a>\n<a id="menu-shortcuts-link">\n Shortcuts\n</a>\n<a id="menu-upgrade-link">\n'), app.user.email == "Guest" ? __p.push("\n Sign up\n") : __p.push("\n Upgrade\n"), __p.push("\n</a>\n"), app.user.nextDrill == 9344 && __p.push('\n<a id="menu-logout-link" href="/logout">\n Logout\n</a>\n'), __p.push("\n"), app.user.nextDrill != 9344 && __p.push('\n<a id="menu-signin-link" href="/sign_in">\n Sign in\n</a>\n'), __p.push("\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/menuview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push("<ul class='nav nav-list'>\n <li class='nav-header'>Welcome</li>\n <li class='active' id='menu-home'>\n <a id=\"menu-home-link\">\n Home\n </a>\n </li>\n <li class='nav-header'>Training</li>\n <li id='menu-drills'>\n <a href='/drills' id=\"menu-drills-link\">\n Drills\n </a>\n </li>\n <li id='menu-practice'>\n <a id=\"menu-practice-link\">\n Practice\n </a>\n </li>\n <li class='nav-header'>Customize</li>\n <li id='menu-bundles'>\n <a id=\"menu-bundles-link\">\n Bundles\n </a>\n </li>\n <li id='menu-shortcuts'>\n <a id=\"menu-shortcuts-link\">\n Shortcuts\n </a>\n </li>\n <li id='menu-upgrade'>\n <a id=\"menu-upgrade-link\">\n Upgrade\n </a>\n </li>\n <li id='menu-help'>\n <a id=\"menu-help-link\">\n Help\n </a>\n </li>\n</ul>\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/newbundleview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push('<legend>Bundle name</legend>\n<div class=\'control-group\' id=\'name-control-group\'>\n<input placeholder="Bundle name" type="text" class="input-xlarge" id="bundle-name" maxlength="50"><span id="name-help" class="help-inline"></span>\n</div>\n\n\n<legend>Shortcuts in this bundle</legend>\n<span class="offset1">Description</span><span class="offset4">Keys</span><span class="offset1">Accuracy</span>\n<div style="max-height: 400px; overflow-y: scroll; margin-bottom: 10px">\n <table class="table table-striped">\n <tbody id="selected-shortcuts">\n\n </tbody>\n </table>\n</div>\n\n<legend>Search shortcuts</legend>\n<span class="offset1">Description</span><span class="offset4">Keys</span><span class="offset1">Accuracy</span>\n<div style="height: 400px; overflow-y: scroll">\n <table class="table table-striped">\n <tbody id=\'unselected-shortcuts\'>\n '), _.each(keys, function (e) {
__p.push('\n <tr>\n <td>\n <a id="', e.id, '" class="btn btn-info btn-small add-key"><i class="icon-plus icon-white"></i></a>\n </td>\n <td>', e.description, "</td>\n <td>", e.sequence, "</td>\n <td>", e.accuracy, "</td>\n </tr>\n ")
}), __p.push('\n </tbody>\n </table>\n</div>\n<div style="width: 100%; text-align: right; margin-top: 20px">\n <a id="save" class="btn btn-large btn-success"><i class="icon-ok icon-white"></i> Save</a>\n</div>\n');
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/paypalupgradeview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) {
__p.push('<div id="upgrade-top">\n <div class="span3 upgrade-top-section" style="background-image: url(\'https://d2r64hzyhllbrg.cloudfront.net/shortcut.png\');background-repeat:no-repeat; background-position:center; ">\n <p class=\'upgrade-top-header\'>Create ', shortcutCount, " custom shortcuts</p>\n </div>\n <div class=\"span3 upgrade-top-section\" style=\"background-image: url('https://d2r64hzyhllbrg.cloudfront.net/bundle.png');background-repeat:no-repeat; background-position:center; \">\n <p class='upgrade-top-header'>Create ", bundleCount, ' custom bundles</p>\n </div>\n <div class="span3 upgrade-top-section" style="background-image: url(\'https://d2r64hzyhllbrg.cloudfront.net/unlock.png\');background-repeat:no-repeat; background-position:center;">\n <p class=\'upgrade-top-header\' style="z-index: 1000">Unlock ', editorCount, " bundles and shortcuts</p>\n </div>\n</div>\n\n<form class=\"form-horizontal\" id=\"upgrade-form\">\n <fieldset style='margin-left: 20px'>\n <div class=\"control-group\">\n <div class='controls'>\n <h2>One step away from signing up</h2>\n <p style='color:gray; width: 400px'>PayPal account will be charged a one time payment of ", price, "<span class='seat-count-description'></span> upon completion. We do not store any credit card information.</p>\n </div>\n </div>\n <div id=\"billing-info\">\n ");
if (app.user.nextDrill != 9344 || plan === "enterprise") __p.push("\n <div>\n "), plan === "enterprise" ? __p.push("\n <legend>Enter your contact information</legend>\n ") : __p.push("\n <legend>Enter your login information</legend>\n "), __p.push('\n <div class="control-group" id="email-control-group">\n <label class="control-label" for="email">Email</label>\n <div class="controls">\n <div class=\'input-prepend\'>\n <span class=\'add-on\'>\n <i class=\'icon-envelope\'></i>\n </span>\n <input type="text" class="input-large" id="email">\n <p class="help-inline input-help" id="email-help"></p>\n </div>\n </div>\n </div>\n '), plan === "enterprise" ? __p.push('\n <div class="control-group" id="company-control-group">\n <label class="control-label" for="company">Company</label>\n <div class="controls">\n <div class=\'input-prepend\'>\n <span class=\'add-on\'>\n <i class=\'icon-user\'></i>\n </span>\n <input type="text" class="input-large" id="company">\n <p class="help-inline input-help" id="company-help"></p>\n </div>\n </div>\n </div>\n ') : __p.push('\n <div class="control-group" id="password-control-group" style=\'margin-top:-10px\'>\n <label class="control-label" for="password">Password</label>\n <div class="controls">\n <div class=\'input-prepend\'>\n <span class=\'add-on\'>\n <i class=\'icon-lock\'></i>\n </span>\n <input type="password" class="input-large" id="password">\n <p class="help-inline input-help" id="password-help"></p>\n </div>\n </div>\n </div>\n \n <div class="control-group" id="password-confirmation-control-group" style=\'margin-bottom:30px; margin-top:-10px\'>\n <label class="control-label" for="password-confirmation">Password Confirmation</label>\n <div class="controls">\n <div class=\'input-prepend\'>\n <span class=\'add-on\'>\n <i class=\'icon-lock\'></i>\n </span>\n <input type="password" class="input-large" id="password-confirmation">\n <p class="help-inline input-help" id="password-confirmation-help"></p>\n </div>\n </div>\n </div>\n '), __p.push("\n </div>\n ");
__p.push('\n <div>\n <div class="control-group">\n <label class="control-label" for="input01"></label>\n <div class="controls">\n <button type="submit" class="submit-button">Complete Upgrade</button><img id="spinner" style=\'margin-left: 10px; margin-bottom: -5px\' src=\'https://d2r64hzyhllbrg.cloudfront.net/spinner.gif\'></img>\n </div>\n </div>\n </div>\n </div>\n </fieldset>\n</form>\n')
}
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/pricingview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push("<h1 style='text-align:center; margin-bottom:20px'>Choose a Plan</h1>\n<div id='pricing-type-container'>\n <div id='basic-plan' class=\"span3 upgrade-top-section pricing-type\" style=\"\">\n <p class='pricing-type-header'>Basic</p>\n <p class='pricing-price'>", basicPrice, "</p>\n <p style='color: gray; margin-top:-7px'>one time payment</p>\n <div style='text-align:left; margin-left:50px; margin-top:20px; font-size:14px; color: #6083A0'>\n <p>• 1 Editor Unlocked</p>\n <p>• No Custom Editors</p>\n <p>• 3 Custom Bundles</p>\n <p>• 30 Custom Shortcuts</p>\n <p>• Interval Training</p>\n </div>\n <button id='pricing-signup-basic' class='btn btn-info plan-button'>\n <span style='font-size:14px'>", signUpText, " Basic</span>\n </button>\n </div>\n <div id='pro-plan' class=\"span3 upgrade-top-section pricing-type\" style=\"\">\n <p class='pricing-type-header'>Pro</p>\n <p class='pricing-price'>", proPrice, "</p>\n <p style='color: gray; margin-top:-7px'>one time payment</p>\n <div style='text-align:left; margin-left:50px; margin-top:20px; color: #6083A0'>\n <p>• 3 Editors Unlocked</p>\n <p>• No Custom Editors</p>\n <p>• 9 Custom Bundles</p>\n <p>• 90 Custom Shortcuts</p>\n <p>• Interval Training</p>\n </div>\n <button id='pricing-signup-pro' class='btn btn-info plan-button'>\n <span style='font-size:14px'>", signUpText, " Pro</span>\n </button>\n </div>\n <div id='ultimate-plan' class=\"span3 upgrade-top-section pricing-type\">\n <p class='pricing-type-header'>Ultimate</p>\n <p class='pricing-price'>", ultimatePrice, "</p>\n <p style='color: gray; margin-top:-7px'>one time payment</p>\n <div style='text-align:left; margin-left:30px; margin-top:20px; color: #6083A0'>\n <p>• All Editors Unlocked</p>\n <p>• Unlimited Custom Editors</p>\n <p>• Unlimited Custom Bundles</p>\n <p>• Unlimited Custom Shortcuts</p>\n <p>• Interval Training</p>\n </div>\n <button id='pricing-signup-ultimate' class='btn btn-info plan-button'>\n <span style='font-size:14px'>", signUpText, " Ultimate</span>\n </button>\n </div>\n <div id=\"pricing-body\" style='text-align: center;'>\n </div>\n "), app.user.email == "Guest" && __p.push("\n <div id='sign_free' style='float: left; margin-top:10px; margin-bottom:5px; margin-left: 20px; color:gray'>You can also sign up <a href='/register' id='free_register'>for free</a> with limited features.</div>\n"), __p.push("\n <div id='sign_team' style='float: right; margin-top:10px; margin-bottom:5px; margin-left: 20px; color:gray'>Need multiple seats? See our <a style='cursor: pointer;' id='sign_team_link'>Enterprise Plan</a></div>\n</div>\n\n\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/shortcutsfilterview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push('<legend>Filter</legend>\nEditor:\n<div class="dropdown" style="font-size: 16px; margin-top: 4px; margin-bottom: 10px; width: 150px">\n <a id=\'filter-editor-choice\' class="dropdown-toggle" data-toggle="dropdown" href="#">', selectedEditor, ' <b class="caret"></b></a>\n <ul id="menu3" class="dropdown-menu">\n '), _.each(_.uniq(app.user.editors).sort(), function (e) {
__p.push("\n <li><a class='filter-editor' style='cursor: pointer'>", e, "</a></li>\n ")
}), __p.push('\n <li class="divider"></li>\n <li><a class=\'filter-editor\' style=\'cursor: pointer\'>Any</a></li>\n </ul>\n</div>\nIn Bundle:\n<div class="dropdown" style="font-size: 16px; margin-top: 4px; margin-bottom: 10px">\n <a id=\'filter-bundle-choice\' class="dropdown-toggle" data-toggle="dropdown" href="#">', selectedBundle, "<b class=\"caret\"></b></a>\n <ul id=\"menu3\" class=\"dropdown-menu\">\n <li><a class='filter-bundle' style='cursor: pointer'>Any</a></li>\n <li><a class='filter-bundle' style='cursor: pointer'>None</a></li>\n <li class=\"divider\"></li>\n "), _.each(bundles, function (e) {
__p.push("\n "), (e.get("editor") === selectedEditor || selectedEditor === "Any") && __p.push("\n <li><a class='filter-bundle' style='cursor: pointer'>", e.get("name"), "</a></li>\n "), __p.push("\n ")
}), __p.push("\n </ul>\n</div>\nAccuracy:\n<div class=\"dropdown\" style=\"font-size: 16px; margin-top: 4px margin-bottom: 10px\">\n <a id='filter-accuracy-choice' class=\"dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">Any<b class=\"caret\"></b></a>\n <ul id=\"menu3\" class=\"dropdown-menu\">\n <li><a class='filter-accuracy' style='cursor: pointer'>Any</a></li>\n <li class=\"divider\"></li>\n <li><a class='filter-accuracy' style='cursor: pointer'><= 100%</a></li>\n <li><a class='filter-accuracy' style='cursor: pointer'><= 75%</a></li>\n <li><a class='filter-accuracy' style='cursor: pointer'><= 50%</a></li>\n <li><a class='filter-accuracy' style='cursor: pointer'><= 25%</a></li>\n <li class=\"divider\"></li>\n <li><a class='filter-accuracy' style='cursor: pointer'>--</a></li>\n </ul>\n</div>\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/shortcutstableview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push('<table class="table table-striped">\n <thead>\n <tr>\n '), button != "none" && __p.push("\n <th></th>\n "), __p.push("\n "), sortDirection = sortAsc ? "icon-chevron-up" : "icon-chevron-down", __p.push("\n <th><a class='shortcut-table-header' id='sort-description'>"), sortBy === "description" ? __p.push("<i class='", sortDirection, "' style='margin-top: 2px'></i> ") : __p.push("", '<i style="width:18px; display:inline-block"></i>', ""), __p.push("description</a></th>\n <th style='text-align:center'><a class='shortcut-table-header' id='sort-keys'>"), sortBy === "keys" ? __p.push("<i class='", sortDirection, "' style='margin-top: 2px'></i> ") : __p.push("", '<i style="width:18px; display:inline-block"></i>', ""), __p.push("keys</a></th>\n <th style='text-align:center; width: 90px'><a class='shortcut-table-header' id='sort-accuracy'>"), sortBy === "accuracy" ? __p.push("<i class='", sortDirection, "' style='margin-top: 2px'></i> ") : __p.push("", '<i style="width:18px; display:inline-block"></i>', ""), __p.push("accuracy</a></th>\n <th></th>\n </tr>\n </thead>\n <tbody id='", tableId, "'>\n "), shortcuts.each(function (e) {
__p.push("\n "), e.get("removed") || (__p.push("\n <tr id=", e.get("parentId"), " class='shortcut-row'>\n "), button != "none" && (__p.push("\n <td>\n "), button == "add" && !e.get("locked") ? __p.push('\n <a id="', e.get("parentId"), '" class="btn btn-info btn-small add-key"><i class="icon-plus icon-white"></i></a>\n ') : button != "add" && !e.get("locked") && __p.push('\n <a id="', e.get("parentId"), '" class="btn btn-danger btn-small add-key"><i class="icon-minus icon-white"></i></a> \n '), __p.push("\n </td>\n ")), __p.push("\n <td>", e.get("description"), "</td>\n <td style='text-align: center'>", e.toString(), "</td>\n <td class='shortcut-accuracy' style='text-align: center'><span class='accuracy-container'>", e.accuracy(), "</span></td>\n <td>\n "), e.get("locked") || (__p.push("\n <div class='confirmation-buttons' style='display: none; opacity: 0; margin-left: -100px; width: 130px'><a class='confirm-operation btn btn-small btn-danger' style='color: white; margin-right: 10px'>Delete</a><a class='cancel-operation btn btn-small'>Cancel</a></div>\n <div class=\"dropdown settings-toggle\" style='opacity: 0; float: left'>\n <a class=\"dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\" style='width: 12px;'><i class=\"icon-cog\" style='opacity: .5'></i></a>\n <ul id=\"menu3\" class=\"dropdown-menu\" style='margin-left: -150px;'>\n <li><a class='reset-stats' style='cursor: pointer;'><i class=\"icon-refresh\"></i> Reset Stats</a></li>\n <li><a class='delete' style='cursor: pointer;'><i class=\"icon-trash\"></i> Delete</a></li>\n "), app.user.logNum == 9987278364 && __p.push("\n <li><a class='delete-perm' style='cursor: pointer;'><i class=\"icon-trash\"></i> Delete Perm</a></li>\n "), __p.push("\n </ul>\n </div>\n ")), __p.push("\n \n\n </td>\n </tr>\n ")), __p.push("\n ")
}), __p.push("\n </tbody>\n</table>\n"), tableId === "selected-shortcuts" ? __p.push("\n <p id='no-shortcuts-selected' style=\"margin-left: 80px; color: gray; font-family: 'Architects Daughter', cursive; font-size: 20px\">No shortcuts selected. Add shortcuts from below.</p>\n") : shortcuts.length === 0 && __p.push("\n <p style=\"margin-left: 120px; color: gray; font-family: 'Architects Daughter', cursive; font-size: 20px\">No more shortcuts. <a id='undo-filters'>Undo filters.</a></p>\n"), __p.push("\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/statsview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push("Shortcuts Pressed: 0\n");
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/thankyou"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) __p.push("<img src='https://d2r64hzyhllbrg.cloudfront.net/master.png' style='float:left; margin-left: 15px'></img>\n<h1 style=\"width: 100%; text-align: center; margin-bottom: 20px\">", header, '</h1> \n<p style="width: 70%; margin-left: 200px; text-align: center">', thankyou, '</p>\n<a id=\'registration-link\' style="width: 70%; margin-left: 100px; text-align: center" href="', registrationLink, '">', registrationLink, '</a>\n<p style="width: 70%; margin-left: 200px; text-align: center; margin-top:10px">', keepSecret, '</p>\n<p style="width: 70%; margin-left: 200px; text-align: center; margin-bottom: 20px">E-mail us at <a href="mailto:support@shortcutfoo.com">support@shortcutfoo.com</a> for any assistance!</p>\n<a id=\'go-home\' class=\'btn btn-large btn-success\' style="float: right; margin-right: 80px">Go to home</a>\n');
return __p.join("")
}
}.call(this),
function () {
this.JST || (this.JST = {}), this.JST["backbone/templates/upgradeview"] = function (obj) {
var __p = [],
print = function () {
__p.push.apply(__p, arguments)
};
with(obj || {}) {
__p.push('<div id="upgrade-top">\n <div class="span3 upgrade-top-section" style="background-image: url(\'https://d2r64hzyhllbrg.cloudfront.net/shortcut.png\');background-repeat:no-repeat; background-position:center; ">\n <p class=\'upgrade-top-header\'>Create ', shortcutCount, " custom shortcuts</p>\n </div>\n <div class=\"span3 upgrade-top-section\" style=\"background-image: url('https://d2r64hzyhllbrg.cloudfront.net/bundle.png');background-repeat:no-repeat; background-position:center; \">\n <p class='upgrade-top-header'>Create ", bundleCount, ' custom bundles</p>\n </div>\n <div class="span3 upgrade-top-section" style="background-image: url(\'https://d2r64hzyhllbrg.cloudfront.net/unlock.png\');background-repeat:no-repeat; background-position:center;">\n <p class=\'upgrade-top-header\' style="z-index: 1000">Unlock ', editorCount, " bundles and shortcuts</p>\n </div>\n</div>\n<h6 id='will-select-editors' style='float:right; margin-top:-15px; margin-right: 40px'>Note: You will select and unlock your ", editorText, ' after signing up</h6>\n<form class="form-horizontal" id="upgrade-form" style=\'margin-top: 30px\'>\n <input id="csrf" type="hidden" name="authenticity_token" value=\'\'>\n <fieldset style=\'margin-left: 20px\'>\n <div class="control-group">\n <div class=\'controls\'>\n '), app.user.email == "Guest" ? __p.push("\n <h2>One step away from signing up</h2>\n ") : __p.push("\n <h2>One step away from upgrading</h2>\n "), __p.push("\n <p style='color:gray; width: 435px'>Credit card will be charged a one time payment of <strong>", price, '</strong><span class=\'seat-count-description\'></span> upon submission. We do not store any credit card information.</p>\n </div>\n </div>\n <div>\n <legend>Payment method</legend>\n <div class="control-group" id="cards-control-group">\n <label class="control-label" for="cards-control-group"><input type="radio" name="paymentOptions" id="pay-with-card" value="option1" checked></label>\n <div class="controls">\n <label for=\'pay-with-card\'>\n <img class=\'card\' id=\'visa\' src=\'https://d2r64hzyhllbrg.cloudfront.net/visa32.png\'><img class=\'card\' id=\'mastercard\' src=\'https://d2r64hzyhllbrg.cloudfront.net/mastercard.png\'><img class=\'card\' id=\'american-express\' src=\'https://d2r64hzyhllbrg.cloudfront.net/americanexpress.png\'><img class=\'card\' id=\'discover\' src=\'https://d2r64hzyhllbrg.cloudfront.net/discover.png\'>\n </label>\n </div>\n </div> \n <div class="control-group" id="paypal-control-group" style=\'margin-top:-10px\'>\n <label class="control-label" for="company"><input type="radio" name="paymentOptions" id="pay-with-paypal" value="option2"></label>\n <div class="controls">\n <label for=\'pay-with-paypal\'>\n <img src="https://www.paypal.com/en_US/i/logo/PayPal_mark_50x34.gif" border="0" alt="PayPal Logo">\n </label>\n </div>\n </div> \n </div>\n <div id=\'checkout-with-paypal\' style=\'display:none\'>\n <a style=\'cursor: pointer\'>\n <img src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" align="left" style="margin-left:125px;">\n </a>\n </div>\n <div id="billing-info">\n ');
if (app.user.nextDrill != 9344 || plan === "enterprise") __p.push("\n <div>\n "), plan == "enterprise" ? __p.push("\n <legend>Contact info</legend>\n ") : __p.push("\n <legend>Login info</legend>\n "), __p.push('\n <div class="control-group" id="email-control-group">\n <label class="control-label" for="email">Email</label>\n <div class="controls">\n <div class=\'input-prepend\'>\n <span class=\'add-on\'>\n <i class=\'icon-envelope\'></i>\n </span>\n <input type="text" class="input-large" id="email">\n <p class="help-inline input-help" id="email-help"></p>\n </div>\n </div>\n </div>\n '), plan == "enterprise" && __p.push('\n <div class="control-group" id="company-control-group">\n <label class="control-label" for="company">Company</label>\n <div class="controls">\n <div class=\'input-prepend\'>\n <span class=\'add-on\'>\n <i class=\'icon-user\'></i>\n </span>\n <input type="text" class="input-large" id="company">\n <p class="help-inline input-help" id="company-help"></p>\n </div>\n </div>\n </div>\n '), __p.push("\n "), plan != "enterprise" && __p.push('\n <div class="control-group" id="password-control-group" style=\'margin-top:-10px\'>\n <label class="control-label" for="password">Password</label>\n <div class="controls">\n <div class=\'input-prepend\'>\n <span class=\'add-on\'>\n <i class=\'icon-lock\'></i>\n </span>\n <input type="password" class="input-large" id="password">\n <p class="help-inline input-help" id="password-help"></p>\n </div>\n </div>\n </div>\n \n <div class="control-group" id="password-confirmation-control-group" style=\'margin-bottom:30px; margin-top:-10px\'>\n <label class="control-label" for="password-confirmation">Password Confirmation</label>\n <div class="controls">\n <div class=\'input-prepend\'>\n <span class=\'add-on\'>\n <i class=\'icon-lock\'></i>\n </span>\n <input type="password" class="input-large" id="password-confirmation">\n <p class="help-inline input-help" id="password-confirmation-help"></p>\n </div>\n </div>\n </div>\n </div>\n '), __p.push("\n ");
__p.push('\n <div>\n <legend>Payment info</legend>\n <div class="control-group" id="cards-control-group">\n <label class="control-label" for="company">Total</label>\n <div class="controls">\n <p class=\'help-inline\' style="margin-top: 5px">', price, ' <span style=\'color:gray\'>one time payment<span class=\'seat-count-description\'></span></span></p>\n </div>\n </div>\n <div class="control-group" id="name-control-group">\n <label class="control-label" for="name">Name on Card</label>\n <div class="controls">\n <input type="text" class="input-xlarge" id="name">\n <p class="help-inline input-help" id="name-help"></p>\n </div>\n </div>\n <div class="control-group" id="cc-control-group">\n <label class="control-label" for="cc-number">Credit Card Number</label>\n <div class="controls">\n <input type="text" class="input-xlarge" id="cc-number">\n <p class="help-inline input-help" id="cc-help"></p>\n </div>\n </div>\n <div class="control-group" id="expiration-control-group">\n <label class="control-label" for="exp-date-month">Credit Card Expiration</label>\n <div class="controls">\n <select id="exp-date-month" class=\'span2\'>\n <option selected="selected" value="1">1 - January</option>\n <option value="2">2 - February</option>\n <option value="3">3 - March</option>\n <option value="4">4 - April</option>\n <option value="5">5 - May</option>\n <option value="6">6 - June</option>\n <option value="7">7 - July</option>\n <option value="8">8 - August</option>\n <option value="9">9 - September</option>\n <option value="10">10 - October</option>\n <option value="11">11 - November</option>\n <option value="12">12 - December</option>\n </select>\n <select id="exp-day-year" class=\'span1\'>\n <option selected="selected" value="2013">2013</option>\n <option value="2014">2014</option>\n <option value="2015">2015</option>\n <option value="2016">2016</option>\n <option value="2017">2017</option>\n <option value="2018">2018</option>\n <option value="2019">2019</option>\n <option value="2020">2020</option>\n <option value="2021">2021</option>\n <option value="2022">2022</option>\n <option value="2023">2023</option>\n <option value="2024">2024</option>\n <option value="2025">2025</option>\n <option value="2026">2026</option>\n <option value="2027">2027</option>\n <option value="2028">2028</option>\n <option value="2029">2029</option>\n <option value="2030">2030</option>\n <option value="2031">2031</option>\n <option value="2032">2032</option>\n <option value="2033">2033</option>\n <option value="2034">2034</option>\n <option value="2035">2035</option>\n <option value="2036">2036</option>\n <option value="2037">2037</option>\n </select>\n <p class="help-inline input-help" id="expiration-help"></p>\n </div>\n </div>\n <div class="control-group" id="cvc-control-group">\n <label class="control-label" for="cvc">Credit Card Code (CVC)</label>\n <div class="controls">\n <input type="text" class="span1" id="cvc">\n <p class="help-inline input-help" id="cvc-help"></p>\n </div>\n </div>\n <div class="control-group" id="zip-control-group">\n <label class="control-label" for="zip">Billing Zip Code</label>\n <div class="controls">\n <input type="text" class="span1" id="zip">\n </div>\n </div>\n <div class="control-group">\n <label class="control-label" for="input01"></label>\n <div class="controls">\n <button type="submit" class="submit-button">Submit Payment</button><img id="spinner" style=\'margin-left: 10px; margin-bottom: -5px\' src=\'https://d2r64hzyhllbrg.cloudfront.net/spinner.gif\'></img>\n </div>\n </div>\n </div>\n </div>\n </fieldset>\n</form>\n<form class="form-horizontal" id="promo-form">\n <fieldset id=\'promo-field-set\'>\n '), plan != "enterprise" && __p.push("\n <a id='received-promo-code' style='cursor: pointer'>I received a promo code</a>\n "), __p.push("\n </fieldset>\n</form>\n\n")
}
return __p.join("")
}
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.VIMGame = function (e) {
function t() {
var e = this;
return this.shortcutFailed = function (n) {
return t.prototype.shortcutFailed.apply(e, arguments)
}, this.shortcutSucceeded = function (n) {
return t.prototype.shortcutSucceeded.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.initialize = function () {
var e;
return this.isDemo = this.get("isDemo"), e = this.isDemo ? app.demokeys : app.keys, this.keyProcessor = new window.KeyProcessor({
shortcuts: this.get("shortcuts"),
masterKeys: e
}), app.dispatcher.on("shortcutSucceeded", this.shortcutSucceeded), app.dispatcher.on("shortcutFailed", this.shortcutFailed), this.currentStreak = 0, this.longestStreak = 0, this.shortcutsRight = 0, this.shortcutsWrong = 0, this.accuracy = 0, this.secondsLeft = 60, this.initialTime = 60, this.elapsedTime = 0, this.practiceMode = !1, this.scpm = 0
}, t.prototype.processKeyEvent = function (e, t, n) {
return this.keyProcessor.processKeyEvent(e, t, n)
}, t.prototype.shortcutSucceeded = function (e) {
return this.increaseStreak(), this.shortcutsRight += 1, this.calculateAccuracy(), this.calculateShortcutsPerMinute()
}, t.prototype.shortcutFailed = function (e) {
return this.currentStreak = 0, this.shortcutsWrong += 1, this.calculateAccuracy(), this.calculateShortcutsPerMinute()
}, t.prototype.start = function (e) {
var t = this;
return this.practiceMode = e, this.secondsLeft = this.initialTime, this.currentStreak = 0, this.longestStreak = 0, this.shortcutsRight = 0, this.shortcutsWrong = 0, this.scpm = 0, this.accuracy = 0, this.elapsedTime = 0, this.keyProcessor.reset(), app.dispatcher.trigger("gameStarted"), this.stopTimer(), this.timer = setInterval(function () {
return t.runTimer()
}, 1e3)
}, t.prototype.runTimer = function () {
if (this.secondsLeft <= 0) return this.endGame();
this.practiceMode || (this.secondsLeft -= 1), this.elapsedTime += 1, this.practiceMode || app.dispatcher.trigger("timeChanged", this.timeToString()), this.practiceMode && app.dispatcher.trigger("timeChanged", this.elapsedTimeToString());
if (this.elapsedTime % 5 === 0) return this.calculateShortcutsPerMinute()
}, t.prototype.increaseTime = function () {
return this.secondsLeft += 15, this.initialTime = this.secondsLeft, app.dispatcher.trigger("timeChanged", this.timeToString())
}, t.prototype.decreaseTime = function () {
if (this.secondsLeft <= 15) return;
return this.secondsLeft -= 15, this.initialTime = this.secondsLeft, app.dispatcher.trigger("timeChanged", this.timeToString())
}, t.prototype.resetTime = function () {
this.secondsLeft = this.initialTime, this.elapsedTime = 0, this.practiceMode || app.dispatcher.trigger("timeChanged", this.timeToString());
if (this.practiceMode) return app.dispatcher.trigger("timeChanged", this.elapsedTimeToString())
}, t.prototype.timeToString = function () {
var e, t, n;
return e = Math.floor(this.secondsLeft / 60), t = this.secondsLeft % 60, t < 10 && (t = "0" + t), n = e + ":" + t
}, t.prototype.elapsedTimeToString = function () {
var e, t, n;
return e = Math.floor(this.elapsedTime / 60), t = this.elapsedTime % 60, t < 10 && (t = "0" + t), n = e + ":" + t
}, t.prototype.endGame = function () {
return this.stopTimer(), this.calculateShortcutsPerMinute(), app.dispatcher.trigger("gameEnded")
}, t.prototype.stopTimer = function () {
if (this.timer) return clearInterval(this.timer)
}, t.prototype.previousShortcut = function () {
return this.keyProcessor.previousShortcut()
}, t.prototype.nextShortcut = function () {
return this.keyProcessor.nextShortcut()
}, t.prototype.currentShortcut = function () {
return this.keyProcessor.currentShortcut()
}, t.prototype.increaseStreak = function () {
this.currentStreak += 1;
if (this.currentStreak > this.longestStreak) return this.longestStreak = this.currentStreak, app.dispatcher.trigger("streakIncreased", this.longestStreak)
}, t.prototype.calculateAccuracy = function () {
return this.accuracy = Math.round(this.shortcutsRight / this.totalShortcutsTyped() * 100), app.dispatcher.trigger("accuracyChanged", this.accuracy + "%")
}, t.prototype.calculateShortcutsPerMinute = function () {
return this.scpm = Math.round(60 / this.elapsedTime * this.totalShortcutsTyped()), app.dispatcher.trigger("scpmChanged", this.scpm)
}, t.prototype.totalShortcutsTyped = function () {
return this.shortcutsRight + this.shortcutsWrong
}, t
}(Backbone.Model)
}.call(this),
function () {
var e = {}.hasOwnProperty,
t = function (t, n) {
function i() {
this.constructor = t
}
for (var r in n) e.call(n, r) && (t[r] = n[r]);
return i.prototype = n.prototype, t.prototype = new i, t.__super__ = n.prototype, t
};
window.Bundle = function (e) {
function n() {
return n.__super__.constructor.apply(this, arguments)
}
return t(n, e), n.prototype.defaults = {
shortcuts: null
}, n.prototype.lastDrillAt = null, n.prototype.initialize = function (e, t) {
this.get("parentId") || this.set("parentId", this.id);
if (this.get("lastDrillAt")) return this.set("lastDrillAt", new Date(this.get("lastDrillAt")))
}, n.prototype.exists = function () {
return this.id
}, n.prototype.accuracyToNum = function () {
var e, t, n = this;
return this.get("locked") ? -2 : (e = [], _.each(this.get("shortcuts"), function (t) {
var n, r;
r = app.keys[t];
if (r) {
n = r.accuracyToNum();
if (n !== -1) return e.push(n)
}
}), e.length === 0 ? -1 : (t = _.reduce(e, function (e, t) {
return e + t
}), Math.round(t / e.length)))
}, n.prototype.accuracy = function () {
var e, t, n = this;
return this.get("locked") ? "N/A" : (e = [], _.each(this.get("shortcuts"), function (t) {
var n, r;
r = app.keys[t];
if (r) {
n = r.accuracyToNum();
if (n !== -1) return e.push(n)
}
}), e.length === 0 ? "N/A" : (t = _.reduce(e, function (e, t) {
return e + t
}), Math.round(t / e.length) + "%"))
}, n.prototype.shortcuts = function () {
var e, t = this;
return e = [], _.each(this.get("shortcuts"), function (t) {
var n;
n = app.keys[t];
if (n && !n.get("removed")) return e.push(n)
}), e
}, n.prototype.shortcutIds = function () {
var e, t = this;
return e = [], _.each(this.get("shortcuts"), function (t) {
var n;
n = app.keys[t];
if (n && !n.get("removed")) return e.push(t)
}), e
}, n
}(Backbone.Model)
}.call(this),
function () {
var e = {}.hasOwnProperty,
t = function (t, n) {
function i() {
this.constructor = t
}
for (var r in n) e.call(n, r) && (t[r] = n[r]);
return i.prototype = n.prototype, t.prototype = new i, t.__super__ = n.prototype, t
};
window.BundleRepository = function (e) {
function n() {
return n.__super__.constructor.apply(this, arguments)
}
return t(n, e), n.prototype.saveOrUpdate = function (e) {
var t, n, r, i = this;
n = e.get("shortcuts");
if (app.user.nextDrill === 9344) return e.exists() ? (r = {
userId: e.get("userId"),
shortcuts: n,
name: e.get("name"),
editor: e.get("editor")
}, e.get("locked") && (r.locked = e.get("locked")), e.get("all") && (r.all = e.get("all")), $.post("/api/bundles/" + e.get("parentId") + ".json", r)) : (t = {
shortcuts: n,
name: e.get("name"),
editor: e.get("editor")
}, e.get("locked") && (t.locked = e.get("locked")), e.get("all") && (t.all = e.get("all")), $.post("/api/bundles.json", t, function (e) {
var t, n;
return e.errors ? (t = "", $(".alert").remove(), e.errors === "Bundle limit exceeded" ? t = JST["backbone/templates/error"]({
message: "<strong>Bundle limit reached.</strong> Please support us by upgrading! <a class='upgrade' style='cursor: pointer'>Upgrade now</a>"
}) : t = JST["backbone/templates/error"]({
message: e.errors
}), $("#notifications").prepend(t), $(".alert").fadeOut(0), $(".alert").fadeIn("fast"), $(".upgrade").click(function () {
app.navigate("app/plans", {
trigger: !0
})
})) : (n = e.bundle, app.user.bundleCount += 1, i.get("bundles").add(n), app.dispatcher.trigger("bundleUpdated", n))
}));
if (!e.exists()) return app.user.bundleCount += 1, e.set("parentId", app.user.bundleCount.toString()), e.set("id", app.user.bundleCount.toString()), e.set("locked", !1), this.get("bundles").add(e), app.dispatcher.trigger("bundleUpdated", e)
}, n.prototype.incDrillCount = function (e) {
var t;
if (app.user.nextDrill === 9344) return e.get("userId") != null ? $.post("/api/bundles/" + e.get("parentId") + ".json", {
userId: e.get("userId"),
last_drill_at: e.get("lastDrillAt").toString(),
inc_drill_count: !0,
editor: e.get("editor"),
type: "update"
}) : (t = e.get("shortcuts").map(function (e) {
return e
}), $.post("/api/bundles/" + e.get("parentId") + ".json", {
userId: e.get("userId"),
shortcuts: t,
name: e.get("name"),
last_drill_at: e.get("lastDrillAt").toString(),
inc_drill_count: !0,
editor: e.get("editor"),
type: "update"
}))
}, n.prototype.find = function (e) {
return this.get("bundles").find(function (t) {
return t.get("parentId") === parseInt(e)
})
}, n.prototype.getNeedsWorkBundle = function (e) {
var t, n;
return n = app.shortcutRepository.getNeedsWorkShortcuts(e), t = n.pluck("parentId"), new Bundle({
shortcuts: t
})
}, n.prototype.getBundleToTry = function (e) {
var t, n;
return n = app.shortcutRepository.getToTryShortcuts(e), t = n.pluck("parentId"), new Bundle({
shortcuts: t
})
}, n.prototype.getLastThreeBundlesDrilled = function () {
var e, t;
return e = this.get("bundles"), e.editorFilter = app.user.defaultEditor, e = e.applyFilters(), t = e.sortBy(function (e) {
var t;
return -((t = e.get("lastDrillAt")) != null ? t.getTime() : void 0)
}), t = _.reject(t, function (e) {
return e.get("lastDrillAt") == null || e.get("locked") === !0
}), t.length < 3 && _.each(e.models, function (e) {
if (!e.get("lastDrillAt")) return t.push(e)
}), t.slice(0, 3)
}, n
}(Backbone.Model)
}.call(this),
function () {
var e = {}.hasOwnProperty,
t = function (t, n) {
function i() {
this.constructor = t
}
for (var r in n) e.call(n, r) && (t[r] = n[r]);
return i.prototype = n.prototype, t.prototype = new i, t.__super__ = n.prototype, t
};
window.IntervalTrainer = function (e) {
function n() {
return n.__super__.constructor.apply(this, arguments)
}
return t(n, e), n.prototype.initTraining = function () {
return this.newShortcutIds = this.newShortcutsForToday(), this.dueShortcutIds = this.dueShortcutsForToday(), this.shortcuts = _.union(this.newShortcutIds, this.dueShortcutIds), this.keyProcessor = new window.KeyProcessor({
shortcuts: this.shortcuts,
useIntervals: !0
}), this.keyProcessor.shuffle()
}, n.prototype.resetNewShortcutList = function () {
return this.newShortcutIds = this.newShortcutsForToday(), this.shortcuts = _.union(this.newShortcutIds, this.dueShortcutIds), this.keyProcessor.setShortcuts(this.shortcuts), this.newShortcutIds.length
}, n.prototype.resetForEditor = function (e) {
return app.shortcutRepository.shortcuts.each(function (t) {
if (t.get("editor") === e) return t.resetIntervalStats()
})
}, n.prototype.newShortcutsForToday = function () {
var e, t, n, r, i, s = this;
return r = app.shortcutRepository.shortcuts.filter(function (e) {
return e.get("editor") === s.get("editor") && !e.get("locked") && e.get("firstStudied") && e.get("firstStudied").isSame(moment(), "day")
}), n = app.shortcutRepository.shortcuts.filter(function (e) {
return e.get("editor") === s.get("editor") && !e.get("locked") && !e.get("lastStudied")
}), t = _.shuffle(n), e = _.first(t, _.max([0, app.user.newIntervalsPerDay - r.length])), r = _.without(e, function (e) {
return !e.isReadyForInterval()
}), i = _.union(r, e), _.map(i, function (e) {
return e.get("parentId")
})
}, n.prototype.dueShortcutsForToday = function () {
var e, t, n = this;
return t = app.shortcutRepository.shortcuts.filter(function (e) {
return e.get("editor") === n.get("editor") && e.dueForTraining()
}), e = _.shuffle(t), _.map(e, function (e) {
return e.get("parentId")
})
}, n.prototype.start = function () {
return this.keyProcessor.hasShortcutsRemaining() ? (this.keyProcessor.reset(), app.dispatcher.trigger("intervalShortcutsLoaded")) : app.dispatcher.trigger("noShortcutsRemaining")
}, n.prototype.processKeyEvent = function (e, t, n) {
return this.keyProcessor.processKeyEvent(e, t, n)
}, n.prototype.endGame = function () {
return app.dispatcher.trigger("gameEnded")
}, n.prototype.previousShortcut = function () {
return this.keyProcessor.previousShortcut()
}, n.prototype.nextShortcut = function () {
return this.keyProcessor.nextShortcut()
}, n.prototype.currentShortcut = function () {
return this.keyProcessor.currentShortcut()
}, n.prototype.moveToNextShortcut = function () {
return this.keyProcessor.moveToNextShortcut()
}, n.prototype.doneForToday = function () {
return !this.keyProcessor.hasShortcutsRemaining()
}, n.prototype.hasTrainedBefore = function () {
var e, t = this;
return e = app.shortcutRepository.shortcuts.find(function (e) {
return e.get("editor") === t.get("editor") && e.get("lastStudied")
}), e != null
}, n.prototype.newShortcutsCount = function () {
return this.newShortcutIds.length
}, n.prototype.dueShortcutsCount = function () {
return this.dueShortcutIds.length
}, n.prototype.totalShortcutsCount = function () {
return this.shortcuts.length
}, n.prototype.trainedTodayCount = function () {
var e, t = this;
return e = app.shortcutRepository.shortcuts.filter(function (e) {
return e.get("editor") === t.get("editor") && !e.get("locked") && e.get("firstStudied") && e.get("firstStudied").isSame(moment(), "day")
}), e.length
}, n.prototype.dueTomorrowCount = function () {
var e, t, n = this;
return t = moment().add("day", 1), e = app.shortcutRepository.shortcuts.filter(function (e) {
return e.get("editor") === n.get("editor") && !e.get("locked") && e.get("nextRepetition") && e.get("nextRepetition").isSame(t, "day")
}), e.length
}, n.prototype.daysLastCount = function () {
var e, t, n, r = this;
return n = app.shortcutRepository.shortcuts.filter(function (e) {
return e.get("editor") === r.get("editor")
}), e = _.map(n, function (e) {
return e.get("lastStudied")
}), t = _.max(e), t != null ? moment(moment()).diff(t, "days") : 0
}, n
}(Backbone.Model)
}.call(this),
function () {
var e = {}.hasOwnProperty,
t = function (t, n) {
function i() {
this.constructor = t
}
for (var r in n) e.call(n, r) && (t[r] = n[r]);
return i.prototype = n.prototype, t.prototype = new i, t.__super__ = n.prototype, t
};
window.KeyProcessor = function (e) {
function n() {
return n.__super__.constructor.apply(this, arguments)
}
return t(n, e), n.prototype.initialize = function () {
return this.shortcutIterator = new window.ShortcutIterator({
shortcuts: this.get("shortcuts"),
masterKeys: this.get("masterKeys"),
useIntervals: this.get("useIntervals")
}), this.keyPressFailedThrottled = _.debounce(this.keyPressFailed, 200), this.keyPressSucceededThrottled = _.throttle(this.keyPressSucceeded, 200)
}, n.prototype.reset = function () {
this.shortcutIterator.shuffle();
if (this.currentShortcut()) return this.currentShortcut().resetKeys()
}, n.prototype.setShortcuts = function (e) {
return this.set("shortcuts", e), this.shortcutIterator.set("shortcuts", e)
}, n.prototype.shuffle = function () {
return this.shortcutIterator.shuffle()
}, n.prototype.previousShortcut = function () {
return this.shortcutIterator.peepPrevious()
}, n.prototype.nextShortcut = function () {
return this.shortcutIterator.peepNext()
}, n.prototype.currentShortcut = function () {
return this.shortcutIterator.current()
}, n.prototype.processKeyEvent = function (e, t, n) {
n.type === "keydown" && this.processKeyDown(e, t, n);
if (n.type === "keypress") return this.processKeyPress(e, t, n)
}, n.prototype.processKeyDown = function (e, t, n) {
return this.processKey(e, t, n)
}, n.prototype.processKeyPress = function (e, t, n) {
if (this.isAcceptingKeyDown) return this.processKey(e, t, n)
}, n.prototype.processKey = function (e, t, n) {
return this.typedKeyMatchesCurrentKey(e, t, n) ? (this.isAcceptingKeyDown = !1, this.keyPressSucceeded(), n.preventDefault && n.preventDefault(), n.stopPropagation && n.stopPropagation(), n.returnValue = !1, n.cancelBubble = !0) : (this.isAcceptingKeyDown = !0, this.keyPressFailedThrottled())
}, n.prototype.keyPressSucceeded = function () {
var e;
return e = this.currentShortcut(), app.dispatcher.trigger("keypressSucceeded", e.currentKeyToString(), e), this.moveShortcutToNextKey(e)
}, n.prototype.keyPressFailed = function () {
var e;
if (!this.isAcceptingKeyDown) return;
return e = this.currentShortcut(), app.dispatcher.trigger("keypressFailed", e.currentKeyToString(), e), this.get("useIntervals") || this.moveToNextShortcut(), app.dispatcher.trigger("shortcutFailed", e), this.currentShortcut().resetKeys(), this.currentShortcut().resetHasFailed(), this.isAcceptingKeyDown = !1
}, n.prototype.moveShortcutToNextKey = function (e) {
var t;
t = e.nextKey();
if (!t) return this.get("useIntervals") || this.moveToNextShortcut(), app.dispatcher.trigger("shortcutSucceeded", e), this.currentShortcut().resetKeys(), this.currentShortcut().resetHasFailed()
}, n.prototype.moveToNextShortcut = function () {
this.shortcutIterator.next() || this.shortcutIterator.shuffle();
if (!this.hasShortcutsRemaining()) return app.dispatcher.trigger("noShortcutsRemaining")
}, n.prototype.hasShortcutsRemaining = function () {
return this.shortcutIterator.get("shortcuts").length > 0
}, n.prototype.typedKeyMatchesCurrentKey = function (e, t, n) {
var r, i, s, o, u, a, f, l, c, h;
a = n.type === "keypress" ? !0 : !1, u = this.currentShortcut().get("editor"), o = this.currentShortcut().currentKey();
if (!o) return !0;
l = o.key, c = o.keyPressKey, h = _.find(t, function (e) {
return e === "shift"
}) ? !0 : !1, r = _.find(t, function (e) {
return e === "alt"
}) ? !0 : !1, i = _.find(t, function (e) {
return e === "meta"
}) ? !0 : !1, s = _.find(t, function (e) {
return e === "ctrl"
}) ? !0 : !1, c = this.getKeyPressKey(o);
if (u && u.toLowerCase() === "emacs") {
f = r || i;
if (l.toLowerCase() === e && h === o.shift && (f === o.alt || f === o.cmd) && s === o.ctrl) return !0;
if ((c === e || a && l === e) && i === o.cmd && s === o.ctrl) return !0
} else {
if (l.toLowerCase() === e && h === o.shift && r === o.alt && i === o.cmd && s === o.ctrl) return !0;
if ((c === e || a && l === e) && i === o.cmd && s === o.ctrl) return !0
}
}, n.prototype.getKeyPressKey = function (e) {
var t;
return e.keyPressKey != null ? e.keyPressKey : (t = e.key, e.shift ? t === "1" ? "!" : t === "2" ? "@" : t === "3" ? "#" : t === "4" ? "$" : t === "5" ? "%" : t === "6" ? "^" : t === "7" ? "&" : t === "8" ? "*" : t === "9" ? "(" : t === "0" ? ")" : t === "-" ? "_" : t === "=" ? "+" : t === "," ? "<" : t === "." ? ">" : t === "/" ? "?" : t === "\\" ? "|" : t === ";" ? ":" : t === "'" ? '"' : t === "[" ? "{" : t === "]" ? "}" : t === "`" ? "~" : t : t)
}, n
}(Backbone.Model)
}.call(this),
function () {
var e = {}.hasOwnProperty,
t = function (t, n) {
function i() {
this.constructor = t
}
for (var r in n) e.call(n, r) && (t[r] = n[r]);
return i.prototype = n.prototype, t.prototype = new i, t.__super__ = n.prototype, t
};
window.Shortcut = function (e) {
function n() {
return n.__super__.constructor.apply(this, arguments)
}
return t(n, e), n.prototype.defaults = {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: null,
sequence: [],
easinessFactor: 2.5,
numberRepetitions: 0,
qualityOfLastRecall: null,
repetitionInterval: null,
nextRepetition: null,
lastStudied: null,
timesReviewed: 0
}, n.prototype.toJSON = function (e) {
var t;
return t = _.clone(this.attributes), t.lastStudied = this.get("lastStudied") ? this.get("lastStudied").format() : void 0, t.firstStudied = this.get("firstStudied") ? this.get("firstStudied").format() : void 0, t.nextRepetition = this.get("nextRepetition") ? this.get("nextRepetition").format() : void 0, t
}, n.stopEventForCharacters = {
down: !0,
up: !0,
left: !0,
right: !0,
home: !0,
end: !0,
pagedown: !0,
pageup: !0,
esc: !0,
tab: !0,
f1: !0,
f2: !0,
f3: !0,
f4: !0,
f5: !0,
f6: !0,
f7: !0,
f8: !0,
f9: !0,
f10: !0,
f11: !0,
f12: !0,
f13: !0,
f14: !0,
f15: !0,
f16: !0,
f17: !0,
f18: !0,
f19: !0,
del: !0,
space: !0,
backspace: !0
}, n.prototype.initialize = function (e, t) {
this.resetKeys(), this.get("parentId") || this.set("parentId", this.get("id")), this.get("nextRepetition") && !moment.isMoment(this.get("nextRepetition")) && this.set("nextRepetition", moment(this.get("nextRepetition") * 1e3)), this.get("lastStudied") && !moment.isMoment(this.get("lastStudied")) && this.set("lastStudied", moment(this.get("lastStudied") * 1e3));
if (this.get("firstStudied") && !moment.isMoment(this.get("firstStudied"))) return this.set("firstStudied", moment(this.get("firstStudied") * 1e3))
}, n.prototype.resetIntervalStats = function () {
return this.set("nextRepetition", null), this.set("lastStudied", null), this.set("firstStudied", null), this.set("easinessFactor", 2.5), this.set("numberRepetitions", 0), this.set("qualityOfLastRecall", null), this.set("repetitionInterval", null), this.set("timesReviewed", 0)
}, n.prototype.isReadyForInterval = function () {
return !this.get("nextRepetition") || this.get("nextRepetition").isBefore(moment(), "day") || this.get("nextRepetition").isSame(moment(), "day")
}, n.prototype.dueForTraining = function () {
return this.get("nextRepetition") && (this.get("nextRepetition").isBefore(moment(), "day") || this.get("nextRepetition").isSame(moment(), "day")) || this.get("firstStudied") && !this.get("nextRepetition")
}, n.prototype.proccessRecall = function (e) {
var t;
this.set("timesReviewed", this.get("timesReviewed") + 1), this.set("lastStudied", moment()), this.get("firstStudied") || this.set("firstStudied", moment());
if (this.get("timesReviewed") < 3) {
app.shortcutRepository.saveOrUpdate(this, !0);
return
}
return this.set("qualityOfLastRecall", e), e < 3 ? (this.set("numberRepetitions", 0), this.set("repetitionInterval", 0)) : (this.set("easinessFactor", this.calculateEasinessFactor(this.get("easinessFactor"), e)), e === 3 ? this.set("repetitionInterval", 0) : (this.set("numberRepetitions", this.get("numberRepetitions") + 1), this.get("numberRepetitions") === 1 ? this.set("repetitionInterval", 1) : this.get("numberRepetitions") === 2 ? this.set("repetitionInterval", 6) : this.set("repetitionInterval", this.get("repetitionInterval") * this.get("easinessFactor")))), t = moment(), t.add("days", this.get("repetitionInterval")), this.set("nextRepetition", t), app.shortcutRepository.saveOrUpdate(this, !0)
}, n.prototype.calculateEasinessFactor = function (e, t) {
var n, r, i;
return r = t, n = e, i = n - .8 + .28 * r - .02 * r * r, i < 1.3 ? 1.3 : i
}, n.prototype.addKey = function (e) {
return this.get("sequence").push(e), this.currentKeyIndex += 1
}, n.prototype.clearKeys = function (e) {
return this.set("sequence", []), this.currentKeyIndex = 0
}, n.prototype.prevKey = function () {
return this.get("sequence")[this.currentKeyIndex - 1]
}, n.prototype.currentKey = function () {
return this.get("sequence")[this.currentKeyIndex]
}, n.prototype.nextKey = function () {
return this.currentKeyIndex >= this.get("sequence").length ? null : (this.currentKeyIndex++, this.currentKey())
}, n.prototype.resetKeys = function () {
return this.currentKeyIndex = 0
}, n.prototype.incrementCorrect = function () {
return this.set("numCorrect", this.get("numCorrect") + 1)
}, n.prototype.incrementIncorrect = function () {
return this.set("numIncorrect", this.get("numIncorrect") + 1), this.set("hasFailed", !0)
}, n.prototype.hasFailed = function () {
return this.get("hasFailed")
}, n.prototype.resetHasFailed = function () {
return this.set("hasFailed", !1)
}, n.prototype.bundleNames = function () {
var e, t, n = this;
return e = [], t = app.keys[this.get("parentId")], app.bundleRepository.get("bundles").each(function (n) {
if (_.include(n.shortcuts(), t)) return e.push(n.get("name"))
}), e
}, n.prototype.accuracy = function () {
var e, t;
return t = this.get("numCorrect") + this.get("numIncorrect"), t > 0 ? e = Math.round(this.get("numCorrect") / t * 100) + "%" : e = "--", e
}, n.prototype.accuracyToNum = function () {
var e, t;
return t = this.get("numCorrect") + this.get("numIncorrect"), t > 0 ? e = Math.round(this.get("numCorrect") / t * 100) : e = -1, e
}, n.prototype.exists = function () {
return this.get("id")
}, n.prototype.toStatJSON = function () {
return {
u: this.get("userId"),
c: this.get("numCorrect"),
i: this.get("numIncorrect"),
p: this.get("parentId")
}
}, n.prototype.toString = function () {
var e, t = this;
return this.get("locked") ? "<i class='icon-lock' style='opacity: .4'></i>" : (e = "", _.each(this.get("sequence"), function (r) {
return e += n.keyToString(r, t.get("editor"))
}), e)
}, n.prototype.sortString = function (e) {
return this.get("locked") && e ? "⌥⌘ZZZ" : this.get("locked") && !e ? "AAA" : this.toString()
}, n.prototype.currentKeyToString = function () {
var e;
return e = this.currentKey(), e ? n.keyToString(e, this.get("editor")) : " "
}, n.prototype.prevKeyToString = function () {
var e;
return e = this.prevKey(), e ? n.keyToString(e, this.get("editor")) : " "
}, n.prototype.remainingKeys = function () {
var e, t, r = this;
return e = "", t = this.get("sequence").slice(this.currentKeyIndex + 1, this.get("sequence").length), _.each(t, function (t) {
if (t != null) return e += n.keyToString(t, r.get("editor"))
}), e
}, n.prototype.previousKeys = function () {
var e, t, r = this;
return e = "", t = this.get("sequence").slice(0, this.currentKeyIndex), _.each(t, function (t) {
if (t != null) return e += n.keyToString(t, r.get("editor"))
}), e
}, n.stopEventIfMatchesKeys = function (e, t, n) {
if (this.stopEventForCharacters[e] || this.isDestructiveKey(e, t, n)) return n.preventDefault && n.preventDefault(), n.stopPropagation && n.stopPropagation(), n.returnValue = !1, n.cancelBubble = !0
}, n.isDestructiveKey = function (e, t, n) {
var r, i, s, o;
return o = _.find(t, function (e) {
return e === "shift"
}) ? !0 : !1, r = _.find(t, function (e) {
return e === "alt"
}) ? !0 : !1, i = _.find(t, function (e) {
return e === "meta"
}) ? !0 : !1, s = _.find(t, function (e) {
return e === "ctrl"
}) ? !0 : !1, e === "r" && (i || s) || e === "d" && (i || s) || e === "o" && (i || s) || e === "i" && i && r || e === "m" && (i || s) || e === "t" && (i || s) || e === "w" && (i || s) || e === "s" && i || e === "f" && i || e === "l" && i || e === "g" && i || e === "y" && i || e === "h" && i && r || e === "[" && i || e === "]" && i
}, n.keyToString = function (e, t) {
var n, r, i, s, o, u, a;
return s = this.getKeyString(e, t), u = this.getShiftKeyChar(t), n = this.getAltKeyChar(t), i = this.getCtrlKeyChar(t), r = this.getCmdKeyChar(t), a = this.shouldAppendShiftModifierKey(t, s), o = "", e.shift && a && (o += u), e.ctrl && (o += i), e.alt && (o += n), e.cmd && (o += r), o + s
}, n.getKeyString = function (e, t) {
var n;
return n = e.key.toUpperCase(), n === "SPACE" ? this.getSpaceKey(t) : n === "ENTER" ? this.getReturnKey() : this.getChar(e, t)
}, n.getChar = function (e, t) {
var n;
return n = this.getKeyPressKey(e, t), this.shouldAppendShiftModifierKey(t) ? n.toUpperCase() : e.shift ? n.toUpperCase() : n
}, n.getKeyPressKey = function (e, t) {
var n;
return e.keyPressKey != null && e.keyPressKey !== "null" ? e.keyPressKey : (n = e.key.toLowerCase(), !e.shift || this.shouldAppendShiftModifierKey(t) ? n : n === "1" ? "!" : n === "2" ? "@" : n === "3" ? "#" : n === "4" ? "$" : n === "5" ? "%" : n === "6" ? "^" : n === "7" ? "&" : n === "8" ? "*" : n === "9" ? "(" : n === "0" ? ")" : n === "-" ? "_" : n === "=" ? "+" : n === "," ? "<" : n === "." ? ">" : n === "/" ? "?" : n === "\\" ? "|" : n === ";" ? ":" : n === "'" ? '"' : n === "[" ? "{" : n === "]" ? "}" : n === "`" ? "~" : n)
}, n.getSpaceKey = function (e) {
return e !== "Command Line" && e !== "Vim" && e !== "Emacs" && e !== "Git" ? "[SPACE]" : "&nbsp;"
}, n.getReturnKey = function (e) {
return "↵"
}, n.getShiftKeyChar = function (e) {
return this.isWindows7orLess() ? "shift+" : "⇧"
}, n.getAltKeyChar = function (e) {
return this.isWindows7orLess() ? "alt+" : e === "Emacs" ? "M-" : "⌥"
}, n.getCtrlKeyChar = function (e) {
return this.isWindows7orLess() ? "ctrl+" : e === "Emacs" ? "C-" : "⌃"
}, n.getCmdKeyChar = function (e) {
return this.isWindows7orLess() ? "cmd+" : e === "Emacs" ? "M-" : "⌘"
}, n.shouldAppendShiftModifierKey = function (e, t) {
return e !== "Vim" && e !== "Emacs" && e !== "Gmail" && e !== "Git" && e !== "Command Line" && t !== "!" && t !== "@" && t !== "#" && t !== "$" && t !== "%" && t !== "^" && t !== "&" && t !== "*" && t !== "(" && t !== ")"
}, n.getCharString = function (e) {
var t;
t = "";
if (e.keyPressKey) return t = key.keyPressKey;
t = key.key;
if (!e.shift && !e.shiftKey && (editor === "Vim" || editor === "Emacs" || editor === "Command Line" || editor === "Gmail" || editor === "Git")) return t.toLowerCase()
}, n.shiftChar = function (e, t, n, r) {
if (n !== "WebStorm") {
if (e === "1" && (t.shift || t.shiftKey)) return "!";
if (e === "2" && (t.shift || t.shiftKey)) return "@";
if (e === "3" && (t.shift || t.shiftKey)) return "#";
if (e === "4" && (t.shift || t.shiftKey)) return "$";
if (e === "5" && (t.shift || t.shiftKey)) return "%";
if (e === "6" && (t.shift || t.shiftKey)) return "^";
if (e === "7" && (t.shift || t.shiftKey)) return "&";
if (e === "8" && (t.shift || t.shiftKey)) return "*";
if (e === "9" && (t.shift || t.shiftKey)) return "(";
if (e === "0" && (t.shift || t.shiftKey)) return ")"
}
return e === "-" && (t.shift || t.shiftKey) ? "_" : e === "=" && (t.shift || t.shiftKey) ? "+" : e === "," && (t.shift || t.shiftKey) ? "<" : e === "." && (t.shift || t.shiftKey) ? ">" : e === "/" && (t.shift || t.shiftKey) ? "?" : e === "\\" && (t.shift || t.shiftKey) ? "|" : e === ";" && (t.shift || t.shiftKey) ? ":" : e === "'" && (t.shift || t.shiftKey) ? '"' : e === "[" && (t.shift || t.shiftKey) ? "{" : e === "]" && (t.shift || t.shiftKey) ? "}" : e === "`" && (t.shift || t.shiftKey) ? "~" : e === "SPACE" && n !== "Command Line" && n !== "Vim" && n !== "Emacs" && n !== "Git" ? t.shift || t.shiftKey ? r + "[SPACE]" : "[SPACE]" : e === "SPACE" ? "&nbsp;" : e === "ENTER" && (t.shift || t.shiftKey) ? r + "↵" : e === "ENTER" ? "↵" : e
}, n.isWindows7orLess = function () {
var e;
return e = navigator.userAgent, $.browser.msie || e.indexOf("Windows NT 7.0") !== -1 || e.indexOf("Windows NT 6.1") !== -1 || e.indexOf("Windows NT 5.1") !== -1 || e.indexOf("Windows XP") !== -1
}, n
}(Backbone.Model)
}.call(this),
function () {
var e = {}.hasOwnProperty,
t = function (t, n) {
function i() {
this.constructor = t
}
for (var r in n) e.call(n, r) && (t[r] = n[r]);
return i.prototype = n.prototype, t.prototype = new i, t.__super__ = n.prototype, t
};
window.ShortcutIterator = function (e) {
function n() {
return n.__super__.constructor.apply(this, arguments)
}
return t(n, e), n.prototype.initialize = function () {
return this.masterKeys = this.get("masterKeys") || app.keys, this.reset()
}, n.prototype.current = function () {
var e;
return e = this.get("shortcuts")[this.index], this.keys[e]
}, n.prototype.peepPrevious = function () {
var e, t;
return this.index === 0 ? t = this.get("shortcuts").length - 1 : t = this.index - 1, e = this.get("shortcuts")[t], this.keys[e]
}, n.prototype.peepNext = function () {
var e, t;
return this.index === this.get("shortcuts").length - 1 ? t = 0 : t = this.index + 1, e = this.get("shortcuts")[t], this.keys[e]
}, n.prototype.prev = function () {
return this.index <= 0 ? null : (this.index--, this.current())
}, n.prototype.next = function () {
return this.index >= this.get("shortcuts").length ? null : (this.index++, this.current())
}, n.prototype.reset = function () {
return this.index = 0, this.keys = this.masterKeys
}, n.prototype.shuffle = function () {
var e, t = this;
return this.get("useIntervals") ? (e = [], _.each(this.get("shortcuts"), function (n) {
var r;
r = t.masterKeys[n];
if (r.isReadyForInterval()) return e.push(n)
}), this.set("shortcuts", _.shuffle(e))) : window.noshuf || this.set("shortcuts", _.shuffle(this.get("shortcuts"))), this.reset()
}, n
}(Backbone.Model)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.ShortcutBucket = function (e) {
function t() {
var e = this;
return this.incShortcutsFailed = function (n) {
return t.prototype.incShortcutsFailed.apply(e, arguments)
}, this.incShortcutSuccess = function (n) {
return t.prototype.incShortcutSuccess.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.defaults = {
shortcuts: null
}, t.prototype.initialize = function () {
return this.listen(), this.get("shortcuts") || this.set("shortcuts", new window.Shortcuts), this.updatServerThrottled = _.throttle(this.updateServer, 3e3)
}, t.prototype.listen = function () {
return app.dispatcher.on("shortcutSucceeded", this.incShortcutSuccess), app.dispatcher.on("shortcutFailed", this.incShortcutsFailed)
}, t.prototype.incShortcutSuccess = function (e) {
var t;
return t = this.findOrAdd(e), t.incrementCorrect(), this.updatServerThrottled()
}, t.prototype.incShortcutsFailed = function (e) {
var t;
return t = this.findOrAdd(e), t.incrementIncorrect(), this.updatServerThrottled()
}, t.prototype.updateServer = function () {
var e, t = this;
return app.user.nextDrill === 9344 ? $.ajax({
url: "/api/stats.json",
type: "POST",
data: JSON.stringify(this.get("shortcuts").map(function (e) {
return e.toStatJSON()
})),
mimeType: "application/json",
contentType: "application/json",
success: function (e) {
var n;
return n = t.get("shortcuts"), n.reset()
}
}) : (e = this.get("shortcuts"), e.reset())
}, t.prototype.findOrAdd = function (e) {
var t, n;
return n = this.get("shortcuts"), t = n.find(function (t) {
return t.get("parentId") === e.get("parentId")
}), t ? t : (n.add(e), e)
}, t
}(Backbone.Model)
}.call(this),
function () {
var e = {}.hasOwnProperty,
t = function (t, n) {
function i() {
this.constructor = t
}
for (var r in n) e.call(n, r) && (t[r] = n[r]);
return i.prototype = n.prototype, t.prototype = new i, t.__super__ = n.prototype, t
};
window.ShortcutRepository = function (e) {
function n() {
return n.__super__.constructor.apply(this, arguments)
}
return t(n, e), n.prototype.initialize = function () {
return this.refresh(), this.needsWorkShortcuts = null, this.toTryShortcuts = null
}, n.prototype.refresh = function () {
return this.shortcuts = new window.Shortcuts(_.select(app.keys, function (e) {
return e
}))
}, n.prototype.shortcutsNotInBundle = function (e) {
return _.difference(this.shortcuts.models, e.shortcuts())
}, n.prototype.getNeedsWorkShortcuts = function (e) {
var t;
return this.needsWorkShortcuts && this.needsWorkShortcuts.length >= 5 ? this.needsWorkShortcuts : (t = [], _.each(app.keys, function (e, n) {
var r;
r = e.accuracyToNum();
if (r !== -1 && r < 70 && e.get("editor") === app.user.defaultEditor && !e.get("removed")) return t.push(e)
}), t = _.shuffle(t), this.needsWorkShortcuts = new Shortcuts(t.slice(0, +(e - 1) + 1 || 9e9)))
}, n.prototype.shuffleNeedsWork = function () {
return this.needsWorkShortcuts = null, this.getNeedsWorkShortcuts(5)
}, n.prototype.getToTryShortcuts = function (e) {
var t;
return this.toTryShortcuts && this.toTryShortcuts.length >= 5 ? this.toTryShortcuts : (t = [], _.each(app.keys, function (e, n) {
if (e.accuracyToNum() === -1 && !e.get("locked") && e.get("editor") === app.user.defaultEditor && !e.get("removed")) return t.push(e)
}), t = _.shuffle(t), this.toTryShortcuts = new Shortcuts(t.slice(0, +(e - 1) + 1 || 9e9)))
}, n.prototype.shuffleToTry = function () {
return this.toTryShortcuts = null, this.getToTryShortcuts(5)
}, n.prototype.saveOrUpdate = function (e, t) {
var n, r = this;
t == null && (t = !1), n = t ? "?isInterval=true" : "";
if (app.user.nextDrill === 9344) return e.exists() ? $.post("/api/shortcuts/" + e.get("parentId") + ".json" + n, e.toJSON(), function (e) {
var n;
if (e != null ? e.errors : void 0) return n = "", $(".alert").remove(), e.errors === "Shortcut editing limit exceeded" ? n = JST["backbone/templates/error"]({
message: "<strong>Shortcut editing limit reached.</strong> Please support us by upgrading! <a class='upgrade' style='cursor: pointer'>Upgrade now</a>"
}) : n = JST["backbone/templates/error"]({
message: e.errors
}), $("#notifications").prepend(n), $(".alert").fadeOut(0), $(".alert").fadeIn("fast"), $(".upgrade").click(function () {
app.navigate("app/plans", {
trigger: !0
})
});
if (!t) return app.user.shortcutEdits += 1
}) : $.post("/api/shortcuts.json", e.toJSON(), function (e) {
var t, n;
return e.errors ? (n = "", $(".alert").remove(), e.errors === "Shortcut limit exceeded" ? n = JST["backbone/templates/error"]({
message: "<strong>Shortcut limit reached.</strong> Please support us by upgrading! <a class='upgrade' style='cursor: pointer'>Upgrade now</a>"
}) : n = JST["backbone/templates/error"]({
message: e.errors
}), $("#notifications").prepend(n), $(".alert").fadeOut(0), $(".alert").fadeIn("fast"), $(".upgrade").click(function () {
app.navigate("app/plans", {
trigger: !0
})
})) : (app.user.shortcutCount += 1, t = new window.Shortcut(e.shortcut), app.keys[t.get("parentId")] = t, r.shortcuts.add(t), app.dispatcher.trigger("shortcutUpdated", t))
});
if (!e.exists()) return app.user.shortcutCount += 1, e.set("parentId", app.user.shortcutCount.toString()), e.set("id", app.user.shortcutCount.toString()), app.keys[e.get("parentId")] = e, this.shortcuts.add(e), app.dispatcher.trigger("shortcutUpdated", e);
if (!t) return app.user.shortcutEdits += 1
}, n
}(Backbone.Model)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.ShortcutFoo = function (e) {
function t() {
var e = this;
return this.loadEditor = function (n) {
return t.prototype.loadEditor.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.routes = {
"": "home",
app: "home",
"app/intervals": "intervals",
"app/drills": "drills",
"app/drills/needs-work": "drillNeedsWork",
"app/drills/to-try": "drillToTry",
"app/drills/:id": "drill",
"app/drills/:id/:quick": "drill",
"app/practice": "practices",
"app/practice/needs-work": "practiceNeedsWork",
"app/practice/to-try": "practiceToTry",
"app/practice/:id": "practice",
"app/bundles": "bundles",
"app/bundles/new/needs-work": "newBundleNeedsWork",
"app/bundles/new/to-try": "newBundleToTry",
"app/bundles/new": "newBundle",
"app/bundles/:id": "editBundle",
"app/shortcuts": "shortcuts",
"app/shortcuts/new": "newShortcut",
"app/shortcuts/:id": "editShortcut",
"app/upgrade/:plan/:payerid/:token/:seats": "upgradeFromPaypal",
"app/upgrade/:plan/:payerid/:token/": "upgradeFromPaypal",
"app/upgrade": "upgrade",
"app/upgrade/enterprise/:seats": "upgradeEnterprise",
"app/upgrade/:plan": "upgrade",
"app/plans/enterprise": "enterprise",
"app/plans": "plans",
"app/thankyou/:token": "thankyou",
"app/thankyou": "thankyou",
"app/welcome": "welcome",
"app/tutorial/:editorName": "tutorial"
}, t.prototype.initialize = function () {
var e, t, n = this;
return this.user = window.user, this.user.email === "Guest" ? _gaq && _gaq.push(["_setCustomVar", 1, "Log", 10000001, 1]) : (_gaq && _gaq.push(["_setCustomVar", 1, "Log", this.user.logNum, 1]), mixpanel.identify(this.user.email), mixpanel.name_tag("" + this.user.email), mixpanel.people.set_once({
$created: new Date(this.user.createdAt)
}), mixpanel.people.set({
level: this.user.logNum,
defaultEditor: this.user.defaultEditor,
$email: this.user.email,
$name: this.user.email
})), Stripe && Stripe.setPublishableKey(window.stripeKey), olark && olark("api.chat.updateVisitorNickname", {
snippet: "" + this.user.email
}), this.bind("route", this.trackPageview), this.dispatcher = _.clone(Backbone.Events), this.keys = {}, this.bundles = new window.Bundles(window.bundles), this.editors = {}, t = Mousetrap.handleKey, e = function (e, n, r) {
return t(e, n, r), app.dispatcher.trigger("keyPressed", e, n, r)
}, Mousetrap.handleKey = e, this.previousURLs = [], _.each(window.defaultKeys, function (e) {
var t;
return t = new window.Shortcut(e), n.keys[t.get("parentId")] = t
})
}, t.prototype.resetAllEditors = function () {
return window.defualtKeys = [], window.bundles = [], this.bundles.reset(), this.editors = {}
}, t.prototype.loadEditor = function (e) {
var t = this;
return this.editors[e] ? this.dispatcher.trigger("editorChanged", e) : $.ajax({
url: "/api/editors.json",
data: {
name: e
},
cache: !1
}).done(function (n) {
return _.each(n.shortcuts, function (e) {
var n;
return window.defaultKeys.push(e), n = new window.Shortcut(e), t.keys[n.get("parentId")] = n
}), _.each(n.bundles, function (e) {
return window.bundles.push(e), t.bundles.add(new window.Bundle(e))
}), t.shortcutRepository.refresh(), t.editors[e] = !0, t.dispatcher.trigger("editorChanged", e)
})
}, t.prototype.trackPageview = function () {
var e;
e = Backbone.history.getFragment(), this.previousURLs.unshift(e), this.previousURLs = this.previousURLs.slice(0, 2), _gaq && _gaq.push(["_trackPageview", "/" + e]), olark && olark("api.chat.updateVisitorStatus", {
snippet: ["log: " + this.user.logNum, "location: " + e]
});
if (Hoptoad && Hoptoad.setErrorDefaults) return Hoptoad.setErrorDefaults({
url: e,
component: "" + this.user.logNum,
action: this.user.email || ""
})
}, t.prototype.back = function (e) {
return this.navigate(this.previousURLs[1] || e, {
trigger: !0
})
}, t.prototype.loadDefaultViews = function () {
return this.menuView = new MenuView, this.main = $("#main"), this.app = $("#app"), app.user.justRegistered || $("#top").append(this.menuView.render().el), this.bundleRepository = new window.BundleRepository({
bundles: this.bundles
}), this.shortcutRepository = new window.ShortcutRepository, this.shortcutBucket = new ShortcutBucket
}, t.prototype.home = function () {
var e;
this.killBindings(), this.main.empty(), this.animateMain(), e = new HomeView, this.swapContent(e), this.user.email === "Guest" && (this.guestTimeout = setTimeout(function () {
var e;
return e = JST["backbone/templates/guest_notification"]({
message: "You are currently signed in as a <strong>guest</strong>. Save your progress by <a id='guest-upgrade' style='cursor: pointer;'>Signing Up</a>."
}), $("#notifications").prepend(e), $(".alert").fadeOut(0), $(".alert").fadeIn("fast"), $("#guest-upgrade").click(function () {
typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Guest", "Upgrade Clicked"]), app.navigate("app/plans", {
trigger: !0
})
})
}, 700));
if (this.justUpgraded && window.user.logNum === "333224556" || this.justUpgraded && window.user.logNum === "6444445") this.justUpgraded = !1, e.showUnlockEditorModal();
return this.applyJSHooks()
}, t.prototype.intervals = function () {
var e;
return this.killBindings(), this.dispatcher.off(), this.animateMain(), e = new IntervalsView, this.swapContent(e), this.applyJSHooks()
}, t.prototype.tutorial = function (e) {
var n;
return this.user.email === "Guest" && (this.user.defaultEditor = window.ShortcutFoo.convertEditor(e)), t.loadDemoKeys(), this.killBindings(), this.main.empty(), this.animateMainFast(), n = new DemoStartView({
name: e
}), this.swapContent(n), this.applyJSHooks()
}, t.prototype.welcome = function () {
var e;
return this.killBindings(), this.animateMain(), e = new ChooseEditorView, this.swapContent(e), this.applyJSHooks()
}, t.prototype.drills = function () {
var e;
return this.killBindings(), this.dispatcher.off(), this.animateMain(), e = new DrillsView({
practice: !1
}), this.swapContent(e), this.applyJSHooks()
}, t.prototype.drillNeedsWork = function () {
var e, t, n;
e = app.bundleRepository.getNeedsWorkBundle(5);
if (e.shortcutIds().length <= 0) {
$(".alert").remove(), n = JST["backbone/templates/error"]({
message: "<strong>No more shortcuts.</strong> Congrats! No more shortcuts under 70%. <a class='add-shortcuts' style='cursor: pointer'>Add more shortcuts</a>"
}), $("#notifications").prepend(n), $(".alert").fadeOut(0), $(".alert").fadeIn("fast"), $(".add-shortcuts").click(function () {
return app.navigate("app/shortcuts/new", {
trigger: !0,
replace: !0
})
});
return
}
return this.killBindings(), this.main.empty(), this.animateMain(), this.shortcutBucket.listen(), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Drill", "Needs-Work"]), t = new DrillView({
bundle: e,
practice: !1,
quick: !1,
saveBundleInfo: !1
}), this.swapContent(t), $(".help-popover-bottom").popover({
placement: "bottom"
})
}, t.prototype.drillToTry = function () {
var e, t, n;
e = app.bundleRepository.getBundleToTry(5);
if (e.shortcutIds().length <= 0) {
$(".alert").remove(), n = JST["backbone/templates/error"]({
message: "<strong>No more shortcuts.</strong> You've attempted all the shortcuts. <a class='add-shortcuts' style='cursor: pointer'>Add more shortcuts</a>"
}), $("#notifications").prepend(n), $(".alert").fadeOut(0), $(".alert").fadeIn("fast"), $(".add-shortcuts").click(function () {
return app.navigate("app/shortcuts/new", {
trigger: !0,
replace: !0
})
});
return
}
return this.killBindings(), this.main.empty(), this.animateMain(), this.shortcutBucket.listen(), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Drill", "To-Try"]), this.shortcutRepository.toTryShortcuts = null, t = new DrillView({
bundle: e,
practice: !1,
quick: !1,
saveBundleInfo: !1
}), this.swapContent(t), $(".help-popover-bottom").popover({
placement: "bottom"
})
}, t.prototype.drill = function (e, t) {
var n, r, i;
n = app.bundleRepository.find(e);
if (n.shortcutIds().length <= 0) {
$(".alert").remove(), i = JST["backbone/templates/error"]({
message: "<strong>This bundle has no shortcuts.</strong> Please add more before attempting a drill. <a class='edit-bundle' style='cursor: pointer'>Edit now</a>"
}), $("#notifications").prepend(i), $(".alert").fadeOut(0), $(".alert").fadeIn("fast"), $(".edit-bundle").click(function () {
return app.navigate("app/bundles/" + e, {
trigger: !0,
replace: !0
})
});
return
}
this.killBindings(), this.main.empty(), this.animateMain(), this.shortcutBucket.listen();
if (n.get("locked")) {
typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Drill", "Denied"]), app.navigate("app/plans", {
trigger: !0,
replace: !0
});
return
}
return typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Drill", n != null ? n.get("name") : void 0]), r = new DrillView({
bundle: n,
practice: !1,
quick: t,
saveBundleInfo: !0
}), this.swapContent(r), t ? this.applyJSHooks() : $(".help-popover-bottom").popover({
placement: "bottom"
})
}, t.prototype.practices = function () {
var e;
return this.killBindings(), this.main.empty(), this.animateMain(), e = new DrillsView({
practice: !0,
saveBundleInfo: !1
}), this.swapContent(e), this.applyJSHooks()
}, t.prototype.practiceNeedsWork = function () {
var e, t;
return this.killBindings(), this.main.empty(), this.animateMain(), e = app.bundleRepository.getNeedsWorkBundle(5), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Practice", "Needs-Work"]), t = new DrillView({
bundle: e,
practice: !0,
saveBundleInfo: !1
}), this.swapContent(t), this.applyJSHooks()
}, t.prototype.practiceToTry = function () {
var e, t;
return this.killBindings(), this.main.empty(), this.animateMain(), e = app.bundleRepository.getBundleToTry(5), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Practice", "To-Try"]), t = new DrillView({
bundle: e,
practice: !0,
saveBundleInfo: !1
}), this.swapContent(t), this.applyJSHooks()
}, t.prototype.practice = function (e) {
var t, n, r;
t = app.bundleRepository.find(e);
if (t.shortcutIds().length <= 0) {
$(".alert").remove(), r = JST["backbone/templates/error"]({
message: "<strong>This bundle has no shortcuts.</strong> Please add more before attempting to practice. <a class='edit-bundle' style='cursor: pointer'>Edit now</a>"
}), $("#notifications").prepend(r), $(".alert").fadeOut(0), $(".alert").fadeIn("fast"), $(".edit-bundle").click(function () {
return app.navigate("app/bundles/" + e, {
trigger: !0,
replace: !0
})
});
return
}
this.killBindings(), this.main.empty(), this.animateMain();
if (t.get("locked")) {
typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Practice", "Denied"]), app.navigate("app/plans", {
trigger: !0,
replace: !0
});
return
}
return typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Practice", t != null ? t.get("name") : void 0]), n = new DrillView({
bundle: t,
practice: !0,
saveBundleInfo: !1
}), this.swapContent(n), this.applyJSHooks()
}, t.prototype.bundles = function () {
var e;
return this.killBindings(), this.main.empty(), this.animateMain(), e = new EditBundlesView({}), this.swapContent(e), this.applyJSHooks()
}, t.prototype.bundleLimitReached = function () {
return app.user.logNum === "2345456567" && app.user.bundleCount >= 1 || app.user.logNum === "333224556" && app.user.bundleCount >= 3 || app.user.logNum === "6444445" && app.user.bundleCount >= 9
}, t.prototype.newBundle = function () {
var e;
this.killBindings();
if (this.bundleLimitReached()) {
typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Create", "Denied"]), this.error = JST["backbone/templates/error"]({
message: "<strong>Bundle limit reached.</strong> Please support us by upgrading! <a class='upgrade' style='cursor: pointer'>Upgrade now</a>"
}), window.history.back();
return
}
return this.main.empty(), this.animateMain(), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "New"]), e = new EditBundleView({
bundle: new Bundle
}), this.swapContent(e), this.applyJSHooks()
}, t.prototype.newBundleNeedsWork = function () {
var e;
this.killBindings();
if (this.bundleLimitReached()) {
typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Create", "Denied"]), this.error = JST["backbone/templates/error"]({
message: "<strong>Bundle limit reached.</strong> Please support us by upgrading! <a class='upgrade' style='cursor: pointer'>Upgrade now</a>"
}), window.history.back();
return
}
return this.main.empty(), this.animateMain(), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Create", "Needs-Work"]), e = new EditBundleView({
bundle: app.bundleRepository.getNeedsWorkBundle(5)
}), this.swapContent(e), this.applyJSHooks()
}, t.prototype.newBundleToTry = function () {
var e;
this.killBindings();
if (this.bundleLimitReached()) {
typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Create", "Denied"]), this.error = JST["backbone/templates/error"]({
message: "<strong>Bundle limit reached.</strong> Please support us by upgrading! <a class='upgrade' style='cursor: pointer'>Upgrade now</a>"
}), window.history.back();
return
}
return this.main.empty(), this.animateMain(), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Create", "To-Try"]), e = new EditBundleView({
bundle: app.bundleRepository.getBundleToTry(5)
}), this.swapContent(e), this.applyJSHooks()
}, t.prototype.editBundle = function (e) {
var t, n;
this.killBindings(), this.main.empty(), this.animateMain(), t = app.bundleRepository.find(e);
if (t.get("locked")) {
typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Edit", "Locked"]), app.navigate("app/plans", {
trigger: !0,
replace: !0
});
return
}
return typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Edit", t != null ? t.get("name") : void 0]), n = new EditBundleView({
bundle: t
}), this.swapContent(n), this.applyJSHooks()
}, t.prototype.shortcuts = function () {
var e;
return this.killBindings(), this.main.empty(), this.animateMain(), e = new EditShortcutsView, this.swapContent(e), this.applyJSHooks()
}, t.prototype.shortcutLimitReached = function () {
return app.user.logNum === "2345456567" && app.user.shortcutCount >= 5 || app.user.logNum === "333224556" && app.user.shortcutCount >= 30 || app.user.logNum === "6444445" && app.user.shortcutCount >= 90
}, t.prototype.newShortcut = function () {
var e;
this.killBindings();
if (this.shortcutLimitReached()) {
typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Shortcuts", "Create", "Denied"]), this.error = JST["backbone/templates/error"]({
message: "<strong>Shortcut limit reached.</strong> Please support us by upgrading! <a class='upgrade' style='cursor: pointer'>Upgrade now</a>"
}), window.history.back();
return
}
return this.main.empty(), this.animateMain(), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Shortcuts", "New"]), e = new EditShortcutView({
shortcut: new Shortcut
}), this.swapContent(e), this.applyJSHooks()
}, t.prototype.editShortcut = function (e) {
var t, n;
this.killBindings(), n = this.keys[e];
if (n.get("locked")) {
typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Shortcuts", "Edit", "Locked"]), app.navigate("app/plans", {
trigger: !0,
replace: !0
});
return
}
if (app.user.logNum === "2345456567" && app.user.shortcutEdits >= 10) {
typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Shortcuts", "Edit", "Denied"]), this.error = JST["backbone/templates/error"]({
message: "<strong>Shortcut editing limit reached.</strong> Please support us by upgrading! <a class='upgrade' style='cursor: pointer'>Upgrade now</a>"
}), window.history.back();
return
}
return this.main.empty(), this.animateMain(), t = new EditShortcutView({
shortcut: n
}), this.swapContent(t), this.applyJSHooks()
}, t.prototype.upgradeFromPaypal = function (e, t, n, r) {
var i;
return this.killBindings(), this.main.empty(), this.animateMain(), i = new PaypalUpgradeView({
plan: e,
payerId: t,
token: n,
seats: r
}), this.swapContent(i), this.applyJSHooks()
}, t.prototype.upgradeEnterprise = function (e) {
var t;
return e == null && (e = 1), this.killBindings(), this.main.empty(), this.animateMain(), t = new UpgradeView({
plan: "enterprise",
seats: e
}), this.swapContent(t), this.applyJSHooks()
}, t.prototype.upgrade = function (e) {
var t;
return e == null && (e = "pro"), this.killBindings(), this.main.empty(), this.animateMain(), t = new UpgradeView({
plan: e
}), this.swapContent(t), this.applyJSHooks()
}, t.prototype.plans = function () {
var e;
return this.killBindings(), this.main.empty(), this.animateMain(), e = new PricingView, this.swapContent(e), this.applyJSHooks()
}, t.prototype.enterprise = function () {
var e;
return this.killBindings(), this.main.empty(), this.animateMain(), e = new EnterpriseView, this.swapContent(e), this.applyJSHooks()
}, t.prototype.thankyou = function (e) {
var t;
return this.killBindings(), this.main.empty(), this.animateMain(), t = new ThankyouView({
token: e
}), this.swapContent(t), this.applyJSHooks()
}, t.prototype.killBindings = function () {
return $(".help-popover").popover("hide"), $(".help-popover-bottom").popover("hide"), $(".pop-tip-left").tooltip("hide"), $(".pop-tip-right").tooltip("hide"), this.dispatcher.off(), this.dispatcher.on("editorSelected", this.loadEditor), clearTimeout(this.guestTimeout)
}, t.prototype.applyJSHooks = function () {
return $(".help-popover").popover(), $(".help-popover-bottom").popover({
placement: "bottom"
}), $(".pop-tip-left").tooltip({
placement: "left"
}), $(".pop-tip-top").tooltip({
placement: "top"
}), $(".btn-group").button()
}, t.prototype.animateMain = function () {
$("#notifications").html(""), $("#main").css({
opacity: "0",
top: "-30px"
}), $("#main").animate({
top: "20px",
opacity: "1"
}, 300, "easeOutQuart", function () {});
if (this.error) return $("#notifications").html(this.error), $(".alert").fadeOut(0), $(".alert").fadeIn("fast"), $(".upgrade").click(function () {
return app.navigate("app/plans", {
trigger: !0
})
}), this.error = null
}, t.prototype.animateMainFast = function () {
$("#notifications").html(""), $("#main").css({
opacity: "0"
}), $("#main").animate({
opacity: "1"
}, 300, "easeOutQuart", function () {});
if (this.error) return $("#notifications").html(this.error), $(".alert").fadeOut(0), $(".alert").fadeIn("fast"), $(".upgrade").click(function () {
return app.navigate("app/upgrade", {
trigger: !0
})
}), this.error = null
}, t.prototype.swapContent = function (e) {
return this.currentView && this.currentView.leave && this.currentView.leave(), this.currentView = e, this.main.empty().append(this.currentView.render().el)
}, t.convertEditor = function (e) {
if (e === "vim") return "Vim";
if (e === "emacs") return "Emacs";
if (e === "commandline") return "Command Line";
if (e === "excel") return "Excel";
if (e === "xcode") return "XCode";
if (e === "photoshop" && /Mac/.test(navigator.userAgent)) return "Photoshop (mac)";
if (e === "photoshop" && !/Mac/.test(navigator.userAgent)) return "Photoshop (win)";
if (e === "textmate") return "TextMate";
if (e === "visualstudio") return "Microsoft Visual Studio";
if (e === "sublimetext" && /Mac/.test(navigator.userAgent)) return "Sublime Text 2 (mac)";
if (e === "sublimetext" && !/Mac/.test(navigator.userAgent)) return "Sublime Text 2 (win)";
if (e === "zendesk") return "Zendesk";
if (e === "eclipse" && !/Mac/.test(navigator.userAgent)) return "Eclipse";
if (e === "eclipse" && /Mac/.test(navigator.userAgent)) return "Eclipse (mac)";
if (e === "gmail") return "Gmail";
if (e === "intellijidea" && !/Mac/.test(navigator.userAgent)) return "IntelliJ IDEA";
if (e === "intellijidea" && /Mac/.test(navigator.userAgent)) return "IntelliJ IDEA (mac)";
if (e === "rubymine" && /Mac/.test(navigator.userAgent)) return "RubyMine";
if (e === "rubymine" && !/Mac/.test(navigator.userAgent)) return "RubyMine (win)";
if (e === "webstorm" && !/Mac/.test(navigator.userAgent)) return "WebStorm/PhpStorm";
if (e === "webstorm" && /Mac/.test(navigator.userAgent)) return "WebStorm/PhpStorm (mac)";
if (e === "appcode") return "AppCode";
if (e === "pycharm" && /Mac/.test(navigator.userAgent)) return "PyCharm";
if (e === "pycharm" && !/Mac/.test(navigator.userAgent)) return "PyCharm (win)";
if (e === "resharper") return "ReSharper (VS Scheme)";
if (e === "git") return "Git"
}, t.go = function (e, n, r) {
var i;
return /tutorial/.test(window.location.pathname) ? i = this.convertEditor(_.last(location.pathname.split("/"))) : i = n ? this.convertEditor(n) : void 0, $.ajax({
url: "/app/shortcutbundlesdata.json",
data: {
name: i
},
cache: !1
}).done(function (s) {
var o, u, a, f;
$.ajaxSetup({
beforeSend: function (e) {
return e.setRequestHeader("X-CSRF-Token", s.csrfToken)
}
}), i = s.defaultEditor || i, window.user = {
email: s.email,
logNum: s.logNum,
defaultEditor: i,
editors: s.editors,
shortcutCount: s.shortcutCount,
shortcutEdits: s.shortcutEdits,
bundleCount: s.bundleCount,
nextDrill: s.nextDrill,
createdAt: s.createdAt,
unlockedEditors: s.unlockedEditors,
sendIntervalEmails: s.sendIntervalEmails != null ? s.sendIntervalEmails : !0,
newIntervalsPerDay: s.newIntervalsPerDay || 10
}, window.user.editors.push("Command Line"), window.user.editors.push("Excel"), window.user.editors.push("Photoshop (mac)"), window.user.editors.push("Photoshop (win)"), window.user.editors.push("Eclipse"), window.user.editors.push("Eclipse (mac)"), window.user.editors.push("Gmail"), window.user.editors.push("Zendesk"), window.user.editors.push("IntelliJ IDEA"), window.user.editors.push("IntelliJ IDEA (mac)"), window.user.editors.push("RubyMine"), window.user.editors.push("RubyMine (win)"), window.user.editors.push("WebStorm/PhpStorm"), window.user.editors.push("WebStorm/PhpStorm (mac)"), window.user.editors.push("AppCode"), window.user.editors.push("PyCharm"), window.user.editors.push("PyCharm (win)"), window.user.editors.push("ReSharper (VS Scheme)"), window.user.editors.push("ReSharper (IDEA Scheme)"), window.user.editors.push("Git"), window.stripeKey = s.stripe_key, window.defaultKeys = s.shortcuts, window.bundles = s.bundles, window.app = new t, window.app.editors[i] = !0, window.app.loadDefaultViews(), o = !0, a = !! (o && window.history && window.history.pushState), Backbone.history.start({
pushState: a,
root: "/"
}), a ? Backbone.history.loadUrl(Backbone.history.getFragment()) : (f = Backbone.history.options.root.length, u = window.location.pathname.substr(f), Backbone.history.navigate(u, {
trigger: !0
}));
if (e) return app.navigate("app/tutorial/" + n, {
trigger: !0,
replace: !1
});
if (!r) return app.navigate("app", {
trigger: !0,
replace: !1
})
})
}, t.startDemo = function () {
var e, t;
return window.app = {}, window.demo = {}, window.app.keys = {}, window.app.dispatcher = _.clone(Backbone.Events), this.loadDemoKeys(), e = new AppView({
el: $("#app")
}), t = new DemoView({
el: $("#demo")
}), t.render()
}, t.loadDemoKeys = function () {
var e, t, n, r, i, s, o, u, a, f, l, c, h, p, d, v, m, g, y, b, w, E, S, x, T, N = this;
return b = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 49,
sequence: [{
key: "J",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fa959dbe1fbd4001b000003"
},
description: "Move down one line",
editor: "Vim",
locked: !1,
id: 49
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 70,
sequence: [{
key: "H",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fa959e5e1fbd40025000002"
},
description: "Move left one character",
editor: "Vim",
locked: !1,
id: 70
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 90,
sequence: [{
key: "L",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fa959eee1fbd40010000005"
},
description: "Move right one character",
editor: "Vim",
locked: !1,
id: 90
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 88,
sequence: [{
key: "B",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fa95a32e1fbd4000c000006"
},
description: "Move to beginning of word",
editor: "Vim",
locked: !1,
id: 88
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 87,
sequence: [{
key: "E",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fa95a27e1fbd4000c000005"
},
description: "Move to end of word",
editor: "Vim",
locked: !1,
id: 87
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 68,
sequence: [{
key: "W",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fa95aade1fbd4001b000005"
},
description: "Move to next word",
editor: "Vim",
locked: !1,
id: 68
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 64,
sequence: [{
key: "K",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fa959d1e1fbd4000c000004"
},
description: "Move up one line",
editor: "Vim",
locked: !1,
id: 64
}
], i = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 631,
sequence: [{
key: "B",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fab516f5215020017000003"
},
description: "Move backward a char",
editor: "Emacs",
locked: !1,
id: 631
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 629,
sequence: [{
key: "B",
shift: !1,
ctrl: !1,
alt: !0,
cmd: !1
}
],
_id: {
$oid: "4fab51855215020011000002"
},
description: "Move backward a word",
editor: "Emacs",
locked: !1,
id: 629
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 633,
sequence: [{
key: "F",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fab5166521502000b000001"
},
description: "Move forward a char",
editor: "Emacs",
locked: !1,
id: 633
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 630,
sequence: [{
key: "F",
shift: !1,
ctrl: !1,
alt: !0,
cmd: !1
}
],
_id: {
$oid: "4fab517c5215020011000001"
},
description: "Move forward a word",
editor: "Emacs",
locked: !1,
id: 630
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 666,
sequence: [{
key: "A",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fab51d4521502001f000004"
},
description: "Move to beginning of line",
editor: "Emacs",
locked: !1,
id: 666
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 628,
sequence: [{
key: "E",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fab51db521502001f000005"
},
description: "Move to end of line",
editor: "Emacs",
locked: !1,
id: 628
}
], y = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 711,
sequence: [{
key: "D",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4faab12394809c0019000002"
},
description: "Delete char on right",
editor: "TextMate",
locked: !1,
id: 711
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 714,
sequence: [{
key: "K",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4faab12c94809c001e000001"
},
description: "Delete rest of line",
editor: "TextMate",
locked: !1,
id: 714
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 727,
sequence: [{
key: "D",
shift: !0,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4faab0ee94809c000a000003"
},
description: "Duplicate line",
editor: "TextMate",
locked: !1,
id: 727
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 710,
sequence: [{
key: "[",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "4faab15494809c000a000006"
},
description: "Shift left",
editor: "TextMate",
locked: !1,
id: 710
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 709,
sequence: [{
key: "]",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "4faab15994809c0012000003"
},
description: "Shift right",
editor: "TextMate",
locked: !1,
id: 709
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 713,
sequence: [{
key: "T",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4faab11c94809c0017000003"
},
description: "Transpose characters",
editor: "TextMate",
locked: !1,
id: 713
}
], x = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 335,
sequence: [{
key: "B",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fac5955bd75820013000016"
},
description: "Move backward",
editor: "XCode",
locked: !1,
id: 335
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 331,
sequence: [{
key: "F",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fac5a41bd7582001a000021"
},
description: "Move forward",
editor: "XCode",
locked: !1,
id: 331
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 321,
sequence: [{
key: "A",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fac64b6bd75820023000019"
},
description: "Move to beginning of line",
editor: "XCode",
locked: !1,
id: 321
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 345,
sequence: [{
key: "E",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fac6abf060519000f000001"
},
description: "Move to end of line",
editor: "XCode",
locked: !1,
id: 345
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 315,
sequence: [{
key: "P",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fac6b120605190022000001"
},
description: "Move up",
editor: "XCode",
locked: !1,
id: 315
}
], w = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 526,
sequence: [{
key: "C",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fac22a0bd75820015000001"
},
description: "Copy",
editor: "Microsoft Visual Studio",
locked: !1,
id: 526
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 525,
sequence: [{
key: "X",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fac2303bd75820013000001"
},
description: "Cut",
editor: "Microsoft Visual Studio",
locked: !1,
id: 525
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 523,
sequence: [{
key: "DEL",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fac2363bd75820027000002"
},
description: "Delete",
editor: "Microsoft Visual Studio",
locked: !1,
id: 523
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 542,
sequence: [{
key: "V",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fac26fdbd75820013000003"
},
description: "Paste",
editor: "Microsoft Visual Studio",
locked: !1,
id: 542
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 540,
sequence: [{
key: "Z",
shift: !0,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fac273ebd7582001a000003"
},
description: "Redo",
editor: "Microsoft Visual Studio",
locked: !1,
id: 540
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 519,
sequence: [{
key: "A",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fac275bbd75820023000001"
},
description: "Select all",
editor: "Microsoft Visual Studio",
locked: !1,
id: 519
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 513,
sequence: [{
key: "Z",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fac27e9bd75820013000004"
},
description: "Undo",
editor: "Microsoft Visual Studio",
locked: !1,
id: 513
}
], m = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 641,
sequence: [{
key: "X",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "4fab4e46521502001f000001"
},
description: "Delete line",
editor: "Sublime Text 2 (mac)",
locked: !1,
id: 641
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 634,
sequence: [{
key: "M",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fab51245215020023000001"
},
description: "Go to matching parentheses",
editor: "Sublime Text 2 (mac)",
locked: !1,
id: 634
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 640,
sequence: [{
key: "ENTER",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "4fab4eac521502001f000002"
},
description: "Insert line after",
editor: "Sublime Text 2 (mac)",
locked: !1,
id: 640
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 639,
sequence: [{
key: "ENTER",
shift: !0,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "4fab4ec9521502001f000003"
},
description: "Insert line before",
editor: "Sublime Text 2 (mac)",
locked: !1,
id: 639
}
], g = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 568,
sequence: [{
key: "X",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fab5e085215020023000009"
},
description: "Delete line",
editor: "Sublime Text 2 (win)",
locked: !1,
id: 568
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 561,
sequence: [{
key: "M",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fab5fa1521502002300000c"
},
description: "Go to matching parentheses",
editor: "Sublime Text 2 (win)",
locked: !1,
id: 561
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 569,
sequence: [{
key: "ENTER",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fab5e18521502001b00000b"
},
description: "Insert line after",
editor: "Sublime Text 2 (win)",
locked: !1,
id: 569
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 566,
sequence: [{
key: "ENTER",
shift: !0,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fab5e28521502001f00000e"
},
description: "Insert line before",
editor: "Sublime Text 2 (win)",
locked: !1,
id: 566
}
], r = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1203,
sequence: [{
key: "D",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "50135468ad5f06001300000f"
},
description: "Delete line",
editor: "Eclipse",
locked: !1,
id: 1203
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1198,
sequence: [{
key: "DEL",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "5013540b216acd001b000008"
},
description: "Delete next word",
editor: "Eclipse",
locked: !1,
id: 1198
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1199,
sequence: [{
key: "DEL",
shift: !0,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "50135416ad5f06001300000e"
},
description: "Delete to end of line",
editor: "Eclipse",
locked: !1,
id: 1199
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1196,
sequence: [{
key: "ENTER",
shift: !0,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "501353d6ad5f06001300000d"
},
description: "Insert line below current line",
editor: "Eclipse",
locked: !1,
id: 1196
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1204,
sequence: [{
key: "RIGHT",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "50135470216acd001e000012"
},
description: "Next word",
editor: "Eclipse",
locked: !1,
id: 1204
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1195,
sequence: [{
key: "LEFT",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "501353c7ad5f06001300000c"
},
description: "Previous word",
editor: "Eclipse",
locked: !1,
id: 1195
}
], n = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1336,
sequence: [{
key: "D",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "50169cb42d0a7c0007000008"
},
description: "Delete line",
editor: "Eclipse (mac)",
locked: !1,
id: 1336
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1341,
sequence: [{
key: "DEL",
shift: !1,
ctrl: !1,
alt: !0,
cmd: !1
}
],
_id: {
$oid: "50169ce52d0a7c0014000009"
},
description: "Delete next word",
editor: "Eclipse (mac)",
locked: !1,
id: 1341
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1331,
sequence: [{
key: "DEL",
shift: !0,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "50169c649610100016000006"
},
description: "Delete to end of line",
editor: "Eclipse (mac)",
locked: !1,
id: 1331
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1337,
sequence: [{
key: "RIGHT",
shift: !1,
ctrl: !1,
alt: !0,
cmd: !1
}
],
_id: {
$oid: "50169cc52d0a7c000b00000a"
},
description: "Next word",
editor: "Eclipse (mac)",
locked: !1,
id: 1337
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1338,
sequence: [{
key: "LEFT",
shift: !1,
ctrl: !1,
alt: !0,
cmd: !1
}
],
_id: {
$oid: "50169ccd961010001f000007"
},
description: "Previous word",
editor: "Eclipse (mac)",
locked: !1,
id: 1338
}
], t = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 249,
sequence: [{
key: "U",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "P",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "T",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "I",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "M",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "E",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "ENTER",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fc548904a33910019000001"
},
description: "Display system uptime",
editor: "Command Line",
locked: !1,
id: 249
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 250,
sequence: [{
key: "D",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "A",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "T",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "E",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "ENTER",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fc548804a33910013000001"
},
description: "Show date and time",
editor: "Command Line",
locked: !1,
id: 250
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 242,
sequence: [{
key: "F",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "R",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "E",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "E",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "ENTER",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fc549c62ad16f000f000001"
},
description: "Show memory and swap usage",
editor: "Command Line",
locked: !1,
id: 242
}
], l = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 932,
sequence: [{
key: "R",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fd9019328423f001100000f"
},
description: "Blur",
editor: "Photoshop (mac)",
locked: !1,
id: 932
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 949,
sequence: [{
key: "B",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fd901f5c7db45000f00000d"
},
description: "Brush",
editor: "Photoshop (mac)",
locked: !1,
id: 949
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 947,
sequence: [{
key: "C",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fd901edc7db450018000014"
},
description: "Crop",
editor: "Photoshop (mac)",
locked: !1,
id: 947
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 937,
sequence: [{
key: "O",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fd901b4c7db45001300000d"
},
description: "Dodge",
editor: "Photoshop (mac)",
locked: !1,
id: 937
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 931,
sequence: [{
key: "E",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fd9018fc7db45000b00000e"
},
description: "Eraser",
editor: "Photoshop (mac)",
locked: !1,
id: 931
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 936,
sequence: [{
key: "I",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fd901adc7db45000b000010"
},
description: "Eyedropper",
editor: "Photoshop (mac)",
locked: !1,
id: 936
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 941,
sequence: [{
key: "G",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "4fd901cb28423f001e00000c"
},
description: "Gradient",
editor: "Photoshop (mac)",
locked: !1,
id: 941
}
], T = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 75,
sequence: [{
key: "R",
shift: !1,
ctrl: !0,
alt: !0,
cmd: !1
}
],
_id: {
$oid: "50591d6f5410610007000003"
},
description: "Current Requester",
editor: "Zendesk",
locked: !1,
id: 75
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 72,
sequence: [{
key: "T",
shift: !1,
ctrl: !0,
alt: !0,
cmd: !1
}
],
_id: {
$oid: "50591d645410610007000002"
},
description: "Current Ticket",
editor: "Zendesk",
locked: !1,
id: 72
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 289,
sequence: [{
key: "H",
shift: !1,
ctrl: !0,
alt: !0,
cmd: !1
}
],
_id: {
$oid: "50591d43e038020007000001"
},
description: "Home",
editor: "Zendesk",
locked: !1,
id: 289
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 89,
sequence: [{
key: "N",
shift: !1,
ctrl: !0,
alt: !0,
cmd: !1
}
],
_id: {
$oid: "50591d7fe038020007000003"
},
description: "New Ticket",
editor: "Zendesk",
locked: !1,
id: 89
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 73,
sequence: [{
key: "F",
shift: !1,
ctrl: !0,
alt: !0,
cmd: !1
}
],
_id: {
$oid: "50591d77e038020007000002"
},
description: "Search",
editor: "Zendesk",
locked: !1,
id: 73
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 44,
sequence: [{
key: "V",
shift: !1,
ctrl: !0,
alt: !0,
cmd: !1
}
],
_id: {
$oid: "50591d4a5410610007000001"
},
description: "Views",
editor: "Zendesk",
locked: !1,
id: 44
}
], u = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1359,
sequence: [{
key: "G",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "A",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "501a0f6f24a2290007000003"
},
description: "Go to all mail",
editor: "Gmail",
locked: !1,
id: 1359
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1358,
sequence: [{
key: "G",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "D",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "501a0f69e1be940007000008"
},
description: "Go to drafts",
editor: "Gmail",
locked: !1,
id: 1358
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1355,
sequence: [{
key: "G",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "I",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "501a0f3fe1be940007000005"
},
description: "Go to inbox",
editor: "Gmail",
locked: !1,
id: 1355
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1357,
sequence: [{
key: "G",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "T",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "501a0f5fe1be940007000007"
},
description: "Go to sent messages",
editor: "Gmail",
locked: !1,
id: 1357
}
], f = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 21,
sequence: [{
key: "Y",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "50370b3ca7b49c0007000010"
},
description: "Delete current line",
editor: "IntelliJ IDEA",
locked: !1,
id: 21
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1415,
sequence: [{
key: "D",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "50370b81cffccf000700001a"
},
description: "Duplicate current line or selected block",
editor: "IntelliJ IDEA",
locked: !1,
id: 1415
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 12,
sequence: [{
key: "TAB",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "50370fb6a7b49c0007000019"
},
description: "Indent selection",
editor: "IntelliJ IDEA",
locked: !1,
id: 12
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 25,
sequence: [{
key: "RIGHT",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "50370a2aa7b49c000700000c"
},
description: "Move to next word",
editor: "IntelliJ IDEA",
locked: !1,
id: 25
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 31,
sequence: [{
key: "LEFT",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "50370a41cffccf0007000014"
},
description: "Move to previous word",
editor: "IntelliJ IDEA",
locked: !1,
id: 31
}
], a = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2077,
sequence: [{
key: "Y",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "50569490ff274d0007000030"
},
description: "Delete line at caret",
editor: "IntelliJ IDEA (mac)",
locked: !1,
id: 2077
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2080,
sequence: [{
key: "D",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "50569536ff274d0007000031"
},
description: "Duplicate line or block",
editor: "IntelliJ IDEA (mac)",
locked: !1,
id: 2080
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2087,
sequence: [{
key: "TAB",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "505695c0ff274d0007000036"
},
description: "Indent selection",
editor: "IntelliJ IDEA (mac)",
locked: !1,
id: 2087
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2073,
sequence: [{
key: "RIGHT",
shift: !1,
ctrl: !1,
alt: !0,
cmd: !1
}
],
_id: {
$oid: "505693ad3c5088000700002e"
},
description: "Move to next word",
editor: "IntelliJ IDEA (mac)",
locked: !1,
id: 2073
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2074,
sequence: [{
key: "LEFT",
shift: !1,
ctrl: !1,
alt: !0,
cmd: !1
}
],
_id: {
$oid: "505693b5ff274d000700002e"
},
description: "Move to previous word",
editor: "IntelliJ IDEA (mac)",
locked: !1,
id: 2074
}
], c = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2277,
sequence: [{
key: "/",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "505be2a35253ae000200000a"
},
description: "Comment line",
editor: "PyCharm",
locked: !1,
id: 2277
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2289,
sequence: [{
key: "BACKSPACE",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "505be2a35253ae0002000016"
},
description: "Delete line at caret",
editor: "PyCharm",
locked: !1,
id: 2289
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2322,
sequence: [{
key: "L",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "505be2a35253ae000200003e"
},
description: "Go to line",
editor: "PyCharm",
locked: !1,
id: 2322
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2332,
sequence: [{
key: "DOWN",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "505be2a35253ae0002000048"
},
description: "Go to next method",
editor: "PyCharm",
locked: !1,
id: 2332
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2331,
sequence: [{
key: "UP",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "505be2a35253ae0002000047"
},
description: "Go to previous method",
editor: "PyCharm",
locked: !1,
id: 2331
}
], h = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2367,
sequence: [{
key: "/",
shift: !1,
alt: !1,
cmd: !1,
ctrl: !0
}
],
_id: {
$oid: "505d1a6779d23c0002000003"
},
description: "Comment/uncomment current line or selected block with line comments",
editor: "PyCharm (win)",
locked: !1,
id: 2367
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2386,
sequence: [{
key: "Y",
shift: !1,
alt: !1,
cmd: !1,
ctrl: !0
}
],
_id: {
$oid: "505d1a6779d23c0002000018"
},
description: "Delete Line",
editor: "PyCharm (win)",
locked: !1,
id: 2386
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2388,
sequence: [{
key: "BACKSPACE",
shift: !1,
alt: !1,
cmd: !1,
ctrl: !0
}
],
_id: {
$oid: "505d1a6779d23c000200001a"
},
description: "Delete to Word Start",
editor: "PyCharm (win)",
locked: !1,
id: 2388
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2389,
sequence: [{
key: "D",
shift: !1,
alt: !1,
cmd: !1,
ctrl: !0
}
],
_id: {
$oid: "505d1a6779d23c000200001b"
},
description: "Duplicate Line or Block",
editor: "PyCharm (win)",
locked: !1,
id: 2389
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2396,
sequence: [{
key: "U",
shift: !0,
alt: !1,
cmd: !1,
ctrl: !0
}
],
_id: {
$oid: "505d1a6779d23c0002000022"
},
description: "Toggle Case",
editor: "PyCharm (win)",
locked: !1,
id: 2396
}
], d = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1511,
sequence: [{
key: "/",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "50381cf8a7b49c0007000058"
},
description: "Comment/uncomment with line comment",
editor: "RubyMine",
locked: !1,
id: 1511
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1524,
sequence: [{
key: "Y",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "50381f05cffccf0007000055"
},
description: "Delete line at caret",
editor: "RubyMine",
locked: !1,
id: 1524
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1523,
sequence: [{
key: "D",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "50381ec7cffccf0007000054"
},
description: "Duplicate current line or selected block",
editor: "RubyMine",
locked: !1,
id: 1523
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1525,
sequence: [{
key: "ENTER",
shift: !0,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "50381f19cffccf0007000056"
},
description: "Start new line",
editor: "RubyMine",
locked: !1,
id: 1525
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1538,
sequence: [{
key: "TAB",
shift: !0,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "503822c4a7b49c0007000065"
},
description: "Unindent selected lines",
editor: "RubyMine",
locked: !1,
id: 1538
}
], v = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1708,
sequence: [{
key: "/",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "503bef06b5fa600007000006"
},
description: "Comment/uncomment with line comment",
editor: "RubyMine (win)",
locked: !1,
id: 1708
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1722,
sequence: [{
key: "Y",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "503bf16b3ca611000700000a"
},
description: "Delete line at caret",
editor: "RubyMine (win)",
locked: !1,
id: 1722
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1721,
sequence: [{
key: "D",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "503bf157b5fa60000700000e"
},
description: "Duplicate current line or selected block",
editor: "RubyMine (win)",
locked: !1,
id: 1721
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1715,
sequence: [{
key: "TAB",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "503bf0bd3ca6110007000007"
},
description: "Indent selected lines",
editor: "RubyMine (win)",
locked: !1,
id: 1715
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1716,
sequence: [{
key: "TAB",
shift: !0,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "503bf0d6b5fa60000700000b"
},
description: "Unindent selected lines",
editor: "RubyMine (win)",
locked: !1,
id: 1716
}
], E = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2176,
sequence: [{
key: "/",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "505bd6cd8c5af30007000019"
},
description: "Comment line",
editor: "WebStorm (mac)",
locked: !1,
id: 2176
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2188,
sequence: [{
key: "BACKSPACE",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "505bd76c4f91520007000014"
},
description: "Delete line at caret",
editor: "WebStorm (mac)",
locked: !1,
id: 2188
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2187,
sequence: [{
key: "D",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "505bd7648c5af30007000021"
},
description: "Duplicate current line or selected block",
editor: "WebStorm (mac)",
locked: !1,
id: 2187
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2184,
sequence: [{
key: "TAB",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "505bd7354f91520007000013"
},
description: "Indent selected lines",
editor: "WebStorm (mac)",
locked: !1,
id: 2184
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2185,
sequence: [{
key: "TAB",
shift: !0,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "505bd73e8c5af3000700001f"
},
description: "Unindent selected lines",
editor: "WebStorm (mac)",
locked: !1,
id: 2185
}
], S = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1801,
sequence: [{
key: "/",
shift: !1,
alt: !1,
cmd: !1,
ctrl: !0
}
],
_id: {
$oid: "504bd1ebcc10d6000200003b"
},
description: "Comment/uncomment current line or selected block with line comments",
editor: "WebStorm",
locked: !1,
id: 1801
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1796,
sequence: [{
key: "C",
shift: !1,
alt: !1,
cmd: !1,
ctrl: !0
}
],
_id: {
$oid: "504bd1ebcc10d60002000036"
},
description: "Copy to clipboard",
editor: "WebStorm",
locked: !1,
id: 1796
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1847,
sequence: [{
key: "Y",
shift: !1,
alt: !1,
cmd: !1,
ctrl: !0
}
],
_id: {
$oid: "504bd1ebcc10d6000200006b"
},
description: "Delete Line",
editor: "WebStorm",
locked: !1,
id: 1847
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1799,
sequence: [{
key: "D",
shift: !1,
alt: !1,
cmd: !1,
ctrl: !0
}
],
_id: {
$oid: "504bd1ebcc10d60002000039"
},
description: "Duplicate Line or Block",
editor: "WebStorm",
locked: !1,
id: 1799
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1904,
sequence: [{
key: "TAB",
shift: !0,
alt: !1,
cmd: !1,
ctrl: !1
}
],
_id: {
$oid: "504bd1ebcc10d600020000a8"
},
description: "Unindent Selection",
editor: "WebStorm",
locked: !1,
id: 1904
}
], e = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1618,
sequence: [{
key: "/",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "5039b911a19bef0007000009"
},
description: "Comment / uncomment line",
editor: "AppCode",
locked: !1,
id: 1618
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1630,
sequence: [{
key: "D",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "5039ba2f6c294e000700000d"
},
description: "Duplicate current line or selected block",
editor: "AppCode",
locked: !1,
id: 1630
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1661,
sequence: [{
key: "L",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !0
}
],
_id: {
$oid: "503b01369e04010007000017"
},
description: "Go to line",
editor: "AppCode",
locked: !1,
id: 1661
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1627,
sequence: [{
key: "TAB",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "5039ba03a19bef000700000f"
},
description: "Indent selected line",
editor: "AppCode",
locked: !1,
id: 1627
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 1628,
sequence: [{
key: "TAB",
shift: !0,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "5039ba106c294e000700000b"
},
description: "Unindent selected line",
editor: "AppCode",
locked: !1,
id: 1628
}
], p = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 111,
sequence: [{
key: "SPACE",
shift: !1,
alt: !1,
cmd: !1,
ctrl: !0
}
],
_id: {
$oid: "50708f4f066dd20002000011"
},
description: "Complete Symbol",
editor: "ReSharper (VS Scheme)",
locked: !1,
id: 111
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2483,
sequence: [{
key: "BACKSPACE",
shift: !1,
alt: !1,
cmd: !1,
ctrl: !0
}
],
_id: {
$oid: "50708f4f066dd2000200000a"
},
description: "Delete text from start of word to the caret",
editor: "ReSharper (VS Scheme)",
locked: !1,
id: 2483
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2484,
sequence: [{
key: "DEL",
shift: !1,
alt: !1,
cmd: !1,
ctrl: !0
}
],
_id: {
$oid: "50708f4f066dd2000200000b"
},
description: "Delete text from the caret to the end of the word",
editor: "ReSharper (VS Scheme)",
locked: !1,
id: 2484
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 99,
sequence: [{
key: "D",
shift: !1,
alt: !1,
cmd: !1,
ctrl: !0
}
],
_id: {
$oid: "50708f4f066dd2000200000e"
},
description: "Duplicate Text",
editor: "ReSharper (VS Scheme)",
locked: !1,
id: 99
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 93,
sequence: [{
key: "]",
shift: !1,
alt: !1,
cmd: !1,
ctrl: !0
}
],
_id: {
$oid: "50708f4f066dd20002000018"
},
description: "Goto Brace",
editor: "ReSharper (VS Scheme)",
locked: !1,
id: 93
}
], s = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 40,
sequence: [{
key: "B",
shift: !1,
alt: !1,
cmd: !1,
ctrl: !0
}
],
_id: {
$oid: "507b6544b2390c000200001f"
},
description: "Bold",
editor: "Excel",
locked: !1,
id: 40
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2706,
sequence: [{
key: "BACKSPACE",
shift: !1,
ctrl: !0,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "507b68ac80d6eb0007000009"
},
description: "Display the active cell",
editor: "Excel",
locked: !1,
id: 2706
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 114,
sequence: [{
key: ";",
shift: !1,
alt: !1,
cmd: !1,
ctrl: !0
}
],
_id: {
$oid: "507b6544b2390c0002000013"
},
description: "Insert Current Date",
editor: "Excel",
locked: !1,
id: 114
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 113,
sequence: [{
key: ";",
shift: !0,
alt: !1,
cmd: !1,
ctrl: !0
}
],
_id: {
$oid: "507b6544b2390c0002000012"
},
description: "Insert Current Time",
editor: "Excel",
locked: !1,
id: 113
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 151,
sequence: [{
key: "Z",
shift: !1,
alt: !1,
cmd: !1,
ctrl: !0
}
],
_id: {
$oid: "507b6544b2390c000200004f"
},
description: "Undo",
editor: "Excel",
locked: !1,
id: 151
}
], o = [{
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2725,
sequence: [{
key: "G",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "I",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "T",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "SPACE",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "C",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "O",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "M",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "M",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "I",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "T",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "ENTER",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "507e3b6260da200007000009"
},
description: "Commit changes",
editor: "Git",
locked: !1,
id: 2725
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2719,
sequence: [{
key: "G",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "I",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "T",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "SPACE",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "I",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "N",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "I",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "T",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "ENTER",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "507e35e060da200007000001"
},
description: "Initialize a repository",
editor: "Git",
locked: !1,
id: 2719
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2720,
sequence: [{
key: "G",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "I",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "T",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "SPACE",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "S",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "T",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "A",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "T",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "U",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "S",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "ENTER",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "507e370d60da200007000002"
},
description: "Show status of working tree",
editor: "Git",
locked: !1,
id: 2720
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2723,
sequence: [{
key: "G",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "I",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "T",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "SPACE",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "D",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "I",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "F",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "F",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "ENTER",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "507e391760da200007000006"
},
description: "Show what's changed but not yet staged",
editor: "Git",
locked: !1,
id: 2723
}, {
numCorrect: 0,
numIncorrect: 0,
hasFailed: !1,
parentId: 2721,
sequence: [{
key: "G",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "I",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "T",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "SPACE",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "A",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "D",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "D",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "SPACE",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "F",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "I",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "L",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "E",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: ".",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "T",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "X",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "T",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}, {
key: "ENTER",
shift: !1,
ctrl: !1,
alt: !1,
cmd: !1
}
],
_id: {
$oid: "507e383660da200007000004"
},
description: "Start tracking file.txt",
editor: "Git",
locked: !1,
id: 2721
}
], window.demo = window.demo || {}, window.app.demokeys = {}, window.demo.intellijWinIds = [], _.each(f, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.intellijWinIds.push(t.get("parentId"))
}), window.demo.intellijMacIds = [], _.each(a, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.intellijMacIds.push(t.get("parentId"))
}), window.demo.pycharmMacIds = [], _.each(c, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.pycharmMacIds.push(t.get("parentId"))
}), window.demo.pycharmWinIds = [], _.each(h, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.pycharmWinIds.push(t.get("parentId"))
}), window.demo.rubymineMacIds = [], _.each(d, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.rubymineMacIds.push(t.get("parentId"))
}), window.demo.rubymineWinIds = [], _.each(v, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.rubymineWinIds.push(t.get("parentId"))
}), window.demo.webstormMacIds = [], _.each(E, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.webstormMacIds.push(t.get("parentId"))
}), window.demo.webstormWinIds = [], _.each(S, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.webstormWinIds.push(t.get("parentId"))
}), window.demo.appcodeIds = [], _.each(e, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.appcodeIds.push(t.get("parentId"))
}), window.demo.resharperIds = [], _.each(p, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.resharperIds.push(t.get("parentId"))
}), window.demo.vimIds = [], _.each(b, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.vimIds.push(t.get("parentId"))
}), window.demo.emacsIds = [], _.each(i, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.emacsIds.push(t.get("parentId"))
}), window.demo.textmateIds = [], _.each(y, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.textmateIds.push(t.get("parentId"))
}), window.demo.xcodeIds = [], _.each(x, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.xcodeIds.push(t.get("parentId"))
}), window.demo.vsIds = [], _.each(w, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.vsIds.push(t.get("parentId"))
}), window.demo.stMacIds = [], _.each(m, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.stMacIds.push(t.get("parentId"))
}), window.demo.stWinIds = [], _.each(g, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.stWinIds.push(t.get("parentId"))
}), window.demo.eclipseWinIds = [], _.each(r, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.eclipseWinIds.push(t.get("parentId"))
}), window.demo.eclipseMacIds = [], _.each(n, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.eclipseMacIds.push(t.get("parentId"))
}), window.demo.commandLineIds = [], _.each(t, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.commandLineIds.push(t.get("parentId"))
}), window.demo.photoshopIds = [], _.each(l, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.photoshopIds.push(t.get("parentId"))
}), window.demo.zendeskIds = [], _.each(T, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.zendeskIds.push(t.get("parentId"))
}), window.demo.excelIds = [], _.each(s, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.excelIds.push(t.get("parentId"))
}), window.demo.gitIds = [], _.each(o, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.gitIds.push(t.get("parentId"))
}), window.demo.gmailIds = [], _.each(u, function (e) {
var t;
return t = new window.Shortcut(e), window.app.demokeys[t.get("parentId")] = t, window.demo.gmailIds.push(t.get("parentId"))
})
}, t
}(Backbone.Router)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.Bundles = function (e) {
function t() {
var e = this;
return this.passesAccuracyFilter = function (n) {
return t.prototype.passesAccuracyFilter.apply(e, arguments)
}, this.passesEditorFilter = function (n) {
return t.prototype.passesEditorFilter.apply(e, arguments)
}, this.passesFilters = function (n) {
return t.prototype.passesFilters.apply(e, arguments)
}, this.applyFilters = function () {
return t.prototype.applyFilters.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.model = window.Bundle, t.prototype.url = "/api/bundles.json", t.prototype.initialize = function () {
return this.editorFilter = "Any", this.accuracyFilter = "Any"
}, t.prototype.applyFilters = function () {
var e, t = this;
return e = this.filter(function (e) {
return t.passesFilters(e)
}), e = new window.Bundles(e), e.editorFilter = this.editorFilter, e.accuracyFilter = this.accuracyFilter, e
}, t.prototype.passesFilters = function (e) {
return (this.editorFilter === "Any" || this.passesEditorFilter(e)) && (this.accuracyFilter === "Any" || this.passesAccuracyFilter(e))
}, t.prototype.passesEditorFilter = function (e) {
return e.get("editor") === this.editorFilter
}, t.prototype.passesAccuracyFilter = function (e) {
var t;
return t = e.accuracyToNum(), this.accuracyFilter === "N/A" ? t === -1 : t <= this.accuracyFilter
}, t.prototype.comparator = function (e) {
var t, n;
return e.get("locked") ? (n = e.get("name")) != null ? n.toLowerCase() : void 0 : (t = e.get("name")) != null ? t.toUpperCase() : void 0
}, t
}(Backbone.Collection)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.Shortcuts = function (e) {
function t() {
var e = this;
return this.passesAccuracyFilter = function (n) {
return t.prototype.passesAccuracyFilter.apply(e, arguments)
}, this.passesBundleFilter = function (n) {
return t.prototype.passesBundleFilter.apply(e, arguments)
}, this.passesEditorFilter = function (n) {
return t.prototype.passesEditorFilter.apply(e, arguments)
}, this.passesFilters = function (n) {
return t.prototype.passesFilters.apply(e, arguments)
}, this.applyFilters = function () {
return t.prototype.applyFilters.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.model = window.Shortcut, t.prototype.url = "/api/shortcuts.json", t.prototype.initialize = function () {
return this.editorFilter = "Any", this.bundleFilter = "Any", this.accuracyFilter = "Any", this.sortByDescriptor = "description", this.sortAsc = !0
}, t.prototype.applyFilters = function () {
var e, t = this;
return e = this.filter(function (e) {
return t.passesFilters(e)
}), e = new window.Shortcuts(e), e.editorFilter = this.editorFilter, e.bundleFilter = this.bundleFilter, e.accuracyFilter = this.accuracyFilter, e
}, t.prototype.passesFilters = function (e) {
return (this.editorFilter === "Any" || this.passesEditorFilter(e)) && (this.bundleFilter === "Any" || this.passesBundleFilter(e)) && (this.accuracyFilter === "Any" || this.passesAccuracyFilter(e)) && !e.get("removed")
}, t.prototype.passesEditorFilter = function (e) {
return e.get("editor") === this.editorFilter
}, t.prototype.passesBundleFilter = function (e) {
return this.bundleFilter === "None" ? e.bundleNames().length === 0 : _.include(e.bundleNames(), this.bundleFilter)
}, t.prototype.passesAccuracyFilter = function (e) {
var t;
return t = e.accuracyToNum(), this.accuracyFilter === "--" ? t === -1 : t <= this.accuracyFilter
}, t
}(Backbone.Collection)
}.call(this),
function () {}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.AppView = function (e) {
function t() {
var e = this;
return this.demoEditorSelected = function (n) {
return t.prototype.demoEditorSelected.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/app"], t.prototype.initialize = function () {
return app.dispatcher.on("demoEditorSelected", this.demoEditorSelected)
}, t.prototype.render = function () {
return $("#bluebanner").hide(), $(this.el).html(this.template({})), this
}, t.prototype.demoEditorSelected = function (e) {
return this.render(), Hoptoad.setKey("25e0b649df06c05d78d242c7cfd5ef4e"), Hoptoad.setHost("//airbrake.io"), Hoptoad.setEnvironment('#{ENV["RACK_ENV"]}'), window.noshuf = !1, typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Demo", "Started"]), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Demo", "Editor Selected", e]), ShortcutFoo.go(!0, e)
}, t
}(Backbone.View)
}.call(this),
function () {}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.BundlesFilterView = function (e) {
function t() {
var e = this;
return this.undoFilters = function () {
return t.prototype.undoFilters.apply(e, arguments)
}, this.filterAccuracy = function (n) {
return t.prototype.filterAccuracy.apply(e, arguments)
}, this.filterEditor = function (n) {
return t.prototype.filterEditor.apply(e, arguments)
}, this.selectFilteredAccuracy = function (n) {
return t.prototype.selectFilteredAccuracy.apply(e, arguments)
}, this.selectFilteredEditor = function (n) {
return t.prototype.selectFilteredEditor.apply(e, arguments)
}, this.render = function () {
return t.prototype.render.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/bundlesfilterview"], t.prototype.events = {
"click .filter-editor": "filterEditor",
"click .filter-accuracy": "filterAccuracy"
}, t.prototype.initialize = function () {
return this.selectedEditor = this.options.selectedEditor, this.editorFilter = "Any", app.dispatcher.on("undoFilters", this.undoFilters)
}, t.prototype.render = function () {
return $(this.el).html(this.template({
selectedEditor: this.selectedEditor
})), this
}, t.prototype.selectFilteredEditor = function (e) {
return this.$("#filter-editor-choice").html("" + e + " <b class='caret'></b>")
}, t.prototype.selectFilteredAccuracy = function (e) {
return this.$("#filter-accuracy-choice").html("" + e + " <b class='caret'></b>")
}, t.prototype.filterEditor = function (e) {
return this.editorFilter = $(e.currentTarget).text(), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Filter", this.editorFilter]), this.selectFilteredEditor(this.editorFilter), app.dispatcher && app.dispatcher.trigger("editorSelected", this.editorFilter), app.user.defaultEditor = this.editorFilter
}, t.prototype.filterAccuracy = function (e) {
var t;
t = $(e.currentTarget).text(), this.selectFilteredAccuracy(t), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Filter", t]), t === "<= 100%" ? this.accuracyFilter = 100 : t === "<= 75%" ? this.accuracyFilter = 75 : t === "<= 50%" ? this.accuracyFilter = 50 : t === "<= 25%" ? this.accuracyFilter = 25 : this.accuracyFilter = t;
if (app.dispatcher) return app.dispatcher.trigger("accuracyFiltered", this.accuracyFilter)
}, t.prototype.undoFilters = function () {
return typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Filter", "undo"]), this.editorFilter = app.user.defaultEditor, this.selectedEditor = this.editorFilter, this.accuracyFilter = "Any", this.render()
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.EditBundleView = function (e) {
function t() {
var e = this;
return this.removeBundleConfirmed = function () {
return t.prototype.removeBundleConfirmed.apply(e, arguments)
}, this.resetStatsConfirmed = function () {
return t.prototype.resetStatsConfirmed.apply(e, arguments)
}, this.undoFilters = function () {
return t.prototype.undoFilters.apply(e, arguments)
}, this.applyFilters = function () {
return t.prototype.applyFilters.apply(e, arguments)
}, this.filterAccuracy = function (n) {
return t.prototype.filterAccuracy.apply(e, arguments)
}, this.filterEditor = function (n) {
return t.prototype.filterEditor.apply(e, arguments)
}, this.filterBundle = function (n) {
return t.prototype.filterBundle.apply(e, arguments)
}, this.render = function () {
return t.prototype.render.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/editbundleview"], t.prototype.events = {
"click .add-key": "keyAdded",
"click #save": "save",
"keyup #bundle-name": "nameChanged",
"click .reset-bundle-stats": "resetStats",
"click .delete-bundle": "removeBundle",
"click #action-confirmation-cancel": "cancelAction",
"click #action-confirmation-button": "performAction"
}, t.prototype.initialize = function () {
return this.bundle = this.options.bundle, this.selectedShortcuts = new window.Shortcuts(this.bundle.shortcuts()), this.unselectedShortcuts = new window.Shortcuts(app.shortcutRepository.shortcutsNotInBundle(this.bundle)), app.dispatcher.on("editorFiltered", this.filterEditor), app.dispatcher.on("bundleFiltered", this.filterBundle), app.dispatcher.on("accuracyFiltered", this.filterAccuracy), app.dispatcher.on("undoFilters", this.undoFilters)
}, t.prototype.render = function () {
var e, t, n, r = this;
return this.editorFilter = this.bundle.get("editor") || app.user.defaultEditor, t = "New Bundle", this.bundle.exists() && (t = "Edit Bundle"), e = this.bundle.exists(), $(this.el).html(this.template({
showChecks: app.user.logNum === 9987278364,
pageName: t,
selectedEditor: this.editorFilter,
isExistingBundle: e
})), n = new ShortcutsFilterView({
selectedEditor: this.editorFilter,
bundles: app.bundleRepository.get("bundles").models
}), this.$("#bundle-shortcut-filters").html(n.render().el), this.selectedShortcutsTableView = new ShortcutsTableView({
collection: this.selectedShortcuts,
button: "remove",
tableId: "selected-shortcuts",
editOnClick: !1
}), this.$("#selected-shortcuts-container").html(this.selectedShortcutsTableView.render().el), this.unselectedShortcuts.editorFilter = this.editorFilter, this.filteredShortcuts = this.unselectedShortcuts, this.searchShortcutsTableView = new ShortcutsTableView({
collection: this.unselectedShortcuts.applyFilters(),
button: "add",
tableId: "unselected-shortcuts",
editOnClick: !1
}), this.$("#search-shortcuts").html(this.searchShortcutsTableView.render().el), this.editorPicker = new window.EditorPickerView({
selectedEditor: this.editorFilter
}), this.$("#editor").replaceWith(this.editorPicker.render().el), this.$("#bundle-name").val(this.bundle.get("name")), setTimeout(function () {
return r.$(".filters").css({
top: r.$("#search-shortcuts").position().top
}), r.selectedShortcuts.length === 0 ? $("#no-shortcuts-selected").fadeIn(0) : $("#no-shortcuts-selected").fadeOut(0)
}, 0), this
}, t.prototype.filterBundle = function (e) {
return this.bundleFilter = e, this.applyFilters()
}, t.prototype.filterEditor = function (e) {
return this.editorFilter = e, this.bundleFilter = "Any", this.applyFilters()
}, t.prototype.filterAccuracy = function (e) {
return this.accuracyFilter = e, this.applyFilters()
}, t.prototype.applyFilters = function () {
return this.filteredShortcuts = this.unselectedShortcuts, this.filteredShortcuts.editorFilter = this.editorFilter || "Any", this.filteredShortcuts.bundleFilter = this.bundleFilter || "Any", this.filteredShortcuts.accuracyFilter = this.accuracyFilter || "Any", this.filteredShortcuts = this.filteredShortcuts.applyFilters(), this.searchShortcutsTableView.collection = this.filteredShortcuts, this.searchShortcutsTableView.render()
}, t.prototype.undoFilters = function () {
return this.editorFilter = app.user.defaultEditor, this.accuracyFilter = "Any", this.bundleFilter = "Any", this.applyFilters()
}, t.prototype.keyAdded = function (e) {
var t, n, r, i, s = this;
return i = e.currentTarget.id, r = $(e.currentTarget).parent().parent(), n = r.find("a").first(), t = r.find("i").first(), r.find(".settings-toggle").css("opacity", "0"), r.fadeOut("fast", function () {
return t.hasClass("icon-minus") ? (s.filteredShortcuts.passesFilters(app.keys[i]) && $("#unselected-shortcuts").prepend(r), t.removeClass("icon-minus"), n.removeClass("btn-danger"), n.addClass("btn-info"), t.addClass("icon-plus"), s.filteredShortcuts.passesFilters(app.keys[i]) && r.fadeIn("fast"), s.selectedShortcuts.remove(app.keys[i]), s.unselectedShortcuts.add(app.keys[i]), s.searchShortcutsTableView.collection.add(app.keys[i]), s.selectedShortcuts.length < 2 && ($("#shortcuts-help").html("Please add at least 2 shortcuts"), $("#shortcuts-control-group").addClass("error")), s.selectedShortcuts.length === 0 && $("#no-shortcuts-selected").fadeIn()) : ($("#selected-shortcuts").append(r), t.removeClass("icon-plus"), n.removeClass("btn-info"), n.addClass("btn-danger"), t.addClass("icon-minus"), r.fadeIn("fast"), s.selectedShortcuts.add(app.keys[i]), s.searchShortcutsTableView.collection.remove(app.keys[i]), s.unselectedShortcuts.remove(app.keys[i]), $("#no-shortcuts-selected").fadeOut(), s.selectedShortcuts.length > 1 && ($("#shortcuts-help").html(""), $("#shortcuts-control-group").removeClass("error"))), s.$(".filters").animate({
top: s.$("#search-shortcuts").position().top
})
})
}, t.prototype.save = function () {
var e, t, n, r, i, s;
n = !1, t = $("#bundle-name").val();
if (!t || !t.match(/\S/)) $("#name-help").html("Please enter a name"), $("#name-control-group").addClass("error"), $("body").scrollTop(0), n = !0;
this.selectedShortcuts.length < 2 && ($("#shortcuts-help").html("Please add at least 2 shortcuts"), $("#shortcuts-control-group").addClass("error"), $("body").scrollTop(0), n = !0);
if (!n) return r = app.user.logNum === 9987278364 && $("#locked").is(":checked"), e = app.user.logNum === 9987278364 && $("#all").is(":checked"), s = app.user.logNum === 9987278364 && $("#stay").is(":checked"), i = this.selectedShortcuts.map(function (e) {
return e.get("parentId")
}), this.bundle.set({
shortcuts: i,
name: t,
editor: this.editorPicker.editorName()
}), r && this.bundle.set("locked", r), e && this.bundle.set("all", e), app.bundleRepository.saveOrUpdate(this.bundle), s ? (this.bundle = new window.Bundle, this.selectedShortcuts = new window.Shortcuts, this.unselectedShortcuts = new window.Shortcuts(app.shortcutRepository.shortcutsNotInBundle(this.bundle)), this.render()) : app.navigate("app/bundles", {
trigger: !0
})
}, t.prototype.nameChanged = function () {
var e;
return e = $("#bundle-name").val(), !e || !e.match(/\S/) ? ($("#name-help").html("Please enter a name"), $("#name-control-group").addClass("error")) : ($("#name-help").html(""), $("#name-control-group").removeClass("error"))
}, t.prototype.resetStats = function () {
return $("#action-confirmation-title").html("Confirm Reset"), $("#action-confirmation-header").html("Are you sure you want to reset this bundle?"), $("#action-confirmation-body").html("This will reset the accuracy of all the shortcuts contained in this bundle."), $("#action-confirmation-button").html("Reset this bundle"), $("#action-modal").modal("show")
}, t.prototype.resetStatsConfirmed = function () {
var e, t;
return typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Reset Stats", (t = this.bundle) != null ? t.get("name") : void 0]), e = [], this.selectedShortcuts.each(function (t) {
var n, r, i;
i = app.keys[t.get("parentId")];
if (i.get("numCorrect") > 0 || i.get("numIncorrect") > 0) return i.set("numCorrect", 0), i.set("numIncorrect", 0), e.push(i.toStatJSON()), r = $("tr#" + i.get("parentId")), n = r.find(".shortcut-accuracy"), n.html("--")
}), e.length > 0 && app.user.nextDrill === 9344 && $.ajax({
url: "/api/stats.json",
type: "POST",
data: JSON.stringify(e),
mimeType: "application/json",
contentType: "application/json"
}), $("#action-modal").modal("hide")
}, t.prototype.removeBundleConfirmed = function () {
var e, t = this;
return typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Bundles", "Delete", (e = this.bundle) != null ? e.get("name") : void 0]), $("#action-modal").on("hidden", function () {
return app.user.nextDrill === 9344 && $.post("/api/bundles/" + t.bundle.get("parentId") + "/remove.json"), app.bundleRepository.get("bundles").remove(t.bundle), app.navigate("app/bundles", {
trigger: !0
})
}), $("#action-modal").modal("hide")
}, t.prototype.removeBundle = function () {
return $("#action-confirmation-title").html("Confirm Delete"), $("#action-confirmation-header").html("Are you sure you want to delete this bundle?"), $("#action-confirmation-body").html("Note: Deleting this bundle will not delete it's shortcuts"), $("#action-confirmation-button").html("Delete this bundle"), $("#action-modal").modal("show")
}, t.prototype.performAction = function (e) {
var t;
t = $(e.currentTarget).text(), t === "Reset this bundle" && this.resetStatsConfirmed();
if (t === "Delete this bundle") return this.removeBundleConfirmed()
}, t.prototype.cancelAction = function () {
return $("#action-modal").modal("hide")
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.EditBundlesView = function (e) {
function t() {
var e = this;
return this.undoFilters = function () {
return t.prototype.undoFilters.apply(e, arguments)
}, this.applyFilters = function () {
return t.prototype.applyFilters.apply(e, arguments)
}, this.filterAccuracy = function (n) {
return t.prototype.filterAccuracy.apply(e, arguments)
}, this.filterEditor = function (n) {
return t.prototype.filterEditor.apply(e, arguments)
}, this.render = function () {
return t.prototype.render.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/editbundlesview"], t.prototype.id = "bundles", t.prototype.events = {
"click #add-new-bundle": "addNewBundle",
"click #undo-filters": "undoFilters"
}, t.prototype.initialize = function () {
var e = this;
return app.dispatcher.on("bundleLoaded", function (t) {
return e.editBundle(t)
}), app.dispatcher.on("bundleUpdated", this.render), app.dispatcher.on("editorChanged", this.filterEditor), app.dispatcher.on("accuracyFiltered", this.filterAccuracy)
}, t.prototype.render = function () {
var e;
return $(this.el).html(this.template({})), this.editorFilter = app.user.defaultEditor, this.unfilteredBundles = app.bundleRepository.get("bundles"), this.filteredBundles = this.unfilteredBundles, e = new BundlesFilterView({
selectedEditor: this.editorFilter
}), this.$("#bundle-filters").html(e.render().el), this.applyFilters(), this
}, t.prototype.drawBundles = function () {
var e = this;
this.$("#bundle-items").html(""), this.filteredBundles.each(function (t) {
var n;
return n = new BundleView({
model: t,
id: t.get("id")
}), e.$("#bundle-items").append(n.render().el)
});
if (this.filteredBundles.length === 0) return this.$("#bundle-items").html("<p style=\"margin-left: 120px; color: gray; font-family: 'Architects Daughter', cursive; font-size: 20px\">No more bundles. <a id='undo-filters'>Undo filters.</a></p>")
}, t.prototype.addNewBundle = function () {
return app.navigate("app/bundles/new", {
trigger: !0
})
}, t.prototype.editBundle = function (e) {
return app.navigate("app/bundles/" + e.get("parentId"), {
trigger: !0
})
}, t.prototype.filterEditor = function (e) {
return this.editorFilter = e, this.applyFilters()
}, t.prototype.filterAccuracy = function (e) {
return this.accuracyFilter = e, this.applyFilters()
}, t.prototype.applyFilters = function () {
return this.filteredBundles = this.unfilteredBundles, this.filteredBundles.editorFilter = this.editorFilter || "Any", this.filteredBundles.accuracyFilter = this.accuracyFilter || "Any", this.filteredBundles = this.filteredBundles.applyFilters(), this.drawBundles()
}, t.prototype.undoFilters = function () {
return app.dispatcher && app.dispatcher.trigger("undoFilters"), this.editorFilter = app.user.defaultEditor, this.accuracyFilter = "Any", this.applyFilters()
}, t.prototype.leave = function () {
return this.off(), this.stopListening(), this.remove()
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.BundleListView = function (e) {
function t() {
var e = this;
return this.undoFilters = function () {
return t.prototype.undoFilters.apply(e, arguments)
}, this.applyFilters = function () {
return t.prototype.applyFilters.apply(e, arguments)
}, this.filterAccuracy = function (n) {
return t.prototype.filterAccuracy.apply(e, arguments)
}, this.filterEditor = function (n) {
return t.prototype.filterEditor.apply(e, arguments)
}, this.render = function () {
return t.prototype.render.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/bundlelistview"], t.prototype.id = "bundles", t.prototype.initialize = function () {
return app.dispatcher.on("editorChanged", this.filterEditor), app.dispatcher.on("accuracyFiltered", this.filterAccuracy), app.dispatcher.on("undoFilters", this.undoFilters)
}, t.prototype.render = function () {
var e;
return $(this.el).html(this.template({
name: this.options.name,
helpTitle: this.options.helpTitle,
helpText: this.options.helpText
})), this.editorFilter = app.user.defaultEditor, this.unfilteredBundles = app.bundleRepository.get("bundles"), this.filteredBundles = this.unfilteredBundles, e = new BundlesFilterView({
selectedEditor: this.editorFilter
}), this.$("#bundle-filters").html(e.render().el), this.applyFilters(), this
}, t.prototype.drawBundles = function () {
var e = this;
this.$("#bundle-items").html(""), this.filteredBundles.each(function (t) {
var n;
return n = new BundleView({
model: t,
id: t.id
}), e.$("#bundle-items").append(n.render().el)
});
if (this.filteredBundles.length === 0) return this.$("#bundle-items").html("<p style=\"margin-left: 120px; color: gray; font-family: 'Architects Daughter', cursive; font-size: 20px\">No more bundles. <a id='undo-filters'>Undo filters.</a></p>")
}, t.prototype.addNewBundle = function () {
return app.navigate("app/bundles/new", {
trigger: !0
})
}, t.prototype.editBundle = function (e) {
return app.navigate("app/bundles/" + e.id, {
trigger: !0
})
}, t.prototype.filterEditor = function (e) {
return this.editorFilter = e, this.applyFilters()
}, t.prototype.filterAccuracy = function (e) {
return this.accuracyFilter = e, this.applyFilters()
}, t.prototype.applyFilters = function () {
return this.filteredBundles = this.unfilteredBundles, this.filteredBundles.editorFilter = this.editorFilter || "Any", this.filteredBundles.accuracyFilter = this.accuracyFilter || "Any", this.filteredBundles = this.filteredBundles.applyFilters(), this.drawBundles()
}, t.prototype.undoFilters = function () {
return this.editorFilter = app.user.defaultEditor, this.accuracyFilter = "Any", this.applyFilters()
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.NewBundleView = function (e) {
function t() {
var e = this;
return this.render = function () {
return t.prototype.render.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/newbundleview"], t.prototype.id = "new-bundle", t.prototype.events = {
"click .add-key": "keyAdded",
"click #save": "save",
"keyup #bundle-name": "nameChanged"
}, t.prototype.initialize = function () {
var e = this;
return this.selectedShortcuts = [], this.unselectedShortcuts = [], _.each(app.keys, function (t, n) {
return e.unselectedShortcuts.push({
id: n,
description: t.get("description") || t.get("desc"),
sequence: t.get("sequence") || t.get("key"),
accuracy: t.accuracy()
})
})
}, t.prototype.render = function () {
return $(this.el).html(this.template({
keys: this.unselectedShortcuts
})), this
}, t.prototype.keyAdded = function (e) {
var t, n, r, i, s = this;
return i = e.currentTarget.id, r = $(e.currentTarget).parent().parent(), n = r.find("a"), t = r.find("i"), r.fadeOut("fast", function () {
return t.hasClass("icon-minus") ? ($("#unselected-shortcuts").prepend(r), t.removeClass("icon-minus"), n.removeClass("btn-danger"), n.addClass("btn-info"), t.addClass("icon-plus"), r.fadeIn("fast"), s.selectedShortcuts = _.reject(s.selectedShortcuts, function (e) {
return e === app.keys[i]
})) : ($("#selected-shortcuts").append(r), t.removeClass("icon-plus"), n.removeClass("btn-info"), n.addClass("btn-danger"), t.addClass("icon-minus"), r.fadeIn("fast"), s.selectedShortcuts.push(app.keys[i]))
})
}, t.prototype.save = function () {
var e, t, n;
return t = $("#bundle-name").val(), !t || !t.match(/\S/) ? ($("#name-help").html("Please enter a name"), $("#name-control-group").addClass("error"), $("body").scrollTop(0)) : (n = _.map(this.selectedShortcuts, function (e) {
return e.get("parentId") || e.id
}), e = new Bundle({
shortcuts: n,
name: t
}), app.bundleRepository.create(e))
}, t.prototype.nameChanged = function () {
var e;
return e = $("#bundle-name").val(), !e || !e.match(/\S/) ? ($("#name-help").html("Please enter a name"), $("#name-control-group").addClass("error")) : ($("#name-help").html(""), $("#name-control-group").removeClass("error"))
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.BundleView = function (e) {
function t() {
var e = this;
return this.mouseMove = function (n) {
return t.prototype.mouseMove.apply(e, arguments)
}, this.render = function () {
return t.prototype.render.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/bundleview"], t.prototype.className = "bundle", t.prototype.events = {
click: "clicked",
mousemove: "mouseMove"
}, t.prototype.initialize = function () {
var e = this;
return this.selectedShortcuts = [], _.each(this.model.get("shortcuts"), function (t) {
var n;
n = app.keys[t];
if (n && !n.get("removed")) return e.selectedShortcuts.push(n)
})
}, t.prototype.render = function () {
var e, t;
return this.id = this.model.get("id"), $(this.el).html(this.template({
bundle: this.model.toJSON(),
accuracy: this.model.accuracy(),
length: this.selectedShortcuts.length
})), this.$(".bundle-shortcut-description").html((e = this.selectedShortcuts[0]) != null ? e.get("description") : void 0), this.$(".bundle-shortcut-keys").html((t = this.selectedShortcuts[0]) != null ? t.toString() : void 0), this
}, t.prototype.clicked = function () {
return app.dispatcher.trigger("bundleLoaded", this.model)
}, t.prototype.mouseMove = function (e) {
var t, n, r, i;
t = this.selectedShortcuts.length, n = 156 / t, e.offsetX ? i = e.offsetX : i = e.pageX - e.currentTarget.offsetLeft - 195, r = Math.floor(i / n);
if (this.selectedShortcuts[r]) return this.$(".bundle-shortcut-description").html(this.selectedShortcuts[r].get("description")), this.$(".bundle-shortcut-keys").html(this.selectedShortcuts[r].toString())
}, t
}(Backbone.View)
}.call(this),
function () {
var e = {}.hasOwnProperty,
t = function (t, n) {
function i() {
this.constructor = t
}
for (var r in n) e.call(n, r) && (t[r] = n[r]);
return i.prototype = n.prototype, t.prototype = new i, t.__super__ = n.prototype, t
};
window.DemoEditorView = function (e) {
function n() {
return n.__super__.constructor.apply(this, arguments)
}
return t(n, e), n.prototype.template = JST["backbone/templates/demoeditorview"], n.prototype.events = {
"click .demo-editor-pick": "editorSelected"
}, n.prototype.render = function () {
return $(this.el).html(this.template({
editors: [{
displayName: "Vim",
idTag: "Vim"
}, {
displayName: "Emacs",
idTag: "Emacs"
}, {
displayName: "TextMate",
idTag: "TextMate"
}, {
displayName: "Sublime Text",
idTag: "SublimeText"
}, {
displayName: "Xcode",
idTag: "XCode"
}, {
displayName: "Visual Studio",
idTag: "VisualStudio"
}, {
displayName: "Command Line",
idTag: "CommandLine"
}
]
})), this.$("#CommandLine").css("margin-left", "108px"), this
}, n.prototype.editorSelected = function (e) {
var t, n;
return t = e.currentTarget, n = t.id, $("#what_do_you_want_to_learn").animate({
"margin-top": "0px"
}, 200), $(t).animate({
opacity: "0"
}, 400, function () {
return app.dispatcher.trigger("demoEditorSelected", n)
}), $(".demo-editor-pick").each(function (e) {
var t;
t = $(this).attr("id");
if (t !== n) return $(this).animate({
opacity: "0"
}, 100)
})
}, n
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.DemoStartView = function (e) {
function t() {
var e = this;
return this.keyPressedDown = function (n) {
return t.prototype.keyPressedDown.apply(e, arguments)
}, this.keyPressed = function (n) {
return t.prototype.keyPressed.apply(e, arguments)
}, this.handleKeyEvent = function (n, r, i) {
return t.prototype.handleKeyEvent.apply(e, arguments)
}, this.shortcutFailed = function (n) {
return t.prototype.shortcutFailed.apply(e, arguments)
}, this.shortcutSucceeded = function (n) {
return t.prototype.shortcutSucceeded.apply(e, arguments)
}, this.decrementCommands = function () {
return t.prototype.decrementCommands.apply(e, arguments)
}, this.startDemoDrill = function () {
return t.prototype.startDemoDrill.apply(e, arguments)
}, this.nextLevel = function () {
return t.prototype.nextLevel.apply(e, arguments)
}, this.keypressFailed = function (n, r) {
return t.prototype.keypressFailed.apply(e, arguments)
}, this.appendRestOfKeys = function () {
return t.prototype.appendRestOfKeys.apply(e, arguments)
}, this.drawAllKeys = function () {
return t.prototype.drawAllKeys.apply(e, arguments)
}, this.drawTypedKeys = function () {
return t.prototype.drawTypedKeys.apply(e, arguments)
}, this.keypressSucceeded = function (n, r) {
return t.prototype.keypressSucceeded.apply(e, arguments)
}, this.timeChanged = function (n) {
return t.prototype.timeChanged.apply(e, arguments)
}, this.gameEnded = function () {
return t.prototype.gameEnded.apply(e, arguments)
}, this.gameStarted = function () {
return t.prototype.gameStarted.apply(e, arguments)
}, this.animateCountDown = function () {
return t.prototype.animateCountDown.apply(e, arguments)
}, this.drawCountDown = function () {
return t.prototype.drawCountDown.apply(e, arguments)
}, this.retry = function () {
return t.prototype.retry.apply(e, arguments)
}, this.scpmChanged = function (n) {
return t.prototype.scpmChanged.apply(e, arguments)
}, this.accuracyChanged = function (n) {
return t.prototype.accuracyChanged.apply(e, arguments)
}, this.streakIncreased = function (n) {
return t.prototype.streakIncreased.apply(e, arguments)
}, this.setHeaderText = function (n, r) {
return t.prototype.setHeaderText.apply(e, arguments)
}, this.render = function () {
return t.prototype.render.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/demostartview"], t.prototype.render = function () {
var e = this;
return this.isGameStarted = !1, this.initializeGame(this.options.name), mixpanel.track("Demo Started", {
editor: this.options.name
}), this.commandsLeft = 5, this.level = 1, app.dispatcher.on("gameStarted", this.gameStarted), app.dispatcher.on("keypressSucceeded", this.keypressSucceeded), app.dispatcher.on("keypressFailed", this.keypressFailed), app.dispatcher.on("shortcutSucceeded", this.shortcutSucceeded), app.dispatcher.on("shortcutFailed", this.shortcutFailed), app.dispatcher.on("timeChanged", this.timeChanged), app.dispatcher.on("gameEnded", this.gameEnded), app.dispatcher.on("streakIncreased", this.streakIncreased), app.dispatcher.on("accuracyChanged", this.accuracyChanged), app.dispatcher.on("scpmChanged", this.scpmChanged), $(this.el).html(this.template({
isWin7: this.isWindows7orLess()
})), setTimeout(function () {
return e.setInitialDemoText(e.options.name), $("#demo-help-footer").html("<br \\>Type " + e.commandsLeft + " more commands correctly."), window.loadSocialButtons(), $.getScript("//platform.twitter.com/widgets.js"), typeof FB != "undefined" && FB !== null ? FB.XFBML.parse() : void 0
}, 0), this.initializePractice(), this
}, t.prototype.isWindows7orLess = function () {
var e;
return e = navigator.userAgent, $.browser.msie || e.indexOf("Windows NT 7.0") !== -1 || e.indexOf("Windows NT 6.1") !== -1 || e.indexOf("Windows NT 5.1") !== -1 || e.indexOf("Windows XP") !== -1
}, t.prototype.setInitialDemoText = function (e) {
e === "vim" && $("#demo-help").html("We'll start by practicing some basic Vim text navigation commands. <br \\><br \\>Type the keys to the left that match the command description."), e === "emacs" && $("#demo-help").html("We'll start by practicing some basic Emacs text navigation commands. <br \\><br \\>Type the keys to the left that match the command description."), e === "textmate" && $("#demo-help").html("We'll start by practicing some basic TextMate text editing commands. <br \\><br \\>Type the keys to the left that match the command description."), e === "xcode" && $("#demo-help").html("We'll start by practicing some basic XCode text navigation commands. <br \\><br \\>Type the keys to the left that match the command description."), e === "visualstudio" && $("#demo-help").html("We'll start by practicing some basic Visual Studio text editing commands. <br \\><br \\>Type the keys to the left that match the command description."), e === "sublimetext" && $("#demo-help").html("We'll start by practicing some basic Sublime Text text editing commands. <br \\><br \\>Type the keys to the left that match the command description."), e === "commandline" && $("#demo-help").html("We'll start by practicing some Command Line system commands and shortcuts. <br \\><br \\>Type the keys to the left that match the command description."), e === "photoshop" && $("#demo-help").html("We'll start by practicing some Photoshop toolbar shortcuts. <br \\><br \\>Type the keys to the left that match the shortcut description."), e === "zendesk" && $("#demo-help").html("We'll start by practicing some Zendesk navigation shortcuts. <br \\><br \\>Type the keys to the left that match the shortcut description."), e === "eclipse" && $("#demo-help").html("We'll start by practicing some Eclipse text editing shortcuts. <br \\><br \\>Type the keys to the left that match the shortcut description."), e === "gmail" && ($("#demo-help").html("We'll start by practicing some Gmail navigation shortcuts. <br \\><br \\>Type the keys to the left that match the shortcut description."), $("#gmail-enable").show()), e === "intellijidea" && $("#demo-help").html("We'll start by practicing some IntelliJ IDEA editor shortcuts. <br \\><br \\>Type the keys to the left that match the shortcut description."), e === "rubymine" && $("#demo-help").html("We'll start by practicing some RubyMine editor shortcuts. <br \\><br \\>Type the keys to the left that match the shortcut description."), e === "appcode" && $("#demo-help").html("We'll start by practicing some AppCode editor shortcuts. <br \\><br \\>Type the keys to the left that match the shortcut description."), e === "pycharm" && $("#demo-help").html("We'll start by practicing some PyCharm editor shortcuts. <br \\><br \\>Type the keys to the left that match the shortcut description."), e === "webstorm" && $("#demo-help").html("We'll start by practicing some WebStorm/PhpStorm editor shortcuts. <br \\><br \\>Type the keys to the left that match the shortcut description."), e === "resharper" && $("#demo-help").html("We'll start by practicing some ReSharper shortcuts. <br \\><br \\>Type the keys to the left that match the shortcut description."), e === "excel" && $("#demo-help").html("We'll start by practicing some Excel shortcuts. <br \\><br \\>Type the keys to the left that match the shortcut description.");
if (e === "git") return $("#demo-help").html("We'll start by practicing some basic Git commands. <br \\><br \\>Type the keys to the left that match the command description.")
}, t.prototype.initializeGame = function (e) {
return e === "emacs" && (this.game = new VIMGame({
shortcuts: window.demo.emacsIds,
isDemo: !0
})), e === "vim" && (this.game = new VIMGame({
shortcuts: window.demo.vimIds,
isDemo: !0
})), e === "textmate" && (this.game = new VIMGame({
shortcuts: window.demo.textmateIds,
isDemo: !0
})), e === "xcode" && (this.game = new VIMGame({
shortcuts: window.demo.xcodeIds,
isDemo: !0
})), e === "visualstudio" && (this.game = new VIMGame({
shortcuts: window.demo.vsIds,
isDemo: !0
})), e === "commandline" && (this.game = new VIMGame({
shortcuts: window.demo.commandLineIds,
isDemo: !0
})), e === "photoshop" && (this.game = new VIMGame({
shortcuts: window.demo.photoshopIds,
isDemo: !0
})), e === "zendesk" && (this.game = new VIMGame({
shortcuts: window.demo.zendeskIds,
isDemo: !0
})), e === "gmail" && (this.game = new VIMGame({
shortcuts: window.demo.gmailIds,
isDemo: !0
})), e === "sublimetext" && /Mac/.test(navigator.userAgent) && (this.game = new VIMGame({
shortcuts: window.demo.stMacIds,
isDemo: !0
})), e === "sublimetext" && !/Mac/.test(navigator.userAgent) && (this.game = new VIMGame({
shortcuts: window.demo.stWinIds,
isDemo: !0
})), e === "eclipse" && /Mac/.test(navigator.userAgent) && (this.game = new VIMGame({
shortcuts: window.demo.eclipseMacIds,
isDemo: !0
})), e === "eclipse" && !/Mac/.test(navigator.userAgent) && (this.game = new VIMGame({
shortcuts: window.demo.eclipseWinIds,
isDemo: !0
})), e === "intellijidea" && /Mac/.test(navigator.userAgent) && (this.game = new VIMGame({
shortcuts: window.demo.intellijMacIds,
isDemo: !0
})), e === "intellijidea" && !/Mac/.test(navigator.userAgent) && (this.game = new VIMGame({
shortcuts: window.demo.intellijWinIds,
isDemo: !0
})), e === "webstorm" && /Mac/.test(navigator.userAgent) && (this.game = new VIMGame({
shortcuts: window.demo.webstormMacIds,
isDemo: !0
})), e === "webstorm" && !/Mac/.test(navigator.userAgent) && (this.game = new VIMGame({
shortcuts: window.demo.webstormWinIds,
isDemo: !0
})), e === "rubymine" && /Mac/.test(navigator.userAgent) && (this.game = new VIMGame({
shortcuts: window.demo.rubymineMacIds,
isDemo: !0
})), e === "rubymine" && !/Mac/.test(navigator.userAgent) && (this.game = new VIMGame({
shortcuts: window.demo.rubymineWinIds,
isDemo: !0
})), e === "appcode" && (this.game = new VIMGame({
shortcuts: window.demo.appcodeIds,
isDemo: !0
})), e === "pycharm" && /Mac/.test(navigator.userAgent) && (this.game = new VIMGame({
shortcuts: window.demo.pycharmMacIds,
isDemo: !0
})), e === "pycharm" && !/Mac/.test(navigator.userAgent) && (this.game = new VIMGame({
shortcuts: window.demo.pycharmWinIds,
isDemo: !0
})), e === "resharper" && (this.game = new VIMGame({
shortcuts: window.demo.resharperIds,
isDemo: !0
})), e === "excel" && (this.game = new VIMGame({
shortcuts: window.demo.excelIds,
isDemo: !0
})), e === "git" && (this.game = new VIMGame({
shortcuts: window.demo.gitIds,
isDemo: !0
})), app.demoGame = this.game
}, t.prototype.setHeaderText = function (e, t) {}, t.prototype.cancelDrawKeyTimeout = function () {
if (this.timeoutId) return window.clearTimeout(this.timeoutId)
}, t.prototype.drawKeysAfterTimeout = function () {
var e = this;
return this.keysDrawn = !1, this.cancelDrawKeyTimeout(), this.timeoutId = window.setTimeout(function () {
return e.appendRestOfKeys(), e.keysDrawn = !0
}, 1800)
}, t.prototype.initializePractice = function () {
return this.keyDisplay = "show", this.previousShortcuts = [], this.startGame(), this.isGameStarted = !0
}, t.prototype.timerUp = function () {
return this.game.increaseTime()
}, t.prototype.timerDown = function () {
return this.game.decreaseTime()
}, t.prototype.streakIncreased = function (e) {
return this.$("#drills-longest-streak").html("Longest Streak: <span class='demo-stat-val'>" + e + "</span>")
}, t.prototype.accuracyChanged = function (e) {
return this.$("#drills-accuracy").html("Accuracy: <span class='demo-stat-val'>" + e + "</span>")
}, t.prototype.scpmChanged = function (e) {
return this.$("#drills-scpm").html("SCPM: <span class='demo-stat-val'>" + e + "</span>")
}, t.prototype.stopTimers = function () {
return this.cursorBlink && clearInterval(this.cursorBlink), this.countDownTimer && clearInterval(this.countDownTimer), this.game.stopTimer()
}, t.prototype.blinkCursor = function () {
return $(".blinking-cursor").animate({
opacity: "toggle"
}, "fast", "swing")
}, t.prototype.startstop = function () {
this.isGameStarted ? (this.keyDisplay === "delay" && this.cancelDrawKeyTimeout(), this.game.endGame(), this.isGameStarted = !1) : (this.startGame(), this.isGameStarted = !0)
}, t.prototype.retry = function () {
return this.resetFields(), this.startstop()
}, t.prototype.resetFields = function () {
return this.$("#startstop").html("Stop"), this.$("#demo-current-shortcut .description").html(""), this.$("#startstop").removeClass("btn-success"), this.$("#startstop").addClass("btn-danger"), this.$("#demo-current-shortcut .keys").html("<span class='blinking-cursor'>|</span>"), this.$("#drills-longest-streak").html("Longest Streak: <span class='demo-stat-val'>0</span>"), this.$("#drills-accuracy").html("Accuracy: <span class='demo-stat-val'>N/A</span>"), this.$("#drills-scpm").html("SCPM: <span class='demo-stat-val'>0</span>"), this.$("#demo-previous-shortcut").empty(), this.game.resetTime()
}, t.prototype.drawCountDown = function () {
this.countDown -= 1, this.animateCountDown(), this.countDown === 0 && (this.startGame(), clearInterval(this.countDownTimer))
}, t.prototype.animateCountDown = function () {
var e, t = this;
return e = "90px", this.$("#count-down").animate({
opacity: "0",
left: "-80px"
}, 0), this.countDown === 0 ? this.$("#count-down").html("<img src='https://d2r64hzyhllbrg.cloudfront.net/ninja-alone.png' style='height: 200px; margin-top: -70px;'></img>") : (this.$("#count-down").html(this.countDown), e = "180px"), this.$("#count-down").animate({
opacity: "1",
left: e
}, 200, "easeOutQuart", function () {
return t.countDown === 0 ? t.$("#count-down").animate({
left: "+=90PX",
opacity: "0"
}, 200, function () {
return t.$("#count-down").empty()
}) : t.$("#count-down").animate({
opacity: "0"
}, 200)
})
}, t.prototype.startGame = function () {
var e = this;
return this.resetFields(), this.game.start(!0), this.cursorBlink = setInterval(function () {
return e.blinkCursor()
}, 600)
}, t.prototype.gameStarted = function () {
return app.dispatcher.on("keyPressed", this.handleKeyEvent), this.displayCurrentAndNextShortcuts()
}, t.prototype.gameEnded = function () {
app.dispatcher.off("keyPressed", this.handleKeyEvent), this.$("#startstop").removeClass("btn-danger"), this.$("#startstop").addClass("btn-success"), this.isGameStarted = !1;
if (this.cursorBlink) return clearInterval(this.cursorBlink)
}, t.prototype.timeChanged = function (e) {
var t, n, r, i, s, o;
i = this.game.elapsedTime, o = 15 - i, n = Math.floor(o / 60), r = o % 60, r < 10 && (r = "0" + r), s = n + ":" + r, o > 0 && o < 4 ? t = "red" : t = "black", this.$("#demo-drill-timer").html("Time Left: <span class='demo-stat-val' style='font-weight: bold; color: " + t + "'>" + s + "</span>");
if (o <= 0 && this.level === 3) return this.nextLevel()
}, t.prototype.keypressSucceeded = function (e, t) {
this.$(".blinking-cursor").remove();
if (this.keyDisplay === "show" || this.keysDrawn && this.keyDisplay !== "hide") return this.$("#demo-current-shortcut .keys").html("<span class='correct-key'>" + (t.previousKeys() + t.currentKeyToString()) + "</span><div style='display: inline-block; width: 1px'><span class='blinking-cursor'>|</span></div><span class='untyped-keys'>" + t.remainingKeys() + "</span>");
this.$("#demo-current-shortcut .keys").html("<span class='correct-key'>" + (t.previousKeys() + t.currentKeyToString()) + "</span><div style='display: inline-block; width: 1px'><span class='blinking-cursor'>|</span></div>");
if (this.keyDisplay === "delay") return this.drawKeysAfterTimeout()
}, t.prototype.drawTypedKeys = function () {
return this.$("#demo-current-shortcut .keys").html("<span class='correct-key'>" + this.game.currentShortcut().previousKeys() + "</span><div style='display: inline-block; width: 1px'><span class='blinking-cursor'>|</span></div>")
}, t.prototype.drawAllKeys = function () {
return this.$("#demo-current-shortcut .keys").html("<span class='correct-key'>" + this.game.currentShortcut().previousKeys() + "</span><div style='display: inline-block; width: 1px'><span class='blinking-cursor'>|</span></div><span class='untyped-keys'>" + (this.game.currentShortcut().currentKeyToString() + this.game.currentShortcut().remainingKeys()) + "</span>")
}, t.prototype.appendRestOfKeys = function () {
return this.$("#demo-current-shortcut .keys").html("<span class='correct-key'>" + this.game.currentShortcut().previousKeys() + "</span><div style='display: inline-block; width: 1px'><span class='blinking-cursor'>|</span></div><span class='untyped-keys fade-in'>" + (this.game.currentShortcut().currentKeyToString() + this.game.currentShortcut().remainingKeys()) + "</span>"), this.$(".fade-in").animate({
opacity: 1
}, 300)
}, t.prototype.keypressFailed = function (e, t) {
return this.$("#demo-current-shortcut .keys").html("<span class='correct-key'>" + t.previousKeys() + "<span class='incorrect-key'>" + t.currentKeyToString() + "</span>")
}, t.prototype.nextLevel = function () {
var e = this;
if (this.level === 3) {
typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Demo", "Completed"]), $("#demo-drill-shortcuts").animate({
opacity: .3
}), $("#practice-options").animate({
opacity: .3
}), this.setHeaderText("Demo Complete!"), $("#demo-help-footer").html("Congratulations! <br \\><span style='font-size:14px'>You completed the tutorial.<br \\>Check out <a id='demo-go-home' style='cursor: pointer'>Home</a> as a guest<br \\> or <a id='demo-sign-up' style='cursor:pointer'>Sign Up</a> now!</span>"), $("#demo-go-home").click(function () {
return typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Demo", "Go Home"]), app.navigate("/app", {
trigger: !0
})
}), $("#demo-sign-up").click(function () {
return typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Demo", "Sign Up"]), app.navigate("/app/plans", {
trigger: !0
})
}), $("#demo-try-again").click(function () {
return app.dispatcher.trigger("demoTryAgain")
}), this.startstop();
return
}
if (this.level === 2) {
typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Demo", "Level Up", "Level 3"]), this.startstop(), this.level = 3, this.commandsLeft = 5, this.keyDisplay = "hide", this.setHeaderText("Now lets try drill mode"), $("#demo-drill-stats").animate({
opacity: 0
}, function () {
return $("#demo-help").html("Drill mode will keep track of your stats for each shortcut. Lets try a 15 second drill. Press 'Start Drill!' when you are ready!"), $("#demo-help-footer").html("<br \\><a class='btn btn-large btn-inverse' style='font-weight: bold' id='start-demo-drill'>Start Drill!</a>"), $("#demo-drill-stats").animate({
opacity: 1
}), $("#demo-drill-shortcuts").animate({
opacity: .3
}), $("#practice-options").animate({
opacity: .3
}), $("#start-demo-drill").click(e.startDemoDrill)
});
return
}
this.level === 1 && (typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Demo", "Level Up", "Level 2"]), this.level = 2, this.commandsLeft = 5, this.keyDisplay = "delay", $("#demo-drill-stats").animate({
opacity: 0
}, function () {
return $("#demo-help").html("Great job! <br \\><br \\>Practice mode can also fade in the answers to give you a chance to answer correctly. Let's try that now."), $("#demo-help-footer").html("<br \\>Type " + e.commandsLeft + " more commands correctly."), $("#demo-drill-stats").animate({
opacity: 1
})
}))
}, t.prototype.startDemoDrill = function () {
return $("#demo-drill-shortcuts").animate({
opacity: 1
}, 0), $("#practice-options").animate({
opacity: 1
}, 0), $("#demo-help").html("<div class='well'><div id='demo-drill-timer' class='demo-stat'></div><div id='drills-longest-streak' class='demo-stat'></div><div id='drills-accuracy' class='demo-stat'></div><div id='drills-scpm' class='demo-stat'></div></div>"), $("#demo-help-footer").html("There are no hints in Drill Mode. Good luck!"), this.retry()
}, t.prototype.decrementCommands = function () {
this.commandsLeft -= 1;
if (this.commandsLeft === 0) {
this.nextLevel();
return
}
return this.commandsLeft === 1 ? $("#demo-help-footer").html("<br \\>Type 1 more command correctly.") : $("#demo-help-footer").html("<br \\>Type " + this.commandsLeft + " more commands correctly.")
}, t.prototype.shortcutSucceeded = function (e) {
var t;
return this.level < 3 && this.decrementCommands(), this.$(".blinking-cursor").remove(), t = this.$("#demo-current-shortcut .keys").clone(), t.html('<i class="icon-ok shortcut-drill-icon"></i> ' + t.html() + ("<br \\><div class='old-description'>" + e.get("description") + "</div>")), this.$("#demo-current-shortcut .keys").html("<span class='blinking-cursor'>|</span>"), this.$("#demo-previous-shortcut").prepend(t), t.animate({
top: "-=120px"
}, 0), t.animate({
top: "+=100px"
}, 500, "easeOutBounce"), this.previousShortcuts.push(t), this.previousShortcuts.length > 2 && this.previousShortcuts.shift().fadeOut("slow", function (e) {
return $(this).remove()
}), this.displayCurrentAndNextShortcuts()
}, t.prototype.shortcutFailed = function (e) {
var t;
return this.$(".blinking-cursor").remove(), t = this.$("#demo-current-shortcut .keys").clone(), t.html('<i class="icon-remove shortcut-drill-icon"></i> ' + this.$("#demo-current-shortcut .keys").html() + ("<span class='untyped-keys'>" + e.remainingKeys() + "</span><br \\><div class='old-description'>" + e.get("description") + "</div>")), this.$("#demo-current-shortcut .keys").html("<span class='blinking-cursor'>|</span>"), this.$("#demo-previous-shortcut").prepend(t), t.animate({
top: "-=120px"
}, 0), t.animate({
top: "+=100px"
}, 500, "easeOutBounce"), this.previousShortcuts.push(t), this.previousShortcuts.length > 2 && this.previousShortcuts.shift().fadeOut("slow", function (e) {
return $(this).remove()
}), this.displayCurrentAndNextShortcuts()
}, t.prototype.handleKeyEvent = function (e, t, n) {
var r;
r = (n.target || n.srcElement).tagName;
if (r === "INPUT" || r === "SELECT" || r === "TEXTAREA") return;
if (n.type === "keydown" && e !== "shift" && e !== "ctrl" && e !== "alt" && e !== "meta") return this.game.processKeyEvent(e, t, n), Shortcut.stopEventIfMatchesKeys(e, t, n);
if (n.type === "keypress" && e !== "shift" && e !== "ctrl" && e !== "alt" && e !== "meta") return this.game.processKeyEvent(e, t, n)
}, t.prototype.keyPressed = function (e) {
var t, n;
t = (e.target || e.srcElement).tagName;
if (t === "INPUT" || t === "SELECT" || t === "TEXTAREA") return;
if (e.which === 0) {
this.keyFailed = !0;
return
}
if ((n = e.which) === 16 || n === 17 || n === 18 || n === 91 || n === 93 || n === 224) return;
return this.game.processKey(e, !1), !1
}, t.prototype.keyPressedDown = function (e) {
if (this.keyFailed) return this.keyFailed = !1, this.game.processKey(e, !0)
}, t.prototype.displayCurrentAndNextShortcuts = function () {
var e;
this.keyDisplay === "show" && this.$("#demo-current-shortcut .keys").html("<div style='display: inline-block; width: 1px'><span class='blinking-cursor'>|</span></div><span class='untyped-keys'>" + this.game.currentShortcut().toString() + "</span>"), e = this.$("#demo-current-shortcut .description"), e.html(this.game.currentShortcut().get("description")), e.stop(), e.css("top", "0px"), e.css("left", "0px"), e.css("opacity", "0"), e.animate({
top: "-=30px",
left: "-=30px"
}, 0), e.animate({
top: "+=30px",
left: "+=30px",
opacity: "1"
}, 200, "easeOutQuart");
if (this.keyDisplay === "delay") return this.drawKeysAfterTimeout()
}, t.prototype.leave = function () {
return this.off(), this.stopListening(), this.stopTimers(), this.remove()
}, t
}(Backbone.View)
}.call(this),
function () {
var e = {}.hasOwnProperty,
t = function (t, n) {
function i() {
this.constructor = t
}
for (var r in n) e.call(n, r) && (t[r] = n[r]);
return i.prototype = n.prototype, t.prototype = new i, t.__super__ = n.prototype, t
};
window.DemoView = function (e) {
function n() {
return n.__super__.constructor.apply(this, arguments)
}
return t(n, e), n.prototype.id = "demo", n.prototype.template = JST["backbone/templates/demo"], n.prototype.initialize = function () {
return mixpanel.track("Index Page Viewed")
}, n.prototype.events = function () {
return {
"click .demo-editor": "editorSelected"
}
}, n.prototype.render = function () {
return $(this.el).html(this.template()), $("#register").click(function () {
return typeof _gaq != "undefined" && _gaq !== null ? _gaq.push(["_trackEvent", "Guest", "Index Register Clicked"]) : void 0
}), this
}, n.prototype.editorSelected = function (e) {
var t, n;
return t = e.currentTarget, n = t.id, $("#logo").animate({
height: 40,
top: "+=20px"
}, 100), $("#bluebanner").fadeOut(300), $("#overviews").fadeOut(300), $("#social").fadeOut(300), $("#footer").fadeOut(300), $("#tagline").fadeOut(300), $("#signin").fadeOut(300), $("#from-zendesk").fadeOut(300), this.$("p").fadeOut(300), $(t).animate({
opacity: "0"
}, 300, function () {
return app.dispatcher.trigger("demoEditorSelected", n)
}), $(".demo-editor").each(function (e) {
var t;
t = $(this).attr("id");
if (t !== n) return $(this).animate({
opacity: "0"
}, 100)
})
}, n
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.DrillsView = function (e) {
function t() {
var e = this;
return this.undoFilters = function () {
return t.prototype.undoFilters.apply(e, arguments)
}, this.bundleSelected = function (n) {
return t.prototype.bundleSelected.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.id = "drillviews", t.prototype.events = {
"click #undo-filters": "undoFilters"
}, t.prototype.render = function () {
var e, t, n, r;
return this.options.practice ? (r = "Practice", n = "Practice", t = "Practice mode shows the shortcut keys and does not affect your stats.") : (r = "Drills", n = "Drills", t = "Drills are timed exercises to test your shortcut accuracy."), e = new BundleListView({
bundles: app.bundleRepository.get("bundles"),
name: r,
helpTitle: n,
helpText: t
}), $(this.el).html(e.render().el), app.dispatcher.on("bundleLoaded", this.bundleSelected), this
}, t.prototype.bundleSelected = function (e) {
return this.options.practice ? app.navigate("app/practice/" + e.get("parentId"), {
trigger: !0
}) : app.navigate("app/drills/" + e.get("parentId"), {
trigger: !0
})
}, t.prototype.undoFilters = function () {
return app.dispatcher.trigger("undoFilters")
}, t.prototype.leave = function () {
return this.off(), this.stopListening(), this.remove()
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.DrillView = function (e) {
function t() {
var e = this;
return this.handleKeyEvent = function (n, r, i) {
return t.prototype.handleKeyEvent.apply(e, arguments)
}, this.characterFromEvent = function (n) {
return t.prototype.characterFromEvent.apply(e, arguments)
}, this.shortcutFailed = function (n) {
return t.prototype.shortcutFailed.apply(e, arguments)
}, this.shortcutSucceeded = function (n) {
return t.prototype.shortcutSucceeded.apply(e, arguments)
}, this.keypressFailed = function (n, r) {
return t.prototype.keypressFailed.apply(e, arguments)
}, this.appendRestOfKeys = function () {
return t.prototype.appendRestOfKeys.apply(e, arguments)
}, this.drawAllKeys = function () {
return t.prototype.drawAllKeys.apply(e, arguments)
}, this.drawTypedKeys = function () {
return t.prototype.drawTypedKeys.apply(e, arguments)
}, this.keypressSucceeded = function (n, r) {
return t.prototype.keypressSucceeded.apply(e, arguments)
}, this.timeChanged = function (n) {
return t.prototype.timeChanged.apply(e, arguments)
}, this.gameEnded = function () {
return t.prototype.gameEnded.apply(e, arguments)
}, this.gameStarted = function () {
return t.prototype.gameStarted.apply(e, arguments)
}, this.animateCountDown = function () {
return t.prototype.animateCountDown.apply(e, arguments)
}, this.drawCountDown = function () {
return t.prototype.drawCountDown.apply(e, arguments)
}, this.home = function () {
return t.prototype.home.apply(e, arguments)
}, this.retry = function () {
return t.prototype.retry.apply(e, arguments)
}, this.scpmChanged = function (n) {
return t.prototype.scpmChanged.apply(e, arguments)
}, this.accuracyChanged = function (n) {
return t.prototype.accuracyChanged.apply(e, arguments)
}, this.streakIncreased = function (n) {
return t.prototype.streakIncreased.apply(e, arguments)
}, this.showKeys = function () {
return t.prototype.showKeys.apply(e, arguments)
}, this.hideKeys = function () {
return t.prototype.hideKeys.apply(e, arguments)
}, this.delayKeys = function () {
return t.prototype.delayKeys.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/drillview"], t.prototype.id = "drillviewcontainer", t.prototype.events = {
"click #startstop": "startstop",
"click #timer-up": "timerUp",
"click #timer-down": "timerDown",
"click #retry": "retry",
"click #home": "home",
"click #show-keys": "showKeys",
"click #hide-keys": "hideKeys",
"click #delay-keys": "delayKeys"
}, t.prototype.cancelDrawKeyTimeout = function () {
if (this.timeoutId) return window.clearTimeout(this.timeoutId)
}, t.prototype.drawKeysAfterTimeout = function () {
var e = this;
return this.keysDrawn = !1, this.cancelDrawKeyTimeout(), this.timeoutId = window.setTimeout(function () {
return e.appendRestOfKeys(), e.keysDrawn = !0
}, 3e3)
}, t.prototype.delayKeys = function () {
if (this.keyDisplay === "delay") return;
this.keyDisplay = "delay", this.isGameStarted && this.drawTypedKeys();
if (this.isGameStarted) return this.drawKeysAfterTimeout()
}, t.prototype.hideKeys = function () {
if (this.keyDisplay === "hide") return;
this.cancelDrawKeyTimeout(), this.keyDisplay = "hide";
if (this.isGameStarted) return this.drawTypedKeys()
}, t.prototype.showKeys = function () {
if (this.keyDisplay === "show") return;
this.cancelDrawKeyTimeout(), this.keyDisplay = "show";
if (this.isGameStarted) return this.drawAllKeys()
}, t.prototype.render = function () {
var e, t, n;
return this.isGameStarted = !1, e = this.options.bundle.get("editor") || app.user.defaultEditor, /Photoshop/.test(e) && (e = "Photoshop"), /Sublime/.test(e) && (e = "Sublime"), e === "Command Line" ? n = ["Lovin' me some #UNIX commands", "Learnin' me some #UNIX commands", "Just finished a #UNIX command line drill", "Typing #UNIX commands is so much fun!", "Just typed a million #UNIX commands", "Honing my #UNIX skills"] : e === "Git" ? n = ["Lovin' me some #Git commands", "Learnin' me some #Git commands", "Just finished a #Git drill", "Typing #Git commands is so much fun!", "Just typed a million #Git commands", "Honing my #Git skills"] : (n = ["Lovin' me some #" + e + " shortcuts", "Learnin' me some #" + e + " shortcuts", "Just finished a #" + e + " shortcut drill", "Typing #" + e + " shortcuts is so much fun!", "Just typed a million #" + e + " shortcuts", "Honing my #" + e + " skills"], e === "Vim" && n.push("Vim, Vim, Vim, I love #Vim")), n = _.shuffle(n), t = n[0], this.game = new VIMGame({
shortcuts: this.options.bundle.shortcutIds()
}), app.dispatcher.on("gameStarted", this.gameStarted), app.dispatcher.on("keypressSucceeded", this.keypressSucceeded), app.dispatcher.on("keypressFailed", this.keypressFailed), app.dispatcher.on("shortcutSucceeded", this.shortcutSucceeded), app.dispatcher.on("shortcutFailed", this.shortcutFailed), app.dispatcher.on("timeChanged", this.timeChanged), app.dispatcher.on("gameEnded", this.gameEnded), app.dispatcher.on("streakIncreased", this.streakIncreased), app.dispatcher.on("accuracyChanged", this.accuracyChanged), app.dispatcher.on("scpmChanged", this.scpmChanged), $(this.el).html(this.template({
name: this.options.bundle.get("name"),
drillEditor: e,
tweetText: t,
isWin7: this.isWindows7orLess()
})), $.browser.msie && this.$("#legend").hide().remove(), this.options.practice ? this.initializePractice() : this.initializeDrill(), this
}, t.prototype.isWindows7orLess = function () {
var e;
return e = navigator.userAgent, $.browser.msie || e.indexOf("Windows NT 7.0") !== -1 || e.indexOf("Windows NT 6.1") !== -1 || e.indexOf("Windows NT 5.1") !== -1 || e.indexOf("Windows XP") !== -1
}, t.prototype.initializePractice = function () {
return this.keyDisplay = "delay", this.$("#delay-keys").button("toggle"), this.previousShortcuts = [], this.$("#drill-summary").animate({
opacity: "0",
top: "-700px"
}, 0), this.$(".timer-button").animate({
opacity: "0"
}, 0), this.$("#count-down").animate({
opacity: "0"
}, 0), this.startGame(), this.$("#drill-timer").html("0:00"), this.isGameStarted = !0
}, t.prototype.initializeDrill = function () {
this.keyDisplay = "hide", this.$("#practice-options").remove(), this.$("#startstop").animate({
top: "-=90px",
left: "-=190px"
}, 0), this.$("#timer-and-buttons").animate({
top: "+=80px",
left: "-=190px"
}, 0), this.$("#drill-stats").animate({
opacity: "0"
}, 0), this.$("#current-shortcut").animate({
opacity: "0"
}, 0), this.$("#count-down").animate({
opacity: "0"
}, 0), this.$("#drill-summary").animate({
opacity: "0",
top: "-700px"
}, 0), $.getScript("//platform.twitter.com/widgets.js"), this.previousShortcuts = [];
if (this.options.quick) return this.startstop()
}, t.prototype.timerUp = function () {
return this.game.increaseTime()
}, t.prototype.timerDown = function () {
return this.game.decreaseTime()
}, t.prototype.streakIncreased = function (e) {
return this.$("#drills-longest-streak").html("Longest Streak: " + e)
}, t.prototype.accuracyChanged = function (e) {
return this.$("#drills-accuracy").html("Accuracy: " + e)
}, t.prototype.scpmChanged = function (e) {
return this.$("#drills-scpm").html("SCPM: " + e)
}, t.prototype.stopTimers = function () {
return this.cursorBlink && clearInterval(this.cursorBlink), this.countDownTimer && clearInterval(this.countDownTimer), this.game.stopTimer()
}, t.prototype.blinkCursor = function () {
return $(".blinking-cursor").animate({
opacity: "toggle"
}, "fast", "swing")
}, t.prototype.startstop = function () {
var e, t = this;
if (this.options.practice) {
this.isGameStarted ? (app.dispatcher.off("keyPressed", this.handleKeyEvent), this.keyDisplay === "delay" && this.cancelDrawKeyTimeout(), this.game.endGame(), this.isGameStarted = !1) : (this.startGame(), this.isGameStarted = !0, this.$("#startstop").html("Stop"), this.$("#startstop").removeClass("btn-success"), this.$("#startstop").addClass("btn-danger"));
return
}
if (this.isGameStarted && this.countDown > 0) return;
return $(".pop-tip-left").tooltip({
placement: "left"
}), this.isGameStarted ? (app.dispatcher.off("keyPressed", this.handleKeyEvent), this.game.endGame()) : (this.options.saveBundleInfo && (e = new Date, this.options.bundle.set("lastDrillAt", e), app.bundleRepository.incDrillCount(this.options.bundle)), this.isGameStarted = !0, this.countDown = 3, this.countDownTimer && clearInterval(this.countDownTimer), this.$("#startstop").animate({
top: "0px",
left: "0px"
}, 200), this.$("#timer-and-buttons").animate({
top: "0px",
left: "0px"
}, 200), this.$("#drill-stats").animate({
opacity: "1"
}, 2e3), this.$("#current-shortcut").animate({
opacity: "1"
}, 200, function () {
return t.$(".timer-button").fadeOut(), t.animateCountDown(), t.countDownTimer = setInterval(function () {
return t.drawCountDown()
}, 600)
}))
}, t.prototype.retry = function () {
return this.resetFields(), this.$("#drill-summary").animate({
opacity: "0",
top: "-500px"
}, 500, "easeOutQuart"), this.$("#drill-shortcuts").animate({
opacity: "1"
}, 200), this.$("#drill-timer-stats").animate({
opacity: "1"
}, 200), this.startstop()
}, t.prototype.home = function () {
return app.navigate("app", {
trigger: !0
})
}, t.prototype.resetFields = function () {
return this.$("#startstop").html("Stop"), this.$("#current-shortcut .description").html(""), this.$("#startstop").removeClass("btn-success"), this.$("#startstop").addClass("btn-danger"), this.$("#current-shortcut .keys").html("<span class='blinking-cursor'>|</span>"), this.$("#drills-longest-streak").html("Longest Streak: 0"), this.$("#drills-accuracy").html("Accuracy: N/A"), this.$("#drills-scpm").html("SCPM: 0"), this.$("#previous-shortcut").empty(), this.game.resetTime()
}, t.prototype.drawCountDown = function () {
this.countDown -= 1, this.animateCountDown(), this.countDown === 0 && (this.startGame(), clearInterval(this.countDownTimer))
}, t.prototype.animateCountDown = function () {
var e, t = this;
return e = "90px", this.$("#count-down").animate({
opacity: "0",
left: "-80px"
}, 0), this.countDown === 0 ? this.$("#count-down").html("<img src='https://d2r64hzyhllbrg.cloudfront.net/ninja-alone.png' style='height: 200px; margin-top: -70px;'></img>") : (this.$("#count-down").html(this.countDown), e = "180px"), this.$("#count-down").animate({
opacity: "1",
left: e
}, 200, "easeOutQuart", function () {
return t.countDown === 0 ? t.$("#count-down").animate({
left: "+=90PX",
opacity: "0"
}, 200, function () {
return t.$("#count-down").empty()
}) : t.$("#count-down").animate({
opacity: "0"
}, 200)
})
}, t.prototype.startGame = function () {
var e, t, n = this;
return this.resetFields(), this.options.practice ? (mixpanel.people.increment("Practice Count"), mixpanel.track("Practice Started", {
editor: (e = app.user) != null ? e.defaultEditor : void 0
})) : (mixpanel.people.increment("Drill Count"), mixpanel.track("Drill Started", {
editor: (t = app.user) != null ? t.defaultEditor : void 0
})), this.game.start(this.options.practice), this.cursorBlink = setInterval(function () {
return n.blinkCursor()
}, 600)
}, t.prototype.gameStarted = function () {
return app.dispatcher.on("keyPressed", this.handleKeyEvent), this.displayCurrentAndNextShortcuts()
}, t.prototype.gameEnded = function () {
this.options.practice || this.$("#startstop").html("Start"), this.options.practice && this.$("#startstop").html("Restart"), this.$("#startstop").removeClass("btn-danger"), this.$("#startstop").addClass("btn-success"), this.isGameStarted = !1, this.cursorBlink && clearInterval(this.cursorBlink);
if (this.options.practice) return;
return this.$(".blinking-cursor").remove(), this.$("#drills-summary-elapsed-time").html("" + this.game.elapsedTimeToString() + " Elapsed Time"), this.$("#drills-summary-total").html("" + this.game.totalShortcutsTyped() + " Total Shortcuts Typed"), this.$("#drills-summary-accuracy").html("" + this.game.accuracy + "% Accuracy"), this.$("#drills-summary-scpm").html("" + this.game.scpm + " Shortcuts Per Minute"), this.$("#drills-summary-longest-streak").html("" + this.game.longestStreak + " Shortcuts for Longest Streak"), this.$("#drill-summary").animate({
opacity: "1",
top: "60px"
}, 1e3, "easeOutElastic"), this.$("#drill-shortcuts").animate({
opacity: ".3"
}, 200), this.$("#drill-timer-stats").animate({
opacity: ".3"
}, 200), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Drills", "Stats", "SCPM", this.game.scpm]), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Drills", "Stats", "Shortcuts Typed", this.game.totalShortcutsTyped()]), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Drills", "Stats", "Elapsed Time", this.game.elapsedTime]), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Drills", "Stats", "Accuracy", this.game.accuracy]), typeof _gaq != "undefined" && _gaq !== null ? _gaq.push(["_trackEvent", "Drills", "Stats", "Longest Streak", this.game.longestStreak]) : void 0
}, t.prototype.timeChanged = function (e) {
return this.$("#drill-timer").html(e)
}, t.prototype.keypressSucceeded = function (e, t) {
this.$(".blinking-cursor").remove();
if (this.keyDisplay === "show" || this.keysDrawn) return this.$("#current-shortcut .keys").html("<span class='correct-key'>" + (t.previousKeys() + t.currentKeyToString()) + "</span><div style='display: inline-block; width: 1px'><span class='blinking-cursor'>|</span></div><span class='untyped-keys'>" + t.remainingKeys() + "</span>");
this.$("#current-shortcut .keys").html("<span class='correct-key'>" + (t.previousKeys() + t.currentKeyToString()) + "</span><div style='display: inline-block; width: 1px'><span class='blinking-cursor'>|</span></div>");
if (this.keyDisplay === "delay") return this.drawKeysAfterTimeout()
}, t.prototype.drawTypedKeys = function () {
return this.$("#current-shortcut .keys").html("<span class='correct-key'>" + this.game.currentShortcut().previousKeys() + "</span><div style='display: inline-block; width: 1px'><span class='blinking-cursor'>|</span></div>")
}, t.prototype.drawAllKeys = function () {
return this.$("#current-shortcut .keys").html("<span class='correct-key'>" + this.game.currentShortcut().previousKeys() + "</span><div style='display: inline-block; width: 1px'><span class='blinking-cursor'>|</span></div><span class='untyped-keys'>" + (this.game.currentShortcut().currentKeyToString() + this.game.currentShortcut().remainingKeys()) + "</span>")
}, t.prototype.appendRestOfKeys = function () {
return this.$("#current-shortcut .keys").html("<span class='correct-key'>" + this.game.currentShortcut().previousKeys() + "</span><div style='display: inline-block; width: 1px'><span class='blinking-cursor'>|</span></div><span class='untyped-keys fade-in'>" + (this.game.currentShortcut().currentKeyToString() + this.game.currentShortcut().remainingKeys()) + "</span>"), this.$(".fade-in").animate({
opacity: 1
}, 300)
}, t.prototype.keypressFailed = function (e, t) {
return this.options.practice ? this.$("#current-shortcut .keys").html("<span class='correct-key'>" + t.previousKeys() + "<span class='incorrect-key'>" + t.currentKeyToString() + "</span>") : this.$("#current-shortcut .keys").append("<span class='incorrect-key'>" + e + "</span>")
}, t.prototype.shortcutSucceeded = function (e) {
var t;
return this.$(".blinking-cursor").remove(), t = this.$("#current-shortcut .keys").clone(), t.html('<i class="icon-ok shortcut-drill-icon"></i> ' + t.html() + ("<br \\><div class='old-description'>" + e.get("description") + "</div>")), this.$("#current-shortcut .keys").html("<span class='blinking-cursor'>|</span>"), this.$("#previous-shortcut").prepend(t), t.animate({
top: "-=180px"
}, 0), t.animate({
top: "+=140px"
}, 500, "easeOutBounce"), this.previousShortcuts.push(t), this.previousShortcuts.length > 4 && this.previousShortcuts.shift().fadeOut("slow", function (e) {
return $(this).remove()
}), this.displayCurrentAndNextShortcuts()
}, t.prototype.shortcutFailed = function (e) {
var t;
return this.$(".blinking-cursor").remove(), t = this.$("#current-shortcut .keys").clone(), t.html('<i class="icon-remove shortcut-drill-icon"></i> ' + this.$("#current-shortcut .keys").html() + ("<span class='untyped-keys'>" + e.remainingKeys() + "</span><br \\><div class='old-description'>" + e.get("description") + "</div>")), this.$("#current-shortcut .keys").html("<span class='blinking-cursor'>|</span>"), this.$("#previous-shortcut").prepend(t), t.animate({
top: "-=180px"
}, 0), t.animate({
top: "+=140px"
}, 500, "easeOutBounce"), this.previousShortcuts.push(t), this.previousShortcuts.length > 4 && this.previousShortcuts.shift().fadeOut("slow", function (e) {
return $(this).remove()
}), this.displayCurrentAndNextShortcuts()
}, t.prototype.characterFromEvent = function (e) {
var t;
return e.type === "keypress" ? (t = String.fromCharCode(e.which), e.shiftKey || (t = t.toLowerCase()), t) : this.MAP[e.which] ? this.MAP[e.which] : String.fromCharCode(e.which).toLowerCase()
}, t.prototype.handleKeyEvent = function (e, t, n) {
var r;
r = (n.target || n.srcElement).tagName;
if (r === "INPUT" || r === "SELECT" || r === "TEXTAREA") return;
if (n.type === "keydown" && e !== "shift" && e !== "ctrl" && e !== "alt" && e !== "meta") return this.game.processKeyEvent(e, t, n), Shortcut.stopEventIfMatchesKeys(e, t, n);
if (n.type === "keypress" && e !== "shift" && e !== "ctrl" && e !== "alt" && e !== "meta") return this.game.processKeyEvent(e, t, n)
}, t.prototype.displayCurrentAndNextShortcuts = function () {
var e;
this.keyDisplay === "show" && this.$("#current-shortcut .keys").html("<div style='display: inline-block; width: 1px'><span class='blinking-cursor'>|</span></div><span class='untyped-keys'>" + this.game.currentShortcut().toString() + "</span>"), e = this.$("#current-shortcut .description"), e.html(this.game.currentShortcut().get("description")), e.stop(), e.css("top", "0px"), e.css("left", "0px"), e.css("opacity", "0"), e.animate({
top: "-=30px",
left: "-=30px"
}, 0), e.animate({
top: "+=30px",
left: "+=30px",
opacity: "1"
}, 200, "easeOutQuart");
if (this.keyDisplay === "delay") return this.drawKeysAfterTimeout()
}, t.prototype.leave = function () {
return this.off(), this.stopListening(), this.stopTimers(), this.remove()
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.EditorPickerView = function (e) {
function t() {
var e = this;
return this.addNewEditor = function () {
return t.prototype.addNewEditor.apply(e, arguments)
}, this.removeEditor = function (n) {
return t.prototype.removeEditor.apply(e, arguments)
}, this.closeEditorModal = function () {
return t.prototype.closeEditorModal.apply(e, arguments)
}, this.selectSelectedEditor = function () {
return t.prototype.selectSelectedEditor.apply(e, arguments)
}, this.optionClicked = function (n) {
return t.prototype.optionClicked.apply(e, arguments)
}, this.render = function () {
return t.prototype.render.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/editorpicker"], t.prototype.events = {
"click .editor-option": "optionClicked",
"click #new-editor": "openEditorModal",
"click #add-editor": "addNewEditor",
"click #close-editor-changes": "closeEditorModal",
"click .remove-editor": "removeEditor"
}, t.prototype.initialize = function () {
return this.selectedEditor = this.options.selectedEditor
}, t.prototype.render = function () {
return $(this.el).html(this.template({
selectedEditor: this.selectedEditor,
editors: _.uniq(app.user.editors).sort()
})), (window.user.logNum === "77788888" || window.user.logNum === "1123445") && this.$("#new-editor").removeClass("disabled"), $("#editorModal").modal({
show: !1
}), this
}, t.prototype.optionClicked = function (e) {
return this.selectedEditor = $(e.currentTarget).text(), this.selectSelectedEditor()
}, t.prototype.selectSelectedEditor = function () {
return this.$("#editor-choice").html("" + this.selectedEditor + " <b class='caret'></b>"), app.dispatcher.trigger("editorSelected", this.selectedEditor)
}, t.prototype.openEditorModal = function () {
return window.user.logNum === "77788888" || window.user.logNum === "1123445" ? ($("#name-control-group").removeClass("error"), $("#editorModal").modal("show")) : app.navigate("app/plans", {
trigger: !0,
replace: !0
})
}, t.prototype.closeEditorModal = function () {
return $("#editorModal").modal("hide"), this.$("#editor-name").val("")
}, t.prototype.removeEditor = function (e) {
var t, n, r = this;
return t = e.currentTarget.id, t === this.selectedEditor && (this.selectedEditor = "Vim"), n = $(e.currentTarget).parent(), n.fadeOut(), app.user.editors = _.reject(app.user.editors, function (e) {
return e === t
}), $("#editorModal").off("hidden"), $("#editorModal").on("hidden", function () {
return $("#editorModal").off("hidden"), r.render(), r.selectedEditor === "Vim" && r.selectSelectedEditor(), $.post("/api/editors.json", {
editors: app.user.editors
})
})
}, t.prototype.addNewEditor = function () {
var e, t = this;
e = this.$("#editor-name").val();
if (!e || !e.match(/\S/)) {
$("#name-control-group").addClass("error");
return
}
return typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Editors", "Create", e]), app.user.editors.push(e), app.user.nextDrill === 9344 && $.post("/api/editors.json", {
editors: app.user.editors
}), this.selectedEditor = e, $("#editorModal").on("hidden", function () {
return $("#editorModal").off("hidden"), t.render(), t.selectSelectedEditor()
}), this.closeEditorModal()
}, t.prototype.editorName = function () {
return this.selectedEditor
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.ChooseEditorView = function (e) {
function t() {
var e = this;
return this.editorPicked = function (n) {
return t.prototype.editorPicked.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/chooseeditorview"], t.prototype.id = "choose-editor-view", t.prototype.events = {
"click .editor-pick": "editorPicked"
}, t.prototype.render = function () {
return $(this.el).html(this.template({
editors: app.user.editors
})), this
}, t.prototype.editorPicked = function (e) {
var t, n;
return t = e.currentTarget, n = t.id, typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Editors", "ChooseDefault", n]), app.user.defaultEditor = n, app.user.justRegistered = !1, app.user.nextDrill === 9344 && $.post("/api/default_editor.json", {
name: n
}), app.dispatcher.trigger("editorSelected", n), app.navigate("app", {
trigger: !0,
replace: !0
})
}, t.prototype.leave = function () {
return this.off(), this.stopListening(), this.remove()
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.HomeView = function (e) {
function t() {
var e = this;
return this.defaultNameChanged = function (n) {
return t.prototype.defaultNameChanged.apply(e, arguments)
}, this.unlockEditorButtonClicked = function (n) {
return t.prototype.unlockEditorButtonClicked.apply(e, arguments)
}, this.shuffleToTry = function () {
return t.prototype.shuffleToTry.apply(e, arguments)
}, this.shuffleNeedsWork = function () {
return t.prototype.shuffleNeedsWork.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/home"], t.prototype.id = "home", t.prototype.events = {
"click #need-work-drill": "openNeedsWorkDrill",
"click #need-work-practice": "openNeedsWorkPractice",
"click #need-work-bundle": "openNeedsWorkBundle",
"click #not-tried-drill": "openToTryDrill",
"click #not-tried-practice": "openToTryPractice",
"click #not-tried-bundle": "openToTryBundle",
"click #shuffle-needs-work": "shuffleNeedsWork",
"click #shuffle-to-try": "shuffleToTry",
"click #unlock_editor": "unlockEditorClicked",
"click .unlock-editor-btn": "unlockEditorButtonClicked",
"click #unlock-sure": "unlockSureClicked"
}, t.prototype.initialize = function () {
return app.dispatcher.on("bundleLoaded", this.quickDrill), app.dispatcher.on("editorChanged", this.defaultNameChanged)
}, t.prototype.render = function () {
var e, t, n, r, i, s = this;
return r = app.shortcutRepository.getNeedsWorkShortcuts(5), t = !r.isEmpty(), i = app.shortcutRepository.getToTryShortcuts(5), n = !i.isEmpty(), $(this.el).html(this.template({
drawToTryTable: n,
drawShortcutsThatNeedWorkTable: t
})), t && (this.needWorkShortcutsView = new ShortcutsTableView({
collection: r,
button: "none",
tableId: "shortcuts"
}), this.needWorkShortcutsView.sortAccuracy(), this.$("#needs-work-table-view").html(this.needWorkShortcutsView.render().el)), i && (this.toTryShortcutsView = new ShortcutsTableView({
collection: i,
button: "none",
tableId: "shortcuts"
}), this.$("#to-try-table-view").html(this.toTryShortcutsView.render().el)), this.editorPicker = new window.EditorPickerView({
selectedEditor: app.user.defaultEditor || "Vim"
}), this.$("#editor").replaceWith(this.editorPicker.render().el), e = app.bundleRepository.getLastThreeBundlesDrilled(), this.userCanUnlockEditors() ? (this.$("#unlock_editor").show(), this.$("#unlock-footer").hide(), this.$("#unlockEditorModel").modal({
show: !1
})) : this.$("#unlock_editor").hide(), _.each(e, function (e) {
var t;
return t = new BundleView({
model: e
}), s.$("#quick-drills").append(t.render().el)
}), this
}, t.prototype.userCanUnlockEditors = function () {
if (window.user.logNum === "333224556") {
if (!window.user.unlockedEditors || window.user.unlockedEditors.length < 1) return !0
} else if (window.user.logNum === "6444445")
if (!window.user.unlockedEditors || window.user.unlockedEditors.length < 3) return !0;
return !1
}, t.prototype.unlocksLeft = function () {
return window.user.logNum === "333224556" ? 1 - window.user.unlockedEditors.length : window.user.logNum === "6444445" ? 3 - window.user.unlockedEditors.length : 0
}, t.prototype.shuffleNeedsWork = function () {
return this.needWorkShortcutsView.collection = app.shortcutRepository.shuffleNeedsWork(), this.needWorkShortcutsView.render()
}, t.prototype.shuffleToTry = function () {
return this.toTryShortcutsView.collection = app.shortcutRepository.shuffleToTry(), this.toTryShortcutsView.render()
}, t.prototype.quickDrill = function (e) {
return app.navigate("app/drills/" + e.get("parentId") + "/quick", {
trigger: !0
})
}, t.prototype.openNeedsWorkDrill = function () {
return app.navigate("app/drills/needs-work", {
trigger: !0
})
}, t.prototype.openNeedsWorkPractice = function () {
return app.navigate("app/practice/needs-work", {
trigger: !0
})
}, t.prototype.openNeedsWorkBundle = function () {
return app.navigate("app/bundles/new/needs-work", {
trigger: !0
})
}, t.prototype.openToTryDrill = function () {
return app.navigate("app/drills/to-try", {
trigger: !0
})
}, t.prototype.openToTryPractice = function () {
return app.navigate("app/practice/to-try", {
trigger: !0
})
}, t.prototype.openToTryBundle = function () {
return app.navigate("app/bundles/new/to-try", {
trigger: !0
})
}, t.prototype.showUnlockEditorModal = function () {
var e = this;
return $(".unlock-editor-btn").removeClass("btn-success"), $(".unlock-editor-btn").removeClass("disabled"), $(".unlock-editor-btn").addClass("btn-info"), _.each(window.user.unlockedEditors, function (t) {
return e.$(".unlock-editor-btn:contains('" + t + "')").removeClass("btn-info"), e.$(".unlock-editor-btn:contains('" + t + "')").addClass("btn-success"), e.$(".unlock-editor-btn:contains('" + t + "')").addClass("disabled")
}), this.$("#unlock-footer").hide(), this.$("#unlocks-left").html(this.unlocksLeft()), this.$("#unlockEditorModel").modal("show")
}, t.prototype.unlockEditorClicked = function () {
return this.showUnlockEditorModal()
}, t.prototype.unlockEditorButtonClicked = function (e) {
var t, n = this;
if ($(e.currentTarget).hasClass("disabled")) return;
return $(".unlock-editor-btn").removeClass("btn-success"), $(".unlock-editor-btn").removeClass("disabled"), $(".unlock-editor-btn").addClass("btn-info"), _.each(window.user.unlockedEditors, function (e) {
return n.$(".unlock-editor-btn:contains('" + e + "')").removeClass("btn-info"), n.$(".unlock-editor-btn:contains('" + e + "')").addClass("btn-success"), n.$(".unlock-editor-btn:contains('" + e + "')").addClass("disabled")
}), $(e.currentTarget).removeClass("btn-info"), $(e.currentTarget).addClass("btn-success"), $(e.currentTarget).addClass("disabled"), t = $(e.currentTarget).html(), this.editorId = this.$(e.currentTarget).attr("id"), this.$("#selected-unlock-editor-name").html(t), this.$("#unlock-footer").fadeIn()
}, t.prototype.unlockSureClicked = function (e) {
var t, n, r = this;
n = this.$("#selected-unlock-editor-name").html(), t = ShortcutFoo.convertEditor(this.editorId);
if (app.user.logNum === "333224556" || app.user.logNum === "6444445") return $.ajax({
type: "POST",
url: "/api/unlock_editor.json",
data: {
editor: n
},
success: function (e) {
r.$("#unlockEditorModel").modal("hide"), $("#unlock_editor").remove();
if (e.success) return app.resetAllEditors(), app.user.unlockedEditors.push(n), app.loadEditor(t)
},
error: function () {
return alert("There was an error saving your editor setting. Please try again!")
}
})
}, t.prototype.defaultNameChanged = function (e) {
typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Editors", "ChangeDefault", e]), app.user.defaultEditor = e, app.shortcutRepository.shuffleNeedsWork(), app.shortcutRepository.shuffleToTry(), this.render(), app.applyJSHooks();
if (app.user.nextDrill === 9344) return $.post("/api/default_editor.json", {
name: e
})
}, t.prototype.leave = function () {
return this.off(), this.stopListening(), this.remove()
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.IndexDemoPricing = function (e) {
function r() {
var e = this;
return this.processKey = function (t) {
return r.prototype.processKey.apply(e, arguments)
}, this.keyPressedDown = function (t) {
return r.prototype.keyPressedDown.apply(e, arguments)
}, this.keyPressed = function (t) {
return r.prototype.keyPressed.apply(e, arguments)
}, r.__super__.constructor.apply(this, arguments)
}
var t;
return n(r, e), r.prototype.id = "demo", r.prototype.template = JST["backbone/templates/index_demo_pricing"], r.prototype.initialize = function () {
return mixpanel.track("Index Page Viewed"), this.code = [65, 66, 65, 67, 65, 66, 66]
}, r.prototype.events = function () {
return {
"click .demo-editor": "editorSelected"
}
}, r.prototype.render = function () {
var e, n, r, i, s;
return e = window.location.host, i = e.split("."), s = i[0], s === "zendesk" ? (r = "Zendesk", n = "zendesk") : (r = "Visual Studio", n = "visualstudio"), $(this.el).html(this.template({
middleEditorName: r,
middleEditorId: n
})), t("from").toLowerCase() === "zendesk" && (this.$("#from-zendesk").html("Note: You just left the Zendesk app"), this.$("#from-zendesk").show()), $("#register").click(function () {
return typeof _gaq != "undefined" && _gaq !== null ? _gaq.push(["_trackEvent", "Guest", "Index Register Clicked"]) : void 0
}), this
}, t = function (e) {
var t, n, r;
return e = e.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"), n = "[\\?&]" + e + "=([^&#]*)", t = new RegExp(n), r = t.exec(window.location.search), r == null ? "" : decodeURIComponent(r[1].replace(/\+/g, " "))
}, r.prototype.editorSelected = function (e) {
var t, n;
return t = e.currentTarget, n = t.id, $("#logo").animate({
height: 40,
top: "+=20px"
}, 100), $("#bluebanner").fadeOut(300), $("#overviews").fadeOut(300), $("#social").fadeOut(300), $("#footer").fadeOut(300), $("#tagline").fadeOut(300), $("#signin").fadeOut(300), $("#from-zendesk").fadeOut(300), this.$("p").fadeOut(300), $(t).animate({
opacity: "0"
}, 300, function () {
return app.dispatcher.trigger("demoEditorSelected", n)
}), $(".demo-editor").each(function (e) {
var t;
t = $(this).attr("id");
if (t !== n) return $(this).animate({
opacity: "0"
}, 100)
})
}, r.prototype.keyPressed = function (e) {
var t, n;
t = (e.target || e.srcElement).tagName;
if (t === "INPUT" || t === "SELECT" || t === "TEXTAREA") return;
if (e.which === 0) {
this.keyFailed = !0;
return
}
if ((n = e.which) === 16 || n === 17 || n === 18 || n === 91 || n === 93 || n === 224) return;
return this.processKey(e, !1), !0
}, r.prototype.keyPressedDown = function (e) {
if (this.keyFailed) return this.keyFailed = !1, this.processKey(e)
}, r.prototype.processKey = function (e) {
var t;
if (this.code.length === 0) return;
t = e.which, this.code[0] === t ? this.code.shift() : this.code = [65, 66, 65, 67, 65, 66, 66];
if (this.code.length === 0) return this.bloodCode()
}, r.prototype.bloodCode = function () {
return $(".span4, h2, a, p, .tag-line").animate({
color: "#dd0000"
}, 600), $.browser.msie || (this.$("p").css("font-family", "Blood, Graublau Sans Web, Lucida Grande, sans-serif"), this.$("p").css("font-size", "80px"), $(".tag-line").css("font-family", "Blood, Graublau Sans Web, Lucida Grande, sans-serif"), $(".tag-line").css("font-size", "24px"), $("h2").css("font-family", "Blood, Lucida Grande, sans-serif"), $("h2").css("font-size", "36px")), typeof _gaq != "undefined" && _gaq !== null ? _gaq.push(["_trackEvent", "Bloodcode", "Completed"]) : void 0
}, r
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.IntervalsView = function (e) {
function t() {
var e = this;
return this.handleKeyEvent = function (n, r, i) {
return t.prototype.handleKeyEvent.apply(e, arguments)
}, this.checkForNumberTyped = function (n) {
return t.prototype.checkForNumberTyped.apply(e, arguments)
}, this.showRatings = function () {
return t.prototype.showRatings.apply(e, arguments)
}, this.shortcutFailed = function (n) {
return t.prototype.shortcutFailed.apply(e, arguments)
}, this.shortcutSucceeded = function (n) {
return t.prototype.shortcutSucceeded.apply(e, arguments)
}, this.keypressFailed = function (n, r) {
return t.prototype.keypressFailed.apply(e, arguments)
}, this.keypressSucceeded = function (n, r) {
return t.prototype.keypressSucceeded.apply(e, arguments)
}, this.displayCurrentAndNextShortcuts = function () {
return t.prototype.displayCurrentAndNextShortcuts.apply(e, arguments)
}, this.intervalShortcutsLoaded = function () {
return t.prototype.intervalShortcutsLoaded.apply(e, arguments)
}, this.trainingCompleted = function () {
return t.prototype.trainingCompleted.apply(e, arguments)
}, this.appendRestOfKeys = function () {
return t.prototype.appendRestOfKeys.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/intervalsview"], t.prototype.intervalTemplate = JST["backbone/templates/interval_trainer"], t.prototype.intervalsComplete = JST["backbone/templates/intervalscomplete"], t.prototype.intervalsStats = JST["backbone/templates/intervalsstats"], t.prototype.legend = JST["backbone/templates/legend"], t.prototype.id = "intervals", t.prototype.initialize = function () {
return this.editor = app.user.defaultEditor, app.dispatcher.on("keypressSucceeded", this.keypressSucceeded), app.dispatcher.on("keypressFailed", this.keypressFailed), app.dispatcher.on("shortcutSucceeded", this.shortcutSucceeded), app.dispatcher.on("shortcutFailed", this.shortcutFailed), app.dispatcher.on("intervalShortcutsLoaded", this.intervalShortcutsLoaded), app.dispatcher.on("noShortcutsRemaining", this.trainingCompleted), this.trainer = new window.IntervalTrainer({
editor: this.editor
}), this.trainer.initTraining(), this.waitingForRating = !1, this.trainingComplete = !1
}, t.prototype.events = {
"click #intervals-get-started": "clickedGetStarted",
"click #intervals-go-home": "clickedIntervalsGoHome",
"click #intervals-go-plans": "clickedIntervalsGoPlans",
"click #intervals-continue-training": "clickedGetStarted",
"click #rating-1": "rating1Clicked",
"click #rating-2": "rating2Clicked",
"click #rating-3": "rating3Clicked",
"click #rating-4": "rating4Clicked",
"click #interval-settings": "clickedIntervalSettings",
"click #save-settings": "clickedSaveSettings",
"click #cancel-settings": "clickedCancelSettings",
"click #reset-intervals": "clickedResetInterval"
}, t.prototype.cancelDrawKeyTimeout = function () {
if (this.timeoutId) return window.clearTimeout(this.timeoutId)
}, t.prototype.drawKeysAfterTimeout = function () {
var e = this;
return this.keysDrawn = !1, this.cancelDrawKeyTimeout(), this.timeoutId = window.setTimeout(function () {
return e.appendRestOfKeys(), e.keysDrawn = !0
}, 3e3)
}, t.prototype.appendRestOfKeys = function () {
return this.$("#current-shortcut .keys").html("<span class='correct-key'>" + this.trainer.currentShortcut().previousKeys() + "</span><div style='display: inline-block; width: 1px'><span class='blinking-cursor'>|</span></div><span class='untyped-keys fade-in'>" + (this.trainer.currentShortcut().currentKeyToString() + this.trainer.currentShortcut().remainingKeys()) + "</span>"), this.$(".fade-in").animate({
opacity: 1
}, 300)
}, t.prototype.render = function () {
var e, t, n, r, i;
r = this.trainer.newShortcutsCount(), $(this.el).html(this.template({
editorName: this.editor,
newCount: r
}));
if (this.trainer.doneForToday() || this.trainer.hasTrainedBefore()) i = this.trainer.trainedTodayCount(), n = this.trainer.dueTomorrowCount(), t = this.trainer.dueShortcutsCount(), e = this.trainer.daysLastCount(), this.$("#intervals-view").html(this.intervalsStats({
newCount: r,
dueCount: t,
trainedTodayCount: i,
dueTomorrowCount: n,
daysLastCount: e
})), r + t === 0 && (this.$("#no-interval-training-left").show(), this.$("#intervals-continue-training").hide());
return this
}, t.prototype.clickedGetStarted = function () {
var e, t = this;
return mixpanel.people.increment("Interval Count"), mixpanel.track("Interval Started", {
editor: (e = app.user) != null ? e.defaultEditor : void 0
}), this.$("#stats-header").fadeOut(), this.$("#intervals-not-started, #intervals-stats").fadeOut(function () {
return t.$("#intervals-not-started").remove(), t.initTraining()
})
}, t.prototype.clickedIntervalsGoHome = function () {
return app.navigate("app", {
trigger: !0
})
}, t.prototype.clickedIntervalsGoPlans = function () {
return app.navigate("app/plans", {
trigger: !0
})
}, t.prototype.initTraining = function () {
return app.dispatcher.on("keyPressed", this.handleKeyEvent), this.$("#intervals-view").html(this.intervalTemplate()), this.$("#interval-help").hide(), this.$("#practice-options").html(this.legend({
isWin7: this.isWindows7orLess()
})), this.$("#rating").hide(), this.$("#current-shortcut").fadeIn(), this.trainer.start(), this.startCursor()
}, t.prototype.trainingCompleted = function () {
var e, t;
return this.trainingComplete = !0, app.dispatcher.off("keyPressed", this.handleKeyEvent), this.stopCursor(), t = app.user.logNum === 2345456567, e = t ? "Sign up to continue training" : "We will notify you via email when it's time for your next training session", this.$("#intervals-view").html(this.intervalsComplete({
isGuest: t,
completedText: e
}))
}, t.prototype.intervalShortcutsLoaded = function () {
return this.displayCurrentAndNextShortcuts()
}, t.prototype.blinkCursor = function () {
return $(".blinking-cursor").animate({
opacity: "toggle"
}, "fast", "swing")
}, t.prototype.startCursor = function () {
var e = this;
return $(".blinking-cursor").show(), this.cursorBlink && clearInterval(this.cursorBlink), this.cursorBlink = setInterval(function () {
return e.blinkCursor()
}, 600)
}, t.prototype.stopCursor = function () {
$(".blinking-cursor").hide();
if (this.cursorBlink) return clearInterval(this.cursorBlink)
}, t.prototype.displayCurrentAndNextShortcuts = function () {
var e;
if (this.trainingComplete) return;
this.keysDrawn = !1, this.trainer.currentShortcut().get("lastStudied") ? this.$("#interval-help").fadeOut() : (this.keysDrawn = !0, this.$("#current-shortcut .keys").html("<div style='display: inline-block; width: 1px'><span class='blinking-cursor'>|</span></div><span class='untyped-keys'>" + this.trainer.currentShortcut().toString() + "</span>"), this.$("#interval-help").fadeIn()), e = this.$("#current-shortcut .description"), e.html(this.trainer.currentShortcut().get("description")), e.stop(), e.css("top", "0px"), e.css("left", "0px"), e.css("opacity", "0"), e.animate({
top: "-=30px",
left: "-=30px"
}, 0), e.animate({
top: "+=30px",
left: "+=30px",
opacity: "1"
}, 200, "easeOutQuart");
if (this.trainer.currentShortcut().get("timesReviewed") === 1) return this.drawKeysAfterTimeout()
}, t.prototype.keypressSucceeded = function (e, t) {
this.$(".blinking-cursor").remove();
if (!t.get("lastStudied") || this.keysDrawn) return this.$("#current-shortcut .keys").html("<span class='correct-key'>" + (t.previousKeys() + t.currentKeyToString()) + "</span><div style='display: inline-block; width: 1px'><span class='blinking-cursor'>|</span></div><span class='untyped-keys'>" + t.remainingKeys() + "</span>");
this.$("#current-shortcut .keys").html("<span class='correct-key'>" + (t.previousKeys() + t.currentKeyToString()) + "</span><div style='display: inline-block; width: 1px'><span class='blinking-cursor'>|</span></div>");
if (t.get("timesReviewed") === 1) return this.drawKeysAfterTimeout()
}, t.prototype.keypressFailed = function (e, t) {
return this.cancelDrawKeyTimeout(), this.keysDrawn ? this.$("#current-shortcut .keys").html("<span class='correct-key'>" + t.previousKeys() + "<span class='incorrect-key'>" + t.currentKeyToString() + "</span>") : this.$("#current-shortcut .keys").append("<span class='incorrect-key'>" + e + "</span>")
}, t.prototype.shortcutSucceeded = function (e) {
return this.currentShortcut = e, this.showRatings()
}, t.prototype.shortcutFailed = function (e) {
return this.currentShortcut = e, this.$("#current-shortcut .keys").append("<span class='untyped-keys'>" + e.remainingKeys() + "</span>"), this.showRatings()
}, t.prototype.showRatings = function () {
return this.waitingForRating = !0, this.stopCursor(), this.$("#current-shortcut").animate({
opacity: .5
}), this.$("#rating").fadeIn(100)
}, t.prototype.rating1Clicked = function () {
return this.ratingCaptured(1)
}, t.prototype.rating2Clicked = function () {
return this.ratingCaptured(2)
}, t.prototype.rating3Clicked = function () {
return this.ratingCaptured(3)
}, t.prototype.rating4Clicked = function () {
return this.ratingCaptured(4)
}, t.prototype.ratingCaptured = function (e) {
if (!this.waitingForRating) return;
return this.currentShortcut.proccessRecall(e), this.$("#current-shortcut").animate({
opacity: 1
}), this.$("#rating").fadeOut(100), this.waitingForRating = !1, this.startCursor(), this.$("#current-shortcut .keys").html("<div style='display: inline-block; width: 1px'><span class='blinking-cursor'>|</span></div>"), this.trainer.moveToNextShortcut(), this.displayCurrentAndNextShortcuts()
}, t.prototype.checkForNumberTyped = function (e) {
switch (e) {
case "1":
return this.rating1Clicked();
case "2":
return this.rating2Clicked();
case "3":
return this.rating3Clicked();
case "4":
return this.rating4Clicked()
}
}, t.prototype.handleKeyEvent = function (e, t, n) {
var r;
r = (n.target || n.srcElement).tagName;
if (r === "INPUT" || r === "SELECT" || r === "TEXTAREA") return;
if (n.type === "keydown" && e !== "shift" && e !== "ctrl" && e !== "alt" && e !== "meta") return this.waitingForRating ? this.checkForNumberTyped(e) : (this.trainer.processKeyEvent(e, t, n), Shortcut.stopEventIfMatchesKeys(e, t, n));
if (n.type === "keypress" && e !== "shift" && e !== "ctrl" && e !== "alt" && e !== "meta") return this.waitingForRating ? this.checkForNumberTyped(e) : this.trainer.processKeyEvent(e, t, n)
}, t.prototype.clickedIntervalSettings = function () {
return app.user.sendIntervalEmails || (this.$("#intervals-email-no").addClass("active"), this.$("#intervals-email-yes").removeClass("active")), this.$(".interval-new-count").removeClass("active"), this.$("#intervals-new-" + app.user.newIntervalsPerDay).addClass("active"), this.$("#action-modal").modal("show")
}, t.prototype.clickedCancelSettings = function () {
return this.$("#action-modal").modal("hide")
}, t.prototype.clickedSaveSettings = function () {
var e, t, n, r, i, s, o = this;
s = this.$("#intervals-email-yes").hasClass("active") ? !0 : !1, n = parseInt(this.$("#intervals-new-btn-group").find(".active").html()), t = app.user.sendIntervalEmails !== s, i = app.user.newIntervalsPerDay !== n;
if (!t && !i) {
this.$("#action-modal").modal("hide");
return
}
return app.user.sendIntervalEmails = s, app.user.newIntervalsPerDay = n, i && (r = this.trainer.resetNewShortcutList(), this.$("#not-started-new-count").html(r), this.trainer.totalShortcutsCount() === 0 ? (this.$("#no-interval-training-left").show(), this.$("#intervals-continue-training").hide()) : (this.$("#no-interval-training-left").hide(), this.$("#intervals-continue-training").show())), app.user.nextDrill !== 9344 ? this.$("#action-modal").modal("hide") : (this.$("#save-settings").button("loading"), e = {
send_interval_emails: s,
new_intervals_per_day: n
}, $.post("/api/intervals/settings.json", e, function (e) {
return o.$("#save-settings").button("reset"), o.$("#action-modal").modal("hide")
}))
}, t.prototype.clickedResetInterval = function () {
var e, t = this;
if (confirm("Are you sure you want to reset interval training for " + this.editor + "?")) return app.user.nextDrill !== 9344 ? this.$("#action-modal").modal("hide") : (this.$("#reset-intervals").button("loading"), e = {
editor: this.editor
}, $.post("/api/intervals/reset.json", e, function (e) {
return t.$("#reset-intervals").button("reset"), t.$("#action-modal").modal("hide"), t.trainer.resetForEditor(t.editor), t.trainer.initTraining(), t.render()
}))
}, t.prototype.isWindows7orLess = function () {
var e;
return e = navigator.userAgent, $.browser.msie || e.indexOf("Windows NT 7.0") !== -1 || e.indexOf("Windows NT 6.1") !== -1 || e.indexOf("Windows NT 5.1") !== -1 || e.indexOf("Windows XP") !== -1
}, t.prototype.leave = function () {
return this.off(), this.stopListening(), this.stopCursor(), this.remove()
}, t
}(Backbone.View)
}.call(this),
function () {
var e = {}.hasOwnProperty,
t = function (t, n) {
function i() {
this.constructor = t
}
for (var r in n) e.call(n, r) && (t[r] = n[r]);
return i.prototype = n.prototype, t.prototype = new i, t.__super__ = n.prototype, t
};
window.MenuView = function (e) {
function n() {
return n.__super__.constructor.apply(this, arguments)
}
return t(n, e), n.prototype.template = JST["backbone/templates/menuhorizontal"], n.prototype.id = "menu", n.prototype.tagName = "span", n.prototype.events = {
"click #menu-home-link": "home",
"click #menu-drills-link": "drills",
"click #menu-practice-link": "practice",
"click #menu-bundles-link": "bundles",
"click #menu-shortcuts-link": "shortcuts",
"click #menu-upgrade-link": "upgrade",
"click #menu-intervals-link": "intervals",
"click #menu-help": "help"
}, n.prototype.render = function () {
return $(this.el).html(this.template({})), (app.user.logNum === "1123445" || app.user.logNum === "77788888" || app.user.logNum === "88877777") && this.$("#menu-upgrade-link").hide(), this
}, n.prototype.home = function () {
return app.navigate("app", {
trigger: !0
})
}, n.prototype.drills = function () {
return app.navigate("app/drills", {
trigger: !0,
replace: !0
})
}, n.prototype.practice = function () {
return app.navigate("app/practice", {
trigger: !0
})
}, n.prototype.bundles = function () {
return app.navigate("app/bundles", {
trigger: !0
})
}, n.prototype.shortcuts = function () {
return app.navigate("app/shortcuts", {
trigger: !0
})
}, n.prototype.upgrade = function () {
return typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Guest", "Menu Sign Up Clicked"]), app.navigate("app/plans", {
trigger: !0
})
}, n.prototype.intervals = function () {
return app.navigate("app/intervals", {
trigger: !0
})
}, n.prototype.help = function () {
return this.activate("help")
}, n
}(Backbone.View)
}.call(this),
function () {}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.EditShortcutView = function (e) {
function t() {
var e = this;
return this.removeShortcutConfirmed = function () {
return t.prototype.removeShortcutConfirmed.apply(e, arguments)
}, this.resetStatsConfirmed = function () {
return t.prototype.resetStatsConfirmed.apply(e, arguments)
}, this.handleKeyEvent = function (n, r, i) {
return t.prototype.handleKeyEvent.apply(e, arguments)
}, this.render = function () {
return t.prototype.render.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/editshortcutview"], t.prototype.id = "edit-shortcut", t.prototype.initialize = function () {
return this.shortcut = this.options.shortcut, this.tmpShortcut = new window.Shortcut({
sequence: this.shortcut.get("sequence")
}), this.isRecording = !1, app.dispatcher.on("editorPicked", this.editorPicked)
}, t.prototype.events = {
"click #record": "record",
"click #keys": "record",
"click #save": "save",
"focus #description": "descriptionFocused",
"click .reset-stats": "resetStats",
"click .delete": "removeShortcut",
"click #action-confirmation-cancel": "cancelAction",
"click #action-confirmation-button": "performAction"
}, t.prototype.render = function () {
var e, t, n;
return n = this.shortcut.get("editor") || app.user.defaultEditor, t = "New Shortcut", this.shortcut.id && (t = "Edit Shortcut"), e = this.shortcut.exists(), $(this.el).html(this.template({
pageName: t,
showChecks: app.user.logNum === 9987278364,
isExistingShortcut: e
})), this.editorPicker = new window.EditorPickerView({
selectedEditor: n
}), this.$("#editor").replaceWith(this.editorPicker.render().el), this.setFields(), this
}, t.prototype.setFields = function () {
return this.$("#description").val(this.shortcut.get("description")), this.$("#keys").html(this.shortcut.toString())
}, t.prototype.descriptionFocused = function () {
return this.isRecording = !0, this.record()
}, t.prototype.blinkCursor = function () {
return $(".blinking-cursor").animate({
opacity: "toggle"
}, "fast", "swing")
}, t.prototype.stopCursor = function () {
if (this.cursorBlink) return clearInterval(this.cursorBlink)
}, t.prototype.record = function () {
var e = this;
return this.isRecording ? (this.stopCursor(), this.$(".blinking-cursor").remove(), this.isRecording = !1, this.$("#buttons-help").html("Press record to start typing your shortcut."), app.dispatcher.off("keyPressed", this.handleKeyEvent), this.$("#record").html('<i class="icon-play-circle"></i> Record')) : ($("#keys-help").html(""), $("#keys-control-group").removeClass("error"), $("#buttons-control-group").removeClass("error"), this.isRecording = !0, this.tmpShortcut.clearKeys(), this.$("#keys").html(""), this.$("#keys").append("<span class='blinking-cursor'>|</span>"), this.$("#buttons-help").html("Begin typing your shortcut. Press stop when you are done."), app.dispatcher.on("keyPressed", this.handleKeyEvent), this.$("#record").html('<i class="icon-stop"></i> Stop'), this.cursorBlink = setInterval(function () {
return e.blinkCursor()
}, 600))
}, t.prototype.handleKeyEvent = function (e, t, n) {
var r, i, s, o, u, a, f, l;
l = (n.target || n.srcElement).tagName;
if (l === "INPUT" || l === "SELECT" || l === "TEXTAREA") return;
f = _.find(t, function (e) {
return e === "shift"
}) ? !0 : !1, r = _.find(t, function (e) {
return e === "alt"
}) ? !0 : !1, i = _.find(t, function (e) {
return e === "meta"
}) ? !0 : !1, s = _.find(t, function (e) {
return e === "ctrl"
}) ? !0 : !1, this.tmpShortcut.set("editor", this.editorPicker.editorName());
if (e !== "shift" && e !== "alt" && e !== "meta" && e !== "ctrl" && n.type === "keydown") {
e = "" + e, o = e.toUpperCase(), this.tmpShortcut.addKey({
key: o,
shift: f,
ctrl: s,
alt: r,
cmd: i
});
if (Shortcut.stopEventIfMatchesKeys(e, t, n) || r || s || i) this.$(".blinking-cursor").remove(), this.$("#keys").append(this.tmpShortcut.prevKeyToString() + "<span class='blinking-cursor'>|</span>");
return this.keyAdded = !1, !0
}
if (e !== "shift" && e !== "alt" && e !== "meta" && e !== "ctrl" && n.type === "keypress" && !this.keyAdded) return o = e, u = o, a = this.tmpShortcut.prevKey(), a.keyPressKey = e, !r && !i && !s && (this.$(".blinking-cursor").remove(), u = this.tmpShortcut.prevKeyToString(), this.$("#keys").append(u + "<span class='blinking-cursor'>|</span>")), this.keyAdded = !0, n.preventDefault()
}, t.prototype.save = function () {
var e, t, n, r, i;
this.cursorBlink && clearInterval(this.cursorBlink), n = !1, t = this.$("#description").val(), !t || !t.match(/\S/) ? (n = !0, $("#description-help").html("Please enter a description"), $("#description-control-group").addClass("error")) : ($("#description-help").html(""), $("#description-control-group").removeClass("error")), this.tmpShortcut.get("sequence").length === 0 ? (n = !0, $("#keys-control-group").addClass("error"), $("#buttons-control-group").addClass("error")) : ($("#keys-help").html(""), $("#keys-control-group").removeClass("error"));
if (!n) return this.shortcut.set("description", t), this.shortcut.set("sequence", this.tmpShortcut.get("sequence")), this.shortcut.set("editor", this.editorPicker.editorName()), r = app.user.logNum === 9987278364 && $("#locked").is(":checked"), e = app.user.logNum === 9987278364 && $("#all").is(":checked"), i = app.user.logNum === 9987278364 && $("#stay").is(":checked"), r && this.shortcut.set("locked", r), e && this.shortcut.set("all", e), app.shortcutRepository.saveOrUpdate(this.shortcut), i ? (this.shortcut = new window.Shortcut, this.tmpShortcut = new window.Shortcut, this.setFields()) : app.back("app/shortcuts")
}, t.prototype.resetStats = function () {
return $("#action-confirmation-title").html("Confirm Reset"), $("#action-confirmation-header").html("Are you sure you want to reset this shortcut's accuracy?"), $("#action-confirmation-body").html(""), $("#action-confirmation-button").html("Reset this shortcut"), $("#action-modal").modal("show")
}, t.prototype.resetStatsConfirmed = function () {
var e;
e = app.keys[this.shortcut.get("parentId")];
if (e.get("numCorrect") !== 0 || e.get("numIncorrect") !== 0) typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Shortcuts", "Reset Stats via View", e != null ? e.get("description") : void 0]), e.set("numCorrect", 0), e.set("numIncorrect", 0), app.user.nextDrill === 9344 && $.ajax({
url: "/api/stats.json",
type: "POST",
data: JSON.stringify([e.toStatJSON()]),
mimeType: "application/json",
contentType: "application/json"
});
return $("#action-modal").on("hidden", function () {
var e;
return $(".alert").remove(), e = JST["backbone/templates/error"]({
message: "<strong>Shortcut accuracy has been reset.</strong>"
}), $("#notifications").prepend(e), $(".alert").fadeOut(0), $(".alert").fadeIn("fast")
}), $("#action-modal").modal("hide")
}, t.prototype.removeShortcutConfirmed = function () {
var e, t = this;
return e = app.keys[this.shortcut.get("parentId")], e.set("removed", !0), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Shortcuts", "Delete via View", e != null ? e.get("description") : void 0]), app.user.nextDrill === 9344 && $.ajax({
url: "/api/shortcuts/" + e.get("parentId") + "/remove.json",
type: "POST",
mimeType: "application/json",
contentType: "application/json"
}), $("#action-modal").on("hidden", function () {
return app.back("app/shortcuts")
}), $("#action-modal").modal("hide")
}, t.prototype.removeShortcut = function () {
return $("#action-confirmation-title").html("Confirm Delete"), $("#action-confirmation-header").html("Are you sure you want to delete this shortcut?"), $("#action-confirmation-body").html(""), $("#action-confirmation-button").html("Delete this shortcut"), $("#action-modal").modal("show")
}, t.prototype.performAction = function (e) {
var t;
t = $(e.currentTarget).text(), t === "Reset this shortcut" && this.resetStatsConfirmed();
if (t === "Delete this shortcut") return this.removeShortcutConfirmed()
}, t.prototype.cancelAction = function () {
return $("#action-modal").modal("hide")
}, t.prototype.isNumber = function (e) {
return !isNaN(parseFloat(e)) && isFinite(e)
}, t.prototype.leave = function () {
return this.off(), this.stopListening(), this.stopCursor(), this.remove()
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.EditShortcutsView = function (e) {
function t() {
var e = this;
return this.undoFilters = function () {
return t.prototype.undoFilters.apply(e, arguments)
}, this.applyFilters = function () {
return t.prototype.applyFilters.apply(e, arguments)
}, this.filterAccuracy = function (n) {
return t.prototype.filterAccuracy.apply(e, arguments)
}, this.filterEditor = function (n) {
return t.prototype.filterEditor.apply(e, arguments)
}, this.filterBundle = function (n) {
return t.prototype.filterBundle.apply(e, arguments)
}, this.render = function () {
return t.prototype.render.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/editshortcutsview"], t.prototype.id = "shortcuts", t.prototype.events = {
"click #add-new-shortcut": "addNewShortcut"
}, t.prototype.initialize = function () {
return app.dispatcher.on("shortcutUpdated", this.render), app.dispatcher.on("editorChanged", this.filterEditor), app.dispatcher.on("bundleFiltered", this.filterBundle), app.dispatcher.on("accuracyFiltered", this.filterAccuracy), app.dispatcher.on("undoFilters", this.undoFilters), this.bundleFilter = "Any"
}, t.prototype.render = function () {
var e;
return this.unfilteredShortcuts = app.shortcutRepository.shortcuts, this.filteredShortcuts = this.unfilteredShortcuts, this.editorFilter = app.user.defaultEditor, this.filteredShortcuts.editorFilter = this.editorFilter, this.filteredShortcuts.bundleFilter = this.bundleFilter, $(this.el).html(this.template({})), e = new ShortcutsFilterView({
selectedEditor: this.editorFilter,
bundles: app.bundleRepository.get("bundles").models
}), this.$("#shortcut-filters").html(e.render().el), this.searchShortcutsTableView = new ShortcutsTableView({
collection: this.filteredShortcuts.applyFilters(),
button: "none",
tableId: "shortcuts"
}), this.$("#shortcut-items").html(this.searchShortcutsTableView.render().el), this
}, t.prototype.addNewShortcut = function () {
return app.navigate("app/shortcuts/new", {
trigger: !0
})
}, t.prototype.filterBundle = function (e) {
return this.bundleFilter = e, this.applyFilters()
}, t.prototype.filterEditor = function (e) {
return this.editorFilter = e, this.bundleFilter = "Any", this.render()
}, t.prototype.filterAccuracy = function (e) {
return this.accuracyFilter = e, this.applyFilters()
}, t.prototype.applyFilters = function () {
return this.unfilteredShortcuts = app.shortcutRepository.shortcuts, this.filteredShortcuts = this.unfilteredShortcuts, this.filteredShortcuts.editorFilter = this.editorFilter || "Any", this.filteredShortcuts.bundleFilter = this.bundleFilter || "Any", this.filteredShortcuts.accuracyFilter = this.accuracyFilter || "Any", this.filteredShortcuts = this.filteredShortcuts.applyFilters(), this.searchShortcutsTableView.collection = this.filteredShortcuts, this.searchShortcutsTableView.render()
}, t.prototype.undoFilters = function () {
return this.editorFilter = app.user.defaultEditor, this.bundleFilter = "Any", this.accuracyFilter = "Any", this.applyFilters()
}, t.prototype.leave = function () {
return this.off(), this.stopListening(), this.remove()
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.ShortcutsFilterView = function (e) {
function t() {
var e = this;
return this.undoFilters = function () {
return t.prototype.undoFilters.apply(e, arguments)
}, this.filterAccuracy = function (n) {
return t.prototype.filterAccuracy.apply(e, arguments)
}, this.filterEditor = function (n) {
return t.prototype.filterEditor.apply(e, arguments)
}, this.filterBundle = function (n) {
return t.prototype.filterBundle.apply(e, arguments)
}, this.selectFilteredAccuracy = function (n) {
return t.prototype.selectFilteredAccuracy.apply(e, arguments)
}, this.selectFilteredEditor = function (n) {
return t.prototype.selectFilteredEditor.apply(e, arguments)
}, this.selectFilteredBundle = function (n) {
return t.prototype.selectFilteredBundle.apply(e, arguments)
}, this.render = function () {
return t.prototype.render.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/shortcutsfilterview"], t.prototype.events = {
"click .filter-editor": "filterEditor",
"click .filter-bundle": "filterBundle",
"click .filter-accuracy": "filterAccuracy"
}, t.prototype.initialize = function () {
return this.selectedEditor = this.options.selectedEditor, this.bundles = this.options.bundles, this.editorFilter = "Any", this.selectedBundle = "Any", app.dispatcher.on("undoFilters", this.undoFilters)
}, t.prototype.render = function () {
return $(this.el).html(this.template({
selectedEditor: this.selectedEditor,
bundles: this.bundles,
selectedBundle: this.selectedBundle
})), this
}, t.prototype.selectFilteredBundle = function (e) {
return this.selectedBundle = e, this.$("#filter-bundle-choice").html("" + e + " <b class='caret'></b>")
}, t.prototype.selectFilteredEditor = function (e) {
return this.selectedEditor = e, this.selectedBundle = "Any", this.render()
}, t.prototype.selectFilteredAccuracy = function (e) {
return this.$("#filter-accuracy-choice").html("" + e + " <b class='caret'></b>")
}, t.prototype.filterBundle = function (e) {
this.bundleFilter = $(e.currentTarget).text(), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Shortcuts", "Filter", this.bundleFilter]), this.selectFilteredBundle(this.bundleFilter);
if (app.dispatcher) return app.dispatcher.trigger("bundleFiltered", this.bundleFilter)
}, t.prototype.filterEditor = function (e) {
return this.editorFilter = $(e.currentTarget).text(), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Shortcuts", "Filter", this.editorFilter]), this.selectFilteredEditor(this.editorFilter), app.dispatcher && app.dispatcher.trigger("editorSelected", this.editorFilter), app.user.defaultEditor = this.editorFilter
}, t.prototype.filterAccuracy = function (e) {
var t;
t = $(e.currentTarget).text(), this.selectFilteredAccuracy(t), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Shortcuts", "Filter", t]), t === "<= 100%" ? this.accuracyFilter = 100 : t === "<= 75%" ? this.accuracyFilter = 75 : t === "<= 50%" ? this.accuracyFilter = 50 : t === "<= 25%" ? this.accuracyFilter = 25 : this.accuracyFilter = t;
if (app.dispatcher) return app.dispatcher.trigger("accuracyFiltered", this.accuracyFilter)
}, t.prototype.undoFilters = function () {
return typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Shortcuts", "Filter", "undo"]), this.selectedEditor = app.user.defaultEditor, this.selectedBundle = "Any", this.render()
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.ShortcutsTableView = function (e) {
function t() {
var e = this;
return this.confirmOperation = function (n) {
return t.prototype.confirmOperation.apply(e, arguments)
}, this.removePermClicked = function (n) {
return t.prototype.removePermClicked.apply(e, arguments)
}, this.removeClicked = function (n) {
return t.prototype.removeClicked.apply(e, arguments)
}, this.resetStatsClicked = function (n) {
return t.prototype.resetStatsClicked.apply(e, arguments)
}, this.setSortAttrs = function (n) {
return t.prototype.setSortAttrs.apply(e, arguments)
}, this.sortShortcuts = function () {
return t.prototype.sortShortcuts.apply(e, arguments)
}, this.sortAccuracy = function () {
return t.prototype.sortAccuracy.apply(e, arguments)
}, this.sortKeys = function () {
return t.prototype.sortKeys.apply(e, arguments)
}, this.sortDescription = function () {
return t.prototype.sortDescription.apply(e, arguments)
}, this.editShortcut = function (n) {
return t.prototype.editShortcut.apply(e, arguments)
}, this.render = function () {
return t.prototype.render.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/shortcutstableview"], t.prototype.initialize = function () {
this.sortBy = "description", this.sortAsc = !0, this.editOnClick = this.options.editOnClick;
if (typeof this.editOnClick == "undefined") return this.editOnClick = !0
}, t.prototype.events = {
"click #sort-description": "sortDescription",
"click #sort-keys": "sortKeys",
"click #sort-accuracy": "sortAccuracy",
"click #undo-filters": "undoFilters",
"click .shortcut-row": "editShortcut",
"click .reset-stats": "resetStatsClicked",
"click .delete": "removeClicked",
"click .delete-perm": "removePermClicked",
"click .confirm-operation": "confirmOperation",
"click .cancel-operation": "cancelOperation",
"mouseenter .shortcut-row": "showSettings",
"mouseleave .shortcut-row": "hideSettings",
"mouseenter .icon-cog": "fadeCogIn",
"mouseleave .icon-cog": "fadeCogOut"
}, t.prototype.showSettings = function (e) {
return $(e.currentTarget).find(".settings-toggle").css("opacity", "1")
}, t.prototype.hideSettings = function (e) {
return $(e.currentTarget).find(".settings-toggle").css("opacity", "0")
}, t.prototype.fadeCogIn = function (e) {
return $(e.currentTarget).css("opacity", "1")
}, t.prototype.fadeCogOut = function (e) {
return $(e.currentTarget).css("opacity", ".5")
}, t.prototype.render = function () {
return this.sortShortcuts(), $(this.el).html(this.template({
shortcuts: this.collection,
button: this.options.button,
tableId: this.options.tableId,
sortBy: this.sortBy,
sortAsc: this.sortAsc
})), this.collection.length > 0 && this.$("#no-shortcuts-selected").fadeOut(0), this
}, t.prototype.editShortcut = function (e) {
var t, n, r;
if (!this.editOnClick) return;
r = e.srcElement || e.target, n = r.tagName;
if (n !== "TD") return;
return t = e.currentTarget.id, app.navigate("app/shortcuts/" + t, {
trigger: !0
})
}, t.prototype.sortDescription = function () {
return this.setSortAttrs("description")
}, t.prototype.sortKeys = function () {
return this.setSortAttrs("keys")
}, t.prototype.sortAccuracy = function () {
return this.setSortAttrs("accuracy")
}, t.prototype.sortShortcuts = function () {
var e = this;
this.collection.comparator = function (t) {
return e.sortBy === "keys" ? t.sortString(e.sortAsc) : e.sortBy === "accuracy" ? t.accuracyToNum() : e.sortAsc ? t.get("locked") ? t.get(e.sortBy).toLowerCase() : t.get(e.sortBy).toUpperCase() : t.get("locked") ? t.get(e.sortBy).toUpperCase() : t.get(e.sortBy).toLowerCase()
}, this.collection.sort();
if (!this.sortAsc) return this.collection.models.reverse()
}, t.prototype.setSortAttrs = function (e) {
return this.sortBy === e && (this.sortAsc = !this.sortAsc), this.sortBy = e, typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Shortcuts", "Sort", e]), this.render()
}, t.prototype.undoFilters = function () {
if (app.dispatcher) return app.dispatcher.trigger("undoFilters")
}, t.prototype.resetStatsClicked = function (e) {
var t, n;
return n = $(e.currentTarget).parents("tr").first(), t = n.find(".confirm-operation"), t.text("Reset"), this.showConfirmationButtons(n)
}, t.prototype.removeClicked = function (e) {
var t, n;
return n = $(e.currentTarget).parents("tr").first(), t = n.find(".confirm-operation"), t.text("Delete"), this.showConfirmationButtons(n)
}, t.prototype.removePermClicked = function (e) {
var t, n;
return n = $(e.currentTarget).parents("tr").first(), t = n.find(".confirm-operation"), t.text("Del Perm"), this.showConfirmationButtons(n)
}, t.prototype.showConfirmationButtons = function (e) {
var t, n, r, i, s, o;
return i = e.find(".confirmation-buttons"), n = e.find(".settings-toggle"), t = e.find(".accuracy-container"), t.fadeOut(), r = e.find(".confirm-operation"), o = e.attr("id"), s = app.keys[o], i.show(), n.hide(), i.animate({
opacity: "1"
}, 300)
}, t.prototype.confirmOperation = function (e) {
var t, n;
n = $(e.currentTarget).parents("tr").first(), t = n.find(".confirm-operation"), t.text() === "Reset" && this.resetStats(e), t.text() === "Delete" && this.deleteShortcut(e);
if (t.text() === "Del Perm") return this.deleteShortcutPerm(e)
}, t.prototype.cancelOperation = function (e) {
var t, n, r, i;
return i = $(e.currentTarget).parents("tr").first(), r = i.find(".confirmation-buttons"), n = i.find(".settings-toggle"), t = i.find(".accuracy-container"), r.animate({
opacity: "0"
}, 100, function () {
return r.hide(), n.show(), t.fadeIn()
})
}, t.prototype.resetStats = function (e) {
var t, n, r, i, s, o, u;
s = $(e.currentTarget).parents("tr").first(), i = s.find(".confirmation-buttons"), n = s.find(".accuracy-container"), r = s.find(".settings-toggle"), u = s.attr("id"), o = app.keys[u];
if (o.get("numCorrect") !== 0 || o.get("numIncorrect") !== 0) typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Shortcuts", "Reset Stats", o != null ? o.get("description") : void 0]), o.set("numCorrect", 0), o.set("numIncorrect", 0), t = s.find(".shortcut-accuracy"), t.html("--"), app.user.nextDrill === 9344 && $.ajax({
url: "/api/stats.json",
type: "POST",
data: JSON.stringify([o.toStatJSON()]),
mimeType: "application/json",
contentType: "application/json"
});
return i.animate({
opacity: "0"
}, 100, function () {
return i.hide(), r.show(), n.fadeIn()
})
}, t.prototype.deleteShortcut = function (e) {
var t, n, r, i, s, o;
return i = $(e.currentTarget).parents("tr").first(), r = i.find(".confirmation-buttons"), t = i.find(".accuracy-container"), n = i.find(".settings-toggle"), o = i.attr("id"), s = app.keys[o], s.set("removed", !0), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Shortcuts", "Delete", s != null ? s.get("description") : void 0]), app.user.nextDrill === 9344 && $.ajax({
url: "/api/shortcuts/" + s.get("parentId") + "/remove.json",
type: "POST",
mimeType: "application/json",
contentType: "application/json"
}), i.fadeOut(function () {
return i.remove(), app.dispatcher.trigger("shortcutRemoved", s)
})
}, t.prototype.deleteShortcutPerm = function (e) {
var t, n, r, i, s, o;
return i = $(e.currentTarget).parents("tr").first(), r = i.find(".confirmation-buttons"), t = i.find(".accuracy-container"), n = i.find(".settings-toggle"), o = i.attr("id"), s = app.keys[o], s.set("removed", !0), app.user.nextDrill === 9344 && $.ajax({
url: "/api/shortcuts/" + s.get("parentId") + "/removeperm.json",
type: "POST",
mimeType: "application/json",
contentType: "application/json"
}), i.fadeOut(function () {
return i.remove(), app.dispatcher.trigger("shortcutRemoved", s)
})
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.StatsView = function (e) {
function t() {
var e = this;
return this.render = function () {
return t.prototype.render.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/statsview"], t.prototype.id = "stats", t.prototype.className = "span2", t.prototype.initialize = function () {
return this.model.on("change", this.render)
}, t.prototype.render = function () {
return $(this.el).html(this.template(this.model.toJSON())), this
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.ThankyouView = function (e) {
function t() {
var e = this;
return this.goHome = function () {
return t.prototype.goHome.apply(e, arguments)
}, this.render = function () {
return t.prototype.render.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/thankyou"], t.prototype.id = "thanks", t.prototype.events = {
"click #go-home": "goHome"
}, t.prototype.render = function () {
var e, t, n, r, i, s;
return this.token = this.options.token, t = this.token ? "Purchase Complete!" : "Upgrade Complete!", i = this.token ? "Your registration link is:" : "Thanks for upgrading.", r = this.token ? "https://www.shortcutfoo.com/register/" + this.token : "", n = this.token ? "Share this link with team members you'd like to sign up. <b>Keep it safe and secret!</b>" : "", $(this.el).html(this.template({
header: t,
thankyou: i,
registrationLink: r,
keepSecret: n
})), this.token || this.$("#registration-link").remove(), this.token || this.$("#go-home").css("margin-top", "50px"), this.token && this.$("#go-home").html("Go to my registration page"), e = typeof app != "undefined" && app !== null ? (s = app.user) != null ? s.defaultEditor : void 0 : void 0, mixpanel.track("Upgrade Completed", {
editor: e
}), this
}, t.prototype.goHome = function () {
return this.token ? window.location = "/register/" + this.token : (app.justUpgraded = !0, app.navigate("app", {
trigger: !0
}))
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.EnterpriseView = function (e) {
function t() {
var e = this;
return this.render = function () {
return t.prototype.render.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/enterpriseview"], t.prototype.id = "enterprise", t.prototype.initialize = function () {
return this.numberOfSeats = 1
}, t.prototype.events = {
"keyup #seat-count": "seatCountChanged",
"propertychange #seat-count": "seatCountChaged",
"input #seat-count": "seatCountChaged",
"click #pricing-signup-enterprise": "signupClicked"
}, t.prototype.seatCountChanged = function (e) {
var t, n;
t = parseInt($("#seat-count").val()), n = t * 29.99, n = n.toFixed(2);
if (this.isNumber(n) && t >= 1) return this.numberOfSeats = t, $("#total-enterprise-cost").html(n)
}, t.prototype.signupClicked = function () {
return app.navigate("app/upgrade/enterprise/" + this.numberOfSeats, {
trigger: !0
})
}, t.prototype.render = function () {
var e, t;
return $(this.el).html(this.template()), e = typeof app != "undefined" && app !== null ? (t = app.user) != null ? t.defaultEditor : void 0 : void 0, mixpanel.track("Enterprise Page Viewed", {
editor: e
}), this
}, t.prototype.isNumber = function (e) {
return !isNaN(parseFloat(e)) && isFinite(e)
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.PaypalUpgradeView = function (e) {
function t() {
var e = this;
return this.render = function () {
return t.prototype.render.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/paypalupgradeview"], t.prototype.id = "upgrade", t.prototype.events = {
"click .submit-button": "submitPayment"
}, t.prototype.render = function () {
var e, t;
return this.plan = this.options.plan, this.seats = this.options.seats, e = this.priceForPlan(), $(this.el).html(this.template({
shortcutCount: this.shortcutCountForPlan(),
bundleCount: this.bundleCountForPlan(),
editorCount: this.editorCountForPlan(),
price: this.priceForPlan(),
plan: this.plan
})), this.plan === "enterprise" && (t = this.seats === "1" ? "seat" : "seats", this.$(".seat-count-description").html(" (" + this.seats + " " + t + ")")), this.$("#spinner").hide(), this
}, t.prototype.priceForPlan = function () {
return this.plan === "basic" ? this.basicPrice() : this.plan === "pro" ? this.proPrice() : this.plan === "enterprise" ? this.enterprisePrice() : this.ultimatePrice()
}, t.prototype.basicPrice = function () {
return "$4.99"
}, t.prototype.proPrice = function () {
return app.user.logNum === "333224556" ? "$4.99" : "$9.99"
}, t.prototype.ultimatePrice = function () {
return app.user.logNum === "333224556" ? "$9.99" : app.user.logNum === "6444445" ? "$4.99" : "$14.99"
}, t.prototype.enterprisePrice = function () {
var e;
return e = this.seats * 29.99, e = e.toFixed(2), "$" + e
}, t.prototype.shortcutCountForPlan = function () {
return this.plan === "basic" ? "30" : this.plan === "pro" ? "90" : "unlimited"
}, t.prototype.bundleCountForPlan = function () {
return this.plan === "basic" ? "3" : this.plan === "pro" ? "9" : "unlimited"
}, t.prototype.editorCountForPlan = function () {
return this.plan === "basic" ? "1 editor's" : this.plan === "pro" ? "3 editors" : "all editors"
}, t.prototype.submitPayment = function () {
var e, t, n, r, i, s, o, u, a, f, l = this;
$(".control-group").removeClass("error"), $(".input-help").html(""), a = !0;
if (app.user.nextDrill !== 9344 || this.plan === "enterprise") $("#email").val() ? ($("#email-help").html(""), $("#email-control-group").removeClass("error")) : ($("#email-help").html("Please enter your email address"), $("#email-control-group").addClass("error"), a = !1), this.plan !== "enterprise" && ($("#password").val() ? ($("#password-help").html(""), $("#password-control-group").removeClass("error")) : ($("#password-help").html("Please enter a password"), $("#password-control-group").addClass("error"), a = !1), $("#password").val() !== $("#password-confirmation").val() ? ($("#password-confirmation-help").html("Passwords do not match"), $("#password-confirmation-control-group").addClass("error"), a = !1) : ($("#password_confirmation_help").html(""), $("#password_confirmation_control_group").removeClass("error")));
return a ? (this.$(".submit-button").attr("disabled", "disabled"), this.$("#spinner").fadeIn(), u = this.options.token, i = this.options.payerId, s = this.options.plan, o = this.seats, this.plan === "enterprise" && (e = $("#company").val()), app.user.nextDrill !== 9344 && (n = $("#email").val()), t = typeof app != "undefined" && app !== null ? (f = app.user) != null ? f.defaultEditor : void 0 : void 0, app.user.nextDrill !== 9344 && (r = $("#password").val()), $.post("/api/upgrade.json", {
plan: s,
seats: o,
token: u,
payerId: i,
email: n,
password: r,
editor: t,
company: e
}, function (e) {
var t, n;
return e.errors ? ($(".alert").remove(), t = JST["backbone/templates/error"]({
message: e.errors
}), $("#upgrade-form").prepend(t), /email is already registered/.test(e.errors) && ($("#email-help").html("Email already taken."), $("#email-control-group").addClass("error")), $(".alert").fadeOut(0), $(".alert").fadeIn("fast"), l.$(".submit-button").attr("disabled", !1), l.$("#spinner").fadeOut(), typeof _gaq != "undefined" && _gaq !== null ? _gaq.push(["_trackEvent", "Upgrading", "Submit Payment Error", t]) : void 0) : (n = e.registrationToken ? "/app/thankyou/" + e.registrationToken : "/app/thankyou", window.location.replace(n))
}).error(function () {
var e;
return $(".alert").remove(), e = JST["backbone/templates/error"]({
message: "There was an error processing your payment. Please try again or contact support@shortcutfoo.com."
}), $("#upgrade-form").prepend(e), $(".alert").fadeOut(0), $(".alert").fadeIn("fast"), l.$(".submit-button").attr("disabled", !1), l.$("#spinner").fadeOut(), typeof _gaq != "undefined" && _gaq !== null ? _gaq.push(["_trackEvent", "Upgrading", "Submit Payment Error", e]) : void 0
}), !1) : !1
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.PricingView = function (e) {
function t() {
var e = this;
return this.render = function () {
return t.prototype.render.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/pricingview"], t.prototype.id = "pricing", t.prototype.events = {
"click #pricing-signup-basic": "pricingSignupBasicClicked",
"click #pricing-signup-pro": "pricingSignupProClicked",
"click #pricing-signup-ultimate": "pricingSignupUltimateClicked",
"click #sign_team_link": "signupTeamClicked"
}, t.prototype.render = function () {
var e, t, n, r, i, s;
return e = this.basicPrice(), n = this.proPrice(), i = this.ultimatePrice(), r = app.user.email === "Guest" ? "Sign Up With" : "Upgrade To", $(this.el).html(this.template({
basicPrice: e,
proPrice: n,
ultimatePrice: i,
signUpText: r
})), this.disablePlansAlreadyBought(), t = typeof app != "undefined" && app !== null ? (s = app.user) != null ? s.defaultEditor : void 0 : void 0, mixpanel.track("Pricing Page Viewed", {
editor: t
}), this
}, t.prototype.disablePlansAlreadyBought = function () {
if (app.user.logNum === "333224556") return this.$("#basic-plan").addClass("disabled"), this.$("#pricing-signup-basic").addClass("disabled");
if (app.user.logNum === "6444445") return this.$("#basic-plan").addClass("disabled"), this.$("#pro-plan").addClass("disabled"), this.$("#pricing-signup-basic").addClass("disabled"), this.$("#pricing-signup-pro").addClass("disabled")
}, t.prototype.basicPrice = function () {
return app.user.logNum === "333224556" || app.user.logNum === "6444445" ? "$0.00" : "$4.99"
}, t.prototype.proPrice = function () {
return app.user.logNum === "6444445" ? "$0.00" : app.user.logNum === "333224556" ? "$4.99" : "$9.99"
}, t.prototype.ultimatePrice = function () {
return app.user.logNum === "333224556" ? "$9.99" : app.user.logNum === "6444445" ? "$4.99" : "$14.99"
}, t.prototype.pricingSignupBasicClicked = function () {
var e, t;
if (this.$("#pricing-signup-basic").hasClass("disabled")) return;
return e = typeof app != "undefined" && app !== null ? (t = app.user) != null ? t.defaultEditor : void 0 : void 0, mixpanel.track("Pricing Signup Basic Clicked", {
editor: e
}), app.navigate("app/upgrade/basic", {
trigger: !0
})
}, t.prototype.pricingSignupProClicked = function () {
var e, t;
if (this.$("#pricing-signup-pro").hasClass("disabled")) return;
return e = typeof app != "undefined" && app !== null ? (t = app.user) != null ? t.defaultEditor : void 0 : void 0, mixpanel.track("Pricing Signup Pro Clicked", {
editor: e
}), app.navigate("app/upgrade/pro", {
trigger: !0
})
}, t.prototype.pricingSignupUltimateClicked = function () {
var e, t;
return e = typeof app != "undefined" && app !== null ? (t = app.user) != null ? t.defaultEditor : void 0 : void 0, mixpanel.track("Pricing Signup Ultimate Clicked", {
editor: e
}), app.navigate("app/upgrade/ultimate", {
trigger: !0
})
}, t.prototype.signupTeamClicked = function () {
return app.navigate("app/plans/enterprise", {
trigger: !0
})
}, t
}(Backbone.View)
}.call(this),
function () {
var e = this,
t = {}.hasOwnProperty,
n = function (e, n) {
function i() {
this.constructor = e
}
for (var r in n) t.call(n, r) && (e[r] = n[r]);
return i.prototype = n.prototype, e.prototype = new i, e.__super__ = n.prototype, e
};
window.UpgradeView = function (e) {
function t() {
var e = this;
return this.stripeResponseHandler = function (n, r) {
return t.prototype.stripeResponseHandler.apply(e, arguments)
}, this.promoClicked = function () {
return t.prototype.promoClicked.apply(e, arguments)
}, this.render = function () {
return t.prototype.render.apply(e, arguments)
}, this.checkoutWithPaypalClicked = function () {
return t.prototype.checkoutWithPaypalClicked.apply(e, arguments)
}, t.__super__.constructor.apply(this, arguments)
}
return n(t, e), t.prototype.template = JST["backbone/templates/upgradeview"], t.prototype.id = "upgrade", t.prototype.initialize = function () {
return this.plan = this.options.plan, this.seats = this.isNumber(this.options.seats) ? this.options.seats : "1"
}, t.prototype.events = {
"click .submit-button": "submitPayment",
"click #received-promo-code": "promoClicked",
"click #apply-promo": "applyPromo",
"change #cc-number": "ccChanged",
"keyup #cc-number": "ccChanged",
"click #pay-with-card": "payWithCard",
"click #pay-with-paypal": "payWithPayPal",
"click #checkout-with-paypal": "checkoutWithPaypalClicked",
"click #free_register": "freeRegister"
}, t.prototype.payWithCard = function () {
return $("#billing-info").show(), $("#promo-form").show(), $("#checkout-with-paypal").hide()
}, t.prototype.payWithPayPal = function () {
return $("#billing-info").hide(), $("#promo-form").hide(), $("#checkout-with-paypal").show()
}, t.prototype.checkoutWithPaypalClicked = function () {
return window.location = "/paypal-checkout/" + this.plan + "/" + this.seats
}, t.prototype.freeRegister = function () {
return typeof _gaq != "undefined" && _gaq !== null ? _gaq.push(["_trackEvent", "Guest", "Upgrade For Free Clicked"]) : void 0
}, t.prototype.ccChanged = function () {
var e;
return e = Stripe.cardType($("#cc-number").val()), e === "Visa" ? ($(".card").stop().fadeTo("slow", .33), $("#visa").stop().fadeTo("fast", 1)) : e === "American Express" ? ($(".card").stop().fadeTo("slow", .33), $("#american-express").stop().fadeTo("fast", 1)) : e === "MasterCard" ? ($(".card").stop().fadeTo("slow", .33), $("#mastercard").stop().fadeTo("fast", 1)) : e === "Discover" ? ($(".card").stop().fadeTo("slow", .33), $("#discover").stop().fadeTo("fast", 1)) : $(".card").stop().fadeTo("fast", 1)
}, t.prototype.render = function () {
var e, t, n, r;
return t = this.plan === "basic" ? "editor" : "editors", $(this.el).html(this.template({
editorText: t,
shortcutCount: this.shortcutCountForPlan(),
bundleCount: this.bundleCountForPlan(),
editorCount: this.editorCountForPlan(),
price: this.priceForPlan(),
plan: this.plan
})), (this.plan === "ultimate" || this.plan === "enterprise") && this.$("#will-select-editors").hide(), this.plan === "enterprise" && (n = this.seats === "1" ? "seat" : "seats", this.$(".seat-count-description").html(" (" + this.seats + " " + n + ")")), this.$("#spinner").hide(), e = typeof app != "undefined" && app !== null ? (r = app.user) != null ? r.defaultEditor : void 0 : void 0, mixpanel.track("Upgrade Page Viewed", {
editor: e
}), this
}, t.prototype.shortcutCountForPlan = function () {
return this.plan === "basic" ? "30" : this.plan === "pro" ? "90" : "unlimited"
}, t.prototype.bundleCountForPlan = function () {
return this.plan === "basic" ? "3" : this.plan === "pro" ? "9" : "unlimited"
}, t.prototype.editorCountForPlan = function () {
return this.plan === "basic" ? "1 editor's" : this.plan === "pro" ? "3 editors" : "all editors"
}, t.prototype.priceForPlan = function () {
return this.plan === "basic" ? this.basicPrice() : this.plan === "pro" ? this.proPrice() : this.plan === "enterprise" ? this.enterprisePrice() : this.ultimatePrice()
}, t.prototype.basicPrice = function () {
return "$4.99"
}, t.prototype.proPrice = function () {
return app.user.logNum === "333224556" ? "$4.99" : "$9.99"
}, t.prototype.ultimatePrice = function () {
return app.user.logNum === "333224556" ? "$9.99" : app.user.logNum === "6444445" ? "$4.99" : "$14.99"
}, t.prototype.enterprisePrice = function () {
var e;
return e = this.seats * 29.99, e = e.toFixed(2), "$" + e
}, t.prototype.promoClicked = function () {
return this.$("#promo-field-set").html(' <div class="control-group" id="promo-control-group"> <label class="control-label" for="promo">Promo Code</label> <div class="controls"> <input type="text" class="span2" id="promo"> <p class="help-inline input-help" id="promo-help"></p> <div class="help-block"><a id="apply-promo" style="cursor: pointer; margin-left: 105px;">Apply</a></div> </div> </div>'), typeof _gaq != "undefined" && _gaq !== null ? _gaq.push(["_trackEvent", "Upgrading", "Click", "Promo"]) : void 0
}, t.prototype.applyPromo = function () {
var e, t, n, r, i, s, o = this;
$(".control-group").removeClass("error"), $(".input-help").html(""), i = !0, r = $("#promo").val(), app.user.nextDrill !== 9344 && (t = $("#email").val()), e = typeof app != "undefined" && app !== null ? (s = app.user) != null ? s.defaultEditor : void 0 : void 0, app.user.nextDrill !== 9344 && (n = $("#password").val()), app.user.nextDrill !== 9344 && ($("#email").val() ? ($("#email-help").html(""), $("#email-control-group").removeClass("error")) : ($("#email-help").html("Please enter your email address"), $("#email-control-group").addClass("error"), i = !1), $("#password").val() ? ($("#password-help").html(""), $("#password-control-group").removeClass("error")) : ($("#password-help").html("Please enter a password"), $("#password-control-group").addClass("error"), i = !1), $("#password").val() !== $("#password-confirmation").val() ? ($("#password-confirmation-help").html("Passwords do not match"), $("#password-confirmation-control-group").addClass("error"), i = !1) : ($("#password_confirmation_help").html(""), $("#password_confirmation_control_group").removeClass("error")));
if (!r || !r.match(/\S/)) $("#promo-help").html("Please enter a promo code"), $("#promo-control-group").addClass("error"), i = !1;
return i ? $.post("/api/promo.json", {
promo: r,
email: t,
password: n,
editor: e
}, function (e) {
return e.errors ? ($("#promo-help").html(e.errors), $("#promo-control-group").addClass("error"), typeof _gaq != "undefined" && _gaq !== null ? _gaq.push(["_trackEvent", "Upgrading", "Promo Failed", r]) : void 0) : (window.location.replace("/app/thankyou"), typeof _gaq != "undefined" && _gaq !== null ? _gaq.push(["_trackEvent", "Upgrading", "Promo Success", r]) : void 0)
}) : !1
}, t.prototype.submitPayment = function () {
var e, t, n, r;
$(".control-group").removeClass("error"), $(".input-help").html(""), n = $("#name").val(), e = $("#cc-number").val(), t = $("#cvc").val(), r = !0;
if (app.user.nextDrill !== 9344 || this.plan === "enterprise") $("#email").val() ? ($("#email-help").html(""), $("#email-control-group").removeClass("error")) : ($("#email-help").html("Please enter your email address"), $("#email-control-group").addClass("error"), r = !1), this.plan !== "enterprise" && ($("#password").val() ? ($("#password-help").html(""), $("#password-control-group").removeClass("error")) : ($("#password-help").html("Please enter a password"), $("#password-control-group").addClass("error"), r = !1), $("#password").val() !== $("#password-confirmation").val() ? ($("#password-confirmation-help").html("Passwords do not match"), $("#password-confirmation-control-group").addClass("error"), r = !1) : ($("#password_confirmation_help").html(""), $("#password_confirmation_control_group").removeClass("error")));
if (!n || !n.match(/\S/)) $("#name-help").html("Please enter your name"), $("#name-control-group").addClass("error"), r = !1;
if (!e || !e.match(/\S/)) $("#cc-help").html("Please enter your card number"), $("#cc-control-group").addClass("error"), r = !1;
if (!t || !t.match(/\S/)) $("#cvc-help").html("Please enter your card cvc"), $("#cvc-control-group").addClass("error"), r = !1;
return Stripe.validateExpiry($("#exp-date-month").val(), $("#exp-day-year").val()) || ($("#expiration-help").html("Date must be in the future"), $("#expiration-control-group").addClass("error"), r = !1), r ? (this.$(".submit-button").attr("disabled", "disabled"), this.$("#spinner").fadeIn(), Stripe.createToken({
name: n,
address_zip: $("#zip").val(),
number: $("#cc-number").val(),
cvc: $("#cvc").val(),
exp_month: $("#exp-date-month").val(),
exp_year: $("#exp-day-year").val()
}, this.stripeResponseHandler), !1) : !1
}, t.prototype.stripeResponseHandler = function (e, t) {
var n, r, i, s, o, u, a, f, l, c = this;
return t.error ? (this.$(".submit-button").attr("disabled", !1), t.error.code === "invalid_number" ? ($("#cc-help").html(t.error.message), $("#cc-control-group").addClass("error")) : t.error.code === "invalid_expiry_month" || t.error.code === "invalid_expiry_year" ? ($("#expiration-help").html(t.error.message), $("#expiration-control-group").addClass("error")) : t.error.code === "invalid_cvc" ? ($("#cvc-help").html(t.error.message), $("#cvc-control-group").addClass("error")) : ($(".alert").remove(), u = JST["backbone/templates/error"]({
message: t.error.message
}), $("#upgrade-form").prepend(u), $(".alert").fadeOut(0), $(".alert").fadeIn("fast"), this.$(".submit-button").attr("disabled", !1)), typeof _gaq != "undefined" && _gaq !== null && _gaq.push(["_trackEvent", "Upgrading", "Submit Payment Error", t.error.code]), this.$("#spinner").fadeOut()) : (f = t.id, i = "", o = "", s = $("#name").val(), n = this.plan === "enterprise" ? $("#company").val() : "", a = this.seats, app.user.nextDrill !== 9344 && (i = $("#email").val()), r = typeof app != "undefined" && app !== null ? (l = app.user) != null ? l.defaultEditor : void 0 : void 0, app.user.nextDrill !== 9344 && (o = $("#password").val()), $.post("/api/upgrade.json", {
plan: this.plan,
token: f,
name: s,
ccheck: t.cvc_check,
zcheck: t.address_zip_check,
email: i,
password: o,
editor: r,
company: n,
seats: a
}, function (e) {
var t;
return e.errors ? ($(".alert").remove(), /email is already registered/.test(e.errors) && ($("#email-help").html("Email already taken."), $("#email-control-group").addClass("error")), u = JST["backbone/templates/error"]({
message: e.errors
}), $("#upgrade-form").prepend(u), $(".alert").fadeOut(0), $(".alert").fadeIn("fast"), c.$(".submit-button").attr("disabled", !1), c.$("#spinner").fadeOut(), typeof _gaq != "undefined" && _gaq !== null ? _gaq.push(["_trackEvent", "Upgrading", "Submit Payment Error", u]) : void 0) : (t = e.registrationToken ? "/app/thankyou/" + e.registrationToken : "/app/thankyou", window.location.replace(t))
}).error(function () {
return $(".alert").remove(), u = JST["backbone/templates/error"]({
message: "There was an error processing your card. Please try again or contact support@shortcutfoo.com."
}), $("#upgrade-form").prepend(u), $(".alert").fadeOut(0), $(".alert").fadeIn("fast"), c.$(".submit-button").attr("disabled", !1), c.$("#spinner").fadeOut(), typeof _gaq != "undefined" && _gaq !== null ? _gaq.push(["_trackEvent", "Upgrading", "Submit Payment Error", u]) : void 0
}))
}, t.prototype.isNumber = function (e) {
return !isNaN(parseFloat(e)) && isFinite(e)
}, t
}(Backbone.View)
}.call(this),
function () {
window.loadSocialButtons = function () {
return window.twttr = function (e, t, n) {
var r, i, s = e.getElementsByTagName(t)[0];
if (e.getElementById(n)) return;
return i = e.createElement(t), i.id = n, i.src = "//platform.twitter.com/widgets.js", s.parentNode.insertBefore(i, s), window.twttr || (r = {
_e: [],
ready: function (e) {
r._e.push(e)
}
})
}(document, "script", "twitter-wjs"),
function () {
var e = document.createElement("script");
e.type = "text/javascript", e.async = !0, e.src = "https://apis.google.com/js/plusone.js";
var t = document.getElementsByTagName("script")[0];
t.parentNode.insertBefore(e, t)
}(),
function (e, t, n) {
var r, i = e.getElementsByTagName(t)[0];
if (e.getElementById(n)) return;
r = e.createElement(t), r.id = n, r.src = "//connect.facebook.net/en_US/all.js#xfbml=1", i.parentNode.insertBefore(r, i)
}(document, "script", "facebook-jssdk")
}, $(document).ready(function () {
var e, t, n = this;
return window._gaq = window._gaq || [], window.loadSocialButtons(), e = function (e, t) {
var n, r;
if (!e) return;
r = new RegExp("[\\?&#]" + t + "=([^&#]*)"), n = r.exec(e);
if (n != null) return unescape(n[1])
}, t = function (t) {
var n, r, i;
if (t) return r = typeof Backbone != "undefined" && Backbone !== null ? (i = Backbone.history) != null ? i.getFragment() : void 0 : void 0, t.target && t.target.nodeName === "IFRAME" && (n = e(t.target.src, "url")), _gaq.push(["_trackSocial", "twitter", t.type, n, r])
}, window.fbAsyncInit = function () {
return FB.Event.subscribe("edge.create", function (e) {
var t, n;
return t = typeof Backbone != "undefined" && Backbone !== null ? (n = Backbone.history) != null ? n.getFragment() : void 0 : void 0, _gaq.push(["_trackSocial", "facebook", "like", e, t])
}), FB.Event.subscribe("edge.remove", function (e) {
var t, n;
return t = typeof Backbone != "undefined" && Backbone !== null ? (n = Backbone.history) != null ? n.getFragment() : void 0 : void 0, _gaq.push(["_trackSocial", "facebook", "unlike", e, t])
})
}, twttr.ready(function (e) {
return e.events.bind("tweet", t), e.events.bind("click", t), e.events.bind("follow", t)
})
})
}.call(this);
@itamargal
Copy link

Is this enough to run a local clone of the site?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment