layout.jade 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. doctype html
  2. html(itemscope, itemtype='http://schema.org/Product')
  3. block vars
  4. head
  5. script(type="text/javscript").
  6. // Stop superfish from loading
  7. window.similarproducts = true
  8. -if (typeof(gaExperiments) != "undefined")
  9. |!{gaExperiments}
  10. -if (typeof(title) == "undefined")
  11. title ShareLaTeX, the Online LaTeX Editor
  12. -else
  13. title= translate(title) + ' - ShareLaTeX, '+translate("online_latex_editor")
  14. link(rel="icon", href="/favicon.ico")
  15. link(rel='stylesheet', href='/stylesheets/style.css?fingerprint='+fingerprint('/stylesheets/style.css'))
  16. link(href="//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css",rel="stylesheet")
  17. if settings.i18n.subdomainLang
  18. each subdomainDetails in settings.i18n.subdomainLang
  19. link(rel="alternate", href=subdomainDetails.url+currentUrl, hreflang=subdomainDetails.lngCode)
  20. meta(itemprop="name", content="ShareLaTeX, the Online LaTeX Editor")
  21. -if (typeof(meta) == "undefined")
  22. 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.")
  23. -else
  24. meta(itemprop="description", name="description" , content=meta)
  25. meta(itemprop="image", name="image", content="https://www.sharelatex.com/favicon.ico")
  26. - if (typeof(gaToken) != "undefined")
  27. script(type='text/javascript').
  28. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  29. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  30. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  31. })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  32. ga('create', '#{gaToken}', 'sharelatex.com');
  33. ga('send', 'pageview');
  34. - else
  35. script(type='text/javascript').
  36. window.ga = function() { console.log("Sending to GA", arguments) };
  37. script(type="text/javascript").
  38. window.csrfToken = "#{csrfToken}";
  39. block scripts
  40. script(src="#{jsPath}libs/jquery-1.11.1.min.js")
  41. script(src="#{jsPath}libs/angular-1.3.0-beta.14.min.js")
  42. - if (typeof(sentrySrc) != "undefined")
  43. - if (sentrySrc.match(/^([a-z]+:)?\/\//i))
  44. script(src="#{sentrySrc}")
  45. - else
  46. script(src="#{jsPath}libs/#{sentrySrc}")
  47. - if (typeof(sentrySrc) != "undefined")
  48. script(type="text/javascript").
  49. if (typeof(Raven) != "undefined" && Raven.config) {
  50. Raven.config("#{sentryPublicDSN}", {
  51. // Ignore list based off: https://gist.github.com/1878283
  52. ignoreErrors: [
  53. 'DealPly',
  54. // Random plugins/extensions
  55. 'top.GLOBALS',
  56. // See: http://blog.errorception.com/2012/03/tale-of-unfindable-js-error.html
  57. 'originalCreateNotification',
  58. 'canvas.contentDocument',
  59. 'MyApp_RemoveAllHighlights',
  60. 'http://tt.epicplay.com',
  61. 'Can\'t find variable: ZiteReader',
  62. 'jigsaw is not defined',
  63. 'ComboSearch is not defined',
  64. 'http://loading.retry.widdit.com/',
  65. 'atomicFindClose',
  66. // Facebook borked
  67. 'fb_xd_fragment',
  68. // ISP optimizing proxy - `Cache-Control: no-transform` seems to reduce this. (thanks @acdha)
  69. // See http://stackoverflow.com/questions/4113268/how-to-stop-javascript-injection-from-vodafone-proxy
  70. 'bmi_SafeAddOnload',
  71. 'EBCallBackMessageReceived',
  72. // See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx
  73. 'conduitPage'
  74. ],
  75. ignoreUrls: [
  76. // Facebook flakiness
  77. /graph\.facebook\.com/i,
  78. // Facebook blocked
  79. /connect\.facebook\.net\/en_US\/all\.js/i,
  80. // Woopra flakiness
  81. /eatdifferent\.com\.woopra-ns\.com/i,
  82. /static\.woopra\.com\/js\/woopra\.js/i,
  83. // Chrome extensions
  84. /extensions\//i,
  85. /^chrome:\/\//i,
  86. // Other plugins
  87. /127\.0\.0\.1:4001\/isrunning/i, // Cacaoweb
  88. /webappstoolbarba\.texthelp\.com\//i,
  89. /metrics\.itunes\.apple\.com\.edgesuite\.net\//i,
  90. /a\.disquscdn\.com/i,
  91. /platform\.twitter\.com/i,
  92. /pstatic\.datafastguru\.info/i
  93. ],
  94. shouldSendCallback: function(data) {
  95. // only send a fraction of errors
  96. var sampleRate = 1.00;
  97. return (Math.random() <= sampleRate);
  98. }
  99. // we highly recommend restricting exceptions to a domain in order to filter out clutter
  100. // whitelistUrls: ['example.com/scripts/']
  101. }).install();
  102. }
  103. - if (typeof(user) != "undefined" && typeof (user.email) != "undefined")
  104. script(type="text/javascript").
  105. if (typeof(Raven) != "undefined" && Raven.setUserContext) {
  106. Raven.setUserContext({email: '#{user.email}'});
  107. }
  108. script.
  109. window.sharelatex = {
  110. siteUrl: '#{settings.siteUrl}',
  111. jsPath: '#{jsPath}'
  112. };
  113. window.systemMessages = !{JSON.stringify(systemMessages).replace(/\//g, '\\/')};
  114. window.ab = {}
  115. - if (typeof(settings.algolia) != "undefined")
  116. script.
  117. window.sharelatex.algolia = {
  118. app_id:'#{settings.algolia.app_id}',
  119. api_key:'#{settings.algolia.read_only_api_key}',
  120. indexes:!{JSON.stringify(settings.algolia.indexes)}
  121. }
  122. - if (typeof(settings.templates) != "undefined")
  123. script.
  124. window.sharelatex.templates = {
  125. user_id : '!{settings.templates.user_id}',
  126. cdnDomain : '!{settings.templates.cdnDomain}',
  127. indexName : '!{settings.templates.indexName}'
  128. }
  129. body
  130. - if(typeof(suppressSystemMessages) == "undefined")
  131. .system-messages(
  132. ng-cloak
  133. ng-controller="SystemMessagesController"
  134. )
  135. .system-message(
  136. ng-repeat="message in messages"
  137. ng-controller="SystemMessageController"
  138. ng-hide="hidden"
  139. )
  140. a(href, ng-click="hide()").pull-right &times;
  141. .system-message-content(ng-bind-html="htmlContent")
  142. include translations/translation_message
  143. - if(typeof(suppressNavbar) == "undefined")
  144. include layout/navbar
  145. block content
  146. div(ng-controller="AbTestController")
  147. - if(typeof(suppressFooter) == "undefined")
  148. include layout/footer
  149. - if (typeof(lookingForScribtex) != "undefined" && lookingForScribtex)
  150. span(ng-controller="ScribtexPopupController")
  151. include scribtex-modal
  152. - if(typeof(suppressFooter) == "undefined")
  153. script(type='text/javascript').
  154. window.requirejs = {
  155. "urlArgs" : "fingerprint=#{fingerprint(jsPath + 'main.js')}-#{fingerprint(jsPath + 'libs.js')}",
  156. "paths" : {
  157. "moment": "libs/moment-2.7.0"
  158. }
  159. };
  160. script(
  161. data-main=jsPath+'main.js',
  162. baseurl=jsPath,
  163. src=jsPath+'libs/require.js?fingerprint='+fingerprint(jsPath + 'libs/require.js')
  164. )
  165. - if (typeof(tenderUrl) != "undefined")
  166. script(src="https://#{tenderUrl}/tender_widget.js" )
  167. script(type="text/javascript").
  168. Tender = {
  169. hideToggle: true,
  170. widgetToggles: $(".js-tender-widget"),
  171. category: "questions"
  172. };