Permalink
Browse files

Added a load of dependencies, updated options.html with liveFyre/disq…

…us embed box, modified extension_info with good values
  • Loading branch information...
1 parent 27c18c0 commit 2099f2168a1eb27277f119cf7b76a883ebf9a5b7 @barnabywalters committed Dec 23, 2012
View
Binary file not shown.
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,20 @@
+// ==UserScript==
+// @name Own Your Comments
+// @include http://*
+// @include https://*
+// @require URI.js
+// @require jquery-1.8.3-min.js
+// ==/UserScript==
+
+var OwnYourComments = (function () {
+ // Private
+
+ // Public
+ return {
+
+ };
+}());
+
+$(document).ready(function () {
+
+});
@@ -1,16 +1,16 @@
{
"content_scripts": [],
- "description": "Extension description",
- "creator": "KangoExtensions",
- "background_scripts": [
- "main.js"
- ],
- "homepage_url": "http://kangoextensions.com/",
+ "description": "Own your comments on the web! Provides comment box hijacking so you can retain a copy of your comments on your own site.",
+ "creator": "Barnaby Walters",
+ "background_scripts": ["main.js"],
+ "content_scripts": ["content_script.js"],
+ "options_page": "options.html",
+ "homepage_url": "http://indiewebcamp.com/",
"version": "0.9",
"browser_button": {
- "caption": "Kango",
+ "caption": "OYC Config",
"icon": "icons/button.png",
- "tooltipText": "Kango"
+ "tooltipText": "Own Your Comments Config"
},
"name": "Own Your Comments"
}

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -6,7 +6,7 @@
MyExtension.prototype = {
_onCommand: function() {
- kango.browser.tabs.create({url: 'http://kangoextensions.com/'});
+ kango.ui.optionsPage.open();
}
};
View
@@ -0,0 +1,63 @@
+<!doctype>
+<html>
+<head>
+ <title>Options for Own Your Comments</title>
+ <style>
+ body {
+ font-family: "Georgia", serif;
+ font-size: 18px;
+ }
+
+ input[type=url] {
+ font-size: 18px;
+ width: 50em;
+ max-width: 100%;
+ }
+
+ .notice {
+ color: green;
+ }
+
+ .unsaved {
+ color: red;
+ font-weight: bold;
+ }
+
+ dl { margin-left: 1em; color: #777; }
+ dd { margin-left: 0; }
+ dt { margin-right: 1em; float: left; }
+
+ code { color: #06a; }
+
+ .notes, .templates {
+ display: inline-block;
+ vertical-align: top;
+ font-size: 90%;
+ width: 45%;
+ }
+ </style>
+ <script src="jquery-1.8.3.min.js"></script>
+ <script src="kango-ui/kango_api.js"></script>
+ <script src="options.js"></script>
+</head>
+<body>
+ <h1>Own Your Comments Preferences</h1>
+
+ <p class="notice" id="notice"></p>
+
+ <div id="providerSelection">
+
+ <label><b>Disqus/Livefyre Embed URL</b> ⇒ <input id="commentEmbedURL" type="url" class="monitor" placeholder="http://example.org/notes/new?inReplyTo={url}" /></label>
+
+ <div class="metadata">
+ <div class="notes">
+ <p>Disqus and Livefyre comments boxes are embedded in the page in a way which makes it very difficult to hijack the actual box, so instead we can embed your own comments box just above it</p>
+ </div>
+ <dl class="templates">
+ <dt><code>{url}</code>
+ <dd>Expands to the (urlencoded) URL of the page you’re replying to
+ </dl>
+ </div>
+ </div>
+</body>
+</html>
View
@@ -0,0 +1,24 @@
+function saveURL(evt) {
+ kango.invokeAsync('kango.storage.setItem', $(evt.target).attr('id'), evt.target.value);
+
+ $('#notice').text('Unsaved Changes Made!').toggleClass('unsaved');
+ window.setTimeout(function () {
+ $('#notice').text('Changes Saved').toggleClass('unsaved');
+ }, 200);
+}
+
+function main() {
+ $('.monitor').each(function () {
+ var self = $(this);
+
+ self.keyup(saveURL);
+
+ kango.invokeAsync('kango.storage.getItem', self.attr('id'), function (url) {
+ self.val(url);
+ });
+ });
+}
+
+KangoAPI.onReady(function () {
+ main();
+});

0 comments on commit 2099f21

Please sign in to comment.