From 24ad677d757121624bab3f2895531f870bcc314c Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Mon, 8 Jul 2013 15:19:00 +0100 Subject: [PATCH] Add back the zoomin view An alternative visualisation for the story list. It just shows the currently selected tiddler, with smooth animations between tiddlers. Not entirely finished yet; for instance, if you close the current tiddler you get a blank screen until you select another tiddler. --- core/modules/widgets/list/listviews/zoomin.js | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 core/modules/widgets/list/listviews/zoomin.js diff --git a/core/modules/widgets/list/listviews/zoomin.js b/core/modules/widgets/list/listviews/zoomin.js new file mode 100644 index 000000000..32c9d32ab --- /dev/null +++ b/core/modules/widgets/list/listviews/zoomin.js @@ -0,0 +1,146 @@ +/*\ +title: $:/core/modules/widgets/list/listviews/zoomin.js +type: application/javascript +module-type: listview + +Zooms between individual tiddlers + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +var ZoominListView = function(listWidget) { + this.listWidget = listWidget; + this.storyNode = this.listWidget.renderer.domNode; + // Set the current tiddler + this.currentTiddler = this.listWidget.children[0]; + // Make all the tiddlers position absolute, and hide all but the first one + this.storyNode.style.position = "relative"; + for(var t=0; t widget +*/ +function findTitleNode(node) { + var t,r; + // Return true if this node is a view widget with the field attribute set to "title" + if(node instanceof $tw.WikiRenderTree.prototype.rendererClasses.element) { + if(node.widget instanceof $tw.WikiRenderTree.prototype.rendererClasses.element.prototype.widgetClasses.view && node.attributes.field === "title") { + return node; + } + if(node.widget.children) { + for(t=0; t