layout.jade 6.5 KB

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