Jelajahi Sumber

Updated 7.md in dev-en-HK doc

tobychui 5 tahun lalu
induk
melakukan
b7dcfd2011
1 mengubah file dengan 80 tambahan dan 0 penghapusan
  1. 80 0
      docs/lang/dev-en-HK/7.md

+ 80 - 0
docs/lang/dev-en-HK/7.md

@@ -127,12 +127,92 @@ ao_module_close();
 ```
 
 ## Focus Float Window
+To focus a float window, the float window object can request the function bar system to focus the iframe to the top z-index. In simple words, you can call the following function.
+
+```
+ao_module_focus();
+```
+
+The float window system support at most 50 float windows running in the same desktop environment. The current z-index of a particular float window must be an even number max at 100 and min at 2. For each float window layer there is a drag-drop cover in which provide cover to the underlaying float window to prevent mouse event being transfered to the iframe content window. 
+
+**It is recommended that float window script DO NOT TRY TO MODIFY THE Z-INDEX**
 
 ## Float Window Closing Override
+As the section above suggested, a float window launched WebApp module can call to the function ```ao_module_close();``` in order to close the float window. While the float window close button is clicked, there is a function call to the float window object depending your scripting method. Here is a table for that action.
+
+<table class="ts table">
+  <tr>
+    <th>Use of ao_module<br></th>
+    <th>on_close action</th>
+  </tr>
+  <tr>
+    <td>True</td>
+    <td>Call to ao_module wrapper ao_module_close()</td>
+  </tr>
+  <tr>
+    <td>False</td>
+    <td>Remove the iframe object from the parent window</td>
+  </tr>
+</table>
+
+To override the on close action for alternative actions like "save check" or "on close saving", you can create a new function after including the ao_module wrapper to override the internal ```ao_module_close()``` function. Here is an example for that.
+
+
+```
+<script src="../script/ao_module.js"></script>
+<!-- Other HTML elements -->
+<script>
+function ao_module_close(){
+	//Do something here before closing
+	parent.closeWindow(ao_module_windowID);
+	return true;
+}
+</script>
+
+```
 
 ## Float Window Parent and Child Callback
+Float Windows can be called with given pid and callback function name. This is specially useful on float windows that requires data communication to and from the parent module. Here are the meta data that you can find on the float window panels.
+
+```
+//These two meta data will be found on the float window panel
+puid	//The parent float window UID
+callback	//The function in parent where the call back should be made in String data type.
+```
+
+You can push **one** object into the ```ao_module_parentCallback``` function. The data will be jsonified as string and delivered to the reciving function. Here is an example for callback and closing the child module.
+
+```
+//Assume you are building a file selector
+selectedFiles = {"filename":"test.txt","filepath":"/demo/text_files/test.txt"};
+if (ao_module_virtualDesktop){
+	var returnvalue = ao_module_parentCallback(selectedFiles);
+	if (returnvalue == false){
+		//Unable to call to parent. Maybe parent is dead or function is not found.
+	}else{
+		//Parameter pass through succeed
+		ao_module_close();
+	}             
+}
+```
 
 ## System Setting Navigation Environment
+In order for file selector to be used in System Seting ```navi.php```,  the navigation interface will also provide partial support over float window API with function call to file selector. In this special case, any page loaded via navigation php will return ```ao_module_virtualDesktop``` as ```true```. To check if this is navigation interface instead of a real float window environment, check the paramter below if you are making a page that allow launching from System Setting and float window mode.
+
+```
+/Return true if this is running under navi.php
+parent.underNaviEnv
+
+//Example for using the parameter
+if (ao_module_virtualDesktop && parent.underNaviEnv){
+	//Launch inside System Setting interface
+}else if (ao_module_virtualDesktop){
+	//Launch inside float window mode
+}else{
+	//Otherwise
+}
+```
+