mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-05-01 11:47:05 +00:00
The big purge of the old widget mechanism
Getting rid of the old widget mechanism files finally gives us a payoff for all the refactoring. Still a bit of tidying up to do, and we need to re-introduce the animation mechanisms.
This commit is contained in:
@@ -1,45 +0,0 @@
|
||||
/*\
|
||||
title: $:/core/modules/widgets/password.js
|
||||
type: application/javascript
|
||||
module-type: widget
|
||||
|
||||
Implements the password widget.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var PasswordWidget = function(renderer) {
|
||||
// Save state
|
||||
this.renderer = renderer;
|
||||
// Generate child nodes
|
||||
this.generate();
|
||||
};
|
||||
|
||||
PasswordWidget.prototype.generate = function() {
|
||||
// Get the parameters from the attributes
|
||||
this.name = this.renderer.getAttribute("name");
|
||||
// Get the current password
|
||||
var password = $tw.browser ? $tw.utils.getPassword(this.name) : "";
|
||||
// Generate our element
|
||||
this.tag = "input";
|
||||
this.attributes = {
|
||||
type: "password",
|
||||
value: password
|
||||
};
|
||||
this.events = [
|
||||
{name: "keyup", handlerObject: this},
|
||||
{name: "input", handlerObject: this}];
|
||||
};
|
||||
|
||||
PasswordWidget.prototype.handleEvent = function(event) {
|
||||
var password = this.renderer.domNode.value;
|
||||
return $tw.utils.savePassword(this.name,password);
|
||||
};
|
||||
|
||||
exports.password = PasswordWidget;
|
||||
|
||||
})();
|
||||
Reference in New Issue
Block a user