From 999d63c0f08d07c1a7f99dbc11739952abf58ba9 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Wed, 24 Oct 2012 22:15:57 +0100 Subject: [PATCH] Add a cecily view Finally, the start of a proper 2D ZUI view. It's going to replace the current "zoomin" storyview --- core/modules/macros/list/listviews/cecily.js | 99 ++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 core/modules/macros/list/listviews/cecily.js diff --git a/core/modules/macros/list/listviews/cecily.js b/core/modules/macros/list/listviews/cecily.js new file mode 100644 index 000000000..7fc48ee92 --- /dev/null +++ b/core/modules/macros/list/listviews/cecily.js @@ -0,0 +1,99 @@ +/*\ +title: $:/core/modules/macros/list/listviews/cecily.js +type: application/javascript +module-type: listview + +Views the list through a 2D map + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +function CecilyListView(listMacro) { + // The list macro we're attached to + this.listMacro = listMacro; + // Prepare the list frame + var listFrameDomNode = this.listMacro.listFrame.domNode + listFrameDomNode.style.position = "relative"; + listFrameDomNode.style.width = "100%"; // TODO: This isn't the best way to set the width and height + listFrameDomNode.style.height = "400px"; + // Prepare the nozzle for dispensing new tiddlers onto the map + this.newTiddlerPosition = {x: 0, y: 0}; + // Position the initial list entries on the map + this.loadMap(); + this.map.positions["HelloThere"] = {x: 250, y: 50, w: 300, h: 300}; + this.saveMap(); + for(var t=0; t