index.template 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <button id="install" style="display:none;" 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. }).show();
  25. };
  26. };
  27. })(navigator.mozApps.checkInstalled(location.origin+"/bugs.webapp"));
  28. }
  29. </script>
  30. <h3>
  31. Welcome to Bugs
  32. </h3>
  33. <p>
  34. Bugs is a project issue tracker.
  35. </p>
  36. {{#if key}}
  37. <a class="button" href="#page-projects">
  38. Projects
  39. </a>
  40. <a class="button" href="#page-issues">
  41. Issues
  42. </a>
  43. <a class="button" href="#page-users">
  44. Users
  45. </a>
  46. {{else}}
  47. <a class="button" href="#page-register">
  48. Register
  49. </a>
  50. <a class="button" href="#page-login">
  51. Login
  52. </a>
  53. {{/if}}