layout.jade 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. dataCallback: function(data) {
  100. // remove circular references from object
  101. var cache = [];
  102. var s = JSON.stringify(data, function(k, v) { if (typeof v === 'object' && v !== null) { if (cache.indexOf(v) !== -1) return "[circular]"; cache.push(v); }; return v; });
  103. return JSON.parse(s);
  104. }
  105. // we highly recommend restricting exceptions to a domain in order to filter out clutter
  106. // whitelistUrls: ['example.com/scripts/']
  107. }).install();
  108. }
  109. - if (typeof(user) != "undefined" && typeof (user.email) != "undefined")
  110. script(type="text/javascript").
  111. if (typeof(Raven) != "undefined" && Raven.setUserContext) {
  112. Raven.setUserContext({email: '#{user.email}'});
  113. }
  114. script.
  115. window.sharelatex = {
  116. siteUrl: '#{settings.siteUrl}',
  117. jsPath: '#{jsPath}'
  118. };
  119. window.systemMessages = !{JSON.stringify(systemMessages).replace(/\//g, '\\/')};
  120. window.ab = {}
  121. - if (typeof(settings.algolia) != "undefined")
  122. script.
  123. window.sharelatex.algolia = {
  124. app_id:'#{settings.algolia.app_id}',
  125. api_key:'#{settings.algolia.read_only_api_key}',
  126. indexes:!{JSON.stringify(settings.algolia.indexes)}
  127. }
  128. - if (typeof(settings.templates) != "undefined")
  129. script.
  130. window.sharelatex.templates = {
  131. user_id : '!{settings.templates.user_id}',
  132. cdnDomain : '!{settings.templates.cdnDomain}',
  133. indexName : '!{settings.templates.indexName}'
  134. }
  135. body
  136. - if(typeof(suppressSystemMessages) == "undefined")
  137. .system-messages(
  138. ng-cloak
  139. ng-controller="SystemMessagesController"
  140. )
  141. .system-message(
  142. ng-repeat="message in messages"
  143. ng-controller="SystemMessageController"
  144. ng-hide="hidden"
  145. )
  146. a(href, ng-click="hide()").pull-right &times;
  147. .system-message-content(ng-bind-html="htmlContent")
  148. include translations/translation_message
  149. - if(typeof(suppressNavbar) == "undefined")
  150. include layout/navbar
  151. block content
  152. div(ng-controller="AbTestController")
  153. - if(typeof(suppressFooter) == "undefined")
  154. include layout/footer
  155. - if (typeof(lookingForScribtex) != "undefined" && lookingForScribtex)
  156. span(ng-controller="ScribtexPopupController")
  157. include scribtex-modal
  158. - if(typeof(suppressFooter) == "undefined")
  159. script(type='text/javascript').
  160. window.requirejs = {
  161. "urlArgs" : "fingerprint=#{fingerprint(jsPath + 'main.js')}-#{fingerprint(jsPath + 'libs.js')}",
  162. "paths" : {
  163. "moment": "libs/moment-2.7.0"
  164. }
  165. };
  166. script(
  167. data-main=jsPath+'main.js',
  168. baseurl=jsPath,
  169. src=jsPath+'libs/require.js?fingerprint='+fingerprint(jsPath + 'libs/require.js')
  170. )
  171. - if (typeof(tenderUrl) != "undefined")
  172. script(src="https://#{tenderUrl}/tender_widget.js" )
  173. script(type="text/javascript").
  174. Tender = {
  175. hideToggle: true,
  176. widgetToggles: $(".js-tender-widget"),
  177. category: "questions"
  178. };