A kind of optimization processing system and method for router help information
Technical field
The present invention relates to the optimization processing system of technical field of information processing more particularly to a kind of router help information and
Its method.
Background technique
With the further development of Internet application, in order to provide the user with more more fully web experiences, in client
The element of end and the client carrying that in the network system of server (BS) framework, operator is provided can be more and more.And in order to
User's correct operation client is instructed, the page for often providing detailed client in the server helps, to introduce client
The content function at end, and the interface for obtaining help information is provided in the page of client.
Router help information function considers that user can pass through side at router interface function interface based on user perspective
Supplementary information checks the application method and related description of each function.For help information, with increasing for router feature,
And the complication of function, help information also can gradually become cumbersome.Our company's product is numerous, the side of the congenerous of different product
Supplementary information would also vary from.
1) product of our company's router is existing K2, K2P, K3, K3C, K2T and the routing of full room etc..In these products
In, the router of different product all has common function, such as the security setting of router.The router of different products
Prompt also can be variant.
2) for each product, there is a set of unified front end page, the interface of each product is from unified front-end code.
3) difference is prompted for the help information of different product, each product does the processing of type differentiation, not for each product
With place, be individually added into the different pages in product type, the page in when compiling each type can replace unified front end
The page in code.
4) help information particular content updates updates in language table in the server, generates specific label,
Applied in code.
5) differentiation of help information is handled in the page in type, according to the help information demand of product, in the page
The label of the different needs of middle filling.
The help system as disclosed in the patent of invention of Publication No. CN101576822A and its implementation, the help are
System includes: operation monitoring module, be used for monitoring user operation, and send the user's operation information and with the user's operation
Corresponding help information;Memory module, for receiving and storing the information and the side from the operation monitoring module
Supplementary information;Statistical analysis module, for obtaining the information and the help information from the memory module, and to the information
It is for statistical analysis with the help information.The implementation method of this help information is only applicable to a kind of product, works as product renewing
Help information needs all to remake when the replacement, increases many workloads for developer.
Meanwhile in the prior art, as shown in Figure 1, A, B, C, D distinguish identifier router product K 2, K2P, K3, K3C.
1) when handling help information in the page, help information is there are three types of format, title: function subhead, content:
Feature content, summary: function mere suggestion increases help information and needs to increase title, content, summary in the page
It is right, it will appear many CSS elements pair when help information is numerous, in the page, it is cumbersome.
2) when increasing help information, same front-end code is opened, increases code newly in code
<li class="summary">{ %helpStr.modeSet% }</li>
<li class="title">{ %label.routerMode% }</li>
<li class="content">{ %helpStr.routerMode% }</li>,
There is the code of multiple same formats in each page, when increasing many information newly, in unified front-end code
Increased workload can be very big, and increased code is also many in product type.Code is more, and easier error is more difficult to
Maintenance, performance are bad.
3) title, content, the summary occurred in the page to it is more when, help information filling be also easy to
Error, it is easy to cause not being inconsistent with PRD.Sending out version, it is easy to appear bug, influence product release.
Therefore, in the case where the numerous different product help informations of product are complicated, how to have one kind being capable of simple-to-maintain
The method of each function help information prompt of more new router, becomes present invention problem to be solved.
Summary of the invention
For above-mentioned technical problem of the existing technology, the present invention provides at a kind of optimization of router help information
System and method are managed, the present invention increases an ID identical with Page Name in page CSS code, by help.JS
The function of definition handles ID to construct the CSS element of fixed format, and the developer of follow-up maintenance only needs to increase in help.js
Help information pair is operated without being added delete operation into each page without opening each page.
To reach above-mentioned technical purpose, the present invention is adopted the following technical scheme that:
A kind of optimization processing system of router help information comprising:
Module is obtained, for obtaining the title of the page;
Definition module, for increasing ID identical with the title of the page in the CSS code of the page;
Constructing module constructs fixed format for handling the ID by function defined in help.js script file
CSS element.
As a preference of the present invention, the acquisition module obtains the page by stateman.current.currentName
Title.
As a preference of the present invention, the definition module removes in the page title, content, summary pairs
CSS code, and pass through addition in the CSS code of the page<div id="ID"></div>to increase ID.
As a preference of the present invention, the constructing module passes through the defined function dealID () in help.js script file
The ID is handled, definition formHelpContent () respectively obtains the CSS member of title, content, summary fixed format
Element;And it is formed by the SetContent () function in help.js script file comprising < li title content
Summary > fixed format CSS element.
As a preference of the present invention, being used for will when calling clickHelp () function the system also includes display module
The content of the constructing module construction is inserted into described by function append ()<div id="ID"></div>ending.
A kind of optimized treatment method of router help information comprising:
S1, the title for obtaining the page;
S2, increase ID identical with the title of the page in the CSS code of the page;
S3, the ID is handled by function defined in help.js script file to construct the CSS element of fixed format.
As a preference of the present invention, the step S1 includes: S11, passes through stateman.current.currentName
Obtain the title of the page.
As a preference of the present invention, the step S2 include: S21, remove title, content in the page,
Summary pairs of CSS code, and pass through addition in the CSS code of the page<div id="ID"></div>to increase
ID。
As a preference of the present invention, the step S3 include: S31, remove title, content in the page,
Summary pairs of CSS code, and pass through addition in the CSS code of the page<div id="ID"></div>to increase
ID。
As a preference of the present invention, in, the method also includes: S4, when calling clickHelp () function by the structure
The content of modeling block construction is inserted into described by function append ()<div id="ID"></div>ending.
Technical solution provided by the invention can include the following benefits:
1, the present invention is shown for the optimization of router help information, and subsequent maintenance can be very simple, and developer only needs
To increase help information pair in help.js, without being added delete operation into each page, without opening each page
It is operated.
2, the present invention increases an ID identical with current page title in page CSS code, passes through
FormHelpContent () is used to construct the CSS form of title, content, summary, and load forms the word of fixed format
Symbol string, then by SetContent () for handling each ID, formed one it is total comprising < li title content
Summary > character string, define the content of help information, only need to be in title, content, summary when follow-up maintenance
In be respectively filled in corresponding help information content.
Detailed description of the invention
Fig. 1 is the processing mode in background technique to help information;
Fig. 2 is a kind of optimization processing system construction drawing of router help information of the embodiment of the present invention 1;
Fig. 3 is a kind of optimization processing system construction drawing of router help information of the embodiment of the present invention 2;
Fig. 4 is a kind of optimized treatment method flow chart of router help information of the embodiment of the present invention 3;
Fig. 5 is the method flow diagram for defining feature.js of the embodiment of the present invention 4.
Specific embodiment
Referring now to attached drawing hereinafter, the present invention is described in more detail below, shows the embodiment of the present invention in the figure.
However, the present invention can be presented as many different forms, and it should not be construed as being limited to specific embodiment presented herein.
Exactly, these embodiments are for conveying the scope of the invention to those skilled in the art.
Unless otherwise defined, otherwise, term (including technical and scientific terms) used herein is interpreted as
With the identical meaning of the meaning that is generally understood with the technical staff in field belonging to the present invention.Also, it is to be understood that
Term used herein be interpreted as having with the consistent meaning of meaning in this specification and related fields, and do not answer
It is explained by ideal or excessively formal meaning, unless being clearly specified that herein.
Embodiment 1
Carry out the technical solution that the present invention will be described in detail with reference to the accompanying drawing.
A kind of optimization processing system of router help information is present embodiments provided, as shown in Figure 2, comprising: obtain mould
The specific operation process of block 100, definition module 200, constructing module 300, this programme is as follows:
Module 100 is obtained, for obtaining the title of the page.
When loading the various functions page, the ID title that module 100 gets every page is obtained.
Definition module 200, for increasing ID identical with the title of the page in the CSS code of the page.
Increase an ID in page CSS code, ID is identical as the ID title of the page, facilitates subsequent operation.
Constructing module 300 constructs fixed grating for handling the ID by function defined in help.js script file
The CSS element of formula.
ID is handled by function defined in JS script file, constructs the CSS element of fixed format.
The prompt of the help information of different router products can be variant, when technical staff safeguards help information, root
According to relevant function and the corresponding page of ID, selection is inserted help information in intrinsic format, without open each page into
Row operation.
In conclusion a kind of optimization processing system of router help information provided in this embodiment, is helped for router
The optimization of supplementary information shows that subsequent maintenance can be very simple, and developer only needs to increase help information pair in help.js,
Without being added delete operation into each page, operated without opening each page.
Embodiment 2
The present embodiment and above-described embodiment 1 are essentially identical, the acquisition module 100 including embodiment 1, definition module 200, structure
Modeling block 300, the present embodiment the difference from embodiment 1 is that, the present embodiment further include: display module 400, as shown in figure 3, this
The specific operation process of embodiment is as follows:
The title for obtaining module 100 and obtaining the page by stateman.current.currentName.
When the page loads, such as when the load security setting page, it can be seen that the ID of the security setting page is
SafeMng, first choice obtain page ID by stateman.current.currentName.In simple terms, i.e., it is asked by network
Transmission these three parameters of stateman.current.currentName are sought, the page ID of interface return is obtained.
The definition module 200 removes title, content, summary pairs in the page of CSS code, and in institute
It states in the CSS code of the page and passes through addition<div id="ID"></div>to increase ID.
After obtaining the ID of the page, remove all about title, content, summary couple in original page
CSS code, be then added in the page again<div id="ID"></div>code, this ID are identical with page ID.
The constructing module 300 handles the ID, definition by the defined function dealID () in help.js script file
FormHelpContent () respectively obtains the CSS element of title, content, summary fixed format;And pass through
It includes<li title content summary>fixed grating that SetContent () function in help.js script file, which is formed,
The CSS element of formula.
Defined function dealID () defines the corresponding information of all ID in help.js script file, and dealID is used to shape
At the additional character string of final needs;
Defined function formHelpContent () is used to construct the CSS form of title, content, summary, load
Form the character string of fixed format, and return string.FormHelpContent () is used to generate the character of fixed format
String.Wherein function formHelpContent () construction is respectively the individual character string of title, content, summary.
SetContent () for handling each ID, formed one it is total comprising<li title content summary>
Character string.
For example, a page can be described as representing a function, there may be multipair < li title in right the latter function
Content summary >, formHelpContent () is responsible for construction title, content, summary;SetContent()
Content for constructing formHelpContent () merge be formed together one it is total comprising < li title content
Summary > character string.
Preferably, the content of all help informations has been defined in help.js, it then follows a kind of format
" timeZone ": [[], [], []] is included in bracket, such as: filling title content in first bracket, second
Content content is inserted, third can insert multiple summary contents.
The optimization processing system of router help information further includes display module, for calling clickHelp () function
When content that the constructing module 300 constructs is inserted by function append () it is described<div id="ID"></div>
Ending.
In each page of load, if user's click display help information button "? ", system calls automatically
ClickHelp () function, the character string append () Dao<div id=" ID ">for then forming function SetContent ()
</div>below, the help information of this function can be shown.
In conclusion a kind of optimization processing system of router help information provided in this embodiment, in page CSS code
One ID identical with current page title of middle increase, by formHelpContent () for construct title, content,
The CSS form of summary, load form the character string of fixed format, then by SetContent () for handling each ID, shape
At a total character string comprising<li title content summary>, the content of help information, subsequent dimension are defined
When shield, corresponding help information content need to be only respectively filled in title, content, summary.
Embodiment 3
A kind of optimized treatment method of router help information is present embodiments provided, as shown in figure 4, its detailed process can
To include the following steps:
S1, the title for obtaining the page.
When loading the various functions page, the ID title of every page is got.
S2, increase ID identical with the title of the page in the CSS code of the page.
Increase an ID in page CSS code, ID is identical as the ID title of the page, facilitates subsequent operation.
S3, the ID is handled by function defined in help.js script file to construct the CSS element of fixed format.
ID is handled by function defined in JS script file, constructs the CSS element of fixed format.
The prompt of the help information of different router products can be variant, when technical staff safeguards help information, root
According to relevant function and the corresponding page of ID, selection is inserted help information in intrinsic format, without open each page into
Row operation.
In conclusion a kind of optimized treatment method of router help information provided in this embodiment, is helped for router
The optimization of supplementary information shows that subsequent maintenance can be very simple, and developer only needs to increase help information pair in help.js,
Without being added delete operation into each page, operated without opening each page.
Embodiment 4
A kind of optimized treatment method of router help information is present embodiments provided, as shown in figure 5, including embodiment 3
Step S1-S3, detailed process is as follows:
The step S1 includes: S11, by the title of the stateman.current.currentName acquisition page.
When the page loads, such as when the load security setting page, it can be seen that the ID of the security setting page is
SafeMng, first choice obtain page ID by stateman.current.currentName.In simple terms, i.e., it is asked by network
Transmission these three parameters of stateman.current.currentName are sought, the page ID of interface return is obtained.
The step S2 includes: S21, removes title, content, summary pairs in the page of CSS code, and
Pass through addition in the CSS code of the page<div id="ID"></div>to increase ID.
After obtaining the ID of the page, remove all about title, content, summary couple in original page
CSS code, be then added in the page again<div id="ID"></div>code, this ID are identical with page ID.
S31, the CSS code for removing title, content, summary pairs in the page, and in the CSS of the page
Pass through addition in code<div id="ID"></div>to increase ID.
Defined function dealID () defines the corresponding information of all ID in help.js script file, and dealID is used to shape
At the additional character string of final needs;
Defined function formHelpContent () is used to construct the CSS form of title, content, summary, load
Form the character string of fixed format, and return string.FormHelpContent () is used to generate the character of fixed format
String.Wherein function formHelpContent () construction is respectively the individual character string of title, content, summary.
SetContent () for handling each ID, formed one it is total comprising<li title content summary>
Character string.
For example, a page can be described as representing a function, there may be multipair < li title in right the latter function
Content summary >, formHelpContent () is responsible for construction title, content, summary;SetContent()
Content for constructing formHelpContent () merge be formed together one it is total comprising < li title content
Summary > character string.
Preferably, the content of all help informations has been defined in help.js, it then follows a kind of format
" timeZone ": [[], [], []] is included in bracket, such as: filling title content in first bracket, second
Content content is inserted, third can insert multiple summary contents.
As shown in figure 5, A, B, C, D distinguish identifier router product K 2, K2P, K3, K3C.It is established first in router product
The file of one featrue.js defines the corresponding help information of all ID in help.js, according to each function of different product
There can be different help informations to do type compatible, it, can will be in featrue.js if there is content in featrue.js
Content covering.That is dealID is for handling feature.js, selection need which function to be shown.
The optimization processing mode of the help information of the present embodiment:
<div id=" ModeSwitch ">
</div>iD is defined in // the page
In formHelpContent ()
Ret+='<li class="title">'+helpStr [idList1 [0] [i]]+'</li>n
Ret+='<li class="content">'+helpStr [idList1 [1] [i]]+'</li>n
Ret+='<li class="summary">'+helpStr [idList1 [2] [i]]+'</li>n'
return ret;
$("#"+name).append(ret);
Newly-generated CSS style can be added in the page.
The optimized treatment method of router help information further include S4, when calling clickHelp () function by the structure
The content of modeling block construction is inserted into described by function append ()<div id="ID"></div>ending.
In each page of load, if user's click display help information button "? ", system calls automatically
ClickHelp () function, the character string append () Dao<div id=" ID ">for then forming function SetContent ()
</div>below, the help information of this function can be shown.
In conclusion a kind of optimized treatment method of router help information provided in this embodiment, in page CSS code
One ID identical with current page title of middle increase, by formHelpContent () for construct title, content,
The CSS form of summary, load form the character string of fixed format, then by SetContent () for handling each ID, shape
At a total character string comprising<li title content summary>, the content of help information, subsequent dimension are defined
When shield, corresponding help information content only need to be respectively filled in title, content, summary, it is easy to maintain.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to the present invention and disclose
Other embodiments.This application is intended to cover any variations, uses, or adaptations of the disclosure, these modifications are used
Way or adaptive change follow the general principles of this disclosure and including the disclosure it is undocumented in the art known in
Common sense or conventional techniques.The description and examples are only to be considered as illustrative, and the true scope and spirit of the disclosure are under
The claim in face is pointed out.