Adjust google drive userscript prompt

This commit is contained in:
Calvin Montgomery 2017-03-03 23:39:38 -08:00
parent aea456436e
commit a56f0d5b10
4 changed files with 8 additions and 13 deletions

View File

@ -2,7 +2,7 @@
"author": "Calvin Montgomery",
"name": "CyTube",
"description": "Online media synchronizer and chat",
"version": "3.30.3",
"version": "3.30.4",
"repository": {
"url": "http://github.com/calzoneman/sync"
},

View File

@ -6,7 +6,7 @@ window.GoogleDrivePlayer = class GoogleDrivePlayer extends VideoJSPlayer
super(data)
load: (data) ->
if not window.hasDriveUserscript and not data.meta.direct
if not window.hasDriveUserscript
window.promptToInstallDriveUserscript()
else if window.hasDriveUserscript
window.maybePromptToUpgradeUserscript()
@ -31,5 +31,3 @@ window.GoogleDrivePlayer = class GoogleDrivePlayer extends VideoJSPlayer
jitter: 500
})
, Math.random() * 1000)
else
super(data)

View File

@ -112,9 +112,8 @@ window.promptToInstallDriveUserscript = ->
alertBox.className = 'alert alert-info'
alertBox.innerHTML = """
Due to continual breaking changes making it increasingly difficult to
maintain Google Drive support, you can now install a userscript that
simplifies the code and has better compatibility. In the future, the
old player will be removed."""
maintain Google Drive support, Google Drive now requires installing
a userscript in order to play the video."""
alertBox.appendChild(document.createElement('br'))
infoLink = document.createElement('a')
infoLink.className = 'btn btn-info'
@ -129,4 +128,4 @@ old player will be removed."""
closeButton.onclick = ->
alertBox.parentNode.removeChild(alertBox)
alertBox.insertBefore(closeButton, alertBox.firstChild)
document.getElementById('videowrap').appendChild(alertBox)
removeOld($('<div/>').append(alertBox))

View File

@ -679,7 +679,7 @@
}
GoogleDrivePlayer.prototype.load = function(data) {
if (!window.hasDriveUserscript && !data.meta.direct) {
if (!window.hasDriveUserscript) {
window.promptToInstallDriveUserscript();
} else if (window.hasDriveUserscript) {
window.maybePromptToUpgradeUserscript();
@ -709,8 +709,6 @@
});
};
})(this), Math.random() * 1000);
} else {
return GoogleDrivePlayer.__super__.load.call(this, data);
}
};
@ -1453,7 +1451,7 @@
alertBox = document.createElement('div');
alertBox.id = 'prompt-install-drive-userscript';
alertBox.className = 'alert alert-info';
alertBox.innerHTML = "Due to continual breaking changes making it increasingly difficult to\nmaintain Google Drive support, you can now install a userscript that\nsimplifies the code and has better compatibility. In the future, the\nold player will be removed.";
alertBox.innerHTML = "Due to continual breaking changes making it increasingly difficult to\nmaintain Google Drive support, Google Drive now requires installing\na userscript in order to play the video.";
alertBox.appendChild(document.createElement('br'));
infoLink = document.createElement('a');
infoLink.className = 'btn btn-info';
@ -1468,7 +1466,7 @@
return alertBox.parentNode.removeChild(alertBox);
};
alertBox.insertBefore(closeButton, alertBox.firstChild);
return document.getElementById('videowrap').appendChild(alertBox);
return removeOld($('<div/>').append(alertBox));
};
window.HLSPlayer = HLSPlayer = (function(superClass) {