Merge lp:~doctormo/smil/seperate-enable into lp:~smilteam/smil/MAIN

Proposed by Martin Owens
Status: Needs review
Proposed branch: lp:~doctormo/smil/seperate-enable
Merge into: lp:~smilteam/smil/MAIN
Diff against target: None lines
To merge this branch: bzr merge lp:~doctormo/smil/seperate-enable
Reviewer Review Type Date Requested Status
Lthere Approve
Review via email: mp+7706@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Owens (doctormo) wrote :

This is a simple extraction of some functionality so it can be called by javascript animation methods and not just at load time.

Revision history for this message
Lthere (helder-magalhaes) wrote :

Sounds like a good idea. The changes are minimal and (like stated) help with dynamic element creation, so IMO this should be folded into the trunk.

review: Approve

Unmerged revisions

33. By Martin Owens

Move animate enabler into it's own function so javascript created animate objects have a way to be enabled after document load.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'smil.user.js'
--- smil.user.js 2009-05-25 19:54:10 +0000
+++ smil.user.js 2009-06-20 06:51:59 +0000
@@ -103,23 +103,27 @@
103 (namespaceURI==smil3ns && !impl.hasFeature(smil3ns, "3.0")) ||103 (namespaceURI==smil3ns && !impl.hasFeature(smil3ns, "3.0")) ||
104 (namespaceURI==timesheetns && !impl.hasFeature(timesheetns, "1.0"))) {104 (namespaceURI==timesheetns && !impl.hasFeature(timesheetns, "1.0"))) {
105 if (nodeName=="set" || nodeName=="animate" || nodeName=="animateColor" || nodeName=="animateMotion" || nodeName=="animateTransform") {105 if (nodeName=="set" || nodeName=="animate" || nodeName=="animateColor" || nodeName=="animateMotion" || nodeName=="animateTransform") {
106 var targets = getTargets(anim);106 enableAnimator(anim);
107 var elAnimators = new Array();
108 for(var i=0; i<targets.length ;i++) {
109 var target = targets[i];
110 var animator = new Animator(anim, target, i);
111 animators.push(animator);
112 elAnimators[i] = animator;
113 }
114 anim.animators = elAnimators;
115 var id = anim.getAttribute("id");
116 if (id)
117 id2anim[id] = anim;
118 }107 }
119 }108 }
120 }109 }
121}110}
122111
112function enableAnimator(anim) {
113 var targets = getTargets(anim);
114 var elAnimators = new Array();
115 for(var i=0; i<targets.length ;i++) {
116 var target = targets[i];
117 var animator = new Animator(anim, target, i);
118 animators.push(animator);
119 elAnimators[i] = animator;
120 }
121 anim.animators = elAnimators;
122 var id = anim.getAttribute("id");
123 if (id)
124 id2anim[id] = anim;
125}
126
123function getTargets(anim) {127function getTargets(anim) {
124 if (anim.hasAttribute("select"))128 if (anim.hasAttribute("select"))
125 return select(anim);129 return select(anim);
@@ -1430,4 +1434,4 @@
14301434
1431try {1435try {
1432 window.addEventListener("load", initSMIL, false);1436 window.addEventListener("load", initSMIL, false);
1433} catch(exc) {}
1434\ No newline at end of file1437\ No newline at end of file
1438} catch(exc) {}

Subscribers

People subscribed via source and target branches

to all changes: