diff --git a/html/views/history/history.js b/html/views/history/history.js index f8d6f64..9b1b30e 100644 --- a/html/views/history/history.js +++ b/html/views/history/history.js @@ -45,6 +45,33 @@ var Commit = function(obj) { }; + +var confirm_gist = function(confirmation_message) { + + // Check whether github user/token are set in .gitconfig + // If yes, we can paste without waiting for confirmation + token = Controller.getConfig_("github.token"); + login = Controller.getConfig_("github.user"); + if (token && login) { + gistie(); + return; + } + + // Set optional confirmation_message + confirmation_message = confirmation_message || "Yes. Paste this commit."; + // Show div#notification, since it?s set to display:none; by default + $("notification").style.display = ""; + // Reset the class (and therefore the color) + $("notification").setAttribute("class", ""); + // Hide img#spinner, since it?s visible by default + $("spinner").style.display = "none"; + // Insert the verification links into div#notification_message + $("notification_message").innerHTML = 'This will upload your commit to http://gist.github.com/' + + '
Are you sure you want to continue?

' + + 'No. Cancel. | ' + + '' + confirmation_message + ''; +} + var gistie = function() { notify("Uploading code to Gistie..", 0); diff --git a/html/views/history/index.html b/html/views/history/index.html index e5a5cf9..1fdba5d 100644 --- a/html/views/history/index.html +++ b/html/views/history/index.html @@ -14,7 +14,7 @@
- + Gist it