Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider 8709c45d rédigé par Dennis Schubert's avatar Dennis Schubert Validation de Benjamin Neff
Parcourir les fichiers

Move the protocol handler into a proper helper module

Previous file history in 80dfdcd6, couldn't keep it.
parent 4430f9e8
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
Diaspora.ProtocolHandler = {
register: function() {
if (typeof (window.navigator.registerProtocolHandler) !== "function") {
return false;
}
var protocol = location.protocol;
var slashes = protocol.concat("//");
var host = slashes.concat(window.location.hostname);
if (location.port) {
host = host.concat(":" + location.port);
}
window.navigator.registerProtocolHandler("web+diaspora", host.concat("/link?q=%s"), document.title);
return true;
}
};
Diaspora.ProtocolHandler.register();
...@@ -45,5 +45,5 @@ ...@@ -45,5 +45,5 @@
//= require api/authorization_page //= require api/authorization_page
//= require bootstrap-markdown/bootstrap-markdown //= require bootstrap-markdown/bootstrap-markdown
//= require helpers/markdown_editor //= require helpers/markdown_editor
//= require helpers/protocol_handler
//= require jquery.are-you-sure //= require jquery.are-you-sure
//= require protocol-handler
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
function registerDiasporaLinksProtocol() {
var protocol = location.protocol;
var slashes = protocol.concat("//");
var host = slashes.concat(window.location.hostname);
if (location.port) {
host = host.concat(":" + location.port);
}
window.navigator.registerProtocolHandler("web+diaspora", host.concat("/link?q=%s"), document.title);
}
if (typeof (window.navigator.registerProtocolHandler) === "function") {
registerDiasporaLinksProtocol();
}
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter