<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="CSEasyScriptSectionWizard.aspx.vb" Inherits="CSEasyScript.CSEasyScriptSectionWizard" %>
<%@ register tagprefix="ex" namespace="Exact.Web.UI.Controls" assembly="Exact.Web.UI.Controls" %>

<html>
<head>
	<meta name="save" content="history" />
	<link rel="stylesheet" type="text/css" href="Exact.css" />
	<script type="text/javascript">
        function replaceSelectedText(elementID, textToAdd)
        {
            var txtarea = document.getElementById(elementID);
            var start = txtarea.selectionStart;
            var finish = txtarea.selectionEnd;
            var allText = txtarea.value;

            //var sel = allText.substring(start, finish);
            //var newText = allText.substring(0, start) + "<center>" + sel + "</center>" + allText.substring(finish, allText.length);
            var newText = allText.substring(0, start) + textToAdd + allText.substring(finish, allText.length);

            txtarea.value = newText;
		}
        function ShowPropertyBrowser(elementID) {
			SysSet('CurrentElementID', elementID);
			$('#pPropertyBrowser').trigger('click');
		}
		function PropertySelected() {
			var propName = $('#PropertyBrowser_ref').text();
			if (propName == '')
				return;
            replaceSelectedText(SysGet('CurrentElementID'), '{{' + propName + '}}')
		}
        function AddPrimaryKeyProperty(elementID, propName) {
			replaceSelectedText(elementID, propName);
        }
    </script>
</head>
<body>
	<ep:form id="frm" runat="server">
		<ex:InputField runat="server" ID="PageID" CreateClientControl="True" Hidden="True" ValidationAs="Guid" />
		<ex:InputField runat="server" ID="MyPageMode" CreateClientControl="True" Hidden="True" ValidationAs="Int" ValidationDefault="0" />
		<ex:InputField runat="server" ID="Generate" CreateClientControl="True" Hidden="True" ValidationAs="Int" ValidationDefault="0" />
		<ex:InputField runat="server" ID="DeleteLineID" CreateClientControl="True" Hidden="True" ValidationAs="Int" ValidationDefault="0" />
		<ex:InputField runat="server" ID="AddLine" CreateClientControl="True" Hidden="True" ValidationAs="Int" ValidationDefault="0" />
		<ex:InputField runat="server" ID="CurrentElementID" CreateClientControl="True" Hidden="True" />
		<ex:InputField runat="server" ID="IsRequest" CreateClientControl="True" Hidden="True" />
		<ex:InputField runat="server" ID="IsSearch" CreateClientControl="True" Hidden="True" />
		<ex:InputField runat="server" ID="IsRequestType" CreateClientControl="True" Hidden="True" ValidationAs="Int" ValidationDefault="0" />

        <ex:CardControl runat="server" ID="Card" Action="Show" Customizable="false">

            <ex:Header runat="server" ID="hdr">
            </ex:Header>

            <ex:ButtonBar runat="server" ID="Buttons">
                <ex:Button runat="server" ID="btnOk" ButtonStyle="Save" OnClick="SysSetValue('Generate', 1); SysSubmit(1);" Caption="Generate" CaptionID="330" CaptionSuffix=":Script" CaptionSuffixID="0" />
                <ex:Button runat="server" ID="btnClose" ButtonStyle="Close" onClick="window.parent.SysCloseModalPopup();" />
				<ex:Button runat="server" ID="btnAdd" ButtonStyle="Custom" Caption="Add" CaptionID="8343" onClick="SysSetValue('AddLine', 1); SysSubmit(1);" />
            </ex:ButtonBar>

            <ex:bcerrormessages runat="server" id="errMsg" />

			<ex:cardrow runat="server" id="crPropertyBrowser">
				<ex:cardcolumn runat="server" id="ccPropertyBrowser">
					<ex:cardsection runat="server" id="csPropertyBrowser" ShowHeader="False">
			            <ex:cardfield runat="server" id="cfPropertyBrowser" ShowLabel="False">
				            <ex:BrowseField runat="server" id="PropertyBrowser" BrowserName="CSEasyScriptPropertyBrowser" OnChange="PropertySelected();" AllowEmpty="True" InputHidden="True" />
			            </ex:cardfield>
					</ex:cardsection>
				</ex:cardcolumn>
			</ex:cardrow>
              
			<ex:cardrow runat="server" id="crEasyList">
				<ex:cardcolumn runat="server" id="ccEasyList">
					<ex:cardsection runat="server" id="csEasyList" caption="Easy List" captionid="0">
			            <ex:cardfield runat="server" id="cfEasyList" caption="Easy List" captionid="0">
				            <ex:BrowseField runat="server" id="bfEasyList" BrowserName="CSEasyListWidgetEasyLists" AllowEmpty="False" InputHidden="True" />
			            </ex:cardfield>
						<ex:cardfield runat="server" id="csEasyListType" caption="Type" captionid="3801">
							<ex:combobox runat="server" id="EasyListType" validationas="int" allowempty="False" ValidationDefault="1">
								<ex:listitem caption="iframe" captionid="0" value="1" />
								<ex:listitem caption="div" captionid="0" value="2" />										
							</ex:combobox> 
						</ex:cardfield>
					</ex:cardsection>
					<ex:cardsection runat="server" id="Cardsection1" caption="Easy List" captionid="0" CaptionSuffix=":Options" CaptionSuffixID="231">
						<ex:cardfield runat="server" id="cfEasyListOptionNoHeader" caption="Verberg titel en knoppen" captionid="0">
							<ex:CheckBox runat="server" id="EasyListOptionNoHeader" />
						</ex:cardfield>
						<ex:cardfield runat="server" id="cfEasyListOptionNoTitle" caption="Verberg titel" captionid="0">
							<ex:CheckBox runat="server" id="EasyListOptionNoTitle" />
						</ex:cardfield>
						<ex:cardfield runat="server" id="cfEasyListOptionNoParam" caption="Geen parameters opvragen" captionid="0">
							<ex:CheckBox runat="server" id="EasyListOptionNoParam" />
						</ex:cardfield>
						<ex:cardfield runat="server" id="cfEasyListOptionJson" caption="Json uitvoer" captionid="0">
							<ex:CheckBox runat="server" id="EasyListOptionJson" />
						</ex:cardfield>
					</ex:cardsection>
				</ex:cardcolumn>
			</ex:cardrow>

			<ex:cardrow runat="server" id="crButtons">
				<ex:cardcolumn runat="server" id="ccButtons">
					<ex:cardsection runat="server" id="csButtonsSettings" caption="Settings" captionid="8799">
						<ex:cardfield runat="server" id="cfButtonsAlignment" caption="Alignment" captionid="33062">
							<ex:combobox runat="server" id="ButtonsAlignment" validationas="int" allowempty="False" ValidationDefault="1">
								<ex:listitem caption="Left" captionid="6122" value="1" />
								<ex:listitem caption="Right" captionid="6123" value="2" />										
							</ex:combobox> 
						</ex:cardfield>
					</ex:cardsection>
					<ex:cardsection runat="server" id="csButtons" caption="Buttons" captionid="22116">
						<ex:listview runat="server" id="lstButtons" showpagesize="false" autopostback="true" scrollbar="None" >
							<ex:listviewcolumn id="colButtonsTitle" caption="Title" captionid="10189" width="19%" />
							<ex:listviewcolumn id="colButtonsURL" caption="URL" captionid="11" width="40%" />
							<ex:listviewcolumn id="colButtonsJavaScript" caption="Javascript" captionid="0" width="40%" />
							<ex:listviewcolumn id="colButtonsActionDelete" caption="Delete" captionid="16636" width="1%" />
						</ex:listview>
					</ex:cardsection>
				</ex:cardcolumn>
			</ex:cardrow>

			<ex:cardrow runat="server" id="crMonitor">
				<ex:cardcolumn runat="server" id="ccMonitor">
					<ex:cardsection runat="server" id="csMonitor" caption="Monitor" captionid="225" CaptionSuffix=":Add" CaptionSuffixID="8343">
					</ex:cardsection>
				</ex:cardcolumn>
			</ex:cardrow>

			<ex:cardrow runat="server" id="crMonitorReplace">
				<ex:cardcolumn runat="server" id="ccMonitorReplace">
					<ex:cardsection runat="server" id="csMonitorReplace" caption="Monitor" captionid="225" CaptionSuffix=":Replace" CaptionSuffixID="23780">
						<ex:listview runat="server" id="lstMonitorReplace" showpagesize="false" autopostback="true" scrollbar="None" >
							<ex:listviewcolumn id="colMonitorReplaceID" caption="ID" captionid="0" width="19%" />
							<ex:listviewcolumn id="colMonitorReplaceURL" caption="URL" captionid="11" width="50%" />
							<ex:listviewcolumn id="colMonitorReplaceTitle" caption="Title" captionid="10189" width="30%" />
							<ex:listviewcolumn id="colMonitorReplaceActionDelete" caption="Delete" captionid="16636" width="1%" />
						</ex:listview>
					</ex:cardsection>
				</ex:cardcolumn>
			</ex:cardrow>
        </ex:CardControl>
    </ep:form>
</body>
</html>
