Inline help engine complete; beginnings of Markdown inline help
This commit is contained in:
@@ -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 = $('<li><a href="#" rel="' + i + ':' + j + '">' +
|
||||
helpData[i].content[j].menuName + '</a></li>');
|
||||
|
||||
var $subLi = $('<li><a href="#" rel="' + index + ':' + i + '">' +
|
||||
subData.content[i].menuName + '</a></li>');
|
||||
|
||||
|
||||
$('#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
|
||||
|
||||
@@ -147,7 +147,7 @@ var MarkDownHelp = [
|
||||
menuName: 'Links and Images',
|
||||
content: [
|
||||
{
|
||||
menuName: 'Links and Images',
|
||||
menuName: 'Links',
|
||||
data: '<p>Links and Images go here</p>'
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user