]> git.mxchange.org Git - friendica.git/commitdiff
fix folder links in filebrowser dialog
authorFabrixxm <fabrix.xm@gmail.com>
Wed, 29 Jul 2015 09:55:26 +0000 (11:55 +0200)
committerFabrixxm <fabrix.xm@gmail.com>
Wed, 29 Jul 2015 09:55:26 +0000 (11:55 +0200)
js/filebrowser.js
mod/fbrowser.php
view/templates/filebrowser_plain.tpl
view/templates/jot-header.tpl

index 8f7b78d1977c16a491db7676b3568c72140b96fc..c203151e143c4d2ffd6cc796e29d6084c39a5bbc 100644 (file)
@@ -67,6 +67,13 @@ var FileBrowser = {
                }\r
                \r
                console.log("FileBrowser:", nickname, type,FileBrowser.event, FileBrowser.id );\r
+               \r
+               $(".folders a, .path a").on("click", function(e){\r
+                       e.preventDefault();\r
+                       var url = baseurl + "/fbrowser/" + FileBrowser.type + "/" + this.dataset.folder + "?mode=minimal" + location['hash'];\r
+                       location.href = url;\r
+               });\r
+               \r
                $(".photo-album-photo-link").on('click', function(e){\r
                        e.preventDefault();\r
                        \r
index bf6842faf5f4f423a4bd43607e411548e68d9ae2..b2bda828792828b2dc21207fcf74949d80b32db6 100644 (file)
@@ -29,7 +29,7 @@ function fbrowser_content($a){
        
        switch($a->argv[1]){
                case "image":
-                       $path = array( array($a->get_baseurl()."/fbrowser/image/".$mode, t("Photos")));
+                       $path = array( array("", t("Photos")));
                        $albums = false;
                        $sql_extra = "";
                        $sql_extra2 = " ORDER BY created DESC LIMIT 0, 10";
@@ -39,7 +39,7 @@ function fbrowser_content($a){
                                        intval(local_user())
                                );
                                // anon functions only from 5.3.0... meglio tardi che mai..
-                               $folder1 = function($el) use ($mode) {return array(bin2hex($el['album']).$mode,$el['album']);};
+                               $folder1 = function($el) use ($mode) {return array(bin2hex($el['album']),$el['album']);};
                                $albums = array_map( $folder1 , $albums);
                                
                        }
@@ -49,7 +49,7 @@ function fbrowser_content($a){
                                $album = hex2bin($a->argv[2]);
                                $sql_extra = sprintf("AND `album` = '%s' ",dbesc($album));
                                $sql_extra2 = "";
-                               $path[]=array($a->get_baseurl()."/fbrowser/image/".$a->argv[2]."/".$mode, $album);
+                               $path[]=array($a->argv[2], $album);
                        }
                                
                        $r = q("SELECT `resource-id`, `id`, `filename`, type, min(`scale`) AS `hiq`,max(`scale`) AS `loq`, `desc`  
@@ -119,7 +119,7 @@ function fbrowser_content($a){
                                $o = replace_macros($tpl, array(
                                        '$type' => 'file',
                                        '$baseurl' => $a->get_baseurl(),
-                                       '$path' => array( array($a->get_baseurl()."/fbrowser/file/", t("Files")) ),
+                                       '$path' => array( array( "", t("Files")) ),
                                        '$folders' => false,
                                        '$files' =>$files,
                                        '$cancel' => t('Cancel'),
index 9b70fbf8524ec5e019720360ea61d4c502d6e4a0..7517ca632c9f02815648def9e1da2f56d3c90b4d 100644 (file)
 <div class="fbrowser {{$type}}">
 
        <div class="path">
-               {{foreach $path as $p}}<a href="{{$p.0}}">{{$p.1}}</a>{{/foreach}}
+               {{foreach $path as $p}}<a href="#" data-folder="{{$p.0}}">{{$p.1}}</a>{{/foreach}}
        </div>
        
        {{if $folders }}
        <div class="folders">
                <ul>
-                       {{foreach $folders as $f}}<li><a href="{{$baseurl}}/fbrowser/{{$type}}/{{$f.0}}">{{$f.1}}</a></li>{{/foreach}}
+                       {{foreach $folders as $f}}<li><a href="#" data-folder="{{$f.0}}">{{$f.1}}</a></li>{{/foreach}}
                </ul>
        </div>
        {{/if}}
index c4934f10b6bb8edac752e67a9faff35fb4fd0b4f..8d009fd40cdd1f81bdabb65fb63a6379fbbaa1e8 100644 (file)
@@ -142,21 +142,21 @@ function enableOnUser(){
                 **/
        
                /* callback */
-               $('body').on('fbrowser.image', function(e, filename, embedcode, id) {
+               $('body').on('fbrowser.image.main', function(e, filename, embedcode, id) {
                        $.colorbox.close();
                        addeditortext(embedcode);
                });
-               $('body').on('fbrowser.file', function(e, filename, embedcode, id) {
+               $('body').on('fbrowser.file.main', function(e, filename, embedcode, id) {
                        $.colorbox.close();
                        addeditortext(embedcode);
                });
        
                $('#wall-image-upload').on('click', function(){
-                       $.colorbox({href: baseurl + "/fbrowser/image/?mode=minimal", iframe:true,innerWidth:'500px',innerHeight:'400px'})
+                       $.colorbox({href: baseurl + "/fbrowser/image/?mode=minimal#main", iframe:true,innerWidth:'500px',innerHeight:'400px'})
                });
                
                $('#wall-file-upload').on('click', function(){
-                       $.colorbox({href: baseurl + "/fbrowser/file/?mode=minimal", iframe:true,innerWidth:'500px',innerHeight:'400px'})
+                       $.colorbox({href: baseurl + "/fbrowser/file/?mode=minimal#main", iframe:true,innerWidth:'500px',innerHeight:'400px'})
                });
                
                /**