Gitlab CSE Unil

Commit ab75435b authored by M. Chardon's avatar M. Chardon
Browse files

résolution bug export png/svg

parent e493f9d0
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -21,6 +21,11 @@
 
// Main requirejs configuration
requirejs.config({
packages: [{
name: 'FileSaver.js',
location: '../_src/lib/FileSaver/',// path where you have placed FileSaver.js file
main: 'FileSaver.js'
}],
paths: {
adim: '../_src/adim',
tools: '../_src/adim/tools',
......@@ -23180,8 +23185,8 @@ function (_, paper, Signal, view) {
});
/* FileSaver.js
* A saveAs() FileSaver implementation.
* 1.3.2
* 2016-06-16 18:25:19
* 1.3.4
* 2018-01-12 13:14:0
*
* By Eli Grey, http://eligrey.com
* License: MIT
......@@ -23353,21 +23358,18 @@ var saveAs = saveAs || (function(view) {
}(
typeof self !== "undefined" && self
|| typeof window !== "undefined" && window
|| this.content
|| this
));
// `self` is undefined in Firefox for Android content script context
// while `this` is nsIContentFrameMessageManager
// with an attribute `content` that corresponds to the window
 
if (typeof module !== "undefined" && module.exports) {
module.exports.saveAs = saveAs;
module.exports.saveAs = saveAs;
} else if ((typeof define !== "undefined" && define !== null) && (define.amd !== null)) {
define("FileSaver.js", [],function() {
return saveAs;
});
define("FileSaver.js", [],function() {
return saveAs;
});
}
;
define("FileSaver", function(){});
define("FileSaver.js/FileSaver", function(){});
 
!function(t){"use strict";var e=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,o=t.Blob&&function(){try{return Boolean(new Blob)}catch(t){return!1}}(),n=o&&t.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(t){return!1}}(),r=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,a=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,i=(o||r)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(t){var e,i,l,u,b,c,d,B,f;if(e=t.match(a),!e)throw new Error("invalid data URI");for(i=e[2]?e[1]:"text/plain"+(e[3]||";charset=US-ASCII"),l=!!e[4],u=t.slice(e[0].length),b=l?atob(u):decodeURIComponent(u),c=new ArrayBuffer(b.length),d=new Uint8Array(c),B=0;B<b.length;B+=1)d[B]=b.charCodeAt(B);return o?new Blob([n?d:c],{type:i}):(f=new r,f.append(c),f.getBlob(i))};t.HTMLCanvasElement&&!e.toBlob&&(e.mozGetAsFile?e.toBlob=function(t,o,n){t(n&&e.toDataURL&&i?i(this.toDataURL(o,n)):this.mozGetAsFile("blob",o))}:e.toDataURL&&i&&(e.toBlob=function(t,e,o){t(i(this.toDataURL(e,o)))})),"function"==typeof define&&define.amd?define('canvasToBlob',[],function(){return i}):"object"==typeof module&&module.exports?module.exports=i:t.dataURLtoBlob=i}(window);
//# sourceMappingURL=canvas-to-blob.min.js.map;
......@@ -24178,7 +24180,7 @@ define("zip", function(){});
define('helper/exporter',[
"jquery",
"paper",
"FileSaver",
"FileSaver.js",
"adim/view",
"adim/config",
 
......@@ -27608,6 +27610,194 @@ define("bootstrap.spinedit", ["jquery.bootstrap"], function(){});
 
define("bootstrap.rating", ["jquery.bootstrap"], function(){});
 
/* FileSaver.js
* A saveAs() FileSaver implementation.
* 1.3.4
* 2018-01-12 13:14:0
*
* By Eli Grey, http://eligrey.com
* License: MIT
* See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md
*/
/*global self */
/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
var saveAs = saveAs || (function(view) {
"use strict";
// IE <10 is explicitly unsupported
if (typeof view === "undefined" || typeof navigator !== "undefined" && /MSIE [1-9]\./.test(navigator.userAgent)) {
return;
}
var
doc = view.document
// only get URL when necessary in case Blob.js hasn't overridden it yet
, get_URL = function() {
return view.URL || view.webkitURL || view;
}
, save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a")
, can_use_save_link = "download" in save_link
, click = function(node) {
var event = new MouseEvent("click");
node.dispatchEvent(event);
}
, is_safari = /constructor/i.test(view.HTMLElement) || view.safari
, is_chrome_ios =/CriOS\/[\d]+/.test(navigator.userAgent)
, throw_outside = function(ex) {
(view.setImmediate || view.setTimeout)(function() {
throw ex;
}, 0);
}
, force_saveable_type = "application/octet-stream"
// the Blob API is fundamentally broken as there is no "downloadfinished" event to subscribe to
, arbitrary_revoke_timeout = 1000 * 40 // in ms
, revoke = function(file) {
var revoker = function() {
if (typeof file === "string") { // file is an object URL
get_URL().revokeObjectURL(file);
} else { // file is a File
file.remove();
}
};
setTimeout(revoker, arbitrary_revoke_timeout);
}
, dispatch = function(filesaver, event_types, event) {
event_types = [].concat(event_types);
var i = event_types.length;
while (i--) {
var listener = filesaver["on" + event_types[i]];
if (typeof listener === "function") {
try {
listener.call(filesaver, event || filesaver);
} catch (ex) {
throw_outside(ex);
}
}
}
}
, auto_bom = function(blob) {
// prepend BOM for UTF-8 XML and text/* types (including HTML)
// note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF
if (/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) {
return new Blob([String.fromCharCode(0xFEFF), blob], {type: blob.type});
}
return blob;
}
, FileSaver = function(blob, name, no_auto_bom) {
if (!no_auto_bom) {
blob = auto_bom(blob);
}
// First try a.download, then web filesystem, then object URLs
var
filesaver = this
, type = blob.type
, force = type === force_saveable_type
, object_url
, dispatch_all = function() {
dispatch(filesaver, "writestart progress write writeend".split(" "));
}
// on any filesys errors revert to saving with object URLs
, fs_error = function() {
if ((is_chrome_ios || (force && is_safari)) && view.FileReader) {
// Safari doesn't allow downloading of blob urls
var reader = new FileReader();
reader.onloadend = function() {
var url = is_chrome_ios ? reader.result : reader.result.replace(/^data:[^;]*;/, 'data:attachment/file;');
var popup = view.open(url, '_blank');
if(!popup) view.location.href = url;
url=undefined; // release reference before dispatching
filesaver.readyState = filesaver.DONE;
dispatch_all();
};
reader.readAsDataURL(blob);
filesaver.readyState = filesaver.INIT;
return;
}
// don't create more object URLs than needed
if (!object_url) {
object_url = get_URL().createObjectURL(blob);
}
if (force) {
view.location.href = object_url;
} else {
var opened = view.open(object_url, "_blank");
if (!opened) {
// Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html
view.location.href = object_url;
}
}
filesaver.readyState = filesaver.DONE;
dispatch_all();
revoke(object_url);
}
;
filesaver.readyState = filesaver.INIT;
if (can_use_save_link) {
object_url = get_URL().createObjectURL(blob);
setTimeout(function() {
save_link.href = object_url;
save_link.download = name;
click(save_link);
dispatch_all();
revoke(object_url);
filesaver.readyState = filesaver.DONE;
});
return;
}
fs_error();
}
, FS_proto = FileSaver.prototype
, saveAs = function(blob, name, no_auto_bom) {
return new FileSaver(blob, name || blob.name || "download", no_auto_bom);
}
;
// IE 10+ (native saveAs)
if (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) {
return function(blob, name, no_auto_bom) {
name = name || blob.name || "download";
if (!no_auto_bom) {
blob = auto_bom(blob);
}
return navigator.msSaveOrOpenBlob(blob, name);
};
}
FS_proto.abort = function(){};
FS_proto.readyState = FS_proto.INIT = 0;
FS_proto.WRITING = 1;
FS_proto.DONE = 2;
FS_proto.error =
FS_proto.onwritestart =
FS_proto.onprogress =
FS_proto.onwrite =
FS_proto.onabort =
FS_proto.onerror =
FS_proto.onwriteend =
null;
return saveAs;
}(
typeof self !== "undefined" && self
|| typeof window !== "undefined" && window
|| this
));
if (typeof module !== "undefined" && module.exports) {
module.exports.saveAs = saveAs;
} else if ((typeof define !== "undefined" && define !== null) && (define.amd !== null)) {
define("FileSaver.js", [],function() {
return saveAs;
});
}
;
define("FileSaver", function(){});
/**
* Copyright (C) 2014 Université de Lausanne, RISET,
* < http://www.unil.ch/riset/ >
......@@ -32048,9 +32238,9 @@ function($){
!function(a){function b(b){if("string"==typeof b.data&&(b.data={keys:b.data}),b.data&&b.data.keys&&"string"==typeof b.data.keys){var c=b.handler,d=b.data.keys.toLowerCase().split(" ");b.handler=function(b){if(this===b.target||!(/textarea|select/i.test(b.target.nodeName)||a.hotkeys.options.filterTextInputs&&a.inArray(b.target.type,a.hotkeys.textAcceptingInputTypes)>-1)){var e="keypress"!==b.type&&a.hotkeys.specialKeys[b.which],f=String.fromCharCode(b.which).toLowerCase(),g="",h={};a.each(["alt","ctrl","shift"],function(a,c){b[c+"Key"]&&e!==c&&(g+=c+"+")}),b.metaKey&&!b.ctrlKey&&"meta"!==e&&(g+="meta+"),b.metaKey&&"meta"!==e&&g.indexOf("alt+ctrl+shift+")>-1&&(g=g.replace("alt+ctrl+shift+","hyper+")),e?h[g+e]=!0:(h[g+f]=!0,h[g+a.hotkeys.shiftNums[f]]=!0,"shift+"===g&&(h[a.hotkeys.shiftNums[f]]=!0));for(var i=0,j=d.length;i<j;i++)if(h[d[i]])return c.apply(this,arguments)}}}}a.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],options:{filterTextInputs:!0}},a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:b}})}(jQuery||this.jQuery||window.jQuery);
define("jquery.hotkeys", ["jquery"], function(){});
 
/*! AdIm - v0.0.0 - 2017-03-27 - Copyright (C) 2017 Université de Lausanne - see licence */
/*! AdIm - v0.0.0 - 2018-02-05 - Copyright (C) 2018 Université de Lausanne - see licence */
define('env/shortcuts',["jquery","paper","signals","adim/config","adim/view","adim/tools","adim/ui","jquery.hotkeys"],function(a,b,c,d,e,f,g){var h,i=function(){return function(){return!1}};return{"backspace del":[{event:"keydown",ctxt:"edit",fn:function(){return e.removeSelectedItems(),!1}},{event:"keydown",ctxt:"review",fn:i()}],space:[{event:"keydown",fn:function(){return h||(h=f.getActiveTool(),f.activateTool("pan")),!1}},{event:"keyup",fn:function(){return h&&(f.activateTool(h),h=null),!1}}],a:[{event:"keydown",ctxt:"edit",fn:function(){return f.activateTool("select"),!1}}],"ctrl+a meta+a":[{event:"keydown",ctxt:"edit",fn:function(){return b.project.activeLayer.children.map(function(a){a.selected=!0}),!1}},{event:"keydown",ctxt:"review",fn:i()}],d:[{event:"keydown",ctxt:"edit",fn:function(){return f.activateTool("drawinggeo"),!1}}],f:[{event:"keydown",ctxt:"edit",fn:function(){return f.activateTool("arrowgeo"),!1}}],l:[{event:"keydown",ctxt:"edit",fn:function(){return f.activateTool("linesgeo"),!1}}],c:[{event:"keydown",ctxt:"edit",fn:function(){return f.activateTool("ellipsegeo"),!1}}],r:[{event:"keydown",ctxt:"edit",fn:function(){return f.activateTool("rectanglegeo"),!1}}],t:[{event:"keydown",ctxt:"edit",fn:function(){return f.activateTool("textgeo"),!1}}]}});
/*! AdIm - v0.0.0 - 2017-03-27 - Copyright (C) 2017 Université de Lausanne - see licence */
/*! AdIm - v0.0.0 - 2018-02-05 - Copyright (C) 2018 Université de Lausanne - see licence */
define('env/env',["jquery","underscore","paper","signals","adim/config","adim/view","adim/attributes","adim/io","adim/tools","adim/ui","adim/category","env/shortcuts"],function(a,b,c,d,e,f,g,h,i,j,k,l){function m(){console.info("_initSignalRouting from env/geomo"),h.events.annotableLoaded.add(function(a){f.events.annotationRemoved.add(function(a){}),f.events.imageLoaded.add(function(a){})},100),f.events.annotationsLoaded.add(function(){},-100),j.events.modeChanged.add(function(b){var c=b.mode;"edit"===c?(a("#annotation-display-panel").hide(),a("div.property-group").show()):"review"===c&&(a("#annotation-display-panel").show(),a("div.property-group").hide(),a("div.comment-prop").show())})}function n(b){function c(a){e.toggleClass("col-sm-1",!a).toggleClass("col-sm-2",a),l.toggleClass("hidden",!a),i.toggleClass("col-xs-12",!a).toggleClass("col-xs-6",a)}function d(a){c(a&&m.find(".panel-collapse").hasClass("in")),m.toggleClass("hidden",!a)}k.init({env:p.name}),a(".adim-display-type-selector").find("button").on("click",function(b){var c=a(this),d=!c.hasClass("active"),e=c.data("category");b.metaKey||(c.toggleClass("active",d),"image"===e?g.setImageOpacity(d?100:0,!0):f.toggleItemsByProp({prop:"category",val:e,undef:!0},d))});var e=a("#side-col"),h=a(".canvas-container"),i=a("#side-col-panel-group"),l=a("#alt-side-col-panel-group"),m=a("#shared-annotation-markers-panel");d("review"===b.mode),j.events.modeChanged.add(function(a){var b=a.mode;d("review"===b),j.updateReservedSpace(),j.adjustCanvasToImage()}),m.find(".panel-collapse").on("hidden.bs.collapse",function(){h.css("transition","width 0.2s cubic-bezier(0.25, 0.1, 0.25, 1) 0s"),m.prependTo(i),c(!1),j.updateReservedSpace(),j.adjustCanvasToImage(),h.css("transition","")}).on("show.bs.collapse",function(){c(!0),m.appendTo(l),j.updateReservedSpace(),j.adjustCanvasToImage()})}function o(){}var p={name:"geomo",shortcuts:l,initSignalRouting:m,initUI:n};return Object.defineProperty(p,"style",{get:o}),p});
/**
* Copyright (C) 2014 Université de Lausanne, RISET,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment