kuy / Wedata Manager

This greasemonkey script works on Wedata and provide various enhancement for editing database items from website.

Clone this repository (size: 24.1 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/kuy/wedata-manager/

Changed (Δ0 bytes):

raw changeset »

wedata_manager.user.js (8 lines added, 8 lines removed)

Up to file-list wedata_manager.user.js:

@@ -103,32 +103,32 @@ Wedata.prototype._nextMethod = function(
103
103
Wedata.prototype._getMethod = function(method){
104
104
    switch(method){
105
105
    case this.METHOD.SCRIPT:
106
        return this._getApiKey_SCRIPT;
106
        return this._getAPIKey_SCRIPT;
107
107
    case this.METHOD.PREF:
108
        return this._getApiKey_PREF;
108
        return this._getAPIKey_PREF;
109
109
    case this.METHOD.XHR:
110
        return this._getApiKey_XHR;
110
        return this._getAPIKey_XHR;
111
111
    case this.METHOD.PROMPT:
112
        return this._getApiKey_PROMPT;
112
        return this._getAPIKey_PROMPT;
113
113
    }
114
114
    console.log('Wedata#_getMethod: invalid method: ' + method);
115
115
    return function(){return ''};
116
116
}
117
Wedata.prototype._getApiKey_SCRIPT = function(){
117
Wedata.prototype._getAPIKey_SCRIPT = function(){
118
118
    if(cfg && cfg.apikey && cfg.apikey.length !== 0)
119
119
        return cfg.apikey;
120
120
    return '';
121
121
}
122
Wedata.prototype._getApiKey_PREF = function(){
122
Wedata.prototype._getAPIKey_PREF = function(){
123
123
    var apikey = GM_getValue('apikey');
124
124
    if(apikey && apikey.length !== 0)
125
125
        return apikey;
126
126
    return '';
127
127
}
128
Wedata.prototype._getApiKey_XHR = function(){
128
Wedata.prototype._getAPIKey_XHR = function(){
129
129
    return '';
130
130
}
131
Wedata.prototype._getApiKey_PROMPT = function(){
131
Wedata.prototype._getAPIKey_PROMPT = function(){
132
132
    var apikey = prompt('[Wedata Manager]\nPlease input your API key of Wedata.');
133
133
    if(apikey && apikey.length !== 0)
134
134
        return apikey;