From aa47584d18118ffbb9d1955198d6361dd9023b7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Champ=C3=A9mont?= Date: Wed, 1 Jun 2016 15:48:15 +0200 Subject: [PATCH 1/2] allow pasting a batch of commands, one on each line, into the text box --- js/controlbox.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/js/controlbox.js b/js/controlbox.js index b0e664d..dae68ba 100644 --- a/js/controlbox.js +++ b/js/controlbox.js @@ -76,6 +76,34 @@ define(['d3'], function () { } }); + input.on('paste', function() { + var e = d3.event; + + var pastedText = undefined; + if (window.clipboardData && window.clipboardData.getData) { // IE + pastedText = window.clipboardData.getData('Text'); + } else if (e.clipboardData && e.clipboardData.getData) { + pastedText = e.clipboardData.getData('text/plain'); + } + + var commands = []; + + if(pastedText.indexOf("\n") != -1) { + commands = pastedText.replace(/\\r+/g, '').split("\n"); + + commands.forEach(function(el) { + cBox._commandHistory.unshift(el); + cBox._tempCommand = ''; + cBox._currentCommand = -1; + cBox.command(el); + }); + + e.preventDefault(); + } + + e.stopImmediatePropagation(); + }); + this.container = cBoxContainer; this.log = log; this.input = input; From e2d09d70251d1ef09564f25c84ebc497a04b4987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Champ=C3=A9mont?= Date: Fri, 3 Jun 2016 15:30:27 +0100 Subject: [PATCH 2/2] add cherry-pick command --- js/controlbox.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/controlbox.js b/js/controlbox.js index dae68ba..381634d 100644 --- a/js/controlbox.js +++ b/js/controlbox.js @@ -189,6 +189,14 @@ define(['d3'], function () { } }, + "cherry-pick": function (args) { + if (args.length < 1) { + this.info('You need to give a commit ID'); + } else { + this.historyView.commit({},this.historyView.getCommit(args[0]).message); + } + }, + branch: function (args) { if (args.length < 1) { this.info(