Current state
This commit is contained in:
365
public/legacy/js/custom.js
Normal file
365
public/legacy/js/custom.js
Normal file
@@ -0,0 +1,365 @@
|
||||
$(document).on("click", ".btnSubmitChat", function() {
|
||||
var msg = $(".chatInputBox").attr("value");
|
||||
$(".chatInputBox").attr("value", "");
|
||||
$.post("/chat_post", {'message' : msg}, function(data) {
|
||||
$("#sideBarChat").html(data);
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on("click", "#btn_UploadArtwork", function() {
|
||||
$("#btn_UploadArtwork").html('Uploading.... <i class="fa fa-spinner fa-spin"></i>');
|
||||
$("#btn_UploadArtwork").attr("class", "btn btn-warning");
|
||||
$("#btn_UploadArtwork").hide(1000);
|
||||
$("#uploadInfo").html('<div class="alert alert-info">Please wait <i class="fa fa-spinner fa-spin"></i> Uploading in progress ...</div>');
|
||||
$("#uploadArtworkForm").submit();
|
||||
});
|
||||
|
||||
$(document).on("change", "#section_filter", function() {
|
||||
var id = $("#section_filter option:selected").val();
|
||||
$("#mySectionList").html('<div align="center"><br><br><i class="fa fa-spinner fa-spin fa-4x"></i></div>');
|
||||
$("#mySectionList").load("/uploads.php?ajax=true&action=updateCats&id=" + id);
|
||||
});
|
||||
|
||||
$(document).on("change", ".quickThumbShow", function(evt) {
|
||||
|
||||
var preview = $(this).data("preview_id");
|
||||
var files = evt.target.files;
|
||||
var f = files[0];
|
||||
var reader = new FileReader();
|
||||
|
||||
reader.onload = (function(theFile) {
|
||||
return function(e) {
|
||||
fname = (theFile.name);
|
||||
if (!fname.match(/\.(gif|jpg|jpeg|tiff|png)$/i)) {
|
||||
$("#" + preview).html("Selected file: <b>" + theFile.name + "</b></h1>");
|
||||
$("#preview_box").show();
|
||||
console.log("no image - ", preview, theFile.name);
|
||||
} else {
|
||||
document.getElementById(preview).innerHTML = ['<img src="', e.target.result,'" title="', theFile.name, '" style="max-height:300px;max-width:300px;" class="img-responsive">'].join('');
|
||||
}
|
||||
};
|
||||
})(f);
|
||||
|
||||
reader.readAsDataURL(f);
|
||||
});
|
||||
|
||||
var numCols = 4;
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
var $container1 = $('.container_photo');
|
||||
$(".scrollContent").mCustomScrollbar();
|
||||
|
||||
var size = function () {
|
||||
|
||||
var w = $container1.width();
|
||||
var c = Math.floor(w / 260);
|
||||
var wc = parseInt($container1.width() / c);
|
||||
numCols = c;
|
||||
|
||||
console.log(w, c, wc);
|
||||
|
||||
if (c == 1) {
|
||||
$(".photo_frame").css("width", "99%");
|
||||
} else if (c == 2) {
|
||||
$(".photo_frame").css("width", "48%");
|
||||
} else if (c == 3) {
|
||||
$(".photo_frame").css("width", "28%");
|
||||
} else if (c == 4) {
|
||||
$(".photo_frame").css("width", "22%");
|
||||
} else {
|
||||
$(".photo_frame").css("width", "250px");
|
||||
}
|
||||
|
||||
$container1.isotope({
|
||||
masonry: { columnWidth: wc }
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
$container1.imagesLoaded( function() {
|
||||
$container1.isotope({
|
||||
itemSelector : '.photo_frame',
|
||||
layoutMode : 'masonry'
|
||||
});
|
||||
size();
|
||||
});
|
||||
|
||||
$(window).smartresize(size);
|
||||
|
||||
$(".summernote").summernote();
|
||||
$(".summernote_lite").summernote({
|
||||
toolbar: [
|
||||
['style', ['bold', 'italic', 'underline', 'clear']],
|
||||
['font', ['strikethrough']],
|
||||
['fontsize', ['fontsize']],
|
||||
['color', ['color']],
|
||||
]
|
||||
});
|
||||
|
||||
var $container = $('.container_gallery');
|
||||
$container.imagesLoaded( function(){
|
||||
$container.isotope({
|
||||
itemSelector : '.photo_frame',
|
||||
layoutMode : 'masonry'
|
||||
});
|
||||
size();
|
||||
});
|
||||
|
||||
var $container = $('.container_news');
|
||||
$container.imagesLoaded( function(){
|
||||
$container.isotope({
|
||||
itemSelector : '.news_frame',
|
||||
layoutMode : 'masonry'
|
||||
});
|
||||
});
|
||||
|
||||
if ($("a[rel^='prettyPhoto']").length > 0) {
|
||||
$("a[rel^='prettyPhoto']").prettyPhoto({theme:'dark_rounded'});
|
||||
}
|
||||
|
||||
$("#sideBarSep").click(function() {
|
||||
|
||||
|
||||
|
||||
if(sbc == 0) {
|
||||
|
||||
$("#sideBarChat").animate({
|
||||
height: '700px'
|
||||
}, 1000, function(){
|
||||
// Complete
|
||||
sbc = 1;
|
||||
$("#sideBarSep").addClass("chat_opened");
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
$("#sideBarChat").animate({
|
||||
height: '550px'
|
||||
}, 1000, function(){
|
||||
// Complete
|
||||
sbc = 0;
|
||||
$("#sideBarSep").removeClass("chat_opened");
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
if ($(".followingButton").length > 0) {
|
||||
$(".followingButton").click(function() {
|
||||
$("#showNoticeBox").load("/include/hideNoticeBox.php?show=following");
|
||||
});
|
||||
}
|
||||
|
||||
if ($(".streamPost").length > 0) {
|
||||
var remme = false;
|
||||
$(".stream_Remove").click(function() {
|
||||
var wid = $(this).attr("rel");
|
||||
if (confirm("Remove this notice?")) {
|
||||
$("#"+wid).hide();
|
||||
$("#showNoticeBox").load("/include/hideNoticeBox.php?id="+wid);
|
||||
remme = true;
|
||||
}
|
||||
});
|
||||
|
||||
$(".streamPost").click(function() {
|
||||
$("BODY").scrollTop(0);
|
||||
var wid = $(this).attr("rel");
|
||||
var id = $(this).attr("id");
|
||||
if (remme == false) {
|
||||
$(".streamContent").removeClass("StreamSelected");
|
||||
$("#"+id+" > .streamContent").addClass("StreamSelected");
|
||||
$("#showNoticeBox").load("/include/loadNoticeBox.php?id="+wid);
|
||||
}
|
||||
remme = false;
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ($("#js-news").length >0) {
|
||||
$('#js-news').ticker();
|
||||
}
|
||||
|
||||
if ($("#imageTicker").length >0) {
|
||||
$("#imageTicker").slideDown().newsticker();
|
||||
}
|
||||
|
||||
if ($(".changeCoverArt").length > 0) {
|
||||
$(".changeCoverArt").click(function() {
|
||||
$("#mywindow").center();
|
||||
$("#mywindow").show();
|
||||
});
|
||||
}
|
||||
|
||||
//$(".openwin").fancybox({});
|
||||
|
||||
$('#ajaxForm').submit(function() {
|
||||
alert('Handler for .submit() called.');
|
||||
return false;
|
||||
});
|
||||
//$('.nav_left').stickySidebar({speed: 400, padding: 70, constrain: true})
|
||||
|
||||
$("#next_page").click(function() {
|
||||
//http://www.skinbase.org/Skins/WindowBlinds/125?page=2&order=2&sorted=dates&display=1
|
||||
//alert(data);
|
||||
var data = ($(".next").attr("href"));
|
||||
data.replace("?","&");
|
||||
$("#artBox").load("/pages/loadArtWork.php?url="+data);
|
||||
});
|
||||
/*
|
||||
$(".category_btn").fancybox({
|
||||
'href' : '/include/skinCategories.php',
|
||||
'width' : 600,
|
||||
'height' : 200,
|
||||
'transitionIn' : 'fade'
|
||||
});
|
||||
|
||||
$(".category_btn2").fancybox({
|
||||
'href' : '/include/skinCategories.php',
|
||||
'width' : 600,
|
||||
'height' : 200,
|
||||
'transitionIn' : 'fade'
|
||||
});
|
||||
*/
|
||||
|
||||
if ($("#boks").length > 0) {
|
||||
InitChat();
|
||||
}
|
||||
|
||||
$("#loginMenu span").click(function() {
|
||||
$("#subLoginMenu").toggle();
|
||||
});
|
||||
|
||||
if ($("#browseMenu").length > 0){
|
||||
$("#browseMenu").click(function(){
|
||||
//showCategories();
|
||||
$("#browserMenuList").toggle();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
if ($("#butCategories").length > 0){
|
||||
$("#butCategories").click(function(){
|
||||
var catID = $("#butCategories").attr("rootid");
|
||||
showCategories(catID);
|
||||
});
|
||||
}
|
||||
|
||||
$("#messageLink").click(function(){
|
||||
$("#streamType").val("message");
|
||||
$("#update_button").html("Publish");
|
||||
$("#streamMessage").val("");
|
||||
});
|
||||
|
||||
$("#pageLink").click(function(){
|
||||
$("#streamType").val("link");
|
||||
$("#update_button").html("Attach link");
|
||||
$("#streamMessage").val("http://");
|
||||
});
|
||||
|
||||
$("#publishButton").click(function(){
|
||||
//event.preventDefault();
|
||||
var type = $("#streamType").val();
|
||||
var data = encodeURI($("#streamMessage").val());
|
||||
//alert("/social/getStreamData.php?type="+type+"&data="+data);
|
||||
$("#streamWork").load("/social/getStreamData.php?type="+type+"&data="+data);
|
||||
$("#streamMessage").val("");
|
||||
|
||||
});
|
||||
|
||||
$("#shareBox textarea").elastic();
|
||||
|
||||
/*if($("#total_msgs").length > 0) {
|
||||
showDownloadCounter();
|
||||
}*/
|
||||
|
||||
$(".addFavourites").click(function() {
|
||||
var id = $(this).attr("rel");
|
||||
$(".af-"+id).load("/include/add2favourites.php?id="+id);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$('textarea.tinymce').tinymce({
|
||||
// Location of TinyMCE script
|
||||
script_url : '/js/tiny_mce/tiny_mce.js',
|
||||
|
||||
// General options
|
||||
theme : "advanced",
|
||||
plugins : "smileys,sdcode,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,youtube",
|
||||
|
||||
// Theme options
|
||||
theme_advanced_buttons1 : "smileys,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,fontselect,fontsizeselect,removeformat,sub,sup,emotions,image,media,youtube",
|
||||
theme_advanced_buttons2 : "pastetext,pasteword,|,bullist,numlist,|,outdent,indent,blockquote,|,link,unlink,anchor,cleanup,forecolor,backcolor",
|
||||
theme_advanced_buttons3 : "",
|
||||
theme_advanced_toolbar_location : "top",
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_statusbar_location : "",
|
||||
theme_advanced_resizing : true,
|
||||
|
||||
valid_elements: "@[style],img[src|class|alt],a[href|target=_blank],-span,-strong,-em,-strike,u,#p,br,-ol,-ul,-li,-sub,-sup,-pre,-address,-h1,-h2,-h3,-h4,-h5,-h6",
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}); // Document ready
|
||||
|
||||
|
||||
|
||||
|
||||
/***********************************************/
|
||||
/** **/
|
||||
/** PRIVATE MESSAGES **/
|
||||
/** **/
|
||||
/** **/
|
||||
/***********************************************/
|
||||
var m_html = '';
|
||||
|
||||
function updatePrivMsgBox() {
|
||||
$.get("include/updatePrivMsgBox.php");
|
||||
$("#msgBox").hide();
|
||||
$("#msgBoxTxt").hide();
|
||||
$("#msgBoxX").hide();
|
||||
}
|
||||
|
||||
function ShowPrivateMessage(id) {
|
||||
$("#msgShow").html(m_html);
|
||||
//$("#news-"+id).css('font-weight','bold');
|
||||
$("#msgShow").load("/privmsg.php?ajax=true&action=ShowMsg&id="+id);
|
||||
}
|
||||
|
||||
function ShowPrivateMessageList(box, id) {
|
||||
|
||||
if (box !== 'new') {
|
||||
$("#msgList").html(m_html);
|
||||
$("#msgShow").html('');
|
||||
}
|
||||
|
||||
if (box == 'new') {
|
||||
//alert ("/privmsg.php?ajax=true&action=msgList&box="+box+"&id=" + id);
|
||||
$("#msgShow").load("/privmsg.php?ajax=true&action=msgList&box="+box+"&id=" + id);
|
||||
} else {
|
||||
$("#msgList").load("/privmsg.php?ajax=true&action=msgList&box="+box+"&id=" + id);
|
||||
}
|
||||
}
|
||||
|
||||
function SaveMessage(id) {
|
||||
$("#msgList").html(m_html);
|
||||
$("#msgShow").html('');
|
||||
$("#msgList").load("/privmsg.php?ajax=true&action=SaveMsg&id=" + id);
|
||||
}
|
||||
|
||||
function DeleteMessage(id,box) {
|
||||
|
||||
$("#msgList").html(m_html);
|
||||
$("#msgShow").html('');
|
||||
$("#msgList").load("/privmsg.php?ajax=true&action=DelMsg&box="+box+"&id="+id);
|
||||
}
|
||||
Reference in New Issue
Block a user