﻿Integrify.service.site = "http://api5.integrify.com/service"
Integrify.service.root = Integrify.service.site + "/integrify-rest.svc";
Integrify.resources.root = "http://resources5.integrify.com/resources";

Integrify.tag_paths = {
    p1: Integrify.resources.root + "/",
    p2: Integrify.resources.root + "/integrify/widgets/"
};


Integrify.service.client_root = document.location.protocol + '//' + document.location.host + "/50/formstoflow/samples";
Integrify.service.default_datatype = "script";
Integrify.service.debugging = true;



Integrify.uploadProxy = Integrify.service.site + "/upload.aspx?url=";
Integrify.availProxies = [Integrify.service.client_root + "/proxy.aspx?url=",
                    Integrify.service.client_root + "/proxy.php?url="];

Integrify.preferredProxy = Integrify.availProxies[0];
Integrify.service.proxy = Integrify.preferredProxy;


//sign on server using proxy, not client
Integrify.oauth.settings.signThroughProxy = true;

//pick up a cookie with the integrify_user_id and feed it into the api endpoint
var integrify_user_id = jQuery.cookie('integrify_user_id');
Integrify.oauth.settings.reqTokenEP = '/request_api_token?user_id=' + integrify_user_id;


Integrify.oauth.settings.exchTokenEP = '/exchange_token';
Integrify.oauth.settings.proxy = Integrify.service.proxy;

//custom auth window formatting

Integrify.oauth.settings.authDisplay = function(url) {

    Ext.MessageBox.alert("Authorization Needed", _tl("You will be redirected to your account login page for authorization."), function(b, text) {
        if (b != "cancel") {
            document.location = url;
        }
    });

}

if (jQuery.cookie("iapi_reqtoken") != null) {
    Integrify.oauth.pendingTokenExchange = true;
}

//override exts external blank image url
Ext.BLANK_IMAGE_URL = Integrify.resources.root + "/css/extjs/s.gif";







