created svgedit main object, moved all namespaces handling in the same place
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2411 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
@@ -13,16 +13,13 @@
|
||||
// 3) math.js
|
||||
// 4) svgutils.js
|
||||
|
||||
var svgedit = svgedit || {};
|
||||
|
||||
(function() {
|
||||
|
||||
if (!svgedit.path) {
|
||||
svgedit.path = {};
|
||||
}
|
||||
|
||||
var svgns = 'http://www.w3.org/2000/svg';
|
||||
|
||||
var NS = svgedit.NS;
|
||||
var uiStrings = {
|
||||
'pathNodeTooltip': 'Drag node to move it. Double-click node to change segment type',
|
||||
'pathCtrlPtTooltip': 'Drag control point to adjust curve properties'
|
||||
@@ -143,7 +140,7 @@ svgedit.path.addPointGrip = function(index, x, y) {
|
||||
var pointGrip = svgedit.utilities.getElem('pathpointgrip_'+index);
|
||||
// create it
|
||||
if (!pointGrip) {
|
||||
pointGrip = document.createElementNS(svgns, 'circle');
|
||||
pointGrip = document.createElementNS(NS.SVG, 'circle');
|
||||
svgedit.utilities.assignAttributes(pointGrip, {
|
||||
'id': 'pathpointgrip_' + index,
|
||||
'display': 'none',
|
||||
@@ -177,7 +174,7 @@ svgedit.path.getGripContainer = function() {
|
||||
var c = svgedit.utilities.getElem('pathpointgrip_container');
|
||||
if (!c) {
|
||||
var parent = svgedit.utilities.getElem('selectorParentGroup');
|
||||
c = parent.appendChild(document.createElementNS(svgns, 'g'));
|
||||
c = parent.appendChild(document.createElementNS(NS.SVG, 'g'));
|
||||
c.id = 'pathpointgrip_container';
|
||||
}
|
||||
return c;
|
||||
@@ -187,7 +184,7 @@ svgedit.path.addCtrlGrip = function(id) {
|
||||
var pointGrip = svgedit.utilities.getElem('ctrlpointgrip_'+id);
|
||||
if (pointGrip) return pointGrip;
|
||||
|
||||
pointGrip = document.createElementNS(svgns, 'circle');
|
||||
pointGrip = document.createElementNS(NS.SVG, 'circle');
|
||||
svgedit.utilities.assignAttributes(pointGrip, {
|
||||
'id': 'ctrlpointgrip_' + id,
|
||||
'display': 'none',
|
||||
@@ -207,7 +204,7 @@ svgedit.path.getCtrlLine = function(id) {
|
||||
var ctrlLine = svgedit.utilities.getElem('ctrlLine_'+id);
|
||||
if (ctrlLine) return ctrlLine;
|
||||
|
||||
ctrlLine = document.createElementNS(svgns, 'line');
|
||||
ctrlLine = document.createElementNS(NS.SVG, 'line');
|
||||
svgedit.utilities.assignAttributes(ctrlLine, {
|
||||
'id': 'ctrlLine_'+id,
|
||||
'stroke': '#555',
|
||||
@@ -310,7 +307,7 @@ svgedit.path.getSegSelector = function(seg, update) {
|
||||
if (!segLine) {
|
||||
var pointGripContainer = svgedit.path.getGripContainer();
|
||||
// create segline
|
||||
segLine = document.createElementNS(svgns, 'path');
|
||||
segLine = document.createElementNS(NS.SVG, 'path');
|
||||
svgedit.utilities.assignAttributes(segLine, {
|
||||
'id': 'segline_' + index,
|
||||
'display': 'none',
|
||||
|
||||
Reference in New Issue
Block a user