bugfixes
[4Free-FSE.git] / src / password-viewer.ts
blobdc23d7b98d2d8705dedacd9a5e92e637126a5053
1 class PasswordViewer extends FeatureInterface{
2         post_id: string = "postPassword";
3         del_id: string = "delPassword";
4         
5         node_post: any;
6         label_post: any = document.createElement('LABEL');
7         node_post_parent:any;
8         
9         node_del: any;
10         label_del: any = document.createElement('LABEL');
11         node_del_parent:any;
12         constructor(){
13                 super();
14                 this.init();
15                 this.activate();
16         }
17         
18         init():void{
19                 this.node_post = document.getElementById(this.post_id);
20                 this.node_del = document.getElementById(this.del_id);
21                 this.node_post_parent = this.node_post.parentNode;
22                 this.node_del_parent = this.node_del.parentNode;
23                 this.label_post.textContent = 'Post: ';
24                 this.label_del.textContent = 'Delete: '
25         }
26         
27         //activate displays passwords
28         activate():void{
29                 console.log("4F-FSE: PasswordViewer Active");
30                 this.node_post_parent.insertBefore(this.label_post, this.node_post);
31                 this.node_del_parent.insertBefore(this.label_del, this.node_del);
32                 
33                 this.node_post.removeAttribute('type');
34                 this.node_del.removeAttribute('type');
35                 (<HTMLElement>document.getElementsByClassName('deleteform')[0]).style.display = 'inline';               
36                 this.node_del.style.display = 'inline';         
37                 this.label_del.style.display = 'inline';        
38                 this.label_del.style.paddingLeft = '10px';      
39         }
40         
41         decideAction(node:any):void{}
42         retrieveStates():void{};
43         storeStates():void{};
44