layout.jade 5.6 KB

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