layout.jade 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. 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="An online LaTeX editor that's easy to use. No installation, real-time collaboration, version control, hundreds of LaTeX templates, and more.")
  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("Sending to GA", arguments) };
  38. // Countly Analytics
  39. if (settings.analytics && settings.analytics.countly && settings.analytics.countly.token)
  40. script(type="text/javascript").
  41. var Countly = Countly || {};
  42. Countly.q = Countly.q || [];
  43. Countly.app_key = '#{settings.analytics.countly.token}';
  44. Countly.url = '#{settings.analytics.countly.server}';
  45. Countly.q.push(['track_sessions']);
  46. Countly.q.push(['track_pageview']);
  47. (function() {
  48. var cly = document.createElement('script'); cly.type = 'text/javascript';
  49. cly.async = true;
  50. //enter url of script here
  51. cly.src = 'https://cdnjs.cloudflare.com/ajax/libs/countly-sdk-web/16.6.0/countly.min.js';
  52. cly.onload = function(){Countly.init()};
  53. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(cly, s);
  54. })();
  55. if (session && session.user)
  56. script(type="text/javascript").
  57. Countly.q.push(['change_id', '#{session.user._id}', true ]);
  58. Countly.q.push(['user_details', {
  59. email: '#{session.user.email}',
  60. custom: {
  61. userId: '#{session.user._id}',
  62. }
  63. }]);
  64. if (justRegistered)
  65. script(type="text/javascript").
  66. Countly.q.push(['add_event',{
  67. key: 'user-registered'
  68. }]);
  69. if (justLoggedIn)
  70. script(type="text/javascript").
  71. Countly.q.push(['add_event',{
  72. key: 'user-logged-in'
  73. }]);
  74. // End countly Analytics
  75. script(type="text/javascript").
  76. window.csrfToken = "#{csrfToken}";
  77. block scripts
  78. script(src="#{jsPath}libs/jquery-1.11.1.min.js")
  79. script(src="#{jsPath}libs/angular-1.3.15.min.js")
  80. script.
  81. window.sharelatex = {
  82. siteUrl: '#{settings.siteUrl}',
  83. jsPath: '#{jsPath}',
  84. sixpackDomain: '#{settings.sixpack.domain}'
  85. };
  86. window.systemMessages = !{JSON.stringify(systemMessages).replace(/\//g, '\\/')};
  87. window.ab = {};
  88. window.user_id = '#{getLoggedInUserId()}';
  89. - if (typeof(settings.algolia) != "undefined")
  90. script.
  91. window.sharelatex.algolia = {
  92. app_id:'#{settings.algolia.app_id}',
  93. api_key:'#{settings.algolia.read_only_api_key}',
  94. indexes:!{JSON.stringify(settings.algolia.indexes)}
  95. }
  96. - if (typeof(settings.templates) != "undefined")
  97. script.
  98. window.sharelatex.templates = {
  99. user_id : '!{settings.templates.user_id}',
  100. cdnDomain : '!{settings.templates.cdnDomain}',
  101. indexName : '!{settings.templates.indexName}'
  102. }
  103. body
  104. - if(typeof(suppressSystemMessages) == "undefined")
  105. .system-messages(
  106. ng-cloak
  107. ng-controller="SystemMessagesController"
  108. )
  109. .system-message(
  110. ng-repeat="message in messages"
  111. ng-controller="SystemMessageController"
  112. ng-hide="hidden"
  113. )
  114. a(href, ng-click="hide()").pull-right ×
  115. .system-message-content(ng-bind-html="htmlContent")
  116. include translations/translation_message
  117. - if(typeof(suppressNavbar) == "undefined")
  118. include layout/navbar
  119. block content
  120. div(ng-controller="AbTestController")
  121. - if(typeof(suppressFooter) == "undefined")
  122. include layout/footer
  123. - if (typeof(lookingForScribtex) != "undefined" && lookingForScribtex)
  124. span(ng-controller="ScribtexPopupController")
  125. include scribtex-modal
  126. - if(typeof(suppressFooter) == "undefined")
  127. script(type='text/javascript').
  128. window.requirejs = {
  129. "urlArgs" : "fingerprint=#{fingerprint(jsPath + 'main.js')}-#{fingerprint(jsPath + 'libs.js')}",
  130. "paths" : {
  131. "moment": "libs/moment-2.7.0"
  132. }
  133. };
  134. script(
  135. data-main=jsPath+'main.js',
  136. baseurl=jsPath,
  137. src=jsPath+'libs/require.js?fingerprint='+fingerprint(jsPath + 'libs/require.js')
  138. )
  139. include contact-us-modal
  140. include sentry