-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wikihouse Extension not Downloading Models. Javascript error? #12
Comments
Found where the load fails in the Ruby end. The attempt to get the segment size for downloading in chunks fails here with Can you check the coffee script bellow to make sure this element id is created and that its value is set to the segment count required. From wikihouse / static / src / coffee / wikihouse.coffee wikihouse.download = (id, url) ->
# Grab the model data over ajax.
$.ajax
type: 'GET'
url: url
dataType: 'text'
success: (data) ->
# Set the data into the hidden textarea.
l = 1500000
i = 0
c = 0
loop
chunk = data.slice(c, c + l)
if chunk.length is 0
break
$target = $('#design-download-data-' + i);
$target.text(chunk)
c = c + l
i++
$('#design-download-data').text(i)
wikihouse.hideProgress()
# Inform SketchUp of the available data.
window.location = "skp:save@#{id}"
error: ->
wikihouse.hideProgress()
# Inform SketchUp of the failed download.
window.location = "skp:error@#{id}"```
|
Hi @MrKriss sorry for not replying on this sooner. Reading the code above, it looks fine and as long as the ajax call is successful then the text value of If I'm to have a go at debugging, can I just check the steps I need to take: basically load the extension into sketchup where sketchup is using chrome as the browser and then try and download a model? |
Hi @thruflo, Yes the error was generated from trying to load a wikihouse model from within Sketchup using the plugin. Though strangely, now I go back to the code I cant seem to be able to reproduce the exact error I was seeing! Before, the call to wikihouse.downloads via Ruby, However now, the wikihouse.download call simply fails, and the Interestingly though, the id is a number and not an empty string when parsed back to Ruby! I've added a few outputs to the console on my testing branch before and after some of the callbacks are run. Hopefully this will aid in debugging. The other thought I had was that it may be down to communication issues on the Mac version of Web Dialogues in particual. I found the following on points on synchronous vs asynchronous communication. Link. Do you think this could be part of the problem? Have yet to test this on a windows machine, so cant be certain this error crops up there as well. |
Hi thruflo, did you get a chance to look into the above? I am assuming you did as downloads via the web dialogues are now working! (as of Sketchup 2013 on mac anyway!) Cheers |
Hi thruflo, I'm currently looking into the above problem, and I think I have tracked the problem to the execution of a javascript function from within the extension code. Thing is I can't seem to find where the Javascript code is in the Website/Github repository.
The problem also seems to affect downloads using Chrome as well, though Firefox and safari are ok.
Could you point me in the direction of it so I can have a rummage around in the code?
Also, I'm a bit of a newbe at Web stuff and would appreciate some pointers on how to set up the site locally with Google App Engine so I can test any changes I make before committing them.
Cheers.
Chris
The text was updated successfully, but these errors were encountered: