'use strict'; var hostIP = '46.105.98.229'; if (window['hostIP'] === undefined) { var hostIP = '{unknown host ip}'; } function jsonStringify(dataObject) { return JSON.stringify(dataObject).replace(/":"([0-9]{16,})"/g, "\":$1"); } function refreshAds() { ANCIL.collections.admin.ads.fetch(); } var ANCIL = { authorization: { token: undefined, expiration: null }, router: undefined, constants: { LOGIN_RESULT_SUCCESS : 1400 }, common: undefined, urls: { serverBase: undefined }, collections: { admin: { pages: undefined, radioBroadcast: undefined, mezalta: undefined, user: undefined, scope: undefined, ads: undefined, article: undefined, eventDefinition: undefined, calendar: undefined } }, programmer: 'john nikho', instance_id: ('' + new Date().getTime()), // Make it a string show: function() { console.log( ANCIL.programmer); }, // Generate a new Guid. newGuid: function(noDashes) { var guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8); return v.toString(16); }); return noDashes ? guid.replace(/-/g, '') : guid; }, // Create a new request id. This is a combination of the app's instance id (so we know which requests came from // which app), and a request id (to track a specific request). newRequestId: function() { return [[['ancil', ANCIL.instance_id].join('_'), hostIP].join('-'), ANCIL.newGuid()].join('--'); } }; ANCIL.urls.serverBase = "http://ancil.org/server/api/1" require.config({ baseUrl: '/build', waitSeconds: 120, map: { "*": { "lodash": "underscore" } }, paths: { app: 'app' } }); require(['app']);