changeset 8:cc10d99e3f83

Persist and read back from disk and parse to objects is working.. Display needs updating now
author Sean Halle <seanhalle@yahoo.com>
date Sat, 09 Aug 2014 03:34:26 -0700
parents 20a1407463a0
children a8e5e71adcf3
files 1__Development/0__Code_Dev/Javascript_approach/.idea/workspace.xml 1__Development/0__Code_Dev/Javascript_approach/GabePattern/.~lock.12_Dc_02___Sample_Prog_to_hand_compile__with_syntax_graph__for_Gabe.odg# 1__Development/0__Code_Dev/Javascript_approach/MVDM_implementation/app/GabePatternSrcHolder.js 1__Development/0__Code_Dev/Javascript_approach/MVDM_implementation/app/POPDisplay.js 1__Development/0__Code_Dev/Javascript_approach/MVDM_implementation/app/POPGraphClasses.js 1__Development/0__Code_Dev/Javascript_approach/MVDM_implementation/app/persistence.js 1__Development/0__Code_Dev/Javascript_approach/MVDM_implementation/lib/filer.js 1__Development/0__Code_Dev/Javascript_approach/Packages_libraries_tools/filerjs/src/filer.js 1__Development/6__Website/POPBottleServer/POPBottleServer.py 1__Development/6__Website/POPBottleServer/syntaxGraph.json
diffstat 10 files changed, 3575 insertions(+), 572 deletions(-) [+]
line diff
     1.1 --- a/1__Development/0__Code_Dev/Javascript_approach/.idea/workspace.xml	Thu Aug 07 00:10:50 2014 -0700
     1.2 +++ b/1__Development/0__Code_Dev/Javascript_approach/.idea/workspace.xml	Sat Aug 09 03:34:26 2014 -0700
     1.3 @@ -2,9 +2,10 @@
     1.4  <project version="4">
     1.5    <component name="ChangeListManager">
     1.6      <list default="true" id="96358ab2-8688-4c45-a3ad-51ca6e0c841b" name="Default" comment="">
     1.7 +      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/MVDM_implementation/app/POPGraphClasses.js" />
     1.8 +      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/MVDM_implementation/app/persistence.js" />
     1.9        <change type="MODIFICATION" beforePath="$PROJECT_DIR$/MVDM_implementation/app/GabePatternSrcHolder.js" afterPath="$PROJECT_DIR$/MVDM_implementation/app/GabePatternSrcHolder.js" />
    1.10        <change type="MODIFICATION" beforePath="$PROJECT_DIR$/MVDM_implementation/app/POPDisplay.js" afterPath="$PROJECT_DIR$/MVDM_implementation/app/POPDisplay.js" />
    1.11 -      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/MVDM_implementation/app/POPSyntaxGraphVisualizer.js" afterPath="$PROJECT_DIR$/MVDM_implementation/app/POPSyntaxGraphVisualizer.js" />
    1.12        <change type="MODIFICATION" beforePath="$PROJECT_DIR$/MVDM_implementation/app/buildGabePatternSyntaxGraph.js" afterPath="$PROJECT_DIR$/MVDM_implementation/app/buildGabePatternSyntaxGraph.js" />
    1.13      </list>
    1.14      <ignored path="Javascript_approach.iws" />
    1.15 @@ -31,30 +32,10 @@
    1.16      <splitter split-orientation="horizontal" split-proportion="0.5">
    1.17        <split-first>
    1.18          <leaf>
    1.19 -          <file leaf-file-name="startUpApp.js" pinned="false" current="false" current-in-tab="false">
    1.20 -            <entry file="file://$PROJECT_DIR$/MVDM_implementation/startUpApp.js">
    1.21 -              <provider selected="true" editor-type-id="text-editor">
    1.22 -                <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="357">
    1.23 -                  <caret line="1" column="0" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
    1.24 -                  <folding />
    1.25 -                </state>
    1.26 -              </provider>
    1.27 -            </entry>
    1.28 -          </file>
    1.29 -          <file leaf-file-name="POPDisplay.html" pinned="false" current="false" current-in-tab="false">
    1.30 -            <entry file="file://$PROJECT_DIR$/MVDM_implementation/POPDisplay.html">
    1.31 -              <provider selected="true" editor-type-id="text-editor">
    1.32 -                <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="918">
    1.33 -                  <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
    1.34 -                  <folding />
    1.35 -                </state>
    1.36 -              </provider>
    1.37 -            </entry>
    1.38 -          </file>
    1.39            <file leaf-file-name="POPApp.js" pinned="false" current="false" current-in-tab="false">
    1.40              <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/POPApp.js">
    1.41                <provider selected="true" editor-type-id="text-editor">
    1.42 -                <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="918">
    1.43 +                <state vertical-scroll-proportion="0.0" vertical-offset="15" max-vertical-offset="918">
    1.44                    <caret line="17" column="14" selection-start-line="17" selection-start-column="14" selection-end-line="17" selection-end-column="14" />
    1.45                    <folding />
    1.46                  </state>
    1.47 @@ -64,9 +45,36 @@
    1.48            <file leaf-file-name="POPSyntaxGraphVisualizer.js" pinned="false" current="false" current-in-tab="false">
    1.49              <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/POPSyntaxGraphVisualizer.js">
    1.50                <provider selected="true" editor-type-id="text-editor">
    1.51 -                <state vertical-scroll-proportion="0.0" vertical-offset="807" max-vertical-offset="4131">
    1.52 +                <state vertical-scroll-proportion="0.0" vertical-offset="754" max-vertical-offset="4131">
    1.53                    <caret line="56" column="0" selection-start-line="56" selection-start-column="0" selection-end-line="56" selection-end-column="0" />
    1.54 -                  <folding />
    1.55 +                  <folding>
    1.56 +                    <marker date="1407321039721" expanded="true" signature="2:108" placeholder="//..." />
    1.57 +                    <marker date="1407321039721" expanded="true" signature="151:7152" placeholder="{...}" />
    1.58 +                    <marker date="1407321039721" expanded="true" signature="293:376" placeholder="{...}" />
    1.59 +                    <marker date="1407321039721" expanded="true" signature="415:494" placeholder="{...}" />
    1.60 +                    <marker date="1407321039721" expanded="true" signature="536:651" placeholder="{...}" />
    1.61 +                    <marker date="1407321039721" expanded="true" signature="654:960" placeholder="//..." />
    1.62 +                    <marker date="1407321039721" expanded="true" signature="1014:7020" placeholder="{...}" />
    1.63 +                    <marker date="1407321039721" expanded="true" signature="1106:1726" placeholder="//..." />
    1.64 +                    <marker date="1407321039721" expanded="true" signature="1732:2111" placeholder="//..." />
    1.65 +                    <marker date="1407321039721" expanded="true" signature="2238:2408" placeholder="//..." />
    1.66 +                    <marker date="1407321039721" expanded="true" signature="2471:2565" placeholder="//..." />
    1.67 +                    <marker date="1407321039721" expanded="true" signature="2569:2800" placeholder="//..." />
    1.68 +                    <marker date="1407321039721" expanded="true" signature="2803:3156" placeholder="//..." />
    1.69 +                    <marker date="1407321039721" expanded="true" signature="3219:3352" placeholder="{&quot;type&quot;: 'container'...}" />
    1.70 +                    <marker date="1407321039721" expanded="true" signature="3580:3822" placeholder="{&quot;type&quot;: 'shape'...}" />
    1.71 +                    <marker date="1407321039721" expanded="true" signature="3943:4185" placeholder="{&quot;type&quot;: 'shape'...}" />
    1.72 +                    <marker date="1407321039721" expanded="true" signature="4335:4549" placeholder="{&quot;type&quot;: 'shape'...}" />
    1.73 +                    <marker date="1407321039721" expanded="true" signature="4730:4944" placeholder="{&quot;type&quot;: 'shape'...}" />
    1.74 +                    <marker date="1407321039721" expanded="true" signature="4997:5211" placeholder="{&quot;type&quot;: 'shape'...}" />
    1.75 +                    <marker date="1407321039721" expanded="true" signature="5264:5478" placeholder="{&quot;type&quot;: 'shape'...}" />
    1.76 +                    <marker date="1407321039721" expanded="true" signature="5531:5745" placeholder="{&quot;type&quot;: 'shape'...}" />
    1.77 +                    <marker date="1407321039721" expanded="true" signature="5922:6136" placeholder="{&quot;type&quot;: 'shape'...}" />
    1.78 +                    <marker date="1407321039721" expanded="true" signature="6189:6403" placeholder="{&quot;type&quot;: 'shape'...}" />
    1.79 +                    <marker date="1407321039721" expanded="true" signature="6456:6670" placeholder="{&quot;type&quot;: 'shape'...}" />
    1.80 +                    <marker date="1407321039721" expanded="true" signature="6801:6967" placeholder="//..." />
    1.81 +                    <marker date="1407321039721" expanded="true" signature="7028:7149" placeholder="{...}" />
    1.82 +                  </folding>
    1.83                  </state>
    1.84                </provider>
    1.85              </entry>
    1.86 @@ -81,34 +89,89 @@
    1.87                </provider>
    1.88              </entry>
    1.89            </file>
    1.90 -          <file leaf-file-name="GabePatternSrcHolder.js" pinned="false" current="false" current-in-tab="false">
    1.91 +          <file leaf-file-name="POPDisplay.js" pinned="false" current="false" current-in-tab="false">
    1.92 +            <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/POPDisplay.js">
    1.93 +              <provider selected="true" editor-type-id="text-editor">
    1.94 +                <state vertical-scroll-proportion="0.0" vertical-offset="697" max-vertical-offset="3162">
    1.95 +                  <caret line="51" column="7" selection-start-line="51" selection-start-column="7" selection-end-line="51" selection-end-column="7" />
    1.96 +                  <folding>
    1.97 +                    <marker date="1407447259235" expanded="true" signature="2:297" placeholder="//..." />
    1.98 +                    <marker date="1407447259235" expanded="true" signature="299:650" placeholder="//..." />
    1.99 +                    <marker date="1407447259235" expanded="true" signature="693:6895" placeholder="{...}" />
   1.100 +                    <marker date="1407447259235" expanded="true" signature="1250:1476" placeholder="//..." />
   1.101 +                    <marker date="1407447259235" expanded="true" signature="1558:1942" placeholder="{...}" />
   1.102 +                    <marker date="1407447259235" expanded="true" signature="1562:1909" placeholder="//..." />
   1.103 +                    <marker date="1407447259235" expanded="true" signature="1944:2237" placeholder="//..." />
   1.104 +                    <marker date="1407447259235" expanded="true" signature="2279:6051" placeholder="{...}" />
   1.105 +                    <marker date="1407447259235" expanded="true" signature="2282:2372" placeholder="//..." />
   1.106 +                    <marker date="1407447259235" expanded="true" signature="2513:2694" placeholder="//..." />
   1.107 +                    <marker date="1407447259235" expanded="true" signature="2737:2929" placeholder="{...}" />
   1.108 +                    <marker date="1407447259235" expanded="true" signature="2741:2835" placeholder="//..." />
   1.109 +                    <marker date="1407447259235" expanded="true" signature="2899:2926" placeholder="{&quot;overflow&quot;: 'hidden'...}" />
   1.110 +                    <marker date="1407447259235" expanded="true" signature="2967:3799" placeholder="//..." />
   1.111 +                    <marker date="1407447259235" expanded="true" signature="4247:6049" placeholder="{...}" />
   1.112 +                    <marker date="1407447259235" expanded="true" signature="4462:5979" placeholder="{...}" />
   1.113 +                    <marker date="1407447259235" expanded="true" signature="4544:4684" placeholder="//..." />
   1.114 +                    <marker date="1407447259235" expanded="true" signature="4721:5547" placeholder="{...}" />
   1.115 +                    <marker date="1407447259235" expanded="true" signature="4763:4866" placeholder="{...}" />
   1.116 +                    <marker date="1407447259235" expanded="true" signature="4827:4860" placeholder="{&quot;overflow&quot;: 'hidden'...}" />
   1.117 +                    <marker date="1407447259235" expanded="true" signature="4904:4984" placeholder="{...}" />
   1.118 +                    <marker date="1407447259235" expanded="true" signature="5198:5418" placeholder="{...}" />
   1.119 +                    <marker date="1407447259235" expanded="true" signature="5230:5314" placeholder="{...}" />
   1.120 +                    <marker date="1407447259235" expanded="true" signature="5619:5975" placeholder="{...}" />
   1.121 +                    <marker date="1407447259235" expanded="true" signature="5650:5731" placeholder="{...}" />
   1.122 +                    <marker date="1407447259235" expanded="true" signature="5831:5911" placeholder="{...}" />
   1.123 +                    <marker date="1407447259235" expanded="true" signature="6069:6615" placeholder="{...}" />
   1.124 +                    <marker date="1407447259235" expanded="true" signature="6160:6471" placeholder="{&quot;content&quot;: '&lt;svg width=&quot;100&quot; height=&quot;80&quot;&gt;&lt;rect x=&quot;30&quot; y=&quot;10&quot; rx=&quot;20&quot; ry=&quot;20&quot; width=&quot;50&quot; height=&quot;50&quot; style=&quot;fill:red;stroke:black;stroke-width:3;opacity:0.5&quot;&gt;'...}" />
   1.125 +                    <marker date="1407447259235" expanded="true" signature="6291:6339" placeholder="..." />
   1.126 +                    <marker date="1407447259235" expanded="true" signature="6359:6468" placeholder="{&quot;color&quot;: 'white'...}" />
   1.127 +                    <marker date="1407447259235" expanded="true" signature="6513:6563" placeholder="{...}" />
   1.128 +                    <marker date="1407447259235" expanded="true" signature="6660:6735" placeholder="{...}" />
   1.129 +                    <marker date="1407447259235" expanded="true" signature="6743:6892" placeholder="{...}" />
   1.130 +                  </folding>
   1.131 +                </state>
   1.132 +              </provider>
   1.133 +            </entry>
   1.134 +          </file>
   1.135 +          <file leaf-file-name="buildGabePatternSyntaxGraph.js" pinned="false" current="false" current-in-tab="false">
   1.136 +            <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/buildGabePatternSyntaxGraph.js">
   1.137 +              <provider selected="true" editor-type-id="text-editor">
   1.138 +                <state vertical-scroll-proportion="0.0" vertical-offset="2625" max-vertical-offset="7650">
   1.139 +                  <caret line="163" column="0" selection-start-line="163" selection-start-column="0" selection-end-line="163" selection-end-column="0" />
   1.140 +                  <folding>
   1.141 +                    <element signature="n#!!doc" expanded="true" />
   1.142 +                    <marker date="1407558065893" expanded="true" signature="18879:18935" placeholder="..." />
   1.143 +                  </folding>
   1.144 +                </state>
   1.145 +              </provider>
   1.146 +            </entry>
   1.147 +          </file>
   1.148 +          <file leaf-file-name="GabePatternSrcHolder.js" pinned="false" current="true" current-in-tab="true">
   1.149              <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/GabePatternSrcHolder.js">
   1.150                <provider selected="true" editor-type-id="text-editor">
   1.151 -                <state vertical-scroll-proportion="-5.2" vertical-offset="4188" max-vertical-offset="7310">
   1.152 -                  <caret line="254" column="0" selection-start-line="254" selection-start-column="0" selection-end-line="254" selection-end-column="0" />
   1.153 +                <state vertical-scroll-proportion="0.2869757" vertical-offset="159" max-vertical-offset="612">
   1.154 +                  <caret line="17" column="12" selection-start-line="17" selection-start-column="12" selection-end-line="17" selection-end-column="12" />
   1.155                    <folding />
   1.156                  </state>
   1.157                </provider>
   1.158              </entry>
   1.159            </file>
   1.160 -          <file leaf-file-name="require.js" pinned="false" current="false" current-in-tab="false">
   1.161 -            <entry file="file://$PROJECT_DIR$/MVDM_implementation/lib/require.js">
   1.162 +          <file leaf-file-name="POPGraphClasses.js" pinned="false" current="false" current-in-tab="false">
   1.163 +            <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/POPGraphClasses.js">
   1.164                <provider selected="true" editor-type-id="text-editor">
   1.165 -                <state vertical-scroll-proportion="0.0" vertical-offset="27963" max-vertical-offset="35309">
   1.166 -                  <caret line="1657" column="0" selection-start-line="1657" selection-start-column="0" selection-end-line="1658" selection-end-column="0" />
   1.167 +                <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="2941">
   1.168 +                  <caret line="133" column="9" selection-start-line="133" selection-start-column="9" selection-end-line="133" selection-end-column="9" />
   1.169                    <folding />
   1.170                  </state>
   1.171                </provider>
   1.172              </entry>
   1.173            </file>
   1.174 -          <file leaf-file-name="POPDisplay.js" pinned="false" current="true" current-in-tab="true">
   1.175 -            <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/POPDisplay.js">
   1.176 +          <file leaf-file-name="persistence.js" pinned="false" current="false" current-in-tab="false">
   1.177 +            <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/persistence.js">
   1.178                <provider selected="true" editor-type-id="text-editor">
   1.179 -                <state vertical-scroll-proportion="0.3112128" vertical-offset="1360" max-vertical-offset="3162">
   1.180 -                  <caret line="88" column="36" selection-start-line="88" selection-start-column="36" selection-end-line="88" selection-end-column="36" />
   1.181 -                  <folding>
   1.182 -                    <marker date="1407395337135" expanded="true" signature="6283:6331" placeholder="..." />
   1.183 -                  </folding>
   1.184 +                <state vertical-scroll-proportion="-5.52" vertical-offset="8787" max-vertical-offset="11084">
   1.185 +                  <caret line="525" column="0" selection-start-line="525" selection-start-column="0" selection-end-line="525" selection-end-column="0" />
   1.186 +                  <folding />
   1.187                  </state>
   1.188                </provider>
   1.189              </entry>
   1.190 @@ -117,33 +180,44 @@
   1.191        </split-first>
   1.192        <split-second>
   1.193          <leaf>
   1.194 +          <file leaf-file-name="POPBottleServer.py" pinned="false" current="false" current-in-tab="false">
   1.195 +            <entry file="file://$PROJECT_DIR$/../../6__Website/POPBottleServer/POPBottleServer.py">
   1.196 +              <provider selected="true" editor-type-id="text-editor">
   1.197 +                <state vertical-scroll-proportion="0.0" vertical-offset="304" max-vertical-offset="1292">
   1.198 +                  <caret line="32" column="33" selection-start-line="32" selection-start-column="33" selection-end-line="32" selection-end-column="33" />
   1.199 +                  <folding />
   1.200 +                </state>
   1.201 +              </provider>
   1.202 +            </entry>
   1.203 +          </file>
   1.204 +          <file leaf-file-name="POPGraphClasses.js" pinned="false" current="false" current-in-tab="false">
   1.205 +            <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/POPGraphClasses.js">
   1.206 +              <provider selected="true" editor-type-id="text-editor">
   1.207 +                <state vertical-scroll-proportion="0.0" vertical-offset="2391" max-vertical-offset="2941">
   1.208 +                  <caret line="156" column="33" selection-start-line="156" selection-start-column="33" selection-end-line="156" selection-end-column="33" />
   1.209 +                  <folding />
   1.210 +                </state>
   1.211 +              </provider>
   1.212 +            </entry>
   1.213 +          </file>
   1.214            <file leaf-file-name="buildGabePatternSyntaxGraph.js" pinned="false" current="false" current-in-tab="false">
   1.215              <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/buildGabePatternSyntaxGraph.js">
   1.216                <provider selected="true" editor-type-id="text-editor">
   1.217 -                <state vertical-scroll-proportion="-5.76" vertical-offset="944" max-vertical-offset="10098">
   1.218 -                  <caret line="66" column="0" selection-start-line="66" selection-start-column="0" selection-end-line="66" selection-end-column="0" />
   1.219 +                <state vertical-scroll-proportion="0.0" vertical-offset="690" max-vertical-offset="7650">
   1.220 +                  <caret line="58" column="0" selection-start-line="58" selection-start-column="0" selection-end-line="58" selection-end-column="0" />
   1.221                    <folding>
   1.222 -                    <marker date="1407386727801" expanded="false" signature="24156:24212" placeholder="..." />
   1.223 +                    <element signature="n#!!doc" expanded="true" />
   1.224 +                    <marker date="1407558065893" expanded="true" signature="18879:18935" placeholder="..." />
   1.225                    </folding>
   1.226                  </state>
   1.227                </provider>
   1.228              </entry>
   1.229            </file>
   1.230 -          <file leaf-file-name="POPBottleServer.py" pinned="false" current="false" current-in-tab="false">
   1.231 -            <entry file="file://$PROJECT_DIR$/../../6__Website/POPBottleServer/POPBottleServer.py">
   1.232 +          <file leaf-file-name="persistence.js" pinned="false" current="false" current-in-tab="true">
   1.233 +            <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/persistence.js">
   1.234                <provider selected="true" editor-type-id="text-editor">
   1.235 -                <state vertical-scroll-proportion="0.0" vertical-offset="165" max-vertical-offset="1173">
   1.236 -                  <caret line="28" column="0" selection-start-line="28" selection-start-column="0" selection-end-line="28" selection-end-column="0" />
   1.237 -                  <folding />
   1.238 -                </state>
   1.239 -              </provider>
   1.240 -            </entry>
   1.241 -          </file>
   1.242 -          <file leaf-file-name="GabePatternSrcHolder.js" pinned="false" current="false" current-in-tab="true">
   1.243 -            <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/GabePatternSrcHolder.js">
   1.244 -              <provider selected="true" editor-type-id="text-editor">
   1.245 -                <state vertical-scroll-proportion="0.33187774" vertical-offset="4166" max-vertical-offset="7310">
   1.246 -                  <caret line="254" column="0" selection-start-line="254" selection-start-column="0" selection-end-line="254" selection-end-column="0" />
   1.247 +                <state vertical-scroll-proportion="0.2966805" vertical-offset="8459" max-vertical-offset="11084">
   1.248 +                  <caret line="506" column="57" selection-start-line="506" selection-start-column="57" selection-end-line="506" selection-end-column="57" />
   1.249                    <folding />
   1.250                  </state>
   1.251                </provider>
   1.252 @@ -171,13 +245,16 @@
   1.253          <option value="$PROJECT_DIR$/Display/app/GabePatternSrcHolder.js" />
   1.254          <option value="/vm:94" />
   1.255          <option value="$PROJECT_DIR$/MVDM_implementation/app/POPSyntaxGraphModifier.js" />
   1.256 +        <option value="$PROJECT_DIR$/MVDM_implementation/app/POPSyntaxGraphVisualizer.js" />
   1.257 +        <option value="$PROJECT_DIR$/../../6__Website/POPBottleServer/POPBottleServer_test.py" />
   1.258 +        <option value="$PROJECT_DIR$/MVDM_implementation/app/POPDisplay.js" />
   1.259 +        <option value="$PROJECT_DIR$/MVDM_implementation/app/persistingGraph.js" />
   1.260          <option value="$PROJECT_DIR$/MVDM_implementation/startUpApp.js" />
   1.261 -        <option value="$PROJECT_DIR$/MVDM_implementation/app/POPSyntaxGraphVisualizer.js" />
   1.262          <option value="$PROJECT_DIR$/MVDM_implementation/app/buildGabePatternSyntaxGraph.js" />
   1.263 -        <option value="$PROJECT_DIR$/../../6__Website/POPBottleServer/POPBottleServer_test.py" />
   1.264 +        <option value="$PROJECT_DIR$/MVDM_implementation/app/POPGraphClasses.js" />
   1.265          <option value="$PROJECT_DIR$/../../6__Website/POPBottleServer/POPBottleServer.py" />
   1.266          <option value="$PROJECT_DIR$/MVDM_implementation/app/GabePatternSrcHolder.js" />
   1.267 -        <option value="$PROJECT_DIR$/MVDM_implementation/app/POPDisplay.js" />
   1.268 +        <option value="$PROJECT_DIR$/MVDM_implementation/app/persistence.js" />
   1.269        </list>
   1.270      </option>
   1.271    </component>
   1.272 @@ -200,7 +277,7 @@
   1.273      <option name="STATE" value="0" />
   1.274    </component>
   1.275    <component name="ProjectView">
   1.276 -    <navigator proportions="" version="1">
   1.277 +    <navigator currentView="ProjectPane" proportions="" version="1">
   1.278        <flattenPackages />
   1.279        <showMembers />
   1.280        <showModules />
   1.281 @@ -211,7 +288,43 @@
   1.282        <autoscrollFromSource />
   1.283        <sortByType />
   1.284      </navigator>
   1.285 -    <panes />
   1.286 +    <panes>
   1.287 +      <pane id="Scope" />
   1.288 +      <pane id="ProjectPane">
   1.289 +        <subPane>
   1.290 +          <PATH>
   1.291 +            <PATH_ELEMENT>
   1.292 +              <option name="myItemId" value="Javascript_approach" />
   1.293 +              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
   1.294 +            </PATH_ELEMENT>
   1.295 +          </PATH>
   1.296 +          <PATH>
   1.297 +            <PATH_ELEMENT>
   1.298 +              <option name="myItemId" value="Javascript_approach" />
   1.299 +              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
   1.300 +            </PATH_ELEMENT>
   1.301 +            <PATH_ELEMENT>
   1.302 +              <option name="myItemId" value="Javascript_approach" />
   1.303 +              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
   1.304 +            </PATH_ELEMENT>
   1.305 +          </PATH>
   1.306 +          <PATH>
   1.307 +            <PATH_ELEMENT>
   1.308 +              <option name="myItemId" value="Javascript_approach" />
   1.309 +              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
   1.310 +            </PATH_ELEMENT>
   1.311 +            <PATH_ELEMENT>
   1.312 +              <option name="myItemId" value="Javascript_approach" />
   1.313 +              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
   1.314 +            </PATH_ELEMENT>
   1.315 +            <PATH_ELEMENT>
   1.316 +              <option name="myItemId" value="lib" />
   1.317 +              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
   1.318 +            </PATH_ELEMENT>
   1.319 +          </PATH>
   1.320 +        </subPane>
   1.321 +      </pane>
   1.322 +    </panes>
   1.323    </component>
   1.324    <component name="PropertiesComponent">
   1.325      <property name="WebServerToolWindowFactoryState" value="false" />
   1.326 @@ -222,11 +335,13 @@
   1.327      <property name="options.splitter.main.proportions" value="0.3" />
   1.328      <property name="options.splitter.details.proportions" value="0.2" />
   1.329      <property name="options.searchVisible" value="true" />
   1.330 -    <property name="last_opened_file_path" value="$PROJECT_DIR$/../../6__Website/POPBottleServer/POPBottleServer.py" />
   1.331 +    <property name="last_opened_file_path" value="$PROJECT_DIR$/MVDM_implementation/app" />
   1.332      <property name="LayoutCode.rearrangeEntriesPlain text" value="false" />
   1.333 +    <property name="JavaScriptLanguageLevel" value="JS_1_8_5" />
   1.334    </component>
   1.335    <component name="RecentsManager">
   1.336      <key name="CopyFile.RECENT_KEYS">
   1.337 +      <recent name="C:\D\2__Work\8__POP\1__Development\0__Code_Dev\Javascript_approach\MVDM_implementation\app" />
   1.338        <recent name="C:\D\2__Work\8__POP\1__Development\6__Website\POPBottleServer" />
   1.339      </key>
   1.340    </component>
   1.341 @@ -305,15 +420,15 @@
   1.342    </component>
   1.343    <component name="ToolWindowManager">
   1.344      <frame x="287" y="0" width="1308" height="870" extended-state="0" />
   1.345 -    <editor active="true" />
   1.346 +    <editor active="false" />
   1.347      <layout>
   1.348        <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3391892" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
   1.349        <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32891566" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
   1.350        <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
   1.351        <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32793522" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
   1.352        <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.21417323" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
   1.353 -      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.17007874" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
   1.354 -      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32928476" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
   1.355 +      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.16994493" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
   1.356 +      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.2968961" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
   1.357        <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.21475771" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
   1.358        <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
   1.359        <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32882273" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
   1.360 @@ -349,12 +464,12 @@
   1.361      <breakpoint-manager>
   1.362        <breakpoints>
   1.363          <line-breakpoint enabled="true" type="javascript">
   1.364 -          <url>file://$PROJECT_DIR$/MVDM_implementation/app/POPSyntaxGraphVisualizer.js</url>
   1.365 -          <line>56</line>
   1.366 -          <option name="timeStamp" value="63" />
   1.367 +          <url>file://$PROJECT_DIR$/MVDM_implementation/app/GabePatternSrcHolder.js</url>
   1.368 +          <line>19</line>
   1.369 +          <option name="timeStamp" value="110" />
   1.370          </line-breakpoint>
   1.371        </breakpoints>
   1.372 -      <option name="time" value="79" />
   1.373 +      <option name="time" value="113" />
   1.374      </breakpoint-manager>
   1.375    </component>
   1.376    <component name="XPathView.XPathProjectComponent">
   1.377 @@ -393,7 +508,39 @@
   1.378          <state vertical-scroll-proportion="0.0" vertical-offset="518" max-vertical-offset="3162">
   1.379            <caret line="62" column="0" selection-start-line="62" selection-start-column="0" selection-end-line="62" selection-end-column="0" />
   1.380            <folding>
   1.381 -            <marker date="1407395337135" expanded="true" signature="6283:6331" placeholder="..." />
   1.382 +            <marker date="1407447259235" expanded="true" signature="2:297" placeholder="//..." />
   1.383 +            <marker date="1407447259235" expanded="true" signature="299:650" placeholder="//..." />
   1.384 +            <marker date="1407447259235" expanded="true" signature="693:6895" placeholder="{...}" />
   1.385 +            <marker date="1407447259235" expanded="true" signature="1250:1476" placeholder="//..." />
   1.386 +            <marker date="1407447259235" expanded="true" signature="1558:1942" placeholder="{...}" />
   1.387 +            <marker date="1407447259235" expanded="true" signature="1562:1909" placeholder="//..." />
   1.388 +            <marker date="1407447259235" expanded="true" signature="1944:2237" placeholder="//..." />
   1.389 +            <marker date="1407447259235" expanded="true" signature="2279:6051" placeholder="{...}" />
   1.390 +            <marker date="1407447259235" expanded="true" signature="2282:2372" placeholder="//..." />
   1.391 +            <marker date="1407447259235" expanded="true" signature="2513:2694" placeholder="//..." />
   1.392 +            <marker date="1407447259235" expanded="true" signature="2737:2929" placeholder="{...}" />
   1.393 +            <marker date="1407447259235" expanded="true" signature="2741:2835" placeholder="//..." />
   1.394 +            <marker date="1407447259235" expanded="true" signature="2899:2926" placeholder="{&quot;overflow&quot;: 'hidden'...}" />
   1.395 +            <marker date="1407447259235" expanded="true" signature="2967:3799" placeholder="//..." />
   1.396 +            <marker date="1407447259235" expanded="true" signature="4247:6049" placeholder="{...}" />
   1.397 +            <marker date="1407447259235" expanded="true" signature="4462:5979" placeholder="{...}" />
   1.398 +            <marker date="1407447259235" expanded="true" signature="4544:4684" placeholder="//..." />
   1.399 +            <marker date="1407447259235" expanded="true" signature="4721:5547" placeholder="{...}" />
   1.400 +            <marker date="1407447259235" expanded="true" signature="4763:4866" placeholder="{...}" />
   1.401 +            <marker date="1407447259235" expanded="true" signature="4827:4860" placeholder="{&quot;overflow&quot;: 'hidden'...}" />
   1.402 +            <marker date="1407447259235" expanded="true" signature="4904:4984" placeholder="{...}" />
   1.403 +            <marker date="1407447259235" expanded="true" signature="5198:5418" placeholder="{...}" />
   1.404 +            <marker date="1407447259235" expanded="true" signature="5230:5314" placeholder="{...}" />
   1.405 +            <marker date="1407447259235" expanded="true" signature="5619:5975" placeholder="{...}" />
   1.406 +            <marker date="1407447259235" expanded="true" signature="5650:5731" placeholder="{...}" />
   1.407 +            <marker date="1407447259235" expanded="true" signature="5831:5911" placeholder="{...}" />
   1.408 +            <marker date="1407447259235" expanded="true" signature="6069:6615" placeholder="{...}" />
   1.409 +            <marker date="1407447259235" expanded="true" signature="6160:6471" placeholder="{&quot;content&quot;: '&lt;svg width=&quot;100&quot; height=&quot;80&quot;&gt;&lt;rect x=&quot;30&quot; y=&quot;10&quot; rx=&quot;20&quot; ry=&quot;20&quot; width=&quot;50&quot; height=&quot;50&quot; style=&quot;fill:red;stroke:black;stroke-width:3;opacity:0.5&quot;&gt;'...}" />
   1.410 +            <marker date="1407447259235" expanded="true" signature="6291:6339" placeholder="..." />
   1.411 +            <marker date="1407447259235" expanded="true" signature="6359:6468" placeholder="{&quot;color&quot;: 'white'...}" />
   1.412 +            <marker date="1407447259235" expanded="true" signature="6513:6563" placeholder="{...}" />
   1.413 +            <marker date="1407447259235" expanded="true" signature="6660:6735" placeholder="{...}" />
   1.414 +            <marker date="1407447259235" expanded="true" signature="6743:6892" placeholder="{...}" />
   1.415            </folding>
   1.416          </state>
   1.417        </provider>
   1.418 @@ -402,7 +549,34 @@
   1.419        <provider selected="true" editor-type-id="text-editor">
   1.420          <state vertical-scroll-proportion="0.0" vertical-offset="715" max-vertical-offset="4165">
   1.421            <caret line="63" column="37" selection-start-line="63" selection-start-column="20" selection-end-line="63" selection-end-column="37" />
   1.422 -          <folding />
   1.423 +          <folding>
   1.424 +            <marker date="1407321039721" expanded="true" signature="2:108" placeholder="//..." />
   1.425 +            <marker date="1407321039721" expanded="true" signature="151:7152" placeholder="{...}" />
   1.426 +            <marker date="1407321039721" expanded="true" signature="293:376" placeholder="{...}" />
   1.427 +            <marker date="1407321039721" expanded="true" signature="415:494" placeholder="{...}" />
   1.428 +            <marker date="1407321039721" expanded="true" signature="536:651" placeholder="{...}" />
   1.429 +            <marker date="1407321039721" expanded="true" signature="654:960" placeholder="//..." />
   1.430 +            <marker date="1407321039721" expanded="true" signature="1014:7020" placeholder="{...}" />
   1.431 +            <marker date="1407321039721" expanded="true" signature="1106:1726" placeholder="//..." />
   1.432 +            <marker date="1407321039721" expanded="true" signature="1732:2111" placeholder="//..." />
   1.433 +            <marker date="1407321039721" expanded="true" signature="2238:2408" placeholder="//..." />
   1.434 +            <marker date="1407321039721" expanded="true" signature="2471:2565" placeholder="//..." />
   1.435 +            <marker date="1407321039721" expanded="true" signature="2569:2800" placeholder="//..." />
   1.436 +            <marker date="1407321039721" expanded="true" signature="2803:3156" placeholder="//..." />
   1.437 +            <marker date="1407321039721" expanded="true" signature="3219:3352" placeholder="{&quot;type&quot;: 'container'...}" />
   1.438 +            <marker date="1407321039721" expanded="true" signature="3580:3822" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.439 +            <marker date="1407321039721" expanded="true" signature="3943:4185" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.440 +            <marker date="1407321039721" expanded="true" signature="4335:4549" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.441 +            <marker date="1407321039721" expanded="true" signature="4730:4944" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.442 +            <marker date="1407321039721" expanded="true" signature="4997:5211" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.443 +            <marker date="1407321039721" expanded="true" signature="5264:5478" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.444 +            <marker date="1407321039721" expanded="true" signature="5531:5745" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.445 +            <marker date="1407321039721" expanded="true" signature="5922:6136" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.446 +            <marker date="1407321039721" expanded="true" signature="6189:6403" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.447 +            <marker date="1407321039721" expanded="true" signature="6456:6670" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.448 +            <marker date="1407321039721" expanded="true" signature="6801:6967" placeholder="//..." />
   1.449 +            <marker date="1407321039721" expanded="true" signature="7028:7149" placeholder="{...}" />
   1.450 +          </folding>
   1.451          </state>
   1.452        </provider>
   1.453      </entry>
   1.454 @@ -427,7 +601,8 @@
   1.455          <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="12597">
   1.456            <caret line="9" column="0" selection-start-line="9" selection-start-column="0" selection-end-line="9" selection-end-column="0" />
   1.457            <folding>
   1.458 -            <marker date="1407386727801" expanded="false" signature="24156:24212" placeholder="..." />
   1.459 +            <element signature="n#!!doc" expanded="true" />
   1.460 +            <marker date="1407558065893" expanded="true" signature="18879:18935" placeholder="..." />
   1.461            </folding>
   1.462          </state>
   1.463        </provider>
   1.464 @@ -469,7 +644,39 @@
   1.465          <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="3043">
   1.466            <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
   1.467            <folding>
   1.468 -            <marker date="1407395337135" expanded="true" signature="6283:6331" placeholder="..." />
   1.469 +            <marker date="1407447259235" expanded="true" signature="2:297" placeholder="//..." />
   1.470 +            <marker date="1407447259235" expanded="true" signature="299:650" placeholder="//..." />
   1.471 +            <marker date="1407447259235" expanded="true" signature="693:6895" placeholder="{...}" />
   1.472 +            <marker date="1407447259235" expanded="true" signature="1250:1476" placeholder="//..." />
   1.473 +            <marker date="1407447259235" expanded="true" signature="1558:1942" placeholder="{...}" />
   1.474 +            <marker date="1407447259235" expanded="true" signature="1562:1909" placeholder="//..." />
   1.475 +            <marker date="1407447259235" expanded="true" signature="1944:2237" placeholder="//..." />
   1.476 +            <marker date="1407447259235" expanded="true" signature="2279:6051" placeholder="{...}" />
   1.477 +            <marker date="1407447259235" expanded="true" signature="2282:2372" placeholder="//..." />
   1.478 +            <marker date="1407447259235" expanded="true" signature="2513:2694" placeholder="//..." />
   1.479 +            <marker date="1407447259235" expanded="true" signature="2737:2929" placeholder="{...}" />
   1.480 +            <marker date="1407447259235" expanded="true" signature="2741:2835" placeholder="//..." />
   1.481 +            <marker date="1407447259235" expanded="true" signature="2899:2926" placeholder="{&quot;overflow&quot;: 'hidden'...}" />
   1.482 +            <marker date="1407447259235" expanded="true" signature="2967:3799" placeholder="//..." />
   1.483 +            <marker date="1407447259235" expanded="true" signature="4247:6049" placeholder="{...}" />
   1.484 +            <marker date="1407447259235" expanded="true" signature="4462:5979" placeholder="{...}" />
   1.485 +            <marker date="1407447259235" expanded="true" signature="4544:4684" placeholder="//..." />
   1.486 +            <marker date="1407447259235" expanded="true" signature="4721:5547" placeholder="{...}" />
   1.487 +            <marker date="1407447259235" expanded="true" signature="4763:4866" placeholder="{...}" />
   1.488 +            <marker date="1407447259235" expanded="true" signature="4827:4860" placeholder="{&quot;overflow&quot;: 'hidden'...}" />
   1.489 +            <marker date="1407447259235" expanded="true" signature="4904:4984" placeholder="{...}" />
   1.490 +            <marker date="1407447259235" expanded="true" signature="5198:5418" placeholder="{...}" />
   1.491 +            <marker date="1407447259235" expanded="true" signature="5230:5314" placeholder="{...}" />
   1.492 +            <marker date="1407447259235" expanded="true" signature="5619:5975" placeholder="{...}" />
   1.493 +            <marker date="1407447259235" expanded="true" signature="5650:5731" placeholder="{...}" />
   1.494 +            <marker date="1407447259235" expanded="true" signature="5831:5911" placeholder="{...}" />
   1.495 +            <marker date="1407447259235" expanded="true" signature="6069:6615" placeholder="{...}" />
   1.496 +            <marker date="1407447259235" expanded="true" signature="6160:6471" placeholder="{&quot;content&quot;: '&lt;svg width=&quot;100&quot; height=&quot;80&quot;&gt;&lt;rect x=&quot;30&quot; y=&quot;10&quot; rx=&quot;20&quot; ry=&quot;20&quot; width=&quot;50&quot; height=&quot;50&quot; style=&quot;fill:red;stroke:black;stroke-width:3;opacity:0.5&quot;&gt;'...}" />
   1.497 +            <marker date="1407447259235" expanded="true" signature="6291:6339" placeholder="..." />
   1.498 +            <marker date="1407447259235" expanded="true" signature="6359:6468" placeholder="{&quot;color&quot;: 'white'...}" />
   1.499 +            <marker date="1407447259235" expanded="true" signature="6513:6563" placeholder="{...}" />
   1.500 +            <marker date="1407447259235" expanded="true" signature="6660:6735" placeholder="{...}" />
   1.501 +            <marker date="1407447259235" expanded="true" signature="6743:6892" placeholder="{...}" />
   1.502            </folding>
   1.503          </state>
   1.504        </provider>
   1.505 @@ -478,7 +685,34 @@
   1.506        <provider selected="true" editor-type-id="text-editor">
   1.507          <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="3876">
   1.508            <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
   1.509 -          <folding />
   1.510 +          <folding>
   1.511 +            <marker date="1407321039721" expanded="true" signature="2:108" placeholder="//..." />
   1.512 +            <marker date="1407321039721" expanded="true" signature="151:7152" placeholder="{...}" />
   1.513 +            <marker date="1407321039721" expanded="true" signature="293:376" placeholder="{...}" />
   1.514 +            <marker date="1407321039721" expanded="true" signature="415:494" placeholder="{...}" />
   1.515 +            <marker date="1407321039721" expanded="true" signature="536:651" placeholder="{...}" />
   1.516 +            <marker date="1407321039721" expanded="true" signature="654:960" placeholder="//..." />
   1.517 +            <marker date="1407321039721" expanded="true" signature="1014:7020" placeholder="{...}" />
   1.518 +            <marker date="1407321039721" expanded="true" signature="1106:1726" placeholder="//..." />
   1.519 +            <marker date="1407321039721" expanded="true" signature="1732:2111" placeholder="//..." />
   1.520 +            <marker date="1407321039721" expanded="true" signature="2238:2408" placeholder="//..." />
   1.521 +            <marker date="1407321039721" expanded="true" signature="2471:2565" placeholder="//..." />
   1.522 +            <marker date="1407321039721" expanded="true" signature="2569:2800" placeholder="//..." />
   1.523 +            <marker date="1407321039721" expanded="true" signature="2803:3156" placeholder="//..." />
   1.524 +            <marker date="1407321039721" expanded="true" signature="3219:3352" placeholder="{&quot;type&quot;: 'container'...}" />
   1.525 +            <marker date="1407321039721" expanded="true" signature="3580:3822" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.526 +            <marker date="1407321039721" expanded="true" signature="3943:4185" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.527 +            <marker date="1407321039721" expanded="true" signature="4335:4549" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.528 +            <marker date="1407321039721" expanded="true" signature="4730:4944" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.529 +            <marker date="1407321039721" expanded="true" signature="4997:5211" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.530 +            <marker date="1407321039721" expanded="true" signature="5264:5478" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.531 +            <marker date="1407321039721" expanded="true" signature="5531:5745" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.532 +            <marker date="1407321039721" expanded="true" signature="5922:6136" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.533 +            <marker date="1407321039721" expanded="true" signature="6189:6403" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.534 +            <marker date="1407321039721" expanded="true" signature="6456:6670" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.535 +            <marker date="1407321039721" expanded="true" signature="6801:6967" placeholder="//..." />
   1.536 +            <marker date="1407321039721" expanded="true" signature="7028:7149" placeholder="{...}" />
   1.537 +          </folding>
   1.538          </state>
   1.539        </provider>
   1.540      </entry>
   1.541 @@ -495,7 +729,8 @@
   1.542          <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="12648">
   1.543            <caret line="267" column="0" selection-start-line="267" selection-start-column="0" selection-end-line="267" selection-end-column="0" />
   1.544            <folding>
   1.545 -            <marker date="1407386727801" expanded="false" signature="24156:24212" placeholder="..." />
   1.546 +            <element signature="n#!!doc" expanded="true" />
   1.547 +            <marker date="1407558065893" expanded="true" signature="18879:18935" placeholder="..." />
   1.548            </folding>
   1.549          </state>
   1.550        </provider>
   1.551 @@ -529,7 +764,39 @@
   1.552          <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="3043">
   1.553            <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
   1.554            <folding>
   1.555 -            <marker date="1407395337135" expanded="true" signature="6283:6331" placeholder="..." />
   1.556 +            <marker date="1407447259235" expanded="true" signature="2:297" placeholder="//..." />
   1.557 +            <marker date="1407447259235" expanded="true" signature="299:650" placeholder="//..." />
   1.558 +            <marker date="1407447259235" expanded="true" signature="693:6895" placeholder="{...}" />
   1.559 +            <marker date="1407447259235" expanded="true" signature="1250:1476" placeholder="//..." />
   1.560 +            <marker date="1407447259235" expanded="true" signature="1558:1942" placeholder="{...}" />
   1.561 +            <marker date="1407447259235" expanded="true" signature="1562:1909" placeholder="//..." />
   1.562 +            <marker date="1407447259235" expanded="true" signature="1944:2237" placeholder="//..." />
   1.563 +            <marker date="1407447259235" expanded="true" signature="2279:6051" placeholder="{...}" />
   1.564 +            <marker date="1407447259235" expanded="true" signature="2282:2372" placeholder="//..." />
   1.565 +            <marker date="1407447259235" expanded="true" signature="2513:2694" placeholder="//..." />
   1.566 +            <marker date="1407447259235" expanded="true" signature="2737:2929" placeholder="{...}" />
   1.567 +            <marker date="1407447259235" expanded="true" signature="2741:2835" placeholder="//..." />
   1.568 +            <marker date="1407447259235" expanded="true" signature="2899:2926" placeholder="{&quot;overflow&quot;: 'hidden'...}" />
   1.569 +            <marker date="1407447259235" expanded="true" signature="2967:3799" placeholder="//..." />
   1.570 +            <marker date="1407447259235" expanded="true" signature="4247:6049" placeholder="{...}" />
   1.571 +            <marker date="1407447259235" expanded="true" signature="4462:5979" placeholder="{...}" />
   1.572 +            <marker date="1407447259235" expanded="true" signature="4544:4684" placeholder="//..." />
   1.573 +            <marker date="1407447259235" expanded="true" signature="4721:5547" placeholder="{...}" />
   1.574 +            <marker date="1407447259235" expanded="true" signature="4763:4866" placeholder="{...}" />
   1.575 +            <marker date="1407447259235" expanded="true" signature="4827:4860" placeholder="{&quot;overflow&quot;: 'hidden'...}" />
   1.576 +            <marker date="1407447259235" expanded="true" signature="4904:4984" placeholder="{...}" />
   1.577 +            <marker date="1407447259235" expanded="true" signature="5198:5418" placeholder="{...}" />
   1.578 +            <marker date="1407447259235" expanded="true" signature="5230:5314" placeholder="{...}" />
   1.579 +            <marker date="1407447259235" expanded="true" signature="5619:5975" placeholder="{...}" />
   1.580 +            <marker date="1407447259235" expanded="true" signature="5650:5731" placeholder="{...}" />
   1.581 +            <marker date="1407447259235" expanded="true" signature="5831:5911" placeholder="{...}" />
   1.582 +            <marker date="1407447259235" expanded="true" signature="6069:6615" placeholder="{...}" />
   1.583 +            <marker date="1407447259235" expanded="true" signature="6160:6471" placeholder="{&quot;content&quot;: '&lt;svg width=&quot;100&quot; height=&quot;80&quot;&gt;&lt;rect x=&quot;30&quot; y=&quot;10&quot; rx=&quot;20&quot; ry=&quot;20&quot; width=&quot;50&quot; height=&quot;50&quot; style=&quot;fill:red;stroke:black;stroke-width:3;opacity:0.5&quot;&gt;'...}" />
   1.584 +            <marker date="1407447259235" expanded="true" signature="6291:6339" placeholder="..." />
   1.585 +            <marker date="1407447259235" expanded="true" signature="6359:6468" placeholder="{&quot;color&quot;: 'white'...}" />
   1.586 +            <marker date="1407447259235" expanded="true" signature="6513:6563" placeholder="{...}" />
   1.587 +            <marker date="1407447259235" expanded="true" signature="6660:6735" placeholder="{...}" />
   1.588 +            <marker date="1407447259235" expanded="true" signature="6743:6892" placeholder="{...}" />
   1.589            </folding>
   1.590          </state>
   1.591        </provider>
   1.592 @@ -538,7 +805,34 @@
   1.593        <provider selected="true" editor-type-id="text-editor">
   1.594          <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="3876">
   1.595            <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
   1.596 -          <folding />
   1.597 +          <folding>
   1.598 +            <marker date="1407321039721" expanded="true" signature="2:108" placeholder="//..." />
   1.599 +            <marker date="1407321039721" expanded="true" signature="151:7152" placeholder="{...}" />
   1.600 +            <marker date="1407321039721" expanded="true" signature="293:376" placeholder="{...}" />
   1.601 +            <marker date="1407321039721" expanded="true" signature="415:494" placeholder="{...}" />
   1.602 +            <marker date="1407321039721" expanded="true" signature="536:651" placeholder="{...}" />
   1.603 +            <marker date="1407321039721" expanded="true" signature="654:960" placeholder="//..." />
   1.604 +            <marker date="1407321039721" expanded="true" signature="1014:7020" placeholder="{...}" />
   1.605 +            <marker date="1407321039721" expanded="true" signature="1106:1726" placeholder="//..." />
   1.606 +            <marker date="1407321039721" expanded="true" signature="1732:2111" placeholder="//..." />
   1.607 +            <marker date="1407321039721" expanded="true" signature="2238:2408" placeholder="//..." />
   1.608 +            <marker date="1407321039721" expanded="true" signature="2471:2565" placeholder="//..." />
   1.609 +            <marker date="1407321039721" expanded="true" signature="2569:2800" placeholder="//..." />
   1.610 +            <marker date="1407321039721" expanded="true" signature="2803:3156" placeholder="//..." />
   1.611 +            <marker date="1407321039721" expanded="true" signature="3219:3352" placeholder="{&quot;type&quot;: 'container'...}" />
   1.612 +            <marker date="1407321039721" expanded="true" signature="3580:3822" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.613 +            <marker date="1407321039721" expanded="true" signature="3943:4185" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.614 +            <marker date="1407321039721" expanded="true" signature="4335:4549" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.615 +            <marker date="1407321039721" expanded="true" signature="4730:4944" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.616 +            <marker date="1407321039721" expanded="true" signature="4997:5211" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.617 +            <marker date="1407321039721" expanded="true" signature="5264:5478" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.618 +            <marker date="1407321039721" expanded="true" signature="5531:5745" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.619 +            <marker date="1407321039721" expanded="true" signature="5922:6136" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.620 +            <marker date="1407321039721" expanded="true" signature="6189:6403" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.621 +            <marker date="1407321039721" expanded="true" signature="6456:6670" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.622 +            <marker date="1407321039721" expanded="true" signature="6801:6967" placeholder="//..." />
   1.623 +            <marker date="1407321039721" expanded="true" signature="7028:7149" placeholder="{...}" />
   1.624 +          </folding>
   1.625          </state>
   1.626        </provider>
   1.627      </entry>
   1.628 @@ -555,7 +849,8 @@
   1.629          <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="12070">
   1.630            <caret line="59" column="21" selection-start-line="59" selection-start-column="21" selection-end-line="59" selection-end-column="21" />
   1.631            <folding>
   1.632 -            <marker date="1407386727801" expanded="false" signature="24156:24212" placeholder="..." />
   1.633 +            <element signature="n#!!doc" expanded="true" />
   1.634 +            <marker date="1407558065893" expanded="true" signature="18879:18935" placeholder="..." />
   1.635            </folding>
   1.636          </state>
   1.637        </provider>
   1.638 @@ -590,48 +885,6 @@
   1.639          </state>
   1.640        </provider>
   1.641      </entry>
   1.642 -    <entry file="file://$PROJECT_DIR$/MVDM_implementation/POPDisplay.html">
   1.643 -      <provider selected="true" editor-type-id="text-editor">
   1.644 -        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="918">
   1.645 -          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
   1.646 -          <folding />
   1.647 -        </state>
   1.648 -      </provider>
   1.649 -    </entry>
   1.650 -    <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/POPSyntaxGraphModifier.js">
   1.651 -      <provider selected="true" editor-type-id="text-editor">
   1.652 -        <state vertical-scroll-proportion="0.0" vertical-offset="530" max-vertical-offset="1003">
   1.653 -          <caret line="40" column="20" selection-start-line="40" selection-start-column="20" selection-end-line="40" selection-end-column="20" />
   1.654 -          <folding />
   1.655 -        </state>
   1.656 -      </provider>
   1.657 -    </entry>
   1.658 -    <entry file="file://$PROJECT_DIR$/MVDM_implementation/lib/require.js">
   1.659 -      <provider selected="true" editor-type-id="text-editor">
   1.660 -        <state vertical-scroll-proportion="0.0" vertical-offset="27963" max-vertical-offset="35309">
   1.661 -          <caret line="1657" column="0" selection-start-line="1657" selection-start-column="0" selection-end-line="1658" selection-end-column="0" />
   1.662 -          <folding />
   1.663 -        </state>
   1.664 -      </provider>
   1.665 -    </entry>
   1.666 -    <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/POPApp.js">
   1.667 -      <provider selected="true" editor-type-id="text-editor">
   1.668 -        <state vertical-scroll-proportion="0.0" vertical-offset="139" max-vertical-offset="918">
   1.669 -          <caret line="17" column="14" selection-start-line="17" selection-start-column="14" selection-end-line="17" selection-end-column="14" />
   1.670 -          <folding />
   1.671 -        </state>
   1.672 -      </provider>
   1.673 -    </entry>
   1.674 -    <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/buildGabePatternSyntaxGraph.js">
   1.675 -      <provider selected="true" editor-type-id="text-editor">
   1.676 -        <state vertical-scroll-proportion="-5.76" vertical-offset="944" max-vertical-offset="10098">
   1.677 -          <caret line="66" column="0" selection-start-line="66" selection-start-column="0" selection-end-line="66" selection-end-column="0" />
   1.678 -          <folding>
   1.679 -            <marker date="1407386727801" expanded="false" signature="24156:24212" placeholder="..." />
   1.680 -          </folding>
   1.681 -        </state>
   1.682 -      </provider>
   1.683 -    </entry>
   1.684      <entry file="file://$PROJECT_DIR$/GabePattern/GabePattern_data_structs.js">
   1.685        <provider selected="true" editor-type-id="text-editor">
   1.686          <state vertical-scroll-proportion="0.49880096" vertical-offset="217" max-vertical-offset="7548">
   1.687 @@ -648,18 +901,10 @@
   1.688          </state>
   1.689        </provider>
   1.690      </entry>
   1.691 -    <entry file="file://$PROJECT_DIR$/../../6__Website/POPBottleServer/POPBottleServer.py">
   1.692 +    <entry file="file://$PROJECT_DIR$/MVDM_implementation/POPDisplay.html">
   1.693        <provider selected="true" editor-type-id="text-editor">
   1.694 -        <state vertical-scroll-proportion="0.0" vertical-offset="165" max-vertical-offset="1173">
   1.695 -          <caret line="28" column="0" selection-start-line="28" selection-start-column="0" selection-end-line="28" selection-end-column="0" />
   1.696 -          <folding />
   1.697 -        </state>
   1.698 -      </provider>
   1.699 -    </entry>
   1.700 -    <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/GabePatternSrcHolder.js">
   1.701 -      <provider selected="true" editor-type-id="text-editor">
   1.702 -        <state vertical-scroll-proportion="-5.2" vertical-offset="4188" max-vertical-offset="7310">
   1.703 -          <caret line="254" column="0" selection-start-line="254" selection-start-column="0" selection-end-line="254" selection-end-column="0" />
   1.704 +        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="918">
   1.705 +          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
   1.706            <folding />
   1.707          </state>
   1.708        </provider>
   1.709 @@ -674,22 +919,624 @@
   1.710      </entry>
   1.711      <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/POPSyntaxGraphVisualizer.js">
   1.712        <provider selected="true" editor-type-id="text-editor">
   1.713 -        <state vertical-scroll-proportion="0.0" vertical-offset="807" max-vertical-offset="4131">
   1.714 +        <state vertical-scroll-proportion="0.0" vertical-offset="754" max-vertical-offset="4131">
   1.715            <caret line="56" column="0" selection-start-line="56" selection-start-column="0" selection-end-line="56" selection-end-column="0" />
   1.716 +          <folding>
   1.717 +            <marker date="1407321039721" expanded="true" signature="2:108" placeholder="//..." />
   1.718 +            <marker date="1407321039721" expanded="true" signature="151:7152" placeholder="{...}" />
   1.719 +            <marker date="1407321039721" expanded="true" signature="293:376" placeholder="{...}" />
   1.720 +            <marker date="1407321039721" expanded="true" signature="415:494" placeholder="{...}" />
   1.721 +            <marker date="1407321039721" expanded="true" signature="536:651" placeholder="{...}" />
   1.722 +            <marker date="1407321039721" expanded="true" signature="654:960" placeholder="//..." />
   1.723 +            <marker date="1407321039721" expanded="true" signature="1014:7020" placeholder="{...}" />
   1.724 +            <marker date="1407321039721" expanded="true" signature="1106:1726" placeholder="//..." />
   1.725 +            <marker date="1407321039721" expanded="true" signature="1732:2111" placeholder="//..." />
   1.726 +            <marker date="1407321039721" expanded="true" signature="2238:2408" placeholder="//..." />
   1.727 +            <marker date="1407321039721" expanded="true" signature="2471:2565" placeholder="//..." />
   1.728 +            <marker date="1407321039721" expanded="true" signature="2569:2800" placeholder="//..." />
   1.729 +            <marker date="1407321039721" expanded="true" signature="2803:3156" placeholder="//..." />
   1.730 +            <marker date="1407321039721" expanded="true" signature="3219:3352" placeholder="{&quot;type&quot;: 'container'...}" />
   1.731 +            <marker date="1407321039721" expanded="true" signature="3580:3822" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.732 +            <marker date="1407321039721" expanded="true" signature="3943:4185" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.733 +            <marker date="1407321039721" expanded="true" signature="4335:4549" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.734 +            <marker date="1407321039721" expanded="true" signature="4730:4944" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.735 +            <marker date="1407321039721" expanded="true" signature="4997:5211" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.736 +            <marker date="1407321039721" expanded="true" signature="5264:5478" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.737 +            <marker date="1407321039721" expanded="true" signature="5531:5745" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.738 +            <marker date="1407321039721" expanded="true" signature="5922:6136" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.739 +            <marker date="1407321039721" expanded="true" signature="6189:6403" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.740 +            <marker date="1407321039721" expanded="true" signature="6456:6670" placeholder="{&quot;type&quot;: 'shape'...}" />
   1.741 +            <marker date="1407321039721" expanded="true" signature="6801:6967" placeholder="//..." />
   1.742 +            <marker date="1407321039721" expanded="true" signature="7028:7149" placeholder="{...}" />
   1.743 +          </folding>
   1.744 +        </state>
   1.745 +      </provider>
   1.746 +    </entry>
   1.747 +    <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/POPSyntaxGraphModifier.js">
   1.748 +      <provider selected="true" editor-type-id="text-editor">
   1.749 +        <state vertical-scroll-proportion="0.0" vertical-offset="530" max-vertical-offset="1003">
   1.750 +          <caret line="40" column="20" selection-start-line="40" selection-start-column="20" selection-end-line="40" selection-end-column="20" />
   1.751            <folding />
   1.752          </state>
   1.753        </provider>
   1.754      </entry>
   1.755 +    <entry file="file://$PROJECT_DIR$/MVDM_implementation/lib/require.js">
   1.756 +      <provider selected="true" editor-type-id="text-editor">
   1.757 +        <state vertical-scroll-proportion="0.0" vertical-offset="27963" max-vertical-offset="35309">
   1.758 +          <caret line="1657" column="0" selection-start-line="1657" selection-start-column="0" selection-end-line="1658" selection-end-column="0" />
   1.759 +          <folding>
   1.760 +            <marker date="1404176020000" expanded="false" signature="-1:-1" placeholder="/** @license RequireJS 2.1.14 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved. ...*/" />
   1.761 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.762 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/*...*/" />
   1.763 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/*...*/" />
   1.764 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.765 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.766 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.767 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.768 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Helper function for iterating over an array. If the func returns ...*/" />
   1.769 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.770 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.771 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.772 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.773 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Helper function for iterating over an array backwards. If the func ...*/" />
   1.774 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.775 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.776 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.777 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.778 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.779 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.780 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Cycles over properties in an object and calls a function for each ...*/" />
   1.781 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.782 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.783 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.784 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.785 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Simple function to mix in properties from source into target, ...*/" />
   1.786 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.787 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.788 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.789 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.790 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.791 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.792 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.793 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.794 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.795 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.796 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.797 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.798 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.799 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.800 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.801 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.802 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Constructs an error with a pointer to an URL with more information. ...*/" />
   1.803 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.804 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.805 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.806 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.807 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.808 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.809 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.810 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.811 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{&quot;waitSeconds&quot;: 7...}" />
   1.812 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.813 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.814 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Trims the . and .. from an array of path segments. ...*/" />
   1.815 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.816 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.817 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.818 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.819 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.820 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.821 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.822 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Given a relative module name, like ./something, normalize it to ...*/" />
   1.823 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.824 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.825 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.826 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.827 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.828 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.829 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.830 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.831 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.832 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.833 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.834 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.835 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.836 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.837 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.838 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.839 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.840 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.841 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.842 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.843 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.844 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.845 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.846 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.847 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.848 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.849 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.850 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{&quot;skipMap&quot;: true...}" />
   1.851 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.852 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.853 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.854 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Creates a module mapping that includes plugin prefix, module ...*/" />
   1.855 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.856 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.857 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.858 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.859 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.860 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.861 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.862 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.863 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.864 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.865 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.866 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.867 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.868 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.869 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.870 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.871 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.872 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.873 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.874 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.875 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.876 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.877 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.878 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.879 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.880 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.881 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.882 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.883 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.884 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Internal method to transfer globalQueue items to this context's ...*/" />
   1.885 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.886 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.887 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.888 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.889 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.890 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.891 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.892 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.893 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.894 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.895 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.896 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.897 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.898 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.899 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.900 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.901 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.902 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.903 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.904 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.905 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.906 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.907 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.908 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.909 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.910 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.911 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.912 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.913 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.914 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.915 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.916 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.917 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.918 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.919 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.920 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.921 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.922 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.923 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.924 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.925 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.926 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.927 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.928 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.929 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.930 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.931 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.932 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/*...*/" />
   1.933 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.934 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.935 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.936 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.937 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.938 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.939 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.940 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.941 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.942 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.943 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.944 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.945 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.946 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.947 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.948 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.949 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.950 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.951 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.952 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.953 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{&quot;enableBuildCallback&quot;: true...}" />
   1.954 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.955 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.956 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.957 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.958 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Checks if the module is ready to define itself, and if so, ...*/" />
   1.959 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.960 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.961 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.962 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.963 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.964 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.965 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.966 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.967 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.968 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.969 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.970 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.971 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.972 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.973 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.974 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.975 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.976 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.977 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.978 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.979 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.980 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.981 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.982 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.983 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.984 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.985 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{&quot;enableBuildCallback&quot;: true...}" />
   1.986 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.987 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.988 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.989 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.990 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.991 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.992 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{&quot;enabled&quot;: true...}" />
   1.993 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.994 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.995 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.996 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.997 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
   1.998 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
   1.999 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1000 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{&quot;enabled&quot;: true...}" />
  1.1001 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1002 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1003 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1004 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1005 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1006 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1007 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/*...*/" />
  1.1008 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1009 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1010 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1011 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1012 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1013 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1014 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1015 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1016 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1017 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1018 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1019 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1020 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1021 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1022 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1023 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1024 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1025 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1026 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1027 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1028 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1029 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1030 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1031 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1032 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1033 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1034 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1035 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1036 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1037 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1038 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1039 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1040 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1041 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1042 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1043 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1044 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1045 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1046 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1047 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Given an event from a script node, get the requirejs info from it, ...*/" />
  1.1048 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1049 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1050 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1051 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1052 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1053 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1054 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1055 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1056 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1057 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Set a configuration for the context. ...*/" />
  1.1058 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1059 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1060 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1061 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1062 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{&quot;paths&quot;: true...}" />
  1.1063 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1064 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1065 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1066 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1067 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1068 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1069 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1070 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1071 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1072 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1073 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1074 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1075 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1076 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1077 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1078 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1079 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1080 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1081 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1082 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1083 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1084 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1085 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1086 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1087 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1088 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1089 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1090 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1091 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1092 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1093 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1094 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1095 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1096 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1097 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1098 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1099 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1100 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1101 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1102 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{&quot;enabled&quot;: true...}" />
  1.1103 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1104 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Converts a module name + .extension into an URL path. ...*/" />
  1.1105 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1106 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1107 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1108 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1109 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1110 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1111 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1112 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1113 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1114 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1115 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1116 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1117 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1118 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1119 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Called to enable a module if it is still in the registry ...*/" />
  1.1120 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1121 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1122 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Internal method used by environment adapters to complete a load event. ...*/" />
  1.1123 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1124 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1125 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1126 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1127 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1128 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1129 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1130 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1131 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1132 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1133 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1134 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1135 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1136 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Converts a module name to a file path. Supports cases where ...*/" />
  1.1137 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1138 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1139 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1140 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1141 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1142 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1143 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1144 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1145 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1146 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1147 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1148 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1149 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1150 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1151 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Executes a module callback function. Broken out as a separate function ...*/" />
  1.1152 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1153 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** callback for script loads, used to check status of loading. ...*/" />
  1.1154 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1155 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1156 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1157 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1158 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Callback for script errors. ...*/" />
  1.1159 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1160 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1161 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Main entry point. ...*/" />
  1.1162 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1163 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1164 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1165 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1166 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1167 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1168 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1169 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Support require.config() to make it easier to cooperate with other ...*/" />
  1.1170 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1171 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Execute something after the current tick ...*/" />
  1.1172 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1173 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Export require as a global, but only if it does not already exist. ...*/" />
  1.1174 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1175 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1176 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="[...]" />
  1.1177 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1178 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1179 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1180 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1181 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1182 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1183 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Any errors that require explicitly generates will be passed to this ...*/" />
  1.1184 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Creates the node for the load command. Only used in browser envs. ...*/" />
  1.1185 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1186 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Does the request to load a module for the browser case. ...*/" />
  1.1187 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1188 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1189 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1190 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1191 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1192 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1193 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1194 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1195 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1196 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1197 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1198 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1199 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1200 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1201 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1202 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1203 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1204 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1205 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1206 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1207 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1208 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1209 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1210 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1211 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1212 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1213 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1214 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1215 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1216 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** The function that handles definitions of modules. Differs from ...*/" />
  1.1217 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1218 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1219 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1220 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1221 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1222 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1223 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1224 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1225 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1226 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1227 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1228 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1229 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1230 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="//..." />
  1.1231 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{&quot;jQuery&quot;: true...}" />
  1.1232 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/** Executes the text. Normally just uses eval, but can be modified ...*/" />
  1.1233 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="{...}" />
  1.1234 +            <marker date="1404176020000" expanded="true" signature="-1:-1" placeholder="/*...*/" />
  1.1235 +          </folding>
  1.1236 +        </state>
  1.1237 +      </provider>
  1.1238 +    </entry>
  1.1239      <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/POPDisplay.js">
  1.1240        <provider selected="true" editor-type-id="text-editor">
  1.1241 -        <state vertical-scroll-proportion="0.3112128" vertical-offset="1360" max-vertical-offset="3162">
  1.1242 -          <caret line="88" column="36" selection-start-line="88" selection-start-column="36" selection-end-line="88" selection-end-column="36" />
  1.1243 +        <state vertical-scroll-proportion="0.0" vertical-offset="697" max-vertical-offset="3162">
  1.1244 +          <caret line="51" column="7" selection-start-line="51" selection-start-column="7" selection-end-line="51" selection-end-column="7" />
  1.1245            <folding>
  1.1246 -            <marker date="1407395337135" expanded="true" signature="6283:6331" placeholder="..." />
  1.1247 +            <marker date="1407447259235" expanded="true" signature="2:297" placeholder="//..." />
  1.1248 +            <marker date="1407447259235" expanded="true" signature="299:650" placeholder="//..." />
  1.1249 +            <marker date="1407447259235" expanded="true" signature="693:6895" placeholder="{...}" />
  1.1250 +            <marker date="1407447259235" expanded="true" signature="1250:1476" placeholder="//..." />
  1.1251 +            <marker date="1407447259235" expanded="true" signature="1558:1942" placeholder="{...}" />
  1.1252 +            <marker date="1407447259235" expanded="true" signature="1562:1909" placeholder="//..." />
  1.1253 +            <marker date="1407447259235" expanded="true" signature="1944:2237" placeholder="//..." />
  1.1254 +            <marker date="1407447259235" expanded="true" signature="2279:6051" placeholder="{...}" />
  1.1255 +            <marker date="1407447259235" expanded="true" signature="2282:2372" placeholder="//..." />
  1.1256 +            <marker date="1407447259235" expanded="true" signature="2513:2694" placeholder="//..." />
  1.1257 +            <marker date="1407447259235" expanded="true" signature="2737:2929" placeholder="{...}" />
  1.1258 +            <marker date="1407447259235" expanded="true" signature="2741:2835" placeholder="//..." />
  1.1259 +            <marker date="1407447259235" expanded="true" signature="2899:2926" placeholder="{&quot;overflow&quot;: 'hidden'...}" />
  1.1260 +            <marker date="1407447259235" expanded="true" signature="2967:3799" placeholder="//..." />
  1.1261 +            <marker date="1407447259235" expanded="true" signature="4247:6049" placeholder="{...}" />
  1.1262 +            <marker date="1407447259235" expanded="true" signature="4462:5979" placeholder="{...}" />
  1.1263 +            <marker date="1407447259235" expanded="true" signature="4544:4684" placeholder="//..." />
  1.1264 +            <marker date="1407447259235" expanded="true" signature="4721:5547" placeholder="{...}" />
  1.1265 +            <marker date="1407447259235" expanded="true" signature="4763:4866" placeholder="{...}" />
  1.1266 +            <marker date="1407447259235" expanded="true" signature="4827:4860" placeholder="{&quot;overflow&quot;: 'hidden'...}" />
  1.1267 +            <marker date="1407447259235" expanded="true" signature="4904:4984" placeholder="{...}" />
  1.1268 +            <marker date="1407447259235" expanded="true" signature="5198:5418" placeholder="{...}" />
  1.1269 +            <marker date="1407447259235" expanded="true" signature="5230:5314" placeholder="{...}" />
  1.1270 +            <marker date="1407447259235" expanded="true" signature="5619:5975" placeholder="{...}" />
  1.1271 +            <marker date="1407447259235" expanded="true" signature="5650:5731" placeholder="{...}" />
  1.1272 +            <marker date="1407447259235" expanded="true" signature="5831:5911" placeholder="{...}" />
  1.1273 +            <marker date="1407447259235" expanded="true" signature="6069:6615" placeholder="{...}" />
  1.1274 +            <marker date="1407447259235" expanded="true" signature="6160:6471" placeholder="{&quot;content&quot;: '&lt;svg width=&quot;100&quot; height=&quot;80&quot;&gt;&lt;rect x=&quot;30&quot; y=&quot;10&quot; rx=&quot;20&quot; ry=&quot;20&quot; width=&quot;50&quot; height=&quot;50&quot; style=&quot;fill:red;stroke:black;stroke-width:3;opacity:0.5&quot;&gt;'...}" />
  1.1275 +            <marker date="1407447259235" expanded="true" signature="6291:6339" placeholder="..." />
  1.1276 +            <marker date="1407447259235" expanded="true" signature="6359:6468" placeholder="{&quot;color&quot;: 'white'...}" />
  1.1277 +            <marker date="1407447259235" expanded="true" signature="6513:6563" placeholder="{...}" />
  1.1278 +            <marker date="1407447259235" expanded="true" signature="6660:6735" placeholder="{...}" />
  1.1279 +            <marker date="1407447259235" expanded="true" signature="6743:6892" placeholder="{...}" />
  1.1280            </folding>
  1.1281          </state>
  1.1282        </provider>
  1.1283      </entry>
  1.1284 +    <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/POPApp.js">
  1.1285 +      <provider selected="true" editor-type-id="text-editor">
  1.1286 +        <state vertical-scroll-proportion="0.0" vertical-offset="15" max-vertical-offset="918">
  1.1287 +          <caret line="17" column="14" selection-start-line="17" selection-start-column="14" selection-end-line="17" selection-end-column="14" />
  1.1288 +          <folding />
  1.1289 +        </state>
  1.1290 +      </provider>
  1.1291 +    </entry>
  1.1292 +    <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/buildGabePatternSyntaxGraph.js">
  1.1293 +      <provider selected="true" editor-type-id="text-editor">
  1.1294 +        <state vertical-scroll-proportion="0.0" vertical-offset="2625" max-vertical-offset="7650">
  1.1295 +          <caret line="163" column="0" selection-start-line="163" selection-start-column="0" selection-end-line="163" selection-end-column="0" />
  1.1296 +          <folding>
  1.1297 +            <element signature="n#!!doc" expanded="true" />
  1.1298 +            <marker date="1407558065893" expanded="true" signature="18879:18935" placeholder="..." />
  1.1299 +          </folding>
  1.1300 +        </state>
  1.1301 +      </provider>
  1.1302 +    </entry>
  1.1303 +    <entry file="file://$PROJECT_DIR$/../../6__Website/POPBottleServer/POPBottleServer.py">
  1.1304 +      <provider selected="true" editor-type-id="text-editor">
  1.1305 +        <state vertical-scroll-proportion="0.0" vertical-offset="304" max-vertical-offset="1292">
  1.1306 +          <caret line="32" column="33" selection-start-line="32" selection-start-column="33" selection-end-line="32" selection-end-column="33" />
  1.1307 +          <folding />
  1.1308 +        </state>
  1.1309 +      </provider>
  1.1310 +    </entry>
  1.1311 +    <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/POPGraphClasses.js">
  1.1312 +      <provider selected="true" editor-type-id="text-editor">
  1.1313 +        <state vertical-scroll-proportion="0.0" vertical-offset="2115" max-vertical-offset="2941">
  1.1314 +          <caret line="133" column="9" selection-start-line="133" selection-start-column="9" selection-end-line="133" selection-end-column="9" />
  1.1315 +          <folding />
  1.1316 +        </state>
  1.1317 +      </provider>
  1.1318 +    </entry>
  1.1319 +    <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/persistence.js">
  1.1320 +      <provider selected="true" editor-type-id="text-editor">
  1.1321 +        <state vertical-scroll-proportion="-5.52" vertical-offset="8787" max-vertical-offset="11084">
  1.1322 +          <caret line="525" column="0" selection-start-line="525" selection-start-column="0" selection-end-line="525" selection-end-column="0" />
  1.1323 +          <folding />
  1.1324 +        </state>
  1.1325 +      </provider>
  1.1326 +    </entry>
  1.1327 +    <entry file="file://$PROJECT_DIR$/MVDM_implementation/app/GabePatternSrcHolder.js">
  1.1328 +      <provider selected="true" editor-type-id="text-editor">
  1.1329 +        <state vertical-scroll-proportion="0.2869757" vertical-offset="159" max-vertical-offset="612">
  1.1330 +          <caret line="17" column="12" selection-start-line="17" selection-start-column="12" selection-end-line="17" selection-end-column="12" />
  1.1331 +          <folding />
  1.1332 +        </state>
  1.1333 +      </provider>
  1.1334 +    </entry>
  1.1335    </component>
  1.1336  </project>
  1.1337  
     2.1 --- a/1__Development/0__Code_Dev/Javascript_approach/GabePattern/.~lock.12_Dc_02___Sample_Prog_to_hand_compile__with_syntax_graph__for_Gabe.odg#	Thu Aug 07 00:10:50 2014 -0700
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,1 +0,0 @@
     2.4 -S H,CrappyDell/Me,CrappyDell,02.08.2014 23:50,file:///C:/Users/Me/AppData/Roaming/OpenOffice/4;
     2.5 \ No newline at end of file
     3.1 --- a/1__Development/0__Code_Dev/Javascript_approach/MVDM_implementation/app/GabePatternSrcHolder.js	Thu Aug 07 00:10:50 2014 -0700
     3.2 +++ b/1__Development/0__Code_Dev/Javascript_approach/MVDM_implementation/app/GabePatternSrcHolder.js	Sat Aug 09 03:34:26 2014 -0700
     3.3 @@ -9,409 +9,15 @@
     3.4  var modifier    = require('./POPSyntaxGraphModifier');	
     3.5  var syntaxGraph = require('./buildGabePatternSyntaxGraph');
     3.6  
     3.7 -var theObjColl = syntaxGraph.rootElem.__proto__.__proto__;
     3.8 -function ConstructorBuffer(){
     3.9 -}
    3.10 +var persistence = require('./persistence');
    3.11  
    3.12 -function ShadowGraphElem() {
    3.13 -    this.portsInShadows = [];
    3.14 -    this.portsOutShadows = [];
    3.15 -    this.portsIn = [];
    3.16 -    this.portsOut = [];
    3.17 -    this.linkedElems = [];
    3.18 -    this.viewSet = {};
    3.19 -};
    3.20 -var shadowGraphElemProto = new ConstructorBuffer();
    3.21 -shadowGraphElemProto.__proto__ = theObjColl;
    3.22 -ShadowGraphElem.prototype = shadowGraphElemProto;
    3.23 -ShadowGraphElem.prototype.constructor = ShadowGraphElem;
    3.24 +//persistence.clearPersistentGraph();
    3.25 +//persistence.persistTheGraph( syntaxGraph );
    3.26 +//console.log("\npersisting graph done!\n")
    3.27  
    3.28 -//==================================================
    3.29 -//==
    3.30 -//==================================================
    3.31 -
    3.32 -//The src holder has to serialize the syntax graph out to persistent
    3.33 -// storage, and bring it back in, converting back to javascript objects
    3.34 -//JSON can stringify and then parse back, but it can't handle circuits
    3.35 -// in the graph, so have to write code that crawls the graph and
    3.36 -// individually stringifies each element
    3.37 -//So, the steps:
    3.38 -//-] crawl only the elements.  
    3.39 -//-] An element has properties, ports, and linked elements attached..
    3.40 -//- -] properties are fine as-is, the stringify will handle them
    3.41 -//- -] ports have pointers back to the element, so those must be replaced
    3.42 -//     with the element's ID before stringify
    3.43 -//- -] linked elements can potentially link back around in a 
    3.44 -//     circle, so replace those links with IDs before stringify
    3.45 -//
    3.46 -//-] start at root, get the first element.
    3.47 -//-] For a given element:
    3.48 -//- -] check whether marked as already visited if yes, return, else
    3.49 -//     continue
    3.50 -//- -] mark the element as having been visited
    3.51 -//- -] visit each port (save this position before visiting!), and 
    3.52 -//     for a given port:
    3.53 -//- - -] follow each pairedPort link, and process element linked to the 
    3.54 -//       paired port
    3.55 -//- - -] when come back, replace pairedPort pointer with ID of the
    3.56 -//       pointed-to port
    3.57 -//- -] for each element in the array of linked elements:
    3.58 -//- - -] visit and process the element linked to (save position first)
    3.59 -//- - -] when come back, replace the pointer with ID of the linked elem
    3.60 -//- -] when all the elment's ports and linked elems have been visited, 
    3.61 -//     return to the position were in just before visiting this element
    3.62 -//-] when no where to return to, then done! 
    3.63 -var persistTheGraph = function( theGraphRoot ) {
    3.64 -    var shadowGraphRoot = {};
    3.65 -
    3.66 -	startPersisting(); //send notice to web server that persist protocol is starting
    3.67 -    //save out the top level object that has the handles to the view hierarchy root
    3.68 -    // and the root element.  Also persist the view hierarchy root because it doesn't
    3.69 -    // fit cleanly to try to reach it from the root element..  by persisting it here,
    3.70 -    // can then do a single recursive call and only pass the next syntax element to
    3.71 -    // clean up.  Any view stuff will be reached from that element
    3.72 -    var rootElem = theGraphRoot.rootElem; //save 'cause pointers about to be replaced
    3.73 -    persistAnchorAndViewSetRoot( theGraphRoot, shadowGraphRoot );
    3.74 -	visitNextElemAndPersistIt( rootElem );
    3.75 -//	endPersisting();   //tell web server that persist protocol ended
    3.76 -
    3.77 -    //now, restore all the pointers, replacing the IDs with pointer to object
    3.78 -    restoreAnchorAndViewSetRoot( theGraphRoot, shadowGraphRoot );
    3.79 -    visitNextElemAndRestoreIt( rootElem );
    3.80 -}
    3.81 -
    3.82 -function persistAnchorAndViewSetRoot( theGraphRoot, shadowGraphRoot ) {
    3.83 -    //save the top level root object and the top view set, which is above
    3.84 -    // the view set of the root element
    3.85 -    //Replace pointer to root elem with its ID and cut off pointers
    3.86 -    // inside the root view set link, so JSON stringify only gets the root
    3.87 -    // view set and its one view set link object
    3.88 -    shadowGraphRoot.rootElem = theGraphRoot.rootElem;
    3.89 -    theGraphRoot.rootElem = theGraphRoot.rootElem.ID;
    3.90 -
    3.91 -    //remove the back link from the view set link back to the root view set
    3.92 -    shadowGraphRoot.backLinkToRootViewSet = theGraphRoot.rootViewSet.viewSetLinks[0].referenceViewSet;
    3.93 -    theGraphRoot.rootViewSet.viewSetLinks[0].referenceViewSet =
    3.94 -        theGraphRoot.rootViewSet.viewSetLinks[0].referenceViewSet.ID;
    3.95 -
    3.96 -    //cut off the view set link, that points to the view set of the root element
    3.97 -    shadowGraphRoot.linkToRootElemsViewSet =
    3.98 -        theGraphRoot.rootViewSet.viewSetLinks[0].subordinateViewSet;
    3.99 -    theGraphRoot.rootViewSet.viewSetLinks[0].subordinateViewSet =
   3.100 -        theGraphRoot.rootViewSet.viewSetLinks[0].subordinateViewSet.ID;
   3.101 -
   3.102 -    //Now, ready to go, stringify away!
   3.103 -    var stringOfGraphRoot = JSON.stringify( theGraphRoot, null, '\t' );
   3.104 -    console.log("JSON of graphRoot: " + stringOfGraphRoot );
   3.105 -    persistString( stringOfGraphRoot )
   3.106 -}
   3.107 -
   3.108 -//Contract: have already verified that this elem has not been visited before calling
   3.109 -var visitNextElemAndPersistIt = function( elem ) {
   3.110 -	//mark the element as having been visited
   3.111 -	elem.isAlreadyVisited = true;
   3.112 -
   3.113 -    //cut the back link going from the view set to the elem node
   3.114 -    if((elem.viewSet||{}).syntaxElem) {
   3.115 -        elem.viewSet.syntaxElem = elem.viewSet.syntaxElem.ID;
   3.116 -    }
   3.117 -
   3.118 -	//visit each port
   3.119 -    var elemToVisit = {}; var i = 0; var j = 0; var inPort = {};
   3.120 -    var ports = elem.portsIn; var numPorts = ports.length; var numPairedPorts = 0;
   3.121 -    for( j = 0; j < numPorts; j++ ) {
   3.122 -        inPort = ports[j];
   3.123 -        numPairedPorts = inPort.pairedPorts.length;
   3.124 -        //follow each pairedPort link
   3.125 -        for( i = 0; i < numPairedPorts; i++ ) {
   3.126 -            //process element linked to the paired port
   3.127 -            elemToVisit = inPort.pairedPorts[i].element;
   3.128 -            if( !elemToVisit.isAlreadyVisited ) {
   3.129 -                visitNextElemAndPersistIt( elemToVisit );
   3.130 -            }
   3.131 -            //back from visit, replace pointer with ID of pointed to port
   3.132 -            inPort.pairedPorts[i] = inPort.pairedPorts[i].ID;
   3.133 -        }
   3.134 -		//replace the element back-pointer in the port object
   3.135 -		inPort.element = inPort.element.ID;
   3.136 -    }
   3.137 -    ports = elem.portsOut; numPorts = ports.length; var outPort = {};
   3.138 -    for( j = 0; j < numPorts; j++ ) {
   3.139 -        outPort = ports[j];
   3.140 -        numPairedPorts = outPort.pairedPorts.length;
   3.141 -        //follow each pairedPort link
   3.142 -        for( i = 0; i < numPairedPorts; i++ ) {
   3.143 -            //process element linked to the paired port
   3.144 -            elemToVisit = outPort.pairedPorts[i].element;
   3.145 -            if( !elemToVisit.isAlreadyVisited ) {
   3.146 -                visitNextElemAndPersistIt( elemToVisit );
   3.147 -            }
   3.148 -            //when come back, replace pointer with ID of pointed to port
   3.149 -            outPort.pairedPorts[i] = outPort.pairedPorts[i].ID;
   3.150 -        }
   3.151 -		//replace the element back-pointer in the port object
   3.152 -		outPort.element = outPort.element.ID;
   3.153 -    }
   3.154 -    var numLinkedElems = elem.linkedElems.length;
   3.155 -    for( i = 0; i < numLinkedElems; i++ ) {
   3.156 -        if( !(elem.linkedElems[i].isAlreadyVisited) ) {
   3.157 -            visitNextElemAndPersistIt( elem.linkedElems[i] );
   3.158 -        }
   3.159 -        //back from visit, replace pointer with ID of pointed to elem
   3.160 -        elem.linkedElems[i] = elem.linkedElems[i].ID;
   3.161 -    }
   3.162 -
   3.163 -    //cut links to the view sets embedded within view set link objects
   3.164 -    if((elem.viewSet||{}).viewSetLinks) {
   3.165 -        var viewSet = elem.viewSet;
   3.166 -        var numLinked = viewSet.viewSetLinks.length;
   3.167 -        var viewSetLink = {};
   3.168 -        for (i = 0; i < numLinked; i++) {
   3.169 -            viewSetLink = viewSet.viewSetLinks[i];
   3.170 -            if( viewSetLink ) {
   3.171 -                viewSetLink.referenceViewSet = viewSetLink.referenceViewSet.ID;
   3.172 -                viewSetLink.subordinateViewSet = viewSetLink.subordinateViewSet.ID;
   3.173 -            }
   3.174 -        }
   3.175 -    }
   3.176 -    //cut back-links to parent view boxes within view set tree
   3.177 -    if((elem.viewSet||{}).rootViewBox ) {
   3.178 -        walkViewTree( elem.viewSet.rootViewBox );
   3.179 -    }
   3.180 -
   3.181 -    //this elem, and all objects reachable from it are now safe to be
   3.182 -    // stringified with JSON..  so do it!
   3.183 -    var stringOfElemNode = JSON.stringify( elem, null, '\t' );
   3.184 -	console.log("JSON of elem: " + stringOfElemNode );
   3.185 -    persistString( stringOfElemNode );
   3.186 -}
   3.187 -
   3.188 -//now that the graph, with its view sets, has been written out to JSON,
   3.189 -// go back and restore the pointers, replacing the IDs with actual pointer.
   3.190 -//Replace top pointers from a shadow, then after this can lookup pointers by ID
   3.191 -function restoreAnchorAndViewSetRoot( theGraphRoot, shadowGraphRoot ) {
   3.192 -    //just copy the above code and reverse the direction of the assignments!
   3.193 -    theGraphRoot.rootElem = shadowGraphRoot.rootElem;
   3.194 -
   3.195 -    //remove the back link from the view set link back to the root view set
   3.196 -    theGraphRoot.rootViewSet.viewSetLinks[0].referenceViewSet = shadowGraphRoot.backLinkToRootViewSet;
   3.197 -
   3.198 -    //cut off the view set link, that points to the view set of the root element
   3.199 -    theGraphRoot.rootViewSet.viewSetLinks[0].subordinateViewSet = shadowGraphRoot.linkToRootElemsViewSet;
   3.200 -}
   3.201 -
   3.202 -//Contract: have already verified that this elem has not been visited before calling
   3.203 -var visitNextElemAndRestoreIt = function( elem ) {
   3.204 -    //mark the element as having been visited
   3.205 -    elem.isAlreadyVisited = false;  //all start at true, making false marks as restored
   3.206 -
   3.207 -    //restore the back link going from the view set to the elem node
   3.208 -    if((elem.viewSet||{}).syntaxElem) { //idiom makes safe when viewset undefined
   3.209 -        elem.viewSet.syntaxElem = elem.getByID(elem.viewSet.syntaxElem);
   3.210 -    }
   3.211 -
   3.212 -    //restore each port
   3.213 -    var elemToVisit = {}; var i = 0; var j = 0; var inPort = {};
   3.214 -    var portsIn = elem.portsIn; var numPorts = portsIn.length; var numPairedPorts = 0;
   3.215 -    //as go along, restore pointers by looking them up
   3.216 -    for( j = 0; j < numPorts; j++ ) {
   3.217 -        inPort = portsIn[j];
   3.218 -
   3.219 -        //restore the element back-pointer in the port object
   3.220 -        inPort.element = inPort.getByID(inPort.element);
   3.221 -
   3.222 -        //follow each pairedPort link
   3.223 -        numPairedPorts = inPort.pairedPorts.length;
   3.224 -        for( i = 0; i < numPairedPorts; i++ ) {
   3.225 -            //process element linked to the paired port
   3.226 -            //first, replace pointer to port
   3.227 -            inPort.pairedPorts[i] = inPort.getByID(inPort.pairedPorts[i]);
   3.228 -            elemToVisit = inPort.pairedPorts[i].element;
   3.229 -            if( typeof elemToVisit == 'number' ) {
   3.230 -                //means the element back-pointer inside the port on the other end
   3.231 -                // is still the ID..  IE, that port and its element not restored yet
   3.232 -                visitNextElemAndRestoreIt( outPort.getByID(elemToVisit) );
   3.233 -            }
   3.234 -            else if( elemToVisit.isAlreadyVisited ) { //if still marked from before
   3.235 -                //don't think this case will ever come up!  if elem not restored,
   3.236 -                // then the elem's port's back pointer will still be an ID and above
   3.237 -                // if() will catch it..
   3.238 -                visitNextElemAndRestoreIt( elemToVisit );
   3.239 -            }
   3.240 -        }
   3.241 -    }
   3.242 -    var outPorts = elem.portsOut; numPorts = outPorts.length; var outPort = {};
   3.243 -    for( j = 0; j < numPorts; j++ ) {
   3.244 -        outPort = outPorts[j];
   3.245 -        //restore back link from outPort to its element
   3.246 -        outPort.element = outPort.getByID(outPort.element);
   3.247 -        numPairedPorts = outPort.pairedPorts.length;
   3.248 -        //visit each pairedPort link
   3.249 -        for( i = 0; i < numPairedPorts; i++ ) {
   3.250 -            //restore the pointer to the paired port
   3.251 -            outPort.pairedPorts[i] = outPort.getByID(outPort.pairedPorts[i]);
   3.252 -            //process element linked to the paired port
   3.253 -            elemToVisit = outPort.pairedPorts[i].element;
   3.254 -            if( typeof elemToVisit == 'number' ) {
   3.255 -                //means the element back-pointer inside the port on the other end
   3.256 -                // is still the ID..  IE, that port and its element not restored yet
   3.257 -                visitNextElemAndRestoreIt( outPort.getByID(elemToVisit) );
   3.258 -            }
   3.259 -            else if( elemToVisit.isAlreadyVisited ) { //if needs restoring
   3.260 -                //don't think this case will ever come up!  if not restored,
   3.261 -                // then the elem back pointer will still be an ID and above
   3.262 -                // if() will catch it..
   3.263 -                visitNextElemAndRestoreIt( elemToVisit );
   3.264 -            }
   3.265 -        }
   3.266 -    }
   3.267 -    var numLinkedElems = elem.linkedElems.length;
   3.268 -    for( i = 0; i < numLinkedElems; i++ ) {
   3.269 -        //restore linked elem first, then process that restored elem
   3.270 -        elem.linkedElems[i] = elem.getByID( elem.linkedElems[i] );
   3.271 -        if( elem.linkedElems[i].isAlreadyVisited ) {
   3.272 -            visitNextElemAndRestoreIt( elem.linkedElems[i] );
   3.273 -        }
   3.274 -    }
   3.275 -
   3.276 -    //restore links to the view sets embedded within view set link objects
   3.277 -    if( (elem.viewSet||{}).viewSetLinks ) {
   3.278 -        var viewSet = elem.viewSet;
   3.279 -        var numLinked = viewSet.viewSetLinks.length; //array always exists
   3.280 -        var viewSetLink = {};
   3.281 -        for (i = 0; i < numLinked; i++) {
   3.282 -            viewSetLink = viewSet.viewSetLinks[i];
   3.283 -            if (viewSetLink) {
   3.284 -                viewSetLink.referenceViewSet = elem.getByID(viewSetLink.referenceViewSet);
   3.285 -                viewSetLink.subordinateViewSet = elem.getByID(viewSetLink.subordinateViewSet);
   3.286 -            }
   3.287 -        }
   3.288 -    }
   3.289 -    //restore back-links to parent view boxes within view set tree
   3.290 -    if( (elem.viewSet||{}).rootViewBox ) { //idiom that's safe when viewSet undefine
   3.291 -        walkViewTreeAndRestore( elem.viewSet.rootViewBox );
   3.292 -    }
   3.293 -}
   3.294 -
   3.295 -persistTheGraph( syntaxGraph );
   3.296 -
   3.297 -console.log("\npersisting graph done!\n")
   3.298 -
   3.299 -//retrievePersistedString();
   3.300 -
   3.301 -//walk the tree, replacing all parent pointers with ID
   3.302 -// dont bother keeping shadow copy, easily restored without copy
   3.303 -function walkViewTree( viewBox ) {
   3.304 -    if(viewBox.parent) viewBox.parent = viewBox.parent.ID;
   3.305 -    if(viewBox.children.length > 0) {
   3.306 -        var childBox = {};
   3.307 -        var numChildren = viewBox.children.length;
   3.308 -        for (i = 0; i < numChildren; i++) {
   3.309 -            childBox = viewBox.children[i];
   3.310 -            if (childBox) {
   3.311 -                walkViewTree( childBox );
   3.312 -            }
   3.313 -        }
   3.314 -    }
   3.315 -//    persistString( JSON.stringify(viewBox))
   3.316 -    console.log("done recursing viewBox: " + viewBox.ID)
   3.317 -}
   3.318 -//walk the tree, restoring all IDs with parent and children pointers
   3.319 -function walkViewTreeAndRestore( viewBox ) {
   3.320 -    //replace ID that's in the parent field with looked up object pointer
   3.321 -    if(viewBox.parent) viewBox.parent = viewBox.getByID(viewBox.parent);
   3.322 -    if(viewBox.children.length > 0) { //all view boxes should have array!
   3.323 -        var childBox = {};
   3.324 -        var numChildren = viewBox.children.length;
   3.325 -        for (i = 0; i < numChildren; i++) {
   3.326 -            viewBox.children[i] = viewBox.getByID(viewBox.children[i]);
   3.327 -            childBox = viewBox.children[i];
   3.328 -            if( childBox ) {
   3.329 -                walkViewTree( childBox );
   3.330 -            }
   3.331 -        }
   3.332 -    }
   3.333 -    console.log("done restoring viewBox: " + viewBox.ID)
   3.334 -}
   3.335 -
   3.336 -function startPersisting() {
   3.337 -	//bottle server
   3.338 -	var theUrl = "http://localhost:8080/startsavinggraph";
   3.339 -    var xmlHttp = new XMLHttpRequest();
   3.340 -    xmlHttp.open( "GET", theUrl, false );
   3.341 -    console.log("about to send start persisting command");
   3.342 -    xmlHttp.send( null );
   3.343 -    console.log("started persisting: " + xmlHttp.responseText );
   3.344 -}
   3.345 -
   3.346 -function persistString( stringToWrite ) {
   3.347 -	//bottle server
   3.348 -    //convert newline to %N, tab to %T, backslash to %H and forward slash to %S
   3.349 -    // then convert back in server before storing to file
   3.350 -    stringToWrite = stringToWrite.replace(/[\t]/g,'%T');
   3.351 -    stringToWrite = stringToWrite.replace(/[\n]/g,'%N');
   3.352 -    stringToWrite = stringToWrite.replace(/[\\]/g,'%H');
   3.353 -    stringToWrite = stringToWrite.replace(/[/]/g,'%S');
   3.354 -	var theUrl = "http://localhost:8080/save1elem/" + stringToWrite;
   3.355 -
   3.356 -    console.log("theURL: " + theUrl);
   3.357 -
   3.358 -    var xmlHttp = null;
   3.359 -    xmlHttp = new XMLHttpRequest();
   3.360 -    xmlHttp.open( "GET", theUrl, true );
   3.361 -    xmlHttp.onload = function (e) {
   3.362 -        if (xmlHttp.readyState === 4) {
   3.363 -            if (xmlHttp.status === 200) {
   3.364 -                console.log("response to the write: " + xmlHttp.responseText );
   3.365 -            } else {
   3.366 -                console.error(xmlHttp.statusText);
   3.367 -            }
   3.368 -        }
   3.369 -    };
   3.370 -    xmlHttp.onerror = function (e) {
   3.371 -        console.error(xmlHttp.statusText);
   3.372 -    };
   3.373 -    xmlHttp.send( null );
   3.374 -}
   3.375 -
   3.376 -function endPersisting() {
   3.377 -	//bottle server
   3.378 -	var theUrl = "http://localhost:8080/endsavinggraph";
   3.379 -    var xmlHttp = new XMLHttpRequest();
   3.380 -    xmlHttp.open( "GET", theUrl, false );
   3.381 -    xmlHttp.send( null );
   3.382 -    console.log("end persisting: " + xmlHttp.responseText );
   3.383 -}
   3.384 -
   3.385 -//================================
   3.386 -
   3.387 -function startRetrieve() {
   3.388 -	var theUrl = "http://localhost:8080/startretrievinggraph";
   3.389 -    var xmlHttp = new XMLHttpRequest();
   3.390 -    xmlHttp.open( "GET", theUrl, false );
   3.391 -    xmlHttp.send( null );
   3.392 -    console.log("started retrieve: " + xmlHttp.responseText );
   3.393 -}
   3.394 -
   3.395 -function retrieveNextPersistedString() {
   3.396 -	var theUrl = "http://localhost:8080/get1elem";
   3.397 -    var xmlHttp = null;
   3.398 -	
   3.399 -    xmlHttp = new XMLHttpRequest();
   3.400 -    xmlHttp.open( "GET", theUrl, false );
   3.401 -    xmlHttp.send( null );
   3.402 -    console.log("retrieved string: " + xmlHttp.responseText );
   3.403 -}
   3.404 -
   3.405 -function endRetrieve() {
   3.406 -	var theUrl = "http://localhost:8080/endretrievinggraph";
   3.407 -    var xmlHttp = new XMLHttpRequest();
   3.408 -    xmlHttp.open( "GET", theUrl, false );
   3.409 -    xmlHttp.send( null );
   3.410 -    console.log("end retrieve: " + xmlHttp.responseText );
   3.411 -}
   3.412 -
   3.413 -//=================================
   3.414 +//wait until all the writes complete before retrieving!
   3.415 +syntaxGraph = persistence.retrieveTheGraph();
   3.416 +console.log("\nretrieving graph done!\n")
   3.417  
   3.418  return{
   3.419  	visualizer:  visualizer,
     4.1 --- a/1__Development/0__Code_Dev/Javascript_approach/MVDM_implementation/app/POPDisplay.js	Thu Aug 07 00:10:50 2014 -0700
     4.2 +++ b/1__Development/0__Code_Dev/Javascript_approach/MVDM_implementation/app/POPDisplay.js	Sat Aug 09 03:34:26 2014 -0700
     4.3 @@ -49,7 +49,7 @@
     4.4  function acceptRootViewSet (rootViewSet) {
     4.5  	//Here, convert each view hierarchy element into an equivalent
     4.6  	// famous render tree node
     4.7 -	
     4.8 +return;
     4.9  	//during testing, log some known positions within the hierarchy
    4.10  	console.log("POPDisplay: root view set: " + rootViewSet.ID);
    4.11  
    4.12 @@ -86,7 +86,7 @@
    4.13  	var viewBox = {}; var newSurface = {}; var newSurfMod = {};
    4.14  	var newContainer = {}; var newContMod = {}; 
    4.15  	var i = 0; var numChildren = 0; 
    4.16 -rewrite display to handle view sets!
    4.17 +//rewrite display to handle view sets!
    4.18  	var nextGenParents = []; var parentContainer = {}; var viewBoxChildren = [];
    4.19  	nextGenParents.push( {viewBox: rootViewSet, container: rootContainer});
    4.20  	//loop, getting oldest parent pair in queue each time
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/1__Development/0__Code_Dev/Javascript_approach/MVDM_implementation/app/POPGraphClasses.js	Sat Aug 09 03:34:26 2014 -0700
     5.3 @@ -0,0 +1,167 @@
     5.4 +
     5.5 +
     5.6 +define( function(require, exports, module) {
     5.7 +
     5.8 +//Using inheritance via prototype, to keep a running hash of objects
     5.9 +// indexed by their ID -- ID is auto generated as the objects are created
    5.10 +function ObjColl(){
    5.11 +    //start at 1 because 0 is interpreted same a null and other special ways
    5.12 +    currID = 1;   //private, will create one ObjColl and use as prototype
    5.13 +    objColl = [];
    5.14 +    this.getNextID = function( obj ) {
    5.15 +        objColl[currID] = obj; //objColl and currID are in the closure!
    5.16 +        return currID++;
    5.17 +    };
    5.18 +    this.getByID = function( ID ) {
    5.19 +        return objColl[ID];
    5.20 +    }
    5.21 +    this.insertByID = function( obj ){
    5.22 +        objColl[obj.ID] = obj; //objColl is in the closure!
    5.23 +    }
    5.24 +}
    5.25 +var theObjColl = new ObjColl();
    5.26 +
    5.27 +//need all the classes to have common ObjColl instance, but each has
    5.28 +// different constructor!  So, each needs its own prototype instance, so
    5.29 +// need to create an empty object to act as the prototype instance, so can
    5.30 +// add the constructor to that instance
    5.31 +function ConstructorBuffer(){
    5.32 +}
    5.33 +
    5.34 +//create a "class" of graph elements..  make an elem via the "new" call..
    5.35 +function GraphElem() {
    5.36 +    this.type = 'GraphElem',
    5.37 +        this.ID = this.getNextID(this); //this.getNextID promotes to prototype
    5.38 +    this.properties = [];
    5.39 +    this.portsIn = [];
    5.40 +    this.portsOut = [];
    5.41 +    this.linkedElems = [];
    5.42 +    this.viewSet = undefined;
    5.43 +};
    5.44 +var graphElemProto = new ConstructorBuffer();
    5.45 +graphElemProto.__proto__ = theObjColl;
    5.46 +GraphElem.prototype = graphElemProto;
    5.47 +GraphElem.prototype.constructor = GraphElem;
    5.48 +
    5.49 +function ViewSet() {
    5.50 +    this.type = 'ViewSet',
    5.51 +        this.ID = this.getNextID(this); //this.getNextID promotes to prototype
    5.52 +    this.syntaxElem = {};   //back link to the corresponding syntax graph element
    5.53 +    this.rootViewBox = [];
    5.54 +    this.viewSetLinks = [];
    5.55 +}
    5.56 +var viewSetProto = new ConstructorBuffer();
    5.57 +viewSetProto.__proto__ = theObjColl;
    5.58 +ViewSet.prototype = viewSetProto;
    5.59 +ViewSet.prototype.constructor = ViewSet;
    5.60 +
    5.61 +function ViewSetLink() {
    5.62 +    this.type = 'ViewSetLink',
    5.63 +        this.ID = this.getNextID(this); //this.getNextID promotes to prototype
    5.64 +    this.referenceViewSet = {};
    5.65 +    this.subordinateViewSet = {};
    5.66 +    this.xOffset = 0;
    5.67 +    this.yOffset = 0;
    5.68 +    this.scale = 1.0;
    5.69 +}
    5.70 +var viewSetLinkProto = new ConstructorBuffer();
    5.71 +viewSetLinkProto.__proto__ = theObjColl;
    5.72 +ViewSetLink.prototype = viewSetLinkProto;
    5.73 +ViewSetLink.prototype.constructor = ViewSetLink;
    5.74 +
    5.75 +//the constructor for a ViewBox object
    5.76 +function ViewBox() {
    5.77 +    this.type = 'ViewBox',
    5.78 +        this.ID = this.getNextID(this); //this.getNextID promotes to prototype
    5.79 +    this.shape = undefined;
    5.80 +    this.width = 0;		//size of bounding box (before scaling)
    5.81 +    this.height = 0;
    5.82 +    this.xOffset = 0;		//offset moves self and all descendants rel to parent
    5.83 +    this.yOffset = 0;
    5.84 +    this.scale = 1.0;		//scale applies to self and all descendants
    5.85 +    this.parent = undefined;	//allows traversing upward through hierarchy
    5.86 +    this.children = [];	//these are children view bounding boxes
    5.87 +    this.handlers = [];	//array of objects -> { typeOfEvent, Fn }
    5.88 +}
    5.89 +var viewBoxProto = new ConstructorBuffer();
    5.90 +viewBoxProto.__proto__ = theObjColl;
    5.91 +ViewBox.prototype = viewBoxProto;
    5.92 +ViewBox.prototype.constructor = ViewBox;
    5.93 +ViewBox.prototype.WithParams = function(shape, width, height, xOffset, yOffset, scale) {
    5.94 +    this.shape = shape;
    5.95 +    this.width = width;		//size of bounding box (before scaling)
    5.96 +    this.height = height;
    5.97 +    this.xOffset = xOffset;		//offset moves self and all descendants rel to parent
    5.98 +    this.yOffset = yOffset;
    5.99 +    this.scale = scale;		//scale applies to self and all descendants
   5.100 +    return this; //so object returns from "constructor" call..
   5.101 +}
   5.102 +
   5.103 +function GraphProperty() {
   5.104 +    this.type = 'GraphProperty',
   5.105 +        this.ID = this.getNextID(this); //this.getNextID promotes to prototype
   5.106 +    this.propertyName = "";
   5.107 +    this.propertyValue = "";
   5.108 +    this.subProperties = [];
   5.109 +}
   5.110 +var graphPropertyProto = new ConstructorBuffer();
   5.111 +graphPropertyProto.__proto__ = theObjColl;
   5.112 +GraphProperty.prototype = graphPropertyProto;
   5.113 +GraphProperty.prototype.constructor = GraphProperty;
   5.114 +GraphProperty.prototype.WithParams = function(propertyName, propertyValue) {
   5.115 +    this.propertyName = propertyName;
   5.116 +    this.propertyValue = propertyValue;
   5.117 +    return this;
   5.118 +}
   5.119 +
   5.120 +function GraphPort() {
   5.121 +    this.type = 'GraphPort',
   5.122 +        this.ID = this.getNextID(this); //this.getNextID promotes to prototype
   5.123 +    this.element = {};
   5.124 +    this.properties = [];
   5.125 +    this.pairedPorts = [];
   5.126 +}
   5.127 +var graphPortProto = new ConstructorBuffer();
   5.128 +graphPortProto.__proto__ = theObjColl;
   5.129 +GraphPort.prototype = graphPortProto;
   5.130 +GraphPort.prototype.constructor = GraphPort;
   5.131 +GraphPort.prototype.WithElem = function(elem) {
   5.132 +    this.element = elem;
   5.133 +    return this;
   5.134 +}
   5.135 +
   5.136 +
   5.137 +function stdKeyHdlr(e) {
   5.138 +    console.log("key event: " + e.type + " on: " + e.target.ID);
   5.139 +}
   5.140 +
   5.141 +function stdClickHdlr(e) {
   5.142 +    console.log("click event: " + e.type + " on: " + e.target.ID);
   5.143 +}
   5.144 +
   5.145 +function stdDragHdlr(e) {
   5.146 +    console.log("drag event: " + e.type + " on: " + e.target.ID);
   5.147 +}
   5.148 +
   5.149 +
   5.150 +return {
   5.151 +    theObjColl:     theObjColl,
   5.152 +    ObjColl:        ObjColl,     //the class that theObjColl is instance of
   5.153 +    GraphElem:      GraphElem,
   5.154 +    graphElemProto: graphElemProto,
   5.155 +    ViewSet:        ViewSet,
   5.156 +    viewSetProto:   viewSetProto,
   5.157 +    ViewSetLink:    ViewSetLink,
   5.158 +    viewSetLinkProto: viewSetLinkProto,
   5.159 +    ViewBox:        ViewBox,
   5.160 +    viewBoxProto:   viewBoxProto,
   5.161 +    GraphProperty:  GraphProperty,
   5.162 +    graphPropertyProto: graphPropertyProto,
   5.163 +    GraphPort:      GraphPort,
   5.164 +    graphPortProto: graphPortProto,
   5.165 +    stdKeyHdlr:     stdKeyHdlr,
   5.166 +    stdClickHdlr:   stdClickHdlr,
   5.167 +    stdDragHdlr:    stdDragHdlr
   5.168 +};
   5.169 +});
   5.170 +
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/1__Development/0__Code_Dev/Javascript_approach/MVDM_implementation/app/persistence.js	Sat Aug 09 03:34:26 2014 -0700
     6.3 @@ -0,0 +1,646 @@
     6.4 +
     6.5 +define( function(require, exports, module) {
     6.6 +
     6.7 +//Get the class objects that define behavior for each of the structures that
     6.8 +// appears in a POP syntax graph.. will use these as read in JSON of a graph
     6.9 +// and parse it into objects of these classes!
    6.10 +var graphClasses = require("./POPGraphClasses");
    6.11 +
    6.12 +
    6.13 +//===========================
    6.14 +//==  Learning stuff -- playing with local file system things..
    6.15 +//===========================
    6.16 +
    6.17 +//note: only Chrome supports the file api !
    6.18 +// start Chrome with flag "--allow-file-access-from-files" to enable the API
    6.19 +
    6.20 +
    6.21 +//put a file selector button onto the screen and register an event handler
    6.22 +// that fires after one or a group of files is chosen
    6.23 +    var outputEl = document.body.appendChild(document.createElement("output"));
    6.24 +    outputEl.id = "fileListOutput";
    6.25 +
    6.26 +    var inputEl = document.createElement("div");
    6.27 +    document.body.appendChild(inputEl);
    6.28 +    var innerHTMLStr = '<input type="file" id="fileChooserElem" name="myfiles[]" multiple />';
    6.29 +    inputEl.innerHTML = innerHTMLStr;
    6.30 +
    6.31 +    var gottenElem = document.getElementById("fileChooserElem");
    6.32 +    gottenElem.addEventListener('change', handleFileSelect, false);
    6.33 +
    6.34 +    //The event handler
    6.35 +    function handleFileSelect(evt) {
    6.36 +        var files = evt.target.files; // FileList object
    6.37 +
    6.38 +        console.log("got event! ");
    6.39 +
    6.40 +        // files is a FileList of File objects. List some properties.
    6.41 +        var output = [];
    6.42 +        for (var i = 0, f; f = files[i]; i++) {
    6.43 +            output.push (
    6.44 +                    '<li><strong>' + f.name + '</strong> (' + (f.type || "n/a") + ') - ' +
    6.45 +                    f.size + ' bytes, last modified: ' +
    6.46 +                    (f.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : "n/a") +
    6.47 +                    '</li>');
    6.48 +            var reader = new FileReader();
    6.49 +
    6.50 +            //The file API is asynchronous, so before do a read, register
    6.51 +            // a callback that runs when the read completes.
    6.52 +            // It's a Closure, which encloses the file info as theFile.
    6.53 +            //The closure runs now, which makes a function invocation body
    6.54 +            // that includes the parameter, and this run makes a new function
    6.55 +            // spec which is returned as the callback!  That new function spec
    6.56 +            // has the invocation of the closure attached to it, so it still
    6.57 +            // has the closure parameter (theFile) available when it is called
    6.58 +            // back later.
    6.59 +            reader.onload = (function(theFile) {
    6.60 +                return function(e) {
    6.61 +                    console.log("file: " + theFile.name + " content: " + e.target.result);
    6.62 +                };
    6.63 +            })(f); //here, invoke the closure function, passing it the file
    6.64 +
    6.65 +            // trigger the onload -- reads in the image file as a data URL.
    6.66 +            console.log("file contents: " + reader.readAsText(f) );
    6.67 +        }
    6.68 +        document.getElementById('fileListOutput').innerHTML = '<ul>' + output.join('') + '</ul>';
    6.69 +        console.log("files: " + output.join(""));
    6.70 +    }
    6.71 +
    6.72 +//this is a call-back that runs at the conclusion of initializing the file system
    6.73 +    function onInitFs(fs) {
    6.74 +        console.log('\n\n!!!Opened file system: ' + fs.name +"\n\n");
    6.75 +    }
    6.76 +
    6.77 +
    6.78 +//note, in order to get persistent file system access to work, had to start
    6.79 +// chrome with the flag "--allow-file-access-from-files"   and added
    6.80 +// "--allow-file-access"  just for good measure
    6.81 +//Test that file system access works via the Filer.js demo in the packages-
    6.82 +// libraries-tools directory -- click on index and see if red "error" shows up
    6.83 +    navigator.webkitPersistentStorage.requestQuota (
    6.84 +            1024*1024*280,
    6.85 +        function(grantedBytes) {
    6.86 +            document.getElementById('fileListOutput').innerHTML = 'request quota callback: ' + grantedBytes;
    6.87 +            window.webkitRequestFileSystem(window.PERSISTENT, grantedBytes, onInitFs, errorHandler);
    6.88 +        },
    6.89 +        errorHandler
    6.90 +    )
    6.91 +
    6.92 +
    6.93 +    function errorHandler(e) {
    6.94 +        var msg = '';
    6.95 +
    6.96 +        switch (e.code) {
    6.97 +            case FileError.QUOTA_EXCEEDED_ERR:
    6.98 +                msg = 'QUOTA_EXCEEDED_ERR';
    6.99 +                break;
   6.100 +            case FileError.NOT_FOUND_ERR:
   6.101 +                msg = 'NOT_FOUND_ERR';
   6.102 +                break;
   6.103 +            case FileError.SECURITY_ERR:
   6.104 +                msg = 'SECURITY_ERR';
   6.105 +                break;
   6.106 +            case FileError.INVALID_MODIFICATION_ERR:
   6.107 +                msg = 'INVALID_MODIFICATION_ERR';
   6.108 +                break;
   6.109 +            case FileError.INVALID_STATE_ERR:
   6.110 +                msg = 'INVALID_STATE_ERR';
   6.111 +                break;
   6.112 +            default:
   6.113 +                msg = 'Unknown Error';
   6.114 +                break;
   6.115 +        };
   6.116 +
   6.117 +        console.log('Error: ' + msg);
   6.118 +    }
   6.119 +
   6.120 +
   6.121 +//==================================================
   6.122 +//==
   6.123 +//==================================================
   6.124 +
   6.125 +//The src holder has to serialize the syntax graph out to persistent
   6.126 +// storage, and bring it back in, converting back to javascript objects
   6.127 +//JSON can stringify and then parse back, but it can't handle circuits
   6.128 +// in the graph, so have to write code that crawls the graph and
   6.129 +// individually stringifies each element
   6.130 +//So, the steps:
   6.131 +//-] crawl only the elements.
   6.132 +//-] An element has properties, ports, and linked elements attached..
   6.133 +//- -] properties are fine as-is, the stringify will handle them
   6.134 +//- -] ports have pointers back to the element, so those must be replaced
   6.135 +//     with the element's ID before stringify
   6.136 +//- -] linked elements can potentially link back around in a
   6.137 +//     circle, so replace those links with IDs before stringify
   6.138 +//
   6.139 +//-] start at root, get the first element.
   6.140 +//-] For a given element:
   6.141 +//- -] check whether marked as already visited if yes, return, else
   6.142 +//     continue
   6.143 +//- -] mark the element as having been visited
   6.144 +//- -] visit each port (save this position before visiting!), and
   6.145 +//     for a given port:
   6.146 +//- - -] follow each pairedPort link, and process element linked to the
   6.147 +//       paired port
   6.148 +//- - -] when come back, replace pairedPort pointer with ID of the
   6.149 +//       pointed-to port
   6.150 +//- -] for each element in the array of linked elements:
   6.151 +//- - -] visit and process the element linked to (save position first)
   6.152 +//- - -] when come back, replace the pointer with ID of the linked elem
   6.153 +//- -] when all the elment's ports and linked elems have been visited,
   6.154 +//     return to the position were in just before visiting this element
   6.155 +//-] when no where to return to, then done!
   6.156 +    function persistTheGraph( theGraphRoot ) {
   6.157 +        var shadowGraphRoot = {};
   6.158 +
   6.159 +        //save out the top level object that has the handles to the view hierarchy root
   6.160 +        // and the root element.  Also persist the view hierarchy root because it doesn't
   6.161 +        // fit cleanly to try to reach it from the root element..  by persisting it here,
   6.162 +        // can then do a single recursive call and only pass the next syntax element to
   6.163 +        // clean up.  Any view stuff will be reached from that element
   6.164 +        var rootElem = theGraphAnchor.rootElem; //save 'cause pointers about to be replaced
   6.165 +        persistAnchorAndViewSetRoot(theGraphAnchor, shadowGraphRoot);
   6.166 +        visitNextElemAndPersistIt(rootElem);
   6.167 +//	endPersisting();   //tell web server that persist protocol ended
   6.168 +
   6.169 +        //now, restore all the pointers, replacing the IDs with pointer to object
   6.170 +        restoreAnchorAndViewSetRoot(theGraphAnchor, shadowGraphRoot);
   6.171 +        visitNextElemAndRestoreIt(rootElem);
   6.172 +    }
   6.173 +
   6.174 +    function persistAnchorAndViewSetRoot(theGraphRoot, shadowGraphRoot) {
   6.175 +        //save the top level root object and the top view set, which is above
   6.176 +        // the view set of the root element
   6.177 +        //Replace pointer to root elem with its ID and cut off pointers
   6.178 +        // inside the root view set link, so JSON stringify only gets the root
   6.179 +        // view set and its one view set link object
   6.180 +        shadowGraphRoot.rootElem = theGraphAnchor.rootElem;
   6.181 +        theGraphAnchor.rootElem = theGraphAnchor.rootElem.ID;
   6.182 +
   6.183 +        //remove the back link from the view set link back to the root view set
   6.184 +        shadowGraphRoot.backLinkToRootViewSet = theGraphAnchor.rootViewSet.viewSetLinks[0].referenceViewSet;
   6.185 +        theGraphAnchor.rootViewSet.viewSetLinks[0].referenceViewSet =
   6.186 +            theGraphAnchor.rootViewSet.viewSetLinks[0].referenceViewSet.ID;
   6.187 +
   6.188 +        //cut off the view set link, that points to the view set of the root element
   6.189 +        shadowGraphRoot.linkToRootElemsViewSet =
   6.190 +            theGraphAnchor.rootViewSet.viewSetLinks[0].subordinateViewSet;
   6.191 +        theGraphAnchor.rootViewSet.viewSetLinks[0].subordinateViewSet =
   6.192 +            theGraphAnchor.rootViewSet.viewSetLinks[0].subordinateViewSet.ID;
   6.193 +
   6.194 +        //Now, ready to go, stringify away!
   6.195 +        var stringOfGraphRoot = JSON.stringify(theGraphAnchor, null, '\t');
   6.196 +//    console.log("JSON of graphRoot: " + stringOfGraphRoot );
   6.197 +        persistString(stringOfGraphRoot)
   6.198 +    }
   6.199 +
   6.200 +//Contract: have already verified that this elem has not been visited before calling
   6.201 +    function visitNextElemAndPersistIt(elem) {
   6.202 +        //mark the element as having been visited
   6.203 +        elem.isAlreadyVisited = true;
   6.204 +
   6.205 +        //cut the back link going from the view set to the elem node
   6.206 +        if ((elem.viewSet || {}).syntaxElem) {
   6.207 +            elem.viewSet.syntaxElem = elem.viewSet.syntaxElem.ID;
   6.208 +        }
   6.209 +
   6.210 +        //visit each port
   6.211 +        var elemToVisit = {};
   6.212 +        var i = 0;
   6.213 +        var j = 0;
   6.214 +        var inPort = {};
   6.215 +        var ports = elem.portsIn;
   6.216 +        var numPorts = ports.length;
   6.217 +        var numPairedPorts = 0;
   6.218 +        for (j = 0; j < numPorts; j++) {
   6.219 +            inPort = ports[j];
   6.220 +            numPairedPorts = inPort.pairedPorts.length;
   6.221 +            //follow each pairedPort link
   6.222 +            for (i = 0; i < numPairedPorts; i++) {
   6.223 +                //process element linked to the paired port
   6.224 +                elemToVisit = inPort.pairedPorts[i].element;
   6.225 +                if (!elemToVisit.isAlreadyVisited) {
   6.226 +                    visitNextElemAndPersistIt(elemToVisit);
   6.227 +                }
   6.228 +                //back from visit, replace pointer with ID of pointed to port
   6.229 +                inPort.pairedPorts[i] = inPort.pairedPorts[i].ID;
   6.230 +            }
   6.231 +            //replace the element back-pointer in the port object
   6.232 +            inPort.element = inPort.element.ID;
   6.233 +        }
   6.234 +        ports = elem.portsOut;
   6.235 +        numPorts = ports.length;
   6.236 +        var outPort = {};
   6.237 +        for (j = 0; j < numPorts; j++) {
   6.238 +            outPort = ports[j];
   6.239 +            numPairedPorts = outPort.pairedPorts.length;
   6.240 +            //follow each pairedPort link
   6.241 +            for (i = 0; i < numPairedPorts; i++) {
   6.242 +                //process element linked to the paired port
   6.243 +                elemToVisit = outPort.pairedPorts[i].element;
   6.244 +                if (!elemToVisit.isAlreadyVisited) {
   6.245 +                    visitNextElemAndPersistIt(elemToVisit);
   6.246 +                }
   6.247 +                //when come back, replace pointer with ID of pointed to port
   6.248 +                outPort.pairedPorts[i] = outPort.pairedPorts[i].ID;
   6.249 +            }
   6.250 +            //replace the element back-pointer in the port object
   6.251 +            outPort.element = outPort.element.ID;
   6.252 +        }
   6.253 +        var numLinkedElems = elem.linkedElems.length;
   6.254 +        for (i = 0; i < numLinkedElems; i++) {
   6.255 +            if (!(elem.linkedElems[i].isAlreadyVisited)) {
   6.256 +                visitNextElemAndPersistIt(elem.linkedElems[i]);
   6.257 +            }
   6.258 +            //back from visit, replace pointer with ID of pointed to elem
   6.259 +            elem.linkedElems[i] = elem.linkedElems[i].ID;
   6.260 +        }
   6.261 +
   6.262 +        //cut links to the view sets embedded within view set link objects
   6.263 +        if ((elem.viewSet || {}).viewSetLinks) {
   6.264 +            var viewSet = elem.viewSet;
   6.265 +            var numLinked = viewSet.viewSetLinks.length;
   6.266 +            var viewSetLink = {};
   6.267 +            for (i = 0; i < numLinked; i++) {
   6.268 +                viewSetLink = viewSet.viewSetLinks[i];
   6.269 +                if (viewSetLink) {
   6.270 +                    viewSetLink.referenceViewSet = viewSetLink.referenceViewSet.ID;
   6.271 +                    viewSetLink.subordinateViewSet = viewSetLink.subordinateViewSet.ID;
   6.272 +                }
   6.273 +            }
   6.274 +        }
   6.275 +        //cut back-links to parent view boxes within view set tree
   6.276 +        if ((elem.viewSet || {}).rootViewBox) {
   6.277 +            walkViewTree(elem.viewSet.rootViewBox);
   6.278 +        }
   6.279 +
   6.280 +        //this elem, and all objects reachable from it are now safe to be
   6.281 +        // stringified with JSON..  so do it!
   6.282 +        var stringOfElemNode = JSON.stringify(elem, null, '\t');
   6.283 +//	console.log("JSON of elem: " + stringOfElemNode );
   6.284 +        persistString(stringOfElemNode);
   6.285 +    }
   6.286 +
   6.287 +//walk the tree, replacing all parent pointers with ID
   6.288 +// dont bother keeping shadow copy, easily restored without copy
   6.289 +    function walkViewTree(viewBox) {
   6.290 +        if (viewBox.parent) viewBox.parent = viewBox.parent.ID;
   6.291 +        if (viewBox.children.length > 0) {
   6.292 +            var childBox = {};
   6.293 +            var numChildren = viewBox.children.length;
   6.294 +            for (i = 0; i < numChildren; i++) {
   6.295 +                childBox = viewBox.children[i];
   6.296 +                if (childBox) {
   6.297 +                    walkViewTree(childBox);
   6.298 +                }
   6.299 +            }
   6.300 +        }
   6.301 +//        console.log("done recursing viewBox: " + viewBox.ID)
   6.302 +    }
   6.303 +
   6.304 + //=====================================
   6.305 +//Search the graph for places where pointer has been replaced by an ID,
   6.306 +// when find one, look up the object with that ID and replace the ID with pointer
   6.307 +    function restoreAnchorAndViewSetRoot( theGraphAnchor ) {
   6.308 +        var theObjColl = graphClasses.theObjColl;
   6.309 +
   6.310 +        theGraphAnchor.rootElem = theObjColl.getByID(theGraphAnchor.rootElem);
   6.311 +
   6.312 +        //restore the back link from the view set link
   6.313 +        theGraphAnchor.rootViewSet.viewSetLinks[0].referenceViewSet =
   6.314 +            theObjColl.getByID(theGraphAnchor.rootViewSet.viewSetLinks[0].referenceViewSet);
   6.315 +        theGraphAnchor.rootViewSet.viewSetLinks[0].subordinateViewSet =
   6.316 +            theObjColl.getByID(theGraphAnchor.rootViewSet.viewSetLinks[0].subordinateViewSet);
   6.317 +    }
   6.318 +
   6.319 +//Contract: have already verified that this elem has not been visited before calling
   6.320 +    function visitNextElemAndRestoreIt( elem ) {
   6.321 +        //mark the element as having been visited
   6.322 +        elem.isAlreadyVisited = false;  //all start at true, making false marks as restored
   6.323 +
   6.324 +        //restore the back link going from the view set to the elem node
   6.325 +        if ((elem.viewSet || {}).syntaxElem) { //idiom makes safe when viewset undefined
   6.326 +            elem.viewSet.syntaxElem = elem.getByID(elem.viewSet.syntaxElem);
   6.327 +        }
   6.328 +
   6.329 +        //restore each port
   6.330 +        var elemToVisit = {};
   6.331 +        var i = 0;
   6.332 +        var j = 0;
   6.333 +        var inPort = {};
   6.334 +        var portsIn = elem.portsIn;
   6.335 +        var numPorts = portsIn.length;
   6.336 +        var numPairedPorts = 0;
   6.337 +        //as go along, restore pointers by looking them up
   6.338 +        for (j = 0; j < numPorts; j++) {
   6.339 +            inPort = portsIn[j];
   6.340 +
   6.341 +            //restore the element back-pointer in the port object
   6.342 +            inPort.element = inPort.getByID(inPort.element);
   6.343 +
   6.344 +            //follow each pairedPort link
   6.345 +            numPairedPorts = inPort.pairedPorts.length;
   6.346 +            for (i = 0; i < numPairedPorts; i++) {
   6.347 +                //process element linked to the paired port
   6.348 +                //first, replace pointer to port
   6.349 +                inPort.pairedPorts[i] = inPort.getByID(inPort.pairedPorts[i]);
   6.350 +                elemToVisit = inPort.pairedPorts[i].element;
   6.351 +                if (typeof elemToVisit == 'number') {
   6.352 +                    //means the element back-pointer inside the port on the other end
   6.353 +                    // is still the ID..  IE, that port and its element not restored yet
   6.354 +                    visitNextElemAndRestoreIt(outPort.getByID(elemToVisit));
   6.355 +                }
   6.356 +                else if (elemToVisit.isAlreadyVisited) { //if still marked from before
   6.357 +                    //don't think this case will ever come up!  if elem not restored,
   6.358 +                    // then the elem's port's back pointer will still be an ID and above
   6.359 +                    // if() will catch it..
   6.360 +                    visitNextElemAndRestoreIt(elemToVisit);
   6.361 +                }
   6.362 +            }
   6.363 +        }
   6.364 +        var outPorts = elem.portsOut;
   6.365 +        numPorts = outPorts.length;
   6.366 +        var outPort = {};
   6.367 +        for (j = 0; j < numPorts; j++) {
   6.368 +            outPort = outPorts[j];
   6.369 +            //restore back link from outPort to its element
   6.370 +            outPort.element = outPort.getByID(outPort.element);
   6.371 +            numPairedPorts = outPort.pairedPorts.length;
   6.372 +            //visit each pairedPort link
   6.373 +            for (i = 0; i < numPairedPorts; i++) {
   6.374 +                //restore the pointer to the paired port
   6.375 +                outPort.pairedPorts[i] = outPort.getByID(outPort.pairedPorts[i]);
   6.376 +                //process element linked to the paired port
   6.377 +                elemToVisit = outPort.pairedPorts[i].element;
   6.378 +                if (typeof elemToVisit == 'number') {
   6.379 +                    //means the element back-pointer inside the port on the other end
   6.380 +                    // is still the ID..  IE, that port and its element not restored yet
   6.381 +                    visitNextElemAndRestoreIt(outPort.getByID(elemToVisit));
   6.382 +                }
   6.383 +                else if (elemToVisit.isAlreadyVisited) { //if needs restoring
   6.384 +                    //don't think this case will ever come up!  if not restored,
   6.385 +                    // then the elem back pointer will still be an ID and above
   6.386 +                    // if() will catch it..
   6.387 +                    visitNextElemAndRestoreIt(elemToVisit);
   6.388 +                }
   6.389 +            }
   6.390 +        }
   6.391 +        var numLinkedElems = elem.linkedElems.length;
   6.392 +        for (i = 0; i < numLinkedElems; i++) {
   6.393 +            //restore linked elem first, then process that restored elem
   6.394 +            elem.linkedElems[i] = elem.getByID(elem.linkedElems[i]);
   6.395 +            if (elem.linkedElems[i].isAlreadyVisited) {
   6.396 +                visitNextElemAndRestoreIt(elem.linkedElems[i]);
   6.397 +            }
   6.398 +        }
   6.399 +
   6.400 +        //restore links to the view sets embedded within view set link objects
   6.401 +        if ((elem.viewSet || {}).viewSetLinks) {
   6.402 +            var viewSet = elem.viewSet;
   6.403 +            var numLinked = viewSet.viewSetLinks.length; //array always exists
   6.404 +            var viewSetLink = {};
   6.405 +            for (i = 0; i < numLinked; i++) {
   6.406 +                viewSetLink = viewSet.viewSetLinks[i];
   6.407 +                if (viewSetLink) {
   6.408 +                    viewSetLink.referenceViewSet = elem.getByID(viewSetLink.referenceViewSet);
   6.409 +                    viewSetLink.subordinateViewSet = elem.getByID(viewSetLink.subordinateViewSet);
   6.410 +                }
   6.411 +            }
   6.412 +        }
   6.413 +        //restore back-links to parent view boxes within view set tree
   6.414 +        if ((elem.viewSet || {}).rootViewBox) { //idiom that's safe when viewSet undefine
   6.415 +            walkViewTreeAndRestore(elem.viewSet.rootViewBox);
   6.416 +        }
   6.417 +    }
   6.418 +
   6.419 +//walk the tree, restoring all IDs with parent and children pointers
   6.420 +    function walkViewTreeAndRestore(viewBox) {
   6.421 +        //replace ID that's in the parent field with looked up object pointer
   6.422 +        if (viewBox.parent) viewBox.parent = viewBox.getByID(viewBox.parent);
   6.423 +        if (viewBox.children.length > 0) { //all view boxes should have array!
   6.424 +            var childBox = {};
   6.425 +            var numChildren = viewBox.children.length;
   6.426 +            for (i = 0; i < numChildren; i++) {
   6.427 +                viewBox.children[i] = viewBox.getByID(viewBox.children[i]);
   6.428 +                childBox = viewBox.children[i];
   6.429 +                if (childBox) {
   6.430 +                    walkViewTree(childBox);
   6.431 +                }
   6.432 +            }
   6.433 +        }
   6.434 +//        console.log("done restoring viewBox: " + viewBox.ID)
   6.435 +    }
   6.436 +
   6.437 +//==================================
   6.438 +
   6.439 +    function clearPersistentGraph() {
   6.440 +        //bottle server
   6.441 +        var theUrl = "http://localhost:8080/cleargraph";
   6.442 +        var xmlHttp = new XMLHttpRequest();
   6.443 +        xmlHttp.open("GET", theUrl, false);
   6.444 +        console.log("about to send clear graph command");
   6.445 +        xmlHttp.send(null);
   6.446 +        console.log("done clearing: " + xmlHttp.responseText);
   6.447 +    }
   6.448 +
   6.449 +    function persistString(stringToWrite) {
   6.450 +        //bottle server
   6.451 +        //convert newline to %N, tab to %T, backslash to %H and forward slash to %S
   6.452 +        // then convert back in server before storing to file
   6.453 +        stringToWrite = stringToWrite.replace(/[\t]/g, '%T');
   6.454 +        stringToWrite = stringToWrite.replace(/[\n]/g, '%N');
   6.455 +        stringToWrite = stringToWrite.replace(/[\\]/g, '%H');
   6.456 +        stringToWrite = stringToWrite.replace(/[/]/g, '%S');
   6.457 +        var theUrl = "http://localhost:8080/save1elem/" + stringToWrite;
   6.458 +
   6.459 +        console.log("theURL: " + theUrl);
   6.460 +
   6.461 +        var xmlHttp = null;
   6.462 +        xmlHttp = new XMLHttpRequest();
   6.463 +        xmlHttp.open("GET", theUrl, false);  //true means send asynchronously
   6.464 +        xmlHttp.onload = function (e) {
   6.465 +            if (xmlHttp.readyState === 4) {
   6.466 +                if (xmlHttp.status === 200) {
   6.467 +                    console.log("response to the write: " + xmlHttp.responseText);
   6.468 +                } else {
   6.469 +                    console.error(xmlHttp.statusText);
   6.470 +                }
   6.471 +            }
   6.472 +        };
   6.473 +        xmlHttp.onerror = function (e) {
   6.474 +            console.error(xmlHttp.statusText);
   6.475 +        };
   6.476 +        xmlHttp.send(null);
   6.477 +    }
   6.478 +
   6.479 +    function endPersisting() {
   6.480 +        //bottle server
   6.481 +        var theUrl = "http://localhost:8080/endsavinggraph";
   6.482 +        var xmlHttp = new XMLHttpRequest();
   6.483 +        xmlHttp.open("GET", theUrl, false);//do synchronously
   6.484 +        xmlHttp.send(null);
   6.485 +        console.log("end persisting: " + xmlHttp.responseText);
   6.486 +    }
   6.487 +
   6.488 +
   6.489 +//=============================================================
   6.490 +//==
   6.491 +//==  Retrieve SyntaxGraph from server
   6.492 +//==
   6.493 +//=============================================================
   6.494 +
   6.495 +    function retrieveTheGraph() {
   6.496 +        var theUrl = "http://localhost:8080/retrievegraph";
   6.497 +        var xmlHttp = new XMLHttpRequest();
   6.498 +        xmlHttp.open("GET", theUrl, false); //do synchronously
   6.499 +        xmlHttp.send(null);
   6.500 +        var theJSONString = xmlHttp.responseText;
   6.501 +
   6.502 +        //starting a new graph, so the set of objects in the obj coll not
   6.503 +        // objects from this new graph -- reset the object collection
   6.504 +        // then fill it back up again as parse the objects in..
   6.505 +        graphClasses.theObjColl = new graphClasses.ObjColl(); //make empty one
   6.506 +
   6.507 +        console.log( "Retrieved: " + theJSONString );
   6.508 +
   6.509 +        //split the string into separate JSON object-strings
   6.510 +        var objJSONArray = theJSONString.split(/separator\n/);
   6.511 +
   6.512 +        //remove the last, empty string
   6.513 +        var temp = objJSONArray.pop();
   6.514 +        if( temp !== "" ) objJSONArray.push(temp); //if not empty, put it back
   6.515 +
   6.516 +        //now parse each string, turning it into objects, and registering them
   6.517 +        for( var i = 0; i < objJSONArray.length; i++ ) {
   6.518 +            JSON.parse(objJSONArray[i], restoreParsedObj);
   6.519 +        }
   6.520 +        //one of the parsed JSON strings was the graph anchor obj, which
   6.521 +        // was placed into theObjColl during JSON parsing.  Grab it
   6.522 +        // then call restore, which will walk the graph, find the places
   6.523 +        // where a pointer should be, grab the ID sitting there, and use
   6.524 +        // that to get the obj and replace the ID with pointer to the object
   6.525 +        theGraphAnchor = graphClasses.theObjColl.graphAnchor;
   6.526 +        restoreAnchorAndViewSetRoot( theGraphAnchor );
   6.527 +        visitNextElemAndRestoreIt( theGraphAnchor.rootElem );
   6.528 +        return theGraphAnchor;
   6.529 +    }
   6.530 +
   6.531 +    //This registers each object that has an ID and restores any that have
   6.532 +    // a type to their correct class, and it restores handler functions
   6.533 +    function restoreParsedObj(k,v) {
   6.534 +        if(v.rootElem) { //This is the graph anchor (AKA head)!
   6.535 +            graphClasses.theObjColl.graphAnchor = v;
   6.536 +        }
   6.537 +        if(v.ID) { //ID is a valid field when v is a full object, to be registered
   6.538 +            console.log("inserting: " + k + " | ID: " + v.ID);
   6.539 +            graphClasses.theObjColl.insertByID( v ); //have a struct worthy of registering
   6.540 +        }
   6.541 +        if( v.type ) {//add the appropriate  __proto__ obj
   6.542 +            switch( v.type ) {
   6.543 +                case "GraphElem": v.__proto__ = graphClasses.graphElemProto;
   6.544 +                    break;
   6.545 +                case "ViewSet": v.__proto__ = graphClasses.viewSetProto;
   6.546 +                    break;
   6.547 +                case "ViewSetLink": v.__proto__ = graphClasses.viewSetLinkProto;
   6.548 +                    break;
   6.549 +                case "ViewBox": v.__proto__ = graphClasses.viewBoxProto;
   6.550 +                    break;
   6.551 +                case "GraphProperty": v.__proto__ = graphClasses.graphPropertyProto;
   6.552 +                    break;
   6.553 +                case "GraphPort": v.__proto__ = graphClasses.graphPortProto;
   6.554 +                    break;
   6.555 +            }
   6.556 +        }
   6.557 +        switch(k) {
   6.558 +            case "handlers": //view box's array of handler fns
   6.559 +                var hdlrPair; //v is an array of objects, each w/type and fn
   6.560 +                for( var i = 0; i < v.length; i++) {
   6.561 +                    hdlrPair = v[i];
   6.562 +                    switch (hdlrPair.type) {
   6.563 +                        case "key":
   6.564 +                            hdlrPair.fn = graphClasses.stdKeyHdlr;
   6.565 +                            break;
   6.566 +                        case "click":
   6.567 +                            hdlrPair.fn = graphClasses.stdClickHdlr;
   6.568 +                            break;
   6.569 +                        case "drag":
   6.570 +                            hdlrPair.fn = graphClasses.stdDragHdlr;
   6.571 +                            break;
   6.572 +                    }
   6.573 +                }
   6.574 +
   6.575 +                //console.log("key: " + k + " | ret value: " + v + " add .toJSON before stringify!");
   6.576 +                break;
   6.577 +            case "isAlreadyVisited":
   6.578 +                return true; //restore relies on this being true
   6.579 +                break;
   6.580 +        }
   6.581 +        return v;
   6.582 +    }
   6.583 +
   6.584 +//                //for this top group, if value is number then it's the ID of obj to get
   6.585 +//                case "rootElem":
   6.586 +//                case "referenceViewSet":
   6.587 +//                case "subordinateViewSet":
   6.588 +//                case "element":
   6.589 +//                case "syntaxElem":
   6.590 +//                case "parent":
   6.591 +//                    if( typeof v === 'number' ) {
   6.592 +//                        var theObj = graphClasses.theObjColl.getByID(v);
   6.593 +//                        var retValue = theObj ? theObj : v; //means need two passes!
   6.594 +//                        console.log("key: " + k + " | ID: " + v + " | ret value: " + retValue);
   6.595 +//                        return retValue;
   6.596 +//                    }
   6.597 +//                    break;
   6.598 +//                //for these two, value is an array of IDs
   6.599 +//                case "pairedPorts":
   6.600 +//                case "linkedElems":
   6.601 +//                    for( var i = 0; i < v.length; i++) {
   6.602 +//                        var val = v[i];
   6.603 +//                        if( typeof val === 'number' ) {
   6.604 +//                            var theObj = graphClasses.theObjColl.getByID(val);
   6.605 +//                            var retValue = theObj ? theObj : val; //means need two passes!
   6.606 +//                            console.log("array -- key: " + k + " | ID: " + v[i] + " | ret value: " + i + ": " + retValue);
   6.607 +//                            v[i] = retValue;
   6.608 +//                        }
   6.609 +//                    }
   6.610 +//                    return v;
   6.611 +//                    break;
   6.612 +
   6.613 +//================================
   6.614 +    function startRetrieve() {
   6.615 +        var theUrl = "http://localhost:8080/startretrievinggraph";
   6.616 +        var xmlHttp = new XMLHttpRequest();
   6.617 +        xmlHttp.open("GET", theUrl, false);
   6.618 +        xmlHttp.send(null);
   6.619 +        console.log("started retrieve: " + xmlHttp.responseText);
   6.620 +    }
   6.621 +
   6.622 +    function retrieveNextPersistedString() {
   6.623 +        var theUrl = "http://localhost:8080/get1elem";
   6.624 +        var xmlHttp = null;
   6.625 +
   6.626 +        xmlHttp = new XMLHttpRequest();
   6.627 +        xmlHttp.open("GET", theUrl, false);
   6.628 +        xmlHttp.send(null);
   6.629 +        console.log("retrieved string: " + xmlHttp.responseText);
   6.630 +    }
   6.631 +
   6.632 +    function endRetrieve() {
   6.633 +        var theUrl = "http://localhost:8080/endretrievinggraph";
   6.634 +        var xmlHttp = new XMLHttpRequest();
   6.635 +        xmlHttp.open("GET", theUrl, false);
   6.636 +        xmlHttp.send(null);
   6.637 +        console.log("end retrieve: " + xmlHttp.responseText);
   6.638 +    }
   6.639 +
   6.640 +//=================================
   6.641 +
   6.642 +
   6.643 +return {
   6.644 +    persistString:          persistString,
   6.645 +    clearPersistentGraph:   clearPersistentGraph,
   6.646 +    persistTheGraph:        persistTheGraph,
   6.647 +    retrieveTheGraph:       retrieveTheGraph
   6.648 +};
   6.649 +});
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/1__Development/0__Code_Dev/Javascript_approach/MVDM_implementation/lib/filer.js	Sat Aug 09 03:34:26 2014 -0700
     7.3 @@ -0,0 +1,836 @@
     7.4 +/** 
     7.5 + * Copyright 2013 - Eric Bidelman
     7.6 + * 
     7.7 + * Licensed under the Apache License, Version 2.0 (the "License");
     7.8 + * you may not use this file except in compliance with the License.
     7.9 + * You may obtain a copy of the License at
    7.10 + * 
    7.11 + *      http://www.apache.org/licenses/LICENSE-2.0
    7.12 + * 
    7.13 + * Unless required by applicable law or agreed to in writing, software
    7.14 + * distributed under the License is distributed on an "AS IS" BASIS,
    7.15 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    7.16 + * See the License for the specific language governing permissions and
    7.17 + * limitations under the License.
    7.18 + 
    7.19 + * @fileoverview
    7.20 + * Convenient wrapper library for the HTML5 Filesystem API, implementing
    7.21 + * familiar UNIX commands (cp, mv, ls) for its API.
    7.22 + * 
    7.23 + * @author Eric Bidelman (ebidel@gmail.com)
    7.24 + * @version: 0.4.3
    7.25 + */
    7.26 +
    7.27 +'use strict';
    7.28 +
    7.29 +var self = this; // window or worker context.
    7.30 +
    7.31 +self.URL = self.URL || self.webkitURL;
    7.32 +self.requestFileSystem = self.requestFileSystem || self.webkitRequestFileSystem;
    7.33 +self.resolveLocalFileSystemURL = self.resolveLocalFileSystemURL ||
    7.34 +                                 self.webkitResolveLocalFileSystemURL;
    7.35 +navigator.temporaryStorage = navigator.temporaryStorage ||
    7.36 +                             navigator.webkitTemporaryStorage;
    7.37 +navigator.persistentStorage = navigator.persistentStorage ||
    7.38 +                              navigator.webkitPersistentStorage;
    7.39 +self.BlobBuilder = self.BlobBuilder || self.MozBlobBuilder ||
    7.40 +                   self.WebKitBlobBuilder;
    7.41 +
    7.42 +// Prevent errors in browsers that don't support FileError.
    7.43 +if (self.FileError === undefined) {
    7.44 +  var FileError = function() {};
    7.45 +  FileError.prototype.prototype = Error.prototype;
    7.46 +}
    7.47 +
    7.48 +var Util = {
    7.49 +
    7.50 +  /**
    7.51 +   * Turns a NodeList into an array.
    7.52 +   *
    7.53 +   * @param {NodeList} list The array-like object.
    7.54 +   * @return {Array} The NodeList as an array.
    7.55 +   */
    7.56 +  toArray: function(list) {
    7.57 +    return Array.prototype.slice.call(list || [], 0);
    7.58 +  },
    7.59 +
    7.60 +  /*toDataURL: function(contentType, uint8Array) {
    7.61 +    return 'data:' + contentType + ';base64,' +
    7.62 +        self.btoa(this.arrayToBinaryString(uint8Array));
    7.63 +  },*/
    7.64 +
    7.65 +  /**
    7.66 +   * Creates a data: URL from string data.
    7.67 +   *
    7.68 +   * @param {string} str The content to encode the data: URL from.
    7.69 +   * @param {string} contentType The mimetype of the data str represents.
    7.70 +   * @param {bool=} opt_isBinary Whether the string data is a binary string
    7.71 +   *     (and therefore should be base64 encoded). True by default.
    7.72 +   * @return {string} The created data: URL.
    7.73 +   */
    7.74 +  strToDataURL: function(str, contentType, opt_isBinary) {
    7.75 +    var isBinary = opt_isBinary != undefined ? opt_isBinary : true;
    7.76 +    if (isBinary) {
    7.77 +      return 'data:' + contentType + ';base64,' + self.btoa(str);
    7.78 +    } else {
    7.79 +      return 'data:' + contentType + ',' + str;
    7.80 +    }
    7.81 +  },
    7.82 +
    7.83 +  /**
    7.84 +   * Creates a blob: URL from a binary str.
    7.85 +   *
    7.86 +   * @param {string} binStr The content as a binary string.
    7.87 +   * @param {string=} opt_contentType An optional mimetype of the data.
    7.88 +   * @return {string} A new blob: URL.
    7.89 +   */
    7.90 +  strToObjectURL: function(binStr, opt_contentType) {
    7.91 +
    7.92 +    var ui8a = new Uint8Array(binStr.length);
    7.93 +    for (var i = 0; i < ui8a.length; ++i) { 
    7.94 +      ui8a[i] = binStr.charCodeAt(i);
    7.95 +    }
    7.96 +
    7.97 +    var blob = new Blob([ui8a],
    7.98 +                        opt_contentType ? {type: opt_contentType} : {});
    7.99 +
   7.100 +    return self.URL.createObjectURL(blob);
   7.101 +  },
   7.102 +
   7.103 +  /**
   7.104 +   * Creates a blob: URL from a File or Blob object.
   7.105 +   *
   7.106 +   * @param {Blob|File} blob The File or Blob data.
   7.107 +   * @return {string} A new blob: URL.
   7.108 +   */
   7.109 +  fileToObjectURL: function(blob) {
   7.110 +    return self.URL.createObjectURL(blob);
   7.111 +  },
   7.112 +
   7.113 +  /**
   7.114 +   * Reads a File or Blob object and returns it as an ArrayBuffer.
   7.115 +   *
   7.116 +   * @param {Blob|File} blob The File or Blob data.
   7.117 +   * @param {Function} callback Success callback passed the array buffer.
   7.118 +   * @param {Function=} opt_error Optional error callback if the read fails.
   7.119 +   */
   7.120 +  fileToArrayBuffer: function(blob, callback, opt_errorCallback) {
   7.121 +    var reader = new FileReader();
   7.122 +    reader.onload = function(e) {
   7.123 +      callback(e.target.result);
   7.124 +    };
   7.125 +    reader.onerror = function(e) {
   7.126 +      if (opt_errorCallback) {
   7.127 +        opt_errorCallback(e);
   7.128 +      }
   7.129 +    };
   7.130 +
   7.131 +    reader.readAsArrayBuffer(blob);
   7.132 +  },
   7.133 +
   7.134 +  /**
   7.135 +   * Creates and returns a blob from a data URL (either base64 encoded or not).
   7.136 +   *
   7.137 +   * @param {string} dataURL The data URL to convert.
   7.138 +   * @return {Blob} A blob representing the array buffer data.
   7.139 +   */
   7.140 +  dataURLToBlob: function(dataURL) {
   7.141 +    var BASE64_MARKER = ';base64,';
   7.142 +    if (dataURL.indexOf(BASE64_MARKER) == -1) {
   7.143 +      var parts = dataURL.split(',');
   7.144 +      var contentType = parts[0].split(':')[1];
   7.145 +      var raw = decodeURIComponent(parts[1]);
   7.146 +
   7.147 +      return new Blob([raw], {type: contentType});
   7.148 +    }
   7.149 +
   7.150 +    var parts = dataURL.split(BASE64_MARKER);
   7.151 +    var contentType = parts[0].split(':')[1];
   7.152 +    var raw = window.atob(parts[1]);
   7.153 +    var rawLength = raw.length;
   7.154 +
   7.155 +    var uInt8Array = new Uint8Array(rawLength);
   7.156 +
   7.157 +    for (var i = 0; i < rawLength; ++i) {
   7.158 +      uInt8Array[i] = raw.charCodeAt(i);
   7.159 +    }
   7.160 +
   7.161 +    return new Blob([uInt8Array], {type: contentType});
   7.162 +  },
   7.163 +
   7.164 +  /**
   7.165 +   * Reads an ArrayBuffer as returns its contents as a binary string.
   7.166 +   *
   7.167 +   * @param {ArrayBuffer} buffer The buffer of data.
   7.168 +   * @param {string=} opt_contentType An optional mimetype of the data.
   7.169 +   * @return {Blob} A blob representing the array buffer data.
   7.170 +   */
   7.171 +  arrayBufferToBlob: function(buffer, opt_contentType) {
   7.172 +    var uInt8Array = new Uint8Array(buffer);
   7.173 +    return new Blob([uInt8Array],
   7.174 +                    opt_contentType ? {type: opt_contentType} : {});
   7.175 +  },
   7.176 +
   7.177 +  /**
   7.178 +   * Reads an ArrayBuffer as returns its contents as a binary string.
   7.179 +   *
   7.180 +   * @param {ArrayBuffer} buffer The buffer of data.
   7.181 +   * @param {Function} callback Success callback passed the binary string.
   7.182 +   * @param {Function=} opt_error Optional error callback if the read fails.
   7.183 +   */
   7.184 +  arrayBufferToBinaryString: function(buffer, callback, opt_errorCallback) {
   7.185 +    var reader = new FileReader();
   7.186 +    reader.onload = function(e) {
   7.187 +      callback(e.target.result);
   7.188 +    };
   7.189 +    reader.onerror = function(e) {
   7.190 +      if (opt_errorCallback) {
   7.191 +        opt_errorCallback(e);
   7.192 +      }
   7.193 +    };
   7.194 +
   7.195 +    var uInt8Array = new Uint8Array(buffer);
   7.196 +    reader.readAsBinaryString(new Blob([uInt8Array]));
   7.197 +  },
   7.198 +
   7.199 +  /**
   7.200 +   * Create a binary string out of an array of numbers (bytes), each varying
   7.201 +   * from 0-255.
   7.202 +   *
   7.203 +   * @param {Array} bytes The array of numbers to transform into a binary str.
   7.204 +   * @return {string} The byte array as a string.
   7.205 +   */
   7.206 +  arrayToBinaryString: function(bytes) {
   7.207 +    if (typeof bytes != typeof []) {
   7.208 +      return null;
   7.209 +    }
   7.210 +    var i = bytes.length;
   7.211 +    var bstr = new Array(i);
   7.212 +    while (i--) {
   7.213 +      bstr[i] = String.fromCharCode(bytes[i]);
   7.214 +    }
   7.215 +    return bstr.join('');
   7.216 +  },
   7.217 +
   7.218 +  /**
   7.219 +   * Returns the file extension for a given filename.
   7.220 +   *
   7.221 +   * @param {string} filename The filename.
   7.222 +   * @return {string} The file's extension.
   7.223 +   */
   7.224 +  getFileExtension: function(filename) {
   7.225 +    var idx = filename.lastIndexOf('.');
   7.226 +    return idx != -1 ? filename.substring(idx) : '';
   7.227 +  }
   7.228 +};
   7.229 +
   7.230 +
   7.231 +var MyFileError = function(obj) {
   7.232 +  this.prototype = FileError.prototype;
   7.233 +  this.code = obj.code;
   7.234 +  this.name = obj.name;
   7.235 +};
   7.236 +//MyFileError.prototype.__proto__ = FileError.prototype;
   7.237 +
   7.238 +// Extend FileError with custom errors and a convenience method to get error
   7.239 +// code mnemonic.
   7.240 +FileError.BROWSER_NOT_SUPPORTED = 1000;
   7.241 +
   7.242 +// TODO: remove when FileError.name is implemented (crbug.com/86014).
   7.243 +FileError.prototype.__defineGetter__('name', function() {
   7.244 +  var keys = Object.keys(FileError);
   7.245 +  for (var i = 0, key; key = keys[i]; ++i) {
   7.246 +    if (FileError[key] == this.code) {
   7.247 +      return key;
   7.248 +    }
   7.249 +  }
   7.250 +  return 'Unknown Error';
   7.251 +});
   7.252 +
   7.253 +
   7.254 +var Filer = new function() {
   7.255 +
   7.256 +  var FS_INIT_ERROR_MSG = 'Filesystem has not been initialized.';
   7.257 +  var NOT_IMPLEMENTED_MSG = 'Not implemented.';
   7.258 +  var NOT_A_DIRECTORY = 'Path was not a directory.';
   7.259 +  var INCORRECT_ARGS = 'These method arguments are not supported.';
   7.260 +  var FS_URL_SCHEME = 'filesystem:';
   7.261 +  var DEFAULT_FS_SIZE = 1024 * 1024; // 1MB.
   7.262 +
   7.263 +  var fs_ = null;
   7.264 +  var cwd_ = null;
   7.265 +  var isOpen_ = false;
   7.266 +
   7.267 +  var isFsURL_ = function(path) {
   7.268 +    return path.indexOf(FS_URL_SCHEME) == 0;
   7.269 +  };
   7.270 +
   7.271 +  // Path can be relative or absolute. If relative, it's taken from the cwd_.
   7.272 +  // If a filesystem URL is passed it, it is simple returned
   7.273 +  var pathToFsURL_ = function(path) {
   7.274 +    if (!isFsURL_(path)) {
   7.275 +      if (path[0] == '/') {
   7.276 +        path = fs_.root.toURL() + path.substring(1);
   7.277 +      } else if (path.indexOf('./') == 0 || path.indexOf('../') == 0) {
   7.278 +        if (path == '../' && cwd_ != fs_.root) {
   7.279 +          path = cwd_.toURL() + '/' + path;
   7.280 +        } else {
   7.281 +          path = cwd_.toURL() + path;
   7.282 +        }
   7.283 +      } else {
   7.284 +        path = cwd_.toURL() + '/' + path;
   7.285 +      }
   7.286 +    }
   7.287 +
   7.288 +    return path;
   7.289 +  };
   7.290 +
   7.291 +  /**
   7.292 +   * Looks up a FileEntry or DirectoryEntry for a given path.
   7.293 +   *
   7.294 +   * @param {function(...FileEntry|DirectorEntry)} callback A callback to be
   7.295 +   *     passed the entry/entries that were fetched. The ordering of the
   7.296 +   *     entries passed to the callback correspond to the same order passed
   7.297 +   *     to this method.
   7.298 +   * @param {...string} var_args 1-2 paths to lookup and return entries for.
   7.299 +   *     These can be paths or filesystem: URLs.
   7.300 +   */
   7.301 +  var getEntry_ = function(callback, var_args) {
   7.302 +    var srcStr = arguments[1];
   7.303 +    var destStr = arguments[2];
   7.304 +
   7.305 +    var onError = function(e) {
   7.306 +      if (e.code == FileError.NOT_FOUND_ERR) {
   7.307 +        if (destStr) {
   7.308 +          throw new Error('"' + srcStr + '" or "' + destStr +
   7.309 +                          '" does not exist.');
   7.310 +        } else {
   7.311 +          throw new Error('"' + srcStr + '" does not exist.');
   7.312 +        }
   7.313 +      } else {
   7.314 +        throw new Error('Problem getting Entry for one or more paths.');
   7.315 +      }
   7.316 +    };
   7.317 +
   7.318 +    // Build a filesystem: URL manually if we need to.
   7.319 +    var src = pathToFsURL_(srcStr);
   7.320 +
   7.321 +    if (arguments.length == 3) {
   7.322 +      var dest = pathToFsURL_(destStr);
   7.323 +      self.resolveLocalFileSystemURL(src, function(srcEntry) {
   7.324 +        self.resolveLocalFileSystemURL(dest, function(destEntry) {
   7.325 +          callback(srcEntry, destEntry);
   7.326 +        }, onError);
   7.327 +      }, onError);
   7.328 +    } else {
   7.329 +      self.resolveLocalFileSystemURL(src, callback, onError);
   7.330 +    }
   7.331 +  };
   7.332 +
   7.333 +  /**
   7.334 +   * Copy or moves a file or directory to a destination.
   7.335 +   *
   7.336 +   * See public method's description (Filer.cp()) for rest of params.
   7.337 +   * @param {Boolean=} opt_deleteOrig True if the original entry should be
   7.338 +   *     deleted after the copy takes place, essentially making the operation
   7.339 +   *     a move instead of a copy. Defaults to false.
   7.340 +   */
   7.341 +  var copyOrMove_ = function(src, dest, opt_newName, opt_successCallback,
   7.342 +                             opt_errorHandler, opt_deleteOrig) {
   7.343 +    var self = this;
   7.344 +
   7.345 +    if (!fs_) {
   7.346 +      throw new Error(FS_INIT_ERROR_MSG);
   7.347 +    }
   7.348 +
   7.349 +    if (typeof src != typeof dest) {
   7.350 +      throw new Error(INCORRECT_ARGS);
   7.351 +    }
   7.352 +
   7.353 +    var newName = opt_newName || null;
   7.354 +    var deleteOrig = opt_deleteOrig != undefined ? opt_deleteOrig : false;
   7.355 +
   7.356 +    if ((src.isFile || dest.isDirectory) && dest.isDirectory) {
   7.357 +      if (deleteOrig) {
   7.358 +        src.moveTo(dest, newName, opt_successCallback, opt_errorHandler);
   7.359 +      } else {
   7.360 +        src.copyTo(dest, newName, opt_successCallback, opt_errorHandler);
   7.361 +      }
   7.362 +    } else {
   7.363 +      getEntry_(function(srcEntry, destDir) {
   7.364 +        if (!destDir.isDirectory) {
   7.365 +          var e = new Error('Oops! "' + destDir.name + ' is not a directory!');
   7.366 +          if (opt_errorHandler) {
   7.367 +            opt_errorHandler(e);
   7.368 +          } else {
   7.369 +            throw e;
   7.370 +          }
   7.371 +          return;
   7.372 +        }
   7.373 +        if (deleteOrig) {
   7.374 +          srcEntry.moveTo(destDir, newName, opt_successCallback, opt_errorHandler);
   7.375 +        } else {
   7.376 +          srcEntry.copyTo(destDir, newName, opt_successCallback, opt_errorHandler);
   7.377 +        }
   7.378 +      }, src, dest);
   7.379 +    }
   7.380 +  }
   7.381 +
   7.382 +  function Filer(fs) {
   7.383 +    fs_  = fs || null;
   7.384 +    if (fs_) {
   7.385 +      cwd_ = fs_.root;
   7.386 +      isOpen_ = true; // TODO: this may not be the case.
   7.387 +    }
   7.388 +  }
   7.389 +
   7.390 +  Filer.DEFAULT_FS_SIZE = DEFAULT_FS_SIZE;
   7.391 +  Filer.version = '0.4.3';
   7.392 +
   7.393 +  Filer.prototype = {
   7.394 +    get fs() {
   7.395 +      return fs_;
   7.396 +    },
   7.397 +    get isOpen() {
   7.398 +      return isOpen_;
   7.399 +    },
   7.400 +    get cwd() {
   7.401 +      return cwd_;
   7.402 +    }
   7.403 +  }
   7.404 +
   7.405 +  /**
   7.406 +   * Constructs and returns a filesystem: URL given a path.
   7.407 +   *
   7.408 +   * @param {string=} path The path to construct a URL for.
   7.409 +   *     size {int=} The storage size (in bytes) to open the filesystem with.
   7.410 +   *         Defaults to DEFAULT_FS_SIZE.
   7.411 +   * @return {string} The filesystem: URL.
   7.412 +   */
   7.413 +  Filer.prototype.pathToFilesystemURL = function(path) {
   7.414 +    return pathToFsURL_(path);
   7.415 +  }
   7.416 +
   7.417 +  /**
   7.418 +   * Initializes (opens) the file system.
   7.419 +   *
   7.420 +   * @param {object=} opt_initObj Optional object literal with the following
   7.421 +   *     properties. Note: If {} or null is passed, default values are used.
   7.422 +   *     persistent {Boolean=} Whether the browser should use persistent quota.
   7.423 +   *         Default is false.
   7.424 +   *     size {int=} The storage size (in bytes) to open the filesystem with.
   7.425 +   *         Defaults to DEFAULT_FS_SIZE.
   7.426 +   * @param {Function=} opt_successCallback Optional success handler passed a
   7.427 +   *      DOMFileSystem object.
   7.428 +   * @param {Function=} opt_errorHandler Optional error callback.
   7.429 +   */
   7.430 +  Filer.prototype.init = function(opt_initObj, opt_successCallback,
   7.431 +                                  opt_errorHandler) {
   7.432 +    if (!self.requestFileSystem) {
   7.433 +      throw new MyFileError({
   7.434 +        code: FileError.BROWSER_NOT_SUPPORTED,
   7.435 +        name: 'BROWSER_NOT_SUPPORTED'
   7.436 +      });
   7.437 +    }
   7.438 +
   7.439 +    var initObj = opt_initObj ? opt_initObj : {}; // Use defaults if obj is null.
   7.440 +
   7.441 +    var size = initObj.size || DEFAULT_FS_SIZE;
   7.442 +    this.type = self.TEMPORARY;
   7.443 +    if ('persistent' in initObj && initObj.persistent) {
   7.444 +      this.type = self.PERSISTENT;
   7.445 +    }
   7.446 +
   7.447 +    var init = function(fs) {
   7.448 +      this.size = size;
   7.449 +      fs_ = fs;
   7.450 +      cwd_ = fs_.root;
   7.451 +      isOpen_ = true;
   7.452 +
   7.453 +      opt_successCallback && opt_successCallback(fs);
   7.454 +    };
   7.455 +
   7.456 +    if (this.type == self.PERSISTENT && !!navigator.persistentStorage) {
   7.457 +      navigator.persistentStorage.requestQuota(size, function(grantedBytes) {  
   7.458 +        self.requestFileSystem(
   7.459 +            this.type, grantedBytes, init.bind(this), opt_errorHandler);
   7.460 +      }.bind(this), opt_errorHandler);
   7.461 +    } else {
   7.462 +      self.requestFileSystem(
   7.463 +          this.type, size, init.bind(this), opt_errorHandler);
   7.464 +    }
   7.465 +  };
   7.466 +
   7.467 +  /**
   7.468 +   * Reads the contents of a directory.
   7.469 +   *
   7.470 +   * @param {string|DirectoryEntry} dirEntryOrPath A path relative to the
   7.471 +   *     current working directory. In most cases that is the root entry, unless
   7.472 +   *     cd() has been called. A DirectoryEntry or filesystem URL can also be
   7.473 +   *     passed, in which case, the folder's contents will be returned.
   7.474 +   * @param {Function} successCallback Success handler passed an Array<Entry>.
   7.475 +   * @param {Function=} opt_errorHandler Optional error callback.
   7.476 +   */
   7.477 +  Filer.prototype.ls = function(dirEntryOrPath, successCallback,
   7.478 +                                opt_errorHandler) {
   7.479 +    if (!fs_) {
   7.480 +      throw new Error(FS_INIT_ERROR_MSG);
   7.481 +    }
   7.482 +
   7.483 +    var callback = function(dirEntry) {
   7.484 +
   7.485 +      cwd_ = dirEntry;
   7.486 +
   7.487 +      // Read contents of current working directory. According to spec, need to
   7.488 +      // keep calling readEntries() until length of result array is 0. We're
   7.489 +      // guarenteed the same entry won't be returned again.
   7.490 +      var entries_ = [];
   7.491 +      var reader = cwd_.createReader();
   7.492 +
   7.493 +      var readEntries = function() {
   7.494 +        reader.readEntries(function(results) {
   7.495 +          if (!results.length) {
   7.496 +            // By default, sort the list by name.
   7.497 +            entries_.sort(function(a, b) {
   7.498 +              return a.name < b.name ? -1 : b.name < a.name ? 1 : 0;
   7.499 +            });
   7.500 +            successCallback(entries_);
   7.501 +          } else {
   7.502 +            entries_ = entries_.concat(Util.toArray(results));
   7.503 +            readEntries();
   7.504 +          }
   7.505 +        }, opt_errorHandler);
   7.506 +      };
   7.507 +
   7.508 +      readEntries();
   7.509 +    };
   7.510 +
   7.511 +    if (dirEntryOrPath.isDirectory) { // passed a DirectoryEntry.
   7.512 +      callback(dirEntryOrPath);
   7.513 +    } else if (isFsURL_(dirEntryOrPath)) { // passed a filesystem URL.
   7.514 +      getEntry_(callback, dirEntryOrPath);
   7.515 +    } else { // Passed a path. Look up DirectoryEntry and proceeed.
   7.516 +      // TODO: Find way to use getEntry_(callback, dirEntryOrPath); with cwd_.
   7.517 +      cwd_.getDirectory(dirEntryOrPath, {}, callback, opt_errorHandler);
   7.518 +    }
   7.519 +  };
   7.520 +
   7.521 +  /**
   7.522 +   * Creates a new directory.
   7.523 +   *
   7.524 +   * @param {string} path The name of the directory to create. If a path is
   7.525 +   *     given, each intermediate dir is created (e.g. similar to mkdir -p).
   7.526 +   * @param {bool=} opt_exclusive True if an error should be thrown if
   7.527 +   *     one or more of the directories already exists. False by default.
   7.528 +   * @param {Function} opt_successCallback Success handler passed the
   7.529 +   *     DirectoryEntry that was created. If we were passed a path, the last
   7.530 +   *     directory that was created is passed back.
   7.531 +   * @param {Function=} opt_errorHandler Optional error callback.
   7.532 +   */
   7.533 +  Filer.prototype.mkdir = function(path, opt_exclusive, opt_successCallback,
   7.534 +                                   opt_errorHandler) {
   7.535 +    if (!fs_) {
   7.536 +      throw new Error(FS_INIT_ERROR_MSG);
   7.537 +    }
   7.538 +
   7.539 +    var exclusive = opt_exclusive != null ? opt_exclusive : false;
   7.540 +
   7.541 +    var folderParts = path.split('/');
   7.542 +
   7.543 +    var createDir = function(rootDir, folders) {
   7.544 +      // Throw out './' or '/' and move on. Prevents: '/foo/.//bar'.
   7.545 +      if (folders[0] == '.' || folders[0] == '') {
   7.546 +        folders = folders.slice(1);
   7.547 +      }
   7.548 +
   7.549 +      rootDir.getDirectory(folders[0], {create: true, exclusive: exclusive},
   7.550 +        function (dirEntry) {
   7.551 +          if (dirEntry.isDirectory) { // TODO: check shouldn't be necessary.
   7.552 +            // Recursively add the new subfolder if we have more to create and
   7.553 +            // There was more than one folder to create.
   7.554 +            if (folders.length && folderParts.length != 1) {
   7.555 +              createDir(dirEntry, folders.slice(1));
   7.556 +            } else {
   7.557 +              // Return the last directory that was created.
   7.558 +              if (opt_successCallback) opt_successCallback(dirEntry);
   7.559 +            }
   7.560 +          } else {
   7.561 +            var e = new Error(path + ' is not a directory');
   7.562 +            if (opt_errorHandler) {
   7.563 +              opt_errorHandler(e);
   7.564 +            } else {
   7.565 +              throw e;
   7.566 +            }
   7.567 +          }
   7.568 +        },
   7.569 +        function(e) {
   7.570 +          if (e.code == FileError.INVALID_MODIFICATION_ERR) {
   7.571 +            e.message = "'" + path + "' already exists";
   7.572 +            if (opt_errorHandler) {
   7.573 +              opt_errorHandler(e);
   7.574 +            } else {
   7.575 +              throw e;
   7.576 +            }
   7.577 +          }
   7.578 +        }
   7.579 +      );
   7.580 +    };
   7.581 +
   7.582 +    createDir(cwd_, folderParts);
   7.583 +  };
   7.584 +
   7.585 +  /**
   7.586 +   * Looks up and return a File for a given file entry.
   7.587 +   *
   7.588 +   * @param {string|FileEntry} entryOrPath A path, filesystem URL, or FileEntry
   7.589 +   *     of the file to lookup.
   7.590 +   * @param {Function} successCallback Success callback passed the File object.
   7.591 +   * @param {Function=} opt_errorHandler Optional error callback.
   7.592 +   */
   7.593 +  Filer.prototype.open = function(entryOrPath, successCallback, opt_errorHandler) {
   7.594 +    if (!fs_) {
   7.595 +      throw new Error(FS_INIT_ERROR_MSG);
   7.596 +    }
   7.597 +
   7.598 +    if (entryOrPath.isFile) {
   7.599 +      entryOrPath.file(successCallback, opt_errorHandler);
   7.600 +    } else {
   7.601 +      getEntry_(function(fileEntry) {
   7.602 +        fileEntry.file(successCallback, opt_errorHandler);
   7.603 +      }, pathToFsURL_(entryOrPath));
   7.604 +    }
   7.605 +  };
   7.606 +
   7.607 +  /**
   7.608 +   * Creates an empty file.
   7.609 +   *
   7.610 +   * @param {string} path The relative path of the file to create, from the
   7.611 +   *     current working directory.
   7.612 +   * @param {bool=} opt_exclusive True (default) if an error should be thrown if
   7.613 +   *     the file already exists.
   7.614 +   * @param {Function} successCallback A success callback, which is passed
   7.615 +   *     the new FileEntry.
   7.616 +   * @param {Function=} opt_errorHandler Optional error callback.
   7.617 +   */
   7.618 +  Filer.prototype.create = function(path, opt_exclusive, successCallback,
   7.619 +                                    opt_errorHandler) {
   7.620 +    if (!fs_) {
   7.621 +      throw new Error(FS_INIT_ERROR_MSG);
   7.622 +    }
   7.623 +
   7.624 +    var exclusive = opt_exclusive != null ? opt_exclusive : true;
   7.625 +
   7.626 +    cwd_.getFile(path, {create: true,  exclusive: exclusive}, successCallback,
   7.627 +      function(e) {
   7.628 +        if (e.code == FileError.INVALID_MODIFICATION_ERR) {
   7.629 +          e.message = "'" + path + "' already exists";
   7.630 +        }
   7.631 +        if (opt_errorHandler) {
   7.632 +          opt_errorHandler(e);
   7.633 +        } else {
   7.634 +          throw e;
   7.635 +        }
   7.636 +      }
   7.637 +    );
   7.638 +  };
   7.639 +
   7.640 +  /**
   7.641 +    * Moves a file or directory.
   7.642 +    *
   7.643 +    * @param {string|FileEntry|DirectoryEntry} src The file/directory
   7.644 +    *     to move. If src is a string, a path or filesystem: URL is accepted.
   7.645 +    * @param {string|DirectoryEntry} dest The directory to move the src into.
   7.646 +    *     If dest is a string, a path or filesystem: URL is accepted.
   7.647 +    *     Note: dest needs to be the same type as src.
   7.648 +    * @param {string=} opt_newName An optional new name for the moved entry.
   7.649 +    * @param {Function=} opt_successCallback Optional callback passed the moved
   7.650 +    *     entry on a successful move.
   7.651 +    * @param {Function=} opt_errorHandler Optional error callback.
   7.652 +    */
   7.653 +  Filer.prototype.mv = function(src, dest, opt_newName, opt_successCallback,
   7.654 +                                opt_errorHandler) {
   7.655 +    copyOrMove_.bind(this, src, dest, opt_newName, opt_successCallback,
   7.656 +                     opt_errorHandler, true)();
   7.657 +  };
   7.658 +
   7.659 +  /**
   7.660 +   * Deletes a file or directory entry.
   7.661 +   *
   7.662 +   * @param {string|FileEntry|DirectoryEntry} entryOrPath The file or directory
   7.663 +   *     to remove. If entry is a DirectoryEntry, its contents are removed
   7.664 +   *     recursively. If entryOrPath is a string, a path or filesystem: URL is
   7.665 +   *     accepted.
   7.666 +   * @param {Function} successCallback Zero arg callback invoked on
   7.667 +   *     successful removal.
   7.668 +   * @param {Function=} opt_errorHandler Optional error callback.
   7.669 +   */
   7.670 +  Filer.prototype.rm = function(entryOrPath, successCallback,
   7.671 +                                opt_errorHandler) {
   7.672 +    if (!fs_) {
   7.673 +      throw new Error(FS_INIT_ERROR_MSG);
   7.674 +    }
   7.675 +
   7.676 +    var removeIt = function(entry) {
   7.677 +      if (entry.isFile) {
   7.678 +        entry.remove(successCallback, opt_errorHandler);
   7.679 +      } else if (entry.isDirectory) {
   7.680 +        entry.removeRecursively(successCallback, opt_errorHandler);
   7.681 +      }
   7.682 +    };
   7.683 +
   7.684 +    if (entryOrPath.isFile || entryOrPath.isDirectory) {
   7.685 +      removeIt(entryOrPath);
   7.686 +    } else {
   7.687 +      getEntry_(removeIt, entryOrPath);
   7.688 +    }
   7.689 +  };
   7.690 +
   7.691 +  /**
   7.692 +   * Changes the current working directory.
   7.693 +   *
   7.694 +   * @param {string|DirectoryEntry} dirEntryOrPath A DirectoryEntry to move into
   7.695 +   *     or a path relative to the current working directory. A filesystem: URL
   7.696 +   *     is also accepted
   7.697 +   * @param {Function=} opt_successCallback Optional success callback, which is
   7.698 +   *     passed the DirectoryEntry of the new current directory.
   7.699 +   * @param {Function=} opt_errorHandler Optional error callback.
   7.700 +   */
   7.701 +  Filer.prototype.cd = function(dirEntryOrPath, opt_successCallback,
   7.702 +                                opt_errorHandler) {
   7.703 +    if (!fs_) {
   7.704 +      throw new Error(FS_INIT_ERROR_MSG);
   7.705 +    }
   7.706 +
   7.707 +    if (dirEntryOrPath.isDirectory) {
   7.708 +      cwd_ = dirEntryOrPath;
   7.709 +      opt_successCallback && opt_successCallback(cwd_);
   7.710 +    } else {
   7.711 +      // Build a filesystem: URL manually if we need to.
   7.712 +      var dirEntryOrPath = pathToFsURL_(dirEntryOrPath);
   7.713 +
   7.714 +      getEntry_(function(dirEntry) {
   7.715 +        if (dirEntry.isDirectory) {
   7.716 +          cwd_ = dirEntry;
   7.717 +          opt_successCallback && opt_successCallback(cwd_);
   7.718 +        } else {
   7.719 +          var e = new Error(NOT_A_DIRECTORY);
   7.720 +          if (opt_errorHandler) {
   7.721 +            opt_errorHandler(e);
   7.722 +          } else {
   7.723 +            throw e;
   7.724 +          }
   7.725 +        }
   7.726 +      }, dirEntryOrPath);
   7.727 +    }
   7.728 +  };
   7.729 +
   7.730 +  /**
   7.731 +    * Copies a file or directory to a destination.
   7.732 +    *
   7.733 +    * @param {string|FileEntry|DirectoryEntry} src The file/directory
   7.734 +    *     to copy. If src is a string, a path or filesystem: URL is accepted.
   7.735 +    * @param {string|DirectoryEntry} dest The directory to copy the src into.
   7.736 +    *     If dest is a string, a path or filesystem: URL is accepted.
   7.737 +    *     Note: dest needs to be the same type as src.
   7.738 +    * @param {string=} opt_newName An optional name for the copied entry.
   7.739 +    * @param {Function=} opt_successCallback Optional callback passed the moved
   7.740 +    *     entry on a successful copy.
   7.741 +    * @param {Function=} opt_errorHandler Optional error callback.
   7.742 +    */
   7.743 +  Filer.prototype.cp = function(src, dest, opt_newName, opt_successCallback,
   7.744 +                                opt_errorHandler) {
   7.745 +    copyOrMove_.bind(this, src, dest, opt_newName, opt_successCallback,
   7.746 +                     opt_errorHandler)();
   7.747 +  };
   7.748 +
   7.749 +  /**
   7.750 +   * Writes data to a file.
   7.751 +   *
   7.752 +   * If the file already exists, its contents are overwritten.
   7.753 +   *
   7.754 +   * @param {string|FileEntry} entryOrPath A path, filesystem URL, or FileEntry
   7.755 +    *     of the file to lookup.
   7.756 +   * @param {object} dataObj The data to write. Example:
   7.757 +   *     {data: string|Blob|File|ArrayBuffer, type: mimetype, append: true}
   7.758 +   *     If append is specified, data is appended to the end of the file.
   7.759 +   * @param {Function} opt_successCallback Success callback, which is passed
   7.760 +   *     the created FileEntry and FileWriter object used to write the data.
   7.761 +   * @param {Function=} opt_errorHandler Optional error callback.
   7.762 +   */
   7.763 +  Filer.prototype.write = function(entryOrPath, dataObj, opt_successCallback,
   7.764 +                                   opt_errorHandler) {
   7.765 +    if (!fs_) {
   7.766 +      throw new Error(FS_INIT_ERROR_MSG);
   7.767 +    }
   7.768 +
   7.769 +    var writeFile_ = function(fileEntry) {
   7.770 +      fileEntry.createWriter(function(fileWriter) {
   7.771 +
   7.772 +        fileWriter.onerror = opt_errorHandler;
   7.773 +
   7.774 +        if (dataObj.append) {
   7.775 +          fileWriter.onwriteend = function(e) {
   7.776 +            if (opt_successCallback) opt_successCallback(fileEntry, this);
   7.777 +          };
   7.778 +
   7.779 +          fileWriter.seek(fileWriter.length); // Start write position at EOF.
   7.780 +        } else {
   7.781 +          var truncated = false;
   7.782 +          fileWriter.onwriteend = function(e) {
   7.783 +            // Truncate file to newly written file size.
   7.784 +            if (!truncated) {
   7.785 +              truncated = true;
   7.786 +              this.truncate(this.position);
   7.787 +              return;
   7.788 +            }
   7.789 +            if (opt_successCallback) opt_successCallback(fileEntry, this);
   7.790 +          };
   7.791 +        }
   7.792 +
   7.793 +        // Blob() takes ArrayBufferView, not ArrayBuffer.
   7.794 +        if (dataObj.data.__proto__ == ArrayBuffer.prototype) {
   7.795 +          dataObj.data = new Uint8Array(dataObj.data);
   7.796 +        }
   7.797 +        var blob = new Blob([dataObj.data],
   7.798 +                            dataObj.type ? {type: dataObj.type} : {});
   7.799 +
   7.800 +        fileWriter.write(blob);
   7.801 +
   7.802 +      }, opt_errorHandler);
   7.803 +    };
   7.804 +
   7.805 +    if (entryOrPath.isFile) {
   7.806 +      writeFile_(entryOrPath);
   7.807 +    } else if (isFsURL_(entryOrPath)) {
   7.808 +      getEntry_(writeFile_, entryOrPath);
   7.809 +    } else {
   7.810 +      cwd_.getFile(entryOrPath, {create: true, exclusive: false}, writeFile_,
   7.811 +                   opt_errorHandler);
   7.812 +    }
   7.813 +  };
   7.814 +  
   7.815 +  /**
   7.816 +   * Displays disk space usage.
   7.817 +   *
   7.818 +   * @param {Function} successCallback Success callback, which is passed
   7.819 +   *     Used space, Free space and Currently allocated total space in bytes.
   7.820 +   * @param {Function=} opt_errorHandler Optional error callback.
   7.821 +   */
   7.822 +  Filer.prototype.df = function(successCallback, opt_errorHandler) {
   7.823 +    var queryCallback = function(byteUsed, byteCap) {
   7.824 +      successCallback(byteUsed, byteCap - byteUsed, byteCap);
   7.825 +    }
   7.826 +    
   7.827 +    if (!(navigator.temporaryStorage.queryUsageAndQuota && navigator.persistentStorage.queryUsageAndQuota)) {
   7.828 +      throw new Error(NOT_IMPLEMENTED_MSG);
   7.829 +    }
   7.830 +
   7.831 +    if (self.TEMPORARY == this.type) {
   7.832 +      navigator.temporaryStorage.queryUsageAndQuota(queryCallback, opt_errorHandler);
   7.833 +    } else if (self.PERSISTENT == this.type) {
   7.834 +      navigator.persistentStorage.queryUsageAndQuota(queryCallback, opt_errorHandler);
   7.835 +    }
   7.836 +  };
   7.837 +                                   
   7.838 +  return Filer;
   7.839 +};
   7.840 \ No newline at end of file
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/1__Development/0__Code_Dev/Javascript_approach/Packages_libraries_tools/filerjs/src/filer.js	Sat Aug 09 03:34:26 2014 -0700
     8.3 @@ -0,0 +1,836 @@
     8.4 +/** 
     8.5 + * Copyright 2013 - Eric Bidelman
     8.6 + * 
     8.7 + * Licensed under the Apache License, Version 2.0 (the "License");
     8.8 + * you may not use this file except in compliance with the License.
     8.9 + * You may obtain a copy of the License at
    8.10 + * 
    8.11 + *      http://www.apache.org/licenses/LICENSE-2.0
    8.12 + * 
    8.13 + * Unless required by applicable law or agreed to in writing, software
    8.14 + * distributed under the License is distributed on an "AS IS" BASIS,
    8.15 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    8.16 + * See the License for the specific language governing permissions and
    8.17 + * limitations under the License.
    8.18 + 
    8.19 + * @fileoverview
    8.20 + * Convenient wrapper library for the HTML5 Filesystem API, implementing
    8.21 + * familiar UNIX commands (cp, mv, ls) for its API.
    8.22 + * 
    8.23 + * @author Eric Bidelman (ebidel@gmail.com)
    8.24 + * @version: 0.4.3
    8.25 + */
    8.26 +
    8.27 +'use strict';
    8.28 +
    8.29 +var self = this; // window or worker context.
    8.30 +
    8.31 +self.URL = self.URL || self.webkitURL;
    8.32 +self.requestFileSystem = self.requestFileSystem || self.webkitRequestFileSystem;
    8.33 +self.resolveLocalFileSystemURL = self.resolveLocalFileSystemURL ||
    8.34 +                                 self.webkitResolveLocalFileSystemURL;
    8.35 +navigator.temporaryStorage = navigator.temporaryStorage ||
    8.36 +                             navigator.webkitTemporaryStorage;
    8.37 +navigator.persistentStorage = navigator.persistentStorage ||
    8.38 +                              navigator.webkitPersistentStorage;
    8.39 +self.BlobBuilder = self.BlobBuilder || self.MozBlobBuilder ||
    8.40 +                   self.WebKitBlobBuilder;
    8.41 +
    8.42 +// Prevent errors in browsers that don't support FileError.
    8.43 +if (self.FileError === undefined) {
    8.44 +  var FileError = function() {};
    8.45 +  FileError.prototype.prototype = Error.prototype;
    8.46 +}
    8.47 +
    8.48 +var Util = {
    8.49 +
    8.50 +  /**
    8.51 +   * Turns a NodeList into an array.
    8.52 +   *
    8.53 +   * @param {NodeList} list The array-like object.
    8.54 +   * @return {Array} The NodeList as an array.
    8.55 +   */
    8.56 +  toArray: function(list) {
    8.57 +    return Array.prototype.slice.call(list || [], 0);
    8.58 +  },
    8.59 +
    8.60 +  /*toDataURL: function(contentType, uint8Array) {
    8.61 +    return 'data:' + contentType + ';base64,' +
    8.62 +        self.btoa(this.arrayToBinaryString(uint8Array));
    8.63 +  },*/
    8.64 +
    8.65 +  /**
    8.66 +   * Creates a data: URL from string data.
    8.67 +   *
    8.68 +   * @param {string} str The content to encode the data: URL from.
    8.69 +   * @param {string} contentType The mimetype of the data str represents.
    8.70 +   * @param {bool=} opt_isBinary Whether the string data is a binary string
    8.71 +   *     (and therefore should be base64 encoded). True by default.
    8.72 +   * @return {string} The created data: URL.
    8.73 +   */
    8.74 +  strToDataURL: function(str, contentType, opt_isBinary) {
    8.75 +    var isBinary = opt_isBinary != undefined ? opt_isBinary : true;
    8.76 +    if (isBinary) {
    8.77 +      return 'data:' + contentType + ';base64,' + self.btoa(str);
    8.78 +    } else {
    8.79 +      return 'data:' + contentType + ',' + str;
    8.80 +    }
    8.81 +  },
    8.82 +
    8.83 +  /**
    8.84 +   * Creates a blob: URL from a binary str.
    8.85 +   *
    8.86 +   * @param {string} binStr The content as a binary string.
    8.87 +   * @param {string=} opt_contentType An optional mimetype of the data.
    8.88 +   * @return {string} A new blob: URL.
    8.89 +   */
    8.90 +  strToObjectURL: function(binStr, opt_contentType) {
    8.91 +
    8.92 +    var ui8a = new Uint8Array(binStr.length);
    8.93 +    for (var i = 0; i < ui8a.length; ++i) { 
    8.94 +      ui8a[i] = binStr.charCodeAt(i);
    8.95 +    }
    8.96 +
    8.97 +    var blob = new Blob([ui8a],
    8.98 +                        opt_contentType ? {type: opt_contentType} : {});
    8.99 +
   8.100 +    return self.URL.createObjectURL(blob);
   8.101 +  },
   8.102 +
   8.103 +  /**
   8.104 +   * Creates a blob: URL from a File or Blob object.
   8.105 +   *
   8.106 +   * @param {Blob|File} blob The File or Blob data.
   8.107 +   * @return {string} A new blob: URL.
   8.108 +   */
   8.109 +  fileToObjectURL: function(blob) {
   8.110 +    return self.URL.createObjectURL(blob);
   8.111 +  },
   8.112 +
   8.113 +  /**
   8.114 +   * Reads a File or Blob object and returns it as an ArrayBuffer.
   8.115 +   *
   8.116 +   * @param {Blob|File} blob The File or Blob data.
   8.117 +   * @param {Function} callback Success callback passed the array buffer.
   8.118 +   * @param {Function=} opt_error Optional error callback if the read fails.
   8.119 +   */
   8.120 +  fileToArrayBuffer: function(blob, callback, opt_errorCallback) {
   8.121 +    var reader = new FileReader();
   8.122 +    reader.onload = function(e) {
   8.123 +      callback(e.target.result);
   8.124 +    };
   8.125 +    reader.onerror = function(e) {
   8.126 +      if (opt_errorCallback) {
   8.127 +        opt_errorCallback(e);
   8.128 +      }
   8.129 +    };
   8.130 +
   8.131 +    reader.readAsArrayBuffer(blob);
   8.132 +  },
   8.133 +
   8.134 +  /**
   8.135 +   * Creates and returns a blob from a data URL (either base64 encoded or not).
   8.136 +   *
   8.137 +   * @param {string} dataURL The data URL to convert.
   8.138 +   * @return {Blob} A blob representing the array buffer data.
   8.139 +   */
   8.140 +  dataURLToBlob: function(dataURL) {
   8.141 +    var BASE64_MARKER = ';base64,';
   8.142 +    if (dataURL.indexOf(BASE64_MARKER) == -1) {
   8.143 +      var parts = dataURL.split(',');
   8.144 +      var contentType = parts[0].split(':')[1];
   8.145 +      var raw = decodeURIComponent(parts[1]);
   8.146 +
   8.147 +      return new Blob([raw], {type: contentType});
   8.148 +    }
   8.149 +
   8.150 +    var parts = dataURL.split(BASE64_MARKER);
   8.151 +    var contentType = parts[0].split(':')[1];
   8.152 +    var raw = window.atob(parts[1]);
   8.153 +    var rawLength = raw.length;
   8.154 +
   8.155 +    var uInt8Array = new Uint8Array(rawLength);
   8.156 +
   8.157 +    for (var i = 0; i < rawLength; ++i) {
   8.158 +      uInt8Array[i] = raw.charCodeAt(i);
   8.159 +    }
   8.160 +
   8.161 +    return new Blob([uInt8Array], {type: contentType});
   8.162 +  },
   8.163 +
   8.164 +  /**
   8.165 +   * Reads an ArrayBuffer as returns its contents as a binary string.
   8.166 +   *
   8.167 +   * @param {ArrayBuffer} buffer The buffer of data.
   8.168 +   * @param {string=} opt_contentType An optional mimetype of the data.
   8.169 +   * @return {Blob} A blob representing the array buffer data.
   8.170 +   */
   8.171 +  arrayBufferToBlob: function(buffer, opt_contentType) {
   8.172 +    var uInt8Array = new Uint8Array(buffer);
   8.173 +    return new Blob([uInt8Array],
   8.174 +                    opt_contentType ? {type: opt_contentType} : {});
   8.175 +  },
   8.176 +
   8.177 +  /**
   8.178 +   * Reads an ArrayBuffer as returns its contents as a binary string.
   8.179 +   *
   8.180 +   * @param {ArrayBuffer} buffer The buffer of data.
   8.181 +   * @param {Function} callback Success callback passed the binary string.
   8.182 +   * @param {Function=} opt_error Optional error callback if the read fails.
   8.183 +   */
   8.184 +  arrayBufferToBinaryString: function(buffer, callback, opt_errorCallback) {
   8.185 +    var reader = new FileReader();
   8.186 +    reader.onload = function(e) {
   8.187 +      callback(e.target.result);
   8.188 +    };
   8.189 +    reader.onerror = function(e) {
   8.190 +      if (opt_errorCallback) {
   8.191 +        opt_errorCallback(e);
   8.192 +      }
   8.193 +    };
   8.194 +
   8.195 +    var uInt8Array = new Uint8Array(buffer);
   8.196 +    reader.readAsBinaryString(new Blob([uInt8Array]));
   8.197 +  },
   8.198 +
   8.199 +  /**
   8.200 +   * Create a binary string out of an array of numbers (bytes), each varying
   8.201 +   * from 0-255.
   8.202 +   *
   8.203 +   * @param {Array} bytes The array of numbers to transform into a binary str.
   8.204 +   * @return {string} The byte array as a string.
   8.205 +   */
   8.206 +  arrayToBinaryString: function(bytes) {
   8.207 +    if (typeof bytes != typeof []) {
   8.208 +      return null;
   8.209 +    }
   8.210 +    var i = bytes.length;
   8.211 +    var bstr = new Array(i);
   8.212 +    while (i--) {
   8.213 +      bstr[i] = String.fromCharCode(bytes[i]);
   8.214 +    }
   8.215 +    return bstr.join('');
   8.216 +  },
   8.217 +
   8.218 +  /**
   8.219 +   * Returns the file extension for a given filename.
   8.220 +   *
   8.221 +   * @param {string} filename The filename.
   8.222 +   * @return {string} The file's extension.
   8.223 +   */
   8.224 +  getFileExtension: function(filename) {
   8.225 +    var idx = filename.lastIndexOf('.');
   8.226 +    return idx != -1 ? filename.substring(idx) : '';
   8.227 +  }
   8.228 +};
   8.229 +
   8.230 +
   8.231 +var MyFileError = function(obj) {
   8.232 +  this.prototype = FileError.prototype;
   8.233 +  this.code = obj.code;
   8.234 +  this.name = obj.name;
   8.235 +};
   8.236 +//MyFileError.prototype.__proto__ = FileError.prototype;
   8.237 +
   8.238 +// Extend FileError with custom errors and a convenience method to get error
   8.239 +// code mnemonic.
   8.240 +FileError.BROWSER_NOT_SUPPORTED = 1000;
   8.241 +
   8.242 +// TODO: remove when FileError.name is implemented (crbug.com/86014).
   8.243 +FileError.prototype.__defineGetter__('name', function() {
   8.244 +  var keys = Object.keys(FileError);
   8.245 +  for (var i = 0, key; key = keys[i]; ++i) {
   8.246 +    if (FileError[key] == this.code) {
   8.247 +      return key;
   8.248 +    }
   8.249 +  }
   8.250 +  return 'Unknown Error';
   8.251 +});
   8.252 +
   8.253 +
   8.254 +var Filer = new function() {
   8.255 +
   8.256 +  var FS_INIT_ERROR_MSG = 'Filesystem has not been initialized.';
   8.257 +  var NOT_IMPLEMENTED_MSG = 'Not implemented.';
   8.258 +  var NOT_A_DIRECTORY = 'Path was not a directory.';
   8.259 +  var INCORRECT_ARGS = 'These method arguments are not supported.';
   8.260 +  var FS_URL_SCHEME = 'filesystem:';
   8.261 +  var DEFAULT_FS_SIZE = 1024 * 1024; // 1MB.
   8.262 +
   8.263 +  var fs_ = null;
   8.264 +  var cwd_ = null;
   8.265 +  var isOpen_ = false;
   8.266 +
   8.267 +  var isFsURL_ = function(path) {
   8.268 +    return path.indexOf(FS_URL_SCHEME) == 0;
   8.269 +  };
   8.270 +
   8.271 +  // Path can be relative or absolute. If relative, it's taken from the cwd_.
   8.272 +  // If a filesystem URL is passed it, it is simple returned
   8.273 +  var pathToFsURL_ = function(path) {
   8.274 +    if (!isFsURL_(path)) {
   8.275 +      if (path[0] == '/') {
   8.276 +        path = fs_.root.toURL() + path.substring(1);
   8.277 +      } else if (path.indexOf('./') == 0 || path.indexOf('../') == 0) {
   8.278 +        if (path == '../' && cwd_ != fs_.root) {
   8.279 +          path = cwd_.toURL() + '/' + path;
   8.280 +        } else {
   8.281 +          path = cwd_.toURL() + path;
   8.282 +        }
   8.283 +      } else {
   8.284 +        path = cwd_.toURL() + '/' + path;
   8.285 +      }
   8.286 +    }
   8.287 +
   8.288 +    return path;
   8.289 +  };
   8.290 +
   8.291 +  /**
   8.292 +   * Looks up a FileEntry or DirectoryEntry for a given path.
   8.293 +   *
   8.294 +   * @param {function(...FileEntry|DirectorEntry)} callback A callback to be
   8.295 +   *     passed the entry/entries that were fetched. The ordering of the
   8.296 +   *     entries passed to the callback correspond to the same order passed
   8.297 +   *     to this method.
   8.298 +   * @param {...string} var_args 1-2 paths to lookup and return entries for.
   8.299 +   *     These can be paths or filesystem: URLs.
   8.300 +   */
   8.301 +  var getEntry_ = function(callback, var_args) {
   8.302 +    var srcStr = arguments[1];
   8.303 +    var destStr = arguments[2];
   8.304 +
   8.305 +    var onError = function(e) {
   8.306 +      if (e.code == FileError.NOT_FOUND_ERR) {
   8.307 +        if (destStr) {
   8.308 +          throw new Error('"' + srcStr + '" or "' + destStr +
   8.309 +                          '" does not exist.');
   8.310 +        } else {
   8.311 +          throw new Error('"' + srcStr + '" does not exist.');
   8.312 +        }
   8.313 +      } else {
   8.314 +        throw new Error('Problem getting Entry for one or more paths.');
   8.315 +      }
   8.316 +    };
   8.317 +
   8.318 +    // Build a filesystem: URL manually if we need to.
   8.319 +    var src = pathToFsURL_(srcStr);
   8.320 +
   8.321 +    if (arguments.length == 3) {
   8.322 +      var dest = pathToFsURL_(destStr);
   8.323 +      self.resolveLocalFileSystemURL(src, function(srcEntry) {
   8.324 +        self.resolveLocalFileSystemURL(dest, function(destEntry) {
   8.325 +          callback(srcEntry, destEntry);
   8.326 +        }, onError);
   8.327 +      }, onError);
   8.328 +    } else {
   8.329 +      self.resolveLocalFileSystemURL(src, callback, onError);
   8.330 +    }
   8.331 +  };
   8.332 +
   8.333 +  /**
   8.334 +   * Copy or moves a file or directory to a destination.
   8.335 +   *
   8.336 +   * See public method's description (Filer.cp()) for rest of params.
   8.337 +   * @param {Boolean=} opt_deleteOrig True if the original entry should be
   8.338 +   *     deleted after the copy takes place, essentially making the operation
   8.339 +   *     a move instead of a copy. Defaults to false.
   8.340 +   */
   8.341 +  var copyOrMove_ = function(src, dest, opt_newName, opt_successCallback,
   8.342 +                             opt_errorHandler, opt_deleteOrig) {
   8.343 +    var self = this;
   8.344 +
   8.345 +    if (!fs_) {
   8.346 +      throw new Error(FS_INIT_ERROR_MSG);
   8.347 +    }
   8.348 +
   8.349 +    if (typeof src != typeof dest) {
   8.350 +      throw new Error(INCORRECT_ARGS);
   8.351 +    }
   8.352 +
   8.353 +    var newName = opt_newName || null;
   8.354 +    var deleteOrig = opt_deleteOrig != undefined ? opt_deleteOrig : false;
   8.355 +
   8.356 +    if ((src.isFile || dest.isDirectory) && dest.isDirectory) {
   8.357 +      if (deleteOrig) {
   8.358 +        src.moveTo(dest, newName, opt_successCallback, opt_errorHandler);
   8.359 +      } else {
   8.360 +        src.copyTo(dest, newName, opt_successCallback, opt_errorHandler);
   8.361 +      }
   8.362 +    } else {
   8.363 +      getEntry_(function(srcEntry, destDir) {
   8.364 +        if (!destDir.isDirectory) {
   8.365 +          var e = new Error('Oops! "' + destDir.name + ' is not a directory!');
   8.366 +          if (opt_errorHandler) {
   8.367 +            opt_errorHandler(e);
   8.368 +          } else {
   8.369 +            throw e;
   8.370 +          }
   8.371 +          return;
   8.372 +        }
   8.373 +        if (deleteOrig) {
   8.374 +          srcEntry.moveTo(destDir, newName, opt_successCallback, opt_errorHandler);
   8.375 +        } else {
   8.376 +          srcEntry.copyTo(destDir, newName, opt_successCallback, opt_errorHandler);
   8.377 +        }
   8.378 +      }, src, dest);
   8.379 +    }
   8.380 +  }
   8.381 +
   8.382 +  function Filer(fs) {
   8.383 +    fs_  = fs || null;
   8.384 +    if (fs_) {
   8.385 +      cwd_ = fs_.root;
   8.386 +      isOpen_ = true; // TODO: this may not be the case.
   8.387 +    }
   8.388 +  }
   8.389 +
   8.390 +  Filer.DEFAULT_FS_SIZE = DEFAULT_FS_SIZE;
   8.391 +  Filer.version = '0.4.3';
   8.392 +
   8.393 +  Filer.prototype = {
   8.394 +    get fs() {
   8.395 +      return fs_;
   8.396 +    },
   8.397 +    get isOpen() {
   8.398 +      return isOpen_;
   8.399 +    },
   8.400 +    get cwd() {
   8.401 +      return cwd_;
   8.402 +    }
   8.403 +  }
   8.404 +
   8.405 +  /**
   8.406 +   * Constructs and returns a filesystem: URL given a path.
   8.407 +   *
   8.408 +   * @param {string=} path The path to construct a URL for.
   8.409 +   *     size {int=} The storage size (in bytes) to open the filesystem with.
   8.410 +   *         Defaults to DEFAULT_FS_SIZE.
   8.411 +   * @return {string} The filesystem: URL.
   8.412 +   */
   8.413 +  Filer.prototype.pathToFilesystemURL = function(path) {
   8.414 +    return pathToFsURL_(path);
   8.415 +  }
   8.416 +
   8.417 +  /**
   8.418 +   * Initializes (opens) the file system.
   8.419 +   *
   8.420 +   * @param {object=} opt_initObj Optional object literal with the following
   8.421 +   *     properties. Note: If {} or null is passed, default values are used.
   8.422 +   *     persistent {Boolean=} Whether the browser should use persistent quota.
   8.423 +   *         Default is false.
   8.424 +   *     size {int=} The storage size (in bytes) to open the filesystem with.
   8.425 +   *         Defaults to DEFAULT_FS_SIZE.
   8.426 +   * @param {Function=} opt_successCallback Optional success handler passed a
   8.427 +   *      DOMFileSystem object.
   8.428 +   * @param {Function=} opt_errorHandler Optional error callback.
   8.429 +   */
   8.430 +  Filer.prototype.init = function(opt_initObj, opt_successCallback,
   8.431 +                                  opt_errorHandler) {
   8.432 +    if (!self.requestFileSystem) {
   8.433 +      throw new MyFileError({
   8.434 +        code: FileError.BROWSER_NOT_SUPPORTED,
   8.435 +        name: 'BROWSER_NOT_SUPPORTED'
   8.436 +      });
   8.437 +    }
   8.438 +
   8.439 +    var initObj = opt_initObj ? opt_initObj : {}; // Use defaults if obj is null.
   8.440 +
   8.441 +    var size = initObj.size || DEFAULT_FS_SIZE;
   8.442 +    this.type = self.TEMPORARY;
   8.443 +    if ('persistent' in initObj && initObj.persistent) {
   8.444 +      this.type = self.PERSISTENT;
   8.445 +    }
   8.446 +
   8.447 +    var init = function(fs) {
   8.448 +      this.size = size;
   8.449 +      fs_ = fs;
   8.450 +      cwd_ = fs_.root;
   8.451 +      isOpen_ = true;
   8.452 +
   8.453 +      opt_successCallback && opt_successCallback(fs);
   8.454 +    };
   8.455 +
   8.456 +    if (this.type == self.PERSISTENT && !!navigator.persistentStorage) {
   8.457 +      navigator.persistentStorage.requestQuota(size, function(grantedBytes) {  
   8.458 +        self.requestFileSystem(
   8.459 +            this.type, grantedBytes, init.bind(this), opt_errorHandler);
   8.460 +      }.bind(this), opt_errorHandler);
   8.461 +    } else {
   8.462 +      self.requestFileSystem(
   8.463 +          this.type, size, init.bind(this), opt_errorHandler);
   8.464 +    }
   8.465 +  };
   8.466 +
   8.467 +  /**
   8.468 +   * Reads the contents of a directory.
   8.469 +   *
   8.470 +   * @param {string|DirectoryEntry} dirEntryOrPath A path relative to the
   8.471 +   *     current working directory. In most cases that is the root entry, unless
   8.472 +   *     cd() has been called. A DirectoryEntry or filesystem URL can also be
   8.473 +   *     passed, in which case, the folder's contents will be returned.
   8.474 +   * @param {Function} successCallback Success handler passed an Array<Entry>.
   8.475 +   * @param {Function=} opt_errorHandler Optional error callback.
   8.476 +   */
   8.477 +  Filer.prototype.ls = function(dirEntryOrPath, successCallback,
   8.478 +                                opt_errorHandler) {
   8.479 +    if (!fs_) {
   8.480 +      throw new Error(FS_INIT_ERROR_MSG);
   8.481 +    }
   8.482 +
   8.483 +    var callback = function(dirEntry) {
   8.484 +
   8.485 +      cwd_ = dirEntry;
   8.486 +
   8.487 +      // Read contents of current working directory. According to spec, need to
   8.488 +      // keep calling readEntries() until length of result array is 0. We're
   8.489 +      // guarenteed the same entry won't be returned again.
   8.490 +      var entries_ = [];
   8.491 +      var reader = cwd_.createReader();
   8.492 +
   8.493 +      var readEntries = function() {
   8.494 +        reader.readEntries(function(results) {
   8.495 +          if (!results.length) {
   8.496 +            // By default, sort the list by name.
   8.497 +            entries_.sort(function(a, b) {
   8.498 +              return a.name < b.name ? -1 : b.name < a.name ? 1 : 0;
   8.499 +            });
   8.500 +            successCallback(entries_);
   8.501 +          } else {
   8.502 +            entries_ = entries_.concat(Util.toArray(results));
   8.503 +            readEntries();
   8.504 +          }
   8.505 +        }, opt_errorHandler);
   8.506 +      };
   8.507 +
   8.508 +      readEntries();
   8.509 +    };
   8.510 +
   8.511 +    if (dirEntryOrPath.isDirectory) { // passed a DirectoryEntry.
   8.512 +      callback(dirEntryOrPath);
   8.513 +    } else if (isFsURL_(dirEntryOrPath)) { // passed a filesystem URL.
   8.514 +      getEntry_(callback, dirEntryOrPath);
   8.515 +    } else { // Passed a path. Look up DirectoryEntry and proceeed.
   8.516 +      // TODO: Find way to use getEntry_(callback, dirEntryOrPath); with cwd_.
   8.517 +      cwd_.getDirectory(dirEntryOrPath, {}, callback, opt_errorHandler);
   8.518 +    }
   8.519 +  };
   8.520 +
   8.521 +  /**
   8.522 +   * Creates a new directory.
   8.523 +   *
   8.524 +   * @param {string} path The name of the directory to create. If a path is
   8.525 +   *     given, each intermediate dir is created (e.g. similar to mkdir -p).
   8.526 +   * @param {bool=} opt_exclusive True if an error should be thrown if
   8.527 +   *     one or more of the directories already exists. False by default.
   8.528 +   * @param {Function} opt_successCallback Success handler passed the
   8.529 +   *     DirectoryEntry that was created. If we were passed a path, the last
   8.530 +   *     directory that was created is passed back.
   8.531 +   * @param {Function=} opt_errorHandler Optional error callback.
   8.532 +   */
   8.533 +  Filer.prototype.mkdir = function(path, opt_exclusive, opt_successCallback,
   8.534 +                                   opt_errorHandler) {
   8.535 +    if (!fs_) {
   8.536 +      throw new Error(FS_INIT_ERROR_MSG);
   8.537 +    }
   8.538 +
   8.539 +    var exclusive = opt_exclusive != null ? opt_exclusive : false;
   8.540 +
   8.541 +    var folderParts = path.split('/');
   8.542 +
   8.543 +    var createDir = function(rootDir, folders) {
   8.544 +      // Throw out './' or '/' and move on. Prevents: '/foo/.//bar'.
   8.545 +      if (folders[0] == '.' || folders[0] == '') {
   8.546 +        folders = folders.slice(1);
   8.547 +      }
   8.548 +
   8.549 +      rootDir.getDirectory(folders[0], {create: true, exclusive: exclusive},
   8.550 +        function (dirEntry) {
   8.551 +          if (dirEntry.isDirectory) { // TODO: check shouldn't be necessary.
   8.552 +            // Recursively add the new subfolder if we have more to create and
   8.553 +            // There was more than one folder to create.
   8.554 +            if (folders.length && folderParts.length != 1) {
   8.555 +              createDir(dirEntry, folders.slice(1));
   8.556 +            } else {
   8.557 +              // Return the last directory that was created.
   8.558 +              if (opt_successCallback) opt_successCallback(dirEntry);
   8.559 +            }
   8.560 +          } else {
   8.561 +            var e = new Error(path + ' is not a directory');
   8.562 +            if (opt_errorHandler) {
   8.563 +              opt_errorHandler(e);
   8.564 +            } else {
   8.565 +              throw e;
   8.566 +            }
   8.567 +          }
   8.568 +        },
   8.569 +        function(e) {
   8.570 +          if (e.code == FileError.INVALID_MODIFICATION_ERR) {
   8.571 +            e.message = "'" + path + "' already exists";
   8.572 +            if (opt_errorHandler) {
   8.573 +              opt_errorHandler(e);
   8.574 +            } else {
   8.575 +              throw e;
   8.576 +            }
   8.577 +          }
   8.578 +        }
   8.579 +      );
   8.580 +    };
   8.581 +
   8.582 +    createDir(cwd_, folderParts);
   8.583 +  };
   8.584 +
   8.585 +  /**
   8.586 +   * Looks up and return a File for a given file entry.
   8.587 +   *
   8.588 +   * @param {string|FileEntry} entryOrPath A path, filesystem URL, or FileEntry
   8.589 +   *     of the file to lookup.
   8.590 +   * @param {Function} successCallback Success callback passed the File object.
   8.591 +   * @param {Function=} opt_errorHandler Optional error callback.
   8.592 +   */
   8.593 +  Filer.prototype.open = function(entryOrPath, successCallback, opt_errorHandler) {
   8.594 +    if (!fs_) {
   8.595 +      throw new Error(FS_INIT_ERROR_MSG);
   8.596 +    }
   8.597 +
   8.598 +    if (entryOrPath.isFile) {
   8.599 +      entryOrPath.file(successCallback, opt_errorHandler);
   8.600 +    } else {
   8.601 +      getEntry_(function(fileEntry) {
   8.602 +        fileEntry.file(successCallback, opt_errorHandler);
   8.603 +      }, pathToFsURL_(entryOrPath));
   8.604 +    }
   8.605 +  };
   8.606 +
   8.607 +  /**
   8.608 +   * Creates an empty file.
   8.609 +   *
   8.610 +   * @param {string} path The relative path of the file to create, from the
   8.611 +   *     current working directory.
   8.612 +   * @param {bool=} opt_exclusive True (default) if an error should be thrown if
   8.613 +   *     the file already exists.
   8.614 +   * @param {Function} successCallback A success callback, which is passed
   8.615 +   *     the new FileEntry.
   8.616 +   * @param {Function=} opt_errorHandler Optional error callback.
   8.617 +   */
   8.618 +  Filer.prototype.create = function(path, opt_exclusive, successCallback,
   8.619 +                                    opt_errorHandler) {
   8.620 +    if (!fs_) {
   8.621 +      throw new Error(FS_INIT_ERROR_MSG);
   8.622 +    }
   8.623 +
   8.624 +    var exclusive = opt_exclusive != null ? opt_exclusive : true;
   8.625 +
   8.626 +    cwd_.getFile(path, {create: true,  exclusive: exclusive}, successCallback,
   8.627 +      function(e) {
   8.628 +        if (e.code == FileError.INVALID_MODIFICATION_ERR) {
   8.629 +          e.message = "'" + path + "' already exists";
   8.630 +        }
   8.631 +        if (opt_errorHandler) {
   8.632 +          opt_errorHandler(e);
   8.633 +        } else {
   8.634 +          throw e;
   8.635 +        }
   8.636 +      }
   8.637 +    );
   8.638 +  };
   8.639 +
   8.640 +  /**
   8.641 +    * Moves a file or directory.
   8.642 +    *
   8.643 +    * @param {string|FileEntry|DirectoryEntry} src The file/directory
   8.644 +    *     to move. If src is a string, a path or filesystem: URL is accepted.
   8.645 +    * @param {string|DirectoryEntry} dest The directory to move the src into.
   8.646 +    *     If dest is a string, a path or filesystem: URL is accepted.
   8.647 +    *     Note: dest needs to be the same type as src.
   8.648 +    * @param {string=} opt_newName An optional new name for the moved entry.
   8.649 +    * @param {Function=} opt_successCallback Optional callback passed the moved
   8.650 +    *     entry on a successful move.
   8.651 +    * @param {Function=} opt_errorHandler Optional error callback.
   8.652 +    */
   8.653 +  Filer.prototype.mv = function(src, dest, opt_newName, opt_successCallback,
   8.654 +                                opt_errorHandler) {
   8.655 +    copyOrMove_.bind(this, src, dest, opt_newName, opt_successCallback,
   8.656 +                     opt_errorHandler, true)();
   8.657 +  };
   8.658 +
   8.659 +  /**
   8.660 +   * Deletes a file or directory entry.
   8.661 +   *
   8.662 +   * @param {string|FileEntry|DirectoryEntry} entryOrPath The file or directory
   8.663 +   *     to remove. If entry is a DirectoryEntry, its contents are removed
   8.664 +   *     recursively. If entryOrPath is a string, a path or filesystem: URL is
   8.665 +   *     accepted.
   8.666 +   * @param {Function} successCallback Zero arg callback invoked on
   8.667 +   *     successful removal.
   8.668 +   * @param {Function=} opt_errorHandler Optional error callback.
   8.669 +   */
   8.670 +  Filer.prototype.rm = function(entryOrPath, successCallback,
   8.671 +                                opt_errorHandler) {
   8.672 +    if (!fs_) {
   8.673 +      throw new Error(FS_INIT_ERROR_MSG);
   8.674 +    }
   8.675 +
   8.676 +    var removeIt = function(entry) {
   8.677 +      if (entry.isFile) {
   8.678 +        entry.remove(successCallback, opt_errorHandler);
   8.679 +      } else if (entry.isDirectory) {
   8.680 +        entry.removeRecursively(successCallback, opt_errorHandler);
   8.681 +      }
   8.682 +    };
   8.683 +
   8.684 +    if (entryOrPath.isFile || entryOrPath.isDirectory) {
   8.685 +      removeIt(entryOrPath);
   8.686 +    } else {
   8.687 +      getEntry_(removeIt, entryOrPath);
   8.688 +    }
   8.689 +  };
   8.690 +
   8.691 +  /**
   8.692 +   * Changes the current working directory.
   8.693 +   *
   8.694 +   * @param {string|DirectoryEntry} dirEntryOrPath A DirectoryEntry to move into
   8.695 +   *     or a path relative to the current working directory. A filesystem: URL
   8.696 +   *     is also accepted
   8.697 +   * @param {Function=} opt_successCallback Optional success callback, which is
   8.698 +   *     passed the DirectoryEntry of the new current directory.
   8.699 +   * @param {Function=} opt_errorHandler Optional error callback.
   8.700 +   */
   8.701 +  Filer.prototype.cd = function(dirEntryOrPath, opt_successCallback,
   8.702 +                                opt_errorHandler) {
   8.703 +    if (!fs_) {
   8.704 +      throw new Error(FS_INIT_ERROR_MSG);
   8.705 +    }
   8.706 +
   8.707 +    if (dirEntryOrPath.isDirectory) {
   8.708 +      cwd_ = dirEntryOrPath;
   8.709 +      opt_successCallback && opt_successCallback(cwd_);
   8.710 +    } else {
   8.711 +      // Build a filesystem: URL manually if we need to.
   8.712 +      var dirEntryOrPath = pathToFsURL_(dirEntryOrPath);
   8.713 +
   8.714 +      getEntry_(function(dirEntry) {
   8.715 +        if (dirEntry.isDirectory) {
   8.716 +          cwd_ = dirEntry;
   8.717 +          opt_successCallback && opt_successCallback(cwd_);
   8.718 +        } else {
   8.719 +          var e = new Error(NOT_A_DIRECTORY);
   8.720 +          if (opt_errorHandler) {
   8.721 +            opt_errorHandler(e);
   8.722 +          } else {
   8.723 +            throw e;
   8.724 +          }
   8.725 +        }
   8.726 +      }, dirEntryOrPath);
   8.727 +    }
   8.728 +  };
   8.729 +
   8.730 +  /**
   8.731 +    * Copies a file or directory to a destination.
   8.732 +    *
   8.733 +    * @param {string|FileEntry|DirectoryEntry} src The file/directory
   8.734 +    *     to copy. If src is a string, a path or filesystem: URL is accepted.
   8.735 +    * @param {string|DirectoryEntry} dest The directory to copy the src into.
   8.736 +    *     If dest is a string, a path or filesystem: URL is accepted.
   8.737 +    *     Note: dest needs to be the same type as src.
   8.738 +    * @param {string=} opt_newName An optional name for the copied entry.
   8.739 +    * @param {Function=} opt_successCallback Optional callback passed the moved
   8.740 +    *     entry on a successful copy.
   8.741 +    * @param {Function=} opt_errorHandler Optional error callback.
   8.742 +    */
   8.743 +  Filer.prototype.cp = function(src, dest, opt_newName, opt_successCallback,
   8.744 +                                opt_errorHandler) {
   8.745 +    copyOrMove_.bind(this, src, dest, opt_newName, opt_successCallback,
   8.746 +                     opt_errorHandler)();
   8.747 +  };
   8.748 +
   8.749 +  /**
   8.750 +   * Writes data to a file.
   8.751 +   *
   8.752 +   * If the file already exists, its contents are overwritten.
   8.753 +   *
   8.754 +   * @param {string|FileEntry} entryOrPath A path, filesystem URL, or FileEntry
   8.755 +    *     of the file to lookup.
   8.756 +   * @param {object} dataObj The data to write. Example:
   8.757 +   *     {data: string|Blob|File|ArrayBuffer, type: mimetype, append: true}
   8.758 +   *     If append is specified, data is appended to the end of the file.
   8.759 +   * @param {Function} opt_successCallback Success callback, which is passed
   8.760 +   *     the created FileEntry and FileWriter object used to write the data.
   8.761 +   * @param {Function=} opt_errorHandler Optional error callback.
   8.762 +   */
   8.763 +  Filer.prototype.write = function(entryOrPath, dataObj, opt_successCallback,
   8.764 +                                   opt_errorHandler) {
   8.765 +    if (!fs_) {
   8.766 +      throw new Error(FS_INIT_ERROR_MSG);
   8.767 +    }
   8.768 +
   8.769 +    var writeFile_ = function(fileEntry) {
   8.770 +      fileEntry.createWriter(function(fileWriter) {
   8.771 +
   8.772 +        fileWriter.onerror = opt_errorHandler;
   8.773 +
   8.774 +        if (dataObj.append) {
   8.775 +          fileWriter.onwriteend = function(e) {
   8.776 +            if (opt_successCallback) opt_successCallback(fileEntry, this);
   8.777 +          };
   8.778 +
   8.779 +          fileWriter.seek(fileWriter.length); // Start write position at EOF.
   8.780 +        } else {
   8.781 +          var truncated = false;
   8.782 +          fileWriter.onwriteend = function(e) {
   8.783 +            // Truncate file to newly written file size.
   8.784 +            if (!truncated) {
   8.785 +              truncated = true;
   8.786 +              this.truncate(this.position);
   8.787 +              return;
   8.788 +            }
   8.789 +            if (opt_successCallback) opt_successCallback(fileEntry, this);
   8.790 +          };
   8.791 +        }
   8.792 +
   8.793 +        // Blob() takes ArrayBufferView, not ArrayBuffer.
   8.794 +        if (dataObj.data.__proto__ == ArrayBuffer.prototype) {
   8.795 +          dataObj.data = new Uint8Array(dataObj.data);
   8.796 +        }
   8.797 +        var blob = new Blob([dataObj.data],
   8.798 +                            dataObj.type ? {type: dataObj.type} : {});
   8.799 +
   8.800 +        fileWriter.write(blob);
   8.801 +
   8.802 +      }, opt_errorHandler);
   8.803 +    };
   8.804 +
   8.805 +    if (entryOrPath.isFile) {
   8.806 +      writeFile_(entryOrPath);
   8.807 +    } else if (isFsURL_(entryOrPath)) {
   8.808 +      getEntry_(writeFile_, entryOrPath);
   8.809 +    } else {
   8.810 +      cwd_.getFile(entryOrPath, {create: true, exclusive: false}, writeFile_,
   8.811 +                   opt_errorHandler);
   8.812 +    }
   8.813 +  };
   8.814 +  
   8.815 +  /**
   8.816 +   * Displays disk space usage.
   8.817 +   *
   8.818 +   * @param {Function} successCallback Success callback, which is passed
   8.819 +   *     Used space, Free space and Currently allocated total space in bytes.
   8.820 +   * @param {Function=} opt_errorHandler Optional error callback.
   8.821 +   */
   8.822 +  Filer.prototype.df = function(successCallback, opt_errorHandler) {
   8.823 +    var queryCallback = function(byteUsed, byteCap) {
   8.824 +      successCallback(byteUsed, byteCap - byteUsed, byteCap);
   8.825 +    }
   8.826 +    
   8.827 +    if (!(navigator.temporaryStorage.queryUsageAndQuota && navigator.persistentStorage.queryUsageAndQuota)) {
   8.828 +      throw new Error(NOT_IMPLEMENTED_MSG);
   8.829 +    }
   8.830 +
   8.831 +    if (self.TEMPORARY == this.type) {
   8.832 +      navigator.temporaryStorage.queryUsageAndQuota(queryCallback, opt_errorHandler);
   8.833 +    } else if (self.PERSISTENT == this.type) {
   8.834 +      navigator.persistentStorage.queryUsageAndQuota(queryCallback, opt_errorHandler);
   8.835 +    }
   8.836 +  };
   8.837 +                                   
   8.838 +  return Filer;
   8.839 +};
     9.1 --- a/1__Development/6__Website/POPBottleServer/POPBottleServer.py	Thu Aug 07 00:10:50 2014 -0700
     9.2 +++ b/1__Development/6__Website/POPBottleServer/POPBottleServer.py	Sat Aug 09 03:34:26 2014 -0700
     9.3 @@ -1,32 +1,47 @@
     9.4  from bottle import route, run, template, response
     9.5  import urllib
     9.6  
     9.7 -graphFile = None
     9.8 -
     9.9  #==============
    9.10 -
    9.11 -@route('/startsavinggraph')
    9.12 -def startsavinggraph():
    9.13 -    global graphFile
    9.14 +# Persisting the graph to disk
    9.15 +#==============
    9.16 +@route('/cleargraph')
    9.17 +def cleargraph():
    9.18      graphFile = open("syntaxGraph.json", "w")
    9.19 -    print "opened graph file "
    9.20 -    print "Name of the file: ", graphFile.name
    9.21 -    print "Closed or not : ", graphFile.closed
    9.22 -    print "Opening mode : ", graphFile.mode
    9.23 -    print "Softspace flag : ", graphFile.softspace
    9.24 +    print "opened graph file, which should have cleared it"
    9.25 +    graphFile.close()
    9.26      response.set_header('Access-Control-Allow-Origin', '*')
    9.27  
    9.28  @route('/save1elem/<thejson>')
    9.29  def save1elem(thejson):
    9.30 -	thejson = thejson.replace('%T', '\t')
    9.31 -	thejson = thejson.replace('%N', '\n')
    9.32 -	thejson = thejson.replace('%H', '\\')
    9.33 -	thejson = thejson.replace('%S', '/')
    9.34 -#	print thejson
    9.35 -	global graphFile
    9.36 -	graphFile.write("%s\nend elem\n" % thejson)
    9.37 +    thejson = thejson.replace('%T', '\t')
    9.38 +    thejson = thejson.replace('%N', '\n')
    9.39 +    thejson = thejson.replace('%H', '\\')
    9.40 +    thejson = thejson.replace('%S', '/')
    9.41 +#    print thejson
    9.42 +    graphFile = open("syntaxGraph.json", "a")
    9.43 +    graphFile.write("%s\nseparator\n" % thejson)
    9.44 +    graphFile.close()
    9.45 +    response.set_header('Access-Control-Allow-Origin', '*')
    9.46 +    return "ACK"
    9.47 +
    9.48 +#================
    9.49 +# Retrieving graph
    9.50 +#================
    9.51 +
    9.52 +@route('/retrievegraph')
    9.53 +def retrieveGraph():
    9.54 +	graphFile = open("syntaxGraph.json", "r")
    9.55 +	returnjson = graphFile.read()
    9.56  	response.set_header('Access-Control-Allow-Origin', '*')
    9.57 +	graphFile.close()
    9.58 +	return returnjson
    9.59  
    9.60 +#================
    9.61 +
    9.62 +#Deprecated -- at first, tried open via "start" URL, then write, then close
    9.63 +# here..  but issues in async mode.  So now, just "start" clears the file
    9.64 +# then write opens in append mode, writes, and closes right away.
    9.65 +#So no longer need the "end" URL
    9.66  @route('/endsavinggraph')
    9.67  def endsavinggraph():
    9.68  	global graphFile
    9.69 @@ -34,8 +49,7 @@
    9.70  	graphFile.close()
    9.71  	return 'ACK'
    9.72  
    9.73 -#================
    9.74 -
    9.75 +#Deprecated -- start and end retrieve are deprecated
    9.76  @route('/startretrievinggraph')
    9.77  def startretrievinggraph():
    9.78  	global graphFile
    9.79 @@ -43,13 +57,6 @@
    9.80  	response.set_header('Access-Control-Allow-Origin', '*')
    9.81  	return 'ACK'
    9.82  
    9.83 -@route('/get1elem')
    9.84 -def get1elem():
    9.85 -	global graphFile
    9.86 -	returnjson = graphFile.readline()
    9.87 -	response.set_header('Access-Control-Allow-Origin', '*')
    9.88 -	return returnjson
    9.89 -
    9.90  @route('/endretrievinggraph')
    9.91  def endretrievinggraph():
    9.92  	global graphFile
    10.1 --- a/1__Development/6__Website/POPBottleServer/syntaxGraph.json	Thu Aug 07 00:10:50 2014 -0700
    10.2 +++ b/1__Development/6__Website/POPBottleServer/syntaxGraph.json	Sat Aug 09 03:34:26 2014 -0700
    10.3 @@ -1,9 +1,11 @@
    10.4  {
    10.5  	"rootElem": 1,
    10.6  	"rootViewSet": {
    10.7 +		"type": "ViewSet",
    10.8  		"ID": 2,
    10.9  		"viewSetLinks": [
   10.10  			{
   10.11 +				"type": "ViewSetLink",
   10.12  				"ID": 3,
   10.13  				"referenceViewSet": 2,
   10.14  				"subordinateViewSet": 4,
   10.15 @@ -14,16 +16,19 @@
   10.16  		]
   10.17  	}
   10.18  }
   10.19 -end elem
   10.20 +separator
   10.21  {
   10.22 +	"type": "GraphElem",
   10.23  	"ID": 31,
   10.24  	"properties": [
   10.25  		{
   10.26 +			"type": "GraphProperty",
   10.27  			"ID": 32,
   10.28  			"propertyName": "TypeOfElement",
   10.29  			"propertyValue": "Command",
   10.30  			"subProperties": [
   10.31  				{
   10.32 +					"type": "GraphProperty",
   10.33  					"ID": 33,
   10.34  					"propertyName": "CommandID",
   10.35  					"propertyValue": "GabePattPop",
   10.36 @@ -32,6 +37,7 @@
   10.37  			]
   10.38  		},
   10.39  		{
   10.40 +			"type": "GraphProperty",
   10.41  			"ID": 34,
   10.42  			"propertyName": "TypeOfSyntacticStructure",
   10.43  			"propertyValue": "syntacticPatternRoot",
   10.44 @@ -40,15 +46,18 @@
   10.45  	],
   10.46  	"portsIn": [
   10.47  		{
   10.48 +			"type": "GraphPort",
   10.49  			"ID": 35,
   10.50  			"element": 31,
   10.51  			"properties": [
   10.52  				{
   10.53 +					"type": "GraphProperty",
   10.54  					"ID": 36,
   10.55  					"propertyName": "TypeOfPort",
   10.56  					"propertyValue": "dataComm",
   10.57  					"subProperties": [
   10.58  						{
   10.59 +							"type": "GraphProperty",
   10.60  							"ID": 37,
   10.61  							"propertyName": "TypeOfCommData",
   10.62  							"propertyValue": "GabePattStack",
   10.63 @@ -64,15 +73,18 @@
   10.64  	],
   10.65  	"portsOut": [
   10.66  		{
   10.67 +			"type": "GraphPort",
   10.68  			"ID": 38,
   10.69  			"element": 31,
   10.70  			"properties": [
   10.71  				{
   10.72 +					"type": "GraphProperty",
   10.73  					"ID": 39,
   10.74  					"propertyName": "TypeOfPort",
   10.75  					"propertyValue": "dataComm",
   10.76  					"subProperties": [
   10.77  						{
   10.78 +							"type": "GraphProperty",
   10.79  							"ID": 40,
   10.80  							"propertyName": "TypeOfCommData",
   10.81  							"propertyValue": "GabePattStack",
   10.82 @@ -84,15 +96,18 @@
   10.83  			"pairedPorts": []
   10.84  		},
   10.85  		{
   10.86 +			"type": "GraphPort",
   10.87  			"ID": 41,
   10.88  			"element": 31,
   10.89  			"properties": [
   10.90  				{
   10.91 +					"type": "GraphProperty",
   10.92  					"ID": 42,
   10.93  					"propertyName": "TypeOfPort",
   10.94  					"propertyValue": "dataComm",
   10.95  					"subProperties": [
   10.96  						{
   10.97 +							"type": "GraphProperty",
   10.98  							"ID": 43,
   10.99  							"propertyName": "TypeOfCommData",
  10.100  							"propertyValue": "float",
  10.101 @@ -107,16 +122,19 @@
  10.102  	"linkedElems": [],
  10.103  	"isAlreadyVisited": true
  10.104  }
  10.105 -end elem
  10.106 +separator
  10.107  {
  10.108 +	"type": "GraphElem",
  10.109  	"ID": 18,
  10.110  	"properties": [
  10.111  		{
  10.112 +			"type": "GraphProperty",
  10.113  			"ID": 19,
  10.114  			"propertyName": "TypeOfElement",
  10.115  			"propertyValue": "Command",
  10.116  			"subProperties": [
  10.117  				{
  10.118 +					"type": "GraphProperty",
  10.119  					"ID": 20,
  10.120  					"propertyName": "CommandID",
  10.121  					"propertyValue": "GabePattPush",
  10.122 @@ -125,6 +143,7 @@
  10.123  			]
  10.124  		},
  10.125  		{
  10.126 +			"type": "GraphProperty",
  10.127  			"ID": 21,
  10.128  			"propertyName": "TypeOfSyntacticStructure",
  10.129  			"propertyValue": "syntacticPatternRoot",
  10.130 @@ -133,15 +152,18 @@
  10.131  	],
  10.132  	"portsIn": [
  10.133  		{
  10.134 +			"type": "GraphPort",
  10.135  			"ID": 22,
  10.136  			"element": 18,
  10.137  			"properties": [
  10.138  				{
  10.139 +					"type": "GraphProperty",
  10.140  					"ID": 23,
  10.141  					"propertyName": "TypeOfPort",
  10.142  					"propertyValue": "dataComm",
  10.143  					"subProperties": [
  10.144  						{
  10.145 +							"type": "GraphProperty",
  10.146  							"ID": 24,
  10.147  							"propertyName": "TypeOfCommData",
  10.148  							"propertyValue": "GabePattStack",
  10.149 @@ -153,15 +175,18 @@
  10.150  			"pairedPorts": []
  10.151  		},
  10.152  		{
  10.153 +			"type": "GraphPort",
  10.154  			"ID": 25,
  10.155  			"element": 18,
  10.156  			"properties": [
  10.157  				{
  10.158 +					"type": "GraphProperty",
  10.159  					"ID": 26,
  10.160  					"propertyName": "TypeOfPort",
  10.161  					"propertyValue": "dataComm",
  10.162  					"subProperties": [
  10.163  						{
  10.164 +							"type": "GraphProperty",
  10.165  							"ID": 27,
  10.166  							"propertyName": "TypeOfCommData",
  10.167  							"propertyValue": "float",
  10.168 @@ -175,15 +200,18 @@
  10.169  	],
  10.170  	"portsOut": [
  10.171  		{
  10.172 +			"type": "GraphPort",
  10.173  			"ID": 28,
  10.174  			"element": 18,
  10.175  			"properties": [
  10.176  				{
  10.177 +					"type": "GraphProperty",
  10.178  					"ID": 29,
  10.179  					"propertyName": "TypeOfPort",
  10.180  					"propertyValue": "dataComm",
  10.181  					"subProperties": [
  10.182  						{
  10.183 +							"type": "GraphProperty",
  10.184  							"ID": 30,
  10.185  							"propertyName": "TypeOfCommData",
  10.186  							"propertyValue": "GabePattStack",
  10.187 @@ -200,17 +228,20 @@
  10.188  	"linkedElems": [],
  10.189  	"isAlreadyVisited": true
  10.190  }
  10.191 -end elem
  10.192 +separator
  10.193  {
  10.194 +	"type": "GraphElem",
  10.195  	"ID": 12,
  10.196  	"properties": [
  10.197  		{
  10.198 +			"type": "GraphProperty",
  10.199  			"ID": 13,
  10.200  			"propertyName": "TypeOfElement",
  10.201  			"propertyValue": "GabeQueryPattern",
  10.202  			"subProperties": []
  10.203  		},
  10.204  		{
  10.205 +			"type": "GraphProperty",
  10.206  			"ID": 14,
  10.207  			"propertyName": "TypeOfSyntacticStructure",
  10.208  			"propertyValue": "syntacticHierarchy",
  10.209 @@ -225,16 +256,19 @@
  10.210  	],
  10.211  	"isAlreadyVisited": true
  10.212  }
  10.213 -end elem
  10.214 +separator
  10.215  {
  10.216 +	"type": "GraphElem",
  10.217  	"ID": 44,
  10.218  	"properties": [
  10.219  		{
  10.220 +			"type": "GraphProperty",
  10.221  			"ID": 45,
  10.222  			"propertyName": "TypeOfElement",
  10.223  			"propertyValue": "Command",
  10.224  			"subProperties": [
  10.225  				{
  10.226 +					"type": "GraphProperty",
  10.227  					"ID": 46,
  10.228  					"propertyName": "CommandID",
  10.229  					"propertyValue": "GabePassThrough",
  10.230 @@ -243,6 +277,7 @@
  10.231  			]
  10.232  		},
  10.233  		{
  10.234 +			"type": "GraphProperty",
  10.235  			"ID": 47,
  10.236  			"propertyName": "TypeOfSyntacticStructure",
  10.237  			"propertyValue": "syntacticPatternRoot",
  10.238 @@ -251,15 +286,18 @@
  10.239  	],
  10.240  	"portsIn": [
  10.241  		{
  10.242 +			"type": "GraphPort",
  10.243  			"ID": 48,
  10.244  			"element": 44,
  10.245  			"properties": [
  10.246  				{
  10.247 +					"type": "GraphProperty",
  10.248  					"ID": 49,
  10.249  					"propertyName": "TypeOfPort",
  10.250  					"propertyValue": "dataComm",
  10.251  					"subProperties": [
  10.252  						{
  10.253 +							"type": "GraphProperty",
  10.254  							"ID": 50,
  10.255  							"propertyName": "TypeOfCommData",
  10.256  							"propertyValue": "GabePattStack",
  10.257 @@ -271,15 +309,18 @@
  10.258  			"pairedPorts": []
  10.259  		},
  10.260  		{
  10.261 +			"type": "GraphPort",
  10.262  			"ID": 51,
  10.263  			"element": 44,
  10.264  			"properties": [
  10.265  				{
  10.266 +					"type": "GraphProperty",
  10.267  					"ID": 52,
  10.268  					"propertyName": "TypeOfPort",
  10.269  					"propertyValue": "dataComm",
  10.270  					"subProperties": [
  10.271  						{
  10.272 +							"type": "GraphProperty",
  10.273  							"ID": 53,
  10.274  							"propertyName": "TypeOfCommData",
  10.275  							"propertyValue": "float",
  10.276 @@ -293,15 +334,18 @@
  10.277  	],
  10.278  	"portsOut": [
  10.279  		{
  10.280 +			"type": "GraphPort",
  10.281  			"ID": 54,
  10.282  			"element": 44,
  10.283  			"properties": [
  10.284  				{
  10.285 +					"type": "GraphProperty",
  10.286  					"ID": 55,
  10.287  					"propertyName": "TypeOfPort",
  10.288  					"propertyValue": "dataComm",
  10.289  					"subProperties": [
  10.290  						{
  10.291 +							"type": "GraphProperty",
  10.292  							"ID": 56,
  10.293  							"propertyName": "TypeOfCommData",
  10.294  							"propertyValue": "GabePattStack",
  10.295 @@ -313,15 +357,18 @@
  10.296  			"pairedPorts": []
  10.297  		},
  10.298  		{
  10.299 +			"type": "GraphPort",
  10.300  			"ID": 57,
  10.301  			"element": 44,
  10.302  			"properties": [
  10.303  				{
  10.304 +					"type": "GraphProperty",
  10.305  					"ID": 58,
  10.306  					"propertyName": "TypeOfPort",
  10.307  					"propertyValue": "dataComm",
  10.308  					"subProperties": [
  10.309  						{
  10.310 +							"type": "GraphProperty",
  10.311  							"ID": 59,
  10.312  							"propertyName": "TypeOfCommData",
  10.313  							"propertyValue": "float",
  10.314 @@ -336,17 +383,20 @@
  10.315  	"linkedElems": [],
  10.316  	"isAlreadyVisited": true
  10.317  }
  10.318 -end elem
  10.319 +separator
  10.320  {
  10.321 +	"type": "GraphElem",
  10.322  	"ID": 15,
  10.323  	"properties": [
  10.324  		{
  10.325 +			"type": "GraphProperty",
  10.326  			"ID": 16,
  10.327  			"propertyName": "TypeOfElement",
  10.328  			"propertyValue": "GabeReplacePattern",
  10.329  			"subProperties": []
  10.330  		},
  10.331  		{
  10.332 +			"type": "GraphProperty",
  10.333  			"ID": 17,
  10.334  			"propertyName": "TypeOfSyntacticStructure",
  10.335  			"propertyValue": "syntacticHierarchy",
  10.336 @@ -360,17 +410,20 @@
  10.337  	],
  10.338  	"isAlreadyVisited": true
  10.339  }
  10.340 -end elem
  10.341 +separator
  10.342  {
  10.343 +	"type": "GraphElem",
  10.344  	"ID": 1,
  10.345  	"properties": [
  10.346  		{
  10.347 +			"type": "GraphProperty",
  10.348  			"ID": 10,
  10.349  			"propertyName": "TypeOfElement",
  10.350  			"propertyValue": "GabeTransformRule",
  10.351  			"subProperties": []
  10.352  		},
  10.353  		{
  10.354 +			"type": "GraphProperty",
  10.355  			"ID": 11,
  10.356  			"propertyName": "TypeOfSyntacticStructure",
  10.357  			"propertyValue": "syntacticHierarchy",
  10.358 @@ -384,9 +437,11 @@
  10.359  		15
  10.360  	],
  10.361  	"viewSet": {
  10.362 +		"type": "ViewSet",
  10.363  		"ID": 4,
  10.364  		"syntaxElem": 1,
  10.365  		"rootViewBox": {
  10.366 +			"type": "ViewBox",
  10.367  			"ID": 5,
  10.368  			"shape": "<svg width=\"68\" height=\"88\"><rect x=\"1\" y=\"1\" rx=\"20\" ry=\"20\" width=\"66\" height=\"86\" style=\"fill:none;stroke:red;stroke-width:2;opacity:1\" vector-effect=\"non-scaling-stroke\">",
  10.369  			"width": 1000,
  10.370 @@ -397,6 +452,7 @@
  10.371  			"parent": 4,
  10.372  			"children": [
  10.373  				{
  10.374 +					"type": "ViewBox",
  10.375  					"ID": 6,
  10.376  					"shape": "<svg>  <text x=\"0\" y=\"9\" style=\"font-family: Arial; font-size: 11;fill:black;stroke:none\" id=\"svgText\">properties</text> </svg>",
  10.377  					"width": 49,
  10.378 @@ -413,6 +469,7 @@
  10.379  					]
  10.380  				},
  10.381  				{
  10.382 +					"type": "ViewBox",
  10.383  					"ID": 7,
  10.384  					"shape": "<svg>  <text x=\"0\" y=\"9\" style=\"font-family: Arial; font-size: 11;fill:black;stroke:none\" id=\"svgText\">portsIn</text> </svg>",
  10.385  					"width": 33,
  10.386 @@ -429,6 +486,7 @@
  10.387  					]
  10.388  				},
  10.389  				{
  10.390 +					"type": "ViewBox",
  10.391  					"ID": 8,
  10.392  					"shape": "<svg>  <text x=\"0\" y=\"9\" style=\"font-family: Arial; font-size: 11;fill:black;stroke:none\" id=\"svgText\">portsOut</text> </svg>",
  10.393  					"width": 42,
  10.394 @@ -445,6 +503,7 @@
  10.395  					]
  10.396  				},
  10.397  				{
  10.398 +					"type": "ViewBox",
  10.399  					"ID": 9,
  10.400  					"shape": "<svg>  <text x=\"0\" y=\"9\" style=\"font-family: Arial; font-size: 11;fill:black;stroke:none\" id=\"svgText\">linkedElems</text> </svg>",
  10.401  					"width": 55,
  10.402 @@ -474,4 +533,4 @@
  10.403  	},
  10.404  	"isAlreadyVisited": true
  10.405  }
  10.406 -end elem
  10.407 +separator