From be6b5c8e774f9e389e4ff4a817caa3ebf5677182 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 21 Jul 2011 22:01:55 +0200 Subject: some work on the updated interface --- core/css/styles.css | 49 +++++--------------------- core/img/breadcrumb-divider.png | Bin 0 -> 1012 bytes core/templates/layout.user.php | 7 ++-- files/css/files.css | 46 +++++++++++++++++++++++- files/js/filelist.js | 8 ++--- files/js/files.js | 68 ++++++++++++++++++++++++++++++------ files/templates/index.php | 24 +++++++------ files/templates/part.breadcrumb.php | 5 +-- files/templates/part.list.php | 5 ++- 9 files changed, 133 insertions(+), 79 deletions(-) create mode 100644 core/img/breadcrumb-divider.png diff --git a/core/css/styles.css b/core/css/styles.css index f9b536a2b04..2bc29882250 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -1,6 +1,6 @@ * { margin:0; padding:0; border:0; } body { background:#fefefe url('../img/body_background.jpg') repeat-y left top; font:normal 80%/1.6em "Lucida Grande", Arial, Verdana, sans-serif; color:#000; } -#header { position:fixed; top:0; z-index:100; width:100%; height:5.5em; padding:0.5em 1.5em; background:url('../img/header-a.png') repeat-x left top; } +#header { position:fixed; top:0; z-index:100; width:100%; height:2.5em; padding:0.5em 1.5em; background:url('../img/header-a.png') repeat-x left top; } #body-settings #header { background-image:url('../img/header-settings-a.png'); } #owncloud { float:left; margin:0 0 0 2em; } h1 { margin:1em 3em 1em 0; border-bottom:1px solid #666; text-transform:uppercase; font-weight:normal; font-style:italic; color:#666; } @@ -20,7 +20,7 @@ form input[type="button"], form input[type="text"] { font-size: 0.9em; } fieldset { padding:1em; background-color:#f7f7f7; border:1px solid #ddd; max-width:600px; margin:2em 2em 2em 3em; } legend { padding: 0.5em; font-size:1.2em; } -div.controls { width:91%; margin:1em 1em 1em 2em; padding:0.5em 0; background-color:#f7f7f7; border:1px solid #eee; } +div.controls { width:100%; margin:0px; background-color:#f7f7f7; border-bottom:1px solid #eee; position:fixed } /* LOG IN & INSTALLATION ------------------------------------------------------------ */ #body-login { width:100%; background-image:none; background-color:#ddd; } @@ -196,17 +196,17 @@ div.controls { width:91%; margin:1em 1em 1em 2em; padding:0.5em 0; background-co .prettybutton:hover, .prettybutton:focus { background-color:#ccc; outline:0; } /* META NAVIGATION (Settings, Log out) ---------------------------------------------------------------- */ -#metanav { float:right; position:relative; top:1.5em; right:2.5em; list-style:none; margin:0; padding:0; } +#metanav { float:right; position:relative; top:0.5em; right:2.5em; list-style:none; margin:0; padding:0; } #metanav li { display:inline; } #metanav li a { margin:.1em; padding:1em; } #metanav li a:hover, #metanav li a:focus { background:rgba(0,0,0,.5); -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; outline:0; box-shadow:#555 0 1px 0; -moz-box-shadow:#555 0 1px 0; -webkit-box-shadow:#555 0 1px 0; } #metanav li a img { vertical-align:middle; } /* SEARCH --------------------------------------------------------------------- */ -form.searchbox { display:inline; position:fixed; top:2em; right:10em; margin:0; padding:0; } +form.searchbox { display:inline; position:fixed; top:1em; right:10em; margin:0; padding:0; } /* NAVIGATION ------------------------------------------------------------- */ -#plugins { position:fixed; top:7em; float:left; width:15.7em; padding:0; } +#plugins { position:fixed; top:3.5em; float:left; width:15.7em; padding:0; } #plugins ul { list-style-type:none; border-top:1px solid #ccc; } #plugins a { display:block; padding:0.5em 0.5em 0.5em 3em; background-position:1.5em center; background-repeat:no-repeat; border-bottom:1px solid #ddd; border-top:1px solid #fff; text-decoration:none; font-size:1.2em; color:#666; } #plugins a.active, #plugins a:hover, #plugins a:focus, #plugins a.selected { background-color:#ccc; border-top:1px solid #ccc; border-bottom:1px solid #ccc; color:#000; outline:0; } @@ -215,47 +215,16 @@ form.searchbox { display:inline; position:fixed; top:2em; right:10em; margin:0; #plugins .subentry.active { background-color:#bbb; border-top:1px solid #aaa; border-bottom:1px solid #ccc; color:#000; outline:0; } /* CONTENT ------------------------------------------------------------------ */ -#content { margin:7em 0 0 16em; } -table { margin:1em 5em 2em 3em; } -table tr.mouseOver td { background-color:#eee; } -table th, table td { padding:0; border-bottom:1px solid #ddd; text-align:left; font-style:italic; } -table th { padding:0.5em; } -table td { border-bottom:1px solid #eee; font-style:normal; } -table td.filesize, table td.date { width:5em; padding:0.5em 1em; text-align:right; } -table td.date { width:11em; } -table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; } -table td.filename a { display:block; background-image:url('../img/file.png'); text-decoration:none; } -table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:0.5em 0.5em 0.5em 3em; background-position:1em center; background-repeat:no-repeat; } -table td.filename a:hover, table td.filename a:focus { outline:0; } -table td.filename a:active { outline:0; } -table em { font-weight:bold; } -table td.filename a.folder-up { background-image:url('../img/back.png'); font-style:italic; } -table td.filename a.folder { background-image:url('../img/folder.png'); } -table td.filename a.folder-home { background-image:url('../img/home.png'); } -table td.filename a.folder-music { background-image:url('../img/folder-music.png'); } -table td.filename a.folder-videos { background-image:url('../img/folder-video.png'); } -table td.filename a.folder-shared { background-image:url('../img/folder-shared.png'); } -table td.filename a.folder-images { background-image:url('../img/folder-image.png'); } -table td.filename a.file-txt { background-image:url('../img/file-txt.png'); } -table td.filename a.file-python { background-image:url('../img/file-python.png'); } -table td.filename a.file-php { background-image:url('../img/file.png'); } -table td.login { background-image:url('../img/login.png'); } -table td.logout { background-image:url('../img/logout.png'); } -table td.download { background-image:url('../img/download.png'); } -table td.upload { background-image:url('../img/upload.png'); } -table td.create { background-image:url('../img/folder-new.png'); } -table td.delete { background-image:url('../img/delete.png'); } -#fileList tr input[type=checkbox] { display:none; } -#fileList tr input[type=checkbox]:checked { display:inline; } -#fileList tr:hover input[type=checkbox] { display:inline; } +#content { margin:3.5em 0 0 15.7em; } + /* NAVIGATION BAR */ -span.nav { margin:1em 0 0 2em; padding:0.8em; line-height:16px; font-weight:bold; display:block} +span.nav { padding:1em 0 0 2em; } span.nav a { padding:0.5em 1.5em 0.5em 0.5em; background-position:right center; background-repeat:no-repeat; background-image:url('../img/arrow.png'); text-decoration:none; } span.nav a img { height:16px; vertical-align:text-top; } /* ACTIONS BAR */ -p.actions, div.actions { padding:0; } +p.actions, div.actions { padding:7px; float:right; margin-right:16em; } p.actions a, div.actions a { padding:0.5em 0.5em 0.5em 3em; background-position:1em center; background-repeat:no-repeat; background-image:url('../img/action.png'); border-right:1px solid #eee; text-decoration:none; color:#333; } p.actions a:hover, p.actions a:focus, div.actions a:hover, div.actions a:focus { background-color:#eee; color:#000; outline:0; } p.actions a:active, div.actions a:active { outline:0; } diff --git a/core/img/breadcrumb-divider.png b/core/img/breadcrumb-divider.png new file mode 100644 index 00000000000..52742e37238 Binary files /dev/null and b/core/img/breadcrumb-divider.png differ diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 2a9a817498d..dedb6e2e4a1 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -38,6 +38,9 @@
+
+ +
    @@ -45,10 +48,6 @@
- -
- -
diff --git a/files/css/files.css b/files/css/files.css index f4da6fae98c..f119fe90a74 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -73,7 +73,9 @@ /* FILE TABLE */ table { - width: 90%; + position:relative; + top:37px; + width: 100%; } tbody tr:hover, tbody tr:active, tbody tr.selected { background-color:#eee; } @@ -118,4 +120,46 @@ span.extention{ div.crumb{ float:left; + background-repeat:no-repeat; + background-position:right 0px; + font-size:20px; + padding:8px; +} + +table tr.mouseOver td { background-color:#eee; } +table th, table td { padding:0; border-bottom:1px solid #ddd; text-align:left; font-style:italic; } +table th { padding:0.5em; } +table td { border-bottom:1px solid #eee; font-style:normal; } +table td.filesize, table td.date { width:5em; padding:0.5em 1em; text-align:right; } +table td.date { width:11em; } +table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; } +table td.filename a { display:block; background-image:url('../img/file.png'); text-decoration:none; } +table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:0.5em 0.5em 0.5em 3em; background-position:1em center; background-repeat:no-repeat; } +table td.filename a:hover, table td.filename a:focus { outline:0; } +table td.filename a:active { outline:0; } +table em { font-weight:bold; } +table td.filename a.folder-up { background-image:url('../img/back.png'); font-style:italic; } +table td.filename a.folder { background-image:url('../img/folder.png'); } +table td.filename a.folder-home { background-image:url('../img/home.png'); } +table td.filename a.folder-music { background-image:url('../img/folder-music.png'); } +table td.filename a.folder-videos { background-image:url('../img/folder-video.png'); } +table td.filename a.folder-shared { background-image:url('../img/folder-shared.png'); } +table td.filename a.folder-images { background-image:url('../img/folder-image.png'); } +table td.filename a.file-txt { background-image:url('../img/file-txt.png'); } +table td.filename a.file-python { background-image:url('../img/file-python.png'); } +table td.filename a.file-php { background-image:url('../img/file.png'); } +table td.login { background-image:url('../img/login.png'); } +table td.logout { background-image:url('../img/logout.png'); } +table td.download { background-image:url('../img/download.png'); } +table td.upload { background-image:url('../img/upload.png'); } +table td.create { background-image:url('../img/folder-new.png'); } +table td.delete { background-image:url('../img/delete.png'); } +#fileList tr input[type=checkbox] { display:none; float:left; margin:0.7em; margin-left:1em; } +#fileList tr input[type=checkbox]:checked { display:inline; } +#fileList tr:hover input[type=checkbox] { display:inline; } +#fileList tr:hover td.filename a{background-image:none !important} +#fileList tr.selected td.filename a{background-image:none !important} +#select_all{float:left; margin:0.2em; margin-left:0.6em; } +#selectedActions{ + float:right; } \ No newline at end of file diff --git a/files/js/filelist.js b/files/js/filelist.js index 2c662087ab2..9300e311076 100644 --- a/files/js/filelist.js +++ b/files/js/filelist.js @@ -5,11 +5,9 @@ FileList={ addFile:function(name,size,lastModified,loading){ var img=(loading)?'img/loading.gif':'img/file.png'; var html=''; - html+=''; - html+=''+name+''; + html+=''+name+''; html+=''+size+''; html+=''+lastModified+''; - html+=''; html+=''; FileList.insertElement(name,'file',$(html)); if(loading){ @@ -20,11 +18,9 @@ FileList={ }, addDir:function(name,size,lastModified){ var html=''; - html+=''; - html+=''+name+''; + html+=''+name+''; html+=''+size+''; html+=''+lastModified+''; - html+=''; html+=''; FileList.insertElement(name,'dir',$(html)); diff --git a/files/js/files.js b/files/js/files.js index d4191215972..4a3de095509 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -54,24 +54,27 @@ $(document).ready(function() { $('#select_all').click(function() { if($(this).attr('checked')){ // Check all - $('td.selection input:checkbox').attr('checked', true); - $('td.selection input:checkbox').parent().parent().addClass('selected'); + $('td.filename input:checkbox').attr('checked', true); + $('td.filename input:checkbox').parent().parent().addClass('selected'); }else{ // Uncheck all - $('td.selection input:checkbox').attr('checked', false); - $('td.selection input:checkbox').parent().parent().removeClass('selected'); + $('td.filename input:checkbox').attr('checked', false); + $('td.filename input:checkbox').parent().parent().removeClass('selected'); } + procesSelection(); }); - $('td.selection input:checkbox').live('click',function() { + $('td.filename input:checkbox').live('click',function() { + var selectedCount=$('td.filename input:checkbox:checked').length; $(this).parent().parent().toggleClass('selected'); if(!$(this).attr('checked')){ $('#select_all').attr('checked',false); }else{ - if($('td.selection input:checkbox:checked').length==$('td.selection input:checkbox').length){ + if(selectedCount==$('td.filename input:checkbox').length){ $('#select_all').attr('checked',true); } } + procesSelection(); }); $('#file_newfolder_form').submit(function(event) { @@ -109,7 +112,7 @@ $(document).ready(function() { $('.download').live('click',function(event) { var files=''; - $('td.selection input:checkbox:checked').parent().parent().each(function(i,element){ + $('td.filename input:checkbox:checked').parent().parent().each(function(i,element){ files+=';'+$(element).attr('data-file'); }); files=files.substr(1);//remove leading ; @@ -121,9 +124,9 @@ $(document).ready(function() { return false; }); - $('.delete').live('click',function(event) { + $('.delete').click(function(event) { var files=''; - $('td.selection input:checkbox:checked').parent().parent().each(function(i,element){ + $('td.filename input:checkbox:checked').parent().parent().each(function(i,element){ files+=';'+$(element).attr('data-file'); }); files=files.substr(1);//remove leading ; @@ -133,7 +136,7 @@ $(document).ready(function() { data: "dir="+$('#dir').val()+"&files="+encodeURIComponent(files), complete: function(data){ boolOperationFinished(data, function(){ - $('td.selection input:checkbox:checked').parent().parent().each(function(i,element){ + $('td.filename input:checkbox:checked').parent().parent().each(function(i,element){ FileList.remove($(element).attr('data-file')); }); }); @@ -282,4 +285,49 @@ var folderDropOptions={ });} }); } +} + +function procesSelection(){ + var selectedFiles=$('tr[data-type="file"]>td.filename>input:checkbox:checked').parent().parent(); + var selectedFolders=$('tr[data-type="dir"]>td.filename>input:checkbox:checked').parent().parent(); + if(selectedFiles.length==0 && selectedFolders.length==0){ + $('#headerName>span.name').text('Name'); + $('#headerSize').text('Size (MB)'); + }else{ + var totalSize=0; + selectedFiles.each(function(){ + totalSize+=parseInt($(this).attr('data-size')); + }); + selectedFolders.each(function(){ + totalSize+=parseInt($(this).attr('data-size')); + }); + if(totalSize>0){ + totalSize = Math.round(totalSize/(1024*102.4))/10; + if(totalSize < 0.1) { + totalSize='<0.1'; + }else if(totalSize > 1000) { + totalSize= '>1000'; + } + } + $('#headerSize').text(totalSize+' (MB)'); + var selection=''; + if(selectedFiles.length>0){ + if(selectedFiles.length==1){ + selection+='1 File'; + }else{ + selection+=selectedFiles.length+' Files'; + } + if(selectedFolders.length>0){ + selection+=' ,'; + } + } + if(selectedFolders.length>0){ + if(selectedFolders.length==1){ + selection+='1 Folder'; + }else{ + selection+=selectedFolders.length+' Folders'; + } + } + $('#headerName>span.name').text(selection+' Selected'); + } } \ No newline at end of file diff --git a/files/templates/index.php b/files/templates/index.php index efc92900637..7cdb81b2d66 100644 --- a/files/templates/index.php +++ b/files/templates/index.php @@ -1,4 +1,7 @@
+ + +
" id="max_upload"> @@ -14,26 +17,25 @@  
- t( 'Download' ); ?> - - t( 'Delete' ); ?>
- - - - - - - + + - diff --git a/files/templates/part.breadcrumb.php b/files/templates/part.breadcrumb.php index 64e0a474728..20c436926c6 100644 --- a/files/templates/part.breadcrumb.php +++ b/files/templates/part.breadcrumb.php @@ -1,8 +1,5 @@ -
- ">" alt="Root"/> -
-
+
")'> ">
\ No newline at end of file diff --git a/files/templates/part.list.php b/files/templates/part.list.php index d717f288851..1468f485c23 100644 --- a/files/templates/part.list.php +++ b/files/templates/part.list.php @@ -1,9 +1,9 @@ -
- + '> - -- cgit v1.2.3 From bc40532109a334165a7c18f55d3c1abd88b866fe Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 21 Jul 2011 22:37:11 +0200 Subject: give the file sizes some more space --- files/css/files.css | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/files/css/files.css b/files/css/files.css index f119fe90a74..e0b06ea0cb5 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -83,10 +83,13 @@ tbody a { color:#000; } table td.filesize, table td.date { - width: 5em; + width: 7em; padding: 0.5em 1em; text-align: right; } +#headerSize{ + text-align:right; +} table td.date { @@ -130,7 +133,6 @@ table tr.mouseOver td { background-color:#eee; } table th, table td { padding:0; border-bottom:1px solid #ddd; text-align:left; font-style:italic; } table th { padding:0.5em; } table td { border-bottom:1px solid #eee; font-style:normal; } -table td.filesize, table td.date { width:5em; padding:0.5em 1em; text-align:right; } table td.date { width:11em; } table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; } table td.filename a { display:block; background-image:url('../img/file.png'); text-decoration:none; } @@ -162,4 +164,5 @@ table td.delete { background-image:url('../img/delete.png'); } #select_all{float:left; margin:0.2em; margin-left:0.6em; } #selectedActions{ float:right; + display:none; } \ No newline at end of file -- cgit v1.2.3 From aa335f57d627e42b14e350f2bdf43112f1f0f2ef Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 21 Jul 2011 23:26:08 +0200 Subject: only show actions for selected file if there are selected files --- files/js/files.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/js/files.js b/files/js/files.js index 4a3de095509..b0970233739 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -293,7 +293,9 @@ function procesSelection(){ if(selectedFiles.length==0 && selectedFolders.length==0){ $('#headerName>span.name').text('Name'); $('#headerSize').text('Size (MB)'); + $('#selectedActions').hide(); }else{ + $('#selectedActions').show(); var totalSize=0; selectedFiles.each(function(){ totalSize+=parseInt($(this).attr('data-size')); -- cgit v1.2.3 From d9a79c0f7eade4915b236c1581ed30714ecab3ff Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 22 Jul 2011 00:18:41 +0200 Subject: show fileactions inline on hover --- apps/media/css/jplayer.css | 2 +- files/css/files.css | 30 +++++++++++------------------- files/js/fileactions.js | 26 ++++++++++++++++---------- files/js/files.js | 10 ++++++---- files/templates/index.php | 5 +---- 5 files changed, 35 insertions(+), 38 deletions(-) diff --git a/apps/media/css/jplayer.css b/apps/media/css/jplayer.css index c47d20c7228..4fd17882391 100644 --- a/apps/media/css/jplayer.css +++ b/apps/media/css/jplayer.css @@ -45,7 +45,7 @@ div.jp-interface { z-index:100; width:25em; left:201px; - top:-10px; + top:-20px; } div.jp-type-playlist{ width:100%; diff --git a/files/css/files.css b/files/css/files.css index e0b06ea0cb5..a886958f137 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -2,22 +2,17 @@ #file_menu { - display: none; - position: absolute; right:0px; - background-color: #EEE; -} - -#file_menu ul -{ - list-style-type: none; + position:absolute; + top:0; } -#file_menu li a +#file_menu a { - display: block; - padding: 0.5em 5em 0.5em 2em; - text-decoration: none; + display:block; + float:left; + background-image:none; + text-decoration: none; } .file_upload_form, #file_newfolder_form { @@ -36,12 +31,12 @@ } .file_upload_filename { - background-image:url(../img/file.png); font-weight:bold; + background-image:url("../img/file.png"); font-weight:bold; } .file_upload_start {opacity:0;filter: alpha(opacity = 0);} #file_newfolder_name { - background-image:url(../img/folder.png); font-weight:bold; + background-image:url("../img/folder.png"); font-weight:bold; width: 14em; } @@ -102,11 +97,8 @@ table td.selection, table th.selection, table td.fileaction text-align: center; } -table td.filename a -{ - display: block; - background-image: url(../img/file.png); - text-decoration: none; +td.filename{ + position:relative; } .dropArrow{ diff --git a/files/js/fileactions.js b/files/js/fileactions.js index b683dc0cd3a..3ad417c91c4 100644 --- a/files/js/fileactions.js +++ b/files/js/fileactions.js @@ -49,33 +49,39 @@ FileActions={ return actions[name]; }, display:function(parent){ - $('#file_menu ul').empty(); + $('#file_menu').empty(); parent.append($('#file_menu')); var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType()); for(name in actions){ - var html='
  • '+name+'
  • '; + var html=''+name+''; var element=$(html); element.data('action',name); element.click(function(event){ + event.stopPropagation(); event.preventDefault(); - $('#file_menu').slideToggle(250); var action=actions[$(this).data('action')]; - $('#file_menu ul').empty(); - action(FileActions.getCurrentFile()); + var currentFile=FileActions.getCurrentFile(); + FileActions.hide(); + action(currentFile); }); - $('#file_menu>ul').append(element); + $('#file_menu').append(element); } - $('#file_menu').slideToggle(250); + $('#file_menu').show(); return false; }, + hide:function(){ + $('#file_menu').hide(); + $('#file_menu').empty(); + $('body').append($('#file_menu')); + }, getCurrentFile:function(){ - return $('#file_menu').parents('tr:first').attr('data-file'); + return $('#file_menu').parent().parent().attr('data-file'); }, getCurrentMimeType:function(){ - return $('#file_menu').parents('tr:first').attr('data-mime'); + return $('#file_menu').parent().parent().attr('data-mime'); }, getCurrentType:function(){ - return $('#file_menu').parents('tr:first').attr('data-type'); + return $('#file_menu').parent().parent().attr('data-type'); } } diff --git a/files/js/files.js b/files/js/files.js index b0970233739..f1c00650d0a 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -31,11 +31,13 @@ $(document).ready(function() { }); // Sets the file-action buttons behaviour : - $('td.fileaction a').live('click',function(event) { - event.preventDefault(); - FileActions.display($(this).parent()); + $('tr').live('mouseenter',function(event) { + FileActions.display($(this).children('td.filename')); }); - + $('tr').live('mouseleave',function(event) { + FileActions.hide(); + }); + // Sets the file link behaviour : $('td.filename a').live('click',function(event) { event.preventDefault(); diff --git a/files/templates/index.php b/files/templates/index.php index 7cdb81b2d66..18b805529a9 100644 --- a/files/templates/index.php +++ b/files/templates/index.php @@ -43,7 +43,4 @@
    t( 'Name' ); ?>t( 'Size (MB)' ); ?> + + t( 'Name' ); ?> + + Download + + Delete + + t( 'Size (MB)' ); ?> t( 'Modified' ); ?>
    + @@ -14,6 +14,5 @@
    -
    - -
    + -- cgit v1.2.3 From 9be2dc8290eac4849c8663e2f8eefa3b8882c4fa Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 22 Jul 2011 00:43:35 +0200 Subject: show fixed filecontrols over the filelist that can scroll underneath it --- core/css/styles.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/css/styles.css b/core/css/styles.css index 2bc29882250..b48092a9c07 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -20,7 +20,7 @@ form input[type="button"], form input[type="text"] { font-size: 0.9em; } fieldset { padding:1em; background-color:#f7f7f7; border:1px solid #ddd; max-width:600px; margin:2em 2em 2em 3em; } legend { padding: 0.5em; font-size:1.2em; } -div.controls { width:100%; margin:0px; background-color:#f7f7f7; border-bottom:1px solid #eee; position:fixed } +div.controls { width:100%; margin:0px; background-color:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:100 } /* LOG IN & INSTALLATION ------------------------------------------------------------ */ #body-login { width:100%; background-image:none; background-color:#ddd; } -- cgit v1.2.3 From d6bf5cd251e4b3ce8a1bbbe09a029148881eeac9 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 22 Jul 2011 15:48:30 +0200 Subject: show error when trying to upload to large files --- files/css/files.css | 3 +- files/js/files.js | 75 ++++++++++++++++++++++++++++------------------- files/templates/index.php | 6 ++++ 3 files changed, 53 insertions(+), 31 deletions(-) diff --git a/files/css/files.css b/files/css/files.css index a886958f137..d45d93441de 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -157,4 +157,5 @@ table td.delete { background-image:url('../img/delete.png'); } #selectedActions{ float:right; display:none; -} \ No newline at end of file +} +#uploadsize-message{display:none} \ No newline at end of file diff --git a/files/js/files.js b/files/js/files.js index f1c00650d0a..dc59dda57e0 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -153,40 +153,55 @@ $(document).ready(function() { var uploadId=form.attr('data-upload-id'); var files=this.files; var target=form.children('iframe'); - target.load(function(){ - var response=jQuery.parseJSON(target.contents().find('body').text()); - //set mimetype and if needed filesize - if(response){ - for(var i=0;i$('#max_upload').val()){ + $( "#uploadsize-message" ).dialog({ + modal: true, + buttons: { + Close: function() { + $( this ).dialog( "close" ); } - FileList.loadingDone(file.name); } + }); + }else{ + target.load(function(){ + var response=jQuery.parseJSON(target.contents().find('body').text()); + //set mimetype and if needed filesize + if(response){ + for(var i=0;i0){ + var size=simpleFileSize(files[i].size); + }else{ + var size='Pending'; + } + FileList.addFile(files[i].name,size,uploadTime,true); } - }); - form.submit(); - var date=new Date(); - var uploadTime=formatDate(date); - for(var i=0;i0){ - var size=simpleFileSize(files[i].size); - }else{ - var size='Pending'; - } - FileList.addFile(files[i].name,size,uploadTime,true); + + //clone the upload form and hide the new one to allow users to start a new upload while the old one is still uploading + var clone=form.clone(); + uploadId++; + clone.attr('data-upload-id',uploadId); + clone.attr('target','file_upload_target_'+uploadId); + clone.children('iframe').attr('name','file_upload_target_'+uploadId) + clone.insertBefore(form); + form.hide(); } - - //clone the upload form and hide the new one to allow users to start a new upload while the old one is still uploading - var clone=form.clone(); - uploadId++; - clone.attr('data-upload-id',uploadId); - clone.attr('target','file_upload_target_'+uploadId); - clone.children('iframe').attr('name','file_upload_target_'+uploadId) - clone.insertBefore(form); - form.hide(); }); //add multiply file upload attribute to all browsers except konqueror (which crashes when it's used) diff --git a/files/templates/index.php b/files/templates/index.php index 18b805529a9..b0d4f556f4a 100644 --- a/files/templates/index.php +++ b/files/templates/index.php @@ -43,4 +43,10 @@ +
    +

    + t( 'The files you are trying to upload exceed the maximum size for file uploads on this server.' ); ?> +

    +
    + -- cgit v1.2.3 From ceb711dff4ceb02efd1c96b867df050f15ba4a93 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 22 Jul 2011 16:52:35 +0200 Subject: some work on the breadcrumb navigation for files --- core/css/styles.css | 4 ++-- core/img/breadcrumb-divider-start.png | Bin 0 -> 495 bytes files/css/files.css | 16 ++++++++++++++-- files/js/files.js | 22 ++++++++++++++++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 core/img/breadcrumb-divider-start.png diff --git a/core/css/styles.css b/core/css/styles.css index b48092a9c07..7a26c2f6703 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -206,7 +206,7 @@ div.controls { width:100%; margin:0px; background-color:#f7f7f7; border-bottom:1 form.searchbox { display:inline; position:fixed; top:1em; right:10em; margin:0; padding:0; } /* NAVIGATION ------------------------------------------------------------- */ -#plugins { position:fixed; top:3.5em; float:left; width:15.7em; padding:0; } +#plugins { position:fixed; top:3.5em; float:left; width:15.7em; padding:0; z-index:100; } #plugins ul { list-style-type:none; border-top:1px solid #ccc; } #plugins a { display:block; padding:0.5em 0.5em 0.5em 3em; background-position:1.5em center; background-repeat:no-repeat; border-bottom:1px solid #ddd; border-top:1px solid #fff; text-decoration:none; font-size:1.2em; color:#666; } #plugins a.active, #plugins a:hover, #plugins a:focus, #plugins a.selected { background-color:#ccc; border-top:1px solid #ccc; border-bottom:1px solid #ccc; color:#000; outline:0; } @@ -219,7 +219,7 @@ form.searchbox { display:inline; position:fixed; top:1em; right:10em; margin:0; /* NAVIGATION BAR */ -span.nav { padding:1em 0 0 2em; } +span.nav { display:block; float:left; /*margin-right:55em;*/ } span.nav a { padding:0.5em 1.5em 0.5em 0.5em; background-position:right center; background-repeat:no-repeat; background-image:url('../img/arrow.png'); text-decoration:none; } span.nav a img { height:16px; vertical-align:text-top; } diff --git a/core/img/breadcrumb-divider-start.png b/core/img/breadcrumb-divider-start.png new file mode 100644 index 00000000000..24d1eb40857 Binary files /dev/null and b/core/img/breadcrumb-divider-start.png differ diff --git a/files/css/files.css b/files/css/files.css index d45d93441de..590c7bac364 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -115,10 +115,13 @@ span.extention{ div.crumb{ float:left; + display:block; background-repeat:no-repeat; background-position:right 0px; font-size:20px; - padding:8px; + padding-top:8px; + padding-left:8px; + height:28px; /*36-8*/ } table tr.mouseOver td { background-color:#eee; } @@ -158,4 +161,13 @@ table td.delete { background-image:url('../img/delete.png'); } float:right; display:none; } -#uploadsize-message{display:none} \ No newline at end of file +#uploadsize-message{display:none} + +/* add breadcrumb divider to the File item in navigation panel */ +#plugins li:first-child{ + background-position: 15.7em 0px; + background-repeat:no-repeat; + background-image: url("/owncloud/core/img/breadcrumb-divider-start.png"); + width:15.7em; + padding-right:11px; +} diff --git a/files/js/files.js b/files/js/files.js index dc59dda57e0..49e2f412d49 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -208,6 +208,28 @@ $(document).ready(function() { if(navigator.userAgent.search(/konqueror/i)==-1){ $('.file_upload_start').attr('multiple','multiple') } + + //if the breadcrumb is to long, start by replacing foldernames with '...' except for the current folder + var crumb=$('div.crumb').first(); + while($('div.controls').height()>40 && crumb.next('div.crumb').length>0){ + crumb.children('a').text('...'); + crumb=crumb.next('div.crumb'); + } + //if that isn't enough, start removing items from the breacrumb except for the current folder and it's parent + var crumb=$('div.crumb').first(); + var next=crumb.next('div.crumb'); + while($('div.controls').height()>40 && next.next('div.crumb').length>0){ + crumb.remove(); + crumb=next; + next=crumb.next('div.crumb'); + } + //still not enough, start shorting down the current folder name + var crumb=$('div.crumb>a').last(); + while($('div.controls').height()>40 && crumb.text().length>6){ + var text=crumb.text() + text=text.substr(0,text.length-6)+'...'; + crumb.text(text); + } }); var adjustNewFolderSize = function() { -- cgit v1.2.3 From b0f166fc836129464a2bdfa03357e844568c1104 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 26 Jul 2011 16:43:12 +0200 Subject: some javascript changes --- core/js/js.js | 19 ++++++++++++ files/js/files.js | 91 +++++++++++++++++++++++++++++-------------------------- 2 files changed, 67 insertions(+), 43 deletions(-) diff --git a/core/js/js.js b/core/js/js.js index 9117f08349a..2dac6907d96 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -55,3 +55,22 @@ OC={ $('head').append(style); } } + +if (!Array.prototype.filter) { + Array.prototype.filter = function(fun /*, thisp*/) { + var len = this.length >>> 0; + if (typeof fun != "function") + throw new TypeError(); + + var res = []; + var thisp = arguments[1]; + for (var i = 0; i < len; i++) { + if (i in this) { + var val = this[i]; // in case fun mutates this + if (fun.call(thisp, val, i, this)) + res.push(val); + } + } + return res; + }; +} \ No newline at end of file diff --git a/files/js/files.js b/files/js/files.js index 2f1ba907ba5..7842c680300 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -4,31 +4,8 @@ $(document).ready(function() { //drag/drop of files $('#fileList tr td.filename').draggable(dragOptions); $('#fileList tr[data-type="dir"] td.filename').droppable(folderDropOptions); - $('div.crumb').droppable({ - drop: function( event, ui ) { - var file=ui.draggable.text().trim(); - var target=$(this).attr('data-dir'); - var dir=$('#dir').val(); - while(dir.substr(0,1)=='/'){//remove extra leading /'s - dir=dir.substr(1); - } - dir='/'+dir; - if(dir.substr(-1,1)!='/'){ - dir=dir+'/'; - } - if(target==dir){ - return; - } - $.ajax({ - url: 'ajax/move.php', - data: "dir="+dir+"&file="+file+'&target='+target, - complete: function(data){boolOperationFinished(data, function(){ - FileList.remove(file); - });} - }); - }, - tolerance: 'pointer' - }); + $('div.crumb').droppable(crumbDropOptions); + $('#plugins>ul>li:first-child').droppable(crumbDropOptions); // Sets the file-action buttons behaviour : $('tr').live('mouseenter',function(event) { @@ -41,10 +18,10 @@ $(document).ready(function() { // Sets the file link behaviour : $('td.filename a').live('click',function(event) { event.preventDefault(); - var filename=$(this).parent().parent().attr('data-file'); + var filename=$(this).parent().parent().data('file'); if(!FileList.isLoading(filename)){ - var mime=$(this).parent().parent().attr('data-mime'); - var type=$(this).parent().parent().attr('data-type'); + var mime=$(this).parent().parent().data('mime'); + var type=$(this).parent().parent().data('type'); var action=FileActions.getDefault(mime,type); if(action){ action(filename); @@ -131,7 +108,7 @@ $(document).ready(function() { complete: function(data){ boolOperationFinished(data, function(){ $('td.filename input:checkbox:checked').parent().parent().each(function(i,element){ - FileList.remove($(element).attr('data-file')); + FileList.remove($(element).data('file')); }); }); } @@ -165,7 +142,7 @@ $(document).ready(function() { if(response){ for(var i=0;itd.filename>input:checkbox:checked').parent().parent(); - var selectedFolders=$('tr[data-type="dir"]>td.filename>input:checkbox:checked').parent().parent(); + var selected=getSelectedFiles(); + var selectedFiles=selected.filter(function(el){return el.type=='file'}); + var selectedFolders=selected.filter(function(el){return el.type=='dir'}); if(selectedFiles.length==0 && selectedFolders.length==0){ $('#headerName>span.name').text('Name'); $('#headerSize').text('Size (MB)'); @@ -328,12 +331,12 @@ function procesSelection(){ }else{ $('#selectedActions').show(); var totalSize=0; - selectedFiles.each(function(){ - totalSize+=parseInt($(this).attr('data-size')); - }); - selectedFolders.each(function(){ - totalSize+=parseInt($(this).attr('data-size')); - }); + for(var i=0;i0){ totalSize = Math.round(totalSize/(1024*102.4))/10; if(totalSize < 0.1) { @@ -370,22 +373,24 @@ function procesSelection(){ * @param string property (option) the property of the file requested * @return array * - * possible values for property: name, mime + * possible values for property: name, mime, size and type * if property is set, an array with that property for each file is returnd * if it's ommited an array of objects with all properties is returned */ function getSelectedFiles(property){ - var elements=$('td.selection input:checkbox:checked').parent().parent(); + var elements=$('td.filename input:checkbox:checked').parent().parent(); var files=[]; elements.each(function(i,element){ var file={ - name:$(element).attr('data-file'), - mime:$(element).attr('data-mime') + name:$(element).data('file'), + mime:$(element).data('mime'), + type:$(element).data('type'), + size:$(element).data('size'), }; if(property){ files.push(file[property]); }else{ - files.push(); + files.push(file); } }); return files; -- cgit v1.2.3 From 48fe201dd57e0958ed85a1a174adf3526f622605 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 26 Jul 2011 16:43:41 +0200 Subject: fit player controls in smaller header --- apps/media/css/player.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/media/css/player.css b/apps/media/css/player.css index bf404f515fd..a8c978514d1 100644 --- a/apps/media/css/player.css +++ b/apps/media/css/player.css @@ -1,4 +1,4 @@ -#jp-interface{position:fixed;z-index:100;width:25em;left:201px;top:-10px;height:80px;border-bottom:none;} +#jp-interface{position:fixed;z-index:100;width:25em;left:201px;top:-20px;height:80px;border-bottom:none;} #jp-interface.player{display:hidden;} #jp-interface ul.jp-controls{list-style-type:none;padding:0;} #jp-interface ul.jp-controls li{display:inline;} @@ -25,5 +25,5 @@ a.jp-unmute{background:url("../img/jplayer.blue.monday.png") 0 -170px no-repeat; a.jp-unmute:hover{background:url("../img/jplayer.blue.monday.png") -19px -186px no-repeat;} div.jp-volume-bar{position:absolute;overflow:hidden;background:url("../img/jplayer.blue.monday.png") 0 -250px repeat-x;width:46px;height:5px;cursor:pointer;top:37px;left:324px;} div.jp-volume-bar-value{background:url("../img/jplayer.blue.monday.png") 0 -256px repeat-x;width:0;height:5px;} -div.jp-current-time,div.jp-duration{position:absolute;font-size:.64em;font-style:oblique;top:49px;left:164px;width:122px;} +div.jp-current-time,div.jp-duration{position:absolute;font-size:.64em;font-style:oblique;top:45px;left:164px;width:122px;} div.jp-duration{text-align:right;} -- cgit v1.2.3 From be45ad904e46a3d11dccb5cda93e827d7e023910 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 26 Jul 2011 16:58:46 +0200 Subject: remove debug alert --- files/js/filelist.js | 1 - 1 file changed, 1 deletion(-) diff --git a/files/js/filelist.js b/files/js/filelist.js index 46ddc230cf0..973fda23e1e 100644 --- a/files/js/filelist.js +++ b/files/js/filelist.js @@ -54,7 +54,6 @@ FileList={ } } } - alert(pos); if(fileElements.length){ if(pos==-1){ $(fileElements[0]).before(element); -- cgit v1.2.3 From 00da23faf6b17cc39c310fab163d122f646098a5 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 26 Jul 2011 17:00:29 +0200 Subject: no longer show deleted files as selected --- files/js/files.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/files/js/files.js b/files/js/files.js index 7842c680300..e1ac4e172fc 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -107,9 +107,11 @@ $(document).ready(function() { data: "dir="+$('#dir').val()+"&files="+encodeURIComponent(files), complete: function(data){ boolOperationFinished(data, function(){ - $('td.filename input:checkbox:checked').parent().parent().each(function(i,element){ - FileList.remove($(element).data('file')); - }); + var files=getSelectedFiles('name'); + for(var i=0;i Date: Wed, 27 Jul 2011 12:05:41 +0200 Subject: updated localization script and removed duplicate strings --- l10n/l10n.pl | 12 ++++-------- l10n/templates/admin.pot | 2 +- l10n/templates/core.pot | 2 +- l10n/templates/help.pot | 2 +- l10n/templates/log.pot | 2 +- l10n/templates/settings.pot | 2 +- 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/l10n/l10n.pl b/l10n/l10n.pl index 0ad33d2116b..b993727e8f1 100644 --- a/l10n/l10n.pl +++ b/l10n/l10n.pl @@ -3,6 +3,7 @@ use strict; use Locale::PO; use Cwd; use Data::Dumper; +use File::Path; sub crawl{ my( $dir ) = @_; @@ -28,7 +29,7 @@ sub crawl{ my $task = shift( @ARGV ); my $place = '..'; -die( "Usuage: l10n.pl task\ntask: read, write\n") unless $task && $place; +die( "Usage: l10n.pl task\ntask: read, write\n" ) unless $task && $place; # Our current position my $whereami = cwd(); @@ -38,6 +39,7 @@ die( "Program must be executed in a l10n-folder called 'l10n'" ) unless $wheream my @dirs = crawl( $place ); # Languages +rmtree( 'templates' ); mkdir( 'templates' ) unless -d 'templates'; my @languages = (); @@ -55,13 +57,7 @@ if( $task eq 'read' ){ my $app = pop( @temp ); chdir( $dir ); my $output = "${whereami}/templates/$app.pot"; - - if( -e $output ){ - `xgettext --files-from=xgettextfiles --join-existing --output="$output" --keyword=t` - } - else{ - `xgettext --files-from=xgettextfiles --output="$output" --keyword=t` - } + `xgettext --files-from=xgettextfiles --output="$output" --keyword=t`; chdir( $whereami ); } } diff --git a/l10n/templates/admin.pot b/l10n/templates/admin.pot index 411ecacce97..d6233365185 100644 --- a/l10n/templates/admin.pot +++ b/l10n/templates/admin.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-27 08:52+0200\n" +"POT-Creation-Date: 2011-07-27 12:03+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/l10n/templates/core.pot b/l10n/templates/core.pot index 8b73bf7ef10..6bcadf8cfc7 100644 --- a/l10n/templates/core.pot +++ b/l10n/templates/core.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-27 08:52+0200\n" +"POT-Creation-Date: 2011-07-27 12:03+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/l10n/templates/help.pot b/l10n/templates/help.pot index 362fdf123d7..e5ffb5a4cf5 100644 --- a/l10n/templates/help.pot +++ b/l10n/templates/help.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-27 08:52+0200\n" +"POT-Creation-Date: 2011-07-27 12:03+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/l10n/templates/log.pot b/l10n/templates/log.pot index 54b633c2f1b..ea98e5c2b14 100644 --- a/l10n/templates/log.pot +++ b/l10n/templates/log.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-27 08:52+0200\n" +"POT-Creation-Date: 2011-07-27 12:03+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/l10n/templates/settings.pot b/l10n/templates/settings.pot index 8c077f56889..24e255fa259 100644 --- a/l10n/templates/settings.pot +++ b/l10n/templates/settings.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-27 08:52+0200\n" +"POT-Creation-Date: 2011-07-27 12:03+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -- cgit v1.2.3 From 6585e83037541bc2126b111b39ce867f9ec09ad3 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 27 Jul 2011 16:38:23 +0200 Subject: fix flash fallback for media player and bumb version of jplayer to 2.0.23 --- apps/media/css/player.css | 2 +- apps/media/js/Jplayer.swf | Bin 7679 -> 7679 bytes apps/media/js/jquery.jplayer.min.js | 78 +----------------------------------- apps/media/js/player.js | 1 + apps/media/templates/player.php | 3 +- 5 files changed, 4 insertions(+), 80 deletions(-) diff --git a/apps/media/css/player.css b/apps/media/css/player.css index bf404f515fd..a21b82d1f4a 100644 --- a/apps/media/css/player.css +++ b/apps/media/css/player.css @@ -1,5 +1,5 @@ #jp-interface{position:fixed;z-index:100;width:25em;left:201px;top:-10px;height:80px;border-bottom:none;} -#jp-interface.player{display:hidden;} +#jp-interface div.player{height:0px} #jp-interface ul.jp-controls{list-style-type:none;padding:0;} #jp-interface ul.jp-controls li{display:inline;} #jp-interface ul.jp-controls a{position:absolute;overflow:hidden;text-indent:-9999px;} diff --git a/apps/media/js/Jplayer.swf b/apps/media/js/Jplayer.swf index 9487f49b5a6..c213fd578e5 100644 Binary files a/apps/media/js/Jplayer.swf and b/apps/media/js/Jplayer.swf differ diff --git a/apps/media/js/jquery.jplayer.min.js b/apps/media/js/jquery.jplayer.min.js index 1bcbb530d96..9ba8b0c45c7 100644 --- a/apps/media/js/jquery.jplayer.min.js +++ b/apps/media/js/jquery.jplayer.min.js @@ -1,78 +1,2 @@ -/* - * jPlayer Plugin for jQuery JavaScript Library - * http://www.happyworm.com/jquery/jplayer - * - * Copyright (c) 2009 - 2010 Happyworm Ltd - * Dual licensed under the MIT and GPL licenses. - * - http://www.opensource.org/licenses/mit-license.php - * - http://www.gnu.org/copyleft/gpl.html - * - * Author: Mark J Panaghiston - * Version: 2.0.0 - * Date: 20th December 2010 - */ -(function(c,h){c.fn.jPlayer=function(a){var b=typeof a==="string",d=Array.prototype.slice.call(arguments,1),f=this;a=!b&&d.length?c.extend.apply(null,[true,a].concat(d)):a;if(b&&a.charAt(0)==="_")return f;b?this.each(function(){var e=c.data(this,"jPlayer"),g=e&&c.isFunction(e[a])?e[a].apply(e,d):e;if(g!==e&&g!==h){f=g;return false}}):this.each(function(){var e=c.data(this,"jPlayer");if(e){e.option(a||{})._init();e.option(a||{})}else c.data(this,"jPlayer",new c.jPlayer(a,this))});return f};c.jPlayer= -function(a,b){if(arguments.length){this.element=c(b);this.options=c.extend(true,{},this.options,a);var d=this;this.element.bind("remove.jPlayer",function(){d.destroy()});this._init()}};c.jPlayer.event={ready:"jPlayer_ready",resize:"jPlayer_resize",error:"jPlayer_error",warning:"jPlayer_warning",loadstart:"jPlayer_loadstart",progress:"jPlayer_progress",suspend:"jPlayer_suspend",abort:"jPlayer_abort",emptied:"jPlayer_emptied",stalled:"jPlayer_stalled",play:"jPlayer_play",pause:"jPlayer_pause",loadedmetadata:"jPlayer_loadedmetadata", -loadeddata:"jPlayer_loadeddata",waiting:"jPlayer_waiting",playing:"jPlayer_playing",canplay:"jPlayer_canplay",canplaythrough:"jPlayer_canplaythrough",seeking:"jPlayer_seeking",seeked:"jPlayer_seeked",timeupdate:"jPlayer_timeupdate",ended:"jPlayer_ended",ratechange:"jPlayer_ratechange",durationchange:"jPlayer_durationchange",volumechange:"jPlayer_volumechange"};c.jPlayer.htmlEvent=["loadstart","abort","emptied","stalled","loadedmetadata","loadeddata","canplaythrough","ratechange"];c.jPlayer.pause= -function(){c.each(c.jPlayer.prototype.instances,function(a,b){b.data("jPlayer").status.srcSet&&b.jPlayer("pause")})};c.jPlayer.timeFormat={showHour:false,showMin:true,showSec:true,padHour:false,padMin:true,padSec:true,sepHour:":",sepMin:":",sepSec:""};c.jPlayer.convertTime=function(a){a=new Date(a*1E3);var b=a.getUTCHours(),d=a.getUTCMinutes();a=a.getUTCSeconds();b=c.jPlayer.timeFormat.padHour&&b<10?"0"+b:b;d=c.jPlayer.timeFormat.padMin&&d<10?"0"+d:d;a=c.jPlayer.timeFormat.padSec&&a<10?"0"+a:a;return(c.jPlayer.timeFormat.showHour? -b+c.jPlayer.timeFormat.sepHour:"")+(c.jPlayer.timeFormat.showMin?d+c.jPlayer.timeFormat.sepMin:"")+(c.jPlayer.timeFormat.showSec?a+c.jPlayer.timeFormat.sepSec:"")};c.jPlayer.uaMatch=function(a){a=a.toLowerCase();var b=/(opera)(?:.*version)?[ \/]([\w.]+)/,d=/(msie) ([\w.]+)/,f=/(mozilla)(?:.*? rv:([\w.]+))?/;a=/(webkit)[ \/]([\w.]+)/.exec(a)||b.exec(a)||d.exec(a)||a.indexOf("compatible")<0&&f.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}};c.jPlayer.browser={};var m=c.jPlayer.uaMatch(navigator.userAgent); -if(m.browser){c.jPlayer.browser[m.browser]=true;c.jPlayer.browser.version=m.version}c.jPlayer.prototype={count:0,version:{script:"2.0.0",needFlash:"2.0.0",flash:"unknown"},options:{swfPath:"js",solution:"html, flash",supplied:"mp3",preload:"metadata",volume:0.8,muted:false,backgroundColor:"#000000",cssSelectorAncestor:"#jp_interface_1",cssSelector:{videoPlay:".jp-video-play",play:".jp-play",pause:".jp-pause",stop:".jp-stop",seekBar:".jp-seek-bar",playBar:".jp-play-bar",mute:".jp-mute",unmute:".jp-unmute", -volumeBar:".jp-volume-bar",volumeBarValue:".jp-volume-bar-value",currentTime:".jp-current-time",duration:".jp-duration"},idPrefix:"jp",errorAlerts:false,warningAlerts:false},instances:{},status:{src:"",media:{},paused:true,format:{},formatType:"",waitForPlay:true,waitForLoad:true,srcSet:false,video:false,seekPercent:0,currentPercentRelative:0,currentPercentAbsolute:0,currentTime:0,duration:0},_status:{volume:h,muted:false,width:0,height:0},internal:{ready:false,instance:h,htmlDlyCmdId:h},solution:{html:true, -flash:true},format:{mp3:{codec:'audio/mpeg; codecs="mp3"',flashCanPlay:true,media:"audio"},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:true,media:"audio"},oga:{codec:'audio/ogg; codecs="vorbis"',flashCanPlay:false,media:"audio"},wav:{codec:'audio/wav; codecs="1"',flashCanPlay:false,media:"audio"},webma:{codec:'audio/webm; codecs="vorbis"',flashCanPlay:false,media:"audio"},m4v:{codec:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:true,media:"video"},ogv:{codec:'video/ogg; codecs="theora, vorbis"', -flashCanPlay:false,media:"video"},webmv:{codec:'video/webm; codecs="vorbis, vp8"',flashCanPlay:false,media:"video"}},_init:function(){var a=this;this.element.empty();this.status=c.extend({},this.status,this._status);this.internal=c.extend({},this.internal);this.formats=[];this.solutions=[];this.require={};this.htmlElement={};this.html={};this.html.audio={};this.html.video={};this.flash={};this.css={};this.css.cs={};this.css.jq={};this.status.volume=this._limitValue(this.options.volume,0,1);this.status.muted= -this.options.muted;this.status.width=this.element.css("width");this.status.height=this.element.css("height");this.element.css({"background-color":this.options.backgroundColor});c.each(this.options.supplied.toLowerCase().split(","),function(e,g){var i=g.replace(/^\s+|\s+$/g,"");if(a.format[i]){var j=false;c.each(a.formats,function(n,k){if(i===k){j=true;return false}});j||a.formats.push(i)}});c.each(this.options.solution.toLowerCase().split(","),function(e,g){var i=g.replace(/^\s+|\s+$/g,"");if(a.solution[i]){var j= -false;c.each(a.solutions,function(n,k){if(i===k){j=true;return false}});j||a.solutions.push(i)}});this.internal.instance="jp_"+this.count;this.instances[this.internal.instance]=this.element;this.element.attr("id")===""&&this.element.attr("id",this.options.idPrefix+"_jplayer_"+this.count);this.internal.self=c.extend({},{id:this.element.attr("id"),jq:this.element});this.internal.audio=c.extend({},{id:this.options.idPrefix+"_audio_"+this.count,jq:h});this.internal.video=c.extend({},{id:this.options.idPrefix+ -"_video_"+this.count,jq:h});this.internal.flash=c.extend({},{id:this.options.idPrefix+"_flash_"+this.count,jq:h,swf:this.options.swfPath+(this.options.swfPath!==""&&this.options.swfPath.slice(-1)!=="/"?"/":"")+"Jplayer.swf"});this.internal.poster=c.extend({},{id:this.options.idPrefix+"_poster_"+this.count,jq:h});c.each(c.jPlayer.event,function(e,g){if(a.options[e]!==h){a.element.bind(g+".jPlayer",a.options[e]);a.options[e]=h}});this.htmlElement.poster=document.createElement("img");this.htmlElement.poster.id= -this.internal.poster.id;this.htmlElement.poster.onload=function(){if(!a.status.video||a.status.waitForPlay)a.internal.poster.jq.show()};this.element.append(this.htmlElement.poster);this.internal.poster.jq=c("#"+this.internal.poster.id);this.internal.poster.jq.css({width:this.status.width,height:this.status.height});this.internal.poster.jq.hide();this.require.audio=false;this.require.video=false;c.each(this.formats,function(e,g){a.require[a.format[g].media]=true});this.html.audio.available=false;if(this.require.audio){this.htmlElement.audio= -document.createElement("audio");this.htmlElement.audio.id=this.internal.audio.id;this.html.audio.available=!!this.htmlElement.audio.canPlayType}this.html.video.available=false;if(this.require.video){this.htmlElement.video=document.createElement("video");this.htmlElement.video.id=this.internal.video.id;this.html.video.available=!!this.htmlElement.video.canPlayType}this.flash.available=this._checkForFlash(10);this.html.canPlay={};this.flash.canPlay={};c.each(this.formats,function(e,g){a.html.canPlay[g]= -a.html[a.format[g].media].available&&""!==a.htmlElement[a.format[g].media].canPlayType(a.format[g].codec);a.flash.canPlay[g]=a.format[g].flashCanPlay&&a.flash.available});this.html.desired=false;this.flash.desired=false;c.each(this.solutions,function(e,g){if(e===0)a[g].desired=true;else{var i=false,j=false;c.each(a.formats,function(n,k){if(a[a.solutions[0]].canPlay[k])if(a.format[k].media==="video")j=true;else i=true});a[g].desired=a.require.audio&&!i||a.require.video&&!j}});this.html.support={}; -this.flash.support={};c.each(this.formats,function(e,g){a.html.support[g]=a.html.canPlay[g]&&a.html.desired;a.flash.support[g]=a.flash.canPlay[g]&&a.flash.desired});this.html.used=false;this.flash.used=false;c.each(this.solutions,function(e,g){c.each(a.formats,function(i,j){if(a[g].support[j]){a[g].used=true;return false}})});this.html.used||this.flash.used||this._error({type:c.jPlayer.error.NO_SOLUTION,context:"{solution:'"+this.options.solution+"', supplied:'"+this.options.supplied+"'}",message:c.jPlayer.errorMsg.NO_SOLUTION, -hint:c.jPlayer.errorHint.NO_SOLUTION});this.html.active=false;this.html.audio.gate=false;this.html.video.gate=false;this.flash.active=false;this.flash.gate=false;if(this.flash.used){var b="id="+escape(this.internal.self.id)+"&vol="+this.status.volume+"&muted="+this.status.muted;if(c.browser.msie&&Number(c.browser.version)<=8){var d='';f[1]='';f[2]='';f[3]='';f[4]='';b=document.createElement(d);for(d=0;d0?100*d/this.status.duration:0;if(typeof a.seekable==="object"&&a.seekable.length>0){e=this.status.duration>0?100*a.seekable.end(a.seekable.length-1)/this.status.duration:100;g=100*a.currentTime/a.seekable.end(a.seekable.length-1)}else{e=100;g=f}if(b)f=g=d=0;this.status.seekPercent=e;this.status.currentPercentRelative=g;this.status.currentPercentAbsolute=f;this.status.currentTime=d},_resetStatus:function(){this.status=c.extend({},this.status,c.jPlayer.prototype.status)}, -_trigger:function(a,b,d){a=c.Event(a);a.jPlayer={};a.jPlayer.version=c.extend({},this.version);a.jPlayer.status=c.extend(true,{},this.status);a.jPlayer.html=c.extend(true,{},this.html);a.jPlayer.flash=c.extend(true,{},this.flash);if(b)a.jPlayer.error=c.extend({},b);if(d)a.jPlayer.warning=c.extend({},d);this.element.trigger(a)},jPlayerFlashEvent:function(a,b){if(a===c.jPlayer.event.ready&&!this.internal.ready){this.internal.ready=true;this.version.flash=b.version;this.version.needFlash!==this.version.flash&& -this._error({type:c.jPlayer.error.VERSION,context:this.version.flash,message:c.jPlayer.errorMsg.VERSION+this.version.flash,hint:c.jPlayer.errorHint.VERSION});this._trigger(a)}if(this.flash.gate)switch(a){case c.jPlayer.event.progress:this._getFlashStatus(b);this._updateInterface();this._trigger(a);break;case c.jPlayer.event.timeupdate:this._getFlashStatus(b);this._updateInterface();this._trigger(a);break;case c.jPlayer.event.play:this._seeked();this._updateButtons(true);this._trigger(a);break;case c.jPlayer.event.pause:this._updateButtons(false); -this._trigger(a);break;case c.jPlayer.event.ended:this._updateButtons(false);this._trigger(a);break;case c.jPlayer.event.error:this.status.waitForLoad=true;this.status.waitForPlay=true;this.status.video&&this.internal.flash.jq.css({width:"0px",height:"0px"});this._validString(this.status.media.poster)&&this.internal.poster.jq.show();this.css.jq.videoPlay.length&&this.css.jq.videoPlay.show();this.status.video?this._flash_setVideo(this.status.media):this._flash_setAudio(this.status.media);this._error({type:c.jPlayer.error.URL, -context:b.src,message:c.jPlayer.errorMsg.URL,hint:c.jPlayer.errorHint.URL});break;case c.jPlayer.event.seeking:this._seeking();this._trigger(a);break;case c.jPlayer.event.seeked:this._seeked();this._trigger(a);break;default:this._trigger(a)}return false},_getFlashStatus:function(a){this.status.seekPercent=a.seekPercent;this.status.currentPercentRelative=a.currentPercentRelative;this.status.currentPercentAbsolute=a.currentPercentAbsolute;this.status.currentTime=a.currentTime;this.status.duration=a.duration}, -_updateButtons:function(a){this.status.paused=!a;if(this.css.jq.play.length&&this.css.jq.pause.length)if(a){this.css.jq.play.hide();this.css.jq.pause.show()}else{this.css.jq.play.show();this.css.jq.pause.hide()}},_updateInterface:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.width(this.status.seekPercent+"%");this.css.jq.playBar.length&&this.css.jq.playBar.width(this.status.currentPercentRelative+"%");this.css.jq.currentTime.length&&this.css.jq.currentTime.text(c.jPlayer.convertTime(this.status.currentTime)); -this.css.jq.duration.length&&this.css.jq.duration.text(c.jPlayer.convertTime(this.status.duration))},_seeking:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.addClass("jp-seeking-bg")},_seeked:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.removeClass("jp-seeking-bg")},setMedia:function(a){var b=this;this._seeked();clearTimeout(this.internal.htmlDlyCmdId);var d=this.html.audio.gate,f=this.html.video.gate,e=false;c.each(this.formats,function(g,i){var j=b.format[i].media==="video"; -c.each(b.solutions,function(n,k){if(b[k].support[i]&&b._validString(a[i])){var l=k==="html";if(j)if(l){b.html.audio.gate=false;b.html.video.gate=true;b.flash.gate=false}else{b.html.audio.gate=false;b.html.video.gate=false;b.flash.gate=true}else if(l){b.html.audio.gate=true;b.html.video.gate=false;b.flash.gate=false}else{b.html.audio.gate=false;b.html.video.gate=false;b.flash.gate=true}if(b.flash.active||b.html.active&&b.flash.gate||d===b.html.audio.gate&&f===b.html.video.gate)b.clearMedia();else if(d!== -b.html.audio.gate&&f!==b.html.video.gate){b._html_pause();b.status.video&&b.internal.video.jq.css({width:"0px",height:"0px"});b._resetStatus()}if(j){if(l){b._html_setVideo(a);b.html.active=true;b.flash.active=false}else{b._flash_setVideo(a);b.html.active=false;b.flash.active=true}b.css.jq.videoPlay.length&&b.css.jq.videoPlay.show();b.status.video=true}else{if(l){b._html_setAudio(a);b.html.active=true;b.flash.active=false}else{b._flash_setAudio(a);b.html.active=false;b.flash.active=true}b.css.jq.videoPlay.length&& -b.css.jq.videoPlay.hide();b.status.video=false}e=true;return false}});if(e)return false});if(e){if(this._validString(a.poster))if(this.htmlElement.poster.src!==a.poster)this.htmlElement.poster.src=a.poster;else this.internal.poster.jq.show();else this.internal.poster.jq.hide();this.status.srcSet=true;this.status.media=c.extend({},a);this._updateButtons(false);this._updateInterface()}else{this.status.srcSet&&!this.status.waitForPlay&&this.pause();this.html.audio.gate=false;this.html.video.gate=false; -this.flash.gate=false;this.html.active=false;this.flash.active=false;this._resetStatus();this._updateInterface();this._updateButtons(false);this.internal.poster.jq.hide();this.html.used&&this.require.video&&this.internal.video.jq.css({width:"0px",height:"0px"});this.flash.used&&this.internal.flash.jq.css({width:"0px",height:"0px"});this._error({type:c.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:c.jPlayer.errorMsg.NO_SUPPORT,hint:c.jPlayer.errorHint.NO_SUPPORT})}}, -clearMedia:function(){this._resetStatus();this._updateButtons(false);this.internal.poster.jq.hide();clearTimeout(this.internal.htmlDlyCmdId);if(this.html.active)this._html_clearMedia();else this.flash.active&&this._flash_clearMedia()},load:function(){if(this.status.srcSet)if(this.html.active)this._html_load();else this.flash.active&&this._flash_load();else this._urlNotSetError("load")},play:function(a){a=typeof a==="number"?a:NaN;if(this.status.srcSet)if(this.html.active)this._html_play(a);else this.flash.active&& -this._flash_play(a);else this._urlNotSetError("play")},videoPlay:function(){this.play()},pause:function(a){a=typeof a==="number"?a:NaN;if(this.status.srcSet)if(this.html.active)this._html_pause(a);else this.flash.active&&this._flash_pause(a);else this._urlNotSetError("pause")},pauseOthers:function(){var a=this;c.each(this.instances,function(b,d){a.element!==d&&d.data("jPlayer").status.srcSet&&d.jPlayer("pause")})},stop:function(){if(this.status.srcSet)if(this.html.active)this._html_pause(0);else this.flash.active&& -this._flash_pause(0);else this._urlNotSetError("stop")},playHead:function(a){a=this._limitValue(a,0,100);if(this.status.srcSet)if(this.html.active)this._html_playHead(a);else this.flash.active&&this._flash_playHead(a);else this._urlNotSetError("playHead")},mute:function(){this.status.muted=true;this.html.used&&this._html_mute(true);this.flash.used&&this._flash_mute(true);this._updateMute(true);this._updateVolume(0);this._trigger(c.jPlayer.event.volumechange)},unmute:function(){this.status.muted=false; -this.html.used&&this._html_mute(false);this.flash.used&&this._flash_mute(false);this._updateMute(false);this._updateVolume(this.status.volume);this._trigger(c.jPlayer.event.volumechange)},_updateMute:function(a){if(this.css.jq.mute.length&&this.css.jq.unmute.length)if(a){this.css.jq.mute.hide();this.css.jq.unmute.show()}else{this.css.jq.mute.show();this.css.jq.unmute.hide()}},volume:function(a){a=this._limitValue(a,0,1);this.status.volume=a;this.html.used&&this._html_volume(a);this.flash.used&&this._flash_volume(a); -this.status.muted||this._updateVolume(a);this._trigger(c.jPlayer.event.volumechange)},volumeBar:function(a){if(!this.status.muted&&this.css.jq.volumeBar){var b=this.css.jq.volumeBar.offset();a=a.pageX-b.left;b=this.css.jq.volumeBar.width();this.volume(a/b)}},volumeBarValue:function(a){this.volumeBar(a)},_updateVolume:function(a){this.css.jq.volumeBarValue.length&&this.css.jq.volumeBarValue.width(a*100+"%")},_volumeFix:function(a){var b=0.0010*Math.random();return a+(a<0.5?b:-b)},_cssSelectorAncestor:function(a, -b){this.options.cssSelectorAncestor=a;b&&c.each(this.options.cssSelector,function(d,f){self._cssSelector(d,f)})},_cssSelector:function(a,b){var d=this;if(typeof b==="string")if(c.jPlayer.prototype.options.cssSelector[a]){this.css.jq[a]&&this.css.jq[a].length&&this.css.jq[a].unbind(".jPlayer");this.options.cssSelector[a]=b;this.css.cs[a]=this.options.cssSelectorAncestor+" "+b;this.css.jq[a]=b?c(this.css.cs[a]):[];this.css.jq[a].length&&this.css.jq[a].bind("click.jPlayer",function(f){d[a](f);c(this).blur(); -return false});b&&this.css.jq[a].length!==1&&this._warning({type:c.jPlayer.warning.CSS_SELECTOR_COUNT,context:this.css.cs[a],message:c.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.css.jq[a].length+" found for "+a+" method.",hint:c.jPlayer.warningHint.CSS_SELECTOR_COUNT})}else this._warning({type:c.jPlayer.warning.CSS_SELECTOR_METHOD,context:a,message:c.jPlayer.warningMsg.CSS_SELECTOR_METHOD,hint:c.jPlayer.warningHint.CSS_SELECTOR_METHOD});else this._warning({type:c.jPlayer.warning.CSS_SELECTOR_STRING, -context:b,message:c.jPlayer.warningMsg.CSS_SELECTOR_STRING,hint:c.jPlayer.warningHint.CSS_SELECTOR_STRING})},seekBar:function(a){if(this.css.jq.seekBar){var b=this.css.jq.seekBar.offset();a=a.pageX-b.left;b=this.css.jq.seekBar.width();this.playHead(100*a/b)}},playBar:function(a){this.seekBar(a)},currentTime:function(){},duration:function(){},option:function(a,b){var d=a;if(arguments.length===0)return c.extend(true,{},this.options);if(typeof a==="string"){var f=a.split(".");if(b===h){for(var e=c.extend(true, -{},this.options),g=0;g=9||this.htmlElement.media.load()}},_html_load:function(){if(this.status.waitForLoad){this.status.waitForLoad=false;this.htmlElement.media.src=this.status.src; -try{this.htmlElement.media.load()}catch(a){}}clearTimeout(this.internal.htmlDlyCmdId)},_html_play:function(a){var b=this;this._html_load();this.htmlElement.media.play();if(!isNaN(a))try{this.htmlElement.media.currentTime=a}catch(d){this.internal.htmlDlyCmdId=setTimeout(function(){b.play(a)},100);return}this._html_checkWaitForPlay()},_html_pause:function(a){var b=this;a>0?this._html_load():clearTimeout(this.internal.htmlDlyCmdId);this.htmlElement.media.pause();if(!isNaN(a))try{this.htmlElement.media.currentTime= -a}catch(d){this.internal.htmlDlyCmdId=setTimeout(function(){b.pause(a)},100);return}a>0&&this._html_checkWaitForPlay()},_html_playHead:function(a){var b=this;this._html_load();try{if(typeof this.htmlElement.media.seekable==="object"&&this.htmlElement.media.seekable.length>0)this.htmlElement.media.currentTime=a*this.htmlElement.media.seekable.end(this.htmlElement.media.seekable.length-1)/100;else if(this.htmlElement.media.duration>0&&!isNaN(this.htmlElement.media.duration))this.htmlElement.media.currentTime= -a*this.htmlElement.media.duration/100;else throw"e";}catch(d){this.internal.htmlDlyCmdId=setTimeout(function(){b.playHead(a)},100);return}this.status.waitForLoad||this._html_checkWaitForPlay()},_html_checkWaitForPlay:function(){if(this.status.waitForPlay){this.status.waitForPlay=false;this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide();if(this.status.video){this.internal.poster.jq.hide();this.internal.video.jq.css({width:this.status.width,height:this.status.height})}}},_html_volume:function(a){if(this.html.audio.available)this.htmlElement.audio.volume= -a;if(this.html.video.available)this.htmlElement.video.volume=a},_html_mute:function(a){if(this.html.audio.available)this.htmlElement.audio.muted=a;if(this.html.video.available)this.htmlElement.video.muted=a},_flash_setAudio:function(a){var b=this;try{c.each(this.formats,function(f,e){if(b.flash.support[e]&&a[e]){switch(e){case "m4a":b._getMovie().fl_setAudio_m4a(a[e]);break;case "mp3":b._getMovie().fl_setAudio_mp3(a[e])}b.status.src=a[e];b.status.format[e]=true;b.status.formatType=e;return false}}); -if(this.options.preload==="auto"){this._flash_load();this.status.waitForLoad=false}}catch(d){this._flashError(d)}},_flash_setVideo:function(a){var b=this;try{c.each(this.formats,function(f,e){if(b.flash.support[e]&&a[e]){switch(e){case "m4v":b._getMovie().fl_setVideo_m4v(a[e])}b.status.src=a[e];b.status.format[e]=true;b.status.formatType=e;return false}});if(this.options.preload==="auto"){this._flash_load();this.status.waitForLoad=false}}catch(d){this._flashError(d)}},_flash_clearMedia:function(){this.internal.flash.jq.css({width:"0px", -height:"0px"});try{this._getMovie().fl_clearMedia()}catch(a){this._flashError(a)}},_flash_load:function(){try{this._getMovie().fl_load()}catch(a){this._flashError(a)}this.status.waitForLoad=false},_flash_play:function(a){try{this._getMovie().fl_play(a)}catch(b){this._flashError(b)}this.status.waitForLoad=false;this._flash_checkWaitForPlay()},_flash_pause:function(a){try{this._getMovie().fl_pause(a)}catch(b){this._flashError(b)}if(a>0){this.status.waitForLoad=false;this._flash_checkWaitForPlay()}}, -_flash_playHead:function(a){try{this._getMovie().fl_play_head(a)}catch(b){this._flashError(b)}this.status.waitForLoad||this._flash_checkWaitForPlay()},_flash_checkWaitForPlay:function(){if(this.status.waitForPlay){this.status.waitForPlay=false;this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide();if(this.status.video){this.internal.poster.jq.hide();this.internal.flash.jq.css({width:this.status.width,height:this.status.height})}}},_flash_volume:function(a){try{this._getMovie().fl_volume(a)}catch(b){this._flashError(b)}}, -_flash_mute:function(a){try{this._getMovie().fl_mute(a)}catch(b){this._flashError(b)}},_getMovie:function(){return document[this.internal.flash.id]},_checkForFlash:function(a){var b=false,d;if(window.ActiveXObject)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+a);b=true}catch(f){}else if(navigator.plugins&&navigator.mimeTypes.length>0)if(d=navigator.plugins["Shockwave Flash"])if(navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/,"$1")>=a)b=true;return c.browser.msie&& -Number(c.browser.version)>=9?false:b},_validString:function(a){return a&&typeof a==="string"},_limitValue:function(a,b,d){return ad?d:a},_urlNotSetError:function(a){this._error({type:c.jPlayer.error.URL_NOT_SET,context:a,message:c.jPlayer.errorMsg.URL_NOT_SET,hint:c.jPlayer.errorHint.URL_NOT_SET})},_flashError:function(a){this._error({type:c.jPlayer.error.FLASH,context:this.internal.flash.swf,message:c.jPlayer.errorMsg.FLASH+a.message,hint:c.jPlayer.errorHint.FLASH})},_error:function(a){this._trigger(c.jPlayer.event.error, -a);if(this.options.errorAlerts)this._alert("Error!"+(a.message?"\n\n"+a.message:"")+(a.hint?"\n\n"+a.hint:"")+"\n\nContext: "+a.context)},_warning:function(a){this._trigger(c.jPlayer.event.warning,h,a);if(this.options.errorAlerts)this._alert("Warning!"+(a.message?"\n\n"+a.message:"")+(a.hint?"\n\n"+a.hint:"")+"\n\nContext: "+a.context)},_alert:function(a){alert("jPlayer "+this.version.script+" : id='"+this.internal.self.id+"' : "+a)}};c.jPlayer.error={FLASH:"e_flash",NO_SOLUTION:"e_no_solution",NO_SUPPORT:"e_no_support", -URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"};c.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.", -VERSION:"jPlayer "+c.jPlayer.prototype.version.script+" needs Jplayer.swf version "+c.jPlayer.prototype.version.needFlash+" but found "};c.jPlayer.errorHint={FLASH:"Check your swfPath option and that Jplayer.swf is there.",NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."};c.jPlayer.warning= -{CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"};c.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of methodCssSelectors found did not equal one: ",CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",OPTION_KEY:"The option requested in jPlayer('option') is undefined."}; -c.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."}})(jQuery); \ No newline at end of file +(function($,undefined){$.fn.jPlayer=function(options){var name="jPlayer",isMethodCall=typeof options==="string",args=Array.prototype.slice.call(arguments,1),returnValue=this;options=!isMethodCall&&args.length?$.extend.apply(null,[true,options].concat(args)):options;if(isMethodCall&&options.charAt(0)==="_")return returnValue;if(isMethodCall){this.each(function(){var instance=$.data(this,name),methodValue=instance&&$.isFunction(instance[options])?instance[options].apply(instance,args):instance;if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue;return false}})}else this.each(function(){var instance=$.data(this,name);if(instance){instance.option(options||{})}else $.data(this,name,new $.jPlayer(options,this))});return returnValue};$.jPlayer=function(options,element){if(arguments.length){this.element=$(element);this.options=$.extend(true,{},this.options,options);var self=this;this.element.bind("remove.jPlayer",function(){self.destroy()});this._init()}};$.jPlayer.emulateMethods="load play pause";$.jPlayer.emulateStatus="src readyState networkState currentTime duration paused ended playbackRate";$.jPlayer.emulateOptions="muted volume";$.jPlayer.reservedEvent="ready flashreset resize repeat error warning";$.jPlayer.event={ready:"jPlayer_ready",flashreset:"jPlayer_flashreset",resize:"jPlayer_resize",repeat:"jPlayer_repeat",error:"jPlayer_error",warning:"jPlayer_warning",loadstart:"jPlayer_loadstart",progress:"jPlayer_progress",suspend:"jPlayer_suspend",abort:"jPlayer_abort",emptied:"jPlayer_emptied",stalled:"jPlayer_stalled",play:"jPlayer_play",pause:"jPlayer_pause",loadedmetadata:"jPlayer_loadedmetadata",loadeddata:"jPlayer_loadeddata",waiting:"jPlayer_waiting",playing:"jPlayer_playing",canplay:"jPlayer_canplay",canplaythrough:"jPlayer_canplaythrough",seeking:"jPlayer_seeking",seeked:"jPlayer_seeked",timeupdate:"jPlayer_timeupdate",ended:"jPlayer_ended",ratechange:"jPlayer_ratechange",durationchange:"jPlayer_durationchange",volumechange:"jPlayer_volumechange"};$.jPlayer.htmlEvent=["loadstart","abort","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","ratechange"];$.jPlayer.pause=function(){$.each($.jPlayer.prototype.instances,function(i,element){if(element.data("jPlayer").status.srcSet)element.jPlayer("pause")})};$.jPlayer.timeFormat={showHour:false,showMin:true,showSec:true,padHour:false,padMin:true,padSec:true,sepHour:":",sepMin:":",sepSec:""};$.jPlayer.convertTime=function(s){var myTime=new Date(s*1e3),hour=myTime.getUTCHours(),min=myTime.getUTCMinutes(),sec=myTime.getUTCSeconds(),strHour=($.jPlayer.timeFormat.padHour&&hour<10)?"0"+hour:hour,strMin=($.jPlayer.timeFormat.padMin&&min<10)?"0"+min:min,strSec=($.jPlayer.timeFormat.padSec&&sec<10)?"0"+sec:sec;return(($.jPlayer.timeFormat.showHour)?strHour+$.jPlayer.timeFormat.sepHour:"")+(($.jPlayer.timeFormat.showMin)?strMin+$.jPlayer.timeFormat.sepMin:"")+(($.jPlayer.timeFormat.showSec)?strSec+$.jPlayer.timeFormat.sepSec:"")};$.jPlayer.uaBrowser=function(userAgent){var ua=userAgent.toLowerCase(),rwebkit=/(webkit)[ \/]([\w.]+)/,ropera=/(opera)(?:.*version)?[ \/]([\w.]+)/,rmsie=/(msie) ([\w.]+)/,rmozilla=/(mozilla)(?:.*? rv:([\w.]+))?/,match=rwebkit.exec(ua)||ropera.exec(ua)||rmsie.exec(ua)||ua.indexOf("compatible")<0&&rmozilla.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"}};$.jPlayer.uaPlatform=function(userAgent){var ua=userAgent.toLowerCase(),rplatform=/(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/,rtablet=/(ipad|playbook)/,randroid=/(android)/,rmobile=/(mobile)/,platform=rplatform.exec(ua)||[],tablet=rtablet.exec(ua)||!rmobile.exec(ua)&&randroid.exec(ua)||[];return{platform:platform[1]||"",tablet:tablet[1]||""}};$.jPlayer.browser={};$.jPlayer.platform={};var browserMatch=$.jPlayer.uaBrowser(navigator.userAgent);if(browserMatch.browser){$.jPlayer.browser[browserMatch.browser]=true;$.jPlayer.browser.version=browserMatch.version};var platformMatch=$.jPlayer.uaPlatform(navigator.userAgent);if(platformMatch.platform){$.jPlayer.platform[platformMatch.platform]=true;$.jPlayer.platform.mobile=!platformMatch.tablet;$.jPlayer.platform.tablet=!!platformMatch.tablet};$.jPlayer.prototype={count:0,version:{script:"2.0.23",needFlash:"2.0.9",flash:"unknown"},options:{swfPath:"js",solution:"html, flash",supplied:"mp3",preload:'metadata',volume:0.8,muted:false,wmode:"opaque",backgroundColor:"#000000",cssSelectorAncestor:"#jp_container_1",cssSelector:{videoPlay:".jp-video-play",play:".jp-play",pause:".jp-pause",stop:".jp-stop",seekBar:".jp-seek-bar",playBar:".jp-play-bar",mute:".jp-mute",unmute:".jp-unmute",volumeBar:".jp-volume-bar",volumeBarValue:".jp-volume-bar-value",volumeMax:".jp-volume-max",currentTime:".jp-current-time",duration:".jp-duration",fullScreen:".jp-full-screen",restoreScreen:".jp-restore-screen",repeat:".jp-repeat",repeatOff:".jp-repeat-off",gui:".jp-gui"},fullScreen:false,autohide:{restored:false,full:true,fadeIn:200,fadeOut:600,hold:1e3},loop:false,repeat:function(event){if(event.jPlayer.options.loop){$(this).unbind(".jPlayerRepeat").bind($.jPlayer.event.ended+".jPlayer.jPlayerRepeat",function(){$(this).jPlayer("play")})}else $(this).unbind(".jPlayerRepeat")},idPrefix:"jp",noConflict:"jQuery",emulateHtml:false,errorAlerts:false,warningAlerts:false},optionsAudio:{size:{width:"0px",height:"0px",cssClass:""},sizeFull:{width:"0px",height:"0px",cssClass:""}},optionsVideo:{size:{width:"480px",height:"270px",cssClass:"jp-video-270p"},sizeFull:{width:"100%",height:"100%",cssClass:"jp-video-full"}},instances:{},status:{src:"",media:{},paused:true,format:{},formatType:"",waitForPlay:true,waitForLoad:true,srcSet:false,video:false,seekPercent:0,currentPercentRelative:0,currentPercentAbsolute:0,currentTime:0,duration:0,readyState:0,networkState:0,playbackRate:1,ended:0},internal:{ready:false},solution:{html:true,flash:true},format:{mp3:{codec:'audio/mpeg; codecs="mp3"',flashCanPlay:true,media:'audio'},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:true,media:'audio'},oga:{codec:'audio/ogg; codecs="vorbis"',flashCanPlay:false,media:'audio'},wav:{codec:'audio/wav; codecs="1"',flashCanPlay:false,media:'audio'},webma:{codec:'audio/webm; codecs="vorbis"',flashCanPlay:false,media:'audio'},fla:{codec:'audio/x-flv',flashCanPlay:true,media:'audio'},m4v:{codec:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:true,media:'video'},ogv:{codec:'video/ogg; codecs="theora, vorbis"',flashCanPlay:false,media:'video'},webmv:{codec:'video/webm; codecs="vorbis, vp8"',flashCanPlay:false,media:'video'},flv:{codec:'video/x-flv',flashCanPlay:true,media:'video'}},_init:function(){var self=this;this.element.empty();this.status=$.extend({},this.status);this.internal=$.extend({},this.internal);this.internal.domNode=this.element.get(0);this.formats=[];this.solutions=[];this.require={};this.htmlElement={};this.html={};this.html.audio={};this.html.video={};this.flash={};this.css={};this.css.cs={};this.css.jq={};this.ancestorJq=[];this.options.volume=this._limitValue(this.options.volume,0,1);$.each(this.options.supplied.toLowerCase().split(","),function(index1,value1){var format=value1.replace(/^\s+|\s+$/g,"");if(self.format[format]){var dupFound=false;$.each(self.formats,function(index2,value2){if(format===value2){dupFound=true;return false}});if(!dupFound)self.formats.push(format)}});$.each(this.options.solution.toLowerCase().split(","),function(index1,value1){var solution=value1.replace(/^\s+|\s+$/g,"");if(self.solution[solution]){var dupFound=false;$.each(self.solutions,function(index2,value2){if(solution===value2){dupFound=true;return false}});if(!dupFound)self.solutions.push(solution)}});this.internal.instance="jp_"+this.count;this.instances[this.internal.instance]=this.element;if(!this.element.attr("id"))this.element.attr("id",this.options.idPrefix+"_jplayer_"+this.count);this.internal.self=$.extend({},{id:this.element.attr("id"),jq:this.element});this.internal.audio=$.extend({},{id:this.options.idPrefix+"_audio_"+this.count,jq:undefined});this.internal.video=$.extend({},{id:this.options.idPrefix+"_video_"+this.count,jq:undefined});this.internal.flash=$.extend({},{id:this.options.idPrefix+"_flash_"+this.count,jq:undefined,swf:this.options.swfPath+((this.options.swfPath!==""&&this.options.swfPath.slice(-1)!=="/")?"/":"")+"Jplayer.swf"});this.internal.poster=$.extend({},{id:this.options.idPrefix+"_poster_"+this.count,jq:undefined});$.each($.jPlayer.event,function(eventName,eventType){if(self.options[eventName]!==undefined){self.element.bind(eventType+".jPlayer",self.options[eventName]);self.options[eventName]=undefined}});this.require.audio=false;this.require.video=false;$.each(this.formats,function(priority,format){self.require[self.format[format].media]=true});if(this.require.video){this.options=$.extend(true,{},this.optionsVideo,this.options)}else this.options=$.extend(true,{},this.optionsAudio,this.options);this._setSize();this.htmlElement.poster=document.createElement('img');this.htmlElement.poster.id=this.internal.poster.id;this.htmlElement.poster.onload=function(){if(!self.status.video||self.status.waitForPlay)self.internal.poster.jq.show()};this.element.append(this.htmlElement.poster);this.internal.poster.jq=$("#"+this.internal.poster.id);this.internal.poster.jq.css({width:this.status.width,height:this.status.height});this.internal.poster.jq.hide();this.html.audio.available=false;if(this.require.audio){this.htmlElement.audio=document.createElement('audio');this.htmlElement.audio.id=this.internal.audio.id;this.html.audio.available=!!this.htmlElement.audio.canPlayType};this.html.video.available=false;if(this.require.video){this.htmlElement.video=document.createElement('video');this.htmlElement.video.id=this.internal.video.id;this.html.video.available=!!this.htmlElement.video.canPlayType};this.flash.available=this._checkForFlash(10);this.html.canPlay={};this.flash.canPlay={};$.each(this.formats,function(priority,format){self.html.canPlay[format]=self.html[self.format[format].media].available&&""!==self.htmlElement[self.format[format].media].canPlayType(self.format[format].codec);self.flash.canPlay[format]=self.format[format].flashCanPlay&&self.flash.available});this.html.desired=false;this.flash.desired=false;$.each(this.solutions,function(solutionPriority,solution){if(solutionPriority===0){self[solution].desired=true}else{var audioCanPlay=false,videoCanPlay=false;$.each(self.formats,function(formatPriority,format){if(self[self.solutions[0]].canPlay[format])if(self.format[format].media==='video'){videoCanPlay=true}else audioCanPlay=true});self[solution].desired=(self.require.audio&&!audioCanPlay)||(self.require.video&&!videoCanPlay)}});this.html.support={};this.flash.support={};$.each(this.formats,function(priority,format){self.html.support[format]=self.html.canPlay[format]&&self.html.desired;self.flash.support[format]=self.flash.canPlay[format]&&self.flash.desired});this.html.used=false;this.flash.used=false;$.each(this.solutions,function(solutionPriority,solution){$.each(self.formats,function(formatPriority,format){if(self[solution].support[format]){self[solution].used=true;return false}})});this.html.active=false;this.html.audio.gate=false;this.html.video.gate=false;this.flash.active=false;this.flash.gate=false;this._cssSelectorAncestor(this.options.cssSelectorAncestor);if(!(this.html.used||this.flash.used))this._error({type:$.jPlayer.error.NO_SOLUTION,context:"{solution:'"+this.options.solution+"', supplied:'"+this.options.supplied+"'}",message:$.jPlayer.errorMsg.NO_SOLUTION,hint:$.jPlayer.errorHint.NO_SOLUTION});if(this.flash.used){var htmlObj,flashVars='jQuery='+encodeURI(this.options.noConflict)+'&id='+encodeURI(this.internal.self.id)+'&vol='+this.options.volume+'&muted='+this.options.muted;if($.browser.msie&&Number($.browser.version)<=8){var objStr='',paramStr=['','','','',''];htmlObj=document.createElement(objStr);for(var i=0;i0)?100*ct/this.status.duration:0;if((typeof media.seekable==="object")&&(media.seekable.length>0)){sp=(this.status.duration>0)?100*media.seekable.end(media.seekable.length-1)/this.status.duration:100;cpr=100*media.currentTime/media.seekable.end(media.seekable.length-1)}else{sp=100;cpr=cpa};if(override){ct=0;cpr=0;cpa=0};this.status.seekPercent=sp;this.status.currentPercentRelative=cpr;this.status.currentPercentAbsolute=cpa;this.status.currentTime=ct;this.status.readyState=media.readyState;this.status.networkState=media.networkState;this.status.playbackRate=media.playbackRate;this.status.ended=media.ended},_resetStatus:function(){this.status=$.extend({},this.status,$.jPlayer.prototype.status)},_trigger:function(eventType,error,warning){var event=$.Event(eventType);event.jPlayer={};event.jPlayer.version=$.extend({},this.version);event.jPlayer.options=$.extend(true,{},this.options);event.jPlayer.status=$.extend(true,{},this.status);event.jPlayer.html=$.extend(true,{},this.html);event.jPlayer.flash=$.extend(true,{},this.flash);if(error)event.jPlayer.error=$.extend({},error);if(warning)event.jPlayer.warning=$.extend({},warning);this.element.trigger(event)},jPlayerFlashEvent:function(eventType,status){if(eventType===$.jPlayer.event.ready)if(!this.internal.ready){this.internal.ready=true;this.internal.flash.jq.css({width:'0px',height:'0px'});this.version.flash=status.version;if(this.version.needFlash!==this.version.flash)this._error({type:$.jPlayer.error.VERSION,context:this.version.flash,message:$.jPlayer.errorMsg.VERSION+this.version.flash,hint:$.jPlayer.errorHint.VERSION});this._trigger($.jPlayer.event.repeat);this._trigger(eventType)}else if(this.flash.gate){if(this.status.srcSet){var currentTime=this.status.currentTime,paused=this.status.paused;this.setMedia(this.status.media);if(currentTime>0)if(paused){this.pause(currentTime)}else this.play(currentTime)};this._trigger($.jPlayer.event.flashreset)};if(this.flash.gate)switch(eventType){case $.jPlayer.event.progress:this._getFlashStatus(status);this._updateInterface();this._trigger(eventType);break;case $.jPlayer.event.timeupdate:this._getFlashStatus(status);this._updateInterface();this._trigger(eventType);break;case $.jPlayer.event.play:this._seeked();this._updateButtons(true);this._trigger(eventType);break;case $.jPlayer.event.pause:this._updateButtons(false);this._trigger(eventType);break;case $.jPlayer.event.ended:this._updateButtons(false);this._trigger(eventType);break;case $.jPlayer.event.error:this.status.waitForLoad=true;this.status.waitForPlay=true;if(this.status.video)this.internal.flash.jq.css({width:'0px',height:'0px'});if(this._validString(this.status.media.poster))this.internal.poster.jq.show();if(this.css.jq.videoPlay.length)this.css.jq.videoPlay.show();if(this.status.video){this._flash_setVideo(this.status.media)}else this._flash_setAudio(this.status.media);this._error({type:$.jPlayer.error.URL,context:status.src,message:$.jPlayer.errorMsg.URL,hint:$.jPlayer.errorHint.URL});break;case $.jPlayer.event.seeking:this._seeking();this._trigger(eventType);break;case $.jPlayer.event.seeked:this._seeked();this._trigger(eventType);break;case $.jPlayer.event.ready:break;default:this._trigger(eventType)};return false},_getFlashStatus:function(status){this.status.seekPercent=status.seekPercent;this.status.currentPercentRelative=status.currentPercentRelative;this.status.currentPercentAbsolute=status.currentPercentAbsolute;this.status.currentTime=status.currentTime;this.status.duration=status.duration;this.status.readyState=4;this.status.networkState=0;this.status.playbackRate=1;this.status.ended=false},_updateButtons:function(playing){if(playing!==undefined){this.status.paused=!playing;if(this.css.jq.play.length&&this.css.jq.pause.length)if(playing){this.css.jq.play.hide();this.css.jq.pause.show()}else{this.css.jq.play.show();this.css.jq.pause.hide()}};if(this.css.jq.restoreScreen.length&&this.css.jq.fullScreen.length)if(this.options.fullScreen){this.css.jq.fullScreen.hide();this.css.jq.restoreScreen.show()}else{this.css.jq.fullScreen.show();this.css.jq.restoreScreen.hide()};if(this.css.jq.repeat.length&&this.css.jq.repeatOff.length)if(this.options.loop){this.css.jq.repeat.hide();this.css.jq.repeatOff.show()}else{this.css.jq.repeat.show();this.css.jq.repeatOff.hide()}},_updateInterface:function(){if(this.css.jq.seekBar.length)this.css.jq.seekBar.width(this.status.seekPercent+"%");if(this.css.jq.playBar.length)this.css.jq.playBar.width(this.status.currentPercentRelative+"%");if(this.css.jq.currentTime.length)this.css.jq.currentTime.text($.jPlayer.convertTime(this.status.currentTime));if(this.css.jq.duration.length)this.css.jq.duration.text($.jPlayer.convertTime(this.status.duration))},_seeking:function(){if(this.css.jq.seekBar.length)this.css.jq.seekBar.addClass("jp-seeking-bg")},_seeked:function(){if(this.css.jq.seekBar.length)this.css.jq.seekBar.removeClass("jp-seeking-bg")},setMedia:function(media){var self=this;this._seeked();clearTimeout(this.internal.htmlDlyCmdId);var audioGate=this.html.audio.gate,videoGate=this.html.video.gate,supported=false;$.each(this.formats,function(formatPriority,format){var isVideo=self.format[format].media==='video';$.each(self.solutions,function(solutionPriority,solution){if(self[solution].support[format]&&self._validString(media[format])){var isHtml=solution==='html';if(isVideo){if(isHtml){self.html.audio.gate=false;self.html.video.gate=true;self.flash.gate=false}else{self.html.audio.gate=false;self.html.video.gate=false;self.flash.gate=true}}else if(isHtml){self.html.audio.gate=true;self.html.video.gate=false;self.flash.gate=false}else{self.html.audio.gate=false;self.html.video.gate=false;self.flash.gate=true};if(self.flash.active||(self.html.active&&self.flash.gate)||(audioGate===self.html.audio.gate&&videoGate===self.html.video.gate)){self.clearMedia()}else if(audioGate!==self.html.audio.gate&&videoGate!==self.html.video.gate){self._html_pause();if(self.status.video)self.internal.video.jq.css({width:'0px',height:'0px'});self._resetStatus()};if(isVideo){if(isHtml){self._html_setVideo(media);self.html.active=true;self.flash.active=false}else{self._flash_setVideo(media);self.html.active=false;self.flash.active=true};if(self.css.jq.videoPlay.length)self.css.jq.videoPlay.show();self.status.video=true}else{if(isHtml){self._html_setAudio(media);self.html.active=true;self.flash.active=false}else{self._flash_setAudio(media);self.html.active=false;self.flash.active=true};if(self.css.jq.videoPlay.length)self.css.jq.videoPlay.hide();self.status.video=false};supported=true;return false}});if(supported)return false});if(supported){if(this._validString(media.poster)){if(this.htmlElement.poster.src!==media.poster){this.htmlElement.poster.src=media.poster}else this.internal.poster.jq.show()}else this.internal.poster.jq.hide();this.status.srcSet=true;this.status.media=$.extend({},media);this._updateButtons(false);this._updateInterface()}else{if(this.status.srcSet&&!this.status.waitForPlay)this.pause();this.html.audio.gate=false;this.html.video.gate=false;this.flash.gate=false;this.html.active=false;this.flash.active=false;this._resetStatus();this._updateInterface();this._updateButtons(false);this.internal.poster.jq.hide();if(this.html.used&&this.require.video)this.internal.video.jq.css({width:'0px',height:'0px'});if(this.flash.used)this.internal.flash.jq.css({width:'0px',height:'0px'});this._error({type:$.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:$.jPlayer.errorMsg.NO_SUPPORT,hint:$.jPlayer.errorHint.NO_SUPPORT})}},clearMedia:function(){this._resetStatus();this._updateButtons(false);this.internal.poster.jq.hide();clearTimeout(this.internal.htmlDlyCmdId);if(this.html.active){this._html_clearMedia()}else if(this.flash.active)this._flash_clearMedia()},load:function(){if(this.status.srcSet){if(this.html.active){this._html_load()}else if(this.flash.active)this._flash_load()}else this._urlNotSetError("load")},play:function(time){time=(typeof time==="number")?time:NaN;if(this.status.srcSet){if(this.html.active){this._html_play(time)}else if(this.flash.active)this._flash_play(time)}else this._urlNotSetError("play")},videoPlay:function(e){this.play()},pause:function(time){time=(typeof time==="number")?time:NaN;if(this.status.srcSet){if(this.html.active){this._html_pause(time)}else if(this.flash.active)this._flash_pause(time)}else this._urlNotSetError("pause")},pauseOthers:function(){var self=this;$.each(this.instances,function(i,element){if(self.element!==element)if(element.data("jPlayer").status.srcSet)element.jPlayer("pause")})},stop:function(){if(this.status.srcSet){if(this.html.active){this._html_pause(0)}else if(this.flash.active)this._flash_pause(0)}else this._urlNotSetError("stop")},playHead:function(p){p=this._limitValue(p,0,100);if(this.status.srcSet){if(this.html.active){this._html_playHead(p)}else if(this.flash.active)this._flash_playHead(p)}else this._urlNotSetError("playHead")},_muted:function(muted){this.options.muted=muted;if(this.html.used)this._html_mute(muted);if(this.flash.used)this._flash_mute(muted);if(this.flash.gate){this._updateMute(muted);this._updateVolume(this.options.volume);this._trigger($.jPlayer.event.volumechange)}},mute:function(mute){mute=mute===undefined?true:!!mute;this._muted(mute)},unmute:function(unmute){unmute=unmute===undefined?true:!!unmute;this._muted(!unmute)},_updateMute:function(mute){if(mute===undefined)mute=this.options.muted;if(this.css.jq.mute.length&&this.css.jq.unmute.length)if(mute){this.css.jq.mute.hide();this.css.jq.unmute.show()}else{this.css.jq.mute.show();this.css.jq.unmute.hide()}},volume:function(v){v=this._limitValue(v,0,1);this.options.volume=v;if(this.html.used)this._html_volume(v);if(this.flash.used)this._flash_volume(v);if(this.flash.gate){this._updateVolume(v);this._trigger($.jPlayer.event.volumechange)}},volumeBar:function(e){if(this.css.jq.volumeBar.length){var offset=this.css.jq.volumeBar.offset(),x=e.pageX-offset.left,w=this.css.jq.volumeBar.width(),v=x/w;this.volume(v)};if(this.options.muted)this._muted(false)},volumeBarValue:function(e){this.volumeBar(e)},_updateVolume:function(v){if(v===undefined)v=this.options.volume;v=this.options.muted?0:v;if(this.css.jq.volumeBarValue.length)this.css.jq.volumeBarValue.width((v*100)+"%")},volumeMax:function(){this.volume(1);if(this.options.muted)this._muted(false)},_cssSelectorAncestor:function(ancestor){var self=this;this.options.cssSelectorAncestor=ancestor;this._removeUiClass();this.ancestorJq=ancestor?$(ancestor):[];if(ancestor&&this.ancestorJq.length!==1)this._warning({type:$.jPlayer.warning.CSS_SELECTOR_COUNT,context:ancestor,message:$.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.ancestorJq.length+" found for cssSelectorAncestor.",hint:$.jPlayer.warningHint.CSS_SELECTOR_COUNT});this._addUiClass();$.each(this.options.cssSelector,function(fn,cssSel){self._cssSelector(fn,cssSel)})},_cssSelector:function(fn,cssSel){var self=this;if(typeof cssSel==='string'){if($.jPlayer.prototype.options.cssSelector[fn]){if(this.css.jq[fn]&&this.css.jq[fn].length)this.css.jq[fn].unbind(".jPlayer");this.options.cssSelector[fn]=cssSel;this.css.cs[fn]=this.options.cssSelectorAncestor+" "+cssSel;if(cssSel){this.css.jq[fn]=$(this.css.cs[fn])}else this.css.jq[fn]=[];if(this.css.jq[fn].length){var handler=function(e){self[fn](e);$(this).blur();return false};this.css.jq[fn].bind("click.jPlayer",handler)};if(cssSel&&this.css.jq[fn].length!==1)this._warning({type:$.jPlayer.warning.CSS_SELECTOR_COUNT,context:this.css.cs[fn],message:$.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.css.jq[fn].length+" found for "+fn+" method.",hint:$.jPlayer.warningHint.CSS_SELECTOR_COUNT})}else this._warning({type:$.jPlayer.warning.CSS_SELECTOR_METHOD,context:fn,message:$.jPlayer.warningMsg.CSS_SELECTOR_METHOD,hint:$.jPlayer.warningHint.CSS_SELECTOR_METHOD})}else this._warning({type:$.jPlayer.warning.CSS_SELECTOR_STRING,context:cssSel,message:$.jPlayer.warningMsg.CSS_SELECTOR_STRING,hint:$.jPlayer.warningHint.CSS_SELECTOR_STRING})},seekBar:function(e){if(this.css.jq.seekBar){var offset=this.css.jq.seekBar.offset(),x=e.pageX-offset.left,w=this.css.jq.seekBar.width(),p=100*x/w;this.playHead(p)}},playBar:function(e){this.seekBar(e)},repeat:function(){this._loop(true)},repeatOff:function(){this._loop(false)},_loop:function(loop){if(this.options.loop!==loop){this.options.loop=loop;this._updateButtons();this._trigger($.jPlayer.event.repeat)}},currentTime:function(e){},duration:function(e){},gui:function(e){},option:function(key,value){var options=key;if(arguments.length===0)return $.extend(true,{},this.options);if(typeof key==="string"){var keys=key.split(".");if(value===undefined){var opt=$.extend(true,{},this.options);for(var i=0;i0){this._html_load()}else clearTimeout(this.internal.htmlDlyCmdId);this.htmlElement.media.pause();if(!isNaN(time))try{this.htmlElement.media.currentTime=time}catch(err){this.internal.htmlDlyCmdId=setTimeout(function(){self.pause(time)},100);return};if(time>0)this._html_checkWaitForPlay()},_html_playHead:function(percent){var self=this;this._html_load();try{if((typeof this.htmlElement.media.seekable==="object")&&(this.htmlElement.media.seekable.length>0)){this.htmlElement.media.currentTime=percent*this.htmlElement.media.seekable.end(this.htmlElement.media.seekable.length-1)/100}else if(this.htmlElement.media.duration>0&&!isNaN(this.htmlElement.media.duration)){this.htmlElement.media.currentTime=percent*this.htmlElement.media.duration/100}else throw"e"}catch(err){this.internal.htmlDlyCmdId=setTimeout(function(){self.playHead(percent)},100);return};if(!this.status.waitForLoad)this._html_checkWaitForPlay()},_html_checkWaitForPlay:function(){if(this.status.waitForPlay){this.status.waitForPlay=false;if(this.css.jq.videoPlay.length)this.css.jq.videoPlay.hide();if(this.status.video){this.internal.poster.jq.hide();this.internal.video.jq.css({width:this.status.width,height:this.status.height})}}},_html_volume:function(v){if(this.html.audio.available)this.htmlElement.audio.volume=v;if(this.html.video.available)this.htmlElement.video.volume=v},_html_mute:function(m){if(this.html.audio.available)this.htmlElement.audio.muted=m;if(this.html.video.available)this.htmlElement.video.muted=m},_flash_setAudio:function(media){var self=this;try{$.each(this.formats,function(priority,format){if(self.flash.support[format]&&media[format]){switch(format){case"m4a":case"fla":self._getMovie().fl_setAudio_m4a(media[format]);break;case"mp3":self._getMovie().fl_setAudio_mp3(media[format]);break};self.status.src=media[format];self.status.format[format]=true;self.status.formatType=format;return false}});if(this.options.preload==='auto'){this._flash_load();this.status.waitForLoad=false}}catch(err){this._flashError(err)}},_flash_setVideo:function(media){var self=this;try{$.each(this.formats,function(priority,format){if(self.flash.support[format]&&media[format]){switch(format){case"m4v":case"flv":self._getMovie().fl_setVideo_m4v(media[format]);break};self.status.src=media[format];self.status.format[format]=true;self.status.formatType=format;return false}});if(this.options.preload==='auto'){this._flash_load();this.status.waitForLoad=false}}catch(err){this._flashError(err)}},_flash_clearMedia:function(){this.internal.flash.jq.css({width:'0px',height:'0px'});try{this._getMovie().fl_clearMedia()}catch(err){this._flashError(err)}},_flash_load:function(){try{this._getMovie().fl_load()}catch(err){this._flashError(err)};this.status.waitForLoad=false},_flash_play:function(time){try{this._getMovie().fl_play(time)}catch(err){this._flashError(err)};this.status.waitForLoad=false;this._flash_checkWaitForPlay()},_flash_pause:function(time){try{this._getMovie().fl_pause(time)}catch(err){this._flashError(err)};if(time>0){this.status.waitForLoad=false;this._flash_checkWaitForPlay()}},_flash_playHead:function(p){try{this._getMovie().fl_play_head(p)}catch(err){this._flashError(err)};if(!this.status.waitForLoad)this._flash_checkWaitForPlay()},_flash_checkWaitForPlay:function(){if(this.status.waitForPlay){this.status.waitForPlay=false;if(this.css.jq.videoPlay.length)this.css.jq.videoPlay.hide();if(this.status.video){this.internal.poster.jq.hide();this.internal.flash.jq.css({width:this.status.width,height:this.status.height})}}},_flash_volume:function(v){try{this._getMovie().fl_volume(v)}catch(err){this._flashError(err)}},_flash_mute:function(m){try{this._getMovie().fl_mute(m)}catch(err){this._flashError(err)}},_getMovie:function(){return document[this.internal.flash.id]},_checkForFlash:function(version){var flashIsInstalled=false,flash;if(window.ActiveXObject){try{flash=new ActiveXObject(("ShockwaveFlash.ShockwaveFlash."+version));flashIsInstalled=true}catch(e){}}else if(navigator.plugins&&navigator.mimeTypes.length>0){flash=navigator.plugins["Shockwave Flash"];if(flash){var flashVersion=navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/,"$1");if(flashVersion>=version)flashIsInstalled=true}};return flashIsInstalled},_validString:function(url){return(url&&typeof url==="string")},_limitValue:function(value,min,max){return(valuemax)?max:value)},_urlNotSetError:function(context){this._error({type:$.jPlayer.error.URL_NOT_SET,context:context,message:$.jPlayer.errorMsg.URL_NOT_SET,hint:$.jPlayer.errorHint.URL_NOT_SET})},_flashError:function(error){var errorType;if(!this.internal.ready){errorType="FLASH"}else errorType="FLASH_DISABLED";this._error({type:$.jPlayer.error[errorType],context:this.internal.flash.swf,message:$.jPlayer.errorMsg[errorType]+error.message,hint:$.jPlayer.errorHint[errorType]})},_error:function(error){this._trigger($.jPlayer.event.error,error);if(this.options.errorAlerts)this._alert("Error!"+(error.message?"\n\n"+error.message:"")+(error.hint?"\n\n"+error.hint:"")+"\n\nContext: "+error.context)},_warning:function(warning){this._trigger($.jPlayer.event.warning,undefined,warning);if(this.options.warningAlerts)this._alert("Warning!"+(warning.message?"\n\n"+warning.message:"")+(warning.hint?"\n\n"+warning.hint:"")+"\n\nContext: "+warning.context)},_alert:function(message){alert("jPlayer "+this.version.script+" : id='"+this.internal.self.id+"' : "+message)},_emulateHtmlBridge:function(){var self=this,methods=$.jPlayer.emulateMethods;$.each($.jPlayer.emulateMethods.split(/\s+/g),function(i,name){self.internal.domNode[name]=function(arg){self[name](arg)}});$.each($.jPlayer.event,function(eventName,eventType){var nativeEvent=true;$.each($.jPlayer.reservedEvent.split(/\s+/g),function(i,name){if(name===eventName){nativeEvent=false;return false}});if(nativeEvent)self.element.bind(eventType+".jPlayer.jPlayerHtml",function(){self._emulateHtmlUpdate();var domEvent=document.createEvent("Event");domEvent.initEvent(eventName,false,true);self.internal.domNode.dispatchEvent(domEvent)})})},_emulateHtmlUpdate:function(){var self=this;$.each($.jPlayer.emulateStatus.split(/\s+/g),function(i,name){self.internal.domNode[name]=self.status[name]});$.each($.jPlayer.emulateOptions.split(/\s+/g),function(i,name){self.internal.domNode[name]=self.options[name]})},_destroyHtmlBridge:function(){var self=this;this.element.unbind(".jPlayerHtml");var emulated=$.jPlayer.emulateMethods+" "+$.jPlayer.emulateStatus+" "+$.jPlayer.emulateOptions;$.each(emulated.split(/\s+/g),function(i,name){delete self.internal.domNode[name]})}};$.jPlayer.error={FLASH:"e_flash",FLASH_DISABLED:"e_flash_disabled",NO_SOLUTION:"e_no_solution",NO_SUPPORT:"e_no_support",URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"};$.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",FLASH_DISABLED:"jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ",NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",VERSION:"jPlayer "+$.jPlayer.prototype.version.script+" needs Jplayer.swf version "+$.jPlayer.prototype.version.needFlash+" but found "};$.jPlayer.errorHint={FLASH:"Check your swfPath option and that Jplayer.swf is there.",FLASH_DISABLED:"Check that you have not display:none; the jPlayer entity or any ancestor.",NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."};$.jPlayer.warning={CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"};$.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of css selectors found did not equal one: ",CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",OPTION_KEY:"The option requested in jPlayer('option') is undefined."};$.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."}})(jQuery) diff --git a/apps/media/js/player.js b/apps/media/js/player.js index f638b86e192..f76628110a8 100644 --- a/apps/media/js/player.js +++ b/apps/media/js/player.js @@ -62,6 +62,7 @@ var PlayList={ } }, cssSelectorAncestor:'#jp-interface', + swfPath:OC.linkTo('media','js'), }); }, add:function(song){ diff --git a/apps/media/templates/player.php b/apps/media/templates/player.php index abba806510e..b307f984734 100644 --- a/apps/media/templates/player.php +++ b/apps/media/templates/player.php @@ -17,7 +17,6 @@ - -
    +
    \ No newline at end of file -- cgit v1.2.3 From 606dec8da026d3aceb75abb64c936a09a3bd9133 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 27 Jul 2011 16:39:44 +0200 Subject: some minor changes in the javascript translation function also provide Array.prototype.indexOf for browser that don't support it nativale (IE) --- core/js/js.js | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/core/js/js.js b/core/js/js.js index 9117f08349a..593a637137c 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1,26 +1,27 @@ -var _l10ncache = {}; function t(app,text){ - if( !( app in _l10ncache )){ - $.post( oc_webroot+'/core/ajax/translations.php', {'app': app}, function(jsondata){ - _l10ncache[app] = jsondata.data; + if( !( app in t.cache )){ + + $.post( OC.filePath('core','ajax','translations.php'), {'app': app}, function(jsondata){ + t.cache[app] = jsondata.data; }); // Bad answer ... - if( !( app in _l10ncache )){ - _l10ncache[app] = []; + if( !( app in t.cache )){ + t.cache[app] = []; } } - if( typeof( _l10ncache[app][text] ) !== 'undefined' ){ - return _l10ncache[app][text]; + if( typeof( t.cache[app][text] ) !== 'undefined' ){ + return t.cache[app][text]; } else{ return text; } } +t.cache={}; OC={ webroot:oc_webroot, - coreApps:['files','admin','log','search','settings'], + coreApps:['files','admin','log','search','settings','core'], linkTo:function(app,file){ return OC.filePath(app,'',file); }, @@ -55,3 +56,25 @@ OC={ $('head').append(style); } } + +if (!Array.prototype.indexOf){ + Array.prototype.indexOf = function(elt /*, from*/) + { + var len = this.length; + + var from = Number(arguments[1]) || 0; + from = (from < 0) + ? Math.ceil(from) + : Math.floor(from); + if (from < 0) + from += len; + + for (; from < len; from++) + { + if (from in this && + this[from] === elt) + return from; + } + return -1; + }; +} \ No newline at end of file -- cgit v1.2.3 From 556bf2ef4ddf1aa47f1ebd90494f562076fdeac2 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 27 Jul 2011 16:57:49 +0200 Subject: fix broken merge --- core/js/js.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/js/js.js b/core/js/js.js index 3a820544b78..2f74bda2588 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -73,6 +73,8 @@ if (!Array.prototype.filter) { } } return res; + } +} if (!Array.prototype.indexOf){ Array.prototype.indexOf = function(elt /*, from*/) { -- cgit v1.2.3 From 7505720350369943d4b1a8be5f3840ada424221b Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 27 Jul 2011 22:44:51 +0200 Subject: fix log when no tablename prefix is used --- lib/log.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/log.php b/lib/log.php index 894575ef059..764c094c919 100644 --- a/lib/log.php +++ b/lib/log.php @@ -51,7 +51,7 @@ class OC_LOG { * This function adds another entry to the log database */ public static function add( $appid, $subject, $predicate, $object = ' ' ){ - $query=OC_DB::prepare("INSERT INTO *PREFIX*log(moment,appid,user,action,info) VALUES(NOW(),?,?,?,?)"); + $query=OC_DB::prepare("INSERT INTO `*PREFIX*log`(moment,appid,user,action,info) VALUES(NOW(),?,?,?,?)"); $result=$query->execute(array($appid,$subject,$predicate,$object)); // Die if we have an error if( PEAR::isError($result)) { @@ -79,7 +79,7 @@ class OC_LOG { * - app: only entries for this app */ public static function get( $filter = array()){ - $queryString='SELECT * FROM *PREFIX*log WHERE 1=1 ORDER BY moment DESC'; + $queryString='SELECT * FROM `*PREFIX*log` WHERE 1=1 ORDER BY moment DESC'; $params=array(); if(isset($filter['from'])){ $queryString.='AND moment>? '; @@ -116,7 +116,7 @@ class OC_LOG { * This function deletes all entries that are older than $date. */ public static function deleteBefore( $date ){ - $query=OC_DB::prepare("DELETE FROM *PREFIX*log WHERE momentexecute(array($date)); return true; } @@ -128,7 +128,7 @@ class OC_LOG { * This function deletes all log entries. */ public static function deleteAll(){ - $query=OC_DB::prepare("DELETE FROM *PREFIX*log"); + $query=OC_DB::prepare("DELETE FROM `*PREFIX*log`"); $query->execute(); return true; } -- cgit v1.2.3 From 7d5bc7974d9f7e7e3e1380b56fc77fd0eb3b87e1 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 27 Jul 2011 23:23:46 +0200 Subject: do not show default file action in the file action list on hover --- files/js/fileactions.js | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/files/js/fileactions.js b/files/js/fileactions.js index 3ad417c91c4..a6891a5f82d 100644 --- a/files/js/fileactions.js +++ b/files/js/fileactions.js @@ -52,19 +52,22 @@ FileActions={ $('#file_menu').empty(); parent.append($('#file_menu')); var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType()); + var defaultAction=FileActions.getDefault(FileActions.getCurrentMimeType(),FileActions.getCurrentType()); for(name in actions){ - var html=''+name+''; - var element=$(html); - element.data('action',name); - element.click(function(event){ - event.stopPropagation(); - event.preventDefault(); - var action=actions[$(this).data('action')]; - var currentFile=FileActions.getCurrentFile(); - FileActions.hide(); - action(currentFile); - }); - $('#file_menu').append(element); + if(actions[name]!=defaultAction){ + var html=''+name+''; + var element=$(html); + element.data('action',name); + element.click(function(event){ + event.stopPropagation(); + event.preventDefault(); + var action=actions[$(this).data('action')]; + var currentFile=FileActions.getCurrentFile(); + FileActions.hide(); + action(currentFile); + }); + $('#file_menu').append(element); + } } $('#file_menu').show(); return false; -- cgit v1.2.3 From 90ecd2c293f96a2e5041767afaf4266af30c4601 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 27 Jul 2011 23:31:38 +0200 Subject: deleting stuff is scary, lets move the button as far to the right as possible it doesn't fit good currently in the column but will be fixed with using icons --- files/css/files.css | 2 +- files/js/fileactions.js | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/files/css/files.css b/files/css/files.css index 590c7bac364..37cb64bff0b 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -88,7 +88,7 @@ table td.filesize, table td.date table td.date { - width: 11em; + width: 12em; } table td.selection, table th.selection, table td.fileaction diff --git a/files/js/fileactions.js b/files/js/fileactions.js index a6891a5f82d..4920e803b71 100644 --- a/files/js/fileactions.js +++ b/files/js/fileactions.js @@ -54,7 +54,7 @@ FileActions={ var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType()); var defaultAction=FileActions.getDefault(FileActions.getCurrentMimeType(),FileActions.getCurrentType()); for(name in actions){ - if(actions[name]!=defaultAction){ + if(actions[name]!=defaultAction && name!='Delete'){ var html=''+name+''; var element=$(html); element.data('action',name); @@ -69,12 +69,27 @@ FileActions={ $('#file_menu').append(element); } } + if(actions['Delete']){ + var html='Delete'; + var element=$(html); + element.data('action','Delete'); + element.click(function(event){ + event.stopPropagation(); + event.preventDefault(); + var action=actions[$(this).data('action')]; + var currentFile=FileActions.getCurrentFile(); + FileActions.hide(); + action(currentFile); + }); + parent.parent().children().last().append(element); + } $('#file_menu').show(); return false; }, hide:function(){ $('#file_menu').hide(); $('#file_menu').empty(); + $('#action_delete').remove(); $('body').append($('#file_menu')); }, getCurrentFile:function(){ -- cgit v1.2.3 From 25c48e6aed35084d3bd49e5b577a4ace9f640bc8 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Thu, 28 Jul 2011 00:21:11 +0200 Subject: lots of small style fixes for the file list --- core/css/styles.css | 4 ++- files/css/files.css | 65 ++++++++++------------------------------------- files/js/files.js | 32 +++++++++++++---------- files/templates/index.php | 6 ++--- 4 files changed, 37 insertions(+), 70 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index 7a26c2f6703..f5f54a1c9f6 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -5,7 +5,9 @@ body { background:#fefefe url('../img/body_background.jpg') repeat-y left top; f #owncloud { float:left; margin:0 0 0 2em; } h1 { margin:1em 3em 1em 0; border-bottom:1px solid #666; text-transform:uppercase; font-weight:normal; font-style:italic; color:#666; } p.center { text-align:center; } -a { color:#000; text-decoration:none; } +a { color:#000; text-decoration:none; outline:0; } +table { white-space:nowrap; } +input { background:#fff; cursor:pointer; } form#user_settings { max-width:600px; } form#user_settings p label { display:block; float:left; width:35%; padding:0.4em 0.5em 0 0; text-align:right; } diff --git a/files/css/files.css b/files/css/files.css index 590c7bac364..c00b595fd2f 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -17,7 +17,6 @@ .file_upload_form, #file_newfolder_form { display: inline; - margin-left:3em; } #fileSelector, #file_upload_submit, #file_newfolder_submit { @@ -37,14 +36,14 @@ #file_newfolder_name { background-image:url("../img/folder.png"); font-weight:bold; - width: 14em; + width: 11em; } .file_upload_start, .file_upload_filename{ position:absolute; top:0px; left:0px; - width:30ex; + width:11em; font-size: 0.9em; } @@ -54,7 +53,7 @@ left:-2em; display: -moz-inline-box; /* fallback for older firefox versions*/ display: inline-block; - width:30ex; + width:12em; } #file_newfolder_submit, #file_upload_submit { @@ -76,39 +75,6 @@ table { tbody tr:hover, tbody tr:active, tbody tr.selected { background-color:#eee; } tbody a { color:#000; } -table td.filesize, table td.date -{ - width: 7em; - padding: 0.5em 1em; - text-align: right; -} -#headerSize{ - text-align:right; -} - -table td.date -{ - width: 11em; -} - -table td.selection, table th.selection, table td.fileaction -{ - width: 2em; - text-align: center; -} - -td.filename{ - position:relative; -} - -.dropArrow{ - height:16px; - width:16px; - display: -moz-inline-box; /* fallback for older firefox versions*/ - display: inline-block; - background-image:url('../img/drop-arrow.png'); -} - span.extention{ color:#999; } @@ -118,23 +84,23 @@ div.crumb{ display:block; background-repeat:no-repeat; background-position:right 0px; - font-size:20px; + font-weight:bold; padding-top:8px; padding-left:8px; height:28px; /*36-8*/ } table tr.mouseOver td { background-color:#eee; } -table th, table td { padding:0; border-bottom:1px solid #ddd; text-align:left; font-style:italic; } -table th { padding:0.5em; } +table th { padding:.5em; } +table th .name { float:left; margin-left:.5em; } +table th, table td { border-bottom:1px solid #ddd; text-align:left; font-weight:normal; } table td { border-bottom:1px solid #eee; font-style:normal; } -table td.date { width:11em; } +table th#headerSize, table td.filesize, table th#headerDate, table td.date { width:4em; padding:0 1em; text-align:right; cursor:help; } table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; } table td.filename a { display:block; background-image:url('../img/file.png'); text-decoration:none; } -table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:0.5em 0.5em 0.5em 3em; background-position:1em center; background-repeat:no-repeat; } +table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:.5em .5em .5em 3em; background-position:1em center; background-repeat:no-repeat; } table td.filename a:hover, table td.filename a:focus { outline:0; } table td.filename a:active { outline:0; } -table em { font-weight:bold; } table td.filename a.folder-up { background-image:url('../img/back.png'); font-style:italic; } table td.filename a.folder { background-image:url('../img/folder.png'); } table td.filename a.folder-home { background-image:url('../img/home.png'); } @@ -151,16 +117,11 @@ table td.download { background-image:url('../img/download.png'); } table td.upload { background-image:url('../img/upload.png'); } table td.create { background-image:url('../img/folder-new.png'); } table td.delete { background-image:url('../img/delete.png'); } -#fileList tr input[type=checkbox] { display:none; float:left; margin:0.7em; margin-left:1em; } -#fileList tr input[type=checkbox]:checked { display:inline; } -#fileList tr:hover input[type=checkbox] { display:inline; } -#fileList tr:hover td.filename a{background-image:none !important} -#fileList tr.selected td.filename a{background-image:none !important} +#fileList tr input[type=checkbox] { display:none; float:left; margin:.7em 0 0 1em; /* bigger clickable area doesn’t work in FF width:2.8em; height:2.4em;*/ } +#fileList tr input[type=checkbox]:checked, #fileList tr:hover input[type=checkbox] { display:inline; } +#fileList tr.selected td.filename a, #fileList tr:hover td.filename a{background-image:none !important} #select_all{float:left; margin:0.2em; margin-left:0.6em; } -#selectedActions{ - float:right; - display:none; -} +#selectedActions { float:right; display:none; } #uploadsize-message{display:none} /* add breadcrumb divider to the File item in navigation panel */ diff --git a/files/js/files.js b/files/js/files.js index e1ac4e172fc..23d4c0205f0 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -328,7 +328,9 @@ function procesSelection(){ var selectedFolders=selected.filter(function(el){return el.type=='dir'}); if(selectedFiles.length==0 && selectedFolders.length==0){ $('#headerName>span.name').text('Name'); - $('#headerSize').text('Size (MB)'); + $('#headerSize').text('Size MB'); + $('#headerDate').text('Modified'); + $('th').css({background:'#fff',fontWeight:'normal'}); $('#selectedActions').hide(); }else{ $('#selectedActions').show(); @@ -347,26 +349,28 @@ function procesSelection(){ totalSize= '>1000'; } } - $('#headerSize').text(totalSize+' (MB)'); + $('#headerSize').text(totalSize+' MB'); var selection=''; - if(selectedFiles.length>0){ - if(selectedFiles.length==1){ - selection+='1 File'; + if(selectedFolders.length>0){ + if(selectedFolders.length==1){ + selection+='1 folder'; }else{ - selection+=selectedFiles.length+' Files'; + selection+=selectedFolders.length+' folders'; } - if(selectedFolders.length>0){ - selection+=' ,'; + if(selectedFiles.length>0){ + selection+=' & '; } } - if(selectedFolders.length>0){ - if(selectedFolders.length==1){ - selection+='1 Folder'; + if(selectedFiles.length>0){ + if(selectedFiles.length==1){ + selection+='1 file'; }else{ - selection+=selectedFolders.length+' Folders'; + selection+=selectedFiles.length+' files'; } } - $('#headerName>span.name').text(selection+' Selected'); + $('#headerName>span.name').text(selection); + $('#headerDate').text(''); + $('th').css({background:'#ddd', fontWeight:'bold'}); } } @@ -396,4 +400,4 @@ function getSelectedFiles(property){ } }); return files; -} \ No newline at end of file +} diff --git a/files/templates/index.php b/files/templates/index.php index b0d4f556f4a..e0c4fd39c15 100644 --- a/files/templates/index.php +++ b/files/templates/index.php @@ -34,8 +34,8 @@ Delete - t( 'Size (MB)' ); ?> - t( 'Modified' ); ?> + t( 'Size MB' ); ?> + t( 'Modified' ); ?> @@ -43,7 +43,7 @@ -
    +

    t( 'The files you are trying to upload exceed the maximum size for file uploads on this server.' ); ?>

    -- cgit v1.2.3 From 78f47c07e078aa9cde119c0eb32a8adc111569f8 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Thu, 28 Jul 2011 00:36:31 +0200 Subject: show arrow cursor instead of text caret by default --- core/css/styles.css | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index f5f54a1c9f6..ac4a6448af2 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -1,4 +1,4 @@ -* { margin:0; padding:0; border:0; } +* { margin:0; padding:0; border:0; cursor:default; } body { background:#fefefe url('../img/body_background.jpg') repeat-y left top; font:normal 80%/1.6em "Lucida Grande", Arial, Verdana, sans-serif; color:#000; } #header { position:fixed; top:0; z-index:100; width:100%; height:2.5em; padding:0.5em 1.5em; background:url('../img/header-a.png') repeat-x left top; } #body-settings #header { background-image:url('../img/header-settings-a.png'); } @@ -7,7 +7,9 @@ h1 { margin:1em 3em 1em 0; border-bottom:1px solid #666; text-transform:uppercas p.center { text-align:center; } a { color:#000; text-decoration:none; outline:0; } table { white-space:nowrap; } -input { background:#fff; cursor:pointer; } +input { background:#fff; } +a, a img, a strong, a span, input, button, select, li { cursor:pointer; } +input[type="text"], input[type="password"] { cursor:text; } form#user_settings { max-width:600px; } form#user_settings p label { display:block; float:left; width:35%; padding:0.4em 0.5em 0 0; text-align:right; } -- cgit v1.2.3 From 9a88f066c58c27152f8c58d5778140b872aa0be6 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Thu, 28 Jul 2011 01:15:36 +0200 Subject: first part of file action icons implementation --- core/img/actions/delete.png | Bin 0 -> 330 bytes core/img/actions/delete.svg | 70 ++++++++++++++++++++++++++++++++++++ core/img/actions/download.png | Bin 0 -> 264 bytes core/img/actions/download.svg | 73 ++++++++++++++++++++++++++++++++++++++ core/img/actions/rename.png | Bin 0 -> 339 bytes core/img/actions/rename.svg | 80 ++++++++++++++++++++++++++++++++++++++++++ core/img/actions/share.png | Bin 0 -> 478 bytes core/img/actions/share.svg | 70 ++++++++++++++++++++++++++++++++++++ files/css/files.css | 5 +-- files/templates/index.php | 4 +-- 10 files changed, 298 insertions(+), 4 deletions(-) create mode 100644 core/img/actions/delete.png create mode 100644 core/img/actions/delete.svg create mode 100644 core/img/actions/download.png create mode 100644 core/img/actions/download.svg create mode 100644 core/img/actions/rename.png create mode 100644 core/img/actions/rename.svg create mode 100644 core/img/actions/share.png create mode 100644 core/img/actions/share.svg diff --git a/core/img/actions/delete.png b/core/img/actions/delete.png new file mode 100644 index 00000000000..97f089524b2 Binary files /dev/null and b/core/img/actions/delete.png differ diff --git a/core/img/actions/delete.svg b/core/img/actions/delete.svg new file mode 100644 index 00000000000..e542b6fed3a --- /dev/null +++ b/core/img/actions/delete.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/core/img/actions/download.png b/core/img/actions/download.png new file mode 100644 index 00000000000..783ad448449 Binary files /dev/null and b/core/img/actions/download.png differ diff --git a/core/img/actions/download.svg b/core/img/actions/download.svg new file mode 100644 index 00000000000..67277b87e3e --- /dev/null +++ b/core/img/actions/download.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/core/img/actions/rename.png b/core/img/actions/rename.png new file mode 100644 index 00000000000..9a86919df5a Binary files /dev/null and b/core/img/actions/rename.png differ diff --git a/core/img/actions/rename.svg b/core/img/actions/rename.svg new file mode 100644 index 00000000000..adda394ddf9 --- /dev/null +++ b/core/img/actions/rename.svg @@ -0,0 +1,80 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/core/img/actions/share.png b/core/img/actions/share.png new file mode 100644 index 00000000000..300ce57544d Binary files /dev/null and b/core/img/actions/share.png differ diff --git a/core/img/actions/share.svg b/core/img/actions/share.svg new file mode 100644 index 00000000000..7812971e387 --- /dev/null +++ b/core/img/actions/share.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/files/css/files.css b/files/css/files.css index c00b595fd2f..7db46e3b0a7 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -95,7 +95,7 @@ table th { padding:.5em; } table th .name { float:left; margin-left:.5em; } table th, table td { border-bottom:1px solid #ddd; text-align:left; font-weight:normal; } table td { border-bottom:1px solid #eee; font-style:normal; } -table th#headerSize, table td.filesize, table th#headerDate, table td.date { width:4em; padding:0 1em; text-align:right; cursor:help; } +table th#headerSize, table td.filesize, table th#headerDate, table td.date { width:5em; padding:0 1em; text-align:right; cursor:help; } table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; } table td.filename a { display:block; background-image:url('../img/file.png'); text-decoration:none; } table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:.5em .5em .5em 3em; background-position:1em center; background-repeat:no-repeat; } @@ -122,7 +122,8 @@ table td.delete { background-image:url('../img/delete.png'); } #fileList tr.selected td.filename a, #fileList tr:hover td.filename a{background-image:none !important} #select_all{float:left; margin:0.2em; margin-left:0.6em; } #selectedActions { float:right; display:none; } -#uploadsize-message{display:none} +#selectedActions a { margin:0 .5em; } +#uploadsize-message{ display:none; } /* add breadcrumb divider to the File item in navigation panel */ #plugins li:first-child{ diff --git a/files/templates/index.php b/files/templates/index.php index e0c4fd39c15..ac890257394 100644 --- a/files/templates/index.php +++ b/files/templates/index.php @@ -29,9 +29,9 @@ t( 'Name' ); ?> - Download + Download - Delete + Delete t( 'Size MB' ); ?> -- cgit v1.2.3 From 7cd7e64498f54bbfff6ffe6d1bce80b844391938 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Thu, 28 Jul 2011 01:26:26 +0200 Subject: proper CSS formatting for better workflow --- core/css/styles.css | 194 ++++++++-------------------------------------------- files/css/files.css | 115 +++++-------------------------- 2 files changed, 46 insertions(+), 263 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index ac4a6448af2..0782986eada 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -7,7 +7,7 @@ h1 { margin:1em 3em 1em 0; border-bottom:1px solid #666; text-transform:uppercas p.center { text-align:center; } a { color:#000; text-decoration:none; outline:0; } table { white-space:nowrap; } -input { background:#fff; } +input, select { background:#fff; color:#333; } a, a img, a strong, a span, input, button, select, li { cursor:pointer; } input[type="text"], input[type="password"] { cursor:text; } @@ -20,9 +20,9 @@ form input { padding:0.2em; border:1px solid #ddd; font-size:1.2em; } form input[type="submit"] { padding:0.1em 1em; border:1px solid #999; font-weight:bold; font-size:0.9em; cursor:pointer; } form input[type="submit"]:hover, form input[type="submit"]:focus { border:1px solid #999; background-color:#999; outline:0; } form input[type="submit"]:active { outline:0; } -form input[type="button"], form input[type="text"] { font-size: 0.9em; } +form input[type="button"], form input[type="text"] { font-size:0.9em; } fieldset { padding:1em; background-color:#f7f7f7; border:1px solid #ddd; max-width:600px; margin:2em 2em 2em 3em; } -legend { padding: 0.5em; font-size:1.2em; } +legend { padding:0.5em; font-size:1.2em; } div.controls { width:100%; margin:0px; background-color:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:100 } @@ -30,170 +30,30 @@ div.controls { width:100%; margin:0px; background-color:#f7f7f7; border-bottom:1 #body-login { width:100%; background-image:none; background-color:#ddd; } #body-login p.info { width:16em; margin:4em auto; padding:1em; background-color:#eee; border:1px solid #ccc; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; } -#login -{ - margin: 0 auto 0 auto; - padding: 2em 0 0 0; - background-image: url(../img/header-login.png); - background-position: left 0; - background-repeat: repeat-x; - background-color: #EEE; - border-bottom: 1px solid #FFF; - text-align: center; -} - -#login_form -{ - width: 20em; - margin: 4em auto; - padding: 0; -} - -#login_form fieldset -{ - background-color: transparent; - border: 0; -} - -#login_form fieldset p -{ - margin: 0.5em 0 0 0; - padding: 0; - text-align: left; -} - -#login_form fieldset p.submit -{ - margin: 2em 0 0 0; - padding: 1em 0 0 0; - border-top: 1px solid #DDD; - text-align: right; -} - -#login_form label -{ - font-size: 1em; - color: #666; -} - -#login_form input -{ - width: 100%; - margin: 0 0 0.5em 0; - padding: 0.5em; - border: 1px solid #DDD; - -moz-border-radius: 15px; - -webkit-border-radius: 15px; - border-radius: 15px; - font-size: 1.5em; - color: #333; - text-align: center; -} - -#login_form input[type=submit] -{ - width: auto; - margin: 1em 0 0 0.5em; - text-align: center; - border: 1px solid #DDD; - background-color: #FFF; - -moz-border-radius: 15px; - -webkit-border-radius: 15px; - border-radius: 15px; - font-size: 1.5em -} - -#login_form input[type=submit]:hover -{ - border: 1px solid #666; - background-color: #666; - color: #FFF; -} -#login_form input[type="checkbox"] -{ - width:15px; -} - -#setup_form { - margin: 3em auto; - text-align: left; - width: 720px; -} - -#setup_form #use_mysql { - font-size: 0.9em; - margin: 0 0 0 1em; -} - -#setup_form p.intro { - color: #666; - font-size: 1.3em; - margin: 4em 0 3em 0; - padding: 0; - text-align: center; -} - -#setup_form ul.errors { - background-image: url(images/no.png); - background-position: 1em 1em; - background-repeat: no-repeat; - background-color: #FED7D7; - border: 1px solid #F00; - font-size: 1.2em; - list-style-indent: inside; - margin: 0 0 4em 0; - padding: 1em 1em 1em 5em; -} - -#setup_form fieldset { - margin: 0 0 3em 0; -} - -#setup_form p { - line-height: 1.8em; -} - -#setup_form legend { - font-weight: normal; -} - -#setup_form label { - cursor: pointer; - display: block; - float: left; - margin: 0 0 0.2em 0; - text-align: right; - width: 40%; -} - +#login { margin:0 auto 0 auto; padding:2em 0 0 0; background-image:url(../img/header-login.png); background-position:left 0; background-repeat:repeat-x; background-color:#EEE; border-bottom:1px solid #FFF; text-align:center; } +#login_form { width:20em; margin:4em auto; padding:0; } +#login_form fieldset { background-color:transparent; border:0; } +#login_form fieldset p { margin:0.5em 0 0 0; padding:0; text-align:left; } +#login_form fieldset p.submit { margin:2em 0 0 0; padding:1em 0 0 0; border-top:1px solid #DDD; text-align:right; } +#login_form label { font-size:1em; color:#666; } +#login_form input { width:100%; margin:0 0 0.5em 0; padding:0.5em; border:1px solid #DDD; -moz-border-radius:15px; -webkit-border-radius:15px; border-radius:15px; font-size:1.5em; color:#333; text-align:center; } +#login_form input[type=submit] { width:auto; margin:1em 0 0 0.5em; text-align:center; border:1px solid #DDD; background-color:#FFF; -moz-border-radius:15px; -webkit-border-radius:15px; border-radius:15px; font-size:1.5em } +#login_form input[type=submit]:hover { border:1px solid #666; background-color:#666; color:#FFF; } +#login_form input[type="checkbox"] { width:15px; } +#setup_form { margin:3em auto; text-align:left; width:720px; } +#setup_form #use_mysql { font-size:0.9em; margin:0 0 0 1em; } +#setup_form p.intro { color:#666; font-size:1.3em; margin:4em 0 3em 0; padding:0; text-align:center; } +#setup_form ul.errors { background-image:url(images/no.png); background-position:1em 1em; background-repeat:no-repeat; background-color:#FED7D7; border:1px solid #F00; font-size:1.2em; list-style-indent:inside; margin:0 0 4em 0; padding:1em 1em 1em 5em; } +#setup_form fieldset { margin:0 0 3em 0; } +#setup_form p { line-height:1.8em; } +#setup_form legend { font-weight:normal; } +#setup_form label { cursor:pointer; display:block; float:left; margin:0 0 0.2em 0; text-align:right; width:40%; } #setup_form input[type='text'], -#setup_form input[type='password'] { - font-size: 1em; - margin: 0 0 0 0.5em; - padding: 0.3em; -} - -#setup_form input[type='radio'] { - margin: 0 0 0 1em; -} - -#setup_form input[type='submit'] { - background-color: #DDD; - border: 1px solid #999; - color: #666; - font-size: 1.2em; -} - -#setup_form input[type='submit']:hover { - border-color: #000; - color: #000; -} - -#setup_form p.submit { - padding: 0 0 1em 0; - text-align: center; -} - +#setup_form input[type='password'] { font-size:1em; margin:0 0 0 0.5em; padding:0.3em; } +#setup_form input[type='radio'] { margin:0 0 0 1em; } +#setup_form input[type='submit'] { background-color:#DDD; border:1px solid #999; color:#666; font-size:1.2em; } +#setup_form input[type='submit']:hover { border-color:#000; color:#000; } +#setup_form p.submit { padding:0 0 1em 0; text-align:center; } .prettybutton { margin:0.1em; padding:0.2em 0.5em; border:1px solid #ddd; -moz-border-radius:15px; -webkit-border-radius:15px; border-radius:15px; font-size:1.5em; text-decoration:none; color:#666; background-color:#fff; } @@ -252,4 +112,4 @@ p.actions a.delete, div.actions a.delete { background-image:url('../img/delete.p #logs_options input[type="submit"] { float:right; margin:0 2em 0 0; } #logs_options input[type="submit"].nofloat { float:none; margin:0 2em 0 0; } #logs_options input[type="text"] { margin:0; padding:0; border:1px solid #ccc; text-align:right; } -li.error{ list-style:none; width:640px; margin:4em auto; padding:1em 1em 1em 4em; background-color:#fee; background-image:url('../img/task-attention.png'); background-position:0.8em 0.8em; background-repeat:no-repeat; border:1px solid #ccc; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; } +li.error { list-style:none; width:640px; margin:4em auto; padding:1em 1em 1em 4em; background-color:#fee; background-image:url('../img/task-attention.png'); background-position:0.8em 0.8em; background-repeat:no-repeat; border:1px solid #ccc; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; } diff --git a/files/css/files.css b/files/css/files.css index 7db46e3b0a7..e956f8c03af 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -1,95 +1,24 @@ /* FILE MENU */ - -#file_menu -{ - right:0px; - position:absolute; - top:0; -} - -#file_menu a -{ - display:block; - float:left; - background-image:none; - text-decoration: none; -} - -.file_upload_form, #file_newfolder_form { - display: inline; -} - -#fileSelector, #file_upload_submit, #file_newfolder_submit { - display: none; -} - -.file_upload_filename, #file_newfolder_name { - background-repeat: no-repeat; - background-position: 0.5em 0; - padding-left: 2em; -} - -.file_upload_filename { - background-image:url("../img/file.png"); font-weight:bold; -} -.file_upload_start {opacity:0;filter: alpha(opacity = 0);} - -#file_newfolder_name { - background-image:url("../img/folder.png"); font-weight:bold; - width: 11em; -} - -.file_upload_start, .file_upload_filename{ - position:absolute; - top:0px; - left:0px; - width:11em; - font-size: 0.9em; -} - -.file_upload_wrapper{ - position:relative; - top:-1.2em; - left:-2em; - display: -moz-inline-box; /* fallback for older firefox versions*/ - display: inline-block; - width:12em; -} - -#file_newfolder_submit, #file_upload_submit { - width: 3em; -} - -.file_upload_target { - display: none; -} +#file_menu { right:0px; position:absolute; top:0; } +#file_menu a { display:block; float:left; background-image:none; text-decoration:none; } +.file_upload_form, #file_newfolder_form { display:inline; } +#fileSelector, #file_upload_submit, #file_newfolder_submit { display:none; } +.file_upload_filename, #file_newfolder_name { background-repeat:no-repeat; background-position:0.5em 0; padding-left:2em; } +.file_upload_filename { background-image:url("../img/file.png"); font-weight:bold; }.file_upload_start { opacity:0;filter:alpha(opacity = 0); } + +#file_newfolder_name { background-image:url("../img/folder.png"); font-weight:bold; width:11em; } +.file_upload_start, .file_upload_filename { position:absolute; top:0px; left:0px; width:11em; font-size:0.9em; } +.file_upload_wrapper { position:relative; top:-1.2em; left:-2em; display:-moz-inline-box; /* fallback for older firefox versions*/ display:inline-block; width:12em; } +#file_newfolder_submit, #file_upload_submit { width:3em; } +.file_upload_target { display:none; } /* FILE TABLE */ - -table { - position:relative; - top:37px; - width: 100%; -} - +table { position:relative; top:37px; width:100%; } tbody tr:hover, tbody tr:active, tbody tr.selected { background-color:#eee; } tbody a { color:#000; } -span.extention{ - color:#999; -} - -div.crumb{ - float:left; - display:block; - background-repeat:no-repeat; - background-position:right 0px; - font-weight:bold; - padding-top:8px; - padding-left:8px; - height:28px; /*36-8*/ -} - +span.extention { color:#999; } +div.crumb { float:left; display:block; background-repeat:no-repeat; background-position:right 0px; font-weight:bold; padding-top:8px; padding-left:8px; height:28px; /*36-8*/ } table tr.mouseOver td { background-color:#eee; } table th { padding:.5em; } table th .name { float:left; margin-left:.5em; } @@ -119,17 +48,11 @@ table td.create { background-image:url('../img/folder-new.png'); } table td.delete { background-image:url('../img/delete.png'); } #fileList tr input[type=checkbox] { display:none; float:left; margin:.7em 0 0 1em; /* bigger clickable area doesn’t work in FF width:2.8em; height:2.4em;*/ } #fileList tr input[type=checkbox]:checked, #fileList tr:hover input[type=checkbox] { display:inline; } -#fileList tr.selected td.filename a, #fileList tr:hover td.filename a{background-image:none !important} -#select_all{float:left; margin:0.2em; margin-left:0.6em; } +#fileList tr.selected td.filename a, #fileList tr:hover td.filename a { background-image:none !important } +#select_all { float:left; margin:0.2em; margin-left:0.6em; } #selectedActions { float:right; display:none; } #selectedActions a { margin:0 .5em; } -#uploadsize-message{ display:none; } +#uploadsize-message { display:none; } /* add breadcrumb divider to the File item in navigation panel */ -#plugins li:first-child{ - background-position: 15.7em 0px; - background-repeat:no-repeat; - background-image: url("/owncloud/core/img/breadcrumb-divider-start.png"); - width:15.7em; - padding-right:11px; -} +#plugins li:first-child { background-position:15.7em 0px; background-repeat:no-repeat; background-image:url("/owncloud/core/img/breadcrumb-divider-start.png"); width:15.7em; padding-right:11px; } -- cgit v1.2.3 From c5bc345604caee2a908c61ac42dad7f025da27de Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Thu, 28 Jul 2011 02:30:09 +0200 Subject: rewrote header in pure CSS, smaller, less obtrusive --- core/css/styles.css | 23 +++- core/img/actions/back.png | Bin 0 -> 396 bytes core/img/actions/back.svg | 121 ++++++++++++++++++ core/img/actions/logout.png | Bin 0 -> 657 bytes core/img/actions/logout.svg | 95 ++++++++++++++ core/img/actions/settings.png | Bin 0 -> 695 bytes core/img/actions/settings.svg | 221 +++++++++++++++++++++++++++++++++ core/img/drop-arrow.png | Bin 2899 -> 0 bytes core/img/header-a.png | Bin 2951 -> 0 bytes core/img/header-login.png | Bin 2402 -> 0 bytes core/img/header-settings-a.png | Bin 2885 -> 0 bytes core/img/header-settings.png | Bin 2887 -> 0 bytes core/img/header.png | Bin 2953 -> 0 bytes core/img/layout/back.png | Bin 396 -> 0 bytes core/img/layout/logout.png | Bin 657 -> 0 bytes core/img/layout/settings.png | Bin 695 -> 0 bytes core/img/owncloud-logo-small-white.png | Bin 5444 -> 5339 bytes core/templates/installation.php | 2 +- core/templates/layout.admin.php | 4 +- core/templates/layout.user.php | 4 +- core/templates/login.php | 2 +- 21 files changed, 460 insertions(+), 12 deletions(-) create mode 100644 core/img/actions/back.png create mode 100644 core/img/actions/back.svg create mode 100644 core/img/actions/logout.png create mode 100644 core/img/actions/logout.svg create mode 100644 core/img/actions/settings.png create mode 100644 core/img/actions/settings.svg delete mode 100644 core/img/drop-arrow.png delete mode 100644 core/img/header-a.png delete mode 100644 core/img/header-login.png delete mode 100644 core/img/header-settings-a.png delete mode 100644 core/img/header-settings.png delete mode 100644 core/img/header.png delete mode 100644 core/img/layout/back.png delete mode 100644 core/img/layout/logout.png delete mode 100644 core/img/layout/settings.png diff --git a/core/css/styles.css b/core/css/styles.css index 0782986eada..0e4ac7ac3eb 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -1,7 +1,7 @@ * { margin:0; padding:0; border:0; cursor:default; } body { background:#fefefe url('../img/body_background.jpg') repeat-y left top; font:normal 80%/1.6em "Lucida Grande", Arial, Verdana, sans-serif; color:#000; } -#header { position:fixed; top:0; z-index:100; width:100%; height:2.5em; padding:0.5em 1.5em; background:url('../img/header-a.png') repeat-x left top; } -#body-settings #header { background-image:url('../img/header-settings-a.png'); } +#header { position:fixed; top:0; z-index:100; width:100%; height:2.5em; padding:0.5em 1.5em; background:#1d2d44; -moz-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; -webkit-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; box-shadow:0 0 10px #000, inset 0 -2px 10px #222; } +#body-settings #header { background:#313131; } #owncloud { float:left; margin:0 0 0 2em; } h1 { margin:1em 3em 1em 0; border-bottom:1px solid #666; text-transform:uppercase; font-weight:normal; font-style:italic; color:#666; } p.center { text-align:center; } @@ -28,9 +28,20 @@ div.controls { width:100%; margin:0px; background-color:#f7f7f7; border-bottom:1 /* LOG IN & INSTALLATION ------------------------------------------------------------ */ #body-login { width:100%; background-image:none; background-color:#ddd; } -#body-login p.info { width:16em; margin:4em auto; padding:1em; background-color:#eee; border:1px solid #ccc; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; } - -#login { margin:0 auto 0 auto; padding:2em 0 0 0; background-image:url(../img/header-login.png); background-position:left 0; background-repeat:repeat-x; background-color:#EEE; border-bottom:1px solid #FFF; text-align:center; } +#body-login p.info { width:16em; margin:2em auto; padding:1em; background-color:#eee; border:1px solid #ccc; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; } +#body-login p.info a { font-weight:bold; } + +#login header { margin-top:-2em; height:10em; + -moz-box-shadow:0 0 5px #000; -webkit-box-shadow:0 0 20px #000; box-shadow:0 0 20px #000; +background: #1d2d44; /* Old browsers */ +background: -moz-linear-gradient(top, #35537a 0%, #1d2d42 100%); /* FF3.6+ */ +background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#35537a), color-stop(100%,#1d2d42)); /* Chrome,Safari4+ */ +background: -webkit-linear-gradient(top, #35537a 0%,#1d2d42 100%); /* Chrome10+,Safari5.1+ */ +background: -o-linear-gradient(top, #35537a 0%,#1d2d42 100%); /* Opera11.10+ */ +background: -ms-linear-gradient(top, #35537a 0%,#1d2d42 100%); /* IE10+ */ +filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#35537a', endColorstr='#1d2d42',GradientType=0 ); /* IE6-9 */ +background: linear-gradient(top, #35537a 0%,#1d2d42 100%); /* W3C */ } +#login { margin:0 auto 0 auto; padding:2em 0 0 0; border-bottom:1px solid #FFF; text-align:center; background:#eee; } #login_form { width:20em; margin:4em auto; padding:0; } #login_form fieldset { background-color:transparent; border:0; } #login_form fieldset p { margin:0.5em 0 0 0; padding:0; text-align:left; } @@ -62,7 +73,7 @@ div.controls { width:100%; margin:0px; background-color:#f7f7f7; border-bottom:1 /* META NAVIGATION (Settings, Log out) ---------------------------------------------------------------- */ #metanav { float:right; position:relative; top:0.5em; right:2.5em; list-style:none; margin:0; padding:0; } #metanav li { display:inline; } -#metanav li a { margin:.1em; padding:1em; } +#metanav li a { margin:.2em; padding:.7em; } #metanav li a:hover, #metanav li a:focus { background:rgba(0,0,0,.5); -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; outline:0; box-shadow:#555 0 1px 0; -moz-box-shadow:#555 0 1px 0; -webkit-box-shadow:#555 0 1px 0; } #metanav li a img { vertical-align:middle; } diff --git a/core/img/actions/back.png b/core/img/actions/back.png new file mode 100644 index 00000000000..86abbe0cabe Binary files /dev/null and b/core/img/actions/back.png differ diff --git a/core/img/actions/back.svg b/core/img/actions/back.svg new file mode 100644 index 00000000000..2bdf50c7334 --- /dev/null +++ b/core/img/actions/back.svg @@ -0,0 +1,121 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/actions/logout.png b/core/img/actions/logout.png new file mode 100644 index 00000000000..74dcd33bee7 Binary files /dev/null and b/core/img/actions/logout.png differ diff --git a/core/img/actions/logout.svg b/core/img/actions/logout.svg new file mode 100644 index 00000000000..d95ac959778 --- /dev/null +++ b/core/img/actions/logout.svg @@ -0,0 +1,95 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/core/img/actions/settings.png b/core/img/actions/settings.png new file mode 100644 index 00000000000..ff650ecb0b0 Binary files /dev/null and b/core/img/actions/settings.png differ diff --git a/core/img/actions/settings.svg b/core/img/actions/settings.svg new file mode 100644 index 00000000000..67473520af6 --- /dev/null +++ b/core/img/actions/settings.svg @@ -0,0 +1,221 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/drop-arrow.png b/core/img/drop-arrow.png deleted file mode 100644 index 315395d5d42..00000000000 Binary files a/core/img/drop-arrow.png and /dev/null differ diff --git a/core/img/header-a.png b/core/img/header-a.png deleted file mode 100644 index 46fb0977ee2..00000000000 Binary files a/core/img/header-a.png and /dev/null differ diff --git a/core/img/header-login.png b/core/img/header-login.png deleted file mode 100644 index b0160e02d1f..00000000000 Binary files a/core/img/header-login.png and /dev/null differ diff --git a/core/img/header-settings-a.png b/core/img/header-settings-a.png deleted file mode 100644 index a72271be6a4..00000000000 Binary files a/core/img/header-settings-a.png and /dev/null differ diff --git a/core/img/header-settings.png b/core/img/header-settings.png deleted file mode 100644 index 7e6b70b5903..00000000000 Binary files a/core/img/header-settings.png and /dev/null differ diff --git a/core/img/header.png b/core/img/header.png deleted file mode 100644 index d377f65186d..00000000000 Binary files a/core/img/header.png and /dev/null differ diff --git a/core/img/layout/back.png b/core/img/layout/back.png deleted file mode 100644 index 86abbe0cabe..00000000000 Binary files a/core/img/layout/back.png and /dev/null differ diff --git a/core/img/layout/logout.png b/core/img/layout/logout.png deleted file mode 100644 index 74dcd33bee7..00000000000 Binary files a/core/img/layout/logout.png and /dev/null differ diff --git a/core/img/layout/settings.png b/core/img/layout/settings.png deleted file mode 100644 index ff650ecb0b0..00000000000 Binary files a/core/img/layout/settings.png and /dev/null differ diff --git a/core/img/owncloud-logo-small-white.png b/core/img/owncloud-logo-small-white.png index 397ddf91341..8374c133506 100644 Binary files a/core/img/owncloud-logo-small-white.png and b/core/img/owncloud-logo-small-white.png differ diff --git a/core/templates/installation.php b/core/templates/installation.php index c3bbe692c1c..0a6dacad955 100644 --- a/core/templates/installation.php +++ b/core/templates/installation.php @@ -1,5 +1,5 @@
    - ownCloud +
    ownCloud

    diff --git a/core/templates/layout.admin.php b/core/templates/layout.admin.php index e83cf6861bf..78ccf877221 100644 --- a/core/templates/layout.admin.php +++ b/core/templates/layout.admin.php @@ -30,8 +30,8 @@

    diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index ffdb7937ae7..f8beb79e81e 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -31,8 +31,8 @@ ownCloud
      -
    • -
    • +
    • +
    diff --git a/core/templates/login.php b/core/templates/login.php index 19830a24993..fb3177eb0ee 100644 --- a/core/templates/login.php +++ b/core/templates/login.php @@ -1,5 +1,5 @@
    - ownCloud +
    ownCloud
    -- cgit v1.2.3 From 74249c65da5b21c4b191f9792b510268c4b83454 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 28 Jul 2011 04:28:04 +0200 Subject: give OC.imagePath the ability to detect whether to use svg or png images --- core/js/js.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/js/js.js b/core/js/js.js index 2f74bda2588..407c5708701 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -40,6 +40,9 @@ OC={ return link; }, imagePath:function(app,file){ + if(file.indexOf('.')==-1){//if no extention is given, use png or svg depending on browser support + file+=(SVGSupport())?'.svg':'.png' + } return OC.filePath(app,'img',file); }, addScript:function(app,script,ready){ @@ -95,4 +98,8 @@ if (!Array.prototype.indexOf){ } return -1; }; -} \ No newline at end of file +} + +function SVGSupport() { + return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") || document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Shape", "1.0"); +} -- cgit v1.2.3 From ece6bd663cc2a03e339019c29d1ea9170d11c24e Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 28 Jul 2011 04:29:04 +0200 Subject: show icons instead of text for file actions --- apps/files_imageviewer/js/lightbox.js | 2 +- apps/media/js/files.js | 8 +++---- files/css/files.css | 3 ++- files/js/fileactions.js | 45 ++++++++++++++++++++++------------- files/js/filelist.js | 4 ++-- files/templates/part.list.php | 2 +- 6 files changed, 38 insertions(+), 26 deletions(-) diff --git a/apps/files_imageviewer/js/lightbox.js b/apps/files_imageviewer/js/lightbox.js index 6e45547ebb4..318c764458e 100644 --- a/apps/files_imageviewer/js/lightbox.js +++ b/apps/files_imageviewer/js/lightbox.js @@ -7,7 +7,7 @@ $(document).ready(function() { $( 'body' ).append(overlay); var container=$(' +
    +

    These items will be permanently deleted and cannot be recovered. Are you sure?

    +
    + -- cgit v1.2.3 From f1616b0e629ec5fd59a859748e64418862691597 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 29 Jul 2011 00:45:44 +0200 Subject: implemented relative file size and coloring --- core/css/styles.css | 2 +- files/templates/part.list.php | 7 +++++-- lib/template.php | 23 +++++++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index 33c1af44362..35b65f9480d 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -24,7 +24,7 @@ form input[type="button"], form input[type="text"] { font-size:0.9em; } fieldset { padding:1em; background-color:#f7f7f7; border:1px solid #ddd; max-width:600px; margin:2em 2em 2em 3em; } legend { padding:0.5em; font-size:1.2em; } -div.controls { width:100%; margin:0px; background-color:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:0; } +div.controls { width:100%; margin:0px; background-color:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:2; } /* LOG IN & INSTALLATION ------------------------------------------------------------ */ #body-login { width:100%; background-image:none; background-color:#ddd; } diff --git a/files/templates/part.list.php b/files/templates/part.list.php index 1d78b77ae3e..a0ffb4b6073 100644 --- a/files/templates/part.list.php +++ b/files/templates/part.list.php @@ -1,6 +1,9 @@ + $simple_size_color = 200-intval(pow(($file['size']/(1024*1024)),2)); + $relative_modified_date = relative_modified_date($file['mtime']); + $relative_date_color = round((time()-$file['mtime'])/60/60/24*5); //days ago + if($relative_date_color>200) $relative_date_color = 200; ?> '> @@ -15,6 +18,6 @@ - + diff --git a/lib/template.php b/lib/template.php index 3c0cdf7e161..99099d49d0f 100644 --- a/lib/template.php +++ b/lib/template.php @@ -75,6 +75,29 @@ function simple_file_size($bytes) { else { return number_format($mbytes, 1); } } +function relative_modified_date($timestamp) { + $timediff = time() - $timestamp; + $diffminutes = round($timediff/60); + $diffhours = round($diffminutes/60); + $diffdays = round($diffhours/24); + $diffmonths = round($diffdays/31); + $diffyears = round($diffdays/365); + if($timediff < 60) { return 'seconds ago'; } + else if($timediff < 120) { return '1 minute ago'; } + else if($timediff < 3600) { return $diffminutes.' minutes ago'; } + //else if($timediff < 7200) { return '1 hour ago'; } + //else if($timediff < 86400) { return $diffhours.' hours ago'; } + else if($timediff < 86400) { return 'today'; } + else if($timediff < 172800) { return 'yesterday'; } + else if($timediff < 2678400) { return $diffdays.' days ago'; } + else if($timediff < 5184000) { return 'last month'; } + //else if($timediff < 31556926) { return $diffmonths.' months ago'; } + else if($timediff < 31556926) { return 'months ago'; } + else if($timediff < 63113852) { return 'last year'; } + else { return $diffyears.' years ago'; } +} + + /** * This class provides the templates for owncloud. */ -- cgit v1.2.3 From 82261e99073047dd72ecec927f33ff5fea3cbffd Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 01:10:08 +0200 Subject: use relative times for new upload files --- files/js/filelist.js | 16 +++++++++++++--- files/js/files.js | 29 +++++++++++++++++++++++++---- 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/files/js/filelist.js b/files/js/filelist.js index e4ec97e5068..252a9c95807 100644 --- a/files/js/filelist.js +++ b/files/js/filelist.js @@ -24,8 +24,10 @@ FileList={ simpleSize='Pending'; } sizeColor = Math.round(200-Math.pow((size/(1024*1024)),2)); + lastModifiedTime=Math.round(lastModified.getTime() / 1000); + modifiedColor=Math.round((Math.round((new Date()).getTime() / 1000)-lastModifiedTime)/60/60/24*5); html+=''+simpleSize+''; - html+=''+lastModified+''; + html+=''+relative_modified_date(lastModified.getTime() / 1000)+''; html+=''; FileList.insertElement(name,'file',$(html)); if(loading){ @@ -37,8 +39,16 @@ FileList={ addDir:function(name,size,lastModified){ var html=''; html+=''+name+''; - html+=''+size+''; - html+=''+lastModified+''; + if(size!='Pending'){ + simpleSize=simpleFileSize(size); + }else{ + simpleSize='Pending'; + } + sizeColor = Math.round(200-Math.pow((size/(1024*1024)),2)); + lastModifiedTime=Math.round(lastModified.getTime() / 1000); + modifiedColor=Math.round((Math.round((new Date()).getTime() / 1000)-lastModifiedTime)/60/60/24*5); + html+=''+simpleSize+''; + html+=''+relative_modified_date(lastModified.getTime() / 1000)+''; html+=''; FileList.insertElement(name,'dir',$(html)); diff --git a/files/js/files.js b/files/js/files.js index cd1689a2dd7..60f2b2aec87 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -62,8 +62,8 @@ $(document).ready(function() { url: 'ajax/newfolder.php', data: "dir="+$('#dir').val()+"&foldername="+$('#file_newfolder_name').val(), complete: function(data){boolOperationFinished(data, function(){ - var date=formatDate(new Date()); - FileList.addDir($('#file_newfolder_name').val(),'0 B',date) + var date=new Date(); + FileList.addDir($('#file_newfolder_name').val(),0,date) });} }); $('#file_newfolder_submit').fadeOut(250).trigger('vanish'); @@ -175,14 +175,13 @@ $(document).ready(function() { }); form.submit(); var date=new Date(); - var uploadTime=formatDate(date); for(var i=0;i0){ var size=files[i].size; }else{ var size='Pending'; } - FileList.addFile(files[i].name,size,uploadTime,true); + FileList.addFile(files[i].name,size,date,true); } //clone the upload form and hide the new one to allow users to start a new upload while the old one is still uploading @@ -416,3 +415,25 @@ function getSelectedFiles(property){ }); return files; } + +function relative_modified_date(timestamp) { + var timediff = Math.round((new Date()).getTime() / 1000) - timestamp; + var diffminutes = Math.round(timediff/60); + var diffhours = Math.round(diffminutes/60); + var diffdays = Math.round(diffhours/24); + var diffmonths = Math.round(diffdays/31); + var diffyears = Math.round(diffdays/365); + if(timediff < 60) { return 'seconds ago'; } + else if(timediff < 120) { return '1 minute ago'; } + else if(timediff < 3600) { return diffminutes+' minutes ago'; } + //else if($timediff < 7200) { return '1 hour ago'; } + //else if($timediff < 86400) { return $diffhours.' hours ago'; } + else if(timediff < 86400) { return 'today'; } + else if(timediff < 172800) { return 'yesterday'; } + else if(timediff < 2678400) { return diffdays+' days ago'; } + else if(timediff < 5184000) { return 'last month'; } + //else if($timediff < 31556926) { return $diffmonths.' months ago'; } + else if(timediff < 31556926) { return 'months ago'; } + else if(timediff < 63113852) { return 'last year'; } + else { return diffyears+' years ago'; } +} -- cgit v1.2.3 From c15db76aa0d86f68242b01e06f982e0ca782fbee Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 29 Jul 2011 01:16:30 +0200 Subject: icons for music and images --- core/img/mimetypes/image.png | Bin 0 -> 284 bytes core/img/mimetypes/music.png | Bin 0 -> 562 bytes files/img/drop-arrow.png | Bin 2899 -> 0 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 core/img/mimetypes/image.png create mode 100644 core/img/mimetypes/music.png delete mode 100644 files/img/drop-arrow.png diff --git a/core/img/mimetypes/image.png b/core/img/mimetypes/image.png new file mode 100644 index 00000000000..06d4024fa23 Binary files /dev/null and b/core/img/mimetypes/image.png differ diff --git a/core/img/mimetypes/music.png b/core/img/mimetypes/music.png new file mode 100644 index 00000000000..6333b947f07 Binary files /dev/null and b/core/img/mimetypes/music.png differ diff --git a/files/img/drop-arrow.png b/files/img/drop-arrow.png deleted file mode 100644 index 315395d5d42..00000000000 Binary files a/files/img/drop-arrow.png and /dev/null differ -- cgit v1.2.3 From b88e5ce9a1af81604eec0a5a03d2d1a0428cb693 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 29 Jul 2011 01:19:09 +0200 Subject: added icon to media app --- apps/media/img/media.png | Bin 0 -> 562 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 apps/media/img/media.png diff --git a/apps/media/img/media.png b/apps/media/img/media.png new file mode 100644 index 00000000000..6333b947f07 Binary files /dev/null and b/apps/media/img/media.png differ -- cgit v1.2.3 From 19d81add3d847da063986b969b1d259de2e897d4 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 29 Jul 2011 01:27:02 +0200 Subject: remove legacy styles --- files/css/files.css | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/files/css/files.css b/files/css/files.css index d79e75468a5..328eaa40f50 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -31,22 +31,6 @@ table td.filename a, table td.login, table td.logout, table td.download, table t table td.filename .nametext, .modified { float:left; padding:.3em 0; } table td.filename .nametext { width:80%; } table td.filename form { float:left; font-size:.85em; } -table td.filename a.folder-up { background-image:url('../img/back.png'); font-style:italic; } -table td.filename a.folder { background-image:url('../img/folder.png'); } -table td.filename a.folder-home { background-image:url('../img/home.png'); } -table td.filename a.folder-music { background-image:url('../img/folder-music.png'); } -table td.filename a.folder-videos { background-image:url('../img/folder-video.png'); } -table td.filename a.folder-shared { background-image:url('../img/folder-shared.png'); } -table td.filename a.folder-images { background-image:url('../img/folder-image.png'); } -table td.filename a.file-txt { background-image:url('../img/file-txt.png'); } -table td.filename a.file-python { background-image:url('../img/file-python.png'); } -table td.filename a.file-php { background-image:url('../img/file.png'); } -table td.login { background-image:url('../img/login.png'); } -table td.logout { background-image:url('../img/logout.png'); } -table td.download { background-image:url('../img/download.png'); } -table td.upload { background-image:url('../img/upload.png'); } -table td.create { background-image:url('../img/folder-new.png'); } -table td.delete { background-image:url('../img/delete.png'); } #fileList tr input[type=checkbox] { display:none; float:left; margin:.7em 0 0 1em; /* bigger clickable area doesn’t work in FF width:2.8em; height:2.4em;*/ } #fileList tr input[type=checkbox]:checked, #fileList tr:hover input[type=checkbox] { display:inline; } #fileList tr.selected td.filename a, #fileList tr:hover td.filename a { background-image:none !important } -- cgit v1.2.3 From dbcebba8826be76eca141a28c29b4dd8d051291f Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 29 Jul 2011 01:33:03 +0200 Subject: show media icon in settings as well --- apps/media/appinfo/app.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/media/appinfo/app.php b/apps/media/appinfo/app.php index 22cb10d7897..a41e228be4a 100644 --- a/apps/media/appinfo/app.php +++ b/apps/media/appinfo/app.php @@ -29,5 +29,5 @@ if(OC_APP::getCurrentApp()=='files'){ OC_APP::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' )); OC_APP::addNavigationEntry( array( 'id' => 'media_index', 'order' => 2, 'href' => OC_HELPER::linkTo( 'media', 'index.php' ), 'icon' => OC_HELPER::imagePath( 'media', 'media.png' ), 'name' => 'Media' )); -OC_APP::addSettingsPage( array( 'id' => 'media_settings', 'order' => 5, 'href' => OC_HELPER::linkTo( 'media', 'settings.php' ), 'name' => 'Media', 'icon' => OC_HELPER::imagePath( 'files', 'media.png' ))); +OC_APP::addSettingsPage( array( 'id' => 'media_settings', 'order' => 5, 'href' => OC_HELPER::linkTo( 'media', 'settings.php' ), 'name' => 'Media', 'icon' => OC_HELPER::imagePath( 'media', 'media.png' ))); ?> -- cgit v1.2.3 From 6d0c8ea7e4c15e2a4072e0951eac3c0f64b2fbdc Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 01:36:31 +0200 Subject: use proper file icons for image and audio files --- core/img/mimetypes/audio.png | Bin 0 -> 562 bytes core/img/mimetypes/music.png | Bin 562 -> 0 bytes files/js/filelist.js | 3 ++- files/js/files.js | 9 +++++++++ lib/helper.php | 5 +++++ 5 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 core/img/mimetypes/audio.png delete mode 100644 core/img/mimetypes/music.png diff --git a/core/img/mimetypes/audio.png b/core/img/mimetypes/audio.png new file mode 100644 index 00000000000..6333b947f07 Binary files /dev/null and b/core/img/mimetypes/audio.png differ diff --git a/core/img/mimetypes/music.png b/core/img/mimetypes/music.png deleted file mode 100644 index 6333b947f07..00000000000 Binary files a/core/img/mimetypes/music.png and /dev/null differ diff --git a/files/js/filelist.js b/files/js/filelist.js index 252a9c95807..a53ad672e42 100644 --- a/files/js/filelist.js +++ b/files/js/filelist.js @@ -96,7 +96,8 @@ FileList={ }, loadingDone:function(name){ $('tr[data-file="'+name+'"]').data('loading',false); - $('tr[data-file="'+name+'"] td.filename a').attr('style','background-image:url(img/file.png'); + var mime=$('tr[data-file="'+name+'"]').data('mime'); + $('tr[data-file="'+name+'"] td.filename a').attr('style','background-image:url('+getMimeIcon(mime)+')'); $('tr[data-file="'+name+'"] td.filename').draggable(dragOptions); }, isLoading:function(name){ diff --git a/files/js/files.js b/files/js/files.js index 60f2b2aec87..193c740b6c5 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -437,3 +437,12 @@ function relative_modified_date(timestamp) { else if(timediff < 63113852) { return 'last year'; } else { return diffyears+' years ago'; } } + +function getMimeIcon(mime){ + mime=mime.substr(0,mime.indexOf('/')); + var knownMimes=['image','audio']; + if(knownMimes.indexOf(mime)==-1){ + mime='file'; + } + return OC.imagePath('core','mimetypes/'+mime+'.png'); +} \ No newline at end of file diff --git a/lib/helper.php b/lib/helper.php index 1fbcc589d10..ffb25877433 100755 --- a/lib/helper.php +++ b/lib/helper.php @@ -110,6 +110,11 @@ class OC_HELPER { if( file_exists( "$SERVERROOT/core/img/mimetypes/$mimetype.png" )){ return "$WEBROOT/core/img/mimetypes/$mimetype.png"; } + //try only the first part of the mimetype + $mimetype=substr($mimetype,0,strpos($mimetype,'-')); + if( file_exists( "$SERVERROOT/core/img/mimetypes/$mimetype.png" )){ + return "$WEBROOT/core/img/mimetypes/$mimetype.png"; + } else{ return "$WEBROOT/core/img/mimetypes/file.png"; } -- cgit v1.2.3 From 03713ede032a6fced5ab24d918d424c7585a355e Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 29 Jul 2011 01:42:08 +0200 Subject: updated ownCloud icon and position --- core/css/styles.css | 2 +- core/img/owncloud-logo-small-white.png | Bin 5339 -> 3550 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/core/css/styles.css b/core/css/styles.css index 35b65f9480d..48a36734e52 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -2,7 +2,7 @@ body { background:#fefefe url('../img/body_background.jpg') repeat-y left top; font:normal 80%/1.6em "Lucida Grande", Arial, Verdana, sans-serif; color:#000; } #header { position:fixed; top:0; z-index:100; width:100%; height:2.5em; padding:0.5em 1.5em; background:#1d2d44; -moz-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; -webkit-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; box-shadow:0 0 10px #000, inset 0 -2px 10px #222; } #body-settings #header { background:#313131; } -#owncloud { float:left; margin:0 0 0 2em; } +#owncloud { float:left; } h1 { margin:1em 3em 1em 0; border-bottom:1px solid #666; text-transform:uppercase; font-weight:normal; font-style:italic; color:#666; } p.center { text-align:center; } a { color:#000; text-decoration:none; outline:0; } diff --git a/core/img/owncloud-logo-small-white.png b/core/img/owncloud-logo-small-white.png index 8374c133506..c0d8a92d833 100644 Binary files a/core/img/owncloud-logo-small-white.png and b/core/img/owncloud-logo-small-white.png differ -- cgit v1.2.3 From ebec36f19019f04d4994ab5980c54208c035a964 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 29 Jul 2011 01:53:29 +0200 Subject: better image icon --- core/img/mimetypes/image.png | Bin 284 -> 303 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/core/img/mimetypes/image.png b/core/img/mimetypes/image.png index 06d4024fa23..3dda2729bc9 100644 Binary files a/core/img/mimetypes/image.png and b/core/img/mimetypes/image.png differ -- cgit v1.2.3 From 3a9af23cda613f7cad497ef824fd80ed66229d56 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 02:02:17 +0200 Subject: always show download icon on hover --- files/js/fileactions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/js/fileactions.js b/files/js/fileactions.js index e1f25885fec..4de7fa5542b 100644 --- a/files/js/fileactions.js +++ b/files/js/fileactions.js @@ -56,7 +56,7 @@ FileActions={ var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType()); var defaultAction=FileActions.getDefault(FileActions.getCurrentMimeType(),FileActions.getCurrentType()); for(name in actions){ - if(actions[name]!=defaultAction && name!='Delete'){ + if((name=='Download' || actions[name]!=defaultAction) && name!='Delete'){ var img=FileActions.icons[name]; var html=''; var element=$(html); -- cgit v1.2.3 From 0e76d06358d6ba8d47a907e64b38f7b63580d33f Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 02:17:40 +0200 Subject: properly style filenames after renaming --- files/js/filelist.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/files/js/filelist.js b/files/js/filelist.js index a53ad672e42..901c4fe2188 100644 --- a/files/js/filelist.js +++ b/files/js/filelist.js @@ -121,7 +121,15 @@ FileList={ event.preventDefault(); tr.attr('data-file',newname); td.children('a.name').empty(); - td.children('a.name').text(newname); + if(newname.indexOf('.')>0){ + basename=newname.substr(0,newname.indexOf('.')); + }else{ + basename=newname; + } + td.children('a.name').text(basename); + if(newname.indexOf('.')>0){ + td.children('a.name').append($(''+newname.substr(newname.indexOf('.'))+'')); + } $.ajax({ url: 'ajax/rename.php', data: "dir="+$('#dir').val()+"&newname="+encodeURIComponent(newname)+"&file="+encodeURIComponent(name) @@ -133,7 +141,15 @@ FileList={ }); input.blur(function(){ td.children('a.name').empty(); - td.children('a.name').text(name); + if(name.indexOf('.')>0){ + basename=name.substr(0,name.indexOf('.')); + }else{ + basename=name; + } + td.children('a.name').text(basename); + if(name.indexOf('.')>0){ + td.children('a.name').append($(''+name.substr(name.indexOf('.'))+'')); + } }); } } -- cgit v1.2.3 From 224dbed79c83930b16f2c080a75a0f8cc05bdc61 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 29 Jul 2011 02:19:53 +0200 Subject: narrow modified column, remove help cursor --- files/css/files.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/css/files.css b/files/css/files.css index 328eaa40f50..46650418409 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -23,8 +23,8 @@ table th { padding:.5em; height:2em; } table th .name { float:left; margin-left:.5em; } table th, table td { border-bottom:1px solid #ddd; text-align:left; font-weight:normal; } table td { border-bottom:1px solid #eee; font-style:normal; } -table th#headerSize, table td.filesize { width:5em; padding:0 1em; text-align:right; cursor:help; } -table th#headerDate, table td.date { width:15em; padding:0 .1em 0 1em; text-align:left; } +table th#headerSize, table td.filesize { width:5em; padding:0 1em; text-align:right; } +table th#headerDate, table td.date { width:10em; padding:0 .1em 0 1em; text-align:left; } table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; } table td.filename a.name { display:block; background-image:url('../img/file.png'); height:1.5em; vertical-align:middle; } table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:.2em .5em .5em 3em; background-position:1em .5em; background-repeat:no-repeat; } -- cgit v1.2.3 From a7748c14c61fbcf412eb96203f2f70e9ef77a9b9 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 02:26:20 +0200 Subject: dont need the ok button for renaming --- files/css/files.css | 1 + files/js/fileactions.js | 4 ++++ files/js/filelist.js | 6 +++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/files/css/files.css b/files/css/files.css index 46650418409..57dc05d135c 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -27,6 +27,7 @@ table th#headerSize, table td.filesize { width:5em; padding:0 1em; text-align:ri table th#headerDate, table td.date { width:10em; padding:0 .1em 0 1em; text-align:left; } table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; } table td.filename a.name { display:block; background-image:url('../img/file.png'); height:1.5em; vertical-align:middle; } +table td.filename a.name input, table td.filename a.name form { width:100% } table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:.2em .5em .5em 3em; background-position:1em .5em; background-repeat:no-repeat; } table td.filename .nametext, .modified { float:left; padding:.3em 0; } table td.filename .nametext { width:80%; } diff --git a/files/js/fileactions.js b/files/js/fileactions.js index 4de7fa5542b..359e54dda3c 100644 --- a/files/js/fileactions.js +++ b/files/js/fileactions.js @@ -54,6 +54,10 @@ FileActions={ display:function(parent){ FileActions.currentFile=parent; var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType()); + var file=FileActions.getCurrentFile(); + if($('tr[data-file="'+file+'"]').data('renaming')){ + return; + } var defaultAction=FileActions.getDefault(FileActions.getCurrentMimeType(),FileActions.getCurrentType()); for(name in actions){ if((name=='Download' || actions[name]!=defaultAction) && name!='Delete'){ diff --git a/files/js/filelist.js b/files/js/filelist.js index 901c4fe2188..ce904075588 100644 --- a/files/js/filelist.js +++ b/files/js/filelist.js @@ -105,18 +105,17 @@ FileList={ }, rename:function(name){ var tr=$('tr[data-file="'+name+'"]'); + tr.data('renaming',true); var td=tr.children('td.filename'); var input=$(''); - var button=$(''); var form=$('
    ') form.append(input); - form.append(button); td.children('a.name').text(''); td.children('a.name').append(form) input.focus(); - td.children('a.name').append(button); form.submit(function(event){ var newname=input.val(); + tr.data('renaming',false); event.stopPropagation(); event.preventDefault(); tr.attr('data-file',newname); @@ -140,6 +139,7 @@ FileList={ event.preventDefault(); }); input.blur(function(){ + tr.data('renaming',false); td.children('a.name').empty(); if(name.indexOf('.')>0){ basename=name.substr(0,name.indexOf('.')); -- cgit v1.2.3 From 952b83cbdce07eb95ae343fe25c6785b24b43b4b Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 02:28:39 +0200 Subject: show proper cursor for rename textfield --- files/css/files.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/css/files.css b/files/css/files.css index 57dc05d135c..4afec03daa1 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -27,7 +27,7 @@ table th#headerSize, table td.filesize { width:5em; padding:0 1em; text-align:ri table th#headerDate, table td.date { width:10em; padding:0 .1em 0 1em; text-align:left; } table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; } table td.filename a.name { display:block; background-image:url('../img/file.png'); height:1.5em; vertical-align:middle; } -table td.filename a.name input, table td.filename a.name form { width:100% } +table td.filename a.name input, table td.filename a.name form { width:100%; cursor:text } table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:.2em .5em .5em 3em; background-position:1em .5em; background-repeat:no-repeat; } table td.filename .nametext, .modified { float:left; padding:.3em 0; } table td.filename .nametext { width:80%; } -- cgit v1.2.3 From 3758b0d707d1f4ce5db0b0f465014caa23ed77b1 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 02:33:58 +0200 Subject: fix size of selected files with new uploaded files --- files/js/filelist.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/js/filelist.js b/files/js/filelist.js index ce904075588..0695b482534 100644 --- a/files/js/filelist.js +++ b/files/js/filelist.js @@ -4,7 +4,7 @@ FileList={ }, addFile:function(name,size,lastModified,loading){ var img=(loading)?'img/loading.gif':'img/file.png'; - var html=''; + var html=''; if(name.indexOf('.')!=-1){ var basename=name.substr(0,name.indexOf('.')); var extention=name.substr(name.indexOf('.')); @@ -37,7 +37,7 @@ FileList={ } }, addDir:function(name,size,lastModified){ - var html=''; + var html=''; html+='
    '+name+''; if(size!='Pending'){ simpleSize=simpleFileSize(size); -- cgit v1.2.3 From 23f051ccd6eb3f6964cd6a61d867e367381dd8d4 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 29 Jul 2011 02:35:16 +0200 Subject: redesigned search box --- core/css/styles.css | 3 ++- core/img/actions/search.png | Bin 0 -> 701 bytes core/templates/part.searchbox.php | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 core/img/actions/search.png diff --git a/core/css/styles.css b/core/css/styles.css index 48a36734e52..55e050b1962 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -78,7 +78,8 @@ background: linear-gradient(top, #35537a 0%,#1d2d42 100%); /* W3C */ } #metanav li a img { vertical-align:middle; } /* SEARCH --------------------------------------------------------------------- */ -form.searchbox { display:inline; position:fixed; top:1em; right:10em; margin:0; padding:0; } +form.searchbox { display:inline; position:fixed; top:.9em; right:9em; margin:0; padding:0; } +input[type="search"] { font-size:1em; padding-left:2em; background:#eee url('../img/actions/search.png') .5em center no-repeat; } /* NAVIGATION ------------------------------------------------------------- */ #plugins { position:fixed; top:3.5em; float:left; width:15.7em; padding:0; z-index:0; } diff --git a/core/img/actions/search.png b/core/img/actions/search.png new file mode 100644 index 00000000000..bfedb80bb57 Binary files /dev/null and b/core/img/actions/search.png differ diff --git a/core/templates/part.searchbox.php b/core/templates/part.searchbox.php index 19b089ef84f..efce47ecd24 100644 --- a/core/templates/part.searchbox.php +++ b/core/templates/part.searchbox.php @@ -1,4 +1,3 @@ -- cgit v1.2.3 From 468319fe049102bc62c59e81a49cbf5e62e0e0ad Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 02:35:53 +0200 Subject: no need for an ok button for creating folders --- files/js/files.js | 19 +++---------------- files/templates/index.php | 1 - 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/files/js/files.js b/files/js/files.js index 193c740b6c5..4e1de1b04a4 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -63,10 +63,11 @@ $(document).ready(function() { data: "dir="+$('#dir').val()+"&foldername="+$('#file_newfolder_name').val(), complete: function(data){boolOperationFinished(data, function(){ var date=new Date(); - FileList.addDir($('#file_newfolder_name').val(),0,date) + FileList.addDir($('#file_newfolder_name').val(),0,date); + $('#file_newfolder_name').val('New Folder'); + $('#file_newfolder_name').blur(); });} }); - $('#file_newfolder_submit').fadeOut(250).trigger('vanish'); }); $('#file_newfolder_name').click(function(){ @@ -75,20 +76,6 @@ $(document).ready(function() { } }); - $('#file_newfolder_name').bind('keyup', adjustNewFolderSize); - - $('#file_newfolder_submit').bind('vanish', function() { - $('#file_newfolder_name').bind('keyup', adjustNewFolderSize); - unsplitSize($('#file_newfolder_name'),$('#file_newfolder_submit')); - }); - - $('#file_newfolder_name').focusout(function(){ - if($('#file_newfolder_name').val() == '') { - $('#file_newfolder_form')[0].reset(); - $('#file_newfolder_submit').fadeOut(250).trigger('vanish'); - } - }); - $('.download').click('click',function(event) { var files=getSelectedFiles('name').join(';'); diff --git a/files/templates/index.php b/files/templates/index.php index 336cca19cd4..9bc939ee90a 100644 --- a/files/templates/index.php +++ b/files/templates/index.php @@ -15,7 +15,6 @@
      -
    -- cgit v1.2.3 From 2d43f6e307e407635483ba503c404d5a2d24522d Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 02:47:02 +0200 Subject: make foldernames also bold after renaming --- files/css/files.css | 1 + files/js/filelist.js | 2 +- files/templates/part.list.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/files/css/files.css b/files/css/files.css index 4afec03daa1..4f217ff819c 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -27,6 +27,7 @@ table th#headerSize, table td.filesize { width:5em; padding:0 1em; text-align:ri table th#headerDate, table td.date { width:10em; padding:0 .1em 0 1em; text-align:left; } table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; } table td.filename a.name { display:block; background-image:url('../img/file.png'); height:1.5em; vertical-align:middle; } +table tr[data-type="dir"] td.filename a.name {font-weight:bold; } table td.filename a.name input, table td.filename a.name form { width:100%; cursor:text } table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:.2em .5em .5em 3em; background-position:1em .5em; background-repeat:no-repeat; } table td.filename .nametext, .modified { float:left; padding:.3em 0; } diff --git a/files/js/filelist.js b/files/js/filelist.js index 0695b482534..260ca00b977 100644 --- a/files/js/filelist.js +++ b/files/js/filelist.js @@ -38,7 +38,7 @@ FileList={ }, addDir:function(name,size,lastModified){ var html=''; - html+=''+name+''; + html+=''+name+''; if(size!='Pending'){ simpleSize=simpleFileSize(size); }else{ diff --git a/files/templates/part.list.php b/files/templates/part.list.php index a0ffb4b6073..e4e178cba16 100644 --- a/files/templates/part.list.php +++ b/files/templates/part.list.php @@ -10,7 +10,7 @@ - + -- cgit v1.2.3 From 18d8f34f96848c91b4d677951bb2ebe0b7494c3b Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 02:54:19 +0200 Subject: fix breadcrumb look of Files in navigation panel --- core/css/styles.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/css/styles.css b/core/css/styles.css index 55e050b1962..cfb5db55d99 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -82,7 +82,7 @@ form.searchbox { display:inline; position:fixed; top:.9em; right:9em; margin:0; input[type="search"] { font-size:1em; padding-left:2em; background:#eee url('../img/actions/search.png') .5em center no-repeat; } /* NAVIGATION ------------------------------------------------------------- */ -#plugins { position:fixed; top:3.5em; float:left; width:15.7em; padding:0; z-index:0; } +#plugins { position:fixed; top:3.5em; float:left; width:15.7em; padding:0; z-index:50; } #plugins ul { list-style-type:none; border-top:1px solid #ccc; } #plugins a { display:block; padding:0.5em 0.5em 0.5em 3em; background-position:1.5em center; background-repeat:no-repeat; border-bottom:1px solid #ddd; border-top:1px solid #fff; text-decoration:none; font-size:1.2em; color:#666; } #plugins a.active, #plugins a:hover, #plugins a:focus, #plugins a.selected { background-color:#ccc; border-top:1px solid #ccc; border-bottom:1px solid #ccc; color:#000; outline:0; } -- cgit v1.2.3 From d23d4e66c5908fd185f792e790e5e2d544a2bc79 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 29 Jul 2011 03:04:25 +0200 Subject: revised color calculation for size and age --- files/templates/part.list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/templates/part.list.php b/files/templates/part.list.php index e4e178cba16..7fa44d0b310 100644 --- a/files/templates/part.list.php +++ b/files/templates/part.list.php @@ -1,8 +1,8 @@ 200) $relative_date_color = 200; ?> '> -- cgit v1.2.3 From 7e0bbd20c0f4b67d31fbe83669c26605449a48fb Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 29 Jul 2011 03:09:30 +0200 Subject: revised coloring again --- files/css/files.css | 2 +- files/templates/part.list.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/files/css/files.css b/files/css/files.css index 4f217ff819c..dd2ed732c77 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -24,7 +24,7 @@ table th .name { float:left; margin-left:.5em; } table th, table td { border-bottom:1px solid #ddd; text-align:left; font-weight:normal; } table td { border-bottom:1px solid #eee; font-style:normal; } table th#headerSize, table td.filesize { width:5em; padding:0 1em; text-align:right; } -table th#headerDate, table td.date { width:10em; padding:0 .1em 0 1em; text-align:left; } +table th#headerDate, table td.date { width:11em; padding:0 .1em 0 1em; text-align:left; } table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; } table td.filename a.name { display:block; background-image:url('../img/file.png'); height:1.5em; vertical-align:middle; } table tr[data-type="dir"] td.filename a.name {font-weight:bold; } diff --git a/files/templates/part.list.php b/files/templates/part.list.php index 7fa44d0b310..54606e083e3 100644 --- a/files/templates/part.list.php +++ b/files/templates/part.list.php @@ -1,6 +1,7 @@ 200) $relative_date_color = 200; ?> -- cgit v1.2.3 From 72402ff143468523656090682c0bb1681af0fc32 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 29 Jul 2011 04:24:02 +0200 Subject: removed some more legacy CSS --- apps/files_publiclink/templates/admin.php | 2 +- core/css/styles.css | 15 --------------- files/css/files.css | 3 ++- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/apps/files_publiclink/templates/admin.php b/apps/files_publiclink/templates/admin.php index da4586cb3df..04aaf5c4302 100644 --- a/apps/files_publiclink/templates/admin.php +++ b/apps/files_publiclink/templates/admin.php @@ -25,4 +25,4 @@ - \ No newline at end of file + diff --git a/core/css/styles.css b/core/css/styles.css index cfb5db55d99..6fc24d4c212 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -93,21 +93,6 @@ input[type="search"] { font-size:1em; padding-left:2em; background:#eee url('../ /* CONTENT ------------------------------------------------------------------ */ #content { margin:3.5em 0 0 15.7em; } - -/* NAVIGATION BAR */ -span.nav { display:block; float:left; /*margin-right:55em;*/ } -span.nav a { padding:0.5em 1.5em 0.5em 0.5em; background-position:right center; background-repeat:no-repeat; background-image:url('../img/arrow.png'); text-decoration:none; } -span.nav a img { height:16px; vertical-align:text-top; } - -/* ACTIONS BAR */ -p.actions, div.actions { padding:7px; float:right; margin-right:16em; } -p.actions a, div.actions a { padding:0.5em 0.5em 0.5em 3em; background-position:1em center; background-repeat:no-repeat; background-image:url('../img/action.png'); border-right:1px solid #eee; text-decoration:none; color:#333; } -p.actions a:hover, p.actions a:focus, div.actions a:hover, div.actions a:focus { background-color:#eee; color:#000; outline:0; } -p.actions a:active, div.actions a:active { outline:0; } -p.actions a.new-dir, div.actions a.new-dir { background-image:url('../img/folder-new.png'); } -p.actions a.download, div.actions a.download { background-image:url('../img/download.png'); } -p.actions a.delete, div.actions a.delete { background-image:url('../img/delete.png'); } - /* USER SETTINGS ------------------------------------------------------------ */ #quota_indicator { margin:0 4em 1em 0; padding:0; border:1px solid #ddd; border-radius:10px; -webkit-border-radius:10px; -moz-border-radius:10px; } #quota_indicator div { background-color:#76A9EA; border-radius:10px; -webkit-border-radius:10px; -moz-border-radius:10px; } diff --git a/files/css/files.css b/files/css/files.css index dd2ed732c77..56a06a903b3 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -1,4 +1,5 @@ /* FILE MENU */ +.actions { padding:.6em; float:right; margin-right:16em; } #file_menu { right:0px; position:absolute; top:0; } #file_menu a { display:block; float:left; background-image:none; text-decoration:none; } .file_upload_form, #file_newfolder_form { display:inline; } @@ -17,7 +18,7 @@ table { position:relative; top:37px; width:100%; } tbody tr:hover, tbody tr:active, tbody tr.selected { background-color:#eee; } tbody a { color:#000; } span.extention, td.date { color:#999; } -div.crumb { float:left; display:block; background-repeat:no-repeat; background-position:right 0px; font-weight:bold; padding-top:8px; padding-left:8px; height:28px; /*36-8*/ } +div.crumb { float:left; display:block; background:no-repeat right 0; font-weight:bold; padding:8px 1.5em 0 1em; height:28px; /*36-8*/ } table tr.mouseOver td { background-color:#eee; } table th { padding:.5em; height:2em; } table th .name { float:left; margin-left:.5em; } -- cgit v1.2.3 From 46400a8124240679b7be4ae50ee932be31b18e2e Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 29 Jul 2011 13:01:15 +0200 Subject: message and hint for upload if folder is empty --- files/css/files.css | 1 + files/templates/part.list.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/files/css/files.css b/files/css/files.css index 56a06a903b3..50b61a488d1 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -14,6 +14,7 @@ .file_upload_target { display:none; } /* FILE TABLE */ +span#emptyfolder { position:absolute; margin:10em 0 0 10em; font-size:1.5em; font-weight:bold; color:#888; text-shadow:#fff 0 1px 0; } table { position:relative; top:37px; width:100%; } tbody tr:hover, tbody tr:active, tbody tr.selected { background-color:#eee; } tbody a { color:#000; } diff --git a/files/templates/part.list.php b/files/templates/part.list.php index 54606e083e3..d249455c55c 100644 --- a/files/templates/part.list.php +++ b/files/templates/part.list.php @@ -1,4 +1,5 @@ - Nothing in here. Upload something!'; + foreach($_['files'] as $file): $simple_file_size = simple_file_size($file['size']); $simple_size_color = 200-intval($file['size']/(1024*1024)*5); if($simple_size_color<0) $simple_size_color = 0; -- cgit v1.2.3 From dee7fb3b722388c30a5ca3e69fb3cf846bb48edf Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 16:48:09 +0200 Subject: fix login header for ie --- core/css/styles.css | 6 +++--- core/templates/login.php | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index 6fc24d4c212..99090b9171e 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -31,7 +31,7 @@ div.controls { width:100%; margin:0px; background-color:#f7f7f7; border-bottom:1 #body-login p.info { width:16em; margin:2em auto; padding:1em; background-color:#eee; border:1px solid #ccc; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; } #body-login p.info a { font-weight:bold; } -#login header { margin-top:-2em; height:10em; +#login div.header { margin-top:-2em; height:10em; -moz-box-shadow:0 0 5px #000; -webkit-box-shadow:0 0 20px #000; box-shadow:0 0 20px #000; background: #1d2d44; /* Old browsers */ background: -moz-linear-gradient(top, #35537a 0%, #1d2d42 100%); /* FF3.6+ */ @@ -39,8 +39,8 @@ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#35537 background: -webkit-linear-gradient(top, #35537a 0%,#1d2d42 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #35537a 0%,#1d2d42 100%); /* Opera11.10+ */ background: -ms-linear-gradient(top, #35537a 0%,#1d2d42 100%); /* IE10+ */ -filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#35537a', endColorstr='#1d2d42',GradientType=0 ); /* IE6-9 */ -background: linear-gradient(top, #35537a 0%,#1d2d42 100%); /* W3C */ } +background: linear-gradient(top, #35537a 0%,#1d2d42 100%); /* W3C */ +filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#35537a', endColorstr='#1d2d42',GradientType=0 ); /* IE6-9 */ } #login { margin:0 auto 0 auto; padding:2em 0 0 0; border-bottom:1px solid #FFF; text-align:center; background:#eee; } #login_form { width:20em; margin:4em auto; padding:0; } #login_form fieldset { background-color:transparent; border:0; } diff --git a/core/templates/login.php b/core/templates/login.php index fb3177eb0ee..c3095047f48 100644 --- a/core/templates/login.php +++ b/core/templates/login.php @@ -1,5 +1,9 @@
    -
    ownCloud
    +
    +
    + ownCloud +
    +
    -- cgit v1.2.3 From 2781fdeed8f1d45ebba23fb2b2e22aa3bbd5f2ff Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 16:52:09 +0200 Subject: automatically replace svg images with png for browsers that dont support svg --- core/js/js.js | 10 ++++++++++ core/templates/layout.admin.php | 4 ++-- core/templates/layout.user.php | 4 ++-- files/templates/index.php | 4 ++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/core/js/js.js b/core/js/js.js index 407c5708701..db96a1adb3e 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -103,3 +103,13 @@ if (!Array.prototype.indexOf){ function SVGSupport() { return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") || document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Shape", "1.0"); } + +$(document).ready(function(){ + if(!SVGSupport()){//replace all svg images with png images for browser that dont support svg + $('img.svg').each(function(index,element){ + element=$(element); + var src=element.attr('src'); + element.attr('src',src.substr(0,src.length-3)+'png'); + }); + }; +}); diff --git a/core/templates/layout.admin.php b/core/templates/layout.admin.php index 78ccf877221..8077fd304f3 100644 --- a/core/templates/layout.admin.php +++ b/core/templates/layout.admin.php @@ -30,8 +30,8 @@ diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index f8beb79e81e..a100eed96b1 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -31,8 +31,8 @@ ownCloud
      -
    • -
    • +
    • +
    diff --git a/files/templates/index.php b/files/templates/index.php index 9bc939ee90a..df78cf0bb2d 100644 --- a/files/templates/index.php +++ b/files/templates/index.php @@ -28,12 +28,12 @@ t( 'Name' ); ?> - Download + Download t( 'Size MB' ); ?> - t( 'Modified' ); ?>Delete + t( 'Modified' ); ?>Delete -- cgit v1.2.3 From 98e78c0599a641ed33ed2abd70e540ce43a7ef15 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 17:51:17 +0200 Subject: some tweaks for renaming --- files/js/filelist.js | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/files/js/filelist.js b/files/js/filelist.js index 260ca00b977..c3a2522fb6a 100644 --- a/files/js/filelist.js +++ b/files/js/filelist.js @@ -114,10 +114,10 @@ FileList={ td.children('a.name').append(form) input.focus(); form.submit(function(event){ - var newname=input.val(); - tr.data('renaming',false); event.stopPropagation(); event.preventDefault(); + var newname=input.val(); + tr.data('renaming',false); tr.attr('data-file',newname); td.children('a.name').empty(); if(newname.indexOf('.')>0){ @@ -125,9 +125,11 @@ FileList={ }else{ basename=newname; } - td.children('a.name').text(basename); + var span=$(''); + span.text(basename); + td.children('a.name').append(span); if(newname.indexOf('.')>0){ - td.children('a.name').append($(''+newname.substr(newname.indexOf('.'))+'')); + span.append($(''+newname.substr(newname.indexOf('.'))+'')); } $.ajax({ url: 'ajax/rename.php', @@ -139,17 +141,7 @@ FileList={ event.preventDefault(); }); input.blur(function(){ - tr.data('renaming',false); - td.children('a.name').empty(); - if(name.indexOf('.')>0){ - basename=name.substr(0,name.indexOf('.')); - }else{ - basename=name; - } - td.children('a.name').text(basename); - if(name.indexOf('.')>0){ - td.children('a.name').append($(''+name.substr(name.indexOf('.'))+'')); - } + form.trigger('submit'); }); } } -- cgit v1.2.3 From b6ad416757a78f404d757551ffa1697988bbf5b4 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 18:00:42 +0200 Subject: you can now move files to the root folder by draging them to the Files entry in the navigation panel --- files/js/files.js | 1 + 1 file changed, 1 insertion(+) diff --git a/files/js/files.js b/files/js/files.js index 4e1de1b04a4..be7e48aeeeb 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -5,6 +5,7 @@ $(document).ready(function() { $('#fileList tr td.filename').draggable(dragOptions); $('#fileList tr[data-type="dir"] td.filename').droppable(folderDropOptions); $('div.crumb').droppable(crumbDropOptions); + $('#plugins>ul>li:first-child').data('dir',''); $('#plugins>ul>li:first-child').droppable(crumbDropOptions); // Sets the file-action buttons behaviour : -- cgit v1.2.3 From 9f867abe75d6e8bfc6b30a8ddbf5ca2644598601 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Fri, 29 Jul 2011 12:17:46 -0400 Subject: Display subnavigation entries in user layout template --- core/templates/layout.user.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index f8beb79e81e..4077499a998 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -44,6 +44,11 @@
    -- cgit v1.2.3 From fe47d51598504dacdfce9b84016f8c1fd1af1755 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 19:12:55 +0200 Subject: some refactoring for subnavigation code --- core/templates/layout.user.php | 5 +++++ lib/app.php | 20 ++++++-------------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index a100eed96b1..f8007548fe2 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -44,6 +44,11 @@
    diff --git a/lib/app.php b/lib/app.php index 475015f6779..bccd0c665fa 100644 --- a/lib/app.php +++ b/lib/app.php @@ -310,20 +310,12 @@ class OC_APP{ /// Private foo private static function addSubNavigation( $list ){ - $found = false; - foreach( self::$subnavigation as $parent => $selection ){ - foreach( $selection as $subentry ){ - if( $subentry['id'] == self::$activeapp ){ - foreach( $list as &$naventry ){ - if( $naventry['id'] == $parent ){ - $naventry['active'] = true; - $naventry['subnavigation'] = $selection; - } - else{ - $naventry['active'] = false; - } - } unset( $naventry ); - $found = true; + if(isset(self::$subnavigation[self::$activeapp])){ + $subNav=self::$subnavigation[self::$activeapp]; + foreach( $list as &$naventry ){ + if( $naventry['id'] == self::$activeapp ){ + $naventry['active'] = true; + $naventry['subnavigation'] = $subNav; } } } -- cgit v1.2.3 From d12d08e2f3553b06df6371535f971c9f193bd388 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 19:38:01 +0200 Subject: some more changes for navigation subentries --- core/css/styles.css | 1 + core/templates/layout.admin.php | 11 +++++++---- core/templates/layout.user.php | 15 +++++++++------ lib/app.php | 36 ++++++++++++++++++++++++++---------- 4 files changed, 43 insertions(+), 20 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index 99090b9171e..00433979d24 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -89,6 +89,7 @@ input[type="search"] { font-size:1em; padding-left:2em; background:#eee url('../ #plugins a:active { outline:0; } #plugins .subentry { background-color:#ddd; border-top:1px solid #aaa; border-bottom:1px solid #ccc; color:#000; outline:0; } #plugins .subentry.active { background-color:#bbb; border-top:1px solid #aaa; border-bottom:1px solid #ccc; color:#000; outline:0; } +#plugins li.subentry a {padding-left:4em;} /* CONTENT ------------------------------------------------------------------ */ #content { margin:3.5em 0 0 15.7em; } diff --git a/core/templates/layout.admin.php b/core/templates/layout.admin.php index 8077fd304f3..3aac4c98ac5 100644 --- a/core/templates/layout.admin.php +++ b/core/templates/layout.admin.php @@ -48,12 +48,15 @@ -
  • class="active">
  • +
  • class="active"> - -
  • - +
      + +
    • + +
    + diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 4440ae28b27..8f073914a1f 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -43,12 +43,15 @@ diff --git a/lib/app.php b/lib/app.php index bccd0c665fa..b6c2512e79a 100644 --- a/lib/app.php +++ b/lib/app.php @@ -158,7 +158,10 @@ class OC_APP{ * the navigation. Lower values come first. */ public static function addNavigationEntry( $data ){ - // TODO: write function + $data['active']=false; + if(!isset($data['icon'])){ + $data['icon']=''; + } OC_APP::$navigation[] = $data; return true; } @@ -184,6 +187,10 @@ class OC_APP{ * the navigation. Lower values come first. */ public static function addNavigationSubEntry( $parent, $data ){ + $data['active']=false; + if(!isset($data['icon'])){ + $data['icon']=''; + } if( !array_key_exists( $parent, self::$subnavigation )){ self::$subnavigation[$parent] = array(); } @@ -318,16 +325,25 @@ class OC_APP{ $naventry['subnavigation'] = $subNav; } } - } - - // Mark subentry as active - foreach( $list as &$naventry ){ - if( $naventry['active'] ){ - foreach( $naventry['subnavigation'] as &$subnaventry ){ - $subnaventry['active'] = $subnaventry['id'] == self::$activeapp? true : false; - } unset( $subnaventry ); + }else{ + foreach(self::$subnavigation as $parent=>$entries){ + $activeParent=false; + foreach($entries as &$subNav){ + $subNav['active']=$subNav['id'] == self::$activeapp; + if($subNav['active']){ + $activeParent=true; + } + } + if($activeParent){ + foreach( $list as &$naventry ){ + if( $naventry['id'] == $parent ){ + $naventry['active'] = true; + $naventry['subnavigation'] = $entries; + } + } + } } - } unset( $naventry ); + } return $list; } -- cgit v1.2.3