<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string>_Cacheable__manager_id</string> </key>
            <value> <string>http_cache</string> </value>
        </item>
        <item>
            <key> <string>__name__</string> </key>
            <value> <string>erp5_acknowledgement.js</string> </value>
        </item>
        <item>
            <key> <string>_vars</string> </key>
            <value>
              <dictionary/>
            </value>
        </item>
        <item>
            <key> <string>globals</string> </key>
            <value>
              <dictionary/>
            </value>
        </item>
        <item>
            <key> <string>raw</string> </key>
            <value> <string encoding="cdata"><![CDATA[

/*\n
Copyright (c) 2012 Nexedi SA and Contributors. All Rights Reserved.\n
\n
This program is Free Software; you can redistribute it and/or\n
modify it under the terms of the GNU General Public License\n
as published by the Free Software Foundation; either version 2\n
of the License, or (at your option) any later version.\n
\n
This program is distributed in the hope that it will be useful,\n
but WITHOUT ANY WARRANTY; without even the implied warranty of\n
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n
GNU General Public License for more details.\n
\n
You should have received a copy of the GNU General Public License\n
along with this program; if not, write to the Free Software\n
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\n
*/\n
"use strict";\n
(function (window, $) {\n
\n
  var notificationload,\n
    notificationdisplay,\n
    notificationsettimeout,\n
    notificationhide,\n
    notificationdismiss,\n
    methods;\n
\n
  notificationload = function (context) {\n
    $.ajax({\n
      url: \'AcknowledgementTool_getUserUnreadAcknowledgementJSON\',\n
      dataType: \'json\',\n
      context: context,\n
      success: function (data) {\n
        notificationhide($(this));\n
        var result = data.result;\n
        if (result.length === 0) {\n
          notificationsettimeout($(this));\n
        } else {\n
          notificationdisplay($(this), data.result[0]);\n
        }\n
      },\n
      error: function () {\n
        notificationsettimeout($(this));\n
      },\n
    });\n
  };\n
\n
  notificationdisplay = function (context, acknowledgement_json) {\n
    context\n
      .css({\n
        "width": "300px",\n
        "min-height": "5em",\n
        "z-index": "9999",\n
        "position": "fixed",\n
        "top": "1em",\n
        "left": "1em",\n
        "text-align": "center",\n
        "color": "#eee",\n
        "font-weight": "bold",\n
        "font-size": "14px",\n
        "text-shadow": "1px 1px 0 #000",\n
        "background-color": "#59bae2",\n
        "padding": "2px 11px 8px 11px",\n
        "border-radius": "15px",\n
      })\n
      .show()\n
      .html(acknowledgement_json.text_content)\n
      .append("<br/><br/><button id=\'acknowledgement_button\'>Mark as read</button>")\n
      .find("#acknowledgement_button")\n
      .attr("data-acknowledgement-url", encodeURIComponent(acknowledgement_json.acknowledge_url))\n
      .click(function () {\n
        var url = decodeURIComponent($(this).attr("data-acknowledgement-url"));\n
        notificationdismiss($(this).parent(), url);\n
        return false;\n
\n
      })\n
      ;\n
  };\n
\n
  notificationhide = function (context) {\n
    context.hide();\n
  };\n
\n
  notificationdismiss = function (context, url) {\n
    notificationhide(context);\n
    $.ajax({\n
      type: \'POST\',\n
      url: url,\n
      context: context,\n
      async: true,\n
      complete: function () {\n
        notificationload($(this));\n
      },\n
    });\n
  };\n
\n
  notificationsettimeout = function (context) {\n
    setTimeout(function () {\n
      notificationload(context);\n
    }, 600000);\n
  };\n
\n
  methods = {\n
    init: function () {\n
      notificationload($(this));\n
      return $(this);\n
    },\n
  };\n
\n
  $.fn.slaposnotification = function (method) {\n
    var result;\n
    if (methods.hasOwnProperty(method)) {\n
      result = methods[method].apply(\n
        this,\n
        Array.prototype.slice.call(arguments, 1)\n
      );\n
    } else {\n
      $.error(\'Method \' + method +\n
              \' does not exist on jQuery.slaposnotification\');\n
    }\n
    return result;\n
  };\n
}(window, jQuery));\n
\n
$(document).ready(function () {\n
  $("#acknowledgement_zone").slaposnotification("init");\n
});\n
\n


]]></string> </value>
        </item>
        <item>
            <key> <string>title</string> </key>
            <value> <string></string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
