Grammalecte  Check-in [acd22b9ea0]

Overview
Comment:[fx] Simple test of previous commit
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fx | webext_sharedworker
Files: files | file ages | folders
SHA3-256: acd22b9ea0d707d13d08677dcb537c5a083bf4aa3ea6f9e79d8468761f3d5e7b
User & Date: IllusionPerdu on 2017-08-11 09:48:15
Other Links: branch diff | manifest | tags
Context
2017-08-11
10:44
[fx] Le SharedWorker ne se partage pas dans toutes les fenêtres... Estce à cause de la bidouille ??? check-in: c262fc885d user: IllusionPerdu tags: fx, webext_sharedworker
09:48
[fx] Simple test of previous commit check-in: acd22b9ea0 user: IllusionPerdu tags: fx, webext_sharedworker
09:27
[fx] Add the possibility to send reply to all or other check-in: d2e1bf16aa user: IllusionPerdu tags: fx, webext_sharedworker
Changes

Modified gc_lang/fr/webext/content_scripts/modify_page.js from [639403006b] to [8eb0661a77].

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
..
46
47
48
49
50
51
52




53
54
55
56
57
58
59
..
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
            case "grammar_errors":
                console.log(answer.aGrammErr);
                for (let oErr of answer.aGrammErr) {
                    console.log(oErr);
                }
                break;
        }
    }    
}

/*
* Creation d'une iframe pour communiquer entre la page visitée et le Shareworker
*/
var sFrameID = browser.extension.getURL("").split('/')[2];
var xIframe = document.createElement('iframe');
................................................................................
        //La frame est chargé on envoie l'initialisation du Sharedworker
        console.log('[Web] Initialise the worker :s');
        console.log('[Web] Domaine ext: '+browser.extension.getURL(""));
        xFrameContent.postMessage({sPath: browser.extension.getURL(""), sPage: location.origin.trim("/")}, browser.extension.getURL(""));
        //Un petit test pour débogage ;)
        console.log('[Web] Test the worker :s');
        xFrameContent.postMessage(["parse", {sText: "Vas... J’en aie mare...", sCountry: "FR", bDebug: false, bContext: false}], browser.extension.getURL(""));




    }
    catch (e) {
        console.error(e);
    }
}
document.body.appendChild(xIframe);

................................................................................
    xRequest.responseType = "arraybuffer";
    xRequest.send();
    let blobTxt = new Blob([xRequest.response], {type: 'image/png'});
    let img = document.createElement('img');
    img.src = (URL || webkitURL).createObjectURL(blobTxt);
    Array.filter(document.getElementsByClassName(sContainerClass), function (oElem) {
        oElem.appendChild(img);
    });     
}


console.log('[Web] La suite des initialisations');

let nWrapper = 0;
let xConjPanel = null;







|







 







>
>
>
>







 







|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
..
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
..
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
            case "grammar_errors":
                console.log(answer.aGrammErr);
                for (let oErr of answer.aGrammErr) {
                    console.log(oErr);
                }
                break;
        }
    }
}

/*
* Creation d'une iframe pour communiquer entre la page visitée et le Shareworker
*/
var sFrameID = browser.extension.getURL("").split('/')[2];
var xIframe = document.createElement('iframe');
................................................................................
        //La frame est chargé on envoie l'initialisation du Sharedworker
        console.log('[Web] Initialise the worker :s');
        console.log('[Web] Domaine ext: '+browser.extension.getURL(""));
        xFrameContent.postMessage({sPath: browser.extension.getURL(""), sPage: location.origin.trim("/")}, browser.extension.getURL(""));
        //Un petit test pour débogage ;)
        console.log('[Web] Test the worker :s');
        xFrameContent.postMessage(["parse", {sText: "Vas... J’en aie mare...", sCountry: "FR", bDebug: false, bContext: false}], browser.extension.getURL(""));
        //Un test qui envoie a tout le monde
        xFrameContent.postMessage(["all", {}], browser.extension.getURL(""));
        //Un test qui envoie aux autres
        xFrameContent.postMessage(["other", {}], browser.extension.getURL(""));
    }
    catch (e) {
        console.error(e);
    }
}
document.body.appendChild(xIframe);

................................................................................
    xRequest.responseType = "arraybuffer";
    xRequest.send();
    let blobTxt = new Blob([xRequest.response], {type: 'image/png'});
    let img = document.createElement('img');
    img.src = (URL || webkitURL).createObjectURL(blobTxt);
    Array.filter(document.getElementsByClassName(sContainerClass), function (oElem) {
        oElem.appendChild(img);
    });
}


console.log('[Web] La suite des initialisations');

let nWrapper = 0;
let xConjPanel = null;

Modified gc_lang/fr/webext/gce_sharedworker.js from [b6aa40b101] to [72e7a7fc85].

109
110
111
112
113
114
115








116
117
118
119
120
121
122
                break;
            case "fullTests":
                fullTests();
                break;
            case "getListOfTokens":
                getListOfTokens(oParam.sText);
                break;








            default:
                console.log("Unknown command: " + showError(e.data[0]));
        }
    }
    //xPort.start();
}








>
>
>
>
>
>
>
>







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
                break;
            case "fullTests":
                fullTests();
                break;
            case "getListOfTokens":
                getListOfTokens(oParam.sText);
                break;
            case "other":
                console.log("Message to Other");
                toReply.Other("Message to Other");
                break;
            case "all":
                console.log("Message to All");
                toReply.All("Message to All");
                break;
            default:
                console.log("Unknown command: " + showError(e.data[0]));
        }
    }
    //xPort.start();
}