mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-31 19:29:11 +00:00
Added $tw.utils.pulse() for animating elements
To make it easier to see things while debugging
This commit is contained in:
parent
7ee48626ab
commit
fd4ff10bf3
@ -14,6 +14,7 @@ Transclude macro
|
||||
|
||||
exports.info = {
|
||||
name: "transclude",
|
||||
dependentAll: true, // Tiddlers containing <<transclude>> macro are dependent on every tiddler
|
||||
params: {
|
||||
filter: {byPos: 0, type: "filter"},
|
||||
title: {byPos: 1, type: "tiddler"},
|
||||
@ -24,6 +25,7 @@ exports.info = {
|
||||
};
|
||||
|
||||
exports.executeMacro = function() {
|
||||
console.log("Executing transclude macro",this.params.filter,this.tiddlerTitle);
|
||||
var titles,templateTiddler,templateText,t,title,templateParseTree,
|
||||
nodes,node,c,
|
||||
parents = this.parents.slice(0);
|
||||
|
@ -28,6 +28,13 @@ exports.getBrowserInfo = function(info) {
|
||||
"Moz": "transitionend",
|
||||
"webkit": "webkitTransitionEnd"
|
||||
}[info.prefix];
|
||||
info.animationEnd = {
|
||||
"": "animationEnd",
|
||||
"O": "oAnimationEnd",
|
||||
"MS": "msAnimationEnd",
|
||||
"Moz": "animationend",
|
||||
"webkit": "webkitAnimationEnd"
|
||||
}[info.prefix];
|
||||
info.requestFullScreen = document.body.webkitRequestFullScreen !== undefined ? "webkitRequestFullScreen" :
|
||||
document.body.mozRequestFullScreen !== undefined ? "mozRequestFullScreen" :
|
||||
document.body.requestFullScreen !== undefined ? "requestFullScreen" : "";
|
||||
|
@ -112,4 +112,19 @@ exports.forceLayout = function(element) {
|
||||
var dummy = element.offsetWidth;
|
||||
};
|
||||
|
||||
/*
|
||||
Pulse an element for debugging purposes
|
||||
*/
|
||||
exports.pulseElement = function(element) {
|
||||
// Event handler to remove the class at the end
|
||||
element.addEventListener($tw.browser.animationEnd,function handler(event) {
|
||||
element.removeEventListener($tw.browser.animationEnd,handler,false);
|
||||
$tw.utils.removeClass(element,"pulse");
|
||||
},false);
|
||||
// Apply the pulse class
|
||||
$tw.utils.removeClass(element,"pulse");
|
||||
element.offsetWidth;
|
||||
$tw.utils.addClass(element,"pulse");
|
||||
};
|
||||
|
||||
})();
|
||||
|
@ -12,6 +12,12 @@
|
||||
"title": "$:/core/lib/bootstrap-responsive.css",
|
||||
"type": "text/css"
|
||||
}
|
||||
}, {
|
||||
"file": "pulse.css",
|
||||
"fields": {
|
||||
"title": "$:/core/lib/pulse.css",
|
||||
"type": "text/css"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user