diff --git a/editor/locale/lang.en.js b/editor/locale/lang.en.js index 92b31ec4..9d61a834 100644 --- a/editor/locale/lang.en.js +++ b/editor/locale/lang.en.js @@ -4,21 +4,21 @@ {"id":"layer_rename","title":"Rename Layer"}, {"id":"layer_up","title":"Move Layer Up"}, {"id":"layer_down","title":"Move Layer Down"}, -{"id":"tool_clear","title":"New Image [N]"}, -{"id":"tool_open","title":"Open Image [O]"}, -{"id":"tool_save","title":"Save Image [S]"}, -{"id":"tool_docprops","title":"Document Properties [I]"}, -{"id":"tool_source","title":"Edit Source [U]"}, -{"id":"tool_undo","title":"Undo [Z]"}, -{"id":"tool_redo","title":"Redo [Y]"}, -{"id":"tool_clone","title":"Clone Element [C]"}, -{"id":"tool_delete","title":"Delete Element [Delete/Backspace]"}, -{"id":"tool_move_top","title":"Move to Top [Shift+Up]"}, -{"id":"tool_move_bottom","title":"Move to Bottom [Shift+Down]"}, +{"id":"tool_clear","title":"New Image"}, +{"id":"tool_open","title":"Open Image"}, +{"id":"tool_save","title":"Save Image"}, +{"id":"tool_docprops","title":"Document Properties"}, +{"id":"tool_source","title":"Edit Source"}, +{"id":"tool_undo","title":"Undo"}, +{"id":"tool_redo","title":"Redo"}, +{"id":"tool_clone","title":"Clone Element"}, +{"id":"tool_delete","title":"Delete Element"}, +{"id":"tool_move_top","title":"Move to Top"}, +{"id":"tool_move_bottom","title":"Move to Bottom"}, {"id":"group_opacity","title":"Change selected item opacity"}, {"id":"angle","title":"Change rotation angle"}, -{"id":"tool_clone_multi","title":"Clone Elements [C]"}, -{"id":"tool_delete_multi","title":"Delete Selected Elements [Delete/Backspace]"}, +{"id":"tool_clone_multi","title":"Clone Elements"}, +{"id":"tool_delete_multi","title":"Delete Selected Elements"}, {"id":"tool_alignleft","title":"Align Left"}, {"id":"tool_aligncenter","title":"Align Center"}, {"id":"tool_alignright","title":"Align Right"}, @@ -26,8 +26,8 @@ {"id":"tool_alignmiddle","title":"Align Middle"}, {"id":"tool_alignbottom","title":"Align Bottom"}, {"id":"align_relative_to","title":"Align relative to ..."}, -{"id":"tool_group","title":"Group Elements [G]"}, -{"id":"tool_ungroup","title":"Ungroup Elements [G]"}, +{"id":"tool_group","title":"Group Elements"}, +{"id":"tool_ungroup","title":"Ungroup Elements"}, {"id":"rect_width","title":"Change rectangle width"}, {"id":"rect_height","title":"Change rectangle height"}, {"id":"rect_rx","title":"Change Rectangle Corner Radius"}, @@ -45,20 +45,20 @@ {"id":"line_y1","title":"Change line's starting y coordinate"}, {"id":"line_x2","title":"Change line's ending x coordinate"}, {"id":"line_y2","title":"Change line's ending y coordinate"}, -{"id":"tool_bold","title":"Bold Text [B]"}, -{"id":"tool_italic","title":"Italic Text [I]"}, +{"id":"tool_bold","title":"Bold Text"}, +{"id":"tool_italic","title":"Italic Text"}, {"id":"font_family","title":"Change Font Family"}, {"id":"font_size","title":"Change Font Size"}, {"id":"text","title":"Change text contents"}, -{"id":"tool_select","title":"Select Tool [1]"}, -{"id":"tool_fhpath","title":"Pencil Tool [2]"}, -{"id":"tool_line","title":"Line Tool [3]"}, -{"id":"tools_rect_show","title":"Square/Rect Tool [4/Shift+4]"}, -{"id":"tools_ellipse_show","title":"Ellipse/Circle Tool [5/Shift+5]"}, -{"id":"tool_text","title":"Text Tool [6]"}, -{"id":"tool_path","title":"Path Tool [7]"}, -{"id":"tool_image","title":"Image Tool [8]"}, -{"id":"tool_zoom","title":"Zoom Tool [Ctrl+Up/Down]"}, +{"id":"tool_select","title":"Select Tool"}, +{"id":"tool_fhpath","title":"Pencil Tool"}, +{"id":"tool_line","title":"Line Tool"}, +{"id":"tools_rect_show","title":"Square/Rect Tool"}, +{"id":"tools_ellipse_show","title":"Ellipse/Circle Tool"}, +{"id":"tool_text","title":"Text Tool"}, +{"id":"tool_path","title":"Path Tool"}, +{"id":"tool_image","title":"Image Tool"}, +{"id":"tool_zoom","title":"Zoom Tool"}, {"id":"zoom","title":"Change zoom level"}, {"id":"fill_color","title":"Change fill color"}, {"id":"stroke_color","title":"Change stroke color"}, @@ -82,8 +82,7 @@ {"id":"angleLabel","textContent":"angle:"}, {"id":"relativeToLabel","textContent":"relative to:"}, {"id":"zoomLabel","textContent":"zoom:"}, -{"id":"svginfo_change_background","textContent":"Canvas Background"}, -{"id":"layersLable","textContent":"Layers:"}, +{"id":"layersLabel","textContent":"Layers:"}, {"id":"selectedPredefined","textContent":"Select predefined:"}, {"id":"fitToContent","textContent":"Fit to Content"}, {"id":"tool_source_save","textContent":"Apply Changes"}, @@ -100,7 +99,6 @@ {"id":"page","textContent":"page"}, {"id":"fill_tool_bottom","textContent":"fill:"}, {"id":"stroke_tool_bottom","textContent":"stroke:"}, -{"id":"svginfo_dim","textContent":"Canvas Dimensions"}, {"id":"path_node_x","title":"Change node's x coordinate"}, {"id":"path_node_y","title":"Change node's y coordinate"}, {"id":"seg_type","title":"Change Segment type"}, @@ -110,8 +108,8 @@ {"id":"tool_node_delete","title":"Delete Node"}, {"id":"selLayerLabel","textContent":"Move elements to:"}, {"id":"selLayerNames","title":"Move selected elements to a different layer"}, -{"id":"sidepanel_handle","title":"Drag left/right to resize side panel [X]","textContent":"L a y e r s"}, -{"id":"tool_wireframe","title":"Wireframe Mode [F]"}, +{"id":"sidepanel_handle","title":"Drag left/right to resize side panel","textContent":"L a y e r s"}, +{"id":"tool_wireframe","title":"Wireframe Mode"}, {"id":"svginfo_image_props","textContent":"Image Properties"}, {"id":"svginfo_title","textContent":"Title"}, {"id":"svginfo_dim","textContent":"Canvas Dimensions"}, @@ -149,7 +147,11 @@ "ok":"OK", "cancel":"Cancel", "pathNodeTooltip":"Drag node to move it. Double-click node to change segment type", - "pathCtrlPtTooltip":"Drag control point to adjust curve properties" + "pathCtrlPtTooltip":"Drag control point to adjust curve properties", + "key_up":"up", + "key_down":"down", + "key_backspace":"backspace", + "key_del":"delete" } } ]; diff --git a/editor/locale/lang.fr.js b/editor/locale/lang.fr.js index 65ca560a..9e755873 100644 --- a/editor/locale/lang.fr.js +++ b/editor/locale/lang.fr.js @@ -4,21 +4,21 @@ {"id":"layer_rename","title":"Renommer le calque"}, {"id":"layer_up","title":"Monter le calque"}, {"id":"layer_down","title":"Descendre le calque"}, -{"id":"tool_clear","title":"Nouvelle image [N]"}, -{"id":"tool_open","title":"Ouvrir une image [O]"}, -{"id":"tool_save","title":"Enregistrer l'image [S]"}, -{"id":"tool_docprops","title":"Propriétés du document [I]"}, -{"id":"tool_source","title":"Modifier la source [U]"}, -{"id":"tool_undo","title":"Annuler l'action [Z]"}, -{"id":"tool_redo","title":"Refaire l'action [Y]"}, -{"id":"tool_clone","title":"Cloner l'élément [C]"}, -{"id":"tool_delete","title":"Supprimer l'élément [Suppr./Retour Arr.]"}, -{"id":"tool_move_top","title":"Déplacer vers le haut [Shift+Haut]"}, -{"id":"tool_move_bottom","title":"Déplacer vers le bas [Shift+Bas]"}, +{"id":"tool_clear","title":"Nouvelle image"}, +{"id":"tool_open","title":"Ouvrir une image"}, +{"id":"tool_save","title":"Enregistrer l'image"}, +{"id":"tool_docprops","title":"Propriétés du document"}, +{"id":"tool_source","title":"Modifier la source"}, +{"id":"tool_undo","title":"Annuler l'action"}, +{"id":"tool_redo","title":"Refaire l'action"}, +{"id":"tool_clone","title":"Cloner l'élément"}, +{"id":"tool_delete","title":"Supprimer l'élément"}, +{"id":"tool_move_top","title":"Déplacer vers le haut"}, +{"id":"tool_move_bottom","title":"Déplacer vers le bas"}, {"id":"group_opacity","title":"Changer l'opacité de l'élément"}, {"id":"angle","title":"Changer l'angle de rotation"}, -{"id":"tool_clone_multi","title":"Cloner les éléments [C]"}, -{"id":"tool_delete_multi","title":"Supprimer les éléments sélectionnés [Suppr./Retour Arr.]"}, +{"id":"tool_clone_multi","title":"Cloner les éléments"}, +{"id":"tool_delete_multi","title":"Supprimer les éléments sélectionnés"}, {"id":"tool_alignleft","title":"Aligner les côtés gauches"}, {"id":"tool_aligncenter","title":"Centrer verticalement"}, {"id":"tool_alignright","title":"Aligner les côtés droits"}, @@ -26,8 +26,8 @@ {"id":"tool_alignmiddle","title":"Centrer horizontalement"}, {"id":"tool_alignbottom","title":"Aligner le bas des objets"}, {"id":"align_relative_to","title":"Aligner par rapport à ..."}, -{"id":"tool_group","title":"Grouper les éléments [G]"}, -{"id":"tool_ungroup","title":"Dégrouper les éléments [G]"}, +{"id":"tool_group","title":"Grouper les éléments"}, +{"id":"tool_ungroup","title":"Dégrouper les éléments"}, {"id":"rect_width","title":"Changer la largeur du rectangle"}, {"id":"rect_height","title":"Changer la hauteur du rectangle"}, {"id":"rect_rx","title":"Changer le rayon des coins du rectangle"}, @@ -45,20 +45,20 @@ {"id":"line_y1","title":"Changer la position verticale y de début de la ligne"}, {"id":"line_x2","title":"Changer la position horizontale x de fin de la ligne"}, {"id":"line_y2","title":"Changer la position verticale y de fin de la ligne"}, -{"id":"tool_bold","title":"Texte en gras [B]"}, -{"id":"tool_italic","title":"Texte en italique [I]"}, +{"id":"tool_bold","title":"Texte en gras"}, +{"id":"tool_italic","title":"Texte en italique"}, {"id":"font_family","title":"Changer la famille de police"}, {"id":"font_size","title":"Taille de la police"}, {"id":"text","title":"Changer le contenu du texte"}, -{"id":"tool_select","title":"Outil de sélection [1]"}, -{"id":"tool_fhpath","title":"Crayon à main levée [2]"}, -{"id":"tool_line","title":"Tracer des lignes [3]"}, -{"id":"tools_rect_show","title":"Carré / Rectangle / Rectangle à main levée [4/Shift+4]"}, -{"id":"tools_ellipse_show","title":"Cercle / Ellipse / Ellipse à main levée [5/Shift+5]"}, -{"id":"tool_text","title":"Outil Texte [6]"}, -{"id":"tool_path","title":"Outil Chemin [7]"}, -{"id":"tool_image","title":"Outil Image [8]"}, -{"id":"tool_zoom","title":"Zoom [Ctrl+Haut/Bas]"}, +{"id":"tool_select","title":"Outil de sélection"}, +{"id":"tool_fhpath","title":"Crayon à main levée"}, +{"id":"tool_line","title":"Tracer des lignes"}, +{"id":"tools_rect_show","title":"Carré / Rectangle / Rectangle à main levée"}, +{"id":"tools_ellipse_show","title":"Cercle / Ellipse / Ellipse à main levée"}, +{"id":"tool_text","title":"Outil Texte"}, +{"id":"tool_path","title":"Outil Chemin"}, +{"id":"tool_image","title":"Outil Image"}, +{"id":"tool_zoom","title":"Zoom"}, {"id":"zoom","title":"Changer le niveau de zoom"}, {"id":"fill_color","title":"Changer la couleur de remplissage"}, {"id":"stroke_color","title":"Changer la couleur du contour"}, @@ -82,8 +82,7 @@ {"id":"angleLabel","textContent":"Angle:"}, {"id":"relativeToLabel","textContent":"Relativement à:"}, {"id":"zoomLabel","textContent":"Zoom:"}, -{"id":"svninfo_change_background","textContent":"Toile de fond"}, -{"id":"layersLable","textContent":"Calques :"}, +{"id":"layersLabel","textContent":"Calques :"}, {"id":"selectedPredefined","textContent":"Sélectionner prédéfinis:"}, {"id":"fitToContent","textContent":"Ajuster au contenu"}, {"id":"tool_source_save","textContent":"Appliquer Modifications"}, @@ -110,8 +109,8 @@ {"id":"tool_node_delete","title":"Supprimer le nœud"}, {"id":"selLayerLabel","textContent":"Déplacer éléments vers:"}, {"id":"selLayerNames","title":"Déplacer les éléments sélectionnés vers un autre calque"}, -{"id":"sidepanel_handle","title":"Tirer vers la gauche/droite pour redimensionner le panneau [X]","textContent":"C A L Q U E S"}, -{"id":"tool_wireframe","title":"Mode Fil de Fer [F]"}, +{"id":"sidepanel_handle","title":"Tirer vers la gauche/droite pour redimensionner le panneau","textContent":"C A L Q U E S"}, +{"id":"tool_wireframe","title":"Mode Fil de Fer"}, {"id":"svginfo_image_props","textContent":"Propriétés de l'Image"}, {"id":"svginfo_title","textContent":"Titre"}, {"id":"svginfo_dim","textContent":"Dimensions du canevas"}, @@ -149,7 +148,11 @@ "ok":"OK", "cancel":"Annuler", "pathNodeTooltip":"Glisser-déposer le nœud pour le déplacer. Double-cliquer le nœud pour changer de type de segment", - "pathCtrlPtTooltip":"Glisser-déposer le point de contrôle pour ajuster les propriétés de la courbe" + "pathCtrlPtTooltip":"Glisser-déposer le point de contrôle pour ajuster les propriétés de la courbe", + "key_up":"Haut", + "key_down":"Bas", + "key_backspace":"Suppr.", + "key_del":"Retour Arr." } } ] \ No newline at end of file diff --git a/editor/locale/lang.nl.js b/editor/locale/lang.nl.js index f7784d7d..db1d2569 100644 --- a/editor/locale/lang.nl.js +++ b/editor/locale/lang.nl.js @@ -1,110 +1,157 @@ [ {"id":"layer_new","title":"Nieuwe laag"}, -{"id":"layer_delete","title":"Wis laag"}, -{"id":"layer_rename","title":"Hernoem Laag"}, +{"id":"layer_delete","title":"Delete laag"}, +{"id":"layer_rename","title":"Hernoem laag"}, {"id":"layer_up","title":"Beweeg laag omhoog"}, {"id":"layer_down","title":"Beweeg laag omlaag"}, -{"id":"tool_clear","title":"Nieuwe afbeelding [N]"}, -{"id":"tool_open","title":"Open afbeelding [O]"}, -{"id":"tool_save","title":"Opslaan afbeelding [S]"}, -{"id":"tool_docprops","title":"Documenteigenschappen [I]"}, -{"id":"tool_source","title":"Bewerk Bron [U]"}, -{"id":"tool_undo","title":"Maak ongedaan [Z]"}, -{"id":"tool_redo","title":"Herdoe [Y]"}, -{"id":"tool_clone","title":"Kloon Element [C]"}, -{"id":"tool_delete","title":"Wis Element [Delete/Backspace]"}, -{"id":"tool_move_top","title":"Breng bovenop [Shift Up]"}, -{"id":"tool_move_bottom","title":"Breng onderop [Shift Down]"}, -{"id":"group_opacity","title":"Verander opaciteit geselecteerd item"}, -{"id":"angle","title":"draai"}, -{"id":"tool_clone_multi","title":"Kloon Elementen [C]"}, -{"id":"tool_delete_multi","title":"Wis geselecteerde Elementen [Delete/Backspace]"}, +{"id":"tool_clear","title":"Nieuwe afbeelding"}, +{"id":"tool_open","title":"Open afbeelding"}, +{"id":"tool_save","title":"Afbeelding opslaan"}, +{"id":"tool_docprops","title":"Documenteigenschappen"}, +{"id":"tool_source","title":"Bewerk bron"}, +{"id":"tool_undo","title":"Ongedaan maken"}, +{"id":"tool_redo","title":"Opnieuw doen"}, +{"id":"tool_clone","title":"Kloon element"}, +{"id":"tool_delete","title":"Delete element"}, +{"id":"tool_move_top","title":"Naar voorgrond"}, +{"id":"tool_move_bottom","title":"Naar achtergrond"}, +{"id":"group_opacity","title":"Verander opaciteit geselecteerde item"}, +{"id":"angle","title":"Draai"}, +{"id":"tool_clone_multi","title":"Kloon elementen"}, +{"id":"tool_delete_multi","title":"Delete geselecteerde elementen"}, {"id":"tool_alignleft","title":"Links uitlijnen"}, {"id":"tool_aligncenter","title":"Centreren"}, {"id":"tool_alignright","title":"Rechts uitlijnen"}, {"id":"tool_aligntop","title":"Boven uitlijnen"}, {"id":"tool_alignmiddle","title":"Midden uitlijnen"}, -{"id":"tool_alignbottom","title":"Onder Uitlijnen"}, -{"id":"align_relative_to","title":"Uitlijnen ten opzichte van ..."}, -{"id":"tool_group","title":"Groepeer Elementen [G]"}, -{"id":"tool_ungroup","title":"Opheffen groepering [G]"}, -{"id":"rect_x","title":"Wijzig X-coördinaat rechthoek"}, -{"id":"rect_y","title":"Wijzig Y-coördinaat rechthoek"}, -{"id":"rect_width","title":"Wijzig breedte rechthoek"}, -{"id":"rect_height","title":"Wijzig hoogte rechthoek"}, -{"id":"rect_rx","title":"Wijzig straal hoek rechthoek"}, -{"id":"afbeelding_x","title":"Wijzig X-coördinaat"}, -{"id":"afbeelding_y","title":"Verander beeld Y-coördinaat"}, -{"id":"afbeelding_width","title":"Wijzig breedte afbeelding"}, -{"id":"afbeelding_height","title":"Wijzig hoogte afbeelding"}, -{"id":"afbeelding_url","title":"URL wijzigen"}, -{"id":"circle_cx","title":"Wijzig cx-coördinaat cirkel"}, -{"id":"circle_cy","title":"Wijzig cy-coördinaat cirkel"}, -{"id":"circle_r","title":"Wijzig straal cirkel"}, -{"id":"ellipse_cx","title":"Wijzig cx-coördinaat ellips"}, -{"id":"ellipse_cy","title":"Wijzig cy-coördinaat ellips"}, -{"id":"ellipse_rx","title":"Wijzig x-straal ellips"}, -{"id":"ellipse_ry","title":"Wijzig y-straal ellips"}, -{"id":"line_x1","title":"Wijzig startend x-coördinaat lijn"}, -{"id":"line_y1","title":"Wijzig startend y-coördinaat lijn"}, -{"id":"line_x2","title":"Wijzig stoppend x-coördinaat lijn"}, -{"id":"line_y2","title":"Wijzig stoppend y-coördinaat lijn"}, -{"id":"text_x","title":"Wijzig x-coördinaat tekst"}, -{"id":"text_y","title":"Wijzig y-coördinaat tekst"}, -{"id":"tool_bold","title":"Vette tekst [B]"}, -{"id":"tool_italic","title":"Cursieve tekst [I]"}, -{"id":"font_family","title":"Wijzig lettertype familie"}, -{"id":"font_size","title":"Wijzig font groote"}, -{"id":"text","title":"Wijzig tekst inhoud"}, -{"id":"tool_select","title":"Selecteer [1]"}, -{"id":"tool_path","title":"Potlood [2]"}, -{"id":"tool_line","title":"Lijn [3]"}, -{"id":"tools_rect_show","title":"Vierkant / Rechthoek [4/Shift 4]"}, -{"id":"tools_ellipse_show","title":"Ellips / Cirkel [5/Shift 5]"}, -{"id":"tool_text","title":"Tekst [6]"}, -{"id":"tool_poly","title":"Poly... [7]"}, -{"id":"tool_afbeelding","title":"afbeelding [8]"}, -{"id":"tool_zoom","title":"Zoom [Ctrl Up/Down]"}, -{"id":"zoom","title":"Zoomniveau wijzigen"}, -{"id":"fill_color","title":"Verander vulkleur"}, -{"id":"stroke_color","title":"Verander lijnkleur"}, -{"id":"stroke_width","title":"Wijzig lijndikte"}, -{"id":"stroke_style","title":"Wijzig lijn stippel stijl"}, -{"id":"palette","title":"Klik om vulkleur te wijzigen, shift-klik om lijnkleur te wijzigen"}, +{"id":"tool_alignbottom","title":"Onder uitlijnen"}, +{"id":"align_relative_to","title":"Uitlijnen relatief ten opzichte van ..."}, +{"id":"tool_group","title":"Groepeer elementen"}, +{"id":"tool_ungroup","title":"Groepering opheffen"}, +{"id":"rect_width","title":"Verander breedte rechthoek"}, +{"id":"rect_height","title":"Verander hoogte rechthoek"}, +{"id":"rect_rx","title":"Verander hoek radius rechthoek"}, +{"id":"image_width","title":"Verander breedte afbeelding"}, +{"id":"image_height","title":"Verander hoogte afbeelding"}, +{"id":"image_url","title":"Verander URL"}, +{"id":"circle_cx" ,"title":"Verander het X coordinaat van het cirkel centrum"}, +{"id":"circle_cy" ,"title":"Verander het Y coordinaat van het cirkel centrum"}, +{"id":"circle_r","title":"Verander de cirkel radius"}, +{"id":"ellipse_cx","title":"Verander het X coordinaat van het ellips centrum"}, +{"id":"ellipse_cy","title":"Verander het Y coordinaat van het ellips centrum"}, +{"id":"ellipse_rx","title":"Verander ellips X radius"}, +{"id":"ellipse_ry","title":"Verander ellips Y radius"}, +{"id":"line_x1","title":"Verander regel start X coordinaat"}, +{"id":"line_y1","title":"Verander regel start Y coordinaat"}, +{"id":"line_x2","title":"Verander regel eind X coordinaat"}, +{"id":"line_y2","title":"Verander regel eind Y coordinaat"}, +{"id":"tool_bold","title":"Vet"}, +{"id":"tool_italic","title":"Cursief"}, +{"id":"font_family","title":"Verander lettertype"}, +{"id":"font_size","title":"Verander lettertype grootte"}, +{"id":"text","title":"Wijzig tekst"}, +{"id":"tool_select","title":"Selecteer"}, +{"id":"tool_fhpath","title":"Potlood"}, +{"id":"tool_line","title":"Lijn"}, +{"id":"tools_rect_show","title":"Vierkant/rechthoek"}, +{"id":"tools_ellipse_show","title":"Ellips/cirkel"}, +{"id":"tool_text","title":"Tekst"}, +{"id":"tool_path","title":"Polygoon"}, +{"id":"tool_image","title":"Afbeelding"}, +{"id":"tool_zoom","title":"Zoom"}, +{"id":"zoom","title":"In-/uitzoomen"}, +{"id":"fill_color","title":"Verander vul kleur"}, +{"id":"stroke_color","title":"Verander lijn kleur"}, +{"id":"stroke_width","title":"Verander lijn breedte"}, +{"id":"stroke_style","title":"Verander lijn stijl"}, +{"id":"palette","title":"Klik om de vul kleur te veranderen, shift-klik om de lijn kleur te veranderen"}, {"id":"tool_square","title":"Vierkant"}, {"id":"tool_rect","title":"Rechthoek"}, -{"id":"tool_fhrect","title":"Losse-Hand Rechthoek"}, +{"id":"tool_fhrect","title":"Vrije stijl rechthoek"}, {"id":"tool_circle","title":"Cirkel"}, {"id":"tool_ellipse","title":"Ellips"}, -{"id":"tool_fhellipse","title":"Losse-Hand Ellips"}, -{"id":"bkgnd_color","title":"Wijzig achtergrondkleur / opaciteit"}, -{"id":"rwidthLabel","textContent":"breedte:"}, -{"id":"rheightLabel","textContent":"hoogte:"}, -{"id":"cornerStraalLabel","textContent":"straal hoek:"}, -{"id":"iwidthLabel","textContent":"breedte:"}, -{"id":"iheightLabel","textContent":"hoogte:"}, -{"id":"svginfo_width","textContent":"Breedte:"}, -{"id":"svginfo_height","textContent":"Hoogte:"}, -{"id":"angleLabel","textContent":"hoek:"}, -{"id":"relativeToLabel","textContent":"ten opzichte van:"}, -{"id":"zoomLabel","textContent":"zoom:"}, -{"id":"svninfo_wijzig_background","textContent":"Doek achtergrond"}, -{"id":"layersLable","textContent":"Lagen:"}, +{"id":"tool_fhellipse","title":"Vrije stijl ellips"}, +{"id":"bkgnd_color","title":"Verander achtergrond kleur/doorzichtigheid"}, +{"id":"rwidthLabel","textContent":"Breedte:"}, +{"id":"rheightLabel","textContent":"Hoogte:"}, +{"id":"cornerRadiusLabel","textContent":"Hoek radius:"}, +{"id":"iwidthLabel","textContent":"Breedte:"}, +{"id":"iheightLabel","textContent":"Hoogte:"}, +{"id":"svginfo_width","textContent":"Breedte:" }, +{"id":"svginfo_height","textContent":"Hoogte:" }, +{"id":"angleLabel","textContent":"Hoek:"}, +{"id":"relativeToLabel","textContent":"Relatief ten opzichte van:"}, +{"id":"zoomLabel","textContent":"Zoom:"}, +{"id":"layersLabel","textContent":"Lagen:"}, {"id":"selectedPredefined","textContent":"Kies voorgedefinieerd:"}, {"id":"fitToContent","textContent":"Pas om inhoud"}, -{"id":"tool_source_save","textContent":"Opslaan"}, -{"id":"tool_docprops_save","textContent":"Opslaan"}, +{"id":"tool_source_save","textContent":"Veranderingen toepassen"}, +{"id":"tool_docprops_save","textContent":"OK"}, {"id":"tool_docprops_cancel","textContent":"Annuleren"}, {"id":"tool_source_cancel","textContent":"Annuleren"}, {"id":"fit_to_all","textContent":"Pas om alle inhoud"}, -{"id":"fit_to_layer_content","textContent":"Aanpassen aan laag gehalte"}, +{"id":"fit_to_layer_content" ,"textContent":"Pas om laag inhoud"}, {"id":"fit_to_sel","textContent":"Pas om selectie"}, -{"id":"fit_to_canvas","textContent":"Pas om doek"}, -{"id":"selected_objects","textContent":"gekozen objecten"}, -{"id":"largest_object","textContent":"grootste object"}, -{"id":"smallest_object","textContent":"kleinste object"}, -{"id":"page","textContent":"pagina"}, -{"id":"fill_tool_bottom","textContent":"vullen:"}, +{"id":"fit_to_canvas","textContent":"Pas om canvas"}, +{"id":"selected_objects","textContent":"Geselecteerde objecten"}, +{"id":"largest_object","textContent":"Grootste object"}, +{"id":"smallest_object","textContent":"Kleinste object"}, +{"id":"page","textContent":"Pagina"}, +{"id":"fill_tool_bottom","textContent":"Vull:"}, {"id":"stroke_tool_bottom","textContent":"(om)lijn(ing):"}, -{"id":"svninfo_dim","textContent":"Canvas Afmetingen"} -] +{"id":"path_node_x","title":"Verander X coordinaat knooppunt"}, +{"id":"path_node_y","title":"Verander Y coordinaat knooppunt"}, +{"id":"seg_type","title":"Verander segment type"}, +{"id":"straight_segments","textContent":"Recht"}, +{"id":"curve_segments","textContent":"Gebogen"}, +{"id":"tool_node_clone","title":"Kloon knooppunt"}, +{"id":"tool_node_delete","title":"Delete knooppunt"}, +{"id":"selLayerLabel","textContent":"Verplaats elementen naar:"}, +{"id":"selLayerNames","title":"Verplaats geselecteerde elementen naar andere laag"}, +{"id":"sidepanel_handle","title":"Sleep naar links/rechts om het zijpaneel te vergroten/verkleinen","textContent":"L a g e n"}, +{"id":"tool_wireframe","title":"'Wireframe' mode"}, +{"id":"svginfo_image_props","textContent":"Afbeeldingeigenschappen"}, +{"id":"svginfo_title","textContent":"Titel"}, +{"id":"svginfo_dim","textContent":"Canvas afmetingen"}, +{"id":"includedImages","textContent":"Ingesloten afbeeldingen"}, +{"id":"image_opt_embed","textContent":"Toevoegen data (lokale bestanden)"}, +{"id":"image_opt_ref","textContent":"Gebruik bestand referentie"}, +{"id":"svginfo_editor_prefs","textContent":"Editor eigenschappen"}, +{"id":"svginfo_lang","textContent":"Taal"}, +{"id":"svginfo_change_background","textContent":"Editor achtergrond"}, +{"id":"svginfo_bg_note","textContent":"Let op: De achtergrond wordt niet opgeslagen met de afbeelding."}, +{"id":"svginfo_icons","textContent":"Icoon grootte"}, +{"id":"icon_small","textContent":"Klein"}, +{"id":"icon_medium","textContent":"Gemiddeld"}, +{"id":"icon_large","textContent":"Groot"}, +{"id":"icon_xlarge","textContent":"Extra groot"}, +{"id":"selected_x","title":"Verander X coordinaat"}, +{"id":"selected_y","title":"Verander Y coordinaat"}, +{"id":"tool_topath","title":"Zet om naar lijnen"}, +{"id":"tool_reorient","title":"Zet object weer recht"}, +{"id":"tool_node_link","title":"Koppel controlle punten"}, +{"js_strings": { + "invalidAttrValGiven":"Verkeerde waarde gegeven", + "noContentToFitTo":"Geen inhoud om omheen te passen", + 'layer':"Laag", + "dupeLayerName":"Er is al een laag met die naam!", + "enterUniqueLayerName":"Geef een unieke laag naam", + "enterNewLayerName":"Geef een nieuwe laag naam", + "layerHasThatName":"Laag heeft al die naam", + "QmoveElemsToLayer":"Verplaats geselecteerde elementen naar laag '%s'?", + "QwantToClear":"Wil je de afbeelding leeg maken?\nDit zal ook de ongedaan maak geschiedenis wissen!", + "QerrorsRevertToSource":"Er waren analyse fouten in je SVG bron.\nTeruggaan naar de originele SVG bron?", + "QignoreSourceChanges":"Veranderingen in de SVG bron negeren?", + "featNotSupported":"Functie wordt niet ondersteund", + "enterNewImgURL":"Geef de nieuwe afbeelding URL", + "ok":"OK", + "cancel":"Annuleren", + "pathNodeTooltip":"Versleep knooppunt om hem te verslepen. Dubbel klik knooppunt om het segment type te veranderen", + "pathCtrlPtTooltip":"Versleep het controlle punt om de boog eigenschappen te veranderen", + "key_up":"up", + "key_down":"down", + "key_backspace":"backspace", + "key_del":"delete" + } +} +]; diff --git a/editor/svg-editor.html b/editor/svg-editor.html index 97ab9dbe..d1cc6c0f 100644 --- a/editor/svg-editor.html +++ b/editor/svg-editor.html @@ -51,7 +51,7 @@ script type="text/javascript" src="locale/locale.min.js">
-

Layers

+

Layers

diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 9825ef20..bf18b7fb 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -26,7 +26,11 @@ function svg_edit_setup() { 'featNotSupported':'Feature not supported', 'enterNewImgURL':'Enter the new image URL', 'ok':'OK', - 'cancel':'Cancel' + 'cancel':'Cancel', + 'key_up':'Up', + 'key_down':'Down', + 'key_backspace':'Backspace', + 'key_del':'Del' }; var palette = ["#000000","#202020","#404040","#606060","#808080","#a0a0a0","#c0c0c0","#e0e0e0","#ffffff","#800000","#ff0000","#808000","#ffff00","#008000","#00ff00","#008080","#00ffff","#000080","#0000ff","#800080","#ff00ff","#2b0000","#550000","#800000","#aa0000","#d40000","#ff0000","#ff2a2a","#ff5555","#ff8080","#ffaaaa","#ffd5d5","#280b0b","#501616","#782121","#a02c2c","#c83737","#d35f5f","#de8787","#e9afaf","#f4d7d7","#241c1c","#483737","#6c5353","#916f6f","#ac9393","#c8b7b7","#e3dbdb","#2b1100","#552200","#803300","#aa4400","#d45500","#ff6600","#ff7f2a","#ff9955","#ffb380","#ffccaa","#ffe6d5","#28170b","#502d16","#784421","#a05a2c","#c87137","#d38d5f","#deaa87","#e9c6af","#f4e3d7","#241f1c","#483e37","#6c5d53","#917c6f","#ac9d93","#c8beb7","#e3dedb","#2b2200","#554400","#806600","#aa8800","#d4aa00","#ffcc00","#ffd42a","#ffdd55","#ffe680","#ffeeaa","#fff6d5","#28220b","#504416","#786721","#a0892c","#c8ab37","#d3bc5f","#decd87","#e9ddaf","#f4eed7","#24221c","#484537","#6c6753","#918a6f","#aca793","#c8c4b7","#e3e2db","#222b00","#445500","#668000","#88aa00","#aad400","#ccff00","#d4ff2a","#ddff55","#e5ff80","#eeffaa","#f6ffd5","#22280b","#445016","#677821","#89a02c","#abc837","#bcd35f","#cdde87","#dde9af","#eef4d7","#22241c","#454837","#676c53","#8a916f","#a7ac93","#c4c8b7","#e2e3db","#112b00","#225500","#338000","#44aa00","#55d400","#66ff00","#7fff2a","#99ff55","#b3ff80","#ccffaa","#e5ffd5","#17280b","#2d5016","#447821","#5aa02c","#71c837","#8dd35f","#aade87","#c6e9af","#e3f4d7","#1f241c","#3e4837","#5d6c53","#7c916f","#9dac93","#bec8b7","#dee3db","#002b00","#005500","#008000","#00aa00","#00d400","#00ff00","#2aff2a","#55ff55","#80ff80","#aaffaa","#d5ffd5","#0b280b","#165016","#217821","#2ca02c","#37c837","#5fd35f","#87de87","#afe9af","#d7f4d7","#1c241c","#374837","#536c53","#6f916f","#93ac93","#b7c8b7","#dbe3db","#002b11","#005522","#008033","#00aa44","#00d455","#00ff66","#2aff80","#55ff99","#80ffb3","#aaffcc","#d5ffe6","#0b2817","#16502d","#217844","#2ca05a","#37c871","#5fd38d","#87deaa","#afe9c6","#d7f4e3","#1c241f","#37483e","#536c5d","#6f917c","#93ac9d","#b7c8be","#dbe3de","#002b22","#005544","#008066","#00aa88","#00d4aa","#00ffcc","#2affd5","#55ffdd","#80ffe6","#aaffee","#d5fff6","#0b2822","#165044","#217867","#2ca089","#37c8ab","#5fd3bc","#87decd","#afe9dd","#d7f4ee","#1c2422","#374845","#536c67","#6f918a","#93aca7","#b7c8c4","#dbe3e2","#00222b","#004455","#006680","#0088aa","#00aad4","#00ccff","#2ad4ff","#55ddff","#80e5ff","#aaeeff","#d5f6ff","#0b2228","#164450","#216778","#2c89a0","#37abc8","#5fbcd3","#87cdde","#afdde9","#d7eef4","#1c2224","#374548","#53676c","#6f8a91","#93a7ac","#b7c4c8","#dbe2e3","#00112b","#002255","#003380","#0044aa","#0055d4","#0066ff","#2a7fff","#5599ff","#80b3ff","#aaccff","#d5e5ff","#0b1728","#162d50","#214478","#2c5aa0","#3771c8","#5f8dd3","#87aade","#afc6e9","#d7e3f4","#1c1f24","#373e48","#535d6c","#6f7c91","#939dac","#b7bec8","#dbdee3","#00002b","#000055","#000080","#0000aa","#0000d4","#0000ff","#2a2aff","#5555ff","#8080ff","#aaaaff","#d5d5ff","#0b0b28","#161650","#212178","#2c2ca0","#3737c8","#5f5fd3","#8787de","#afafe9","#d7d7f4","#1c1c24","#373748","#53536c","#6f6f91","#9393ac","#b7b7c8","#dbdbe3","#11002b","#220055","#330080","#4400aa","#5500d4","#6600ff","#7f2aff","#9955ff","#b380ff","#ccaaff","#e5d5ff","#170b28","#2d1650","#442178","#5a2ca0","#7137c8","#8d5fd3","#aa87de","#c6afe9","#e3d7f4","#1f1c24","#3e3748","#5d536c","#7c6f91","#9d93ac","#beb7c8","#dedbe3","#22002b","#440055","#660080","#8800aa","#aa00d4","#cc00ff","#d42aff","#dd55ff","#e580ff","#eeaaff","#f6d5ff","#220b28","#441650","#672178","#892ca0","#ab37c8","#bc5fd3","#cd87de","#ddafe9","#eed7f4","#221c24","#453748","#67536c","#8a6f91","#a793ac","#c4b7c8","#e2dbe3","#2b0022","#550044","#800066","#aa0088","#d400aa","#ff00cc","#ff2ad4","#ff55dd","#ff80e5","#ffaaee","#ffd5f6","#280b22","#501644","#782167","#a02c89","#c837ab","#d35fbc","#de87cd","#e9afdd","#f4d7ee","#241c22","#483745","#6c5367","#916f8a","#ac93a7","#c8b7c4","#e3dbe2","#2b0011","#550022","#800033","#aa0044","#d40055","#ff0066","#ff2a7f","#ff5599","#ff80b2","#ffaacc","#ffd5e5","#280b17","#50162d","#782144","#a02c5a","#c83771","#d35f8d","#de87aa","#e9afc6","#f4d7e3","#241c1f","#48373e","#6c535d","#916f7c","#ac939d","#c8b7be","#e3dbde"] @@ -1374,51 +1378,6 @@ function svg_edit_setup() { if (!editingsource) return; properlySourceSizeTextArea(); }); - - $('#tool_select').click(clickSelect); - $('#tool_fhpath').click(clickFHPath); - $('#tool_line').click(clickLine); - $('#tool_square').mouseup(clickSquare); - $('#tool_rect').mouseup(clickRect); - $('#tool_fhrect').mouseup(clickFHRect); - $('#tool_circle').mouseup(clickCircle); - $('#tool_ellipse').mouseup(clickEllipse); - $('#tool_fhellipse').mouseup(clickFHEllipse); - $('#tool_image').mouseup(clickImage); - $('#tool_zoom').mouseup(clickZoom); - $('#tool_zoom').dblclick(dblclickZoom); - $('#tool_text').click(clickText); - $('#tool_path').click(clickPath); - $('#tool_clear').click(clickClear); - $('#tool_save').click(clickSave); - $('#tool_open').click(clickOpen); - $('#tool_source').click(showSourceEditor); - $('#tool_wireframe').click(clickWireframe); - $('#tool_source_cancel,#svg_source_overlay,#tool_docprops_cancel').click(cancelOverlays); - $('#tool_source_save').click(saveSourceEditor); - $('#tool_docprops_save').click(saveDocProperties); - $('#tool_docprops').click(showDocProperties); - $('#tool_delete').click(deleteSelected); - $('#tool_delete_multi').click(deleteSelected); - $('#tool_reorient').click(reorientPath); - $('#tool_node_link').click(linkControlPoints); - $('#tool_node_clone').click(clonePathNode); - $('#tool_node_delete').click(deletePathNode); - $('#tool_move_top').click(moveToTopSelected); - $('#tool_move_bottom').click(moveToBottomSelected); - $('#tool_topath').click(convertToPath); - $('#tool_undo').click(clickUndo); - $('#tool_redo').click(clickRedo); - $('#tool_clone').click(clickClone); - $('#tool_clone_multi').click(clickClone); - $('#tool_group').click(clickGroup); - $('#tool_ungroup').click(clickGroup); - $('[id^=tool_align]').click(clickAlign); - // these two lines are required to make Opera work properly with the flyout mechanism - $('#tools_rect_show').click(clickRect); - $('#tools_ellipse_show').click(clickEllipse); - $('#tool_bold').mousedown(clickBold); - $('#tool_italic').mousedown(clickItalic); $('#url_notice').click(function() { $.alert(this.title); @@ -1530,59 +1489,6 @@ function svg_edit_setup() { } } - // do keybindings using jquery-hotkeys plugin - function setKeyBindings() { - var keys = [ - ['1', clickSelect], - ['2', clickFHPath], - ['3', clickLine], - ['Shift+4', clickSquare], - ['4', clickRect], - ['Shift+5', clickCircle], - ['5', clickEllipse], - ['6', clickPath], - ['7', clickText], - ['8', clickImage], - [modKey+'N', function(evt){clickClear();evt.preventDefault();}], - [modKey+'S', function(evt){editingsource?saveSourceEditor():clickSave();evt.preventDefault();}], - [modKey+'O', function(evt){clickOpen();evt.preventDefault();}], - ['del', function(evt){deleteSelected();evt.preventDefault();}], - ['backspace', function(evt){deleteSelected();evt.preventDefault();}], - ['shift+up', moveToTopSelected], - ['shift+down', moveToBottomSelected], - ['shift+left', function(){rotateSelected(0)}], - ['shift+right', function(){rotateSelected(1)}], - ['shift+O', selectPrev], - ['shift+P', selectNext], - ['ctrl+up', function(evt){zoomImage(2);evt.preventDefault();}], - ['ctrl+down', function(evt){zoomImage(.5);evt.preventDefault();}], - ['up', function(evt){moveSelected(0,-1);evt.preventDefault();}], - ['down', function(evt){moveSelected(0,1);evt.preventDefault();}], - ['left', function(evt){moveSelected(-1,0);evt.preventDefault();}], - ['right', function(evt){moveSelected(1,0);evt.preventDefault();}], - [modKey+'z', function(evt){clickUndo();evt.preventDefault();}], - [modKey+'y', function(evt){clickRedo();evt.preventDefault();}], - [modKey+'u', function(evt){showSourceEditor();evt.preventDefault();}], - [modKey+'i', function(evt){showDocProperties();evt.preventDefault();}], - [modKey+'c', function(evt){clickClone();evt.preventDefault();}], - [modKey+'g', function(evt){clickGroup();evt.preventDefault();}], - [modKey+'f', function(evt){clickWireframe();evt.preventDefault();}], - [modKey+'x', function(evt){toggleSidePanel();}], - ['esc', cancelOverlays, false], - ]; - - $.each(keys,function(i,item) { - var disable = !(item.length > 2 && !item[2]); - $(document).bind('keydown', {combi:item[0], disableInInput: disable}, item[1]); - }); - - $('.attr_changer, #image_url').bind('keydown', {combi:'return', disableInInput: false}, - function(evt) {$(this).change();evt.preventDefault();} - ); - } - - setKeyBindings(); - // TODO: go back to the color boxes having white background-color and then setting // background-image to none.png (otherwise partially transparent gradients look weird) var colorPicker = function(elem) { @@ -2101,6 +2007,141 @@ function svg_edit_setup() { //Prevent browser from erroneously repopulating fields $('input,select').attr("autocomplete","off"); + + // Associate all button actions as well as non-button keyboard shortcuts + var Actions = function() { + // sel:'selector', fn:function, evt:'event', key:[key, preventDefault, NoDisableInInput] + var tool_buttons = [ + {sel:'#tool_select', fn: clickSelect, evt: 'click', key: 1}, + {sel:'#tool_fhpath', fn: clickFHPath, evt: 'click', key: 2}, + {sel:'#tool_line', fn: clickLine, evt: 'click', key: 3}, + {sel:'#tool_square', fn: clickSquare, evt: 'mouseup', key: 'Shift+4'}, + {sel:'#tool_rect', fn: clickRect, evt: 'mouseup', key: 4}, + {sel:'#tool_fhrect', fn: clickFHRect, evt: 'mouseup'}, + {sel:'#tool_circle', fn: clickCircle, evt: 'mouseup', key: 'Shift+5'}, + {sel:'#tool_ellipse', fn: clickEllipse, evt: 'mouseup', key: 5}, + {sel:'#tool_fhellipse', fn: clickFHEllipse, evt: 'mouseup'}, + {sel:'#tool_path', fn: clickPath, evt: 'click', key: 6}, + {sel:'#tool_text', fn: clickText, evt: 'click', key: 7}, + {sel:'#tool_image', fn: clickImage, evt: 'mouseup', key: 8}, + {sel:'#tool_zoom', fn: clickZoom, evt: 'mouseup', dblclick: dblclickZoom, key: 9}, + {sel:'#tool_clear', fn: clickClear, evt: 'click', key: [modKey+'N', true]}, + {sel:'#tool_save', fn: function() { editingsource?saveSourceEditor():clickSave()}, evt: 'click', key: [modKey+'S', true]}, + {sel:'#tool_open', fn: clickOpen, evt: 'click', key: [modKey+'O', true]}, + {sel:'#tool_source', fn: showSourceEditor, evt: 'click', key: ['U', true]}, + {sel:'#tool_wireframe', fn: clickWireframe, evt: 'click', key: ['F', true]}, + {sel:'#tool_source_cancel,#svg_source_overlay,#tool_docprops_cancel', fn: cancelOverlays, evt: 'click', key: ['esc', false, true]}, + {sel:'#tool_source_save', fn: saveSourceEditor, evt: 'click'}, + {sel:'#tool_docprops_save', fn: saveDocProperties, evt: 'click'}, + {sel:'#tool_docprops', fn: showDocProperties, evt: 'click', key: [modKey+'I', true]}, + {sel:'#tool_delete', fn: deleteSelected, evt: 'click', key: ['del/backspace', true]}, + {sel:'#tool_delete_multi', fn: deleteSelected, evt: 'click', key: ['del/backspace', true]}, + {sel:'#tool_reorient', fn: reorientPath, evt: 'click'}, + {sel:'#tool_node_link', fn: linkControlPoints, evt: 'click'}, + {sel:'#tool_node_clone', fn: clonePathNode, evt: 'click'}, + {sel:'#tool_node_delete', fn: deletePathNode, evt: 'click'}, + {sel:'#tool_move_top', fn: moveToTopSelected, evt: 'click', key: 'shift+up'}, + {sel:'#tool_move_bottom', fn: moveToBottomSelected, evt: 'click', key: 'shift+down'}, + {sel:'#tool_topath', fn: convertToPath, evt: 'click'}, + {sel:'#tool_undo', fn: clickUndo, evt: 'click', key: [modKey+'Z', true]}, + {sel:'#tool_redo', fn: clickRedo, evt: 'click', key: [modKey+'Y', true]}, + {sel:'#tool_clone', fn: clickClone, evt: 'click', key: [modKey+'C', true]}, + {sel:'#tool_clone_multi', fn: clickClone, evt: 'click', key: [modKey+'C', true]}, + {sel:'#tool_group', fn: clickGroup, evt: 'click', key: [modKey+'G', true]}, + {sel:'#tool_ungroup', fn: clickGroup, evt: 'click'}, + {sel:'[id^=tool_align]', fn: clickAlign, evt: 'click'}, + // these two lines are required to make Opera work properly with the flyout mechanism + {sel:'#tools_rect_show', fn: clickRect, evt: 'click'}, + {sel:'#tools_ellipse_show', fn: clickEllipse, evt: 'click'}, + {sel:'#tool_bold', fn: clickBold, evt: 'mousedown'}, + {sel:'#tool_italic', fn: clickItalic, evt: 'mousedown'}, + {sel:'#sidepanel_handle', fn: toggleSidePanel, key: [modKey+'X']}, + + // Shortcuts not associated with buttons + {key: 'shift+left', fn: function(){rotateSelected(0)}}, + {key: 'shift+right', fn: function(){rotateSelected(1)}}, + {key: 'shift+O', fn: selectPrev}, + {key: 'shift+P', fn: selectNext}, + {key: ['ctrl+up', true], fn: function(){zoomImage(2);}}, + {key: ['ctrl+down', true], fn: function(){zoomImage(.5);}}, + {key: ['up', true], fn: function(){moveSelected(0,-1);}}, + {key: ['down', true], fn: function(){moveSelected(0,1);}}, + {key: ['left', true], fn: function(){moveSelected(-1,0);}}, + {key: ['right', true], fn: function(){moveSelected(1,0);}} + ]; + + var key_assocs = {}; + + return { + setAll: function() { + $.each(tool_buttons, function(i, opts) { + // Bind function to button + if(opts.sel) { + var btn = $(opts.sel); + if(opts.evt) { + btn[opts.evt](opts.fn); + } + } + // Bind function to shortcut key + if(opts.key) { + // Set shortcut based on options + var keyval, shortcut = '', disInInp = false, fn = opts.fn, pd = false; + if($.isArray(opts.key)) { + keyval = opts.key[0]; + if(opts.key.length > 1) pd = opts.key[1]; + if(opts.key.length > 2) disInInp = opts.key[2]; + } else { + keyval = opts.key; + } + keyval += ''; + + $.each(keyval.split('/'), function(i, key) { + $(document).bind('keydown', {combi: key, disableInInput: disInInp}, function(e) { + fn(); + if(pd) e.preventDefault(); + }); + }); + + // Put shortcut in title + if(opts.sel) { + var new_title = btn.attr('title').split('[')[0] + '[' + keyval + ']'; + key_assocs[keyval] = opts.sel; + btn.attr('title', new_title); + } + } + }); + + // Make "return" keypress trigger the change event + $('.attr_changer, #image_url').bind('keydown', {combi:'return'}, + function(evt) {$(this).change();evt.preventDefault();} + ); + }, + setTitles: function() { + $.each(key_assocs, function(keyval, sel) { + $(sel).each(function() { + var t = this.title.split(' [')[0]; + var key_str = ''; + // Shift+Up + $.each(keyval.split('/'), function(i, key) { + var mod_bits = key.split('+'), mod = ''; + if(mod_bits.length > 1) { + mod = mod_bits[0] + '+'; + key = mod_bits[1]; + } + if(uiStrings['key_'+key]) { + key_str += (i?'/':'') + mod + uiStrings['key_'+key]; + } else { + key_str = key; + } + }); + this.title = t +' ['+key_str+']'; + }); + }); + } + }; + }(); + + Actions.setAll(); $('#rect_rx').SpinButton({ min: 0, max: 1000, step: 1, callback: changeRectRadius }); $('#stroke_width').SpinButton({ min: 0, max: 99, step: 1, callback: changeStrokeWidth }); @@ -2119,6 +2160,7 @@ function svg_edit_setup() { // $.extend will only replace the given strings $.extend(uiStrings,strings); svgCanvas.setUiStrings(strings); + Actions.setTitles(); } };