Merge pull request #926 from dawnbreak/master

Fix JavaScript problems on channels where you are not allowed to upload ...
This commit is contained in:
Klaus 2015-03-12 23:14:51 +01:00
commit fc84c81f64

View File

@ -75,7 +75,6 @@ function initEditor(cb){
else {
$('#profile-jot-desc').html(' ');
}
});
ed.onInit.add(function(ed) {
@ -89,7 +88,6 @@ function initEditor(cb){
});
editor = true;
} else {
if (typeof cb!="undefined") cb();
}
@ -100,22 +98,19 @@ function enableOnUser(){
$(this).val("");
initEditor();
}
</script>
<script type="text/javascript" src="{{$baseurl}}/view/js/ajaxupload.js" ></script>
<script>
var ispublic = '{{$ispublic}}';
$(document).ready(function() {
/* enable tinymce on focus and click */
$("#profile-jot-text").focus(enableOnUser);
$("#profile-jot-text").click(enableOnUser);
var upload_title = $('#wall-image-upload').attr('title');
var attach_title = $('#wall-file-upload').attr('title');
var uploader = new window.AjaxUpload(
'wall-image-upload',
try {
var uploader = new window.AjaxUpload('wall-image-upload',
{ action: '{{$baseurl}}/wall_upload/{{$nickname}}',
name: 'userfile',
title: upload_title,
@ -125,10 +120,11 @@ function enableOnUser(){
$('#jot-media').val($('#jot-media').val() + response);
$('#profile-rotator').spin(false);
}
});
} catch (e) {
}
);
var uploader_sub = new window.AjaxUpload(
'wall-image-upload-sub',
try {
var uploader_sub = new window.AjaxUpload('wall-image-upload-sub',
{ action: '{{$baseurl}}/wall_upload/{{$nickname}}',
name: 'userfile',
title: upload_title,
@ -138,11 +134,11 @@ function enableOnUser(){
$('#jot-media').val($('#jot-media').val() + response);
$('#profile-rotator').spin(false);
}
});
} catch(e) {
}
);
var file_uploader = new window.AjaxUpload(
'wall-file-upload',
try {
var file_uploader = new window.AjaxUpload('wall-file-upload',
{ action: '{{$baseurl}}/wall_attach/{{$nickname}}',
name: 'userfile',
title: attach_title,
@ -152,10 +148,11 @@ function enableOnUser(){
$('#jot-media').val($('#jot-media').val() + response);
$('#profile-rotator').spin(false);
}
});
} catch(e) {
}
);
var file_uploader_sub = new window.AjaxUpload(
'wall-file-upload-sub',
try {
var file_uploader_sub = new window.AjaxUpload('wall-file-upload-sub',
{ action: '{{$baseurl}}/wall_attach/{{$nickname}}',
name: 'userfile',
title: attach_title,
@ -165,10 +162,9 @@ function enableOnUser(){
$('#jot-media').val($('#jot-media').val() + response);
$('#profile-rotator').spin(false);
}
});
} catch(e) {
}
);
});
function deleteCheckedItems() {
@ -232,8 +228,6 @@ function enableOnUser(){
$('#expiryModal').modal('hide');
}
})
}
function jotShare(id) {
@ -247,7 +241,6 @@ function enableOnUser(){
$('#like-rotator-' + id).spin(false);
$(window).scrollTop(0);
});
});
}
@ -352,8 +345,6 @@ function enableOnUser(){
$('#profile-nolocation-wrapper').attr('disabled', true);
}
{{$geotag}}
</script>
@ -366,12 +357,11 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del
e.preventDefault();
bootbox.confirm("<h4>{{$confirmdelete}}</h4>",function(result) {
if (result) {
document.location.href = link;}
});}
else {
document.location.href = link;
}
});
} else {
return confirm("{{$confirmdelete}}");
}
});
</script>