Permalink
Browse files

Removed extra class attr in options.html, added disqus selector for o…

…lder, non-iframe disqus threads
  • Loading branch information...
1 parent 2660d40 commit 5626bb4e5257a8ddf052cc337c077db2dd53c3f6 @barnabywalters committed Dec 23, 2012
@@ -36,18 +36,22 @@ var OwnYourComments = (function () {
* Embeds an Indieweb comments box before Disqus or Livefyre iframes
*/
function embedCommentsBox() {
- $('iframe[data-disqus-uid]').each(function (i, el) {
+ $('iframe[data-disqus-uid], div#disqus_thread').each(function (i, el) {
var insertID = 'own-your-comments-embed-' + $(el).attr('data-disqus-uid');
- var insertFrame = $('<iframe />').attr('id', insertID);
+ var insertFrame = $('<iframe />')
+ .attr('id', insertID)
+ .css('width', '100%');
var properties = { url: window.location.href };
getOption('commentEmbedURL', function (url) {
$('#' + insertID).attr('src', expandTemplates(url, properties));
});
- console.log('Inserting:', insertFrame, 'before:', el);
+ getOption('commentEmbedHeight', function (height) {
+ $('#' + insertID).css('height', height);
+ });
$(el).before(insertFrame);
});
@@ -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 id="commentEmbedHeight" class="monitor short" placeholder="5em" /></label>
<div class="metadata">
<div class="notes">
@@ -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);
@@ -36,18 +36,22 @@ var OwnYourComments = (function () {
* Embeds an Indieweb comments box before Disqus or Livefyre iframes
*/
function embedCommentsBox() {
- $('iframe[data-disqus-uid]').each(function (i, el) {
+ $('iframe[data-disqus-uid], div#disqus_thread').each(function (i, el) {
var insertID = 'own-your-comments-embed-' + $(el).attr('data-disqus-uid');
- var insertFrame = $('<iframe />').attr('id', insertID);
+ var insertFrame = $('<iframe />')
+ .attr('id', insertID)
+ .css('width', '100%');
var properties = { url: window.location.href };
getOption('commentEmbedURL', function (url) {
$('#' + insertID).attr('src', expandTemplates(url, properties));
});
- console.log('Inserting:', insertFrame, 'before:', el);
+ getOption('commentEmbedHeight', function (height) {
+ $('#' + insertID).css('height', height);
+ });
$(el).before(insertFrame);
});
@@ -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 id="commentEmbedHeight" class="monitor short" placeholder="5em" /></label>
<div class="metadata">
<div class="notes">
@@ -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);
@@ -36,18 +36,22 @@ var OwnYourComments = (function () {
* Embeds an Indieweb comments box before Disqus or Livefyre iframes
*/
function embedCommentsBox() {
- $('iframe[data-disqus-uid]').each(function (i, el) {
+ $('iframe[data-disqus-uid], div#disqus_thread').each(function (i, el) {
var insertID = 'own-your-comments-embed-' + $(el).attr('data-disqus-uid');
- var insertFrame = $('<iframe />').attr('id', insertID);
+ var insertFrame = $('<iframe />')
+ .attr('id', insertID)
+ .css('width', '100%');
var properties = { url: window.location.href };
getOption('commentEmbedURL', function (url) {
$('#' + insertID).attr('src', expandTemplates(url, properties));
});
- console.log('Inserting:', insertFrame, 'before:', el);
+ getOption('commentEmbedHeight', function (height) {
+ $('#' + insertID).css('height', height);
+ });
$(el).before(insertFrame);
});
@@ -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 id="commentEmbedHeight" class="monitor short" placeholder="5em" /></label>
<div class="metadata">
<div class="notes">
@@ -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);
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -4,8 +4,6 @@
<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>
@@ -19,7 +17,7 @@
<key>Chrome</key>
<dict>
<key>Database Quota</key>
- <real>10485760</real>
+ <real>10485760.0</real>
<key>Global Page</key>
<string>background.html</string>
<key>Popovers</key>
@@ -36,18 +36,22 @@ var OwnYourComments = (function () {
* Embeds an Indieweb comments box before Disqus or Livefyre iframes
*/
function embedCommentsBox() {
- $('iframe[data-disqus-uid]').each(function (i, el) {
+ $('iframe[data-disqus-uid], div#disqus_thread').each(function (i, el) {
var insertID = 'own-your-comments-embed-' + $(el).attr('data-disqus-uid');
- var insertFrame = $('<iframe />').attr('id', insertID);
+ var insertFrame = $('<iframe />')
+ .attr('id', insertID)
+ .css('width', '100%');
var properties = { url: window.location.href };
getOption('commentEmbedURL', function (url) {
$('#' + insertID).attr('src', expandTemplates(url, properties));
});
- console.log('Inserting:', insertFrame, 'before:', el);
+ getOption('commentEmbedHeight', function (height) {
+ $('#' + insertID).css('height', height);
+ });
$(el).before(insertFrame);
});
@@ -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 id="commentEmbedHeight" class="monitor short" placeholder="5em" /></label>
<div class="metadata">
<div class="notes">
@@ -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);
@@ -36,10 +36,12 @@ var OwnYourComments = (function () {
* Embeds an Indieweb comments box before Disqus or Livefyre iframes
*/
function embedCommentsBox() {
- $('iframe[data-disqus-uid]').each(function (i, el) {
+ $('iframe[data-disqus-uid], div#disqus_thread').each(function (i, el) {
var insertID = 'own-your-comments-embed-' + $(el).attr('data-disqus-uid');
- var insertFrame = $('<iframe />').attr('id', insertID);
+ var insertFrame = $('<iframe />')
+ .attr('id', insertID)
+ .css('width', '100%');
var properties = { url: window.location.href };
@@ -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" /></label>
+ <label><b title="CSS height string">Height:</b> <input id="commentEmbedHeight" class="monitor short" placeholder="5em" /></label>
<div class="metadata">
<div class="notes">

0 comments on commit 5626bb4

Please sign in to comment.