DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:smblink

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:smblink [2009-02-10 19:51] – Added syntax section 74.14.228.158plugin:smblink [2023-10-31 00:07] (current) Klap-in
Line 1: Line 1:
-~~NOTOC~~ +====== smblink Plugin ======
- +
-====== smblink ======+
  
 ---- plugin ---- ---- plugin ----
-description: A replacement for doku's default Windows Share Link feature which supports firefox.+description: A replacement for DokuWiki's default Windows Share Link feature which supports Firefox
 author     : enki author     : enki
 email      : enki1337@gmail.com email      : enki1337@gmail.com
 type       : syntax type       : syntax
 lastupdate : 2009-02-09 lastupdate : 2009-02-09
-compatible : rc2007-05-24+compatible : 2007-06-26
 depends    :  depends    : 
 conflicts  conflicts 
 similar    :  similar    : 
-tags       : samba, smb, share, link, Firefox+tags       : samba, smb, share, links, Firefox 
 +downloadurl: https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/doku-smblink/smblink.zip
 ---- ----
- 
-^ Download | [[http://doku-smblink.googlecode.com/files/smblink.zip|smblink.zip]] | 
  
 ===== Description ===== ===== Description =====
Line 52: Line 49:
   * 2007-06-03   * 2007-06-03
     * Initial release     * Initial release
- 
 ===== Issues ===== ===== Issues =====
  
Line 64: Line 60:
 </code> </code>
 Obviously the warning will now not show up even if you don't have the smb url handler installed. Obviously the warning will now not show up even if you don't have the smb url handler installed.
 +
 +
 +:!: The sole purpose of the //checkWindowsShares// function is to loop through all the links in the page and add the annoying popup to every link to Windows shares in the page. I suggest commenting the call to the checkWindowsShares() function instead. Same end result but this saves at least 1 function call and 1 loop, every time a page is rendered.
 +<code javascript>
 +addInitEvent(function(){
 +    checkWindowsShares();
 +});
 +</code>
 +Becomes:
 +<code javascript>
 +addInitEvent(function(){
 +    //checkWindowsShares();
 +});
 +</code>
 + --- //Bering, 2009/12/02 12:43//
 +
 +I was rather hacking together such hack by disabling the JavaScript value of an alert, however this also requires change in core:
 +<code javascript>
 +--- dokuwiki/lib/scripts/script.js~    2010-04-29 15:42:12.000000000 +0300
 ++++ dokuwiki/lib/scripts/script.js    2010-04-29 15:43:39.640053591 +0300
 +@@ -512,7 +512,7 @@
 +         for(var i=0; i<elems.length; i++){
 +             var share = elems[i];
 +             addEvent(share,'click',function(){
 +-                if(document.all == null) {
 ++                if(document.all == null && LANG['nosmblinks']) {
 +                     alert(LANG['nosmblinks']);
 +                 }
 +             });
 +</code>
 +<code javascript>
 +--- /dev/null    2008-11-04 20:33:38.146691408 +0200
 ++++ dokuwiki/lib/plugins/smblink/script.js    2010-04-29 15:45:59.670031225 +0300
 +@@ -0,0 +1,4 @@
 ++addInitEvent(function() {
 ++    // Reset warning as we now handle the links for all OS
 ++    LANG['nosmblinks'] = '';
 ++});
 +</code>
 +--- //[[glen@delfi.ee|Elan Ruusamäe]], 2010/04/29 15:48//
  
 ===== Discussion ===== ===== Discussion =====
Line 74: Line 110:
  
 > Great work! Integrated it! I would've done this, but I don't currently have access to a linux box :$ Thanks for the contribution! ~Enki > Great work! Integrated it! I would've done this, but I don't currently have access to a linux box :$ Thanks for the contribution! ~Enki
 +
 +==== Windows 7 ====
 +The plugin doesn't work with Windows 7 Prof. german (64bit) and Firefox 3.6.3 (german).
 +The errormessage is "Für die Dateierweiterung ".js" gibt es kein Skriptmodul." which means there is no module for .js-fileextension in wscript.exe in Windows 7 Professional - out of the box.
 +
 +==== Firefox-Addon ====
 +If you don't want to install the smblink-hack, there is a Firefox Addon which allows to open links to local files: [[https://addons.mozilla.org/de/firefox/addon/locallink/|Localllink]]. With the Addon installed, you can right-click on links to windows shares and chose the option to open these links in a "local context"
 +
 +==== spaces in file path====
 +
 +Will there be support for linking to a file path that includes spaces?
  
 ===== Source Code ===== ===== Source Code =====
Line 108: Line 155:
             'name'   => 'SMB Plugin',             'name'   => 'SMB Plugin',
             'desc'   => 'Makes filesystem links globally accessible, even through firefox.',             'desc'   => 'Makes filesystem links globally accessible, even through firefox.',
-            'url'    => 'http://www.dokuwiki.org/',+            'url'    => 'http://www.dokuwiki.org/plugin:smblink',
         );         );
     }     }
Line 189: Line 236:
 </code> </code>
  
 +
 +===== url-handlers =====
 +
 +== Support Drive Letters ==
 +Extend the url-handlers to support driver letters. Modify the ''url_protocol_handler.js'' of the ''url-handlers.zip''
 +
 +
 +Original Code in the ''function handleUrl(rawUrl)''
 +<code>
 +   // rescue some non-conformant URL's eg.
 +   // smb://server/share
 +   if(arg.substr(0,2) != "\\\\")
 + arg = "\\\\" + arg
 +</code>
 +
 +Modified Code in the ''function handleUrl(rawUrl)'': 
 +<code>
 +
 +                if ( arg.substr( 1,1 ) == ":" ) {
 +                  // support drive letters 
 +                }
 +                else {
 +
 +   // rescue some non-conformant URL's eg.
 +   // smb://server/share
 +   if(arg.substr(0,2) != "\\\\")
 + arg = "\\\\" + arg
 +                }
 +</code>
 +
 +== Support deeper directory structures ===
 +
 +A path like //myserver/share/deeper/still is handled badly as it links to //myserver/share only under ceratin circumstances. Here is a Bugfix:
 +
 +In line 79 replace
 +  arg = arg.replace("/", "\\")
 +with
 +  arg = arg.replace(/\//g, "\\")
 +
 +Otherwise %%//%%myserver/share/deeper/still will be changed to %%\\%%myserver\share**/**share**/**deeper**/**still which the explorer can't open (look at the slashes).
plugin/smblink.1234291880.txt.gz · Last modified: 2009-10-06 10:00 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki