Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

Commit

Permalink
try to rollback old changes before the 2.9 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mhewedy committed Mar 23, 2019
1 parent 3fd680b commit f122838
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 17 deletions.
Empty file modified build.sh
100644 → 100755
Empty file.
52 changes: 36 additions & 16 deletions core/drawService.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ sboModule.drawService = (function () {
http.send();
};

let isNewDomain = function () {
return window.location.hostname.indexOf('learning.oreilly.com') >= 0;
}

return {
draw: function (domList, videoUrl, index, flavors) {

Expand All @@ -34,24 +38,40 @@ sboModule.drawService = (function () {
let title = $(element).attr('title') || $(element).text();
dldBtn.insertAfter($('.orm-PlaylistsDropdown-playlistsDropdown', $(element)));

var dialogStyle = 'padding: 6px 14px 5px 12px;' +
'margin-left: -240px;' +
'box-shadow: rgba(0, 0, 0, 0.2) 2px 2px 2px 2px;' +
'background-color: rgb(255, 255, 255);' +
'z-index: 99;' +
'top: 0px;' +
'left: 0px;' +
'display: none;';
let dialog;

let dialog = $('<div>').attr('style', dialogStyle + ';display: none;');
if (isNewDomain()) {
let dialogStyle = 'padding: 6px 14px 5px 12px;' +
'margin-left: -240px;' +
'box-shadow: rgba(0, 0, 0, 0.2) 2px 2px 2px 2px;' +
'background-color: rgb(255, 255, 255);' +
'z-index: 99;' +
'top: 0px;' +
'left: 0px;' +
'display: none;';

$(document).click(function (e) {
if (e.target === dldBtn[0] || e.target === dldBtnIcon[0]) {
dialog.attr('style', dialogStyle + ';display: inline;')
} else {
dialog.attr('style', dialogStyle + ';display: none;');
}
});
dialog = $('<div>').attr('style', dialogStyle + ';display: none;');

$(document).click(function (e) {
if (e.target === dldBtn[0] || e.target === dldBtnIcon[0]) {
dialog.attr('style', dialogStyle + ';display: inline;')
} else {
dialog.attr('style', dialogStyle + ';display: none;');
}
});
} else { // techbus
dialog = $('<div>').attr('style', 'padding: 6px 14px 5px 12px; margin-left: 15px; ' +
'display: inline; box-shadow: rgba(0, 0, 0, 0.2) 2px 2px 2px 2px; ' +
'background-color: rgb(255, 255, 255); position: absolute; right: 0px; z-index: 99;').hide();

$(document).click(function (e) {
if (e.target === dldBtn[0] || e.target === dldBtnIcon[0]) {
dialog.show();
} else {
dialog.hide();
}
});
}

dialog.insertAfter($(dldBtn));

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Safari Books Online Video Downloader",
"description": "If you have Safari Books online(R) subscription, use this extension to save videos to your disk to watch later offline.",
"version": "2.9",
"version": "2.10",
"permissions": [
"cookies",
"downloads",
Expand Down

0 comments on commit f122838

Please sign in to comment.