update: zotero-types 0.1.5
This commit is contained in:
		
							parent
							
								
									398bf89a23
								
							
						
					
					
						commit
						5d3cde376d
					
				@ -40,6 +40,6 @@
 | 
			
		||||
    "esbuild": "^0.16.10",
 | 
			
		||||
    "release-it": "^14.14.3",
 | 
			
		||||
    "replace-in-file": "^6.3.5",
 | 
			
		||||
    "zotero-types": "^0.1.4"
 | 
			
		||||
    "zotero-types": "^0.1.5"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -14,12 +14,12 @@ interface LineOptions {
 | 
			
		||||
  idx?: number;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// @ts-ignore
 | 
			
		||||
export class PopupWindow extends Zotero.ProgressWindow {
 | 
			
		||||
  private lines: _ZoteroItemProgress[];
 | 
			
		||||
  private closeTime: number | undefined;
 | 
			
		||||
  private originalShow: Function;
 | 
			
		||||
  public show: typeof this.showWithTimer;
 | 
			
		||||
  private originalShow: typeof Zotero.ProgressWindow.prototype.show;
 | 
			
		||||
  // @ts-ignore
 | 
			
		||||
  public show!: typeof this.showWithTimer;
 | 
			
		||||
 | 
			
		||||
  constructor(
 | 
			
		||||
    header: string,
 | 
			
		||||
@ -36,17 +36,14 @@ export class PopupWindow extends Zotero.ProgressWindow {
 | 
			
		||||
    this.lines = [];
 | 
			
		||||
    this.closeTime = options.closeTime || 5000;
 | 
			
		||||
    this.changeHeadline(header);
 | 
			
		||||
    // @ts-ignore
 | 
			
		||||
    this.originalShow = this.show;
 | 
			
		||||
    this.originalShow = this
 | 
			
		||||
      .show as unknown as typeof Zotero.ProgressWindow.prototype.show;
 | 
			
		||||
    this.show = this.showWithTimer;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  createLine(options: LineOptions) {
 | 
			
		||||
    const icon = this.getIcon(options.type, options.icon);
 | 
			
		||||
    const line = new this.ItemProgress(
 | 
			
		||||
      icon || "",
 | 
			
		||||
      options.text || ""
 | 
			
		||||
    ) as _ZoteroItemProgress;
 | 
			
		||||
    const line = new this.ItemProgress(icon || "", options.text || "");
 | 
			
		||||
    if (typeof options.progress === "number") {
 | 
			
		||||
      line.setProgress(options.progress);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user