<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
	
	<Frame name="wbSpamBlocker_Options" inherits="WIM_PluginOptionFrame">
		<Frames>
			<CheckButton>
				<Size>
					<AbsDimension x="25" y="25" />
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="0" y="0" />
						</Offset>
					</Anchor>
				</Anchors>
				<NormalTexture file="Interface\Buttons\UI-CheckBox-Up" />
				<PushedTexture file="Interface\Buttons\UI-CheckBox-Down" />
				<HighlightTexture file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD" />
				<CheckedTexture file="Interface\Buttons\UI-CheckBox-Check" />
				<Layers>
					<Layer level="OVERLAY">
						<FontString name="$parentText" inherits="GameFontNormal" text="Enable Plugin">
							<Anchors>
								<Anchor point="LEFT">
									<Offset>
										<AbsDimension x="30" y="1" />
									</Offset>
								</Anchor>
							</Anchors>
							<FontHeight>
								<AbsValue val="12" />
							</FontHeight>
							<Color r="1" g="0.8196079" b="0" />
							<Shadow>
							<Color r="0" g="0" b="0" />
								<Offset>
									<AbsDimension x="1" y="-1" />
								</Offset>
							</Shadow>
						</FontString>
					</Layer>
				</Layers>
				<Scripts>
					<OnShow>
						if(wpSpamBlocker_Data) then
							this:SetChecked(wpSpamBlocker_Data.enabled);
						end
					</OnShow>
					<OnClick>
						if ( this:GetChecked() ) then
							PlaySound("igMainMenuOptionCheckBoxOff");
							wpSpamBlocker_Data.enabled = true;
						else
							PlaySound("igMainMenuOptionCheckBoxOn");
							wpSpamBlocker_Data.enabled = false;
						end
					</OnClick>
				</Scripts>
			</CheckButton>
			<Slider name="wpSpamBlocker_LevelSlider" inherits="WIM_Options_SliderTemplate" minValue="1" maxValue="70" valueStep="1">
					<Size>
						<AbsDimension x="325" y="17"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="0" y="-50" />
							</Offset>
						</Anchor>
					</Anchors>
					<Scripts>
						<OnValueChanged>
							wpSpamBlocker_Data.blockLevel = this:GetValue();
							getglobal(this:GetName().."EditBox"):SetText(this:GetValue());
						</OnValueChanged>
				</Scripts>
			</Slider>
			<Frame name="$parentStats" inherits="WIM_Options_PanelTemplate">
				<Size>
					<AbsDimension x="370" y="30" />
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="0" y="-200" />
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer>
						<FontString name="$parentText" inherits="GameFontNormal" justifyH="CENTER" text="Statistics">
							<Size>
								<AbsDimension x="360" y="14"/>
							</Size>
							<Anchors>
								<Anchor point="CENTER">
									<Offset>
										<AbsDimension x="0" y="0"/>
									</Offset>
								</Anchor>
							</Anchors>
							<FontHeight>
								<AbsValue val="8" />
							</FontHeight>
							<Color r="1" g="0.8" b="0" />
						</FontString>
					</Layer>
				</Layers>
			</Frame>
			<CheckButton>
				<Size>
					<AbsDimension x="25" y="25" />
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="25" y="-85" />
						</Offset>
					</Anchor>
				</Anchors>
				<NormalTexture file="Interface\Buttons\UI-CheckBox-Up" />
				<PushedTexture file="Interface\Buttons\UI-CheckBox-Down" />
				<HighlightTexture file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD" />
				<CheckedTexture file="Interface\Buttons\UI-CheckBox-Check" />
				<Layers>
					<Layer level="OVERLAY">
						<FontString name="$parentText" inherits="GameFontNormal" text="Allow positive confirmation.">
							<Anchors>
								<Anchor point="LEFT">
									<Offset>
										<AbsDimension x="30" y="1" />
									</Offset>
								</Anchor>
							</Anchors>
							<FontHeight>
								<AbsValue val="12" />
							</FontHeight>
							<Color r="1" g="0.8196079" b="0" />
							<Shadow>
							<Color r="0" g="0" b="0" />
								<Offset>
									<AbsDimension x="1" y="-1" />
								</Offset>
							</Shadow>
						</FontString>
					</Layer>
				</Layers>
				<Scripts>
					<OnShow>
						if(wpSpamBlocker_Data) then
							this:SetChecked(wpSpamBlocker_Data.confirmation);
						end
					</OnShow>
					<OnClick>
						if ( this:GetChecked() ) then
							PlaySound("igMainMenuOptionCheckBoxOff");
							wpSpamBlocker_Data.confirmation = true;
						else
							PlaySound("igMainMenuOptionCheckBoxOn");
							wpSpamBlocker_Data.confirmation = false;
						end
					</OnClick>
				</Scripts>
			</CheckButton>
			<CheckButton>
				<Size>
					<AbsDimension x="25" y="25" />
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="25" y="-110" />
						</Offset>
					</Anchor>
				</Anchors>
				<NormalTexture file="Interface\Buttons\UI-CheckBox-Up" />
				<PushedTexture file="Interface\Buttons\UI-CheckBox-Down" />
				<HighlightTexture file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD" />
				<CheckedTexture file="Interface\Buttons\UI-CheckBox-Check" />
				<Layers>
					<Layer level="OVERLAY">
						<FontString name="$parentText" inherits="GameFontNormal" text="Notify me when spam is blocked.">
							<Anchors>
								<Anchor point="LEFT">
									<Offset>
										<AbsDimension x="30" y="1" />
									</Offset>
								</Anchor>
							</Anchors>
							<FontHeight>
								<AbsValue val="12" />
							</FontHeight>
							<Color r="1" g="0.8196079" b="0" />
							<Shadow>
							<Color r="0" g="0" b="0" />
								<Offset>
									<AbsDimension x="1" y="-1" />
								</Offset>
							</Shadow>
						</FontString>
					</Layer>
				</Layers>
				<Scripts>
					<OnShow>
						if(wpSpamBlocker_Data) then
							this:SetChecked(wpSpamBlocker_Data.notify);
						end
					</OnShow>
					<OnClick>
						if ( this:GetChecked() ) then
							PlaySound("igMainMenuOptionCheckBoxOff");
							wpSpamBlocker_Data.notify = true;
						else
							PlaySound("igMainMenuOptionCheckBoxOn");
							wpSpamBlocker_Data.notify = false;
						end
					</OnClick>
				</Scripts>
			</CheckButton>
			<CheckButton>
				<Size>
					<AbsDimension x="25" y="25" />
				</Size>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset>
							<AbsDimension x="25" y="-135" />
						</Offset>
					</Anchor>
				</Anchors>
				<NormalTexture file="Interface\Buttons\UI-CheckBox-Up" />
				<PushedTexture file="Interface\Buttons\UI-CheckBox-Down" />
				<HighlightTexture file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD" />
				<CheckedTexture file="Interface\Buttons\UI-CheckBox-Check" />
				<Layers>
					<Layer level="OVERLAY">
						<FontString name="$parentText" inherits="GameFontNormal" text="Save white list between sessions.">
							<Anchors>
								<Anchor point="LEFT">
									<Offset>
										<AbsDimension x="30" y="1" />
									</Offset>
								</Anchor>
							</Anchors>
							<FontHeight>
								<AbsValue val="12" />
							</FontHeight>
							<Color r="1" g="0.8196079" b="0" />
							<Shadow>
							<Color r="0" g="0" b="0" />
								<Offset>
									<AbsDimension x="1" y="-1" />
								</Offset>
							</Shadow>
						</FontString>
					</Layer>
				</Layers>
				<Scripts>
					<OnShow>
						if(wpSpamBlocker_Data) then
							this:SetChecked(wpSpamBlocker_Data.saveWhiteList);
						end
					</OnShow>
					<OnClick>
						if ( this:GetChecked() ) then
							PlaySound("igMainMenuOptionCheckBoxOff");
							wpSpamBlocker_Data.saveWhiteList = true;
						else
							PlaySound("igMainMenuOptionCheckBoxOn");
							wpSpamBlocker_Data.saveWhiteList = false;
						end
					</OnClick>
				</Scripts>
			</CheckButton>
			
		</Frames>
		<Scripts>
			<OnShow>
				local BlockedUsers = 0;
				local BlockedMessages = 0;
				if(wpSpamBlocker_Blocked) then
					for key,_ in pairs(wpSpamBlocker_Blocked) do
						BlockedUsers = BlockedUsers + 1;
						BlockedMessages = BlockedMessages + wpSpamBlocker_Blocked[key];
					end
				end
				wbSpamBlocker_OptionsStatsText:SetText("Spammers Blocked: |cffffffff"..BlockedUsers.."|r      Messages Blocked: |cffffffff"..BlockedMessages.."|r");
			</OnShow>
		</Scripts>
	</Frame>

	<Frame name="wbSpamBlocker_Options_OtherLoaded" inherits="WIM_PluginOptionFrame">
		<Layers>
			<Layer level="OVERLAY">
				<FontString name="$parentText" inherits="GameFontNormal" justifyH="LEFT">
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="0" y="0" />
							</Offset>
						</Anchor>
					</Anchors>
					<FontHeight>
						<AbsValue val="12" />
					</FontHeight>
					<Color r="1" g="1" b="1" />
					<Shadow>
						<Color r="0" g="0" b="0" />
						<Offset>
							<AbsDimension x="1" y="-1" />
						</Offset>
					</Shadow>
				</FontString>
			</Layer>
		</Layers>
	</Frame>

	<Frame name="wpSpamBlocker_Core"> 
		<Scripts> 
			<OnLoad> 
				wpSpamBlocker_OnLoad();
				this:RegisterEvent("VARIABLES_LOADED");
				this:RegisterEvent("ADDON_LOADED");
				wpSpamBlocker_LevelSliderTitle:SetText("Level threshold to block:");
			</OnLoad> 
			<OnEvent>
				if(event == "VARIABLES_LOADED") then
					-- handle the loading and setting of plugin's options.
					if(wpSpamBlocker_Blocked == nil) then wpSpamBlocker_Blocked = {}; end
					if(wpSpamBlocker_WhiteList == nil) then wpSpamBlocker_WhiteList = {}; end
					if(wpSpamBlocker_Data == nil) then
						wpSpamBlocker_Data = wpSpamBlocker_Data_DEFAULT;
					end
					if(wpSpamBlocker_Data.notify == nil) then wpSpamBlocker_Data.notify = wpSpamBlocker_Data_DEFAULT.notify; end
					if(wpSpamBlocker_Data.confirmation == nil) then wpSpamBlocker_Data.confirmation = wpSpamBlocker_Data_DEFAULT.confirmation; end
					if(wpSpamBlocker_Data.saveWhiteList == nil) then wpSpamBlocker_Data.saveWhiteList = wpSpamBlocker_Data_DEFAULT.saveWhiteList; end
					wpSpamBlocker_LevelSlider:SetValue(wpSpamBlocker_Data.blockLevel);
					if(not wpSpamBlocker_Data.saveWhiteList) then wpSpamBlocker_WhiteList = {}; end
					wpSpamBlocker_CheckAddonLoaded();
				elseif(event == "ADDON_LOADED") then
					wpSpamBlocker_CheckAddonLoaded();
				end
			</OnEvent>
		</Scripts> 
	</Frame> 
	
</Ui>