Commit 8e10ef18 authored by Thomas Bernard's avatar Thomas Bernard

2006-06-30 thomas

* Added PlanningBox rendering support in xhtml style

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8246 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6ed038d1
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PageTemplates.ZopePageTemplate</string>
<string>ZopePageTemplate</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!--\n
Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.\n
Thomas Bernard <thomas@nexedi.com>\n
\n
This program is Free Software; you can redistribute it and/or\n
modify it under the terms of the GNU General Public License\n
as published by the Free Software Foundation; either version 2\n
of the License, or (at your option) any later version.\n
\n
This program is distributed in the hope that it will be useful,\n
but WITHOUT ANY WARRANTY; without even the implied warranty of\n
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n
GNU General Public License for more details.\n
\n
You should have received a copy of the GNU General Public License\n
along with this program; if not, write to the Free Software\n
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
-->\n
\n
<!--\n
This Page template is aimed to generate the HTML code necessary to display correctly the\n
PlaningBox. The process is based on the strucutre passed in parameter (i.e options/struct)\n
Beware this only generates the HTML code, no CSS generation is done in this script\n
-->\n
\n
\n
<tal:block tal:condition="python:struct.build_error_list != None"\n
tal:define="struct options/struct;\n
basic python:struct.basic;\n
adress python:basic.here.getUrl()">\n
<input type="hidden" name="list_selection_name" value="PLanningView" tal:attributes="value python:basic.field.get_value(\'selection_name\')"/>\n
\n
<table>\n
<tr><td><h3><span tal:replace="structure python:struct.basic.field.get_value(\'title\')"/>\n
</h3></td>\n
<td>\n
<select name="report_root_url" onChange="submitAction(this.form,\'/portal_selections/setReportRoot\')"\n
tal:attributes="onChange string:submitAction(this.form,\'${adress}/portal_selections/setReportRoot\')">\n
<tal:block tal:condition="python:basic.selection is None"\n
tal:define="global selection_report_path python:basic.report_root_list[0][0]"/>\n
<tal:block tal:condition="python:basic.selection is not None"\n
tal:define="global selection_report_path python:basic.selection.report_path"/>\n
<tal:block tal:repeat="report_root_element python:basic.report_root_list">\n
<tal:block tal:condition="python:report_root_element[0]==selection_report_path">\n
<b tal:replace="nothing">actual value is selected</b>\n
<option selected="selected" value="None"\n
tal:attributes="value python:report_root_element[0]"\n
tal:content="structure python:report_root_element[1]">_</option>\n
</tal:block>\n
<tal:block tal:condition="python:report_root_element[0]!=selection_report_path">\n
<b tal:replace="nothing">actual value is not selected</b>\n
<option value="None"\n
tal:attributes="value python:report_root_element[0]"\n
tal:content="structure python:report_root_element[1]">_</option>\n
</tal:block>\n
</tal:block>\n
</select>\n
</td>\n
</tr>\n
</table>\n
\n
<tal:block tal:repeat="error_message python:struct.build_error_list"\n
tal:content="python:str(error_message)">\n
</tal:block>\n
\n
</tal:block>\n
\n
\n
<tal:block tal:condition="python:struct.build_error_list == None"\n
tal:define="struct options/struct">\n
<tal:block tal:define="basic python:struct.basic;\n
planning python:struct.planning;\n
adress python:basic.here.getUrl()">\n
\n
<!-- hidden fields holding some usefull data-->\n
<input type="hidden" name="list_selection_name" value="PLanningView" tal:attributes="value python:basic.field.get_value(\'selection_name\')"/>\n
<!-- setPage needs \'listbox_uid:list\'-->\n
<input type="hidden" name="listbox_uid:list"/>\n
<!-- block_moved_list -->\n
<input type="hidden" name="previous_block_moved" value="None"\n
tal:attributes="value python:basic.REQUEST.get(\'previous_block_moved\',\'\')"/>\n
<input type="hidden" name="block_moved"/>\n
\n
<!-- Planning\'s header -->\n
<div class="planning_box">\n
\n
<table>\n
<tr>\n
<td>\n
<h3><span tal:replace="structure python:basic.field.get_value(\'title\')"/></h3>\n
</td>\n
<b tal:replace="nothing"><!-- report path selection --></b>\n
<td>\n
<select name="report_root_url" onChange="submitAction(this.form,\'/portal_selections/setReportRoot\')"\n
tal:attributes="onChange string:submitAction(this.form,\'${adress}/portal_selections/setReportRoot\')">\n
<tal:block tal:condition="python:basic.selection is None"\n
tal:define="global selection_report_path python:basic.report_root_list[0][0]"/>\n
<tal:block tal:condition="python:basic.selection is not None"\n
tal:define="global selection_report_path python:basic.selection.report_path"/>\n
<tal:block tal:repeat="report_root_element python:basic.report_root_list">\n
<tal:block tal:condition="python:report_root_element[0]==selection_report_path">\n
<b tal:replace="nothing">actual value is selected</b>\n
<option selected="selected" value="None"\n
tal:attributes="value python:report_root_element[0]"\n
tal:content="structure python:report_root_element[1]">_</option>\n
</tal:block>\n
<tal:block tal:condition="python:report_root_element[0]!=selection_report_path">\n
<b tal:replace="nothing">actual value is not selected</b>\n
<option value="None"\n
tal:attributes="value python:report_root_element[0]"\n
tal:content="structure python:report_root_element[1]">_</option>\n
</tal:block>\n
</tal:block>\n
</select>\n
</td>\n
\n
<td>\n
<tal:block tal:repeat="nb python:range(8)">\n
&nbsp;\n
</tal:block>\n
<tal:block tal:condition="python:planning.main_axis == planning.Y">\n
Y Axis\n
</tal:block>\n
<tal:block tal:condition="python:planning.main_axis != planning.Y">\n
X Axis\n
</tal:block>\n
<tal:block tal:repeat="nb python:range(1)">\n
&nbsp;\n
</tal:block>\n
</td>\n
\n
<td>\n
<b tal:replace="nothing">\n
<!-- page selection need to be implemented here\n
for that will use structure.basic-->\n
</b>\n
<tal:block tal:condition="python:basic.main_axis_info[\'bound_start\']!=0">\n
<b tal:replace="nothing"> previous page exists </b>\n
<input type="image" src="/images/1leftarrowv.png" title="Previous Page" name="" border="0"\n
tal:attributes="src string:${adress}/images/1leftarrowv.png;\n
name string:${adress}/portal_selections/previousPage:method"/>\n
</tal:block>\n
\n
<select name="list_start" title="Change Page" size="1"\n
onChange=""\n
tal:condition="python:basic.main_axis_info[\'bound_page_total\'] > 1"\n
tal:attributes="onChange string:submitAction(this.form,\'${adress}/portal_selections/setPage\')">\n
<tal:block tal:repeat="current_page_number python:range(basic.main_axis_info[\'bound_page_total\']+1)[1:]">\n
<tal:block tal:condition="python:current_page_number==basic.main_axis_info[\'bound_page_current\']">\n
<b tal:replace="nothing"> actual page is selected </b>\n
<option selected="selected" value="None"\n
tal:attributes="value python:(current_page_number - 1)*basic.main_axis_info[\'bound_axis_groups\']"\n
tal:content="structure python:str(current_page_number) + \' of \' + str(basic.main_axis_info[\'bound_page_total\'])">page</option>\n
</tal:block>\n
<tal:block tal:condition="python:current_page_number!=basic.main_axis_info[\'bound_page_current\']">\n
<b tal:replace="nothing"> actual page is not selected </b>\n
<option value="None"\n
tal:attributes="value python:(current_page_number - 1)*basic.main_axis_info[\'bound_axis_groups\']"\n
tal:content="structure python:str(current_page_number) + \' of \' + str(basic.main_axis_info[\'bound_page_total\'])">page</option>\n
</tal:block>\n
</tal:block>\n
</select>\n
\n
<tal:block tal:condition="python:basic.main_axis_info[\'bound_stop\']!=basic.main_axis_info[\'bound_end\']">\n
<b tal:replace="nothing"> next page exists </b>\n
<input type="image" src="/images/1rightarrowv.png" title="Next Page" name="" border="0"\n
tal:attributes="src string:${adress}/images/1rightarrowv.png;\n
name string:${adress}/portal_selections/nextPage:method"/>\n
</tal:block>\n
\n
</td>\n
\n
\n
\n
<td>\n
<tal:block tal:repeat="nb python:range(8)">\n
&nbsp;\n
</tal:block>\n
<tal:block tal:condition="python:planning.main_axis == planning.Y">\n
X Axis\n
</tal:block>\n
<tal:block tal:condition="python:planning.main_axis != planning.Y">\n
Y Axis\n
</tal:block>\n
<tal:block tal:repeat="nb python:range(1)">\n
&nbsp;\n
</tal:block>\n
</td>\n
<td>\n
\n
<!-- processing zoom level select -->\n
<select name="zoom_level" title="Change Zoom Level" size="1"\n
onChange=""\n
tal:attributes="onChange string:submitAction(this.form,\'${adress}/portal_selections/setZoomLevel\')">\n
<tal:block tal:repeat="current_zoom_level python:[0.25,0.5,1,2,3,4,8]">\n
<tal:block tal:condition="python:current_zoom_level==basic.secondary_axis_info[\'zoom_level\']">\n
<b tal:replace="nothing"> current zoom level is selected </b>\n
<option selected="selected" value="None"\n
tal:attributes="value python:current_zoom_level"\n
tal:content="structure python:\'Zoom \' + str(current_zoom_level) + \'x\'">Zoom level</option>\n
</tal:block>\n
<tal:block tal:condition="python:current_zoom_level!=basic.secondary_axis_info[\'zoom_level\']">\n
<b tal:replace="nothing"> current zoom level is not selected </b>\n
<option value="None"\n
tal:attributes="value python:current_zoom_level"\n
tal:content="structure python:\'Zoom \' + str(current_zoom_level) + \'x\'">Zoom level</option>\n
</tal:block>\n
</tal:block>\n
</select>\n
\n
\n
<!-- previous Zoom page-->\n
<tal:block tal:condition="python:basic.secondary_axis_info[\'zoom_start\']!=0">\n
<b tal:replace="nothing"> previous page exists </b>\n
<input type="image" src="/images/1leftarrowv.png" title="Previous Zoom Page" name="" border="0"\n
tal:attributes="src string:${adress}/images/1leftarrowv.png;\n
name string:${adress}/portal_selections/previousZoom:method"/>\n
</tal:block>\n
\n
<!-- pocessing zoom page selection widgets -->\n
<select name="zoom_start" title="Change Zoom Page" size="1"\n
onChange=""\n
tal:condition="python:basic.secondary_axis_info[\'zoom_level\'] > 1"\n
tal:attributes="onChange string:submitAction(this.form,\'${adress}/portal_selections/setZoom\')">\n
<tal:block tal:repeat="current_zoom_page_number python:range(basic.secondary_axis_info[\'zoom_level\'])">\n
<tal:block tal:condition="python:current_zoom_page_number == basic.secondary_axis_info[\'zoom_start\']">\n
<b tal:replace="nothing"> actual zoom page is selected </b>\n
<option selected="selected" value="None"\n
tal:attributes="value python:current_zoom_page_number"\n
tal:content="structure python:str(current_zoom_page_number + 1) + \'of \' + str(max(int(float(basic.secondary_axis_info[\'zoom_level\'])),1))">Zoom page</option>\n
</tal:block>\n
<tal:block tal:condition="python:current_zoom_page_number != basic.secondary_axis_info[\'zoom_start\']">\n
<b tal:replace="nothing"> actual zoom page is not selected </b>\n
<option value="None"\n
tal:attributes="value python:current_zoom_page_number"\n
tal:content="structure python:str(current_zoom_page_number + 1) + \'of \' + str(max(int(float(basic.secondary_axis_info[\'zoom_level\'])),1))">Zoom page</option>\n
</tal:block>\n
</tal:block>\n
</select>\n
\n
\n
<!-- next Zoom Page-->\n
<tal:block tal:condition="python:basic.secondary_axis_info[\'zoom_start\']!=(basic.secondary_axis_info[\'zoom_level\'] - 1) and basic.secondary_axis_info[\'zoom_level\'] > 1">\n
<b tal:replace="nothing"> next page exists </b>\n
<input type="image" src="/images/1rightarrowv.png" title="Next Zoom Page" name="" border="0"\n
tal:attributes="src string:${adress}/images/1rightarrowv.png;\n
name string:${adress}/portal_selections/nextZoom:method"/>\n
</tal:block>\n
</td>\n
</tr>\n
</table>\n
\n
\n
\n
\n
<!-- div class="planning_box" -->\n
<!-- planning structure (axis and group representation)-->\n
<div tal:repeat="axis python:(planning.main_axis,planning.secondary_axis)"\n
tal:attributes="id python:axis.name">\n
<!-- groups of the current axis-->\n
<div tal:repeat="axis_group python:axis.axis_group"\n
tal:attributes="id python:axis_group.name;\n
title python:axis_group.tooltip">\n
<!-- depth of the current group -->\n
<div tal:repeat="depth python:range(axis_group.depth)"\n
tal:attributes="id python: axis_group.name + \'_depth_\' + str(depth)">\n
</div>\n
<!-- title of the current group-->\n
<a tal:attributes="href python:axis_group.info_title.link;\n
id python:axis_group.name + \'_info\'"\n
tal:content="python:axis_group.info_title.info">\n
</a>\n
</div>\n
\n
\n
<tal:condition tal:condition="python:axis==planning.X">\n
<tal:block tal:define="global previous_src string:${adress}/images/1leftarrowv.png;\n
global next_src string:${adress}/images/1rightarrowv.png">\n
</tal:block>\n
</tal:condition>\n
<tal:condition tal:condition="python:axis==planning.Y">\n
<tal:block tal:define="global previous_src string:${adress}/images/1toparrow.png;\n
global next_src string:${adress}/images/1bottomarrow.png">\n
</tal:block>\n
</tal:condition>\n
\n
\n
<!-- widgets of the current axis -->\n
<tal:block tal:condition="python:axis==planning.main_axis">\n
<!-- current axis is main axis-->\n
<tal:block tal:condition="python:basic.main_axis_info[\'bound_start\']!=0">\n
<!-- previous page exists -->\n
<input type="image" src="/images/1leftarrowv.png" title="Previous Page" name="" border="0"\n
tal:attributes="src previous_src;\n
name string:${adress}/portal_selections/previousPage:method;\n
id python:axis.name + \'_previous\'"/>\n
</tal:block>\n
<tal:block tal:condition="python:basic.main_axis_info[\'bound_stop\']!=basic.main_axis_info[\'bound_end\']">\n
<!-- next page exists -->\n
<input type="image" src="/images/1rightarrowv.png" title="Next Page" name="" border="0"\n
tal:attributes="src next_src;\n
name string:${adress}/portal_selections/nextPage:method;\n
id python:axis.name + \'_next\'"/>\n
</tal:block>\n
\n
\n
\n
<!-- inserting depth widget -->\n
<div tal:condition= "python:axis==planning.X"\n
tal:define="url python:\'%s/%s\' % (basic.here.absolute_url(),basic.form.id);\n
selection_name python:basic.field.get_value(\'selection_name\')"\n
tal:attributes="id python:axis.name + \'_depth\'">\n
<a tal:repeat="unfold_level python:range(0,4)"\n
tal:attributes="href python:\'%s?selection_index=&amp;selection_name=%s&amp;ignore_layout:int=0&amp;report_depth:int=%s\' % (url,selection_name,unfold_level)"\n
tal:content="structure python:str(unfold_level) + \'&lt;br&gt;\'">\n
0\n
</a>\n
</div>\n
\n
<div tal:condition= "python:axis==planning.Y"\n
tal:define="url python:\'%s/%s\' % (basic.here.absolute_url(),basic.form.id);\n
selection_name python:basic.field.get_value(\'selection_name\')"\n
tal:attributes="id python:axis.name + \'_depth\'">\n
<a tal:repeat="unfold_level python:range(0,4)"\n
tal:attributes="href python:\'%s?selection_index=&amp;selection_name=%s&amp;ignore_layout:int=0&amp;report_depth:int=%s\' % (url,selection_name,unfold_level)"\n
tal:content="structure python:str(unfold_level) + \'&nbsp;\'">\n
0\n
</a>\n
</div>\n
\n
\n
\n
\n
\n
</tal:block>\n
<tal:block tal:condition="python:axis==planning.secondary_axis">\n
<!-- Zoom page-->\n
<tal:block tal:condition="python:basic.secondary_axis_info[\'zoom_start\']!=0">\n
<!-- previous page exists -->\n
<input type="image" src="/images/1leftarrowv.png" title="Previous Zoom Page" name="" border="0"\n
tal:attributes="src previous_src;\n
name string:${adress}/portal_selections/previousZoom:method;\n
id python:axis.name + \'_previous\'"/>\n
</tal:block>\n
<tal:block tal:condition="python:basic.secondary_axis_info[\'zoom_start\']!=(basic.secondary_axis_info[\'zoom_level\'] - 1) and basic.secondary_axis_info[\'zoom_level\'] > 1">\n
<!-- next page exists -->\n
<input type="image" src="/images/1rightarrowv.png" title="Next Zoom Page" name="" border="0"\n
tal:attributes="src next_src;\n
name string:${adress}/portal_selections/nextZoom:method;\n
id python:axis.name + \'_next\'"/>\n
</tal:block>\n
</tal:block>\n
\n
</div>\n
\n
<!-- planning content-->\n
<div class="planning_content"\n
tal:condition="python:struct.build_error_list == None">\n
\n
<!-- display main axis lines -->\n
<tal:block tal:repeat="axis_group python:planning.main_axis.axis_group">\n
<div tal:attributes="id python:axis_group.name + \'_line\'"></div>\n
<b tal:replace="nothing">\n
<!-- display main axis sub_lines if necessary --></b>\n
<tal:block tal:condition="python:axis_group.axis_element_number > 1">\n
<div tal:repeat="axis_element_number python:range(axis_group.axis_element_number)[1:]"\n
tal:attributes="id python:axis_group.name + \'_line_\' + str(axis_element_number)">\n
</div>\n
</tal:block>\n
\n
</tal:block>\n
\n
<!-- display secondary axis lines -->\n
<div tal:repeat="axis_group python:planning.secondary_axis.axis_group"\n
tal:attributes="id python:axis_group.name + \'_line\'"></div>\n
\n
<!-- display blocks -->\n
<tal:block tal:repeat="block python:planning.content">\n
<div tal:condition="python:block.property_dict[\'stat\']== 0"\n
tal:attributes="id python:block.name;\n
ondblclick string:showGrips();\n
title python:block.title;\n
style python:\'text-align:center\'">\n
<tal:block tal:condition="python:block.zone == 1">\n
<tal:block tal:repeat="area python:block.info.keys()">\n
<tal:block tal:define="info_area python:area.split(\'_\')[1]">\n
<!-- tal:attributes="id python:info_area"> <! python:block.name + \'_\' + area"-->\n
<tal:block tal:condition="python:block.info[area].info != \'\'">\n
<tal:block tal:condition="python:info_area!=\'center\'">\n
<a tal:condition="python:block.info[area].info != \'__\'"\n
tal:content="python:block.info[area].info"\n
tal:attributes="href python:block.info[area].link;\n
class python:\'planning_box_\' + info_area">\n
</a>\n
<!--\n
<a tal:condition="python:block.info[area].info == \'__\'"\n
tal:attributes="href python:block.info[area].link;\n
class python:\'planning_box_\' + info_area">\n
<img tal:attributes="src python:basic.here.getUrl() + \'/images/question.png\'"\n
height="15" width="15">\n
</a> -->\n
</tal:block>\n
<tal:block tal:condition="python:info_area==\'center\'" >\n
<div tal:attributes="class python:\'planning_box_\' + info_area">\n
<a tal:condition="python:block.info[area].info != \'__\'"\n
tal:content="python:block.info[area].info"\n
tal:attributes="href python:block.info[area].link">\n
</a>\n
<a tal:condition="python:block.info[area].info == \'__\'"\n
tal:attributes="href python:block.info[area].link">\n
<img tal:attributes="src python:basic.here.getUrl() + \'/images/question.png\'"\n
height="15" width="15">\n
</a>\n
</div>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</div>\n
<div tal:condition="python:block.property_dict[\'stat\']== 1"\n
tal:attributes="id python:block.name;\n
title python:block.title">\n
</div>\n
</tal:block>\n
</div>\n
\n
<!-- generic div used for redimensionning-->\n
<div id="top" style="position:absolute; width:5px;height:5px; background:#a45d10"></div>\n
<div id="right" style="position:absolute; width:5px;height:5px; background:#a45d10"></div>\n
<div id="bottom" style="position:absolute; width:5px;height:5px; background:#a45d10"></div>\n
<div id="left" style="position:absolute; width:5px;height:5px; background:#a45d10"></div>\n
\n
<!-- declaring DTML properties -->\n
<tal:block tal:replace="structure python:here.planning_dhtml(planning=planning)"/>\n
\n
<!--/div-->\n
</div>\n
</tal:block>\n
</tal:block>\n
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>planning_content</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
"""\n
Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.\n
Thomas Bernard <thomas@nexedi.com>\n
\n
This program is Free Software; you can redistribute it and/or\n
modify it under the terms of the GNU General Public License\n
as published by the Free Software Foundation; either version 2\n
of the License, or (at your option) any later version.\n
\n
This program is distributed in the hope that it will be useful,\n
but WITHOUT ANY WARRANTY; without even the implied warranty of\n
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n
GNU General Public License for more details.\n
\n
You should have received a copy of the GNU General Public License\n
along with this program; if not, write to the Free Software\n
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
"""\n
\n
"""\n
This script is aimed to generate the coordinates and the properties necessary to\n
display correctly the PlaningBox in HTML style (i.e using HTML code + CSS class\n
for positionning). The process is based on the strucutre passed in parameter (i.e\n
\'structure\').\n
Beware this only generates a dict based structure, and need to be passed through\n
the CSS script (\'planning_css\') to have CSS compliant code, no HTML generation is\n
done in this script.\n
\n
This script is also used by the validator script in order to recover the\n
groups of moved blocks\n
"""\n
\n
# the following values are hard-defined and can be modified if necessary to comply with\n
# special constraints (big fonts for example)\n
car_height = 10 # caracter height\n
car_width = 6 # caracter width\n
depth_width = 10 # space to insert between each depth\n
depth_height = 10 # the same over the vertical axis\n
block_width = 40 # mid block size in wich we try to insert text\n
margin = 5 # margin between the block and the delimitation (this permits to have\n
# blocks a bit smaller that lines or columns)\n
\n
\n
\n
size_planning_width = structure.basic.field.get_value(\'size_planning_width\')\n
size_x_axis_height = structure.basic.field.get_value(\'size_x_axis_height\')\n
size_x_axis_space = structure.basic.field.get_value(\'size_x_axis_space\')\n
size_border_width_left = structure.basic.field.get_value(\'size_border_width_left\')\n
size_header_height = structure.basic.field.get_value(\'size_header_height\')\n
size_planning_height = structure.basic.field.get_value(\'size_planning_height\')\n
size_y_axis_width = structure.basic.field.get_value(\'size_y_axis_width\')\n
size_y_axis_space = structure.basic.field.get_value(\'size_y_axis_space\')\n
y_axis_position = structure.basic.field.get_value(\'y_axis_position\')\n
if y_axis_position == \'right\':\n
y_axis_position = 1\n
else:\n
y_axis_position = 0\n
x_axis_position = structure.basic.field.get_value(\'x_axis_position\')\n
if x_axis_position == \'top\':\n
x_axis_position = 1\n
else:\n
x_axis_position = 0\n
\n
\n
properties_structure = {}\n
properties_structure[\'base\'] = {}\n
properties_structure[\'frame\'] = {}\n
properties_structure[\'main_axis\'] = {}\n
properties_structure[\'secondary_axis\'] = {}\n
properties_structure[\'line\'] = {}\n
properties_structure[\'content\'] = {}\n
properties_structure[\'info\'] = {}\n
\n
\n
# getting number of elements to display on the main axis\n
if structure.planning.main_axis.size != structure.basic.main_axis_info[\'bound_axis_groups\']:\n
# number of groups to display over the main axis is different from the expected\n
# value : updating planning size to fit exactly the number of groups \n
if structure.planning.main_axis == structure.planning.Y:\n
# updating Y axis\n
main_axis_step = float(size_planning_height) / float(structure.basic.main_axis_info[\'bound_axis_groups\'])\n
size_planning_height = main_axis_step * structure.planning.main_axis.size\n
else:\n
main_axis_step = float(size_planning_width) / float(structure.basic.main_axis_info[\'bound_axis_groups\'])\n
size_planning_width = main_axis_step * structure.planning.main_axis.size\n
else:\n
if structure.planning.main_axis == structure.planning.Y:\n
main_axis_step = float(size_planning_height) / float(structure.basic.main_axis_info[\'bound_axis_groups\'])\n
else:\n
main_axis_step = float(size_planning_width) / float(structure.basic.main_axis_info[\'bound_axis_groups\'])\n
\n
# defining planning area CSS class\n
planning_dict=None\n
planning_dict= {}\n
planning_dict[\'position\'] = \'relative\'\n
planning_dict[\'border-style\'] = \'solid\'\n
planning_dict[\'border-color\'] = \'#000000\'\n
planning_dict[\'border-width\'] = 0\n
planning_dict[\'background\'] = \'#d5e6de\'\n
planning_dict[\'width\'] = size_planning_width + size_border_width_left + size_y_axis_width + size_y_axis_space + 20\n
planning_dict[\'height\'] = size_header_height + size_x_axis_height + size_x_axis_space + size_planning_height + 100\n
planning_dict[\'margin-top\'] = 0\n
planning_dict[\'margin-left\'] = 0\n
properties_structure[\'base\'][\'planning_box\'] = planning_dict\n
\n
\n
\n
\n
# recovering axis CSS class informations\n
for axis in (structure.planning.Y, structure.planning.X):\n
axis_dict= None\n
axis_dict= {}\n
axis_previous = None\n
axis_previous = {}\n
axis_next = None\n
axis_next = {}\n
axis_depth = None\n
axis_dict[\'position\']= \'absolute\'\n
axis_dict[\'border-style\'] = \'solid\'\n
axis_dict[\'border-color\'] = \'#53676e\'\n
axis_dict[\'border-width\'] = 0\n
axis_dict[\'background\'] = \'#d5e6de\'\n
# adding cursors position informations\n
axis_previous[\'position\'] = \'absolute\'\n
axis_previous[\'border-width\'] = 0\n
axis_next[\'position\'] = \'absolute\'\n
axis_next[\'border-width\'] = 0\n
if axis == structure.planning.X:\n
# current axis is X axis\n
# positionning it\n
axis_dict[\'width\'] = size_planning_width\n
axis_dict[\'height\'] = size_x_axis_height\n
if x_axis_position:\n
axis_dict[\'margin-top\'] = size_header_height\n
else:\n
axis_dict[\'margin-top\'] = size_header_height + size_planning_height + size_x_axis_space\n
if y_axis_position:\n
axis_dict[\'margin-left\'] = size_border_width_left\n
else:\n
axis_dict[\'margin-left\'] = size_border_width_left + size_y_axis_width + size_y_axis_space\n
\n
axis_previous[\'margin-left\'] = -20\n
axis_previous[\'margin-top\'] = (axis_dict[\'height\'] - 15) / 2\n
axis_next[\'margin-left\'] = axis_dict[\'width\'] + 5\n
axis_next[\'margin-top\'] = axis_previous[\'margin-top\']\n
\n
if axis == structure.planning.main_axis:\n
# current axis is main axis : need to implement depth widget\n
axis_depth = {}\n
axis_depth[\'margin-left\'] = -10\n
axis_depth[\'margin-top\'] = 0\n
axis_depth[\'border-width\'] = 0\n
axis_depth[\'position\'] = \'absolute\'\n
# updating axis previous values\n
axis_previous[\'margin-left\'] = axis_previous[\'margin-left\'] - 10\n
else:\n
# current axis is Y axis\n
# positionning it\n
axis_dict[\'width\'] = size_y_axis_width\n
axis_dict[\'height\'] = size_planning_height\n
if x_axis_position:\n
axis_dict[\'margin-top\'] = size_header_height + size_x_axis_height + size_x_axis_space\n
else:\n
axis_dict[\'margin-top\'] = size_header_height\n
if y_axis_position:\n
axis_dict[\'margin-left\'] = size_border_width_left + size_planning_width + size_y_axis_space\n
else:\n
axis_dict[\'margin-left\'] = size_border_width_left\n
\n
\n
axis_previous[\'margin-left\'] = (axis_dict[\'width\'] -15) / 2\n
axis_previous[\'margin-top\'] = -20\n
axis_next[\'margin-left\'] = axis_previous[\'margin-left\']\n
axis_next[\'margin-top\'] = axis_dict[\'height\'] + 5\n
if axis == structure.planning.main_axis:\n
axis_depth = {}\n
axis_depth[\'margin-left\'] = 0\n
axis_depth[\'bottom\'] = \'100%\'\n
axis_depth[\'border-width\'] = 0\n
axis_depth[\'position\'] = \'absolute\'\n
# updating axis previous values\n
axis_previous[\'margin-top\'] = axis_previous[\'margin-top\'] - 10\n
# adding axis_definitions to dictionnary\n
properties_structure[\'frame\'][axis.name] = axis_dict\n
properties_structure[\'frame\'][axis.name + \'_previous\'] = axis_previous\n
properties_structure[\'frame\'][axis.name + \'_next\'] = axis_next\n
if axis_depth != None:\n
properties_structure[\'frame\'][axis.name + \'_depth\'] = axis_depth\n
\n
\n
# now processing groups over the main axis, including their info object\n
# at the same time generating line to separate each group\n
for axis_group in structure.planning.main_axis.axis_group:\n
axis_group_dict=None\n
axis_group_dict={}\n
axis_group_dict[\'position\']= \'absolute\'\n
axis_group_dict[\'border-style\'] = \'solid\'\n
#axis_group_dict[\'border-color\'] = \'#53676e\'\n
axis_group_dict[\'border-width\'] = 1\n
#axis_group_dict[\'background\'] = \'#d5e6de\'\n
if axis_group.property_dict[\'stat\'] == 1 :\n
axis_group_dict[\'background\'] = \'#ddefe7\'\n
# info definition\n
axis_info_dict= {}\n
#axis_info_dict[\'position\'] = \'absolute\'\n
#axis_info_dict[\'border-style\'] = \'solid\'\n
#axis_info_dict[\'border-color\'] = \'#53676e\'\n
#axis_info_dict[\'border-width\'] = 0\n
# group line separator definition\n
axis_line_dict=None\n
axis_line_dict = {}\n
axis_line_dict[\'position\']= \'absolute\'\n
axis_line_dict[\'border-style\'] = \'solid\'\n
#axis_line_dict[\'border-right-width\'] = 0\n
#axis_line_dict[\'border-bottom-width\'] = 0\n
axis_line_dict[\'border-width\'] = 0\n
if structure.planning.main_axis == structure.planning.X:\n
# current axis is X axis\n
axis_group_dict[\'width\'] = float(axis_group.axis_element_number) * main_axis_step\n
axis_group_dict[\'margin-left\'] = float( axis_group.axis_element_start -1) * main_axis_step\n
axis_group_dict[\'height\'] = size_x_axis_height #- axis_group.depth * depth_height * 2\n
axis_group_dict[\'margin-top\'] = 0 #axis_group.depth * depth_height * 2\n
axis_info_dict[\'margin-top\'] = axis_group.depth * depth_height\n
axis_info_dict[\'margin-left\'] = 1\n
# dotted line must be vertical\n
if axis_group.depth == 0 :\n
#current group is main group : line must be bold\n
axis_line_dict[\'border-left-width\'] = 3\n
else:\n
axis_line_dict[\'border-left-width\'] = 1\n
#axis_line_dict[\'border-top-width\'] = 0\n
axis_line_dict[\'height\'] = size_planning_height\n
#axis_line_dict[\'width\'] = 0\n
axis_line_dict[\'margin-left\'] = axis_group_dict[\'margin-left\']\n
#axis_line_dict[\'margin-top\'] = 0\n
\n
# processing depth\n
for depth in range(axis_group.depth):\n
axis_depth_dict = None\n
axis_depth_dict = {}\n
axis_depth_dict[\'position\'] = \'absolute\'\n
#axis_depth_dict[\'border_style\'] = \'solid\'\n
#axis_depth_dict[\'border-color\'] = \'#53676e\'\n
#axis_depth_dict[\'border-right-width\'] = 0\n
#axis_depth_dict[\'border-left-width\'] = 0\n
#axis_depth_dict[\'border-top-width\'] = 1\n
#axis_depth_dict[\'border-bottom-width\'] = 0\n
axis_depth_dict[\'background\'] = \'#53676e\'\n
axis_depth_dict[\'margin-top\'] = (depth +1) * depth_height\n
axis_depth_dict[\'margin-left\'] = 0\n
axis_depth_dict[\'width\'] = axis_group_dict[\'width\']\n
axis_depth_dict[\'height\'] = 1\n
\n
# adding current depth line info to properties structure\n
properties_structure[\'info\'][axis_group.name + \'_depth_\' + str(depth)] = axis_depth_dict\n
\n
\n
# updating info size\n
if axis_group_dict[\'height\'] - axis_info_dict[\'margin-top\'] < car_height:\n
# block height is too low to be able to display any text\n
# removing block title but keeping tooltip\n
axis_group.info_title.edit(\'\')\n
else:\n
# height matches info\n
if len(axis_group.info_title.info) * car_width > axis_group_dict[\'width\']:\n
# defining number of caracts to leave\n
nb = max((axis_group_dict[\'width\'] - car_width * 3) / car_width, 0 )\n
# cutting activity\n
axis_group.info_title.edit(axis_group.info_title.info[:int(nb)] + \'..\')\n
\n
\n
if axis_group.axis_element_number > 1:\n
# subgroups are present\n
for axis_element_number in range(axis_group.axis_element_number)[1:]:\n
# iterating each subgroup except the first one\n
# for each of them, building a new line over the axis as a delimiter\n
axis_element_dict = None\n
axis_element_dict = {}\n
axis_element_dict[\'position\']= \'absolute\'\n
axis_element_dict[\'border-right-width\'] = 0\n
axis_element_dict[\'border-bottom-width\'] = 0\n
axis_element_dict[\'border-left-width\'] = 1\n
axis_element_dict[\'border-top-width\'] = 0\n
#axis_element_dict[\'border-style\'] = \'dotted\'\n
axis_element_dict[\'border-style\'] = \'dotted\'\n
axis_element_dict[\'width\'] = 0\n
axis_element_dict[\'height\'] = size_planning_height\n
axis_element_dict[\'margin-left\'] = axis_group_dict[\'margin-left\'] + axis_element_number * main_axis_step\n
axis_element_dict[\'margin-top\'] = 0\n
\n
# adding current sub line info to properties_structure\n
properties_structure[\'line\'][axis_group.name + \'_line_\' + str(axis_element_number)] = axis_element_dict\n
\n
else:\n
# current axis is Y axis\n
axis_group_dict[\'margin-left\'] = 0 #axis_group.depth * depth_width * 2\n
axis_group_dict[\'width\'] = size_y_axis_width #- axis_group.depth * depth_width * 2\n
axis_group_dict[\'margin-top\'] = float( axis_group.axis_element_start - 1) * main_axis_step\n
axis_group_dict[\'height\'] = float(axis_group.axis_element_number) * main_axis_step\n
#axis_group_dict[\'text-align\'] = \'center\'\n
#axis_group_dict[\'vertical-align\'] = \'middle\'\n
\n
# positionning info object in the middle of the axisGroup\n
#axis_info_dict[\'margin-top\'] = ((float(axis_group_dict[\'height\']) - car_height ) / 2.0)\n
#axis_info_dict[\'margin-top\'] = -12\n
#axis_info_dict[\'margin-left\'] = axis_group.depth * depth_width + depth_width / 2\n
#axis_info_dict[\'margin-left\']=\'auto\'\n
#axis_info_dict[\'margin-right\']=\'auto\'\n
#axis_info_dict[\'margin-top\']=\'auto\'\n
#axis_info_dict[\'margin-bottom\']=\'auto\'\n
\n
# main line must be horizontal\n
if axis_group.depth == 0:\n
axis_line_dict[\'border-top-width\'] = 2\n
else:\n
axis_line_dict[\'border-top-width\'] = 1\n
#axis_line_dict[\'border-left-width\'] = 0\n
axis_line_dict[\'width\'] = size_planning_width\n
#axis_line_dict[\'height\'] = 0\n
#axis_line_dict[\'margin-left\'] = 0\n
axis_line_dict[\'margin-top\'] = axis_group_dict[\'margin-top\']\n
\n
\n
# processing depth\n
for depth in range(axis_group.depth):\n
axis_depth_dict = None\n
axis_depth_dict = {}\n
axis_depth_dict[\'position\'] = \'absolute\'\n
#axis_depth_dict[\'border_style\'] = \'solid\'\n
#axis_depth_dict[\'border-color\'] = \'#53676e\'\n
#axis_depth_dict[\'border-right-width\'] = 0\n
#axis_depth_dict[\'border-left-width\'] = 1\n
#axis_depth_dict[\'border-top-width\'] = 0\n
#axis_depth_dict[\'border-bottom-width\'] = 0\n
#axis_depth_dict[\'border-width\'] = 2\n
axis_depth_dict[\'background\'] = \'#53676e\'\n
axis_depth_dict[\'margin-top\'] = 1\n
axis_depth_dict[\'margin-left\'] = (depth +1) * depth_width\n
axis_depth_dict[\'width\'] = 1\n
axis_depth_dict[\'height\'] = axis_group_dict[\'height\']\n
\n
# adding current depth line info to properties structure\n
properties_structure[\'info\'][axis_group.name + \'_depth_\' + str(depth)] = axis_depth_dict\n
\n
\n
\n
# updating info size\n
if axis_group_dict[\'height\'] < car_height:\n
# block height is too low to be able to display any text\n
# removing block title but keeping tooltip\n
axis_group.info_title.edit(\'\')\n
else:\n
# height matches info\n
if len(axis_group.info_title.info) * car_width > axis_group_dict[\'width\']:\n
# defining number of caracts to leave\n
nb = max((axis_group_dict[\'width\'] - car_width * 3) / car_width, 0 )\n
# cutting activity\n
axis_group.info_title.edit(axis_group.info_title.info[:int(nb)] + \'..\')\n
\n
\n
\n
if axis_group.axis_element_number > 1:\n
# subgroup are present\n
for axis_element_number in range(axis_group.axis_element_number)[1:]:\n
# iterating each subgroup except the first one\n
# for each of them, building a new line over the axis as a delimiter\n
axis_element_dict = None\n
axis_element_dict = {}\n
axis_element_dict[\'position\']= \'absolute\'\n
axis_element_dict[\'border-right-width\'] = 0\n
axis_element_dict[\'border-bottom-width\'] = 0\n
axis_element_dict[\'border-left-width\'] = 0\n
axis_element_dict[\'border-top-width\'] = 1\n
axis_element_dict[\'border-style\'] = \'dotted\'\n
axis_element_dict[\'width\'] = size_planning_width\n
axis_element_dict[\'height\'] = 0\n
axis_element_dict[\'margin-left\'] = 0\n
axis_element_dict[\'margin-top\'] = axis_group_dict[\'margin-top\'] + axis_element_number * main_axis_step\n
\n
# adding current sub line info to properties_structure\n
properties_structure[\'line\'][axis_group.name + \'_line_\' + str(axis_element_number)] = axis_element_dict\n
\n
\n
# adding axis_definitions to dictionnary\n
properties_structure[\'main_axis\'][axis_group.name] = axis_group_dict\n
properties_structure[\'line\'][axis_group.name + \'_line\'] = axis_line_dict\n
#properties_structure[\'info\'][axis_group.name + \'_info\'] = axis_info_dict\n
\n
\n
\n
# processing secondary_axis_group\n
for sec_axis_group in structure.planning.secondary_axis.axis_group:\n
sec_axis_group_dict=None\n
sec_axis_group_dict={}\n
sec_axis_group_dict[\'position\']= \'absolute\'\n
sec_axis_group_dict[\'border-color\'] = \'#53676e\'\n
sec_axis_group_dict[\'border-style\'] = \'solid\'\n
sec_axis_group_dict[\'border-width\'] = 1\n
sec_axis_group_dict[\'background\'] = \'#d5e6de\'\n
# info definition\n
sec_axis_info_dict= {}\n
sec_axis_info_dict[\'position\'] = \'absolute\'\n
#sec_axis_info_dict[\'border-style\'] = \'solid\'\n
#sec_axis_info_dict[\'border-color\'] = \'#53676e\'\n
#sec_axis_info_dict[\'border-width\'] = 0\n
# line definition\n
sec_axis_line_dict=None\n
sec_axis_line_dict = {}\n
sec_axis_line_dict[\'position\']= \'absolute\'\n
if sec_axis_group.delimiter_type == 0:\n
sec_axis_line_dict[\'border-style\'] = \'dotted\'\n
else:\n
sec_axis_line_dict[\'border-style\'] = \'solid\'\n
sec_axis_line_dict[\'border-right-width\'] = 0\n
sec_axis_line_dict[\'border-bottom-width\'] = 0\n
if structure.planning.main_axis == structure.planning.Y:\n
# current axis is X axis\n
sec_axis_group_dict[\'width\'] = sec_axis_group.position_secondary.absolute_range * size_planning_width\n
sec_axis_group_dict[\'margin-left\'] = sec_axis_group.position_secondary.absolute_begin * size_planning_width\n
sec_axis_group_dict[\'height\'] = size_x_axis_height\n
sec_axis_group_dict[\'margin-top\'] = sec_axis_group.depth\n
sec_axis_info_dict[\'margin-top\'] = 1\n
sec_axis_info_dict[\'margin-left\'] = 1\n
# dotted line must be vertical\n
if sec_axis_group.delimiter_type == 2:\n
sec_axis_line_dict[\'border-left-width\'] = 2\n
else:\n
sec_axis_line_dict[\'border-left-width\'] = 1\n
sec_axis_line_dict[\'border-top-width\'] = 0\n
sec_axis_line_dict[\'height\'] = size_planning_height\n
sec_axis_line_dict[\'width\'] = 0\n
sec_axis_line_dict[\'margin-left\'] = sec_axis_group_dict[\'margin-left\']\n
sec_axis_line_dict[\'margin-top\'] = 0\n
\n
# updating info size\n
if sec_axis_group_dict[\'height\'] - sec_axis_info_dict[\'margin-top\'] < car_height:\n
# block height is too low to be able to display any text\n
# removing block title but keeping tooltip\n
sec_axis_group.info_title.edit(\'\')\n
else:\n
# height matches info\n
if len(sec_axis_group.info_title.info) * car_width > sec_axis_group_dict[\'width\']:\n
# defining number of caracts to leave\n
nb = max((sec_axis_group_dict[\'width\'] - car_width * 3) / car_width, 0 )\n
# cutting activity\n
sec_axis_group.info_title.edit(sec_axis_group.info_title.info[:int(nb)] + \'..\')\n
# adding axis_definitions to dictionnary\n
properties_structure[\'secondary_axis\'][sec_axis_group.name] = sec_axis_group_dict\n
properties_structure[\'line\'][sec_axis_group.name + \'_line\'] = sec_axis_line_dict\n
#properties_structure[\'info\'][sec_axis_group.name + \'_info\'] = sec_axis_info_dict\n
\n
else:\n
# current axis is Y axis\n
sec_axis_group_dict[\'margin-left\'] = sec_axis_group.depth\n
sec_axis_group_dict[\'width\'] = size_y_axis_width\n
sec_axis_group_dict[\'margin-top\'] = sec_axis_group.position_secondary.absolute_begin * size_planning_height\n
sec_axis_group_dict[\'height\'] = sec_axis_group.position_secondary.absolute_range * size_planning_height\n
# positionning info object in the middle of the axisGroup\n
sec_axis_info_dict[\'margin-top\'] = ((float(axis_group_dict[\'height\']) - car_height ) / 2.0)\n
sec_axis_info_dict[\'margin-top\'] = 0\n
sec_axis_info_dict[\'margin-left\'] = 1\n
# dotted line must be horizontal\n
sec_axis_line_dict[\'border-left-width\'] = 0\n
if sec_axis_group.delimiter_type == 2:\n
sec_axis_line_dict[\'border-top-width\'] = 2\n
else:\n
sec_axis_line_dict[\'border-top-width\'] = 1\n
sec_axis_line_dict[\'width\'] = size_planning_width\n
sec_axis_line_dict[\'height\'] = 0\n
sec_axis_line_dict[\'margin-left\'] = 0\n
sec_axis_line_dict[\'margin-top\'] = sec_axis_group_dict[\'margin-top\']\n
\n
\n
# updating info size\n
if sec_axis_group_dict[\'height\'] < car_height:\n
# block height is too low to be able to display any text\n
# removing block title but keeping tooltip\n
sec_axis_group.info_title.edit(\'\')\n
else:\n
# height matches info\n
if len(sec_axis_group.info_title.info) * car_width > sec_axis_group_dict[\'width\']:\n
# defining number of caracts to leave\n
nb = max((sec_axis_group_dict[\'width\'] - car_width * 3) / car_width, 0 )\n
# cutting activity\n
sec_axis_group.info_title.edit(sec_axis_group.info_title.info[:int(nb)] + \'..\')\n
\n
# adding axis_definitions to dictionnary\n
properties_structure[\'secondary_axis\'][sec_axis_group.name] = sec_axis_group_dict\n
properties_structure[\'line\'][sec_axis_group.name + \'_line\'] = sec_axis_line_dict\n
#properties_structure[\'info\'][sec_axis_group.name + \'_info\'] = sec_axis_info_dict\n
\n
\n
\n
\n
\n
# defining CSS properties for content\n
content_dict=None\n
content_dict={}\n
content_dict[\'position\'] = \'absolute\'\n
content_dict[\'width\'] = size_planning_width\n
content_dict[\'height\'] = size_planning_height\n
if y_axis_position:\n
content_dict[\'margin-left\'] = size_border_width_left\n
else:\n
content_dict[\'margin-left\'] = size_border_width_left + size_y_axis_width + size_y_axis_space\n
if x_axis_position:\n
content_dict[\'margin-top\'] = size_header_height + size_x_axis_height + size_x_axis_space\n
else:\n
content_dict[\'margin-top\'] = size_header_height\n
content_dict[\'background\'] = \'#ffffff\'\n
content_dict[\'border-style\'] = \'solid\'\n
content_dict[\'border-color\'] = \'#53676e\'\n
content_dict[\'border-width\'] = 1\n
properties_structure[\'frame\'][\'planning_content\'] = content_dict\n
\n
\n
\n
# processing blocks in the planning content\n
for block_object in structure.planning.content:\n
block_dict = None\n
block_dict = {}\n
block_dict[\'position\'] = \'absolute\'\n
block_dict[\'border-style\'] = \'solid\'\n
block_dict[\'border-color\'] = \'#53676e\'\n
block_dict[\'border-width\'] = 1\n
if block_object.error == 1: # task has error (not validated)\n
block_dict[\'background\'] = \'#e4c4da\'\n
elif block_object.warning == 1: # other bloc in the same task has error\n
block_dict[\'background\'] = \'#e9e3f0\'\n
elif block_object.property_dict[\'stat\'] == 1: # stat\n
block_dict[\'background\'] = \'#97b0c1\'\n
block_dict[\'border-color\'] = \'#97b0c1\'\n
elif block_object.color != \'\': # color specified\n
block_dict[\'background\'] = block_object.color\n
else: # default color\n
block_dict[\'background\'] = \'#bdd2e7\'\n
\n
\n
block_dict[\'width\'] = block_object.position_x.relative_range * size_planning_width\n
block_dict[\'height\'] = block_object.position_y.relative_range * size_planning_height\n
block_dict[\'margin-left\'] = block_object.position_x.relative_begin * size_planning_width\n
block_dict[\'margin-top\'] = block_object.position_y.relative_begin * size_planning_height\n
\n
if block_object.parent_activity.property_dict[\'stat\'] == 0:\n
# the whole following process is aimed to take care of the non-stat blocks\n
\n
if structure.planning.main_axis == structure.planning.Y and block_object.parent_activity.property_dict[\'stat\'] == 0:\n
# Y axis is main axis\n
# adapt Y block size\n
block_dict[\'height\'] = block_dict[\'height\'] - 10\n
block_dict[\'margin-top\'] = block_dict[\'margin-top\'] + 5\n
elif block_object.parent_activity.property_dict[\'stat\'] == 0:\n
# X axis is main axis\n
# adapt X block size\n
block_dict[\'width\'] = block_dict[\'width\'] - 10\n
block_dict[\'margin-left\'] = block_dict[\'margin-left\'] + 5\n
\n
# for each block processing its info objects and placing them\n
# testing if there is enough room horizontally to display the info,\n
# first checking when 2 info on the same line (top or bottom)\n
top_string = \'\'\n
top_list = []\n
bot_string = \'\'\n
bot_list = []\n
center = \'\'\n
# recovering full string that will have to be displayed on the top & bottom line\n
for info_name in block_object.info.keys():\n
if \'top\' in info_name:\n
top_string += block_object.info[info_name].info\n
top_list.append(info_name)\n
if \'bot\' in info_name:\n
bot_string += block_object.info[info_name].info\n
bot_list.append(info_name)\n
if \'center\' in info_name:\n
center = info_name\n
# checking if block length can fit them\n
if (len(top_string) * car_width) > block_dict[\'width\']:\n
# block is too short, escaping top line\n
for top_id in top_list:\n
block_object.info[top_id].edit(\'.\')\n
if (len(bot_string) * car_width) > block_dict[\'width\']:\n
for bot_id in bot_list:\n
block_object.info[bot_id].edit(\'.\')\n
# testing if need to update center info object (horizontal test)\n
# as center info is automatically splitted into lines if necessary, need to check\n
# the length of the biggest line.\n
center_content_list = block_object.info[center].info.split(\' \')\n
center_length = 0\n
for center_content_string in center_content_list:\n
if center_length < len(center_content_string):\n
center_length = len(center_content_string)\n
# now center_length contains the maximum length of a line\n
# applying test\n
if center_length * car_width > block_dict[\'width\']:\n
# center length is too long, escaping it\n
block_object.info[center].edit(\'__\')\n
\n
# now testing vertical limit (..)\n
# lines contains the nuber of \'lines\' to display\n
lines = 1 # center line is always present\n
for list_object in (top_list,bot_list):\n
if list_object is not (None,[]):\n
lines += 1\n
if block_dict[\'height\'] < car_height:\n
# there is no room to display any text in the block\n
# escaping all text\n
for info_name in block_object.info.keys():\n
block_object.info[info_name].edit(\'\')\n
else:\n
if block_dict[\'height\'] < (car_height* lines):\n
# there is not enought room to display all the text in the block\n
# keeping only the most important : center\n
for list_object in (top_list,bot_list):\n
for info_name in list_object:\n
block_object.info[info_name].edit(\'\')\n
# now processing standard testing and positionning\n
# testing if the info can fit inside the block horizontally\n
"""\n
for info_name in block_object.info.keys():\n
block_info_dict = None\n
block_info_dict = {}\n
block_info_dict[\'position\'] = \'absolute\'\n
if \'top\' in info_name:\n
#block_info_dict[\'margin-top\'] = 0\n
pass\n
if \'bot\' in info_name:\n
#block_info_dict[\'margin-top\'] = block_dict[\'height\'] - car_height\n
block_info_dict[\'margin-top\'] = - car_height - 5\n
block_info_dict[\'top\'] = \'100%\'\n
if \'left\' in info_name:\n
#block_info_dict[\'margin-left\'] = 0\n
pass\n
if \'right\' in info_name:\n
#block_info_dict[\'margin-left\'] = block_dict[\'width\'] - (car_width * len(block_object.info[info_name].info))\n
#block_info_dict[\'margin-right\'] = 0\n
block_info_dict[\'left\'] = \'100%\'\n
block_info_dict[\'margin-left\'] = -(car_width * len(block_object.info[info_name].info))\n
if \'center\' in info_name:\n
#block_info_dict[\'margin-left\'] = (block_dict[\'width\'] - (car_width * len(block_object.info[info_name].info)))/2\n
block_info_dict[\'margin-left\'] = - (car_width * len(block_object.info[info_name].info)) /2\n
block_info_dict[\'left\'] = \'50%\'\n
#if block_info_dict[\'margin-left\'] < 0:\n
# block_info_dict[\'margin-left\'] = 0\n
#block_info_dict[\'margin-left\'] = block_info_dict[\'margin-left\']\n
block_info_dict[\'top\'] = \'50%\'\n
block_info_dict[\'margin-top\'] = - car_height / 2\n
#block_info_dict[\'margin-top\'] = (block_dict[\'height\'] - car_height)/2\n
if \'error\' in info_name:\n
#block_info_dict[\'margin-left\'] = 0\n
block_info_dict[\'width\'] = block_dict[\'width\']\n
block_info_dict[\'margin-top\'] = block_dict[\'height\']\n
\n
properties_structure[\'info\'][block_object.name + \'_\' + info_name] = block_info_dict\n
"""\n
\n
\n
properties_structure[\'content\'][block_object.name] = block_dict\n
\n
"""\n
planning_box_dict=None\n
planning_box_dict={}\n
planning_box_dict[\'position\']=\'absolute\'\n
planning_box_dict[\'width\'] = \n
planning_box_dict[\'height\'] = \n
properties_structure[\'base\'][\'planning_box\'] = planning_box_dict\n
"""\n
return properties_structure\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/erp5/portal_skins/erp5_xhtml_style/planning_coordinates</string> </value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>structure</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>structure</string>
<string>car_height</string>
<string>car_width</string>
<string>depth_width</string>
<string>depth_height</string>
<string>block_width</string>
<string>margin</string>
<string>_getattr_</string>
<string>size_planning_width</string>
<string>size_x_axis_height</string>
<string>size_x_axis_space</string>
<string>size_border_width_left</string>
<string>size_header_height</string>
<string>size_planning_height</string>
<string>size_y_axis_width</string>
<string>size_y_axis_space</string>
<string>y_axis_position</string>
<string>x_axis_position</string>
<string>properties_structure</string>
<string>_write_</string>
<string>_getitem_</string>
<string>float</string>
<string>main_axis_step</string>
<string>None</string>
<string>planning_dict</string>
<string>_getiter_</string>
<string>axis</string>
<string>axis_dict</string>
<string>axis_previous</string>
<string>axis_next</string>
<string>axis_depth</string>
<string>axis_group</string>
<string>axis_group_dict</string>
<string>axis_info_dict</string>
<string>axis_line_dict</string>
<string>range</string>
<string>depth</string>
<string>axis_depth_dict</string>
<string>str</string>
<string>len</string>
<string>max</string>
<string>nb</string>
<string>int</string>
<string>axis_element_number</string>
<string>axis_element_dict</string>
<string>sec_axis_group</string>
<string>sec_axis_group_dict</string>
<string>sec_axis_info_dict</string>
<string>sec_axis_line_dict</string>
<string>content_dict</string>
<string>block_object</string>
<string>block_dict</string>
<string>top_string</string>
<string>top_list</string>
<string>bot_string</string>
<string>bot_list</string>
<string>center</string>
<string>info_name</string>
<string>top_id</string>
<string>bot_id</string>
<string>center_content_list</string>
<string>center_length</string>
<string>center_content_string</string>
<string>lines</string>
<string>list_object</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>planning_coordinates</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
"""\n
Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.\n
Thomas Bernard <thomas@nexedi.com>\n
\n
This program is Free Software; you can redistribute it and/or\n
modify it under the terms of the GNU General Public License\n
as published by the Free Software Foundation; either version 2\n
of the License, or (at your option) any later version.\n
\n
This program is distributed in the hope that it will be useful,\n
but WITHOUT ANY WARRANTY; without even the implied warranty of\n
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n
GNU General Public License for more details.\n
\n
You should have received a copy of the GNU General Public License\n
along with this program; if not, write to the Free Software\n
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
"""\n
\n
"""\n
This script is aimed to generate the CSS code needed to display correctly the\n
PlaningBox in HTML style (i.e using HTML code + CSS class for positionning).\n
The process is based on the strucutre passed in parameter (i.e \'structure\').\n
\n
Beware this only generates CSS code, and need to use the \'planning_coordinates\'\n
script (\'planning_css\') to have CSS compliant code, no HTML generation is\n
done in this script.\n
"""\n
\n
if structure.build_error_list != None:\n
# structure contains errors, do not need to do any further processing about\n
# CSS generation. Error display will be handled in html rendering.\n
return \'\'\n
\n
\n
properties_structure = context.planning_coordinates(structure)\n
\n
"""\n
- the properties_structure returned from the planning_coordinates script is somehow\n
special : it is a dict defined by the areas of data\n
- then each area is itself a dict defined by the name of the object (axis, group, block, etc.)\n
- finally the objects holds a dict with all the proprieties\n
"""\n
\n
\n
# udating properties if necessary.\n
# This process is only usefull when displaying a planning that failed to\n
# validate. In such a case the block properties are updated to match their\n
# last position.\n
block_string = structure.basic.REQUEST.get(\'previous_block_moved\',\'\')\n
if block_string != \'\':\n
# block_list is not empty, need to recover porperties and update the blocks\n
# that need to be refreshed\n
block_object_list = block_string.split(\'*\')\n
for block_object_string in block_object_list:\n
block_dict = None\n
block_dict = {}\n
block_sub_list = block_object_string.split(\',\')\n
block_dict[\'name\'] = block_sub_list[0]\n
block_dict[\'old_X\'] = float(block_sub_list[1])\n
block_dict[\'old_Y\'] = float(block_sub_list[2])\n
block_dict[\'new_X\'] = float(block_sub_list[3])\n
block_dict[\'new_Y\'] = float(block_sub_list[4])\n
block_dict[\'width\'] = float(block_sub_list[5])\n
block_dict[\'height\'] = float(block_sub_list[6])\n
# recovering corresponding block coordinates object in properties_structure\n
block_properties = properties_structure[\'content\'][block_dict[\'name\']]\n
# list of dict of blocks has been recovered\n
# need to find deltaX and deltaY\n
deltaX = block_dict[\'old_X\'] - block_properties[\'margin-left\']\n
deltaY = block_dict[\'old_Y\'] - block_properties[\'margin-top\']\n
# updating position\n
block_properties[\'margin-left\'] = block_dict[\'new_X\'] - deltaX\n
block_properties[\'margin-top\'] = block_dict[\'new_Y\'] - deltaY\n
# updating size\n
block_properties[\'width\'] = block_dict[\'width\']\n
block_properties[\'height\'] = block_dict[\'height\']\n
\n
else:\n
# no unvalidated block, using actual properties\n
pass\n
\n
\n
\n
# build list from dictionnary structure\n
# this list will e converted to a string afterwards\n
returned_list = []\n
for area_name in properties_structure.keys():\n
css_dict = properties_structure[area_name]\n
for class_name in css_dict.keys():\n
if class_name == \'planning_content\':\n
returned_list.append(\'.%s{\' % class_name)\n
elif class_name == \'planning_box\':\n
returned_list.append(\'.%s{\' % class_name)\n
else:\n
returned_list.append(\'#%s{\' % class_name)\n
for id in css_dict[class_name].keys():\n
if same_type(css_dict[class_name][id],\'\'):\n
returned_list.append(\'%s:%s;\\n\' % (id,css_dict[class_name][id]))\n
else:\n
# if data is type float or integer then need to add \'px\' at the end\n
returned_list.append(\'%s:%s%s;\\n\' % (id, int(css_dict[class_name][id] + 0.5),\'px\'))\n
returned_list.append(\'}\\n\')\n
returned_list.append(" \\\n
.planning_box_topleft{ position:absolute;left:0;top:0;} \\n \\\n
.planning_box_topright{position:absolute;right:0;top:0;} \\n \\\n
.planning_box_botleft{ position:absolute;bottom:0;left:0;} \\n \\\n
.planning_box_botright{position:absolute;right:0;bottom:0;} \\n \\\n
.planning_box_center{position:absolute; left:0; right:0; top:40%;}")\n
\n
\n
# now joining list to build the final CSS string\n
# and returning it\n
return "\\n" + "".join(returned_list)\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/erp5/portal_skins/erp5_xhtml_style/planning_css</string> </value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>structure</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>structure</string>
<string>_getattr_</string>
<string>None</string>
<string>context</string>
<string>properties_structure</string>
<string>block_string</string>
<string>block_object_list</string>
<string>_getiter_</string>
<string>block_object_string</string>
<string>block_dict</string>
<string>block_sub_list</string>
<string>_getitem_</string>
<string>_write_</string>
<string>float</string>
<string>block_properties</string>
<string>deltaX</string>
<string>deltaY</string>
<string>returned_list</string>
<string>area_name</string>
<string>css_dict</string>
<string>class_name</string>
<string>id</string>
<string>same_type</string>
<string>int</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>planning_css</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
"""\n
Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.\n
Thomas Bernard <thomas@nexedi.com>\n
\n
This program is Free Software; you can redistribute it and/or\n
modify it under the terms of the GNU General Public License\n
as published by the Free Software Foundation; either version 2\n
of the License, or (at your option) any later version.\n
\n
This program is distributed in the hope that it will be useful,\n
but WITHOUT ANY WARRANTY; without even the implied warranty of\n
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n
GNU General Public License for more details.\n
\n
You should have received a copy of the GNU General Public License\n
along with this program; if not, write to the Free Software\n
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
"""\n
\n
"""\n
This script builds a string with all necessary data to allow block\n
moving and resizing\n
"""\n
\n
returned_string = "<script type=\\"text/javascript\\">SET_DHTML("\n
for block in planning.content:\n
if block.property_dict[\'stat\'] == 0:\n
returned_string += \'"%s",\' % block.name\n
returned_string += "\\"top\\"+CURSOR_N_RESIZE+VERTICAL, \\"right\\"+CURSOR_E_RESIZE+HORIZONTAL, \\"bottom\\"+CURSOR_S_RESIZE+VERTICAL, \\"left\\"+CURSOR_W_RESIZE+HORIZONTAL);</script>"\n
\n
return returned_string\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/erp5/portal_skins/erp5_xhtml_style/planning_dhtml</string> </value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>planning</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>planning</string>
<string>returned_string</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>block</string>
<string>_getitem_</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>planning_dhtml</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>OFS.DTMLMethod</string>
<string>DTMLMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>wz_dragdrop.js</string> </value>
</item>
<item>
<key> <string>_vars</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>globals</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>raw</string> </key>
<value> <string encoding="cdata"><![CDATA[
/* This notice must be untouched at all times.\n
\n
wz_dragdrop.js v. 4.56\n
The latest version is available at\n
http://www.walterzorn.com\n
or http://www.devira.com\n
or http://www.walterzorn.de\n
\n
Copyright (c) 2002-2003 Walter Zorn. All rights reserved.\n
Created 26. 8. 2002 by Walter Zorn (Web: http://www.walterzorn.com )\n
Last modified: 20. 10. 2004\n
\n
This DHTML & Drag&Drop Library adds Drag&Drop functionality\n
to the following types of html-elements:\n
- images, even if not positioned via layers,\n
nor via stylesheets or any other kind of "hard-coding"\n
- relatively and absolutely positioned layers (DIV elements).\n
Moreover, it provides extended DHTML abilities.\n
\n
LICENSE: LGPL\n
\n
This library is free software; you can redistribute it and/or\n
modify it under the terms of the GNU Lesser General Public\n
License (LGPL) as published by the Free Software Foundation; either\n
version 2.1 of the License, or (at your option) any later version.\n
\n
This library is distributed in the hope that it will be useful,\n
but WITHOUT ANY WARRANTY; without even the implied warranty of\n
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n
\n
For more details on the GNU Lesser General Public License,\n
see http://www.gnu.org/copyleft/lesser.html\n
*/\n
\n
\n
\n
\n
\n
// PATH TO THE TRANSPARENT 1*1 PX IMAGE (required by NS 4 as spacer)\n
var spacer = \'transparentpixel.gif\';\n
\n
\n
//var bmoved=new Array; //array where are stocked all the information when a block is moved (added by jonathan)\n
\n
//window.onerror = new Function(\'return true;\');\n
var lines=new Array;\n
var rt;\n
var lt;\n
var rb;\n
var lb;\n
var grips;\n
// Optional commands passed to SET_DHTML() on the html-page (g: may be applied globally, i: individually)\n
var CLONE = \'C10nE\'; // i img clone image\n
var COPY = \'C0pY\'; // i img create copies\n
var DETACH_CHILDREN = \'d37aCH\'; // i lyr detach images\n
var HORIZONTAL = \'H0r1Z\'; // i img,lyr horizontally draggable only\n
var MAXHEIGHT = \'m7x8I\'; // i img,lyr maximum height limit, "\n
var MAXOFFBOTTOM = \'m7xd0wN\'; // i img,lyr downward offset limit\n
var MAXOFFLEFT = \'m7x23Ft\'; // i img,lyr leftward offset limit\n
var MAXOFFRIGHT = \'m7x0Ff8\'; // i img,lyr rightward offset limit\n
var MAXOFFTOP = \'m7xu9\'; // i img,lyr upward offset limit\n
var MAXWIDTH = \'m7xW1\'; // i img,lyr maximum width limit, use with resizable or scalable\n
var MINWIDTH = \'m1nw1\'; // i img,lyr minimum width limit, " \n
var MINHEIGHT = \'m1n8I\'; // i img,lyr minimum height limit, "\n
var NO_ALT = \'no81T\'; // gi img disable alt and title attributes\n
var NO_DRAG = \'N0d4Ag\'; // i img,lyr disable draggability\n
var RESET_Z = \'r35E7z\'; // gi img,lyr reset z-index when dropped\n
var RESIZABLE = \'r5IZbl\'; // gi img,lyr resizable if <ctrl> or <shift> pressed\n
var SCALABLE = \'SCLbl\'; // gi img,lyr scalable "\n
var SCROLL = \'sC8lL\'; // gi img,lyr enable auto scroll functionality\n
var VERTICAL = \'V3Rt1C\'; // i img,lyr vertically draggable only\n
\n
var dd_cursors = new Array(\n
\t\'c:default\',\n
\t\'c:crosshair\',\n
\t\'c:e-resize\',\n
\t\'c:hand\',\n
\t\'c:help\',\n
\t\'c:move\',\n
\t\'c:n-resize\',\n
\t\'c:ne-resize\',\n
\t\'c:nw-resize\',\n
\t\'c:s-resize\',\n
\t\'c:se-resize\',\n
\t\'c:sw-resize\',\n
\t\'c:text\',\n
\t\'c:w-resize\',\n
\t\'c:wait\'\n
);\n
var dd_i = dd_cursors.length; while(dd_i--)\n
\teval(\'var CURSOR_\' + (dd_cursors[dd_i].substring(2).toUpperCase().replace(\'-\', \'_\')) + \' = "\' + dd_cursors[dd_i] + \'";\');\n
\n
\n
\n
function WZDD()\n
{\n
\tthis.n = navigator.userAgent.toLowerCase();\n
\tthis.db = (document.compatMode && document.compatMode.toLowerCase() != "backcompat")?\n
\t\tdocument.documentElement\n
\t\t: (document.body || null);\n
\tthis.op = !!(window.opera && document.getElementById);\n
\tthis.op6 = !!(this.op && !(this.db && this.db.innerHTML));\n
\tif (this.op && !this.op6) document.onmousedown = new Function(\'e\',\n
\t\t\'if (((e = e || window.event).target || e.srcElement).tagName == "IMAGE") return false;\');\n
\tthis.ie = !!(this.n.indexOf("msie") >= 0 && document.all && this.db && !this.op);\n
\tthis.iemac = !!(this.ie && this.n.indexOf("mac") >= 0);\n
\tthis.ie4 = !!(this.ie && !document.getElementById);\n
\tthis.n4 = !!(document.layers && typeof document.classes != "undefined");\n
\tthis.n6 = !!(typeof window.getComputedStyle != "undefined" && typeof document.createRange != "undefined");\n
\tthis.w3c = !!(!this.op && !this.ie && !this.n6 && document.getElementById);\n
\tthis.ce = !!(document.captureEvents && document.releaseEvents);\n
\tthis.px = (this.n4 || this.op6)? \'\' : \'px\';\n
}\n
var dd = new WZDD();\n
\n
dd.Int = function(d_x, d_y)\n
{\n
\treturn isNaN(d_y = parseInt(d_x))? 0 : d_y;\n
};\n
\n
dd.getWndW = function()\n
{\n
\treturn dd.Int(\n
\t\t(dd.db && !dd.op && !dd.w3c && dd.db.clientWidth)? dd.db.clientWidth\n
\t\t: (window.innerWidth || 0)\n
\t);\n
};\n
\n
dd.getWndH = function()\n
{\n
\treturn dd.Int(\n
\t\t(dd.db && !dd.op && !dd.w3c && dd.db.clientHeight)? dd.db.clientHeight\n
\t\t: (window.innerHeight || 0)\n
\t);\n
};\n
\n
dd.getScrollX = function()\n
{\n
\treturn dd.Int(window.pageXOffset || (dd.db? dd.db.scrollLeft : 0));\n
};\n
\n
dd.getScrollY = function()\n
{\n
\treturn dd.Int(window.pageYOffset || (dd.db? dd.db.scrollTop : 0));\n
};\n
\n
dd.getPageXY = function(d_o)\n
{\n
\tif (dd.n4 && d_o)\n
\t{\n
\t\tdd.x = d_o.pageX || 0;\n
\t\tdd.y = d_o.pageY || 0;\n
\t}\n
\telse\n
\t{\n
\t\tdd.x = dd.y = 0; //global helper vars\n
\t\twhile (d_o)\n
\t\t{\n
\t\t\tdd.x += dd.Int(d_o.offsetLeft);\n
\t\t\tdd.y += dd.Int(d_o.offsetTop);\n
\t\t\td_o = d_o.offsetParent || null;\n
\t\t}\n
\t}\n
};\n
\n
dd.getCssXY = function(d_o)\n
{\n
\tif (d_o.div)\n
\t{\n
\t\tif (dd.n4)\n
\t\t{\n
\t\t\td_o.cssx = d_o.div.x;\n
\t\t\td_o.cssy = d_o.div.y;\n
\t\t}\n
\t\telse if (dd.ie4)\n
\t\t{\n
\t\t\td_o.cssx = d_o.css.pixelLeft;\n
\t\t\td_o.cssy = d_o.css.pixelTop;\n
\t\t}\n
\t\telse\n
\t\t{\n
\t\t\td_o.css.left = d_o.css.top = 0 + dd.px;\n
\t\t\tdd.getPageXY(d_o.div);\n
\t\t\td_o.cssx = d_o.x - dd.x;\n
\t\t\td_o.cssy = d_o.y - dd.y;\n
\t\t\td_o.css.left = d_o.cssx + dd.px;\n
\t\t\td_o.css.top = d_o.cssy + dd.px;\n
\t\t}\n
\t}\n
\telse\n
\t{\n
\t\td_o.cssx = 0;\n
\t\td_o.cssy = 0;\n
\t}\n
};\n
\n
dd.getImgW = function(d_o)\n
{\n
\treturn d_o? dd.Int(d_o.width) : 0;\n
};\n
\n
dd.getImgH = function(d_o)\n
{\n
\treturn d_o? dd.Int(d_o.height) : 0;\n
};\n
\n
dd.getDivW = function(d_o)\n
{\n
\treturn dd.Int(\n
\t\tdd.n4? (d_o.div? d_o.div.clip.width : 0)\n
\t\t: d_o.div? (d_o.div.offsetWidth || d_o.css.pixelWidth || d_o.css.width || 0)\n
\t\t: 0\n
\t);\n
};\n
\n
dd.getDivH = function(d_o)\n
{\n
\treturn dd.Int(\n
\t\tdd.n4? (d_o.div? d_o.div.clip.height : 0)\n
\t\t: d_o.div? (d_o.div.offsetHeight || d_o.css.pixelHeight || d_o.css.height || 0)\n
\t\t: 0\n
\t);\n
};\n
\n
dd.getWH = function(d_o)\n
{\n
\td_o.w = dd.getDivW(d_o);\n
\td_o.h = dd.getDivH(d_o);\n
\tif (d_o.css)\n
\t{\n
\t\td_o.css.width = d_o.w + dd.px;\n
\t\td_o.css.height = d_o.h + dd.px;\n
\t\td_o.dw = dd.getDivW(d_o)-d_o.w;\n
\t\td_o.dh = dd.getDivH(d_o)-d_o.h;\n
\t\td_o.css.width = (d_o.w-d_o.dw) + dd.px;\n
\t\td_o.css.height = (d_o.h-d_o.dh) + dd.px;\n
\t}\n
\telse d_o.dw = d_o.dh = 0;\n
};\n
\n
dd.getCssProp = function(d_o, d_pn6, d_pstyle, d_pn4)\n
{\n
\tif (d_o && dd.n6) return \'\'+window.getComputedStyle(d_o, null).getPropertyValue(d_pn6);\n
\tif (d_o && d_o.currentStyle) return \'\'+eval(\'d_o.currentStyle.\'+d_pstyle);\n
\tif (d_o && d_o.style) return \'\'+eval(\'d_o.style.\'+d_pstyle);\n
\tif (d_o && dd.n4) return \'\'+eval(\'d_o.\'+d_pn4);\n
\treturn \'\';\n
};\n
\n
dd.getDiv = function(d_x, d_d)\n
{\n
\td_d = d_d || document;\n
\tif (dd.n4)\n
\t{\n
\t\tif (d_d.layers[d_x]) return d_d.layers[d_x];\n
\t\tfor (var d_i = d_d.layers.length; d_i--;)\n
\t\t{\n
\t\t\tvar d_y = dd.getDiv(d_x, d_d.layers[d_i].document);\n
\t\t\tif (d_y) return d_y;\n
\t\t}\n
\t}\n
\tif (dd.ie) return d_d.all[d_x] || null;\n
\tif (d_d.getElementById) return d_d.getElementById(d_x) || null;\n
\treturn null;\n
};\n
\n
dd.getImg = function(d_o, d_nm, d_xy, d_w)\n
{\n
\td_w = d_w || window;\n
\tvar d_img;\n
\tif ((d_img = d_w.document.images[d_nm]) && d_img.name == d_nm)\n
\t{\n
\t\tif (d_xy)\n
\t\t{\n
\t\t\tif (dd.n4)\n
\t\t\t{\n
\t\t\t\tdd.getPageXY(d_w);\n
\t\t\t\td_o.defx = d_img.x + dd.x;\n
\t\t\t\td_o.defy = d_img.y + dd.y;\n
\t\t\t}\n
\t\t\telse\n
\t\t\t{\n
\t\t\t\tdd.getPageXY(d_img);\n
\t\t\t\td_o.defx = dd.x;\n
\t\t\t\td_o.defy = dd.y;\n
\t\t\t}\n
\t\t}\n
\t\treturn d_img;\n
\t}\n
\tif (dd.n4) for (var d_i = d_w.document.layers.length; d_i--;)\n
\t{\n
\t\tvar d_y = dd.getImg(d_o, d_nm, d_xy, d_w.document.layers[d_i]);\n
\t\tif (d_y) return d_y;\n
\t}\n
\treturn null;\n
};\n
\n
dd.getParent = function(d_o)\n
{\n
\tif (dd.n4)\n
\t{\n
\t\tfor (var d_p, d_i = dd.elements.length; d_i--;)\n
\t\t{\n
\t\t\tif (!((d_p = dd.elements[d_i]).is_image) && d_p.div && (d_p.div.document.layers[d_o.name] || d_o.oimg && d_p.div.document.images[d_o.oimg.name]))\n
\t\t\t\td_p.addChild(d_o, d_p.detach, 1);\n
\t\t} \n
\t}\n
\telse\n
\t{\n
\t\tvar d_p = d_o.is_image? dd.getImg(d_o, d_o.oimg.name) : (d_o.div || null);\n
\t\twhile (d_p && !!(d_p = d_p.offsetParent || d_p.parentNode || null))\n
\t\t{\n
\t\t\tif (d_p.ddObj)\n
\t\t\t{\n
\t\t\t\td_p.ddObj.addChild(d_o, d_p.ddObj.detach, 1);\n
\t\t\t\tbreak;\n
\t\t\t}\n
\t\t}\n
\t}\n
};\n
\n
dd.getCmd = function(d_o, d_cmd, d_cmdStr)\n
{\n
\tvar d_i = d_o.id.indexOf(d_cmd), d_j,\n
\td_y = (d_i >= 0)*1;\n
\tif (d_y)\n
\t{\n
\t\td_j = d_i+d_cmd.length;\n
\t\tif (d_cmdStr) d_o.cmd += d_o.id.substring(d_i, d_j);\n
\t\td_o.id = d_o.id.substring(0, d_i) + d_o.id.substring(d_j);\n
\t}\n
\treturn d_y;\n
};\n
\n
dd.getCmdVal = function(d_o, d_cmd, d_cmdStr, int0)\n
{\n
\tvar d_i = d_o.id.indexOf(d_cmd), d_j,\n
\td_y = (d_o.id.indexOf(d_cmd) >= 0)? dd.Int(d_o.id.substring(d_o.id.indexOf(d_cmd)+d_cmd.length)) : int0? -1 : 0;\n
\tif (!int0 && d_y || int0 && d_y >= 0)\n
\t{\n
\t\td_j = d_i+d_cmd.length+(""+d_y).length;\n
\t\tif (d_cmdStr) d_o.cmd += d_o.id.substring(d_i, d_j);\n
\t\td_o.id = d_o.id.substring(0, d_i) + d_o.id.substring(d_j);\n
\t}\n
\treturn d_y;\n
};\n
\n
dd.addElt = function(d_o, d_p)\n
{\n
\tdd.elements[dd.elements.length] = dd.elements[d_o.name] = d_o;\n
\tif (d_p) d_p.copies[d_p.copies.length] = d_p.copies[d_o.name] = d_o;\n
};\n
\n
dd.mkWzDom = function()\n
{\n
\tvar d_i = dd.elements.length; while(d_i--) dd.getParent(dd.elements[d_i]);\n
\td_i = dd.elements.length; while(d_i--)\n
\t\td_o = dd.elements[d_i];\n
\t\tif (d_o.children && !d_o.parent)\n
\t\t{\n
\t\t\tvar d_j = d_o.children.length; while(d_j--)\n
\t\t\t\td_o.children[d_j].setZ(d_o.z+d_o.children[d_j].z, 1);\n
\t\t}\n
};\n
\n
dd.addProps = function(d_o)\n
{\n
\tvar d_i, d_c;\n
\tif (d_o.is_image)\n
\t{\n
\t\td_o.div = dd.getDiv(d_o.id);\n
\t\tif (d_o.div && typeof d_o.div.style != "undefined") d_o.css = d_o.div.style;\n
\t\td_o.nimg = (dd.n4 && d_o.div)? d_o.div.document.images[0] : (document.images[d_o.id+\'NImG\'] || null);\n
\t\tif (!d_o.noalt && !dd.noalt)\n
\t\t{\n
\t\t\td_o.nimg.alt = d_o.oimg.alt || \'\';\n
\t\t\tif (d_o.oimg.title) d_o.nimg.title = d_o.oimg.title;\n
\t\t}\n
\t\td_o.bgColor = \'\';\n
\t}\n
\telse\n
\t{\n
\t\td_o.bgColor = dd.getCssProp(d_o.div, \'background-color\',\'backgroundColor\',\'bgColor\').toLowerCase();\n
\t\tif (dd.n6 && d_o.div)\n
\t\t{\n
\t\t\tif ((d_c = d_o.bgColor).indexOf(\'rgb\') >= 0)\n
\t\t\t{\n
\t\t\t\td_c = d_c.substring(4, d_c.length-1).split(\',\');\n
\t\t\t\td_o.bgColor = \'#\';\n
\t\t\t\tfor (var d_i = 0; d_i < d_c.length; d_i++) d_o.bgColor += parseInt(d_c[d_i]).toString(0x10);\n
\t\t\t}\n
\t\t\telse d_o.bgColor = d_c;\n
\t\t}\n
\t}\n
\tif (dd.scalable) d_o.scalable = d_o.resizable^1;\n
\telse if (dd.resizable) d_o.resizable = d_o.scalable^1;\n
\td_o.setZ(d_o.defz);\n
\td_o.cursor = d_o.cursor || dd.cursor || \'auto\';\n
\td_o._setCrs(d_o.nodrag? \'auto\' : d_o.cursor);\n
\td_o.visible = true;\n
};\n
\n
dd.initz = function()\n
{\n
\tif (!(dd && (dd.n4 || dd.n6 || dd.ie || dd.op || dd.w3c))) return;\n
\tif (dd.op6) WINSZ(2);\n
\telse if (dd.n6 || dd.ie || dd.op && !dd.op6 || dd.w3c) dd.recalc(1);\n
\tvar d_drag = (document.onmousemove == DRAG),\n
\td_resize = (document.onmousemove == RESIZE);\n
\tif (dd.loadFunc) dd.loadFunc();\n
\tif (d_drag && document.onmousemove != DRAG) dd.setEvtHdl(1, DRAG);\n
\telse if (d_resize && document.onmousemove != RESIZE) dd.setEvtHdl(1, RESIZE);\n
\tif ((d_drag || d_resize) && document.onmouseup != DROP) dd.setEvtHdl(2, DROP);\n
\tdd.setEvtHdl(0, PICK);\n
};\n
\n
dd.finlz = function()\n
{\n
\tif (dd.ie && dd.elements)\n
\t{\n
\t\tvar d_i = dd.elements.length; while (d_i--)\n
\t\t\tdd.elements[d_i].del();\n
\t}\n
};\n
\n
dd.setEvtHdl = function(d_typ, d_func)\n
{\n
\tif (!d_typ)\n
\t{\n
\t\tif (document.onmousedown != d_func) dd.downFunc = document.onmousedown || null;\n
\t\tdocument.onmousedown = d_func;\n
\t}\n
\telse if (d_typ&1)\n
\t{\n
\t\tif (document.onmousemove != d_func) dd.moveFunc = document.onmousemove || null;\n
\t\tdocument.onmousemove = d_func;\n
\t}\n
\telse\n
\t{\n
\t\tif (document.onmouseup != d_func) dd.upFunc = document.onmouseup || null;\n
\t\tdocument.onmouseup = d_func;\n
\t}\n
\tif (dd.ce)\n
\t{\n
\t\tvar d_e = (!d_typ)? Event.MOUSEDOWN : (d_typ&1)? Event.MOUSEMOVE : Event.MOUSEUP;\n
\t\td_func? document.captureEvents(d_e) : document.releaseEvents(d_e);\n
\t}\n
};\n
\n
dd.evt = function(d_e)\n
{\n
\tthis.but = (this.e = d_e || window.event).which || this.e.button || 0;\n
\tthis.button = (this.e.type == \'mousedown\')? this.but\n
\t\t: (dd.e && dd.e.button)? dd.e.button\n
\t\t: 0;\n
\tthis.src = this.e.target || this.e.srcElement || null;\n
\tthis.src.tag = ("" + (this.src.tagName || this.src)).toLowerCase();\n
\tthis.x = dd.Int(this.e.pageX || this.e.clientX || 0);\n
\tthis.y = dd.Int(this.e.pageY || this.e.clientY || 0);\n
\tif (dd.ie)\n
\t{\n
\t\tthis.x += dd.getScrollX() - (dd.ie && !dd.iemac)*1;\n
\t\tthis.y += dd.getScrollY() - (dd.ie && !dd.iemac)*1;\n
\t}\n
\tthis.modifKey = this.e.modifiers? this.e.modifiers&Event.SHIFT_MASK : (this.e.shiftKey || false);\n
};\n
\n
dd.recalc = function(d_x)\n
{\n
\tif (dd.elements)\n
\t{\n
\t\tvar d_o, d_i = dd.elements.length; while(d_i--)\n
\t\t{\n
\t\t\tif (!(d_o = dd.elements[d_i]).is_image && d_o.div)\n
\t\t\t{\n
\t\t\t\tdd.getWH(d_o);\n
\t\t\t\tif (d_o.div.pos_rel)\n
\t\t\t\t{\n
\t\t\t\t\tdd.getPageXY(d_o.div);\n
\t\t\t\t\tvar d_dx = dd.x - d_o.x, d_dy = dd.y - d_o.y;\n
\t\t\t\t\td_o.defx += d_dx;\n
\t\t\t\t\td_o.x += d_dx;\n
\t\t\t\t\td_o.defy += d_dy;\n
\t\t\t\t\td_o.y += d_dy;\n
\t\t\t\t\tvar d_p, d_j = d_o.children.length; while(d_j--)\n
\t\t\t\t\t{\n
\t\t\t\t\t\tif (!(d_p = d_o.children[d_j]).detached && (d_o != d_p.defparent || !(d_p.is_image && dd.getImg(d_p, d_p.oimg.name, 1))))\n
\t\t\t\t\t\t{\n
\t\t\t\t\t\t\td_p.defx += d_dx;\n
\t\t\t\t\t\t\td_p.defy += d_dy;\n
\t\t\t\t\t\t\td_p.moveBy(d_dx, d_dy);\n
\t\t\t\t\t\t}\n
\t\t\t\t\t}\n
\t\t\t\t}\n
\t\t\t}\n
\t\t\telse if (d_o.is_image && !dd.op6 && !dd.n4)\n
\t\t\t{\n
\t\t\t\tif (dd.n6 && d_x && !d_o.defw) d_o.resizeTo(d_o.defw = dd.getImgW(d_o.oimg), d_o.defh = dd.getImgH(d_o.oimg));\n
\t\t\t\tvar d_defx = d_o.defx, d_defy = d_o.defy;\n
\t\t\t\tif (!(d_o.parent && d_o.parent != d_o.defparent) && (d_x || !d_o.detached || d_o.horizontal || d_o.vertical) && dd.getImg(d_o, d_o.oimg.name, 1))\n
\t\t\t\t\td_o.moveBy(d_o.defx-d_defx, d_o.defy-d_defy);\n
\t\t\t}\n
\t\t}\n
\t }\n
};\n
\n
\n
\n
function WINSZ(d_x)\n
{\n
\tif (d_x)\n
\t{\n
\t\tif (dd.n4 || dd.op6 && d_x&2)\n
\t\t{\n
\t\t\tdd.iW = innerWidth;\n
\t\t\tdd.iH = innerHeight;\n
\t\t\tif (dd.op6) setTimeout("WINSZ()", 0x1ff);\n
\t\t}\n
\t\twindow.onresize = new Function(\'WINSZ();\');\n
\t}\n
\telse if ((dd.n4 || dd.op6) && (innerWidth != dd.iW || innerHeight != dd.iH)) location.reload();\n
\telse if (dd.op6) setTimeout("WINSZ()", 0x1ff);\n
\telse if (!dd.n4) setTimeout(\'dd.recalc()\', 0xa);\n
}\n
WINSZ(1);\n
\n
\n
\n
function DDObj(d_o, d_i)\n
{\n
\tthis.id = d_o;\n
\tthis.cmd = \'\';\n
\tthis.cpy_n = dd.getCmdVal(this, COPY);\n
\tthis.maxoffb = dd.getCmdVal(this, MAXOFFBOTTOM, 0, 1);\n
\tthis.maxoffl = dd.getCmdVal(this, MAXOFFLEFT, 0, 1);\n
\tthis.maxoffr = dd.getCmdVal(this, MAXOFFRIGHT, 0, 1);\n
\tthis.maxofft = dd.getCmdVal(this, MAXOFFTOP, 0, 1);\n
\tvar d_j = dd_cursors.length; while(d_j--)\n
\t\tif (dd.getCmd(this, dd_cursors[d_j], 1)) this.cursor = dd_cursors[d_j].substring(2);\n
\tthis.clone = dd.getCmd(this, CLONE, 1);\n
\tthis.detach = dd.getCmd(this, DETACH_CHILDREN);\n
\tthis.scalable = dd.getCmd(this, SCALABLE, 1);\n
\tthis.horizontal = dd.getCmd(this, HORIZONTAL);\n
\tthis.noalt = dd.getCmd(this, NO_ALT, 1);\n
\tthis.nodrag = dd.getCmd(this, NO_DRAG);\n
\tthis.scroll = dd.getCmd(this, SCROLL, 1);\n
\tthis.resizable = dd.getCmd(this, RESIZABLE, 1);\n
\tthis.re_z = dd.getCmd(this, RESET_Z, 1);\n
\tthis.vertical = dd.getCmd(this, VERTICAL);\n
\tthis.maxw = dd.getCmdVal(this, MAXWIDTH, 1, 1);\n
\tthis.minw = Math.abs(dd.getCmdVal(this, MINWIDTH, 1, 1));\n
\tthis.maxh = dd.getCmdVal(this, MAXHEIGHT, 1, 1);\n
\tthis.minh = Math.abs(dd.getCmdVal(this, MINHEIGHT, 1, 1));\n
this.moved = 0\n
\tthis.name = this.id + (d_i || \'\');\n
\tthis.oimg = dd.getImg(this, this.id, 1);\n
\tthis.is_image = !!this.oimg;\n
\tthis.copies = new Array();\n
\tthis.children = new Array();\n
\tthis.parent = this.original = null;\n
\tif (this.oimg)\n
\t{\n
\t\tthis.id += \'div\' + (d_i || \'\');\n
\t\tthis.w = dd.getImgW(this.oimg);\n
\t\tthis.h = dd.getImgH(this.oimg);\n
\t\tthis.dw = this.dh = 0;\n
\t\tthis.defz = dd.Int(dd.getCssProp(this.oimg, \'z-index\',\'zIndex\',\'zIndex\')) || 1;\n
\t\tthis.defsrc = this.src = this.oimg.src;\n
\t\tthis.htm = \'<img name="\' + this.id + \'NImG"\'+\n
\t\t\t\' src="\' + this.oimg.src + \'" \'+\n
\t\t\t\'width="\' + this.w + \'" height="\' + this.h + \'">\';\n
\t\tthis.t_htm = \'<div id="\' + this.id +\n
\t\t\t\'" style="position:absolute;\'+\n
\t\t\t\'left:\' + (this.cssx = this.x = this.defx) + \'px;\'+\n
\t\t\t\'top:\' + (this.cssy = this.y = this.defy) + \'px;\'+\n
\t\t\t\'width:\' + this.w + \'px;\'+\n
\t\t\t\'height:\' + this.h + \'px;">\'+\n
\t\t\tthis.htm + \'<\\/div>\';\n
\t}\n
\telse\n
\t{\n
\t\tif (!!(this.div = dd.getDiv(this.id)) && typeof this.div.style != "undefined") this.css = this.div.style;\n
\t\tdd.getWH(this);\n
\t\tif (this.div)\n
\t\t{\n
\t\t\tthis.div.ddObj = this;\n
\t\t\tthis.div.pos_rel = ("" + (this.div.parentNode? this.div.parentNode.tagName : this.div.parentElement? this.div.parentElement.tagName : \'\').toLowerCase().indexOf(\'body\') < 0);\n
\t\t}\n
\t\tdd.getPageXY(this.div);\n
\t\tthis.defx = this.x = dd.x;\n
\t\tthis.defy = this.y = dd.y;\n
\t\tdd.getCssXY(this);\n
\t\tthis.defz = dd.Int(dd.getCssProp(this.div, \'z-index\',\'zIndex\',\'zIndex\'));\n
\t}\n
\tthis.defw = this.w || 0;\n
\tthis.defh = this.h || 0;\n
}\n
\n
DDObj.prototype.moveBy = function(d_x, d_y, d_kds, d_o)\n
{\n
\tif (!this.div) return;\n
\tthis.x += (d_x = dd.Int(d_x));\n
\tthis.y += (d_y = dd.Int(d_y));\n
\tif (!d_kds || this.is_image || this.parent != this.defparent)\n
\t{\n
\t\t(d_o = this.css || this.div).left = (this.cssx += d_x) + dd.px;\n
\t\td_o.top = (this.cssy += d_y) + dd.px;\n
\t}\n
\tvar d_i = this.children.length; while (d_i--)\n
\t{\n
\t\tif (!(d_o = this.children[d_i]).detached) d_o.moveBy(d_x, d_y, 1);\n
\t\td_o.defx += d_x;\n
\t\td_o.defy += d_y;\n
\t}\n
};\n
\n
DDObj.prototype.moveTo = function(d_x, d_y)\n
{\n
\tthis.moveBy(dd.Int(d_x)-this.x, dd.Int(d_y)-this.y);\n
};\n
\n
DDObj.prototype.hide = function(d_m, d_o, d_p)\n
{\n
\tif (this.div && this.visible)\n
\t{\n
\t\td_p = this.css || this.div;\n
\t\tif (d_m && !dd.n4)\n
\t\t{\n
\t\t\tthis.display = dd.getCssProp(this.div, "display", "display", "display");\n
\t\t\tif (this.oimg)\n
\t\t\t{\n
\t\t\t\tthis.oimg.display = dd.getCssProp(this.oimg, "display", "display", "display");\n
\t\t\t\tthis.oimg.style.display = "none";\n
\t\t\t}\n
\t\t\td_p.display = "none";\n
\t\t\tdd.recalc();\n
\t\t}\n
\t\telse d_p.visibility = "hidden";\n
\t}\n
\tthis.visible = false;\n
\tvar d_i = this.children.length; while (d_i--)\n
\t\tif (!(d_o = this.children[d_i]).detached) d_o.hide(d_m);\n
};\n
\n
DDObj.prototype.show = function(d_o, d_p)\n
{\n
\tif (this.div)\n
\t{\n
\t\td_p = this.css || this.div;\n
\t\tif (d_p.display && d_p.display == "none")\n
\t\t{\n
\t\t\td_p.display = this.display || "block";\n
\t\t\tif (this.oimg) this.oimg.style.display = this.oimg.display || "inline";\n
\t\t\tdd.recalc();\n
\t\t}\n
\t\telse d_p.visibility = "visible";\n
\t}\n
\tthis.visible = true;\n
\tvar d_i = this.children.length; while (d_i--)\n
\t\tif (!(d_o = this.children[d_i]).detached) d_o.show();\n
};\n
\n
DDObj.prototype.resizeTo = function(d_w, d_h, d_o)\n
{\n
\tif (!this.div) return;\n
\td_w = (this.w = dd.Int(d_w))-this.dw;\n
\td_h = (this.h = dd.Int(d_h))-this.dh;\n
\tif (dd.n4)\n
\t{\n
\t\tthis.div.resizeTo(d_w, d_h);\n
\t\tif (this.is_image)\n
\t\t{\n
\t\t\tthis.write(\'<img src="\' + this.src + \'" width="\' + d_w + \'" height="\' + d_h + \'">\');\n
\t\t\t(this.nimg = this.div.document.images[0]).src = this.src;\n
\t\t}\n
\t}\n
\telse if (typeof this.css.pixelWidth != "undefined")\n
\t{\n
\t\tthis.css.pixelWidth = d_w;\n
\t\tthis.css.pixelHeight = d_h;\n
\t\tif (this.is_image)\n
\t\t{\n
\t\t\t(d_o = this.nimg.style).pixelWidth = d_w;\n
\t\t\td_o.pixelHeight = d_h;\n
\t\t}\n
\t}\n
\telse\n
\t{\n
\t\tthis.css.width = d_w + dd.px;\n
\t\tthis.css.height = d_h + dd.px;\n
\t\tif (this.is_image)\n
\t\t{\n
\t\t\t(d_o = this.nimg).width = d_w;\n
\t\t\td_o.height = d_h;\n
\t\t\tif (!d_o.complete) d_o.src = this.src;\n
\t\t}\n
\t}\n
};\n
\n
DDObj.prototype.resizeBy = function(d_dw, d_dh)\n
{\n
\tthis.resizeTo(this.w+dd.Int(d_dw), this.h+dd.Int(d_dh));\n
};\n
\n
DDObj.prototype.swapImage = function(d_x, d_cp)\n
{\n
\tif (!this.nimg) return;\n
\tthis.nimg.src = d_x;\n
\tthis.src = this.nimg.src;\n
\tif (d_cp)\n
\t{\n
\t\tvar d_i = this.copies.length; while (d_i--)\n
\t\t\tthis.copies[d_i].src = this.copies[d_i].nimg.src = this.nimg.src;\n
\t}\n
};\n
\n
DDObj.prototype.setBgColor = function(d_x)\n
{\n
\tif (dd.n4 && this.div) this.div.bgColor = d_x;\n
\telse if (this.css) this.css.background = d_x;\n
\tthis.bgColor = d_x;\n
};\n
\n
DDObj.prototype.write = function(d_x, d_o)\n
{\n
\tthis.text = d_x;\n
\tif (!this.div) return;\n
\tif (dd.n4)\n
\t{\n
\t\t(d_o = this.div.document).open();\n
\t\td_o.write(d_x);\n
\t\td_o.close();\n
\t\tdd.getWH(this);\n
\t}\n
\telse if (!dd.op6)\n
\t{\n
\t\tthis.css.height = \'auto\';\n
\t\tthis.div.innerHTML = d_x;\n
\t\tif (!dd.ie4) dd.recalc();\n
\t\tif (dd.ie4 || dd.n6) setTimeout(\'dd.recalc();\', 0); // n6.0: recalc twice\n
\t}\n
};\n
\n
DDObj.prototype.copy = function(d_n, d_p)\n
{\n
\tif (!this.oimg) return;\n
\td_n = d_n || 1;\n
\twhile (d_n--)\n
\t{\n
\t\tvar d_l = this.copies.length,\n
\t\td_o = new DDObj(this.name+this.cmd, d_l+1);\n
\t\tif (dd.n4)\n
\t\t{\n
\t\t\td_o.id = (d_p = new Layer(d_o.w)).name;\n
\t\t\td_p.clip.height = d_o.h;\n
\t\t\td_p.visibility = \'show\';\n
\t\t\t(d_p = d_p.document).open();\n
\t\t\td_p.write(d_o.htm);\n
\t\t\td_p.close();\n
\t\t}\n
\t\telse if (dd.db.insertAdjacentHTML) dd.db.insertAdjacentHTML("AfterBegin", d_o.t_htm);\n
\t\telse if (document.createElement && dd.db && dd.db.appendChild)\n
\t\t{\n
\t\t\tdd.db.appendChild(d_p = document.createElement(\'div\'));\n
\t\t\td_p.innerHTML = d_o.htm;\n
\t\t\td_p.id = d_o.id;\n
\t\t\td_p.style.position = \'absolute\';\n
\t\t\td_p.style.width = d_o.w + \'px\';\n
\t\t\td_p.style.height = d_o.h + \'px\';\n
\t\t}\n
\t\telse if (dd.db && dd.db.innerHTML) dd.db.innerHTML += d_o.t_htm;\n
\t\td_o.defz = this.defz+1+d_l;\n
\t\tdd.addProps(d_o);\n
\t\td_o.original = this;\n
\t\tdd.addElt(d_o, this);\n
\t\tif (this.parent)\n
\t\t{\n
\t\t\tthis.parent.addChild(d_o, this.detached);\n
\t\t\td_o.defparent = this.defparent;\n
\t\t}\n
\t\td_o.moveTo(d_o.defx = this.defx, d_o.defy = this.defy);\n
\t\tif (dd.n4) d_o.defsrc = d_o.src = this.defsrc;\n
\t\td_o.swapImage(this.src);\n
\t}\n
};\n
\n
DDObj.prototype.addChild = function(d_kd, detach, defp)\n
{\n
\tif (typeof d_kd != "object") d_kd = dd.elements[d_kd];\n
\tif (d_kd.parent && d_kd.parent == this || d_kd == this || !d_kd.is_image && d_kd.defparent && !defp) return;\n
\n
\tthis.children[this.children.length] = this.children[d_kd.name] = d_kd;\n
\td_kd.detached = detach || 0;\n
\tif (defp) d_kd.defparent = this;\n
\telse if (this == d_kd.defparent && d_kd.is_image) dd.getImg(this, d_kd.oimg.name, 1);\n
\tif (!d_kd.defparent || this != d_kd.defparent)\n
\t{\n
\t\td_kd.defx = d_kd.x;\n
\t\td_kd.defy = d_kd.y;\n
\t}\n
\tif (!detach)\n
\t{\n
\t\td_kd.defz = d_kd.defz+this.defz-(d_kd.parent? d_kd.parent.defz : 0)+(!d_kd.is_image*1);\n
\t\td_kd.setZ(d_kd.z+this.z-(d_kd.parent? d_kd.parent.z : 0)+(!d_kd.is_image*1), 1);\n
\t}\n
\tif (d_kd.parent) d_kd.parent._removeChild(d_kd, 1);\n
\td_kd.parent = this;\n
};\n
\n
DDObj.prototype._removeChild = function(d_kd, d_newp)\n
{\n
\tif (typeof d_kd != "object") d_kd = this.children[d_kd];\n
\tvar d_oc = this.children, d_nc = new Array();\n
\tfor (var d_i = 0; d_i < d_oc.length; d_i++)\n
\t\tif (d_oc[d_i] != d_kd) d_nc[d_nc.length] = d_oc[d_i];\n
\tthis.children = d_nc;\n
\td_kd.parent = null;\n
\tif (!d_newp)\n
\t{\n
\t\td_kd.detached = d_kd.defp = 0;\n
\t\tif (d_kd.is_image) dd.getImg(d_kd, d_kd.oimg.name, 1);\n
\t}\n
};\n
\n
DDObj.prototype.attachChild = function(d_kd)\n
{\n
\t(d_kd = (typeof d_kd != "object")? this.children[d_kd]: d_kd).detached = 0;\n
\td_kd.setZ(d_kd.defz + this.z-this.defz, 1);\n
};\n
\n
DDObj.prototype.detachChild = function(d_kd)\n
{\n
\t(d_kd = (typeof d_kd != "object")? this.children[d_kd]: d_kd).detached = 1;\n
};\n
\n
DDObj.prototype.setZ = function(d_x, d_kds)\n
{\n
\tif (d_kds)\n
\t{\n
\t\tvar d_dz = d_x-this.z,\n
\t\td_i = this.children.length; while (d_i--)\n
\t\t\tif (!(d_o = this.children[d_i]).detached) d_o.setZ(d_o.z+d_dz, 1);\n
\t}\n
\tdd.z = Math.max(dd.z, this.z = this.div? ((this.css || this.div).zIndex = d_x) : 0);\n
};\n
\n
DDObj.prototype.maximizeZ = function()\n
{\n
\tthis.setZ(dd.z+1, 1);\n
};\n
\n
DDObj.prototype._resetZ = function(d_o)\n
{\n
\tif (this.re_z || dd.re_z)\n
\t{\n
\t\tthis.setZ(this.defz);\n
\t\tvar d_i = this.children.length; while (d_i--)\n
\t\t\tif (!(d_o = this.children[d_i]).detached) d_o.setZ(d_o.defz);\n
\t}\n
};\n
\n
DDObj.prototype.setCursor = function(d_x)\n
{\n
\tthis._setCrs(this.cursor = (d_x.indexOf(\'c:\')+1)? d_x.substring(2) : d_x);\n
};\n
\n
DDObj.prototype._setCrs = function(d_x)\n
{\n
\tif (this.css) this.css.cursor = ((!dd.ie || dd.iemac) && d_x == \'hand\')? \'pointer\' : d_x;\n
};\n
\n
DDObj.prototype.setDraggable = function(d_x)\n
{\n
\tthis.nodrag = !d_x*1;\n
\tthis._setCrs(d_x? this.cursor : \'auto\');\n
};\n
\n
DDObj.prototype.setResizable = function(d_x)\n
{\n
\tthis.resizable = d_x*1;\n
\tif (d_x) this.scalable = 0;\n
};\n
\n
DDObj.prototype.setScalable = function(d_x)\n
{\n
\tthis.scalable = d_x*1;\n
\tif (d_x) this.resizable = 0;\n
};\n
\n
DDObj.prototype.del = function(d_os, d_o)\n
{\n
\tif (this.parent && this.parent._removeChild) this.parent._removeChild(this);\n
\tif (this.original)\n
\t{\n
\t\tthis.hide();\n
\t\tif (this.original.copies)\n
\t\t{\n
\t\t\td_os = new Array();\n
\t\t\tfor (var d_i = 0; d_i < this.original.copies.length; d_i++)\n
\t\t\t\tif ((d_o = this.original.copies[d_i]) != this) d_os[d_os.length] = d_os[d_o.name] = d_o;\n
\t\t\tthis.original.copies = d_os;\n
\t\t}\n
\t}\n
\telse if (this.is_image)\n
\t{\n
\t\tthis.hide();\n
\t\tif (this.oimg)\n
\t\t{\n
\t\t if (dd.n4) this.oimg.src = this.defsrc;\n
\t\t else this.oimg.style.visibility = \'visible\';\n
\t\t}\n
\t}\n
\telse if (this.moveTo)\n
\t{\n
\t\tif (this.css) this.css.cursor = \'default\';\n
\t\tthis.moveTo(this.defx, this.defy);\n
\t\tthis.resizeTo(this.defw, this.defh);\n
\t}\n
\td_os = new Array();\n
\tfor (var d_i = 0; d_i < dd.elements.length; d_i++)\n
\t{\n
\t\tif ((d_o = dd.elements[d_i]) != this) d_os[d_os.length] = d_os[d_o.name] = d_o;\n
\t\telse d_o._free();\n
\t}\n
\tdd.elements = d_os;\n
\tif (!dd.op6 && !dd.n4) dd.recalc();\n
};\n
\n
DDObj.prototype._free = function()\n
{\n
\tfor (var d_i in this)\n
\t\tthis[d_i] = null;\n
\tdd.elements[this.name] = null;\n
};\n
\n
\n
\n
dd.n4RectVis = function(vis)\n
{\n
\tfor (var d_i = 4; d_i--;)\n
\t{\n
\t\tdd.rectI[d_i].visibility = dd.rectA[d_i].visibility = vis? \'show\' : \'hide\';\n
\t\tif (vis) dd.rectI[d_i].zIndex = dd.rectA[d_i].zIndex = dd.z+2;\n
\t}\n
};\n
\n
dd.n4RectPos = function(d_o, d_x, d_y, d_w, d_h)\n
{\n
\td_o.x = d_x;\n
\td_o.y = d_y;\n
\td_o.clip.width = d_w;\n
\td_o.clip.height = d_h;\n
}; \n
\n
// NN4: draw im resize rectangle.\n
dd.n4Rect = function(d_w, d_h)\n
{\n
\tif (!dd.rectI)\n
\t{\n
\t\tdd.rectI = new Array();\n
\t\tdd.rectA = new Array();\n
\t}\n
\tif (!dd.rectI[0])\n
\t{\n
\t\tfor (var d_i = 4; d_i--;)\n
\t\t{\n
\t\t\t(dd.rectI[d_i] = new Layer(1)).bgColor = \'#000000\';\n
\t\t\t(dd.rectA[d_i] = new Layer(1)).bgColor = \'#ffffff\';\n
\t\t}\n
\t}\n
\tif (!dd.rectI[0].visibility || dd.rectI[0].visibility == \'hide\') dd.n4RectVis(1);\n
\tdd.obj.w = d_w;\n
\tdd.obj.h = d_h;\n
\tfor (var d_i = 4; d_i--;)\n
\t{\n
\t\tdd.n4RectPos(dd.rectI[d_i], dd.obj.x + (!(d_i-1)? (dd.obj.w-1) : 0), dd.obj.y + (!(d_i-2)? (dd.obj.h-1) : 0), d_i&1 || dd.obj.w, !(d_i&1) || dd.obj.h);\n
\t\tdd.n4RectPos(dd.rectA[d_i], !(d_i-1)? dd.rectI[1].x+1 : (dd.obj.x-1), !(d_i-2)? dd.rectI[2].y+1 : (dd.obj.y-1), d_i&1 || dd.obj.w+2, !(d_i&1) || dd.obj.h+2);\n
\t}\n
};\n
\n
dd.reszTo = function(d_w, d_h)\n
{\n
\tif (dd.n4 && dd.obj.is_image) dd.n4Rect(d_w, d_h);\n
\telse dd.obj.resizeTo(d_w, d_h);\n
};\n
\n
dd.embedVis = function(d_vis)\n
{\n
\tvar d_o = new Array(\'iframe\', \'applet\', \'embed\', \'object\');\n
\tvar d_i = d_o.length; while (d_i--)\n
\t{\n
\t\tvar d_p = dd.ie? document.all.tags(d_o[d_i]) : document.getElementsByTagName? document.getElementsByTagName(d_o[d_i]) : null;\n
\t\tif (d_p)\n
\t\t{\n
\t\t\tvar d_j = d_p.length; while (d_j--)\n
\t\t\t{\n
\t\t\t\tvar d_q = d_p[d_j];\n
\t\t\t\twhile (d_q.offsetParent || d_q.parentNode)\n
\t\t\t\t{\n
\t\t\t\t\tif ((d_q = d_q.parentNode || d_q.offsetParent || null) == dd.obj.div)\n
\t\t\t\t\t{\n
\t\t\t\t\t\td_p[d_j].style.visibility = d_vis;\n
\t\t\t\t\t\tbreak;\n
\t\t\t\t\t}\n
\t\t\t\t}\n
\t\t\t}\n
\t\t}\n
\t}\n
};\n
\n
dd.maxOffX = function(d_x, d_y)\n
{\n
\treturn (\n
\t\t(dd.obj.maxoffl+1 && (d_y = dd.obj.defx-dd.obj.maxoffl)-d_x > 0\n
\t\t|| dd.obj.maxoffr+1 && (d_y = dd.obj.defx+dd.obj.maxoffr)-d_x < 0)? d_y\n
\t\t: d_x\n
\t);\n
};\n
\n
dd.maxOffY = function(d_x, d_y)\n
{\n
\treturn (\n
\t\t(dd.obj.maxofft+1 && (d_y = dd.obj.defy-dd.obj.maxofft)-d_x > 0\n
\t\t|| dd.obj.maxoffb+1 && (d_y = dd.obj.defy+dd.obj.maxoffb)-d_x < 0)? d_y\n
\t\t: d_x\n
\t);\n
};\n
\n
dd.inWndW = function(d_x, d_y)\n
{\n
\tvar d_wx = dd.getScrollX(),\n
\td_ww = dd.getWndW();\n
\treturn (\n
\t\t((d_y = d_wx+2)-d_x > 0) || ((d_y = d_wx+d_ww+dd.obj.w-2)-d_x < 0)? d_y\n
\t\t: d_x\n
\t);\n
};\n
\n
dd.inWndH = function(d_x, d_y)\n
{\n
\tvar d_wy = dd.getScrollY(),\n
\td_wh = dd.getWndH();\n
\treturn (\n
\t\t((d_y = d_wy+2)-d_x > 0) || ((d_y = d_wy+d_wh+dd.obj.h-2)-d_x < 0)? d_y\n
\t\t: d_x\n
\t);\n
};\n
\n
// These two funcs limit the size of element when mouseresized.\n
// Implemented 22.5.2003 by Gregor L\xc3\x83\xc2\xbctolf <gregor@milou.ch>, modified by Walter Zorn\n
dd.limW = function(d_w)\n
{\n
\treturn (\n
\t\t(dd.obj.minw-d_w > 0)? dd.obj.minw\n
\t\t: (dd.obj.maxw > 0 && dd.obj.maxw-d_w < 0)? dd.obj.maxw\n
\t\t: d_w\n
\t);\n
};\n
\n
dd.limH = function(d_h)\n
{\n
\treturn (\n
\t\t(dd.obj.minh-d_h > 0)? dd.obj.minh\n
\t\t: (dd.obj.maxh > 0 && dd.obj.maxh-d_h < 0)? dd.obj.maxh\n
\t\t: d_h\n
\t);\n
};\n
\n
\n
// Optional autoscroll-page functionality. Courtesy Cedric Savarese.\n
// Implemented by Walter Zorn\n
function DDScroll()\n
{\n
\tif (!dd.obj || !dd.obj.scroll && !dd.scroll || dd.op || dd.ie4 || dd.whratio)\n
\t{\n
\t\tdd.scrx = dd.scry = 0;\n
\t\treturn;\n
\t}\n
\tvar d_bnd = 0x1c,\n
\td_wx = dd.getScrollX(), d_wy = dd.getScrollY();\n
\tif (dd.msmoved)\n
\t{\n
\t\tvar d_ww = dd.getWndW(), d_wh = dd.getWndH(), d_y;\n
\t\tdd.scrx = ((d_y = dd.e.x-d_ww-d_wx+d_bnd) > 0)? (d_y>>=2)*d_y\n
\t\t\t: ((d_y = d_wx+d_bnd-dd.e.x) > 0)? -(d_y>>=2)*d_y\n
\t\t\t: 0;\n
\t\tdd.scry = ((d_y = dd.e.y-d_wh-d_wy+d_bnd) > 0)? (d_y>>=2)*d_y\n
\t\t\t: ((d_y = d_wy+d_bnd-dd.e.y) > 0)? -(d_y>>=2)*d_y\n
\t\t\t: 0;\n
\t}\n
\tif (dd.scrx || dd.scry)\n
\t{\n
\t\twindow.scrollTo(\n
\t\t\td_wx + (dd.scrx = dd.obj.is_resized? dd.limW(dd.obj.w+dd.scrx)-dd.obj.w : dd.obj.vertical? 0 : (dd.maxOffX(dd.obj.x+dd.scrx)-dd.obj.x)),\n
\t\t\td_wy + (dd.scry = dd.obj.is_resized? dd.limH(dd.obj.h+dd.scry)-dd.obj.h : dd.obj.horizontal? 0 : (dd.maxOffY(dd.obj.y+dd.scry)-dd.obj.y))\n
\t\t);\n
\t\tdd.obj.is_dragged? dd.obj.moveTo(dd.obj.x+dd.getScrollX()-d_wx, dd.obj.y+dd.getScrollY()-d_wy)\n
\t\t\t: dd.reszTo(dd.obj.w+dd.getScrollX()-d_wx, dd.obj.h+dd.getScrollY()-d_wy);\n
\t}\n
\tdd.msmoved = 0;\n
\twindow.setTimeout(\'DDScroll()\', 0x33);\n
}\n
\n
\n
\n
function PICK(d_ev)\n
{\n
\tdd.e = new dd.evt(d_ev);\n
\tif (dd.e.x >= dd.getWndW()+dd.getScrollX() || dd.e.y >= dd.getWndH()+dd.getScrollY()) return true; // on scrollbar\n
\tvar d_o, d_cmp = -1, d_i = dd.elements.length; while (d_i--)\n
\t{\n
\t\td_o = dd.elements[d_i];\n
\t\tif (dd.n4 && dd.e.but > 1 && dd.e.src == d_o.oimg && !d_o.clone) return false;\n
\t\tif (d_o.visible && dd.e.but <= 1 && dd.e.x >= d_o.x && dd.e.x <= d_o.x+d_o.w && dd.e.y >= d_o.y && dd.e.y <= d_o.y+d_o.h)\n
\t\t{\n
\t\t\tif (d_o.z > d_cmp && dd.e.src.tag.indexOf(\'input\') < 0 && dd.e.src.tag.indexOf(\'textarea\') < 0 && dd.e.src.tag.indexOf(\'select\') < 0 && dd.e.src.tag.indexOf(\'option\') < 0)\n
\t\t\t{\n
\t\t\t\td_cmp = d_o.z;\n
\t\t\t\tdd.obj = d_o;\n
\t\t\t}\n
\t\t}\n
\t}\n
\tif (dd.obj)\n
\t{\n
\t\tif (dd.obj.nodrag) dd.obj = null;\n
\t\telse\n
\t\t{\n
\t\t\tdd.e.e.cancelBubble = true;\n
\t\t\tvar d_rsz = dd.e.modifKey && (dd.obj.resizable || dd.obj.scalable);\n
\t\t\tif (dd.op && !dd.op6)\n
\t\t\t{\n
\t\t\t\t(d_o = document.getElementById(\'OpBlUr\')).style.pixelLeft = dd.e.x;\n
\t\t\t\td_o.style.pixelTop = dd.e.y;\n
\t\t\t\t(d_o = d_o.children[0].children[0]).focus();\n
\t\t\t\td_o.blur();\n
\t\t\t}\n
\t\t\telse if (dd.ie && !dd.ie4)\n
\t\t\t{\n
\t\t\t\tif (document.selection && document.selection.empty) document.selection.empty();\n
\t\t\t\tdd.db.onselectstart = function()\n
\t\t\t\t{\n
\t\t\t\t\tevent.returnValue = false;\n
\t\t\t\t};\n
\t\t\t}\n
\t\t\tif (d_rsz)\n
\t\t\t{\n
\t\t\t\tdd.obj._setCrs(\'se-resize\');\n
\t\t\t\tdd.obj.is_resized = 1;\n
\t\t\t\tdd.whratio = dd.obj.scalable? dd.obj.defw/dd.obj.defh : 0;\n
\t\t\t\tif (dd.ie)\n
\t\t\t\t{\n
\t\t\t\t\tif (dd.ie4)\n
\t\t\t\t\t{\n
\t\t\t\t\t\twindow.dd_x = dd.getScrollX();\n
\t\t\t\t\t\twindow.dd_y = dd.getScrollY();\n
\t\t\t\t\t}\n
\t\t\t\t\tsetTimeout(\n
\t\t\t\t\t\t\'if (dd.obj && document.selection && document.selection.empty)\'+\n
\t\t\t\t\t\t\'{\'+\n
\t\t\t\t\t\t\t\'document.selection.empty();\'+\n
\t\t\t\t\t\t\t\'if (dd.ie4) window.scrollTo(window.dd_x, window.dd_y);\'+\n
\t\t\t\t\t\t\'}\'\n
\t\t\t\t\t,0);\n
\t\t\t\t}\n
\t\t\t\tdd.setEvtHdl(1, RESIZE);\n
\t\t\t\tdd.reszTo(dd.obj.w, dd.obj.h);\n
\t\t\t}\n
\t\t\telse if (!dd.obj.nodrag)\n
\t\t\t{\n
\t\t\t\tdd.obj.is_dragged = 1;\n
\t\t\t\tdd.setEvtHdl(1, DRAG);\n
\t\t\t}\n
\t\t\tdd.setEvtHdl(2, DROP);\n
\t\t\tdd.embedVis(\'hidden\');\n
\t\t\tdd.obj.maximizeZ();\n
\t\t\tdd.ofx = dd.obj.x+dd.obj.w-dd.e.x;\n
\t\t\tdd.ofy = dd.obj.y+dd.obj.h-dd.e.y;\n
\t\t\tif (window.my_PickFunc) my_PickFunc();\n
\t\t\tDDScroll();\n
\t\t\treturn !(\n
\t\t\t\tdd.obj.is_resized\n
\t\t\t\t|| dd.n4 && dd.obj.is_image\n
\t\t\t\t|| dd.n6 || dd.w3c\n
\t\t\t);\n
\t\t}\n
\t}\n
\tif (dd.downFunc) return dd.downFunc(d_ev);\n
\treturn true;\n
}\n
\n
function DRAG(d_ev)\n
{\n
\tif (!dd.obj || !dd.obj.visible) return true;\n
\tif (dd.ie4 || dd.w3c || dd.n6 || dd.obj.children.length > 0xf)\n
\t{\n
\t\tif (dd.wait) return false;\n
\t\tdd.wait = 1;\n
\t\tsetTimeout(\'dd.wait = 0;\', 5);\n
\t}\n
\tdd.e = new dd.evt(d_ev);\n
\tif (dd.ie && !dd.e.but)\n
\t{\n
\t\tDROP(d_ev);\n
\t\treturn true;\n
\t}\n
\tdd.msmoved = 1;\n
\tdd.obj.moveTo(\n
\t\tdd.obj.vertical? dd.obj.x : dd.maxOffX(dd.inWndW(dd.ofx+dd.e.x)-dd.obj.w),\n
\t\tdd.obj.horizontal? dd.obj.y : dd.maxOffY(dd.inWndH(dd.ofy+dd.e.y)-dd.obj.h)\n
\t);\n
\n
\tif (window.my_DragFunc) my_DragFunc();\n
\treturn false;\n
}\n
\n
function RESIZE(d_ev)\n
{\n
\tif (!dd.obj || !dd.obj.visible) return true;\n
\tif (dd.wait) return false;\n
\tdd.wait = 1;\n
\tsetTimeout(\'dd.wait = 0;\', 5);\n
\tdd.e = new dd.evt(d_ev);\n
\tif (dd.ie && !dd.e.but)\n
\t{\n
\t\tDROP(d_ev);\n
\t\treturn true;\n
\t}\n
\tdd.msmoved = 1;\n
\tvar d_w = dd.limW(dd.inWndW(dd.ofx+dd.e.x)-dd.obj.x);\n
\tif (!dd.whratio) var d_h = dd.limH(dd.inWndH(dd.ofy+dd.e.y)-dd.obj.y);\n
\telse\n
\t{\n
\t\tvar d_h = dd.limH(dd.inWndH(Math.round(d_w/dd.whratio)+dd.obj.y)-dd.obj.y);\n
\t\td_w = Math.round(d_h*dd.whratio);\n
\n
}\n
\tdd.reszTo(d_w, d_h);\n
\tif (window.my_ResizeFunc) my_ResizeFunc();\n
\treturn false;\n
}\n
\n
function DROP(d_ev)\n
{\n
\tif (dd.obj)\n
\t{\n
\t\tif (dd.obj.is_dragged)\n
\t\t{\n
\t\t\tif (!dd.obj.is_image) dd.getWH(dd.obj);\n
\t\t}\n
\t\telse if (dd.n4)\n
\t\t{\n
\t\t\tif (dd.obj.is_image)\n
\t\t\t{\n
\t\t\t\tdd.n4RectVis(0);\n
\t\t\t\tdd.obj.resizeTo(dd.obj.w, dd.obj.h);\n
\t\t\t}\n
\t\t}\n
\t\tif (!dd.n4 && !dd.op6 || !dd.obj.is_image) dd.recalc();\n
\t\tdd.setEvtHdl(1, dd.moveFunc);\n
\t\tdd.setEvtHdl(2, dd.upFunc);\n
\t\tif (dd.db) dd.db.onselectstart = null;\n
\t\tdd.obj._setCrs(dd.obj.cursor);\n
\t\tdd.embedVis(\'visible\');\n
\t\tdd.obj._resetZ();\n
\t\tif (window.my_DropFunc)\n
\t\t{\n
\t\t\tdd.e = new dd.evt(d_ev);\n
\t\t\tmy_DropFunc();\n
\t\t}\n
\t\tdd.msmoved = dd.obj.is_dragged = dd.obj.is_resized = dd.whratio = 0;\n
\t\tdd.obj = null;\n
\t}\n
\tdd.setEvtHdl(0, PICK);\n
}\n
\n
function compare_x(a,b){\n
return a.x-b.x;\n
}\n
\n
\n
\n
function SET_DHTML2()\n
{\n
\tdd.elements = new Array();\n
\tvar d_a = SET_DHTML2.arguments, d_ai, d_htm = \'\', d_o, d_i = d_a.length; while (d_i--)\n
\t{\n
\t\tif (dd.op6)\n
\t\t{\n
\t\t\tvar d_t0 = (new Date()).getTime();\n
\t\t\twhile ((new Date()).getTime()-d_t0 < 0x99);\n
\t\t}\n
\t\tif (!(d_ai = d_a[d_i]).indexOf(\'c:\')) dd.cursor = d_ai.substring(2);\n
\t\telse if (d_ai == NO_ALT) dd.noalt = 1;\n
\t\telse if (d_ai == SCROLL) dd.scroll = 1;\n
\t\telse if (d_ai == RESET_Z) dd.re_z = 1;\n
\t\telse if (d_ai == RESIZABLE) dd.resizable = 1;\n
\t\telse if (d_ai == SCALABLE) dd.scalable = 1;\n
\t\telse\n
\t\t{\n
\t\t\td_o = new DDObj(d_ai);\n
\t\t\tdd.addElt(d_o);\n
\t\t\td_htm += d_o.t_htm || \'\';\n
\t\t\tif (d_o.oimg && d_o.cpy_n)\n
\t\t\t{\n
\t\t\t\tvar d_j = 0; while (d_j < d_o.cpy_n)\n
\t\t\t\t{\n
\t\t\t\t\tvar d_p = new DDObj(d_o.name+d_o.cmd, ++d_j);\n
\t\t\t\t\tdd.addElt(d_p, d_o);\n
\t\t\t\t\td_p.defz = d_o.defz+d_j;\n
\t\t\t\t\td_p.original = d_o;\n
\t\t\t\t\td_htm += d_p.t_htm;\n
\t\t\t\t}\n
\t\t\t}\n
\t\t}\n
\t}\n
\tif (dd.n4 || dd.n6 || dd.ie || dd.op || dd.w3c) document.write(\n
\t\t(dd.n4? \'<div style="position:absolute;"><\\/div>\\n\'\n
\t\t: (dd.op && !dd.op6)? \'<div id="OpBlUr" style="position:absolute;visibility:hidden;width:0px;height:0px;"><form><input type="text" style="width:0px;height:0px;"><\\/form><\\/div>\'\n
\t\t: \'\') + d_htm\n
\t);\n
\tdd.z = 0x33;\n
\td_i = dd.elements.length; while (d_i--)\n
\t{\n
\t\tdd.addProps(d_o = dd.elements[d_i]);\n
\t\tif (d_o.is_image && !d_o.original && !d_o.clone)\n
\t\t\tdd.n4? d_o.oimg.src = spacer : d_o.oimg.style.visibility = \'hidden\';\n
\t}\n
\tdd.mkWzDom();\n
\tif (window.onload) dd.loadFunc = window.onload;\n
\twindow.onload = dd.initz;\n
\twindow.onunload = dd.finlz;\n
\tdd.setEvtHdl(0, PICK);\n
\n
\n
for (var i=0;i < lines.length;i++){ \n
lines[i]=lines[i].sort(compare_x);\n
}\n
\n
lt = dd.elements.top;\n
rt = dd.elements.right;\n
rb = dd.elements.bottom;\n
lb = dd.elements.left;\n
grips = [lt, rt, rb, lb];\n
\n
\n
\n
\n
//******************************\n
hideGrips();\n
//main.setZ(main.z+1);\n
//dd.obj.ondblclick = showGrips;//*****************************************************************************\n
\n
}\n
\n
\n
\n
\n
\n
\n
\n
function SET_DHTML()\n
{\n
\tdd.elements = new Array();\n
\tvar d_a = SET_DHTML.arguments, d_ai, d_htm = \'\', d_o, d_i = d_a.length; while (d_i--)\n
\t{\n
\t\tif (dd.op6)\n
\t\t{\n
\t\t\tvar d_t0 = (new Date()).getTime();\n
\t\t\twhile ((new Date()).getTime()-d_t0 < 0x99);\n
\t\t}\n
\t\tif (!(d_ai = d_a[d_i]).indexOf(\'c:\')) dd.cursor = d_ai.substring(2);\n
\t\telse if (d_ai == NO_ALT) dd.noalt = 1;\n
\t\telse if (d_ai == SCROLL) dd.scroll = 1;\n
\t\telse if (d_ai == RESET_Z) dd.re_z = 1;\n
\t\telse if (d_ai == RESIZABLE) dd.resizable = 1;\n
\t\telse if (d_ai == SCALABLE) dd.scalable = 1;\n
\t\telse\n
\t\t{\n
\t\t\td_o = new DDObj(d_ai);\n
\t\t\tdd.addElt(d_o);\n
\t\t\td_htm += d_o.t_htm || \'\';\n
\t\t\tif (d_o.oimg && d_o.cpy_n)\n
\t\t\t{\n
\t\t\t\tvar d_j = 0; while (d_j < d_o.cpy_n)\n
\t\t\t\t{\n
\t\t\t\t\tvar d_p = new DDObj(d_o.name+d_o.cmd, ++d_j);\n
\t\t\t\t\tdd.addElt(d_p, d_o);\n
\t\t\t\t\td_p.defz = d_o.defz+d_j;\n
\t\t\t\t\td_p.original = d_o;\n
\t\t\t\t\td_htm += d_p.t_htm;\n
\t\t\t\t}\n
\t\t\t}\n
\t\t}\n
\t}\n
\tif (dd.n4 || dd.n6 || dd.ie || dd.op || dd.w3c) document.write(\n
\t\t(dd.n4? \'<div style="position:absolute;"><\\/div>\\n\'\n
\t\t: (dd.op && !dd.op6)? \'<div id="OpBlUr" style="position:absolute;visibility:hidden;width:0px;height:0px;"><form><input type="text" style="width:0px;height:0px;"><\\/form><\\/div>\'\n
\t\t: \'\') + d_htm\n
\t);\n
\tdd.z = 0x33;\n
\td_i = dd.elements.length; while (d_i--)\n
\t{\n
\t\tdd.addProps(d_o = dd.elements[d_i]);\n
\t\tif (d_o.is_image && !d_o.original && !d_o.clone)\n
\t\t\tdd.n4? d_o.oimg.src = spacer : d_o.oimg.style.visibility = \'hidden\';\n
\t}\n
\tdd.mkWzDom();\n
\tif (window.onload) dd.loadFunc = window.onload;\n
\twindow.onload = dd.initz;\n
\twindow.onunload = dd.finlz;\n
\tdd.setEvtHdl(0, PICK);\n
\n
// from this point. Written by jonathan\n
//creation of the structure of lines \n
for (var i=0;i < dd.elements.length;i++){\n
if (dd.elements[i].nodrag==0){ // do not need to add in lines the informations inside a div\n
test=false; //used for determining if blocks with same y of the current is block are already present\n
for (var j=0;j < lines.length;j++){\n
if ((dd.elements[i].y+dd.elements[i].h)==(lines[j][0].y+lines[j][0].h)){\n
lines[j][lines[j].length]=dd.elements[i];\n
test=true;\n
}\n
}\n
if (test==false){ //we create a new line\n
lines[lines.length]=new Array(dd.elements[i]);\n
}\n
}}\n
\n
\n
for (var i=0;i < lines.length;i++){ \n
lines[i]=lines[i].sort(compare_x);\n
}\n
\n
lt = dd.elements.top;\n
rt = dd.elements.right;\n
rb = dd.elements.bottom;\n
lb = dd.elements.left;\n
grips = [lt, rt, rb, lb];\n
\n
\n
\n
\n
//******************************\n
hideGrips();\n
//main.setZ(main.z+1);\n
//dd.obj.ondblclick = showGrips;//*****************************************************************************\n
\n
}\n
\n
function ADD_DHTML(d_o) // layers only!\n
{\n
\td_o = new DDObj(d_o);\n
\tdd.addElt(d_o);\n
\tdd.addProps(d_o);\n
\tdd.mkWzDom();\n
}\n
\n
\n
\n
\n
////////////////////////////////////////////////////////////\n
// If not needed, all code below this line may be removed\n
\n
\n
// For backward compatibility\n
dd.d = document; // < v. 2.72\n
var RESET_ZINDEX = RESET_Z; // < 3.44\n
var KEYDOWN_RESIZE = RESIZABLE; // < 4.43\n
var CURSOR_POINTER = CURSOR_HAND; // < 4.44\n
var NO_SCROLL = \'\'; // < v. 4.49\n
\n
\n
\n
\n
////////////////////////////////////////////////////////////\n
// FUNCTIONS FOR EXTENDED SCRIPTING\n
// Use these for your own extensions,\n
// or to call functions defined elsewhere\n
\n
\n
\n
/* my_PickFunc IS AUTOMATICALLY CALLED WHEN AN ITEM STARTS TO BE DRAGGED.\n
The following objects/properties are accessible from here:\n
\n
- dd.e: current mouse event\n
- dd.e.property: access to a property of the current mouse event.\n
Mostly requested properties:\n
- dd.e.x: document-related x co-ordinate\n
- dd.e.y: document-related y co-ord\n
- dd.e.src: target of mouse event (not identical with the drag drop object itself).\n
- dd.e.button: currently pressed mouse button. Left button: dd.e.button <= 1\n
\n
- dd.obj: reference to currently dragged item.\n
- dd.obj.property: access to any property of that item.\n
- dd.obj.method(): for example dd.obj.resizeTo() or dd.obj.swapImage() .\n
Mostly requested properties:\n
\t- dd.obj.name: image name or layer ID passed to SET_DHTML();\n
\t- dd.obj.x and dd.obj.y: co-ordinates;\n
\t- dd.obj.w and dd.obj.h: size;\n
\t- dd.obj.is_dragged: 1 while item is dragged, else 0;\n
\t- dd.obj.is_resized: 1 while item is resized, i.e. if <ctrl> or <shift> is pressed, else 0\n
\n
For more properties and details, visit the API documentation\n
at http://www.walterzorn.com/dragdrop/api_e.htm (english) or\n
http://www.walterzorn.de/dragdrop/api.htm (german) */\n
bmoved=new Array;\n
var obj_old; \n
var obj_oldx;//previous position X\n
var obj_oldy; //previous position Y\n
var obj_size_w; \n
var obj_record;\n
var direction; //knows whether we move a block on the right or on the left \n
var prev_dd_obj;// used when resizing. This variable stocks the previous block clicked\n
\n
\n
\n
function my_PickFunc()\n
{ // window.status=dd.e.button;\n
\n
// used by bmoved\n
for (var i=0;i<grips.length;i++){\n
if (dd.obj.name!=grips[i].name){\n
obj_oldx=dd.obj.x;\n
obj_oldy=dd.obj.y;\n
}}\n
//*****\n
\n
obj_old=dd.obj.x;\n
obj_size_w=dd.obj.w;\n
x_old=dd.obj.x+dd.obj.w;\n
y_old=dd.obj.y+dd.obj.h;\n
\n
test=false;\n
var i = 4; while (i--)\n
{ \n
if (grips[i] != dd.obj){\n
grips[i].hide();} \n
else{\n
test=true;}\n
}\n
if (test==false){\n
prev_dd_obj=dd.obj;\n
hideGrips(); \n
}\n
\n
}\n
\n
\n
\n
// these two checks functions are called when a collision is detected, they move blocks which are touched\n
function check_list_right(index_line){\n
\n
for (var j=0;j<lines[index_line].length;j++){ //we compare each block of a line with its following.\n
if ((j+1)!=lines[index_line].length){\n
if (lines[index_line][j].x>lines[index_line][j+1].x || ((lines[index_line][j].x+lines[index_line][j].w)>lines[index_line][j+1].x)){\n
if (((lines[index_line][j].y)<(lines[index_line][j+1].y+lines[index_line][j+1].h) && (lines[index_line][j].y+lines[index_line][j].h>lines[index_line][j+1].y))){\n
delta=lines[index_line][j].x+lines[index_line][j].w-lines[index_line][j+1].x;\n
lines[index_line][j+1].moveBy(+delta,0);\n
}}\n
}\n
}\n
}\n
\n
\n
function check_list_left(index_line){\n
\n
for (var j=(lines[index_line].length)-1;j>-1;j--){\n
if ((j-1)!=-1){\n
if(lines[index_line][j-1].x>lines[index_line][j].x || ((lines[index_line][j-1].x+lines[index_line][j-1].w)>lines[index_line][j].x)){\n
if (((lines[index_line][j-1].y)<(lines[index_line][j].y+lines[index_line][j].h) && (lines[index_line][j-1].y+lines[index_line][j-1].h>lines[index_line][j].y))){ \n
delta=(lines[index_line][j-1].x+lines[index_line][j-1].w)-lines[index_line][j].x;\n
lines[index_line][j-1].moveBy(-delta,0);\n
}\n
}\n
}\n
}}\n
\n
\n
\n
\n
//function called when a block jump an other, so we exchange the objects in the list\n
function exchange_object(index_line){\n
for (var j=0;j<lines[index_line].length;j++){ \n
if ((j+1)!=lines[index_line].length){\n
if(lines[index_line][j].x>lines[index_line][j+1].x){\n
var dobject=lines[index_line][j+1];\n
lines[index_line][j+1]=lines[index_line][j];\n
lines[index_line][j]=dobject;\n
}\n
}\n
}\n
}\n
\n
\n
\n
function move_block(direction){\n
found=false; \n
test=false;\n
var i = 4; while (i--)\n
{ \n
if (grips[i] == dd.obj){\n
current_obj=prev_dd_obj;\n
test=true;\n
}\n
}\n
if (test==false){\n
current_obj=dd.obj; \n
}\n
\n
for (var i=0;i<lines.length;i++){ \n
for (var k=0;k<lines[i].length;k++){\n
if (current_obj==lines[i][k]){ //it means we are in the correct lines\n
var found=true;\n
for (var j=0;j<lines[i].length;j++){\n
if (direction>0){ //to the right\n
if((lines[i][j].x < (current_obj.x+current_obj.w)) && (lines[i][j]!=current_obj)){\n
if ( ((current_obj.y)<(lines[i][j].y+lines[i][j].h)) && ((current_obj.y+current_obj.h) > (lines[i][j].y)) ){\n
check_list_right(i);//sometimes a collision is not detected when the mouse is speeding.\n
if (current_obj.x<(lines[i][j].x+lines[i][j].w)){\n
delta= (current_obj.x+current_obj.w)-lines[i][j].x;\n
\t lines[i][j].moveBy(+delta,0);\n
//check_list_right(i); //REMOVE IF IT IS TOO SLOW\n
}\n
}\n
else{ //we have jumped so we exchange two objects in lines\n
check_list_left(i);\n
exchange_object(i);\n
} \n
\n
}}\n
else{ //to the left\n
\n
if(((lines[i][j].x+lines[i][j].w) > current_obj.x)&& (lines[i][j]!=current_obj)){ \n
if ( (current_obj.y<(lines[i][j].y+lines[i][j].h)) && ((current_obj.y+current_obj.h) > lines[i][j].y) ){\n
check_list_left(i);\n
if ( (current_obj.x+current_obj.w)>lines[i][j].x){ \n
delta= (lines[i][j].x+lines[i][j].w)-current_obj.x;\n
lines[i][j].moveBy(-delta,0);\n
check_list_left(i); //don\'t know why but needed...\n
}\n
}\n
else{\n
check_list_left(i); //needed because sometimes a block can jump over an other even if there is a colision\n
exchange_object(i);} \n
} \n
}\n
}\n
}\n
if (found==true){ //we found the line of the current object so it\'s no use continuing.\n
break;\n
}\n
}\n
\n
}\n
}\n
\n
\n
\n
/* my_DragFunc IS CALLED WHILE AN ITEM IS DRAGGED\n
See the description of my_PickFunc above for what\'s accessible from here. */\n
//***************************************************************************************\n
function my_DragFunc()\n
{ \n
\n
if (dd.obj == rb)\n
{if (dd.obj.y> prev_dd_obj.y ){\n
prev_dd_obj.resizeTo(prev_dd_obj.w,rb.y-lt.y);\n
//************************\n
//window.status=prev_dd_obj.children.length;\n
for (var i=0;i<prev_dd_obj.children.length;i++){\n
\n
if (dd.obj.y<prev_dd_obj.children[i].y+prev_dd_obj.children[i].h){\n
prev_dd_obj.children[i].hide();\n
}\n
else{\n
prev_dd_obj.children[i].show();\n
}\n
\n
}\n
//*********************************\n
}}\n
else if (dd.obj == rt)\n
{\n
if (dd.obj.x > prev_dd_obj.x ){\n
prev_dd_obj.resizeTo(rt.x-lb.x, prev_dd_obj.h);\n
prev_dd_obj.moveTo(rt.x-prev_dd_obj.w+rt.w/2,prev_dd_obj.y);\n
//***********************************\n
for (var i=0;i<prev_dd_obj.children.length;i++){\n
\n
if (dd.obj.x<prev_dd_obj.children[i].x+prev_dd_obj.children[i].w){\n
prev_dd_obj.children[i].hide();\n
}\n
else{\n
prev_dd_obj.children[i].show();\n
}\n
}\n
//***************************************\n
}} \n
\n
else if (dd.obj == lb)\n
{ if (dd.obj.x+dd.obj.w < prev_dd_obj.x+prev_dd_obj.w){\n
prev_dd_obj.moveTo(lb.x+lb.w/2,prev_dd_obj.y);\n
prev_dd_obj.resizeTo(rt.x-lb.x,prev_dd_obj.h);\n
//***********************************\n
for (var i=0;i<prev_dd_obj.children.length;i++){\n
if (prev_dd_obj.x+prev_dd_obj.w<prev_dd_obj.children[i].x+prev_dd_obj.children[i].w ){\n
prev_dd_obj.children[i].hide();\n
}\n
else{\n
prev_dd_obj.children[i].show();\n
}\n
}\n
//***************************************\n
}}\n
else if (dd.obj == lt)\n
{\n
if (dd.obj.y+dd.obj.h< (prev_dd_obj.y+prev_dd_obj.h)){\n
prev_dd_obj.moveTo(prev_dd_obj.x, lt.y+lt.h/2);\n
prev_dd_obj.resizeTo(prev_dd_obj.w, rb.y-lt.y);\n
\n
//***********************************\n
for (var i=0;i<prev_dd_obj.children.length;i++){\n
if ((prev_dd_obj.y+prev_dd_obj.h)< (prev_dd_obj.children[i].y+prev_dd_obj.children[i].h)){\n
prev_dd_obj.children[i].hide();\n
}\n
else{\n
prev_dd_obj.children[i].show();\n
}\n
}\n
//***************************************\n
\n
}}\n
\n
if ((dd.obj.x-obj_old)>0 ){\n
direction=1;\n
}\n
else{\n
direction=-1;\n
}\n
obj_old=dd.obj.x;\n
obj_size_w=dd.obj.w;\n
move_block(direction);\n
\n
} \n
\n
\n
\n
/* my_ResizeFunc IS CALLED WHILE AN ITEM IS RESIZED\n
See the description of my_PickFunc above for what\'s accessible from here. */\n
function my_ResizeFunc()\n
{\n
\n
}\n
\n
\n
\n
/* THIS ONE IS CALLED ONCE AN ITEM IS DROPPED\n
See the description of my_PickFunc for what\'s accessible from here.\n
Here may be investigated, for example, what\'s the name (dd.obj.name)\n
of the dropped item, and where (dd.obj.x, dd.obj.y) it has been dropped... */\n
function my_DropFunc()\n
{\n
hideGrips();\n
x_old=dd.obj.x+dd.obj.w;\n
y_old=dd.obj.y+dd.obj.h;x_old=dd.obj.x+dd.obj.w;\n
isnotobject=0;\n
\n
for (var j=0;j<grips.length;j++){\n
if (grips[j].name == dd.obj.name){\n
isnotobject=1;\n
} \n
}\n
if (isnotobject == 0){\n
obj_record=dd.obj;\n
}\n
\n
var present=false;\n
for(var i=0; i < bmoved.length; i++){\n
if (bmoved[i][0]==obj_record.name){\n
present=true; //the block has already be moved a first time.\n
bmoved[i][3]=obj_record.x;\n
bmoved[i][4]=obj_record.y;\n
bmoved[i][5]=obj_record.w;\n
bmoved[i][6]=obj_record.h; \n
break;} \n
}\n
\n
if (present==false){\n
if (bmoved.length==0){\n
bmoved[0]=new Array(obj_record.name,obj_oldx,obj_oldy,obj_record.x,obj_record.y,obj_record.w,obj_record.h);}//first block moved\n
else{\n
\n
bmoved[i]=new Array(obj_record.name,obj_oldx,obj_oldy,obj_record.x,obj_record.y,obj_record.w,obj_record.h);\n
}\n
}\n
/* we save all the informations in an hidden input called "block_moved". The datas are stored in an unique string with the following sheme:\n
"name,x,y,width,height*name,x,y,width,height-name etc.." */\n
\n
document.forms["main_form"]["block_moved"].value=bmoved.join("*");\n
\n
}\n
\n
//specific functions for resizing. ******\n
function showGrips()\n
{\n
moveGripsToCorners();\n
var i = 4; while(i--)\n
{\n
grips[i].setZ(prev_dd_obj.z+1);\n
grips[i].show();\n
}\n
}\n
\n
\n
function hideGrips()\n
{\n
var i = 4; while(i--)\n
grips[i].hide();\n
}\n
\n
\n
/* (lt) \n
___________\xc3\x82\xc2\xa4____________\n
| |\n
(lb)\xc3\x82\xc2\xa4| |\xc3\x82\xc2\xa4 (rt)\n
|_______________________|\n
\xc3\x82\xc2\xa4 (rb)\n
*/\n
\n
function moveGripsToCorners()\n
{\n
lt.moveTo(prev_dd_obj.x+(prev_dd_obj.w/2)-lt.w/2, prev_dd_obj.y-lt.h/2);\n
rt.moveTo(prev_dd_obj.x+prev_dd_obj.w-lt.w/2, prev_dd_obj.y+(prev_dd_obj.h/2)-lt.h/2);\n
rb.moveTo(prev_dd_obj.x+(prev_dd_obj.w/2)-lt.w/2, prev_dd_obj.y+prev_dd_obj.h-lt.h/2);\n
lb.moveTo(prev_dd_obj.x-lt.w/2, prev_dd_obj.y+(prev_dd_obj.h/2)-lt.h/2);\n
}\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment