Unity Web API Documentation code snippets don't work

Bug #1035581 reported by mark johnson
34
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Ubuntu Developer Portal
Invalid
High
Michael Hall
WebApps: Applications Data
Invalid
Medium
Alexandre Abreu

Bug Description

What I did:
Accessed the Web API documentation[1] on Ubuntu 12.04, with unity-webapps-preview installed, using both Chromium and Firefox
Clicked the "Try Executing this code now" link for each snippet in turn, from top to bottom

What I expected to happen:
The launcher Icon appears
A notification is displayed
An entry is added to the media menu
An entry is added to the HUD
An Entry is added to the messaging menu
A quicklist and indicators are added to the launcher icon

What happened instead:
The launcher icon appears
All subsequent links clicked appear to have no effect.
The following error is logged ot the console with each click: "ReferenceError: Unity is not defined"
In addition, clicking the first link (Unity.init) in Chromium caused the attached console output.

[1] http://developer.ubuntu.com/api/ubuntu-12.04/javascript/index.html

Revision history for this message
mark johnson (mark.johnson) wrote :
visibility: private → public
Revision history for this message
mark johnson (mark.johnson) wrote :

I've just installed Ubuntu 12.10 on another machine, and the problem still occurs.

Revision history for this message
Vojtěch Trefný (vojtech.trefny) wrote :

Same problem here.

Ubuntu 12.10, libunity-webapps0 2.4.1-0ubuntu3

Changed in webapps-applications:
status: New → Confirmed
Maxim Ermilov (zaspire)
Changed in webapps-applications:
assignee: nobody → Alexandre Abreu (abreu-alexandre)
Revision history for this message
Alan Bell (alanbell) wrote :

there is a hidden web page I discovered that doesn't appear to be navigable to from the developer portal, but has working code on it
http://developer.ubuntu.com/api/ubuntu-12.10/javascript/uwapi-ref.html

It does mean that you can't write a webapp and target 12.04 and 12.10 with it unless you wrap the webapps API with some compatibility layer because there are now two incompatible versions of the API with the same version number in the init call.

Revision history for this message
Alan Bell (alanbell) wrote :

maybe the changes have been implemented in 12.04 as well if it doesn't work there too now. I know they used to work at some point. It is actually a lot better situation if the 12.04 documentation doesn't work in 12.04 either and there is one consistent API for both versions of Ubuntu and we can write webapps just to the 12.10 API.

Revision history for this message
Alex Launi (alexlauni) wrote :

Webapps aren't supported in 12.04. 12.10 is the first release for which the API is supported. 12.04 was a tech preview.

Changed in webapps-applications:
assignee: Alexandre Abreu (abreu-alexandre) → Alex Launi (alexlauni)
importance: Undecided → Medium
Revision history for this message
Alan Bell (alanbell) wrote :

Unity.Notification.showNotification("Attention", "Lorem ipsum dolor sit amet");
that still does not work because this version of the API requires three parameters to Unity.Notification.showNotification
the documentation is now at:
http://developer.ubuntu.com/api/devel/ubuntu-13.10/javascript/web-docs/
so it was working in 12.04, then the api changed in 12.10 but the docs were not fixed, then they were not updated for 13.04 and then they were not updated for 13.10 and now they are still wrong as 14.04 is about to come out :/
This is the hello world bit of the API, if that doesn't work nobody is going to get any further with it.

Revision history for this message
David Barth (dbarth) wrote :

Yes, this is annoying, Thanks for bringing that up again. This needs to be cleaned for the App Showdown.

KyleN: can you help when reviewing updates to the dev. site with Michael
Alex for advice on how best to fix

tags: added: html5-blocker
Changed in ubuntudeveloperportal:
assignee: nobody → Kyle Nitzsche (knitzsche)
Changed in webapps-applications:
assignee: Alex Launi (alexlauni) → Alexandre Abreu (abreu-alexandre)
Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

Mike, can you take a look at the dev portal side of this? thx

Changed in ubuntudeveloperportal:
assignee: Kyle Nitzsche (knitzsche) → Michael Hall (mhall119)
tags: removed: html5-blocker
Michael Hall (mhall119)
Changed in ubuntudeveloperportal:
status: New → Triaged
importance: Undecided → High
tags: added: webapps
David Barth (dbarth)
tags: added: html5-sdk-hotlist
tags: added: html5-hotlist
removed: html5-sdk-hotlist
Revision history for this message
Daniel Holbach (dholbach) wrote :

The pages don't exist any more.

Changed in ubuntudeveloperportal:
status: Triaged → Invalid
Changed in webapps-applications:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.