Edit D:\AVAWeike\AVAWeike\AVA.ResourcesPlatform.WebUI\Tools\UploadCut.aspx
??<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="UploadCut.aspx.cs" Inherits="AVA.ResourcesPlatform.WebUI.Tools.UploadCut" %> <!doctype html > <%-- %><html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title></title> <style> body{ margin:0 auto; text-align:center; } .jcrop-holder{ margin: 0 auto; } </style> <link rel="stylesheet" href="<%= Request.WebPath()+"/Tools/Jcrop/css/jquery.Jcrop.css"%>" type="text/css" /> <script type="text/javascript" src='<%= Request.WebPath()+"/Tools/jQuery-File-Upload/js/vendor/jquery.11.min.js" %>'></script> <script type="text/javascript" src='<%= Request.WebPath()+"/Tools/Jcrop/js/jquery.Jcrop.js"%>'></script> <script type="text/javascript"> jQuery(function($){ var src = "<%= this._ImgSrc %>", jcrop_api, coordinates, width,height; $("#target").hide() .one('load', function() { $("#target").fadeIn(); var image = document.getElementById("target"); width = image.naturalWidth , height = image.naturalHeight ; initJcrop(); }) .attr('src', src) .each(function() { //Cache fix for browsers that don't trigger .load() if(this.complete) $(this).trigger('load'); }); // The function is pretty simple function initJcrop() { var boxH = parseInt(<%= this._Height %>)+350; var aspectR = <%= this._Width %>/<%= this._Height %> == 1 ? 1: 16/9 $('#target').Jcrop({ boxHeight: boxH, allowSelect: false, allowResize: false, keySupport: false, trueSize: [width,height] , aspectRatio: aspectR, onSelect:function(coords){ coordinates = coords; }, onChange:function(coords){ //console.log(coords); //if(coords.w != NaN && coords.y != NaN && coords.x != NaN && coords.h != NaN){ coordinates = coords; //} }, onRelease: releaseCheck },function(){ jcrop_api = this; //jcrop_api.setOptions( { trueSize: [width,height] }); // jcrop_api.setOptions( { aspectRatio: 16/9 }); jcrop_api.animateTo([0,0,<%= this._Width %>,<%= this._Height %>]); }); }; $('#finish').click(function(e){ if(coordinates){ var rUrl = "<%= Request.Url.ToString() %>"; rUrl =removeParams(rUrl, "width"); rUrl =removeParams(rUrl, "height"); //var zoom = $('#target').height() / parseInt("<%= this._Height %>"); var zoom = 1; window.location.href = rUrl+"&zoom="+zoom+"&left="+parseInt(coordinates.x)+"&top="+parseInt(coordinates.y)+ "&width="+parseInt(coordinates.w)+"&height="+parseInt(coordinates.h); } }); function removeParams(url,name){ return url.replace(new RegExp("[\\?&]"+name+"=([^&#]*)"),""); } function releaseCheck() { jcrop_api.setOptions({ allowSelect: true }); $('#can_click').attr('checked',false); }; }); </script> </head> <body> <div style="overflow:auto; height:<%= this._Height + 220 %>px; width:<%= this._Width + 230 %>px;"> <img src="" id="target" height="<%= this._Height + 350 %>"/> </div> <div style="position:fixed;margin-bottom:5px; bottom:0; width:100%;background:#fff"> <button id="finish" class="btn btn-mini" style="">???</button> </div> --%> <%-- <span class="requiresjcrop"> <button id="setSelect" class="btn btn-mini">setSelect</button> <button id="animateTo" class="btn btn-mini">animateTo</button> <button id="release" class="btn btn-mini">Release</button> <button id="disable" class="btn btn-mini">Disable</button> <button id="finish" class="btn btn-mini">Finish</button> </span> <button id="enable" class="btn btn-mini" style="display:none;">Re-Enable</button> <button id="unhook" class="btn btn-mini">Destroy!</button> <button id="rehook" class="btn btn-mini" style="display:none;">Attach Jcrop</button> </div> <fieldset class="optdual requiresjcrop"> <legend>Option Toggles</legend> <div class="optlist offset"> <label><input type="checkbox" id="ar_lock" />Aspect ratio</label> <label><input type="checkbox" id="size_lock" />minSize/maxSize setting</label> </div> <div class="optlist"> <label><input type="checkbox" id="can_click" />Allow new selections</label> <label><input type="checkbox" id="can_move" />Selection can be moved</label> <label><input type="checkbox" id="can_size" />Resizable selection</label> </div> </fieldset> <scrtip> // Hide any interface elements that require Jcrop // (This is for the local user interface portion.) $('.requiresjcrop').hide(); // This function is bound to the onRelease handler... // In certain circumstances (such as if you set minSize // and aspectRatio together), you can inadvertently lose // the selection. This callback re-enables creating selections // in such a case. Although the need to do this is based on a // buggy behavior, it's recommended that you in some way trap // the onRelease callback if you use allowSelect: false function releaseCheck() { jcrop_api.setOptions({ allowSelect: true }); $('#can_click').attr('checked',false); }; // Setup and dipslay the interface for "enabled" $('#can_click,#can_move,#can_size').attr('checked','checked'); $('#ar_lock,#size_lock,#bg_swap').attr('checked',false); $('.requiresjcrop').show(); // Use the API to find cropping dimensions // Then generate a random selection // This function is used by setSelect and animateTo buttons // Mainly for demonstration purposes function getRandom() { var dim = jcrop_api.getBounds(); return [ Math.round(Math.random() * dim[0]), Math.round(Math.random() * dim[1]), Math.round(Math.random() * dim[0]), Math.round(Math.random() * dim[1]) ]; }; // Attach interface buttons // This may appear to be a lot of code but it's simple stuff $('#setSelect').click(function(e) { // Sets a random selection jcrop_api.setSelect(getRandom()); }); $('#animateTo').click(function(e) { // Animates to a random selection jcrop_api.animateTo(getRandom()); }); $('#release').click(function(e) { // Release method clears the selection jcrop_api.release(); }); $('#disable').click(function(e) { // Disable Jcrop instance jcrop_api.disable(); // Update the interface to reflect disabled state $('#enable').show(); $('.requiresjcrop').hide(); }); $('#enable').click(function(e) { // Re-enable Jcrop instance jcrop_api.enable(); // Update the interface to reflect enabled state $('#enable').hide(); $('.requiresjcrop').show(); }); $('#rehook').click(function(e) { // This button is visible when Jcrop has been destroyed // It performs the re-attachment and updates the UI $('#rehook,#enable').hide(); initJcrop(); $('#unhook,.requiresjcrop').show(); return false; }); $('#unhook').click(function(e) { // Destroy Jcrop widget, restore original state jcrop_api.destroy(); // Update the interface to reflect un-attached state $('#unhook,#enable,.requiresjcrop').hide(); $('#rehook').show(); return false; }); // The checkboxes simply set options based on it's checked value // Options are changed by passing a new options object // Also, to prevent strange behavior, they are initially checked // This matches the default initial state of Jcrop $('#can_click').change(function(e) { jcrop_api.setOptions({ allowSelect: !!this.checked }); jcrop_api.focus(); }); $('#can_move').change(function(e) { jcrop_api.setOptions({ allowMove: !!this.checked }); jcrop_api.focus(); }); $('#can_size').change(function(e) { jcrop_api.setOptions({ allowResize: !!this.checked }); jcrop_api.focus(); }); $('#ar_lock').change(function(e) { jcrop_api.setOptions(this.checked? { aspectRatio: 16/9 }: { aspectRatio: 0 }); jcrop_api.focus(); }); $('#size_lock').change(function(e) { jcrop_api.setOptions(this.checked? { minSize: [ 80, 80 ], maxSize: [ 350, 350 ] }: { minSize: [ 0, 0 ], maxSize: [ 0, 0 ] }); jcrop_api.focus(); }); </script> --%> <%--</body> </html>--%> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title></title> <link rel="stylesheet" type="text/css" href="<%= Request.WebPath()+"/Tools/Cropit/ion.rangeSlider.css"%>"> <link rel="stylesheet" type="text/css" href="<%= Request.WebPath()+"/Tools/Cropit/ion.rangeSlider.skinHTML5.css"%>"> <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script> <script type="text/javascript" src='<%= Request.WebPath()+"/Tools/Cropit/jquery.cropit.js"%>'></script> <script type="text/javascript" src='<%= Request.WebPath()+"/Tools/Cropit/ion.rangeSlider.min.js"%>'></script> <style> .cropit-image-preview { background-color: #f8f8f8; background-size: cover; border: 1px solid #ccc; border-radius: 3px; margin: 15px auto 10px auto; width: 250px; height: 250px; cursor: move; } .cropit-image-background { opacity: .4; cursor: auto; } .image-size-label { margin-top: 10px; } input { display: block; } .export { margin-top: 10px; } .image-editor { text-align:center; } </style> </head> <body> <div class="image-editor"> <div class="cropit-image-preview"></div> <input type="range" class="cropit-image-zoom-input" value="0"> <button class="export">???</button> </div> <script> $(function () { $('.image-editor').cropit({ width: '<%= this._Width %>', height: '<%= this._Height %>', minZoom: 'fit', maxZoom: 1, initialZoom: 'min', smallImage: 'allow', allowDragNDrop: false, imageState: { src: '<%= this._ImgSrc %>', }, }); $(".cropit-image-zoom-input").ionRangeSlider({ grid: true, min: 0, max: 1, step: 0.01, }); $('.export').click(function () { var imageData = $('.image-editor').cropit('export'); //var zoom = 1; var zoom = $('.image-editor').cropit('zoom'); var pos = $('.image-editor').cropit('offset'); var x = Math.abs(pos.x); var y = Math.abs(pos.y); var rUrl = "<%= Request.Url.ToString() %>"; rUrl = removeParams(rUrl, "width"); rUrl = removeParams(rUrl, "height"); window.location.href = rUrl + "&zoom=" + zoom + "&left=" + x + "&top=" + y + "&width=" + '<%= this._Width %>' + "&height=" + '<%= this._Height %>'; }); function removeParams(url, name) { return url.replace(new RegExp("[\\?&]" + name + "=([^&#]*)"), ""); } }); </script> </body> </html> <%-- <style type="text/css"> html, body { height: 100%; overflow:hidden; } body { padding: 0; margin: 0; } #silverlightControlHost { height: 100%; text-align: center; } </style> <script type="text/javascript"> function onSilverlightError(sender, args) { var appSource = ""; if (sender != null && sender != 0) { appSource = sender.getHost().Source; } var errorType = args.ErrorType; var iErrorCode = args.ErrorCode; if (errorType == "ImageError" || errorType == "MediaError") { return; } var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n"; errMsg += "Code: " + iErrorCode + " \n"; errMsg += "Category: " + errorType + " \n"; errMsg += "Message: " + args.ErrorMessage + " \n"; if (errorType == "ParserError") { errMsg += "File: " + args.xamlFile + " \n"; errMsg += "Line: " + args.lineNumber + " \n"; errMsg += "Position: " + args.charPosition + " \n"; } else if (errorType == "RuntimeError") { if (args.lineNumber != 0) { errMsg += "Line: " + args.lineNumber + " \n"; errMsg += "Position: " + args.charPosition + " \n"; } errMsg += "MethodName: " + args.methodName + " \n"; } throw new Error(errMsg); } </script> </head> <body style="padding: 0px; margin: 0px;"> <div id="silverlightControlHost" style="margin: 0px;"> <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%"> <param name="source" value="C5.ImgCropper.xap" /> <param name="onError" value="onSilverlightError" /> <param name="background" value="white" /> <param name="minRuntimeVersion" value="4.0.50826.0" /> <param name="autoUpgrade" value="true" /> <param name="initParams" value="width=<%= this._Width %>, height=<%= this._Height %>, imgurl=<%= this._ImgSrc %>, zoomin=???, zoomout=???, reset=???, about=???, continue=???, exit=????, continueurl=<%= Request.Url.ToString() %>, exiturl=<%= Request.WebPath() + "/Tools/UploadCutOut.aspx" %>" /> <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0" style="text-decoration: none"> <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style: none" /> </a> </object> <iframe id="_sl_historyFrame" style="visibility: hidden; height: 0px; width: 0px; border: 0px"></iframe> </div> </body> </html> --%>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de