From b689ac6760c6046a029b2e70bf52292cc8e68e18 Mon Sep 17 00:00:00 2001 From: German Laullon Date: Fri, 31 Dec 2010 00:07:24 -0800 Subject: [PATCH] remove javascript and logs --- PBWebHistoryController.m | 1 - html/views/history/history.js | 92 ----------------------------------- 2 files changed, 93 deletions(-) diff --git a/PBWebHistoryController.m b/PBWebHistoryController.m index e4a583c..8abe82e 100644 --- a/PBWebHistoryController.m +++ b/PBWebHistoryController.m @@ -134,7 +134,6 @@ if([line length]==0){ black++; }else if(black==2){ - NSLog(@"l=%@",line); NSArray *file=[line componentsSeparatedByString:@"\t"]; if([file count]==3){ [stats setObject:file forKey:[file objectAtIndex:2]]; diff --git a/html/views/history/history.js b/html/views/history/history.js index 6bd97b3..8fd8c0a 100644 --- a/html/views/history/history.js +++ b/html/views/history/history.js @@ -1,106 +1,14 @@ -var confirm_gist = function(confirmation_message) { - if (!Controller.isFeatureEnabled_("confirmGist")) { - gistie(); - return; - } - - // Set optional confirmation_message - confirmation_message = confirmation_message || "Yes. Paste this commit."; - var deleteMessage = Controller.getConfig_("github.token") ? " " : "You might not be able to delete it after posting.
"; - var publicMessage = Controller.isFeatureEnabled_("publicGist") ? "public" : "private"; - // Insert the verification links into div#notification_message - var notification_text = 'This will create a ' + publicMessage + ' paste of your commit to http://gist.github.com/
' + - deleteMessage + - 'Are you sure you want to continue?

' + - 'No. Cancel. | ' + - '' + confirmation_message + ''; - - notify(notification_text, 0); - // Hide img#spinner, since it?s visible by default - $("spinner").style.display = "none"; -} - -var gistie = function() { - notify("Uploading code to Gistie..", 0); - - parameters = { - "file_ext[gistfile1]": "patch", - "file_name[gistfile1]": commit.object.subject.replace(/[^a-zA-Z0-9]/g, "-") + ".patch", - "file_contents[gistfile1]": commit.object.patch(), - }; - - // TODO: Replace true with private preference - token = Controller.getConfig_("github.token"); - login = Controller.getConfig_("github.user"); - if (token && login) { - parameters.login = login; - parameters.token = token; - } - if (!Controller.isFeatureEnabled_("publicGist")) - parameters.private = true; - - var params = []; - for (var name in parameters) - params.push(encodeURIComponent(name) + "=" + encodeURIComponent(parameters[name])); - params = params.join("&"); - - var t = new XMLHttpRequest(); - t.onreadystatechange = function() { - if (t.readyState == 4 && t.status >= 200 && t.status < 300) { - if (m = t.responseText.match(//)) - notify("Code uploaded to gistie #" + m[1] + "", 1); - else { - notify("Pasting to Gistie failed :(.", -1); - Controller.log_(t.responseText); - } - } - } - - t.open('POST', "https://gist.github.com/gists"); - t.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - t.setRequestHeader('Accept', 'text/javascript, text/html, application/xml, text/xml, */*'); - t.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); - - try { - t.send(params); - } catch(e) { - notify("Pasting to Gistie failed: " + e, -1); - } -} - var selectCommit = function(a) { Controller.selectCommit_(a); } -// Relead only refs -var reload = function() { - commit.reloadRefs(); - showRefs(); -} - var showImage = function(element, filename) { element.outerHTML = ''; return false; } -var enableFeature = function(feature, element) -{ - if(!Controller || Controller.isFeatureEnabled_(feature)) { - element.style.display = ""; - } else { - element.style.display = "none"; - } -} - -var enableFeatures = function() -{ - enableFeature("gist", $("gist")) -} - - var showDiff = function(data){ $("diff").innerHTML=data; - enableFeatures(); }