Methods

  • BrainJS: u.method()
  • BrainXML: <u>method()</u>
function User( ) {
this.p2pp = function(p) {
  
     switch(p){
       case 'i':
         return 'my';
       case 'you':
         return 'your';
       case 'he':
         return 'his';
       case 'she':
         return 'her';
       case 'it':
         return 'its';
       case 'we':
         return 'our';
       case 'they':
         return 'their';
       default:
         return p;
     }
  
};
this.pageFeedback = function(p) {
     if (p === undefined) {
       p = 1;
     }
     var lang = this.getPageLang();
     var url = 'http://acobot.com/api/page/feedback/' + this.uid_key + '/' + p + '/' + lang;
     
     if (this.app) {
       url += '/' + this.app;
     }
     return this.loadWebPage(url);
  
};
this.pageMyWords = function(del, undo) {
     var clearTop = '';
     
     if (typeof(this.appVersion) !== 'undefined'){
       if (this.appVersion > 98) {
         clearTop = '<clearTop/>';
       }
     }
     
     var lang = this.getPageLang();
     var url = 'http://acobot.com/api/page/mywords/' + this.uid_key + '/' + lang;
     if (undo !== undefined){
       url += '/' + del + '/' + undo ;
       return '<page>web</page>' + clearTop + '<load>' + url + '</load>';
     }
     if (del !== undefined){
       url += '/' + del;
       return '<page>web</page>' + clearTop + '<load>' + url + '</load>';
     }    
     return this.loadWebPage(url);
  
};
this.pageStart = function( ) {
     var lang = this.getPageLang();
     var url = 'http://acobot.com/api/page/start/' + this.uid_key + '/' + lang;
     return this.loadWebPage(url);
  
};
this.pageWelcome = function(lang) {
     if (lang === undefined) {
       lang = this.getPageLang();
     }
     else {
       this.device.language = lang;
     }
     var url = 'http://acobot.com/api/page/welcome/' + this.uid_key + '/' + lang;
     return this.loadWebPage(url);
  
};
this.pageWordbook = function( ) {
     var lang = this.getPageLang();
     var url = 'http://acobot.com/api/page/mywords/' + this.uid_key + '/' + lang;
     return this.loadWebPage(url);
  
};
this.previewMusic = function(keyword) {
  
     var url = "http://acobot.com/api/xm/" + this.uid_key;
     if(!keyword){
       url += "/tops";
     }
     else {
       keyword = encodeURIComponent (keyword); 
       url += "/preview/" + keyword;
     }
     return sraix(url);
  
};
this.pushNews = function( ) {
    
     return sraix('http://acobot.com/api/pushnews/' + this.uid_key);
  
};
this.pushNews2 = function( ) {
    
     return sraix('http://acobot.com/api/pushnews2/' + this.uid_key);
  
};
this.pushPS = function(condition, output) {
  
     var ps = {condition:condition, output:output};
     this.psTMP.push(ps); 
  
};

Pages