aboutsummaryrefslogtreecommitdiffstats
path: root/mod/ffsapi.php
diff options
context:
space:
mode:
authorWave <wave72@users.noreply.github.com>2015-11-06 09:09:58 +0100
committerWave <wave72@users.noreply.github.com>2015-11-06 09:09:58 +0100
commit30d083ac3cbdf36171cfee7b892271b9b587325c (patch)
treef2f63728f86f8336330d31ee8edf2fcd742dc71e /mod/ffsapi.php
parent50cf095c000813d0b1408d929c1fa7422b131a3d (diff)
parent4ca0c2cfd14df5e2b6e9c7f59a10628f7653d6a4 (diff)
downloadvolse-hubzilla-30d083ac3cbdf36171cfee7b892271b9b587325c.tar.gz
volse-hubzilla-30d083ac3cbdf36171cfee7b892271b9b587325c.tar.bz2
volse-hubzilla-30d083ac3cbdf36171cfee7b892271b9b587325c.zip
Merge pull request #2 from redmatrix/master
Update to latest hubzilla
Diffstat (limited to 'mod/ffsapi.php')
-rw-r--r--mod/ffsapi.php65
1 files changed, 65 insertions, 0 deletions
diff --git a/mod/ffsapi.php b/mod/ffsapi.php
new file mode 100644
index 000000000..f4033e63b
--- /dev/null
+++ b/mod/ffsapi.php
@@ -0,0 +1,65 @@
+<?php
+
+
+function ffsapi_content(&$a) {
+
+$baseurl = z_root();
+$name = get_config('system','sitename');
+$description = t('Share content from Firefox to $Projectname');
+$author = 'Mike Macgirvin';
+$homepage = 'http://hubzilla.org';
+$activate = t('Activate the Firefox $Projectname provider');
+
+$s = <<< EOT
+
+<script>
+
+var baseurl = '$baseurl';
+
+var data = {
+ "origin": baseurl,
+ // currently required
+ "name": '$name',
+ "iconURL": baseurl+"/images/hz-16.png",
+ "icon32URL": baseurl+"/images/hz-32.png",
+ "icon64URL": baseurl+"/images/hz-64.png",
+
+ // at least one of these must be defined
+ // "workerURL": baseurl+"/worker.js",
+ // "sidebarURL": baseurl+"/sidebar.htm",
+ "shareURL": baseurl+"/rpost?f=&url=%{url}",
+
+ // status buttons are scheduled for Firefox 26 or 27
+ //"statusURL": baseurl+"/statusPanel.html",
+
+ // social bookmarks are available in Firefox 26
+ "markURL": baseurl+"/rbmark?f=&url=%{url}&title=%{title}",
+ // icons should be 32x32 pixels
+ // "markedIcon": baseurl+"/images/checkbox-checked-32.png",
+ // "unmarkedIcon": baseurl+"/images/checkbox-unchecked-32.png",
+ "unmarkedIcon": baseurl+"/images/hz-bookmark-32.png",
+
+ // should be available for display purposes
+ "description": '$description',
+ "author": '$author',
+ "homepageURL": '$homepage',
+
+ // optional
+ "version": "1.0"
+}
+
+function activate(node) {
+ var event = new CustomEvent("ActivateSocialFeature");
+ var jdata = JSON.stringify(data);
+ node.setAttribute("data-service", JSON.stringify(data));
+ node.dispatchEvent(event);
+}
+</script>
+
+<button onclick="activate(this)" title="activate the demo provider" class="btn btn-primary">$activate</button>
+
+EOT;
+
+return $s;
+
+}