Merge pull request #8092 from annando/inverted

The widgets are now inflated by default
This commit is contained in:
Hypolite Petovan 2020-01-12 13:47:37 -05:00 committed by GitHub
commit f41a219f49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 107 additions and 22 deletions

View file

@ -33,6 +33,41 @@ function _resizeIframe(obj, desth) {
setTimeout(_resizeIframe, 100, obj, ch); setTimeout(_resizeIframe, 100, obj, ch);
} }
function initWidget(inflated, deflated) {
var elInf = document.getElementById(inflated);
var elDef = document.getElementById(deflated);
if (!elInf || !elDef) {
return;
}
if (localStorage.getItem(window.location.pathname + ":" + inflated) != "none") {
elInf.style.display = "block";
elDef.style.display = "none";
} else {
elInf.style.display = "none";
elDef.style.display = "block";
}
}
function openCloseWidget(inflated, deflated) {
var elInf = document.getElementById(inflated);
var elDef = document.getElementById(deflated);
if (!elInf || !elDef) {
return;
}
if (window.getComputedStyle(elInf).display === "none") {
elInf.style.display = "block";
elDef.style.display = "none";
localStorage.setItem(window.location.pathname + ":" + inflated, "block");
} else {
elInf.style.display = "none";
elDef.style.display = "block";
localStorage.setItem(window.location.pathname + ":" + inflated, "none");
}
}
function openClose(theID) { function openClose(theID) {
var el = document.getElementById(theID); var el = document.getElementById(theID);
if (el) { if (el) {

View file

@ -1,5 +1,10 @@
<div class="widget" id="group-sidebar"> <span id="group-sidebar-inflated" class="widget fakelink" onclick="openCloseWidget('group-sidebar', 'group-sidebar-inflated');">
<h3>{{$title}}</h3> <h3>{{$title}}</h3>
</span>
<div class="widget" id="group-sidebar">
<span class="fakelink" onclick="openCloseWidget('group-sidebar', 'group-sidebar-inflated');">
<h3>{{$title}}</h3>
</span>
<div id="sidebar-group-list"> <div id="sidebar-group-list">
<ul role="menu" id="sidebar-group-ul"> <ul role="menu" id="sidebar-group-ul">
@ -38,5 +43,6 @@
{{if $ungrouped}}<div id="sidebar-ungrouped"><a class="{{if $ungrouped_selected}}group-selected{{/if}}" href="nogroup">{{$ungrouped}}</a></div>{{/if}} {{if $ungrouped}}<div id="sidebar-ungrouped"><a class="{{if $ungrouped_selected}}group-selected{{/if}}" href="nogroup">{{$ungrouped}}</a></div>{{/if}}
</div> </div>
<script>
initWidget('group-sidebar', 'group-sidebar-inflated');
</script>

View file

@ -1,8 +1,8 @@
<span id="{{$type}}-sidebar-inflated" class="widget fakelink" style="display: block;" onclick="openClose('{{$type}}-sidebar'); openClose('{{$type}}-sidebar-inflated');"> <span id="{{$type}}-sidebar-inflated" class="widget fakelink" onclick="openCloseWidget('{{$type}}-sidebar', '{{$type}}-sidebar-inflated');">
<h3>{{$title}}</h3> <h3>{{$title}}</h3>
</span> </span>
<div id="{{$type}}-sidebar" class="widget" style="display: none;"> <div id="{{$type}}-sidebar" class="widget">
<span class="fakelink" onclick="openClose('{{$type}}-sidebar'); openClose('{{$type}}-sidebar-inflated');"> <span class="fakelink" onclick="openCloseWidget('{{$type}}-sidebar', '{{$type}}-sidebar-inflated');">
<h3>{{$title}}</h3> <h3>{{$title}}</h3>
</span> </span>
<div id="{{$type}}-desc">{{$desc nofilter}}</div> <div id="{{$type}}-desc">{{$desc nofilter}}</div>
@ -13,3 +13,6 @@
{{/foreach}} {{/foreach}}
</ul> </ul>
</div> </div>
<script>
initWidget('{{$type}}-sidebar', '{{$type}}-sidebar-inflated');
</script>

View file

@ -11,8 +11,13 @@ function showHideDates() {
} }
</script> </script>
<div id="datebrowse-sidebar" class="widget"> <span id="datebrowse-sidebar-inflated" class="widget fakelink" onclick="openCloseWidget('datebrowse-sidebar', 'datebrowse-sidebar-inflated');">
<h3>{{$title}}</h3> <h3>{{$title}}</h3>
</span>
<div id="datebrowse-sidebar" class="widget">
<span class="fakelink" onclick="openCloseWidget('datebrowse-sidebar', 'datebrowse-sidebar-inflated');">
<h3>{{$title}}</h3>
</span>
<ul id="posted-date-selector" class="datebrowse-ul"> <ul id="posted-date-selector" class="datebrowse-ul">
{{foreach $dates as $y => $arr}} {{foreach $dates as $y => $arr}}
@ -41,3 +46,6 @@ function showHideDates() {
</ul> </ul>
{{/if}} {{/if}}
</div> </div>
<script>
initWidget('datebrowse-sidebar', 'datebrowse-sidebar-inflated');
</script>

View file

@ -1,8 +1,8 @@
<span id="saved-search-list-inflated" class="widget fakelink" style="display: block;" onclick="openClose('saved-search-list'); openClose('saved-search-list-inflated');"> <span id="saved-search-list-inflated" class="widget fakelink" onclick="openCloseWidget('saved-search-list', 'saved-search-list-inflated');">
<h3>{{$title}}</h3> <h3>{{$title}}</h3>
</span> </span>
<div class="widget" id="saved-search-list" style="display: none;"> <div class="widget" id="saved-search-list">
<span class="fakelink" onclick="openClose('saved-search-list'); openClose('saved-search-list-inflated');"> <span class="fakelink" onclick="openCloseWidget('saved-search-list', 'saved-search-list-inflated');">
<h3 id="search">{{$title}}</h3> <h3 id="search">{{$title}}</h3>
</span> </span>
{{$searchbox nofilter}} {{$searchbox nofilter}}
@ -17,3 +17,6 @@
</ul> </ul>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<script>
initWidget('saved-search-list', 'saved-search-list-inflated');
</script>

View file

@ -1,6 +1,10 @@
<span id="tagblock-inflated" class="widget fakelink" onclick="openCloseWidget('tagblock', 'tagblock-inflated');">
<div class="tagblock widget">
<h3>{{$title}}</h3> <h3>{{$title}}</h3>
</span>
<div class="tagblock widget">
<span class="fakelink" onclick="openCloseWidget('tagblock', 'tagblock-inflated');">
<h3>{{$title}}</h3>
</span>
<div class="tag-cloud"> <div class="tag-cloud">
{{foreach $tags as $tag}} {{foreach $tags as $tag}}
@ -11,3 +15,6 @@
</div> </div>
<div class="tagblock-widget-end clear"></div> <div class="tagblock-widget-end clear"></div>
</div> </div>
<script>
initWidget('tagblock', 'tagblock-inflated');
</script>

View file

@ -1,5 +1,10 @@
<div id="trending-tags-sidebar" class="widget"> <span id="trending-tags-sidebar-inflated" class="widget fakelink" onclick="openCloseWidget('trending-tags-sidebar', 'trending-tags-sidebar-inflated');">
<h3>{{$title}}</h3> <h3>{{$title}}</h3>
</span>
<div id="trending-tags-sidebar" class="widget">
<span class="fakelink" onclick="openCloseWidget('trending-tags-sidebar', 'trending-tags-sidebar-inflated');">
<h3>{{$title}}</h3>
</span>
<ul> <ul>
{{section name=ol loop=$tags max=10}} {{section name=ol loop=$tags max=10}}
<li><a href="search?tag={{$tags[ol].term}}">#{{$tags[ol].term}}</a></li> <li><a href="search?tag={{$tags[ol].term}}">#{{$tags[ol].term}}</a></li>
@ -16,3 +21,6 @@
</details> </details>
{{/if}} {{/if}}
</div> </div>
<script>
initWidget('trending-tags-sidebar', 'trending-tags-sidebar-inflated');
</script>

View file

@ -11,11 +11,11 @@ function showHideForumlist() {
} }
} }
</script> </script>
<span id="forumlist-sidebar-inflated" class="widget fakelink" style="display: block;" onclick="openClose('forumlist-sidebar'); openClose('forumlist-sidebar-inflated');"> <span id="forumlist-sidebar-inflated" class="widget fakelink" onclick="openCloseWidget('forumlist-sidebar', 'forumlist-sidebar-inflated');">
<h3>{{$title}}</h3> <h3>{{$title}}</h3>
</span> </span>
<div id="forumlist-sidebar" class="widget" style="display: none;"> <div id="forumlist-sidebar" class="widget">
<span class="fakelink" onclick="openClose('forumlist-sidebar'); openClose('forumlist-sidebar-inflated');"> <span class="fakelink" onclick="openCloseWidget('forumlist-sidebar', 'forumlist-sidebar-inflated');">
<h3 id="forumlist">{{$title}}</h3> <h3 id="forumlist">{{$title}}</h3>
</span> </span>
<ul id="forumlist-sidbar-ul" role="menu"> <ul id="forumlist-sidbar-ul" role="menu">
@ -46,3 +46,6 @@ function showHideForumlist() {
{{/if}} {{/if}}
</ul> </ul>
</div> </div>
<script>
initWidget('forumlist-sidebar', 'forumlist-sidebar-inflated');
</script>

View file

@ -2932,10 +2932,13 @@ details.profile-jot-net[open] summary:before {
.fakelink > h3:before { .fakelink > h3:before {
padding-right: 10px; padding-right: 10px;
} }
.widget.fakelink > h3:before,
.settings-block.fakelink > h3:before { .settings-block.fakelink > h3:before {
font-family: ForkAwesome; font-family: ForkAwesome;
content: "\f0da"; /* Right Plain Pointer */ content: "\f0da"; /* Right Plain Pointer */
} }
.widget > .fakelink > h3:before,
#sidebar-group-header > .fakelink > h3:before,
.settings-block > .fakelink > h3:before { .settings-block > .fakelink > h3:before {
font-family: ForkAwesome; font-family: ForkAwesome;
content: "\f0d7"; /* Bottom Plain Pointer */ content: "\f0d7"; /* Bottom Plain Pointer */

View file

@ -1,6 +1,11 @@
<span id="group-sidebar-inflated" class="widget fakelink" onclick="openCloseWidget('group-sidebar', 'group-sidebar-inflated');">
<h3>{{$title}}</h3>
</span>
<div class="widget" id="group-sidebar"> <div class="widget" id="group-sidebar">
<div id="sidebar-group-header"> <div id="sidebar-group-header">
<h3>{{$title}}</h3> <span class="fakelink" onclick="openCloseWidget('group-sidebar', 'group-sidebar-inflated');">
<h3>{{$title}}</h3>
</span>
{{if ! $newgroup}} {{if ! $newgroup}}
<a class="group-edit-tool pull-right widget-action faded-icon" id="sidebar-edit-group" href="{{$grouppage}}" data-toggle="tooltip" title="{{$editgroupstext}}"> <a class="group-edit-tool pull-right widget-action faded-icon" id="sidebar-edit-group" href="{{$grouppage}}" data-toggle="tooltip" title="{{$editgroupstext}}">
<i class="fa fa-pencil" aria-hidden="true"></i> <i class="fa fa-pencil" aria-hidden="true"></i>
@ -49,6 +54,7 @@
{{if $ungrouped}}<li class="{{if $ungrouped_selected}}selected{{/if}} sidebar-group-li" id="sidebar-ungrouped"><a href="nogroup">{{$ungrouped}}</a></li>{{/if}} {{if $ungrouped}}<li class="{{if $ungrouped_selected}}selected{{/if}} sidebar-group-li" id="sidebar-ungrouped"><a href="nogroup">{{$ungrouped}}</a></li>{{/if}}
</ul> </ul>
</div> </div>
</div> </div>
<script>
initWidget('group-sidebar', 'group-sidebar-inflated');
</script>

View file

@ -1,9 +1,9 @@
{{if $saved}} {{if $saved}}
<span id="saved-search-list-inflated" class="widget fakelink" style="display: block;" onclick="openClose('saved-search-list'); openClose('saved-search-list-inflated');"> <span id="saved-search-list-inflated" class="widget fakelink" onclick="openCloseWidget('saved-search-list', 'saved-search-list-inflated');">
<h3>{{$title}}</h3> <h3>{{$title}}</h3>
</span> </span>
<div class="widget" id="saved-search-list" style="display: none;"> <div class="widget" id="saved-search-list">
<span class="fakelink" onclick="openClose('saved-search-list'); openClose('saved-search-list-inflated');"> <span class="fakelink" onclick="openCloseWidget('saved-search-list', 'saved-search-list-inflated');">
<h3 id="search">{{$title}}</h3> <h3 id="search">{{$title}}</h3>
</span> </span>
<ul role="menu" id="saved-search-ul"> <ul role="menu" id="saved-search-ul">
@ -18,4 +18,7 @@
</ul> </ul>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<script>
initWidget('saved-search-list', 'saved-search-list-inflated');
</script>
{{/if}} {{/if}}