Skip to content

Commit

Permalink
Another round of English text improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeDBR committed May 2, 2015
1 parent aafa18f commit 5427e35
Show file tree
Hide file tree
Showing 58 changed files with 185 additions and 184 deletions.
2 changes: 1 addition & 1 deletion api/en/setting.async.dataType.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
<div class="desc">
<p></p>
<div class="longdesc">
<p>The data type of Ajax. It is valid when <span class="highlight_red">[setting.async.enable = true]</span></p>
<p>The data type of Ajax requests. It is valid when <span class="highlight_red">[setting.async.enable = true]</span></p>
<p>Default:"text"</p>
</div>
</div>
Expand Down
18 changes: 9 additions & 9 deletions api/en/setting.async.otherParam.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,36 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
<div class="desc">
<p></p>
<div class="longdesc">
<p>The static parameters of the Ajax request. (key - value) It is valid when <span class="highlight_red">[setting.async.enable = true]</span></p>
<p>The query parameters of the Ajax request. (key - value) It is valid when <span class="highlight_red">[setting.async.enable = true]</span></p>
<p>Default: [ ]</p>
</div>
</div>
<h3>Array(String) Format</h3>
<div class="desc">
<p>Can be empty array. e.g. [ ]. If set key, you must set value, e.g. [key, value]. ([key] or [key, value, key] is wrong!!)</p>
<p>Can be an empty array. e.g. [ ]. The array should contain key value pairs, e.g. [key, value]. (Either or [key] or [key, value, key] is wrong!!)</p>
</div>
<h3>JSON Format</h3>
<div class="desc">
<p>Use JSON data format set the key-value. e.g. { key1:value1, key2:value2 }</p>
<p>Use JSON hash data to set the key-value pairs. e.g. { key1:value1, key2:value2 }</p>
</div>
<h3>Examples of setting</h3>
<h4>1. Use Array(String) Format</h4>
<h4>1. Using Array(String) Format</h4>
<pre xmlns=""><code>var setting = {
async: {
enable: true,
url: "http://host/getNode.php",
otherParam: ["id", "1", "name", "test"]
<font color="red">otherParam: ["id", "1", "name", "test"]</font>
}
};
when zTree send ajax, the parameters will has: id=1&name=test</code></pre>
<h4>2. Use JSON data Format</h4>
when zTree sends the ajax request, the query string will be like this: id=1&name=test</code></pre>
<h4>2. Using JSON data Format</h4>
<pre xmlns=""><code>var setting = {
async: {
enable: true,
url: "http://host/getNode.php",
otherParam: { "id":"1", "name":"test"}
<font color="red">otherParam: { "id":"1", "name":"test"}</font>
}
};
when zTree send ajax, the parameters will has: id=1&name=test</code></pre>
when zTree sends the ajax request, the query string will be like this: id=1&name=test</code></pre>
</div>
</div>
6 changes: 3 additions & 3 deletions api/en/setting.async.type.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
<div class="desc">
<p></p>
<div class="longdesc">
<p>Http request mode in ajax. It is valid when <span class="highlight_red">[setting.async.enable = true]</span></p>
<p>Defalut: "post"</p>
<p>Http request tyoe in ajax. It is valid when <span class="highlight_red">[setting.async.enable = true]</span></p>
<p>Default: "post"</p>
</div>
</div>
<h3>String Format</h3>
<div class="desc">
<p> "post" - http request mode</p>
<p> "get" - http request mode</p>
<p class="highlight_red">The 'type' in zTree and jQuery's ajax is same.</p>
<p class="highlight_red">Both zTree and jQuery's this 'type' for ajax requests.</p>
</div>
<h3>Examples of setting</h3>
<h4>1. Set http request mode is 'get'</h4>
Expand Down
6 changes: 3 additions & 3 deletions api/en/setting.async.url.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
</div>
<h3>String Format</h3>
<div class="desc">
<p>A url string(e.g. "http://www.domain.com"). Note: please ensure that the url can be loaded</p>
<p class="highlight_red">Url can also take parameters, please note that transcode.</p>
<p>A url string(e.g. "http://www.domain.com/cgi-bin/my-script.cgi"). Note: please check that the url can be loaded with a browser</p>
<p class="highlight_red">Url can also take parameters, please note that they need to be urlencoded.</p>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>Parent node's JSON data object</p>
<p class="highlight_red">When asynchronously loading the root, the treeNode = null</p>
Expand Down
15 changes: 8 additions & 7 deletions api/en/setting.callback.beforeAsync.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,30 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event before zTree execute ajax, zTree based on return value to determine whether to execute ajax.</p>
<p>This callback is made before zTree makes an ajax request, giving you an opportunity to decide if it should proceed or not.
Return false to prevent zTree from sending the ajax request.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the parent node</p>
<p class="highlight_red">When asynchronously loading the root, the treeNode = null</p>
<p class="highlight_red">When asynchronously loading the root, treeNode = null</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
<p>return true or false</p>
<p class="highlight_red">If return false, zTree will not execute ajax, and will not trigger the 'onAsyncSuccess / onAsyncError' callback.</p>
<p class="highlight_red">If the function returns false, zTree will not send the ajax request, and will not trigger the 'onAsyncSuccess / onAsyncError' callback.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. If the parent node's attribute 'id' is 1, zTree will not execute ajax.</h4>
<pre xmlns=""><code>function zTreeBeforeAsync(treeId, treeNode) {
<h4>1. If the parent node's attribute 'id' is 1, don't send the ajax request.</h4>
<pre xmlns=""><code>function myBeforeCallBack(treeId, treeNode) {
return (treeNode.id !== 1);
};
var setting = {
callback: {
beforeAsync: zTreeBeforeAsync
beforeAsync: myBeforeCallBack
}
};
......</code></pre>
Expand Down
12 changes: 6 additions & 6 deletions api/en/setting.callback.beforeCheck.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event before check or uncheck node, zTree based on return value to determine whether to change check state.</p>
<p>Callback before checking or unchecking a node, A false return value from the callback will prevent any change in the checked state.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which is checked or unchecked</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
<p>return true or false</p>
<p class="highlight_red">If return false, zTree will not change check state, and will not trigger the 'onCheck' callback.</p>
<p class="highlight_red">If return false, zTree will not change the checkbox state, and will not trigger the 'onCheck' callback.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. disable to change check state of all nodes, and keep the check state initialization</h4>
<pre xmlns=""><code>function zTreeBeforeCheck(treeId, treeNode) {
<h4>1. This example returns false, preventing all checkboxes in the tree from toggling.</h4>
<pre xmlns=""><code>function myBeforeCheckCallBack(treeId, treeNode) {
return false;
};
var setting = {
callback: {
beforeCheck: zTreeBeforeCheck
beforeCheck: myBeforeCheckCallBack
}
};
......</code></pre>
Expand Down
8 changes: 4 additions & 4 deletions api/en/setting.callback.beforeClick.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event before click node, zTree based on return value to determine whether to trigger the 'onClick' callback.</p>
<p>Before click callback, return false to prevent the 'onClick' callback.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which is clicked</p>
<h4 class="topLine"><b>clickFlag</b><span>Number</span></h4>
Expand All @@ -36,12 +36,12 @@ <h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
</div>
<h3>Examples of setting & function</h3>
<h4>1. disabled to click the node</h4>
<pre xmlns=""><code>function zTreeBeforeClick(treeId, treeNode, clickFlag) {
<pre xmlns=""><code>function myBeforeClick(treeId, treeNode, clickFlag) {
return (treeNode.id !== 1);
};
var setting = {
callback: {
beforeClick: zTreeBeforeClick
beforeClick: myBeforeClick
}
};
......</code></pre>
Expand Down
10 changes: 5 additions & 5 deletions api/en/setting.callback.beforeCollapse.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event before collapse node, zTree based on return value to determine whether to collapse node.</p>
<p>Specify callback function to be called before collapse node, The return value controls the collapse node.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which will be collapsed</p>
<p>JSON data object of the node to be collapsed</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
<p>return true or false</p>
<p class="highlight_red">If return false, zTree will not collapse node, and will not trigger the 'onCollapse' callback.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. disabled to collapse node which is expanded</h4>
<pre xmlns=""><code>function zTreeBeforeCollapse(treeId, treeNode) {
<pre xmlns=""><code>function myBeforeCollapse(treeId, treeNode) {
return false;
};
var setting = {
callback: {
beforeCollapse: zTreeBeforeCollapse
beforeCollapsefunction myBeforeCollapse
}
};
......</code></pre>
Expand Down
10 changes: 5 additions & 5 deletions api/en/setting.callback.beforeDblClick.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the dblclick event before the 'onDblClick' callback, zTree based on return value to determine whether to trigger the 'onDblClick' callback.</p>
<p>Specify callback function, executed before the 'onDblClick' callback, The return value controls the 'onDblClick' callback.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the node which is double clicked</p>
<p class="highlight_red">If the DOM which dblclicked isn't a node, it will return null.</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
<p>return true or false</p>
<p class="highlight_red">If return false, ztree will not trigger the 'onDblClick' callback, no effect on other operations.</p>
<p class="highlight_red">This callback function does not affect the dblclick the parent node to auto expand, please refer to setting.view.dblClickExpand properties.</p>
<p class="highlight_red">This callback function does not affect the auto expand of the parent node , please refer to setting.view.dblClickExpand properties.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. disable to trigger the 'onDblClick' callback</h4>
<pre xmlns=""><code>function zTreeBeforeDblClick(treeId, treeNode) {
<pre xmlns=""><code>function myBeforeDblClick(treeId, treeNode) {
return false;
};
var setting = {
callback: {
beforeDblClick: zTreeBeforeDblClick
beforeDblClickfunction myBeforeDblClick
}
};
......</code></pre>
Expand Down
18 changes: 9 additions & 9 deletions api/en/setting.callback.beforeDrag.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,33 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event before drag node, zTree based on return value to determine whether to start to drag node.</p>
<p>Specify callback function to be called before the drag node callback, The return value controls whether the drag node callback will execute.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, the tree is what the treeNodes are belong to, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, the id of the containing tree.</p>
<h4 class="topLine"><b>treeNodes</b><span>Array(JSON)</span></h4>
<p>A collection of the nodes which will be dragged</p>
<p class="highlight_red">v3.x allows drag and drop multiple sibling nodes, so this parameter is modified to Array(JSON).</p>
<p class="highlight_red">If the selected nodes aren't the sibling nodes, you can only drag one node which mouse over.</p>
<p>A collection of the nodes being dragged</p>
<p class="highlight_red">v3.x allows the drag and drop of multiple sibling nodes, so this parameter's type is changed to Array(JSON).</p>
<p class="highlight_red">If the selected nodes aren't sibling nodes, you can only drag one node.</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
<p>return true or false</p>
<p class="highlight_red">If return false, zTree will stop drag, and will not trigger the 'onDrag / beforeDrop / onDrop' callback.</p>
<p class="highlight_red">If return false, zTree will abort the drag and drop, and will not trigger the 'onDrag / beforeDrop / onDrop' sequence of callbacks.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. disable to drag all node</h4>
<pre xmlns=""><code>function zTreeBeforeDrag(treeId, treeNodes) {
<h4>1. disable drag completely (by returning false)</h4>
<pre xmlns=""><code>function myBeforeDrag(treeId, treeNodes) {
return false;
};
var setting = {
edit: {
enable: true
},
callback: {
beforeDrag: zTreeBeforeDrag
beforeDragfunction myBeforeDrag
}
};
......</code></pre>
Expand Down
8 changes: 4 additions & 4 deletions api/en/setting.callback.beforeDragOpen.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event when drag node to collapsed parent node, zTree based on return value to determine whether to auto expand parent node.</p>
<p>Callback executed before drag node to collapsed parent node, The return value controls the auto expand behaviour of the parent node.</p>
<p>Default: null</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, the tree is what the treeNode(parent node) is belong to, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, the tree is what the treeNode(parent node) is belong to.</p>
<h4 class="topLine"><b>treeNode</b><span>JSON</span></h4>
<p>JSON data object of the parent node which will be auto expanded</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
Expand All @@ -21,15 +21,15 @@ <h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
</div>
<h3>Examples of setting & function</h3>
<h4>1. disable to auto expand parent node.</h4>
<pre xmlns=""><code>function zTreeBeforeDragOpen(treeId, treeNode) {
<pre xmlns=""><code>function myBeforeDragOpen(treeId, treeNode) {
return false;
};
var setting = {
edit: {
enable: true
},
callback: {
beforeDragOpen: zTreeBeforeDragOpen
beforeDragOpenfunction myBeforeDragOpen
}
};
......</code></pre>
Expand Down
18 changes: 9 additions & 9 deletions api/en/setting.callback.beforeDrop.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,44 @@ <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jqu
<div class="desc">
<p></p>
<div class="longdesc">
<p>Used to capture the event before drag-drop node, zTree based on return value to determine whether to allow drag-drop node.</p>
<p>Specify callback function to be called before drag-drop of a node, The return value controls the execution of drag-drop callback.</p>
<p>Default: null</p>
<p class="highlight_red">When drop the nodes, if the dragged nodes is not in a valid location, this callback will not triggered, and will restore the original position.</p>
<p class="highlight_red">When a node is dropped, if the drop is not in a valid location, this callback will not be triggered, and will revert to the original position.</p>
</div>
</div>
<h3>Function Parameter Descriptions</h3>
<div class="desc">
<h4><b>treeId</b><span>String</span></h4>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, the tree is what the targetNode is belong to, easy for users to control.</p>
<p>zTree unique identifier: <b class="highlight_red">treeId</b>, the id of the containing tree.</p>
<h4 class="topLine"><b>treeNodes</b><span>Array(JSON)</span></h4>
<p>A collection of the nodes which has been dragged</p>
<p class="highlight_red">The treeNodes are the data of the nodes which has been dragged, when copy nodes or move nodes.</p>
<p class="highlight_red">The treeNodes which have been dragged, when copying nodes or moving nodes.</p>
<h4 class="topLine"><b>targetNode</b><span>JSON</span></h4>
<p>JSON data object of the target node which treeNodes are drag-dropped.</p>
<p class="highlight_red">If the treeNodes will be root node, the targetNode = null</p>
<p>JSON data object of the destination node on which treeNodes are being dropped.</p>
<p class="highlight_red">If the treeNodes is the root node, the targetNode = null</p>
<h4 class="topLine"><b>moveType</b><span>String</span></h4>
<p>the relative position of move to the target node</p>
<p class="highlight_red">"inner": will be child of targetNode</p>
<p class="highlight_red">"prev": will be sibling node, and be in front of targetNode</p>
<p class="highlight_red">"next": will be sibling node, and be behind targetNode</p>
<h4 class="topLine"><b>isCopy</b><span>Boolean</span></h4>
<p>the flag used to judge copy node or move node</p>
<p>the flag used to determine if the drop is to copy or move the node</p>
<p class="highlight_red">true: copy node; false: move node</p>
<h4 class="topLine"><b>Return </b><span>Boolean</span></h4>
<p>return true or false</p>
<p class="highlight_red">If return false, zTree will restore the dragged nodes, and will not trigger the 'onDrop' callback.</p>
</div>
<h3>Examples of setting & function</h3>
<h4>1. disable to drag nodes to root</h4>
<pre xmlns=""><code>function zTreeBeforeDrop(treeId, treeNodes, targetNode, moveType) {
<pre xmlns=""><code>function myBeforeDrop(treeId, treeNodes, targetNode, moveType) {
return !(targetNode == null || (moveType != "inner" && !targetNode.parentTId));
};
var setting = {
edit: {
enable: true
},
callback: {
beforeDrop: zTreeBeforeDrop
beforeDropfunction myBeforeDrop
}
};
......</code></pre>
Expand Down
Loading

0 comments on commit 5427e35

Please sign in to comment.