47d52497b345133a802290ef1c27eae4aa0a2547 — Zack Scholl 3 years ago 8ce92cf
Fixed up the site, added to READMEy
3 files changed, 48 insertions(+), 18 deletions(-)

M README.md
M lib.py
M templates/index.html
M README.md => README.md +4 -0
@@ 36,6 36,10 @@   Try the demo [here](http://permalinker.duckdns.org/).
  
+ ## Todo
+ 
+ - Determine relative links and fill in the original address to be able to convert
+ 
  # References
  
  1. Markwell, John, and David W. Brooks. "“Link rot” limits the usefulness of web‐based educational materials in biochemistry and molecular biology*." Biochemistry and Molecular Biology Education 31.1 (2003): 69-72.

M lib.py => lib.py +1 -1
@@ 43,7 43,7 @@ if r.status_code == 201:
      result = json.loads(r.text)
      print json.dumps(result,indent=4)
-     return url,str('http://perma.cc/' + result['guid'])
+     return url,str('http://perma.cc/' + result['guid'] + '?type=source')
    else:
      return url,url
    

M templates/index.html => templates/index.html +43 -17
@@ 65,28 65,54 @@ </nav>
  
      <!-- Intro Section -->
-     <section id="intro" class="intro-section">
+  <section class="intro-section" id="intro">
          <div class="container">
              <div class="row">
                  <div class="col-lg-12">
                      <h1>Permalinker</h1>
-                     <p class="lead">Don't let your links rot! Type in any series of links, or text with links, and this tool will automatically make them permanent! Supports Markdown, HTML, or any sort of text or links.</p>
-                     <p>Automatically uses the <a href="https://archive.org/index.php">Internet Archive</a>. If you'd like to use <a href="https://perma.cc/login">perma.cc</a> instead, simply enter your <a href="https://perma.cc/settings/tools" target="_blank">API key</a>.</p>
-                     <textarea placeholder="Type in text or links or both." rows="10" style="width:100%;" name="comment[text]" class="ui-autocomplete-input" autocomplete="off" role="textbox" aria-autocomplete="list" aria-haspopup="true" id="inputtext"></textarea>
+ 
+                     <p class="lead">Don't let your links rot! Type in any
+                     series of links, or text with links, and this tool will
+                     automatically make them permanent! Supports Markdown, HTML,
+                     or any sort of text or links.</p>
+ 
+                     <p>Automatically uses the <a href=
+                     "https://archive.org/index.php">Internet Archive</a>. If
+                     you'd like to use <a href=
+                     "https://perma.cc/login">perma.cc</a> instead, simply enter
+                     your <a href="https://perma.cc/settings/tools" target=
+                     "_blank">API key</a>.</p>
+                     <textarea class="ui-autocomplete-input" id="inputtext"
+                     name="comment[text]" placeholder=
+                     "Type in text or links or both." rows="10" style=
+                     "width:100%;">
+ </textarea>
                  </div>
-                 <div class="col-xs-12">
- <form class="form-inline" action="javascript:void(0);">
-   <div class="form-group">
-     <label class="sr-only" for="apikey">Perm.cc API key</label>
-     <input type="input" class="form-control" id="apikey" placeholder="Perm.cc API key">
-   </div>
-   <button type="submit" class="btn btn-default" id="submitbutton">Generate permalinks!</button>
- </form>
+             </div>
  
+             <div class="row">
+                 <div class="col-xs-5 col-xs-offset-2">
+                     <label class="sr-only" for="apikey">Perm.cc API key</label>
+                     <input class="form-control" id="apikey" placeholder=
+                     "perm.cc API key (optional)" type="input">
                  </div>
-                 <div class="col-lg-12">
-                     <textarea placeholder="Type in text or links or both." rows="10" style="width:100%;" name="comment[text]" class="ui-autocomplete-input" autocomplete="off" role="textbox" aria-autocomplete="list" aria-haspopup="true" id="outputtext"></textarea>
+ 
+                 <div class="col-xs-2">
+                     <p style="text-align: left"><button class="btn btn-primary"
+                     id="submitbutton" type="submit">Generate
+                     permalinks!</button></p>
                  </div>
+ 
+                 <div class="col-xs-3"></div>
+             </div>
+ 
+             <div class="row">
+                 <div class="col-lg-12">
+                     <textarea class="ui-autocomplete-input" id="outputtext"
+                     name="comment[text]" placeholder=
+                     "Type in text or links or both." rows="10" style=
+                     "width:100%;">
+ </textarea>
                  </div>
              </div>
          </div>


@@ 97,11 123,11 @@ <section id="about" class="about-section">
          <div class="container">
              <div class="row">
-                 <div class="col-lg-12">
+                 <div class="col-xs-4 col-xs-offset-4">
                      <h1>Generating</h1>
-                     <center>
+ 
  <img src="http://www.ibm.com/social-business/us/en/images/socbiz-loader.gif" width=100px>
- </center>
+ 
                  </div>
              </div>
          </div>