From d7fe48d1b683bf11c796dca22c01b83076d1e96b Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sun, 17 Apr 2016 07:09:42 -0400 Subject: [PATCH 1/2] New help panel that slides in from the top and pushes the content down so it is not covered. Panel toggles with help button. Still some bugs with small screen viewing. --- view/theme/redbasic/css/style.css | 41 ++-- view/theme/redbasic/js/redbasic.js | 51 +++- view/tpl/nav.tpl | 367 +++++++++++++++-------------- 3 files changed, 254 insertions(+), 205 deletions(-) diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index de48ff74a..5f38f60f1 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1898,28 +1898,35 @@ nav .badge.mail-update:hover { /* contextual help */ .help-content { - background: rgba(255, 255, 255, 0.9); - color: #333333; - position: fixed; - top: 50px; - left: -80%; - width: 80%; - height: 60%; - padding: 20px; - transition: left 300ms cubic-bezier(0.17, 0.04, 0.03, 0.94); - box-sizing: border-box; - border: #CCC thin solid; - overflow: auto; + background: rgba(255, 255, 255, 0.9); + color: #333333; + position: fixed; + top: -1000px; + left: 0%; + right: 100%; + width: 100%; + height: auto; + padding: 20px; + transition: top 300ms cubic-bezier(0.17, 0.04, 0.03, 0.94); + box-sizing: border-box; + border: #CCC thin solid; + overflow: auto; } .help-content-open { - left: 0px; - -moz-box-shadow: 3px 3px 3px #ccc; - -webkit-box-shadow: 3px 3px 3px #ccc; - box-shadow: 3px 3px 3px #ccc; + top: 50px; + -moz-box-shadow: 3px 3px 3px #ccc; + -webkit-box-shadow: 3px 3px 3px #ccc; + box-shadow: 3px 3px 3px #ccc; +} +main { + top: auto; +} +main.help-content-open { + top: 200px; } .help-content dd { - margin-bottom: 1em; + margin-bottom: 1em; } /* contextual help end */ diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index b4cde6efc..ccc24d2b3 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -69,13 +69,48 @@ function makeFullScreen(full) { } /* contextual help */ -$(document).mouseup(function (e) { - var container = $("#help-content"); +$('.help-content').css('top', '-' + $('#help-content').height() + 'px') +$(document).mouseup(function (e) +{ + e.preventDefault; + + var container = $("#help-content"); + + if ((!container.is(e.target) // if the target of the click isn't the container... + && container.has(e.target).length === 0 // ... nor a descendant of the container + && container.hasClass('help-content-open')) + || + ( + ($('#help_nav_btn').is(e.target) || $('#help_nav_btn').has(e.target).length !== 0) + && container.hasClass('help-content-open') + )) { + container.removeClass('help-content-open'); + $('main').removeClass('help-content-open'); + $('main').css('top', 'auto') + } + else if (($('#help_nav_btn').is(e.target) || $('#help_nav_btn').has(e.target).length !== 0) + && !container.hasClass('help-content-open')) { + $('#help-content').addClass('help-content-open'); + $('main').removeClass('help-content-open'); + var mainTop = $('#navbar-collapse-1').height(); + if ($('#navbar-collapse-1').height() < $('#help-content').height()) { + mainTop = $('#help-content').height(); + } + + $('main').css('top', +mainTop + +50 + 'px'); + } - if (!container.is(e.target) // if the target of the click isn't the container... - && container.has(e.target).length === 0 // ... nor a descendant of the container - && container.hasClass('help-content-open')) - { - container.removeClass('help-content-open'); - } }); + +var contextualHelpFocus = function (target, openSidePanel) { + if (openSidePanel) { + $("main").addClass('region_1-on'); // Open the side panel to highlight element + } else { + $("main").removeClass('region_1-on'); + } + // Animate the page scroll to the element and then pulse the element to direct attention + $('html,body').animate({scrollTop: $(target).offset().top - $('#navbar-collapse-1').height() - $('#help-content').height() - 50}, 'slow'); + for (i = 0; i < 3; i++) { + $(target).fadeTo('slow', 0.1).fadeTo('slow', 1.0); + } +} \ No newline at end of file diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl index 7f6c33c61..90d741e96 100755 --- a/view/tpl/nav.tpl +++ b/view/tpl/nav.tpl @@ -1,195 +1,202 @@
- - +
-
- {{$nav.help.5}} -

Click here for more documentation...

-
- From f4cca21fdf99f0cdd9be900c9190f7e5f6590828 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sun, 17 Apr 2016 07:29:08 -0400 Subject: [PATCH 2/2] Recover lost language translation accommodation and doc/context restructuring --- doc/context/channel/help.html | 24 ------------------- doc/context/cloud/help.html | 22 ----------------- doc/context/{ => en}/admin/security/help.html | 0 doc/context/en/channel/help.html | 8 +++++++ doc/context/en/cloud/help.html | 6 +++++ doc/context/{ => en}/mail/help.html | 0 doc/context/{ => en}/network/help.html | 20 ++-------------- doc/context/en/photos/help.html | 6 +++++ doc/context/en/profile/help.html | 6 +++++ doc/context/photos/help.html | 22 ----------------- doc/context/profile/help.html | 22 ----------------- mod/help.php | 12 ++++++++-- 12 files changed, 38 insertions(+), 110 deletions(-) delete mode 100644 doc/context/channel/help.html delete mode 100644 doc/context/cloud/help.html rename doc/context/{ => en}/admin/security/help.html (100%) create mode 100644 doc/context/en/channel/help.html create mode 100644 doc/context/en/cloud/help.html rename doc/context/{ => en}/mail/help.html (100%) rename doc/context/{ => en}/network/help.html (58%) create mode 100644 doc/context/en/photos/help.html create mode 100644 doc/context/en/profile/help.html delete mode 100644 doc/context/photos/help.html delete mode 100644 doc/context/profile/help.html diff --git a/doc/context/channel/help.html b/doc/context/channel/help.html deleted file mode 100644 index 810913ff3..000000000 --- a/doc/context/channel/help.html +++ /dev/null @@ -1,24 +0,0 @@ - -
-
General
-
This is the home page of a channel. It is similar to someone's profile "wall" in a social network context. Posts created by the channel are displayed according to the observer's viewing permissions.
-
Create a Post
-
If you have permission to create posts on the channel page, then you will see the post editor at the top.
-
Channel Content Tabs
-
The channel content tabs are links to other content published by the channel. The About tab links to the channel profile. The Photos tab links to the channel photo galleries. The Files tab links to the general shared files published by the channel.
-
\ No newline at end of file diff --git a/doc/context/cloud/help.html b/doc/context/cloud/help.html deleted file mode 100644 index 105947517..000000000 --- a/doc/context/cloud/help.html +++ /dev/null @@ -1,22 +0,0 @@ - -
-
General
-
This page displays a channel's "cloud" files. The files visible to the observer depend on the individual file permissions set by the channel owner. If you have permission to create/upload files you will see control buttons above the file list.
-
Channel Content Tabs
-
The channel content tabs are links to other content published by the channel. The About tab links to the channel profile. The Photos tab links to the channel photo galleries. The Files tab links to the general shared files published by the channel.
-
\ No newline at end of file diff --git a/doc/context/admin/security/help.html b/doc/context/en/admin/security/help.html similarity index 100% rename from doc/context/admin/security/help.html rename to doc/context/en/admin/security/help.html diff --git a/doc/context/en/channel/help.html b/doc/context/en/channel/help.html new file mode 100644 index 000000000..6e3181cbf --- /dev/null +++ b/doc/context/en/channel/help.html @@ -0,0 +1,8 @@ +
+
General
+
This is the home page of a channel. It is similar to someone's profile "wall" in a social network context. Posts created by the channel are displayed according to the observer's viewing permissions.
+
Create a Post
+
If you have permission to create posts on the channel page, then you will see the post editor at the top.
+
Channel Content Tabs
+
The channel content tabs are links to other content published by the channel. The About tab links to the channel profile. The Photos tab links to the channel photo galleries. The Files tab links to the general shared files published by the channel.
+
\ No newline at end of file diff --git a/doc/context/en/cloud/help.html b/doc/context/en/cloud/help.html new file mode 100644 index 000000000..a8f193223 --- /dev/null +++ b/doc/context/en/cloud/help.html @@ -0,0 +1,6 @@ +
+
General
+
This page displays a channel's "cloud" files. The files visible to the observer depend on the individual file permissions set by the channel owner. If you have permission to create/upload files you will see control buttons above the file list.
+
Channel Content Tabs
+
The channel content tabs are links to other content published by the channel. The About tab links to the channel profile. The Photos tab links to the channel photo galleries. The Files tab links to the general shared files published by the channel.
+
\ No newline at end of file diff --git a/doc/context/mail/help.html b/doc/context/en/mail/help.html similarity index 100% rename from doc/context/mail/help.html rename to doc/context/en/mail/help.html diff --git a/doc/context/network/help.html b/doc/context/en/network/help.html similarity index 58% rename from doc/context/network/help.html rename to doc/context/en/network/help.html index 956af7380..53e993b69 100644 --- a/doc/context/network/help.html +++ b/doc/context/en/network/help.html @@ -1,25 +1,9 @@ -
General
The network page displays a stream of posts and conversations, typically ordered by the most recently updated. This page is highly customizable.
-
Create a Post
+
Create a Post
At the top of the page there is a text box that says "Share". Clicking this box opens a new post editor. The post editor is customizable, but the basic editor provides fields for a post body and an optional post Title. Buttons below the text area to the left provide shortcuts to text formatting and inserting links, images, and other data into the post. The buttons to the right provide a post preview, the post permissions setting, and a Submit button to send the post.
-
Privacy Groups
+
Privacy Groups
The privacy groups you have created are displayed in the side panel. Selecting them filters posts to those created by channels in the chosen group.
Post Permissions
The access control list (ACL) is what you use to set who can see your new post. Pressing the ACL button beside the Submit button will display a dialog in which you can select what channels and/or privacy groups can see the post. You can also select who is explicitly denied access. For example, say you are planning a surprise party for a friend. You can send an invitation post to everyone in your Friends group except the friend you are surprising. In this case you "show" the Friends group but "don't show" that one person.
diff --git a/doc/context/en/photos/help.html b/doc/context/en/photos/help.html new file mode 100644 index 000000000..78b442bb4 --- /dev/null +++ b/doc/context/en/photos/help.html @@ -0,0 +1,6 @@ +
+
General
+
This page displays a channel's photo albums. The images visible to the observer depend on the individual image permissions.
+
Channel Content Tabs
+
The channel content tabs are links to other content published by the channel. The About tab links to the channel profile. The Photos tab links to the channel photo galleries. The Files tab links to the general shared files published by the channel.
+
\ No newline at end of file diff --git a/doc/context/en/profile/help.html b/doc/context/en/profile/help.html new file mode 100644 index 000000000..563e0df99 --- /dev/null +++ b/doc/context/en/profile/help.html @@ -0,0 +1,6 @@ +
+
General
+
This is the profile page of a channel. It typically displays information describing the channel. If the channel represents a person in a social network, for example, then the profile might provide contact information and other personal details about the person. Channels can have multiple profiles, where the displayed profile depends on the observer.
+
Channel Content Tabs
+
The channel content tabs are links to other content published by the channel. The About tab links to the channel profile. The Photos tab links to the channel photo galleries. The Files tab links to the general shared files published by the channel.
+
\ No newline at end of file diff --git a/doc/context/photos/help.html b/doc/context/photos/help.html deleted file mode 100644 index f41611f8d..000000000 --- a/doc/context/photos/help.html +++ /dev/null @@ -1,22 +0,0 @@ - -
-
General
-
This page displays a channel's photo albums. The images visible to the observer depend on the individual image permissions.
-
Channel Content Tabs
-
The channel content tabs are links to other content published by the channel. The About tab links to the channel profile. The Photos tab links to the channel photo galleries. The Files tab links to the general shared files published by the channel.
-
\ No newline at end of file diff --git a/doc/context/profile/help.html b/doc/context/profile/help.html deleted file mode 100644 index 0d4abb8cb..000000000 --- a/doc/context/profile/help.html +++ /dev/null @@ -1,22 +0,0 @@ - -
-
General
-
This is the profile page of a channel. It typically displays information describing the channel. If the channel represents a person in a social network, for example, then the profile might provide contact information and other personal details about the person. Channels can have multiple profiles, where the displayed profile depends on the observer.
-
Channel Content Tabs
-
The channel content tabs are links to other content published by the channel. The About tab links to the channel profile. The Photos tab links to the channel photo galleries. The Files tab links to the general shared files published by the channel.
-
\ No newline at end of file diff --git a/mod/help.php b/mod/help.php index fb0339cd9..8c27156ab 100644 --- a/mod/help.php +++ b/mod/help.php @@ -88,9 +88,17 @@ function load_context_help() { $path = App::$cmd; $args = App::$argv; - + $lang = App::$language; + + if(! isset($lang) || !is_dir('doc/context/' . $lang . '/')) { + $lang = 'en'; + } while($path) { - $context_help = load_doc_file('doc/context/' . $path . '/help.html'); + $context_help = load_doc_file('doc/context/' . $lang . '/' . $path . '/help.html'); + if(!$context_help) { + // Fallback to English if the translation is absent + $context_help = load_doc_file('doc/context/en/' . $path . '/help.html'); + } if($context_help) break; array_pop($args);