Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: barnabywalters/own-your-comments
base: ebe33fb798
...
head fork: barnabywalters/own-your-comments
compare: 2660d40ab5
  • 4 commits
  • 11 files changed
  • 0 commit comments
  • 1 contributor
View
107 output/chrome/content_script.js
@@ -2,62 +2,63 @@
// @name Own Your Comments
// @include http://*
// @include https://*
-// @require URI.js
-// @require jquery-1.8.3-min.js
+// @require jquery-1.8.3.min.js
// ==/UserScript==
var OwnYourComments = (function () {
- // Private
- // Utility functions
- function getOption(key, callback) {
- kango.invokeAsync('kango.storage.getItem', key, callback);
- }
-
- /**
- * Expands {name} templates with the replace.name, or the empty string
- */
- function expandTemplates(postURL, replace) {
- for (var template in replace) {
- if (replace[template] == undefined)
- continue;
+ // Private
+
+ // Utility functions
+ function getOption(key, callback) {
+ kango.invokeAsync('kango.storage.getItem', key, callback);
+ }
+
+ /**
+ * Expands {name} templates with the replace.name, or the empty string
+ */
+ function expandTemplates(postURL, replace) {
+ for (var template in replace) {
+ if (replace[template] == undefined)
+ continue;
postURL = postURL.split('{' + template + '}')
- .join(encodeURIComponent(replace[template].replace(/^\s+|\s+$/g, '')));
- }
-
- // replace any unreplaced templates with nothing
- postURL = postURL.replace(/\{[a-zA-Z0-9_-]+\}/gi, '');
-
- return postURL;
- }
-
- // Content manipuation functions
- /**
- * Embeds an Indieweb comments box before Disqus or Livefyre iframes
- */
- function embedCommentsBox() {
- $('iframe[data-disqus-uid]').before(function () {
- var eID = $(this).attr('data-disqus-uid');
-
- var el = $('iframe').attr('id', 'own-your-comments-embed-' + eID);
-
- var properties = {
- url: window.location.href
- };
-
- getOption('commentEmbedURL', function (url) {
- $('#' + eID).attr('src', expandTemplates(url, properties));
- });
-
- return el;
- });
- }
-
- // Public
- return {
-
- };
+ .join(encodeURIComponent(replace[template].replace(/^\s+|\s+$/g, '')));
+ }
+
+ // replace any unreplaced templates with nothing
+ postURL = postURL.replace(/\{[a-zA-Z0-9_-]+\}/gi, '');
+
+ return postURL;
+ }
+
+ // Content manipuation functions
+
+ /**
+ * Embeds an Indieweb comments box before Disqus or Livefyre iframes
+ */
+ function embedCommentsBox() {
+ $('iframe[data-disqus-uid]').each(function (i, el) {
+ var insertID = 'own-your-comments-embed-' + $(el).attr('data-disqus-uid');
+
+ var insertFrame = $('<iframe />').attr('id', insertID);
+
+ var properties = { url: window.location.href };
+
+ getOption('commentEmbedURL', function (url) {
+ $('#' + insertID).attr('src', expandTemplates(url, properties));
+ });
+
+ console.log('Inserting:', insertFrame, 'before:', el);
+
+ $(el).before(insertFrame);
+ });
+ }
+
+ // Public
+ return {
+ init: function () {
+ embedCommentsBox();
+ }
+ };
}());
-KangoAPI.onReady(function () {
- embedCommentsBox();
-});
+setTimeout(OwnYourComments.init, 2000);
View
107 output/firefox/chrome/content/content_script.js
@@ -2,62 +2,63 @@
// @name Own Your Comments
// @include http://*
// @include https://*
-// @require URI.js
-// @require jquery-1.8.3-min.js
+// @require jquery-1.8.3.min.js
// ==/UserScript==
var OwnYourComments = (function () {
- // Private
- // Utility functions
- function getOption(key, callback) {
- kango.invokeAsync('kango.storage.getItem', key, callback);
- }
-
- /**
- * Expands {name} templates with the replace.name, or the empty string
- */
- function expandTemplates(postURL, replace) {
- for (var template in replace) {
- if (replace[template] == undefined)
- continue;
+ // Private
+
+ // Utility functions
+ function getOption(key, callback) {
+ kango.invokeAsync('kango.storage.getItem', key, callback);
+ }
+
+ /**
+ * Expands {name} templates with the replace.name, or the empty string
+ */
+ function expandTemplates(postURL, replace) {
+ for (var template in replace) {
+ if (replace[template] == undefined)
+ continue;
postURL = postURL.split('{' + template + '}')
- .join(encodeURIComponent(replace[template].replace(/^\s+|\s+$/g, '')));
- }
-
- // replace any unreplaced templates with nothing
- postURL = postURL.replace(/\{[a-zA-Z0-9_-]+\}/gi, '');
-
- return postURL;
- }
-
- // Content manipuation functions
- /**
- * Embeds an Indieweb comments box before Disqus or Livefyre iframes
- */
- function embedCommentsBox() {
- $('iframe[data-disqus-uid]').before(function () {
- var eID = $(this).attr('data-disqus-uid');
-
- var el = $('iframe').attr('id', 'own-your-comments-embed-' + eID);
-
- var properties = {
- url: window.location.href
- };
-
- getOption('commentEmbedURL', function (url) {
- $('#' + eID).attr('src', expandTemplates(url, properties));
- });
-
- return el;
- });
- }
-
- // Public
- return {
-
- };
+ .join(encodeURIComponent(replace[template].replace(/^\s+|\s+$/g, '')));
+ }
+
+ // replace any unreplaced templates with nothing
+ postURL = postURL.replace(/\{[a-zA-Z0-9_-]+\}/gi, '');
+
+ return postURL;
+ }
+
+ // Content manipuation functions
+
+ /**
+ * Embeds an Indieweb comments box before Disqus or Livefyre iframes
+ */
+ function embedCommentsBox() {
+ $('iframe[data-disqus-uid]').each(function (i, el) {
+ var insertID = 'own-your-comments-embed-' + $(el).attr('data-disqus-uid');
+
+ var insertFrame = $('<iframe />').attr('id', insertID);
+
+ var properties = { url: window.location.href };
+
+ getOption('commentEmbedURL', function (url) {
+ $('#' + insertID).attr('src', expandTemplates(url, properties));
+ });
+
+ console.log('Inserting:', insertFrame, 'before:', el);
+
+ $(el).before(insertFrame);
+ });
+ }
+
+ // Public
+ return {
+ init: function () {
+ embedCommentsBox();
+ }
+ };
}());
-KangoAPI.onReady(function () {
- embedCommentsBox();
-});
+setTimeout(OwnYourComments.init, 2000);
View
107 output/opera/content_script.js
@@ -2,62 +2,63 @@
// @name Own Your Comments
// @include http://*
// @include https://*
-// @require URI.js
-// @require jquery-1.8.3-min.js
+// @require jquery-1.8.3.min.js
// ==/UserScript==
var OwnYourComments = (function () {
- // Private
- // Utility functions
- function getOption(key, callback) {
- kango.invokeAsync('kango.storage.getItem', key, callback);
- }
-
- /**
- * Expands {name} templates with the replace.name, or the empty string
- */
- function expandTemplates(postURL, replace) {
- for (var template in replace) {
- if (replace[template] == undefined)
- continue;
+ // Private
+
+ // Utility functions
+ function getOption(key, callback) {
+ kango.invokeAsync('kango.storage.getItem', key, callback);
+ }
+
+ /**
+ * Expands {name} templates with the replace.name, or the empty string
+ */
+ function expandTemplates(postURL, replace) {
+ for (var template in replace) {
+ if (replace[template] == undefined)
+ continue;
postURL = postURL.split('{' + template + '}')
- .join(encodeURIComponent(replace[template].replace(/^\s+|\s+$/g, '')));
- }
-
- // replace any unreplaced templates with nothing
- postURL = postURL.replace(/\{[a-zA-Z0-9_-]+\}/gi, '');
-
- return postURL;
- }
-
- // Content manipuation functions
- /**
- * Embeds an Indieweb comments box before Disqus or Livefyre iframes
- */
- function embedCommentsBox() {
- $('iframe[data-disqus-uid]').before(function () {
- var eID = $(this).attr('data-disqus-uid');
-
- var el = $('iframe').attr('id', 'own-your-comments-embed-' + eID);
-
- var properties = {
- url: window.location.href
- };
-
- getOption('commentEmbedURL', function (url) {
- $('#' + eID).attr('src', expandTemplates(url, properties));
- });
-
- return el;
- });
- }
-
- // Public
- return {
-
- };
+ .join(encodeURIComponent(replace[template].replace(/^\s+|\s+$/g, '')));
+ }
+
+ // replace any unreplaced templates with nothing
+ postURL = postURL.replace(/\{[a-zA-Z0-9_-]+\}/gi, '');
+
+ return postURL;
+ }
+
+ // Content manipuation functions
+
+ /**
+ * Embeds an Indieweb comments box before Disqus or Livefyre iframes
+ */
+ function embedCommentsBox() {
+ $('iframe[data-disqus-uid]').each(function (i, el) {
+ var insertID = 'own-your-comments-embed-' + $(el).attr('data-disqus-uid');
+
+ var insertFrame = $('<iframe />').attr('id', insertID);
+
+ var properties = { url: window.location.href };
+
+ getOption('commentEmbedURL', function (url) {
+ $('#' + insertID).attr('src', expandTemplates(url, properties));
+ });
+
+ console.log('Inserting:', insertFrame, 'before:', el);
+
+ $(el).before(insertFrame);
+ });
+ }
+
+ // Public
+ return {
+ init: function () {
+ embedCommentsBox();
+ }
+ };
}());
-KangoAPI.onReady(function () {
- embedCommentsBox();
-});
+setTimeout(OwnYourComments.init, 2000);
View
BIN  output/ownyourcomments_0.9.crx
Binary file not shown
View
BIN  output/ownyourcomments_0.9.oex
Binary file not shown
View
BIN  output/ownyourcomments_0.9.xpi
Binary file not shown
View
4 output/safari/ownyourcomments_0.9.safariextension/Info.plist
@@ -4,6 +4,8 @@
<dict>
<key>Author</key>
<string>Barnaby Walters</string>
+ <key>Builder Version</key>
+ <string>6534.57.2</string>
<key>CFBundleDisplayName</key>
<string>Own Your Comments</string>
<key>CFBundleIdentifier</key>
@@ -17,7 +19,7 @@
<key>Chrome</key>
<dict>
<key>Database Quota</key>
- <real>10485760.0</real>
+ <real>10485760</real>
<key>Global Page</key>
<string>background.html</string>
<key>Popovers</key>
View
107 output/safari/ownyourcomments_0.9.safariextension/content_script.js
@@ -2,62 +2,63 @@
// @name Own Your Comments
// @include http://*
// @include https://*
-// @require URI.js
-// @require jquery-1.8.3-min.js
+// @require jquery-1.8.3.min.js
// ==/UserScript==
var OwnYourComments = (function () {
- // Private
- // Utility functions
- function getOption(key, callback) {
- kango.invokeAsync('kango.storage.getItem', key, callback);
- }
-
- /**
- * Expands {name} templates with the replace.name, or the empty string
- */
- function expandTemplates(postURL, replace) {
- for (var template in replace) {
- if (replace[template] == undefined)
- continue;
+ // Private
+
+ // Utility functions
+ function getOption(key, callback) {
+ kango.invokeAsync('kango.storage.getItem', key, callback);
+ }
+
+ /**
+ * Expands {name} templates with the replace.name, or the empty string
+ */
+ function expandTemplates(postURL, replace) {
+ for (var template in replace) {
+ if (replace[template] == undefined)
+ continue;
postURL = postURL.split('{' + template + '}')
- .join(encodeURIComponent(replace[template].replace(/^\s+|\s+$/g, '')));
- }
-
- // replace any unreplaced templates with nothing
- postURL = postURL.replace(/\{[a-zA-Z0-9_-]+\}/gi, '');
-
- return postURL;
- }
-
- // Content manipuation functions
- /**
- * Embeds an Indieweb comments box before Disqus or Livefyre iframes
- */
- function embedCommentsBox() {
- $('iframe[data-disqus-uid]').before(function () {
- var eID = $(this).attr('data-disqus-uid');
-
- var el = $('iframe').attr('id', 'own-your-comments-embed-' + eID);
-
- var properties = {
- url: window.location.href
- };
-
- getOption('commentEmbedURL', function (url) {
- $('#' + eID).attr('src', expandTemplates(url, properties));
- });
-
- return el;
- });
- }
-
- // Public
- return {
-
- };
+ .join(encodeURIComponent(replace[template].replace(/^\s+|\s+$/g, '')));
+ }
+
+ // replace any unreplaced templates with nothing
+ postURL = postURL.replace(/\{[a-zA-Z0-9_-]+\}/gi, '');
+
+ return postURL;
+ }
+
+ // Content manipuation functions
+
+ /**
+ * Embeds an Indieweb comments box before Disqus or Livefyre iframes
+ */
+ function embedCommentsBox() {
+ $('iframe[data-disqus-uid]').each(function (i, el) {
+ var insertID = 'own-your-comments-embed-' + $(el).attr('data-disqus-uid');
+
+ var insertFrame = $('<iframe />').attr('id', insertID);
+
+ var properties = { url: window.location.href };
+
+ getOption('commentEmbedURL', function (url) {
+ $('#' + insertID).attr('src', expandTemplates(url, properties));
+ });
+
+ console.log('Inserting:', insertFrame, 'before:', el);
+
+ $(el).before(insertFrame);
+ });
+ }
+
+ // Public
+ return {
+ init: function () {
+ embedCommentsBox();
+ }
+ };
}());
-KangoAPI.onReady(function () {
- embedCommentsBox();
-});
+setTimeout(OwnYourComments.init, 2000);
View
109 src/common/content_script.js
@@ -2,62 +2,65 @@
// @name Own Your Comments
// @include http://*
// @include https://*
-// @require URI.js
-// @require jquery-1.8.3-min.js
+// @require jquery-1.8.3.min.js
// ==/UserScript==
var OwnYourComments = (function () {
- // Private
- // Utility functions
- function getOption(key, callback) {
- kango.invokeAsync('kango.storage.getItem', key, callback);
- }
-
- /**
- * Expands {name} templates with the replace.name, or the empty string
- */
- function expandTemplates(postURL, replace) {
- for (var template in replace) {
- if (replace[template] == undefined)
- continue;
+ // Private
+
+ // Utility functions
+ function getOption(key, callback) {
+ kango.invokeAsync('kango.storage.getItem', key, callback);
+ }
+
+ /**
+ * Expands {name} templates with the replace.name, or the empty string
+ */
+ function expandTemplates(postURL, replace) {
+ for (var template in replace) {
+ if (replace[template] == undefined)
+ continue;
postURL = postURL.split('{' + template + '}')
- .join(encodeURIComponent(replace[template].replace(/^\s+|\s+$/g, '')));
- }
-
- // replace any unreplaced templates with nothing
- postURL = postURL.replace(/\{[a-zA-Z0-9_-]+\}/gi, '');
-
- return postURL;
- }
-
- // Content manipuation functions
- /**
- * Embeds an Indieweb comments box before Disqus or Livefyre iframes
- */
- function embedCommentsBox() {
- $('iframe[data-disqus-uid]').before(function () {
- var eID = $(this).attr('data-disqus-uid');
-
- var el = $('iframe').attr('id', 'own-your-comments-embed-' + eID);
-
- var properties = {
- url: window.location.href
- };
-
- getOption('commentEmbedURL', function (url) {
- $('#' + eID).attr('src', expandTemplates(url, properties));
- });
-
- return el;
- });
- }
-
- // Public
- return {
-
- };
+ .join(encodeURIComponent(replace[template].replace(/^\s+|\s+$/g, '')));
+ }
+
+ // replace any unreplaced templates with nothing
+ postURL = postURL.replace(/\{[a-zA-Z0-9_-]+\}/gi, '');
+
+ return postURL;
+ }
+
+ // Content manipuation functions
+
+ /**
+ * Embeds an Indieweb comments box before Disqus or Livefyre iframes
+ */
+ function embedCommentsBox() {
+ $('iframe[data-disqus-uid]').each(function (i, el) {
+ var insertID = 'own-your-comments-embed-' + $(el).attr('data-disqus-uid');
+
+ var insertFrame = $('<iframe />').attr('id', insertID);
+
+ var properties = { url: window.location.href };
+
+ getOption('commentEmbedURL', function (url) {
+ $('#' + insertID).attr('src', expandTemplates(url, properties));
+ });
+
+ getOption('commentEmbedHeight', function (height) {
+ $('#' + insertID).css('height', height);
+ });
+
+ $(el).before(insertFrame);
+ });
+ }
+
+ // Public
+ return {
+ init: function () {
+ embedCommentsBox();
+ }
+ };
}());
-KangoAPI.onReady(function () {
- embedCommentsBox();
-});
+setTimeout(OwnYourComments.init, 2000);
View
2  src/common/options.html
@@ -53,7 +53,7 @@
<label><b>Disqus/Livefyre Embed URL</b> ⇒ <input id="commentEmbedURL" type="url" class="monitor" placeholder="http://example.org/notes/new?inReplyTo={url}" /></label>
- <label><b title="CSS height string">Height:</b> <input class="short" id="commentEmbedHeight" class="monitor" placeholder="5em"</b>
+ <label><b title="CSS height string">Height:</b> <input class="short" id="commentEmbedHeight" class="monitor" placeholder="5em" /></label>
<div class="metadata">
<div class="notes">
View
4 src/common/options.js
@@ -1,4 +1,4 @@
-function saveURL(evt) {
+function saveOption(evt) {
kango.invokeAsync('kango.storage.setItem', $(evt.target).attr('id'), evt.target.value);
$('#notice').text('Unsaved Changes Made!').toggleClass('unsaved');
@@ -11,7 +11,7 @@ function main() {
$('.monitor').each(function () {
var self = $(this);
- self.keyup(saveURL);
+ self.keyup(saveOption);
kango.invokeAsync('kango.storage.getItem', self.attr('id'), function (url) {
self.val(url);

No commit comments for this range

Something went wrong with that request. Please try again.