From 5dae3aae9d8636cab0adc52d4bcd569bcdb83e44 Mon Sep 17 00:00:00 2001 From: andygup Date: Sun, 23 Feb 2014 15:27:58 -0700 Subject: [PATCH] undid local proxy references so the repo can be shared --- lib/edit/offlineFeaturesManager.js | 16 ++-------------- samples/attachments-editor.html | 24 +++++++++++++----------- 2 files changed, 15 insertions(+), 25 deletions(-) diff --git a/lib/edit/offlineFeaturesManager.js b/lib/edit/offlineFeaturesManager.js index 0841758..64fe5f6 100644 --- a/lib/edit/offlineFeaturesManager.js +++ b/lib/edit/offlineFeaturesManager.js @@ -58,8 +58,8 @@ define([ layer.offline = { online: true, store: new DbAttachmentStore(), -// proxyPath: "../../lib/proxy.php" - proxyPath: "http://localhost/proxy/proxy.php" + proxyPath: "../../lib/proxy.php" + //proxyPath: "http://localhost/proxy/proxy.php" }; if( /*false &&*/ layer.offline.store.isSupported() ) @@ -111,18 +111,6 @@ define([ } } - layer.test = function (a,c,b,d,e){ - var f=this; - return C({url:this._url.path+"/"+c+"/"+("add"===a?"addAttachment":"updateAttachment"), - form:b,content:q.mixin(this._url.query,{ - f:"json",token:this._getToken()||void 0}), - callbackParamName:"callback.html",handleAs:"json"}).addCallback(function(b){ - var e="add"===a?"onAddAttachmentComplete":"onUpdateAttachmentComplete"; - b=new D(b["add"===a?"addAttachmentResult":"updateAttachmentResult"]); - b.attachmentId=b.objectId;b.objectId=c; - f._resolve([b],e,d);return b}).addErrback( - function(a){f._resolve([a],null,e,null,!0)})} - layer.deleteAttachments = function(objectId,attachmentsIds,callback,errback){ if( self.getOnlineStatus() == self.ONLINE) { diff --git a/samples/attachments-editor.html b/samples/attachments-editor.html index 9c38a80..5388bc2 100644 --- a/samples/attachments-editor.html +++ b/samples/attachments-editor.html @@ -49,8 +49,7 @@ vendor: locationPath + "/../vendor" } } - //window.proxyPath = "../../lib/proxy.php"; - window.proxyPath = "http://localhost/proxy/proxy.php"; + window.proxyPath = "../../lib/proxy.php"; @@ -82,8 +81,8 @@ // a proxy page is required to upload attachments // refer to "Using the Proxy Page" for more information: https://developers.arcgis.com/en/javascript/jshelp/ags_proxy.html - //esriConfig.defaults.io.proxyUrl = "../lib/proxy.php"; - esriConfig.defaults.io.proxyUrl = "http://localhost/proxy/proxy.php"; + esriConfig.defaults.io.proxyUrl = "../lib/proxy.php"; + //esriConfig.defaults.io.proxyUrl = "http://localhost/proxy/proxy.php"; var offlineFeaturesManager = new OfflineFeaturesManager(); offlineFeaturesManager.on(offlineFeaturesManager.events.EDITS_ENQUEUED, updateStatus); @@ -126,13 +125,16 @@ // console.log("Problem querying attachments: " + err.toString()) // }) - featureLayer.addAttachment(objectId,dom.byId("upload-test"),function(evt){ - console.log("TEST ADD callback: " + evt); - attachmentEditor.showAttachments(event.graphic,featureLayer); - map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint)); - },function(err){ - console.log("TEST ADD error: " + err) - }) +// featureLayer.addAttachment(objectId,dom.byId("upload-test"),function(evt){ +// console.log("TEST ADD callback: " + evt); +// attachmentEditor.showAttachments(event.graphic,featureLayer); +// map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint)); +// },function(err){ +// console.log("TEST ADD error: " + err) +// }) + + attachmentEditor.showAttachments(event.graphic,featureLayer); + map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint)); });