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
1=== modified file 'smil.user.js'
2--- smil.user.js 2009-05-25 19:54:10 +0000
3+++ smil.user.js 2009-06-20 06:51:59 +0000
4@@ -103,23 +103,27 @@
5 (namespaceURI==smil3ns && !impl.hasFeature(smil3ns, "3.0")) ||
6 (namespaceURI==timesheetns && !impl.hasFeature(timesheetns, "1.0"))) {
7 if (nodeName=="set" || nodeName=="animate" || nodeName=="animateColor" || nodeName=="animateMotion" || nodeName=="animateTransform") {
8- var targets = getTargets(anim);
9- var elAnimators = new Array();
10- for(var i=0; i<targets.length ;i++) {
11- var target = targets[i];
12- var animator = new Animator(anim, target, i);
13- animators.push(animator);
14- elAnimators[i] = animator;
15- }
16- anim.animators = elAnimators;
17- var id = anim.getAttribute("id");
18- if (id)
19- id2anim[id] = anim;
20+ enableAnimator(anim);
21 }
22 }
23 }
24 }
25
26+function enableAnimator(anim) {
27+ var targets = getTargets(anim);
28+ var elAnimators = new Array();
29+ for(var i=0; i<targets.length ;i++) {
30+ var target = targets[i];
31+ var animator = new Animator(anim, target, i);
32+ animators.push(animator);
33+ elAnimators[i] = animator;
34+ }
35+ anim.animators = elAnimators;
36+ var id = anim.getAttribute("id");
37+ if (id)
38+ id2anim[id] = anim;
39+}
40+
41 function getTargets(anim) {
42 if (anim.hasAttribute("select"))
43 return select(anim);
44@@ -1430,4 +1434,4 @@
45
46 try {
47 window.addEventListener("load", initSMIL, false);
48-} catch(exc) {}
49\ No newline at end of file
50+} catch(exc) {}

Subscribers

People subscribed via source and target branches

to all changes: