layout.jade 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. doctype html
  2. html(itemscope, itemtype='http://schema.org/Product')
  3. block vars
  4. head
  5. script(type="text/javascript").
  6. // Stop superfish from loading
  7. window.similarproducts = true
  8. style [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {display: none !important; display: none; }
  9. -if (typeof(gaExperiments) != "undefined")
  10. |!{gaExperiments}
  11. -if (typeof(title) == "undefined")
  12. title= 'ShareLaTeX, '+ translate("online_latex_editor")
  13. -else
  14. title= translate(title) + ' - ShareLaTeX, ' + translate("online_latex_editor")
  15. link(rel="icon", href="/favicon.ico")
  16. link(rel='stylesheet', href=buildCssPath('/style.css'))
  17. if settings.i18n.subdomainLang
  18. each subdomainDetails in settings.i18n.subdomainLang
  19. if !subdomainDetails.hide
  20. link(rel="alternate", href=subdomainDetails.url+currentUrl, hreflang=subdomainDetails.lngCode)
  21. meta(itemprop="name", content="ShareLaTeX, the Online LaTeX Editor")
  22. -if (typeof(meta) == "undefined")
  23. meta(itemprop="description", name="description", content='#{translate("site_description")}')
  24. -else
  25. meta(itemprop="description", name="description" , content=meta)
  26. meta(itemprop="image", name="image", content="https://www.sharelatex.com/favicon.ico")
  27. - if (typeof(gaToken) != "undefined")
  28. script(type='text/javascript').
  29. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  30. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  31. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  32. })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  33. ga('create', '#{gaToken}', 'sharelatex.com');
  34. ga('send', 'pageview');
  35. - else
  36. script(type='text/javascript').
  37. window.ga = function() { console.log("would send to GA", arguments) };
  38. script(type="text/javascript").
  39. window.csrfToken = "#{csrfToken}";
  40. block scripts
  41. script(src=buildJsPath("libs/jquery-1.11.1.min.js", {fingerprint:false}))
  42. script(src=buildJsPath("libs/angular-1.3.15.min.js", {fingerprint:false}))
  43. script.
  44. window.sharelatex = {
  45. siteUrl: '#{settings.siteUrl}',
  46. jsPath: '#{jsPath}',
  47. sixpackDomain: '#{settings.sixpack.domain}'
  48. };
  49. window.systemMessages = !{JSON.stringify(systemMessages).replace(/\//g, '\\/')};
  50. window.ab = {};
  51. window.user_id = '#{getLoggedInUserId()}';
  52. - if (typeof(settings.algolia) != "undefined")
  53. script.
  54. window.sharelatex.algolia = {
  55. app_id:'#{settings.algolia.app_id}',
  56. api_key:'#{settings.algolia.read_only_api_key}',
  57. indexes:!{JSON.stringify(settings.algolia.indexes)}
  58. }
  59. - if (typeof(settings.templates) != "undefined")
  60. script.
  61. window.sharelatex.templates = {
  62. user_id : '!{settings.templates.user_id}',
  63. cdnDomain : '!{settings.templates.cdnDomain}',
  64. indexName : '!{settings.templates.indexName}'
  65. }
  66. body
  67. - if(typeof(suppressSystemMessages) == "undefined")
  68. .system-messages(
  69. ng-cloak
  70. ng-controller="SystemMessagesController"
  71. )
  72. .system-message(
  73. ng-repeat="message in messages"
  74. ng-controller="SystemMessageController"
  75. ng-hide="hidden"
  76. )
  77. a(href, ng-click="hide()").pull-right ×
  78. .system-message-content(ng-bind-html="htmlContent")
  79. include translations/translation_message
  80. - if(typeof(suppressNavbar) == "undefined")
  81. include layout/navbar
  82. block content
  83. div(ng-controller="AbTestController")
  84. - if(typeof(suppressFooter) == "undefined")
  85. include layout/footer
  86. - if (typeof(lookingForScribtex) != "undefined" && lookingForScribtex)
  87. span(ng-controller="ScribtexPopupController")
  88. include scribtex-modal
  89. - if(typeof(suppressFooter) == "undefined")
  90. script(type='text/javascript').
  91. window.requirejs = {
  92. "urlArgs" : "fingerprint=#{fingerprint(jsPath + 'main.js')}-#{fingerprint(jsPath + 'libs.js')}",
  93. "paths" : {
  94. "moment": "libs/moment-2.7.0"
  95. }
  96. };
  97. script(
  98. data-main=buildJsPath('main.js', {fingerprint:false}),
  99. baseurl=fullJsPath,
  100. src=buildJsPath('libs/require.js')
  101. )
  102. include contact-us-modal
  103. include sentry