mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-14 00:24:28 +02:00
almost can do tests
This commit is contained in:
parent
565142048c
commit
ddf399e099
10 changed files with 288 additions and 163 deletions
|
@ -16,5 +16,9 @@ _.each(toGlobalize, function(module) {
|
|||
_.extend(window, module);
|
||||
});
|
||||
|
||||
window.events = toGlobalize.Main.getEvents();
|
||||
$(document).ready(function() {
|
||||
window.events = toGlobalize.Main.getEvents();
|
||||
window.mainVis = toGlobalize.Main.getMainVis();
|
||||
window.ui = toGlobalize.Main.getMainVis();
|
||||
});
|
||||
|
||||
|
|
|
@ -1,5 +1,24 @@
|
|||
var _ = require('underscore');
|
||||
|
||||
exports.isBrowser = function() {
|
||||
var inBrowser = String(typeof window) !== 'undefined';
|
||||
return inBrowser;
|
||||
};
|
||||
|
||||
|
||||
exports.splitTextCommand = function(value, func, context) {
|
||||
func = _.bind(func, context);
|
||||
_.each(value.split(';'), function(command, index) {
|
||||
command = _.escape(command);
|
||||
command = command
|
||||
.replace(/^(\s+)/, '')
|
||||
.replace(/(\s+)$/, '')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, "'");
|
||||
|
||||
if (index > 0 && !command.length) {
|
||||
return;
|
||||
}
|
||||
func(command);
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue