]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add js linkToRemote and linkToRemoteBase
authorThomas Tanghus <thomas@tanghus.net>
Fri, 25 Jan 2013 15:00:26 +0000 (16:00 +0100)
committerThomas Tanghus <thomas@tanghus.net>
Fri, 25 Jan 2013 15:00:26 +0000 (16:00 +0100)
core/js/js.js

index 6241036b1b855ef49828a0e83dea701e5eda0443..6e0a405114b5e7404fad82ccafedb06cb4324b2e 100644 (file)
@@ -100,6 +100,27 @@ var OC={
        linkTo:function(app,file){
                return OC.filePath(app,'',file);
        },
+       /**
+        * Creates an url for remote use
+        * @param string $service id
+        * @return string the url
+        *
+        * Returns a url to the given service.
+        */
+       linkToRemoteBase:function(service) {
+               return OC.webroot + '/remote.php/' + service;
+       },
+       /**
+        * @brief Creates an absolute url for remote use
+        * @param string $service id
+        * @param bool $add_slash
+        * @return string the url
+        *
+        * Returns a absolute url to the given service.
+        */
+       linkToRemote:function(service) {
+               return window.location.protocol + '//' + window.location.host + OC.linkToRemoteBase(service);
+       },
        /**
         * get the absolute url for a file in an app
         * @param app the id of the app