File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ var configAttributes = {
3333
3434 plotlyServerURL : {
3535 valType : 'string' ,
36- dflt : '' ,
36+ dflt : 'https://cloud.plotly.com/upload ' ,
3737 description : [
3838 'Sets the URL for the `sendChartToCloud` modebar button.' ,
3939 'When clicked, the button will send the chart data to this URL.' ,
Original file line number Diff line number Diff line change @@ -209,6 +209,8 @@ plots.sendDataToCloud = function(gd) {
209209 }
210210
211211 // Plotly Cloud origin, used to validate incoming messages and to target outgoing ones.
212+ // `baseUrl` (plotlyServerURL) is the upload page that handles login and signals
213+ // back when authentication succeeds.
212214 var cloudOrigin ;
213215 try {
214216 cloudOrigin = new URL ( baseUrl ) . origin ;
@@ -217,9 +219,6 @@ plots.sendDataToCloud = function(gd) {
217219 return ;
218220 }
219221
220- // The page that handles login and signals back when authentication succeeds.
221- var uploadUrl = baseUrl . replace ( / \/ + $ / , '' ) + '/upload' ;
222-
223222 gd . emit ( 'plotly_beforeexport' ) ;
224223
225224 // Build the request body: the chart JSON plus the plotly.js version used to
@@ -229,7 +228,7 @@ plots.sendDataToCloud = function(gd) {
229228
230229 // Open the Cloud login page in a new tab. We keep a reference so we can post
231230 // the chart back to it once Cloud reports that authentication succeeded.
232- var cloudWindow = window . open ( uploadUrl , '_blank' ) ;
231+ var cloudWindow = window . open ( baseUrl , '_blank' ) ;
233232 if ( ! cloudWindow ) {
234233 console . error ( 'Unable to open Plotly Cloud (the popup may have been blocked)' ) ;
235234 gd . emit ( 'plotly_afterexport' ) ;
Original file line number Diff line number Diff line change 280280 },
281281 "plotlyServerURL": {
282282 "description": "Sets the URL for the `sendChartToCloud` modebar button. When clicked, the button will send the chart data to this URL.",
283- "dflt": "",
283+ "dflt": "https://cloud.plotly.com/upload ",
284284 "valType": "string"
285285 },
286286 "queueLength": {
You can’t perform that action at this time.
0 commit comments