<?xml version="1.0" encoding="utf-8"?>
<Application>
	<AppTitle>Untitled Application</AppTitle>
	<DesignDeviceName>Apple iPhone 6</DesignDeviceName>
	<VariablesScanned>False</VariablesScanned>
	<PageWidth>667</PageWidth>
	<PageHeight>375</PageHeight>
	<AutoSizeWidth>False</AutoSizeWidth>
	<AutoSizeHeight>False</AutoSizeHeight>
	<HideScrollbars>False</HideScrollbars>
	<PublishPlatform>WebApp</PublishPlatform>
	<EmptyBuildFolder>False</EmptyBuildFolder>
	<LanguageCode>en</LanguageCode>
	<MobileOSTypes>[AndroidOS,iOS,WindowsPhoneOS]</MobileOSTypes>
	<WindowState>normal</WindowState>
	<TitleBar>True</TitleBar>
	<Sizeable>True</Sizeable>
	<MaximizeBtn>False</MaximizeBtn>
	<MinimizeBtn>True</MinimizeBtn>
	<SystemMenu>True</SystemMenu>
	<ContextMenu>False</ContextMenu>
	<AlwaysOnTop>False</AlwaysOnTop>
	<ShowInTaskbar>True</ShowInTaskbar>
	<SingleInstance>False</SingleInstance>
	<ChromeKioskMode>False</ChromeKioskMode>
	<Components>
		<FunctionList name="Subroutines">
			<Components>
				<Function name="updateModifications">
					<Code>if (savehistory === true) {
        $App.myjson = JSON.stringify(window[&quot;Canvas&quot;+$App.containerId]);
        $App.state.push($App.myjson);
}</Code>
					<Params>savehistory|BOOLEAN|Save history</Params>
					<ScriptLanguage>JavaScript</ScriptLanguage>
				</Function>
				<Function name="undo">
					<Code>if ($App.mods &lt; $App.state.length) {
        window[&quot;Canvas&quot;+$App.containerId].clear().renderAll();
        window[&quot;Canvas&quot;+$App.containerId].loadFromJSON($App.state[$App.state.length - 1 - $App.mods - 1]);
        window[&quot;Canvas&quot;+$App.containerId].renderAll();
        //console.log(&quot;geladen &quot; + ($App.state.length-1-mods-1));
        //console.log(&quot;state &quot; + $App.state.length);
        $App.mods += 1;
        //console.log(&quot;mods &quot; + $App.mods);
}</Code>
					<ScriptLanguage>JavaScript</ScriptLanguage>
				</Function>
				<Function name="redo">
					<Code>if ($App.mods &gt; 0) {
        window[&quot;Canvas&quot;+$App.containerId].clear().renderAll();
        window[&quot;Canvas&quot;+$App.containerId].loadFromJSON($App.state[$App.state.length - 1 - $App.mods + 1]);
        window[&quot;Canvas&quot;+$App.containerId].renderAll();
        //console.log(&quot;geladen &quot; + ($App.state.length-1-$App.mods+1));
        $App.mods -= 1;
        //console.log(&quot;state &quot; + $App.state.length);
        //console.log(&quot;mods &quot; + $App.mods);
}</Code>
					<ScriptLanguage>JavaScript</ScriptLanguage>
				</Function>
				<Function name="clearcan">
					<Code>window[&quot;Canvas&quot;+$App.containerId].clear().renderAll();
$App.newleft = 0;</Code>
					<ScriptLanguage>JavaScript</ScriptLanguage>
				</Function>
			</Components>
		</FunctionList>
		<LibraryList name="Libraries"/>
		<PageList name="Main">
			<Components>
				<Page id="NewPage">
					<pageenter>fabInitialize &quot;Container1&quot;
BeginJS
$App.containerId=&quot;Container1&quot;;
window[&quot;Canvas&quot;+$App.containerId].counter = 0;
window[&quot;Canvas&quot;+$App.containerId].selection = false;
$App.state = [];
$App.mods = 0;
window[&quot;Canvas&quot;+$App.containerId].on(
    &apos;object:modified&apos;, function () {
    $scope.updateModifications(true);
},
    &apos;object:added&apos;, function () {
     $scope.updateModifications(true);
});
EndJS</pageenter>
					<Components>
						<Container id="Container1">
							<left>192px</left>
							<top>16px</top>
							<width>456px</width>
							<height>344px</height>
							<style>border-width:1px;border-style:solid;background-color:#fff;</style>
						</Container>
						<PushButton id="PushButton1">
							<left>16px</left>
							<top>16px</top>
							<width>160px</width>
							<height>56px</height>
							<caption>Add Rect</caption>
							<click>RandomEx 10 400 [x]
RandomEx 10 250 [y]
Random 255 [r]
Random 255 [g]
Random 255 [b]
SetVar [color] &quot;rgb([r],[g],[b])&quot;
fabNewRect &quot;Container1&quot; &quot;&quot; [x] [y] 60 60 &quot;[color]&quot;
updateModifications true
BeginJS
  window[&quot;Canvas&quot;+$App.containerId].counter++;
EndJS
</click>
						</PushButton>
						<PushButton id="PushButton2">
							<left>16px</left>
							<top>80px</top>
							<width>160px</width>
							<height>56px</height>
							<caption>Undo</caption>
							<click>undo</click>
						</PushButton>
						<PushButton id="PushButton3">
							<left>16px</left>
							<top>144px</top>
							<width>160px</width>
							<height>56px</height>
							<caption>Redo</caption>
							<click>redo</click>
						</PushButton>
						<PushButton id="PushButton4">
							<left>16px</left>
							<top>208px</top>
							<width>160px</width>
							<height>56px</height>
							<caption>Clear</caption>
							<click>clearcan</click>
						</PushButton>
					</Components>
				</Page>
			</Components>
		</PageList>
		<PageList name="Master">
			<Components>
				<Page id="MasterPage"/>
			</Components>
		</PageList>
		<PageList name="Dialog">
			<Components>
				<Page id="NewDialog">
					<Components>
						<DialogContainer id="DialogContainer1">
							<left>0px</left>
							<top>0px</top>
							<width>667px</width>
							<height>375px</height>
							<close_button>False</close_button>
						</DialogContainer>
					</Components>
				</Page>
			</Components>
		</PageList>
	</Components>
</Application>
