Merge pull request #350 from bollwyvl/pg-permalink-popover
authorDavid I. Lehn <dil@lehn.org>
Thu, 15 May 2014 21:51:46 -0400
changeset 2155 a12ff6c6c901
parent 2152 829349eb856c (current diff)
parent 2154 523665ff5818 (diff)
child 2156 5ce9f694c385
Merge pull request #350 from bollwyvl/pg-permalink-popover

Changing permalink from tooltip to popover
--- a/playground/index.html	Mon May 12 16:24:40 2014 +0200
+++ b/playground/index.html	Thu May 15 21:51:46 2014 -0400
@@ -314,7 +314,7 @@
     <script src="//cdn.jsdelivr.net/g/[email protected],[email protected],[email protected],[email protected](codemirror.min.js+addon/lint/lint.js+addon/edit/matchbrackets.js+addon/edit/closebrackets.js+addon/display/placeholder.js+addon/hint/show-hint.js+mode/ntriples/ntriples.js+mode/javascript/javascript.js)"></script>
 
     <!-- local scripts -->
-    <script src="./jsonld.js"></script>
+    <script src="//cdnjs.cloudflare.com/ajax/libs/jsonld/0.2.8/jsonld.js"></script>
     <script src="./jsonlint.js"></script>
     <script src="./tv4.min.js"></script>
     <script src="./json-schema-lint.js"></script>
--- a/playground/playground.js	Mon May 12 16:24:40 2014 +0200
+++ b/playground/playground.js	Thu May 15 21:51:46 2014 -0400
@@ -850,19 +850,28 @@
 
     playground.permalink.title =  messages.danger + " " + messages.warning;
 
-    $("#permalink").tooltip({
+    $("#permalink").popover({
+      placement: "left",
       title: function(){
+        var title = $("<span/>");
+        title.append(
+          $("<span/>").text("Share this "),
+          $("<a/>", {
+            href: "http://tinyurl.com/create.php?url=" + loc +
+              hash.replace("#", "?"),
+              target: "_blank",
+              "class": "pull-right"
+          }).text("Shorten"));
+        return title[0];
+      },
+      content: function(){
         var tip = $("<p/>"),
           inp = $("<input/>", {
             "class": "span2",
             value: loc + hash,
             autofocus: true
           });
-        tip.append(
-          $("<span/>")
-            .text(playground.permalink.title.trim() + " Press Ctrl+C to copy."),
-          inp
-        );
+        tip.append(inp);
 
         setTimeout(function(){
           inp[0].select();