cejs
Version:
A JavaScript module framework that is simple to use.
1,891 lines (1,241 loc) • 116 kB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="JsDoc Toolkit" />
<title>JsDoc Reference - _global_</title>
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<!-- ============================== header ================================= -->
<!-- begin static/header.html -->
<div id="header">
</div>
<!-- end static/header.html -->
<!-- ============================== classes index ============================ -->
<div id="index">
<!-- begin publish.classesIndex -->
<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
<li><a href="../symbols/CeL.html">CeL</a></li>
<li><a href="../symbols/CeL.application.debug.html">CeL.application.debug</a></li>
<li><a href="../symbols/CeL.application.debug.log.html">CeL.application.debug.log</a></li>
<li><a href="../symbols/CeL.application.locale.html">CeL.application.locale</a></li>
<li><a href="../symbols/CeL.application.net.html">CeL.application.net</a></li>
<li><a href="../symbols/CeL.application.net.Ajax.html">CeL.application.net.Ajax</a></li>
<li><a href="../symbols/CeL.application.OS.Windows.html">CeL.application.OS.Windows</a></li>
<li><a href="../symbols/CeL.application.OS.Windows.file.html">CeL.application.OS.Windows.file</a></li>
<li><a href="../symbols/CeL.application.OS.Windows.HTA.html">CeL.application.OS.Windows.HTA</a></li>
<li><a href="../symbols/CeL.application.OS.Windows.job.html">CeL.application.OS.Windows.job</a></li>
<li><a href="../symbols/CeL.application.OS.Windows.registry.html">CeL.application.OS.Windows.registry</a></li>
<li><a href="../symbols/CeL.application.OS.Windows.WMI.html">CeL.application.OS.Windows.WMI</a></li>
<li><a href="../symbols/CeL.application.storage.file.html">CeL.application.storage.file</a></li>
<li><a href="../symbols/CeL.data.html">CeL.data</a></li>
<li><a href="../symbols/CeL.data.check.html">CeL.data.check</a></li>
<li><a href="../symbols/CeL.data.code.API.html">CeL.data.code.API</a></li>
<li><a href="../symbols/CeL.data.code.compatibility.html">CeL.data.code.compatibility</a></li>
<li><a href="../symbols/CeL.data.code.reorganize.html">CeL.data.code.reorganize</a></li>
<li><a href="../symbols/CeL.data.CSV.html">CeL.data.CSV</a></li>
<li><a href="../symbols/CeL.data.math.html">CeL.data.math</a></li>
<li><a href="../symbols/CeL.data.math.Hamming.html">CeL.data.math.Hamming</a></li>
<li><a href="../symbols/CeL.data.math.polynomial.html">CeL.data.math.polynomial</a></li>
<li><a href="../symbols/CeL.data.math.quotient.html">CeL.data.math.quotient</a></li>
<li><a href="../symbols/CeL.data.native.html">CeL.data.native</a></li>
<li><a href="../symbols/CeL.data.XML.html">CeL.data.XML</a></li>
<li><a href="../symbols/CeL.env.html">CeL.env</a></li>
<li><a href="../symbols/CeL.interact.DOM.html">CeL.interact.DOM</a></li>
<li><a href="../symbols/CeL.interact.form.address.html">CeL.interact.form.address</a></li>
<li><a href="../symbols/CeL.interact.form.select_input.html">CeL.interact.form.select_input</a></li>
<li><a href="../symbols/CeL.interact.integrate.map.html">CeL.interact.integrate.map</a></li>
<li><a href="../symbols/CeL.interact.integrate.SVG.html">CeL.interact.integrate.SVG</a></li>
</ul>
<hr />
<!-- end publish.classesIndex -->
</div>
<div id="content">
<!-- ============================== class title ============================ -->
<h1 class="classTitle">
Built-In Namespace _global_
</h1>
<!-- ============================== class summary ========================== -->
<p class="description">
</p>
<!-- ============================== constructor summary ==================== -->
<!-- ============================== properties summary ===================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class _global_.">
<caption>Field Summary</caption>
<thead>
<tr>
<th scope="col">Field Attributes</th>
<th scope="col">Field Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/_global_.html#cache_code">cache_code</a></b>
</div>
<div class="description">是否 cache code。
若不是要重構 code 則不需要。
undefined: 依照預設
Boolean: 明確設定,但如此即無法繼承。</div>
</td>
</tr>
<tr>
<td class="attributes"><constant> </td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/_global_.html#Class">Class</a></b>
</div>
<div class="description">JavaScript library framework main class name.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/_global_.html#get_file">get_file</a></b>
</div>
<div class="description">Get file resource by XMLHttpRequest<br/>
依序載入 resource,用於 include JavaScript 檔之類需求時,取得檔案內容之輕量級函數。<br/>
除 Ajax,本函數亦可用在 CScript 執行中。</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/_global_.html#global_eval">global_eval</a></b>
</div>
<div class="description">evaluate @ Global scope.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/_global_.html#i">i</a></b>
</div>
<div class="description">真正執行 module code.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/_global_.html#is_Object">is_Object</a></b>
</div>
<div class="description">Test if the value is a native Object.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/_global_.html#prototype">prototype</a></b>
</div>
<div class="description">framework main prototype definition
for JSDT: 有 prototype 才會將之當作 Class</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/_global_.html#variable_hash">variable_hash</a></b>
</div>
<div class="description">要 extend 到 name_space 下的 variables。
variable_hash[variable name] = variable full name, 包括所在 module name.</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== methods summary ======================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class _global_.">
<caption>Method Summary</caption>
<thead>
<tr>
<th scope="col">Method Attributes</th>
<th scope="col">Method Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b>_</b>()
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#_get_hash_key">_get_hash_key</a></b>(text)
</div>
<div class="description">Get the hash key of text.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b>a</b>(htm, t, js, ico)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#add_item">add_item</a></b>(item)
</div>
<div class="description">增加項目至當前的 synchronous_group.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#add_Microsoft_translate">add_Microsoft_translate</a></b>(text, callback, from_enc, to_enc)
</div>
<div class="description">為 Microsoft Translator 設置</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#afterwards_add">afterwards_add</a></b>(item, item_is_path)
</div>
<div class="description">臨時/後續新增項目至當前的 synchronous_group.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#autodetectStringEncode">autodetectStringEncode</a></b>(str)
</div>
<div class="description">靠常用字自動判別字串之編碼 string,預設編碼</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#Big5_kana_fix">Big5_kana_fix</a></b>(text)
</div>
<div class="description">將 BIG5 日文假名碼修改為 Unicode 日文假名。</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b>c</b>(r)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#complement">complement</a></b>(number)
</div>
<div class="description">補數計算。
正數的補數即為自身。若要求得互補之後的數字,請設成負數。</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#continued_fraction">continued_fraction</a></b>(sequence, max_no)
</div>
<div class="description">取得連分數序列的數值</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#eval_code">eval_code</a></b>(code)
</div>
<div class="description">本 library 專用之 evaluate()。
若在 function 中 eval 以獲得 local variable,在舊 browser 中須加 var。
e.g.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#extend">extend</a></b>(variable_set, name_space, from_name_space)
</div>
<div class="description">延展物件 (learned from jQuery):
將 from_name_space 下的 variable_set 延展/覆蓋到 name_space。</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#factorization">factorization</a></b>(number)
</div>
<div class="description">取得某數的質因數,因式分解/素因子分解, factorization, get floor factor.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#find_class">find_class</a></b>(class_name, element, parent_node, tag_name, flag)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#floor_sqrt">floor_sqrt</a></b>(positive)
</div>
<div class="description">得到平方數,相當於 Math.floor(Math.sqrt(number)).</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#gcd">gcd</a></b>(n1, n2)
</div>
<div class="description">Get GCD of 2 numbers</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#get_code_from_generated_various">get_code_from_generated_various</a></b>(ns, prefix, code_array)
</div>
<div class="description">把 get_various_from_code 生成的 namespace 轉成 code</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#get_function_name">get_function_name</a></b>(fr, ns, force_load)
</div>
<div class="description">獲得函數名</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#get_module">get_module</a></b>(module_name)
</div>
<div class="description">不使用 eval 的方法,get the module namespace of specific module name.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#get_module_path">get_module_path</a></b>(module_name, file_name)
</div>
<div class="description">get the path of specified module.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#get_script_base_path">get_script_base_path</a></b>(JSFN)
</div>
<div class="description">得知 script file 之相對 base path</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#get_script_full_name">get_script_full_name</a></b>()
</div>
<div class="description">取得執行 script 之 path, 在 .hta 中取代 WScript.ScriptFullName。</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#get_script_name">get_script_name</a></b>()
</div>
<div class="description">取得執行 script 之名稱</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#get_variable">get_variable</a></b>(variable_name, name_space)
</div>
<div class="description">simple evaluates to get value of specified variable identifier name.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#get_various_from_code">get_various_from_code</a></b>(code, fill_code)
</div>
<div class="description">get various from code</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#get_window_status">get_window_status</a></b>(node)
</div>
<div class="description">取得當前 window status</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#has_class">has_class</a></b>(element, class_name)
</div>
<div class="description">If HTML element has specified class</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#hex">hex</a></b>(number)
</div>
<div class="description">VBScript has a Hex() function but JScript does not.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#include_module_resource">include_module_resource</a></b>(file_name, module_name)
</div>
<div class="description">include resource of module.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#include_resource">include_resource</a></b>(resource, callback, use_write, type, type, use_write)
</div>
<div class="description">Including other JavaScript/CSS files synchronously.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#inherit">inherit</a></b>(parent_module_name, initial_arguments)
</div>
<div class="description">module 中模擬 inherit 時使用。
TODO:
同步載入功能</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b>initI</b>(a)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#initial_env">initial_env</a></b>(OS_type, reset)
</div>
<div class="description">Setup environment variables</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#is_Array">is_Array</a></b>(v)
</div>
<div class="description">Test if the value is a native Array.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#is_debug">is_debug</a></b>(debug_level)
</div>
<div class="description">Tell if it's now debugging.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#is_Function">is_Function</a></b>(v)
</div>
<div class="description">Test if the value is a native Function.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#is_loaded">is_loaded</a></b>(module_name, module_name)
</div>
<div class="description">判斷 module 是否存在,
TODO
以及是否破損。</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#is_module_pattern">is_module_pattern</a></b>(test_string)
</div>
<div class="description">test 是否符合 module pattern.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#is_type">is_type</a></b>(value, want_type, get_Class)
</div>
<div class="description">判斷為何種 type。主要用在 Error, DOMException 等 native object 之判別。</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#library_loader_by_registry">library_loader_by_registry</a></b>()
</div>
<div class="description">for 引用: include library 自 registry 中的 path</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#mutual_division">mutual_division</a></b>(n1, n2, times)
</div>
<div class="description">輾轉相除 n1/n2 或 小數 n1/1 轉成 整數/整數</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#name">name</a></b>()
</div>
<div class="description">translate {String} code_for_including to function</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#new_node">new_node</a></b>(nodes, layer)
</div>
<div class="description">創建新的 DOM 節點(node)。
createNode() 的功能補充加強版。
TODO: 分割功能(set_attrib, add_child, .</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#object_tester">object_tester</a></b>(want_type, toString_reference)
</div>
<div class="description">get a type test function</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#open_template">open_template</a></b>(FN, format, io_mode)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#parse_require">parse_require</a></b>(dependency_list, separator, base_require)
</div>
<div class="description">解析 dependency list 以獲得所需之 module/path/variable name.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b>pv</b>(i, d, k)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#replace_function">replace_function</a></b>(name_space, function_name, new_function)
</div>
<div class="description">workaround.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#request_item_maybe_module">request_item_maybe_module</a></b>(resource_string)
</div>
<div class="description">test function.request 的項目是否為 module.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#require_netscape_privilege">require_netscape_privilege</a></b>(privilege, callback|[callback,arguments])
</div>
<div class="description">Ask privilege in mozilla projects: Firefox 2, 3.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#set_debug">set_debug</a></b>(debug_level)
</div>
<div class="description">Set debugging level</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#set_run">set_run</a></b>(running)
</div>
<div class="description">control/setup source codes to run.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#setup_module">setup_module</a></b>(module_name, code_for_including, parent_module_name)
</div>
<div class="description">載入 module。
<p>
本函數會預先準備好下層 module 定義時的環境,但請盡量先 call 上層 name-space
再定義下層的,否則可能會出現問題,如 memory leak 等。
</p></div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#simplify_path">simplify_path</a></b>(path)
</div>
<div class="description">轉化所有 /.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#split_module_name">split_module_name</a></b>(module_name)
</div>
<div class="description">將輸入的 string 分割成各 module 單元。<br/>
need environment_adapter()<br/>
** 並沒有對 module 做完善的審核!</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#to_module_name">to_module_name</a></b>(module, separator)
</div>
<div class="description">取得 module 之 name。以 library name 起始。</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#to_rational_number">to_rational_number</a></b>(number, rate, max_no)
</div>
<div class="description">The best rational approximation.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#to_RegExp_pattern">to_RegExp_pattern</a></b>(pattern, RegExp_flag, escape_pattern)
</div>
<div class="description">String pattern (e.g.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#use">use</a></b>(module, callback, extend_to, force)
</div>
<div class="description">Include specified module.</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#use_API">use_API</a></b>(API, callback)
</div>
<div class="description">自動挑選 domain</div>
</td>
</tr>
<tr>
<td class="attributes"> </td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#use_function">use_function</a></b>(name_space, dependency_list, extend_to, no_strict)
</div>
<div class="description">module 中需要 include function/module/variable 時設定 local variables 使用。<br/>
本函數將把所需 function include 至當前 namespace 下。
TODO: 輸入 function name 即可</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== events summary ======================== -->
<!-- ============================== constructor details ==================== -->
<!-- ============================== field details ========================== -->
<div class="sectionTitle">
Field Detail
</div>
<a name="cache_code"> </a>
<div class="fixedFont">
<span class="light">{Boolean, undefined}</span>
<b>cache_code</b>
</div>
<div class="description">
是否 cache code。
若不是要重構 code 則不需要。
undefined: 依照預設
Boolean: 明確設定,但如此即無法繼承。
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_ce.origin.js.html">ce.origin.js</a>.
</div>
<hr />
<a name="Class"> </a>
<div class="fixedFont"><constant>
<b>Class</b>
</div>
<div class="description">
JavaScript library framework main class name.
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_ce.origin.js.html">ce.origin.js</a>.
</div>
<dl class="detailList">
<dt class="heading">See:</dt>
<dd><a href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf">ECMA-262</a>: Object.Class: A string value indicating the kind of this object.</dd>
</dl>
<hr />
<a name="get_file"> </a>
<div class="fixedFont">
<span class="light">{String, undefined}</span>
<b>get_file</b>
</div>
<div class="description">
Get file resource by XMLHttpRequest<br/>
依序載入 resource,用於 include JavaScript 檔之類需求時,取得檔案內容之輕量級函數。<br/>
除 Ajax,本函數亦可用在 CScript 執行中。
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_ce.origin.js.html">ce.origin.js</a>.
</div>
<pre class="code">// get contents of [path/to/file]:
var file_contents = CeL.get_file('path/to/file');</pre>
<dl class="detailList">
<dt class="heading">See:</dt>
<dd><a href=http://blog.joycode.com/saucer/archive/2006/10/03/84572.aspx">Cross Site AJAX</a>,
<a href="http://domscripting.com/blog/display/91">Cross-domain Ajax</a>,
<a href="http://forums.mozillazine.org/viewtopic.php?f=25&t=737645" accessdate="2010/1/1 19:37">FF3 issue with iFrames and XSLT standards</a>,
<a href="http://kb.mozillazine.org/Security.fileuri.strict_origin_policy" accessdate="2010/1/1 19:38">Security.fileuri.strict origin policy - MozillaZine Knowledge Base</a>
Chrome: <a href="http://code.google.com/p/chromium/issues/detail?id=37586" title="between builds 39339 (good) and 39344 (bad)">NETWORK_ERR: XMLHttpRequest Exception 101</a></dd>
</dl>
<hr />
<a name="global_eval"> </a>
<div class="fixedFont">
<b>global_eval</b>
</div>
<div class="description">
evaluate @ Global scope.
By the ECMA-262, new Function() will 'Pass in the Global Environment as the Scope parameter.'
copy from jQuery core.js
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_ce.origin.js.html">ce.origin.js</a>.
</div>
<dl class="detailList">
<dt class="heading">See:</dt>
<dd><a href="http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context" accessdate="2011/8/6 8:56">Eval JavaScript in a global context | Java.net</a>
use execScript on Internet Explorer</dd>
</dl>
<hr />
<a name="i"> </a>
<div class="fixedFont">
<b>i</b>
</div>
<div class="description">
真正執行 module code.
<code>
_.debug('including code of [' + _.to_module_name(module_name) + ']..'),
</code>
TODO: code_for_including(_, load_arguments)
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_ce.origin.js.html">ce.origin.js</a>.
</div>
<hr />
<a name="is_Object"> </a>
<div class="fixedFont">
<span class="light">{Boolean}</span>
<b>is_Object</b>
</div>
<div class="description">
Test if the value is a native Object.
TODO:
test null
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_ce.origin.js.html">ce.origin.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Since:</dt>
<dd>2009/12/20 08:38:26</dd>
</dl>
<hr />
<a name="prototype"> </a>
<div class="fixedFont">
<b>prototype</b>
</div>
<div class="description">
framework main prototype definition
for JSDT: 有 prototype 才會將之當作 Class
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_ce.origin.js.html">ce.origin.js</a>.
</div>
<hr />
<a name="variable_hash"> </a>
<div class="fixedFont">
<b>variable_hash</b>
</div>
<div class="description">
要 extend 到 name_space 下的 variables。
variable_hash[variable name] = variable full name, 包括所在 module name.
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_ce.origin.js.html">ce.origin.js</a>.
</div>
<!-- ============================== method details ========================= -->
<div class="sectionTitle">
Method Detail
</div>
<a name="_"> </a>
<div class="fixedFont">
<b>_</b>()
</div>
<div class="description">
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_plugin_old.class template.origin.js.html">old.class template.origin.js</a>.
</div>
<hr />
<a name="_get_hash_key"> </a>
<div class="fixedFont">
<span class="light">{String}</span>
<b>_get_hash_key</b>(text)
</div>
<div class="description">
Get the hash key of text.
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_ce.origin.js.html">ce.origin.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{String}</span> <b>text</b>
</dt>
<dd>text to test</dd>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{String}</span> hash key</dd>
</dl>
<hr />
<a name="a"> </a>
<div class="fixedFont">
<b>a</b>(htm, t, js, ico)
</div>
<div class="description">
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_interact_integrate_map.origin.js.html">map.origin.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>htm</b>
</dt>
<dd></dd>
<dt>
<b>t</b>
</dt>
<dd></dd>
<dt>
<b>js</b>
</dt>
<dd></dd>
<dt>
<b>ico</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="add_item"> </a>
<div class="fixedFont">
<b>add_item</b>(item)
</div>
<div class="description">
增加項目至當前的 synchronous_group.
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_ce.origin.js.html">ce.origin.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>item</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="add_Microsoft_translate"> </a>
<div class="fixedFont">
<b>add_Microsoft_translate</b>(text, callback, from_enc, to_enc)
</div>
<div class="description">
為 Microsoft Translator 設置
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_data_code_API.origin.js.html">API.origin.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>text</b>
</dt>
<dd>test to translate</dd>
<dt>
<b>callback</b>
</dt>
<dd>callback(from text,to text)</dd>
<dt>
<b>from_enc</b>
<i>Optional</i>
</dt>
<dd></dd>
<dt>
<b>to_enc</b>
<i>Optional</i>
</dt>
<dd></dd>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd></dd>
</dl>
<dl class="detailList">
<dt class="heading">See:</dt>
<dd><a href="http://msdn.microsoft.com/en-us/library/ff512406.aspx" accessdate="2010/7/12 20:22">Translate Method</a>,
<a href="http://www.west-wind.com/Weblog/posts/107136.aspx" accessdate="2010/7/12 20:22">JSONP for cross-site Callbacks - Rick Strahl's Web Log</a></dd>
</dl>
<hr />
<a name="afterwards_add"> </a>
<div class="fixedFont">
<b>afterwards_add</b>(item, item_is_path)
</div>
<div class="description">
臨時/後續新增項目至當前的 synchronous_group.
callback 用.
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_ce.origin.js.html">ce.origin.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>item</b>
</dt>
<dd></dd>
<dt>
<b>item_is_path</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="autodetectStringEncode"> </a>
<div class="fixedFont">
<b>autodetectStringEncode</b>(str)
</div>
<div class="description">
靠常用字自動判別字串之編碼 string,預設編碼
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_application_OS_Windows_file.origin.js.html">file.origin.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>str</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="Big5_kana_fix"> </a>
<div class="fixedFont">
<b>Big5_kana_fix</b>(text)
</div>
<div class="description">
將 BIG5 日文假名碼修改為 Unicode 日文假名。
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_interact_DOM.origin.js.html">DOM.origin.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{String}</span> <b>text</b>
</dt>
<dd>Unicode text</dd>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd></dd>
</dl>
<dl class="detailList">
<dt class="heading">See:</dt>
<dd>from Unicode 補完計畫 jrename.js</dd>
</dl>
<hr />
<a name="c"> </a>
<div class="fixedFont">
<b>c</b>(r)
</div>
<div class="description">
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_interact_integrate_map.origin.js.html">map.origin.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>r</b>
</dt>
<dd></dd>
</dl>
<hr />
<a name="complement"> </a>
<div class="fixedFont">
<span class="light">{Number}</span>
<b>complement</b>(number)
</div>
<div class="description">
補數計算。
正數的補數即為自身。若要求得互補之後的數字,請設成負數。
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_data_math.origin.js.html">math.origin.js</a>.
</div>
<pre class="code">alert(complement())</pre>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{Number}</span> <b>number</b>
</dt>
<dd></dd>
</dl>
<dl class="detailList">
<dt class="heading">Since:</dt>
<dd>2010/3/12 23:47:52</dd>
</dl>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{Number}</span> base 1: 1's Complement, 2: 2's Complement, (TODO: 3, 4, ..)</dd>
</dl>
<dl class="detailList">
<dt class="heading">See:</dt>
<dd>http://www.tomzap.com/notes/DigitalSystemsEngEE316/1sAnd2sComplement.pdf
http://en.wikipedia.org/wiki/Method_of_complements
http://en.wikipedia.org/wiki/Signed_number_representations</dd>
</dl>
<hr />
<a name="continued_fraction"> </a>
<div class="fixedFont">
<b>continued_fraction</b>(sequence, max_no)
</div>
<div class="description">
取得連分數序列的數值
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_data_math.origin.js.html">math.origin.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{Array}</span> <b>sequence</b>
</dt>
<dd>序列</dd>
<dt>
<span class="light fixedFont">{Number}</span> <b>max_no</b>
<i>Optional</i>
</dt>
<dd>取至第 max_no 個</dd>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd></dd>
</dl>
<dl class="detailList">
<dt class="heading">Requires:</dt>
<dd>mutual_division.done</dd>
</dl>
<dl class="detailList">
<dt class="heading">See:</dt>
<dd>var a=continued_fraction([1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]);
alert(a+'\n'+a[0]/a[1]+'\n'+Math.SQRT2+'\n'+(Math.SQRT2-a[0]/a[1])+'\n'+mutual_division(a[0],a[1]));</dd>
</dl>
<hr />
<a name="eval_code"> </a>
<div class="fixedFont">
<b>eval_code</b>(code)
</div>
<div class="description">
本 library 專用之 evaluate()。
若在 function 中 eval 以獲得 local variable,在舊 browser 中須加 var。
e.g., 'var local_variable=' + ..
不加 var 在舊 browser 中會變成 global 變數。
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_ce.origin.js.html">ce.origin.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>code</b>
</dt>
<dd>script code to evaluate</dd>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd>value that evaluate process returned</dd>
</dl>
<dl class="detailList">
<dt class="heading">See:</dt>
<dd>window.eval === window.parent.eval
http://stackoverflow.com/questions/3277182/how-to-get-the-global-object-in-javascript</dd>
</dl>
<hr />
<a name="extend"> </a>
<div class="fixedFont">
<b>extend</b>(variable_set, name_space, from_name_space)
</div>
<div class="description">
延展物件 (learned from jQuery):
將 from_name_space 下的 variable_set 延展/覆蓋到 name_space。
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_ce.origin.js.html">ce.origin.js</a>.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>variable_set</b>
</dt>
<dd>variable set</dd>
<dt>
<span class="light fixedFont">{Object|Function}</span> <b>name_space</b>
</dt>
<dd>extend to what name-space</dd>
<dt>
<span class="light fixedFont">{Object|Function}</span> <b>from_name_space</b>
</dt>
<dd>When inputing function names, we need a base name-space to search these functions.</dd>
</dl>
<dl class="detailList">
<dt class="heading">Since:</dt>
<dd>2009/11/25 21:17:44</dd>
</dl>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd>library names-pace</dd>
</dl>
<dl class="detailList">
<dt class="heading">See:</dt>
<dd><a href="http://blog.darkthread.net/blogs/darkthreadtw/archive/2009/03/01/jquery-extend.aspx" accessdate="2009/11/17 1:24" title="jQuery.extend的用法 - 黑暗執行緒">jQuery.extend的用法</a>,
<a href="http://www.cnblogs.com/rubylouvre/archive/2009/11/21/1607072.html" accessdate="2010/1/1 1:40">jQuery源码学习笔记三 - Ruby's Louvre - 博客园</a></dd>
</dl>
<hr />
<a name="factorization"> </a>
<div class="fixedFont">
<span class="light">{Array}</span>
<b>factorization</b>(number)
</div>
<div class="description">
取得某數的質因數,因式分解/素因子分解, factorization, get floor factor.
唯一分解定理(The Unique Factorization Theorem)告訴我們素因子分解是唯一的,這即是稱為算術基本定理 (The Fundamental Theorem of Arithmeric) 的數學金科玉律。
<br />
<i>Defined in: </i> <a href="../symbols/src/D__USB_cgi-bin_lib_JS_data