Changeset 6465a92 in github


Ignore:
Timestamp:
Sep 25, 2010 6:34:54 AM (3 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
e019f2d
Parents:
22c6b5b6
Message:
  • Support action in form of "task/action" in goto_url()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/js/app.js

    r614c642 r6465a92  
    48884888  this.goto_url = function(action, query, lock) 
    48894889  { 
    4890     var querystring = query ? '&'+query : ''; 
    4891     this.redirect(this.env.comm_path+'&_action='+action+querystring, lock); 
    4892   }; 
    4893  
    4894   // send a http request to the server 
    4895   this.http_request = function(action, querystring, lock) 
    4896   { 
    4897     var url = this.env.comm_path; 
     4890    var url = this.env.comm_path, 
     4891     querystring = query ? '&'+query : ''; 
    48984892 
    48994893    // overwrite task name 
     
    49034897    } 
    49044898 
     4899    this.redirect(url+'&_action='+action+querystring, lock); 
     4900  }; 
     4901 
     4902  // send a http request to the server 
     4903  this.http_request = function(action, query, lock) 
     4904  { 
     4905    var url = this.env.comm_path; 
     4906 
     4907    // overwrite task name 
     4908    if (action.match(/([a-z]+)\/([a-z-_]+)/)) { 
     4909      action = RegExp.$2; 
     4910      url = url.replace(/\_task=[a-z]+/, '_task='+RegExp.$1); 
     4911    } 
     4912 
    49054913    // trigger plugin hook 
    4906     var result = this.triggerEvent('request'+action, querystring); 
     4914    var result = this.triggerEvent('request'+action, query); 
    49074915 
    49084916    if (typeof result != 'undefined') { 
     
    49114919        return false; 
    49124920      else 
    4913         querystring = result; 
    4914     } 
    4915  
    4916     url += '&_remote=1&_action=' + action + (querystring ? '&' : '') + querystring; 
     4921        query = result; 
     4922    } 
     4923 
     4924    url += '&_remote=1&_action=' + action + (query ? '&' : '') + query; 
    49174925 
    49184926    // send request 
Note: See TracChangeset for help on using the changeset viewer.