<%@ Page Title="Paste Upload" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" %>
<%@ Register Assembly="AjaxUploader" Namespace="AjaxUploader.Controls" TagPrefix="au" %>

<asp:Content ID="TitleContent" ContentPlaceHolderID="TitleContent" runat="server">Paste Upload - AjaxUploader v5.0 Demos</asp:Content>
<asp:Content ID="HeaderContent" ContentPlaceHolderID="HeaderTitle" runat="server">Paste Upload</asp:Content>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">

<div class="demo-card">
    <div class="demo-card-header">Paste Upload</div>
    <div class="demo-card-body">
        <p class="demo-description">
            Enable clipboard paste upload with <code>EnablePaste="true"</code>. Users can
            paste images from the clipboard (Ctrl+V / Cmd+V) directly into the upload area.
            Ideal for screenshots, copied images, and quick image sharing workflows.
        </p>

        <au:AjaxFileUpload ID="Uploader1" runat="server"
            EnablePaste="true"
            AutoUpload="true"
            ShowProgress="true"
            AllowedExtensions="jpg,jpeg,png,gif,webp,bmp"
            ButtonText="Browse or Paste (Ctrl+V)" />

        <div class="alert alert-info mt-3" style="max-width: 500px;">
            <strong>Try it:</strong> Copy an image to your clipboard (e.g., take a screenshot
            with Print Screen), then click in this area and press <kbd>Ctrl</kbd>+<kbd>V</kbd>
            to paste and upload it.
        </div>

        <div class="code-panel">
            <pre><code>&lt;%-- Server control with paste enabled --%&gt;
&lt;au:AjaxFileUpload ID="Uploader1" runat="server"
    EnablePaste="true"
    AutoUpload="true"
    ShowProgress="true"
    AllowedExtensions="jpg,jpeg,png,gif,webp,bmp"
    ButtonText="Browse or Paste (Ctrl+V)" /&gt;

&lt;%-- JavaScript API equivalent --%&gt;
AjaxUploader.create(el, {
    uploadUrl: '<%= ResolveUrl("~/ajaxupload.axd/upload") %>',
    paste: true,
    autoUpload: true,
    allowedExtensions: ['jpg','jpeg','png','gif','webp','bmp'],
    onComplete: function (file) {
        console.log('Pasted/uploaded: ' + file.name);
    }
});</code></pre>
        </div>
    </div>
</div>

</asp:Content>
