<%@ Page Language="C#" MasterPageFile="Posts.Master"  AutoEventWireup="true" CodeBehind="Edit.aspx.cs" Inherits="EnjooSite.Web.Admin.Posts.Edit" Title="EnjooSite Admin - Edit Posts" %>
<%@ Import Namespace="EnjooSite.Web.UI" %>
<%@ Register TagPrefix="st" TagName="EntryEditor" Src="~/Admin/UserControls/EntryEditor.ascx" %>

<asp:Content ID="HeadContent" ContentPlaceHolderID="ContentPlaceHoder_Head" runat="server">
    <script type="text/javascript" src="<%= VirtualPathUtility.ToAbsolute("~/Common/Scripts/jQueryUI/jquery-ui-sortable_dialog-1.5.3.packed.js") %>" ></script>
    <script type="text/javascript" src="<%= VirtualPathUtility.ToAbsolute("~/Scripts/My97DatePicker/WdatePicker.js") %>" ></script>  
    <script type="text/javascript" src="<%= VirtualPathUtility.ToAbsolute("~/Scripts/jQuery/jTemplates/jquery-jtemplates-0.7.5.js") %>" ></script>  
    <script type="text/javascript" src="<%= UrlHelper.AdminUrl+ "/Services/Ajax/PostEditService.ashx?proxy" %>"></script>  
    <script type="text/javascript">
        $(function(e) {

            //alert(Page_Validators[5].errormessage);
            //Array.remove(Page_Validators, Page_Validators[5]);
            //            $(document).click(function(e) {
            //                if (typeof (Page_ClientValidate) == "function") {
            //                    alert(Page_ClientValidate());
            //                }
            //                alert(eval(Page_Validators[5].evaluationfunction)(Page_Validators[5]));
            //            });
            //alert($("#ctl00_ctl00_pageContent_postsContent_Editor_richTextEditor_richTextEditor___Frame").height());
        });
    </script>
</asp:Content>

<asp:Content ID="LocationContent" ContentPlaceHolderID="ContentLocationContentPlace" runat="server">
    <ul class="vList clearfix">
        <li>
            <b><%= UIText.GetSafeText("Label_Location_Text")%></b>
        </li>
        <li>
            <a href='<%= UrlHelper.GetAdminCenterUrl() %>' title='<%= UIText.GetSafeText("Label_AdminCenter_Text") %>'><span><%= UIText.GetSafeText("Label_AdminCenter_Text") %></span></a>
        </li>
        <li class="vSeparate">
            <span>»</span>
        </li>
        <li>
            <a class="postManager" href='<%= UrlHelper.GetPostsManagerUrl() %>' title="<%= UIText.GetSafeText("Label_PostsManager_Text") %>"><span><%= UIText.GetSafeText("Label_PostsManager_Text") %></span></a>
        </li>
        <li class="vSeparate">
            <span>»</span>
        </li>
        <li>
            <label><%= UIText.GetSafeText("Label_AddPost_Text")%></label>
        </li>
    </ul>
</asp:Content>

<asp:Content ID="ActionsContent" ContentPlaceHolderID="ContentActionsContentPlace" runat="server">
    <ul class="vList clearfix menuButtons">
        <li>
            <a href="#" title='<%= UIText.GetSafeText("Button_Save_Text") %>' id="savePostLink" class="save">
                <span><%= UIText.GetSafeText("Button_Save_Text") %></span>
            </a>
        </li>
        <li>
            <a href="#" title='<%= UIText.GetSafeText("Button_Save_Text") %>' id="fitWindowLink" class="fitWindow">
                <span><%= UIText.GetSafeText("Button_FitWindow_Text") %></span>
            </a>
        </li>
    </ul>
    <script type="text/javascript">
        $(function(e) {
            $("#savePostLink").click(function(e) {
                $(String.format("#{0}_lkbPost", '<%= Editor.ClientID %>')).trigger("click"); return false;
            });
            $("#fitWindowLink").click(function(e) {
                var oEditor = FCKeditorAPI.GetInstance("ctl00_ctl00_pageContent_postsContent_Editor_richTextEditor_richTextEditor");
                oEditor.Commands.GetCommand('FitWindow').Execute();
                return false;
            });
        });
    </script>
</asp:Content>

<asp:Content ID="content" ContentPlaceHolderID="postsContent" runat="server">
    <div class="hSpace_10"></div>
    <st:EntryEditor id="Editor" CategoryType="PostCollection" EntryType="BlogPost" ResultsTitle="Posts" runat="server" />
</asp:Content>
