function ak_init_editor(evt,what){
/*<!-- ========================================================================= -->
<!-- AKs SVG Editor, Version 3.0, Build 56                                       -->
<!-- Copyright (c) 2004-2009 Andreas Krammel. All rights reserved.               -->
<!-- kontakt@krammel.net     www.krammel.net                                     -->
<!-- WARNING: This computer program is protected by                              -->
<!-- copyright law and international treaties. You must not                      -->
<!-- reproduce, modificate or distribute this program or parts of it!            -->
<!-- ========================================================================= -->*/
if(ak_init_editor_already_done) {evt.stopPropagation();return}
try{
ak_directory=window.getSrc()
ak_directory=ak_directory.replace(/^file:\/\//,"")
ak_directory=ak_directory.replace(/^\//,"")
ak_directory=ak_directory.replace(/\//g,"\\")
var ak_tmp=ak_directory.lastIndexOf("\\")
if(ak_tmp>0)
{
ak_file=ak_directory.substring(ak_tmp+1)
ak_directory=ak_directory.substring(0,ak_tmp)
}
else
{
ak_file=ak_directory
ak_directory=""
}
if(ak_file=="~AKs_Export_indexed_frames_tmp.svg")
{
ak_svgroot=document.documentElement
ak_svgroot.pauseAnimations()
ak_init_userSpace2()
ak_timeline_aniArray(evt)
setTimeout("ak_setExportImage()",100)
return
}
}
catch(err){return}
if(what)
{
var ak_tmp_what=new Array(what)
var ak_tmp_return=false
if(/,/.test(what)) ak_tmp_what=what.split(",")
for(var i=0;i<ak_tmp_what.length;i++)
{
switch(ak_tmp_what[i])
{
case "menu":
ak_add_context_menu_entry(evt)
ak_tmp_return=true
break
case "g_true":
ak_group_ctrl=true
break
}
}
if(ak_tmp_return) return
}
try{getSVGViewerVersion()}catch(error){alert("AK's SVG Editor will not start, needs SVG Viewer Version Adobe 3.0 or higher!");return}
ak_serNo=''
ak_orgMenu=getContextMenu().firstChild
try{getURL(window.getSrc(),ak_init_header)}catch(error){return}
// ak_save try{
ak_svgroot=document.documentElement
ak_object2update_nodeNr=-1
ak_init_userSpace()
ak_init_colorMenu()
ak_init_toolbox()
ak_object2update=document.getElementById("ak_no_selection")
ak_svgroot.childNodes.item(1).appendChild(ak_userspace_svg)
ak_userspace_svg.insertBefore(parseXML("<rect id='ak_internal_userSpace_grid2' x='-100000' y='-100000' width='200000' height='200000' style='shape-rendering:optimizeSpeed;fill:url(#ak_internal_grid_fill)'/>",document).firstChild,ak_userspace_svg.firstChild)
ak_object2update_CTM=ak_svgroot.createSVGMatrix()
ak_point_2=ak_svgroot.createSVGPoint()
ak_EditPoint=ak_svgroot.createSVGPoint()
ak_EditPoint_enter=ak_svgroot.createSVGPoint()
ak_EditPoint_enter_r=ak_svgroot.createSVGPoint()
ak_EditPoint2_enter=ak_svgroot.createSVGPoint()
ak_EditPoint_BBox=ak_svgroot.createSVGPoint()
ak_EditPoint_Size=ak_svgroot.createSVGPoint()
ak_bbox_center=ak_svgroot.createSVGPoint()
ak_bbox_center_translate=ak_svgroot.createSVGPoint()
ak_bbox_upperleft=ak_svgroot.createSVGPoint()
ak_bbox_lowerright=ak_svgroot.createSVGPoint()
ak_use_min=ak_svgroot.createSVGPoint()
ak_use_max=ak_svgroot.createSVGPoint()
ak_gradient_vector=ak_svgroot.createSVGPoint()
ak_init_button_set(evt)
ak_init_more_sliders(evt)
for (var i=0; i<ak_init_eval.length; i++) {eval(ak_init_eval[i])}
if(/6.0x38363$/.test(getSVGViewerVersion()))
{
for(var i=0;i<document.getElementsByTagName("use").length;i++)
{
var ak_uses_onmousedown=document.getElementsByTagName("use").item(i).getAttribute("onmousedown")
ak_uses_onmousedown="ak_MoveEditRect_flag=true;ak_clickset_obj2update(evt);"+ak_uses_onmousedown
document.getElementsByTagName("use").item(i).setAttribute("onmousedown",ak_uses_onmousedown)
}
}
ak_temporary_undo=ak_userspace_svg.cloneNode(1)
ak_undoVariables('tmpSet')
ak_undo_init() // ak_save 
ak_actualSelect=ak_userspace_svg
ak_prevSelect=ak_userspace_svg
ak_cout("Welcome to AKs SVG Editor!")
document.rootElement.setAttribute('zoomAndPan','disable')
for (var i=0; i<256; i++) {ak_key_status[i]="up"}
ak_svgroot.setAttribute("onkeydown","ak_key_down(evt)")
ak_svgroot.setAttribute("onkeyup","ak_key_up(evt)")
ak_svgroot.setAttribute("onmousemove","ak_mouse_move(evt,'move')")
ak_svgroot.setAttribute("onmouseout","ak_mouse_move(evt,'out')")
ak_svgroot.setAttribute("onmouseup","ak_mouse_move(evt,'up')")
ak_svgroot.setAttribute("onmousedown","if(!ak_nachNom && ak_grouping.length<=0) ak_edit_overall('remove')")
ak_clientX=0; ak_clientY=0
ak_svgroot.setAttribute("style","font-family:Arial;font-size:12;font-weight:normal;fill:#000;stroke:none;stroke-width:1;opacity:1;fill-opacity:1;stroke-opacity:1")
try{ak_svgroot.removeAttribute("shape-rendering")}catch(error){}
try{ak_svgroot.removeAttribute("text-rendering")}catch(error){}
try{ak_svgroot.removeAttribute("viewBox")}catch(error){}
try{ak_svgroot.removeAttribute("id")}catch(error){}
var ak_tmp_script=ak_userspace_svg.getElementsByTagName("script")
var ak_tmp_link=""
for(var i=ak_tmp_script.length-1;i>=0;i--)
{
ak_tmp_link=ak_tmp_script.item(i).getAttribute("xlink:href")
if(ak_tmp_link)
{
if(/aks_svgeditor.js$/.test(ak_tmp_link.toLowerCase()))
{
ak_tmp_link=ak_tmp_link.replace(/\//,"\\")
ak_tmp_link=ak_tmp_link.replace(/^\\/,"")
if(/:/.test(ak_tmp_link)) ak_editorfilename=ak_tmp_link
else if(/\\/.test(ak_tmp_link))
{
ak_tmp_link=ak_tmp_link.split("\\")
var ak_tmp_folder=ak_directory.split("\\")
for(var f=0;f<ak_tmp_link.length;)
{
if(ak_tmp_link[0]=="..")
{
ak_tmp_folder.pop()
ak_tmp_link.shift()
}
else break
}
ak_editorfilename=ak_tmp_folder.join("\\")+"\\"+ak_tmp_link.join("\\")
}
else ak_editorfilename=ak_directory+"\\"+ak_tmp_link
break
}
}
}
if(i<ak_tmp_script.length) ak_editorObject=ak_tmp_script.item(i)
if(/\\/.test(ak_editorfilename))
{
ak_editorDir=ak_editorfilename.split("\\")
ak_editorDir.pop()
ak_editorDir=ak_editorDir.join("\\")+"\\"
}
var ak_tmpSys=document.getElementById("ak_variable_system")
var ak_tmp
if(ak_tmpSys && ak_tmpSys.tagName=="text")
{
//x,y,zoom,timeline,grid,color,cache1,cache2,cache3,cache4,toolON
ak_tmp=ak_tmpSys.firstChild.data
if(/\|/.test(ak_tmp))
{
ak_tmp=ak_tmp.split("|")
ak_tmp[0]=parseInt(ak_tmp[0])
ak_tmp[1]=parseInt(ak_tmp[1])
ak_tmp[2]=parseFloat(ak_tmp[2])
ak_tmpSys=false
if(!isNaN(ak_tmp[0])) ak_tmpSys=true
else ak_tmp[0]=0
if(!isNaN(ak_tmp[1])) ak_tmpSys=true
else ak_tmp[1]=0
if(!isNaN(ak_tmp[2]))
{
ak_tmp[2]=ak_round(ak_tmp[2],10000)
if(ak_tmp[2]<0.01) ak_tmp[2]=0.01
else if(ak_tmp[2]>100) ak_tmp[2]=100
ak_tmpSys=true
}
else ak_tmp[2]=1
if(ak_tmpSys)
{
ak_grid_zoom=ak_tmp[2]
ak_grid_pan_x=ak_tmp[0]
ak_grid_pan_y=ak_tmp[1]
document.getElementById("ak_internal_userSpace").setAttribute("transform",("matrix("+ak_grid_zoom+",0,0,"+ak_grid_zoom+","+(ak_xy_etc_shift+ak_grid_pan_x*ak_grid_zoom)+","+(ak_xy_etc_shift+ak_grid_pan_y*ak_grid_zoom)+")"))
ak_userspace_svg.firstChild.setAttribute("style",ak_userspace_svg.firstChild.getAttribute("style"))
ak_write_grid_status(((ak_grid_pan_x*-1)+","+(ak_grid_pan_y*-1)+" | x"+ak_grid_zoom+" | "+ak_grid_on_flag))
}
if(ak_tmp[3]=="timeline") ak_animation_stop_flag=true
if(ak_tmp[5]) ak_setAttribute(ak_noSelection,"fill",ak_set_hex2hue(evt,ak_tmp[5],"get_hex"))
else ak_setAttribute(ak_noSelection,"fill","#e38a16")
ak_set_hex2hue(evt,"fill")
if(ak_tmp[4]=="Grid ON (dark)") ak_grid_on_off(evt,"on_dark")
else if(ak_tmp[4]=="Grid OFF") ak_grid_on_off(evt,"off")
else if(ak_tmp[4]=="Grid OFF (toolbox color)") ak_grid_on_off(evt,"off_color")
else ak_grid_on_off(evt,"on")
if(ak_tmp[6]) ak_setAttribute(ak_colPreFill,"fill",ak_set_hex2hue(evt,ak_tmp[6],"get_hex"))
if(ak_tmp[7]) ak_setAttribute(ak_colPreStroke,"fill",ak_set_hex2hue(evt,ak_tmp[7],"get_hex"))
if(ak_tmp[8]) ak_setAttribute(ak_colCache1,"fill",ak_set_hex2hue(evt,ak_tmp[8],"get_hex"))
if(ak_tmp[9]) ak_setAttribute(ak_colCache2,"fill",ak_set_hex2hue(evt,ak_tmp[9],"get_hex"))
if(ak_tmp[10]=="toolOFF") ak_hide_s_v()
if(ak_tmp[11]=="shortMenu") ak_shortMenu(evt,"short","init")
if(!isNaN(ak_tmp[12])) ak_keySplineX=parseInt((ak_tmp[12]))
if(!isNaN(ak_tmp[13])) ak_keySplineY=parseInt((ak_tmp[13]))
if(!isNaN(ak_tmp[14])) ak_keySplineScale=parseInt((ak_tmp[14]))
}
}
else
{
ak_setAttribute(ak_noSelection,"fill","#e38a16")
ak_set_hex2hue(evt,"fill")
ak_grid_on_off(evt,"on")
}
ak_window_resize(evt,"on_init")
ak_createToolObject()
ak_dirty_flag=false
var ak_tmpNode='<menu><header>Aks SVG Editor Start</header>'
ak_tmpNode+='</menu>'
contextMenu().replaceChild(parseXML(ak_tmpNode,getContextMenu()).firstChild,getContextMenu().firstChild)
ak_check4ASV6(evt)
if(ak_tmp[3]=="timeline")
{
ak_animation_stop_flag=true
setTimeout("ak_init_encodingMenu(evt)",100)
ak_timeline_editor(evt)
}
else
{
setTimeout("ak_init_encodingMenu(evt)",100)
}

// ak_save }catch(error){return}
} 
//########################################################################
var ak_editorfilename="", ak_editorDir="", ak_editorObject=false
var ak_init_eval=new Array
var ak_object2update, ak_object2update_nodeNr
var ak_screen_res=96 // 96dpi
var ak_pt_factor=ak_screen_res/72 // 1Punkt=1/72Inch (1.333 x pt = px)
var ak_pc_factor=ak_screen_res/6 // pica
var ak_em_factor=ak_screen_res/8 // ems
var ak_ex_factor=ak_screen_res/16 // exs
var ak_svg_header="", ak_svg_header2="", ak_header_valid=false
// ############    ######################################################
var ak_context_already=false, ak_StartEntry
function ak_add_context_menu_entry(evt)
{
if(ak_context_already) return
contextMenu().firstChild.appendChild(parseXML('<separator/>',contextMenu()).firstChild)
ak_StartEntry='<item id="ak_start_svg_editor" onactivate="ak_init_editor(evt)">Start AKs SVG Editor</item>'
contextMenu().firstChild.appendChild(parseXML(ak_StartEntry,contextMenu()).firstChild)
ak_context_already=true
}
// ############    ################
function ak_init_header(urlRequestStatus)
{
if(urlRequestStatus.success)
{
try{
ak_svg_header2=(urlRequestStatus.getContent)
ak_svg_header2=ak_svg_header2.substring(0,ak_svg_header2.search(/<svg/))
}
catch(err){ak_svg_header2=''}
ak_header2_valid=true
}
else
{
ak_header2_valid=true
}
}
// ############    ################
function ak_init_userSpace_Feb05(evt)
{
ak_userspace_svg=ak_svgroot.cloneNode(0)
ak_svgroot.setAttribute("x",0)
ak_svgroot.setAttribute("y",0)
ak_svgroot.setAttribute("width",'100%')
ak_svgroot.setAttribute("height",'100%')
ak_svgroot.appendChild(parseXML("<rect id='ak_background_editor' x='0' y='0' width='100%' height='100%' style='fill:#ccd4dd;stroke:none;opacity:1'/>",document).firstChild)
document.getElementById("ak_background_editor").setAttribute("onmousedown","ak_background_editor_action(evt)")
ak_svgroot.appendChild(parseXML("<g id='ak_internal_userSpace' transform='matrix(1,0,0,1,21,21)'/>",document).firstChild)
ak_userspace_g=ak_svgroot.lastChild
ak_userspace_g.setAttribute("onmousedown","ak_clickset_obj2update(evt)")
ak_userspace_g.appendChild(ak_userspace_svg)
var rm_child=ak_svgroot.childNodes.length-2
for (var i=(rm_child-1);i>=0;i--)
{
//ak_svgroot.removeChild(ak_svgroot.getChildNodes.item(0))
ak_userspace_svg.appendChild(ak_svgroot.getChildNodes.item(0))
}
}
// ############    ################
function ak_init_userSpace(evt)
{
ak_userspace_svg=ak_svgroot.cloneNode(1)
ak_svgroot.setAttribute("x",0)
ak_svgroot.setAttribute("y",0)
ak_svgroot.setAttribute("width",'100%')
ak_svgroot.setAttribute("height",'100%')
var rm_child=ak_svgroot.childNodes.length;
for (var i=(rm_child-1);i>=0;i--)
{
ak_svgroot.removeChild(ak_svgroot.getChildNodes.item(0))
}
ak_svg_header=printNode(document).substring(0,printNode(document).search(/<svg/))
ak_svgroot.appendChild(parseXML("<rect id='ak_background_editor' x='0' y='0' width='100%' height='100%' style='fill:#ccd4dd;stroke:none;opacity:1'/>",document).firstChild)
document.getElementById("ak_background_editor").setAttribute("onmousedown","ak_background_editor_action(evt)")
ak_svgroot.appendChild(parseXML("<g id='ak_internal_userSpace' transform='matrix(1,0,0,1,21,21)'/>",document).firstChild)
ak_userspace_g=ak_svgroot.lastChild
ak_userspace_g.setAttribute("onmousedown","ak_clickset_obj2update(evt)")
}
var ak_userspace_g
// ############    ################
function ak_checkDownDisable(evt)
{
var ak_tmpObject
if(/ElementInstance/.test(evt.target) && evt.currentNode!="[object SVGUseElement]") return
else if(/ElementInstance/.test(evt.target)) ak_tmpObject=evt.currentNode
else ak_tmpObject=evt.target
var ak_tmp=ak_tmpObject.getAttribute("onmousedown")
if(ak_tmp && !/^\/\/ak_disable\/\//.test(ak_tmp) && !/^ak_MoveEditRect_flag\=true\;ak_clickset_obj2update\(evt\)\;/.test(ak_tmp))
{
ak_tmpObject.setAttribute("onmousedown","//ak_disable//"+ak_tmp)
}
}
// ############    ################
function ak_init_userSpace2(evt)
{
ak_userspace_svg=ak_svgroot.cloneNode(1)
ak_svgroot.setAttribute("x",0)
ak_svgroot.setAttribute("y",0)
ak_svgroot.setAttribute("width",'100%')
ak_svgroot.setAttribute("height",'100%')
var rm_child=ak_svgroot.childNodes.length;
for (var i=(rm_child-1);i>=0;i--)
{
ak_svgroot.removeChild(ak_svgroot.getChildNodes.item(0))
}
ak_svgroot.appendChild(parseXML("<rect id='ak_background_editor' x='0' y='0' width='100%' height='100%' style='fill:#fff;stroke:none;opacity:0'/>",document).firstChild)
ak_svgroot.appendChild(parseXML("<g id='ak_internal_userSpace' transform='translate(0,0)'/>",document).firstChild)
ak_userspace_g=ak_svgroot.lastChild
ak_svgroot.setAttribute('zoomAndPan','disable')
for (var i=0; i<256; i++) {ak_key_status[i]="up"}
ak_svgroot.setAttribute("onkeydown","ak_key_cancel(evt)")
ak_svgroot.setAttribute("onkeyup","")
ak_svgroot.setAttribute("onmousemove","window.focus(ak_svgroot)")
ak_svgroot.setAttribute("onmouseout","")
ak_svgroot.setAttribute("onmouseover","")
ak_svgroot.setAttribute("onclick","ak_mouse_cancel(evt)")
ak_svgroot.setAttribute("onmouseup","")
ak_clientX=0; ak_clientY=0
try{ak_svgroot.removeAttribute("viewBox")}catch(error){}
try{ak_svgroot.removeAttribute("id")}catch(error){}
ak_userspace_g.appendChild(ak_userspace_svg)
window.focus(ak_svgroot)
}
// ############    ################
function ak_key_cancel(evt)
{
ak_exportAbort=true
//ak_setExport="setExportImageAbort"
//ak_SVGSaver('setExportImageInfo')
}
// ############    ################
function ak_mouse_cancel(evt)
{
evt.preventDefault()
//ak_exportAbort=true
ak_setExport="setExportImageAbort"
ak_SVGSaver('setExportImageInfoErr')
}
// ############    ################
function ak_init_colorMenu(evt)
{
var ak_tmp_length=ak_color_table[0].length
for(var i=0;i<ak_tmp_length;i++)
{
// evtl. menu items
if(/(gray)/.test(ak_color_table[0][i]))
{
var ak_tmp_color_name=ak_color_table[0][i].replace(/(gray)/,"grey")
ak_color_table[0].push(ak_tmp_color_name)
ak_color_table[1].push(ak_color_table[1][i])
}
}
}
// ############    ################
function ak_background_editor_action(evt,woher)
{
if(!ak_menuValid(evt,"mainMenu")) return
if(woher=="right_down_border") ak_pathAddPoint=false
switch(evt.type)
{
case "mousedown":
if (evt.getButton==1 || (ak_key_status[16]=="up" && ak_key_status[17]=="up" && ak_key_status[32]=="down")) ak_MoveEditRect(evt,"down","translate") // pan
else if(ak_menu_status=="timeline")
{
//if(ak_playTrue) ak_timeMain(evt,'Pause')
if(evt.getButton==2) ak_showMenu(evt,'timeCanvas')
}
else if(evt.getButton==2) ak_showMainMenu(evt)
else
{
ak_clickset_obj2update(evt,ak_userspace_svg.firstChild)
ak_cout('no selection!')
}
break
}
}
// ############    ################
function ak_window_resize(evt,on_init)
{
ak_window_innerWidth=window.innerWidth
ak_window_innerHeight=window.innerHeight
var ak_tmpW=ak_window_innerWidth
var ak_tmpH=ak_window_innerHeight
if (ak_window_innerWidth<(69)) ak_tmpW=(69)
if (ak_window_innerHeight<(160+41)) ak_tmpH=(160+67)
document.getElementById("ak_background_status").setAttribute("y",ak_tmpH-21)
document.getElementById("ak_status_border_cover").setAttribute("y",ak_tmpH-21)
document.getElementById("ak_statusGroup").setAttribute("y",ak_tmpH-6)
document.getElementById("ak_background_huebar").setAttribute("x",ak_tmpW-47)
document.getElementById("ak_background_huebar").setAttribute("height",ak_tmpH-42)
ak_frameTop.setAttribute("x2",ak_tmpW-47)
ak_frameRight.setAttribute("x1",ak_tmpW-47)
ak_frameRight.setAttribute("x2",ak_tmpW-47)
ak_frameRight.setAttribute("y2",ak_tmpH-21)
ak_frameBottom.setAttribute("x2",ak_tmpW-47)
ak_frameBottom.setAttribute("y1",ak_tmpH-21)
ak_frameBottom.setAttribute("y2",ak_tmpH-21)
ak_frameLeft.setAttribute("y2",ak_tmpH-21)
if(window.innerWidth<123) ak_topShort.setAttribute("transform","translate(0,0)")
else ak_topShort.setAttribute("transform","translate("+(window.innerWidth-123)+",0)")
document.getElementById("ak_hue_und_sv_bar_g").setAttribute("transform","matrix(1,0,0,1,"+(ak_tmpW-789)+",0)")
document.getElementById("ak_object2status").setAttribute("transform","matrix(0.7,0,0,0.7,3,"+(ak_tmpH-17)+")")
if(ak_menu_status=="timeline")
{
ak_timeline_top=window.innerHeight-(ak_timeline_ystart+ak_timeline_yani+(ak_timeline_count*ak_timeline_anidelta))
if(ak_timeline_top<ak_timeStatus) ak_timeline_top=ak_timeStatus
document.getElementById("ak_timeline_g").setAttribute("transform","translate(0,"+ak_timeline_top+")")
}
}
// ############    ################
function ak_edit_text_attributes(evt,which_attribute,value)
{
switch(which_attribute)
{
case "font-family":
if(value=="remove")
{
ak_SetGetRm_styleValue(ak_object2update,"font-family","remove","no_cout")
break
}
if(value=="set_manual")
{
var ak_tmp_value=ak_SetGetRm_styleValue(ak_object2update,"font-family","get","no_cout")
if(ak_tmp_value=="false") var ak_tmp_value_new=prompt("Enter font-family:","")
else var ak_tmp_value_new=prompt("Enter font-family:",ak_tmp_value)
window.focus(ak_svgroot)
if(ak_tmp_value_new==null) break
ak_tmp_value_new=ak_tmp_value_new.replace(/[^A-Za-z0-9_ ,]/g,"")
ak_SetGetRm_styleValue(ak_object2update,"font-family",ak_tmp_value_new,"no_cout")
break
}
ak_SetGetRm_styleValue(ak_object2update,"font-family",value,"no_cout")
break
case "font-weight":
if(value=="remove")
{
ak_SetGetRm_styleValue(ak_object2update,"font-weight","remove","no_cout")
break
}
ak_SetGetRm_styleValue(ak_object2update,"font-weight",value,"no_cout")
break
case "font-style":
if(value=="remove")
{
ak_SetGetRm_styleValue(ak_object2update,"font-style","remove","no_cout")
break
}
ak_SetGetRm_styleValue(ak_object2update,"font-style",value,"no_cout")
break
case "font-stretch":
if(value=="remove")
{
ak_SetGetRm_styleValue(ak_object2update,"font-stretch","remove","no_cout")
break
}
ak_SetGetRm_styleValue(ak_object2update,"font-stretch",value,"no_cout")
break
case "text-anchor":
if(value=="remove")
{
ak_SetGetRm_styleValue(ak_object2update,"text-anchor","remove","no_cout")
break
}
ak_SetGetRm_styleValue(ak_object2update,"text-anchor",value,"no_cout")
break
case "text-decoration":
if(value=="remove")
{
ak_SetGetRm_styleValue(ak_object2update,"text-decoration","remove","no_cout")
break
}
var ak_tmp_deco=ak_SetGetRm_styleValue(ak_object2update,"text-decoration","get","no_cout")
ak_tmp_deco=ak_tmp_deco.replace(/false/g,"")
switch(value)
{
case "underline":
ak_tmp_deco=ak_tmp_deco.replace(/underline/g,"")
ak_tmp_deco=ak_tmp_deco.replace(/ +/g,",")
ak_tmp_deco=ak_tmp_deco.replace(/,+/g,",")
ak_tmp_deco=ak_tmp_deco.replace(/^,+|,+$/g,"")
if(document.getElementById("ak_tdeco_underline").getAttribute("checked")!="yes")
{
if(ak_tmp_deco=="") ak_tmp_deco=value
else ak_tmp_deco=value+","+ak_tmp_deco
}
break
case "overline":
ak_tmp_deco=ak_tmp_deco.replace(/overline/g,"")
ak_tmp_deco=ak_tmp_deco.replace(/ +/g,",")
ak_tmp_deco=ak_tmp_deco.replace(/,+/g,",")
ak_tmp_deco=ak_tmp_deco.replace(/^,+|,+$/g,"")
if(document.getElementById("ak_tdeco_overline").getAttribute("checked")!="yes")
{
if(ak_tmp_deco=="") ak_tmp_deco=value
else ak_tmp_deco=value+","+ak_tmp_deco
}
break
case "line-through":
ak_tmp_deco=ak_tmp_deco.replace(/line-through/g,"")
ak_tmp_deco=ak_tmp_deco.replace(/ +/g,",")
ak_tmp_deco=ak_tmp_deco.replace(/,+/g,",")
ak_tmp_deco=ak_tmp_deco.replace(/^,+|,+$/g,"")
if(document.getElementById("ak_tdeco_overline").getAttribute("checked")!="yes")
{
if(ak_tmp_deco=="") ak_tmp_deco=value
else ak_tmp_deco=value+","+ak_tmp_deco
}
break
}
if(ak_tmp_deco=="") ak_SetGetRm_styleValue(ak_object2update,"text-decoration","remove","no_cout")
else ak_SetGetRm_styleValue(ak_object2update,"text-decoration",ak_tmp_deco,"no_cout")
break
case "text-rendering":
if(value=="remove")
{
ak_SetGetRm_styleValue(ak_object2update,"text-rendering","remove","no_cout")
break
}
ak_SetGetRm_styleValue(ak_object2update,"text-rendering",value,"no_cout")
break
case "xmlspace":
switch(value)
{
case "remove":
try{ak_object2update.removeAttribute("xml:space")}catch(error){}
break
case "default":
ak_object2update.setAttribute("xml:space",value)
var ak_tmp_clone=parseXML(printNode(ak_object2update),document).firstChild
ak_object2update.parentNode.replaceChild(ak_tmp_clone,ak_object2update)
ak_object2update=ak_tmp_clone
break
case "preserve":
ak_object2update.setAttribute("xml:space",value)
var ak_tmp_clone=parseXML(printNode(ak_object2update),document).firstChild
ak_object2update.parentNode.replaceChild(ak_tmp_clone,ak_object2update)
ak_object2update=ak_tmp_clone
break
}
break
case "kerning":
ak_SetGetRm_styleValue(ak_object2update,"letter-spacing","remove","no_cout")
ak_SetGetRm_styleValue(ak_object2update,"kerning","remove","no_cout")
break
case "word-space":
ak_SetGetRm_styleValue(ak_object2update,"word-spacing","remove","no_cout")
break
}
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
var ak_text_attribute_submenu='<menu><header>font-family:</header>'
ak_text_attribute_submenu+='<item id="ak_ffamily_arial" onactivate="'+"ak_edit_text_attributes(evt,'font-family','Arial')"+'">Arial</item>'
ak_text_attribute_submenu+='<item id="ak_ffamily_century gothic" onactivate="'+"ak_edit_text_attributes(evt,'font-family','Century Gothic')"+'">Century Gothic</item>'
ak_text_attribute_submenu+='<item id="ak_ffamily_comic" onactivate="'+"ak_edit_text_attributes(evt,'font-family','Comic')"+'">Comic</item>'
ak_text_attribute_submenu+='<item id="ak_ffamily_courier" onactivate="'+"ak_edit_text_attributes(evt,'font-family','Courier')"+'">Courier</item>'
ak_text_attribute_submenu+='<item id="ak_ffamily_lucida console" onactivate="'+"ak_edit_text_attributes(evt,'font-family','Lucida Console')"+'">Lucida Console</item>'
ak_text_attribute_submenu+='<item id="ak_ffamily_old english" onactivate="'+"ak_edit_text_attributes(evt,'font-family','Old English')"+'">Old English</item>'
ak_text_attribute_submenu+='<item id="ak_ffamily_times new roman" onactivate="'+"ak_edit_text_attributes(evt,'font-family','Times New Roman')"+'">Times New Roman</item>'
ak_text_attribute_submenu+='<separator/>'
ak_text_attribute_submenu+='<item id="ak_ffamily_set_manual" onactivate="'+"ak_edit_text_attributes(evt,'font-family','set_manual')"+'">set font-family manual</item>'
ak_text_attribute_submenu+='<item id="ak_ffamily_false" onactivate="'+"ak_edit_text_attributes(evt,'font-family','remove')"+'">remove font-family</item>'
ak_text_attribute_submenu+='</menu>'
ak_text_attribute_submenu+='<menu><header>font-weight:</header>'
ak_text_attribute_submenu+='<item id="ak_fweight_normal" onactivate="'+"ak_edit_text_attributes(evt,'font-weight','normal')"+'">normal</item>'
ak_text_attribute_submenu+='<item id="ak_fweight_bold" onactivate="'+"ak_edit_text_attributes(evt,'font-weight','bold')"+'">bold</item>'
ak_text_attribute_submenu+='<separator/>'
ak_text_attribute_submenu+='<item id="ak_fweight_inherit" onactivate="'+"ak_edit_text_attributes(evt,'font-weight','inherit')"+'">inherit</item>'
ak_text_attribute_submenu+='<item id="ak_fweight_false" onactivate="'+"ak_edit_text_attributes(evt,'font-weight','remove')"+'">remove font-weight</item>'
ak_text_attribute_submenu+='</menu>'
ak_text_attribute_submenu+='<menu><header>font-style:</header>'
ak_text_attribute_submenu+='<item id="ak_fstyle_normal" onactivate="'+"ak_edit_text_attributes(evt,'font-style','normal')"+'">normal</item>'
ak_text_attribute_submenu+='<item id="ak_fstyle_italic" onactivate="'+"ak_edit_text_attributes(evt,'font-style','italic')"+'">italic</item>'
ak_text_attribute_submenu+='<item id="ak_fstyle_oblique" onactivate="'+"ak_edit_text_attributes(evt,'font-style','oblique')"+'">oblique</item>'
ak_text_attribute_submenu+='<separator/>'
ak_text_attribute_submenu+='<item id="ak_fstyle_inherit" onactivate="'+"ak_edit_text_attributes(evt,'font-style','inherit')"+'">inherit</item>'
ak_text_attribute_submenu+='<item id="ak_fstyle_false" onactivate="'+"ak_edit_text_attributes(evt,'font-style','remove')"+'">remove font-style</item>'
ak_text_attribute_submenu+='</menu>'
ak_text_attribute_submenu+='<menu><header>font-stretch:</header>'
ak_text_attribute_submenu+='<item id="ak_fstretch_normal" onactivate="'+"ak_edit_text_attributes(evt,'font-stretch','normal')"+'">normal</item>'
ak_text_attribute_submenu+='<separator/>'
ak_text_attribute_submenu+='<item id="ak_fstretch_wider" onactivate="'+"ak_edit_text_attributes(evt,'font-stretch','wider')"+'">wider</item>'
ak_text_attribute_submenu+='<item id="ak_fstretch_semi-expanded" onactivate="'+"ak_edit_text_attributes(evt,'font-stretch','semi-expanded')"+'">semi-expanded</item>'
ak_text_attribute_submenu+='<item id="ak_fstretch_expanded" onactivate="'+"ak_edit_text_attributes(evt,'font-stretch','expanded')"+'">expanded</item>'
ak_text_attribute_submenu+='<item id="ak_fstretch_extra-expanded" onactivate="'+"ak_edit_text_attributes(evt,'font-stretch','extra-expanded')"+'">extra-expanded</item>'
ak_text_attribute_submenu+='<item id="ak_fstretch_ultra-expanded" onactivate="'+"ak_edit_text_attributes(evt,'font-stretch','ultra-expanded')"+'">ultra-expanded</item>'
ak_text_attribute_submenu+='<separator/>'
ak_text_attribute_submenu+='<item id="ak_fstretch_narrower" onactivate="'+"ak_edit_text_attributes(evt,'font-stretch','narrower')"+'">narrower</item>'
ak_text_attribute_submenu+='<item id="ak_fstretch_semi-condensed" onactivate="'+"ak_edit_text_attributes(evt,'font-stretch','semi-condensed')"+'">semi-condensed</item>'
ak_text_attribute_submenu+='<item id="ak_fstretch_condensed" onactivate="'+"ak_edit_text_attributes(evt,'font-stretch','condensed')"+'">condensed</item>'
ak_text_attribute_submenu+='<item id="ak_fstretch_extra-condensed" onactivate="'+"ak_edit_text_attributes(evt,'font-stretch','extra-condensed')"+'">extra-condensed</item>'
ak_text_attribute_submenu+='<item id="ak_fstretch_ultra-condensed" onactivate="'+"ak_edit_text_attributes(evt,'font-stretch','ultra-condensed')"+'">ultra-condensed</item>'
ak_text_attribute_submenu+='<separator/>'
ak_text_attribute_submenu+='<item id="ak_fstretch_inherit" onactivate="'+"ak_edit_text_attributes(evt,'font-stretch','inherit')"+'">inherit</item>'
ak_text_attribute_submenu+='<item id="ak_fstretch_false" onactivate="'+"ak_edit_text_attributes(evt,'font-stretch','remove')"+'">remove font-stretch</item>'
ak_text_attribute_submenu+='</menu>'
ak_text_attribute_submenu+='<menu><header>text-anchor:</header>'
ak_text_attribute_submenu+='<item id="ak_tanchor_start" onactivate="'+"ak_edit_text_attributes(evt,'text-anchor','start')"+'">start</item>'
ak_text_attribute_submenu+='<item id="ak_tanchor_middle" onactivate="'+"ak_edit_text_attributes(evt,'text-anchor','middle')"+'">middle</item>'
ak_text_attribute_submenu+='<item id="ak_tanchor_end" onactivate="'+"ak_edit_text_attributes(evt,'text-anchor','end')"+'">end</item>'
ak_text_attribute_submenu+='<separator/>'
ak_text_attribute_submenu+='<item id="ak_tanchor_false" onactivate="'+"ak_edit_text_attributes(evt,'text-anchor','remove')"+'">remove text-anchor</item>'
ak_text_attribute_submenu+='</menu>'
ak_text_attribute_submenu+='<menu><header>text-decoration:</header>'
ak_text_attribute_submenu+='<item id="ak_tdeco_overline" onactivate="'+"ak_edit_text_attributes(evt,'text-decoration','overline')"+'">overline</item>'
ak_text_attribute_submenu+='<item id="ak_tdeco_line-through" onactivate="'+"ak_edit_text_attributes(evt,'text-decoration','line-through')"+'">line-through</item>'
ak_text_attribute_submenu+='<item id="ak_tdeco_underline" onactivate="'+"ak_edit_text_attributes(evt,'text-decoration','underline')"+'">underline</item>'
ak_text_attribute_submenu+='<separator/>'
ak_text_attribute_submenu+='<item id="ak_tdeco_false" onactivate="'+"ak_edit_text_attributes(evt,'text-decoration','remove')"+'">remove text-decoration</item>'
ak_text_attribute_submenu+='</menu>'
ak_text_attribute_submenu+='<menu><header>text-rendering:</header>'
ak_text_attribute_submenu+='<item id="ak_trender_auto" onactivate="'+"ak_edit_text_attributes(evt,'text-rendering','auto')"+'">auto</item>'
ak_text_attribute_submenu+='<item id="ak_trender_optimizespeed" onactivate="'+"ak_edit_text_attributes(evt,'text-rendering','optimizeSpeed')"+'">optimizeSpeed</item>'
ak_text_attribute_submenu+='<item id="ak_trender_optimizelegibility" onactivate="'+"ak_edit_text_attributes(evt,'text-rendering','optimizeLegibility')"+'">optimizeLegibility</item>'
ak_text_attribute_submenu+='<item id="ak_trender_geometricprecision" onactivate="'+"ak_edit_text_attributes(evt,'text-rendering','geometricPrecision')"+'">geometricPrecision</item>'
ak_text_attribute_submenu+='<separator/>'
ak_text_attribute_submenu+='<item id="ak_trender_false" onactivate="'+"ak_edit_text_attributes(evt,'text-rendering','remove')"+'">remove text-rendering</item>'
ak_text_attribute_submenu+='</menu>'
ak_text_attribute_submenu+='<separator/>'
ak_text_attribute_submenu+='<item id="ak_xmlspace_default" onactivate="'+"ak_edit_text_attributes(evt,'xmlspace','default')"+'">xml:space="default"</item>'
ak_text_attribute_submenu+='<item id="ak_xmlspace_preserve" onactivate="'+"ak_edit_text_attributes(evt,'xmlspace','preserve')"+'">xml:space="preserve"</item>'
ak_text_attribute_submenu+='<item id="ak_xmlspace_false" onactivate="'+"ak_edit_text_attributes(evt,'xmlspace','remove')"+'">remove xml:space</item>'
ak_text_attribute_submenu+='<separator/>'
ak_text_attribute_submenu+='<item id="ak_txkerning_false" onactivate="'+"ak_edit_text_attributes(evt,'kerning','remove')"+'">rm letter-spacing/kerning</item>'
ak_text_attribute_submenu+='<item id="ak_txwordspace_false" onactivate="'+"ak_edit_text_attributes(evt,'word-space','remove')"+'">remove word-spacing</item>'
ak_text_attribute_submenu+='</menu>'
var ak_obj_data=new Array
ak_obj_data[0]=false
var ak_obj_control_scale
var ak_object2update_CTM
var ak_use_object="nix"
var ak_tagName_start=""
var ak_EditArray_work=new Array
var ak_object_mouse_event
var ak_precision=100 // 100 = 1 hundertstel (2 Nachkommastellen)
var ak_use_min, ak_use_max
var ak_edit_gradient_flag=false
var ak_last_fill_url=false, ak_last_stroke_url=false
var ak_no_use_element_flag=true
var ak_last_fill_color, ak_last_stroke_color
//######################################################################################################
var ak_tagNames=new Array("svg","a","g","text","textPath","tspan","tref","line","marker","rect","image","use","symbol","circle","ellipse","path","polyline","polygon")
function ak_getElementsById(evt)
{
if(!ak_menuValid(evt,"ak_getElementsById")) return
if (evt.type=="mousedown" && evt.getButton!=2)
{
document.getElementById("ak_use_right_mouse_button").setAttribute("transform","matrix(1,0,0,1,"+(evt.clientX-25)+","+(evt.clientY+10)+")")
document.getElementById("ak_use_right_mouse_button").setAttribute("style","visibility:visible")
}
else if(evt.type=="mouseup" || evt.type=="mouseout")
{
document.getElementById("ak_use_right_mouse_button").setAttribute("style","visibility:hidden")
}
else if (evt.type=="mousedown" && evt.getButton==2)
{
if(ak_menu_status=="timeline")
{
var ak_tmpNode='<menu><header>AKs SVGEditor editAnimationMenu</header>'
ak_tmpNode+='<item checked="yes" onactivate="ak_main_menu(\'BackFromTimeline\')">Timeline EDITOR</item>'
ak_tmpNode+='</menu>'
contextMenu().replaceChild(parseXML(ak_tmpNode,getContextMenu()).firstChild,getContextMenu().firstChild)
return
}
var ak_tmp_checked=''
if(ak_object2update_nodeNr=="") ak_tmp_checked=' checked="yes"'
var ak_tmp_menu='<menu><header>getElementsByTagName Menu</header><item onactivate="ak_select_nodeNr()"'+ak_tmp_checked+'>&lt;svg'
if(ak_userspace_svg.getId()!="" && ak_userspace_svg.getId()!=null) ak_tmp_menu+=' id="'+ak_userspace_svg.getId()+'"'
else ak_tmp_menu+=' (rootElement)'
ak_tmp_menu+='</item>'
if(ak_idDoubleObject.length>0)
{
ak_tmp_menu+='<menu><header>Check if id\'s unique</header>'
ak_tmp_menu+='<item onactivate="ak_checkIdUniqueArray(evt)">Check if id\'s unique</item>'
ak_tmp_menu+='<separator/>'
var ak_tmpIdNr
for(var i=0;i<ak_idDoubleObject.length;i++)
{
ak_tmpIdNr=ak_which_nodeNr(ak_idDoubleObject[i])
if(ak_tmpIdNr!=-1)
{
var ak_tmp_checked=''
if(ak_tmpIdNr==ak_object2update_nodeNr) ak_tmp_checked=' checked="yes"'
ak_tmp_menu+='<item'+ak_tmp_checked+' onactivate="ak_select_nodeNr('+ak_tmpIdNr+')">&lt;'+ak_idDoubleObject[i].tagName
if(ak_idDoubleObject[i].getId()!="" && ak_idDoubleObject[i].getId()!=null) ak_tmp_menu+=' id="'+ak_idDoubleObject[i].getId()+'"'
ak_tmp_menu+='</item>'
}
}
ak_tmp_menu+='</menu>'
}
else ak_tmp_menu+='<item onactivate="ak_checkIdUniqueArray(evt)">Check if id\'s unique</item>'
ak_tmp_menu+='<separator/>'
for(var i=0;i<ak_tagNames.length;i++)
{
var ak_tmp_nodeList=ak_userspace_svg.getElementsByTagName(ak_tagNames[i])
if(ak_tmp_nodeList.length<=0) ak_tmp_menu+='<item enabled="no">   &lt;'+ak_tagNames[i]+'</item>'
else if(ak_tmp_nodeList.length==1 && ak_tagNames[i]=="rect") ak_tmp_menu+='<item enabled="no">   &lt;'+ak_tagNames[i]+'</item>'
else
{
ak_tmp_menu+='<menu><header>'
if(ak_object2update.tagName()==ak_tagNames[i] && ak_which_nodeNr(ak_object2update)!=-1) ak_tmp_menu+='* '
else ak_tmp_menu+='   '
ak_tmp_menu+='&lt;'+ak_tagNames[i]+'  ('+ak_tmp_nodeList.length+')</header>'
var ak_tmpLength=ak_tmp_nodeList.length
if(ak_tmpLength>30 && !evt.ctrlKey())
{
ak_tmpLength=20
ak_tmp_menu+='<item>use +[Ctrl] for complete list</item><separator/>'
}
for(var i2=0;i2<ak_tmpLength;i2++)
{
var ak_tmp_cache=ak_tmp_menu
try{ // marker zeigt ein item zuviel error
if(ak_tagNames[i]=="rect" && i2==0) i2++
var ak_tmp_nodeNr=ak_which_nodeNr(ak_tmp_nodeList.item(i2))
var ak_tmp_checked=''
if(ak_tmp_nodeNr==ak_object2update_nodeNr) ak_tmp_checked=' checked="yes"'
ak_tmp_menu+='<item'+ak_tmp_checked+' onactivate="ak_select_nodeNr('+ak_tmp_nodeNr+')">&lt;'+ak_tagNames[i]
if(ak_tmp_nodeList.item(i2).getId()!="" && ak_tmp_nodeList.item(i2).getId()!=null) ak_tmp_menu+=' id="'+ak_tmp_nodeList.item(i2).getId()+'"'
ak_tmp_menu+='</item>'
}
catch(err){ak_tmp_menu=ak_tmp_cache}
}
ak_tmp_menu+='</menu>'
}
}
ak_tmp_menu+='</menu>'
contextMenu().replaceChild(parseXML(ak_tmp_menu,getContextMenu()).firstChild,getContextMenu().firstChild)
}
}
//###############################################
function ak_getObject(for_nodeNr)
{
if(for_nodeNr==-1) return ak_userspace_svg.firstChild
if(for_nodeNr=="") return ak_userspace_svg
var ak_tmp_array
try{var ak_tmp_array=for_nodeNr.split(",")}catch(error){return false}
var ak_tmp_eval="var ak_tmp_object=ak_userspace_svg"
for(var i=0;i<ak_tmp_array.length;i++)
{
ak_tmp_eval+=".childNodes.item("+ak_tmp_array[i]+")"
}
try{eval(ak_tmp_eval)}catch(error){return false}
return ak_tmp_object
}
//###############################################
function ak_which_nodeNr(for_object)
{
var ak_tmp_array=new Array
try
{
while(for_object.parentNode.getId!="ak_internal_userSpace")
{
var ak_tmp_sibling=0
while(for_object.previousSibling){for_object=for_object.previousSibling; ak_tmp_sibling++}
ak_tmp_array.push(ak_tmp_sibling)
for_object=for_object.parentNode
}
return ak_tmp_array.reverse().join()
}
catch(error){return -1}
}
//###############################################
function ak_select_nodeNr()
{
var ak_tmp_eval="var ak_tmp_object=ak_userspace_svg"
for(var i=0;i<arguments.length;i++)
{
ak_tmp_eval+=".childNodes.item("+arguments[i]+")"
}
eval(ak_tmp_eval)
if(ak_tmp_object.tagName=="marker")
{
ak_grid_zoom=8
ak_grid_pan_x=5
ak_grid_pan_y=5
document.getElementById("ak_internal_userSpace").setAttribute("transform",("matrix("+ak_grid_zoom+",0,0,"+ak_grid_zoom+","+(21+ak_grid_pan_x*ak_grid_zoom)+","+(21+ak_grid_pan_y*ak_grid_zoom)+")"))
ak_userspace_svg.firstChild.setAttribute("style",ak_userspace_svg.firstChild.getAttribute("style"))
ak_write_grid_status(((ak_grid_pan_x*-1)+","+(ak_grid_pan_y*-1)+" | x"+ak_grid_zoom+" | "+ak_grid_on_flag))
}
ak_clickset_obj2update(evt,ak_tmp_object)
}
//###############################################
function ak_move_nodeNr_before()
{
if(arguments.length<=0) return
var ak_tmp_array=new Array
var ak_tmp_eval="var ak_tmp_move=ak_userspace_svg"
for(var i=0;i<arguments.length;i++)
{
ak_tmp_eval+=".childNodes.item("+arguments[i]+")"
ak_tmp_array.push(arguments[i])
}
eval(ak_tmp_eval)
var ak_tmp_prev_text=ak_tmp_move.previousSibling
var ak_tmp_sibling=ak_tmp_move.previousSibling
while(!/(\[object SVG)/.test(ak_tmp_sibling)){ak_tmp_sibling=ak_tmp_sibling.previousSibling}
ak_tmp_move.parentNode.insertBefore(ak_tmp_move,ak_tmp_sibling)
if(ak_tmp_prev_text=="[object Text]") ak_tmp_move.parentNode.insertBefore(ak_tmp_prev_text,ak_tmp_sibling)
ak_gradient_stop_index=ak_which_nodeNr(ak_tmp_move)
ak_lastFilterIndex=ak_gradient_stop_index
ak_push2undoTrue()
ak_set_gradient_control(evt)
}
//###############################################
function ak_move_nodeNr_behind()
{
if(arguments.length<=0) return
var ak_tmp_array=new Array
var ak_tmp_eval="var ak_tmp_move=ak_userspace_svg"
for(var i=0;i<arguments.length;i++)
{
ak_tmp_eval+=".childNodes.item("+arguments[i]+")"
ak_tmp_array.push(arguments[i])
}
eval(ak_tmp_eval)
var ak_tmp_sibling=ak_tmp_move.nextSibling
while(!/(\[object SVG)/.test(ak_tmp_sibling)){ak_tmp_sibling=ak_tmp_sibling.nextSibling}
var ak_tmp_next_text=ak_tmp_sibling.previousSibling
ak_tmp_move.parentNode.insertBefore(ak_tmp_sibling,ak_tmp_move)
if(ak_tmp_next_text=="[object Text]") ak_tmp_move.parentNode.insertBefore(ak_tmp_next_text,ak_tmp_move)
ak_gradient_stop_index=ak_which_nodeNr(ak_tmp_move)
ak_lastFilterIndex=ak_gradient_stop_index
ak_push2undoTrue()
ak_set_gradient_control(evt)
}
//###############################################
function ak_setAttribute_nodeNr()
{
ak_push2undoTrue()
var ak_tmp_eval="var ak_tmp_set=ak_userspace_svg"
for(var i=2;i<arguments.length;i++){ak_tmp_eval+=".childNodes.item("+arguments[i]+")"}
eval(ak_tmp_eval)
ak_tmp_set.setAttribute(arguments[0],arguments[1])
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
//###############################################
function ak_removeAttribute_nodeNr()
{
ak_push2undoTrue()
var ak_tmp_eval="var ak_tmp_set=ak_userspace_svg"
for(var i=1;i<arguments.length;i++){ak_tmp_eval+=".childNodes.item("+arguments[i]+")"}
eval(ak_tmp_eval)
try{ak_tmp_set.removeAttribute(arguments[0])}catch(error){}
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
//###############################################
var ak_inAttribute=new Array("SourceGraphic","SourceAlpha","BackgroundImage","BackgroundAlpha","FillPaint","StrokePaint")
function ak_edit_feResult()
{
ak_push2undoTrue()
var ak_tmp_eval="var ak_tmp_feNode=ak_userspace_svg"
var ak_tmp_arrayNodeNr=new Array
for(var i=1;i<arguments.length;i++)
{
ak_tmp_eval+=".childNodes.item("+arguments[i]+")"
ak_tmp_arrayNodeNr.push(arguments[i])
}
eval(ak_tmp_eval)
var ak_tmp_feNodeIn=ak_tmp_feNode
if(ak_tmp_feNode.parentNode.tagName!="filter") ak_tmp_feNode=ak_tmp_feNode.parentNode // fuer feMergeNode z.B.
var ak_tmp_count=1
var ak_tmp_array=new Array
var ak_tmp_prev=ak_tmp_feNode.previousSibling
while(ak_tmp_prev.previousSibling)
{
if(/^(\[object SVG)/.test(ak_tmp_prev))
{
if(ak_tmp_prev.tagName==arguments[0]) ak_tmp_count++
var ak_tmp_result=ak_tmp_prev.getAttribute("result")
if(ak_tmp_result!=null && ak_tmp_result.length>0) ak_tmp_array.push(ak_tmp_result)
}
ak_tmp_prev=ak_tmp_prev.previousSibling
}
ak_tmp_array.reverse()
if(arguments[0]=="get_inList")
{
var ak_tmp_returnMenu=""
var ak_tmp_inAttribute=ak_tmp_feNodeIn.getAttribute("in")
for(var i=0;i<ak_inAttribute.length;i++)
{
var ak_tmp_checked=''
if(ak_tmp_inAttribute==ak_inAttribute[i]) ak_tmp_checked=' checked="yes"'
ak_tmp_returnMenu+='<item'+ak_tmp_checked+' onactivate="ak_setAttribute_nodeNr('+"'in','"+ak_inAttribute[i]+"',"+ak_tmp_arrayNodeNr.join()+')">'+ak_inAttribute[i]+'</item>'
}
if(ak_tmp_array.length>0) ak_tmp_returnMenu+='<separator/>'
for(var i=0;i<ak_tmp_array.length;i++)
{
var ak_tmp_checked=''
if(ak_tmp_inAttribute==ak_tmp_array[i]) ak_tmp_checked=' checked="yes"'
ak_tmp_returnMenu+='<item'+ak_tmp_checked+' onactivate="ak_setAttribute_nodeNr('+"'in','"+ak_tmp_array[i]+"',"+ak_tmp_arrayNodeNr.join()+')">'+ak_tmp_array[i]+'</item>'
}
var ak_tmp_checked=''
if(ak_tmp_inAttribute==null || ak_tmp_inAttribute=="") ak_tmp_checked=' checked="yes"'
ak_tmp_returnMenu+='<separator/>'
ak_tmp_returnMenu+='<item'+ak_tmp_checked+' onactivate="ak_removeAttribute_nodeNr('+"'in',"+ak_tmp_arrayNodeNr.join()+')">remove in</item>'
return ak_tmp_returnMenu
}
else if(arguments[0]=="get_in2List")
{
var ak_tmp_returnMenu=""
var ak_tmp_inAttribute=ak_tmp_feNodeIn.getAttribute("in2")
for(var i=0;i<ak_inAttribute.length;i++)
{
var ak_tmp_checked=''
if(ak_tmp_inAttribute==ak_inAttribute[i]) ak_tmp_checked=' checked="yes"'
ak_tmp_returnMenu+='<item'+ak_tmp_checked+' onactivate="ak_setAttribute_nodeNr('+"'in2','"+ak_inAttribute[i]+"',"+ak_tmp_arrayNodeNr.join()+')">'+ak_inAttribute[i]+'</item>'
}
if(ak_tmp_array.length>0) ak_tmp_returnMenu+='<separator/>'
for(var i=0;i<ak_tmp_array.length;i++)
{
var ak_tmp_checked=''
if(ak_tmp_inAttribute==ak_tmp_array[i]) ak_tmp_checked=' checked="yes"'
ak_tmp_returnMenu+='<item'+ak_tmp_checked+' onactivate="ak_setAttribute_nodeNr('+"'in2','"+ak_tmp_array[i]+"',"+ak_tmp_arrayNodeNr.join()+')">'+ak_tmp_array[i]+'</item>'
}
var ak_tmp_checked=''
if(ak_tmp_inAttribute==null || ak_tmp_inAttribute=="") ak_tmp_checked=' checked="yes"'
ak_tmp_returnMenu+='<separator/>'
ak_tmp_returnMenu+='<item'+ak_tmp_checked+' onactivate="ak_removeAttribute_nodeNr('+"'in2',"+ak_tmp_arrayNodeNr.join()+')">remove in2</item>'
return ak_tmp_returnMenu
}
// else set result
var ak_tmp_new_result
switch(ak_tmp_feNode.tagName)
{
case "feBlend": ak_tmp_new_result="blend_"+ak_tmp_count;break
case "feColorMatrix": ak_tmp_new_result="colorMx_"+ak_tmp_count;break
case "feComponentTransfer": ak_tmp_new_result="compTrans_"+ak_tmp_count;break
case "feComposite": ak_tmp_new_result="composite_"+ak_tmp_count;break
case "feConvolveMatrix": ak_tmp_new_result="convolveMx_"+ak_tmp_count;break
case "feDisplacementMap": ak_tmp_new_result="disMap_"+ak_tmp_count;break
case "feFlood": ak_tmp_new_result="flood_"+ak_tmp_count;break
case "feGaussianBlur": ak_tmp_new_result="blur_"+ak_tmp_count;break
case "feImage": ak_tmp_new_result="image_"+ak_tmp_count;break
case "feMerge": ak_tmp_new_result="merge_"+ak_tmp_count;break
case "feMorphology": ak_tmp_new_result="morph_"+ak_tmp_count;break
case "feOffset": ak_tmp_new_result="offset_"+ak_tmp_count;break
case "feTile": ak_tmp_new_result="tile_"+ak_tmp_count;break
case "feTurbulence": ak_tmp_new_result="turbo_"+ak_tmp_count;break
case "feDiffuseLighting": ak_tmp_new_result="difLight_"+ak_tmp_count;break
case "feSpecularLighting": ak_tmp_new_result="specLight_"+ak_tmp_count;break
default: ak_tmp_new_result=ak_tmp_feNode.tagName+"_"+ak_tmp_count
}
var ak_tmp_next=ak_tmp_feNode.nextSibling
while(ak_tmp_next.nextSibling)
{
if(/^(\[object SVG)/.test(ak_tmp_next))
{
var ak_tmp_result=ak_tmp_next.getAttribute("result")
if(ak_tmp_result!=null && ak_tmp_result.length>0) ak_tmp_array.push(ak_tmp_result)
}
ak_tmp_next=ak_tmp_next.nextSibling
}
if((","+ak_tmp_array.join()+",").search((","+ak_tmp_new_result+","))!=-1)
{
ak_tmp_count=1
var ak_tmp_new_result_check=ak_tmp_new_result
while((","+ak_tmp_array.join()+",").search((","+ak_tmp_new_result+","))!=-1)
{
ak_tmp_new_result=ak_tmp_new_result_check+"_"+ak_tmp_count
ak_tmp_count++
}
}
ak_tmp_feNode.setAttribute("result",ak_tmp_new_result)
}
//###############################################
var ak_feImageString="", ak_feImageArguments, ak_feImage=false
var ak_newFilterFlag=false
function ak_add_fe(evt)
{
ak_push2undoTrue()
var ak_tmp_fe=arguments[0]
switch(arguments[0])
{
case "feBlend":
arguments[0]='<feBlend/>'; break
case "feColorMatrix":
arguments[0]='<feColorMatrix type="saturate" values="1"/>'; break
case "feComponentTransfer":
arguments[0]='<feComponentTransfer/>'; break
case "feFuncR":
arguments[0]='<feFuncR type="gamma" amplitude="1" exponent="1" offset="0"/>'; break
case "feFuncG":
arguments[0]='<feFuncG type="gamma" amplitude="1" exponent="1" offset="0"/>'; break
case "feFuncB":
arguments[0]='<feFuncB type="gamma" amplitude="1" exponent="1" offset="0"/>'; break
case "feFuncA":
arguments[0]='<feFuncA type="gamma" amplitude="1" exponent="1" offset="0"/>'; break
case "feComposite":
arguments[0]='<feComposite operator="over"/>'; break
case "feConvolveMatrix":
arguments[0]='<feConvolveMatrix order="3 3" kernelMatrix="1 2 3, 4 5 6, 7 8 9" divisor="" bias="0" targetX="0" targetY="0" edgeMode="duplicate" preserveAlpha="false"/>'; break
case "feDisplacementMap":
arguments[0]='<feDisplacementMap scale="1" xChannelSelector="R" yChannelSelector="R"/>'; break
case "feFlood":
var ak_tmp_color=ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")
arguments[0]='<feFlood style="flood-color:'+ak_tmp_color+'"/>'; break
case "feGaussianBlur":
arguments[0]='<feGaussianBlur stdDeviation="0 0"/>'; break
case "feImageGotoIO":
ak_feImageArguments=new Array
for(var i=0;i<arguments.length;i++){ak_feImageArguments.push(arguments[i])}
ak_feImageArguments[0]="'feImageIO'"
ak_feImage=true
ak_SVGSaver("image")
return
case "feImageGotoIObase64":
ak_feImageArguments=new Array
for(var i=0;i<arguments.length;i++){ak_feImageArguments.push(arguments[i])}
ak_feImageArguments[0]="'feImageIObase64'"
ak_feImage=true
ak_imageBase64=true
ak_SVGSaver("image")
return
case "feImageIO":
case "feImageIObase64":
ak_feImageString=ak_feImageString.replace(/^<feImage xlink:href=\"/,"")
ak_feImageString=ak_feImageString.replace(/\"\/\>$/,"")
arguments[0]='<feImage xlink:href=""/>'
break
case "feImage":
var ak_tmp_file=prompt("Enter Image file-name or id (e.g. #shape_id [!! absolute position]):","")
window.focus(ak_svgroot)
if(!ak_tmp_file) return
ak_tmp_file=ak_tmp_file.replace(/\\/g,"\\\\")
ak_tmp_file=ak_tmp_file.replace(/\'/g,"\\\'")
arguments[0]='<feImage xlink:href="'+ak_tmp_file+'"/>'; break
case "feMerge":
arguments[0]='<feMerge/>'; break
case "feMergeNode":
arguments[0]='<feMergeNode/>'; break
case "feMorphology":
arguments[0]='<feMorphology operator="erode" radius="0 0"/>'; break
case "feOffset":
arguments[0]='<feOffset dx="0" dy="0"/>'; break
case "feTile":
arguments[0]='<feTile/>'; break
case "feTurbulence":
arguments[0]='<feTurbulence seed="0" numOctaves="1" baseFrequency="0.1 0.1" type="turbulence" stitchTiles="noStitch"/>'; break
case "feDiffuseLighting":
case "feDiffuseLightingP":
case "feDiffuseLightingS":
var ak_tmp_color=ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")
arguments[0]='<feDiffuseLighting diffuseConstant="1" surfaceScale="1" style="lighting-color:'+ak_tmp_color+'"/>'; break
case "feSpecularLighting":
case "feSpecularLightingP":
case "feSpecularLightingS":
var ak_tmp_color=ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")
arguments[0]='<feSpecularLighting specularExponent="1" specularConstant="1" surfaceScale="1" style="lighting-color:'+ak_tmp_color+'"/>'; break
case "feDistantLight":
arguments[0]='<feDistantLight azimuth="0" elevation="45"/>'; break
case "fePointLight":
var ak_tmpBBox=ak_getBBox(evt,ak_object2update)
arguments[0]='<fePointLight x="'+Math.round(ak_tmpBBox.x)+'" y="'+Math.round(ak_tmpBBox.x)+'" z="10"/>'; break
case "feSpotLight":
var ak_tmpBBox=ak_getBBox(evt,ak_object2update)
arguments[0]='<feSpotLight x="'+Math.round(ak_tmpBBox.x)+'" y="'+Math.round(ak_tmpBBox.x)+'" z="100%" pointsAtX="100%" pointsAtY="100%" pointsAtZ="0" specularExponent="0" limitingConeAngle="90"/>'; break
}
var ak_tmp_array=new Array
for(var i=0;i<arguments.length;i++){ak_tmp_array.push(arguments[i])}
ak_tmp_array[0]="'"+ak_tmp_array[0]+"'"
eval("ak_gradient_stop_index=ak_addChildNode("+ak_tmp_array.join(",")+")")
ak_lastFilterIndex=ak_gradient_stop_index
if(/^feImageIO/.test(ak_tmp_fe))
{
ak_getObject(ak_gradient_stop_index).setAttribute("xlink:href",ak_feImageString)
ak_tmp_fe="feImage"
}
switch(ak_tmp_fe)
{
case "feBlend":
case "feColorMatrix":
case "feComponentTransfer":
case "feFuncR":
case "feFuncG":
case "feFuncB":
case "feFuncA":
case "feComposite":
case "feConvolveMatrix":
case "feDisplacementMap":
case "feFlood":
case "feGaussianBlur":
case "feImage":
case "feMerge":
case "feMorphology":
case "feOffset":
case "feTile":
case "feTurbulence":
case "feDiffuseLighting":
case "feSpecularLighting":
eval("ak_edit_feResult('"+ak_tmp_fe+"',"+ak_gradient_stop_index+")")
break
case "feDiffuseLightingP":
case "feDiffuseLightingS":
eval("ak_edit_feResult('feDiffuseLighting',"+ak_gradient_stop_index+")")
break
case "feSpecularLightingP":
case "feSpecularLightingS":
eval("ak_edit_feResult('feSpecularLighting',"+ak_gradient_stop_index+")")
break
}
switch(ak_tmp_fe)
{
case "feComponentTransfer":
var ak_tmp_index=ak_gradient_stop_index
eval("ak_gradient_stop_index=ak_addChildNode('"+'<feFuncR type="gamma" amplitude="1" exponent="1" offset="0"/>'+"',"+ak_gradient_stop_index+")")
ak_lastFilterIndex=ak_gradient_stop_index
eval("ak_addChildNode('"+'<feFuncG type="gamma" amplitude="1" exponent="1" offset="0"/>'+"',"+ak_tmp_index+")")
eval("ak_addChildNode('"+'<feFuncB type="gamma" amplitude="1" exponent="1" offset="0"/>'+"',"+ak_tmp_index+")")
eval("ak_addChildNode('"+'<feFuncA type="gamma" amplitude="1" exponent="1" offset="0"/>'+"',"+ak_tmp_index+")")
break
case "feMerge":
eval("ak_addChildNode('"+'<feMergeNode/>'+"',"+ak_gradient_stop_index+")")
eval("ak_gradient_stop_index=ak_addChildNode('"+'<feMergeNode in="SourceGraphic"/>'+"',"+ak_gradient_stop_index+")")
ak_lastFilterIndex=ak_gradient_stop_index
break
case "feDiffuseLighting":
case "feSpecularLighting":
eval("ak_gradient_stop_index=ak_addChildNode('"+'<feDistantLight azimuth="0" elevation="45"/>'+"',"+ak_gradient_stop_index+")")
ak_lastFilterIndex=ak_gradient_stop_index
break
case "feDiffuseLightingP":
case "feSpecularLightingP":
var ak_tmpBBox=ak_getBBox(evt,ak_object2update)
eval("ak_gradient_stop_index=ak_addChildNode('"+'<fePointLight x="'+Math.round(ak_tmpBBox.x+(ak_tmpBBox.width/2))+'" y="'+Math.round(ak_tmpBBox.y+(ak_tmpBBox.height/2))+'" z="25"/>'+"',"+ak_gradient_stop_index+")")
ak_lastFilterIndex=ak_gradient_stop_index
break
case "feDiffuseLightingS":
case "feSpecularLightingS":
var ak_tmpBBox=ak_getBBox(evt,ak_object2update)
eval("ak_gradient_stop_index=ak_addChildNode('"+'<feSpotLight x="'+Math.round(ak_tmpBBox.x+(ak_tmpBBox.width/10))+'" y="'+Math.round(ak_tmpBBox.y+(ak_tmpBBox.height/10))+'" z="25" pointsAtX="'+Math.round(ak_tmpBBox.x+(ak_tmpBBox.width/1.1))+'" pointsAtY="'+Math.round(ak_tmpBBox.y+(ak_tmpBBox.height/1.1))+'" pointsAtZ="0" specularExponent="0" limitingConeAngle="35"/>'+"',"+ak_gradient_stop_index+")")
ak_lastFilterIndex=ak_gradient_stop_index
break
}
ak_gradient_stop_index=ak_lastFilterIndex // ak_click aus ak_edit_feResult entfernt
if(!ak_newFilterFlag) ak_set_gradient_control(evt)
else ak_newFilterFlag=false
}
//###############################################
function ak_addChildNode()
{
var ak_tmp_array=new Array
var ak_tmp_eval="var ak_tmp_feParent=ak_userspace_svg"
var ak_tmp_spaces="\n"
for(var i=1;i<arguments.length;i++)
{
ak_tmp_eval+=".childNodes.item("+arguments[i]+")"
ak_tmp_array.push(arguments[i])
ak_tmp_spaces+="  "
}
eval(ak_tmp_eval)
var ak_tmp_add="<g>"+ak_tmp_spaces+"  "+arguments[0]
if(ak_tmp_feParent.lastChild=="[object Text]")
{
ak_tmp_add+="</g>"
var ak_tmp_addList=parseXML(ak_tmp_add,document).firstChild.childNodes
for(var i=0;i<ak_tmp_addList.length;)
{
ak_tmp_feParent.insertBefore(ak_tmp_addList.item(0),ak_tmp_feParent.lastChild)
}
}
else
{
ak_tmp_add+=ak_tmp_spaces+"</g>"
var ak_tmp_addList=parseXML(ak_tmp_add,document).firstChild.childNodes
for(var i=0;i<ak_tmp_addList.length;)
{
ak_tmp_feParent.appendChild(ak_tmp_addList.item(0))
}
}
return ak_which_nodeNr(ak_tmp_feParent.lastChild.previousSibling)
}
//###############################################
function ak_change_fe(fe2change,objectToReplace)
{
var ak_tmp_string
switch(fe2change)
{
case "identity":
ak_tmp_string='<'+objectToReplace.tagName+' type="identity"/>'
break
case "table":
ak_tmp_string='<'+objectToReplace.tagName+' type="table" tableValues="1 2 3"/>'
break
case "discrete":
ak_tmp_string='<'+objectToReplace.tagName+' type="discrete" tableValues="1 2 3"/>'
break
case "linear":
ak_tmp_string='<'+objectToReplace.tagName+' type="linear" slope="1" intercept="0"/>'
break
case "gamma":
ak_tmp_string='<'+objectToReplace.tagName+' type="gamma" amplitude="1" exponent="1"  offset="0"/>'
break
default: return
}
ak_replaceChildNode(ak_tmp_string,objectToReplace)
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
ak_check4animates()
}
//###############################################
function ak_replaceChildNode(newChildString,objectToReplace)
{
objectToReplace.parentNode.replaceChild(parseXML(newChildString,document).firstChild,objectToReplace)
}
//###############################################
var ak_noClick=false
function ak_delete_nodeNr()
{
if(arguments.length<=0) return
ak_gradient_stop_index=-1
var ak_tmp_array=new Array
var ak_tmp_eval="var ak_tmp_delete=ak_userspace_svg"
for(var i=0;i<arguments.length;i++)
{
ak_tmp_eval+=".childNodes.item("+arguments[i]+")"
ak_tmp_array.push(arguments[i])
}
eval(ak_tmp_eval)
if(/Light$/.test(ak_tmp_delete.tagName) && /Lighting$/.test(ak_tmp_delete.parentNode.tagName)) ak_tmp_delete=ak_tmp_delete.parentNode
var ak_tmp_prev=ak_tmp_delete.previousSibling()
ak_tmp_delete.parentNode.removeChild(ak_tmp_delete)
if(ak_tmp_prev=="[object Text]") ak_tmp_prev.parentNode.removeChild(ak_tmp_prev)
if(ak_tmp_array.join(",")==ak_object2update_nodeNr) ak_select_nodeNr(0)
else if(!ak_noClick) ak_set_gradient_control(evt)
ak_noClick=false
}
//###############################################
function ak_show_svgRootMenu(evt)
{
if(!ak_menuValid(evt,"ElementTree")) return
if (evt.type=="mousedown" && evt.getButton==2)
{
if(ak_menu_status=="timeline")
{
var ak_tmpNode='<menu><header>AKs SVGEditor editAnimationMenu</header>'
ak_tmpNode+='<item checked="yes" onactivate="ak_main_menu(\'BackFromTimeline\')">Timeline EDITOR</item>'
ak_tmpNode+='</menu>'
contextMenu().replaceChild(parseXML(ak_tmpNode,getContextMenu()).firstChild,getContextMenu().firstChild)
}
else contextMenu().replaceChild(parseXML(ak_get_childMenu2(true,ak_userspace_svg),getContextMenu()).firstChild,getContextMenu().firstChild)
//else contextMenu().replaceChild(parseXML(ak_get_childMenu(true),getContextMenu()).firstChild,getContextMenu().firstChild)
return
}
if (evt.type=="mousedown" && evt.getButton!=2)
{
document.getElementById("ak_use_right_mouse_button").setAttribute("transform","matrix(1,0,0,1,"+(evt.clientX-25)+","+(evt.clientY+10)+")")
document.getElementById("ak_use_right_mouse_button").setAttribute("style","visibility:visible")
}
if(evt.type=="mouseup" || evt.type=="mouseout")
{
document.getElementById("ak_use_right_mouse_button").setAttribute("style","visibility:hidden")
}
}
//###############################################
var ak_idDouble=new Array
var ak_idDoubleObject=new Array
function ak_checkIdUniqueArray(evt)
{
ak_idUnique=new Array
ak_idUniqueObject=new Array
ak_setIdUniqueArray(true,ak_userspace_svg)
ak_idDouble=new Array
ak_idDoubleObject=new Array
var ak_tmpId, ak_tmpFlag, ak_tmpFlag2
for(var i=0;i<(ak_idUnique.length-1);i++)
{
ak_tmpId=ak_idUnique[i]
ak_tmpFlag=true
for(var iB=(i+1);iB<ak_idUnique.length;iB++)
{
if(ak_tmpId==ak_idUnique[iB])
{
if(ak_tmpFlag)
{
ak_tmpFlag=false
ak_tmpFlag2=true
for(var iC=0;iC<ak_idDoubleObject.length;iC++)
{
if(ak_which_nodeNr(ak_idDoubleObject[iC])==ak_which_nodeNr(ak_idUniqueObject[i]))
{
ak_tmpFlag2=false
break
}
}
if(ak_tmpFlag2) ak_idDoubleObject.push(ak_idUniqueObject[i])
}
ak_tmpFlag2=true
for(var iC=0;iC<ak_idDoubleObject.length;iC++)
{
if(ak_which_nodeNr(ak_idDoubleObject[iC])==ak_which_nodeNr(ak_idUniqueObject[iB]))
{
ak_tmpFlag2=false
break
}
}
if(ak_tmpFlag2) ak_idDoubleObject.push(ak_idUniqueObject[iB])
if((";"+ak_idDouble.join(";")+";").search((";"+ak_tmpId+";"))==-1) ak_idDouble.push(ak_tmpId)
break
}
}
}
if(ak_idDouble.length>0)
{
ak_alert("Following id\'s not unique! Select\nwithin getElementsByTagName-Menu:\n -> "+ak_idDouble.join("\n -> "))
}
else ak_alert("All id\'s unique!")
}
//###############################################
var ak_idUnique=new Array
var ak_idUniqueObject=new Array
function ak_setIdUniqueArray(flag1,ak_tmp_object)
{
if(!/^(\[object SVG)/.test(ak_tmp_object)) return
var ak_tmp_nodeNr=ak_which_nodeNr(ak_tmp_object)
if(ak_tmp_nodeNr=="0") return "" // dann grid
var ak_tmpNode
if(!ak_tmp_object.hasChildNodes)
{
if(ak_tmp_object.getId()!="" && ak_tmp_object.getId()!=null)
{
ak_idUnique.push(ak_tmp_object.getId())
ak_idUniqueObject.push(ak_tmp_object)
}
return
}
var ak_tmp_childs=ak_tmp_object.childNodes.length
var ak_childNode_flag=false
for(var i=0;i<ak_tmp_childs;i++)
{
if(/^(\[object SVG)/.test(ak_tmp_object.childNodes.item(i))) {ak_childNode_flag=true; break}
}
if(!ak_childNode_flag)
{
if(ak_tmp_object.getId()!="" && ak_tmp_object.getId()!=null)
{
ak_idUnique.push(ak_tmp_object.getId())
ak_idUniqueObject.push(ak_tmp_object)
}
return
}
if(ak_tmp_object.getId()!="" && ak_tmp_object.getId()!=null)
{
ak_idUnique.push(ak_tmp_object.getId())
ak_idUniqueObject.push(ak_tmp_object)
}
for(var i=0;i<ak_tmp_childs;i++)
{
ak_setIdUniqueArray(true,ak_tmp_object.childNodes.item(i))
}
return
}
//###############################################
function ak_get_childMenu2(flag1,ak_tmp_object)
{
if(!/^(\[object SVG)/.test(ak_tmp_object)) return ""
var ak_tmp_nodeNr=ak_which_nodeNr(ak_tmp_object)
if(ak_tmp_nodeNr=="0") return "" // dann grid
var ak_tmpNode=""
var ak_tmpId=ak_tmp_object.getId()
if(!ak_tmp_object.hasChildNodes)
{
//if(!flag1) return ''
ak_tmpNode='<item'
if(ak_tmp_nodeNr==ak_object2update_nodeNr) ak_tmpNode+=' checked="yes"'
if(/^script/.test(ak_tmp_object.tagName)) ak_tmpNode+=' enabled="no"'
ak_tmpNode+=' onactivate="ak_select_nodeNr('+ak_tmp_nodeNr+')">   &lt;'+ak_tmp_object.tagName
if(ak_tmpId!="" && ak_tmpId!=null) ak_tmpNode+=' id="'+ak_tmpId+'"</item>'
else ak_tmpNode+='</item>'
return ak_tmpNode
}
var ak_tmp_childs=ak_tmp_object.childNodes.length, ak_tmpMenu=""
for(var i=0;i<ak_tmp_childs;i++)
{
ak_tmpNode+=ak_get_childMenu2(true,ak_tmp_object.childNodes.item(i))
}
if(!ak_tmpNode)
{
ak_tmpNode='<item'
if(ak_tmp_nodeNr==ak_object2update_nodeNr) ak_tmpNode+=' checked="yes"'
if(/^script/.test(ak_tmp_object.tagName)) ak_tmpNode+=' enabled="no"'
ak_tmpNode+=' onactivate="ak_select_nodeNr('+ak_tmp_nodeNr+')">   &lt;'+ak_tmp_object.tagName
if(ak_tmpId!="" && ak_tmpId!=null) ak_tmpNode+=' id="'+ak_tmpId+'"</item>'
else ak_tmpNode+='</item>'
return ak_tmpNode
}
ak_tmpMenu='<menu><header>'
if(flag1)
{
eval("var ak_tmp_in_flag=/^("+ak_tmp_nodeNr+",)/.test(ak_object2update_nodeNr)")
if(ak_tmp_nodeNr==ak_object2update_nodeNr) ak_tmp_in_flag=true
if(ak_tmp_in_flag) ak_tmpMenu+='* '
else ak_tmpMenu+='   '
}
ak_tmpMenu+="&lt;"+ak_tmp_object.tagName
if(ak_tmpId!="" && ak_tmpId!=null) ak_tmpMenu+=' id="'+ak_tmpId+'"</header>'
else ak_tmpMenu+='</header>'
if(flag1)
{
ak_tmpMenu+='<item'
if(ak_tmp_nodeNr==ak_object2update_nodeNr) ak_tmpMenu+=' checked="yes"'
if(/^script/.test(ak_tmp_object.tagName)) ak_tmpMenu+=' enabled="no"'
ak_tmpMenu+=' onactivate="ak_select_nodeNr('+ak_tmp_nodeNr+')">   &lt;'+ak_tmp_object.tagName
if(ak_tmpId!="" && ak_tmpId!=null) ak_tmpMenu+=' id="'+ak_tmpId+'"</item>'
else ak_tmpMenu+='</item>'
ak_tmpMenu+='<separator/>'
}
ak_tmpNode=ak_tmpMenu+ak_tmpNode+"</menu>"
return ak_tmpNode
}
//###############################################
function ak_get_childMenu()
{
var ak_tmp_object
var ak_tmp_eval="ak_tmp_object=ak_userspace_svg"
for(var i=1;i<arguments.length;i++)
{
ak_tmp_eval+=".childNodes.item("+arguments[i]+")"
}
eval(ak_tmp_eval)
if(!/^(\[object SVG)/.test(ak_tmp_object)) return ""
if(!ak_tmp_object.hasChildNodes)
{
if(!arguments[0]) return ''
try{var ak_tmp_tagName=ak_tmp_object.tagName()}catch(error){return ''}
var ak_tmp_nodeNr=ak_which_nodeNr(ak_tmp_object)
if(ak_tmp_nodeNr==0) return "" // dann grid
var ak_tmp_checked=''
if(ak_tmp_nodeNr==ak_object2update_nodeNr) ak_tmp_checked=' checked="yes"'
//script
if(/^script/.test(ak_tmp_object.tagName())) ak_tmp_checked+=' enabled="no"'
var ak_tmp_item='<item'+ak_tmp_checked+' onactivate="ak_select_nodeNr('+ak_tmp_nodeNr+')">   &lt;'+ak_tmp_tagName
if(/^(feMergeNode)/.test(ak_tmp_object.tagName()))
{if(ak_tmp_object.getAttribute("in")!="" && ak_tmp_object.getAttribute("in")!=null) ak_tmp_item+=' in="'+ak_tmp_object.getAttribute("in")+'"'}
else if(/^(fe)/.test(ak_tmp_object.tagName()))
{if(ak_tmp_object.getAttribute("result")!="" && ak_tmp_object.getAttribute("result")!=null) ak_tmp_item+=' result="'+ak_tmp_object.getAttribute("result")+'"'}
else {if(ak_tmp_object.getId()!="" && ak_tmp_object.getId()!=null) ak_tmp_item+=' id="'+ak_tmp_object.getId()+'"'}
ak_tmp_item+='</item>'
return ak_tmp_item
}
var ak_tmp_childs=ak_tmp_object.childNodes.length
var ak_childNode_flag=false
for(var i=0;i<ak_tmp_childs;i++)
{
if(/^(\[object SVG)/.test(ak_tmp_object.childNodes.item(i))) {ak_childNode_flag=true; break}
}
if(!ak_childNode_flag)
{
if(!arguments[0]) return ''
try{var ak_tmp_tagName=ak_tmp_object.tagName()}catch(error){return ''}
var ak_tmp_nodeNr=ak_which_nodeNr(ak_tmp_object)
var ak_tmp_checked=''
if(ak_tmp_nodeNr==ak_object2update_nodeNr) ak_tmp_checked=' checked="yes"'
//script
if(/^script/.test(ak_tmp_object.tagName())) ak_tmp_checked+=' enabled="no"'
var ak_tmp_item='<item'+ak_tmp_checked+' onactivate="ak_select_nodeNr('+ak_tmp_nodeNr+')">   &lt;'+ak_tmp_tagName
if(/^(feMergeNode)/.test(ak_tmp_object.tagName()))
{if(ak_tmp_object.getAttribute("in")!="" && ak_tmp_object.getAttribute("in")!=null) ak_tmp_item+=' in="'+ak_tmp_object.getAttribute("in")+'"'}
else if(/^(fe)/.test(ak_tmp_object.tagName()))
{if(ak_tmp_object.getAttribute("result")!="" && ak_tmp_object.getAttribute("result")!=null) ak_tmp_item+=' result="'+ak_tmp_object.getAttribute("result")+'"'}
else {if(ak_tmp_object.getId()!="" && ak_tmp_object.getId()!=null) ak_tmp_item+=' id="'+ak_tmp_object.getId()+'"'}
ak_tmp_item+='</item>'
return ak_tmp_item
}
var ak_tmp_nodeNr=ak_which_nodeNr(ak_tmp_object)+""
var ak_tmp_menu='<menu><header>'
eval("var ak_tmp_in_flag=/^("+ak_tmp_nodeNr+",)/.test(ak_object2update_nodeNr)")
if(ak_tmp_nodeNr==ak_object2update_nodeNr) ak_tmp_in_flag=true
if(arguments[0])
{
if(ak_tmp_in_flag) ak_tmp_menu+='* '
else ak_tmp_menu+='   '
}
ak_tmp_menu+="&lt;"+ak_tmp_object.tagName()
if(/^(fe)/.test(ak_tmp_object.tagName()))
{if(ak_tmp_object.getAttribute("result")!="" && ak_tmp_object.getAttribute("result")!=null) ak_tmp_menu+=' result="'+ak_tmp_object.getAttribute("result")+'"'}
else if(ak_tmp_object.getId()!="" && ak_tmp_object.getId()!=null) ak_tmp_menu+=' id="'+ak_tmp_object.getId()+'"'
ak_tmp_menu+='</header>'
if(arguments[0])
{
var ak_tmp_checked=''
if(ak_tmp_nodeNr==ak_object2update_nodeNr) ak_tmp_checked=' checked="yes"'
ak_tmp_menu+='<item'+ak_tmp_checked+' onactivate="ak_select_nodeNr('+ak_tmp_nodeNr+')">&lt;'+ak_tmp_object.tagName()
if(/^(fe)/.test(ak_tmp_object.tagName()))
{if(ak_tmp_object.getAttribute("result")!="" && ak_tmp_object.getAttribute("result")!=null) ak_tmp_menu+=' result="'+ak_tmp_object.getAttribute("result")+'"'}
else
{
if(ak_tmp_object.getId()!="" && ak_tmp_object.getId()!=null) ak_tmp_menu+=' id="'+ak_tmp_object.getId()+'"'
else if(ak_tmp_nodeNr=="") ak_tmp_menu+=' (rootElement)'
}
ak_tmp_menu+='</item><separator/>'
}
for(var i=0;i<ak_tmp_childs;i++)
{
if(ak_tmp_nodeNr=="") eval("ak_tmp_menu+=ak_get_childMenu(true"+","+i+")")
else eval("ak_tmp_menu+=ak_get_childMenu(true"+","+ak_tmp_nodeNr+","+i+")")
}
ak_tmp_menu+="</menu>"
return ak_tmp_menu
}
//######################################################################################################
var ak_undo_enabled=true
var ak_push2undo=false
var ak_undo_length=5
var ak_temporary_undo
var ak_temporary_nodeNr=-1
var ak_undo_array=new Array
var ak_undo_array_nodeNr=new Array
var ak_redo_array=new Array
var ak_redo_array_nodeNr=new Array
var ak_undoVar_array=new Array, ak_redoVar_array=new Array, ak_tempory_undoVar=new Array
//###################################
function ak_undoFunction(action)
{
if(action=='enable')
{
ak_undo_enabled=true
ak_append2undo()
return
}
if(action=='enableUndo')
{
ak_undo_enabled=true
if(ak_push2undo)
{
ak_doUndo()
}
return
}
if(action=='disable')
{
ak_undo_enabled=true
ak_add2undo()
ak_undo_enabled=false
if(!ak_autoMode)
{
ak_redo_array=new Array
ak_redo_array_nodeNr=new Array
ak_redoVar_array=new Array
}
return
}
if(action=='disableAppend')
{
ak_undo_enabled=true
ak_append2undo()
ak_undo_enabled=false
if(!ak_autoMode)
{
ak_redo_array=new Array
ak_redo_array_nodeNr=new Array
ak_redoVar_array=new Array
}
return
}
if(action=='clearUndo')
{
ak_undo_array=new Array
ak_undo_array_nodeNr=new Array
ak_undoVar_array=new Array
ak_redo_array=new Array
ak_redo_array_nodeNr=new Array
ak_redoVar_array=new Array
}
}
//###################################
function ak_undo(refresh)
{
if(!ak_undo_enabled) return
if(ak_temporary_nodeNr==ak_which_nodeNr(ak_object2update) && !refresh) return
if(ak_push2undo)
{
ak_dirty_flag=true
ak_push2undo=false
ak_undo_array.push(ak_temporary_undo)
ak_undoVariables('pushTmp2Undo')
ak_undo_array_nodeNr.push(ak_temporary_nodeNr)
while(ak_undo_array_nodeNr.length>ak_undo_length) {ak_undo_array.shift(); ak_undo_array_nodeNr.shift()}
}
ak_temporary_nodeNr=ak_which_nodeNr(ak_object2update)
ak_temporary_undo=ak_userspace_svg.cloneNode(1)
ak_undoVariables('tmpSet')
}
//###################################
function ak_add2undo()
{
if(!ak_undo_enabled) return
if(ak_push2undo)
{
ak_undo_array.push(ak_temporary_undo)
ak_undoVariables('pushTmp2Undo')
ak_undo_array_nodeNr.push(ak_temporary_nodeNr)
ak_temporary_nodeNr=ak_which_nodeNr(ak_object2update)
ak_temporary_undo=ak_userspace_svg.cloneNode(1)
ak_undoVariables('tmpSet')
}
ak_undo_array.push(ak_userspace_svg.cloneNode(1))
ak_undoVariables('push2Undo')
ak_undo_array_nodeNr.push(ak_which_nodeNr(ak_object2update))
while(ak_undo_array_nodeNr.length>ak_undo_length) {ak_undo_array.shift(); ak_undo_array_nodeNr.shift()}
ak_dirty_flag=true
ak_push2undo=false
ak_redo_array=new Array
ak_redo_array_nodeNr=new Array
}
//###################################
function ak_append2undo()
{
if(!ak_undo_enabled) return
if(ak_push2undo)
{
ak_dirty_flag=true
ak_push2undo=false
ak_undo_array.push(ak_temporary_undo)
ak_undoVariables('pushTmp2Undo')
ak_undo_array_nodeNr.push(ak_temporary_nodeNr)
while(ak_undo_array_nodeNr.length>ak_undo_length) {ak_undo_array.shift(); ak_undo_array_nodeNr.shift()}
}
ak_temporary_nodeNr=ak_which_nodeNr(ak_object2update)
ak_temporary_undo=ak_userspace_svg.cloneNode(1)
ak_undoVariables('tmpSet')
}
//###################################
var ak_dirty_flag=false
function ak_push2undoTrue()
{
if(ak_autoMode) ak_push2undo=true
if(!ak_undo_enabled) return
ak_redo_array=new Array
ak_redo_array_nodeNr=new Array
ak_redoVar_array=new Array
ak_dirty_flag=true
ak_push2undo=true
}
//###################################
function ak_doUndo()
{
if(ak_autoMode) {ak_animate_auto("autoCancel");return}
if(!ak_undo_enabled) return
var ak_tmp_status=ak_edit_gradient_flag
var ak_tmp_on=ak_color_action_on
if(ak_push2undo)
{
ak_dirty_flag=true
ak_undoVariables('doTmpUndo')
ak_redo_array.push(ak_userspace_svg.cloneNode(1))
ak_redo_array_nodeNr.push(ak_which_nodeNr(ak_object2update))
ak_userspace_g.replaceChild(ak_temporary_undo,ak_userspace_svg)
ak_userspace_svg=ak_userspace_g.firstChild
ak_clickset_obj2update(evt,ak_getObject(ak_temporary_nodeNr))
ak_check4animates()
}
else if(ak_undo_array_nodeNr.length>0)
{
ak_dirty_flag=true
ak_undoVariables('doUndo')
ak_redo_array.push(ak_userspace_svg.cloneNode(1))
ak_redo_array_nodeNr.push(ak_which_nodeNr(ak_object2update))
ak_userspace_g.replaceChild(ak_undo_array.pop(),ak_userspace_svg)
ak_userspace_svg=ak_userspace_g.firstChild
ak_clickset_obj2update(evt,ak_getObject(ak_undo_array_nodeNr.pop()))
ak_check4animates()
}
else
{
ak_tagName_cout="No UNDO anymore!"
ak_transform_cout="No UNDO anymore!"
ak_cout(ak_tagName_cout)
}
ak_push2undo=false
ak_temporary_nodeNr=ak_which_nodeNr(ak_object2update)
ak_temporary_undo=ak_userspace_svg.cloneNode(1)
ak_undoVariables('tmpSet')
ak_grouping=new Array
ak_gr_index=new Array
if(ak_temporary_nodeNr==-1) ak_deselect(evt)
}
//###################################
var ak_undoWhat=new Array('ak_valueNr','ak_autoMode','ak_multiName')
function ak_undoVariables(what)
{
if(what=='doUndo')
{
ak_redoVar_array.push(new Array(ak_valueNr, ak_autoMode, ak_multiName))
ak_valueNr=ak_undoVar_array[ak_undoVar_array.length-1][0]
ak_autoMode=ak_undoVar_array[ak_undoVar_array.length-1][1]
ak_multiName=ak_undoVar_array[ak_undoVar_array.length-1][2]
ak_undoVar_array.pop()
}
else if(what=='doTmpUndo')
{
ak_redoVar_array.push(new Array(ak_valueNr, ak_autoMode, ak_multiName))
ak_valueNr=ak_tempory_undoVar[0]
ak_autoMode=ak_tempory_undoVar[1]
ak_multiName=ak_tempory_undoVar[2]
}
else if(what=='doRedo')
{
ak_undoVar_array.push(new Array(ak_valueNr, ak_autoMode, ak_multiName))
ak_valueNr=ak_redoVar_array[ak_redoVar_array.length-1][0]
ak_autoMode=ak_redoVar_array[ak_redoVar_array.length-1][1]
ak_multiName=ak_redoVar_array[ak_redoVar_array.length-1][2]
ak_redoVar_array.pop()
}
else if(what=='tmpSet')
{
ak_tempory_undoVar=new Array(ak_valueNr, ak_autoMode, ak_multiName)
}
else if(what=='push2Undo')
{
ak_undoVar_array.push(new Array(ak_valueNr, ak_autoMode, ak_multiName))
while(ak_undoVar_array.length>ak_undo_length) {ak_undoVar_array.shift()}
}
else if(what=='pushTmp2Undo')
{
ak_undoVar_array.push(ak_tempory_undoVar)
while(ak_undoVar_array.length>ak_undo_length) {ak_undoVar_array.shift()}
}
//ak_valueNr=-1
}
//###################################
function ak_doRedo()
{
if(!ak_undo_enabled) return
var ak_tmp_status=ak_edit_gradient_flag
var ak_tmp_on=ak_color_action_on
if(ak_redo_array_nodeNr.length<=0)
{
ak_tagName_cout="No REDO anymore!"
ak_transform_cout="No REDO anymore!"
ak_cout(ak_tagName_cout)
return
}
ak_dirty_flag=true
ak_undo_array.push(ak_userspace_svg.cloneNode(1))
ak_undoVariables('push2Undo')
ak_undo_array_nodeNr.push(ak_which_nodeNr(ak_object2update))
while(ak_undo_array_nodeNr.length>ak_undo_length) {ak_undo_array.shift(); ak_undo_array_nodeNr.shift()}
ak_userspace_g.replaceChild(ak_redo_array.pop(),ak_userspace_svg)
ak_userspace_svg=ak_userspace_g.firstChild
ak_undoVariables('doRedo')
ak_clickset_obj2update(evt,ak_getObject(ak_redo_array_nodeNr.pop()))
ak_check4animates()
ak_push2undo=false
ak_temporary_nodeNr=ak_which_nodeNr(ak_object2update)
ak_temporary_undo=ak_userspace_svg.cloneNode(1)
ak_undoVariables('tmpSet')
}
//###################################
function ak_getPixel(object,attribute)
{
return ak_getAbsolutePixel(object,attribute)
}
//###################################
function ak_getAbsolutePixel(string,attribute,width,height)
{
var ak_tmp_in, ak_tmp_width, ak_tmp_height
if(/^\[object SVG/.test(string))
{// dann object
ak_tmp_in=string.getAttribute(attribute)
ak_tmp_width=window.innerWidth
ak_tmp_height=window.innerHeight
}
else
{
ak_tmp_in=string
ak_tmp_width=ak_parentSVG_width
ak_tmp_height=ak_parentSVG_height
if(width) ak_tmp_width=width
if(height) ak_tmp_height=height
}
ak_tmp_in=ak_tmp_in.replace(/^ +| +$/g,'')
if(/\d$/.test(ak_tmp_in))
{
ak_tmp_in=parseFloat(ak_tmp_in)
if(isNaN(ak_tmp_in)) ak_tmp_in=0
}
else if(/\%$/.test(ak_tmp_in))
{        
ak_tmp_in=parseFloat(ak_tmp_in)
if(isNaN(ak_tmp_in)) ak_tmp_in=0
if(/x/.test(attribute) || /width/.test(attribute)) ak_tmp_in=ak_round(((ak_tmp_in*ak_tmp_width)/100),ak_precision)
else ak_tmp_in=ak_round(((ak_tmp_in*ak_tmp_height)/100),ak_precision)
}
else if(/in$/.test(ak_tmp_in))
{
ak_tmp_in=parseFloat(ak_tmp_in)
if(isNaN(ak_tmp_in)) ak_tmp_in=0
else ak_tmp_in*=ak_screen_res
}
else if(/mm$/.test(ak_tmp_in))
{
ak_tmp_in=parseFloat(ak_tmp_in)
if(isNaN(ak_tmp_in)) ak_tmp_in=0
else ak_tmp_in*=ak_screen_res/25.4
}
else if(/cm$/.test(ak_tmp_in))
{
ak_tmp_in=parseFloat(ak_tmp_in)
if(isNaN(ak_tmp_in)) ak_tmp_in=0
else ak_tmp_in*=ak_screen_res/2.54
}
else if(/pt$/.test(ak_tmp_in))
{
ak_tmp_in=parseFloat(ak_tmp_in)
if(isNaN(ak_tmp_in)) ak_tmp_in=0
else ak_tmp_in*=ak_pt_factor
}
else if(/pc$/.test(ak_tmp_in))
{
ak_tmp_in=parseFloat(ak_tmp_in)
if(isNaN(ak_tmp_in)) ak_tmp_in=0
else ak_tmp_in*=ak_pc_factor
}
else if(/em$/.test(ak_tmp_in))
{
ak_tmp_in=parseFloat(ak_tmp_in)
if(isNaN(ak_tmp_in)) ak_tmp_in=0
else ak_tmp_in*=ak_em_factor
}
else if(/ex$/.test(ak_tmp_in))
{
ak_tmp_in=parseFloat(ak_tmp_in)
if(isNaN(ak_tmp_in)) ak_tmp_in=0
else ak_tmp_in*=ak_ex_factor
}
else
{
ak_tmp_in=parseFloat(ak_tmp_in)
if(isNaN(ak_tmp_in)) ak_tmp_in=0
}
return ak_tmp_in
}
//##########################
window.ak_redirectTarget=ak_redirectTarget
function ak_redirectTarget(evt,action)
{
if(action=='rm_groupObject')
{
ak_group_object.parentNode.removeChild(ak_group_object)
return
}
if(ak_checkLink[0][2]) ak_checkLink[0][0].setAttribute("target",ak_checkLink[0][2])
else {try{ak_checkLink[0][0].removeAttribute("target")}catch(error){}}
}
//##########################
function ak_get_grid(action)
{
if(action=='zoom') return ak_grid_zoom
return 1
}
//##########################
function ak_redirectWarning(evt,isClick)
{
ak_alert("Data-Changes not saved!!!!\nLink will be redirected to new window!")
if(!isClick) return
if(ak_checkLink[0][3]) ak_checkLink[0][0].setAttribute("onclick",ak_checkLink[0][3])
else {try{ak_checkLink[0][0].removeAttribute("onclick")}catch(error){}}
setTimeout("ak_redirectTarget(evt)",400)
}
//##########################
var ak_group_object
function ak_group_select(evt,action,index)
{
if(evt.type=='mousedown' && evt.getButton()==2)
{
contextMenu().replaceChild(parseXML(ak_group_menu,getContextMenu()).firstChild,getContextMenu().firstChild)
}
else if(action=='up')
{
evt.target.setAttribute('onmousedown',"ak_group_select(evt,'remove',"+index+")")
}
else if(evt.type=='mousedown' && evt.getButton()==0 && !evt.shiftKey())
{
if(evt.ctrlKey())
{
var ak_tmp_object=ak_grouping[index]
while(ak_which_nodeNr(ak_tmp_object.parentNode)!='')
{
ak_tmp_object=ak_tmp_object.parentNode
}
ak_clickset_obj2update(evt,ak_tmp_object)
}
else ak_clickset_obj2update(evt,ak_grouping[index])
}
else if(action=='remove' && evt.shiftKey() && evt.getButton()==0)
{
ak_grouping_noSwitch=true
for(var i=0;i<ak_gr_index.length;i++)
{
if(ak_gr_index[i]==index) ak_gr_index.splice(i,1)
}
evt.target.setAttribute("visibility","hidden")
//ak_group_object=evt.target
//setTimeout("ak_redirectTarget(evt,'rm_groupObject')",1)
}
}
//##########################
function ak_group_in(evt,action,dialog)
{
if(action=="set_xlink")
{
ak_object2update.setAttribute("xlink:href",ak_fileSelectFile)
ak_clickset_obj2update(evt,ak_object2update,"no")
return
}
ak_append2undo()
var ak_tmp_array=new Array
if(ak_gr_index.length<2)
{
ak_tmp_array.push(ak_grouping[ak_gr_index[0]])
}
else
{
for(var i=0;i<ak_gr_index.length;i++)
{
ak_tmp_array.push(ak_grouping[ak_gr_index[i]])
}
var ak_tmp_del=new Array
for(var i=0;i<ak_tmp_array.length;i++)
{
for(var b=0;b<ak_tmp_array.length;b++)
{
var ak_tmp_parent=ak_tmp_array[i].parentNode
while(ak_which_nodeNr(ak_tmp_parent)!='')
{
if(ak_which_nodeNr(ak_tmp_parent)==ak_which_nodeNr(ak_tmp_array[b]))
{
ak_tmp_del.push(i)
break
}
ak_tmp_parent=ak_tmp_parent.parentNode
}
}
}
for(var i=ak_tmp_del.length-1;i>=0;i--)
{
ak_tmp_array.splice(ak_tmp_del[i],1)
}
var ak_tmp_nr=new Array
for(var i=0;i<ak_tmp_array.length;i++)
{
ak_tmp_nr.push(ak_which_nodeNr(ak_tmp_array[i]))
if(/,/.test(ak_tmp_nr[i]))
{
ak_tmp_nr[i]=ak_tmp_nr[i].split(',')
for(var b=0;b<ak_tmp_nr[i].length;b++)
{
ak_tmp_nr[i][b]=parseInt(ak_tmp_nr[i][b])
}
}
else
{
var ak_tmp=parseInt(ak_tmp_nr[i])
ak_tmp_nr[i]=new Array
ak_tmp_nr[i][0]=ak_tmp
}
}
for(var i=0;i<ak_tmp_nr.length-1;i++)
{
for(var b=(i+1);b<ak_tmp_nr.length;b++)
{
if(ak_tmp_nr[i][0]==ak_tmp_nr[b][0])
{
var ak_tmp_c=1
while(ak_tmp_nr[i][ak_tmp_c]==ak_tmp_nr[b][ak_tmp_c])
{
if(ak_tmp_nr[i][ak_tmp_c]==undefined || ak_tmp_nr[b][ak_tmp_c]==undefined) break
ak_tmp_c++
}
if(ak_tmp_nr[i][ak_tmp_c]!=undefined && ak_tmp_nr[b][ak_tmp_c]!=undefined && ak_tmp_nr[i][ak_tmp_c]>ak_tmp_nr[b][ak_tmp_c])
{
ak_tmp=ak_tmp_nr[b].join(",")
ak_tmp_nr.splice(b,1)
ak_tmp_nr.splice(i,0,ak_tmp)
if(/,/.test(ak_tmp)) ak_tmp_nr[i]=ak_tmp.split(",")
else ak_tmp_nr[i]=new Array(ak_tmp)
for(var c=0;c<ak_tmp_nr[i].length;c++)
{
ak_tmp_nr[i][c]=parseInt(ak_tmp_nr[i][c])
}
ak_tmp=ak_tmp_array[b]
ak_tmp_array.splice(b,1)
ak_tmp_array.splice(i,0,ak_tmp)
}
}
else if(ak_tmp_nr[i][0]>ak_tmp_nr[b][0])
{
ak_tmp=ak_tmp_nr[b].join(",")
ak_tmp_nr.splice(b,1)
ak_tmp_nr.splice(i,0,ak_tmp)
if(/,/.test(ak_tmp)) ak_tmp_nr[i]=ak_tmp.split(",")
else ak_tmp_nr[i]=new Array(ak_tmp)
for(var c=0;c<ak_tmp_nr[i].length;c++)
{
ak_tmp_nr[i][c]=parseInt(ak_tmp_nr[i][c])
}
ak_tmp=ak_tmp_array[b]
ak_tmp_array.splice(b,1)
ak_tmp_array.splice(i,0,ak_tmp)
}
}
}
}
var ak_tmp_to=ak_tmp_array[ak_tmp_array.length-1]
while(ak_which_nodeNr(ak_tmp_to.parentNode)!='') {ak_tmp_to=ak_tmp_to.parentNode}
if(action=="in_g" || action=="copy_in_g") var ak_tmp_object=parseXML('<g/>',document).firstChild
else var ak_tmp_object=parseXML('<a xlink:href=""/>',document).firstChild
if(ak_tmp_to.nextSibling())
{
ak_tmp_to.parentNode.insertBefore(ak_tmp_object,ak_tmp_to.nextSibling)
}
else ak_userspace_svg.appendChild(ak_tmp_object)
ak_userspace_svg.insertBefore(parseXML('<g>\n  </g>',document).firstChild.firstChild,ak_tmp_object)
for(var i=0;i<ak_tmp_array.length;i++)
{
if(/^\[object Text/.test(ak_tmp_array[i].previousSibling) && (action=="in_g" || action=="in_a"))
{
ak_tmp_array[i].parentNode.removeChild(ak_tmp_array[i].previousSibling)
}
if(ak_which_nodeNr(ak_tmp_array[i].parentNode)!='')
{
ak_tmp=ak_tmp_array[i].getAttribute('transform')
if(ak_tmp) ak_tmp_array[i].setAttribute('transform','')
ak_within_root=true
var ak_tmp_CTM=ak_get_overall_CTM(evt,ak_tmp_array[i])
ak_within_root=false
var ak_tmp_matrix=new Array(ak_tmp_CTM.a,ak_tmp_CTM.b,ak_tmp_CTM.c,ak_tmp_CTM.d,ak_tmp_CTM.e,ak_tmp_CTM.f)
ak_tmp_matrix[0]=ak_round(ak_tmp_matrix[0],ak_matrix_precision)
ak_tmp_matrix[1]=ak_round(ak_tmp_matrix[1],ak_matrix_precision)
ak_tmp_matrix[2]=ak_round(ak_tmp_matrix[2],ak_matrix_precision)
ak_tmp_matrix[3]=ak_round(ak_tmp_matrix[3],ak_matrix_precision)
ak_tmp_matrix[4]=ak_round(ak_tmp_matrix[4],ak_precision)
ak_tmp_matrix[5]=ak_round(ak_tmp_matrix[5],ak_precision)
if(action=="in_g" || action=="in_a")
{
ak_tmp_object.appendChild(ak_tmp_array[i])
if(ak_tmp_matrix.join()!='1,0,0,1,0,0')
{
if(ak_tmp) ak_tmp_array[i].setAttribute('transform','matrix('+ak_tmp_matrix.join()+')'+ak_transform_split+ak_tmp)
else  ak_tmp_array[i].setAttribute('transform','matrix('+ak_tmp_matrix.join()+')')
}
else if(ak_tmp) ak_tmp_array[i].setAttribute('transform',ak_tmp)
}
else
{
ak_tmp_object.appendChild(ak_tmp_array[i].cloneNode(1))
if(ak_tmp_matrix.join()!='1,0,0,1,0,0')
{
if(ak_tmp)
{
ak_tmp_object.lastChild.setAttribute('transform','matrix('+ak_tmp_matrix.join()+')'+ak_transform_split+ak_tmp)
ak_tmp_array[i].setAttribute('transform',ak_tmp)
}
else  ak_tmp_object.lastChild.setAttribute('transform','matrix('+ak_tmp_matrix.join()+')')
}
else if(ak_tmp)
{
ak_tmp_object.lastChild.setAttribute('transform',ak_tmp)
ak_tmp_array[i].setAttribute('transform',ak_tmp)
}
}
}
else
{
if(action=="in_g" || action=="in_a") ak_tmp_object.appendChild(ak_tmp_array[i])
else ak_tmp_object.appendChild(ak_tmp_array[i].cloneNode(1))
}
}
ak_nice_tabs(ak_tmp_object)
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_tmp_object)
if(dialog=="dialog" && (action=="copy_in_a" || action=="in_a"))
{
ak_fileSelectSuccess="ak_group_in(evt,'set_xlink')"
ak_fileSelectCancel=""
ak_SVGSaver('fileSelect')
return
}
else if(action=="copy_in_a" || action=="in_a") ak_set_attribute('manual','xlink:href','http://','no_color','no_push')
}
var ak_matrix_precision=10000
var ak_group_menu='<menu><header>AKs Group Menu</header>'
ak_group_menu+='<item onactivate="ak_group_in(evt,'+"'in_g'"+')">Group in &lt;g/&gt;</item>'
ak_group_menu+='<item onactivate="ak_group_in(evt,'+"'in_a'"+')">Group in &lt;a/&gt;   prompt:</item>'
ak_group_menu+='<item onactivate="ak_group_in(evt,\'in_a\',\'dialog\')">Group in &lt;a/&gt;   dialog:</item>'
ak_group_menu+='<separator/>'
ak_group_menu+='<item onactivate="ak_group_in(evt,'+"'copy_in_g'"+')">Clone + Group in &lt;g/&gt;</item>'
ak_group_menu+='<item onactivate="ak_group_in(evt,'+"'copy_in_a'"+')">Clone + Group in &lt;a/&gt;   prompt:</item>'
ak_group_menu+='<item onactivate="ak_group_in(evt,\'copy_in_a\',\'dialog\')">Clone + Group in &lt;a/&gt;   dialog:</item>'
ak_group_menu+='</menu>'
//##############################
function ak_getBBox(evt,object)
{
var ak_tmpBBox=ak_svgroot.createSVGRect()
ak_BBoxValid=1
if(!object)
{
ak_tmpBBox.x=0
ak_tmpBBox.y=0
ak_tmpBBox.width=0
ak_tmpBBox.height=0
ak_BBoxValid=-1
return ak_tmpBBox
}
try{
if(object.tagName=="use")
{
var ak_tmpClone=object.cloneNode(0)
var ak_tmpX=ak_tmpClone.getAttribute("x")
if(!ak_tmpX) ak_tmpX=0
var ak_tmpY=ak_tmpClone.getAttribute("y")
if(!ak_tmpY) ak_tmpY=0
ak_tmpClone.setAttribute("x",0)
ak_tmpClone.setAttribute("y",0)
ak_tmpClone.setAttribute("transform","")
var ak_tmp_use=parseXML('<g/>',document).firstChild
object.parentNode.insertBefore(ak_tmp_use,object)
ak_tmp_use.appendChild(ak_tmpClone)
ak_tmpBBox.x=ak_tmp_use.getBBox.x+parseFloat(ak_tmpX)
ak_tmpBBox.y=ak_tmp_use.getBBox.y+parseFloat(ak_tmpY)
ak_tmpBBox.width=ak_tmp_use.getBBox.width
ak_tmpBBox.height=ak_tmp_use.getBBox.height
ak_tmp_use.parentNode.removeChild(ak_tmp_use)
}
else if(object.tagName=="line")
{
ak_tmpBBox.x=parseFloat(object.getAttribute("x1"))
ak_tmpBBox.y=parseFloat(object.getAttribute("y1"))
ak_tmpBBox.width=parseFloat(object.getAttribute("x2"))
ak_tmpBBox.height=parseFloat(object.getAttribute("y2"))
var ak_tmp=ak_tmpBBox.width-ak_tmpBBox.x
if(ak_tmp<0)
{
ak_tmpBBox.x=ak_tmpBBox.width
ak_tmpBBox.width=-ak_tmp
}
else ak_tmpBBox.width=ak_tmp
ak_tmp=ak_tmpBBox.height-ak_tmpBBox.y
if(ak_tmp<0)
{
ak_tmpBBox.y=ak_tmpBBox.height
ak_tmpBBox.height=-ak_tmp
}
else ak_tmpBBox.height=ak_tmp
ak_BBoxValid=2
}
else if(/^textPath|^tref|^tspan/.test(object.tagName))
{
var ak_tmpObject=object
while(object=="[object SVGTextPathElement]" || object=="[object SVGTSpanElement]" || object=="[object SVGTRefElement]")
{
object=object.parentNode
}
ak_tmpBBox.x=object.getBBox.x
ak_tmpBBox.y=object.getBBox.y
ak_tmpBBox.width=object.getBBox.width
ak_tmpBBox.height=object.getBBox.height
}
else if(object.tagName=="svg")
{
ak_tmpBBox.x=0
ak_tmpBBox.y=0
ak_tmpBBox.width=ak_getPixel(object,"width")
ak_tmpBBox.height=ak_getPixel(object,"height")
}
else if((";"+ak_BBoxFor.join(";")+";").search(";"+object.tagName+";")!=-1)
{
ak_tmpBBox.x=object.getBBox.x
ak_tmpBBox.y=object.getBBox.y
ak_tmpBBox.width=object.getBBox.width
ak_tmpBBox.height=object.getBBox.height
}
else
{
ak_tmpBBox.x=-100000
ak_tmpBBox.y=-100000
ak_tmpBBox.width=0
ak_tmpBBox.height=0
if(object.tagName=="marker") ak_BBoxValid=1
else ak_BBoxValid=-1
}
return ak_tmpBBox
}
catch(err)
{
ak_tmpBBox.x=-100000
ak_tmpBBox.y=-100000
ak_tmpBBox.width=0
ak_tmpBBox.height=0
ak_BBoxValid=false
return ak_tmpBBox
}
}
var ak_BBoxValid=false
var ak_BBoxFor=new Array("a","g","text","rect","image","use","circle","ellipse","polyline","polygon","path","clipPath")
//##############################
function ak_draw_BBox(evt,object,test2)
{
if(!object) return
// wenn 0 oder -1 deselect ?,
if(ak_which_nodeNr(object)==0)
{
if(ak_avoidMouseDown) try{ak_svgroot.removeChild(ak_avoidMouseDown)}catch(err){}
ak_avoidMouseDown=false
if(ak_toolG)
{
try{
ak_svgroot.removeChild(ak_toolG)
ak_svgroot.removeChild(ak_toolG2)
ak_svgroot.removeChild(ak_toolG3)
ak_svgroot.removeChild(ak_toolG4)
}catch(err){}
ak_toolG=false
}
ak_object2update_nodeNr=-1
return
}
var ak_tmpBBox=ak_svgroot.createSVGRect()
ak_tmpBBox=ak_getBBox(evt,object)
ak_object2update_CTM=ak_get_overall_CTM(evt,object)
var ak_tmpPoint=ak_svgroot.createSVGPoint()
var ak_tmpPoint2=ak_svgroot.createSVGPoint()
var ak_tmpPoint3=ak_svgroot.createSVGPoint()
var ak_tmpPoint4=ak_svgroot.createSVGPoint()

ak_tmpPoint.x=ak_tmpBBox.x
ak_tmpPoint.y=ak_tmpBBox.y
ak_tmpPoint2.x=ak_tmpBBox.width
ak_tmpPoint2.y=0
ak_tmpPoint3.x=ak_tmpBBox.width
ak_tmpPoint3.y=ak_tmpBBox.height
ak_tmpPoint4.x=0
ak_tmpPoint4.y=ak_tmpPoint3.y

ak_tmpMatrix=ak_object2update_CTM.translate(ak_tmpBBox.x,ak_tmpBBox.y)
var ak_tmpObjectMatrixTxT=ak_object2update_CTM.a+","+ak_object2update_CTM.b+","+ak_object2update_CTM.c+","+ak_object2update_CTM.d+","+ak_object2update_CTM.e+","+ak_object2update_CTM.f
var ak_tmpMatrixTxT=ak_tmpMatrix.a+","+ak_tmpMatrix.b+","+ak_tmpMatrix.c+","+ak_tmpMatrix.d+","+ak_tmpMatrix.e+","+ak_tmpMatrix.f
ak_tmpPoint.x=0
ak_tmpPoint.y=0
ak_tmpPoint=ak_tmpPoint.matrixTransform(ak_tmpMatrix)
ak_tmpPoint2=ak_tmpPoint2.matrixTransform(ak_tmpMatrix)
ak_tmpPoint3=ak_tmpPoint3.matrixTransform(ak_tmpMatrix)
ak_tmpPoint4=ak_tmpPoint4.matrixTransform(ak_tmpMatrix)
var ak_tmpRotate=Math.atan2(ak_tmpPoint2.y-ak_tmpPoint.y,ak_tmpPoint2.x-ak_tmpPoint.x)*(180/Math.PI)
var ak_tmpNode='<g style="stroke:#ff0;fill:#000;stroke-width:1;stroke-dasharray:6 6;shape-rendering:optimizeSpeed">'
//if(test2) ak_tmpNode+='<rect transform="matrix('+ak_tmpMatrixTxT+')" x="0" y="0" width="'+ak_object2update.getBBox.width+'" height="'+ak_object2update.getBBox.height+'" style="opacity:0.2"/>'
//if(test2) ak_tmpNode+=test2
var ak_tmpStyle=' style="stroke:#ff0;fill:#000;stroke-width:1;stroke-dasharray:6 6;shape-rendering:optimizeSpeed"'
//ak_tmpStyle=""
if(ak_toolG)
{
try{
ak_svgroot.removeChild(ak_toolG)
ak_svgroot.removeChild(ak_toolG2)
ak_svgroot.removeChild(ak_toolG3)
ak_svgroot.removeChild(ak_toolG4)
}catch(err){}
ak_toolG=false
}
ak_toolG=parseXML('<line'+ak_tmpStyle+' x1="'+ak_tmpPoint.x+'" y1="'+ak_tmpPoint.y+'" x2="'+ak_tmpPoint2.x+'" y2="'+ak_tmpPoint2.y+'"/>',document).firstChild
ak_toolG2=parseXML('<line'+ak_tmpStyle+' x1="'+ak_tmpPoint.x+'" y1="'+ak_tmpPoint.y+'" x2="'+ak_tmpPoint4.x+'" y2="'+ak_tmpPoint4.y+'"/>',document).firstChild
ak_toolG3=parseXML('<line'+ak_tmpStyle+' x1="'+ak_tmpPoint3.x+'" y1="'+ak_tmpPoint3.y+'" x2="'+ak_tmpPoint2.x+'" y2="'+ak_tmpPoint2.y+'"/>',document).firstChild
ak_toolG4=parseXML('<line'+ak_tmpStyle+' x1="'+ak_tmpPoint3.x+'" y1="'+ak_tmpPoint3.y+'" x2="'+ak_tmpPoint4.x+'" y2="'+ak_tmpPoint4.y+'"/>',document).firstChild
//ak_tmpNode+='<rect transform="translate('+ak_tmpPoint3.x+','+ak_tmpPoint3.y+') rotate('+ak_tmpRotate+')" x="0" y="0" width="16" height="16" style="stroke:#000;stroke-dasharray:0 0;fill:#0a0"/>'
//ak_tmpNode+='<rect transform="translate('+ak_tmpPoint3.x+','+ak_tmpPoint3.y+') rotate('+ak_tmpRotate+')" x="0" y="0" width="8" height="8" style="stroke:#000;stroke-dasharray:0 0;fill:#ff0"/>'
//ak_tmpNode+='<rect transform="translate('+ak_tmpPoint3.x+','+ak_tmpPoint3.y+')" x="0" y="0" width="'+ak_tmpSize.x+'" height="'+ak_tmpSize.y+'" style="stroke:#000;stroke-dasharray:0 0;fill:#ff0"/>'
//ak_tmpNode+='</g>'
//ak_toolG=parseXML(ak_tmpNode,document).firstChild
ak_svgroot.insertBefore(ak_toolG,ak_toolOverall)
ak_svgroot.insertBefore(ak_toolG2,ak_toolOverall)
ak_svgroot.insertBefore(ak_toolG3,ak_toolOverall)
ak_svgroot.insertBefore(ak_toolG4,ak_toolOverall)
}
//#########################################
var ak_BBox=new Array, ak_avoidMouseDown=false, ak_toolG=false, ak_toolG2, ak_toolG3, ak_toolG4
//##############################
var ak_encodingMenu='<item id="ak_encoding_menu" enabled="no">&lt;?xml encoding=""</item>'
function ak_showMainMenu(evt)
{
if(!ak_menuValid(evt,"mainMenu")) return
var ak_tmpNode='<menu id="ak_main_menu_xml"><header>AKs SVGEditor Main Menu</header>'
if(ak_svgroot.currentTranslate.x!=0 || ak_svgroot.currentTranslate.y!=0 || ak_svgroot.currentScale!=1)
{
ak_tmpNode+='<item action="'+"OriginalView"+'">Original View</item>'
ak_tmpNode+='</menu>'
contextMenu().replaceChild(parseXML(ak_tmpNode,getContextMenu()).firstChild,getContextMenu().firstChild)
return
}
if(/\,/.test(ak_object2update_nodeNr)) ak_tmpNode+=ak_addChildMain
else ak_tmpNode+=ak_addChildMain.replace(/\>paste from/,">[Ctrl+V] paste from")
ak_tmpNode+='<item onactivate="'+"ak_switch_xy_transform()"+'">[Shift+Ctrl] Edit xy &lt;> transform</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_timeline_editor(evt)"+'">Timeline EDITOR</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<menu><header>Zoom | Pan Canvas  (x'+ak_grid_zoom
if(ak_grid_what=="Grid OFF (toolbox color)") ak_tmpNode+=' | color)</header>'
else ak_tmpNode+=')</header>'
ak_tmpNode+='<item onactivate="ak_grid_on_off(evt,\'ZoomIn\')">Zoom IN      [A]</item>'
ak_tmpNode+='<item onactivate="ak_grid_on_off(evt,\'ZoomOut\')">Zoom OUT   [Y] or [Z]</item>'
if(ak_grid_pan_x==0 && ak_grid_pan_y==0 && ak_grid_zoom==1)
{ak_tmpNode+='<item checked="yes">0,0 | x1       [A+Y] or [A+Z] </item>'}
else {ak_tmpNode+='<item onactivate="ak_grid_on_off(evt,\'ZoomReset\')">0,0 | x1       [A+Y] or [A+Z] </item>'}
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item>To Pan Canvas use middleMouseButton,</item>'
ak_tmpNode+='<item>or [Space] and leftMouseButton!</item>'
ak_tmpNode+='<separator/>'
if(ak_grid_what=="Grid ON") ak_tmpNode+='<item checked="yes">   Grid ON</item>'
else ak_tmpNode+='<item onactivate="ak_grid_on_off(evt,\'on\')">   Grid ON</item>'
if(ak_grid_what=="Grid ON (dark)") ak_tmpNode+='<item checked="yes">   Grid ON (dark)</item>'
else ak_tmpNode+='<item onactivate="ak_grid_on_off(evt,\'on_dark\')">   Grid ON (dark)</item>'
if(ak_grid_what=="Grid OFF (toolbox color)") ak_tmpNode+='<item checked="yes" onactivate="ak_grid_on_off(evt,\'off_color\')">   Grid OFF (toolbox color)</item>'
else ak_tmpNode+='<item onactivate="'+"ak_grid_on_off(evt,'off_color')"+'">   Grid OFF (toolbox color)</item>'
if(ak_grid_what=="Grid OFF") ak_tmpNode+='<item checked="yes">   Grid OFF</item>'
else ak_tmpNode+='<item onactivate="ak_grid_on_off(evt,\'off\')">   Grid OFF</item>'
ak_tmpNode+='</menu>'
ak_tmpNode+='<item onactivate="ak_main_menu(\'EnterSVGwidth\')">Enter width/height  ('
ak_tmpNode+=ak_userspace_svg.getAttribute("width")+","+ak_userspace_svg.getAttribute("height")+')</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_main_menu('[Ctrl+G]')"+'">[Ctrl+G] Replace (Id-match)</item>'
if(ak_undo_enabled)
{
if(ak_undo_array.length<1) ak_tmpNode+='<item id="ak_item_doUndo" enabled="no" onactivate="'+"ak_doUndo()"+'">[Ctrl+Z] Undo</item>'
else ak_tmpNode+='<item id="ak_item_doUndo" enabled="yes" onactivate="'+"ak_doUndo()"+'">[Ctrl+Z] Undo</item>'
if(ak_redo_array.length<1) ak_tmpNode+='<item id="ak_item_doRedo" enabled="no" onactivate="'+"ak_doRedo()"+'">[Ctrl+Y] Redo</item>'
else  ak_tmpNode+='<item id="ak_item_doRedo" enabled="yes" onactivate="'+"ak_doRedo()"+'">[Ctrl+Y] Redo</item>'
}
else if(ak_autoMode)
{
ak_tmpNode+='<item onactivate="'+"ak_doUndo()"+'">[Ctrl+Z] Undo autoMode</item>'
ak_tmpNode+='<item enabled="no">[Ctrl+Y] Redo (disabled)</item>'
}
else ak_tmpNode+='<item id="ak_item_doUndo" enabled="no" onactivate="'+"ak_doUndo()"+'">[Ctrl+Z] Undo (disabled)</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<menu><header>Save | Open | New SVG</header>'
var ak_tmp='"    '
if(ak_file.length<16)
{
for(var i=0;i<(16-ak_file.length);i++) {ak_tmp+='  '}
}
ak_tmpNode+='<item onactivate="'+"ak_main_menu('Save2Disk')"+'">Save "'+ak_file+ak_tmp+'[Ctrl+S]</item>'
ak_tmpNode+='<item onactivate="'+"ak_main_menu('saveAs')"+'">Save as ...</item>'
if(evt.ctrlKey()) ak_tmpNode+='<item onactivate="'+"ak_main_menu('Save SVG to Clipboard')"+'">Copy SVG to Clipboard</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_SVGSaver('openSVG')"+'">Open "*.svg"</item>'
ak_tmpNode+='<item onactivate="'+"ak_SVGSaver('openSVGNew')"+'">Open in new Window</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_SVGSaver('openEditor')"+'">Text-Editor (setup via AKs_SVGSaver)</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_main_menu('New untitled')"+'">New SVG, save as ...</item>'
ak_tmpNode+='<item onactivate="'+"ak_main_menu('New SVG, clear Userspace')"+'">New SVG, clear userspace ...</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'exportRaster0\',1)">Export Raster-Image  (0:00:00 prog.)</item>'
//ak_tmpNode+='<item enabled="no" onactivate="ak_timeMain(evt,\'exportPrompt\',1)">Export Indexed-Frame  (Prompt)</item>'
ak_tmpNode+='</menu>'
ak_tmpNode+='<separator/>'
var ak_tmp_load=ak_userspace_svg.getAttribute("onload")
ak_tmp_load=ak_tmp_load.replace(/^try\{ak_init_editor\(evt,\'/,"")
if(/^try\{ak_init_editor\(evt\)\};?catch\(err\)\{\}/.test(ak_tmp_load))
{
ak_tmpNode+='<item id="ak_autoStart" checked="yes" onactivate="ak_main_menu(\'autoStart\')">autoStart AKs SVG Editor</item>'
}
else ak_tmpNode+='<item id="ak_autoStart" onactivate="ak_main_menu(\'autoStart\')">autoStart AKs SVGEditor</item>'
ak_tmpNode+=ak_encodingMenu
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_info('Help')"+'">Help   (Aks_Help.html)</item>'
ak_tmpNode+='<item onactivate="'+"ak_info()"+'">About Aks SVG Editor</item>'
ak_tmpNode+='<item action="'+"Quality"+'">Higher Quality</item>'
ak_tmpNode+='</menu>'
contextMenu().replaceChild(parseXML(ak_tmpNode,getContextMenu()).firstChild,getContextMenu().firstChild)
}
//#############################
function ak_deselect(evt,only_hide)
{
var ak_tmp
if(!only_hide)
{
ak_object2update=ak_noSelection
ak_object2update_nodeNr=-1; ak_undo()
if(ak_grid_what=="Grid OFF (toolbox color)") ak_set_hex2hue(evt,"fill")
ak_selection("hide")
}
if(ak_toolObject) ak_toolObject.setAttribute("visibility","hidden")
if(ak_toolSVGFrame) ak_toolSVGFrame.setAttribute("visibility","hidden")
ak_tmp=document.getElementById("ak_g_keyTimes")
if(ak_tmp) ak_tmp.setAttribute("visibility","hidden")
ak_durSlider.setAttribute("visibility","hidden")
if(!only_hide) ak_coutStatus.data="No selection!"
else ak_coutStatus.data=""
ak_coutMulti.data=""
ak_coutAuto.data=""
if(only_hide!="keepObjectStatus") ak_setAttribute(ak_objectStatus,"visibility","hidden")
if(true)
{// Reset Toolbox
ak_buttonFill.setAttribute("fill",ak_off)
ak_buttonStroke.setAttribute("fill",ak_off)
ak_buttonFilter.setAttribute("fill",ak_off)
ak_buttonVisibility.setAttribute("fill",ak_off)
ak_buttonTransform.setAttribute("fill",ak_off)
for(var i=0;i<4;i++)
{
ak_sliderArrayV3[i][1].firstChild.setAttribute("fill","#eee")
ak_sliderArrayV3[i][1].firstChild.nextSibling.firstChild.data="off"
if(i<3) ak_sliderArrayV3[i][1].setAttribute("transform","translate(0,78)")
else ak_sliderArrayV3[i][1].setAttribute("transform","translate(0,33)")
}
ak_sliderArrayV3[4][0].parentNode.setAttribute("visibility","hidden")
ak_sliderArrayV3[5][0].parentNode.setAttribute("visibility","hidden")
}
return
}
//######################################################################################################
function ak_checkMultiTransform(object)
{
if(object.tagName!="g") return object
try{if(object.hasAttributes)  return object}catch(err){return object} // try wegen ASV 6.0...
var ak_tmpChilds=object.childNodes
var ak_tmp_flag=0
var ak_tmp_return=false
for(var i=0;i<ak_tmpChilds.length;i++)
{
if(/^\[object SVG/.test(ak_tmpChilds.item(i)))
{
ak_tmp_flag++
if(/^animateTransform/.test(ak_tmpChilds.item(i).tagName) && !/^ak_multi_/.test(ak_tmpChilds.item(i).getId())) ak_tmp_flag=3
else if(!/^animate|set/.test(ak_tmpChilds.item(i).tagName)) ak_tmp_return=ak_tmpChilds.item(i)
}
if(ak_tmp_flag>2) return object
}
if(ak_tmp_flag==2 && ak_tmp_return)
{
if(ak_tmp_return.tagName=="g") ak_tmp_return=ak_checkMultiTransform(ak_tmp_return)
if(ak_tmp_return.getAttribute("ak_multi")) return ak_tmp_return
}
return object
}
//######################################################################################################
function ak_getMultiTransObject(object)
{
var ak_tmpFlag=true, ak_tmpParent
var ak_tmpMulti=object.getAttribute("ak_multi")
if(!ak_tmpMulti || !/,/.test(ak_which_nodeNr(object))) return object
ak_tmpMulti=";"+ak_tmpMulti+";"
ak_tmpObject=object
while(ak_tmpFlag)
{
while(ak_tmpObject.previousSibling())
{
ak_tmpObject=ak_tmpObject.previousSibling()
if(/\[object SVG/.test(ak_tmpObject) && (ak_tmpMulti).search(";"+ak_tmpObject.getId()+";")==-1)
{
ak_tmpFlag=false
break
}
}
if(ak_tmpFlag)
{
ak_tmpObject=object
while(ak_tmpObject.nextSibling())
{
ak_tmpObject=ak_tmpObject.nextSibling()
if(/\[object SVG/.test(ak_tmpObject) && (ak_tmpMulti).search(";"+ak_tmpObject.getId()+";")==-1)
{
ak_tmpFlag=false
break
}
}
}
if(ak_tmpFlag && object.parentNode.tagName=="g" && !object.parentNode.hasAttributes())
{
object=object.parentNode
if(!/,/.test(ak_which_nodeNr(object))) break
ak_tmpObject=object
}
else break
}
return object
}
//######################################################################################################
function ak_createToolObject(evt)
{
var ak_tmpNode
ak_tmpNode='<g id="ak_Id_tmp_edit_g" style="text-rendering:optimizeSpeed;font-weight:bold;fill-opacity:0;stroke-opacity:1;stroke:url(#ak_internal_edit_border);visibility:hidden">'
ak_tmpNode+='<line id="ak_Id_tmp_edit_objectLine" x1="0" y1="0" x2="0" y2="0" style="shape-rendering:optimizeSpeed;fill-opacity:0;stroke-opacity:1;stroke:url(#ak_internal_edit_border)"'
ak_tmpNode+=' onmousedown="ak_MoveEditRect(evt,\'down\',\'translate\')"'
ak_tmpNode+=' onmouseup="ak_MoveEditRect(evt,\'up\',\'translate\')"'
ak_tmpNode+=' onmouseover="ak_MoveEditRect(evt,\'over\',\'translate\')"'
ak_tmpNode+=' onmouseout="ak_MoveEditRect(evt,\'out\',\'translate\')"'
ak_tmpNode+=' onclick="ak_MoveEditRect(evt,\'click\',\'translate\')"'
ak_tmpNode+='/>'
ak_tmpNode+='<rect id="ak_Id_tmp_edit_objectRect" shape-rendering="optimizeSpeed" x="" y="" width="100" height="100" style=""'
ak_tmpNode+=' onmousedown="ak_MoveEditRect(evt,\'down\',\'translate\')"'
ak_tmpNode+=' onmouseup="ak_MoveEditRect(evt,\'up\',\'translate\')"'
ak_tmpNode+=' onmouseover="ak_MoveEditRect(evt,\'over\',\'translate\')"'
ak_tmpNode+=' onmouseout="ak_MoveEditRect(evt,\'out\',\'translate\')"'
ak_tmpNode+=' onclick="ak_MoveEditRect(evt,\'click\',\'translate\')"'
ak_tmpNode+='/>'
ak_tmpNode+='<text onmousedown="ak_MoveEditRect(evt,\'down\',\'parentKeyTimes\')" id="ak_freezeTspanBefore" x="" y="" style="stroke:none"> <tspan id="ak_freezeTspan"  style="fill:#10d"> </tspan> <tspan id="ak_freezeTspanBehind"> </tspan></text>'
ak_tmpNode+='<a id="ak_a_wrapper" style="visibility:hidden" xlink:href=""><rect shape-rendering="optimizeSpeed" x="0" y="0" width="0" height="0"/></a>'
ak_tmpNode+='<g id="ak_rotateCenter">'
ak_tmpNode+='<rect onmousedown="ak_MoveEditRect(evt,\'down\',\'size\',1)" x="" y="" width="" height="" style="fill:#12cc05;fill-opacity:1;stroke:#000"/>'
ak_tmpNode+='<path transform="translate(0,0)" id="ak_rotateCenterPoint" d="M 0 -10 L 10 0 L 0 10 L -10 0 Z M -10 0 L 10 0 M 0 -10 L 0 10"'
ak_tmpNode+=' style="fill:#12cc05;fill-opacity:1;stroke-width:2;stroke:#000"'
ak_tmpNode+=' onmousedown="ak_MoveEditRect(evt,\'down\',\'rotateCenter\')"/>'
ak_tmpNode+='</g>'
ak_tmpNode+='<rect id="ak_Id_tmp_edit_width" x="" y="" width="" height="" style="fill:#ff0;fill-opacity:1;stroke:#000"'
ak_tmpNode+=' onmousedown="ak_MoveEditRect(evt,\'down\',\'size\')"'
ak_tmpNode+='/>'
ak_tmpNode+='<g>'
ak_tmpNode+='<line onmousedown="ak_MoveEditRect(evt,\'down\',\'translate\')" x1="0" y1="0" x2="0" y2="0" style="shape-rendering:optimizeSpeed;stroke:url(#ak_internal_edit_border)"/>'
ak_tmpNode+='<line x1="0" y1="0" x2="0" y2="0" style="shape-rendering:optimizeSpeed;opacity:0.75;stroke:#ff0"/>'
ak_tmpNode+='<circle onmousedown="ak_MoveEditRect(evt,\'down\',\'filter_txKerning\')" cx="" cy="" r="" style="fill:#ff0;fill-opacity:1;stroke:#000"/>'
ak_tmpNode+='<line x1="0" y1="0" x2="0" y2="0" style="shape-rendering:optimizeSpeed;opacity:0.75;stroke:#ff0"/>'
ak_tmpNode+='<circle onmousedown="ak_MoveEditRect(evt,\'down\',\'filter_txWordSpace\')" cx="" cy="" r="" style="fill:#ff0;fill-opacity:1;stroke:#000"/>'
ak_tmpNode+='</g>'
ak_tmpNode+='<line x1="0" y1="0" x2="0" y2="0" style="shape-rendering:optimizeSpeed;opacity:0.75;stroke:#ff0"/>'
ak_tmpNode+='<circle id="ak_tmp_edit_control_xy"  onmousedown="ak_MoveEditRect(evt,\'down\',\'xy_control\')" cx="" cy="" r="" style="fill:#ff0;fill-opacity:1;stroke:#000"/>'
ak_tmpNode+='<g id="ak_path_control_g"/>'
ak_tmpNode+='<rect id="ak_svg_outline" x="0" y="0" width="0" height="0" style="shape-rendering:optimizeSpeed;fill:none;opacity:0.75;stroke:#fff"/>'
ak_tmpNode+='<g id="ak_gradient_control_g"/>' // marker, filter, gradienten, pattern
ak_tmpNode+='</g>'
ak_toolObject=parseXML(ak_tmpNode,document).firstChild
ak_svgroot.insertBefore(ak_toolObject,ak_toolOverall)
ak_objEditLine=ak_toolObject.firstChild
ak_objEditRect=ak_objEditLine.nextSibling
ak_freezeTextBefore=document.getElementById("ak_freezeTspanBefore")
ak_freezeText=document.getElementById("ak_freezeTspan")
ak_freezeTextBehind=document.getElementById("ak_freezeTspanBehind")
ak_objAWrapper=document.getElementById("ak_a_wrapper")
ak_objRotateCenter=document.getElementById("ak_rotateCenter")
ak_objScale=ak_objRotateCenter.firstChild
ak_objRotateCenterPoint=document.getElementById("ak_rotateCenterPoint")
ak_objWidth=document.getElementById("ak_Id_tmp_edit_width")
ak_objKerning=ak_objWidth.nextSibling
ak_objControlXYLine=ak_objKerning.nextSibling
ak_objControlXY=document.getElementById("ak_tmp_edit_control_xy")
ak_toolPath=document.getElementById("ak_path_control_g")
ak_toolSVGFrame=document.getElementById("ak_svg_outline")
ak_toolGradient=document.getElementById("ak_gradient_control_g")
}
var ak_objEditLine, ak_objEditRect, ak_objAWrapper, ak_objRotateCenter, ak_objScale, ak_objRotateCenterPoint
var ak_objKerning, ak_objControlXYLine, ak_objControlXY
var ak_toolPath
//######################################################################################################
var ak_SVGAttributes=["tagName","id","x","y","width","height","x1","y1","x2","y2","cx","cy","r","rx","ry","xlink:href","transform","style","points","d","SchmarnZumTest"]
var ak_xyPercent=new Array, ak_groupTextPath=false, ak_group_ctrl=false, ak_mouse_over="", ak_mouse_overObject=false
//########################## 0 ##### 1 ## 2 # 3 ## 4 ##### 5 ##### 6 ## 7 ## 8 ## 9 ## 10 # 11 # 12# 13 # 14 ## 15 ########## 16 ####### 17 #### 18 #### 19#  
var ak_click1=0, ak_click2=0 // for testing
var ak_parentSVG_Array, ak_image_preserveMenu=false
var ak_parentSVG_width=window.innerWidth
var ak_parentSVG_height=window.innerHeight
var ak_prevSelect, ak_actualSelect, ak_actualDefs=false
var ak_checkLink, ak_grouping=new Array, ak_gr_index=new Array, ak_grouping_noSwitch=false
var ak_toolObject, ak_toolGradient, ak_toolKey, ak_toolGroup, ak_toolSVGFrame
//######### ak_clicka #################
function ak_click(evt,object2set,from_move)
{
ak_clickset_obj2update(evt,object2set,from_move)
}
function ak_clickset_obj2update(evt,object2set,from_move)
{
if(!object2set && !evt) return
var ak_tmp
if(evt && evt.getButton==2 && ak_menu_status=="ak_editor" && ak_key_status[32]=="up")
{
ak_showMainMenu(evt)
ak_MoveEditRect_flag=false
return
}
if(ak_menu_status=="timeline")
{
if(ak_key_status[32]=="down" || (evt && evt.getButton==1))
{
if(ak_playTrue) ak_timeMain(evt,'Pause')
ak_MoveEditRect(evt,"down","translate")
}
else if(evt && evt.type=="mousedown") ak_showMenu(evt,'timeCanvas')
ak_mouse_circle.setAttribute("style","visibility:hidden")
return
}
if(from_move=="no") from_move="no_ak_init_set4object"
if(!object2set && evt && evt.shiftKey())
{// select for grouping bei click
var ak_tmpObject
if(/ElementInstance/.test(evt.target) && evt.currentNode!="[object SVGUseElement]") return
else if(/ElementInstance/.test(evt.target)) ak_tmpObject=evt.currentNode
else ak_tmpObject=evt.target
//ak_tmpObject=ak_getMultiTransObject(ak_tmpObject)
var ak_tmpObjectNr=ak_which_nodeNr(ak_tmpObject)
if(ak_tmpObjectNr==0) return // rootSVG nicht selektieren
var ak_tmpShiftX=0, ak_tmpShiftY=0 //ak_xy_etc_shift
ak_grouping_noSwitch=true
var ak_tmp_grid_size=ak_userspace_g.getAttribute("transform")
ak_tmp_grid_size=ak_tmp_grid_size.replace(/^matrix\(/,"")
ak_tmp_grid_size=1/parseFloat(ak_tmp_grid_size)
if(ak_grouping.length==0)
{
while(ak_toolGroup.childNodes.length>0)
{
ak_toolGroup.removeChild(ak_toolGroup.childNodes.item(0))
}
ak_toolGroup.setAttribute("visibility","visible")
var ak_tmpTool=ak_toolGroup
ak_gr_index=new Array
if(ak_object2update_nodeNr!=-1 && ak_object2update_nodeNr!="")
{
ak_deselect(evt,"only_hide")
//ak_object2update=ak_getMultiTransObject(ak_object2update)
ak_object2update_nodeNr=ak_which_nodeNr(ak_object2update)
while(/^(tspan)|^(tref)|^(textPath)/.test(ak_object2update.tagName))
{
ak_object2update=ak_object2update.parentNode
}
ak_gr_index.push(ak_grouping.length)
ak_grouping.push(ak_object2update)
var ak_tmp_CTM=ak_get_overall_CTM(evt,ak_object2update)
var ak_tmp_transform='matrix('+ak_tmp_CTM.a+','+ak_tmp_CTM.b+','+ak_tmp_CTM.c+','+ak_tmp_CTM.d+','+(ak_tmp_CTM.e-ak_tmpShiftX)+','+(ak_tmp_CTM.f-ak_tmpShiftY)+')'
if(/^(a)|^(g)|^(svg)|^text|^(tref)|^(tspan)|^(use)|^(image)/.test(ak_object2update.tagName))
{
var ak_tmpBBox=ak_getBBox(evt,ak_object2update)
if(ak_BBoxValid)
{
ak_tmpTool='<rect x="'+ak_tmpBBox.x+'" y="'+ak_tmpBBox.y+'"'
ak_tmpTool+=' width="'+(ak_tmpBBox.width)+'" height="'+(ak_tmpBBox.height)+'"'
ak_tmpTool+=' transform="'+ak_tmp_transform+'"'
ak_tmpTool+=' style="fill-opacity:0.3;stroke-width:'+(2*ak_tmp_grid_size)
ak_tmpTool+=';stroke-dasharray:'+(3*ak_tmp_grid_size)+' '+(5*ak_tmp_grid_size)
ak_tmpTool+=';stroke:'
if(/,/.test(ak_object2update_nodeNr)) ak_tmpTool+='#f0c"'
else ak_tmpTool+='#f70"'
ak_tmpTool+=' onmousedown="ak_group_select(evt,\'down\',0)" onmouseup="ak_group_select(evt,\'remove\',0)"/>'
ak_toolGroup.appendChild(parseXML(ak_tmpTool,document).firstChild)
}
}
else
{
ak_tmpTool=ak_object2update.cloneNode(0)
ak_tmp='fill-opacity:0.3;stroke-width:'+(2*ak_tmp_grid_size)
ak_tmp+=';stroke-dasharray:'+(3*ak_tmp_grid_size)+' '+(5*ak_tmp_grid_size)
ak_tmp+=';stroke:'
if(/,/.test(ak_object2update_nodeNr)) ak_tmp+='#f0c'
else ak_tmp+='#f70'
ak_tmpTool.setAttribute("style",ak_tmp)
ak_tmpTool.setAttribute("onmousedown","ak_group_select(evt,\'down\',0)")
ak_tmpTool.setAttribute("onmouseup","ak_group_select(evt,\'remove\',0)")
ak_tmpTool.setAttribute("transform",ak_tmp_transform)
ak_toolGroup.appendChild(ak_tmpTool)
}
}
}
ak_object2update=ak_tmpObject
if(evt.ctrlKey()==ak_group_ctrl)
{
while(ak_which_nodeNr(ak_object2update.parentNode)!='')
{
ak_object2update=ak_object2update.parentNode
}
}
while(/^(tspan)|^(tref)|^(textPath)/.test(ak_object2update.tagName))
{
ak_object2update=ak_object2update.parentNode
}
ak_object2update_nodeNr=ak_which_nodeNr(ak_object2update)
ak_gr_index.push(ak_grouping.length)
ak_grouping.push(ak_object2update)
var ak_tmp_CTM=ak_get_overall_CTM(evt,ak_object2update)
var ak_tmp_transform='matrix('+ak_tmp_CTM.a+','+ak_tmp_CTM.b+','+ak_tmp_CTM.c+','+ak_tmp_CTM.d+','+(ak_tmp_CTM.e-ak_tmpShiftX)+','+(ak_tmp_CTM.f-ak_tmpShiftY)+')'
if(/^(a)|^(g)|^(svg)|^text|^(tref)|^(tspan)|^(use)|^(image)/.test(ak_object2update.tagName))
{
var ak_tmpBBox=ak_getBBox(evt,ak_object2update)
if(ak_BBoxValid)
{
ak_tmpTool='<rect x="'+ak_tmpBBox.x+'" y="'+ak_tmpBBox.y+'"'
ak_tmpTool+=' width="'+(ak_tmpBBox.width)+'" height="'+(ak_tmpBBox.height)+'"'
ak_tmpTool+=' transform="'+ak_tmp_transform+'"'
ak_tmpTool+=' style="fill-opacity:0.3;stroke-width:'+(2*ak_tmp_grid_size)
ak_tmpTool+=';stroke-dasharray:'+(3*ak_tmp_grid_size)+' '+(5*ak_tmp_grid_size)
ak_tmpTool+=';stroke:'
if(/,/.test(ak_object2update_nodeNr)) ak_tmpTool+='#f0c"'
else ak_tmpTool+='#f70"'
ak_tmpTool+=' onmousedown="ak_group_select(evt,\'down\','+(ak_grouping.length-1)+')" onmouseup="ak_group_select(evt,\'up\','+(ak_grouping.length-1)+')"/>'
ak_toolGroup.appendChild(parseXML(ak_tmpTool,document).firstChild)
}
}
else
{
ak_tmpTool=ak_object2update.cloneNode(0)
ak_tmp='fill-opacity:0.3;stroke-width:'+(2*ak_tmp_grid_size)
ak_tmp+=';stroke-dasharray:'+(3*ak_tmp_grid_size)+' '+(5*ak_tmp_grid_size)
ak_tmp+=';stroke:'
if(/,/.test(ak_object2update_nodeNr)) ak_tmp+='#f0c'
else ak_tmp+='#f70'
ak_tmpTool.setAttribute("style",ak_tmp)
ak_tmpTool.setAttribute("onmousedown","ak_group_select(evt,\'down\',"+(ak_grouping.length-1)+")")
ak_tmpTool.setAttribute("onmouseup","ak_group_select(evt,\'up\',"+(ak_grouping.length-1)+")")
ak_tmpTool.setAttribute("transform",ak_tmp_transform)
ak_toolGroup.appendChild(ak_tmpTool)
}
ak_cout("Select Elements for Grouping!")
return
}
if(evt && evt.altKey() && !object2set)
{
if(ak_dirty_flag)
{
if(ak_which_nodeNr(evt.target)!='0' && ak_which_nodeNr(evt.target)!=-1 && ak_which_nodeNr(evt.target)!='')
{
ak_checkLink=new Array
ak_checkLink[0]=new Array(evt.target,"","","")
while(ak_which_nodeNr(ak_checkLink[0][0])!='')
{
if(ak_checkLink[0][0].tagName=="a")
{
ak_checkLink[0][1]=ak_checkLink[0][0].getAttribute("xlink:href")
if(ak_checkLink[0][1])
{
ak_checkLink[0][2]=ak_checkLink[0][0].getAttribute("target")
if(/(_parent)|(_self)|(_top)/.test(ak_checkLink[0][2]) ||!ak_checkLink[0][2])
{
ak_checkLink[0][3]=ak_checkLink[0][0].getAttribute("onclick")
ak_checkLink[0][0].setAttribute("onclick","ak_redirectWarning(evt,'click');"+ak_checkLink[0][3])
ak_checkLink[0][0].setAttribute("target","redirect")
}
}
break
}
ak_checkLink[0][0]=ak_checkLink[0][0].parentNode
}
}
}
for (var i=0; i<256; i++) {ak_key_status[i]="up"}
return
}
if(ak_grouping.length>0)
{
ak_grouping_noSwitch=false
ak_toolGroup.setAttribute("visibility","hidden")
ak_grouping=new Array()
ak_gr_index=new Array()
from_move=""
}
if(!from_move && ((evt && evt.getButton==1 && evt.type=="mousedown") || (ak_key_status[32]=="down")))
{
ak_MoveEditRect(evt,"down","translate") // pan
return
}
else if(ak_pathAddPoint && evt && evt.type=="mousedown")
{
ak_MoveEditRect(evt,"down","translate")
return
}
var ak_tmpOldNr=ak_object2update_nodeNr
if (!object2set)
{// object setzen
if(/ElementInstance/.test(evt.target) && evt.currentNode!="[object SVGUseElement]") return
else if(/ElementInstance/.test(evt.target)) ak_object2update=evt.currentNode
else ak_object2update=evt.target
ak_object2update_nodeNr=ak_which_nodeNr(ak_object2update)
if(ak_object2update_nodeNr==0 && !evt.ctrlKey) {ak_deselect(evt);return}
else if(ak_object2update_nodeNr==0)
{
ak_object2update=ak_userspace_svg
ak_object2update_nodeNr=""
}
}
else
{
if(ak_which_nodeNr(object2set)=="0"){ak_deselect(evt);return}
else ak_object2update=object2set
if(!from_move) ak_init_set4object(evt)
}
// ak_object2update gesetzt
if(!from_move)
{
ak_object2update_nodeNr=ak_which_nodeNr(ak_object2update)
ak_checkLink=new Array
ak_checkLink[0]=new Array(ak_object2update,"","","")
if(ak_object2update_nodeNr!="" && ak_object2update_nodeNr!=-1 && ak_object2update_nodeNr!="0")
{
if(!object2set && evt && !ak_groupTextPath && ak_object2update.tagName=="textPath" && evt.ctrlKey()==ak_group_ctrl)
{
var ak_tmpTP=ak_which_nodeNr(ak_object2update)
if(/,/.test(ak_tmpTP) && ak_tmpTP.split(",").length>2)
{
while(ak_which_nodeNr(ak_object2update.parentNode)!='')
{
ak_object2update=ak_object2update.parentNode
}
ak_object2update_nodeNr=ak_which_nodeNr(ak_object2update)
}
}
/*else if(ak_object2update.getAttribute("ak_multi") && evt && !evt.ctrlKey())
{
var ak_tmpObject=ak_getMultiTransObject(ak_object2update)
if(/,/.test(ak_which_nodeNr(ak_tmpObject)))
{
ak_object2update=ak_tmpObject
while(ak_which_nodeNr(ak_object2update.parentNode)!='')
{
ak_object2update=ak_object2update.parentNode
}
ak_object2update_nodeNr=ak_which_nodeNr(ak_object2update)
}
}*/
else if(!object2set && evt && evt.ctrlKey()==ak_group_ctrl)
{
while(ak_which_nodeNr(ak_object2update.parentNode)!='')
{
ak_object2update=ak_object2update.parentNode
}
ak_object2update=ak_checkMultiTransform(ak_object2update)
ak_object2update_nodeNr=ak_which_nodeNr(ak_object2update)
}
if(ak_object2update.tagName=='defs') ak_actualDefs=ak_object2update
else if(ak_which_nodeNr(ak_actualDefs)==-1)
{
var ak_tmp_defs=ak_userspace_svg.getElementsByTagName('defs')
if(ak_tmp_defs) ak_actualDefs=ak_tmp_defs.item(0)
}
var ak_tmp=ak_which_nodeNr(ak_actualSelect)
if(ak_tmp!=ak_object2update_nodeNr)
{
if(ak_tmp==-1 || ak_tmp=="") ak_actualSelect=ak_object2update
else
{
ak_prevSelect=ak_getObject(ak_tmp)
ak_actualSelect=ak_object2update
}
}
while(ak_which_nodeNr(ak_checkLink[0][0])!='')
{
if(ak_checkLink[0][0].tagName=="a") break
ak_checkLink[0][0]=ak_checkLink[0][0].parentNode
}
}
}
if(ak_object2update_nodeNr==-1)
{
ak_deselect(evt)
return
}
if(ak_object2update_nodeNr!=ak_tmpOldNr) ak_pathAddPoint=false
if(ak_autoMode) ak_animate_auto('autoAdd',ak_object2update_nodeNr)
//ak_checkGradient('check')
ak_undo()
ak_obj_data[0]=ak_object2update.tagName;
for(var i=1;i<ak_SVGAttributes.length;i++)
{
ak_obj_data[i]="";
}
for(var i=1;i<ak_SVGAttributes.length;i++)
{
ak_obj_data[i]=ak_object2update.getAttribute(ak_SVGAttributes[i]);
}
ak_parentSVG_width=window.innerWidth
ak_parentSVG_height=window.innerHeight
ak_parentSVG_Array=new Array
var ak_tmp_svgArray=new Array
var ak_tmp_svg=ak_object2update
while(ak_which_nodeNr(ak_tmp_svg)!='-1' && ak_which_nodeNr(ak_tmp_svg)!='')
{
ak_tmp_svg=ak_tmp_svg.parentNode
if(ak_tmp_svg.tagName) ak_tmp_svgArray.push(ak_tmp_svg.cloneNode(0))
}
if(ak_tmp_svgArray.length>0)
{
ak_tmp_svgArray.reverse()
for(var i=0;i<ak_tmp_svgArray.length;i++)
{
if(ak_tmp_svgArray[i].getAttributeNode('width'))
{
ak_parentSVG_width=ak_getAbsolutePixel(ak_tmp_svgArray[i].getAttribute('width'),'width')
}
if(ak_tmp_svgArray[i].getAttributeNode('height'))
{
ak_parentSVG_height=ak_getAbsolutePixel(ak_tmp_svgArray[i].getAttribute('height'),'height')
}
ak_parentSVG_Array[i]=new Array(ak_parentSVG_width, ak_parentSVG_height)
}
}
for(var i=2;i<15;i++) // x y ... absolut berechnen
{
ak_obj_data[i]=ak_obj_data[i].replace(/^ +| +$/g,'')
ak_xyPercent[i]=''
if(/\%$/.test(ak_obj_data[i]))
{        
ak_xyPercent[i]='%'
ak_obj_data[i]=parseFloat(ak_obj_data[i])
if(isNaN(ak_obj_data[i])) ak_obj_data[i]=0
if(/x/.test(ak_SVGAttributes[i]) || /width/.test(ak_SVGAttributes[i])) ak_obj_data[i]=ak_round(((ak_obj_data[i]*ak_parentSVG_width)/100),ak_precision)
else ak_obj_data[i]=ak_round(((ak_obj_data[i]*ak_parentSVG_height)/100),ak_precision)
}
else if(/in$/.test(ak_obj_data[i]))
{
ak_obj_data[i]=parseFloat(ak_obj_data[i])
if(isNaN(ak_obj_data[i])) ak_obj_data[i]=0
else ak_obj_data[i]*=ak_screen_res
}
else if(/mm$/.test(ak_obj_data[i]))
{
ak_obj_data[i]=parseFloat(ak_obj_data[i])
if(isNaN(ak_obj_data[i])) ak_obj_data[i]=0
else ak_obj_data[i]*=ak_screen_res/25.4
}
else if(/cm$/.test(ak_obj_data[i]))
{
ak_obj_data[i]=parseFloat(ak_obj_data[i])
if(isNaN(ak_obj_data[i])) ak_obj_data[i]=0
else ak_obj_data[i]*=ak_screen_res/2.54
}
else if(/pt$/.test(ak_obj_data[i]))
{
ak_obj_data[i]=parseFloat(ak_obj_data[i])
if(isNaN(ak_obj_data[i])) ak_obj_data[i]=0
else ak_obj_data[i]*=ak_pt_factor
}
else if(/pc$/.test(ak_obj_data[i]))
{
ak_obj_data[i]=parseFloat(ak_obj_data[i])
if(isNaN(ak_obj_data[i])) ak_obj_data[i]=0
else ak_obj_data[i]*=ak_pc_factor
}
else if(/em$/.test(ak_obj_data[i]))
{
ak_obj_data[i]=parseFloat(ak_obj_data[i])
if(isNaN(ak_obj_data[i])) ak_obj_data[i]=0
else ak_obj_data[i]*=ak_em_factor
}
else if(/ex$/.test(ak_obj_data[i]))
{
ak_obj_data[i]=parseFloat(ak_obj_data[i])
if(isNaN(ak_obj_data[i])) ak_obj_data[i]=0
else ak_obj_data[i]*=ak_ex_factor
}
else
{
ak_obj_data[i]=parseFloat(ak_obj_data[i])
if(isNaN(ak_obj_data[i])) ak_obj_data[i]=0
}
}
ak_object2update_CTM=ak_get_overall_CTM(evt,ak_object2update)
ak_obj_control_scale=(Math.abs(ak_object2update_CTM.a)+Math.abs(ak_object2update_CTM.b)+Math.abs(ak_object2update_CTM.c)+Math.abs(ak_object2update_CTM.d))/2
var ak_grid_zoom=ak_obj_control_scale // locale variable
ak_objectStatus.setAttribute("style","fill:url(#ak_internal_edit_border);stroke:none")
var ak_tmpBBox=ak_getBBox(evt,ak_object2update)
if(!ak_BBoxValid)
{
ak_deselect(evt,"keepObjectStatus")
ak_tmp=document.getElementById("ak_g_keyTimes")
if(ak_tmp) ak_tmp.setAttribute("visibility","hidden")
ak_durSlider.setAttribute("visibility","hidden")
document.getElementById("ak_internal_edit_border").setAttribute("style","fill:#e81809")
document.getElementById("ak_translate_border").setAttribute("style","fill:#e81809")
ak_coutAuto.data=""
ak_coutMulti.data=""
ak_coutStatus.data="<"+ak_object2update.tagName+ak_getAttributeCout(ak_object2update,'id')
return
}
var ak_matrix_tmp_text="matrix("+ak_object2update_CTM.a+","+ak_object2update_CTM.b+","+ak_object2update_CTM.c+","+ak_object2update_CTM.d+","+ak_object2update_CTM.e+","+ak_object2update_CTM.f+")"
var ak_tmp_w=2
ak_toolObject.setAttribute("transform",ak_matrix_tmp_text)
var ak_tmpNode
var ak_tmpXYControl=false
if(ak_object2update.tagName=="line")
{
var ak_tmpX1=ak_getPixel(ak_object2update,"x1")
var ak_tmpY1=ak_getPixel(ak_object2update,"y1")
var ak_tmpX2=ak_getPixel(ak_object2update,"x2")
var ak_tmpY2=ak_getPixel(ak_object2update,"y2")
ak_objEdit=ak_objEditLine
ak_objEdit.setAttribute("x1",ak_tmpX1)
ak_objEdit.setAttribute("y1",ak_tmpY1)
ak_objEdit.setAttribute("x2",ak_tmpX2)
ak_objEdit.setAttribute("y2",ak_tmpY2)
ak_objEdit.setAttribute("stroke-width",(4/ak_grid_zoom))
ak_objWidth.setAttribute("x",ak_tmpX2)
ak_objWidth.setAttribute("y",ak_tmpY2)
ak_objWidth.setAttribute("width",(10/ak_grid_zoom))
ak_objWidth.setAttribute("height",(10/ak_grid_zoom))
ak_objWidth.setAttribute("stroke-width",(2/ak_grid_zoom))
ak_objControlXY.setAttribute("cx",ak_tmpX1)
ak_objControlXY.setAttribute("cy",ak_tmpY1)
ak_objControlXY.setAttribute("r",(5/ak_grid_zoom))
ak_objControlXY.setAttribute("stroke-width",(2/ak_grid_zoom))
ak_tmpXYControl=true
ak_objScale.setAttribute("visibility","hidden")
ak_objEditRect.setAttribute("visibility","hidden")
ak_rmAttribute(ak_objEditLine,"visibility")
}
else if(ak_BBoxValid==1)
{
ak_objEdit=ak_objEditRect
ak_objEdit.setAttribute("x",ak_tmpBBox.x)
ak_objEdit.setAttribute("y",ak_tmpBBox.y)
ak_objEdit.setAttribute("width",ak_tmpBBox.width)
ak_objEdit.setAttribute("height",ak_tmpBBox.height)
ak_objEdit.setAttribute("stroke-width",(2/ak_grid_zoom))
ak_objScale.setAttribute("x",ak_tmpBBox.x+ak_tmpBBox.width)
ak_objScale.setAttribute("y",ak_tmpBBox.y+ak_tmpBBox.height)
ak_objScale.setAttribute("width",(20/ak_grid_zoom))
ak_objScale.setAttribute("height",(20/ak_grid_zoom))
ak_objScale.setAttribute("stroke-width",(2/ak_grid_zoom))
ak_rmAttribute(ak_objScale,"visibility")
ak_objWidth.setAttribute("x",ak_tmpBBox.x+ak_tmpBBox.width)
ak_objWidth.setAttribute("y",ak_tmpBBox.y+ak_tmpBBox.height)
ak_objWidth.setAttribute("width",(10/ak_grid_zoom))
ak_objWidth.setAttribute("height",(10/ak_grid_zoom))
ak_objWidth.setAttribute("stroke-width",(2/ak_grid_zoom))
ak_objEditLine.setAttribute("visibility","hidden")
ak_rmAttribute(ak_objEditRect,"visibility")
ak_bbox_center_translate.x=ak_tmpBBox.x+(ak_tmpBBox.width/2)
ak_bbox_center_translate.y=ak_tmpBBox.y+(ak_tmpBBox.height/2)
}
else
{
ak_deselect(evt,"keepObjectStatus")
document.getElementById("ak_internal_edit_border").setAttribute("style","fill:#5a1")
document.getElementById("ak_translate_border").setAttribute("style","fill:#5a1")
ak_cout("<"+ak_object2update.tagName+ak_getAttributeCout(ak_object2update,'id'))
return
}
ak_objEdit.setAttribute("onmousedown","ak_MoveEditRect(evt,'down','translate')")
ak_objEdit.setAttribute("onmouseup","ak_MoveEditRectCtrl(evt,'up','translate')")
ak_objEdit.setAttribute("onmouseover","ak_MoveEditRectCtrl(evt,'over','translate')")
ak_objEdit.setAttribute("onmouseout","ak_MoveEditRectCtrl(evt,'out','translate')")
ak_objEdit.setAttribute("onclick","ak_MoveEditRectCtrl(evt,'click','translate')")
var g_append=ak_toolObject
ak_tagName_start="<"+ak_obj_data[0]
if(/^(fe)/.test(ak_object2update.tagName()))
{if(ak_object2update.getAttribute("result")!=null && ak_object2update.getAttribute("result")!="") ak_tagName_start+=' result="'+ak_object2update.getAttribute("result")+'"'}
else if(ak_object2update.getId) ak_tagName_start+=' id="'+ak_object2update.getId()+'"'
else if(ak_which_nodeNr(ak_object2update)=="") ak_tagName_start+=" (rootElement)"
var ak_tmp_forUse=true
var ak_tmp_default=false
var ak_tmpKerning=false, ak_tmpSVGFrame=false, ak_tmpPath=false, ak_tmpGradient=false
// ak_clicko                     
switch (ak_obj_data[0])
{
case "textPath":
case "tspan":
case "tref":ak_tmp_forUse=false
case "text":
case "a":
case "g":
if(ak_obj_data[0]=="g") ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'style')
else if(ak_obj_data[0]=="a") ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'xlink:href','style')
else
{
ak_tagName_cout=ak_tagName_start
if(ak_object2update.getAttribute("x")!="") ak_tagName_cout+=' x="'+ak_object2update.getAttribute("x")+'"'
if(ak_object2update.getAttribute("y")!="") ak_tagName_cout+=' y="'+ak_object2update.getAttribute("y")+'"'
if(ak_obj_data[0]!="text" && ak_object2update.getAttribute("startOffset")!="") ak_tagName_cout+=' startOffset="'+ak_object2update.getAttribute("startOffset")+'"'
ak_tagName_cout+=' style="'+ak_object2update.getAttribute("style")+'"'
}
var ak_tmp_object=ak_object2update
while(ak_tmp_object=="[object SVGTextPathElement]" || ak_tmp_object=="[object SVGTSpanElement]" || ak_tmp_object=="[object SVGTRefElement]")
{
ak_tmp_object=ak_tmp_object.parentNode
}
var ak_tmp_font_size_txt=ak_SetGetRm_styleValue(ak_object2update,"font-size","get","no_cout")
var ak_tmp_font_size=isNaN(parseFloat(ak_tmp_font_size_txt))?0:parseFloat(ak_tmp_font_size_txt)
ak_tmp_font_size=ak_tmp_font_size<0?0:ak_tmp_font_size
if(/pt/.test(ak_tmp_font_size_txt)) ak_tmp_font_size=ak_round((ak_tmp_font_size/0.8),10)
if(/%/.test(ak_tmp_font_size_txt)) ak_tmp_font_size=ak_round((ak_tmp_font_size/10),10)
var ak_tmpKern=parseFloat(ak_SetGetRm_styleValue(ak_object2update,"kerning","get","no_cout"))
ak_tmpKern=isNaN(ak_tmpKern)?0:ak_tmpKern
ak_txKerning=parseFloat(ak_SetGetRm_styleValue(ak_object2update,"letter-spacing","get","no_cout"))
ak_txKerning=isNaN(ak_txKerning)?0:ak_txKerning
ak_txKerning+=ak_tmpKern
ak_txWordSpace=parseFloat(ak_SetGetRm_styleValue(ak_object2update,"word-spacing","get","no_cout"))
ak_txWordSpace=isNaN(ak_txWordSpace)?0:ak_txWordSpace
ak_objControlXY.setAttribute("cx",ak_tmpBBox.x)
ak_objControlXY.setAttribute("cy",(ak_tmpBBox.y+ak_tmpBBox.height-ak_tmp_font_size))
ak_objControlXY.setAttribute("r",5/ak_grid_zoom)
ak_objControlXY.setAttribute("stroke-width",2/ak_grid_zoom)
ak_objControlXYLine.setAttribute("x1",ak_tmpBBox.x)
ak_objControlXYLine.setAttribute("y1",ak_tmpBBox.y+ak_tmpBBox.height)
ak_objControlXYLine.setAttribute("x2",ak_tmpBBox.x)
ak_objControlXYLine.setAttribute("y2",(ak_tmpBBox.y+ak_tmpBBox.height-ak_tmp_font_size))
ak_objControlXYLine.setAttribute("stroke-width",1/ak_grid_zoom)
ak_tmpXYControl=true
var ak_tmpKerningChild=ak_objKerning.firstChild
ak_tmpKerningChild.setAttribute("x1",ak_tmpBBox.x)
ak_tmpKerningChild.setAttribute("y1",ak_tmpBBox.y+ak_tmpBBox.height)
ak_tmpKerningChild.setAttribute("x2",ak_tmpBBox.x)
ak_tmpKerningChild.setAttribute("y2",(ak_tmpBBox.y+ak_tmpBBox.height+(40/ak_grid_zoom)))
ak_tmpKerningChild.setAttribute("stroke-width",4/ak_grid_zoom)
ak_tmpKerning=true
var ak_tmp_mal=5
ak_kerningRes=ak_tmp_mal
ak_tmpKerningChild=ak_tmpKerningChild.nextSibling
ak_tmpKerningChild.setAttribute("x1",ak_tmpBBox.x)
ak_tmpKerningChild.setAttribute("y1",ak_tmpBBox.y+ak_tmpBBox.height+(20/ak_grid_zoom))
ak_tmpKerningChild.setAttribute("x2",ak_tmpBBox.x+(ak_txKerning*ak_tmp_mal))
ak_tmpKerningChild.setAttribute("y2",ak_tmpBBox.y+ak_tmpBBox.height+(20/ak_grid_zoom))
ak_tmpKerningChild.setAttribute("stroke-width",1/ak_grid_zoom)
ak_tmpKerningChild=ak_tmpKerningChild.nextSibling
ak_tmpKerningChild.setAttribute("cx",ak_tmpBBox.x+(ak_txKerning*ak_tmp_mal))
ak_tmpKerningChild.setAttribute("cy",ak_tmpBBox.y+ak_tmpBBox.height+(20/ak_grid_zoom))
ak_tmpKerningChild.setAttribute("r",(5/ak_grid_zoom))
ak_tmpKerningChild.setAttribute("stroke-width",2/ak_grid_zoom)
ak_tmp_mal=2
ak_wordspacingRes=ak_tmp_mal
ak_tmpKerningChild=ak_tmpKerningChild.nextSibling
ak_tmpKerningChild.setAttribute("x1",ak_tmpBBox.x)
ak_tmpKerningChild.setAttribute("y1",ak_tmpBBox.y+ak_tmpBBox.height+(40/ak_grid_zoom))
ak_tmpKerningChild.setAttribute("x2",ak_tmpBBox.x+(ak_txWordSpace*ak_tmp_mal))
ak_tmpKerningChild.setAttribute("y2",ak_tmpBBox.y+ak_tmpBBox.height+(40/ak_grid_zoom))
ak_tmpKerningChild.setAttribute("stroke-width",1/ak_grid_zoom)
ak_tmpKerningChild=ak_tmpKerningChild.nextSibling
ak_tmpKerningChild.setAttribute("cx",ak_tmpBBox.x+(ak_txWordSpace*ak_tmp_mal))
ak_tmpKerningChild.setAttribute("cy",ak_tmpBBox.y+ak_tmpBBox.height+(40/ak_grid_zoom))
ak_tmpKerningChild.setAttribute("r",(5/ak_grid_zoom))
ak_tmpKerningChild.setAttribute("stroke-width",2/ak_grid_zoom)
break;
case "line":
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'x1','y1','x2','y2')
break
case "rect":
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'x','y','width','height','rx','ry')
ak_objControlXY.setAttribute("cx",(ak_tmpBBox.x+ak_obj_data[13]))
ak_objControlXY.setAttribute("cy",(ak_tmpBBox.y+ak_obj_data[14]))
ak_objControlXY.setAttribute("r",5/ak_grid_zoom)
ak_objControlXY.setAttribute("stroke-width",2/ak_grid_zoom)
ak_objControlXYLine.setAttribute("x1",ak_tmpBBox.x)
ak_objControlXYLine.setAttribute("y1",ak_tmpBBox.y)
ak_objControlXYLine.setAttribute("x2",ak_tmpBBox.x+ak_obj_data[13])
ak_objControlXYLine.setAttribute("y2",ak_tmpBBox.y+ak_obj_data[14])
ak_objControlXYLine.setAttribute("stroke-width",1/ak_grid_zoom)
ak_tmpXYControl=true
break
case "image":
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'x','y','width','height','xlink:href','preserveAspectRatio')
break
case "use":
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'x','y','xlink:href')
break
case "circle":
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'cx','cy','r')
break
case "ellipse":
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'cx','cy','rx','ry')
break
case "polyline":
case "polygon":
ak_tagName_cout=ak_tagName_start+' points="'+ak_obj_data[18]+'"'
if (ak_tagName_cout.length>124) ak_tagName_cout=ak_tagName_cout.substring(0,120)+" ..."
if(ak_edit_which_attribute=="xy_etc")
{
if(from_move=="no_ak_init_set4object")
{
for(var i=0;i<ak_EditArray_work.length;i++)
{
ak_EditArray_enter[i]=ak_EditArray_work[i]
}
}
else
{
ak_EditPathPoints_enter=ak_obj_data[18].replace(/,/g," ") // alle Kommas mit spaces ersetzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/\+/g," ") // alle pluszeichen mit spaces ersetzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/\-/g," -") // alle minuszeichen mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/\s\s+/g," ") // mehrfach whitespaces raus
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/^ +/g,"") // spaces am Anfang raus
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/ $/g,"") // spaces am Ende raus
ak_EditArray_enter=ak_EditPathPoints_enter.split(" ")
for(var i=0;i<ak_EditArray_enter.length;i++)
{
ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
}
ak_EditArray_work=new Array
for(var i=0;i<ak_EditArray_enter.length;i++)
{
ak_EditArray_work[i]=ak_EditArray_enter[i]
}
}
}
break
case "path":
ak_path_symOn=true
ak_tmpPath=true
if(ak_path_symOn)
{
ak_path_attr=ak_object2update.getAttribute("ak_path")
if(ak_path_attr && /;/.test(ak_path_attr))
{
ak_path_attr=ak_path_attr.split(";")
if(ak_path_attr[5]=="no_edit")
{
ak_path_attr=false
ak_tagName_cout=ak_tagName_start+' d="'+ak_obj_data[19]+'"'
}
else
{
ak_path_attr[0]=parseFloat(ak_path_attr[0])
if(isNaN(ak_path_attr[0])) ak_path_attr[0]=3
ak_path_attr[3]=parseFloat(ak_path_attr[3])
if(isNaN(ak_path_attr[3])) ak_path_attr[3]=100
ak_path_attr[4]=parseFloat(ak_path_attr[4])
if(isNaN(ak_path_attr[4])) ak_path_attr[4]=100
ak_obj_data[19]=ak_path_attr[2]
ak_path_attr_enter=new Array
for(var i=0;i<ak_path_attr.length;i++)
{
ak_path_attr_enter[i]=ak_path_attr[i]
}
ak_tagName_cout=ak_tagName_start+' ak_path="'+ak_path_attr.join(";")+'"'
}
}
else
{
ak_path_attr=false
ak_tagName_cout=ak_tagName_start+' d="'+ak_obj_data[19]+'"'
}
}
else
{
ak_path_attr=false
ak_tagName_cout=ak_tagName_start+' d="'+ak_obj_data[19]+'"'
}
if (ak_tagName_cout.length>124) ak_tagName_cout=ak_tagName_cout.substring(0,120)+" ...";
if(ak_edit_which_attribute=="xy_etc")
{
if(from_move=="no_ak_init_set4object")
{
for(var i=0;i<ak_EditArray_work.length;i++)
{
ak_EditArray_enter[i]=ak_EditArray_work[i]
}
ak_EditArray_MCZ=ak_EditArray_enter
ak_set_path_control()
}
else
{
ak_path_conversion()
ak_EditArray_enter=ak_EditArray_MCZ
ak_EditArray_work=new Array
for(var i=0;i<ak_EditArray_enter.length;i++)
{
ak_EditArray_work[i]=ak_EditArray_enter[i]
}
ak_set_path_control()
}
}
break
case "svg":
ak_viewBox=ak_object2update.getAttribute('viewBox')
if(ak_viewBox)
{
ak_viewBox=ak_viewBox.replace(/^ +| +$/g,'')
ak_viewBox=ak_viewBox.replace(/ +/g,' ')
if(/ /.test(ak_viewBox))
{
ak_viewBox=ak_viewBox.split(' ')
for(var i=0; i<4;i++)
{
ak_viewBox[i]=parseFloat(ak_viewBox[i])
ak_viewBox[i]=isNaN(ak_viewBox[i])?0:ak_viewBox[i]
}
}
else ak_viewBox=new Array(0,0,ak_obj_data[4],ak_obj_data[5])
}
else ak_viewBox=new Array(0,0,ak_obj_data[4],ak_obj_data[5])
ak_tmp_forUse=false
ak_toolSVGFrame.setAttribute("x",0)
ak_toolSVGFrame.setAttribute("y",0)
ak_toolSVGFrame.setAttribute("width",ak_obj_data[4])
ak_toolSVGFrame.setAttribute("height",ak_obj_data[5])
ak_tmpSVGFrame=true
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'x','y','width','height','viewBox','preserveAspectRatio')
break
case "clipPath":
ak_tmp_forUse=false
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'clipPathUnits')
break
case "symbol": // yes for ak_tmp_forUse
ak_tagName_cout=ak_tagName_start
break
case "marker":
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'refX','refY','markerWidth','markerHeight','orient')
var ak_tmp_id=ak_object2update.getId()
ak_markerWidth=ak_object2update.getAttribute("markerWidth")
ak_markerWidth=isNaN(ak_markerWidth)?3:parseInt(ak_markerWidth)
ak_markerWidth=ak_markerWidth<3?3:ak_markerWidth
ak_markerHeight=ak_object2update.getAttribute("markerHeight")
ak_markerHeight=isNaN(ak_markerHeight)?3:parseInt(ak_markerHeight)
ak_markerHeight=ak_markerHeight<3?3:ak_markerHeight
ak_markerX=ak_object2update.getAttribute("refX")
ak_markerX=isNaN(ak_markerX)?0:parseInt(ak_markerX)
ak_markerY=ak_object2update.getAttribute("refY")
ak_markerY=isNaN(ak_markerY)?0:parseInt(ak_markerY)
ak_markerOrient=ak_object2update.getAttribute("orient")
if(ak_markerOrient=="auto") ak_markerAuto=true
else ak_markerAuto=false
if(ak_markerAuto) var ak_tmp_color="#000"
else  var ak_tmp_color="#ff006a"
ak_markerOrient=isNaN(ak_markerOrient)?0:parseInt(ak_markerOrient)
while(ak_markerOrient<0) {ak_markerOrient+=360}
while(ak_markerOrient>=360) {ak_markerOrient-=360}
ak_gradient_vector.x=(ak_markerWidth+ak_markerHeight)/1.8
ak_gradient_vector.y=0
var ak_tmp_matrix=ak_svgroot.createSVGMatrix()
ak_tmp_matrix=ak_tmp_matrix.rotate(ak_markerOrient)
ak_gradient_vector=ak_gradient_vector.matrixTransform(ak_tmp_matrix)
var ak_tmp_elements=parseXML("<g id='ak_gradient_control_g' style='stroke:#000;stroke-width:"+(1/ak_grid_zoom)+";fill-opacity:1'/>",document).firstChild
g_append.replaceChild(ak_tmp_elements,ak_toolGradient)
ak_toolGradient=ak_tmp_elements
g_append=ak_toolGradient
ak_tmpGradient=true
var ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
var ak_tmp_elements="<rect id='ak_gradient_line1' x='0' y='0' width='"+ak_markerWidth+"' height='"+ak_markerHeight
ak_tmp_elements+="' style='fill-opacity:0;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_markerXY")'
ak_tmp_elements="<line id='ak_gradient_circle2' x1='"+ak_markerX+"' y1='"+ak_markerY+"' x2='"+(ak_markerX+ak_gradient_vector.x)+"' y2='"+(ak_markerY+ak_gradient_vector.y)
ak_tmp_elements+="' style='stroke:#fff;stroke-width:1;stroke-opacity:0.75;marker-start:url(#"+ak_object2update.getId()+")'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_markerXY")'
ak_tmp_elements="<circle id='ak_gradient_circle1' cx='"+ak_markerX+"' cy='"+ak_markerY+"' r='"+(11/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#ddd;fill-opacity:0;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_markerRotate")'
ak_tmp_elements="<circle cx='"+(ak_markerX+ak_gradient_vector.x)+"' cy='"+(ak_markerY+ak_gradient_vector.y)+"' r='"+(11/ak_grid_zoom)
ak_tmp_elements+="' style='fill:"+ak_tmp_color+";stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_markerWH")'
ak_tmp_elements="<rect id='ak_pattern_rect2' x='"+ak_markerWidth+"' y='"+ak_markerHeight+"' width='"+(10/ak_grid_zoom)+"' height='"+(10/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#000;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
default:
ak_tmp_default=true
ak_tmp_forUse=false
if(ak_object2update.tagName!="marker") ak_tagName_cout=ak_tagName_start
break
}// ende switch for object
ak_canUsed=ak_tmp_forUse
if(ak_tmpXYControl)
{
ak_rmAttribute(ak_objControlXY,"visibility")
ak_rmAttribute(ak_objControlXYLine,"visibility")
}
else
{
ak_objControlXY.setAttribute("visibility","hidden")
ak_objControlXYLine.setAttribute("visibility","hidden")
}
if(ak_tmpGradient) ak_rmAttribute(ak_toolGradient,"visibility")
else ak_toolGradient.setAttribute("visibility","hidden")
if(ak_tmpKerning) ak_rmAttribute(ak_objKerning,"visibility")
else ak_objKerning.setAttribute("visibility","hidden")
if(ak_tmpSVGFrame) ak_toolSVGFrame.setAttribute("visibility","visible")
else ak_toolSVGFrame.setAttribute("visibility","hidden")
if(ak_tmpPath && !ak_hide_pathPoints) ak_rmAttribute(ak_toolPath,"visibility")
else ak_setAttribute(ak_toolPath,"visibility","hidden")
var ak_tmpMulti=ak_object2update.getAttribute("ak_multi")
if(ak_tmpMulti) ak_tmpMulti="-multiTransform"
else ak_tmpMulti=""
//var ak_tmpMulti=""
var ak_tmp_parents=0
if(/,/.test(ak_object2update_nodeNr))
{
ak_tmp_parents=ak_object2update_nodeNr.split(",")
ak_tmp_parents=ak_tmp_parents.length-1
}
ak_tmp_parents+=ak_tmpMulti
if(ak_object2update.tagName=="line")
{
var ak_tmp_x=(ak_obj_data[8]+(10/ak_grid_zoom))
var ak_tmp_y=(ak_obj_data[9]+(-2/ak_grid_zoom))
if(ak_obj_data[6]>ak_obj_data[8])
{
ak_tmp_x=(ak_obj_data[8]+(-3/ak_grid_zoom))
ak_tmp_y=(ak_obj_data[9]+(9/ak_grid_zoom))
ak_freezeTextBefore.firstChild.data=""
ak_freezeTextBehind.firstChild.data=ak_tmp_parents
ak_freezeTextBefore.setAttribute("text-anchor","end")
}
else
{
ak_freezeTextBefore.firstChild.data=ak_tmp_parents
ak_freezeTextBehind.firstChild.data=""
ak_freezeTextBefore.setAttribute("text-anchor","begin")
}
ak_freezeTextBefore.setAttribute("x",ak_tmp_x)
ak_freezeTextBefore.setAttribute("y",ak_tmp_y)
if(ak_tmp_parents!="0")
{
ak_freezeTextBefore.setAttribute("style","fill-opacity:1;fill:#f0c;stroke:none;font-size:"+(12/ak_grid_zoom))
}
else if(ak_object2update_nodeNr!='')
{
ak_freezeTextBefore.setAttribute("style","fill-opacity:1;fill:#f70;stroke:none;font-size:"+(12/ak_grid_zoom))
}
}
else
{
ak_freezeTextBefore.setAttribute("x",ak_tmpBBox.x+ak_tmpBBox.width)
ak_freezeTextBefore.setAttribute("y",ak_tmpBBox.y)
if(ak_tmp_parents!="0")
{
ak_freezeTextBefore.firstChild.data=ak_tmp_parents
ak_freezeTextBehind.firstChild.data=""
ak_freezeTextBefore.setAttribute("style","fill-opacity:1;fill:#f0c;stroke:none;font-size:"+(12/ak_grid_zoom))
}
else if(ak_object2update_nodeNr!='')
{
ak_freezeTextBefore.firstChild.data="0"
ak_freezeTextBehind.firstChild.data=""
ak_freezeTextBefore.setAttribute("style","fill-opacity:1;fill:#f70;stroke:none;font-size:"+(12/ak_grid_zoom))
}
}
if(ak_checkLink[0][0].tagName=="a")
{
ak_checkLink[0][1]=ak_checkLink[0][0].getAttribute("xlink:href")
ak_objAWrapper.setAttribute("xlink:href",ak_checkLink[0][1])
ak_objAWrapper.setAttribute("style","visibility:hidden")
ak_objAWrapper.firstChild.setAttribute("x",ak_tmpBBox.x)
ak_objAWrapper.firstChild.setAttribute("y",ak_tmpBBox.y)
ak_objAWrapper.firstChild.setAttribute("width",ak_tmpBBox.width)
ak_objAWrapper.firstChild.setAttribute("height",ak_tmpBBox.height)
}
else
{
ak_objAWrapper.setAttribute("xlink:href","")
ak_objAWrapper.setAttribute("style","visibility:hidden")
ak_objAWrapper.firstChild.setAttribute("width",0)
ak_objAWrapper.firstChild.setAttribute("height",0)
}
ak_objXY=document.getElementById("ak_tmp_edit_control_xy")
if(ak_objXY) ak_objXY.setAttribute("onmousedown","ak_MoveEditRect(evt,'down','xy_control')");
else ak_objXY=false
if(!ak_tmp_default && ak_object2update.tagName!='line') {}
else ak_objRotateCenter.setAttribute("visibility","hidden")
ak_rotateX=ak_SetGetRm_transformValue(ak_object2update,"rotateCenter","get","no_cout")
if(ak_rotateX=="false") ak_rotateX="0,0"
if(ak_SetGetRm_transformValue(ak_object2update,"rotate","get","no_cout")=="false")
{
ak_rotateX=0; ak_rotateY=0
ak_objRotateCenterPoint.setAttribute("visibility","hidden")
ak_objRotateCenterPoint.setAttribute("transform","translate("+(ak_tmpBBox.x+(ak_tmpBBox.width/2))+","+(ak_tmpBBox.y+(ak_tmpBBox.height/2))+")")
}
else
{
ak_rmAttribute(ak_objRotateCenterPoint,"visibility")
ak_rotateX=ak_rotateX.split(",")
ak_rotateY=ak_round(parseFloat(ak_rotateX[1]),ak_precision)
ak_rotateX=ak_round(parseFloat(ak_rotateX[0]),ak_precision)
var ak_a=7/ak_grid_zoom
var ak_b=10/ak_grid_zoom
ak_rotateMatrix=ak_SetGetRm_transformValue(ak_object2update,"rotate","get","get_restmatrix")
var ak_tmp_rMatrix=ak_rotateMatrix.inverse
var ak_tmpTransformTxT='matrix('+ak_tmp_rMatrix.a+","+ak_tmp_rMatrix.b+","+ak_tmp_rMatrix.c+","+ak_tmp_rMatrix.d+","+ak_tmp_rMatrix.e+","+ak_tmp_rMatrix.f+')'
var ak_tmp_scale=(Math.abs(ak_tmp_rMatrix.a)+Math.abs(ak_tmp_rMatrix.b)+Math.abs(ak_tmp_rMatrix.c)+Math.abs(ak_tmp_rMatrix.d))/2
ak_tmpTransformTxT+='translate('+ak_rotateX+','+ak_rotateY+')scale('+(1/ak_grid_zoom)+'),scale('+(1/ak_tmp_scale)+')'
ak_objRotateCenterPoint.setAttribute("transform",ak_tmpTransformTxT)
ak_rmAttribute(ak_objRotateCenter,"vibility")
}
if(!from_move) ak_set_toolbox=true
if(evt && evt.ctrlKey()) ak_clickCtrl=true
else ak_clickCtrl=false
if(!object2set && from_move!="no_ak_init_set4object" && from_move!="no_toolbox")
{
if(ak_edit_which_attribute=="xy_etc") ak_MoveEditRect(evt,"down","translate")
else ak_MoveEditRect(evt,"down","translate",1)
}
else if(object2set) ak_selection('show')
if(ak_edit_which_attribute=="xy_etc") ak_switch_xy_transform("xy_etc_no_ak_clickset_obj2update")
else ak_switch_xy_transform(ak_edit_which_attribute)
if(ak_which_nodeNr(ak_object2update)==-1) 
{
ak_set_path_point=false
ak_add_pathPoint(false)
ak_SetGetRm_styleValue(ak_objWidth,"visibility","hidden","no_cout")
ak_tagName_cout="no selection!"
}
ak_init_set4object(evt)
if(ak_edit_gradient_flag) ak_set_gradient_control(evt) //  hier gehts zu den Gradienten
if(ak_edit_gradient_flag!="gradient" && ak_sliderArrayV3[4][0].parentNode.getAttribute("visibility")!="hidden") ak_sliderArrayV3[4][0].parentNode.setAttribute("visibility","hidden")
if(ak_edit_gradient_flag!="filter" && ak_sliderArrayV3[5][0].parentNode.getAttribute("visibility")!="hidden") ak_sliderArrayV3[5][0].parentNode.setAttribute("visibility","hidden")
}
var ak_freezeText=false, ak_clickCtrl=false
//### ak_clicke #####################################
var ak_set_toolbox=false
function ak_set_attribute(action,what,to_what,click_set,no_push)
{
var ak_tmp_object=ak_object2update
if(action=="attribute")
{
if(to_what) ak_tmp_object.setAttribute(what,to_what)
else {try{ak_tmp_object.removeAttribute(what)}catch(error){}}
if(!no_push) ak_push2undoTrue()
}
else if(action=="attribute_set")
{
ak_tmp_object.setAttribute(what,to_what)
if(!no_push) ak_push2undoTrue()
}
else if(action=="xlink_absolute")
{
var ak_tmp_link=ak_tmp_object.getAttribute("xlink:href")
if(/\:/.test(ak_tmp_link)) return
if(/\.\.\\/.test(ak_tmp_link))
{
var ak_tmp_file=ak_tmp_link.split("\\")
var ak_tmp_dir=new Array(ak_directory)
if(/\\/.test(ak_directory)) ak_tmp_dir=ak_directory.split("\\")
while(ak_tmp_file[0]=="..")
{
ak_tmp_file.shift()
ak_tmp_dir.pop()
}
ak_tmp_object.setAttribute("xlink:href",ak_tmp_dir.join("\\")+"\\"+ak_tmp_file.join("\\"))
}
else ak_tmp_object.setAttribute("xlink:href",ak_directory+"\\"+ak_tmp_link)
if(!no_push) ak_push2undoTrue()
}
else if(action=="dialog")
{
ak_fileSelectSuccess="ak_set_attribute('attribute_set','xlink:href',ak_fileSelectFile,'no_color')"
ak_fileSelectCancel=""
ak_file_selector=ak_tmp_object.getAttribute("xlink:href")
if(!/^http/.test(ak_file_selector.toLowerCase()) && /\\/.test(ak_file_selector))
{
ak_dir_selector=ak_file_selector.split("\\")
ak_file_selector=ak_dir_selector.pop()
ak_dir_selector=ak_dir_selector.join("\\")
}
else
{
ak_dir_selector=ak_directory
ak_file_selector=""
}
ak_SVGSaver('fileSelect')
return
}
else if(action=="manual")
{
var ak_tmp_in=prompt('Please Enter '+what+'!',to_what)
window.focus(ak_svgroot)
if(ak_tmp_in==null) return
ak_tmp_in=ak_tmp_in.replace(/^ +| +$/,'')
if(ak_tmp_in)
{
ak_tmp_object.setAttribute(what,ak_tmp_in)
if(what=="xlink:href" && ak_checkLink[0][0].tagName=="a")
{
ak_checkLink[0][1]=ak_checkLink[0][0].getAttribute("xlink:href")
document.getElementById('ak_a_wrapper').setAttribute('xlink:href',ak_checkLink[0][1])
}
}
else
{
try{ak_tmp_object.removeAttribute(what)}catch(error){}
if(what=="xlink:href" && ak_checkLink[0][0].tagName=="a")
{
document.getElementById('ak_a_wrapper').setAttribute('xlink:href','')
}
}
if(!no_push) ak_push2undoTrue()
}
if(click_set=="no_color") ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
else if(click_set=="no_tool") ak_clickset_obj2update(evt,ak_object2update,"no_toolbox")
else if(click_set) ak_clickset_obj2update(evt,ak_object2update)
}
//########################################
function ak_edit_svg(action,what_1,what_2)
{
switch(action)
{
case 'x0y0':
ak_object2update.setAttribute('x',0)
ak_object2update.setAttribute('y',0)
break
case 'x0y0Percent':
ak_object2update.setAttribute('x','0%')
ak_object2update.setAttribute('y','0%')
break
case 'removeXY':
try{ak_object2update.removeAttribute('x')}catch(error){}
try{ak_object2update.removeAttribute('y')}catch(error){}
break
case 'width_height':
ak_object2update.setAttribute('width',what_1)
ak_object2update.setAttribute('height',what_2)
break
case 'removeWH':
try{ak_object2update.removeAttribute('width')}catch(error){}
try{ak_object2update.removeAttribute('height')}catch(error){}
break
case 'viewBox':
ak_object2update.setAttribute('viewBox','0 0 '+ak_round(ak_obj_data[4]*what_1,ak_precision)+' '+ak_round(ak_obj_data[5]*what_1,ak_precision))
break
case 'removeView':
try{ak_object2update.removeAttribute('viewBox')}catch(error){}
break
case 'aspect':
ak_object2update.setAttribute('preserveAspectRatio',what_1)
break
case 'removeAspect':
try{ak_object2update.removeAttribute('preserveAspectRatio')}catch(error){}
break
}
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
//########################################
function ak_edit_encoding(action,what_1,what_2)
{
ak_dirty_flag=true
var ak_tmp_header=ak_svg_header
if(ak_svg_header2) ak_tmp_header=ak_svg_header2
var ak_tmp_back=ak_tmp_header.search(/\?\>/)
var ak_tmp_front=ak_tmp_header.search(/encoding *= *\".*\"/)
var ak_tmp_enc_txt=what_1
var ak_svgMenu='<menu id="ak_encoding_menu"><header>&lt;?xml encoding="'+ak_tmp_enc_txt+'"</header>'
if(ak_tmp_front==-1)
{
if(/^\<\?xml /.test(ak_tmp_header))
{
var ak_i1=ak_tmp_header.search(/\?\>/)
var ak_i2=ak_tmp_header.search(/\" /)
if(ak_i2==-1 || ak_i2>ak_i1) ak_svg_header2=ak_tmp_header.replace(/\"\?/,'" encoding="'+ak_tmp_enc_txt+'"?')
else ak_svg_header2=ak_tmp_header.replace(/\" /,'" encoding="'+ak_tmp_enc_txt+'" ')
}
else ak_svg_header2='<?xml version="1.0" encoding="'+ak_tmp_enc_txt+'" standalone="no"?>\n'+ak_tmp_header
}
else
{
ak_tmp_enc_txt=ak_tmp_header.substring(ak_tmp_front)
var ak_tmp_front_txt=ak_tmp_header.substring(0,ak_tmp_front)
ak_tmp_front=ak_tmp_enc_txt.search(/\"/)
ak_tmp_front_txt+=ak_tmp_enc_txt.substring(0,ak_tmp_front+1)
ak_tmp_enc_txt=ak_tmp_enc_txt.substring(ak_tmp_front+1)
ak_tmp_front=ak_tmp_enc_txt.search(/\"/)
var ak_tmp_back_txt=ak_tmp_enc_txt.substring(ak_tmp_front)
ak_tmp_enc_txt=ak_tmp_enc_txt.substring(0,ak_tmp_front)
ak_tmp_enc_txt=ak_tmp_enc_txt.replace(/^ +| +$/g,"")
ak_tmp_enc_txt=what_1
ak_svg_header2=ak_tmp_front_txt+ak_tmp_enc_txt+ak_tmp_back_txt
ak_svgMenu='<menu id="ak_encoding_menu"><header>&lt;?xml encoding="'+ak_tmp_enc_txt+'"</header>'
}
if(ak_tmp_enc_txt.toUpperCase()=="UTF-8") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_encoding('setEncoding','UTF-8')"+'">UTF-8</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_encoding('setEncoding','UTF-8')"+'">UTF-8</item>'
if(ak_tmp_enc_txt.toUpperCase()=="ISO-8859-1") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_encoding('setEncoding','ISO-8859-1')"+'">ISO-8859-1</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_encoding('setEncoding','ISO-8859-1')"+'">ISO-8859-1</item>'
if(ak_tmp_enc_txt.toLowerCase()=="us-ascii") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_encoding('setEncoding','us-ascii')"+'">us-ascii</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_encoding('setEncoding','us-ascii')"+'">us-ascii</item>'
ak_svgMenu+='</menu><separator/>'
ak_encodingMenu=ak_svgMenu
if(!what_2)
{
ak_cout('encoding="'+ak_tmp_enc_txt+'", [Ctrl+S]save and [F5]reload to activate!')
ak_alert('encoding="'+ak_tmp_enc_txt+'"\nUse [Ctrl+S]save and [F5]reload to activate!')
}
}
//########################################
function ak_setSVGMenu(evt)
{
var ak_svgMenu='<menu id="ak_svg_submenu"><header>SVG Attributes</header>'
ak_svgMenu+='<item onactivate="ak_main_menu(\'EnterSVGwidth\')">Enter width/height  ('
ak_svgMenu+=ak_userspace_svg.getAttribute("width")+","+ak_userspace_svg.getAttribute("height")+')</item>'
if(ak_object2update.getAttribute("x")=="0" && ak_object2update.getAttribute("y")=="0")
{ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('x0y0')"+'">x="0"  y="0"</item>'}
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('x0y0')"+'">x="0"  y="0"</item>'
if(ak_object2update_nodeNr=="")
{ak_svgMenu+='<item enabled="no" onactivate="'+"ak_edit_svg('x0y0Percent')"+'">x="0%"  y="0%"</item>'}
else if(ak_object2update.getAttribute("x")=="0%" && ak_object2update.getAttribute("y")=="0%")
{ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('x0y0Percent')"+'">x="0%"  y="0%"</item>'}
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('x0y0Percent')"+'">x="0%"  y="0%"</item>'
ak_svgMenu+='<separator/>'
var ak_tmp_wh=ak_object2update.getAttribute("width")+"x"+ak_object2update.getAttribute("height")
ak_svgMenu+='<menu><header>width  height</header>'
if(ak_tmp_wh=="160x120") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('width_height','160','120')"+'">160 x 120</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('width_height','160','120')"+'">160 x 120</item>'
if(ak_tmp_wh=="320x240") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('width_height','320','240')"+'">320 x 240</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('width_height','320','240')"+'">320 x 240</item>'
if(ak_tmp_wh=="640x480") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('width_height','640','480')"+'">640 x 480</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('width_height','640','480')"+'">640 x 480</item>'
if(ak_tmp_wh=="720x576") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('width_height','720','576')"+'">720 x 576</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('width_height','720','576')"+'">720 x 576</item>'
if(ak_tmp_wh=="768x576") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('width_height','768','576')"+'">768 x 576</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('width_height','768','576')"+'">768 x 576</item>'
if(ak_tmp_wh=="800x600") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('width_height','800','600')"+'">800 x 600</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('width_height','800','600')"+'">800 x 600</item>'
if(ak_tmp_wh=="1024x768") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('width_height','1024','768')"+'">1024 x 768</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('width_height','1024','768')"+'">1024 x 768</item>'
ak_svgMenu+='<separator/>'
if(ak_tmp_wh=="40%x30%") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('width_height','40%','30%')"+'">40% x 30%</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('width_height','40%','30%')"+'">40% x 30%</item>'
if(ak_tmp_wh=="50%x50%") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('width_height','50%','50%')"+'">50% x 50%</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('width_height','50%','50%')"+'">50% x 50%</item>'
ak_svgMenu+='</menu>'
if(ak_tmp_wh=="100%x100%") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('width_height','100%','100%')"+'">100% x 100%</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('width_height','100%','100%')"+'">100% x 100%</item>'
ak_svgMenu+='<separator/>'
var ak_tmp_view=ak_object2update.getAttribute("viewBox")
if(ak_tmp_view)
{
ak_tmp_view=ak_tmp_view.replace(/^ +| +$/g,"")
ak_tmp_view=ak_tmp_view.replace(/,/g," ")
ak_tmp_view=ak_tmp_view.replace(/ +/g," ")
if(/ /.test(ak_tmp_view))
{
ak_tmp_view=ak_tmp_view.split(" ")
for(var i=0;i<4;i++)
{
ak_tmp_view[i]=parseFloat(ak_tmp_view[i])
ak_tmp_view[i]=isNaN(ak_tmp_view[i])?0:ak_tmp_view[i]
}
if(!ak_tmp_view[2] || !ak_tmp_view[3]) ak_svgMenu+='<menu><header>viewBox  (?)</header>'
else
{
var ak_tmpX=ak_round(ak_obj_data[4]/ak_tmp_view[2],ak_precision)
var ak_tmpY=ak_round(ak_obj_data[5]/ak_tmp_view[3],ak_precision)
if(ak_tmpX>ak_tmpY) ak_tmpX=ak_tmpY
if(ak_tmpX<=1)
{
ak_svgMenu+='<menu><header>viewBox  (1 : '+ak_round(1/ak_tmpX,ak_precision)+')</header>'
}
else ak_svgMenu+='<menu><header>viewBox  ('+ak_tmpX+' : 1)</header>'
}
}
}
else ak_svgMenu+='<menu><header>viewBox</header>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',1)"+'">1 : 1</item>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',1/2)"+'">2 : 1</item>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',1/3)"+'">3 : 1</item>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',1/4)"+'">4 : 1</item>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',1/5)"+'">5 : 1</item>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',1/6)"+'">6 : 1</item>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',1/7)"+'">7 : 1</item>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',1/8)"+'">8 : 1</item>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',1/9)"+'">9 : 1</item>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',1/10)"+'">10 : 1</item>'
ak_svgMenu+='<separator/>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',10)"+'">1 : 10</item>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',9)"+'">1 : 9</item>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',8)"+'">1 : 8</item>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',7)"+'">1 : 7</item>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',6)"+'">1 : 6</item>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',5)"+'">1 : 5</item>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',4)"+'">1 : 4</item>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',3)"+'">1 : 3</item>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',2)"+'">1 : 2</item>'
ak_svgMenu+='<item onactivate="'+"ak_edit_svg('viewBox',1)"+'">1 : 1</item>'
ak_svgMenu+='</menu>'
if(!ak_tmp_view) ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('removeView')"+'">Remove  viewBox</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('removeView')"+'">Remove  viewBox</item>'
ak_svgMenu+='<separator/>'
ak_svgMenu+='<menu><header>preserveAspectRatio</header>'
var ak_tmp_preserve=ak_object2update.getAttribute("preserveAspectRatio")
var ak_tmp
for(var i=0;i<ak_preserve.length;i++)
{
if(ak_preserve[i]=="xMidYMid") ak_tmp=" (def.)"
else ak_tmp=""
if(ak_tmp_preserve==ak_preserve[i]+" meet") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('aspect','"+ak_preserve[i]+" meet')"+'">'+ak_preserve[i]+' meet'+ak_tmp+'</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('aspect','"+ak_preserve[i]+" meet')"+'">'+ak_preserve[i]+' meet'+ak_tmp+'</item>'
}
ak_svgMenu+='<separator/>'
for(var i=0;i<ak_preserve.length;i++)
{
if(ak_tmp_preserve==ak_preserve[i]+" slice") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('aspect','"+ak_preserve[i]+" slice')"+'">'+ak_preserve[i]+' slice</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('aspect','"+ak_preserve[i]+" slice')"+'">'+ak_preserve[i]+' slice</item>'
}
ak_svgMenu+='<separator/>'
if(ak_tmp_preserve=="none") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('aspect','none')"+'">none</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('aspect','none')"+'">none</item>'
ak_svgMenu+='</menu>'
if(ak_tmp_preserve=="xMidYMid meet") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('aspect','xMidYMid meet')"+'">Default "xMidYMid meet"</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('aspect','xMidYMid meet')"+'">Default "xMidYMid meet"</item>'
ak_svgMenu+='</menu>'
return ak_svgMenu
}
var ak_preserve=new Array('xMinYMin','xMinYMid','xMinYMax','xMidYMin','xMidYMid','xMidYMax','xMaxYMin','xMaxYMid','xMaxYMax')
//########################################
var ak_viewBox
var ak_hasAnimate, ak_rotateX, ak_rotateY, ak_rotateMatrix
var ak_txKerning, ak_txWordSpace
var ak_markerWidth, ak_markerHeight, ak_markerOrient, ak_markerX, ak_markerY, ak_markerAuto
//########################################
function ak_childNodeMenu_enable()
{
var ak_tmp_fe=false
if(/^(fe)|^(stop)|^(animate)/.test(ak_obj_data[0])) ak_tmp_fe=true
var ak_tmp_menu=document.getElementById("ak_new_object_insertBefore_submenu")
if(ak_tmp_fe || ak_object2update_nodeNr=="" || ak_object2update_nodeNr==-1)
{
ak_tmp_menu.parentNode.replaceChild(parseXML('<item id="ak_new_object_insertBefore_submenu" enabled="no">Add siblingNode (insertBefore)</item>',document).firstChild,ak_tmp_menu)
ak_tmp_menu=document.getElementById("ak_new_object_add2Parent_submenu")
ak_tmp_menu.parentNode.replaceChild(parseXML('<item id="ak_new_object_add2Parent_submenu" enabled="no">Add siblingNode</item>',document).firstChild,ak_tmp_menu)
ak_tmp_menu=document.getElementById("ak_createParentNode_submenu")
ak_tmp_menu.parentNode.replaceChild(parseXML('<item id="ak_createParentNode_submenu" enabled="no">MoveTo | Create parentNode</item>',document).firstChild,ak_tmp_menu)
}
else
{
ak_tmp_menu.parentNode.replaceChild(parseXML(ak_addChildBefore,document).firstChild,ak_tmp_menu)
ak_tmp_menu=document.getElementById("ak_new_object_add2Parent_submenu")
ak_tmp_menu.parentNode.replaceChild(parseXML(ak_addChild2Parent,document).firstChild,ak_tmp_menu)
ak_tmp_menu=document.getElementById("ak_createParentNode_submenu")
var ak_tmpNode='<menu id="ak_createParentNode_submenu"><header>MoveTo | Create parentNode</header>'
var ak_tmp=ak_which_nodeNr(ak_prevSelect)
var ak_t=ak_prevSelect.tagName
if(!ak_tmp || ak_tmp==-1 || /^(fe)|^(stop)|^(animate)/.test(ak_prevSelect.tagName)) ak_tmpNode+='<item enabled="no">Move previousSelected</item><separator/>'
else
{
ak_tmpNode+='<menu><header>Move previousSelected ...</header>'
var ak_tmp_next=ak_prevSelect.nextSibling()
var ak_tmp_flag=true
while(ak_tmp_next)
{
if(/^\[object SVG/.test(ak_tmp_next))
{
if(ak_which_nodeNr(ak_tmp_next)==ak_object2update_nodeNr) ak_tmp_flag=false
break
}
ak_tmp_next=ak_tmp_next.nextSibling()
}
if(ak_tmp_flag)
{
ak_tmpNode+='<item onactivate="'+"ak_moveBefore(ak_object2update,ak_prevSelect)"+'">... before Selection</item>'
}
else ak_tmpNode+='<item enabled="no">... before Selection</item>'
ak_tmp_next=ak_prevSelect.previousSibling()
ak_tmp_flag=true
while(ak_tmp_next)
{
if(/^\[object SVG/.test(ak_tmp_next))
{
if(ak_which_nodeNr(ak_tmp_next)==ak_object2update_nodeNr) ak_tmp_flag=false
break
}
ak_tmp_next=ak_tmp_next.previousSibling()
}
if(ak_tmp_flag)
{
ak_tmpNode+='<item onactivate="'+"ak_moveNextTo(ak_object2update,ak_prevSelect)"+'">... nextTo Selection</item>'
}
else ak_tmpNode+='<item enabled="no">... nextTo Selection</item>'
var ak_tmp_true=false
ak_t=ak_object2update.tagName
if(ak_t=="svg" || ak_t=="defs" || ak_t=="pattern" || ak_t=="symbol" || ak_t=="g" || ak_t=="a" || ak_t=="marker" || ak_t=="clipPath")
{ak_tmp_true=true}
if(ak_t=="rect" || ak_t=="circle" || ak_t=="ellipse" || ak_t=="path" || ak_t=="polygon" || ak_t=="polyline" || ak_t=="use" || ak_t=="line" || ak_t=="text" || ak_t=="textPath")
{
var ak_tup=ak_prevSelect.tagName
if(ak_tup=='filter' ||ak_tup=='linearGradient' ||ak_tup=='radialGradient' ||ak_tup=='pattern') ak_tmp_true=true
}
ak_t=ak_prevSelect.tagName
if(ak_tmp_true && ak_which_nodeNr(ak_prevSelect.parentNode)!=ak_object2update_nodeNr)
{
ak_tmpNode+='<item onactivate="'+"ak_moveInTo(ak_object2update,ak_prevSelect)"+'">... inTo Selection</item>'
}
else ak_tmpNode+='<item enabled="no">... inTo Selection</item>'
ak_tmpNode+='</menu><separator/>'
}
if(ak_tmp==ak_object2update_nodeNr)
{
ak_tmpNode+='<item enabled="no">MoveBefore previousSelected</item>'
ak_tmpNode+='<item enabled="no">MoveNextTo previousSelected</item>'
}
else if(ak_tmp!='' && ak_tmp!=-1 && !/^(fe)|^(stop)|^(animate)/.test(ak_prevSelect.tagName))
{
var ak_tmp_ar1=ak_tmp.split(',')
var ak_tmp_ar2=ak_object2update_nodeNr.split(',')
if(ak_tmp_ar1.length>ak_tmp_ar2.length)
{
while(ak_tmp_ar1.length!=ak_tmp_ar2.length) {ak_tmp_ar1.pop()}
if(ak_tmp_ar1.join()!=ak_tmp_ar2.join())
{
ak_tmpNode+='<item onactivate="'+"ak_moveBefore(ak_prevSelect,ak_object2update)"+'">MoveBefore &lt;'+ak_t
if(ak_prevSelect.getId())  ak_tmpNode+=' id="'+ak_prevSelect.getId()+'"</item>'
else ak_tmpNode+='</item>'
ak_tmpNode+='<item onactivate="'+"ak_moveNextTo(ak_prevSelect,ak_object2update)"+'">MoveNextTo &lt;'+ak_t
if(ak_prevSelect.getId())  ak_tmpNode+=' id="'+ak_prevSelect.getId()+'"</item>'
else ak_tmpNode+='</item>'
}
else
{
ak_tmpNode+='<item enabled="no">MoveBefore previousSelected</item>'
ak_tmpNode+='<item enabled="no">MoveNextTo previousSelected</item>'
}
}
else if(ak_tmp_ar1.length==ak_tmp_ar2.length)
{
var ak_tmp_same=true
if(ak_tmp_ar1.length>1)
{
for(var i=0;i<(ak_tmp_ar1.length-1);i++)
{
if(ak_tmp_ar1[i]!=ak_tmp_ar2[i]) {ak_tmp_same=false; break}
}
}
if(ak_tmp_same)
{
ak_tmp_ar1[ak_tmp_ar1.length-1]=parseInt(ak_tmp_ar1[ak_tmp_ar1.length-1])
ak_tmp_ar2[ak_tmp_ar2.length-1]=parseInt(ak_tmp_ar2[ak_tmp_ar2.length-1])
if(ak_tmp_ar1[ak_tmp_ar1.length-1]>ak_tmp_ar2[ak_tmp_ar2.length-1])
{
var ak_tmp_next=ak_object2update.nextSibling()
while(ak_tmp_next)
{
if(/^\[object SVG/.test(ak_tmp_next))
{
if(ak_which_nodeNr(ak_tmp_next)==ak_tmp_ar1.join()) ak_tmp_next=false
break
}
ak_tmp_next=ak_tmp_next.nextSibling()
}
if(ak_tmp_next)
{
ak_tmpNode+='<item onactivate="'+"ak_moveBefore(ak_prevSelect,ak_object2update)"+'">MoveBefore &lt;'+ak_t
if(ak_prevSelect.getId())  ak_tmpNode+=' id="'+ak_prevSelect.getId()+'"</item>'
else ak_tmpNode+='</item>'
}
else ak_tmpNode+='<item enabled="no">MoveBefore previousSelected</item>'
ak_tmpNode+='<item onactivate="'+"ak_moveNextTo(ak_prevSelect,ak_object2update)"+'">MoveNextTo &lt;'+ak_t
if(ak_prevSelect.getId())  ak_tmpNode+=' id="'+ak_prevSelect.getId()+'"</item>'
else ak_tmpNode+='</item>'
}
else
{
ak_tmpNode+='<item onactivate="'+"ak_moveBefore(ak_prevSelect,ak_object2update)"+'">MoveBefore &lt;'+ak_t
if(ak_prevSelect.getId())  ak_tmpNode+=' id="'+ak_prevSelect.getId()+'"</item>'
else ak_tmpNode+='</item>'
var ak_tmp_next=ak_object2update.previousSibling()
while(ak_tmp_next)
{
if(/^\[object SVG/.test(ak_tmp_next))
{
if(ak_which_nodeNr(ak_tmp_next)==ak_tmp_ar1.join()) ak_tmp_next=false
break
}
ak_tmp_next=ak_tmp_next.previousSibling()
}
if(ak_tmp_next)
{
ak_tmpNode+='<item onactivate="'+"ak_moveNextTo(ak_prevSelect,ak_object2update)"+'">MoveNextTo &lt;'+ak_t
if(ak_prevSelect.getId())  ak_tmpNode+=' id="'+ak_prevSelect.getId()+'"</item>'
else ak_tmpNode+='</item>'
}
else ak_tmpNode+='<item enabled="no">MoveNextTo previousSelected</item>'
}
}
else
{
ak_tmpNode+='<item onactivate="'+"ak_moveBefore(ak_prevSelect,ak_object2update)"+'">MoveBefore &lt;'+ak_t
if(ak_prevSelect.getId())  ak_tmpNode+=' id="'+ak_prevSelect.getId()+'"</item>'
else ak_tmpNode+='</item>'
ak_tmpNode+='<item onactivate="'+"ak_moveNextTo(ak_prevSelect,ak_object2update)"+'">MoveNextTo &lt;'+ak_t
if(ak_prevSelect.getId())  ak_tmpNode+=' id="'+ak_prevSelect.getId()+'"</item>'
else ak_tmpNode+='</item>'
}
}
else
{
ak_tmpNode+='<item onactivate="'+"ak_moveBefore(ak_prevSelect,ak_object2update)"+'">MoveBefore &lt;'+ak_t
if(ak_prevSelect.getId())  ak_tmpNode+=' id="'+ak_prevSelect.getId()+'"</item>'
else ak_tmpNode+='</item>'
ak_tmpNode+='<item onactivate="'+"ak_moveNextTo(ak_prevSelect,ak_object2update)"+'">MoveNextTo &lt;'+ak_t
if(ak_prevSelect.getId())  ak_tmpNode+=' id="'+ak_prevSelect.getId()+'"</item>'
else ak_tmpNode+='</item>'
}
}
else
{
ak_tmpNode+='<item enabled="no">MoveBefore previousSelected</item>'
ak_tmpNode+='<item enabled="no">MoveNextTo previousSelected</item>'
}
if(ak_tmp!='' && ak_tmp!=-1)
{
var ak_tmp_true=false
if(ak_t=="svg" || ak_t=="defs" || ak_t=="pattern" || ak_t=="symbol" || ak_t=="g" || ak_t=="a" || ak_t=="marker" || ak_t=="clipPath")
{ak_tmp_true=true}
if(ak_t=="rect" || ak_t=="circle" || ak_t=="ellipse" || ak_t=="path" || ak_t=="polygon" || ak_t=="polyline" || ak_t=="use" || ak_t=="line" || ak_t=="text" || ak_t=="textPath")
{
var ak_tup=ak_object2update.tagName
if(ak_tup=='filter' ||ak_tup=='linearGradient' ||ak_tup=='radialGradient' ||ak_tup=='pattern') ak_tmp_true=true
}
if(ak_tmp_true)
{
var ak_tmp_ar1=ak_tmp.split(',')
var ak_tmp_ar2=ak_object2update_nodeNr.split(',')
if((ak_tmp_ar1.length+1)==ak_tmp_ar2.length)
{
ak_tmp_ar2.pop()
if(ak_tmp_ar1.join()!=ak_tmp_ar2.join())
{
ak_tmpNode+='<item onactivate="'+"ak_moveInTo(ak_prevSelect,ak_object2update)"+'">MoveInTo &lt;'+ak_t
if(ak_prevSelect.getId())  ak_tmpNode+=' id="'+ak_prevSelect.getId()+'"</item>'
else ak_tmpNode+='</item>'
}
else ak_tmpNode+='<item enabled="no">MoveInTo previousSelected</item>'
}
else if(ak_tmp_ar1.length<=ak_tmp_ar2.length)
{
ak_tmpNode+='<item onactivate="'+"ak_moveInTo(ak_prevSelect,ak_object2update)"+'">MoveInTo &lt;'+ak_t
if(ak_prevSelect.getId())  ak_tmpNode+=' id="'+ak_prevSelect.getId()+'"</item>'
else ak_tmpNode+='</item>'
}
else
{
while(ak_tmp_ar1.length!=ak_tmp_ar2.length) {ak_tmp_ar1.pop()}
if(ak_tmp_ar1.join()!=ak_tmp_ar2.join())
{
ak_tmpNode+='<item onactivate="'+"ak_moveInTo(ak_prevSelect,ak_object2update)"+'">MoveInTo &lt;'+ak_t
if(ak_prevSelect.getId())  ak_tmpNode+=' id="'+ak_prevSelect.getId()+'"</item>'
else ak_tmpNode+='</item>'
}
else ak_tmpNode+='<item enabled="no">MoveInTo previousSelected</item>'
}
}
else ak_tmpNode+='<item enabled="no">MoveInTo previousSelected</item>'
}
else ak_tmpNode+='<item enabled="no">MoveInTo previousSelected</item>'
ak_tmpNode+='<separator/>'
ak_tmp=ak_which_nodeNr(ak_actualDefs)
if(ak_tmp==-1) ak_tmpNode+='<item onactivate="'+"ak_create_moveInTo('defs',ak_object2update)"+'">MoveInTo NEW &lt;defs/></item>'
else if(ak_tmp==ak_object2update_nodeNr) ak_tmpNode+='<item enabled="no">MoveInTo &lt;defs</item>'
else
{
var ak_tmp_ar1=ak_tmp.split(',')
var ak_tmp_ar2=ak_object2update_nodeNr.split(',')
if((ak_tmp_ar1.length+1)==ak_tmp_ar2.length)
{
ak_tmp_ar2.pop()
if(ak_tmp_ar1.join()!=ak_tmp_ar2.join())
{
ak_tmpNode+='<item onactivate="'+"ak_moveInTo(ak_actualDefs,ak_object2update)"+'">MoveInTo &lt;defs'
if(ak_actualDefs.getId())  ak_tmpNode+=' id="'+ak_actualDefs.getId()+'"</item>'
else ak_tmpNode+='</item>'
}
else ak_tmpNode+='<item enabled="no">MoveInTo &lt;defs</item>'
}
else if(ak_tmp_ar1.length<=ak_tmp_ar2.length)
{
ak_tmpNode+='<item onactivate="'+"ak_moveInTo(ak_actualDefs,ak_object2update)"+'">MoveInTo &lt;defs'
if(ak_actualDefs.getId())  ak_tmpNode+=' id="'+ak_actualDefs.getId()+'"</item>'
else ak_tmpNode+='</item>'
}
else
{
while(ak_tmp_ar1.length!=ak_tmp_ar2.length) {ak_tmp_ar1.pop()}
if(ak_tmp_ar1.join()!=ak_tmp_ar2.join())
{
ak_tmpNode+='<item onactivate="'+"ak_moveInTo(ak_actualDefs,ak_object2update)"+'">MoveInTo &lt;defs'
if(ak_actualDefs.getId())  ak_tmpNode+=' id="'+ak_actualDefs.getId()+'"</item>'
else ak_tmpNode+='</item>'
}
else ak_tmpNode+='<item enabled="no">MoveInTo &lt;defs</item>'
}
}
ak_tmpNode+='<separator/>'
{
var ak_tmp=ak_object2update.previousSibling()
var ak_tmp_back=false
while(ak_tmp)
{
if(/^\[object SVG/.test(ak_tmp) && ak_tmp.tagName!='script' && ak_tmp.tagName!='defs')
{
if(ak_which_nodeNr(ak_tmp)==0) ak_tmp=false
else ak_tmp_back=true
break
}
else if(/^\[object SVG/.test(ak_tmp)) ak_tmp_back=true
ak_tmp=ak_tmp.previousSibling()
}
if(ak_tmp || /,/.test(ak_object2update_nodeNr)) ak_tmpNode+='<item onactivate="'+"ak_moveInToFirst(ak_userspace_svg,ak_object2update)"+'">MoveTo BACK</item>'
else ak_tmpNode+='<item enabled="no">MoveTo BACK</item>'
if(ak_tmp && /,/.test(ak_object2update_nodeNr)) ak_tmpNode+='<item onactivate="'+"ak_moveBackwards(ak_object2update)"+'">Move backwards in group</item>'
else if(ak_tmp) ak_tmpNode+='<item onactivate="'+"ak_moveBackwards(ak_object2update)"+'">Move backwards</item>'
else if(/,/.test(ak_object2update_nodeNr))ak_tmpNode+='<item enabled="no">Move backwards in group</item>'
else ak_tmpNode+='<item enabled="no">Move backwards</item>'
ak_tmp=ak_object2update.nextSibling()
while(ak_tmp)
{
if(/^\[object SVG/.test(ak_tmp)) break
ak_tmp=ak_tmp.nextSibling()
}
if(ak_tmp && /,/.test(ak_object2update_nodeNr)) ak_tmpNode+='<item onactivate="'+"ak_moveTopwards(ak_object2update)"+'">Move topwards in group</item>'
else if(ak_tmp) ak_tmpNode+='<item onactivate="'+"ak_moveTopwards(ak_object2update)"+'">Move topwards</item>'
else if(/,/.test(ak_object2update_nodeNr)) ak_tmpNode+='<item enabled="no">Move topwards in group</item>'
else ak_tmpNode+='<item enabled="no">Move topwards</item>'
if(ak_tmp || /,/.test(ak_object2update_nodeNr)) ak_tmpNode+='<item onactivate="'+"ak_moveInTo(ak_userspace_svg,ak_object2update)"+'">MoveTo TOP</item>'
else ak_tmpNode+='<item enabled="no">MoveTo TOP</item>'
}
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_new_object_menu(evt,'parentG')"+'">Create parent &lt;g/></item>'
ak_tmpNode+='<item onactivate="'+"ak_new_object_menu(evt,'parentA')"+'">Create parent &lt;a/>   prompt:</item>'
ak_tmpNode+='<item onactivate="'+"ak_new_object_menu(evt,'parentASelect')"+'">Create parent &lt;a/>   dialog:</item>'
ak_tmpNode+='<separator/>'
if(ak_object2update.tagName=="g")
{
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'a')"+'">Convert to &lt;a/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'pattern')"+'">Convert to &lt;pattern/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'symbol')"+'">Convert to &lt;symbol/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'clipPath')"+'">Convert to &lt;clipPath/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'mask')"+'">Convert to &lt;mask/></item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_removeGroup(ak_object2update)"+'">Remove &lt;g/> keep childNodes</item>'
}
else if(ak_object2update.tagName=="a")
{
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'g')"+'">Convert to &lt;g/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'pattern')"+'">Convert to &lt;pattern/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'symbol')"+'">Convert to &lt;symbol/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'clipPath')"+'">Convert to &lt;clipPath/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'mask')"+'">Convert to &lt;mask/></item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_removeGroup(ak_object2update)"+'">Remove &lt;a/> keep childNodes</item>'
}
else if(ak_object2update.tagName=="pattern")
{
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'g')"+'">Convert to &lt;g/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'a')"+'">Convert to &lt;a/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'symbol')"+'">Convert to &lt;symbol/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'clipPath')"+'">Convert to &lt;clipPath/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'mask')"+'">Convert to &lt;mask/></item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_removeGroup(ak_object2update)"+'">Remove &lt;pattern/> keep childNodes</item>'
}
else if(ak_object2update.tagName=="symbol")
{
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'g')"+'">Convert to &lt;g/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'a')"+'">Convert to &lt;a/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'pattern')"+'">Convert to &lt;pattern/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'clipPath')"+'">Convert to &lt;clipPath/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'mask')"+'">Convert to &lt;mask/></item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_removeGroup(ak_object2update)"+'">Remove &lt;symbol/> keep childNodes</item>'
}
else if(ak_object2update.tagName=="clipPath")
{
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'g')"+'">Convert to &lt;g/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'a')"+'">Convert to &lt;a/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'pattern')"+'">Convert to &lt;pattern/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'symbol')"+'">Convert to &lt;symbol/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'mask')"+'">Convert to &lt;mask/></item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_removeGroup(ak_object2update)"+'">Remove &lt;clipPath/> keep childNodes</item>'
}
else if(ak_object2update.tagName=="mask")
{
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'g')"+'">Convert to &lt;g/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'a')"+'">Convert to &lt;a/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'pattern')"+'">Convert to &lt;pattern/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'symbol')"+'">Convert to &lt;symbol/></item>'
ak_tmpNode+='<item onactivate="'+"ak_convertGroup(ak_object2update,'clipPath')"+'">Convert to &lt;clipPath/></item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_removeGroup(ak_object2update)"+'">Remove &lt;mask/> keep childNodes</item>'
}
else ak_tmpNode+='<item enabled="no">Convert to &lt;g/> | &lt;a/> ...</item>'
ak_tmpNode+='</menu>'
ak_tmp_menu.parentNode.replaceChild(parseXML(ak_tmpNode,document).firstChild,ak_tmp_menu)
}
}
//########################################
function ak_convertGroup(object,to_what,node_nr)
{
ak_push2undoTrue()
if(node_nr) object=ak_getObject(node_nr)
var ak_tmp_tag=object.tagName
var ak_tmp_xml=printNode(object.cloneNode(0))
ak_tmp_xml='<'+to_what+ak_tmp_xml.substring(ak_tmp_tag.length+1)
object.parentNode.insertBefore(parseXML(ak_tmp_xml,document).firstChild,object)
var ak_tmp_new=object.previousSibling()
while(object.firstChild)
{
ak_tmp_new.appendChild(object.firstChild)
}
object.parentNode.removeChild(object)
ak_object2update_nodeNr=ak_which_nodeNr(ak_tmp_new)
if(ak_tmp_new.tagName=="a" && !ak_tmp_new.getAttribute("xlink:href"))
{
ak_tmp_new.setAttribute("xlink:href","")
}
else if(ak_tmp_new.tagName!="a" && !ak_tmp_new.getAttribute("xlink:href")) 
{
try{ak_tmp_new.removeAttribute("xlink:href")}catch(error){}
}
if(/symbol|mask|clipPath|pattern/.test(to_what) && !ak_tmp_new.getId())
{
var ak_tmp_id=ak_promptForId("Enter Id!",ak_tmp_new.tagName)
if(ak_tmp_id) ak_tmp_new.setAttribute("id",ak_tmp_id)
}
ak_clickset_obj2update(evt,ak_tmp_new,"no_ak_init_set4object")
}
//########################################
var ak_has_transform=new Array("a","g","line","text","rect","image","use","circle","ellipse","path","polyline","polygon")
function ak_removeGroup(object)
{
ak_push2undoTrue()
var ak_tmp_trans=object.getAttribute("transform")
if(object.firstChild)
{
ak_nice_tabs(object,'likewise')
if(/^\[object Text/.test(object.firstChild)) object.removeChild(object.firstChild)
if(/^\[object Text/.test(object.lastChild)) object.removeChild(object.lastChild)
while(object.firstChild)
{
if(/^\[object SVG/.test(object.firstChild) && ak_tmp_trans)
{
for(var i=0;i<ak_has_transform.length;i++)
{
if(object.firstChild.tagName==ak_has_transform[i])
{
var ak_tmp_childTrans=object.firstChild.getAttribute("transform")
if(ak_tmp_childTrans) object.firstChild.setAttribute("transform",ak_tmp_trans+" "+ak_tmp_childTrans)
else object.firstChild.setAttribute("transform",ak_tmp_trans)
break
}
}
}
object.parentNode.insertBefore(object.firstChild,object)
}
object.parentNode.removeChild(object)
}
else
{
var ak_tmp_prev=object.previousSibling()
if(/^\[object Text/.test(ak_tmp_prev))
{
var ak_tmp_spaces=printNode(ak_tmp_prev)
ak_tmp_spaces=ak_tmp_spaces.substring(0,ak_tmp_spaces.lastIndexOf('\n'))
ak_tmp_prev.data=ak_tmp_spaces
}
object.parentNode.removeChild(object)
}
ak_clickset_obj2update(evt,ak_userspace_svg.firstChild)
}
//########################################
function ak_moveBefore(beforeObject,object)
{
ak_push2undoTrue()
ak_removeSpaceBefore(object)
beforeObject.parentNode.insertBefore(object,beforeObject)
beforeObject.parentNode.insertBefore(parseXML("<g>"+ak_spaces(object)+"</g>",document).firstChild.firstChild,object)
ak_object2update_nodeNr=ak_which_nodeNr(ak_object2update)
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
//########################################
function ak_moveNextTo(nextToObject,object)
{
ak_push2undoTrue()
ak_removeSpaceBefore(object)
var ak_tmp_next=nextToObject.nextSibling()
if(ak_tmp_next && /^\[object/.test(ak_tmp_next))
{
ak_tmp_next.parentNode.insertBefore(object,ak_tmp_next)
ak_tmp_next.parentNode.insertBefore(parseXML("<g>"+ak_spaces(object)+"</g>",document).firstChild.firstChild,object)
}
else
{
nextToObject.parentNode.appendChild(object)
nextToObject.parentNode.insertBefore(parseXML("<g>"+ak_spaces(object)+"</g>",document).firstChild.firstChild,object)
}
ak_object2update_nodeNr=ak_which_nodeNr(ak_object2update)
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
//########################################
function ak_moveInToFirst(intoObject,object)
{
ak_push2undoTrue()
ak_removeSpaceBefore(object)
var ak_tmp_child=intoObject.childNodes
if(ak_tmp_child.length==0)
{
intoObject.appendChild(object)
ak_nice_tabs(intoObject)
}
else
{
var ak_tmp_append=true
for(var i=0;i<ak_tmp_child.length;i++)
{
if(/^\[object SVG/.test(ak_tmp_child.item(i)) &&ak_which_nodeNr(ak_tmp_child.item(i))!=0)
{
if(ak_tmp_child.item(i).tagName!='script' && ak_tmp_child.item(i).tagName!='defs')
{
ak_tmp_append=false
break
}
}
}
if(ak_tmp_append)
{
intoObject.appendChild(object)
intoObject.insertBefore(parseXML("<g>"+ak_spaces(object)+"</g>",document).firstChild.firstChild,object)
}
else
{
intoObject.insertBefore(object,ak_tmp_child.item(i))
intoObject.insertBefore(parseXML("<g>"+ak_spaces(object)+"</g>",document).firstChild.firstChild,ak_tmp_child.item(i))
}
}
ak_object2update_nodeNr=ak_which_nodeNr(ak_object2update)
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
//########################################
function ak_moveBackwards(object)
{
var ak_tmpNext=object.previousSibling()
var ak_tmpPrev=object.previousSibling()
if(!/^\[object Text/.test(ak_tmpPrev)) ak_tmpPrev=false
while(ak_tmpNext)
{
if(/^\[object SVG/.test(ak_tmpNext)) break
ak_tmpNext=ak_tmpNext.previousSibling()
}
if(ak_tmpNext && /^\[object SVG/.test(ak_tmpNext))
{
ak_push2undoTrue()
if(ak_tmpNext.previousSibling() && /^\[object Text/.test(ak_tmpNext.previousSibling())) ak_tmpNext=ak_tmpNext.previousSibling()
if(ak_tmpPrev) ak_tmpNext.parentNode.insertBefore(ak_tmpPrev,ak_tmpNext)
ak_tmpNext.parentNode.insertBefore(object,ak_tmpNext)
ak_object2update_nodeNr=ak_which_nodeNr(ak_object2update)
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
}
//########################################
function ak_moveTopwards(object)
{
var ak_tmpNext=object.nextSibling()
var ak_tmpPrev=object.previousSibling()
if(!/^\[object Text/.test(ak_tmpPrev)) ak_tmpPrev=false
while(ak_tmpNext)
{
if(/^\[object SVG/.test(ak_tmpNext)) break
ak_tmpNext=ak_tmpNext.nextSibling()
}
if(ak_tmpNext && /^\[object SVG/.test(ak_tmpNext))
{
ak_push2undoTrue()
if(ak_tmpNext.nextSibling())
{
ak_tmpNext=ak_tmpNext.nextSibling()
if(ak_tmpPrev) ak_tmpNext.parentNode.insertBefore(ak_tmpPrev,ak_tmpNext)
ak_tmpNext.parentNode.insertBefore(object,ak_tmpNext)
}
else
{
if(ak_tmpPrev) ak_tmpNext.parentNode.appendChild(ak_tmpPrev)
ak_tmpNext.parentNode.appendChild(ak_tmpPrev)
}
ak_object2update_nodeNr=ak_which_nodeNr(ak_object2update)
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
}
//########################################
function ak_moveInTo(intoObject,object)
{
ak_push2undoTrue()
ak_removeSpaceBefore(object)
var ak_tmp_child=intoObject.childNodes
if(ak_tmp_child.length==0)
{
intoObject.appendChild(object)
ak_nice_tabs(intoObject)
}
else if(/^\[object Text/.test(intoObject.lastChild))
{
intoObject.insertBefore(object,intoObject.lastChild)
intoObject.insertBefore(parseXML("<g>"+ak_spaces(object)+"</g>",document).firstChild.firstChild,object)
}
else
{
intoObject.appendChild(object)
intoObject.insertBefore(parseXML("<g>"+ak_spaces(object)+"</g>",document).firstChild.firstChild,object)
}
ak_object2update_nodeNr=ak_which_nodeNr(ak_object2update)
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
//########################################
function ak_removeSpaceBefore(object)
{
var ak_tmp_space=object.previousSibling()
if(/^\[object Text/.test(ak_tmp_space))
{
var ak_tmp=ak_tmp_space.data
var ak_tmp_nr=ak_tmp.lastIndexOf('\n')
if(ak_tmp_nr==0)
{
ak_tmp_space.parentNode.removeChild(ak_tmp_space)
}
else ak_tmp_space.data=ak_tmp.substring(0,ak_tmp_nr)
}
}
//########################################
function ak_create_moveInTo(what,object)
{
if(what=='defs')
{
ak_actualDefs=ak_appendChildSP('<defs/>',ak_userspace_svg)
ak_moveInTo(ak_actualDefs,object)
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
}
//############### ak_edit #########################
function ak_editAnimationMenu(evt)
{
if(!ak_menuValid(evt,"animation")) return
var ak_tmpNode
if(ak_grouping.length>0) {evt.preventDefault;return}
if (evt.type=="mousedown" && evt.getButton!=2)
{
document.getElementById("ak_use_right_mouse_button").setAttribute("transform","matrix(1,0,0,1,"+(evt.clientX-25)+","+(evt.clientY+10)+")")
document.getElementById("ak_use_right_mouse_button").setAttribute("style","visibility:visible")
return
}
else if(evt.type=="mouseup" || evt.type=="mouseout")
{
document.getElementById("ak_use_right_mouse_button").setAttribute("style","visibility:hidden")
document.getElementById("ak_select_element_first").setAttribute("style","visibility:hidden")
return
}
else if(ak_object2update_nodeNr==-1 && evt.type=="mousedown" && evt.getButton==2)
{
if(ak_menu_status=="timeline")
{
ak_tmpNode='<menu><header>AKs SVGEditor editAnimationMenu</header>'
ak_tmpNode+='<item checked="yes" onactivate="ak_main_menu(\'BackFromTimeline\')">Timeline EDITOR</item>'
ak_tmpNode+='</menu>'
}
else if(ak_autoMode)
{
ak_tmpNode='<menu><header>AKs SVGEditor editAnimationMenu</header>'
ak_tmpNode+='<item>   !!!  autoMode  !!!</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+=ak_getAnimateMenu(ak_object2update)
}
else
{
ak_tmpNode='<menu><header>AKs SVGEditor editAnimationMenu</header>'
ak_tmpNode+='<item onactivate="ak_timeline_editor(evt)">Timeline EDITOR</item>'
ak_tmpNode+='<item onactivate="ak_avoidOnce=true;ak_animation(\'start\')">[Ctrl+Space]  Start at 0:00:00</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item enabled="no">Select Element!</item>'
ak_tmpNode+='</menu>'
}
contextMenu().replaceChild(parseXML(ak_tmpNode,getContextMenu()).firstChild,getContextMenu().firstChild)
return
}
else if (evt.type!="mousedown" || evt.getButton!=2) return
// wenn nicht return dann gehts los hier
ak_tmpNode='<menu><header>AKs SVGEditor editAnimationMenu</header>'
ak_tmpNode+='<item onactivate="ak_timeline_editor(evt)">Timeline EDITOR</item>'
ak_tmpNode+='<item onactivate="ak_avoidOnce=true;ak_animation(\'start\')">[Ctrl+Space]  Start at 0:00:00</item>'
ak_tmpNode+='<separator/>'
var ak_tmp, ak_tmp_action
if(ak_autoMode)
{
ak_tmpNode='<menu><header>AKs SVGEditor editAnimationMenu</header>'
ak_tmpNode+='<item>   !!!  autoMode  !!!</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+=ak_getAnimateMenu(ak_object2update)
}
else if(ak_edit_gradient_flag=="gradient")
{
if(ak_gradient2edit.tagName=="linearGradient") ak_tmpNode+='<item>  !!!  Animation  &lt;linearGradient  !!!</item>'
else ak_tmpNode+='<item>  !!!  Animation  &lt;radialGradient  !!!</item>'
if(ak_freezeArray.length>0)
{
ak_tmp_action=' onactivate="ak_animate_auto('+"'autoNew','"+ak_which_nodeNr(ak_getObject(ak_animate2update).parentNode)+"','"+ak_animate2update+"'"+')"'
ak_tmpNode+='<item'+ak_tmp_action+'>autoMode new Animation</item>'
ak_tmp_action=' onactivate="ak_animate_auto('+"'autoSelected','"+ak_which_nodeNr(ak_getObject(ak_animate2update).parentNode)+"','"+ak_animate2update+"'"+')"'
ak_tmpNode+='<item'+ak_tmp_action+'>autoMode selected Animation</item>'
ak_tmpNode+='<separator/>'
}
ak_tmpNode+=ak_getAnimateMenu(ak_gradient2edit)
}
else if(ak_edit_gradient_flag=="pattern")
{
ak_tmpNode+='<item>   !!!  Animation &lt;pattern  !!!</item>'
if(ak_freezeArray.length>0)
{
ak_tmp_action=' onactivate="ak_animate_auto('+"'autoNew','"+ak_which_nodeNr(ak_getObject(ak_animate2update).parentNode)+"','"+ak_animate2update+"'"+')"'
ak_tmpNode+='<item'+ak_tmp_action+'>autoMode new Animation</item>'
ak_tmp_action=' onactivate="ak_animate_auto('+"'autoSelected','"+ak_which_nodeNr(ak_getObject(ak_animate2update).parentNode)+"','"+ak_animate2update+"'"+')"'
ak_tmpNode+='<item'+ak_tmp_action+'>autoMode selected Animation</item>'
ak_tmpNode+='<separator/>'
}
ak_tmpNode+=ak_getAnimateMenu(ak_pattern2edit)
}
else if(ak_edit_gradient_flag=="filter")
{
if(ak_gradient_stop_index!=-1) var ak_tmp_name=ak_getObject(ak_gradient_stop_index).tagName
else var ak_tmp_name=ak_pattern2edit.tagName
if(ak_tmp_name.length>13) ak_tmp_name=ak_tmp_name.substring(0,10)+"..."
ak_tmpNode+='<item>  !!!  Animation  &lt;'+ak_tmp_name+'  !!!</item>'
if(ak_freezeArray.length>0)
{
ak_tmp_action=' onactivate="ak_animate_auto('+"'autoNew','"+ak_which_nodeNr(ak_getObject(ak_animate2update).parentNode)+"','"+ak_animate2update+"'"+')"'
ak_tmpNode+='<item'+ak_tmp_action+'>autoMode new Animation</item>'
ak_tmp_action=' onactivate="ak_animate_auto('+"'autoSelected','"+ak_which_nodeNr(ak_getObject(ak_animate2update).parentNode)+"','"+ak_animate2update+"'"+')"'
ak_tmpNode+='<item'+ak_tmp_action+'>autoMode selected Animation</item>'
ak_tmpNode+='<separator/>'
}
if(ak_gradient_stop_index!=-1) ak_tmpNode+=ak_getAnimateMenu(ak_getObject(ak_gradient_stop_index))
else ak_tmpNode+=ak_getAnimateMenu(ak_pattern2edit)
}
else
{
ak_tmpNode+='<item>   !!!  Animation &lt;'+ak_object2update.tagName+'  !!!</item>'
if(ak_freezeArray.length>0)
{
ak_tmp_action=' onactivate="ak_animate_auto('+"'autoNew','"+ak_which_nodeNr(ak_getObject(ak_animate2update).parentNode)+"','"+ak_animate2update+"'"+')"'
ak_tmpNode+='<item'+ak_tmp_action+'>autoMode new Animation</item>'
ak_tmp_action=' onactivate="ak_animate_auto('+"'autoSelected','"+ak_which_nodeNr(ak_getObject(ak_animate2update).parentNode)+"','"+ak_animate2update+"'"+')"'
ak_tmpNode+='<item'+ak_tmp_action+'>autoMode selected Animation</item>'
ak_tmpNode+='<separator/>'
}
ak_tmpNode+=ak_getAnimateMenu(ak_object2update)
}
ak_tmpNode+='</menu>'
contextMenu().replaceChild(parseXML(ak_tmpNode,getContextMenu()).firstChild,getContextMenu().firstChild)
return
}
//########################################
var ak_animate2update="0", ak_animateStop2update="0", ak_attribute2update
var ak_freeze, ak_freezeArray=new Array
var ak_aniMenuFor=new Array("a","g","marker","symbol","svg","text","textPath","line","rect","image","use","circle","ellipse","polyline","polygon","path")
function ak_check4animates()
{
var ak_tmp, ak_tmp_what
ak_hasAnimate=false
ak_freeze=false
if(ak_autoMode)
{
if(ak_edit_gradient_flag=="gradient")
{
ak_animate_auto('autoAdd',ak_which_nodeNr(ak_gradient2edit))
var ak_tmp=ak_gradient2edit.childNodes
for(var i=0;i<ak_tmp.length;i++)
{
if(/^\[object SVG/.test(ak_gradient2edit.childNodes.item(i))) ak_animate_auto('autoAdd',ak_which_nodeNr(ak_gradient2edit.childNodes.item(i)))
}
}
else if(ak_edit_gradient_flag=="pattern") ak_animate_auto('autoAdd',ak_which_nodeNr(ak_pattern2edit))
else if(ak_edit_gradient_flag=="filter" && ak_gradient_stop_index!=-1) ak_animate_auto('autoAdd',ak_gradient_stop_index)
else if(ak_edit_gradient_flag=="filter") ak_animate_auto('autoAdd',ak_which_nodeNr(ak_pattern2edit))
}
ak_freezeArray=new Array
var ak_tmp4Object=ak_object2update
var ak_tmpI=-1
if(ak_edit_gradient_flag=="gradient")
{
ak_tmp4Object=ak_gradient2edit
ak_tmp=-1
for(var i=0;i<ak_tmp4Object.childNodes.length;i++)
{
if(/^\[object SVGAnimate|^\[object SVGSet/.test(ak_tmp4Object.childNodes.item(i)))
{
ak_hasAnimate=true
if(ak_tmp4Object.childNodes.item(i).getAttribute("fill")=="freeze") ak_freeze=true
ak_freezeArray.push(ak_tmp4Object.childNodes.item(i))
if(ak_animate2update==ak_which_nodeNr(ak_tmp4Object.childNodes.item(i))) ak_tmp=ak_freezeArray.length-1
if(ak_tmpI==-1 && ak_multiName && ak_tmp4Object.childNodes.item(i).getId() && ak_tmp4Object.childNodes.item(i).getId().search("ak_multi_"+ak_multiName+"_")==0)
{ak_tmpI=ak_freezeArray.length-1}
}
else if(/^\[object SVGStop/.test(ak_tmp4Object.childNodes.item(i)))
{
var ak_tmp4Stop=ak_tmp4Object.childNodes.item(i)
for(var ib=0;ib<ak_tmp4Stop.childNodes.length;ib++)
{
if(/^\[object SVGAnimate|^\[object SVGSet/.test(ak_tmp4Stop.childNodes.item(ib)))
{
ak_hasAnimate=true
if(ak_tmp4Stop.childNodes.item(ib).getAttribute("fill")=="freeze") ak_freeze=true
ak_freezeArray.push(ak_tmp4Stop.childNodes.item(ib))
if(ak_animate2update==ak_which_nodeNr(ak_tmp4Stop.childNodes.item(ib))) ak_tmp=ak_freezeArray.length-1
if(ak_tmpI==-1 && ak_multiName && ak_tmp4Stop.childNodes.item(ib).getId() && ak_tmp4Stop.childNodes.item(ib).getId().search("ak_multi_"+ak_multiName+"_")==0)
{ak_tmpI=ak_freezeArray.length-1}
}
}
}
}
if(ak_tmp!=-1) ak_tmpI=ak_tmp
else if(ak_freezeArray.length>0 && ak_tmpI==-1) ak_tmpI=0
}
else
{
if(ak_edit_gradient_flag=="pattern") ak_tmp4Object=ak_pattern2edit
else if(ak_edit_gradient_flag=="filter" && ak_gradient_stop_index!=-1) ak_tmp4Object=ak_getObject(ak_gradient_stop_index)
else if(ak_edit_gradient_flag=="filter") ak_tmp4Object=ak_pattern2edit
ak_tmp=-1
for(var i=0;i<ak_tmp4Object.childNodes.length;i++)
{
if(/^\[object SVGAnimate|^\[object SVGSet/.test(ak_tmp4Object.childNodes.item(i)))
{
ak_hasAnimate=true
if(ak_tmp4Object.childNodes.item(i).getAttribute("fill")=="freeze") ak_freeze=true
ak_freezeArray.push(ak_tmp4Object.childNodes.item(i))
if(ak_animate2update==ak_which_nodeNr(ak_tmp4Object.childNodes.item(i))) ak_tmp=ak_freezeArray.length-1
if(ak_tmpI==-1 && ak_multiName && ak_tmp4Object.childNodes.item(i).getId() && ak_tmp4Object.childNodes.item(i).getId().search("ak_multi_"+ak_multiName+"_")==0)
{ak_tmpI=ak_freezeArray.length-1}
}
}
if(ak_tmp!=-1) ak_tmpI=ak_tmp
else if(ak_freezeArray.length>0 && ak_tmpI==-1) ak_tmpI=0
}
if(ak_autoMode && !ak_multiName)
{
document.getElementById("ak_autoStatus").firstChild.data="autoMode [V] | "
document.getElementById("ak_multiStatus").firstChild.data='Restart autoMode [G] | '
}
else if(ak_autoMode)
{
ak_tmp=ak_autoSelectedObject.getAttribute('values')
if(ak_autoSelectedObject.tagName=='animateTransform') ak_tmp_what=ak_autoSelectedObject.getAttribute('type')
if(/;/.test(ak_tmp)) ak_tmp=ak_tmp.split(';').length
else ak_tmp=1
document.getElementById("ak_autoStatus").firstChild.data="autoMode [V] | "
document.getElementById("ak_multiStatus").firstChild.data='ak_multi_'+ak_multiName+'_... [G] '+(ak_valueNr+1)+'./'+ak_tmp+'| '
}
else
{
if(ak_tmpI!=-1)
{
ak_animate2update=ak_which_nodeNr(ak_freezeArray[ak_tmpI])
if(ak_value2update!=ak_animate2update)
{
ak_value2update=ak_animate2update
ak_valueNr=-1
}
if(/^animateMotion|^set/.test(ak_freezeArray[ak_tmpI].tagName))
{
document.getElementById("ak_autoStatus").firstChild.data=''
document.getElementById("ak_multiStatus").firstChild.data='<'+ak_freezeArray[ak_tmpI].tagName+' | '
ak_durSliderText.firstChild.data=ak_hhmmss(ak_freezeArray[ak_tmpI].getAttribute("dur"),"durSlider")
if(ak_durSlider.getAttribute("visibility")=="hidden") ak_durSlider.setAttribute("visibility","visible")
if(ak_keysEditor && ak_freezeArray[ak_tmpI].getAttribute("keyTimes")) ak_edit_keyTimesInit('keyTimesEditor',ak_which_nodeNr(ak_freezeArray[ak_tmpI].parentNode),ak_animate2update)
}
else
{
var ak_tmpType, ak_tmpValues, ak_tmp2
if(/^animateTransform/.test(ak_freezeArray[ak_tmpI].tagName)) ak_attribute2update=ak_freezeArray[ak_tmpI].getAttribute("type")
else ak_attribute2update=ak_freezeArray[ak_tmpI].getAttribute("attributeName")
ak_tmpType=ak_getAttribute(ak_freezeArray[ak_tmpI].parentNode,ak_attribute2update)
if(ak_tmpType=="false") ak_tmpType=""
try{ak_tmpType=ak_tmpType.replace(/^ +| +$/g,"")}catch(err){} // skew kommt mit number nicht mit string
ak_tmpValues=ak_freezeArray[ak_tmpI].getAttribute("values")
if(/;/.test(ak_tmpValues)) ak_tmpValues=ak_tmpValues.split(";")
else ak_tmpValues=new Array(ak_tmpValues)
if(ak_valueNr>=ak_tmpValues.length) ak_valueNr=-1
var ak_tmpNr=-1
for(var i=0;i<ak_tmpValues.length;i++)
{
if(ak_tmpType==ak_tmpValues[i].replace(/^ +| +$/g,""))
{
ak_tmpNr=i
if(ak_tmpNr==ak_valueNr) break
}
}
ak_tmp=''
if(/^ak_multi_/.test(ak_freezeArray[ak_tmpI].getId()))
{
ak_multiName=ak_freezeArray[ak_tmpI].getId().split("_")
ak_multiName=ak_multiName[2]
ak_tmp="ak_multi_"+ak_multiName+"_.. | "
}
else if(ak_freezeArray[ak_tmpI].getId()) ak_tmp=ak_freezeArray[ak_tmpI].getId()+" | "
else ak_tmp=ak_attribute2update+" | "
if(ak_valueNr>=0 && ak_tmpNr==ak_valueNr) ak_tmp+="[G] "+(ak_valueNr+1)+"."
else if(ak_valueNr>=0) ak_tmp+="[G] (?"+(ak_valueNr+1)+".)"
else if(ak_tmpNr>=0)
{
ak_tmp+="[G] "+(ak_tmpNr+1)+"."
ak_valueNr=ak_tmpNr
}
if(ak_tmpValues.length>0)  ak_tmp+="/ "+ak_tmpValues.length+" "
if(ak_tmp) ak_tmp+="| "
document.getElementById("ak_multiStatus").firstChild.data=ak_tmp
document.getElementById("ak_autoStatus").firstChild.data="[V] Add value | "
ak_animate2update=ak_which_nodeNr(ak_freezeArray[ak_tmpI])
ak_durSliderText.firstChild.data=ak_hhmmss(ak_freezeArray[ak_tmpI].getAttribute("dur"),"durSlider")
if(ak_durSlider.getAttribute("visibility")=="hidden") ak_durSlider.setAttribute("visibility","visible")
if(ak_keysEditor && ak_freezeArray[ak_tmpI].getAttribute("keyTimes")) ak_edit_keyTimesInit('keyTimesEditor',ak_which_nodeNr(ak_freezeArray[ak_tmpI].parentNode),ak_animate2update)
}
}
else
{
if(ak_durSlider.getAttribute("visibility")!="hidden") ak_durSlider.setAttribute("visibility","hidden")
ak_tmp=document.getElementById("ak_g_keyTimes")
if(ak_tmp) ak_tmp.setAttribute("visibility","hidden")
document.getElementById("ak_autoStatus").firstChild.data=''
document.getElementById("ak_multiStatus").firstChild.data=''
}
}
if(ak_freezeText && ak_freeze) ak_freezeText.firstChild.data=" | freeze"
else if(ak_freezeText) ak_freezeText.firstChild.data=" "
if((";"+ak_addChildFor.join(";")+";").search((";"+ak_object2update.tagName+";"))!=-1)
{
if(ak_hasAnimate)
{
document.getElementById("ak_internal_edit_border").setAttribute("style","fill:#2af")
document.getElementById("ak_translate_border").setAttribute("style","fill:#2af")
}
else
{
document.getElementById("ak_internal_edit_border").setAttribute("style","fill:#eee")
document.getElementById("ak_translate_border").setAttribute("style","fill:#eee")
}
}
else
{
if(ak_hasAnimate)
{
document.getElementById("ak_internal_edit_border").setAttribute("style","fill:#10d")
document.getElementById("ak_translate_border").setAttribute("style","fill:#10d")
}
else
{
document.getElementById("ak_internal_edit_border").setAttribute("style","fill:#000")
document.getElementById("ak_translate_border").setAttribute("style","fill:#000")
}
}
}
//########################################
var ak_add_animateMenu, ak_stop_array=new Array
var ak_value2update=false, ak_valueNr=-1, ak_multiName='', ak_delArray=new Array
function ak_getAnimateMenu(for_object)
{
var ak_tmpAniMenu, ak_tmp_action, ak_tmp
var ak_tmp_array=new Array
var ak_tmp_item=0
for(var i=0;i<for_object.childNodes.length;i++)
{
ak_tmp_array[ak_tmp_item]=new Array
ak_tmp_array[ak_tmp_item][0]=for_object.childNodes.item(i)
try{
if(/^(animate)/.test(for_object.childNodes.item(i).tagName)) 
{
ak_hasAnimate=true
ak_tmp_array[ak_tmp_item][1]=ak_tmp_array[ak_tmp_item][0].getAttribute("fill")
if(ak_tmp_array[ak_tmp_item][0].tagName=="animateTransform")  ak_tmp_array[ak_tmp_item][2]=ak_tmp_array[ak_tmp_item][0].getAttribute("type")
else ak_tmp_array[ak_tmp_item][2]=ak_tmp_array[ak_tmp_item][0].getAttribute("attributeName")
ak_tmp_array[ak_tmp_item][3]=''
if(ak_tmp_array[ak_tmp_item][0].getId() && ak_tmp_array[ak_tmp_item][0].getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$1")!='ak_multi_') ak_tmp_array[ak_tmp_item][4]=''
else if(ak_tmp_array[ak_tmp_item][0].getId()) ak_tmp_array[ak_tmp_item][4]=ak_tmp_array[ak_tmp_item][0].getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$2")
else  ak_tmp_array[ak_tmp_item][4]=''
ak_tmp_item++
}
}catch(error){}
}
ak_stop_array=new Array
if(/Gradient/.test(for_object.tagName))
{
var ak_tmp_stop=1
for(var ii=0;ii<for_object.childNodes.length;ii++)
{
if(/^(stop)/.test(for_object.childNodes.item(ii).tagName)) 
{
ak_stop_array.push(ak_which_nodeNr(for_object.childNodes.item(ii)))
for(var i=0;i<for_object.childNodes.item(ii).childNodes.length;i++)
{
ak_tmp_array[ak_tmp_item]=new Array
ak_tmp_array[ak_tmp_item][0]=for_object.childNodes.item(ii).childNodes.item(i)
try{
if(/^(animate)/.test(ak_tmp_array[ak_tmp_item][0].tagName)) 
{
ak_hasAnimate=true
ak_tmp_array[ak_tmp_item][1]=ak_tmp_array[ak_tmp_item][0].getAttribute("fill")
if(/^animateTransform/.test(ak_tmp_array[ak_tmp_item][0].tagName)) ak_tmp_array[ak_tmp_item][2]=ak_tmp_array[ak_tmp_item][0].getAttribute("type")
else ak_tmp_array[ak_tmp_item][2]=ak_tmp_array[ak_tmp_item][0].getAttribute("attributeName")
ak_tmp_array[ak_tmp_item][3]=ak_tmp_stop+'.&lt;stop '
if(ak_tmp_array[ak_tmp_item][0].getId() && ak_tmp_array[ak_tmp_item][0].getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$1")!='ak_multi_') ak_tmp_array[ak_tmp_item][4]=''
else if(ak_tmp_array[ak_tmp_item][0].getId()) ak_tmp_array[ak_tmp_item][4]=ak_tmp_array[ak_tmp_item][0].getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$2")
else  ak_tmp_array[ak_tmp_item][4]=''
ak_tmp_item++
}
}catch(error){}
}
ak_tmp_stop++
}
}
}
if(ak_tmp_array.length>0 && /^\[object Text/.test(ak_tmp_array[ak_tmp_array.length-1][0])) ak_tmp_array.pop()
if(ak_tmp_array.length<=0) ak_hasAnimate=false
if(ak_hasAnimate && !ak_autoMode)
{
var ak_tmp2update=0
for(var i=0;i<ak_tmp_item;i++)
{
if(ak_animate2update==ak_which_nodeNr(ak_tmp_array[i][0])) ak_tmp2update=i
if(ak_tmp_array[i][1]=="freeze") ak_freeze=true
}
if(ak_multiName && ak_multiName!=ak_tmp_array[ak_tmp2update][4])
{
for(var i=0;i<ak_tmp_item;i++)
{
if(ak_multiName==ak_tmp_array[i][4])
{
ak_tmp2update=i
break
}
}
}
ak_multiName=ak_tmp_array[ak_tmp2update][4]
ak_animate2update=ak_which_nodeNr(ak_tmp_array[ak_tmp2update][0])
if(ak_tmp_array[ak_tmp2update][3])
{
for_object=ak_tmp_array[ak_tmp2update][0].parentNode
ak_animateStop2update=ak_which_nodeNr(ak_tmp_array[ak_tmp2update][0])
}
ak_set_rmAdd_animate(for_object)
var ak_tmp_attr=false
if(ak_tmp_array[ak_tmp2update][0].tagName=="animateTransform") ak_tmp_attr=ak_tmp_array[ak_tmp2update][0].getAttribute("type")
else if(ak_tmp_array[ak_tmp2update][0].tagName=="animate" || ak_tmp_array[ak_tmp2update][0].tagName=="animateColor")
{ak_tmp_attr=ak_tmp_array[ak_tmp2update][0].getAttribute("attributeName")}
var ak_tmp_objAni="'"+ak_which_nodeNr(for_object)+"','"
if(for_object.tagName=="stop") ak_tmp_objAni+=ak_animateStop2update+"'"
else ak_tmp_objAni+=ak_animate2update+"'"
if(ak_tmp_array[ak_tmp2update][0].tagName=="animateMotion")
{
if(ak_tmp_array[ak_tmp2update][0].getAttribute("path"))
{
ak_tmp_action=' onactivate="ak_edit_animate('+"'convertPath',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>Convert path="..." to &lt;path</item><separator/>'
}
var ak_tmp_mpath=false
for(var i=0;i<ak_tmp_array[ak_tmp2update][0].childNodes.length;i++)
{
if(ak_tmp_array[ak_tmp2update][0].childNodes.item(i).tagName=="mpath")
{
ak_tmp_mpath=ak_tmp_array[ak_tmp2update][0].childNodes.item(i).getAttribute("xlink:href")
ak_tmp_mpath=ak_tmp_mpath.replace(/^ +| +$/g,"")
ak_tmp_mpath=ak_tmp_mpath.replace(/^#/g,"")
break
}
}
var ak_tmp_path=ak_userspace_svg.getElementsByTagName("path")
if(ak_tmp_path.length<=0)
{
ak_tmpAniMenu+='<menu><header>Set &lt;mpath xlink:href</header><item enabled="no">no path recognized</item>'
}
else
{
ak_tmpAniMenu+='<menu><header>Set &lt;mpath xlink:href</header>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'setMpath',"+ak_tmp_objAni
for(var i=0;i<ak_tmp_path.length;i++)
{
var ak_tmp_id=ak_tmp_path.item(i).getId
if(ak_tmp_id)
{
if(ak_tmp_mpath==ak_tmp_id) var ak_tmp_checked=' checked="yes"'
else var ak_tmp_checked=""
ak_tmpAniMenu+='<item'+ak_tmp_checked+ak_tmp_action+",'"+ak_tmp_id+"'"+')"'+'>'+ak_tmp_id+'</item>'
}
}
}
ak_tmpAniMenu+='<separator/>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'addPath',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>Add new &lt;path</item>'
ak_tmpAniMenu+='</menu>'
if(ak_tmp_mpath)
{
var ak_tmp_mpathObject=document.getElementById(ak_tmp_mpath)
if(!ak_tmp_mpathObject || ak_tmp_mpathObject.tagName!="path") ak_tmpAniMenu+='<item enabled="no">   - "'+ak_tmp_mpath+'" no path</item>'
else
{
ak_tmp_action=' onactivate="ak_edit_animate('+"'selectPath',"+ak_tmp_objAni
ak_tmpAniMenu+='<item'+ak_tmp_action+",'"+ak_tmp_mpath+"'"+')"'+'>   - &lt;path id="'+ak_tmp_mpath+'"</item>'
}
}
else ak_tmpAniMenu+='<item enabled="no">   - no path referenced</item>'
}
else if(ak_tmp_attr)
{
if(ak_multiName)
{
try{
var ak_tmp_2=ak_getObject(ak_value2update).getId()
if(ak_tmp_2.replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$1")=='ak_multi_' && ak_tmp_2.replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$2")==ak_multiName)
{
ak_value2update=ak_animate2update
}}catch(error){ak_multiName=ak_tmp_array[ak_tmp2update][4]}
}
if(ak_animate2update!=ak_value2update) ak_valueNr=-1
var ak_tmp_values=ak_tmp_array[ak_tmp2update][0].getAttribute("values")
if(ak_tmp_values) ak_tmp_values=ak_tmp_values.split(";")
for(var i=0;i<ak_tmp_values.length;i++)
{
ak_tmp_values[i]=ak_tmp_values[i].replace(/^ +| +$/g,"")
if(ak_tmp_values[i].length>23) ak_tmp_values[i]=ak_tmp_values[i].substring(0,20)+"..."
}
if(!ak_tmp_values) ak_valueNr=-1
var ak_tmp_isAttr=false
var ak_tmpWhat="Style"
for(var i=0;i<ak_aniArray.length;i++)
{
if(ak_aniArray[i]==ak_tmp_attr) {ak_tmp_isAttr=true; ak_tmpWhat="Attribute"; break}
}
if(ak_tmp_attr=="offset") {ak_tmp_isAttr=true; ak_tmpWhat="Attribute"}
var ak_tmp_aValue
if(ak_tmp_isAttr) ak_tmp_aValue=for_object.getAttribute(ak_tmp_attr)
else if(ak_tmp_array[ak_tmp2update][0].tagName=="animateTransform")
{
ak_tmpWhat="Transform"
ak_tmp_aValue=ak_SetGetRm_transformValue(for_object,ak_tmp_attr,"get","no_cout")
if(ak_tmp_aValue=="false") ak_tmp_aValue=""
}
else
{
ak_tmp_aValue=ak_SetGetRm_styleValue(for_object,ak_tmp_attr,"get","no_cout")
if(ak_tmp_aValue=="false") ak_tmp_aValue=""
}
if(ak_tmp_aValue.length>14) ak_tmp_aValue=ak_tmp_aValue.substring(0,12)+"..."
ak_tmpAniMenu+='<menu><header>Add value | insertBefore ..</header>'
if(ak_tmp_array[ak_tmp2update][0].getAttribute("from") || ak_tmp_array[ak_tmp2update][0].getAttribute("by") || ak_tmp_array[ak_tmp2update][0].getAttribute("to"))
{
var ak_tmp_frby=ak_tmp_array[ak_tmp2update][0].getAttribute("from")
if(ak_tmp_frby)
{
ak_tmp_action=' onactivate="ak_edit_animate('+"'addFrom',"+ak_tmp_objAni+')"'
if(ak_tmp_frby.length>14) ak_tmp_frby=ak_tmp_frby.substring(0,12)+"..."
ak_tmpAniMenu+='<item'+ak_tmp_action+'>Add from="'+ak_tmp_frby+'" to values</item>'
}
else ak_tmpAniMenu+='<item enabled="no">Add from="..." to values</item>'
ak_tmp_frby=ak_tmp_array[ak_tmp2update][0].getAttribute("to")
if(ak_tmp_frby)
{
ak_tmp_action=' onactivate="ak_edit_animate('+"'addTo',"+ak_tmp_objAni+')"'
if(ak_tmp_frby.length>14) ak_tmp_frby=ak_tmp_frby.substring(0,12)+"..."
ak_tmpAniMenu+='<item'+ak_tmp_action+'>Add to="'+ak_tmp_frby+'" to values</item>'
}
else ak_tmpAniMenu+='<item enabled="no">Add to="..." to values</item>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'deleteFromByTo',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>Remove from / by / to</item>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'addRemoveFromByTo',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>Add from/to and remove from/by/to</item>'
ak_tmpAniMenu+='<separator/>'
}

if(ak_tmp_values)
{
for(i=0;i<ak_tmp_values.length;i++)
{
if(i==ak_valueNr) ak_tmp_check=' checked="yes"'
else ak_tmp_check=''
ak_tmp_action=' onactivate="ak_edit_animate('+"'insertBeforeValue',"+ak_tmp_objAni+",'"+ak_tmp_attr+"',"+i+')"'
ak_tmpAniMenu+='<item'+ak_tmp_check+ak_tmp_action+'>('+(i+1)+'.)   '+ak_tmp_values[i]+'</item>'
}
}
else ak_tmpAniMenu+='<item enabled="no">no values</item>'


ak_tmpAniMenu+='<separator/>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'add2Values',"+ak_tmp_objAni+",'"+ak_tmp_attr+"'"+')"'
ak_tmpAniMenu+='<item id="ak_ctrlAddMenu"'+ak_tmp_action+'>[V] Add  "'+ak_tmp_aValue+'"</item>'
if(ak_tmp_values && ak_tmp_values.length>1)
{
ak_tmp_action=' onactivate="ak_edit_animate('+"'sortValuesReverse',"+ak_tmp_objAni+",'"+ak_tmp_attr+"'"+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>Sort values reverse</item>'
}
else ak_tmpAniMenu+='<item enabled="no">Sort values reverse</item>'
ak_tmpAniMenu+='</menu>'
var ak_tmp_check
//ak_tmpAniMenu+='<menu><header>Replace value ..</header>'

ak_tmpAniMenu+='<menu><header>Replace | Delete value ..</header>'
if(ak_tmp_values)
{
ak_tmpAniMenu+='<menu><header>Replace ..</header>'
ak_tmpAniMenu+='<item>  Delete</item>'
ak_tmpAniMenu+='<separator/>'
//if(ak_tmp_values)
{
for(i=0;i<ak_tmp_values.length;i++)
{
if(i==ak_valueNr) ak_tmp_check=' checked="yes"'
else ak_tmp_check=''
ak_tmp_action=' onactivate="ak_edit_animate('+"'delValue',"+ak_tmp_objAni+",'"+ak_tmp_attr+"',"+i+')"'
//ak_tmpAniMenu+='<item'+ak_tmp_check+ak_tmp_action+'>('+(i+1)+'.)   '+ak_tmp_values[i]+'</item>'
ak_tmpAniMenu+='<item'+ak_tmp_check+ak_tmp_action+'>&lt;- this -&gt;</item>'
}
}
//else ak_tmpAniMenu+='<item enabled="no">no values</item>'
ak_tmpAniMenu+='</menu>'
ak_tmpAniMenu+='<separator/>'

for(i=0;i<ak_tmp_values.length;i++)
{
ak_tmp_action=' onactivate="ak_edit_animate('+"'set2Value',"+ak_tmp_objAni+",'"+ak_tmp_attr+"',"+i+')"'
if(i==ak_valueNr) ak_tmpAniMenu+='<item id="ak_ctrlLastValue" checked="yes"'+ak_tmp_action+'>[G] ('+(i+1)+'.)   '+ak_tmp_values[i]+'</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+'>      ('+(i+1)+'.)   '+ak_tmp_values[i]+'</item>'
}
}
else ak_tmpAniMenu+='<item enabled="no">no values</item>'

ak_tmpAniMenu+='</menu>'
{
ak_tmpAniMenu+='<menu><header>Set Object to ..</header>'
if(ak_tmp_values)
{
for(i=0;i<ak_tmp_values.length;i++)
{
if(i==ak_valueNr) ak_tmp_check=' checked="yes"'
else ak_tmp_check=''
ak_tmp_action=' onactivate="ak_edit_animate('+"'set2Attribute',"+ak_tmp_objAni+",'"+ak_tmp_attr+"',"+i+')"'
ak_tmpAniMenu+='<item'+ak_tmp_check+ak_tmp_action+'>('+(i+1)+'.)   '+ak_tmp_values[i]+'</item>'
}
}
else ak_tmpAniMenu+='<item enabled="no">no values</item>'
}
ak_tmpAniMenu+='<separator/>'
if(ak_tmp_values)
{
ak_tmp_action=' onactivate="ak_edit_animate('+"'set2Attribute',"+ak_tmp_objAni+",'"+ak_tmp_attr+"',"+0+')"'
ak_tmpAniMenu+='<item id="ak_shiftArrowUp"'+ak_tmp_action+'>[Shift+arrowUp]     first value</item>'
ak_tmp=ak_valueNr-1
ak_tmp=ak_tmp<0?0:ak_tmp
ak_tmp_action=' onactivate="ak_edit_animate('+"'set2Attribute',"+ak_tmp_objAni+",'"+ak_tmp_attr+"',"+ak_tmp+')"'
ak_tmpAniMenu+='<item id="ak_arrowUp"'+ak_tmp_action+'>[arrowUp]               previous value</item>'
ak_tmp=ak_valueNr<0?ak_tmp_values.length-1:ak_valueNr+1
ak_tmp=ak_tmp>ak_tmp_values.length-1?ak_tmp_values.length-1:ak_tmp
ak_tmp_action=' onactivate="ak_edit_animate('+"'set2Attribute',"+ak_tmp_objAni+",'"+ak_tmp_attr+"',"+ak_tmp+')"'
ak_tmpAniMenu+='<item id="ak_arrowDown"'+ak_tmp_action+'>[arrowDown]           next value</item>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'set2Attribute',"+ak_tmp_objAni+",'"+ak_tmp_attr+"',"+(ak_tmp_values.length-1)+')"'
ak_tmpAniMenu+='<item id="ak_shiftArrowDown"'+ak_tmp_action+'>[Shift+arrowDown] last value</item>'
}
else
{
ak_tmpAniMenu+='<item enabled="no">[Shift+arrowUp]     first value</item>'
ak_tmpAniMenu+='<item enabled="no">[arrowUp]               previous value</item>'
ak_tmpAniMenu+='<item enabled="no">[arrowDown]           next value</item>'
ak_tmpAniMenu+='<item enabled="no">[Shift+arrowDown] last value</item>'
}
ak_tmpAniMenu+='</menu>'
/*ak_tmpAniMenu+='<menu><header>Delete value ..</header>'
if(ak_tmp_values)
{
for(i=0;i<ak_tmp_values.length;i++)
{
if(i==ak_valueNr) ak_tmp_check=' checked="yes"'
else ak_tmp_check=''
ak_tmp_action=' onactivate="ak_edit_animate('+"'delValue',"+ak_tmp_objAni+",'"+ak_tmp_attr+"',"+i+')"'
ak_tmpAniMenu+='<item'+ak_tmp_check+ak_tmp_action+'>('+(i+1)+'.)   '+ak_tmp_values[i]+'</item>'
}
}
else ak_tmpAniMenu+='<item enabled="no">no values</item>'
ak_tmpAniMenu+='</menu>'*/
}
else
{
ak_tmpAniMenu+='<item enabled="no">Add value | insertBefore ..</item>'
ak_tmpAniMenu+='<item enabled="no">Set value Nr. ..</item>'
ak_tmpAniMenu+='<item enabled="no">Set Object to ..</item>'
ak_tmpAniMenu+='<item enabled="no">Delete value ..</item>'
}
ak_tmpAniMenu+='<separator/>'
ak_tmpAniMenu+='<menu><header>Delete Animation</header>'
ak_tmp_action=' onactivate="ak_edit_animateMulti('+"'delAllListedAnimation',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>Delete all listed Animation</item>'
ak_delArray=new Array
for(var i=0;i<ak_tmp_item;i++)
{
ak_delArray[i]=new Array
ak_delArray[i][0]=ak_tmp_array[i][0]
ak_delArray[i][1]=ak_tmp_array[i][4]
}
var ak_tmp_schoMulti=new Array
for(var i=0;i<ak_tmp_item;i++)
{
if(ak_tmp_array[i][4])
{
while(true)
{
for(var ib=0;ib<ak_tmp_schoMulti.length;ib++)
{
if(ak_tmp_schoMulti[ib]==ak_tmp_array[i][4]) break
}
if(ib>=ak_tmp_schoMulti.length)
{
ak_tmp_schoMulti.push(ak_tmp_array[i][4])
break
}
else
{
i++
if(i>=ak_tmp_item || !ak_tmp_array[i][4]) break
}
}
}
if(i>=ak_tmp_item) break
ak_tmp_action=' onactivate="ak_delArrayDelete('+"'delArrayAnimationDelete',"+ak_tmp_objAni+','+i+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>&lt;------  Delete this  ------&gt;</item>'
}
if(ak_multiName)
{
ak_tmpAniMenu+='<separator/>'
ak_tmp_action=' onactivate="ak_edit_animateMulti('+"'delAnimation',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>Delete complete ak_multi_'+ak_tmp_array[ak_tmp2update][4]+'_..</item>'
}
ak_tmpAniMenu+='</menu>'
var ak_tmp_objAniOnly="'"+ak_which_nodeNr(for_object)+"','"
var ak_tmp_objAniOnly_1=ak_tmp_objAniOnly
var ak_tmp_objAniOnly_parent="'"+ak_which_nodeNr(for_object.parentNode)+"','"
var ak_tmp_freeze
ak_tmp_schoMulti=new Array
for(var i=0;i<ak_tmp_item;i++)
{
if(ak_tmp_array[i][4])
{
while(true)
{
for(var ib=0;ib<ak_tmp_schoMulti.length;ib++)
{
if(ak_tmp_schoMulti[ib]==ak_tmp_array[i][4]) break
}
if(ib>=ak_tmp_schoMulti.length)
{
ak_tmp_schoMulti.push(ak_tmp_array[i][4])
break
}
else
{
i++
if(i>=ak_tmp_item || !ak_tmp_array[i][4]) break
}
}
}
if(i>=ak_tmp_item) break
if(for_object.tagName=="stop" && ak_tmp_array[i][3]) ak_tmp_objAniOnly=ak_tmp_objAniOnly_1
else if(for_object.tagName=="stop") ak_tmp_objAniOnly=ak_tmp_objAniOnly_parent
else ak_tmp_objAniOnly=ak_tmp_objAniOnly_1
ak_tmp_action=' onactivate="ak_edit_animate('+"'selectAnimation',"+ak_tmp_objAniOnly+ak_which_nodeNr(ak_tmp_array[i][0])+"'"+')"'
ak_tmp_check=''
if(i==ak_tmp2update) ak_tmp_check=' checked="yes"'
ak_tmp_freeze='    ('
if(ak_tmp_array[i][1]=="freeze") ak_tmp_freeze+='f) '
else ak_tmp_freeze+='r) '
if(ak_tmp_array[i][4])
{
if(ak_tmp_array[i][4]==ak_multiName) ak_tmp_check=' checked="yes"'
ak_tmpAniMenu+='<item'+ak_tmp_check+ak_tmp_action+'>'+ak_tmp_freeze+'ak_multi_'+ak_tmp_array[i][4]+'_..  "'+ak_tmp_array[i][2]+'"</item>'
}
else ak_tmpAniMenu+='<item'+ak_tmp_check+ak_tmp_action+'>'+ak_tmp_freeze+ak_tmp_array[i][3]+'&lt;'+ak_tmp_array[i][0].tagName+' "'+ak_tmp_array[i][2]+'"</item>'
}
ak_tmpAniMenu+='<menu><header>Add Animation</header>'
ak_tmpAniMenu+=ak_add_animateMenu+'</menu>'
ak_tmpAniMenu+='<separator/>'
var ak_tmp_attAddAttr=ak_tmp_array[ak_tmp2update][0].getAttribute("begin")
/*ak_tmpAniMenu+='<menu><header>keyTimes | keySplines | calcMode</header>'
ak_tmp_attAddAttr=ak_tmp_array[ak_tmp2update][0].getAttribute("keySplines")
if(ak_tmp_attAddAttr) 
{
if(ak_keysEditor)
{
ak_tmp_action=' onactivate="ak_edit_animateSpline('+"'closeKeyTimes',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item checked="yes"'+ak_tmp_action+'>keyTimes|keySplines EDITOR</item>'
}
else
{
ak_tmp_action=' onactivate="ak_edit_keyTimesInit('+"'keyTimesEditor',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>keyTimes|keySplines EDITOR</item>'
}
ak_tmpAniMenu+='<separator/>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'rmAniAttribute',"+ak_tmp_objAni+",'keyTimes'"+')"'
ak_tmpAniMenu+='<item checked="yes"'+ak_tmp_action+'>keyTimes + keySplines</item>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'rmAniAttribute',"+ak_tmp_objAni+",'keySplines'"+')"'
ak_tmpAniMenu+='<item checked="no"'+ak_tmp_action+'>Remove keySplines</item>'
}
else if(ak_tmp_array[ak_tmp2update][0].getAttribute("keyTimes"))
{

if(ak_keysEditor)
{
ak_tmp_action=' onactivate="ak_edit_animateSpline('+"'closeKeyTimes',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item checked="yes"'+ak_tmp_action+'>keyTimes|keySplines EDITOR</item>'
}
else
{
ak_tmp_action=' onactivate="ak_edit_keyTimesInit('+"'keyTimesEditor',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>keyTimes|keySplines EDITOR</item>'
}
ak_tmpAniMenu+='<separator/>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'rmAniAttribute',"+ak_tmp_objAni+",'keyTimes'"+')"'
ak_tmpAniMenu+='<item checked="yes"'+ak_tmp_action+'>keyTimes</item>'
ak_tmp_action=' onactivate="ak_edit_keyTimes('+"'keySplinesEditor',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>Add keySplines</item>'
}
else
{
ak_tmp_action=' onactivate="ak_edit_keyTimes('+"'keyTimesEditor',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>Add keyTimes</item>'
ak_tmp_action=' onactivate="ak_edit_keyTimes('+"'keySplinesEditor',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>Add keyTimes + keySplines</item>'
}
ak_tmpAniMenu+='<separator/>'
ak_tmpAniMenu+='<menu><header>calcMode'
ak_tmp_attAddAttr=ak_tmp_array[ak_tmp2update][0].getAttribute("calcMode")
if(ak_tmp_attAddAttr) ak_tmpAniMenu+=' = "'+ak_tmp_attAddAttr+'"'
ak_tmp_action=' onactivate="ak_edit_animate('+"'setAniAttr',"+ak_tmp_objAni
ak_tmpAniMenu+='</header>'
if(ak_tmp_attAddAttr=="linear") ak_tmpAniMenu+='<item checked="yes">linear</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+",'calcMode','linear'"+')"'+'>linear</item>'
if(ak_tmp_attAddAttr=="spline") ak_tmpAniMenu+='<item checked="yes">spline</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+",'calcMode','spline'"+')"'+'>spline</item>'
if(ak_tmp_attAddAttr=="discrete") ak_tmpAniMenu+='<item checked="yes">discrete</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+",'calcMode','discrete'"+')"'+'>discrete</item>'
if(ak_tmp_attAddAttr=="paces") ak_tmpAniMenu+='<item checked="yes">paces</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+",'calcMode','paces'"+')"'+'>paces</item>'
ak_tmpAniMenu+='</menu>'
ak_tmpAniMenu+='</menu>'
ak_tmpAniMenu+='<separator/>'*/
ak_tmpAniMenu+='<menu><header>fill | restart | additive | ..</header>'
ak_tmpAniMenu+='<menu><header>fill = "'+ak_tmp_array[ak_tmp2update][1]+'"</header>'
if(ak_tmp_array[ak_tmp2update][1]=="remove") ak_tmpAniMenu+='<item checked="yes">remove</item>'
else
{
ak_tmp_action=' onactivate="ak_edit_animate('+"'setFill',"+ak_tmp_objAni+",'remove'"+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>remove</item>'
}
if(ak_tmp_array[ak_tmp2update][1]=="freeze") ak_tmpAniMenu+='<item checked="yes">freeze</item>'
else
{
ak_tmp_action=' onactivate="ak_edit_animate('+"'setFill',"+ak_tmp_objAni+",'freeze'"+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>freeze</item>'
}
ak_tmpAniMenu+='</menu>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'setAniAttr',"+ak_tmp_objAni
if(ak_tmp_array[ak_tmp2update][0].tagName=="animateMotion")
{
ak_tmpAniMenu+='<menu><header>rotate'
ak_tmp_attAddAttr=ak_tmp_array[ak_tmp2update][0].getAttribute("rotate")
if(ak_tmp_attAddAttr) ak_tmpAniMenu+=' = "'+ak_tmp_attAddAttr+'"'
ak_tmpAniMenu+='</header>'
if(ak_tmp_attAddAttr=="auto") ak_tmpAniMenu+='<item checked="yes">auto</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+",'rotate','auto'"+')"'+'>auto</item>'
if(ak_tmp_attAddAttr=="auto-reverse") ak_tmpAniMenu+='<item checked="yes">auto-reverse</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+",'rotate','auto-reverse'"+')"'+'>auto-reverse</item>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'setRotate',"+ak_tmp_objAni+')"'
if(ak_tmp_attAddAttr && !isNaN(ak_tmp_attAddAttr)) ak_tmpAniMenu+='<item checked="yes"'+ak_tmp_action+'>Enter rotate angle</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+'>Enter rotate angle</item>'
if(ak_tmp_attAddAttr)
{
ak_tmpAniMenu+='<separator/>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'rmAniAttribute',"+ak_tmp_objAni+",'rotate'"+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>Remove rotate (= 0 degree)</item>'
}
ak_tmpAniMenu+='</menu>'
}
ak_tmp_action=' onactivate="ak_edit_animate('+"'setAniAttr',"+ak_tmp_objAni
ak_tmpAniMenu+='<menu><header>restart'
ak_tmp_attAddAttr=ak_tmp_array[ak_tmp2update][0].getAttribute("restart")
if(ak_tmp_attAddAttr) ak_tmpAniMenu+=' = "'+ak_tmp_attAddAttr+'"'
ak_tmpAniMenu+='</header>'
if(ak_tmp_attAddAttr=="always") ak_tmpAniMenu+='<item checked="yes">always</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+",'restart','always'"+')"'+'>always</item>'
if(ak_tmp_attAddAttr=="whenNotActive") ak_tmpAniMenu+='<item checked="yes">whenNotActive</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+",'restart','whenNotActive'"+')"'+'>whenNotActive</item>'
if(ak_tmp_attAddAttr=="never") ak_tmpAniMenu+='<item checked="yes">never</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+",'restart','never'"+')"'+'>never</item>'
ak_tmpAniMenu+='</menu>'
ak_tmpAniMenu+='<menu><header>additive'
ak_tmp_attAddAttr=ak_tmp_array[ak_tmp2update][0].getAttribute("additive")
if(ak_tmp_attAddAttr) ak_tmpAniMenu+=' = "'+ak_tmp_attAddAttr+'"'
ak_tmpAniMenu+='</header>'
if(ak_tmp_attAddAttr=="replace") ak_tmpAniMenu+='<item checked="yes">replace</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+",'additive','replace'"+')"'+'>replace</item>'
if(ak_tmp_attAddAttr=="sum") ak_tmpAniMenu+='<item checked="yes">sum</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+",'additive','sum'"+')"'+'>sum</item>'
ak_tmpAniMenu+='</menu>'
ak_tmpAniMenu+='<menu><header>accumulate'
ak_tmp_attAddAttr=ak_tmp_array[ak_tmp2update][0].getAttribute("accumulate")
if(ak_tmp_attAddAttr) ak_tmpAniMenu+=' = "'+ak_tmp_attAddAttr+'"'
ak_tmpAniMenu+='</header>'
if(ak_tmp_attAddAttr=="none") ak_tmpAniMenu+='<item checked="yes">none</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+",'accumulate','none'"+')"'+'>none</item>'
if(ak_tmp_attAddAttr=="sum") ak_tmpAniMenu+='<item checked="yes">sum</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+",'accumulate','sum'"+')"'+'>sum</item>'
ak_tmpAniMenu+='</menu>'
ak_tmpAniMenu+='</menu>'
}
else
{
ak_set_rmAdd_animate(for_object)
if(ak_autoMode && !ak_multiName)
{
ak_tmp_action=' onactivate="ak_animate_auto('+"'autoEnd'"+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>[V] Create first 2 values</item>'
ak_tmp_action=' onactivate="ak_animate_auto('+"'autoRestart'"+')"'
ak_tmpAniMenu+='<item id="ak_ctrlLastValue"'+ak_tmp_action+'>[G] Restart autoMode</item>'
ak_tmp_action=' onactivate="ak_animate_auto('+"'autoStop'"+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>[Enter]   End autoMode</item>'
}
else if(ak_autoMode)
{
ak_tmp_action=' onactivate="ak_animate_auto('+"'autoAdd2Values'"+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>[V] Add value ..</item>'
ak_tmp=ak_autoSelectedObject.getAttribute('values')
if(ak_autoSelectedObject.tagName=='animateTransform') ak_tmp_what=ak_autoSelectedObject.getAttribute('type')
if(/;/.test(ak_tmp)) ak_tmp=ak_tmp.split(';').length
else ak_tmp=1
ak_tmp_action=' onactivate="ak_animate_auto('+"'autoSet2Value'"+')"'
ak_tmpAniMenu+='<item id="ak_ctrlLastValue"'+ak_tmp_action+'>[G] Set value '+(ak_valueNr+1)+'./'+ak_tmp+'</item>'
ak_tmp_action=' onactivate="ak_animate_auto('+"'autoStop'"+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>[Enter]   End autoMode</item>'
}
else ak_tmpAniMenu+=ak_add_animateMenu
}
return ak_tmpAniMenu
}
//########################################
function ak_set_rmAdd_animate(for_object,param2)
{
var ak_tmp_style1="fill fill-opacity stroke stroke-width stroke-opacity opacity visibility"
var ak_tmp_style2=" font-size letter-spacing word-spacing"
if(for_object.tagName=="stop") for_object=for_object.parentNode
var ak_tmp_action=' onactivate="ak_animate_auto('+"'autoNew','"+ak_which_nodeNr(for_object)+"','"+ak_animate2update+"'"+')"'
ak_add_animateMenu='<item'+ak_tmp_action+'>autoMode new Animation</item>'
if(ak_hasAnimate)
{
ak_tmp_action=' onactivate="ak_animate_auto('+"'autoSelected','"+ak_which_nodeNr(for_object)+"','"+ak_animate2update+"'"+')"'
ak_add_animateMenu+='<item'+ak_tmp_action+'>autoMode selected Animation</item>'
}
ak_add_animateMenu+='<item/>'
ak_add_animateMenu+='<item/>'
ak_aniArray=new Array
ak_aniStyleArray=new Array
ak_aniTransformArray=false
switch(for_object.tagName)
{
case "a":
case "g":
ak_set_add_transformAnimate(for_object,false)
ak_set_add_styleAnimate(for_object,ak_tmp_style1+ak_tmp_style2,true)
break
case "text":
ak_set_rmMenu(for_object,"x y")
ak_set_add_transformAnimate(for_object,true)
ak_set_add_styleAnimate(for_object,ak_tmp_style1+ak_tmp_style2,true)
break
case "textPath":
ak_set_rmMenu(for_object,"startOffset")
ak_set_add_styleAnimate(for_object,"baseline-shift "+ak_tmp_style1+ak_tmp_style2,true)
break
case "line":
ak_set_rmMenu(for_object,"x1 y1 x2 y2")
ak_set_add_transformAnimate(for_object,true)
ak_set_add_styleAnimate(for_object,ak_tmp_style1,true)
break
case "rect":
ak_set_rmMenu(for_object,"x y width height rx ry")
ak_set_add_transformAnimate(for_object,true)
ak_set_add_styleAnimate(for_object,ak_tmp_style1,true)
break
case "image":
case "use":
ak_set_rmMenu(for_object,"x y width height")
ak_set_add_transformAnimate(for_object,true)
ak_set_add_styleAnimate(for_object,ak_tmp_style1,true)
break
case "circle":
ak_set_rmMenu(for_object,"cx cy r")
ak_set_add_transformAnimate(for_object,true)
ak_set_add_styleAnimate(for_object,ak_tmp_style1,true)
break
case "ellipse":
ak_set_rmMenu(for_object,"cx cy rx ry")
ak_set_add_transformAnimate(for_object,true)
ak_set_add_styleAnimate(for_object,ak_tmp_style1,true)
break
case "path":
ak_set_rmMenu(for_object,"d")
ak_set_add_transformAnimate(for_object,true)
ak_set_add_styleAnimate(for_object,ak_tmp_style1,true)
break
case "polyline":
case "polygon":
ak_set_rmMenu(for_object,"points")
ak_set_add_transformAnimate(for_object,true)
ak_set_add_styleAnimate(for_object,ak_tmp_style1,true)
break
case "svg":
ak_set_rmMenu(for_object,"x y width height viewBox")
ak_set_add_styleAnimate(for_object,ak_tmp_style1,true)
break
case "symbol":
ak_set_add_styleAnimate(for_object,ak_tmp_style1,false)
break
case "marker":
ak_set_rmMenu(for_object,"refX refY markerWidth markerHeight")
ak_set_add_styleAnimate(for_object,ak_tmp_style1,true)
break
case "linearGradient":
ak_set_rmMenu(for_object,"x1 y1 x2 y2")
ak_set_add_stopAnimate(for_object)
break
case "radialGradient":
ak_set_rmMenu(for_object,"cx cy r fx fy")
ak_set_add_stopAnimate(for_object)
break
case "pattern":
case "feImage":
case "feTile":
case "filter": ak_set_rmMenu(for_object,"x y width height"); break
case "feOffset": ak_set_rmMenu(for_object,"dx dy"); break
case "feColorMatrix": ak_set_rmMenu(for_object,"values"); break
case "feFuncR":
case "feFuncG":
case "feFuncB":
case "feFuncA": ak_set_rmMenu(for_object,"tableValues slope intercept amplitude exponent offset"); break
case "feComposite": ak_set_rmMenu(for_object,"k1 k2 k3 k4"); break
case "feConvolveMatrix": ak_set_rmMenu(for_object,"divisor bias targetX targetY order kernelMatrix"); break
case "feDisplacementMap": ak_set_rmMenu(for_object,"scale xChannelSelector yChannelSelector"); break
case "feFlood":
ak_set_rmMenu(for_object,"x y width height")
ak_set_add_styleAnimate(for_object,"flood-color flood-opacity",true)
break
case "feGaussianBlur": ak_set_rmMenu(for_object,"stdDeviation"); break
case "feMorphology": ak_set_rmMenu(for_object,"radius"); break
case "feTurbulence": ak_set_rmMenu(for_object,"seed numOctaves baseFrequency"); break
case "feDiffuseLighting": ak_set_rmMenu(for_object,"diffuseConstant surfaceScale"); ak_set_add_styleAnimate(for_object,"lighting-color",true); break
case "feSpecularLighting": ak_set_rmMenu(for_object,"specularExponent specularConstant surfaceScale"); ak_set_add_styleAnimate(for_object,"lighting-color",true); break
case "feDistantLight": ak_set_rmMenu(for_object,"elevation azimuth"); break
case "fePointLight": ak_set_rmMenu(for_object,"x y z"); break
case "feSpotLight": ak_set_rmMenu(for_object,"x y z pointsAtX pointsAtY pointsAtZ specularExponent limitingConeAngle"); break
default:
ak_add_animateMenu=""
}
}
//########################################
function ak_set_add_stopAnimate(for_object)
{
if(ak_stop_array.length<1) return
var ak_tmp_stop_index=ak_which_nodeNr(ak_gradient_stop[ak_gradient_stop_index])
var ak_tmp_m, ak_tmp_action
ak_add_animateMenu+='<separator/>'
for(var i=0;i<ak_stop_array.length;i++)
{
if(ak_tmp_stop_index==ak_stop_array[i]) ak_tmp_m='* '
else ak_tmp_m='   '
ak_add_animateMenu+='<menu><header>'+ak_tmp_m+(i+1)+'. &lt;stop</header>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'addAniAttribute','"+ak_stop_array[i]+"','"+ak_animateStop2update+"','offset'"+')"'
ak_add_animateMenu+='<item'+ak_tmp_action+'>&lt;animate "offset"</item>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'addAniStyle','"+ak_stop_array[i]+"','"+ak_animateStop2update+"','stop-color'"+')"'
ak_add_animateMenu+='<item'+ak_tmp_action+'>&lt;animate "stop-color"</item>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'addAniStyle','"+ak_stop_array[i]+"','"+ak_animateStop2update+"','stop-opacity'"+')"'
ak_add_animateMenu+='<item'+ak_tmp_action+'>&lt;animate "stop-opacity"</item>'
ak_add_animateMenu+='</menu>'
}
}
//########################################
var ak_aniArray
function ak_set_rmMenu(for_object,for_attributes)
{
var ak_tmp_objAni="'"+ak_which_nodeNr(for_object)+"','"+ak_animate2update+"'"
ak_aniArray=for_attributes.split(" ")
for(var i=0;i<ak_aniArray.length;i++)
{
ak_tmp_action=' onactivate="ak_edit_animate('+"'addAniAttribute',"+ak_tmp_objAni+",'"+ak_aniArray[i]+"'"+')"'
ak_add_animateMenu+='<item'+ak_tmp_action+'>&lt;animate "'+ak_aniArray[i]+'"</item>'
}
}
//########################################
var ak_aniTransformArray
function ak_set_add_transformAnimate(for_object,separator)
{
ak_aniTransformArray=true
if(separator) ak_add_animateMenu+="<separator/>"
var ak_tmp_objAni="'"+ak_which_nodeNr(for_object)+"','"+ak_animate2update+"'"
var ak_tmp_action=' onactivate="ak_edit_animate('+"'addAniMotion',"+ak_tmp_objAni+')"'
ak_add_animateMenu+='<item'+ak_tmp_action+'>&lt;animateMotion>&lt;mpath</item>'
var ak_tmp_array="translate rotate scale skewX skewY".split(" ")
for(var i=0;i<ak_tmp_array.length;i++)
{
ak_tmp_action=' onactivate="ak_edit_animate('+"'addAniTransform',"+ak_tmp_objAni+",'"+ak_tmp_array[i]+"'"+')"'
ak_add_animateMenu+='<item'+ak_tmp_action+'>&lt;animateTransform "'+ak_tmp_array[i]+'"</item>'
}
}
//########################################
var ak_aniStyleArray
function ak_set_add_styleAnimate(for_object,for_attributes,separator)
{
if(separator) ak_add_animateMenu+="<separator/>"
else ak_add_animateMenu=""
var ak_tmp_objAni="'"+ak_which_nodeNr(for_object)+"','"+ak_animate2update+"'"
ak_aniStyleArray=for_attributes.split(" ")
for(var i=0;i<ak_aniStyleArray.length;i++)
{
var ak_tmp_action=' onactivate="ak_edit_animate('+"'addAniStyle',"+ak_tmp_objAni+",'"+ak_aniStyleArray[i]+"'"+')"'
ak_add_animateMenu+='<item'+ak_tmp_action+'>&lt;animate "'+ak_aniStyleArray[i]+'"</item>'
}
}
//########################################
var ak_autoArray, ak_autoMode=false, ak_autoSelectedObject
function ak_animate_auto(action,for_object,for_animate,what,what_2)
{
switch(action)
{
case "autoRestart":
ak_autoArray=new Array
ak_autoArray[0]=new Array(ak_object2update, ak_object2update.cloneNode(0))
if(!ak_multiName) ak_cout('autoMode restarted!')
else ak_cout('autoMode [G] Replaced values ('+(ak_valueNr+1)+'.)')
break
case "autoNew":
ak_undoFunction('disableAppend')
ak_multiName=''
ak_autoArray=new Array
ak_autoArray[0]=new Array(ak_object2update, ak_object2update.cloneNode(0))
ak_autoMode=true
ak_check4animates()
break
case "autoSelected":
case "autoSelectedAppend":
ak_undoFunction('disableAppend')
ak_autoSelectedObject=ak_getObject(for_animate)
var ak_tmp=ak_autoSelectedObject.getId()
if(ak_tmp)
{
if(ak_tmp.replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$1")=="ak_multi_") ak_multiName=ak_tmp.replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$2")
if(ak_tmp.replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$1")=="ak_multi_" && ak_multiName) {}
else
{
ak_multiName=ak_generate_multiId().replace(/^(ak_multi_)/,'')
var ak_tmp_idBegin='ak_multi_'+ak_multiName+'_'
var ak_tmp_idNr=1
while(document.getElementById(ak_tmp_idBegin+ak_tmp_idNr)){ak_tmp_idNr++}
ak_autoSelectedObject.setAttribute('id',ak_tmp_idBegin+ak_tmp_idNr)
if(ak_autoSelectedObject.tagName=='animateTransform')
{
ak_tmp=ak_autoSelectedObject.parentNode.getAttribute('ak_multi')
if(ak_tmp) ak_autoSelectedObject.parentNode.setAttribute('ak_multi',ak_tmp+';'+ak_tmp_idBegin+ak_tmp_idNr)
else ak_autoSelectedObject.parentNode.setAttribute('ak_multi',ak_tmp_idBegin+ak_tmp_idNr)
}
}
}
else
{
ak_multiName=ak_generate_multiId().replace(/^(ak_multi_)/,'')
var ak_tmp_idBegin='ak_multi_'+ak_multiName+'_'
var ak_tmp_idNr=1
while(document.getElementById(ak_tmp_idBegin+ak_tmp_idNr)){ak_tmp_idNr++}
ak_autoSelectedObject.setAttribute('id',ak_tmp_idBegin+ak_tmp_idNr)
if(ak_autoSelectedObject.tagName=='animateTransform')
{
ak_tmp=ak_autoSelectedObject.parentNode.getAttribute('ak_multi')
if(ak_tmp) ak_autoSelectedObject.parentNode.setAttribute('ak_multi',ak_tmp+';'+ak_tmp_idBegin+ak_tmp_idNr)
else ak_autoSelectedObject.parentNode.setAttribute('ak_multi',ak_tmp_idBegin+ak_tmp_idNr)
}
}
ak_tmp=ak_autoSelectedObject.getAttribute('values')
var ak_tmp_what=ak_autoSelectedObject.getAttribute('attributeName')
if(ak_autoSelectedObject.tagName=='animateTransform') ak_tmp_what=ak_autoSelectedObject.getAttribute('type')
if(/;/.test(ak_tmp))
{
ak_tmp=ak_tmp.split(';')
ak_edit_animate('set2Attribute',for_object,for_animate,ak_tmp_what,ak_tmp.length-1,'no_check')
}
else if(ak_tmp) ak_edit_animate('set2Attribute',for_object,for_animate,ak_tmp_what,0,'no_check')
else ak_edit_animate('add2Values',for_object,for_animate,ak_tmp_what,0,'no_check')
ak_autoArray=new Array
ak_autoArray[0]=new Array(ak_object2update, ak_object2update.cloneNode(0))
ak_autoMode=true
ak_check4animates()
break
case "autoAdd":
if(for_object=="0" || for_object=="-1") break
var ak_tmp=true
for(var i=0;i<ak_autoArray.length;i++)
{
if(for_object==ak_which_nodeNr(ak_autoArray[i][0])) {ak_tmp=false; break}
}
if(ak_tmp) ak_autoArray[ak_autoArray.length]=new Array(ak_getObject(for_object), ak_getObject(for_object).cloneNode(0))
if(/Light$/.test(ak_getObject(for_object).tagName))
{
for_object=ak_which_nodeNr(ak_getObject(for_object).parentNode)
if(for_object=="0" || for_object=="-1") break
ak_tmp=true
for(var i=0;i<ak_autoArray.length;i++)
{
if(for_object==ak_which_nodeNr(ak_autoArray[i][0])) {ak_tmp=false; break}
}
if(ak_tmp) ak_autoArray[ak_autoArray.length]=new Array(ak_getObject(for_object), ak_getObject(for_object).cloneNode(0))
}
break
case "autoStop":
ak_autoMode=false
ak_undoFunction('enable')
ak_check4animates()
break
case "autoCancel":
ak_autoMode=false
ak_undoFunction('enableUndo')
ak_check4animates()
break
case "autoSet2Value":
case "autoAdd2Values": // ende for Add to selected Animation
var ak_tmp_ani=ak_userspace_svg.getElementsByTagName("animate")
var ak_tmp_id1, ak_tmp_id2, ak_tmp_array=new Array, ak_tmp
ak_tmp_array[0]=new Array(for_object,for_animate,what)
for(var i=0;i<ak_tmp_ani.length;i++)
{
if(ak_tmp_ani.item(i).getId())
{
ak_tmp_id1=ak_tmp_ani.item(i).getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$1")
ak_tmp_id2=ak_tmp_ani.item(i).getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$2")
if(ak_tmp_id1=="ak_multi_" && ak_tmp_id2==ak_multiName) ak_tmp_array.push(new Array(ak_tmp_ani.item(i).parentNode,ak_tmp_ani.item(i),ak_tmp_ani.item(i).getAttribute('attributeName')))
}
}
ak_tmp_ani=ak_userspace_svg.getElementsByTagName("animateColor")
for(var i=0;i<ak_tmp_ani.length;i++)
{
if(ak_tmp_ani.item(i).getId())
{
ak_tmp_id1=ak_tmp_ani.item(i).getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$1")
ak_tmp_id2=ak_tmp_ani.item(i).getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$2")
if(ak_tmp_id1=="ak_multi_" && ak_tmp_id2==ak_multiName) ak_tmp_array.push(new Array(ak_tmp_ani.item(i).parentNode,ak_tmp_ani.item(i),ak_tmp_ani.item(i).getAttribute('attributeName')))
}
}
ak_tmp_ani=ak_userspace_svg.getElementsByTagName("animateTransform")
for(var i=0;i<ak_tmp_ani.length;i++)
{
if(ak_tmp_ani.item(i).getId())
{
ak_tmp_id1=ak_tmp_ani.item(i).getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$1")
ak_tmp_id2=ak_tmp_ani.item(i).getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$2")
if(ak_tmp_id1=="ak_multi_" && ak_tmp_id2==ak_multiName)
{
ak_tmp=ak_get_multiAttribute(ak_tmp_ani.item(i).parentNode,ak_tmp_ani.item(i).getId())
if(!ak_tmp) ak_tmp=ak_tmp_ani.item(i).parentNode
ak_tmp_array.push(new Array(ak_tmp,ak_tmp_ani.item(i),ak_tmp_ani.item(i).getAttribute('type')))
}
}
}
var ak_tmp_idBegin='ak_multi_'+ak_multiName+'_', ak_tmp_idNr=1, ak_tmp_node, ak_tmp_ok
var ak_tmp_in0, ak_tmp_in1, ak_tmp_inRef
for(var i=0;i<ak_autoArray.length;i++)
{
var ak_tmp_nr=ak_which_nodeNr(ak_autoArray[i][0])
if(ak_tmp_nr!="0" && ak_tmp_nr!="-1")
{
if(ak_autoArray[i][0].tagName=="stop")
{
ak_aniArray=new Array("offset")
ak_aniStyleArray=new Array("stop-color","stop-opacity")
ak_aniTransformArray=false
}
else ak_set_rmAdd_animate(ak_autoArray[i][0])
for(var iA=0;iA<ak_aniArray.length;iA++)
{
ak_tmp_ok=true
for(var iAA=0;iAA<ak_tmp_array.length;iAA++)
{
if(ak_which_nodeNr(ak_tmp_array[iAA][0])==ak_which_nodeNr(ak_autoArray[i][0]))
{
if(ak_aniArray[iA]==ak_tmp_array[iAA][2]){ak_tmp_ok=false;break}
}
}
if(ak_tmp_ok)
{
ak_tmp_in0=ak_autoArray[i][0].getAttribute(ak_aniArray[iA])
ak_tmp_in1=ak_autoArray[i][1].getAttribute(ak_aniArray[iA])
if(ak_tmp_in0!=ak_tmp_in1)
{
if(!ak_tmp_in1) ak_tmp_in1=' '
while(document.getElementById(ak_tmp_idBegin+ak_tmp_idNr)){ak_tmp_idNr++}
ak_tmp_node='<animate id="'+ak_tmp_idBegin+ak_tmp_idNr+'" attributeName="'+ak_aniArray[iA]
ak_tmp_node+='" values="'+ak_tmp_in1
ak_tmp_in0=ak_autoSelectedObject.getAttribute('values')
if(/;/.test(ak_tmp_in0)) ak_tmp_in0=ak_tmp_in0.split(';').length-1
else ak_tmp_in0=0
for(var iAA=0;iAA<ak_tmp_in0;iAA++)
{
ak_tmp_node+=';'+ak_tmp_in1
}
ak_tmp_node+='"/>'
ak_tmp=ak_appendChildSP(ak_tmp_node,ak_autoArray[i][0])
var ak_tmp_attr='fill begin dur end repeatCount repeatDur calcMode keyTimes keySplines keyPoints restart additive accumulate'
ak_tmp_attr=ak_tmp_attr.split(' ')
for(var iAA=0;iAA<ak_tmp_attr.length;iAA++)
{
ak_tmp_ok=ak_autoSelectedObject.getAttribute(ak_tmp_attr[iAA])
if(ak_tmp_ok) ak_tmp.setAttribute(ak_tmp_attr[iAA],ak_tmp_ok)
else {try{ak_tmp.removeAttribute(ak_tmp_attr[iAA])}catch(error){}}
}
if(ak_which_nodeNr(ak_autoArray[i][0])==ak_object2update_nodeNr)
{
ak_animate2update=ak_which_nodeNr(ak_tmp)
ak_value2update=ak_animate2update; ak_valueNr=1
}
ak_tmp_idNr++
ak_tagName_cout=ak_tmp_cout
}
}
}
for(var iA=0;iA<ak_aniStyleArray.length;iA++)
{
ak_tmp_ok=true
for(var iAA=0;iAA<ak_tmp_array.length;iAA++)
{
if(ak_which_nodeNr(ak_tmp_array[iAA][0])==ak_which_nodeNr(ak_autoArray[i][0]))
{
if(ak_aniStyleArray[iA]==ak_tmp_array[iAA][2]){ak_tmp_ok=false;break}
}
}
if(ak_tmp_ok)
{
ak_tmp_in0=ak_SetGetRm_styleValue(ak_autoArray[i][0],ak_aniStyleArray[iA],"get","getValue")
ak_tmp_in1=ak_SetGetRm_styleValue(ak_autoArray[i][1],ak_aniStyleArray[iA],"get","getValue")
if(ak_tmp_in0!=ak_tmp_in1)
{
while(document.getElementById(ak_tmp_idBegin+ak_tmp_idNr)){ak_tmp_idNr++}
ak_tmp_node='<animate id="'+ak_tmp_idBegin+ak_tmp_idNr+'" attributeName="'+ak_aniStyleArray[iA]
ak_tmp_node+='" values="'+ak_tmp_in1
ak_tmp_in0=ak_autoSelectedObject.getAttribute('values')
if(/;/.test(ak_tmp_in0)) ak_tmp_in0=ak_tmp_in0.split(';').length-1
else ak_tmp_in0=0
for(var iAA=0;iAA<ak_tmp_in0;iAA++)
{
ak_tmp_node+=';'+ak_tmp_in1
}
ak_tmp_node+='"/>'
ak_tmp=ak_appendChildSP(ak_tmp_node,ak_autoArray[i][0])
var ak_tmp_attr='fill begin dur end repeatCount repeatDur calcMode keyTimes keySplines keyPoints restart additive accumulate'
ak_tmp_attr=ak_tmp_attr.split(' ')
for(var iAA=0;iAA<ak_tmp_attr.length;iAA++)
{
ak_tmp_ok=ak_autoSelectedObject.getAttribute(ak_tmp_attr[iAA])
if(ak_tmp_ok) ak_tmp.setAttribute(ak_tmp_attr[iAA],ak_tmp_ok)
else {try{ak_tmp.removeAttribute(ak_tmp_attr[iAA])}catch(error){}}
}
if(ak_which_nodeNr(ak_autoArray[i][0])==ak_object2update_nodeNr)
{
ak_animate2update=ak_which_nodeNr(ak_tmp)
ak_value2update=ak_animate2update; ak_valueNr=1
}
ak_tmp_idNr++
ak_tagName_cout=ak_tmp_cout
}
}
}
if(ak_aniTransformArray)
{
ak_tmp_in0=ak_SetGetRm_transformValue(ak_autoArray[i][0],'translate',"get","no_cout")
if(ak_tmp_in0=='false') ak_SetGetRm_transformValue(ak_autoArray[i][1],'translate',"remove","no_cout")
else ak_SetGetRm_transformValue(ak_autoArray[i][0],'translate',ak_tmp_in0,"no_cout")
ak_tmp_in0=ak_autoArray[i][0].getAttribute('transform')
ak_tmp_in1=ak_SetGetRm_transformValue(ak_autoArray[i][1],'translate',"get","no_cout")
if(ak_tmp_in1=='false') ak_SetGetRm_transformValue(ak_autoArray[i][1],'translate',"remove","no_cout")
else ak_SetGetRm_transformValue(ak_autoArray[i][1],'translate',ak_tmp_in1,"no_cout")
ak_tmp_in1=ak_autoArray[i][1].getAttribute('transform')
if(ak_tmp_in0!=ak_tmp_in1)
{
if(!ak_tmp_in0) ak_tmp_inRef=ak_tmp_in1
else ak_tmp_inRef=ak_tmp_in0
ak_tmp_inRef=ak_tmp_inRef.split(')')
ak_tmp_inRef.pop()
var ak_tmp_2=false, ak_tmp_mx=false
for(var iA=0;iA<ak_tmp_inRef.length;iA++)
{
ak_tmp_inRef[iA]=ak_tmp_inRef[iA].replace(/^,|^ +|^;| +$/g,"")
if(/^matrix/.test(ak_tmp_inRef[iA])) {ak_tmp_inRef.splice(iA,1);ak_tmp_mx=true;iA--}
else
{
for(var iB=(iA+1);iB<ak_tmp_inRef.length;iB++)
{
if(ak_tmp_inRef[iA].split('(')[0]==ak_tmp_inRef[iB].split('(')[0]) {ak_tmp_inRef.splice(iB,1);ak_tmp_2=true;iB--}
}
}
}
if(ak_tmp_inRef.length==0) ak_alert('WARNING: No animation for matrix possible!')
else if(ak_tmp_mx && !ak_tmp_2) ak_alert('WARNING: No animation for matrix possible, parameter will be removed!')
else if(ak_tmp_mx && ak_tmp_2) ak_alert('WARNING: No animation for matrix possible, also double paramters will be removed!')
else if(ak_tmp_2) ak_alert('WARNING: Double paramters will be removed!')
var ak_tmp_multi=ak_autoArray[i][0].getAttribute('ak_multi')
var ak_tmp_count=0
if(!ak_tmp_multi) ak_tmp_multi=''
else
{
var ak_tmp_split=ak_tmp_multi.split(';')
for(var iBB=0;iBB<ak_tmp_split.length;iBB++)
{
if(ak_tmp_split[iBB].replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$1")=='ak_multi_' && ak_tmp_split[iBB].replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$2")==ak_multiName) ak_tmp_count++
else
{
ak_tmp_split.splice(iBB,1)
iBB--
}
}
var ak_tmp_move=document.getElementById(ak_tmp_split[ak_tmp_split.length-1])
}
if(ak_tmp_inRef.length>ak_tmp_count)
{
var ak_tmp_yesTransform=true
if(ak_tmp_count>0 && ak_which_nodeNr(ak_tmp_move.parentNode)==ak_which_nodeNr(ak_autoArray[i][0]))
{
ak_create_parentNode('<g/>',ak_autoArray[i][0])
ak_autoArray[i][0].parentNode.insertBefore(ak_tmp_move,ak_autoArray[i][0])
ak_nice_tabs(ak_autoArray[i][0].parentNode)
}
ak_tmp_idBegin='ak_multi_'+ak_multiName+'_'
for(var iC=ak_tmp_count;iC<ak_tmp_inRef.length;iC++)
{
while(document.getElementById(ak_tmp_idBegin+ak_tmp_idNr)){ak_tmp_idNr++}
ak_tmp_node='<animateTransform id="'+ak_tmp_idBegin+ak_tmp_idNr+'" attributeName="transform" type="'+ak_tmp_inRef[iC].split('(')[0]
ak_tmp_in1=ak_SetGetRm_transformValue(ak_autoArray[i][1],ak_tmp_inRef[iC].split('(')[0],"get","getValue")
ak_tmp_node+='" values="'+ak_tmp_in1
ak_tmp_in0=ak_autoSelectedObject.getAttribute('values')
if(/;/.test(ak_tmp_in0)) ak_tmp_in0=ak_tmp_in0.split(';').length-1
else ak_tmp_in0=0
for(var iAA=0;iAA<ak_tmp_in0;iAA++)
{
ak_tmp_node+=';'+ak_tmp_in1
}
ak_tmp_node+='"/>'
if(iC==(ak_tmp_inRef.length-1)) ak_tmp=ak_appendChildSP(ak_tmp_node,ak_autoArray[i][0])
else
{
ak_create_parentNode('<g/>',ak_autoArray[i][0])
ak_tmp=ak_insertBeforeSP(ak_tmp_node,ak_autoArray[i][0])
}
var ak_tmp_attr='fill begin dur end repeatCount repeatDur calcMode keyTimes keySplines keyPoints restart additive accumulate'
ak_tmp_attr=ak_tmp_attr.split(' ')
for(var iAA=0;iAA<ak_tmp_attr.length;iAA++)
{
ak_tmp_ok=ak_autoSelectedObject.getAttribute(ak_tmp_attr[iAA])
if(ak_tmp_ok) ak_tmp.setAttribute(ak_tmp_attr[iAA],ak_tmp_ok)
else {try{ak_tmp.removeAttribute(ak_tmp_attr[iAA])}catch(error){}}
}
if(ak_which_nodeNr(ak_autoArray[i][0])==ak_which_nodeNr(ak_object2update))
{
ak_animate2update=ak_which_nodeNr(ak_tmp)
ak_value2update=ak_animate2update; ak_valueNr=1
}
if(ak_tmp_multi) ak_tmp_multi+=';'+ak_tmp_idBegin+ak_tmp_idNr
else ak_tmp_multi=ak_tmp_idBegin+ak_tmp_idNr
ak_tmp_idNr++
}
ak_autoArray[i][0].setAttribute('ak_multi',ak_tmp_multi)
//ak_autoArray[i][0].setAttribute('transform',ak_tmp_inRef.join(') ')+')')
}
}
}
}

}
if(ak_autoSelectedObject.tagName=='animateTransform')
{
ak_tmp=ak_get_multiAttribute(ak_autoSelectedObject.parentNode,ak_autoSelectedObject.getId())
if(!ak_tmp) ak_tmp=ak_autoSelectedObject.parentNode
ak_tmp_ok=ak_autoSelectedObject.getAttribute('type')
}
else
{
ak_tmp=ak_autoSelectedObject.parentNode
ak_tmp_ok=ak_autoSelectedObject.getAttribute('attributeName')
}
ak_tmp_in0=ak_autoSelectedObject.getAttribute('values')
if(/;/.test(ak_tmp_in0)) ak_tmp_in0=ak_tmp_in0.split(';').length-1
else ak_tmp_in0=0
if(action=='autoAdd2Values') ak_edit_animate('add2Values',ak_which_nodeNr(ak_tmp),ak_which_nodeNr(ak_autoSelectedObject),ak_tmp_ok)
else ak_edit_animate('set2Value',ak_which_nodeNr(ak_tmp),ak_which_nodeNr(ak_autoSelectedObject),ak_tmp_ok,ak_tmp_in0)
if(ak_tmp_yesTransform) ak_clickset_obj2update(evt,ak_object2update)
ak_cout(ak_tagName_cout)
ak_autoMode=false
ak_undoFunction('enable')
ak_check4animates()
break
case "autoEnd": // ende for Add new Animation// end 
var ak_tmp_idBegin='', ak_tmp_idNr=1, ak_tmp_node, ak_tmp
var ak_tmp_in0, ak_tmp_in1, ak_tmp_inRef
var ak_tmp_cout=ak_tagName_cout
ak_tagName_cout="No edit recognized, no new animations generated!"
for(var i=0;i<ak_autoArray.length;i++)
{
var ak_tmp_nr=ak_which_nodeNr(ak_autoArray[i][0])
if(ak_tmp_nr!="0" && ak_tmp_nr!="-1")
{
if(ak_autoArray[i][0].tagName=="stop")
{
ak_aniArray=new Array("offset")
ak_aniStyleArray=new Array("stop-color","stop-opacity")
ak_aniTransformArray=false
}
else ak_set_rmAdd_animate(ak_autoArray[i][0])
for(var iA=0;iA<ak_aniArray.length;iA++)
{
ak_tmp_in0=ak_autoArray[i][0].getAttribute(ak_aniArray[iA])
ak_tmp_in1=ak_autoArray[i][1].getAttribute(ak_aniArray[iA])
if(ak_tmp_in0!=ak_tmp_in1)
{
if(!ak_tmp_in0) ak_tmp_in0=' '
if(!ak_tmp_in1) ak_tmp_in1=' '
if(!ak_tmp_idBegin) ak_tmp_idBegin=ak_generate_multiId()+'_'
while(document.getElementById(ak_tmp_idBegin+ak_tmp_idNr)){ak_tmp_idNr++}
ak_tmp_node='<animate id="'+ak_tmp_idBegin+ak_tmp_idNr+'" attributeName="'+ak_aniArray[iA]
ak_tmp_node+='" begin="0" dur="2" values="'+ak_tmp_in1+';'+ak_tmp_in0+'"/>'
ak_tmp=ak_appendChildSP(ak_tmp_node,ak_autoArray[i][0])
if(ak_which_nodeNr(ak_autoArray[i][0])==ak_object2update_nodeNr)
{
ak_animate2update=ak_which_nodeNr(ak_tmp)
ak_value2update=ak_animate2update; ak_valueNr=1
}
ak_tmp_idNr++
ak_tagName_cout=ak_tmp_cout
}
}
for(var iA=0;iA<ak_aniStyleArray.length;iA++)
{
ak_tmp_in0=ak_SetGetRm_styleValue(ak_autoArray[i][0],ak_aniStyleArray[iA],"get","getValue")
ak_tmp_in1=ak_SetGetRm_styleValue(ak_autoArray[i][1],ak_aniStyleArray[iA],"get","getValue")
if(ak_tmp_in0!=ak_tmp_in1)
{
if(!ak_tmp_idBegin) ak_tmp_idBegin=ak_generate_multiId()+'_'
while(document.getElementById(ak_tmp_idBegin+ak_tmp_idNr)){ak_tmp_idNr++}
ak_tmp_node='<animate id="'+ak_tmp_idBegin+ak_tmp_idNr+'" attributeName="'+ak_aniStyleArray[iA]
ak_tmp_node+='" begin="0" dur="2" values="'+ak_tmp_in1+';'+ak_tmp_in0+'"/>'
ak_tmp=ak_appendChildSP(ak_tmp_node,ak_autoArray[i][0])
if(ak_which_nodeNr(ak_autoArray[i][0])==ak_object2update_nodeNr)
{
ak_animate2update=ak_which_nodeNr(ak_tmp)
ak_value2update=ak_animate2update; ak_valueNr=1
}
ak_tmp_idNr++
ak_tagName_cout=ak_tmp_cout
}
}
if(ak_aniTransformArray)
{
ak_tmp_in0=ak_SetGetRm_transformValue(ak_autoArray[i][0],'translate',"get","no_cout")
if(ak_tmp_in0=='false') ak_SetGetRm_transformValue(ak_autoArray[i][0],'translate',"remove","no_cout")
else ak_SetGetRm_transformValue(ak_autoArray[i][0],'translate',ak_tmp_in0,"no_cout")
ak_tmp_in0=ak_autoArray[i][0].getAttribute('transform')
ak_tmp_in1=ak_SetGetRm_transformValue(ak_autoArray[i][1],'translate',"get","no_cout")
if(ak_tmp_in1=='false') ak_SetGetRm_transformValue(ak_autoArray[i][1],'translate',"remove","no_cout")
else ak_SetGetRm_transformValue(ak_autoArray[i][1],'translate',ak_tmp_in1,"no_cout")
ak_tmp_in1=ak_autoArray[i][1].getAttribute('transform')
if(ak_tmp_in0!=ak_tmp_in1)
{
if(!ak_tmp_in0) ak_tmp_inRef=ak_tmp_in1
else ak_tmp_inRef=ak_tmp_in0
ak_tmp_inRef=ak_tmp_inRef.split(')')
ak_tmp_inRef.pop()
var ak_tmp_2=false, ak_tmp_mx=false
for(var iA=0;iA<ak_tmp_inRef.length;iA++)
{
ak_tmp_inRef[iA]=ak_tmp_inRef[iA].replace(/^,|^ +|^;| +$/g,"")
if(/^matrix/.test(ak_tmp_inRef[iA])) {ak_tmp_inRef.splice(iA,1);ak_tmp_mx=true;iA--}
else
{
for(var iB=(iA+1);iB<ak_tmp_inRef.length;iB++)
{
if(ak_tmp_inRef[iA].split('(')[0]==ak_tmp_inRef[iB].split('(')[0]) {ak_tmp_inRef.splice(iB,1);ak_tmp_2=true;iB--}
}
}
}
if(ak_tmp_inRef.length==0) ak_alert('WARNING: No animation for matrix possible!')
else if(ak_tmp_mx && !ak_tmp_2) ak_alert('WARNING: No animation for matrix possible, parameter will be removed!')
else if(ak_tmp_mx && ak_tmp_2) ak_alert('WARNING: No animation for matrix possible, also double paramters will be removed!')
else if(ak_tmp_2) ak_alert('WARNING: Double paramters will be removed!')
if(ak_tmp_inRef.length>0)
{
var ak_tmp_yesTransform=true
if(!ak_tmp_idBegin) ak_tmp_idBegin=ak_generate_multiId()+'_'
var ak_tmp_multi=ak_autoArray[i][0].getAttribute('ak_multi')
if(!ak_tmp_multi) ak_tmp_multi=''
for(var iC=0;iC<ak_tmp_inRef.length;iC++)
{
while(document.getElementById(ak_tmp_idBegin+ak_tmp_idNr)){ak_tmp_idNr++}
ak_tmp_node='<animateTransform id="'+ak_tmp_idBegin+ak_tmp_idNr+'" attributeName="transform" type="'+ak_tmp_inRef[iC].split('(')[0]
ak_tmp_in0=ak_SetGetRm_transformValue(ak_autoArray[i][0],ak_tmp_inRef[iC].split('(')[0],"get","getValue")
ak_tmp_in1=ak_SetGetRm_transformValue(ak_autoArray[i][1],ak_tmp_inRef[iC].split('(')[0],"get","getValue")
ak_tmp_node+='" begin="0" dur="2" values="'+ak_tmp_in1+';'+ak_tmp_in0+'"/>'
if(iC==(ak_tmp_inRef.length-1)) ak_tmp=ak_appendChildSP(ak_tmp_node,ak_autoArray[i][0])
else
{
ak_create_parentNode('<g/>',ak_autoArray[i][0])
ak_tmp=ak_insertBeforeSP(ak_tmp_node,ak_autoArray[i][0])
}
if(ak_which_nodeNr(ak_autoArray[i][0])==ak_which_nodeNr(ak_object2update))
{
ak_animate2update=ak_which_nodeNr(ak_tmp)
ak_value2update=ak_animate2update; ak_valueNr=1
}
if(ak_tmp_multi) ak_tmp_multi+=';'+ak_tmp_idBegin+ak_tmp_idNr
else ak_tmp_multi=ak_tmp_idBegin+ak_tmp_idNr
ak_tmp_idNr++
}
ak_autoArray[i][0].setAttribute('ak_multi',ak_tmp_multi)
//ak_autoArray[i][0].setAttribute('transform',ak_tmp_inRef.join(') ')+')')
}
}
}
}

}
ak_autoMode=false
if(ak_tmp_idBegin)
{
ak_multiName=ak_tmp_idBegin.replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$2")
if(ak_tmp_yesTransform) ak_clickset_obj2update(evt,ak_object2update)
ak_cout(ak_tagName_cout)
ak_undoFunction('enable')
ak_check4animates()
}
else
{
ak_cout(ak_tagName_cout)
ak_undoFunction('enable')
ak_check4animates()
}
if(/^No edit recognized/.test(ak_tagName_cout))
{ak_alert("No edit recognized, no new animations generated!")}
break
default:
}
}
//########################################
function ak_alert(text)
{
for (var i=0; i<256; i++) {ak_key_status[i]="up"}
alert(text)
window.focus(ak_svgroot)
}
//########################################
function ak_generate_multiId()
{
var ak_tmp_array=new Array, ak_tmp_id1, ak_tmp_idArray=new Array
var ak_tmp_ani=ak_userspace_svg.getElementsByTagName("animate")
for(var i=0;i<ak_tmp_ani.length;i++)
{
if(ak_tmp_ani.item(i).getId())
{
ak_tmp_id1=ak_tmp_ani.item(i).getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$1")
if(ak_tmp_id1=="ak_multi_") ak_tmp_idArray.push(ak_tmp_ani.item(i).getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$2"))
}
}
ak_tmp_ani=ak_userspace_svg.getElementsByTagName("animateColor")
for(var i=0;i<ak_tmp_ani.length;i++)
{
if(ak_tmp_ani.item(i).getId())
{
ak_tmp_id1=ak_tmp_ani.item(i).getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$1")
if(ak_tmp_id1=="ak_multi_") ak_tmp_idArray.push(ak_tmp_ani.item(i).getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$2"))
}
}
ak_tmp_ani=ak_userspace_svg.getElementsByTagName("animateTransform")
for(var i=0;i<ak_tmp_ani.length;i++)
{
if(ak_tmp_ani.item(i).getId())
{
ak_tmp_id1=ak_tmp_ani.item(i).getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$1")
if(ak_tmp_id1=="ak_multi_") ak_tmp_idArray.push(ak_tmp_ani.item(i).getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$2"))
}
}
var ak_tmp_nr=1
for(var i=0;i<ak_tmp_idArray.length;i++)
{
if(!isNaN(ak_tmp_idArray[i]))
{
var ak_tmp_nrC=parseInt(ak_tmp_idArray[i])
if(ak_tmp_nrC>=ak_tmp_nr) ak_tmp_nr=ak_tmp_nrC+1
}
}
return "ak_multi_"+ak_tmp_nr
}
//########################################
function ak_edit_animateMulti(action,for_object,for_animate,what,what_2,what_3)
{
var ak_tmp_multiName=ak_multiName, ak_tmp
ak_multiName=''
if(action=='addAniTransform' || action=='addAniStyle' || action=='addAniAttribute' || action=='addAniMotion' || action=='selectAnimation')
{
ak_edit_animate(action,for_object,for_animate,what,what_2)
return
}
if(action=='delSelectedAnimation')
{
ak_add2undo()
ak_edit_animate('delAnimation',for_object,for_animate,what,what_2)
ak_undo('refresh')
ak_multiName=ak_tmp_multiName
ak_check4animates()
return
}
if(action=='startSingleAnimation')
{
ak_edit_animate('startAnimation',for_object,for_animate,what,what_2)
ak_multiName=ak_tmp_multiName
return
}
ak_multiLocked=true
var ak_tmp, ak_tmp_array=new Array, ak_tmp_ani
if(action=='delAllListedAnimation')
{
ak_add2undo()
ak_tmp_ani=ak_getObject(for_object).childNodes
for(var i=0;i<ak_tmp_ani.length;i++)
{
if(/^animate/.test(ak_tmp_ani.item(i).tagName)) ak_tmp_array.push(ak_tmp_ani.item(i))
}
for(var i=0;i<ak_tmp_array.length;i++)
{
ak_edit_animate('delAnimation',for_object,ak_which_nodeNr(ak_tmp_array[i]),what,what_2)
}
ak_tmp=ak_getObject(for_object).getAttribute('ak_multi')
if(ak_tmp)
{
ak_tmp=ak_tmp.split(';')
ak_tmp.reverse()
for(var i=0;i<ak_tmp.length;i++)
{
ak_tmp_ani=document.getElementById(ak_tmp[i])
if(ak_tmp_ani) ak_edit_animate('delAnimation',ak_which_nodeNr(ak_tmp_ani.parentNode),ak_which_nodeNr(ak_tmp_ani),what,what_2)
}
}
ak_multiLocked=false
ak_multiName=ak_tmp_multiName
ak_check4animates()
ak_undo('refresh')
return
}
ak_tmp_ani=ak_userspace_svg.getElementsByTagName("animate")
var ak_tmp_id1, ak_tmp_id2
var ak_tmp_IdArray=new Array()
ak_tmp_array[0]=new Array(for_object,for_animate,what)
for(var i=0;i<ak_tmp_ani.length;i++)
{
if(ak_tmp_ani.item(i).getId())
{
ak_tmp_id1=ak_tmp_ani.item(i).getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$1")
ak_tmp_id2=ak_tmp_ani.item(i).getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$2")
if(ak_tmp_id1=="ak_multi_" && ak_tmp_id2==ak_tmp_multiName) ak_tmp_array.push(new Array(ak_which_nodeNr(ak_tmp_ani.item(i).parentNode),ak_which_nodeNr(ak_tmp_ani.item(i)),ak_tmp_ani.item(i).getAttribute('attributeName')))
else if(ak_tmp_id1=="ak_multi_") ak_tmp_IdArray.push(ak_tmp_id2)
}
}
ak_tmp_ani=ak_userspace_svg.getElementsByTagName("animateColor")
for(var i=0;i<ak_tmp_ani.length;i++)
{
if(ak_tmp_ani.item(i).getId())
{
ak_tmp_id1=ak_tmp_ani.item(i).getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$1")
ak_tmp_id2=ak_tmp_ani.item(i).getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$2")
if(ak_tmp_id1=="ak_multi_" && ak_tmp_id2==ak_tmp_multiName) ak_tmp_array.push(new Array(ak_which_nodeNr(ak_tmp_ani.item(i).parentNode),ak_which_nodeNr(ak_tmp_ani.item(i)),ak_tmp_ani.item(i).getAttribute('attributeName')))
else if(ak_tmp_id1=="ak_multi_") ak_tmp_IdArray.push(ak_tmp_id2)
}
}
ak_tmp_ani=ak_userspace_svg.getElementsByTagName("animateTransform")
for(var i=0;i<ak_tmp_ani.length;i++)
{
if(ak_tmp_ani.item(i).getId())
{
ak_tmp_id1=ak_tmp_ani.item(i).getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$1")
ak_tmp_id2=ak_tmp_ani.item(i).getId().replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$2")
if(ak_tmp_id1=="ak_multi_" && ak_tmp_id2==ak_tmp_multiName) ak_tmp_array.push(new Array(ak_which_nodeNr(ak_tmp_ani.item(i).parentNode),ak_which_nodeNr(ak_tmp_ani.item(i)),ak_tmp_ani.item(i).getAttribute('type')))
else if(ak_tmp_id1=="ak_multi_") ak_tmp_IdArray.push(ak_tmp_id2)
}
}
for(var i=1;i<ak_tmp_array.length;i++)
{
if(ak_tmp_array[0][1]==ak_tmp_array[i][1])
{
if(action=='delAnimation') ak_tmp_array.splice(0,1)
else ak_tmp_array.splice(i,1)
break
}
}
if(action=='delAnimation') // = delete ak_multi
{
ak_tmp_array.reverse()
ak_add2undo()
var ak_tmp_object=new Array
for(var i=0;i<ak_tmp_array.length;i++)
{
ak_tmp_object[i]=new Array(ak_getObject(ak_tmp_array[i][0]),ak_getObject(ak_tmp_array[i][1]))
}
for(var i=0;i<ak_tmp_array.length;i++)
{
ak_edit_animate(action,ak_which_nodeNr(ak_tmp_object[i][0]),ak_which_nodeNr(ak_tmp_object[i][1]),ak_tmp_array[i][2],what_2)
}
ak_multiLocked=false
ak_multiName=ak_tmp_multiName
ak_check4animates()
ak_undo('refresh')
}
else if(action=='renameId')
{
ak_tmp_id1=prompt('Please Enter "ak_multi_..." Id!',ak_tmp_multiName)
window.focus(ak_svgroot)
if(!ak_tmp_id1 || ak_tmp_id1==ak_tmp_multiName) {ak_multiName=ak_tmp_multiName;return}
ak_tmp_id1=ak_tmp_id1.replace(/^ak_multi_/,'')
ak_tmp_id1=ak_tmp_id1.replace(/[^A-Za-z\d]/g,'')
if(!ak_tmp_id1 || ak_tmp_id1==ak_tmp_multiName) {ak_multiName=ak_tmp_multiName;return}
do
{
ak_tmp=false
for(var i=0;i<ak_tmp_IdArray.length;i++)
{
if(ak_tmp_IdArray[i]==ak_tmp_id1)
{
ak_tmp=true
break
}
}
if(ak_tmp)
{
ak_tmp_id1=prompt('"ak_multi_'+ak_tmp_id1+'" already exists, please enter "ak_multi_..." Id!',ak_tmp_multiName)
window.focus(ak_svgroot)
if(!ak_tmp_id1 || ak_tmp_id1==ak_tmp_multiName) {ak_multiName=ak_tmp_multiName;return}
ak_tmp_id1=ak_tmp_id1.replace(/^ak_multi_/,'')
ak_tmp_id1=ak_tmp_id1.replace(/[^A-Za-z\d]/g,'')
if(!ak_tmp_id1 || ak_tmp_id1==ak_tmp_multiName) {ak_multiName=ak_tmp_multiName;return}
}
}
while(ak_tmp)
ak_tmp=1
for(var i=0;i<ak_tmp_array.length;i++)
{
while(document.getElementById('ak_multi_'+ak_tmp_id1+'_'+ak_tmp)){ak_tmp++}
var ak_tmp_object=ak_getObject(ak_tmp_array[i][1])
if(ak_tmp_object.tagName=='animateTransform')
{
var ak_tmp_object2=ak_get_multiAttribute(ak_tmp_object.parentNode,ak_tmp_object.getId())
if(ak_tmp_object2)
{
ak_tmp_id2=ak_tmp_object2.getAttribute('ak_multi')
ak_tmp_id2=ak_tmp_id2.split(';')
for(var iB=0;iB<ak_tmp_id2.length;iB++)
{
if(ak_tmp_id2[iB]==ak_tmp_object.getId()) {ak_tmp_id2[iB]='ak_multi_'+ak_tmp_id1+'_'+ak_tmp;break}
}
ak_tmp_object2.setAttribute('ak_multi',ak_tmp_id2.join(';'))
}
}
ak_tmp_object.setAttribute('id','ak_multi_'+ak_tmp_id1+'_'+ak_tmp)
}
ak_multiName=ak_tmp_id1
ak_multiLocked=false
ak_check4animates()
}
else if(action=='set2Attribute')
{
for(var i=1;i<ak_tmp_array.length;i++)
{
if(ak_getObject(ak_tmp_array[i][0]).tagName=="stop")
{
ak_aniArray=new Array("offset")
ak_aniStyleArray=new Array("stop-color","stop-opacity")
ak_aniTransformArray=false
}
else ak_set_rmAdd_animate(ak_getObject(ak_tmp_array[i][0]))
ak_edit_animate(action,ak_tmp_array[i][0],ak_tmp_array[i][1],ak_tmp_array[i][2],what_2)
}
ak_multiLocked=false
if(ak_getObject(ak_tmp_array[0][0]).tagName=="stop")
{
ak_aniArray=new Array("offset")
ak_aniStyleArray=new Array("stop-color","stop-opacity")
ak_aniTransformArray=false
}
else ak_set_rmAdd_animate(ak_getObject(ak_tmp_array[0][0]))
ak_edit_animate(action,ak_tmp_array[0][0],ak_tmp_array[0][1],ak_tmp_array[0][2],what_2)
ak_multiName=ak_tmp_multiName
ak_check4animates()
}
else if(action=='setFill' || action=='setFillStart' || action=='setAniAttr' || action=='rmAniAttribute' || action=='setRepeat' || action=='editKeyPoints')
{
if(action=='rmAniAttribute') ak_add2undo()
var ak_tmp_object=new Array
for(var i=0;i<ak_tmp_array.length;i++)
{
ak_tmp_object[i]=new Array(ak_getObject(ak_tmp_array[i][0]),ak_getObject(ak_tmp_array[i][1]))
}
if(action=='setRepeat')
{
ak_edit_animate(action,ak_which_nodeNr(ak_tmp_object[0][0]),ak_which_nodeNr(ak_tmp_object[0][1]),what,what_2)
for(var i=1;i<ak_tmp_array.length;i++)
{
if(ak_tmp_object[0][1].getAttribute('repeatCount')) ak_tmp_object[i][1].setAttribute('repeatCount',ak_tmp_object[0][1].getAttribute('repeatCount'))
else {try{ak_tmp_object[i][1].removeAttribute('repeatCount')}catch(error){}}
if(ak_tmp_object[0][1].getAttribute('repeatDur')) ak_tmp_object[i][1].setAttribute('repeatDur',ak_tmp_object[0][1].getAttribute('repeatDur'))
else {try{ak_tmp_object[i][1].removeAttribute('repeatDur')}catch(error){}}
}
}
else if(action=='editKeyPoints')
{
ak_edit_animate(action,ak_which_nodeNr(ak_tmp_object[0][0]),ak_which_nodeNr(ak_tmp_object[0][1]),what,what_2)
for(var i=1;i<ak_tmp_array.length;i++)
{
if(ak_tmp_object[0][1].getAttribute('keyPoints')) ak_tmp_object[i][1].setAttribute('keyPoints',ak_tmp_object[0][1].getAttribute('keyPoints'))
else {try{ak_tmp_object[i][1].removeAttribute('keyPoints')}catch(error){}}
}
}
else
{
for(var i=0;i<ak_tmp_array.length;i++)
{
ak_edit_animate(action,ak_which_nodeNr(ak_tmp_object[i][0]),ak_which_nodeNr(ak_tmp_object[i][1]),what,what_2)
}
}
ak_multiLocked=false
ak_multiName=ak_tmp_multiName
if(action=='rmAniAttribute') ak_undo('refresh')
if(!what_3 && action=='rmAniAttribute' && (what=='keyTimes' || what=='keySplines'))
{
if(ak_keysEditor) ak_edit_keyTimesInit("keyEditor",for_object,for_animate)
else ak_edit_animateSpline("closeKeyTimes",for_object,for_animate)
}
else if(!what_3) ak_check4animates()
}
else if(action=='setBeginDurEnd' || action=='setTiming')
{
var ak_tmp_object=new Array, ak_tmp_in
for(var i=0;i<ak_tmp_array.length;i++)
{
ak_tmp_object[i]=new Array(ak_getObject(ak_tmp_array[i][0]),ak_getObject(ak_tmp_array[i][1]))
}
if(action=='setBeginDurEnd')
{
ak_edit_animate(action,ak_which_nodeNr(ak_tmp_object[0][0]),ak_which_nodeNr(ak_tmp_object[0][1]),what,what_2)
for(var i=1;i<ak_tmp_array.length;i++)
{
if(ak_tmp_object[0][1].getAttribute('begin')) ak_tmp_object[i][1].setAttribute('begin',ak_tmp_object[0][1].getAttribute('begin'))
else {try{ak_tmp_object[i][1].removeAttribute('begin')}catch(error){}}
if(ak_tmp_object[0][1].getAttribute('dur')) ak_tmp_object[i][1].setAttribute('dur',ak_tmp_object[0][1].getAttribute('dur'))
else {try{ak_tmp_object[i][1].removeAttribute('dur')}catch(error){}}
if(ak_tmp_object[0][1].getAttribute('end')) ak_tmp_object[i][1].setAttribute('end',ak_tmp_object[0][1].getAttribute('end'))
else {try{ak_tmp_object[i][1].removeAttribute('end')}catch(error){}}
ak_tmp_in=printNode(ak_tmp_object[i][1])
ak_tmp_object[i][1].parentNode.insertBefore(parseXML(ak_tmp_in,document).firstChild,ak_tmp_object[i][1])
ak_tmp_object[i][1].parentNode.removeChild(ak_tmp_object[i][1]) // trick to new end
}
}
else if(action=='setTiming')
{
ak_edit_animate(action,ak_which_nodeNr(ak_tmp_object[0][0]),ak_which_nodeNr(ak_tmp_object[0][1]),what,what_2)
for(var i=1;i<ak_tmp_array.length;i++)
{
if(ak_tmp_object[0][1].getAttribute(what)) ak_tmp_object[i][1].setAttribute(what,ak_tmp_object[0][1].getAttribute(what))
else {try{ak_tmp_object[i][1].removeAttribute(what)}catch(error){}}
ak_tmp_in=printNode(ak_tmp_object[i][1])
ak_tmp_object[i][1].parentNode.insertBefore(parseXML(ak_tmp_in,document).firstChild,ak_tmp_object[i][1])
ak_tmp_object[i][1].parentNode.removeChild(ak_tmp_object[i][1]) // trick to new end
}
}
ak_multiLocked=false
ak_multiName=ak_tmp_multiName
ak_check4animates()
}
else
{
if(action=='delValue' || action=='set2Value' || action=='add2Values' || action=='insertBeforeValue') ak_add2undo()
if(action=='delValue')
{
if(what_2==ak_valueNr) ak_tmp=-1
else ak_tmp=ak_valueNr-1
}
else if(action=='sortValuesReverse') ak_tmp=ak_valueNr
var ak_tmp_object=new Array
for(var i=0;i<ak_tmp_array.length;i++)
{
ak_tmp_object[i]=new Array(ak_getObject(ak_tmp_array[i][0]),ak_getObject(ak_tmp_array[i][1]))
}
for(var i=0;i<ak_tmp_array.length;i++)
{
if(ak_getObject(ak_tmp_object[i][0]).tagName=="stop")
{
ak_aniArray=new Array("offset")
ak_aniStyleArray=new Array("stop-color","stop-opacity")
ak_aniTransformArray=false
}
else ak_set_rmAdd_animate(ak_tmp_object[i][0])
if(action=='sortValuesReverse') ak_valueNr=ak_tmp
ak_edit_animate(action,ak_which_nodeNr(ak_tmp_object[i][0]),ak_which_nodeNr(ak_tmp_object[i][1]),ak_tmp_array[i][2],what_2)
}
ak_multiLocked=false
ak_multiName=ak_tmp_multiName
ak_undo('refresh')
if(action=='delValue') ak_valueNr=ak_tmp
//ak_click(evt,ak_object2update)
ak_check4animates()
}
}
//########################################
function ak_delArrayDelete(action,for_object,for_animate,what)
{
var ak_tmp_in, ak_tmp_newNode, ak_tmp_out, ak_tmp_swap, ak_tmp
var ak_tmp_animate
var ak_tmp_standard=false
ak_add2undo()
for(var idel=0;idel<ak_delArray.length;idel++)
{
if(idel==what || (ak_delArray[what][1] && ak_delArray[what][1]==ak_delArray[idel][1]))
{
ak_tmp_animate=ak_delArray[idel][0]
if(ak_tmp_animate.tagName=="animateTransform")
{
if(/^ak_multi_/.test(ak_tmp_animate.getId()))
{
var ak_tmp_id=ak_tmp_animate.getId()
var ak_tmp_object2=ak_get_multiAttribute(ak_tmp_animate.parentNode,ak_tmp_id)
if(ak_tmp_object2)
{
ak_tmp=ak_tmp_object2.getAttribute('ak_multi')
ak_tmp=ak_tmp.split(';')
for(var i=0;i<ak_tmp.length;i++)
{
if(ak_tmp_id==ak_tmp[i])
{
ak_tmp.splice(i,1)
i--
}
}
ak_tmp=ak_tmp.join(';')
if(ak_tmp) ak_tmp_object2.setAttribute('ak_multi',ak_tmp)
else {try{ak_tmp_object2.removeAttribute('ak_multi')}catch(error){}}
if(ak_tmp_animate.parentNode.tagName!='g') {ak_tmp_standard=true}
if(ak_tmp_animate.parentNode.cloneNode(0).hasAttributes()) {ak_tmp_standard=true}
if(!ak_tmp_standard)
{
ak_tmp=ak_tmp_animate.parentNode.childNodes
for(var i=0;i<ak_tmp.length;i++)
{
if(/^\[object SVG/.test(ak_tmp.item(i)) && ak_which_nodeNr(ak_tmp.item(i))!=ak_which_nodeNr(ak_tmp_animate) && ak_which_nodeNr(ak_tmp.item(i))!=ak_which_nodeNr(ak_tmp_object2)) ak_tmp_standard=true
}
if(!ak_tmp_standard)
{
ak_remove_parentNode(ak_tmp_animate)
var ak_tmp_prev=ak_tmp_animate.previousSibling()
if(ak_tmp_prev=="[object Text]") ak_tmp_animate.parentNode.removeChild(ak_tmp_prev)
ak_tmp_animate.parentNode.removeChild(ak_tmp_animate)
}
}
}else {ak_tmp_standard=true}
}else {ak_tmp_standard=true}
}else {ak_tmp_standard=true}
if(ak_tmp_standard)
{
var ak_tmp_prev=ak_tmp_animate.previousSibling()
if(ak_tmp_prev=="[object Text]") ak_tmp_animate.parentNode.removeChild(ak_tmp_prev)
ak_tmp_animate.parentNode.removeChild(ak_tmp_animate)
}
}
}
ak_value2update=false
ak_valueNr=-1
ak_tagName_cout='Animation deleted!'
ak_cout(ak_tagName_cout)
ak_check4animates()
}
//########################################
function ak_edit_animateAllChilds(action,for_object,for_animate,what,what_2,what_3)
{
var ak_tmpArray=new Array, ak_tmp
var ak_tmp_multiName=ak_multiName
for(var i=0;i<ak_freezeArray.length;i++)
{
if(/^ak_multi_/.test(ak_freezeArray[i].getId()))
{
ak_tmp=ak_freezeArray[i].getId().split("_")
ak_multiName=ak_tmp[2]
ak_tmp=false
for(var ib=0;ib<ak_tmpArray.length;ib++)
{
if(ak_tmpArray[ib]==ak_multiName) ak_tmp=true
}
if(!ak_tmp)
{
ak_tmpArray.push(ak_multiName)
ak_edit_animateMulti(action,ak_which_nodeNr(ak_freezeArray[i].parentNode),ak_which_nodeNr(ak_freezeArray[i]),what,what_2,what_3)
}
}
else
{
ak_multiName=""
ak_edit_animate(action,ak_which_nodeNr(ak_freezeArray[i].parentNode),ak_which_nodeNr(ak_freezeArray[i]),what,what_2,what_3)
}
}
ak_multiName=ak_tmp_multiName
}
//########################################
function ak_edit_animate(action,for_object,for_animate,what,what_2,what_3)
{
//if(ak_multiName) {ak_edit_animateMulti(action,for_object,for_animate,what,what_2,what_3);return}
//if(ak_getObject(ak_animate2update).getId().search("ak_multi_"+ak_multiName+"_")==0)
try{
if(ak_getObject(for_animate).getId() && ak_getObject(for_animate).getId().search("ak_multi_"+ak_multiName+"_")==0)
{ak_edit_animateMulti(action,for_object,for_animate,what,what_2,what_3);return}
}catch(err){}
var ak_tmp_break=false
var ak_tmp_in, ak_tmp_newNode, ak_tmp_out, ak_tmp_swap, ak_tmp
var ak_tmp_object=ak_getObject(for_object)
var ak_tmp_animate=ak_getObject(for_animate)
try{ak_tagName_cout=ak_getAttributeCout("<"+ak_tmp_animate.tagName,ak_tmp_animate,'attributeName','type')
ak_cout(ak_tagName_cout)}catch(error){}
switch(action)
{
case "addFrom":
ak_tmp_in=ak_tmp_animate.getAttribute("from")
ak_tmp_out=ak_tmp_animate.getAttribute("values")
if(!ak_tmp_out) ak_tmp_out=ak_tmp_in
else ak_tmp_out+="; "+ak_tmp_in
ak_tmp_animate.setAttribute("values",ak_tmp_out)
ak_check_keyValues(action,for_object,for_animate,what,what_2)
ak_valueNr=-1
break
case "addTo":
ak_tmp_in=ak_tmp_animate.getAttribute("to")
ak_tmp_out=ak_tmp_animate.getAttribute("values")
if(!ak_tmp_out) ak_tmp_out=ak_tmp_in
else ak_tmp_out+="; "+ak_tmp_in
ak_tmp_animate.setAttribute("values",ak_tmp_out)
ak_check_keyValues(action,for_object,for_animate,what,what_2)
ak_valueNr=-1
break
case "deleteFromByTo":
try{ak_tmp_animate.removeAttribute("from")}catch(error){}
try{ak_tmp_animate.removeAttribute("by")}catch(error){}
try{ak_tmp_animate.removeAttribute("to")}catch(error){}
ak_check_keyValues(action,for_object,for_animate,what,what_2)
ak_valueNr=-1
break
case "addRemoveFromByTo":
ak_tmp_in=ak_tmp_animate.getAttribute("from")
ak_tmp_out=ak_tmp_animate.getAttribute("values")
if(!ak_tmp_out) ak_tmp_out=ak_tmp_in
else ak_tmp_out+="; "+ak_tmp_in
ak_tmp_animate.setAttribute("values",ak_tmp_out)
ak_tmp_in=ak_tmp_animate.getAttribute("to")
ak_tmp_out=ak_tmp_animate.getAttribute("values")
if(!ak_tmp_out) ak_tmp_out=ak_tmp_in
else ak_tmp_out+="; "+ak_tmp_in
ak_tmp_animate.setAttribute("values",ak_tmp_out)
try{ak_tmp_animate.removeAttribute("from")}catch(error){}
try{ak_tmp_animate.removeAttribute("by")}catch(error){}
try{ak_tmp_animate.removeAttribute("to")}catch(error){}
ak_check_keyValues(action,for_object,for_animate,what,what_2)
ak_valueNr=-1
break
case "insertBeforeValue":
if(!ak_multiLocked) ak_add2undo()
if(ak_tmp_animate.tagName=="animateTransform")
{
if(ak_tmp_animate.getId())
{
var ak_tmp_object2=ak_get_multiAttribute(ak_tmp_animate.parentNode,ak_tmp_animate.getId())
if(ak_tmp_object2) ak_tmp_in=ak_SetGetRm_transformValue(ak_tmp_object2,what,"get","getValue")
else ak_tmp_in=ak_SetGetRm_transformValue(ak_tmp_object,what,"get","getValue")
}
else ak_tmp_in=ak_SetGetRm_transformValue(ak_tmp_object,what,"get","getValue")
}
else
{
ak_tmp_in=ak_getAttribute(ak_tmp_object,what)
if(ak_tmp_in=="false") ak_tmp_in=''
}
if(ak_tmp_in=="") ak_tmp_in=" "
ak_tmp_out=ak_tmp_animate.getAttribute("values")
if(!/;/.test(ak_tmp_out)) ak_tmp_out=ak_tmp_in+";"+ak_tmp_out
else
{
ak_tmp_out=ak_tmp_out.split(";")
ak_tmp_out.splice((what_2),0,ak_tmp_in)
ak_tmp_out=ak_tmp_out.join(";")
}
ak_tmp_animate.setAttribute("values",ak_tmp_out)
ak_check_keyValues(action,for_object,for_animate,what,what_2)
ak_value2update=ak_animate2update; ak_valueNr=what_2
if(!ak_multiLocked) ak_undo('refresh')
break
case "add2Values":
if(!ak_multiLocked) ak_add2undo()
if(ak_tmp_animate.tagName=="animateTransform")
{
if(ak_tmp_animate.getId())
{
var ak_tmp_object2=ak_get_multiAttribute(ak_tmp_animate.parentNode,ak_tmp_animate.getId())
if(ak_tmp_object2) ak_tmp_in=ak_SetGetRm_transformValue(ak_tmp_object2,what,"get","getValue")
else ak_tmp_in=ak_SetGetRm_transformValue(ak_tmp_object,what,"get","getValue")
}
else ak_tmp_in=ak_SetGetRm_transformValue(ak_tmp_object,what,"get","getValue")
}
else
{
ak_tmp_in=ak_getAttribute(ak_tmp_object,what)
if(ak_tmp_in=="false") ak_tmp_in=''
}
if(ak_tmp_in=='') ak_tmp_in=' '
ak_tmp_out=ak_tmp_animate.getAttribute("values")
if(!ak_tmp_out) ak_tmp_out=ak_tmp_in
else ak_tmp_out+="; "+ak_tmp_in
ak_tmp_animate.setAttribute("values",ak_tmp_out)
ak_check_keyValues(action,for_object,for_animate,what,what_2)
ak_value2update=ak_animate2update
if(!/;/.test(ak_tmp_out)) ak_valueNr=0
else ak_valueNr=ak_tmp_out.split(";").length-1
if(!ak_multiLocked) ak_undo('refresh')
break
case "set2Value":
if(!ak_multiLocked) ak_add2undo()
if(ak_tmp_animate.tagName=="animateTransform")
{
if(ak_tmp_animate.getId())
{
var ak_tmp_object2=ak_get_multiAttribute(ak_tmp_animate.parentNode,ak_tmp_animate.getId())
if(ak_tmp_object2) ak_tmp_in=ak_SetGetRm_transformValue(ak_tmp_object2,what,"get","getValue")
else ak_tmp_in=ak_SetGetRm_transformValue(ak_tmp_object,what,"get","getValue")
}
else ak_tmp_in=ak_SetGetRm_transformValue(ak_tmp_object,what,"get","getValue")
}
else
{
ak_tmp_in=ak_getAttribute(ak_tmp_object,what)
}
if(ak_tmp_in=="") ak_tmp_in=" "
ak_tmp_out=ak_tmp_animate.getAttribute("values")
if(!/;/.test(ak_tmp_out)) ak_tmp_out=ak_tmp_in
else
{
ak_tmp_out=ak_tmp_out.split(";")
ak_tmp_out[what_2]=ak_tmp_in
ak_tmp_out=ak_tmp_out.join(";")
}
ak_tmp_animate.setAttribute("values",ak_tmp_out)
ak_value2update=ak_animate2update; ak_valueNr=what_2
if(!ak_multiLocked) ak_undo('refresh')
break
case "set2Attribute":
ak_tmp_out=ak_tmp_animate.getAttribute("values")
ak_tmp_out=ak_tmp_out.split(";")
ak_tmp_swap=ak_tmp_out[what_2].replace(/^ +| +$/g,"")
ak_tmp_animate.setAttribute("fill","remove")
if(ak_tmp_animate.tagName=="animateTransform")
{
if(/^ak_multi_/.test(ak_tmp_animate.getId()))
{
var ak_tmp_id=ak_tmp_animate.getId()
var ak_tmp_object2=ak_get_multiAttribute(ak_tmp_animate.parentNode,ak_tmp_id)
if(ak_tmp_object2)
{
ak_tmp_id=ak_tmp_id.replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$2")
ak_tmp=ak_tmp_object2.getAttribute('ak_multi')
ak_tmp=ak_tmp.split(';')
for(var i=0;i<ak_tmp.length;i++)
{
if(!/^ak_multi_/.test(ak_tmp[i]) || ak_tmp[i].replace(/^(ak_multi_)([^_]*)(_*)([^_]*)/,"$2")!=ak_tmp_id)
{
ak_tmp.splice(i,1)
i--
}
}
var ak_tmp_out2=''
for(var i=0;i<ak_tmp.length;i++)
{
ak_tmp_animate=document.getElementById(ak_tmp[i])
if(ak_tmp_animate)
{
what=ak_tmp_animate.getAttribute("type")
ak_tmp_out=ak_tmp_animate.getAttribute("values")
ak_tmp_out=ak_tmp_out.split(";")
ak_tmp_swap=ak_tmp_out[what_2].replace(/^ +| +$/g,"")
ak_tmp_animate.setAttribute("fill","remove")
ak_tmp_out2+=what+'('+ak_tmp_swap+')'
if(i<ak_tmp.length-1) ak_tmp_out2+=ak_transform_split
}
}
ak_tmp_object2.setAttribute('transform',ak_tmp_out2)
ak_tmp_break="set"
}
else
{
ak_tmp_object.setAttribute('transform',what+'('+ak_tmp_swap+')')
ak_tmp_break="set"
}
}
else
{
ak_tmp_object.setAttribute('transform',what+'('+ak_tmp_swap+')')
ak_tmp_break="set"
}
}
else
{
ak_tmp_break="set"
//ak_setAttribute(ak_tmp_object,what,ak_tmp_swap)
ak_setAttribute(ak_tmp_animate.parentNode,what,ak_tmp_swap)
}
ak_value2update=ak_animate2update; ak_valueNr=what_2
break
case "sortValuesReverse":
ak_tmp_out=ak_tmp_animate.getAttribute("values")
ak_tmp_out=ak_tmp_out.split(";")
if(ak_valueNr>=0) ak_valueNr=ak_tmp_out.length-1-ak_valueNr
ak_tmp_out=ak_tmp_out.reverse()
ak_tmp_animate.setAttribute("values",ak_tmp_out.join(";"))
break
case "delValue":
if(!ak_multiLocked) ak_add2undo()
ak_tmp_out=ak_tmp_animate.getAttribute("values")
ak_tmp_out=ak_tmp_out.split(";")
ak_tmp_out.splice(what_2,1)
ak_tmp_animate.setAttribute("values",ak_tmp_out.join(";"))
ak_check_keyValues(action,for_object,for_animate,what,what_2)
ak_value2update=ak_animate2update
if(ak_valueNr==what_2) ak_valueNr=-1
else if(ak_valueNr>what_2) ak_valueNr--
if(!ak_multiLocked) ak_undo('refresh')
break
case "delAnimation":
var ak_tmp_standard=false
if(ak_tmp_animate.tagName=="animateTransform")
{
if(/^ak_multi_/.test(ak_tmp_animate.getId()))
{
var ak_tmp_id=ak_tmp_animate.getId()
var ak_tmp_object2=ak_get_multiAttribute(ak_tmp_animate.parentNode,ak_tmp_id)
if(ak_tmp_object2)
{
ak_tmp=ak_tmp_object2.getAttribute('ak_multi')
ak_tmp=ak_tmp.split(';')
for(var i=0;i<ak_tmp.length;i++)
{
if(ak_tmp_id==ak_tmp[i])
{
ak_tmp.splice(i,1)
i--
}
}
ak_tmp=ak_tmp.join(';')
if(ak_tmp) ak_tmp_object2.setAttribute('ak_multi',ak_tmp)
else {try{ak_tmp_object2.removeAttribute('ak_multi')}catch(error){}}
if(ak_tmp_animate.parentNode.tagName!='g') {ak_tmp_standard=true}
if(ak_tmp_animate.parentNode.cloneNode(0).hasAttributes()) {ak_tmp_standard=true}
if(!ak_tmp_standard)
{
ak_tmp=ak_tmp_animate.parentNode.childNodes
for(var i=0;i<ak_tmp.length;i++)
{
if(/^\[object SVG/.test(ak_tmp.item(i)) && ak_which_nodeNr(ak_tmp.item(i))!=ak_which_nodeNr(ak_tmp_animate) && ak_which_nodeNr(ak_tmp.item(i))!=ak_which_nodeNr(ak_tmp_object2)) ak_tmp_standard=true
}
if(!ak_tmp_standard)
{
ak_remove_parentNode(ak_tmp_animate)
var ak_tmp_prev=ak_tmp_animate.previousSibling()
if(ak_tmp_prev=="[object Text]") ak_tmp_animate.parentNode.removeChild(ak_tmp_prev)
ak_tmp_animate.parentNode.removeChild(ak_tmp_animate)
}
}
}else {ak_tmp_standard=true}
}else {ak_tmp_standard=true}
}else {ak_tmp_standard=true}
if(ak_tmp_standard)
{
var ak_tmp_prev=ak_tmp_animate.previousSibling()
if(ak_tmp_prev=="[object Text]") ak_tmp_animate.parentNode.removeChild(ak_tmp_prev)
ak_tmp_animate.parentNode.removeChild(ak_tmp_animate)
}
ak_value2update=false
ak_valueNr=-1
ak_tagName_cout='Animation deleted!'
ak_cout(ak_tagName_cout)
break
case "startAnimation":
ak_tmp_in=ak_tmp_animate.getAttribute("begin")
ak_tmp_animate.setAttribute("begin","indefinite")
ak_tmp_animate.beginElement()
ak_tmp_animate.setAttribute("begin",ak_tmp_in)
break
case "setFill":
ak_tmp_animate.setAttribute("fill",what)
ak_tagName_cout='fill="'+what+'"'
//ak_tmp_break="no_set"
break
case "setFillStart":
ak_tmp_animate.setAttribute("fill",what)
ak_tmp_in=ak_tmp_animate.getAttribute("begin")
ak_tmp_animate.setAttribute("begin","indefinite")
ak_tmp_animate.beginElement()
ak_tmp_animate.setAttribute("begin",ak_tmp_in)
ak_tagName_cout='fill="'+what+'"  |  Start selected Animation!'
ak_cout(ak_tagName_cout)
break
case "addAniTransform":
ak_tmp_in=ak_SetGetRm_transformValue(ak_tmp_object,what,"get","getValue")
ak_tmp_object.setAttribute('transform',what+'('+ak_tmp_in+')')
ak_tmp_newNode='<animateTransform attributeName="transform" type="'+what
ak_tmp_newNode+='" begin="0" dur="2" values="'+ak_tmp_in+'"/>'
var ak_tmp=ak_appendChildSP(ak_tmp_newNode,ak_tmp_object)
ak_animate2update=ak_which_nodeNr(ak_tmp)
ak_value2update=ak_animate2update; ak_valueNr=0
ak_tmp_break="set"
break
case "addAniStyle":
ak_tmp_in=ak_SetGetRm_styleValue(ak_tmp_object,what,"get","no_cout")
if(ak_tmp_in=="false")
{
ak_tmp_in=ak_SetGetRm_styleValue(ak_tmp_object,what,"get","setValue")
if(what=='stroke')
{
ak_setAttribute(ak_tmp_object,"stroke",ak_getAttribute(ak_colToolBox,"fill"))
if(ak_getAttribute(ak_tmp_object,"stroke-width")=="false") ak_setAttribute(ak_tmp_object,"stroke-width",1)
ak_set4Style(evt,"stroke")
ak_init_slider("stroke-width")
}
else if(what=='flood-opacity')
{
ak_init_slider('flood-opacity')
ak_tmp_break="set"
}
else if(what=='stop-opacity') ak_init_slider(evt,ak_stop_slider_nr)
else if(what=='flood-color') ak_set_hex2hue(evt,'#000000',"set_stop_hex")
else if(what=='lighting-color') ak_set_hex2hue(evt,'#ffffff',"set_stop_hex")
else ak_tmp_break="set"
ak_init_buttonV3()
}
ak_tmp_newNode='<animate attributeName="'+what
ak_tmp_newNode+='" begin="0" dur="2" values="'+ak_tmp_in+'"/>'
var ak_tmp=ak_appendChildSP(ak_tmp_newNode,ak_tmp_object)
ak_animate2update=ak_which_nodeNr(ak_tmp)
ak_value2update=ak_animate2update; ak_valueNr=0
if(ak_tmp_object.tagName=="stop" && for_object!=ak_which_nodeNr(ak_gradient2edit.childNodes.item(ak_gradient_stop_index)))
{
ak_gradient_stop_index=for_object.split(",")
ak_gradient_stop_index=parseInt(ak_gradient_stop_index[ak_gradient_stop_index.length-1])
ak_lastGradientIndex=ak_gradient_stop_index
ak_tmp_break="no_set"
}
break
case "addAniAttribute":
ak_tmp_in=ak_tmp_object.getAttribute(arguments[3])
if(!ak_tmp_in) ak_tmp_in=' '
ak_tmp_newNode='<animate attributeName="'+arguments[3]
ak_tmp_newNode+='" begin="0" dur="2" values="'+ak_tmp_in+'"/>'
var ak_tmp=ak_appendChildSP(ak_tmp_newNode,ak_tmp_object)
ak_animate2update=ak_which_nodeNr(ak_tmp)
ak_value2update=ak_animate2update; ak_valueNr=0
if(ak_tmp_object.tagName=="stop" && for_object!=ak_which_nodeNr(ak_gradient2edit.childNodes.item(ak_gradient_stop_index)))
{
ak_gradient_stop_index=for_object.split(",")
ak_gradient_stop_index=parseInt(ak_gradient_stop_index[ak_gradient_stop_index.length-1])
ak_lastGradientIndex=ak_gradient_stop_index
ak_tmp_break="set"
}
break
case "addAniMotion":
ak_tmp_newNode='<animateMotion  begin="0" dur="2"/>'
var ak_tmp=ak_appendChildSP(ak_tmp_newNode,ak_tmp_object)
ak_tmp_out=ak_which_nodeNr(ak_tmp)
ak_animate2update=ak_tmp_out
ak_edit_animate("addPath",for_object,ak_tmp_out)
break
case "rmAniAttribute":
try{ak_tmp_animate.removeAttribute(what)}catch(error){}
ak_tagName_cout=what+' removed!'
if(what=='repeatCount')
{
try{ak_tmp_animate.removeAttribute('repeatDur')}catch(error){}
ak_tagName_cout+=' repeatDur removed!'
}
if(ak_tmp_animate.getAttribute("calcMode")=="spline" && what=='keySplines')
{
ak_tmp_animate.setAttribute("calcMode","linear")
ak_tagName_cout+=' calcMode="linear"'
}
if(what=="keyTimes")
{
try{ak_tmp_animate.removeAttribute('keySplines')}catch(error){}
if(ak_tmp_animate.getAttribute("calcMode")=="spline") ak_tmp_animate.setAttribute("calcMode","linear")
ak_keysEditor=false
}
ak_cout(ak_tagName_cout)
break
case "selectAnimation":
ak_animate2update=for_animate
for_object=ak_which_nodeNr(ak_tmp_animate.parentNode)
if(ak_tmp_animate.parentNode.tagName=="stop" && for_object!=ak_which_nodeNr(ak_gradient2edit.childNodes.item(ak_gradient_stop_index)))
{
ak_gradient_stop_index=for_object.split(",")
ak_gradient_stop_index=parseInt(ak_gradient_stop_index[ak_gradient_stop_index.length-1])
var ak_tmp_ox=(ak_stop_offset[ak_gradient_stop_index]*ak_gradient_vector.x)+ak_gradient_vector_start.x
var ak_tmp_oy=(ak_stop_offset[ak_gradient_stop_index]*ak_gradient_vector.y)+ak_gradient_vector_start.y
var ak_tmp_set=document.getElementById('ak_gradient_line2')
ak_tmp_set.setAttribute("x1",(ak_tmp_ox+ak_gradient_vector_90.x))
ak_tmp_set.setAttribute("y1",(ak_tmp_oy+ak_gradient_vector_90.y))
ak_tmp_set.setAttribute("x2",(ak_tmp_ox-ak_gradient_vector_90.x))
ak_tmp_set.setAttribute("y2",(ak_tmp_oy-ak_gradient_vector_90.y))
ak_stop_color[ak_gradient_stop_index]=ak_SetGetRm_styleValue(ak_gradient_stop[ak_gradient_stop_index],"stop-color","get","no_cout")
ak_set_hex2hue(evt,ak_stop_color[ak_gradient_stop_index],"set_stop_hex")
ak_init_slider(evt,ak_stop_slider_nr)
}
if(/^ak_multi_/.test(ak_tmp_animate.getId()))
{
ak_multiName=ak_tmp_animate.getId().split("_")[2]
}
else ak_multiName=""
break
case "setAniAttr":
ak_tmp_animate.setAttribute(what,what_2)
if(what=="repeatCount" && what_2=="indefinite")
{
ak_tmp_in=ak_tmp_animate.getAttribute("begin")
ak_tmp_animate.setAttribute("begin","indefinite")
ak_tmp_animate.beginElement()
ak_tmp_animate.setAttribute("begin",ak_tmp_in)
try{ak_tmp_animate.removeAttribute('repeatDur')}catch(error){}
}
if(what=="dur")
{
ak_tmp_in=printNode(ak_tmp_animate)
ak_tmp_animate.parentNode.insertBefore(parseXML(ak_tmp_in,document).firstChild,ak_tmp_animate)
ak_tmp_animate.parentNode.removeChild(ak_tmp_animate) // trick to new end
}
ak_tagName_cout=what+'="'+what_2+'"'
ak_cout(ak_tagName_cout)
break
case "setBeginDurEnd":
ak_tmp_in=ak_tmp_animate.getAttribute("begin")
var ak_tmp_in2=ak_tmp_animate.getAttribute("dur")
var ak_tmp_in3=ak_tmp_animate.getAttribute("end")
if(ak_tmp_in3 && !ak_tmp_in2) ak_tmp_in+=" dur"
else if(ak_tmp_in2) ak_tmp_in+=" "+ak_tmp_in2
if(ak_tmp_in3) ak_tmp_in+=" "+ak_tmp_in3
ak_tmp_out=prompt("Enter begin dur end (missing parameter will be removed)!\n2.4=2.4s, 340ms, 2min, 1h, 1:20:23.3=h:min:sec, 2:23=min:sec",ak_tmp_in)
if(ak_tmp_out==null) return
ak_tmp_out=ak_tmp_out.replace(/^ +| +$/g,"")
ak_tmp_out=ak_tmp_out.replace(/ +/g," ")
ak_tmp_out=ak_tmp_out.split(" ")
ak_tagName_cout='begin'
if(ak_tmp_out[0])
{
ak_tmp_animate.setAttribute("begin",ak_tmp_out[0])
ak_tagName_cout+='="'+ak_tmp_out[0]+'"'
}
else
{
try{ak_tmp_animate.removeAttribute("begin")}catch(error){}
ak_tagName_cout+=' removed!'
}
if(ak_tmp_out[1])
{
ak_tmp_animate.setAttribute("dur",ak_tmp_out[1])
ak_tagName_cout+=' dur="'+ak_tmp_out[1]+'"'
}
else
{
try{ak_tmp_animate.removeAttribute("dur")}catch(error){}
ak_tagName_cout+=' dur removed!'
}
if(ak_tmp_out[2])
{
ak_tmp_animate.setAttribute("end",ak_tmp_out[2])
ak_tagName_cout+=' end="'+ak_tmp_out[2]+'"'
}
else
{
try{ak_tmp_animate.removeAttribute("end")}catch(error){}
ak_tagName_cout+=' end removed!'
}
ak_tmp_in=printNode(ak_tmp_animate)
ak_tmp_animate.parentNode.insertBefore(parseXML(ak_tmp_in,document).firstChild,ak_tmp_animate)
ak_tmp_animate.parentNode.removeChild(ak_tmp_animate) // trick to new end
ak_cout(ak_tagName_cout)
break
case "setTiming":
ak_tmp_in=ak_tmp_animate.getAttribute(what)
if(what!="begin") ak_tmp_out=prompt("Enter "+what+" (missing parameter will be removed)!\n2.4=2.4s, 340ms, 2min, 1h, 1:20:23.3=h:min:sec, 2:23=min:sec",ak_tmp_in)
else ak_tmp_out=prompt("Enter "+what+"!\n2.4=2.4s, 340ms, 2min, 1h, 1:20:23.3=h:min:sec, 2:23=min:sec",ak_tmp_in)
if(ak_tmp_out==null) return
ak_tmp_out=ak_tmp_out.replace(/^ +| +$/g,"")
if(ak_tmp_out)
{
ak_tmp_animate.setAttribute(what,ak_tmp_out)
ak_tagName_cout=what+'="'+ak_tmp_out+'"'
ak_cout(ak_tagName_cout)
}
else if(what!="begin") ak_edit_animate("rmAniAttribute",for_object,for_animate,what)
ak_tmp_in=printNode(ak_tmp_animate)
ak_tmp_animate.parentNode.insertBefore(parseXML(ak_tmp_in,document).firstChild,ak_tmp_animate)
ak_tmp_animate.parentNode.removeChild(ak_tmp_animate) // trick to new end
break
case "setRepeat":
ak_tmp_in=ak_tmp_animate.getAttribute("repeatCount")
var ak_tmp_in2=ak_tmp_animate.getAttribute("repeatDur")
if(ak_tmp_in2) ak_tmp_in+=" "+ak_tmp_in2
ak_tmp_out=prompt("Enter repeatCount repeatDur (missing parameter will be removed)!\n2.4=2.4s, 340ms, 2min, 1h, 1:20:23.3=h:min:sec, 2:23=min:sec",ak_tmp_in)
if(ak_tmp_out==null) return
ak_tmp_out=ak_tmp_out.replace(/^ +| +$/g,"")
ak_tmp_out=ak_tmp_out.replace(/ +/g," ")
ak_tmp_out=ak_tmp_out.split(" ")
ak_tagName_cout='repeatCount'
if(ak_tmp_out[0])
{
ak_tmp_animate.setAttribute("repeatCount",ak_tmp_out[0])
ak_tagName_cout+='="'+ak_tmp_out[0]+'"'
if(!ak_tmp_out[1]) ak_tagName_cout+=','
if(ak_tmp_out[0]=='indefinite')
{
ak_tmp_in=ak_tmp_animate.getAttribute("begin")
ak_tmp_animate.setAttribute("begin","indefinite")
ak_tmp_animate.beginElement()
ak_tmp_animate.setAttribute("begin",ak_tmp_in)
}
}
else
{
try{ak_tmp_animate.removeAttribute("repeatCount")}catch(error){}
ak_tagName_cout+=' removed!'
}
if(ak_tmp_out[1])
{
ak_tmp_animate.setAttribute("repeatDur",ak_tmp_out[1])
ak_tagName_cout+=' repeatDur="'+ak_tmp_out[1]+'"'
}
else
{
try{ak_tmp_animate.removeAttribute("repeatDur")}catch(error){}
ak_tagName_cout+=' repeatDur removed!'
}
//ak_tmp_animate.parentNode.replaceChild(parseXML(printNode(ak_tmp_animate),document).firstChild,ak_tmp_animate) // refresh-trick
ak_cout(ak_tagName_cout)
break
case "editKeyPoints":
ak_tmp_in=ak_tmp_animate.getAttribute("keyPoints")
ak_tmp_out=prompt("Enter keyPoints (missing parameter will be removed)!",ak_tmp_in)
if(ak_tmp_out==null) return
ak_tmp_out=ak_tmp_out.replace(/^ +| +$/g,"")
if(ak_tmp_out)
{
ak_tmp_animate.setAttribute("keyPoints",ak_tmp_out)
ak_tagName_cout='keyPoints="'+ak_tmp_out+'"'
ak_cout(ak_tagName_cout)
}
else
{
try{ak_tmp_animate.removeAttribute("keyPoints")}catch(error){}
ak_tagName_cout='keyPoints removed!'
ak_cout(ak_tagName_cout)
}
break
case "setRotate":
ak_tmp_in=ak_tmp_animate.getAttribute("rotate")
ak_tmp_out=prompt("Enter rotate (missing parameter will be removed = 0 degree)!\n0 - 360, auto, auto-reverse",ak_tmp_in)
if(ak_tmp_out==null) return
ak_tmp_out=ak_tmp_out.replace(/^ +| +$/g,"")
if(ak_tmp_out)
{
ak_tmp_animate.setAttribute("rotate",ak_tmp_out)
ak_tagName_cout='rotate="'+ak_tmp_out+'"'
ak_cout(ak_tagName_cout)
}
else {ak_edit_animate("rmAniAttribute",for_object,for_animate,"rotate")}
break
case "selectPath":
ak_clickset_obj2update(evt,document.getElementById(what))
return
case "setMpath":
ak_tmp_in=false
for(var i=0;i<ak_tmp_animate.childNodes.length;i++)
{
if(ak_tmp_animate.childNodes.item(i).tagName=="mpath")
{
ak_tmp_in=ak_tmp_animate.childNodes.item(i)
break
}
}
if(ak_tmp_in) ak_tmp_in.setAttribute("xlink:href","#"+what)
else
{
ak_tmp_out='<mpath xlink:href="#'+what+'"/>'
ak_appendChildSP(ak_tmp_out,ak_tmp_animate)
}
ak_check_keyValues(action,for_object,for_animate,what,what_2)
break
case "convertPath":
case "addPath":
var ak_tmp_id=ak_promptForId("Enter <path Id!",ak_generate_id(evt,"path_")); if(!ak_tmp_id) return
try{
var ak_tmp_x=ak_tmp_object.getBBox.x
var ak_tmp_y=ak_tmp_object.getBBox.y
var ak_tmp_width=ak_tmp_object.getBBox.width
var ak_tmp_height=ak_tmp_object.getBBox.height
}
catch(error){
var ak_tmp_x=0
var ak_tmp_y=0
var ak_tmp_width=100
var ak_tmp_height=100
}
ak_tmp_out='<path id="'+ak_tmp_id+'" d="'
if(action=="addPath")
{
ak_tmp_out+="M 0 0 C "+ak_round((ak_tmp_width*0.75),100)+" "
ak_tmp_out+=ak_round((ak_tmp_height*0),100)+" "
ak_tmp_out+=ak_round((ak_tmp_width*0.75),100)+" "
ak_tmp_out+=ak_round((ak_tmp_height),100)+" "
ak_tmp_out+=ak_round((ak_tmp_width*1.5),100)+" "
ak_tmp_out+=ak_round((ak_tmp_height),100)
}
else
{
ak_tmp_out+=ak_tmp_animate.getAttribute("path")
try{ak_tmp_animate.removeAttribute("path")}catch(error){}
}
var ak_tmp_rd=1000
var ak_matrix1_tmp_text="matrix("+ak_round(ak_object2update_CTM.a,ak_tmp_rd)+","+ak_round(ak_object2update_CTM.b,ak_tmp_rd)+","+ak_round(ak_object2update_CTM.c,ak_tmp_rd)+","+ak_round(ak_object2update_CTM.d,ak_tmp_rd)+","+ak_round(ak_object2update_CTM.e,ak_tmp_rd)+","+ak_round(ak_object2update_CTM.f,ak_tmp_rd)+")"
ak_tmp_out+='" transform="matrix(1,0,0,1,-21,-21),'+ak_matrix1_tmp_text+',matrix(1,0,0,1,'+ak_round(ak_tmp_x+(ak_tmp_width/2),100)+","+ak_round(ak_tmp_y+(ak_tmp_height/2),100)
ak_tmp_out+=')" style="fill:none;stroke:#000"/>'
var ak_tmp_insert=ak_tmp_object.nextSibling
if(ak_tmp_insert) ak_insertBeforeSP(ak_tmp_out,ak_tmp_insert)
else if(ak_tmp_object.parentNode) ak_appendChildSP(ak_tmp_out,ak_tmp_object.parentNode)
else ak_appendChildSP(ak_tmp_out,ak_userspace_svg)
ak_edit_animate("setMpath",for_object,for_animate,ak_tmp_id)
ak_clickset_obj2update(evt,document.getElementById(ak_tmp_id))
return
default:
}
if(!ak_multiLocked)
{
if(ak_tmp_break=="no_set")
{
ak_object2update.parentNode.insertBefore(parseXML('<g/>',document).firstChild,ak_object2update)
ak_tmp=ak_object2update.previousSibling() // trick to real.getBBox data
ak_object2update.parentNode.insertBefore(ak_object2update,ak_tmp)
ak_object2update.parentNode.removeChild(ak_tmp)
ak_clickset_obj2update(evt,ak_object2update,"no_toolbox")
ak_check4animates()
}
else if(ak_tmp_break=="set")
{
ak_object2update.parentNode.insertBefore(parseXML('<g/>',document).firstChild,ak_object2update)
ak_tmp=ak_object2update.previousSibling() // trick to real.getBBox data
ak_object2update.parentNode.insertBefore(ak_object2update,ak_tmp)
ak_object2update.parentNode.removeChild(ak_tmp)
ak_clickset_obj2update(evt,ak_object2update)
ak_check4animates()
}
else 
{
ak_check4animates()
}
if(what=='keyTimes' || what=='keySplines')
{
if(ak_keysEditor) ak_edit_keyTimesInit("keyEditor",for_object,for_animate)
else ak_edit_animateSpline("closeKeyTimes",for_object,for_animate)
}
}
}
var ak_multiLocked
//########################################
function ak_get_multiAttribute(for_parent,for_id)
{
var ak_tmp_string=';'+for_id+';'
var ak_tmp=for_parent.getAttribute('ak_multi')
if(!ak_tmp) ak_tmp=''
var ak_tmp_compare=';'+ak_tmp+';'
if(ak_tmp_compare.search(ak_tmp_string)!=-1) return for_parent
for(var i=0;i<for_parent.childNodes.length;i++)
{
try{ak_tmp=for_parent.childNodes.item(i).getAttribute('ak_multi')}catch(error){ak_tmp=''}
ak_tmp_compare=';'+ak_tmp+';'
if(ak_tmp_compare.search(ak_tmp_string)!=-1) return for_parent.childNodes.item(i)
if(for_parent.childNodes.item(i).childNodes.length>0)
{
ak_tmp=ak_get_multiAttribute(for_parent.childNodes.item(i),for_id)
if(ak_tmp) return ak_tmp
}
}
return false
}
//########################################
function ak_check_keyValues(action,for_object,for_animate,what,what_2)
{
var ak_tmp_animate=ak_getObject(for_animate)
var ak_tmp_kT=ak_tmp_animate.getAttribute('keyTimes')
var ak_tmp_v=ak_tmp_animate.getAttribute('values')
if(ak_tmp_animate.tagName=="animateMotion")
{
var ak_tmp_mpath=false
for(var i=0;i<ak_tmp_animate.childNodes.length;i++)
{
if(ak_tmp_animate.childNodes.item(i).tagName=="mpath")
{
ak_tmp_mpath=ak_tmp_animate.childNodes.item(i).getAttribute("xlink:href")
ak_tmp_mpath=ak_tmp_mpath.replace(/^ +| +$/g,"")
ak_tmp_mpath=ak_tmp_mpath.replace(/^#/g,"")
break
}
}
if(ak_tmp_mpath)
{
ak_tmp_v=document.getElementById(ak_tmp_mpath).getAttribute("d")
if(!ak_tmp_v) ak_tmp_v=ak_tmp_animate.getAttribute("path")
}
else ak_tmp_v=ak_tmp_animate.getAttribute("path")
if(ak_tmp_v) ak_tmp_v=ak_tmp_v.replace(/[lLhHvVzZcCaAqQsStT]/g,";")
}
if(ak_tmp_v) ak_tmp_v=ak_tmp_v.split(';')
if(!ak_tmp_v || ak_tmp_v.length<2)
{
try{ak_tmp_animate.removeAttribute('keyTimes')}catch(error){}
ak_tagName_cout='keyTimes removed!'
ak_cout(ak_tagName_cout)
try{ak_tmp_animate.removeAttribute('keySplines')}catch(error){}
if(ak_tmp_animate.getAttribute('calcMode')=='spline') ak_tmp_animate.setAttribute('calcMode','linear')
return
}
var ak_tmp_array, ak_tmp
var ak_tmp_res=200
if(ak_tmp_kT)
{
ak_tmp_array=ak_tmp_kT.split(';')
ak_tmp_array[0]=0
for(var i=1;i<ak_tmp_array.length;i++)
{
ak_tmp_array[i]=isNaN(ak_tmp_array[i])?0:parseFloat(ak_tmp_array[i])
if(ak_tmp_array[i]<=ak_tmp_array[i-1]) ak_tmp_array[i]=ak_tmp_array[i-1]+(1/ak_tmp_res)
else if(ak_tmp_array[i]>1) ak_tmp_array[i]=1
}
if(action=='add2Values')
{
ak_tmp=(1*(ak_tmp_array.length-1))/ak_tmp_array.length
if(ak_tmp_array[(ak_tmp_array.length-1)]<=ak_tmp) ak_tmp_array.push(1)
else
{
for(var i=1;i<ak_tmp_array.length;i++){ak_tmp_array[i]*=(ak_tmp/ak_tmp_array[ak_tmp_array.length-1])}
ak_tmp_array.push(1)
}
}
else if(action=='insertBeforeValue' && what_2==0)
{
ak_tmp=1/ak_tmp_array.length
if(ak_tmp_array[(ak_tmp_array.length-1)]>(1-ak_tmp))
{
for(var i=1;i<ak_tmp_array.length;i++){ak_tmp_array[i]*=((1-ak_tmp)/ak_tmp_array[ak_tmp_array.length-1])}
}
for(var i=0;i<ak_tmp_array.length;i++){ak_tmp_array[i]+=ak_tmp}
ak_tmp_array.unshift(0)
}
else if(action=='insertBeforeValue' && what_2<(ak_tmp_array.length-1))
{
ak_tmp_array.splice(what_2,0,(ak_tmp_array[what_2-1]+ak_tmp_array[what_2])/2)
}
else if(action=='delValue' && what_2<ak_tmp_array.length)
{
ak_tmp_array.splice(what_2,1)
}
if(ak_tmp_array.length!=ak_tmp_v.length)
{
ak_tmp_array=new Array
for(var i=0;i<ak_tmp_v.length;i++){ak_tmp_array[i]=ak_round(i/(ak_tmp_v.length-1),ak_tmp_res)}
}
else
{
for(var i=0;i<ak_tmp_array.length;i++){ak_tmp_array[i]=ak_round(ak_tmp_array[i],ak_tmp_res)}
for(var i=1;i<ak_tmp_array.length;i++)
{
if(ak_tmp_array[i]<=ak_tmp_array[i-1]) ak_tmp_array[i]=ak_tmp_array[i-1]+(1/ak_tmp_res)
if(ak_tmp_array[i]>1) ak_tmp_array[i]=1
}
}
ak_tmp_animate.setAttribute('keyTimes',ak_tmp_array.join('; '))
}
var ak_tmp_kS=ak_tmp_animate.getAttribute('keySplines')
if(ak_tmp_kS)
{
ak_tmp_array=ak_tmp_kS.split(';')
if(action=='add2Values') ak_tmp_array.push('0 0 1 1')
else if(action=='insertBeforeValue') ak_tmp_array.splice(what_2,0,'0 0 1 1')
else if(action=='delValue') ak_tmp_array.splice(what_2,1)
if(ak_tmp_array.length!=(ak_tmp_v.length-1))
{
ak_tmp_array=new Array
for(var i=0;i<(ak_tmp_v.length-1);i++){ak_tmp_array[i]='0 0 1 1'}
}
ak_tmp_animate.setAttribute('keySplines',ak_tmp_array.join('; '))
}
else if(ak_tmp_animate.getAttribute('calcMode')=='spline')
{
ak_tmp_array=new Array
for(var i=0;i<(ak_tmp_v.length-1);i++){ak_tmp_array[i]='0 0 1 1'}
ak_tmp_animate.setAttribute('keySplines',ak_tmp_array.join('; '))
}
}
//########################################
var ak_keysEditor
function ak_edit_animateSpline(action,for_object,for_animate,what,what_2)
{
switch(action)
{
case "closeKeyTimes":
try{document.getElementById("ak_animation_bar").removeChild(document.getElementById("ak_g_keyTimes"))}catch(error){}
ak_keysEditor=false
return
case "nextKeySplines":
ak_keySplineEditor++
if(ak_keySplineEditor>(ak_keySplines.length-1)) ak_keySplineEditor=0
ak_edit_keyTimes("keySplinesEditor",for_object,for_animate)
return
case "prevKeySplines":
ak_keySplineEditor--
if(ak_keySplineEditor<0) ak_keySplineEditor=(ak_keySplines.length-1)
ak_edit_keyTimes("keySplinesEditor",for_object,for_animate)
return
case "sizeKeySplines":
if(ak_keySplineScale==1) ak_keySplineScale=0.5
else ak_keySplineScale=1
ak_edit_keyTimes("keySplinesEditor",for_object,for_animate)
return
}
}
//########################################
var ak_keyTimes, ak_keyTimes_node, ak_keySplines, ak_keySplineEditor=0, ak_dur, ak_dur_index
var ak_keySplineX=221, ak_keySplineY=421, ak_keySplineX_in, ak_keySplineY_in, ak_keySplineScale=0.5
var ak_keySplines_in=new Array //, ak_key4Multi='_', ak_key4animate='-1'
function ak_edit_keyTimes(action,for_object,for_animate)
{
ak_edit_keyTimesInit(action,for_object,for_animate)
ak_check4animates()
}
function ak_edit_keyTimesInit(action,for_object,for_animate)
{
try{document.getElementById("ak_animation_bar").removeChild(document.getElementById("ak_g_keyTimes"))}catch(error){}
ak_keysEditor=false
//var ak_tmp_object=ak_getObject(for_object)
var ak_tmp_animate=ak_getObject(for_animate)
var ak_tmp_calcMode=ak_tmp_animate.getAttribute("calcMode")
var ak_tmp_values=ak_tmp_animate.getAttribute("values")
if(ak_tmp_animate.tagName=="animateMotion")
{
var ak_tmp_mpath=false
for(var i=0;i<ak_tmp_animate.childNodes.length;i++)
{
if(ak_tmp_animate.childNodes.item(i).tagName=="mpath")
{
ak_tmp_mpath=ak_tmp_animate.childNodes.item(i).getAttribute("xlink:href")
ak_tmp_mpath=ak_tmp_mpath.replace(/^ +| +$/g,"")
ak_tmp_mpath=ak_tmp_mpath.replace(/^#/g,"")
break
}
}
if(ak_tmp_mpath)
{
ak_tmp_values=document.getElementById(ak_tmp_mpath).getAttribute("d")
if(!ak_tmp_values) ak_tmp_values=ak_tmp_animate.getAttribute("path")
}
else ak_tmp_values=ak_tmp_animate.getAttribute("path")
ak_tmp_values=ak_tmp_values.replace(/[lLhHvVzZcCaAqQsStT]/g,";")
}
ak_tmp_values=ak_tmp_values.split(";")
ak_keyTimes=ak_tmp_animate.getAttribute("keyTimes")
ak_keyTimes=ak_keyTimes.split(";")
ak_keySplines=ak_tmp_animate.getAttribute("keySplines")
ak_keySplines=ak_keySplines.split(";")
if(ak_tmp_values.length<2)
{
if(action=="editKeyTimes" || action=="keyTimesEditor")
{
//var ak_tmp_out=prompt("ATTENTION: values < 2\nEnter keyTimes (missing parameter will be removed)!",ak_keyTimes.join(";"))
ak_alert("ATTENTION: 2 values minimum to use keyTimes!")
return
if(ak_tmp_out==null) return
ak_tmp_out=ak_tmp_out.replace(/^ +| +$/g,"")
if(ak_tmp_out) ak_edit_animate('setAniAttr',for_object,for_animate,'keyTimes',ak_tmp_out)
else ak_edit_animate('rmAniAttribute',for_object,for_animate,'keyTimes')
}
else if(action=="editKeySplines" || action=="keySplinesEditor")
{
//var ak_tmp_out=prompt("ATTENTION: values < 2\nEnter keySplines (missing parameter will be removed)!",ak_keySplines.join(";"))
ak_alert("ATTENTION: 2 values minimum to use keySplines!")
return
if(ak_tmp_out==null) return
ak_tmp_out=ak_tmp_out.replace(/^ +| +$/g,"")
if(ak_tmp_out)
{
ak_edit_animate('setAniAttr',for_object,for_animate,'calcMode','spline')
ak_edit_animate('setAniAttr',for_object,for_animate,'keySplines',ak_tmp_out)
ak_tagName_cout+=' calcMode="spline"'
ak_cout(ak_tagName_cout)
}
else ak_edit_animate('rmAniAttribute',for_object,for_animate,'keySplines')
}
return
}
if(ak_tmp_values.length!=ak_keyTimes.length)
{
ak_keyTimes=new Array
for(var i=0;i<ak_tmp_values.length;i++)
{
ak_keyTimes[i]=ak_round(i/(ak_tmp_values.length-1),200)
}
}
else
{
ak_keyTimes[0]=0
for(var i=1;i<ak_keyTimes.length;i++)
{
ak_keyTimes[i]=parseFloat(ak_keyTimes[i])
if(isNaN(ak_keyTimes[i])) ak_keyTimes[i]=0
ak_round(ak_keyTimes[i],200)
if(ak_keyTimes[i]<=ak_keyTimes[i-1] || ak_keyTimes[i]>1)
{
ak_keyTimes=new Array
for(var i=0;i<ak_tmp_values.length;i++)
{
ak_keyTimes[i]=ak_round(i/(ak_tmp_values.length-1),200)
}
break
}
}
}
if(ak_tmp_values.length>(ak_keySplines.length+1))
{
for(var i=ak_keySplines.length;i<(ak_tmp_values.length-1);i++)
{
ak_keySplines[i]="0 0 1 1"
}
}
else if(ak_tmp_values.length<(ak_keySplines.length+1))
{
for(var i=(ak_tmp_values.length-1);i<ak_keySplines.length;i++)
{
ak_keySplines.pop()
}
}
for(var i=0;i<ak_keySplines.length;i++)
{
ak_keySplines[i]=ak_keySplines[i].replace(/,/g," ")
ak_keySplines[i]=ak_keySplines[i].replace(/^ +| +$/g,"")
ak_keySplines[i]=ak_keySplines[i].replace(/ +/g," ")
ak_keySplines[i]=ak_keySplines[i].split(" ")
if(ak_keySplines[i].length!=4) ak_keySplines[i]=new Array(0,0,1,1)
for(var i2=0;i2<4;i2++)
{
ak_keySplines[i][i2]=parseFloat(ak_keySplines[i][i2])
ak_keySplines[i][i2]=isNaN(ak_keySplines[i][i2])?0:ak_keySplines[i][i2]
ak_keySplines[i][i2]=ak_round(ak_keySplines[i][i2],200)
ak_keySplines[i][i2]=ak_keySplines[i][i2]<0?0:ak_keySplines[i][i2]
ak_keySplines[i][i2]=ak_keySplines[i][i2]>1?1:ak_keySplines[i][i2]
}
}
if(action=="editKeyTimes")
{
var ak_tmp_out=prompt("Enter keyTimes (missing parameter will be removed)!",ak_keyTimes.join("; "))
if(ak_tmp_out==null) return
ak_tmp_out=ak_tmp_out.replace(/^ +| +$/g,"")
if(ak_tmp_out) ak_edit_animate('setAniAttr',for_object,for_animate,'keyTimes',ak_tmp_out)
else ak_edit_animate('rmAniAttribute',for_object,for_animate,'keyTimes')
return
}
else if(action=="editKeySplines")
{
for(var i=0;i<ak_keySplines.length;i++)
{
ak_keySplines[i]=ak_keySplines[i].join(" ")
}
var ak_tmp_out=prompt("Enter keySplines (missing parameter will be removed)!",ak_keySplines.join("; "))
if(ak_tmp_out==null) return
ak_tmp_out=ak_tmp_out.replace(/^ +| +$/g,"")
if(ak_tmp_out)
{
ak_edit_animate('setAniAttr',for_object,for_animate,'calcMode','spline')
ak_edit_animate('setAniAttr',for_object,for_animate,'keySplines',ak_tmp_out)
ak_tagName_cout+=' calcMode="spline"'
ak_cout(ak_tagName_cout)
}
else ak_edit_animate('rmAniAttribute',for_object,for_animate,'keySplines')
return
}
var ak_tmp_multi=ak_multiLocked
ak_multiLocked=true
var ak_tmpMultiName=ak_multiName
if(ak_multiName && ak_tmp_animate.tagName.search("ak_multi_"+ak_multiName+"_")!=0) ak_multiName=""
ak_edit_animate('setAniAttr',for_object,for_animate,'keyTimes',ak_keyTimes.join("; "),'no_check')
ak_multiName=ak_tmpMultiName
var ak_tmp_Node='<g id="ak_g_keyTimes" visibility="visible" style="fill:'+ak_colDur2+';stroke:'+ak_colDur3+';stroke-width:1">'
for(var i=ak_keyTimes.length-1;i>=0;i--)
{
if(i==0)
{
ak_tmp_Node+='<path style="fill:'+ak_colDur+';stroke:'+ak_colDur2+';stroke-width:1" d="M 16 '+(76+(ak_keyTimes[i]*200))+' l '+(5+(i*8))+' 0 l 10 -5 '
ak_tmp_Node+='l 0 -12 l 31 0 l 0 12 l -31 0 l 0 10 l -10 -4"/>'
ak_tmp_Node+='<text x="34" y="69" style="fill:'+ak_colDur2+';stroke:none;font-size:11">close</text>'
ak_tmp_Node+='<rect x="31" y="59" width="31" height="12" style="opacity:0"'
ak_tmp_Node+=' onmousedown="ak_edit_animateSpline('+"'closeKeyTimes','"+for_object+"','"+for_animate+"'"+')"/>'
}
else if(i==(ak_keyTimes.length-1))
{
ak_tmp=(5+(i*8))
if(ak_tmp<28) ak_tmp=28
ak_tmp_Node+='<path id="ak_g_keyTimes_'+i+'" onmousedown="ak_MoveEditRect(evt,'+"'down','keyTimes',"+i+')" d="M 16 '+(76+(ak_keyTimes[i]*200))+' l '+ak_tmp+' 0 l 10 -5 l 0 10 l -10 -4"/>' 
}
else ak_tmp_Node+='<path id="ak_g_keyTimes_'+i+'" onmousedown="ak_MoveEditRect(evt,'+"'down','keyTimes',"+i+')" d="M 16 '+(76+(ak_keyTimes[i]*200))+' l '+(5+(i*8))+' 0 l 10 -5 l 0 10 l -10 -4"/>'
}
ak_tmp_Node+='</g>'
ak_keyTimes_node=for_animate
document.getElementById("ak_animation_bar").appendChild((parseXML(ak_tmp_Node,document).firstChild))
ak_tagName_cout='keyTimes="'+ak_keyTimes.join("; ")+'"'
ak_multiLocked=true
var ak_tmpMultiName=ak_multiName
if(ak_multiName && ak_tmp_animate.tagName.search("ak_multi_"+ak_multiName+"_")!=0) ak_multiName=""
if(action=="keySplinesEditor") ak_edit_animate('setAniAttr',for_object,for_animate,"calcMode","spline",'no_check')
ak_multiName=ak_tmpMultiName
if(ak_tmp_animate.getAttribute("calcMode")!="spline")
{
ak_cout(ak_tagName_cout)
ak_multiLocked=ak_tmp_multi
ak_keysEditor=true
return
}
ak_tagName_cout='calcMode="spline" '+ak_tagName_cout
if(ak_keySplineEditor>(ak_keySplines.length-1)) ak_keySplineEditor=ak_keySplines.length-1
if(ak_keySplineEditor<0) ak_keySplineEditor=0
if(isNaN(ak_keySplineScale)) ak_keySplineScale=1
if(ak_keySplineScale<0.5) ak_keySplineScale=0.5
if(ak_keySplineScale>1) ak_keySplineScale=1
ak_tmp_Node='<g id="ak_g_keySplines" transform="translate('+ak_keySplineX+','+ak_keySplineY+'),scale('+ak_keySplineScale+')" style="fill:none;stroke:'+ak_colDur2+';stroke-width:2">'
ak_tmp_Node+='<rect transform="scale('+(1/ak_keySplineScale)+')" x="4" y="4" width="14" height="14" style="fill:'+ak_colDur+';stroke:'+ak_colDur2+';stroke-width:1.5'
ak_tmp_Node+='" onmousedown="ak_edit_animateSpline('+"'sizeKeySplines','"+for_object+"','"+for_animate+"'"+')"/>'
ak_tmp_Node+='<path style="stroke-width:5;stroke:'+ak_colDur+'" d="M -25 0 l 250 0 m -14 -5 l 14 5 l -14 5 M 0 25 l 0 -250 m -5 14 l 5 -14 l 5 14 M 0 -200 l 200 0 l 0 200"/>'
ak_tmp_Node+='<path d="M -25 0 l 250 0 m -14 -5 l 14 5 l -14 5 M 0 25 l 0 -250 m -5 14 l 5 -14 l 5 14 M 0 -200 l 200 0 l 0 200"/>'
var ak_tmp_asy=''
if(ak_keySplines.length>1)
{
ak_tmp_Node+='<rect x="23" y="-218" width="155" height="14" style="fill:'+ak_colDur+';stroke:'+ak_colDur2+';stroke-width:1"/>'
ak_tmp_Node+='<text x="26" y="-207" style="fill:'+ak_colDur2+';stroke:none;font-size:12">+[Shift] = asymetrical adjust</text>'
ak_tmp_asy=' M23 -218 h155 v14 h-155 v-14'
}
ak_tmp_Node+='<rect x="130" y="4" width="77" height="14" style="fill:'+ak_colDur+';stroke:'+ak_colDur2+';stroke-width:1"/>'
ak_tmp_Node+='<text x="133" y="15" style="fill:'+ak_colDur2+';stroke:none;font-size:12">currentTime()</text>'
ak_tmp_Node+='<g transform="rotate(-90),translate(97,-18)"><rect x="0" y="0" width="110" height="14" style="fill:'+ak_colDur+';stroke:'+ak_colDur2+';stroke-width:1"/>'
ak_tmp_Node+='<text x="3" y="11" style="fill:'+ak_colDur2+';stroke:none;font-size:12">animation progress</text></g>'
ak_tmp_Node+='<g transform="scale('+(1/ak_keySplineScale)+')">'
ak_tmp_Node+='<rect x="-38" y="-18" width="34" height="14" style="fill:'+ak_colDur+';stroke:'+ak_colDur2+';stroke-width:1.5"/>'
ak_tmp_Node+='<text x="-32" y="-7" style="fill:'+ak_colDur2+';stroke:none;font-size:12">next</text>'
ak_tmp_Node+='<rect x="-72" y="-18" width="34" height="14" style="fill:'+ak_colDur+';stroke:'+ak_colDur2+';stroke-width:1.5"/>'
ak_tmp_Node+='<text x="-67" y="-7" style="fill:'+ak_colDur2+';stroke:none;font-size:12">prev</text>'
ak_tmp_Node+='<rect x="-72" y="-32" width="68" height="14" style="fill:'+ak_colDur+';stroke:'+ak_colDur2+';stroke-width:1.5"/>'
ak_tmp_Node+='<text x="-67" y="-21" style="fill:'+ak_colDur2+';stroke:none;font-size:12">close</text>'
ak_tmp_Node+='<text x="-7" y="-21" style="fill:'+ak_colDur2+';stroke:none;font-size:12;text-anchor:end">('+(ak_keySplineEditor+1)+'.)</text>'
ak_tmp_Node+='<rect x="-72" y="-32" width="68" height="14" style="fill:#000;opacity:0"'
ak_tmp_Node+=' onmousedown="ak_edit_animateSpline('+"'closeKeyTimes','"+for_object+"','"+for_animate+"'"+')"/>'
ak_tmp_Node+='<rect x="-38" y="-18" width="34" height="14" style="fill:#000;opacity:0"'
ak_tmp_Node+=' onmousedown="ak_edit_animateSpline('+"'nextKeySplines','"+for_object+"','"+for_animate+"'"+')"/>'
ak_tmp_Node+='<rect x="-72" y="-18" width="34" height="14" style="fill:#000;opacity:0"'
ak_tmp_Node+=' onmousedown="ak_edit_animateSpline('+"'prevKeySplines','"+for_object+"','"+for_animate+"'"+')"/>'
ak_tmp_Node+='</g>'
ak_tmp_Node+='<path style="fill:#000;opacity:0" d="M 0 -200 h200 v200 h-200 v-200 M130 4 h77 v14 h-77 v-14 M-18 -207 h14 v110 h-14 v-110'+ak_tmp_asy
ak_tmp_Node+='" onmousedown="ak_MoveEditRect(evt,'+"'down','moveKeySplines',"+0+')"/>'
ak_tmp_Node+='<path id="ak_keyPath" style="stroke-width:4;stroke:#c1c" d="'
if(ak_keySplineEditor>0)
{
var i=ak_keySplineEditor-1
ak_tmp_Node+='M -200 200 c '+(ak_keySplines[i][0]*200)+' '+(-ak_keySplines[i][1]*200)+' '+(ak_keySplines[i][2]*200)+' '+(-ak_keySplines[i][3]*200)+' 200 -200'
}
else ak_tmp_Node+='M 0 0'
var i=ak_keySplineEditor
ak_tmp_Node+=' c '+(ak_keySplines[i][0]*200)+' '+(-ak_keySplines[i][1]*200)+' '+(ak_keySplines[i][2]*200)+' '+(-ak_keySplines[i][3]*200)+' 200 -200'
if(ak_keySplineEditor<(ak_keySplines.length-1))
{
var i=ak_keySplineEditor+1
ak_tmp_Node+=' c '+(ak_keySplines[i][0]*200)+' '+(-ak_keySplines[i][1]*200)+' '+(ak_keySplines[i][2]*200)+' '+(-ak_keySplines[i][3]*200)+' 200 -200'
}
ak_tmp_Node+='"/>'
var i=ak_keySplineEditor
var ak_tmp_action=' onmousedown="ak_MoveEditRect(evt,'+"'down','editKeySplines',"
ak_tmp_Node+='<line id="ak_keyLine_1" x1="0" y1="0" style="stroke:#eee" x2="'+(ak_keySplines[i][0]*200)+'" y2="'+(-ak_keySplines[i][1]*200)+'"/>'
ak_tmp_Node+='<line id="ak_keyLine_2" x1="200" y1="-200" style="stroke:#eee" x2="'+(ak_keySplines[i][2]*200)+'" y2="'+(-ak_keySplines[i][3]*200)+'"/>'
if(ak_keySplineEditor>0)
{
var i=ak_keySplineEditor-1
ak_tmp_Node+='<line id="ak_keyLine_0" x1="0" y1="0" style="stroke:#eee" x2="'+((ak_keySplines[i][2]*200)-200)+'" y2="'+(200-(ak_keySplines[i][3]*200))+'"/>'
ak_tmp_Node+='<circle id="ak_keyCircle_0" r="'+(4/ak_keySplineScale)+'" style="shape-rendering:geometricPrecision;fill:'+ak_colDur+';stroke:'+ak_colDur2+';stroke-width:1.5" cx="'+((ak_keySplines[i][2]*200)-200)+'" cy="'+(200-(ak_keySplines[i][3]*200))+'"'
ak_tmp_Node+=ak_tmp_action+0+')"/>'
}
if(ak_keySplineEditor<(ak_keySplines.length-1))
{
var i=ak_keySplineEditor+1
ak_tmp_Node+='<line id="ak_keyLine_3" x1="200" y1="-200" style="stroke:#eee" x2="'+((ak_keySplines[i][0]*200)+200)+'" y2="'+(-(ak_keySplines[i][1]*200)-200)+'"/>'
ak_tmp_Node+='<circle id="ak_keyCircle_3" r="'+(4/ak_keySplineScale)+'" style="shape-rendering:geometricPrecision;fill:'+ak_colDur2+';stroke:'+ak_colDur3+';stroke-width:1.5" cx="'+((ak_keySplines[i][0]*200)+200)+'" cy="'+(-(ak_keySplines[i][1]*200)-200)+'"'
ak_tmp_Node+=ak_tmp_action+3+')"/>'
}
var i=ak_keySplineEditor
ak_tmp_Node+='<circle id="ak_keyCircle_2" r="'+(4/ak_keySplineScale)+'" style="shape-rendering:geometricPrecision;fill:'+ak_colDur+';stroke:'+ak_colDur2+';stroke-width:1.5" cx="'+(ak_keySplines[i][2]*200)+'" cy="'+(-(ak_keySplines[i][3]*200))+'"'
ak_tmp_Node+=ak_tmp_action+2+')"/>'
ak_tmp_Node+='<circle id="ak_keyCircle_1" r="'+(4/ak_keySplineScale)+'" style="shape-rendering:geometricPrecision;fill:'+ak_colDur2+';stroke:'+ak_colDur3+';stroke-width:1.5" cx="'+(ak_keySplines[i][0]*200)+'" cy="'+(-(ak_keySplines[i][1]*200))+'"'
ak_tmp_Node+=ak_tmp_action+1+')"/>'

ak_tmp_Node+='</g>'
document.getElementById("ak_g_keyTimes").appendChild((parseXML(ak_tmp_Node,document).firstChild))
var ak_tmp_splines=new Array
for(var i=0;i<ak_keySplines.length;i++)
{
ak_tmp_splines.push(ak_keySplines[i].join(" "))
}
ak_multiLocked=true
var ak_tmpMultiName=ak_multiName
if(ak_multiName && ak_tmp_animate.tagName.search("ak_multi_"+ak_multiName+"_")!=0) ak_multiName=""
ak_edit_animate('setAniAttr',for_object,for_animate,"keySplines",ak_tmp_splines.join("; "),'no_check')
ak_multiName=ak_tmpMultiName
ak_tagName_cout='keyTimes="'+ak_keyTimes.join("; ")+'" keySplines="'+ak_tmp_splines.join("; ")+'"'
if(ak_tagName_cout>124) ak_tagName_cout=ak_tagName_cout.substring(0,120)+'...'
ak_cout(ak_tagName_cout)
ak_multiLocked=ak_tmp_multi
ak_keysEditor=true
}
//########################################
function ak_create_parentNode(node,for_object)
{
var ak_tmp_nr=ak_which_nodeNr(for_object)
if(ak_tmp_nr=="0" || ak_tmp_nr=="-1" || ak_tmp_nr=="") return // bei rootSVG noch erweitern
if(!/^\[object Text/.test(for_object.previousSibling()))
{
for_object.parentNode.insertBefore(parseXML("<g>"+ak_spaces(for_object)+"</g>",document).firstChild.firstChild,for_object)
}
for_object.parentNode.insertBefore(parseXML(node,document).firstChild,for_object)
var ak_tmp_parent=for_object.previousSibling()
ak_tmp_parent.appendChild(for_object)
ak_nice_tabs(ak_tmp_parent)
}
//########################################
function ak_remove_parentNode(for_object)
{
for_object=for_object.parentNode
var ak_tmp_nr=ak_which_nodeNr(for_object)
if(ak_tmp_nr=="0" || ak_tmp_nr=="-1" || ak_tmp_nr=="") return
ak_nice_tabs(for_object,'likewise')
var ak_tmp_prev=for_object.previousSibling()
if(ak_tmp_prev && /^\[object Text/.test(ak_tmp_prev) && printNode(ak_tmp_prev).lastIndexOf('\n')==0)
{
for_object.previousSibling().parentNode.removeChild(for_object.previousSibling())
}
else if(ak_tmp_prev && /^\[object Text/.test(ak_tmp_prev))
{
var ak_tmp=printNode(ak_tmp_prev)
ak_tmp=ak_tmp.substring(0,ak_tmp.lastIndexOf('\n'))
ak_tmp_prev.data=ak_tmp
}
for(var i=0;i<for_object.childNodes.length;)
{
if(i==(for_object.childNodes.length-1) && /^\[object Text/.test(for_object.childNodes.item(i))) break
for_object.parentNode.insertBefore(for_object.childNodes.item(i),for_object)
}
for_object.parentNode.removeChild(for_object)
}
//########################################
function ak_nice_tabs(for_object,likewise)
{
var ak_tmp_prev=for_object.previousSibling()
if(!/^\[object Text/.test(ak_tmp_prev))  var ak_tmp_spaces='\n'
else var ak_tmp_spaces=printNode(ak_tmp_prev)
ak_tmp_spaces=ak_tmp_spaces.substring(ak_tmp_spaces.lastIndexOf('\n'))
if(!/^\[object SVGText/.test(for_object) && !/^\[object SVGTSpan/.test(for_object) && !/^\[object SVGTRef/.test(for_object))
{
for(var i=0;i<for_object.childNodes.length;i++)
{
var ak_tmp_object=for_object.childNodes.item(i)
if(/^\[object Text/.test(ak_tmp_object)) {ak_tmp_object.parentNode.removeChild(ak_tmp_object); i--}
}
for(var i=0;i<for_object.childNodes.length;i++)
{
if(likewise) for_object.insertBefore(parseXML('<g>'+ak_tmp_spaces+'</g>',document).firstChild.firstChild,for_object.childNodes.item(i))
else for_object.insertBefore(parseXML('<g>'+ak_tmp_spaces+'  </g>',document).firstChild.firstChild,for_object.childNodes.item(i))
i++
}
for_object.appendChild(parseXML('<g>'+ak_tmp_spaces+'</g>',document).firstChild.firstChild)
for(var i=0;i<for_object.childNodes.length;i++)
{
if(for_object.childNodes.item(i).childNodes.length>0) ak_nice_tabs(for_object.childNodes.item(i))
}
}
}
//########################################
var ak_fast_move=false
function ak_edit_overall(set2)
{
if(ak_fast_selection) return
if(set2=="remove") 
{
ak_mouse_circle.setAttribute("cx",ak_mouse_x)
ak_mouse_circle.setAttribute("cy",ak_mouse_y)
ak_mouse_circle.setAttribute("style","visibility:visible")
ak_fast_move=true
}
else
{
if(!ak_pathAddPoint) ak_mouse_circle.setAttribute("style","visibility:hidden")
ak_fast_move=false
}
}
//########################################
function ak_add_pathPoint(flag)
{
ak_pathAddPoint=flag
if(ak_no_edit_before) return
if(flag)
{
ak_mouse_circle.setAttribute("style","visibility:visible")
}
else
{
ak_mouse_circle.setAttribute("style","visibility:hidden")
ak_add_c.setAttribute("style","visibility:hidden")
ak_add_l.setAttribute("style","visibility:hidden")
ak_add_m.setAttribute("style","visibility:hidden")
ak_add_q.setAttribute("style","visibility:hidden")
ak_del_x.setAttribute("style","visibility:hidden")
}
}
//########################################
function ak_edit_marker(what)
{
switch(what)
{
case "userSpaceOnUse":
ak_object2update.setAttribute("markerUnits",what)
break
case "strokeWidth":
ak_object2update.setAttribute("markerUnits",what)
break
case "removeUnits":
try{ak_object2update.removeAttribute("markerUnits")}catch(error){}
break
case "auto":
ak_object2update.setAttribute("orient",what)
break
case "drawLine":
var ak_tmp_line='<line id="'+ak_generate_id(evt,"line_")+'" x1="0" y1="0" x2="'+ak_round(((ak_markerWidth+ak_markerHeight)/1.8),10)+'" y2="0"'
ak_tmp_line+=' style="stroke:#08f;marker:url(#'+ak_object2update.getId()+')"'
ak_tmp_line+=' transform="translate('+ak_markerX+','+ak_markerY+'),rotate('+(-ak_markerOrient)+')"/>'
var ak_tmp_parent=ak_object2update.parentNode
while(ak_tmp_parent.tagName!="svg" && ak_tmp_parent.tagName!="g" && ak_tmp_parent.tagName!="a")
{ak_tmp_parent=ak_tmp_parent.parentNode}
ak_appendChildSP(ak_tmp_line,ak_tmp_parent)
var ak_tmp_object=document.getElementById(ak_object2update.getId()).childNodes
for(var i=0;i<ak_tmp_object.length;i++)
{
if(/^(\[object SVG)/.test(ak_tmp_object.item(i)))
{
ak_clickset_obj2update(evt,ak_tmp_object.item(i))
return
}
}
break
}
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
//########################################
function ak_set4marker()
{
var ak_tmp_clips=ak_userspace_svg.getElementsByTagName("marker")
var ak_tmp_array=new Array
for(var i=0;i<ak_tmp_clips.length;i++)
{
try{ // marker zeigt ein item zuviel
if(ak_tmp_clips.item(i).getId()!="") ak_tmp_array.push(ak_tmp_clips.item(i).getId())
}
catch(err){}
}
var ak_tmp_yes=false
switch(ak_object2update.tagName)
{
case "a":
case "g":
case "line":
case "polyline":
case "polygon":
case "path": ak_tmp_yes=true
}
if(ak_tmp_array.length>0 && ak_tmp_yes)
{
var ak_newNode='<menu id="ak_set_marker"><header>Set Marker</header>'
for(var mark=0;mark<4;mark++)
{
var ak_tmp_whichMarker="marker"
switch(mark)
{
case 1: ak_tmp_whichMarker="marker-start"; break
case 2: ak_tmp_whichMarker="marker-mid"; break
case 3: ak_tmp_whichMarker="marker-end"; break
}
ak_newNode+='<menu id="ak_set_marker"><header>'+ak_tmp_whichMarker+'</header>'
var ak_tmp_clip=ak_SetGetRm_styleValue(ak_object2update,ak_tmp_whichMarker,"get","no_cout")
if(!/^(url\(#)/.test(ak_tmp_clip) || ak_tmp_clip=="false") ak_tmp_clip=false
else ak_tmp_clip=ak_tmp_clip.replace(/^(url\(#)|\)$/g,"")
for(var i=0;i<ak_tmp_array.length;i++)
{
var ak_tmp_checked=''
if(ak_tmp_array[i]==ak_tmp_clip) ak_tmp_checked=' checked="yes"'
ak_newNode+='<item'+ak_tmp_checked+' onactivate="ak_set_2marker('+"'"+ak_tmp_whichMarker+"','"+ak_tmp_array[i]+"'"+')">'+ak_tmp_array[i]+'</item>'
}
ak_newNode+='<separator/>'
ak_newNode+='<item onactivate="ak_set_2marker('+"'"+ak_tmp_whichMarker+"'"+')">remove '+ak_tmp_whichMarker+'</item></menu>'
}
ak_newNode+='</menu>'
return ak_newNode
}
return ""
}
//########################################
function ak_set_2marker(which_marker)
{
if(arguments.length==1) ak_SetGetRm_styleValue(ak_object2update,which_marker,"remove","no_cout")
else ak_SetGetRm_styleValue(ak_object2update,which_marker,"url(#"+arguments[1]+")","no_cout")
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
//########################################
var ak_attr_array
function ak_set_attribute_tools()
{
if(!/^Adobe; 3\./.test(getSVGViewerVersion())) return
var ak_tmp_expert=document.getElementById('ak_attribute_tools')
ak_attr_array=new Array
if(ak_tmp_expert)
{
var ak_tmp=ak_object2update.attributes
var ak_newNode='<menu id="ak_attribute_tools"><header>Object Attributes</header>'
var ak_newRem=''
if(ak_tmp.length>0)
{
ak_newRem='<menu id="ak_attribute_tools"><header>Remove Attributes</header>'
for(var i=0;i<ak_tmp.length;i++)
{
ak_attr_array[i]=new Array(ak_tmp.item(i).getNodeName(),ak_tmp.item(i).getNodeValue())
var ak_tmp_txt=ak_attr_array[i][0]+'="'+ak_attr_array[i][1]+'"'
if(ak_tmp_txt.length>30) ak_tmp_txt=ak_tmp_txt.substring(0,26)+'..."'
ak_newNode+='<item onactivate="'+"ak_expert_tool('enter_attr_list',"+i+")"+'">'+ak_tmp_txt+'</item>'
ak_newRem+='<item onactivate="'+"ak_expert_tool('remove_attr_list',"+i+")"+'">'+ak_tmp_txt+'</item>'
}
ak_newRem+='</menu>'
}
else ak_newNode+='<item enabled="no">No Attributes found!</item>'
ak_newNode+='<separator/>'
ak_newNode+='<item onactivate="'+"ak_expert_tool('enter_attr_val')"+'">Enter "attribute" "value"</item>'
if(ak_newRem) ak_newNode+=ak_newRem
else ak_newNode+='<item enabled="no">Remove Attributes</item>'
ak_newNode+='</menu>'
ak_tmp_expert.parentNode.replaceChild(parseXML(ak_newNode,document).firstChild,ak_tmp_expert)
}
}
//########################################
var ak_attr_array
function ak_set4clipPath()
{
var ak_tmp_clips=ak_userspace_svg.getElementsByTagName("clipPath")
var ak_tmp_array=new Array
for(var i=0;i<ak_tmp_clips.length;i++){if(ak_tmp_clips.item(i).getId()!="" && ak_tmp_clips.item(i).getId()!=null) ak_tmp_array.push(ak_tmp_clips.item(i).getId())}
var ak_tmp_mask=ak_userspace_svg.getElementsByTagName("mask")
var ak_tmp_arrayMask=new Array
for(var i=0;i<ak_tmp_mask.length;i++)
{
if(ak_tmp_mask.item(i))
{
if(ak_tmp_mask.item(i).getId()!="" && ak_tmp_mask.item(i).getId()!=null) ak_tmp_arrayMask.push(ak_tmp_mask.item(i).getId())
}
else break
}
var ak_tmp_yes=false
switch(ak_object2update.tagName)
{
case "a":
case "g":
case "textPath":
case "tspan":
case "tref":
case "text":
case "line":
case "rect":
case "use":
case "image":
case "circle":
case "ellipse":
case "polyline":
case "polygon":
case "path":
case "mask":
case "clipPath":
case "svg": ak_tmp_yes=true
}
if(ak_tmp_yes)
{
var ak_tmp_clip=ak_SetGetRm_styleValue(ak_object2update,"clip-path","get","no_cout")
if(!/^(url\(#)/.test(ak_tmp_clip) || ak_tmp_clip=="false") ak_tmp_clip=false
else ak_tmp_clip=ak_tmp_clip.replace(/^(url\(#)|\)$/g,"")
var ak_tmp_menu=document.getElementById("ak_set_clipPath")
var ak_newNode='<menu id="ak_set_clipPath"><header>Set clip-path | mask</header>'
for(var i=0;i<ak_tmp_array.length;i++)
{
var ak_tmp_checked=''
if(ak_tmp_array[i]==ak_tmp_clip) ak_tmp_checked=' checked="yes"'
if(ak_object2update.tagName=="clipPath" && ak_tmp_array[i]==ak_object2update.getId())
{ak_newNode+='<item'+ak_tmp_checked+' enabled="no" onactivate="ak_set_2clipPath('+"'"+ak_tmp_array[i]+"'"+')">    '+ak_tmp_array[i]+'</item>'}
else ak_newNode+='<item'+ak_tmp_checked+' onactivate="ak_set_2clipPath('+"'"+ak_tmp_array[i]+"'"+')">    '+ak_tmp_array[i]+'</item>'
}
if(ak_tmp_array.length<=0) ak_newNode+='<item enabled="no">    no clip-path!</item>'
var ak_tmp_checked=''
//if(!ak_tmp_clip) ak_tmp_checked=' checked="yes"'
ak_newNode+='<item onactivate="ak_set_2clipPath()">Remove  clip-path</item>'
ak_newNode+='<separator/>'
ak_newNode+='<item/>'
ak_tmp_clip=ak_SetGetRm_styleValue(ak_object2update,"mask","get","no_cout")
if(!/^(url\(#)/.test(ak_tmp_clip) || ak_tmp_clip=="false") ak_tmp_clip=false
else ak_tmp_clip=ak_tmp_clip.replace(/^(url\(#)|\)$/g,"")
for(var i=0;i<ak_tmp_arrayMask.length;i++)
{
var ak_tmp_checked=''
if(ak_tmp_arrayMask[i]==ak_tmp_clip) ak_tmp_checked=' checked="yes"'
if(ak_object2update.tagName=="mask" && ak_tmp_arrayMask[i]==ak_object2update.getId())
{ak_newNode+='<item'+ak_tmp_checked+' enabled="no" onactivate="ak_set_2mask('+"'"+ak_tmp_arrayMask[i]+"'"+')">    '+ak_tmp_arrayMask[i]+'</item>'}
else ak_newNode+='<item'+ak_tmp_checked+' onactivate="ak_set_2mask('+"'"+ak_tmp_arrayMask[i]+"'"+')">    '+ak_tmp_arrayMask[i]+'</item>'
}
if(ak_tmp_arrayMask.length<=0) ak_newNode+='<item enabled="no">    no mask!</item>'
var ak_tmp_checked=''
//if(!ak_tmp_clip) ak_tmp_checked=' checked="yes"'
ak_newNode+='<item onactivate="ak_set_2mask()">Remove  mask</item></menu>'
ak_tmp_menu.parentNode.replaceChild(parseXML(ak_newNode,document).firstChild,ak_tmp_menu)
}
else
{
var ak_tmp_menu=document.getElementById("ak_set_clipPath")
var ak_newNode='<item id="ak_set_clipPath" enabled="no">Set clip-path | mask</item>'
ak_tmp_menu.parentNode.replaceChild(parseXML(ak_newNode,document).firstChild,ak_tmp_menu)
}
}
//########################################
function ak_set_2clipPath()
{
if(arguments.length==0) ak_SetGetRm_styleValue(ak_object2update,"clip-path","remove","no_cout")
else ak_SetGetRm_styleValue(ak_object2update,"clip-path","url(#"+arguments[0]+")","no_cout")
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
//########################################
function ak_set_2mask()
{
if(arguments.length==0) ak_SetGetRm_styleValue(ak_object2update,"mask","remove","no_cout")
else ak_SetGetRm_styleValue(ak_object2update,"mask","url(#"+arguments[0]+")","no_cout")
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
//########################################
function ak_convertPoly2Path(evt)
{
ak_push2undoTrue()
if(ak_edit_which_attribute!="xy_etc") ak_switch_xy_transform("xy_etc")
ak_EditArray_enter.splice(2,0,"L")
ak_EditArray_enter.unshift("M")
if(ak_object2update.tagName=="polygon") ak_EditArray_enter.push("Z")
ak_object2update.setAttribute("points",ak_EditArray_enter.join(" "))
var ak_tmp_path=printNode(ak_object2update)
ak_tmp_path=ak_tmp_path.replace(/(polygon)|(polyline)/g,"path")
ak_tmp_path=ak_tmp_path.replace(/(points)/g,"d")
ak_tmp_path=parseXML(ak_tmp_path,document).firstChild
ak_object2update.parentNode.replaceChild(ak_tmp_path,ak_object2update)
ak_clickset_obj2update(evt,ak_tmp_path)
}
//########################################
function ak_get_parent_size(for_object,what)
{
if(what=='width')
{
var ak_tmp=window.innerWidth
var ak_tmp_svgArray=new Array
var ak_tmp_svg=for_object
while(ak_which_nodeNr(ak_tmp_svg)!='-1' && ak_which_nodeNr(ak_tmp_svg)!='')
{
ak_tmp_svg=ak_tmp_svg.parentNode
if(ak_tmp_svg.tagName) ak_tmp_svgArray.push(ak_tmp_svg.cloneNode(0))
}
if(ak_tmp_svgArray.length>0)
{
ak_tmp_svgArray.reverse()
for(var i=0;i<ak_tmp_svgArray.length;i++)
{
if(ak_tmp_svgArray[i].getAttributeNode('width'))
{
ak_tmp=ak_getAbsolutePixel(ak_tmp_svgArray[i].getAttribute('width'),'width',ak_tmp,ak_tmp)
}
}
}
return ak_tmp
}
else if(what=='height')
{
var ak_tmp=window.innerHeight
var ak_tmp_svgArray=new Array
var ak_tmp_svg=for_object
while(ak_which_nodeNr(ak_tmp_svg)!='-1' && ak_which_nodeNr(ak_tmp_svg)!='')
{
ak_tmp_svg=ak_tmp_svg.parentNode
if(ak_tmp_svg.tagName) ak_tmp_svgArray.push(ak_tmp_svg.cloneNode(0))
}
if(ak_tmp_svgArray.length>0)
{
ak_tmp_svgArray.reverse()
for(var i=0;i<ak_tmp_svgArray.length;i++)
{
if(ak_tmp_svgArray[i].getAttributeNode('height'))
{
ak_tmp=ak_getAbsolutePixel(ak_tmp_svgArray[i].getAttribute('height'),'height',ak_tmp,ak_tmp)
}
}
}
return ak_tmp
}
}
//########################################
var ak_viewBox_check, ak_svg_for_object='1', ak_viewBox_CTM, ak_viewBox_attr, ak_within_root=false
function ak_get_overall_CTM(evt,for_object,viewBox_check)
{
//if(ak_which_nodeNr(for_object)==-1) return ak_svgroot.createSVGMatrix
var ak_tmp_matrix=ak_SetGetRm_transformValue(for_object,"matrix","get","get_matrix")
if(!for_object) return ak_tmp_matrix
if((for_object.parentNode!="[object SVGDocument]" && !ak_within_root) || (ak_which_nodeNr(for_object.parentNode)!="" && ak_within_root))
//if(for_object!="[object SVGSVGElement]")
{
if(!viewBox_check)
{
if(ak_which_nodeNr(for_object)==-1)
{
ak_svg_for_object=''; ak_viewBox_CTM=''; ak_viewBox_attr=''
}
else
{
ak_svg_for_object=for_object
if(ak_svg_for_object.tagName!='svg')
{
ak_viewBox_attr=''
while(ak_which_nodeNr(ak_svg_for_object)!='')
{
ak_viewBox_attr=ak_svg_for_object.getAttribute('viewBox')
if(ak_viewBox_attr) break
ak_svg_for_object=ak_svg_for_object.parentNode
}
ak_viewBox_CTM=ak_which_nodeNr(ak_svg_for_object)
ak_viewBox_attr=ak_svg_for_object.getAttribute('viewBox').replace(/^ +| +$/g,"")
var ak_tmp_scX=1, ak_tmp_scY=1
var ak_tmp_shX=0, ak_tmp_shY=0
if(ak_viewBox_attr)
{
var ak_tmp_viewB=ak_viewBox_attr.replace(/ +/g,' ').split(' ')
for(var i=0; i<4;i++)
{
ak_tmp_viewB[i]=parseFloat(ak_tmp_viewB[i])
ak_tmp_viewB[i]=isNaN(ak_tmp_viewB[i])?0:ak_tmp_viewB[i]
}
var ak_tmp_width=ak_get_parent_size(ak_svg_for_object,'width')
var ak_tmp_height=ak_get_parent_size(ak_svg_for_object,'height')
var ak_tmp_width_own=ak_getAbsolutePixel(ak_svg_for_object.getAttribute('width'),'width',ak_tmp_width,ak_tmp_height)
var ak_tmp_height_own=ak_getAbsolutePixel(ak_svg_for_object.getAttribute('height'),'height',ak_tmp_width,ak_tmp_height)
ak_tmp_scX=ak_tmp_viewB[2]/ak_tmp_width_own
ak_tmp_scY=ak_tmp_viewB[3]/ak_tmp_height_own
ak_tmp_shX=ak_tmp_viewB[0]
ak_tmp_shY=ak_tmp_viewB[1]
}
ak_svg_for_object=for_object
while(ak_svg_for_object.tagName!='svg')
{
ak_svg_for_object=ak_svg_for_object.parentNode
}
if(!ak_svg_for_object.getAttribute('viewBox'))
{
var ak_tmp_width=ak_get_parent_size(ak_svg_for_object,'width')
var ak_tmp_height=ak_get_parent_size(ak_svg_for_object,'height')
var ak_tmp_width_own=ak_getAbsolutePixel(ak_svg_for_object.getAttribute('width'),'width',ak_tmp_width,ak_tmp_height)
var ak_tmp_height_own=ak_getAbsolutePixel(ak_svg_for_object.getAttribute('height'),'height',ak_tmp_width,ak_tmp_height)
//ak_viewBox_attr=ak_round(ak_tmp_shX,100)+' '+ak_round(ak_tmp_shY,100)
ak_viewBox_attr='0 0'
ak_viewBox_attr+=' '+ak_round(ak_tmp_width_own*ak_tmp_scX,100)+' '+ak_round(ak_tmp_height_own*ak_tmp_scY,100)
}
else
{
ak_viewBox_attr=ak_svg_for_object.getAttribute('viewBox')
ak_viewBox_attr=ak_viewBox_attr.replace(/^ +| +$/g,"")
}
ak_svg_for_object=ak_which_nodeNr(ak_svg_for_object)
}
else
{
ak_svg_for_object=ak_which_nodeNr(ak_svg_for_object)
ak_viewBox_CTM=''; ak_viewBox_attr=''
}
}
}
var ak_tmp_matrix2=ak_get_overall_CTM(evt,for_object.parentNode,true)
if(ak_which_nodeNr(for_object.parentNode)==ak_svg_for_object) var ak_tmp_viewBox=ak_viewBox_attr
else var ak_tmp_viewBox=for_object.parentNode.getAttribute("viewBox").replace(/^ +| +$/g,"")
if(ak_tmp_viewBox!="" && (for_object.parentNode.tagName()=="svg" || for_object.parentNode.tagName()=="pattern"))
{
ak_tmp_viewBox=ak_tmp_viewBox.replace(/ +/g,";")
var ak_tmp_viewBox_array=ak_tmp_viewBox.split(";")
var ak_tmp_ratio=for_object.parentNode.getAttribute("preserveAspectRatio").replace(/^ +| +$/g,"")
var ak_tmp_ratio_array=ak_tmp_ratio.replace(/ +/g,";").split(";")
if(ak_tmp_ratio_array[1]!="slice") ak_tmp_ratio_array[1]="meet"
for(var i=0; i<4;i++)
{
ak_tmp_viewBox_array[i]=parseFloat(ak_tmp_viewBox_array[i])
ak_tmp_viewBox_array[i]=isNaN(ak_tmp_viewBox_array[i])?0:ak_tmp_viewBox_array[i]
}
var ak_tmp_shiftX_flag="xMid"
switch(ak_tmp_ratio_array[0].substring(0,4))
{
case "xMin":
ak_tmp_shiftX_flag="xMin"
break
case "xMid":
break
case "xMax":
ak_tmp_shiftX_flag="xMax"
break
default:
ak_tmp_ratio_array[0]="xMidYMid"
break
}
var ak_tmp_shiftY_flag="YMid"
switch(ak_tmp_ratio_array[0].substring(4,8))
{
case "YMin":
ak_tmp_shiftY_flag="YMin"
break
case "YMid":
break
case "YMax":
ak_tmp_shiftY_flag="YMax"
break
default:
ak_tmp_shiftX_flag="xMid"
ak_tmp_shiftY_flag="YMid"
break
}
var ak_tmp_linksoben_x=0
var ak_tmp_linksoben_y=0
var ak_tmp_width=ak_get_parent_size(for_object.parentNode,'width')
var ak_tmp_height=ak_get_parent_size(for_object.parentNode,'height')
var ak_tmp_patternUnits="userSpaceOnUse"
var ak_tmp_x=for_object.parentNode.getAttribute("x")
var ak_tmp_y=for_object.parentNode.getAttribute("y")
var ak_tmp_p_width=ak_check_on_href(evt,for_object.parentNode,"width")
var ak_tmp_p_height=ak_check_on_href(evt,for_object.parentNode,"height")
ak_tmp_x=ak_get_gradient_xy(evt,ak_tmp_x,0,ak_tmp_linksoben_x,ak_tmp_width,ak_tmp_patternUnits)
ak_tmp_y=ak_get_gradient_xy(evt,ak_tmp_y,0,ak_tmp_linksoben_y,ak_tmp_height,ak_tmp_patternUnits)
ak_tmp_x2=ak_get_gradient_xy(evt,ak_tmp_p_width,0,ak_tmp_linksoben_x,ak_tmp_width,ak_tmp_patternUnits)
ak_tmp_y2=ak_get_gradient_xy(evt,ak_tmp_p_height,0,ak_tmp_linksoben_y,ak_tmp_height,ak_tmp_patternUnits)
ak_tmp_p_width=ak_tmp_x2-ak_tmp_linksoben_x
ak_tmp_p_height=ak_tmp_y2-ak_tmp_linksoben_y
var ak_tmp_scaleX=1
var ak_tmp_scaleY=1
if(ak_tmp_viewBox_array[2]>0) ak_tmp_scaleX=ak_tmp_p_width/ak_tmp_viewBox_array[2]
else {ak_tmp_shiftX_flag="xMin"; ak_tmp_shiftY_flag="YMin"}
if(ak_tmp_viewBox_array[3]>0) ak_tmp_scaleY=ak_tmp_p_height/ak_tmp_viewBox_array[3]
else {ak_tmp_shiftX_flag="xMin"; ak_tmp_shiftY_flag="YMin"}
var ak_tmp_shiftX=0
var ak_tmp_shiftY=0
if(ak_tmp_ratio=="none") {}
else if(ak_tmp_ratio_array[1]=="meet")
{
if(ak_tmp_scaleX>ak_tmp_scaleY)
{
if(ak_tmp_shiftX_flag=="xMid") ak_tmp_shiftX=(ak_tmp_p_width-(ak_tmp_p_height*(ak_tmp_viewBox_array[2]/ak_tmp_viewBox_array[3])))/2
else if(ak_tmp_shiftX_flag=="xMax") ak_tmp_shiftX=(ak_tmp_p_width-(ak_tmp_p_height*(ak_tmp_viewBox_array[2]/ak_tmp_viewBox_array[3])))
ak_tmp_scaleX=ak_tmp_scaleY
}
else
{
if(ak_tmp_shiftY_flag=="YMid") ak_tmp_shiftY=(ak_tmp_p_height-(ak_tmp_p_width*(ak_tmp_viewBox_array[3]/ak_tmp_viewBox_array[2])))/2
else if(ak_tmp_shiftY_flag=="YMax") ak_tmp_shiftY=(ak_tmp_p_height-(ak_tmp_p_width*(ak_tmp_viewBox_array[3]/ak_tmp_viewBox_array[2])))
ak_tmp_scaleY=ak_tmp_scaleX
}
}
else // dann slice
{
if(ak_tmp_scaleX>ak_tmp_scaleY)
{
if(ak_tmp_shiftY_flag=="YMid") ak_tmp_shiftY=(ak_tmp_p_height-(ak_tmp_p_width*(ak_tmp_viewBox_array[3]/ak_tmp_viewBox_array[2])))/2
else if(ak_tmp_shiftY_flag=="YMax") ak_tmp_shiftY=(ak_tmp_p_height-(ak_tmp_p_width*(ak_tmp_viewBox_array[3]/ak_tmp_viewBox_array[2])))
ak_tmp_scaleY=ak_tmp_scaleX
}
else
{
if(ak_tmp_shiftX_flag=="xMid") ak_tmp_shiftX=(ak_tmp_p_width-(ak_tmp_p_height*(ak_tmp_viewBox_array[2]/ak_tmp_viewBox_array[3])))/2
else if(ak_tmp_shiftX_flag=="xMax") ak_tmp_shiftX=(ak_tmp_p_width-(ak_tmp_p_height*(ak_tmp_viewBox_array[2]/ak_tmp_viewBox_array[3])))
ak_tmp_scaleX=ak_tmp_scaleY
}
}
if(ak_svg_for_object==ak_which_nodeNr(for_object.parentNode))
//if(for_object.tagName!='svg')
{
ak_tmp_matrix2=ak_tmp_matrix2.translate(ak_tmp_shiftX,ak_tmp_shiftY)
ak_tmp_matrix2=ak_tmp_matrix2.scaleNonUniform(ak_tmp_scaleX,ak_tmp_scaleY)
ak_tmp_matrix2=ak_tmp_matrix2.translate(-ak_tmp_viewBox_array[0],-ak_tmp_viewBox_array[1])
}
else if(ak_viewBox_CTM==ak_which_nodeNr(for_object.parentNode))
{
ak_tmp_matrix2=ak_tmp_matrix2.translate(-ak_tmp_viewBox_array[0]*ak_tmp_scaleX,-ak_tmp_viewBox_array[1]*ak_tmp_scaleY)
//ak_tmp_matrix2=ak_tmp_matrix2.translate(ak_tmp_shiftX,ak_tmp_shiftY)
//ak_tmp_matrix2=ak_tmp_matrix2.scaleNonUniform(ak_tmp_scaleX,ak_tmp_scaleY)
//ak_tmp_matrix2=ak_tmp_matrix2.translate(-ak_tmp_viewBox_array[0],-ak_tmp_viewBox_array[1])
}
else ak_tmp_matrix2=ak_tmp_matrix2.translate(-ak_tmp_viewBox_array[0]*ak_tmp_scaleX,-ak_tmp_viewBox_array[1]*ak_tmp_scaleY)
}
}
else var ak_tmp_matrix2=ak_svgroot.createSVGMatrix
if(for_object.tagName()=="svg" || for_object.tagName()=="pattern")
{
var ak_tmp_linksoben_x=0
var ak_tmp_linksoben_y=0
var ak_tmp_width=ak_get_parent_size(for_object,'width')
var ak_tmp_height=ak_get_parent_size(for_object,'height')
var ak_tmp_patternUnits="userSpaceOnUse"
var ak_tmp_x=for_object.getAttribute("x")
var ak_tmp_y=for_object.getAttribute("y")
var ak_tmp_p_width=ak_check_on_href(evt,for_object,"width")
var ak_tmp_p_height=ak_check_on_href(evt,for_object,"height")
ak_tmp_x=ak_get_gradient_xy(evt,ak_tmp_x,0,ak_tmp_linksoben_x,ak_tmp_width,ak_tmp_patternUnits)
ak_tmp_y=ak_get_gradient_xy(evt,ak_tmp_y,0,ak_tmp_linksoben_y,ak_tmp_height,ak_tmp_patternUnits)
ak_tmp_x2=ak_get_gradient_xy(evt,ak_tmp_p_width,0,ak_tmp_linksoben_x,ak_tmp_width,ak_tmp_patternUnits)
ak_tmp_y2=ak_get_gradient_xy(evt,ak_tmp_p_height,0,ak_tmp_linksoben_y,ak_tmp_height,ak_tmp_patternUnits)
ak_tmp_p_width=ak_tmp_x2-ak_tmp_linksoben_x
ak_tmp_p_height=ak_tmp_y2-ak_tmp_linksoben_y
ak_tmp_x=isNaN(ak_tmp_x)?0:ak_tmp_x
ak_tmp_y=isNaN(ak_tmp_y)?0:ak_tmp_y
ak_tmp_matrix2=ak_tmp_matrix2.translate(ak_tmp_x,ak_tmp_y)
}
return ak_tmp_matrix2.multiply(ak_tmp_matrix)
}
//######################################################################################################
function ak_selection(show_hide)
{
if(ak_object2update.tagName=="marker" && /^hide/.test(show_hide)) show_hide="hide_keep_gradient"
switch(show_hide)
{
case "hide_keep_gradient":
ak_SetGetRm_styleValue(document.getElementById("ak_gradient_line1"),"visibility","visible","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_gradient_line2"),"visibility","remove","no_cout")
if(document.getElementById("ak_gradient_circle1"))
{
ak_SetGetRm_styleValue(document.getElementById("ak_gradient_circle1"),"visibility","visible","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_gradient_circle2"),"visibility","visible","no_cout")
}
ak_SetGetRm_styleValue(document.getElementById("ak_Id_tmp_edit_g"),"visibility","hidden","no_cout")
break
case "hide_keep_gradient_stop":
ak_SetGetRm_styleValue(document.getElementById("ak_gradient_line1"),"visibility","visible","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_gradient_line2"),"visibility","visible","no_cout")
if(document.getElementById("ak_gradient_circle1"))
{
ak_SetGetRm_styleValue(document.getElementById("ak_gradient_circle1"),"visibility","visible","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_gradient_circle2"),"visibility","visible","no_cout")
}
ak_SetGetRm_styleValue(document.getElementById("ak_Id_tmp_edit_g"),"visibility","hidden","no_cout")
break
case "hide_keep_control":
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_lines"),"visibility","visible","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_circles"),"visibility","visible","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_Id_tmp_edit_g"),"visibility","hidden","no_cout")
break
case "hide":
if(document.getElementById("ak_path_control_lines"))
{
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_lines"),"visibility","inherit","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_circles"),"visibility","inherit","no_cout")
}
if(document.getElementById("ak_gradient_line1"))
{
ak_SetGetRm_styleValue(document.getElementById("ak_gradient_line1"),"visibility","inherit","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_gradient_line2"),"visibility","inherit","no_cout")
}
if(document.getElementById("ak_gradient_circle1"))
{
ak_SetGetRm_styleValue(document.getElementById("ak_gradient_circle1"),"visibility","inherit","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_gradient_circle2"),"visibility","inherit","no_cout")
}
ak_SetGetRm_styleValue(document.getElementById("ak_Id_tmp_edit_g"),"visibility","hidden","no_cout")
break
case "hide_only_selection":
ak_SetGetRm_styleValue(document.getElementById("ak_Id_tmp_edit_g"),"visibility","hidden","no_cout")
break
case "show":
ak_edit_overall("hidden")
if(ak_object2update_nodeNr==-1) break
var ak_tmp=document.getElementById("ak_path_control_lines")
if(ak_tmp)
{
ak_SetGetRm_styleValue(ak_tmp,"visibility","inherit","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_circles"),"visibility","inherit","no_cout")
}
ak_tmp=document.getElementById("ak_gradient_line1")
if(ak_tmp)
{
ak_SetGetRm_styleValue(ak_tmp,"visibility","inherit","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_gradient_line2"),"visibility","inherit","no_cout")
}
ak_tmp=document.getElementById("ak_gradient_circle1")
if(ak_tmp)
{
ak_SetGetRm_styleValue(ak_tmp,"visibility","inherit","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_gradient_circle2"),"visibility","inherit","no_cout")
}
ak_rmAttribute(ak_toolObject,"visibility")
if(ak_edit_which_attribute=="xy_etc") ak_cout(ak_tagName_cout)
else if(ak_object2update.tagName()=="svg")
{
document.getElementById("ak_svg_outline").setAttribute("visibility","visible")
ak_cout(ak_tagName_cout)
}
else if(ak_edit_which_attribute=="matrix") ak_cout(ak_transform_cout)
ak_check4animates()
break
}
}
var ak_pause_flag=false;
function ak_pause(ms)
{
var ak_in_time=ak_svgroot.getCurrentTime();
var ak_out_time=ak_in_time+(ms/1000);
while (ak_in_time<ak_out_time)
{
ak_in_time=ak_svgroot.getCurrentTime();
}
}
var ak_objEdit;
var ak_objWidth;
var ak_objXY;
var ak_MoveEditRect_flag=false;
var ak_MoveEditRectX=0, ak_MoveEditRectY=0;
var ak_point_2;
var ak_EditPoint;
var ak_EditPoint_enter, ak_EditPoint_enter_r, ak_EditPoint2_enter, ak_EditPathPoints_enter, ak_EditArray_enter, ak_EditArray_MCZ;
var ak_EditPoint_BBox, ak_EditPoint_Size, ak_EditPoint_Center;
var ak_tagName_cout="";
//######################################################################################################
//######################################################################################################
var ak_mouseUp=false
function ak_SizeEditRect(evt,mouse_flag,action,point_nr)
{
if(ak_obj_data[0]=="path" && (ak_EditPoint_Size.x<=0 || ak_EditPoint_Size.y<=0)) return
var ak_tmp_prec=10000
var ak_tmp_precision=100
if (ak_edit_which_attribute=="matrix"  && ak_key_status[17]=="up" && point_nr=='1')
{ // dann wird scale gesized
var ak_tmp_restmatrix=ak_SetGetRm_transformValue(ak_object2update,"scale","get","get_restmatrix")
ak_point_2=ak_point_2.matrixTransform(ak_tmp_restmatrix)
var ak_tmp_inPoint=ak_svgroot.createSVGPoint()
ak_tmp_inPoint.x=ak_EditPoint.x
ak_tmp_inPoint.y=ak_EditPoint.y
ak_tmp_inPoint=ak_tmp_inPoint.matrixTransform(ak_tmp_restmatrix)
var ak_tmp_in=ak_scale_invalue.split(',')
ak_tmp_in[0]=parseFloat(ak_tmp_in[0])
ak_tmp_in[1]=parseFloat(ak_tmp_in[1])
var ak_point_scale=ak_svgroot.createSVGPoint()
ak_point_scale.x=ak_point_2.x/ak_tmp_inPoint.x
ak_point_scale.y=ak_point_2.y/ak_tmp_inPoint.y
if(ak_key_status[16]=="up") // dann symetrisch
{
var ak_tmp_scaleX=Math.min(Math.abs(ak_point_scale.x),Math.abs(ak_point_scale.y))
var ak_tmp_scaleY=Math.min(Math.abs(ak_point_scale.x),Math.abs(ak_point_scale.y))
if(ak_point_scale.x<0) ak_tmp_scaleX*=-1
if(ak_point_scale.y<0) ak_tmp_scaleY*=-1
}
else
{
ak_tmp_scaleX=ak_point_scale.x
ak_tmp_scaleY=ak_point_scale.y
}
ak_tmp_scaleX=ak_round(ak_tmp_scaleX*ak_tmp_in[0],ak_tmp_prec)
ak_tmp_scaleY=ak_round(ak_tmp_scaleY*ak_tmp_in[1],ak_tmp_prec)
if(ak_tmp_scaleX==0) ak_tmp_scaleX=0.0001
if(ak_tmp_scaleY==0) ak_tmp_scaleY=0.0001
ak_SetGetRm_transformValue(ak_object2update,"scale",ak_tmp_scaleX+","+ak_tmp_scaleY,"no_cout")
if(ak_mouseUp!='scale')
{
if(ak_rotate_inflag) ak_SetGetRm_transformValue(ak_object2update,"rotate",ak_rotate_invalue,'no_cout')
else ak_SetGetRm_transformValue(ak_object2update,"rotate",'remove','no_cout')
}
ak_mouseUp='scale'
return
}
if (ak_edit_which_attribute=="matrix"  && ak_key_status[17]=="up" && ak_object2update.tagName!='line')
{ // dann wird matrix gesized
if(ak_object2update.tagName=='svg')
{
var ak_tmp_2=ak_viewBox[2], ak_tmp_3=ak_viewBox[3]
var ak_bbox_center_matrized=ak_bbox_upperleft.matrixTransform(ak_object2update_CTM.inverse)
var ak_start_sizex=ak_EditPoint.x-ak_bbox_center_matrized.x
var ak_start_sizey=ak_EditPoint.y-ak_bbox_center_matrized.y
var ak_point_scale=ak_svgroot.createSVGPoint()
ak_point_scale.x=((ak_point_2.x-ak_bbox_center_matrized.x)/ak_start_sizex)
ak_point_scale.y=((ak_point_2.y-ak_bbox_center_matrized.y)/ak_start_sizey)
if(ak_key_status[16]=="up") // dann symetrisch
{
ak_point_scale.x=Math.min(Math.abs(ak_point_scale.x),Math.abs(ak_point_scale.y))
ak_point_scale.y=Math.min(Math.abs(ak_point_scale.x),Math.abs(ak_point_scale.y))
if(((ak_point_2.x-ak_bbox_center_matrized.x)/ak_start_sizex)<0) ak_point_scale.x*=-1
if(((ak_point_2.y-ak_bbox_center_matrized.y)/ak_start_sizey)<0) ak_point_scale.y*=-1
}
if(ak_point_scale.x<=0.01) ak_point_scale.x=0.01
if(ak_point_scale.y<=0.01) ak_point_scale.y=0.01
ak_viewBox[2]=ak_round(ak_viewBox[2]/ak_point_scale.x,ak_precision)
ak_viewBox[3]=ak_round(ak_viewBox[3]/ak_point_scale.y,ak_precision)
ak_object2update.setAttribute('viewBox',ak_viewBox.join(' '))
ak_transform_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'viewBox','preserveAspectRatio')
ak_cout(ak_transform_cout)
ak_viewBox[2]=ak_tmp_2
ak_viewBox[3]=ak_tmp_3
}
else
{
var ak_bbox_center_matrized=ak_bbox_center.matrixTransform(ak_object2update_CTM.inverse)
var ak_start_sizex=ak_EditPoint.x-ak_bbox_center_matrized.x
var ak_start_sizey=ak_EditPoint.y-ak_bbox_center_matrized.y
var ak_point_scale=ak_svgroot.createSVGPoint()
ak_point_scale.x=((ak_point_2.x-ak_bbox_center_matrized.x)/ak_start_sizex)
ak_point_scale.y=((ak_point_2.y-ak_bbox_center_matrized.y)/ak_start_sizey)
if(ak_key_status[16]=="up") // dann symetrisch
{
ak_point_scale.x=Math.min(Math.abs(ak_point_scale.x),Math.abs(ak_point_scale.y))
ak_point_scale.y=Math.min(Math.abs(ak_point_scale.x),Math.abs(ak_point_scale.y))
if(((ak_point_2.x-ak_bbox_center_matrized.x)/ak_start_sizex)<0) ak_point_scale.x*=-1
if(((ak_point_2.y-ak_bbox_center_matrized.y)/ak_start_sizey)<0) ak_point_scale.y*=-1
}
var ak_tmp_restmatrix=ak_SetGetRm_transformValue(ak_object2update,"matrix","get","get_restmatrix")
var ak_tmp_matrix_split=ak_matrix_invalue.split(",")
var ak_tmp_matrix2=ak_svgroot.createSVGMatrix()
for (var i=0;i<6;i++)
{
ak_tmp_matrix_split[i]=parseFloat(ak_tmp_matrix_split[i])
}
ak_tmp_matrix2.a=ak_tmp_matrix_split[0]
ak_tmp_matrix2.b=ak_tmp_matrix_split[1]
ak_tmp_matrix2.c=ak_tmp_matrix_split[2]
ak_tmp_matrix2.d=ak_tmp_matrix_split[3]
ak_tmp_matrix2.e=ak_tmp_matrix_split[4]
ak_tmp_matrix2.f=ak_tmp_matrix_split[5]
ak_tmp_matrix2=ak_tmp_matrix2.multiply(ak_tmp_restmatrix)
ak_tmp_matrix2=ak_tmp_matrix2.translate(ak_bbox_center_translate.x,ak_bbox_center_translate.y)
ak_tmp_matrix2=ak_tmp_matrix2.scaleNonUniform(ak_point_scale.x,ak_point_scale.y)
ak_tmp_matrix2=ak_tmp_matrix2.translate(-ak_bbox_center_translate.x,-ak_bbox_center_translate.y)
try {ak_tmp_matrix2=ak_tmp_matrix2.multiply(ak_tmp_restmatrix.inverse)}
catch (error){return} // falls scale 0 dann nicht invertable und zurueck
var ak_tmp_out=new Array
ak_tmp_out[0]=ak_round(ak_tmp_matrix2.a,ak_tmp_prec)
ak_tmp_out[1]=ak_round(ak_tmp_matrix2.b,ak_tmp_prec)
ak_tmp_out[2]=ak_round(ak_tmp_matrix2.c,ak_tmp_prec)
ak_tmp_out[3]=ak_round(ak_tmp_matrix2.d,ak_tmp_prec)
ak_tmp_out[4]=ak_round(ak_tmp_matrix2.e,ak_tmp_precision)
ak_tmp_out[5]=ak_round(ak_tmp_matrix2.f,ak_tmp_precision)
if(ak_tmp_out[1]==0 || ak_tmp_out[2]==0)
{
if(ak_tmp_out[0]==0) ak_tmp_out[0]=0.0001
if(ak_tmp_out[3]==0) ak_tmp_out[3]=0.0001
}
ak_SetGetRm_transformValue(ak_object2update,"matrix",ak_tmp_out.join(),"no_cout")
}
return
}
if(ak_edit_which_attribute=="matrix" && point_nr=="1" && ak_key_status[17]=="down")
{ // dann rotate
if(ak_mouseUp!='rotate') ak_objRotateCenterPoint.setAttribute("visibility","visible")
var ak_tmp_in=ak_rotate_invalue.split(',')
ak_tmp_in[0]=parseFloat(ak_tmp_in[0])
ak_tmp_in[1]=parseFloat(ak_tmp_in[1])
ak_tmp_in[2]=parseFloat(ak_tmp_in[2])
var ak_tmp_inPoint=ak_svgroot.createSVGPoint()
ak_tmp_inPoint.x=ak_tmp_in[1]
ak_tmp_inPoint.y=ak_tmp_in[2]
var ak_tmp_restmatrix=ak_SetGetRm_transformValue(ak_object2update,"rotate","get","get_restmatrix")
ak_tmp_restmatrix=ak_object2update_CTM.multiply(ak_tmp_restmatrix.inverse)
ak_tmp_inPoint=ak_tmp_inPoint.matrixTransform(ak_tmp_restmatrix)
var ak_tmp_angle_in=Math.atan2(ak_PanInPointy-ak_tmp_inPoint.y,ak_PanInPointx-ak_tmp_inPoint.x)
var ak_tmp_angle_out=Math.atan2(ak_point_2_pany-ak_tmp_inPoint.y,ak_point_2_panx-ak_tmp_inPoint.x)
ak_tmp_angle_out-=ak_tmp_angle_in
ak_tmp_angle_out=(ak_tmp_angle_out*180)/Math.PI
if((ak_tmp_restmatrix.a>=0 && ak_tmp_restmatrix.d<0) || (ak_tmp_restmatrix.a<0 && ak_tmp_restmatrix.d>=0))ak_tmp_angle_out*=-1
if(ak_tmp_angle_out<-180) ak_tmp_angle_out+=360
if(ak_tmp_angle_out>180) ak_tmp_angle_out-=360
ak_tmp_angle_out=ak_round(ak_tmp_angle_out+ak_tmp_in[0],ak_precision)
if(ak_mouseUp!='rotate')
{
if(ak_scale_inflag) ak_SetGetRm_transformValue(ak_object2update,"scale",ak_scale_invalue,'no_cout')
else ak_SetGetRm_transformValue(ak_object2update,"scale",'remove','no_cout')
}
ak_SetGetRm_transformValue(ak_object2update,"rotate",ak_tmp_angle_out+','+ak_tmp_in[1]+','+ak_tmp_in[2],"no_cout")
ak_mouseUp='rotate'
return
}
if(ak_edit_which_attribute=="matrix" && ak_key_status[16]=="up" && ak_key_status[17]=="down")
{ // dann matrix rotate
var ak_start_angle=Math.acos((ak_PanInPointx-ak_bbox_center.x)/Math.pow((Math.pow((ak_PanInPointx-ak_bbox_center.x),2)+Math.pow((ak_PanInPointy-ak_bbox_center.y),2)),0.5))
ak_start_angle=ak_start_angle*(180/Math.PI)
if (ak_PanInPointy>ak_bbox_center.y) ak_start_angle*=-1
var ak_edit_angle=Math.acos((ak_point_2_panx-ak_bbox_center.x)/Math.pow((Math.pow((ak_point_2_panx-ak_bbox_center.x),2)+Math.pow((ak_point_2_pany-ak_bbox_center.y),2)),0.5))
ak_edit_angle=ak_edit_angle*(180/Math.PI)
if (ak_point_2_pany>ak_bbox_center.y) ak_edit_angle*=-1
ak_edit_angle-=ak_start_angle
var ak_tmp_restmatrix=ak_SetGetRm_transformValue(ak_object2update,"matrix","get","get_restmatrix")
var ak_tmp_matrix_split=ak_matrix_invalue.split(",")
var ak_tmp_matrix2=ak_svgroot.createSVGMatrix()
for (var i=0;i<6;i++)
{
ak_tmp_matrix_split[i]=parseFloat(ak_tmp_matrix_split[i])
}
ak_tmp_matrix2.a=ak_tmp_matrix_split[0]
ak_tmp_matrix2.b=ak_tmp_matrix_split[1]
ak_tmp_matrix2.c=ak_tmp_matrix_split[2]
ak_tmp_matrix2.d=ak_tmp_matrix_split[3]
ak_tmp_matrix2.e=ak_tmp_matrix_split[4]
ak_tmp_matrix2.f=ak_tmp_matrix_split[5]
if((ak_object2update_CTM.a>=0 && ak_object2update_CTM.d>=0) || (ak_object2update_CTM.a<0 && ak_object2update_CTM.d<0))ak_edit_angle*=-1
//if((ak_object2update_CTM.a*ak_object2update_CTM.d*ak_object2update_CTM.a*ak_object2update_CTM.d>=0))ak_edit_angle*=-1
ak_tmp_matrix2=ak_tmp_matrix2.multiply(ak_tmp_restmatrix)
ak_tmp_matrix2=ak_tmp_matrix2.translate(ak_bbox_center_translate.x,ak_bbox_center_translate.y)
ak_tmp_matrix2=ak_tmp_matrix2.rotate(ak_edit_angle)
ak_tmp_matrix2=ak_tmp_matrix2.translate(-ak_bbox_center_translate.x,-ak_bbox_center_translate.y)
try {ak_tmp_matrix2=ak_tmp_matrix2.multiply(ak_tmp_restmatrix.inverse)}
catch (error){return} // falls scale 0 dann nicht invertable und zurueck
var ak_tmp_out=new Array
ak_tmp_out[0]=ak_round(ak_tmp_matrix2.a,ak_tmp_prec)
ak_tmp_out[1]=ak_round(ak_tmp_matrix2.b,ak_tmp_prec)
ak_tmp_out[2]=ak_round(ak_tmp_matrix2.c,ak_tmp_prec)
ak_tmp_out[3]=ak_round(ak_tmp_matrix2.d,ak_tmp_prec)
ak_tmp_out[4]=ak_round(ak_tmp_matrix2.e,ak_tmp_precision)
ak_tmp_out[5]=ak_round(ak_tmp_matrix2.f,ak_tmp_precision)
if(ak_tmp_out[1]==0 || ak_tmp_out[2]==0)
{
if(ak_tmp_out[0]==0) ak_tmp_out[0]=0.0001
if(ak_tmp_out[3]==0) ak_tmp_out[3]=0.0001
}
ak_SetGetRm_transformValue(ak_object2update,"matrix",ak_tmp_out.join(),"no_cout")
return
}
if(ak_edit_which_attribute=="xy_etc" && ak_key_status[16]=="up" && ak_key_status[17]=="down" && ak_obj_data[0]=="path")
{ // path points rotieren
var ak_start_angle=Math.acos((ak_PanInPointx-ak_bbox_center.x)/Math.pow((Math.pow((ak_PanInPointx-ak_bbox_center.x),2)+Math.pow((ak_PanInPointy-ak_bbox_center.y),2)),0.5))
ak_start_angle=ak_start_angle*(180/Math.PI)
if (ak_PanInPointy>ak_bbox_center.y) ak_start_angle*=-1
var ak_edit_angle=Math.acos((ak_point_2_panx-ak_bbox_center.x)/Math.pow((Math.pow((ak_point_2_panx-ak_bbox_center.x),2)+Math.pow((ak_point_2_pany-ak_bbox_center.y),2)),0.5))
ak_edit_angle=ak_edit_angle*(180/Math.PI)
if (ak_point_2_pany>ak_bbox_center.y) ak_edit_angle*=-1
ak_edit_angle-=ak_start_angle
if((ak_object2update_CTM.a>=0 && ak_object2update_CTM.d<0) || (ak_object2update_CTM.a<0 && ak_object2update_CTM.d>=0))ak_edit_angle*=-1
var ak_rotate_matrix=ak_svgroot.createSVGMatrix()
ak_rotate_matrix=ak_rotate_matrix.rotate(-ak_edit_angle)
var ak_bbox_center_matrized=ak_bbox_center.matrixTransform(ak_object2update_CTM.inverse)
var ak_tmp_point_2rotate=ak_svgroot.createSVGPoint()
if(ak_path_attr)
{
ak_bbox_center_matrized.x=ak_path_attr_enter[3]
ak_bbox_center_matrized.y=ak_path_attr_enter[4]
}
for(var i=0;i<ak_EditArray_enter.length;i++)
{
switch (ak_EditArray_enter[i])
{
case "M":
ak_tmp_point_2rotate.x=(ak_EditArray_enter[i+1]-ak_bbox_center_matrized.x)
ak_tmp_point_2rotate.y=(ak_EditArray_enter[i+2]-ak_bbox_center_matrized.y)
ak_tmp_point_2rotate=ak_tmp_point_2rotate.matrixTransform(ak_rotate_matrix)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.x+ak_bbox_center_matrized.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.y+ak_bbox_center_matrized.y),ak_tmp_precision)
break
case "C":
ak_tmp_point_2rotate.x=(ak_EditArray_enter[i+1]-ak_bbox_center_matrized.x)
ak_tmp_point_2rotate.y=(ak_EditArray_enter[i+2]-ak_bbox_center_matrized.y)
ak_tmp_point_2rotate=ak_tmp_point_2rotate.matrixTransform(ak_rotate_matrix)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.x+ak_bbox_center_matrized.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.y+ak_bbox_center_matrized.y),ak_tmp_precision)
ak_tmp_point_2rotate.x=(ak_EditArray_enter[i+1]-ak_bbox_center_matrized.x)
ak_tmp_point_2rotate.y=(ak_EditArray_enter[i+2]-ak_bbox_center_matrized.y)
ak_tmp_point_2rotate=ak_tmp_point_2rotate.matrixTransform(ak_rotate_matrix)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.x+ak_bbox_center_matrized.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.y+ak_bbox_center_matrized.y),ak_tmp_precision)
ak_tmp_point_2rotate.x=(ak_EditArray_enter[i+1]-ak_bbox_center_matrized.x)
ak_tmp_point_2rotate.y=(ak_EditArray_enter[i+2]-ak_bbox_center_matrized.y)
ak_tmp_point_2rotate=ak_tmp_point_2rotate.matrixTransform(ak_rotate_matrix)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.x+ak_bbox_center_matrized.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.y+ak_bbox_center_matrized.y),ak_tmp_precision)
break
case "L":
ak_tmp_point_2rotate.x=(ak_EditArray_enter[i+1]-ak_bbox_center_matrized.x)
ak_tmp_point_2rotate.y=(ak_EditArray_enter[i+2]-ak_bbox_center_matrized.y)
ak_tmp_point_2rotate=ak_tmp_point_2rotate.matrixTransform(ak_rotate_matrix)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.x+ak_bbox_center_matrized.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.y+ak_bbox_center_matrized.y),ak_tmp_precision)
break
case "Q":
ak_tmp_point_2rotate.x=(ak_EditArray_enter[i+1]-ak_bbox_center_matrized.x)
ak_tmp_point_2rotate.y=(ak_EditArray_enter[i+2]-ak_bbox_center_matrized.y)
ak_tmp_point_2rotate=ak_tmp_point_2rotate.matrixTransform(ak_rotate_matrix)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.x+ak_bbox_center_matrized.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.y+ak_bbox_center_matrized.y),ak_tmp_precision)
ak_tmp_point_2rotate.x=(ak_EditArray_enter[i+1]-ak_bbox_center_matrized.x)
ak_tmp_point_2rotate.y=(ak_EditArray_enter[i+2]-ak_bbox_center_matrized.y)
ak_tmp_point_2rotate=ak_tmp_point_2rotate.matrixTransform(ak_rotate_matrix)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.x+ak_bbox_center_matrized.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.y+ak_bbox_center_matrized.y),ak_tmp_precision)
break
case "A":
i=i+3; ak_EditArray_work[i]=ak_round(ak_EditArray_enter[i]-ak_edit_angle,ak_tmp_precision)
i=i+2
ak_tmp_point_2rotate.x=(ak_EditArray_enter[i+1]-ak_bbox_center_matrized.x)
ak_tmp_point_2rotate.y=(ak_EditArray_enter[i+2]-ak_bbox_center_matrized.y)
ak_tmp_point_2rotate=ak_tmp_point_2rotate.matrixTransform(ak_rotate_matrix)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.x+ak_bbox_center_matrized.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.y+ak_bbox_center_matrized.y),ak_tmp_precision)
break
}
}
if(ak_path_attr)
{
var ak_tmp_array=new Array
for(var i=0;i<ak_EditArray_work.length;i++)
{
if(/[A]/.test(ak_EditArray_work[i]))
{
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[3],ak_tmp_precision); i++
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[4],ak_tmp_precision)
}
else if(!isNaN(ak_EditArray_enter[i]))
{
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[3],ak_tmp_precision); i++
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[4],ak_tmp_precision)
}
else ak_tmp_array[i]=ak_EditArray_work[i]
}
ak_path_attr[2]=ak_tmp_array.join(" ")
ak_object2update.setAttribute("d",ak_path_create())
ak_object2update.setAttribute("ak_path",ak_path_attr.join(";"))
ak_tagName_cout=ak_tagName_start+' ak_path="'+ak_path_attr.join(";")+'"'
if (ak_tagName_cout.length>124) ak_tagName_cout=ak_tagName_cout.substring(0,120)+" ..."
ak_cout(ak_tagName_cout)
}
else
{
ak_obj_data[19]=ak_EditArray_work.join(" ")
ak_object2update.setAttribute("d",ak_obj_data[19])
ak_tagName_cout=ak_tagName_start+' d="'+ak_obj_data[19]+'"'
if (ak_tagName_cout.length>124) ak_tagName_cout=ak_tagName_cout.substring(0,120)+" ..."
//ak_cout(ak_tagName_cout)
}
return
}
if((ak_obj_data[0]=="polyline" || ak_obj_data[0]=="polygon") && ak_edit_which_attribute=="xy_etc" && ak_key_status[16]=="up" && ak_key_status[17]=="down")
{ // polyline oder polygon points rotieren
var ak_start_angle=Math.acos((ak_PanInPointx-ak_bbox_center.x)/Math.pow((Math.pow((ak_PanInPointx-ak_bbox_center.x),2)+Math.pow((ak_PanInPointy-ak_bbox_center.y),2)),0.5))
ak_start_angle=ak_start_angle*(180/Math.PI)
if (ak_PanInPointy>ak_bbox_center.y) ak_start_angle*=-1
var ak_edit_angle=Math.acos((ak_point_2_panx-ak_bbox_center.x)/Math.pow((Math.pow((ak_point_2_panx-ak_bbox_center.x),2)+Math.pow((ak_point_2_pany-ak_bbox_center.y),2)),0.5))
ak_edit_angle=ak_edit_angle*(180/Math.PI)
if (ak_point_2_pany>ak_bbox_center.y) ak_edit_angle*=-1
ak_edit_angle-=ak_start_angle
if((ak_object2update_CTM.a>=0 && ak_object2update_CTM.d<0) || (ak_object2update_CTM.a<0 && ak_object2update_CTM.d>=0))ak_edit_angle*=-1
var ak_rotate_matrix=ak_svgroot.createSVGMatrix()
ak_rotate_matrix=ak_rotate_matrix.rotate(-ak_edit_angle)
var ak_bbox_center_matrized=ak_bbox_center.matrixTransform(ak_object2update_CTM.inverse)
var ak_tmp_point_2rotate=ak_svgroot.createSVGPoint()
for(var i=0;i<ak_EditArray_enter.length;i+=2)
{
ak_tmp_point_2rotate.x=(ak_EditArray_enter[i]-ak_bbox_center_matrized.x)
ak_tmp_point_2rotate.y=(ak_EditArray_enter[i+1]-ak_bbox_center_matrized.y)
ak_tmp_point_2rotate=ak_tmp_point_2rotate.matrixTransform(ak_rotate_matrix)
ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.x+ak_bbox_center_matrized.x),ak_tmp_precision)
ak_EditArray_work[i+1]=ak_round((ak_tmp_point_2rotate.y+ak_bbox_center_matrized.y),ak_tmp_precision)
}
ak_obj_data[18]=ak_EditArray_work.join(" ")
ak_object2update.setAttribute("points",ak_obj_data[18]);
ak_tagName_cout=ak_tagName_start+' points="'+ak_obj_data[18]+'"';
if (ak_tagName_cout.length>124) ak_tagName_cout=ak_tagName_cout.substring(0,120)+" ...";
//ak_cout(ak_tagName_cout);
return
}
// dann xy size ####################
switch(ak_obj_data[0])
{
case "line":
ak_obj_data[8]=ak_round(parseFloat(ak_EditPoint2_enter.x+ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
ak_obj_data[9]=ak_round(parseFloat(ak_EditPoint2_enter.y+ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
ak_object2update.setAttribute("x2",ak_obj_data[8])
ak_object2update.setAttribute("y2",ak_obj_data[9])
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'x1','y1','x2','y2')
break;
case "rect":
if((ak_rect_symetricOnShift && evt.shiftKey()) || (!ak_rect_symetricOnShift && !evt.shiftKey()))
{
if(ak_EditPoint_Size.x<=1) ak_EditPoint_Size.x=1
if(ak_EditPoint_Size.y<=1) ak_EditPoint_Size.y=1
if (((ak_point_2.x-ak_EditPoint.x+ak_EditPoint_Size.x)/ak_EditPoint_Size.x)<((ak_point_2.y-ak_EditPoint.y+ak_EditPoint_Size.y)/ak_EditPoint_Size.y))
{
ak_obj_data[4]=ak_round((ak_EditPoint_Size.x+ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
ak_obj_data[5]=ak_round(ak_obj_data[4]*(ak_EditPoint_Size.y/ak_EditPoint_Size.x),ak_tmp_precision)
}
else
{
ak_obj_data[5]=ak_round((ak_EditPoint_Size.y+ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
ak_obj_data[4]=ak_round(ak_obj_data[5]*(ak_EditPoint_Size.x/ak_EditPoint_Size.y),ak_tmp_precision)
}
}
else
{
ak_obj_data[4]=ak_round((ak_EditPoint_Size.x+ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
ak_obj_data[5]=ak_round((ak_EditPoint_Size.y+ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
}
if (ak_obj_data[4]<0) ak_obj_data[4]=0
if (ak_obj_data[5]<0) ak_obj_data[5]=0
ak_object2update.setAttribute("width",ak_obj_data[4])
ak_object2update.setAttribute("height",ak_obj_data[5])
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'x','y','width','height','rx','ry')
break
case "image":
if(ak_EditPoint_Size.x<=0) ak_EditPoint_Size.x=0.01
if(ak_EditPoint_Size.y<=0) ak_EditPoint_Size.y=0.01
if(!evt.shiftKey())
{
if (((ak_point_2.x-ak_EditPoint.x+ak_EditPoint_Size.x)/ak_EditPoint_Size.x)<((ak_point_2.y-ak_EditPoint.y+ak_EditPoint_Size.y)/ak_EditPoint_Size.y))
{
ak_obj_data[4]=ak_round((ak_EditPoint_Size.x+ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
if (ak_obj_data[4]<=1) ak_obj_data[4]=1
ak_obj_data[5]=ak_round(ak_obj_data[4]*(ak_EditPoint_Size.y/ak_EditPoint_Size.x),ak_tmp_precision)
}
else
{
ak_obj_data[5]=ak_round((ak_EditPoint_Size.y+ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
if (ak_obj_data[5]<=1) ak_obj_data[5]=1
ak_obj_data[4]=ak_round(ak_obj_data[5]*(ak_EditPoint_Size.x/ak_EditPoint_Size.y),ak_tmp_precision)
}
}
else
{
ak_obj_data[4]=ak_round((ak_EditPoint_Size.x+ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
ak_obj_data[5]=ak_round((ak_EditPoint_Size.y+ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
if (ak_obj_data[4]<=1) ak_obj_data[4]=1
if (ak_obj_data[5]<=1) ak_obj_data[5]=1
}
ak_object2update.setAttribute("width",ak_obj_data[4])
ak_object2update.setAttribute("height",ak_obj_data[5])
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'x','y','width','height')
break
case "circle":
if ((ak_point_2.x-ak_EditPoint.x)<(ak_point_2.y-ak_EditPoint.y))
{
ak_obj_data[12]=ak_round((ak_EditPoint_Size.x/2)+(ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
}
else
{
ak_obj_data[12]=ak_round((ak_EditPoint_Size.y/2)+(ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
}
if (ak_obj_data[12]<0) ak_obj_data[12]=0
ak_object2update.setAttribute("r",ak_obj_data[12])
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'cx','cy','r')
break
case "ellipse":
if((ak_rect_symetricOnShift && evt.shiftKey()) || (!ak_rect_symetricOnShift && !evt.shiftKey()))
{
if(ak_EditPoint_Size.x<=1) ak_EditPoint_Size.x=1
if(ak_EditPoint_Size.y<=1) ak_EditPoint_Size.y=1
if (((ak_point_2.x-ak_EditPoint.x+ak_EditPoint_Size.x)/ak_EditPoint_Size.x)<((ak_point_2.y-ak_EditPoint.y+ak_EditPoint_Size.y)/ak_EditPoint_Size.y))
{
ak_obj_data[13]=ak_round((ak_EditPoint_Size.x/2)+(ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
ak_obj_data[14]=ak_round(ak_obj_data[13]*(ak_EditPoint_Size.y/ak_EditPoint_Size.x),ak_tmp_precision)
}
else
{
ak_obj_data[14]=ak_round((ak_EditPoint_Size.y/2)+(ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
ak_obj_data[13]=ak_round(ak_obj_data[14]*(ak_EditPoint_Size.x/ak_EditPoint_Size.y),ak_tmp_precision)
}
}
else
{
ak_obj_data[13]=ak_round((ak_EditPoint_Size.x/2)+(ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
ak_obj_data[14]=ak_round((ak_EditPoint_Size.y/2)+(ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
}
if (ak_obj_data[13]<0) ak_obj_data[13]=0
if (ak_obj_data[14]<0) ak_obj_data[14]=0
ak_object2update.setAttribute("rx",ak_obj_data[13])
ak_object2update.setAttribute("ry",ak_obj_data[14])
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'cx','cy','rx','ry')
break
case "polyline":
case "polygon":
var ak_point_delta=ak_svgroot.createSVGPoint()
ak_point_delta.x=ak_point_2.x-ak_EditPoint.x
ak_point_delta.y=ak_point_2.y-ak_EditPoint.y
var ak_um_die_mitte=2 // 1 = Ecke bleibt, 2 = Mitte bleibt
var ak_point_scale=ak_svgroot.createSVGPoint()
ak_point_scale.x=((ak_EditPoint_Size.x/ak_um_die_mitte)+ak_point_delta.x)/(ak_EditPoint_Size.x/ak_um_die_mitte)
ak_point_scale.y=((ak_EditPoint_Size.y/ak_um_die_mitte)+ak_point_delta.y)/(ak_EditPoint_Size.y/ak_um_die_mitte)
if(ak_key_status[16]=="up") // dann symetrisch
{
ak_point_scale.x=Math.min(Math.abs(ak_point_scale.x),Math.abs(ak_point_scale.y))
ak_point_scale.y=Math.min(Math.abs(ak_point_scale.x),Math.abs(ak_point_scale.y))
if(((ak_EditPoint_Size.x/ak_um_die_mitte)+ak_point_delta.x)/(ak_EditPoint_Size.x/ak_um_die_mitte)<0) ak_point_scale.x*=-1
if(((ak_EditPoint_Size.y/ak_um_die_mitte)+ak_point_delta.y)/(ak_EditPoint_Size.y/ak_um_die_mitte)<0) ak_point_scale.y*=-1
}
var ak_point_bezug=ak_svgroot.createSVGPoint()
if(ak_um_die_mitte==1)
{
ak_point_bezug.x=ak_EditPoint_BBox.x
ak_point_bezug.y=ak_EditPoint_BBox.y
}
else
{
ak_point_bezug.x=ak_EditPoint_BBox.x+(ak_EditPoint_Size.x/2)
ak_point_bezug.y=ak_EditPoint_BBox.y+(ak_EditPoint_Size.y/2)
}
for(var i=0;i<ak_EditArray_enter.length;i+=2)
{
ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.x)*ak_point_scale.x)+ak_point_bezug.x),ak_tmp_precision)
ak_EditArray_work[i+1]=ak_round((((ak_EditArray_enter[i+1]-ak_point_bezug.y)*ak_point_scale.y)+ak_point_bezug.y),ak_tmp_precision)
}
ak_obj_data[18]=ak_EditArray_work.join(" ")
ak_object2update.setAttribute("points",ak_obj_data[18]);
ak_tagName_cout=ak_tagName_start+' points="'+ak_obj_data[18]+'"';
if (ak_tagName_cout.length>124) ak_tagName_cout=ak_tagName_cout.substring(0,120)+" ...";
break
case "path":
var ak_point_delta=ak_svgroot.createSVGPoint()
ak_point_delta.x=ak_point_2.x-ak_EditPoint.x
ak_point_delta.y=ak_point_2.y-ak_EditPoint.y
var ak_um_die_mitte=2 // 1 = Ecke bleibt, 2 = Mitte bleibt
var ak_point_scale=ak_svgroot.createSVGPoint()
ak_point_scale.x=((ak_EditPoint_Size.x/ak_um_die_mitte)+ak_point_delta.x)/(ak_EditPoint_Size.x/ak_um_die_mitte)
ak_point_scale.y=((ak_EditPoint_Size.y/ak_um_die_mitte)+ak_point_delta.y)/(ak_EditPoint_Size.y/ak_um_die_mitte)
if(ak_key_status[16]=="up") // dann symetrisch
{
ak_point_scale.x=Math.min(Math.abs(ak_point_scale.x),Math.abs(ak_point_scale.y))
ak_point_scale.y=Math.min(Math.abs(ak_point_scale.x),Math.abs(ak_point_scale.y))
if(((ak_EditPoint_Size.x/ak_um_die_mitte)+ak_point_delta.x)/(ak_EditPoint_Size.x/ak_um_die_mitte)<0) ak_point_scale.x*=-1
if(((ak_EditPoint_Size.y/ak_um_die_mitte)+ak_point_delta.y)/(ak_EditPoint_Size.y/ak_um_die_mitte)<0) ak_point_scale.y*=-1
}
var ak_point_bezug=ak_svgroot.createSVGPoint()
if(ak_um_die_mitte==1)
{
ak_point_bezug.x=ak_EditPoint_BBox.x
ak_point_bezug.y=ak_EditPoint_BBox.y
}
else
{
ak_point_bezug.x=ak_EditPoint_BBox.x+(ak_EditPoint_Size.x/2)
ak_point_bezug.y=ak_EditPoint_BBox.y+(ak_EditPoint_Size.y/2)
}
if(ak_path_attr)
{
ak_point_bezug.x=ak_path_attr_enter[3]
ak_point_bezug.y=ak_path_attr_enter[4]
}
for(var i=0;i<ak_EditArray_enter.length;i++)
{
switch (ak_EditArray_enter[i])
{
case "M":
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.x)*ak_point_scale.x)+ak_point_bezug.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.y)*ak_point_scale.y)+ak_point_bezug.y),ak_tmp_precision)
break
case "C":
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.x)*ak_point_scale.x)+ak_point_bezug.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.y)*ak_point_scale.y)+ak_point_bezug.y),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.x)*ak_point_scale.x)+ak_point_bezug.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.y)*ak_point_scale.y)+ak_point_bezug.y),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.x)*ak_point_scale.x)+ak_point_bezug.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.y)*ak_point_scale.y)+ak_point_bezug.y),ak_tmp_precision)
break
case "L":
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.x)*ak_point_scale.x)+ak_point_bezug.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.y)*ak_point_scale.y)+ak_point_bezug.y),ak_tmp_precision)
break
case "Q":
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.x)*ak_point_scale.x)+ak_point_bezug.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.y)*ak_point_scale.y)+ak_point_bezug.y),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.x)*ak_point_scale.x)+ak_point_bezug.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.y)*ak_point_scale.y)+ak_point_bezug.y),ak_tmp_precision)
break
case "A":
if(ak_point_scale.x<0 && ak_point_scale.y>=0 && ak_EditArray_enter[i+5]==0) ak_EditArray_work[i+5]=1
else if(ak_point_scale.x>=0 && ak_point_scale.y<0 && ak_EditArray_enter[i+5]==0) ak_EditArray_work[i+5]=1
else if(ak_point_scale.x<0 && ak_point_scale.y>=0 && ak_EditArray_enter[i+5]==1) ak_EditArray_work[i+5]=0
else if(ak_point_scale.x>=0 && ak_point_scale.y<0 && ak_EditArray_enter[i+5]==1) ak_EditArray_work[i+5]=0
else ak_EditArray_work[i+5]=ak_EditArray_enter[i+5]
i=i+6; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.x)*ak_point_scale.x)+ak_point_bezug.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.y)*ak_point_scale.y)+ak_point_bezug.y),ak_tmp_precision)
break
case "S":
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.x)*ak_point_scale.x)+ak_point_bezug.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.y)*ak_point_scale.y)+ak_point_bezug.y),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.x)*ak_point_scale.x)+ak_point_bezug.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.y)*ak_point_scale.y)+ak_point_bezug.y),ak_tmp_precision)
break
case "T":
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.x)*ak_point_scale.x)+ak_point_bezug.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.y)*ak_point_scale.y)+ak_point_bezug.y),ak_tmp_precision)
break
case "H":
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.x)*ak_point_scale.x)+ak_point_bezug.x),ak_tmp_precision)
break
case "V":
i++; ak_EditArray_work[i]=ak_round((((ak_EditArray_enter[i]-ak_point_bezug.y)*ak_point_scale.y)+ak_point_bezug.y),ak_tmp_precision)
break
}
}
if(ak_path_attr)
{
var ak_tmp_array=new Array
for(var i=0;i<ak_EditArray_work.length;i++)
{
if(/[A]/.test(ak_EditArray_work[i]))
{
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[3],ak_tmp_precision); i++
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[4],ak_tmp_precision)
}
else if(!isNaN(ak_EditArray_enter[i]))
{
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[3],ak_tmp_precision); i++
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[4],ak_tmp_precision)
}
else ak_tmp_array[i]=ak_EditArray_work[i]
}
ak_path_attr[2]=ak_tmp_array.join(" ")
ak_object2update.setAttribute("d",ak_path_create())
ak_object2update.setAttribute("ak_path",ak_path_attr.join(";"))
ak_tagName_cout=ak_tagName_start+' ak_path="'+ak_path_attr.join(";")+'"'
if (ak_tagName_cout.length>124) ak_tagName_cout=ak_tagName_cout.substring(0,120)+" ..."
}
else
{
ak_obj_data[19]=ak_EditArray_work.join(" ")
ak_object2update.setAttribute("d",ak_obj_data[19]);
ak_tagName_cout=ak_tagName_start+' d="'+ak_obj_data[19]+'"';
if (ak_tagName_cout.length>124) ak_tagName_cout=ak_tagName_cout.substring(0,120)+" ..."
}
break
case "svg":
if((ak_rect_symetricOnShift && evt.shiftKey()) || (!ak_rect_symetricOnShift && !evt.shiftKey()))
{
if(ak_EditPoint_Size.x<=1) ak_EditPoint_Size.x=1
if(ak_EditPoint_Size.y<=1) ak_EditPoint_Size.y=1
if (((ak_point_2.x-ak_EditPoint.x+ak_EditPoint_Size.x)/ak_EditPoint_Size.x)<((ak_point_2.y-ak_EditPoint.y+ak_EditPoint_Size.y)/ak_EditPoint_Size.y))
{
ak_obj_data[4]=parseInt((ak_EditPoint_Size.x+ak_point_2.x-ak_EditPoint.x))
ak_obj_data[5]=parseInt(ak_obj_data[4]*(ak_EditPoint_Size.y/ak_EditPoint_Size.x))
}
else
{
ak_obj_data[5]=parseInt((ak_EditPoint_Size.y+ak_point_2.y-ak_EditPoint.y))
ak_obj_data[4]=parseInt(ak_obj_data[5]*(ak_EditPoint_Size.x/ak_EditPoint_Size.y))
}
}
else
{
ak_obj_data[4]=parseInt((ak_EditPoint_Size.x+ak_point_2.x-ak_EditPoint.x))
ak_obj_data[5]=parseInt((ak_EditPoint_Size.y+ak_point_2.y-ak_EditPoint.y))
}
document.getElementById('ak_svg_outline').setAttribute('width',ak_obj_data[4])
document.getElementById('ak_svg_outline').setAttribute('height',ak_obj_data[5])
if(ak_obj_data[4]<=0)
{
if(ak_xyPercent[4]) ak_object2update.setAttribute("width","0%")
else ak_object2update.setAttribute("width","0")
}
else if(ak_xyPercent[4])
{
ak_obj_data[4]=ak_round((ak_EditPoint_Size.x+(ak_point_2.x-ak_EditPoint.x))*100/ak_parentSVG_width,ak_tmp_precision)+'%'
ak_object2update.setAttribute("width",ak_obj_data[4])
}
else ak_object2update.setAttribute("width",ak_obj_data[4])
if(ak_obj_data[5]<=0)
{
if(ak_xyPercent[5]) ak_object2update.setAttribute("height","0%")
else ak_object2update.setAttribute("height","0")
}
else if(ak_xyPercent[5])
{
ak_obj_data[5]=ak_round((ak_EditPoint_Size.y+(ak_point_2.y-ak_EditPoint.y))*100/ak_parentSVG_height,ak_tmp_precision)+'%'
ak_object2update.setAttribute("height",ak_obj_data[5])
}
else ak_object2update.setAttribute("height",ak_obj_data[5])
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'x','y','width','height','viewBox','preserveAspectRatio')
break
}
//if (ak_tagName_cout.length>124) ak_tagName_cout=ak_tagName_cout.substring(0,120)+" ...";
//ak_cout(ak_tagName_cout);
}
var ak_rect_symetricOnShift=true
//######################################################################################################
//######################################################################################################
function ak_edit_translateMatrix(evt,point_nr) // wie es mal war
{
if (ak_edit_which_attribute=="matrix" && point_nr!="1") 
//if (ak_edit_which_attribute=="matrix" && ak_rotate_action_down=="up" && point_nr!="1") 
{
if(ak_object2update.tagName=='svg')
{
var ak_tmp_0=ak_viewBox[0], ak_tmp_1=ak_viewBox[1]
ak_viewBox[0]=ak_round(ak_viewBox[0]-((ak_point_2.x-ak_EditPoint.x)*(ak_viewBox[2]/ak_obj_data[4])),ak_precision)
ak_viewBox[1]=ak_round(ak_viewBox[1]-((ak_point_2.y-ak_EditPoint.y)*(ak_viewBox[3]/ak_obj_data[5])),ak_precision)
ak_object2update.setAttribute('viewBox',ak_viewBox.join(' '))
ak_transform_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'viewBox','preserveAspectRatio')
ak_cout(ak_transform_cout)
ak_viewBox[0]=ak_tmp_0
ak_viewBox[1]=ak_tmp_1
}
else
{
var ak_tmp_matrix_split=ak_matrix_invalue.split(",")
var ak_tmp_restmatrix=ak_SetGetRm_transformValue(ak_object2update,"matrix","get","get_restmatrix")
var ak_tmp_matrix2=ak_svgroot.createSVGMatrix()
ak_point_2.x=(ak_point_2.x-ak_EditPoint.x)
ak_point_2.y=(ak_point_2.y-ak_EditPoint.y)
for (var i=0;i<6;i++)
{
ak_tmp_matrix_split[i]=parseFloat(ak_tmp_matrix_split[i])
}
ak_tmp_matrix2.a=ak_tmp_matrix_split[0]
ak_tmp_matrix2.b=ak_tmp_matrix_split[1]
ak_tmp_matrix2.c=ak_tmp_matrix_split[2]
ak_tmp_matrix2.d=ak_tmp_matrix_split[3]
ak_tmp_restmatrix=ak_tmp_matrix2.multiply(ak_tmp_restmatrix)
ak_point_2=ak_point_2.matrixTransform(ak_tmp_restmatrix)
ak_tmp_matrix_split[4]+=((ak_point_2.x)-ak_tmp_restmatrix.e)
ak_tmp_matrix_split[5]+=((ak_point_2.y)-ak_tmp_restmatrix.f)
var ak_tmp_matrix_out=((Math.round(ak_tmp_matrix_split[0]*10000))/10000)+","
ak_tmp_matrix_out+=((Math.round(ak_tmp_matrix_split[1]*10000))/10000)+","
ak_tmp_matrix_out+=((Math.round(ak_tmp_matrix_split[2]*10000))/10000)+","
ak_tmp_matrix_out+=((Math.round(ak_tmp_matrix_split[3]*10000))/10000)+","
ak_tmp_matrix_out+=((Math.round(ak_tmp_matrix_split[4]*10))/10)+","
ak_tmp_matrix_out+=((Math.round(ak_tmp_matrix_split[5]*10))/10)
ak_SetGetRm_transformValue(ak_object2update,"matrix",ak_tmp_matrix_out)
if(ak_rm_matrix)
{
switch(ak_object2update.tagName())
{
case "textPath":
case "tref":
case "tspan":
case "svg":
break
default:
ak_SetGetRm_styleValue(document.getElementById("ak_standard_button_rm_matrix"),"fill","#d44","no_cout")
}
ak_rm_matrix=false
}
}
return
}
}
//######################################################################################################
function ak_edit_transform(evt,point_nr) // translate von transform wird editiert
{
if (ak_edit_which_attribute=="matrix" && point_nr!="1" && ak_object2update.tagName=='svg') 
{
if(ak_object2update.tagName=='svg')
{
var ak_tmp_0=ak_viewBox[0], ak_tmp_1=ak_viewBox[1]
ak_viewBox[0]=ak_round(ak_viewBox[0]-((ak_point_2.x-ak_EditPoint.x)*(ak_viewBox[2]/ak_obj_data[4])),ak_precision)
ak_viewBox[1]=ak_round(ak_viewBox[1]-((ak_point_2.y-ak_EditPoint.y)*(ak_viewBox[3]/ak_obj_data[5])),ak_precision)
ak_object2update.setAttribute('viewBox',ak_viewBox.join(' '))
ak_transform_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'viewBox','preserveAspectRatio')
//ak_cout(ak_transform_cout)
ak_viewBox[0]=ak_tmp_0
ak_viewBox[1]=ak_tmp_1
}
return
}
// wenn nicht matrix dann translate
var ak_tmp_restmatrix=ak_SetGetRm_transformValue(ak_object2update,"translate","get","get_restmatrix")
var ak_tmp_translateY=parseFloat(ak_translate_invalue.substring(((parseFloat(ak_translate_invalue)+",").length),ak_translate_invalue.length))
var ak_tmp_translateX=parseFloat(ak_translate_invalue) // nun x wert

ak_point_2.x=(ak_point_2.x-ak_EditPoint.x)
ak_point_2.y=(ak_point_2.y-ak_EditPoint.y)
ak_point_2=ak_point_2.matrixTransform(ak_tmp_restmatrix)

ak_tmp_translateX+=ak_point_2.x-ak_tmp_restmatrix.e
ak_tmp_translateY+=ak_point_2.y-ak_tmp_restmatrix.f
ak_tmp_translateX=ak_round(ak_tmp_translateX,100)+","+ak_round(ak_tmp_translateY,100)
ak_SetGetRm_transformValue(ak_object2update,"translate",ak_tmp_translateX,"no_cout")
}
var ak_edit_which_attribute="xy_etc" // xy_etc translate matrix
var ak_translate_invalue="0,0", ak_scale_invalue='1,1', ak_scale_inflag, ak_rotate_invalue='0,0,0', ak_rotate_inflag
var ak_matrix_invalue="1,0,0,1,0,0"
var ak_grid_zoom=1
var ak_grid_pan_x_in=0
var ak_grid_pan_y_in=0
var ak_grid_pan_x=0
var ak_grid_pan_y=0
var ak_bbox_center, ak_bbox_center_translate, ak_bbox_upperleft, ak_bbox_lowerright
var ak_grid_on_flag="Grid ON"
var ak_PanInPointx, ak_PanInPointy
var ak_point_2_panx, ak_point_2_pany
var ak_rotate_action_down
//##################################
var ak_how_many_path_points
//###########################################################################################################
function ak_path_conversion() // nimmt Daten aus dem Array und macht absolute Koordinaten nur M, C und Z
{
if(/[,maclHhVvSsTtz\+]/.test(ak_obj_data[19]))
{
ak_EditPathPoints_enter=ak_obj_data[19].replace(/,/g," ") // alle Kommas mit spaces ersetzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/\+/g," ") // alle pluszeichen mit spaces ersetzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/\-/g," -") // alle minuszeichen mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/M/g," M ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/m/g," m ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/A/g," A ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/a/g," a ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/C/g," C ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/c/g," c ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/L/g," L ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/l/g," l ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/H/g," H ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/h/g," h ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/V/g," V ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/v/g," v ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/S/g," S ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/s/g," s ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/Q/g," Q ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/q/g," q ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/T/g," T ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/t/g," t ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/[Zz]/g," Z ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/\s\s+/g," ") // mehrfach whitespaces raus
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/Z( Z)+/g,"Z") // mehrfach Zets weg
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/^ +/g,"") // spaces am Anfang raus
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/ $/g,"") // space am Ende raus
ak_EditArray_enter=ak_EditPathPoints_enter.split(" ")
var ak_tmp_path_command="M"
ak_how_many_path_points=0
for(var i=0;i<ak_EditArray_enter.length;)
{
if(/\d/.test(ak_EditArray_enter[i]))
{
ak_EditArray_enter.splice(i,0,ak_tmp_path_command)
}
if(/[MmTtLl]/.test(ak_EditArray_enter[i]))
{
if(ak_EditArray_enter[i]=="M") ak_tmp_path_command="L"
else if(ak_EditArray_enter[i]=="m") ak_tmp_path_command="l"
else ak_tmp_path_command=ak_EditArray_enter[i]
if(i==0) ak_EditArray_enter[i]="M"
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++
ak_how_many_path_points++
}
else if(/[Cc]/.test(ak_EditArray_enter[i]))
{
ak_tmp_path_command=ak_EditArray_enter[i]
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++
ak_how_many_path_points++
}
else if(/[Zz]/.test(ak_EditArray_enter[i]))
{
ak_tmp_path_command=ak_EditArray_enter[i]
i++
ak_how_many_path_points++
}
else if(/[HhVv]/.test(ak_EditArray_enter[i]))
{
ak_tmp_path_command=ak_EditArray_enter[i]
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++
ak_how_many_path_points++
}
else if(/[SsQq]/.test(ak_EditArray_enter[i]))
{
ak_tmp_path_command=ak_EditArray_enter[i]
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++
ak_how_many_path_points++
}
else if(/[Aa]/.test(ak_EditArray_enter[i]))
{
ak_tmp_path_command=ak_EditArray_enter[i]
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++
ak_how_many_path_points++
}
else break
}
}
else // sonst vermutlich schon mal konvertiert dann quick convert
{
ak_EditPathPoints_enter=ak_obj_data[19].replace(/\-/g," -") // alle minuszeichen mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/M/g," M ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/A/g," A ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/C/g," C ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/L/g," L ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/Q/g," Q ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/[Zz]/g," Z ") // mit spaces ergaenzen
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/\s\s+/g," ") // mehrfach whitespaces raus
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/Z( Z)+/g,"Z") // mehrfach Zets weg
ak_EditPathPoints_enter=ak_EditPathPoints_enter.replace(/^ +| +$/g,"") // spaces am Anfang und Ende raus
ak_EditArray_enter=ak_EditPathPoints_enter.split(" ")
var ak_tmp_path_command="M"
ak_how_many_path_points=0
for(var i=0;i<ak_EditArray_enter.length;)
{
if(/\d/.test(ak_EditArray_enter[i]))
{
ak_EditArray_enter.splice(i,0,ak_tmp_path_command)
}
if(/[C]/.test(ak_EditArray_enter[i]))
{
ak_tmp_path_command=ak_EditArray_enter[i]
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++
ak_how_many_path_points++
}
else if(/[ML]/.test(ak_EditArray_enter[i]))
{
ak_tmp_path_command="L"
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++
ak_how_many_path_points++
}
else if(/[Z]/.test(ak_EditArray_enter[i]))
{
ak_tmp_path_command=ak_EditArray_enter[i]
i++
ak_how_many_path_points++
}
else if(/[Q]/.test(ak_EditArray_enter[i]))
{
ak_tmp_path_command=ak_EditArray_enter[i]
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++
ak_how_many_path_points++
}
else if(/[A]/.test(ak_EditArray_enter[i]))
{
ak_tmp_path_command=ak_EditArray_enter[i]
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++; ak_EditArray_enter[i]=parseFloat(ak_EditArray_enter[i])
i++
ak_how_many_path_points++
}
else break
}
}
if(isNaN(ak_path_point_step) || ak_path_point_step<25) ak_path_point_step=25
ak_segment_how_many=Math.round(ak_how_many_path_points/ak_path_point_step)
ak_segment_how_many=ak_segment_how_many==0?1:ak_segment_how_many
if(ak_segment_start<0) ak_segment_start=0
else if(ak_segment_start>=ak_segment_how_many) ak_segment_start=0
var ak_newNode='<menu id="ak_edit_path_points_submenu"><header>Path Attributes</header>'
if(ak_path_attr)
{
ak_newNode+='<item enabled="no">Add d="..." from Clipboard</item>'
ak_newNode+='<item enabled="no">Replace d="..." from Clipboard</item>'
ak_newNode+='<item enabled="no">Mirror left | right</item>'
ak_newNode+='<item enabled="no">Mirror top | bottom</item>'
ak_newNode+='<item enabled="no">Rotate Path Points</item>'
}
else
{
ak_newNode+='<item onactivate="'+"ak_edit_path_menu('addPathClipboard')"+'">Add d="..." from Clipboard</item>'
ak_newNode+='<item onactivate="'+"ak_edit_path_menu('replacePathClipboard')"+'">Replace d="..." from Clipboard</item>'
ak_newNode+='<item onactivate="'+"ak_edit_path_menu('mirrorLeftRight')"+'">Mirror left | right</item>'
ak_newNode+='<item onactivate="'+"ak_edit_path_menu('mirrorTopBottom')"+'">Mirror top | bottom</item>'
ak_newNode+='<menu><header>Rotate Path Points</header>'
ak_newNode+='<item onactivate="'+"ak_edit_path_menu('rotatePathPoints',-90)"+'">-90</item>'
ak_newNode+='<item onactivate="'+"ak_edit_path_menu('rotatePathPoints',-60)"+'">-60</item>'
ak_newNode+='<item onactivate="'+"ak_edit_path_menu('rotatePathPoints',-45)"+'">-45</item>'
ak_newNode+='<item onactivate="'+"ak_edit_path_menu('rotatePathPoints',-30)"+'">-30</item>'
ak_newNode+='<item onactivate="'+"ak_edit_path_menu('rotatePathPoints',-15)"+'">-15</item>'
ak_newNode+='<separator/>'
ak_newNode+='<item onactivate="'+"ak_edit_path_menu('rotatePathPoints','enter')"+'">Enter angle</item>'
ak_newNode+='<separator/>'
ak_newNode+='<item onactivate="'+"ak_edit_path_menu('rotatePathPoints',15)"+'">15</item>'
ak_newNode+='<item onactivate="'+"ak_edit_path_menu('rotatePathPoints',30)"+'">30</item>'
ak_newNode+='<item onactivate="'+"ak_edit_path_menu('rotatePathPoints',45)"+'">45</item>'
ak_newNode+='<item onactivate="'+"ak_edit_path_menu('rotatePathPoints',60)"+'">60</item>'
ak_newNode+='<item onactivate="'+"ak_edit_path_menu('rotatePathPoints',90)"+'">90</item>'
ak_newNode+='<item onactivate="'+"ak_edit_path_menu('rotatePathPoints',120)"+'">120</item>'
ak_newNode+='<item onactivate="'+"ak_edit_path_menu('rotatePathPoints',180)"+'">180</item>'
ak_newNode+='</menu>'
}
ak_newNode+='<separator/>'
ak_pathMenu=ak_newNode
ak_newNode=""
var ak_tmp_akPath
if(!ak_object2update.getAttribute("ak_path"))
{
ak_tmp_akPath='<item onactivate="'+"ak_edit_path_menu('edit_ak_path_create')"+'">Create ak_path Attribute</item>'
}
else
{
if(ak_path_attr)
{
ak_tmp_akPath='<menu><header>&#187;&#187;     Edit ak_path Attribute</header>'
ak_tmp_akPath+='<item checked="yes" onactivate="'+"ak_edit_path_menu('edit_ak_path_off')"+'">Edit ak_path Attribute</item>'
ak_tmp_akPath+='<separator/>'
if(ak_path_attr[0]>=1080) ak_tmp_akPath+='<item enabled="no" onactivate="'+"ak_edit_path_menu('edit_ak_path_inc')"+'">Increase Segments</item>'
else ak_tmp_akPath+='<item onactivate="'+"ak_edit_path_menu('edit_ak_path_inc')"+'">Increase Segments</item>'
if(ak_path_attr[0]>2) ak_tmp_akPath+='<item onactivate="'+"ak_edit_path_menu('edit_ak_path_dec')"+'">Decrease Segments</item>'
else if(ak_path_attr[0]>1 && /2$/.test(ak_path_attr[1])) ak_tmp_akPath+='<item onactivate="'+"ak_edit_path_menu('edit_ak_path_dec')"+'">Decrease Segments</item>'
else ak_tmp_akPath+='<item enabled="no" onactivate="'+"ak_edit_path_menu('edit_ak_path_dec')"+'">Decrease Segments</item>'
var ak_tmp
if(/2$/.test(ak_path_attr[1])) ak_tmp=ak_path_attr[1].substring(0,2)
else ak_tmp=ak_path_attr[1]+"2"
ak_tmp_akPath+='<item id="ak_pathMode_1" onactivate="'+"ak_edit_path_menu('edit_ak_path_mode','"+ak_tmp+"')"+'">--&gt; '+ak_tmp+'</item>'
if(/2$/.test(ak_path_attr[1]))
{
if(ak_path_attr[1]=="mm2") ak_tmp_akPath+='<item id="ak_pathMode_2" onactivate="'+"ak_edit_path_menu('edit_ak_path_mode_rm','ml2')"+'">--&gt; ml2, mc2, mq2</item>'
else  ak_tmp_akPath+='<item id="ak_pathMode_2" onactivate="'+"ak_edit_path_menu('edit_ak_path_mode','mm2')"+'">--&gt; mm2</item>'
}
else
{
if(ak_path_attr[1]=="mm") ak_tmp_akPath+='<item id="ak_pathMode_2" onactivate="'+"ak_edit_path_menu('edit_ak_path_mode_rm','ml')"+'">--&gt; ml, mc, mq</item>'
else  ak_tmp_akPath+='<item id="ak_pathMode_2" onactivate="'+"ak_edit_path_menu('edit_ak_path_mode','mm')"+'">--&gt; mm</item>'
}
ak_tmp_akPath+='<separator/>'
ak_tmp_akPath+='<item onactivate="'+"ak_edit_path_menu('edit_ak_path2d_rm')"+'">d = ak_path, Remove ak_path</item>'
ak_tmp_akPath+='<item onactivate="'+"ak_edit_path_menu('edit_ak_path_remove')"+'">Remove ak_path</item>'
ak_tmp_akPath+='</menu>'
}
else ak_tmp_akPath='<item onactivate="'+"ak_edit_path_menu('edit_ak_path')"+'">Edit ak_path Attribute</item>'
}
ak_pathMenuAK=ak_tmp_akPath
ak_pathMenu2=ak_newNode
ak_pathMenuValid=ak_object2update
//#######  wenn keine absoluten Daten  
if(!/[mcSsqTtalHhVvz]/.test(ak_EditArray_enter+""))
{
if(ak_path_attr)
{
for(var i=0;i<ak_EditArray_enter.length;i++)
{
if(/[A]/.test(ak_EditArray_enter[i]))
{
i+=6
ak_EditArray_enter[i]+=ak_path_attr[3]; i++
ak_EditArray_enter[i]+=ak_path_attr[4]
}
else if(!isNaN(ak_EditArray_enter[i]))
{
ak_EditArray_enter[i]+=ak_path_attr[3]; i++
ak_EditArray_enter[i]+=ak_path_attr[4]
}
}
}
ak_EditArray_MCZ=ak_EditArray_enter
return
}
//#######  dann konvertieren
ak_EditArray_MCZ=new Array (ak_EditArray_enter[0],ak_EditArray_enter[1],ak_EditArray_enter[2])
var ak_last_absolute_x=ak_EditArray_enter[1]
var ak_last_absolute_y=ak_EditArray_enter[2]
var ak_last_absolute_Mx=ak_EditArray_enter[1]
var ak_last_absolute_My=ak_EditArray_enter[2] // fuer die Z und z noetig
for(var i=3;i<ak_EditArray_enter.length;)  // /[mcSsQqTtAaLlHhVvz]/
{
switch(ak_EditArray_enter[i])
{
case "Z":
ak_EditArray_MCZ.push("Z"); i++
ak_last_absolute_x=ak_last_absolute_Mx
ak_last_absolute_y=ak_last_absolute_My
break
case "z":
ak_EditArray_MCZ.push("Z"); i++
ak_last_absolute_x=ak_last_absolute_Mx
ak_last_absolute_y=ak_last_absolute_My
break
case "H":
ak_EditArray_MCZ.push("L"); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_last_absolute_y)
ak_last_absolute_x=ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]
ak_last_absolute_y=ak_EditArray_MCZ[ak_EditArray_MCZ.length-1]
break
case "h":
ak_EditArray_MCZ.push("L"); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_x); i++
ak_EditArray_MCZ.push(ak_last_absolute_y)
ak_last_absolute_x=ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]
ak_last_absolute_y=ak_EditArray_MCZ[ak_EditArray_MCZ.length-1]
break
case "V":
ak_EditArray_MCZ.push("L"); i++
ak_EditArray_MCZ.push(ak_last_absolute_x)
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_last_absolute_x=ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]
ak_last_absolute_y=ak_EditArray_MCZ[ak_EditArray_MCZ.length-1]
break
case "v":
ak_EditArray_MCZ.push("L"); i++
ak_EditArray_MCZ.push(ak_last_absolute_x)
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_y); i++
ak_last_absolute_x=ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]
ak_last_absolute_y=ak_EditArray_MCZ[ak_EditArray_MCZ.length-1]
break
case "M":
ak_EditArray_MCZ.push("M"); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_last_absolute_x=ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]
ak_last_absolute_y=ak_EditArray_MCZ[ak_EditArray_MCZ.length-1]
ak_last_absolute_Mx=ak_last_absolute_x
ak_last_absolute_My=ak_last_absolute_y
break
case "m":
ak_EditArray_MCZ.push("M"); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_x); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_y); i++
ak_last_absolute_x=ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]
ak_last_absolute_y=ak_EditArray_MCZ[ak_EditArray_MCZ.length-1]
ak_last_absolute_Mx=ak_last_absolute_x
ak_last_absolute_My=ak_last_absolute_y
break
case "L":
ak_EditArray_MCZ.push("L"); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_last_absolute_x=ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]
ak_last_absolute_y=ak_EditArray_MCZ[ak_EditArray_MCZ.length-1]
break
case "l":
ak_EditArray_MCZ.push("L"); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_x); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_y); i++
ak_last_absolute_x=ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]
ak_last_absolute_y=ak_EditArray_MCZ[ak_EditArray_MCZ.length-1]
break
case "C":
ak_EditArray_MCZ.push("C"); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_last_absolute_x=ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]
ak_last_absolute_y=ak_EditArray_MCZ[ak_EditArray_MCZ.length-1]
break
case "c":
ak_EditArray_MCZ.push("C"); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_x); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_y); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_x); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_y); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_x); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_y); i++
ak_last_absolute_x=ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]
ak_last_absolute_y=ak_EditArray_MCZ[ak_EditArray_MCZ.length-1]
break
case "S":
ak_EditArray_MCZ.push("C"); i++
if((ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]=="Z") || (ak_EditArray_MCZ[ak_EditArray_MCZ.length-4]=="M") || (ak_EditArray_MCZ[ak_EditArray_MCZ.length-4]=="L"))
{
ak_EditArray_MCZ.push(ak_last_absolute_x)
ak_EditArray_MCZ.push(ak_last_absolute_y)
}
else // dann ist ein C oder Q da
{
ak_EditArray_MCZ.push(ak_last_absolute_x-(ak_EditArray_MCZ[ak_EditArray_MCZ.length-5]-ak_last_absolute_x))
ak_EditArray_MCZ.push(ak_last_absolute_y-(ak_EditArray_MCZ[ak_EditArray_MCZ.length-5]-ak_last_absolute_y)) // length schon um eins groesser
}
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_last_absolute_x=ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]
ak_last_absolute_y=ak_EditArray_MCZ[ak_EditArray_MCZ.length-1]
break
case "s":
ak_EditArray_MCZ.push("C"); i++
if((ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]=="Z") || (ak_EditArray_MCZ[ak_EditArray_MCZ.length-4]=="M") || (ak_EditArray_MCZ[ak_EditArray_MCZ.length-4]=="L"))
{
ak_EditArray_MCZ.push(ak_last_absolute_x)
ak_EditArray_MCZ.push(ak_last_absolute_y)
}
else // dann ist ein C oder Q da
{
ak_EditArray_MCZ.push(ak_last_absolute_x-(ak_EditArray_MCZ[ak_EditArray_MCZ.length-5]-ak_last_absolute_x))
ak_EditArray_MCZ.push(ak_last_absolute_y-(ak_EditArray_MCZ[ak_EditArray_MCZ.length-5]-ak_last_absolute_y)) // length schon um eins groesser
}
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_x); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_y); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_x); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_y); i++
ak_last_absolute_x=ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]
ak_last_absolute_y=ak_EditArray_MCZ[ak_EditArray_MCZ.length-1]
break
case "Q":
ak_EditArray_MCZ.push("Q"); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_last_absolute_x=ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]
ak_last_absolute_y=ak_EditArray_MCZ[ak_EditArray_MCZ.length-1]
break
case "q":
ak_EditArray_MCZ.push("Q"); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_x); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_y); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_x); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_y); i++
ak_last_absolute_x=ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]
ak_last_absolute_y=ak_EditArray_MCZ[ak_EditArray_MCZ.length-1]
break
case "T":
if((ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]=="Z") || (ak_EditArray_MCZ[ak_EditArray_MCZ.length-4]=="M") || (ak_EditArray_MCZ[ak_EditArray_MCZ.length-4]=="L"))
{
ak_EditArray_MCZ.push("L"); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
}
else // dann ist ein C oder Q da
{
ak_EditArray_MCZ.push("Q"); i++
ak_EditArray_MCZ.push(ak_last_absolute_x-(ak_EditArray_MCZ[ak_EditArray_MCZ.length-5]-ak_last_absolute_x))
ak_EditArray_MCZ.push(ak_last_absolute_y-(ak_EditArray_MCZ[ak_EditArray_MCZ.length-5]-ak_last_absolute_y)) // length schon um eins groesser
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
}
ak_last_absolute_x=ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]
ak_last_absolute_y=ak_EditArray_MCZ[ak_EditArray_MCZ.length-1]
break
case "t":
if((ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]=="Z") || (ak_EditArray_MCZ[ak_EditArray_MCZ.length-4]=="M") || (ak_EditArray_MCZ[ak_EditArray_MCZ.length-4]=="L"))
{
ak_EditArray_MCZ.push("L"); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_x); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_y); i++
}
else // dann ist ein C oder Q da
{
ak_EditArray_MCZ.push("Q"); i++
ak_EditArray_MCZ.push(ak_last_absolute_x-(ak_EditArray_MCZ[ak_EditArray_MCZ.length-5]-ak_last_absolute_x))
ak_EditArray_MCZ.push(ak_last_absolute_y-(ak_EditArray_MCZ[ak_EditArray_MCZ.length-5]-ak_last_absolute_y)) // length schon um eins groesser
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_x); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_y); i++
}
ak_last_absolute_x=ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]
ak_last_absolute_y=ak_EditArray_MCZ[ak_EditArray_MCZ.length-1]
break
case "A":
ak_EditArray_MCZ.push("A"); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_last_absolute_x=ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]
ak_last_absolute_y=ak_EditArray_MCZ[ak_EditArray_MCZ.length-1]
break
case "a":
ak_EditArray_MCZ.push("A"); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_x); i++
ak_EditArray_MCZ.push(ak_EditArray_enter[i]+ak_last_absolute_y); i++
ak_last_absolute_x=ak_EditArray_MCZ[ak_EditArray_MCZ.length-2]
ak_last_absolute_y=ak_EditArray_MCZ[ak_EditArray_MCZ.length-1]
break
default:
ak_EditArray_MCZ.push(ak_EditArray_enter[i]); i++
break
}
}
if(ak_path_attr)
{
for(var i=0;i<ak_EditArray_MCZ.length;i++)
{
if(/[A]/.test(ak_EditArray_MCZ[i]))
{
i+=6
ak_EditArray_MCZ[i]+=ak_path_attr[3]; i++
ak_EditArray_MCZ[i]+=ak_path_attr[4]
}
else if(!isNaN(ak_EditArray_enter[i]))
{
ak_EditArray_MCZ[i]+=ak_path_attr[3]; i++
ak_EditArray_MCZ[i]+=ak_path_attr[4]
}
}
}
}
//##########################################################
var ak_ctrl_start, ak_ctrl_how_many, ak_segment_start=0, ak_segment_how_many=1, ak_path_point_step=50
//##########################################################
function ak_set_path_control(evt,ctrl_start,ctrl_how_many)
{
var ak_grid_zoom=ak_obj_control_scale // locale variable groesse der control points
if(ak_hide_pathPoints || ak_segment_how_many==-1 || ak_segment_start>=ak_segment_how_many)
{//< show path points disabled
return
}
ak_hide_pathPoints=false
if(ak_segment_start==-1 || ak_segment_how_many==1) // show all path points
{
var ak_ctrl_start=0
var ak_ctrl_how_many=ak_EditArray_MCZ.length
}
else
{
var ak_ctrl_start=ak_segment_start*parseInt(ak_EditArray_MCZ.length/ak_segment_how_many)
var ak_ctrl_how_many=parseInt(ak_EditArray_MCZ.length*1.1/ak_segment_how_many)
}
if(!ak_ctrl_start || ak_ctrl_start>ak_EditArray_MCZ.length) ak_ctrl_start=0
if((ak_ctrl_how_many+ak_ctrl_start)>ak_EditArray_MCZ.length) ak_ctrl_how_many=ak_EditArray_MCZ.length-ak_ctrl_start
var ak_tmp_Mx, ak_tmp_My;
var ak_tmp_Absx, ak_tmp_Absy;
for(var i=0;i<ak_ctrl_start;i++) // da koennte Z kommen dann ist ak_tmp_My und y noetig
{
switch(ak_EditArray_MCZ[i])
{
case "Z":
ak_tmp_Absx=ak_tmp_Mx
ak_tmp_Absy=ak_tmp_My
break
case "M":
ak_tmp_Mx=ak_EditArray_MCZ[i+1]; ak_tmp_My=ak_EditArray_MCZ[i+2];
ak_tmp_Absx=ak_EditArray_MCZ[i+1]; ak_tmp_Absy=ak_EditArray_MCZ[i+2];
i+=2
break
case "L":
ak_tmp_Absx=ak_EditArray_MCZ[i+1]; ak_tmp_Absy=ak_EditArray_MCZ[i+2];
i+=2
break
case "C":
ak_tmp_Absx=ak_EditArray_MCZ[i+5]; ak_tmp_Absy=ak_EditArray_MCZ[i+6];
i+=6
break
case "Q":
ak_tmp_Absx=ak_EditArray_MCZ[i+3]; ak_tmp_Absy=ak_EditArray_MCZ[i+4];
i+=4
break
case "A":
ak_tmp_Absx=ak_EditArray_MCZ[i+6]; ak_tmp_Absy=ak_EditArray_MCZ[i+7];
i+=7
break
}
}
ak_toolObject.replaceChild(parseXML(("<g id='ak_path_control_g' style='stroke:#000;stroke-width:"+(1/ak_grid_zoom)+";fill-opacity:1'/>"),document).firstChild,ak_toolPath)
ak_toolPath=document.getElementById("ak_path_control_g")
var g_append=ak_toolPath
var ak_tmp_circle_xml
var ak_tmp_function='ak_MoveEditRect(evt,"down","path_stroke",'
var ak_tmp_Marray=new Array, ak_tmp_Mindex=-1
var ak_tmpRender=' shape-rendering="optimizeSpeed"'
for(var i=ak_ctrl_start;i<(ak_ctrl_start+ak_ctrl_how_many);i++)
{
switch(ak_EditArray_MCZ[i])
{
case "Z":
ak_tmp_circle_xml="<path d='M "+ak_tmp_Absx+" "+ak_tmp_Absy+" L "
ak_tmp_circle_xml+=ak_tmp_Mx+" "+ak_tmp_My+"'"
ak_tmp_circle_xml+=ak_tmpRender+" style='fill:none;stroke:#000;opacity:0.4;stroke-width:"+(4/ak_grid_zoom)+"'"
ak_tmp_circle_xml+=" onmousedown='"+ak_tmp_function+(i)+")'/>"
g_append.appendChild(parseXML(ak_tmp_circle_xml,document).firstChild)
ak_tmp_Absx=ak_tmp_Mx
ak_tmp_Absy=ak_tmp_My
break
case "M":
ak_tmp_Mindex=i
ak_tmp_Marray[ak_tmp_Mindex]=false
if(i>2 && ak_EditArray_MCZ[i-1]!="Z")
{
ak_tmp_circle_xml="<path d='M "+ak_tmp_Absx+" "+ak_tmp_Absy+" L "
ak_tmp_circle_xml+=ak_tmp_Mx+" "+ak_tmp_My+"'"
ak_tmp_circle_xml+=ak_tmpRender+" style='fill:none;stroke:#fff;opacity:0.75;stroke-width:"+(4/ak_grid_zoom)+"'"
ak_tmp_circle_xml+=" onmousedown='"+ak_tmp_function+(i)+")'/>"
g_append.appendChild(parseXML(ak_tmp_circle_xml,document).firstChild)
}
ak_tmp_Mx=ak_EditArray_MCZ[i+1]; ak_tmp_My=ak_EditArray_MCZ[i+2];
ak_tmp_Absx=ak_EditArray_MCZ[i+1]; ak_tmp_Absy=ak_EditArray_MCZ[i+2];
i+=2
break
case "L":
ak_tmp_circle_xml="<path d='M "+ak_tmp_Absx+" "+ak_tmp_Absy+" L "
i++; ak_tmp_circle_xml+=ak_EditArray_MCZ[i]+" "+ak_EditArray_MCZ[i+1]+"'"; i++
ak_tmp_circle_xml+=ak_tmpRender+" style='fill:none;stroke:#00c3ff;opacity:0.75;stroke-width:"+(4/ak_grid_zoom)+"'"
ak_tmp_circle_xml+=" onmousedown='"+ak_tmp_function+(i-2)+")'/>"
g_append.appendChild(parseXML(ak_tmp_circle_xml,document).firstChild)
if(ak_tmp_Mindex>=0)
{
var ak_tmp_pathLength=g_append.lastChild.getTotalLength()
if(ak_tmp_pathLength<=(16/ak_grid_zoom)) ak_tmp_Marray[ak_tmp_Mindex]=g_append.lastChild.getPointAtLength(ak_tmp_pathLength)
else ak_tmp_Marray[ak_tmp_Mindex]=g_append.lastChild.getPointAtLength(16/ak_grid_zoom)
ak_tmp_Marray[ak_tmp_Mindex+1]=Math.atan2((ak_tmp_Marray[ak_tmp_Mindex].y-ak_EditArray_MCZ[ak_tmp_Mindex+2]),(ak_tmp_Marray[ak_tmp_Mindex].x-ak_EditArray_MCZ[ak_tmp_Mindex+1]))*(180/Math.PI)
ak_tmp_Mindex=-1
}
ak_tmp_Absx=ak_EditArray_MCZ[i-1]; ak_tmp_Absy=ak_EditArray_MCZ[i];
break
case "C":
ak_tmp_circle_xml="<path d='M "+ak_tmp_Absx+" "+ak_tmp_Absy+" C "
i++; ak_tmp_circle_xml+=ak_EditArray_MCZ[i]+" "
i++; ak_tmp_circle_xml+=ak_EditArray_MCZ[i]+" "
i++; ak_tmp_circle_xml+=ak_EditArray_MCZ[i]+" "
i++; ak_tmp_circle_xml+=ak_EditArray_MCZ[i]+" "
i++; ak_tmp_circle_xml+=ak_EditArray_MCZ[i]+" "
i++; ak_tmp_circle_xml+=ak_EditArray_MCZ[i]+"'"
ak_tmp_circle_xml+=ak_tmpRender+" style='fill:none;stroke:#ff9400;opacity:0.75;stroke-width:"+(4/ak_grid_zoom)+"'"
ak_tmp_circle_xml+=" onmousedown='"+ak_tmp_function+(i-6)+")'/>"
g_append.appendChild(parseXML(ak_tmp_circle_xml,document).firstChild)
if(ak_tmp_Mindex>=0)
{
var ak_tmp_pathLength=g_append.lastChild.getTotalLength()
if(ak_tmp_pathLength<=(16/ak_grid_zoom)) ak_tmp_Marray[ak_tmp_Mindex]=g_append.lastChild.getPointAtLength(ak_tmp_pathLength)
else ak_tmp_Marray[ak_tmp_Mindex]=g_append.lastChild.getPointAtLength(16/ak_grid_zoom)
ak_tmp_Marray[ak_tmp_Mindex+1]=Math.atan2((ak_tmp_Marray[ak_tmp_Mindex].y-ak_EditArray_MCZ[ak_tmp_Mindex+2]),(ak_tmp_Marray[ak_tmp_Mindex].x-ak_EditArray_MCZ[ak_tmp_Mindex+1]))*(180/Math.PI)
ak_tmp_Mindex=-1
}
ak_tmp_Absx=ak_EditArray_MCZ[i-1]; ak_tmp_Absy=ak_EditArray_MCZ[i];
break
case "Q":
ak_tmp_circle_xml="<path d='M "+ak_tmp_Absx+" "+ak_tmp_Absy+" Q "
i++; ak_tmp_circle_xml+=ak_EditArray_MCZ[i]+" "
i++; ak_tmp_circle_xml+=ak_EditArray_MCZ[i]+" "
i++; ak_tmp_circle_xml+=ak_EditArray_MCZ[i]+" "
i++; ak_tmp_circle_xml+=ak_EditArray_MCZ[i]+"'"
ak_tmp_circle_xml+=ak_tmpRender+" style='fill:none;stroke:#8cff00;opacity:0.75;stroke-width:"+(4/ak_grid_zoom)+"'"
ak_tmp_circle_xml+=" onmousedown='"+ak_tmp_function+(i-4)+")'/>"
g_append.appendChild(parseXML(ak_tmp_circle_xml,document).firstChild)
if(ak_tmp_Mindex>=0)
{
var ak_tmp_pathLength=g_append.lastChild.getTotalLength()
if(ak_tmp_pathLength<=(16/ak_grid_zoom)) ak_tmp_Marray[ak_tmp_Mindex]=g_append.lastChild.getPointAtLength(ak_tmp_pathLength)
else ak_tmp_Marray[ak_tmp_Mindex]=g_append.lastChild.getPointAtLength(16/ak_grid_zoom)
ak_tmp_Marray[ak_tmp_Mindex+1]=Math.atan2((ak_tmp_Marray[ak_tmp_Mindex].y-ak_EditArray_MCZ[ak_tmp_Mindex+2]),(ak_tmp_Marray[ak_tmp_Mindex].x-ak_EditArray_MCZ[ak_tmp_Mindex+1]))*(180/Math.PI)
ak_tmp_Mindex=-1
}
ak_tmp_Absx=ak_EditArray_MCZ[i-1]; ak_tmp_Absy=ak_EditArray_MCZ[i];
break
case "A":
ak_tmp_circle_xml="<path d='M "+ak_tmp_Absx+" "+ak_tmp_Absy+" A "
i++; ak_tmp_circle_xml+=ak_EditArray_MCZ[i]+" "
i++; ak_tmp_circle_xml+=ak_EditArray_MCZ[i]+" "
i++; ak_tmp_circle_xml+=ak_EditArray_MCZ[i]+" "
i++; ak_tmp_circle_xml+=ak_EditArray_MCZ[i]+" "
i++; ak_tmp_circle_xml+=ak_EditArray_MCZ[i]+" "
i++; ak_tmp_circle_xml+=ak_EditArray_MCZ[i]+" "
i++; ak_tmp_circle_xml+=ak_EditArray_MCZ[i]+"'"
ak_tmp_circle_xml+=ak_tmpRender+" style='fill:none;stroke:#db01e7;opacity:0.75;stroke-width:"+(4/ak_grid_zoom)+"'"
ak_tmp_circle_xml+=" onmousedown='"+ak_tmp_function+(i-7)+")'/>"
g_append.appendChild(parseXML(ak_tmp_circle_xml,document).firstChild)
if(ak_tmp_Mindex>=0)
{
var ak_tmp_pathLength=g_append.lastChild.getTotalLength()
if(ak_tmp_pathLength<=(16/ak_grid_zoom)) ak_tmp_Marray[ak_tmp_Mindex]=g_append.lastChild.getPointAtLength(ak_tmp_pathLength)
else ak_tmp_Marray[ak_tmp_Mindex]=g_append.lastChild.getPointAtLength(16/ak_grid_zoom)
ak_tmp_Marray[ak_tmp_Mindex+1]=Math.atan2((ak_tmp_Marray[ak_tmp_Mindex].y-ak_EditArray_MCZ[ak_tmp_Mindex+2]),(ak_tmp_Marray[ak_tmp_Mindex].x-ak_EditArray_MCZ[ak_tmp_Mindex+1]))*(180/Math.PI)
ak_tmp_Mindex=-1
}
ak_tmp_Absx=ak_EditArray_MCZ[i-1]; ak_tmp_Absy=ak_EditArray_MCZ[i];
break
}
}
if((ak_ctrl_start+ak_ctrl_how_many)==ak_EditArray_MCZ.length && [ak_EditArray_MCZ.length-1]!="Z")
{ // wenn letzter Eintrag kein Z
ak_tmp_circle_xml="<path d='M "+ak_tmp_Absx+" "+ak_tmp_Absy+" L "
ak_tmp_circle_xml+=ak_tmp_Mx+" "+ak_tmp_My+"'"
ak_tmp_circle_xml+=" style='fill:none;stroke:#fff;opacity:0.75;stroke-width:"+(4/ak_grid_zoom)+"'"
ak_tmp_circle_xml+=" onmousedown='"+ak_tmp_function+(ak_EditArray_MCZ.length)+")'/>"
g_append.appendChild(parseXML(ak_tmp_circle_xml,document).firstChild)
}
ak_tmp_circle_xml="<g id='ak_path_control_lines'>"
ak_tmp_circle_xml+="<line id='ak_path_control_l1' x1='10' y1='10' x2='100' y2='100' style='stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'/>"
ak_tmp_circle_xml+="<line id='ak_path_control_l2' x1='10' y1='20' x2='100' y2='110' style='stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'/>"
ak_tmp_circle_xml+="<circle id='ak_path_control_lc' cx='100' cy='100' r='"+(4/ak_grid_zoom)+"'"
ak_tmp_circle_xml+=" style='fill:#fff;fill-opacity:0;stroke:#fff;opacity:0.75;stroke-width:"+(1/ak_grid_zoom)+"'/>"
ak_tmp_circle_xml+="</g>"
g_append.appendChild(parseXML(ak_tmp_circle_xml,document).firstChild)
var ak_tmp_function='ak_MoveEditRect(evt,"down","path_point",'
var ak_tmpPoint=ak_svgroot.createSVGPoint()
for(var i=ak_ctrl_start;i<(ak_ctrl_start+ak_ctrl_how_many);i++)
{
switch(ak_EditArray_MCZ[i])
{
case "M":
var ak_tmp='fill:#00f'
if(ak_path_attr && i==0) ak_tmp='fill:#f00;stroke:#00c'
else if(ak_path_attr) ak_tmp='fill:#00f;stroke:#cc0'
else if(i==0) ak_tmp+=';stroke:#c00'
if(ak_tmp_Marray[i] && !isNaN(ak_tmp_Marray[i+1]))
{
var ak_tmp_length=Math.pow(Math.pow(ak_tmp_Marray[i].x-ak_EditArray_MCZ[i+1],2)+Math.pow(ak_tmp_Marray[i].y-ak_EditArray_MCZ[i+2],2),0.5)
if(ak_tmp_length>(16/ak_grid_zoom))
{
ak_tmp_length=(16/ak_grid_zoom)/ak_tmp_length
ak_tmp_Marray[i].x=((ak_tmp_Marray[i].x-ak_EditArray_MCZ[i+1])*ak_tmp_length)+ak_EditArray_MCZ[i+1]
ak_tmp_Marray[i].y=((ak_tmp_Marray[i].y-ak_EditArray_MCZ[i+2])*ak_tmp_length)+ak_EditArray_MCZ[i+2]
}
var ak_tmpMatrix=ak_svgroot.createSVGMatrix()
ak_tmpMatrix=ak_tmpMatrix.rotate(ak_tmp_Marray[i+1]+45)
ak_tmp_circle_xml="<path d='M"
ak_tmpPoint.x=0; ak_tmpPoint.y=-8/ak_grid_zoom
ak_tmpPoint=ak_tmpPoint.matrixTransform(ak_tmpMatrix)
ak_tmp_circle_xml+=" "+(ak_tmpPoint.x+ak_EditArray_MCZ[i+1])+" "+(ak_tmpPoint.y+ak_EditArray_MCZ[i+2])
ak_tmp_circle_xml+=" L "+ak_tmp_Marray[i].x+" "+ak_tmp_Marray[i].y
ak_tmpPoint.x=8/ak_grid_zoom; ak_tmpPoint.y=0
ak_tmpPoint=ak_tmpPoint.matrixTransform(ak_tmpMatrix)
ak_tmp_circle_xml+=" L "+(ak_tmpPoint.x+ak_EditArray_MCZ[i+1])+" "+(ak_tmpPoint.y+ak_EditArray_MCZ[i+2])
ak_tmpPoint.x=8/ak_grid_zoom; ak_tmpPoint.y=4.42/ak_grid_zoom
ak_tmpPoint=ak_tmpPoint.matrixTransform(ak_tmpMatrix)
ak_tmp_circle_xml+=" C "+(ak_tmpPoint.x+ak_EditArray_MCZ[i+1])+" "+(ak_tmpPoint.y+ak_EditArray_MCZ[i+2])
ak_tmpPoint.x=4.42/ak_grid_zoom; ak_tmpPoint.y=8/ak_grid_zoom
ak_tmpPoint=ak_tmpPoint.matrixTransform(ak_tmpMatrix)
ak_tmp_circle_xml+=" "+(ak_tmpPoint.x+ak_EditArray_MCZ[i+1])+" "+(ak_tmpPoint.y+ak_EditArray_MCZ[i+2])
ak_tmpPoint.x=0; ak_tmpPoint.y=8/ak_grid_zoom
ak_tmpPoint=ak_tmpPoint.matrixTransform(ak_tmpMatrix)
ak_tmp_circle_xml+=" "+(ak_tmpPoint.x+ak_EditArray_MCZ[i+1])+" "+(ak_tmpPoint.y+ak_EditArray_MCZ[i+2])
ak_tmpPoint.x=-4.42/ak_grid_zoom; ak_tmpPoint.y=8/ak_grid_zoom
ak_tmpPoint=ak_tmpPoint.matrixTransform(ak_tmpMatrix)
ak_tmp_circle_xml+=" C "+(ak_tmpPoint.x+ak_EditArray_MCZ[i+1])+" "+(ak_tmpPoint.y+ak_EditArray_MCZ[i+2])
ak_tmpPoint.x=-8/ak_grid_zoom; ak_tmpPoint.y=4.42/ak_grid_zoom
ak_tmpPoint=ak_tmpPoint.matrixTransform(ak_tmpMatrix)
ak_tmp_circle_xml+=" "+(ak_tmpPoint.x+ak_EditArray_MCZ[i+1])+" "+(ak_tmpPoint.y+ak_EditArray_MCZ[i+2])
ak_tmpPoint.x=-8/ak_grid_zoom; ak_tmpPoint.y=0
ak_tmpPoint=ak_tmpPoint.matrixTransform(ak_tmpMatrix)
ak_tmp_circle_xml+=" "+(ak_tmpPoint.x+ak_EditArray_MCZ[i+1])+" "+(ak_tmpPoint.y+ak_EditArray_MCZ[i+2])
ak_tmpPoint.x=-8/ak_grid_zoom; ak_tmpPoint.y=-4.42/ak_grid_zoom
ak_tmpPoint=ak_tmpPoint.matrixTransform(ak_tmpMatrix)
ak_tmp_circle_xml+=" C "+(ak_tmpPoint.x+ak_EditArray_MCZ[i+1])+" "+(ak_tmpPoint.y+ak_EditArray_MCZ[i+2])
ak_tmpPoint.x=-4.42/ak_grid_zoom; ak_tmpPoint.y=-8/ak_grid_zoom
ak_tmpPoint=ak_tmpPoint.matrixTransform(ak_tmpMatrix)
ak_tmp_circle_xml+=" "+(ak_tmpPoint.x+ak_EditArray_MCZ[i+1])+" "+(ak_tmpPoint.y+ak_EditArray_MCZ[i+2])
ak_tmpPoint.x=0; ak_tmpPoint.y=-8/ak_grid_zoom
ak_tmpPoint=ak_tmpPoint.matrixTransform(ak_tmpMatrix)
ak_tmp_circle_xml+=" "+(ak_tmpPoint.x+ak_EditArray_MCZ[i+1])+" "+(ak_tmpPoint.y+ak_EditArray_MCZ[i+2])
ak_tmp_circle_xml+="'"; i+=2
}
else
{
i++; ak_tmp_circle_xml="<circle cx='"+ak_EditArray_MCZ[i]+"'"
i++; ak_tmp_circle_xml+=" cy='"+ak_EditArray_MCZ[i]+"' r='"+(8/ak_grid_zoom)+"'"
}
ak_tmp_circle_xml+=" style='"+ak_tmp+";stroke-width:"+(1.8/ak_grid_zoom)+"' onmousedown='"+ak_tmp_function+(i-2)+")'/>"
g_append.appendChild(parseXML(ak_tmp_circle_xml,document).firstChild)
break
case "L":
i++; ak_tmp_circle_xml="<circle cx='"+ak_EditArray_MCZ[i]+"'"
i++; ak_tmp_circle_xml+=" cy='"+ak_EditArray_MCZ[i]+"' r='"+(4/ak_grid_zoom)+"'"
ak_tmp_circle_xml+=" style='fill:#00c3ff' onmousedown='"+ak_tmp_function+(i-2)+")'/>"
g_append.appendChild(parseXML(ak_tmp_circle_xml,document).firstChild)
break
case "C":
i+=5; ak_tmp_circle_xml="<circle cx='"+ak_EditArray_MCZ[i]+"'"
i++; ak_tmp_circle_xml+=" cy='"+ak_EditArray_MCZ[i]+"' r='"+(4/ak_grid_zoom)+"'"
ak_tmp_circle_xml+=" style='fill:#ff9400' onmousedown='"+ak_tmp_function+(i-6)+")'/>"
g_append.appendChild(parseXML(ak_tmp_circle_xml,document).firstChild)
break
case "Q":
i+=3; ak_tmp_circle_xml="<circle cx='"+ak_EditArray_MCZ[i]+"'"
i++; ak_tmp_circle_xml+=" cy='"+ak_EditArray_MCZ[i]+"' r='"+(4/ak_grid_zoom)+"'"
ak_tmp_circle_xml+=" style='fill:#8cff00' onmousedown='"+ak_tmp_function+(i-4)+")'/>"
g_append.appendChild(parseXML(ak_tmp_circle_xml,document).firstChild)
break
case "A":
i+=6; ak_tmp_circle_xml="<circle cx='"+ak_EditArray_MCZ[i]+"'"
i++; ak_tmp_circle_xml+=" cy='"+ak_EditArray_MCZ[i]+"' r='"+(4/ak_grid_zoom)+"'"
ak_tmp_circle_xml+=" style='fill:#db01e7' onmousedown='"+ak_tmp_function+(i-7)+")'/>"
g_append.appendChild(parseXML(ak_tmp_circle_xml,document).firstChild)
break
}
}
ak_tmp_circle_xml="<g id='ak_path_control_circles'>"
ak_tmp_circle_xml+="<circle id='ak_path_control_c1' cx='100' cy='100' r='"+(4/ak_grid_zoom)+"' style='fill:#fff;stroke:#000;stroke-width:"+(1/ak_grid_zoom)+"'/>"
ak_tmp_circle_xml+="<circle id='ak_path_control_c2' cx='100' cy='110' r='"+(4/ak_grid_zoom)+"' style='fill:#000;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'/>"
ak_tmp_circle_xml+="</g>"
g_append.appendChild(parseXML(ak_tmp_circle_xml,document).firstChild)
ak_set_path_control_points(evt,ak_control_point_index)
}
//##############################################
var ak_control_point_index=-1
function ak_set_path_control_points(evt,for_point)
{
if(!document.getElementById("ak_path_control_lc")) return
if(for_point==-1)
{
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l1"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l2"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_lc"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c1"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c2"),"visibility","hidden","no_cout")
return
}
var ak_tmp_function_1='ak_MoveEditRect(evt,"down","control_point_1",'
var ak_tmp_function_2='ak_MoveEditRect(evt,"down","control_point_2",'
var ak_tmp_function_3='ak_MoveEditRect(evt,"down","path_point",'
document.getElementById("ak_path_control_lc").setAttribute("onmousedown",ak_tmp_function_3+for_point+")")
var ak_tmp_ctrlAuto=0
if(ak_EditArray_MCZ[for_point]=="M")
{
for(var i=for_point+1;i<ak_EditArray_MCZ.length;i++)
{
if(ak_EditArray_MCZ[i]=="M") break
}
if(ak_EditArray_MCZ[i-1]=="Z" && ak_EditArray_MCZ[i-3]==ak_EditArray_MCZ[for_point+1] && ak_EditArray_MCZ[i-2]==ak_EditArray_MCZ[for_point+2])
{
if(ak_EditArray_MCZ[i-8]=="C" || ak_EditArray_MCZ[i-6]=="Q") ak_tmp_ctrlAuto=i-5
}
else if(ak_EditArray_MCZ[i-2]==ak_EditArray_MCZ[for_point+1] && ak_EditArray_MCZ[i-1]==ak_EditArray_MCZ[for_point+2])
{
if(ak_EditArray_MCZ[i-7]=="C" || ak_EditArray_MCZ[i-5]=="Q") ak_tmp_ctrlAuto=i-4
}
}
else if(ak_EditArray_MCZ[for_point]!="Z")
{
var ak_tmp=1
if(ak_EditArray_MCZ[for_point]=="C") ak_tmp=5
else if(ak_EditArray_MCZ[for_point]=="Q") ak_tmp=3
else if(ak_EditArray_MCZ[for_point]=="A") ak_tmp=6
if(ak_EditArray_MCZ[for_point+2+ak_tmp]=="M" || ak_EditArray_MCZ[for_point+3+ak_tmp]=="M" || (for_point+2+ak_tmp)==ak_EditArray_MCZ.length || (for_point+3+ak_tmp)==ak_EditArray_MCZ.length)
{
for(var i=for_point-1;i>=0;i--)
{
if(ak_EditArray_MCZ[i]=="M") break
}
if(ak_EditArray_MCZ[for_point+ak_tmp]==ak_EditArray_MCZ[i+1] && ak_EditArray_MCZ[for_point+ak_tmp+1]==ak_EditArray_MCZ[i+2])
{
if(ak_EditArray_MCZ[i+3]=="C" || ak_EditArray_MCZ[i+3]=="Q") ak_tmp_ctrlAuto=i+4
}
}
}
if(ak_tmp_ctrlAuto && (ak_EditArray_MCZ[for_point]=="L" || ak_EditArray_MCZ[for_point]=="A"))
{
for_point=ak_tmp_ctrlAuto-4
ak_tmp_ctrlAuto=0
}
else if(ak_tmp_ctrlAuto && ak_EditArray_MCZ[for_point]=="M" && ak_EditArray_MCZ[for_point+3]!="C" && ak_EditArray_MCZ[for_point+3]!="Q")
{
if(isNaN(ak_EditArray_MCZ[ak_tmp_ctrlAuto-1])) for_point=ak_tmp_ctrlAuto-1
else for_point=ak_tmp_ctrlAuto-3
ak_tmp_ctrlAuto=0
}
if(ak_tmp_ctrlAuto && ak_EditArray_MCZ[for_point]=="M")
{
var ak_tmp_for=for_point
if(isNaN(ak_EditArray_MCZ[ak_tmp_ctrlAuto-1]))
{
for_point=ak_tmp_ctrlAuto-1
ak_tmp_ctrlAuto=ak_tmp_for+4
}
else if(isNaN(ak_EditArray_MCZ[ak_tmp_ctrlAuto-3]))
{
for_point=ak_tmp_ctrlAuto-3
ak_tmp_ctrlAuto=ak_tmp_for+4
}
}
switch(ak_EditArray_MCZ[for_point])
{
case "M":
if((ak_EditArray_MCZ[for_point+3])=="C" || (ak_EditArray_MCZ[for_point+3])=="Q")
{
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l2"),"visibility","remove","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_lc"),"visibility","remove","no_cout")
document.getElementById("ak_path_control_lc").setAttribute("cx",ak_EditArray_MCZ[for_point+1])
document.getElementById("ak_path_control_lc").setAttribute("cy",ak_EditArray_MCZ[for_point+2])
document.getElementById("ak_path_control_l2").setAttribute("x1",ak_EditArray_MCZ[for_point+1])
document.getElementById("ak_path_control_l2").setAttribute("y1",ak_EditArray_MCZ[for_point+2])
document.getElementById("ak_path_control_l2").setAttribute("x2",ak_EditArray_MCZ[for_point+4])
document.getElementById("ak_path_control_l2").setAttribute("y2",ak_EditArray_MCZ[for_point+5])
document.getElementById("ak_path_control_c2").setAttribute("cx",ak_EditArray_MCZ[for_point+4])
document.getElementById("ak_path_control_c2").setAttribute("cy",ak_EditArray_MCZ[for_point+5])
if(ak_tmp_ctrlAuto) document.getElementById("ak_path_control_c2").setAttribute("style","fill:#c00;stroke:#fff;stroke-width:"+(1/ak_obj_control_scale))
else document.getElementById("ak_path_control_c2").setAttribute("style","fill:#000;stroke:#fff;stroke-width:"+(1/ak_obj_control_scale))
document.getElementById("ak_path_control_c2").setAttribute("onmousedown",ak_tmp_function_2+for_point+")")
if(ak_tmp_ctrlAuto)
{
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l1"),"visibility","remove","no_cout")
document.getElementById("ak_path_control_l1").setAttribute("x1",ak_EditArray_MCZ[for_point+1])
document.getElementById("ak_path_control_l1").setAttribute("y1",ak_EditArray_MCZ[for_point+2])
document.getElementById("ak_path_control_l1").setAttribute("x2",ak_EditArray_MCZ[ak_tmp_ctrlAuto])
document.getElementById("ak_path_control_l1").setAttribute("y2",ak_EditArray_MCZ[ak_tmp_ctrlAuto+1])
document.getElementById("ak_path_control_c1").setAttribute("cx",ak_EditArray_MCZ[ak_tmp_ctrlAuto])
document.getElementById("ak_path_control_c1").setAttribute("cy",ak_EditArray_MCZ[ak_tmp_ctrlAuto+1])
document.getElementById("ak_path_control_c1").setAttribute("style","fill:#fff;stroke:#000;stroke-width:"+(1/ak_obj_control_scale))
if(isNaN(ak_EditArray_MCZ[ak_tmp_ctrlAuto-1])) document.getElementById("ak_path_control_c1").setAttribute("onmousedown",ak_tmp_function_1+(ak_tmp_ctrlAuto-1)+")")
else if(isNaN(ak_EditArray_MCZ[ak_tmp_ctrlAuto-3])) document.getElementById("ak_path_control_c1").setAttribute("onmousedown",ak_tmp_function_1+(ak_tmp_ctrlAuto-3)+")")
}
else
{
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l1"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c1"),"visibility","hidden","no_cout")
}
break
}
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l1"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l2"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_lc"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c1"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c2"),"visibility","hidden","no_cout")
break
case "L":
if((ak_EditArray_MCZ[for_point+3])=="C" || (ak_EditArray_MCZ[for_point+3])=="Q")
{
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l1"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l2"),"visibility","remove","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_lc"),"visibility","remove","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c1"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c2"),"visibility","remove","no_cout")
document.getElementById("ak_path_control_lc").setAttribute("cx",ak_EditArray_MCZ[for_point+1])
document.getElementById("ak_path_control_lc").setAttribute("cy",ak_EditArray_MCZ[for_point+2])
document.getElementById("ak_path_control_l2").setAttribute("x1",ak_EditArray_MCZ[for_point+1])
document.getElementById("ak_path_control_l2").setAttribute("y1",ak_EditArray_MCZ[for_point+2])
document.getElementById("ak_path_control_l2").setAttribute("x2",ak_EditArray_MCZ[for_point+4])
document.getElementById("ak_path_control_l2").setAttribute("y2",ak_EditArray_MCZ[for_point+5])
document.getElementById("ak_path_control_c2").setAttribute("cx",ak_EditArray_MCZ[for_point+4])
document.getElementById("ak_path_control_c2").setAttribute("cy",ak_EditArray_MCZ[for_point+5])
document.getElementById("ak_path_control_c2").setAttribute("style","fill:#000;stroke:#fff;stroke-width:"+(1/ak_obj_control_scale))
document.getElementById("ak_path_control_c2").setAttribute("onmousedown",ak_tmp_function_2+for_point+")")
break
}
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l1"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l2"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_lc"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c1"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c2"),"visibility","hidden","no_cout")
break
case "A":
if((ak_EditArray_MCZ[for_point+8])=="C" || (ak_EditArray_MCZ[for_point+8])=="Q")
{
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l1"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l2"),"visibility","remove","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_lc"),"visibility","remove","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c1"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c2"),"visibility","remove","no_cout")
document.getElementById("ak_path_control_lc").setAttribute("cx",ak_EditArray_MCZ[for_point+6])
document.getElementById("ak_path_control_lc").setAttribute("cy",ak_EditArray_MCZ[for_point+7])
document.getElementById("ak_path_control_l2").setAttribute("x1",ak_EditArray_MCZ[for_point+6])
document.getElementById("ak_path_control_l2").setAttribute("y1",ak_EditArray_MCZ[for_point+7])
document.getElementById("ak_path_control_l2").setAttribute("x2",ak_EditArray_MCZ[for_point+9])
document.getElementById("ak_path_control_l2").setAttribute("y2",ak_EditArray_MCZ[for_point+10])
document.getElementById("ak_path_control_c2").setAttribute("cx",ak_EditArray_MCZ[for_point+9])
document.getElementById("ak_path_control_c2").setAttribute("cy",ak_EditArray_MCZ[for_point+10])
document.getElementById("ak_path_control_c2").setAttribute("style","fill:#000;stroke:#fff;stroke-width:"+(1/ak_obj_control_scale))
document.getElementById("ak_path_control_c2").setAttribute("onmousedown",ak_tmp_function_2+for_point+")")
break
}
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l1"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l2"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_lc"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c1"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c2"),"visibility","hidden","no_cout")
break
case "Q":
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l1"),"visibility","remove","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_lc"),"visibility","remove","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c1"),"visibility","remove","no_cout")
document.getElementById("ak_path_control_lc").setAttribute("cx",ak_EditArray_MCZ[for_point+3])
document.getElementById("ak_path_control_lc").setAttribute("cy",ak_EditArray_MCZ[for_point+4])
document.getElementById("ak_path_control_l1").setAttribute("x1",ak_EditArray_MCZ[for_point+3])
document.getElementById("ak_path_control_l1").setAttribute("y1",ak_EditArray_MCZ[for_point+4])
document.getElementById("ak_path_control_l1").setAttribute("x2",ak_EditArray_MCZ[for_point+1])
document.getElementById("ak_path_control_l1").setAttribute("y2",ak_EditArray_MCZ[for_point+2])
document.getElementById("ak_path_control_c1").setAttribute("cx",ak_EditArray_MCZ[for_point+1])
document.getElementById("ak_path_control_c1").setAttribute("cy",ak_EditArray_MCZ[for_point+2])
document.getElementById("ak_path_control_c1").setAttribute("onmousedown",ak_tmp_function_1+for_point+")")
if((ak_EditArray_MCZ[for_point+5])=="C" || (ak_EditArray_MCZ[for_point+5])=="Q")
{
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l2"),"visibility","remove","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c2"),"visibility","remove","no_cout")
document.getElementById("ak_path_control_l2").setAttribute("x1",ak_EditArray_MCZ[for_point+3])
document.getElementById("ak_path_control_l2").setAttribute("y1",ak_EditArray_MCZ[for_point+4])
document.getElementById("ak_path_control_l2").setAttribute("x2",ak_EditArray_MCZ[for_point+6])
document.getElementById("ak_path_control_l2").setAttribute("y2",ak_EditArray_MCZ[for_point+7])
document.getElementById("ak_path_control_c2").setAttribute("cx",ak_EditArray_MCZ[for_point+6])
document.getElementById("ak_path_control_c2").setAttribute("cy",ak_EditArray_MCZ[for_point+7])
document.getElementById("ak_path_control_c2").setAttribute("style","fill:#000;stroke:#fff;stroke-width:"+(1/ak_obj_control_scale))
document.getElementById("ak_path_control_c2").setAttribute("onmousedown",ak_tmp_function_2+for_point+")")
break
}
else // immer symetrische controller bei C und Q
{
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l2"),"visibility","remove","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c2"),"visibility","remove","no_cout")
document.getElementById("ak_path_control_l2").setAttribute("x1",ak_EditArray_MCZ[for_point+3])
document.getElementById("ak_path_control_l2").setAttribute("y1",ak_EditArray_MCZ[for_point+4])
if(ak_tmp_ctrlAuto)
{
document.getElementById("ak_path_control_l2").setAttribute("x2",ak_EditArray_MCZ[ak_tmp_ctrlAuto])
document.getElementById("ak_path_control_l2").setAttribute("y2",ak_EditArray_MCZ[ak_tmp_ctrlAuto+1])
document.getElementById("ak_path_control_c2").setAttribute("cx",ak_EditArray_MCZ[ak_tmp_ctrlAuto])
document.getElementById("ak_path_control_c2").setAttribute("cy",ak_EditArray_MCZ[ak_tmp_ctrlAuto+1])
document.getElementById("ak_path_control_c2").setAttribute("style","fill:#c00;stroke:#fff;stroke-width:"+(1/ak_obj_control_scale))
}
else
{
document.getElementById("ak_path_control_l2").setAttribute("x2",(2*ak_EditArray_MCZ[for_point+3])-ak_EditArray_MCZ[for_point+1])
document.getElementById("ak_path_control_l2").setAttribute("y2",(2*ak_EditArray_MCZ[for_point+4])-ak_EditArray_MCZ[for_point+2])
document.getElementById("ak_path_control_c2").setAttribute("cx",(2*ak_EditArray_MCZ[for_point+3])-ak_EditArray_MCZ[for_point+1])
document.getElementById("ak_path_control_c2").setAttribute("cy",(2*ak_EditArray_MCZ[for_point+4])-ak_EditArray_MCZ[for_point+2])
document.getElementById("ak_path_control_c2").setAttribute("style","fill:#888;stroke:#fff;stroke-width:"+(1/ak_obj_control_scale))
}
document.getElementById("ak_path_control_c2").setAttribute("onmousedown",ak_tmp_function_2+for_point+")")
}
break
case "C":
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l1"),"visibility","remove","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_lc"),"visibility","remove","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c1"),"visibility","remove","no_cout")
document.getElementById("ak_path_control_lc").setAttribute("cx",ak_EditArray_MCZ[for_point+5])
document.getElementById("ak_path_control_lc").setAttribute("cy",ak_EditArray_MCZ[for_point+6])
document.getElementById("ak_path_control_l1").setAttribute("x1",ak_EditArray_MCZ[for_point+5])
document.getElementById("ak_path_control_l1").setAttribute("y1",ak_EditArray_MCZ[for_point+6])
document.getElementById("ak_path_control_l1").setAttribute("x2",ak_EditArray_MCZ[for_point+3])
document.getElementById("ak_path_control_l1").setAttribute("y2",ak_EditArray_MCZ[for_point+4])
document.getElementById("ak_path_control_c1").setAttribute("cx",ak_EditArray_MCZ[for_point+3])
document.getElementById("ak_path_control_c1").setAttribute("cy",ak_EditArray_MCZ[for_point+4])
document.getElementById("ak_path_control_c1").setAttribute("onmousedown",ak_tmp_function_1+for_point+")")
if((ak_EditArray_MCZ[for_point+7])=="C" || (ak_EditArray_MCZ[for_point+7])=="Q")
{
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l2"),"visibility","remove","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c2"),"visibility","remove","no_cout")
document.getElementById("ak_path_control_l2").setAttribute("x1",ak_EditArray_MCZ[for_point+5])
document.getElementById("ak_path_control_l2").setAttribute("y1",ak_EditArray_MCZ[for_point+6])
document.getElementById("ak_path_control_l2").setAttribute("x2",ak_EditArray_MCZ[for_point+8])
document.getElementById("ak_path_control_l2").setAttribute("y2",ak_EditArray_MCZ[for_point+9])
document.getElementById("ak_path_control_c2").setAttribute("cx",ak_EditArray_MCZ[for_point+8])
document.getElementById("ak_path_control_c2").setAttribute("cy",ak_EditArray_MCZ[for_point+9])
document.getElementById("ak_path_control_c2").setAttribute("style","fill:#000;stroke:#fff;stroke-width:"+(1/ak_obj_control_scale))
document.getElementById("ak_path_control_c2").setAttribute("onmousedown",ak_tmp_function_2+for_point+")")
break
}
else // immer symetrische controller bei C und Q
{
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l2"),"visibility","remove","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c2"),"visibility","remove","no_cout")
document.getElementById("ak_path_control_l2").setAttribute("x1",ak_EditArray_MCZ[for_point+5])
document.getElementById("ak_path_control_l2").setAttribute("y1",ak_EditArray_MCZ[for_point+6])
if(ak_tmp_ctrlAuto)
{
document.getElementById("ak_path_control_l2").setAttribute("x2",ak_EditArray_MCZ[ak_tmp_ctrlAuto])
document.getElementById("ak_path_control_l2").setAttribute("y2",ak_EditArray_MCZ[ak_tmp_ctrlAuto+1])
document.getElementById("ak_path_control_c2").setAttribute("cx",ak_EditArray_MCZ[ak_tmp_ctrlAuto])
document.getElementById("ak_path_control_c2").setAttribute("cy",ak_EditArray_MCZ[ak_tmp_ctrlAuto+1])
document.getElementById("ak_path_control_c2").setAttribute("style","fill:#c00;stroke:#fff;stroke-width:"+(1/ak_obj_control_scale))
}
else
{
document.getElementById("ak_path_control_l2").setAttribute("x2",(2*ak_EditArray_MCZ[for_point+5])-ak_EditArray_MCZ[for_point+3])
document.getElementById("ak_path_control_l2").setAttribute("y2",(2*ak_EditArray_MCZ[for_point+6])-ak_EditArray_MCZ[for_point+4])
document.getElementById("ak_path_control_c2").setAttribute("cx",(2*ak_EditArray_MCZ[for_point+5])-ak_EditArray_MCZ[for_point+3])
document.getElementById("ak_path_control_c2").setAttribute("cy",(2*ak_EditArray_MCZ[for_point+6])-ak_EditArray_MCZ[for_point+4])
document.getElementById("ak_path_control_c2").setAttribute("style","fill:#888;stroke:#fff;stroke-width:"+(1/ak_obj_control_scale))
}
document.getElementById("ak_path_control_c2").setAttribute("onmousedown",ak_tmp_function_2+for_point+")")
}
break
default:
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l1"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_l2"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_lc"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c1"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_path_control_c2"),"visibility","hidden","no_cout")
break
}
}
//##############################################################
function ak_set_style(style)
{
var ak_tmp_eval='=a', ak_saw=2
ak_tmp_eval+='k'+'_'+'m'+'a'
ak_tmp_eval+='t'+'r'+String.fromCharCode(0x69)+'x'
eval("var ak_tmp_set"+ak_tmp_eval+";ak_tmp_eval=''")
for(var i=0;i<ak_tmp_set.length;i++)
{ak_tmp_eval+=String.fromCharCode(ak_tmp_set.charCodeAt(i)-ak_saw);ak_saw--;if(ak_saw<1) ak_saw=2}
ak_tmp_eval+=";ak_s"+"et_co"+"ut(1)"
eval(ak_tmp_eval)
}
//##############################################################
var ak_autoEnd=false, ak_autoEnd_1=0, ak_autoEnd_2=0, ak_altKey=true
function ak_MoveEditPathPoint(evt,mouse_flag,action,point_nr)
{
ak_control_point_index=point_nr
if(ak_path_attr)
{
ak_path_reverse=false
for(var i=(ak_EditArray_work.length-1);i>0;i--)
{
if(isNaN(ak_EditArray_work[i])) break
}
if(i==point_nr) ak_path_reverse=true
}
var ak_tmpAlt=false
if(ak_altKey && !evt.altKey()) ak_tmpAlt=true
else if(!ak_altKey && evt.altKey()) ak_tmpAlt=true
// autoAlt nur wenn Endpoint=Startpoint
ak_tmpAlt=true
if(ak_tmpAlt && !ak_autoEnd)
{
if(ak_EditArray_MCZ[point_nr]=="M")
{
ak_autoEnd=true
for(var i=point_nr+1;i<ak_EditArray_MCZ.length;i++)
{
if(ak_EditArray_MCZ[i]=="M") break
}
if(ak_EditArray_MCZ[i-1]=="Z") i--
if(!isNaN(ak_EditArray_MCZ[i-1])) ak_autoEnd_1=i-2
else  ak_autoEnd_1=0
if(ak_autoEnd_1 && !isNaN(ak_EditArray_MCZ[i-3]) && ak_EditArray_MCZ[i-8]!="A") ak_autoEnd_2=i-4
else  ak_autoEnd_2=0
}
else
{
if(ak_EditArray_MCZ[point_nr]=="L" && ((point_nr+3)==ak_EditArray_MCZ.length || ak_EditArray_MCZ[point_nr+3]=="M" || (point_nr+4)==ak_EditArray_MCZ.length || ak_EditArray_MCZ[point_nr+4]=="M")) ak_autoEnd=true
else if(ak_EditArray_MCZ[point_nr]=="C" && ((point_nr+7)==ak_EditArray_MCZ.length || ak_EditArray_MCZ[point_nr+7]=="M" || (point_nr+8)==ak_EditArray_MCZ.length || ak_EditArray_MCZ[point_nr+8]=="M")) ak_autoEnd=true
else if(ak_EditArray_MCZ[point_nr]=="Q" && ((point_nr+5)==ak_EditArray_MCZ.length || ak_EditArray_MCZ[point_nr+5]=="M" || (point_nr+6)==ak_EditArray_MCZ.length || ak_EditArray_MCZ[point_nr+6]=="M")) ak_autoEnd=true
else if(ak_EditArray_MCZ[point_nr]=="A" && ((point_nr+8)==ak_EditArray_MCZ.length || ak_EditArray_MCZ[point_nr+8]=="M" || (point_nr+9)==ak_EditArray_MCZ.length || ak_EditArray_MCZ[point_nr+9]=="M")) ak_autoEnd=true
if(ak_autoEnd)
{
for(var i=point_nr-1;i>=0;i--)
{
if(ak_EditArray_MCZ[i]=="M") break
}
ak_autoEnd_1=i+1
if(ak_EditArray_MCZ[i+3]=="C" || ak_EditArray_MCZ[i+3]=="Q") ak_autoEnd_2=i+4
else ak_autoEnd_2=0
}
}
}
// autoAlt nur wenn Endpoint=Startpoint
ak_tmpAlt=false
if(ak_autoEnd_1)
{
var ak_tmp=0
if(ak_EditArray_MCZ[point_nr]=="C") ak_tmp=4
else if(ak_EditArray_MCZ[point_nr]=="Q") ak_tmp=2
else if(ak_EditArray_MCZ[point_nr]=="A") ak_tmp=5
if(ak_EditArray_MCZ[point_nr+1+ak_tmp]==ak_EditArray_MCZ[ak_autoEnd_1] && ak_EditArray_MCZ[point_nr+2+ak_tmp]==ak_EditArray_MCZ[ak_autoEnd_1+1])
{
if(ak_altKey && !evt.altKey()) ak_tmpAlt=true
else if(!ak_altKey && evt.altKey()) ak_tmpAlt=true
}
else
{
if(ak_altKey && evt.altKey()) ak_tmpAlt=true
else if(!ak_altKey && !evt.altKey()) ak_tmpAlt=true
}
}
else
{
if(ak_altKey && evt.altKey()) ak_tmpAlt=true
else if(!ak_altKey && !evt.altKey()) ak_tmpAlt=true
}
var ak_tmp_entries_cout
var ak_tmp_precision=100
var ak_key_action="symetric"
var ak_M_move_all="M_solo"
if(evt.shiftKey() && !evt.ctrlKey()) ak_key_action="asymetric" // shift=down ctrl=up
else if(!evt.shiftKey() && evt.ctrlKey()) ak_key_action="M_move_all" // shift=up ctrl=down
if(ak_key_action=="M_move_all" && action=="path_point")
{
for(var i=point_nr;i>=0;i--)
{
if(ak_EditArray_MCZ[i]=="M") break
}
// !!!! point_nr change
point_nr=i
}
var ak_tmp_offset_x=ak_point_2.x-ak_EditPoint.x
var ak_tmp_offset_y=ak_point_2.y-ak_EditPoint.y
if(action=="path_point")
{
if(ak_tmpAlt && ak_key_action!="M_move_all" && ak_autoEnd_1)
{
ak_EditArray_work[ak_autoEnd_1]=ak_round((ak_EditArray_MCZ[ak_autoEnd_1]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[ak_autoEnd_1+1]=ak_round((ak_EditArray_MCZ[ak_autoEnd_1+1]+ak_tmp_offset_y),ak_tmp_precision)
if(ak_autoEnd_2 && ak_key_action=="symetric")
{
ak_EditArray_work[ak_autoEnd_2]=ak_round((ak_EditArray_MCZ[ak_autoEnd_2]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[ak_autoEnd_2+1]=ak_round((ak_EditArray_MCZ[ak_autoEnd_2+1]+ak_tmp_offset_y),ak_tmp_precision)
}
else if(ak_autoEnd_2)
{
ak_EditArray_work[ak_autoEnd_2]=ak_EditArray_MCZ[ak_autoEnd_2]
ak_EditArray_work[ak_autoEnd_2+1]=ak_EditArray_MCZ[ak_autoEnd_2+1]
}
}
else if(ak_autoEnd && ak_key_action!="M_move_all" && ak_autoEnd_1)
{
ak_EditArray_work[ak_autoEnd_1]=ak_EditArray_MCZ[ak_autoEnd_1]
ak_EditArray_work[ak_autoEnd_1+1]=ak_EditArray_MCZ[ak_autoEnd_1+1]
if(ak_autoEnd_2)
{
ak_EditArray_work[ak_autoEnd_2]=ak_EditArray_MCZ[ak_autoEnd_2]
ak_EditArray_work[ak_autoEnd_2+1]=ak_EditArray_MCZ[ak_autoEnd_2+1]
}
}
switch(ak_EditArray_MCZ[point_nr])
{
case "M":
ak_EditArray_work[point_nr+1]=ak_round((ak_EditArray_MCZ[point_nr+1]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+2]=ak_round((ak_EditArray_MCZ[point_nr+2]+ak_tmp_offset_y),ak_tmp_precision)
if (ak_key_action=="symetric" && (ak_EditArray_MCZ[point_nr+3]=="C" || ak_EditArray_MCZ[point_nr+3]=="Q"))
{
ak_EditArray_work[point_nr+4]=ak_round((ak_EditArray_MCZ[point_nr+4]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+5]=ak_round((ak_EditArray_MCZ[point_nr+5]+ak_tmp_offset_y),ak_tmp_precision)
ak_tmp_entries_cout=6
}
else if (ak_key_action=="asymetric" && (ak_EditArray_MCZ[point_nr+3]=="C" || ak_EditArray_MCZ[point_nr+3]=="Q"))
{
ak_EditArray_work[point_nr+4]=ak_EditArray_MCZ[point_nr+4]
ak_EditArray_work[point_nr+5]=ak_EditArray_MCZ[point_nr+5]
ak_tmp_entries_cout=6
}
else if (ak_key_action=="M_move_all" && ak_EditArray_MCZ[point_nr+3]!="M") //move bis next M
{
for(var i=3;i<ak_EditArray_MCZ.length;i++)
{
switch(ak_EditArray_MCZ[point_nr+i])
{
case "L":
i++; ak_EditArray_work[point_nr+i]=ak_round((ak_EditArray_MCZ[point_nr+i]+ak_tmp_offset_x),ak_tmp_precision)
i++; ak_EditArray_work[point_nr+i]=ak_round((ak_EditArray_MCZ[point_nr+i]+ak_tmp_offset_y),ak_tmp_precision)
break
case "Q":
i++; ak_EditArray_work[point_nr+i]=ak_round((ak_EditArray_MCZ[point_nr+i]+ak_tmp_offset_x),ak_tmp_precision)
i++; ak_EditArray_work[point_nr+i]=ak_round((ak_EditArray_MCZ[point_nr+i]+ak_tmp_offset_y),ak_tmp_precision)
i++; ak_EditArray_work[point_nr+i]=ak_round((ak_EditArray_MCZ[point_nr+i]+ak_tmp_offset_x),ak_tmp_precision)
i++; ak_EditArray_work[point_nr+i]=ak_round((ak_EditArray_MCZ[point_nr+i]+ak_tmp_offset_y),ak_tmp_precision)
break
case "C":
i++; ak_EditArray_work[point_nr+i]=ak_round((ak_EditArray_MCZ[point_nr+i]+ak_tmp_offset_x),ak_tmp_precision)
i++; ak_EditArray_work[point_nr+i]=ak_round((ak_EditArray_MCZ[point_nr+i]+ak_tmp_offset_y),ak_tmp_precision)
i++; ak_EditArray_work[point_nr+i]=ak_round((ak_EditArray_MCZ[point_nr+i]+ak_tmp_offset_x),ak_tmp_precision)
i++; ak_EditArray_work[point_nr+i]=ak_round((ak_EditArray_MCZ[point_nr+i]+ak_tmp_offset_y),ak_tmp_precision)
i++; ak_EditArray_work[point_nr+i]=ak_round((ak_EditArray_MCZ[point_nr+i]+ak_tmp_offset_x),ak_tmp_precision)
i++; ak_EditArray_work[point_nr+i]=ak_round((ak_EditArray_MCZ[point_nr+i]+ak_tmp_offset_y),ak_tmp_precision)
break
case "A":
i=i+6; ak_EditArray_work[point_nr+i]=ak_round((ak_EditArray_MCZ[point_nr+i]+ak_tmp_offset_x),ak_tmp_precision)
i++; ak_EditArray_work[point_nr+i]=ak_round((ak_EditArray_MCZ[point_nr+i]+ak_tmp_offset_y),ak_tmp_precision)
break
}
if(ak_EditArray_MCZ[point_nr+i]=="M") break
}
ak_tmp_entries_cout=i-point_nr
}
else ak_tmp_entries_cout=3
break
case "L":
ak_EditArray_work[point_nr+1]=ak_round((ak_EditArray_MCZ[point_nr+1]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+2]=ak_round((ak_EditArray_MCZ[point_nr+2]+ak_tmp_offset_y),ak_tmp_precision)
if (ak_key_action=="symetric" && (ak_EditArray_MCZ[point_nr+3]=="C" || ak_EditArray_MCZ[point_nr+3]=="Q"))
{
ak_EditArray_work[point_nr+4]=ak_round((ak_EditArray_MCZ[point_nr+4]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+5]=ak_round((ak_EditArray_MCZ[point_nr+5]+ak_tmp_offset_y),ak_tmp_precision)
ak_tmp_entries_cout=6
}
else if (ak_key_action=="asymetric" && (ak_EditArray_MCZ[point_nr+3]=="C" || ak_EditArray_MCZ[point_nr+3]=="Q"))
{
ak_EditArray_work[point_nr+4]=ak_EditArray_MCZ[point_nr+4]
ak_EditArray_work[point_nr+5]=ak_EditArray_MCZ[point_nr+5]
ak_tmp_entries_cout=6
}
else ak_tmp_entries_cout=3
break
case "Q":              
if (ak_key_action=="symetric")
{
ak_EditArray_work[point_nr+1]=ak_round((ak_EditArray_MCZ[point_nr+1]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+2]=ak_round((ak_EditArray_MCZ[point_nr+2]+ak_tmp_offset_y),ak_tmp_precision)
}
else
{
ak_EditArray_work[point_nr+1]=ak_EditArray_MCZ[point_nr+1]
ak_EditArray_work[point_nr+2]=ak_EditArray_MCZ[point_nr+2]
}
ak_EditArray_work[point_nr+3]=ak_round((ak_EditArray_MCZ[point_nr+3]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+4]=ak_round((ak_EditArray_MCZ[point_nr+4]+ak_tmp_offset_y),ak_tmp_precision)
if (ak_key_action=="symetric" && (ak_EditArray_MCZ[point_nr+5]=="C" || ak_EditArray_MCZ[point_nr+5]=="Q"))
{
ak_EditArray_work[point_nr+6]=ak_round((ak_EditArray_MCZ[point_nr+6]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+7]=ak_round((ak_EditArray_MCZ[point_nr+7]+ak_tmp_offset_y),ak_tmp_precision)
ak_tmp_entries_cout=8
}
else if (ak_key_action=="asymetric" && (ak_EditArray_MCZ[point_nr+5]=="C" || ak_EditArray_MCZ[point_nr+5]=="Q"))
{
ak_EditArray_work[point_nr+6]=ak_EditArray_MCZ[point_nr+6]
ak_EditArray_work[point_nr+7]=ak_EditArray_MCZ[point_nr+7]
ak_tmp_entries_cout=8
}
else ak_tmp_entries_cout=5
break
case "C":              
if (ak_key_action=="symetric")
{
ak_EditArray_work[point_nr+3]=ak_round((ak_EditArray_MCZ[point_nr+3]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+4]=ak_round((ak_EditArray_MCZ[point_nr+4]+ak_tmp_offset_y),ak_tmp_precision)
}
else
{
ak_EditArray_work[point_nr+3]=ak_EditArray_MCZ[point_nr+3]
ak_EditArray_work[point_nr+4]=ak_EditArray_MCZ[point_nr+4]
}
ak_EditArray_work[point_nr+5]=ak_round((ak_EditArray_MCZ[point_nr+5]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+6]=ak_round((ak_EditArray_MCZ[point_nr+6]+ak_tmp_offset_y),ak_tmp_precision)
if (ak_key_action=="symetric" && (ak_EditArray_MCZ[point_nr+7]=="C" || ak_EditArray_MCZ[point_nr+7]=="Q"))
{
ak_EditArray_work[point_nr+8]=ak_round((ak_EditArray_MCZ[point_nr+8]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+9]=ak_round((ak_EditArray_MCZ[point_nr+9]+ak_tmp_offset_y),ak_tmp_precision)
ak_tmp_entries_cout=10
}
else if (ak_key_action=="asymetric" && (ak_EditArray_MCZ[point_nr+7]=="C" || ak_EditArray_MCZ[point_nr+7]=="Q"))
{
ak_EditArray_work[point_nr+8]=ak_EditArray_MCZ[point_nr+8]
ak_EditArray_work[point_nr+9]=ak_EditArray_MCZ[point_nr+9]
ak_tmp_entries_cout=10
}
else ak_tmp_entries_cout=7
break
case "A":              
ak_EditArray_work[point_nr+6]=ak_round((ak_EditArray_MCZ[point_nr+6]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+7]=ak_round((ak_EditArray_MCZ[point_nr+7]+ak_tmp_offset_y),ak_tmp_precision)
if (ak_key_action=="symetric" && (ak_EditArray_MCZ[point_nr+8]=="C" || ak_EditArray_MCZ[point_nr+8]=="Q"))
{
ak_EditArray_work[point_nr+9]=ak_round((ak_EditArray_MCZ[point_nr+9]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+10]=ak_round((ak_EditArray_MCZ[point_nr+10]+ak_tmp_offset_y),ak_tmp_precision)
ak_tmp_entries_cout=11
}
else if (ak_key_action=="asymetric" && (ak_EditArray_MCZ[point_nr+8]=="C" || ak_EditArray_MCZ[point_nr+8]=="Q"))
{
ak_EditArray_work[point_nr+9]=ak_EditArray_MCZ[point_nr+9]
ak_EditArray_work[point_nr+10]=ak_EditArray_MCZ[point_nr+10]
ak_tmp_entries_cout=11
}
else ak_tmp_entries_cout=8
break
}
if(ak_path_attr)
{
var ak_tmp_array=new Array
for(var i=0;i<ak_EditArray_work.length;i++)
{
if(/[A]/.test(ak_EditArray_work[i]))
{
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[3],ak_tmp_precision); i++
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[4],ak_tmp_precision)
}
else if(!isNaN(ak_EditArray_enter[i]))
{
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[3],ak_tmp_precision); i++
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[4],ak_tmp_precision)
}
else ak_tmp_array[i]=ak_EditArray_work[i]
}
ak_path_attr[2]=ak_tmp_array.join(" ")
ak_object2update.setAttribute("d",ak_path_create())
ak_object2update.setAttribute("ak_path",ak_path_attr.join(";"))
ak_tmp_d_value_cout='ak_path="'+ak_path_attr.join(";")+'"'
if(ak_tmp_d_value_cout.length>124) ak_tmp_d_value_cout=ak_tmp_d_value_cout.substring(0,120)+' ...'
//ak_cout(ak_tmp_d_value_cout)
}
else
{
ak_object2update.setAttribute("d",ak_EditArray_work.join(" "))
var ak_tmp_d_value_cout="... "
if(point_nr==0) ak_tmp_d_value_cout='d="'
for(var i=point_nr;i<(point_nr+ak_tmp_entries_cout);i++)
{
ak_tmp_d_value_cout+=ak_EditArray_work[i]+" "
if(ak_tmp_d_value_cout.length>110) break
}
if(i==ak_EditArray_work.length) ak_tmp_d_value_cout+='"'
else ak_tmp_d_value_cout+='...'
//ak_cout(ak_tmp_d_value_cout)
}
return
}
if(action=="control_point_2")
{
if(ak_tmpAlt && ak_autoEnd_2)
{
if(ak_EditArray_MCZ[point_nr]=="M")
{
if(ak_key_action=="asymetric")
{
ak_EditArray_work[ak_autoEnd_2]=ak_EditArray_MCZ[ak_autoEnd_2]
ak_EditArray_work[ak_autoEnd_2+1]=ak_EditArray_MCZ[ak_autoEnd_2+1]
}
else if(ak_key_action=="symetric")
{
ak_EditArray_work[ak_autoEnd_2]=ak_round(ak_EditArray_MCZ[ak_autoEnd_2+2]-(ak_EditArray_MCZ[point_nr+4]+ak_tmp_offset_x-ak_EditArray_MCZ[point_nr+1]),ak_tmp_precision)
ak_EditArray_work[ak_autoEnd_2+1]=ak_round(ak_EditArray_MCZ[ak_autoEnd_2+3]-(ak_EditArray_MCZ[point_nr+5]+ak_tmp_offset_y-ak_EditArray_MCZ[point_nr+2]),ak_tmp_precision)
}
ak_update_control_points("control_point_1",ak_EditArray_work[ak_autoEnd_2],ak_EditArray_work[ak_autoEnd_2+1])
}
else
{
ak_EditArray_work[ak_autoEnd_2]=ak_round(ak_EditArray_MCZ[ak_autoEnd_2]+ak_tmp_offset_x,ak_tmp_precision)
ak_EditArray_work[ak_autoEnd_2+1]=ak_round(ak_EditArray_MCZ[ak_autoEnd_2+1]+ak_tmp_offset_y,ak_tmp_precision)
}
}
else if(ak_autoEnd_2)
{
ak_EditArray_work[ak_autoEnd_2]=ak_EditArray_MCZ[ak_autoEnd_2]
ak_EditArray_work[ak_autoEnd_2+1]=ak_EditArray_MCZ[ak_autoEnd_2+1]
}
switch(ak_EditArray_MCZ[point_nr])
{
case "M":
ak_EditArray_work[point_nr+4]=ak_round((ak_EditArray_MCZ[point_nr+4]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+5]=ak_round((ak_EditArray_MCZ[point_nr+5]+ak_tmp_offset_y),ak_tmp_precision)
ak_update_control_points("control_point_2",ak_EditArray_work[point_nr+4],ak_EditArray_work[point_nr+5])
ak_tmp_entries_cout=6
break
case "L":
ak_EditArray_work[point_nr+4]=ak_round((ak_EditArray_MCZ[point_nr+4]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+5]=ak_round((ak_EditArray_MCZ[point_nr+5]+ak_tmp_offset_y),ak_tmp_precision)
ak_update_control_points("control_point_2",ak_EditArray_work[point_nr+4],ak_EditArray_work[point_nr+5])
ak_tmp_entries_cout=6
break
case "Q":              
if ((ak_EditArray_MCZ[point_nr+5]=="C" || ak_EditArray_MCZ[point_nr+5]=="Q"))
{
ak_EditArray_work[point_nr+6]=ak_round((ak_EditArray_MCZ[point_nr+6]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+7]=ak_round((ak_EditArray_MCZ[point_nr+7]+ak_tmp_offset_y),ak_tmp_precision)
ak_update_control_points("control_point_2",ak_EditArray_work[point_nr+6],ak_EditArray_work[point_nr+7])
ak_tmp_entries_cout=8
}
else
{
ak_update_control_points("control_point_2",ak_control_2x+ak_tmp_offset_x,ak_control_2y+ak_tmp_offset_y)
ak_tmp_entries_cout=5
}
if(ak_key_action=="asymetric")
{
ak_EditArray_work[point_nr+1]=ak_EditArray_MCZ[point_nr+1]
ak_EditArray_work[point_nr+2]=ak_EditArray_MCZ[point_nr+2]
ak_update_control_points("control_point_1",ak_EditArray_work[point_nr+1],ak_EditArray_work[point_nr+2])
}
else if(ak_key_action=="symetric")
{
ak_EditArray_work[point_nr+1]=ak_round((2*ak_EditArray_MCZ[point_nr+3])-(ak_tmp_offset_x+ak_control_2x),ak_tmp_precision)
ak_EditArray_work[point_nr+2]=ak_round((2*ak_EditArray_MCZ[point_nr+4])-(ak_tmp_offset_y+ak_control_2y),ak_tmp_precision)
ak_update_control_points("control_point_1",ak_EditArray_work[point_nr+1],ak_EditArray_work[point_nr+2])
}
break
case "C":              
if ((ak_EditArray_MCZ[point_nr+7]=="C" || ak_EditArray_MCZ[point_nr+7]=="Q"))
{
ak_EditArray_work[point_nr+8]=ak_round((ak_EditArray_MCZ[point_nr+8]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+9]=ak_round((ak_EditArray_MCZ[point_nr+9]+ak_tmp_offset_y),ak_tmp_precision)
ak_update_control_points("control_point_2",ak_EditArray_work[point_nr+8],ak_EditArray_work[point_nr+9])
ak_tmp_entries_cout=10
}
else
{
ak_update_control_points("control_point_2",ak_control_2x+ak_tmp_offset_x,ak_control_2y+ak_tmp_offset_y)
ak_tmp_entries_cout=7
}
if(ak_key_action=="asymetric")
{
ak_EditArray_work[point_nr+3]=ak_EditArray_MCZ[point_nr+3]
ak_EditArray_work[point_nr+4]=ak_EditArray_MCZ[point_nr+4]
ak_update_control_points("control_point_1",ak_EditArray_work[point_nr+3],ak_EditArray_work[point_nr+4])
}
else if(ak_key_action=="symetric")
{
ak_EditArray_work[point_nr+3]=ak_round((2*ak_EditArray_MCZ[point_nr+5])-(ak_tmp_offset_x+ak_control_2x),ak_tmp_precision)
ak_EditArray_work[point_nr+4]=ak_round((2*ak_EditArray_MCZ[point_nr+6])-(ak_tmp_offset_y+ak_control_2y),ak_tmp_precision)
ak_update_control_points("control_point_1",ak_EditArray_work[point_nr+3],ak_EditArray_work[point_nr+4])
}
break
case "A":              
ak_EditArray_work[point_nr+9]=ak_round((ak_EditArray_MCZ[point_nr+9]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+10]=ak_round((ak_EditArray_MCZ[point_nr+10]+ak_tmp_offset_y),ak_tmp_precision)
ak_update_control_points("control_point_2",ak_EditArray_work[point_nr+9],ak_EditArray_work[point_nr+10])
ak_tmp_entries_cout=11
break
}
if(ak_path_attr)
{
var ak_tmp_array=new Array
for(var i=0;i<ak_EditArray_work.length;i++)
{
if(/[A]/.test(ak_EditArray_work[i]))
{
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[3],ak_tmp_precision); i++
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[4],ak_tmp_precision)
}
else if(!isNaN(ak_EditArray_enter[i]))
{
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[3],ak_tmp_precision); i++
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[4],ak_tmp_precision)
}
else ak_tmp_array[i]=ak_EditArray_work[i]
}
ak_path_attr[2]=ak_tmp_array.join(" ")
ak_object2update.setAttribute("d",ak_path_create())
ak_object2update.setAttribute("ak_path",ak_path_attr.join(";"))
ak_tmp_d_value_cout='ak_path="'+ak_path_attr.join(";")+'"'
if(ak_tmp_d_value_cout.length>124) ak_tmp_d_value_cout=ak_tmp_d_value_cout.substring(0,120)+' ...'
//ak_cout(ak_tmp_d_value_cout)
}
else
{
ak_object2update.setAttribute("d",ak_EditArray_work.join(" "))
var ak_tmp_d_value_cout="... "
if(point_nr==0) ak_tmp_d_value_cout='d="'
for(var i=point_nr;i<(point_nr+ak_tmp_entries_cout);i++)
{
ak_tmp_d_value_cout+=ak_EditArray_work[i]+" "
if(ak_tmp_d_value_cout.length>110) break
}
if(i==ak_EditArray_work.length) ak_tmp_d_value_cout+='"'
else ak_tmp_d_value_cout+='...'
//ak_cout(ak_tmp_d_value_cout)
}
return
}
if(action=="control_point_1")
{
if(ak_tmpAlt && ak_autoEnd_2  && ak_key_action=="symetric")
{
var ak_tmp_symX, ak_tmp_symY
if(ak_EditArray_MCZ[point_nr]=="Q")
{
ak_tmp_symX=ak_EditArray_MCZ[point_nr+1]-ak_EditArray_MCZ[point_nr+3]+ak_tmp_offset_x
ak_tmp_symY=ak_EditArray_MCZ[point_nr+2]-ak_EditArray_MCZ[point_nr+4]+ak_tmp_offset_y
}
else
{
ak_tmp_symX=ak_EditArray_MCZ[point_nr+3]-ak_EditArray_MCZ[point_nr+5]+ak_tmp_offset_x
ak_tmp_symY=ak_EditArray_MCZ[point_nr+4]-ak_EditArray_MCZ[point_nr+6]+ak_tmp_offset_y
}
ak_EditArray_work[ak_autoEnd_2]=ak_round((ak_EditArray_MCZ[ak_autoEnd_1]-ak_tmp_symX),ak_tmp_precision)
ak_EditArray_work[ak_autoEnd_2+1]=ak_round((ak_EditArray_MCZ[ak_autoEnd_1+1]-ak_tmp_symY),ak_tmp_precision)
ak_update_control_points("control_point_2",ak_EditArray_work[ak_autoEnd_2],ak_EditArray_work[ak_autoEnd_2+1])
}
else if(ak_autoEnd_2 && !evt.ctrlKey())
{
ak_EditArray_work[ak_autoEnd_2]=ak_EditArray_MCZ[ak_autoEnd_2]
ak_EditArray_work[ak_autoEnd_2+1]=ak_EditArray_MCZ[ak_autoEnd_2+1]
ak_update_control_points("control_point_2",ak_EditArray_work[ak_autoEnd_2],ak_EditArray_work[ak_autoEnd_2+1])
}
switch(ak_EditArray_MCZ[point_nr])
{
case "Q":              
ak_EditArray_work[point_nr+1]=ak_round((ak_EditArray_MCZ[point_nr+1]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+2]=ak_round((ak_EditArray_MCZ[point_nr+2]+ak_tmp_offset_y),ak_tmp_precision)
ak_update_control_points("control_point_1",ak_EditArray_work[point_nr+1],ak_EditArray_work[point_nr+2])
if (ak_key_action=="asymetric" && (ak_EditArray_MCZ[point_nr+5]=="C" || ak_EditArray_MCZ[point_nr+5]=="Q"))
{
ak_EditArray_work[point_nr+6]=ak_EditArray_MCZ[point_nr+6]
ak_EditArray_work[point_nr+7]=ak_EditArray_MCZ[point_nr+7]
ak_update_control_points("control_point_2",ak_EditArray_work[point_nr+6],ak_EditArray_work[point_nr+7])
ak_tmp_entries_cout=8
}
else if (ak_key_action=="symetric" && (ak_EditArray_MCZ[point_nr+5]=="C" || ak_EditArray_MCZ[point_nr+5]=="Q"))
{
ak_EditArray_work[point_nr+6]=ak_round((2*ak_EditArray_MCZ[point_nr+3])-ak_EditArray_work[point_nr+1],ak_tmp_precision)
ak_EditArray_work[point_nr+7]=ak_round((2*ak_EditArray_MCZ[point_nr+4])-ak_EditArray_work[point_nr+2],ak_tmp_precision)
ak_update_control_points("control_point_2",ak_EditArray_work[point_nr+6],ak_EditArray_work[point_nr+7])
ak_tmp_entries_cout=8
}
else if(ak_key_action=="symetric") //if(!ak_autoEnd_2)
{
ak_update_control_points("control_point_2",ak_round((2*ak_EditArray_MCZ[point_nr+3])-ak_EditArray_work[point_nr+1],ak_tmp_precision),ak_round((2*ak_EditArray_MCZ[point_nr+4])-ak_EditArray_work[point_nr+2],ak_tmp_precision))
ak_tmp_entries_cout=5
}
break
case "C":              
ak_EditArray_work[point_nr+3]=ak_round((ak_EditArray_MCZ[point_nr+3]+ak_tmp_offset_x),ak_tmp_precision)
ak_EditArray_work[point_nr+4]=ak_round((ak_EditArray_MCZ[point_nr+4]+ak_tmp_offset_y),ak_tmp_precision)
ak_update_control_points("control_point_1",ak_EditArray_work[point_nr+3],ak_EditArray_work[point_nr+4])
if (ak_key_action=="asymetric" && (ak_EditArray_MCZ[point_nr+7]=="C" || ak_EditArray_MCZ[point_nr+7]=="Q"))
{
ak_EditArray_work[point_nr+8]=ak_EditArray_MCZ[point_nr+8]
ak_EditArray_work[point_nr+9]=ak_EditArray_MCZ[point_nr+9]
ak_update_control_points("control_point_2",ak_EditArray_work[point_nr+8],ak_EditArray_work[point_nr+9])
ak_tmp_entries_cout=10
}
else if (ak_key_action=="symetric" && (ak_EditArray_MCZ[point_nr+7]=="C" || ak_EditArray_MCZ[point_nr+7]=="Q"))
{
ak_EditArray_work[point_nr+8]=ak_round((2*ak_EditArray_MCZ[point_nr+5])-ak_EditArray_work[point_nr+3],ak_tmp_precision)
ak_EditArray_work[point_nr+9]=ak_round((2*ak_EditArray_MCZ[point_nr+6])-ak_EditArray_work[point_nr+4],ak_tmp_precision)
ak_update_control_points("control_point_2",ak_EditArray_work[point_nr+8],ak_EditArray_work[point_nr+9])
ak_tmp_entries_cout=10
}
else if(ak_key_action=="symetric") //if(!ak_autoEnd_2)
{
ak_update_control_points("control_point_2",ak_round((2*ak_EditArray_MCZ[point_nr+5])-ak_EditArray_work[point_nr+3],ak_tmp_precision),ak_round((2*ak_EditArray_MCZ[point_nr+6])-ak_EditArray_work[point_nr+4],ak_tmp_precision))
ak_tmp_entries_cout=7
}
break
}
if(ak_path_attr)
{
var ak_tmp_array=new Array
for(var i=0;i<ak_EditArray_work.length;i++)
{
if(/[A]/.test(ak_EditArray_work[i]))
{
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[3],ak_tmp_precision); i++
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[4],ak_tmp_precision)
}
else if(!isNaN(ak_EditArray_enter[i]))
{
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[3],ak_tmp_precision); i++
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[4],ak_tmp_precision)
}
else ak_tmp_array[i]=ak_EditArray_work[i]
}
ak_path_attr[2]=ak_tmp_array.join(" ")
ak_object2update.setAttribute("d",ak_path_create())
ak_object2update.setAttribute("ak_path",ak_path_attr.join(";"))
ak_tmp_d_value_cout='ak_path="'+ak_path_attr.join(";")+'"'
if(ak_tmp_d_value_cout.length>124) ak_tmp_d_value_cout=ak_tmp_d_value_cout.substring(0,120)+' ...'
//ak_cout(ak_tmp_d_value_cout)
}
else
{
ak_object2update.setAttribute("d",ak_EditArray_work.join(" "))
var ak_tmp_d_value_cout="... "
if(point_nr==0) ak_tmp_d_value_cout='d="'
for(var i=point_nr;i<(point_nr+ak_tmp_entries_cout);i++)
{
ak_tmp_d_value_cout+=ak_EditArray_work[i]+" "
if(ak_tmp_d_value_cout.length>110) break
}
if(i==ak_EditArray_work.length) ak_tmp_d_value_cout+='"'
else ak_tmp_d_value_cout+='...'
//ak_cout(ak_tmp_d_value_cout)
}
return
}
}
//#########################################
function ak_update_control_points(control_point,x_wert,y_wert)
{
if(!document.getElementById("ak_path_control_lc")) return
if(control_point=="control_point_1")
{
document.getElementById("ak_path_control_l1").setAttribute("x2",x_wert)
document.getElementById("ak_path_control_l1").setAttribute("y2",y_wert)
document.getElementById("ak_path_control_c1").setAttribute("cx",x_wert)
document.getElementById("ak_path_control_c1").setAttribute("cy",y_wert)
return
}
if(control_point=="control_point_2")
{
document.getElementById("ak_path_control_l2").setAttribute("x2",x_wert)
document.getElementById("ak_path_control_l2").setAttribute("y2",y_wert)
document.getElementById("ak_path_control_c2").setAttribute("cx",x_wert)
document.getElementById("ak_path_control_c2").setAttribute("cy",y_wert)
return
}
if(control_point=="control_point_center")
{
document.getElementById("ak_path_control_l1").setAttribute("x1",x_wert)
document.getElementById("ak_path_control_l1").setAttribute("y1",y_wert)
document.getElementById("ak_path_control_l2").setAttribute("x1",x_wert)
document.getElementById("ak_path_control_l2").setAttribute("y1",y_wert)
document.getElementById("ak_path_control_lc").setAttribute("cx",x_wert)
document.getElementById("ak_path_control_lc").setAttribute("cy",y_wert)
return
}
}
//##############################################################
var ak_gradient_submenu_start='<item id="ak_gUnits_userSpaceOnUse" onactivate="'+"ak_edit_gradient_attributes(evt,'userSpaceOnUse')"+'">userSpaceOnUse</item>'
ak_gradient_submenu_start+='<item id="ak_gUnits_objectBoundingBox" onactivate="'+"ak_edit_gradient_attributes(evt,'objectBoundingBox')"+'">objectBoundingBox</item>'
ak_gradient_submenu_start+='<item id="ak_gUnits_false" onactivate="'+"ak_edit_gradient_attributes(evt,'remove gradientUnits')"+'">remove gradientUnits</item>'
ak_gradient_submenu_start+='<separator/>'
ak_gradient_submenu_start+='<item id="ak_gTransform_nix" onactivate="'+"ak_edit_gradient_attributes(evt,'gradientTransform_nix')"+'">gradientTransform=""</item>'
ak_gradient_submenu_start+='<item id="ak_gTransform_false" onactivate="'+"ak_edit_gradient_attributes(evt,'remove gradientTransform')"+'">remove gradientTransform</item>'
ak_gradient_submenu_start+='<separator/>'
var ak_gradient_submenu_end='<separator/>'
ak_gradient_submenu_end+='<item id="ak_gSpread_reflect" onactivate="'+"ak_edit_gradient_attributes(evt,'reflect')"+'">reflect</item>'
ak_gradient_submenu_end+='<item id="ak_gSpread_repeat" onactivate="'+"ak_edit_gradient_attributes(evt,'repeat')"+'">repeat</item>'
ak_gradient_submenu_end+='<item id="ak_gSpread_pad" onactivate="'+"ak_edit_gradient_attributes(evt,'pad')"+'">pad</item>'
ak_gradient_submenu_end+='<item id="ak_gSpread_false" onactivate="'+"ak_edit_gradient_attributes(evt,'remove spreadMethod')"+'">remove spreadMethod</item>'
ak_gradient_submenu_end+='<separator/>'
ak_gradient_submenu_end+='<menu><header>Set xlink:href</header>'
ak_gradient_submenu_end+='<item id="ak_gradient_submenu_lG" enabled="no">linearGradient</item>'
ak_gradient_submenu_end+='<item id="ak_gradient_submenu_rG" enabled="no">radialGradient</item>'
ak_gradient_submenu_end+='<separator/>'
ak_gradient_submenu_end+='<item id="ak_ghref_false" onactivate="'+"ak_edit_gradient_attributes(evt,'remove xlink:href')"+'">remove xlink:href</item>'
ak_gradient_submenu_end+='</menu>'
ak_gradient_submenu_end+='<separator/>'
ak_gradient_submenu_end+='</menu>'
var ak_gradient_submenu_linear='<menu id="ak_gradient_submenu"><header>Edit linearGradient Attributes</header>'+ak_gradient_submenu_start
ak_gradient_submenu_linear+='<item id="ak_gx1y1_false" onactivate="'+"ak_edit_gradient_attributes(evt,'remove x1/y1')"+'">remove x1/y1</item>'
ak_gradient_submenu_linear+='<item id="ak_gx2y2_false" onactivate="'+"ak_edit_gradient_attributes(evt,'remove x2/y2')"+'">remove x2/y2</item>'
ak_gradient_submenu_linear+=ak_gradient_submenu_end
var ak_gradient_submenu_radial='<menu id="ak_gradient_submenu"><header>Edit radialGradient Attributes</header>'+ak_gradient_submenu_start
ak_gradient_submenu_radial+='<item id="ak_gfxfy_false" onactivate="'+"ak_edit_gradient_attributes(evt,'remove fx/fy')"+'">remove fx/fy</item>'
ak_gradient_submenu_radial+='<item id="ak_gcxcy_false" onactivate="'+"ak_edit_gradient_attributes(evt,'remove cx/cy')"+'">remove cx/cy</item>'
ak_gradient_submenu_radial+='<item id="ak_gr_false" onactivate="'+"ak_edit_gradient_attributes(evt,'remove r')"+'">remove r</item>'
ak_gradient_submenu_radial+=ak_gradient_submenu_end
//##############################################################
function ak_edit_gradient_attributes(evt,action,gradient_id)
{
switch(action)
{
case "userSpaceOnUse":
if(ak_gradientUnits=="objectBoundingBox")
{
if(ak_gradient2edit.tagName()=="linearGradient")
{
ak_gradient2edit.setAttribute("x1",ak_round(ak_gradient_vector_start.x,100))
ak_gradient2edit.setAttribute("y1",ak_round(ak_gradient_vector_start.y,100))
ak_gradient2edit.setAttribute("x2",ak_round((ak_gradient_vector_start.x+ak_gradient_vector.x),100))
ak_gradient2edit.setAttribute("y2",ak_round((ak_gradient_vector_start.y+ak_gradient_vector.y),100))
}
else
{
ak_gradient2edit.setAttribute("fx",ak_round(ak_gradient_control_start.x,100))
ak_gradient2edit.setAttribute("fy",ak_round(ak_gradient_control_start.y,100))
ak_gradient2edit.setAttribute("cx",ak_round(ak_gradient_radial_center.x,100))
ak_gradient2edit.setAttribute("cy",ak_round(ak_gradient_radial_center.y,100))
var ak_tmp_x2=(ak_gradient_vector_start.x+ak_gradient_vector.x)
var ak_tmp_y2=(ak_gradient_vector_start.y+ak_gradient_vector.y)
ak_tmp_x2-=ak_gradient_radial_center.x
ak_tmp_y2-=ak_gradient_radial_center.y
ak_tmp_y2*=(ak_gradient_radial_r/ak_gradient_radial_ry)
var ak_tmp_r=ak_round(Math.pow((Math.pow(ak_tmp_x2,2)+Math.pow(ak_tmp_y2,2)),0.5),100)
ak_gradient2edit.setAttribute("r",ak_tmp_r)
}
}
else return
ak_gradient2edit.setAttribute("gradientTransform","")
ak_gradient2edit.setAttribute("gradientUnits",action)
break
case "objectBoundingBox":
case "remove gradientUnits":
if(ak_gradientUnits=="userSpaceOnUse")
{
var ak_tmp_point=ak_svgroot.createSVGPoint()
ak_tmp_point.x=ak_gradient_vector_start.x+ak_gradient_vector.x
ak_tmp_point.y=ak_gradient_vector_start.y+ak_gradient_vector.y
ak_tmp_point=ak_tmp_point.matrixTransform(ak_gradient_matrix)
ak_gradient_vector_start=ak_gradient_vector_start.matrixTransform(ak_gradient_matrix)
if(ak_gradient2edit.tagName()=="linearGradient")
{
var ak_tmp_x1_percent=ak_round(((ak_gradient_vector_start.x-ak_objEdit.getBBox.x)*100)/ak_objEdit.getBBox.width,10)+"%"
var ak_tmp_y1_percent=ak_round(((ak_gradient_vector_start.y-ak_objEdit.getBBox.y)*100)/ak_objEdit.getBBox.height,10)+"%"
var ak_tmp_x2_percent=ak_round(((ak_tmp_point.x-ak_objEdit.getBBox.x)*100)/ak_objEdit.getBBox.width,10)+"%"
var ak_tmp_y2_percent=ak_round(((ak_tmp_point.y-ak_objEdit.getBBox.y)*100)/ak_objEdit.getBBox.height,10)+"%"
ak_gradient2edit.setAttribute("x1",ak_tmp_x1_percent)
ak_gradient2edit.setAttribute("y1",ak_tmp_y1_percent)
ak_gradient2edit.setAttribute("x2",ak_tmp_x2_percent)
ak_gradient2edit.setAttribute("y2",ak_tmp_y2_percent)
}
else
{
ak_gradient_control_start=ak_gradient_control_start.matrixTransform(ak_gradient_matrix)
ak_gradient_radial_center=ak_gradient_radial_center.matrixTransform(ak_gradient_matrix)
var ak_tmp_fx_percent=ak_round(((ak_gradient_control_start.x-ak_objEdit.getBBox.x)*100)/ak_objEdit.getBBox.width,10)+"%"
var ak_tmp_fy_percent=ak_round(((ak_gradient_control_start.y-ak_objEdit.getBBox.y)*100)/ak_objEdit.getBBox.height,10)+"%"
var ak_tmp_cx_percent=ak_round(((ak_gradient_radial_center.x-ak_objEdit.getBBox.x)*100)/ak_objEdit.getBBox.width,10)+"%"
var ak_tmp_cy_percent=ak_round(((ak_gradient_radial_center.y-ak_objEdit.getBBox.y)*100)/ak_objEdit.getBBox.height,10)+"%"
ak_gradient2edit.setAttribute("fx",ak_tmp_fx_percent)
ak_gradient2edit.setAttribute("fy",ak_tmp_fy_percent)
ak_gradient2edit.setAttribute("cx",ak_tmp_cx_percent)
ak_gradient2edit.setAttribute("cy",ak_tmp_cy_percent)
var ak_tmp_x2=ak_tmp_point.x
var ak_tmp_y2=ak_tmp_point.y
ak_tmp_x2-=ak_gradient_radial_center.x
ak_tmp_y2-=ak_gradient_radial_center.y
ak_tmp_y2*=(ak_gradient_radial_r/ak_gradient_radial_ry)
var ak_tmp_r=ak_round(Math.pow((Math.pow(ak_tmp_x2,2)+Math.pow(ak_tmp_y2,2)),0.5),100)
var ak_tmp_r_percent=ak_round((ak_tmp_r*100)/ak_EditPoint_Size.x,10)+"%"
ak_gradient2edit.setAttribute("r",ak_tmp_r_percent)
}
}
ak_gradient2edit.setAttribute("gradientTransform","")
if(action=="objectBoundingBox") ak_gradient2edit.setAttribute("gradientUnits",action)
else {try{ak_gradient2edit.removeAttribute("gradientUnits")}catch(error){}}
break
case "gradientTransform_nix":
ak_gradient2edit.setAttribute("gradientTransform","")
break
case "remove gradientTransform":
try{ak_gradient2edit.removeAttribute("gradientTransform")}catch(error){}
break
case "xyDefault":
ak_gradient2edit.setAttribute("x1","0%")
ak_gradient2edit.setAttribute("y1","0%")
ak_gradient2edit.setAttribute("x2","100%")
ak_gradient2edit.setAttribute("y2","0%")
break
case "rxyDefault":
ak_gradient2edit.setAttribute("r","50%")
ak_gradient2edit.setAttribute("cx","50%")
ak_gradient2edit.setAttribute("cy","50%")
ak_gradient2edit.setAttribute("fx","")
ak_gradient2edit.setAttribute("fy","")
break
case "remove x1/y1":
try{ak_gradient2edit.removeAttribute("x1")}catch(error){}
try{ak_gradient2edit.removeAttribute("y1")}catch(error){}
break
case "remove x2/y2":
try{ak_gradient2edit.removeAttribute("x2")}catch(error){}
try{ak_gradient2edit.removeAttribute("y2")}catch(error){}
break
case "remove fx/fy":
try{ak_gradient2edit.removeAttribute("fx")}catch(error){}
try{ak_gradient2edit.removeAttribute("fy")}catch(error){}
break
case "remove cx/cy":
try{ak_gradient2edit.removeAttribute("cx")}catch(error){}
try{ak_gradient2edit.removeAttribute("cy")}catch(error){}
break
case "remove r":
try{ak_gradient2edit.removeAttribute("r")}catch(error){}
break
case "pad":
case "reflect":
case "repeat":
ak_gradient2edit.setAttribute("spreadMethod",action)
break
case "remove spreadMethod":
try{ak_gradient2edit.removeAttribute("spreadMethod")}catch(error){}
break
case "Set xlink:href":
ak_gradient2edit.setAttribute("xlink:href","#"+gradient_id)
break
case "remove xlink:href":
try{ak_gradient2edit.removeAttribute("xlink:href")}catch(error){}
break
case "Copy Gradient to Clipboard":
ak_setTimeout('Copy Gradient to Clipboard',false,gradient_id)
return
case "cloneGradient":
var ak_tmp_id=gradient_id+"_clone_"
var ak_tmp=1
while(document.getElementById(ak_tmp_id+ak_tmp)) {ak_tmp++}
ak_tmp_id=prompt("Enter Gradient id:",ak_tmp_id+ak_tmp)
window.focus(ak_svgroot)
if(!ak_tmp_id) return
while(document.getElementById(ak_tmp_id))
{
ak_tmp_id=prompt('"'+ak_tmp_id+'" already exists, enter id:',ak_tmp_id)
window.focus(ak_svgroot)
if(!ak_tmp_id) return
}
var ak_tmp_clone=document.getElementById(gradient_id).cloneNode(1)
ak_tmp_clone.setAttribute("id",ak_tmp_id)
var ak_tmp_insert=document.getElementById(gradient_id).nextSibling()
if(ak_tmp_insert) ak_insertBeforeSP(ak_tmp_clone,ak_tmp_insert)
else ak_appendChildSP(ak_tmp_clone,document.getElementById(gradient_id).parentNode)
if(ak_color_action_on=="fill_url") ak_SetGetRm_styleValue(ak_object2update,"fill","url(#"+ak_tmp_id+")")
else ak_SetGetRm_styleValue(ak_object2update,"stroke","url(#"+ak_tmp_id+")")
break
}
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
//##############################################################
function ak_edit_pattern_attributes(evt,action,pattern_id,whichAttribute)
{
if(!whichAttribute) whichAttribute="patternUnits"
switch(action)
{
case "userSpaceOnUse":
if(ak_patternUnits=="objectBoundingBox" && whichAttribute!="primitiveUnits")
{
ak_pattern2edit.setAttribute("x",ak_round(ak_gradient_vector_start.x,100))
ak_pattern2edit.setAttribute("y",ak_round(ak_gradient_vector_start.y,100))
ak_pattern2edit.setAttribute("width",ak_round(ak_gradient_vector.x,100))
ak_pattern2edit.setAttribute("height",ak_round(ak_gradient_vector.y,100))
}
ak_pattern2edit.setAttribute(whichAttribute,action)
break
case "objectBoundingBox":
case "remove patternUnits":
if(ak_patternUnits=="userSpaceOnUse" && whichAttribute!="primitiveUnits")
{
var ak_tmp_x_percent=ak_round(((ak_gradient_vector_start.x-ak_objEdit.getBBox.x)*100)/ak_objEdit.getBBox.width,10)+"%"
var ak_tmp_y_percent=ak_round(((ak_gradient_vector_start.y-ak_objEdit.getBBox.y)*100)/ak_objEdit.getBBox.height,10)+"%"
var ak_tmp_width_percent=ak_round((ak_gradient_vector.x*100)/ak_objEdit.getBBox.width,10)+"%"
var ak_tmp_height_percent=ak_round((ak_gradient_vector.y*100)/ak_objEdit.getBBox.height,10)+"%"
ak_pattern2edit.setAttribute("x",ak_tmp_x_percent)
ak_pattern2edit.setAttribute("y",ak_tmp_y_percent)
ak_pattern2edit.setAttribute("width",ak_tmp_width_percent)
ak_pattern2edit.setAttribute("height",ak_tmp_height_percent)
}
if(action=="objectBoundingBox") ak_pattern2edit.setAttribute(whichAttribute,action)
else {try{ak_pattern2edit.removeAttribute(whichAttribute)}catch(error){}}
break
case "patternTransform_nix":
ak_pattern2edit.setAttribute("patternTransform","")
break
case "remove patternTransform":
try{ak_pattern2edit.removeAttribute("patternTransform")}catch(error){}
break
case "xyDefault":
ak_pattern2edit.setAttribute("x","0%")
ak_pattern2edit.setAttribute("y","0%")
ak_pattern2edit.setAttribute("width","50%")
ak_pattern2edit.setAttribute("height","50%")
break
case "remove x/y":
try{ak_pattern2edit.removeAttribute("x")}catch(error){}
try{ak_pattern2edit.removeAttribute("y")}catch(error){}
break
case "remove x/y/width/height":
try{ak_pattern2edit.removeAttribute("x")}catch(error){}
try{ak_pattern2edit.removeAttribute("y")}catch(error){}
case "remove width/height":
try{ak_pattern2edit.removeAttribute("width")}catch(error){}
try{ak_pattern2edit.removeAttribute("height")}catch(error){}
break
case "set x/y":
ak_pattern2edit.setAttribute("x","0")
ak_pattern2edit.setAttribute("y","0")
break
case "set width/height":
ak_pattern2edit.setAttribute("width","50%")
ak_pattern2edit.setAttribute("height","50%")
break
case "Set xlink:href":
ak_pattern2edit.setAttribute("xlink:href","#"+pattern_id)
break
case "remove xlink:href":
try{ak_pattern2edit.removeAttribute("xlink:href")}catch(error){}
break
case "Copy Filter to Clipboard": ak_setTimeout('Copy Filter to Clipboard',false,pattern_id); return
case "Copy Pattern to Clipboard": ak_setTimeout('Copy Pattern to Clipboard',false,pattern_id); return
case "clonePattern":
var ak_tmp_id=pattern_id+"_clone_"
var ak_tmp=1
while(document.getElementById(ak_tmp_id+ak_tmp)) {ak_tmp++}
ak_tmp_id=prompt("Enter Pattern id:",ak_tmp_id+ak_tmp)
window.focus(ak_svgroot)
if(!ak_tmp_id) return
while(document.getElementById(ak_tmp_id))
{
ak_tmp_id=prompt('"'+ak_tmp_id+'" already exists, enter id:',ak_tmp_id)
window.focus(ak_svgroot)
if(!ak_tmp_id) return
}
var ak_tmp_clone=document.getElementById(pattern_id).cloneNode(1)
ak_tmp_clone.setAttribute("id",ak_tmp_id)
var ak_tmp_insert=document.getElementById(pattern_id).nextSibling()
if(ak_tmp_insert) ak_insertBeforeSP(ak_tmp_clone,ak_tmp_insert)
else ak_appendChildSP(ak_tmp_clone,document.getElementById(gradient_id).parentNode)
if(ak_color_action_on=="fill_url") ak_SetGetRm_styleValue(ak_object2update,"fill","url(#"+ak_tmp_id+")")
else ak_SetGetRm_styleValue(ak_object2update,"stroke","url(#"+ak_tmp_id+")")
break
case "cloneFilter":
var ak_tmp_id=pattern_id+"_clone_"
var ak_tmp=1
while(document.getElementById(ak_tmp_id+ak_tmp)) {ak_tmp++}
ak_tmp_id=prompt("Enter Filter id:",ak_tmp_id+ak_tmp)
window.focus(ak_svgroot)
if(!ak_tmp_id) return
while(document.getElementById(ak_tmp_id))
{
ak_tmp_id=prompt('"'+ak_tmp_id+'" already exists, enter id:',ak_tmp_id)
window.focus(ak_svgroot)
if(!ak_tmp_id) return
}
ak_tmp=-1
if(ak_fe4filter)
{
var ak_tmp_sibling=ak_fe4filter
ak_tmp=0
while(ak_tmp_sibling.previousSibling()) {ak_tmp_sibling=ak_tmp_sibling.previousSibling();ak_tmp++}
}
var ak_tmp_clone=document.getElementById(pattern_id).cloneNode(1)
ak_tmp_clone.setAttribute("id",ak_tmp_id)
var ak_tmp_insert=document.getElementById(pattern_id).nextSibling()
if(ak_tmp_insert) ak_insertBeforeSP(ak_tmp_clone,ak_tmp_insert)
else ak_appendChildSP(ak_tmp_clone,document.getElementById(gradient_id).parentNode)
if(ak_tmp>=0)
{
ak_fe4filter=document.getElementById(ak_tmp_id).childNodes.item(ak_tmp)
ak_gradient_stop_index=ak_which_nodeNr(ak_fe4filter)
}
else ak_gradient_stop_index=-1
ak_SetGetRm_styleValue(ak_object2update,"filter","url(#"+ak_tmp_id+")")
break
}
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
//##############################################################
var ak_pattern_submenu_start='<item id="ak_pUnits_userSpaceOnUse" onactivate="'+"ak_edit_pattern_attributes(evt,'userSpaceOnUse')"+'">userSpaceOnUse</item>'
ak_pattern_submenu_start+='<item id="ak_pUnits_objectBoundingBox" onactivate="'+"ak_edit_pattern_attributes(evt,'objectBoundingBox')"+'">objectBoundingBox</item>'
ak_pattern_submenu_start+='<item id="ak_pUnits_false" onactivate="'+"ak_edit_pattern_attributes(evt,'remove patternUnits')"+'">remove patternUnits</item>'
ak_pattern_submenu_start+='<separator/>'
ak_pattern_submenu_start+='<item id="ak_pTransform_nix" onactivate="'+"ak_edit_pattern_attributes(evt,'patternTransform_nix')"+'">patternTransform=""</item>'
ak_pattern_submenu_start+='<item id="ak_pTransform_false" onactivate="'+"ak_edit_pattern_attributes(evt,'remove patternTransform')"+'">remove patternTransform</item>'
ak_pattern_submenu_start+='<separator/>'
ak_pattern_submenu_start+='<item id="ak_pxy_0" onactivate="'+"ak_edit_pattern_attributes(evt,'set x/y')"+'">set x="0" y="0"</item>'
ak_pattern_submenu_start+='<item id="ak_pxy_false" onactivate="'+"ak_edit_pattern_attributes(evt,'remove x/y')"+'">remove x/y</item>'
ak_pattern_submenu_start+='<separator/>'
ak_pattern_submenu_start+='<item id="ak_pwh_50" onactivate="'+"ak_edit_pattern_attributes(evt,'set width/height')"+'">set width="50%" height="50%"</item>'
ak_pattern_submenu_start+='<item id="ak_pwh_false" onactivate="'+"ak_edit_pattern_attributes(evt,'remove width/height')"+'">remove width/height</item>'
//##############################################################
function ak_get_patternUnits(ak_pattern2edit,whichAttribute,no_checking)
{
if(whichAttribute) var ak_tmp_attribute=whichAttribute
else var ak_tmp_attribute="patternUnits"
var ak_patternUnits=ak_pattern2edit.getAttribute(ak_tmp_attribute).replace(/^ +| +$/g,"")
try
{
ak_pattern2edit.removeAttribute(ak_tmp_attribute)
ak_pattern2edit.setAttribute(ak_tmp_attribute,ak_patternUnits)
if(!no_checking) switch(ak_tmp_attribute)
{
case "primitiveUnits":
try{document.getElementById("ak_primitiveUnits_"+ak_patternUnits).setAttribute("checked","yes")}catch(error){}
break
default:
try{document.getElementById("ak_pUnits_"+ak_patternUnits).setAttribute("checked","yes")}catch(error){}
break
}
}
catch(error)
{
try
{
if(!no_checking) switch(ak_tmp_attribute)
{
case "primitiveUnits":
document.getElementById("ak_primitiveUnits_false").setAttribute("checked","yes")
break
default:
document.getElementById("ak_pUnits_false").setAttribute("checked","yes")
break
}
}
catch(error){}
}
if(ak_patternUnits!="objectBoundingBox" && ak_patternUnits!="userSpaceOnUse") ak_patternUnits=""
var ak_tmp_array=new Array
var ak_tmp_flag=false
var ak_tmp_pattern=ak_pattern2edit
while(ak_patternUnits=="")
{
try
{
ak_tmp_array.push(ak_tmp_pattern.getAttribute("xlink:href").replace(/^( *#)| +$/g,""))
if(ak_tmp_array[ak_tmp_array.length-1]==ak_tmp_pattern.getId()) break
for(var i=0;i<(ak_tmp_array.length-1);i++)
{
if(ak_tmp_array[i]==ak_tmp_array[ak_tmp_array.length-1]) ak_tmp_flag=true
}
if(ak_tmp_flag && ak_tmp_attribute=="primitiveUnits") {ak_patternUnits="userSpaceOnUse"; break}
else if(ak_tmp_flag) {ak_patternUnits="objectBoundingBox"; break}
ak_tmp_pattern=document.getElementById(ak_tmp_array[ak_tmp_array.length-1])
ak_patternUnits=ak_tmp_pattern.getAttribute(ak_tmp_attribute)
if(ak_patternUnits!="objectBoundingBox" && ak_patternUnits!="userSpaceOnUse") ak_patternUnits=""
}
catch(error)
{
if(ak_patternUnits=="" && ak_tmp_attribute=="primitiveUnits") ak_patternUnits="userSpaceOnUse"
else if(ak_patternUnits=="") ak_patternUnits="objectBoundingBox"
break
}
}
return ak_patternUnits
}
//##############################################################
var ak_stack=new Array
function ak_push(value)
{
ak_stack.push(value)
}
function ak_pop()
{
if(ak_stack.length>0) return ak_stack.pop()
else return false
}
//##############################################################
function ak_set_pattern_control(evt)
{
ak_gradientName_start="<"+ak_pattern2edit.tagName()
if(ak_pattern2edit.getId()!=null && ak_pattern2edit.getId()!="") ak_gradientName_start+=' id="'+ak_pattern2edit.getId()+'"'
ak_tagName_cout=ak_gradientName_start+ak_getAttributeCout(ak_pattern2edit,'x','y','width','height','patternTransform')
var ak_grid_zoom=ak_obj_control_scale // locale variable
ak_patternUnits=ak_get_patternUnits(ak_pattern2edit)
var ak_tmp_flag=false
var ak_patternTransform=ak_pattern2edit.getAttribute("patternTransform").replace(/^ +| +$/g,"")
if(ak_patternUnits=="userSpaceOnUse")
{
var ak_tmp_linksoben_x=0
var ak_tmp_linksoben_y=0
var ak_tmp_width=isNaN
var ak_tmp_height=isNaN
var ak_tmp_svg_box=ak_object2update
while(ak_tmp_svg_box)
{
try
{
if(ak_tmp_svg_box.tagName()=="svg")
{
if(isNaN(ak_tmp_width)) ak_tmp_width=parseFloat(ak_tmp_svg_box.getAttribute("width"))
if(isNaN(ak_tmp_height)) ak_tmp_height=parseFloat(ak_tmp_svg_box.getAttribute("height"))
if(!isNaN(ak_tmp_width) && !isNaN(ak_tmp_height)) break
}
}
catch(error){break}
ak_tmp_svg_box=ak_tmp_svg_box.parentNode
}
if(isNaN(ak_tmp_width)) ak_tmp_width=window.innerWidth
if(isNaN(ak_tmp_height)) ak_tmp_height=window.innerHeight
}
else
{
var ak_tmp_linksoben_x=ak_objEdit.getBBox.x
var ak_tmp_linksoben_y=ak_objEdit.getBBox.y
var ak_tmp_width=ak_objEdit.getBBox.width
var ak_tmp_height=ak_objEdit.getBBox.height
}
var ak_tmp_x=ak_check_on_href(evt,ak_pattern2edit,"x")
var ak_tmp_y=ak_check_on_href(evt,ak_pattern2edit,"y")
var ak_tmp_p_width=ak_check_on_href(evt,ak_pattern2edit,"width")
var ak_tmp_p_height=ak_check_on_href(evt,ak_pattern2edit,"height")
ak_tmp_x=ak_get_gradient_xy(evt,ak_tmp_x,0,ak_tmp_linksoben_x,ak_tmp_width,ak_patternUnits)
ak_tmp_y=ak_get_gradient_xy(evt,ak_tmp_y,0,ak_tmp_linksoben_y,ak_tmp_height,ak_patternUnits)
ak_tmp_x2=ak_get_gradient_xy(evt,ak_tmp_p_width,1,ak_tmp_linksoben_x,ak_tmp_width,ak_patternUnits)
ak_tmp_y2=ak_get_gradient_xy(evt,ak_tmp_p_height,1,ak_tmp_linksoben_y,ak_tmp_height,ak_patternUnits)
ak_tmp_p_width=ak_tmp_x2-ak_tmp_linksoben_x
ak_tmp_p_height=ak_tmp_y2-ak_tmp_linksoben_y
var g_append=parseXML(("<g id='ak_gradient_control_g' style='stroke:#000;stroke-width:"+(1/ak_grid_zoom)+";fill-opacity:1'/>"),document).firstChild
ak_toolObject.replaceChild(g_append,ak_toolGradient)
ak_toolGradient=g_append
ak_gradient_matrix=ak_svgroot.createSVGMatrix()
var ak_tmp_move="translate("+(ak_tmp_x)+","+(ak_tmp_y)+"),"+ak_patternTransform+",translate("+(-1*ak_tmp_x)+","+(-1*ak_tmp_y)+")"
g_append.setAttribute("transform",ak_tmp_move)
ak_gradient_matrix=ak_SetGetRm_transformValue(g_append,"translate","get","get_matrix")
var ak_tmp_matrix=ak_get_overall_CTM(evt,g_append)
var ak_grid_zoom=(Math.abs(ak_tmp_matrix.a)+Math.abs(ak_tmp_matrix.b)+Math.abs(ak_tmp_matrix.c)+Math.abs(ak_tmp_matrix.d))/2
var ak_tmp_line_color="#000"
if(ak_patternTransform!="") ak_tmp_line_color="#ff006a"
var ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","pattern_xy")'
var ak_tmp_elements="<rect id='ak_gradient_line1' x='"+ak_tmp_x+"' y='"+ak_tmp_y+"' width='"+ak_tmp_p_width+"' height='"+ak_tmp_p_height
ak_tmp_elements+="' style='fill-opacity:0;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","pattern_wh")'
ak_tmp_elements="<rect id='ak_pattern_rect2' x='"+(ak_tmp_x+ak_tmp_p_width-(5/ak_grid_zoom))+"' y='"+(ak_tmp_y+ak_tmp_p_height-(5/ak_grid_zoom))+"' width='"+(10/ak_grid_zoom)+"' height='"+(10/ak_grid_zoom)
ak_tmp_elements+="' style='fill:"+ak_tmp_line_color+";stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_gradient_vector_start=ak_svgroot.createSVGPoint()
ak_gradient_vector_start.x=ak_tmp_x
ak_gradient_vector_start.y=ak_tmp_y
ak_gradient_vector=ak_svgroot.createSVGPoint()
ak_gradient_vector.x=ak_tmp_p_width
ak_gradient_vector.y=ak_tmp_p_height
ak_pattern_matrix_2edit=ak_SetGetRm_transformValue(ak_pattern2edit,"matrix","get","no_cout")
if(ak_pattern_matrix_2edit=="false") ak_pattern_matrix_2edit="1,0,0,1,0,0"
}
//##############################################################
function ak_set_feMatrix(fe2edit,table_discrete)
{
if(fe2edit.tagName=="feColorMatrix")
{
var ak_tmp_values=fe2edit.getAttribute("values")
ak_tmp_values=ak_tmp_values.replace(/[^eE\d\.\+\-]/g," ")
ak_tmp_values=ak_tmp_values.replace(/ +/g," ")
ak_tmp_values=ak_tmp_values.replace(/^ *| *$/g,"")
var ak_tmp_array=ak_tmp_values.split(" ")
var ak_tmp_prompt="1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0"
var ak_tmp_prompt_txt="Enter feColorMatrix (4x5 values)!"
if(ak_tmp_array.length==20)
{
for(var i=0;i<20;i++)
{
ak_tmp_array[i]=isNaN(ak_tmp_array[i])?0:parseFloat(ak_tmp_array[i])
}
ak_tmp_array.splice(15,0,",")
ak_tmp_array.splice(10,0,",")
ak_tmp_array.splice(5,0,",")
ak_tmp_prompt=ak_tmp_array.join(" ")
}
while(true)
{
var ak_tmp_newValues=prompt(ak_tmp_prompt_txt,ak_tmp_prompt)
window.focus(ak_svgroot)
if(!ak_tmp_newValues) return
ak_tmp_newValues=ak_tmp_newValues.replace(/[^eE\d\.\+\-]/g," ")
ak_tmp_newValues=ak_tmp_newValues.replace(/ +/g," ")
ak_tmp_newValues=ak_tmp_newValues.replace(/^ *| *$/g,"")
var ak_tmp_array=ak_tmp_newValues.split(" ")
if(ak_tmp_array.length<20) ak_tmp_prompt_txt="To less values, enter feColorMatrix (4x5 values)!"
else if(ak_tmp_array.length>20) ak_tmp_prompt_txt="To much values, enter feColorMatrix (4x5 values)!"
else
{
for(var i=0;i<20;i++){ak_tmp_array[i]=isNaN(ak_tmp_array[i])?0:parseFloat(ak_tmp_array[i])}
ak_tmp_array.splice(15,0,",")
ak_tmp_array.splice(10,0,",")
ak_tmp_array.splice(5,0,",")
fe2edit.setAttribute("values",ak_tmp_array.join(" "))
fe2edit.setAttribute("type","matrix")
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
return
}
if(ak_tmp_array.length>20) ak_tmp_array.splice(20,0,"to much")
if(ak_tmp_array.length>14) ak_tmp_array.splice(15,0,",")
if(ak_tmp_array.length>9) ak_tmp_array.splice(10,0,",")
if(ak_tmp_array.length>4) ak_tmp_array.splice(5,0,",")
ak_tmp_prompt=ak_tmp_array.join(" ")
}
}
else if(/^(feFunc)/.test(fe2edit.tagName))
{
var ak_tmp_values=fe2edit.getAttribute("tableValues")
ak_tmp_values=ak_tmp_values.replace(/[^eE\d\.\+\-]/g," ")
ak_tmp_values=ak_tmp_values.replace(/ +/g," ")
ak_tmp_values=ak_tmp_values.replace(/^ *| *$/g,"")
ak_tmp_values=prompt("Enter tableValues (e.g. 1 2 3 4)!",ak_tmp_values)
window.focus(ak_svgroot)
if(!ak_tmp_values) return
ak_tmp_values=ak_tmp_values.replace(/[^eE\d\.\+\-]/g," ")
ak_tmp_values=ak_tmp_values.replace(/ +/g," ")
ak_tmp_values=ak_tmp_values.replace(/^ *| *$/g,"")
ak_setAttributeListUpdateRM(ak_fe2edit,"tableValues",ak_tmp_values,"type",table_discrete,'slope','','intercept','','amplitude','','exponent','','offset','')
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
return
}
else if(fe2edit.tagName=="feConvolveMatrix")
{
var ak_tmp_order=fe2edit.getAttribute("order")
ak_tmp_order=ak_tmp_order.replace(/[^eE\d\.\+\-]/g," ")
ak_tmp_order=ak_tmp_order.replace(/ +/g," ")
ak_tmp_order=ak_tmp_order.replace(/^ *| *$/g,"")
var ak_tmp_array=ak_tmp_order.split(" ")
ak_tmp_array[0]=isNaN(ak_tmp_array[0])?0:parseInt(ak_tmp_array[0])
ak_tmp_array[1]=isNaN(ak_tmp_array[1])?ak_tmp_array[0]:parseInt(ak_tmp_array[1])
var ak_tmp_newValues=ak_tmp_array[0]+"x"+ak_tmp_array[1]+" , "
var ak_tmp_values=fe2edit.getAttribute("kernelMatrix")
ak_tmp_values=ak_tmp_values.replace(/[^eE\d\.\+\-]/g," ")
ak_tmp_values=ak_tmp_values.replace(/ +/g," ")
ak_tmp_values=ak_tmp_values.replace(/^ *| *$/g,"")
var ak_tmp_arrayValues=ak_tmp_values.split(" ")
for(var i=(ak_tmp_array[0]-1);i>0;i--)
{
ak_tmp_arrayValues.splice((i*ak_tmp_array[1]),0,",")
}
ak_tmp_newValues+=ak_tmp_arrayValues.join(" ")
var ak_tmp_prompt_txt="Enter order and kernelMatrix!\ne.g. 2x3 , 1 2 3 , 4 5 6"
while(true)
{
var ak_tmp_valuesReturn=prompt(ak_tmp_prompt_txt,ak_tmp_newValues)
window.focus(ak_svgroot)
if(!ak_tmp_valuesReturn) return
ak_tmp_valuesReturn=ak_tmp_valuesReturn.replace(/[^eE\d\.\+\-]/g," ")
ak_tmp_valuesReturn=ak_tmp_valuesReturn.replace(/ +/g," ")
ak_tmp_valuesReturn=ak_tmp_valuesReturn.replace(/^ *| *$/g,"")
var ak_tmp_array=ak_tmp_valuesReturn.split(" ")
for(var i=0;i<ak_tmp_array.length;i++){ak_tmp_array[i]=isNaN(ak_tmp_array[i])?0:parseFloat(ak_tmp_array[i])}
if(ak_tmp_array.length<((ak_tmp_array[0]*ak_tmp_array[1])+2) || ak_tmp_array.length<3) ak_tmp_prompt_txt="To less values, enter order and kernelMatrix!\ne.g. 2x3 , 1 2 3 , 4 5 6"
else if(ak_tmp_array.length>((ak_tmp_array[0]*ak_tmp_array[1])+2))
{
ak_tmp_prompt_txt="To much values, enter order and kernelMatrix!\ne.g. 2x3 , 1 2 3 , 4 5 6"
ak_tmp_array.splice(((ak_tmp_array[0]*ak_tmp_array[1])+2),0,"to much")
}
else
{
ak_tmp_order=parseInt(ak_tmp_array[0])+" "+parseInt(ak_tmp_array[1])
fe2edit.setAttribute("order",ak_tmp_order)
for(var i=(ak_tmp_array[0]-1);i>0;i--)
{
ak_tmp_array.splice((i*ak_tmp_array[1])+2,0,",")
}
ak_tmp_array.splice(0,2)
fe2edit.setAttribute("kernelMatrix",ak_tmp_array.join(" "))
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
return
}
for(var i=(ak_tmp_array[0]-1);i>0;i--)
{
ak_tmp_array.splice((i*ak_tmp_array[1])+2,0,",")
}
ak_tmp_array.splice(2,",")
ak_tmp_array[0]=parseInt(ak_tmp_array[0])+"x"+parseInt(ak_tmp_array[1])
ak_tmp_array[1]=","
ak_tmp_newValues=ak_tmp_array.join(" ")
}
}
}
//##############################################################
var ak_filter_submenu_start='<item id="ak_pUnits_userSpaceOnUse" onactivate="'+"ak_edit_pattern_attributes(evt,'userSpaceOnUse','id','filterUnits')"+'">userSpaceOnUse</item>'
ak_filter_submenu_start+='<item id="ak_pUnits_objectBoundingBox" onactivate="'+"ak_edit_pattern_attributes(evt,'objectBoundingBox','id','filterUnits')"+'">objectBoundingBox</item>'
ak_filter_submenu_start+='<item id="ak_pUnits_false" onactivate="'+"ak_edit_pattern_attributes(evt,'remove patternUnits','id','filterUnits')"+'">remove filterUnits</item>'
ak_filter_submenu_start+='<separator/>'
ak_filter_submenu_start+='<item id="ak_primitiveUnits_userSpaceOnUse" onactivate="'+"ak_edit_pattern_attributes(evt,'userSpaceOnUse','id','primitiveUnits')"+'">userSpaceOnUse</item>'
ak_filter_submenu_start+='<item id="ak_primitiveUnits_objectBoundingBox" onactivate="'+"ak_edit_pattern_attributes(evt,'objectBoundingBox','id','primitiveUnits')"+'">objectBoundingBox</item>'
ak_filter_submenu_start+='<item id="ak_primitiveUnits_false" onactivate="'+"ak_edit_pattern_attributes(evt,'remove patternUnits','id','primitiveUnits')"+'">remove primitiveUnits</item>'
ak_filter_submenu_start+='<separator/>'
ak_filter_submenu_start+='<item id="ak_pxy_false" onactivate="'+"ak_edit_pattern_attributes(evt,'remove x/y')"+'">remove x/y</item>'
ak_filter_submenu_start+='<item id="ak_pwh_false" onactivate="'+"ak_edit_pattern_attributes(evt,'remove width/height')"+'">remove width/height</item>'
var ak_new_filterNode_menu='<menu><header>Add Filter childNode</header>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feBlend'"+',replacer)">&lt;feBlend</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feColorMatrix'"+',replacer)">&lt;feColorMatrix</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feComponentTransfer'"+',replacer)">&lt;feComponentTransfer</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feComposite'"+',replacer)">&lt;feComposite</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feConvolveMatrix'"+',replacer)">&lt;feConvolveMatrix</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feDisplacementMap'"+',replacer)">&lt;feDisplacementMap</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feFlood'"+',replacer)">&lt;feFlood</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feGaussianBlur'"+',replacer)">&lt;feGaussianBlur</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feImage'"+',replacer)">&lt;feImage      -> prompt:</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feImageGotoIO'"+',replacer)">&lt;feImage      -> dialog:</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feImageGotoIObase64'"+',replacer)">&lt;feImage      -> base64,...</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feMerge'"+',replacer)">&lt;feMerge</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feMorphology'"+',replacer)">&lt;feMorphology</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feOffset'"+',replacer)">&lt;feOffset</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feTile'"+',replacer)">&lt;feTile</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feTurbulence'"+',replacer)">&lt;feTurbulence</item>'
ak_new_filterNode_menu+='<separator/>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feDiffuseLighting'"+',replacer)">&lt;feDiffuseLighting (Distant)</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feDiffuseLightingP'"+',replacer)">&lt;feDiffuseLighting (Point)</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feDiffuseLightingS'"+',replacer)">&lt;feDiffuseLighting (Spot)</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feSpecularLighting'"+',replacer)">&lt;feSpecularLighting (Distant)</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feSpecularLightingP'"+',replacer)">&lt;feSpecularLighting (Point)</item>'
ak_new_filterNode_menu+='<item onactivate="ak_add_fe('+"'feSpecularLightingS'"+',replacer)">&lt;feSpecularLighting (Spot)</item>'
ak_new_filterNode_menu+='</menu>'
//##############################################################
function ak_getAnimateFlag(object,main)
{
var ak_tmp='     &lt;'
if(main) ak_tmp=''
var ak_tmpChilds=object.childNodes
for(var i=0;i<ak_tmpChilds.length;i++)
{
if(/^\[object SVG/.test(ak_tmpChilds.item(i)) && /^animate|^set/.test(ak_tmpChilds.item(i).tagName))
{
if(main) ak_tmp='  (animated)'
else ak_tmp='(a)&lt;'
break
}
}
return ak_tmp
}
//##############################################################
function ak_getFilterChildMenu(object)
{
var ak_tmpNode=''
var ak_tmpNotChecked='<item onactivate="ak_lastFilterIndex=\''
var ak_tmpActivate='\';ak_set_gradient_control(evt)">'
if(ak_gradient_stop_index==ak_which_nodeNr(object)) ak_tmpNode+='<item checked="yes">'
else ak_tmpNode+=ak_tmpNotChecked+'-1'+ak_tmpActivate
ak_tmpNode+='&lt;'+object.tagName+' id="'+object.getId()+'"'+ak_getAnimateFlag(object,true)+'</item>'
var ak_tmpChilds=object.childNodes
for(var i=0;i<ak_tmpChilds.length;i++)
{
if(/^\[object SVG/.test(ak_tmpChilds.item(i)) && /^feDiffuseLighting|^feSpecularLighting/.test(ak_tmpChilds.item(i).tagName))
{
if(ak_gradient_stop_index.search(ak_which_nodeNr(ak_tmpChilds.item(i)))==0) ak_tmpNode+='<item checked="yes">'
else ak_tmpNode+=ak_tmpNotChecked+ak_which_nodeNr(ak_tmpChilds.item(i))+ak_tmpActivate
ak_tmpNode+=ak_getAnimateFlag(ak_tmpChilds.item(i))+ak_tmpChilds.item(i).tagName+' result="'+ak_tmpChilds.item(i).getAttribute("result")+'"</item>'
var ak_tmp2ndChilds=ak_tmpChilds.item(i).childNodes
for(var ib=0;ib<ak_tmp2ndChilds.length;ib++)
{
if(/^\[object SVG/.test(ak_tmp2ndChilds.item(ib)) && /^fe/.test(ak_tmp2ndChilds.item(ib).tagName))
{
ak_tmpNode+=ak_tmpNotChecked+ak_which_nodeNr(ak_tmpChilds.item(i))+ak_tmpActivate
ak_tmpNode+='       '+ak_getAnimateFlag(ak_tmp2ndChilds.item(ib))+ak_tmp2ndChilds.item(ib).tagName+'</item>'
}
}
}
else if(/^\[object SVG/.test(ak_tmpChilds.item(i)) && ak_tmpChilds.item(i).tagName=="feMerge")
{
if(ak_gradient_stop_index==ak_which_nodeNr(ak_tmpChilds.item(i))) ak_tmpNode+='<item checked="yes">'
else ak_tmpNode+=ak_tmpNotChecked+ak_which_nodeNr(ak_tmpChilds.item(i))+ak_tmpActivate
ak_tmpNode+=ak_getAnimateFlag(ak_tmpChilds.item(i))+ak_tmpChilds.item(i).tagName+' result="'+ak_tmpChilds.item(i).getAttribute("result")+'"</item>'
var ak_tmp2ndChilds=ak_tmpChilds.item(i).childNodes
for(var ib=0;ib<ak_tmp2ndChilds.length;ib++)
{
if(/^\[object SVG/.test(ak_tmp2ndChilds.item(ib)) && /^fe/.test(ak_tmp2ndChilds.item(ib).tagName))
{
if(ak_gradient_stop_index==ak_which_nodeNr(ak_tmp2ndChilds.item(ib))) ak_tmpNode+='<item checked="yes">'
else ak_tmpNode+=ak_tmpNotChecked+ak_which_nodeNr(ak_tmp2ndChilds.item(ib))+ak_tmpActivate
ak_tmpNode+='       '+ak_getAnimateFlag(ak_tmp2ndChilds.item(ib))+ak_tmp2ndChilds.item(ib).tagName+' in="'+ak_tmp2ndChilds.item(ib).getAttribute("in")+'"</item>'
}
}
ak_tmpNode+='<item onactivate="ak_add_fe('+"'feMergeNode',"+ak_which_nodeNr(ak_tmpChilds.item(i))+")"+'">            + add &lt;feMergeNode</item>'
}
else if(/^\[object SVG/.test(ak_tmpChilds.item(i)) && /^fe/.test(ak_tmpChilds.item(i).tagName))
{
if(ak_gradient_stop_index==ak_which_nodeNr(ak_tmpChilds.item(i))) ak_tmpNode+='<item checked="yes">'
else ak_tmpNode+=ak_tmpNotChecked+ak_which_nodeNr(ak_tmpChilds.item(i))+ak_tmpActivate
ak_tmpNode+=ak_getAnimateFlag(ak_tmpChilds.item(i))+ak_tmpChilds.item(i).tagName+' result="'+ak_tmpChilds.item(i).getAttribute("result")+'"</item>'
var ak_tmp2ndChilds=ak_tmpChilds.item(i).childNodes
for(var ib=0;ib<ak_tmp2ndChilds.length;ib++)
{
if(/^\[object SVG/.test(ak_tmp2ndChilds.item(ib)) && /^fe/.test(ak_tmp2ndChilds.item(ib).tagName))
{
if(ak_gradient_stop_index==ak_which_nodeNr(ak_tmp2ndChilds.item(ib))) ak_tmpNode+='<item checked="yes">'
else ak_tmpNode+=ak_tmpNotChecked+ak_which_nodeNr(ak_tmp2ndChilds.item(ib))+ak_tmpActivate
ak_tmpNode+='       '+ak_getAnimateFlag(ak_tmp2ndChilds.item(ib))+ak_tmp2ndChilds.item(ib).tagName+' in="'+ak_tmp2ndChilds.item(ib).getAttribute("in")+'"</item>'
}
}
}
/*else if(/^\[object SVG/.test(ak_tmpChilds.item(i)) && /^fe/.test(ak_tmpChilds.item(i).tagName))
{
if(ak_gradient_stop_index==ak_which_nodeNr(ak_tmpChilds.item(i))) ak_tmpNode+='<item checked="yes">'
else ak_tmpNode+=ak_tmpNotChecked+ak_which_nodeNr(ak_tmpChilds.item(i))+ak_tmpActivate
ak_tmpNode+=ak_getAnimateFlag(ak_tmpChilds.item(i))+ak_tmpChilds.item(i).tagName+' result="'+ak_tmpChilds.item(i).getAttribute("result")+'"</item>'
}*/
}
return ak_tmpNode
}
//##############################################################
var ak_filter2edit=false, ak_fe4filter=false, ak_feListed=true
function ak_getFilterMenu(evt)
{
var ak_tmp_nodeNr=ak_which_nodeNr(ak_pattern2edit)
var ak_before_menu_start=''
ak_before_menu_start+=ak_new_filterNode_menu.replace(/(replacer)/g,ak_tmp_nodeNr)
if(ak_gradient_stop_index==-1)
{
if(ak_tmp_nodeNr==ak_which_nodeNr(ak_filter2edit) && /^\[object SVGElement\]/.test(ak_fe4filter) && /^fe/.test(ak_fe4filter.tagName) && ak_which_nodeNr(ak_fe4filter)!=-1)
{
ak_gradient_stop_index=ak_which_nodeNr(ak_fe4filter)
}
else ak_gradient_stop_index=ak_tmp_nodeNr
}
ak_filter2edit=ak_getObject(ak_tmp_nodeNr)
/*ak_push(ak_object2update_nodeNr); ak_object2update_nodeNr=ak_gradient_stop_index
eval("var ak_tmp_childMenu=ak_get_childMenu(true,"+ak_tmp_nodeNr+")") // kein rootCheck hier noetig
ak_object2update_nodeNr=ak_pop()
ak_tmp_childMenu=ak_tmp_childMenu.replace(/(ak_select_nodeNr)/g,"ak_lastFilterIndex=")
ak_tmp_childMenu=ak_tmp_childMenu.replace(/\(/g,"'")
ak_tmp_childMenu=ak_tmp_childMenu.replace(/\)/g,"';ak_set_gradient_control(evt)")
if(ak_feListed && ak_tmp_childMenu.search(/<\/header>/)!=-1)
{
ak_tmp_childMenu=ak_tmp_childMenu.substring(ak_tmp_childMenu.search(/<\/header>/))
ak_tmp_childMenu=ak_tmp_childMenu.replace(/^<\/header>/,"")
ak_tmp_childMenu=ak_tmp_childMenu.replace(/<\/menu>$/,"")
ak_tmp_childMenu=ak_tmp_childMenu.replace(/<separator\/>/,"")
}
else if(ak_tmp_childMenu.search(/<\/header>/)!=-1)
{
ak_tmp_childMenu=ak_tmp_childMenu.substring(ak_tmp_childMenu.search(/<\/header>/))
ak_tmp_childMenu="<menu><header>Select Filter childNode to edit"+ak_tmp_childMenu
}*/
var ak_tmp_childMenu=ak_getFilterChildMenu(ak_filter2edit)
if (ak_tmp_childMenu=="") ak_before_menu_start+='<item enabled="no">No filter childNodes found!</item>'
else ak_before_menu_start+=ak_tmp_childMenu
var ak_tmp_fe_menu=""
var ak_pattern_submenu=''
var ak_tmpfilterStart=''
ak_tmpfilterStart+='<separator/>'
if(ak_tmp_nodeNr==ak_gradient_stop_index)
{// filter container tag
ak_fe4filter=false
var ak_tmpValue=ak_pattern2edit.getAttribute("filterUnits")
if(ak_tmpValue=="userSpaceOnUse") ak_tmpfilterStart+='<item checked="yes" onactivate="'+"ak_edit_pattern_attributes(evt,'remove patternUnits','id','filterUnits')"+'">filterUnits = "userSpaceOnUse"</item>'
else ak_tmpfilterStart+='<item onactivate="'+"ak_edit_pattern_attributes(evt,'userSpaceOnUse','id','filterUnits')"+'">filterUnits = "userSpaceOnUse"</item>'
if(ak_tmpValue=="objectBoundingBox") ak_tmpfilterStart+='<item checked="yes" onactivate="'+"ak_edit_pattern_attributes(evt,'remove patternUnits','id','filterUnits')"+'">filterUnits = "objectBoundingBox"</item>'
else ak_tmpfilterStart+='<item onactivate="'+"ak_edit_pattern_attributes(evt,'objectBoundingBox','id','filterUnits')"+'">filterUnits = "objectBoundingBox"</item>'
ak_tmpfilterStart+='<separator/>'
ak_tmpValue=ak_pattern2edit.getAttribute("primitiveUnits")
if(ak_tmpValue=="userSpaceOnUse") ak_tmpfilterStart+='<item checked="yes" onactivate="'+"ak_edit_pattern_attributes(evt,'remove patternUnits','id','primitiveUnits')"+'">primitiveUnits = "userSpaceOnUse"</item>'
else ak_tmpfilterStart+='<item onactivate="'+"ak_edit_pattern_attributes(evt,'userSpaceOnUse','id','primitiveUnits')"+'">primitiveUnits = "userSpaceOnUse"</item>'
if(ak_tmpValue=="objectBoundingBox") ak_tmpfilterStart+='<item checked="yes" onactivate="'+"ak_edit_pattern_attributes(evt,'remove patternUnits','id','primitiveUnits')"+'">primitiveUnits = "objectBoundingBox"</item>'
else ak_tmpfilterStart+='<item onactivate="'+"ak_edit_pattern_attributes(evt,'objectBoundingBox','id','primitiveUnits')"+'">primitiveUnits = "objectBoundingBox"</item>'
ak_tmpfilterStart+='<separator/>'
var ak_tmp=true
ak_tmpValue=ak_pattern2edit.getAttribute("x")
if(ak_tmpValue!="") ak_tmp=false
ak_tmpValue=ak_pattern2edit.getAttribute("y")
if(ak_tmpValue!="") ak_tmp=false
ak_tmpValue=ak_pattern2edit.getAttribute("width")
if(ak_tmpValue!="") ak_tmp=false
ak_tmpValue=ak_pattern2edit.getAttribute("height")
if(ak_tmpValue!="") ak_tmp=false
if(ak_tmp) ak_tmpfilterStart+='<item enabled="no">remove x/y/width/height</item>'
else ak_tmpfilterStart+='<item onactivate="'+"ak_edit_pattern_attributes(evt,'remove x/y/width/height')"+'">remove x/y/width/height</item>'
}
else
{// fe tags
var ak_tmp_feObject=ak_getObject(ak_gradient_stop_index)
ak_fe4filter=ak_getObject(ak_gradient_stop_index)
ak_fe2edit=ak_tmp_feObject
var ak_tmp_printObject
switch(ak_tmp_feObject.tagName)
{
case "animate":
case "animateColor":
case "animateMotion":
case "animateTransform":
ak_gradient_stop_index=ak_which_nodeNr(ak_tmp_feObject.parentNode)
ak_clickset_obj2update(evt,ak_object2update,'no_ak_init_set4object')
return
case "feMergeNode":
ak_tmp_printObject=ak_tmp_feObject.tagName+' in="'+ak_tmp_feObject.getAttribute("in")+'"'
break
case "feDistantLight":
case "fePointLight":
case "feSpotLight":
ak_tmp_printObject=ak_tmp_feObject.parentNode.tagName
break
case "feFuncR":
case "feFuncG":
case "feFuncB":
case "feFuncA":
ak_tmp_printObject=ak_tmp_feObject.tagName
break
default:
ak_tmp_printObject=ak_tmp_feObject.tagName+' result="'+ak_tmp_feObject.getAttribute("result")+'"'
}
/*switch(ak_tmp_feObject.tagName)
{
case "feMerge":
ak_tmp_fe_menu+='<item onactivate="ak_add_fe('+"'feMergeNode',"+ak_gradient_stop_index+")"+'">      Add &lt;feMerge child  *</item>'
break
case "feMergeNode":
var ak_tmp_index=ak_gradient_stop_index.split(",")
ak_tmp_index.pop()
ak_tmp_fe_menu+='<item onactivate="ak_add_fe('+"'feMergeNode',"+ak_tmp_index.join()+")"+'">      Add &lt;feMerge child  *</item>'
break
}*/
ak_tmp_fe_menu+='<separator/>'
ak_tmp_fe_menu+='<item onactivate="'+"ak_delete_nodeNr("+ak_gradient_stop_index+")"+'">Delete &lt;'+ak_tmp_printObject+'</item>'
var ak_tmp_checked=' enabled="no"'
var ak_tmp_prev=ak_tmp_feObject
if(/Light$/.test(ak_tmp_feObject.tagName))
{
var ak_tmp_parentNr=ak_which_nodeNr(ak_tmp_feObject.parentNode)
ak_tmp_prev=ak_tmp_feObject.parentNode
while(ak_tmp_prev.previousSibling)
{
if(/^(\[object SVG)/.test(ak_tmp_prev.previousSibling)) ak_tmp_checked=''
ak_tmp_prev=ak_tmp_prev.previousSibling
}
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="'+"ak_move_nodeNr_before("+ak_tmp_parentNr+")"+'">Move &lt;'+ak_tmp_feObject.parentNode.tagName+'  UP</item>'
var ak_tmp_checked=' enabled="no"'
ak_tmp_prev=ak_tmp_feObject.parentNode
while(ak_tmp_prev.nextSibling())
{
if(/^(\[object SVG)/.test(ak_tmp_prev.nextSibling)) ak_tmp_checked=''
ak_tmp_prev=ak_tmp_prev.nextSibling
}
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="'+"ak_move_nodeNr_behind("+ak_tmp_parentNr+")"+'">Move &lt;'+ak_tmp_feObject.parentNode.tagName+'  DOWN</item>'
}
else
{
while(ak_tmp_prev.previousSibling)
{
if(/^(\[object SVG)/.test(ak_tmp_prev.previousSibling)) ak_tmp_checked=''
ak_tmp_prev=ak_tmp_prev.previousSibling
}
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="'+"ak_move_nodeNr_before("+ak_gradient_stop_index+")"+'">Move &lt;'+ak_tmp_feObject.tagName+'  UP</item>'
var ak_tmp_checked=' enabled="no"'
var ak_tmp_prev=ak_tmp_feObject
while(ak_tmp_prev.nextSibling())
{
if(/^(\[object SVG)/.test(ak_tmp_prev.nextSibling)) ak_tmp_checked=''
ak_tmp_prev=ak_tmp_prev.nextSibling
}
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="'+"ak_move_nodeNr_behind("+ak_gradient_stop_index+")"+'">Move &lt;'+ak_tmp_feObject.tagName+'  DOWN</item>'
}
ak_tmp_fe_menu+='<separator/>'
var ak_tmp_result=ak_tmp_feObject.getAttribute("result")
if((ak_tmp_result=="" || ak_tmp_result==null))
{
switch(ak_tmp_feObject.tagName)
{
case "feMergeNode":
case "feDistantLight":
case "fePointLight":
case "feSpotLight":
case "feFuncR":
case "feFuncG":
case "feFuncB":
case "feFuncA":
break
default:
ak_tmp_fe_menu+='<item onactivate="ak_edit_feResult('+"'"+ak_tmp_feObject.tagName+"',"+ak_gradient_stop_index+')">   generate resultAttribute</item>'
}
}
var ak_tmp_in=ak_tmp_feObject.getAttribute("in")
switch(ak_tmp_feObject.tagName)
{
case "feMerge":
case "feDistantLight":
case "fePointLight":
case "feSpotLight":
case "feFuncR":
case "feFuncG":
case "feFuncB":
case "feFuncA":
case "feFlood":
case "feImage":
case "feTurbulence":
break
default:
ak_tmp_fe_menu+='<menu><header>   in="'+ak_tmp_in+'"</header>'
ak_tmp_fe_menu+=eval("ak_edit_feResult('get_inList',"+ak_gradient_stop_index+")")
ak_tmp_fe_menu+='</menu>'
}
ak_tmp_in=ak_tmp_feObject.getAttribute("in2")
switch(ak_tmp_feObject.tagName)
{
case "feBlend":
case "feComposite":
case "feDisplacementMap":
ak_tmp_fe_menu+='<menu><header>   in2="'+ak_tmp_in+'"</header>'
ak_tmp_fe_menu+=eval("ak_edit_feResult('get_in2List',"+ak_gradient_stop_index+")")
ak_tmp_fe_menu+='</menu>'
}
ak_tmp_checked=''
switch(ak_tmp_feObject.tagName)
{
case "feBlend":
ak_tmp_fe_menu+='<separator/>'
if(ak_tmp_feObject.getAttribute("mode")=="normal") ak_tmp_checked=' checked="yes"'
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'mode','normal'"+')">   normal</item>'
if(ak_tmp_feObject.getAttribute("mode")=="multiply") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'mode','multiply'"+')">   multiply</item>'
if(ak_tmp_feObject.getAttribute("mode")=="screen") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'mode','screen'"+')">   screen</item>'
if(ak_tmp_feObject.getAttribute("mode")=="darken") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'mode','darken'"+')">   darken</item>'
if(ak_tmp_feObject.getAttribute("mode")=="lighten") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'mode','lighten'"+')">   lighten</item>'
break
case "feColorMatrix":
var ak_tmp_type=ak_tmp_feObject.getAttribute("type")
ak_tmp_fe_menu+='<separator/>'
if(ak_tmp_type=="matrix") ak_tmp_checked=' checked="yes"'
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_set_feMatrix(ak_fe2edit)">   set matrix="...</item>'
if(ak_tmp_type=="saturate") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'type','saturate','values','1'"+')">   saturate</item>'
if(ak_tmp_type=="hueRotate") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'type','hueRotate','values','0'"+')">   hueRotate</item>'
if(ak_tmp_type=="luminanceToAlpha") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdateRM(ak_fe2edit,'+"'type','luminanceToAlpha','values',''"+')">   luminanceToAlpha</item>'
break
case "feFuncR":
case "feFuncG":
case "feFuncB":
case "feFuncA":
var ak_tmp_type=ak_tmp_feObject.getAttribute("type")
ak_tmp_fe_menu+='<separator/>'
if(ak_tmp_type=="identity") ak_tmp_checked=' checked="yes"'
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_change_fe('+"'identity'"+',ak_fe2edit)">   identity</item>'
if(ak_tmp_type=="table") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_set_feMatrix(ak_fe2edit,'+"'table'"+')">   table, set tableValues="...</item>'
if(ak_tmp_type=="discrete") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_set_feMatrix(ak_fe2edit,'+"'discrete'"+')">   discrete, set tableValues="...</item>'
if(ak_tmp_type=="linear") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_change_fe('+"'linear'"+',ak_fe2edit)">   linear</item>'
if(ak_tmp_type=="gamma") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_change_fe('+"'gamma'"+',ak_fe2edit)">   gamma</item>'
break
case "feComposite":
var ak_tmp_type=ak_tmp_feObject.getAttribute("operator")
ak_tmp_fe_menu+='<separator/>'
if(ak_tmp_type=="over") ak_tmp_checked=' checked="yes"'
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdateRM(ak_fe2edit,'+"'operator','over','k1','','k2','','k3','','k4',''"+')">   over</item>'
if(ak_tmp_type=="in") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdateRM(ak_fe2edit,'+"'operator','in','k1','','k2','','k3','','k4',''"+')">   in</item>'
if(ak_tmp_type=="out") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdateRM(ak_fe2edit,'+"'operator','out','k1','','k2','','k3','','k4',''"+')">   out</item>'
if(ak_tmp_type=="atop") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdateRM(ak_fe2edit,'+"'operator','atop','k1','','k2','','k3','','k4',''"+')">   atop</item>'
if(ak_tmp_type=="xor") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdateRM(ak_fe2edit,'+"'operator','xor','k1','','k2','','k3','','k4',''"+')">   xor</item>'
if(ak_tmp_type=="arithmetic") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdateRM(ak_fe2edit,'+"'operator','arithmetic','k1','0','k2','1','k3','0','k4','0'"+')">   arithmetic</item>'
break
case "feConvolveMatrix":
ak_tmp_fe_menu+='<separator/>'
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_set_feMatrix(ak_fe2edit)">   set order / kernelMatrix="...</item>'
if(ak_tmp_feObject.getAttribute("divisor")=="") ak_tmp_checked=' checked="yes"'
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdateRM(ak_fe2edit,'+"'divisor',''"+')">   remove divisor</item>'
if(ak_tmp_feObject.getAttribute("bias")=="") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdateRM(ak_fe2edit,'+"'bias',''"+')">   remove bias</item>'
var ak_tmp_type=ak_tmp_feObject.getAttribute("edgeMode")
ak_tmp_fe_menu+='<separator/>'
if(ak_tmp_type=="duplicate") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'edgeMode','duplicate'"+')">   edgeMode="duplicate"</item>'
if(ak_tmp_type=="wrap") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'edgeMode','wrap'"+')">   edgeMode="wrap"</item>'
if(ak_tmp_type=="none") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'edgeMode','none'"+')">   edgeMode="none"</item>'
var ak_tmp_type=ak_tmp_feObject.getAttribute("preserveAlpha")
ak_tmp_fe_menu+='<separator/>'
if(ak_tmp_type=="true") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'preserveAlpha','true'"+')">   preserveAlpha="true"</item>'
if(ak_tmp_type=="false") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'preserveAlpha','false'"+')">   preserveAlpha="false"</item>'
break
case "feDisplacementMap":
if(ak_tmp_feObject.getAttribute("scale")=="1") ak_tmp_checked=' checked="yes"'
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'scale','1'"+')">   scale="1"</item>'
break
case "feGaussianBlur":
if(ak_tmp_feObject.getAttribute("stdDeviation")=="") ak_tmp_checked=' checked="yes"'
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_removeAttributeListUpdate(ak_fe2edit,'+"'stdDeviation'"+')">   remove stdDeviation</item>'
break
case "feMerge":
break
case "feMergeNode":
break
case "feMorphology":
var ak_tmp_type=ak_tmp_feObject.getAttribute("operator")
if(ak_tmp_type=="erode") ak_tmp_checked=' checked="yes"'
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'operator','erode'"+')">   operator="erode"</item>'
if(ak_tmp_type=="dilate") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'operator','dilate'"+')">   operator="dilate"</item>'
if(ak_tmp_feObject.getAttribute("radius")=="") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdateRM(ak_fe2edit,'+"'radius',''"+')">   remove radius</item>'
break
case "feOffset":
if(ak_tmp_feObject.getAttribute("dx")=="" && ak_tmp_feObject.getAttribute("dy")=="") ak_tmp_checked=' checked="yes"'
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_removeAttributeListUpdate(ak_fe2edit,'+"'dx','dy'"+')">   remove dx/dy</item>'
break
case "feFlood":
case "feImage":
case "feTile":
if(ak_tmp_feObject.getAttribute("x")=="" && ak_tmp_feObject.getAttribute("y")=="") ak_tmp_checked=' checked="yes"'
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_removeAttributeListUpdate(ak_fe2edit,'+"'x','y'"+')">   remove x/y</item>'
if(ak_tmp_feObject.getAttribute("width")=="" && ak_tmp_feObject.getAttribute("height")=="") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_removeAttributeListUpdate(ak_fe2edit,'+"'width','height'"+')">   remove width/height</item>'
break
case "feTurbulence":
var ak_tmp_type=ak_tmp_feObject.getAttribute("type")
ak_tmp_fe_menu+='<separator/>'
if(ak_tmp_type=="turbulence") ak_tmp_checked=' checked="yes"'
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdateRM(ak_fe2edit,'+"'type','turbulence'"+')">   turbulence</item>'
if(ak_tmp_type=="fractalNoise") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdateRM(ak_fe2edit,'+"'type','fractalNoise'"+')">   fractalNoise</item>'
ak_tmp_type=ak_tmp_feObject.getAttribute("stitchTiles")
ak_tmp_fe_menu+='<separator/>'
if(ak_tmp_type=="noStitch") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'stitchTiles','noStitch'"+')">   noStitch</item>'
if(ak_tmp_type=="stitch") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'stitchTiles','stitch'"+')">   stitch</item>'
break
case "feDiffuseLighting":
break
case "feSpecularLighting":
break
case "fePointLight":
if(ak_tmp_feObject.getAttribute("x")=="0" && ak_tmp_feObject.getAttribute("y")=="0" && ak_tmp_feObject.getAttribute("z")=="0") ak_tmp_checked=' checked="yes"'
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'x','0','y','0','z','0'"+')">   x/y/z="0"</item>'
break
case "feSpotLight":
if(ak_tmp_feObject.getAttribute("x")=="0" && ak_tmp_feObject.getAttribute("y")=="0" && ak_tmp_feObject.getAttribute("z")=="0") ak_tmp_checked=' checked="yes"'
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'x','0','y','0','z','0'"+')">   x/y/z="0"</item>'
if(ak_tmp_feObject.getAttribute("pointsAtX")=="0" && ak_tmp_feObject.getAttribute("pointsAtY")=="0" && ak_tmp_feObject.getAttribute("pointsAtZ")=="0") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'pointsAtX','0','pointsAtY','0','pointsAtZ','0'"+')">   pointsAtX/Y/Z="0"</item>'
if(ak_tmp_feObject.getAttribute("specularExponent")=="0") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmp_fe_menu+='<item'+ak_tmp_checked+' onactivate="ak_setAttributeListUpdate(ak_fe2edit,'+"'specularExponent','0'"+')">   specularExponent="0"</item>'
break
}
}
ak_pattern_submenu+='<separator/><item onactivate="'+"ak_edit_pattern_attributes(evt,'Copy Filter to Clipboard','"+ak_pattern2edit.getId()+"')"+'">Copy "'+ak_pattern2edit.getId()+'" to Clipboard</item>'
ak_pattern_submenu+='<item onactivate="'+"ak_edit_pattern_attributes(evt,'cloneFilter','"+ak_pattern2edit.getId()+"')"+'">Clone "'+ak_pattern2edit.getId()+'"</item>'
if(ak_tmp_nodeNr==ak_gradient_stop_index)
{
return (ak_before_menu_start+ak_tmpfilterStart+ak_pattern_submenu)
}
else
{
return (ak_before_menu_start+ak_tmp_fe_menu+ak_pattern_submenu)
}
}
//##############################################################
var ak_lastFilter=false, ak_lastFilterIndex=-1
function ak_set_filter_control(evt) // uses ak_pattern2edit variablen name
{
ak_gradientName_start="<"+ak_pattern2edit.tagName()
if(ak_pattern2edit.getId!=null && ak_pattern2edit.getId!="") ak_gradientName_start+=' id="'+ak_pattern2edit.getId+'"'
ak_tagName_cout=ak_gradientName_start+ak_getAttributeCout(ak_pattern2edit,'x','y','width','height')
var ak_grid_zoom=ak_obj_control_scale // locale variable
var ak_tmp_nodeNr=ak_which_nodeNr(ak_pattern2edit)
if(ak_which_nodeNr(ak_lastFilter)!=ak_tmp_nodeNr)
{
ak_lastFilter=ak_pattern2edit
ak_lastFilterIndex=-1
ak_gradient_stop_index=-1
}
else ak_gradient_stop_index=ak_lastFilterIndex
var ak_tmp_feObject=ak_getObject(ak_gradient_stop_index)
if(!ak_tmp_feObject)
{
ak_gradient_stop_index=ak_tmp_nodeNr
ak_tmp_feObject=ak_pattern2edit
}
else if(/Lighting$/.test(ak_tmp_feObject.tagName))
{
for(var i=0;i<ak_tmp_feObject.childNodes.length;i++)
{
if(/^\[object SVG/.test(ak_tmp_feObject.childNodes.item(i)) && /Light$/.test(ak_tmp_feObject.childNodes.item(i).tagName))
{
ak_tmp_feObject=ak_tmp_feObject.childNodes.item(i)
ak_gradient_stop_index=ak_which_nodeNr(ak_tmp_feObject)
break
}
}
}
else if(/^animate|^set/.test(ak_tmp_feObject.tagName))
{
ak_tmp_feObject=ak_tmp_feObject.parentNode
ak_gradient_stop_index=ak_which_nodeNr(ak_tmp_feObject)
}
ak_fe4filter=ak_getObject(ak_gradient_stop_index)
ak_fe2edit=ak_tmp_feObject
if(ak_autoMode) ak_animate_auto('autoAdd',ak_gradient_stop_index)
if(ak_fe2edit.tagName=="feFlood")
{
ak_init_slider("flood-opacity")
if(ak_sliderArrayV3[5][0].parentNode.getAttribute("visibility")=="hidden") ak_sliderArrayV3[5][0].parentNode.removeAttribute("visibility")
}
else ak_sliderArrayV3[5][0].parentNode.setAttribute("visibility","hidden")
//ak_lastFilterIndex=ak_gradient_stop_index
if(ak_tmp_nodeNr==ak_gradient_stop_index)
{
ak_patternUnits=ak_get_patternUnits(ak_pattern2edit,"filterUnits")
ak_primitiveUnits=ak_get_patternUnits(ak_pattern2edit,"primitiveUnits")
}
else
{
ak_patternUnits=ak_get_patternUnits(ak_pattern2edit,"filterUnits",true)
ak_primitiveUnits=ak_get_patternUnits(ak_pattern2edit,"primitiveUnits",true)
}
if(ak_patternUnits=="userSpaceOnUse")
{
var ak_tmp_linksoben_x=0
var ak_tmp_linksoben_y=0
var ak_tmp_width=isNaN
var ak_tmp_height=isNaN
var ak_tmp_svg_box=ak_object2update
while(ak_tmp_svg_box)
{
try
{
if(ak_tmp_svg_box.tagName()=="svg")
{
if(isNaN(ak_tmp_width)) ak_tmp_width=parseFloat(ak_tmp_svg_box.getAttribute("width"))
if(isNaN(ak_tmp_height)) ak_tmp_height=parseFloat(ak_tmp_svg_box.getAttribute("height"))
if(!isNaN(ak_tmp_width) && !isNaN(ak_tmp_height)) break
}
}
catch(error){break}
ak_tmp_svg_box=ak_tmp_svg_box.parentNode
}
if(isNaN(ak_tmp_width)) ak_tmp_width=window.innerWidth
if(isNaN(ak_tmp_height)) ak_tmp_height=window.innerHeight
}
else
{
var ak_tmp_linksoben_x=ak_objEdit.getBBox.x
var ak_tmp_linksoben_y=ak_objEdit.getBBox.y
var ak_tmp_width=ak_objEdit.getBBox.width
var ak_tmp_height=ak_objEdit.getBBox.height
}
var ak_tmp_x=ak_check_on_href(evt,ak_pattern2edit,"x")
var ak_tmp_y=ak_check_on_href(evt,ak_pattern2edit,"y")
var ak_tmp_p_width=ak_check_on_href(evt,ak_pattern2edit,"width")
var ak_tmp_p_height=ak_check_on_href(evt,ak_pattern2edit,"height")
ak_tmp_x=ak_get_gradient_xy(evt,ak_tmp_x,-0.1,ak_tmp_linksoben_x,ak_tmp_width,ak_patternUnits)
ak_tmp_y=ak_get_gradient_xy(evt,ak_tmp_y,-0.1,ak_tmp_linksoben_y,ak_tmp_height,ak_patternUnits)
ak_tmp_x2=ak_get_gradient_xy(evt,ak_tmp_p_width,1.2,ak_tmp_linksoben_x,ak_tmp_width,ak_patternUnits)
ak_tmp_y2=ak_get_gradient_xy(evt,ak_tmp_p_height,1.2,ak_tmp_linksoben_y,ak_tmp_height,ak_patternUnits)
ak_tmp_p_width=ak_tmp_x2-ak_tmp_linksoben_x
ak_tmp_p_height=ak_tmp_y2-ak_tmp_linksoben_y
var g_append=parseXML(("<g id='ak_gradient_control_g' style='stroke:#000;stroke-width:"+(1/ak_grid_zoom)+";fill-opacity:1'/>"),document).firstChild
ak_toolObject.replaceChild(g_append,ak_toolGradient)
ak_toolGradient=g_append
var ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_xy")'
var ak_tmp_elements="<rect id='ak_gradient_line1' x='"+ak_tmp_x+"' y='"+ak_tmp_y+"' width='"+ak_tmp_p_width+"' height='"+ak_tmp_p_height
ak_tmp_elements+="' style='fill-opacity:0;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_wh")'
ak_tmp_elements="<rect id='ak_pattern_rect2' x='"+(ak_tmp_x+ak_tmp_p_width-(5/ak_grid_zoom))+"' y='"+(ak_tmp_y+ak_tmp_p_height-(5/ak_grid_zoom))+"' width='"+(10/ak_grid_zoom)+"' height='"+(10/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#000;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_gradient_vector_start=ak_svgroot.createSVGPoint()
ak_gradient_vector_start.x=ak_tmp_x
ak_gradient_vector_start.y=ak_tmp_y
ak_gradient_vector=ak_svgroot.createSVGPoint()
ak_gradient_vector.x=ak_tmp_p_width
ak_gradient_vector.y=ak_tmp_p_height
if(ak_tmp_nodeNr!=ak_gradient_stop_index)
{
switch(ak_fe2edit.parentNode.tagName)
{
case "feDiffuseLighting":
ak_set_hex2hue(evt,ak_SetGetRm_styleValue(ak_fe2edit.parentNode,"lighting-color","get","no_cout"),"set_stop_hex")
ak_make_controlBar(20,ak_grid_zoom,g_append)
ak_feScale=parseFloat(ak_fe2edit.parentNode.getAttribute("surfaceScale"))
ak_feScale=isNaN(ak_feScale)?0:ak_feScale
ak_make_controlPoint(0,ak_grid_zoom,g_append,ak_feScale/10,'filter_fesurfaceScaleP','#fff','#08f')
ak_feConstant=parseFloat(ak_fe2edit.parentNode.getAttribute("diffuseConstant"))
ak_feConstant=isNaN(ak_feConstant)?0:ak_feConstant
ak_make_controlPoint(20,ak_grid_zoom,g_append,ak_feConstant/10,'filter_fediffuseConstantP','#fff','#08f')
break
case "feSpecularLighting":
ak_set_hex2hue(evt,ak_SetGetRm_styleValue(ak_fe2edit.parentNode,"lighting-color","get","no_cout"),"set_stop_hex")
ak_make_controlBar(40,ak_grid_zoom,g_append)
ak_feScale=parseFloat(ak_fe2edit.parentNode.getAttribute("surfaceScale"))
ak_feScale=isNaN(ak_feScale)?0:ak_feScale
ak_make_controlPoint(0,ak_grid_zoom,g_append,ak_feScale/10,'filter_feSpecSurfaceScaleP','#fff','#08f')
ak_feConstant=parseFloat(ak_fe2edit.parentNode.getAttribute("specularConstant"))
ak_feConstant=isNaN(ak_feConstant)?0:ak_feConstant
ak_make_controlPoint(20,ak_grid_zoom,g_append,ak_feConstant/10,'filter_fespecularConstantP','#fff','#08f')
ak_feExponent=parseFloat(ak_fe2edit.parentNode.getAttribute("specularExponent"))
ak_feExponent=isNaN(ak_feExponent)?0:ak_feExponent
ak_make_controlPoint(40,ak_grid_zoom,g_append,ak_feExponent/10,'filter_fespecularExponentP','#fff','#08f')
break
}
switch(ak_fe2edit.tagName)
{
case "feBlend":
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','mode')
break
case "feColorMatrix":
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','type','values')
var ak_tmp_type=ak_fe2edit.getAttribute("type")
if(ak_tmp_type=="saturate")
{
ak_feSaturate=parseFloat(ak_fe2edit.getAttribute("values"))
ak_feSaturate=isNaN(ak_feSaturate)?1:ak_feSaturate
ak_feSaturate=ak_feSaturate>1?1:ak_feSaturate
ak_feSaturate=ak_feSaturate<0?0:ak_feSaturate
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+ak_objEdit.getBBox.x+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+ak_objEdit.getBBox.x+"' y2='"+(ak_objEdit.getBBox.y+(ak_feSaturate*ak_objEdit.getBBox.height))
ak_tmp_elements+="' style='fill-opacity:0;stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feSaturate")'
ak_tmp_elements="<circle cx='"+ak_objEdit.getBBox.x+"' cy='"+(ak_objEdit.getBBox.y+(ak_feSaturate*ak_objEdit.getBBox.height))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#08f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
}
else if(ak_tmp_type=="hueRotate")
{
ak_feSaturate=parseFloat(ak_fe2edit.getAttribute("values"))
ak_feSaturate=isNaN(ak_feSaturate)?0:ak_feSaturate
while(ak_feSaturate>360){ak_feSaturate-=360}
while(ak_feSaturate<0){ak_feSaturate+=360}
var ak_tmp_centerX=(ak_objEdit.getBBox.x+(0.5*ak_objEdit.getBBox.width))
var ak_tmp_centerY=(ak_objEdit.getBBox.y+(0.5*ak_objEdit.getBBox.height))
var ak_tmp_length=(ak_objEdit.getBBox.width+ak_objEdit.getBBox.height)/4
var ak_tmp_matrix=ak_svgroot.createSVGMatrix().rotate(ak_feSaturate)
ak_feRotate=ak_svgroot.createSVGPoint()
ak_feRotate.x=ak_tmp_length
ak_feRotate=ak_feRotate.matrixTransform(ak_tmp_matrix)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+ak_tmp_centerX+"' y1='"+ak_tmp_centerY+"' x2='"+(ak_tmp_centerX+ak_feRotate.x)+"' y2='"+(ak_tmp_centerY+ak_feRotate.y)
ak_tmp_elements+="' style='fill-opacity:0;stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<circle cx='"+(ak_tmp_centerX)+"' cy='"+(ak_tmp_centerY)+"' r='"+(2/ak_grid_zoom)
ak_tmp_elements+="' style='fill:none;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feRotate")'
ak_tmp_elements="<circle cx='"+(ak_tmp_centerX+ak_feRotate.x)+"' cy='"+(ak_tmp_centerY+ak_feRotate.y)+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#08f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
}
break
case "feComponentTransfer":
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result')
break
case "feFuncR":
case "feFuncG":
case "feFuncB":
case "feFuncA":
var ak_tmp_color="#000"
switch(ak_fe2edit.tagName)
{
case "feFuncR": ak_tmp_color="#e20"; break
case "feFuncG": ak_tmp_color="#2e0"; break
case "feFuncB": ak_tmp_color="#00f"; break
}
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'type','tableValues','slope','intercept','amplitude','exponent','offset')
var ak_tmp_type=ak_fe2edit.getAttribute("type")
if(ak_tmp_type=="linear")
{
ak_feSaturate=parseFloat(ak_fe2edit.getAttribute("intercept"))
ak_feSaturate=isNaN(ak_feSaturate)?1:ak_feSaturate
ak_feSaturate=ak_feSaturate>1?1:ak_feSaturate
ak_feSaturate=ak_feSaturate<0?0:ak_feSaturate
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","translate")'
ak_tmp_elements="<line x1='"+ak_objEdit.getBBox.x+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x-(20/ak_grid_zoom))+"' y2='"+ak_objEdit.getBBox.y
ak_tmp_elements+="' style='stroke:url(#ak_internal_edit_border);stroke-width:"+(4/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+ak_objEdit.getBBox.x+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+ak_objEdit.getBBox.x+"' y2='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feSaturate))
ak_tmp_elements+="' style='stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feIntercept")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x)+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feSaturate))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:"+ak_tmp_color+";stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_feSlope=parseFloat(ak_fe2edit.getAttribute("slope"))
ak_feSlope=isNaN(ak_feSlope)?1:ak_feSlope
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+(ak_objEdit.getBBox.x-(20/ak_grid_zoom))+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x-(20/ak_grid_zoom))+"' y2='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feSlope/10))
ak_tmp_elements+="' style='stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feSlope")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(20/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feSlope/10))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:"+ak_tmp_color+";stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
}
else if(ak_tmp_type=="gamma")
{
ak_feSaturate=parseFloat(ak_fe2edit.getAttribute("offset"))
ak_feSaturate=isNaN(ak_feSaturate)?0:ak_feSaturate
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","translate")'
ak_tmp_elements="<line x1='"+ak_objEdit.getBBox.x+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x-(40/ak_grid_zoom))+"' y2='"+ak_objEdit.getBBox.y
ak_tmp_elements+="' style='stroke:url(#ak_internal_edit_border);stroke-width:"+(4/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+ak_objEdit.getBBox.x+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+ak_objEdit.getBBox.x+"' y2='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feSaturate))
ak_tmp_elements+="' style='stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feGammaOffset")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x)+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feSaturate))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:"+ak_tmp_color+";stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_feSlope=parseFloat(ak_fe2edit.getAttribute("exponent"))
ak_feSlope=isNaN(ak_feSlope)?1:ak_feSlope
ak_feSlope=ak_feSlope<0?0:ak_feSlope
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+(ak_objEdit.getBBox.x-(20/ak_grid_zoom))+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x-(20/ak_grid_zoom))+"' y2='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feSlope))
ak_tmp_elements+="' style='stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feExponent")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(20/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feSlope))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:"+ak_tmp_color+";stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_feAmplitude=parseFloat(ak_fe2edit.getAttribute("amplitude"))
ak_feAmplitude=isNaN(ak_feAmplitude)?1:ak_feAmplitude
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+(ak_objEdit.getBBox.x-(40/ak_grid_zoom))+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x-(40/ak_grid_zoom))+"' y2='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude/10))
ak_tmp_elements+="' style='stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feAmplitude")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(40/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude/10))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:"+ak_tmp_color+";stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
}
break
case "feComposite":
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','operator','k1','k2','k3','k4')
var ak_tmp_type=ak_fe2edit.getAttribute("operator")
if(ak_tmp_type=="arithmetic")
{
ak_feSaturate=parseFloat(ak_fe2edit.getAttribute("k4"))
ak_feSaturate=isNaN(ak_feSaturate)?0:ak_feSaturate
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","translate")'
ak_tmp_elements="<line x1='"+ak_objEdit.getBBox.x+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x-(60/ak_grid_zoom))+"' y2='"+ak_objEdit.getBBox.y
ak_tmp_elements+="' style='stroke:url(#ak_internal_edit_border);stroke-width:"+(4/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+ak_objEdit.getBBox.x+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+ak_objEdit.getBBox.x+"' y2='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feSaturate))
ak_tmp_elements+="' style='stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_fek4")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x)+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feSaturate))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#08f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_feSlope=parseFloat(ak_fe2edit.getAttribute("k3"))
ak_feSlope=isNaN(ak_feSlope)?0:ak_feSlope
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+(ak_objEdit.getBBox.x-(20/ak_grid_zoom))+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x-(20/ak_grid_zoom))+"' y2='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feSlope))
ak_tmp_elements+="' style='stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_fek3")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(20/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feSlope))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#08f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_feAmplitude=parseFloat(ak_fe2edit.getAttribute("k2"))
ak_feAmplitude=isNaN(ak_feAmplitude)?0:ak_feAmplitude
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+(ak_objEdit.getBBox.x-(40/ak_grid_zoom))+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x-(40/ak_grid_zoom))+"' y2='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude))
ak_tmp_elements+="' style='stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_fek2")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(40/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#08f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_feOffsetX=parseFloat(ak_fe2edit.getAttribute("k1"))
ak_feOffsetX=isNaN(ak_feOffsetX)?0:ak_feOffsetX
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+(ak_objEdit.getBBox.x-(60/ak_grid_zoom))+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x-(60/ak_grid_zoom))+"' y2='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feOffsetX))
ak_tmp_elements+="' style='stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_fek1")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(60/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feOffsetX))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#08f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
}
break
case "feConvolveMatrix":
ak_tagName_cout=ak_getAttributeCout("<"+ak_fe2edit.tagName,ak_fe2edit,'result','divisor','bias','targetX','targetY','order','kernelMatrix')
ak_feOrderX=ak_fe2edit.getAttribute("order")
ak_feOrderX=ak_feOrderX.replace(/,/g," ")
ak_feOrderX=ak_feOrderX.replace(/ +/g," ")
ak_feOrderX=ak_feOrderX.replace(/^ *| *$/g,"")
var ak_tmp_array=ak_feOrderX.split(" ")
ak_feOrderX=parseInt(ak_tmp_array[0])
ak_feOrderX=isNaN(ak_feOrderX)?0:ak_feOrderX
ak_feOrderY=parseInt(ak_tmp_array[1])
ak_feOrderY=isNaN(ak_feOrderY)?ak_feOrderX:ak_feOrderY
ak_feOffsetX=parseInt(ak_fe2edit.getAttribute("targetX"))
ak_feOffsetX=isNaN(ak_feOffsetX)?0:ak_feOffsetX
ak_feOffsetY=parseInt(ak_fe2edit.getAttribute("targetY"))
ak_feOffsetY=isNaN(ak_feOffsetY)?ak_feOffsetX:ak_feOffsetY
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feTarget")'
ak_tmp_elements="<rect x='"+(ak_objEdit.getBBox.x+ak_feOffsetX)+"' y='"+(ak_objEdit.getBBox.y+ak_feOffsetY)+"' width='"+ak_objEdit.getBBox.width+"' height='"+ak_objEdit.getBBox.height
ak_tmp_elements+="' style='fill-opacity:0;stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","translate")'
ak_tmp_elements="<line x1='"+ak_objEdit.getBBox.x+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x-(40/ak_grid_zoom))+"' y2='"+ak_objEdit.getBBox.y
ak_tmp_elements+="' style='stroke:url(#ak_internal_edit_border);stroke-width:"+(4/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_feMatrix=ak_fe2edit.getAttribute("kernelMatrix")
ak_feMatrix=ak_feMatrix.replace(/,/g," ")
ak_feMatrix=ak_feMatrix.replace(/ +/g," ")
ak_feMatrix=ak_feMatrix.replace(/^ *| *$/g,"")
var ak_tmp_array=ak_feMatrix.split(" ")
ak_feSaturate=0
for(var i=0;i<ak_tmp_array.length;i++)
{
ak_tmp_array[i]=parseFloat(ak_tmp_array[i])
ak_tmp_array[i]=isNaN(ak_tmp_array[i])?0:ak_tmp_array[i]
ak_feSaturate+=ak_tmp_array[i]
}
ak_feAmplitude=parseFloat(ak_fe2edit.getAttribute("divisor"))
ak_feAmplitude=isNaN(ak_feAmplitude)?ak_feSaturate:ak_feAmplitude
ak_feAmplitude=ak_feAmplitude/ak_feSaturate
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+(ak_objEdit.getBBox.x-(40/ak_grid_zoom))+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x-(40/ak_grid_zoom))+"' y2='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude))
ak_tmp_elements+="' style='stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feDivisor")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(40/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#08f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_feSlope=parseFloat(ak_fe2edit.getAttribute("bias"))
ak_feSlope=isNaN(ak_feSlope)?0:ak_feSlope
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+(ak_objEdit.getBBox.x-(20/ak_grid_zoom))+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x-(20/ak_grid_zoom))+"' y2='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feSlope))
ak_tmp_elements+="' style='stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feBias")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(20/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feSlope))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#08f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
break
case "feDisplacementMap":
var ak_tmp_color="#000"
switch(ak_fe2edit.getAttribute("xChannelSelector"))
{
case "R": ak_tmp_color="#e20"; break
case "G": ak_tmp_color="#2e0"; break
case "B": ak_tmp_color="#00f"; break
}
var ak_tmp_colorY="#000"
switch(ak_fe2edit.getAttribute("yChannelSelector"))
{
case "R": ak_tmp_colorY="#e20"; break
case "G": ak_tmp_colorY="#2e0"; break
case "B": ak_tmp_colorY="#00f"; break
}
ak_feAmplitude=parseFloat(ak_fe2edit.getAttribute("scale"))
ak_feAmplitude=isNaN(ak_feAmplitude)?1:ak_feAmplitude
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+(ak_objEdit.getBBox.x)+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x)+"' y2='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude/10)+(16/ak_grid_zoom))
ak_tmp_elements+="' style='stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+(ak_objEdit.getBBox.x-(28/ak_grid_zoom))+"' y1='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude/10))+"' x2='"+(ak_objEdit.getBBox.x)+"' y2='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude/10))
ak_tmp_elements+="' style='stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+(ak_objEdit.getBBox.x-(28/ak_grid_zoom))+"' y1='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude/10)+(16/ak_grid_zoom))+"' x2='"+(ak_objEdit.getBBox.x)+"' y2='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude/10)+(16/ak_grid_zoom))
ak_tmp_elements+="' style='stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feScale")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x)+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude/10))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:"+ak_tmp_colorY+";stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feScale")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(8/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude/10))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:"+ak_tmp_color+";stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","xChannelSelector","A")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(28/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude/10))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#000;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","xChannelSelector","B")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(38/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude/10))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#00f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","xChannelSelector","G")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(48/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude/10))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#2e0;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","xChannelSelector","R")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(58/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude/10))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#e20;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","yChannelSelector","A")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(28/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude/10)+(16/ak_grid_zoom))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#000;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","yChannelSelector","B")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(38/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude/10)+(16/ak_grid_zoom))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#00f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","yChannelSelector","G")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(48/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude/10)+(16/ak_grid_zoom))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#2e0;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","yChannelSelector","R")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(58/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feAmplitude/10)+(16/ak_grid_zoom))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#e20;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tagName_cout=ak_getAttributeCout("<"+ak_fe2edit.tagName,ak_fe2edit,'result','scale','xChannelSelector','yChannelSelector')
break
case "feGaussianBlur":
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','stdDeviation')
var ak_tmp_dev=ak_fe2edit.getAttribute("stdDeviation")
ak_tmp_dev=ak_tmp_dev.replace(/,/g," ")
ak_tmp_dev=ak_tmp_dev.replace(/ +/g," ")
ak_tmp_dev=ak_tmp_dev.split(" ")
ak_feOffsetX=ak_get_gradient_xy(evt,ak_tmp_dev[0],0,0,ak_objEdit.getBBox.width,ak_primitiveUnits)
if(isNaN(ak_tmp_dev[1])) ak_feOffsetY=ak_feOffsetX
else ak_feOffsetY=ak_get_gradient_xy(evt,ak_tmp_dev[1],0,0,ak_objEdit.getBBox.height,ak_primitiveUnits)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feGaussianBlurFine")'
ak_tmp_elements="<rect x='"+(ak_objEdit.getBBox.x-ak_feOffsetX)+"' y='"+(ak_objEdit.getBBox.y-ak_feOffsetY)+"' width='"+(ak_objEdit.getBBox.width+(2*ak_feOffsetX))+"' height='"+(ak_objEdit.getBBox.height+(2*ak_feOffsetY))
ak_tmp_elements+="' style='fill-opacity:0;stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feGaussianBlur")'
ak_tmp_elements="<rect x='"+((ak_objEdit.getBBox.x+ak_objEdit.getBBox.width+ak_feOffsetX)-(5/ak_grid_zoom))+"' y='"+((ak_objEdit.getBBox.y+ak_objEdit.getBBox.height+ak_feOffsetY)-(5/ak_grid_zoom))+"' width='"+(10/ak_grid_zoom)+"' height='"+(10/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#08f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
break
case "feMerge":
ak_tagName_cout=ak_getAttributeCout("<"+ak_fe2edit.tagName,ak_fe2edit,'result')
break
case "feMergeNode":
ak_tagName_cout=ak_getAttributeCout("<"+ak_fe2edit.tagName,ak_fe2edit,'in')
break
case "feMorphology":
ak_tagName_cout=ak_getAttributeCout("<"+ak_fe2edit.tagName,ak_fe2edit,'result','operator','radius')
var ak_tmp_dev=ak_fe2edit.getAttribute("radius")
ak_tmp_dev=ak_tmp_dev.replace(/,/g," ")
ak_tmp_dev=ak_tmp_dev.replace(/ +/g," ")
ak_tmp_dev=ak_tmp_dev.split(" ")
ak_feOffsetX=ak_get_gradient_xy(evt,ak_tmp_dev[0],0,0,ak_objEdit.getBBox.width,ak_primitiveUnits)
if(isNaN(ak_tmp_dev[1])) ak_feOffsetY=ak_feOffsetX
else ak_feOffsetY=ak_get_gradient_xy(evt,ak_tmp_dev[1],0,0,ak_objEdit.getBBox.height,ak_primitiveUnits)
var ak_tmp_scale=10
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<rect x='"+(ak_objEdit.getBBox.x-(ak_feOffsetX*ak_tmp_scale))+"' y='"+(ak_objEdit.getBBox.y-(ak_feOffsetY*ak_tmp_scale))+"' width='"+(ak_objEdit.getBBox.width+(2*(ak_feOffsetX*ak_tmp_scale)))+"' height='"+(ak_objEdit.getBBox.height+(2*(ak_feOffsetY*ak_tmp_scale)))
ak_tmp_elements+="' style='fill-opacity:0;stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feRadius")'
ak_tmp_elements="<rect x='"+((ak_objEdit.getBBox.x+ak_objEdit.getBBox.width+(ak_feOffsetX*ak_tmp_scale))-(5/ak_grid_zoom))+"' y='"+((ak_objEdit.getBBox.y+ak_objEdit.getBBox.height+(ak_feOffsetY*ak_tmp_scale))-(5/ak_grid_zoom))+"' width='"+(10/ak_grid_zoom)+"' height='"+(10/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#08f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
break
case "feOffset":
ak_feOffsetX=ak_get_gradient_xy(evt,ak_fe2edit.getAttribute("dx"),0,0,ak_objEdit.getBBox.width,ak_primitiveUnits)
ak_feOffsetY=ak_get_gradient_xy(evt,ak_fe2edit.getAttribute("dy"),0,0,ak_objEdit.getBBox.height,ak_primitiveUnits)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feOffset")'
ak_tmp_elements="<rect x='"+(ak_objEdit.getBBox.x+ak_feOffsetX)+"' y='"+(ak_objEdit.getBBox.y+ak_feOffsetY)+"' width='"+ak_objEdit.getBBox.width+"' height='"+ak_objEdit.getBBox.height
ak_tmp_elements+="' style='fill-opacity:0;stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','dx','dy')
break
case "feFlood":
ak_tagName_cout=ak_getAttributeCout("<"+ak_fe2edit.tagName,ak_fe2edit,'result','style','x','y','width','height')
ak_init_slider(evt,(ak_stop_slider_nr+1))
ak_SetGetRm_styleValue(document.getElementById(("ak_slider_nr_"+(ak_stop_slider_nr+1))),"visibility","remove","no_cout")
ak_set_hex2hue(evt,ak_SetGetRm_styleValue(ak_fe2edit,"flood-color","get","no_cout"),"set_stop_hex")
case "feImage":
if(ak_fe2edit.tagName=="feImage") ak_tagName_cout=ak_getAttributeCout("<"+ak_fe2edit.tagName,ak_fe2edit,'result','xlink:href','x','y','width','height')
case "feTile":
var ak_tmp_width=isNaN
var ak_tmp_height=isNaN
var ak_tmp_svg_box=ak_object2update
while(ak_tmp_svg_box)
{
try
{
if(ak_tmp_svg_box.tagName()=="svg")
{
if(isNaN(ak_tmp_width)) ak_tmp_width=parseFloat(ak_tmp_svg_box.getAttribute("width"))
if(isNaN(ak_tmp_height)) ak_tmp_height=parseFloat(ak_tmp_svg_box.getAttribute("height"))
if(!isNaN(ak_tmp_width) && !isNaN(ak_tmp_height)) break
}
}
catch(error){break}
ak_tmp_svg_box=ak_tmp_svg_box.parentNode
}
if(isNaN(ak_tmp_width)) ak_tmp_width=window.innerWidth
if(isNaN(ak_tmp_height)) ak_tmp_height=window.innerHeight
if(/%$/.test(ak_fe2edit.getAttribute("x")))
{ak_feOffsetX=ak_get_gradient_xy(evt,ak_fe2edit.getAttribute("x"),0,ak_gradient_vector_start.x,ak_tmp_p_width,"objectBoundingBox",ak_gradient_vector_start.x)}
else ak_feOffsetX=ak_get_gradient_xy(evt,ak_fe2edit.getAttribute("x"),0,0,ak_tmp_width,"userSpaceOnUse",ak_gradient_vector_start.x)
if(/%$/.test(ak_fe2edit.getAttribute("y")))
{ak_feOffsetY=ak_get_gradient_xy(evt,ak_fe2edit.getAttribute("y"),0,ak_gradient_vector_start.y,ak_tmp_p_height,"objectBoundingBox",ak_gradient_vector_start.y)}
else ak_feOffsetY=ak_get_gradient_xy(evt,ak_fe2edit.getAttribute("y"),0,0,ak_tmp_height,"userSpaceOnUse",ak_gradient_vector_start.y)
ak_feOrderX=ak_get_gradient_xy(evt,ak_fe2edit.getAttribute("width"),1,0,ak_tmp_p_width,ak_primitiveUnits,ak_tmp_p_width)
ak_feOrderY=ak_get_gradient_xy(evt,ak_fe2edit.getAttribute("height"),1,0,ak_tmp_p_height,ak_primitiveUnits,ak_tmp_p_height)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feTileXY")'
ak_tmp_elements="<rect x='"+ak_feOffsetX+"' y='"+ak_feOffsetY+"' width='"+ak_feOrderX+"' height='"+ak_feOrderY
ak_tmp_elements+="' style='fill-opacity:0;stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feTileWH")'
ak_tmp_elements="<rect x='"+((ak_feOrderX+ak_feOffsetX)-(5/ak_grid_zoom))+"' y='"+((ak_feOrderY+ak_feOffsetY)-(5/ak_grid_zoom))+"' width='"+(10/ak_grid_zoom)+"' height='"+(10/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#08f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
if(ak_fe2edit.tagName=="feTile") ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','x','y','width','height')
break
case "feTurbulence":
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","translate")'
ak_tmp_elements="<line x1='"+ak_objEdit.getBBox.x+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x-(40/ak_grid_zoom))+"' y2='"+ak_objEdit.getBBox.y
ak_tmp_elements+="' style='stroke:url(#ak_internal_edit_border);stroke-width:"+(4/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
var ak_tmp_dev=ak_fe2edit.getAttribute("baseFrequency")
ak_tmp_dev=ak_tmp_dev.replace(/,/g," ")
ak_tmp_dev=ak_tmp_dev.replace(/ +/g," ")
ak_tmp_dev=ak_tmp_dev.split(" ")
ak_feOffsetX=parseFloat(ak_tmp_dev[0])
if(isNaN(ak_tmp_dev[1])) ak_feOffsetY=ak_feOffsetX
else ak_feOffsetY=parseFloat(ak_tmp_dev[1])
ak_feOffsetX=Math.pow(ak_feOffsetX,1/3)
ak_feOffsetY=Math.pow(ak_feOffsetY,1/3)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+(ak_objEdit.getBBox.x)+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x+(ak_objEdit.getBBox.width*ak_feOffsetX))+"' y2='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feOffsetY))
ak_tmp_elements+="' style='stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feBaseFrequency")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x+(ak_objEdit.getBBox.width*ak_feOffsetX))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feOffsetY))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#08f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_feSlope=parseFloat(ak_fe2edit.getAttribute("numOctaves"))
ak_feSlope=isNaN(ak_feSlope)?1:ak_feSlope
ak_feSlope=ak_feSlope<0?0:ak_feSlope
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+(ak_objEdit.getBBox.x-(20/ak_grid_zoom))+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x-(20/ak_grid_zoom))+"' y2='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feSlope/10))
ak_tmp_elements+="' style='stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feNumOctaves")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(20/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height*ak_feSlope/10))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#08f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_feAmplitude=parseFloat(ak_fe2edit.getAttribute("seed"))
ak_feAmplitude=isNaN(ak_feAmplitude)?0:ak_feAmplitude
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+(ak_objEdit.getBBox.x-(40/ak_grid_zoom))+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x-(40/ak_grid_zoom))+"' y2='"+(ak_objEdit.getBBox.y+ak_feAmplitude)
ak_tmp_elements+="' style='stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feSeed")'
ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(40/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+ak_feAmplitude)+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#08f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','seed','numOctaves','baseFrequency','type','stitchTiles')
break
case "feDiffuseLighting":
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','diffuseConstant','surfaceScale','style')
ak_set_hex2hue(evt,ak_SetGetRm_styleValue(ak_fe2edit,"lighting-color","get","no_cout"),"set_stop_hex")
ak_make_controlBar(20,ak_grid_zoom,g_append)
ak_feAmplitude=parseFloat(ak_fe2edit.getAttribute("surfaceScale"))
ak_feAmplitude=isNaN(ak_feAmplitude)?0:ak_feAmplitude
ak_make_controlPoint(0,ak_grid_zoom,g_append,ak_feAmplitude/10,'filter_fesurfaceScale')
ak_feConstant=parseFloat(ak_fe2edit.getAttribute("diffuseConstant"))
ak_feConstant=isNaN(ak_feConstant)?0:ak_feConstant
ak_make_controlPoint(20,ak_grid_zoom,g_append,ak_feConstant/10,'filter_fediffuseConstant')
break
case "feSpecularLighting":
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','specularExponent','specularConstant','surfaceScale','style')
ak_set_hex2hue(evt,ak_SetGetRm_styleValue(ak_fe2edit,"lighting-color","get","no_cout"),"set_stop_hex")
ak_make_controlBar(40,ak_grid_zoom,g_append)
ak_feAmplitude=parseFloat(ak_fe2edit.getAttribute("surfaceScale"))
ak_feAmplitude=isNaN(ak_feAmplitude)?0:ak_feAmplitude
ak_make_controlPoint(0,ak_grid_zoom,g_append,ak_feAmplitude/10,'filter_feSpecSurfaceScale')
ak_feSaturate=parseFloat(ak_fe2edit.getAttribute("specularConstant"))
ak_feSaturate=isNaN(ak_feSaturate)?0:ak_feSaturate
ak_make_controlPoint(20,ak_grid_zoom,g_append,ak_feSaturate/10,'filter_fespecularConstant')
ak_feSlope=parseFloat(ak_fe2edit.getAttribute("specularExponent"))
ak_feSlope=isNaN(ak_feSlope)?0:ak_feSlope
ak_make_controlPoint(40,ak_grid_zoom,g_append,ak_feSlope/10,'filter_fespecularExponent')
break
case "feDistantLight":
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'elevation','azimuth')
ak_feSaturate=parseFloat(ak_fe2edit.getAttribute("azimuth"))
ak_feSaturate=isNaN(ak_feSaturate)?0:ak_feSaturate
while(ak_feSaturate>360){ak_feSaturate-=360}
while(ak_feSaturate<0){ak_feSaturate+=360}
var ak_tmp_centerX=(ak_objEdit.getBBox.x+(0.5*ak_objEdit.getBBox.width))
var ak_tmp_centerY=(ak_objEdit.getBBox.y+(0.5*ak_objEdit.getBBox.height))
var ak_tmp_length=(Math.pow(Math.pow(ak_objEdit.getBBox.width,2)+Math.pow(ak_objEdit.getBBox.height,2),0.5)*0.6)+(10/ak_grid_zoom)
ak_feOffsetX=ak_tmp_length
ak_feSlope=parseFloat(ak_fe2edit.getAttribute("elevation"))
ak_feSlope=isNaN(ak_feSlope)?0:ak_feSlope
while(ak_feSlope>270){ak_feSlope-=360}
while(ak_feSlope<-90){ak_feSlope+=360}
var ak_tmp_length2=ak_tmp_length*((ak_feSlope-90)/-90)
var ak_tmp_matrix=ak_svgroot.createSVGMatrix().rotate(ak_feSaturate+90)
ak_feRotate=ak_svgroot.createSVGPoint()
ak_feRotate.y=-ak_tmp_length
ak_feRotate=ak_feRotate.matrixTransform(ak_tmp_matrix)
ak_feRotate2=ak_svgroot.createSVGPoint()
ak_feRotate2.y=-ak_tmp_length2
ak_feRotate2=ak_feRotate2.matrixTransform(ak_tmp_matrix)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+ak_tmp_centerX+"' y1='"+ak_tmp_centerY+"' x2='"+(ak_tmp_centerX+ak_feRotate.x)+"' y2='"+(ak_tmp_centerY+ak_feRotate.y)
ak_tmp_elements+="' style='stroke:#08f;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+ak_tmp_centerX+"' y1='"+ak_tmp_centerY+"' x2='"+(ak_tmp_centerX+ak_feRotate2.x)+"' y2='"+(ak_tmp_centerY+ak_feRotate2.y)
ak_tmp_elements+="' style='stroke:#c2c;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<circle cx='"+(ak_tmp_centerX)+"' cy='"+(ak_tmp_centerY)+"' r='"+(2/ak_grid_zoom)
ak_tmp_elements+="' style='fill:none;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feAzimuth")'
ak_tmp_elements="<circle cx='"+(ak_tmp_centerX+ak_feRotate.x)+"' cy='"+(ak_tmp_centerY+ak_feRotate.y)+"' r='"+(10/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#08f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feElevation")'
ak_tmp_elements="<circle cx='"+(ak_tmp_centerX+ak_feRotate2.x)+"' cy='"+(ak_tmp_centerY+ak_feRotate2.y)+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#c2c;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
break
case "fePointLight":
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'x','y','z')
ak_feOffsetX=parseFloat(ak_fe2edit.getAttribute("x"))
ak_feOffsetX=isNaN(ak_feOffsetX)?0:ak_feOffsetX
ak_feOffsetY=parseFloat(ak_fe2edit.getAttribute("y"))
ak_feOffsetY=isNaN(ak_feOffsetY)?0:ak_feOffsetY
ak_feSaturate=parseFloat(ak_fe2edit.getAttribute("z"))
ak_feSaturate=isNaN(ak_feSaturate)?0:ak_feSaturate
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+ak_feOffsetX+"' y1='"+ak_feOffsetY+"' x2='"+ak_feOffsetX+"' y2='"+(ak_feOffsetY+ak_feSaturate)
ak_tmp_elements+="' style='stroke:#c2c;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_fePointXY")'
ak_tmp_elements="<circle cx='"+ak_feOffsetX+"' cy='"+ak_feOffsetY+"' r='"+(10/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#08f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_fePointZ")'
ak_tmp_elements="<circle cx='"+ak_feOffsetX+"' cy='"+(ak_feOffsetY+ak_feSaturate)+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#c2c;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
break
case "feSpotLight":
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'x','y','z','pointsAtX','pointsAtY','pointsAtZ','specularExponent','limitingConeAngle')
ak_feOffsetX=parseFloat(ak_fe2edit.getAttribute("x"))
ak_feOffsetX=isNaN(ak_feOffsetX)?0:ak_feOffsetX
ak_feOffsetY=parseFloat(ak_fe2edit.getAttribute("y"))
ak_feOffsetY=isNaN(ak_feOffsetY)?0:ak_feOffsetY
ak_feSaturate=parseFloat(ak_fe2edit.getAttribute("z"))
ak_feSaturate=isNaN(ak_feSaturate)?0:ak_feSaturate
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+ak_feOffsetX+"' y1='"+ak_feOffsetY+"' x2='"+ak_feOffsetX+"' y2='"+(ak_feOffsetY+ak_feSaturate)
ak_tmp_elements+="' style='stroke:#c2c;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_feOrderX=parseFloat(ak_fe2edit.getAttribute("pointsAtX"))
ak_feOrderX=isNaN(ak_feOrderX)?0:ak_feOrderX
ak_feOrderY=parseFloat(ak_fe2edit.getAttribute("pointsAtY"))
ak_feOrderY=isNaN(ak_feOrderY)?0:ak_feOrderY
ak_feSlope=parseFloat(ak_fe2edit.getAttribute("pointsAtZ"))
ak_feSlope=isNaN(ak_feSlope)?0:ak_feSlope
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+ak_feOffsetX+"' y1='"+ak_feOffsetY+"' x2='"+ak_feOrderX+"' y2='"+ak_feOrderY
ak_tmp_elements+="' style='stroke:#bbb;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+ak_feOrderX+"' y1='"+ak_feOrderY+"' x2='"+ak_feOrderX+"' y2='"+(ak_feOrderY+ak_feSlope)
ak_tmp_elements+="' style='stroke:#c2c;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+ak_feOffsetX+"' y1='"+ak_feOffsetY+"' x2='"+ak_feOffsetX+"' y2='"+(ak_feOffsetY+ak_feSaturate)
ak_tmp_elements+="' style='stroke:#c2c;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_feAmplitude=parseFloat(ak_fe2edit.getAttribute("specularExponent"))
ak_feAmplitude=isNaN(ak_feAmplitude)?0:ak_feAmplitude
var ak_tmp_shift=(15/ak_grid_zoom)
ak_feAngle=parseFloat(ak_fe2edit.getAttribute("limitingConeAngle"))
ak_feAngle=isNaN(ak_feAngle)?90:ak_feAngle
ak_feAngle=ak_feAngle<0?90:ak_feAngle
ak_feAngle=ak_feAngle>90?90:ak_feAngle
if(ak_feAmplitude<0) ak_tmp_shift*=-1
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+(ak_feOffsetX+ak_feAmplitude+ak_tmp_shift)+"' y1='"+ak_feOffsetY+"' x2='"+ak_feOffsetX+"' y2='"+ak_feOffsetY
ak_tmp_elements+="' style='stroke:#f90;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
ak_tmp_elements="<line x1='"+(ak_feOrderX+ak_feAngle+(15/ak_grid_zoom))+"' y1='"+ak_feOrderY+"' x2='"+ak_feOrderX+"' y2='"+ak_feOrderY
ak_tmp_elements+="' style='stroke:#f90;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_fePointAtXY")'
ak_tmp_elements="<circle cx='"+ak_feOrderX+"' cy='"+ak_feOrderY+"' r='"+(10/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#bbb;stroke:#08f;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_fePointAtZ")'
ak_tmp_elements="<circle cx='"+ak_feOrderX+"' cy='"+(ak_feOrderY+ak_feSlope)+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#c2c;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_fePointXY")'
ak_tmp_elements="<circle cx='"+ak_feOffsetX+"' cy='"+ak_feOffsetY+"' r='"+(10/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#08f;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_fePointZ")'
ak_tmp_elements="<circle cx='"+ak_feOffsetX+"' cy='"+(ak_feOffsetY+ak_feSaturate)+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#c2c;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feSpotExponent")'
ak_tmp_elements="<circle cx='"+(ak_feOffsetX+ak_feAmplitude+ak_tmp_shift)+"' cy='"+(ak_feOffsetY)+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#f90;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_feConeAngle")'
ak_tmp_elements="<circle cx='"+(ak_feOrderX+ak_feAngle+(15/ak_grid_zoom))+"' cy='"+(ak_feOrderY)+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#f90;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
break
}
}
if (ak_tagName_cout.length>124) ak_tagName_cout=ak_tagName_cout.substring(0,120)+" ..."
}
var ak_feOffsetX, ak_feOffsetY, ak_feSaturate, ak_feRotate, ak_feRotate2, ak_feSlope, ak_feAmplitude, ak_feAngle
var ak_feOrderX, ak_feOrderY, ak_feMatrix, ak_feScale, ak_feConstant, ak_feExponent
//##############################################################
function ak_make_controlBar(x_minus,ak_grid_zoom,g_append)
{
var ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","translate")'
var ak_tmp_elements="<line x1='"+ak_objEdit.getBBox.x+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x-(x_minus/ak_grid_zoom))+"' y2='"+ak_objEdit.getBBox.y
ak_tmp_elements+="' style='stroke:url(#ak_internal_edit_border);stroke-width:"+(4/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
}
//##############################################################
function ak_make_controlLine(x_minus,ak_grid_zoom,g_append,yPixel,color)
{
var ak_tmp_color='#08f'
if(color) ak_tmp_color=color
var ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","filter_nix")'
var ak_tmp_elements="<line x1='"+(ak_objEdit.getBBox.x-(x_minus/ak_grid_zoom))+"' y1='"+ak_objEdit.getBBox.y+"' x2='"+(ak_objEdit.getBBox.x-(x_minus/ak_grid_zoom))+"' y2='"+(ak_objEdit.getBBox.y+(yPixel*ak_objEdit.getBBox.height))
ak_tmp_elements+="' style='stroke:"+ak_tmp_color+";stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
}
//##############################################################
function ak_make_controlPoint(x_minus,ak_grid_zoom,g_append,yPixel,mouse_action,color,stroke)
{
var ak_tmp_color='#08f'
var ak_tmp_stroke='#fff'
if(color) {ak_make_controlLine(x_minus,ak_grid_zoom,g_append,yPixel,color); ak_tmp_color=color}
else ak_make_controlLine(x_minus,ak_grid_zoom,g_append,yPixel)
if(stroke) ak_tmp_stroke=stroke
var ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","'+mouse_action+'")'
var ak_tmp_elements="<circle cx='"+(ak_objEdit.getBBox.x-(x_minus/ak_grid_zoom))+"' cy='"+(ak_objEdit.getBBox.y+(yPixel*ak_objEdit.getBBox.height))+"' r='"+(5/ak_grid_zoom)
ak_tmp_elements+="' style='fill:"+ak_tmp_color+";stroke:"+ak_tmp_stroke+";stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
}
//##############################################################
function ak_getAttributeCout()
{
var ak_tmp_return=''
var i_plus=0
if(typeof(arguments[0])=="string") {ak_tmp_return=arguments[0]; i_plus=1}
for(var i=(1+i_plus);i<arguments.length;i++)
{
if(arguments[(0+i_plus)].getAttribute(arguments[i])!="")
{
if(arguments[i]=="xlink:href" && /^data:;base64/.test(arguments[(0+i_plus)].getAttribute(arguments[i])))
{
ak_tmp_return+=' '+arguments[i]+'="data:;base64,..."'
}
else ak_tmp_return+=' '+arguments[i]+'="'+arguments[(0+i_plus)].getAttribute(arguments[i])+'"'
}
}
if(typeof(arguments[0])=="string") {if (ak_tmp_return.length>124) ak_tmp_return=ak_tmp_return.substring(0,120)+" ..."}
return ak_tmp_return
}
//##############################################################
function ak_setAttributeList()
{
for(var i=1;i<arguments.length;i=i+2){arguments[0].setAttribute(arguments[i],arguments[i+1])}
ak_push2undoTrue()
}
//##############################################################
function ak_setAttributeListUpdate()
{
for(var i=1;i<arguments.length;i=i+2){arguments[0].setAttribute(arguments[i],arguments[i+1])}
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
//##############################################################
function ak_setAttributeListUpdateRM() // RM = remove attribute=""
{
for(var i=1;i<arguments.length;i=i+2)
{
if(arguments[i+1]=="") {try{arguments[0].removeAttribute(arguments[i])}catch(error){}}
else arguments[0].setAttribute(arguments[i],arguments[i+1])
}
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
//##############################################################
function ak_removeAttributeList()
{
for(var i=1;i<arguments.length;i++){try{arguments[0].removeAttribute(arguments[i])}catch(error){}}
ak_push2undoTrue()
}
//##############################################################
function ak_removeAttributeListUpdate()
{
for(var i=1;i<arguments.length;i++){try{arguments[0].removeAttribute(arguments[i])}catch(error){}}
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
}
//##############################################################
function ak_getGradientMenu(evt)
{
var ak_tmpNode="", ak_tmp
var ak_tmpValue=ak_gradient2edit.getAttribute("gradientUnits")
if(ak_tmpValue=="userSpaceOnUse") ak_tmpNode+='<item checked="yes" onactivate="'+"ak_edit_gradient_attributes(evt,'remove gradientUnits')"+'">userSpaceOnUse</item>'
else ak_tmpNode+='<item onactivate="'+"ak_edit_gradient_attributes(evt,'userSpaceOnUse')"+'">userSpaceOnUse</item>'
if(ak_tmpValue=="objectBoundingBox") ak_tmpNode+='<item checked="yes" onactivate="'+"ak_edit_gradient_attributes(evt,'remove gradientUnits')"+'">objectBoundingBox (default)</item>'
else ak_tmpNode+='<item onactivate="'+"ak_edit_gradient_attributes(evt,'objectBoundingBox')"+'">objectBoundingBox (default)</item>'
ak_tmpNode+='<separator/>'
ak_tmpValue=ak_gradient2edit.getAttribute("gradientTransform")
if(ak_tmpValue) ak_tmpNode+='<item onactivate="'+"ak_edit_gradient_attributes(evt,'remove gradientTransform')"+'">remove gradientTransform</item><separator/>'
ak_tmp=true
if(ak_gradient2edit.tagName=="linearGradient")
{
ak_tmpValue=ak_gradient2edit.getAttribute("x1")
if(ak_tmpValue!="" && ak_tmpValue!="0%" && ak_tmpValue!="0") ak_tmp=false
ak_tmpValue=ak_gradient2edit.getAttribute("y1")
if(ak_tmpValue!="" && ak_tmpValue!="0%" && ak_tmpValue!="0") ak_tmp=false
ak_tmpValue=ak_gradient2edit.getAttribute("x2")
if(ak_tmpValue!="" && ak_tmpValue!="100%" && ak_tmpValue!="1") ak_tmp=false
ak_tmpValue=ak_gradient2edit.getAttribute("y2")
if(ak_tmpValue!="" && ak_tmpValue!="0%" && ak_tmpValue!="0") ak_tmp=false
if(ak_tmp) ak_tmpNode+='<item checked="yes"> x1|y1|y2 = "0%"    x2="100%"</item>'
else ak_tmpNode+='<item onactivate="'+"ak_edit_gradient_attributes(evt,'xyDefault')"+'">set  x1|y1|y2 = "0%"    x2="100%"</item>'
}
else
{
ak_tmpValue=ak_gradient2edit.getAttribute("r")
if(ak_tmpValue!="" && ak_tmpValue!="50%" && ak_tmpValue!="0.5") ak_tmp=false
ak_tmpValue=ak_gradient2edit.getAttribute("fx")
if(ak_tmpValue!="") ak_tmp=false
ak_tmpValue=ak_gradient2edit.getAttribute("fy")
if(ak_tmpValue!="") ak_tmp=false
ak_tmpValue=ak_gradient2edit.getAttribute("cx")
if(ak_tmpValue!="" && ak_tmpValue!="50%" && ak_tmpValue!="0.5") ak_tmp=false
ak_tmpValue=ak_gradient2edit.getAttribute("cy")
if(ak_tmpValue!="" && ak_tmpValue!="50%" && ak_tmpValue!="0.5") ak_tmp=false
if(ak_tmp) ak_tmpNode+='<item checked="yes"> cx|cy|r = "50%"    fx|fy = ""</item>'
else ak_tmpNode+='<item onactivate="'+"ak_edit_gradient_attributes(evt,'rxyDefault')"+'">set  cx|cy|r = "50%"    fx|fy = ""</item>'
}
ak_tmpNode+='<separator/>'
ak_tmpValue=ak_gradient2edit.getAttribute("spreadMethod")
if(ak_tmpValue=="reflect") ak_tmpNode+='<item checked="yes">reflect</item>'
else ak_tmpNode+='<item onactivate="'+"ak_edit_gradient_attributes(evt,'reflect')"+'">reflect</item>'
if(ak_tmpValue=="repeat") ak_tmpNode+='<item checked="yes">repeat</item>'
else ak_tmpNode+='<item onactivate="'+"ak_edit_gradient_attributes(evt,'repeat')"+'">repeat</item>'
if(ak_tmpValue=="pad") ak_tmpNode+='<item checked="yes">pad  (default)</item>'
else ak_tmpNode+='<item onactivate="'+"ak_edit_gradient_attributes(evt,'pad')"+'">pad  (default)</item>'
if(!ak_tmpValue) ak_tmpNode+='<item checked="yes">remove spreadMethod</item>'
else ak_tmpNode+='<item onactivate="'+"ak_edit_gradient_attributes(evt,'remove spreadMethod')"+'">remove spreadMethod</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item id="ak_gUnits_copy_gradient" onactivate="'+"ak_edit_gradient_attributes(evt,'Copy Gradient to Clipboard','"+ak_gradient2edit.getId()+"')"+'">Copy "'+ak_gradient2edit.getId()+'" to Clipboard</item>'
ak_tmpNode+='<item onactivate="'+"ak_edit_gradient_attributes(evt,'cloneGradient','"+ak_gradient2edit.getId()+"')"+'">Clone "'+ak_gradient2edit.getId()+'"</item>'
return ak_tmpNode
}
//##############################################################
function ak_getPatternMenu(evt)
{
var ak_tmpNode="", ak_tmp
var ak_tmp_childNr=ak_which_nodeNr(ak_pattern2edit)
eval("var ak_tmp_childMenu=ak_get_childMenu(true,"+ak_tmp_childNr+")") // kein rootCheck hier noetig
if (ak_tmp_childMenu=="") ak_tmpNode='<item enabled="no">No Pattern childNodes!</item>'
else
{
if(ak_tmp_childMenu.search(/<\/header>/)!=-1)
{
ak_tmp_childMenu=ak_tmp_childMenu.substring(ak_tmp_childMenu.search(/<\/header>/))
ak_tmp_childMenu="<menu><header>Pattern childNodes"+ak_tmp_childMenu
}
ak_tmpNode=ak_tmp_childMenu
}
ak_tmpNode+='<item onactivate="ak_convertGroup(\'nodeNr\',\'g\',\''+ak_tmp_childNr+'\')">Convert to &lt;g/></item>'
ak_tmpNode+='<separator/>'
var ak_tmpValue=ak_pattern2edit.getAttribute("patternUnits")
if(ak_tmpValue=="userSpaceOnUse") ak_tmpNode+='<item checked="yes" onactivate="'+"ak_edit_pattern_attributes(evt,'remove patternUnits')"+'">userSpaceOnUse</item>'
else ak_tmpNode+='<item onactivate="'+"ak_edit_pattern_attributes(evt,'userSpaceOnUse')"+'">userSpaceOnUse</item>'
if(ak_tmpValue=="objectBoundingBox") ak_tmpNode+='<item checked="yes" onactivate="'+"ak_edit_pattern_attributes(evt,'remove patternUnits')"+'">objectBoundingBox (default)</item>'
else ak_tmpNode+='<item onactivate="'+"ak_edit_pattern_attributes(evt,'objectBoundingBox')"+'">objectBoundingBox (default)</item>'
ak_tmpNode+='<separator/>'
ak_tmpValue=ak_pattern2edit.getAttribute("patternTransform")
if(ak_tmpValue) ak_tmpNode+='<item onactivate="'+"ak_edit_pattern_attributes(evt,'remove patternTransform')"+'">remove patternTransform</item><separator/>'
else ak_tmpNode+='<item enabled="no">remove patternTransform</item><separator/>'
ak_tmp=true
ak_tmpValue=ak_pattern2edit.getAttribute("x")
if(ak_tmpValue!="" && ak_tmpValue!="0%" && ak_tmpValue!="0") ak_tmp=false
ak_tmpValue=ak_pattern2edit.getAttribute("y")
if(ak_tmpValue!="" && ak_tmpValue!="0%" && ak_tmpValue!="0") ak_tmp=false
ak_tmpValue=ak_pattern2edit.getAttribute("width")
if(ak_tmpValue!="50%") ak_tmp=false
ak_tmpValue=ak_pattern2edit.getAttribute("height")
if(ak_tmpValue!="50%") ak_tmp=false
if(ak_tmp) ak_tmpNode+='<item checked="yes"> x|y = "0%"    width|height = "50%"</item>'
else ak_tmpNode+='<item onactivate="'+"ak_edit_pattern_attributes(evt,'xyDefault')"+'">set  x|y = "0%"    width|height = "50%"</item>'

ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_edit_pattern_attributes(evt,'Copy Pattern to Clipboard','"+ak_pattern2edit.getId()+"')"+'">Copy "'+ak_pattern2edit.getId()+'" to Clipboard</item>'
ak_tmpNode+='<item onactivate="'+"ak_edit_pattern_attributes(evt,'clonePattern','"+ak_pattern2edit.getId()+"')"+'">Clone "'+ak_pattern2edit.getId()+'"</item>'
return ak_tmpNode
}
//##############################################################
var ak_gradient2edit
var ak_pattern2edit, ak_fe2edit
var ak_gradient_matrix
var ak_gradientName_start
var ak_gradientUnits, ak_patternUnits, ak_primitiveUnits
var ak_gradient_stop, ak_stop_offset, ak_stop_color, ak_stop_opacity, ak_stop_min // arrays
var ak_previous_stop, ak_last_stop, ak_previous_color, ak_previous_opacity // arrays
var ak_gradient_stop_index=-1 // aktueller stop Node
var ak_gradient_vector, ak_gradient_vector_90, ak_gradient_vector_start, ak_gradient_radial_center
var ak_gradient_control_start, ak_gradient_radial_r, ak_gradient_radial_ry
//##############################################################
var ak_lastGradient=false, ak_lastGradientIndex=-1
function ak_set_gradient_control(evt)
{
if(ak_color_action_on=="stroke_url") var ak_tmp_gradient=ak_SetGetRm_styleValue(ak_object2update,"stroke","get","no_cout")
else if(ak_color_action_on=="fill_url") var ak_tmp_gradient=ak_SetGetRm_styleValue(ak_object2update,"fill","get","no_cout")
else if(ak_color_action_on=="filter") var ak_tmp_gradient=ak_SetGetRm_styleValue(ak_object2update,"filter","get","no_cout")
else
{
ak_gradient_stop_index=-1
return
}
ak_tmp_gradient=ak_tmp_gradient.replace(/\( +/,"(")
ak_tmp_gradient=ak_tmp_gradient.replace(/ +\)/,")")
if(ak_tmp_gradient.substring(0,5)!="url(#")
{
ak_edit_gradient_flag=false
ak_gradient_stop_index=-1
return
}
ak_tmp_gradient=ak_tmp_gradient.replace(/url\(#|\)/g,"")
var ak_tmp_gradient_id=ak_tmp_gradient
ak_tmp_gradient=document.getElementById(ak_tmp_gradient)
if(!ak_tmp_gradient || !/Gradient/.test(ak_tmp_gradient.tagName()))
{
if(ak_tmp_gradient && ak_tmp_gradient.tagName()=="pattern") 
{
try{document.getElementById("ak_gradient_flag_in_menu").setAttribute("checked","yes")}catch(error){}
ak_pattern2edit=ak_tmp_gradient
ak_edit_gradient_flag="pattern"
ak_set_pattern_control(evt)
}
else if(ak_tmp_gradient && ak_tmp_gradient.tagName()=="filter") 
{
try{document.getElementById("ak_filter_flag_in_menu").setAttribute("checked","yes")}catch(error){}
ak_pattern2edit=ak_tmp_gradient
ak_edit_gradient_flag="filter"
ak_set_filter_control(evt)
}
else ak_edit_gradient_flag=false
return
}
if(ak_which_nodeNr(ak_lastGradient)!=ak_which_nodeNr(ak_tmp_gradient))
{
ak_lastGradient=ak_tmp_gradient
ak_lastGradientIndex=-1
ak_gradient_stop_index=-1
}
else ak_gradient_stop_index=ak_lastGradientIndex
ak_edit_gradient_flag="gradient"
var ak_tmp_href=ak_tmp_gradient.getAttribute("xlink:href").replace(/^( *#)| +$/g,"")
ak_gradient2edit=ak_tmp_gradient
ak_gradientName_start="<"+ak_gradient2edit.tagName()
if(ak_gradient2edit.getId()!=null && ak_gradient2edit.getId()!="") ak_gradientName_start+=' id="'+ak_gradient2edit.getId()+'"'
ak_tagName_cout=ak_gradientName_start
if(ak_gradient2edit.tagName=="linearGradient"){ak_tagName_cout+=ak_getAttributeCout(ak_gradient2edit,'x1','y1','x2','y2')}
else{ak_tagName_cout+=ak_getAttributeCout(ak_gradient2edit,'fx','fy','cx','cy','r')}
var ak_grid_zoom=ak_obj_control_scale // locale variable
ak_gradient_stop=new Array
ak_stop_offset=new Array
ak_stop_min=new Array
ak_previous_stop=new Array
ak_stop_color=new Array
ak_previous_color=new Array
ak_stop_opacity=new Array
ak_previous_opacity=new Array
ak_last_stop=new Array
var ak_tmp_index=ak_gradient_stop_index
ak_gradient_stop_index=-1
for(var i=0;i<ak_gradient2edit.childNodes.length;i++)
{
if(ak_gradient2edit.childNodes.item(i).tagName=="stop")
{
ak_gradient_stop[i]=ak_gradient2edit.childNodes.item(i)
ak_stop_offset[i]=ak_gradient_stop[i].getAttribute("offset")
ak_stop_color[i]=ak_SetGetRm_styleValue(ak_gradient_stop[i],"stop-color","get","no_cout")
ak_stop_opacity[i]=ak_SetGetRm_styleValue(ak_gradient_stop[i],"stop-opacity","get","no_cout")
}
else ak_gradient_stop[i]=false
}
ak_gradient_stop_index=ak_tmp_index
var ak_tmp_min=0
var ak_tmp_color=false
var ak_tmp_opacity
var ak_tmp_prev_stop
var ak_tmp_val_increments=new Array
ak_tmp_val_increments[0]=0
for(var i=0;i<ak_gradient2edit.childNodes.length;i++)
{
if(ak_gradient_stop[i])
{
var ak_tmp_value=parseFloat(ak_stop_offset[i])
if(isNaN(ak_tmp_value)) ak_stop_offset[i]=0
else if(/(% *)$/.test(ak_stop_offset[i])) ak_stop_offset[i]=ak_tmp_value/100
if(ak_stop_offset[i]>1) ak_stop_offset[i]=1
if(ak_stop_offset[i]>ak_tmp_min) ak_tmp_val_increments.push(ak_stop_offset[i])
if(ak_stop_offset[i]<=ak_tmp_min) 
{
ak_stop_offset[i]=ak_tmp_min            
}
ak_stop_min[i]=ak_tmp_min
ak_tmp_min=ak_stop_offset[i]
ak_gradient_stop[i].setAttribute("offset",ak_round(ak_stop_offset[i]*100,10)+"%")
if(/[^\d\.\+\-]/.test(ak_stop_opacity[i])) ak_stop_opacity[i]=1
ak_tmp_value=parseFloat(ak_stop_opacity[i])
if(isNaN(ak_tmp_value)) ak_stop_opacity[i]=1
else if(ak_tmp_value>1) ak_stop_opacity[i]=1
else if(ak_tmp_value<0) ak_stop_opacity[i]=0
ak_stop_color[i]=ak_set_hex2hue(evt,ak_stop_color[i],"get_hex")
if(!ak_tmp_color)
{
ak_tmp_prev_stop=i
ak_previous_stop[i]=ak_tmp_prev_stop
ak_tmp_color=ak_stop_color[i]
ak_previous_color[i]=ak_tmp_color
ak_tmp_opacity=ak_stop_opacity[i]
ak_previous_opacity[i]=ak_tmp_opacity
}
else
{
ak_previous_stop[i]=ak_tmp_prev_stop
ak_tmp_prev_stop=i
ak_previous_color[i]=ak_tmp_color
ak_tmp_color=ak_stop_color[i]
ak_previous_opacity[i]=ak_tmp_opacity
ak_tmp_opacity=ak_stop_opacity[i]
}
}
}
if(ak_tmp_val_increments[ak_tmp_val_increments.length-1]<1) ak_tmp_val_increments.push(1)
if(ak_gradient_stop_index==-1)
{
for(var i=0;i<ak_gradient2edit.childNodes.length;i++)
{
if(ak_gradient_stop[i])
{
ak_gradient_stop_index=i
break
}
}
}
var ak_tmp_gradientUnits=ak_tmp_gradient.getAttribute("gradientUnits").replace(/^ +| +$/g,"")
var ak_tmp_gradient_href=ak_tmp_gradient
if(ak_tmp_gradientUnits!="objectBoundingBox" && ak_tmp_gradientUnits!="userSpaceOnUse") ak_tmp_gradientUnits=""
var ak_tmp_array=new Array
var ak_tmp_flag=false
var ak_tmp_object=ak_tmp_gradient
while(ak_tmp_gradientUnits=="")
{
try
{
ak_tmp_array.push(ak_tmp_object.getAttribute("xlink:href").replace(/^( *#)| +$/g,""))
if(ak_tmp_array[ak_tmp_array.length-1]==ak_tmp_object.getId()) break
for(var i=0;i<(ak_tmp_array.length-1);i++)
{
if(ak_tmp_array[i]==ak_tmp_array[ak_tmp_array.length-1]) ak_tmp_flag=true
}
if(ak_tmp_flag) {ak_tmp_gradientUnits="objectBoundingBox"; break}
ak_tmp_object=document.getElementById(ak_tmp_array[ak_tmp_array.length-1])
ak_tmp_gradientUnits=ak_tmp_object.getAttribute("gradientUnits")
if(ak_tmp_gradientUnits!="objectBoundingBox" && ak_tmp_gradientUnits!="userSpaceOnUse") ak_tmp_gradientUnits=""
}
catch(error)
{
if(ak_tmp_gradientUnits=="") ak_tmp_gradientUnits="objectBoundingBox"
break
}
}
ak_gradientUnits=ak_tmp_gradientUnits
if(ak_tmp_gradientUnits=="userSpaceOnUse")
{
var ak_tmp_linksoben_x=0
var ak_tmp_linksoben_y=0
var ak_tmp_width=isNaN
var ak_tmp_height=isNaN
var ak_tmp_svg_box=ak_object2update
while(ak_tmp_svg_box)
{
try
{
if(ak_tmp_svg_box.tagName()=="svg")
{
if(isNaN(ak_tmp_width)) ak_tmp_width=parseFloat(ak_tmp_svg_box.getAttribute("width"))
if(isNaN(ak_tmp_height)) ak_tmp_height=parseFloat(ak_tmp_svg_box.getAttribute("height"))
if(!isNaN(ak_tmp_width) && !isNaN(ak_tmp_height)) break
}
}
catch(error){break}
ak_tmp_svg_box=ak_tmp_svg_box.parentNode
}
if(isNaN(ak_tmp_width)) ak_tmp_width=window.innerWidth
if(isNaN(ak_tmp_height)) ak_tmp_height=window.innerHeight
}
else
{
var ak_tmp_linksoben_x=ak_objEdit.getBBox.x
var ak_tmp_linksoben_y=ak_objEdit.getBBox.y
var ak_tmp_width=ak_objEdit.getBBox.width
var ak_tmp_height=ak_objEdit.getBBox.height
}
var ak_tmp_flag=false
var ak_tmp_gradientTransform
var ak_tmp_gradient_href=ak_tmp_gradient
var ak_tmp_array=new Array
while(!ak_tmp_flag)
{
try
{
ak_tmp_gradientTransform=ak_tmp_gradient_href.getAttribute("gradientTransform").replace(/^ +| +$/g,"")
ak_tmp_gradient_href.removeAttribute("gradientTransform")
ak_tmp_gradient_href.setAttribute("gradientTransform",ak_tmp_gradientTransform)
ak_tmp_flag=true
}
catch(error)
{
try{ak_tmp_array.push(ak_tmp_gradient_href.getAttribute("xlink:href").replace(/^( *#)| +$/g,""))}
catch(error){break}
if(ak_tmp_array[ak_tmp_array.length-1]==ak_tmp_gradient.getId()) break
for(var i=0;i<(ak_tmp_array.length-1);i++)
{
if(ak_tmp_array[i]==ak_tmp_array[ak_tmp_array.length-1]) ak_tmp_flag=true
}
if(ak_tmp_flag) break
ak_tmp_gradient_href=document.getElementById(ak_tmp_array[ak_tmp_array.length-1])
}
}
if(ak_tmp_gradient.tagName()=="linearGradient") // dann x1 y1 x2 y2
{
var ak_tmp_x1=ak_check_on_href(evt,ak_tmp_gradient,"x1")
var ak_tmp_y1=ak_check_on_href(evt,ak_tmp_gradient,"y1")
var ak_tmp_x2=ak_check_on_href(evt,ak_tmp_gradient,"x2")
var ak_tmp_y2=ak_check_on_href(evt,ak_tmp_gradient,"y2")
ak_tmp_x1=ak_get_gradient_xy(evt,ak_tmp_x1,0,ak_tmp_linksoben_x,ak_tmp_width,ak_tmp_gradientUnits)
ak_tmp_y1=ak_get_gradient_xy(evt,ak_tmp_y1,0,ak_tmp_linksoben_y,ak_tmp_height,ak_tmp_gradientUnits)
ak_tmp_x2=ak_get_gradient_xy(evt,ak_tmp_x2,1,ak_tmp_linksoben_x,ak_tmp_width,ak_tmp_gradientUnits)
ak_tmp_y2=ak_get_gradient_xy(evt,ak_tmp_y2,0,ak_tmp_linksoben_y,ak_tmp_height,ak_tmp_gradientUnits)
var ak_tmp_fx=ak_tmp_x1
var ak_tmp_fy=ak_tmp_y1
}
else // radialGradient
{
var ak_tmp_cx=ak_check_on_href(evt,ak_tmp_gradient,"cx")
var ak_tmp_cy=ak_check_on_href(evt,ak_tmp_gradient,"cy")
var ak_tmp_r=ak_check_on_href(evt,ak_tmp_gradient,"r")
var ak_tmp_fx=ak_check_on_href(evt,ak_tmp_gradient,"fx")
var ak_tmp_fy=ak_check_on_href(evt,ak_tmp_gradient,"fy")
ak_tmp_cx=ak_get_gradient_xy(evt,ak_tmp_cx,0.5,ak_tmp_linksoben_x,ak_tmp_width,ak_tmp_gradientUnits)
ak_tmp_cy=ak_get_gradient_xy(evt,ak_tmp_cy,0.5,ak_tmp_linksoben_y,ak_tmp_height,ak_tmp_gradientUnits)
var ak_tmp_ry=ak_tmp_r
ak_tmp_r=ak_get_gradient_xy(evt,ak_tmp_r,0.5,0,ak_tmp_width,ak_tmp_gradientUnits)
ak_tmp_ry=ak_get_gradient_xy(evt,ak_tmp_ry,0.5,0,ak_tmp_height,ak_tmp_gradientUnits)
ak_tmp_fx=ak_get_gradient_xy(evt,ak_tmp_fx,0.5,ak_tmp_linksoben_x,ak_tmp_width,ak_tmp_gradientUnits,ak_tmp_cx)
ak_tmp_fy=ak_get_gradient_xy(evt,ak_tmp_fy,0.5,ak_tmp_linksoben_y,ak_tmp_height,ak_tmp_gradientUnits,ak_tmp_cy)
if(ak_tmp_gradientUnits=="userSpaceOnUse") 
{
ak_tmp_r=(ak_tmp_r+ak_tmp_ry)/2
ak_tmp_ry=ak_tmp_r
}
var ak_tmp_x1=ak_tmp_fx
var ak_tmp_y1=ak_tmp_fy
var ak_tmp_x2=ak_tmp_cx-ak_tmp_fx
var ak_tmp_y2=ak_tmp_cy-ak_tmp_fy
var ak_tmp_2length=Math.pow((Math.pow(ak_tmp_x2,2)+Math.pow(ak_tmp_y2,2)),0.5)
if(ak_tmp_2length==0)
{
ak_tmp_x2=ak_tmp_fx+ak_tmp_r
ak_tmp_y2=ak_tmp_fy
}
else
{
var ak_tmp_angle1=Math.atan2(ak_tmp_y2,ak_tmp_x2)
var ak_tmp_angle=Math.atan(Math.tan(ak_tmp_angle1)*ak_tmp_r/ak_tmp_ry)
if(ak_tmp_angle1>(Math.PI/2) || ak_tmp_angle1<(-Math.PI/2)) ak_tmp_angle+=Math.PI
ak_tmp_x2=(Math.cos(ak_tmp_angle)*ak_tmp_r)+ak_tmp_cx
ak_tmp_y2=(Math.sin(ak_tmp_angle)*ak_tmp_ry)+ak_tmp_cy
}
if(Math.abs(ak_tmp_x2-ak_tmp_cx)<Math.abs(ak_tmp_cx-ak_tmp_x1)) ak_tmp_x1=ak_tmp_cx-1*(ak_tmp_x2-ak_tmp_cx)
if(Math.abs(ak_tmp_y2-ak_tmp_cy)<Math.abs(ak_tmp_cy-ak_tmp_y1)) ak_tmp_y1=ak_tmp_cy-1*(ak_tmp_y2-ak_tmp_cy)
}
// nun beide berechnen
ak_gradient_control_start=ak_svgroot.createSVGPoint()
ak_gradient_control_start.x=ak_tmp_fx
ak_gradient_control_start.y=ak_tmp_fy
ak_gradient_vector_start=ak_svgroot.createSVGPoint()
ak_gradient_vector_start.x=ak_tmp_x1
ak_gradient_vector_start.y=ak_tmp_y1
ak_gradient_vector=ak_svgroot.createSVGPoint()
ak_gradient_vector.x=ak_tmp_x2-ak_tmp_x1
ak_gradient_vector.y=ak_tmp_y2-ak_tmp_y1
var ak_tmp_rotate=ak_svgroot.createSVGMatrix()
ak_tmp_rotate=ak_tmp_rotate.rotate(90)
ak_gradient_vector_90=ak_svgroot.createSVGPoint()
ak_gradient_vector_90=ak_gradient_vector.matrixTransform(ak_tmp_rotate)
ak_gradient_vector_90.x*=(8/ak_grid_zoom)/Math.pow((Math.pow(ak_gradient_vector.x,2)+Math.pow(ak_gradient_vector.y,2)),0.5)
ak_gradient_vector_90.y*=(8/ak_grid_zoom)/Math.pow((Math.pow(ak_gradient_vector.x,2)+Math.pow(ak_gradient_vector.y,2)),0.5)
var g_append=parseXML(("<g id='ak_gradient_control_g' style='stroke:#000;stroke-width:"+(1/ak_grid_zoom)+";fill-opacity:1'/>"),document).firstChild
ak_toolObject.replaceChild(g_append,ak_toolGradient)
ak_toolGradient=g_append
ak_gradient_matrix=ak_svgroot.createSVGMatrix()
if(ak_tmp_gradientUnits=="userSpaceOnUse")
{
g_append.setAttribute("transform",ak_tmp_gradientTransform)
ak_gradient_matrix=ak_SetGetRm_transformValue(g_append,"translate","get","get_matrix")
var ak_tmp_matrix=ak_get_overall_CTM(evt,g_append)
var ak_grid_zoom=(Math.abs(ak_tmp_matrix.a)+Math.abs(ak_tmp_matrix.b)+Math.abs(ak_tmp_matrix.c)+Math.abs(ak_tmp_matrix.d))/2
}
if(ak_tmp_gradient.tagName()=="radialGradient")
{
ak_gradient_radial_center=ak_svgroot.createSVGPoint()
ak_gradient_radial_center.x=ak_tmp_cx
ak_gradient_radial_center.y=ak_tmp_cy
ak_gradient_radial_r=ak_tmp_r
ak_gradient_radial_ry=ak_tmp_ry
var ak_tmp_elements="<circle id='ak_gradient_circle2' cx='"+ak_tmp_cx+"' cy='"+ak_tmp_cy+"' r='"+(2/ak_grid_zoom)
ak_tmp_elements+="' style='fill-opacity:0;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
var ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","gradient_control",4)'
var ak_tmp_elements="<ellipse id='ak_gradient_circle1' cx='"+ak_tmp_cx+"' cy='"+ak_tmp_cy+"' rx='"+ak_tmp_r+"' ry='"+ak_tmp_ry
ak_tmp_elements+="' style='shape-rendering:optimizeSpeed;fill:#ddd;fill-opacity:0;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
}
if(ak_tmp_gradient.tagName()=="linearGradient") var ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","gradient_control",0)'
else var ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","gradient_control",2)'
var ak_tmp_elements="<circle id='ak_gradient_rect1' cx='"+ak_tmp_fx+"' cy='"+ak_tmp_fy+"' r='"+(13/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#aaa;stroke:#333;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
if(ak_tmp_gradient.tagName()=="linearGradient") ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","gradient_control",1)'
else ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","gradient_control",3)'
ak_tmp_elements="<circle id='ak_gradient_rect2' cx='"+ak_tmp_x2+"' cy='"+ak_tmp_y2+"' r='"+(13/ak_grid_zoom)
ak_tmp_elements+="' style='fill:#666;stroke:#ddd;stroke-width:"+(2/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
var ak_tmp_elements="<line id='ak_gradient_line1' x1='"+ak_tmp_fx+"' y1='"+ak_tmp_fy+"' x2='"+ak_tmp_x2+"' y2='"+ak_tmp_y2+"' style='shape-rendering:optimizeSpeed;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
var ak_tmp_begin=0
var ak_tmp_last_stop=-1
var ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","gradient_add",'
var ak_tmp_line_color="#fff"
if(ak_tmp_gradientTransform!="") ak_tmp_line_color="#ff006a"
for(var i=0;i<ak_gradient_stop.length;i++)
{
if(ak_gradient_stop[i])
{
ak_tmp_elements="<line x1='"+((ak_gradient_vector.x*ak_tmp_begin)+ak_gradient_vector_start.x)+"' y1='"+((ak_gradient_vector.y*ak_tmp_begin)+ak_gradient_vector_start.y)+"' x2='"+((ak_gradient_vector.x*ak_stop_offset[i])+ak_gradient_vector_start.x)+"' y2='"+((ak_gradient_vector.y*ak_stop_offset[i])+ak_gradient_vector_start.y)
ak_tmp_elements+="' style='shape-rendering:optimizeSpeed;stroke:"+ak_tmp_line_color+";opacity:0.75;stroke-width:"+(4/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+i+")'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_tmp_begin=ak_stop_offset[i]
ak_tmp_last_stop=i
}
}
if(ak_tmp_begin<1)
{
ak_previous_stop[ak_tmp_last_stop+1]=ak_tmp_prev_stop
ak_stop_min[ak_tmp_last_stop+1]=ak_tmp_begin
ak_stop_color[ak_tmp_last_stop+1]=ak_tmp_color
ak_previous_color[ak_tmp_last_stop+1]=ak_tmp_color
ak_stop_opacity[ak_tmp_last_stop+1]=ak_tmp_opacity
ak_previous_opacity[ak_tmp_last_stop+1]=ak_tmp_opacity
ak_tmp_elements="<line x1='"+((ak_gradient_vector.x*ak_tmp_begin)+ak_gradient_vector_start.x)+"' y1='"+((ak_gradient_vector.y*ak_tmp_begin)+ak_gradient_vector_start.y)+"' x2='"+((ak_gradient_vector.x*1)+ak_gradient_vector_start.x)+"' y2='"+((ak_gradient_vector.y*1)+ak_gradient_vector_start.y)
ak_tmp_elements+="' style='shape-rendering:optimizeSpeed;stroke:"+ak_tmp_line_color+";opacity:0.75;stroke-width:"+(4/ak_grid_zoom)+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+(ak_tmp_last_stop+1)+")'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
}
if(ak_gradient_stop_index==-1)
{
ak_tmp_elements="<line id='ak_gradient_line2' x1='"+ak_tmp_x1+"' y1='"+ak_tmp_y1+"' x2='"+ak_tmp_x1+"' y2='"+ak_tmp_y1+"' style='shape-rendering:optimizeSpeed;stroke:#fff;stroke-width:"+(1/ak_grid_zoom)+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
}
else
{
var ak_tmp_ox=(ak_stop_offset[ak_gradient_stop_index]*ak_gradient_vector.x)+ak_gradient_vector_start.x
var ak_tmp_oy=(ak_stop_offset[ak_gradient_stop_index]*ak_gradient_vector.y)+ak_gradient_vector_start.y
ak_tmp_elements="<line id='ak_gradient_line2' x1='"+(ak_tmp_ox+ak_gradient_vector_90.x)+"' y1='"+(ak_tmp_oy+ak_gradient_vector_90.y)+"' x2='"+(ak_tmp_ox-ak_gradient_vector_90.x)+"' y2='"+(ak_tmp_oy-ak_gradient_vector_90.y)+"' style='shape-rendering:optimizeSpeed;stroke:#ff0;stroke-width:"+(2/ak_grid_zoom)+"'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
ak_set_hex2hue(evt,ak_stop_color[ak_gradient_stop_index],"set_stop_hex")
}
ak_tmp_onmousedown='ak_MoveEditRect(evt,"down","gradient_stop",'
for(var i=ak_gradient_stop.length-1;i>=0;i--) //<
{
if(ak_gradient_stop[i])
{
ak_tmp_elements="<circle id='ak_gradient_circle_"+i+"' cx='"+((ak_gradient_vector.x*ak_stop_offset[i])+ak_gradient_vector_start.x)+"' cy='"+((ak_gradient_vector.y*ak_stop_offset[i])+ak_gradient_vector_start.y)+"' r='"+(4/ak_grid_zoom)+"'"
ak_tmp_elements+=" style='stroke:#000;fill:"+ak_stop_color[i]+"'"
ak_tmp_elements+=" onmousedown='"+ak_tmp_onmousedown+i+")'/>"
g_append.appendChild(parseXML(ak_tmp_elements,document).firstChild)
}
}
if(ak_gradient_stop[ak_tmp_last_stop+1]!=undefined) ak_gradient_stop[ak_tmp_last_stop+1]=ak_gradient2edit.childNodes.item(ak_tmp_last_stop+1)
ak_last_stop[ak_tmp_last_stop+1]=true
if(ak_tmp_last_stop==-1) ak_gradient_stop_index=-1
else
{
ak_init_slider(evt,ak_stop_slider_nr)
}
}
// #################################
function ak_check_on_href(evt,ak_tmp_object,which_attribute)
{
var ak_tmp_array=new Array
var ak_tmp_value=ak_tmp_object.getAttribute(which_attribute)
var ak_tmp_flag=false
while(ak_tmp_value=="")
{
try
{
ak_tmp_array.push(ak_tmp_object.getAttribute("xlink:href").replace(/^( *#)| +$/g,""))
if(ak_tmp_array[ak_tmp_array.length-1]==ak_tmp_object.getId()) break
for(var i=0;i<(ak_tmp_array.length-1);i++)
{
if(ak_tmp_array[i]==ak_tmp_array[ak_tmp_array.length-1]) ak_tmp_flag=true
}
if(ak_tmp_flag) break
ak_tmp_object=document.getElementById(ak_tmp_array[ak_tmp_array.length-1])
ak_tmp_value=ak_tmp_object.getAttribute(which_attribute)
}
catch(error) {break}
}
return ak_tmp_value
}
// #################################
function ak_get_gradient_xy(evt,wert,default_wert,x_y,width_height,gradientUnits,isNaN_wert)
{
if(wert==undefined) return ((default_wert*width_height)+x_y)
wert=wert.replace(/^ +| +$/g,"")
var ak_tmp_val=parseFloat(wert)
if(isNaN(ak_tmp_val) && !isNaN(isNaN_wert)) wert=isNaN_wert
else if(isNaN(ak_tmp_val)) wert=(default_wert*width_height)+x_y
else if(gradientUnits=="objectBoundingBox" && /[^0-9%]$/.test(wert)) wert=(default_wert*width_height)+x_y
else if(/%$/.test(wert)) wert=(ak_tmp_val*width_height/100)+x_y
else if(/(pt)$/.test(wert)) wert=(ak_tmp_val*ak_pt_factor)+x_y
else if(/(pc)$/.test(wert)) wert=(ak_tmp_val*ak_pc_factor)+x_y
else if(/(em)$/.test(wert)) wert=(ak_tmp_val*ak_em_factor)+x_y
else if(/(ex)$/.test(wert)) wert=(ak_tmp_val*ak_ex_factor)+x_y
else if(/(in)$/.test(wert)) wert=(ak_tmp_val*ak_screen_res)+x_y
else if(/(mm)$/.test(wert)) wert=(ak_tmp_val*ak_screen_res/25.4)+x_y
else if(/(cm)$/.test(wert)) wert=(ak_tmp_val*ak_screen_res/2.54)+x_y
else if(gradientUnits!="userSpaceOnUse") wert=(ak_tmp_val*width_height)+x_y
else wert=ak_tmp_val+x_y
return wert
}
// ############################
function ak_MoveEditFilter(evt,mouse_flag,action,point_nr)
{
var ak_tmp_precision=100 // 10 = 1 zehntel genau
var ak_tmp_delta=ak_svgroot.createSVGPoint()
ak_tmp_delta.x=ak_point_2.x-ak_EditPoint.x
ak_tmp_delta.y=ak_point_2.y-ak_EditPoint.y
var ak_tmp_corner=ak_svgroot.createSVGPoint()
switch(action)
{
case "filter_xy":
ak_tmp_corner.x=ak_gradient_vector_start.x+ak_tmp_delta.x
ak_tmp_corner.y=ak_gradient_vector_start.y+ak_tmp_delta.y
var ak_tmp_x=ak_round(ak_tmp_corner.x,ak_tmp_precision)
var ak_tmp_y=ak_round(ak_tmp_corner.y,ak_tmp_precision)
if(ak_patternUnits=="userSpaceOnUse"){ak_setAttributeList(ak_pattern2edit,'x',ak_tmp_x,'y',ak_tmp_y)}
else
{
var ak_tmp_x1_percent=ak_round(((ak_tmp_corner.x-ak_EditPoint_BBox.x)*100)/ak_EditPoint_Size.x,10)+"%"
var ak_tmp_y1_percent=ak_round(((ak_tmp_corner.y-ak_EditPoint_BBox.y)*100)/ak_EditPoint_Size.y,10)+"%"
ak_setAttributeList(ak_pattern2edit,'x',ak_tmp_x1_percent,'y',ak_tmp_y1_percent)
}
ak_setAttributeList(document.getElementById("ak_gradient_line1"),'x',ak_gradient_vector_start.x+(ak_point_2.x-ak_EditPoint.x),'y',ak_gradient_vector_start.y+(ak_point_2.y-ak_EditPoint.y))
ak_tagName_cout=ak_gradientName_start+ak_getAttributeCout(ak_pattern2edit,'x','y','width','height')
break
case "filter_wh":
ak_tmp_corner.x=ak_gradient_vector.x+(ak_point_2.x-ak_EditPoint.x)
ak_tmp_corner.y=ak_gradient_vector.y+(ak_point_2.y-ak_EditPoint.y)
ak_tmp_corner.x=ak_tmp_corner.x<0?0:ak_tmp_corner.x
ak_tmp_corner.y=ak_tmp_corner.y<0?0:ak_tmp_corner.y
if(ak_tmp_corner.x==0 && ak_tmp_corner.y==0){ak_removeAttributeList(ak_pattern2edit,"width","height")}
else if(ak_patternUnits=="userSpaceOnUse")
{
ak_setAttributeList(ak_pattern2edit,'width',ak_round(ak_tmp_corner.x,ak_tmp_precision),'height',ak_round(ak_tmp_corner.y,ak_tmp_precision))
}
else
{
var ak_tmp_x1_percent=ak_round((ak_tmp_corner.x*100)/ak_EditPoint_Size.x,10)+"%"
var ak_tmp_y1_percent=ak_round((ak_tmp_corner.y*100)/ak_EditPoint_Size.y,10)+"%"
ak_setAttributeList(ak_pattern2edit,'width',ak_tmp_x1_percent,'height',ak_tmp_y1_percent)
}
ak_setAttributeList(document.getElementById("ak_gradient_line1"),'width',ak_tmp_corner.x,'height',ak_tmp_corner.y)
ak_tagName_cout=ak_gradientName_start+ak_getAttributeCout(ak_pattern2edit,'x','y','width','height')
break
case "filter_feSaturate":
var ak_tmp_y=ak_round(((ak_feSaturate*ak_objEdit.getBBox.height)+ak_tmp_delta.y)/ak_objEdit.getBBox.height,ak_tmp_precision)
ak_tmp_y=ak_tmp_y<0?0:ak_tmp_y
ak_tmp_y=ak_tmp_y>1?1:ak_tmp_y
ak_setAttributeList(ak_fe2edit,'values',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','type','values')
break
case "filter_feRotate":
var ak_tmp_x=ak_feRotate.x+ak_tmp_delta.x
var ak_tmp_y=ak_feRotate.y+ak_tmp_delta.y
var ak_tmp_angle=ak_round(Math.atan2(ak_tmp_y,ak_tmp_x)*180/Math.PI,10)
while(ak_tmp_angle<0){ak_tmp_angle+=360}
ak_setAttributeList(ak_fe2edit,'values',ak_tmp_angle)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','type','values')
break
case "filter_feIntercept":
var ak_tmp_y=ak_round(((ak_feSaturate*ak_objEdit.getBBox.height)+ak_tmp_delta.y)/ak_objEdit.getBBox.height,ak_tmp_precision)
ak_tmp_y=ak_tmp_y<0?0:ak_tmp_y
ak_tmp_y=ak_tmp_y>1?1:ak_tmp_y
ak_setAttributeList(ak_fe2edit,'intercept',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'type','slope','intercept')
break
case "filter_feSlope":
var ak_tmp_y=ak_round((((ak_feSlope*ak_objEdit.getBBox.height)+(ak_tmp_delta.y*10)))/ak_objEdit.getBBox.height,ak_tmp_precision)
ak_setAttributeList(ak_fe2edit,'slope',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'type','slope','intercept')
break
case "filter_feGammaOffset":
var ak_tmp_y=ak_round(((ak_feSaturate*ak_objEdit.getBBox.height)+ak_tmp_delta.y)/ak_objEdit.getBBox.height,ak_tmp_precision)
ak_setAttributeList(ak_fe2edit,'offset',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'type','amplitude','exponent','offset')
break
case "filter_feExponent":
var ak_tmp_y=ak_round((((ak_feSlope*ak_objEdit.getBBox.height)+(ak_tmp_delta.y)))/ak_objEdit.getBBox.height,ak_tmp_precision)
ak_tmp_y=ak_tmp_y<0?0:ak_tmp_y
ak_setAttributeList(ak_fe2edit,'exponent',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'type','amplitude','exponent','offset')
break
case "filter_feAmplitude":
var ak_tmp_y=ak_round((((ak_feAmplitude*ak_objEdit.getBBox.height)+(ak_tmp_delta.y*10)))/ak_objEdit.getBBox.height,ak_tmp_precision)
ak_setAttributeList(ak_fe2edit,'amplitude',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'type','amplitude','exponent','offset')
break
case "filter_fek1":
var ak_tmp_y=ak_round(((ak_feOffsetX*ak_objEdit.getBBox.height)+ak_tmp_delta.y)/ak_objEdit.getBBox.height,ak_tmp_precision)
ak_setAttributeList(ak_fe2edit,'k1',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','operator','k1','k2','k3','k4')
break
case "filter_fek2":
var ak_tmp_y=ak_round(((ak_feAmplitude*ak_objEdit.getBBox.height)+ak_tmp_delta.y)/ak_objEdit.getBBox.height,ak_tmp_precision)
ak_setAttributeList(ak_fe2edit,'k2',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','operator','k1','k2','k3','k4')
break
case "filter_fek3":
var ak_tmp_y=ak_round(((ak_feSlope*ak_objEdit.getBBox.height)+ak_tmp_delta.y)/ak_objEdit.getBBox.height,ak_tmp_precision)
ak_setAttributeList(ak_fe2edit,'k3',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','operator','k1','k2','k3','k4')
break
case "filter_fek4":
var ak_tmp_y=ak_round(((ak_feSaturate*ak_objEdit.getBBox.height)+ak_tmp_delta.y)/ak_objEdit.getBBox.height,ak_tmp_precision)
ak_setAttributeList(ak_fe2edit,'k4',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','operator','k1','k2','k3','k4')
break
case "filter_feTarget":
var ak_tmp_x=ak_round(ak_feOffsetX+ak_tmp_delta.x,ak_tmp_precision)
var ak_tmp_y=ak_round(ak_feOffsetY+ak_tmp_delta.y,ak_tmp_precision)
ak_tmp_x=ak_tmp_x>ak_feOrderX-1?ak_feOrderX-1:ak_tmp_x
ak_tmp_x=ak_tmp_x<0?0:ak_tmp_x
ak_tmp_y=ak_tmp_y>ak_feOrderY-1?ak_feOrderY-1:ak_tmp_y
ak_tmp_y=ak_tmp_y<0?0:ak_tmp_y
ak_setAttributeList(ak_fe2edit,'targetX',ak_tmp_x,'targetY',ak_tmp_y)
ak_tagName_cout=ak_getAttributeCout("<"+ak_fe2edit.tagName,ak_fe2edit,'result','divisor','bias','targetX','targetY','order','kernelMatrix')
break
case "filter_feDivisor":
var ak_tmp_y=ak_round(((ak_feAmplitude*ak_objEdit.getBBox.height)+ak_tmp_delta.y)*ak_feSaturate/ak_objEdit.getBBox.height,ak_tmp_precision)
ak_setAttributeList(ak_fe2edit,'divisor',ak_tmp_y)
ak_tagName_cout=ak_getAttributeCout("<"+ak_fe2edit.tagName,ak_fe2edit,'result','divisor','bias','targetX','targetY','order','kernelMatrix')
break
case "filter_feBias":
var ak_tmp_y=ak_round(((ak_feSlope*ak_objEdit.getBBox.height)+ak_tmp_delta.y)/ak_objEdit.getBBox.height,ak_tmp_precision)
ak_setAttributeList(ak_fe2edit,'bias',ak_tmp_y)
ak_tagName_cout=ak_getAttributeCout("<"+ak_fe2edit.tagName,ak_fe2edit,'result','divisor','bias','targetX','targetY','order','kernelMatrix')
break
case "filter_feScale":
var ak_tmp_y=ak_round((((ak_feAmplitude*ak_objEdit.getBBox.height)+(ak_tmp_delta.y*10)))/ak_objEdit.getBBox.height,ak_tmp_precision)
ak_setAttributeList(ak_fe2edit,'scale',ak_tmp_y)
ak_tagName_cout=ak_getAttributeCout("<"+ak_fe2edit.tagName,ak_fe2edit,'result','scale','xChannelSelector','yChannelSelector')
break
case "filter_feGaussianBlurFine":
var ak_tmp_x=ak_round(ak_feOffsetX+(ak_tmp_delta.x/10),ak_tmp_precision)
var ak_tmp_y=ak_round(ak_feOffsetY+(ak_tmp_delta.y/10),ak_tmp_precision)
case "filter_feGaussianBlur":
if(action=="filter_feGaussianBlur")
{
var ak_tmp_x=ak_round(ak_feOffsetX+ak_tmp_delta.x,ak_tmp_precision)
var ak_tmp_y=ak_round(ak_feOffsetY+ak_tmp_delta.y,ak_tmp_precision)
}
ak_tmp_x=ak_tmp_x<0?0:ak_tmp_x
ak_tmp_y=ak_tmp_y<0?0:ak_tmp_y
if(ak_primitiveUnits=="userSpaceOnUse"){ak_setAttributeList(ak_fe2edit,'stdDeviation',ak_tmp_x+' '+ak_tmp_y)}
else
{
ak_setAttributeList(ak_fe2edit,'stdDeviation',ak_round(ak_tmp_x/ak_objEdit.getBBox.width,ak_tmp_precision)+' '+ak_round(ak_tmp_y/ak_objEdit.getBBox.height,ak_tmp_precision))
}
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','stdDeviation')
break
case "filter_feRadius":
var ak_tmp_x=ak_round(ak_feOffsetX+(ak_tmp_delta.x/10),ak_tmp_precision)
var ak_tmp_y=ak_round(ak_feOffsetY+(ak_tmp_delta.y/10),ak_tmp_precision)
ak_tmp_x=ak_tmp_x<0?0:ak_tmp_x
ak_tmp_y=ak_tmp_y<0?0:ak_tmp_y
if(ak_primitiveUnits=="userSpaceOnUse"){ak_setAttributeList(ak_fe2edit,'radius',ak_tmp_x+' '+ak_tmp_y)}
else
{
ak_setAttributeList(ak_fe2edit,'radius',ak_round(ak_tmp_x/ak_objEdit.getBBox.width,10000)+' '+ak_round(ak_tmp_y/ak_objEdit.getBBox.height,10000))
}
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','operator','radius')
break
case "filter_feOffset":
var ak_tmp_x=ak_round(ak_feOffsetX+ak_tmp_delta.x,ak_tmp_precision)
var ak_tmp_y=ak_round(ak_feOffsetY+ak_tmp_delta.y,ak_tmp_precision)
if(ak_primitiveUnits=="userSpaceOnUse"){ak_setAttributeList(ak_fe2edit,'dx',ak_tmp_x,'dy',ak_tmp_y)}
else
{
ak_setAttributeList(ak_fe2edit,'dx',ak_round(ak_tmp_x/ak_objEdit.getBBox.width,ak_tmp_precision),'dy',ak_round(ak_tmp_y/ak_objEdit.getBBox.height,ak_tmp_precision))
}
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','dx','dy')
break
case "filter_feTileXY":
var ak_tmp_x=ak_round(ak_feOffsetX+ak_tmp_delta.x,ak_tmp_precision)
var ak_tmp_y=ak_round(ak_feOffsetY+ak_tmp_delta.y,ak_tmp_precision)
if(ak_patternUnits=="userSpaceOnUse"){ak_setAttributeList(ak_fe2edit,'x',ak_tmp_x,'y',ak_tmp_y)}
else
{
var ak_tmp_x1_percent=ak_round(((ak_feOffsetX+ak_tmp_delta.x-ak_gradient_vector_start.x)*100)/ak_gradient_vector.x,10)+"%"
var ak_tmp_y1_percent=ak_round(((ak_feOffsetY+ak_tmp_delta.y-ak_gradient_vector_start.y)*100)/ak_gradient_vector.y,10)+"%"
ak_setAttributeList(ak_fe2edit,'x',ak_tmp_x1_percent,'y',ak_tmp_y1_percent)
}
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','x','y','width','height')
break
case "filter_feTileWH":
var ak_tmp_x=ak_round(ak_feOrderX+ak_tmp_delta.x,ak_tmp_precision)
var ak_tmp_y=ak_round(ak_feOrderY+ak_tmp_delta.y,ak_tmp_precision)
ak_tmp_x=ak_tmp_x<0?0:ak_tmp_x
ak_tmp_y=ak_tmp_y<0?0:ak_tmp_y
if(ak_patternUnits=="userSpaceOnUse"){ak_setAttributeList(ak_fe2edit,'width',ak_tmp_x,'height',ak_tmp_y)}
else
{
var ak_tmp_x1_percent=ak_round(((ak_feOrderX+ak_tmp_delta.x)*100)/ak_gradient_vector.x,10)+"%"
var ak_tmp_y1_percent=ak_round(((ak_feOrderY+ak_tmp_delta.y)*100)/ak_gradient_vector.y,10)+"%"
ak_setAttributeList(ak_fe2edit,'width',ak_tmp_x1_percent,'height',ak_tmp_y1_percent)
}
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','x','y','width','height')
break
case "filter_feBaseFrequency":
var ak_tmp_x=((ak_feOffsetX*ak_objEdit.getBBox.width)+ak_tmp_delta.x)/ak_objEdit.getBBox.width
var ak_tmp_y=((ak_feOffsetY*ak_objEdit.getBBox.height)+ak_tmp_delta.y)/ak_objEdit.getBBox.height
ak_tmp_x=ak_tmp_x<0?0:ak_tmp_x
ak_tmp_y=ak_tmp_y<0?0:ak_tmp_y
ak_tmp_x=ak_round(Math.pow(ak_tmp_x,3),10000); ak_tmp_y=ak_round(Math.pow(ak_tmp_y,3),10000)
ak_setAttributeList(ak_fe2edit,'baseFrequency',ak_tmp_x+' '+ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','seed','numOctaves','baseFrequency','type','stitchTiles')
break
case "filter_feNumOctaves":
var ak_tmp_y=ak_round((((ak_feSlope*ak_objEdit.getBBox.height)+(ak_tmp_delta.y*10)))/ak_objEdit.getBBox.height,1)
ak_tmp_y=ak_tmp_y<0?0:ak_tmp_y
ak_setAttributeList(ak_fe2edit,'numOctaves',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','seed','numOctaves','baseFrequency','type','stitchTiles')
break
case "filter_feSeed":
var ak_tmp_y=Math.round(ak_feAmplitude+ak_tmp_delta.y)
ak_setAttributeList(ak_fe2edit,'seed',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','seed','numOctaves','baseFrequency','type','stitchTiles')
break
case "filter_fesurfaceScale":
var ak_tmp_y=ak_round((((ak_feAmplitude*ak_objEdit.getBBox.height)+(ak_tmp_delta.y*10)))/ak_objEdit.getBBox.height,100)
ak_setAttributeList(ak_fe2edit,'surfaceScale',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','diffuseConstant','surfaceScale','style')
break
case "filter_fediffuseConstant":
var ak_tmp_y=ak_round((((ak_feConstant*ak_objEdit.getBBox.height)+(ak_tmp_delta.y*10)))/ak_objEdit.getBBox.height,100)
ak_tmp_y=ak_tmp_y<0?0:ak_tmp_y
ak_setAttributeList(ak_fe2edit,'diffuseConstant',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','diffuseConstant','surfaceScale','style')
break
case "filter_fesurfaceScaleP":
var ak_tmp_y=ak_round((((ak_feScale*ak_objEdit.getBBox.height)+(ak_tmp_delta.y*10)))/ak_objEdit.getBBox.height,100)
ak_setAttributeList(ak_fe2edit.parentNode,'surfaceScale',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.parentNode.tagName+ak_getAttributeCout(ak_fe2edit.parentNode,'result','diffuseConstant','surfaceScale','style')
break
case "filter_fediffuseConstantP":
var ak_tmp_y=ak_round((((ak_feConstant*ak_objEdit.getBBox.height)+(ak_tmp_delta.y*10)))/ak_objEdit.getBBox.height,100)
ak_tmp_y=ak_tmp_y<0?0:ak_tmp_y
ak_setAttributeList(ak_fe2edit.parentNode,'diffuseConstant',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.parentNode.tagName+ak_getAttributeCout(ak_fe2edit.parentNode,'result','diffuseConstant','surfaceScale','style')
break
case "filter_feSpecSurfaceScale":
var ak_tmp_y=ak_round((((ak_feAmplitude*ak_objEdit.getBBox.height)+(ak_tmp_delta.y*10)))/ak_objEdit.getBBox.height,100)
ak_setAttributeList(ak_fe2edit,'surfaceScale',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','specularExponent','specularConstant','surfaceScale','style')
break
case "filter_fespecularConstant":
var ak_tmp_y=ak_round((((ak_feSaturate*ak_objEdit.getBBox.height)+(ak_tmp_delta.y*10)))/ak_objEdit.getBBox.height,100)
ak_tmp_y=ak_tmp_y<0?0:ak_tmp_y
ak_setAttributeList(ak_fe2edit,'specularConstant',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','specularExponent','specularConstant','surfaceScale','style')
break
case "filter_fespecularExponent":
var ak_tmp_y=ak_round((((ak_feSlope*ak_objEdit.getBBox.height)+(ak_tmp_delta.y*10)))/ak_objEdit.getBBox.height,100)
ak_tmp_y=ak_tmp_y<0?0:ak_tmp_y
ak_setAttributeList(ak_fe2edit,'specularExponent',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'result','specularExponent','specularConstant','surfaceScale','style')
break
case "filter_feSpecSurfaceScaleP":
var ak_tmp_y=ak_round((((ak_feScale*ak_objEdit.getBBox.height)+(ak_tmp_delta.y*10)))/ak_objEdit.getBBox.height,100)
ak_setAttributeList(ak_fe2edit.parentNode,'surfaceScale',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.parentNode.tagName+ak_getAttributeCout(ak_fe2edit.parentNode,'result','specularExponent','specularConstant','surfaceScale','style')
break
case "filter_fespecularConstantP":
var ak_tmp_y=ak_round((((ak_feConstant*ak_objEdit.getBBox.height)+(ak_tmp_delta.y*10)))/ak_objEdit.getBBox.height,100)
ak_tmp_y=ak_tmp_y<0?0:ak_tmp_y
ak_setAttributeList(ak_fe2edit.parentNode,'specularConstant',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.parentNode.tagName+ak_getAttributeCout(ak_fe2edit.parentNode,'result','specularExponent','specularConstant','surfaceScale','style')
break
case "filter_fespecularExponentP":
var ak_tmp_y=ak_round((((ak_feExponent*ak_objEdit.getBBox.height)+(ak_tmp_delta.y*10)))/ak_objEdit.getBBox.height,100)
ak_tmp_y=ak_tmp_y<0?0:ak_tmp_y
ak_setAttributeList(ak_fe2edit.parentNode,'specularExponent',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.parentNode.tagName+ak_getAttributeCout(ak_fe2edit.parentNode,'result','specularExponent','specularConstant','surfaceScale','style')
break
case "filter_feAzimuth":
var ak_tmp_x=ak_feRotate.x+ak_tmp_delta.x
var ak_tmp_y=ak_feRotate.y+ak_tmp_delta.y
var ak_tmp_angle=ak_round(Math.atan2(ak_tmp_y,ak_tmp_x)*180/Math.PI,10)
while(ak_tmp_angle<0){ak_tmp_angle+=360}
ak_setAttributeList(ak_fe2edit,'azimuth',ak_tmp_angle)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'elevation','azimuth')
break
case "filter_feElevation":
ak_tmp_corner.x=ak_feRotate2.x+ak_tmp_delta.x
ak_tmp_corner.y=ak_feRotate2.y+ak_tmp_delta.y
var ak_tmp_matrix=ak_svgroot.createSVGMatrix()
ak_tmp_matrix=ak_tmp_matrix.rotate(-ak_feSaturate)
ak_tmp_corner=ak_tmp_corner.matrixTransform(ak_tmp_matrix)
var ak_tmp_angle=ak_round(-90*((ak_tmp_corner.x/ak_feOffsetX)-1),10)
ak_tmp_angle=ak_tmp_angle<-90?-90:ak_tmp_angle
ak_tmp_angle=ak_tmp_angle>270?270:ak_tmp_angle
ak_setAttributeList(ak_fe2edit,'elevation',ak_tmp_angle)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'elevation','azimuth')
break
case "filter_fePointAtXY":
var ak_tmp_x=ak_round(ak_feOrderX+ak_tmp_delta.x,ak_tmp_precision)
var ak_tmp_y=ak_round(ak_feOrderY+ak_tmp_delta.y,ak_tmp_precision)
ak_setAttributeList(ak_fe2edit,'pointsAtX',ak_tmp_x,'pointsAtY',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'x','y','z','pointsAtX','pointsAtY','pointsAtZ')
if(ak_key_status[17]=="up") break
case "filter_fePointXY":
var ak_tmp_x=ak_round(ak_feOffsetX+ak_tmp_delta.x,ak_tmp_precision)
var ak_tmp_y=ak_round(ak_feOffsetY+ak_tmp_delta.y,ak_tmp_precision)
ak_setAttributeList(ak_fe2edit,'x',ak_tmp_x,'y',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'x','y','z')
if(ak_key_status[17]=="up" || ak_fe2edit.tagName!="feSpotLight") break
var ak_tmp_x=ak_round(ak_feOrderX+ak_tmp_delta.x,ak_tmp_precision)
var ak_tmp_y=ak_round(ak_feOrderY+ak_tmp_delta.y,ak_tmp_precision)
ak_setAttributeList(ak_fe2edit,'pointsAtX',ak_tmp_x,'pointsAtY',ak_tmp_y)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'x','y','z','pointsAtX','pointsAtY','pointsAtZ')
break
case "filter_fePointZ":
var ak_tmp_z=ak_round(ak_feSaturate+ak_tmp_delta.y,ak_tmp_precision)
ak_setAttributeList(ak_fe2edit,'z',ak_tmp_z)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'x','y','z')
break
case "filter_fePointAtZ":
var ak_tmp_z=ak_round(ak_feSlope+ak_tmp_delta.y,ak_tmp_precision)
ak_setAttributeList(ak_fe2edit,'pointsAtZ',ak_tmp_z)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'x','y','z','pointsAtX','pointsAtY','pointsAtZ')
break
case "filter_feSpotExponent":
var ak_tmp_x=ak_round(ak_feAmplitude+ak_tmp_delta.x,ak_tmp_precision)
if(ak_tmp_x<0 && ak_feAmplitude>=0)
{
if(ak_tmp_x>-29) ak_tmp_x=0
else ak_tmp_x+=29
}
else if(ak_tmp_x>=0 && ak_feAmplitude<0)
{
if(ak_tmp_x<29) ak_tmp_x=0
else ak_tmp_x-=29
}
ak_setAttributeList(ak_fe2edit,'specularExponent',ak_tmp_x)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'specularExponent')
break
case "filter_feConeAngle":
var ak_tmp_x=ak_round(ak_feAngle+ak_tmp_delta.x,ak_tmp_precision)
ak_tmp_x=ak_tmp_x<0?0:ak_tmp_x
ak_tmp_x=ak_tmp_x>90?90:ak_tmp_x
ak_setAttributeList(ak_fe2edit,'limitingConeAngle',ak_tmp_x)
ak_tagName_cout="<"+ak_fe2edit.tagName+ak_getAttributeCout(ak_fe2edit,'limitingConeAngle')
break
case "filter_txKerning":
var ak_tmp_x=ak_round(ak_txKerning+(ak_tmp_delta.x/ak_kerningRes),10)
ak_SetGetRm_styleValue(ak_object2update,"letter-spacing",ak_tmp_x,"no_cout")
ak_SetGetRm_styleValue(ak_object2update,"kerning","remove","no_cout")
ak_tagName_cout="<"+ak_object2update.tagName+ak_getAttributeCout(ak_object2update,'id','style')
break
case "filter_txWordSpace":
var ak_tmp_x=ak_round(ak_txWordSpace+(ak_tmp_delta.x/ak_wordspacingRes),10)
ak_SetGetRm_styleValue(ak_object2update,"word-spacing",ak_tmp_x,"no_cout")
ak_tagName_cout="<"+ak_object2update.tagName+ak_getAttributeCout(ak_object2update,'id','style')
break
case "filter_markerWH":
var ak_tmp_x=Math.round(ak_markerWidth+ak_tmp_delta.x)
var ak_tmp_y=Math.round(ak_markerHeight+ak_tmp_delta.y)
ak_tmp_x=ak_tmp_x<3?3:ak_tmp_x
ak_tmp_y=ak_tmp_y<3?3:ak_tmp_y
ak_setAttributeList(ak_object2update,'markerWidth',ak_tmp_x,'markerHeight',ak_tmp_y)
ak_setAttributeList(document.getElementById("ak_gradient_line1"),'width',ak_tmp_x,'height',ak_tmp_y)
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'refX','refY','markerWidth','markerHeight','orient')
break
case "filter_markerXY":
var ak_tmp_x=Math.round(ak_markerX+ak_tmp_delta.x)
var ak_tmp_y=Math.round(ak_markerY+ak_tmp_delta.y)
ak_setAttributeList(ak_object2update,'refX',ak_tmp_x,'refY',ak_tmp_y)
ak_setAttributeList(document.getElementById("ak_gradient_circle1"),'cx',ak_tmp_x,'cy',ak_tmp_y)
ak_setAttributeList(document.getElementById("ak_gradient_circle2"),'x1',ak_tmp_x,'y1',ak_tmp_y,'x2',(ak_tmp_x+ak_gradient_vector.x),'y2',(ak_tmp_y+ak_gradient_vector.y))
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'refX','refY','markerWidth','markerHeight','orient')
break
case "filter_markerRotate":
var ak_tmp_x=ak_gradient_vector.x+ak_tmp_delta.x
var ak_tmp_y=ak_gradient_vector.y+ak_tmp_delta.y
var ak_tmp_angle=ak_round(Math.atan2(ak_tmp_y,ak_tmp_x)*180/Math.PI,10)
while(ak_tmp_angle<0){ak_tmp_angle+=360}
ak_setAttributeList(ak_object2update,'orient',ak_tmp_angle)
ak_setAttributeList(document.getElementById("ak_gradient_circle2"),'x2',(ak_markerX+ak_tmp_x),'y2',(ak_markerY+ak_tmp_y))
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'refX','refY','markerWidth','markerHeight','orient')
break
}
ak_cout(ak_tagName_cout)
}
var ak_kerningRes, ak_wordspacingRes
// ############################
var ak_pattern_matrix_2edit
function ak_MoveEditPattern(evt,mouse_flag,action,point_nr)
{
var ak_tmp_precision=100 // 10 = 1 zehntel genau
var ak_tmp_delta=ak_svgroot.createSVGPoint()
ak_tmp_delta.x=ak_point_2.x-ak_EditPoint.x
ak_tmp_delta.y=ak_point_2.y-ak_EditPoint.y
ak_point_2=ak_point_2.matrixTransform(ak_gradient_matrix.inverse)
var ak_tmp_EditPoint=ak_svgroot.createSVGPoint()
ak_tmp_EditPoint=ak_EditPoint
ak_EditPoint=ak_EditPoint.matrixTransform(ak_gradient_matrix.inverse)
var ak_tmp_corner=ak_svgroot.createSVGPoint()
ak_tagName_cout=ak_gradientName_start
switch(action)
{
case "pattern_xy":
ak_tmp_corner.x=ak_gradient_vector_start.x+ak_tmp_delta.x
ak_tmp_corner.y=ak_gradient_vector_start.y+ak_tmp_delta.y
ak_setAttributeList(document.getElementById("ak_gradient_line1"),"x",ak_gradient_vector_start.x+(ak_point_2.x-ak_EditPoint.x),"y",ak_gradient_vector_start.y+(ak_point_2.y-ak_EditPoint.y))
var ak_tmp_x=ak_round(ak_tmp_corner.x,ak_tmp_precision)
var ak_tmp_y=ak_round(ak_tmp_corner.y,ak_tmp_precision)
if(ak_patternUnits=="userSpaceOnUse"){ak_setAttributeList(ak_pattern2edit,"x",ak_tmp_x,"y",ak_tmp_y)}
else
{
var ak_tmp_x1_percent=ak_round(((ak_tmp_corner.x-ak_EditPoint_BBox.x)*100)/ak_EditPoint_Size.x,10)+"%"
var ak_tmp_y1_percent=ak_round(((ak_tmp_corner.y-ak_EditPoint_BBox.y)*100)/ak_EditPoint_Size.y,10)+"%"
ak_setAttributeList(ak_pattern2edit,"x",ak_tmp_x1_percent,"y",ak_tmp_y1_percent)
}
ak_tagName_cout=ak_gradientName_start+ak_getAttributeCout(ak_pattern2edit,'x','y','width','height')
break
case "pattern_wh":
ak_tmp_corner.x=ak_gradient_vector.x+(ak_point_2.x-ak_EditPoint.x)
ak_tmp_corner.y=ak_gradient_vector.y+(ak_point_2.y-ak_EditPoint.y)
if (ak_edit_which_attribute=="xy_etc") 
{
ak_tmp_corner.x=ak_tmp_corner.x<0?0:ak_tmp_corner.x
ak_tmp_corner.y=ak_tmp_corner.y<0?0:ak_tmp_corner.y
ak_setAttributeList(document.getElementById("ak_gradient_line1"),"width",ak_tmp_corner.x,"height",ak_tmp_corner.y)
if(ak_tmp_corner.x==0 && ak_tmp_corner.y==0){ak_removeAttributeList(ak_pattern2edit,"width","height")}
else if(ak_patternUnits=="userSpaceOnUse")
{
ak_setAttributeList(ak_pattern2edit,'width',ak_round(ak_tmp_corner.x,ak_tmp_precision),'height',ak_round(ak_tmp_corner.y,ak_tmp_precision))
}
else
{
var ak_tmp_x1_percent=ak_round((ak_tmp_corner.x*100)/ak_EditPoint_Size.x,10)+"%"
var ak_tmp_y1_percent=ak_round((ak_tmp_corner.y*100)/ak_EditPoint_Size.y,10)+"%"
ak_setAttributeList(ak_pattern2edit,'width',ak_tmp_x1_percent,'height',ak_tmp_y1_percent)
}
ak_tagName_cout=ak_gradientName_start+ak_getAttributeCout(ak_pattern2edit,'x','y','width','height')
}
else if(ak_key_status[17]=="up")
{
var ak_point_center=ak_svgroot.createSVGPoint()
ak_point_center.x=(ak_gradient_vector.x/2)
ak_point_center.y=(ak_gradient_vector.y/2)
var ak_point_scale=ak_svgroot.createSVGPoint()
ak_point_scale.x=(ak_tmp_corner.x-(ak_gradient_vector.x/2))/(ak_gradient_vector.x/2)
ak_point_scale.y=(ak_tmp_corner.y-(ak_gradient_vector.y/2))/(ak_gradient_vector.y/2)
if(ak_key_status[16]=="up") // dann symetrisch
{
var ak_tmp_min=Math.abs(Math.min(ak_point_scale.x,ak_point_scale.y))
if(ak_point_scale.x<0) ak_point_scale.x=-ak_tmp_min
else ak_point_scale.x=ak_tmp_min
if(ak_point_scale.y<0) ak_point_scale.y=-ak_tmp_min
else ak_point_scale.y=ak_tmp_min
}
var ak_tmp_restmatrix=ak_SetGetRm_transformValue(ak_pattern2edit,"matrix","get","get_restmatrix")
var ak_tmp_matrix_split=ak_pattern_matrix_2edit.split(",")
var ak_tmp_matrix2=ak_svgroot.createSVGMatrix()
for (var i=0;i<6;i++)
{
ak_tmp_matrix_split[i]=parseFloat(ak_tmp_matrix_split[i])
}
ak_tmp_matrix2.a=ak_tmp_matrix_split[0]
ak_tmp_matrix2.b=ak_tmp_matrix_split[1]
ak_tmp_matrix2.c=ak_tmp_matrix_split[2]
ak_tmp_matrix2.d=ak_tmp_matrix_split[3]
ak_tmp_matrix2.e=ak_tmp_matrix_split[4]
ak_tmp_matrix2.f=ak_tmp_matrix_split[5]
ak_tmp_matrix2=ak_tmp_matrix2.multiply(ak_tmp_restmatrix)
ak_tmp_matrix2=ak_tmp_matrix2.translate(ak_point_center.x,ak_point_center.y)
ak_tmp_matrix2=ak_tmp_matrix2.scaleNonUniform(ak_point_scale.x,ak_point_scale.y)
ak_tmp_matrix2=ak_tmp_matrix2.translate(-ak_point_center.x,-ak_point_center.y)
try {ak_tmp_matrix2=ak_tmp_matrix2.multiply(ak_tmp_restmatrix.inverse)}
catch (error){break} // falls scale 0 dann nicht invertable und zurueck
var ak_tmp_matrix_out=((Math.round(ak_tmp_matrix2.a*10000))/10000)+","
ak_tmp_matrix_out+=((Math.round(ak_tmp_matrix2.b*10000))/10000)+","
ak_tmp_matrix_out+=((Math.round(ak_tmp_matrix2.c*10000))/10000)+","
ak_tmp_matrix_out+=((Math.round(ak_tmp_matrix2.d*10000))/10000)+","
ak_tmp_matrix_out+=((Math.round(ak_tmp_matrix2.e*100))/100)+","
ak_tmp_matrix_out+=((Math.round(ak_tmp_matrix2.f*100))/100)
ak_SetGetRm_transformValue(ak_pattern2edit,"matrix",ak_tmp_matrix_out,"no_cout")
ak_tagName_cout=ak_gradientName_start+' patternTransform="'+ak_pattern2edit.getAttribute("patternTransform")+'"'
var ak_tmp_move="translate("+(ak_gradient_vector_start.x)+","+(ak_gradient_vector_start.y)+"),"+ak_pattern2edit.getAttribute("patternTransform")+",translate("+(-1*ak_gradient_vector_start.x)+","+(-1*ak_gradient_vector_start.y)+")"
document.getElementById("ak_gradient_control_g").setAttribute("transform",ak_tmp_move)
}
else
{
var ak_point_center=ak_svgroot.createSVGPoint()
ak_point_center.x=(ak_gradient_vector.x/2)
ak_point_center.y=(ak_gradient_vector.y/2)
var ak_tmp_rect=document.getElementById("ak_gradient_line1")
var ak_tmp_rect_CTM=ak_get_overall_CTM(evt,ak_tmp_rect)
var ak_angle_center=ak_svgroot.createSVGPoint()
ak_angle_center.x=ak_tmp_rect.getBBox.x+(ak_tmp_rect.getBBox.width/2)
ak_angle_center.y=ak_tmp_rect.getBBox.y+(ak_tmp_rect.getBBox.height/2)
ak_angle_center=ak_angle_center.matrixTransform(ak_tmp_rect_CTM)
var ak_start_angle=Math.acos((ak_PanInPointx-ak_angle_center.x)/Math.pow((Math.pow((ak_PanInPointx-ak_angle_center.x),2)+Math.pow((ak_PanInPointy-ak_angle_center.y),2)),0.5))
ak_start_angle=ak_start_angle*(180/Math.PI)
if (ak_PanInPointy>ak_angle_center.y) ak_start_angle*=-1
var ak_edit_angle=Math.acos((ak_point_2_panx-ak_angle_center.x)/Math.pow((Math.pow((ak_point_2_panx-ak_angle_center.x),2)+Math.pow((ak_point_2_pany-ak_angle_center.y),2)),0.5))
ak_edit_angle=ak_edit_angle*(180/Math.PI)
if (ak_point_2_pany>ak_angle_center.y) ak_edit_angle*=-1
ak_edit_angle-=ak_start_angle
var ak_tmp_restmatrix=ak_SetGetRm_transformValue(ak_pattern2edit,"matrix","get","get_restmatrix")
var ak_tmp_matrix_split=ak_pattern_matrix_2edit.split(",")
var ak_tmp_matrix2=ak_svgroot.createSVGMatrix()
for (var i=0;i<6;i++)
{
ak_tmp_matrix_split[i]=parseFloat(ak_tmp_matrix_split[i])
}
ak_tmp_matrix2.a=ak_tmp_matrix_split[0]
ak_tmp_matrix2.b=ak_tmp_matrix_split[1]
ak_tmp_matrix2.c=ak_tmp_matrix_split[2]
ak_tmp_matrix2.d=ak_tmp_matrix_split[3]
ak_tmp_matrix2.e=ak_tmp_matrix_split[4]
ak_tmp_matrix2.f=ak_tmp_matrix_split[5]
if((ak_tmp_matrix2.a>=0 && ak_tmp_matrix2.d>=0) || (ak_tmp_matrix2.a<0 && ak_tmp_matrix2.d<0))ak_edit_angle*=-1
ak_tmp_matrix2=ak_tmp_matrix2.multiply(ak_tmp_restmatrix)
ak_tmp_matrix2=ak_tmp_matrix2.translate(ak_point_center.x,ak_point_center.y)
ak_tmp_matrix2=ak_tmp_matrix2.rotate(ak_edit_angle)
ak_tmp_matrix2=ak_tmp_matrix2.translate(-ak_point_center.x,-ak_point_center.y)
try {ak_tmp_matrix2=ak_tmp_matrix2.multiply(ak_tmp_restmatrix.inverse)}
catch (error){break} // falls scale 0 dann nicht invertable und zurueck
var ak_tmp_matrix_out=((Math.round(ak_tmp_matrix2.a*10000))/10000)+","
ak_tmp_matrix_out+=((Math.round(ak_tmp_matrix2.b*10000))/10000)+","
ak_tmp_matrix_out+=((Math.round(ak_tmp_matrix2.c*10000))/10000)+","
ak_tmp_matrix_out+=((Math.round(ak_tmp_matrix2.d*10000))/10000)+","
ak_tmp_matrix_out+=((Math.round(ak_tmp_matrix2.e*10))/10)+","
ak_tmp_matrix_out+=((Math.round(ak_tmp_matrix2.f*10))/10)
ak_SetGetRm_transformValue(ak_pattern2edit,"matrix",ak_tmp_matrix_out,"no_cout")
ak_tagName_cout=ak_gradientName_start+' patternTransform="'+ak_pattern2edit.getAttribute("patternTransform")+'"'
var ak_tmp_move="translate("+(ak_gradient_vector_start.x)+","+(ak_gradient_vector_start.y)+"),"+ak_pattern2edit.getAttribute("patternTransform")+",translate("+(-1*ak_gradient_vector_start.x)+","+(-1*ak_gradient_vector_start.y)+")"
document.getElementById("ak_gradient_control_g").setAttribute("transform",ak_tmp_move)
}
break
}
ak_cout(ak_tagName_cout)
ak_EditPoint=ak_tmp_EditPoint
}
// ############################
function ak_MoveEditGradient(evt,mouse_flag,action,point_nr)
{
var ak_tmp_precision=100 // 10 = 1 zehntel genau
ak_point_2=ak_point_2.matrixTransform(ak_gradient_matrix.inverse)
var ak_tmp_EditPoint=ak_svgroot.createSVGPoint()
ak_tmp_EditPoint=ak_EditPoint
ak_EditPoint=ak_EditPoint.matrixTransform(ak_gradient_matrix.inverse)
var ak_tmp_no_ctrl_flag=true
if(ak_key_status[17]=="down")
{
action="gradient_control"
point_nr=point_nr<2?0:2
ak_tmp_no_ctrl_flag=false
}
if(action=="gradient_control")
{
switch(point_nr)
{
case 0: // x1 y1 linearGradient
var ak_tmp_x1=ak_round(ak_gradient_vector_start.x+(ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
var ak_tmp_y1=ak_round(ak_gradient_vector_start.y+(ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
ak_setAttributeList(document.getElementById("ak_gradient_line1"),"x1",ak_tmp_x1,"y1",ak_tmp_y1)
if(ak_gradientUnits=="userSpaceOnUse"){ak_setAttributeList(ak_gradient2edit,"x1",ak_tmp_x1,"y1",ak_tmp_y1)}
else
{
var ak_tmp_x1_percent=ak_round(((ak_tmp_x1-ak_EditPoint_BBox.x)*100)/ak_EditPoint_Size.x,10)+"%"
var ak_tmp_y1_percent=ak_round(((ak_tmp_y1-ak_EditPoint_BBox.y)*100)/ak_EditPoint_Size.y,10)+"%"
ak_setAttributeList(ak_gradient2edit,"x1",ak_tmp_x1_percent,"y1",ak_tmp_y1_percent)
}
ak_tagName_cout=ak_gradientName_start+ak_getAttributeCout(ak_gradient2edit,'x1','y1','x2','y2')
if(ak_tmp_no_ctrl_flag) break
case 1: // x2 y2 linearGradient
var ak_tmp_x1=ak_round(ak_gradient_vector_start.x+ak_gradient_vector.x+(ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
var ak_tmp_y1=ak_round(ak_gradient_vector_start.y+ak_gradient_vector.y+(ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
ak_setAttributeList(document.getElementById("ak_gradient_line1"),"x2",ak_tmp_x1,"y2",ak_tmp_y1)
if(ak_gradientUnits=="userSpaceOnUse"){ak_setAttributeList(ak_gradient2edit,"x2",ak_tmp_x1,"y2",ak_tmp_y1)}
else
{
var ak_tmp_x1_percent=ak_round(((ak_tmp_x1-ak_EditPoint_BBox.x)*100)/ak_EditPoint_Size.x,10)+"%"
var ak_tmp_y1_percent=ak_round(((ak_tmp_y1-ak_EditPoint_BBox.y)*100)/ak_EditPoint_Size.y,10)+"%"
ak_setAttributeList(ak_gradient2edit,"x2",ak_tmp_x1_percent,"y2",ak_tmp_y1_percent)
}
ak_tagName_cout=ak_gradientName_start+ak_getAttributeCout(ak_gradient2edit,'x1','y1','x2','y2')
break
case 2: // fx fy radialGradient
var ak_tmp_x1=ak_round(ak_gradient_control_start.x+(ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
var ak_tmp_y1=ak_round(ak_gradient_control_start.y+(ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
var ak_tmp_x2=ak_gradient_radial_center.x-ak_tmp_x1
var ak_tmp_y2=ak_gradient_radial_center.y-ak_tmp_y1
var ak_tmp_r=ak_gradient_radial_r
var ak_tmp_ry=ak_gradient_radial_ry
var ak_tmp_2length=Math.pow((Math.pow(ak_tmp_x2,2)+Math.pow(ak_tmp_y2,2)),0.5)
if(ak_tmp_2length==0)
{
ak_tmp_x2=ak_tmp_x1+ak_tmp_r
ak_tmp_y2=ak_tmp_y1
}
else
{
var ak_tmp_angle1=Math.atan2(ak_tmp_y2,ak_tmp_x2)
var ak_tmp_angle=Math.atan(Math.tan(ak_tmp_angle1)*ak_tmp_r/ak_tmp_ry)
if(ak_tmp_angle1>(Math.PI/2) || ak_tmp_angle1<(-Math.PI/2)) ak_tmp_angle+=Math.PI
ak_tmp_x2=(Math.cos(ak_tmp_angle)*ak_tmp_r)+ak_gradient_radial_center.x
ak_tmp_y2=(Math.sin(ak_tmp_angle)*ak_tmp_ry)+ak_gradient_radial_center.y
}
ak_setAttributeList(document.getElementById("ak_gradient_line1"),"x1",ak_tmp_x1,"y1",ak_tmp_y1,"x2",ak_tmp_x2,"y2",ak_tmp_y2)
if(ak_gradientUnits=="userSpaceOnUse"){ak_setAttributeList(ak_gradient2edit,"fx",ak_tmp_x1,"fy",ak_tmp_y1)}
else
{
var ak_tmp_x1_percent=ak_round(((ak_tmp_x1-ak_EditPoint_BBox.x)*100)/ak_EditPoint_Size.x,10)+"%"
var ak_tmp_y1_percent=ak_round(((ak_tmp_y1-ak_EditPoint_BBox.y)*100)/ak_EditPoint_Size.y,10)+"%"
ak_setAttributeList(ak_gradient2edit,"fx",ak_tmp_x1_percent,"fy",ak_tmp_y1_percent)
}
ak_tagName_cout=ak_gradientName_start+ak_getAttributeCout(ak_gradient2edit,'fx','fy','cx','cy','r')
if(ak_tmp_no_ctrl_flag) break
var ak_tmp_schon_x1=ak_tmp_x1
var ak_tmp_schon_y1=ak_tmp_y1
case 4: // cx cy radialGradient
var ak_tmp_cx=ak_gradient_radial_center.x+(ak_point_2.x-ak_EditPoint.x)
var ak_tmp_cy=ak_gradient_radial_center.y+(ak_point_2.y-ak_EditPoint.y)
var ak_tmp_r=ak_gradient_radial_r
var ak_tmp_ry=ak_gradient_radial_ry
if(ak_gradient2edit.getAttribute("fx")=="") var ak_tmp_x1=ak_tmp_cx
else var ak_tmp_x1=ak_gradient_control_start.x
if(ak_gradient2edit.getAttribute("fy")=="")  var ak_tmp_y1=ak_tmp_cy
else var ak_tmp_y1=ak_gradient_control_start.y
if(!ak_tmp_no_ctrl_flag)
{
ak_tmp_x1=ak_tmp_schon_x1
ak_tmp_y1=ak_tmp_schon_y1
}
var ak_tmp_x2=ak_tmp_cx-ak_tmp_x1
var ak_tmp_y2=ak_tmp_cy-ak_tmp_y1
var ak_tmp_2length=Math.pow((Math.pow(ak_tmp_x2,2)+Math.pow(ak_tmp_y2,2)),0.5)
if(ak_tmp_2length==0)
{
ak_tmp_x2=ak_tmp_x1+ak_tmp_r
ak_tmp_y2=ak_tmp_y1
}
else
{
var ak_tmp_angle1=Math.atan2(ak_tmp_y2,ak_tmp_x2)
var ak_tmp_angle=Math.atan(Math.tan(ak_tmp_angle1)*ak_tmp_r/ak_tmp_ry)
if(ak_tmp_angle1>(Math.PI/2) || ak_tmp_angle1<(-Math.PI/2)) ak_tmp_angle+=Math.PI
ak_tmp_x2=(Math.cos(ak_tmp_angle)*ak_tmp_r)+ak_tmp_cx
ak_tmp_y2=(Math.sin(ak_tmp_angle)*ak_tmp_ry)+ak_tmp_cy
}
ak_setAttributeList(document.getElementById("ak_gradient_circle1"),"cx",ak_tmp_cx,"cy",ak_tmp_cy)
ak_setAttributeList(document.getElementById("ak_gradient_circle2"),"cx",ak_tmp_cx,"cy",ak_tmp_cy)
ak_setAttributeList(document.getElementById("ak_gradient_line1"),"x1",ak_tmp_x1,"y1",ak_tmp_y1,"x2",ak_tmp_x2,"y2",ak_tmp_y2)
if(ak_gradientUnits=="userSpaceOnUse"){ak_setAttributeList(ak_gradient2edit,"cx",ak_tmp_cx,"cy",ak_tmp_cy)}
else
{
var ak_tmp_cx_percent=ak_round(((ak_tmp_cx-ak_EditPoint_BBox.x)*100)/ak_EditPoint_Size.x,10)+"%"
var ak_tmp_cy_percent=ak_round(((ak_tmp_cy-ak_EditPoint_BBox.y)*100)/ak_EditPoint_Size.y,10)+"%"
ak_setAttributeList(ak_gradient2edit,"cx",ak_tmp_cx_percent,"cy",ak_tmp_cy_percent)
}
ak_tagName_cout=ak_gradientName_start+ak_getAttributeCout(ak_gradient2edit,'fx','fy','cx','cy','r')
break
case 3: // r radialGradient
var ak_tmp_x2=(ak_gradient_vector_start.x+ak_gradient_vector.x)+(ak_point_2.x-ak_EditPoint.x)
var ak_tmp_y2=(ak_gradient_vector_start.y+ak_gradient_vector.y)+(ak_point_2.y-ak_EditPoint.y)
ak_tmp_x2-=ak_gradient_radial_center.x
ak_tmp_y2-=ak_gradient_radial_center.y
ak_tmp_y2*=(ak_gradient_radial_r/ak_gradient_radial_ry)
var ak_tmp_r=ak_round(Math.pow((Math.pow(ak_tmp_x2,2)+Math.pow(ak_tmp_y2,2)),0.5),100)
var ak_tmp_ry=ak_tmp_r*ak_gradient_radial_ry/ak_gradient_radial_r
var ak_tmp_x1=ak_gradient_control_start.x
var ak_tmp_y1=ak_gradient_control_start.y
ak_tmp_x2=ak_gradient_radial_center.x-ak_tmp_x1
ak_tmp_y2=ak_gradient_radial_center.y-ak_tmp_y1
var ak_tmp_2length=Math.pow((Math.pow(ak_tmp_x2,2)+Math.pow(ak_tmp_y2,2)),0.5)
if(ak_tmp_2length==0)
{
ak_tmp_x2=ak_tmp_x1+ak_tmp_r
ak_tmp_y2=ak_tmp_y1
}
else
{
var ak_tmp_angle1=Math.atan2(ak_tmp_y2,ak_tmp_x2)
var ak_tmp_angle=Math.atan(Math.tan(ak_tmp_angle1)*ak_tmp_r/ak_tmp_ry)
if(ak_tmp_angle1>(Math.PI/2) || ak_tmp_angle1<(-Math.PI/2)) ak_tmp_angle+=Math.PI
ak_tmp_x2=(Math.cos(ak_tmp_angle)*ak_tmp_r)+ak_gradient_radial_center.x
ak_tmp_y2=(Math.sin(ak_tmp_angle)*ak_tmp_ry)+ak_gradient_radial_center.y
}
ak_setAttributeList(document.getElementById("ak_gradient_circle1"),"rx",ak_tmp_r,"ry",ak_tmp_ry)
ak_setAttributeList(document.getElementById("ak_gradient_line1"),"x2",ak_tmp_x2,"y2",ak_tmp_y2)
if(ak_gradientUnits=="userSpaceOnUse")
{
ak_gradient2edit.setAttribute("r",ak_tmp_r)
}
else
{
var ak_tmp_r_percent=ak_round((ak_tmp_r*100)/ak_EditPoint_Size.x,10)+"%"
ak_gradient2edit.setAttribute("r",ak_tmp_r_percent)
}
ak_tagName_cout=ak_gradientName_start+ak_getAttributeCout(ak_gradient2edit,'fx','fy','cx','cy','r')
break
}
ak_cout(ak_tagName_cout)
ak_EditPoint=ak_tmp_EditPoint
return
}
if(action=="gradient_stop") 
{ // point_nr entspricht stop entry
var ak_tmp_x=ak_point_2.x-ak_gradient_vector_start.x
var ak_tmp_y=ak_point_2.y-ak_gradient_vector_start.y
var ak_tmp_offset=Math.pow((Math.pow(ak_tmp_x,2)+Math.pow(ak_tmp_y,2)),0.5)
var ak_tmp_vector_length=Math.pow((Math.pow(ak_gradient_vector.x,2)+Math.pow(ak_gradient_vector.y,2)),0.5)
var ak_tmp_angle=Math.atan2(ak_tmp_y,ak_tmp_x)
var ak_tmp_angle_vector=Math.atan2(ak_gradient_vector.y,ak_gradient_vector.x)
ak_tmp_offset=(ak_tmp_offset*Math.cos(ak_tmp_angle_vector-ak_tmp_angle))/ak_tmp_vector_length
if(ak_tmp_offset>1) ak_tmp_offset=1
if(ak_tmp_offset<ak_stop_min[point_nr]) ak_tmp_offset=ak_stop_min[point_nr]
var ak_tmp_ox=(ak_tmp_offset*ak_gradient_vector.x)+ak_gradient_vector_start.x
var ak_tmp_oy=(ak_tmp_offset*ak_gradient_vector.y)+ak_gradient_vector_start.y
ak_setAttributeList(document.getElementById("ak_gradient_line2"),"x1",ak_tmp_ox+ak_gradient_vector_90.x,"y1",ak_tmp_oy+ak_gradient_vector_90.y,"x2",ak_tmp_ox-ak_gradient_vector_90.x,"y2",ak_tmp_oy-ak_gradient_vector_90.y)
ak_gradient_stop[point_nr].setAttribute("offset",ak_round(ak_tmp_offset*100,10)+"%")
ak_cout('<stop offset="'+ak_round(ak_tmp_offset*100,10)+'%"')
ak_EditPoint=ak_tmp_EditPoint
return
}
}
//##############################################################
var ak_pathMenu, ak_pathMenu2, ak_pathMenuAK, ak_pathMenuValid=false
function ak_show_object_menu(evt,test,action)
{
if(!ak_menuValid(evt,"object")) return
if (evt.getButton==2)
{
if(evt.type=="mouseup") return
if(ak_svgroot.currentTranslate.x!=0 || ak_svgroot.currentTranslate.y!=0 || ak_svgroot.currentScale!=1)
{
ak_showMainMenu(evt)
return
}
if(ak_object2update_nodeNr==-1)
{
if(action=="keyTimes") evt.preventDefault()
else ak_showMainMenu(evt)
return
}
var ak_tmpNode='<menu id="ak_object_edit_menu_xml"><header>AKs SVGEditor Object Edit Menu</header>'
if(action=="aniDuration" || /Times$|Splines$/.test(action))
{
if(ak_freezeArray.length<=0)
{
evt.preventDefault()
return
}
var ak_tmpAniMenu="", ak_tmp_attAddAttr=""
var ak_tmp_objAni="'"+ak_which_nodeNr(ak_getObject(ak_animate2update).parentNode)+"','"+ak_animate2update+"'"
var ak_tmp_action=' onactivate="ak_edit_animate('+"'setTiming',"+ak_tmp_objAni+',\'dur\')"'
if(action=="parentKeyTimes") // kommt von freeze und how many parents
{
ak_tmp_attAddAttr=ak_getObject(ak_animate2update).getAttribute("fill")
if(ak_tmp_attAddAttr=="remove") ak_tmpAniMenu+='<item checked="yes">fill = "remove"</item>'
else
{
ak_tmp_action=' onactivate="ak_edit_animate('+"'setFill',"+ak_tmp_objAni+",'remove'"+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>fill = "remove"</item>'
}
if(ak_tmp_attAddAttr=="freeze") ak_tmpAniMenu+='<item checked="yes">fill = "freeze"</item>'
else
{
ak_tmp_action=' onactivate="ak_edit_animate('+"'setFill',"+ak_tmp_objAni+",'freeze'"+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>fill = "freeze"</item>'
}
var ak_tmpFlag=false
for(var i=0;i<ak_freezeArray.length;i++)
{
if(/^ak_multi_/.test(ak_getObject(ak_animate2update).getId()) && ak_freezeArray[i].getId().search("ak_multi_"+ak_multiName+"_")==0) {}
else if(ak_which_nodeNr(ak_freezeArray[i])!=ak_animate2update && ak_freezeArray[i].getAttribute("fill")!="remove") ak_tmpFlag=true
}
if(ak_tmpFlag)
{
ak_tmpAniMenu+='<separator/>'
ak_tmp_action=' onactivate="ak_edit_animateAllChilds('+"'setFill',"+ak_tmp_objAni+",'remove'"+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>fill = "remove"  (all childs)</item>'
}
ak_tmp_attAddAttr=ak_getObject(ak_animate2update).getAttribute("keySplines")
if(ak_tmp_attAddAttr) 
{
ak_tmpAniMenu+='<separator/>'
if(ak_keysEditor)
{
ak_tmp_action=' onactivate="ak_edit_animateSpline('+"'closeKeyTimes',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item checked="yes"'+ak_tmp_action+'>keyTimes|keySplines EDITOR</item>'
}
else
{
ak_tmp_action=' onactivate="ak_edit_keyTimesInit('+"'keyTimesEditor',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>keyTimes|keySplines EDITOR</item>'
}
}
ak_tmpNode+=ak_tmpAniMenu+'</menu>'
var ak_tmpObject=parseXML(ak_tmpNode,document).firstChild
if(ak_objectMenu) ak_svgroot.replaceChild(ak_tmpObject,ak_objectMenu)
else ak_svgroot.appendChild(ak_tmpObject)
ak_objectMenu=ak_tmpObject
contextMenu().replaceChild(parseXML(printNode(getDocument().getElementById("ak_object_edit_menu_xml")),getContextMenu()).firstChild,getContextMenu().firstChild)
return
}
ak_tmp_action=' onactivate="ak_edit_animate('+"'setTiming',"+ak_tmp_objAni+',\'begin\')"'
ak_tmpNode+='<item'+ak_tmp_action+'>Enter begin</item>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'setTiming',"+ak_tmp_objAni+',\'dur\')"'
ak_tmpNode+='<item'+ak_tmp_action+'>Enter dur</item>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'setTiming',"+ak_tmp_objAni+',\'repeatCount\')"'
ak_tmpNode+='<item'+ak_tmp_action+'>Enter repeatCount</item>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'setTiming',"+ak_tmp_objAni+',\'end\')"'
ak_tmpNode+='<item'+ak_tmp_action+'>Enter end</item>'
ak_tmpNode+='<separator/>'
ak_tmp_attAddAttr=ak_getObject(ak_animate2update).getAttribute("keySplines")
if(ak_tmp_attAddAttr) 
{
if(ak_keysEditor)
{
ak_tmp_action=' onactivate="ak_edit_animateSpline('+"'closeKeyTimes',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item checked="yes"'+ak_tmp_action+'>keyTimes|keySplines EDITOR</item>'
}
else
{
ak_tmp_action=' onactivate="ak_edit_keyTimesInit('+"'keyTimesEditor',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>keyTimes|keySplines EDITOR</item>'
}
ak_tmpAniMenu+='<separator/>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'rmAniAttribute',"+ak_tmp_objAni+",'keyTimes'"+')"'
ak_tmpAniMenu+='<item checked="yes"'+ak_tmp_action+'>keyTimes + keySplines</item>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'rmAniAttribute',"+ak_tmp_objAni+",'keySplines'"+')"'
ak_tmpAniMenu+='<item checked="no"'+ak_tmp_action+'>Remove keySplines</item>'
}
else if(ak_getObject(ak_animate2update).getAttribute("keyTimes"))
{

if(ak_keysEditor)
{
ak_tmp_action=' onactivate="ak_edit_animateSpline('+"'closeKeyTimes',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item checked="yes"'+ak_tmp_action+'>keyTimes|keySplines EDITOR</item>'
}
else
{
ak_tmp_action=' onactivate="ak_edit_keyTimesInit('+"'keyTimesEditor',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>keyTimes|keySplines EDITOR</item>'
}
ak_tmpAniMenu+='<separator/>'
ak_tmp_action=' onactivate="ak_edit_animate('+"'rmAniAttribute',"+ak_tmp_objAni+",'keyTimes'"+')"'
ak_tmpAniMenu+='<item checked="yes"'+ak_tmp_action+'>keyTimes</item>'
ak_tmp_action=' onactivate="ak_edit_keyTimes('+"'keySplinesEditor',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>Add keySplines</item>'
}
else
{
ak_tmpAniMenu+='<item enabled="no">keyTimes|keySplines EDITOR</item>'
ak_tmpAniMenu+='<separator/>'
ak_tmp_action=' onactivate="ak_edit_keyTimes('+"'keyTimesEditor',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>Add keyTimes</item>'
ak_tmp_action=' onactivate="ak_edit_keyTimes('+"'keySplinesEditor',"+ak_tmp_objAni+')"'
ak_tmpAniMenu+='<item'+ak_tmp_action+'>Add keyTimes + keySplines</item>'
}
ak_tmpAniMenu+='<separator/>'
ak_tmpAniMenu+='<menu><header>calcMode'
ak_tmp_attAddAttr=ak_getObject(ak_animate2update).getAttribute("calcMode")
if(ak_tmp_attAddAttr) ak_tmpAniMenu+=' = "'+ak_tmp_attAddAttr+'"'
ak_tmp_action=' onactivate="ak_edit_animate('+"'setAniAttr',"+ak_tmp_objAni
ak_tmpAniMenu+='</header>'
if(ak_tmp_attAddAttr=="linear") ak_tmpAniMenu+='<item checked="yes">linear</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+",'calcMode','linear'"+')"'+'>linear</item>'
if(ak_tmp_attAddAttr=="spline") ak_tmpAniMenu+='<item checked="yes">spline</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+",'calcMode','spline'"+')"'+'>spline</item>'
if(ak_tmp_attAddAttr=="discrete") ak_tmpAniMenu+='<item checked="yes">discrete</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+",'calcMode','discrete'"+')"'+'>discrete</item>'
if(ak_tmp_attAddAttr=="paces") ak_tmpAniMenu+='<item checked="yes">paces</item>'
else ak_tmpAniMenu+='<item'+ak_tmp_action+",'calcMode','paces'"+')"'+'>paces</item>'
ak_tmpAniMenu+='</menu>'
ak_tmpNode+=ak_tmpAniMenu+'</menu>'
var ak_tmpObject=parseXML(ak_tmpNode,document).firstChild
if(ak_objectMenu) ak_svgroot.replaceChild(ak_tmpObject,ak_objectMenu)
else ak_svgroot.appendChild(ak_tmpObject)
ak_objectMenu=ak_tmpObject
contextMenu().replaceChild(parseXML(printNode(getDocument().getElementById("ak_object_edit_menu_xml")),getContextMenu()).firstChild,getContextMenu().firstChild)
return
}
// bei Animation evt auch von ak_no_selection
if(ak_edit_gradient_flag=="gradient")
{//  dann nur Gradient Menu
ak_tmpNode='<menu><header>Gradient Attributes</header>'
ak_tmpNode+='<item checked="yes" onactivate="ak_set4Style(evt,false,\'off\');ak_init_buttonV3()">Edit Gradient</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+=ak_getGradientMenu(evt)
ak_tmpNode+='</menu>'
var ak_tmpObject=parseXML(ak_tmpNode,document).firstChild
if(ak_objectMenu) ak_svgroot.replaceChild(ak_tmpObject,ak_objectMenu)
else ak_svgroot.appendChild(ak_tmpObject)
ak_objectMenu=ak_tmpObject
contextMenu().replaceChild(parseXML(ak_tmpNode,getContextMenu()).firstChild,getContextMenu().firstChild)
return
}
if(ak_edit_gradient_flag=="pattern")
{//  dann nur Pattern Menu
ak_tmpNode='<menu><header>Pattern Attributes</header>'
ak_tmpNode+='<item checked="yes" onactivate="ak_set4Style(evt,false,\'off\');ak_init_buttonV3()">Edit Pattern</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+=ak_getPatternMenu(evt)
ak_tmpNode+='</menu>'
var ak_tmpObject=parseXML(ak_tmpNode,document).firstChild
if(ak_objectMenu) ak_svgroot.replaceChild(ak_tmpObject,ak_objectMenu)
else ak_svgroot.appendChild(ak_tmpObject)
ak_objectMenu=ak_tmpObject
contextMenu().replaceChild(parseXML(ak_tmpNode,getContextMenu()).firstChild,getContextMenu().firstChild)
return
}
if(ak_edit_gradient_flag=="filter")
{//  dann nur Filter Menu
ak_tmpNode='<menu><header>Filter Attributes</header>'
ak_tmpNode+='<item checked="yes" onactivate="ak_set4Style(evt,false,\'off\');ak_init_buttonV3()">Edit Filter</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+=ak_getFilterMenu(evt)
ak_tmpNode+='</menu>'
var ak_tmpObject=parseXML(ak_tmpNode,document).firstChild
if(ak_objectMenu) ak_svgroot.replaceChild(ak_tmpObject,ak_objectMenu)
else ak_svgroot.appendChild(ak_tmpObject)
ak_objectMenu=ak_tmpObject
contextMenu().replaceChild(parseXML(ak_tmpNode,getContextMenu()).firstChild,getContextMenu().firstChild)
return
}
if(ak_object2update.tagName=="marker")
{//  dann nur Marker Menu
ak_tmpNode='<menu id="ak_edit_markerMenu"><header>Edit Marker Attributes</header>'
eval("var ak_tmp_Childmenu=ak_get_childMenu(false,"+ak_object2update_nodeNr+")")
if (ak_tmp_Childmenu=="") ak_tmpNode+='<item enabled="no">No marker childNodes found!</item>'
else
{
var ak_tmp=ak_tmp_Childmenu.search(/<\/header>/)
if(ak_tmp!=-1)
{
ak_tmp_Childmenu=ak_tmp_Childmenu.substring(ak_tmp)
ak_tmp_Childmenu='<menu><header>Marker childNodes'+ak_tmp_Childmenu
}
ak_tmpNode+=ak_tmp_Childmenu
}
ak_tmpNode+='<item onactivate="ak_edit_marker('+"'drawLine'"+')">draw line at refX / refY</item>'
ak_tmpNode+='<separator/>'
var ak_tmp_units=ak_object2update.getAttribute("markerUnits")
var ak_tmp_checked=''
if(ak_tmp_units=="userSpaceOnUse") ak_tmp_checked=' checked="yes"'
ak_tmpNode+='<item'+ak_tmp_checked+' onactivate="ak_edit_marker('+"'userSpaceOnUse'"+')">userSpaceOnUse</item>'
if(ak_tmp_units=="strokeWidth")  ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmpNode+='<item'+ak_tmp_checked+' onactivate="ak_edit_marker('+"'strokeWidth'"+')">strokeWidth</item>'
if(ak_tmp_units=="") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmpNode+='<item'+ak_tmp_checked+' onactivate="ak_edit_marker('+"'removeUnits'"+')">remove markerUnits</item>'
ak_tmpNode+='<separator/>'
if(ak_markerAuto) ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmpNode+='<item'+ak_tmp_checked+' onactivate="ak_edit_marker('+"'auto'"+')">orient="auto"</item>'
ak_tmpNode+='</menu>'
var ak_tmpObject=parseXML(ak_tmpNode,document).firstChild
if(ak_objectMenu) ak_svgroot.replaceChild(ak_tmpObject,ak_objectMenu)
else ak_svgroot.appendChild(ak_tmpObject)
ak_objectMenu=ak_tmpObject
contextMenu().replaceChild(parseXML(ak_tmpNode,getContextMenu()).firstChild,getContextMenu().firstChild)
return
}//   Ende marker           
// Path Attributes
if(ak_object2update.tagName=="path")
{
if(ak_pathMenuValid && ak_which_nodeNr(ak_pathMenuValid)==ak_which_nodeNr(ak_object2update))
{
ak_tmpNode+=ak_pathMenu
}
else
{
ak_tmpNode+='<menu id="ak_edit_path_points_submenu"><header>Path Attributes</header>'
ak_tmpNode+='<item onactivate="'+"ak_switch_xy_transform()"+'">[Shift+Ctrl] Edit xy &lt;> transform</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_edit_path_menu('addPathClipboard')"+'">Add d="..." from Clipboard</item>'
ak_tmpNode+='<item onactivate="'+"ak_edit_path_menu('replacePathClipboard')"+'">Replace d="..." from Clipboard</item>'
ak_tmpNode+='<item enabled="no">Mirror left | right</item>'
ak_tmpNode+='<item enabled="no">Mirror top | bottom</item>'
ak_tmpNode+='<item enabled="no">Rotate Path Points</item>'
ak_tmpNode+='<separator/>'
}
var ak_tmp_fill=ak_SetGetRm_styleValue(ak_object2update,"fill-rule","get","no_cout")
if(ak_tmp_fill=="nonzero")
{
ak_tmpNode+='<item id="ak_fillrule_nonzero" checked="yes">fill-rule: nonzero</item>'
ak_tmpNode+='<item id="ak_fillrule_evenodd" onactivate="'+"ak_edit_path_menu('evenodd')"+'">fill-rule: evenodd</item>'
ak_tmpNode+='<item id="ak_fillrule_false" onactivate="'+"ak_edit_path_menu('rm fill-rule')"+'">remove fill-rule</item>'
}
else if(ak_tmp_fill=="evenodd")
{
ak_tmpNode+='<item id="ak_fillrule_nonzero" onactivate="'+"ak_edit_path_menu('nonzero')"+'">fill-rule: nonzero</item>'
ak_tmpNode+='<item id="ak_fillrule_evenodd" checked="yes">fill-rule = "evenodd"</item>'
ak_tmpNode+='<item id="ak_fillrule_false" onactivate="'+"ak_edit_path_menu('rm fill-rule')"+'">remove fill-rule</item>'
}
else
{
ak_tmpNode+='<item id="ak_fillrule_nonzero" onactivate="'+"ak_edit_path_menu('nonzero')"+'">fill-rule: nonzero</item>'
ak_tmpNode+='<item id="ak_fillrule_evenodd" onactivate="'+"ak_edit_path_menu('evenodd')"+'">fill-rule: evenodd</item>'
}
ak_tmpNode+='<separator/>'
if(ak_pathMenuValid && ak_which_nodeNr(ak_pathMenuValid)==ak_which_nodeNr(ak_object2update))
{
ak_tmpNode+=ak_pathMenu2
if(ak_segment_how_many==1)
{
//ak_tmpNode+=ak_pathMenuAK
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item checked="no" onactivate="ak_edit_path_menu(\'Select Previous Segment\')">[S] or [D]  Show | Hide Path Points</item>'
}
else
{
//ak_tmpNode+=ak_pathMenuAK
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_edit_path_menu('Select Previous Segment')"+'">[S] Select Previous Segment</item>'
ak_tmpNode+='<item onactivate="'+"ak_edit_path_menu('Select Next Segment')"+'">[D] Select Next Segment</item>'
ak_tmpNode+='<item id="ak_hide_control_points" checked="no" onactivate="'+"ak_edit_path_menu('Hide Path Control Points')"+'">[S+D] Hide Path Points</item>'
ak_tmpNode+='<item id="ak_show_all_control_points" checked="no" onactivate="'+"ak_edit_path_menu('Show all Path Control Points')"+'">Show all Path Points</item>'
ak_tmpNode+='<separator/>'
var ak_tmp_segment_start='<item onactivate="'+"ak_edit_path_menu('Select Segment',"
var ak_tmp_segment_startCheck='<item checked="yes" onactivate="'+"ak_edit_path_menu('Select Segment',"
var ak_tmp_segment_mid=')">Select '
var ak_tmp_segment_end='. Segment</item>'
for(var i=0;i<ak_segment_how_many;i++)
{
if(i==ak_segment_start && !ak_hide_pathPoints) ak_tmpNode+=ak_tmp_segment_startCheck+i+ak_tmp_segment_mid+(i+1)+ak_tmp_segment_end
else ak_tmpNode+=ak_tmp_segment_start+i+ak_tmp_segment_mid+(i+1)+ak_tmp_segment_end
}
}
ak_tmpNode+='</menu>'
}
else
{
//ak_tmpNode+='<item enabled="no">Edit ak_path Attribute</item>'
//ak_tmpNode+='<separator/>'
ak_tmpNode+='<item enabled="no">[S] or [D]  Show | Hide Path Points</item>'
ak_tmpNode+='</menu>'
}
if(ak_pathMenuValid && ak_which_nodeNr(ak_pathMenuValid)==ak_which_nodeNr(ak_object2update))
{
ak_tmpNode+=ak_pathMenuAK
}
else ak_tmpNode+='<item enabled="no">Edit ak_path Attribute</item>'
}// Ende Path Attributes
else if(ak_object2update.tagName=="a")
{// <a Menu fuer xlink:href
var ak_tmpTarget=ak_object2update.getAttribute('xlink:href')
ak_tmpNode+='<menu id="ak_svg_submenu"><header>&lt;a xlink:href | target</header>'
if(ak_tmpTarget)
{
var ak_tmp_txt=ak_tmpTarget
if(ak_tmpTarget.length>14) ak_tmp_txt=ak_tmpTarget.substring(0,10)+"..."
ak_tmpTarget=ak_tmpTarget.replace(/\\/g,'\\\\')
ak_tmpTarget=ak_tmpTarget.replace(/\'/g,'\\\'')
ak_tmpNode+='<item checked="yes" onactivate="'+"ak_set_attribute('manual','xlink:href','"+ak_tmpTarget+"','no_color')"+'">Enter xlink:href="'+ak_tmp_txt+'"</item>'
ak_tmpNode+='<item onactivate="'+"ak_set_attribute('dialog','xlink:href','"+ak_tmpTarget+"','no_color')"+'">Dialog for xlink:href</item>'
if(/\:/.test(ak_tmpTarget)) ak_tmpNode+='<item enabled="no">Set absolutePath for xlink:href</item>'
else ak_tmpNode+='<item onactivate="'+"ak_set_attribute('xlink_absolute','xlink:href','','no_color')"+'">Set absolutePath for xlink:href</item>'
ak_tmpNode+='<item onactivate="'+"ak_set_attribute('attribute_set','xlink:href','','no_color')"+'">xlink:href=""</item>'
}
else
{
ak_tmpNode+='<item onactivate="'+"ak_set_attribute('manual','xlink:href','http://','no_color')"+'">Enter xlink:href</item>'
ak_tmpNode+='<item onactivate="'+"ak_set_attribute('dialog','xlink:href','','no_color')"+'">Dialog for xlink:href</item>'
if(ak_object2update.hasAttribute('xlink:href'))
{ak_tmpNode+='<item checked="yes" onactivate="'+"ak_set_attribute('attribute_set','xlink:href','','no_color')"+'">xlink:href=""</item>'}
else
{ak_tmpNode+='<item onactivate="'+"ak_set_attribute('attribute_set','xlink:href','','no_color')"+'">xlink:href=""</item>'}
}
ak_tmpNode+='<separator/>'
ak_tmpTarget=ak_object2update.getAttribute('target')
if(ak_tmpTarget=='_self') ak_tmpNode+='<item checked="yes" onactivate="'+"ak_set_attribute('attribute','target','_self','no_color')"+'">target="_self"</item>'
else ak_tmpNode+='<item onactivate="'+"ak_set_attribute('attribute','target','_self','no_color')"+'">target="_self"</item>'
if(ak_tmpTarget=='_parent') ak_tmpNode+='<item checked="yes" onactivate="'+"ak_set_attribute('attribute','target','_parent','no_color')"+'">target="_parent"</item>'
else ak_tmpNode+='<item onactivate="'+"ak_set_attribute('attribute','target','_parent','no_color')"+'">target="_parent"</item>'
if(ak_tmpTarget=='_top') ak_tmpNode+='<item checked="yes" onactivate="'+"ak_set_attribute('attribute','target','_top','no_color')"+'">target="_top"</item>'
else ak_tmpNode+='<item onactivate="'+"ak_set_attribute('attribute','target','_top','no_color')"+'">target="_top"</item>'
if(ak_tmpTarget=='_blank') ak_tmpNode+='<item checked="yes" onactivate="'+"ak_set_attribute('attribute','target','_blank','no_color')"+'">target="_blank"</item>'
else ak_tmpNode+='<item onactivate="'+"ak_set_attribute('attribute','target','_blank','no_color')"+'">target="_blank"</item>'
ak_tmpNode+='<separator/>'
if(ak_tmpTarget)
{
ak_tmp_txt=ak_tmpTarget
ak_tmpTarget=ak_tmpTarget.replace(/\\/g,'\\\\')
if(/_self|_parent|_top|_blank/.test(ak_tmp_txt)) ak_tmpNode+='<item onactivate="'+"ak_set_attribute('manual','target','"+ak_tmpTarget+"','no_color')"+'">Enter target="'+ak_tmp_txt+'"</item>'
else ak_tmpNode+='<item checked="yes" onactivate="'+"ak_set_attribute('manual','target','"+ak_tmpTarget+"','no_color')"+'">Enter target="'+ak_tmp_txt+'"</item>'
ak_tmpNode+='<item onactivate="'+"ak_set_attribute('attribute','target','','no_color')"+'">Remove target</item>'
}
else
{
ak_tmpNode+='<item onactivate="'+"ak_set_attribute('manual','target','','no_color')"+'">Enter target</item>'
ak_tmpNode+='<item checked="yes" onactivate="'+"ak_set_attribute('attribute','target','','no_color')"+'">Remove target</item>'
}
ak_tmpNode+='</menu>'
}// Ende <a Menu fuer xlink:href
else if(ak_object2update.tagName=="image")
{// <image Menu
var ak_tmpTarget=ak_object2update.getAttribute('xlink:href')
//ak_image_preserveMenu=true
if(ak_image_preserveMenu)
{
var ak_svgMenu='<menu id="ak_svg_submenu"><header>&lt;image xlink:href | preserveAspectRatio</header>'
if(/\:/.test(ak_tmpTarget)) ak_svgMenu+='<item onactivate="ak_editEnter(\'xlink:href\')">Enter &lt;image xlink:href</item>'
else
{
ak_svgMenu+='<item onactivate="ak_set_attribute(\'xlink_absolute\',\'xlink:href\',\'\',\'no_color\')">&lt;image xlink:href set absolutePath</item>'
ak_svgMenu+='<item onactivate="ak_editEnter(\'xlink:href\')">Enter &lt;image xlink:href</item>'
}
ak_svgMenu+='<separator/>'
var ak_tmp_preserve=ak_object2update.getAttribute("preserveAspectRatio")
var ak_tmp
for(var i=0;i<ak_preserve.length;i++)
{
if(ak_preserve[i]=="xMidYMid") ak_tmp=" (def.)"
else ak_tmp=""
if(ak_tmp_preserve==ak_preserve[i]+" meet") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('aspect','"+ak_preserve[i]+" meet')"+'">'+ak_preserve[i]+' meet'+ak_tmp+'</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('aspect','"+ak_preserve[i]+" meet')"+'">'+ak_preserve[i]+' meet'+ak_tmp+'</item>'
}
ak_svgMenu+='<separator/>'
for(var i=0;i<ak_preserve.length;i++)
{
if(ak_tmp_preserve==ak_preserve[i]+" slice") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('aspect','"+ak_preserve[i]+" slice')"+'">'+ak_preserve[i]+' slice</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('aspect','"+ak_preserve[i]+" slice')"+'">'+ak_preserve[i]+' slice</item>'
}
ak_svgMenu+='<separator/>'
if(ak_tmp_preserve=="none") ak_svgMenu+='<item checked="yes" onactivate="'+"ak_edit_svg('aspect','none')"+'">none</item>'
else ak_svgMenu+='<item onactivate="'+"ak_edit_svg('aspect','none')"+'">none</item>'
ak_tmpNode+=ak_svgMenu+'</menu>'
}
else
{
if(/\:/.test(ak_tmpTarget)) ak_tmpNode+='<item onactivate="ak_editEnter(\'xlink:href\')">Enter &lt;image xlink:href</item>'
else
{
ak_tmpNode+='<item onactivate="ak_set_attribute(\'xlink_absolute\',\'xlink:href\',\'\',\'no_color\')">&lt;image xlink:href set absolutePath</item>'
ak_tmpNode+='<item onactivate="ak_editEnter(\'xlink:href\')">Enter &lt;image xlink:href</item>'
}
}
}// Ende <image Menu
else if(/^poly/.test(ak_object2update.tagName)) ak_tmpNode+='<item id="ak_convert2path" onactivate="ak_convertPoly2Path(evt)">Convert to &lt;path ...</item>'
else if(ak_object2update.tagName=="svg") ak_tmpNode+=ak_setSVGMenu(evt)
else if(ak_object2update.tagName=="clipPath")
{//                                         
var ak_tmpUnits=ak_object2update.getAttribute('clipPathUnits')
ak_tmpNode+='<menu id="ak_svg_submenu"><header>clipPath Attributes</header>'
if(ak_tmpUnits=='userSpaceOnUse') ak_tmpNode+='<item checked="yes" onactivate="'+"ak_set_attribute('attribute','clipPathUnits','userSpaceOnUse','no_color')"+'">clipPathUnits="userSpaceOnUse"</item>'
else ak_tmpNode+='<item onactivate="'+"ak_set_attribute('attribute','clipPathUnits','userSpaceOnUse','no_color')"+'">clipPathUnits="userSpaceOnUse"</item>'
if(ak_tmpUnits=='objectBoundingBox') ak_tmpNode+='<item checked="yes" onactivate="'+"ak_set_attribute('attribute','clipPathUnits','objectBoundingBox','no_color')"+'">clipPathUnits="objectBoundingBox"</item>'
else ak_tmpNode+='<item onactivate="'+"ak_set_attribute('attribute','clipPathUnits','objectBoundingBox','no_color')"+'">clipPathUnits="objectBoundingBox"</item>'
if(ak_tmpUnits) ak_tmpNode+='<item onactivate="'+"ak_set_attribute('attribute','clipPathUnits','','no_color')"+'">Remove clipPathUnits</item>'
else ak_tmpNode+='<item checked="yes" onactivate="'+"ak_set_attribute('attribute','clipPathUnits','','no_color')"+'">Remove clipPathUnits</item>'
ak_tmpNode+='</menu>'
}//   Ende  clipPath  
else if(ak_object2update.tagName=="marker")
{//                                         
ak_tmpNode+='<menu id="ak_edit_markerMenu"><header>Edit Marker Attributes</header>'
eval("var ak_tmp_Childmenu=ak_get_childMenu(false,"+ak_object2update_nodeNr+")")
if (ak_tmp_Childmenu=="") ak_tmpNode+='<item enabled="no">No marker childNodes found!</item>'
else ak_tmpNode+=ak_tmp_Childmenu
ak_tmpNode+='<item onactivate="ak_edit_marker('+"'drawLine'"+')">draw line at refX / refY</item>'
ak_tmpNode+='<separator/>'
var ak_tmp_units=ak_object2update.getAttribute("markerUnits")
var ak_tmp_checked=''
if(ak_tmp_units=="userSpaceOnUse") ak_tmp_checked=' checked="yes"'
ak_tmpNode+='<item'+ak_tmp_checked+' onactivate="ak_edit_marker('+"'userSpaceOnUse'"+')">userSpaceOnUse</item>'
if(ak_tmp_units=="strokeWidth")  ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmpNode+='<item'+ak_tmp_checked+' onactivate="ak_edit_marker('+"'strokeWidth'"+')">strokeWidth</item>'
if(ak_tmp_units=="") ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmpNode+='<item'+ak_tmp_checked+' onactivate="ak_edit_marker('+"'removeUnits'"+')">remove markerUnits</item>'
ak_tmpNode+='<separator/>'
if(ak_markerAuto) ak_tmp_checked=' checked="yes"'
else ak_tmp_checked=''
ak_tmpNode+='<item'+ak_tmp_checked+' onactivate="ak_edit_marker('+"'auto'"+')">orient="auto"</item>'
ak_tmpNode+='</menu>'
}//   Ende marker           
if(ak_edit_gradient_flag=="gradient")
{
ak_tmpNode+='<menu><header>Gradient Attributes</header>'
ak_tmpNode+=ak_getGradientMenu(evt)
ak_tmpNode+='</menu>'
}
if(ak_edit_gradient_flag=="pattern")
{
ak_tmpNode+='<menu><header>Pattern Attributes</header>'
ak_tmpNode+=ak_getPatternMenu(evt)
ak_tmpNode+='</menu>'
}
if(ak_edit_gradient_flag=="filter")
{
ak_tmpNode+='<menu><header>Filter Attributes</header>'
ak_tmpNode+=ak_getFilterMenu(evt)
ak_tmpNode+='</menu>'
}
var ak_tmpExpert=false
if(evt.ctrlKey())
{
ak_tmpExpert=true
ak_tmpNode+='<menu id="ak_attribute_tools"><header>Attribute Tools for 6.0x38363</header>'
ak_tmpNode+='<item onactivate="'+"ak_expert_tool('enter_attr_val')"+'">Enter "attribute" "value"</item>'
ak_tmpNode+='<item onactivate="'+"ak_expert_tool('remove_attr')"+'">Remove "attribute"</item>'
ak_tmpNode+='</menu>'
}
var ak_tmpParentNodeMenu=false
if(/,/.test(ak_object2update_nodeNr)) ak_tmpParentNodeMenu=true
if(ak_tmpParentNodeMenu) ak_tmpNode+='<menu id="ak_parentNode_submenu"><header>Select parentNode</header></menu>'
if(ak_tmpNode.length>90) ak_tmpNode+='<separator/>' // eignetlich 82 characters am anfang
ak_tmpNode+=ak_addChildBefore
ak_tmpNode+=ak_addChild2Parent
//ak_tmpNode+=ak_addChildAppend
ak_tmpNode+='<item id="ak_new_object_append_submenu" enabled="no">Add childNode</item>'
ak_tmpNode+='<item id="ak_createParentNode_submenu" enabled="no">MoveTo | Create parentNode</item>'
ak_tmpNode+='<item onactivate="'+"ak_edit_menu(evt,'[Ctrl+C] copy to Clipboard')"+'">[Ctrl+C] copy to Clipboard</item>'
ak_tmpNode+='<item onactivate="'+"ak_edit_menu(evt,'[Ctrl+X] cut to Clipboard')"+'">[Ctrl+X] cut to Clipboard</item>'
ak_tmpNode+='<separator/>'
if(ak_object2update.getId()==null || ak_object2update.getId()=="") ak_tmpNode+='<item onactivate="'+"ak_edit_menu(evt,'Change Id')"+'">Enter id</item>'
else ak_tmpNode+='<item onactivate="'+"ak_edit_menu(evt,'Change Id')"+'">Rename "'+ak_object2update.getId()+'"</item>'
ak_tmpNode+='<item id="ak_create_useElement" enabled="no">&lt;use ""</item>'
ak_tmpNode+='<item id="ak_set_clipPath" enabled="no">Set clip-path (not available)</item>'
ak_tmpNode+=ak_set4marker()
ak_tmpNode+='</menu>'
var ak_tmpObject=parseXML(ak_tmpNode,document).firstChild
if(ak_objectMenu) ak_svgroot.replaceChild(ak_tmpObject,ak_objectMenu)
else ak_svgroot.appendChild(ak_tmpObject)
ak_objectMenu=ak_tmpObject
if(ak_tmpParentNodeMenu)
{ // parentNode oben ak_tmpParentNodeMenu=true setzen, menu select initialisieren wenn gewuenscht
var ak_tmp_object=ak_object2update
var i=0
while(ak_tmp_object.getId!="ak_internal_userSpace")
{
ak_tmp_object=ak_tmp_object.parentNode
i++
}
i--
var ak_newNode='<menu id="ak_parentNode_submenu"><header>Select parentNode</header>'
var ak_newNodeArray=new Array
ak_tmp_rootId=ak_userspace_svg.getId()
if(!ak_tmp_rootId) ak_tmp_rootId="(rootElement)"
else ak_tmp_rootId='id="'+ak_tmp_rootId+'"'
if(i==0) ak_newNodeArray[i]='<item checked="yes" onactivate="'+"ak_edit_menu(evt,'Select parentNode',"+i+")"+'">&#60;svg '+ak_tmp_rootId+'</item>'
else ak_newNodeArray[i]='<item onactivate="'+"ak_edit_menu(evt,'Select parentNode',"+i+")"+'">&#60;svg '+ak_tmp_rootId+'</item>'
var ak_tmp_object=ak_object2update
var ak_newNodeArray_gradient=new Array
var ak_newNodeArray_filter=new Array
for(var i2=0;i2<i;i2++)
{
var ak_tmp_spaces=""
for(var i3=i;i3>i2;i3--) {ak_tmp_spaces+="  "}
if(/url\(#/.test(ak_SetGetRm_styleValue(ak_tmp_object,"fill","get","no_cout")) || /url\(#/.test(ak_SetGetRm_styleValue(ak_tmp_object,"stroke","get","no_cout")))
{ ak_newNodeArray_gradient[i2]=true}
else {ak_newNodeArray_gradient[i2]=false}
if(i2==0) ak_newNodeArray[i2]='<item checked="yes"'
else ak_newNodeArray[i2]='<item'
ak_newNodeArray[i2]+=' onactivate="'+"ak_edit_menu(evt,'Select parentNode',"+i2+')">'+ak_tmp_spaces+'&#60;'+ak_tmp_object.tagName
if(ak_tmp_object.getId) ak_newNodeArray[i2]+=' id="'+ak_tmp_object.getId+'"</item>'
else ak_newNodeArray[i2]+='</item>'
//filter
if(/url\(#/.test(ak_SetGetRm_styleValue(ak_tmp_object,"filter","get","no_cout")))
{ ak_newNodeArray_filter[i2]=true}
else {ak_newNodeArray_filter[i2]=false}
ak_tmp_object=ak_tmp_object.parentNode
}
for(var i2=i;i2>=0;i2--)
{ // textPath |href <path
var ak_tmp_spaces=""
for(var i3=i;i3>i2;i3--) {ak_tmp_spaces+="  "}
if(/&#60;textPath/.test(ak_newNodeArray[i2]))
{
ak_newNodeArray.splice(i2,0," ")
ak_newNodeArray[i2]='<item onactivate="'+"ak_edit_menu(evt,'Select parentNode',"+i2+",'text_data')"+'">'+ak_tmp_spaces+'      - edit text-data</item>'
ak_newNodeArray.splice(i2,0," ")
var ak_tmp_href=ak_object2update.getAttribute("xlink:href").replace(/^( *#)| +$/g,"")
ak_newNodeArray[i2]='<item onactivate="'+"ak_edit_menu(evt,'Select parentNode',"+i2+",'href_path')"+'">'+ak_tmp_spaces+'      - select &#60;path</item>'
ak_newNodeArray.splice(i2,0," ")
var ak_tmp_path=ak_userspace_svg.getElementsByTagName("path")
if(ak_tmp_path.length<=0)ak_newNodeArray[i2]='<item enabled="no">'+ak_tmp_spaces+'      - set xlink:href - no path recognized!</item>'
else
{
ak_newNodeArray[i2]='<menu><header>'+ak_tmp_spaces+'      - set xlink:href</header>'
for(var i=0;i<ak_tmp_path.length;i++)
{
var ak_tmp_id=ak_tmp_path.item(i).getId
if(ak_tmp_id)
{
if(ak_tmp_href==ak_tmp_id) var ak_tmp_checked=' checked="yes"'
else var ak_tmp_checked=""
ak_newNodeArray[i2]+='<item'+ak_tmp_checked+' onactivate="'+"ak_edit_menu(evt,'Select parentNode',"+i2+",'change_href','"+ak_tmp_id+"')"+'">'+ak_tmp_id+'</item>'
}
}
ak_newNodeArray[i2]+='</menu>'
}
}
else if(/(&#60;text)|(&#60;tspan)/.test(ak_newNodeArray[i2]))
{
ak_newNodeArray.splice(i2,0," ")
ak_newNodeArray[i2]='<item onactivate="'+"ak_edit_menu(evt,'Select parentNode',"+i2+",'text_data')"+'">'+ak_tmp_spaces+'      - edit text-data</item>'
}
else if(/(&#60;use)/.test(ak_newNodeArray[i2]))
{
var ak_tmp_useRef=ak_object2update.getAttribute("xlink:href").replace(/^ +| +$/g,"")
if(/^#/.test(ak_tmp_useRef))
{
ak_tmp_useRef=ak_tmp_useRef.replace(/^#/,"")
ak_newNodeArray.splice(i2,0," ")
ak_newNodeArray[i2]='<item onactivate="'+"ak_edit_menu(evt,'Select parentNode',"+i2+",'select_useRef','"+ak_tmp_useRef+"')"+'">'+ak_tmp_spaces+'      - select "'+ak_tmp_useRef+'"</item>'
ak_newNodeArray[i2]+='<item onactivate="'+"ak_edit_menu(evt,'Select parentNode',"+i2+",'select_useRef1Symbol','"+ak_tmp_useRef+"')"+'">'+ak_tmp_spaces+'        - select firstSymbolChild</item>'
}
else
{
ak_newNodeArray.splice(i2,0," ")
ak_newNodeArray[i2]='<item enabled="no">      - select not for external</item>'
}
}
if(ak_newNodeArray_gradient[i2])
{
if(i2==0) var ak_tmp_id=' id="ak_gradient_flag_in_menu"'
else var ak_tmp_id='' 
ak_newNodeArray.splice(i2,0," ")
ak_newNodeArray[i2]='<item'+ak_tmp_id+' onactivate="'+"ak_edit_menu(evt,'Select parentNode',"+i2+",'edit_lg_rg_pattern')"+'">'+ak_tmp_spaces+'      - edit gradient / edit pattern</item>'
}
if(ak_newNodeArray_filter[i2])
{
if(i2==0) var ak_tmp_id=' id="ak_filter_flag_in_menu"'
else var ak_tmp_id='' 
ak_newNodeArray.splice(i2,0," ")
ak_newNodeArray[i2]='<item'+ak_tmp_id+' onactivate="'+"ak_edit_menu(evt,'Select parentNode',"+i2+",'edit_filter')"+'">'+ak_tmp_spaces+'      - edit filter</item>'
}
}
ak_newNode+=ak_newNodeArray.reverse().join("")
ak_newNode+='<separator/>'
if(ak_which_nodeNr(ak_object2update.parentNode)=='') ak_newNode+='<item enabled="no">[&lt;] Select parentNode</item>'
else ak_newNode+='<item id="ak_arrowLeft" onactivate="'+"ak_edit_menu(evt,'Select parentNode',"+i2+",'selectParentNode')"+'">[&lt;] Select parentNode</item>'
ak_newNode+='</menu>'
document.getElementById("ak_parentNode_submenu").parentNode.replaceChild(parseXML(ak_newNode,document).firstChild,document.getElementById("ak_parentNode_submenu"))
}// Ende parentNode Menu
if(ak_object2update.tagName=="text" || ak_object2update.tagName=="tref" || ak_object2update.tagName=="tspan" || ak_object2update.tagName=="textPath" || ak_object2update.tagName=="g" || ak_object2update.tagName=="a" || ak_object2update.tagName=="svg")
{// append Text Attributes
if(ak_object2update.tagName=="g" || ak_object2update.tagName=="a" || ak_object2update.tagName=="svg")
{
var ak_tmp_text_attribute_submenu='<menu id="ak_textAttribute_submenu"><header>Text Attributes</header>'
ak_tmp_text_attribute_submenu+='<item onactivate="ak_editEnter(\'font-size\')">Enter font-size</item>'
ak_tmp_text_attribute_submenu+='<separator/>'
ak_tmp_text_attribute_submenu+=ak_text_attribute_submenu
}
else
{
var ak_tmp_text_attribute_submenu='<menu id="ak_textAttribute_submenu"><header>Text Attributes</header>'
ak_tmp_text_attribute_submenu+='<item onactivate="'+"ak_edit_menu(evt,'Select parentNode',"+0+",'text_data')"+'">'+'- edit text-data</item>'
ak_tmp_text_attribute_submenu+='<item onactivate="ak_editEnter(\'font-size\')">Enter font-size</item>'
ak_tmp_text_attribute_submenu+='<separator/>'
ak_tmp_text_attribute_submenu+=ak_text_attribute_submenu
}
var ak_tmpMenuObject=document.getElementById("ak_object_edit_menu_xml")
if(ak_object2update.tagName!="a" && ak_object2update.tagName!="svg" && !ak_tmpParentNodeMenu && !ak_tmpExpert) ak_tmpMenuObject.insertBefore(parseXML('<separator/>',document).firstChild,ak_tmpMenuObject.firstChild.nextSibling())
ak_tmpMenuObject.insertBefore(parseXML(ak_tmp_text_attribute_submenu,document).firstChild,ak_tmpMenuObject.firstChild.nextSibling())
var ak_tmp_font_family=ak_SetGetRm_styleValue(ak_object2update,"font-family","get","no_cout")
try{document.getElementById("ak_ffamily_"+ak_tmp_font_family.toLowerCase()).setAttribute("checked","yes")}
catch(error){document.getElementById("ak_ffamily_set_manual").setAttribute("checked","yes")}
var ak_tmp_font_weight=ak_SetGetRm_styleValue(ak_object2update,"font-weight","get","no_cout")
try{document.getElementById("ak_fweight_"+ak_tmp_font_weight.toLowerCase()).setAttribute("checked","yes")}
catch(error){}
var ak_tmp_font_style=ak_SetGetRm_styleValue(ak_object2update,"font-style","get","no_cout")
try{document.getElementById("ak_fstyle_"+ak_tmp_font_style.toLowerCase()).setAttribute("checked","yes")}
catch(error){}
var ak_tmp_font_stretch=ak_SetGetRm_styleValue(ak_object2update,"font-stretch","get","no_cout")
try{document.getElementById("ak_fstretch_"+ak_tmp_font_stretch.toLowerCase()).setAttribute("checked","yes")}
catch(error){}
var ak_tmp_text_anchor=ak_SetGetRm_styleValue(ak_object2update,"text-anchor","get","no_cout")
try{document.getElementById("ak_tanchor_"+ak_tmp_text_anchor.toLowerCase()).setAttribute("checked","yes")}
catch(error){}
var ak_tmp_text_render=ak_SetGetRm_styleValue(ak_object2update,"text-rendering","get","no_cout")
try{document.getElementById("ak_trender_"+ak_tmp_text_render.toLowerCase()).setAttribute("checked","yes")}
catch(error){}
var ak_tmp_tdeco=ak_SetGetRm_styleValue(ak_object2update,"text-decoration","get","no_cout")
if(ak_tmp_tdeco=="false") document.getElementById("ak_tdeco_false").setAttribute("checked","yes")
if(/underline/.test(ak_tmp_tdeco)) document.getElementById("ak_tdeco_underline").setAttribute("checked","yes")
if(/overline/.test(ak_tmp_tdeco)) document.getElementById("ak_tdeco_overline").setAttribute("checked","yes")
if(/line-through/.test(ak_tmp_tdeco)) document.getElementById("ak_tdeco_line-through").setAttribute("checked","yes")
switch(ak_object2update.getAttribute("xml:space").replace(/^ +| +$/g,""))
{
case "default":
document.getElementById("ak_xmlspace_default").setAttribute("checked","yes")
break
case "preserve":
document.getElementById("ak_xmlspace_preserve").setAttribute("checked","yes")
break
default:
document.getElementById("ak_xmlspace_false").setAttribute("checked","yes")
}
if(ak_SetGetRm_styleValue(ak_object2update,"letter-spacing","get","no_cout")=="false" && ak_SetGetRm_styleValue(ak_object2update,"kerning","get","no_cout")=="false") document.getElementById("ak_txkerning_false").setAttribute("checked","yes")
if(ak_SetGetRm_styleValue(ak_object2update,"word-spacing","get","no_cout")=="false") document.getElementById("ak_txwordspace_false").setAttribute("checked","yes")
}// Ende Text Attributes
var ak_tmp_menu=document.getElementById("ak_create_useElement")
if(!ak_canUsed)
{ak_tmp_menu.parentNode.replaceChild(parseXML('<item id="ak_create_useElement" enabled="no">&lt;use (not available)</item>',document).firstChild,ak_tmp_menu)}
else if(ak_object2update.getId()==null || ak_object2update.getId()=="")
{ak_tmp_menu.parentNode.replaceChild(parseXML('<item id="ak_create_useElement" enabled="no">&lt;use "no id"</item>',document).firstChild,ak_tmp_menu)}
else {ak_tmp_menu.parentNode.replaceChild(parseXML('<item id="ak_create_useElement" onactivate="'+"ak_new_object_menu(evt,'use','#"+ak_object2update.getId()+"')"+'">&lt;use "'+ak_object2update.getId()+'"</item>',document).firstChild,ak_tmp_menu)}
ak_set4clipPath()
ak_childNodeMenu_enable()
var ak_tmp_menu=document.getElementById("ak_new_object_append_submenu")
if((";"+ak_addChildFor.join(";")+";").search((";"+ak_object2update.tagName+";"))!=-1)
{
ak_tmp_menu.parentNode.replaceChild(parseXML(ak_addChildAppend,document).firstChild,ak_tmp_menu)
}
if(ak_tmpExpert) ak_set_attribute_tools()
contextMenu().replaceChild(parseXML(printNode(getDocument().getElementById("ak_object_edit_menu_xml")),getContextMenu()).firstChild,getContextMenu().firstChild)
}
}
var ak_addChildFor=new Array("svg","defs","pattern","symbol","g","a","marker","clipPath")
var ak_objectMenu=false, ak_canUsed=false
//##############################################################
function ak_editEnter(attribute)
{
var ak_tmp=ak_getAttribute(attribute)
if(ak_tmp=="false") ak_tmp=""
var ak_tmpIn=prompt('Enter '+attribute+':',ak_tmp)
if(!ak_tmpIn) return
ak_setAttribute(attribute,ak_tmpIn.replace(/^ +| +$/g,""))
ak_click(evt,ak_object2update)
}
//##############################################################
var ak_move_eval="", ak_up_eval=""
var ak_font_size_inText
var ak_middle_button=false
var ak_MoveEditRect_flag_update=false
var ak_mouse_changed_x, ak_mouse_changed_y
var ak_transform_in=""
var ak_MoveEditRect_flag_update_pan=false
var ak_keyTimes_in, ak_keyObject
//##############################################################
function ak_updateD(isReverse)
{
var ak_tmp_array=new Array
for(var i=0;i<ak_EditArray_work.length;i++)
{
if(/[A]/.test(ak_EditArray_work[i]))
{
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_EditArray_work[i]; i++
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[3],ak_precision); i++
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[4],ak_precision)
}
else if(!isNaN(ak_EditArray_enter[i]))
{
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[3],ak_precision); i++
ak_tmp_array[i]=ak_round(ak_EditArray_work[i]-ak_path_attr_enter[4],ak_precision)
}
else ak_tmp_array[i]=ak_EditArray_work[i]
}
ak_path_attr[2]=ak_tmp_array.join(" ")
if(isReverse) ak_path_reverse=true
ak_object2update.setAttribute("d",ak_path_create())
ak_object2update.setAttribute("ak_path",ak_path_attr.join(";"))
ak_tagName_cout=ak_tagName_start+' ak_path="'+ak_path_attr.join(";")+'"'
if (ak_tagName_cout.length>124) ak_tagName_cout=ak_tagName_cout.substring(0,120)+" ..."
ak_cout(ak_tagName_cout)
return
var ak_tmp_object=document.getElementById("ak_pathMode_1")
var ak_tmp_akPath
var ak_tmp
if(/2$/.test(ak_path_attr[1])) ak_tmp=ak_path_attr[1].substring(0,2)
else ak_tmp=ak_path_attr[1]+"2"
ak_tmp_akPath='<item id="ak_pathMode_1" onactivate="'+"ak_edit_path_menu('edit_ak_path_mode','"+ak_tmp+"')"+'">--&gt; '+ak_tmp+'</item>'
ak_tmp_object.parentNode.replaceChild(parseXML(ak_tmp_akPath,document).firstChild,ak_tmp_object)
if(/2$/.test(ak_path_attr[1]))
{
if(ak_path_attr[1]=="mm2") ak_tmp_akPath='<item id="ak_pathMode_2" onactivate="'+"ak_edit_path_menu('edit_ak_path_mode_rm','ml2')"+'">--&gt; ml2, mc2, mq2</item>'
else  ak_tmp_akPath='<item id="ak_pathMode_2" onactivate="'+"ak_edit_path_menu('edit_ak_path_mode','mm2')"+'">--&gt; mm2</item>'
}
else
{
if(ak_path_attr[1]=="mm") ak_tmp_akPath='<item id="ak_pathMode_2" onactivate="'+"ak_edit_path_menu('edit_ak_path_mode_rm','ml')"+'">--&gt; ml, mc, mq</item>'
else  ak_tmp_akPath='<item id="ak_pathMode_2" onactivate="'+"ak_edit_path_menu('edit_ak_path_mode','mm')"+'">--&gt; mm</item>'
}
ak_tmp_object=document.getElementById("ak_pathMode_2")
ak_tmp_object.parentNode.replaceChild(parseXML(ak_tmp_akPath,document).firstChild,ak_tmp_object)
}
//##############################################################
function ak_rect_alert(evt)
{
ak_alert('Data-Changes not saved!!!!\nLink will be redirected to new window!')
document.getElementById('ak_a_wrapper').setAttribute('style','visibility:hidden')
}
///##############################################################
function ak_MoveEditRectCtrl(evt,mouse_flag,action,point_nr)
{
try{
for (var i=0; i<256; i++) {ak_key_status[i]="up"}
if(evt.ctrlKey()) ak_object2update.dispatchEvent(evt)
}catch(err){}
}
///##############################################################
function ak_nachNominieren(evt)
{
ak_nachNom=true
//ak_userspace_g.setAttribute("onmouseover","ak_nachNominierenOver(evt)")
ak_toolObject.setAttribute("visibility","hidden")
}
///##############################################################
function ak_nachNominierenOver(evt)
{
ak_nachNom=false
ak_userspace_g.setAttribute("onmouseover","")
if(/ElementInstance/.test(evt.target) && evt.currentNode!="[object SVGUseElement]") return
else if(/ElementInstance/.test(evt.target)) ak_object2update=evt.currentNode
else ak_object2update=evt.target
if(ak_which_nodeNr(ak_object2update)==0)
{
ak_rmAttribute(ak_toolObject,"visibility")
}
else
{
ak_clickset_obj2update(evt,ak_object2update)
ak_init_buttonV3()
ak_set_gradient_control(evt)
}
}
var ak_nachNom=false
//############# ak_rect #####################
var ak_up_action, ak_control_2x, ak_control_2y, ak_rectInVal, ak_rectOutVal
var ak_gradientEdit=false
function ak_MoveEditRect(evt,mouse_flag,action,point_nr)
{
if(action=="translate" && evt.altKey() && mouse_flag=="down")
{
if(ak_checkLink[0][0].tagName=="a")
{
ak_checkLink[0][1]=ak_checkLink[0][0].getAttribute("xlink:href")
ak_checkLink[0][2]=ak_checkLink[0][0].getAttribute("target")
}
if(ak_checkLink[0][1])
{
if((/(_self)|(_parent)|(_top)/.test(ak_checkLink[0][2]) || !ak_checkLink[0][2]) && (ak_dirty_flag))
{
document.getElementById('ak_a_wrapper').setAttribute('target','redirect')
document.getElementById('ak_a_wrapper').setAttribute('onclick',"ak_rect_alert(evt)")
}
else
{
document.getElementById('ak_a_wrapper').setAttribute('target',ak_checkLink[0][2])
document.getElementById('ak_a_wrapper').setAttribute('onclick',"")
}
document.getElementById('ak_a_wrapper').setAttribute('style','opacity:0;visibility:visible')
}
for (var i=0; i<256; i++) {ak_key_status[i]="up"}
ak_object2update.dispatchEvent(evt)
return
}
if(evt.getButton==2 && ak_key_status[32]=="up") //!/down/.test(ak_key_status.join))
{
if(ak_menu_status=="ak_editor") ak_show_object_menu(evt,'test',action)
else if(ak_menu_status=="timeline")
{
ak_showMenu(evt,'timeCanvas')
}
return
}
else evt.preventDefault()
if(action=="translate" && evt.type=="mousedown" && evt.ctrlKey() && !ak_clickCtrl)
{
ak_nachNominieren(evt)
return
}
else ak_clickCtrl=false
if(mouse_flag=="up" || mouse_flag=="out")
{
if(ak_avoidMouseDown) try{ak_svgroot.removeChild(ak_avoidMouseDown)}catch(err){}
if(ak_turbo && ak_MoveEditRect_flag_update_pan)
{
ak_panLine.setAttribute("visibility","hidden")
ak_panLine1.setAttribute("visibility","hidden")
ak_panLine2.setAttribute("visibility","hidden")
ak_panLine3.setAttribute("visibility","hidden")
ak_panLine4.setAttribute("visibility","hidden")
ak_MoveEditRect_flag_update_pan=false
ak_move_eval=""
ak_middle_button=false
ak_MoveEditRect_flag=false
ak_mouse_x=evt.clientX
ak_mouse_y=evt.clientY
ak_grid_pan_x=parseInt(ak_grid_pan_x+((ak_mouse_x-ak_PanInPointx)/ak_grid_zoom))
ak_grid_pan_y=parseInt(ak_grid_pan_y+((ak_mouse_y-ak_PanInPointy)/ak_grid_zoom))
document.getElementById("ak_internal_userSpace").setAttribute("transform",("matrix("+ak_grid_zoom+",0,0,"+ak_grid_zoom+","+(ak_xy_etc_shift+ak_grid_pan_x*ak_grid_zoom)+","+(ak_xy_etc_shift+ak_grid_pan_y*ak_grid_zoom)+")"))
// refresh grid
ak_userspace_svg.firstChild.setAttribute("style",ak_userspace_svg.firstChild.getAttribute("style"));
ak_write_grid_status(((ak_grid_pan_x*-1)+","+(ak_grid_pan_y*-1)+" | x"+ak_grid_zoom+" | "+ak_grid_on_flag))
if(ak_object2update_nodeNr!=-1) ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
return
}
ak_autoEnd=false; ak_autoEnd_1=0; ak_autoEnd_2=0
ak_move_eval=""
ak_mouse_x=evt.clientX
ak_mouse_y=evt.clientY
ak_MoveEditRect_flag=false
if(ak_gradientEdit)
{
ak_selection('show')
ak_set_gradient_control(evt)
ak_gradientEdit=false
ak_MoveEditRect_flag_update=false
return
}
if(ak_MoveEditRect_flag_update) 
{
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
ak_MoveEditRect_flag_update=false
if(!ak_MoveEditRect_flag_update_pan) ak_push2undoTrue()
}
else if(ak_key_status[32]=="up") ak_selection('show')
if(ak_PanInPointx==evt.clientX && ak_PanInPointy==evt.clientY) return // wenn nix geaendert
//if(!ak_up_action) return
var ak_tmpMulti=ak_multiName
//if(ak_multiName && ak_getObject(ak_animate2update).tagName.search("ak_multi_"+ak_multiName+"_")!=0) ak_multiName=""
if(ak_up_action=='keyTimes')
{
ak_edit_animate('setAniAttr',ak_which_nodeNr(ak_getObject(ak_keyTimes_node).parentNode),ak_keyTimes_node,'keyTimes',ak_keyTimes.join("; "))
ak_up_action=false
}
else if(ak_up_action=='keySplines')
{
ak_edit_animate('setAniAttr',ak_which_nodeNr(ak_getObject(ak_keyTimes_node).parentNode),ak_keyTimes_node,'keySplines',ak_getObject(ak_keyTimes_node).getAttribute('keySplines'))
ak_up_action=false
}
else if(ak_up_action=='aniDuration')
{
ak_durSliderLine.setAttribute("y1",0)
ak_durSliderLine.setAttribute("y2",0)
ak_edit_animate('setAniAttr',ak_which_nodeNr(ak_getObject(ak_animate2update).parentNode),ak_animate2update,'dur',ak_rectOutVal)
ak_up_action=false
}
ak_multiName=ak_tmpMulti
return
}
if (ak_key_status[16]=="down" && ak_key_status[17]=="down") return; // zunaechst mal raus hier
if(mouse_flag=="down")
{
if(ak_svgroot.getCurrentTime()<ak_aniStop)
{evt.preventDefault();ak_animation("stop")}
if(ak_turbo && (evt.getButton==1 || (ak_key_status[16]=="up" && ak_key_status[17]=="up" && ak_key_status[32]=="down")))
{//fuer pan
ak_PanInPointx=evt.clientX
ak_PanInPointy=evt.clientY
ak_grid_pan_x_in=(ak_grid_pan_x*ak_grid_zoom)+ak_xy_etc_shift
ak_grid_pan_y_in=(ak_grid_pan_y*ak_grid_zoom)+ak_xy_etc_shift
ak_EditPoint_Size.x=Math.round(ak_getAbsolutePixel(ak_userspace_svg.getAttribute("width"),"width",window.innerWidth,window.innerHeight))
if(ak_EditPoint_Size.x<1) ak_EditPoint_Size.x=window.innerWidth
ak_EditPoint_Size.y=Math.round(ak_getAbsolutePixel(ak_userspace_svg.getAttribute("height"),"height",window.innerWidth,window.innerHeight))
if(ak_EditPoint_Size.y<1) ak_EditPoint_Size.y=window.innerWidth
ak_middle_button=true
ak_move_eval="ak_MoveEditRect(evt,'move','"+action+"')"
ak_MoveEditRect_flag=true
ak_MoveEditRect_flag_update_pan=true
ak_panLine.setAttribute("x1",ak_PanInPointx)
ak_panLine.setAttribute("y1",ak_PanInPointy)
ak_panLine.setAttribute("x2",ak_PanInPointx)
ak_panLine.setAttribute("y2",ak_PanInPointy)
ak_panLine.setAttribute("visibility","visible")
ak_panLine1.setAttribute("x1",ak_grid_pan_x_in)
ak_panLine1.setAttribute("y1",ak_grid_pan_y_in)
ak_panLine1.setAttribute("x2",ak_grid_pan_x_in+(ak_EditPoint_Size.x*ak_grid_zoom))
ak_panLine1.setAttribute("y2",ak_grid_pan_y_in)
ak_panLine1.setAttribute("visibility","visible")
ak_panLine2.setAttribute("x1",ak_grid_pan_x_in)
ak_panLine2.setAttribute("y1",ak_grid_pan_y_in)
ak_panLine2.setAttribute("x2",ak_grid_pan_x_in)
ak_panLine2.setAttribute("y2",ak_grid_pan_y_in+(ak_EditPoint_Size.y*ak_grid_zoom))
ak_panLine2.setAttribute("visibility","visible")
ak_panLine3.setAttribute("x1",ak_grid_pan_x_in+(ak_EditPoint_Size.x*ak_grid_zoom))
ak_panLine3.setAttribute("y1",ak_grid_pan_y_in+(ak_EditPoint_Size.y*ak_grid_zoom))
ak_panLine3.setAttribute("x2",ak_grid_pan_x_in+(ak_EditPoint_Size.x*ak_grid_zoom))
ak_panLine3.setAttribute("y2",ak_grid_pan_y_in)
ak_panLine3.setAttribute("visibility","visible")
ak_panLine4.setAttribute("x1",ak_grid_pan_x_in+(ak_EditPoint_Size.x*ak_grid_zoom))
ak_panLine4.setAttribute("y1",ak_grid_pan_y_in+(ak_EditPoint_Size.y*ak_grid_zoom))
ak_panLine4.setAttribute("x2",ak_grid_pan_x_in)
ak_panLine4.setAttribute("y2",ak_grid_pan_y_in+(ak_EditPoint_Size.y*ak_grid_zoom))
ak_panLine4.setAttribute("visibility","visible")
return
}
ak_MoveEditRect_flag_update_pan=false
if(ak_edit_gradient_flag) {ak_pathAddPoint=false; ak_set_path_point=false}
ak_transform_in=ak_object2update.getAttribute("transform")
if (evt.getButton==1) ak_middle_button=true //return // middle button
else ak_middle_button=false
ak_MoveEditRect_flag_update=false
ak_MoveEditRect_flag=true;
if (evt.getButton==0 && ak_key_status[32]=="up" && !/gradient/.test(action)) ak_control_point_index=point_nr // sonst alten wert belassen
if(evt.ctrlKey()) ak_rotate_action_down="down"
else ak_rotate_action_down="up"
ak_PanInPointx=evt.clientX // fuer Pan nicht matrizieren
ak_PanInPointy=evt.clientY
ak_mouse_changed_x=ak_PanInPointx // check fuer screen update
ak_mouse_changed_y=ak_PanInPointy        
if(action=="aniDuration")
{
ak_rectInVal=ak_getObject(ak_animate2update).getAttribute("dur")
if(ak_rectInVal=="indefinite") ak_rectInVal=2
else ak_rectInVal=ak_checkTime(ak_rectInVal)
if(isNaN(ak_rectInVal)) ak_rectInVal=2
ak_move_eval="ak_MoveEditRect(evt,'move','"+action+"',"+point_nr+")"
return
}
ak_EditPoint.x=ak_PanInPointx
ak_EditPoint.y=ak_PanInPointy
var ak_tmp_object=ak_objEdit
try{ak_tmp_object.getBBox.x}catch(error){ak_tmp_object=ak_object2update}
try{ak_tmp_object.getBBox.x}catch(error){ak_tmp_object=document.getElementById("ak_no_selection")}
if(ak_object2update.tagName=="use")
{
ak_bbox_center.x=ak_bbox_center_translate.x
ak_bbox_center.y=ak_bbox_center_translate.y
}
else
{
ak_bbox_center.x=ak_tmp_object.getBBox.x+(ak_tmp_object.getBBox.width/2)
ak_bbox_center.y=ak_tmp_object.getBBox.y+(ak_tmp_object.getBBox.height/2)
ak_bbox_center_translate.x=ak_bbox_center.x
ak_bbox_center_translate.y=ak_bbox_center.y
}
ak_bbox_center=ak_bbox_center.matrixTransform(ak_object2update_CTM) // matrizieren um platz auf der canvas zu orten nicht inverse
ak_bbox_upperleft.x=ak_tmp_object.getBBox.x
ak_bbox_upperleft.y=ak_tmp_object.getBBox.y
ak_bbox_upperleft=ak_bbox_upperleft.matrixTransform(ak_object2update_CTM) // matrizieren um platz auf der canvas zu orten nicht inverse
ak_bbox_lowerright.x=ak_tmp_object.getBBox.x+(ak_tmp_object.getBBox.width)
ak_bbox_lowerright.y=ak_tmp_object.getBBox.y+(ak_tmp_object.getBBox.height)
ak_bbox_lowerright=ak_bbox_lowerright.matrixTransform(ak_object2update_CTM) // matrizieren um platz auf der canvas zu orten nicht inverse
ak_grid_pan_x_in=ak_grid_pan_x
ak_grid_pan_y_in=ak_grid_pan_y
try{ak_EditPoint=ak_EditPoint.matrixTransform(ak_object2update_CTM.inverse)}
catch(error)
{
ak_object2update.setAttribute('transform','')
ak_object2update_CTM=ak_svgroot.createSVGMatrix()
}
ak_EditPoint_BBox.x=ak_tmp_object.getBBox.x
ak_EditPoint_BBox.y=ak_tmp_object.getBBox.y
ak_EditPoint_Size.x=ak_tmp_object.getBBox.width
ak_EditPoint_Size.y=ak_tmp_object.getBBox.height
if(action=="xChannelSelector")
{
ak_push2undoTrue()
ak_fe2edit.setAttribute("xChannelSelector",point_nr)
action="filter_feScale"
point_nr=undefined
ak_MoveEditRect_flag_update=true
ak_gradientEdit=true
}
else if(action=="yChannelSelector")
{
ak_push2undoTrue()
ak_fe2edit.setAttribute("yChannelSelector",point_nr)
action="filter_feScale"
point_nr=undefined
ak_MoveEditRect_flag_update=true
ak_gradientEdit=true
}
if(action=="gradient_add"  && ak_key_status[88]!="down"  && ak_key_status[17]!="down")
{
ak_gradientEdit=true
var ak_tmp_EditPoint=ak_EditPoint
ak_tmp_EditPoint=ak_tmp_EditPoint.matrixTransform(ak_gradient_matrix.inverse)
var ak_tmp_x=ak_tmp_EditPoint.x-ak_gradient_vector_start.x
var ak_tmp_y=ak_tmp_EditPoint.y-ak_gradient_vector_start.y
var ak_tmp_offset=Math.pow((Math.pow(ak_tmp_x,2)+Math.pow(ak_tmp_y,2)),0.5)
var ak_tmp_vector_length=Math.pow((Math.pow(ak_gradient_vector.x,2)+Math.pow(ak_gradient_vector.y,2)),0.5)
var ak_tmp_angle=Math.atan2(ak_tmp_y,ak_tmp_x)
var ak_tmp_angle_vector=Math.atan2(ak_gradient_vector.y,ak_gradient_vector.x)
ak_tmp_offset=(ak_tmp_offset*Math.cos(ak_tmp_angle_vector-ak_tmp_angle))/ak_tmp_vector_length
var ak_tmp_off_offset=ak_stop_offset[point_nr]-ak_tmp_offset
var ak_tmp_off_ganz=ak_stop_offset[point_nr]-ak_stop_min[point_nr]
ak_stop_offset[point_nr]=ak_tmp_offset
if(ak_gradient_stop_index==-1)
{
var ak_tmp_color=ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")
var ak_tmp_opacity=1
}
else if(ak_last_stop[point_nr])
{
var ak_tmp_color=ak_stop_color[ak_previous_stop[point_nr]]
var ak_tmp_opacity=ak_stop_opacity[ak_previous_stop[point_nr]]
}
else
{
if(ak_stop_color[ak_previous_stop[point_nr]]==ak_stop_color[point_nr] && ak_stop_opacity[ak_previous_stop[point_nr]]==ak_stop_opacity[point_nr])
{ // wenn previous color und opacity gleich
var ak_tmp_color=ak_stop_color[ak_previous_stop[point_nr]]
var ak_tmp_opacity=ak_stop_opacity[ak_previous_stop[point_nr]]
}
else
{
var ak_tmp_from_prev=ak_tmp_off_offset/ak_tmp_off_ganz
var ak_tmp_own=1-ak_tmp_from_prev
var ak_r_own=parseInt("0x"+ak_stop_color[point_nr].substring(1,3))*ak_tmp_own
var ak_g_own=parseInt("0x"+ak_stop_color[point_nr].substring(3,5))*ak_tmp_own
var ak_b_own=parseInt("0x"+ak_stop_color[point_nr].substring(5,7))*ak_tmp_own
var ak_r_prev=parseInt("0x"+ak_stop_color[ak_previous_stop[point_nr]].substring(1,3))*ak_tmp_from_prev
var ak_g_prev=parseInt("0x"+ak_stop_color[ak_previous_stop[point_nr]].substring(3,5))*ak_tmp_from_prev
var ak_b_prev=parseInt("0x"+ak_stop_color[ak_previous_stop[point_nr]].substring(5,7))*ak_tmp_from_prev
ak_r_own=(Math.round(ak_r_own+ak_r_prev)>255?255:Math.round(ak_r_own+ak_r_prev)).toString(16)
ak_g_own=(Math.round(ak_g_own+ak_g_prev)>255?255:Math.round(ak_g_own+ak_g_prev)).toString(16)
ak_b_own=(Math.round(ak_b_own+ak_b_prev)>255?255:Math.round(ak_b_own+ak_b_prev)).toString(16)
ak_r_own=(ak_r_own.length==1)?("0"+ak_r_own):ak_r_own
ak_g_own=(ak_g_own.length==1)?("0"+ak_g_own):ak_g_own
ak_b_own=(ak_b_own.length==1)?("0"+ak_b_own):ak_b_own
var ak_tmp_color="#"+ak_r_own+ak_g_own+ak_b_own
var ak_tmp_opacity=ak_round((ak_stop_opacity[point_nr]*ak_tmp_own)+(ak_stop_opacity[ak_previous_stop[point_nr]]*ak_tmp_from_prev),100)
}
}
var ak_tmp_spaces=""
var ak_tmp_array=ak_which_nodeNr(ak_gradient2edit).split(",").length
for(var i=0;i<ak_tmp_array;i++){ak_tmp_spaces+="  "}
var ak_new_stopNode='<stop offset="'+ak_round(ak_tmp_offset*100,10)+'%" style="stop-color:'+ak_tmp_color+';stop-opacity:'+ak_tmp_opacity+'"/>'
if(ak_gradient_stop[point_nr]==undefined)
{
ak_appendChild('\n  '+ak_tmp_spaces+ak_new_stopNode+"\n"+ak_tmp_spaces,ak_gradient2edit)
point_nr++
ak_gradient_stop[point_nr]=ak_gradient2edit.lastChild.previousSibling
ak_stop_min[point_nr]=ak_stop_min[point_nr-1]
}
else
{
if(ak_gradient_stop[point_nr].previousSibling=="[object Text]")
{
ak_insertBefore('\n  '+ak_tmp_spaces+ak_new_stopNode,ak_gradient_stop[point_nr])
ak_gradient_stop[point_nr]=ak_gradient2edit.childNodes.item(point_nr)
}
else
{
ak_insertBefore('\n  '+ak_tmp_spaces+ak_new_stopNode,ak_gradient_stop[point_nr])
point_nr++
ak_gradient_stop[point_nr]=ak_gradient2edit.childNodes.item(point_nr)
ak_stop_min[point_nr]=ak_stop_min[point_nr-1]
}
}
ak_control_point_index=point_nr
ak_lastGradientIndex=ak_gradient_stop_index
ak_MoveEditRect_flag_update=true
action="gradient_stop"
}
if(action=="gradient_stop" && ak_key_status[88]=="down")
{ // delete gradient
ak_gradientEdit=true
ak_noClick=true
eval("ak_delete_nodeNr("+ak_which_nodeNr(ak_gradient_stop[point_nr])+")")
ak_MoveEditRect_flag_update=true
ak_gradient_stop_index=-1
ak_lastGradientIndex=ak_gradient_stop_index
action="gradient_add"
return
}
else if(action=="gradient_stop")
{
ak_gradientEdit=true
ak_gradient_stop_index=point_nr
ak_lastGradientIndex=ak_gradient_stop_index
var ak_tmp_ox=(ak_stop_offset[ak_gradient_stop_index]*ak_gradient_vector.x)+ak_gradient_vector_start.x
var ak_tmp_oy=(ak_stop_offset[ak_gradient_stop_index]*ak_gradient_vector.y)+ak_gradient_vector_start.y
var ak_tmp_set=document.getElementById('ak_gradient_line2')
ak_tmp_set.setAttribute("x1",(ak_tmp_ox+ak_gradient_vector_90.x))
ak_tmp_set.setAttribute("y1",(ak_tmp_oy+ak_gradient_vector_90.y))
ak_tmp_set.setAttribute("x2",(ak_tmp_ox-ak_gradient_vector_90.x))
ak_tmp_set.setAttribute("y2",(ak_tmp_oy-ak_gradient_vector_90.y))
ak_stop_color[ak_gradient_stop_index]=ak_SetGetRm_styleValue(ak_gradient_stop[ak_gradient_stop_index],"stop-color","get","no_cout")
ak_set_hex2hue(evt,ak_stop_color[ak_gradient_stop_index],"set_stop_hex")
ak_init_slider("stop-opacity")
}
if(ak_edit_which_attribute=="matrix")
{
ak_translate_invalue=ak_SetGetRm_transformValue(ak_object2update,"translate","get")
if(ak_translate_invalue=="false") ak_translate_invalue="0,0"
ak_matrix_invalue=ak_SetGetRm_transformValue(ak_object2update,"matrix","get")
if(ak_matrix_invalue=="false") ak_matrix_invalue="1,0,0,1,0,0"
ak_rotate_invalue=ak_SetGetRm_transformValue(ak_object2update,"rotate","get")
if(ak_rotate_invalue=="false")
{
ak_rotate_invalue="0,"+ak_round(ak_EditPoint_BBox.x+(ak_EditPoint_Size.x/2),100)+','+ak_round(ak_EditPoint_BBox.y+(ak_EditPoint_Size.y/2),100)
ak_rotate_inflag=false
}
else ak_rotate_inflag=true
if(!/,/.test(ak_rotate_invalue)) ak_rotate_invalue+=',0,0'
ak_scale_invalue=ak_SetGetRm_transformValue(ak_object2update,"scale","get")
if(ak_scale_invalue=="false")
{
ak_scale_invalue="1,1"
ak_scale_inflag=false
}
else
{
ak_scale_inflag=true
if(!/,/.test(ak_scale_invalue)) ak_scale_invalue+=','+ak_scale_invalue
}
}
switch(ak_obj_data[0])
{
case "textPath":
var ak_tmp_offset=ak_object2update.getAttribute("startOffset").replace(/^ +| +$/g,"")
ak_EditPoint_enter.x=parseFloat(ak_tmp_offset)
ak_EditPoint_enter.x=isNaN(ak_EditPoint_enter.x)?0:ak_EditPoint_enter.x
if(/%$/.test(ak_tmp_offset))
{
var ak_tmp_path=ak_object2update.getAttribute("xlink:href").replace(/^#/g,"")
var ak_tmp_pathObject=document.getElementById(ak_tmp_path)
var ak_tmp_length=0
try{ak_tmp_length=ak_tmp_pathObject.getTotalLength()}catch(error){}
ak_EditPoint_enter.x=(ak_EditPoint_enter.x*ak_tmp_length)/100
}
ak_EditPoint_enter.y=parseFloat(ak_SetGetRm_styleValue(ak_object2update,"baseline-shift","get","no_cout"))
ak_EditPoint_enter.y=isNaN(ak_EditPoint_enter.y)?0:(ak_EditPoint_enter.y*-1)
ak_font_size_inText=ak_SetGetRm_styleValue(ak_object2update,"font-size","get","no_cout")
break;
case "tspan":
case "tref":
ak_font_size_inText=ak_SetGetRm_styleValue(ak_object2update,"font-size","get","no_cout")
var ak_tmp2_object=ak_object2update
ak_EditPoint_enter.x=parseFloat(ak_tmp2_object.getAttribute("x"))
ak_EditPoint_enter.y=parseFloat(ak_tmp2_object.getAttribute("y"))
if(isNaN(ak_EditPoint_enter.x) || isNaN(ak_EditPoint_enter.y))
{
while(ak_tmp2_object=="[object SVGTSpanElement]" || ak_tmp2_object=="[object SVGTRefElement]")
{
ak_tmp2_object=ak_tmp2_object.parentNode
}
if(ak_tmp2_object=="[object SVGTextPathElement]")
{
ak_EditPoint_enter.x=isNaN(ak_EditPoint_enter.x)?0:ak_EditPoint_enter.x
ak_EditPoint_enter.y=isNaN(ak_EditPoint_enter.y)?0:ak_EditPoint_enter.y
}
else
{
ak_EditPoint_enter.x=ak_EditPoint.x
ak_EditPoint_enter.y=ak_EditPoint.y
}
}
break
case "text":
ak_EditPoint_enter.x=ak_obj_data[2]
ak_EditPoint_enter.y=ak_obj_data[3]
ak_font_size_inText=ak_SetGetRm_styleValue(ak_object2update,"font-size","get","no_cout")
break;
case "line":
ak_EditPoint_enter.x=ak_obj_data[6];
ak_EditPoint_enter.y=ak_obj_data[7];
ak_EditPoint2_enter.x=ak_obj_data[8];
ak_EditPoint2_enter.y=ak_obj_data[9];
break;
case "rect":
ak_EditPoint_enter.x=ak_obj_data[2]
ak_EditPoint_enter.y=ak_obj_data[3]
ak_EditPoint_enter_r.x=ak_obj_data[13]
ak_EditPoint_enter_r.y=ak_obj_data[14]
break;
case "use":
ak_EditPoint_enter.x=ak_obj_data[2]
ak_EditPoint_enter.y=ak_obj_data[3]
ak_EditPoint2_enter.x=ak_obj_data[4];
ak_EditPoint2_enter.y=ak_obj_data[5];
break;
case "circle":
ak_EditPoint_enter.x=ak_obj_data[10];
ak_EditPoint_enter.y=ak_obj_data[11];
break;
case "ellipse":
ak_EditPoint_enter.x=ak_obj_data[10];
ak_EditPoint_enter.y=ak_obj_data[11];
break;
// polyline und polygon set in ak_clickset_obj2update
case "path":
if(ak_middle_button || ak_key_status[32]=="down") break
if(ak_edit_which_attribute=="xy_etc")
{
ak_set_path_control_points(evt,ak_control_point_index)
ak_EditArray_enter=ak_EditArray_MCZ
}
else break
if(action=="path_stroke") // delete or set Z
{
if(ak_key_status[88]=="down" && ak_EditArray_MCZ[point_nr]=="Z") // delete Z
{
ak_EditArray_MCZ.splice(point_nr,1)
ak_EditArray_work.splice(point_nr,1)
ak_obj_data[19]=ak_EditArray_work.join(" ")
ak_object2update.setAttribute("d",ak_obj_data[19]);
ak_MoveEditRect_flag_update=true
if(ak_path_attr) ak_updateD()
return
}
if(!/down/.test(ak_key_status.join()) && !ak_pathAddPoint && (ak_EditArray_MCZ[point_nr]=="Z" || ak_EditArray_MCZ[point_nr]=="M" || point_nr==ak_EditArray_MCZ.length)) // set Z
{
if(evt.altKey())
{
for(var i=point_nr-1;i>=0;i--)
{
if(ak_EditArray_MCZ[i]=="M") break
}
ak_EditArray_MCZ[point_nr-2]=ak_EditArray_MCZ[i+1]
ak_EditArray_MCZ[point_nr-1]=ak_EditArray_MCZ[i+2]
ak_EditArray_work[point_nr-2]=ak_EditArray_MCZ[i+1]
ak_EditArray_work[point_nr-1]=ak_EditArray_MCZ[i+2]
}
else if(ak_EditArray_MCZ[point_nr]!="Z")
{
ak_EditArray_MCZ.splice(point_nr,0,"Z")
ak_EditArray_work.splice(point_nr,0,"Z")
}
ak_obj_data[19]=ak_EditArray_work.join(" ")
ak_object2update.setAttribute("d",ak_obj_data[19]);
ak_MoveEditRect_flag_update=true
if(ak_path_attr) ak_updateD()
return
}
if(!/down/.test(ak_key_status.join()) && !ak_pathAddPoint)
{
action="translate"
}
}
var ak_tmp_pathX=ak_round(ak_EditPoint.x,ak_precision)
var ak_tmp_pathY=ak_round(ak_EditPoint.y,ak_precision)
if(action=="path_point" && (ak_key_status[77]=="down" || ak_key_status[76]=="down" || ak_set_path_point==76 || ak_key_status[81]=="down" || ak_set_path_point==81 || ak_key_status[67]=="down" || ak_set_path_point==67))
{
action="translate"
if(ak_EditArray_MCZ[point_nr]=="C")
{
ak_tmp_pathX=ak_EditArray_MCZ[point_nr+5]
ak_tmp_pathY=ak_EditArray_MCZ[point_nr+6]
}
else if(ak_EditArray_MCZ[point_nr]=="Q")
{
ak_tmp_pathX=ak_EditArray_MCZ[point_nr+3]
ak_tmp_pathY=ak_EditArray_MCZ[point_nr+4]
}
else if(ak_EditArray_MCZ[point_nr]=="A")
{
ak_tmp_pathX=ak_EditArray_MCZ[point_nr+6]
ak_tmp_pathY=ak_EditArray_MCZ[point_nr+7]
}
else
{
ak_tmp_pathX=ak_EditArray_MCZ[point_nr+1]
ak_tmp_pathY=ak_EditArray_MCZ[point_nr+2]
}
}
if(action=="path_point")
{
if(ak_key_status[88]=="down") // X fuer delete point    #######################################
{
switch(ak_EditArray_MCZ[point_nr])
{
case "M":
if(evt.shiftKey)
{
for(var i=point_nr+1;i<ak_EditArray_MCZ.length;i++)
{
if(ak_EditArray_MCZ[i]=="M") break
}
if(i==ak_EditArray_MCZ.length && point_nr==0)
{
ak_EditArray_MCZ.splice(point_nr+3,i-point_nr-3)
ak_EditArray_work.splice(point_nr+3,i-point_nr-3)
}
else
{
ak_EditArray_MCZ.splice(point_nr,i-point_nr)
ak_EditArray_work.splice(point_nr,i-point_nr)
}
}
else if(point_nr!=0 || ak_EditArray_MCZ[3]=='M')
{
ak_EditArray_MCZ.splice(point_nr,3)
ak_EditArray_work.splice(point_nr,3)
}
break
case "L":
ak_EditArray_MCZ.splice(point_nr,3)
ak_EditArray_work.splice(point_nr,3)
break
case "Q":
if(ak_EditArray_MCZ[point_nr+5]=="C")
{
ak_EditArray_MCZ[point_nr+6]=ak_EditArray_MCZ[point_nr+1]
ak_EditArray_MCZ[point_nr+7]=ak_EditArray_MCZ[point_nr+2]
}
ak_EditArray_MCZ.splice(point_nr,5)
ak_EditArray_work.splice(point_nr,5)
break
case "C":
if(ak_EditArray_MCZ[point_nr+7]=="C")
{
ak_EditArray_MCZ[point_nr+8]=ak_EditArray_MCZ[point_nr+1]
ak_EditArray_MCZ[point_nr+9]=ak_EditArray_MCZ[point_nr+2]
}
ak_EditArray_MCZ.splice(point_nr,7)
ak_EditArray_work.splice(point_nr,7)
break
case "A":
ak_EditArray_MCZ.splice(point_nr,8)
ak_EditArray_work.splice(point_nr,8)
break
}
ak_obj_data[19]=ak_EditArray_work.join(" ")
if(ak_EditArray_work.length==0) {try{ak_object2update.removeAttribute('d')}catch(error){}}
else ak_object2update.setAttribute("d",ak_obj_data[19])
ak_MoveEditRect_flag_update=true
if(ak_path_attr) ak_updateD()
return
}
else ak_set_path_control_points(evt,point_nr)
break
}
if(action=="control_point_1" || action=="control_point_2")
{
ak_control_2x=parseFloat(document.getElementById("ak_path_control_c2").getAttribute("cx"))
ak_control_2y=parseFloat(document.getElementById("ak_path_control_c2").getAttribute("cy"))
break
}
if(ak_key_status[77]=="down") // M create point  ###########################################
{
if(action=="path_stroke")
{
action="path_point"
ak_EditArray_MCZ.splice(point_nr,0,"M",ak_tmp_pathX,ak_tmp_pathY)
ak_EditArray_work.splice(point_nr,0,"M",ak_tmp_pathX,ak_tmp_pathY)
if(ak_EditArray_MCZ[point_nr+3]=="C")
{
ak_EditArray_MCZ[point_nr+4]=ak_tmp_pathX
ak_EditArray_MCZ[point_nr+5]=ak_tmp_pathY
ak_EditArray_work[point_nr+4]=ak_tmp_pathX
ak_EditArray_work[point_nr+5]=ak_tmp_pathY
}
}
else
{
ak_control_point_index=ak_EditArray_enter.length
point_nr=ak_control_point_index
action="path_point"
ak_EditArray_MCZ.push("M")
ak_EditArray_MCZ.push(ak_tmp_pathX)
ak_EditArray_MCZ.push(ak_tmp_pathY)
ak_EditArray_work.push("M")
ak_EditArray_work.push(ak_tmp_pathX)
ak_EditArray_work.push(ak_tmp_pathY)
}
ak_obj_data[19]=ak_EditArray_work.join(" ")
ak_object2update.setAttribute("d",ak_obj_data[19]);
ak_MoveEditRect_flag_update=true
if(ak_path_attr) ak_updateD()
ak_set_path_control_points(evt,ak_control_point_index)
break
}
if(ak_key_status[76]=="down" || ak_set_path_point==76) // L create point  ###########################################
{
if(action=="path_stroke")
{
action="path_point"
ak_EditArray_MCZ.splice(point_nr,0,"L",ak_tmp_pathX,ak_tmp_pathY)
ak_EditArray_work.splice(point_nr,0,"L",ak_tmp_pathX,ak_tmp_pathY)
if(ak_EditArray_MCZ[point_nr+3]=="C")
{
ak_EditArray_MCZ[point_nr+4]=ak_tmp_pathX
ak_EditArray_MCZ[point_nr+5]=ak_tmp_pathY
ak_EditArray_work[point_nr+4]=ak_tmp_pathX
ak_EditArray_work[point_nr+5]=ak_tmp_pathY
}
}
else
{
ak_control_point_index=ak_EditArray_enter.length
point_nr=ak_control_point_index
action="path_point"
ak_EditArray_MCZ.push("L")
ak_EditArray_MCZ.push(ak_tmp_pathX)
ak_EditArray_MCZ.push(ak_tmp_pathY)
ak_EditArray_work.push("L")
ak_EditArray_work.push(ak_tmp_pathX)
ak_EditArray_work.push(ak_tmp_pathY)
}
ak_obj_data[19]=ak_EditArray_work.join(" ")
ak_object2update.setAttribute("d",ak_obj_data[19]);
ak_MoveEditRect_flag_update=true
if(ak_path_attr && action=="path_stroke") ak_updateD()
else if(ak_path_attr) ak_updateD('reverse')
ak_set_path_control_points(evt,ak_control_point_index)
break
}
if(ak_key_status[81]=="down" || ak_set_path_point==81) // Q create point  ###########################################
{
if(action=="path_stroke")
{
ak_EditArray_MCZ.splice(point_nr,0,"Q",ak_tmp_pathX,ak_tmp_pathY,ak_tmp_pathX,ak_tmp_pathY)
ak_EditArray_work.splice(point_nr,0,"Q",ak_tmp_pathX,ak_tmp_pathY,ak_tmp_pathX,ak_tmp_pathY)
}
else
{
ak_control_point_index=ak_EditArray_enter.length
point_nr=ak_control_point_index
ak_EditArray_MCZ.push("Q")
ak_EditArray_MCZ.push(ak_tmp_pathX)
ak_EditArray_MCZ.push(ak_tmp_pathY)
ak_EditArray_MCZ.push(ak_tmp_pathX)
ak_EditArray_MCZ.push(ak_tmp_pathY)
ak_EditArray_work.push("Q")
ak_EditArray_work.push(ak_tmp_pathX)
ak_EditArray_work.push(ak_tmp_pathY)
ak_EditArray_work.push(ak_tmp_pathX)
ak_EditArray_work.push(ak_tmp_pathY)
}
if(ak_EditArray_MCZ[point_nr+5]=="Q" || ak_EditArray_MCZ[point_nr+5]=="C")
{
ak_EditArray_MCZ[point_nr+6]=ak_tmp_pathX
ak_EditArray_MCZ[point_nr+7]=ak_tmp_pathY
ak_EditArray_work[point_nr+6]=ak_tmp_pathX
ak_EditArray_work[point_nr+7]=ak_tmp_pathY
}
ak_obj_data[19]=ak_EditArray_work.join(" ")
ak_object2update.setAttribute("d",ak_obj_data[19]);
ak_MoveEditRect_flag_update=true
if(ak_path_attr && action=="path_stroke") ak_updateD()
else if(ak_path_attr) ak_updateD('reverse')
action="control_point_2"
ak_set_path_control_points(evt,ak_control_point_index)
ak_control_2x=parseFloat(document.getElementById("ak_path_control_c2").getAttribute("cx"))
ak_control_2y=parseFloat(document.getElementById("ak_path_control_c2").getAttribute("cy"))
break
}
if(ak_key_status[67]=="down" || ak_set_path_point==67) // C create point  ###########################################
{
ak_tmp_pathX=ak_round(ak_tmp_pathX,ak_precision)
ak_tmp_pathY=ak_round(ak_tmp_pathY,ak_precision)
if(action=="path_stroke")
{
ak_EditArray_MCZ.splice(point_nr,0,"C")
ak_EditArray_work.splice(point_nr,0,"C")
if(ak_EditArray_MCZ[point_nr-1]=="Z")
{
ak_EditArray_MCZ.splice((point_nr+1),0,ak_tmp_pathX,ak_tmp_pathY)
ak_EditArray_work.splice((point_nr+1),0,ak_tmp_pathX,ak_tmp_pathY)
}
else if(ak_EditArray_MCZ[point_nr+1]=="C")
{
ak_EditArray_MCZ.splice((point_nr+1),0,ak_EditArray_MCZ[point_nr+2])
ak_EditArray_MCZ.splice((point_nr+2),0,ak_EditArray_MCZ[point_nr+4]) // 1 mehr auf MCZ
ak_EditArray_work.splice((point_nr+1),0,ak_EditArray_MCZ[point_nr+4]) // nun bereits 2 mehr auf MCZ
ak_EditArray_work.splice((point_nr+2),0,ak_EditArray_MCZ[point_nr+5])
}
else
{
ak_EditArray_MCZ.splice((point_nr+1),0,ak_EditArray_MCZ[point_nr-2])
ak_EditArray_MCZ.splice((point_nr+2),0,ak_EditArray_MCZ[point_nr-1])
ak_EditArray_work.splice((point_nr+1),0,ak_EditArray_MCZ[point_nr-2])
ak_EditArray_work.splice((point_nr+2),0,ak_EditArray_MCZ[point_nr-1])
}
ak_EditArray_MCZ.splice((point_nr+3),0,ak_tmp_pathX,ak_tmp_pathY,ak_tmp_pathX,ak_tmp_pathY)
ak_EditArray_work.splice((point_nr+3),0,ak_tmp_pathX,ak_tmp_pathY,ak_tmp_pathX,ak_tmp_pathY)
}
else
{
ak_control_point_index=ak_EditArray_enter.length
point_nr=ak_control_point_index
ak_EditArray_MCZ.push("C")
ak_EditArray_work.push("C")
if(ak_EditArray_MCZ[point_nr-1]=="Z")
{
for(var i=point_nr-2;i>=0;i--)
{
if(ak_EditArray_MCZ[i]=="M") break
}
ak_EditArray_MCZ.push(ak_EditArray_MCZ[i+1])
ak_EditArray_MCZ.push(ak_EditArray_MCZ[i+2])
ak_EditArray_work.push(ak_EditArray_MCZ[i+1])
ak_EditArray_work.push(ak_EditArray_MCZ[i+2])
}
else if(ak_EditArray_MCZ[point_nr-7]=="C" || ak_EditArray_MCZ[point_nr-5]=="Q")
{
ak_EditArray_MCZ.push(ak_round((2*ak_EditArray_MCZ[point_nr-2])-ak_EditArray_MCZ[point_nr-4],ak_precision))
ak_EditArray_MCZ.push(ak_round((2*ak_EditArray_MCZ[point_nr-1])-ak_EditArray_MCZ[point_nr-3],ak_precision))
ak_EditArray_work.push(ak_EditArray_MCZ[point_nr+1])
ak_EditArray_work.push(ak_EditArray_MCZ[point_nr+2])
}
else
{
ak_EditArray_MCZ.push(ak_EditArray_MCZ[point_nr-2])
ak_EditArray_MCZ.push(ak_EditArray_MCZ[point_nr-1])
ak_EditArray_work.push(ak_EditArray_MCZ[point_nr-2])
ak_EditArray_work.push(ak_EditArray_MCZ[point_nr-1])
}
ak_EditArray_MCZ.push(ak_tmp_pathX)
ak_EditArray_MCZ.push(ak_tmp_pathY)
ak_EditArray_MCZ.push(ak_tmp_pathX)
ak_EditArray_MCZ.push(ak_tmp_pathY)
ak_EditArray_work.push(ak_tmp_pathX)
ak_EditArray_work.push(ak_tmp_pathY)
ak_EditArray_work.push(ak_tmp_pathX)
ak_EditArray_work.push(ak_tmp_pathY)
}
if(ak_EditArray_MCZ[point_nr+7]=="C" || ak_EditArray_MCZ[point_nr+7]=="Q")
{
ak_EditArray_MCZ[point_nr+8]=ak_tmp_pathX
ak_EditArray_MCZ[point_nr+9]=ak_tmp_pathY
ak_EditArray_work[point_nr+8]=ak_tmp_pathX
ak_EditArray_work[point_nr+9]=ak_tmp_pathY
}
ak_obj_data[19]=ak_EditArray_work.join(" ")
ak_object2update.setAttribute("d",ak_obj_data[19]);
ak_MoveEditRect_flag_update=true
if(ak_path_attr && action=="path_stroke") ak_updateD()
else if(ak_path_attr) ak_updateD('reverse')
action="control_point_2"
ak_set_path_control_points(evt,ak_control_point_index)
}
ak_control_2x=parseFloat(document.getElementById("ak_path_control_c2").getAttribute("cx"))
ak_control_2y=parseFloat(document.getElementById("ak_path_control_c2").getAttribute("cy"))
break
case "svg":
ak_EditPoint_enter.x=ak_obj_data[2]
ak_EditPoint_enter.y=ak_obj_data[3]
ak_EditPoint_Size.x=ak_obj_data[4]
ak_EditPoint_Size.y=ak_obj_data[5]
break
case "a":
case "g":
case "clipPath":
ak_translate_invalue=ak_SetGetRm_transformValue(ak_object2update,"translate","get")
if(ak_translate_invalue=="false") ak_translate_invalue="0,0"
break
default:
if(ak_which_nodeNr(ak_object2update)==-1) break;
ak_EditPoint_enter.x=ak_tmp_object.getBBox.x
ak_EditPoint_enter.y=ak_tmp_object.getBBox.y
}
ak_move_eval="ak_MoveEditRect(evt,'move','"+action+"',"+point_nr+")"
if(action=="control_point_1" || action=="control_point_2") ak_selection('hide_keep_control')
else if(action=="gradient_control" || /pattern/.test(action) || (/filter/.test(action) && !/filter_txKerning|filter_txWordSpace|marker/.test(action))) ak_selection('hide_keep_gradient')
else if(action=="gradient_stop") {}
else if(action=="rotateCenter") ak_objRotateCenterPoint.setAttribute("visibility","visible")
else if(action=="keyTimes")
{
//ak_keyTimes_in=ak_keyTimes[point_nr]
ak_keyTimes_in=new Array
for(var i=0;i<ak_keyTimes.length;i++)
{
ak_keyTimes_in[i]=ak_keyTimes[i]
}
}
else if(action=="moveKeySplines")
{
ak_keySplineX_in=ak_keySplineX
ak_keySplineY_in=ak_keySplineY
}
else if(action=="editKeySplines")
{
if(ak_keySplineEditor>0)
{
ak_keySplines_in[0]=ak_keySplines[ak_keySplineEditor-1][2]
ak_keySplines_in[1]=ak_keySplines[ak_keySplineEditor-1][3]
}
ak_keySplines_in[2]=ak_keySplines[ak_keySplineEditor][0]
ak_keySplines_in[3]=ak_keySplines[ak_keySplineEditor][1]
ak_keySplines_in[4]=ak_keySplines[ak_keySplineEditor][2]
ak_keySplines_in[5]=ak_keySplines[ak_keySplineEditor][3]
if(ak_keySplineEditor<(ak_keySplines.length-1))
{
ak_keySplines_in[6]=ak_keySplines[ak_keySplineEditor+1][0]
ak_keySplines_in[7]=ak_keySplines[ak_keySplineEditor+1][1]
}
ak_keyObject=ak_getObject(ak_keyTimes_node)
}
else ak_selection('hide')
if(ak_middle_button || (ak_key_status[16]=="up" && ak_key_status[17]=="up" && ak_key_status[32]=="down"))
{
ak_selection('hide') // bei pan auch alles hiden
if(ak_object2update.tagName()=="svg") document.getElementById("ak_svg_outline").setAttribute("visibility","hidden")
}
return
}
// hier nun mousemove #################################################################
if(!ak_MoveEditRect_flag) return;
ak_point_2.x=evt.clientX;
ak_point_2.y=evt.clientY;
if(ak_point_2.x==ak_mouse_changed_x && ak_point_2.y==ak_mouse_changed_y) return // dann no nix macha
ak_mouse_changed_x=ak_point_2.x
ak_mouse_changed_y=ak_point_2.y
if(!ak_MoveEditRect_flag_update && action=="gradient_stop") ak_selection('hide_keep_gradient_stop')
ak_MoveEditRect_flag_update=true
ak_point_2_panx=ak_point_2.x
ak_point_2_pany=ak_point_2.y
ak_mouse_x=ak_point_2.x
ak_mouse_y=ak_point_2.y
var ak_tmpDeltaX=ak_mouse_x-ak_PanInPointx
var ak_tmpDeltaY=ak_mouse_y-ak_PanInPointy
ak_point_2=ak_point_2.matrixTransform(ak_object2update_CTM.inverse);
if (ak_middle_button || (ak_key_status[16]=="up" && ak_key_status[17]=="up" && ak_key_status[32]=="down"))
{// spacebar dann Pan
if(ak_turbo)
{
ak_panLine.setAttribute("x2",ak_mouse_x)
ak_panLine.setAttribute("y2",ak_mouse_y)


ak_panLine1.setAttribute("x1",ak_grid_pan_x_in+ak_tmpDeltaX)
ak_panLine1.setAttribute("y1",ak_grid_pan_y_in+ak_tmpDeltaY)
ak_panLine1.setAttribute("x2",ak_grid_pan_x_in+ak_tmpDeltaX+(ak_EditPoint_Size.x*ak_grid_zoom))
ak_panLine1.setAttribute("y2",ak_grid_pan_y_in+ak_tmpDeltaY)

ak_panLine2.setAttribute("x1",ak_grid_pan_x_in+ak_tmpDeltaX)
ak_panLine2.setAttribute("y1",ak_grid_pan_y_in+ak_tmpDeltaY)
ak_panLine2.setAttribute("x2",ak_grid_pan_x_in+ak_tmpDeltaX)
ak_panLine2.setAttribute("y2",ak_grid_pan_y_in+ak_tmpDeltaY+(ak_EditPoint_Size.y*ak_grid_zoom))

ak_panLine3.setAttribute("x1",ak_grid_pan_x_in+ak_tmpDeltaX+(ak_EditPoint_Size.x*ak_grid_zoom))
ak_panLine3.setAttribute("y1",ak_grid_pan_y_in+ak_tmpDeltaY+(ak_EditPoint_Size.y*ak_grid_zoom))
ak_panLine3.setAttribute("x2",ak_grid_pan_x_in+ak_tmpDeltaX+(ak_EditPoint_Size.x*ak_grid_zoom))
ak_panLine3.setAttribute("y2",ak_grid_pan_y_in+ak_tmpDeltaY)

ak_panLine4.setAttribute("x1",ak_grid_pan_x_in+ak_tmpDeltaX+(ak_EditPoint_Size.x*ak_grid_zoom))
ak_panLine4.setAttribute("y1",ak_grid_pan_y_in+ak_tmpDeltaY+(ak_EditPoint_Size.y*ak_grid_zoom))
ak_panLine4.setAttribute("x2",ak_grid_pan_x_in+ak_tmpDeltaX)
ak_panLine4.setAttribute("y2",ak_grid_pan_y_in+ak_tmpDeltaY+(ak_EditPoint_Size.y*ak_grid_zoom))
return
}
//ak_svg_x=-ak_getAbsolutePixel(ak_userspace_svg.getAttribute('x'),'x',window.innerWidth,window.innerHeight)
//ak_svg_y=-ak_getAbsolutePixel(ak_userspace_svg.getAttribute('y'),'y',window.innerWidth,window.innerHeight)
ak_MoveEditRect_flag_update_pan=true
ak_grid_pan_x=ak_grid_pan_x_in-parseInt((ak_PanInPointx-ak_point_2_panx)/ak_grid_zoom)
ak_grid_pan_y=ak_grid_pan_y_in-parseInt((ak_PanInPointy-ak_point_2_pany)/ak_grid_zoom)
document.getElementById("ak_internal_userSpace").setAttribute("transform",("matrix("+ak_grid_zoom+",0,0,"+ak_grid_zoom+","+(ak_xy_etc_shift+ak_grid_pan_x*ak_grid_zoom)+","+(ak_xy_etc_shift+ak_grid_pan_y*ak_grid_zoom)+")"));
// refresh grid
ak_userspace_svg.firstChild.setAttribute("style",ak_userspace_svg.firstChild.getAttribute("style"));
ak_write_grid_status(((ak_grid_pan_x*-1)+","+(ak_grid_pan_y*-1)+" | x"+ak_grid_zoom+" | "+ak_grid_on_flag))
return
}
if(ak_which_nodeNr(ak_object2update)==-1) return // nur pan zulassen
if (action=="path_point" || action=="control_point_1" || action=="control_point_2")
{
ak_MoveEditPathPoint(evt,mouse_flag,action,point_nr)
return
}
if (/gradient/.test(action)) {ak_MoveEditGradient(evt,mouse_flag,action,point_nr);ak_gradientEdit=true;return}
if (/pattern/.test(action)) {ak_MoveEditPattern(evt,mouse_flag,action,point_nr);ak_gradientEdit=true;return}
if (/filter/.test(action))
{
ak_MoveEditFilter(evt,mouse_flag,action,point_nr)
if(!/filter_txKerning|filter_txWordSpace|marker/.test(action)) ak_gradientEdit=true
return
}
if(action=="rotateCenter")
{
ak_MoveEditRect_flag_update=false
var ak_tmp_point=ak_svgroot.createSVGPoint()
ak_tmp_point.x=(ak_point_2.x-ak_EditPoint.x)
ak_tmp_point.y=(ak_point_2.y-ak_EditPoint.y)
ak_rotateMatrix.e=0
ak_rotateMatrix.f=0
ak_tmp_point=ak_tmp_point.matrixTransform(ak_rotateMatrix)
var ak_tmp_rotX=ak_round(ak_rotateX+ak_tmp_point.x,ak_precision)
var ak_tmp_rotY=ak_round(ak_rotateY+ak_tmp_point.y,ak_precision)
ak_SetGetRm_transformValue(document.getElementById("ak_rotateCenterPoint"),"translate",ak_tmp_rotX+","+ak_tmp_rotY,"no_cout")
ak_SetGetRm_transformValue(ak_object2update,"rotateCenter",ak_tmp_rotX+","+ak_tmp_rotY)
return
}
if(action=="aniDuration")
{
if(ak_rectInVal<0.2)
{
if(ak_tmpDeltaY<(-ak_rectInVal*1000)) ak_tmpDeltaY=(-ak_rectInVal*1000)
ak_rectOutVal=ak_rectInVal+(ak_tmpDeltaY/1000)
}
else
{
if(ak_tmpDeltaY<-200) ak_tmpDeltaY=-200
ak_rectOutVal=ak_rectInVal+(ak_tmpDeltaY*(ak_rectInVal/200))
}
ak_durSliderLine.setAttribute("y1",ak_tmpDeltaY)
ak_durSliderLine.setAttribute("y2",ak_tmpDeltaY)
ak_rectOutVal=ak_round(ak_rectOutVal,1000)
ak_durSliderText.firstChild.data=ak_hhmmss(ak_rectOutVal,"durSlider")
ak_up_action='aniDuration'
return
}
if(action=="keyTimes")
{
var ak_tmp_prec=200
ak_keyTimes[point_nr]=ak_round(ak_keyTimes_in[point_nr]+((ak_point_2_pany-ak_PanInPointy)/200),200)
if(ak_key_status[17]=="down")
{
if(ak_keyTimes[point_nr]<(point_nr/200)) ak_keyTimes[point_nr]=point_nr/200
if(ak_keyTimes[point_nr]>1) ak_keyTimes[point_nr]=1
var ak_tmp_ratio=ak_keyTimes[point_nr]/ak_keyTimes_in[point_nr]
for(var i=0;i<point_nr;i++)
{
ak_keyTimes[i]=ak_round(ak_keyTimes_in[i]*ak_tmp_ratio,ak_tmp_prec)
}
if(point_nr<ak_keyTimes.length-1)
{
if(ak_keyTimes[point_nr]==1)
{
for(var i=point_nr+1;i<ak_keyTimes.length;i++)
{
ak_keyTimes[i]=1
}
}
else
{
ak_tmp_ratio=(1-ak_keyTimes[point_nr])/(1-ak_keyTimes_in[point_nr])
for(var i=point_nr+1;i<ak_keyTimes.length;i++)
{
ak_keyTimes[i]=ak_round(1-((1-ak_keyTimes_in[i])*ak_tmp_ratio),ak_tmp_prec)
if(ak_keyTimes[i]>1) ak_keyTimes[i]=1
}
}
}
for(var i=ak_keyTimes.length-1;i>0;i--)
{
if(ak_keyTimes[i]<=ak_keyTimes[i-1]) ak_keyTimes[i-1]=ak_keyTimes[i]-(1/ak_tmp_prec)
if(ak_keyTimes[i-1]<0) ak_keyTimes[i-1]=0
}
for(var i=1;i<ak_keyTimes.length;i++)
{
if(ak_keyTimes[i]<=ak_keyTimes[i-1]) ak_keyTimes[i]=ak_keyTimes[i-1]+(1/ak_tmp_prec)
if(ak_keyTimes[i]>1) ak_keyTimes[i]=1
}
}
else
{
for(var i=1;i<ak_keyTimes.length;i++)
{
if(i!=point_nr) ak_keyTimes[i]=ak_keyTimes_in[i]
}
if(ak_keyTimes[point_nr]<=ak_keyTimes[point_nr-1]) ak_keyTimes[point_nr]=ak_keyTimes[point_nr-1]+0.005
}
if(point_nr==(ak_keyTimes.length-1))
{
if(ak_keyTimes[point_nr]>1) ak_keyTimes[point_nr]=1
}
else
{
if(ak_keyTimes[point_nr]>=ak_keyTimes[point_nr+1]) ak_keyTimes[point_nr]=ak_keyTimes[point_nr+1]-0.005
}
for(var i=1;i<ak_keyTimes.length;i++)
{
var ak_tmp=(5+(i*8))
if(i==(ak_keyTimes.length-1) && ak_tmp<28) ak_tmp=28
var ak_tmp_d='M 16 '+(76+(ak_keyTimes[i]*200))+' l '+ak_tmp+' 0 l 10 -5 l 0 10 l -10 -4'
var ak_tmp_timesSlider=document.getElementById("ak_g_keyTimes_"+i)
ak_tmp_timesSlider.setAttribute("d",ak_tmp_d)
}
ak_getObject(ak_keyTimes_node).setAttribute("keyTimes",ak_keyTimes.join("; "))
ak_MoveEditRect_flag_update=false
ak_tagName_cout='keyTimes="'+ak_keyTimes.join("; ")+'"'
ak_cout(ak_tagName_cout)
ak_up_action='keyTimes'
return
}
if(action=="moveKeySplines")
{
ak_MoveEditRect_flag_update=false
ak_keySplineX=ak_keySplineX_in+(ak_point_2_panx-ak_PanInPointx)
ak_keySplineY=ak_keySplineY_in+(ak_point_2_pany-ak_PanInPointy)
document.getElementById("ak_g_keySplines").setAttribute("transform","translate("+ak_keySplineX+","+ak_keySplineY+"),scale("+ak_keySplineScale+")")
return
}
if(action=="editKeySplines")
{
ak_MoveEditRect_flag_update=false
var ak_tmpX=((ak_point_2_panx-ak_PanInPointx)/200)/ak_keySplineScale
var ak_tmpY=(-(ak_point_2_pany-ak_PanInPointy)/200)/ak_keySplineScale
switch(point_nr)
{
case 0:
ak_keySplines[ak_keySplineEditor-1][2]=ak_round(ak_keySplines_in[0]+ak_tmpX,200)
ak_keySplines[ak_keySplineEditor-1][3]=ak_round(ak_keySplines_in[1]+ak_tmpY,200)
if(ak_keySplines[ak_keySplineEditor-1][2]>1) ak_keySplines[ak_keySplineEditor-1][2]=1
if(ak_keySplines[ak_keySplineEditor-1][2]<0) ak_keySplines[ak_keySplineEditor-1][2]=0
if(ak_keySplines[ak_keySplineEditor-1][3]>1) ak_keySplines[ak_keySplineEditor-1][3]=1
if(ak_keySplines[ak_keySplineEditor-1][3]<0) ak_keySplines[ak_keySplineEditor-1][3]=0
if(ak_key_status[16]=="down")
{
ak_keySplines[ak_keySplineEditor][0]=ak_keySplines_in[2]
ak_keySplines[ak_keySplineEditor][1]=ak_keySplines_in[3]
}
else
{
ak_keySplines[ak_keySplineEditor][0]=ak_round(1-ak_keySplines[ak_keySplineEditor-1][2],200)
ak_keySplines[ak_keySplineEditor][1]=ak_round(1-ak_keySplines[ak_keySplineEditor-1][3],200)
}
document.getElementById("ak_keyLine_0").setAttribute("x2",(ak_keySplines[ak_keySplineEditor-1][2]*200)-200)
document.getElementById("ak_keyLine_0").setAttribute("y2",((1-ak_keySplines[ak_keySplineEditor-1][3])*200))
document.getElementById("ak_keyCircle_0").setAttribute("cx",(ak_keySplines[ak_keySplineEditor-1][2]*200)-200)
document.getElementById("ak_keyCircle_0").setAttribute("cy",((1-ak_keySplines[ak_keySplineEditor-1][3])*200))
document.getElementById("ak_keyLine_1").setAttribute("x2",ak_keySplines[ak_keySplineEditor][0]*200)
document.getElementById("ak_keyLine_1").setAttribute("y2",-ak_keySplines[ak_keySplineEditor][1]*200)
document.getElementById("ak_keyCircle_1").setAttribute("cx",ak_keySplines[ak_keySplineEditor][0]*200)
document.getElementById("ak_keyCircle_1").setAttribute("cy",-ak_keySplines[ak_keySplineEditor][1]*200)
break
case 1:
ak_keySplines[ak_keySplineEditor][0]=ak_round(ak_keySplines_in[2]+ak_tmpX,200)
ak_keySplines[ak_keySplineEditor][1]=ak_round(ak_keySplines_in[3]+ak_tmpY,200)
if(ak_keySplines[ak_keySplineEditor][0]>1) ak_keySplines[ak_keySplineEditor][0]=1
if(ak_keySplines[ak_keySplineEditor][0]<0) ak_keySplines[ak_keySplineEditor][0]=0
if(ak_keySplines[ak_keySplineEditor][1]>1) ak_keySplines[ak_keySplineEditor][1]=1
if(ak_keySplines[ak_keySplineEditor][1]<0) ak_keySplines[ak_keySplineEditor][1]=0
if(ak_keySplineEditor>0)
{
if(ak_key_status[16]=="down")
{
ak_keySplines[ak_keySplineEditor-1][2]=ak_keySplines_in[0]
ak_keySplines[ak_keySplineEditor-1][3]=ak_keySplines_in[1]
}
else
{
ak_keySplines[ak_keySplineEditor-1][2]=ak_round(1-ak_keySplines[ak_keySplineEditor][0],200)
ak_keySplines[ak_keySplineEditor-1][3]=ak_round(1-ak_keySplines[ak_keySplineEditor][1],200)
}
document.getElementById("ak_keyLine_0").setAttribute("x2",(ak_keySplines[ak_keySplineEditor-1][2]*200)-200)
document.getElementById("ak_keyLine_0").setAttribute("y2",((1-ak_keySplines[ak_keySplineEditor-1][3])*200))
document.getElementById("ak_keyCircle_0").setAttribute("cx",(ak_keySplines[ak_keySplineEditor-1][2]*200)-200)
document.getElementById("ak_keyCircle_0").setAttribute("cy",((1-ak_keySplines[ak_keySplineEditor-1][3])*200))
}
document.getElementById("ak_keyLine_1").setAttribute("x2",ak_keySplines[ak_keySplineEditor][0]*200)
document.getElementById("ak_keyLine_1").setAttribute("y2",-ak_keySplines[ak_keySplineEditor][1]*200)
document.getElementById("ak_keyCircle_1").setAttribute("cx",ak_keySplines[ak_keySplineEditor][0]*200)
document.getElementById("ak_keyCircle_1").setAttribute("cy",-ak_keySplines[ak_keySplineEditor][1]*200)
break
case 2:
ak_keySplines[ak_keySplineEditor][2]=ak_round(ak_keySplines_in[4]+ak_tmpX,200)
ak_keySplines[ak_keySplineEditor][3]=ak_round(ak_keySplines_in[5]+ak_tmpY,200)
if(ak_keySplines[ak_keySplineEditor][2]>1) ak_keySplines[ak_keySplineEditor][2]=1
if(ak_keySplines[ak_keySplineEditor][2]<0) ak_keySplines[ak_keySplineEditor][2]=0
if(ak_keySplines[ak_keySplineEditor][3]>1) ak_keySplines[ak_keySplineEditor][3]=1
if(ak_keySplines[ak_keySplineEditor][3]<0) ak_keySplines[ak_keySplineEditor][3]=0
if(ak_keySplineEditor<(ak_keySplines.length-1))
{
if(ak_key_status[16]=="down")
{
ak_keySplines[ak_keySplineEditor+1][0]=ak_keySplines_in[6]
ak_keySplines[ak_keySplineEditor+1][1]=ak_keySplines_in[7]
}
else
{
ak_keySplines[ak_keySplineEditor+1][0]=ak_round(1-ak_keySplines[ak_keySplineEditor][2],200)
ak_keySplines[ak_keySplineEditor+1][1]=ak_round(1-ak_keySplines[ak_keySplineEditor][3],200)
}
document.getElementById("ak_keyLine_3").setAttribute("x2",(ak_keySplines[ak_keySplineEditor+1][0]*200)+200)
document.getElementById("ak_keyLine_3").setAttribute("y2",((-ak_keySplines[ak_keySplineEditor+1][1])*200)-200)
document.getElementById("ak_keyCircle_3").setAttribute("cx",(ak_keySplines[ak_keySplineEditor+1][0]*200)+200)
document.getElementById("ak_keyCircle_3").setAttribute("cy",((-ak_keySplines[ak_keySplineEditor+1][1])*200)-200)
}
document.getElementById("ak_keyLine_2").setAttribute("x2",(ak_keySplines[ak_keySplineEditor][2]*200))
document.getElementById("ak_keyLine_2").setAttribute("y2",(-ak_keySplines[ak_keySplineEditor][3]*200))
document.getElementById("ak_keyCircle_2").setAttribute("cx",(ak_keySplines[ak_keySplineEditor][2]*200))
document.getElementById("ak_keyCircle_2").setAttribute("cy",(-ak_keySplines[ak_keySplineEditor][3]*200))
break
case 3:
ak_keySplines[ak_keySplineEditor+1][0]=ak_round(ak_keySplines_in[6]+ak_tmpX,200)
ak_keySplines[ak_keySplineEditor+1][1]=ak_round(ak_keySplines_in[7]+ak_tmpY,200)
if(ak_keySplines[ak_keySplineEditor+1][0]>1) ak_keySplines[ak_keySplineEditor+1][0]=1
if(ak_keySplines[ak_keySplineEditor+1][0]<0) ak_keySplines[ak_keySplineEditor+1][0]=0
if(ak_keySplines[ak_keySplineEditor+1][1]>1) ak_keySplines[ak_keySplineEditor+1][1]=1
if(ak_keySplines[ak_keySplineEditor+1][1]<0) ak_keySplines[ak_keySplineEditor+1][1]=0
if(ak_key_status[16]=="down")
{
ak_keySplines[ak_keySplineEditor][2]=ak_keySplines_in[4]
ak_keySplines[ak_keySplineEditor][3]=ak_keySplines_in[5]
}
else
{
ak_keySplines[ak_keySplineEditor][2]=ak_round(1-ak_keySplines[ak_keySplineEditor+1][0],200)
ak_keySplines[ak_keySplineEditor][3]=ak_round(1-ak_keySplines[ak_keySplineEditor+1][1],200)
}
document.getElementById("ak_keyLine_3").setAttribute("x2",(ak_keySplines[ak_keySplineEditor+1][0]*200)+200)
document.getElementById("ak_keyLine_3").setAttribute("y2",((-ak_keySplines[ak_keySplineEditor+1][1])*200)-200)
document.getElementById("ak_keyCircle_3").setAttribute("cx",(ak_keySplines[ak_keySplineEditor+1][0]*200)+200)
document.getElementById("ak_keyCircle_3").setAttribute("cy",((-ak_keySplines[ak_keySplineEditor+1][1])*200)-200)
document.getElementById("ak_keyLine_2").setAttribute("x2",ak_keySplines[ak_keySplineEditor][2]*200)
document.getElementById("ak_keyLine_2").setAttribute("y2",-ak_keySplines[ak_keySplineEditor][3]*200)
document.getElementById("ak_keyCircle_2").setAttribute("cx",ak_keySplines[ak_keySplineEditor][2]*200)
document.getElementById("ak_keyCircle_2").setAttribute("cy",-ak_keySplines[ak_keySplineEditor][3]*200)
break
}
var ak_tmp_Node=''
if(ak_keySplineEditor>0)
{
var i=ak_keySplineEditor-1
ak_tmp_Node+='M -200 200 c '+(ak_keySplines[i][0]*200)+' '+(-ak_keySplines[i][1]*200)+' '+(ak_keySplines[i][2]*200)+' '+(-ak_keySplines[i][3]*200)+' 200 -200'
}
else ak_tmp_Node+='M 0 0'
var i=ak_keySplineEditor
ak_tmp_Node+=' c '+(ak_keySplines[i][0]*200)+' '+(-ak_keySplines[i][1]*200)+' '+(ak_keySplines[i][2]*200)+' '+(-ak_keySplines[i][3]*200)+' 200 -200'
if(ak_keySplineEditor<(ak_keySplines.length-1))
{
var i=ak_keySplineEditor+1
ak_tmp_Node+=' c '+(ak_keySplines[i][0]*200)+' '+(-ak_keySplines[i][1]*200)+' '+(ak_keySplines[i][2]*200)+' '+(-ak_keySplines[i][3]*200)+' 200 -200'
}
document.getElementById("ak_keyPath").setAttribute("d",ak_tmp_Node)
var ak_tmp_splines=new Array
for(var i=0;i<ak_keySplines.length;i++)
{
ak_tmp_splines.push(ak_keySplines[i].join(" "))
}
ak_keyObject.setAttribute("keySplines",ak_tmp_splines.join("; "))
ak_tagName_cout=' keySplines="'+ak_tmp_splines.join("; ")+'"'
if(ak_tagName_cout>124) ak_tagName_cout=ak_tagName_cout.substring(0,120)+'...'
ak_cout(ak_tagName_cout)
ak_up_action='keySplines'
return
}
if (action=="size") {ak_SizeEditRect(evt,mouse_flag,action,point_nr); return}
var ak_tmp_precision=100 // 10 = 1 zehntel genau
if (action=="xy_control") 
{
switch(ak_obj_data[0])
{
case "g": // font-size
case "a": // font-size
case "textPath": // font-size
case "tspan": // font-size
case "tref": // font-size
case "text": // font-size
var ak_tmp_font_size_txt=ak_font_size_inText
var ak_tmp_font_size
//ak_tmp_font_size=ak_round((((ak_EditPoint_BBox.y+ak_EditPoint_Size.y)-(ak_point_2.y))-((ak_EditPoint_BBox.x-ak_point_2.x)/20)),10)
if(evt && evt.shiftKey())
{
if(/pt/.test(ak_tmp_font_size_txt)) ak_tmp_font_size=ak_round((parseFloat(ak_tmp_font_size_txt)/0.8),10)
else ak_tmp_font_size=parseFloat(ak_tmp_font_size_txt)
if(isNaN(ak_tmp_font_size)) ak_tmp_font_size=0
ak_tmp_font_size=ak_round(ak_tmp_font_size-((ak_point_2.y-ak_EditPoint.y)/10),10)
}
else
{
ak_tmp_font_size=ak_round((ak_EditPoint_BBox.y+ak_EditPoint_Size.y)-(ak_point_2.y),10)
}
if(ak_tmp_font_size>0)
{
if(/pt/.test(ak_tmp_font_size_txt)) ak_tmp_font_size_txt=ak_round((ak_tmp_font_size*0.8),10)+"pt"
else ak_tmp_font_size_txt=ak_tmp_font_size+""
ak_SetGetRm_styleValue(ak_object2update,"font-size",ak_tmp_font_size_txt,"no_cout")
}
else ak_SetGetRm_styleValue(ak_object2update,"font-size","remove","no_cout")
ak_tagName_cout=ak_tagName_start+' style="'+ak_object2update.getAttribute("style")+'"'
if(ak_tmp_font_size>0) ak_cout(ak_tmp_font_size)
else ak_cout("")
break;
case "line":
ak_obj_data[6]=ak_round(ak_EditPoint_enter.x+(ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
ak_obj_data[7]=ak_round(ak_EditPoint_enter.y+(ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
ak_object2update.setAttribute("x1",ak_obj_data[6]);
ak_object2update.setAttribute("y1",ak_obj_data[7]);
ak_tagName_cout=ak_tagName_start+' x1="'+ak_obj_data[6]+'" y1="'+ak_obj_data[7]+'" x2="'+ak_obj_data[8]+'" y2="'+ak_obj_data[9]+'"';
break;
case "rect":
ak_obj_data[13]=ak_round((ak_EditPoint_enter_r.x+(ak_point_2.x-ak_EditPoint.x)),ak_tmp_precision)
ak_obj_data[13]=ak_obj_data[13]<0?0:ak_obj_data[13]
ak_obj_data[14]=ak_round((ak_EditPoint_enter_r.y+(ak_point_2.y-ak_EditPoint.y)),ak_tmp_precision)
ak_obj_data[14]=ak_obj_data[14]<0?0:ak_obj_data[14]
if(ak_key_status[16]=="up")
{
ak_obj_data[13]=ak_obj_data[13]<ak_obj_data[14]?ak_obj_data[13]:ak_obj_data[14]
ak_obj_data[14]=ak_obj_data[14]<ak_obj_data[13]?ak_obj_data[14]:ak_obj_data[13]
}
if(ak_obj_data[13]>0 || ak_obj_data[14]>0)
{
ak_object2update.setAttribute("rx",ak_obj_data[13]);
ak_object2update.setAttribute("ry",ak_obj_data[14]);
ak_tagName_cout=ak_tagName_start+' x="'+ak_obj_data[2]+'" y="'+ak_obj_data[3]+'" width="'+ak_obj_data[4]+'" height="'+ak_obj_data[5]
ak_tagName_cout+=' rx="'+ak_obj_data[13]+'" ry="'+ak_obj_data[14]+'"'
}
else
{
try
{
ak_object2update.removeAttribute("rx")
ak_object2update.removeAttribute("ry")
}
catch(error){}
ak_tagName_cout=ak_tagName_start+' x="'+ak_obj_data[2]+'" y="'+ak_obj_data[3]+'" width="'+ak_obj_data[4]+'" height="'+ak_obj_data[5]+'"'
}
break
case "use":
ak_obj_data[4]=ak_round(ak_point_2.x-ak_obj_data[2],ak_tmp_precision)
ak_obj_data[5]=ak_round(ak_point_2.y-ak_obj_data[3],ak_tmp_precision)
ak_tagName_cout=ak_tagName_start+' x="'+ak_obj_data[2]+'" y="'+ak_obj_data[3]
if(ak_obj_data[4]<ak_use_min.x || ak_obj_data[4]<0)
{
try {ak_object2update.removeAttribute("width")}
catch(error){}
}
else
{
ak_object2update.setAttribute("width",ak_obj_data[4]);
ak_tagName_cout+=' width="'+ak_obj_data[4]+'"'
}
if(ak_obj_data[5]<ak_use_min.y || ak_obj_data[5]<0)
{
try {ak_object2update.removeAttribute("height")}
catch(error){}
}
else
{
ak_object2update.setAttribute("height",ak_obj_data[5]);
ak_tagName_cout+=' height="'+ak_obj_data[5]+'"'
}
break
}
//ak_cout(ak_tagName_cout)
return
}
if (action!="translate") return; // wenn nix erwaehnt dann retour
if (ak_edit_which_attribute=="translate" || ak_edit_which_attribute=="matrix") 
{
ak_edit_transform(evt,point_nr) // hier wird dass transform attribute editiert
return
}
switch(ak_obj_data[0])
{
case "textPath":
var ak_startOffset=ak_round(ak_EditPoint_enter.x+(ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
var ak_baslineShift=ak_round(-1*(ak_EditPoint_enter.y+(ak_point_2.y-ak_EditPoint.y)),ak_tmp_precision)
ak_object2update.setAttribute("startOffset",ak_startOffset)
ak_SetGetRm_styleValue(ak_object2update,"baseline-shift",ak_baslineShift,"no_cout")
ak_tagName_cout=ak_tagName_start+' startOffset="'+ak_startOffset+'" style="'+ak_object2update.getAttribute("style")+'"'
break;
case "text":
ak_obj_data[2]=ak_round(ak_EditPoint_enter.x+(ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
ak_obj_data[3]=ak_round(ak_EditPoint_enter.y+(ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
ak_object2update.setAttribute("x",ak_obj_data[2]);
ak_object2update.setAttribute("y",ak_obj_data[3]);
ak_tagName_cout=ak_tagName_start+' x="'+ak_obj_data[2]+'" y="'+ak_obj_data[3]+'" style="'+ak_object2update.getAttribute("style")+'"'
break;
case "tspan":
case "tref":
ak_obj_data[2]=ak_round(ak_EditPoint_enter.x+(ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
ak_obj_data[3]=ak_round(ak_EditPoint_enter.y+(ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
ak_object2update.setAttribute("x",ak_obj_data[2]);
ak_object2update.setAttribute("y",ak_obj_data[3]);
ak_tagName_cout=ak_tagName_start+' x="'+ak_obj_data[2]+'" y="'+ak_obj_data[3]+'" style="'+ak_object2update.getAttribute("style")+'"'
break;
case "line":
ak_obj_data[6]=ak_round(ak_EditPoint_enter.x+(ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
ak_obj_data[7]=ak_round(ak_EditPoint_enter.y+(ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
ak_obj_data[8]=ak_round(ak_EditPoint2_enter.x+(ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
ak_obj_data[9]=ak_round(ak_EditPoint2_enter.y+(ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
ak_object2update.setAttribute("x1",ak_obj_data[6]);
ak_object2update.setAttribute("y1",ak_obj_data[7]);
ak_object2update.setAttribute("x2",ak_obj_data[8]);
ak_object2update.setAttribute("y2",ak_obj_data[9]);
ak_tagName_cout=ak_tagName_start+' x1="'+ak_obj_data[6]+'" y1="'+ak_obj_data[7]+'" x2="'+ak_obj_data[8]+'" y2="'+ak_obj_data[9]+'"';
break;
case "rect":
ak_obj_data[2]=ak_round(ak_EditPoint_enter.x+(ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
ak_obj_data[3]=ak_round(ak_EditPoint_enter.y+(ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
ak_object2update.setAttribute("x",ak_obj_data[2]);
ak_object2update.setAttribute("y",ak_obj_data[3]);
ak_tagName_cout=ak_tagName_start+' x="'+ak_obj_data[2]+'" y="'+ak_obj_data[3]+'" width="'+ak_obj_data[4]+'" height="'+ak_obj_data[5]+'"'
break;
case "image":
ak_obj_data[2]=ak_round(ak_EditPoint_enter.x+(ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
ak_obj_data[3]=ak_round(ak_EditPoint_enter.y+(ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
ak_object2update.setAttribute("x",ak_obj_data[2]);
ak_object2update.setAttribute("y",ak_obj_data[3]);
ak_tagName_cout=ak_tagName_start+' x="'+ak_obj_data[2]+'" y="'+ak_obj_data[3]+'" width="'+ak_obj_data[4]+'" height="'+ak_obj_data[5]+'"'
break;
case "use":
ak_obj_data[2]=ak_round(ak_EditPoint_enter.x+(ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
ak_obj_data[3]=ak_round(ak_EditPoint_enter.y+(ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
ak_object2update.setAttribute("x",ak_obj_data[2]);
ak_object2update.setAttribute("y",ak_obj_data[3]);
ak_tagName_cout=ak_tagName_start+' x="'+ak_obj_data[2]+'" y="'+ak_obj_data[3]
break;
case "circle":
ak_obj_data[10]=ak_round(ak_EditPoint_enter.x+(ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
ak_obj_data[11]=ak_round(ak_EditPoint_enter.y+(ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
ak_object2update.setAttribute("cx",ak_obj_data[10]);
ak_object2update.setAttribute("cy",ak_obj_data[11]);
ak_tagName_cout=ak_tagName_start+' cx="'+ak_obj_data[10]+'" cy="'+ak_obj_data[11]+'" r="'+ak_obj_data[12]+'"';
break;
case "ellipse":
ak_obj_data[10]=ak_round((ak_EditPoint_enter.x+(ak_point_2.x-ak_EditPoint.x)),ak_tmp_precision)
ak_obj_data[11]=ak_round((ak_EditPoint_enter.y+(ak_point_2.y-ak_EditPoint.y)),ak_tmp_precision)
ak_object2update.setAttribute("cx",ak_obj_data[10]);
ak_object2update.setAttribute("cy",ak_obj_data[11]);
ak_tagName_cout=ak_tagName_start+' cx="'+ak_obj_data[10]+'" cy="'+ak_obj_data[11]+'" rx="'+ak_obj_data[13]+'" ry="'+ak_obj_data[14]+'"'
break;
case "polyline":
case "polygon":
var ak_point_delta=ak_svgroot.createSVGPoint();
ak_point_delta.x=ak_point_2.x-ak_EditPoint.x
ak_point_delta.y=ak_point_2.y-ak_EditPoint.y
for(var i=0;i<ak_EditArray_enter.length;i+=2)
{
ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.x),ak_tmp_precision)
ak_EditArray_work[i+1]=ak_round((ak_EditArray_enter[i+1]+ak_point_delta.y),ak_tmp_precision)
}
ak_obj_data[18]=ak_EditArray_work.join(" ")
ak_object2update.setAttribute("points",ak_obj_data[18]);
ak_tagName_cout=ak_tagName_start+' points="'+ak_obj_data[18]+'"';
if (ak_tagName_cout.length>124) ak_tagName_cout=ak_tagName_cout.substring(0,120)+" ...";
break
case "path":
var ak_point_delta=ak_svgroot.createSVGPoint();
ak_point_delta.x=ak_point_2.x-ak_EditPoint.x
ak_point_delta.y=ak_point_2.y-ak_EditPoint.y
for(var i=0;i<ak_EditArray_enter.length;i++)
{
switch (ak_EditArray_enter[i])
{
case "M":
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.y),ak_tmp_precision)
break
case "C":
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.y),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.y),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.y),ak_tmp_precision)
break
case "L":
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.y),ak_tmp_precision)
break
case "Q":
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.y),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.y),ak_tmp_precision)
break
case "A":
i=i+6; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.y),ak_tmp_precision)
break
case "S":
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.y),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.y),ak_tmp_precision)
break
case "T":
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.y),ak_tmp_precision)
break
case "H":
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.x),ak_tmp_precision)
break
case "V":
i++; ak_EditArray_work[i]=ak_round((ak_EditArray_enter[i]+ak_point_delta.y),ak_tmp_precision)
break
}
}
if(ak_path_attr)
{
ak_path_attr[3]=ak_round(ak_path_attr_enter[3]+ak_point_delta.x,ak_tmp_precision)
ak_path_attr[4]=ak_round(ak_path_attr_enter[4]+ak_point_delta.y,ak_tmp_precision)
ak_object2update.setAttribute("d",ak_path_create())
ak_object2update.setAttribute("ak_path",ak_path_attr.join(";"))
ak_tagName_cout=ak_tagName_start+' ak_path="'+ak_path_attr.join(";")+'"'
if (ak_tagName_cout.length>124) ak_tagName_cout=ak_tagName_cout.substring(0,120)+" ..."
}
else
{
ak_obj_data[19]=ak_EditArray_work.join(" ")
ak_object2update.setAttribute("d",ak_obj_data[19])
ak_tagName_cout=ak_tagName_start+' d="'+ak_obj_data[19]+'"'
if (ak_tagName_cout.length>124) ak_tagName_cout=ak_tagName_cout.substring(0,120)+" ..."
}
break
case "svg":
if(ak_xyPercent[2])
{
ak_obj_data[2]=ak_round((ak_EditPoint_enter.x+(ak_point_2.x-ak_EditPoint.x))*100/ak_parentSVG_width,ak_tmp_precision)+'%'
}
else ak_obj_data[2]=ak_round(ak_EditPoint_enter.x+(ak_point_2.x-ak_EditPoint.x),ak_tmp_precision)
if(ak_xyPercent[3])
{
ak_obj_data[3]=ak_round((ak_EditPoint_enter.y+(ak_point_2.y-ak_EditPoint.y))*100/ak_parentSVG_height,ak_tmp_precision)+'%'
}
else ak_obj_data[3]=ak_round(ak_EditPoint_enter.y+(ak_point_2.y-ak_EditPoint.y),ak_tmp_precision)
if(ak_object2update_nodeNr=="")
{
ak_tagName_cout='rootSVG always uses x="0" y="0"!'
ak_object2update.setAttribute("x",0)
ak_object2update.setAttribute("y",0)
}
else
{
ak_object2update.setAttribute("x",ak_obj_data[2])
ak_object2update.setAttribute("y",ak_obj_data[3])
document.getElementById('ak_svg_outline').setAttribute('x',(ak_point_2.x-ak_EditPoint.x))
document.getElementById('ak_svg_outline').setAttribute('y',(ak_point_2.y-ak_EditPoint.y))
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'x','y','width','height','viewBox','preserveAspectRatio')
}
break
case "a":
case "g":
case "clipPath":
ak_edit_transform(evt,point_nr)
ak_tagName_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'transform')
break
default:
ak_MoveEditRect_flag_update=false
}
//ak_cout(ak_tagName_cout)
}
// ############    ################
function ak_round(in_wert,factor)
{
return Math.round(in_wert*factor)/factor
}
// ############    ################
var ak_mouse_x=0;
var ak_mouse_y=0;
var ak_window_innerWidth=0;
var ak_window_innerHeight=0;
function ak_switch_xy_transform(which_action)
{
switch(ak_edit_which_attribute)
{
case "xy_etc":
ak_edit_which_attribute="matrix"
break
case "matrix":
ak_edit_which_attribute="xy_etc"
break
default:
ak_edit_which_attribute="xy_etc"
break
}
if(which_action) ak_edit_which_attribute=which_action
try{document.getElementById("ak_rotateCenter").setAttribute("visibility","hidden")}catch(error){}
switch(ak_edit_which_attribute)
{
case "xy_etc_no_ak_clickset_obj2update":
ak_edit_which_attribute="xy_etc"
ak_SetGetRm_styleValue(document.getElementById("ak_internal_edit_border_color"),"fill","#ff0","no_cout")
if(ak_which_nodeNr(ak_object2update)==-1) return
if(document.getElementById("ak_Id_tmp_edit_width"))
{
switch(ak_obj_data[0])
{
case "g":
case "a":
case "use":
case "text":
case "tspan":
case "textPath":
case "tref":
case "clipPath":
ak_SetGetRm_styleValue(document.getElementById("ak_Id_tmp_edit_width"),"visibility","hidden","no_cout")
break
default:
ak_SetGetRm_styleValue(document.getElementById("ak_Id_tmp_edit_width"),"visibility","remove","no_cout")
break
}
}
if(document.getElementById("ak_Id_tmp_edit_width")) ak_SetGetRm_styleValue(document.getElementById("ak_Id_tmp_edit_width"),"fill","#ffff00","no_cout");
if(document.getElementById("ak_Id_tmp_edit_g")) document.getElementById("ak_Id_tmp_edit_g").setAttribute("onmouseover","ak_cout(ak_tagName_cout)")
if(!ak_hide_pathPoints && ak_object2update.tagName=="path") ak_SetGetRm_styleValue(document.getElementById("ak_path_control_g"),"visibility","remove","no_cout");
ak_objRotateCenter.setAttribute("visibility","hidden")
ak_cout(ak_tagName_cout)
break
case "xy_etc":
ak_SetGetRm_styleValue(document.getElementById("ak_internal_edit_border_color"),"fill","#ff0","no_cout");
if(ak_which_nodeNr(ak_object2update)==-1) return
if(document.getElementById("ak_Id_tmp_edit_width"))
{
switch(ak_obj_data[0])
{
case "g":
case "a":
case "use":
case "text":
case "tspan":
case "textPath":
case "tref":
case "clipPath":
ak_SetGetRm_styleValue(document.getElementById("ak_Id_tmp_edit_width"),"visibility","hidden","no_cout")
break
default:
ak_SetGetRm_styleValue(document.getElementById("ak_Id_tmp_edit_width"),"visibility","remove","no_cout")
break
}
}
if(document.getElementById("ak_Id_tmp_edit_width")) ak_SetGetRm_styleValue(document.getElementById("ak_Id_tmp_edit_width"),"fill","#ffff00","no_cout");
if(document.getElementById("ak_Id_tmp_edit_g")) document.getElementById("ak_Id_tmp_edit_g").setAttribute("onmouseover","ak_cout(ak_tagName_cout)")
//if(!ak_hide_pathPoints && ak_object2update.tagName=="path") ak_SetGetRm_styleValue(document.getElementById("ak_path_control_g"),"visibility","remove","no_cout");
if (ak_object2update.tagName=="path" || ak_object2update.tagName=="polyline" || ak_object2update.tagName=="polygon")
{
ak_clickset_obj2update(evt,ak_object2update)
break
}
ak_objRotateCenter.setAttribute("visibility","hidden")
ak_cout(ak_tagName_cout)
break
case "matrix":
//if(ak_object2update.tagName!='svg') try{document.getElementById("ak_rotateCenter").removeAttribute("visibility")}catch(error){}
if(ak_object2update.tagName!='svg')
{
ak_rmAttribute(ak_objRotateCenter,"visibility")
ak_setAttribute(ak_border1,"fill","#12cc05")
}
else ak_setAttribute(ak_border1,"fill","#ff006a")
if(ak_which_nodeNr(ak_object2update)==-1) return
if(ak_objWidth)
{
ak_rmAttribute(ak_objWidth,"visibility") // wegen text
if(ak_object2update.tagName!='line') ak_setAttribute(ak_objWidth,"fill","#ff006a")
}
if(document.getElementById("ak_Id_tmp_edit_g")) document.getElementById("ak_Id_tmp_edit_g").setAttribute("onmouseover","ak_cout(ak_transform_cout)")
if(!ak_hide_pathPoints && ak_object2update.tagName=="path") ak_SetGetRm_styleValue(document.getElementById("ak_path_control_g"),"visibility","hidden","no_cout");
else ak_SetGetRm_transformValue(ak_object2update,"matrix","get")
if(ak_object2update.tagName=='svg') ak_transform_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'viewBox','preserveAspectRatio')
else ak_transform_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'transform')
ak_cout(ak_transform_cout)
break
}
return
}
// ############    ################
var ak_pathAddPoint=false, ak_clientX, ak_clientY
var ak_xy_etc_shift=21
function ak_mouse_move(evt,mouse_flag)
{
if(ak_pathAddPoint || ak_fast_move) ak_mouse_circle.setAttribute('transform','translate('+evt.getClientX+','+evt.getClientY+')')
if(ak_io_wait_active)
{
if(evt.getClientX==0 && evt.getClientY==0) ak_io_wait.setAttribute('transform','translate(-200,-200)')
else ak_io_wait.setAttribute('transform','translate('+(evt.getClientX+2)+','+(evt.getClientY-11)+')')
ak_io_wait.setAttribute('visibility','visible')
return
}
if (mouse_flag=="out") return
if (mouse_flag=="up")
{
ak_edit_overall("hidden")
if(ak_timeAction) eval(ak_move_eval)
else if(ak_menu_status!="timeline" && ak_svgroot.getCurrentTime()<ak_aniStop)
{evt.preventDefault();ak_animation("stop");ak_selection("show");return}
else if(ak_nachNom) ak_nachNominierenOver(evt)
else if(ak_up_eval) eval(ak_up_eval)
else if(ak_grouping.length>0) return
else ak_MoveEditRect(evt,mouse_flag)
return
}
ak_mouse_x=evt.getClientX
ak_mouse_y=evt.getClientY
ak_clientX=(((ak_mouse_x-ak_xy_etc_shift)/ak_grid_zoom)-ak_grid_pan_x)
ak_clientY=(((ak_mouse_y-ak_xy_etc_shift)/ak_grid_zoom)-ak_grid_pan_y)
status="x "+ak_clientX.toFixed(1)+" | y "+ak_clientY.toFixed(1)
if(window.innerWidth!=ak_window_innerWidth || window.innerHeight!=ak_window_innerHeight) ak_window_resize(evt)
window.focus(ak_svgroot)
eval(ak_move_eval)
}
// ############    ################
var ak_edit_which_attribute="xy_etc"
var ak_make2clipboard="null"
window.ak_setTimeout=ak_setTimeout
var ak_setTimeout_counter=0
var ak_replace=false
// ############    ################
function ak_setTimeout(to_do,wohin,id)
{
var ak_tmp_wohin=ak_object2update
if(wohin)
{
while(ak_tmp_wohin=="[object SVGTextPathElement]" || ak_tmp_wohin=="[object SVGTSpanElement]" || ak_tmp_wohin=="[object SVGTRefElement]")
{
ak_tmp_wohin=ak_tmp_wohin.parentNode
}
if(ak_which_nodeNr(ak_object2update)==-1 || ak_which_nodeNr(ak_object2update)=="") wohin=false
}
switch(to_do)
{
case "replaceFromClipboard": ak_replace=true
case "pasteFromClipboard":
try{var ak_fromclipboard=top.clipboardData.getData("Text")}catch(err){setTimeout("ak_setTimeout(to_do,wohin,id)",100);break}
if((ak_fromclipboard+"")=="null")
{
ak_fromclipboard=ak_make2clipboard
if((ak_fromclipboard+"")=="null")
{
ak_cout("clipboard empty!")
ak_replace=false
return
}
}
var ak_tmp_parsed_stuff=parseXML("<g>"+ak_fromclipboard+"</g>",document).firstChild
var ak_tmp_file_nodes=ak_tmp_parsed_stuff.getChildNodes.length
var ak_tmp_cout
if(ak_tmp_file_nodes==0)
{
var ak_tmp=ak_fromclipboard.search(/<svg/)
if(ak_tmp==-1)
{
ak_cout("No svg elements recognized!")
ak_replace=false
return
}
ak_fromclipboard=ak_fromclipboard.substring(ak_tmp,ak_fromclipboard.length)
ak_tmp_parsed_stuff=parseXML("<g>"+ak_fromclipboard+"</g>",document).firstChild
ak_tmp_file_nodes=ak_tmp_parsed_stuff.getChildNodes.length
if(ak_tmp_file_nodes==0)
{
ak_cout("No svg elements recognized!")
ak_replace=false
return
}
}
if(ak_replace)
{
for(var i=ak_tmp_parsed_stuff.getChildNodes.length-1;i>=0;i--)
{
var ak_tmp_paste_object=ak_tmp_parsed_stuff.getChildNodes.item(i)
if(/^(\[object SVG)/.test(ak_tmp_paste_object))
{
var ak_tmp_id=ak_tmp_paste_object.getId()
if(ak_tmp_id!="" && ak_tmp_id!=null)
{
if(document.getElementById(ak_tmp_id))
{
var ak_tmp_Id_nodeNr=ak_which_nodeNr(document.getElementById(ak_tmp_id))
if(ak_tmp_Id_nodeNr==-1 || ak_tmp_Id_nodeNr=="0") ak_alert("Internal used Id recognized, no replace!")
else if(ak_tmp_Id_nodeNr=="") ak_alert("Use Load SVG, for complete replace!")
else
{
var ak_tmp_replace=ak_userspace_svg.getElementById(ak_tmp_id)
if(/^(\[object SVG)/.test(ak_tmp_replace)) ak_add2undo()
try
{
var ak_tmp_nodeNr=ak_which_nodeNr(ak_tmp_replace)
ak_tmp_replace.parentNode.replaceChild(ak_tmp_paste_object,ak_tmp_replace)
var ak_tmp_cout=ak_tmp_paste_object
if(ak_tmp_nodeNr==ak_object2update_nodeNr) ak_replace=false
}
catch(error){}
}
window.focus(ak_svgroot)
}
}
}
}
}
else if(ak_tmp_parsed_stuff.getChildNodes.length>=1)
{
var ak_tmp_paste_object
for(var i=0;i<ak_tmp_parsed_stuff.getChildNodes.length;i++)
{
ak_tmp_paste_object=ak_tmp_parsed_stuff.getChildNodes.item(i)
if(/^(\[object SVG)/.test(ak_tmp_paste_object))
{
if(wohin=="insert") ak_tmp_cout=ak_insertBeforeSP(ak_tmp_paste_object,ak_tmp_wohin)
else if(wohin=="add2Parent") ak_tmp_cout=ak_appendChildSP(ak_tmp_paste_object,ak_tmp_wohin.parentNode)
else if(wohin=="append") ak_tmp_cout=ak_appendChildSP(ak_tmp_paste_object,ak_tmp_wohin)
else ak_tmp_cout=ak_appendChildSP(ak_tmp_paste_object,ak_userspace_svg)
}
}
}
if(/6.0x38363$/.test(getSVGViewerVersion()))
{
for(var i=0;i<document.getElementsByTagName("use").length;i++)
{
var ak_uses_onmousedown=document.getElementsByTagName("use").item(i).getAttribute("onmousedown")
if(ak_uses_onmousedown.search('ak_MoveEditRect_flag=true;ak_clickset_obj2update')==-1)
{
ak_uses_onmousedown="ak_MoveEditRect_flag=true;ak_clickset_obj2update(evt);"+ak_uses_onmousedown
document.getElementsByTagName("use").item(i).setAttribute("onmousedown",ak_uses_onmousedown)
}
}
}
if(ak_replace) 
{
if(ak_edit_gradient_flag=="filter")
{
var ak_tmp_fe=ak_getObject(ak_gradient_stop_index)
if(/^(\[object SVG)/.test(ak_tmp_fe)) ak_tmp_fe=ak_tmp_fe.tagName
if(!/^(filter)|(fe)/.test(ak_tmp_fe)) ak_gradient_stop_index=-1
}
else if(ak_edit_gradient_flag=="gradient")
{
var ak_tmp_fe=ak_getObject(ak_gradient_stop_index)
if(/^(\[object SVG)/.test(ak_tmp_fe)) ak_tmp_fe=ak_tmp_fe.tagName
if(!/^(stop)/.test(ak_tmp_fe)) ak_gradient_stop_index=-1
}
else ak_gradient_stop_index=-1
}
else ak_gradient_stop_index=-1
if(!ak_replace && /^(\[object SVG)/.test(ak_tmp_cout)) ak_clickset_obj2update(evt,ak_tmp_cout)
else ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
if(ak_fromclipboard.length<1000 && /object/.test(ak_tmp_cout))
{
var ak_tmp_cout=printNode(ak_tmp_cout)
if(ak_tmp_cout.length>84) var ak_tmp_cout=ak_tmp_cout.substring(0,80)+" ..."
}
if(ak_tmp_cout==undefined) ak_tmp_cout="no svg elements recognized!"
if(ak_replace) ak_cout("[Ctrl+G] replace (Clipboard, Id-match) completed: "+ak_tmp_cout)
else ak_cout("[Ctrl+V] paste from clipboard completed: "+ak_tmp_cout)
ak_replace=false
ak_undo('refresh')
break
case "New SVG, clear Userspace":
if(!confirm("This clears all data!\nDo you want to continue?")) return
ak_add2undo()
ak_attention=true
ak_clickset_obj2update(evt,ak_userspace_svg.firstChild)
case "New untitled":
var ak_tmp_newSVG=""
if(to_do=="New untitled")
{
ak_tmp_newSVG='<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>\n'
ak_tmp_newSVG+='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"\n'
ak_tmp_newSVG+='  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">\n\n'
}
ak_tmp_newSVG+='<svg x="0" y="0" width="640" height="480" onload="try{ak_init_editor(evt)}catch(err){};init(evt)">'
if(to_do=="New SVG, clear Userspace") ak_tmp_newSVG+='<rect id="ak_internal_userSpace_grid2" x="0" y="0" width="160000" height="160000" style="fill:url(#ak_internal_grid_fill)"/>'
ak_tmp_newSVG+='\n<!-- ======================================================================== -->\n'
var ak_tmp_date=new Date()
var ak_tmp_create='<!-- New SVG, created with AKs SVG Editor ('+ak_tmp_date.toLocaleDateString()+') '
if(/(tag)|(woch)/.test(ak_tmp_date.toLocaleDateString()))
{ak_tmp_create='<!-- SVG erstellt mit AKs SVG Editor ('+ak_tmp_date.toLocaleDateString()+') '}
var ak_tmp=77-ak_tmp_create.length
for(var i=0;i<ak_tmp;i++) {ak_tmp_create+="="}
ak_tmp_newSVG+=ak_tmp_create+' -->\n'
ak_tmp_newSVG+='<!-- www.krammel.net                                                          -->\n'
ak_tmp_newSVG+='<!-- ======================================================================== -->\n\n'
ak_tmp_newSVG+='  <script type="text/javascript"> <![CDATA[\n\n'
ak_tmp_newSVG+='    function init(evt)\n'
ak_tmp_newSVG+='    {\n'
ak_tmp_newSVG+='      // init own scripts here\n'
ak_tmp_newSVG+='      // AKs_SVGEditors function-, variable- and id-names start all with "ak_"\n'
ak_tmp_newSVG+='      // use different naming!\n'
ak_tmp_newSVG+='    }\n\n'
ak_tmp_newSVG+='  ]]> </script>\n'
ak_tmp_newSVG+='  <script id="AKs_SVGEditor" xlink:href="'+ak_editorfilename+'" type="text/javascript"/>\n\n'
ak_tmp_newSVG+='<!-- ======================================================================== -->\n'
ak_tmp_newSVG+='<!-- ======================================================================== -->\n\n'
ak_tmp_newSVG+='  <defs>\n'
ak_tmp_newSVG+='    <radialGradient id="rG_gold" cx="100%" cy="100%" r="143%">\n'
ak_tmp_newSVG+='      <stop offset="0%" style="stop-color:gold"/>\n'
ak_tmp_newSVG+='      <stop offset="100%" style="stop-color:#4b3f00"/>\n'
ak_tmp_newSVG+='    </radialGradient>\n'
ak_tmp_newSVG+='    <text id="ak_variable_system" visibility="hidden" startOffset="0">0|0|1</text>\n'
ak_tmp_newSVG+='  </defs>\n\n'
ak_tmp_newSVG+='<!-- ======================================================================== -->\n'
ak_tmp_newSVG+='<!-- ======================================================================== -->\n\n'
ak_tmp_newSVG+='</svg>\n'
if(to_do=="New untitled")
{
ak_make2clipboard=ak_tmp_newSVG
ak_make2clipboard=ak_make2clipboard.replace(/(\n)/g,"\r\n")
ak_SVGSaver('newAs')
return
}
ak_userspace_g.replaceChild(parseXML(ak_tmp_newSVG,document).firstChild,ak_userspace_svg)
ak_userspace_svg=ak_userspace_g.firstChild
ak_grid_on_off(evt,"ZoomReset")
ak_undo('refresh')
ak_deselect(evt)
ak_cout("New SVG, clear Userspace completed!")
break
case "Load SVG, paste from Clipboard":
try{var ak_fromclipboard=top.clipboardData.getData("Text")}catch(err){setTimeout("ak_setTimeout('Load SVG, paste from Clipboard',wohin,id)",100);break}
ak_clickset_obj2update(evt,ak_userspace_svg.firstChild)
if((ak_fromclipboard+"")=="null")
{
ak_cout("clipboard empty!")
return
}
if(/<svg/.test(ak_fromclipboard))
{
var ak_tmp_object=ak_userspace_svg.firstChild
ak_svg_header2=ak_fromclipboard.substring(0,ak_fromclipboard.search(/<svg/))
ak_fromclipboard=ak_fromclipboard.substring(ak_fromclipboard.search(/<svg/),ak_fromclipboard.length)
ak_add2undo()
ak_userspace_g.replaceChild(parseXML(ak_fromclipboard,document).firstChild,ak_userspace_svg)
ak_userspace_svg=ak_userspace_g.firstChild
ak_userspace_svg.insertBefore(ak_tmp_object,ak_userspace_svg.firstChild)
ak_grid_on_off(evt,'on_reset')
ak_cout("Load SVG from Clipboard completed!")
}
else
{
ak_cout("No SVG-File on Clipboard recognized!")
return
}
if(/6.0x38363$/.test(getSVGViewerVersion()))
{
for(var i=0;i<document.getElementsByTagName("use").length;i++)
{
var ak_uses_onmousedown=document.getElementsByTagName("use").item(i).getAttribute("onmousedown")
ak_uses_onmousedown="ak_MoveEditRect_flag=true;ak_clickset_obj2update(evt);"+ak_uses_onmousedown
document.getElementsByTagName("use").item(i).setAttribute("onmousedown",ak_uses_onmousedown)
}
}
ak_undo('refresh')
break
case "Save SVG to Clipboard":
ak_saveSetup(evt,"set_ak_make2clipboard")
case "saveSVGerr":
try{top.clipboardData.setData("Text",ak_make2clipboard)}catch(err){setTimeout("ak_setTimeout('saveSVGerr',wohin,id)",100);break}
ak_cout("Copy to Clipboard completed!")
break    
case "cutToClipboard":
case "copyToClipboard":
if(ak_which_nodeNr(ak_object2update)==-1 || !ak_object2update)
{
if(to_do=="copyToClipboard") ak_cout("Nothing selceted to copy!")
else ak_cout("Nothing selceted to cut!")
return
}
while(ak_object2update=="[object SVGTextPathElement]" || ak_object2update=="[object SVGTSpanElement]" || ak_object2update=="[object SVGTRefElement]")
{
ak_object2update=ak_object2update.parentNode
}
var ak_tmp_grid
if(ak_which_nodeNr(ak_object2update)=="")
{
ak_tmp_grid=ak_object2update.firstChild
ak_object2update.removeChild(ak_tmp_grid)
}
ak_make2clipboard=printNode(ak_object2update)+"\r\n"
var ak_tmp_prev=ak_object2update.previousSibling()
while(ak_make2clipboard.search(' onmousedown="ak_MoveEditRect_flag=true;ak_clickset_obj2update')!=-1)
{
ak_make2clipboard=ak_make2clipboard.replace(' onmousedown="ak_MoveEditRect_flag=true;ak_clickset_obj2update(evt);"',"")
ak_make2clipboard=ak_make2clipboard.replace(' onmousedown="ak_MoveEditRect_flag=true;ak_clickset_obj2update(evt);',' onmousedown="')
}
if(ak_make2clipboard.length>84) var ak_tmp_cout=ak_make2clipboard.substring(0,80)+" ..."
else var ak_tmp_cout=ak_make2clipboard
if(ak_tmp_prev=="[object Text]")
{
var ak_tmp_prevObj=ak_tmp_prev
ak_tmp_prev=printNode(ak_tmp_prev)
if(ak_tmp_prev.lastIndexOf('\n')>=0)
{ak_make2clipboard=ak_tmp_prev.substring(ak_tmp_prev.lastIndexOf('\n')+1)+ak_make2clipboard}
}
ak_make2clipboard=ak_make2clipboard.replace(/(\r\n)/g,"\n")
ak_make2clipboard=ak_make2clipboard.replace(/(\n)/g,"\r\n")
case "cutCopyErr":
try{top.clipboardData.setData("Text",ak_make2clipboard)}catch(err){setTimeout("ak_setTimeout('cutCopyErr',wohin,id)",100);break}
ak_object2update.insertBefore(ak_tmp_grid,ak_object2update.firstChild)
if(to_do=="copyToClipboard") ak_cout("[Ctrl+C] copy to clipboard completed: "+ak_tmp_cout)
else
{
if(ak_which_nodeNr(ak_object2update)=="")
{
ak_setTimeout("New SVG, clear Userspace")
ak_cout("[Ctrl+X] cut SVG rootElement to clipboard completed! New SVG, cleared Userspace!")
}
else
{
ak_add2undo()
var ak_tmp_cut=ak_object2update.parentNode
ak_tmp_cut.removeChild(ak_object2update)
try{ak_tmp_cut.removeChild(ak_tmp_prevObj)}catch(error){}
ak_clickset_obj2update(evt,ak_userspace_svg.firstChild)
ak_cout("[Ctrl+X] cut to clipboard completed: "+ak_tmp_cout)
}
}
break
case "Copy Gradient to Clipboard":
case "Copy Filter to Clipboard":
case "Copy Pattern to Clipboard":
ak_make2clipboard=printNode(document.getElementById(id))+"\n"
var ak_tmp_prev=document.getElementById(id).previousSibling
if(ak_tmp_prev=="[object Text]")
{
ak_tmp_prev=printNode(ak_tmp_prev)
if(ak_tmp_prev.lastIndexOf('\n')>=0)
{ak_make2clipboard=ak_tmp_prev.substring(ak_tmp_prev.lastIndexOf('\n')+1)+ak_make2clipboard}
}
ak_make2clipboard=ak_make2clipboard.replace(/(\r\n)/g,"\n")
ak_make2clipboard=ak_make2clipboard.replace(/(\n)/g,"\r\n")
case "copyGradErr":
try{top.clipboardData.setData("Text",ak_make2clipboard)}catch(err){setTimeout("ak_setTimeout('copyGradErr',wohin,id)",100);break}
var ak_tmp_cout=to_do+" completed: "
if (ak_make2clipboard.length>84) ak_tmp_cout+=ak_make2clipboard.substring(0,80)+" ..."
else ak_tmp_cout+=ak_make2clipboard
ak_cout(ak_tmp_cout)
break
}
window.focus(ak_svgroot)
}
var ak_attention=false
// #################################
var ak_exportID=false, ak_setExport, ak_exportIn
window.ak_setExportImage=ak_setExportImage
function ak_setExportImage()
{
var ak_tmpNode='<rect id="ak_aniAllOver" visibility="hidden" onkeydown="ak_exportAbort=true" onmouseout="ak_aniAllOverFunc(\'out\')" onmouseover="ak_aniAllOverFunc(\'over\')" opacity="0" x="0" y="0" width="100%" height="100%"/>'
ak_tmpNode=parseXML(ak_tmpNode,document).firstChild
ak_svgroot.appendChild(ak_tmpNode)
setTimeout("ak_SVGSaver('getExportImageInfo')",100)
}
// #################################
var ak_exportAbort=false
var ak_currentTime=-1, ak_currentTimeComp=-1, ak_currentPan="translate(0,0)", ak_currentPanComp="translate(0,0)"
var ak_actFrame=0 ,ak_actField
function ak_setForImage(info)
{
if(/\|/.test(info))
{
var ak_tmp=info.split("|")
ak_currentTime=parseInt(ak_tmp[3])
if(ak_tmp[4]=="second-field") ak_currentTime+=0.5
ak_actField=ak_tmp[4]
ak_actFrame=ak_currentTime
ak_fps=parseFloat(ak_tmp[2])
ak_currentTime/=ak_fps
if(ak_currentTime!=ak_currentTimeComp)
{
ak_currentTimeComp=ak_currentTime
ak_svgroot.setCurrentTime(ak_currentTime)
}
ak_currentPan="translate(-"+ak_tmp[0]+",-"+ak_tmp[1]+")"
if(ak_currentPan!=ak_currentPanComp)
{
ak_currentPanComp=ak_currentPan
ak_userspace_g.setAttribute("transform",ak_currentPan)
}
setTimeout("ak_aniAllOverFunc(\'visible\')",10)
}
else
{
top.clipboardData.setData("text","setExportNoInfoFound")
setTimeout("ak_SVGSaver('getExportImageInfo')",1000)
}
}
// #################################
window.ak_aniAllOverFunc=ak_aniAllOverFunc
function ak_aniAllOverFunc(what)
{
if(what=="over")
{
setTimeout("ak_aniAllOverFunc(\'hidden\')",10)
}
else if(what=="out")
{
ak_SVGSaver('setExportImageInfo')
}
else if(what=="visible")
{
document.getElementById("ak_aniAllOver").setAttribute("visibility","visible")
}
else if(what=="hidden")
{
document.getElementById("ak_aniAllOver").setAttribute("visibility","hidden")
}
}
// #################################
window.ak_SVGSaver=ak_SVGSaver
var ak_openSVG="", ak_file_selector="", ak_dir_selector="", ak_path_relative=true
var ak_ak_SVGSaver_count=0, ak_directory, ak_file, ak_time_stamp, ak_clipboard2
var ak_SaverHeader, ak_wait=0, ak_ioAction, ak_saver_tested=false, ak_openNew=false
var ak_autostart_saver="start_AKs_SVGSaver.html"
var ak_eval_autostart='ak_saver_starter=window.open(ak_editorDir+ak_autostart_saver, "_blank", "height=108,width=327,scrollbars=no,resizable=no");ak_saver_starter.moveTo(50,50);'
var ak_io_wait_active=false, ak_image_directory='', ak_imageBase64
// #################################
function ak_SVGSaver(to_do,what)
{
var ak_tmp_in, ak_tmp, ak_tmp_ok
switch(to_do)
{
case "getExportImageInfo":
try{ak_exportIn=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('getExportImageInfo')",200);break}
if(ak_exportID)
{
if(ak_exportIn==ak_setExport)
{
setTimeout("ak_SVGSaver('getExportImageInfo')",200)
return
}
else if(!ak_exportIn)
{
setTimeout("ak_SVGSaver('getExportImageInfo')",1000)
return
}
else if(ak_exportIn.substring(0,ak_exportID.length)==ak_exportID)
{
ak_setForImage(ak_exportIn.substring(ak_exportID.length))
return
}
}
else if(/^AKs_SVGSaver;/.test(ak_exportIn))
{
ak_tmp=ak_exportIn.indexOf("\n")
if(ak_tmp>0)
{
ak_exportID=ak_exportIn.substring(0,ak_tmp+1)
if(/;/.test(ak_exportID))
{
var ak_tmpArray=ak_exportID.split(";")
if(ak_tmpArray[3]!="listenExportImage") ak_exportID=false
else
{
ak_setForImage(ak_exportIn.substring(ak_tmp+1))
return
}
}
}
}
setTimeout("ak_SVGSaver('getExportImageInfo')",1000)
break
case "setExportImageInfo":
if(ak_exportAbort)
{
ak_exportAbort=false
ak_setExport="setExportImageAbort"
}
else
{
ak_setExport=ak_exportIn.replace(/^AKs_SVGSaver/,"AKs_SVGEditor")
ak_setExport=ak_setExport.replace(/;listenExportImage;/,";setExportImage;")
}
try{top.clipboardData.setData("text",ak_setExport)}catch(err){setTimeout("ak_SVGSaver('setExportImageInfoErr')",200);break}
setTimeout("ak_SVGSaver('getExportImageInfo')",100)
break
case "setExportImageInfoErr":
try{top.clipboardData.setData("text",ak_setExport)}catch(err){setTimeout("ak_SVGSaver('setExportImageInfoErr')",200);break}
setTimeout("ak_SVGSaver('getExportImageInfo')",100)
break
case "testing":
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_cout("Abort, AKs_SVGSaver.exe is not answering!")
ak_alert("AKs_SVGSaver.exe is not answering!\nPlease start AKs_SVGSaver.exe and try again!")
setTimeout("ak_SVGSaver('restore')",200)
if(ak_ioAction=="image")
{
var ak_tmp_man=confirm("Do you want to enter the image filename manually?")
if(ak_tmp_man)
{
ak_new_object_menu(evt,"imageManually",ak_imageWohin)
return
}
}
break
case "testing_old":
var ak_tmp_time=new Date().toUTCString()
var ak_tmp_cksum=0
for(var i=0;i<ak_tmp_time.length;i++)
{
ak_tmp_cksum+=ak_tmp_time.charCodeAt(i)
}
ak_time_stamp=ak_tmp_time+";"+ak_tmp_cksum
try{top.clipboardData.setData("text","AKs_SVGEditor;"+ak_time_stamp+";testing;"+ak_editorDir+";*.svg;\n")}catch(err){setTimeout("ak_SVGSaver('testing')",200);break}
ak_ak_SVGSaver_count=0
if(!what) ak_wait=3
ak_cout('Testing for AKs_SVGSaver.exe ... '+((ak_wait*8)-ak_ak_SVGSaver_count-1))
setTimeout("ak_SVGSaver('wait_testing')",500)
break
case "wait_testing":
try{ak_tmp_in=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('wait_testing')",200);break}
ak_cout('Testing for AKs_SVGSaver.exe ... '+((ak_wait*8)-ak_ak_SVGSaver_count-1))
ak_tmp_ok=true
if(/^AKs_SVGSaver;/.test(ak_tmp_in))
{
ak_tmp=ak_tmp_in.indexOf("\n")
if(ak_tmp>0)
{
var ak_tmp_cmd=ak_tmp_in.substring(0,ak_tmp)
ak_tmp_cmd=ak_tmp_cmd.split(";")
if(ak_tmp_cmd[1]+";"+ak_tmp_cmd[2]==ak_time_stamp)
{
if(ak_tmp_cmd[3]=="cancel")
{
ak_cout('AKs_SVGSaver is answering!')
ak_saver_starter.close()
setTimeout("ak_SVGSaver(ak_ioAction,'leave_ak_clipboard2')",100)
break
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
if(!ak_tmp_ok)
{
ak_ak_SVGSaver_count++
if(ak_ak_SVGSaver_count>8)
{
ak_ak_SVGSaver_count=0
ak_wait--
if(ak_wait>0) setTimeout("ak_SVGSaver('testing','nix_ak_wait')",500)
else
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_cout("Abort, AKs_SVGSaver.exe is not answering!")
ak_saver_starter.close()
ak_alert("AKs_SVGSaver.exe is not answering!\nPlease start manually!")
setTimeout("ak_SVGSaver('restore')",200)
if(ak_ioAction=="image")
{
var ak_tmp_man=confirm("Do you want to enter the image filename manually?")
if(ak_tmp_man)
{
ak_new_object_menu(evt,"imageManually",ak_imageWohin)
return
}
}
}
}
else setTimeout("ak_SVGSaver('wait_testing')",500)
}
break
case "image":
ak_io_wait_active=true
ak_ioAction="image"
if(!what) {try{ak_clipboard2=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('openSVG')",200);break}}
if(!ak_image_directory) ak_image_directory=ak_directory
var ak_tmp_time=new Date().toUTCString()
var ak_tmp_cksum=0
for(var i=0;i<ak_tmp_time.length;i++)
{
ak_tmp_cksum+=ak_tmp_time.charCodeAt(i)
}
ak_time_stamp=ak_tmp_time+";"+ak_tmp_cksum
if(ak_imageBase64) {try{top.clipboardData.setData("text","AKs_SVGEditor;"+ak_time_stamp+";imageBase64;"+ak_image_directory+";*.*;\n")}catch(err){setTimeout("ak_SVGSaver('image','leave_ak_clipboard2')",200)}}
else if(ak_feImage) {try{top.clipboardData.setData("text","AKs_SVGEditor;"+ak_time_stamp+";image;"+ak_image_directory+";*.*;\n")}catch(err){setTimeout("ak_SVGSaver('image','leave_ak_clipboard2')",200)}}
else {try{top.clipboardData.setData("text","AKs_SVGEditor;"+ak_time_stamp+";image;"+ak_image_directory+";*.*;\n")}catch(err){setTimeout("ak_SVGSaver('image','leave_ak_clipboard2')",200)}}
ak_ak_SVGSaver_count=0; ak_wait=30
if(ak_feImage) ak_cout('Selecting Image-File (*.jpg/*.jpeg/*.gif/*.png) ...')
else ak_cout('Selecting Image-File (*.jpg/*.jpeg/*.gif/*.png/*.svg) ...')
setTimeout("ak_SVGSaver('wait_image')",1000)
break
case "wait_image":
try{ak_tmp_in=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('wait_image')",200);break}
ak_tmp_ok=true
if(/^AKs_SVGSaver;/.test(ak_tmp_in))
{
ak_tmp=ak_tmp_in.indexOf("\n")
if(ak_tmp>0)
{
var ak_tmp_cmd=ak_tmp_in.substring(0,ak_tmp)
ak_tmp_cmd=ak_tmp_cmd.split(";")
if(ak_tmp_cmd[1]+";"+ak_tmp_cmd[2]==ak_time_stamp)
{
if(ak_tmp_cmd[3]=="wait")
{
setTimeout("ak_SVGSaver('wait_image')",300)
break
}
else if(ak_tmp_cmd[3]=="cancel")
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_cout('Selecting Image-File Abort!')
setTimeout("ak_SVGSaver('restore')",200)
break
}
else if(ak_tmp_cmd[3]=="imageAbort")
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_cout('Selecting Image-File is not supported!')
ak_tmp=ak_tmp_in.indexOf("\n")
ak_tmp_in=ak_tmp_in.substring(ak_tmp+1)
if(/\\/.test(ak_tmp_in))
{
ak_image_directory=ak_tmp_in.split("\\")
ak_image_directory.pop()
ak_image_directory=ak_image_directory.join("\\")
}
if(ak_feImage) ak_alert('"'+ak_tmp_cmd[5]+'" is not supported!!\nImage must be \'.jpg\', \'.jpeg\', \'.gif\' or \'.png\'!')
else ak_alert('"'+ak_tmp_cmd[5]+'" is not supported!!\nImage must be \'.jpg\', \'.jpeg\', \'.gif\', \'.png\' or \'.svg\'!')
setTimeout("ak_SVGSaver('restore')",200)
break
}
else if(ak_tmp_cmd[3]=="imageReturn")
{
// image appenden
ak_tmp=ak_tmp_in.indexOf("\n")
ak_tmp_in=ak_tmp_in.substring(ak_tmp+1)
if(ak_tmp_cmd[6]) ak_image_directory=ak_tmp_cmd[6]
else if(!/\.svg$/.test(ak_tmp_cmd[5].toLowerCase()) && /\\/.test(ak_tmp_in))
{
ak_image_directory=ak_tmp_in.split("\\")
ak_image_directory.pop()
ak_image_directory=ak_image_directory.join("\\")
}
else if(/\.svg$/.test(ak_tmp_cmd[5].toLowerCase()))
{
ak_image_directory=ak_tmp_cmd[4]
}
var ak_tmp_svg=""
var ak_tmp_file=ak_tmp_cmd[4]+"\\"+ak_tmp_cmd[5]
if(/\.svg$/.test(ak_tmp_cmd[5].toLowerCase()) && ak_tmp_cmd[6])
{
ak_tmp=ak_tmp_in.indexOf("&")
ak_tmp_svg=ak_tmp_in.substring(ak_tmp+1)
ak_tmp_in=ak_tmp_in.substring(0,ak_tmp)
ak_tmp=ak_tmp_svg.indexOf("<svg")
if(ak_tmp>=0) ak_tmp_svg=ak_tmp_svg.substring(ak_tmp)
else
{
ak_tmp_cmd[4]="200"
ak_tmp_cmd[5]="150"
}
}
else if(/\.svg$/.test(ak_tmp_cmd[5].toLowerCase()))
{
ak_tmp=ak_tmp_in.indexOf("<svg")
if(ak_tmp>=0) ak_tmp_svg=ak_tmp_in.substring(ak_tmp)
else
{
ak_tmp_cmd[4]="200"
ak_tmp_cmd[5]="150"
}
ak_tmp_in=ak_tmp_file
}
if(ak_tmp_svg)
{
ak_tmp_cmd[4]="200"
ak_tmp_cmd[5]="150"
var ak_tmp_svg_object=parseXML(ak_tmp_svg,document).firstChild
try
{
ak_tmp_cmd[4]=ak_tmp_svg_object.getAttribute("width")
ak_tmp_cmd[5]=ak_tmp_svg_object.getAttribute("height")
}
catch(err){}                      
}
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_tmp=ak_tmp_in.lastIndexOf("\\")
if(ak_path_relative && !ak_tmp_cmd[6] && ak_tmp>0)
{
var ak_tmp_file=ak_tmp_in.substring(ak_tmp+1)
var ak_tmp_dir=ak_tmp_in.split("\\")
ak_tmp_dir.pop()
if(/\\/.test(ak_directory)) var ak_tmp_home=ak_directory.split("\\")
else ak_tmp_home=new Array(ak_directory)
if(ak_tmp_home[0].toLowerCase()==ak_tmp_dir[0].toLowerCase())
{
while(true)
{
if(!ak_tmp_home[0] || !ak_tmp_dir[0]) break
if(ak_tmp_home[0].toLowerCase()!=ak_tmp_dir[0].toLowerCase()) break
ak_tmp_home.shift()
ak_tmp_dir.shift()
}
var ak_tmp_prefix=""
for(var i=0;i<ak_tmp_home.length;i++)
{
ak_tmp_prefix+="..\\"
}
if(ak_tmp_dir.length>0) ak_tmp_prefix+=ak_tmp_dir.join("\\")+"\\"
ak_tmp_in=ak_tmp_prefix+ak_tmp_file
}
}
if(ak_feImage)
{
ak_feImageString='<feImage xlink:href="'+ak_tmp_in+'"/>'
eval('ak_add_fe('+ak_feImageArguments.join(",")+')')
}
else
{
var ak_tmp_id=ak_generate_id(evt,"image_")
var ak_tmp_image='<image id="'+ak_tmp_id+'" x="'+ak_imageX+'" y="'+ak_imageY
ak_tmp_image+='" width="'+ak_tmp_cmd[4]+'" height="'+ak_tmp_cmd[5]
ak_tmp_image+='" xlink:href="'+ak_tmp_in+'"/>'
if(ak_imageWohin=="insert") ak_insertBeforeSP(ak_tmp_image,ak_object2update)
else if(ak_imageWohin=="add2Parent") ak_appendChildSP(ak_tmp_image,ak_object2update.parentNode)
else if(ak_imageWohin=="append") ak_appendChildSP(ak_tmp_image,ak_object2update)
else ak_appendChildSP(ak_tmp_image,ak_userspace_svg)
var ak_tmp_object=document.getElementById(ak_tmp_id)
if(ak_tmp_object)
{
//ak_tmp_object.setAttribute("xlink:href",ak_tmp_in)
if(!ak_autoId) try{ak_tmp_object.removeAttribute("id")}catch(error){}
ak_clickset_obj2update(evt,ak_tmp_object)
}
}
setTimeout("ak_SVGSaver('restore')",200)
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
if(!ak_tmp_ok)
{
ak_ak_SVGSaver_count++
if(ak_ak_SVGSaver_count>8)
{
ak_SVGSaver('testing')
}
else setTimeout("ak_SVGSaver('wait_image')",500)
}
break
case "openNew":
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
var ak_tmp_time=new Date().toUTCString()
var ak_tmp_cksum=0
for(var i=0;i<ak_tmp_time.length;i++)
{
ak_tmp_cksum+=ak_tmp_time.charCodeAt(i)
}
ak_time_stamp=ak_tmp_time+";"+ak_tmp_cksum
try{top.clipboardData.setData("text","AKs_SVGEditor;"+ak_time_stamp+";openNew;"+ak_openNew)}catch(err){setTimeout("ak_SVGSaver('openNew','leave_ak_clipboard2')",200);break}
ak_openNew="AKs_SVGSaver;"+ak_time_stamp+";openNewOk;"+ak_openNew
ak_ak_SVGSaver_count=0; ak_wait=30
ak_cout('Open SVG in new window!')
setTimeout("ak_SVGSaver('wait_open_new')",1000)
break
case "wait_open_new":
try{ak_tmp_in=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('wait_open_new')",200);break}
ak_ak_SVGSaver_count++
if(ak_tmp_in==ak_openNew) setTimeout("ak_SVGSaver('restore')",10)
else if(ak_ak_SVGSaver_count<8) setTimeout("ak_SVGSaver('wait_open_new')",500)
else setTimeout("ak_SVGSaver('restore')",10)
break
case "openSVGNew": ak_openNew=true
case "openSVG":
if(to_do=="openSVG") ak_openNew=false
if(ak_dirty_flag && !what && !ak_openNew)
{
var ak_tmp_confirm=confirm("Data-Changes not saved!\nDo you want to continue with 'Open SVG'?")
if(!ak_tmp_confirm) return
}
ak_io_wait_active=true
if(!what) {try{ak_clipboard2=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('openSVG')",200)}}
var ak_tmp_time=new Date().toUTCString()
var ak_tmp_cksum=0
for(var i=0;i<ak_tmp_time.length;i++)
{
ak_tmp_cksum+=ak_tmp_time.charCodeAt(i)
}
ak_time_stamp=ak_tmp_time+";"+ak_tmp_cksum
try{top.clipboardData.setData("text","AKs_SVGEditor;"+ak_time_stamp+";open;"+ak_directory+";*.svg;\n")}catch(err){setTimeout("ak_SVGSaver('openSVG','leave_ak_clipboard2')",200);break}
ak_ak_SVGSaver_count=0; ak_wait=30
ak_cout('Open "*.svg" ...')
if(to_do=="openSVG") setTimeout("ak_SVGSaver('wait_open')",1000)
else setTimeout("ak_SVGSaver('wait_openN')",1000)
break
case "wait_openN":
case "wait_open":
try{ak_tmp_in=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('wait_open')",200);break}
if(to_do=="wait_open") ak_ioAction="openSVG"
else ak_ioAction="openSVGNew"
ak_tmp_ok=true
if(/^AKs_SVGSaver;/.test(ak_tmp_in))
{
ak_tmp=ak_tmp_in.indexOf("\n")
if(ak_tmp>0)
{
var ak_tmp_cmd=ak_tmp_in.substring(0,ak_tmp)
ak_tmp_cmd=ak_tmp_cmd.split(";")
if(ak_tmp_cmd[1]+";"+ak_tmp_cmd[2]==ak_time_stamp)
{
if(ak_tmp_cmd[3]=="wait")
{
setTimeout("ak_SVGSaver('wait_open')",300)
break
}
else if(ak_tmp_cmd[3]=="cancel")
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_cout('Open "*.svg" Abort!')
setTimeout("ak_SVGSaver('restore')",200)
break
}
else if(ak_tmp_cmd[3]=="opened")
{
ak_tmp_in=ak_tmp_in.substring(ak_tmp+1)
ak_tmp=ak_tmp_in.indexOf("<svg")
if(ak_tmp>=0)
{
if(ak_tmp>0)
{
ak_SaverHeader=ak_tmp_in.substring(0,ak_tmp)
ak_tmp_in=ak_tmp_in.substring(ak_tmp)
}
else ak_SaverHeader=""
ak_tmp=false

var ak_tmpSVGTagIndex=ak_tmp_in.indexOf(">")
if(ak_tmpSVGTagIndex==-1)
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_cout('Open Abort!')
ak_alert("No valid SVG-File!")
setTimeout("ak_SVGSaver('restore')",200)
break
}
var ak_tmpSVGTag=ak_tmp_in.substring(0,ak_tmpSVGTagIndex+1)
ak_tmp_in=ak_tmp_in.substring(ak_tmpSVGTagIndex+1)
ak_tmpSVGTag=ak_tmpSVGTag.replace(/ +\=/g,"=")
ak_tmpSVGTag=ak_tmpSVGTag.replace(/\= +/g,"=")
var ak_tmpOnload=ak_tmpSVGTag.search("onload=")
if(ak_tmpOnload==-1)
{
ak_tmp=true
var ak_tmpConfirm=confirm('Do you want to enable "autoStart AKs SVG Editor" for this file?')
if(!ak_tmpConfirm) ak_tmpConfirm=",'menu'"
else ak_tmpConfirm=""
ak_tmpSVGTag=ak_tmpSVGTag.replace(/^\<svg/,'<svg onload="try{ak_init_editor(evt'+ak_tmpConfirm+')}catch(err){}"')
}
else
{
var ak_tmpSVGStart=ak_tmpSVGTag.substring(0,ak_tmpOnload+8)
var ak_tmpSVGEnd=ak_tmpSVGTag.substring(ak_tmpOnload+8)
if(!/^try\{ak_init_editor\(evt/.test(ak_tmpSVGEnd))
{
ak_tmp=true
var ak_tmpConfirm=confirm('Do you want to enable "autoStart AKs SVG Editor" for this file?')
if(!ak_tmpConfirm) ak_tmpConfirm=",'menu'"
else ak_tmpConfirm=""
ak_tmpSVGTag=ak_tmpSVGStart+'try{ak_init_editor(evt'+ak_tmpConfirm+')}catch(err){};'+ak_tmpSVGEnd
}
}
var ak_tmpNachSVG="", ak_tmpScript, ak_tmpI1, ak_tmpParse
do
{
var ak_tmp_editorfilename=""
ak_tmpScript=ak_tmp_in.indexOf("<script ")
if(ak_tmpScript==-1)
{
ak_tmp=true
ak_tmpSVGTag+='\n  <script id="AKs_SVGEditor" xlink:href="'+ak_editorfilename+'" type="text/javascript"/>'
}
else
{
ak_tmpNachSVG+=ak_tmp_in.substring(0,ak_tmpScript)
ak_tmp_in=ak_tmp_in.substring(ak_tmpScript)
ak_tmpI1=ak_tmp_in.indexOf(">")
if(ak_tmpI1==-1) ak_tmpParse=parseXML(ak_tmp_in+"/>",document).firstChild
else ak_tmpParse=parseXML(ak_tmp_in.substring(0,ak_tmpI1+1),document).firstChild
ak_tmpNachSVG+=ak_tmp_in.substring(0,ak_tmpI1+1)
ak_tmp_in=ak_tmp_in.substring(ak_tmpI1+1)
var ak_tmp_link=ak_tmpParse.getAttribute("xlink:href")
if(/aks_svgeditor.js$/.test(ak_tmp_link.toLowerCase()))
{
ak_tmp_link=ak_tmp_link.replace(/\//,"\\")
ak_tmp_link=ak_tmp_link.replace(/^\\/,"")
if(/:/.test(ak_tmp_link)) ak_tmp_editorfilename=ak_tmp_link
else if(/\.\.\\/.test(ak_tmp_link))
{
ak_tmp_link=ak_tmp_link.split("\\")
if(/\\/.test(ak_tmp_cmd[4])) var ak_tmp_folder=ak_tmp_cmd[4].split("\\")
else ak_tmp_folder[0]=ak_tmp_cmd[4]
for(var f=0;f<ak_tmp_link.length;)
{
if(ak_tmp_link[0]=="..")
{
ak_tmp_folder.pop()
ak_tmp_link.shift()
}
else break
}
ak_tmp_editorfilename=ak_tmp_folder.join("\\")+"\\"+ak_tmp_link.join("\\")
}
else
{
ak_tmp_editorfilename=ak_tmp_cmd[4]+"\\"+ak_tmp_link
}
}
}
if(ak_tmp_editorfilename.toLowerCase()==ak_editorfilename.toLowerCase()) break
}
while(ak_tmpScript!=-1)
ak_tmp_in=ak_SaverHeader+ak_tmpSVGTag+ak_tmpNachSVG+ak_tmp_in
if(ak_tmp)
{
var ak_tmp_time=new Date().toUTCString()
var ak_tmp_cksum=0
for(var i=0;i<ak_tmp_time.length;i++)
{
ak_tmp_cksum+=ak_tmp_time.charCodeAt(i)
}
ak_time_stamp=ak_tmp_time+";"+ak_tmp_cksum
var ak_tmp_back=ak_tmp_cmd[5].replace(/\.svg$/,"_backup(nr).svg ...")
ak_cout("Save "+ak_tmp_back)
var ak_tmp_extension=ak_tmp_cmd[5].toLowerCase()
if(/\.svg$/.test(ak_tmp_extension)) ak_SVGSaver('set_wait_saveBackup',"AKs_SVGEditor;"+ak_time_stamp+";saveBackup;"+ak_tmp_cmd[4]+";"+ak_tmp_cmd[5]+";\n"+ak_tmp_in)
else
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_cout('Open Abort!')
ak_alert("File-Extension must be '.svg'!")
setTimeout("ak_SVGSaver('restore')",200)
break
}
break
}
else
{
ak_openSVG=ak_tmp_cmd[4]+"\\"+ak_tmp_cmd[5]
if(!ak_openNew) setTimeout("ak_SVGSaver('restore','ak_openSVG')",10)
else
{
ak_openNew=ak_tmp_cmd[4]+";"+ak_tmp_cmd[5]+";\n"
setTimeout("ak_SVGSaver('openNew')",10)
}
}
}
else
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
setTimeout("ak_SVGSaver('clear')",500)
ak_cout("No SVG-File!!")
return
break
}
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
if(!ak_tmp_ok)
{
ak_ak_SVGSaver_count++
if(ak_ak_SVGSaver_count>8)
{
ak_SVGSaver('testing')
}
else setTimeout("ak_SVGSaver('wait_open')",500)
}
break
case "set_wait_saveBackup":
try{top.clipboardData.setData("text",what)}catch(err){setTimeout("ak_SVGSaver('set_wait_saveBackup',what)",200);break}
ak_ak_SVGSaver_count=0; ak_wait=30
setTimeout("ak_SVGSaver('wait_saveBackup')",1000)
break
case "wait_saveBackup":
try{ak_tmp_in=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('wait_saveBackup')",200);break}
if(/^AKs_SVGSaver;/.test(ak_tmp_in))
{
ak_tmp=ak_tmp_in.indexOf("\n")
if(ak_tmp>0)
{
var ak_tmp_cmd=ak_tmp_in.substring(0,ak_tmp)
ak_tmp_cmd=ak_tmp_cmd.split(";")
if(ak_tmp_cmd[1]+";"+ak_tmp_cmd[2]==ak_time_stamp)
{
if(ak_tmp_cmd[3]=="wait")
{
setTimeout("ak_SVGSaver('wait_saveBackup')",300)
break
}
else if(ak_tmp_cmd[3]=="cancel")
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_cout('saveBackup abort!')
setTimeout("ak_SVGSaver('restore')",200)
break
}
else if(ak_tmp_cmd[3]=="savedBackup")
{
ak_openSVG=ak_tmp_cmd[4]+"\\"+ak_tmp_cmd[5]
if(!ak_openNew) setTimeout("ak_SVGSaver('restore','ak_openSVG')",10)
else
{
ak_openNew=ak_tmp_cmd[4]+";"+ak_tmp_cmd[5]+";\n"
setTimeout("ak_SVGSaver('openNew')",10)
}
}
else
{
ak_ak_SVGSaver_count++
if(ak_ak_SVGSaver_count>8) ak_alert("timeout")
else setTimeout("ak_SVGSaver('wait_saveBackup')",500)
}
}
else
{
ak_ak_SVGSaver_count++
if(ak_ak_SVGSaver_count>8) ak_alert("timeout")
else setTimeout("ak_SVGSaver('wait_saveBackup')",500)
}
}
else
{
ak_ak_SVGSaver_count++
if(ak_ak_SVGSaver_count>8) ak_alert("timeout")
else setTimeout("ak_SVGSaver('wait_saveBackup')",500)
}
}
else
{
ak_ak_SVGSaver_count++
if(ak_ak_SVGSaver_count>8) ak_alert("timeout")
else setTimeout("ak_SVGSaver('wait_saveBackup')",500)
}
break
case "get_ak_clipboard2":
try{ak_clipboard2=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('get_ak_clipboard2')",200);break}
break
case "Save2Disk":
if(ak_attention)
{
ak_alert("New SVG, clear userspace!\nPlease use Save as ...!")
ak_cout("Please use Save as ...!")
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
return
}
ak_io_wait_active=true
if(!what) {try{ak_clipboard2=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('Save2Disk')",200);break}}
ak_saveSetup(evt,"set_ak_make2clipboard")
var ak_tmp_time=new Date().toUTCString()
var ak_tmp_cksum=0
for(var i=0;i<ak_tmp_time.length;i++)
{
ak_tmp_cksum+=ak_tmp_time.charCodeAt(i)
}
ak_time_stamp=ak_tmp_time+";"+ak_tmp_cksum
ak_SVGSaver("set_wait_save","AKs_SVGEditor;"+ak_time_stamp+";save;"+ak_directory+";"+ak_file+";\n"+ak_make2clipboard)
break
case "set_wait_save":
try{top.clipboardData.setData("text",what)}catch(err){setTimeout("ak_SVGSaver('set_wait_save',what)",200);break}
ak_ak_SVGSaver_count=0; ak_wait=30
ak_cout('Save "'+ak_file+'" ...')
setTimeout("ak_SVGSaver('wait_save')",1000)
break
case "wait_save":
try{ak_tmp_in=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('wait_save')",200);break}
ak_ioAction="Save2Disk"
ak_tmp_ok=true
if(/^AKs_SVGSaver;/.test(ak_tmp_in))
{
ak_tmp=ak_tmp_in.indexOf("\n")
if(ak_tmp>0)
{
var ak_tmp_cmd=ak_tmp_in.substring(0,ak_tmp)
ak_tmp_cmd=ak_tmp_cmd.split(";")
if(ak_tmp_cmd[1]+";"+ak_tmp_cmd[2]==ak_time_stamp)
{
if(ak_tmp_cmd[3]=="wait")
{
setTimeout("ak_SVGSaver('wait_save')",300)
break
}
else if(ak_tmp_cmd[3]=="cancel")
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_cout('Save "'+ak_file+'" Abort!')
setTimeout("ak_SVGSaver('restore')",200)
break
}
else if(ak_tmp_cmd[3]=="saved")
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_cout('"'+ak_file+'" saved!')
ak_dirty_flag=false
if(ak_menu_status=="timeline") ak_timeUndoClean=ak_timeUndo.length
setTimeout("ak_SVGSaver('restore')",200)
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
if(!ak_tmp_ok)
{
ak_ak_SVGSaver_count++
if(ak_ak_SVGSaver_count>8)
{
ak_SVGSaver('testing')
}
else setTimeout("ak_SVGSaver('wait_save')",500)
}
break
case "newAs":
ak_io_wait_active=true
if(!what) {try{ak_clipboard2=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('Save2Disk')",200);break}}
var ak_tmp_time=new Date().toUTCString()
var ak_tmp_cksum=0
for(var i=0;i<ak_tmp_time.length;i++)
{
ak_tmp_cksum+=ak_tmp_time.charCodeAt(i)
}
ak_time_stamp=ak_tmp_time+";"+ak_tmp_cksum
ak_ioAction="newAs"
ak_SVGSaver("set_wait_NewsaveAs","AKs_SVGEditor;"+ak_time_stamp+";saveAs;"+ak_directory+";untitled.svg;\n"+ak_make2clipboard)
break
case "set_wait_NewsaveAs":
try{top.clipboardData.setData("text",what)}catch(err){setTimeout("ak_SVGSaver('set_wait_NewsaveAs',what)",200);break}
ak_ak_SVGSaver_count=0; ak_wait=30
ak_cout('New SVG, save as ...')
ak_openNew=true
setTimeout("ak_SVGSaver('wait_saveAs')",1000)
break
case "saveAs":
ak_io_wait_active=true
if(!what) {try{ak_clipboard2=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('Save2Disk')",200);break}}
ak_saveSetup(evt,"set_ak_make2clipboard","saveAs")
var ak_tmp_time=new Date().toUTCString()
var ak_tmp_cksum=0
for(var i=0;i<ak_tmp_time.length;i++)
{
ak_tmp_cksum+=ak_tmp_time.charCodeAt(i)
}
ak_time_stamp=ak_tmp_time+";"+ak_tmp_cksum
ak_ioAction="saveAs"
ak_SVGSaver("set_wait_saveAs","AKs_SVGEditor;"+ak_time_stamp+";saveAs;"+ak_directory+";"+ak_file+";\n"+ak_make2clipboard)
break
case "set_wait_saveAs":
try{top.clipboardData.setData("text",what)}catch(err){setTimeout("ak_SVGSaver('set_wait_saveAs',what)",200);break}
ak_ak_SVGSaver_count=0; ak_wait=30
ak_cout('Save as ...')
setTimeout("ak_SVGSaver('wait_saveAs')",1000)
break
case "wait_saveAs":
try{ak_tmp_in=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('wait_saveAs')",200);break}
ak_tmp_ok=true
if(/^AKs_SVGSaver;/.test(ak_tmp_in))
{
ak_tmp=ak_tmp_in.indexOf("\n")
if(ak_tmp>0)
{
var ak_tmp_cmd=ak_tmp_in.substring(0,ak_tmp)
ak_tmp_cmd=ak_tmp_cmd.split(";")
if(ak_tmp_cmd[1]+";"+ak_tmp_cmd[2]==ak_time_stamp)
{
if(ak_tmp_cmd[3]=="wait")
{
setTimeout("ak_SVGSaver('wait_saveAs')",300)
break
}
else if(ak_tmp_cmd[3]=="cancel")
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_cout('Save as ... abort!')
setTimeout("ak_SVGSaver('restore')",200)
break
}
else if(ak_tmp_cmd[3]=="saveAsAbort")
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_cout('Save as ... abort!')
ak_alert('"'+ak_tmp_cmd[5]+'" not saved!!\nExtension must be \'.svg\'!')
setTimeout("ak_SVGSaver('restore')",200)
break
}
else if(ak_tmp_cmd[3]=="savedAs")
{
ak_attention=false
ak_openSVG=ak_tmp_cmd[4]+"\\"+ak_tmp_cmd[5]
//if(!ak_openNew) setTimeout("ak_SVGSaver('restore','ak_openSVG')",10)
//else
{
ak_openNew=ak_tmp_cmd[4]+";"+ak_tmp_cmd[5]+";\n"
setTimeout("ak_SVGSaver('openNew')",10)
}
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
if(!ak_tmp_ok)
{
ak_ak_SVGSaver_count++
if(ak_ak_SVGSaver_count>8)
{
ak_SVGSaver('testing')
}
else setTimeout("ak_SVGSaver('wait_saveAs')",500)
}
break
case "openSVGSpecial":
if(ak_dirty_flag && !what)
{
var ak_tmp_confirm=confirm("Data-Changes not saved!\nDo you want to continue with 'Open SVG'?")
if(!ak_tmp_confirm) return
}
ak_fileSelectSuccess='window.open(ak_fileSelectFile,"_self")'
case "openSVGNewSpecial":
if(to_do!="openSVGSpecial") ak_fileSelectSuccess='window.open(ak_fileSelectFile,"_blank")'
case "fileSelect":
ak_io_wait_active=true
ak_cout('Select Filename:')
if(!what) {try{ak_clipboard2=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('fileSelect')",200);break}}
var ak_tmp_time=new Date().toUTCString()
var ak_tmp_cksum=0
for(var i=0;i<ak_tmp_time.length;i++)
{
ak_tmp_cksum+=ak_tmp_time.charCodeAt(i)
}
ak_time_stamp=ak_tmp_time+";"+ak_tmp_cksum
ak_ioAction="fileSelect"
if(ak_dir_selector) ak_tmp="AKs_SVGEditor;"+ak_time_stamp+";fileSelect;"+ak_dir_selector+";"+ak_file_selector+";\n"
else ak_tmp="AKs_SVGEditor;"+ak_time_stamp+";fileSelect;"+ak_directory+";"+ak_file_selector+";\n"
try{top.clipboardData.setData("text",ak_tmp);setTimeout("ak_SVGSaver('wait_fileSelect')",200)}catch(err){setTimeout("ak_SVGSaver('fileSelect','ak_clipboard2_ok')",200)}
break
case "wait_fileSelect":
try{ak_tmp_in=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('wait_fileSelect')",200);break}
ak_tmp_ok=true
if(/^AKs_SVGSaver;/.test(ak_tmp_in))
{
ak_tmp=ak_tmp_in.indexOf("\n")
if(ak_tmp>0)
{
var ak_tmp_cmd=ak_tmp_in.substring(0,ak_tmp)
ak_tmp_cmd=ak_tmp_cmd.split(";")
if(ak_tmp_cmd[1]+";"+ak_tmp_cmd[2]==ak_time_stamp)
{
if(ak_tmp_cmd[3]=="wait")
{
setTimeout("ak_SVGSaver('wait_fileSelect')",300)
break
}
else if(ak_tmp_cmd[3]=="cancel")
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_cout('Selecting Filename Abort!')
setTimeout("ak_SVGSaver('restore')",200)
break
}
else if(ak_tmp_cmd[3]=="fileSelected")
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_fileSelectFile=ak_tmp_in.substring(ak_tmp+1)
var ak_tmp=ak_fileSelectFile.lastIndexOf("\\")
if(ak_path_relative && ak_tmp>0)
{
var ak_tmp_file=ak_fileSelectFile.substring(ak_tmp+1)
var ak_tmp_dir=ak_fileSelectFile.split("\\")
ak_tmp_dir.pop()
if(/\\/.test(ak_directory)) var ak_tmp_home=ak_directory.split("\\")
else ak_tmp_home=new Array(ak_directory)
if(ak_tmp_home[0].toLowerCase()==ak_tmp_dir[0].toLowerCase())
{
while(true)
{
if(!ak_tmp_home[0] || !ak_tmp_dir[0]) break
if(ak_tmp_home[0].toLowerCase()!=ak_tmp_dir[0].toLowerCase()) break
ak_tmp_home.shift()
ak_tmp_dir.shift()
}
var ak_tmp_prefix=""
for(var i=0;i<ak_tmp_home.length;i++)
{
ak_tmp_prefix+="..\\"
}
if(ak_tmp_dir.length>0) ak_tmp_prefix+=ak_tmp_dir.join("\\")+"\\"
ak_fileSelectFile=ak_tmp_prefix+ak_tmp_file
}
}
eval(ak_fileSelectSuccess)
setTimeout("ak_SVGSaver('restore')",200)
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
if(!ak_tmp_ok)
{
ak_ak_SVGSaver_count++
if(ak_ak_SVGSaver_count>8)
{
ak_SVGSaver('testing')
}
else setTimeout("ak_SVGSaver('wait_fileSelect')",500)
}
break
case "openEditor":
if(ak_dirty_flag && !what)
{
var ak_tmp_confirm=confirm("Data-Changes not saved!\nDo you want to continue open with Text-Editor?")
if(!ak_tmp_confirm) return
}
ak_io_wait_active=true
ak_cout('Open in Text-Editor ...')
if(!what) {try{ak_clipboard2=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('openEditor')",200);break}}
var ak_tmp_time=new Date().toUTCString()
var ak_tmp_cksum=0
for(var i=0;i<ak_tmp_time.length;i++)
{
ak_tmp_cksum+=ak_tmp_time.charCodeAt(i)
}
ak_time_stamp=ak_tmp_time+";"+ak_tmp_cksum
ak_ioAction="openEditor"
ak_tmp="AKs_SVGEditor;"+ak_time_stamp+";openEditor;"+ak_directory+";"+ak_file+";\n"
try{top.clipboardData.setData("text",ak_tmp);setTimeout("ak_SVGSaver('wait_Editor')",200)}catch(err){setTimeout("ak_SVGSaver('openEditor','ak_clipboard2_ok')",200)}
break
case "wait_Editor":
try{ak_tmp_in=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('wait_Editor')",200);break}
ak_tmp_ok=true
if(/^AKs_SVGSaver;/.test(ak_tmp_in))
{
ak_tmp=ak_tmp_in.indexOf("\n")
if(ak_tmp>0)
{
var ak_tmp_cmd=ak_tmp_in.substring(0,ak_tmp)
ak_tmp_cmd=ak_tmp_cmd.split(";")
if(ak_tmp_cmd[1]+";"+ak_tmp_cmd[2]==ak_time_stamp)
{
if(ak_tmp_cmd[3]=="wait")
{
setTimeout("ak_SVGSaver('wait_Editor')",300)
break
}
else if(ak_tmp_cmd[3]=="cancel")
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_cout('Open in Text-Editor Abort!')
setTimeout("ak_SVGSaver('restore')",200)
break
}
else if(ak_tmp_cmd[3]=="openedEditor")
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_cout('Opened with Text-Editor!')
setTimeout("ak_SVGSaver('restore')",200)
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
if(!ak_tmp_ok)
{
ak_ak_SVGSaver_count++
if(ak_ak_SVGSaver_count>8)
{
ak_SVGSaver('testing')
}
else setTimeout("ak_SVGSaver('wait_Editor')",500)
}
break
case "exportAck":
var ak_tmp_time=new Date().toUTCString()
var ak_tmp_cksum=0
for(var i=0;i<ak_tmp_time.length;i++)
{
ak_tmp_cksum+=ak_tmp_time.charCodeAt(i)
}
ak_time_stamp=ak_tmp_time+";"+ak_tmp_cksum
ak_tmp="AKs_SVGEditor;"+ak_time_stamp+";exportAck;"+ak_directory+";"+ak_file+";\n"+ak_exportFile
try{top.clipboardData.setData("text",ak_tmp)}catch(err){setTimeout("ak_SVGSaver('exportAck','ak_clipboard2_ok')",200)}
ak_timeMain(evt,"timeVariable")
break
case "export":
ak_io_wait_active=true
if(!what) {try{ak_clipboard2=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('export')",200);break}}
var ak_tmp_time=new Date().toUTCString()
var ak_tmp_cksum=0
for(var i=0;i<ak_tmp_time.length;i++)
{
ak_tmp_cksum+=ak_tmp_time.charCodeAt(i)
}
ak_time_stamp=ak_tmp_time+";"+ak_tmp_cksum
ak_ioAction="export"
ak_tmp="AKs_SVGEditor;"+ak_time_stamp+";export;"+ak_directory+";"+ak_file+";\n"+ak_exportFrames
try{top.clipboardData.setData("text",ak_tmp);setTimeout("ak_SVGSaver('wait_export')",200)}catch(err){setTimeout("ak_SVGSaver('export','ak_clipboard2_ok')",200)}
break
case "wait_export":
try{ak_tmp_in=top.clipboardData.getData("text")}catch(err){setTimeout("ak_SVGSaver('wait_export')",200);break}
ak_tmp_ok=true
if(/^AKs_SVGSaver;/.test(ak_tmp_in))
{
ak_tmp=ak_tmp_in.indexOf("\n")
if(ak_tmp>0)
{
var ak_tmp_cmd=ak_tmp_in.substring(0,ak_tmp)
ak_tmp_cmd=ak_tmp_cmd.split(";")
if(ak_tmp_cmd[1]+";"+ak_tmp_cmd[2]==ak_time_stamp)
{
if(ak_tmp_cmd[3]=="wait")
{
setTimeout("ak_SVGSaver('wait_export')",300)
break
}
else if(ak_tmp_cmd[3]=="exportAbort")
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_cout('Export Indexed-Frames Abort!')
setTimeout("ak_SVGSaver('restore')",200)
ak_alert("Wrong file naming. Check index and extension!\n\""+ak_tmp_in.substring(ak_tmp+1)+'"')
break
}
else if(ak_tmp_cmd[3]=="cancel")
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_cout('Export Indexed-Frames Cancel!')
setTimeout("ak_SVGSaver('restore')",200)
break
}
else if(ak_tmp_cmd[3]=="exportOk")
{
ak_io_wait.setAttribute('visibility','hidden'); ak_io_wait_active=false
ak_exportFile=ak_tmp_in.substring(ak_tmp+1)
setTimeout("ak_SVGSaver('exportAck')",100)
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
}
else ak_tmp_ok=false
if(!ak_tmp_ok)
{
ak_ak_SVGSaver_count++
if(ak_ak_SVGSaver_count>8) ak_SVGSaver('testing')
else setTimeout("ak_SVGSaver('wait_export')",500)
}
break
case "restore":
if(ak_clipboard2)
{
try{top.clipboardData.setData("text",ak_clipboard2)}
catch(err){setTimeout("ak_SVGSaver('restore')",200);break}
}
else
{
try{top.clipboardData.clearData("text")}
catch(err){setTimeout("ak_SVGSaver('restore')",200);break}
}
if(what) window.open(ak_openSVG,"_self")
ak_file_selector="", ak_dir_selector="", ak_openNew=false
break
case "clear":
try{top.clipboardData.clearData("text")}
catch(err){setTimeout("ak_SVGSaver('restore')",200)}
ak_file_selector="", ak_dir_selector="", ak_openNew=false
break
}
}
// ######################
function ak_saveSetup(evt,what,saveAs)
{
if(what=="set_ak_make2clipboard")
{
if(saveAs)
{
var ak_tmp=''
if(ak_editorObject)
{
ak_tmp=ak_editorObject.getAttribute("xlink:href")
ak_editorObject.setAttribute("xlink:href",ak_editorfilename)
}
}
if(ak_svg_header2!="") ak_make2clipboard=ak_svg_header2
else ak_make2clipboard=ak_svg_header
ak_saveSetup(evt,"setup")
var ak_tmp_object=ak_userspace_svg.firstChild
ak_userspace_svg.removeChild(ak_tmp_object)
ak_make2clipboard+=printNode(ak_userspace_svg)+"\r\n"
ak_userspace_svg.insertBefore(ak_tmp_object,ak_userspace_svg.firstChild)
ak_saveSetup(evt,"setback")
if(saveAs && ak_editorObject) ak_editorObject.setAttribute("xlink:href",ak_tmp)
ak_make2clipboard=ak_make2clipboard.replace(/( onmousedown="ak_MoveEditRect_flag=true;ak_clickset_obj2update\(evt\);)/g,' onmousedown="') //'
ak_make2clipboard=ak_make2clipboard.replace(/( onmousedown="")/g,"")
ak_make2clipboard=ak_make2clipboard.replace(/(\r\n)/g,"\n")
ak_make2clipboard=ak_make2clipboard.replace(/(\n)/g,"\r\n")
}
else if(what=="setup")
{
var ak_tmpSys=document.getElementById("ak_variable_system")
//x,y,zoom,timeline,grid,color,cache1,cache2,cache3,cache4,toolON,shortMenu
ak_tmp=ak_grid_pan_x+"|"+ak_grid_pan_y+"|"+ak_grid_zoom+"|"+ak_menu_status
ak_tmp+="|"+ak_grid_what
if(ak_grid_what.search("toolbox")==-1) ak_tmp+="|"+ak_getAttribute(document.getElementById("ak_no_selection"),"fill")
else ak_tmp+="|"+ak_getAttribute(ak_userspace_svg.firstChild,"fill")
ak_tmp+="|"+ak_getAttribute(ak_colPreFill,"fill")+"|"+ak_getAttribute(ak_colPreStroke,"fill")+"|"+ak_getAttribute(ak_colCache1,"fill")+"|"+ak_getAttribute(ak_colCache2,"fill")
if(ak_getAttribute(document.getElementById("ak_s_v_show"),"visibility")=="hidden") ak_tmp+="|toolOFF"
else ak_tmp+="|toolON"
if(ak_getAttribute(ak_topShort,"visibility")=="hidden") ak_tmp+="|standardMenu"
else ak_tmp+="|shortMenu"
ak_tmp+="|"+ak_keySplineX+"|"+ak_keySplineY+"|"+ak_keySplineScale
if(ak_tmpSys && ak_tmpSys.tagName=="text")
{
if(!ak_tmpSys.firstChild || /^\[object Text/.test(ak_tmpSys))
{
ak_tmp='<text id="ak_variable_system" visibility="hidden">'+ak_tmp+'</text>'
ak_tmpSys.parentNode.replaceChild(parseXML(ak_tmp,document).firstChild,ak_tmpSys)
}
else ak_tmpSys.firstChild.data=ak_tmp
}
else if(ak_tmpSys) ak_alert('WARNING:\nid="ak_variable_system" used for\n'+ak_tmpSys)
else
{
var ak_tmpEnabled=ak_undo_enabled
ak_undo_enabled=false
ak_appendChildSP('<text id="ak_variable_system" visibility="hidden">'+ak_tmp+'</text>',ak_getDefs())
ak_undo_enabled=ak_tmpEnabled
}
if(ak_menu_status=="timeline")
{
ak_timeMain(evt,"timeVariable")
if(ak_checkLink.length>0)
{
for(var i=0;i<ak_checkLink.length;i++)
{
if(ak_checkLink[i][1])
{
if(ak_checkLink[i][3]) ak_checkLink[i][0].setAttribute("onclick",ak_checkLink[i][3])
else {try{ak_checkLink[i][0].removeAttribute("onclick")}catch(error){}}
if(ak_checkLink[i][2]) ak_checkLink[i][0].setAttribute("target",ak_checkLink[i][2])
else {try{ak_checkLink[i][0].removeAttribute("target")}catch(error){}}
}
}
}
var ak_tmp
for(var i=0;i<ak_animationArray.length;i++)
{
if(ak_animationArray[i][1])
{
ak_tmp=ak_animationArray[i][1]
if(ak_animationArray[i][2]) ak_tmp+="+"+ak_round(ak_animationArray[i][2],1000)
if(ak_animationArray[i][3]) ak_tmp+=";"+ak_animationArray[i][3]
ak_animationArray[i][0].setAttribute("begin",ak_tmp)
}
else if(typeof(ak_animationArray[i][2])=="number")
{
ak_tmp=ak_round(ak_animationArray[i][2],1000)
if(ak_animationArray[i][3]) ak_tmp+=";"+ak_animationArray[i][3]
ak_animationArray[i][0].setAttribute("begin",ak_tmp)
}
else try{ak_animationArray[i][0].removeAttribute("begin")}catch(err){}
if(ak_animationArray[i][4])
{
ak_tmp=ak_animationArray[i][4]
if(ak_animationArray[i][5]) ak_tmp+="+"+ak_round(ak_animationArray[i][5],1000)
if(ak_animationArray[i][6]) ak_tmp+=";"+ak_animationArray[i][6]
ak_animationArray[i][0].setAttribute("end",ak_tmp)
}
else if(typeof(ak_animationArray[i][5])=="number")
{
ak_tmp=ak_round(ak_animationArray[i][5],1000)
if(ak_animationArray[i][6]) ak_tmp+=";"+ak_animationArray[i][6]
ak_animationArray[i][0].setAttribute("end",ak_tmp)
}
else try{ak_animationArray[i][0].removeAttribute("end")}catch(err){}
if(typeof(ak_animationArray[i][7])=="number") ak_animationArray[i][7]=ak_round(ak_animationArray[i][7],1000)
ak_animationArray[i][0].setAttribute("dur",ak_animationArray[i][7])
if(typeof(ak_animationArray[i][8])=="number") ak_animationArray[i][8]=ak_round(ak_animationArray[i][8],1000)
if(ak_animationArray[i][8]) ak_animationArray[i][0].setAttribute("repeatCount",ak_animationArray[i][8])
else try{ak_animationArray[i][0].removeAttribute("repeatCount")}catch(err){}
if(typeof(ak_animationArray[i][9])=="number") ak_animationArray[i][9]=ak_round(ak_animationArray[i][9],1000)
if(ak_animationArray[i][9]) ak_animationArray[i][0].setAttribute("repeatDur",ak_animationArray[i][9])
else if(typeof(ak_animationArray[i][9])=="number") ak_animationArray[i][0].setAttribute("repeatDur",ak_animationArray[i][9])
else try{ak_animationArray[i][0].removeAttribute("repeatDur")}catch(err){}
}
}
}
else if(what=="setback")
{
if(ak_menu_status=="timeline")
{
var ak_tmp_a=ak_userspace_svg.getElementsByTagName("a")
ak_checkLink=new Array
for(var i=0;i<ak_tmp_a.length;i++)
{
ak_checkLink[i]=new Array(ak_tmp_a.item(i),"","","")
ak_checkLink[i][1]=ak_checkLink[i][0].getAttribute("xlink:href")
if(ak_checkLink[i][1])
{
ak_checkLink[i][2]=ak_checkLink[i][0].getAttribute("target")
if(/(_parent)|(_self)|(_top)/.test(ak_checkLink[i][2]) ||!ak_checkLink[i][2])
{
ak_checkLink[i][3]=ak_checkLink[i][0].getAttribute("onclick")
ak_checkLink[i][0].setAttribute("onclick","ak_redirectAlways(evt);"+ak_checkLink[i][3])
ak_checkLink[i][0].setAttribute("target","redirect")
}
}
}
for(var i=0;i<ak_animationArray.length;i++)
{
if(typeof(ak_animationArray[i][2])=="number") ak_animationArray[i][2]=ak_round(ak_animationArray[i][2],1000)
if(typeof(ak_animationArray[i][5])=="number") ak_animationArray[i][5]=ak_round(ak_animationArray[i][5],1000)
ak_round(ak_animationArray[i][11],1000)
if(ak_animationArray[i][11]>0)
{
ak_animationArray[i][0].setAttribute("begin",ak_animationArray[i][11])
}
else if(ak_animationArray[i][2]) ak_animationArray[i][0].setAttribute("begin",ak_animationArray[i][2])
else ak_animationArray[i][0].setAttribute("begin",0)
if(ak_animationArray[i][13]>0) ak_animationArray[i][0].setAttribute("end",ak_animationArray[i][13])
}
}
}
}
// ############## short cuts key up ##########################################
var ak_key_status=new Array(256); // shiftKey index =16, ctrl Key index = 17
function ak_key_up(evt)
{
if(ak_menu_status=="final_view") return
var key_up=evt.getKeyCode();
ak_key_status[key_up]="up";
if(ak_menu_status=="timeline")
{
if(key_up==32 && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey())
{ // Spacebar - Pan
ak_space_down=false
ak_cout("")
return
}
if(key_up==0x53 && !evt.shiftKey() && evt.ctrlKey() && !evt.altKey())
{ // [Ctrl+S]
ak_io_wait.setAttribute('transform','translate('+(evt.getClientX+2)+','+(evt.getClientY-11)+')')
ak_io_wait.setAttribute('visibility','visible'); ak_io_wait_active=true
ak_cout('Save "'+ak_file+'" ...')
setTimeout("ak_SVGSaver('Save2Disk')",500)
return
}
return
}
// dann Animation in progress
if(ak_svgroot.getCurrentTime()<ak_aniStop) return
//   nix ak_selection("show")
if(!ak_set_path_point)
{ // [C] [L] [M] [Q] [X]
if(ak_key_status[67]=="up" && ak_key_status[0x4c]=="up" && ak_key_status[0x4d]=="up" && ak_key_status[0x51]=="up")
{
ak_add_pathPoint(false)
}
}
if(key_up==67 && !evt.shiftKey() && evt.ctrlKey() && !evt.altKey())
{ // [Ctrl+C]
ak_cout("[Ctrl+C] copy to Clipboard in progress ...")
setTimeout("ak_setTimeout('copyToClipboard')",10)
return
}
if(key_up==0x53 && !evt.shiftKey() && evt.ctrlKey() && !evt.altKey())
{ // [Ctrl+S]
ak_io_wait.setAttribute('transform','translate('+(evt.getClientX+2)+','+(evt.getClientY-11)+')')
ak_io_wait.setAttribute('visibility','visible'); ak_io_wait_active=true
ak_cout('Save "'+ak_file+'" ...')
setTimeout("ak_SVGSaver('Save2Disk')",500)
return
}
if((key_up==16 && ak_key_status[17]=='down') || (key_up==17 && ak_key_status[16]=='down'))
{ // [Ctrl+Shift] switch edit mode xy or translate or matrix
if(ak_MoveEditRect_flag==true) return
if(ak_grouping_noSwitch)
{
ak_grouping_noSwitch=false
return
}
ak_switch_xy_transform()
}
if(key_up==32)
{ // Spacebar - Pan off, oder shift up oder ctrl up
if(ak_edit_which_attribute=="matrix") ak_cout(ak_transform_cout)
else ak_cout(ak_tagName_cout)
if(key_up==32 && ak_space_down)
{
ak_selection('show')
ak_space_down=false
}
return
}
}
// ##############
/*function ak_message(message)
{
ak_error_cout=message+'\n--------- message buffer -------------\n'+ak_error_cout
if(ak_error_cout.length>5000) ak_error_cout=ak_error_cout.substring(0,5000)
ak_key_down_cout=''
}
var ak_key_down_cout="undefined", ak_error_cout=''*/
// ############## short cuts key down ##########################################
var ak_set_path_point=false, ak_keyCode_cout=false, ak_space_down=false
var ak_key_1enable=false
function ak_key_down(evt)
{
if(ak_menu_status=="final_view") return
var key_down=evt.getKeyCode()
var ak_tmp
if(ak_set_path_point)
{
ak_add_c.setAttribute("style","visibility:hidden")
ak_add_m.setAttribute("style","visibility:hidden")
ak_add_l.setAttribute("style","visibility:hidden")
ak_add_q.setAttribute("style","visibility:hidden")
ak_set_path_point=false
ak_pathAddPoint=false
}
if(ak_key_status[key_down]=="down") {evt.stopPropagation();return} //return // no automatic repeats
ak_key_status[evt.getKeyCode()]="down"
if(ak_menu_status=="timeline")
{
if(key_down==32 && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey())
{ // Spacebar - Pan
ak_space_down=true
//ak_selection('hide')
if(ak_playTrue) ak_timeMain(evt,'Pause')
ak_cout("Pan-Mode")
return
}
if((evt.getKeyCode()==0x50) && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey()) 
{ // [P]
if(ak_playTrue) ak_timeMain(evt,'Pause')
else ak_timeMain(evt,'Play')
return
}
else if(ak_playTrue) ak_timeMain(evt,'Pause')
if((evt.getKeyCode()==0x49) && !evt.ctrlKey() && !evt.altKey()) 
{ // [I]
if(!evt.shiftKey()) ak_timeMain(evt,'Inpoint')
else ak_timeMain(evt,'SetInpoint')
return
}
if((evt.getKeyCode()==0x4f) && !evt.ctrlKey() && !evt.altKey()) 
{ // [O]
if(!evt.shiftKey()) ak_timeMain(evt,'Outpoint')
else  ak_timeMain(evt,'SetOutpoint')
return
}
if((evt.getKeyCode()==0x30) && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey()) 
{ // [0]
ak_timeMain(evt,'0point')
return
}
if((evt.getKeyCode()==32) && !evt.shiftKey() && evt.ctrlKey() && !evt.altKey()) 
{ // [Ctrl+Space]
ak_timeMain(evt,'Start0')
return
}
if((evt.getKeyCode()==17) && ak_key_status[32]=="down") 
{ // [Ctrl+Space]
ak_timeMain(evt,'Start0')
return
}
if(key_down==0x59 && !evt.shiftKey() && evt.ctrlKey() && !evt.altKey())
{ // [Ctrl+Y]
ak_timeMain(evt,'redo')
return
}
if(key_down==0x5a && !evt.shiftKey() && evt.ctrlKey() && !evt.altKey())
{ // [Ctrl+Z]
ak_timeMain(evt,'undo')
return
}
var ak_tmp_x=evt.clientX
if(evt.clientY<ak_timeline_top)
{
if (((ak_key_status[89]=="down" || ak_key_status[90]=="down") && (ak_key_status[65]=="down")) && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey()) // ZoomIn  ak_object2update.getId()=="ak_no_selection" && 
{ // [A+Y] or [A+Z]
ak_grid_on_off(evt,"ZoomReset")
return
}
if ((evt.getKeyCode()==65) && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey()) 
{ // [A]
ak_grid_on_off(evt,"ZoomIn")
return
}
if ((evt.getKeyCode()==89 || evt.getKeyCode()==90) && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey())
{ // [Y] or [Z]
ak_grid_on_off(evt,"ZoomOut")
return
}
}
else
{
if (((ak_key_status[89]=="down" || ak_key_status[90]=="down") && (ak_key_status[65]=="down")) && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey()) // ZoomIn  ak_object2update.getId()=="ak_no_selection" && 
{ // [A+Y] or [A+Z]
ak_timeMain(evt,'ShowComplete')
return
}
if ((evt.getKeyCode()==65) && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey()) 
{ // [A]
ak_timeMain(evt,'Stretch')
return
}
if ((evt.getKeyCode()==89 || evt.getKeyCode()==90) && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey())
{ // [Y] or [Z]
ak_timeMain(evt,'Shrink')
return
}
}
return
}
// Animation stop
if(ak_svgroot.getCurrentTime()<ak_aniStop)
{ak_animation("stop");ak_selection('show')}
//               
if(key_down==0x31 && ak_key_1enable)
{ // 1
if(typeof(ak_key_1enable)=="string")
{
try
{
eval(ak_key_1enable)
}
catch(err){ak_alert('eval("'+ak_key_1enable+'")'+' !!!! Error !!!!')}
return
}
if(evt.ctrlKey())
{
if(!ak_keyCode_cout) ak_keyCode_cout=1
else ak_keyCode_cout++
if(ak_keyCode_cout>2) ak_keyCode_cout=false
if(ak_keyCode_cout==1) {ak_cout("keyCode = "+key_down+" | SHORTCUT OR display keyCode!")}
else if(ak_keyCode_cout==2) {ak_cout("keyCode = "+key_down+" | NO SHORTCUT, display keyCode!")}
else {ak_cout("keyCode = "+key_down+" | SHORTCUT, normal operation!")}
return
}
if(ak_keyCode_cout==2) {ak_cout("keyCode = "+key_down);return}
return
}
if(ak_keyCode_cout==2) {ak_cout("keyCode = "+key_down);return}
if(key_down==32 && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey())
{ // Spacebar - Pan
ak_space_down=true
ak_selection('hide')
ak_cout("Pan-Mode")
return
}
if(key_down==27 && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey())
{ // esc = deselect
ak_deselect(evt)
if(ak_grouping.length>0)
{
ak_grouping_noSwitch=false
ak_toolGroup.setAttribute("visibility","hidden")
ak_grouping=new Array()
ak_gr_index=new Array()
}
return
}
if(key_down==13 && !evt.shiftKey() && !evt.altKey())
{ // [Enter] = deselect
if(ak_autoMode)
{
ak_animate_auto('autoStop')
return
}
else if(evt.ctrlKey())
{// lastFile for AKs_SVGSaver
return
}
return
}
if(ak_edit_which_attribute=="xy_etc")
{
if(key_down==67 && !evt.ctrlKey() && !evt.altKey() && ak_obj_data[0]=="path")
{ // [C]
if(ak_edit_gradient_flag) return
if(evt.shiftKey())
{
ak_set_path_point=67
}
ak_add_c.setAttribute('style',"font:arial;font-weight:bold;font-size:14;fill:#f90")
ak_add_pathPoint(true)
return
}
if(key_down==0x4c && !evt.ctrlKey() && !evt.altKey() && ak_obj_data[0]=="path")
{ // [L]
if(ak_edit_gradient_flag) return
if(evt.shiftKey())
{
ak_set_path_point=0x4c
}
ak_add_l.setAttribute('style',"font:arial;font-weight:bold;font-size:14;fill:#0cf")
ak_add_pathPoint(true)
return
}
if(key_down==0x4d && !evt.ctrlKey() && !evt.altKey() && ak_obj_data[0]=="path")
{ // [M]
if(ak_edit_gradient_flag) return
ak_add_m.setAttribute('style',"font:arial;font-weight:bold;font-size:14;fill:#00f")
ak_add_pathPoint(true)
return
}
if(key_down==0x51 && !evt.ctrlKey() && !evt.altKey() && ak_obj_data[0]=="path")
{ // [Q]
if(ak_edit_gradient_flag) return
if(evt.shiftKey())
{
ak_set_path_point=0x51
}
ak_add_q.setAttribute('style',"font:arial;font-weight:bold;font-size:14;fill:#8f0")
ak_add_pathPoint(true)
return
}
}
if(key_down==0x58 && !evt.ctrlKey() && !evt.altKey() && (ak_obj_data[0]=="path" || ak_edit_gradient_flag))
{ // [X]
ak_del_x.setAttribute('style',"font:arial;font-weight:bold;font-size:14;fill:#000")
ak_add_pathPoint(true)
return
}
if(key_down==0x56 && !evt.shiftKey() && evt.ctrlKey() && !evt.altKey())
{ // [Ctrl+V]
ak_cout("[Ctrl+V] paste from Clipboard in progress ...")
setTimeout("ak_setTimeout('pasteFromClipboard','add2Parent')",100)
return
}
if(key_down==0x47 && !evt.shiftKey() && evt.ctrlKey() && !evt.altKey())
{ // [Ctrl+G]
ak_cout("[Ctrl+G] replace from Clipboard (Id-match) in progress ...")
setTimeout("ak_setTimeout('replaceFromClipboard')",10)
return
}
if(key_down==0x58 && !evt.shiftKey() && evt.ctrlKey() && !evt.altKey())
{ // [Ctrl+X]
ak_cout("[Ctrl+X] cut to Clipboard in progress ...")
setTimeout("ak_setTimeout('cutToClipboard')",10)
return
}
if(key_down==127 && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey())
{ // [Del]
if(ak_object2update_nodeNr=="" || ak_object2update_nodeNr==-1 || ak_object2update_nodeNr==0)
{
ak_cout("[Del] nothing selected to delete!")
return
}
else
{
ak_add2undo()
var ak_tmp_object=ak_object2update.previousSibling()
if(/^\[object Text/.test(ak_tmp_object)) ak_tmp_object.parentNode.removeChild(ak_tmp_object)
ak_object2update.parentNode.removeChild(ak_object2update)
ak_clickset_obj2update(evt,document.getElementById('ak_no_selection'))
ak_cout("[Del] object deleted!")
return
}
}
if(key_down==0x59 && !evt.shiftKey() && evt.ctrlKey() && !evt.altKey())
{ // [Ctrl+Y]
//ak_cout("[Ctrl+Y] Redo in progress ...")
ak_doRedo()
return
}
if(key_down==0x5a && !evt.shiftKey() && evt.ctrlKey() && !evt.altKey())
{ // [Ctrl+Z]
//ak_cout("[Ctrl+Z] Undo in progress ...")
ak_doUndo()
return
}
if(key_down==0x20 && !evt.shiftKey() && evt.ctrlKey() && !evt.altKey())
{ // [Ctrl+Space]
ak_space_down=true
ak_selection('hide')
ak_cout("[Ctrl+Space] Start Animation (setCurrentTime(0))!")
ak_animation("start")
return
}
else if(key_down==17 && !evt.shiftKey() && ak_key_status[32]=="down" && !evt.altKey())
{ // [Ctrl+Space]
ak_space_down=true
ak_selection('hide')
ak_cout("[Ctrl+Space] Start Animation (setCurrentTime(0))!")
ak_animation("start")
return
}
/*if(key_down==0x20 && evt.shiftKey() && !evt.ctrlKey() && !evt.altKey())
{ // [Shift+Space]
ak_cout("[Shift+Space] Stop Animation (setCurrentTime(10000))!")
//ak_cout("[Shift+Space] Stop Animation (setCurrentTime(0))!")
ak_animation("stop")
return
}
else if(key_down==16 && ak_key_status[32]=="down" && !evt.ctrlKey() && !evt.altKey())
{ // [Shift+Space]
ak_cout("[Shift+Space] Stop Animation (setCurrentTime(10000))!")
//ak_cout("[Shift+Space] Stop Animation (setCurrentTime(0))!")
ak_animation("stop")
return
}*/
if(key_down==0x56 && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey())
{ // [V]
if(ak_autoMode && !ak_multiName) ak_animate_auto('autoEnd')
else if(ak_autoMode) ak_animate_auto('autoAdd2Values')
else if(ak_freezeArray.length>0)
{
ak_edit_animate('add2Values',ak_which_nodeNr(ak_getObject(ak_animate2update).parentNode),ak_animate2update,ak_attribute2update)
}
return
}
if(key_down==0x47 && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey())
{ // [G]
if(ak_autoMode && ak_multiName) ak_animate_auto('autoSet2Value')
else if(ak_autoMode)
{
ak_animate_auto('autoRestart')
}
else if(ak_freezeArray.length>0 && ak_valueNr!=-1)
{
ak_edit_animate('set2Value',ak_which_nodeNr(ak_getObject(ak_animate2update).parentNode),ak_animate2update,ak_attribute2update,ak_valueNr)
ak_cout('Replaced value ('+(ak_valueNr+1)+'.)')
}
return
}
if(key_down==226)
{ // [<]
if(/\,/.test(ak_object2update_nodeNr))
{
ak_tmp=ak_object2update_nodeNr.split(",")
ak_tmp.pop()
ak_clickset_obj2update(evt,ak_getObject(ak_tmp.join(",")))
}
return
}
if(key_down==38)
{ // [ arrowUp]
if(ak_freezeArray.length>0)
{
if(!evt.shiftKey())
{
ak_tmp=ak_valueNr-1
ak_tmp=ak_tmp<0?0:ak_tmp
ak_edit_animate('set2Attribute',ak_which_nodeNr(ak_getObject(ak_animate2update).parentNode),ak_animate2update,ak_attribute2update,ak_tmp)
}
else ak_edit_animate('set2Attribute',ak_which_nodeNr(ak_getObject(ak_animate2update).parentNode),ak_animate2update,ak_attribute2update,0)
}
return
}
if(key_down==40)
{ // [ arrowDown]
if(ak_freezeArray.length>0)
{
var ak_tmp_values=ak_getObject(ak_animate2update).getAttribute("values")
if(/;/.test(ak_tmp_values)) ak_tmp_values=ak_tmp_values.split(";")
else ak_tmp_values=new Array(ak_tmp_values)
if(!evt.shiftKey())
{
ak_tmp=ak_valueNr<0?ak_tmp_values.length-1:ak_valueNr+1
ak_tmp=ak_tmp>ak_tmp_values.length-1?ak_tmp_values.length-1:ak_tmp
ak_edit_animate('set2Attribute',ak_which_nodeNr(ak_getObject(ak_animate2update).parentNode),ak_animate2update,ak_attribute2update,ak_tmp)
}
else ak_edit_animate('set2Attribute',ak_which_nodeNr(ak_getObject(ak_animate2update).parentNode),ak_animate2update,ak_attribute2update,(ak_tmp_values.length-1))
}
return
}
if(key_down==0x44 && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey())
{ // [D] select next path-segment controlpoints
if(ak_key_status[83]=="down") ak_edit_path_menu("Hide Path Control Points")
else ak_edit_path_menu("Select Next Segment")
return
}
if(key_down==0x53 && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey())
{ // [S] select previous path-segment controlpoints
if(ak_key_status[68]=="down") ak_edit_path_menu("Hide Path Control Points")
else ak_edit_path_menu("Select Previous Segment")
return
}
if (((ak_key_status[89]=="down" || ak_key_status[90]=="down") && (ak_key_status[65]=="down")) && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey()) // ZoomIn  ak_object2update.getId()=="ak_no_selection" && 
{ // [A+Y] or [A+Z]
ak_grid_on_off(evt,"ZoomReset")
return
}
if ((evt.getKeyCode()==65) && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey()) 
{ // [A]
ak_grid_on_off(evt,"ZoomIn")
return
}
if ((evt.getKeyCode()==89 || evt.getKeyCode()==90) && !evt.shiftKey() && !evt.ctrlKey() && !evt.altKey())
{ // [Y] or [Z]
ak_grid_on_off(evt,"ZoomOut")
return
}
if(ak_keyCode_cout) {ak_cout("keyCode = "+key_down);return}
}
// ############    ################
function ak_setwert(evt,id_to_change,wich_wert,wert)
{
var playtmp=document.getElementById(id_to_change)
playtmp.setAttribute(wich_wert, wert)
}
// ############    ###############################################################################
var ak_cerrUp=new Array(), ak_cerrUp2=0
function ak_cerr(errortext)
{
ak_cerrUp2++
var ak_tmpOut="err: "+ak_cerrUp2+" | ", ak_tmpFlag=true
for(var i=0;i<ak_cerrUp.length;i++)
{
if(errortext==ak_cerrUp[i][0])
{
ak_cerrUp[i][1]++
ak_tmpFlag=false
ak_tmpOut+=ak_cerrUp[i][1]+" "+ak_cerrUp[i][0]+" | "
}
else
{
ak_tmpOut+=ak_cerrUp[i][1]+" "+ak_cerrUp[i][0]+" | "
}
}
if(ak_tmpFlag)
{
ak_cerrUp.push(new Array)
ak_cerrUp[ak_cerrUp.length-1]=new Array
ak_cerrUp[ak_cerrUp.length-1][0]=errortext
ak_cerrUp[ak_cerrUp.length-1][1]=1
ak_tmpOut+=ak_cerrUp[ak_cerrUp.length-1][1]+" "+ak_cerrUp[ak_cerrUp.length-1][0]+" | "
}
document.getElementById("ak_errorStatus").firstChild.data=ak_tmpOut
document.getElementById("ak_errorStatus2").firstChild.data=ak_tmpOut
}
// ############    ###############################################################################
function ak_cout(text_2_status)
{  
if(ak_menu_status=="timeline")
{
var ak_tmp=ak_userspace_svg.getAttribute("width")+","+ak_userspace_svg.getAttribute("height")+"  |  "
var ak_tmp2=ak_round(ak_fps,1000000)
if(ak_tmp2!=ak_fps) ak_tmp2=ak_round(ak_fps,1000)+'..'
ak_tmp+=ak_tmp2+"fps  |  "+ak_progressive+"  |  "
if(text_2_status!="no selection!") ak_tmp+=text_2_status
document.getElementById("ak_timelineStatus").firstChild.data=ak_tmp
return
}
if(ak_which_nodeNr(ak_object2update)==-1 && /^<|(style)/.test(text_2_status))
{
text_2_status="no selection!"
document.getElementById("ak_object2status").setAttribute("style","visibility:hidden")
}
document.getElementById("ak_status").firstChild.data=text_2_status
}
// ############    #######################################################################
var ak_hue=0;
var ak_sat=150;
var ak_hell=0;
var ak_rot=255,ak_gruen=0,ak_blau=0; // ist Ergebniss von hue berechnung
var ak_hue_flag=false, ak_sv_flag=false;
//#########  function ak_hue_sv_parameter(evt,
function ak_MoveSlider_hue(evt,hue_flag,which_wert)
{
if(evt && evt.type=="mousedown" && ak_SetGetRm_styleValue(document.getElementById("ak_s_v_show"),"visibility","get")=="hidden")
{
evt.preventDefault()
ak_show_s_v(evt)
return
}
if(evt && evt.getButton>0 && evt.type=="mousedown" && ak_SetGetRm_styleValue(document.getElementById("ak_s_v_show"),"visibility","get")!="hidden")
{
evt.preventDefault()
ak_hide_s_v(evt)
return
}
else if(evt && evt.type=="mousedown") ak_selection('hide_only_selection')
if(evt && evt.getButton>0) {evt.preventDefault(); return}
if(ak_color_action_on=="fill" || ak_color_action_on=="stroke") which_wert=ak_color_action_on
else which_wert="none"
if(hue_flag=="false") ak_hue_flag=false
if(hue_flag=="true") ak_hue_flag=true
var ak_tmpHue=ak_hue
if(ak_hue_flag)
{
ak_hue=evt.clientY-25;
if(ak_hue>360) ak_hue=360;
if(ak_hue<0) ak_hue=0;
var slhue=document.getElementById("ak_slider_hue")
if(slhue.getAttribute("y")==(24+ak_hue)) return
slhue.setAttribute("y",24+ak_hue)
ak_hue=360-ak_hue; // von y auf Gradangabe umgerechnet
if(ak_hue>=360) ak_hue=0;
if (ak_hue<60) {ak_rot=255; ak_gruen=parseInt(ak_hue*255/60); ak_blau=0;}
if (ak_hue>=60 && ak_hue<120) {hue_tmp=120-ak_hue;ak_rot=parseInt(hue_tmp*255/60);ak_gruen=255;ak_blau=0;}
if (ak_hue>=120 && ak_hue<180) {hue_tmp=ak_hue-120; ak_rot=0; ak_gruen=255; ak_blau=parseInt(hue_tmp*255/60);}
if (ak_hue>=180 && ak_hue<240) {hue_tmp=240-ak_hue; ak_rot=0; ak_gruen=parseInt(hue_tmp*255/60); ak_blau=255;}
if (ak_hue>=240 && ak_hue<300) {hue_tmp=ak_hue-240; ak_rot=parseInt(hue_tmp*255/60); ak_gruen=0; ak_blau=255;}
if (ak_hue>=300) {hue_tmp=360-ak_hue; ak_rot=255; ak_gruen=0; ak_blau=parseInt(hue_tmp*255/60);}
var hr=parseInt(ak_rot).toString(16)
hr=(hr.length==1)?"0"+hr:hr;
var hg=parseInt(ak_gruen).toString(16)
hg=(hg.length==1)?"0"+hg:hg;
var hb=parseInt(ak_blau).toString(16)
hb=(hb.length==1)?"0"+hb:hb;
var hexfarbe="#"+hr+hg+hb; // #RRGGBB
ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_huea"),"stop-color",hexfarbe,"no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_hueb"),"stop-color",hexfarbe,"no_cout")
ak_MoveSlider_s_v(evt,"from_hue",which_wert)
}
}
//#################################################
var ak_svMax=100
function ak_MoveSlider_s_v(evt,sv_flag,which_wert)
{  
if(evt && evt.getButton>0) {evt.preventDefault(); sv_flag="false"}
if(ak_color_action_on=="fill" || ak_color_action_on=="stroke") which_wert=ak_color_action_on
else which_wert="none"
var rotc,gruenc,blauc;
if(sv_flag=="false") ak_sv_flag=false;
if(sv_flag=="true") ak_sv_flag=true;
var ak_tmpSat=ak_sat
var ak_tmpHell=ak_hell
if(ak_sv_flag) //ak_window_innerWidth
{
ak_sat=evt.clientY-26
if(ak_sat>ak_svMax) ak_sat=ak_svMax
if(ak_sat<0) ak_sat=0
//ak_hell=evt.clientX-(ak_window_innerWidth-204)
ak_hell=evt.clientX-(ak_window_innerWidth-((204-150)+ak_svMax))
if(ak_hell>ak_svMax) ak_hell=ak_svMax
if(ak_hell<0) ak_hell=0
ak_sat=ak_sat*(150/ak_svMax)
ak_hell=ak_hell*(150/ak_svMax)
if(ak_tmpHell==ak_hell && ak_tmpSat==ak_sat) return
}
var slsat=document.getElementById("ak_slider_s_v").getElementsByTagName("line").item(0);
//slsat.setAttribute("y1",26+ak_sat); slsat.setAttribute("y2",26+ak_sat);
slsat.setAttribute("y1",26+(ak_sat*(ak_svMax/150))); slsat.setAttribute("y2",26+(ak_sat*(ak_svMax/150)));
var slhell=document.getElementById("ak_slider_s_v").getElementsByTagName("line").item(1);
//slhell.setAttribute("x1",586+ak_hell); slhell.setAttribute("x2",586+ak_hell);
slhell.setAttribute("x1",(586+150-ak_svMax)+(ak_hell*(ak_svMax/150))); slhell.setAttribute("x2",(586+150-ak_svMax)+(ak_hell*(ak_svMax/150)));
rotc=ak_rot+((255-ak_rot)*ak_sat/150); gruenc=ak_gruen+((255-ak_gruen)*ak_sat/150); blauc=ak_blau+((255-ak_blau)*ak_sat/150);
rotc=rotc*ak_hell/150; gruenc=gruenc*ak_hell/150; blauc=blauc*ak_hell/150;
var hr=parseInt(rotc).toString(16)
hr=(hr.length==1)?"0"+hr:hr;
var hg=parseInt(gruenc).toString(16)
hg=(hg.length==1)?"0"+hg:hg;
var hb=parseInt(blauc).toString(16)
hb=(hb.length==1)?"0"+hb:hb;
var hexfarbe="#"+hr+hg+hb; // #RRGGBB
if (sv_flag!="setted_hex" && ak_sv_flag==true || sv_flag=="from_hue")
{
ak_setAttribute(ak_colToolBox,"fill",hexfarbe)
if(ak_object2update_nodeNr==-1 && ak_grid_what=="Grid OFF (toolbox color)")
{
ak_setAttribute(ak_noSelection,"fill",hexfarbe)
ak_SetGetRm_styleValue(ak_userspace_svg.firstChild,"fill",hexfarbe,"no_cout")
return
}
else if(ak_object2update_nodeNr==-1) return
if (which_wert!="none")
{
ak_SetGetRm_styleValue(ak_object2update,which_wert,hexfarbe)
ak_SetGetRm_styleValue(ak_object2update,"fill","get_print")
}
else if(ak_gradient_stop_index!=-1)
{
try
{
if(ak_gradient_stop[ak_gradient_stop_index]=="[object SVGStopElement]")
{
ak_SetGetRm_styleValue(document.getElementById("ak_gradient_circle_"+ak_gradient_stop_index),"fill",hexfarbe,"no_cout")
ak_SetGetRm_styleValue(ak_gradient_stop[ak_gradient_stop_index],"stop-color",hexfarbe)
ak_stop_color[ak_gradient_stop_index]=hexfarbe
}
}
catch(error){}
try
{
if(ak_getObject(ak_gradient_stop_index).tagName=="feFlood")
{
ak_SetGetRm_styleValue(ak_getObject(ak_gradient_stop_index),"flood-color",hexfarbe)
ak_tagName_cout="<feFlood"+ak_getAttributeCout(ak_getObject(ak_gradient_stop_index),'result','style','x','y','width','height')
}
else if(ak_getObject(ak_gradient_stop_index).tagName=="feDiffuseLighting")
{
ak_SetGetRm_styleValue(ak_getObject(ak_gradient_stop_index),"lighting-color",hexfarbe)
ak_tagName_cout="<feDiffuseLighting"+ak_getAttributeCout(ak_getObject(ak_gradient_stop_index),'result','diffuseConstant','surfaceScale','style')
}
else if(ak_getObject(ak_gradient_stop_index).tagName=="feSpecularLighting")
{
ak_SetGetRm_styleValue(ak_getObject(ak_gradient_stop_index),"lighting-color",hexfarbe)
ak_tagName_cout="<feSpecularLighting"+ak_getAttributeCout(ak_getObject(ak_gradient_stop_index),'result','specularExponent','specularConstant','surfaceScale','style')
}
else if(ak_getObject(ak_gradient_stop_index).parentNode.tagName=="feDiffuseLighting" || ak_getObject(ak_gradient_stop_index).parentNode.tagName=="feSpecularLighting")
{
ak_SetGetRm_styleValue(ak_getObject(ak_gradient_stop_index).parentNode,"lighting-color",hexfarbe)
}
}
catch(error){}
}
}
else ak_SetGetRm_styleValue(ak_object2update,"fill","get_print")
}
// #############    #########################
var ak_hex_value=new Array ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f")
var ak_color_name="black,maroon,green,olive,navy,purple,teal,gray,silver,red,lime,yellow,blue,fuchsia,aqua,white"
var ak_color_hex="#000,#800000,#008000,#808000,#000080,#800080,#008080,#808080,#c0c0c0,#f00,#0f0,#ff0,#00f,#f0f,#0ff,#fff"
ak_color_name+=",aliceblue,antiquewhite,aquamarine,azure,beige,blueviolet,brown,burlywood,cadetblue,chartreuse"
ak_color_hex+=",#f0f8ff,#faebd7,#7fffd4,#f0ffff,#f5f5dc,#842be2,#a52a2a,#deb887,#5f9ea0,#7fff00"
ak_color_name+=",chocolate,coral,cornflowerblue,cornsilk,crimson,darkblue,darkcyan,darkgoldenrod,darkgray,darkgreen"
ak_color_hex+=",#d2691e,#ff7f50,#6495ed,#fff8dc,#dc143c,#00008b,#008b8b,#b8860b,#a9a9a9,#006400"
ak_color_name+=",darkkhaki,darkmagenta,darkolivegreen,darkorange,darkorchid,darkred,darksalmon,darkseagreen,darkslateblue"
ak_color_hex+=",#bdb76b,#8b008b,#556b2f,#ff8c00,#9932cc,#8b0000,#e9967a,#8fbc8f,#483d8b"
ak_color_name+=",darkslategray,darkturquoise,darkviolet,deeppink,deepskyblue,dimgray,dodgerblue,firebrick,floralwhite"
ak_color_hex+=",#2f4f4f,#00ced1,#9400d3,#ff1493,#00bfff,#696969,#1e90ff,#b22222,#fffaf0"
ak_color_name+=",forestgreen,gainsboro,ghostwhite,gold,goldenrod,greenyellow,honeydew,hotpink,indianred,indigo,ivory"
ak_color_hex+=",#228b22,#dcdcdc,#f8f8ff,#ffd700,#daa520,#adff2f,#f0fff0,#ff69b4,#cd5c5c,#4b0082,#fffff0"
ak_color_name+=",khaki,lavender,lavenderblush,lawngreen,lemonchiffon,lightblue,lightcoral,lightcyan,lightgoldenrodyellow"
ak_color_hex+=",#f0e68c,#e6e6fa,#fff0f5,#7cfc00,#fffacd,#add8e6,#f08080,#e0ffff,#fafad2"
ak_color_name+=",lightgreen,lightgray,lightpink,lightsalmon,lightseagreen,lightskyblue,lightslategray,lightsteelblue"
ak_color_hex+=",#90ee90,#d3d3d3,#ffb6c1,#ffa07a,#20b2aa,#87cefa,#778899,#b0c4de"
ak_color_name+=",lightyellow,limegreen,linen,mediumaquamarine,mediumblue,mediumorchid,mediumpurple,mediumseagreen"
ak_color_hex+=",#ffffe0,#32cd32,#faf0e6,#66cdaa,#0000cd,#ba55d3,#9370db,#3cb371"
ak_color_name+=",mediumslateblue,mediumspringgreen,mediumturquoise,mediumvioletred,midnightblue,mintcream,mistyrose"
ak_color_hex+=",#7b68ee,#00fa9a,#48d1cc,#c71585,#191970,#f5fffa,#ffe4e1"
ak_color_name+=",moccasin,navajowhite,oldlace,olivedrab,orange,orangered,orchid,palegoldenrod,palegreen,paleturquoise"
ak_color_hex+=",#ffe4b5,#ffdead,#fdf5e6,#6b8e23,#ffa500,#ff4500,#da70d6,#eee8aa,#98fb98,#afeeee"
ak_color_name+=",palevioletred,papayawhip,peachpuff,peru,pink,plum,powderblue,rosybrown,royalblue,saddlebrown,salmon"
ak_color_hex+=",#db7093,#ffefd5,#ffdab9,#cd853f,#ffc0cb,#dda0dd,#b0e0e6,#bc8f8f,#4169e1,#8b4513,#fa8072"
ak_color_name+=",sandybrown,seagreen,seashell,sienna,skyblue,slateblue,slategray,snow,springgreen,steelblue,tan"
ak_color_hex+=",#f4a460,#2e8b57,#fff5ee,#a0522d,#87ceeb,#6a5acd,#708090,#fffafa,#00ff7f,#4682b4,#d2b48c"
ak_color_name+=",thistle,tomato,turquoise,violet,wheat,whitesmoke,yellowgreen"
ak_color_hex+=",#d8bfd8,#ff6347,#40e0d0,#ee82ee,#f5deb3,#f5f5f5,#9acd32"
var ak_color_table=new Array(2); // fuer Farbname index 0, und Farbhexwert index 1
ak_color_table[0]=ak_color_name.split(",")
ak_color_table[1]=ak_color_hex.split(",")
// #############    #########################
function ak_set_hex2hue(evt,which_wert,return_hex)
{  
if(return_hex=="get_hex") var hexfarbe=which_wert
else if(return_hex=="set_stop_hex") var hexfarbe=which_wert
else var hexfarbe=ak_SetGetRm_styleValue(ak_object2update,which_wert,"get")
var ak_tmp_hex_lower=hexfarbe.toLowerCase()
for (var i=0;i<ak_color_table[0].length;i++)
{
if (ak_color_table[0][i]==ak_tmp_hex_lower)
{
hexfarbe=ak_color_table[1][i];
break
}
}
if (which_wert=="from_ak_fill_color")
{
hexfarbe=ak_SetGetRm_styleValue(document.getElementById("ak_fill_color"),"fill","get");
ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill",hexfarbe);
var ak_tmp_slider_eval=document.getElementById("ak_slider_s_v").getAttribute("onmousedown");
ak_tmp_slider_eval=ak_tmp_slider_eval.split(",");
ak_tmp_slider_eval[0]=ak_tmp_slider_eval[2].substring(1,ak_tmp_slider_eval[2].length-2);
if (ak_tmp_slider_eval[0]!="none") ak_SetGetRm_styleValue(ak_object2update,ak_tmp_slider_eval[0],hexfarbe);
}
if (which_wert=="from_ak_stroke_color")
{
hexfarbe=ak_SetGetRm_styleValue(document.getElementById("ak_stroke_color"),"fill","get");
ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill",hexfarbe);
var ak_tmp_slider_eval=document.getElementById("ak_slider_s_v").getAttribute("onmousedown");
ak_tmp_slider_eval=ak_tmp_slider_eval.split(",");
ak_tmp_slider_eval[0]=ak_tmp_slider_eval[2].substring(1,ak_tmp_slider_eval[2].length-2);
if (ak_tmp_slider_eval[0]!="none") ak_SetGetRm_styleValue(ak_object2update,ak_tmp_slider_eval[0],hexfarbe);
}
if (hexfarbe.substring(0,1)=="#" && hexfarbe.length!=7)
{
if (hexfarbe.length==4)
{
hexfarbe="#"+hexfarbe.substring(1,2)+hexfarbe.substring(1,2)+hexfarbe.substring(2,3)+hexfarbe.substring(2,3)+hexfarbe.substring(3,4)+hexfarbe.substring(3,4);
}
else hexfarbe="#000000";
}
if (hexfarbe.substring(0,1)=="#" && hexfarbe.length==7)
{
if(/[^\dABCDEFabcdef]/.test(hexfarbe.substring(1,7))) hexfarbe="#000000"
}
if (hexfarbe.substring(0,4)=="rgb(")
{
hexfarbe=hexfarbe.replace(/(rgb\( *)|( *\))/g,"")
hexfarbe=hexfarbe.replace(/,/g," ")
hexfarbe=hexfarbe.replace(/ +/g," ")
var hex=hexfarbe.split(" ")
hex[0]=hex[0]==""?0:hex[0]
hex[0]=hex[0]<0?0:hex[0]
hex[0]=hex[0]>255?255:hex[0]
hex[1]=hex[1]==undefined?0:hex[1]
hex[1]=hex[1]<0?0:hex[1]
hex[1]=hex[1]>255?255:hex[1]
hex[2]=hex[2]==undefined?0:hex[2]
hex[2]=hex[2]<0?0:hex[2]
hex[2]=hex[2]>255?255:hex[2]
var hr=parseInt(hex[0]).toString(16).toLowerCase();
hr=(hr.length==1)?"0"+hr:hr;
var hg=parseInt(hex[1]).toString(16).toLowerCase();
hg=(hg.length==1)?"0"+hg:hg;
var hb=parseInt(hex[2]).toString(16).toLowerCase();
hb=(hb.length==1)?"0"+hb:hb;
var hexfarbe="#"+hr+hg+hb; // #rrggbb            
}
if(return_hex=="get_hex")
{
if(hexfarbe.substring(0,1)=="#" && hexfarbe.length==7) return hexfarbe.toLowerCase()
else return "#000000"
}
if (hexfarbe.substring(0,1)!="#" && which_wert!="from_ak_fill_color")
{
hexfarbe=ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get");
ak_SetGetRm_styleValue(ak_object2update,which_wert,hexfarbe);
}
else ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill",hexfarbe);
if(ak_object2update_nodeNr==-1 && ak_grid_what=="Grid OFF (toolbox color)" && return_hex)
{
ak_SetGetRm_styleValue(ak_userspace_svg.firstChild,"fill",hexfarbe,"no_cout")
}
hexfarbe=hexfarbe.substring(1,7).toLowerCase();
var i;
for(i=0;i<16;i++) {if(hexfarbe.substring(0,1)==ak_hex_value[i]) ak_rot=i*16;}
for(i=0;i<16;i++) {if(hexfarbe.substring(1,2)==ak_hex_value[i]) ak_rot=ak_rot+i;}
for(i=0;i<16;i++) {if(hexfarbe.substring(2,3)==ak_hex_value[i]) ak_gruen=i*16;}
for(i=0;i<16;i++) {if(hexfarbe.substring(3,4)==ak_hex_value[i]) ak_gruen=ak_gruen+i;}
for(i=0;i<16;i++) {if(hexfarbe.substring(4,5)==ak_hex_value[i]) ak_blau=i*16;}
for(i=0;i<16;i++) {if(hexfarbe.substring(5,6)==ak_hex_value[i]) ak_blau=ak_blau+i;}
ak_hell=ak_rot;
if (ak_gruen>ak_hell) ak_hell=ak_gruen
if (ak_blau>ak_hell) ak_hell=ak_blau
ak_hell=ak_hell*150/255;
ak_sat=0;
if (ak_hell>0.5)
{
ak_sat=ak_rot;
if (ak_gruen<ak_sat) ak_sat=ak_gruen
if (ak_blau<ak_sat) ak_sat=ak_blau
ak_sat=150/(255/(255-(ak_sat*150/ak_hell))) // 150=ak_sat 100% hier noch
}
ak_hue=360;
if (ak_hell>0.5 && ak_sat>0.5) // hier wird die huefarbe berechnet
{
ak_rot=255-((255-(ak_rot*150/ak_hell))*150/ak_sat);
ak_gruen=255-((255-(ak_gruen*150/ak_hell))*150/ak_sat);
ak_blau=255-((255-(ak_blau*150/ak_hell))*150/ak_sat);
ak_rot=Math.round(ak_rot); ak_gruen=Math.round(ak_gruen); ak_blau=Math.round(ak_blau);
if (ak_rot==255) ak_hue=360+(ak_gruen*60/255)-(ak_blau*60/255);
if (ak_gruen==255) ak_hue=120+(ak_blau*60/255)-(ak_rot*60/255);
if (ak_blau==255) ak_hue=240+(ak_rot*60/255)-(ak_gruen*60/255);
if (ak_hue>360) ak_hue=parseInt(ak_hue-360); //<

}
ak_sat=150-Math.round(ak_sat); // hier auf y wert umgerechnet
ak_hue=360-Math.round(ak_hue); // hier auf y wert umgerechnet
ak_hell=Math.round(ak_hell);
if(ak_hue>360) ak_hue=360;
if(ak_hue<0) ak_hue=0;                
var slhue=document.getElementById("ak_slider_hue");
if(ak_sat<150) slhue.setAttribute("y",24+ak_hue)
else ak_hue=slhue.getAttribute("y")-24
ak_hue=360-ak_hue; // von y auf Gradangabe umgerechnet
if(ak_hue>=360) ak_hue=0;
if (ak_hue<60) {ak_rot=255; ak_gruen=parseInt(ak_hue*255/60); ak_blau=0;}
if (ak_hue>=60 && ak_hue<120) {hue_tmp=120-ak_hue;ak_rot=parseInt(hue_tmp*255/60);ak_gruen=255;ak_blau=0;}
if (ak_hue>=120 && ak_hue<180) {hue_tmp=ak_hue-120; ak_rot=0; ak_gruen=255; ak_blau=parseInt(hue_tmp*255/60);}
if (ak_hue>=180 && ak_hue<240) {hue_tmp=240-ak_hue; ak_rot=0; ak_gruen=parseInt(hue_tmp*255/60); ak_blau=255;}
if (ak_hue>=240 && ak_hue<300) {hue_tmp=ak_hue-240; ak_rot=parseInt(hue_tmp*255/60); ak_gruen=0; ak_blau=255;}
if (ak_hue>=300) {hue_tmp=360-ak_hue; ak_rot=255; ak_gruen=0; ak_blau=parseInt(hue_tmp*255/60);} //<
var rgbfarbe="rgb("+ak_rot+","+ak_gruen+","+ak_blau+")";
// RGB-Werte zur Anzeige in Hex-Schreibweise umwandeln
var hex=rgbfarbe.substring(4,rgbfarbe.length-1);
hex=hex.split(",");
var hr=parseInt(hex[0]).toString(16).toUpperCase();
hr=(hr.length==1)?"0"+hr:hr;
var hg=parseInt(hex[1]).toString(16).toUpperCase();
hg=(hg.length==1)?"0"+hg:hg;
var hb=parseInt(hex[2]).toString(16).toUpperCase();
hb=(hb.length==1)?"0"+hb:hb;
var hexfarbe="#"+hr+hg+hb; // #RRGGBB
var rgb=document.getElementById("ak_internal_color_huea");  
if(ak_sat<150)
{
rgb.style.setProperty("stop-color",hexfarbe);
document.getElementById("ak_internal_color_hueb").style.setProperty("stop-color",hexfarbe)
}
ak_MoveSlider_s_v(evt,"setted_hex",which_wert);
}
// #############    #########################
function ak_hide_s_v(mousemove_event)
{  
var slsat=document.getElementById("ak_s_v_show")
ak_SetGetRm_styleValue(slsat,"visibility","hidden")
ak_SetGetRm_styleValue(ak_object2update,"fill","get_print")
}
// #############    #########################
function ak_show_s_v(mousemove_event)
{  
if(ak_menu_status=="timeline") return
var slsat=document.getElementById("ak_s_v_show")
if (ak_SetGetRm_styleValue(slsat,"visibility","get")=="hidden")
{
ak_rmAttribute(slsat,"visibility")
if(ak_grouping.length>0) ak_click(false,ak_object2update)
//else ak_init_set4object(evt)
}
}
// ############   #########
function ak_shortMenu(evt,toDo,init)
{
if(toDo=="short")
{
ak_frameTop.setAttribute("visibility","hidden")
ak_frameLeft.setAttribute("visibility","hidden")
ak_topStandard.setAttribute("visibility","hidden")
ak_leftStandard.setAttribute("visibility","hidden")
ak_leftStandardMenu.setAttribute("visibility","hidden")
ak_setAttribute(ak_topShort,"visibility","visible")
ak_rmAttribute(ak_leftShort,"visibility")
ak_frameBottom.setAttribute("x1",0)
ak_xy_etc_shift=0
document.getElementById("ak_internal_userSpace").setAttribute("transform",("matrix("+ak_grid_zoom+",0,0,"+ak_grid_zoom+","+(ak_xy_etc_shift+ak_grid_pan_x*ak_grid_zoom)+","+(ak_xy_etc_shift+ak_grid_pan_y*ak_grid_zoom)+")"))
ak_userspace_svg.firstChild.setAttribute("style",ak_userspace_svg.firstChild.getAttribute("style"))
if(!init) ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
return
}
if(toDo=="standard")
{
ak_frameTop.setAttribute("visibility","visible")
ak_frameLeft.setAttribute("visibility","visible")
ak_topStandard.setAttribute("visibility","visible")
ak_leftStandard.setAttribute("visibility","visible")
ak_leftStandardMenu.setAttribute("visibility","visible")
ak_setAttribute(ak_topShort,"visibility","hidden")
ak_leftShort.setAttribute("visibility","hidden")
ak_frameBottom.setAttribute("x1",21)
ak_xy_etc_shift=21
document.getElementById("ak_internal_userSpace").setAttribute("transform",("matrix("+ak_grid_zoom+",0,0,"+ak_grid_zoom+","+(ak_xy_etc_shift+ak_grid_pan_x*ak_grid_zoom)+","+(ak_xy_etc_shift+ak_grid_pan_y*ak_grid_zoom)+")"))
ak_userspace_svg.firstChild.setAttribute("style",ak_userspace_svg.firstChild.getAttribute("style"))
ak_write_grid_status(((ak_grid_pan_x*-1)+","+(ak_grid_pan_y*-1)+" | x"+ak_grid_zoom+" | "+ak_grid_on_flag))
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
ak_rmAttribute(document.getElementById("ak_wird_von_aks_.js_gefuellt"),"visibility")
return
}
if(toDo=="hideStatus")
{
ak_setAttribute(document.getElementById("ak_wird_von_aks_.js_gefuellt"),"visibility","hidden")
return
}
if(toDo=="showStatus")
{
ak_rmAttribute(document.getElementById("ak_wird_von_aks_.js_gefuellt"),"visibility")
return
}
if(toDo=="reloadFrame")
{
if(ak_dirty_flag)
{
if(!confirm("Data-Changes not saved!\nDo you want to continue with 'Reload Frame'?")) return
}
ak_svgroot.unpauseAnimations()
if(printNode(ak_orgMenu.lastChild)==ak_StartEntry) ak_orgMenu.removeChild(ak_orgMenu.lastChild)
if(printNode(ak_orgMenu.lastChild)=="<separator/>") ak_orgMenu.removeChild(ak_orgMenu.lastChild)
contextMenu().replaceChild(ak_orgMenu,getContextMenu().firstChild)
ak_menu_status=""
window.reload() // IE nicht ganz stabil
//window.open(ak_directory+"\\"+ak_file,"_self")
return
}
if(!ak_menuValid(evt,"shortMenu")) return
if(evt.getButton==0)
{
if(ak_getAttribute(ak_topShort,"visibility")=="hidden") ak_shortMenu(evt,"short")
else ak_shortMenu(evt,"standard")
return
}
var ak_tmpNode='<menu><header>Short Menu</header>'
if(ak_getAttribute(ak_topShort,"visibility")=="hidden")
{
ak_tmpNode+='<item onactivate="ak_shortMenu(evt,\'short\')">Set Short Menu</item>'
}
else
{
ak_tmpNode+='<item onactivate="ak_shortMenu(evt,\'standard\')">Set Standard Menu</item>'
if(ak_getAttribute(document.getElementById("ak_wird_von_aks_.js_gefuellt"),"visibility")!="hidden")
{ak_tmpNode+='<separator/><item onactivate="ak_shortMenu(evt,\'hideStatus\')">Hide Hue | Status</item>'}
else
{ak_tmpNode+='<separator/><item onactivate="ak_shortMenu(evt,\'showStatus\')">Show Hue | Status</item>'}
//ak_tmpNode+='<separator/><item onactivate="ak_shortMenu(evt,\'reloadFrame\')">Reload Frame</item>'
}
ak_tmpNode+='</menu>'
contextMenu().replaceChild(parseXML(ak_tmpNode,getContextMenu()).firstChild,getContextMenu().firstChild)
}
//############################
function ak_check4ASV6(evt)
{
if(!/^Adobe\; 6/.test(getSVGViewerVersion())) return
ak_init4ASV6(ak_toolsComplete)
ak_init4ASV6(ak_leftStandardMenu)
ak_init4ASV6(ak_durSlider)
ak_init4ASV6(ak_io_wait)
ak_init4ASV6(ak_toolObject)
ak_init4ASV6(ak_about)
ak_init4ASV6(document.getElementById("ak_timeline_g"))
}
//############################
function ak_init4ASV6(object)
{
if(!/^Adobe\; 6/.test(getSVGViewerVersion())) return
var ak_tmp, ak_tmpAttr, ak_tmpChilds
ak_tmpAttr="onmousedown"; ak_tmp=object.getAttribute(ak_tmpAttr)
if(ak_tmp) object.setAttribute(ak_tmpAttr,ak_tmp)
ak_tmpAttr="onmouseup"; ak_tmp=object.getAttribute(ak_tmpAttr)
if(ak_tmp) object.setAttribute(ak_tmpAttr,ak_tmp)
ak_tmpAttr="onmousemove"; ak_tmp=object.getAttribute(ak_tmpAttr)
if(ak_tmp) object.setAttribute(ak_tmpAttr,ak_tmp)
ak_tmpAttr="onmouseover"; ak_tmp=object.getAttribute(ak_tmpAttr)
if(ak_tmp) object.setAttribute(ak_tmpAttr,ak_tmp)
ak_tmpAttr="onmouseout"; ak_tmp=object.getAttribute(ak_tmpAttr)
if(ak_tmp) object.setAttribute(ak_tmpAttr,ak_tmp)
ak_tmpAttr="onclick"; ak_tmp=object.getAttribute(ak_tmpAttr)
if(ak_tmp) object.setAttribute(ak_tmpAttr,ak_tmp)
ak_tmpChilds=object.childNodes
for(var i=0;i<ak_tmpChilds.length;i++)
{
if(/^\[object SVG/.test(ak_tmpChilds.item(i))) ak_init4ASV6(ak_tmpChilds.item(i))
}
return
}
// ############   ##############################################################################################################
var ak_init_editor_already_done=false, ak_filter, ak_matrix
var ak_animation_control=true
var ak_fast_selection=false, ak_no_edit_before=false
var ak_fill_init='#aa0000', ak_stroke_init=false, ak_strokeWidth_init=false
var ak_mouse_circle, ak_add_c, ak_add_l, ak_add_m, ak_add_q, ak_del_x
var ak_tCircle, ak_tPause, ak_tPan, ak_tData, ak_tMouseDown
var ak_tMouseDownMax, ak_tMax
var ak_turbo=true, ak_panLine, ak_panLine1, ak_panLine2, ak_panLine3, ak_panLine4
var ak_colBack="#ccd4dd", ak_colFront="#9eafbf", ak_colAK="#006993", ak_colDur="#eee", ak_colDur2="#08f", ak_colDur3="#3499ff", ak_colAni="#e3d19a"
var ak_colToolBox, ak_colPreFill, ak_colPreStroke, ak_colCache1, ak_colCache2
var ak_toolOverall, ak_backTop, ak_backLeft, ak_backRight, ak_noSelection
var ak_topStandard, ak_topShort, ak_leftStandard, ak_leftShort, ak_leftStandardMenu
var ak_frameTop, ak_frameLeft, ak_frameRight, ak_frameBottom
var ak_orgMenu, ak_toolsComplete, ak_about
//##########################
function ak_init_toolbox(evt)
{
var ak_tmp, ak_tmp2
ak_matrix='clatguadqmqs?gwoeukpp)e-f-c-d-k*}b?()<d>e<hpt)k>2<k=clagkmvft/nfphvi=j-,+|c,?Tvskoi/hsqnEicsEpff*bm`hjnugs0djbtDqegBv)k*/c+<d./<kg*c>e+c?dfxbn)c*<clajpjv`ffht**'
ak_filter=''// ak_save 
var g_append=ak_svgroot
var neuer_knoten=document.createElement("g")
neuer_knoten.setAttribute("id","ak_wird_von_aks_.js_gefuellt")
g_append.appendChild(neuer_knoten)
g_append=document.getElementById("ak_wird_von_aks_.js_gefuellt")
ak_toolsComplete=g_append
g_append.setAttribute("shape-rendering","optimizeSpeed")
g_append.setAttribute("text-rendering","optimizeSpeed")
ak_toolGroup=parseXML('<g/>',document).firstChild
ak_svgroot.insertBefore(ak_toolGroup,g_append)
ak_panLine='<line x1="0" y1="0" x2="0" y2="0" shape-rendering="optimizeSpeed" visibility="hidden" style="stroke:#000;fill:#fff;stroke-dasharray:2 4;stroke-width:1"/>'
ak_panLine=parseXML(ak_panLine,document).firstChild
ak_svgroot.insertBefore(ak_panLine,g_append)
ak_panLine1='<line x1="0" y1="0" x2="0" y2="0" shape-rendering="optimizeSpeed" visibility="hidden" style="stroke:#000;fill:#fff;stroke-dasharray:2 4;stroke-width:1"/>'
ak_panLine1=parseXML(ak_panLine1,document).firstChild
ak_svgroot.insertBefore(ak_panLine1,g_append)
ak_panLine2='<line x1="0" y1="0" x2="0" y2="0" shape-rendering="optimizeSpeed" visibility="hidden" style="stroke:#000;fill:#fff;stroke-dasharray:2 4;stroke-width:1"/>'
ak_panLine2=parseXML(ak_panLine2,document).firstChild
ak_svgroot.insertBefore(ak_panLine2,g_append)
ak_panLine3='<line x1="0" y1="0" x2="0" y2="0" shape-rendering="optimizeSpeed" visibility="hidden" style="stroke:#000;fill:#fff;stroke-dasharray:2 4;stroke-width:1"/>'
ak_panLine3=parseXML(ak_panLine3,document).firstChild
ak_svgroot.insertBefore(ak_panLine3,g_append)
ak_panLine4='<line x1="0" y1="0" x2="0" y2="0" shape-rendering="optimizeSpeed" visibility="hidden" style="stroke:#000;fill:#fff;stroke-dasharray:2 4;stroke-width:1"/>'
ak_panLine4=parseXML(ak_panLine4,document).firstChild
ak_svgroot.insertBefore(ak_panLine4,g_append)
ak_mouse_circle=parseXML('<g style="visibility:hidden"><rect shape-rendering="optimizeSpeed" style="opacity:0" x="-10" y="-10" width="20" height="20"/></g>',document).firstChild
ak_mouse_circle.setAttribute("onmousedown","ak_MoveEditRect(evt,'down','add_c')")
ak_svgroot.insertBefore(ak_mouse_circle,g_append)
ak_add_c=parseXML('<text x="12" y="30" style="visibility:hidden">C</text>',document).firstChild
ak_mouse_circle.appendChild(ak_add_c)
ak_add_l=parseXML('<text x="12" y="30" style="visibility:hidden">L</text>',document).firstChild
ak_mouse_circle.appendChild(ak_add_l)
ak_add_m=parseXML('<text x="12" y="30" style="visibility:hidden">M</text>',document).firstChild
ak_mouse_circle.appendChild(ak_add_m)
ak_add_q=parseXML('<text x="12" y="30" style="visibility:hidden">Q</text>',document).firstChild
ak_mouse_circle.appendChild(ak_add_q)
ak_del_x=parseXML('<text x="12" y="30" style="visibility:hidden">del</text>',document).firstChild
ak_mouse_circle.appendChild(ak_del_x)
ak_toolOverall=document.createElement("g")
ak_toolOverall.setAttribute("id","ak_Id_tmp_edit_overall")
ak_svgroot.insertBefore(ak_toolOverall,g_append)
ak_init_defs(event)// ak_save ak_set_style("fill:#9ab;stroke:#555;stroke-width:1")
ak_make_rect("ak_background_status",0,598,4096,4096,"fill:#9eafbf;stroke:none",g_append)
document.getElementById("ak_background_status").setAttribute("onmousedown","ak_background_editor_action(evt)")
g_append.appendChild((parseXML('<text id="ak_statusGroup" x="20" style="text-rendering:optimizeSpeed;text-anchor:left;fill:#123456;font-family:Arial;font-size:12"><tspan id="ak_errorStatus" style="fill:#f21"> </tspan><tspan id="ak_autoStatus" style="fill:#ff0"> </tspan><tspan id="ak_multiStatus" style="fill:#d00"> </tspan><tspan id="ak_status">Status!</tspan></text>',document).firstChild))
ak_coutAuto=document.getElementById("ak_autoStatus").firstChild
ak_coutMulti=document.getElementById("ak_multiStatus").firstChild
ak_coutError=document.getElementById("ak_errorStatus").firstChild
ak_coutStatus=document.getElementById("ak_status").firstChild
ak_make_rect("ak_status_border_cover",20,598,4096,4096,"fill:#000;stroke:none;opacity:0",g_append)
document.getElementById("ak_status_border_cover").setAttribute("onmousedown","ak_background_editor_action(evt,'right_down_border')")
ak_make_rect("ak_background_huebar","741","21","4096","4096","fill:#9eafbf;stroke:none",g_append)
ak_backRight=g_append.lastChild
// top_menu
var ak_tmp_logo='<path onmousedown="ak_shortMenu(evt)" style="shape-rendering:auto;stroke:#333333;fill:#006993" d="M 2 16.38 C 2 16.38 6.64 1.99 6.64 1.99 C 6.64 1.99 9.03 9.07 9.08 9.07 C 9.08 9.07 14.65 2.03 14.65 2.03 C 14.61 2.03 14.61 16.42 14.65 16.38 C 14.65 16.38 9.26 9.58 9.26 9.58 C 9.82 11.27 11.56 16.38 11.56 16.38 C 11.56 16.38 8.47 16.38 8.47 16.38 C 8.47 16.38 6.59 10.75 6.59 10.75 C 6.59 10.75 4.81 16.38 4.81 16.38 C 4.81 16.38 2 16.38 2 16.38 Z"/>'
ak_topStandard=parseXML('<g visibility="visible"/>',document).firstChild
g_append.appendChild(ak_topStandard)
ak_make_rect("ak_background_menu","0","0","4000","21","fill:#9eafbf;stroke:none",ak_topStandard)
document.getElementById("ak_background_menu").setAttribute("onmousedown","evt.preventDefault()")
ak_backTop=ak_topStandard.lastChild
ak_topStandard.appendChild((parseXML(ak_tmp_logo,document).firstChild))
ak_make_polyline("","20,20,20,3,50,3","stroke:#000;stroke-width:1;fill:none",ak_topStandard)
ak_make_polygon("","20,20,16,14,24,14","shape-rendering:auto;fill:#000",ak_topStandard)
ak_make_text("ak_grid_position_text","28","15","font-family:Arial;font-size:12","0,0 | x1",ak_topStandard)
ak_make_text("ak_elementTree_text",137,15,"font-family:Arial;font-size:12","SVG ElementTree",ak_topStandard)
ak_make_text("ak_elementByTag_text",250,15,"font-family:Arial;font-size:12","getElementsByTagName",ak_topStandard)
ak_make_text("ak_editAnimation_text",398,15,"font-family:Arial;font-size:12","Edit Animation",ak_topStandard)
ak_make_rect("ak_grid_position_rect",19,0,107,21,"fill:#000;stroke:none;opacity:0",ak_topStandard)
document.getElementById("ak_grid_position_rect").setAttribute("onmousedown","evt.preventDefault()")
ak_make_rect("ak_elementTree_rect",131,0,108,21,"fill:#000;stroke:none;opacity:0.2",ak_topStandard)
document.getElementById("ak_elementTree_rect").setAttribute("onmousedown","ak_show_svgRootMenu(evt)")
document.getElementById("ak_elementTree_rect").setAttribute("onmouseup","ak_show_svgRootMenu(evt)")
document.getElementById("ak_elementTree_rect").setAttribute("onmouseout","ak_show_svgRootMenu(evt)")
ak_make_rect("ak_elementByTag_rect",244,0,143,21,"fill:#000;stroke:none;opacity:0.2",ak_topStandard)
document.getElementById("ak_elementByTag_rect").setAttribute("onmousedown","ak_getElementsById(evt)")
document.getElementById("ak_elementByTag_rect").setAttribute("onmouseup","ak_getElementsById(evt)")
document.getElementById("ak_elementByTag_rect").setAttribute("onmouseout","ak_getElementsById(evt)")
ak_make_rect("ak_editAnimation_rect",392,0,88,21,"fill:#000;stroke:none;opacity:0.2",ak_topStandard)
document.getElementById("ak_editAnimation_rect").setAttribute("onmousedown","ak_editAnimationMenu(evt)")
document.getElementById("ak_editAnimation_rect").setAttribute("onmouseup","ak_editAnimationMenu(evt)")
document.getElementById("ak_editAnimation_rect").setAttribute("onmouseout","ak_editAnimationMenu(evt)")
// top_menu end
ak_leftStandard=parseXML('<g visibility="visible" onmousedown="evt.preventDefault()"/>',document).firstChild
g_append.appendChild(ak_leftStandard)
ak_make_rect("ak_background_leftside","0","21","21","4096","fill:#9eafbf;stroke:none",ak_leftStandard)
ak_backLeft=ak_leftStandard.lastChild
ak_make_g("ak_animation_bar","translate(0,-30)","","","","","","",ak_leftStandard)
var an_append=document.getElementById("ak_animation_bar")
ak_make_rect("","3","50","13","20","fill:#ddf;stroke:#000;stroke-width:1",an_append); // 0-100startgruen
var ak_tmpNode='<line x1="3" y1="60" x2="15" y2="60" style="fill:#fff;stroke:#f00;stroke-width:1;stroke-dasharray:2 3"/>'
an_append.appendChild(parseXML(ak_tmpNode,document).firstChild)
ak_buildInAni='<animateTransform attributeName="transform" type="translate" repeatCount="indefinite" values="0,-10;0,10;0,-10" begin="0" dur="2" end="indefinite"/>'
ak_buildInAni=parseXML(ak_buildInAni,document).firstChild
an_append.lastChild.appendChild(ak_buildInAni)
ak_tmpNode='<rect x="3" y="76" width="13" height="200" style="fill:'+ak_colAni+';stroke:#000;stroke-width:1"/>'
an_append.appendChild(parseXML(ak_tmpNode,document).firstChild)
var line_style="stroke:#555555;stroke-width:1"
ak_make_line("9","96","14","96",line_style,an_append)
ak_make_line("9","116","14","116",line_style,an_append)
ak_make_line("9","136","14","136",line_style,an_append)
ak_make_line("9","156","14","156",line_style,an_append)
ak_make_line("6","176","15","176",line_style,an_append)
ak_make_line("9","196","14","196",line_style,an_append)
ak_make_line("9","216","14","216",line_style,an_append)
ak_make_line("9","236","14","236",line_style,an_append)
ak_make_line("9","256","14","256",line_style,an_append)
// over
ak_make_line("9","296","16","296",line_style,an_append)
ak_make_line("9","316","16","316",line_style,an_append)
ak_make_line("9","336","16","336",line_style,an_append)
ak_make_line("9","356","16","356",line_style,an_append)
ak_make_line("6","376","16","376",line_style,an_append)
ak_make_line("9","396","16","396",line_style,an_append)
ak_make_line("9","416","16","416",line_style,an_append)
ak_make_line("9","436","16","436",line_style,an_append)
ak_make_line("9","456","16","456",line_style,an_append)
ak_make_line("6","476","16","476",line_style,an_append)
ak_frameTop=parseXML('<line x1="20" y1="20" x2="722" y2="20" style="stroke:#555555;stroke-width:1"/>',document).firstChild
g_append.appendChild(ak_frameTop)
ak_frameBottom=parseXML('<line x1="20" y1="576" x2="722" y2="576" style="stroke:#555555;stroke-width:1"/>',document).firstChild
g_append.appendChild(ak_frameBottom)
ak_frameLeft=parseXML('<line x1="20" y1="20" x2="20" y2="576" style="stroke:#555555;stroke-width:1"/>',document).firstChild
g_append.appendChild(ak_frameLeft)
ak_frameRight=parseXML('<line x1="741" y1="20" x2="741" y2="576" style="stroke:#555555;stroke-width:1"/>',document).firstChild
g_append.appendChild(ak_frameRight)
// timcode ende - slider hue und sv anfang
neuer_knoten=document.createElement("g")
neuer_knoten.setAttribute("id","ak_hue_und_sv_bar_g")
g_append.appendChild(neuer_knoten)
ak_topShort='<g visibility="hidden" transform="translate(675,0)">'
ak_topShort+='<rect x="-3" y="-1" width="4000" height="21" onmousedown="evt.preventDefault()" style="fill:#9eafbf;stroke:#555555"/>'
ak_topShort+='<g transform="translate(101,0)">'+ak_tmp_logo+'</g>'
ak_topShort+='<text x="1" y="15" onmousedown="evt.preventDefault()" xml:space="preserve" style="font-family:Arial;font-size:12">SVG<tspan dx="11">Tag</tspan><tspan dx="15">Ani</tspan></text>'
ak_topShort+='<rect x="-3" y="0" width="31" height="20" onmousedown="ak_show_svgRootMenu(evt)" onmouseup="ak_show_svgRootMenu(evt)" onmouseout="ak_show_svgRootMenu(evt)" style="fill:#000;stroke:none;opacity:0.2"/>'
ak_topShort+='<rect x="31" y="0" width="31" height="20" onmousedown="ak_getElementsById(evt)" onmouseup="ak_getElementsById(evt)" onmouseout="ak_getElementsById(evt)" style="fill:#000;stroke:none;opacity:0.2"/>'
ak_topShort+='<rect x="65" y="0" width="31" height="20" onmousedown="ak_editAnimationMenu(evt)" onmouseup="ak_editAnimationMenu(evt)" onmouseout="ak_editAnimationMenu(evt)" style="fill:#000;stroke:none;opacity:0.2"/>'
ak_topShort+='</g>'
ak_topShort=parseXML(ak_topShort,document).firstChild
g_append.appendChild(ak_topShort)
var ak_tmp_viewer_version=getSVGViewerVersion()
ak_tmp_viewer_version=ak_tmp_viewer_version.substring(7,ak_tmp_viewer_version.length)
if(ak_serNo) document.getElementById("ak_hue_und_sv_bar_g").appendChild((parseXML('<text id="ak_SerialNumber" transform="translate(746,447),rotate(90)" style="fill:#123456;font-size:10">'+ak_serNo+'</text>',document).firstChild))
else document.getElementById("ak_hue_und_sv_bar_g").appendChild((parseXML('<text id="ak_SerialNumber" transform="translate(746,447),rotate(90)" style="fill:#123456;font-size:10">3.0 | '+ak_tmp_viewer_version+'</text>',document).firstChild))
var ak_tmp_logo='<path transform="translate(742,393)" style="shape-rendering:auto;stroke:#333333;fill:#006993;stroke-width:1.3" d="M 3 45.33 C 3 45.33 16.86 2.33 16.86 2.33 C 16.86 2.33 24.01 23.48 24.15 23.48 C 24.15 23.48 40.82 2.47 40.82 2.47 C 40.68 2.47 40.68 45.47 40.82 45.33 C 40.82 45.33 24.72 25.02 24.72 25.02 C 26.39 30.07 31.58 45.33 31.58 45.33 C 31.58 45.33 22.33 45.33 22.33 45.33 C 22.33 45.33 16.72 28.52 16.72 28.52 C 16.72 28.52 11.4 45.33 11.4 45.33 C 11.4 45.33 3 45.33 3 45.33 Z"/>'
document.getElementById("ak_hue_und_sv_bar_g").appendChild((parseXML(ak_tmp_logo,document).firstChild))
ak_make_rect("ak_hue_border_cover",743,0,100,4096,"opacity:0",document.getElementById("ak_hue_und_sv_bar_g"))
document.getElementById("ak_hue_border_cover").setAttribute("onmousedown","ak_background_editor_action(evt,'right_down_border')")
ak_make_rect("","750","25","30","361","fill:url(#ak_hue_slider_bar);stroke:none",document.getElementById("ak_hue_und_sv_bar_g"))
ak_make_rect("ak_slider_hue","746","24","38","3","fill:none;stroke:#555;stroke-width:1;stroke-opacity:1",document.getElementById("ak_hue_und_sv_bar_g"))
ak_make_rect("ak_slider_hue_activity","745","20","40","371","stroke:#555;stroke-width:1;fill-opacity:0",document.getElementById("ak_hue_und_sv_bar_g"))
ak_setwert(evt,"ak_slider_hue_activity","onmousedown","ak_toolBoxMouse(evt,\'hue\')")
neuer_knoten=document.createElement("g")
neuer_knoten.setAttribute("id","ak_s_v_show")
document.getElementById("ak_hue_und_sv_bar_g").appendChild(neuer_knoten)
g_append=document.getElementById("ak_s_v_show")
neuer_knoten=document.createElement("g")
neuer_knoten.setAttribute("id","ak_slider_s_v")
g_append.appendChild(neuer_knoten)
ak_toolBox=document.getElementById("ak_slider_s_v")
var ak_tmpSize=110
ak_svMax=ak_tmpSize
var ak_tmpBorder=5
var ak_tmpStart=581+160-ak_tmpSize-(2*ak_tmpBorder)
ak_tmpNode='<g visibility="">'
ak_tmpNode+='<rect x="'+ak_tmpStart+'" y="21" width="'+(ak_tmpSize+(2*ak_tmpBorder))+'" height="'+(ak_tmpSize+(2*ak_tmpBorder))+'" style="fill:#888;stroke:#000;stroke-width:1"/>'
ak_tmpNode+='<rect x="'+(ak_tmpStart+ak_tmpBorder)+'" y="'+(21+ak_tmpBorder)+'" width="'+ak_tmpSize+'" height="'+ak_tmpSize+'" style="fill:url(#ak_linear_schwarz2weiss);stroke:none"/>'
ak_tmpNode+='<rect x="'+(ak_tmpStart+ak_tmpBorder)+'" y="'+(21+ak_tmpBorder)+'" width="'+ak_tmpSize+'" height="'+ak_tmpSize+'" style="fill:url(#ak_sv_radial_schwarz);stroke:none"/>'
ak_tmpNode+='<rect x="'+(ak_tmpStart+ak_tmpBorder)+'" y="'+(21+ak_tmpBorder)+'" width="'+ak_tmpSize+'" height="'+ak_tmpSize+'" style="fill:url(#ak_sv_radial_hue_color);stroke:none"/>'
ak_tmpNode+='<line x1="'+ak_tmpStart+'" y1="70" x2="741" y2="70" style="stroke:#fff;stroke-width:1;opacity:0.8"/>'
ak_tmpNode+='<line x1="680" y1="21" x2="680" y2="'+(21+ak_tmpSize+(2*ak_tmpBorder))+'" style="stroke:#fff;stroke-width:1;opacity:0.8"/>'
ak_tmpNode+='<rect onmousedown="ak_toolBoxMouse(evt,\'sv\')" id="ak_internal_activity_slider_s_v" x="'+ak_tmpStart+'" y="21" width="'+(ak_tmpSize+(2*ak_tmpBorder))+'" height="'+(ak_tmpSize+(2*ak_tmpBorder))+'" style="fill:#000;opacity:0"/>'
var ak_tmpSize2=50
ak_tmpNode+='<rect onmousedown="ak_toolBoxMouse(evt,\'closeTools\')" x="'+ak_tmpStart+'" y="'+(21+ak_tmpSize+(2*ak_tmpBorder))+'" width="'+(ak_tmpSize+(2*ak_tmpBorder))+'" height="'+ak_tmpSize2+'" style="fill:#888;stroke:#000;stroke-width:1"/>'
ak_tmpNode+='<rect onmousedown="ak_toolBoxMouse(evt,\'closeTools\')" id="ak_internal_color_calculate" x="'+(ak_tmpStart+ak_tmpBorder)+'" y="'+(21+ak_tmpSize+(3*ak_tmpBorder))+'" width="'+(ak_tmpSize-(ak_tmpSize2))+'" height="'+(ak_tmpSize2-(2*ak_tmpBorder))+'" style="fill:#800"/>'
ak_tmpNode+='<rect onmousedown="ak_toolBoxMouse(evt,\'prevColor\')" id="ak_prev_fill_color" x="'+(ak_tmpStart+(2*ak_tmpBorder)+(ak_tmpSize-(ak_tmpSize2)))+'" y="'+(21+ak_tmpSize+(2*ak_tmpBorder))+'" width="'+(ak_tmpSize2/2)+'" height="'+(ak_tmpSize2/2)+'" style="fill:#800;stroke:#000;stroke-width:1"/>'
ak_tmpNode+='<rect onmousedown="ak_toolBoxMouse(evt,\'prevColorStroke\')" id="ak_prev_stroke_color" x="'+(ak_tmpStart+(2*ak_tmpBorder)+(ak_tmpSize-(ak_tmpSize2)))+'" y="'+(21+ak_tmpSize+(2*ak_tmpBorder)+(ak_tmpSize2/2))+'" width="'+(ak_tmpSize2/2)+'" height="'+(ak_tmpSize2/2)+'" style="fill:#080;stroke:#000;stroke-width:1"/>'
ak_tmpNode+='<rect onmousedown="ak_toolBoxMouse(evt,\'cache1Color\')" id="ak_fill_color" x="'+(ak_tmpStart+(2*ak_tmpBorder)+(ak_tmpSize-(ak_tmpSize2/2)))+'" y="'+(21+ak_tmpSize+(2*ak_tmpBorder))+'" width="'+(ak_tmpSize2/2)+'" height="'+(ak_tmpSize2/2)+'" style="fill:#123456;stroke:#000;stroke-width:1"/>'
ak_tmpNode+='<rect onmousedown="ak_toolBoxMouse(evt,\'cache2Color\')" id="ak_stroke_color" x="'+(ak_tmpStart+(2*ak_tmpBorder)+(ak_tmpSize-(ak_tmpSize2/2)))+'" y="'+(21+ak_tmpSize+(2*ak_tmpBorder)+(ak_tmpSize2/2))+'" width="'+(ak_tmpSize2/2)+'" height="'+(ak_tmpSize2/2)+'" style="fill:gold;stroke:#000;stroke-width:1"/>'
ak_tmpNode+='<g transform="translate('+(80+ak_tmpStart)+','+(21+ak_tmpSize+(2*ak_tmpBorder)+ak_tmpSize2)+')">'
ak_tmpNode+='<rect x="0" y="0" width="40" height="16" fill="'+ak_eee+'" style="stroke:#000;stroke-width:1"/>'
ak_tmpNode+='<text x="21" y="13" style="text-anchor:middle;font-size:12;fill:#123456">visib..</text>'
ak_tmpNode+='<rect x="0" y="0" width="40" height="16" style="opacity:0"'
ak_tmpNode+=' onmousedown="ak_toolBoxMouse(evt,\'visibility\')"/>'
ak_tmpNode+='</g>'
ak_tmpNode+='<g transform="translate('+(ak_tmpStart)+','+(21+ak_tmpSize+(2*ak_tmpBorder)+ak_tmpSize2)+')">'
ak_tmpNode+='<rect x="0" y="0" width="80" height="16" fill="'+ak_eee+'" style="stroke:#000;stroke-width:1"/>'
ak_tmpNode+='<text x="41" y="13" style="text-anchor:middle;font-size:12;fill:#123456">transform</text>'
ak_tmpNode+='<rect x="0" y="0" width="80" height="16" style="opacity:0"'
ak_tmpNode+=' onmousedown="ak_toolBoxMouse(evt,\'transform\')"/>'
ak_tmpNode+='</g>'
ak_tmpNode+='<g transform="translate('+ak_tmpStart+','+(16+21+ak_tmpSize+(2*ak_tmpBorder)+ak_tmpSize2)+')">'
ak_tmpNode+='<rect x="0" y="0" width="40" height="16" fill="'+ak_eee+'" style="stroke:#000;stroke-width:1"/>'
ak_tmpNode+='<text x="21" y="13" style="text-anchor:middle;font-size:12;fill:#123456">fill</text>'
ak_tmpNode+='<rect x="0" y="0" width="40" height="16" style="opacity:0"'
ak_tmpNode+='  onmousedown="ak_toolBoxMouse(evt,\'fill\')"/>'
ak_tmpNode+='</g>'
ak_tmpNode+='<g transform="translate('+(40+ak_tmpStart)+','+(16+21+ak_tmpSize+(2*ak_tmpBorder)+ak_tmpSize2)+')">'
ak_tmpNode+='<rect x="0" y="0" width="40" height="16" fill="'+ak_eee+'" style="stroke:#000;stroke-width:1"/>'
ak_tmpNode+='<text x="20" y="13" style="text-anchor:middle;font-size:12;fill:#123456">stroke</text>'
ak_tmpNode+='<rect x="0" y="0" width="40" height="16" style="opacity:0"'
ak_tmpNode+=' onmousedown="ak_toolBoxMouse(evt,\'stroke\')"/>'
ak_tmpNode+='</g>'
ak_tmpNode+='<g transform="translate('+(80+ak_tmpStart)+','+(16+21+ak_tmpSize+(2*ak_tmpBorder)+ak_tmpSize2)+')">'
ak_tmpNode+='<rect x="0" y="0" width="40" height="16" fill="'+ak_eee+'" style="stroke:#000;stroke-width:1"/>'
ak_tmpNode+='<text x="20" y="13" style="text-anchor:middle;font-size:12;fill:#123456">filter</text>'
ak_tmpNode+='<rect x="0" y="0" width="40" height="16" style="opacity:0"'
ak_tmpNode+=' onmousedown="ak_toolBoxMouse(evt,\'filter\')"/>'
ak_tmpNode+='</g>'
ak_sliderX=ak_tmpStart
ak_sliderY=(32+21+ak_tmpSize+(2*ak_tmpBorder)+ak_tmpSize2)
ak_tmpNode+='</g>'
ak_toolBox.appendChild(parseXML(ak_tmpNode,document).firstChild)
ak_colToolBox=document.getElementById("ak_internal_color_calculate")
ak_colPreFill=document.getElementById("ak_prev_fill_color")
ak_colPreStroke=document.getElementById("ak_prev_stroke_color")
ak_colCache1=document.getElementById("ak_fill_color")
ak_colCache2=document.getElementById("ak_stroke_color")
ak_buttonFilter=ak_toolBox.lastChild.lastChild
ak_buttonStroke=ak_buttonFilter.previousSibling
ak_buttonFill=ak_buttonStroke.previousSibling
ak_buttonTransform=ak_buttonFill.previousSibling
ak_buttonVisibility=ak_buttonTransform.previousSibling.firstChild
ak_buttonTransform=ak_buttonTransform.firstChild
ak_buttonFill=ak_buttonFill.firstChild
ak_buttonStroke=ak_buttonStroke.firstChild
ak_buttonFilter=ak_buttonFilter.firstChild
g_append=document.getElementById("ak_wird_von_aks_.js_gefuellt")
g_append.appendChild((parseXML('<g id="ak_no_selection"/>',document).firstChild))
ak_noSelection=g_append.lastChild
g_append.appendChild((parseXML('<g id="ak_saveBackup" visibility="hidden"/>',document).firstChild))
ak_tmpNode='<g id="ak_select_element_first" style="visibility:hidden">'
ak_tmpNode+='<circle cx="40" cy="40" r="40" style="shape-rendering:geometricPrecision;stroke-width:3;stroke:#000000;fill:#fffa00"/>'
ak_tmpNode+='<text x="40" y="25" style="stroke:none;fill:#000000;font-size:10pt;text-anchor:middle" startOffset="0">select<tspan x="40" y="44" style="word-spacing:0;letter-spacing:0">element<tspan x="40" y="64"/>first!</tspan></text>'
ak_tmpNode+='</g>'
g_append.appendChild((parseXML(ak_tmpNode,document).firstChild))
g_append.lastChild.setAttribute("onmousedown","ak_hide_tips(evt)")
g_append.lastChild.setAttribute("onmouseover","ak_hide_tips(evt)")
ak_make_g("ak_use_right_mouse_button","","visibility:hidden","","","","","",g_append)
g_append=document.getElementById("ak_use_right_mouse_button")
g_append.setAttribute("shape-rendering","geometricPrecision")
g_append.setAttribute("onmousedown","ak_hide_tips(evt)")
g_append.setAttribute("onmouseover","ak_hide_tips(evt)")
ak_make_circle('',40,40,40,'stroke-width:3;stroke:#fbfabd;fill:#0059ff',g_append)
g_append.appendChild((parseXML('<text x="40" y="24" style="stroke:none;fill:#fbfabd;font-size:10pt;text-anchor:middle">use<tspan x="40" y="43">right mouse<tspan x="40" y="62"/>button</tspan></text>',document).firstChild))
// Vorsicht wenn keyTimes Bar verschoben wird
ak_tmpNode='<rect onmousedown="ak_show_object_menu(evt,\'test\',\'keyTimes\')" x="3" y="46" width="13" height="200" style="fill:#000;opacity:0"/>'
ak_leftStandardMenu=parseXML(ak_tmpNode,document).firstChild
ak_svgroot.appendChild(ak_leftStandardMenu)
ak_tmpNode='<g id="ak_timeline_g" visibility="hidden" style="font:Arial;font-size:10;shape-rendering:optimizeSpeed;text-rendering:optimizeSpeed" transform="translate(0,'+ak_timeline_top+')">'
ak_tmpNode+='<rect onmousedown="ak_timeMouseAction(evt,\'scale\')" x="0" y="0" width="100%" height="100%" style="fill:#9eafbf"/>'
ak_tmpNode+='<rect x="0" y="-'+ak_timeStatus+'" width="100%" height="'+ak_timeStatus+'" style="fill:#e3d19a"/>'
ak_tmpNode+='<text x="3" y="-4" xml:space="preserve" style="stroke:none;fill:#000000;font-size:12;text-anchor:left" startOffset="0"><tspan id="ak_errorStatus2" style="fill:#f21"> </tspan><tspan id="ak_timelineStatus">Timeline-Status!</tspan></text>'
ak_tmpNode+='<rect onmousedown="ak_timeMouseAction(evt,\'scale\')" x="0" y="-'+ak_timeStatus+'" width="100%" height="'+ak_timeStatus+'" style="opacity:0"/>'
ak_tmpNode+='<g transform="translate('+ak_timeline_left+',0)">'
ak_tmpNode+='<line x1="0" y1="0" x2="0" y2="100%" style="stroke-width:1;stroke:#000;stroke-dasharray:1 2;fill:none"/>'
ak_tmpNode+='<line x1="0" y1="'+ak_timeline_ystart+'" x2="100%" y2="'+ak_timeline_ystart+'" style="stroke-width:1;stroke:#000"/>'
ak_tmpNode+='<g id="ak_timeline_small_scale"/>'
ak_tmpNode+='<g id="ak_timeline_large_scale"/>'
ak_tmpNode+='<rect onmousedown="ak_timeMouseAction(evt,\'scale\')" x="0" y="0" width="100%" height="'+(ak_timeline_ystart+5)+'" style="fill:#000;opacity:0"/>'
ak_tmpNode+='<g id="ak_timeline_ani" transform="translate(0,'+(ak_timeline_ystart+ak_timeline_yani+0)+')">'
ak_tmpNode+='</g>'
ak_tmpNode+='</g>'
ak_tmpNode+='<line id="ak_aniPauseVisible" visibility="hidden" x1="'+(ak_timeline_left-1)+'" y1="0" x2="'+(ak_timeline_left-1)+'" y2="100%" style="stroke-width:1;stroke:#fff;fill:#f00;stroke-dasharray:4 8">'
ak_tmpNode+='<animateTransform id="ak_aniPauseAnimation" attributeName="transform" type="translate" begin="indefinite" dur="0" values="0,0" accumulate="none" additive="replace" calcMode="linear" fill="freeze" restart="always"/>'
ak_tmpNode+='</line>'
ak_tmpNode+='<rect onmousedown="ak_timeMouseAction(evt,\'line\')" x="0" y="0" width="'+ak_timeline_left+'" height="100%" style="fill:#79a"/>'
ak_tmpNode+='<path onmousedown="ak_timeMouseAction(evt,\'max\')" transform="translate('+((ak_timeline_left-19)/2)+','+((ak_timeline_ystart-12)/2)+')" style="stroke:#333333;fill:#006993;shape-rendering:auto" d="M 2 16.38 C 2 16.38 6.64 1.99 6.64 1.99 C 6.64 1.99 9.03 9.07 9.08 9.07 C 9.08 9.07 14.65 2.03 14.65 2.03 C 14.61 2.03 14.61 16.42 14.65 16.38 C 14.65 16.38 9.26 9.58 9.26 9.58 C 9.82 11.27 11.56 16.38 11.56 16.38 C 11.56 16.38 8.47 16.38 8.47 16.38 C 8.47 16.38 6.59 10.75 6.59 10.75 C 6.59 10.75 4.81 16.38 4.81 16.38 C 4.81 16.38 2 16.38 2 16.38 Z"/>'
ak_tmpNode+='<line x1="0" y1="0" x2="100%" y2="0" style="stroke-width:2;stroke:#666;shape-rendering:auto"/>'
ak_tmpNode+='<line x1="0" y1="-'+ak_timeStatus+'" x2="100%" y2="-'+ak_timeStatus+'" style="stroke-width:2;stroke:#000;shape-rendering:auto"/>'
ak_tmpNode+='<g id="ak_timeline_nr"/>'
ak_tmpNode+='</g>'
ak_svgroot.appendChild((parseXML(ak_tmpNode,document).firstChild))
ak_tMouseDown=parseXML('<line x1="0" y1="0" x2="0" y2="100%" visibility="hidden" style="stroke-width:1;stroke:#000;fill:none;stroke-dasharray:2 4"/>',document).firstChild
ak_tPan=parseXML('<line x1="0" y1="0" x2="0" y2="100%" visibility="hidden" style="stroke-width:1;stroke:#000;fill:none;stroke-dasharray:2 4;stroke-dashoffset:3"/>',document).firstChild
ak_tData=parseXML('<line x1="0" y1="0" x2="0" y2="100%" visibility="hidden" style="stroke-width:1;stroke:#fff;fill:none;stroke-dasharray:2 4;stroke-dashoffset:3"/>',document).firstChild
ak_tCircle=parseXML('<circle style="opacity:0" cx="100" cy="100" r="15" visibility="hidden" shape-rendering="optimizeSpeed"/>',document).firstChild
ak_tMouseDownMax=parseXML('<line x1="0" y1="'+ak_timeline_ystart+'" x2="'+(ak_timeline_left*2)+'" y2="'+ak_timeline_ystart+'" visibility="hidden" style="stroke-width:1;stroke:#f22;fill:none;stroke-dasharray:2 4"/>',document).firstChild
ak_tMax=parseXML('<line x1="0" y1="'+ak_timeline_ystart+'" x2="'+(ak_timeline_left*2)+'" y2="'+ak_timeline_ystart+'" visibility="hidden" style="stroke-width:1;stroke:#f22;fill:none;stroke-dasharray:2 4;stroke-dashoffset:3"/>',document).firstChild
ak_svgroot.lastChild.appendChild(ak_tMouseDown)
ak_svgroot.lastChild.appendChild(ak_tPan)
ak_svgroot.lastChild.appendChild(ak_tData)
ak_svgroot.lastChild.appendChild(ak_tMouseDownMax)
ak_svgroot.lastChild.appendChild(ak_tMax)
ak_svgroot.appendChild(ak_tCircle)
ak_make_rect("ak_object2status",0,0,20,20,"fill:url(#ak_internal_edit_border);stroke:none;visibility:hidden",ak_svgroot)
ak_objectStatus=document.getElementById("ak_object2status")
ak_objectStatus.setAttribute("onmousedown","ak_show_object_menu(evt)")
ak_tmpNode='<g id="ak_info_about" visibility="hidden" transform="translate(329,231)"><g transform="translate(-329,-231)">'
ak_tmpNode+='<radialGradient r="71.4%" fy="17.3%" fx="21.8%" id="ak_info_background">'
ak_tmpNode+='<stop offset="0%" style="stop-color:#d9ebff"/>'
ak_tmpNode+='<stop offset="100%" style="stop-color:#8fafd1"/>'
ak_tmpNode+='</radialGradient>'
ak_tmpNode+='<filter id="ak_filter_about"><feGaussianBlur in="SourceAlpha" stdDeviation="2" result="blur_1"/><feOffset dx="5" dy="5" result="offset_1"/>'
ak_tmpNode+='<feMerge result="merge_1"><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>'
ak_tmpNode+='<rect x="107" y="62" width="444" height="330" style="fill:url(#ak_info_background);stroke:#123456;stroke-width:4;filter:url(#ak_filter_about)"/>'
ak_tmpNode+='<path id="ak_copyright" style="fill:none;stroke:#123456;visibility:hidden" d="M 127 315 L 446 315 M 127 330.67 L 459 331.67 M 128 347.33 L 453 347.33 M 127 362 L 453 362"/>'
ak_tmpNode+='<text startOffset="0"><textPath xlink:href="#ak_copyright" startOffset="3" xml:space="preserve" style="fill:#123456;font-size:14;baseline-shift:-1">WARNING: This computer program is protected by copyright law and international treaties. You must not reproduce or distribute this program or parts of it.</textPath></text>'
ak_tmpNode+='<path style="stroke:#333333;fill:#006993;stroke-width:2.6" d="M 132 188.25 C 132 188.25 163.9 89.33 163.9 89.33 C 163.9 89.33 180.66 138.66 180.99 138.66 C 180.99 138.66 219 89.65 219 89.65 C 218.68 89.65 218.68 188.57 219 188.25 C 219 188.25 181.27 139.53 181.27 139.53 C 185.14 151.13 197.73 188.25 197.73 188.25 C 197.73 188.25 176.47 188.25 176.47 188.25 C 176.47 188.25 163.58 149.59 163.58 149.59 C 163.58 149.59 151.33 188.25 151.33 188.25 C 151.33 188.25 132 188.25 132 188.25 Z"/>'
ak_tmpNode+='<text x="222" y="189" style="fill:#006993;font-size:49.6;font-weight:bold;stroke:#001923;stroke-width:2" startOffset="0">s SVG Editor</text>'
ak_tmpNode+='<text x="523" y="231" style="fill:#006993;font-size:24.9;stroke:#001923;text-anchor:end" startOffset="0">Version 3.0</text>'
ak_tmpNode+='<text x="523" y="250" style="fill:#123456;font-size:15.1;text-anchor:end;letter-spacing:1;font-weight:bold" startOffset="0">Build 56</text>'
ak_tmpNode+='<text x="129" y="299" style="fill:#123456;font-size:15.1;text-anchor:begin;letter-spacing:1;font-weight:bold" startOffset="0">Copyright &#169; 2004-2009 Andreas Krammel</text>'
ak_tmpNode+='<rect onmousedown="ak_info_show(evt)" x="107" y="62" width="444" height="330" style="opacity:0"/>'
ak_tmpNode+='<a xlink:href="http://www.krammel.net" target="_blank">'
ak_tmpNode+='<text x="337" y="377" fill="#123456" onmouseout="evt.target.setAttribute(\'fill\',\'#123456\')" onmouseover="evt.target.setAttribute(\'fill\',\'#d90a7f\')" style="font-size:15.1;letter-spacing:11.9;text-anchor:middle" startOffset="0">www.krammel.net</text>'
ak_tmpNode+='</a>'
ak_tmpNode+='</g></g>'
ak_svgroot.appendChild((parseXML(ak_tmpNode,document).firstChild))
ak_about=ak_svgroot.lastChild
ak_tmpNode='<g transform="translate(3,246)" visibility="hidden" text-rendering="optimizeSpeed" shape-rendering="optimizeSpeed">'
ak_tmpNode+='<g onmousedown="ak_show_object_menu(evt,\'test\',\'keyTimes\')" visibility="hidden">'
ak_tmpNode+='<line x1="13" y1="0" x2="13" y2="-200" style="fill:none;stroke:#123456;stroke-width:3"/>'
ak_tmpNode+='<line x1="13" y1="0" x2="13" y2="-200" style="fill:none;stroke:'+ak_colAni+';stroke-width:1"/>'
ak_tmpNode+='<line x1="4" y1="-200" x2="14" y2="-200" style="fill:none;stroke:#123456;stroke-width:1"/>'
for(var i=-180;i<0;i+=20)
{
if(i==-100) ak_tmpNode+='<line x1="6" y1="'+i+'" x2="13" y2="'+i+'" style="fill:none;stroke:#123456;stroke-width:1"/>'
else  ak_tmpNode+='<line x1="9" y1="'+i+'" x2="13" y2="'+i+'" style="fill:none;stroke:#123456;stroke-width:1"/>'
}
ak_tmpNode+='</g>'
ak_tmpNode+='<rect x="0" y="0" width="40" height="13" style="fill:'+ak_colDur+';stroke:#123456;stroke-width:1"/>'
ak_tmpNode+='<text id="ak_durTextId" x="21" y="11" style="fill:#123456;font-size:11;text-anchor:middle" startOffset="0">dur 2s</text>'
ak_tmpNode+='<line id="ak_durLineId" x1="0" y1="0" x2="40" y2="0" style="fill:none;stroke:#123456;stroke-width:1;stroke-dasharray:1 2"/>'
ak_tmpNode+='<rect onmousedown="ak_MoveEditRect(evt,\'down\',\'aniDuration\')" x="0" y="0" width="40" height="13" style="opacity:0"/>'
ak_tmpNode+='</g>'
ak_durSlider=parseXML(ak_tmpNode,document).firstChild
ak_svgroot.appendChild(ak_durSlider)
ak_leftShort=ak_durSlider.firstChild
ak_durSliderText=document.getElementById("ak_durTextId")
ak_durSliderLine=document.getElementById("ak_durLineId")
ak_tmpNode='<g id="ak_io_wait" visibility="hidden">'
ak_tmpNode+='<path style="fill:#ff9000;stroke:#0f0c07;stroke-width:2.4" d="M -13.34 -30.19 L 13.34 -30.2 L 32.19 -11.34 L 32.2 15.34 L 13.34 34.19 L -13.34 34.2 L -32.19 15.34 L -32.2 -11.34 L -13.34 -30.19"/>'
ak_tmpNode+='<text startOffset="0" style="fill:#0f0c07;font-size:16;text-anchor:middle" y="7" x="0.5">Data I/O</text>'
ak_tmpNode+='<path onmousedown="evt.preventDefault()" style="fill:#fffff;opacity:0" d="M -13.34 -30.19 L 13.34 -30.2 L 32.19 -11.34 L 32.2 15.34 L 13.34 34.19 L -13.34 34.2 L -32.19 15.34 L -32.2 -11.34 L -13.34 -30.19"/>'
ak_tmpNode+='</g>'
ak_svgroot.appendChild((parseXML(ak_tmpNode,document).firstChild))
ak_io_wait=ak_svgroot.lastChild()
ak_init_editor_already_done=true
}
var ak_durSlider, ak_durSliderText, ak_durSliderLine, ak_toolBox
var ak_coutAuto, ak_coutMulti, ak_coutError, ak_coutStatus, ak_objectStatus
// ############    #######################################
function ak_hide_tips(evt)
{
evt.preventDefault()
document.getElementById("ak_use_right_mouse_button").setAttribute("style","visibility:hidden")
document.getElementById("ak_select_element_first").setAttribute("style","visibility:hidden")
}
// ############    #######################################
var ak_addChildMenu='<item onactivate="'+"ak_main_menu('pasteFromClipboard'replacer)"+'">[Ctrl+V] paste from Clipboard</item><separator/>'
ak_addChildMenu+='<item onactivate="'+"ak_new_object_menu(evt,'text'replacer)"+'">&lt;text</item>'
ak_addChildMenu+='<item onactivate="'+"ak_new_object_menu(evt,'textPath'replacer)"+'">&lt;text>&lt;textPath</item>'
ak_addChildMenu+='<item onactivate="'+"ak_new_object_menu(evt,'flowtext'replacer)"+'">Group &lt;text from Clipboard</item>'
ak_addChildMenu+='<item onactivate="'+"ak_new_object_menu(evt,'line'replacer)"+'">&lt;line</item>'
ak_addChildMenu+='<item onactivate="'+"ak_new_object_menu(evt,'rect'replacer)"+'">&lt;rect</item>'
ak_addChildMenu+='<item onactivate="'+"ak_new_object_menu(evt,'image'replacer)"+'">&lt;image</item>'
ak_addChildMenu+='<item onactivate="'+"ak_new_object_menu(evt,'imageBase64'replacer)"+'">&lt;image (data:;base64,...)</item>'
ak_addChildMenu+='<item onactivate="'+"ak_new_object_menu(evt,'circle'replacer)"+'">&lt;circle</item>'
ak_addChildMenu+='<item onactivate="'+"ak_new_object_menu(evt,'ellipse'replacer)"+'">&lt;ellipse</item>'
ak_addChildMenu+='<item onactivate="'+"ak_new_object_menu(evt,'path'replacer)"+'">&lt;path (M only)</item>'
ak_addChildMenu+='<item onactivate="'+"ak_new_object_menu(evt,'pathSquare'replacer)"+'">&lt;path (square)</item>'
ak_addChildMenu+='<item onactivate="'+"ak_new_object_menu(evt,'pathCircle'replacer)"+'">&lt;path (circle)</item>'
ak_addChildMenu+='<item onactivate="'+"ak_new_object_menu(evt,'pathPolygon'replacer)"+'">&lt;path (symetric shapes)</item>'
ak_addChildMenu+='<separator/>'
ak_addChildMenu+='<item onactivate="'+"ak_new_object_menu(evt,'a'replacer)"+'">&lt;a xlink:href="http://...</item>'
ak_addChildMenu+='<item onactivate="'+"ak_new_object_menu(evt,'aSelect'replacer)"+'">&lt;a     (File-Dialog)</item>'
ak_addChildMenu+='<item onactivate="'+"ak_new_object_menu(evt,'svg'replacer)"+'">&lt;svg</item>'
var ak_addChildMain='<menu id="ak_new_object_submenu"><header>Add childNode to rootSVG</header>'
ak_addChildMain+=ak_addChildMenu.replace(/(replacer)|(\[Ctrl\+V\] )/g,"")
ak_addChildMain+='<separator/>'
ak_addChildMain+='<item onactivate="'+"ak_new_object_menu(evt,'defs')"+'">&lt;defs</item>'
//ak_addChildMain+='<item onactivate="'+"ak_new_object_menu(evt,'symbol')"+'">&lt;symbol>&lt;text .. &lt;use</item>'
ak_addChildMain+='<item onactivate="'+"ak_new_object_menu(evt,'marker_start')"+'">&lt;marker &lt;--   (to &lt;defs)</item>'
ak_addChildMain+='<item onactivate="'+"ak_new_object_menu(evt,'marker_end')"+'">&lt;marker  -->  (to &lt;defs)</item>'
//ak_addChildMain+='<item onactivate="'+"ak_new_object_menu(evt,'clipPath')"+'">&lt;clipPath   (to &lt;defs)</item>'
ak_addChildMain+='<item onactivate="'+"ak_new_object_menu(evt,'rectBackground')"+'">&lt;rect   (background)</item>'
ak_addChildMain+='</menu>'
var ak_addChildBefore='<menu id="ak_new_object_insertBefore_submenu"><header>Add siblingNode (insertBefore)</header>'
ak_addChildBefore+=ak_addChildMenu.replace(/(replacer)/g,",'insert'")
ak_addChildBefore=ak_addChildBefore.replace(/(\[Ctrl\+V\] )/g,"")+'</menu>'
var ak_addChild2Parent='<menu id="ak_new_object_add2Parent_submenu"><header>Add siblingNode</header>'
ak_addChild2Parent+=ak_addChildMenu.replace(/(replacer)/g,",'add2Parent'")+'</menu>'
var ak_addChildAppend='<menu id="ak_new_object_append_submenu"><header>Add childNode</header>'
ak_addChildAppend+=ak_addChildMenu.replace(/(replacer)/g,",'append'")
ak_addChildAppend=ak_addChildAppend.replace(/(\[Ctrl\+V\] )/g,"")+'</menu>'
// ############    #######################################
function ak_info_show(evt)
{
if(evt.getButton==2) evt.preventDefault()
else document.getElementById('ak_info_about').setAttribute('visibility','hidden')
}
// ############    #######################################
window.ak_init_encodingMenu=ak_init_encodingMenu
var ak_animation_stop_flag=false
function ak_init_encodingMenu(evt)
{
if(!ak_animation_stop_flag)
{
ak_animation_stop_flag=true
ak_animation("stop")
}
if(!ak_header2_valid){setTimeout("ak_init_encodingMenu(evt)",1000);return}
var ak_tmp_header=ak_svg_header
if(ak_svg_header2) ak_tmp_header=ak_svg_header2
var ak_tmp_back=ak_tmp_header.search(/\?\>/)
var ak_tmp_front=ak_tmp_header.search(/encoding *= *\".*\"/)
var ak_tmp_enc_txt=""
if(!ak_svg_header2 && ak_tmp_front==-1)
{
ak_edit_encoding('setEncoding','ISO-8859-1','on_init')
ak_cout("Welcome to AKs SVG Editor!")
ak_dirty_flag=false
return
}
var ak_newNode
if(ak_tmp_front==-1) ak_newNode='<menu id="ak_encoding_menu"><header>&lt;?xml encoding=""</header>'
else
{
ak_tmp_enc_txt=ak_tmp_header.substring(ak_tmp_front)
var ak_tmp_front_txt=ak_tmp_header.substring(0,ak_tmp_front)
ak_tmp_front=ak_tmp_enc_txt.search(/\"/)
ak_tmp_front_txt+=ak_tmp_enc_txt.substring(0,ak_tmp_front+1)
ak_tmp_enc_txt=ak_tmp_enc_txt.substring(ak_tmp_front+1)
ak_tmp_front=ak_tmp_enc_txt.search(/\"/)
var ak_tmp_back_txt=ak_tmp_enc_txt.substring(ak_tmp_front)
ak_tmp_enc_txt=ak_tmp_enc_txt.substring(0,ak_tmp_front)
ak_tmp_enc_txt=ak_tmp_enc_txt.replace(/^ +| +$/g,"")
ak_newNode='<menu id="ak_encoding_menu"><header>&lt;?xml encoding="'+ak_tmp_enc_txt+'"</header>'
}
if(ak_tmp_enc_txt.toUpperCase()=="UTF-8") ak_newNode+='<item checked="yes" onactivate="'+"ak_edit_encoding('setEncoding','UTF-8')"+'">UTF-8</item>'
else ak_newNode+='<item onactivate="'+"ak_edit_encoding('setEncoding','UTF-8')"+'">UTF-8</item>'
if(ak_tmp_enc_txt.toUpperCase()=="ISO-8859-1") ak_newNode+='<item checked="yes" onactivate="'+"ak_edit_encoding('setEncoding','ISO-8859-1')"+'">ISO-8859-1</item>'
else ak_newNode+='<item onactivate="'+"ak_edit_encoding('setEncoding','ISO-8859-1')"+'">ISO-8859-1</item>'
if(ak_tmp_enc_txt.toLowerCase()=="us-ascii") ak_newNode+='<item checked="yes" onactivate="'+"ak_edit_encoding('setEncoding','us-ascii')"+'">us-ascii</item>'
else ak_newNode+='<item onactivate="'+"ak_edit_encoding('setEncoding','us-ascii')"+'">us-ascii</item>'
ak_newNode+='</menu>'
ak_encodingMenu=ak_newNode
}
// ############    #######################################
function ak_init_defs(evt)
{
g_append=document.getElementById("ak_wird_von_aks_.js_gefuellt")
var neuer_knoten=document.createElement("defs")
neuer_knoten.setAttribute("id","ak_hue_sv_defines")
g_append.appendChild(neuer_knoten)
// ak_save ak_set_color(2,1) 
g_append=document.getElementById("ak_hue_sv_defines")
ak_make_pattern("ak_internal_edit_border","userSpaceOnUse",0,0,20,20,ak_svgroot)
ak_make_pattern("ak_translate_border","userSpaceOnUse",0,0,20,20,ak_svgroot)
ak_make_pattern("ak_internal_grid_fill","userSpaceOnUse",0,0,50,50,ak_svgroot) // damit sie nicht ausgeschaltet werden bei Hide hue
ak_make_linearGradient("ak_linear_schwarz2weiss","objectBoundingBox","0%","50%","100%","50%",g_append)
ak_make_linearGradient("ak_hue_slider_bar","objectBoundingBox","50%","100%","50%","0%",g_append)
ak_make_radialGradient("ak_sv_radial_hue_color","objectBoundingBox","100%","0%","100%","100%","0%",g_append)
ak_make_radialGradient("ak_sv_radial_schwarz","objectBoundingBox","0%","0%","100%","0%","0%",g_append)
var ak_newNode
// final view menu
ak_newNode='<menu id="ak_final_view_menu_xml"><header>AKs SVGEditor Final View Menu</header>'
ak_newNode+='<item onactivate="'+"ak_main_menu('Back to Aks SVG Editor')"+'">Back to Aks SVG Editor</item>'
if(ak_animation_control) ak_newNode+='<item onactivate="'+"ak_animation('start')"+'">Start Animation</item>'
ak_newNode+='<separator/>'
ak_newNode+='<item onactivate="'+"ak_info('Help')"+'">Aks_Help.html</item>'
ak_newNode+='<item checked="yes" onactivate="'+"ak_info()"+'">About Aks SVG Editor</item>'
ak_newNode+='<item action="'+"Quality"+'">Higher Quality</item>'
ak_newNode+='<item action="'+"OriginalView"+'">Reset View</item>'
ak_newNode+='</menu>'
g_append.appendChild(parseXML(ak_newNode,document).firstChild)
// grid menu
ak_newNode='<menu id="ak_grid_menu_xml"><header>AKs SVGEditor Grid Menu</header>'
ak_newNode+='<item checked="yes" onactivate="'+"ak_grid_on_off(evt,'on')"+'">   Grid ON</item>'
ak_newNode+='<item onactivate="'+"ak_grid_on_off(evt,'on_dark')"+'">   Grid ON (dark)</item>'
ak_newNode+='<menu id="ak_grid_menu_pattern"><header>   Grid ON (select pattern)</header>'
ak_newNode+='<item enabled="no">no pattern</item>'
ak_newNode+='</menu>'
ak_newNode+='<item onactivate="'+"ak_grid_on_off(evt,'on_reset')"+'">   0,0 | x1 | Grid ON</item>'
ak_newNode+='<separator/>'
ak_newNode+='<item onactivate="'+"ak_grid_on_off(evt,'off')"+'">   Grid OFF</item>'
ak_newNode+='<item onactivate="'+"ak_grid_on_off(evt,'off_color')"+'">   Grid OFF (toolbox color)</item>'
ak_newNode+='<item onactivate="'+"ak_grid_on_off(evt,'off_reset')"+'">   0,0 | x1 | Grid OFF</item>'
ak_newNode+='<separator/>'
ak_newNode+='<item onactivate="'+"ak_grid_on_off(evt,'ZoomIn')"+'">   Zoom IN      [A]</item>'
ak_newNode+='<item onactivate="'+"ak_grid_on_off(evt,'ZoomOut')"+'">   Zoom OUT   [Y] or [Z]</item>'
ak_newNode+='<item onactivate="'+"ak_grid_on_off(evt,'ZoomReset')"+'">   0,0 | x1       [A+Y] or [A+Z] </item>'
ak_newNode+='<separator/>'
ak_newNode+='<menu><header>   To Pan Canvas use ...</header>'
ak_newNode+='<item>middle mouseButton,</item>'
ak_newNode+='<item>or [Space] and mouseButton!</item>'
ak_newNode+='</menu>'
ak_newNode+='</menu>'
g_append.appendChild(parseXML(ak_newNode,document).firstChild)
//### appends zu den makes
g_append=document.getElementById("ak_internal_edit_border");
g_append.setAttribute("style","fill:#000") // 2af helllau, 91a violett
ak_make_rect("ak_internal_edit_border_color",0,0,20,20,"fill:#ff0",g_append);
ak_make_rect("",10,0,10,10,"",g_append);
ak_make_rect("",0,10,10,10,"",g_append);
ak_border1=document.getElementById("ak_internal_edit_border_color")
g_append=document.getElementById("ak_translate_border");
g_append.setAttribute("style","fill:#000")
ak_make_rect("",0,0,20,20,"fill:#12cc05",g_append);
ak_make_rect("",0,0,10,10,"",g_append);
ak_make_rect("",10,10,10,10,"",g_append);
g_append=document.getElementById("ak_internal_grid_fill");
ak_make_rect("ak_grid_dark",0,0,50,50,"shape-rendering:optimizeSpeed;fill:#dddddd",g_append);
ak_make_rect("",25,0,25,25,"shape-rendering:optimizeSpeed;fill:#aaaaaa",g_append);
ak_make_rect("",0,25,25,25,"shape-rendering:optimizeSpeed;fill:#aaaaaa",g_append);
g_append=document.getElementById("ak_linear_schwarz2weiss");
ak_make_stop("","0%","stop-color:#000000;stop-opacity:1",g_append);
ak_make_stop("","100%","stop-color:#ffffff;stop-opacity:1",g_append);
g_append=document.getElementById("ak_hue_slider_bar");
ak_make_stop("","0%","stop-color:#ff0000;stop-opacity:1",g_append);
ak_make_stop("","16%","stop-color:#ffff00;stop-opacity:1",g_append);
ak_make_stop("","33%","stop-color:#00ff00;stop-opacity:1",g_append);
ak_make_stop("","50%","stop-color:#00ffff;stop-opacity:1",g_append);
ak_make_stop("","66%","stop-color:#0000ff;stop-opacity:1",g_append);
ak_make_stop("","84%","stop-color:#ff00ff;stop-opacity:1",g_append);
ak_make_stop("","100%","stop-color:#ff0000;stop-opacity:1",g_append);      
g_append=document.getElementById("ak_sv_radial_hue_color");
ak_make_stop("ak_internal_color_huea","0%","stop-color:#ff0000;stop-opacity:1",g_append);
ak_make_stop("ak_internal_color_hueb","100%","stop-color:#ff0000;stop-opacity:0.1",g_append);
g_append=document.getElementById("ak_sv_radial_schwarz");
ak_make_stop("","0%","stop-color:#000000;stop-opacity:1",g_append);
ak_make_stop("","100%","stop-color:#000000;stop-opacity:0",g_append);
g_append=document.getElementById("ak_hue_sv_defines")
}
var ak_border1=false
// ############    ################
function ak_expert_tool(action,index)
{
if(action=='enter_attr_val' && ak_object2update_nodeNr!=-1)
{
var ak_tmp=prompt('Enter attribute value!','')
if(!ak_tmp) return
ak_tmp=ak_tmp.replace(/^ +| +$/,'')
var ak_tmp_nr=ak_tmp.search(/ /)
var ak_tmp_val=''
if(ak_tmp_nr!=-1)
{
ak_tmp_val=ak_tmp.substring(ak_tmp_nr)
ak_tmp_val=ak_tmp_val.replace(/^ +| +$/,'')
ak_tmp=ak_tmp.substring(0,ak_tmp_nr)
}  
if(!ak_tmp) return
ak_append2undo()
ak_object2update.setAttribute(ak_tmp,ak_tmp_val)
ak_push2undoTrue()
}
else if(action=='remove_attr' && ak_object2update_nodeNr!=-1)
{
var ak_tmp=prompt('Remove attribute!','')
if(!ak_tmp) return
ak_tmp=ak_tmp.replace(/^ +| +$/,'')
if(!ak_tmp) return
ak_append2undo()
try{ak_object2update.removeAttribute(ak_tmp)}
catch(error){}
ak_push2undoTrue()
}
else if(action=='enter_attr_list' && ak_object2update_nodeNr!=-1)
{
if(index>ak_attr_array.length) return
var ak_tmp=prompt('Enter '+ak_attr_array[index][0]+'!',ak_attr_array[index][1])
if(ak_tmp==null) return
ak_tmp=ak_tmp.replace(/^ +| +$/,'')
ak_append2undo()
// try wegen error bei image wenn nur data:;base64, und dann ohne daten
try{ak_object2update.setAttribute(ak_attr_array[index][0],ak_tmp)}catch(err){}
ak_push2undoTrue()
}
else if(action=='remove_attr_list' && ak_object2update_nodeNr!=-1)
{
if(index>ak_attr_array.length) return
ak_append2undo()
try{ak_object2update.removeAttribute(ak_attr_array[index][0])}
catch(error){}
ak_push2undoTrue()
}
ak_clickset_obj2update(evt,ak_object2update)
}
//##########################
function ak_redirectAlways(evt,isClick)
{
ak_alert("Link will be opened in new window!")
if(!isClick) return
if(ak_checkLink[0][3]) ak_checkLink[0][0].setAttribute("onclick",ak_checkLink[0][3])
else {try{ak_checkLink[0][0].removeAttribute("onclick")}catch(error){}}
setTimeout("ak_redirectTarget(evt)",400)
}
// ############    ################
var ak_timeStatus=17
var ak_timeline_left=30, ak_timeline_ystart=24, ak_timeline_yani=16, ak_timeline_count=10, ak_timeline_anidelta=20
var ak_timeline_top=300 // wird in resize berechnet
var ak_fps_flag=true, ak_fps=12, ak_progressive="progressive", ak_timeline_res=0.01 // 1 pixel = 0.01 sekunden
var ak_time_small=4
var ak_screen_width=1280, ak_timeline_begin=0, ak_timeline_pause=1
var ak_timeline_scale=new Array(0.001,0.002,0.005,0.01,0.02,0.05,0.1,0.2,0.5,1,2,5,10)
var ak_timeline_scale_index=4 // 0 bis 12
var ak_timeline_scale_init=3, ak_timeInpoint=0, ak_timeOutpoint=-1, ak_timeEnd=0
// ##-##-##-##-##-##-##-##-##-##-##
function ak_draw_timescale(evt)
{
var ak_tmp
var ak_std, ak_min, ak_sec, ak_frame
var ak_tmpLarge='<g id="ak_timeline_large_scale" style="stroke:#000;stroke-width:1">'
if(ak_timeline_begin<0) ak_timeline_begin=0
if(ak_fps<=0)
{
ak_fps=25
ak_fps_flag=false
}
else if(ak_fps<1) ak_fps=1
else if(ak_fps>1000) ak_fps=1000
if(ak_fps>500) ak_progressive="progressive"
ak_timeline_res=ak_timeline_scale[ak_timeline_scale_index]
if(ak_fps_flag && ak_timeline_res<0.05 && ak_fps>1)
{
ak_time_small=(1/ak_timeline_res)/ak_fps
if(ak_time_small>=4)
{
ak_time_small=Math.round(ak_time_small)
ak_timeline_res=1/(ak_fps*ak_time_small)
var ak_tmp_begin_fps=Math.floor(ak_timeline_begin*ak_fps)
ak_timeline_begin=(ak_tmp_begin_fps/ak_fps)
ak_tmp=0 // counter frame plus
var ak_tmp_x=0, ak_tmp_time
while(ak_tmp_x<=ak_screen_width)
{
ak_tmp_time=(ak_tmp_begin_fps+ak_tmp)/ak_fps
var ak_tmp_txt=Math.floor(ak_tmp_time)
ak_std=Math.floor(ak_tmp_txt/3600)
ak_min=Math.floor((ak_tmp_txt-(ak_std*3600))/60)
ak_sec=ak_tmp_txt-(ak_std*3600)-(ak_min*60)
ak_frame=Math.floor(((ak_tmp_time-ak_tmp_txt)*ak_fps)+0.00001)
if(ak_frame==0)
{
if(ak_min<10) ak_min="0"+ak_min
if(ak_sec<10) ak_sec="0"+ak_sec
if(ak_sec==0 && ak_min==0 && ak_std==0)
{ak_tmpLarge+='<line style="stroke:#fff" x1="'+ak_tmp_x+'" y1="100%" x2="'+ak_tmp_x+'" y2="0"/>'}
else if(ak_sec==0 && ak_min==0 && ak_std>0)
{ak_tmpLarge+='<line style="stroke:#fff;stroke-width:3" x1="'+ak_tmp_x+'" y1="'+ak_timeline_ystart+'" x2="'+ak_tmp_x+'" y2="0"/>'}
else if(ak_sec==0)
{ak_tmpLarge+='<line style="stroke:#fff;stroke-width:1" x1="'+ak_tmp_x+'" y1="'+ak_timeline_ystart+'" x2="'+ak_tmp_x+'" y2="0"/>'}
else
{ak_tmpLarge+='<line x1="'+ak_tmp_x+'" y1="'+ak_timeline_ystart+'" x2="'+ak_tmp_x+'" y2="0"/>'}
ak_tmpLarge+='<text x="'+(ak_tmp_x+3)+'" y="10" style="font-size:11;stroke:none">'+ak_std+':'+ak_min+':'+ak_sec+'</text>'
}
else if(Math.floor(ak_frame/500)==(ak_frame/500))
{ak_tmpLarge+='<line style="stroke:#079" x1="'+ak_tmp_x+'" y1="'+ak_timeline_ystart+'" x2="'+ak_tmp_x+'" y2="'+(ak_timeline_ystart-19)+'"/>'}
else if(Math.floor(ak_frame/100)==(ak_frame/100))
{ak_tmpLarge+='<line style="stroke:#079" x1="'+ak_tmp_x+'" y1="'+ak_timeline_ystart+'" x2="'+ak_tmp_x+'" y2="'+(ak_timeline_ystart-16)+'"/>'}
else if(Math.floor(ak_frame/50)==(ak_frame/50))
{ak_tmpLarge+='<line style="stroke:#079" x1="'+ak_tmp_x+'" y1="'+ak_timeline_ystart+'" x2="'+ak_tmp_x+'" y2="'+(ak_timeline_ystart-12)+'"/>'}
else if(Math.floor(ak_frame/10)==(ak_frame/10))
{ak_tmpLarge+='<line style="stroke:#079" x1="'+ak_tmp_x+'" y1="'+ak_timeline_ystart+'" x2="'+ak_tmp_x+'" y2="'+(ak_timeline_ystart-9)+'"/>'}
else if(Math.floor(ak_frame/5)==(ak_frame/5))
{ak_tmpLarge+='<line style="stroke:#079" x1="'+ak_tmp_x+'" y1="'+ak_timeline_ystart+'" x2="'+ak_tmp_x+'" y2="'+(ak_timeline_ystart-5)+'"/>'}
else
{ak_tmpLarge+='<line style="stroke:#079" x1="'+ak_tmp_x+'" y1="'+ak_timeline_ystart+'" x2="'+ak_tmp_x+'" y2="'+(ak_timeline_ystart-2)+'"/>'}
ak_tmp_x+=ak_time_small
ak_tmp++
}
}
else
{
ak_timeline_begin=Math.floor(ak_timeline_begin/ak_timeline_res)*ak_timeline_res
ak_tmp=1/ak_timeline_res // counter second plus
var ak_tmp_x=(Math.floor(ak_timeline_begin)-ak_timeline_begin)*ak_tmp
var ak_tmp_time
while(ak_tmp_x<=ak_screen_width)
{
ak_tmp_time=(ak_tmp_x*ak_timeline_res)+ak_timeline_begin
var ak_tmp_txt=Math.floor(ak_tmp_time)
ak_std=Math.floor(ak_tmp_txt/3600)
ak_min=Math.floor((ak_tmp_txt-(ak_std*3600))/60)
ak_sec=ak_tmp_txt-(ak_std*3600)-(ak_min*60)
if(ak_tmp_x>=0)
{
if(ak_min<10) ak_min="0"+ak_min
if(ak_sec<10) ak_sec="0"+ak_sec
if(ak_sec==0 && ak_min==0 && ak_std==0)
{ak_tmpLarge+='<line style="stroke:#fff" x1="'+ak_tmp_x+'" y1="100%" x2="'+ak_tmp_x+'" y2="0"/>'}
else if(ak_sec==0 && ak_min==0 && ak_std>0)
{ak_tmpLarge+='<line style="stroke:#fff;stroke-width:3" x1="'+ak_tmp_x+'" y1="'+ak_timeline_ystart+'" x2="'+ak_tmp_x+'" y2="0"/>'}
else if(ak_sec==0)
{ak_tmpLarge+='<line style="stroke:#fff;stroke-width:1" x1="'+ak_tmp_x+'" y1="'+ak_timeline_ystart+'" x2="'+ak_tmp_x+'" y2="0"/>'}
else
{ak_tmpLarge+='<line x1="'+ak_tmp_x+'" y1="'+ak_timeline_ystart+'" x2="'+ak_tmp_x+'" y2="0"/>'}
ak_tmpLarge+='<text x="'+(ak_tmp_x+3)+'" y="10" style="font-size:11;stroke:none">'+ak_std+':'+ak_min+':'+ak_sec+'</text>'
}
if(ak_fps>100 && (ak_tmp*100)/ak_fps>=4)
{
var ak_tmp_delta=(ak_tmp*100)/ak_fps
var ak_tmp_i=ak_tmp_delta
while(ak_tmp_i<ak_tmp)
{
ak_tmpLarge+='<line style="stroke:#079" x1="'+(ak_tmp_x+ak_tmp_i)+'" y1="'+ak_timeline_ystart+'" x2="'+(ak_tmp_x+ak_tmp_i)+'" y2="'+(ak_timeline_ystart-16)+'"/>'
ak_tmp_i+=ak_tmp_delta
}
}
if(ak_fps>50 && (ak_tmp*50)/ak_fps>=4)
{
var ak_tmp_delta=(ak_tmp*50)/ak_fps
var ak_tmp_i=ak_tmp_delta
ak_tmp_delta+=ak_tmp_delta
while(ak_tmp_i<ak_tmp)
{
ak_tmpLarge+='<line style="stroke:#079" x1="'+(ak_tmp_x+ak_tmp_i)+'" y1="'+ak_timeline_ystart+'" x2="'+(ak_tmp_x+ak_tmp_i)+'" y2="'+(ak_timeline_ystart-12)+'"/>'
ak_tmp_i+=ak_tmp_delta
}
}
if(ak_fps>10 && (ak_tmp*10)/ak_fps>=4)
{
var ak_tmp_delta=(ak_tmp*10)/ak_fps
var ak_tmp_i=ak_tmp_delta
while(ak_tmp_i<ak_tmp)
{
ak_tmpLarge+='<line style="stroke:#079" x1="'+(ak_tmp_x+ak_tmp_i)+'" y1="'+ak_timeline_ystart+'" x2="'+(ak_tmp_x+ak_tmp_i)+'" y2="'+(ak_timeline_ystart-9)+'"/>'
ak_tmp_i+=ak_tmp_delta
}
}
if(ak_fps>5 && (ak_tmp*5)/ak_fps>=4)
{
var ak_tmp_delta=(ak_tmp*5)/ak_fps
var ak_tmp_i=ak_tmp_delta
ak_tmp_delta+=ak_tmp_delta
while(ak_tmp_i<ak_tmp)
{
ak_tmpLarge+='<line style="stroke:#079" x1="'+(ak_tmp_x+ak_tmp_i)+'" y1="'+ak_timeline_ystart+'" x2="'+(ak_tmp_x+ak_tmp_i)+'" y2="'+(ak_timeline_ystart-5)+'"/>'
ak_tmp_i+=ak_tmp_delta
}
}
ak_tmp_x+=ak_tmp
}
}
var ak_tmpNode='<g id="ak_timeline_small_scale"/>'
var ak_tmp_object=document.getElementById("ak_timeline_small_scale")
ak_tmp_object.parentNode.replaceChild(parseXML(ak_tmpNode,document).firstChild,ak_tmp_object)
}
else
{
if(ak_timeline_res<=0.02)
{
if(ak_timeline_res<=0.001)
{
ak_timeline_res=0.001
ak_time_small=100
}
else if(ak_timeline_res<=0.002)
{
ak_timeline_res=0.002
ak_time_small=50
}
else if(ak_timeline_res<=0.005)
{
ak_timeline_res=0.005
ak_time_small=20
}
else if(ak_timeline_res<=0.01)
{
ak_timeline_res=0.01
ak_time_small=10
}
else
{
ak_timeline_res=0.02
ak_time_small=5
}
ak_tmp=Math.round(ak_timeline_begin/(ak_timeline_res*ak_time_small))
ak_timeline_begin=ak_tmp*(ak_timeline_res*ak_time_small)
ak_tmp=Math.round(ak_timeline_begin)
var ak_tmp_i=5*ak_time_small
if(ak_timeline_begin!=ak_tmp)
{
if((ak_timeline_begin-ak_tmp)==-0.5) ak_tmp_i=0
else ak_tmp_i=(((0.5-(ak_timeline_begin-ak_tmp))*ak_time_small)*10)
}
var ak_tmp_txt=Math.floor(ak_timeline_begin)
if(ak_tmp!=ak_tmp_txt && ak_tmp_i!=0) ak_tmp_txt++
for(var i=ak_tmp_i;i<ak_screen_width;i+=(ak_time_small*10))
{
if((i-(ak_time_small*5))>=0)
{
ak_std=Math.floor(ak_tmp_txt/3600)
ak_min=Math.floor((ak_tmp_txt-(ak_std*3600))/60)
ak_sec=ak_round((ak_tmp_txt-(ak_std*3600)-(ak_min*60)),1000)
if(ak_min<10) ak_min="0"+ak_min
if(ak_sec<10) ak_sec="0"+ak_sec
if(ak_sec==0 && ak_min==0 && ak_std==0)
{ak_tmpLarge+='<line style="stroke:#fff" x1="'+ak_tmp_x+'" y1="100%" x2="'+ak_tmp_x+'" y2="0"/>'}
else if(ak_sec==0 && ak_min==0 && ak_std>0)
{ak_tmpLarge+='<line style="stroke:#fff;stroke-width:3" x1="'+(i-(ak_time_small*5))+'" y1="'+ak_timeline_ystart+'" x2="'+(i-(ak_time_small*5))+'" y2="0"/>'}
else if(ak_sec==0)
{ak_tmpLarge+='<line style="stroke:#fff;stroke-width:1" x1="'+(i-(ak_time_small*5))+'" y1="'+ak_timeline_ystart+'" x2="'+(i-(ak_time_small*5))+'" y2="0"/>'}
else
{ak_tmpLarge+='<line x1="'+(i-(ak_time_small*5))+'" y1="'+ak_timeline_ystart+'" x2="'+(i-(ak_time_small*5))+'" y2="0"/>'}
ak_tmpLarge+='<text x="'+(i-(ak_time_small*5)+3)+'" y="10" style="font-size:11;stroke:none">'+ak_std+':'+ak_min+':'+ak_sec+'</text>'
}
ak_tmp_txt++
ak_tmpLarge+='<line x1="'+i+'" y1="'+ak_timeline_ystart+'" x2="'+i+'" y2="'+(ak_timeline_ystart-7)+'"/>'
}
}
else if(ak_timeline_res<=0.2)
{
if(ak_timeline_res<=0.05)
{
ak_timeline_res=0.05
ak_time_small=2
}
else if(ak_timeline_res<=0.1)
{
ak_timeline_res=0.1
ak_time_small=1
}
else if(ak_timeline_res<=0.2)
{
ak_timeline_res=0.2
ak_time_small=0.5
ak_timeline_begin=Math.round(ak_timeline_begin)
}
ak_tmp=Math.round(ak_timeline_begin/0.5)
ak_timeline_begin=ak_tmp*0.5
ak_tmp=Math.round(ak_timeline_begin)
var ak_tmp_i=5*ak_time_small
if(ak_timeline_begin!=ak_tmp)
{
if((ak_timeline_begin-ak_tmp)==-0.5) ak_tmp_i=0
else ak_tmp_i=(((0.5-(ak_timeline_begin-ak_tmp))*ak_time_small)*10)
}
var ak_tmp_txt=Math.floor(ak_timeline_begin)
if(ak_tmp!=ak_tmp_txt && ak_tmp_i!=0) ak_tmp_txt++
for(var i=ak_tmp_i;i<ak_screen_width;i+=(ak_time_small*10))
{
if((i-(ak_time_small*5))>=0)
{
ak_std=Math.floor(ak_tmp_txt/3600)
ak_min=Math.floor((ak_tmp_txt-(ak_std*3600))/60)
ak_sec=ak_round((ak_tmp_txt-(ak_std*3600)-(ak_min*60)),1000)
if(ak_min<10) ak_min="0"+ak_min
if(ak_sec<10) ak_sec="0"+ak_sec
if(ak_sec==0 && ak_min==0 && ak_std==0)
{ak_tmpLarge+='<line style="stroke:#fff" x1="'+ak_tmp_x+'" y1="100%" x2="'+ak_tmp_x+'" y2="0"/>'}
else if(ak_sec==0 && ak_min==0 && ak_std>0)
{ak_tmpLarge+='<line style="stroke:#fff;stroke-width:3" x1="'+(i-(ak_time_small*5))+'" y1="'+ak_timeline_ystart+'" x2="'+(i-(ak_time_small*5))+'" y2="0"/>'}
else if(ak_sec==0)
{ak_tmpLarge+='<line style="stroke:#fff;stroke-width:1" x1="'+(i-(ak_time_small*5))+'" y1="'+ak_timeline_ystart+'" x2="'+(i-(ak_time_small*5))+'" y2="0"/>'}
else if(Math.floor(ak_sec/10)==(ak_sec/10))
{ak_tmpLarge+='<line x1="'+(i-(ak_time_small*5))+'" y1="'+ak_timeline_ystart+'" x2="'+(i-(ak_time_small*5))+'" y2="0"/>'}
else if(Math.floor(ak_sec/5)==(ak_sec/5))
{ak_tmpLarge+='<line x1="'+(i-(ak_time_small*5))+'" y1="'+ak_timeline_ystart+'" x2="'+(i-(ak_time_small*5))+'" y2="'+(ak_timeline_ystart-10)+'"/>'}
else
{ak_tmpLarge+='<line x1="'+(i-(ak_time_small*5))+'" y1="'+ak_timeline_ystart+'" x2="'+(i-(ak_time_small*5))+'" y2="'+(ak_timeline_ystart-5)+'"/>'}
if(Math.floor(ak_sec/10)==(ak_sec/10))
{
ak_tmpLarge+='<text x="'+(i-(ak_time_small*5)+3)+'" y="10" style="font-size:11;stroke:none">'+ak_std+':'+ak_min+':'+ak_sec+'</text>'
}
}
ak_tmp_txt++
if(ak_timeline_res<0.2) ak_tmpLarge+='<line x1="'+i+'" y1="'+ak_timeline_ystart+'" x2="'+i+'" y2="'+(ak_timeline_ystart-2)+'"/>'
}
}
else if(ak_timeline_res<=1)
{
if(ak_timeline_res<=0.5)
{
ak_timeline_res=0.5
ak_time_small=0.2
}
else if(ak_timeline_res<=1)
{
ak_timeline_res=1
ak_time_small=0.1
}
ak_tmp=Math.round(ak_timeline_begin/5)
ak_timeline_begin=ak_tmp*5
ak_tmp=Math.round(ak_timeline_begin)
var ak_tmp_i=5*ak_time_small
if(ak_timeline_begin!=ak_tmp)
{
if((ak_timeline_begin-ak_tmp)==-0.5) ak_tmp_i=0
else ak_tmp_i=(((0.5-(ak_timeline_begin-ak_tmp))*ak_time_small)*10)
}
var ak_tmp_txt=Math.floor(ak_timeline_begin)
if(ak_tmp!=ak_tmp_txt && ak_tmp_i!=0) ak_tmp_txt++
for(var i=ak_tmp_i;i<ak_screen_width;i+=(ak_time_small*10))
{
if((i-(ak_time_small*5))>=0)
{
ak_std=Math.floor(ak_tmp_txt/3600)
ak_min=Math.floor((ak_tmp_txt-(ak_std*3600))/60)
ak_sec=ak_round((ak_tmp_txt-(ak_std*3600)-(ak_min*60)),1000)
if(ak_min<10) ak_min="0"+ak_min
if(ak_sec<10) ak_sec="0"+ak_sec
if(ak_sec==0 && ak_min==0 && ak_std==0)
{ak_tmpLarge+='<line style="stroke:#fff" x1="'+ak_tmp_x+'" y1="100%" x2="'+ak_tmp_x+'" y2="0"/>'}
else if(ak_sec==0 && ak_min==0 && ak_std>0)
{ak_tmpLarge+='<line style="stroke:#fff;stroke-width:3" x1="'+(i-(ak_time_small*5))+'" y1="'+ak_timeline_ystart+'" x2="'+(i-(ak_time_small*5))+'" y2="0"/>'}
else if(ak_sec==0)
{ak_tmpLarge+='<line style="stroke:#fff;stroke-width:1" x1="'+(i-(ak_time_small*5))+'" y1="'+ak_timeline_ystart+'" x2="'+(i-(ak_time_small*5))+'" y2="0"/>'}
else if(Math.floor(ak_sec/10)==(ak_sec/10))
{ak_tmpLarge+='<line x1="'+(i-(ak_time_small*5))+'" y1="'+ak_timeline_ystart+'" x2="'+(i-(ak_time_small*5))+'" y2="'+(ak_timeline_ystart-10)+'"/>'}
else if(Math.floor(ak_sec/5)==(ak_sec/5))
{ak_tmpLarge+='<line x1="'+(i-(ak_time_small*5))+'" y1="'+ak_timeline_ystart+'" x2="'+(i-(ak_time_small*5))+'" y2="'+(ak_timeline_ystart-5)+'"/>'}
if(Math.floor(ak_sec/60)==(ak_sec/60))
{
ak_tmpLarge+='<text x="'+(i-(ak_time_small*5)+3)+'" y="10" style="font-size:11;stroke:none">'+ak_std+':'+ak_min+':'+ak_sec+'</text>'
}
}
ak_tmp_txt++
if(ak_timeline_res<0.2) ak_tmpLarge+='<line x1="'+i+'" y1="'+ak_timeline_ystart+'" x2="'+i+'" y2="'+(ak_timeline_ystart-2)+'"/>'
}
}
else if(ak_timeline_res<=10)
{
if(ak_timeline_res<=2)
{
ak_timeline_res=2
ak_time_small=0.05
}
else if(ak_timeline_res<=5)
{
ak_timeline_res=5
ak_time_small=0.02
ak_tmp=Math.round(ak_timeline_begin/60)
ak_timeline_begin=ak_tmp*60
}
else if(ak_timeline_res<=10)
{
ak_timeline_res=10
ak_time_small=0.01
ak_tmp=Math.round(ak_timeline_begin/60)
ak_timeline_begin=ak_tmp*60
}
ak_tmp=Math.round(ak_timeline_begin/10)
ak_timeline_begin=ak_tmp*10
ak_tmp=Math.round(ak_timeline_begin)
var ak_tmp_i=5*ak_time_small
if(ak_timeline_begin!=ak_tmp)
{
if((ak_timeline_begin-ak_tmp)==-0.5) ak_tmp_i=0
else ak_tmp_i=(((0.5-(ak_timeline_begin-ak_tmp))*ak_time_small)*10)
}
var ak_tmp_txt=Math.floor(ak_timeline_begin)
if(ak_tmp!=ak_tmp_txt && ak_tmp_i!=0) ak_tmp_txt++
for(var i=ak_tmp_i;i<ak_screen_width;i+=(ak_time_small*10))
{
if((i-(ak_time_small*5))>=0)
{
ak_std=Math.floor(ak_tmp_txt/3600)
ak_min=Math.floor((ak_tmp_txt-(ak_std*3600))/60)
ak_sec=ak_round((ak_tmp_txt-(ak_std*3600)-(ak_min*60)),1000)
if(ak_min<10) ak_min="0"+ak_min
if(ak_sec<10) ak_sec="0"+ak_sec
if(ak_sec==0 && ak_min==0 && ak_std==0)
{ak_tmpLarge+='<line style="stroke:#fff" x1="'+ak_tmp_x+'" y1="100%" x2="'+ak_tmp_x+'" y2="0"/>'}
else if(ak_sec==0 && ak_min==0 && ak_std>0)
{ak_tmpLarge+='<line style="stroke:#fff;stroke-width:3" x1="'+(i-(ak_time_small*5))+'" y1="'+ak_timeline_ystart+'" x2="'+(i-(ak_time_small*5))+'" y2="0"/>'}
else if(ak_sec==0 && Math.floor(ak_min/10)==(ak_min/10))
{ak_tmpLarge+='<line style="stroke:#fff;stroke-width:1" x1="'+(i-(ak_time_small*5))+'" y1="'+ak_timeline_ystart+'" x2="'+(i-(ak_time_small*5))+'" y2="0"/>'}
else if(ak_sec==0)
{ak_tmpLarge+='<line style="stroke:#fff;stroke-width:1" x1="'+(i-(ak_time_small*5))+'" y1="'+ak_timeline_ystart+'" x2="'+(i-(ak_time_small*5))+'" y2="'+(ak_timeline_ystart-10)+'"/>'}
else if(Math.floor(ak_sec/10)==(ak_sec/10) && ak_timeline_res<5)
{ak_tmpLarge+='<line x1="'+(i-(ak_time_small*5))+'" y1="'+ak_timeline_ystart+'" x2="'+(i-(ak_time_small*5))+'" y2="'+(ak_timeline_ystart-5)+'"/>'}
if(Math.floor(ak_min/10)==(ak_min/10) && ak_sec==0)
{
ak_tmpLarge+='<text x="'+(i-(ak_time_small*5)+3)+'" y="10" style="font-size:11;stroke:none">'+ak_std+':'+ak_min+':'+ak_sec+'</text>'
}
}
ak_tmp_txt++
}
}
var ak_tmpNode='<g id="ak_timeline_small_scale" style="stroke:#000;stroke-width:1">'
if(ak_time_small>=4)
{
for(var i=0;i<ak_screen_width;i+=ak_time_small)
{
ak_tmpNode+='<line x1="'+i+'" y1="'+ak_timeline_ystart+'" x2="'+i+'" y2="'+(ak_timeline_ystart-2)+'"/>'
}
}
ak_tmpNode+='</g>'
var ak_tmp_object=document.getElementById("ak_timeline_small_scale")
ak_tmp_object.parentNode.replaceChild(parseXML(ak_tmpNode,document).firstChild,ak_tmp_object)
}
ak_tmpLarge+='</g>'
ak_tmp_object=document.getElementById("ak_timeline_large_scale")
ak_tmp_object.parentNode.replaceChild(parseXML(ak_tmpLarge,document).firstChild,ak_tmp_object)
}
// #################################
function ak_getDefs()
{
var ak_tmp_def=ak_userspace_svg.getElementsByTagName("defs")
var ak_tmp_object
if(ak_tmp_def.length<=0)
{
ak_tmp_object=parseXML('<g>\n  <defs/>\n</g>',document).firstChild
var ak_tmp_child=ak_userspace_svg.childNodes
var ak_tmp_append=true
for(var i=0;i<ak_tmp_child.length;i++)
{
if(/^\[object SVG/.test(ak_tmp_child.item(i)) &&ak_which_nodeNr(ak_tmp_child.item(i))!=0)
{
if(ak_tmp_child.item(i).tagName!='script' && ak_tmp_child.item(i).tagName!='defs' && ak_tmp_child.item(i).tagName!='title')
{
ak_tmp_append=false
break
}
}
}
if(ak_tmp_append)
{
ak_userspace_svg.appendChild(ak_tmp_object.firstChild)
ak_userspace_svg.appendChild(ak_tmp_object.firstChild)
ak_userspace_svg.appendChild(ak_tmp_object.firstChild)
}
else
{
ak_tmp_object=parseXML('<g><defs/>\n  </g>',document).firstChild
ak_userspace_svg.insertBefore(ak_tmp_object.firstChild,ak_tmp_child.item(i))
ak_userspace_svg.insertBefore(ak_tmp_object.firstChild,ak_tmp_child.item(i+1))
}
ak_tmp_def=ak_userspace_svg.getElementsByTagName("defs")
}
return ak_tmp_def.item(0)
}
// #################################
//"25*pal*inpoint*outpoint*folder*filename_digits.extension*x*y*width*height"
var ak_timeline="25*pal*0*-1"
var ak_timelineNew=false, ak_toolBoxOn=false
function ak_timeline_editor(evt)
{
ak_svgroot.pauseAnimations()
ak_timeline_aniArray(evt)
if(ak_animationArray.length<=0)
{
ak_alert("No animations recognized!")
ak_svgroot.unpauseAnimations()
return
}
ak_lastStyle=ak_userspace_svg.firstChild.getAttribute("style")
ak_SetGetRm_styleValue(ak_userspace_svg.firstChild,"style","fill:#fff","no_cout")
if(ak_getAttribute(document.getElementById("ak_s_v_show"),"visibility")!="hidden")
{
ak_hide_s_v(evt)
ak_toolBoxOn=true
}
else ak_toolBoxOn=false
if(ak_durSlider.getAttribute("visibility")!="hidden") ak_durSlider.setAttribute("visibility","hidden")
var ak_tmp
ak_timeUndo=new Array
ak_timeRedo=new Array
ak_timeUndoClean=0
if(ak_dirty_flag) ak_timeUndoClean=-1
if(!ak_timelineNew)
{
ak_timelineNew=true
ak_timeline_scale_index=ak_timeline_scale_init
if(ak_timeline_scale_index>=ak_timeline_scale.length) ak_timeline_scale_index=ak_timeline_scale.length-1
ak_timeline_begin=0
ak_tmp=ak_timeEnd/600
if(ak_timeline_scale[ak_timeline_scale_index]<ak_tmp)
{
for(ak_timeline_scale_index=0;ak_timeline_scale_index<ak_timeline_scale.length;ak_timeline_scale_index++)
{
if(ak_timeline_scale[ak_timeline_scale_index]>ak_tmp) break
}
if(ak_timeline_scale_index>=ak_timeline_scale.length) ak_timeline_scale_index=ak_timeline_scale.length-1
}
}
// ak_variable_timeline auswerten
var ak_tmp_var=document.getElementById("ak_variable_timeline")
if(ak_tmp_var && ak_tmp_var.tagName!="text")
{
ak_tmp_var.parentNode.replaceChild(parseXML('<text id="ak_variable_timeline" visibility="hidden">'+ak_timeline+'</text>',document).firstChild,ak_tmp_var)
ak_tmp_var=document.getElementById("ak_variable_timeline")
}
else if(!ak_tmp_var)
{
var ak_tmp_def=ak_userspace_svg.getElementsByTagName("defs")
var ak_tmp_object
if(ak_tmp_def.length<=0)
{
ak_tmp_object=parseXML('<g>\n  <defs/>\n</g>',document).firstChild
var ak_tmp_child=ak_userspace_svg.childNodes
var ak_tmp_append=true
for(var i=0;i<ak_tmp_child.length;i++)
{
if(/^\[object SVG/.test(ak_tmp_child.item(i)) &&ak_which_nodeNr(ak_tmp_child.item(i))!=0)
{
if(ak_tmp_child.item(i).tagName!='script' && ak_tmp_child.item(i).tagName!='defs' && ak_tmp_child.item(i).tagName!='title')
{
ak_tmp_append=false
break
}
}
}
if(ak_tmp_append)
{
ak_userspace_svg.appendChild(ak_tmp_object.firstChild)
ak_userspace_svg.appendChild(ak_tmp_object.firstChild)
ak_userspace_svg.appendChild(ak_tmp_object.firstChild)
}
else
{
ak_tmp_object=parseXML('<g><defs/>\n  </g>',document).firstChild
ak_userspace_svg.insertBefore(ak_tmp_object.firstChild,ak_tmp_child.item(i))
ak_userspace_svg.insertBefore(ak_tmp_object.firstChild,ak_tmp_child.item(i+1))
}
ak_tmp_def=ak_userspace_svg.getElementsByTagName("defs")
}
ak_tmp=ak_which_nodeNr(ak_tmp_def.item(0))
if(ak_tmp.search(/,/)==-1) ak_tmp="  "
else
{
var ak_tmp_i=ak_tmp.split(",")
ak_tmp_i=ak_tmp_i.length
ak_tmp=""
for(var i=0;i<ak_tmp_i;i++){ak_tmp+="  "}
}
if(ak_tmp_def.item(0).lastChild)
{
ak_tmp_object=parseXML('<g>\n  '+ak_tmp+'<text id="ak_variable_timeline" visibility="hidden">'+ak_timeline+'</text></g>',document).firstChild
ak_tmp_def.item(0).insertBefore(ak_tmp_object.firstChild,ak_tmp_def.item(0).lastChild)
ak_tmp_def.item(0).insertBefore(ak_tmp_object.firstChild,ak_tmp_def.item(0).lastChild)
}
else
{
ak_tmp_object=parseXML('<g>\n  '+ak_tmp+'<text id="ak_variable_timeline" visibility="hidden">'+ak_timeline+'</text>\n'+ak_tmp+'</g>',document).firstChild
ak_tmp_def.item(0).appendChild(ak_tmp_object.firstChild)
ak_tmp_def.item(0).appendChild(ak_tmp_object.firstChild)
ak_tmp_def.item(0).appendChild(ak_tmp_object.firstChild)
}
ak_tmp_var=document.getElementById("ak_variable_timeline")
}
ak_tmp=ak_tmp_var.firstChild.data
ak_tmp=ak_tmp.replace(/\r|\n/g,"") // whitespaces raus
if(ak_tmp.search(/\*/)==-1) ak_tmp=new Array(ak_tmp)
else ak_tmp=ak_tmp.split("*")
if(ak_tmp[0])
{
ak_tmp[0]=parseFloat(ak_tmp[0])
if(isNaN(ak_tmp[0])) ak_tmp[0]=25
if(ak_tmp[0]<1) ak_tmp[0]=1
else if(ak_tmp[0]>1000) ak_tmp[0]=1000
}
else ak_tmp[0]=25
ak_fps=ak_tmp[0]
if(ak_tmp[1])
{
ak_tmp[1]=ak_tmp[1].replace(/^ +| +$/g,"")
ak_tmp[1]=ak_tmp[1].toLowerCase()
if(ak_tmp[1]!="interlaced-pal" && ak_tmp[1]!="interlaced-ntsc") ak_tmp[1]="progressive"
if(ak_tmp[0]>500) ak_tmp[1]="progressive"
}
else ak_tmp[1]="progressive"
ak_progressive=ak_tmp[1]
if(ak_tmp[2])
{
ak_tmp[2]=parseFloat(ak_tmp[2])
if(isNaN(ak_tmp[2])) ak_tmp[2]=0
else if(ak_tmp[2]<0) ak_tmp[2]=0
}
else ak_tmp[2]=0
ak_timeInpoint=ak_tmp[2]
if(ak_tmp[3])
{
ak_tmp[3]=parseFloat(ak_tmp[3])
if(isNaN(ak_tmp[3])) ak_tmp[3]=-1
else if(ak_tmp[3]<0) ak_tmp[3]=-1
else if(ak_tmp[3]<ak_tmp[2]) ak_tmp[3]=-1
}
else ak_tmp[3]=-1
ak_timeOutpoint=ak_tmp[3]
if(!ak_tmp[4]) ak_tmp[4]=ak_directory
if(!ak_tmp[5]) ak_tmp[5]=ak_file.replace(/(\.svg)$/,"_"+Math.ceil(ak_timeEnd*ak_fps)+".png")
ak_tmp_var.firstChild.data=ak_tmp.join("*")
// ak_variable_timeline schreiben
ak_lastSelected=ak_object2update
ak_checkLink=new Array
var ak_tmp_a=ak_userspace_svg.getElementsByTagName("a")
ak_checkLink=new Array
for(var i=0;i<ak_tmp_a.length;i++)
{
ak_checkLink[i]=new Array(ak_tmp_a.item(i),"","","")
ak_checkLink[i][1]=ak_checkLink[i][0].getAttribute("xlink:href")
if(ak_checkLink[i][1])
{
ak_checkLink[i][2]=ak_checkLink[i][0].getAttribute("target")
if(/(_parent)|(_self)|(_top)/.test(ak_checkLink[i][2]) ||!ak_checkLink[i][2])
{
ak_checkLink[i][3]=ak_checkLink[i][0].getAttribute("onclick")
ak_checkLink[i][0].setAttribute("onclick","ak_redirectAlways(evt);"+ak_checkLink[i][3])
ak_checkLink[i][0].setAttribute("target","redirect")
}
}
}
ak_deselect(evt)
ak_menu_status="timeline"
ak_cout("")
ak_draw_timescale(evt)
ak_draw_animations(evt)
document.getElementById("ak_timeline_g").setAttribute("visibility","visible")
}
// #################################
var ak_firstAnimation=0, ak_maxCount=10
function ak_draw_animations(evt)
{
var ak_tmp, ak_tmp2, ak_tmp3, ak_tmp4, ak_tmpBeg
if(ak_maxCount<2) ak_maxCount=2
var ak_tmp_count=ak_maxCount
if(ak_firstAnimation<0) ak_firstAnimation=0
if(ak_maxCount>ak_timelineArray.length)
{
ak_tmp_count=ak_timelineArray.length
ak_firstAnimation=0
}
else if(ak_tmp_count>(ak_timelineArray.length-ak_firstAnimation))
{
ak_firstAnimation=ak_timelineArray.length-ak_tmp_count
}
ak_timeline_count=ak_tmp_count
ak_timeline_top=window.innerHeight-(ak_timeline_ystart+ak_timeline_yani+(ak_tmp_count*ak_timeline_anidelta))
if(ak_timeline_top<ak_timeStatus) ak_timeline_top=ak_timeStatus
document.getElementById("ak_timeline_g").setAttribute("transform","translate(0,"+ak_timeline_top+")")
var ak_tmpNode='<g id="ak_timeline_ani" transform="translate(-'+(ak_timeline_begin/ak_timeline_res)+','+(ak_timeline_ystart+ak_timeline_yani)+')">'
var ak_tmpNodeIndex='<g id="ak_timeline_nr" transform="translate('+(ak_timeline_left/2)+',0)" fill="#000" style="text-anchor:middle">'
for(var i=ak_firstAnimation;i<(ak_firstAnimation+ak_tmp_count);i++)
{
if(i==0) ak_tmpNodeIndex+='<text onmousedown="ak_timeMouseAction(evt,\'line\','+i+')" fill="#fff" x="0" y="'+(((i-ak_firstAnimation)*ak_timeline_anidelta)+ak_timeline_ystart+ak_timeline_yani+9)+'">'+(i+1)+'.)</text>'
else ak_tmpNodeIndex+='<text onmousedown="ak_timeMouseAction(evt,\'line\','+i+')" x="0" y="'+(((i-ak_firstAnimation)*ak_timeline_anidelta)+ak_timeline_ystart+ak_timeline_yani+9)+'">'+(i+1)+'.)</text>'
ak_tmpBeg=0
if(ak_animationArray[ak_timelineArray[i][1]][11]==-1)
{
if(ak_animationArray[ak_timelineArray[i][1]][2])
{
ak_tmpBeg=ak_animationArray[ak_timelineArray[i][1]][2]
ak_tmpNode+='<g transform="translate('+(ak_animationArray[ak_timelineArray[i][1]][2]/ak_timeline_res)+','+((i-ak_firstAnimation)*ak_timeline_anidelta)+')">'
}
else ak_tmpNode+='<g transform="translate(0,'+((i-ak_firstAnimation)*ak_timeline_anidelta)+')">'
}
else ak_tmpNode+='<g transform="translate('+(ak_animationArray[ak_timelineArray[i][1]][11]/ak_timeline_res)+','+((i-ak_firstAnimation)*ak_timeline_anidelta)+')">'
ak_tmp2="#2b0"
if(ak_animationArray[ak_timelineArray[i][1]][1])
{
ak_tmp3=0
if(ak_animationArray[ak_timelineArray[i][1]][2]) ak_tmp3=-ak_animationArray[ak_timelineArray[i][1]][2]/ak_timeline_res
if(/\.begin$/.test(ak_animationArray[ak_timelineArray[i][1]][1])) ak_tmp2="#eee"
else if(/\.end$/.test(ak_animationArray[ak_timelineArray[i][1]][1])) ak_tmp2="#555"
else ak_tmp2="#f21"
if(ak_tmp2!="#f21" && ak_animationArray[ak_timelineArray[i][1]][11]==-1) ak_tmp2="#e0e"
ak_tmpNode+='<line x1="'+ak_tmp3+'" y1="0" x2="0" y2="0" style="stroke:'+ak_tmp2+'"/>'
ak_tmpNode+='<line x1="'+ak_tmp3+'" y1="-2" x2="'+ak_tmp3+'" y2="14" style="stroke:'+ak_tmp2+'"/>'
}
if(ak_tmp2!="#f21" && ak_tmp2!="#e0e" && ak_animationArray[ak_timelineArray[i][1]][3]) ak_tmp2="#ee0"
if(ak_animationArray[ak_timelineArray[i][1]][7]!="indefinite") ak_tmp3=ak_animationArray[ak_timelineArray[i][1]][7]/ak_timeline_res
else ak_tmp3=0
ak_tmp4=ak_tmp3
if(ak_animationArray[ak_timelineArray[i][1]][8] && ak_animationArray[ak_timelineArray[i][1]][8]!="indefinite")
{ak_tmp4=ak_animationArray[ak_timelineArray[i][1]][8]*ak_tmp3}
var ak_tmpRD=false
if(typeof(ak_animationArray[ak_timelineArray[i][1]][9])=="number")
{
ak_tmpRD=ak_animationArray[ak_timelineArray[i][1]][9]/ak_timeline_res
if(ak_animationArray[ak_timelineArray[i][1]][8] && ak_animationArray[ak_timelineArray[i][1]][8]!="indefinite")
{
if(ak_tmpRD<ak_tmp4)
{
ak_tmp4=ak_tmpRD
ak_tmpRD=true
}
else ak_tmpRD=false
}
else
{
ak_tmp4=ak_tmpRD
ak_tmpRD=true
}
}
else if(ak_animationArray[ak_timelineArray[i][1]][9]=="indefinite") ak_tmpRD=true
if(ak_tmp4>ak_tmp3)
{
ak_tmpNode+='<line x1="'+ak_tmp3+'" y1="0" x2="'+ak_tmp4+'" y2="0" style="stroke:#000"/>'
}
ak_tmpNode+='<rect onmousedown="ak_timeMouseAction(evt,\'begin\','+i+')" x="0" y="0" width="'+ak_tmp3+'" height="5" style="fill:'+ak_tmp2+'"/>'
ak_tmp=ak_timelineArray[i][0]
if(ak_timelineArray[i][2]) ak_tmp+="..."
ak_tmpNode+='<text onmousedown="ak_timeMouseAction(evt,\'begin\','+i+')" x="2" y="13" style="fill:#000">'+ak_tmp+'</text>'
if(ak_animationArray[ak_timelineArray[i][1]][8] || ak_animationArray[ak_timelineArray[i][1]][9] || typeof(ak_animationArray[ak_timelineArray[i][1]][9])=="number")
{
if(ak_tmpRD && ak_animationArray[ak_timelineArray[i][1]][9]!="indefinite") ak_tmpNode+='<rect onmousedown="ak_timeMouseAction(evt,\'repeat\','+i+')" x="'+ak_tmp4+'" y="0" width="16" height="12" style="stroke:#000;fill:#6f4"/>'
else if(!ak_tmpRD && ak_animationArray[ak_timelineArray[i][1]][8]!="indefinite") ak_tmpNode+='<rect onmousedown="ak_timeMouseAction(evt,\'repeat\','+i+')" x="'+ak_tmp4+'" y="0" width="16" height="12" style="stroke:#000;fill:#bdf"/>'
else ak_tmpNode+='<rect onmousedown="ak_timeMouseAction(evt,\'repeat\','+i+')" x="'+ak_tmp4+'" y="0" width="16" height="12" style="stroke:#000;fill:#f87"/>'
}
if(ak_animationArray[ak_timelineArray[i][1]][7]=="indefinite") ak_tmpNode+='<rect onmousedown="ak_timeMouseAction(evt,\'dur\','+i+')" x="'+ak_tmp3+'" y="0" width="8" height="12" style="stroke:#000;fill:#f21"/>'
else if(ak_animationArray[ak_timelineArray[i][1]][11]==-1) ak_tmpNode+='<rect onmousedown="ak_timeMouseAction(evt,\'dur\','+i+')" x="'+ak_tmp3+'" y="0" width="8" height="12" style="stroke:#000;fill:#e0e"/>'
else ak_tmpNode+='<rect onmousedown="ak_timeMouseAction(evt,\'dur\','+i+')" x="'+ak_tmp3+'" y="0" width="8" height="12" style="stroke:#000;fill:#2b0"/>'
if(ak_animationArray[ak_timelineArray[i][1]][15])ak_tmpNode+='<text onmousedown="ak_timeMouseAction(evt,\'dur\','+i+')" x="'+(ak_tmp3+3)+'" y="10" style="fill:#fff">f</text>'
if(ak_animationArray[ak_timelineArray[i][1]][4] || ak_animationArray[ak_timelineArray[i][1]][5])
{
ak_tmp2="#2b0"
if(/\.begin$/.test(ak_animationArray[ak_timelineArray[i][1]][4])) ak_tmp2="#eee"
else if(/\.end$/.test(ak_animationArray[ak_timelineArray[i][1]][4])) ak_tmp2="#555"
else if(ak_animationArray[ak_timelineArray[i][1]][4]) ak_tmp2="#f21"
if(ak_animationArray[ak_timelineArray[i][1]][13]==-1)
{
if(ak_tmp2!="#f21" && ak_animationArray[ak_timelineArray[i][1]][11]==-1) ak_tmp2="#e0e"
ak_tmp3=0
if(ak_animationArray[ak_timelineArray[i][1]][5]) ak_tmp3+=ak_animationArray[ak_timelineArray[i][1]][5]/ak_timeline_res
}
else ak_tmp3=ak_animationArray[ak_timelineArray[i][1]][13]/ak_timeline_res
if(ak_animationArray[ak_timelineArray[i][1]][11]!=-1) ak_tmp3=ak_tmp3-(ak_animationArray[ak_timelineArray[i][1]][11]/ak_timeline_res)
else ak_tmp3=ak_tmp3-(ak_tmpBeg/ak_timeline_res)
ak_tmp4=0
if(ak_animationArray[ak_timelineArray[i][1]][5]) ak_tmp4=ak_animationArray[ak_timelineArray[i][1]][5]/ak_timeline_res
if(ak_tmp2!="#2b0")
{
ak_tmpNode+='<line x1="'+ak_tmp3+'" y1="0" x2="'+(ak_tmp3-ak_tmp4)+'" y2="0" style="stroke:'+ak_tmp2+'"/>'
ak_tmpNode+='<line x1="'+(ak_tmp3-ak_tmp4)+'" y1="-2" x2="'+(ak_tmp3-ak_tmp4)+'" y2="14" style="stroke:'+ak_tmp2+'"/>'
}
if(ak_tmp2!="#f21" && ak_tmp2!="#e0e" && ak_animationArray[ak_timelineArray[i][1]][6]) ak_tmp2="#ee0"
ak_tmpNode+='<path onmousedown="ak_timeMouseAction(evt,\'end\','+i+')" d="M '+(ak_tmp3)+' 1 l 5 10 l -10 0 Z" style="fill:'+ak_tmp2+';stroke-width:1;stroke:#000"/>'
}
ak_tmpNode+='</g>'
}
ak_timeInpoint=Math.floor(ak_timeInpoint*ak_fps)/ak_fps
if(ak_timeOutpoint>0) ak_timeOutpoint=Math.ceil(ak_timeOutpoint*ak_fps)/ak_fps
ak_tmp2=(ak_timeInpoint/ak_timeline_res)
if(ak_timeOutpoint==-1 && ak_timeEnd>=ak_timeInpoint)
{ak_tmp3=(ak_timeEnd/ak_timeline_res)}
else if(ak_timeOutpoint>ak_timeInpoint)
{ak_tmp3=(ak_timeOutpoint/ak_timeline_res)}
else if(ak_timeOutpoint==-1)
{ak_tmp3=(ak_timeInpoint/ak_timeline_res)}
else
{
ak_timeOutpoint=ak_timeInpoint
ak_tmp3=(ak_timeOutpoint/ak_timeline_res)
}
ak_tmpNode+='<rect onmousedown="ak_timeMouseAction(evt,\'scale\')" x="'+ak_tmp2+'" y="'+(-ak_timeline_ystart+9)+'" width="'+(ak_tmp3-ak_tmp2)+'" height="5" style="fill:#006993"/>'
ak_tmpNode+='<g onmousedown="ak_timeMouseAction(evt,\'InOut\',\'Out\')" transform="translate('+ak_tmp3+','+(-ak_timeline_ystart+6)+')">'
ak_tmpNode+='<path d="M 0 0 l 0 14 l 20 0 l 0 -10 l -18 0 Z" style="fill:#faa;stroke-width:1;stroke:#000"/>'
ak_tmpNode+='<text x="3" y="13">out</text>'
ak_tmpNode+='<path d="M 0 0 l 0 14 l 20 0 l 0 -10 l -18 0 Z" style="opacity:0"/>'
ak_tmpNode+='</g>'
ak_tmpNode+='<g onmousedown="ak_timeMouseAction(evt,\'InOut\',\'In\')" transform="translate('+ak_tmp2+','+(-ak_timeline_ystart+6)+')">'
ak_tmpNode+='<path d="M 0 0 l 0 14 l 12 0 l 0 -10 l -10 0 Z" style="fill:#afa;stroke-width:1;stroke:#000"/>'
ak_tmpNode+='<text x="2" y="13">in</text>'
ak_tmpNode+='<path d="M 0 0 l 0 14 l 12 0 l 0 -10 l -10 0 Z" style="opacity:0"/>'
ak_tmpNode+='</g>'
ak_tmpNode+='<line id="ak_aniPause" onmousedown="ak_timeMouseAction(evt,\'scale\')" x1="'+(ak_timeline_pause/ak_timeline_res)+'" y1="-'+(ak_timeline_ystart+ak_timeline_yani+0)+'" x2="'+(ak_timeline_pause/ak_timeline_res)+'" y2="100%" style="stroke-width:1;stroke:#fff;fill:#f00;stroke-dasharray:4 8"/>'
ak_tmpNode+='</g>'
ak_tmp=((ak_tmp_count*ak_timeline_anidelta)+ak_timeline_ystart+ak_timeline_yani-9)
if((ak_timeline_top+ak_tmp)>window.innerHeight) ak_tmp=window.innerHeight-9-ak_timeline_top
if((ak_tmp_count+ak_firstAnimation)<ak_timelineArray.length)
{
ak_tmpNodeIndex+='<path onmousedown="ak_timeMouseAction(evt,\'line\')" id="ak_more_ani" d="M '+((ak_timeline_left/2)-1)+' '+ak_tmp+' l -8 0 l 4 8 Z" style="fill:#fff;stroke-width:1;stroke:#000"/>'
}
else ak_tmpNodeIndex+='<path onmousedown="ak_timeMouseAction(evt,\'line\')" visibility="hidden" id="ak_more_ani" d="M '+((ak_timeline_left/2)-1)+' '+ak_tmp+' l -8 0 l 4 8 Z" style="fill:#fff;stroke-width:1;stroke:#000"/>'
ak_tmpNodeIndex+='</g>'
var ak_tmp_object=parseXML(ak_tmpNode,document).firstChild
var ak_tmp_replace=document.getElementById("ak_timeline_ani")
ak_tmp_replace.parentNode.replaceChild(ak_tmp_object,ak_tmp_replace)
ak_tmp_object=parseXML(ak_tmpNodeIndex,document).firstChild
ak_tmp_replace=document.getElementById("ak_timeline_nr")
ak_tmp_replace.parentNode.replaceChild(ak_tmp_object,ak_tmp_replace)
ak_tPause=document.getElementById("ak_aniPause")
ak_svgroot.setCurrentTime(ak_timeline_pause+1)
ak_svgroot.setCurrentTime(ak_timeline_pause)
}
// #################################
function ak_timeMenu(evt,action,entry,index)
{
var ak_tmp, ak_tmp_id1
switch(action)
{
case "fill":
if(ak_timelineArray[index][2])
{// wenn ak_multi_
for(var i=0;i<ak_animationArray.length;i++)
{
if(ak_animationArray[i][10].search(ak_timelineArray[index][0])==0)
{
if(entry=="freeze") ak_animationArray[i][15]=true
else ak_animationArray[i][15]=false
ak_animationArray[i][0].setAttribute(action,entry)
}
}
}
else if(entry=="freeze")
{
ak_animationArray[ak_timelineArray[index][1]][15]=true
ak_animationArray[ak_timelineArray[index][1]][0].setAttribute(action,"freeze")
}
else
{
ak_animationArray[ak_timelineArray[index][1]][15]=false
ak_animationArray[ak_timelineArray[index][1]][0].setAttribute(action,entry)
}
ak_draw_animations(evt)
break
case "begin":
if(ak_timelineArray[index][2])
{// wenn ak_multi_
for(var i=0;i<ak_animationArray.length;i++)
{
if(ak_animationArray[i][10].search(ak_timelineArray[index][0])==0)
{
if(typeof(entry)=="number")
{
ak_animationArray[i][1]=""
ak_animationArray[i][2]=entry
}
else
{
ak_animationArray[i][1]=entry
ak_animationArray[i][2]=""
}

}
}
}
else
{
if(typeof(entry)=="number")
{
ak_animationArray[ak_timelineArray[index][1]][1]=""
ak_animationArray[ak_timelineArray[index][1]][2]=entry
}
else
{
ak_animationArray[ak_timelineArray[index][1]][1]=entry
ak_animationArray[ak_timelineArray[index][1]][2]=""
}
}
ak_animationArray[ak_timelineArray[index][1]][3]=""
ak_timeline_aniArray(evt,"no_new_array")
ak_draw_animations(evt)
break
case "end":
if(ak_timelineArray[index][2])
{// wenn ak_multi_
for(var i=0;i<ak_animationArray.length;i++)
{
if(ak_animationArray[i][10].search(ak_timelineArray[index][0])==0)
{
if(typeof(entry)=="number")
{
ak_animationArray[i][4]=""
ak_animationArray[i][5]=entry
}
else
{
ak_animationArray[i][4]=entry
ak_animationArray[i][5]=""
}

}
}
}
else
{
if(typeof(entry)=="number")
{
ak_animationArray[ak_timelineArray[index][1]][4]=""
ak_animationArray[ak_timelineArray[index][1]][5]=entry
}
else
{
ak_animationArray[ak_timelineArray[index][1]][4]=entry
ak_animationArray[ak_timelineArray[index][1]][5]=""
}
}
ak_animationArray[ak_timelineArray[index][1]][6]=""
ak_timeline_aniArray(evt,"no_new_array")
ak_draw_animations(evt)
break
case "enterRepeat":
if(ak_animationArray[ak_timelineArray[index][1]][7]=="indefinite")
{
ak_tmp_id1=prompt('Please Enter repeatDur!\n2.4=2.4s, 340ms, 2min, 1h, 1:20:23.3=h:min:sec, 2:23=min:sec',ak_hhmmss(ak_animationArray[ak_timelineArray[index][1]][9],"mm:ss"))
}
else
{
if(ak_animationArray[ak_timelineArray[index][1]][8]) ak_tmp="x"+ak_animationArray[ak_timelineArray[index][1]][8]
else if(typeof(ak_animationArray[ak_timelineArray[index][1]][9])=="number") ak_tmp=ak_hhmmss(ak_animationArray[ak_timelineArray[index][1]][9],"mm:ss")
else if(ak_animationArray[ak_timelineArray[index][1]][9]) ak_tmp=ak_animationArray[ak_timelineArray[index][1]][9]
else ak_tmp=ak_hhmmss(ak_animationArray[ak_timelineArray[index][1]][7],"mm:ss")
ak_tmp_id1=prompt('Please Enter repeatCount|Dur (x3.4 = Count | 23.2 = Dur)!\n2.4=2.4s, 340ms, 2min, 1h, 1:20:23.3=h:min:sec, 2:23=min:sec',ak_tmp)
}
window.focus(ak_svgroot)
if(!ak_tmp_id1) return
ak_tmp_id1=ak_tmp_id1.replace(/^ +| +$/g,'')
if(!ak_tmp_id1) return
ak_tmp_id1=ak_tmp_id1.toLowerCase()
if(ak_tmp_id1=="indefinite")
{
ak_animationArray[ak_timelineArray[index][1]][8]=""
ak_animationArray[ak_timelineArray[index][1]][9]=ak_tmp_id1
}
else if(/^x/.test(ak_tmp_id1))
{
if(ak_animationArray[ak_timelineArray[index][1]][7]=="indefinte") return
ak_tmp_id1=ak_tmp_id1.replace(/^x/,'')
ak_tmp_id1=parseFloat(ak_tmp_id1)
if(isNaN(ak_tmp_id1)) return
ak_tmp_id1=ak_round(ak_tmp_id1,1000)
if(ak_tmp_id1<0.01) return
ak_animationArray[ak_timelineArray[index][1]][8]=ak_tmp_id1
ak_animationArray[ak_timelineArray[index][1]][9]=""
}
else
{
ak_tmp=ak_checkTime(ak_tmp_id1)
if(isNaN(ak_tmp) || ak_tmp<0) return
ak_animationArray[ak_timelineArray[index][1]][8]=""
ak_animationArray[ak_timelineArray[index][1]][9]=ak_tmp
}
if(ak_timelineArray[index][2])
{// wenn ak_multi_
for(var i=0;i<ak_animationArray.length;i++)
{
if(i!=ak_timelineArray[index][1] && ak_animationArray[i][10].search(ak_timelineArray[index][0])==0)
{
ak_animationArray[i][8]=ak_animationArray[ak_timelineArray[index][1]][8]
ak_animationArray[i][9]=ak_animationArray[ak_timelineArray[index][1]][9]
}
}
}
ak_timeline_aniArray(evt,"no_new_array")
ak_draw_animations(evt)
break
case "repeatRemove":
ak_animationArray[ak_timelineArray[index][1]][8]=""
ak_animationArray[ak_timelineArray[index][1]][9]=""
if(ak_timelineArray[index][2])
{// wenn ak_multi_
for(var i=0;i<ak_animationArray.length;i++)
{
if(i!=ak_timelineArray[index][1] && ak_animationArray[i][10].search(ak_timelineArray[index][0])==0)
{
ak_animationArray[i][8]=ak_animationArray[ak_timelineArray[index][1]][8]
ak_animationArray[i][9]=ak_animationArray[ak_timelineArray[index][1]][9]
}
}
}
ak_timeline_aniArray(evt,"no_new_array")
ak_draw_animations(evt)
break
case "endRemove":
ak_animationArray[ak_timelineArray[index][1]][4]=""
ak_animationArray[ak_timelineArray[index][1]][5]=""
ak_animationArray[ak_timelineArray[index][1]][6]=""
if(ak_timelineArray[index][2])
{// wenn ak_multi_
for(var i=0;i<ak_animationArray.length;i++)
{
if(i!=ak_timelineArray[index][1] && ak_animationArray[i][10].search(ak_timelineArray[index][0])==0)
{
ak_animationArray[i][4]=ak_animationArray[ak_timelineArray[index][1]][4]
ak_animationArray[i][5]=ak_animationArray[ak_timelineArray[index][1]][5]
ak_animationArray[i][6]=ak_animationArray[ak_timelineArray[index][1]][6]
}
}
}
ak_timeline_aniArray(evt,"no_new_array")
ak_draw_animations(evt)
break
case "repeatDur":
ak_animationArray[ak_timelineArray[index][1]][8]=""
ak_animationArray[ak_timelineArray[index][1]][9]=entry
if(ak_timelineArray[index][2])
{// wenn ak_multi_
for(var i=0;i<ak_animationArray.length;i++)
{
if(i!=ak_timelineArray[index][1] && ak_animationArray[i][10].search(ak_timelineArray[index][0])==0)
{
ak_animationArray[i][8]=ak_animationArray[ak_timelineArray[index][1]][8]
ak_animationArray[i][9]=ak_animationArray[ak_timelineArray[index][1]][9]
}
}
}
ak_timeline_aniArray(evt,"no_new_array")
ak_draw_animations(evt)
break
case "repeatCount":
ak_animationArray[ak_timelineArray[index][1]][8]=entry
ak_animationArray[ak_timelineArray[index][1]][9]=""
if(ak_timelineArray[index][2])
{// wenn ak_multi_
for(var i=0;i<ak_animationArray.length;i++)
{
if(i!=ak_timelineArray[index][1] && ak_animationArray[i][10].search(ak_timelineArray[index][0])==0)
{
ak_animationArray[i][8]=ak_animationArray[ak_timelineArray[index][1]][8]
ak_animationArray[i][9]=ak_animationArray[ak_timelineArray[index][1]][9]
}
}
}
ak_timeline_aniArray(evt,"no_new_array")
ak_draw_animations(evt)
break
case "enterDur":
ak_tmp_id1=prompt('Please Enter dur!\n2.4=2.4s, 340ms, 2min, 1h, 1:20:23.3=h:min:sec, 2:23=min:sec',ak_hhmmss(ak_animationArray[ak_timelineArray[index][1]][7],"mm:ss"))
window.focus(ak_svgroot)
if(!ak_tmp_id1) return
ak_tmp_id1=ak_tmp_id1.replace(/^ +| +$/g,'')
if(!ak_tmp_id1) return
ak_animationArray[ak_timelineArray[index][1]][7]=ak_checkTime(ak_tmp_id1)
if(isNaN(ak_animationArray[ak_timelineArray[index][1]][7]) || ak_animationArray[ak_timelineArray[index][1]][7]<0) ak_animationArray[ak_timelineArray[index][1]][7]="indefinite"
if(ak_timelineArray[index][2])
{// wenn ak_multi_
for(var i=0;i<ak_animationArray.length;i++)
{
if(i!=ak_timelineArray[index][1] && ak_animationArray[i][10].search(ak_timelineArray[index][0])==0)
{
ak_animationArray[i][7]=ak_animationArray[ak_timelineArray[index][1]][7]
}
}
}
ak_timeline_aniArray(evt,"no_new_array")
ak_draw_animations(evt)
break
case "enterEnd":
ak_tmp=ak_animationArray[ak_timelineArray[index][1]][4]
if(ak_tmp)
{
if(ak_animationArray[ak_timelineArray[index][1]][5]) ak_tmp+="+"+ak_hhmmss(ak_animationArray[ak_timelineArray[index][1]][5],"mm:ss")
if(ak_animationArray[ak_timelineArray[index][1]][6]) ak_tmp+=";"+ak_animationArray[ak_timelineArray[index][1]][6]
}
else if(typeof(ak_animationArray[ak_timelineArray[index][1]][5])=="number")
{
ak_tmp=ak_hhmmss(ak_animationArray[ak_timelineArray[index][1]][5],"mm:ss")
if(ak_animationArray[ak_timelineArray[index][1]][6]) ak_tmp+=";"+ak_animationArray[ak_timelineArray[index][1]][6]
}
ak_tmp_id1=prompt('Please Enter end!\n2.4=2.4s, 340ms, 2min, 1h, 1:20:23.3=h:min:sec, 2:23=min:sec',ak_tmp)
window.focus(ak_svgroot)
if(!ak_tmp_id1) return
ak_tmp_id1=ak_tmp_id1.replace(/^ +| +$/g,'')
if(!ak_tmp_id1) return
var ak_tmp2=ak_tmp_id1, ak_tmp3, ak_tmp_i=ak_timelineArray[index][1]
if(/;/.test(ak_tmp2))
{
ak_tmp2=ak_tmp2.split(";")
ak_tmp3=ak_tmp2[0]
ak_tmp2.shift()
ak_animationArray[ak_tmp_i][6]=ak_tmp2.join(";")
if(/\+/.test(ak_tmp3))
{
ak_tmp3=ak_tmp3.split("+")
ak_animationArray[ak_tmp_i][5]=ak_checkTime(ak_tmp3[ak_tmp3.length-1])
ak_tmp3.pop()
ak_animationArray[ak_tmp_i][4]=ak_tmp3.join("+")
if(isNaN(ak_animationArray[ak_tmp_i][5]))
{
ak_animationArray[ak_tmp_i][4]+="+"+ak_animationArray[ak_tmp_i][5]
ak_animationArray[ak_tmp_i][5]=""
}
}
else
{
ak_animationArray[ak_tmp_i][4]=""
ak_animationArray[ak_tmp_i][5]=ak_checkTime(ak_tmp3)
if(isNaN(ak_animationArray[ak_tmp_i][5]))
{
ak_animationArray[ak_tmp_i][4]=ak_animationArray[ak_tmp_i][5]
ak_animationArray[ak_tmp_i][5]=""
}
}
}
else
{
ak_animationArray[ak_tmp_i][6]=""
ak_tmp3=ak_tmp2
if(/\+/.test(ak_tmp3))
{
ak_tmp3=ak_tmp3.split("+")
ak_animationArray[ak_tmp_i][5]=ak_checkTime(ak_tmp3[ak_tmp3.length-1])
ak_tmp3.pop()
ak_animationArray[ak_tmp_i][4]=ak_tmp3.join("+")
if(isNaN(ak_animationArray[ak_tmp_i][5]))
{
ak_animationArray[ak_tmp_i][4]+="+"+ak_animationArray[ak_tmp_i][5]
ak_animationArray[ak_tmp_i][5]=""
}
}
else
{
ak_animationArray[ak_tmp_i][4]=""
ak_animationArray[ak_tmp_i][5]=ak_checkTime(ak_tmp3)
if(isNaN(ak_animationArray[ak_tmp_i][5]))
{
ak_animationArray[ak_tmp_i][4]=ak_animationArray[ak_tmp_i][5]
ak_animationArray[ak_tmp_i][5]=""
}
}
}
if(ak_animationArray[ak_tmp_i][4]) ak_animationArray[ak_tmp_i][4]=ak_animationArray[ak_tmp_i][4].replace(/^ +| +$/g,'')
if(ak_timelineArray[index][2])
{// wenn ak_multi_
for(var i=0;i<ak_animationArray.length;i++)
{
if(i!=ak_timelineArray[index][1] && ak_animationArray[i][10].search(ak_timelineArray[index][0])==0)
{
ak_animationArray[i][4]=ak_animationArray[ak_timelineArray[index][1]][4]
ak_animationArray[i][5]=ak_animationArray[ak_timelineArray[index][1]][5]
ak_animationArray[i][6]=ak_animationArray[ak_timelineArray[index][1]][6]
}
}
}
ak_timeline_aniArray(evt,"no_new_array")
ak_draw_animations(evt)
break
case "enterBegin":
ak_tmp=ak_animationArray[ak_timelineArray[index][1]][1]
if(ak_tmp)
{
if(ak_animationArray[ak_timelineArray[index][1]][2]) ak_tmp+="+"+ak_hhmmss(ak_animationArray[ak_timelineArray[index][1]][2],"mm:ss")
if(ak_animationArray[ak_timelineArray[index][1]][3]) ak_tmp+=";"+ak_animationArray[ak_timelineArray[index][1]][3]
}
else if(typeof(ak_animationArray[ak_timelineArray[index][1]][2])=="number")
{
ak_tmp=ak_hhmmss(ak_animationArray[ak_timelineArray[index][1]][2],"mm:ss")
if(ak_animationArray[ak_timelineArray[index][1]][3]) ak_tmp+=";"+ak_animationArray[ak_timelineArray[index][1]][3]
}
ak_tmp_id1=prompt('Please Enter begin!\n2.4=2.4s, 340ms, 2min, 1h, 1:20:23.3=h:min:sec, 2:23=min:sec',ak_tmp)
window.focus(ak_svgroot)
if(!ak_tmp_id1) return
ak_tmp_id1=ak_tmp_id1.replace(/^ +| +$/g,'')
if(!ak_tmp_id1) return
var ak_tmp2=ak_tmp_id1, ak_tmp3, ak_tmp_i=ak_timelineArray[index][1]
if(/;/.test(ak_tmp2))
{
ak_tmp2=ak_tmp2.split(";")
ak_tmp3=ak_tmp2[0]
ak_tmp2.shift()
ak_animationArray[ak_tmp_i][3]=ak_tmp2.join(";")
if(/\+/.test(ak_tmp3))
{
ak_tmp3=ak_tmp3.split("+")
ak_animationArray[ak_tmp_i][2]=ak_checkTime(ak_tmp3[ak_tmp3.length-1])
ak_tmp3.pop()
ak_animationArray[ak_tmp_i][1]=ak_tmp3.join("+")
if(isNaN(ak_animationArray[ak_tmp_i][2]))
{
ak_animationArray[ak_tmp_i][1]+="+"+ak_animationArray[ak_tmp_i][2]
ak_animationArray[ak_tmp_i][2]=""
}
}
else
{
ak_animationArray[ak_tmp_i][1]=""
ak_animationArray[ak_tmp_i][2]=ak_checkTime(ak_tmp3)
if(isNaN(ak_animationArray[ak_tmp_i][2]))
{
ak_animationArray[ak_tmp_i][1]=ak_animationArray[ak_tmp_i][2]
ak_animationArray[ak_tmp_i][2]=""
}
}
}
else
{
ak_animationArray[ak_tmp_i][3]=""
ak_tmp3=ak_tmp2
if(/\+/.test(ak_tmp3))
{
ak_tmp3=ak_tmp3.split("+")
ak_animationArray[ak_tmp_i][2]=ak_checkTime(ak_tmp3[ak_tmp3.length-1])
ak_tmp3.pop()
ak_animationArray[ak_tmp_i][1]=ak_tmp3.join("+")
if(isNaN(ak_animationArray[ak_tmp_i][2]))
{
ak_animationArray[ak_tmp_i][1]+="+"+ak_animationArray[ak_tmp_i][2]
ak_animationArray[ak_tmp_i][2]=""
}
}
else
{
ak_animationArray[ak_tmp_i][1]=""
ak_animationArray[ak_tmp_i][2]=ak_checkTime(ak_tmp3)
if(isNaN(ak_animationArray[ak_tmp_i][2]))
{
ak_animationArray[ak_tmp_i][1]=ak_animationArray[ak_tmp_i][2]
ak_animationArray[ak_tmp_i][2]=""
}
}
}
if(ak_animationArray[ak_tmp_i][1]) ak_animationArray[ak_tmp_i][1]=ak_animationArray[ak_tmp_i][1].replace(/^ +| +$/g,'')
if(ak_timelineArray[index][2])
{// wenn ak_multi_
for(var i=0;i<ak_animationArray.length;i++)
{
if(i!=ak_timelineArray[index][1] && ak_animationArray[i][10].search(ak_timelineArray[index][0])==0)
{
ak_animationArray[i][1]=ak_animationArray[ak_timelineArray[index][1]][1]
ak_animationArray[i][2]=ak_animationArray[ak_timelineArray[index][1]][2]
ak_animationArray[i][3]=ak_animationArray[ak_timelineArray[index][1]][3]
}
}
}
ak_timeline_aniArray(evt,"no_new_array")
ak_draw_animations(evt)
break
case "id":
if(ak_timelineArray[index][2])
{// wenn ak_multi_
ak_tmp_id1=prompt('Please Enter "ak_multi_..." Id!',ak_timelineArray[index][0].replace(/^ak_multi_|_$/g,""))
window.focus(ak_svgroot)
if(!ak_tmp_id1) return
ak_tmp_id1=ak_tmp_id1.replace(/^ak_multi_/,'')
ak_tmp_id1=ak_tmp_id1.replace(/[^A-Za-z\d]/g,'')
if(!ak_tmp_id1) return
ak_tmp_id1="ak_multi_"+ak_tmp_id1+"_"
do
{
ak_tmp=false
for(var i=0;i<ak_animationArray.length;i++)
{
if(ak_animationArray[i][10].search(ak_tmp_id1)==0)
{
ak_tmp=true
break
}
}
if(ak_tmp)
{
ak_tmp_id1=prompt('"'+ak_tmp_id1+'..." already exists, please enter "ak_multi_..." Id!',ak_tmp_id1.replace(/^ak_multi_|_$/g,""))
window.focus(ak_svgroot)
if(!ak_tmp_id1) return
ak_tmp_id1=ak_tmp_id1.replace(/^ak_multi_/,'')
ak_tmp_id1=ak_tmp_id1.replace(/[^A-Za-z\d]/g,'')
if(!ak_tmp_id1) return
ak_tmp_id1="ak_multi_"+ak_tmp_id1+"_"
}
}
while(ak_tmp)
for(var i=0;i<ak_animationArray.length;i++)
{
if(ak_animationArray[i][10].search(ak_timelineArray[index][0])==0)
{
ak_animationArray[i][10]=ak_animationArray[i][10].replace(ak_timelineArray[index][0],ak_tmp_id1)
if(ak_animationArray[i][0].tagName=='animateTransform')
{
var ak_tmp_object2=ak_get_multiAttribute(ak_animationArray[i][0].parentNode,ak_animationArray[i][0].getId())
if(ak_tmp_object2)
{
ak_tmp_id2=ak_tmp_object2.getAttribute('ak_multi')
ak_tmp_id2=ak_tmp_id2.split(';')
for(var iB=0;iB<ak_tmp_id2.length;iB++)
{
if(ak_tmp_id2[iB]==ak_animationArray[i][0].getId()) {ak_tmp_id2[iB]=ak_animationArray[i][10];break}
}
ak_tmp_object2.setAttribute('ak_multi',ak_tmp_id2.join(';'))
}
}
ak_animationArray[i][0].setAttribute(action,ak_animationArray[i][10])
}
if(ak_animationArray[i][1].search(ak_timelineArray[index][0])==0) ak_animationArray[i][1]=ak_animationArray[i][1].replace(ak_timelineArray[index][0],ak_tmp_id1)
if(ak_animationArray[i][4].search(ak_timelineArray[index][0])==0) ak_animationArray[i][4]=ak_animationArray[i][4].replace(ak_timelineArray[index][0],ak_tmp_id1)
}
ak_timelineArray[index][0]=ak_tmp_id1
}
else
{
ak_tmp_id1=ak_animationArray[ak_timelineArray[index][1]][10]
ak_tmp='Please Enter Id!'
do
{
ak_tmp_id1=prompt(ak_tmp,ak_tmp_id1)
window.focus(ak_svgroot)
if(!ak_tmp_id1) return
ak_tmp_id1=ak_tmp_id1.replace(/^ak_multi_/,'')
ak_tmp_id1=ak_tmp_id1.replace(/[^A-Za-z\d_]/g,'')
if(!ak_tmp_id1) return
if(!document.getElementById(ak_tmp_id1))
{
ak_tmp=ak_animationArray[ak_timelineArray[index][1]][10]+"."
ak_timelineArray[index][0]=ak_tmp_id1
ak_animationArray[ak_timelineArray[index][1]][0].setAttribute(action,ak_tmp_id1)
ak_animationArray[ak_timelineArray[index][1]][10]=ak_tmp_id1
ak_tmp_id1+="."
if(ak_tmp!=".")
{
for(var i=0;i<ak_animationArray.length;i++)
{
if(ak_animationArray[i][1].search(ak_tmp)==0) ak_animationArray[i][1]=ak_animationArray[i][1].replace(ak_tmp,ak_tmp_id1)
if(ak_animationArray[i][4].search(ak_tmp)==0) ak_animationArray[i][4]=ak_animationArray[i][4].replace(ak_tmp,ak_tmp_id1)
}
}
ak_tmp=false
}
else ak_tmp='"'+ak_tmp_id1+'" already exists, please enter Id!'
}
while(ak_tmp)
}
//ak_timeline_aniArray(evt,"no_new_array")
ak_draw_animations(evt)
//return // no undo for change id
break
}
if(typeof(index)=="number" && action!="id")
{
ak_tmp=ak_timeUndo.length
ak_timeUndo[ak_tmp]=new Array
ak_timeUndo[ak_tmp][0]=index
for(var i=1;i<ak_animationArray[0].length;i++){ak_timeUndo[ak_tmp][i]=ak_animationArray[ak_timelineArray[index][1]][i]}
if(ak_timeUndo[ak_tmp].join()!=ak_objectIn.join())
{
ak_timeRedo=new Array
for(var i=1;i<ak_objectIn.length;i++){ak_timeUndo[ak_tmp][i]=ak_objectIn[i]}
}
else ak_timeUndo.pop()
}
}
// #################################
function ak_hhmmss(number,hms)
{
if(hms=="durSlider" && number=="indefinite") return "indef.."
if(isNaN(number)) return number
number=ak_round(number,1000)
var ak_tmp="", ak_tmp_h, ak_tmp_m, ak_tmp_s
if(hms=="hh:mm:ss")
{
ak_tmp_h=Math.floor(number/3600)
ak_tmp_m=Math.floor((number-(ak_tmp_h*3600))/60)
ak_tmp_s=ak_round(number-(ak_tmp_h*3600)-(ak_tmp_m*60),1000)
ak_tmp=ak_tmp_h+":"
if(ak_tmp_m<10) ak_tmp+="0"+ak_tmp_m+":"
else ak_tmp+=ak_tmp_m+":"
if(ak_tmp_s<10) ak_tmp+="0"+ak_tmp_s
else ak_tmp+=ak_tmp_s
}
else if(hms=="mm:ss")
{
ak_tmp_h=Math.floor(number/3600)
ak_tmp_m=Math.floor((number-(ak_tmp_h*3600))/60)
ak_tmp_s=ak_round(number-(ak_tmp_h*3600)-(ak_tmp_m*60),1000)
if(ak_tmp_h) ak_tmp=ak_tmp_h+":"
if(ak_tmp && ak_tmp_m<10) ak_tmp+="0"+ak_tmp_m+":"
else if(ak_tmp_m) ak_tmp+=ak_tmp_m+":"
if(ak_tmp && ak_tmp_s<10) ak_tmp+="0"+ak_tmp_s
else ak_tmp+=ak_tmp_s
}
else if(hms=="durSlider")
{
if(number==2) return "dur 2s"
if(number<60)
{
ak_tmp_s=ak_round(number,1000)
ak_tmp=ak_tmp_s
if(ak_tmp_s==Math.floor(ak_tmp_s)) ak_tmp+=".000"
else if((ak_tmp_s*10)==Math.floor(ak_tmp_s*10)) ak_tmp+="00"
else if((ak_tmp_s*100)==Math.floor(ak_tmp_s*100)) ak_tmp+="0"
return ak_tmp
}
else number=Math.floor(number)
ak_tmp_h=Math.floor(number/3600)
ak_tmp_m=Math.floor((number-(ak_tmp_h*3600))/60)
ak_tmp_s=ak_round(number-(ak_tmp_h*3600)-(ak_tmp_m*60),1000)
if(ak_tmp_h) ak_tmp=ak_tmp_h+":"
if(ak_tmp && ak_tmp_m<10) ak_tmp+="0"+ak_tmp_m+":"
else if(ak_tmp_m) ak_tmp+=ak_tmp_m+":"
if(ak_tmp && ak_tmp_s<10) ak_tmp+="0"+ak_tmp_s
else ak_tmp+=ak_tmp_s
}
else
{
ak_tmp_h=Math.floor(number/3600)
ak_tmp_m=Math.floor((number-(ak_tmp_h*3600))/60)
ak_tmp_s=ak_round(number-(ak_tmp_h*3600)-(ak_tmp_m*60),1000)
ak_tmp=ak_tmp_h+":"
if(ak_tmp_m<10) ak_tmp+="0"+ak_tmp_m+":"
else ak_tmp+=ak_tmp_m+":"
if(ak_tmp_s<10) ak_tmp+="0"+ak_tmp_s
else ak_tmp+=ak_tmp_s
if(number<60) ak_tmp=number
}
return ak_tmp
}
// #################################
var ak_playTrue=false
function ak_timeMain(evt,action,value1,value2)
{
var ak_tmp_x=ak_mouse_x, ak_tmp, ak_tmp2
switch(action)
{
case "Stretch":
ak_tmp_x-=ak_timeline_left
if(ak_tmp_x<0) ak_tmp_x=0
var ak_tmp_x2=ak_tmp_x
ak_tmp_x*=ak_timeline_scale[ak_timeline_scale_index]
ak_tmp_x+=ak_timeline_begin
ak_timeline_scale_index--
if(ak_timeline_scale_index<0) ak_timeline_scale_index=0
ak_tmp_x2*=ak_timeline_scale[ak_timeline_scale_index]
ak_timeline_begin=ak_tmp_x-ak_tmp_x2
ak_draw_timescale(evt)
ak_draw_animations(evt)
break
case "Shrink":
ak_tmp_x-=ak_timeline_left
if(ak_tmp_x<0) ak_tmp_x=0
var ak_tmp_x2=ak_tmp_x
ak_tmp_x*=ak_timeline_scale[ak_timeline_scale_index]
ak_tmp_x+=ak_timeline_begin
ak_timeline_scale_index++
if(ak_timeline_scale_index>=ak_timeline_scale.length) ak_timeline_scale_index=ak_timeline_scale.length-1
ak_tmp_x2*=ak_timeline_scale[ak_timeline_scale_index]
ak_timeline_begin=ak_tmp_x-ak_tmp_x2
ak_draw_timescale(evt)
ak_draw_animations(evt)
break
case "ShowComplete":
ak_timeline_scale_index=ak_timeline_scale_init
if(ak_timeline_scale_index>=ak_timeline_scale.length) ak_timeline_scale_index=ak_timeline_scale.length-1
ak_timeline_begin=0
var ak_tmp=ak_timeEnd/600
if(ak_timeline_scale[ak_timeline_scale_index]<ak_tmp)
{
for(ak_timeline_scale_index=0;ak_timeline_scale_index<ak_timeline_scale.length;ak_timeline_scale_index++)
{
if(ak_timeline_scale[ak_timeline_scale_index]>ak_tmp) break
}
if(ak_timeline_scale_index>=ak_timeline_scale.length) ak_timeline_scale_index=ak_timeline_scale.length-1
}
ak_draw_timescale(evt)
ak_draw_animations(evt)
break
case "Start0":
ak_svgroot.setCurrentTime(0)
case "Play":
var ak_tmpBegin=0
var ak_tmpDur=((ak_screen_width)*ak_timeline_res)
if(ak_timeline_begin>(2*ak_timeline_res)) ak_tmpBegin=ak_timeline_begin-(2*ak_timeline_res)
var ak_tmpValue='0,0;'+(ak_screen_width)+',0'
var ak_tmp=document.getElementById('ak_aniPauseAnimation')
ak_tmp.setAttribute('begin',ak_tmpBegin)
ak_tmp.setAttribute('dur',ak_tmpDur)
ak_tmp.setAttribute('values',ak_tmpValue)
var ak_tmpNew=parseXML(printNode(ak_tmp.parentNode),document).firstChild
ak_tmp.parentNode.parentNode.replaceChild(ak_tmpNew,ak_tmp.parentNode)
ak_tPause.setAttribute("visibility","hidden")
ak_tmpNew.setAttribute("visibility","")
ak_svgroot.unpauseAnimations()
ak_playTrue=true
break
case "Pause":
ak_svgroot.pauseAnimations()
document.getElementById('ak_aniPauseVisible').setAttribute("visibility","hidden")
var ak_tmp=document.getElementById('ak_aniPauseAnimation')
ak_tmp.setAttribute('begin',"indefinite")
ak_tmp.setAttribute('dur',0)
var ak_tmpNew=parseXML(printNode(ak_tmp.parentNode),document).firstChild
ak_tmp.parentNode.parentNode.replaceChild(ak_tmpNew,ak_tmp.parentNode)
ak_timeline_pause=ak_svgroot.getCurrentTime()
ak_tPause.setAttribute("x1",(ak_timeline_pause/ak_timeline_res))
ak_tPause.setAttribute("x2",(ak_timeline_pause/ak_timeline_res))
ak_tPause.setAttribute("visibility","")
ak_playTrue=false
//ak_svgroot.setCurrentTime(ak_timeline_pause+1)
ak_svgroot.setCurrentTime(ak_timeline_pause)
// refresh
ak_backTop.setAttribute("style","fill:#9eafbf;stroke:none")
ak_backLeft.setAttribute("style","fill:#9eafbf;stroke:none")
ak_backRight.setAttribute("style","fill:#9eafbf;stroke:none")
break
case "Inpoint":
ak_timeline_pause=ak_timeInpoint
ak_svgroot.setCurrentTime(ak_timeline_pause)
ak_tPause.setAttribute("x1",(ak_timeline_pause/ak_timeline_res))
ak_tPause.setAttribute("x2",(ak_timeline_pause/ak_timeline_res))
ak_tPause.setAttribute("visibility","")
var ak_tmpEnd=((window.innerWidth-ak_timeline_left)*ak_timeline_res)+ak_timeline_begin
if(ak_timeline_begin>ak_timeline_pause || ak_tmpEnd<ak_timeline_pause)
{
ak_timeline_begin=ak_timeline_pause-(100*ak_timeline_res)
if(ak_timeline_begin<0) ak_timeline_begin=0
ak_draw_animations(evt)
}
break
case "SetInpoint":
ak_timeInpoint=ak_timeline_pause
if(ak_timeOutpoint!=-1 && ak_timeOutpoint<ak_timeInpoint) ak_timeOutpoint=ak_timeInpoint
var ak_tmpEnd=((window.innerWidth-ak_timeline_left)*ak_timeline_res)+ak_timeline_begin
if(ak_timeline_begin>ak_timeline_pause || ak_tmpEnd<ak_timeline_pause)
{
ak_timeline_begin=ak_timeline_pause-(100*ak_timeline_res)
if(ak_timeline_begin<0) ak_timeline_begin=0
}
ak_draw_animations(evt)
break
case "Outpoint":
if(ak_timeOutpoint==-1 && ak_timeEnd>=ak_timeInpoint) {ak_timeline_pause=ak_timeEnd}
else if(ak_timeOutpoint>ak_timeInpoint) {ak_timeline_pause=ak_timeOutpoint}
else {ak_timeline_pause=ak_timeInpoint}
ak_svgroot.setCurrentTime(ak_timeline_pause)
ak_tPause.setAttribute("x1",(ak_timeline_pause/ak_timeline_res))
ak_tPause.setAttribute("x2",(ak_timeline_pause/ak_timeline_res))
ak_tPause.setAttribute("visibility","")
var ak_tmpEnd=((window.innerWidth-ak_timeline_left)*ak_timeline_res)+ak_timeline_begin
if(ak_timeline_begin>ak_timeline_pause)
{
ak_timeline_begin=ak_timeline_pause-(100*ak_timeline_res)
if(ak_timeline_begin<0) ak_timeline_begin=0
ak_draw_animations(evt)
}
else if(ak_tmpEnd<ak_timeline_pause)
{
var ak_tmp_delta=ak_tmpEnd-ak_timeline_begin
if((window.innerWidth-ak_timeline_left)>50) ak_timeline_begin=(ak_timeline_pause+(25*ak_timeline_res))-ak_tmp_delta
else  ak_timeline_begin=(ak_timeline_pause+(((window.innerWidth-ak_timeline_left)/2)*ak_timeline_res))-ak_tmp_delta
if(ak_timeline_begin<0) ak_timeline_begin=0
ak_draw_animations(evt)
}
break
case "SetOutpoint":
ak_timeOutpoint=ak_timeline_pause
if(ak_timeOutpoint<ak_timeInpoint) ak_timeInpoint=ak_timeOutpoint
var ak_tmpEnd=((window.innerWidth-ak_timeline_left)*ak_timeline_res)+ak_timeline_begin
if(ak_timeline_begin>ak_timeline_pause)
{
ak_timeline_begin=ak_timeline_pause-(100*ak_timeline_res)
if(ak_timeline_begin<0) ak_timeline_begin=0
}
else if(ak_tmpEnd<ak_timeline_pause)
{
var ak_tmp_delta=ak_tmpEnd-ak_timeline_begin
if((window.innerWidth-ak_timeline_left)>50) ak_timeline_begin=(ak_timeline_pause+(25*ak_timeline_res))-ak_tmp_delta
else  ak_timeline_begin=(ak_timeline_pause+(((window.innerWidth-ak_timeline_left)/2)*ak_timeline_res))-ak_tmp_delta
if(ak_timeline_begin<0) ak_timeline_begin=0
}
ak_draw_animations(evt)
break
case "SetEnd":
ak_timeOutpoint=-1
ak_timeline_pause=ak_timeEnd
var ak_tmpEnd=((window.innerWidth-ak_timeline_left)*ak_timeline_res)+ak_timeline_begin
if(ak_timeline_begin>ak_timeline_pause)
{
ak_timeline_begin=ak_timeline_pause-(100*ak_timeline_res)
if(ak_timeline_begin<0) ak_timeline_begin=0
}
else if(ak_tmpEnd<ak_timeline_pause)
{
var ak_tmp_delta=ak_tmpEnd-ak_timeline_begin
if((window.innerWidth-ak_timeline_left)>50) ak_timeline_begin=(ak_timeline_pause+(25*ak_timeline_res))-ak_tmp_delta
else  ak_timeline_begin=(ak_timeline_pause+(((window.innerWidth-ak_timeline_left)/2)*ak_timeline_res))-ak_tmp_delta
if(ak_timeline_begin<0) ak_timeline_begin=0
}
ak_draw_animations(evt)
break
case "0point":
ak_timeline_pause=0
ak_svgroot.setCurrentTime(ak_timeline_pause)
ak_tPause.setAttribute("x1",(ak_timeline_pause/ak_timeline_res))
ak_tPause.setAttribute("x2",(ak_timeline_pause/ak_timeline_res))
ak_tPause.setAttribute("visibility","")
if(ak_timeline_begin>0)
{
ak_timeline_begin=0
ak_draw_animations(evt)
}
break
case "enterInpoint":
var ak_tmp3=Math.round(Math.floor(ak_timeInpoint)*ak_fps)
ak_tmp2=Math.round(ak_timeInpoint*ak_fps)-ak_tmp3
ak_tmp=0
if(ak_timeInpoint<ak_timeOutpoint) ak_tmp=Math.round((ak_timeOutpoint-ak_timeInpoint)*ak_fps)
else if(ak_timeOutpoint==-1)
{
ak_tmp=Math.round((ak_timeEnd-ak_timeInpoint)*ak_fps)
if(ak_tmp<0) ak_tmp=0
}
if(ak_tmp==0) ak_tmp=1
ak_tmp=ak_hhmmss(Math.floor(ak_timeInpoint),"hh:mm:ss")+"."+ak_tmp2+"f "+"+"+ak_tmp+"f"
while(true)
{
ak_tmp=prompt("Enter Inpoint Outpoint (e.g. +34f = Inpoint + 34 frames)!\n"+ak_fps+"fps | 2.4=2.4s, 340ms, 2min, 1h, 1:20:23.3=h:min:sec, 2:23=min:sec",ak_tmp)
if(!ak_tmp) return
ak_tmp=ak_tmp.toLowerCase()
ak_tmp=ak_tmp.replace(/ +/g," ")
if(!ak_tmp) return
if(/ /.test(ak_tmp)) ak_tmp=ak_tmp.split(" ")
else ak_tmp=new Array(ak_tmp)
if(ak_tmp.length==1 && /^\+/.test(ak_tmp[0])) ak_tmp.unshift(ak_timeInpoint+"s")
if(/f$/.test(ak_tmp[0]))
{
ak_tmp3=ak_tmp[0].replace(/f$/,"")
if(/\./.test(ak_tmp3))
{
ak_tmp3=ak_tmp3.split(".")
ak_tmp3[0]=ak_checkTime(ak_tmp3[0])
ak_tmp3[1]=parseInt(ak_tmp3[1])
if(isNaN(ak_tmp3[0]) || isNaN(ak_tmp3[1])) ak_tmp3="NaN"
else if(ak_tmp3[1]>ak_fps) ak_tmp3=ak_tmp3[0]+1
else
{
ak_tmp3=ak_tmp3[0]+(ak_tmp3[1]/ak_fps)
}
}
else
{
ak_tmp3=ak_checkTime(ak_tmp3)
if(!isNaN(ak_tmp3)) ak_tmp3/=ak_fps
}
}
else ak_tmp3=ak_checkTime(ak_tmp[0])

var ak_tmpFlag=false
if(ak_tmp[1] && /^\+/.test(ak_tmp[1])) ak_tmpFlag=true
if(ak_tmp[1]=="-1") ak_tmp2=-1
else if(ak_tmp[1] && /f$/.test(ak_tmp[1]))
{
ak_tmp2=ak_tmp[1].replace(/f$/,"")
if(/\./.test(ak_tmp2))
{
ak_tmp2=ak_tmp2.split(".")
ak_tmp2[0]=ak_checkTime(ak_tmp2[0])
ak_tmp2[1]=parseInt(ak_tmp2[1])
if(isNaN(ak_tmp2[0]) || isNaN(ak_tmp2[1])) ak_tmp2="NaN"
else if(ak_tmp2[1]>ak_fps) ak_tmp2=ak_tmp2[0]+1
else
{
ak_tmp2=ak_tmp2[0]+(ak_tmp2[1]/ak_fps)
}
}
else
{
ak_tmp2=ak_checkTime(ak_tmp2)
if(!isNaN(ak_tmp2)) ak_tmp2/=ak_fps
}
}
else if(ak_tmp[1]) ak_tmp2=ak_checkTime(ak_tmp[1])
else if(!isNaN(ak_tmp3)) ak_tmp2=ak_timeOutpoint
if(!isNaN(ak_tmp2) && !isNaN(ak_tmp3))
{
ak_timeInpoint=Math.floor(ak_tmp3*ak_fps)/ak_fps
if(ak_tmpFlag && ak_tmp2!=-1) ak_timeOutpoint=Math.ceil((ak_timeInpoint+ak_tmp2)*ak_fps)/ak_fps
else if(ak_tmp2==-1) ak_timeOutpoint=-1
else if(ak_tmp2<ak_tmp3) ak_timeOutpoint=ak_timeInpoint
else ak_timeOutpoint=Math.ceil(ak_tmp2*ak_fps)/ak_fps
break
}
else
{
if(ak_tmp[1]) ak_tmp=ak_tmp[0]+" "+ak_tmp[1]
else ak_tmp=ak_tmp[0]
}
}
ak_draw_animations(evt)
break
case "fpsEnter":
ak_tmp=ak_fps
while(true)
{
ak_tmp=prompt("Please Enter frames per second (fps 1 - 250)!",ak_tmp)
if(!ak_tmp) return
ak_tmp=parseFloat(ak_tmp)
if(!isNaN(ak_tmp))
{
if(ak_tmp>=1 && ak_tmp<=250) break
}
else ak_tmp="Enter Number!"
}
value1=ak_tmp
case "fps":
if(value2) ak_progressive=value2
if(value1)
{
ak_fps=value1
ak_timeInpoint=Math.floor(ak_timeInpoint*ak_fps)/ak_fps
if(ak_timeOutpoint!=-1)
{
ak_timeOutpoint=Math.ceil(ak_timeOutpoint*ak_fps)/ak_fps
if(ak_timeOutpoint<ak_timeInpoint) ak_timeOutpoint=ak_timeInpoint
}
ak_draw_timescale(evt)
ak_draw_animations(evt)
}
break
case "undo":
if(ak_timeUndo.length<1) return
ak_tmp=ak_timeUndo.length-1
if(ak_tmp<ak_timeUndoClean) ak_timeUndoClean=-1
ak_tmp2=ak_timeRedo.length
ak_timeRedo[ak_tmp2]=new Array
ak_timeRedo[ak_tmp2][0]=ak_timeUndo[ak_tmp][0]
if(ak_timeUndo[ak_tmp][0]=="svg")
{
ak_timeRedo[ak_tmp2][1]=ak_userspace_svg.getAttribute("width")
ak_timeRedo[ak_tmp2][2]=ak_userspace_svg.getAttribute("height")
ak_timeRedo[ak_tmp2][3]=ak_userspace_svg.getAttribute("viewBox")
ak_userspace_svg.setAttribute("width",ak_timeUndo[ak_tmp][1])
ak_userspace_svg.setAttribute("height",ak_timeUndo[ak_tmp][2])
if(ak_timeUndo[ak_tmp][3]) ak_userspace_svg.setAttribute("viewBox",ak_timeUndo[ak_tmp][3])
else try{ak_userspace_svg.removeAttribute("viewBox")}catch(err){}
}
else
{
var ak_tmpi=ak_timeUndo[ak_tmp][0]
var ak_tmpIdOld=ak_animationArray[ak_timelineArray[ak_tmpi][1]][10]
for(var i=1;i<ak_animationArray[ak_timelineArray[ak_tmpi][1]].length;i++){ak_timeRedo[ak_tmp2][i]=ak_animationArray[ak_timelineArray[ak_tmpi][1]][i]}
for(var i=1;i<ak_animationArray[ak_timelineArray[ak_tmpi][1]].length;i++){ak_animationArray[ak_timelineArray[ak_tmpi][1]][i]=ak_timeUndo[ak_tmp][i]}
var ak_tmpIdNew=ak_animationArray[ak_timelineArray[ak_tmpi][1]][10]
if(ak_tmpIdOld && ak_tmpIdNew && ak_tmpIdOld!=ak_tmpIdNew)
{
ak_timeUndo.pop()
return
}
if(ak_timelineArray[ak_tmpi][2])
{// wenn ak_multi_
ak_tmpIdNew=ak_tmpIdNew.split("_")
ak_tmpIdNew="ak_multi_"+ak_tmpIdNew[2]+"_"
for(var i=0;i<ak_animationArray.length;i++)
{
if(i!=ak_timelineArray[ak_tmpi][1] && ak_animationArray[i][10].search(ak_timelineArray[ak_tmpi][0])==0)
{
for(var ib=1;ib<ak_timeUndo[ak_tmp].length;ib++)
{
if(ib<10) ak_animationArray[i][ib]=ak_timeUndo[ak_tmp][ib]
// keine Ids
}
//ak_animationArray[i][10]=ak_animationArray[i][10].replace(ak_timelineArray[ak_tmpi][0],ak_tmpIdNew)
}
if(ak_animationArray[i][1].search(ak_timelineArray[ak_tmpi][0])==0) ak_animationArray[i][1]=ak_animationArray[i][1].replace(ak_timelineArray[ak_tmpi][0],ak_tmpIdNew)
if(ak_animationArray[i][4].search(ak_timelineArray[ak_tmpi][0])==0) ak_animationArray[i][4]=ak_animationArray[i][4].replace(ak_timelineArray[ak_tmpi][0],ak_tmpIdNew)
}
}
/*else if(ak_tmpIdOld && ak_tmpIdNew && ak_tmpIdOld!=ak_tmpIdNew)
{// ak_tmpIdOld zur Sicherheit auf true pruefen
ak_tmpIdOld+="."
ak_tmpIdNew+="."
for(var i=0;i<ak_animationArray.length;i++)
{
if(ak_animationArray[i][1].search(ak_tmpIdOld)==0) ak_animationArray[i][1]=ak_animationArray[i][1].replace(ak_tmpIdOld,ak_tmpIdNew)
if(ak_animationArray[i][4].search(ak_tmpIdOld)==0) ak_animationArray[i][4]=ak_animationArray[i][4].replace(ak_tmpIdOld,ak_tmpIdNew)
}
}*/
ak_timeline_aniArray(evt,"no_new_array")
ak_draw_animations(evt)
}
ak_timeUndo.pop()
break
case "redo":
if(ak_timeRedo.length<1) return
ak_tmp=ak_timeUndo.length
ak_tmp2=ak_timeRedo.length-1
ak_timeUndo[ak_tmp]=new Array
ak_timeUndo[ak_tmp][0]=ak_timeRedo[ak_tmp2][0]
if(ak_timeRedo[ak_tmp2][0]=="svg")
{
ak_timeUndo[ak_tmp][1]=ak_userspace_svg.getAttribute("width")
ak_timeUndo[ak_tmp][2]=ak_userspace_svg.getAttribute("height")
ak_timeUndo[ak_tmp][3]=ak_userspace_svg.getAttribute("viewBox")
ak_userspace_svg.setAttribute("width",ak_timeRedo[ak_tmp2][1])
ak_userspace_svg.setAttribute("height",ak_timeRedo[ak_tmp2][2])
if(ak_timeRedo[ak_tmp2][3]) ak_userspace_svg.setAttribute("viewBox",ak_timeRedo[ak_tmp2][3])
else try{ak_userspace_svg.removeAttribute("viewBox")}catch(err){}
}
else
{
var ak_tmpi=ak_timeRedo[ak_tmp2][0]
var ak_tmpIdOld=ak_animationArray[ak_timelineArray[ak_tmpi][1]][10]
for(var i=1;i<ak_animationArray[ak_timelineArray[ak_tmpi][1]].length;i++){ak_timeUndo[ak_tmp][i]=ak_animationArray[ak_timelineArray[ak_tmpi][1]][i]}
for(var i=1;i<ak_animationArray[ak_timelineArray[ak_tmpi][1]].length;i++){ak_animationArray[ak_timelineArray[ak_tmpi][1]][i]=ak_timeRedo[ak_tmp2][i]}
var ak_tmpIdNew=ak_animationArray[ak_timelineArray[ak_tmpi][1]][10]
if(ak_timelineArray[ak_tmpi][2])
{// wenn ak_multi_
ak_tmpIdNew=ak_tmpIdNew.split("_")
ak_tmpIdNew="ak_multi_"+ak_tmpIdNew[2]+"_"
for(var i=0;i<ak_animationArray.length;i++)
{
if(i!=ak_timelineArray[ak_tmpi][1] && ak_animationArray[i][10].search(ak_timelineArray[ak_tmpi][0])==0)
{
for(var ib=1;ib<ak_timeRedo[ak_tmp2].length;ib++)
{
if(ib<10) ak_animationArray[i][ib]=ak_timeRedo[ak_tmp2][ib]
// keine Ids
}
//ak_animationArray[i][10]=ak_animationArray[i][10].replace(ak_timelineArray[ak_tmpi][0],ak_tmpIdNew)
}
if(ak_animationArray[i][1].search(ak_timelineArray[ak_tmpi][0])==0) ak_animationArray[i][1]=ak_animationArray[i][1].replace(ak_timelineArray[ak_tmpi][0],ak_tmpIdNew)
if(ak_animationArray[i][4].search(ak_timelineArray[ak_tmpi][0])==0) ak_animationArray[i][4]=ak_animationArray[i][4].replace(ak_timelineArray[ak_tmpi][0],ak_tmpIdNew)
}
}
/*else if(ak_tmpIdOld && ak_tmpIdNew && ak_tmpIdOld!=ak_tmpIdNew)
{// ak_tmpIdOld zur Sicherheit auf true pruefen
ak_tmpIdOld+="."
ak_tmpIdNew+="."
for(var i=0;i<ak_animationArray.length;i++)
{
if(ak_animationArray[i][1].search(ak_tmpIdOld)==0) ak_animationArray[i][1]=ak_animationArray[i][1].replace(ak_tmpIdOld,ak_tmpIdNew)
if(ak_animationArray[i][4].search(ak_tmpIdOld)==0) ak_animationArray[i][4]=ak_animationArray[i][4].replace(ak_tmpIdOld,ak_tmpIdNew)
}
}*/
ak_timeline_aniArray(evt,"no_new_array")
ak_draw_animations(evt)
}
ak_timeRedo.pop()
break
case 'timeVariable':
var ak_tmp_var=document.getElementById("ak_variable_timeline")
if(ak_tmp_var) ak_tmp=ak_tmp_var.firstChild.data
else ak_tmp=''
ak_tmp=ak_tmp.replace(/\r|\n/g,"") // whitespaces raus
if(ak_tmp.search(/\*/)==-1) ak_tmp=new Array(ak_tmp)
else ak_tmp=ak_tmp.split("*")
ak_tmp[0]=ak_fps
ak_tmp[1]=ak_progressive
ak_tmp[2]=ak_timeInpoint
ak_tmp[3]=ak_timeOutpoint
if(ak_exportFile)
{
ak_exportFile=ak_exportFile.split("*")
ak_tmp[4]=ak_exportFile[0]
ak_tmp[5]=ak_exportFile[1]
ak_exportFile=""
}
if(ak_tmp_var) ak_tmp_var.firstChild.data=ak_tmp.join("*")
break
case 'exportRaster0': var ak_tmpIn=ak_timeInpoint;ak_timeInpoint=0
case 'exportRaster':
case 'export':
if(ak_timeUndo.length!=ak_timeUndoClean)
{
var ak_tmp_confirm=confirm("Data-Changes not saved!\nDo you want to continue with 'Export indexed ...'?")
if(!ak_tmp_confirm) return
}
var ak_tmp_inTmp=ak_timeInpoint
if(action=='exportRaster') ak_timeInpoint=Math.round(ak_timeline_pause*ak_fps)/ak_fps
var ak_tmp_var=document.getElementById("ak_variable_timeline")
if(ak_tmp_var) ak_tmp=ak_tmp_var.firstChild.data
else ak_tmp=''
ak_tmp=ak_tmp.replace(/\r|\n/g,"") // whitespaces raus
if(ak_tmp.search(/\*/)==-1) ak_tmp=new Array(ak_tmp)
else ak_tmp=ak_tmp.split("*")
if(!ak_tmp[4]) ak_tmp[4]=ak_directory
if(!ak_tmp[5])
{
if(ak_timeEnd>ak_timeOutpoint) ak_tmp[5]=ak_file.replace(/(\.svg)$/,"_"+Math.ceil(ak_timeEnd*ak_fps)+".png")
else ak_tmp[5]=ak_file.replace(/(\.svg)$/,"_"+Math.ceil(ak_timeOutpoint*ak_fps)+".png")
}
var ak_tmpExt=".png"
if(/\.bmp$/.test(ak_tmp[5].toLowerCase()))
{
ak_tmpExt=".bmp"
ak_tmp[5]=ak_tmp[5].substring(0,ak_tmp[5].length-4)
}
else if(/\.jpg$/.test(ak_tmp[5].toLowerCase()))
{
ak_tmpExt=".jpg"
ak_tmp[5]=ak_tmp[5].substring(0,ak_tmp[5].length-4)
}
else if(/\.tif$/.test(ak_tmp[5].toLowerCase()))
{
ak_tmpExt=".tif"
ak_tmp[5]=ak_tmp[5].substring(0,ak_tmp[5].length-4)
}
else if(/\....$/.test(ak_tmp[5]))
{
ak_tmp[5]=ak_tmp[5].substring(0,ak_tmp[5].length-4)
}
var ak_tmpDigits=ak_tmp[5].replace(/\d+$/,"")
ak_tmpDigits=ak_tmp[5].substring(ak_tmpDigits.length)
ak_tmp[5]=ak_tmp[5].replace(/\d+$/,"")
var ak_tmpCheck=ak_timeEnd
if(ak_timeOutpoint>ak_timeEnd) ak_tmpCheck=ak_timeOutpoint
ak_tmpCheck=Math.ceil(ak_tmpCheck*ak_fps)
if(((ak_tmpCheck+" ").length-1)<ak_tmpDigits.length) ak_tmpCheck=ak_tmpDigits
ak_tmpDigits=Math.round(ak_timeInpoint*ak_fps)
ak_exportFrames=ak_tmpDigits+"*"+value1
while((ak_tmpDigits+" ").length-1<(ak_tmpCheck+" ").length-1){ak_tmpDigits="0"+ak_tmpDigits}
var ak_tmpProg=ak_progressive
if(action=="exportRaster0") ak_tmpProg="progressive"
ak_exportFrames=ak_fps+"*"+ak_tmpProg+"*"+ak_exportFrames+"*"+ak_tmp[4]+"*"+ak_tmp[5]+ak_tmpDigits+ak_tmpExt
ak_tmp=ak_userspace_svg.getAttribute("width")
if(!ak_tmp) ak_tmp="-1000"
else if(/%$/.test(ak_tmp))
{
ak_tmp=Math.round(parseFloat(ak_tmp.replace(/%$/,""))*-10)
if(isNaN(ak_tmp) || ak_tmp>=0) ak_tmp="-1000"
}
else
{
ak_tmp=Math.round(ak_getAbsolutePixel(ak_tmp,"width",window.innerWidth,window.innerHeight))
if(!ak_tmp) ak_tmp="-1000"
}
ak_exportFrames+="*"+ak_tmp
ak_tmp=ak_userspace_svg.getAttribute("height")
if(!ak_tmp) ak_tmp="-1000"
else if(/%$/.test(ak_tmp))
{
ak_tmp=Math.round(parseFloat(ak_tmp.replace(/%$/,""))*-10)
if(isNaN(ak_tmp) || ak_tmp>=0) ak_tmp="-1000"
}
else
{
ak_tmp=Math.round(ak_getAbsolutePixel(ak_tmp,"height",window.innerWidth,window.innerHeight))
if(!ak_tmp) ak_tmp="-1000"
}
ak_exportFrames+="*"+ak_tmp
if(action=="exportRaster0") ak_timeInpoint=ak_tmpIn
else ak_timeInpoint=ak_tmp_inTmp
//ak_alert(ak_exportFrames); return
ak_io_wait_active=true
setTimeout("ak_SVGSaver('export')",10)
break
}
ak_cout("")
}
var ak_exportFrames, ak_exportFile=""
// #################################
function ak_menuValid(evt,action)
{
if(evt.type!="mousedown") return true
if(ak_menu_status=="timeline")
{
if(ak_playTrue)
{
evt.preventDefault()
ak_timeMouseAction(evt,"pause")
return false
}
else return true
}
else if(ak_svgroot.getCurrentTime()<ak_aniStop)
{evt.preventDefault();ak_animation("stop");ak_selection("show");return false}
else return true
}
// #################################
function ak_showMenu(evt,what)
{
if(!ak_menuValid(evt,"timeline")) return
var ak_tmpNode, ak_tmp
if(what=="timeCanvas" || what=="timeScale")
{
ak_tmpNode='<menu><header>ak_timeMenuMain</header>'
ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'Start0\')">[Ctrl+Space]  Start at 0:00:00</item>'
ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'Play\')">[P]                  Play | Pause</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item checked="yes" onactivate="ak_main_menu(\'BackFromTimeline\')">Timeline EDITOR</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<menu><header>Zoom | Pan Canvas  (x'+ak_grid_zoom+')</header>'
ak_tmpNode+='<item onactivate="ak_grid_on_off(evt,\'ZoomIn\')">Zoom IN      [A]</item>'
ak_tmpNode+='<item onactivate="ak_grid_on_off(evt,\'ZoomOut\')">Zoom OUT   [Y] or [Z]</item>'
if(ak_grid_pan_x==0 && ak_grid_pan_y==0 && ak_grid_zoom==1)
{ak_tmpNode+='<item checked="yes">0,0 | x1       [A+Y] or [A+Z] </item>'}
else {ak_tmpNode+='<item onactivate="ak_grid_on_off(evt,\'ZoomReset\')">0,0 | x1       [A+Y] or [A+Z] </item>'}
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item>To Pan Canvas use middleMouseButton,</item>'
ak_tmpNode+='<item>or [Space] and leftMouseButton!</item>'
ak_tmpNode+='</menu>'
ak_tmpNode+='<item onactivate="ak_main_menu(\'EnterSVGwidth\')">Enter width/height  ('
ak_tmpNode+=ak_userspace_svg.getAttribute("width")+","+ak_userspace_svg.getAttribute("height")+')</item>'
ak_tmpNode+='<separator/>'
if(ak_timeUndo.length>0) ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'undo\')">[Ctrl+Z] Undo</item>'
else ak_tmpNode+='<item enabled="no">[Ctrl+Z] Undo</item>'
if(ak_timeRedo.length>0) ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'redo\')">[Ctrl+Y] Redo</item>'
else ak_tmpNode+='<item enabled="no">[Ctrl+Y] Redo</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<menu><header>Save | Open | Export</header>'
ak_tmpNode+='<item onactivate="ak_main_menu(\'Save2Disk\')">[Ctrl+S] Save "'+ak_file+'"</item>'
ak_tmpNode+='<item onactivate="'+"ak_main_menu('saveAs')"+'">Save as ...</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_SVGSaver('openSVG')"+'">Open "*.svg"</item>'
ak_tmpNode+='<item onactivate="'+"ak_SVGSaver('openSVGNew')"+'">Open in new Window</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_SVGSaver('openEditor')"+'">Text-Editor (setup AKs_SVGSaver)</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_main_menu('New untitled')"+'">New SVG, save as ...</item>'
ak_tmpNode+='<separator/>'
ak_tmp=0
if(ak_timeInpoint<ak_timeOutpoint) ak_tmp=Math.round((ak_timeOutpoint-ak_timeInpoint)*ak_fps)
else if(ak_timeOutpoint==-1)
{
ak_tmp=Math.round((ak_timeEnd-ak_timeInpoint)*ak_fps)
if(ak_tmp<0) ak_tmp=0
}
ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'exportRaster\',1)">Export Raster-Image (Pause-Cursor)</item>'
if(ak_tmp==0) ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'export\',1)">Export Indexed-Frame  (Inpoint)</item>'
else ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'export\','+ak_tmp+')">Export Indexed-Frames  ('+ak_tmp+')</item>'
ak_tmpNode+='</menu>'
ak_tmpNode+='<menu><header>Inpoint | Outpoint  ('+ak_tmp+')</header>'
ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'0point\')">Goto 0:00:00      [0] (Null)</item>'
ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'Inpoint\')">Goto Inpoint        [I]</item>'
ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'Outpoint\')">Goto Outpoint     [O]</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'SetInpoint\')">Set Inpoint          [Shift+I]</item>'
ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'SetOutpoint\')">Set Outpoint       [Shift+O]</item>'
ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'SetEnd\')">Set Outpoint to -1 (End)</item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'enterInpoint\')">Enter In-|Outpoint</item>'
ak_tmpNode+='</menu>'
ak_tmp=ak_round(ak_fps,1000000)
ak_tmpNode+='<menu><header>'
if(ak_tmp!=ak_fps)
{
ak_tmp=ak_round(ak_fps,1000)
ak_tmpNode+=ak_tmp+'..'
}
else ak_tmpNode+=ak_tmp
ak_tmpNode+=' fps | '+ak_progressive+'</header>'
ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'fpsEnter\')">Enter frames per seconds</item>'
ak_tmpNode+='<separator/>'
if(ak_fps==12) ak_tmpNode+='<item checked="yes">12 fps</item>'
else ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'fps\',\'12\')">12 fps</item>'
if(ak_fps==24) ak_tmpNode+='<item checked="yes">24 fps</item>'
else ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'fps\',\'24\')">24 fps</item>'
if(ak_fps==25) ak_tmpNode+='<item checked="yes">25 fps</item>'
else ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'fps\',\'25\')">25 fps</item>'
if(ak_fps==29.97) ak_tmpNode+='<item checked="yes">29.97 fps</item>'
else ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'fps\',\'29.97\')">29.97 fps</item>'
ak_tmpNode+='<separator/>'
if(ak_progressive=="progressive") ak_tmpNode+='<item checked="yes">progressive</item>'
else ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'fps\',false,\'progressive\')">progressive</item>'
if(ak_progressive=="interlaced-pal") ak_tmpNode+='<item checked="yes">interlaced-pal  (even/odd)</item>'
else ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'fps\',false,\'interlaced-pal\')">interlaced-pal  (even/odd)</item>'
if(ak_progressive=="interlaced-ntsc") ak_tmpNode+='<item checked="yes">interlaced-ntsc  (odd/even)</item>'
else ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'fps\',false,\'interlaced-ntsc\')">interlaced-ntsc  (odd/even)</item>'
ak_tmpNode+='<separator/>'
if(ak_fps==25 && ak_progressive=="interlaced-pal") ak_tmpNode+='<item checked="yes">25 fps | interlaced-pal</item>'
else ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'fps\',\'25\',\'interlaced-pal\')">25 fps | interlaced-pal</item>'
if(ak_fps==29.97 && ak_progressive=="interlaced-ntsc") ak_tmpNode+='<item checked="yes">29.97 fps | interlaced-ntsc</item>'
else ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'fps\',\'29.97\',\'interlaced-ntsc\')">29.97 fps | interlaced-ntsc</item>'
ak_tmpNode+='</menu>'
ak_tmpNode+='<separator/>'
//             
var ak_tmp_load=ak_userspace_svg.getAttribute("onload")
ak_tmp_load=ak_tmp_load.replace(/^try\{ak_init_editor\(evt,\'/,"")
if(/^try\{ak_init_editor\(evt\)\};?catch\(err\)\{\}/.test(ak_tmp_load))
{
ak_tmpNode+='<item id="ak_autoStart" checked="yes" onactivate="ak_main_menu(\'autoStart\')">autoStart AKs Timeline Editor</item>'
}
else ak_tmpNode+='<item id="ak_autoStart" onactivate="ak_main_menu(\'autoStart\')">autoStart AKs Timeline Editor</item>'
ak_tmpNode+='<menu><header>Stretch | Shrink Timeline</header>'
ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'Stretch\')">Stretch Timeline      [A]</item>'
ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'Shrink\')">Shrink Timeline        [Y] or [Z]</item>'
ak_tmpNode+='<item onactivate="ak_timeMain(evt,\'ShowComplete\')">Show Complete       [A+Y] or [A+Z] </item>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item>To Pan Timeline use middleMouseButton,</item>'
ak_tmpNode+='<item>or [Space] and leftMouseButton!</item>'
ak_tmpNode+='</menu>'
ak_tmpNode+='<separator/>'
ak_tmpNode+='<item onactivate="'+"ak_info('Help')"+'">Help   (Aks_Help.html)</item>'
ak_tmpNode+='<item checked="no" onactivate="'+"ak_info()"+'">About Aks SVG Editor</item>'
ak_tmpNode+='<item action="'+"Quality"+'">Higher Quality</item>'
if(ak_svgroot.currentTranslate.x!=0 || ak_svgroot.currentTranslate.y!=0 || ak_svgroot.currentScale!=1) ak_tmpNode+='<item action="'+"OriginalView"+'">Original View</item>'
ak_tmpNode+='</menu>'
contextMenu().replaceChild(parseXML(ak_tmpNode,getContextMenu()).firstChild,getContextMenu().firstChild)
}
else evt.preventDefault()
}
// #################################
// #################################
var ak_timeAction=false, ak_timeScaleIn=0, ak_timeScaleInY=0, ak_timeIn=0, ak_repeatDur=true, ak_tmpStep=20
var ak_objectIn, ak_timeUndo=new Array, ak_timeRedo=new Array, ak_timeUndoClean=0
function ak_timeMouseAction(evt,action,index)
{
if(ak_playTrue) 
{
evt.preventDefault()
ak_timeMain(evt,'Pause')
return
}
if(evt.type=="mousedown")
{
if(typeof(index)=="number")
{
ak_objectIn=new Array
ak_objectIn[0]=index
for(var i=1;i<ak_animationArray[0].length;i++){ak_objectIn[i]=ak_animationArray[ak_timelineArray[index][1]][i]}
}
ak_timeScaleIn=evt.clientX
var ak_tmpY=evt.clientY, ak_tmp3
if(action=="max")
{
evt.preventDefault()
if(evt.getButton==2) return
ak_timeAction=action
ak_timeScaleInY=ak_tmpY
ak_move_eval="ak_timeMouseAction(evt,ak_timeAction)"
ak_tCircle.setAttribute("cx",ak_timeScaleIn)
ak_tCircle.setAttribute("cy",ak_tmpY)
ak_tCircle.setAttribute("visibility","visible")
ak_tMouseDownMax.setAttribute("visibility","visible")
ak_tMax.setAttribute("y1",ak_timeline_ystart)
ak_tMax.setAttribute("y2",ak_timeline_ystart)
ak_tMax.setAttribute("visibility","visible")
ak_maxCount=ak_timeline_count
// ak_status
}
else if((action=="line" && evt.getButton!=2) || (action=="line" && typeof(index)!="number"))
{
evt.preventDefault()
if(evt.getButton==2) return
if(ak_timeline_count>=ak_timelineArray.length) return
ak_timeAction=action
ak_timeScaleInY=ak_tmpY
ak_move_eval="ak_timeMouseAction(evt,ak_timeAction)"
ak_tCircle.setAttribute("cx",ak_timeScaleIn)
ak_tCircle.setAttribute("cy",ak_tmpY)
ak_tCircle.setAttribute("visibility","visible")
document.getElementById("ak_timeline_nr").setAttribute("fill","#f22")
// ak_status
}
else if(evt.getButton==1 || ak_key_status[32]=="down")
{
evt.preventDefault()
ak_timeAction="pan"
ak_move_eval="ak_timeMouseAction(evt,ak_timeAction)"
ak_tCircle.setAttribute("cx",ak_timeScaleIn)
ak_tCircle.setAttribute("cy",ak_tmpY)
ak_tCircle.setAttribute("visibility","visible")
ak_tMouseDown.setAttribute("x1",ak_timeScaleIn)
ak_tMouseDown.setAttribute("x2",ak_timeScaleIn)
ak_tMouseDown.setAttribute("visibility","visible")
ak_tPan.setAttribute("x1",ak_timeScaleIn)
ak_tPan.setAttribute("x2",ak_timeScaleIn)
ak_tPan.setAttribute("visibility","visible")
// ak_status
}
else if(action=="scale")
{
if(evt.getButton==0)
{
ak_timeAction="pause"
ak_move_eval="ak_timeMouseAction(evt,ak_timeAction)"
ak_tCircle.setAttribute("cx",ak_timeScaleIn)
ak_tCircle.setAttribute("cy",evt.clientY)
ak_tCircle.setAttribute("visibility","visible")
var ak_tmpTime=((ak_timeScaleIn-ak_timeline_left)*ak_timeline_res)+ak_timeline_begin
if(ak_tmpTime<0) ak_tmpTime=0
ak_tPause.setAttribute("x1",(ak_tmpTime)/ak_timeline_res)
ak_tPause.setAttribute("x2",(ak_tmpTime)/ak_timeline_res)
ak_timeline_pause=ak_tmpTime
ak_svgroot.setCurrentTime(ak_timeline_pause)
}
else if(evt.getButton==2) ak_showMenu(evt,'timeScale')
}
else if(action=="InOut")
{
if(evt.getButton==2)
{
ak_showMenu(evt,'timeScale')
return
}
ak_timeAction=action
ak_move_eval="ak_timeMouseAction(evt,ak_timeAction,'"+index+"')"
ak_tCircle.setAttribute("cx",ak_timeScaleIn)
ak_tCircle.setAttribute("cy",ak_tmpY)
ak_tCircle.setAttribute("visibility","visible")
if(index=="In") ak_timeIn=((ak_timeInpoint-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left
else
{
if(ak_timeOutpoint==-1 && ak_timeEnd>=ak_timeInpoint)
{ak_tmp3=ak_timeEnd}
else if(ak_timeOutpoint>ak_timeInpoint)
{ak_tmp3=ak_timeOutpoint}
else if(ak_timeOutpoint==-1)
{ak_tmp3=ak_timeInpoint}
else
{
ak_timeOutpoint=ak_timeInpoint
ak_tmp3=ak_timeOutpoint
}
ak_timeOutpoint=ak_tmp3
ak_timeIn=((ak_tmp3-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left
}
ak_tMouseDown.setAttribute("x1",ak_timeIn)
ak_tMouseDown.setAttribute("x2",ak_timeIn)
ak_tMouseDown.setAttribute("visibility","visible")
ak_tData.setAttribute("x1",ak_timeIn)
ak_tData.setAttribute("x2",ak_timeIn)
ak_tData.setAttribute("visibility","visible")
// ak_status
}
else if(evt.getButton==2)
{
if(typeof(index)=="number")
{
var ak_tmpMenu='<menu><header>ak_timeMenuLine</header>'
var ak_tmpi=ak_timelineArray[index][1]
var ak_tmpEntry
if(ak_timelineArray[index][2]) ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'id\',\'rename\','+index+')">('+(index+1)+'.)   Rename  "'+ak_timelineArray[index][0]+'..."</item>'
else if(ak_animationArray[ak_tmpi][10]) ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'id\',\'rename\','+index+')">('+(index+1)+'.)   Rename  "'+ak_animationArray[ak_tmpi][10]+'"</item>'
else ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'id\',\'rename\','+index+')">('+(index+1)+'.)   Enter id</item>'
ak_tmpMenu+='<separator/>'
//begin
if(ak_animationArray[ak_tmpi][1])
{
ak_tmpEntry=' = "'+ak_animationArray[ak_tmpi][1]
if(ak_animationArray[ak_tmpi][2]) ak_tmpEntry+="+"+ak_animationArray[ak_tmpi][2]
if(ak_animationArray[ak_tmpi][3]) ak_tmpEntry+=";"+ak_animationArray[ak_tmpi][3]
ak_tmpEntry+='"'
}
else if(typeof(ak_animationArray[ak_tmpi][2])=="number")
{
ak_tmpEntry=' = "'+ak_animationArray[ak_tmpi][2]
if(ak_animationArray[ak_tmpi][3]) ak_tmpEntry+=";"+ak_animationArray[ak_tmpi][3]
ak_tmpEntry+='"'
}
else ak_tmpEntry=""
if(ak_tmpEntry.length>26) ak_tmpEntry=ak_tmpEntry.substring(0,23)+'...'
if(!ak_animationArray[ak_tmpi][1] && ak_animationArray[ak_tmpi][2] && !ak_animationArray[ak_tmpi][3])
{
ak_tmpEntry=' = "'+ak_hhmmss(ak_animationArray[ak_tmpi][2])+'"'
}
ak_tmpMenu+='<menu><header>begin'+ak_tmpEntry+'</header>'
if(!ak_animationArray[ak_tmpi][1] && !ak_animationArray[ak_tmpi][2]) ak_tmpMenu+='<item checked="yes">begin = "0"</item>'
else ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'begin\',0,'+index+')">begin = "0"</item>'
if(ak_animationArray[ak_tmpi][1])
{
if(ak_animationArray[ak_tmpi][11]>0) ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'begin\','+ak_animationArray[ak_tmpi][11]+','+index+')">begin = "'+ak_hhmmss(ak_round(ak_animationArray[ak_tmpi][11],10000))+'"</item>'
else if(ak_animationArray[ak_tmpi][2]>0) ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'begin\','+ak_animationArray[ak_tmpi][2]+','+index+')">begin = "'+ak_hhmmss(ak_animationArray[ak_tmpi][2])+'"</item>'
}
ak_tmpMenu+='<separator/>'
var ak_tmpMenuB="", ak_tmpMenuC="", ak_tmp=0, ak_tmpCheck
for(var i=0;i<ak_timelineArray.length;i++)
{
ak_tmpCheck=""
if(ak_timelineArray[i][2])
{
if(i==index) ak_tmpCheck+=' enabled="no"'
if(ak_animationArray[ak_timelineArray[index][1]][1].search(ak_timelineArray[i][0])==0 && /\.begin$/.test(ak_animationArray[ak_timelineArray[index][1]][1])) ak_tmpCheck+=' checked="yes"'
ak_tmpMenuB+='<item'+ak_tmpCheck+' onactivate="ak_timeMenu(evt,\'begin\',\''+ak_animationArray[ak_timelineArray[i][1]][10]+'.begin\','+index+')">'+ak_timelineArray[i][0]+'.. .begin</item>'
if(i==index) ak_tmpCheck=' enabled="no"'
else ak_tmpCheck=""
if(ak_animationArray[ak_timelineArray[index][1]][1].search(ak_timelineArray[i][0])==0 && /\.end$/.test(ak_animationArray[ak_timelineArray[index][1]][1])) ak_tmpCheck+=' checked="yes"'
ak_tmpMenuC+='<item'+ak_tmpCheck+' onactivate="ak_timeMenu(evt,\'begin\',\''+ak_animationArray[ak_timelineArray[i][1]][10]+'.end\','+index+')">'+ak_timelineArray[i][0]+'.. .end</item>'
ak_tmp++
}
else if(ak_animationArray[ak_timelineArray[i][1]][10])
{
if(i==index) ak_tmpCheck+=' enabled="no"'
if(ak_animationArray[ak_timelineArray[i][1]][10]+'.begin'==ak_animationArray[ak_timelineArray[index][1]][1]) ak_tmpCheck+=' checked="yes"'
ak_tmpMenuB+='<item'+ak_tmpCheck+' onactivate="ak_timeMenu(evt,\'begin\',\''+ak_animationArray[ak_timelineArray[i][1]][10]+'.begin\','+index+')">'+ak_timelineArray[i][0]+'.begin</item>'
if(i==index) ak_tmpCheck=' enabled="no"'
else ak_tmpCheck=""
if(ak_animationArray[ak_timelineArray[i][1]][10]+'.end'==ak_animationArray[ak_timelineArray[index][1]][1]) ak_tmpCheck+=' checked="yes"'
ak_tmpMenuC+='<item'+ak_tmpCheck+' onactivate="ak_timeMenu(evt,\'begin\',\''+ak_animationArray[ak_timelineArray[i][1]][10]+'.end\','+index+')">'+ak_timelineArray[i][0]+'.end</item>'
ak_tmp++
}
}
if(ak_tmp>4)
{
ak_tmpMenuB='<menu><header>begin = "... .begin"</header>'+ak_tmpMenuB+'</menu>'
ak_tmpMenuC='<menu><header>begin = "... .end"</header>'+ak_tmpMenuC+'</menu>'
}
else ak_tmpMenuB+='<separator/>'
ak_tmpMenu+=ak_tmpMenuB
ak_tmpMenu+=ak_tmpMenuC
ak_tmpMenu+='<separator/>'
ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'enterBegin\',0,'+index+')">Enter begin</item>'
ak_tmpMenu+='</menu>'
ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'enterDur\',0,'+index+')">dur = "'+ak_hhmmss(ak_animationArray[ak_tmpi][7],"mm:ss")+'"</item>'
if(ak_animationArray[ak_tmpi][8])
{
ak_tmpMenu+='<menu><header>repeatCount = "'+ak_animationArray[ak_tmpi][8]+'"</header>'
ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'repeatRemove\',0,'+index+')">Remove  repeatCount</item><separator/>'
ak_tmp=ak_hhmmss(ak_animationArray[ak_tmpi][8]*ak_animationArray[ak_tmpi][7],"mm:ss")
ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'repeatDur\','+ak_tmp+','+index+')">repeatDur = "'+ak_tmp+'"</item>'
}
else if(ak_animationArray[ak_tmpi][9] || typeof(ak_animationArray[ak_tmpi][9])=="number")
{
ak_tmpMenu+='<menu><header>repeatDur = "'+ak_hhmmss(ak_animationArray[ak_tmpi][9],"mm:ss")+'"</header>'
ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'repeatRemove\',0,'+index+')">Remove  repeatDur</item><separator/>'
if(typeof(ak_animationArray[ak_tmpi][9])=="number" && typeof(ak_animationArray[ak_tmpi][7])=="number") ak_tmp=ak_hhmmss(ak_animationArray[ak_tmpi][9]/ak_animationArray[ak_tmpi][7],"mm:ss")
else ak_tmp=ak_animationArray[ak_tmpi][9]
if(typeof(ak_animationArray[ak_tmpi][7])=="number" && typeof(ak_animationArray[ak_tmpi][9])=="number") ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'repeatCount\','+ak_tmp+','+index+')">repeatCount = "'+ak_tmp+'"</item>'
else if(ak_animationArray[ak_tmpi][9]=="indefinite") ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'repeatCount\',1,'+index+')">repeatCount = "1"</item>'
}
else
{
ak_tmpMenu+='<menu><header>repeatCount|Dur</header>'
ak_tmpMenu+='<item checked="yes">Remove  repeatDur</item><separator/>'
if(typeof(ak_animationArray[ak_tmpi][7])=="number")
{
ak_tmp=ak_hhmmss(ak_animationArray[ak_tmpi][7],"mm:ss")
ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'repeatDur\','+ak_tmp+','+index+')">repeatDur = "'+ak_tmp+'"</item>'
ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'repeatCount\',1,'+index+')">repeatCount = "1"</item>'
}
else
{
ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'repeatDur\',2,'+index+')">repeatDur = "2s"</item>'
}
}
if(ak_animationArray[ak_tmpi][9]=="indefinite") ak_tmpMenu+='<item checked="yes">repeatDur = "indefinite"</item>'
else if(typeof(ak_animationArray[ak_tmpi][7])=="number") ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'repeatDur\',\'indefinite\','+index+')">repeatDur = "indefinite"</item>'
ak_tmpMenu+='<separator/>'
ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'enterRepeat\',0,'+index+')">Enter  repeatCount|Dur</item>'
ak_tmpMenu+='</menu>'
//end
if(ak_animationArray[ak_tmpi][4])
{
ak_tmpEntry=' = "'+ak_animationArray[ak_tmpi][4]
if(ak_animationArray[ak_tmpi][5]) ak_tmpEntry+="+"+ak_animationArray[ak_tmpi][5]
if(ak_animationArray[ak_tmpi][6]) ak_tmpEntry+=";"+ak_animationArray[ak_tmpi][6]
ak_tmpEntry+='"'
}
else if(typeof(ak_animationArray[ak_tmpi][5])=="number")
{
ak_tmpEntry=' = "'+ak_animationArray[ak_tmpi][5]
if(ak_animationArray[ak_tmpi][6]) ak_tmpEntry+=";"+ak_animationArray[ak_tmpi][6]
ak_tmpEntry+='"'
}
else ak_tmpEntry=""
if(ak_tmpEntry.length>26) ak_tmpEntry=ak_tmpEntry.substring(0,23)+'...'
if(!ak_animationArray[ak_tmpi][4] && ak_animationArray[ak_tmpi][5] && !ak_animationArray[ak_tmpi][6])
{
ak_tmpEntry=' = "'+ak_hhmmss(ak_animationArray[ak_tmpi][5])+'"'
}
ak_tmpMenu+='<menu><header>end'+ak_tmpEntry+'</header>'
if((ak_animationArray[ak_tmpi][4]+ak_animationArray[ak_tmpi][5]+ak_animationArray[ak_tmpi][6])=="")
{ak_tmpMenu+='<item checked="yes">Remove  end</item>'}
else ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'endRemove\',0,'+index+')">Remove  end</item>'
ak_tmp=0
if(ak_animationArray[ak_tmpi][11]!=-1) ak_tmp+=ak_animationArray[ak_tmpi][11]
else if(typeof(ak_animationArray[ak_tmpi][2])=="number") ak_tmp+=ak_animationArray[ak_tmpi][2]
if(typeof(ak_animationArray[ak_tmpi][7])=="number") ak_tmp+=ak_animationArray[ak_tmpi][7]
if((ak_animationArray[ak_tmpi][4]+ak_animationArray[ak_tmpi][5]+ak_animationArray[ak_tmpi][6])==ak_tmp)
{ak_tmpMenu+='<item checked="yes">end = "'+ak_hhmmss(ak_tmp)+'"</item>'}
else ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'end\','+ak_tmp+','+index+')">end = "'+ak_hhmmss(ak_tmp)+'"</item>'
ak_tmpMenu+='<separator/>'
var ak_tmpMenuB="", ak_tmpMenuC="", ak_tmp=0, ak_tmpCheck
for(var i=0;i<ak_timelineArray.length;i++)
{
ak_tmpCheck=""
if(ak_timelineArray[i][5])
{
if(i==index) ak_tmpCheck+=' enabled="no"'
if(ak_animationArray[ak_timelineArray[index][1]][4].search(ak_timelineArray[i][0])==0 && /\.begin$/.test(ak_animationArray[ak_timelineArray[index][1]][4])) ak_tmpCheck+=' checked="yes"'
ak_tmpMenuB+='<item'+ak_tmpCheck+' onactivate="ak_timeMenu(evt,\'end\',\''+ak_animationArray[ak_timelineArray[i][1]][10]+'.begin\','+index+')">'+ak_timelineArray[i][0]+'.. .begin</item>'
if(i==index) ak_tmpCheck=' enabled="no"'
else ak_tmpCheck=""
if(ak_animationArray[ak_timelineArray[index][1]][4].search(ak_timelineArray[i][0])==0 && /\.end$/.test(ak_animationArray[ak_timelineArray[index][1]][4])) ak_tmpCheck+=' checked="yes"'
ak_tmpMenuC+='<item'+ak_tmpCheck+' onactivate="ak_timeMenu(evt,\'end\',\''+ak_animationArray[ak_timelineArray[i][1]][10]+'.end\','+index+')">'+ak_timelineArray[i][0]+'.. .end</item>'
ak_tmp++
}
else if(ak_animationArray[ak_timelineArray[i][1]][10])
{
if(i==index) ak_tmpCheck+=' enabled="no"'
if(ak_animationArray[ak_timelineArray[i][1]][10]+'.begin'==ak_animationArray[ak_timelineArray[index][1]][4]) ak_tmpCheck+=' checked="yes"'
ak_tmpMenuB+='<item'+ak_tmpCheck+' onactivate="ak_timeMenu(evt,\'end\',\''+ak_animationArray[ak_timelineArray[i][1]][10]+'.begin\','+index+')">'+ak_timelineArray[i][0]+'.begin</item>'
if(i==index) ak_tmpCheck=' enabled="no"'
else ak_tmpCheck=""
if(ak_animationArray[ak_timelineArray[i][1]][10]+'.end'==ak_animationArray[ak_timelineArray[index][1]][4]) ak_tmpCheck+=' checked="yes"'
ak_tmpMenuC+='<item'+ak_tmpCheck+' onactivate="ak_timeMenu(evt,\'end\',\''+ak_animationArray[ak_timelineArray[i][1]][10]+'.end\','+index+')">'+ak_timelineArray[i][0]+'.end</item>'
ak_tmp++
}
}
if(ak_tmp>4)
{
ak_tmpMenuB='<menu><header>end = "... .begin"</header>'+ak_tmpMenuB+'</menu>'
ak_tmpMenuC='<menu><header>end = "... .end"</header>'+ak_tmpMenuC+'</menu>'
}
else ak_tmpMenuB+='<separator/>'
ak_tmpMenu+=ak_tmpMenuB
ak_tmpMenu+=ak_tmpMenuC
ak_tmpMenu+='<separator/>'
ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'enterEnd\',0,'+index+')">Enter end</item>'
ak_tmpMenu+='</menu>'

if(ak_animationArray[ak_tmpi][15]) ak_tmpEntry='fill = "freeze"'
else ak_tmpEntry='fill = "remove"'
ak_tmpMenu+='<menu><header>'+ak_tmpEntry+'</header>'
if(ak_animationArray[ak_tmpi][15])
{
ak_tmpMenu+='<item checked="yes">freeze</item>'
ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'fill\',\'remove\','+index+')" checked="no">remove</item>'
}
else
{
ak_tmpMenu+='<item onactivate="ak_timeMenu(evt,\'fill\',\'freeze\','+index+')" checked="no">freeze</item>'
ak_tmpMenu+='<item checked="yes">remove</item>'
}
ak_tmpMenu+='</menu>'
ak_tmpMenu+='</menu>'
contextMenu().replaceChild(parseXML(ak_tmpMenu,getContextMenu()).firstChild,getContextMenu().firstChild)
}
}
else if(action=="begin")
{
if(ak_animationArray[ak_timelineArray[index][1]][1])
{
if(!/\.begin$|\.end$/.test(ak_animationArray[ak_timelineArray[index][1]][1]) || ak_animationArray[ak_timelineArray[index][1]][11]==-1)
{
ak_animationArray[ak_timelineArray[index][1]][11]=0
if(ak_animationArray[ak_timelineArray[index][1]][2]) ak_animationArray[ak_timelineArray[index][1]][11]+=ak_animationArray[ak_timelineArray[index][1]][2]
var ak_tmp=ak_animationArray[ak_timelineArray[index][1]][1]
if(ak_animationArray[ak_timelineArray[index][1]][2]) ak_tmp+="+"+ak_animationArray[ak_timelineArray[index][1]][2]
else ak_animationArray[ak_timelineArray[index][1]][2]=0
if(ak_animationArray[ak_timelineArray[index][1]][3]) ak_tmp+=";"+ak_animationArray[ak_timelineArray[index][1]][3]
ak_animationArray[ak_timelineArray[index][1]][3]=ak_tmp
ak_animationArray[ak_timelineArray[index][1]][1]=""
}
}
ak_timeAction="begin"
ak_move_eval="ak_timeMouseAction(evt,ak_timeAction,"+index+")"
ak_tCircle.setAttribute("cx",ak_timeScaleIn)
ak_tCircle.setAttribute("cy",ak_tmpY)
ak_tCircle.setAttribute("visibility","visible")
ak_timeIn=((ak_animationArray[ak_timelineArray[index][1]][11]-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left
ak_tMouseDown.setAttribute("x1",ak_timeIn)
ak_tMouseDown.setAttribute("x2",ak_timeIn)
ak_tMouseDown.setAttribute("visibility","visible")
ak_tData.setAttribute("x1",ak_timeIn)
ak_tData.setAttribute("x2",ak_timeIn)
ak_tData.setAttribute("visibility","visible")
// ak_status
}
else if(action=="end")
{
if(ak_animationArray[ak_timelineArray[index][1]][4])
{
if(!/\.begin$|\.end$/.test(ak_animationArray[ak_timelineArray[index][1]][4]) || ak_animationArray[ak_timelineArray[index][1]][13]==-1)
{
ak_animationArray[ak_timelineArray[index][1]][13]=0
if(ak_animationArray[ak_timelineArray[index][1]][5]) ak_animationArray[ak_timelineArray[index][1]][13]+=ak_animationArray[ak_timelineArray[index][1]][5]
var ak_tmp=ak_animationArray[ak_timelineArray[index][1]][4]
if(ak_animationArray[ak_timelineArray[index][1]][5]) ak_tmp+="+"+ak_animationArray[ak_timelineArray[index][1]][5]
else ak_animationArray[ak_timelineArray[index][1]][5]=0
if(ak_animationArray[ak_timelineArray[index][1]][6]) ak_tmp+=";"+ak_animationArray[ak_timelineArray[index][1]][6]
ak_animationArray[ak_timelineArray[index][1]][6]=ak_tmp
ak_animationArray[ak_timelineArray[index][1]][4]=""
}
}
ak_timeAction=action
ak_move_eval="ak_timeMouseAction(evt,ak_timeAction,"+index+")"
ak_tCircle.setAttribute("cx",ak_timeScaleIn)
ak_tCircle.setAttribute("cy",ak_tmpY)
ak_tCircle.setAttribute("visibility","visible")
ak_timeIn=((ak_animationArray[ak_timelineArray[index][1]][13]-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left
ak_tMouseDown.setAttribute("x1",ak_timeIn)
ak_tMouseDown.setAttribute("x2",ak_timeIn)
ak_tMouseDown.setAttribute("visibility","visible")
ak_tData.setAttribute("x1",ak_timeIn)
ak_tData.setAttribute("x2",ak_timeIn)
ak_tData.setAttribute("visibility","visible")
// ak_status
}
else if(action=="dur")
{
ak_timeAction=action
ak_move_eval="ak_timeMouseAction(evt,ak_timeAction,"+index+")"
ak_tCircle.setAttribute("cx",ak_timeScaleIn)
ak_tCircle.setAttribute("cy",ak_tmpY)
ak_tCircle.setAttribute("visibility","visible")
if(ak_animationArray[ak_timelineArray[index][1]][11]==-1)
{
ak_animationArray[ak_timelineArray[index][1]][11]=0
if(ak_animationArray[ak_timelineArray[index][1]][2]) ak_animationArray[ak_timelineArray[index][1]][11]+=ak_animationArray[ak_timelineArray[index][1]][2]
var ak_tmp=ak_animationArray[ak_timelineArray[index][1]][1]
if(ak_animationArray[ak_timelineArray[index][1]][2]) ak_tmp+="+"+ak_animationArray[ak_timelineArray[index][1]][2]
else ak_animationArray[ak_timelineArray[index][1]][2]=0
if(ak_animationArray[ak_timelineArray[index][1]][3]) ak_tmp+=";"+ak_animationArray[ak_timelineArray[index][1]][3]
ak_animationArray[ak_timelineArray[index][1]][3]=ak_tmp
ak_animationArray[ak_timelineArray[index][1]][1]=""
}
if(ak_animationArray[ak_timelineArray[index][1]][7]=="indefinite")
{
ak_animationArray[ak_timelineArray[index][1]][7]=0
ak_timeIn=((ak_animationArray[ak_timelineArray[index][1]][11]-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left
}
else
{
ak_timeIn=(((ak_animationArray[ak_timelineArray[index][1]][11]+ak_animationArray[ak_timelineArray[index][1]][7])-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left
}
ak_tMouseDown.setAttribute("x1",ak_timeIn)
ak_tMouseDown.setAttribute("x2",ak_timeIn)
ak_tMouseDown.setAttribute("visibility","visible")
ak_tData.setAttribute("x1",ak_timeIn)
ak_tData.setAttribute("x2",ak_timeIn)
ak_tData.setAttribute("visibility","visible")
// ak_status
}
else if(action=="repeat")
{
ak_timeAction=action
ak_move_eval="ak_timeMouseAction(evt,ak_timeAction,"+index+")"
ak_tCircle.setAttribute("cx",ak_timeScaleIn)
ak_tCircle.setAttribute("cy",ak_tmpY)
ak_tCircle.setAttribute("visibility","visible")
if(ak_animationArray[ak_timelineArray[index][1]][11]==-1)
{
ak_animationArray[ak_timelineArray[index][1]][11]=0
if(ak_animationArray[ak_timelineArray[index][1]][2]) ak_animationArray[ak_timelineArray[index][1]][11]+=ak_animationArray[ak_timelineArray[index][1]][2]
var ak_tmp=ak_animationArray[ak_timelineArray[index][1]][1]
if(ak_animationArray[ak_timelineArray[index][1]][2]) ak_tmp+="+"+ak_animationArray[ak_timelineArray[index][1]][2]
else ak_animationArray[ak_timelineArray[index][1]][2]=0
if(ak_animationArray[ak_timelineArray[index][1]][3]) ak_tmp+=";"+ak_animationArray[ak_timelineArray[index][1]][3]
ak_animationArray[ak_timelineArray[index][1]][3]=ak_tmp
ak_animationArray[ak_timelineArray[index][1]][1]=""
}
if(ak_animationArray[ak_timelineArray[index][1]][8]=="indefinite")
{
ak_animationArray[ak_timelineArray[index][1]][8]=1
ak_timeIn=(((ak_animationArray[ak_timelineArray[index][1]][11]+ak_animationArray[ak_timelineArray[index][1]][7])-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left
}
else if(ak_animationArray[ak_timelineArray[index][1]][9]=="indefinite")
{
ak_animationArray[ak_timelineArray[index][1]][9]=ak_animationArray[ak_timelineArray[index][1]][7]
ak_timeIn=(((ak_animationArray[ak_timelineArray[index][1]][11]+ak_animationArray[ak_timelineArray[index][1]][7])-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left
}
else if(ak_animationArray[ak_timelineArray[index][1]][8])
{
ak_timeIn=(((ak_animationArray[ak_timelineArray[index][1]][11]+(ak_animationArray[ak_timelineArray[index][1]][7]*ak_animationArray[ak_timelineArray[index][1]][8]))-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left
}
else
{
ak_timeIn=(((ak_animationArray[ak_timelineArray[index][1]][11]+ak_animationArray[ak_timelineArray[index][1]][9])-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left
}
ak_tMouseDown.setAttribute("x1",ak_timeIn)
ak_tMouseDown.setAttribute("x2",ak_timeIn)
ak_tMouseDown.setAttribute("visibility","visible")
ak_tData.setAttribute("x1",ak_timeIn)
ak_tData.setAttribute("x2",ak_timeIn)
ak_tData.setAttribute("visibility","visible")
// ak_status
}
}
else if(evt.type=="mouseup")
{
var ak_tmp
ak_move_eval=""
ak_timeAction=false
ak_tCircle.setAttribute("visibility","hidden")
ak_tMouseDown.setAttribute("visibility","hidden")
ak_tPan.setAttribute("visibility","hidden")
ak_tData.setAttribute("visibility","hidden")
ak_tMouseDownMax.setAttribute("visibility","hidden")
ak_tMax.setAttribute("visibility","hidden")
document.getElementById("ak_timeline_nr").setAttribute("fill","#000")
var ak_tmpY=evt.clientY
if(action=="pan")
{
var ak_tmpTime=(evt.clientX-ak_timeScaleIn)*ak_timeline_res
ak_timeline_begin-=ak_tmpTime
if(ak_timeline_begin<0) ak_timeline_begin=0
ak_draw_timescale(evt)
document.getElementById("ak_timeline_ani").setAttribute("transform",'translate(-'+(ak_timeline_begin/ak_timeline_res)+','+(ak_timeline_ystart+ak_timeline_yani)+')')
}
else if(action=="InOut")
{
var ak_tmpCmp=0
var ak_tmpTime=ak_timeInpoint+((evt.clientX-ak_timeScaleIn)*ak_timeline_res)
if(index=="Out")
{
ak_tmpCmp=ak_timeInpoint
ak_tmpTime=ak_timeOutpoint+((evt.clientX-ak_timeScaleIn)*ak_timeline_res)
}
ak_tmpTime=Math.round(ak_tmpTime*ak_fps)/ak_fps
if(ak_tmpTime<ak_tmpCmp) ak_tmpTime=ak_tmpCmp
if(index=="Out") ak_timeOutpoint=ak_tmpTime
else ak_timeInpoint=ak_tmpTime
ak_draw_animations(evt)
}
else if(action=="line")
{
var ak_tmpStart=ak_firstAnimation-Math.round((evt.clientY-ak_timeScaleInY)/ak_tmpStep) // alle 3 Pixel
if(ak_tmpStart<0) ak_tmpStart=0
if((ak_tmpStart+ak_timeline_count)>=ak_timelineArray.length) ak_tmpStart=ak_timelineArray.length-ak_timeline_count
if(ak_firstAnimation!=ak_tmpStart)
{
ak_firstAnimation=ak_tmpStart
ak_draw_animations(evt)
}
}
else if(action=="max")
{
var ak_tmpCount=-Math.round((ak_tmpY-ak_timeScaleInY)/ak_timeline_anidelta)
if((ak_timeline_count+ak_tmpCount)<2) ak_tmpCount=2-ak_timeline_count
else if((ak_timeline_count+ak_tmpCount)>ak_timelineArray.length) ak_tmpCount=ak_timelineArray.length-ak_timeline_count
if(ak_tmpCount)
{
ak_maxCount+=ak_tmpCount
ak_draw_animations(evt)
}
}
else if(action=="pause")
{
var ak_tmpTime=((evt.clientX-ak_timeline_left)*ak_timeline_res)+ak_timeline_begin
if(ak_tmpTime<0) ak_tmpTime=0
ak_timeline_pause=ak_tmpTime
ak_svgroot.setCurrentTime(ak_timeline_pause)
ak_tPause.setAttribute("x1",(ak_tmpTime)/ak_timeline_res)
ak_tPause.setAttribute("x2",(ak_tmpTime)/ak_timeline_res)
}
else if(action=="begin")
{
var ak_tmpComp=0
if(ak_animationArray[ak_timelineArray[index][1]][2]) ak_tmpComp=ak_animationArray[ak_timelineArray[index][1]][2]
var ak_tmpTime=ak_tmpComp+((evt.clientX-ak_timeScaleIn)*ak_timeline_res)
if(ak_tmpTime<0) ak_animationArray[ak_timelineArray[index][1]][2]=0
else ak_animationArray[ak_timelineArray[index][1]][2]=ak_tmpTime
if(ak_timelineArray[index][2])
{// wenn ak_multi_
for(var i=0;i<ak_animationArray.length;i++)
{
if(i!=ak_timelineArray[index][1] && ak_animationArray[i][10].search(ak_timelineArray[index][0])==0)
{
ak_animationArray[i][1]=ak_animationArray[ak_timelineArray[index][1]][1]
ak_animationArray[i][2]=ak_animationArray[ak_timelineArray[index][1]][2]
ak_animationArray[i][3]=ak_animationArray[ak_timelineArray[index][1]][3]
}
}
}
ak_timeline_aniArray(evt,"no_new_array")
ak_draw_animations(evt)
}
else if(action=="end")
{
var ak_tmpComp=0
if(ak_animationArray[ak_timelineArray[index][1]][5]) ak_tmpComp=ak_animationArray[ak_timelineArray[index][1]][5]
var ak_tmpTime=ak_tmpComp+((evt.clientX-ak_timeScaleIn)*ak_timeline_res)
if(ak_animationArray[ak_timelineArray[index][1]][4] && ak_tmpTime<0) ak_animationArray[ak_timelineArray[index][1]][5]=0
else if(!ak_animationArray[ak_timelineArray[index][1]][4] && ak_tmpTime<0.001) ak_animationArray[ak_timelineArray[index][1]][5]=0.001
else ak_animationArray[ak_timelineArray[index][1]][5]=ak_tmpTime
if(ak_timelineArray[index][2])
{// wenn ak_multi_
for(var i=0;i<ak_animationArray.length;i++)
{
if(i!=ak_timelineArray[index][1] && ak_animationArray[i][10].search(ak_timelineArray[index][0])==0)
{
ak_animationArray[i][4]=ak_animationArray[ak_timelineArray[index][1]][4]
ak_animationArray[i][5]=ak_animationArray[ak_timelineArray[index][1]][5]
ak_animationArray[i][6]=ak_animationArray[ak_timelineArray[index][1]][6]
}
}
}
ak_timeline_aniArray(evt,"no_new_array")
ak_draw_animations(evt)
}
else if(action=="dur")
{
var ak_tmpTime=((evt.clientX-ak_timeScaleIn)*ak_timeline_res)
if((ak_animationArray[ak_timelineArray[index][1]][7]+ak_tmpTime)<0) ak_tmpTime=-ak_animationArray[ak_timelineArray[index][1]][7]
ak_animationArray[ak_timelineArray[index][1]][7]+=ak_tmpTime
if(ak_timelineArray[index][2])
{// wenn ak_multi_
for(var i=0;i<ak_animationArray.length;i++)
{
if(i!=ak_timelineArray[index][1] && ak_animationArray[i][10].search(ak_timelineArray[index][0])==0)
{
ak_animationArray[i][7]=ak_animationArray[ak_timelineArray[index][1]][7]
}
}
}
ak_timeline_aniArray(evt,"no_new_array")
ak_draw_animations(evt)
}
else if(action=="repeat")
{
var ak_tmpTime=((evt.clientX-ak_timeScaleIn)*ak_timeline_res)
if(ak_animationArray[ak_timelineArray[index][1]][8])
{
ak_animationArray[ak_timelineArray[index][1]][8]=ak_round(((ak_animationArray[ak_timelineArray[index][1]][8]*ak_animationArray[ak_timelineArray[index][1]][7])+ak_tmpTime)/ak_animationArray[ak_timelineArray[index][1]][7],100)
if(ak_animationArray[ak_timelineArray[index][1]][8]<0.01) ak_animationArray[ak_timelineArray[index][1]][8]=0.01
}
else
{
if((ak_animationArray[ak_timelineArray[index][1]][9]+ak_tmpTime)<0) ak_animationArray[ak_timelineArray[index][1]][9]=0
else ak_animationArray[ak_timelineArray[index][1]][9]+=ak_tmpTime
}
if(ak_timelineArray[index][2])
{// wenn ak_multi_
for(var i=0;i<ak_animationArray.length;i++)
{
if(i!=ak_timelineArray[index][1] && ak_animationArray[i][10].search(ak_timelineArray[index][0])==0)
{
ak_animationArray[i][8]=ak_animationArray[ak_timelineArray[index][1]][8]
ak_animationArray[i][9]=ak_animationArray[ak_timelineArray[index][1]][9]
}
}
}
ak_timeline_aniArray(evt,"no_new_array")
ak_draw_animations(evt)
}
if(typeof(index)=="number")
{
ak_tmp=ak_timeUndo.length
ak_timeUndo[ak_tmp]=new Array
ak_timeUndo[ak_tmp][0]=index
for(var i=1;i<ak_animationArray[0].length;i++){ak_timeUndo[ak_tmp][i]=ak_animationArray[ak_timelineArray[index][1]][i]}
if(ak_timeUndo[ak_tmp].join()!=ak_objectIn.join())
{
ak_timeRedo=new Array
for(var i=1;i<ak_objectIn.length;i++){ak_timeUndo[ak_tmp][i]=ak_objectIn[i]}
}
else ak_timeUndo.pop()
}
}
else if(evt.type=="mousemove")
{
var ak_tmpX=evt.clientX
var ak_tmpY=evt.clientY
ak_tCircle.setAttribute("cx",ak_tmpX)
ak_tCircle.setAttribute("cy",ak_tmpY)
if(action=="pan")
{
var ak_tmpTime=(ak_tmpX-ak_timeScaleIn)*ak_timeline_res
if((ak_timeline_begin-ak_tmpTime)<0)
{
ak_tmpX=(ak_timeline_begin/ak_timeline_res)+ak_timeScaleIn
}
ak_tPan.setAttribute("x1",ak_tmpX)
ak_tPan.setAttribute("x2",ak_tmpX)
}
else if(action=="InOut")
{
var ak_tmpCmp=0
var ak_tmpTime=ak_timeInpoint+((evt.clientX-ak_timeScaleIn)*ak_timeline_res)
if(index=="Out")
{
ak_tmpCmp=ak_timeInpoint
ak_tmpTime=ak_timeOutpoint+((evt.clientX-ak_timeScaleIn)*ak_timeline_res)
}
ak_tmpTime=Math.round(ak_tmpTime*ak_fps)/ak_fps
if(ak_tmpTime<ak_tmpCmp) ak_tmpTime=ak_tmpCmp
ak_tData.setAttribute("x1",((ak_tmpTime-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left)
ak_tData.setAttribute("x2",((ak_tmpTime-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left)
}
else if(action=="line")
{
var ak_tmpStart=ak_firstAnimation-Math.round((ak_tmpY-ak_timeScaleInY)/ak_tmpStep) // alle 3 Pixel
if(ak_tmpStart<0) ak_tmpStart=0
if((ak_tmpStart+ak_timeline_count)>=ak_timelineArray.length)
{
ak_tmpStart=ak_timelineArray.length-ak_timeline_count
document.getElementById("ak_more_ani").setAttribute("visibility","hidden")
}
else document.getElementById("ak_more_ani").setAttribute("visibility","")
var ak_tmpChild=document.getElementById("ak_timeline_nr").childNodes
for(var i=0;i<(ak_tmpChild.length-1);i++)
{
if(ak_tmpStart+i==0) ak_tmpChild.item(i).setAttribute("fill","#fff")
else ak_tmpChild.item(i).setAttribute("fill","")
ak_tmpChild.item(i).firstChild.data=(ak_tmpStart+i+1)+".)"
}
}
else if(action=="max")
{
var ak_tmpCount=-Math.round((ak_tmpY-ak_timeScaleInY)/ak_timeline_anidelta)
if((ak_timeline_count+ak_tmpCount)<2) ak_tmpCount=2-ak_timeline_count
else if((ak_timeline_count+ak_tmpCount)>ak_timelineArray.length) ak_tmpCount=ak_timelineArray.length-ak_timeline_count
ak_tMax.setAttribute("y1",ak_timeline_ystart-(ak_tmpCount*ak_timeline_anidelta))
ak_tMax.setAttribute("y2",ak_timeline_ystart-(ak_tmpCount*ak_timeline_anidelta))
}
else if(action=="pause")
{
var ak_tmpTime=((evt.clientX-ak_timeline_left)*ak_timeline_res)+ak_timeline_begin
if(ak_tmpTime<0) ak_tmpTime=0
ak_tPause.setAttribute("x1",(ak_tmpTime)/ak_timeline_res)
ak_tPause.setAttribute("x2",(ak_tmpTime)/ak_timeline_res)
ak_timeline_pause=ak_tmpTime
ak_svgroot.setCurrentTime(ak_timeline_pause)
}
else if(action=="begin")
{
var ak_tmpCmp=0
if(ak_animationArray[ak_timelineArray[index][1]][1])
{
ak_tmpCmp=ak_animationArray[ak_timelineArray[index][1]][11]
if(ak_animationArray[ak_timelineArray[index][1]][2]) ak_tmpCmp-=ak_animationArray[ak_timelineArray[index][1]][2]
}
var ak_tmpTime=ak_animationArray[ak_timelineArray[index][1]][11]+((evt.clientX-ak_timeScaleIn)*ak_timeline_res)
if(ak_tmpTime<ak_tmpCmp) ak_tmpTime=ak_tmpCmp
ak_tData.setAttribute("x1",((ak_tmpTime-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left)
ak_tData.setAttribute("x2",((ak_tmpTime-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left)
}
else if(action=="end")
{
var ak_tmpCmp=0
var ak_tmpTime=ak_animationArray[ak_timelineArray[index][1]][13]+((evt.clientX-ak_timeScaleIn)*ak_timeline_res)
if(ak_animationArray[ak_timelineArray[index][1]][4])
{
ak_tmpCmp=ak_animationArray[ak_timelineArray[index][1]][13]
if(ak_animationArray[ak_timelineArray[index][1]][5]) ak_tmpCmp-=ak_animationArray[ak_timelineArray[index][1]][5]
if(ak_tmpTime<ak_tmpCmp) ak_tmpTime=ak_tmpCmp
}
else if(ak_tmpTime<0.001) ak_tmpTime=0.001
ak_tData.setAttribute("x1",((ak_tmpTime-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left)
ak_tData.setAttribute("x2",((ak_tmpTime-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left)
}
else if(action=="dur")
{
var ak_tmpTime=((evt.clientX-ak_timeScaleIn)*ak_timeline_res)
if((ak_animationArray[ak_timelineArray[index][1]][7]+ak_tmpTime)<0) ak_tmpTime=-ak_animationArray[ak_timelineArray[index][1]][7]
ak_tmpTime+=ak_animationArray[ak_timelineArray[index][1]][11]+ak_animationArray[ak_timelineArray[index][1]][7]
ak_tData.setAttribute("x1",((ak_tmpTime-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left)
ak_tData.setAttribute("x2",((ak_tmpTime-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left)
}
else if(action=="repeat")
{
var ak_tmpTime=((evt.clientX-ak_timeScaleIn)*ak_timeline_res)
if(ak_animationArray[ak_timelineArray[index][1]][8])
{
if(((ak_animationArray[ak_timelineArray[index][1]][8]*ak_animationArray[ak_timelineArray[index][1]][7])+ak_tmpTime)<0) ak_tmpTime=-ak_animationArray[ak_timelineArray[index][1]][8]*ak_animationArray[ak_timelineArray[index][1]][7]
ak_tmpTime+=ak_animationArray[ak_timelineArray[index][1]][11]+(ak_animationArray[ak_timelineArray[index][1]][8]*ak_animationArray[ak_timelineArray[index][1]][7])
}
else
{
if((ak_animationArray[ak_timelineArray[index][1]][9]+ak_tmpTime)<0) ak_tmpTime=-ak_animationArray[ak_timelineArray[index][1]][9]
ak_tmpTime+=ak_animationArray[ak_timelineArray[index][1]][11]+ak_animationArray[ak_timelineArray[index][1]][9]
}
ak_tData.setAttribute("x1",((ak_tmpTime-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left)
ak_tData.setAttribute("x2",((ak_tmpTime-ak_timeline_begin)/ak_timeline_res)+ak_timeline_left)
}
}
}
// #################################
function ak_checkTime(time)
{
var ak_tmp=time.replace(/^ +| +$/g,'')
if(!isNaN(parseInt(ak_tmp)) && /\.$|ms$|s$|min$|h$|\d$/.test(ak_tmp))
{
if(/:/.test(ak_tmp))
{
var ak_tmp_dur=ak_tmp.split(':')
ak_tmp_dur[0]=isNaN(parseInt(ak_tmp_dur[0]))?0:parseInt(ak_tmp_dur[0])
if(ak_tmp_dur.length==2)
{
ak_tmp=ak_tmp_dur[0]*60
ak_tmp_dur[1]=isNaN(parseFloat(ak_tmp_dur[1]))?0:ak_round(parseFloat(ak_tmp_dur[1]),1000)
ak_tmp+=ak_tmp_dur[1]

}
else
{
ak_tmp=ak_tmp_dur[0]*60*60
ak_tmp_dur[1]=isNaN(parseInt(ak_tmp_dur[1]))?0:parseInt(ak_tmp_dur[1])
ak_tmp+=ak_tmp_dur[1]*60
ak_tmp_dur[2]=isNaN(parseFloat(ak_tmp_dur[2]))?0:ak_round(parseFloat(ak_tmp_dur[2]),1000)
ak_tmp+=ak_tmp_dur[2]
}
}
else if(/(ms)$/.test(ak_tmp))
{
ak_tmp=ak_round(parseFloat(ak_tmp)/1000,1000)
}
else if(/(min)$/.test(ak_tmp))
{
ak_tmp=ak_round(parseFloat(ak_tmp)*60,1000)
}
else if(/(h)$/.test(ak_tmp))
{
ak_tmp=ak_round(parseFloat(ak_tmp)*60*60,1000)
}
else ak_tmp=ak_round(parseFloat(ak_tmp),1000)
}
else return ak_tmp
if(ak_tmp<=0) return 0
return ak_tmp
}
// #################################
var ak_animationArray, ak_timelineArray
function ak_timeline_aniArray(evt,no_new_array)
{
var ak_tmp_i=0, ak_tmp2, ak_tmp3
var ak_tmp
var ak_tmp_while=""
if(!no_new_array)
{
ak_animationArray=new Array
ak_timelineArray=new Array
while(ak_tmp_while!="set")
{
if(!ak_tmp_while) ak_tmp_while='animate'
else if(ak_tmp_while=="animate") ak_tmp_while='animateColor'
else if(ak_tmp_while=="animateColor") ak_tmp_while='animateTransform'
else if(ak_tmp_while=="animateTransform") ak_tmp_while='animateMotion'
else if(ak_tmp_while=="animateMotion") ak_tmp_while='set'
ak_tmp=ak_userspace_svg.getElementsByTagName(ak_tmp_while)
for(var i=0;i<ak_tmp.length;i++)
{
ak_animationArray[ak_tmp_i]=new Array(ak_tmp.item(i))
ak_tmp2=ak_tmp.item(i).getAttribute("begin")
if(!ak_tmp2)
{
ak_animationArray[ak_tmp_i][1]=""
ak_animationArray[ak_tmp_i][2]=""
ak_animationArray[ak_tmp_i][3]=""
}
else if(/;/.test(ak_tmp2))
{
ak_tmp2=ak_tmp2.split(";")
ak_tmp3=ak_tmp2[0]
ak_tmp2.shift()
ak_animationArray[ak_tmp_i][3]=ak_tmp2.join(";")
if(/\+/.test(ak_tmp3))
{
ak_tmp3=ak_tmp3.split("+")
ak_animationArray[ak_tmp_i][2]=ak_checkTime(ak_tmp3[ak_tmp3.length-1])
ak_tmp3.pop()
ak_animationArray[ak_tmp_i][1]=ak_tmp3.join("+")
if(isNaN(ak_animationArray[ak_tmp_i][2]))
{
ak_animationArray[ak_tmp_i][1]+="+"+ak_animationArray[ak_tmp_i][2]
ak_animationArray[ak_tmp_i][2]=""
}
}
else
{
ak_animationArray[ak_tmp_i][1]=""
ak_animationArray[ak_tmp_i][2]=ak_checkTime(ak_tmp3)
if(isNaN(ak_animationArray[ak_tmp_i][2]))
{
ak_animationArray[ak_tmp_i][1]=ak_animationArray[ak_tmp_i][2]
ak_animationArray[ak_tmp_i][2]=""
}
}
}
else
{
ak_animationArray[ak_tmp_i][3]=""
ak_tmp3=ak_tmp2
if(/\+/.test(ak_tmp3))
{
ak_tmp3=ak_tmp3.split("+")
ak_animationArray[ak_tmp_i][2]=ak_checkTime(ak_tmp3[ak_tmp3.length-1])
ak_tmp3.pop()
ak_animationArray[ak_tmp_i][1]=ak_tmp3.join("+")
if(isNaN(ak_animationArray[ak_tmp_i][2]))
{
ak_animationArray[ak_tmp_i][1]+="+"+ak_animationArray[ak_tmp_i][2]
ak_animationArray[ak_tmp_i][2]=""
}
}
else
{
ak_animationArray[ak_tmp_i][1]=""
ak_animationArray[ak_tmp_i][2]=ak_checkTime(ak_tmp3)
if(isNaN(ak_animationArray[ak_tmp_i][2]))
{
ak_animationArray[ak_tmp_i][1]=ak_animationArray[ak_tmp_i][2]
ak_animationArray[ak_tmp_i][2]=""
}
}
}
if(ak_animationArray[ak_tmp_i][1]) ak_animationArray[ak_tmp_i][1]=ak_animationArray[ak_tmp_i][1].replace(/^ +| +$/g,'')
ak_tmp2=ak_tmp.item(i).getAttribute("end")
if(!ak_tmp2)
{
ak_animationArray[ak_tmp_i][4]=""
ak_animationArray[ak_tmp_i][5]=""
ak_animationArray[ak_tmp_i][6]=""
}
else if(/;/.test(ak_tmp2))
{
ak_tmp2=ak_tmp2.split(";")
ak_tmp3=ak_tmp2[0]
ak_tmp2.shift()
ak_animationArray[ak_tmp_i][6]=ak_tmp2.join(";")
if(/\+/.test(ak_tmp3))
{
ak_tmp3=ak_tmp3.split("+")
ak_animationArray[ak_tmp_i][5]=ak_checkTime(ak_tmp3[ak_tmp3.length-1])
ak_tmp3.pop()
ak_animationArray[ak_tmp_i][4]=ak_tmp3.join("+")
if(isNaN(ak_animationArray[ak_tmp_i][5]))
{
ak_animationArray[ak_tmp_i][4]+="+"+ak_animationArray[ak_tmp_i][5]
ak_animationArray[ak_tmp_i][5]=""
}
}
else
{
ak_animationArray[ak_tmp_i][4]=""
ak_animationArray[ak_tmp_i][5]=ak_checkTime(ak_tmp3)
if(isNaN(ak_animationArray[ak_tmp_i][5]))
{
ak_animationArray[ak_tmp_i][4]=ak_animationArray[ak_tmp_i][5]
ak_animationArray[ak_tmp_i][5]=""
}
}
}
else
{
ak_animationArray[ak_tmp_i][6]=""
ak_tmp3=ak_tmp2
if(/\+/.test(ak_tmp3))
{
ak_tmp3=ak_tmp3.split("+")
ak_animationArray[ak_tmp_i][5]=ak_checkTime(ak_tmp3[ak_tmp3.length-1])
ak_tmp3.pop()
ak_animationArray[ak_tmp_i][4]=ak_tmp3.join("+")
if(isNaN(ak_animationArray[ak_tmp_i][5]))
{
ak_animationArray[ak_tmp_i][4]+="+"+ak_animationArray[ak_tmp_i][5]
ak_animationArray[ak_tmp_i][5]=""
}
}
else
{
ak_animationArray[ak_tmp_i][4]=""
ak_animationArray[ak_tmp_i][5]=ak_checkTime(ak_tmp3)
if(isNaN(ak_animationArray[ak_tmp_i][5]))
{
ak_animationArray[ak_tmp_i][4]=ak_animationArray[ak_tmp_i][5]
ak_animationArray[ak_tmp_i][5]=""
}
}
}
if(ak_animationArray[ak_tmp_i][4]) ak_animationArray[ak_tmp_i][4]=ak_animationArray[ak_tmp_i][4].replace(/^ +| +$/g,'')
ak_tmp2=ak_tmp.item(i).getAttribute("dur")
if(!ak_tmp2) ak_animationArray[ak_tmp_i][7]="indefinite"
else
{
ak_animationArray[ak_tmp_i][7]=ak_checkTime(ak_tmp2)
if(isNaN(ak_animationArray[ak_tmp_i][7]) || ak_animationArray[ak_tmp_i][7]<0) ak_animationArray[ak_tmp_i][7]="indefinite"
}
ak_tmp2=ak_tmp.item(i).getAttribute("repeatCount")
if(ak_tmp2) ak_tmp2=ak_tmp2.replace(/^ +| +$/g,'')
if(!ak_tmp2) ak_animationArray[ak_tmp_i][8]=""
else if(ak_tmp2!="indefinite")
{
ak_animationArray[ak_tmp_i][8]=parseFloat(ak_tmp2)
if(!isNaN(ak_animationArray[ak_tmp_i][8]) && ak_animationArray[ak_tmp_i][8]<=0) ak_animationArray[ak_tmp_i][8]=""
else if(isNaN(ak_animationArray[ak_tmp_i][8])) ak_animationArray[ak_tmp_i][8]=""
}
else ak_animationArray[ak_tmp_i][8]="indefinite"
ak_tmp2=ak_tmp.item(i).getAttribute("repeatDur")
if(ak_tmp2) ak_tmp2=ak_tmp2.replace(/^ +| +$/g,'')
if(!ak_tmp2) ak_animationArray[ak_tmp_i][9]=""
else if(ak_tmp2!="indefinite")
{
ak_animationArray[ak_tmp_i][9]=parseFloat(ak_tmp2)
if(!isNaN(ak_animationArray[ak_tmp_i][9]) && ak_animationArray[ak_tmp_i][9]<0) ak_animationArray[ak_tmp_i][9]=""
else if(isNaN(ak_animationArray[ak_tmp_i][9])) ak_animationArray[ak_tmp_i][9]=""
}
else ak_animationArray[ak_tmp_i][9]="indefinite"
ak_tmp2=ak_tmp.item(i).getAttribute("id")
if(ak_tmp2) ak_tmp2=ak_tmp2.replace(/^ +| +$/g,'')
if(!ak_tmp2) ak_animationArray[ak_tmp_i][10]=""
else ak_animationArray[ak_tmp_i][10]=ak_tmp2
ak_animationArray[ak_tmp_i][15]=ak_animationArray[ak_tmp_i][0].getAttribute("fill")
if(ak_animationArray[ak_tmp_i][15]!="freeze") ak_animationArray[ak_tmp_i][15]=""
ak_tmp_i++
}
}
}
if(ak_animationArray.length==0) return
// 11 calcBegin, 12 calcEnd, 13 end
for(var i=0;i<ak_animationArray.length;i++)
{
// clean up repeat
ak_tmp_i=i
if(ak_animationArray[ak_tmp_i][7]==0) ak_animationArray[ak_tmp_i][8]=""
if(ak_animationArray[ak_tmp_i][7]=="indefinite")
{
ak_animationArray[ak_tmp_i][8]=""
if(ak_animationArray[ak_tmp_i][9]=="indefinite") ak_animationArray[ak_tmp_i][9]=""
}
else if(ak_animationArray[ak_tmp_i][8]=="indefinite" && ak_animationArray[ak_tmp_i][9]=="indefinite") ak_animationArray[ak_tmp_i][8]=""
else if(ak_animationArray[ak_tmp_i][8]=="indefinite" && typeof(ak_animationArray[ak_tmp_i][9])=="number") ak_animationArray[ak_tmp_i][8]=""
else if(ak_animationArray[ak_tmp_i][8]=="indefinite")
{
ak_animationArray[ak_tmp_i][8]=""
ak_animationArray[ak_tmp_i][9]="indefinite"
}
else if(ak_animationArray[ak_tmp_i][9]=="indefinite" && typeof(ak_animationArray[ak_tmp_i][8])=="number") ak_animationArray[ak_tmp_i][9]=""
else if(typeof(ak_animationArray[ak_tmp_i][8])=="number" && typeof(ak_animationArray[ak_tmp_i][9])=="number") 
{
if((ak_animationArray[ak_tmp_i][8]*ak_animationArray[ak_tmp_i][7])<ak_animationArray[ak_tmp_i][9])
{ak_animationArray[ak_tmp_i][9]=""}
else ak_animationArray[ak_tmp_i][8]=""
}
ak_animationArray[i][11]=-1
if(ak_animationArray[i][1]=="" && typeof(ak_animationArray[i][2])=="number") ak_animationArray[i][11]=ak_animationArray[i][2]
else if(/\.end$|\.begin$/.test(ak_animationArray[i][1]))
{
ak_tmp=ak_animationArray[i][1].replace(/\.end$|\.begin$/,"")
if(ak_tmp)
{
for(var ib=(i-1);ib>=0;ib--)
{
if(ak_tmp==ak_animationArray[ib][10])
{
if(/\.begin$/.test(ak_animationArray[i][1])) ak_animationArray[i][11]=ak_animationArray[ib][11]
else if(/\.end$/.test(ak_animationArray[i][1])) ak_animationArray[i][11]=ak_animationArray[ib][12]
break
}
}
if(ak_animationArray[i][11]>=0 && typeof(ak_animationArray[i][2])=="number") ak_animationArray[i][11]+=ak_animationArray[i][2]
}
}
else if(ak_animationArray[i][1])
{
if(ak_animationArray[i][2]) ak_animationArray[i][11]=ak_animationArray[i][2]
else ak_animationArray[i][11]=0
}
ak_animationArray[i][13]=-1
if(ak_animationArray[i][4]=="" && typeof(ak_animationArray[i][5])=="number") ak_animationArray[i][13]=ak_animationArray[i][5]
else if(/\.end$|\.begin$/.test(ak_animationArray[i][4]))
{
ak_tmp=ak_animationArray[i][4].replace(/\.end$|\.begin$/,"")
if(ak_tmp)
{
for(var ib=(i-1);ib>=0;ib--)
{
if(ak_tmp==ak_animationArray[ib][10])
{
if(/\.begin$/.test(ak_animationArray[i][4])) ak_animationArray[i][13]=ak_animationArray[ib][11]
else if(/\.end$/.test(ak_animationArray[i][4])) ak_animationArray[i][13]=ak_animationArray[ib][12]
break
}
}
if(ak_animationArray[i][13]>=0 && typeof(ak_animationArray[i][5])=="number") ak_animationArray[i][13]+=ak_animationArray[i][5]
}
}
else if(ak_animationArray[i][4])
{
if(ak_animationArray[i][5]) ak_animationArray[i][13]=ak_animationArray[i][5]
else ak_animationArray[i][13]=0
}
var ak_tmpEnd=0
if(ak_animationArray[i][7]!="indefinite")
{
ak_tmpEnd=ak_animationArray[i][7]
if(typeof(ak_animationArray[i][8])=="number") ak_tmpEnd*=ak_animationArray[i][8]
if(typeof(ak_animationArray[i][9])=="number" && typeof(ak_animationArray[i][8])!="number") ak_tmpEnd=ak_animationArray[i][9]
else if(typeof(ak_animationArray[i][9])=="number" && ak_animationArray[i][9]<ak_tmpEnd) ak_tmpEnd=ak_animationArray[i][9]
if(ak_animationArray[i][11]>=0) ak_tmpEnd+=ak_animationArray[i][11]
else if(ak_animationArray[i][2]) ak_tmpEnd+=ak_animationArray[i][2]
}
else
{
if(typeof(ak_animationArray[i][9])=="number")
{
ak_tmpEnd=ak_animationArray[i][9]
if(ak_animationArray[i][11]>=0) ak_tmpEnd+=ak_animationArray[i][11]
else if(ak_animationArray[i][2]) ak_tmpEnd+=ak_animationArray[i][2]
}
else ak_tmpEnd=-1
}
if(ak_animationArray[i][11]==-1) ak_animationArray[i][12]=-1
else if(ak_animationArray[i][13]>ak_animationArray[i][11] && ak_animationArray[i][13]<ak_tmpEnd) ak_animationArray[i][12]=ak_animationArray[i][13]
else ak_animationArray[i][12]=ak_tmpEnd
}
var ak_tmp_check=true
var ak_tmp_checkLoop=10
while(ak_tmp_check && ak_tmp_checkLoop>0)
{
ak_tmp_checkLoop--
ak_tmp_check=false
var ak_tmpComp
for(var i=ak_animationArray.length-2;i>=0;i--)
{
if(/\.end$|\.begin$/.test(ak_animationArray[i][1]))
{
ak_tmpComp=ak_animationArray[i][11]
ak_tmp=ak_animationArray[i][1].replace(/\.end$|\.begin$/,"")
if(ak_tmp)
{
for(var ib=i+1;ib<ak_animationArray.length;ib++)
{
if(ak_animationArray[ib][10]==ak_tmp)
{
if(/\.begin$/.test(ak_animationArray[i][1])) ak_animationArray[i][11]=ak_animationArray[ib][11]
else if(/\.end$/.test(ak_animationArray[i][1])) ak_animationArray[i][11]=ak_animationArray[ib][12]
if(ak_animationArray[i][11]>=0 && typeof(ak_animationArray[i][2])=="number") ak_animationArray[i][11]+=ak_animationArray[i][2]
if(ak_animationArray[i][11]!=ak_tmpComp)
{
ak_tmpEnd=0
if(ak_animationArray[i][7]!="indefinite")
{
ak_tmpEnd=ak_animationArray[i][7]
if(typeof(ak_animationArray[i][8])=="number") ak_tmpEnd*=ak_animationArray[i][8]
if(typeof(ak_animationArray[i][9])=="number" && typeof(ak_animationArray[i][8])!="number") ak_tmpEnd=ak_animationArray[i][9]
else if(typeof(ak_animationArray[i][9])=="number" && ak_animationArray[i][9]<ak_tmpEnd) ak_tmpEnd=ak_animationArray[i][9]
if(ak_animationArray[i][11]>=0) ak_tmpEnd+=ak_animationArray[i][11]
else if(ak_animationArray[i][2]) ak_tmpEnd+=ak_animationArray[i][2]
}
else
{
if(typeof(ak_animationArray[i][9])=="number")
{
ak_tmpEnd=ak_animationArray[i][9]
if(ak_animationArray[i][11]>=0) ak_tmpEnd+=ak_animationArray[i][11]
else if(ak_animationArray[i][2]) ak_tmpEnd+=ak_animationArray[i][2]
}
else ak_tmpEnd=-1
}
if(ak_animationArray[i][11]==-1) ak_animationArray[i][12]=-1
else if(ak_animationArray[i][13]>ak_animationArray[i][11] && ak_animationArray[i][13]<ak_tmpEnd) ak_animationArray[i][12]=ak_animationArray[i][13]
else ak_animationArray[i][12]=ak_tmpEnd
ak_tmp_check=true
}
break
}
}
}
}
if(/\.end$|\.begin$/.test(ak_animationArray[i][4]))
{
ak_tmpComp=ak_animationArray[i][13]
ak_tmp=ak_animationArray[i][4].replace(/\.end$|\.begin$/,"")
if(ak_tmp)
{
for(var ib=i+1;ib<ak_animationArray.length;ib++)
{
if(ak_animationArray[ib][10]==ak_tmp)
{
if(/\.begin$/.test(ak_animationArray[i][4])) ak_animationArray[i][13]=ak_animationArray[ib][11]
else if(/\.end$/.test(ak_animationArray[i][4])) ak_animationArray[i][13]=ak_animationArray[ib][12]
if(ak_animationArray[i][13]>=0 && typeof(ak_animationArray[i][5])=="number") ak_animationArray[i][13]+=ak_animationArray[i][5]
if(ak_animationArray[i][13]!=ak_tmpComp)
{
if(ak_animationArray[i][13]>ak_animationArray[i][11] && ak_animationArray[i][13]<ak_animationArray[i][12]) ak_animationArray[i][12]=ak_animationArray[i][13]
ak_tmp_check=true
}
break
}
}
}
}
}
for(var i=1;i<ak_animationArray.length;i++)
{
if(/\.end$|\.begin$/.test(ak_animationArray[i][1]))
{
ak_tmpComp=ak_animationArray[i][11]
ak_tmp=ak_animationArray[i][1].replace(/\.end$|\.begin$/,"")
if(ak_tmp)
{
for(var ib=i-1;ib>=0;ib--)
{
if(ak_animationArray[ib][10]==ak_tmp)
{
if(/\.begin$/.test(ak_animationArray[i][1])) ak_animationArray[i][11]=ak_animationArray[ib][11]
else if(/\.end$/.test(ak_animationArray[i][1])) ak_animationArray[i][11]=ak_animationArray[ib][12]
if(ak_animationArray[i][11]>=0 && typeof(ak_animationArray[i][2])=="number") ak_animationArray[i][11]+=ak_animationArray[i][2]
if(ak_animationArray[i][11]!=ak_tmpComp)
{
ak_tmpEnd=0
if(ak_animationArray[i][7]!="indefinite")
{
ak_tmpEnd=ak_animationArray[i][7]
if(typeof(ak_animationArray[i][8])=="number") ak_tmpEnd*=ak_animationArray[i][8]
if(typeof(ak_animationArray[i][9])=="number" && typeof(ak_animationArray[i][8])!="number") ak_tmpEnd=ak_animationArray[i][9]
else if(typeof(ak_animationArray[i][9])=="number" && ak_animationArray[i][9]<ak_tmpEnd) ak_tmpEnd=ak_animationArray[i][9]
if(ak_animationArray[i][11]>=0) ak_tmpEnd+=ak_animationArray[i][11]
else if(ak_animationArray[i][2]) ak_tmpEnd+=ak_animationArray[i][2]
}
else
{
if(typeof(ak_animationArray[i][9])=="number")
{
ak_tmpEnd=ak_animationArray[i][9]
if(ak_animationArray[i][11]>=0) ak_tmpEnd+=ak_animationArray[i][11]
else if(ak_animationArray[i][2]) ak_tmpEnd+=ak_animationArray[i][2]
}
else ak_tmpEnd=-1
}
if(ak_animationArray[i][11]==-1) ak_animationArray[i][12]=-1
else if(ak_animationArray[i][13]>ak_animationArray[i][11] && ak_animationArray[i][13]<ak_tmpEnd) ak_animationArray[i][12]=ak_animationArray[i][13]
else ak_animationArray[i][12]=ak_tmpEnd
ak_tmp_check=true
}
break
}
}
}
}
if(/\.end$|\.begin$/.test(ak_animationArray[i][4]))
{
ak_tmpComp=ak_animationArray[i][13]
ak_tmp=ak_animationArray[i][4].replace(/\.end$|\.begin$/,"")
if(ak_tmp)
{
for(var ib=i-1;ib>=0;ib--)
{
if(ak_animationArray[ib][10]==ak_tmp)
{
if(/\.begin$/.test(ak_animationArray[i][4])) ak_animationArray[i][13]=ak_animationArray[ib][11]
else if(/\.end$/.test(ak_animationArray[i][4])) ak_animationArray[i][13]=ak_animationArray[ib][12]
if(ak_animationArray[i][13]>=0 && typeof(ak_animationArray[i][5])=="number") ak_animationArray[i][13]+=ak_animationArray[i][5]
if(ak_animationArray[i][13]!=ak_tmpComp)
{
if(ak_animationArray[i][13]>ak_animationArray[i][11] && ak_animationArray[i][13]<ak_animationArray[i][12]) ak_animationArray[i][12]=ak_animationArray[i][13]
ak_tmp_check=true
}
break
}
}
}
}
}
}
ak_timelineArray=new Array
var ak_ti=0
ak_timeEnd=0
for(var i=0;i<ak_animationArray.length;i++)
{
if(ak_animationArray[i][12]>ak_timeEnd) ak_timeEnd=ak_animationArray[i][12]
if(/^ak_multi_/.test(ak_animationArray[i][10]))
{
ak_tmp=ak_animationArray[i][10].split("_")
if(ak_tmp.length<=3) ak_timelineArray.push(new Array(ak_animationArray[i][10],i,false))
else
{
ak_tmp=ak_tmp[0]+"_"+ak_tmp[1]+"_"+ak_tmp[2]+"_"
var ak_tmpOk=true
for(var ib=0;ib<ak_timelineArray.length;ib++)
{
if(ak_tmp==ak_timelineArray[ib][0])
{
ak_tmpOk=false
break
}
}
if(ak_tmpOk) ak_timelineArray.push(new Array(ak_tmp,i,true))
}
}
else if(ak_animationArray[i][10]) ak_timelineArray.push(new Array(ak_animationArray[i][10],i,false))
else
{
ak_tmp=ak_animationArray[i][0].getAttribute("xlink:href")
if(ak_tmp) ak_timelineArray.push(new Array(('xlink:href="'+ak_tmp+'"'),i,false))
else
{
ak_tmp=ak_animationArray[i][0].getAttribute("attributeName")
if(ak_tmp=="transform") ak_tmp=ak_animationArray[i][0].getAttribute("type")
else if(ak_animationArray[i][0].tagName=="animateMotion") ak_tmp="animateMotion"
ak_tmp2=ak_animationArray[i][0].parentNode.tagName
ak_tmp3=ak_animationArray[i][0].parentNode.getId()
ak_tmp+=" &lt;"+ak_tmp2
if(ak_tmp3) ak_tmp+=' id="'+ak_tmp3+'"'
ak_timelineArray.push(new Array(ak_tmp,i,false))
}
}
}
for(var i=0;i<ak_animationArray.length;i++)
{
if(typeof(ak_animationArray[i][2])=="number") ak_animationArray[i][2]=ak_round(ak_animationArray[i][2],1000)
if(typeof(ak_animationArray[i][5])=="number") ak_animationArray[i][5]=ak_round(ak_animationArray[i][5],1000)
ak_animationArray[i][11]=ak_round(ak_animationArray[i][11],1000)
if(ak_animationArray[i][11]>0)
{
ak_animationArray[i][0].setAttribute("begin",ak_animationArray[i][11])
}
else if(ak_animationArray[i][2]) ak_animationArray[i][0].setAttribute("begin",ak_animationArray[i][2])
else ak_animationArray[i][0].setAttribute("begin",0)
if(ak_animationArray[i][13]>0) ak_animationArray[i][0].setAttribute("end",ak_animationArray[i][13])
else try{ak_animationArray[i][0].removeAttribute("end")}catch(err){}
if(typeof(ak_animationArray[i][7])=="number") ak_animationArray[i][7]=ak_round(ak_animationArray[i][7],1000)
ak_animationArray[i][0].setAttribute("dur",ak_animationArray[i][7])
if(typeof(ak_animationArray[i][8])=="number") ak_animationArray[i][8]=ak_round(ak_animationArray[i][8],1000)
if(ak_animationArray[i][8]) ak_animationArray[i][0].setAttribute("repeatCount",ak_animationArray[i][8])
else try{ak_animationArray[i][0].removeAttribute("repeatCount")}catch(err){}
if(typeof(ak_animationArray[i][9])=="number") ak_animationArray[i][9]=ak_round(ak_animationArray[i][9],1000)
if(ak_animationArray[i][9]) ak_animationArray[i][0].setAttribute("repeatDur",ak_animationArray[i][9])
else if(typeof(ak_animationArray[i][9])=="number") ak_animationArray[i][0].setAttribute("repeatDur",ak_animationArray[i][9])
else try{ak_animationArray[i][0].removeAttribute("repeatDur")}catch(err){}
ak_tmp=parseXML(printNode(ak_animationArray[i][0]),document).firstChild
ak_animationArray[i][0].parentNode.replaceChild(ak_tmp,ak_animationArray[i][0])
ak_animationArray[i][0]=ak_tmp
}
}
// ############    ################
var ak_avoidOnce=false, ak_aniStop=1000, ak_buildInAni
window.ak_animation=ak_animation
function ak_animation(action)
{
if(action=="start")
{
if(ak_avoidOnce)
{
setTimeout("ak_animation(\'start\')",100) // Sodass Start via Menu auch selction hide ausfuehrt
ak_avoidOnce=false
return
}
ak_svgroot.pauseAnimations()
var ak_tmp, ak_tmp_in
var ak_tmp_while=""
while(ak_tmp_while!="set")
{
if(!ak_tmp_while) ak_tmp_while='animate'
else if(ak_tmp_while=="animate") ak_tmp_while='animateColor'
else if(ak_tmp_while=="animateColor") ak_tmp_while='animateTransform'
else if(ak_tmp_while=="animateTransform") ak_tmp_while='animateMotion'
else if(ak_tmp_while=="animateMotion") ak_tmp_while='set'
ak_tmp=ak_userspace_svg.getElementsByTagName(ak_tmp_while)
for(var i=0;i<ak_tmp.length;i++)
{
if(ak_tmp.item(i).getAttribute("repeatCount")=="indefinite" || ak_tmp.item(i).getAttribute("repeatDur")=="indefinite")
{
ak_tmp_in=parseXML(printNode(ak_tmp.item(i)),document).firstChild
ak_tmp.item(i).parentNode.replaceChild(ak_tmp_in,ak_tmp.item(i))
}
}
}
ak_svgroot.setCurrentTime(0)
ak_svgroot.unpauseAnimations()
if(document.getElementById("ak_Id_tmp_edit_g")) ak_setAttribute(document.getElementById("ak_Id_tmp_edit_g"),"visibility","hidden")
}
else if(action=="stop")
{
if(ak_avoidOnce) {ak_avoidOnce=false;return}
if(ak_aniStop<ak_timeEnd) ak_aniStop=Math.ceil(ak_timeEnd+1)
//ak_svgroot.setCurrentTime(ak_aniStop)
ak_svgroot.unpauseAnimations()
var ak_tmp, ak_tmp_in, ak_tmpBegin
var ak_tmp_while=""
ak_repeatArray=new Array
while(ak_tmp_while!="set")
{
if(!ak_tmp_while) ak_tmp_while='animate'
else if(ak_tmp_while=="animate") ak_tmp_while='animateColor'
else if(ak_tmp_while=="animateColor") ak_tmp_while='animateTransform'
else if(ak_tmp_while=="animateTransform") ak_tmp_while='animateMotion'
else if(ak_tmp_while=="animateMotion") ak_tmp_while='set'
ak_tmp=ak_userspace_svg.getElementsByTagName(ak_tmp_while)
for(var i=0;i<ak_tmp.length;i++)
{
if(ak_tmp.item(i).getAttribute("repeatCount")=="indefinite" || ak_tmp.item(i).getAttribute("repeatDur")=="indefinite")
{
ak_tmpBegin=ak_tmp.item(i).getAttribute("begin")
if(/\.end/.test(ak_tmpBegin)) ak_repeatArray.push(ak_tmp.item(i))
ak_tmp_in=ak_tmp.item(i).getAttribute("end")
ak_tmp.item(i).setAttribute("end","indefinite")
ak_tmp.item(i).endElement()
if(!ak_tmp_in)
{
try{ak_tmp.item(i).removeAttribute("end")}catch(error){}
}
else ak_tmp.item(i).setAttribute("end",ak_tmp_in)

}
}
}
ak_buildInAni.setAttribute("end",ak_aniStop)
ak_svgroot.setCurrentTime(ak_aniStop)
if(ak_repeatArray.length>0) setTimeout("ak_repeatRefresh(evt)",50)
}
}
// ############    ################
var ak_repeatArray=new Array
window.ak_repeatRefresh=ak_repeatRefresh
function ak_repeatRefresh(evt)
{
for(var i=0;i<ak_repeatArray.length;i++)
{
ak_tmp=parseXML(printNode(ak_repeatArray[i]),document).firstChild
ak_repeatArray[i].parentNode.replaceChild(ak_tmp,ak_repeatArray[i])
}
ak_repeatArray=new Array
}
// ############    ################
var ak_help_window=false
function ak_info(help)
{
if(help=="Help")
{
//alert(ak_editorDir+"AKs_Help.html","HelpWindow")
try{window.open(ak_editorDir+"AKs_Help.html","HelpWindow")}
catch(err){alert("window.open(\""+ak_editorDir+"AKs_Help.html\", \"HelpWindow\") not allowed!\nPlease select file within folder manually!")}
//ak_help_window=window.open(ak_editorDir+"AKs_Help.html","HelpWindow")        
return
}
var ak_tmp=document.getElementById("ak_info_about")
var ak_tmp_trans="translate("+(window.innerWidth/2)+","+(window.innerHeight/2)+")"
ak_tmp.setAttribute("transform",ak_tmp_trans)
ak_tmp.setAttribute("visibility","visible")
}
// ############    ################
function ak_generate_id(evt,previx,re_check,get_date)
{
if(!re_check)
{
var ak_tmp_date=new Date()
var ak_tmp_id_rest=(ak_tmp_date.getFullYear()-2000)+(ak_tmp_date.getMonth()+1).toString(16)
if(ak_tmp_date.getDate()<10) ak_tmp_id_rest+="0"+ak_tmp_date.getDate()
else ak_tmp_id_rest+=ak_tmp_date.getDate()
if(ak_tmp_date.getHours()<12) ak_tmp_id_rest+="a"+ak_tmp_date.getHours().toString(16)
else ak_tmp_id_rest+="p"+(ak_tmp_date.getHours()-12).toString(16)
if(ak_tmp_date.getMinutes()<10) ak_tmp_id_rest+="0"+ak_tmp_date.getMinutes()
else ak_tmp_id_rest+=ak_tmp_date.getMinutes()
if(ak_tmp_date.getSeconds()<10) ak_tmp_id_rest+="0"+ak_tmp_date.getSeconds()
else ak_tmp_id_rest+=ak_tmp_date.getSeconds()
re_check=previx+ak_tmp_id_rest
if(get_date) return ak_tmp_id_rest
}
re_check=re_check+"" // String
if(!document.getElementById(re_check)) return re_check
var i=0
while(document.getElementById(re_check+i)){ i++}
return (re_check+i)
}
// ######################################
function ak_dialogSuccess(evt,to_do)
{
var ak_tmp, ak_tmp_id_rest, ak_tmp_id_rest2, ak_tmp_object, ak_newNode=""
if(to_do=="aCreate")
{
var ak_tmp_text=ak_fileSelectFile
ak_tmp_id_rest=ak_generate_id(evt,"a_")
ak_tmp_id_rest2=ak_generate_id(evt,false,ak_tmp_id_rest.replace(/^a/,"text"))
ak_newNode='<a id="'+ak_tmp_id_rest+'" xlink:href="'+ak_tmp_text+'"/>'
var ak_newNodeText='<text id="'+ak_tmp_id_rest2+'" x="'+ak_imageX+'" y="'+ak_imageY
ak_newNodeText+='" style="fill:'+ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")
ak_newNodeText+=';font-size:24">'+ak_tmp_text+'</text>'
if(ak_imageWohin=="insert") ak_insertBeforeSP(ak_newNode,ak_object2update)
else if(ak_imageWohin=="add2Parent") ak_appendChildSP(ak_newNode,ak_object2update.parentNode)
else if(ak_imageWohin=="append") ak_appendChildSP(ak_newNode,ak_object2update)
else ak_appendChildSP(ak_newNode,ak_userspace_svg)
ak_appendChildSP(ak_newNodeText,document.getElementById(ak_tmp_id_rest))
if(!ak_autoId) {document.getElementById(ak_tmp_id_rest).removeAttribute("id")}
ak_tmp_object=document.getElementById(ak_tmp_id_rest2)
}
if(to_do=="parentACreate")
{
ak_append2undo()
ak_tmp_id_rest=ak_generate_id(evt,"a_")
var ak_tmp_link=ak_fileSelectFile
ak_create_parentNode('<a id="'+ak_tmp_id_rest+'" xlink:href="'+ak_tmp_link+'"/>',ak_object2update)
ak_tmp_object=document.getElementById(ak_tmp_id_rest)
ak_push2undoTrue()
//ak_dirty_flag=true
}
if(ak_tmp_object)
{
if(!ak_autoId) try{ak_tmp_object.removeAttribute("id")}catch(error){}
ak_clickset_obj2update(evt,ak_tmp_object)
}
}
// ######################################
var ak_autoId=false, ak_path=false, ak_imageX, ak_imageY, ak_imageWohin
var ak_fileSelectSuccess="", ak_fileSelectCancel="", ak_fileSelectFile=""
function ak_new_object_menu(evt,object,wohin)
{
var ak_tmp_id_rest, ak_tmp_object
var ak_tmp_x=parseInt(ak_userspace_svg.getAttribute("x"))
ak_tmp_x=isNaN(ak_tmp_x)?0:ak_tmp_x
ak_tmp_x=parseInt(((ak_mouse_x-21)/ak_grid_zoom)-ak_grid_pan_x-ak_tmp_x)
var ak_tmp_y=parseInt(ak_userspace_svg.getAttribute("y"))
ak_tmp_y=isNaN(ak_tmp_y)?0:ak_tmp_y
ak_tmp_y=parseInt(((ak_mouse_y-21)/ak_grid_zoom)-ak_grid_pan_y-ak_tmp_y)
var ak_newNode=""
if(!/(text)/.test(object))
{
while(ak_object2update=="[object SVGTextPathElement]" || ak_object2update=="[object SVGTSpanElement]" || ak_object2update=="[object SVGTRefElement]")
{
ak_object2update=ak_object2update.parentNode
}
}
if(ak_mouse_x<25) ak_mouse_x=25
if(ak_mouse_x>(window.innerWidth-150)) ak_mouse_x=(window.innerWidth-150)
if(ak_mouse_y<25) ak_mouse_y=25
if(ak_mouse_y>(window.innerHeight-30) && object=="line") ak_mouse_y=(window.innerHeight-30)
else if(ak_mouse_y>(window.innerHeight-125)) ak_mouse_y=(window.innerHeight-125)
var ak_tmpPoint=ak_svgroot.createSVGPoint()
if(wohin=="append")
{
ak_tmpPoint.x=ak_mouse_x
ak_tmpPoint.y=ak_mouse_y
var ak_tmp_matrix
if(ak_which_nodeNr(ak_object2update)==-1 || ak_which_nodeNr(ak_object2update)=='') ak_tmp_matrix=ak_get_overall_CTM(evt,ak_userspace_svg.firstChild)
else if(ak_object2update.tagName=='svg' || ak_object2update.tagName=='pattern')
{
ak_object2update.appendChild(parseXML('<g/>',document).firstChild)
ak_tmp_matrix=ak_get_overall_CTM(evt,ak_object2update.lastChild)
ak_object2update.removeChild(ak_object2update.lastChild)
}
else ak_tmp_matrix=ak_get_overall_CTM(evt,ak_object2update)
ak_tmpPoint=ak_tmpPoint.matrixTransform(ak_tmp_matrix.inverse)      
ak_tmp_x=Math.round(ak_tmpPoint.x)
ak_tmp_y=Math.round(ak_tmpPoint.y)
}
else if(!wohin)
{
ak_tmpPoint.x=ak_mouse_x
ak_tmpPoint.y=ak_mouse_y
var ak_tmp_matrix=ak_get_overall_CTM(evt,ak_userspace_svg.firstChild)
ak_tmpPoint=ak_tmpPoint.matrixTransform(ak_tmp_matrix.inverse)      
ak_tmp_x=Math.round(ak_tmpPoint.x)
ak_tmp_y=Math.round(ak_tmpPoint.y)
}
else
{
ak_tmpPoint.x=ak_mouse_x
ak_tmpPoint.y=ak_mouse_y
var ak_tmp_matrix
if(ak_which_nodeNr(ak_object2update.parentNode)==-1 || ak_which_nodeNr(ak_object2update.parentNode)=='') ak_tmp_matrix=ak_get_overall_CTM(evt,ak_userspace_svg.firstChild)
else if(ak_object2update.parentNode.tagName=='svg' || ak_object2update.parentNode.tagName=='pattern')
{
ak_object2update.parentNode.appendChild(parseXML('<g/>',document).firstChild)
ak_tmp_matrix=ak_get_overall_CTM(evt,ak_object2update.parentNode.lastChild)
ak_object2update.parentNode.removeChild(ak_object2update.parentNode.lastChild)
}
else ak_tmp_matrix=ak_get_overall_CTM(evt,ak_object2update.parentNode)
ak_tmpPoint=ak_tmpPoint.matrixTransform(ak_tmp_matrix.inverse)      
ak_tmp_x=Math.round(ak_tmpPoint.x)
ak_tmp_y=Math.round(ak_tmpPoint.y)
}
var ak_tmp=ak_SetGetRm_styleValue(ak_object2update,"fill","get","no_cout")
if(ak_tmp!='false') var ak_tmp_style='" style="fill:'+ak_tmp
else var ak_tmp_style='" style="fill:'+ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")
ak_tmp=ak_SetGetRm_styleValue(ak_object2update,"stroke","get","no_cout")
if(ak_tmp!='false')
{
ak_tmp_style+=';stroke:'+ak_tmp
ak_tmp=ak_SetGetRm_styleValue(ak_object2update,"stroke-width","get","no_cout")
if(ak_tmp!='false') ak_tmp_style+=';stroke-width:'+ak_tmp
}
switch(object)
{
case "aSelect":
ak_io_wait_active=true
ak_imageX=ak_tmp_x
ak_imageY=ak_tmp_y
ak_imageWohin=wohin
ak_fileSelectSuccess="ak_dialogSuccess(evt,'aCreate')"
ak_fileSelectCancel=""
ak_SVGSaver('fileSelect')
return
case "a":
var ak_tmp_text=prompt("Enter xlink:href!","http://")
if(ak_tmp_text==null) return
window.focus(ak_svgroot)
ak_tmp_text=ak_tmp_text.replace(/^ +| +$/,'')
ak_tmp_id_rest=ak_generate_id(evt,"a_")
ak_tmp_id_rest2=ak_generate_id(evt,false,ak_tmp_id_rest.replace(/^a/,"text"))
ak_newNode='<a id="'+ak_tmp_id_rest+'" xlink:href="'+ak_tmp_text+'"/>'
var ak_newNodeText='<text id="'+ak_tmp_id_rest2+'" x="'+ak_tmp_x+'" y="'+ak_tmp_y
ak_newNodeText+='" style="fill:'+ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")
if(!ak_tmp_text) ak_tmp_text='&lt;a&gt;&lt;text'
ak_newNodeText+=';font-size:24">'+ak_tmp_text+'</text>'
if(wohin=="insert") ak_insertBeforeSP(ak_newNode,ak_object2update)
else if(wohin=="add2Parent") ak_appendChildSP(ak_newNode,ak_object2update.parentNode)
else if(wohin=="append") ak_appendChildSP(ak_newNode,ak_object2update)
else ak_appendChildSP(ak_newNode,ak_userspace_svg)
ak_appendChildSP(ak_newNodeText,document.getElementById(ak_tmp_id_rest))
if(!ak_autoId) {document.getElementById(ak_tmp_id_rest).removeAttribute("id")}
ak_tmp_object=document.getElementById(ak_tmp_id_rest2)
break
case "g":
ak_tmp_id_rest=ak_generate_id(evt,"g_")
ak_tmp_id_rest2=ak_generate_id(evt,false,ak_tmp_id_rest.replace(/^g/,"text"))
ak_newNode='<g id="'+ak_tmp_id_rest+'"/>'
var ak_newNodeText='<text id="'+ak_tmp_id_rest2+'" x="'+ak_tmp_x+'" y="'+ak_tmp_y
ak_newNodeText+='" style="fill:'+ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")
ak_newNodeText+=';font-size:24">&lt;g>&lt;text</text>'
if(wohin=="insert") ak_insertBeforeSP(ak_newNode,ak_object2update)
else if(wohin=="add2Parent") ak_appendChildSP(ak_newNode,ak_object2update.parentNode)
else if(wohin=="append") ak_appendChildSP(ak_newNode,ak_object2update)
else ak_appendChildSP(ak_newNode,ak_userspace_svg)
ak_appendChildSP(ak_newNodeText,document.getElementById(ak_tmp_id_rest))
if(!ak_autoId) {document.getElementById(ak_tmp_id_rest).removeAttribute("id")}
ak_tmp_object=document.getElementById(ak_tmp_id_rest2)
break
case "flowtext":
var ak_tmp_clipboard=""
while(true)
{
try{ak_tmp_clipboard=top.clipboardData.getData("text");break}
catch(err){}
}
if(!ak_tmp_clipboard)
{
ak_alert("No text on Clipboard!")
break
}
ak_tmp_clipboard=ak_tmp_clipboard.replace(/\r\n/g,"\n")
if(/\n/.test(ak_tmp_clipboard)) ak_tmp_clipboard=ak_tmp_clipboard.split("\n")
else ak_tmp_clipboard=new Array(ak_tmp_clipboard)
if(ak_tmp_clipboard.length>1000)
{
ak_alert(ak_tmp_clipboard.length+" text lines found on clipboard!\nGroup <text ... is aborting (max. 1000)!")
return
}
else if(ak_tmp_clipboard.length>100)
{
if(!confirm(ak_tmp_clipboard.length+" text lines found on clipboard!\nYou still want to create grouped elements?")) return
}
ak_tmp_id_rest=ak_generate_id(evt,"g_")
ak_newNode='<g id="'+ak_tmp_id_rest
ak_newNode+='" style="fill:'+ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")
ak_newNode+=';font-size:12" xml:space="preserve"/>'
if(wohin=="insert") ak_insertBeforeSP(ak_newNode,ak_object2update)
else if(wohin=="add2Parent") ak_appendChildSP(ak_newNode,ak_object2update.parentNode)
else if(wohin=="append") ak_appendChildSP(ak_newNode,ak_object2update)
else ak_appendChildSP(ak_newNode,ak_userspace_svg)
ak_tmp_object=document.getElementById(ak_tmp_id_rest)
for(var i=0;i<ak_tmp_clipboard.length;i++)
{
ak_tmp_clipboard[i]=ak_tmp_clipboard[i].replace(/ +$/,"")
ak_tmp_object.appendChild(parseXML('<text x="'+ak_tmp_x+'" y="'+(ak_tmp_y+(15*i))+'"> </text>',document).firstChild)
ak_tmp_object.lastChild.firstChild.data=ak_tmp_clipboard[i]
}
ak_nice_tabs(ak_tmp_object)
break
case "parentASelect":
ak_io_wait_active=true
ak_imageX=ak_tmp_x
ak_imageY=ak_tmp_y
ak_imageWohin=wohin
ak_fileSelectSuccess="ak_dialogSuccess(evt,'parentACreate')"
ak_fileSelectCancel=""
ak_SVGSaver('fileSelect')
return
case "parentG":
ak_append2undo()
ak_tmp_id_rest=ak_generate_id(evt,"g_")
ak_create_parentNode('<g id="'+ak_tmp_id_rest+'"/>',ak_object2update)
ak_tmp_object=document.getElementById(ak_tmp_id_rest)
ak_push2undoTrue()
break
case "parentA":
ak_tmp_id_rest=ak_generate_id(evt,"a_")
var ak_tmp_link=prompt("Enter xlink:href!","http://")
window.focus(ak_svgroot)
if(ak_tmp_link==null) return
ak_append2undo()
ak_tmp_link=ak_tmp_link.replace(/^ +| +$/,'')
ak_create_parentNode('<a id="'+ak_tmp_id_rest+'" xlink:href="'+ak_tmp_link+'"/>',ak_object2update)
ak_tmp_object=document.getElementById(ak_tmp_id_rest)
ak_push2undoTrue()
break
case "svg":
ak_tmp_id_rest=ak_generate_id(evt,"svg_")
ak_newNode='<svg id="'+ak_tmp_id_rest+'" x="'+ak_tmp_x+'" y="'+ak_tmp_y+'" width="'+100+'" height="'+100+'"/>'
if(wohin=="insert") ak_insertBeforeSP(ak_newNode,ak_object2update)
else if(wohin=="add2Parent") ak_appendChildSP(ak_newNode,ak_object2update.parentNode)
else if(wohin=="append") ak_appendChildSP(ak_newNode,ak_object2update)
else ak_appendChildSP(ak_newNode,ak_userspace_svg)
ak_tmp_object=document.getElementById(ak_tmp_id_rest)
break
case "defs":
ak_tmp_id_rest=ak_generate_id(evt,"defs_")
//ak_tmp_id_rest=ak_promptForId("Enter Id!",ak_tmp_id_rest); if(!ak_tmp_id_rest) return
ak_newNode='<defs id="'+ak_tmp_id_rest+'"/>'
if(wohin=="insert") ak_insertBeforeSP(ak_newNode,ak_object2update)
else if(wohin=="add2Parent") ak_appendChildSP(ak_newNode,ak_object2update.parentNode)
else if(wohin=="append") ak_appendChildSP(ak_newNode,ak_object2update)
else ak_appendChildSP(ak_newNode,ak_userspace_svg)
ak_tmp_object=document.getElementById(ak_tmp_id_rest)
break
case "symbol":
ak_tmp_id_rest=ak_generate_id(evt,"symbol_")
ak_tmp_id_rest=ak_promptForId("Enter Id!",ak_tmp_id_rest); if(!ak_tmp_id_rest) return
ak_newNode='<symbol id="'+ak_tmp_id_rest+'"/>'
var ak_tmp_symbol=ak_appendChildSP(ak_newNode,ak_userspace_svg)
var ak_newNodeText='<text x="'+ak_tmp_x+'" y="'+ak_tmp_y
ak_newNodeText+='" style="fill:'+ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")
ak_newNodeText+=';font-size:24">in &lt;symbol id="'+ak_tmp_id_rest+'"</text>'
ak_tmp_symbol=ak_appendChildSP(ak_newNodeText,ak_tmp_symbol)
ak_appendChildSP('<use xlink:href="#'+ak_tmp_id_rest+'"/>',ak_userspace_svg)
ak_clickset_obj2update(evt,ak_tmp_symbol)
return
case "marker_end":
ak_tmp_id_rest=ak_generate_id(evt,"marker_")
ak_tmp_id_rest2=ak_generate_id(evt,false,ak_tmp_id_rest.replace(/^(marker)/,"path"))
ak_tmp_id_rest=ak_promptForId("Enter Id!",ak_tmp_id_rest); if(!ak_tmp_id_rest) return
ak_newNode='<marker id="'+ak_tmp_id_rest+'" markerWidth="10" markerHeight="10" refX="7" refY="5" orient="auto" style="fill:none;stroke:'+ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")+'"/>'
ak_appendChildSP(ak_newNode,ak_userspace_svg,"marker")
ak_newNode='<path id="'+ak_tmp_id_rest2+'" d="M 2 3 L 7 5 L 2 7"/>'
ak_appendChildSP(ak_newNode,document.getElementById(ak_tmp_id_rest))
ak_grid_zoom=8
ak_grid_pan_x=5
ak_grid_pan_y=5
document.getElementById("ak_internal_userSpace").setAttribute("transform",("matrix("+ak_grid_zoom+",0,0,"+ak_grid_zoom+","+(21+ak_grid_pan_x*ak_grid_zoom)+","+(21+ak_grid_pan_y*ak_grid_zoom)+")"))
ak_userspace_svg.firstChild.setAttribute("style",ak_userspace_svg.firstChild.getAttribute("style"))
ak_write_grid_status(((ak_grid_pan_x*-1)+","+(ak_grid_pan_y*-1)+" | x"+ak_grid_zoom+" | "+ak_grid_on_flag))
ak_clickset_obj2update(evt,document.getElementById(ak_tmp_id_rest))
if(!ak_autoId) {document.getElementById(ak_tmp_id_rest2).removeAttribute("id")}
return
case "marker_start":
ak_tmp_id_rest=ak_generate_id(evt,"marker_")
ak_tmp_id_rest2=ak_generate_id(evt,false,ak_tmp_id_rest.replace(/^(marker)/,"path"))
ak_tmp_id_rest=ak_promptForId("Enter Id!",ak_tmp_id_rest); if(!ak_tmp_id_rest) return
ak_newNode='<marker id="'+ak_tmp_id_rest+'" markerWidth="10" markerHeight="10" refX="2" refY="5" orient="auto" style="fill:none;stroke:'+ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")+'"/>'
ak_appendChildSP(ak_newNode,ak_userspace_svg,"marker")
ak_newNode='<path id="'+ak_tmp_id_rest2+'" d="M 7 3 L 2 5 L 7 7"/>'
ak_appendChildSP(ak_newNode,document.getElementById(ak_tmp_id_rest))
ak_grid_zoom=8
ak_grid_pan_x=5
ak_grid_pan_y=5
document.getElementById("ak_internal_userSpace").setAttribute("transform",("matrix("+ak_grid_zoom+",0,0,"+ak_grid_zoom+","+(21+ak_grid_pan_x*ak_grid_zoom)+","+(21+ak_grid_pan_y*ak_grid_zoom)+")"))
ak_userspace_svg.firstChild.setAttribute("style",ak_userspace_svg.firstChild.getAttribute("style"))
ak_write_grid_status(((ak_grid_pan_x*-1)+","+(ak_grid_pan_y*-1)+" | x"+ak_grid_zoom+" | "+ak_grid_on_flag))
ak_clickset_obj2update(evt,document.getElementById(ak_tmp_id_rest))
if(!ak_autoId) {document.getElementById(ak_tmp_id_rest2).removeAttribute("id")}
return
case "clipPath":
ak_tmp_id_rest=ak_generate_id(evt,"clipPath_")
ak_tmp_id_rest=ak_promptForId("Enter Id!",ak_tmp_id_rest); if(!ak_tmp_id_rest) return
ak_newNode='<clipPath id="'+ak_tmp_id_rest+'"/>'
ak_appendChildSP(ak_newNode,ak_userspace_svg,"clipPath")
ak_clickset_obj2update(evt,document.getElementById(ak_tmp_id_rest))
return
case "text":
ak_tmp_id_rest=ak_generate_id(evt,"text_")
var ak_tmp_text=prompt("Enter text-data!","text")
window.focus(ak_svgroot)
if(!ak_tmp_text) return
while(ak_object2update=="[object SVGTextPathElement]" || ak_object2update=="[object SVGTSpanElement]" || ak_object2update=="[object SVGTRefElement]")
{
ak_object2update=ak_object2update.parentNode
}
ak_tmp_text=ak_tmp_text.replace(/</g,"&lt;")
ak_tmp_text=ak_tmp_text.replace(/>/g,"&gt;")
ak_newNode='<text id="'+ak_tmp_id_rest+'" x="'+ak_tmp_x+'" y="'+ak_tmp_y
ak_newNode+='" style="fill:'+ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")
ak_newNode+=';font-size:48">'+ak_tmp_text+'</text>'
if(wohin=="insert") ak_insertBeforeSP(ak_newNode,ak_object2update)
else if(wohin=="add2Parent") ak_appendChildSP(ak_newNode,ak_object2update.parentNode)
else if(wohin=="append") ak_appendChildSP(ak_newNode,ak_object2update)
else ak_appendChildSP(ak_newNode,ak_userspace_svg)
ak_tmp_object=document.getElementById(ak_tmp_id_rest)
break
case "textLines":
var ak_tmp_lines=prompt("Enter number of lines (100 max)!","10")
window.focus(ak_svgroot)
if(!ak_tmp_lines) return
ak_tmp_lines=parseInt(ak_tmp_lines)
if(isNaN(ak_tmp_lines) || ak_tmp_lines>100 || ak_tmp_lines<1) return
case "textPath":
ak_tmp_id_rest=ak_generate_id(evt,"path_")
ak_tmp_id_rest2=ak_generate_id(evt,false,ak_tmp_id_rest.replace(/^(path)/,"text"))
ak_tmp_id_rest3=ak_generate_id(evt,false,ak_tmp_id_rest.replace(/^(path)/,"textPath"))
if(ak_tmp_lines) var ak_tmp_text=prompt("Enter text-data!",'xml:space="preserve",           text for '+ak_tmp_lines+' lines!')
else var ak_tmp_text=prompt("Enter text-data!","Path_text")
window.focus(ak_svgroot)
if(!ak_tmp_text) return
ak_tmp_id_rest=ak_promptForId("Enter <path Id!",ak_tmp_id_rest); if(!ak_tmp_id_rest) return
while(ak_object2update=="[object SVGTextPathElement]" || ak_object2update=="[object SVGTSpanElement]" || ak_object2update=="[object SVGTRefElement]")
{
ak_object2update=ak_object2update.parentNode
}
var ak_tmp_color=ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")
var ak_tmp_length=ak_tmp_text.length<9?150:ak_tmp_text.length*17
ak_tmp_text=ak_tmp_text.replace(/</g,"&lt;")
ak_tmp_text=ak_tmp_text.replace(/>/g,"&gt;")
window.focus(ak_svgroot)
ak_newNode='<path id="'+ak_tmp_id_rest+'" style="fill:none;stroke:'+ak_tmp_color+'" d="M '+ak_tmp_x+" "+ak_tmp_y
if(ak_tmp_lines)
{
ak_newNode+=" L "+(ak_tmp_x+157)+" "+ak_tmp_y
for(var i=0;i<ak_tmp_lines;i++)
{
ak_tmp_y+=16
ak_newNode+=" M "+ak_tmp_x+" "+ak_tmp_y+" L "+(ak_tmp_x+157)+" "+ak_tmp_y
}
ak_newNode+='"/>'
var ak_newNodeTextP='<textPath id="'+ak_tmp_id_rest3+'" xlink:href="#'+ak_tmp_id_rest
ak_newNodeTextP+='" startOffset="0" xml:space="preserve" style="fill:'+ak_tmp_color
ak_newNodeTextP+=';font-size:12">'+ak_tmp_text+'</textPath>'
}
else
{
ak_newNode+=" C "+(ak_tmp_x+50)+" "+(ak_tmp_y-50)+" "+(ak_tmp_x+ak_tmp_length-50)+" "+(ak_tmp_y+50)+" "+(ak_tmp_x+ak_tmp_length)+" "+(ak_tmp_y)+'"/>'
var ak_newNodeTextP='<textPath id="'+ak_tmp_id_rest3+'" xlink:href="#'+ak_tmp_id_rest
ak_newNodeTextP+='" startOffset="'+(ak_tmp_length/2)+'" style="fill:'+ak_tmp_color
ak_newNodeTextP+=';font-size:24;text-anchor:middle">'+ak_tmp_text+'</textPath>'
}
var ak_newNodeText='<text id="'+ak_tmp_id_rest2+'"/>'
if(wohin=="insert")
{
ak_insertBeforeSP(ak_newNode,ak_object2update)
ak_insertBeforeSP(ak_newNodeText,ak_object2update)
}
else if(wohin=="add2Parent")
{
ak_appendChildSP(ak_newNode,ak_object2update.parentNode)
ak_appendChildSP(ak_newNodeText,ak_object2update.parentNode)
}
else if(wohin=="append")
{
ak_appendChildSP(ak_newNode,ak_object2update)
ak_appendChildSP(ak_newNodeText,ak_object2update)
}
else
{
ak_appendChildSP(ak_newNode,ak_userspace_svg)
ak_appendChildSP(ak_newNodeText,ak_userspace_svg)
}
ak_appendChildSP(ak_newNodeTextP,document.getElementById(ak_tmp_id_rest2))
ak_clickset_obj2update(evt,document.getElementById(ak_tmp_id_rest))
if(!ak_autoId) {document.getElementById(ak_tmp_id_rest2).removeAttribute("id")}
if(!ak_autoId) {document.getElementById(ak_tmp_id_rest3).removeAttribute("id")}
return
case "line":
ak_tmp_id_rest=ak_generate_id(evt,"line_")
ak_newNode='<line id="'+ak_tmp_id_rest+'" x1="'+ak_tmp_x+'" y1="'+ak_tmp_y+'" x2="'+(ak_tmp_x+100)+'" y2="'+(ak_tmp_y)
ak_newNode+='" style="stroke:'+ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")
ak_newNode+=';stroke-width:2"/>'
if(wohin=="insert") ak_insertBeforeSP(ak_newNode,ak_object2update)
else if(wohin=="add2Parent") ak_appendChildSP(ak_newNode,ak_object2update.parentNode)
else if(wohin=="append") ak_appendChildSP(ak_newNode,ak_object2update)
else ak_appendChildSP(ak_newNode,ak_userspace_svg)
ak_tmp_object=document.getElementById(ak_tmp_id_rest)
break
case "rect":
ak_tmp_id_rest=ak_generate_id(evt,"rect_")
ak_newNode='<rect id="'+ak_tmp_id_rest+'" x="'+ak_tmp_x+'" y="'+ak_tmp_y+'" width="'+100+'" height="'+100
ak_newNode+=ak_tmp_style
ak_newNode+='"/>'
if(wohin=="insert") ak_insertBeforeSP(ak_newNode,ak_object2update)
else if(wohin=="add2Parent") ak_appendChildSP(ak_newNode,ak_object2update.parentNode)
else if(wohin=="append") ak_appendChildSP(ak_newNode,ak_object2update)
else ak_appendChildSP(ak_newNode,ak_userspace_svg)
ak_tmp_object=document.getElementById(ak_tmp_id_rest)
break
case "rectBackground":
ak_append2undo()
ak_tmp_id_rest=ak_generate_id(evt,"rect_")
ak_newNode='<rect id="'+ak_tmp_id_rest+'" x="0" y="0" width="100%" height="100%'
if(/^#/.test(ak_grid_what)) ak_newNode+='" style="fill:url('+ak_grid_what+')'
else ak_newNode+='" style="fill:'+ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")
ak_newNode+='"/>'
var ak_tmp_child=ak_userspace_svg.childNodes
if(ak_tmp_child.length==0)
{
ak_newNode="<g>\n  "+ak_newNode+"\n</g>"
var ak_tmp_object=parseXML(ak_newNode,document).firstChild
ak_userspace_svg.appendChild(ak_tmp_object.firstChild)
ak_userspace_svg.appendChild(ak_tmp_object.firstChild)
ak_userspace_svg.appendChild(ak_tmp_object.firstChild)
}
else
{
var ak_tmp_append=true
for(var i=0;i<ak_tmp_child.length;i++)
{
if(/^\[object SVG/.test(ak_tmp_child.item(i)) &&ak_which_nodeNr(ak_tmp_child.item(i))!=0)
{
if(ak_tmp_child.item(i).tagName!='script' && ak_tmp_child.item(i).tagName!='defs')
{
if(/^\[object Text/.test(ak_tmp_child.item(i-1)))  i--
ak_tmp_append=false
break
}
}
}
if(ak_tmp_append && /^\[object Text/.test(ak_userspace_svg.lastChild))
{
ak_newNode="<g>\n  "+ak_newNode+"</g>"
var ak_tmp_object=parseXML(ak_newNode,document).firstChild
ak_userspace_svg.insertBefore(ak_tmp_object.firstChild,ak_userspace_svg.lastChild)
ak_userspace_svg.insertBefore(ak_tmp_object.firstChild,ak_userspace_svg.lastChild)
}
else if(ak_tmp_append)
{
ak_newNode="<g>\n  "+ak_newNode+"\n</g>"
var ak_tmp_object=parseXML(ak_newNode,document).firstChild
ak_userspace_svg.appendChild(ak_tmp_object.firstChild)
ak_userspace_svg.appendChild(ak_tmp_object.firstChild)
ak_userspace_svg.appendChild(ak_tmp_object.firstChild)
}
else
{
ak_newNode="<g>\n  "+ak_newNode+"</g>"
var ak_tmp_object=parseXML(ak_newNode,document).firstChild
ak_userspace_svg.insertBefore(ak_tmp_object.lastChild,ak_tmp_child.item(i))
ak_userspace_svg.insertBefore(ak_tmp_object.lastChild,ak_tmp_child.item(i))
}
}
ak_push2undoTrue()
ak_grid_on_off(evt,"off")
ak_tmp_object=document.getElementById(ak_tmp_id_rest)
break
case "use":
ak_tmp_id_rest=ak_generate_id(evt,"use_")
if(/6.0x38363$/.test(getSVGViewerVersion()))
{ak_newNode='<use id="'+ak_tmp_id_rest+'" xlink:href="'+wohin+'" onmousedown="ak_MoveEditRect_flag=true;ak_clickset_obj2update(evt);"/>'}
else ak_newNode='<use id="'+ak_tmp_id_rest+'" xlink:href="'+wohin+'"/>'
ak_appendChildSP(ak_newNode,ak_userspace_svg)
ak_tmp_object=document.getElementById(ak_tmp_id_rest)
break
case "imageBase64":
ak_feImage=false
ak_io_wait_active=true
ak_imageX=ak_tmp_x
ak_imageY=ak_tmp_y
ak_imageWohin=wohin
ak_imageBase64=true
setTimeout("ak_SVGSaver('image')",100)
return
case "image":
ak_feImage=false
ak_io_wait_active=true
ak_imageX=ak_tmp_x
ak_imageY=ak_tmp_y
ak_imageWohin=wohin
ak_imageBase64=false
setTimeout("ak_SVGSaver('image')",100)
return
case "imageManually":
var ak_tmp_file=prompt("Enter Image file-name:","")
window.focus(ak_svgroot)
if(!ak_tmp_file) break
var ak_tmp_wh=prompt("Enter Image width height:","100 100")
window.focus(ak_svgroot)
if(!ak_tmp_wh) break
ak_tmp_wh=ak_tmp_wh.replace(/[^eE\d\.\+\-]/g," ")
ak_tmp_wh=ak_tmp_wh.replace(/ +/g," ")
ak_tmp_wh=ak_tmp_wh.replace(/^ *| *$/g,"")
var ak_tmp_array=ak_tmp_wh.split(" ")
var ak_tmp_w=isNaN(ak_tmp_array[0])?100:parseInt(ak_tmp_array[0])
var ak_tmp_h=isNaN(ak_tmp_array[1])?100:parseInt(ak_tmp_array[1])
ak_tmp_w=ak_tmp_w<0?1:ak_tmp_w
ak_tmp_h=ak_tmp_h<0?1:ak_tmp_h
ak_tmp_id_rest=ak_generate_id(evt,"image_")
ak_newNode='<image id="'+ak_tmp_id_rest+'" x="'+ak_tmp_x+'" y="'+ak_tmp_y+'" width="'+ak_tmp_w+'" height="'+ak_tmp_h
ak_newNode+='" xlink:href="'+ak_tmp_file+'"/>'
if(wohin=="insert") ak_insertBeforeSP(ak_newNode,ak_object2update)
else if(wohin=="add2Parent") ak_appendChildSP(ak_newNode,ak_object2update.parentNode)
else if(wohin=="append") ak_appendChildSP(ak_newNode,ak_object2update)
else ak_appendChildSP(ak_newNode,ak_userspace_svg)
ak_tmp_object=document.getElementById(ak_tmp_id_rest)
break
case "circle":
ak_tmp_id_rest=ak_generate_id(evt,"circle_")
ak_newNode='<circle id="'+ak_tmp_id_rest+'" cx="'+ak_tmp_x+'" cy="'+ak_tmp_y+'" r="'+50
ak_newNode+=ak_tmp_style
ak_newNode+='"/>'
if(wohin=="insert") ak_insertBeforeSP(ak_newNode,ak_object2update)
else if(wohin=="add2Parent") ak_appendChildSP(ak_newNode,ak_object2update.parentNode)
else if(wohin=="append") ak_appendChildSP(ak_newNode,ak_object2update)
else ak_appendChildSP(ak_newNode,ak_userspace_svg)
ak_tmp_object=document.getElementById(ak_tmp_id_rest)
break
case "ellipse":
ak_tmp_id_rest=ak_generate_id(evt,"ellipse_")
ak_newNode='<ellipse id="'+ak_tmp_id_rest+'" cx="'+ak_tmp_x+'" cy="'+ak_tmp_y+'" rx="'+50+'" ry="'+25
ak_newNode+=ak_tmp_style
ak_newNode+='"/>'
if(wohin=="insert") ak_insertBeforeSP(ak_newNode,ak_object2update)
else if(wohin=="add2Parent") ak_appendChildSP(ak_newNode,ak_object2update.parentNode)
else if(wohin=="append") ak_appendChildSP(ak_newNode,ak_object2update)
else ak_appendChildSP(ak_newNode,ak_userspace_svg)
ak_tmp_object=document.getElementById(ak_tmp_id_rest)
break
case "path":
ak_hide_pathPoints=false
ak_tmp_id_rest=ak_generate_id(evt,"path_")
ak_newNode='<path id="'+ak_tmp_id_rest+'" d="M '+ak_tmp_x+" "+ak_tmp_y
ak_newNode+=ak_tmp_style
ak_newNode+='"/>'
if(wohin=="insert") ak_insertBeforeSP(ak_newNode,ak_object2update)
else if(wohin=="add2Parent") ak_appendChildSP(ak_newNode,ak_object2update.parentNode)
else if(wohin=="append") ak_appendChildSP(ak_newNode,ak_object2update)
else ak_appendChildSP(ak_newNode,ak_userspace_svg)
ak_tmp_object=document.getElementById(ak_tmp_id_rest)
break
case "pathSquare":
ak_hide_pathPoints=false
ak_tmp_id_rest=ak_generate_id(evt,"path_")
ak_newNode='<path id="'+ak_tmp_id_rest+'" d="M '+ak_tmp_x+" "+ak_tmp_y
ak_newNode+=" l 100 0 0 100 -100 0 0 -100"
ak_newNode+=ak_tmp_style
ak_newNode+='"/>'
if(wohin=="insert") ak_insertBeforeSP(ak_newNode,ak_object2update)
else if(wohin=="add2Parent") ak_appendChildSP(ak_newNode,ak_object2update.parentNode)
else if(wohin=="append") ak_appendChildSP(ak_newNode,ak_object2update)
else ak_appendChildSP(ak_newNode,ak_userspace_svg)
ak_tmp_object=document.getElementById(ak_tmp_id_rest)
break
case "pathCircle":
ak_hide_pathPoints=false
ak_tmp_id_rest=ak_generate_id(evt,"path_")
ak_newNode='<path id="'+ak_tmp_id_rest+'" d="M '+ak_tmp_x+" "+(ak_tmp_y-50)
ak_newNode+=" c 27.6 0 50 22.4 50 50 c 0 27.6 -22.4 50 -50 50 c -27.6 0 -50 -22.4 -50 -50 c 0 -27.6 22.4 -50 50 -50"
ak_newNode+=ak_tmp_style
ak_newNode+='"/>'
if(wohin=="insert") ak_insertBeforeSP(ak_newNode,ak_object2update)
else if(wohin=="add2Parent") ak_appendChildSP(ak_newNode,ak_object2update.parentNode)
else if(wohin=="append") ak_appendChildSP(ak_newNode,ak_object2update)
else ak_appendChildSP(ak_newNode,ak_userspace_svg)
ak_tmp_object=document.getElementById(ak_tmp_id_rest)
break
case "pathPolygon":
var ak_tmp_param=prompt("Enter [ segments ]  [ l  c  q  mm  ml  ...  mm2  ml2  ... ]  [ d1 ]  [ d2 ] e.g.:\n3 (= triangle w/ lines), 5 c 50 (= star diameter_1=50 diameter_2=default 100)","3")
window.focus(ak_svgroot)
if(!ak_tmp_param) break
ak_hide_pathPoints=false
ak_tmp_param=ak_tmp_param.toLowerCase()
ak_tmp_param=ak_tmp_param.replace(/ +/g," ")
ak_tmp_param=ak_tmp_param.replace(/^ *| *$/g,"")
var ak_tmp_array=ak_tmp_param.split(" ")
ak_tmp_array[0]=parseInt(ak_tmp_array[0])
if(isNaN(ak_tmp_array[0]) || ak_tmp_array[0]<1) ak_tmp_array[0]=1
if(ak_tmp_array[0]>ak_segment_max)
{
ak_alert(ak_segment_max+" segments maximum!")
ak_tmp_array[0]=ak_segment_max
}
if(!ak_tmp_array[1]) ak_tmp_array.splice(1,0,'l')
if(isNaN(parseFloat(ak_tmp_array[1])))
{
switch(ak_tmp_array[1])
{
case "l":
case "c":
case "q":
case "mm":
case "ml":
case "mc":
case "mq":
case "mm2":
case "ml2":
case "mc2":
case "mq2":
break
default:
ak_tmp_array[1]='l'
break
}
}
else ak_tmp_array.splice(1,0,'l')
switch(ak_tmp_array[1])
{
case "mm":
case "ml":
case "mc":
case "mq":
if(ak_tmp_array[0]<2) ak_tmp_array[0]=2
}
switch(ak_tmp_array[1])
{
case "l":
case "c":
case "q":
if(ak_tmp_array[0]<3) ak_tmp_array[0]=3
}
ak_path=false
switch(ak_tmp_array[1])
{
case "ml2":
case "mc2":
case "mq2":
case "mm2":
ak_path=ak_tmp_array[0]+';'+ak_tmp_array[1]+';'
ak_tmp_array[0]*=2
case "mm":
case "ml":
case "mc":
case "mq":
if(!ak_tmp_array[2]) ak_tmp_array[2]=130
if(!ak_tmp_array[3]) ak_tmp_array[3]=100
if(!ak_path) ak_path=ak_tmp_array[0]+';'+ak_tmp_array[1]+';'
}
if(ak_tmp_array[2])
{
ak_tmp_array[2]=parseFloat(ak_tmp_array[2])
ak_tmp_array[2]=isNaN(ak_tmp_array[2])?50:ak_tmp_array[2]
ak_tmp_array[2]=ak_tmp_array[2]<0?0:ak_tmp_array[2]
if(!ak_tmp_array[3]) ak_tmp_array[3]=100
else
{
ak_tmp_array[3]=parseFloat(ak_tmp_array[3])
ak_tmp_array[3]=isNaN(ak_tmp_array[3])?100:ak_tmp_array[3]
ak_tmp_array[3]=ak_tmp_array[3]<0?0:ak_tmp_array[3]
}
}
ak_tmp_id_rest=ak_generate_id(evt,"path_")
if(ak_tmp_array[3]) ak_tmp_y=Math.round(ak_tmp_y-(ak_tmp_array[3]/2))
else ak_tmp_y-=50
ak_newNode='<path id="'+ak_tmp_id_rest+'" d="M '+ak_tmp_x+" "+ak_tmp_y
if(ak_path) ak_path+='M 0 '+ak_round((-ak_tmp_array[3]/2),ak_precision)
var ak_tmp_point=ak_svgroot.createSVGPoint()
var ak_tmp_matrix
var ak_tmp_xb=ak_tmp_x, ak_tmp_yb=ak_tmp_y, ak_tmp_xc, ak_tmp_yc
if(ak_tmp_array.length==2)
{
for(var i=1;i<=ak_tmp_array[0];i++)
{
ak_tmp_matrix=ak_svgroot.createSVGMatrix()
ak_tmp_matrix=ak_tmp_matrix.rotate((i/ak_tmp_array[0])*360)
ak_tmp_point.x=0; ak_tmp_point.y=-50
ak_tmp_point=ak_tmp_point.matrixTransform(ak_tmp_matrix)
if(ak_tmp_array[1]=='c')
{
ak_tmp_xc=ak_round(ak_tmp_point.x+ak_tmp_x,ak_precision)
ak_tmp_yc=ak_round(ak_tmp_point.y+ak_tmp_y+50,ak_precision)
ak_newNode+=' C '+ak_round(((ak_tmp_xc-ak_tmp_xb)/3)+ak_tmp_xb,ak_precision)+' '+ak_round(((ak_tmp_yc-ak_tmp_yb)/3)+ak_tmp_yb,ak_precision)
ak_newNode+=' '+ak_round((2*(ak_tmp_xc-ak_tmp_xb)/3)+ak_tmp_xb,ak_precision)+' '+ak_round((2*(ak_tmp_yc-ak_tmp_yb)/3)+ak_tmp_yb,ak_precision)
ak_newNode+=' '+ak_tmp_xc+' '+ak_tmp_yc
ak_tmp_xb=ak_tmp_xc
ak_tmp_yb=ak_tmp_yc
}
else if(ak_tmp_array[1]=='q')
{
ak_tmp_xc=ak_round(ak_tmp_point.x+ak_tmp_x,ak_precision)
ak_tmp_yc=ak_round(ak_tmp_point.y+ak_tmp_y+50,ak_precision)
ak_newNode+=' Q '+ak_round(((ak_tmp_xc-ak_tmp_xb)/2)+ak_tmp_xb,ak_precision)+' '+ak_round(((ak_tmp_yc-ak_tmp_yb)/2)+ak_tmp_yb,ak_precision)
ak_newNode+=' '+ak_tmp_xc+' '+ak_tmp_yc
ak_tmp_xb=ak_tmp_xc
ak_tmp_yb=ak_tmp_yc
}
else
{
ak_newNode+=' L '+ak_round(ak_tmp_point.x+ak_tmp_x,ak_precision)+' '+ak_round(ak_tmp_point.y+ak_tmp_y+50,ak_precision)
}
}
}
else
{
for(var i=1;i<=ak_tmp_array[0];i++)
{
ak_tmp_matrix=ak_svgroot.createSVGMatrix()
ak_tmp_matrix=ak_tmp_matrix.rotate(((2*i-1)/(ak_tmp_array[0]*2))*360)
ak_tmp_point.x=0; ak_tmp_point.y=-ak_tmp_array[2]/2
ak_tmp_point=ak_tmp_point.matrixTransform(ak_tmp_matrix)
if(/c/.test(ak_tmp_array[1]))
{
ak_tmp_xc=ak_round(ak_tmp_point.x+ak_tmp_x,ak_precision)
ak_tmp_yc=ak_round(ak_tmp_point.y+ak_tmp_y+(ak_tmp_array[3]/2),ak_precision)
ak_newNode+=' C '+ak_round(((ak_tmp_xc-ak_tmp_xb)/3)+ak_tmp_xb,ak_precision)+' '+ak_round(((ak_tmp_yc-ak_tmp_yb)/3)+ak_tmp_yb,ak_precision)
ak_newNode+=' '+ak_round((2*(ak_tmp_xc-ak_tmp_xb)/3)+ak_tmp_xb,ak_precision)+' '+ak_round((2*(ak_tmp_yc-ak_tmp_yb)/3)+ak_tmp_yb,ak_precision)
ak_newNode+=' '+ak_tmp_xc+' '+ak_tmp_yc
if(i==1 && ak_path)
{
ak_tmp_xb=0
ak_tmp_yb=-ak_tmp_array[3]/2
ak_path+=' C '+ak_round(((ak_tmp_point.x-ak_tmp_xb)/3)+ak_tmp_xb,ak_precision)+' '+ak_round(((ak_tmp_point.y-ak_tmp_yb)/3)+ak_tmp_yb,ak_precision)
ak_path+=' '+ak_round((2*(ak_tmp_point.x-ak_tmp_xb)/3)+ak_tmp_xb,ak_precision)+' '+ak_round((2*(ak_tmp_point.y-ak_tmp_yb)/3)+ak_tmp_yb,ak_precision)
var ak_tmp_pathX=ak_round(ak_tmp_point.x,ak_precision)
var ak_tmp_pathY=ak_round(ak_tmp_point.y,ak_precision)
ak_path+=' '+ak_tmp_pathX+' '+ak_tmp_pathY
}
ak_tmp_xb=ak_tmp_xc
ak_tmp_yb=ak_tmp_yc
}
else if(/q/.test(ak_tmp_array[1]))
{
ak_tmp_xc=ak_round(ak_tmp_point.x+ak_tmp_x,ak_precision)
ak_tmp_yc=ak_round(ak_tmp_point.y+ak_tmp_y+(ak_tmp_array[3]/2),ak_precision)
ak_newNode+=' Q '+ak_round(((ak_tmp_xc-ak_tmp_xb)/2)+ak_tmp_xb,ak_precision)+' '+ak_round(((ak_tmp_yc-ak_tmp_yb)/2)+ak_tmp_yb,ak_precision)
ak_newNode+=' '+ak_tmp_xc+' '+ak_tmp_yc
if(i==1 && ak_path)
{
ak_tmp_xb=0
ak_tmp_yb=-ak_tmp_array[3]/2
ak_path+=' Q '+ak_round(((ak_tmp_point.x-ak_tmp_xb)/2)+ak_tmp_xb,ak_precision)+' '+ak_round(((ak_tmp_point.y-ak_tmp_yb)/2)+ak_tmp_yb,ak_precision)
var ak_tmp_pathX=ak_round(ak_tmp_point.x,ak_precision)
var ak_tmp_pathY=ak_round(ak_tmp_point.y,ak_precision)
ak_path+=' '+ak_tmp_pathX+' '+ak_tmp_pathY
}
ak_tmp_xb=ak_tmp_xc
ak_tmp_yb=ak_tmp_yc
}
else
{
ak_newNode+=' L '+ak_round(ak_tmp_point.x+ak_tmp_x,ak_precision)+' '+ak_round(ak_tmp_point.y+ak_tmp_y+(ak_tmp_array[3]/2),ak_precision)
if(i==1 && ak_path)
{
ak_path+=' L '+ak_round(ak_tmp_point.x,ak_precision)+' '+ak_round(ak_tmp_point.y,ak_precision)
}
}
ak_tmp_matrix=ak_svgroot.createSVGMatrix()
ak_tmp_matrix=ak_tmp_matrix.rotate((i/ak_tmp_array[0])*360)
ak_tmp_point.x=0; ak_tmp_point.y=-ak_tmp_array[3]/2
ak_tmp_point=ak_tmp_point.matrixTransform(ak_tmp_matrix)
if(/c/.test(ak_tmp_array[1]))
{
ak_tmp_xc=ak_round(ak_tmp_point.x+ak_tmp_x,ak_precision)
ak_tmp_yc=ak_round(ak_tmp_point.y+ak_tmp_y+(ak_tmp_array[3]/2),ak_precision)
ak_newNode+=' C '+ak_round(((ak_tmp_xc-ak_tmp_xb)/3)+ak_tmp_xb,ak_precision)+' '+ak_round(((ak_tmp_yc-ak_tmp_yb)/3)+ak_tmp_yb,ak_precision)
ak_newNode+=' '+ak_round((2*(ak_tmp_xc-ak_tmp_xb)/3)+ak_tmp_xb,ak_precision)+' '+ak_round((2*(ak_tmp_yc-ak_tmp_yb)/3)+ak_tmp_yb,ak_precision)
ak_newNode+=' '+ak_tmp_xc+' '+ak_tmp_yc
if(i==1 && ak_path)
{
ak_tmp_xb=ak_tmp_pathX
ak_tmp_yb=ak_tmp_pathY
ak_path+=' C '+ak_round(((ak_tmp_point.x-ak_tmp_xb)/3)+ak_tmp_xb,ak_precision)+' '+ak_round(((ak_tmp_point.y-ak_tmp_yb)/3)+ak_tmp_yb,ak_precision)
ak_path+=' '+ak_round((2*(ak_tmp_point.x-ak_tmp_xb)/3)+ak_tmp_xb,ak_precision)+' '+ak_round((2*(ak_tmp_point.y-ak_tmp_yb)/3)+ak_tmp_yb,ak_precision)
ak_path+=' '+ak_round(ak_tmp_point.x,ak_precision)+' '+ak_round(ak_tmp_point.y,ak_precision)
}
ak_tmp_xb=ak_tmp_xc
ak_tmp_yb=ak_tmp_yc
}
else if(/q/.test(ak_tmp_array[1]))
{
ak_tmp_xc=ak_round(ak_tmp_point.x+ak_tmp_x,ak_precision)
ak_tmp_yc=ak_round(ak_tmp_point.y+ak_tmp_y+(ak_tmp_array[3]/2),ak_precision)
ak_newNode+=' Q '+ak_round(((ak_tmp_xc-ak_tmp_xb)/2)+ak_tmp_xb,ak_precision)+' '+ak_round(((ak_tmp_yc-ak_tmp_yb)/2)+ak_tmp_yb,ak_precision)
ak_newNode+=' '+ak_tmp_xc+' '+ak_tmp_yc
if(i==1 && ak_path)
{
ak_tmp_xb=ak_tmp_pathX
ak_tmp_yb=ak_tmp_pathY
ak_path+=' Q '+ak_round(((ak_tmp_point.x-ak_tmp_xb)/2)+ak_tmp_xb,ak_precision)+' '+ak_round(((ak_tmp_point.y-ak_tmp_yb)/2)+ak_tmp_yb,ak_precision)
ak_path+=' '+ak_round(ak_tmp_point.x,ak_precision)+' '+ak_round(ak_tmp_point.y,ak_precision)
}
ak_tmp_xb=ak_tmp_xc
ak_tmp_yb=ak_tmp_yc
}
else
{
ak_newNode+=' L '+ak_round(ak_tmp_point.x+ak_tmp_x,ak_precision)+' '+ak_round(ak_tmp_point.y+ak_tmp_y+ak_tmp_array[3]/2,ak_precision)
if(i==1 && ak_path)
{
ak_path+=' L '+ak_round(ak_tmp_point.x,ak_precision)+' '+ak_round(ak_tmp_point.y,ak_precision)
}
}
if(/mm/.test(ak_tmp_array[1]) && i<=(ak_tmp_array[0]-1))
{
if(ak_tmp_array[1]=='mm' || /^1;mm2/.test(ak_path))
{ak_newNode+=' M '+ak_round(ak_tmp_point.x+ak_tmp_x,ak_precision)+' '+ak_round(ak_tmp_point.y+ak_tmp_y+ak_tmp_array[3]/2,ak_precision)}
else if((i/2)==Math.round(i/2))
{ak_newNode+=' M '+ak_round(ak_tmp_point.x+ak_tmp_x,ak_precision)+' '+ak_round(ak_tmp_point.y+ak_tmp_y+ak_tmp_array[3]/2,ak_precision)}
}
}
}
if(ak_path)
{
ak_path+=";"+ak_tmp_x+";"+ak_round((ak_tmp_y+(ak_tmp_array[3]/2)),ak_precision)
ak_path_symOn=true
ak_newNode+='" ak_path="'+ak_path
}
ak_newNode+=ak_tmp_style
ak_newNode+='"/>'
if(wohin=="insert") ak_insertBeforeSP(ak_newNode,ak_object2update)
else if(wohin=="add2Parent") ak_appendChildSP(ak_newNode,ak_object2update.parentNode)
else if(wohin=="append") ak_appendChildSP(ak_newNode,ak_object2update)
else ak_appendChildSP(ak_newNode,ak_userspace_svg)
ak_tmp_object=document.getElementById(ak_tmp_id_rest)
if(ak_tmp_array[1]=='mm2')
{
ak_path_attr=ak_tmp_object.getAttribute("ak_path")
if(ak_path_attr && /;/.test(ak_path_attr))
{
ak_path_attr=ak_path_attr.split(";")
ak_path_attr[0]=parseFloat(ak_path_attr[0])
if(isNaN(ak_path_attr[0])) ak_path_attr[0]=3
ak_path_attr[3]=parseFloat(ak_path_attr[3])
if(isNaN(ak_path_attr[3])) ak_path_attr[3]=100
ak_path_attr[4]=parseFloat(ak_path_attr[4])
if(isNaN(ak_path_attr[4])) ak_path_attr[4]=100
ak_obj_data[19]=ak_path_attr[2]
ak_tmp_object.setAttribute("d",ak_path_create())
}
else
{
ak_path_attr=false
}
}
break
}
if(ak_tmp_object)
{
if(!ak_autoId) try{ak_tmp_object.removeAttribute("id")}catch(error){}
ak_clickset_obj2update(evt,ak_tmp_object)
}
}
// ############    ################
function ak_edit_menu(evt,action,parent_nr,href_path,path_id)
{
switch(action)
{
case "[Ctrl+C] copy to Clipboard":
ak_cout("[Ctrl+C] copy to Clipboard in progress ...")
setTimeout("ak_setTimeout('copyToClipboard')",10)
break
case "[Ctrl+X] cut to Clipboard":
ak_cout("[Ctrl+X] cut to Clipboard in progress ...")
setTimeout("ak_setTimeout('cutToClipboard')",10)
break
case "Change Id":
var ak_tmp_id=ak_object2update.getAttribute("id")
if(ak_tmp_id=="")
{
var ak_tmp_prev=ak_object2update.tagName
switch(ak_tmp_prev)
{
case "linearGradient": ak_tmp_prev="lG"; break
case "radialGradient": ak_tmp_prev="rG"; break
}
ak_tmp_id=ak_generate_id(evt,ak_tmp_prev+"_")
}
if(/(filter)|(Gradient)|(pattern)/.test(ak_object2update.tagName) && /^(Adobe; 6.)/.test(getSVGViewerVersion())) // 6.0x38363
{ak_alert("Changing still used Filter/Gradient/Pattern-Id's,\nmight cause system hang up in Viewer Version 6.??!")}
ak_tmp_id=ak_promptForId("Enter Id!",ak_tmp_id)
if(ak_tmp_id==null) break
if(ak_tmp_id=="")
{
try{ak_object2update.removeAttribute("id")}
catch(error){}
}
else ak_object2update.setAttribute("id",ak_tmp_id)
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
break
case "Select parentNode":
if(href_path=="selectParentNode")
{
if(ak_which_nodeNr(ak_object2update)==-1 || ak_which_nodeNr(ak_object2update)=='') break
ak_clickset_obj2update(evt,ak_object2update.parentNode)
break
}
if(href_path=="select_useRef")
{
ak_clickset_obj2update(evt,document.getElementById(path_id))
break
}
if(href_path=="select_useRef1Symbol")
{
var ak_tmp_symbol=document.getElementById(path_id)
var ak_tmp_child=false
for(var i=0;i<ak_tmp_symbol.childNodes.length;i++)
{
if(/^(\[object SVG)/.test(ak_tmp_symbol.childNodes.item(i)))
{
ak_tmp_child=true
ak_clickset_obj2update(evt,ak_tmp_symbol.childNodes.item(i))
break
}
}
if(!ak_tmp_child) ak_clickset_obj2update(evt,document.getElementById(path_id))
break
}
if(href_path=="change_href")
{
var ak_tmp_object=ak_object2update
if(parent_nr>0)
{
var ak_tmp_parent_eval="ak_tmp_object=ak_tmp_object"
for(var i=0;i<parent_nr;i++){ak_tmp_parent_eval+=".parentNode"}
eval(ak_tmp_parent_eval)
}
ak_tmp_object.setAttribute("xlink:href","#"+path_id)
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_tmp_object,"no_ak_init_set4object")
break
}
if(href_path=="text_data")
{
if(parent_nr>0)
{
var ak_tmp_parent_eval="ak_object2update=ak_object2update"
for(var i=0;i<parent_nr;i++){ak_tmp_parent_eval+=".parentNode"}
eval(ak_tmp_parent_eval)
}
var ak_tmp_data=ak_object2update.firstChild.data
ak_tmp_data=prompt("Enter text!",ak_tmp_data)
window.focus(ak_svgroot)
if(ak_tmp_data==null) {ak_clickset_obj2update(evt,ak_object2update); break}
if(ak_object2update.firstChild.data==undefined) ak_object2update.insertBefore(document.createTextNode(ak_tmp_data),ak_object2update.firstChild)
else ak_object2update.firstChild.data=ak_tmp_data
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
break
}
if(href_path=="href_path")
{
if(parent_nr>0)
{
var ak_tmp_parent_eval="ak_object2update=ak_object2update"
for(var i=0;i<parent_nr;i++){ak_tmp_parent_eval+=".parentNode"}
eval(ak_tmp_parent_eval)
}
var ak_tmp_href_path=ak_object2update.getAttribute("xlink:href")
if(ak_tmp_href_path.substring(0,1)!="#")
{
ak_cout("No valid path-reference recongnized!")
break
}
if(!document.getElementById(ak_tmp_href_path.substring(1,ak_tmp_href_path.length)))
{
ak_cout('<path id="'+ak_tmp_href_path.substring(1,ak_tmp_href_path.length)+'" is missing!')
break
}
ak_push2undoTrue()
ak_clickset_obj2update(evt,document.getElementById(ak_tmp_href_path.substring(1,ak_tmp_href_path.length)))
break
}
if(parent_nr==0 && href_path=="edit_lg_rg_pattern")
{
if(/^(url)/.test(ak_SetGetRm_styleValue(ak_object2update,"fill","get","no_cout")))
{
ak_color_action_on="fill_url"
ak_set4Style(evt,ak_color_action_on)
ak_init_buttonV3()
ak_set_gradient_control(evt)
}
else if(/^(url)/.test(ak_SetGetRm_styleValue(ak_object2update,"stroke","get","no_cout")))
{
ak_color_action_on="stroke_url"
ak_set4Style(evt,ak_color_action_on)
ak_init_buttonV3()
ak_set_gradient_control(evt)
}
break
}
else if(parent_nr==0 && href_path=="edit_filter")
{
ak_color_action_on="filter"
ak_set4Style(evt,ak_color_action_on)
ak_init_buttonV3()
ak_set_gradient_control(evt)
break
}
else if(parent_nr==0) break
var ak_tmp_parent_eval="var ak_tmp_object=ak_object2update"
for(var i=0;i<parent_nr;i++){ak_tmp_parent_eval+=".parentNode"}
eval(ak_tmp_parent_eval)
ak_clickset_obj2update(evt,ak_tmp_object)
if(href_path=="edit_lg_rg_pattern")
{
if(/^(url)/.test(ak_SetGetRm_styleValue(ak_object2update,"fill","get","no_cout")))
{
ak_color_action_on="fill_url"
ak_set4Style(evt,ak_color_action_on)
ak_init_buttonV3()
ak_set_gradient_control(evt)
}
else if(/^(url)/.test(ak_SetGetRm_styleValue(ak_object2update,"stroke","get","no_cout")))
{
ak_color_action_on="stroke_url"
ak_set4Style(evt,ak_color_action_on)
ak_init_buttonV3()
ak_set_gradient_control(evt)
}
}
else if(href_path=="edit_filter")
{
ak_color_action_on="filter"
ak_set4Style(evt,ak_color_action_on)
ak_init_buttonV3()
ak_set_gradient_control(evt)
}
break
}
}
// ############    ################
function ak_set_fillRuleChecked(for_this)
{
return
try{
document.getElementById("ak_fillrule_nonzero").setAttribute("checked","no")
document.getElementById("ak_fillrule_evenodd").setAttribute("checked","no")
document.getElementById("ak_fillrule_false").setAttribute("checked","no")
document.getElementById("ak_fillrule_"+for_this).setAttribute("checked","yes")
}
catch(error){}
}
// ############    ################
var ak_path_attr=false, ak_path_symOn=false, ak_path_attr_enter, ak_path_reverse=false
ak_path_attr=new Array(5,'ml2','M 0 -50 L 25 -48 L 12 -30',250,150)
ak_path_attr=new Array(7,'mc','M -20 -30 C 64 -100 75 -50 0 30',250,150)
function ak_path_create(nixMCZ)
{
if(!ak_path_attr) return false
if(ak_path_attr[0]>1080) ak_path_attr[0]=1080
var ak_tmp, ak_tmp_point=ak_svgroot.createSVGPoint(), ak_tmp_d='M'
var ak_tmp_matrix=ak_svgroot.createSVGMatrix()
ak_tmp_matrix=ak_tmp_matrix.rotate((360/ak_path_attr[0]))
var ak_tmp_path=ak_path_attr[2].split(' ')
for(var i=1;i<ak_tmp_path.length;i++)
{
ak_tmp=parseFloat(ak_tmp_path[i])
if(!isNaN(ak_tmp)) ak_tmp_path[i]=ak_tmp
}
var ak_tmp_shiftX=ak_path_attr[3]
var ak_tmp_shiftY=ak_path_attr[4]
if(isNaN(ak_tmp_path[ak_tmp_path.length-1]))
{
if(/2$/.test(ak_path_attr[1])) ak_path_attr[1]="mm2"
else ak_path_attr[1]="mm"
}
else if(ak_path_attr[1]=='ml' || ak_path_attr[1]=='mc' || ak_path_attr[1]=='mq')
{
if(ak_path_reverse)
{
ak_tmp_matrix=ak_svgroot.createSVGMatrix()
ak_tmp_matrix=ak_tmp_matrix.rotate(-(360/ak_path_attr[0]))
ak_tmp_point.x=ak_tmp_path[ak_tmp_path.length-2]
ak_tmp_point.y=ak_tmp_path[ak_tmp_path.length-1]
ak_tmp_point=ak_tmp_point.matrixTransform(ak_tmp_matrix)
ak_tmp_path[1]=ak_round(ak_tmp_point.x,ak_precision)
ak_tmp_path[2]=ak_round(ak_tmp_point.y,ak_precision)
ak_EditArray_work[1]=ak_tmp_path[1]+ak_tmp_shiftX
ak_EditArray_work[2]=ak_tmp_path[2]+ak_tmp_shiftY
}
else
{
ak_tmp_point.x=ak_tmp_path[1]
ak_tmp_point.y=ak_tmp_path[2]
ak_tmp_point=ak_tmp_point.matrixTransform(ak_tmp_matrix)
ak_tmp_path[ak_tmp_path.length-2]=ak_round(ak_tmp_point.x,ak_precision)
ak_tmp_path[ak_tmp_path.length-1]=ak_round(ak_tmp_point.y,ak_precision)
}
ak_path_attr[1]='ml'
if(ak_tmp_path[ak_tmp_path.length-5]=='Q') ak_path_attr[1]='mq'
else if(ak_tmp_path[ak_tmp_path.length-7]=='C') ak_path_attr[1]='mc'
}
ak_path_reverse=false
for(var i=1;i<ak_tmp_path.length;i++)
{
if(isNaN(ak_tmp_path[i]))
{
if(ak_tmp_path[i]=="M" && /2$/.test(ak_path_attr[1])) ak_path_attr[1]='mm2'
else if(ak_tmp_path[i]=="M") ak_path_attr[1]='mm'
ak_tmp_d+=' '+ak_tmp_path[i]
}
else
{
ak_tmp_d+=' '+ak_round((ak_tmp_path[i]+ak_tmp_shiftX),ak_precision); i++
ak_tmp_d+=' '+ak_round((ak_tmp_path[i]+ak_tmp_shiftY),ak_precision)
}
}
var ak_tmp_path2=false
if(ak_path_attr[1]=='mm2')
{
ak_tmp_matrix=ak_svgroot.createSVGMatrix()
ak_tmp_matrix=ak_tmp_matrix.flipX()
ak_tmp_matrix=ak_tmp_matrix.rotate(-(360/ak_path_attr[0]))
ak_tmp_path2=new Array('M')
for(var i=1;i<ak_tmp_path.length;i++)
{
if(isNaN(ak_tmp_path[i])) ak_tmp_path2.push(ak_tmp_path[i])
else
{
ak_tmp_point.x=ak_tmp_path[i]; i++
ak_tmp_point.y=ak_tmp_path[i]
ak_tmp_point=ak_tmp_point.matrixTransform(ak_tmp_matrix)
ak_tmp_path2.push(ak_round(ak_tmp_point.x,ak_precision))
ak_tmp_path2.push(ak_round(ak_tmp_point.y,ak_precision))
}
}
}
else if(/2$/.test(ak_path_attr[1]))
{
var ak_tmp_isZ=false
//if(ak_path_attr[0]>2)
{
ak_tmp_matrix=ak_svgroot.createSVGMatrix()
ak_tmp_matrix=ak_tmp_matrix.rotate((360/ak_path_attr[0]))
ak_tmp_point.x=ak_tmp_path[1]
ak_tmp_point.y=ak_tmp_path[2]
ak_tmp_point=ak_tmp_point.matrixTransform(ak_tmp_matrix)
var ak_tmpLX=ak_tmp_point.x
var ak_tmpLY=ak_tmp_point.y
}
ak_tmp_matrix=ak_svgroot.createSVGMatrix()
ak_tmp_matrix=ak_tmp_matrix.flipX()
ak_tmp_matrix=ak_tmp_matrix.rotate(-(360/ak_path_attr[0]))
ak_tmp_path2=new Array()
for(var i=1;i<ak_tmp_path.length;i++)
{
if(isNaN(ak_tmp_path[i]))
{
if(ak_tmp_path[i]=="Z")
{
ak_tmp_isZ=true
ak_tmp_path.splice(i,1,'L',ak_tmp_path[1],ak_tmp_path[2])
}
ak_tmp_path2.push(ak_tmp_path[i])
}
else
{
ak_tmp_point.x=ak_tmp_path[i]; i++
ak_tmp_point.y=ak_tmp_path[i]
ak_tmp_point=ak_tmp_point.matrixTransform(ak_tmp_matrix)
ak_tmp_path2.push(ak_round(ak_tmp_point.x,ak_precision))
ak_tmp_path2.push(ak_round(ak_tmp_point.y,ak_precision))
}
}
for(var i=(ak_tmp_path2.length-1);i>=0;i--)
{
if(ak_tmp_path2[i]=="Q")
{
ak_tmp_path2.splice(i,1)
ak_tmp_path2.splice(i+2,0,"Q")
}
else if(ak_tmp_path2[i]=="C")
{
ak_tmp_path2.splice(i,1)
ak_tmp_path2.splice(i+4,0,"C")
}
}
ak_tmp_path2.push('L')
ak_tmp_path2.reverse()
for(var i=1;i<ak_tmp_path2.length;i++)
{
if(!isNaN(ak_tmp_path2[i]))
{
ak_tmp=ak_tmp_path2[i]
ak_tmp_path2[i]=ak_tmp_path2[i+1]
ak_tmp_path2[i+1]=ak_tmp
i++
}
}
ak_tmp_path2.push('L',ak_tmpLX,ak_tmpLY)
if(ak_tmp_isZ)
{
ak_tmp_d='M'
for(var i=1;i<ak_tmp_path.length;i++)
{
if(isNaN(ak_tmp_path[i])) ak_tmp_d+=' '+ak_tmp_path[i]
else
{
ak_tmp_d+=' '+ak_round((ak_tmp_path[i]+ak_tmp_shiftX),ak_precision); i++
ak_tmp_d+=' '+ak_round((ak_tmp_path[i]+ak_tmp_shiftY),ak_precision)
}
}
}
ak_path_attr[1]='ml2'
if(ak_tmp_path[ak_tmp_path.length-5]=='Q') ak_path_attr[1]='mq2'
else if(ak_tmp_path[ak_tmp_path.length-7]=='C') ak_path_attr[1]='mc2'
}
ak_path_attr[2]=ak_tmp_path.join(" ")
if(!nixMCZ && !/^mm/.test(ak_path_attr[1]))
{
if(!isNaN(ak_EditArray_work[ak_EditArray_work.length-3]))
{
ak_EditArray_work[ak_EditArray_work.length-4]=ak_tmp_path[ak_tmp_path.length-4]+ak_tmp_shiftX
ak_EditArray_work[ak_EditArray_work.length-3]=ak_tmp_path[ak_tmp_path.length-3]+ak_tmp_shiftY
}
ak_EditArray_work[ak_EditArray_work.length-2]=ak_tmp_path[ak_tmp_path.length-2]+ak_tmp_shiftX
ak_EditArray_work[ak_EditArray_work.length-1]=ak_tmp_path[ak_tmp_path.length-1]+ak_tmp_shiftY
}
if(!/^mm/.test(ak_path_attr[1])) ak_tmp_path.splice(0,3)
if(ak_tmp_path2)
{
for(var i=0;i<ak_tmp_path2.length;i++)
{
if(isNaN(ak_tmp_path2[i])) ak_tmp_d+=' '+ak_tmp_path2[i]
else
{
ak_tmp_d+=' '+ak_round((ak_tmp_path2[i]+ak_tmp_shiftX),ak_precision); i++
ak_tmp_d+=' '+ak_round((ak_tmp_path2[i]+ak_tmp_shiftY),ak_precision)
}
}
}
for(var angle=1;angle<ak_path_attr[0];angle++)
{
ak_tmp_matrix=ak_svgroot.createSVGMatrix()
ak_tmp_matrix=ak_tmp_matrix.rotate((360/ak_path_attr[0])*angle)
for(var i=0;i<ak_tmp_path.length;i++)
{
if(isNaN(ak_tmp_path[i])) ak_tmp_d+=' '+ak_tmp_path[i]
else
{
ak_tmp_point.x=ak_tmp_path[i]; i++
ak_tmp_point.y=ak_tmp_path[i]
ak_tmp_point=ak_tmp_point.matrixTransform(ak_tmp_matrix)
ak_tmp_d+=' '+ak_round(ak_tmp_point.x+ak_tmp_shiftX,ak_precision)
ak_tmp_d+=' '+ak_round(ak_tmp_point.y+ak_tmp_shiftY,ak_precision)
}
}
if(ak_tmp_path2)
{
for(var i=0;i<ak_tmp_path2.length;i++)
{
if(isNaN(ak_tmp_path2[i])) ak_tmp_d+=' '+ak_tmp_path2[i]
else
{
ak_tmp_point.x=ak_tmp_path2[i]; i++
ak_tmp_point.y=ak_tmp_path2[i]
ak_tmp_point=ak_tmp_point.matrixTransform(ak_tmp_matrix)
ak_tmp_d+=' '+ak_round(ak_tmp_point.x+ak_tmp_shiftX,ak_precision)
ak_tmp_d+=' '+ak_round(ak_tmp_point.y+ak_tmp_shiftY,ak_precision)
}
}
}
}
return ak_tmp_d
}
// ############    ################
var ak_segment_max=100
var ak_path_segment_menu=17 //zwecks entries
function ak_edit_path_menu(action,segment_nr)
{
if(!/^(\[object SVGPath)/.test(ak_object2update)) return
switch(action)
{
case "nonzero":
ak_SetGetRm_styleValue(ak_object2update,"fill-rule","nonzero","no_cout")
break
case "evenodd":
ak_SetGetRm_styleValue(ak_object2update,"fill-rule","evenodd","no_cout")
break
case "rm fill-rule":
ak_SetGetRm_styleValue(ak_object2update,"fill-rule","remove","no_cout")
break
case "addPathClipboard":
var ak_tmp_d=top.clipboardData.getData("Text")
ak_tmp_d=ak_tmp_d.substring(ak_tmp_d.search(/<path/))
var ak_tmp_path=parseXML("<g>"+ak_tmp_d+"</g>",document).firstChild
if(ak_tmp_path)
{
var ak_tmp_dOrg=ak_object2update.getAttribute("d")
var ak_tmp_compare=ak_tmp_dOrg
for(var i=0;i<ak_tmp_path.childNodes.length;i++)
{
try{
if(ak_tmp_path.childNodes.item(i).tagName=="path") ak_tmp_d=ak_tmp_path.childNodes.item(i).getAttribute("d")
else ak_tmp_d=''
}catch(error){ak_tmp_d=""}
if(ak_tmp_d) ak_tmp_dOrg+=" "+ak_tmp_d
}
if(ak_tmp_compare!=ak_tmp_dOrg) ak_append2undo()
ak_object2update.setAttribute("d",ak_tmp_dOrg)
if(ak_tmp_compare!=ak_tmp_dOrg) ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update)
}
break
case "replacePathClipboard":
var ak_tmp_d=top.clipboardData.getData("Text")
ak_tmp_d=ak_tmp_d.substring(ak_tmp_d.search(/<path/))
var ak_tmp_path=parseXML("<g>"+ak_tmp_d+"</g>",document).firstChild
if(ak_tmp_path)
{
var ak_tmp_dOrg=''
for(var i=0;i<ak_tmp_path.childNodes.length;i++)
{
try{
if(ak_tmp_path.childNodes.item(i).tagName=="path") ak_tmp_d=ak_tmp_path.childNodes.item(i).getAttribute("d")
else ak_tmp_d=''
}catch(error){ak_tmp_d=""}
if(ak_tmp_d) ak_tmp_dOrg+=" "+ak_tmp_d
}
ak_tmp_dOrg=ak_tmp_dOrg.replace(/^ +/,'')
if(ak_tmp_dOrg)
{
ak_append2undo()
ak_object2update.setAttribute("d",ak_tmp_dOrg)
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update)
}
else
{
ak_tagName_cout='No path data found!'
ak_cout(ak_tagName_cout)
}
}
break
case "mirrorLeftRight":
if(ak_object2update.getBBox.width<=0) return
ak_append2undo()
var ak_tmp_mid=ak_object2update.getBBox.x+(ak_object2update.getBBox.width/2)
for(var i=0;i<ak_EditArray_enter.length;i++)
{
switch (ak_EditArray_enter[i])
{
case "M":
i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision); i++
break
case "C":
i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision); i++
i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision); i++
i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision); i++
break
case "L":
i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision); i++
break
case "Q":
i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision); i++
i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision); i++
break
case "A":
if(ak_EditArray_enter[i+5]==0) ak_EditArray_work[i+5]=1
else ak_EditArray_work[i+5]=0
i=i+6; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision); i++
break
case "S":
i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision); i++
i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision); i++
break
case "T":
i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision); i++
break
case "H":
i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision)
break
}
}
ak_obj_data[19]=ak_EditArray_work.join(" ")
ak_object2update.setAttribute("d",ak_obj_data[19])
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update)
break
case "mirrorTopBottom":
if(ak_object2update.getBBox.height<=0) return
ak_append2undo()
var ak_tmp_mid=ak_object2update.getBBox.y+(ak_object2update.getBBox.height/2)
for(var i=0;i<ak_EditArray_enter.length;i++)
{
switch (ak_EditArray_enter[i])
{
case "M":
i++; i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision)
break
case "C":
i++; i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision)
i++; i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision)
i++; i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision)
break
case "L":
i++; i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision)
break
case "Q":
i++; i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision)
i++; i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision)
break
case "A":
if(ak_EditArray_enter[i+5]==0) ak_EditArray_work[i+5]=1
else ak_EditArray_work[i+5]=0
i=i+7; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision)
break
case "S":
i++; i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision)
i++; i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision)
break
case "T":
i++; i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision)
break
case "V":
i++; i++; ak_EditArray_work[i]=ak_round(ak_tmp_mid-(ak_EditArray_enter[i]-ak_tmp_mid),ak_precision)
break
}
}
ak_obj_data[19]=ak_EditArray_work.join(" ")
ak_object2update.setAttribute("d",ak_obj_data[19])
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update)
break
case "rotatePathPoints":
if(segment_nr=="enter")
{
var ak_tmp=prompt("Enter rotation angle!",0)
window.focus(ak_svgroot)
if(!ak_tmp) return
segment_nr=parseFloat(ak_tmp)
if(isNaN(segment_nr) || segment_nr==0) return
}
ak_append2undo()
var ak_tmp_precision=ak_precision
var ak_rotate_matrix=ak_svgroot.createSVGMatrix()
ak_rotate_matrix=ak_rotate_matrix.rotate(segment_nr)
var ak_bbox_center_matrized=ak_svgroot.createSVGPoint()
ak_bbox_center_matrized.x=ak_object2update.getBBox.x+(ak_object2update.getBBox.width/2)
ak_bbox_center_matrized.y=ak_object2update.getBBox.y+(ak_object2update.getBBox.height/2)
var ak_tmp_point_2rotate=ak_svgroot.createSVGPoint()
for(var i=0;i<ak_EditArray_enter.length;i++)
{
switch (ak_EditArray_enter[i])
{
case "M":
ak_tmp_point_2rotate.x=(ak_EditArray_enter[i+1]-ak_bbox_center_matrized.x)
ak_tmp_point_2rotate.y=(ak_EditArray_enter[i+2]-ak_bbox_center_matrized.y)
ak_tmp_point_2rotate=ak_tmp_point_2rotate.matrixTransform(ak_rotate_matrix)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.x+ak_bbox_center_matrized.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.y+ak_bbox_center_matrized.y),ak_tmp_precision)
break
case "C":
ak_tmp_point_2rotate.x=(ak_EditArray_enter[i+1]-ak_bbox_center_matrized.x)
ak_tmp_point_2rotate.y=(ak_EditArray_enter[i+2]-ak_bbox_center_matrized.y)
ak_tmp_point_2rotate=ak_tmp_point_2rotate.matrixTransform(ak_rotate_matrix)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.x+ak_bbox_center_matrized.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.y+ak_bbox_center_matrized.y),ak_tmp_precision)
ak_tmp_point_2rotate.x=(ak_EditArray_enter[i+1]-ak_bbox_center_matrized.x)
ak_tmp_point_2rotate.y=(ak_EditArray_enter[i+2]-ak_bbox_center_matrized.y)
ak_tmp_point_2rotate=ak_tmp_point_2rotate.matrixTransform(ak_rotate_matrix)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.x+ak_bbox_center_matrized.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.y+ak_bbox_center_matrized.y),ak_tmp_precision)
ak_tmp_point_2rotate.x=(ak_EditArray_enter[i+1]-ak_bbox_center_matrized.x)
ak_tmp_point_2rotate.y=(ak_EditArray_enter[i+2]-ak_bbox_center_matrized.y)
ak_tmp_point_2rotate=ak_tmp_point_2rotate.matrixTransform(ak_rotate_matrix)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.x+ak_bbox_center_matrized.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.y+ak_bbox_center_matrized.y),ak_tmp_precision)
break
case "L":
ak_tmp_point_2rotate.x=(ak_EditArray_enter[i+1]-ak_bbox_center_matrized.x)
ak_tmp_point_2rotate.y=(ak_EditArray_enter[i+2]-ak_bbox_center_matrized.y)
ak_tmp_point_2rotate=ak_tmp_point_2rotate.matrixTransform(ak_rotate_matrix)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.x+ak_bbox_center_matrized.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.y+ak_bbox_center_matrized.y),ak_tmp_precision)
break
case "Q":
ak_tmp_point_2rotate.x=(ak_EditArray_enter[i+1]-ak_bbox_center_matrized.x)
ak_tmp_point_2rotate.y=(ak_EditArray_enter[i+2]-ak_bbox_center_matrized.y)
ak_tmp_point_2rotate=ak_tmp_point_2rotate.matrixTransform(ak_rotate_matrix)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.x+ak_bbox_center_matrized.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.y+ak_bbox_center_matrized.y),ak_tmp_precision)
ak_tmp_point_2rotate.x=(ak_EditArray_enter[i+1]-ak_bbox_center_matrized.x)
ak_tmp_point_2rotate.y=(ak_EditArray_enter[i+2]-ak_bbox_center_matrized.y)
ak_tmp_point_2rotate=ak_tmp_point_2rotate.matrixTransform(ak_rotate_matrix)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.x+ak_bbox_center_matrized.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.y+ak_bbox_center_matrized.y),ak_tmp_precision)
break
case "A":
i=i+3; ak_EditArray_work[i]=ak_round(ak_EditArray_enter[i]-ak_edit_angle,ak_tmp_precision)
i=i+2
ak_tmp_point_2rotate.x=(ak_EditArray_enter[i+1]-ak_bbox_center_matrized.x)
ak_tmp_point_2rotate.y=(ak_EditArray_enter[i+2]-ak_bbox_center_matrized.y)
ak_tmp_point_2rotate=ak_tmp_point_2rotate.matrixTransform(ak_rotate_matrix)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.x+ak_bbox_center_matrized.x),ak_tmp_precision)
i++; ak_EditArray_work[i]=ak_round((ak_tmp_point_2rotate.y+ak_bbox_center_matrized.y),ak_tmp_precision)
break
}
}
ak_obj_data[19]=ak_EditArray_work.join(" ")
ak_object2update.setAttribute("d",ak_obj_data[19])
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update)
break
case "edit_ak_path_off":
ak_path_symOn=false
ak_path_attr[5]="no_edit"
ak_object2update.setAttribute("ak_path",ak_path_attr.join(";"))
ak_clickset_obj2update(evt,ak_object2update)
break
case "edit_ak_path":
ak_hide_pathPoints=false
ak_path_symOn=true
ak_path_attr=ak_object2update.getAttribute("ak_path")
if(ak_path_attr && /;/.test(ak_path_attr))
{
ak_path_attr=ak_path_attr.split(";")
ak_path_attr[0]=parseFloat(ak_path_attr[0])
if(isNaN(ak_path_attr[0])) ak_path_attr[0]=3
ak_path_attr[3]=parseFloat(ak_path_attr[3])
if(isNaN(ak_path_attr[3])) ak_path_attr[3]=100
ak_path_attr[4]=parseFloat(ak_path_attr[4])
if(isNaN(ak_path_attr[4])) ak_path_attr[4]=100
ak_obj_data[19]=ak_path_attr[2]
ak_path_attr_enter=new Array
for(var i=0;i<ak_path_attr.length;i++)
{
ak_path_attr_enter[i]=ak_path_attr[i]
}
ak_path_attr.splice(5,1)
ak_object2update.setAttribute("d",ak_path_create())
ak_object2update.setAttribute("ak_path",ak_path_attr.join(";"))
}
else
{
ak_path_attr=false
}
ak_clickset_obj2update(evt,ak_object2update)
break
case "edit_ak_path_create":
var ak_tmp=prompt("Enter [ segments ] [ mm  ml  ...  mm2  ml2  ... ] (1 = mm2 ml2 ..., max. "+ak_segment_max+")",3)
window.focus(ak_svgroot)
if(!ak_tmp) return
ak_hide_pathPoints=false
ak_tmp=ak_tmp.replace(/ +/g," ")
ak_tmp=ak_tmp.replace(/^ *| *$/g,"")
if(!ak_tmp) return
ak_append2undo()
var ak_tmpAttr_array
if(/ /.test(ak_tmp)) ak_tmpAttr_array=ak_tmp.split(" ")
else ak_tmpAttr_array=new Array(ak_tmp,"mm")
ak_tmp=parseInt(ak_tmpAttr_array[0])
if(ak_tmp<1) ak_tmp=1
if(ak_tmp>ak_segment_max)
{
ak_alert(ak_segment_max+" segments maximum!")
ak_tmp=ak_segment_max
}
if(ak_tmp>1)
{
switch(ak_tmpAttr_array[1])
{
case "mm":
case "ml":
case "mc":
case "mq":
case "mm2":
case "ml2":
case "mc2":
case "mq2": break
default: ak_tmpAttr_array[1]="mm"
}
}
else
{
switch(ak_tmpAttr_array[1])
{
case "ml": ak_tmpAttr_array[1]="ml2";break
case "mc": ak_tmpAttr_array[1]="mc2";break
case "mq": ak_tmpAttr_array[1]="mq2";break
case "mm2":
case "ml2":
case "mc2":
case "mq2": break
default: ak_tmpAttr_array[1]="mm2"
}
}
if(ak_edit_which_attribute!="xy_etc") ak_switch_xy_transform("xy_etc")
ak_path_symOn=true
var ak_tmp_shiftX=ak_round(ak_object2update.getBBox.x,ak_precision)
var ak_tmp_shiftY=ak_round(ak_object2update.getBBox.y+ak_object2update.getBBox.height,ak_precision)
var ak_tmp_array=new Array
var ak_tmpARemoveConfirm=true, ak_tmpABreak=false
var ak_i2=0
for(var i=0;i<ak_EditArray_enter.length;i++)
{
if(/[A]/.test(ak_EditArray_enter[i]))
{
if(ak_tmpARemoveConfirm)
{
ak_tmpARemoveConfirm=false
if(!confirm("No rotation for A-Points, remove A-Points?"))
{
ak_tmpABreak=true
break
}
}
i+=7
/*ak_tmp_array[i]=ak_EditArray_enter[i]; i++
ak_tmp_array[i]=ak_EditArray_enter[i]; i++
ak_tmp_array[i]=ak_EditArray_enter[i]; i++
ak_tmp_array[i]=ak_EditArray_enter[i]; i++
ak_tmp_array[i]=ak_EditArray_enter[i]; i++
ak_tmp_array[i]=ak_EditArray_enter[i]; i++
ak_tmp_array[i]=ak_round(ak_EditArray_enter[i]-ak_tmp_shiftX,ak_precision); i++
ak_tmp_array[i]=ak_round(ak_EditArray_enter[i]-ak_tmp_shiftY,ak_precision)*/
}
else if(!isNaN(ak_EditArray_enter[i]))
{
ak_tmp_array[ak_i2]=ak_round(ak_EditArray_enter[i]-ak_tmp_shiftX,ak_precision); i++; ak_i2++
ak_tmp_array[ak_i2]=ak_round(ak_EditArray_enter[i]-ak_tmp_shiftY,ak_precision)
ak_i2++
}
else
{
ak_tmp_array[ak_i2]=ak_EditArray_enter[i]
ak_i2++
}
}
if(!ak_tmpABreak)
{
ak_path_attr=new Array(ak_tmp,ak_tmpAttr_array[1],ak_tmp_array.join(" "),ak_tmp_shiftX,ak_tmp_shiftY)
ak_object2update.setAttribute("d",ak_path_create())
ak_object2update.setAttribute("ak_path",ak_path_attr.join(";"))
}
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update)
break
case "edit_ak_path_inc":
if(ak_edit_which_attribute!="xy_etc") ak_switch_xy_transform("xy_etc")
if(ak_path_attr[0]<1080) ak_path_attr[0]++
else break
ak_append2undo()
ak_object2update.setAttribute("d",ak_path_create())
ak_object2update.setAttribute("ak_path",ak_path_attr.join(";"))
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update)
break
case "edit_ak_path_dec":
if(ak_edit_which_attribute!="xy_etc") ak_switch_xy_transform("xy_etc")
if(ak_path_attr[0]>2) ak_path_attr[0]--
else if(ak_path_attr[0]>1 && /2$/.test(ak_path_attr[1])) ak_path_attr[0]--
else break
ak_append2undo()
ak_object2update.setAttribute("d",ak_path_create())
ak_object2update.setAttribute("ak_path",ak_path_attr.join(";"))
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update)
break
case "edit_ak_path_mode":
if(ak_edit_which_attribute!="xy_etc") ak_switch_xy_transform("xy_etc")
if(ak_path_attr[0]<2 && !/2$/.test(segment_nr)) ak_path_attr[0]=2
ak_path_attr[1]=segment_nr
ak_append2undo()
ak_object2update.setAttribute("d",ak_path_create())
ak_object2update.setAttribute("ak_path",ak_path_attr.join(";"))
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update)
break
case "edit_ak_path_mode_rm":
if(ak_edit_which_attribute!="xy_etc") ak_switch_xy_transform("xy_etc")
if(ak_path_attr[0]<2 && !/2$/.test(segment_nr)) ak_path_attr[0]=2
ak_path_attr[1]=segment_nr
if(/ /.test(ak_path_attr[2]))
{
var ak_tmp_array=ak_path_attr[2].split(" ")
for(var i=1;i<ak_tmp_array.length;i++)
{
if(ak_tmp_array[i]=="M") ak_tmp_array[i]="L"
if(ak_tmp_array[i]=="Z")
{
ak_tmp_array.splice(i,1)
i--
}
}
ak_path_attr[2]=ak_tmp_array.join(" ")
}
ak_append2undo()
ak_object2update.setAttribute("d",ak_path_create())
ak_object2update.setAttribute("ak_path",ak_path_attr.join(";"))
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update)
break
case "edit_ak_path2d_rm":
ak_append2undo()
ak_object2update.setAttribute("d",ak_EditArray_enter.join(" "))
try{ak_object2update.removeAttribute("ak_path")}catch(error){}
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update)
break
case "edit_ak_path_remove":
ak_append2undo()
try{ak_object2update.removeAttribute("ak_path")}catch(error){}
ak_push2undoTrue()
ak_clickset_obj2update(evt,ak_object2update)
break
case "Select Next Segment":
if(ak_segment_how_many==1)
{
if(ak_hide_pathPoints) ak_hide_pathPoints=false
else ak_hide_pathPoints=true
if(ak_edit_which_attribute!="xy_etc") ak_switch_xy_transform("xy_etc")
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
break
}
if(ak_edit_which_attribute!="xy_etc")
{
ak_switch_xy_transform("xy_etc")
ak_segment_start--
}
ak_segment_start++
if(ak_segment_start>=ak_segment_how_many) ak_segment_start=0
ak_hide_pathPoints=false
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
break
case "Select Previous Segment":
if(ak_segment_how_many==1)
{
if(ak_hide_pathPoints) ak_hide_pathPoints=false
else ak_hide_pathPoints=true
if(ak_edit_which_attribute!="xy_etc") ak_switch_xy_transform("xy_etc")
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
break
}
if(ak_edit_which_attribute!="xy_etc")
{
ak_switch_xy_transform("xy_etc")
ak_segment_start++
}
ak_segment_start--
if(ak_segment_start<0) ak_segment_start=ak_segment_how_many-1
ak_hide_pathPoints=false
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
break
case "Hide Path Control Points":
if(ak_segment_how_many==1)
{
if(ak_hide_pathPoints) ak_hide_pathPoints=false
else ak_hide_pathPoints=true
if(ak_edit_which_attribute!="xy_etc") ak_switch_xy_transform("xy_etc")
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
break
}
if(ak_edit_which_attribute!="xy_etc") return
ak_hide_pathPoints=true
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
break
case "Show all Path Control Points":
if(ak_edit_which_attribute!="xy_etc") ak_switch_xy_transform("xy_etc")
ak_hide_pathPoints=false
ak_segment_start=-1
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
break
case "Select Segment":
if(ak_edit_which_attribute!="xy_etc") ak_switch_xy_transform("xy_etc")
ak_hide_pathPoints=false
ak_segment_start=segment_nr
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
break
}
}
var ak_hide_pathPoints=false
// ############    ################
var ak_menu_status="ak_editor", ak_lastSelected, ak_lastPanX, ak_lastPanY, ak_lastScale, ak_lastStyle
function ak_main_menu(action,insert_append)
{
var ak_tmp_dirty=ak_dirty_flag, ak_tmp, ak_tmp2, ak_tmp3
switch(action)
{
case "fastSelection":
if(ak_fast_selection)
{
ak_fast_selection=false
document.getElementById("ak_fast_selection_item").setAttribute("checked","no")
}
else
{
ak_fast_selection=true
document.getElementById("ak_fast_selection_item").setAttribute("checked","yes")
}
break
case "Final View":
ak_lastSelected=ak_object2update
ak_checkLink=new Array
if(ak_dirty_flag)
{
var ak_tmp_a=ak_userspace_svg.getElementsByTagName("a")
ak_checkLink=new Array
for(var i=0;i<ak_tmp_a.length;i++)
{
ak_checkLink[i]=new Array(ak_tmp_a.item(i),"","","")
ak_checkLink[i][1]=ak_checkLink[i][0].getAttribute("xlink:href")
if(ak_checkLink[i][1])
{
ak_checkLink[i][2]=ak_checkLink[i][0].getAttribute("target")
if(/(_parent)|(_self)|(_top)/.test(ak_checkLink[i][2]) ||!ak_checkLink[i][2])
{
ak_checkLink[i][3]=ak_checkLink[i][0].getAttribute("onclick")
ak_checkLink[i][0].setAttribute("onclick","ak_redirectWarning(evt);"+ak_checkLink[i][3])
ak_checkLink[i][0].setAttribute("target","redirect")
}
}
}
}
ak_xy_etc_shift=0
ak_lastScale=ak_grid_zoom
ak_lastPanX=ak_grid_pan_x
ak_lastPanY=ak_grid_pan_y
ak_grid_zoom=1
ak_grid_pan_x=0
ak_grid_pan_y=0
ak_lastStyle=ak_userspace_svg.firstChild.getAttribute("style")
ak_edit_gradient_flag=false
ak_gradient_stop_index=-1
ak_clickset_obj2update(evt,ak_userspace_svg.firstChild)
ak_menu_status="final_view"
ak_SetGetRm_styleValue(document.getElementById("ak_background_editor"),"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(ak_userspace_svg.firstChild,"visibility","hidden","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_wird_von_aks_.js_gefuellt"),"visibility","hidden","no_cout")
var ak_tmp_x=-ak_getAbsolutePixel(ak_userspace_svg.getAttribute('x'),'x',window.innerWidth,window.innerHeight)
var ak_tmp_y=-ak_getAbsolutePixel(ak_userspace_svg.getAttribute('y'),'y',window.innerWidth,window.innerHeight)
ak_SetGetRm_transformValue(document.getElementById("ak_internal_userSpace"),"matrix","1,0,0,1,"+ak_tmp_x+","+ak_tmp_y,"no_cout")
contextMenu().replaceChild(parseXML(printNode(getDocument().getElementById("ak_final_view_menu_xml")),getContextMenu()).firstChild,getContextMenu().firstChild);
ak_svgroot.setCurrentTime(0)
ak_svgroot.unpauseAnimations()
ak_dirty_flag=ak_tmp_dirty
break
case "BackFromTimeline":
ak_svgroot.unpauseAnimations()
var ak_tmp, ak_tmpParse
ak_svgroot.setCurrentTime(ak_timeEnd)
for(var i=0;i<ak_animationArray.length;i++)
{
if(ak_animationArray[i][1])
{
ak_tmp=ak_animationArray[i][1]
if(ak_animationArray[i][2]) ak_tmp+="+"+ak_round(ak_animationArray[i][2],1000)
if(ak_animationArray[i][3]) ak_tmp+=";"+ak_animationArray[i][3]
ak_animationArray[i][0].setAttribute("begin",ak_tmp)
}
else if(typeof(ak_animationArray[i][2])=="number")
{
ak_tmp=ak_round(ak_animationArray[i][2],1000)
if(ak_animationArray[i][3]) ak_tmp+=";"+ak_animationArray[i][3]
ak_animationArray[i][0].setAttribute("begin",ak_tmp)
}
else try{ak_animationArray[i][0].removeAttribute("begin")}catch(err){}
if(typeof(ak_animationArray[i][7])=="number") ak_animationArray[i][7]=ak_round(ak_animationArray[i][7],1000)
ak_animationArray[i][0].setAttribute("dur",ak_animationArray[i][7])
if(typeof(ak_animationArray[i][8])=="number") ak_animationArray[i][8]=ak_round(ak_animationArray[i][8],1000)
if(ak_animationArray[i][8]) ak_animationArray[i][0].setAttribute("repeatCount",ak_animationArray[i][8])
else try{ak_animationArray[i][0].removeAttribute("repeatCount")}catch(err){}
if(typeof(ak_animationArray[i][9])=="number") ak_animationArray[i][9]=ak_round(ak_animationArray[i][9],1000)
if(ak_animationArray[i][9]) ak_animationArray[i][0].setAttribute("repeatDur",ak_animationArray[i][9])
else if(typeof(ak_animationArray[i][9])=="number") ak_animationArray[i][0].setAttribute("repeatDur",ak_animationArray[i][9])
else try{ak_animationArray[i][0].removeAttribute("repeatDur")}catch(err){}
ak_animationArray[i][0].setAttribute("end","indefinite")
ak_animationArray[i][0].endElement()
if(ak_animationArray[i][4])
{
ak_tmp=ak_animationArray[i][4]
if(ak_animationArray[i][5]) ak_tmp+="+"+ak_round(ak_animationArray[i][5],1000)
if(ak_animationArray[i][6]) ak_tmp+=";"+ak_animationArray[i][6]
ak_animationArray[i][0].setAttribute("end",ak_tmp)
}
else if(typeof(ak_animationArray[i][5])=="number")
{
ak_tmp=ak_round(ak_animationArray[i][5],1000)
if(ak_animationArray[i][6]) ak_tmp+=";"+ak_animationArray[i][6]
ak_animationArray[i][0].setAttribute("end",ak_tmp)
}
else try{ak_animationArray[i][0].removeAttribute("end")}catch(err){}
}
ak_svgroot.setCurrentTime(ak_aniStop)
ak_timeline_pause=1
ak_buildInAni.endElement()
if(ak_checkLink.length>0)
{
for(var i=0;i<ak_checkLink.length;i++)
{
if(ak_checkLink[i][1])
{
if(ak_checkLink[i][3]) ak_checkLink[i][0].setAttribute("onclick",ak_checkLink[i][3])
else {try{ak_checkLink[i][0].removeAttribute("onclick")}catch(error){}}
if(ak_checkLink[i][2]) ak_checkLink[i][0].setAttribute("target",ak_checkLink[i][2])
else {try{ak_checkLink[i][0].removeAttribute("target")}catch(error){}}
}
}
}
ak_menu_status="ak_editor"
ak_SetGetRm_styleValue(document.getElementById("ak_wird_von_aks_.js_gefuellt"),"visibility","remove","no_cout")
ak_userspace_svg.firstChild.setAttribute("style",ak_lastStyle)
ak_timeMain(evt,"timeVariable")
ak_dirty_flag=ak_tmp_dirty
document.getElementById("ak_timeline_g").setAttribute("visibility","hidden")
if(ak_timeUndo.length>0) ak_undoFunction('clearUndo')
if(ak_which_nodeNr(ak_lastSelected)!=-1)
{
ak_lastSelected.parentNode.insertBefore(parseXML('<g/>',document).firstChild,ak_lastSelected)
ak_tmp=ak_lastSelected.previousSibling() // trick to real.getBBox data
ak_lastSelected.parentNode.insertBefore(ak_lastSelected,ak_tmp)
ak_lastSelected.parentNode.removeChild(ak_tmp)
ak_clickset_obj2update(evt,ak_lastSelected)
if(ak_color_action_on) ak_set_gradient_control(evt)
}
if(ak_toolBoxOn) ak_show_s_v(evt)
ak_check4animates()
break
case "Back to Aks SVG Editor":
if(ak_checkLink.length>0)
{
for(var i=0;i<ak_checkLink.length;i++)
{
if(ak_checkLink[i][1])
{
if(ak_checkLink[i][3]) ak_checkLink[i][0].setAttribute("onclick",ak_checkLink[i][3])
else {try{ak_checkLink[i][0].removeAttribute("onclick")}catch(error){}}
if(ak_checkLink[i][2]) ak_checkLink[i][0].setAttribute("target",ak_checkLink[i][2])
else {try{ak_checkLink[i][0].removeAttribute("target")}catch(error){}}
}
}
}
ak_xy_etc_shift=21
ak_menu_status="ak_editor"
ak_SetGetRm_styleValue(document.getElementById("ak_background_editor"),"visibility","remove","no_cout")
ak_SetGetRm_styleValue(ak_userspace_svg.firstChild,"visibility","remove","no_cout")
ak_SetGetRm_styleValue(document.getElementById("ak_wird_von_aks_.js_gefuellt"),"visibility","remove","no_cout")
ak_grid_zoom=ak_lastScale
ak_grid_pan_x=ak_lastPanX
ak_grid_pan_y=ak_lastPanY
document.getElementById("ak_internal_userSpace").setAttribute("transform",("matrix("+ak_grid_zoom+",0,0,"+ak_grid_zoom+","+(21+ak_grid_pan_x*ak_grid_zoom)+","+(21+ak_grid_pan_y*ak_grid_zoom)+")"))
ak_userspace_svg.firstChild.setAttribute("style",ak_lastStyle)
ak_animation("stop")
ak_cout("Back to Aks SVG Editor!")
if(ak_which_nodeNr(ak_lastSelected)!=-1) ak_clickset_obj2update(evt,ak_lastSelected)
ak_dirty_flag=ak_tmp_dirty
break
case "Save SVG to Clipboard":
ak_cout("Copy to Clipboard in progress ...")
setTimeout('ak_setTimeout("Save SVG to Clipboard")',10)
break
case "saveAs":
ak_io_wait.setAttribute('transform','translate('+(ak_mouse_x+2)+','+(ak_mouse_y-11)+')')
ak_io_wait.setAttribute('visibility','visible'); ak_io_wait_active=true
setTimeout("ak_SVGSaver('saveAs')",500)
break
case "Save2Disk":
ak_io_wait.setAttribute('transform','translate('+(ak_mouse_x+2)+','+(ak_mouse_y-11)+')')
ak_io_wait.setAttribute('visibility','visible'); ak_io_wait_active=true
setTimeout("ak_SVGSaver('Save2Disk')",500)
break
case "Load SVG, paste from Clipboard":
ak_cout("Load SVG from Clipboard in progress ...")
setTimeout('ak_setTimeout("Load SVG, paste from Clipboard")',10)
break
case "New untitled":
ak_cout("New SVG progress ...")
ak_setTimeout("New untitled")
break
case "New SVG, clear Userspace":
ak_cout("New SVG, clear Userspace in progress ...")
setTimeout('ak_setTimeout("New SVG, clear Userspace")',10)
break
case "EnterSVGwidth":
ak_tmp=ak_userspace_svg.getAttribute("width")
if(!ak_tmp) ak_tmp="100%"
var ak_tmpUW=ak_tmp
ak_tmp2=ak_userspace_svg.getAttribute("height")
if(!ak_tmp2) ak_tmp2="100%"
var ak_tmpUH=ak_tmp2
var ak_tmpW=ak_getAbsolutePixel(ak_tmp,"width",window.innerWidth,window.innerHeight)
var ak_tmpH=ak_getAbsolutePixel(ak_tmp2,"height",window.innerWidth,window.innerHeight)
var ak_tmp_viewBox=ak_userspace_svg.getAttribute("viewBox")
var ak_tmpUV=ak_tmp_viewBox
var ak_tmp3=""
var ak_tmpMag=false, ak_tmp_ratio_array=false, ak_tmpF="1    0    0"
if(ak_tmp_viewBox)
{
ak_tmp_viewBox=ak_tmp_viewBox.replace(/ +/g,";")
if(/;/.test(ak_tmp_viewBox)) var ak_tmp_viewBox_array=ak_tmp_viewBox.split(";")
else ak_tmp_viewBox_array=new Array(0,0,ak_tmpW,ak_tmpH)
var ak_tmp_ratio=ak_userspace_svg.getAttribute("preserveAspectRatio").replace(/^ +| +$/g,"")
ak_tmp_ratio_array=ak_tmp_ratio.replace(/ +/g,";").split(";")
if(ak_tmp_ratio_array[1]!="slice") ak_tmp_ratio_array[1]="meet"
ak_tmp_viewBox_array[0]=parseFloat(ak_tmp_viewBox_array[0])
ak_tmp_viewBox_array[0]=isNaN(ak_tmp_viewBox_array[0])?0:ak_tmp_viewBox_array[0]
ak_tmp_viewBox_array[1]=parseFloat(ak_tmp_viewBox_array[1])
ak_tmp_viewBox_array[1]=isNaN(ak_tmp_viewBox_array[1])?0:ak_tmp_viewBox_array[1]
ak_tmp_viewBox_array[2]=parseFloat(ak_tmp_viewBox_array[2])
ak_tmp_viewBox_array[2]=isNaN(ak_tmp_viewBox_array[2])?ak_tmpW:ak_tmp_viewBox_array[2]
ak_tmp_viewBox_array[2]=(ak_tmp_viewBox_array[2]==0)?ak_tmpW:ak_tmp_viewBox_array[2]
ak_tmp_viewBox_array[3]=parseFloat(ak_tmp_viewBox_array[3])
ak_tmp_viewBox_array[3]=isNaN(ak_tmp_viewBox_array[3])?ak_tmpH:ak_tmp_viewBox_array[3]
ak_tmp_viewBox_array[3]=(ak_tmp_viewBox_array[3]==0)?ak_tmpH:ak_tmp_viewBox_array[3]
var ak_tmpMX=false, ak_tmpMY
if(ak_tmp_ratio=="none")
{
ak_tmpMX=(ak_tmpW/ak_tmp_viewBox_array[2])
ak_tmpMY=(ak_tmpH/ak_tmp_viewBox_array[3])
ak_tmp3=ak_round(Math.pow((ak_tmpMX*ak_tmpMY),0.5),1000)
}
else if(ak_tmp_ratio_array[1]=="meet" && (ak_tmpW/ak_tmpH)<(ak_tmp_viewBox_array[2]/ak_tmp_viewBox_array[3]))
{
ak_tmp3=ak_round(ak_tmpW/ak_tmp_viewBox_array[2],1000)
}
else if(ak_tmp_ratio_array[1]=="meet")
{
ak_tmp3=ak_round(ak_tmpH/ak_tmp_viewBox_array[3],1000)
}
else if((ak_tmpW/ak_tmpH)>(ak_tmp_viewBox_array[2]/ak_tmp_viewBox_array[3]))
{
ak_tmp3=ak_round(ak_tmpW/ak_tmp_viewBox_array[2],1000)
}
else
{
ak_tmp3=ak_round(ak_tmpH/ak_tmp_viewBox_array[3],1000)
}
ak_tmpMag=ak_tmp3
ak_tmp3=" "+ak_tmp3
if(ak_tmpMX && (ak_tmp_viewBox_array[0] || ak_tmp_viewBox_array[1]))
{
ak_tmpF=ak_round(ak_tmp3,100)+"    "+ak_round((-ak_tmp_viewBox_array[0]*ak_tmpMX),100)+"    "+ak_round((-ak_tmp_viewBox_array[1]*ak_tmpMY),100)
ak_tmp3+=" "+ak_round((-ak_tmp_viewBox_array[0]*ak_tmpMX),100)+" "+ak_round((-ak_tmp_viewBox_array[1]*ak_tmpMY),100)

}
else if(ak_tmp_viewBox_array[0] || ak_tmp_viewBox_array[1])
{
ak_tmpF=ak_round(ak_tmpMag,100)+"    "+ak_round((-ak_tmp_viewBox_array[0]*ak_tmpMag),100)+"    "+ak_round((-ak_tmp_viewBox_array[1]*ak_tmpMag),100)
ak_tmp3+=" "+ak_round((-ak_tmp_viewBox_array[0]*ak_tmpMag),100)+" "+ak_round((-ak_tmp_viewBox_array[1]*ak_tmpMag),100)
}
else ak_tmpF=ak_round(ak_tmpMag,100)+"    "+ak_round((-ak_tmp_viewBox_array[0]*ak_tmpMag),100)+"    "+ak_round((-ak_tmp_viewBox_array[1]*ak_tmpMag),100)
}
var ak_tmpRet=prompt("Enter:  width  height  MagnifyFactor  Xoffset  Yoffset!\ne.g.:  "+Math.round(ak_tmpW)+"    "+Math.round(ak_tmpH)+"    "+ak_tmpF+"   (factor and offsets optional)",ak_tmp+" "+ak_tmp2+ak_tmp3)
if(!ak_tmpRet || ak_tmpRet==(ak_tmp+" "+ak_tmp2+ak_tmp3)) return
var ak_tmpValues
while(ak_tmpRet)
{
ak_tmpValues=ak_tmpRet.replace(/^ +| +$/g,"").replace(/ +/g," ")
if(!ak_tmpValues) return
ak_tmpValues=ak_tmpValues.split(" ")
if(ak_tmpValues.length>=2)
{
var ak_tmpW2=Math.round(ak_getAbsolutePixel(ak_tmpValues[0],"width",window.innerWidth,window.innerHeight))
var ak_tmpH2=Math.round(ak_getAbsolutePixel(ak_tmpValues[1],"height",window.innerWidth,window.innerHeight))
if(ak_tmpW2 && ak_tmpH2)
{
if(ak_tmpValues[2])
{
ak_tmpValues[2]=parseFloat(ak_tmpValues[2])
ak_tmpValues[2]=isNaN(ak_tmpValues[2])?1:ak_tmpValues[2]
ak_tmpValues[2]=(ak_tmpValues[2]==0)?1:ak_tmpValues[2]
if(ak_tmpMag)
{
ak_tmpValues[3]=parseFloat(ak_tmpValues[3])
ak_tmpValues[3]=isNaN(ak_tmpValues[3])?ak_tmp_viewBox_array[0]:ak_tmpValues[3]
ak_tmpValues[4]=parseFloat(ak_tmpValues[4])
ak_tmpValues[4]=isNaN(ak_tmpValues[4])?ak_tmp_viewBox_array[1]:ak_tmpValues[4]
}
else
{
ak_tmpValues[3]=parseFloat(ak_tmpValues[3])
ak_tmpValues[3]=isNaN(ak_tmpValues[3])?0:ak_tmpValues[3]
ak_tmpValues[4]=parseFloat(ak_tmpValues[4])
ak_tmpValues[4]=isNaN(ak_tmpValues[4])?0:ak_tmpValues[4]
}
}
if(ak_tmpMag && ak_tmpW && ak_tmpH)
{
ak_tmp_viewBox_array[2]*=(ak_tmpW2/ak_tmpW)
ak_tmp_viewBox_array[3]*=(ak_tmpH2/ak_tmpH)
if(ak_tmpValues[2])
{
ak_tmp=(ak_tmpMag/ak_tmpValues[2])
ak_tmp_viewBox_array[0]=(-ak_tmpValues[3]/ak_tmpValues[2])
ak_tmp_viewBox_array[1]=(-ak_tmpValues[4]/ak_tmpValues[2])
ak_tmp_viewBox_array[2]*=ak_tmp
ak_tmp_viewBox_array[3]*=ak_tmp
}
}
else if(ak_tmpValues[2])
{
ak_tmp_viewBox_array=new Array((-ak_tmpValues[3]/ak_tmpValues[2]),(-ak_tmpValues[4]/ak_tmpValues[2]))
ak_tmp_viewBox_array[2]=ak_tmpW2/ak_tmpValues[2]
ak_tmp_viewBox_array[3]=ak_tmpH2/ak_tmpValues[2]
}
if(ak_tmp_viewBox_array)
{
for(var i=0;i<4;i++){ak_tmp_viewBox_array[i]=ak_round(ak_tmp_viewBox_array[i],10)}
if(
ak_tmp_viewBox_array[0]==0 &&
ak_tmp_viewBox_array[1]==0 &&
ak_tmp_viewBox_array[2]==ak_tmpValues[0] &&
ak_tmp_viewBox_array[3]==ak_tmpValues[1])
{
try{ak_userspace_svg.removeAttribute("viewBox")}catch(err){}
}
else ak_userspace_svg.setAttribute("viewBox",ak_tmp_viewBox_array.join(" "))
}
if(!/\d$/.test(ak_tmpValues[0])) ak_userspace_svg.setAttribute("width",ak_tmpValues[0])
else ak_userspace_svg.setAttribute("width",ak_tmpW2)
if(!/\d$/.test(ak_tmpValues[1])) ak_userspace_svg.setAttribute("height",ak_tmpValues[1])
else ak_userspace_svg.setAttribute("height",ak_tmpH2)
if(ak_menu_status=="timeline")
{
ak_tmp=ak_timeUndo.length
ak_timeUndo[ak_tmp]=new Array
ak_timeUndo[ak_tmp][0]="svg"
ak_timeUndo[ak_tmp][1]=ak_tmpUW
ak_timeUndo[ak_tmp][2]=ak_tmpUH
if(ak_tmpUV) ak_timeUndo[ak_tmp][3]=ak_tmpUV
else ak_timeUndo[ak_tmp][3]=false
ak_timeRedo=new Array
ak_cout("")
}
else ak_push2undoTrue()
break
}
}
ak_tmpRet=prompt("Enter:  width  height  MagnifyFactor  Xoffset  Yoffset!\ne.g.:  "+Math.round(ak_tmpW)+"    "+Math.round(ak_tmpH)+"    "+ak_tmpF+"   (factor and offsets optional)",ak_tmpValues.join(" "))
}
if(ak_object2update_nodeNr!=-1) ak_clickset_obj2update(evt,ak_object2update)
break
case "Edit SVG rootElement":EnterSVGwidth
ak_clickset_obj2update(evt,ak_userspace_svg)
break
case "autoStart":
var ak_tmp_load=ak_userspace_svg.getAttribute("onload")
if(/^try\{ak_init_editor\(evt\)/.test(ak_tmp_load)) ak_tmp_load=ak_tmp_load.replace(/^try\{ak_init_editor\(evt\)/,"try{ak_init_editor(evt,\'menu\')")
else if(/^try\{ak_init_editor\(evt\,\'menu\'\)/.test(ak_tmp_load))
{ak_tmp_load=ak_tmp_load.replace(/^try\{ak_init_editor\(evt\,\'menu\'\)/,"try{ak_init_editor(evt)")}
else if(ak_tmp_load) ak_tmp_load="try{ak_init_editor(evt)}catch(err){};"+ak_tmp_load
else ak_tmp_load="try{ak_init_editor(evt)}catch(err){}" // zur Sicherheit
ak_userspace_svg.setAttribute("onload",ak_tmp_load)
ak_dirty_flag=true
break
case "pasteFromClipboard":
ak_cout("[Ctrl+V] paste from Clipboard in progress ...")
if(insert_append) setTimeout('ak_setTimeout("pasteFromClipboard","'+insert_append+'")',100)
else setTimeout('ak_setTimeout("pasteFromClipboard")',100)
break
case "[Ctrl+G]":
ak_cout("[Ctrl+G] replace from Clipboard (Id-match) in progress ...")
setTimeout("ak_setTimeout('replaceFromClipboard')",100)
break
}
}
// ############    ################
function ak_grid_menu(evt,mouse)
{
if (evt.type=="mousedown" && evt.getButton==2)
{
var ak_tmp_pattern=ak_userspace_svg.getElementsByTagName("pattern")
var ak_newNode='<menu id="ak_grid_menu_pattern"><header>   Grid ON (select pattern)</header>'
if(/^#/.test(ak_grid_what)) ak_newNode='<menu id="ak_grid_menu_pattern"><header>&#187; Grid ON (select pattern)</header>'
if(ak_tmp_pattern.length==0) ak_newNode+='<item enabled="no">no pattern</item>'
else
{
var ak_tmp_set=""
if(/^#/.test(ak_grid_what)) ak_tmp_set=ak_grid_what.substring(1)
var ak_tmp_id=new Array()
for(var i=0;i<ak_tmp_pattern.length;i++)
{
var ak_tmp=ak_tmp_pattern.item(i).getId()
if(ak_tmp)
{
if(ak_tmp==ak_tmp_set) ak_newNode+='<item checked="yes" onactivate="'+"ak_grid_on_off(evt,'on_pattern','"+ak_tmp+"')"+'">'+ak_tmp+'</item>'
else ak_newNode+='<item onactivate="'+"ak_grid_on_off(evt,'on_pattern','"+ak_tmp+"')"+'">'+ak_tmp+'</item>'
}
}

}
ak_newNode+='</menu>'
document.getElementById("ak_grid_menu_pattern").parentNode.replaceChild(parseXML(ak_newNode,document).firstChild,document.getElementById("ak_grid_menu_pattern"))
contextMenu().replaceChild(parseXML(printNode(getDocument().getElementById("ak_grid_menu_xml")),getContextMenu()).firstChild,getContextMenu().firstChild);
return;
}
if (evt.type=="mousedown" && evt.getButton!=2)
{
document.getElementById("ak_use_right_mouse_button").setAttribute("transform","matrix(1,0,0,1,"+(evt.clientX-25)+","+(evt.clientY+10)+")")
document.getElementById("ak_use_right_mouse_button").setAttribute("style","visibility:visible")
}
if(evt.type=="mouseup" || evt.type=="mouseout")
{
document.getElementById("ak_use_right_mouse_button").setAttribute("style","visibility:hidden")
}
}
// ############    ################
var ak_grid_what=""
function ak_grid_on_off(evt,on_off,pattern)
{
var ak_tmp_menu=document.getElementById("ak_grid_menu_xml").childNodes
if(!/^Zoom|^reset/.test(on_off))
{
ak_tmp_menu.item(3).firstChild.firstChild.data="   Grid ON (select pattern)"
for(var i=1;i<8;i++) {ak_tmp_menu.item(i).setAttribute("checked","no")}
}
switch(on_off)
{
case "on":
ak_tmp_menu.item(1).setAttribute("checked","yes")
ak_grid_on_flag="Grid ON";
ak_grid_what="Grid ON"
document.getElementById("ak_grid_dark").setAttribute("style","fill:#ddd")
ak_userspace_svg.firstChild.setAttribute("style","fill:url(#ak_internal_grid_fill);stroke:none;visibility:visible;opacity:1;fill-opacity:1")
ak_write_grid_status(((ak_grid_pan_x*-1)+","+(ak_grid_pan_y*-1)+" | x"+ak_grid_zoom+" | "+ak_grid_on_flag))
break
case "on_dark":
ak_tmp_menu.item(2).setAttribute("checked","yes")
ak_grid_on_flag="Grid ON"
ak_grid_what="Grid ON (dark)"
document.getElementById("ak_grid_dark").setAttribute("style","fill:#444")
ak_userspace_svg.firstChild.setAttribute("style","fill:url(#ak_internal_grid_fill);stroke:none;visibility:visible;opacity:1;fill-opacity:1")
ak_write_grid_status(((ak_grid_pan_x*-1)+","+(ak_grid_pan_y*-1)+" | x"+ak_grid_zoom+" | "+ak_grid_on_flag))
break
case "on_pattern":
ak_tmp_menu.item(3).firstChild.firstChild.data="* Grid ON (select pattern)"
ak_grid_on_flag="Grid ON"
ak_grid_what="#"+pattern
document.getElementById("ak_grid_dark").setAttribute("style","fill:#444")
ak_userspace_svg.firstChild.setAttribute("style","fill:url(#"+pattern+");stroke:none;visibility:visible;opacity:1;fill-opacity:1")
ak_write_grid_status(((ak_grid_pan_x*-1)+","+(ak_grid_pan_y*-1)+" | x"+ak_grid_zoom+" | "+ak_grid_on_flag))
break
case "off":
ak_tmp_menu.item(6).setAttribute("checked","yes")
ak_grid_on_flag="Grid OFF"
ak_grid_what="Grid OFF"
ak_userspace_svg.firstChild.setAttribute("style","fill:#fff;stroke:none;visibility:visible;opacity:1;fill-opacity:1")
ak_write_grid_status(((ak_grid_pan_x*-1)+","+(ak_grid_pan_y*-1)+" | x"+ak_grid_zoom+" | "+ak_grid_on_flag))
break
case "off_color":
ak_tmp_menu.item(7).setAttribute("checked","yes")
ak_grid_on_flag="Grid OFF"
ak_grid_what="Grid OFF (toolbox color)"
var ak_tmp_color=ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")
ak_userspace_svg.firstChild.setAttribute("style","fill:"+ak_tmp_color+";stroke:none;visibility:visible;opacity:1;fill-opacity:1")
ak_setAttribute(document.getElementById("ak_no_selection"),"fill",ak_tmp_color)
ak_write_grid_status(((ak_grid_pan_x*-1)+","+(ak_grid_pan_y*-1)+" | x"+ak_grid_zoom+" | "+ak_grid_on_flag))
break
case "reset":
ak_grid_zoom=1
ak_grid_pan_x=0
ak_grid_pan_y=0
document.getElementById("ak_internal_userSpace").setAttribute("transform","matrix(1,0,0,1,21,21)")
ak_write_grid_status(((ak_grid_pan_x*-1)+","+(ak_grid_pan_y*-1)+" | x"+ak_grid_zoom+" | "+ak_grid_on_flag),93)
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
break
case "on_reset":
ak_tmp_menu.item(1).setAttribute("checked","yes")
ak_grid_zoom=1
ak_grid_pan_x=0
ak_grid_pan_y=0
ak_grid_on_flag="Grid ON"
ak_grid_what="Grid ON"
document.getElementById("ak_internal_userSpace").setAttribute("transform","matrix(1,0,0,1,21,21)")
document.getElementById("ak_grid_dark").setAttribute("style","fill:#ddd")
ak_userspace_svg.firstChild.setAttribute("style","fill:url(#ak_internal_grid_fill);stroke:none;visibility:visible;opacity:1;fill-opacity:1")
ak_write_grid_status(((ak_grid_pan_x*-1)+","+(ak_grid_pan_y*-1)+" | x"+ak_grid_zoom+" | "+ak_grid_on_flag),93)
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
break
case "off_reset":
ak_tmp_menu.item(6).setAttribute("checked","yes")
ak_grid_zoom=1
ak_grid_pan_x=0
ak_grid_pan_y=0
ak_grid_on_flag="Grid OFF"
ak_grid_what="Grid OFF"
document.getElementById("ak_internal_userSpace").setAttribute("transform","matrix(1,0,0,1,21,21)")
ak_userspace_svg.firstChild.setAttribute("style","fill:#fff;stroke:none;visibility:visible;opacity:1;fill-opacity:1")
ak_write_grid_status(((ak_grid_pan_x*-1)+","+(ak_grid_pan_y*-1)+" | x"+ak_grid_zoom+" | "+ak_grid_on_flag))
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
break
case "ZoomIn":
var ak_user_org_x=((ak_mouse_x-ak_xy_etc_shift)/ak_grid_zoom)-ak_grid_pan_x
var ak_user_org_y=((ak_mouse_y-ak_xy_etc_shift)/ak_grid_zoom)-ak_grid_pan_y
if (ak_grid_zoom<1) ak_grid_zoom=ak_grid_zoom*2
else if (ak_grid_zoom>7) ak_grid_zoom+=4
else if (ak_grid_zoom>3) ak_grid_zoom+=2
else ak_grid_zoom+=1
if (ak_grid_zoom>16) ak_grid_zoom=16
ak_grid_pan_x=parseInt(((ak_mouse_x-ak_xy_etc_shift)/ak_grid_zoom)-ak_user_org_x)
ak_grid_pan_y=parseInt(((ak_mouse_y-ak_xy_etc_shift)/ak_grid_zoom)-ak_user_org_y)
document.getElementById("ak_internal_userSpace").setAttribute("transform",("matrix("+ak_grid_zoom+",0,0,"+ak_grid_zoom+","+(ak_xy_etc_shift+ak_grid_pan_x*ak_grid_zoom)+","+(ak_xy_etc_shift+ak_grid_pan_y*ak_grid_zoom)+")"))
ak_userspace_svg.firstChild.setAttribute("style",ak_userspace_svg.firstChild.getAttribute("style"))
ak_write_grid_status(((ak_grid_pan_x*-1)+","+(ak_grid_pan_y*-1)+" | x"+ak_grid_zoom+" | "+ak_grid_on_flag))
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
break
case "ZoomOut":
var ak_user_org_x=((ak_mouse_x-ak_xy_etc_shift)/ak_grid_zoom)-ak_grid_pan_x
var ak_user_org_y=((ak_mouse_y-ak_xy_etc_shift)/ak_grid_zoom)-ak_grid_pan_y
if (ak_grid_zoom>8) ak_grid_zoom-=4
else if (ak_grid_zoom>4) ak_grid_zoom-=2
else if (ak_grid_zoom>2) ak_grid_zoom-=1
else ak_grid_zoom/=2
if (ak_grid_zoom<1/16) ak_grid_zoom=1/16
ak_grid_pan_x=parseInt(((ak_mouse_x-ak_xy_etc_shift)/ak_grid_zoom)-ak_user_org_x)
ak_grid_pan_y=parseInt(((ak_mouse_y-ak_xy_etc_shift)/ak_grid_zoom)-ak_user_org_y)
document.getElementById("ak_internal_userSpace").setAttribute("transform",("matrix("+ak_grid_zoom+",0,0,"+ak_grid_zoom+","+(ak_xy_etc_shift+ak_grid_pan_x*ak_grid_zoom)+","+(ak_xy_etc_shift+ak_grid_pan_y*ak_grid_zoom)+")"))
// refresh grid
ak_userspace_svg.firstChild.setAttribute("style",ak_userspace_svg.firstChild.getAttribute("style"))
ak_write_grid_status(((ak_grid_pan_x*-1)+","+(ak_grid_pan_y*-1)+" | x"+ak_grid_zoom+" | "+ak_grid_on_flag))
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
break
case "ZoomReset":
ak_grid_zoom=1
ak_grid_pan_x=0
ak_grid_pan_y=0
document.getElementById("ak_internal_userSpace").setAttribute("transform",("matrix("+ak_grid_zoom+",0,0,"+ak_grid_zoom+","+(ak_xy_etc_shift+ak_grid_pan_x*ak_grid_zoom)+","+(ak_xy_etc_shift+(ak_grid_pan_y*ak_grid_zoom))+")"))
ak_userspace_svg.firstChild.setAttribute("style",ak_userspace_svg.firstChild.getAttribute("style"))
ak_write_grid_status((ak_grid_pan_x*-1)+","+(ak_grid_pan_y*-1)+" | x"+ak_grid_zoom+" | "+ak_grid_on_flag)
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
break
}
}
// ############    ################
function ak_write_grid_status(status_text,text_length)
{
status_text=status_text.split(" | ")
status_text.pop()
status_text=status_text.join(" | ")
ak_cout2id("ak_grid_position_text",status_text)
if(text_length) var ak_tmp_length=text_length
else var ak_tmp_length=Math.round(document.getElementById("ak_grid_position_text").getComputedTextLength)
if(ak_tmp_length==0) return
document.getElementById("ak_grid_position_rect").setAttribute("width",ak_tmp_length+14)
document.getElementById("ak_elementTree_rect").setAttribute("x",ak_tmp_length+38)
document.getElementById("ak_elementTree_text").setAttribute("x",ak_tmp_length+44)
document.getElementById("ak_elementByTag_rect").setAttribute("x",ak_tmp_length+151)
document.getElementById("ak_elementByTag_text").setAttribute("x",ak_tmp_length+157)
document.getElementById("ak_editAnimation_rect").setAttribute("x",ak_tmp_length+299)
document.getElementById("ak_editAnimation_text").setAttribute("x",ak_tmp_length+305)
}
//  #########   makes  ####################################################################
function ak_make_pattern(id,pU,x,y,w,h,g_append)
{
var neuer_knoten=document.createElement("pattern");
neuer_knoten.setAttribute("id",id);
neuer_knoten.setAttribute("patternUnits",pU);
neuer_knoten.setAttribute("x",x);
neuer_knoten.setAttribute("y",y);
neuer_knoten.setAttribute("width",w);
neuer_knoten.setAttribute("height",h);
g_append.appendChild(neuer_knoten);        
}
function ak_make_radialGradient(id,gU,cx,cy,r,fx,fy,g_append)
{
var neuer_knoten=document.createElement("radialGradient");
neuer_knoten.setAttribute("id",id);
neuer_knoten.setAttribute("gradientUnits",gU);
neuer_knoten.setAttribute("cx",cx);
neuer_knoten.setAttribute("cy",cy);
neuer_knoten.setAttribute("r",r);
neuer_knoten.setAttribute("fx",fx);
neuer_knoten.setAttribute("fy",fy);
g_append.appendChild(neuer_knoten);        
}
function ak_make_linearGradient(id,gU,x1,y1,x2,y2,g_append)
{
var neuer_knoten=document.createElement("linearGradient");
neuer_knoten.setAttribute("id",id);
neuer_knoten.setAttribute("gradientUnits",gU);
neuer_knoten.setAttribute("x1",x1);
neuer_knoten.setAttribute("y1",y1);
neuer_knoten.setAttribute("x2",x2);
neuer_knoten.setAttribute("y2",y2);
g_append.appendChild(neuer_knoten);        
}
function ak_make_stop(id,o,s,g_append)
{
var neuer_knoten=document.createElement("stop");
neuer_knoten.setAttribute("id",id);
neuer_knoten.setAttribute("offset",o);
neuer_knoten.setAttribute("style",s);
g_append.appendChild(neuer_knoten);        
}

function ak_make_line(x1,y1,x2,y2,s,g_append)
{
var neuer_knoten=document.createElement("line");
neuer_knoten.setAttribute("x1",x1);
neuer_knoten.setAttribute("y1",y1);
neuer_knoten.setAttribute("x2",x2);
neuer_knoten.setAttribute("y2",y2);
neuer_knoten.setAttribute("style",s);
g_append.appendChild(neuer_knoten);        
}
function ak_make_polyline(id,points,s,g_append)
{
var neuer_knoten=document.createElement("polyline");
neuer_knoten.setAttribute("id",id);
neuer_knoten.setAttribute("points",points);
neuer_knoten.setAttribute("style",s);
g_append.appendChild(neuer_knoten);        
}
function ak_make_polygon(id,points,s,g_append)
{
var neuer_knoten=document.createElement("polygon");
neuer_knoten.setAttribute("id",id);
neuer_knoten.setAttribute("points",points);
neuer_knoten.setAttribute("style",s);
g_append.appendChild(neuer_knoten);        
}
function ak_make_circle(id,cx,cy,r,s,g_append)
{
var neuer_knoten=document.createElement("circle");
neuer_knoten.setAttribute("id",id);
neuer_knoten.setAttribute("cx",cx);
neuer_knoten.setAttribute("cy",cy);
neuer_knoten.setAttribute("r",r);
neuer_knoten.setAttribute("style",s);
g_append.appendChild(neuer_knoten);        
}
function ak_make_rect(id,x,y,w,h,s,g_append)
{
var neuer_knoten=document.createElement("rect");
neuer_knoten.setAttribute("id",id);
neuer_knoten.setAttribute("x",x);
neuer_knoten.setAttribute("y",y);
neuer_knoten.setAttribute("width",w);
neuer_knoten.setAttribute("height",h);
neuer_knoten.setAttribute("style",s);
g_append.appendChild(neuer_knoten);        
}
function ak_make_g_use(id,g_append)
{
var neuer_knoten=document.createElement("g");
neuer_knoten.setAttribute("id",id);
neuer_knoten.setAttribute("style","opacity:0");
g_append.appendChild(neuer_knoten);        
}
function ak_make_g(id,transform,style,mouse_move,mouse_out,mouse_down,mouse_up,mouse_click,g_append)
{
var neuer_knoten=document.createElement("g");
neuer_knoten.setAttribute("id",id);
neuer_knoten.setAttribute("transform",transform);
neuer_knoten.setAttribute("style",style);
neuer_knoten.setAttribute("onmousemove",mouse_move);
neuer_knoten.setAttribute("onmouseout",mouse_out);
neuer_knoten.setAttribute("onmousedown",mouse_down);
neuer_knoten.setAttribute("onmouseup",mouse_up);
neuer_knoten.setAttribute("onclick",mouse_click);
g_append.appendChild(neuer_knoten);        
}
function ak_make_mouse2id(id,mouse_move,mouse_out,mouse_down,mouse_up,mouse_click)
{
var temp_set=document.getElementById(id);
temp_set.setAttribute("onmousemove",mouse_move);
temp_set.setAttribute("onmouseout",mouse_out);
temp_set.setAttribute("onmousedown",mouse_down);
temp_set.setAttribute("onmouseup",mouse_up);
temp_set.setAttribute("onclick",mouse_click);
}
function ak_make_animate(id,a_name,begin,end,dur,fill,calc,values,g_append)
{
var neuer_knoten=document.createElement("animate");
neuer_knoten.setAttribute("id",id);
neuer_knoten.setAttribute("attributeName",a_name);
neuer_knoten.setAttribute("begin",begin);
neuer_knoten.setAttribute("end",end);
neuer_knoten.setAttribute("dur",dur);
neuer_knoten.setAttribute("fill",fill);
neuer_knoten.setAttribute("calcMode",calc);
neuer_knoten.setAttribute("values",values);
g_append.appendChild(neuer_knoten);        
}
function ak_make_text(id,x,y,s,text,g_append)
{
var neuer_knoten=document.createElement("text");
neuer_knoten.setAttribute("id",id);
neuer_knoten.setAttribute("x",x);
neuer_knoten.setAttribute("y",y);
neuer_knoten.setAttribute("style",s);
var neu_append=g_append.appendChild(neuer_knoten);        
g_append.lastChild.appendChild(document.createTextNode(text));
}
function ak_make_menu(id,g_append)
{
var neuer_knoten=document.createElement("menu");
neuer_knoten.setAttribute("id",id);
g_append.appendChild(neuer_knoten);        
}
function ak_make_separator(g_append)
{
var neuer_knoten=document.createElement("separator");
g_append.appendChild(neuer_knoten);        
}
function ak_make_header(text,g_append)
{
var neuer_knoten=document.createElement("header");
g_append.appendChild(neuer_knoten);        
g_append.lastChild.appendChild(document.createTextNode(text));
}
function ak_make_item(id,checked,action,onactivate,text,g_append)
{
var neuer_knoten=document.createElement("item");
neuer_knoten.setAttribute("id",id);
neuer_knoten.setAttribute("checked",checked);
neuer_knoten.setAttribute("action",action);
neuer_knoten.setAttribute("onactivate",onactivate);
g_append.appendChild(neuer_knoten);        
g_append.lastChild.appendChild(document.createTextNode(text));
}
//   ############  viele Slider und Buttons  ##############################################################
// ######################################################
var ak_stop_slider_nr=10
function ak_init_slider(evt,nr)
{
if(nr)
{
switch(nr)
{
case 1: return // skewX
case 2: return // skewY
case 3: return // rotate
case 4: return // scaleX
case 5: return // scaleY
case 6: evt="opacity";break
case 7: evt="fill-opacity";break
case 8: evt="stroke-opacity";break
case 9: evt="stroke-width";break
case 10: evt="stop-opacity";break
case 11: evt="flood-opacity";break
default: return
}
}
var ak_tmp=0, ak_tmpEnd      
if(evt=="all") ak_tmpEnd=ak_sliderArrayV3.length
else if(evt=="first4") ak_tmpEnd=ak_sliderArrayV3.length-2
else
{
for(var i=0;i<ak_sliderArrayV3.length;i++)
{
if(ak_sliderArrayV3[i][2]==evt)
{
break
}
}
if(i>=ak_sliderArrayV3.length) return
ak_tmp=i
ak_tmpEnd=ak_tmp+1
}
var ak_tmp2, ak_tmpData, ak_tmpTrans, ak_tmpCol
for(var nr=ak_tmp;nr<ak_tmpEnd;nr++)
{
if(ak_sliderArrayV3[nr][2]=="stop-opacity")
{
ak_tmp2=ak_getAttribute(ak_gradient2edit.childNodes.item(ak_gradient_stop_index),ak_sliderArrayV3[nr][2])
}
else if(ak_sliderArrayV3[nr][2]=="flood-opacity" && ak_edit_gradient_flag=="filter" && ak_gradient_stop_index!=-1)
{ak_tmp2=ak_getAttribute(ak_getObject(ak_gradient_stop_index),ak_sliderArrayV3[nr][2])}
else ak_tmp2=ak_getAttribute(ak_object2update,ak_sliderArrayV3[nr][2])
if(ak_sliderArrayV3[nr][2]=="stroke-width")
{
if(ak_tmp2=="false")
{
ak_tmpData="off"
ak_tmpCol="#eee"
ak_tmpTrans="translate(0,33)"
}
else
{
ak_tmp2=parseFloat(ak_tmp2)
if(ak_tmp2>100) ak_tmpData=">100"
else ak_tmpData=ak_tmp2
if(ak_tmp2>10) ak_tmpTrans="translate(0,78)"
else ak_tmpTrans="translate(0,"+(28+(ak_tmp2*5))+")"
ak_tmpCol="#ee0"
}
}
else if(ak_tmp2=="false")
{
ak_tmpData="off"
ak_tmpCol="#eee"
ak_tmpTrans="translate(0,78)"
}
else
{
if(ak_tmp2>1) ak_tmp2=1
ak_tmpTrans="translate(0,"+(28+(ak_tmp2*50))+")"
ak_tmpData=ak_tmp2
ak_tmpCol="#ee0"
}
if(ak_tmpData!=ak_sliderArrayV3[nr][1].firstChild.nextSibling.firstChild.data) ak_sliderArrayV3[nr][1].firstChild.nextSibling.firstChild.data=ak_tmpData
if(ak_tmpCol!=ak_sliderArrayV3[nr][1].firstChild.getAttribute("fill")) ak_sliderArrayV3[nr][1].firstChild.setAttribute("fill",ak_tmpCol)
if(ak_tmpTrans!=ak_sliderArrayV3[nr][1].firstChild.getAttribute("transform")) ak_sliderArrayV3[nr][1].setAttribute("transform",ak_tmpTrans)
if(evt=="stop-opacity" && ak_getAttribute(ak_sliderArrayV3[nr][0].parentNode,"visibility")=="hidden")
{ak_rmAttribute(ak_sliderArrayV3[nr][0].parentNode,"visibility")}
else if(evt=="flood-opacity" && ak_getAttribute(ak_sliderArrayV3[nr][0].parentNode,"visibility")=="hidden")
{ak_rmAttribute(ak_sliderArrayV3[nr][0].parentNode,"visibility")}
}
}
// ######################################################
function ak_init_buttonV3()
{
var ak_tmp="#1d1"
if(ak_getAttribute(ak_object2update,"transform")=="false") ak_tmp=ak_eee
if(ak_buttonTransform.getAttribute("fill")!=ak_tmp) ak_buttonTransform.setAttribute("fill",ak_tmp)
ak_tmp="#e0c"
var ak_tmp2=ak_getAttribute(ak_object2update,"visibility")
if(ak_tmp2=="false")
{
ak_tmp=ak_eee
ak_tmp2="visib.."
}
if(ak_buttonVisibility.getAttribute("fill")!=ak_tmp) ak_buttonVisibility.setAttribute("fill",ak_tmp)
ak_tmp2=ak_tmp2.replace(/^ +| +$/g,"")
if(ak_tmp2.length>8) ak_tmp2=ak_tmp2.substring(0,6)+".?"
if(ak_buttonVisibility.nextSibling.firstChild.data!=ak_tmp2) ak_buttonVisibility.nextSibling.firstChild.data=ak_tmp2
var ak_tmpFill="#0ee", ak_tmpStroke="#0ee", ak_tmpFilter="#0ee"
ak_tmp=ak_getAttribute(ak_object2update,"fill")
ak_tmp2=ak_getAttribute(ak_object2update,"stroke")
var ak_tmp3=ak_getAttribute(ak_object2update,"filter")
if(ak_tmp=="false") ak_tmpFill=ak_eee
if(ak_tmp2=="false") ak_tmpStroke=ak_eee
if(ak_tmp3=="false") ak_tmpFilter=ak_eee
ak_color_action_on=""
ak_edit_gradient_flag=false
while(true)
{
if(ak_tmp3!="false" && ak_filter4 && ak_which_nodeNr(ak_filter4)==ak_object2update_nodeNr)
{
ak_tmpFilter="#fe0"
ak_edit_gradient_flag="filter"
ak_color_action_on="filter"
break
}
if(/^url/.test(ak_tmp2))
{
if(ak_strokeUrl4  && ak_which_nodeNr(ak_strokeUrl4)==ak_object2update_nodeNr)
{
ak_tmpStroke="#fe0"
ak_color_action_on="stroke_url"
ak_edit_gradient_flag=true
break
}
}
else if(!/(false)|(none)/.test(ak_tmp2) && ak_stroke4 && ak_which_nodeNr(ak_stroke4)==ak_object2update_nodeNr)
{
ak_tmpStroke="#fe0"
ak_color_action_on="stroke"
ak_set_hex2hue(evt,"stroke")
break
}
if(/^url/.test(ak_tmp))
{
if(ak_fillUrl4  && ak_which_nodeNr(ak_fillUrl4)==ak_object2update_nodeNr)
{
ak_tmpFill="#fe0"
ak_color_action_on="fill_url"
ak_edit_gradient_flag=true
break
}
}
else if(!/(false)|(none)/.test(ak_tmp))
{
ak_tmpFill="#fe0"
ak_color_action_on="fill"
ak_set_hex2hue(evt,ak_color_action_on)
break
}
if(!/(false)|(none)|^url/.test(ak_tmp2))
{
ak_tmpStroke="#fe0"
ak_color_action_on="stroke"
ak_set_hex2hue(evt,ak_color_action_on)
}
break
}
if(ak_buttonFill.getAttribute("fill")!=ak_tmpFill) ak_buttonFill.setAttribute("fill",ak_tmpFill)
if(ak_buttonStroke.getAttribute("fill")!=ak_tmpStroke) ak_buttonStroke.setAttribute("fill",ak_tmpStroke)
if(ak_buttonFilter.getAttribute("fill")!=ak_tmpFilter) ak_buttonFilter.setAttribute("fill",ak_tmpFilter)
if(ak_tmp=="none") ak_buttonFill.nextSibling.setAttribute("text-decoration","line-through")
else ak_buttonFill.nextSibling.setAttribute("text-decoration","")
if(ak_tmp2=="none") ak_buttonStroke.nextSibling.setAttribute("text-decoration","line-through")
else ak_buttonStroke.nextSibling.setAttribute("text-decoration","")
}
// ######################################################
window.ak_init_set4object=ak_init_set4object
var ak_filter4=false, ak_fillUrl4=false, ak_strokeUrl4=false, ak_stroke4=false
var ak_eee="#ccc", ak_on="#fe0", ak_off=ak_eee
// ##########################
function ak_init_set4object(evt)
{
//if(ak_SetGetRm_styleValue(document.getElementById("ak_s_v_show"),"visibility","get")=="hidden") return
ak_init_buttonV3()
ak_init_slider("first4")
}
// ######################################################
function ak_init_button_set(evt)
{
ak_filter=''      
ak_matrix=''
// ak_save ak_init_button(4,1)
}
// ######################################################
var ak_standard_button_array=new Array
function ak_make_standard_button(evt,x,y,button_action,button_text,g_append,custom)
{
ak_standard_button_array.push(button_action)
ak_make_g(("ak_standard_button_g_"+button_action),("matrix(1,0,0,1,"+x+","+y+")"),"","","","","","",g_append)
g_append=g_append.lastChild
if(!custom)
{
ak_make_rect("ak_standard_button_"+button_action,0,0,40,13,"fill:#888;stroke:#000000",g_append)
ak_make_text("",20,10,"stroke:none;fill:#123456;font-size:10;text-anchor:middle",button_text,g_append)
ak_make_rect("",0,0,40,13,"fill:#ff0000;opacity:0",g_append)
g_append.lastChild.setAttribute("onmousedown",("ak_Fstandard_button(evt,'"+button_action+"')"))
if(button_action=="fill_url" || button_action=="stroke_url" || button_action=="filter")
{ g_append.lastChild.setAttribute("onmouseup",("ak_Fstandard_button(evt,'"+button_action+"')")) }
}
else if(button_action=="rm_translate")
{
ak_make_polyline("ak_standard_button_"+button_action,"0 0, 80 0, 80 13, 40 13","fill:#7b7;stroke:none",g_append)
ak_make_polygon("ak_standard_button_rm_matrix","0 0, 0 26, 40 26, 40 13","fill:#b77;stroke:none",g_append)
ak_make_line(0,1,40,13,"stroke:#aaa;stroke-width:2",g_append)
ak_make_text("",41,10,"stroke:none;fill:#123456;font-size:10;text-anchor:middle",button_text,g_append)
ak_make_text("",20,22,"stroke:none;fill:#123456;font-size:10;text-anchor:middle","matrix",g_append)
ak_make_polyline("","0 0, 80 0, 80 13, 40 13","fill:#000;stroke:#000;stroke-width:1;fill-opacity:0",g_append)
g_append.lastChild.setAttribute("onmousedown",("ak_Fcustom_button(evt,'"+button_action+"')"))
g_append.lastChild.setAttribute("onmouseup",("ak_Fcustom_button(evt,'"+button_action+"')"))
}
else if(button_action=="rm_matrix")
{
ak_make_polyline("","0 0, 0 26, 40 26, 40 13","fill:#000;stroke:#000;stroke-width:1;fill-opacity:0",g_append)
g_append.lastChild.setAttribute("onmousedown",("ak_Fcustom_button(evt,'"+button_action+"')"))
g_append.lastChild.setAttribute("onmouseup",("ak_Fcustom_button(evt,'"+button_action+"')"))
}
}
// ######################################################
function ak_set_transform(evt,entry,value,value2)
{
var ak_tmp_trans=ak_SetGetRm_transformValue(ak_object2update,entry,"get","no_cout")
if(entry=="remove")
{
var ak_tmpIn=ak_object2update.getAttribute("transform")
var ak_tmp
if(ak_tmpIn)
{
if(/\)/.test(ak_tmpIn))
{
ak_tmp=ak_tmpIn.split(")")
ak_tmp.pop()
}
else ak_tmp=new Array(ak_tmpIn)
ak_tmp.splice(value,1)
if(ak_tmp.length>0) ak_object2update.setAttribute("transform",ak_tmp.join(")")+")")
else ak_rmAttribute(ak_object2update,"transform")
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
ak_push2undoTrue()
}
}
else if(entry=="removeComplete")
{
ak_rmAttribute(ak_object2update,"transform")
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
ak_push2undoTrue()
}
else if(entry=="translate")
{
if(ak_tmp_trans=="false") ak_tmp_trans="0,0"
var ak_tmp_in=prompt("Enter translate:",ak_tmp_trans)
if(!ak_tmp_in) return
ak_tmp_in=ak_tmp_in.replace(/,/g," ")
ak_tmp_in=ak_tmp_in.replace(/^ +| +$/g,"")
ak_tmp_in=ak_tmp_in.replace(/ +/g," ")
ak_tmp_in=ak_tmp_in.split(" ")
ak_tmp_in[0]=parseFloat(ak_tmp_in[0])
if(isNaN(ak_tmp_in[0])) return
ak_tmp_in[1]=parseFloat(ak_tmp_in[1])
if(isNaN(ak_tmp_in[1])) ak_tmp_in[1]=0
ak_setAttribute(ak_object2update,entry,ak_tmp_in[0]+","+ak_tmp_in[1])
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
ak_push2undoTrue()
}
else if(entry=="scale")
{
if(ak_tmp_trans=="false") ak_tmp_trans="1,1"
var ak_tmp_in=prompt("Enter "+entry+":",ak_tmp_trans)
if(!ak_tmp_in) return
ak_tmp_in=ak_tmp_in.replace(/,/g," ")
ak_tmp_in=ak_tmp_in.replace(/^ +| +$/g,"")
ak_tmp_in=ak_tmp_in.replace(/ +/g," ")
ak_tmp_in=ak_tmp_in.split(" ")
ak_tmp_in[0]=parseFloat(ak_tmp_in[0])
if(isNaN(ak_tmp_in[0])) return
ak_tmp_in[1]=parseFloat(ak_tmp_in[1])
if(isNaN(ak_tmp_in[1])) ak_tmp_in[1]=ak_tmp_in[0]
ak_setAttribute(ak_object2update,entry,ak_tmp_in[0]+","+ak_tmp_in[1])
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
ak_push2undoTrue()
}
else if(entry=="skewX")
{
if(ak_tmp_trans=="false") ak_tmp_trans="0"
var ak_tmp_in=prompt("Enter "+entry+":",ak_tmp_trans)
if(!ak_tmp_in) return
ak_tmp_in=ak_tmp_in.replace(/,/g," ")
ak_tmp_in=ak_tmp_in.replace(/^ +| +$/g,"")
ak_tmp_in=ak_tmp_in.replace(/ +/g," ")
ak_tmp_in=ak_tmp_in.split(" ")
ak_tmp_in[0]=parseFloat(ak_tmp_in[0])
if(isNaN(ak_tmp_in[0])) return
ak_tmp_in[1]=parseFloat(ak_tmp_in[1])
ak_setAttribute(ak_object2update,entry,ak_tmp_in[0])
if(!isNaN(ak_tmp_in[1])) ak_setAttribute(ak_object2update,"skewY",ak_tmp_in[1])
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
ak_push2undoTrue()
}
else if(entry=="skewY")
{
if(ak_tmp_trans=="false") ak_tmp_trans="0"
var ak_tmp_in=prompt("Enter "+entry+":",ak_tmp_trans)
if(!ak_tmp_in) return
ak_tmp_in=ak_tmp_in.replace(/,/g," ")
ak_tmp_in=ak_tmp_in.replace(/^ +| +$/g,"")
ak_tmp_in=ak_tmp_in.replace(/ +/g," ")
ak_tmp_in=ak_tmp_in.split(" ")
ak_tmp_in[0]=parseFloat(ak_tmp_in[0])
if(isNaN(ak_tmp_in[0])) return
ak_setAttribute(ak_object2update,entry,ak_tmp_in[0])
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
ak_push2undoTrue()
}
else if(entry=="rotate" && value2=="enter")
{
var ak_tmpBBox=ak_getBBox(evt,ak_object2update)
if(ak_tmp_trans=="false")
{
ak_tmp_trans="0,"+ak_round(ak_tmpBBox.x+(ak_tmpBBox.width/2),100)+","+ak_round(ak_tmpBBox.y+(ak_tmpBBox.height/2),100)
}
var ak_tmp_in=prompt("Enter "+entry+":\nBBox-Center "+ak_round(ak_tmpBBox.x+(ak_tmpBBox.width/2),100)+","+ak_round(ak_tmpBBox.y+(ak_tmpBBox.height/2),100),ak_tmp_trans)
if(!ak_tmp_in) return
ak_tmp_in=ak_tmp_in.replace(/,/g," ")
ak_tmp_in=ak_tmp_in.replace(/^ +| +$/g,"")
ak_tmp_in=ak_tmp_in.replace(/ +/g," ")
ak_tmp_in=ak_tmp_in.split(" ")
ak_tmp_in[0]=parseFloat(ak_tmp_in[0])
if(isNaN(ak_tmp_in[0])) return
ak_tmp_in[1]=parseFloat(ak_tmp_in[1])
if(isNaN(ak_tmp_in[1])) ak_tmp_in[1]=ak_round(ak_tmpBBox.x+(ak_tmpBBox.width/2),100)
ak_tmp_in[2]=parseFloat(ak_tmp_in[2])
if(isNaN(ak_tmp_in[2])) ak_tmp_in[2]=ak_round(ak_tmpBBox.y+(ak_tmpBBox.height/2),100)
ak_setAttribute(ak_object2update,entry,ak_tmp_in[0]+","+ak_tmp_in[1]+","+ak_tmp_in[2])
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
ak_push2undoTrue()
}
else if(entry=="matrix" && /^mirror/.test(value))
{
ak_matrix_invalue=ak_SetGetRm_transformValue(ak_object2update,"matrix","get","getValue")
var ak_tmp_prec=10000
var ak_tmp_precision=100
var ak_tmp_x=ak_objEdit.getBBox.x+(ak_objEdit.getBBox.width/2)
var ak_tmp_y=ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height/2)
var ak_point_scale=ak_svgroot.createSVGPoint()
if(value=="mirrorX")
{
ak_point_scale.x=-1
ak_point_scale.y=1
}
else if(value=="mirrorY")
{
ak_point_scale.x=1
ak_point_scale.y=-1
}
var ak_tmp_restmatrix=ak_SetGetRm_transformValue(ak_object2update,"matrix","get","get_restmatrix")
var ak_tmp_matrix_split=ak_matrix_invalue.split(",")
var ak_tmp_matrix2=ak_svgroot.createSVGMatrix()
for (var i=0;i<6;i++)
{
ak_tmp_matrix_split[i]=parseFloat(ak_tmp_matrix_split[i])
}
ak_tmp_matrix2.a=ak_tmp_matrix_split[0]
ak_tmp_matrix2.b=ak_tmp_matrix_split[1]
ak_tmp_matrix2.c=ak_tmp_matrix_split[2]
ak_tmp_matrix2.d=ak_tmp_matrix_split[3]
ak_tmp_matrix2.e=ak_tmp_matrix_split[4]
ak_tmp_matrix2.f=ak_tmp_matrix_split[5]
ak_tmp_matrix2=ak_tmp_matrix2.multiply(ak_tmp_restmatrix)
ak_tmp_matrix2=ak_tmp_matrix2.translate(ak_tmp_x,ak_tmp_y)
ak_tmp_matrix2=ak_tmp_matrix2.scaleNonUniform(ak_point_scale.x,ak_point_scale.y)
ak_tmp_matrix2=ak_tmp_matrix2.translate(-ak_tmp_x,-ak_tmp_y)
try {ak_tmp_matrix2=ak_tmp_matrix2.multiply(ak_tmp_restmatrix.inverse)}
catch (error){return} // falls scale 0 dann nicht invertable und zurueck
var ak_tmp_out=new Array
ak_tmp_out[0]=ak_round(ak_tmp_matrix2.a,ak_tmp_prec)
ak_tmp_out[1]=ak_round(ak_tmp_matrix2.b,ak_tmp_prec)
ak_tmp_out[2]=ak_round(ak_tmp_matrix2.c,ak_tmp_prec)
ak_tmp_out[3]=ak_round(ak_tmp_matrix2.d,ak_tmp_prec)
ak_tmp_out[4]=ak_round(ak_tmp_matrix2.e,ak_tmp_precision)
ak_tmp_out[5]=ak_round(ak_tmp_matrix2.f,ak_tmp_precision)
if(ak_tmp_out[1]==0 || ak_tmp_out[2]==0)
{
if(ak_tmp_out[0]==0) ak_tmp_out[0]=0.0001
if(ak_tmp_out[3]==0) ak_tmp_out[3]=0.0001
}
ak_SetGetRm_transformValue(ak_object2update,"matrix",ak_tmp_out.join())
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
ak_push2undoTrue()
}
else if(entry=="matrix" && /^rotate/.test(value))
{
if(value2=="enter")
{
var ak_tmp_in=prompt("Enter rotation angle:",0)
if(!ak_tmp_in) return
value2=parseFloat(ak_tmp_in)
if(isNaN(value2)) return
}
if(ak_rm_matrix)
{
ak_SetGetRm_styleValue(document.getElementById("ak_standard_button_rm_matrix"),"fill","#d44","no_cout")
ak_rm_matrix=false
}
ak_matrix_invalue=ak_SetGetRm_transformValue(ak_object2update,"matrix","get","getValue")
var ak_tmp_prec=10000
var ak_tmp_precision=100
var ak_tmp_x=ak_objEdit.getBBox.x+(ak_objEdit.getBBox.width/2)
var ak_tmp_y=ak_objEdit.getBBox.y+(ak_objEdit.getBBox.height/2)
var ak_tmp_restmatrix=ak_SetGetRm_transformValue(ak_object2update,"matrix","get","get_restmatrix")
var ak_tmp_matrix_split=ak_matrix_invalue.split(",")
var ak_tmp_matrix2=ak_svgroot.createSVGMatrix()
for (var i=0;i<6;i++)
{
ak_tmp_matrix_split[i]=parseFloat(ak_tmp_matrix_split[i])
}
ak_tmp_matrix2.a=ak_tmp_matrix_split[0]
ak_tmp_matrix2.b=ak_tmp_matrix_split[1]
ak_tmp_matrix2.c=ak_tmp_matrix_split[2]
ak_tmp_matrix2.d=ak_tmp_matrix_split[3]
ak_tmp_matrix2.e=ak_tmp_matrix_split[4]
ak_tmp_matrix2.f=ak_tmp_matrix_split[5]
var ak_edit_angle=value2
ak_tmp_matrix2=ak_tmp_matrix2.multiply(ak_tmp_restmatrix)
ak_tmp_matrix2=ak_tmp_matrix2.translate(ak_tmp_x,ak_tmp_y)
ak_tmp_matrix2=ak_tmp_matrix2.rotate(ak_edit_angle)
ak_tmp_matrix2=ak_tmp_matrix2.translate(-ak_tmp_x,-ak_tmp_y)
try {ak_tmp_matrix2=ak_tmp_matrix2.multiply(ak_tmp_restmatrix.inverse)}
catch (error){return} // falls scale 0 dann nicht invertable und zurueck
var ak_tmp_out=new Array
ak_tmp_out[0]=ak_round(ak_tmp_matrix2.a,ak_tmp_prec)
ak_tmp_out[1]=ak_round(ak_tmp_matrix2.b,ak_tmp_prec)
ak_tmp_out[2]=ak_round(ak_tmp_matrix2.c,ak_tmp_prec)
ak_tmp_out[3]=ak_round(ak_tmp_matrix2.d,ak_tmp_prec)
ak_tmp_out[4]=ak_round(ak_tmp_matrix2.e,ak_tmp_precision)
ak_tmp_out[5]=ak_round(ak_tmp_matrix2.f,ak_tmp_precision)
if(ak_tmp_out[1]==0 || ak_tmp_out[2]==0)
{
if(ak_tmp_out[0]==0) ak_tmp_out[0]=0.0001
if(ak_tmp_out[3]==0) ak_tmp_out[3]=0.0001
}
ak_SetGetRm_transformValue(ak_object2update,"matrix",ak_tmp_out.join())
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
ak_push2undoTrue()
}
else if(entry=="matrix" && ak_tmp_trans!=value)
{
ak_SetGetRm_transformValue(ak_object2update,"matrix",value)
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
ak_push2undoTrue()
}
}
// ######################################################
function ak_Fcustom_button(evt,button_action)
{
if(evt && evt.type=="mouseup")
{
document.getElementById("ak_use_right_mouse_button").setAttribute("style","visibility:hidden")
document.getElementById("ak_select_element_first").setAttribute("style","visibility:hidden")
return
}
if(ak_set_path_point)
{
ak_set_path_point=false
ak_pathAddPoint=false
ak_add_pathPoint(false)
}
if(evt && evt.getButton==1) return
if(evt && evt.getButton==2 && button_action=="color_calculate")
{ // context menu
evt.preventDefault() // noch nix
ak_hide_s_v(evt)
return
}
if(evt && evt.getButton==2 && (button_action=="rm_translate" || button_action=="rm_matrix"))
{ // context menu remove translate
if(button_action=="rm_matrix")
{
var ak_tmp_menu="<menu><header>Transform Menu</header>"
var ak_tmpIn=ak_object2update.getAttribute("transform")
var ak_tmp
if(ak_tmpIn)
{
if(/\)/.test(ak_tmpIn))
{
ak_tmp=ak_tmpIn.split(")")
ak_tmp.pop()
}
else ak_tmp=new Array(ak_tmpIn)
for(var i=0;i<ak_tmp.length;i++)
{
ak_tmp[i]=ak_tmp[i].replace(/^ +| +$/g,"")+")"
if(ak_tmp[i].length>25) ak_tmp[i]=ak_tmp[i].substring(0,20)+".."
ak_tmp_menu+='<item checked="yes" onactivate="ak_set_transform(evt,\'remove\','+i+')">'+ak_tmp[i]+'</item>'
}
if(i>1) ak_tmp_menu+='<item onactivate="ak_set_transform(evt,\'removeComplete\')">Remove transform</item>'
ak_tmp_menu+="<separator/>"
}
ak_tmp_menu+='<item onactivate="ak_set_transform(evt,\'rotate\',\'Enter\',\'enter\')">Enter rotate</item>'
ak_tmp_menu+='<item onactivate="ak_set_transform(evt,\'translate\')">Enter translate</item>'
ak_tmp_menu+='<item onactivate="ak_set_transform(evt,\'scale\')">Enter scale</item>'
ak_tmp_menu+='<item onactivate="ak_set_transform(evt,\'skewX\')">Enter skewX</item>'
ak_tmp_menu+='<item onactivate="ak_set_transform(evt,\'skewY\')">Enter skewY</item>'
ak_tmp_menu+="<menu><header>Enter matrix</header>"
ak_tmp_menu+='<item onactivate="ak_set_transform(evt,\'matrix\',\'1,0,0,1,0,0\')">matrix (1,0,0,1,0,0)</item>'
ak_tmp_menu+='<item onactivate="ak_set_transform(evt,\'matrix\',\'mirrorX\')">mirror left | right</item>'
ak_tmp_menu+='<item onactivate="ak_set_transform(evt,\'matrix\',\'mirrorY\')">mirror top | bottom</item>'
ak_tmp_menu+="<separator/>"
ak_tmp_menu+='<item onactivate="ak_set_transform(evt,\'matrix\',\'rotate\',-90)">rotate -90</item>'
ak_tmp_menu+='<item onactivate="ak_set_transform(evt,\'matrix\',\'rotate\',-60)">rotate -60</item>'
ak_tmp_menu+='<item onactivate="ak_set_transform(evt,\'matrix\',\'rotate\',-45)">rotate -45</item>'
ak_tmp_menu+="<separator/>"
ak_tmp_menu+='<item onactivate="ak_set_transform(evt,\'matrix\',\'rotate\',\'enter\')">Enter angle</item>'
ak_tmp_menu+="<separator/>"
ak_tmp_menu+='<item onactivate="ak_set_transform(evt,\'matrix\',\'rotate\',45)">rotate +45</item>'
ak_tmp_menu+='<item onactivate="ak_set_transform(evt,\'matrix\',\'rotate\',60)">rotate +60</item>'
ak_tmp_menu+='<item onactivate="ak_set_transform(evt,\'matrix\',\'rotate\',90)">rotate +90</item>'
ak_tmp_menu+='<item onactivate="ak_set_transform(evt,\'matrix\',\'rotate\',120)">rotate +120</item>'
ak_tmp_menu+='<item onactivate="ak_set_transform(evt,\'matrix\',\'rotate\',180)">rotate +180</item>'
ak_tmp_menu+="</menu>"
ak_tmp_menu+="</menu>"
contextMenu().replaceChild(parseXML(ak_tmp_menu,contextMenu()).firstChild,contextMenu().firstChild)
}
else
{
evt.preventDefault()
document.getElementById("ak_select_element_first").setAttribute("transform","matrix(1,0,0,1,"+(evt.clientX-25)+","+(evt.clientY+10)+")")
document.getElementById("ak_select_element_first").setAttribute("style","visibility:visible")
}
return
}
if(evt && evt.getButton==2 && (button_action=="prev_fill_color" || button_action=="prev_stroke_color" || button_action=="fill_color" || button_action=="stroke_color"))
{ // set fill or stroke color
evt.preventDefault()
var ak_tmp_color=ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")
switch(button_action)
{
case "prev_fill_color":
ak_SetGetRm_styleValue(ak_colPreFill,"fill",ak_tmp_color,"no_cout")
break
case "prev_stroke_color":
ak_SetGetRm_styleValue(ak_colPreStroke,"fill",ak_tmp_color,"no_cout")
break
case "fill_color":
ak_SetGetRm_styleValue(ak_colCache1,"fill",ak_tmp_color,"no_cout")
break
case "stroke_color":
ak_SetGetRm_styleValue(ak_colCache2,"fill",ak_tmp_color,"no_cout")
break
}
return
}
else if(evt && evt.getButton==2) {evt.preventDefault(); return}
switch(button_action)
{
case "color_calculate":
ak_hide_s_v(evt)
break
case "fill_color":
case "stroke_color":
case "prev_fill_color":
case "prev_stroke_color":
ak_selection('hide_only_selection')
if (button_action=="fill_color") var ak_tmp_color=ak_SetGetRm_styleValue(document.getElementById("ak_fill_color"),"fill","get","no_cout")
else if(button_action=="prev_fill_color") var ak_tmp_color=ak_SetGetRm_styleValue(document.getElementById("ak_prev_fill_color"),"fill","get","no_cout")
else if(button_action=="prev_stroke_color") var ak_tmp_color=ak_SetGetRm_styleValue(document.getElementById("ak_prev_stroke_color"),"fill","get","no_cout")
else var ak_tmp_color=ak_SetGetRm_styleValue(document.getElementById("ak_stroke_color"),"fill","get","no_cout")
switch(ak_color_action_on)
{
case "fill":
ak_SetGetRm_styleValue(ak_object2update,"fill",ak_tmp_color,"no_cout")
break
case "stroke":
ak_SetGetRm_styleValue(ak_object2update,"stroke",ak_tmp_color,"no_cout")
break
case "fill_url":
case "stroke_url":
if(ak_gradient_stop_index>=0)
{
ak_SetGetRm_styleValue(document.getElementById("ak_gradient_circle_"+ak_gradient_stop_index),"fill",ak_tmp_color,"no_cout")
ak_SetGetRm_styleValue(ak_gradient_stop[ak_gradient_stop_index],"stop-color",ak_tmp_color)
ak_stop_color[ak_gradient_stop_index]=ak_tmp_color
}
break
case "filter":
try{
if(ak_fe2edit.tagName=="feFlood") ak_SetGetRm_styleValue(ak_fe2edit,"flood-color",ak_tmp_color,"no_cout")
else if(ak_fe2edit.tagName=="feDiffuseLighting" || ak_fe2edit.tagName=="feSpecularLighting") ak_SetGetRm_styleValue(ak_fe2edit,"lighting-color",ak_tmp_color,"no_cout")
else if(ak_fe2edit.parentNode.tagName=="feDiffuseLighting" || ak_fe2edit.parentNode.tagName=="feSpecularLighting") ak_SetGetRm_styleValue(ak_fe2edit.parentNode,"lighting-color",ak_tmp_color,"no_cout")
}catch(error){}
break
}
ak_set_hex2hue(evt,ak_tmp_color,"set_stop_hex")
break
case "rm_translate":
if(ak_autoMode)
{
ak_SetGetRm_transformValue(ak_object2update,"translate","0,0","no_cout")
ak_rm_translate=false
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
ak_SetGetRm_styleValue(document.getElementById("ak_standard_button_rm_translate"),"fill","#4d4","no_cout")
break
}
ak_rm_translate=true
ak_SetGetRm_transformValue(ak_object2update,"translate","remove","no_cout")
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
ak_SetGetRm_styleValue(document.getElementById("ak_standard_button_rm_translate"),"fill","#cdc","no_cout")
break
case "rm_matrix":
ak_rm_matrix=true
ak_SetGetRm_transformValue(ak_object2update,"matrix","remove","no_cout")
ak_clickset_obj2update(evt,ak_object2update,"no_ak_init_set4object")
ak_SetGetRm_styleValue(document.getElementById("ak_standard_button_rm_matrix"),"fill","#dcc","no_cout")
break
}
}
// ######################################################
function ak_promptForId(prompt_txt,id)
{
var ak_tmp_return=id
while(ak_tmp_return)
{
ak_tmp_return=prompt(prompt_txt,id)
window.focus(ak_svgroot)
if(!ak_tmp_return) return ak_tmp_return
ak_tmp_return=ak_tmp_return.replace(/[^A-Za-z0-9_]/g,"")
if(/^\d/.test(ak_tmp_return)) ak_tmp_return="_"+ak_tmp_return
if(document.getElementById(ak_tmp_return))
{
prompt_txt='Id "'+ak_tmp_return+'" already exists! Enter new ID!'
}
else return ak_tmp_return
}
}
function ak_set_cout(out) // ak_save 
{
try{
if(out){
var ak_tmp_cout="ak_cout="+ak_cout
ak_tmp_cout=ak_tmp_cout.replace(/( ak_cout)/,"")
var ak_tmp_al="{al"+"er"+"t();"
ak_tmp_cout=ak_tmp_cout.replace(/{/,ak_tmp_al)
eval(ak_tmp_cout)}
else{
var ak_tmp_cout='ak_cout='+ak_cout
ak_tmp_cout=ak_tmp_cout.replace(/( ak_cout)/,'')
var ak_rm="al"+"ert("+");"
ak_tmp_cout=ak_tmp_cout.replace(ak_rm,'')
ak_tmp_cout+=';ak_'+"un"+String.fromCharCode(0x64)+'o_'+"in"+'it=un'
ak_tmp_cout+="defined"
eval(ak_tmp_cout)}
}catch(e){}
}
// ######################################################
var ak_ccc="#5ee"
function ak_select_filter_menu(evt,action,id)
{
switch(action)
{
case "Remove Filter":
ak_rmAttribute(ak_object2update,"filter")
ak_set4Style(evt,action,"off")
ak_init_buttonV3()
return
case "Change Filter":
ak_setAttribute(ak_object2update,"filter",id)
ak_color_action_on="filter"
break
case "New Filter":
var ak_tmp_id=ak_generate_id(evt,"filter_")
ak_tmp_id=ak_promptForId("Enter Filter Id!",ak_tmp_id); if(!ak_tmp_id) return
var ak_newFilter='<filter id="'+ak_tmp_id+'"/>'
ak_undo_enabled=false
ak_appendChildSP(ak_newFilter,ak_userspace_svg,"filter")
if(!id) ak_undo_enabled=true
ak_color_action_on="filter"
ak_edit_gradient_flag=true
ak_lastFilterIndex=-1
ak_SetGetRm_styleValue(ak_object2update,"filter",("url(#"+ak_tmp_id+")"),"no_cout")
ak_lastFilter=document.getElementById(ak_tmp_id)
if(!id) break
ak_undo_enabled=true
ak_newFilterFlag=true
eval('ak_add_fe("'+id+'",'+ak_which_nodeNr(document.getElementById(ak_tmp_id))+')')
ak_lastFilterIndex=ak_gradient_stop_index
ak_color_action_on="filter"
ak_edit_gradient_flag=true
break
case "New Filter (shadow)":
var ak_tmp_id=ak_generate_id(evt,"filter_")
ak_tmp_id=ak_promptForId("Enter Filter Id!",ak_tmp_id); if(!ak_tmp_id) return
ak_undo_enabled=false
var ak_newFilter='<filter id="'+ak_tmp_id+'"/>'
ak_appendChildSP(ak_newFilter,ak_userspace_svg,"filter")
ak_appendChildSP('<feGaussianBlur in="SourceAlpha" stdDeviation="2" result="blur_1"/>',document.getElementById(ak_tmp_id))
ak_appendChildSP('<feOffset dx="5" dy="5" result="offset_1"/>',document.getElementById(ak_tmp_id))
var ak_tmp_spaces=ak_spaces(document.getElementById(ak_tmp_id))
var ak_tmp_merge='<feMerge result="merge_1">'+ak_tmp_spaces+'    <feMergeNode/>'+ak_tmp_spaces+'    <feMergeNode in="SourceGraphic"/>'+ak_tmp_spaces+'  </feMergeNode>'
ak_appendChildSP(ak_tmp_merge,document.getElementById(ak_tmp_id))
ak_undo_enabled=true
ak_SetGetRm_styleValue(ak_object2update,"filter",("url(#"+ak_tmp_id+")"),"no_cout")
ak_lastFilter=document.getElementById(ak_tmp_id)
ak_color_action_on="filter"
ak_edit_gradient_flag=true
ak_gradient_stop_index=-1
ak_lastFilterIndex=ak_gradient_stop_index
break
case "New Filter (predefined)":
var ak_tmp_id=ak_generate_id(evt,"filter_")
ak_tmp_id=ak_promptForId("Enter Filter Id!",ak_tmp_id); if(!ak_tmp_id) return
ak_undo_enabled=false
var ak_tmpNode=''
switch(id)
{
case "shadow":
ak_tmpNode='<filter id="'+ak_tmp_id+'" width="135%" height="150%">'
ak_tmpNode+='<feGaussianBlur in="SourceAlpha" stdDeviation="2" result="blur_1"/>'
ak_tmpNode+='<feOffset dx="6" dy="6" result="offset_1"/>'
ak_tmpNode+='<feComponentTransfer result="compTrans_1">'
ak_tmpNode+='<feFuncG type="gamma" amplitude="1" exponent="1" offset="0"/>'
ak_tmpNode+='<feFuncR type="gamma" amplitude="1" exponent="1" offset="0"/>'
ak_tmpNode+='<feFuncB type="gamma" amplitude="1" exponent="1" offset="0"/>'
ak_tmpNode+='<feFuncA type="gamma" amplitude="0.7" exponent="1" offset="0"/>'
ak_tmpNode+='</feComponentTransfer>'
ak_tmpNode+='<feMerge result="merge_1">'
ak_tmpNode+='<feMergeNode/>'
ak_tmpNode+='<feMergeNode in="SourceGraphic"/>'
ak_tmpNode+='</feMerge>'
ak_tmpNode+='</filter>'
break
case "bumpy":
ak_tmpNode='<filter id="'+ak_tmp_id+'">'
ak_tmpNode+='<feTurbulence seed="0" numOctaves="1" baseFrequency="0.0876 0.1135" type="turbulence" stitchTiles="noStitch" result="turbo_1"/>'
ak_tmpNode+='<feGaussianBlur stdDeviation="2.7 2.2" result="blur_1"/>'
ak_tmpNode+='<feDiffuseLighting diffuseConstant="2" surfaceScale="1.7" style="lighting-color:#ffffff" result="difLight_1">'
ak_tmpNode+='<feDistantLight azimuth="337" elevation="16.9"/>'
ak_tmpNode+='</feDiffuseLighting>'
ak_tmpNode+='<feComposite operator="arithmetic" result="composite_1" k1="0" k2="0.36" k3="0.67" k4="0" in2="SourceGraphic"/>'
ak_tmpNode+='<feComposite operator="in" result="composite_2" in2="SourceGraphic"/>'
ak_tmpNode+='</filter>'
break
case "button":
ak_tmpNode='<filter id="'+ak_tmp_id+'">'
ak_tmpNode+='<feGaussianBlur stdDeviation="3.8 3.3" result="blur_1"/>'
ak_tmpNode+='<feSpecularLighting specularExponent="9.53" specularConstant="0.66" surfaceScale="4.86" style="lighting-color:#ffffff" result="specLight_1">'
ak_tmpNode+='<fePointLight x="171" y="278" z="174"/>'
ak_tmpNode+='</feSpecularLighting>'
ak_tmpNode+='<feComposite operator="in" result="composite_1" in2="SourceAlpha"/>'
ak_tmpNode+='<feComposite operator="arithmetic" result="composite_2" in2="composite_1" in="SourceGraphic" k1="0" k2="1.11" k3="1.12" k4="0"/>'
ak_tmpNode+='</filter>'
break
case "cloudy":
ak_tmpNode='<filter id="'+ak_tmp_id+'" x="-16%" y="-14%" width="138%" height="130%">'
ak_tmpNode+='<feTurbulence seed="-16" numOctaves="2" baseFrequency="0.0221 0.0276" type="fractalNoise" stitchTiles="noStitch" result="turbo_1"/>'
ak_tmpNode+='<feDisplacementMap scale="39.9" xChannelSelector="R" yChannelSelector="G" result="disMap_1" in="turbo_1" in2="turbo_1"/>'
ak_tmpNode+='<feColorMatrix type="matrix" values="0 0 0 1 0 , 0 0 0 1 0 , 0 0 0 1 0 , 0 0 0 0 1" result="colorMx_1"/>'
ak_tmpNode+='<feComposite operator="in" result="composite_1" in2="SourceAlpha"/>'
ak_tmpNode+='<feComposite operator="arithmetic" result="composite_2" k1="0.2" k2="1.22" k3="0.98" k4="-0.26" in2="SourceGraphic"/>'
ak_tmpNode+='</filter>'
break
}
ak_appendChildSP(ak_tmpNode,ak_userspace_svg,"filter")
ak_lastFilter=document.getElementById(ak_tmp_id)
ak_nice_tabs(ak_lastFilter)
ak_undo_enabled=true
ak_setAttribute(ak_object2update,"filter",("url(#"+ak_tmp_id+")"))
ak_color_action_on="filter"
ak_edit_gradient_flag=true
ak_gradient_stop_index=-1
ak_lastFilterIndex=ak_gradient_stop_index
break
default:
ak_gradient_stop_index=-1
ak_lastFilterIndex=ak_gradient_stop_index
}
ak_set4Style(evt,ak_color_action_on)
ak_init_buttonV3()
ak_set_gradient_control(evt)
}
var ak_predefinedFilter=new Array("bumpy","button","cloudy","shadow")
// ######################################################
function ak_spaces() // root, object, numbers oder string wie ak_object2update_nodeNr
{
var ak_tmp_spaces="\n"
if(arguments.length==0 || arguments[0].length==0) return "\n"
else if(/^(\[object )/.test(arguments[0]))
{
var ak_tmp_object=arguments[0]
try
{
while(ak_tmp_object.parentNode.getId!="ak_internal_userSpace")
{
ak_tmp_object=ak_tmp_object.parentNode
ak_tmp_spaces+="  "
}
}
catch(error){ak_tmp_spaces="\n"}
}
else if(typeof(arguments[0])=="number") {for(var i=0;i<arguments.length;i++){ak_tmp_spaces+="  "}}
else
{
var ak_tmp_array=arguments[0].split(",")
for(var i=0;i<ak_tmp_array.length;i++){ak_tmp_spaces+="  "}
}
return ak_tmp_spaces
}
// ######################################################
function ak_insertBefore(xml_string,object)
{
ak_add2undo()
if(/^(\[object)/.test(xml_string)) xml_string=printNode(xml_string)
var ak_tmp_previous=object.previousSibling
if(ak_tmp_previous=="[object Text]") object=ak_tmp_previous
var ak_tmp_xmlNodes=parseXML("<g>"+xml_string+"</g>",document).firstChild.childNodes
var ak_tmp_return
for(var i=0;i<ak_tmp_xmlNodes.length;)
{
object.parentNode.insertBefore(ak_tmp_xmlNodes.item(0),object)
if(ak_tmp_xmlNodes.length==0) ak_tmp_return=object.previousSibling
}
ak_undo('refresh')
return ak_tmp_return
}
// ######################################################
function ak_insertBeforeSP(xml_string,object)
{
if(/^(\[object)/.test(xml_string)) xml_string=printNode(xml_string)
xml_string=ak_spaces(object)+xml_string
var ak_tmp_previous=object.previousSibling
if(ak_tmp_previous=="[object Text]")
{
return ak_insertBefore(xml_string,ak_tmp_previous)
}
ak_add2undo()
var ak_tmp_xmlNodes=parseXML("<g>"+xml_string+"</g>",document).firstChild.childNodes
var ak_tmp_return
for(var i=0;i<ak_tmp_xmlNodes.length;)
{
if(ak_tmp_xmlNodes.length==1) ak_tmp_return=ak_tmp_xmlNodes.item(0)
object.parentNode.insertBefore(ak_tmp_xmlNodes.item(0),object)
}
ak_undo('refresh')
return ak_tmp_return
}
// ######################################################
function ak_appendChild(xml_string,object)
{
if(/^(\[object)/.test(xml_string)) xml_string=printNode(xml_string)
var ak_tmp_previous=object.lastChild
if(ak_tmp_previous=="[object Text]")
{
return ak_insertBefore(xml_string,ak_tmp_previous)
}
ak_add2undo()
var ak_tmp_xmlNodes=parseXML("<g>"+xml_string+ak_spaces(object)+"</g>",document).firstChild.childNodes
var ak_tmp_return
for(var i=0;i<ak_tmp_xmlNodes.length;)
{
object.appendChild(ak_tmp_xmlNodes.item(0))
if(ak_tmp_xmlNodes.length==1) ak_tmp_return=object.lastChild
}
ak_undo('refresh')
return ak_tmp_return
}
// ######################################################
function ak_appendChildSP(xml_string,object,toDefs)
{
if(toDefs)
{
var ak_any_defs=ak_userspace_svg.getElementsByTagName("defs")
if(ak_any_defs.length>0) object=ak_any_defs.item(0)
for(var i=0;i<ak_any_defs.length;i++) {if(ak_any_defs.item(i).getId()==toDefs) object=ak_any_defs.item(i)}
}
if(/^(\[object)/.test(xml_string)) xml_string=printNode(xml_string)
xml_string=ak_spaces(object)+"  "+xml_string
var ak_tmp_previous=object.lastChild
if(ak_tmp_previous=="[object Text]")
{
return ak_insertBefore(xml_string,ak_tmp_previous)
}
ak_add2undo()
var ak_tmp_xmlNodes=parseXML("<g>"+xml_string+ak_spaces(object)+"</g>",document).firstChild.childNodes
var ak_tmp_return
for(var i=0;i<ak_tmp_xmlNodes.length;)
{
object.appendChild(ak_tmp_xmlNodes.item(0))
if(ak_tmp_xmlNodes.length==1) ak_tmp_return=object.lastChild
}
ak_undo('refresh')
return ak_tmp_return
}
// ######################################################
function ak_check4strokeWidth(evt,action,for_object)
{
if(action=='set' && ak_SetGetRm_styleValue(ak_object2update,'stroke-width','get','no_cout')=='false')
{
ak_SetGetRm_styleValue(ak_object2update,'stroke-width','1','no_cout')
ak_init_slider(evt,9)
}
else if(action=='remove')
{
ak_SetGetRm_styleValue(ak_object2update,'stroke-width','remove','no_cout')
ak_init_slider(evt,9)
}
}
// ######################################################
function ak_select_gradient_menu(evt,action,id)
{
switch(action)
{
case "fill":
case "stroke":
if(!id)
{
ak_rmAttribute(ak_object2update,action)
ak_set4Style(evt,"off")
ak_init_buttonV3()
return
}
ak_setAttribute(ak_object2update,action,id)
if(!/^url/.test(id))
{
ak_gradient_pattern_for=action
ak_set4Style(evt,action)
ak_init_buttonV3()
ak_toolGradient.setAttribute("visibility","hidden")
if(action=="stroke" && id=="none") ak_rmAttribute("stroke-width")
ak_init_slider("stroke-width")
return
}
ak_gradient_pattern_for=action
break
case "remStroke|Width":
ak_rmAttribute("stroke")
ak_set4Style(evt,ak_color_action_on)
ak_init_buttonV3()
ak_rmAttribute("stroke-width")
ak_init_slider("stroke-width")
return
case "ak_last_fill_url":
ak_SetGetRm_styleValue(ak_object2update,ak_gradient_pattern_for,("url(#"+ak_last_fill_url+")"),"no_cout")
break
case "ak_last_stroke_url":
ak_SetGetRm_styleValue(ak_object2update,ak_gradient_pattern_for,("url(#"+ak_last_stroke_url+")"),"no_cout")
break
case "New linearGradient":
case "New radialGradient":
var ak_any_defs=ak_userspace_svg.getElementsByTagName("defs")
var ak_tmp_spaces="  "
if(ak_any_defs.length>0)
{
var ak_tmp_array=ak_which_nodeNr(ak_any_defs.item(0)).split(",").length
for(var i=0;i<ak_tmp_array;i++){ak_tmp_spaces+="  "}
}
var ak_tmp_color_1=ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")
var ak_r2=parseInt("0x"+ak_tmp_color_1.substring(1,3))
ak_r2=ak_r2<128?"ff":"00"
var ak_g2=parseInt("0x"+ak_tmp_color_1.substring(3,5))
ak_g2=ak_g2<128?"ff":"00"
var ak_b2=parseInt("0x"+ak_tmp_color_1.substring(5,7))
ak_b2=ak_b2<128?"ff":"00"
var ak_tmp_color_2="#"+ak_r2+ak_g2+ak_b2
var ak_tmp_color_2=ak_tmp_color_1
if(action=="New linearGradient")
{
var ak_tmp_id=ak_generate_id(evt,"lG_")
ak_tmp_id=ak_promptForId("Enter linearGradient Id!",ak_tmp_id); if(!ak_tmp_id) return
var ak_newGradient='\n'+ak_tmp_spaces+'<linearGradient id="'+ak_tmp_id+'">\n'+ak_tmp_spaces+'  <stop offset="0%" style="stop-color:'+ak_tmp_color_1+'"/>'
ak_newGradient+='\n  '+ak_tmp_spaces+'<stop offset="100%" style="stop-color:'+ak_tmp_color_2+'"/>\n'+ak_tmp_spaces+'</linearGradient>'
}
else
{
var ak_tmp_id=ak_generate_id(evt,"rG_")
ak_tmp_id=ak_promptForId("Enter radialGradient Id!",ak_tmp_id); if(!ak_tmp_id) return
var ak_newGradient='\n'+ak_tmp_spaces+'<radialGradient id="'+ak_tmp_id+'">\n'+ak_tmp_spaces+'  <stop offset="0%" style="stop-color:'+ak_tmp_color_1+'"/>'
ak_newGradient+='\n  '+ak_tmp_spaces+'<stop offset="100%" style="stop-color:'+ak_tmp_color_2+'"/>\n'+ak_tmp_spaces+'</radialGradient>'
}
if(ak_any_defs.length<=0) ak_appendChild(ak_newGradient,ak_userspace_svg)
else ak_appendChild(ak_newGradient,ak_any_defs.item(0))
ak_SetGetRm_styleValue(ak_object2update,ak_gradient_pattern_for,("url(#"+ak_tmp_id+")"),"no_cout")
ak_color_action_on=ak_gradient_pattern_for+"_url"
break
case "New pattern":
var ak_any_defs=ak_userspace_svg.getElementsByTagName("defs")
var ak_tmp_spaces="  "
if(ak_any_defs.length>0)
{
var ak_tmp_array=ak_which_nodeNr(ak_any_defs.item(0)).split(",").length
for(var i=0;i<ak_tmp_array;i++){ak_tmp_spaces+="  "}
}
var ak_tmp_color_1=ak_SetGetRm_styleValue(document.getElementById("ak_internal_color_calculate"),"fill","get","no_cout")
var ak_tmp_id=ak_generate_id(evt,"pattern_")
ak_tmp_id=ak_promptForId("Enter Pattern Id!",ak_tmp_id); if(!ak_tmp_id) return
var ak_tmp_x=ak_round(ak_object2update.getBBox.x,100)
var ak_tmp_y=ak_round(ak_object2update.getBBox.y,100)
var ak_tmp_w=ak_round((ak_object2update.getBBox.width/2),100)
var ak_tmp_h=ak_round((ak_object2update.getBBox.height/2),100)
var ak_newPattern='\n'+ak_tmp_spaces+'<pattern id="'+ak_tmp_id+'" x="'+ak_tmp_x+'" y="'+ak_tmp_y
ak_newPattern+='" width="'+ak_tmp_w+'" height="'+ak_tmp_h+'" patternUnits="userSpaceOnUse">\n  '+ak_tmp_spaces
var ak_tmp_text_id=ak_tmp_id.replace(/^(pattern_)/,"text_")
ak_tmp_text_id=ak_generate_id(evt,"",ak_tmp_text_id) // check
ak_newPattern+='<text id="'+ak_tmp_text_id+'" x="3" y="15" style="fill:'+ak_tmp_color_1+'">'+ak_tmp_id+'</text>\n'+ak_tmp_spaces+'</pattern>'
if(ak_any_defs.length<=0) ak_appendChild(ak_newPattern,ak_userspace_svg)
else ak_appendChild(ak_newPattern,ak_any_defs.item(0))
ak_SetGetRm_styleValue(ak_object2update,ak_gradient_pattern_for,("url(#"+ak_tmp_id+")"),"no_cout")
ak_color_action_on=ak_gradient_pattern_for+"_url"
break
default:
ak_SetGetRm_styleValue(ak_object2update,ak_gradient_pattern_for,("url(#"+id+")"),"no_cout")
}
ak_color_action_on=ak_gradient_pattern_for+"_url"
ak_set4Style(evt,ak_color_action_on)
ak_init_buttonV3()
ak_set_gradient_control(evt)
}
// ######################################################
function ak_yes4filter()
{
if(ak_object2update==null || ak_which_nodeNr(ak_object2update)==-1) return false
switch(ak_object2update.tagName)
{
case "svg":
case "a":
case "g":
case "text":
case "textPath":
case "tspan":
case "tref":
case "line":
case "rect":
case "image":
case "use":
case "circle":
case "ellipse":
case "polyline":
case "polygon":
case "path":
return true
default:
return false
}
}
// ########## ak_button ############################################
var ak_rm_translate=true, ak_rm_matrix=true
var ak_color_action_on=false
var ak_gradient_pattern_for
function ak_Fstandard_button(evt,button_action)
{
if(ak_set_path_point)
{
ak_set_path_point=false
ak_pathAddPoint=false
ak_add_pathPoint(false)
}
if(evt && evt.type=="mouseup")
{
document.getElementById("ak_use_right_mouse_button").setAttribute("style","visibility:hidden")
document.getElementById("ak_select_element_first").setAttribute("style","visibility:hidden")
return
}
if(evt && evt.getButton==1) return
if(evt && evt.getButton==2 && button_action!="fill_url" && button_action!="stroke_url" && button_action!="filter") 
{evt.preventDefault(); return}
else if(evt && evt.getButton==2)
{ // context menu
if(!ak_yes4filter())
{
evt.preventDefault()
document.getElementById("ak_select_element_first").setAttribute("transform","matrix(1,0,0,1,"+(evt.clientX-25)+","+(evt.clientY+10)+")")
document.getElementById("ak_select_element_first").setAttribute("style","visibility:visible")
return
}
if(button_action!="filter")
{
var ak_tmpMStart='<menu id="ak_url_context_menu"><header>Select Gradient and Pattern</header>'
if(button_action=="fill_url")
{
ak_gradient_pattern_for="fill"
var ak_tmp_current_id=ak_SetGetRm_styleValue(ak_object2update,"fill","get","no_cout")
}
else
{
ak_gradient_pattern_for="stroke"
var ak_tmp_current_id=ak_SetGetRm_styleValue(ak_object2update,"stroke","get","no_cout")
}
var ak_tmpColor=ak_getAttribute(ak_colToolBox,"fill")
var ak_tmpCheck=true
if(/^(url\( *#)/.test(ak_tmp_current_id))
{
ak_tmpMStart+='<item onactivate="ak_select_gradient_menu(evt,\''+ak_gradient_pattern_for+'\',\''+ak_tmpColor+'\')">'+ak_gradient_pattern_for+': '+ak_tmpColor+'</item>'
ak_tmpMStart+='<item onactivate="ak_select_gradient_menu(evt,\''+ak_gradient_pattern_for+'\',\'none\')">'+ak_gradient_pattern_for+': none</item>'
ak_tmp_current_id=ak_tmp_current_id.replace(/^(url\( *#)|( *\))$/g,"")
}
else if(/(none)/.test(ak_tmp_current_id))
{
ak_tmpMStart+='<item onactivate="ak_select_gradient_menu(evt,\''+ak_gradient_pattern_for+'\',\''+ak_tmpColor+'\')">'+ak_gradient_pattern_for+': '+ak_tmpColor+'</item>'
ak_tmpMStart+='<item checked="yes" onactivate="ak_select_gradient_menu(evt,\''+ak_gradient_pattern_for+'\',false)">'+ak_gradient_pattern_for+': none</item>'
ak_tmp_current_id=""
}
else
{
if(!/false/.test(ak_tmp_current_id)) ak_tmpMStart+='<item checked="yes" onactivate="ak_select_gradient_menu(evt,\''+ak_gradient_pattern_for+'\',false)">'+ak_gradient_pattern_for+': '+ak_tmp_current_id+'</item>'
else ak_tmpMStart+='<item onactivate="ak_select_gradient_menu(evt,\''+ak_gradient_pattern_for+'\',\''+ak_tmpColor+'\')">'+ak_gradient_pattern_for+': '+ak_tmpColor+'</item>'
ak_tmpMStart+='<item onactivate="ak_select_gradient_menu(evt,\''+ak_gradient_pattern_for+'\',\'none\')">'+ak_gradient_pattern_for+': none</item>'
ak_tmp_current_id=""
}
var ak_tmpUrlObject=""
if(ak_tmp_current_id) ak_tmpUrlObject=document.getElementById(ak_tmp_current_id)
if(!/^\[object SVG/.test(ak_tmpUrlObject)) ak_tmpUrlObject=""
else ak_tmpUrlObject=ak_tmpUrlObject.tagName
var ak_tmp_checked=""
var ak_tmp_menu_end=''
ak_tmp_menu_end+="</menu>"
var ak_tmp_url_menu=ak_tmpMStart
var ak_tmp_nodeList=ak_userspace_svg.getElementsByTagName("linearGradient")
if(ak_tmpUrlObject=="linearGradient") ak_tmp_url_menu+='<menu><header>*  '+ak_gradient_pattern_for+': linearGradient</header>'
else ak_tmp_url_menu+='<menu><header>'+ak_gradient_pattern_for+': linearGradient</header>'
ak_tmp_url_menu+='<item onactivate="'+"ak_select_gradient_menu(evt,'New linearGradient')"+'">'+'New linearGradient</item>'
ak_tmp_url_menu+='<separator/>'
if(ak_tmp_nodeList.length<=0)
{
ak_tmp_url_menu+='<item enabled="no">Select linearGradient</item>'
}
else
{
for(var i=0;i<ak_tmp_nodeList.length;i++)
{
var ak_tmp_id=ak_tmp_nodeList.item(i).getId()
if(ak_tmp_id!="")
{
if(ak_tmp_current_id==ak_tmp_id) ak_tmp_url_menu+='<item checked="yes" onactivate="ak_select_gradient_menu(evt,\''+ak_gradient_pattern_for+'\',false)">'+ak_tmp_id+'</item>'
else ak_tmp_url_menu+='<item onactivate="'+"ak_select_gradient_menu(evt,'Select linearGradient','"+ak_tmp_id+"'"+')">'+ak_tmp_id+'</item>'
}
}
}
ak_tmp_url_menu+='</menu>'
var ak_tmp_nodeList=ak_userspace_svg.getElementsByTagName("radialGradient")
if(ak_tmpUrlObject=="radialGradient") ak_tmp_url_menu+='<menu><header>*  '+ak_gradient_pattern_for+': radialGradient</header>'
else ak_tmp_url_menu+='<menu><header>'+ak_gradient_pattern_for+': radialGradient</header>'
ak_tmp_url_menu+='<item onactivate="'+"ak_select_gradient_menu(evt,'New radialGradient')"+'">'+'New radialGradient</item>'
ak_tmp_url_menu+='<separator/>'
if(ak_tmp_nodeList.length<=0)
{
ak_tmp_url_menu+='<item enabled="no">Select radialGradient</item>'
}
else
{
for(var i=0;i<ak_tmp_nodeList.length;i++)
{
var ak_tmp_id=ak_tmp_nodeList.item(i).getId()
if(ak_tmp_id!="")
{
if(ak_tmp_current_id==ak_tmp_id) ak_tmp_url_menu+='<item checked="yes" onactivate="ak_select_gradient_menu(evt,\''+ak_gradient_pattern_for+'\',false)">'+ak_tmp_id+'</item>'
else ak_tmp_url_menu+='<item onactivate="'+"ak_select_gradient_menu(evt,'Select radialGradient','"+ak_tmp_id+"'"+')">'+ak_tmp_id+'</item>'
}
}
}
ak_tmp_url_menu+='</menu>'
var ak_tmp_nodeList=ak_userspace_svg.getElementsByTagName("pattern")
if(ak_tmpUrlObject=="pattern") ak_tmp_url_menu+='<menu><header>*  '+ak_gradient_pattern_for+': pattern</header>'
else ak_tmp_url_menu+='<menu><header>'+ak_gradient_pattern_for+': pattern</header>'
ak_tmp_url_menu+='<item onactivate="'+"ak_select_gradient_menu(evt,'New pattern')"+'">'+'New pattern</item>'
ak_tmp_url_menu+='<separator/>'
if(ak_tmp_nodeList.length<=0)
{
ak_tmp_url_menu+='<item enabled="no">Select pattern</item>'
}
else
{
for(var i=0;i<ak_tmp_nodeList.length;i++)
{
var ak_tmp_id=ak_tmp_nodeList.item(i).getId()
if(ak_tmp_id!="")
{
if(ak_tmp_current_id==ak_tmp_id) ak_tmp_url_menu+='<item checked="yes" onactivate="ak_select_gradient_menu(evt,\''+ak_gradient_pattern_for+'\',false)">'+ak_tmp_id+'</item>'
else ak_tmp_url_menu+='<item onactivate="'+"ak_select_gradient_menu(evt,'Select pattern','"+ak_tmp_id+"'"+')">'+ak_tmp_id+'</item>'
}
}
}
ak_tmp_url_menu+='</menu>'
if(ak_tmp_current_id)
{
ak_tmp_url_menu+='<separator/><item onactivate="ak_select_gradient_menu(evt,\''+ak_gradient_pattern_for+'\',false)">Remove '+ak_gradient_pattern_for+'</item>'
if(ak_tmpCheck && ak_gradient_pattern_for=="stroke" && ak_getAttribute("stroke-width")!="false") ak_tmp_url_menu+='<item onactivate="ak_select_gradient_menu(evt,\'remStroke|Width\',\'none\')">Remove stroke|stroke-width</item>'
}
else if(ak_tmpCheck && ak_gradient_pattern_for=="stroke" && ak_getAttribute("stroke-width")!="false") ak_tmp_url_menu+='<separator/><item onactivate="ak_select_gradient_menu(evt,\'remStroke|Width\',\'none\')">Remove stroke|stroke-width</item>'
ak_tmp_url_menu+=ak_tmp_menu_end
contextMenu().replaceChild(parseXML(ak_tmp_url_menu,contextMenu()).firstChild,contextMenu().firstChild)
}
else
{ // dann filter
var ak_tmp_current_id=ak_SetGetRm_styleValue(ak_object2update,"filter","get","no_cout")
if(/^(url\( *#)/.test(ak_tmp_current_id)) {ak_tmp_current_id=ak_tmp_current_id.replace(/^(url\( *#)|( *\))$/g,"")}
else ak_tmp_current_id="" // bei extern url
var ak_tmp_menu='<menu id="ak_filter_context_menu"><header>Select Filter</header>'
ak_tmp_menu+='<menu><header>New Filter (add ...)</header>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feBlend')"+'">&lt;feBlend</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feColorMatrix')"+'">&lt;feColorMatrix</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feComponentTransfer')"+'">&lt;feComponentTransfer</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feComposite')"+'">&lt;feComposite</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feConvolveMatrix')"+'">&lt;feConvolveMatrix</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feDisplacementMap')"+'">&lt;feDisplacementMap</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feFlood')"+'">&lt;feFlood</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feGaussianBlur')"+'">&lt;feGaussianBlur</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feImage')"+'">&lt;feImage      -> prompt:</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feImageGotoIO')"+'">&lt;feImage      -> dialog:</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feImageGotoIObase64')"+'">&lt;feImage      -> base64,...</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feMerge')"+'">&lt;feMerge</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feMorphology')"+'">&lt;feMorphology</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feOffset')"+'">&lt;feOffset</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feTile')"+'">&lt;feTile</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feTurbulence')"+'">&lt;feTurbulence</item>'
ak_tmp_menu+='<separator/>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feDiffuseLighting')"+'">&lt;feDiffuseLighting (Distant)</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feDiffuseLightingP')"+'">&lt;feDiffuseLighting (Point)</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feDiffuseLightingS')"+'">&lt;feDiffuseLighting (Spot)</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feSpecularLighting')"+'">&lt;feSpecularLighting (Distant)</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feSpecularLightingP')"+'">&lt;feSpecularLighting (Point)</item>'
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter','feSpecularLightingS')"+'">&lt;feSpecularLighting (Spot)</item>'
ak_tmp_menu+='</menu>'
//ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter (shadow)')"+'">'+'New Filter (shadow)</item><separator/>'
ak_tmp_menu+='<menu><header>New Filter (predefined)</header>'
for(var i=0;i<ak_predefinedFilter.length;i++)
{
ak_tmp_menu+='<item onactivate="'+"ak_select_filter_menu(evt,'New Filter (predefined)','"+ak_predefinedFilter[i]+"')"+'">'+ak_predefinedFilter[i]+'</item>'
}
ak_tmp_menu+='</menu>'
ak_tmp_menu+='<separator/>'
var ak_tmp_nodeList=ak_userspace_svg.getElementsByTagName("filter")
if(ak_tmp_nodeList.length<=0)
{
ak_tmp_menu+='<item enabled="no">Select Filter</item>'
}
else
{
for(var i=0;i<ak_tmp_nodeList.length;i++)
{
try{
var ak_tmp_id=ak_tmp_nodeList.item(i).getId()
if(ak_tmp_id!="" && ak_tmp_id!=null)
{
if(ak_tmp_current_id==ak_tmp_id)
{
ak_tmp_menu+='<item checked="yes" onactivate="ak_select_filter_menu(evt,\'Remove Filter\')">'+ak_tmp_id+'</item>'
}
else
{
ak_tmp_menu+='<item onactivate="ak_select_filter_menu(evt,\'Change Filter\',\'url(#'+ak_tmp_id+')\')">'+ak_tmp_id+'</item>'
}
}
}catch(err){}
}
}
ak_tmp_menu+='</menu>'
contextMenu().replaceChild(parseXML(ak_tmp_menu,contextMenu()).firstChild,contextMenu().firstChild)
}
return
}
}
// ######################################################
function ak_cout2id(id,text)
{
document.getElementById(id).firstChild.data=text;
}
//############### ak_set #######################################
var ak_style_cout="";
var ak_transform_attributes=";translate;matrix;scale;scaleX;scaleY;rotate;skewX;skewY;"
var ak_style_attributes=";alignment-baseline;baseline-shift;clip;clip-path;clip-rule;"
ak_style_attributes+="color;color-interpolation;color-interpolation-filters;color-profile;color-rendering;"
ak_style_attributes+="cursor;direction;display;dominant-baseline;enable-background;"
ak_style_attributes+="fill;fill-opacity;fill-rule;filter;flood-color;flood-opacity;"
ak_style_attributes+="font;font-family;font-size;font-size-adjust;font-stretch;font-style;font-variant;font-weight;"
ak_style_attributes+="glyph-orientationhoizontal;glyph-orientationvertical;image-rendering;"
ak_style_attributes+="kerning;letter-spacing;lighting-color;marker;marker-end;marker-mid;marker-start;mask;"
ak_style_attributes+="opacity;overflow;pointer-events;shape-rendering;stop-color;stop-opacity;"
ak_style_attributes+="stroke;stroke-dasharray;stroke-dashoffset;stroke-linecap;stroke-linejoin;stroke-miterlimit;"
ak_style_attributes+="stroke-opacity;stroke-width;text-anchor;text-decoration;text-rendering;unicode-bidi;"
ak_style_attributes+="visibility;word-spacing;writing-mode;"
//#######################
function ak_rmAttribute(object_to_change,which_attribute)
{
if(typeof(object_to_change)=="string")
{
which_attribute=object_to_change
object_to_change=ak_object2update
}
if(ak_transform_attributes.search(";"+which_attribute+";")!=-1)
{
return ak_SetGetRm_transformValue(object_to_change,which_attribute,"remove","no_cout")
}
else return ak_SetGetRm_styleValue(object_to_change,which_attribute,"remove","no_cout")
}
//#######################
function ak_setAttribute(object_to_change,which_attribute,SetGetRm)
{
if(typeof(object_to_change)=="string")
{
SetGetRm=which_attribute
which_attribute=object_to_change
object_to_change=ak_object2update
}
if(ak_transform_attributes.search(";"+which_attribute+";")!=-1)
{
return ak_SetGetRm_transformValue(object_to_change,which_attribute,SetGetRm,"no_cout")
}
else return ak_SetGetRm_styleValue(object_to_change,which_attribute,SetGetRm,"no_cout")
}
//#######################
function ak_getAttribute(object_to_change,which_attribute)
{
if(typeof(object_to_change)=="string")
{
which_attribute=object_to_change
object_to_change=ak_object2update
}
if(ak_transform_attributes.search(";"+which_attribute+";")!=-1)
{
return ak_SetGetRm_transformValue(object_to_change,which_attribute,"get","no_cout")
}
else return ak_SetGetRm_styleValue(object_to_change,which_attribute,"get","no_cout")
}
//#######################
function ak_setGetRmAttribute(object_to_change,which_attribute,SetGetRm,no_cout)
{
if(ak_transform_attributes.search(";"+which_attribute+";")!=-1)
{
return ak_SetGetRm_transformValue(object_to_change,which_attribute,SetGetRm,no_cout)
}
else return ak_SetGetRm_styleValue(object_to_change,which_attribute,SetGetRm,no_cout)
}
//#######################
function ak_SetGetRm_styleValue(object_to_change,which_attribute,SetGetRm,no_cout) // SetGetRm wert=set, get, remove
{
if(!object_to_change) return
if(which_attribute && ak_style_attributes.search(";"+which_attribute+";")==-1)
{
var ak_tmp_nocss
if(SetGetRm=="get")
{
ak_tmp_nocss=object_to_change.getAttribute(which_attribute)
if(ak_tmp_nocss) return ak_tmp_nocss
else return "false"
}
else if(SetGetRm=="remove")
{
try{object_to_change.removeAttribute(which_attribute)}catch(err){}
return "false"
}
else
{
ak_tmp_nocss=object_to_change.setAttribute(which_attribute,SetGetRm)
return SetGetRm
}
}
if(/^(animate)/.test(object_to_change.tagName)) return "false"
if(ak_which_nodeNr(object_to_change)!=-1 && !/^(get)/.test(SetGetRm)) ak_push2undoTrue() // grid on/off direct
if(which_attribute=="flood-opacity" && !/\[object SVGFEFlood/.test(object_to_change) && ak_gradient_stop_index!=-1) object_to_change=ak_getObject(ak_gradient_stop_index)
if(SetGetRm=="get_print")
{
ak_style_cout=object_to_change.getAttribute("style")
ak_cout('style="'+ak_style_cout+'"')
return
}
var ak_tmp_attribute=which_attribute
which_attribute+=":"
var tmpStyle // try weil aerger bei spreadMethod bei den gradienten
try{tmpStyle=object_to_change.getAttribute("style")}catch(err){return "false"}
if (SetGetRm=="get" && tmpStyle=="")
{
var tmp_return_2=object_to_change.getAttribute(ak_tmp_attribute)
if(!tmp_return_2) tmpStyle=''
else
{
tmp_return_2=which_attribute+tmp_return_2
object_to_change.setAttribute("style",tmp_return_2)
try{object_to_change.removeAttribute(ak_tmp_attribute)}catch(error){}
tmpStyle=tmp_return_2
}
}
else if (SetGetRm=="remove" && tmpStyle=="")
{
try{object_to_change.removeAttribute(ak_tmp_attribute)}
catch(error){}
tmpStyle=''
}
tmpStyle=tmpStyle.replace(/^ +| +$/g,"")
if (SetGetRm=="get") // dann heisst das get
{
tmpStyle=tmpStyle.replace(/;+$/g,"")
if (tmpStyle.length==0 && no_cout=='no_cout') return "false"
var tmpStyleSplit=tmpStyle.split(";")
for (var i=0;i<tmpStyleSplit.length;i++) {tmpStyleSplit[i]=tmpStyleSplit[i].replace(/^ +| +$/g,"")}
var tmp_return="false"
for (i=0;i<tmpStyleSplit.length;i++)
{
if(tmpStyleSplit[i].substring(0,which_attribute.length)==which_attribute) tmp_return=tmpStyleSplit[i].substring(which_attribute.length,tmpStyleSplit[i].length)
}
tmp_return=tmp_return.replace(/^ +| +$/g,"")
if(!tmp_return) tmp_return='false'
if(tmp_return=='false')
{
tmp_return=object_to_change.getAttribute(ak_tmp_attribute)
if(!tmp_return) tmp_return='false'
}
var tmp_style=object_to_change.getAttribute("style");
tmp_style='style="'+tmp_style+'"';
ak_style_cout=tmp_style
if (no_cout!="no_cout") ak_cout(tmp_style)
if(tmp_return=="false" && (no_cout=='getValue' || no_cout=='setValue'))
{
switch(ak_tmp_attribute)
{
case "stop-color":
case "flood-color":
case "fill":
case "stroke":
tmp_return="#000000"
break
case "lighting-color":
tmp_return="#ffffff"
break
case "flood-opacity":
case "fill-opacity":
case "stroke-opacity":
case "opacity":
case "stop-opacity":
case "stroke-width":
tmp_return="1"
break
case "font-size":
tmp_return="12"
break
case "visibility":
tmp_return=" "
break
default:
tmp_return='0'
}
if(no_cout=='setValue' && tmpStyle) object_to_change.setAttribute("style",tmpStyle+';'+which_attribute+tmp_return)
else if(no_cout=='setValue') object_to_change.setAttribute("style",which_attribute+tmp_return)
}
if(which_attribute=="flood-opacity:" && ak_gradient_stop_index!=-1) ak_tagName_cout=ak_getAttributeCout("<"+ak_fe2edit.tagName,ak_fe2edit,'result','style')
return tmp_return
}
if (SetGetRm=="remove") // dann heisst das rm remove
{
tmpStyle=tmpStyle.replace(/;+$/g,"")
if (tmpStyle.length==0) return "false";
var tmpStyleSplit=tmpStyle.split(";");
for (i=0;i<tmpStyleSplit.length;i++) {tmpStyleSplit[i]=tmpStyleSplit[i].replace(/^ +| +$/g,"")}
var tmp_return="false";
for (i=(tmpStyleSplit.length-1);i>=0;i--)
{
if(tmpStyleSplit[i].substring(0,which_attribute.length)==which_attribute) tmpStyleSplit.splice(i,1)
}
var tmpStyleSplitResult="";
for (i=0;i<tmpStyleSplit.length;i++)
{
if(i!=0) tmpStyleSplitResult=tmpStyleSplitResult+";"
tmpStyleSplitResult=tmpStyleSplitResult+tmpStyleSplit[i]
}
if(tmpStyleSplitResult=="")
{
object_to_change.setAttribute("style",'stroke:#000') // if hasAnimate trick to remove fill
try {object_to_change.removeAttribute("style")}catch(error){}
}
else object_to_change.setAttribute("style",tmpStyleSplitResult)
tmpStyleSplitResult='style="'+tmpStyleSplitResult+'"';
ak_style_cout=tmpStyleSplitResult
if (no_cout!="no_cout") ak_cout(tmpStyleSplitResult)
try{object_to_change.removeAttribute(ak_tmp_attribute)}
catch(error){}
if(which_attribute=="flood-opacity:" && ak_gradient_stop_index!=-1) ak_tagName_cout=ak_getAttributeCout("<"+ak_fe2edit.tagName,ak_fe2edit,'result','style')
return "false"
}
// dann heisst das set
tmpStyle=tmpStyle.replace(/;+$/g,"")
if (tmpStyle.length==0) {tmpStyle=which_attribute+SetGetRm;}
var tmpStyleSplit=tmpStyle.split(";");
for (i=0;i<tmpStyleSplit.length;i++) {tmpStyleSplit[i]=tmpStyleSplit[i].replace(/^ +| +$/g,"")}
var tmp_return="false";
var tmp_push=which_attribute+SetGetRm;
for (i=0;i<tmpStyleSplit.length;i++) //<
{
if(tmpStyleSplit[i].substring(0,which_attribute.length)==which_attribute) {tmp_return="true"; tmpStyleSplit[i]=tmp_push;}
}
if (tmp_return=="false") tmpStyleSplit.push(tmp_push)
var tmpStyleSplitResult=tmpStyleSplit.join(";")
object_to_change.setAttribute("style",tmpStyleSplitResult)
tmpStyleSplitResult='style="'+tmpStyleSplitResult+'"'
ak_style_cout=tmpStyleSplitResult
if (no_cout!="no_cout") ak_cout(tmpStyleSplitResult)
if(which_attribute=="flood-opacity:" && ak_gradient_stop_index!=-1) ak_tagName_cout=ak_getAttributeCout("<"+ak_fe2edit.tagName,ak_fe2edit,'result','style')
return SetGetRm
}
//###########################################################################################################
function ak_toolBoxMouse(evt,action,attribute)
{
if(!ak_menuValid(evt,"toolBox")) return
var ak_tmp, ak_tmp2
if((ak_object2update_nodeNr==-1 && !/(sv)|(hue)|(closeTools)|(prevColor)|(prevColorStroke)|(cache1Color)|(cache2Color)/.test(action)) || action=="nix")
{
evt.preventDefault()
if(evt.type=="mousedown")
{
document.getElementById("ak_select_element_first").setAttribute("transform","matrix(1,0,0,1,"+(evt.clientX-25)+","+(evt.clientY+10)+")")
document.getElementById("ak_select_element_first").setAttribute("style","visibility:visible")
ak_up_eval="ak_toolBoxMouse(evt,'nix')"
return
}
else if(evt.type=="mouseup")
{
document.getElementById("ak_use_right_mouse_button").setAttribute("style","visibility:hidden")
document.getElementById("ak_select_element_first").setAttribute("style","visibility:hidden")
ak_up_eval=""
return
}
}
if(evt.type=="mousedown" && evt.getButton==0)
{
switch(action)
{
case "sv":
ak_selection('hide_only_selection')
ak_MoveSlider_s_v(evt,'true','fill')
ak_move_eval="ak_MoveSlider_s_v(evt,'none','fill')"
ak_up_eval="ak_toolBoxMouse(evt,'sv')"
break
case "hue":
ak_selection('hide_only_selection')
ak_MoveSlider_hue(evt,'true','fill')
ak_move_eval="ak_MoveSlider_hue(evt,'none','fill')"
ak_up_eval="ak_toolBoxMouse(evt,'hue')"
break
case "closeTools":
ak_hide_s_v(evt)
break
case "prevColor":
ak_Fcustom_button(evt,'prev_fill_color')
break
case "prevColorStroke":
ak_Fcustom_button(evt,'prev_stroke_color')
break
case "cache1Color":
ak_Fcustom_button(evt,'fill_color')
break
case "cache2Color":
ak_Fcustom_button(evt,'stroke_color')
break
case "fill":
ak_tmp=ak_getAttribute(ak_object2update,"fill")
if(/(false)|(none)/.test(ak_tmp))
{
ak_color_action_on="fill"
ak_set4Style(evt,ak_color_action_on,"off")
ak_setAttribute(ak_object2update,"fill",ak_getAttribute(ak_colToolBox,"fill"))
ak_init_buttonV3()
}
else if(/^url/.test(ak_tmp) && ak_buttonFill.getAttribute("fill")==ak_on)
{
ak_set4Style(evt,ak_color_action_on,"off")
ak_edit_gradient_flag=false
ak_color_action_on=""
ak_init_buttonV3()
}
else if(/^url/.test(ak_tmp))
{
ak_color_action_on="fill_url"
ak_set4Style(evt,ak_color_action_on)
ak_init_buttonV3()
ak_set_gradient_control(evt)
}
else if(ak_color_action_on!=action)
{
ak_color_action_on="fill"
ak_set4Style(evt,ak_color_action_on,"off")
ak_init_buttonV3()
}
else
{
document.getElementById("ak_use_right_mouse_button").setAttribute("transform","matrix(1,0,0,1,"+(evt.clientX-25)+","+(evt.clientY+10)+")")
document.getElementById("ak_use_right_mouse_button").setAttribute("style","visibility:visible")
ak_up_eval="ak_toolBoxMouse(evt,'nix')"
}
break
case "stroke":
ak_tmp=ak_getAttribute(ak_object2update,action)
if(/(false)|(none)/.test(ak_tmp))
{
ak_color_action_on=action
ak_setAttribute(ak_object2update,action,ak_getAttribute(ak_colToolBox,"fill"))
ak_set4Style(evt,ak_color_action_on)
ak_init_buttonV3()
}
else if(/^url/.test(ak_tmp) && ak_buttonStroke.getAttribute("fill")==ak_on)
{
ak_set4Style(evt,ak_color_action_on,"off")
ak_edit_gradient_flag=false
ak_color_action_on=""
ak_init_buttonV3()
}
else if(/^url/.test(ak_tmp))
{
ak_color_action_on="stroke_url"
ak_set4Style(evt,ak_color_action_on)
ak_init_buttonV3()
ak_set_gradient_control(evt)
}
else if(ak_color_action_on!=action)
{
ak_color_action_on=action
ak_set4Style(evt,ak_color_action_on)
ak_init_buttonV3()
}
else
{
document.getElementById("ak_use_right_mouse_button").setAttribute("transform","matrix(1,0,0,1,"+(evt.clientX-25)+","+(evt.clientY+10)+")")
document.getElementById("ak_use_right_mouse_button").setAttribute("style","visibility:visible")
ak_up_eval="ak_toolBoxMouse(evt,'nix')"
}
break
case "filter":
ak_tmp=ak_getAttribute(ak_object2update,action)
if(/^url/.test(ak_tmp) && ak_buttonFilter.getAttribute("fill")==ak_on)
{
ak_set4Style(evt,ak_color_action_on,"off")
ak_edit_gradient_flag=false
ak_color_action_on=""
ak_init_buttonV3()
}
else if(/^url/.test(ak_tmp))
{
ak_color_action_on="filter"
ak_set4Style(evt,ak_color_action_on)
ak_init_buttonV3()
ak_set_gradient_control(evt)
}
else
{
document.getElementById("ak_use_right_mouse_button").setAttribute("transform","matrix(1,0,0,1,"+(evt.clientX-25)+","+(evt.clientY+10)+")")
document.getElementById("ak_use_right_mouse_button").setAttribute("style","visibility:visible")
ak_up_eval="ak_toolBoxMouse(evt,'nix')"
}
break
case "visibility":
case "transform":
document.getElementById("ak_use_right_mouse_button").setAttribute("transform","matrix(1,0,0,1,"+(evt.clientX-25)+","+(evt.clientY+10)+")")
document.getElementById("ak_use_right_mouse_button").setAttribute("style","visibility:visible")
ak_up_eval="ak_toolBoxMouse(evt,'nix')"
break
}
}
if(evt.type=="mousedown" && evt.getButton==2)
{
switch(action)
{
case "sv":
evt.preventDefault()
ak_selection('hide_only_selection')
ak_up_eval="ak_toolBoxMouse(evt,'sv')"
break
case "hue":
evt.preventDefault()
ak_MoveSlider_hue(evt,'true','fill')
ak_move_eval="ak_MoveSlider_hue(evt,'none','fill')"
ak_up_eval="ak_toolBoxMouse(evt,'hue')"
break
case "prevColor":
ak_Fcustom_button(evt,'prev_fill_color')
break
case "prevColorStroke":
ak_Fcustom_button(evt,'prev_stroke_color')
break
case "cache1Color":
ak_Fcustom_button(evt,'fill_color')
break
case "cache2Color":
ak_Fcustom_button(evt,'stroke_color')
break
case "fill":
ak_Fstandard_button(evt,'fill_url')
break
case "stroke":
ak_Fstandard_button(evt,'stroke_url')
break
case "filter":
ak_Fstandard_button(evt,'filter')
break
case "visibility":
ak_showVisibilityMenu(evt)
break
case "transform":
var ak_tmp_true=false
for(var i=0;i<ak_has_transform.length;i++)
{
if(ak_has_transform[i]==ak_object2update.tagName)
{
ak_tmp_true=true
break
}
}
if(ak_tmp_true) ak_Fcustom_button(evt,'rm_matrix')
else
{
evt.preventDefault()
document.getElementById("ak_select_element_first").setAttribute("transform","matrix(1,0,0,1,"+(evt.clientX-25)+","+(evt.clientY+10)+")")
document.getElementById("ak_select_element_first").setAttribute("style","visibility:visible")
ak_up_eval="ak_toolBoxMouse(evt,'nix')"
return
}
break
default:
evt.preventDefault()
}
}
else if(evt.type=="mouseup")
{
switch(action)
{
case "sv":
ak_selection('show')
ak_MoveSlider_s_v(evt,'false','none')
ak_move_eval=""
ak_up_eval=""
break
case "hue":
ak_selection('show')
ak_MoveSlider_hue(evt,'false','none')
ak_move_eval=""
ak_up_eval=""
break
}
}
}
//############################# 
function ak_showVisibilityMenu(evt)
{
var ak_tmp, ak_tmp2, ak_tmpNode
ak_tmp=ak_getAttribute(ak_object2update,"visibility")
ak_tmpNode='<menu><header>Menu Visibility</header>'
if(ak_tmp=="visible") ak_tmpNode+='<item checked="yes" onactivate="ak_editVisibility(evt,false)">visibility = "visible"</item>'
else ak_tmpNode+='<item onactivate="ak_editVisibility(evt,\'visible\')">visibility = "visible"</item>'
if(ak_tmp=="hidden") ak_tmpNode+='<item checked="yes" onactivate="ak_editVisibility(evt,false)">visibility = "hidden"</item>'
else ak_tmpNode+='<item onactivate="ak_editVisibility(evt,\'hidden\')">visibility = "hidden"</item>'
contextMenu().replaceChild(parseXML(ak_tmpNode,getContextMenu()).firstChild,getContextMenu().firstChild)      
}
//############################# 
function ak_editVisibility(evt,action)
{
if(!action) ak_rmAttribute(ak_object2update,"visibility")
else ak_setAttribute(ak_object2update,"visibility",action)
ak_init_buttonV3()
}
//############################# 
function ak_set4Style(evt,action,schalte)
{
if(ak_which_nodeNr(ak_fillUrl4)==ak_object2update_nodeNr) ak_fillUrl4=false
if(ak_which_nodeNr(ak_strokeUrl4)==ak_object2update_nodeNr) ak_strokeUrl4=false
if(ak_which_nodeNr(ak_filter4)==ak_object2update_nodeNr) ak_filter4=false
if(ak_which_nodeNr(ak_stroke4)==ak_object2update_nodeNr) ak_stroke4=false
if(schalte=="off")
{
ak_color_action_on=""
ak_edit_gradient_flag=false
ak_selection("show")
ak_setAttribute(ak_toolGradient,"visibility","hidden")
ak_sliderArrayV3[4][0].parentNode.setAttribute("visibility","hidden")
ak_sliderArrayV3[5][0].parentNode.setAttribute("visibility","hidden")
return
}
switch(action)
{
case "fill_url":
ak_fillUrl4=ak_object2update
ak_sliderArrayV3[5][0].parentNode.setAttribute("visibility","hidden")
break
case "stroke_url":
ak_strokeUrl4=ak_object2update
ak_sliderArrayV3[5][0].parentNode.setAttribute("visibility","hidden")
break
case "filter":
ak_filter4=ak_object2update
ak_sliderArrayV3[4][0].parentNode.setAttribute("visibility","hidden")
break
case "stroke":
ak_color_action_on="stroke"
ak_edit_gradient_flag=false
ak_stroke4=ak_object2update
ak_selection("show")
ak_setAttribute(ak_toolGradient,"visibility","hidden")
ak_sliderArrayV3[4][0].parentNode.setAttribute("visibility","hidden")
ak_sliderArrayV3[5][0].parentNode.setAttribute("visibility","hidden")
break
default:
ak_color_action_on=""
ak_edit_gradient_flag=false
ak_selection("show")
ak_setAttribute(ak_toolGradient,"visibility","hidden")
ak_sliderArrayV3[4][0].parentNode.setAttribute("visibility","hidden")
ak_sliderArrayV3[5][0].parentNode.setAttribute("visibility","hidden")
}
}
//#############################  More Sliders  ##################################################
var ak_sliderX, ak_sliderY
function ak_init_more_sliders(evt)
{
ak_make_sliderV3(ak_sliderX,ak_sliderY,50,"fill-opacity")
ak_make_sliderV3(ak_sliderX+30,ak_sliderY,50,"stroke-opacity")
ak_make_sliderV3(ak_sliderX+60,ak_sliderY,50,"opacity")
ak_make_sliderV3(ak_sliderX+90,ak_sliderY,50,"stroke-width")
ak_make_sliderV3(ak_sliderX-30,ak_sliderY,50,"stop-opacity")
ak_make_sliderV3(ak_sliderX-30,ak_sliderY,50,"flood-opacity")
ak_sliderArrayV3[4][0].parentNode.setAttribute("visibility","hidden")
ak_sliderArrayV3[5][0].parentNode.setAttribute("visibility","hidden")
ak_undo_init=ak_set_cout// ak_save  //ak_make_slide()
}
//##############################################    
var ak_sliderArrayV3=new Array  
function ak_make_sliderV3(startX,startY,length,attribute)
{
var ak_tmpNode="", ak_tmp
var ak_tmpNr=ak_sliderArrayV3.length
ak_tmpNode+='<g transform="translate('+startX+','+startY+')">'
if(/^stop|^flood/.test(attribute)) ak_tmpNode+='<rect x="0" y="0" width="30" height="22" style="fill:#88e;stroke:#000;stroke-width:1"/>'
else ak_tmpNode+='<rect x="0" y="0" width="30" height="22" style="fill:#aaa;stroke:#000;stroke-width:1"/>'
if(/\-/.test(attribute))
{
ak_tmp=attribute.split("-")
ak_tmpNode+='<text x="16" y="10" style="text-anchor:middle;font-size:9;fill:#123456">'+ak_tmp[0]+'</text>'
if(ak_tmp[1]=="opacity") ak_tmpNode+='<text x="16" y="19" style="text-anchor:middle;font-size:11;fill:#123456">opac.</text>'
else ak_tmpNode+='<text x="16" y="19" style="text-anchor:middle;font-size:11;fill:#123456">'+ak_tmp[1]+'</text>'
}
else ak_tmpNode+='<text x="16" y="15" style="text-anchor:middle;font-size:11;fill:#123456">opac.</text>'
ak_tmpNode+='<rect x="0" y="0" width="40" height="22" style="opacity:0"'
ak_tmpNode+=' onmousedown="ak_slideV3(evt,\'OnOff\','+ak_tmpNr+')"/>'
ak_tmpNode+='<g transform="translate(0,-4)" onmousedown="ak_slideV3(evt,\'slide\','+ak_tmpNr+')">'
if(/^stop|^flood/.test(attribute)) ak_tmpNode+='<rect x="0" y="26" width="30" height="'+(length+4+13)+'" style="fill:#ff9;stroke:#000;stroke-width:1"/>'
else ak_tmpNode+='<rect x="0" y="26" width="30" height="'+(length+4+13)+'" style="fill:#ccc;stroke:#000;stroke-width:1"/>'
ak_tmpNode+='<g transform="translate(0,35)">'
ak_tmpNode+='<line x1="8" y1="0" x2="22" y2="0" style="stroke:#00f;stroke-width:1"/>'
for(var i=5;i<=length;i+=5)
{
if(Math.floor(i/50)==(i/50)) ak_tmpNode+='<line x1="8" y1="'+i+'" x2="22" y2="'+i+'" style="stroke:#000;stroke-width:1"/>'
else if(Math.floor(i/25)==(i/25)) ak_tmpNode+='<line x1="11" y1="'+i+'" x2="19" y2="'+i+'" style="stroke:#000;stroke-width:1"/>'
else ak_tmpNode+='<line x1="13" y1="'+i+'" x2="17" y2="'+i+'" style="stroke:#888;stroke-width:1"/>'
}
ak_tmpNode+='</g>'
if(attribute=="stroke-width") ak_tmpNode+='<g transform="translate(0,33)">'
else ak_tmpNode+='<g transform="translate(0,78)">'
ak_tmpNode+='<rect x="2" y="0" width="26" height="13" fill="#eee" style="stroke:#000;stroke-width:1"/>'
ak_tmpNode+='<text x="16" y="11" style="text-anchor:middle;font-size:11;fill:#123456">off</text>'
ak_tmpNode+='<rect x="2" y="0" width="26" height="13" style="stroke:none;opacity:0"/>'
ak_tmpNode+='</g>'
ak_tmpNode+='</g>'
ak_tmpNode+='</g>'
ak_tmpNode=parseXML(ak_tmpNode,document).firstChild
ak_sliderArrayV3.push(new Array)
ak_sliderArrayV3[ak_tmpNr][0]=ak_tmpNode.lastChild
ak_sliderArrayV3[ak_tmpNr][1]=ak_tmpNode.lastChild.lastChild
ak_sliderArrayV3[ak_tmpNr][2]=attribute
ak_toolBox.appendChild(ak_tmpNode)
}
//##############################################    
var ak_yIn=0, ak_yInShift=255 //251
function ak_slideV3(evt,action,nr)
{
if(!ak_menuValid(evt,"slider")) return
var ak_tmp, ak_tmp2
if(ak_object2update_nodeNr==-1 || action=="nix")
{
evt.preventDefault()
if(evt.type=="mousedown")
{
document.getElementById("ak_select_element_first").setAttribute("transform","matrix(1,0,0,1,"+(evt.clientX-25)+","+(evt.clientY+10)+")")
document.getElementById("ak_select_element_first").setAttribute("style","visibility:visible")
ak_up_eval="ak_toolBoxMouse(evt,'nix')"
return
}
else if(evt.type=="mouseup")
{
document.getElementById("ak_use_right_mouse_button").setAttribute("style","visibility:hidden")
document.getElementById("ak_select_element_first").setAttribute("style","visibility:hidden")
ak_up_eval=""
return
}
}
if(evt.type=="mousedown" && evt.getButton==0)
{
switch(action)
{
case "OnOff":
if(ak_sliderArrayV3[nr][2]=="stop-opacity") ak_tmp=ak_getAttribute(ak_gradient2edit.childNodes.item(ak_gradient_stop_index),ak_sliderArrayV3[nr][2])
else ak_tmp=ak_getAttribute(ak_object2update,ak_sliderArrayV3[nr][2])
if(ak_tmp=="false")
{
if(ak_sliderArrayV3[nr][2]=="stop-opacity") ak_setAttribute(ak_gradient2edit.childNodes.item(ak_gradient_stop_index),ak_sliderArrayV3[nr][2],1)
else ak_setAttribute(ak_object2update,ak_sliderArrayV3[nr][2],1)
if(ak_sliderArrayV3[nr][2]=="stroke-width") ak_sliderArrayV3[nr][1].setAttribute("transform","translate(0,33)")
else ak_sliderArrayV3[nr][1].setAttribute("transform","translate(0,78)")
ak_sliderArrayV3[nr][1].firstChild.setAttribute("fill","#ee0")
ak_sliderArrayV3[nr][1].firstChild.nextSibling.firstChild.data="1.00"
}
else
{
if(ak_sliderArrayV3[nr][2]=="stop-opacity") ak_rmAttribute(ak_gradient2edit.childNodes.item(ak_gradient_stop_index),ak_sliderArrayV3[nr][2])
else ak_rmAttribute(ak_object2update,ak_sliderArrayV3[nr][2])
if(ak_sliderArrayV3[nr][2]=="stroke-width") ak_sliderArrayV3[nr][1].setAttribute("transform","translate(0,33)")
else ak_sliderArrayV3[nr][1].setAttribute("transform","translate(0,78)")
ak_sliderArrayV3[nr][1].firstChild.setAttribute("fill","#eee")
ak_sliderArrayV3[nr][1].firstChild.nextSibling.firstChild.data="off"
}
break
case "slide":
ak_yIn=evt.getClientY()
ak_tmp2=ak_yIn-ak_yInShift
if(ak_tmp2<0) ak_tmp2=0
if(ak_sliderArrayV3[nr][2]=="stop-opacity")
{
ak_selection("hide_keep_gradient_stop")
ak_tmp=ak_getAttribute(ak_gradient2edit.childNodes.item(ak_gradient_stop_index),ak_sliderArrayV3[nr][2])
}
else
{
ak_selection("hide")
ak_tmp=ak_getAttribute(ak_object2update,ak_sliderArrayV3[nr][2])
}
if(ak_sliderArrayV3[nr][2]=="stroke-width")
{
if(ak_tmp=="false" && /false|none/.test(ak_getAttribute(ak_object2update,"stroke")))
{
ak_setAttribute(ak_object2update,"stroke",ak_getAttribute(ak_colToolBox,"fill"))
ak_set4Style(evt,"stroke")
ak_init_buttonV3()
ak_selection("hide")
}
ak_setAttribute(ak_object2update,ak_sliderArrayV3[nr][2],ak_tmp2/5)
ak_sliderArrayV3[nr][1].firstChild.nextSibling.firstChild.data=ak_tmp2/5
if(ak_tmp2>50)
{
ak_sliderArrayV3[nr][1].setAttribute("transform","translate(0,78)")
}
else ak_sliderArrayV3[nr][1].setAttribute("transform","translate(0,"+(28+ak_tmp2)+")")
}
else
{
if(ak_tmp2>50) ak_tmp2=50
ak_sliderArrayV3[nr][1].setAttribute("transform","translate(0,"+(28+ak_tmp2)+")")
ak_sliderArrayV3[nr][1].firstChild.nextSibling.firstChild.data=ak_tmp2/50
if(ak_sliderArrayV3[nr][2]=="stop-opacity") ak_setAttribute(ak_gradient2edit.childNodes.item(ak_gradient_stop_index),ak_sliderArrayV3[nr][2],ak_tmp2/50)
else ak_setAttribute(ak_object2update,ak_sliderArrayV3[nr][2],ak_tmp2/50)
}
ak_sliderArrayV3[nr][1].firstChild.setAttribute("fill","#ee0")
ak_move_eval="ak_slideV3(evt,'"+action+"','"+nr+"')"
ak_up_eval="ak_slideV3(evt,'"+action+"','"+nr+"')"
break
}
}
if(evt.type=="mouseup")
{
ak_move_eval=""
ak_up_eval=""
ak_selection("show")
}
if(evt.type=="mousemove")
{
ak_tmp2=evt.getClientY()-ak_yInShift
if(ak_tmp2<0) ak_tmp2=0
ak_tmp=ak_getAttribute(ak_object2update,ak_sliderArrayV3[nr][2])
if(ak_sliderArrayV3[nr][2]=="stroke-width")
{
if(ak_tmp=="false" && /false|none/.test(ak_getAttribute(ak_object2update,"stroke")))
{
ak_setAttribute(ak_object2update,"stroke",ak_getAttribute(ak_colToolBox,"fill"))
}
ak_setAttribute(ak_object2update,ak_sliderArrayV3[nr][2],ak_tmp2/5)
if((ak_tmp2/5)>100) ak_sliderArrayV3[nr][1].firstChild.nextSibling.firstChild.data=Math.round(ak_tmp2/5)
else ak_sliderArrayV3[nr][1].firstChild.nextSibling.firstChild.data=ak_tmp2/5
if(ak_tmp2>50)
{
ak_sliderArrayV3[nr][1].setAttribute("transform","translate(0,78)")
}
else ak_sliderArrayV3[nr][1].setAttribute("transform","translate(0,"+(28+ak_tmp2)+")")
}
else
{
if(ak_tmp2>50) ak_tmp2=50
ak_sliderArrayV3[nr][1].setAttribute("transform","translate(0,"+(28+ak_tmp2)+")")
ak_sliderArrayV3[nr][1].firstChild.nextSibling.firstChild.data=ak_tmp2/50
if(ak_sliderArrayV3[nr][2]=="stop-opacity") ak_setAttribute(ak_gradient2edit.childNodes.item(ak_gradient_stop_index),ak_sliderArrayV3[nr][2],ak_tmp2/50)
else ak_setAttribute(ak_object2update,ak_sliderArrayV3[nr][2],ak_tmp2/50)
}
}
else if(evt.type=="mousedown" && evt.getButton==2) ak_sliderMenu(evt)
else evt.preventDefault()
}
//##############################################    
function ak_quickMenu()
{
if(!ak_menuValid(evt,"quick|"+arguments[0])) return
var ak_tmpAttribute=arguments[0]
var ak_tmpIn=ak_getAttribute(ak_tmpAttribute)
var ak_tmpNode='<menu><header>Quick Edit Menu</header>'
for(var i=1;i<arguments.length;i++)
{
if(ak_tmpIn==arguments[i]) ak_tmpNode+='<item checked="yes" onactivate="ak_quickEdit(\''+arguments[0]+'\',false)">'+arguments[i]+'</item>'
else ak_tmpNode+='<item onactivate="ak_quickEdit(\''+arguments[0]+'\',\''+arguments[i]+'\')">'+arguments[i]+'</item>'
}
ak_tmpNode+='<separator/>'
if(ak_tmpIn=="false") ak_tmpNode+='<item checked="yes">'+arguments[0]+' removed</item>'
else ak_tmpNode+='<item onactivate="ak_quickEdit(\''+arguments[0]+'\',false)">Remove '+arguments[0]+'</item>'
ak_tmpNode+='</menu>'
contextMenu().replaceChild(parseXML(ak_tmpNode,getContextMenu()).firstChild,getContextMenu().firstChild)
}
//##############################################    
function ak_quickEdit(attribute,to_what)
{
if(!to_what) ak_rmAttribute(attribute)
else ak_setAttribute(attribute,to_what)
}
//##############################################    
function ak_quickEnter(attribute)
{
var ak_tmpIn=ak_getAttribute(attribute)
if(ak_tmpIn=="false") ak_tmpIn=""
ak_tmpIn=prompt('Enter '+attribute+':',ak_tmpIn)
if(!ak_tmpIn) ak_rmAttribute(attribute)
else ak_setAttribute(attribute,ak_tmpIn)
}
//##############################################    
function ak_getQuickMenu()
{
var ak_tmpAttribute=arguments[0]
var ak_tmpIn=ak_getAttribute(ak_tmpAttribute)
var ak_tmpNode='<menu><header>'+ak_tmpAttribute+'</header>'
for(var i=1;i<arguments.length;i++)
{
//if(ak_tmpIn==arguments[i]) ak_tmpNode+='<item checked="yes" onactivate="ak_quickEdit(\''+arguments[0]+'\',false)">'+arguments[i]+'</item>'
if(ak_tmpIn==arguments[i])  ak_tmpNode+='<item checked="yes" onactivate="ak_quickEdit(\''+arguments[0]+'\',\''+arguments[i]+'\')">'+arguments[i]+'</item>'
else ak_tmpNode+='<item onactivate="ak_quickEdit(\''+arguments[0]+'\',\''+arguments[i]+'\')">'+arguments[i]+'</item>'
}
ak_tmpNode+='<separator/>'
if(ak_tmpIn=="false") ak_tmpNode+='<item checked="yes">'+arguments[0]+' removed</item>'
else ak_tmpNode+='<item onactivate="ak_quickEdit(\''+arguments[0]+'\',false)">Remove '+arguments[0]+'</item>'
ak_tmpNode+='</menu>'
return ak_tmpNode
}
//##############################################    
function ak_sliderMenu(evt)
{
if(!ak_menuValid(evt,"slider")) return
var ak_tmpNode='<menu><header>Slider Menu</header>'
if(ak_object2update_nodeNr!=-1 && /^svg|^g|^a|^text|^tspan|^tref/.test(ak_object2update.tagName))
{ak_tmpNode+=ak_getQuickMenu('text-rendering',"auto","optimizeSpeed","optimizeLegibility","geometricPrecision")}
ak_tmpNode+=ak_getQuickMenu('shape-rendering',"auto","optimizeSpeed","crispEdges","geometricPrecision")
ak_tmpNode+=ak_getQuickMenu('stroke-linecap',"butt","round","square")
ak_tmpNode+=ak_getQuickMenu('stroke-linejoin',"miter","bevel","round")
ak_tmpNode+='<item onactivate="ak_quickEnter(\'stroke-miterlimit\')">Enter stroke-miterlimit</item>'
ak_tmpNode+='<item onactivate="ak_quickEnter(\'stroke-dasharray\')">Enter stroke-dasharray</item>'
ak_tmpNode+='<item onactivate="ak_quickEnter(\'stroke-dashoffset\')">Enter stroke-dashoffset</item>'
ak_tmpNode+='</menu>'
contextMenu().replaceChild(parseXML(ak_tmpNode,getContextMenu()).firstChild,getContextMenu().firstChild)
}
//################## ak_sett ############################
var ak_transform_cout="", ak_transform_split=" "
function ak_SetGetRm_transformValue(object_to_change,which_value,SetGetRm,no_cout)
{
if(!object_to_change) return "false"
if(ak_which_nodeNr(object_to_change)!=-1 && !/^(get)/.test(SetGetRm)) ak_MoveEditRect_flag_update=true
if(no_cout=="get_restmatrix" || no_cout=="get_matrix" ) var ak_tmp_return=ak_svgroot.createSVGMatrix()
else var ak_tmp_return="false"
switch(object_to_change.tagName)
{
case "textPath":
case "tspan":
case "tref":
ak_cout("Select parentNode - <text - in the ContextMenu!")
return ak_tmp_return
case "svg":
ak_transform_cout=ak_tagName_start+ak_getAttributeCout(ak_object2update,'viewBox','preserveAspectRatio')
if(!no_cout) ak_cout(ak_transform_cout)
return ak_tmp_return
}
ak_transform_cout=""
var ak_tmpCenter=false
if(which_value=="rotateCenter") {which_value="rotate("; ak_tmpCenter=true}
else which_value+="("
if(object_to_change.tagName()=="pattern") var ak_tmpTransform=object_to_change.getAttribute("patternTransform")
else var ak_tmpTransform=object_to_change.getAttribute("transform")
if ((SetGetRm=="get" || SetGetRm=="remove") && ak_tmpTransform=="" && !no_cout)
{
ak_transform_cout=ak_tagName_start
return "false"
}
ak_tmpTransform=ak_tmpTransform.replace(/^ *| *$/g,"") // spaces am Anfang und Ende raus
ak_tmpTransform=ak_tmpTransform.replace(/ +/g," ")
ak_tmpTransform=ak_tmpTransform.replace(/\)(,| )+/g,")")
ak_tmpTransform=ak_tmpTransform.replace(/\( +,/g,"(0,")
ak_tmpTransform=ak_tmpTransform.replace(/\( +/g,"(")
ak_tmpTransform=ak_tmpTransform.replace(/, *,/g,",0,")
ak_tmpTransform=ak_tmpTransform.replace(/, +\)/g,",0)")
ak_tmpTransform=ak_tmpTransform.replace(/ *, */g,",")
ak_tmpTransform=ak_tmpTransform.replace(/ /g,",")
var ak_tmpTransEntries=ak_tmpTransform.split(/\(|\)/)
var ak_tmpTransWhich=new Array
var ak_tmpTransValue=new Array
var ak_tmpRotateVector=new Array
for(var i=0;i<ak_tmpTransEntries.length;i++)
{
switch(ak_tmpTransEntries[i])
{
case "matrix":
ak_tmpTransWhich.push("matrix(")
i++
var ak_tmp_value=ak_tmpTransEntries[i].split(",")
ak_tmp_value[0]=isNaN(parseFloat(ak_tmp_value[0]))?0:parseFloat(ak_tmp_value[0])
ak_tmp_value[1]=isNaN(parseFloat(ak_tmp_value[1]))?0:parseFloat(ak_tmp_value[1])
ak_tmp_value[2]=isNaN(parseFloat(ak_tmp_value[2]))?0:parseFloat(ak_tmp_value[2])
ak_tmp_value[3]=isNaN(parseFloat(ak_tmp_value[3]))?0:parseFloat(ak_tmp_value[3])
ak_tmp_value[4]=isNaN(parseFloat(ak_tmp_value[4]))?0:parseFloat(ak_tmp_value[4])
ak_tmp_value[5]=isNaN(parseFloat(ak_tmp_value[5]))?0:parseFloat(ak_tmp_value[5])
ak_tmpTransValue.push(ak_tmp_value[0]+","+ak_tmp_value[1]+","+ak_tmp_value[2]+","+ak_tmp_value[3]+","+ak_tmp_value[4]+","+ak_tmp_value[5])
break
case "translate":
ak_tmpTransWhich.push("translate(")
i++
var ak_tmp_value=ak_tmpTransEntries[i].split(",")
ak_tmp_value[0]=isNaN(parseFloat(ak_tmp_value[0]))?0:parseFloat(ak_tmp_value[0])
ak_tmp_value[1]=isNaN(parseFloat(ak_tmp_value[1]))?0:parseFloat(ak_tmp_value[1])
ak_tmpTransValue.push(ak_tmp_value[0]+","+ak_tmp_value[1])
break
case "rotate":
ak_tmpTransWhich.push("rotate(")
i++
var ak_tmp_value
try{
ak_tmp_value=ak_tmpTransEntries[i].split(",")
if(ak_tmp_value[1])
{
ak_tmp_value[1]=isNaN(parseFloat(ak_tmp_value[1]))?0:parseFloat(ak_tmp_value[1])
ak_tmp_value[2]=isNaN(parseFloat(ak_tmp_value[2]))?0:parseFloat(ak_tmp_value[2])
ak_tmpRotateVector[ak_tmpTransValue.length]=ak_tmp_value[1]+","+ak_tmp_value[2]
}
else ak_tmpRotateVector[ak_tmpTransValue.length]=""
}catch(error){ak_tmpRotateVector[ak_tmpTransValue.length]=""}
ak_tmpTransValue.push(isNaN(parseFloat(ak_tmpTransEntries[i]))?0:parseFloat(ak_tmpTransEntries[i]))
break
case "skewX":
ak_tmpTransWhich.push("skewX(")
i++
ak_tmpTransValue.push(isNaN(parseFloat(ak_tmpTransEntries[i]))?0:parseFloat(ak_tmpTransEntries[i]))
break
case "skewY":
ak_tmpTransWhich.push("skewY(")
i++
ak_tmpTransValue.push(isNaN(parseFloat(ak_tmpTransEntries[i]))?0:parseFloat(ak_tmpTransEntries[i]))
break
case "scale":
ak_tmpTransWhich.push("scale(")
i++
var ak_tmp_value=ak_tmpTransEntries[i].split(",")
ak_tmp_value[0]=isNaN(parseFloat(ak_tmp_value[0]))?0:parseFloat(ak_tmp_value[0])
if(!isNaN(parseFloat(ak_tmp_value[1]))) ak_tmpTransValue.push(ak_tmp_value[0]+","+parseFloat(ak_tmp_value[1]))
else ak_tmpTransValue.push(ak_tmp_value[0])
break
}
}
var ak_tmp_value_return="false"
if (SetGetRm=="get")
{
for (var i=ak_tmpTransWhich.length-1;i>=0;i--)
{      
switch(which_value)
{
case "matrix(":
if(ak_tmpTransWhich[i]!=which_value) break
ak_tmp_value_return=ak_tmpTransValue[i]
break
case "rotate(":
if(ak_tmpTransWhich[i]!=which_value) break
if(ak_tmpCenter && ak_tmpRotateVector[i]) ak_tmp_value_return=ak_tmpRotateVector[i]
else if(ak_tmpCenter) ak_tmp_value_return="false"
else if(ak_tmpRotateVector[i]) ak_tmp_value_return=ak_tmpTransValue[i]+","+ak_tmpRotateVector[i]
else ak_tmp_value_return=ak_tmpTransValue[i]
break
case "skewX(":
if(ak_tmpTransWhich[i]!=which_value) break
ak_tmp_value_return=ak_tmpTransValue[i]
break
case "skewY(":
if(ak_tmpTransWhich[i]!=which_value) break
ak_tmp_value_return=ak_tmpTransValue[i]
break
case "translate(":
if(ak_tmpTransWhich[i]!=which_value) break
ak_tmp_value_return=ak_tmpTransValue[i]
break
case "scale(":
if(ak_tmpTransWhich[i]!=which_value) break
ak_tmp_value_return=ak_tmpTransValue[i]
break
case "scaleX(":
if(ak_tmpTransWhich[i]!="scale(") break
ak_tmp_value_return=parseFloat(ak_tmpTransValue[i])
break
case "scaleY(":
if(ak_tmpTransWhich[i]!="scale(") break
if(/,/.test(ak_tmpTransValue[i])) ak_tmp_value_return=parseFloat(ak_tmpTransValue[i].split(",")[1])
break
}
}
if(no_cout=='getValue' || no_cout=='setValue')
{
if(ak_tmp_value_return=='false')
{
switch(which_value)
{
case "translate(": ak_tmp_value_return='0,0'; break
case "rotate(":
var ak_tmp_x=0, ak_tmp_y=0
try{
ak_tmp_x=ak_object2update.getBBox.x+(ak_object2update.getBBox.width/2)
ak_tmp_y=ak_object2update.getBBox.y+(ak_object2update.getBBox.height/2)
}catch(error){ak_tmp_x=0; ak_tmp_y=0}
if(ak_tmp_x>1e37) ak_tmp_x=0
ak_tmp_x=ak_round(ak_tmp_x,ak_precision)
if(ak_tmp_y>1e37) ak_tmp_y=0
ak_tmp_y=ak_round(ak_tmp_y,ak_precision)
ak_tmp_value_return='0,'+ak_tmp_x+','+ak_tmp_y
break
case "scale(": ak_tmp_value_return='1,1'; break
case "skewX(": ak_tmp_value_return='0'; break
case "skewY(": ak_tmp_value_return='0'; break
case "matrix(": ak_tmp_value_return='1,0,0,1,0,0'; break
}
}
if(no_cout=='setValue') {SetGetRm=ak_tmp_value_return; ak_tmp_value_return='false'}
no_cout='no_cout'
}
}
if (SetGetRm=="remove")
{
for (var i=ak_tmpTransWhich.length-1;i>=0;i--)
{      
switch(which_value)
{
case "matrix(":
if(ak_tmpTransWhich[i]!=which_value) break
ak_tmp_value_return=ak_tmpTransValue[i]
ak_tmpTransValue.splice(i,1)
ak_tmpTransWhich.splice(i,1)
ak_tmpRotateVector.splice(i,1)
break
case "rotate(":
if(ak_tmpTransWhich[i]!=which_value) break
ak_tmp_value_return=ak_tmpTransValue[i]
ak_tmpTransValue.splice(i,1)
ak_tmpTransWhich.splice(i,1)
ak_tmpRotateVector.splice(i,1)
break
case "skewX(":
if(ak_tmpTransWhich[i]!=which_value) break
ak_tmp_value_return=ak_tmpTransValue[i]
ak_tmpTransValue.splice(i,1)
ak_tmpTransWhich.splice(i,1)
ak_tmpRotateVector.splice(i,1)
break
case "skewY(":
if(ak_tmpTransWhich[i]!=which_value) break
ak_tmp_value_return=ak_tmpTransValue[i]
ak_tmpTransValue.splice(i,1)
ak_tmpTransWhich.splice(i,1)
ak_tmpRotateVector.splice(i,1)
break
case "translate(":
if(ak_tmpTransWhich[i]!=which_value) break
ak_tmp_value_return=ak_tmpTransValue[i]
ak_tmpTransValue.splice(i,1)
ak_tmpTransWhich.splice(i,1)
ak_tmpRotateVector.splice(i,1)
break
case "scale(":
if(ak_tmpTransWhich[i]!=which_value) break
ak_tmp_value_return=ak_tmpTransValue[i]
ak_tmpTransValue.splice(i,1)
ak_tmpTransWhich.splice(i,1)
ak_tmpRotateVector.splice(i,1)
break
case "scaleX(": // wie bei scale( alles weg
if(ak_tmpTransWhich[i]!="scale(") break
ak_tmp_value_return=parseFloat(ak_tmpTransValue[i])
ak_tmpTransValue.splice(i,1)
ak_tmpTransWhich.splice(i,1)
ak_tmpRotateVector.splice(i,1)
break
case "scaleY(":
if(ak_tmpTransWhich[i]!="scale(") break
ak_tmp_value_return=parseFloat(ak_tmpTransValue[i].split(",")[1])
if(isNaN(ak_tmp_value_return)) ak_tmp_value_return="false"
ak_tmpTransValue[i]=parseFloat(ak_tmpTransValue[i])
break
}
}
}
if(SetGetRm=="[object SVGMatrix]")
{
var ak_tmp_prec=10000
SetGetRm=ak_round(SetGetRm.a,ak_tmp_prec)+","+ak_round(SetGetRm.b,ak_tmp_prec)+","+ak_round(SetGetRm.c,ak_tmp_prec)+","+ak_round(SetGetRm.d,ak_tmp_prec)+","+ak_round(SetGetRm.e,ak_tmp_prec)+","+ak_round(SetGetRm.f,ak_tmp_prec)
}
if (SetGetRm!="get" && SetGetRm!="remove")
{
for (var i=0;i<ak_tmpTransWhich.length;i++)
{      
switch(which_value)
{
case "matrix(":
if(ak_tmpTransWhich[i]!=which_value) break
ak_tmpTransValue[i]=SetGetRm
ak_tmp_value_return=SetGetRm
i=ak_tmpTransWhich.length
break
case "rotate(":
if(ak_tmpTransWhich[i]!=which_value) break
if(ak_tmpCenter && ak_tmpRotateVector[i])
{
try{
var ak_tmp_split=SetGetRm.split(',')
if(ak_tmp_split.length<3) ak_tmpRotateVector[i]=SetGetRm
else
{
ak_tmpTransValue[i]=ak_tmp_split[0]
ak_tmpRotateVector[i]=ak_tmp_split[1]+','+ak_tmp_split[2]
}
}
catch(error){ak_tmpRotateVector[i]=SetGetRm}
}
else
{
try{
var ak_tmp_split=SetGetRm.split(',')
if(ak_tmp_split.length<3) ak_tmpTransValue[i]=SetGetRm
else
{
ak_tmpTransValue[i]=ak_tmp_split[0]
ak_tmpRotateVector[i]=ak_tmp_split[1]+','+ak_tmp_split[2]
}
}
catch(error){ak_tmpTransValue[i]=SetGetRm}
}
ak_tmp_value_return=SetGetRm
i=ak_tmpTransWhich.length
break
case "skewX(":
if(ak_tmpTransWhich[i]!=which_value) break
ak_tmpTransValue[i]=SetGetRm
ak_tmp_value_return=SetGetRm
i=ak_tmpTransWhich.length
break
case "skewY(":
if(ak_tmpTransWhich[i]!=which_value) break
ak_tmpTransValue[i]=SetGetRm
ak_tmp_value_return=SetGetRm
i=ak_tmpTransWhich.length
break
case "translate(":
if(ak_tmpTransWhich[i]!=which_value) break
ak_tmpTransValue[i]=SetGetRm
ak_tmp_value_return=SetGetRm
i=ak_tmpTransWhich.length
break
case "scale(":
if(ak_tmpTransWhich[i]!=which_value) break
ak_tmpTransValue[i]=SetGetRm
ak_tmp_value_return=SetGetRm
i=ak_tmpTransWhich.length
break;
case "scaleX(":
if(ak_tmpTransWhich[i]!="scale(") break
if(/,/.test(ak_tmpTransValue[i])) ak_tmpTransValue[i]=SetGetRm+","+parseFloat(ak_tmpTransValue[i].split(",")[1])
else ak_tmpTransValue[i]=SetGetRm
ak_tmp_value_return=SetGetRm
i=ak_tmpTransWhich.length
break;
case "scaleY(":
if(ak_tmpTransWhich[i]!="scale(") break
ak_tmpTransValue[i]=parseFloat(ak_tmpTransValue[i])+","+SetGetRm
ak_tmp_value_return=SetGetRm
i=ak_tmpTransWhich.length
break
}
}
if(ak_tmp_value_return=="false")
{
if(which_value=="scaleX(") which_value="scale("
if(which_value=="scaleY(") {which_value="scale(";SetGetRm="1,"+SetGetRm}
if(ak_tmpCenter)
{
if(!/,/.test(SetGetRm)) SetGetRm='0,'+SetGetRm+',0'
else if(SetGetRm.split(',').length==2) SetGetRm='0,'+SetGetRm
}
ak_tmpTransWhich.push(which_value)
ak_tmpTransValue.push(SetGetRm)
ak_tmp_value_return=SetGetRm
}
}

var k=ak_transform_split
for (var i=0;i<ak_tmpTransWhich.length;i++)
{
if(ak_tmpTransWhich[i]+""!="undefined") ak_transform_cout+=ak_tmpTransWhich[i]
if(ak_tmpTransWhich[i]=="matrix(")
{
ak_transform_cout+=ak_tmpTransValue[i]+")"
}
if(ak_tmpTransWhich[i]=="rotate(")
{
if(ak_tmpRotateVector[i]) ak_transform_cout+=ak_tmpTransValue[i]+","+ak_tmpRotateVector[i]+")"
else ak_transform_cout+=ak_tmpTransValue[i]+")"
}
if(ak_tmpTransWhich[i]=="skewX(")
{
ak_transform_cout+=ak_tmpTransValue[i]+")"
}
if(ak_tmpTransWhich[i]=="skewY(")
{
ak_transform_cout+=ak_tmpTransValue[i]+")"
}
if(ak_tmpTransWhich[i]=="translate(")
{
ak_transform_cout+=ak_tmpTransValue[i]+")"
}
if(ak_tmpTransWhich[i]=="scale(")
{
ak_transform_cout+=ak_tmpTransValue[i]+")"
}
if(ak_tmpTransWhich[i]+""!="undefined") {if(i<ak_tmpTransWhich.length-1) {ak_transform_cout+=k;}}
}
if(SetGetRm!="get") // bei set und remove neues Attribute schreiben
{
if(object_to_change.tagName()=="pattern") object_to_change.setAttribute("patternTransform",ak_transform_cout)
else object_to_change.setAttribute("transform",ak_transform_cout)
if(ak_transform_cout=="") 
{
if(object_to_change.tagName()=="pattern") {try{object_to_change.removeAttribute("patternTransform")}catch(error){}}
else {try{object_to_change.removeAttribute("transform")}catch(error){}}
}
}
if(object_to_change.tagName()=="pattern")  ak_transform_cout=ak_tagName_start+' patternTransform="'+ak_transform_cout+'"'
else ak_transform_cout=ak_tagName_start+' transform="'+ak_transform_cout+'"'
if(!no_cout) ak_cout(ak_transform_cout)
if(no_cout=="get_restmatrix" || no_cout=="get_matrix")
{
ak_tmp_value_return=ak_svgroot.createSVGMatrix() // 1,0,0,1,0,0 matrix
var ak_tmp_matrix2
if (no_cout=="get_restmatrix")
{
for (var i=0;i<ak_tmpTransWhich.length;i++)
{
if(ak_tmpTransWhich[i]==which_value) break
}
}
else var i=-1 // wenn get_matrix dann komplettes transform attribute berechnen
for (i++;i<ak_tmpTransWhich.length;i++)
{
ak_tmp_matrix2=ak_svgroot.createSVGMatrix()
switch(ak_tmpTransWhich[i])
{
case "matrix(":
var ak_tmp_value=ak_tmpTransValue[i].split(",")
ak_tmp_matrix2.a=parseFloat(ak_tmp_value[0])
ak_tmp_matrix2.b=parseFloat(ak_tmp_value[1])
ak_tmp_matrix2.c=parseFloat(ak_tmp_value[2])
ak_tmp_matrix2.d=parseFloat(ak_tmp_value[3])
ak_tmp_matrix2.e=parseFloat(ak_tmp_value[4])
ak_tmp_matrix2.f=parseFloat(ak_tmp_value[5])
break
case "translate(":
ak_tmp_matrix2.e=parseFloat(ak_tmpTransValue[i])
var ak_tmpTransValue_tmp=parseFloat(ak_tmpTransValue[i].split(",")[1])
ak_tmp_matrix2.f=parseFloat(ak_tmpTransValue_tmp)
break
case "scale(":
if(/,/.test(ak_tmpTransValue[i])) var ak_tmpTransValue_tmp=parseFloat(ak_tmpTransValue[i].split(",")[1])
else  var ak_tmpTransValue_tmp=parseFloat(ak_tmpTransValue[i])
ak_tmp_matrix2=ak_tmp_matrix2.scaleNonUniform(parseFloat(ak_tmpTransValue[i]),ak_tmpTransValue_tmp)
break
case "rotate(":
if(ak_tmpRotateVector[i])
{
var ak_tmp_value=ak_tmpRotateVector[i].split(",")
ak_tmp_value[0]=isNaN(parseFloat(ak_tmp_value[0]))?0:parseFloat(ak_tmp_value[0])
ak_tmp_value[1]=isNaN(parseFloat(ak_tmp_value[1]))?0:parseFloat(ak_tmp_value[1])
ak_tmp_matrix2=ak_tmp_matrix2.translate(ak_tmp_value[0],ak_tmp_value[1])
ak_tmp_matrix2=ak_tmp_matrix2.rotate(parseFloat(ak_tmpTransValue[i]))
ak_tmp_matrix2=ak_tmp_matrix2.translate(-ak_tmp_value[0],-ak_tmp_value[1])
}
else ak_tmp_matrix2=ak_tmp_matrix2.rotate(parseFloat(ak_tmpTransValue[i]))
break
case "skewX(":
ak_tmp_matrix2=ak_tmp_matrix2.skewX(parseFloat(ak_tmpTransValue[i]))
break
case "skewY(":
ak_tmp_matrix2=ak_tmp_matrix2.skewY(parseFloat(ak_tmpTransValue[i]))
break
}
ak_tmp_value_return=ak_tmp_value_return.multiply(ak_tmp_matrix2)
}
}
return ak_tmp_value_return
}
//########### end ###################################

