@ -425,7 +425,7 @@ define([
}
) ;
} ;
NotebookList . prototype . update _location = function ( path ) {
this . notebook _path = path ;
$ ( 'body' ) . attr ( 'data-notebook-path' , path ) ;
@ -525,7 +525,7 @@ define([
var item = $ ( "<div/>" )
. addClass ( "col-md-12" )
. appendTo ( row ) ;
var checkbox ;
if ( selectable !== undefined ) {
checkbox = $ ( '<input/>' )
@ -624,7 +624,7 @@ define([
var ipynb _extensions = [ 'ipynb' ] ;
return includes _extension ( model . path , ipynb _extensions ) ;
} ;
NotebookList . prototype . _is _editable = function ( model ) {
// Allow any file to be "edited"
// Non-text files will display the following error:
@ -633,17 +633,17 @@ define([
// See Console for more details.
return true ;
} ;
NotebookList . prototype . _is _viewable = function ( model ) {
var html _types = [ 'htm' , 'html' , 'xhtml' , 'xml' , 'mht' , 'mhtml' ] ;
var media _extension = [ '3gp' , 'avi' , 'mov' , 'mp4' , 'm4v' , 'm4a' , 'mp3' , 'mkv' , 'ogv' , 'ogm' , 'ogg' , 'oga' , 'webm' , 'wav' ] ;
var image _type = [ 'bmp' , 'gif' , 'jpg' , 'jpeg' , 'png' , 'webp' ] ;
var other _type = [ 'ico' ] ;
var viewable _extensions = [ ] . concat ( html _types , media _extension , image _type , other _type ) ;
return model . mimetype === 'text/html'
return model . mimetype === 'text/html'
|| includes _extension ( model . path , viewable _extensions ) ;
} ;
// Files like PDF that should be opened using `/files` prefix
NotebookList . prototype . _is _pdflike = function ( model ) {
var pdflike _extensions = [ 'pdf' ] ;
@ -862,7 +862,7 @@ define([
return false ;
} ) ;
}
// Add in the date that the file was last modified
item . find ( ".item_modified" ) . text ( utils . format _datetime ( model . last _modified ) ) ;
item . find ( ".item_modified" ) . attr ( "title" , moment ( model . last _modified ) . format ( "YYYY-MM-DD HH:mm" ) ) ;
@ -962,7 +962,7 @@ define([
) . append (
$ ( "<br/>" )
) . append ( input ) ;
// This statement is used simply so that message extraction
// will pick up the strings. The actual setting of the text
// for the button is in dialog.js.
@ -1271,7 +1271,7 @@ define([
} ) ;
return false ;
}
var check _exist = function ( ) {
var exists = false ;
$ . each ( that . element . find ( '.list_item:not(.new-file)' ) , function ( k , v ) {
@ -1280,7 +1280,7 @@ define([
return exists
} ;
var exists = check _exist ( ) ;
var add _uploading _button = function ( f , item ) {
// change buttons, add a progress bar
var uploading _button = item . find ( '.upload_button' ) . text ( "Uploading" ) ;
@ -1301,7 +1301,7 @@ define([
var offset = 0 ;
var chunk = 0 ;
var chunk _reader = null ;
var large _reader _onload = function ( event ) {
if ( stop _signal === true ) {
return ;
@ -1374,7 +1374,7 @@ define([
model . chunk = chunk ;
model . content = filedata ;
var on _success = function ( ) {
if ( offset < f . size ) {
// of to the next chunk
@ -1434,6 +1434,7 @@ define([
var upload _button = $ ( '<button/>' ) . text ( i18n . msg . _ ( "Upload" ) )
. addClass ( 'btn btn-primary btn-xs upload_button' )
. click ( function ( e ) {
item . find ( '.upload_button' ) . text ( "Uploading..." ) ;
var filename = item . find ( '.item_name > input' ) . val ( ) ;
var path = utils . url _path _join ( that . notebook _path , filename ) ;
var filedata = item . data ( 'filedata' ) ;