зеркало из https://github.com/mozilla/pjs.git
Adding facility for platform-specific help panel datasources b=254992 r=doron
This commit is contained in:
Родитель
bc75ef1532
Коммит
8dbb4da35c
|
@ -44,8 +44,8 @@ var helpBrowser;
|
|||
var helpExternal;
|
||||
var helpSearchPanel;
|
||||
var emptySearch;
|
||||
var emptySearchText
|
||||
var emptySearchLink
|
||||
var emptySearchText = "No search items found.";
|
||||
var emptySearchLink = "about:blank";
|
||||
var helpTocPanel;
|
||||
var helpIndexPanel;
|
||||
var helpGlossaryPanel;
|
||||
|
@ -59,6 +59,7 @@ const RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Comp
|
|||
const RDF_ROOT = RDF.GetResource("urn:root");
|
||||
const NC_PANELLIST = RDF.GetResource(NC + "panellist");
|
||||
const NC_PANELID = RDF.GetResource(NC + "panelid");
|
||||
const NC_PLATFORM = RDF.GetResource(NC + "platform");
|
||||
const NC_EMPTY_SEARCH_TEXT = RDF.GetResource(NC + "emptysearchtext");
|
||||
const NC_EMPTY_SEARCH_LINK = RDF.GetResource(NC + "emptysearchlink");
|
||||
const NC_DATASOURCES = RDF.GetResource(NC + "datasources");
|
||||
|
@ -87,6 +88,9 @@ const defaultHelpFile = "chrome://help/locale/mozillahelp.rdf";
|
|||
var defaultTopic = "welcome";
|
||||
var searchDatasources = "rdf:null";
|
||||
var searchDS = null;
|
||||
var platform = /mac/i.test(navigator.platform) ? "mac" :
|
||||
/win/i.test(navigator.platform) ? "win" :
|
||||
/os\/2/i.test(navigator.platform) ? "os/2" : "unix";
|
||||
|
||||
const NSRESULT_RDF_SYNTAX_ERROR = 0x804e03f7;
|
||||
|
||||
|
@ -212,24 +216,27 @@ function loadHelpRDF() {
|
|||
var panelDefs = helpFileDS.GetTarget(RDF_ROOT, NC_PANELLIST, true);
|
||||
RDFContainer.Init(helpFileDS, panelDefs);
|
||||
var iterator = RDFContainer.GetElements();
|
||||
while (iterator.hasMoreElements()) {
|
||||
while (iterator.hasMoreElements()) {
|
||||
var panelDef = iterator.getNext();
|
||||
var panelID = getAttribute(helpFileDS, panelDef, NC_PANELID, null);
|
||||
if (getAttribute(helpFileDS, panelDef, NC_PLATFORM, platform) != platform)
|
||||
continue; // ignore datasources for other platforms.
|
||||
|
||||
var datasources = getAttribute(helpFileDS, panelDef, NC_DATASOURCES, "rdf:none");
|
||||
var panelID = getAttribute(helpFileDS, panelDef, NC_PANELID, null);
|
||||
|
||||
var datasources = getAttribute(helpFileDS, panelDef, NC_DATASOURCES, "rdf:null");
|
||||
datasources = normalizeLinks(helpBaseURI, datasources);
|
||||
// cache additional datsources to augment search datasources.
|
||||
if (panelID == "search") {
|
||||
emptySearchText = getAttribute(helpFileDS, panelDef, NC_EMPTY_SEARCH_TEXT, "No search items found.");
|
||||
emptySearchLink = getAttribute(helpFileDS, panelDef, NC_EMPTY_SEARCH_LINK, "about:blank");
|
||||
searchDatasources = datasources;
|
||||
datasources = "rdf:null"; // but don't try to display them yet!
|
||||
emptySearchText = getAttribute(helpFileDS, panelDef, NC_EMPTY_SEARCH_TEXT, emptySearchText);
|
||||
emptySearchLink = getAttribute(helpFileDS, panelDef, NC_EMPTY_SEARCH_LINK, emptySearchLink);
|
||||
searchDatasources += " " + datasources;
|
||||
continue; // but don't try to display them yet!
|
||||
}
|
||||
|
||||
// cache toc datasources for use by ID lookup.
|
||||
var tree = document.getElementById("help-" + panelID + "-panel");
|
||||
loadDatabasesBlocking(datasources);
|
||||
tree.setAttribute("datasources", datasources);
|
||||
tree.setAttribute("datasources", tree.getAttribute("datasources") + " " + datasources);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
|
|
|
@ -155,8 +155,7 @@
|
|||
</template>
|
||||
<treecols>
|
||||
<treecol id="GlossaryNameColumn" flex="1"
|
||||
hideheader="true"
|
||||
primary="true"/>
|
||||
hideheader="true"/>
|
||||
</treecols>
|
||||
</tree>
|
||||
|
||||
|
@ -248,7 +247,7 @@
|
|||
|
||||
<treecols>
|
||||
<treecol id="ResultsColumn" flex="1"
|
||||
hideheader="true" primary="true"
|
||||
hideheader="true"
|
||||
sortActive="true"
|
||||
sortDirection="ascending"
|
||||
sort="?name"/>
|
||||
|
|
|
@ -9,6 +9,7 @@ help.jar:
|
|||
|
||||
en-US.jar:
|
||||
locale/en-US/help/mozillahelp.rdf (locale/en-US/mozillahelp.rdf)
|
||||
locale/en-US/help/help-win.rdf (locale/en-US/help-win.rdf)
|
||||
locale/en-US/help/help-glossary.rdf (locale/en-US/help-glossary.rdf)
|
||||
* locale/en-US/help/contents.rdf (locale/en-US/contents.rdf)
|
||||
locale/en-US/help/developer_tools.xhtml (locale/en-US/developer_tools.xhtml)
|
||||
|
|
|
@ -1828,16 +1828,6 @@
|
|||
</nc:subheadings>
|
||||
</rdf:Description>
|
||||
|
||||
<rdf:Description about="help-indexAZ.rdf#q">
|
||||
<nc:subheadings>
|
||||
<rdf:Seq><rdf:li>
|
||||
<rdf:Description ID="Quick_Launch"
|
||||
nc:name="Quick Launch"
|
||||
nc:link="nav_help.xhtml#using_quick_launch"/>
|
||||
</rdf:li></rdf:Seq>
|
||||
</nc:subheadings>
|
||||
</rdf:Description>
|
||||
|
||||
<rdf:Description about="help-indexAZ.rdf#r">
|
||||
<nc:subheadings>
|
||||
<rdf:Seq><rdf:li>
|
||||
|
@ -1934,11 +1924,6 @@
|
|||
<rdf:Description ID="SSL"
|
||||
nc:name="SSL"
|
||||
nc:link="ssl_help.xhtml#edit_ciphers"/>
|
||||
</rdf:li>
|
||||
<rdf:li>
|
||||
<rdf:Description ID="System"
|
||||
nc:name="System Preferences"
|
||||
nc:link="cs_nav_prefs_advanced.xhtml#system"/>
|
||||
</rdf:li></rdf:Seq>
|
||||
</nc:subheadings>
|
||||
</rdf:Description>
|
||||
|
|
|
@ -131,7 +131,6 @@ nc:link="chrome://help/locale/nav_help.xhtml#plugins_and_downloads"/> </rdf:li>
|
|||
<rdf:li> <rdf:Description ID="nav-doc-cache" nc:name="Changing Cache Settings" nc:link="nav_help.xhtml#changing_cache_settings"/> </rdf:li>
|
||||
<rdf:li> <rdf:Description ID="nav-doc-smartup" nc:name="Getting the Latest Software Automatically" nc:link="nav_help.xhtml#getting_the_latest_software_automatically"/> </rdf:li>
|
||||
<rdf:li> <rdf:Description ID="nav-doc-mousewheel" nc:name="Using a Mouse Wheel" nc:link="nav_help.xhtml#using_a_mouse_wheel"/> </rdf:li>
|
||||
<rdf:li> <rdf:Description ID="nav-doc-quicklaunch" nc:name="Using Quick Launch" nc:link="nav_help.xhtml#using_quick_launch"/> </rdf:li>
|
||||
</rdf:Seq>
|
||||
</nc:subheadings>
|
||||
</rdf:Description>
|
||||
|
@ -804,7 +803,6 @@ nc:link="chrome://help/locale/nav_help.xhtml#plugins_and_downloads"/> </rdf:li>
|
|||
<rdf:li><rdf:Description ID="advanced_pref_installation" nc:name="Software Installation" nc:link="cs_nav_prefs_advanced.xhtml#software_installation"/> </rdf:li>
|
||||
<rdf:li><rdf:Description ID="advanced_pref_mouse_wheel" nc:name="Mouse Wheel" nc:link="cs_nav_prefs_advanced.xhtml#mouse_wheel"/> </rdf:li>
|
||||
<rdf:li><rdf:Description ID="advanced_pref_dom_inspector" nc:name="DOM Inspector" nc:link="cs_nav_prefs_advanced.xhtml#dom_inspector"/> </rdf:li>
|
||||
<rdf:li><rdf:Description ID="advanced_pref_system" nc:name="System" nc:link="cs_nav_prefs_advanced.xhtml#system"/> </rdf:li>
|
||||
</rdf:Seq>
|
||||
</nc:subheadings>
|
||||
</rdf:Description>
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
<?xml version="1.0"?>
|
||||
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:nc="http://home.netscape.com/NC-rdf#">
|
||||
|
||||
<rdf:Description about="help-toc.rdf#nav-doc-ses">
|
||||
<nc:subheadings>
|
||||
<rdf:Seq>
|
||||
<rdf:li> <rdf:Description ID="nav-doc-quicklaunch" nc:name="Using Quick Launch" nc:link="nav_help.xhtml#using_quick_launch"/> </rdf:li>
|
||||
</rdf:Seq>
|
||||
</nc:subheadings>
|
||||
</rdf:Description>
|
||||
|
||||
<rdf:Description about="help-toc.rdf#advanced_pref_advanced">
|
||||
<nc:subheadings>
|
||||
<rdf:Seq>
|
||||
<rdf:li><rdf:Description ID="advanced_pref_system" nc:name="System" nc:link="cs_nav_prefs_advanced.xhtml#system"/> </rdf:li>
|
||||
</rdf:Seq>
|
||||
</nc:subheadings>
|
||||
</rdf:Description>
|
||||
|
||||
<rdf:Description about="help-indexAZ.rdf#q">
|
||||
<nc:subheadings>
|
||||
<rdf:Seq><rdf:li>
|
||||
<rdf:Description ID="Quick_Launch"
|
||||
nc:name="Quick Launch"
|
||||
nc:link="nav_help.xhtml#using_quick_launch"/>
|
||||
</rdf:li></rdf:Seq>
|
||||
</nc:subheadings>
|
||||
</rdf:Description>
|
||||
|
||||
<rdf:Description about="help-indexAZ.rdf#s">
|
||||
<nc:subheadings>
|
||||
<rdf:Seq><rdf:li>
|
||||
<rdf:Description ID="System"
|
||||
nc:name="System Preferences"
|
||||
nc:link="cs_nav_prefs_advanced.xhtml#system"/>
|
||||
</rdf:li></rdf:Seq>
|
||||
</nc:subheadings>
|
||||
</rdf:Description>
|
||||
|
||||
</rdf:RDF>
|
Загрузка…
Ссылка в новой задаче