layout.pug 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. block _headLinks
  18. if settings.i18n.subdomainLang
  19. each subdomainDetails in settings.i18n.subdomainLang
  20. if !subdomainDetails.hide
  21. link(rel="alternate", href=subdomainDetails.url+currentUrl, hreflang=subdomainDetails.lngCode)
  22. meta(itemprop="name", content="ShareLaTeX, the Online LaTeX Editor")
  23. -if (typeof(meta) == "undefined")
  24. meta(itemprop="description", name="description", content=translate("site_description"))
  25. -else
  26. meta(itemprop="description", name="description" , content=meta)
  27. meta(itemprop="image", name="image", content="https://www.sharelatex.com/favicon.ico")
  28. - if (typeof(gaToken) != "undefined")
  29. script(type='text/javascript').
  30. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  31. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  32. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  33. })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  34. ga('create', '#{gaToken}', 'sharelatex.com');
  35. ga('send', 'pageview');
  36. - else
  37. script(type='text/javascript').
  38. window.ga = function() { console.log("would send to GA", arguments) };
  39. script(type="text/javascript").
  40. window.csrfToken = "#{csrfToken}";
  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 && navigator.userAgent.indexOf("Googlebot") == -1) {
  47. window.location.search += '&'+noCdnKey;
  48. }
  49. block scripts
  50. script(src=buildJsPath("libs/angular-1.3.15.min.js", {fingerprint:false}))
  51. script.
  52. window.sharelatex = {
  53. siteUrl: '#{settings.siteUrl}',
  54. jsPath: '#{jsPath}',
  55. sixpackDomain: '#{settings.sixpack.domain}'
  56. };
  57. window.systemMessages = !{JSON.stringify(systemMessages).replace(/\//g, '\\/')};
  58. window.ab = {};
  59. window.user_id = '#{getLoggedInUserId()}';
  60. - if (typeof(settings.algolia) != "undefined")
  61. script.
  62. window.sharelatex.algolia = {
  63. app_id:'#{settings.algolia.app_id}',
  64. api_key:'#{settings.algolia.read_only_api_key}',
  65. indexes:!{JSON.stringify(settings.algolia.indexes)}
  66. }
  67. - if (typeof(settings.templates) != "undefined")
  68. script.
  69. window.sharelatex.templates = {
  70. user_id : '!{settings.templates.user_id}',
  71. cdnDomain : '!{settings.templates.cdnDomain}',
  72. indexName : '!{settings.templates.indexName}'
  73. }
  74. body
  75. - if(typeof(suppressSystemMessages) == "undefined")
  76. .system-messages(
  77. ng-cloak
  78. ng-controller="SystemMessagesController"
  79. )
  80. .system-message(
  81. ng-repeat="message in messages"
  82. ng-controller="SystemMessageController"
  83. ng-hide="hidden"
  84. )
  85. a(href, ng-click="hide()").pull-right ×
  86. .system-message-content(ng-bind-html="htmlContent")
  87. include translations/translation_message
  88. - if(typeof(suppressNavbar) == "undefined")
  89. include layout/navbar
  90. block content
  91. div(ng-controller="AbTestController")
  92. - if(typeof(suppressFooter) == "undefined")
  93. include layout/footer
  94. - if (typeof(lookingForScribtex) != "undefined" && lookingForScribtex)
  95. span(ng-controller="ScribtexPopupController")
  96. include scribtex-modal
  97. block requirejs
  98. script(type='text/javascript').
  99. // minimal requirejs configuration (can be extended/overridden)
  100. window.requirejs = {
  101. "paths" : {
  102. "moment": "libs/#{lib('moment')}"
  103. },
  104. "urlArgs": "fingerprint=#{fingerprint(jsPath + 'main.js')}-#{fingerprint(jsPath + 'libs.js')}",
  105. "config":{
  106. "moment":{
  107. "noGlobal": true
  108. }
  109. }
  110. };
  111. script(
  112. data-main=buildJsPath('main.js', {fingerprint:false}),
  113. baseurl=fullJsPath,
  114. src=buildJsPath('libs/require.js')
  115. )
  116. include contact-us-modal
  117. include sentry