Create rest.js

add: RESTfulProto                = function() {
            this.delete = function(pUrl, pData, pCallBack, pQuery) {
                sendRequest({
                    method      : 'DELETE',
                    url         : CloudFunc.FS + pUrl + (pQuery || ''),
                    data        : pData,
                    callback    : pCallBack,
                    imgPosition : { top: !!pData }
                });
            };
            
            this.save   = function(pUrl, pData, pCallBack, pQuery) {
                sendRequest({
                    method      : 'PUT',
                    url         : CloudFunc.FS + pUrl + (pQuery || ''),
                    data        : pData,
                    callback    : pCallBack,
                    imgPosition : { top: true }
                });
            };
            
            this.read   = function(pUrl, pCallBack, pQuery) {
                sendRequest({
                    method      : 'GET',
                    url         : CloudFunc.FS + pUrl + (pQuery || ''),
                    callback    : pCallBack
                });
            };
            
             this.cp     = function(pData, pCallBack) {
                sendRequest({
                    method      : 'PUT',
                    url         : '/cp',
                    data        : pData,
                    callback    : pCallBack
                });
            };
            
            this.zip    = function(pData, pCallBack) {
                sendRequest({
                    method      : 'PUT',
                    url         : '/zip',
                    data        : pData,
                    callback    : pCallBack
                });
            };
            
            this.mv     = function(pData, pCallBack) {
                sendRequest({
                    method      : 'PUT',
                    url         : '/mv',
                    data        : pData,
                    callback    : pCallBack
                });
            };
            
            this.config    = function(pData, pCallBack) {
                sendRequest({
                    method      : 'PUT',
                    url         : '/config',
                    data        : pData,
                    callback    : pCallBack,
                    imgPosition : { top: true }
                });
            };
           
           function sendRequest(pParams) {
                var lRet = Util.checkObjTrue(pParams, ['method']);
                if (lRet) {
                    var p               = pParams;
                        
                    Images.showLoad( p.imgPosition );
                    CloudCmd.getConfig(function(pConfig) {
                        var lData;
                        
                        if (Util.isString(p.url))
                            p.url = decodeURI(p.url);
                        
                        if (p.data                 &&
                            !Util.isString(p.data)  &&
                                !Util.isArrayBuffer(p.data))
                                    lData = Util.stringifyJSON(p.data);
                        else
                            lData = p.data;
                        
                        p.url        = pConfig && pConfig.apiURL + p.url,
                        DOM.ajax({
                            method  : p.method,
                            url     : p.url,
                            data    : lData,
                            error   : Images.showError,
                            success : function(pData) {
                                Images.hideLoad();
                                Util.log(pData);
                                Util.exec(p.callback, pData);
                            }
                        });
                    });
                }
                
                return lRet;
            }
        },