mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-10-30 15:13:00 +00:00
Rename the 'title' attributes of various widgets to 'tiddler'
The change is to avoid confusion with the HTML 'title' attribute. The name 'tiddler' better emphasises the purpose of the attribute, too.
This commit is contained in:
@@ -79,7 +79,7 @@ Compute the internal state of the widget
|
||||
*/
|
||||
CheckboxWidget.prototype.execute = function() {
|
||||
// Get the parameters from the attributes
|
||||
this.checkboxTitle = this.getAttribute("title",this.getVariable("currentTiddler"));
|
||||
this.checkboxTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
|
||||
this.checkboxTag = this.getAttribute("tag");
|
||||
this.checkboxClass = this.getAttribute("class");
|
||||
// Make the child widgets
|
||||
@@ -91,7 +91,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
|
||||
*/
|
||||
CheckboxWidget.prototype.refresh = function(changedTiddlers) {
|
||||
var changedAttributes = this.computeAttributes();
|
||||
if(changedAttributes.title || changedAttributes.tag || changedAttributes["class"]) {
|
||||
if(changedAttributes.tiddler || changedAttributes.tag || changedAttributes["class"]) {
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@@ -84,7 +84,7 @@ Compute the internal state of the widget
|
||||
*/
|
||||
EditBitmapWidget.prototype.execute = function() {
|
||||
// Get our parameters
|
||||
this.editTitle = this.getAttribute("title",this.getVariable("currentTiddler"));
|
||||
this.editTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
|
||||
this.editClass = this.getAttribute("class");
|
||||
};
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ Compute the internal state of the widget
|
||||
*/
|
||||
EditTextWidget.prototype.execute = function() {
|
||||
// Get our parameters
|
||||
this.editTitle = this.getAttribute("title",this.getVariable("currentTiddler"));
|
||||
this.editTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
|
||||
this.editField = this.getAttribute("field","text");
|
||||
this.editIndex = this.getAttribute("index");
|
||||
this.editDefault = this.getAttribute("default","");
|
||||
@@ -144,7 +144,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
|
||||
EditTextWidget.prototype.refresh = function(changedTiddlers) {
|
||||
var changedAttributes = this.computeAttributes();
|
||||
// Completely rerender if any of our attributes have changed
|
||||
if(changedAttributes.title || changedAttributes.field || changedAttributes.index) {
|
||||
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index) {
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
} else if(changedTiddlers[this.editTitle]) {
|
||||
|
||||
@@ -49,7 +49,7 @@ Compute the internal state of the widget
|
||||
*/
|
||||
EditWidget.prototype.execute = function() {
|
||||
// Get our parameters
|
||||
this.editTitle = this.getAttribute("title",this.getVariable("currentTiddler"));
|
||||
this.editTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
|
||||
this.editField = this.getAttribute("field","text");
|
||||
this.editIndex = this.getAttribute("index");
|
||||
this.editClass = this.getAttribute("class");
|
||||
@@ -81,7 +81,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
|
||||
*/
|
||||
EditWidget.prototype.refresh = function(changedTiddlers) {
|
||||
var changedAttributes = this.computeAttributes();
|
||||
if(changedAttributes.title || changedAttributes.field || changedAttributes.index) {
|
||||
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index) {
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@@ -44,7 +44,7 @@ Compute the internal state of the widget
|
||||
*/
|
||||
FieldManglerWidget.prototype.execute = function() {
|
||||
// Get our parameters
|
||||
this.mangleTitle = this.getAttribute("title",this.getVariable("currentTiddler"));
|
||||
this.mangleTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
|
||||
// Construct the child widgets
|
||||
this.makeChildWidgets();
|
||||
};
|
||||
|
||||
@@ -90,10 +90,10 @@ ListWidget.prototype.makeItemTemplate = function(title) {
|
||||
}
|
||||
// Compose the transclusion of the template
|
||||
if(this.hasAttribute("hackTemplate")) {
|
||||
templateTree = [{type: "transclude", attributes: {title: {type: "string", value: title}}}];
|
||||
templateTree = [{type: "transclude", attributes: {tiddler: {type: "string", value: title}}}];
|
||||
} else {
|
||||
if(template) {
|
||||
templateTree = [{type: "transclude", attributes: {title: {type: "string", value: template}}}];
|
||||
templateTree = [{type: "transclude", attributes: {tiddler: {type: "string", value: template}}}];
|
||||
} else {
|
||||
if(this.parseTreeNode.children && this.parseTreeNode.children.length > 0) {
|
||||
templateTree = this.parseTreeNode.children;
|
||||
@@ -105,7 +105,7 @@ ListWidget.prototype.makeItemTemplate = function(title) {
|
||||
}
|
||||
}
|
||||
if(!this.hasAttribute("hackCurrentTiddler")) {
|
||||
templateTree = [{type: "tiddler", attributes: {title: {type: "string", value: title}}, children: templateTree}]
|
||||
templateTree = [{type: "tiddler", attributes: {tiddler: {type: "string", value: title}}, children: templateTree}]
|
||||
}
|
||||
}
|
||||
// Return the list item
|
||||
|
||||
@@ -41,7 +41,7 @@ Compute the internal state of the widget
|
||||
*/
|
||||
TiddlerWidget.prototype.execute = function() {
|
||||
// Get our parameters
|
||||
this.tiddlerTitle = this.getAttribute("title","");
|
||||
this.tiddlerTitle = this.getAttribute("tiddler","");
|
||||
// Set context variables
|
||||
this.setVariable("currentTiddler",this.tiddlerTitle);
|
||||
this.setVariable("missingTiddlerClass",(this.wiki.tiddlerExists(this.tiddlerTitle) || this.wiki.isShadowTiddler(this.tiddlerTitle)) ? "tw-tiddler-exists" : "tw-tiddler-missing");
|
||||
@@ -56,7 +56,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
|
||||
*/
|
||||
TiddlerWidget.prototype.refresh = function(changedTiddlers) {
|
||||
var changedAttributes = this.computeAttributes();
|
||||
if(changedAttributes.title) {
|
||||
if(changedAttributes.tiddler) {
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@@ -38,7 +38,7 @@ Compute the internal state of the widget
|
||||
*/
|
||||
TranscludeWidget.prototype.execute = function() {
|
||||
// Get our parameters
|
||||
this.transcludeTitle = this.getAttribute("title",this.getVariable("currentTiddler"));
|
||||
this.transcludeTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
|
||||
this.transcludeField = this.getAttribute("field");
|
||||
this.transcludeIndex = this.getAttribute("index");
|
||||
// Check for recursion
|
||||
@@ -82,7 +82,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
|
||||
*/
|
||||
TranscludeWidget.prototype.refresh = function(changedTiddlers) {
|
||||
var changedAttributes = this.computeAttributes();
|
||||
if(changedAttributes.title || changedAttributes.field || changedAttributes.index || changedTiddlers[this.transcludeTitle]) {
|
||||
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedTiddlers[this.transcludeTitle]) {
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@@ -40,7 +40,7 @@ Compute the internal state of the widget
|
||||
*/
|
||||
ViewWidget.prototype.execute = function() {
|
||||
// Get parameters from our attributes
|
||||
this.viewTitle = this.getAttribute("title",this.getVariable("currentTiddler"));
|
||||
this.viewTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
|
||||
this.viewField = this.getAttribute("field","text");
|
||||
this.viewIndex = this.getAttribute("index");
|
||||
this.viewFormat = this.getAttribute("format","text");
|
||||
@@ -165,7 +165,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
|
||||
*/
|
||||
ViewWidget.prototype.refresh = function(changedTiddlers) {
|
||||
var changedAttributes = this.computeAttributes();
|
||||
if(changedAttributes.title || changedAttributes.field || changedAttributes.index || changedAttributes.template || changedAttributes.format || changedTiddlers[this.viewTitle]) {
|
||||
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.template || changedAttributes.format || changedTiddlers[this.viewTitle]) {
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user