layout.jade 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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(type="text/javascript").
  43. var noCdnKey = "nocdn=true"
  44. var cdnBlocked = typeof jQuery === 'undefined'
  45. var noCdnAlreadyInUrl = window.location.href.indexOf(noCdnKey) != -1 //prevent loops
  46. if (cdnBlocked && !noCdnAlreadyInUrl) {
  47. window.location.search += '&'+noCdnKey;
  48. }
  49. script(src=buildJsPath("libs/angular-1.3.15.min.js", {fingerprint:false}))
  50. script.
  51. window.sharelatex = {
  52. siteUrl: '#{settings.siteUrl}',
  53. jsPath: '#{jsPath}',
  54. sixpackDomain: '#{settings.sixpack.domain}'
  55. };
  56. window.systemMessages = !{JSON.stringify(systemMessages).replace(/\//g, '\\/')};
  57. window.ab = {};
  58. window.user_id = '#{getLoggedInUserId()}';
  59. - if (typeof(settings.algolia) != "undefined")
  60. script.
  61. window.sharelatex.algolia = {
  62. app_id:'#{settings.algolia.app_id}',
  63. api_key:'#{settings.algolia.read_only_api_key}',
  64. indexes:!{JSON.stringify(settings.algolia.indexes)}
  65. }
  66. - if (typeof(settings.templates) != "undefined")
  67. script.
  68. window.sharelatex.templates = {
  69. user_id : '!{settings.templates.user_id}',
  70. cdnDomain : '!{settings.templates.cdnDomain}',
  71. indexName : '!{settings.templates.indexName}'
  72. }
  73. body
  74. - if(typeof(suppressSystemMessages) == "undefined")
  75. .system-messages(
  76. ng-cloak
  77. ng-controller="SystemMessagesController"
  78. )
  79. .system-message(
  80. ng-repeat="message in messages"
  81. ng-controller="SystemMessageController"
  82. ng-hide="hidden"
  83. )
  84. a(href, ng-click="hide()").pull-right ×
  85. .system-message-content(ng-bind-html="htmlContent")
  86. include translations/translation_message
  87. - if(typeof(suppressNavbar) == "undefined")
  88. include layout/navbar
  89. block content
  90. div(ng-controller="AbTestController")
  91. - if(typeof(suppressFooter) == "undefined")
  92. include layout/footer
  93. - if (typeof(lookingForScribtex) != "undefined" && lookingForScribtex)
  94. span(ng-controller="ScribtexPopupController")
  95. include scribtex-modal
  96. - if(typeof(suppressFooter) == "undefined")
  97. script(type='text/javascript').
  98. window.requirejs = {
  99. "urlArgs" : "fingerprint=#{fingerprint(jsPath + 'main.js')}-#{fingerprint(jsPath + 'libs.js')}",
  100. "paths" : {
  101. "moment": "libs/moment-2.7.0"
  102. }
  103. };
  104. script(
  105. data-main=buildJsPath('main.js', {fingerprint:false}),
  106. baseurl=fullJsPath,
  107. src=buildJsPath('libs/require.js')
  108. )
  109. include contact-us-modal
  110. include sentry