FloatWindow.js 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. //FloatWindow.js
  2. //ArOZ Online Beta Project
  3. //This function is developed for launching a FloatWindow in Function Bar environment
  4. //[Variables Meaning]
  5. //src: The path in which the new window points to
  6. //title: The title text that displace on the window top bar
  7. //iconTag: The icon used for the window label and buttons. Reference Semantic UI for the iconTag information
  8. //uid: The uid is the unique id for this window. If duplicated uid is found, the old window will be replaced.
  9. //ww, wh: Window Width, Window Height
  10. //posx, posy: Window Position x, Window Position y
  11. //resizable: If the float window is resizable
  12. class FloatWindow {
  13. constructor(src, title, iconTag="folder", uid ,ww=undefined, wh=undefined, posx=undefined, posy=undefined, resizable=true, glassEffect=false) {
  14. this.src = location.href.replace(/[^/]*$/, '') + src;
  15. this.title = title;
  16. this.iconTag = iconTag;
  17. this.uid = uid;
  18. this.ww = ww;
  19. this.wh = wh;
  20. this.posx = posx;
  21. this.posy = posy;
  22. this.resizable = resizable;
  23. this.glassEffect = glassEffect;
  24. }
  25. // Method
  26. launch() {
  27. parent.newEmbededWindow(this.src,this.title,this.iconTag,this.uid,this.ww,this.wh,this.posx,this.posy,this.resizable,this.glassEffect);
  28. //console.log(this.src,this.title,this.iconTag,this.uid,this.ww,this.wh,this.posx,this.posy,this.resizable,this.glassEffect);
  29. }
  30. }