Sync with latest SVG-Edit
Loading of configuration data via URL query string. Now no differences, from trunk, in svgcanvas.js or svg-edit.js.
This commit is contained in:
parent
c946c331e1
commit
5167363a2d
6 changed files with 2749 additions and 2677 deletions
|
@ -82,7 +82,7 @@ function setupSVGedit(path){
|
|||
f.insert({top: SVGeditButton});
|
||||
SVGeditButton.disabled = true;
|
||||
Event.observe(SVGeditButton, 'click', function(){
|
||||
var editor = window.open(path, 'Edit SVG graphic', 'status=1,resizable=1,scrollbars=1');
|
||||
var editor = window.open(path + "?initStroke[width]=2", 'Edit SVG graphic', 'status=1,resizable=1,scrollbars=1');
|
||||
editor.addEventListener("load", function() {
|
||||
editor.svgEditor.setCustomHandlers({
|
||||
'save': function(window,svg){
|
||||
|
|
|
@ -46,6 +46,9 @@ $.jGraduate.Paint({hex: "#rrggbb", linearGradient: o}) -> throws an exception?
|
|||
|
||||
*
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
var ns = { svg: 'http://www.w3.org/2000/svg', xlink: 'http://www.w3.org/1999/xlink' };
|
||||
if(!window.console) {
|
||||
window.console = new function() {
|
||||
|
@ -1083,3 +1086,4 @@ jQuery.fn.jGraduate =
|
|||
$this.show();
|
||||
});
|
||||
};
|
||||
})();
|
|
@ -674,7 +674,7 @@ span.zoom_tool {
|
|||
}
|
||||
|
||||
#svg_editor #tools_bottom_2 {
|
||||
width: 204px;
|
||||
width: 215px;
|
||||
position: relative;
|
||||
float: left;
|
||||
}
|
||||
|
@ -706,6 +706,7 @@ span.zoom_tool {
|
|||
-moz-border-radius-bottomleft: 4px;
|
||||
-webkit-border-top-left-radius: 4px;
|
||||
-webkit-border-bottom-left-radius: 4px;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.color_tool > *:last-child {
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
<script type="text/javascript" src="js-hotkeys/jquery.hotkeys.min.js"></script>
|
||||
<script type="text/javascript" src="jgraduate/jquery.jgraduate.js"></script>
|
||||
<script type="text/javascript" src="svgicons/jquery.svgicons.js"></script>
|
||||
<script type="text/javascript" src="jquerybbq/jquery.bbq.min.js"></script>
|
||||
<script type="text/javascript" src="spinbtn/JQuerySpinBtn.js"></script>
|
||||
<script type="text/javascript" src="locale/locale.js"></script>
|
||||
<script type="text/javascript" src="svgcanvas.js"></script>
|
||||
|
@ -28,6 +29,7 @@
|
|||
<!-- Release version of script tags: >
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="js-hotkeys/jquery.hotkeys-0.7.9.js"></script>
|
||||
<script type="text/javascript" src="jquerybbq/jquery.bbq.min.js"></script>
|
||||
<script type="text/javascript" src="jgraduate/jquery.jgraduate.min.js"></script>
|
||||
<script type="text/javascript" src="spinbtn/JQuerySpinBtn.min.js"></script>
|
||||
<script type="text/javascript" src="svgcanvas.min.js"></script>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -60,7 +60,7 @@ if(window.opera) {
|
|||
|
||||
} else if(typeof key === "object") {
|
||||
// Setting attributes form object
|
||||
for(v in key) {
|
||||
for(var v in key) {
|
||||
elem.setAttribute(v, key[v]);
|
||||
}
|
||||
// Getting attribute
|
||||
|
@ -170,7 +170,8 @@ var isOpera = !!window.opera,
|
|||
},
|
||||
|
||||
curConfig = {
|
||||
show_outside_canvas: true
|
||||
show_outside_canvas: true,
|
||||
dimensions: [640, 480]
|
||||
},
|
||||
|
||||
toXml = function(str) {
|
||||
|
@ -672,10 +673,11 @@ function BatchCommand(text) {
|
|||
if($("#canvasBackground").length) return;
|
||||
|
||||
var canvasbg = svgdoc.createElementNS(svgns, "svg");
|
||||
var dims = curConfig.dimensions;
|
||||
assignAttributes(canvasbg, {
|
||||
'id':'canvasBackground',
|
||||
'width': 640,
|
||||
'height': 480,
|
||||
'width': dims[0],
|
||||
'height': dims[1],
|
||||
'x': 0,
|
||||
'y': 0,
|
||||
'overflow': 'visible',
|
||||
|
@ -935,8 +937,9 @@ function BatchCommand(text) {
|
|||
mathns = "http://www.w3.org/1998/Math/MathML",
|
||||
idprefix = "svg_",
|
||||
svgdoc = container.ownerDocument,
|
||||
dimensions = curConfig.dimensions,
|
||||
svgroot = svgdoc.importNode(Utils.text2xml('<svg id="svgroot" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ' +
|
||||
'width="640" height="480" x="640" y="480" overflow="visible">' +
|
||||
'width="' + dimensions[0] + '" height="' + dimensions[1] + '" x="' + dimensions[0] + '" y="' + dimensions[1] + '" overflow="visible">' +
|
||||
'<defs>' +
|
||||
'<filter id="canvashadow" filterUnits="objectBoundingBox">' +
|
||||
'<feGaussianBlur in="SourceAlpha" stdDeviation="4" result="blur"/>'+
|
||||
|
@ -981,10 +984,10 @@ function BatchCommand(text) {
|
|||
// Produce a Namespace-aware version of svgWhitelist
|
||||
var svgWhiteListNS = {};
|
||||
$.each(svgWhiteList, function(elt,atts){
|
||||
attNS = {};
|
||||
var attNS = {};
|
||||
$.each(atts, function(i, att){
|
||||
if (att.indexOf(':') != -1) {
|
||||
v=att.split(':');
|
||||
var v = att.split(':');
|
||||
attNS[v[1]] = nsRevMap[v[0]];
|
||||
} else {
|
||||
attNS[att] = att == 'xmlns' ? xmlnsns : null;
|
||||
|
@ -996,10 +999,10 @@ function BatchCommand(text) {
|
|||
var svgcontent = svgdoc.createElementNS(svgns, "svg");
|
||||
$(svgcontent).attr({
|
||||
id: 'svgcontent',
|
||||
width: 640,
|
||||
height: 480,
|
||||
x: 640,
|
||||
y: 480,
|
||||
width: dimensions[0],
|
||||
height: dimensions[1],
|
||||
x: dimensions[0],
|
||||
y: dimensions[1],
|
||||
overflow: curConfig.show_outside_canvas?'visible':'hidden',
|
||||
xmlns: svgns,
|
||||
"xmlns:se": se_ns,
|
||||
|
@ -1200,15 +1203,15 @@ function BatchCommand(text) {
|
|||
current_resize_mode = "none",
|
||||
all_properties = {
|
||||
shape: {
|
||||
fill: "#FF0000",
|
||||
fill: "#" + curConfig.initFill.color,
|
||||
fill_paint: null,
|
||||
fill_opacity: 1,
|
||||
stroke: "#000000",
|
||||
fill_opacity: curConfig.initFill.opacity,
|
||||
stroke: "#" + curConfig.initStroke.color,
|
||||
stroke_paint: null,
|
||||
stroke_opacity: 1,
|
||||
stroke_width: 2,
|
||||
stroke_opacity: curConfig.initStroke.opacity,
|
||||
stroke_width: curConfig.initStroke.width,
|
||||
stroke_style: 'none',
|
||||
opacity: 1
|
||||
opacity: curConfig.initOpacity
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -8107,7 +8110,7 @@ function BatchCommand(text) {
|
|||
// Function: getVersion
|
||||
// Returns a string which describes the revision number of SvgCanvas.
|
||||
this.getVersion = function() {
|
||||
return "svgcanvas.js ($Rev: 1456 $)";
|
||||
return "svgcanvas.js ($Rev: 1459 $)";
|
||||
};
|
||||
|
||||
this.setUiStrings = function(strs) {
|
||||
|
|
Loading…
Reference in a new issue