]> git.pld-linux.org Git - packages/dokuwiki-plugin-smblink.git/commitdiff
- remove unneccessary cruft, making plugin usable for all browsers master auto/th/dokuwiki-plugin-smblink-20090209-2
authorElan Ruusamäe <glen@pld-linux.org>
Sat, 24 Jul 2010 21:49:18 +0000 (21:49 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    dokuwiki-plugin-smblink.spec -> 1.4
    syntax.1.patch -> 1.1

dokuwiki-plugin-smblink.spec
syntax.1.patch [new file with mode: 0644]

index 6191058f13e6681f24996d803f4d49337f353f14..79ef9ea903a432f11ce9e3689a90e9ca780bb8ea 100644 (file)
@@ -2,11 +2,12 @@
 Summary:       Plugin to make Windows Share Links globally accessible
 Name:          dokuwiki-plugin-%{plugin}
 Version:       20090209
-Release:       1
+Release:       2
 License:       GPL v2
 Group:         Applications/WWW
 Source0:       http://doku-smblink.googlecode.com/files/smblink.zip
 # Source0-md5: b880e7d257904050c97396ffbd7a9d5e
+Patch0:                syntax.1.patch
 URL:           http://wiki.splitbrain.org/plugin:smblink
 BuildRequires: rpmbuild(macros) >= 1.553
 BuildRequires: unzip
@@ -29,6 +30,7 @@ to better support the Firefox browser.
 %setup -qc
 mv %{plugin}/* .
 %undos *.php
+%patch0 -p0
 
 version=$(awk -F"'" '/date/{print $4}' syntax.php)
 if [ "$(echo "$version" | tr -d -)" != %{version} ]; then
diff --git a/syntax.1.patch b/syntax.1.patch
new file mode 100644 (file)
index 0000000..1290724
--- /dev/null
@@ -0,0 +1,49 @@
+*** syntax.php 2009-02-09 17:08:04.000000000 +0200
+--- syntax_t-verssion.php      2010-04-30 12:11:50.000000000 +0300
+***************
+*** 78,102 ****
+          } else {
+              $link['class'] = 'media';
+          }
+!         //Format the link for smb (Linux or Win-Firefox)
+          //Just replace all \ with / to get something like smb://host/path/to/file
+!         $smburl='smb:' . str_replace('\\', '/', $url);
+!         //If we're using linux, then smb:// protocol works fine.
+!         if (strstr($_SERVER['HTTP_USER_AGENT'], 'Linux')) {
+!             $url = $smburl;
+!         } else {
+!             //If we're not on linux, we might be using IE, so...
+!             //Replace the \\ with the file:/// protocol and put the \\ back in
+!             $url = str_replace('\\\\', 'file:///\\\\', $url);
+!             //Use javascript to change the link in Firefox to the smb url.
+!             $link['more'] =
+!                 'onclick="if(document.all == null){' .
+!                     "parent.location='".$smburl."';" .
+!                 '}" ' .
+!                 'onkeypress="if(document.all == null){' .
+!                     "parent.location='".$smburl."';" .
+!                 '}"';
+!         }
+  
+          $link['url'] = $url;
+  
+--- 78,96 ----
+          } else {
+              $link['class'] = 'media';
+          }
+! 
+          //Just replace all \ with / to get something like smb://host/path/to/file
+!         $smburl='smb:' . str_replace('\\', '/', $url);
+!         //Replace the \\ with the file:/// protocol and put the \\ back in
+!         $url = str_replace('\\\\', 'file:///\\\\', $url);
+!         //Use javascript to change the link in other browsers then IE to the smb url.
+!         $link['more'] =
+!             'onclick="if(!(/Internet Explorer/.test(navigator.appName))){' .
+!                 " window.location.href='".$smburl."';" .
+!             '}" ' .
+!             'onkeypress="if(!(/Internet Explorer/.test(navigator.appName))){' .
+!                 " window.location.href='".$smburl."';" .
+!             '}"';
+  
+          $link['url'] = $url;
+  
This page took 0.131418 seconds and 4 git commands to generate.