Grammalecte  Check-in [fcbc7d9332]

Overview
Comment:[fx] TextFormatter always on top
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fx
Files: files | file ages | folders
SHA3-256: fcbc7d9332db29fc83c926085d56102311984c0d13f91fa4968888b507edfecb
User & Date: olr on 2019-05-03 11:40:59
Other Links: manifest | tags
Context
2019-05-03
11:42
[fx] useless comments check-in: 9341ef2dbf user: olr tags: fx, trunk
11:40
[fx] TextFormatter always on top check-in: fcbc7d9332 user: olr tags: fx, trunk
11:40
[fr] ajustements check-in: f69bfa4b3e user: olr tags: fr, trunk
Changes

Modified gc_lang/fr/webext/content_scripts/panel.js from [e8afa544eb] to [fea7f6e3b1].

    30     30           this.xWaitIcon = this._createWaitIcon();
    31     31           this.xPanel = this._createPanel(sTitle);
    32     32           this.center();
    33     33       }
    34     34   
    35     35       _createPanel (sTitle) {
    36     36           try {
    37         -            let xPanel = oGrammalecte.createNode("div", {id: this.sId, className: "grammalecte_panel"});
           37  +            let xPanel = oGrammalecte.createNode("div", {id: this.sId, className: "grammalecte_panel" });
    38     38               this.xPanelBar.appendChild(oGrammalecte.createNode("div", {className: "grammalecte_panel_invisible_marker", textContent: "__grammalecte_panel__"}));
    39     39               this.xPanelBar.appendChild(this._createButtons());
    40     40               let xTitle = oGrammalecte.createNode("div", {className: "grammalecte_panel_title"});
    41     41               xTitle.appendChild(this._createLogo());
    42     42               xTitle.appendChild(oGrammalecte.createNode("div", {className: "grammalecte_panel_label", textContent: sTitle}));
    43     43               this.xPanelBar.appendChild(xTitle);
    44     44               xPanel.appendChild(this.xPanelBar);
................................................................................
   122    122       hide () {
   123    123           this.xPanel.style.display = "none";
   124    124           oGrammalecte.clearRightClickedNode();
   125    125       }
   126    126   
   127    127       center () {
   128    128           let nHeight = (this.bFlexible) ? window.innerHeight-100 : this.nHeight;
   129         -        this.xPanel.style = `top: 50%; left: 50%; width: ${this.nWidth}px; height: ${nHeight}px; margin-top: -${nHeight/2}px; margin-left: -${this.nWidth/2}px;`;
          129  +        //this.xPanel.style = `top: 50%; left: 50%; width: ${this.nWidth}px; height: ${nHeight}px; margin-top: -${nHeight/2}px; margin-left: -${this.nWidth/2}px;`;
          130  +        this.setSizeAndPosition(`${this.nWidth}px`, `${nHeight}px`, "50%", "", "", "50%", `-${nHeight/2}px`, `-${this.nWidth/2}px`);
   130    131       }
   131    132   
   132    133       stickToLeft () {
   133    134           let nHeight = (this.bFlexible) ? window.innerHeight-100 : this.nHeight;
   134         -        this.xPanel.style = `top: 50%; left: -2px; width: ${this.nWidth}px; height: ${nHeight}px; margin-top: -${nHeight/2}px;`;
          135  +        //this.xPanel.style = `top: 50%; left: -2px; width: ${this.nWidth}px; height: ${nHeight}px; margin-top: -${nHeight/2}px;`;
          136  +        this.setSizeAndPosition(`${this.nWidth}px`, `${nHeight}px`, "50%", "", "", "-2px", `-${nHeight/2}px`, "");
   135    137       }
   136    138   
   137    139       stickToRight () {
   138    140           let nHeight = (this.bFlexible) ? window.innerHeight-100 : this.nHeight;
   139         -        this.xPanel.style = `top: 50%; right: -2px; width: ${this.nWidth}px; height: ${nHeight}px; margin-top: -${nHeight/2}px;`;
          141  +        //this.xPanel.style = `top: 50%; right: -2px; width: ${this.nWidth}px; height: ${nHeight}px; margin-top: -${nHeight/2}px;`;
          142  +        this.setSizeAndPosition(`${this.nWidth}px`, `${nHeight}px`, "50%", "-2px", "", "", `-${nHeight/2}px`, "");
   140    143       }
   141    144   
   142    145       stickToTop () {
   143    146           let nWidth = (this.bFlexible) ? Math.floor(window.innerWidth/2) : this.nWidth;
   144    147           let nHeight = (this.bFlexible) ? Math.floor(window.innerHeight*0.45) : this.nHeight;
   145         -        this.xPanel.style = `top: -2px; left: 50%; width: ${nWidth}px; height: ${nHeight}px; margin-left: -${nWidth/2}px;`;
          148  +        //this.xPanel.style = `top: -2px; left: 50%; width: ${nWidth}px; height: ${nHeight}px; margin-left: -${nWidth/2}px;`;
          149  +        this.setSizeAndPosition(`${nWidth}px`, `${nHeight}px`, "-2px", "", "", "50%", "", `-${nWidth/2}px`);
   146    150       }
   147    151   
   148    152       stickToBottom () {
   149    153           let nWidth = (this.bFlexible) ? Math.floor(window.innerWidth/2) : this.nWidth;
   150    154           let nHeight = (this.bFlexible) ? Math.floor(window.innerHeight*0.45) : this.nHeight;
   151         -        this.xPanel.style = `bottom: -2px; left: 50%; width: ${nWidth}px; height: ${nHeight}px; margin-left: -${nWidth/2}px;`;
          155  +        //this.xPanel.style = `bottom: -2px; left: 50%; width: ${nWidth}px; height: ${nHeight}px; margin-left: -${nWidth/2}px;`;
          156  +        this.setSizeAndPosition(`${nWidth}px`, `${nHeight}px`, "", "", "-2px", "50%", "", `-${nWidth/2}px`);
          157  +    }
          158  +
          159  +    setSizeAndPosition (sWidth, sHeight, sTop, sRight, sBottom, sLeft, sMarginTop, sMarginLeft) {
          160  +        this.xPanel.style.width = sWidth;
          161  +        this.xPanel.style.height = sHeight;
          162  +        this.xPanel.style.top = sTop;
          163  +        this.xPanel.style.right = sRight;
          164  +        this.xPanel.style.bottom = sBottom;
          165  +        this.xPanel.style.left = sLeft;
          166  +        this.xPanel.style.marginTop = sMarginTop;
          167  +        this.xPanel.style.marginLeft = sMarginLeft;
   152    168       }
   153    169   
   154    170       reduce () {
   155    171           // todo
   156    172       }
   157    173   
   158    174       adjustHeight () {

Modified gc_lang/fr/webext/content_scripts/panel_tf.js from [397ac93475] to [af5a3d9e1f].

    11     11   class GrammalecteTextFormatter extends GrammalectePanel {
    12     12   
    13     13       constructor (...args) {
    14     14           super(...args);
    15     15           this.xTFNode = this._createTextFormatter();
    16     16           this.xPanelContent.appendChild(this.xTFNode);
    17     17           this.xTextArea = null;
           18  +        this.xPanel.style.zIndex = 2147483647; /* maximum is 2147483647: https://stackoverflow.com/questions/491052/minimum-and-maximum-value-of-z-index */
    18     19   
    19     20           this.TextFormatter = new TextFormatter();
    20     21           this.formatText = this.TextFormatter.formatTextRuleCount;
    21     22           this.removeHyphenAtEndOfParagraphs = this.TextFormatter.removeHyphenAtEndOfParagraphsCount;
    22     23           this.mergeContiguousParagraphs = this.TextFormatter.mergeContiguousParagraphsCount;
    23     24           this.getParagraph = this.TextFormatter.getParagraph;
    24     25       }