diff --git a/src/inject/inject.js b/src/inject/inject.js index e6a5d3d..ad09eb2 100755 --- a/src/inject/inject.js +++ b/src/inject/inject.js @@ -35,7 +35,7 @@ chrome.extension.sendMessage({}, function(response) { { //Clear the data clearData(); - //Remove the title attribute + //Remove the title attribute element.removeAttr('title'); var baseURL = window.location.origin, //Get the URL @@ -45,18 +45,38 @@ chrome.extension.sendMessage({}, function(response) { $.get(fullURL, function(data) { var content = $(data).find('#bodyContent').find('p').html(), cssRules = { - position: 'fixed', - top: 10+"px", - left: 10+"px", + position: 'fixed', + top: 10+"px", + left: 10+"px", right: 10+"px", maxHeight: 500+"px", - padding: 1.4+"em", background: "#fff", boxShadow: "2px 2px 15px rgba(50,50,50,.75)", zIndex: 100 }; + // Select article pictures that are taller than 100px + var picture = $(data).find('#bodyContent').find('img').filter(function(index) { + return $(this).attr('height') > 100; + }); + // Display popup with picture + if (picture.attr('src') !== undefined) { + var new_html = ''; + new_html += '