layout.pug 5.1 KB

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