aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/detailsview.js5
-rw-r--r--apps/files/js/detailtabview.js9
-rw-r--r--apps/files/js/favoritesfilelist.js6
-rw-r--r--apps/files/js/favoritesplugin.js5
-rw-r--r--apps/files/js/filelist.js22
-rw-r--r--apps/files/js/newfilemenu.js2
-rw-r--r--apps/files/js/recentplugin.js5
-rw-r--r--apps/files/js/sidebarpreviewmanager.js2
-rw-r--r--apps/files/js/templates.js12
-rw-r--r--apps/files/js/templates/detailsview.handlebars1
10 files changed, 55 insertions, 14 deletions
diff --git a/apps/files/js/detailsview.js b/apps/files/js/detailsview.js
index 2a5d589a730..cd602961c0a 100644
--- a/apps/files/js/detailsview.js
+++ b/apps/files/js/detailsview.js
@@ -102,7 +102,7 @@
this.$el.insertAfter($('#app-content'));
} else {
if ($appSidebar[0] !== this.el) {
- $appSidebar.replaceWith(this.$el)
+ $appSidebar.replaceWith(this.$el);
}
}
@@ -122,7 +122,8 @@
templateVars.tabHeaders = _.map(this._tabViews, function(tabView, i) {
return {
tabId: tabView.id,
- label: tabView.getLabel()
+ label: tabView.getLabel(),
+ tabIcon: tabView.getIcon()
};
});
diff --git a/apps/files/js/detailtabview.js b/apps/files/js/detailtabview.js
index 0bd34a88188..a66cedbc15d 100644
--- a/apps/files/js/detailtabview.js
+++ b/apps/files/js/detailtabview.js
@@ -50,6 +50,15 @@
},
/**
+ * Returns the tab label
+ *
+ * @return {String}|{null} icon class
+ */
+ getIcon: function() {
+ return null
+ },
+
+ /**
* returns the jQuery object for HTML output
*
* @returns {jQuery}
diff --git a/apps/files/js/favoritesfilelist.js b/apps/files/js/favoritesfilelist.js
index 8c9c125d0a1..44adf5d7b5b 100644
--- a/apps/files/js/favoritesfilelist.js
+++ b/apps/files/js/favoritesfilelist.js
@@ -94,12 +94,6 @@ $(document).ready(function() {
return OCA.Files.FileList.prototype.reloadCallback.call(this, status, result);
},
-
- _onUrlChanged: function (e) {
- if (e && _.isString(e.dir)) {
- this.changeDirectory(e.dir, false, true);
- }
- }
});
OCA.Files.FavoritesFileList = FavoritesFileList;
diff --git a/apps/files/js/favoritesplugin.js b/apps/files/js/favoritesplugin.js
index 7294ef9461c..3ceadca826d 100644
--- a/apps/files/js/favoritesplugin.js
+++ b/apps/files/js/favoritesplugin.js
@@ -67,6 +67,11 @@
return new OCA.Files.FavoritesFileList(
$el, {
fileActions: fileActions,
+ // The file list is created when a "show" event is handled,
+ // so it should be marked as "shown" like it would have been
+ // done if handling the event with the file list already
+ // created.
+ shown: true
}
);
},
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 1f4d230cef0..75cef4afece 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -221,6 +221,10 @@
return;
}
+ if (options.shown) {
+ this.shown = options.shown;
+ }
+
if (options.config) {
this._filesConfig = options.config;
} else if (!_.isUndefined(OCA.Files) && !_.isUndefined(OCA.Files.App)) {
@@ -310,10 +314,10 @@
breadcrumbOptions.onDrop = _.bind(this._onDropOnBreadCrumb, this);
breadcrumbOptions.onOver = function() {
self.$el.find('td.filename.ui-droppable').droppable('disable');
- }
+ };
breadcrumbOptions.onOut = function() {
self.$el.find('td.filename.ui-droppable').droppable('enable');
- }
+ };
}
this.breadcrumb = new OCA.Files.BreadCrumb(breadcrumbOptions);
@@ -1409,6 +1413,10 @@
// rgb(118, 118, 118) / #767676
// min. color contrast for normal text on white background according to WCAG AA
sizeColor = Math.round(118-Math.pow((fileData.size/(1024*1024)),2));
+
+ if (OCA.Accessibility && OCA.Accessibility.theme === 'themedark') {
+ sizeColor = Math.abs(sizeColor);
+ }
} else {
simpleSize = t('files', 'Pending');
}
@@ -1428,6 +1436,16 @@
if (modifiedColor >= '118') {
modifiedColor = 118;
}
+ if (OCA.Accessibility && OCA.Accessibility.theme === 'themedark') {
+ modifiedColor = Math.abs(modifiedColor);
+
+ // ensure that the dimmest color is still readable
+ // rgb(130, 130, 130) / #828282
+ // min. color contrast for normal text on black background according to WCAG AA
+ if (modifiedColor < 130) {
+ modifiedColor = 130;
+ }
+ }
var formatted;
var text;
if (mtime > 0) {
diff --git a/apps/files/js/newfilemenu.js b/apps/files/js/newfilemenu.js
index 01a183a33a7..69450e97c2a 100644
--- a/apps/files/js/newfilemenu.js
+++ b/apps/files/js/newfilemenu.js
@@ -171,7 +171,7 @@
/* Find the right actionHandler that should be called.
* Actions is retrieved by using `actionSpec.id` */
- action = _.filter(self._menuItems, function(item) {
+ var action = _.filter(self._menuItems, function(item) {
return item.id == $target.attr('data-action');
}).pop();
action.actionHandler(newname);
diff --git a/apps/files/js/recentplugin.js b/apps/files/js/recentplugin.js
index 524b556a517..c1b013ef1b8 100644
--- a/apps/files/js/recentplugin.js
+++ b/apps/files/js/recentplugin.js
@@ -67,6 +67,11 @@
return new OCA.Files.RecentFileList(
$el, {
fileActions: fileActions,
+ // The file list is created when a "show" event is handled,
+ // so it should be marked as "shown" like it would have been
+ // done if handling the event with the file list already
+ // created.
+ shown: true
}
);
},
diff --git a/apps/files/js/sidebarpreviewmanager.js b/apps/files/js/sidebarpreviewmanager.js
index 27ccd4fc405..69528ce4e43 100644
--- a/apps/files/js/sidebarpreviewmanager.js
+++ b/apps/files/js/sidebarpreviewmanager.js
@@ -9,7 +9,7 @@
*/
(function () {
- SidebarPreviewManager = function (fileList) {
+ var SidebarPreviewManager = function (fileList) {
this._fileList = fileList;
this._previewHandlers = {};
OC.Plugins.attach('OCA.Files.SidebarPreviewManager', this);
diff --git a/apps/files/js/templates.js b/apps/files/js/templates.js
index 0511873c8fb..a2bdae5b3c4 100644
--- a/apps/files/js/templates.js
+++ b/apps/files/js/templates.js
@@ -7,13 +7,21 @@ templates['detailsview'] = template({"1":function(container,depth0,helpers,parti
+ ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.tabHeaders : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "</ul>\n";
},"2":function(container,depth0,helpers,partials,data) {
- var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
return " <li class=\"tabHeader\" data-tabid=\""
+ alias4(((helper = (helper = helpers.tabId || (depth0 != null ? depth0.tabId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"tabId","hash":{},"data":data}) : helper)))
- + "\" tabindex=\"0\">\n <a href=\"#\" tabindex=\"-1\">"
+ + "\" tabindex=\"0\">\n "
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.tabIcon : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + "\n <a href=\"#\" tabindex=\"-1\">"
+ alias4(((helper = (helper = helpers.label || (depth0 != null ? depth0.label : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"label","hash":{},"data":data}) : helper)))
+ "</a>\n </li>\n";
+},"3":function(container,depth0,helpers,partials,data) {
+ var helper;
+
+ return "<span class=\"icon "
+ + container.escapeExpression(((helper = (helper = helpers.tabIcon || (depth0 != null ? depth0.tabIcon : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"tabIcon","hash":{},"data":data}) : helper)))
+ + "\"></span>";
},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {});
diff --git a/apps/files/js/templates/detailsview.handlebars b/apps/files/js/templates/detailsview.handlebars
index 841a8fe25fe..4d489e4fa0d 100644
--- a/apps/files/js/templates/detailsview.handlebars
+++ b/apps/files/js/templates/detailsview.handlebars
@@ -3,6 +3,7 @@
<ul class="tabHeaders">
{{#each tabHeaders}}
<li class="tabHeader" data-tabid="{{tabId}}" tabindex="0">
+ {{#if tabIcon}}<span class="icon {{tabIcon}}"></span>{{/if}}
<a href="#" tabindex="-1">{{label}}</a>
</li>
{{/each}}