Skip to content

Commit

Permalink
Help: Fix help system and tags. Fixes Komodo#1174 and probably others.
Browse files Browse the repository at this point in the history
rn=

(integrated from the KomodoIDE master branch change 16ba6ab by Carey Hoffman <[email protected]>)

Komodo/KomodoIDE@16ba6ab
  • Loading branch information
th3coop committed Apr 4, 2018
1 parent 22c423f commit 2b87dbe
Show file tree
Hide file tree
Showing 21 changed files with 94 additions and 82 deletions.
2 changes: 1 addition & 1 deletion src/chrome/komodo/content/dialogs/editEnvVar.xul
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
oncommand="InsertShortcut(this);"/>
<menuseparator/>
<menuitem label="&helpOnShortcuts.label;"
oncommand="ko.help.open('interpolation_shortcuts');"/>
oncommand="ko.help.open('shortcuts.html');"/>
</menupopup>
</button>
<button label="&addPath.label;" accesskey="&addPath.accesskey;"
Expand Down
28 changes: 14 additions & 14 deletions src/chrome/komodo/content/dialogs/featureControlPanel.p.xul
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@
/>
<button class="help-icon button-toolbar-a"
tooltiptext="&helpOnBackgroundSyntaxChecking.tooltiptext;"
oncommand="LaunchHelp('background_syntax_checking');"/>
oncommand="LaunchHelp('editor.html#Linting');"/>
<separator flex="1"/>
<button class="configure-icon button-toolbar-a"
<button class="icon-cog button-toolbar-a"
tooltiptext="&configureNodeJS.tooltiptext;"
oncommand="LaunchPrefs('nodejsItem')"/>
</hbox>
Expand All @@ -107,9 +107,9 @@
/>
<button class="help-icon button-toolbar-a"
tooltiptext="&helpOnBackgroundSyntaxChecking.tooltiptext;"
oncommand="LaunchHelp('background_syntax_checking');"/>
oncommand="LaunchHelp('editor.html#Linting');"/>
<separator flex="1"/>
<button class="configure-icon button-toolbar-a"
<button class="icon-cog button-toolbar-a"
tooltiptext="&configurePerl.tooltiptext;"
oncommand="LaunchPrefs('perlItem')"/>
</hbox>
Expand All @@ -126,9 +126,9 @@
/>
<button class="help-icon button-toolbar-a"
tooltiptext="&helpOnBackgroundSyntaxChecking.tooltiptext;"
oncommand="LaunchHelp('background_syntax_checking');"/>
oncommand="LaunchHelp('editor.html#Linting');"/>
<separator flex="1"/>
<button class="configure-icon button-toolbar-a"
<button class="icon-cog button-toolbar-a"
tooltiptext="&configurePHP.tooltiptext;"
oncommand="LaunchPrefs('phpItem')"/>
</hbox>
Expand All @@ -145,9 +145,9 @@
/>
<button class="help-icon button-toolbar-a"
tooltiptext="&helpOnBackgroundSyntaxChecking.tooltiptext;"
oncommand="LaunchHelp('background_syntax_checking');"/>
oncommand="LaunchHelp('editor.html#Linting');"/>
<separator flex="1"/>
<button class="configure-icon button-toolbar-a"
<button class="icon-cog button-toolbar-a"
tooltiptext="&configurePython.tooltiptext;"
oncommand="LaunchPrefs('pythonItem')"/>
</hbox>
Expand All @@ -164,9 +164,9 @@
/>
<button class="help-icon button-toolbar-a"
tooltiptext="&helpOnBackgroundSyntaxChecking.tooltiptext;"
oncommand="LaunchHelp('background_syntax_checking');"/>
oncommand="LaunchHelp('editor.html#Linting');"/>
<separator flex="1"/>
<button class="configure-icon button-toolbar-a"
<button class="icon-cog button-toolbar-a"
tooltiptext="&configurePython3.tooltiptext;"
oncommand="LaunchPrefs('python3Item')"/>
</hbox>
Expand All @@ -183,9 +183,9 @@
/>
<button class="help-icon button-toolbar-a"
tooltiptext="&helpOnBackgroundSyntaxChecking.tooltiptext;"
oncommand="LaunchHelp('background_syntax_checking');"/>
oncommand="LaunchHelp('editor.html#Linting');"/>
<separator flex="1"/>
<button class="configure-icon button-toolbar-a"
<button class="icon-cog button-toolbar-a"
tooltiptext="&configureRuby.tooltiptext;"
oncommand="LaunchPrefs('rubyItem')"/>
</hbox>
Expand All @@ -201,7 +201,7 @@
/>
<button class="help-icon button-toolbar-a"
tooltiptext="&helpOnBackgroundSyntaxChecking.tooltiptext;"
oncommand="LaunchHelp('background_syntax_checking');"/>
oncommand="LaunchHelp('editor.html#Linting');"/>
</hbox>
</row>
<row id="other-languages-feature-row">
Expand All @@ -215,7 +215,7 @@
/>
<button class="help-icon button-toolbar-a"
tooltiptext="&helpOnBackgroundSyntaxChecking.tooltiptext;"
oncommand="LaunchHelp('background_syntax_checking');"/>
oncommand="LaunchHelp('editor.html#Linting');"/>
</hbox>
</row>
</rows>
Expand Down
9 changes: 7 additions & 2 deletions src/chrome/komodo/content/launch.p.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,17 @@ if (!("help" in ko)) {
ko.help = {};
(function () {
var _log = ko.logging.getLogger("ko.help");

/* XXX duplicated from help/content/contextHelp.js. We do NOT want
alwaysRaised attribute on the window, that's obnoxious! */

function openHelp(topic, path = 'Manual/')
function openHelp(topic, path = 'manual/')
{
const {Cc, Ci} = require("chrome");
let version = Cc["@activestate.com/koInfoService;1"].getService(Ci.koIInfoService).version;
// get major version
version = version.substr(0,version.indexOf("."));
path = '/'+version+"/"+path;

var url = ko.prefs.getString('doc_site');
if (topic) url += path + topic;
ko.browse.openUrlInDefaultBrowser(url);
Expand Down
1 change: 0 additions & 1 deletion src/chrome/komodo/content/pref/pref-html.xul
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
<![CDATA[
function OnPreferencePageLoading(prefset) {
log.debug("Loading HTML Prefs");
//try {
// matchingTag_toggle(document.getElementById("showMatchingTagsOnClick"));
// const { classes: Cc, interfaces: Ci } = Components;
Expand Down
3 changes: 2 additions & 1 deletion src/chrome/komodo/content/pref/pref-proxies.xul
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&connectionsDialog.title;"
dlgbuttons="accept,cancel,help"
ondialoghelp="doHelp();"
onbeforeaccept="return gConnectionsDialog.beforeAccept();">

<prefpane id="ConnectionsDialogPane"
helpTopic="prefs-connection-settings" helpURI="chrome://komododoc/locale/komodohelp.rdf">
helpTopic="prefs.html#http-inspector-preferences">

<preferences>
<preference id="network.proxy.type" name="network.proxy.type" type="int" onchange="gConnectionsDialog.proxyTypeChanged();"/>
Expand Down
11 changes: 9 additions & 2 deletions src/chrome/komodo/content/pref/pref.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,15 @@ function canHelp() {

function doHelp() {
var tag = getHelpTag();
tag = "prefs#preferences_"+tag.replace(/\-/g,"_").toLowerCase();
ko.windowManager.getMainWindow().ko.help.open(tag);
if (tag.indexOf(".html") >= 0)
{
ko.windowManager.getMainWindow().ko.help.open(tag);
}
else
{
tag = "prefs.html#"+tag.replace(/\_/g,"-").toLowerCase();
ko.windowManager.getMainWindow().ko.help.open(tag);
}
}

function setupFilteredTree() {
Expand Down
Loading

0 comments on commit 2b87dbe

Please sign in to comment.