Вход Регистрация
Файл: themes/classic/js/jQuery-File-Upload/basic-plus.html
Строк: 288
<?php
<!DOCTYPE HTML>
<!--
/*
 * jQuery File Upload Plugin Basic Plus Demo 1.0
 * https://github.com/blueimp/jQuery-File-Upload
 *
 * Copyright 2013, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * http://www.opensource.org/licenses/MIT
 */
-->
<
html lang="en">
<
head>
<!-- 
Force latest IE rendering engine or ChromeFrame if installed -->
<!--[if 
IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]-->
<
meta charset="utf-8">
<
title>jQuery File Upload Demo Basic Plus version</title>
<
meta name="description" content="File Upload widget with multiple file selection, drag&amp;drop support, progress bar, validation and preview images for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.">
<
meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- 
Bootstrap CSS Toolkit styles -->
<
link rel="stylesheet" href="http://blueimp.github.com/cdn/css/bootstrap.min.css">
<!-- 
Generic page styles -->
<
link rel="stylesheet" href="css/style.css">
<!-- 
Bootstrap styles for responsive website layoutsupporting different screen sizes -->
<
link rel="stylesheet" href="http://blueimp.github.com/cdn/css/bootstrap-responsive.min.css">
<!-- 
Bootstrap CSS fixes for IE6 -->
<!--[if 
lt IE 7]><link rel="stylesheet" href="http://blueimp.github.com/cdn/css/bootstrap-ie6.min.css"><![endif]-->
<!-- 
CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<
link rel="stylesheet" href="css/jquery.fileupload-ui.css">
</
head>
<
body>
<
div class="navbar navbar-fixed-top">
    <
div class="navbar-inner">
        <
div class="container">
            <
class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                <
span class="icon-bar"></span>
                <
span class="icon-bar"></span>
                <
span class="icon-bar"></span>
            </
a>
            <
class="brand" href="https://github.com/blueimp/jQuery-File-Upload">jQuery File Upload</a>
            <
div class="nav-collapse">
                <
ul class="nav">
                    <
li class="active"><a href="http://blueimp.github.com/jQuery-File-Upload/">Demo</a></li>
                    <
li><a href="https://github.com/blueimp/jQuery-File-Upload#download">Download</a></li>
                    <
li><a href="https://github.com/blueimp/jQuery-File-Upload">Source Code</a></li>
                    <
li><a href="https://github.com/blueimp/jQuery-File-Upload/wiki">Documentation</a></li>
                    <
li><a href="https://github.com/blueimp/jQuery-File-Upload#support">Support</a></li>
                    <
li><a href="https://blueimp.net">&copySebastian Tschan</a></li>
                </
ul>
            </
div>
        </
div>
    </
div>
</
div>
<
div class="container">
    <
div class="page-header">
        <
h1>jQuery File Upload Demo</h1>
        <
h2 class="lead">Basic Plus version</h2>
        <
ul class="nav nav-tabs">
            <
li><a href="basic.html">Basic</a></li>
            <
li class="active"><a href="basic-plus.html">Basic Plus</a></li>
            <
li><a href="index.html">Basic Plus UI</a></li>
            <
li><a href="angularjs.html">AngularJS</a></li>
        </
ul>
        <
blockquote>
            <
p>File Upload widget with multiple file selectiondrag&amp;drop supportprogress barvalidation and preview images for jQuery.<br>
            
Supports cross-domainchunked and resumable file uploads and client-side image resizing.<br>
            
Works with any server-side platform (PHPPythonRuby on RailsJavaNode.jsGo etc.) that supports standard HTML form file uploads.</p>
        </
blockquote>
    </
div>
    <!-- 
The fileinput-button span is used to style the file input field as button -->
    <
span class="btn btn-success fileinput-button">
        <
class="icon-plus icon-white"></i>
        <
span>Add files...</span>
        <!-- 
The file input field used as target for the file upload widget -->
        <
input id="fileupload" type="file" name="files[]" multiple>
    </
span>
    <
br>
    <
br>
    <!-- 
The global progress bar -->
    <
div id="progress" class="progress progress-success progress-striped">
        <
div class="bar"></div>
    </
div>
    <!-- 
The container for the uploaded files -->
    <
div id="files"></div>
    <
br>
    <
div class="well">
        <
h3>Demo Notes</h3>
        <
ul>
            <
li>The maximum file size for uploads in this demo is <strong>5 MB</strong> (default file size is unlimited).</li>
            <
li>Only image files (<strong>JPGGIFPNG</strong>) are allowed in this demo (by default there is no file type restriction).</li>
            <
li>Uploaded files will be deleted automatically after <strong>5 minutes</strong> (demo setting).</li>
            <
li>You can <strong>drag &ampdrop</strongfiles from your desktop on this webpage with Google ChromeMozilla Firefox and Apple Safari.</li>
            <
li>Please refer to the <a href="https://github.com/blueimp/jQuery-File-Upload">project website</a> and <a href="https://github.com/blueimp/jQuery-File-Upload/wiki">documentation</a> for more information.</li>
            <
li>Built with Twitter's <a href="http://twitter.github.com/bootstrap/">Bootstrap</a> toolkit and Icons from <a href="http://glyphicons.com/">Glyphicons</a>.</li>
        </ul>
    </div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
<script src="js/vendor/jquery.ui.widget.js"></script>
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
<script src="http://blueimp.github.com/JavaScript-Load-Image/load-image.min.js"></script>
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
<script src="http://blueimp.github.com/JavaScript-Canvas-to-Blob/canvas-to-blob.min.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="js/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<script src="js/jquery.fileupload.js"></script>
<!-- The File Upload processing plugin -->
<script src="js/jquery.fileupload-process.js"></script>
<!-- The File Upload image resize plugin -->
<script src="js/jquery.fileupload-resize.js"></script>
<!-- The File Upload validation plugin -->
<script src="js/jquery.fileupload-validate.js"></script>
<script>
/*jslint unparam: true */
/*global window, $ */
$(function () {
    '
use strict';
    // Change this to the location of your server-side upload handler:
    var url = (window.location.hostname === '
blueimp.github.com' ||
                window.location.hostname === '
blueimp.github.io') ?
                '
//jquery-file-upload.appspot.com/' : 'server/php/',
        
uploadButton = $('<button/>')
            .
addClass('btn')
            .
prop('disabled'true)
            .
text('Processing...')
            .
on('click', function () {
                var 
$this = $(this),
                    
data $this.data();
                
$this
                    
.off('click')
                    .
text('Abort')
                    .
on('click', function () {
                        
$this.remove();
                        
data.abort();
                    });
                
data.submit().always(function () {
                    
$this.remove();
                });
            });
    $(
'#fileupload').fileupload({
        
urlurl,
        
dataType'json',
        
autoUploadfalse,
        
acceptFileTypes: /(.|/)(gif|jpe?g|png)$/i,
        
maxFileSize5000000// 5 MB
        
loadImageMaxFileSize15000000// 15MB
        
disableImageResizefalse,
        
previewMaxWidth100,
        
previewMaxHeight100,
        
previewCroptrue
    
}).on('fileuploadadd', function (edata) {
        
data.context = $('<div/>').appendTo('#files');
        $.
each(data.files, function (indexfile) {
            var 
node = $('<p/>')
                    .
append($('<span/>').text(file.name));
            if (!
index) {
                
node
                    
.append('<br>')
                    .
append(uploadButton.clone(true).data(data));
            }
            
node.appendTo(data.context);
        });
    }).
on('fileuploadprocessalways', function (edata) {
        var 
index data.index,
            
file data.files[index],
            
node = $(data.context.children()[index]);
        if (
file.preview) {
            
node
                
.prepend('<br>')
                .
prepend(file.preview);
        }
        if (
file.error) {
            
node
                
.append('<br>')
                .
append(file.error);
        }
        if (
index === data.files.length) {
            
data.context.find('button')
                .
text('Upload')
                .
prop('disabled', !!data.files.error);
        }
    }).
on('fileuploadprogressall', function (edata) {
        var 
progress parseInt(data.loaded data.total 10010);
        $(
'#progress .bar').css(
            
'width',
            
progress '%'
        
);
    }).
on('fileuploaddone', function (edata) {
        $.
each(data.result.files, function (indexfile) {
            var 
link = $('<a>')
                .
attr('target''_blank')
                .
prop('href'file.url);
            $(
data.context.children()[index])
                .
wrap(link);
        });
    }).
on('fileuploadfail', function (edata) {
        $.
each(data.result.files, function (indexfile) {
            var 
error = $('<span/>').text(file.error);
            $(
data.context.children()[index])
                .
append('<br>')
                .
append(error);
        });
    });
});
</
script>
</
body
</
html>
?>
Онлайн: 2
Реклама