layout.jade 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. 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='#{translate("site_description")}')
  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("would send 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. !{ session.user ? 'Countly.device_id = "' + session.user._id + '";' : '' }
  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. script(type="text/javascript")
  57. if (session && session.user)
  58. - var name = session.user.first_name + (session.user.last_name ? ' ' + session.user.last_name : '');
  59. | Countly.q.push(['user_details', { email: '#{session.user.email}', name: '#{name}' }]);
  60. if (justRegistered)
  61. | Countly.q.push(['add_event',{ key: 'user-registered' }]);
  62. if (justLoggedIn)
  63. | Countly.q.push(['add_event',{ key: 'user-logged-in' }]);
  64. if (user && user.features)
  65. - featureFlagSet = false;
  66. if user.features.hasOwnProperty('collaborators')
  67. | Countly.q.push([ 'userData.set', 'features-collaborators', #{ user.features.collaborators } ]);
  68. - featureFlagSet = true;
  69. if user.features.hasOwnProperty('compileGroup')
  70. | Countly.q.push([ 'userData.set', 'features-compileGroup', '#{ user.features.compileGroup }' ]);
  71. - featureFlagSet = true;
  72. if user.features.hasOwnProperty('compileTimeout')
  73. | Countly.q.push([ 'userData.set', 'features-compileTimeout', #{ user.features.compileTimeout } ]);
  74. - featureFlagSet = true;
  75. if user.features.hasOwnProperty('dropbox')
  76. | Countly.q.push([ 'userData.set', 'features-dropbox', #{ user.features.dropbox } ]);
  77. - featureFlagSet = true;
  78. if user.features.hasOwnProperty('github')
  79. | Countly.q.push([ 'userData.set', 'features-github', #{ user.features.github } ]);
  80. - featureFlagSet = true;
  81. if user.features.hasOwnProperty('references')
  82. | Countly.q.push([ 'userData.set', 'features-references', #{ user.features.references } ]);
  83. - featureFlagSet = true;
  84. if user.features.hasOwnProperty('templates')
  85. | Countly.q.push([ 'userData.set', 'features-templates', #{ user.features.templates } ]);
  86. - featureFlagSet = true;
  87. if user.features.hasOwnProperty('versioning')
  88. | Countly.q.push([ 'userData.set', 'features-versioning', #{ user.features.versioning } ]);
  89. - featureFlagSet = true;
  90. if featureFlagSet
  91. | Countly.q.push(['userData.save'])
  92. // End countly Analytics
  93. script(type="text/javascript").
  94. window.csrfToken = "#{csrfToken}";
  95. block scripts
  96. script(src=buildJsPath("libs/jquery-1.11.1.min.js", {fingerprint:false}))
  97. script(src=buildJsPath("libs/angular-1.3.15.min.js", {fingerprint:false}))
  98. script.
  99. window.sharelatex = {
  100. siteUrl: '#{settings.siteUrl}',
  101. jsPath: '#{jsPath}',
  102. sixpackDomain: '#{settings.sixpack.domain}'
  103. };
  104. window.systemMessages = !{JSON.stringify(systemMessages).replace(/\//g, '\\/')};
  105. window.ab = {};
  106. window.user_id = '#{getLoggedInUserId()}';
  107. - if (typeof(settings.algolia) != "undefined")
  108. script.
  109. window.sharelatex.algolia = {
  110. app_id:'#{settings.algolia.app_id}',
  111. api_key:'#{settings.algolia.read_only_api_key}',
  112. indexes:!{JSON.stringify(settings.algolia.indexes)}
  113. }
  114. - if (typeof(settings.templates) != "undefined")
  115. script.
  116. window.sharelatex.templates = {
  117. user_id : '!{settings.templates.user_id}',
  118. cdnDomain : '!{settings.templates.cdnDomain}',
  119. indexName : '!{settings.templates.indexName}'
  120. }
  121. body
  122. - if(typeof(suppressSystemMessages) == "undefined")
  123. .system-messages(
  124. ng-cloak
  125. ng-controller="SystemMessagesController"
  126. )
  127. .system-message(
  128. ng-repeat="message in messages"
  129. ng-controller="SystemMessageController"
  130. ng-hide="hidden"
  131. )
  132. a(href, ng-click="hide()").pull-right ×
  133. .system-message-content(ng-bind-html="htmlContent")
  134. include translations/translation_message
  135. - if(typeof(suppressNavbar) == "undefined")
  136. include layout/navbar
  137. block content
  138. div(ng-controller="AbTestController")
  139. - if(typeof(suppressFooter) == "undefined")
  140. include layout/footer
  141. - if (typeof(lookingForScribtex) != "undefined" && lookingForScribtex)
  142. span(ng-controller="ScribtexPopupController")
  143. include scribtex-modal
  144. - if(typeof(suppressFooter) == "undefined")
  145. script(type='text/javascript').
  146. window.requirejs = {
  147. "urlArgs" : "fingerprint=#{fingerprint(jsPath + 'main.js')}-#{fingerprint(jsPath + 'libs.js')}",
  148. "paths" : {
  149. "moment": "libs/moment-2.7.0"
  150. }
  151. };
  152. script(
  153. data-main=buildJsPath('main.js'),
  154. baseurl=fullJsPath,
  155. src=buildJsPath('libs/require.js')
  156. )
  157. include contact-us-modal
  158. include sentry