summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2013-09-03 05:38:59 -0700
committerJörn Friedrich Dreyer <jfd@butonic.de>2013-09-03 05:38:59 -0700
commit85758f3d7d7aed9cca5b043f85cdac216e4891b9 (patch)
tree3dd39f795f686e96373e9e5b18758cca34a6cef6
parentfe0b8ac2c0e4ffd06ab8a14d18a701e1ab9071af (diff)
parent449fe8c75ed6ccc52708d6efa1c7a00a7d0836d3 (diff)
downloadnextcloud-server-85758f3d7d7aed9cca5b043f85cdac216e4891b9.tar.gz
nextcloud-server-85758f3d7d7aed9cca5b043f85cdac216e4891b9.zip
Merge pull request #4473 from owncloud/texteditor_polishing
Texteditor polishing
-rw-r--r--apps/files/templates/index.php2
-rw-r--r--core/js/js.js49
2 files changed, 30 insertions, 21 deletions
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php
index 24cb8c2fe58..29cb457cd5a 100644
--- a/apps/files/templates/index.php
+++ b/apps/files/templates/index.php
@@ -104,7 +104,7 @@
<?php print_unescaped($_['fileList']); ?>
</tbody>
</table>
-<div id="editor"></div>
+<div id="editor"></div><!-- FIXME Do not use this div in your app! It is deprecated and will be removed in the future! -->
<div id="uploadsize-message" title="<?php p($l->t('Upload too large'))?>">
<p>
<?php p($l->t('The files you are trying to upload exceed the maximum size for file uploads on this server.'));?>
diff --git a/core/js/js.js b/core/js/js.js
index af4a6d6b336..1999ff73d23 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -431,9 +431,16 @@ OC.Notification={
OC.Breadcrumb={
container:null,
- crumbs:[],
show:function(dir, leafname, leaflink){
- OC.Breadcrumb.clear();
+ if(!this.container){//default
+ this.container=$('#controls');
+ }
+ this._show(this.container, dir, leafname, leaflink);
+ },
+ _show:function(container, dir, leafname, leaflink){
+ var self = this;
+
+ this._clear(container);
// show home + path in subdirectories
if (dir && dir !== '/') {
@@ -450,8 +457,7 @@ OC.Breadcrumb={
crumbImg.attr('src',OC.imagePath('core','places/home'));
crumbLink.append(crumbImg);
crumb.append(crumbLink);
- OC.Breadcrumb.container.prepend(crumb);
- OC.Breadcrumb.crumbs.push(crumb);
+ container.prepend(crumb);
//add path parts
var segments = dir.split('/');
@@ -460,20 +466,23 @@ OC.Breadcrumb={
if (name !== '') {
pathurl = pathurl+'/'+name;
var link = OC.linkTo('files','index.php')+'?dir='+encodeURIComponent(pathurl);
- OC.Breadcrumb.push(name, link);
+ self._push(container, name, link);
}
});
}
//add leafname
if (leafname && leaflink) {
- OC.Breadcrumb.push(leafname, leaflink);
+ this._push(container, leafname, leaflink);
}
},
push:function(name, link){
- if(!OC.Breadcrumb.container){//default
- OC.Breadcrumb.container=$('#controls');
+ if(!this.container){//default
+ this.container=$('#controls');
}
+ return this._push(OC.Breadcrumb.container, name, link);
+ },
+ _push:function(container, name, link){
var crumb=$('<div/>');
crumb.addClass('crumb').addClass('last');
@@ -482,30 +491,30 @@ OC.Breadcrumb={
crumbLink.text(name);
crumb.append(crumbLink);
- var existing=OC.Breadcrumb.container.find('div.crumb');
+ var existing=container.find('div.crumb');
if(existing.length){
existing.removeClass('last');
existing.last().after(crumb);
}else{
- OC.Breadcrumb.container.prepend(crumb);
+ container.prepend(crumb);
}
- OC.Breadcrumb.crumbs.push(crumb);
return crumb;
},
pop:function(){
- if(!OC.Breadcrumb.container){//default
- OC.Breadcrumb.container=$('#controls');
+ if(!this.container){//default
+ this.container=$('#controls');
}
- OC.Breadcrumb.container.find('div.crumb').last().remove();
- OC.Breadcrumb.container.find('div.crumb').last().addClass('last');
- OC.Breadcrumb.crumbs.pop();
+ this.container.find('div.crumb').last().remove();
+ this.container.find('div.crumb').last().addClass('last');
},
clear:function(){
- if(!OC.Breadcrumb.container){//default
- OC.Breadcrumb.container=$('#controls');
+ if(!this.container){//default
+ this.container=$('#controls');
}
- OC.Breadcrumb.container.find('div.crumb').remove();
- OC.Breadcrumb.crumbs=[];
+ this._clear(this.container);
+ },
+ _clear:function(container) {
+ container.find('div.crumb').remove();
}
};