Browse Source

Fix errors, temorary remove element_animate

Konstantin Zakablukovsky 9 years ago
parent
commit
c27941f786
3 changed files with 6 additions and 72 deletions
  1. 3 4
      include/nitro.hrl
  2. 0 65
      src/elements/element_animate.erl
  3. 3 3
      src/elements/element_svg.erl

+ 3 - 4
include/nitro.hrl

@@ -11,16 +11,16 @@
 -define(ACTION_BASE(Module), ancestor=action, trigger, target, module=Module, actions, source=[]).
 -define(ACTION_BASE(Module), ancestor=action, trigger, target, module=Module, actions, source=[]).
 -define(CTRL_BASE(Module), ?ELEMENT_BASE(Module,undefined,Module)).
 -define(CTRL_BASE(Module), ?ELEMENT_BASE(Module,undefined,Module)).
 % SVG attribute groups
 % SVG attribute groups
--define(SVG_ANIMATION_EVENT, onbegin, onend, onload, onrepeat).
+-define(SVG_ANIMATION_EVENT, onbegin, onend, onload_animation, onrepeat).
 -define(SVG_ANIMATION_ATTRIBUT_TARGET, attributeType, attributeName).
 -define(SVG_ANIMATION_ATTRIBUT_TARGET, attributeType, attributeName).
 -define(SVG_ANIMATION_TIMING, svgbegin, dur, svgend, min, max, restart, repeatCount, repeatDur, fill).
 -define(SVG_ANIMATION_TIMING, svgbegin, dur, svgend, min, max, restart, repeatCount, repeatDur, fill).
 -define(SVG_ANIMATION_VALUE, calcMode, values, keyTimes, keySplines, from, to, by, autoReverse, accelerate, decelerate).
 -define(SVG_ANIMATION_VALUE, calcMode, values, keyTimes, keySplines, from, to, by, autoReverse, accelerate, decelerate).
 -define(SVG_ANIMATION_ADDITION, additive, accumulate).
 -define(SVG_ANIMATION_ADDITION, additive, accumulate).
 -define(SVG_CONDITIONAL_PROCESSING, requiredExtensions, requiredFeatures, systemLanguage).
 -define(SVG_CONDITIONAL_PROCESSING, requiredExtensions, requiredFeatures, systemLanguage).
 -define(SVG_CORE, xmlbase, xmllang, xmlspace).
 -define(SVG_CORE, xmlbase, xmllang, xmlspace).
--define(SVG_DOCUMENT_EVENT, onabort, onscroll, onunload, onzoom).  %% onerror and onresize, duplicating HTML events, were removed.
+-define(SVG_DOCUMENT_EVENT, onabort, onscroll, onunload_document, onzoom).  %% onerror and onresize, duplicating HTML events, were removed.
 -define(SVG_FILTER_PRIMITIVE, height, result, width, x, y).
 -define(SVG_FILTER_PRIMITIVE, height, result, width, x, y).
--define(SVG_GRAPHICAL_EVENT, onactivate, onfocusin, onfocusout, onload, onmousedown, onmousemove, onmouseout, onmouseup). %% onclick and onmouseover, duplicating HTML events, were removed.
+-define(SVG_GRAPHICAL_EVENT, onactivate, onfocusin, onfocusout, onload_graphical, onmousedown, onmousemove, onmouseout, onmouseup). %% onclick and onmouseover, duplicating HTML events, were removed.
 -define(SVG_PRESENTATION, alignment_baseline, baseline_shift, clip, clip_path, clip_rule, color, color_interpolation, color_interpolation_filters, color_profile, color_rendering, cursor,
 -define(SVG_PRESENTATION, alignment_baseline, baseline_shift, clip, clip_path, clip_rule, color, color_interpolation, color_interpolation_filters, color_profile, color_rendering, cursor,
 		direction, display, dominant_baseline, enable_background, fill, fill_opacity, fill_rule, filter, flood_color, flood_opacity, font_family, font_size, font_size_adjust, font_stretch,
 		direction, display, dominant_baseline, enable_background, fill, fill_opacity, fill_rule, filter, flood_color, flood_opacity, font_family, font_size, font_size_adjust, font_stretch,
 		font_style, font_variant, font_weight, glyph_orientation_horizontal, glyph_orientation_vertical, image_rendering, kerning, letter_spacing, lighting_color, marker_end, marker_mid,
 		font_style, font_variant, font_weight, glyph_orientation_horizontal, glyph_orientation_vertical, image_rendering, kerning, letter_spacing, lighting_color, marker_end, marker_mid,
@@ -199,7 +199,6 @@
 
 
 % SVG
 % SVG
 -record(svg, {?ELEMENT_BASE(element_svg), version="1.1", baseProfile="full", xmlns="http://www.w3.org/2000/svg", xmlnsxlink="http://www.w3.org/1999/xlink", xmlnsev="http://www.w3.org/2001/xml-events", preserveAspectRatio, contentScriptType, contentStyleType, viewBox, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_DOCUMENT_EVENT, ?SVG_FILTER_PRIMITIVE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION, ?SVG_TRANSFERT_FUNCTION, ?SVG_XLINK}).
 -record(svg, {?ELEMENT_BASE(element_svg), version="1.1", baseProfile="full", xmlns="http://www.w3.org/2000/svg", xmlnsxlink="http://www.w3.org/1999/xlink", xmlnsev="http://www.w3.org/2001/xml-events", preserveAspectRatio, contentScriptType, contentStyleType, viewBox, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_DOCUMENT_EVENT, ?SVG_FILTER_PRIMITIVE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION, ?SVG_TRANSFERT_FUNCTION, ?SVG_XLINK}).
--record(animate, {?ELEMENT_BASE(element_animate), externalResourcesRequired, ?SVG_ANIMATION_EVENT, ?SVG_ANIMATION_ATTRIBUT_TARGET, ?SVG_ANIMATION_TIMING, ?SVG_ANIMATION_VALUE, ?SVG_ANIMATION_ADDITION, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_XLINK}).
 
 
 % Extras
 % Extras
 -record(upload,         {?CTRL_BASE(element_upload), name, value}).
 -record(upload,         {?CTRL_BASE(element_upload), name, value}).

+ 0 - 65
src/elements/element_animate.erl

@@ -1,65 +0,0 @@
--module(element_animate).
--author('Konstantin Zakablukovsky').
--include("nitro.hrl").
--compile(export_all).
--import(element_svg, [svg_conditional_processing/1, svg_core/1, svg_xlink/1]).
-
-render_element(Record) ->
-	wf_tags:emit_tag(<<"animate">>, nitro:render(Record#animate.body),
-	list:append([
-		[
-			{<<"id">>, Record#animate.id},
-			{<<"class">>, Record#animate.class},
-			{<<"style">>, Record#animate.style},
-			{<<"externalResourcesRequired">>, Record#animate.externalResourcesRequired}
-		],
-		svg_animation_event(Record),
-		svg_animation_attribut_target(Record),
-		svg_animation_timing(Record),
-		svg_animation_value(Record),
-		svg_animation_addition(Record),
-		svg_conditional_processing(Record),
-		svg_core(Record),
-		svg_xlink(Record),
-		Record#animate.data_fields,
-		Record#animate.aria_states
-	])).
-
-% Common SVG animate attributes
-svg_animation_event(Record) -> [
-	{<<"onbegin">>, Record#animate.onbegin},
-	{<<"onend">>, Record#animate.onend},
-	{<<"onload">>, Record#animate.onload},
-	{<<"onrepeat">>, Record#animate.onrepeat}
-].
-svg_animation_attribut_target(Record) -> [
-	{<<"attributeType">>, Record#animate.attributeType},
-	{<<"attributeName">>, Record#animate.attributeName}
-].
-svg_animation_timing(Record) -> [
-	{<<"begin">>, Record#animate.svgbegin},
-	{<<"dur">>, Record#animate.dur},
-	{<<"end">>, Record#animate.svgend},
-	{<<"min">>, Record#animate.min},
-	{<<"max">>, Record#animate.max},
-	{<<"restart">>, Record#animate.restart},
-	{<<"repeatCount">>, Record#animate.repeatCount},
-	{<<"repeatDur">>, Record#animate.repeatDur},
-	{<<"fill">>, Record#animate.fill}
-].
-svg_animation_value(Record) -> [
-	{<<"calcMode">>, Record#animate.calcMode},
-	{<<"values">>, Record#animate.values},
-	{<<"keyTimes">>, Record#animate.keyTimes},
-	{<<"keySplines">>, Record#animate.keySplines},
-	{<<"from">>, Record#animate.from},
-	{<<"to">>, Record#animate.to},
-	{<<"by">>, Record#animate.by},
-	{<<"autoReverse">>, Record#animate.autoReverse},
-	{<<"accelerate">>, Record#animate.accelerate},
-	{<<"decelerate">>, Record#animate.decelerate}
-].
-svg_animation_addition(Record) -> [
-	{<<"additive">>, Record#animate.additive},
-	{<<"accumulate">>, Record#animate.accumulate}
-].

+ 3 - 3
src/elements/element_svg.erl

@@ -5,7 +5,7 @@
 
 
 render_element(Record) ->
 render_element(Record) ->
 	wf_tags:emit_tag(<<"svg">>, nitro:render(Record#svg.body),
 	wf_tags:emit_tag(<<"svg">>, nitro:render(Record#svg.body),
-	list:append([
+	lists:append([
 		[
 		[
 			{<<"id">>, Record#svg.id},
 			{<<"id">>, Record#svg.id},
 			{<<"class">>, Record#svg.class},
 			{<<"class">>, Record#svg.class},
@@ -52,7 +52,7 @@ svg_document_event(Record)-> [
 	{<<"onerror">>, Record#svg.onerror},
 	{<<"onerror">>, Record#svg.onerror},
 	{<<"onresize">>, Record#svg.onresize},
 	{<<"onresize">>, Record#svg.onresize},
 	{<<"onscroll">>, Record#svg.onscroll},
 	{<<"onscroll">>, Record#svg.onscroll},
-	{<<"onunload">>, Record#svg.onunload},
+	{<<"onunload">>, Record#svg.onunload_document},
 	{<<"onzoom">>, Record#svg.onzoom}
 	{<<"onzoom">>, Record#svg.onzoom}
 ].
 ].
 
 
@@ -69,7 +69,7 @@ svg_graphical_event(Record)-> [
 	{<<"onclick">>, Record#svg.onclick},
 	{<<"onclick">>, Record#svg.onclick},
 	{<<"onfocusin">>, Record#svg.onfocusin},
 	{<<"onfocusin">>, Record#svg.onfocusin},
 	{<<"onfocusout">>, Record#svg.onfocusout},
 	{<<"onfocusout">>, Record#svg.onfocusout},
-	{<<"onload">>, Record#svg.onload},
+	{<<"onload">>, Record#svg.onload_graphical},
 	{<<"onmousedown">>, Record#svg.onmousedown},
 	{<<"onmousedown">>, Record#svg.onmousedown},
 	{<<"onmousemove">>, Record#svg.onmousemove},
 	{<<"onmousemove">>, Record#svg.onmousemove},
 	{<<"onmouseout">>, Record#svg.onmouseout},
 	{<<"onmouseout">>, Record#svg.onmouseout},