| 33 |
var nextId=1; |
var nextId=1; |
| 34 |
|
|
| 35 |
var lineEdit=null; |
var lineEdit=null; |
| 36 |
|
|
| 37 |
////// SVG |
////// SVG |
| 38 |
var svg_ns = 'http://www.w3.org/2000/svg'; |
var svg_ns = 'http://www.w3.org/2000/svg'; |
| 39 |
var svg_x=10; |
var svg_x=10; |
| 1897 |
var inputform = document.getElementById('svg_input'); |
var inputform = document.getElementById('svg_input'); |
| 1898 |
var color=document.getElementById('svg_color'); |
var color=document.getElementById('svg_color'); |
| 1899 |
var size=document.getElementById('svg_size'); |
var size=document.getElementById('svg_size'); |
| 1900 |
var y = parseInt(inputform.style.top) + parseInt(size.value)*0.8; |
var y = parseInt(inputform.style.top) + parseInt(size.value)*0.8 + 12; |
| 1901 |
|
var x = parseInt(inputform.style.left) + 12; |
| 1902 |
if(inputform.value){ |
if(inputform.value){ |
| 1903 |
targetItem=createSVGText(inputform.value, inputform.style.left, y, size.value, color.value); |
targetItem=createSVGText(inputform.value, x, y, size.value, color.value); |
| 1904 |
|
|
| 1905 |
appendSVGObj(targetItem); |
appendSVGObj(targetItem); |
| 1906 |
} |
} |
| 1907 |
inputform.setAttribute("type", "hidden"); |
inputform.setAttribute("type", "hidden"); |
| 1910 |
|
|
| 1911 |
function svgInputFormAdjust(e){ |
function svgInputFormAdjust(e){ |
| 1912 |
var inputform = document.getElementById('svg_input'); |
var inputform = document.getElementById('svg_input'); |
| 1913 |
inputform.size = inputform.value.length + 1; |
inputform.size = jstrlen(inputform.value) + 1; |
| 1914 |
|
} |
| 1915 |
|
|
| 1916 |
|
function jstrlen(str) { |
| 1917 |
|
var len = 0; |
| 1918 |
|
str = escape(str); |
| 1919 |
|
for (var i = 0; i < str.length; i++, len++) { |
| 1920 |
|
if (str.charAt(i) == "%") { |
| 1921 |
|
if (str.charAt(++i) == "u") { |
| 1922 |
|
i += 3; |
| 1923 |
|
len++; |
| 1924 |
|
} |
| 1925 |
|
i++; |
| 1926 |
|
} |
| 1927 |
|
} |
| 1928 |
|
return len; |
| 1929 |
} |
} |
| 1930 |
|
|
| 1931 |
function putInputForm(x, y, txt, size){ |
function putInputForm(x, y, txt, size){ |