Merge pull request #926 from dawnbreak/master
Fix JavaScript problems on channels where you are not allowed to upload ...
This commit is contained in:
commit
fc84c81f64
@ -1,6 +1,6 @@
|
|||||||
<script language="javascript" type="text/javascript">
|
<script language="javascript" type="text/javascript">
|
||||||
|
|
||||||
var editor=false;
|
var editor = false;
|
||||||
var textlen = 0;
|
var textlen = 0;
|
||||||
var plaintext = '{{$editselect}}';
|
var plaintext = '{{$editselect}}';
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ function initEditor(cb){
|
|||||||
$(".jothidden").show();
|
$(".jothidden").show();
|
||||||
if (typeof cb!="undefined") cb();
|
if (typeof cb!="undefined") cb();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tinyMCE.init({
|
tinyMCE.init({
|
||||||
theme : "advanced",
|
theme : "advanced",
|
||||||
mode : "specific_textareas",
|
mode : "specific_textareas",
|
||||||
@ -74,8 +74,7 @@ function initEditor(cb){
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('#profile-jot-desc').html(' ');
|
$('#profile-jot-desc').html(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ed.onInit.add(function(ed) {
|
ed.onInit.add(function(ed) {
|
||||||
@ -89,7 +88,6 @@ function initEditor(cb){
|
|||||||
});
|
});
|
||||||
|
|
||||||
editor = true;
|
editor = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (typeof cb!="undefined") cb();
|
if (typeof cb!="undefined") cb();
|
||||||
}
|
}
|
||||||
@ -100,22 +98,19 @@ function enableOnUser(){
|
|||||||
$(this).val("");
|
$(this).val("");
|
||||||
initEditor();
|
initEditor();
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="{{$baseurl}}/view/js/ajaxupload.js" ></script>
|
<script type="text/javascript" src="{{$baseurl}}/view/js/ajaxupload.js" ></script>
|
||||||
<script>
|
<script>
|
||||||
var ispublic = '{{$ispublic}}';
|
var ispublic = '{{$ispublic}}';
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
/* enable tinymce on focus and click */
|
/* enable tinymce on focus and click */
|
||||||
$("#profile-jot-text").focus(enableOnUser);
|
$("#profile-jot-text").focus(enableOnUser);
|
||||||
$("#profile-jot-text").click(enableOnUser);
|
$("#profile-jot-text").click(enableOnUser);
|
||||||
var upload_title = $('#wall-image-upload').attr('title');
|
var upload_title = $('#wall-image-upload').attr('title');
|
||||||
var attach_title = $('#wall-file-upload').attr('title');
|
var attach_title = $('#wall-file-upload').attr('title');
|
||||||
|
try {
|
||||||
var uploader = new window.AjaxUpload(
|
var uploader = new window.AjaxUpload('wall-image-upload',
|
||||||
'wall-image-upload',
|
|
||||||
{ action: '{{$baseurl}}/wall_upload/{{$nickname}}',
|
{ action: '{{$baseurl}}/wall_upload/{{$nickname}}',
|
||||||
name: 'userfile',
|
name: 'userfile',
|
||||||
title: upload_title,
|
title: upload_title,
|
||||||
@ -124,11 +119,12 @@ function enableOnUser(){
|
|||||||
addeditortext(response);
|
addeditortext(response);
|
||||||
$('#jot-media').val($('#jot-media').val() + response);
|
$('#jot-media').val($('#jot-media').val() + response);
|
||||||
$('#profile-rotator').spin(false);
|
$('#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}}',
|
{ action: '{{$baseurl}}/wall_upload/{{$nickname}}',
|
||||||
name: 'userfile',
|
name: 'userfile',
|
||||||
title: upload_title,
|
title: upload_title,
|
||||||
@ -137,12 +133,12 @@ function enableOnUser(){
|
|||||||
addeditortext(response);
|
addeditortext(response);
|
||||||
$('#jot-media').val($('#jot-media').val() + response);
|
$('#jot-media').val($('#jot-media').val() + response);
|
||||||
$('#profile-rotator').spin(false);
|
$('#profile-rotator').spin(false);
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
);
|
} catch(e) {
|
||||||
|
}
|
||||||
var file_uploader = new window.AjaxUpload(
|
try {
|
||||||
'wall-file-upload',
|
var file_uploader = new window.AjaxUpload('wall-file-upload',
|
||||||
{ action: '{{$baseurl}}/wall_attach/{{$nickname}}',
|
{ action: '{{$baseurl}}/wall_attach/{{$nickname}}',
|
||||||
name: 'userfile',
|
name: 'userfile',
|
||||||
title: attach_title,
|
title: attach_title,
|
||||||
@ -152,10 +148,11 @@ function enableOnUser(){
|
|||||||
$('#jot-media').val($('#jot-media').val() + response);
|
$('#jot-media').val($('#jot-media').val() + response);
|
||||||
$('#profile-rotator').spin(false);
|
$('#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}}',
|
{ action: '{{$baseurl}}/wall_attach/{{$nickname}}',
|
||||||
name: 'userfile',
|
name: 'userfile',
|
||||||
title: attach_title,
|
title: attach_title,
|
||||||
@ -165,10 +162,9 @@ function enableOnUser(){
|
|||||||
$('#jot-media').val($('#jot-media').val() + response);
|
$('#jot-media').val($('#jot-media').val() + response);
|
||||||
$('#profile-rotator').spin(false);
|
$('#profile-rotator').spin(false);
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
);
|
} catch(e) {
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function deleteCheckedItems() {
|
function deleteCheckedItems() {
|
||||||
@ -182,7 +178,7 @@ function enableOnUser(){
|
|||||||
else {
|
else {
|
||||||
checkedstr = $(this).val();
|
checkedstr = $(this).val();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$.post('item', { dropitems: checkedstr }, function(data) {
|
$.post('item', { dropitems: checkedstr }, function(data) {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
@ -226,14 +222,12 @@ function enableOnUser(){
|
|||||||
//reply = prompt("{{$expirewhen}}", $('#jot-expire').val());
|
//reply = prompt("{{$expirewhen}}", $('#jot-expire').val());
|
||||||
$('#expiryModal').modal();
|
$('#expiryModal').modal();
|
||||||
$('#expiry-modal-OKButton').on('click', function() {
|
$('#expiry-modal-OKButton').on('click', function() {
|
||||||
reply=$('#expiration-date').val();
|
reply=$('#expiration-date').val();
|
||||||
if(reply && reply.length) {
|
if(reply && reply.length) {
|
||||||
$('#jot-expire').val(reply);
|
$('#jot-expire').val(reply);
|
||||||
$('#expiryModal').modal('hide');
|
$('#expiryModal').modal('hide');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function jotShare(id) {
|
function jotShare(id) {
|
||||||
@ -247,7 +241,6 @@ function enableOnUser(){
|
|||||||
$('#like-rotator-' + id).spin(false);
|
$('#like-rotator-' + id).spin(false);
|
||||||
$(window).scrollTop(0);
|
$(window).scrollTop(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -292,9 +285,9 @@ function enableOnUser(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function itemFiler(id) {
|
function itemFiler(id) {
|
||||||
|
|
||||||
var bordercolor = $("input").css("border-color");
|
var bordercolor = $("input").css("border-color");
|
||||||
|
|
||||||
$.get('filer/', function(data){
|
$.get('filer/', function(data){
|
||||||
$.colorbox({html:data});
|
$.colorbox({html:data});
|
||||||
$("#id_term").keypress(function(){
|
$("#id_term").keypress(function(){
|
||||||
@ -303,7 +296,7 @@ function enableOnUser(){
|
|||||||
$("#select_term").change(function(){
|
$("#select_term").change(function(){
|
||||||
$("#id_term").css("border-color",bordercolor);
|
$("#id_term").css("border-color",bordercolor);
|
||||||
})
|
})
|
||||||
|
|
||||||
$("#filer_save").click(function(e){
|
$("#filer_save").click(function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
reply = $("#id_term").val();
|
reply = $("#id_term").val();
|
||||||
@ -352,8 +345,6 @@ function enableOnUser(){
|
|||||||
$('#profile-nolocation-wrapper').attr('disabled', true);
|
$('#profile-nolocation-wrapper').attr('disabled', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{$geotag}}
|
{{$geotag}}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -362,16 +353,15 @@ function enableOnUser(){
|
|||||||
$( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-delete-link,.block-delete-link", function(e) {
|
$( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-delete-link,.block-delete-link", function(e) {
|
||||||
var link = $(this).attr("href"); // "get" the intended link in a var
|
var link = $(this).attr("href"); // "get" the intended link in a var
|
||||||
|
|
||||||
if (typeof(eval($.fn.modal)) === 'function'){
|
if (typeof(eval($.fn.modal)) === 'function'){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
bootbox.confirm("<h4>{{$confirmdelete}}</h4>",function(result) {
|
bootbox.confirm("<h4>{{$confirmdelete}}</h4>",function(result) {
|
||||||
if (result) {
|
if (result) {
|
||||||
document.location.href = link;}
|
document.location.href = link;
|
||||||
});}
|
}
|
||||||
else {
|
});
|
||||||
return confirm("{{$confirmdelete}}");
|
} else {
|
||||||
}
|
return confirm("{{$confirmdelete}}");
|
||||||
});
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user