Commits

Sam Skillman  committed a93daf7 Merge

merging.

  • Participants
  • Parent commits 6ec93eb, f1abb71

Comments (0)

Files changed (3)

File button.png

Added
New image
  function update_inventory(data) {
     gotten = data;
     posts = $("#content");
+    var this_uuid;
+    var base_loc = "https://bitbucket.org/" + bbuser + "/" + bbuser 
+                 + ".bitbucket.org/src/tip/";
     $.each(data, function(intIndex, objValue) {
-        //alert(objValue['modtime']);
-        posts.append("<div class='post_time grid_1'><a href='"+objValue['htmlname']+
+        this_uuid = objValue['fullname'].substring(6,42);
+        // embed code is the path to the post in the bitbucket repository, but
+        // with embed=t as a query
+        posts.append("<div class='post_time grid_1 alpha'><a href='"+objValue['htmlname']+
                      "'>"+objValue['modtime']+ "</a></div>");
         posts.append("<div class='post_name grid_4'>"+objValue['name'] + "</div>");
-        posts.append("<div class='post_links grid_1'>"+
+        posts.append("<div class='post_links grid_1 omega'>"+
                      "<a href='" + objValue['fullname'] + "'>raw</a></div>");
-        posts.append("<div class='post_desc grid_5 prefix_1'>" +
+        posts.append("<div class='grid_1 post_ebutton alpha'>" +
+                     "<a href='#' class='ebutton small'" +
+                     "onClick='var t = $(\"#"+this_uuid+"\");t.toggle();t.select();'" + 
+                     ">embed</a></div>");
+        posts.append("<div class='grid_5 post_embed omega'>" +
+                     "<input size=80 type='text' class='post_embed_input'"+
+                     "id='" + this_uuid + "'" +
+                     "value='<script src=\"" + base_loc + objValue['fullname'] + 
+                     "?embed=t\">" + "<\/script>'></div>");
+        posts.append("<div class='post_desc grid_5 prefix_1 alpha omega'>" +
                      objValue['descr'] + "</div>");
     });
  }
+ var bbuser;
  $(document).ready(function() {
+    var loc = window.location;
+    bbuser = loc.hostname.substring(0, loc.hostname.indexOf('.'));
+    if(bbuser.length == 0) { bbuser = "Unknown User"; }
+    $("#this_username").html(bbuser);
     update_inventory(inventory_data);
  });
 </script>    
 <body>
 <div id="header" class="container_6">
     <div class="grid_6">
-        <h1>My PasteBoard</h1>
+        <h1><span id="this_username">Nothing</span>'s PasteBoard</h1>
     </div>
 <div id="content" class="container_6">
 
     border-bottom: 1px solid #BBBBBB;
     padding-bottom: 25px;
 }
+
+.post_embed {
+    font-family: "Inconsolata";
+}
+
+.post_embed_input {
+    font-family: "Inconsolata";
+    display: none;
+    margin: -2px;
+}
+
+.post_ebutton a {
+    text-decoration: none;
+    font-family: "Inconsolata";
+    padding-top:10px;
+    padding-bottom:10px;
+}
+
+.ebutton {
+    padding: 5px 10px;
+    display: inline;
+    background: #777 url(button.png) repeat-x bottom;
+    border: none;
+    color: #fff;
+    cursor: pointer;
+    font-weight: bold;
+    border-radius: 5px;
+    -moz-border-radius: 5px;
+    -webkit-border-radius: 5px;
+    text-shadow: 1px 1px #666;
+    }
+.ebutton:hover {
+    background-position: 0 -48px;
+    }
+.ebutton:active {
+    background-position: 0 top;
+    position: relative;
+    top: 1px;
+    padding: 6px 10px 4px;
+    }
+.ebutton.red { background-color: #e50000; }
+.ebutton.purple { background-color: #9400bf; }
+.ebutton.green { background-color: #58aa00; }
+.ebutton.orange { background-color: #ff9c00; }
+.ebutton.blue { background-color: #2c6da0; }
+.ebutton.black { background-color: #333; }
+.ebutton.white { background-color: #fff; color: #000; text-shadow: 1px 1px #fff; }
+.ebutton.small { font-size: 75%; padding: 3px 7px; }
+.ebutton.small:hover { background-position: 0 -50px; }
+.ebutton.small:active { padding: 4px 7px 2px; background-position: 0 top; }
+.ebutton.large { font-size: 125%; padding: 7px 12px; }
+.ebutton.large:hover { background-position: 0 -35px; }
+.ebutton.large:active { padding: 8px 12px 6px; background-position: 0 top; }