layout.jade 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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, the 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='/stylesheets/style.css?fingerprint='+fingerprint('/stylesheets/style.css'))
  17. link(href="//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css",rel="stylesheet")
  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="An online LaTeX editor that's easy to use. No installation, real-time collaboration, version control, hundreds of LaTeX templates, and more.")
  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("Sending to GA", arguments) };
  39. // Heap Analytics
  40. if (settings.analytics && settings.analytics.heap && session && session.user)
  41. script(type="text/javascript").
  42. window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var n=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(n?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(a,o);for(var r=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["clearEventProperties","identify","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=r(p[c])};
  43. heap.load("#{settings.analytics.heap.token}");
  44. script(type="text/javascript").
  45. heap.identify({
  46. handle: "#{session.user._id}",
  47. email: "#{session.user.email}",
  48. })
  49. // End Heap Analytics
  50. // Countly Analytics
  51. if (settings.analytics && settings.analytics.countly && settings.analytics.countly.token)
  52. script(type="text/javascript").
  53. var Countly = Countly || {};
  54. Countly.q = Countly.q || [];
  55. Countly.app_key = "#{settings.analytics.countly.token}";
  56. Countly.url = "https://try.count.ly";
  57. Countly.q.push(['track_sessions']);
  58. Countly.q.push(['track_pageview']);
  59. (function() {
  60. var cly = document.createElement('script'); cly.type = 'text/javascript';
  61. cly.async = true;
  62. //enter url of script here
  63. cly.src = 'https://cdnjs.cloudflare.com/ajax/libs/countly-sdk-web/16.6.0/countly.min.js';
  64. cly.onload = function(){Countly.init()};
  65. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(cly, s);
  66. })();
  67. // End countly Analytics
  68. script(type="text/javascript").
  69. window.csrfToken = "#{csrfToken}";
  70. block scripts
  71. script(src="#{jsPath}libs/jquery-1.11.1.min.js")
  72. script(src="#{jsPath}libs/angular-1.3.15.min.js")
  73. script.
  74. window.sharelatex = {
  75. siteUrl: '#{settings.siteUrl}',
  76. jsPath: '#{jsPath}',
  77. sixpackDomain: '#{settings.sixpack.domain}'
  78. };
  79. window.systemMessages = !{JSON.stringify(systemMessages).replace(/\//g, '\\/')};
  80. window.ab = {};
  81. window.user_id = '#{getLoggedInUserId()}';
  82. - if (typeof(settings.algolia) != "undefined")
  83. script.
  84. window.sharelatex.algolia = {
  85. app_id:'#{settings.algolia.app_id}',
  86. api_key:'#{settings.algolia.read_only_api_key}',
  87. indexes:!{JSON.stringify(settings.algolia.indexes)}
  88. }
  89. - if (typeof(settings.templates) != "undefined")
  90. script.
  91. window.sharelatex.templates = {
  92. user_id : '!{settings.templates.user_id}',
  93. cdnDomain : '!{settings.templates.cdnDomain}',
  94. indexName : '!{settings.templates.indexName}'
  95. }
  96. body
  97. - if(typeof(suppressSystemMessages) == "undefined")
  98. .system-messages(
  99. ng-cloak
  100. ng-controller="SystemMessagesController"
  101. )
  102. .system-message(
  103. ng-repeat="message in messages"
  104. ng-controller="SystemMessageController"
  105. ng-hide="hidden"
  106. )
  107. a(href, ng-click="hide()").pull-right &times;
  108. .system-message-content(ng-bind-html="htmlContent")
  109. include translations/translation_message
  110. - if(typeof(suppressNavbar) == "undefined")
  111. include layout/navbar
  112. block content
  113. div(ng-controller="AbTestController")
  114. - if(typeof(suppressFooter) == "undefined")
  115. include layout/footer
  116. - if (typeof(lookingForScribtex) != "undefined" && lookingForScribtex)
  117. span(ng-controller="ScribtexPopupController")
  118. include scribtex-modal
  119. - if(typeof(suppressFooter) == "undefined")
  120. script(type='text/javascript').
  121. window.requirejs = {
  122. "urlArgs" : "fingerprint=#{fingerprint(jsPath + 'main.js')}-#{fingerprint(jsPath + 'libs.js')}",
  123. "paths" : {
  124. "moment": "libs/moment-2.7.0"
  125. }
  126. };
  127. script(
  128. data-main=jsPath+'main.js',
  129. baseurl=jsPath,
  130. src=jsPath+'libs/require.js?fingerprint='+fingerprint(jsPath + 'libs/require.js')
  131. )
  132. include contact-us-modal
  133. include sentry