- Update Opera and jQuery links
- Use `https://` (fix #172), including in prompt for URL and relevant code comments (where available and naturally not on namespaces) - Comment out broken link in svg-editor.html - Trailing space
This commit is contained in:
12
README.md
12
README.md
@@ -17,10 +17,10 @@ SVG-edit is a fast, web-based, javascript-driven SVG drawing editor that works i
|
|||||||
|
|
||||||
## Videos
|
## Videos
|
||||||
|
|
||||||
* [SVG-edit 2.4 Part 1](http://www.youtube.com/watch?v=zpC7b1ZJvvM)
|
* [SVG-edit 2.4 Part 1](https://www.youtube.com/watch?v=zpC7b1ZJvvM)
|
||||||
* [SVG-edit 2.4 Part 2](http://www.youtube.com/watch?v=mDzZEoGUDe8)
|
* [SVG-edit 2.4 Part 2](https://www.youtube.com/watch?v=mDzZEoGUDe8)
|
||||||
* [SVG-edit 2.3 Features](http://www.youtube.com/watch?v=RVIcIy5fXOc)
|
* [SVG-edit 2.3 Features](https://www.youtube.com/watch?v=RVIcIy5fXOc)
|
||||||
* [Introduction to SVG-edit](http://www.youtube.com/watch?v=ZJKmEI06YiY) (Version 2.2)
|
* [Introduction to SVG-edit](https://www.youtube.com/watch?v=ZJKmEI06YiY) (Version 2.2)
|
||||||
|
|
||||||
## Supported browsers
|
## Supported browsers
|
||||||
|
|
||||||
@@ -36,6 +36,6 @@ The following browsers had been tested for 2.6 or earlier and will probably cont
|
|||||||
* See [docs](docs/) for more documentation.
|
* See [docs](docs/) for more documentation.
|
||||||
* [Acknowledgements](docs/Acknowledgements.md) lists open source projects used in svg-edit.
|
* [Acknowledgements](docs/Acknowledgements.md) lists open source projects used in svg-edit.
|
||||||
* See [AUTHORS](AUTHORS) file for authors.
|
* See [AUTHORS](AUTHORS) file for authors.
|
||||||
* [Stackoverflow](http://stackoverflow.com/tags/svg-edit) group.
|
* [Stackoverflow](https://stackoverflow.com/tags/svg-edit) group.
|
||||||
* Join the [svg-edit mailing list](https://groups.google.com/forum/#!forum/svg-edit).
|
* Join the [svg-edit mailing list](https://groups.google.com/forum/#!forum/svg-edit).
|
||||||
* Join us on `#svg-edit` on `freenode.net` (or use the [web client](http://webchat.freenode.net/?channels=svg-edit)).
|
* Join us on `#svg-edit` on `freenode.net` (or use the [web client](https://webchat.freenode.net/?channels=svg-edit)).
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ Gabe Lerner's excellent [canvg](https://github.com/gabelerner/canvg) library has
|
|||||||
|
|
||||||
## jQuery UI
|
## jQuery UI
|
||||||
|
|
||||||
We use [jQuery-UI](http://jqueryui.com) for making the dialog boxes (color picker, document properties) draggable, as well as for the opacity slider.
|
We use [jQuery-UI](https://jqueryui.com) for making the dialog boxes (color picker, document properties) draggable, as well as for the opacity slider.
|
||||||
|
|
||||||
## js-hotkeys
|
## js-hotkeys
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Function | Description
|
|||||||
[`Utils.convertToXMLReferences`](#utilsconverttoxmlreferences) | Converts a string to use XML references
|
[`Utils.convertToXMLReferences`](#utilsconverttoxmlreferences) | Converts a string to use XML references
|
||||||
[`rectsIntersect`](#rectsintersect) | Check if two rectangles (BBoxes objects) intersect each other
|
[`rectsIntersect`](#rectsintersect) | Check if two rectangles (BBoxes objects) intersect each other
|
||||||
[`snapToAngle`](#snaptoangle) | Returns a 45 degree angle coordinate associated with the two given coordinates
|
[`snapToAngle`](#snaptoangle) | Returns a 45 degree angle coordinate associated with the two given coordinates
|
||||||
[`text2xml`](#text2xml) | Cross-browser compatible method of converting a string to an XML tree found this function [here](http://groups.google.com/group/jquery-dev/browse_thread/thread/c6d11387c580a77f)
|
[`text2xml`](#text2xml) | Cross-browser compatible method of converting a string to an XML tree found this function [here](https://groups.google.com/group/jquery-dev/browse_thread/thread/c6d11387c580a77f)
|
||||||
|
|
||||||
### Unit conversion functions
|
### Unit conversion functions
|
||||||
|
|
||||||
@@ -330,7 +330,7 @@ Object with the following values: x - The angle-snapped x value y - The angle-sn
|
|||||||
|
|
||||||
"text2xml": function(sXML)
|
"text2xml": function(sXML)
|
||||||
|
|
||||||
Cross-browser compatible method of converting a string to an XML tree found this function [here](http://groups.google.com/group/jquery-dev/browse_thread/thread/c6d11387c580a77f)
|
Cross-browser compatible method of converting a string to an XML tree found this function [here](https://groups.google.com/group/jquery-dev/browse_thread/thread/c6d11387c580a77f)
|
||||||
|
|
||||||
# Unit conversion functions
|
# Unit conversion functions
|
||||||
|
|
||||||
@@ -1864,7 +1864,7 @@ Sets the new segment type to the selected segment(s).
|
|||||||
|
|
||||||
#### Parameters
|
#### Parameters
|
||||||
|
|
||||||
* `new_type` Integer with the new segment type See http://www.w3.org/TR/SVG/paths.html#InterfaceSVGPathSeg for list
|
* `new_type` Integer with the new segment type See https://www.w3.org/TR/SVG/paths.html#InterfaceSVGPathSeg for list
|
||||||
|
|
||||||
## `convertToPath`
|
## `convertToPath`
|
||||||
|
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ var supportsGoodDecimals_ = (function () {
|
|||||||
var retValue = (crect.getAttribute('x').indexOf(',') === -1);
|
var retValue = (crect.getAttribute('x').indexOf(',') === -1);
|
||||||
if (!retValue) {
|
if (!retValue) {
|
||||||
$.alert('NOTE: This version of Opera is known to contain bugs in SVG-edit.\n' +
|
$.alert('NOTE: This version of Opera is known to contain bugs in SVG-edit.\n' +
|
||||||
'Please upgrade to the <a href="http://opera.com">latest version</a> in which the problems have been fixed.');
|
'Please upgrade to the <a href="https://www.opera.com/download">latest version</a> in which the problems have been fixed.');
|
||||||
}
|
}
|
||||||
return retValue;
|
return retValue;
|
||||||
}());
|
}());
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* Gabe Lerner (gabelerner@gmail.com)
|
* Gabe Lerner (gabelerner@gmail.com)
|
||||||
* http://code.google.com/p/canvg/
|
* http://code.google.com/p/canvg/
|
||||||
*
|
*
|
||||||
* Requires: rgbcolor.js - http://www.phpied.com/rgb-color-parser-in-javascript/
|
* Requires: rgbcolor.js - https://www.phpied.com/rgb-color-parser-in-javascript/
|
||||||
*/
|
*/
|
||||||
var canvg;
|
var canvg;
|
||||||
(function () {
|
(function () {
|
||||||
@@ -608,7 +608,7 @@ function build (opts) {
|
|||||||
|
|
||||||
// aspect ratio
|
// aspect ratio
|
||||||
svg.AspectRatio = function (ctx, aspectRatio, width, desiredWidth, height, desiredHeight, minX, minY, refX, refY) {
|
svg.AspectRatio = function (ctx, aspectRatio, width, desiredWidth, height, desiredHeight, minX, minY, refX, refY) {
|
||||||
// aspect ratio - http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute
|
// aspect ratio - https://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute
|
||||||
aspectRatio = svg.compressSpaces(aspectRatio);
|
aspectRatio = svg.compressSpaces(aspectRatio);
|
||||||
aspectRatio = aspectRatio.replace(/^defer\s/, ''); // ignore defer
|
aspectRatio = aspectRatio.replace(/^defer\s/, ''); // ignore defer
|
||||||
var align = aspectRatio.split(' ')[0] || 'xMidYMid';
|
var align = aspectRatio.split(' ')[0] || 'xMidYMid';
|
||||||
@@ -1213,7 +1213,7 @@ function build (opts) {
|
|||||||
this.base(node);
|
this.base(node);
|
||||||
|
|
||||||
var d = this.attribute('d').value;
|
var d = this.attribute('d').value;
|
||||||
// TODO: convert to real lexer based on http://www.w3.org/TR/SVG11/paths.html#PathDataBNF
|
// TODO: convert to real lexer based on https://www.w3.org/TR/SVG11/paths.html#PathDataBNF
|
||||||
d = d.replace(/,/gm, ' '); // get rid of all commas
|
d = d.replace(/,/gm, ' '); // get rid of all commas
|
||||||
d = d.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm, '$1 $2'); // separate commands from commands
|
d = d.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm, '$1 $2'); // separate commands from commands
|
||||||
d = d.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm, '$1 $2'); // separate commands from commands
|
d = d.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm, '$1 $2'); // separate commands from commands
|
||||||
@@ -2432,7 +2432,7 @@ function build (opts) {
|
|||||||
if (element != null) {
|
if (element != null) {
|
||||||
var tempSvg = element;
|
var tempSvg = element;
|
||||||
if (element.type === 'symbol') {
|
if (element.type === 'symbol') {
|
||||||
// render me using a temporary svg element in symbol cases (http://www.w3.org/TR/SVG/struct.html#UseElement)
|
// render me using a temporary svg element in symbol cases (https://www.w3.org/TR/SVG/struct.html#UseElement)
|
||||||
tempSvg = new svg.Element.svg();
|
tempSvg = new svg.Element.svg();
|
||||||
tempSvg.type = 'svg';
|
tempSvg.type = 'svg';
|
||||||
tempSvg.attributes['viewBox'] = new svg.Property('viewBox', element.attribute('viewBox').value);
|
tempSvg.attributes['viewBox'] = new svg.Property('viewBox', element.attribute('viewBox').value);
|
||||||
@@ -2610,7 +2610,7 @@ function build (opts) {
|
|||||||
this.base(node);
|
this.base(node);
|
||||||
|
|
||||||
var matrix = svg.ToNumberArray(this.attribute('values').value);
|
var matrix = svg.ToNumberArray(this.attribute('values').value);
|
||||||
switch (this.attribute('type').valueOrDefault('matrix')) { // http://www.w3.org/TR/SVG/filters.html#feColorMatrixElement
|
switch (this.attribute('type').valueOrDefault('matrix')) { // https://www.w3.org/TR/SVG/filters.html#feColorMatrixElement
|
||||||
case 'saturate':
|
case 'saturate':
|
||||||
var s = matrix[0];
|
var s = matrix[0];
|
||||||
matrix = [
|
matrix = [
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* A class to parse color values
|
* A class to parse color values
|
||||||
* @author Stoyan Stefanov <sstoo@gmail.com>
|
* @author Stoyan Stefanov <sstoo@gmail.com>
|
||||||
* @link http://www.phpied.com/rgb-color-parser-in-javascript/
|
* @link https://www.phpied.com/rgb-color-parser-in-javascript/
|
||||||
* @license Use it if you like it
|
* @license Use it if you like it
|
||||||
*/
|
*/
|
||||||
function RGBColor (colorString) { // eslint-disable-line no-unused-vars
|
function RGBColor (colorString) { // eslint-disable-line no-unused-vars
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
// Version 1.01
|
// Version 1.01
|
||||||
//
|
//
|
||||||
// Cory S.N. LaViska
|
// Cory S.N. LaViska
|
||||||
// A Beautiful Site (http://abeautifulsite.net/)
|
// A Beautiful Site (https://abeautifulsite.net/)
|
||||||
// Modified by Alexis Deveria
|
// Modified by Alexis Deveria
|
||||||
//
|
//
|
||||||
// More info: http://abeautifulsite.net/2008/09/jquery-context-menu-plugin/
|
// More info: https://abeautifulsite.net/2008/09/jquery-context-menu-plugin/
|
||||||
//
|
//
|
||||||
// Terms of Use
|
// Terms of Use
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ svgEditor.addExtension('mathjax', function () {
|
|||||||
'<legend id="mathjax_legend">Mathematics Editor</legend>' +
|
'<legend id="mathjax_legend">Mathematics Editor</legend>' +
|
||||||
'<label>' +
|
'<label>' +
|
||||||
'<span id="mathjax_explication">Please type your mathematics in ' +
|
'<span id="mathjax_explication">Please type your mathematics in ' +
|
||||||
'<a href="http://en.wikipedia.org/wiki/Help:Displaying_a_formula" target="_blank">TeX</a> code.</span></label>' +
|
'<a href="https://en.wikipedia.org/wiki/Help:Displaying_a_formula" target="_blank">TeX</a> code.</span></label>' +
|
||||||
'<textarea id="mathjax_code_textarea" spellcheck="false"></textarea>' +
|
'<textarea id="mathjax_code_textarea" spellcheck="false"></textarea>' +
|
||||||
'</fieldset>' +
|
'</fieldset>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function encodeRFC5987ValueChars ($str) {
|
function encodeRFC5987ValueChars ($str) {
|
||||||
// See http://tools.ietf.org/html/rfc5987#section-3.2.1
|
// See https://tools.ietf.org/html/rfc5987#section-3.2.1
|
||||||
// For better readability within headers, add back the characters escaped by rawurlencode but still allowable
|
// For better readability within headers, add back the characters escaped by rawurlencode but still allowable
|
||||||
// Although RFC3986 reserves "!" (%21), RFC5987 does not
|
// Although RFC3986 reserves "!" (%21), RFC5987 does not
|
||||||
return preg_replace_callback('@%(2[1346B]|5E|60|7C)@', function ($matches) {
|
return preg_replace_callback('@%(2[1346B]|5E|60|7C)@', function ($matches) {
|
||||||
@@ -47,7 +47,7 @@ if ($suffix == '.svg') {
|
|||||||
header('Cache-Control: public');
|
header('Cache-Control: public');
|
||||||
header('Content-Description: File Transfer');
|
header('Content-Description: File Transfer');
|
||||||
|
|
||||||
// See http://tools.ietf.org/html/rfc6266#section-4.1
|
// See https://tools.ietf.org/html/rfc6266#section-4.1
|
||||||
header("Content-Disposition: attachment; filename*=UTF-8''" . encodeRFC5987ValueChars(
|
header("Content-Disposition: attachment; filename*=UTF-8''" . encodeRFC5987ValueChars(
|
||||||
// preg_replace('@[\\\\/:*?"<>|]@', '', $file) // If we wanted to strip Windows-disallowed characters server-side (but not a security issue, so we can strip client-side instead)
|
// preg_replace('@[\\\\/:*?"<>|]@', '', $file) // If we wanted to strip Windows-disallowed characters server-side (but not a security issue, so we can strip client-side instead)
|
||||||
$file
|
$file
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>-</title>
|
<title>-</title>
|
||||||
<link rel="icon" type="image/png" href="../../images/logo.png"/>
|
<link rel="icon" type="image/png" href="../../images/logo.png"/>
|
||||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|||||||
2
editor/jquery-svg.js
vendored
2
editor/jquery-svg.js
vendored
@@ -16,7 +16,7 @@
|
|||||||
// This fixes $(...).attr() to work as expected with SVG elements.
|
// This fixes $(...).attr() to work as expected with SVG elements.
|
||||||
// Does not currently use *AttributeNS() since we rarely need that.
|
// Does not currently use *AttributeNS() since we rarely need that.
|
||||||
|
|
||||||
// See http://api.jquery.com/attr/ for basic documentation of .attr()
|
// See https://api.jquery.com/attr/ for basic documentation of .attr()
|
||||||
|
|
||||||
// Additional functionality:
|
// Additional functionality:
|
||||||
// - When getting attributes, a string that's a number is return as type number.
|
// - When getting attributes, a string that's a number is return as type number.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#About
|
#About
|
||||||
**jQuery Hotkeys** is a plug-in that lets you easily add and remove handlers for keyboard events anywhere in your code supporting almost any key combination.
|
**jQuery Hotkeys** is a plug-in that lets you easily add and remove handlers for keyboard events anywhere in your code supporting almost any key combination.
|
||||||
|
|
||||||
This plugin is based off of the plugin by Tzury Bar Yochay: [jQuery.hotkeys](http://github.com/tzuryby/hotkeys)
|
This plugin is based off of the plugin by Tzury Bar Yochay: [jQuery.hotkeys](https://github.com/tzuryby/hotkeys)
|
||||||
|
|
||||||
The syntax is as follows:
|
The syntax is as follows:
|
||||||
|
|
||||||
|
|||||||
@@ -674,7 +674,7 @@ svgedit.path.Path.prototype.addSeg = function (index) {
|
|||||||
newseg = this.elem.createSVGPathSegLinetoAbs(newX, newY);
|
newseg = this.elem.createSVGPathSegLinetoAbs(newX, newY);
|
||||||
break;
|
break;
|
||||||
case 6: // make it a curved segment to preserve the shape (WRS)
|
case 6: // make it a curved segment to preserve the shape (WRS)
|
||||||
// http://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm#Geometric_interpretation
|
// https://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm#Geometric_interpretation
|
||||||
var p0x = (prev.item.x + seg.item.x1) / 2;
|
var p0x = (prev.item.x + seg.item.x1) / 2;
|
||||||
var p1x = (seg.item.x1 + seg.item.x2) / 2;
|
var p1x = (seg.item.x1 + seg.item.x2) / 2;
|
||||||
var p2x = (seg.item.x2 + seg.item.x) / 2;
|
var p2x = (seg.item.x2 + seg.item.x) / 2;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
if (!('SVGPathSeg' in window)) {
|
if (!('SVGPathSeg' in window)) {
|
||||||
// Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSeg
|
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSeg
|
||||||
window.SVGPathSeg = function (type, typeAsLetter, owningPathSegList) {
|
window.SVGPathSeg = function (type, typeAsLetter, owningPathSegList) {
|
||||||
this.pathSegType = type;
|
this.pathSegType = type;
|
||||||
this.pathSegTypeAsLetter = typeAsLetter;
|
this.pathSegTypeAsLetter = typeAsLetter;
|
||||||
@@ -315,7 +315,7 @@ if (!('SVGPathSeg' in window)) {
|
|||||||
Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype, 'y', { get: function () { return this._y; }, set: function (y) { this._y = y; this._segmentChanged(); }, enumerable: true });
|
Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype, 'y', { get: function () { return this._y; }, set: function (y) { this._y = y; this._segmentChanged(); }, enumerable: true });
|
||||||
|
|
||||||
// Add createSVGPathSeg* functions to window.SVGPathElement.
|
// Add createSVGPathSeg* functions to window.SVGPathElement.
|
||||||
// Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-Interfacewindow.SVGPathElement.
|
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-Interfacewindow.SVGPathElement.
|
||||||
window.SVGPathElement.prototype.createSVGPathSegClosePath = function () { return new window.SVGPathSegClosePath(undefined); };
|
window.SVGPathElement.prototype.createSVGPathSegClosePath = function () { return new window.SVGPathSegClosePath(undefined); };
|
||||||
window.SVGPathElement.prototype.createSVGPathSegMovetoAbs = function (x, y) { return new window.SVGPathSegMovetoAbs(undefined, x, y); };
|
window.SVGPathElement.prototype.createSVGPathSegMovetoAbs = function (x, y) { return new window.SVGPathSegMovetoAbs(undefined, x, y); };
|
||||||
window.SVGPathElement.prototype.createSVGPathSegMovetoRel = function (x, y) { return new window.SVGPathSegMovetoRel(undefined, x, y); };
|
window.SVGPathElement.prototype.createSVGPathSegMovetoRel = function (x, y) { return new window.SVGPathSegMovetoRel(undefined, x, y); };
|
||||||
@@ -372,7 +372,7 @@ if (!('SVGPathSeg' in window)) {
|
|||||||
// SVGPathSegList API (e.g., appendItem). In this case we need to re-implement the entire API
|
// SVGPathSegList API (e.g., appendItem). In this case we need to re-implement the entire API
|
||||||
// so the polyfill data (i.e., _list) is used throughout.
|
// so the polyfill data (i.e., _list) is used throughout.
|
||||||
if (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.prototype)) {
|
if (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.prototype)) {
|
||||||
// Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSegList
|
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSegList
|
||||||
window.SVGPathSegList = function (pathElement) {
|
window.SVGPathSegList = function (pathElement) {
|
||||||
this._pathElement = pathElement;
|
this._pathElement = pathElement;
|
||||||
this._list = this._parsePath(this._pathElement.getAttribute('d'));
|
this._list = this._parsePath(this._pathElement.getAttribute('d'));
|
||||||
@@ -394,7 +394,7 @@ if (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.pro
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Add the pathSegList accessors to window.SVGPathElement.
|
// Add the pathSegList accessors to window.SVGPathElement.
|
||||||
// Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGAnimatedPathData
|
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGAnimatedPathData
|
||||||
Object.defineProperty(window.SVGPathElement.prototype, 'pathSegList', {
|
Object.defineProperty(window.SVGPathElement.prototype, 'pathSegList', {
|
||||||
get: function () {
|
get: function () {
|
||||||
if (!this._pathSegList) {
|
if (!this._pathSegList) {
|
||||||
@@ -674,7 +674,7 @@ if (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.pro
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Parse a number from an SVG path. This very closely follows genericParseNumber(...) from Source/core/svg/SVGParserUtilities.cpp.
|
// Parse a number from an SVG path. This very closely follows genericParseNumber(...) from Source/core/svg/SVGParserUtilities.cpp.
|
||||||
// Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-PathDataBNF
|
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-PathDataBNF
|
||||||
Source.prototype._parseNumber = function () {
|
Source.prototype._parseNumber = function () {
|
||||||
var exponent = 0;
|
var exponent = 0;
|
||||||
var integer = 0;
|
var integer = 0;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
Styles to make ordinary <INPUT type="text"/> look like a spinbutton/spinbox control.
|
Styles to make ordinary <INPUT type="text"/> look like a spinbutton/spinbox control.
|
||||||
Use with JQuerySpinBtn.js to provide the spin functionality by reacting to mouse etc.
|
Use with JQuerySpinBtn.js to provide the spin functionality by reacting to mouse etc.
|
||||||
(Requires a reference to the JQuery library found at http://jquery.com/src/latest/)
|
(Requires a reference to the JQuery library found at http://code.jquery.com/)
|
||||||
(Hats-off to John Resig for creating the excellent JQuery library. It is fab.)
|
(Hats-off to John Resig for creating the excellent JQuery library. It is fab.)
|
||||||
|
|
||||||
This control is achieved with no extra html markup whatsoever and uses unobtrusive javascript.
|
This control is achieved with no extra html markup whatsoever and uses unobtrusive javascript.
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*
|
*
|
||||||
* Modifications by Jeff Schiller, June 2009:
|
* Modifications by Jeff Schiller, June 2009:
|
||||||
* - provide callback function for when the value changes based on the following
|
* - provide callback function for when the value changes based on the following
|
||||||
* http://www.mail-archive.com/jquery-en@googlegroups.com/msg36070.html
|
* https://www.mail-archive.com/jquery-en@googlegroups.com/msg36070.html
|
||||||
* Modifications by Jeff Schiller, July 2009:
|
* Modifications by Jeff Schiller, July 2009:
|
||||||
* - improve styling for widget in Opera
|
* - improve styling for widget in Opera
|
||||||
* - consistent key-repeat handling cross-browser
|
* - consistent key-repeat handling cross-browser
|
||||||
|
|||||||
@@ -61,8 +61,11 @@
|
|||||||
<script src="config.js"></script>
|
<script src="config.js"></script>
|
||||||
|
|
||||||
<!-- feeds -->
|
<!-- feeds -->
|
||||||
<link rel="alternate" type="application/atom+xml" title="SVG-edit General Discussion" href="http://groups.google.com/group/svg-edit/feed/atom_v1_0_msgs.xml" />
|
<link rel="alternate" type="application/atom+xml" title="SVG-edit General Discussion" href="https://groups.google.com/group/svg-edit/feed/atom_v1_0_msgs.xml" />
|
||||||
|
<!--
|
||||||
|
Broken:
|
||||||
<link rel="alternate" type="application/atom+xml" title="SVG-edit Updates (Issues/Fixes/Commits)" href="http://code.google.com/feeds/p/svg-edit/updates/basic" />
|
<link rel="alternate" type="application/atom+xml" title="SVG-edit Updates (Issues/Fixes/Commits)" href="http://code.google.com/feeds/p/svg-edit/updates/basic" />
|
||||||
|
-->
|
||||||
|
|
||||||
<!-- Add script with custom handlers here -->
|
<!-- Add script with custom handlers here -->
|
||||||
<title>SVG-edit</title>
|
<title>SVG-edit</title>
|
||||||
@@ -684,7 +687,7 @@
|
|||||||
<legend id="svginfo_editor_prefs">Editor Preferences</legend>
|
<legend id="svginfo_editor_prefs">Editor Preferences</legend>
|
||||||
|
|
||||||
<label><span id="svginfo_lang">Language:</span>
|
<label><span id="svginfo_lang">Language:</span>
|
||||||
<!-- Source: http://en.wikipedia.org/wiki/Language_names -->
|
<!-- Source: https://en.wikipedia.org/wiki/Language_names -->
|
||||||
<select id="lang_select">
|
<select id="lang_select">
|
||||||
<option id="lang_ar" value="ar">العربية</option>
|
<option id="lang_ar" value="ar">العربية</option>
|
||||||
<option id="lang_cs" value="cs">Čeština</option>
|
<option id="lang_cs" value="cs">Čeština</option>
|
||||||
|
|||||||
@@ -3241,7 +3241,7 @@ window.svgEditor = (function ($) {
|
|||||||
changeOpacity(false, perc);
|
changeOpacity(false, perc);
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
// For slider usage, see: http://jqueryui.com/demos/slider/
|
// For slider usage, see: https://jqueryui.com/demos/slider/
|
||||||
$('#opac_slider').slider({
|
$('#opac_slider').slider({
|
||||||
start: function () {
|
start: function () {
|
||||||
$('#opacity_dropdown li:not(.special)').hide();
|
$('#opacity_dropdown li:not(.special)').hide();
|
||||||
@@ -3485,7 +3485,7 @@ window.svgEditor = (function ($) {
|
|||||||
|
|
||||||
var makeHyperlink = function () {
|
var makeHyperlink = function () {
|
||||||
if (selectedElement != null || multiselected) {
|
if (selectedElement != null || multiselected) {
|
||||||
$.prompt(uiStrings.notification.enterNewLinkURL, 'http://', function (url) {
|
$.prompt(uiStrings.notification.enterNewLinkURL, 'https://', function (url) {
|
||||||
if (url) { svgCanvas.makeHyperlink(url); }
|
if (url) { svgCanvas.makeHyperlink(url); }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -3588,7 +3588,7 @@ window.svgEditor = (function ($) {
|
|||||||
var loadingURL;
|
var loadingURL;
|
||||||
var clickExport = function () {
|
var clickExport = function () {
|
||||||
$.select('Select an image type for export: ', [
|
$.select('Select an image type for export: ', [
|
||||||
// See http://kangax.github.io/jstests/toDataUrl_mime_type_test/ for a useful list of MIME types and browser support
|
// See https://kangax.github.io/jstests/toDataUrl_mime_type_test/ for a useful list of MIME types and browser support
|
||||||
// 'ICO', // Todo: Find a way to preserve transparency in SVG-Edit if not working presently and do full packaging for x-icon; then switch back to position after 'PNG'
|
// 'ICO', // Todo: Find a way to preserve transparency in SVG-Edit if not working presently and do full packaging for x-icon; then switch back to position after 'PNG'
|
||||||
'PNG',
|
'PNG',
|
||||||
'JPEG', 'BMP', 'WEBP', 'PDF'
|
'JPEG', 'BMP', 'WEBP', 'PDF'
|
||||||
@@ -4911,7 +4911,7 @@ window.svgEditor = (function ($) {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
// hypothetical indicator should be removed here
|
// hypothetical indicator should be removed here
|
||||||
}
|
}
|
||||||
// Use HTML5 File API: http://www.w3.org/TR/FileAPI/
|
// Use HTML5 File API: https://www.w3.org/TR/FileAPI/
|
||||||
// if browser has HTML5 File API support, then we will show the open menu item
|
// if browser has HTML5 File API support, then we will show the open menu item
|
||||||
// and provide a file input to click. When that change event fires, it will
|
// and provide a file input to click. When that change event fires, it will
|
||||||
// get the text contents of the file and send it to the canvas
|
// get the text contents of the file and send it to the canvas
|
||||||
|
|||||||
@@ -638,7 +638,7 @@ var getIntersectionList = this.getIntersectionList = function (rect) {
|
|||||||
|
|
||||||
// addToSelection expects an array, but it's ok to pass a NodeList
|
// addToSelection expects an array, but it's ok to pass a NodeList
|
||||||
// because using square-bracket notation is allowed:
|
// because using square-bracket notation is allowed:
|
||||||
// http://www.w3.org/TR/DOM-Level-2-Core/ecma-script-binding.html
|
// https://www.w3.org/TR/DOM-Level-2-Core/ecma-script-binding.html
|
||||||
return resultList;
|
return resultList;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -958,7 +958,7 @@ var addToSelection = this.addToSelection = function (elemsToAdd, showGrips) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// make sure the elements are in the correct order
|
// make sure the elements are in the correct order
|
||||||
// See: http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-compareDocumentPosition
|
// See: https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-compareDocumentPosition
|
||||||
|
|
||||||
selectedElements.sort(function (a, b) {
|
selectedElements.sort(function (a, b) {
|
||||||
if (a && b && a.compareDocumentPosition) {
|
if (a && b && a.compareDocumentPosition) {
|
||||||
@@ -2809,9 +2809,9 @@ var smoothPolylineIntoPath = function (element) {
|
|||||||
//
|
//
|
||||||
// Reading:
|
// Reading:
|
||||||
// - http://www.efg2.com/Lab/Graphics/Jean-YvesQueinecBezierCurves.htm
|
// - http://www.efg2.com/Lab/Graphics/Jean-YvesQueinecBezierCurves.htm
|
||||||
// - http://www.codeproject.com/KB/graphics/BezierSpline.aspx?msg=2956963
|
// - https://www.codeproject.com/KB/graphics/BezierSpline.aspx?msg=2956963
|
||||||
// - http://www.ian-ko.com/ET_GeoWizards/UserGuide/smooth.htm
|
// - https://www.ian-ko.com/ET_GeoWizards/UserGuide/smooth.htm
|
||||||
// - http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/Bezier/bezier-der.html
|
// - https://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/Bezier/bezier-der.html
|
||||||
var curpos = points.getItem(0), prevCtlPt = null;
|
var curpos = points.getItem(0), prevCtlPt = null;
|
||||||
var d = [];
|
var d = [];
|
||||||
d.push(['M', curpos.x, ',', curpos.y, ' C'].join(''));
|
d.push(['M', curpos.x, ',', curpos.y, ' C'].join(''));
|
||||||
@@ -4001,7 +4001,7 @@ this.save = function (opts) {
|
|||||||
if (opts) { $.extend(saveOptions, opts); }
|
if (opts) { $.extend(saveOptions, opts); }
|
||||||
saveOptions.apply = true;
|
saveOptions.apply = true;
|
||||||
|
|
||||||
// no need for doctype, see http://jwatt.org/svg/authoring/#doctype-declaration
|
// no need for doctype, see https://jwatt.org/svg/authoring/#doctype-declaration
|
||||||
var str = this.svgCanvasToString();
|
var str = this.svgCanvasToString();
|
||||||
call('saved', str);
|
call('saved', str);
|
||||||
};
|
};
|
||||||
@@ -6108,7 +6108,7 @@ this.removeHyperlink = function () {
|
|||||||
//
|
//
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// new_type - Integer with the new segment type
|
// new_type - Integer with the new segment type
|
||||||
// See http://www.w3.org/TR/SVG/paths.html#InterfaceSVGPathSeg for list
|
// See https://www.w3.org/TR/SVG/paths.html#InterfaceSVGPathSeg for list
|
||||||
this.setSegType = function (newType) {
|
this.setSegType = function (newType) {
|
||||||
pathActions.setSegType(newType);
|
pathActions.setSegType(newType);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ svgedit = {
|
|||||||
SVG: 'http://www.w3.org/2000/svg',
|
SVG: 'http://www.w3.org/2000/svg',
|
||||||
XLINK: 'http://www.w3.org/1999/xlink',
|
XLINK: 'http://www.w3.org/1999/xlink',
|
||||||
XML: 'http://www.w3.org/XML/1998/namespace',
|
XML: 'http://www.w3.org/XML/1998/namespace',
|
||||||
XMLNS: 'http://www.w3.org/2000/xmlns/' // see http://www.w3.org/TR/REC-xml-names/#xmlReserved
|
XMLNS: 'http://www.w3.org/2000/xmlns/' // see https://www.w3.org/TR/REC-xml-names/#xmlReserved
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -291,7 +291,7 @@ $.svgIcons = function (file, opts) {
|
|||||||
holder = $('#' + id);
|
holder = $('#' + id);
|
||||||
var svg = elem.getElementsByTagNameNS(svgns, 'svg')[0];
|
var svg = elem.getElementsByTagNameNS(svgns, 'svg')[0];
|
||||||
var svgroot = document.createElementNS(svgns, 'svg');
|
var svgroot = document.createElementNS(svgns, 'svg');
|
||||||
// Per http://www.w3.org/TR/xml-names11/#defaulting, the namespace for
|
// Per https://www.w3.org/TR/xml-names11/#defaulting, the namespace for
|
||||||
// attributes should have no value.
|
// attributes should have no value.
|
||||||
svgroot.setAttributeNS(null, 'viewBox', [0, 0, iconW, iconH].join(' '));
|
svgroot.setAttributeNS(null, 'viewBox', [0, 0, iconW, iconH].join(' '));
|
||||||
|
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ svgedit.utilities.convertToXMLReferences = function (input) {
|
|||||||
|
|
||||||
// Function: svgedit.utilities.text2xml
|
// Function: svgedit.utilities.text2xml
|
||||||
// Cross-browser compatible method of converting a string to an XML tree
|
// Cross-browser compatible method of converting a string to an XML tree
|
||||||
// found this function here: http://groups.google.com/group/jquery-dev/browse_thread/thread/c6d11387c580a77f
|
// found this function here: https://groups.google.com/group/jquery-dev/browse_thread/thread/c6d11387c580a77f
|
||||||
svgedit.utilities.text2xml = function (sXML) {
|
svgedit.utilities.text2xml = function (sXML) {
|
||||||
if (sXML.indexOf('<svg:svg') >= 0) {
|
if (sXML.indexOf('<svg:svg') >= 0) {
|
||||||
sXML = sXML.replace(/<(\/?)svg:/g, '<$1').replace('xmlns:svg', 'xmlns');
|
sXML = sXML.replace(/<(\/?)svg:/g, '<$1').replace('xmlns:svg', 'xmlns');
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ svgedit.units.isValidUnit = function (attr, val, selectedElement) {
|
|||||||
|
|
||||||
var result = false;
|
var result = false;
|
||||||
// because getElem() can throw an exception in the case of an invalid id
|
// because getElem() can throw an exception in the case of an invalid id
|
||||||
// (according to http://www.w3.org/TR/xml-id/ IDs must be a NCName)
|
// (according to https://www.w3.org/TR/xml-id/ IDs must be a NCName)
|
||||||
// we wrap it in an exception and only return true if the ID was valid and
|
// we wrap it in an exception and only return true if the ID was valid and
|
||||||
// not already present
|
// not already present
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>SVG-edit, Pavol Rusnák, SVG Open 2010, Paris</title>
|
<title>SVG-edit, Pavol Rusnák, SVG Open 2010, Paris</title>
|
||||||
<link href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans+Mono" rel="stylesheet" />
|
<link href="https://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans+Mono" rel="stylesheet" />
|
||||||
<link rel="stylesheet" href="style.css" />
|
<link rel="stylesheet" href="style.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -266,8 +266,8 @@ svgEditor.addExtension("Hello World", function () {
|
|||||||
<ul class="bulleted">
|
<ul class="bulleted">
|
||||||
<li><a href="http://svg-edit.googlecode.com">http://svg-edit.googlecode.com/</a> (demos, downloads, source, wiki, issue tracker)</li>
|
<li><a href="http://svg-edit.googlecode.com">http://svg-edit.googlecode.com/</a> (demos, downloads, source, wiki, issue tracker)</li>
|
||||||
<li>#svg-edit on irc.freenode.net</li>
|
<li>#svg-edit on irc.freenode.net</li>
|
||||||
<li><a href="http://groups.google.com/group/svg-edit">http://groups.google.com/group/svg-edit</a></li>
|
<li><a href="https://groups.google.com/group/svg-edit">https://groups.google.com/group/svg-edit</a></li>
|
||||||
<li><a href="http://en.wikipedia.org/wiki/SVG-edit">http://en.wikipedia.org/wiki/SVG-edit</a></li>
|
<li><a href="https://en.wikipedia.org/wiki/SVG-edit">https://en.wikipedia.org/wiki/SVG-edit</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
@@ -287,7 +287,7 @@ svgEditor.addExtension("Hello World", function () {
|
|||||||
|
|
||||||
<!--[if lt IE 9]>
|
<!--[if lt IE 9]>
|
||||||
<script
|
<script
|
||||||
src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js">
|
src="https://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js">
|
||||||
</script>
|
</script>
|
||||||
<script>CFInstall.check({mode: 'overlay'});</script>
|
<script>CFInstall.check({mode: 'overlay'});</script>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
|
|||||||
Reference in New Issue
Block a user