Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 14th, 2012  |  syntax: JavaScript  |  size: 0.94 KB  |  hits: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  return new WinJS.Promise(function () {
  2.             if (App.validade(params)) {
  3.  
  4.                 return Daruma.Channel.open().then(function (newChannel) {
  5.  
  6.                     var payload = ['cpf=' + escape(params.cpf), 'uri=' + escape(Daruma.Channel.channel.uri)];
  7.                     var xhrParams = { type: "GET", url: Daruma.App.serverURL + '?' + payload.join('&') };
  8.  
  9.                     return new WinJS.Promise(function () {
  10.                         return new WinJS.xhr(xhrParams).then(function (req) {
  11.                             var logged = tratarResponseSucesso(req, params.cpf);
  12.                             return _afterLogin(logged);
  13.                         }, function (req) {
  14.                             return tratarResponseFail(req);
  15.                         });
  16.                     });
  17.                 });
  18.             }
  19.  
  20.             return false;
  21.         }).then(function (logged) {
  22.             return logged;
  23.         });