aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextShape.java
Commit message (Expand)AuthorAgeFilesLines
* committing intermediate results - hslf is mostly migrated to common interface...Andreas Beeker2015-04-271-5/+37
* committing intermediate results - xslf now compiles - hslf needs to be migrat...Andreas Beeker2015-03-071-52/+15
* initial commit - still lots of errors, but I need to switch to a clean trunk ...Andreas Beeker2015-02-211-130/+33
* Bug 56854 - XMLBeans performance when using getXXXList() and other proxy methodsAndreas Beeker2014-08-281-9/+10
* Bug 54210 - Fixed rendering text in flipped shapes in PPT2PNG and PPTX2PNGYegor Kozlov2012-12-021-1/+35
* more xlsf docs and samplesYegor Kozlov2011-12-161-1/+1
* xlsf tutorial and cookbook updatesYegor Kozlov2011-12-111-0/+19
* improved rendering of groupped shapes in xslfYegor Kozlov2011-12-041-1/+2
* more progress with XSLF: made some methods publis as suggested on poi-dev, mo...Yegor Kozlov2011-11-241-3/+14
* misc improvements in text rendering in xlsfYegor Kozlov2011-11-171-1/+1
* improved rendering of indented text in XSLF, also improved import content fro...Yegor Kozlov2011-11-101-4/+50
* more progress with xlsf: support for gradient and texture fills, backgrounds,...Yegor Kozlov2011-11-071-62/+90
* more progress with PPTX2PNG: support for gradient and texture fill, also refa...Yegor Kozlov2011-10-281-13/+9
* support for preset shape geometries in xslfYegor Kozlov2011-10-261-3/+6
* more progress with PPTX2PNGYegor Kozlov2011-10-241-5/+6
* initial support for rendering pptx slides into images with a PPTX2PNG command...Yegor Kozlov2011-10-211-72/+203
* support for tables and hyperlinks in XSLFYegor Kozlov2011-08-171-0/+365
ckport/47745/stable28'>backport/47745/stable28 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/files/js/filelist.js
blob: ce9595d3495716ca0d91dc9840020b18f9c21452 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
FileList={
	update:function(fileListHtml) {
		$('#fileList').empty().html(fileListHtml);
	},
	addFile:function(name,size,lastModified,loading){
		var img=(loading)?'img/loading.gif':'img/file.png';
		var html='<tr data-file="'+name+'" data-type="file" data-size="'+size+'">';
		if(name.indexOf('.')!=-1){
			var basename=name.substr(0,name.indexOf('.'));
			var extention=name.substr(name.indexOf('.'));
		}else{
			var basename=name;
			var extention=false;
		}
		html+='<td class="filename" style="background-image:url('+img+')"><input type="checkbox" />';
		html+='<a class="name" href="download.php?file='+$('#dir').val()+'/'+name+'"><span class="nametext">'+basename
		if(extention){
			html+='<span class="extention">'+extention+'</span>';
		}
		html+='</span></a></td>';
		if(size!='Pending'){
			simpleSize=simpleFileSize(size);
		}else{
			simpleSize='Pending';
		}
		sizeColor = Math.round(200-size/(1024*1024)*2);
		lastModifiedTime=Math.round(lastModified.getTime() / 1000);
		modifiedColor=Math.round((Math.round((new Date()).getTime() / 1000)-lastModifiedTime)/60/60/24*14);
		html+='<td class="filesize" title="'+humanFileSize(size)+'" style="color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')">'+simpleSize+'</td>';
		html+='<td class="date" title="'+formatDate(lastModified)+'" style="color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')">'+relative_modified_date(lastModified.getTime() / 1000)+'</td>';
		html+='</tr>';
		FileList.insertElement(name,'file',$(html));
		if(loading){
			$('tr[data-file="'+name+'"]').data('loading',true);
		}else{
			$('tr[data-file="'+name+'"] td.filename').draggable(dragOptions);
		}
	},
	addDir:function(name,size,lastModified){
		var html='<tr data-file="'+name+'" data-type="dir" data-size="'+size+'">';
		html+='<td class="filename" style="background-image:url(img/folder.png)"><input type="checkbox" /><a class="name" href="index.php?dir='+$('#dir').val()+'/'+name+'">'+name+'</a></td>';
		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+='<td class="filesize" title="'+humanFileSize(size)+'" style="color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')">'+simpleSize+'</td>';
		html+='<td class="date" title="'+formatDate(lastModified)+'" style="color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')">'+relative_modified_date(lastModified.getTime() / 1000)+'</td>';
		html+='</tr>';
		
		FileList.insertElement(name,'dir',$(html));
		$('tr[data-file="'+name+'"] td.filename').draggable(dragOptions);
		$('tr[data-file="'+name+'"] td.filename').droppable(folderDropOptions);
	},
	refresh:function(data) {
		result = jQuery.parseJSON(data.responseText);
		if(typeof(result.data.breadcrumb) != 'undefined'){
			updateBreadcrumb(result.data.breadcrumb);
		}
		FileList.update(result.data.files);
		resetFileActionPanel();
	},
	remove:function(name){
		$('tr[data-file="'+name+'"] td.filename').draggable('destroy');
		$('tr[data-file="'+name+'"]').remove();
		if($('tr[data-file]').length==0){
			$('#emptyfolder').show();
			$('.file_upload_filename').addClass('highlight');
		}
	},
	insertElement:function(name,type,element){
		//find the correct spot to insert the file or folder
		var fileElements=$('tr[data-file][data-type="'+type+'"]');
		var pos;
		if(name.localeCompare($(fileElements[0]).attr('data-file'))<0){
			pos=-1;
		}else if(name.localeCompare($(fileElements[fileElements.length-1]).attr('data-file'))>0){
			pos=fileElements.length-1;
		}else{
			for(var pos=0;pos<fileElements.length-1;pos++){
				if(name.localeCompare($(fileElements[pos]).attr('data-file'))>0 && name.localeCompare($(fileElements[pos+1]).attr('data-file'))<0){
					break;
				}
			}
		}
		if(fileElements.length){
			if(pos==-1){
				$(fileElements[0]).before(element);
			}else{
				$(fileElements[pos]).after(element);
			}
		}else if(type=='dir' && $('tr[data-file]').length>0){
			$('tr[data-file]').first().before(element);
		}else{
			$('#fileList').append(element);
		}
		$('#emptyfolder').hide();
		$('.file_upload_filename').removeClass('highlight');
	},
	loadingDone:function(name){
		$('tr[data-file="'+name+'"]').data('loading',false);
		var mime=$('tr[data-file="'+name+'"]').data('mime');
		$('tr[data-file="'+name+'"] td.filename').attr('style','background-image:url('+getMimeIcon(mime)+')');
		$('tr[data-file="'+name+'"] td.filename').draggable(dragOptions);
	},
	isLoading:function(name){
		return $('tr[data-file="'+name+'"]').data('loading');
	},
	rename:function(name){
		var tr=$('tr[data-file="'+name+'"]');
		tr.data('renaming',true);
		var td=tr.children('td.filename');
		var input=$('<input value="'+name+'" class="filename"></input>');
		var form=$('<form action="#"></form>')
		form.append(input);
		td.children('a.name').text('');
		td.children('a.name').append(form)
		input.focus();
		form.submit(function(event){
			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){
				basename=newname.substr(0,newname.indexOf('.'));
			}else{
				basename=newname;
			}
			var span=$('<span class="nametext"></span>');
			span.text(basename);
			td.children('a.name').append(span);
			if(newname.indexOf('.')>0){
				span.append($('<span class="extention">'+newname.substr(newname.indexOf('.'))+'</span>'));
			}
			$.ajax({
				url: 'ajax/rename.php',
				data: "dir="+$('#dir').val()+"&newname="+encodeURIComponent(newname)+"&file="+encodeURIComponent(name)
			});
		});
		form.click(function(event){
			event.stopPropagation();
			event.preventDefault();
		});
		input.blur(function(){
			form.trigger('submit');
		});
	},
	delete:function(files){
		if(FileList.deleteFiles){//finish any ongoing deletes first
			FileList.finishDelete(function(){
				FileList.delete(files);
			});
			return;
		}
		if(files.substr){
			files=[files];
		}
		$.each(files,function(index,file){
			$('tr[data-file="'+file+'"]').hide();
			$('tr[data-file="'+file+'"]').find('input[type="checkbox"]').removeAttr('checked');
			$('tr[data-file="'+file+'"]').removeClass('selected');
		});
		procesSelection();
		FileList.deleteCanceled=false;
		FileList.deleteFiles=files;
		$('#notification').text('undo deletion');
		$('#notification').fadeIn();
	},
	finishDelete:function(ready,sync){
		if(!FileList.deleteCanceled && FileList.deleteFiles){
			var fileNames=FileList.deleteFiles.join(';');
			$.ajax({
				url: 'ajax/delete.php',
				async:!sync,
				data: "dir="+$('#dir').val()+"&files="+encodeURIComponent(fileNames),
				complete: function(data){
					boolOperationFinished(data, function(){
						$('#notification').fadeOut();
						$.each(FileList.deleteFiles,function(index,file){
// 							alert(file);
							FileList.remove(file);
						});
						FileList.deleteCanceled=true;
						FileList.deleteFiles=null;
						if(ready){
							ready();
						}
					});
				}
			});
		}
	}
}

$(document).ready(function(){
	$('#notification').hide();
	$('#notification').click(function(){
		FileList.deleteCanceled=true;
		$('#notification').fadeOut();
		$.each(FileList.deleteFiles,function(index,file){
			$('tr[data-file="'+file+'"]').show();
// 			alert(file);
		});
		FileList.deleteFiles=null;
	});
	$(window).bind('beforeunload', function (){
		FileList.finishDelete(null,true);
	});
});