use apiURL
This commit is contained in:
parent
fe0acbb3ba
commit
952be0a154
2 changed files with 21 additions and 21 deletions
|
|
@ -125,9 +125,9 @@ requires
|
|||
Ox.App = function() {
|
||||
/*
|
||||
options:
|
||||
requestTimeout
|
||||
requestType
|
||||
requestURL
|
||||
apiTimeout
|
||||
apiType
|
||||
apiURL
|
||||
*/
|
||||
return function(options) {
|
||||
|
||||
|
|
@ -138,12 +138,11 @@ requires
|
|||
self.time = +new Date();
|
||||
|
||||
self.options = $.extend({
|
||||
id: '',
|
||||
init: '',
|
||||
name: '',
|
||||
requestTimeout: 15000,
|
||||
requestType: 'POST',
|
||||
requestURL: '', // fixme: should be apiURL etc
|
||||
apiTimeout: 15000,
|
||||
apiType: 'POST',
|
||||
apiURL: '',
|
||||
config: '',
|
||||
init: ''
|
||||
}, options);
|
||||
|
||||
function getUserAgent() {
|
||||
|
|
@ -201,7 +200,7 @@ requires
|
|||
that.api = {
|
||||
api: function(callback) {
|
||||
Ox.Request.send({
|
||||
url: self.options.requestURL,
|
||||
url: self.options.apiURL,
|
||||
data: {
|
||||
action: 'api'
|
||||
},
|
||||
|
|
@ -217,19 +216,20 @@ requires
|
|||
var time = +new Date(),
|
||||
userAgent = getUserAgent(),
|
||||
userAgents = ['Chrome', 'Firefox', 'Safari'];
|
||||
document.title = self.options.name;
|
||||
$.ajaxSetup({
|
||||
timeout: self.options.requestTimeout,
|
||||
type: self.options.requestType,
|
||||
url: self.options.requestURL
|
||||
timeout: self.options.apiTimeout,
|
||||
type: self.options.apiType,
|
||||
url: self.options.apiURL
|
||||
});
|
||||
userAgents.indexOf(userAgent) > -1 ? start() : stop();
|
||||
function start() {
|
||||
loadImages(function() {
|
||||
$.getJSON(self.options.config, function(data) {
|
||||
var config = data;
|
||||
Ox.print('config', config);
|
||||
document.title = config.site.name;
|
||||
window.google = function() {};
|
||||
$.getScript('http://maps.google.com/maps/api/js?callback=google&sensor=false', function() {
|
||||
$.getJSON(self.options.config, function(data) {
|
||||
var config = data;
|
||||
loadImages(function() {
|
||||
that.api.api(function(result) {
|
||||
$.each(result.data.actions, function(i, action) {
|
||||
that.api[action] = function(data, callback) {
|
||||
|
|
@ -238,9 +238,8 @@ requires
|
|||
data = {};
|
||||
}
|
||||
console.log('api', action, data)
|
||||
console.log('sending', self.options.requestURL, {action: action, data: data})
|
||||
return Ox.Request.send({
|
||||
url: self.options.requestURL,
|
||||
url: self.options.apiURL,
|
||||
data: {
|
||||
action: action,
|
||||
data: JSON.stringify(data)
|
||||
|
|
@ -5906,7 +5905,8 @@ requires
|
|||
}
|
||||
|
||||
function mousedown(e) {
|
||||
e.preventDefault();
|
||||
// fixme: preventDefault keeps image from being draggable in safari - but also keeps the list from getting focus
|
||||
// e.preventDefault();
|
||||
}
|
||||
|
||||
function mouseenter() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue