コード例 #1
0
ファイル: LoginWindow.js プロジェクト: Gn13l/appdev_titanium
 onSubmit: function() {
     // Gather the login data
     var loginData = {
         userID: this.getChild('user').value,
         pWord: Ti.Utils.md5HexDigest(this.getChild('password').value) // MD5 hash the user's password
     };
     
     // Send login request to the server
     Ti.API.log('Attempting to login as {'+loginData.userID+', '+loginData.pWord+'}');
     AD.ServiceJSON.post({
         params: loginData,
         url: '/service/site/login/authenticate',
         success: this.proxy(function(data) {
             Ti.API.log('Login succeeded!');
             
             this.close();
             
             // Call the onLogin callback if it was provided to the "open" call
             if ($.isFunction(this.onLogin)) {
                 this.onLogin();
             }
         }),
         failure: function(data) {
             Ti.API.log('Login failed!');
         }
     });
 },
コード例 #2
0
ファイル: serviceModel.js プロジェクト: Gn13l/appdev_titanium
   findOne: function(opt){
 
       return AD.ServiceJSON.post({
           url:  opt.url,
           params: opt.params,
           success: function (data) {
                       opt.success(ServiceModel.returnFirst(data) );
                   },
           failure: opt.failure,
       
       });
       
       
   },
コード例 #3
0
ファイル: serviceModel.js プロジェクト: Gn13l/appdev_titanium
    destroy: function (opt) {
           
        return AD.ServiceJSON.post({
            url:  opt.url,
            params: opt.params,
            retry: true,
            success: function (data) {
                        opt.success(ServiceModel.returnData(data) );
                    },
            failure: opt.failure,

        });

    },
コード例 #4
0
ファイル: serviceModel.js プロジェクト: Gn13l/appdev_titanium
    findAll: function(opt){

        // we can enable certain error handling here
        // for when we need to reauthenticate.
        //
        // also explore local cached data, etc...
        
        return AD.ServiceJSON.post({
            url:  opt.url,
            params: opt.params,
            success: function (data) {
                opt.success(ServiceModel.returnData(data) );
            },
            failure: opt.failure,
        
        });
        
    },