Make nc:platform a whitespace-separated list of values in content pack RDF

RESOLVED FIXED in mozilla1.8beta2

Status

SeaMonkey
Help Viewer
--
enhancement
RESOLVED FIXED
13 years ago
2 years ago

People

(Reporter: Jeff Walden (gone starting June 8), Assigned: Jeff Walden (gone starting June 8))

Tracking

unspecified
mozilla1.8beta2

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

13 years ago
In bug 254992 we added an attribute to Help content pack RDF so that data
specified in RDF (glossary, table of contents, index, etc.) could be
platform-specific.  I've been working on updating/editing content pack docs on
<http://developer-test.mozilla.org/docs/Help_Viewer:Creating_a_Help_Content_Pack>
and have encountered the problem that specifying something this way requires
duplication of the proper panel description *four* separate times if the
application using it expects to be usable on any platform: once each for
win/unix/os2/mac.  Firefox will be used on all these platforms, so this will
grow unwieldy very quickly.

We need to change nc:platform to be a space-separated list of platforms, such
that all the following would be valid, properly-parsed values for a nc:platform
attribute:

(not present)
"win"
"mac unix"
"os2 win mac"

...and so on.  The patch for both toolkit and Seamonkey viewers is minimal (11
lines of changes), and I intend that this get in before the last 1.8 freeze.
(Assignee)

Comment 1

13 years ago
Created attachment 183562 [details] [diff] [review]
Modify nc:platform to be a space-separated list of values

If the attribute isn't present, the default value of the current platform is
returned and thus is later found in the list when checking whether to bail.  If
it is present, it's split up by whitespace.  Then we bail if the user's
platform isn't found in the platform list (indexOf returns -1 if the value
isn't found in the array).

This should work even if the attribute has only one platform, which is
verifiable by evaluating the following in the JS Console (it returns 0):

"Hello".split(/\s+/).indexOf("Hello");

(Just to be certain, Neil, your review is good for r+sr in Seamonkey and r in
toolkit, right?)
Attachment #183562 - Flags: first-review?(neil.parkwaycc.co.uk)
(Assignee)

Comment 2

13 years ago
Comment on attachment 183562 [details] [diff] [review]
Modify nc:platform to be a space-separated list of values

For review purposes, pretend that "panelPlatform" in Seamonkey code has been
replaced by "panelPlatforms" (a trivial mistake).  If this patch passes muster,
I'll make sure to make the change on check-in.

Comment 3

13 years ago
Comment on attachment 183562 [details] [diff] [review]
Modify nc:platform to be a space-separated list of values

If it wasn't clear, omitting the platforn resource is equivalent to specifying
all platforms (for convenience and backward compatibility).
Attachment #183562 - Flags: first-review?(neil.parkwaycc.co.uk) → first-review+
(Assignee)

Comment 4

13 years ago
Comment on attachment 183562 [details] [diff] [review]
Modify nc:platform to be a space-separated list of values

This patch makes specifying platform-specific documentation that is relevant to
more than one platform more compact.  I changed both Seamonkey and toolkit
viewers to maintain content pack compatibility.
Attachment #183562 - Flags: approval1.8b2?

Comment 5

13 years ago
Comment on attachment 183562 [details] [diff] [review]
Modify nc:platform to be a space-separated list of values

a=chofmann
Attachment #183562 - Flags: approval1.8b2? → approval1.8b2+
(Assignee)

Comment 6

13 years ago
Checked in, marking as fixed.
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8beta2
Product: Toolkit → Seamonkey
You need to log in before you can comment on or make changes to this bug.