0x1949 Team - FAZEMRX - MANAGER
Edit File: minified_6d8f7bddf5c035f8275ad6dfea1c0df4.js
/* Any changes to this file will be overwritten. To change the content of this file, edit the source files from which it was compiled. */ function getClosest(el,divID) {if(typeof divID=='undefined'||divID==!1) return null;do{if(el.nodeName==='TEXTAREA'||el.nodeName==='INPUT'||el.id==='error_box') break;if(el.id===divID) {return el}} while(el=el.parentNode);return null} function getSelectedText(divID) {if(typeof divID=='undefined'||divID==!1) return!1;var text='',selection,found=0,container=document.createElement("div");if(window.getSelection) {selection=window.getSelection();text=selection.toString()} else if(document.selection&&document.selection.type!='Control') {selection=document.selection.createRange();text=selection.text} for(var i=0;i<selection.rangeCount;i++){s=getClosest(selection.getRangeAt(i).startContainer,divID);e=getClosest(selection.getRangeAt(i).endContainer,divID);if(s!==null&&e!==null) {found=1;container.appendChild(selection.getRangeAt(i).cloneContents());text=container.innerHTML;break}} return found===1?text:!1} function quotedTextClick(oOptions) {text='';$('#quoteSelected_'+oOptions.msgID).hide();$.ajax({url:smf_prepareScriptUrl(smf_scripturl)+'action=quotefast;quote='+oOptions.msgID+';xml;pb='+oEditorID+';mode='+(oEditorObject.bRichTextEnabled?1:0),type:'GET',headers:{"X-SMF-AJAX":1},xhrFields:{withCredentials:typeof allow_xhjr_credentials!=="undefined"?allow_xhjr_credentials:!1},dataType:'xml',beforeSend:function(){ajax_indicator(!0)},complete:function(jqXHR,textStatus){ajax_indicator(!1)},success:function(data,textStatus,xhr){oOptions.text=oOptions.text.replaceAll(/<img src=".*?" alt="(.*?)" title=".*?" class="smiley">/,'$1');text=$(data).find('quote').text();text=text.match(/^\[quote(.*)]/ig)+oOptions.text+'[/quote]'+'\n\n';var e=$('#'+oEditorID).get(0);var oEditor=sceditor.instance(e);text=oEditor.toBBCode(text);oEditor.insert(text);if(typeof oJumpAnchor!='undefined'){if(navigator.appName=='Microsoft Internet Explorer') window.location.hash=oJumpAnchor;else window.location.hash='#'+oJumpAnchor}},error:function(xhr,textStatus,errorThrown){}})} $(function(){$(document).on('mouseup','.inner, .list_posts',function(){var oSelected={divID:$(this).attr('id'),msgID:$(this).data('msgid'),};oSelected.text=getSelectedText(oSelected.divID);if(typeof oSelected.text=='undefined'||oSelected.text==!1) return!0;$('#quoteSelected_'+oSelected.msgID).show();$(document).off('click','#quoteSelected_'+oSelected.msgID+' a');$(document).one('click','#quoteSelected_'+oSelected.msgID+' a',function(e){e.preventDefault();quotedTextClick(oSelected)});$(document).on('click.ondeselecttext'+oSelected.msgID,function(){setTimeout(function(){selectedText=getSelectedText(oSelected.divID);if(typeof selectedText!='undefined'&&selectedText!=!1) return;$(document).off('click','#quoteSelected_'+oSelected.msgID+' a');$('#quoteSelected_'+oSelected.msgID).hide();$(document).off('click.ondeselecttext'+oSelected.msgID)},1)});return!0})});function smf_fileUpload(oOptions){var previewNode=document.querySelector('#au-template');previewNode.id='';var tmp=document.createElement('div');tmp.appendChild(previewNode.cloneNode(!0));previewTemplate=tmp.innerHTML;previewNode.parentNode.removeChild(previewNode);var isNewTemplate=!!document.getElementById('post_attachments_area');if(typeof current_board=='undefined') current_board=!1;var dOptions={url:smf_prepareScriptUrl(smf_scripturl)+'action=uploadAttach;sa=add;'+smf_session_var+'='+smf_session_id+(current_board?';board='+current_board:''),parallelUploads:1,filesizeBase:1024,paramName:'attachment',uploadMultiple:!0,previewsContainer:'#attachment_previews',previewTemplate:previewTemplate,acceptedFiles:'.doc,.gif,.jpg,.pdf,.png,.txt,.zip',thumbnailWidth:100,thumbnailHeight:null,autoQueue:isNewTemplate,clickable:isNewTemplate?['.attachment_spacer','#drop_zone_ui']:'.fileinput-button',currentUsedSize:0,timeout:null,smf_insertBBC:function(file,w,h){var mime_type=typeof file.type!=="undefined"?file.type:(typeof file.mime_type!=="undefined"?file.mime_type:''),bbcOptionalParams={width:mime_type.indexOf('image')==0&&+w>0?(' width='+w):'',height:mime_type.indexOf('image')==0&&+h>0?(' height='+h):'',};return '[attach id='+file.attachID+bbcOptionalParams.width+bbcOptionalParams.height+']'+(typeof file.name!=="undefined"?decodeURIComponent(file.name.replace(/\+/g,' ')):'')+'[/attach]'},createMaxSizeBar:function(){var currentSize=Math.round(myDropzone.options.currentUsedSize/1024),maxSize=myDropzone.options.maxTotalSize,usedPercentage=Math.round($.fn.percentToRange($.fn.rangeToPercent(currentSize,0,maxSize),0,100));if(isNewTemplate&&maxSize>1024){maxSize=Math.round(((maxSize/1024)+Number.EPSILON)*100)/100;currentSize=Math.round(((currentSize/1024)+Number.EPSILON)*10)/10} if(usedPercentage<=33) percentage_class='green';else if(usedPercentage>=34&&usedPercentage<=66) percentage_class='yellow';else percentage_class='red';$('#max_files_progress').removeClass().addClass('progress_bar progress_'+percentage_class).show();$('#max_files_progress_text').show();$('#max_files_progress .bar').width(usedPercentage+'%');$('#max_files_progress_text').text(myDropzone.options.text_max_size_progress.replace('{currentTotal}',maxSize).replace('{currentRemain}',currentSize));if(maxSize==0){$('#max_files_progress').hide();$('#max_files_progress_text').hide()}},accept:function(file,done){var currentlyUsedKB=myDropzone.options.currentUsedSize/1024,totalKB=myDropzone.options.maxTotalSize,fileKB=myDropzone.options.maxFilesize,uploadedFileKB=file.size/1024;if((myDropzone.options.maxFileAmount!=null)&&(myDropzone.getAcceptedFiles().length)>=myDropzone.options.maxFileAmount) {$('.attach_drop_zone_label').text(myDropzone.options.text_attachLimitNag);done(this.options.dictMaxFilesExceeded)} else $('.attach_drop_zone_label').text(myDropzone.options.text_attachDropzoneLabel);myDropzone.options.currentUsedSize=myDropzone.options.currentUsedSize+file.size;if(totalKB>0&¤tlyUsedKB>totalKB){done(myDropzone.options.text_totalMaxSize.replace('{currentTotal}',totalKB).replace('{currentRemain}',currentlyUsedKB));myDropzone.options.currentUsedSize=myDropzone.options.currentUsedSize-file.size;file.status=Dropzone.CANCELED} else if(fileKB>0&&uploadedFileKB>fileKB){done(myDropzone.options.dictFileTooBig);file.status=Dropzone.CANCELED;myDropzone.options.currentUsedSize=myDropzone.options.currentUsedSize-file.size} else{myDropzone.options.createMaxSizeBar();done()}},hideFileProgressAndAllButtonsIfNeeded:function(){if(myDropzone.getFilesWithStatus(Dropzone.ADDED).length==0){$('div#attachment_upload').find('#attach_cancel_all, #attach_upload_all').hide()} if(myDropzone.getAcceptedFiles().length==0){$('#max_files_progress').hide();$('#max_files_progress_text').hide()}},};if(oOptions.thumbnailHeight&&oOptions.thumbnailWidth){if(oOptions.thumbnailHeight>oOptions.thumbnailWidth){oOptions.thumbnailWidth=null} else{oOptions.thumbnailHeight=null}} $.extend(!0,dOptions,oOptions);var myDropzone=new Dropzone('div#attachment_upload',dOptions);if(isNewTemplate) {var dragTimer;$(document).on('dragover',function(e){var dt=e.originalEvent.dataTransfer;if(dt.types&&(dt.types.indexOf?dt.types.indexOf('Files')!=-1:dt.types.contains('Files'))){$("#attachment_upload").addClass('dz-drag-hover');window.clearTimeout(dragTimer)}});$(document).on('dragleave dragend',function(e){dragTimer=window.setTimeout(function(){$("#attachment_upload").removeClass('dz-drag-hover')},25)})} myDropzone.on('addedfile',function(file){_thisElement=$(file.previewElement);if(!file.type.match(/image.*/)){myDropzone.emit('thumbnail',file,smf_images_url+'/generic_attach.png')} else if(typeof file.isMock!=="undefined"&&typeof file.attachID!=="undefined"){myDropzone.emit('thumbnail',file,smf_prepareScriptUrl(smf_scripturl)+'action=dlattach;attach='+(file.thumbID>0?file.thumbID:file.attachID)+';type=preview')} file.name=file.name.php_to8bit().php_urlencode();_thisElement.find('.attach-ui').show();$('#max_files_progress').show();file.insertAttachment=function(_innerElement,response){if(!isNewTemplate){insertButton=$('<a />').addClass('button').addClass('insertBBC').prop('disabled',!1).text(myDropzone.options.text_insertBBC).on('click',function(e){e.preventDefault();w=_innerElement.find('input[name="attached_BBC_width"]').val();h=_innerElement.find('input[name="attached_BBC_height"]').val();var e=$('#'+oEditorID).get(0);var oEditor=sceditor.instance(e);oEditor.insert(myDropzone.options.smf_insertBBC(response,w,h),' ')}).appendTo(_innerElement.find('.attach-ui'))} else if(file.type.match(/image.*/)){let attached_BBC_width_height=_innerElement.find('.attached_BBC_width_height');insertPanelButton=$('<a />').addClass('main_icons').addClass('select_above').addClass('floatright').addClass('insertBBC').prop('disabled',!1).prop('title',myDropzone.options.text_insertBBC).on('click',function(e){attached_BBC_width_height.toggle()}).insertBefore(attached_BBC_width_height);insertButton=$('<a />').addClass('button').addClass('insertBBC').addClass('floatright').prop('disabled',!1).text(myDropzone.options.text_insertBBC).on('click',function(e){e.preventDefault();w=_innerElement.find('input[name="attached_BBC_width"]').val();h=_innerElement.find('input[name="attached_BBC_height"]').val();var e=$('#'+oEditorID).get(0);var oEditor=sceditor.instance(e);oEditor.insert(myDropzone.options.smf_insertBBC(response,w,h),'');attached_BBC_width_height.hide()}).appendTo(attached_BBC_width_height)} else{insertButton=$('<a />').addClass('main_icons').addClass('select_above').addClass('floatright').addClass('insertBBC').prop('disabled',!1).prop('title',myDropzone.options.text_insertBBC).on('click',function(e){e.preventDefault();var e=$('#'+oEditorID).get(0);var oEditor=sceditor.instance(e);oEditor.insert(myDropzone.options.smf_insertBBC(response,null,null),' ')}).appendTo(_innerElement.find('.attach-ui'))}};file.deleteAttachment=function(_innerElement,attachmentId,file){deleteButton=$('<a />').addClass(!isNewTemplate?'button':'main_icons delete floatright').prop('disabled',!1).prop('title',myDropzone.options.text_deleteAttach).text(!isNewTemplate?myDropzone.options.text_deleteAttach:'').one('click',function(e){$this=$(this);if(!confirm(smf_you_sure)){return} $.ajax({url:smf_prepareScriptUrl(smf_scripturl)+'action=uploadAttach;sa=delete;attach='+attachmentId+';'+smf_session_var+'='+smf_session_id+(current_board?';board='+current_board:''),type:'GET',headers:{"X-SMF-AJAX":1},xhrFields:{withCredentials:typeof allow_xhjr_credentials!=="undefined"?allow_xhjr_credentials:!1},dataType:'json',beforeSend:function(){ajax_indicator(!0)},complete:function(jqXHR,textStatus){ajax_indicator(!1);if(!isNewTemplate) $this.fadeOutAndRemove()},success:function(data,textStatus,xhr){if(!isNewTemplate){_innerElement.removeClass('infobox').addClass(data.type+'box');_innerElement.find('.attached_BBC').fadeOut();_innerElement.find('.attachment_info a.insertBBC').fadeOut()} if(file.accepted&&file.status!=Dropzone.ERROR){myDropzone.options.currentUsedSize=myDropzone.options.currentUsedSize-file.size;myDropzone.options.createMaxSizeBar();file.accepted=!1;$('.attach_remaining').html(Math.max(myDropzone.options.maxFileAmount-myDropzone.getAcceptedFiles().length,0));if(myDropzone.getAcceptedFiles().length>=myDropzone.options.maxFileAmount) {$('.attach_drop_zone_label').text(myDropzone.options.text_attachLimitNag)} else $('.attach_drop_zone_label').text(myDropzone.options.text_attachDropzoneLabel);myDropzone.options.hideFileProgressAndAllButtonsIfNeeded();if(isNewTemplate) _innerElement.remove()}},error:function(xhr,textStatus,errorThrown){_innerElement.find('span.error').append(textStatus.error.join('<br>')).css({'text-decoration':'none'});_innerElement.removeClass('infobox').addClass('errorbox')}});var attachBbcRegex=new RegExp('\\[attach[^\\]]+id='+attachmentId+'[^\\]]*\\][^\\[\\]]*\\[/attach\\]','g');var e=$('#'+oEditorID).get(0);var oEditor=sceditor.instance(e);var newEditorVal=oEditor.val().replace(attachBbcRegex,'');oEditor.val(newEditorVal)});if(!isNewTemplate) deleteButton.appendTo(_innerElement.find('.attach-ui'));else deleteButton.prependTo(_innerElement.find('.attach-ui'));if(myDropzone.getAcceptedFiles().length>=myDropzone.options.maxFileAmount) {$('.attach_drop_zone_label').text(myDropzone.options.text_attachLimitNag)} else $('.attach_drop_zone_label').text(myDropzone.options.text_attachDropzoneLabel);$('.attach_remaining').html(Math.max(myDropzone.options.maxFileAmount-myDropzone.getAcceptedFiles().length,0))};file.addToCurrentAttachmentsList=function(file,response){current_attachments.push({name:file.name,size:file.size,attachID:response.attachID,type:file.type,thumbID:(response.thumbID>0?response.thumbID:response.attachID)})} _thisElement.find('.upload').on('click',function(){myDropzone.enqueueFile(file)});_thisElement.addClass('descbox');if(myDropzone.getFilesWithStatus(Dropzone.ADDED).length==1){$('div#attachment_upload').find('#attach_cancel_all, #attach_upload_all').css('display','inline-block')}});myDropzone.on('removedfile',function(file){if(file.accepted&&file.status!=Dropzone.ERROR){myDropzone.options.currentUsedSize=myDropzone.options.currentUsedSize-file.size;myDropzone.options.createMaxSizeBar()} myDropzone.options.hideFileProgressAndAllButtonsIfNeeded()});myDropzone.on("canceled",function(file){myDropzone.options.currentUsedSize=myDropzone.options.currentUsedSize-file.size;myDropzone.options.createMaxSizeBar();this.removeFile(file)});myDropzone.on("maxfilesexceeded",function(file){myDropzone.options.currentUsedSize=myDropzone.options.currentUsedSize-file.size;myDropzone.options.createMaxSizeBar();this.removeFile(file)});myDropzone.on('totaluploadprogress',function(progress){$('#total_progress span').width(progress+'%')});myDropzone.on('error',function(file,errorMessage,xhr){_thisElement=$(file.previewElement);_thisElement.find('.upload').fadeOutAndRemove();_thisElement.addClass('errorbox').removeClass('descbox')});myDropzone.on('success',function(file,responseText,e){_thisElement=$(file.previewElement);_thisElement.find('.upload').fadeOutAndRemove();if(!responseText){return} if(responseText.generalErrors){_thisElement.find('span.error').append(responseText.generalErrors.join('<br>'));return} response=responseText.files[0];_thisElement.find('.attachment_info div.attached_BBC').fadeIn();_thisElement.find('.attachment_info a.insertBBC').fadeIn();if(typeof response.mime_type=="undefined"||response.mime_type.indexOf('image')!=0){_thisElement.find('.attachment_info .attached_BBC_width_height').hide()} if(typeof response.errors!=='undefined'&&response.errors.length>0){_thisElement.addClass('errorbox').removeClass('descbox');_thisElement.find('span.error').append(response.errors.join('<br>'));return} _thisElement.removeClass('descbox');if(!isNewTemplate) _thisElement.addClass('infobox');_thisElement.find('a.cancel').fadeOutAndRemove();file.deleteAttachment(_thisElement,response.attachID,file);w=_thisElement.find('input[name="attached_BBC_width"]').val();h=_thisElement.find('input[name="attached_BBC_height"]').val();_thisElement.find('input[name="attachBBC"]').val(myDropzone.options.smf_insertBBC(response,w,h));file.insertAttachment(_thisElement,response);file.addToCurrentAttachmentsList(file,response)});myDropzone.on('uploadprogress',function(file,progress,bytesSent){_thisElement=$(file.previewElement);_thisElement.find('.progress_bar .bar').width(progress+'%')});myDropzone.on('complete',function(file,progress,bytesSent){_thisElement=$(file.previewElement);_thisElement.find('.progress_bar').fadeOut();myDropzone.options.hideFileProgressAndAllButtonsIfNeeded();if(typeof file.isMock!=="undefined"&&typeof file.attachID!=="undefined"){_thisElement.find('.attachment_info div.attached_BBC').fadeIn();_thisElement.find('.attachment_info a.insertBBC').fadeIn();if(typeof file.type=="undefined"||file.type.indexOf('image')!=0){_thisElement.find('.attachment_info .attached_BBC_width_height').hide()} _thisElement.removeClass('descbox');if(!isNewTemplate) _thisElement.addClass('infobox');_thisElement.find('.upload').fadeOutAndRemove();_thisElement.find('a.cancel').remove();file.deleteAttachment(_thisElement,file.attachID,file);w=_thisElement.find('input[name="attached_BBC_width"]').val();h=_thisElement.find('input[name="attached_BBC_height"]').val();_thisElement.find('input[name="attachBBC"]').val(myDropzone.options.smf_insertBBC(file,w,h));file.insertAttachment(_thisElement,file);myDropzone.options.currentUsedSize=myDropzone.options.currentUsedSize+file.size;myDropzone.options.createMaxSizeBar()}});myDropzone.on('sending',function(file,xhr,formData){_thisElement=$(file.previewElement);_thisElement.find('.progress_bar').fadeIn();$("#total_progress").fadeIn()});myDropzone.on("totaluploadprogress",function(progress){$("#total_progress span").width(progress+'%')});myDropzone.on("queuecomplete",function(progress){$("#total_progress").fadeOut()});$('a#attach_cancel_all').on('click',function(){if(!confirm(smf_you_sure)) return;myDropzone.getAddedFiles().forEach(function(file){myDropzone.removeFile(file)});myDropzone.getFilesWithStatus(Dropzone.ERROR).forEach(function(file){myDropzone.removeFile(file)});myDropzone.options.createMaxSizeBar();myDropzone.options.hideFileProgressAndAllButtonsIfNeeded()});$('a#attach_upload_all').on('click',function(){if(!confirm(smf_you_sure)){return} myDropzone.enqueueFiles(myDropzone.getFilesWithStatus(Dropzone.ADDED));myDropzone.options.createMaxSizeBar();myDropzone.options.hideFileProgressAndAllButtonsIfNeeded()});$("input[name ='post']").on('click',function(e){attachAdded=myDropzone.getFilesWithStatus(Dropzone.ADDED).length;attachQueued=myDropzone.getFilesWithStatus(Dropzone.QUEUED).length;if(attachAdded>0||attachQueued>0){alert(myDropzone.options.text_attachLeft);e.preventDefault();e.stopPropagation();return!1}});$('#postAttachment').remove();$('#attachment_previews').css('display',!isNewTemplate?'block':'flex');$('.attach_available').remove();$('#drop_zone_ui').css('display',!isNewTemplate?'block':'flex');if(typeof current_attachments!=="undefined"){$.each(current_attachments,function(key,mock){mock.isMock=!0;mock.status=Dropzone.ADDED;mock.accepted=!0;myDropzone.emit("addedfile",mock);mock.status=Dropzone.SUCCESS;myDropzone.files.push(mock);myDropzone.emit("complete",mock)})}}