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", "author": "Calvin Montgomery",
"name": "CyTube", "name": "CyTube",
"description": "Online media synchronizer and chat", "description": "Online media synchronizer and chat",
"version": "3.30.3", "version": "3.30.4",
"repository": { "repository": {
"url": "http://github.com/calzoneman/sync" "url": "http://github.com/calzoneman/sync"
}, },

View File

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

View File

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