History

Add rel="noopener" to external links

Thibaut Courouble committed 10 years ago

Commit 175308b1 parent 41496045 files · +13 −11Browse files

Unified · Split

5 files
  1. assets/javascripts/lib/util.coffee +3 −1
  2. assets/javascripts/news.json +5 −5
  3. assets/javascripts/templates/notif_tmpl.coffee +3 −3
  4. assets/javascripts/templates/pages/root_tmpl.coffee.erb +1 −1
  5. assets/javascripts/templates/sidebar_tmpl.coffee +1 −1
assets/javascripts/lib/util.coffee+3−1
@@ -321,7 +321,9 @@ $.framify = (fn, obj) -> · 320 unmodified lines
321321 $.noop = ->
322322
323323 $.popup = (value) ->
324− open value.href or value, '_blank'
324+ win = window.open()
325+ win.opener = null if win.opener
326+ win.location = value.href or value
325327 return
326328
327329 $.isTouchScreen = ->
assets/javascripts/news.json+5−5
@@ -43,7 +43,7 @@ · 42 unmodified lines
4343 "New documentations: <a href=\"/erlang/\">Erlang</a> and <a href=\"/tcl_tk/\">Tcl/Tk</a>"
4444 ], [
4545 "2016-01-24",
46− "&ldquo;Multi-version support&rdquo; has landed!\nClick <a href=\"#\" data-pick-docs>Select documentation</a> to pick which versions to use. More versions will be added in the coming weeks.\nIf you notice any bugs, please report them on <a href=\"https://github.com/Thibaut/devdocs/issues\" target=\"_blank\">GitHub</a>."
46+ "&ldquo;Multi-version support&rdquo; has landed!\nClick <a href=\"#\" data-pick-docs>Select documentation</a> to pick which versions to use. More versions will be added in the coming weeks.\nIf you notice any bugs, please report them on <a href=\"https://github.com/Thibaut/devdocs/issues\" target=\"_blank\" rel=\"noopener\">GitHub</a>."
4747 ], [
4848 "2015-11-22",
4949 "New documentations: <a href=\"/phoenix/\">Phoenix</a>, <a href=\"/dojo/\">Dojo</a>, <a href=\"/relay/\">Relay</a> and <a href=\"/flow/\">Flow</a>"
@@ -67,7 +67,7 @@ · 17 unmodified lines
6767 "New documentations: <a href=\"/q/\">Q</a> and <a href=\"/opentsdb/\">OpenTSDB</a>"
6868 ], [
6969 "2015-07-26",
70− "Added search abbreviations (e.g. <code class=\"_label\">$</code> is an alias for <code class=\"_label\">jQuery</code>).\n<a href=\"/help#abbreviations\">Click here</a> to see the full list. Feel free to suggest more on <a href=\"https://github.com/Thibaut/devdocs/issues/new\" target=\"_blank\">GitHub</a>.",
70+ "Added search abbreviations (e.g. <code class=\"_label\">$</code> is an alias for <code class=\"_label\">jQuery</code>).\n<a href=\"/help#abbreviations\">Click here</a> to see the full list. Feel free to suggest more on <a href=\"https://github.com/Thibaut/devdocs/issues/new\" target=\"_blank\" rel=\"noopener\">GitHub</a>.",
7171 "Added <code class=\"_label\">shift + &darr;/&uarr;</code> shortcut for scrolling (same as <code class=\"_label\">alt + &darr;/&uarr;</code>)."
7272 ], [
7373 "2015-07-12",
@@ -96,10 +96,10 @@ · 22 unmodified lines
9696 "New <a href=\"/iojs/\">io.js</a>, <a href=\"/symfony/\">Symfony</a>, <a href=\"/clojure/\">Clojure</a>, <a href=\"/lua/\">Lua</a> and <a href=\"/yii1/\">Yii 1.1</a> documentations"
9797 ], [
9898 "2015-02-08",
99− "New dark theme\nClick the icon in the bottom left corner to activate.\n<a href=\"https://github.com/Thibaut/devdocs/issues\" target=\"_blank\">Feedback</a> welcome :)"
99+ "New dark theme\nClick the icon in the bottom left corner to activate.\n<a href=\"https://github.com/Thibaut/devdocs/issues\" target=\"_blank\" rel=\"noopener\">Feedback</a> welcome :)"
100100 ], [
101101 "2015-01-13",
102− "<a href=\"/offline\">Offline mode</a> has landed!\nIf you notice any bugs, please report them on <a href=\"https://github.com/Thibaut/devdocs/issues\" target=\"_blank\">GitHub</a>."
102+ "<a href=\"/offline\">Offline mode</a> has landed!\nIf you notice any bugs, please report them on <a href=\"https://github.com/Thibaut/devdocs/issues\" target=\"_blank\" rel=\"noopener\">GitHub</a>."
103103 ], [
104104 "2014-12-21",
105105 "New <a href=\"/react/\">React</a>, <a href=\"/rethinkdb/\">RethinkDB</a>, <a href=\"/socketio/\">Socket.IO</a>, <a href=\"/modernizr/\">Modernizr</a> and <a href=\"/bower/\">Bower</a> documentations"
@@ -111,7 +111,7 @@ · 5 unmodified lines
111111 "New <a href=\"/python2/\">Python 2</a> documentation"
112112 ], [
113113 "2014-11-09",
114− "New design\nFeedback welcome on <a href=\"https://twitter.com/DevDocs\" target=\"_blank\">Twitter</a> and <a href=\"https://github.com/Thibaut/devdocs\" target=\"_blank\">GitHub</a>."
114+ "New design\nFeedback welcome on <a href=\"https://twitter.com/DevDocs\" target=\"_blank\" rel=\"noopener\">Twitter</a> and <a href=\"https://github.com/Thibaut/devdocs\" target=\"_blank\" rel=\"noopener\">GitHub</a>."
115115 ], [
116116 "2014-10-19",
117117 "New <a href=\"/svg/\">SVG</a>, <a href=\"/marionette/\">Marionette.js</a>, and <a href=\"/mongoose/\">Mongoose</a> documentations"
assets/javascripts/templates/notif_tmpl.coffee+3−3
@@ -13,7 +13,7 @@ app.templates.notifError = -> · 12 unmodified lines
1313 textNotif """ Oops, an error occured. """,
1414 """ Try <a href="#" data-behavior="hard-reload">reloading</a>, and if the problem persists,
1515 <a href="#" data-behavior="reset">resetting the app</a>.<br>
16− You can also report this issue on <a href="https://github.com/Thibaut/devdocs/issues/new" target="_blank">GitHub</a>. """
16+ You can also report this issue on <a href="https://github.com/Thibaut/devdocs/issues/new" target="_blank" rel="noopener">GitHub</a>. """
1717
1818 app.templates.notifQuotaExceeded = ->
1919 textNotif """ The offline database has exceeded its size limitation. """,
@@ -51,8 +51,8 @@ app.templates.notifUpdates = (docs, disabledDocs) -> · 31 unmodified lines
5151 app.templates.notifShare = ->
5252 textNotif """ Hi there! """,
5353 """ Like DevDocs? Help us reach more developers by sharing the link with your friends on
54− <a href="http://out.devdocs.io/s/tw" target="_blank">Twitter</a>, <a href="http://out.devdocs.io/s/fb" target="_blank">Facebook</a>,
55− <a href="http://out.devdocs.io/s/re" target="_blank">Reddit</a>, etc.<br>Thanks :) """
54+ <a href="http://out.devdocs.io/s/tw" target="_blank" rel="noopener">Twitter</a>, <a href="http://out.devdocs.io/s/fb" target="_blank" rel="noopener">Facebook</a>,
55+ <a href="http://out.devdocs.io/s/re" target="_blank" rel="noopener">Reddit</a>, etc.<br>Thanks :) """
5656
5757 app.templates.notifUpdateDocs = ->
5858 textNotif """ Documentation updates available. """,
assets/javascripts/templates/pages/root_tmpl.coffee.erb+1−1
@@ -79,6 +79,6 @@ app.templates.androidWarning = """ · 78 unmodified lines
7979 <h2 class="_intro-title">Hi there</h2>
8080 <p>DevDocs is running inside an Android WebView. Some features may not work properly.
8181 <p>If you downloaded an app called DevDocs on the Play Store, please uninstall it — it's made by someone who is using (and profiting from) the name DevDocs without permission.
82− <p>To install DevDocs on your phone, visit <a href="http://devdocs.io" target="_blank">devdocs.io</a> in Chrome and select "Add to home screen" in the menu.
82+ <p>To install DevDocs on your phone, visit <a href="http://devdocs.io" target="_blank" rel="noopener">devdocs.io</a> in Chrome and select "Add to home screen" in the menu.
8383 </div>
8484 """
assets/javascripts/templates/sidebar_tmpl.coffee+1−1
@@ -60,7 +60,7 @@ templates.sidebarDisabledVersionedDoc = (doc, versions) -> · 59 unmodified lines
6060
6161 templates.sidebarPickerNote = """
6262 <div class="_list-note">Tip: for faster and better search results, select only the docs you need.</div>
63− <a href="https://trello.com/b/6BmTulfx/devdocs-documentation" class="_list-link" target="_blank">Vote for new documentation</a>
63+ <a href="https://trello.com/b/6BmTulfx/devdocs-documentation" class="_list-link" target="_blank" rel="noopener">Vote for new documentation</a>
6464 """
6565
6666 sidebarFooter = (html) -> """<div class="_sidebar-footer">#{html}</div>"""