/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk
20.1.1 by galaxyAbstractor
* Added an simple admin panel to the codeviewer-cmssy stuff
1
$(function(){
2
	var $_GET = {};
3
4
	document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () {
5
	    function decode(s) {
6
	        return decodeURIComponent(s.split("+").join(" "));
7
	    }
8
9
	    $_GET[decode(arguments[1])] = decode(arguments[2]);
10
	});
11
12
	var dropbox = $('#dropbox'),
13
		message = $('.message', dropbox);
14
	
15
	dropbox.filedrop({
16
		// The name of the $_FILES entry:
17
		paramname:'files',
18
		
19
		url: '../../../uploadfile/'+$('input[name="cid"]').val()+'/'+$('input[name="example"]').val()+'/'+$('input[name="page"]').val(),
20
		
21
		uploadFinished:function(i,file,response){
22
			$('.progress').addClass('done');
23
			$('#flist').append("<li>"+file.name+"</li>")
24
25
		},
26
		
27
    	error: function(err, file) {
28
			switch(err) {
29
				case 'BrowserNotSupported':
30
					showMessage('Your browser does not support HTML5 file uploads!');
31
					break;
32
				default:
33
					break;
34
			}
35
		},
36
		
37
		// Called before each upload is started
38
		beforeEach: function(file){
39
			
40
		},
41
		
42
		uploadStarted:function(i, file, len){
43
			
44
		},
45
		
46
		progressUpdated: function(i, file, progress) {
47
			$('.progress').width(progress);
48
		}
49
    	 
50
	});
51
	
52
53
	function showMessage(msg){
54
		message.html(msg);
55
	}
56
57
});