#58 √ resolved
Corey

Suggestion: Usability of "Gist It" button

Reported by Corey | January 5th, 2009 @ 09:26 PM

I once hit this button to find out what it was for, and had code posted to Gist. There's apparently no way to remove something from Gist. This seems like the sort of thing that should be a) hideable through a preference, or b) require clicking a confirmation dialog.

Comments and changes to this ticket

  • Pieter de Bie

    Pieter de Bie January 6th, 2009 @ 01:38 PM

    It'll be hideable in the next version. If you don't have your github username / password set, it'll create a non-public gist. Otherwise you'll be able to delete it yourself.

    If you want a confirmation, it should be very easy to create, it's all in javascript :)

  • Pieter de Bie

    Pieter de Bie January 6th, 2009 @ 01:38 PM

    It'll be hideable in the next version. If you don't have your github username / password set, it'll create a non-public gist. Otherwise you'll be able to delete it yourself.

    If you want a confirmation, it should be very easy to create, it's all in javascript :)

  • mypapa12 (at gmail)

    mypapa12 (at gmail) January 6th, 2009 @ 02:58 PM

    here's a quick fix:

    • change the file GitX.app/Contents/Resources/html/views/history/history.js, add the line "return;" to the function gistie, like this:
    
    var gistie = function() {
      return;
      // ...
    

    It will prevent your private information from leaking on the internet, and

    • change the file GitX.app/Contents/Resources/html/views/history/index.html, comment out the content of the div#rightcontent, something like this:
    
    <div id="rightcontent">
      <!--
      <div id="buttons">
        <a class="servicebutton" onClick="gistie();return false" href='#'>
          Gist&nbsp;it
        </a>
      </div>
      <img id="gravatar" src="">
      -->
    </div>
    

    It will remove both the gist button, and the gravatar.

  • kwerle

    kwerle January 16th, 2009 @ 01:32 AM

    I clicked the button, not knowing what it was.

    As a result, I posted proprietary source code on the internet. Over http (in the clear), I suppose.

    Please add a confirmation, or at least a hover help message so folks know what they're getting into.

  • Pieter de Bie

    Pieter de Bie January 25th, 2009 @ 04:42 PM

    • → State changed from “new” to “open”

    I understand the problem. If anyone creates a patch, I'll include it, but I don't fancy doing it myself.

  • Dave Grijalva

    Dave Grijalva January 26th, 2009 @ 09:35 PM

    If we're going to do a confirmation box anyway, perhaps there should be an checkbox for creating "private" gist.

  • James T

    James T February 6th, 2009 @ 10:25 PM

    I had this issue today and uploaded some code I should not have.

    Linked below (posted via gist on purpose after my patch hehe) is a patch to offer a confirmation each time the gist button is pressed.

    Ideally this should be turned on/off via user preferences but I don't have time to get the Xcode project working properly (I can't get it to build for some reason)

    https://gist.github.com/fc3c9773...

    Tested here and seems to work fine. Could be a bit tidier but thought I would share as it is.

    Thanks,

    James

  • Pieter de Bie

    Pieter de Bie February 12th, 2009 @ 11:58 AM

    Thanks for the patch, I'll take a look at it later

  • rjb

    rjb March 18th, 2009 @ 05:36 AM

    • → Assigned user cleared.

    For anyone interested, I too created a quick patch that adds a confirmation message to the notification_message div.

    It is similar to the patch James T created, but I dumped everything into index.html instead of "rewriting" gistie().

    Pasted here: https://gist.github.com/db3f7470...

    I also blogged about it here: http://raffyjohn.com/2009/03/17/...

    What I did:

    Created a confirm_gist() method:

    
    <script type="text/javascript" charset="utf-8">
        var confirm_gist = function(confirmation_message) {
            // 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 = "";
            // 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/<br/>Are you sure you want to continue?<br/><br/>’ +
            ‘<a href="#" onClick="hideNotification();return false;">No. Cancel.</a> | ‘ +
            ‘<a href="#" onClick="gistie();return false;">’ + confirmation_message + ‘</a>’;
        }
    </script>
    

    And updated the 'Gist it' button onClick method:

    
    <a class="servicebutton" id="gist" onClick="confirm_gist();return false" href=‘#’>
        Gist it
    </a>
    

    I hope this can be of some help to someone.

  • James T
  • Pieter de Bie

    Pieter de Bie March 24th, 2009 @ 01:44 AM

    • → Assigned user set to “Pieter de Bie”

    This should really only be done if the user doesn't have a token set, because otherwise he can just delete the gist.

    That, or an option to never show the confirmation again.

  • Johannes Gilger

    Johannes Gilger March 26th, 2009 @ 12:50 PM

    Ok, I followed Pieter's thought and implemented the following behaviour:

    • Always ask for confirmation if github.user/token isn't set
    • Never ask for confirmation if is set

    I'm not big on preferences, so, if someone likes to take that up fine, but until then this is a viable compromise imho.

    The commit is on my bugfixes-branch at http://github.com/heipei/gitx/co...

  • Pieter de Bie

    Pieter de Bie March 27th, 2009 @ 03:44 PM

    • → State changed from “open” to “resolved”

    Thanks to Johannes' patch and a few tweaks from me, we now have confirmation with preferences.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

GitX is the nice-looking gitk clone for OS X

Tags