From 23fad40f6de2d74ff023f83193f17558d34774b5 Mon Sep 17 00:00:00 2001 From: Min RK Date: Mon, 2 Feb 2015 16:35:24 -0800 Subject: [PATCH] add download link to editor --- IPython/html/static/edit/js/menubar.js | 5 +++++ IPython/html/templates/edit.html | 1 + 2 files changed, 6 insertions(+) diff --git a/IPython/html/static/edit/js/menubar.js b/IPython/html/static/edit/js/menubar.js index 374ebe201..5b7dac5d1 100644 --- a/IPython/html/static/edit/js/menubar.js +++ b/IPython/html/static/edit/js/menubar.js @@ -74,6 +74,11 @@ define([ this.element.find('#rename-file').click(function () { that.save_widget.rename(); }); + this.element.find('#download-file').click(function () { + window.open(utils.url_join_encode( + that.base_url, 'files', that.editor.file_path + ) + '?download=1'); + }); // Edit this.element.find('#menu-find').click(function () { diff --git a/IPython/html/templates/edit.html b/IPython/html/templates/edit.html index 24c679ca2..72d748169 100644 --- a/IPython/html/templates/edit.html +++ b/IPython/html/templates/edit.html @@ -48,6 +48,7 @@ data-file-path="{{file_path}}"
  • New
  • Save
  • Rename
  • +
  • Download