diff --git a/lib/gollum/frontend/public/javascript/gollum-editor/gollum.editor.js b/lib/gollum/frontend/public/javascript/gollum-editor/gollum.editor.js index 749d1d97..24e9fd74 100644 --- a/lib/gollum/frontend/public/javascript/gollum-editor/gollum.editor.js +++ b/lib/gollum/frontend/public/javascript/gollum-editor/gollum.editor.js @@ -507,10 +507,6 @@ var FormatSelector = { $_SELECTOR: null, - - changeFormat: function( newFormat ) { - - }, evtChangeFormat: function( e ) { var newMarkup = $(this).val(); @@ -552,6 +548,9 @@ } $('#function-help').unbind('click'); $('#function-help').click( Help.evtHelpButtonClick ); + + // generate help menus + Help.generateHelpMenuFor( name ); } } else { if ( $('#function-help').length ) { @@ -594,26 +593,29 @@ } // generate parent submenu on first run - Help.generateSubMenu( helpData[0] ); + Help.generateSubMenu( helpData[0], 0 ); + $($('#gollum-editor-help-list li a').get(0)).click(); }, - generateSubMenu: function( subData ) { + generateSubMenu: function( subData, index ) { $('#gollum-editor-help-list').html(''); $('#gollum-editor-help-content').html(''); for ( var i=0; i < subData.content.length; i++ ) { if ( typeof subData.content[i] != 'object' ) break; - - var $subLi = $('
  • ' + - helpData[i].content[j].menuName + '
  • '); + + var $subLi = $('
  • ' + + subData.content[i].menuName + '
  • '); + $('#gollum-editor-help-list').append( $subLi ); $subLi.children('a').click( Help.evtSubMenuClick ); } }, - showHelp: function( index1, index2 ) { - var html = Help._HELP[_ACTIVE_HELP_LANG][index1].content[index2].data; + showHelpFor: function( index1, index2 ) { + var html = + Help._HELP[Help._ACTIVE_HELP_LANG][index1].content[index2].data; $('#gollum-editor-help-content').html(html); }, @@ -647,6 +649,7 @@ } $('#function-help').unbind('click'); $('#function-help').click( Help.evtHelpButtonClick ); + Help.generateHelpMenuFor( name ); } } }, @@ -675,19 +678,22 @@ }, evtParentMenuClick: function( e ) { + e.preventDefault(); // short circuit if we've selected this already if ( $(this).hasClass('selected') ) return; // populate from help data for this var helpIndex = $(this).attr('rel'); - var subData = Help._HELP[Help._ACTIVE_HELP][helpIndex]; + var subData = Help._HELP[Help._ACTIVE_HELP_LANG][helpIndex]; - $('#gollum-editor-help-content li a').removeClass('selected'); + $('#gollum-editor-help-parent li a').removeClass('selected'); $(this).addClass('selected'); - Help.generateSubMenu( subData ); + Help.generateSubMenu( subData, helpIndex ); + $($('#gollum-editor-help-list li a').get(0)).click(); }, evtSubMenuClick: function( e ) { + e.preventDefault(); if ( $(this).hasClass('selected') ) return; // split index rel data diff --git a/lib/gollum/frontend/public/javascript/gollum-editor/langs/markdown.js b/lib/gollum/frontend/public/javascript/gollum-editor/langs/markdown.js index d44e3b19..3a4e170f 100644 --- a/lib/gollum/frontend/public/javascript/gollum-editor/langs/markdown.js +++ b/lib/gollum/frontend/public/javascript/gollum-editor/langs/markdown.js @@ -147,7 +147,7 @@ var MarkDownHelp = [ menuName: 'Links and Images', content: [ { - menuName: 'Links and Images', + menuName: 'Links', data: '

    Links and Images go here

    ' } ]