<%@language = "javascript" %>
<% /*
    $Revision$
    $Id$

    File:           appl/fac/fac_hotnews.asp
    Description:    Invullen of wissen van 'hot news'
    Parameters:
    Context:        Manual call to check asp file consistency
    Note:           FACTAB authorization is required
*/ %>
<!--#include file="../Shared/common.inc"-->
<!--#include file="../Shared/iface.inc"-->
<%
    user.checkAutorisation("WEB_FACTAB");

    FCLTHeader.Requires({ plugins: ["jQuery"],
                               js: ["jquery-ui.js", "jquery.timepicker-table.js"], // Misschien expire tijd erbij?
                              css: ["timePicker-table.css"]})

%>
<html>
<head>
    <% FCLTHeader.Generate(); %>
    <title>Facilitor hot news</title>
    <script>
         $(function()
          {
            $('textarea').resize(function () { FcltMgr.resized(window) });
            $('textarea').autogrow();
            $('#hotnews').keyup(function () { $("#container").html((this.value||"").replace(/\n/g, "<br/>")) });
            $('#hotnews').keyup();

            FcltMgr.resized();
          });
          function submitnews(promote)
            {
                FcltMgr.confirm("Let op: dit geldt direct voor alle omgevingen!", { }, function() {
                    $.post($("form[name=fhotnews]")[0].action, $("[name=fhotnews]").serialize(), FcltCallback, "json");
                });
            }
          function clearnews(promote)
            {
                FcltMgr.confirm("Nieuwbericht wissen?", { }, function() {
                    var data = {};
                    protectRequest.dataToken(data);

                    $.post($("form[name=fhotnews]")[0].action, data, FcltCallbackRefresh, "json");
                });
            }


    </script>
</head>
<body class="editmode">
    <%
        SUBFRAME_START();
        buttons = [ { title: L("lcl_submit"), icon: "fa-fclt-save", action: "submitnews()" },
                    { title: "Wissen", icon: "fa-trash-alt", action: "clearnews()" }
                  ];
        IFRAMER_HEADER("Hot news bewerker", buttons);
    %>
    <form action="fac_hotnews_save.asp" method="post" name="fhotnews">
    <%
      BLOCK_START("headerblock", "Hot news", { "icon": "fa-newspaper", "wide": true });
        RWTEXTAREATR("hotnews", "", "", (Application("portalalert")||""), { no_bb_codes: true });
      BLOCK_END();
      IFACE.FORM_END();
%>
    </form>
    <p style='clear: both;'>

<%BLOCK_START("", L("lcl_msg_preview"), { "icon": "fa-eye", "wide": true });%>
    <div id='facforum'>
        <h5><a href="#"><%=L("lcl_forum_news").format(1)%></a></h5>
        <div id='container'><%=(Application("portalalert")||"").replace(/\n/g, "<br/>")%></div>
    </div>
    <h2>Voorbeeld tekst</h2><button onclick='$("#hotnews").val($("#sample").html()).keyup()'>Invullen</button>
    <xmp id='sample'>Vanavond wordt uw Facilitor omgeving bijgewerkt naar versie XXXX.X.
U kunt gewoon doorwerken, er wordt geen downtime verwacht.
Meer informatie is te vinden op het <a href='http://forum.facilitor.nl' target='_blank'>Facilitor Forum</a>.</xmp>
<% BLOCK_END();
SUBFRAME_END(); %>
</body>
</html><% ASPPAGE_END(); %>
