Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

removing github userscripts for now

These are just problematic, and let's face it, I can make changes much
more effectively now.
  • Loading branch information...
commit c681e838145389fefcdb609636f8b15a166f2697 1 parent de80fb2
Yossef Mendelssohn authored March 15, 2013
14  gist.github.com.js
... ...
@@ -1,14 +0,0 @@
1  
-function imageTagForString(str) {
2  
-  label = str.substr(1, str.length - 2);
3  
-  return "<img alt='" + str + "' title='" + str + 
4  
-         "' src='https://github.com/flogic/emogc/raw/master/images/" + label + ".png' />";
5  
-}
6  
-
7  
-$('*').replaceText(/:([a-z]\w*):(?!:)/gi, imageTagForString);
8  
-
9  
-
10  
-$("div.actions").prepend("<a href='#' id='soft-wrap'>wrap it</a>")
11  
-$("a#soft-wrap").click(function(event) {
12  
-  $("div.highlight pre").css("width", "590px").css("white-space", "pre-wrap")
13  
-  event.preventDefault()
14  
-})
46  github.com.js
... ...
@@ -1,46 +0,0 @@
1  
-function imageTagForString(str) {
2  
-  label = str.substr(1, str.length - 2);
3  
-  return "<img alt='" + str + "' title='" + str + 
4  
-         "' src='https://github.com/flogic/emogc/raw/master/images/" + label + ".png' />";
5  
-}
6  
-
7  
-if (!window.location.href.match('/raw/')) {
8  
-    $('*').replaceText(/:([a-z]\w*):(?!:)/gi, imageTagForString);
9  
-}
10  
-
11  
-
12  
-$("div.file ul.actions").prepend("<li><a href='https://gist.github.com/gists' id='gist-url'>gist it</a></li>")
13  
-
14  
-function buildGistForm() {
15  
-  $("body").append("\
16  
-    <div id='hiddenGistForm'> \
17  
-      <form action='https://gist.github.com/gists' method='post'> \
18  
-        <input type='text' name='file_name[gistfile1]' /> \
19  
-        <input type='text' name='file_ext[gistfile1]' /> \
20  
-        <textarea name='file_contents[gistfile1]'></textarea> \
21  
-        <button type='submit' name='action_button' value='private'>Create Private Gist</button> \
22  
-      </form> \
23  
-    </div> \
24  
-  ")
25  
-  $("div#hiddenGistForm").hide()
26  
-}
27  
-
28  
-function submitGistForm() {
29  
-  $('button[name=action_button]').click()
30  
-}
31  
-function setGistFormValues() {
32  
-  rawURL = $("ul.actions a#raw-url").attr("href")
33  
-  filename = rawURL.split("/").pop()
34  
-  $("form input[name='file_name[gistfile1]']").attr('value', filename)
35  
-  $.get(rawURL, function(data) { 
36  
-      $("form textarea[name='file_contents[gistfile1]']").attr('innerHTML', data)
37  
-      submitGistForm()
38  
-    }
39  
-  )
40  
-}
41  
-
42  
-$("a#gist-url").click(function(event) {
43  
-  event.preventDefault()
44  
-  buildGistForm()
45  
-  setGistFormValues()
46  
-})

0 notes on commit c681e83

Please sign in to comment.
Something went wrong with that request. Please try again.