Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master' into master-topic-2-entire_page_dropzone

dom111 před 6 roky
rodič
revize
508f47f053

+ 7 - 6
README.md

@@ -2,18 +2,19 @@ webdav-js
 =========
 A simple way to administer a WebDAV filesystem in a browser.
 
-Currently Supported
--------------------
-Firefox (Unsure of specific version, works on latest)
-Chrome (Unsure of specific version, works on latest)
+Currently Tested
+----------------
+Firefox
+Chrome
+Edge
 
 Implementations
 ---------------
 Add this to your Bookmarks Bar:
 
-    javascript:!function(){var t=document.getElementsByTagName("head")[0],e=function(e,s){var a=document.createElement("script");a.src=e,a.type="text/javascript",s&&(a.onload=s),t.appendChild(a)},s=function(e){var s=document.createElement("link");s.href=e,s.rel="stylesheet",t.appendChild(s)};e("https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js",function(){["https://cdn.rawgit.com/noelboss/featherlight/1.7.1/release/featherlight.min.js","https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?autorun=false","https://cdn.rawgit.com/notifyjs/notifyjs/master/dist/notify.js","https://cdn.rawgit.com/noelboss/featherlight/1.7.1/release/featherlight.min.css","https://cdn.rawgit.com/dom111/webdav-js/master/assets/css/style-min.css","https://cdn.rawgit.com/dom111/webdav-js/master/src/webdav-min.js"].forEach(function(t){t.match(/css$/)?s(t):e(t)})})}()
+    javascript:!function(){var e;e=["https://cdn.jsdelivr.net/gh/noelboss/featherlight@1.7.1/release/featherlight.min.js","https://cdn.jsdelivr.net/gh/google/code-prettify/loader/run_prettify.js?autorun=false","https://cdn.jsdelivr.net/gh/notifyjs/notifyjs/dist/notify.js","https://cdn.jsdelivr.net/gh/noelboss/featherlight@1.7.1/release/featherlight.min.css","https://cdn.jsdelivr.net/gh/dom111/webdav-js/assets/css/style-min.css","https://cdn.jsdelivr.net/gh/dom111/webdav-js/src/webdav-min.js"];var t,n=document.getElementsByTagName("head")[0],a=function(e,t){var s=document.createElement("script");s.src=e,s.type="text/javascript",t&&(s.onload=t),n.appendChild(s)};a("https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js",function(){e.forEach(function(e){var t,s;e.match(/css$/)?(t=e,(s=document.createElement("link")).href=t,s.rel="stylesheet",n.appendChild(s)):a(e)})}),(t=document.createElement("meta")).name="viewport",t.content="width=device-width, initial-scale=1",n.appendChild(t)}()
 
-Another use could be to implement the above bookmarklet in-line using `Apache`'s `Indexes` option using the `HeaderName` directive.
+There are supplied examples for how to set up `Apache` in the `examples/` directory and a working example (using Docker) usable via the scripts in the `test/` directory.
 
 [Blog post](https://dom.hastin.gs/blog/uncategorized/wevdav-js-update/475)
 

+ 1 - 1
examples/apache-directory-list/header.html

@@ -1 +1 @@
-<script type="text/javascript">!function(){var t;t=["https://cdn.rawgit.com/noelboss/featherlight/1.7.1/release/featherlight.min.js","https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?autorun=false","https://cdn.rawgit.com/notifyjs/notifyjs/master/dist/notify.js","https://cdn.rawgit.com/noelboss/featherlight/1.7.1/release/featherlight.min.css","https://cdn.rawgit.com/dom111/webdav-js/master/assets/css/style-min.css","https://cdn.rawgit.com/dom111/webdav-js/master/src/webdav-min.js"];var e,s=document.getElementsByTagName("head")[0],n=function(t,e){var a=document.createElement("script");a.src=t,a.type="text/javascript",e&&(a.onload=e),s.appendChild(a)};n("https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js",function(){t.forEach(function(t){var e,a;t.match(/css$/)?(e=t,(a=document.createElement("link")).href=e,a.rel="stylesheet",s.appendChild(a)):n(t)})}),(e=document.createElement("meta")).name="viewport",e.content="width=device-width, initial-scale=1",s.appendChild(e)}();</script><!--
+<script type="text/javascript">!function(){var e;e=["https://cdn.jsdelivr.net/gh/noelboss/featherlight@1.7.1/release/featherlight.min.js","https://cdn.jsdelivr.net/gh/google/code-prettify/loader/run_prettify.js?autorun=false","https://cdn.jsdelivr.net/gh/notifyjs/notifyjs/dist/notify.js","https://cdn.jsdelivr.net/gh/noelboss/featherlight@1.7.1/release/featherlight.min.css","https://cdn.jsdelivr.net/gh/dom111/webdav-js/assets/css/style-min.css","https://cdn.jsdelivr.net/gh/dom111/webdav-js/src/webdav-min.js"];var t,n=document.getElementsByTagName("head")[0],a=function(e,t){var s=document.createElement("script");s.src=e,s.type="text/javascript",t&&(s.onload=t),n.appendChild(s)};a("https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js",function(){e.forEach(function(e){var t,s;e.match(/css$/)?(t=e,(s=document.createElement("link")).href=t,s.rel="stylesheet",n.appendChild(s)):a(e)})}),(t=document.createElement("meta")).name="viewport",t.content="width=device-width, initial-scale=1",n.appendChild(t)}();</script><!--

+ 1 - 1
examples/bookmarklet/source-min.js

@@ -1 +1 @@
-javascript:!function(){var t;t=["https://cdn.rawgit.com/noelboss/featherlight/1.7.1/release/featherlight.min.js","https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?autorun=false","https://cdn.rawgit.com/notifyjs/notifyjs/master/dist/notify.js","https://cdn.rawgit.com/noelboss/featherlight/1.7.1/release/featherlight.min.css","https://cdn.rawgit.com/dom111/webdav-js/master/assets/css/style-min.css","https://cdn.rawgit.com/dom111/webdav-js/master/src/webdav-min.js"];var e,s=document.getElementsByTagName("head")[0],n=function(t,e){var a=document.createElement("script");a.src=t,a.type="text/javascript",e&&(a.onload=e),s.appendChild(a)};n("https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js",function(){t.forEach(function(t){var e,a;t.match(/css$/)?(e=t,(a=document.createElement("link")).href=e,a.rel="stylesheet",s.appendChild(a)):n(t)})}),(e=document.createElement("meta")).name="viewport",e.content="width=device-width, initial-scale=1",s.appendChild(e)}();
+javascript:!function(){var e;e=["https://cdn.jsdelivr.net/gh/noelboss/featherlight@1.7.1/release/featherlight.min.js","https://cdn.jsdelivr.net/gh/google/code-prettify/loader/run_prettify.js?autorun=false","https://cdn.jsdelivr.net/gh/notifyjs/notifyjs/dist/notify.js","https://cdn.jsdelivr.net/gh/noelboss/featherlight@1.7.1/release/featherlight.min.css","https://cdn.jsdelivr.net/gh/dom111/webdav-js/assets/css/style-min.css","https://cdn.jsdelivr.net/gh/dom111/webdav-js/src/webdav-min.js"];var t,n=document.getElementsByTagName("head")[0],a=function(e,t){var s=document.createElement("script");s.src=e,s.type="text/javascript",t&&(s.onload=t),n.appendChild(s)};a("https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js",function(){e.forEach(function(e){var t,s;e.match(/css$/)?(t=e,(s=document.createElement("link")).href=t,s.rel="stylesheet",n.appendChild(s)):a(e)})}),(t=document.createElement("meta")).name="viewport",t.content="width=device-width, initial-scale=1",n.appendChild(t)}();

+ 2 - 2
index.html

@@ -46,12 +46,12 @@
                         <p>I've also cerated a bookmarklet that you can add to your bookmarks bar:</p>
 
                         <p class="text-center">
-                            <a href="javascript:!function(){var t=document.getElementsByTagName(&quot;head&quot;)[0],e=function(e,s){var a=document.createElement(&quot;script&quot;);a.src=e,a.type=&quot;text/javascript&quot;,s&amp;&amp;(a.onload=s),t.appendChild(a)},s=function(e){var s=document.createElement(&quot;link&quot;);s.href=e,s.rel=&quot;stylesheet&quot;,t.appendChild(s)};e(&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js&quot;,function(){[&quot;https://cdn.rawgit.com/noelboss/featherlight/1.7.1/release/featherlight.min.js&quot;,&quot;https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?autorun=false&quot;,&quot;https://cdn.rawgit.com/notifyjs/notifyjs/master/dist/notify.js&quot;,&quot;https://cdn.rawgit.com/noelboss/featherlight/1.7.1/release/featherlight.min.css&quot;,&quot;https://cdn.rawgit.com/dom111/webdav-js/master/assets/css/style.min.css&quot;,&quot;https://cdn.rawgit.com/dom111/webdav-js/master/src/webdav-min.js&quot;].forEach(function(t){t.match(/css$/)?s(t):e(t)})})}()" class="btn btn-primary btn-lg">
+                            <a href="javascript:!function(){var e;e=[&quot;https://cdn.jsdelivr.net/gh/noelboss/featherlight@1.7.1/release/featherlight.min.js&quot;,&quot;https://cdn.jsdelivr.net/gh/google/code-prettify/loader/run_prettify.js?autorun=false&quot;,&quot;https://cdn.jsdelivr.net/gh/notifyjs/notifyjs/dist/notify.js&quot;,&quot;https://cdn.jsdelivr.net/gh/noelboss/featherlight@1.7.1/release/featherlight.min.css&quot;,&quot;https://cdn.jsdelivr.net/gh/dom111/webdav-js/assets/css/style-min.css&quot;,&quot;https://cdn.jsdelivr.net/gh/dom111/webdav-js/src/webdav-min.js&quot;];var t,n=document.getElementsByTagName(&quot;head&quot;)[0],a=function(e,t){var s=document.createElement(&quot;script&quot;);s.src=e,s.type=&quot;text/javascript&quot;,t&&(s.onload=t),n.appendChild(s)};a(&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js&quot;,function(){e.forEach(function(e){var t,s;e.match(/css$/)?(t=e,(s=document.createElement(&quot;link&quot;)).href=t,s.rel=&quot;stylesheet&quot;,n.appendChild(s)):a(e)})}),(t=document.createElement(&quot;meta&quot;)).name=&quot;viewport&quot;,t.content=&quot;width=device-width, initial-scale=1&quot;,n.appendChild(t)}();" class="btn btn-primary btn-lg">
                                 Browse WebDAV...
                             </a>
                         </p>
                         <p>or copy/paste from the below:</p>
-                       <pre class="copy-paste"><code class="js">javascript:!function(){var t=document.getElementsByTagName(&quot;head&quot;)[0],e=function(e,s){var a=document.createElement(&quot;script&quot;);a.src=e,a.type=&quot;text/javascript&quot;,s&amp;&amp;(a.onload=s),t.appendChild(a)},s=function(e){var s=document.createElement(&quot;link&quot;);s.href=e,s.rel=&quot;stylesheet&quot;,t.appendChild(s)};e(&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js&quot;,function(){[&quot;https://cdn.rawgit.com/noelboss/featherlight/1.7.1/release/featherlight.min.js&quot;,&quot;https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?autorun=false&quot;,&quot;https://cdn.rawgit.com/notifyjs/notifyjs/master/dist/notify.js&quot;,&quot;https://cdn.rawgit.com/noelboss/featherlight/1.7.1/release/featherlight.min.css&quot;,&quot;https://cdn.rawgit.com/dom111/webdav-js/master/assets/css/style-min.css&quot;,&quot;https://cdn.rawgit.com/dom111/webdav-js/master/src/webdav-min.js&quot;].forEach(function(t){t.match(/css$/)?s(t):e(t)})})}()</code><a class="btn btn-primary btn-xs copy" href="#" data-clipboard-target="pre.copy-paste code">Copy</a></pre>
+                       <pre class="copy-paste"><code class="js">javascript:!function(){var e;e=[&quot;https://cdn.jsdelivr.net/gh/noelboss/featherlight@1.7.1/release/featherlight.min.js&quot;,&quot;https://cdn.jsdelivr.net/gh/google/code-prettify/loader/run_prettify.js?autorun=false&quot;,&quot;https://cdn.jsdelivr.net/gh/notifyjs/notifyjs/dist/notify.js&quot;,&quot;https://cdn.jsdelivr.net/gh/noelboss/featherlight@1.7.1/release/featherlight.min.css&quot;,&quot;https://cdn.jsdelivr.net/gh/dom111/webdav-js/assets/css/style-min.css&quot;,&quot;https://cdn.jsdelivr.net/gh/dom111/webdav-js/src/webdav-min.js&quot;];var t,n=document.getElementsByTagName(&quot;head&quot;)[0],a=function(e,t){var s=document.createElement(&quot;script&quot;);s.src=e,s.type=&quot;text/javascript&quot;,t&&(s.onload=t),n.appendChild(s)};a(&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js&quot;,function(){e.forEach(function(e){var t,s;e.match(/css$/)?(t=e,(s=document.createElement(&quot;link&quot;)).href=t,s.rel=&quot;stylesheet&quot;,n.appendChild(s)):a(e)})}),(t=document.createElement(&quot;meta&quot;)).name=&quot;viewport&quot;,t.content=&quot;width=device-width, initial-scale=1&quot;,n.appendChild(t)}()</code><a class="btn btn-primary btn-xs copy" href="#" data-clipboard-target="pre.copy-paste code">Copy</a></pre>
                     </aside>
                 </div>
             </section>

+ 6 - 6
src/source-pp.js

@@ -4,12 +4,12 @@ var url_jquery, url_after
 // #ifdef CDN
 url_jquery = 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js';
 url_after = [
-    'https://cdn.rawgit.com/noelboss/featherlight/1.7.1/release/featherlight.min.js',
-    'https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?autorun=false',
-    'https://cdn.rawgit.com/notifyjs/notifyjs/master/dist/notify.js',
-    'https://cdn.rawgit.com/noelboss/featherlight/1.7.1/release/featherlight.min.css',
-    'https://cdn.rawgit.com/dom111/webdav-js/master/assets/css/style-min.css',
-    'https://cdn.rawgit.com/dom111/webdav-js/master/src/webdav-min.js'
+    'https://cdn.jsdelivr.net/gh/noelboss/featherlight@1.7.1/release/featherlight.min.js',
+    'https://cdn.jsdelivr.net/gh/google/code-prettify/loader/run_prettify.js?autorun=false',
+    'https://cdn.jsdelivr.net/gh/notifyjs/notifyjs/dist/notify.js',
+    'https://cdn.jsdelivr.net/gh/noelboss/featherlight@1.7.1/release/featherlight.min.css',
+    'https://cdn.jsdelivr.net/gh/dom111/webdav-js/assets/css/style-min.css',
+    'https://cdn.jsdelivr.net/gh/dom111/webdav-js/src/webdav-min.js'
 ];
 // #else
 url_jquery = '/webdav-js/external/jquery.min.js';