index.template 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <button id="install" class="recommend">
  2. Install this App
  3. </button>
  4. <script>
  5. if('mozApps' in navigator){
  6. (function(ic){
  7. ic.onsuccess = function(){
  8. if(ic.result){
  9. $('button#install').hide();
  10. }else{
  11. $('button#install').click(function(e){
  12. e.preventDefault();
  13. // install the app
  14. var request = navigator.mozApps.install(location.origin+'/bugs.webapp');
  15. request.onsuccess = function(data){
  16. replaceState('page-index');
  17. };
  18. request.onerror = function(){
  19. // App wasn't installed, info is in
  20. // installapp.error.name
  21. error(request.error.name);
  22. };
  23. return false;
  24. });
  25. };
  26. };
  27. })(navigator.mozApps.checkInstalled(location.origin+"/bugs.webapp"));
  28. }else{
  29. $('button#install').hide();
  30. }
  31. </script>
  32. <h3>
  33. Welcome to Bugs
  34. </h3>
  35. <p>
  36. Bugs is a project issue tracker.
  37. </p>
  38. {{#if key}}
  39. <a class="button" href="#page-projects">
  40. Projects
  41. </a>
  42. <a class="button" href="#page-issues">
  43. Issues
  44. </a>
  45. <a class="button" href="#page-users">
  46. Users
  47. </a>
  48. {{else}}
  49. <a class="button" href="#page-register">
  50. Register
  51. </a>
  52. <a class="button" href="#page-login">
  53. Login
  54. </a>
  55. {{/if}}