]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
Integrate Firefox Social API for bookmarking
authorChristian Weiske <cweiske@cweiske.de>
Wed, 21 Jan 2015 21:05:12 +0000 (22:05 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Wed, 21 Jan 2015 21:05:12 +0000 (22:05 +0100)
data/templates/default/bookmarklet.inc.php
data/templates/default/top.inc.php
www/themes/default/images/logo-empty.png [new file with mode: 0644]
www/themes/default/scuttle.css

index c93f58165b0368533c81f16de73660b3298f035a..b2037355adec472e1c4ddf12893b1b502235bcf9 100644 (file)
@@ -115,3 +115,38 @@ echo jsEscTitle(htmlspecialchars($link));
 }
 //]]>
 </script>
+
+
+<script type="text/javascript">
+function activateSocialApi(node) {
+    var baseurl = <?php echo json_encode(addProtocolToUrl(createURL())); ?>;
+    var socialApiData = {
+        // currently required
+        "name": <?php echo json_encode($GLOBALS['sitename']); ?>,
+        "iconURL":   baseurl + "themes/default/images/logo.png",
+        "icon32URL": baseurl + "themes/default/images/logo.png",
+        "icon64URL": baseurl + "themes/default/images/logo.png",
+
+        "markURL": "<?php echo addProtocolToUrl(createURL('bookmarks', $GLOBALS['user'])); ?>?action=add&amp;popup=1&amp;width=800&amp;height=470&amp;address=%{url}&amp;title=%{title}&amp;description=%{description}%{text}",
+        "markedIcon":   baseurl + "themes/default/images/logo.png",
+        "unmarkedIcon": baseurl + "themes/default/images/logo-empty.png",
+
+        // should be available for display purposes
+        "description": "Self-hosted bookmark manager",
+        "author": "Christian Weiske",
+        "homepageURL": "http://semanticscuttle.sf.net/",
+
+        // optional
+        "version": "0.0.3"
+    };
+
+    var event = new CustomEvent("ActivateSocialFeature");
+    node.setAttribute("data-service", JSON.stringify(socialApiData));
+    node.dispatchEvent(event);
+}
+</script>
+<p>
+  <button onclick="activateSocialApi(this)" title="activate semanticscuttle in firefox">
+    Add SemanticScuttle to Firefox
+  </button>
+</p>
index 240e5b246e007d5d60dd8624b8754d749402e17d..55be4a7cc1e0f80b87c230db67c69a83b6b6e3e4 100644 (file)
@@ -30,11 +30,25 @@ if (isset($rsschannels)) {
 <?php endif ?>
 
  </head>
- <body>
+<?php
+$bodystyle = '';
+if (isset($_GET['popup'])) {
+    if (isset($_GET['height'])) {
+        $bodystyle .= 'height:' . intval($_GET['height']) . 'px;';
+    }
+    if (isset($_GET['width'])) {
+        $bodystyle .= 'width:' . intval($_GET['width']) . 'px;';
+    }
+    if ($bodystyle != '') {
+        $bodystyle = ' style="' . $bodystyle . '"';
+    }
+}
+?>
+ <body<?php echo $bodystyle; ?>>
 
 <?php
 $headerstyle = '';
-if(isset($_GET['popup'])) {
+if (isset($_GET['popup'])) {
        $headerstyle = ' class="popup"';
 }
 ?>
diff --git a/www/themes/default/images/logo-empty.png b/www/themes/default/images/logo-empty.png
new file mode 100644 (file)
index 0000000..4590098
Binary files /dev/null and b/www/themes/default/images/logo-empty.png differ
index 12a88fcca64105842bc70648413c8bdc1a4a20dc..c9d7293f99741ba019253e693ac88a86e3e8a279 100644 (file)
@@ -110,7 +110,8 @@ html > body h1 {
     padding-left: 75px;
 }
 html > body div#header.popup h1 {
-    background: url('images/logo_24.gif') no-repeat 10px;
+    background: url('images/logo.png') no-repeat 10px;
+    background-size: 24px;
     padding: 0.5em 0.5em 0.5em 50px;
 }
 /*html > body div#header #welcome {