From: rabuzarus Date: Sat, 11 Jun 2016 08:52:26 +0000 (+0200) Subject: Merge develop into 1006-short-info X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d39f679230a55d683da4dcba8ca17f08c6f7f5c0;p=friendica.git Merge develop into 1006-short-info Conflicts: view/theme/frio/js/theme.js --- d39f679230a55d683da4dcba8ca17f08c6f7f5c0 diff --cc .gitignore index b300f579e2,b300f579e2..0000000000 deleted file mode 100644,100644 --- a/.gitignore +++ /dev/null @@@ -1,44 -1,44 +1,0 @@@ --favicon.* --.htconfig.php --.htpreconfig.php --\#* --include/jquery-1.4.2.min.js --*.log --*.out --*.version* --favicon.* --home.html --addon --*~ --robots.txt -- --#ignore documentation, it should be newly built --doc/html -- --#ignore reports, should be generted with every build --report/ -- --#ignore config files from eclipse, we don't want IDE files in our repository --.project --.buildpath --.externalToolBuilders --.settings --#ignore OSX .DS_Store files --.DS_Store -- --/nbproject/private/ -- --#ignore smarty cache --/view/smarty3/compiled/ -- --#ignore cache folders --/privacy_image_cache/ --/photo/ --/proxy/ --nbproject -- --#ignore vagrant dir --.vagrant/ -- --#ignore local folder --/local/ diff --cc view/theme/frio/js/theme.js index 418c233e72,28221dcd0d..45966e0117 --- a/view/theme/frio/js/theme.js +++ b/view/theme/frio/js/theme.js @@@ -120,33 -113,48 +113,72 @@@ $(document).ready(function() // initialize the bootstrap-select $('.selectpicker').selectpicker(); + // add search-heading to the seccond navbar + if( $(".search-heading").length) { + $(".search-heading").appendTo("#topbar-second > .container > #tabmenu"); + } + + // add search results heading to the second navbar + // and insert the search value to the top nav search input + if( $(".search-content-wrapper").length ) { + // get the text of the heading (we catch the plain text because we don't + // want to have a h4 heading in the navbar + var searchText = $(".section-title-wrapper > h2").text(); + // insert the plain text in a

heading and give it a class + var newText = '

'+searchText+'

'; + // append the new heading to the navbar + $("#topbar-second > .container > #tabmenu").append(newText); + + // try to get the value of the original search input to insert it + // as value in the nav-search-input + var searchValue = $("#search-wrapper .form-group-search input").val(); + + // if the orignal search value isn't available use the location path as value + if( typeof searchValue === "undefined") { + // get the location path + var urlPath = window.location.search + // and split it up in its parts + var splitPath = urlPath.split(/(\?search?=)(.*$)/); + + if(typeof splitPath[2] !== 'undefined') { + // decode the path (e.g to decode %40 to the character @) + var searchValue = decodeURIComponent(splitPath[2]); + } + } + + if( typeof searchValue !== "undefined") { + $("#nav-search-input-field").val(searchValue); + } - + } + + // move the "Save the search" button to the second navbar + $(".search-content-wrapper #search-save-form ").appendTo("#topbar-second > .container > #navbar-button"); + + // append the vcard-short-info to the second nav after passing the element + // with .p-addr (vcard). Use scrollspy to get the scroll position. + if( $("aside .vcard .p-addr").length) { + $(".vcard .p-addr").scrollspy({ + min: $(".vcard .p-addr").position().top - 50, + onLeaveTop: function onLeave(element) { + $("#vcard-short-info").fadeOut(500, function () { + $("#vcard-short-info").appendTo("#vcard-short-info-wrapper"); + }); - - + }, + onEnter: function(element) { + $("#vcard-short-info").appendTo("#nav-short-info"); + $("#vcard-short-info").fadeIn(500); + }, + }); + } + + // move the forum contact information of the network page into the second navbar + if( $(".network-content-wrapper > #viewcontact_wrapper-network").length) { + // get the contact-wrapper element and append it to the second nav bar + // Note: We need the first() element with this class since at the present time we + // store also the js template information in the html code and thats why + // there are two elements with this class but we don't want the js template + $(".network-content-wrapper > #viewcontact_wrapper-network .contact-wrapper").first().appendTo("#nav-short-info"); + } }); //function commentOpenUI(obj, id) { // $(document).unbind( "click.commentOpen", handler );