On 6 Oct 2015, at 12:44, Danielo Rodríguez <rdan...@gmail.com> wrote:
At the end I'm using $tw.pageContainerseems that all the Node creation stuff happens at render module of the core.
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/bd355e56-fa8a-4c2f-bf13-7620a4e05fa8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I want to know when TW creates the main div container. That with the class tc-page-container-wrapper
So, clearly, I have no wish to discourage discussion.Nonetheless, I would invite you and others to use the TiddlyWikiDev group much more,even if the (perceived) latency might be a bit higher (although I'm not sure it is).
I imagine all this tech-noise to seriously shy away thosewho just want to use and learn more about how to use TiddlyWikiand are overburdened by numerous dev threads on how it all works or how to extend it,considering how leveraging the power of TiddlyWiki already can have quite a techy feel to it.
Sure, this will never be a mere "use the save-as button" discussion group,but let's watch out for it to not sound too much like we're all using a console.Thanks for considering,
Hello Tobias, you're right.But it is also hard for jeremy for checking on three different places, tw group, tw dev group and github. People not interested on a topic does not need to read it. Anyway, I understand what you say, and I agree with you.
But, I hope you don't mind if I make another question on this same thread.Is there any tag similar to rawMarkup tag but placing the content outside the page container instead of the head section?
Regards
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/e445048a-19d7-47cf-ad89-2c48185f529f%40googlegroups.com.
Posts to all three places come through to my inbox so I see them all.Tobias is correct: development questions belong in the tiddlywikidev group, out of respect for newcomers who find them overwhelming. They also give a misleading impression that all TiddlyWiki users need to have developer skills.
It is my fault because I am more or less lazy.Then, Jeremy, If I place an element manually outside that template, and I trigger an event, Will it be cached by the root widget? I suppose the answer is yes, but I am not sure at all.
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/b2df0f40-2e85-43b4-9409-a73827ff76df%40googlegroups.com.
The root widget only catches widget messages, it doesn’t catch DOM events.
If you create an element outside of the page container, and trigger an event from that DOM tree, then there’s nothing in the core that will catch that event.
What do you think that would be the best way to place a tiddler at the top of the page and hide all the rest of the elements? Including story river, sidebars and everything else.
Regards
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/5fc38cea-8ae0-4581-9f22-8f336e5b3e27%40googlegroups.com.
You can easily overlay the main page using a position: fixed div, just like the backdrop for the modals.
@Danielo,
I don't see why a widget should not be able to store a reference to its context somewhere, no matter where it resides. Can it not?
var messageBox = doc.getElementById("tiddlyclip-message-box");
if(!messageBox) {
messageBox = doc.createElement("div");
messageBox.id = "tiddlyclip-message-box";
messageBox.style.display = "none";
doc.body.appendChild(messageBox);
}
// Attach the event handler to the message box
messageBox.addEventListener("tiddlyclip-save-file", onSaveFile,false);HI Danielo,
It is possible to write a widget that creates a dom element and attaches it outside of the page container - it can then listen for dom events
var messageBox = doc.getElementById("tiddlyclip-message-box"); if(!messageBox) { messageBox = doc.createElement("div"); messageBox.id = "tiddlyclip-message-box"; messageBox.style.display = "none"; doc.body.appendChild(messageBox); } // Attach the event handler to the message box messageBox.addEventListener("tiddlyclip-save-file", onSaveFile,false);
and the onSaveFile() function generates messages.
El martes, 6 de octubre de 2015, 23:43:49 (UTC+2), BJ escribió:HI Danielo,
It is possible to write a widget that creates a dom element and attaches it outside of the page container - it can then listen for dom eventsIndeed. I know that I can listem for events the old normal way. But the problem is not only listening to events, but taking advantage of all the rendering capabilities that TW provides.var messageBox = doc.getElementById("tiddlyclip-message-box"); if(!messageBox) { messageBox = doc.createElement("div"); messageBox.id = "tiddlyclip-message-box"; messageBox.style.display = "none"; doc.body.appendChild(messageBox); } // Attach the event handler to the message box messageBox.addEventListener("tiddlyclip-save-file", onSaveFile,false);Your listener seems to be just a listener, without any DOM rendering. What I want is some interface that can be placed outside TW and survives hidding the whole TW container (tc-page-wrapper display none). This is not possible because all the widget tree will become "invisible"
messageBox,nextSibling);The widget tree is not made invisible by setting display = none of the tc-page-wrapper, only its dom subtree is hidden.
To render child widgets outside tc-page-wrapper you can use
this.renderChildren(messageBox,nextSibling);
/*\
title: $:/bj/modules/widgets/externalise.js
type: application/javascript
module-type: widget
externaliseWidget -
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var externaliseWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};
/*
Inherit from the base widget class
*/
externaliseWidget.prototype = new Widget();
/*
Render this widget into the DOM
*/
externaliseWidget.prototype.render = function(parent,nextSibling) {
{
var doc = document;
// Inject the message box
var outsidetree = doc.getElementById("tiddlyclip-message-box");
if(!outsidetree) {
outsidetree = doc.createElement("div");
outsidetree.id = "tiddlyclip-message-box";
outsidetree.style.display = "show";
doc.body.insertBefore(outsidetree,doc.body.firstChild);
//doc.body.appendChild(outsidetree);
}
// Attach the event handler to the message box
//outsidetree.addEventListener("tiddlyclip-save-file", onSaveFile,false);
};
this.parentDomNode = parent;
this.computeAttributes();
this.execute();
this.renderChildren(outsidetree,nextSibling);
};
/*
Compute the internal state of the widget
*/
externaliseWidget.prototype.execute = function() {
// Get our parameters
this.close=this.getAttribute("close");
if (this.close) {
this.addEventListeners([
{type: this.close, handler: "handleEvent"}
]);
}
this.open=this.getAttribute("open");
if (this.open) {
this.addEventListeners([
{type: this.open, handler: "handleOpenEvent"}
]);
}
// Construct the child widgets
this.makeChildWidgets();
};
/*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
externaliseWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes["close"] ) {
this.refreshSelf();
return true;
}
else {
return this.refreshChildren(changedTiddlers);
}
};
externaliseWidget.prototype.handleEvent = function(event) {
$tw.pageContainer.setAttribute("hidden","true");
};
externaliseWidget.prototype.handleOpenEvent = function(event) {
$tw.pageContainer.removeAttribute("hidden");
};
exports.externalise = externaliseWidget;
})();
The Widget could be