CN101847147A - System and method for integrating independently edited script and style into webpage - Google Patents
System and method for integrating independently edited script and style into webpage Download PDFInfo
- Publication number
- CN101847147A CN101847147A CN200910119729A CN200910119729A CN101847147A CN 101847147 A CN101847147 A CN 101847147A CN 200910119729 A CN200910119729 A CN 200910119729A CN 200910119729 A CN200910119729 A CN 200910119729A CN 101847147 A CN101847147 A CN 101847147A
- Authority
- CN
- China
- Prior art keywords
- style
- webpage
- script
- web page
- file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000013515 script Methods 0.000 title claims abstract description 121
- 238000000034 method Methods 0.000 title claims abstract description 22
- 230000006870 function Effects 0.000 claims description 145
- 230000010354 integration Effects 0.000 claims description 16
- 230000000694 effects Effects 0.000 abstract description 4
- 230000000007 visual effect Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Landscapes
- Information Transfer Between Computers (AREA)
Abstract
本发明涉及一种将独立编辑的脚本及样式整合至网页的系统及其方法,其透过分析出网页所包含的脚本与样式名称后,将脚本所呼叫的函式写入函式文件中,并将网页中所使用的样式语法写入样式文件中,以及在网页中写入加载函式文件以及样式文件的网页语法,可以降低网页的原始码的复杂度,达成增加网页开发效率的技术功效。
The present invention relates to a system and method for integrating independently edited scripts and styles into a web page. After analyzing the script and style names contained in the web page, the system writes the function called by the script into a function file, writes the style syntax used in the web page into a style file, and writes the web page syntax for loading the function file and the style file into the web page. This can reduce the complexity of the source code of the web page and achieve the technical effect of increasing the efficiency of web page development.
Description
技术领域technical field
本发明涉及一种整合脚本(script)、样式与网页的系统及其方法,特别是指一种将独立编辑的脚本及样式整合至网页的系统及其方法。The present invention relates to a system and method for integrating scripts, styles and webpages, in particular to a system and method for integrating independently edited scripts and styles into webpages.
背景技术Background technique
在开发网页时,往往都需要依赖许多具有专业知识与技术的人员运用特定的应用软件在计算机上进行网页的编辑,在网页完成编辑之后,再由开发人员将网页上传至提供网站服务的服务器。When developing a webpage, it is often necessary to rely on many personnel with professional knowledge and technology to use specific application software to edit the webpage on the computer. After the webpage is edited, the developer uploads the webpage to the server that provides website services.
早期的网页主要是由超文本标记语言(HyperText Markup Language,HTML)语法与脚本组成,网页的开发人员大多是程序设计师,不过近来由于样式在网页中被大量的使用,因此网页的开发人员除了程序设计师之外,也增加了与程序设计师的专业领域完全不相同的视觉设计师。因此,目前网页开发的流程通常是由视觉设计师制作好加入了样式语法的网页后,交由程序设计师撰写在浏览器上执行的脚本以及在服务器上执行的程序。Early webpages were mainly composed of HyperText Markup Language (HTML) syntax and scripts. Most webpage developers were programmers, but recently, due to the extensive use of styles in webpages, webpage developers except In addition to programmers, visual designers whose field of expertise is completely different from that of programmers have also been added. Therefore, the current process of web page development is usually made by the visual designer to create a web page with style syntax added, and then handed over to the programmer to write the script executed on the browser and the program executed on the server.
不过,由于在网页开发的过程中,网页所呈现出来的画面以及提供操作的功能会不断的调整,另外,网页的原始码并非由同一个人编辑,而是由视觉设计师以及程序设计师共同开发,因此,当视觉设计师以及程序设计师对网页的原始码进行一次又一次的编辑之后,网页的原始码会越来越杂乱,在这样的情况下,一旦网页所要呈现的画面或程序代码的复杂度提高,网页的原始码会变的越来越长,如此,视觉设计师以及程序设计师将不易寻找需要修改的样式语法或是脚本。However, in the process of web page development, the screen presented on the web page and the functions provided for operation will be constantly adjusted. In addition, the source code of the web page is not edited by the same person, but jointly developed by the visual designer and the programmer. Therefore, when visual designers and programmers edit the source code of the web page again and again, the source code of the web page will become more and more messy. As the complexity increases, the source code of the web page will become longer and longer. In this way, it will be difficult for visual designers and programmers to find style syntax or scripts that need to be modified.
综上所述,可知现有技术中长期以来一直存在不易在网页的原始码中寻找特定的脚本以及样式语法的问题,因此有必要提出改进的技术手段,来解决此一问题。To sum up, it can be seen that there has been a problem in the prior art for a long time that it is difficult to find specific scripts and style grammars in the source code of web pages, so it is necessary to propose improved technical means to solve this problem.
发明内容Contents of the invention
有鉴于现有技术存在不易在网页的原始码中寻找特定的脚本以及样式语法的问题,本发明遂提供一种将独立编辑的脚本及样式整合至网页的系统及其方法,其中:In view of the problem that it is difficult to find specific scripts and style grammars in the source code of webpages in the prior art, the present invention provides a system and method for integrating independently edited scripts and styles into webpages, wherein:
本发明所提供的将独立编辑的脚本及样式整合至网页的系统,其包括有:脚本函式库,用以储存复数个函式;样式语法库,用以储存复数个样式语法;输入模块,用以输入网页,网页至少包含脚本或样式名称;网页分析模块,用以由网页中分析出脚本及样式名称;函式文件建立模块,用以于网页分析模块由网页中分析出脚本后,至脚本函式库中读取执行脚本所需的函式,并将函式写入函式文件中;样式文件建立模块,用以于网页分析模块由网页中分析出样式名称后,至样式语法库中读取对应样式名称的样式语法,并将样式语法写入样式文件中;整合模块,用以于网页中写入加载函式文件的第一网页语法及加载样式文件的第二网页语法;输出模块,用以输出包含第一网页语法或第二网页语法的网页,其透过网页分析模块分析出网页中的脚本与样式名称后,函式文件建立模块会至脚本函式库中读取函式并写入函式文件中,样式文件建立模块会至样式语法库中读取样式语法并写入样式文件中,并由整合模块在网页中写入加载函式文件以及样式文件的网页语法,借以由分离脚本以及样式语法的技术来解决现有技术所存在的问题。The system for integrating independently edited scripts and styles into webpages provided by the present invention includes: a script library for storing multiple functions; a style grammar library for storing multiple style grammars; an input module, It is used to input a webpage, and the webpage at least includes script or style name; the webpage analysis module is used to analyze the script and style name from the webpage; the function file creation module is used to analyze the script from the webpage by the webpage analysis module, to The script function library reads the functions required to execute the script, and writes the functions into the function file; the style file creation module is used to store the style name in the style syntax library after the webpage analysis module analyzes the style name from the webpage Read the style syntax corresponding to the style name, and write the style syntax into the style file; the integration module is used to write the first web page syntax of the loading function file and the second web page syntax of loading the style file in the web page; output The module is used to output the webpage containing the first webpage grammar or the second webpage grammar. After analyzing the script and style name in the webpage through the webpage analysis module, the function file creation module will read the function file from the script library. The style file creation module will read the style grammar from the style grammar library and write it into the style file, and the integration module will write the webpage grammar of loading the function file and the style file in the webpage. Therefore, the problems existing in the prior art are solved by the technology of separating the script and the style syntax.
本发明所提供的将独立编辑的脚本及样式整合至网页的方法,其包括有下列步骤:储存复数个函式及复数个样式语法;输入包含脚本或样式名称的网页;分析网页;当网页包含脚本时,读取执行脚本所需的函式,并于写入函式至函式文件中后,于网页中写入载入函式文件的第一网页语法;当网页包含样式名称时,读取对应样式名称的样式语法,并于写入样式语法至样式文件中后,于网页中写入加载样式文件的第二网页语法;输出包含第一网页语法或第二网页语法的网页,其透过分析出网页中的脚本与样式名称后,读取脚本所呼叫的函式并写入函式文件中,读取网页所使用的样式语法并写入样式文件中,并在网页中写入加载函式文件以及样式文件的网页语法,借以由分离脚本以及样式语法的方式来解决现有技术所存在的问题。The method for integrating independently edited scripts and styles into webpages provided by the present invention includes the following steps: storing multiple functions and multiple style grammars; inputting webpages containing script or style names; analyzing webpages; when the webpage contains When scripting, read the functions required to execute the script, and after writing the functions into the function file, write the syntax of the first web page that loads the function file in the web page; when the web page contains a style name, read Get the style grammar corresponding to the style name, and after writing the style grammar into the style file, write the second webpage grammar of loading the style file in the webpage; output the webpage containing the first webpage grammar or the second webpage grammar, which is transparent After analyzing the script and style names in the web page, read the function called by the script and write it into the function file, read the style grammar used by the web page and write it into the style file, and write the loading function in the web page The web page syntax of the function file and the style file solves the problems existing in the prior art by separating the script and the style syntax.
本发明所提供的系统与方法如上,其与现有技术之间的差异在于本发明会对网页进行分析,在分析出网页所包含的脚本与样式名称后,读取脚本所呼叫的函式并将函式写入函式文件中,以及读取网页所使用的样式语法并将样式语法写入样式文件中,并在网页中写入加载函式文件以及样式文件的网页语法,借以由分离脚本以及样式语法来减低网页的原始码的复杂度。透过上述的技术手段,本发明可以达成增加网页开发效率的技术功效。The system and method provided by the present invention are as above, and the difference between it and the prior art is that the present invention will analyze the webpage, and after analyzing the script and style name contained in the webpage, read the function called by the script and Write the function into the function file, and read the style grammar used by the webpage and write the style grammar into the style file, and write the webpage grammar of loading the function file and the style file in the webpage, so as to separate the script And style syntax to reduce the complexity of the source code of the web page. Through the above-mentioned technical means, the present invention can achieve the technical effect of increasing the efficiency of web page development.
附图说明Description of drawings
图1是本发明所提的将独立编辑的脚本及样式整合至网页的系统架构图。FIG. 1 is a system architecture diagram for integrating independently edited scripts and styles into web pages proposed by the present invention.
图2是本发明所提的将独立编辑的脚本及样式整合至网页的方法流程图。FIG. 2 is a flow chart of a method for integrating independently edited scripts and styles into a webpage proposed by the present invention.
图3是本发明实施例所提的整合前的网页的原始码。FIG. 3 is the source code of the webpage before integration proposed by the embodiment of the present invention.
图4A是本发明实施例所提的函式一览表示意图。FIG. 4A is a schematic diagram of a function list provided by an embodiment of the present invention.
图4B是本发明实施例所提的样式一览表示意图。FIG. 4B is a schematic diagram of a style list provided by an embodiment of the present invention.
图5A是本发明实施例所提的写入函式的函式文件。FIG. 5A is a function file for writing a function according to an embodiment of the present invention.
图5B是本发明实施例所提的写入样式语法的样式文件。FIG. 5B is a style file for writing style syntax proposed by the embodiment of the present invention.
图6是本发明实施例所提的整合后的网页的原始码。FIG. 6 is the source code of the integrated webpage proposed by the embodiment of the present invention.
图7是本发明实施例所提的另一网页整合前的原始码。Fig. 7 is the source code before integration of another webpage proposed by the embodiment of the present invention.
【主要元件符号说明】[Description of main component symbols]
111脚本函式库111 script library
112样式语法库112 style syntax library
120输入模块120 input modules
130网页分析模块130 web page analysis modules
151函式文件建立模块151 function file building module
152样式文件建立模块152 style file build module
160整合模块160 integration modules
170输出模块170 output modules
180网页编辑模块180 web page editing module
191脚本管理模块191 script management module
192样式管理模块192 style management module
300a网页300a page
300b网页300b page
300c网页300c web page
310脚本310 script
320样式名称320 style name
331第一网页语法331 First Web Grammar
332第二网页语法332 Second Web Page Grammar
341第三网页语法341 Third Web Page Grammar
342第四网页语法342 Fourth Web Grammar
410函式一览表List of 410 functions
420样式一览表420 style list
500函式文件500 function files
600样式文件600 style files
具体实施方式Detailed ways
以下将配合附图及实施例来详细说明本发明的详细特征与实施方式,内容足以使任何本领域技术人员轻易地理解本发明解决技术问题所应用的技术手段并据以实施,及理解实现本发明可达成的功效。The detailed features and implementation methods of the present invention will be described in detail below in conjunction with the accompanying drawings and embodiments, the content is enough to make any person skilled in the art easily understand the technical means used to solve the technical problems of the present invention and implement them accordingly, and understand the realization of the present invention The effect that the invention can achieve.
本发明执行于网页开发环境中,提供本发明执行的网页开发环境可以为执行于计算机中的网页编辑软件,使用者可以透过网页编辑软件使用本发明进行网页程序的开发;提供本发明执行的网页开发环境也可以执行于服务器上,使用者透过客户端联机到服务器后,透过服务器所提供的使用者接口上传已编辑完成的网页,由本发明对被上传的网页中的HTML语法、脚本以及样式语法进行整合。The present invention is executed in a webpage development environment, and the webpage development environment provided by the present invention can be webpage editing software executed in a computer, and users can use the webpage editing software to use the present invention to develop webpage programs; providing the implementation of the present invention The webpage development environment can also be executed on the server. After the user connects to the server through the client, he uploads the edited webpage through the user interface provided by the server, and the HTML grammar and script in the uploaded webpage are analyzed by the present invention and style syntax for integration.
以下先以图1本发明所提的将独立编辑的脚本及样式整合至网页的系统架构图来说明本发明的系统运作。如图1所示,本发明的系统含有脚本函式库111、样式语法库112、输入模块120、网页分析模块130、函式文件建立模块151、样式文件建立模块152、整合模块160以及输出模块170。In the following, the system operation of the present invention will be illustrated with the system architecture diagram of integrating independently edited scripts and styles into web pages in FIG. 1 of the present invention. As shown in Figure 1, the system of the present invention contains script library 111,
脚本函式库111负责储存复数个函式,脚本函式库111所储存的函式为程序代码(原始码)的形式,包含函式名称、呼叫(call)所需的参数以及函式主体等。The script function library 111 is responsible for storing a plurality of functions, and the functions stored in the script function library 111 are in the form of program code (source code), including function name, parameters required for calling (call), and function body, etc. .
样式语法库112负责储存复数个样式语法,样式语法库112所储存的样式语法包含样式选择器(selector)以及至少一个样式定义。The
输入模块120负责输入网页300a,被输入模块120输入的网页300a除了包含HTML语法之外,通常也包含一个以上的脚本、一个以上的样式名称或一个以上的脚本与一个以上的样式名称。一般而言,网页300a是由使用者透过输入模块120输入至本系统中,但本发明并不以此为限。The
网页分析模块130负责对被输入模块120输入的网页300a的原始码进行分析(parser),借以分析出网页300a所包含的各个元素(element)以及脚本,并由元素的“class”属性中搜寻出样式名称。The
网页分析模块130更负责在对被输入模块120输入的网页300a进行分析后,由分析后所获得的元素的特定属性或脚本的特定语法中搜寻出外部连结,并依据外部连结追溯(trace)网页300a被浏览时,显示网页300a的浏览器依据网页300a中记录的外部连结所加载的外部文件,并对分析后取得的外部文件进行与网页300a相同的分析,借以获得网页300a被浏览时所执行的脚本以及所使用的样式名称。The web
函式文件建立模块151负责在网页分析模块130由被输入模块120所输入的网页300a中分析出网页300a所包含的脚本时,判断网页300a包含的脚本是否会呼叫脚本函式库111所储存的函式,若是,则函式文件建立模块151会在特定目录中建立空白的函式文件,并在至脚本函式库111中读取执行网页300a包含的脚本所需的函式的程序代码后,将被读出的函式的程序代码写入其所建立的函式文件中,借以将网页300a包含的脚本执行时所需要的函式加入函式文件中。其中,函式文件建立模块151建立函式文件的特定目录通常是网页300a所存放的目录或是专门存放函式文件的目录,如“/script”等,但本发明并不以此为限。The function
一般而言,函式文件建立模块151会为各个网页建立不同的函式文件,但本发明并不以此为限,也就是说,函式文件建立模块151可以对每一个函式建立一个函式文件,也可以依据各个函式的相关性建立不同的函式文件,甚至也可以将同一目录中各个网页的函式都写入同一个函式文件中,但其它方式在技术上并没有不同,同时也没有特别的好处,因此在实做函式文件建立模块151时,还是以为各个网页建立不同的函式文件为主。Generally speaking, the function
样式文件建立模块152负责在网页分析模块130分析出网页300a所包含的样式名称后,判断网页分析模块130分析出的样式名称是否与样式语法库112储存的其中一个样式语法所包含的样式选择器相同,若是,则样式文件建立模块152会先在特定目录中建立一个空白的样式文件,并再至样式语法库112中读取样式选择器与网页300a包含的样式名称相同的样式语法后,将读取出的样式语法(样式选择器以及样式定义)写入其所建立的样式文件中。其中,样式文件建立模块152建立样式文件的特定目录通常是网页300a所存在的目录或是专门存放样式文件的目录,如“/css”等,但本发明并不以此为限。The style
与函式文件建立模块151相似的,样式文件建立模块152可以为各个网页建立不同的样式文件,但本发明并不以此为限,样式文件建立模块152也可能将整个网站中所有网页的样式语法都写在同一个样式文件中。Similar to the function
整合模块160负责在函式文件建立模块151将函式(的程序代码)写入函式文件后,在符合HTML语法的条件下,于网页300a中的任意位置写入加载函式文件的第一网页语法,以及负责在样式文件建立模块152将样式语法写入样式文件后,在符合HTML语法的条件下,于网页300a中写入加载样式文件的第二网页语法,一般而言,第一网页语法会写入网页300a中的“HEAD”元素以及“BODY”元素之间,而第二网页语法会写入“HEAD”元素之中,但本发明所提的第一网页语法以及第二网页语法所写入网页300a的位置并不以此为限。如此,整合模块160在网页300a中写入第一网页语法和/或第二网页语法后所产生的新网页为网页300b。The
输出模块170负责输出由整合模块160写入第一网页语法和/或第二网页语法至网页300a后所产生的网页300b。输出模块170可以将网页300b以储存为文件的方式输出,也可以直接以显示网页300b的方式输出,但本发明并不以此为限。The
另外,本发明更可以包含网页编辑模块180、脚本管理模块191以及样式管理模块192。In addition, the present invention may further include a
网页编辑模块180负责编辑网页300a,输入模块120负责将网页编辑模块180编辑后的网页300a输入至本发明中。一般而言,网页编辑模块180会提供使用者接口,借以提供使用者于本发明中直接对网页300a进行编辑。The
脚本管理模块191负责在网页300a被网页分析模块130分析后,将网页300a中使用者自行撰写的自订函式新增至脚本函式库111中,也就是将网页300a中的自订函式的程序代码写入脚本函式库111,借以扩充脚本函式库111中的函式。此外,脚本管理模块191也负责提供使用者对脚本函式库111所储存的函式进行新增、修改或删除等操作。The
样式管理模块192负责在网页300a被网页分析模块130分析后,将网页300a中使用者自行撰写的自订样式新增至样式语法库112中,也就是在样式语法库112中写入网页300a中的自订样式所包含的样式选择器以及样式定义。此外,样式管理模块192也负责提供使用者对样式语法库112中所储存的样式语法进行新增、修改或删除等操作。The
接着以一个实施例来解说本发明的运作系统与方法,并请参照图2本发明所提的将独立编辑的脚本及样式整合至网页的方法流程图。假设本发明执行于计算机(图中未示)的网页开发软件中,但本发明并不以此为限。Next, an embodiment is used to explain the operating system and method of the present invention, and please refer to FIG. 2 for the flow chart of the method for integrating independently edited scripts and styles into a web page proposed by the present invention. It is assumed that the present invention is implemented in webpage development software of a computer (not shown in the figure), but the present invention is not limited thereto.
在使用者安装执行有本发明的网页开发软件至计算机上后,包含多个函式的脚本函式库111以及包含多个样式语法的样式语法库112也会被储存到计算机上(步骤210)。在本实施例中,假设脚本函式库111中储存了函式名称为“isChecked”、“isNotNull”以及“isNotSelect”等函式,同时假设样式语法库112中储存了样式选择器为“.bg_color”、“.title”以及“P”等的样式语法。After the user installs and executes the web page development software of the present invention on the computer, the script library 111 including multiple functions and the
事实上,脚本函式库111所储存的函式除了在使用者安装后便已建立之外,使用者也可以在使用输入模块120输入网页300a之前,透过脚本管理模块191所提供的使用者接口,在本实施例的网页开发软件中撰写新的函式,脚本管理模块191会将使用者撰写的新函式(的程序代码)储存到脚本函式库111中后,使用者撰写的新函式便可以提供后续开发网页时使用,甚至,使用者也可以透过脚本管理模块191,在本实施例的网页开发软件中修改或删除脚本函式库111所储存的函式(的程序代码)。同样的,样式管理模块192也可以提供使用者新增自订的新的样式语法,以及提供使用者修改或删除储存于样式语法库112中的样式语法。In fact, in addition to the functions stored in the script library 111 being created after the user installs them, the user can also use the
当使用者欲使用本发明时,使用者可以操作网页开发软件开启先前已编辑完成的网页300a,如此,输入模块120由计算机的储存媒体(图中未示)读取网页300a后,便完成网页300a的输入(步骤220)。但输入模块120所输入的网页300a并非一定要预先编辑完成,例如,本发明也可以由网页编辑模块180让使用者先在网页开发软件中编辑网页300a(步骤280),当使用者完成网页300a的编辑后,输入模块120会将网页300a输入(步骤220)。When the user wants to use the present invention, the user can operate the webpage development software to open the previously edited
在输入模块120输入网页300a(步骤220)后,网页分析模块130会对网页300a的原始码进行分析(步骤230),借以取得网页300a中所包含的元素以及脚本,并进一步由元素中搜寻出样式名称。若网页300a如图3所示,则在网页分析模块130分析后,网页分析模块130至少会分析出网页300a包含一段脚本310以及包含于元素“table”的“class”属性的“bg_color”与包含于元素“td”的“class”属性的“title”两个样式名称320。其中,网页300a的脚本310包含呼叫函式名称为“isNotNull”与“isNotSelect”的函式的语法。After the
在网页分析模块130对网页300a进行分析(步骤230)后,函式文件建立模块151会依据网页分析模块130的分析结果,判断网页300a中是否包含脚本(步骤251)。由于网页分析模块130分析出网页300a包含脚本310,则函式文件建立模块151会在专门存放脚本的目录中建立一个空白的函式文件“uw.js”,之后,函式文件建立模块151会至脚本函式库111中读取网页300a中的脚本310会呼叫的函式,并将读出的函式写入函式文件“uw.js”中(步骤252)。After the
函式文件建立模块151可以使用如图4A所示的函式一览表410来记录脚本函式库111中所储存的函式,但本发明并不以此为限,函式文件建立模块151也可以直接至脚本函式库111中搜寻脚本函式库111所储存的函式的函式名称,借以得知脚本函式库111中储存了哪些函式。其中,函式文件建立模块151所使用的函式一览表410在网页开发软件被安装时所建立,此时函式一览表410中的内容为脚本函式库111中所记录的函式的函式名称,之后,会随着脚本管理模块191对脚本函式库111中的函式进行新增与删除时,由脚本管理模块191在函式一览表410中新增与删除被新增或删除的函式的函式名称。The function
由于网页分析模块130分析出网页300a中的脚本310会呼叫函式名称为“isNotNull”与“isNotSelect”的函式,因此,函式文件建立模块151便会至脚本函式库111中读出函式名称为“isNotNull”与“isNotSelect”的函式的程序代码,并将读出的程序代码写入函式文件“uw.js”中,函式文件建立模块151在写入读出的程序代码后的函式文件“uw.js”500如图5A所示。Since the
同样在网页分析模块130对网页300a进行分析(步骤230)后,样式文件建立模块152会依据网页分析模块130的分析结果,判断网页300a中是否包含样式名称(步骤261)。由于网页分析模块130分析出网页300a包含“.bg_color”以及“.title”两个样式名称320,则样式文件建立模块152会在专门存放样式的目录中建立一个空白的样式文件“style_uw_sys.css”,之后,样式文件建立模块152会至样式语法库112中读取样式选择器与网页300a中的样式名称320相同的样式语法,也就是读出样式选择器为“.bg_color”以及“.title”的样式语法,并将读出的样式语法写入样式文件“style_uw_sys.css”600中(步骤262)。样式文件建立模块152在写入样式选择器为“.bg_color”以及“.title”的样式语法后的样式文件“style_uw_sys.css”600如图5B所示。Also after the web
与函式文件建立模块151相似的,样式文件建立模块152可以使用如图4B所示的样式一览表420来记录样式语法库112中所储存的样式语法的样式选择器,也可以直接搜寻样式语法库112中所储存的样式语法的样式选择器,借以得之脚本函式库111所储存的样式语法的样式选择器是否与网页300a中的样式名称相同,但本发明并不以此两种方法为限。其中,样式文件建立模块152所使用的样式一览表420在网页开发软件被安装时所建立,此时样式一览表420中的内容为样式语法库112中所记录的样式语法的样式选择器,之后,会随着样式管理模块192对样式语法库112中的样式语法进行新增与删除时,由样式管理模块192在样式一览表420中新增与删除被新增或删除的样式语法的样式选择器。Similar to the function
事实上,函式文件建立模块151以及样式文件建立模块152执行的顺序并没有先后次序的关系,也就是说,除了函式文件建立模块151先将函式写入函式文件“uw.js”500,再由样式文件建立模块152将样式语法写入样式文件“style_uw_sys.css”600之外,本发明也可以先执行样式文件建立模块152后,再执行函式文件建立模块151。In fact, the execution order of the function
在函式文件建立模块151读出脚本310会呼叫的函式并将读出的函式写入函式文件“uw.js”500中(步骤252)后,整合模块160会如图6所示,将载入函式文件“uw.js”500的第一网页语法331写入网页300a中(步骤256)。同样的,在样式文件建立模块152读出样式选择器与网页300a中的样式名称相同的样式语法并写入样式文件“style_uw_sys.css”600(步骤262)后,整合模块160会将加载样式文件“style_uw_sys.css”600的第二网页语法332写入网页300a中(步骤266)。网页300a的原始码被整合模块160写入第一网页语法331以及第二网页语法332后,成为新的网页300b。After the function
最后,输出模块170会输出包含第一网页语法331以及第二网页语法332的新的网页300b。假设在本实施例中,输出模块170以将网页300b储存为文件的方式输出网页300b,则输出模块170储存至计算机上的文件的内容即为网页300b的原始码,如此,网页300b中的函式与样式语法便会被本发明分别储存到函式文件以及样式文件中,减低网页300b的原始码的复杂度。Finally, the
综上所述,可知本发明与现有技术之间的差异在于分析出网页300a所包含的脚本310与样式名称320后,将脚本310所呼叫的函式写入函式文件500中,并将网页300a所使用的样式名称与所包含的样式选择器相同的样式语法写入样式文件600中,再于网页300a中写入加载函式文件500以及样式文件600的第一网页语法331以及第二网页语法332,由此技术手段可以分离网页300a中的脚本310以及样式语法,使得网页300a的原始码的复杂度降低,借以解决现有技术所存在不易在网页的原始码中寻找特定的程序代码以及样式语法的问题,进而达成增加网页开发效率的功效。In summary, it can be seen that the difference between the present invention and the prior art is that after analyzing the
在上述实施例中,输入模块120所输入的网页300a也可能不包含脚本310,或是脚本310中没有呼叫的函式,则在经过网页分析模块130的分析后,函式文件建立模块151会因为网页300a中没有记录被呼叫的函式的函式名称而不执行,如此整合模块160将不会在网页300a中写入加载函式文件500的第一网页语法331(步骤256)。同样的,若输入模块120所输入的网页300a不包含样式名称320时,样式文件建立模块152不会执行,整合模块160也不会在网页300a中写入加载样式文件600的第二网页语法332(步骤266)。In the above embodiment, the
另外,若输入模块120所输入的网页300c如图7所示,包含载入外部文件的第三网页语法341以及第四网页语法342,则网页分析模块130在对网页300c进行分析(步骤230)后,也会对文件名称为“function.js”以及“style.css”的两个外部文件进行与网页300c相同的分析,借以取得被呼叫的函式以及样式名称。In addition, if the
再者,本发明的将独立编辑的脚本及样式整合至网页的方法,可实现于硬件、软件或硬件与软件的组合中,亦可在计算机系统中以集中方式实现或以不同组件散布于若干互连的计算机系统的分散方式实现。Furthermore, the method for integrating independently edited scripts and styles into webpages of the present invention can be implemented in hardware, software, or a combination of hardware and software, and can also be implemented in a centralized manner in a computer system or distributed in several different components. A decentralized implementation of interconnected computer systems.
虽然本发明所公开的实施方式如上,惟所述的内容并非用以直接限定本发明的专利保护范围。任何本发明所属技术领域中技术人员,在不脱离本发明所公开的精神和范围的内,在实施的形式上及细节上所为的更动或润饰,均属本发明的专利保护范围。因此本发明的专利保护范围仍须以本说明书所附的权利要求所界定者为准。Although the disclosed embodiments of the present invention are as above, the content described is not intended to directly limit the patent protection scope of the present invention. Any changes or modifications made by those skilled in the technical field of the present invention in the form and details of implementation without departing from the spirit and scope disclosed in the present invention belong to the scope of patent protection of the present invention. Therefore, the scope of patent protection of the present invention must still be defined by the appended claims of this specification.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN200910119729A CN101847147A (en) | 2009-03-24 | 2009-03-24 | System and method for integrating independently edited script and style into webpage |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN200910119729A CN101847147A (en) | 2009-03-24 | 2009-03-24 | System and method for integrating independently edited script and style into webpage |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN101847147A true CN101847147A (en) | 2010-09-29 |
Family
ID=42771770
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN200910119729A Pending CN101847147A (en) | 2009-03-24 | 2009-03-24 | System and method for integrating independently edited script and style into webpage |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN101847147A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2011079733A1 (en) * | 2009-12-30 | 2011-07-07 | 深圳市同洲电子股份有限公司 | Method, device and embedded browser for script processing |
| CN105159686A (en) * | 2015-09-28 | 2015-12-16 | 北京奇虎科技有限公司 | Website page development method and apparatus |
-
2009
- 2009-03-24 CN CN200910119729A patent/CN101847147A/en active Pending
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2011079733A1 (en) * | 2009-12-30 | 2011-07-07 | 深圳市同洲电子股份有限公司 | Method, device and embedded browser for script processing |
| CN105159686A (en) * | 2015-09-28 | 2015-12-16 | 北京奇虎科技有限公司 | Website page development method and apparatus |
| CN105159686B (en) * | 2015-09-28 | 2018-09-04 | 北京奇虎科技有限公司 | A kind of Website page development approach and device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8392880B2 (en) | Rapid application development for database-aware applications | |
| JP5363355B2 (en) | Method, system and program for copying and pasting selected display area of screen display using style elements | |
| JP3857663B2 (en) | Structured document editing apparatus, structured document editing method and program | |
| US9524279B2 (en) | Help document animated visualization | |
| US9990343B2 (en) | System and method for in-browser editing | |
| CN108762743A (en) | Data table operation code generation method and device | |
| CN113158651A (en) | Web server system and demonstration application generation method | |
| CN111078217A (en) | Brain graph generation method, apparatus and computer-readable storage medium | |
| CN118210816A (en) | Spark engine-based data blood-edge static analysis method and device, medium and product | |
| CN103226475B (en) | Method and the device of control replacement is realized during transcoding | |
| US20240378028A1 (en) | Automated authoring of software solutions from a data model | |
| JP4686117B2 (en) | Source code conversion apparatus, source code conversion method, and program | |
| CN101847147A (en) | System and method for integrating independently edited script and style into webpage | |
| US7805452B2 (en) | Data processing device and data processing method | |
| CN112417827A (en) | Method and device for editing and displaying online document, electronic equipment and storage medium | |
| CN118656078A (en) | Front-end framework conversion method, device, electronic device, computer-readable storage medium, and computer program product | |
| CN117555587A (en) | Project reconstruction methods, devices, equipment and media based on AngularJS framework | |
| CN117472492A (en) | Method and related device for generating graphical user interface | |
| CN114020358B (en) | Interface rendering method and device based on iOS application | |
| CN115983230A (en) | Word document generation method and device based on JSON data | |
| CN114416088A (en) | Mobile tool page generation method and device, computer equipment and storage medium | |
| CN113986322B (en) | Method, device and storage medium for dynamically modifying page codes | |
| CN114691131B (en) | Method and device for generating framework code file for user interface UI file | |
| KR102588597B1 (en) | Method for designing a program using operation logic designer as an alternative editor for uml sequence diagram and apparatus using the same | |
| Le | A react responsive web application managing offers and configurations of projects |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
| WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20100929 |