Moodle

Convert the navbar to YUI3 and improve it

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: None
  • Component/s: Libraries
  • Labels:
    None
  • Difficulty:
    Moderate
  • Affected Branches:
    MOODLE_20_STABLE

Description

Purpose of this issue to to convert the navbar... the bar that the navigation trees can be docked to on the side of the page so that it uses YUI 3 where ever possible as well as improve it a bit if possible.

Issue Links

Activity

Hide
Sam Hemelryk added a comment -

Hi Petr,
I've just attached a patch that converts the navigation to YUI3 and makes the following changes, could you please have a look at this an just make sure you are happy with the direction that is it going?

Changes:

  1. Converted the whole navigation and navbar JS to YUI3, the only YUI2 remaining is the panel which I won't upgrade until the overlay is brought out of beta in YUI3
  2. Separated the code behind the navbar and the navigation trees so that they are two clearly self contained units now
  3. Redesigned the navbar so that it can be easily overridden in later JS such as by themers
  4. Moved navbar JS to blocks/blocks.js and navigation tree JS to blocks/global_navigation_tree/navigation.js as it can now be overridden by themers
  5. Added support into block_base class so that any block can dock with the navbar... this is on by default with user prefs and all
  6. Separated conf/display parameters into a name spaced structure so that JS included later can override it without any difficulty.
  7. Tested this in all browsers, despite all themes being broken in IE6 it appears to work nicely

Still to do:

  1. Add a CFG variable to limit/configure use of the navbar
  2. Find a solution for the navbar when more blocks than can be displayed have been added to it.
  3. Work with you Petr to find a nice solution to reduce the size of columns with no blocks in them for the holy grail themes

Cheers
Sam

Show
Sam Hemelryk added a comment - Hi Petr, I've just attached a patch that converts the navigation to YUI3 and makes the following changes, could you please have a look at this an just make sure you are happy with the direction that is it going? Changes:
  1. Converted the whole navigation and navbar JS to YUI3, the only YUI2 remaining is the panel which I won't upgrade until the overlay is brought out of beta in YUI3
  2. Separated the code behind the navbar and the navigation trees so that they are two clearly self contained units now
  3. Redesigned the navbar so that it can be easily overridden in later JS such as by themers
  4. Moved navbar JS to blocks/blocks.js and navigation tree JS to blocks/global_navigation_tree/navigation.js as it can now be overridden by themers
  5. Added support into block_base class so that any block can dock with the navbar... this is on by default with user prefs and all
  6. Separated conf/display parameters into a name spaced structure so that JS included later can override it without any difficulty.
  7. Tested this in all browsers, despite all themes being broken in IE6 it appears to work nicely
Still to do:
  1. Add a CFG variable to limit/configure use of the navbar
  2. Find a solution for the navbar when more blocks than can be displayed have been added to it.
  3. Work with you Petr to find a nice solution to reduce the size of columns with no blocks in them for the holy grail themes
Cheers Sam
Hide
Sam Hemelryk added a comment -

Ohh nearly forgot for information on overridding the JS for navigation check out the navigation.js in the base theme.
The current setup works perfectly with standardold, but the holy grail themes may pose a real challenge

Show
Sam Hemelryk added a comment - Ohh nearly forgot for information on overridding the JS for navigation check out the navigation.js in the base theme. The current setup works perfectly with standardold, but the holy grail themes may pose a real challenge
Hide
Petr Škoda (skodak) added a comment -

We should be trying to minimise number of linked .js files because each of them introduces one more http request to server which is killing them if there are tens on each page, so everything from core (moodle/blocks/blocks.js) should go into one JS file if possible (javascript-static.js).

I still can not get past the idea that every theme will have the sidebar with shadow on the left side. Urs was also concerned about the usability and visual aspects of the sidebar. I do not think that the base theme should have any shadows at all. If this gets into the 'base' theme there should be an easy way to indicate navbar is not welcome in derived theme (theme/name/config.php option).

BTW why is this thing called navbar? It is not used for navigation only, right? I can see words like "navbar", "sideblock", "instance_can_dock_with_navbar", etc. , why not use something more consistent:
1/ first we ned to decide how to call that dock thing (I do not think left, right, side words should be there, it can be anywhere on page)
2/ use the new name instead of navbar, sidebar, dock consistently

Show
Petr Škoda (skodak) added a comment - We should be trying to minimise number of linked .js files because each of them introduces one more http request to server which is killing them if there are tens on each page, so everything from core (moodle/blocks/blocks.js) should go into one JS file if possible (javascript-static.js). I still can not get past the idea that every theme will have the sidebar with shadow on the left side. Urs was also concerned about the usability and visual aspects of the sidebar. I do not think that the base theme should have any shadows at all. If this gets into the 'base' theme there should be an easy way to indicate navbar is not welcome in derived theme (theme/name/config.php option). BTW why is this thing called navbar? It is not used for navigation only, right? I can see words like "navbar", "sideblock", "instance_can_dock_with_navbar", etc. , why not use something more consistent: 1/ first we ned to decide how to call that dock thing (I do not think left, right, side words should be there, it can be anywhere on page) 2/ use the new name instead of navbar, sidebar, dock consistently
Hide
Petr Škoda (skodak) added a comment -

oh!

$string['*'] = 'Any page';
$string['site-*'] = 'Any top-level site page';

is not good, we have to use a-z english words there only, please revert ASAP

Show
Petr Škoda (skodak) added a comment - oh! $string['*'] = 'Any page'; $string['site-*'] = 'Any top-level site page'; is not good, we have to use a-z english words there only, please revert ASAP
Hide
Sam Hemelryk added a comment -

Hi Petr,
The above comment you made on this issue I think was meant to MDL-21375?

Show
Sam Hemelryk added a comment - Hi Petr, The above comment you made on this issue I think was meant to MDL-21375?
Hide
Sam Hemelryk added a comment -

Hi Petr,
Could you please have a look at this patch for me and let me know what you think.
Cheers
Sam

Show
Sam Hemelryk added a comment - Hi Petr, Could you please have a look at this patch for me and let me know what you think. Cheers Sam
Hide
Sam Hemelryk added a comment -

This was commit last night

Show
Sam Hemelryk added a comment - This was commit last night
Hide
Sam Hemelryk added a comment -

All done for now

Show
Sam Hemelryk added a comment - All done for now

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: