var getParameters = function () {
    var search = window.location.search;
    var obj = {};
    if (search != '') {
        // window.location.search '' or start with '?'
        search = search.substring(1);
        var keypairArray = search.split('&');
        for (i in keypairArray) {
            keypair = keypairArray[i];
            partArray = keypair.split('=');
            if (partArray.length == 2) {
                obj[partArray[0]] = partArray[1];
            }
        }
    }
    return obj;
}

var param = getParameters();

var docEditor = new DocsAPI.DocEditor("placeholder", {
    "document": {
        "fileType": param.fileType.replace(".", ""),
        "permissions": {
            "edit": false,
            "copy": false,
            "download": false,
            "print": false,
            "chat": false
        },
        // "key": "C8D7FB890BAC496FB0D27B163EDB88BDAA",
        "title": decodeURIComponent(param.filename),
        "url": decodeURIComponent(param.url),
    },
    "height": "1000px",
    "width": "100%",
    "editorConfig": {
        "mode": 'view',
        "customization": {
            //是否显示插件
            "plugins": false,
            "feedback": {
                "url": "https://example.com",
                "visible": false
            },
            "help": false
        },
        about: false,
    }
});