diff --git a/core/modules/parsers/wikiparser/rules/blockidentifier.js b/core/modules/parsers/wikiparser/rules/blockid.js similarity index 94% rename from core/modules/parsers/wikiparser/rules/blockidentifier.js rename to core/modules/parsers/wikiparser/rules/blockid.js index 5cc659600..ecc4e2393 100644 --- a/core/modules/parsers/wikiparser/rules/blockidentifier.js +++ b/core/modules/parsers/wikiparser/rules/blockid.js @@ -9,7 +9,7 @@ Use hash as a tag for paragraph, we call it block identifier. 2. When creating widgets for rendering, omit this hash, so it's invisible in view mode. But this widget will create an anchor to jump to. \*/ -exports.name = "blockidentifier"; +exports.name = "blockid"; exports.types = {inline: true}; /* @@ -30,7 +30,7 @@ exports.parse = function() { var id = this.match[0].slice(2); // Parse tree nodes to return return [{ - type: "blockidentifier", + type: "blockid", attributes: { id: {type: "string", value: id} }, diff --git a/core/modules/widgets/blockidentifier.js b/core/modules/widgets/blockid.js similarity index 75% rename from core/modules/widgets/blockidentifier.js rename to core/modules/widgets/blockid.js index caad458f2..0f33c1adb 100644 --- a/core/modules/widgets/blockidentifier.js +++ b/core/modules/widgets/blockid.js @@ -1,17 +1,17 @@ /*\ -title: $:/core/modules/widgets/blockidentifier.js +title: $:/core/modules/widgets/blockid.js type: application/javascript module-type: widget An invisible element with block id metadata. \*/ var Widget = require("$:/core/modules/widgets/widget.js").widget; -var BlockIdentifierWidget = function(parseTreeNode,options) { +var BlockIdWidget = function(parseTreeNode,options) { this.initialise(parseTreeNode,options); }; -BlockIdentifierWidget.prototype = new Widget(); +BlockIdWidget.prototype = new Widget(); -BlockIdentifierWidget.prototype.render = function(parent,nextSibling) { +BlockIdWidget.prototype.render = function(parent,nextSibling) { // Save the parent dom node this.parentDomNode = parent; // Compute our attributes @@ -29,7 +29,7 @@ BlockIdentifierWidget.prototype.render = function(parent,nextSibling) { /* Compute the internal state of the widget */ -BlockIdentifierWidget.prototype.execute = function() { +BlockIdWidget.prototype.execute = function() { // Get the id from the parse tree node or manually assigned attributes this.id = this.getAttribute("id"); // Make the child widgets @@ -39,7 +39,7 @@ BlockIdentifierWidget.prototype.execute = function() { /* Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering */ -BlockIdentifierWidget.prototype.refresh = function(changedTiddlers) { +BlockIdWidget.prototype.refresh = function(changedTiddlers) { var changedAttributes = this.computeAttributes(); if(($tw.utils.count(changedAttributes) > 0)) { this.refreshSelf(); @@ -49,4 +49,4 @@ BlockIdentifierWidget.prototype.refresh = function(changedTiddlers) { } }; -exports.blockidentifier = BlockIdentifierWidget; +exports.blockid = BlockIdWidget;