RuntimeException Object
(
    [message:protected] => COULD_NOT_CREATE_FOLDER
    [string:Exception:private] => 
    [code:protected] => 0
    [file:protected] => /home/active/general/soompi/fr/system/File/FileSystem.php
    [line:protected] => 461
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [file] => /home/active/general/soompi/fr/system/File/FileSystem.php
                    [line] => 339
                    [function] => getFolder
                    [class] => IPS\File\_FileSystem
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [1] => Array
                (
                    [file] => /home/active/general/soompi/fr/system/File/File.php
                    [line] => 214
                    [function] => save
                    [class] => IPS\File\_FileSystem
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [2] => Array
                (
                    [file] => /home/active/general/soompi/fr/system/Output/Javascript/Javascript.php
                    [line] => 904
                    [function] => create
                    [class] => IPS\_File
                    [type] => ::
                    [args] => Array
                        (
                            [0] => core_Theme
                            [1] => root_front.js
                            [2] => /**
 * IPS Social Suite 4
 * (c) 2013 Invision Power Services - http://www.invisionpower.com
 * This file contains minified javascript and is not directly editable
 */

;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.app',{initialize:function(){this.on('click','a[data-confirm]',this.confirmSomething);this.setup();},setup:function(){this.scope.addClass('ipsJS_has').removeClass('ipsJS_none');if(!ips.utils.events.isTouchDevice()){this.scope.addClass('ipsApp_noTouch');}
if(typeof jstz!=='undefined'){ips.utils.cookie.set('ipsTimezone',jstz.determine().name());}
if($('#elInlineMessage').length){var dialogRef=ips.ui.dialog.create({showFrom:'#inbox',content:'#elInlineMessage',title:$('#elInlineMessage').attr('title')});setTimeout(function(){dialogRef.show();},800);}
if(ips.getSetting('links_external')){this.scope.find('a[rel*="external"]').each(function(index,elem){elem.target="_blank";})}
prettyPrint();},confirmSomething:function(e){e.preventDefault();var elem=$(e.currentTarget);var customMessage=$(e.currentTarget).attr('data-confirmMessage');var subMessage=$(e.currentTarget).attr('data-confirmSubMessage');ips.ui.alert.show({type:'confirm',icon:'warn',message:(customMessage)?customMessage:ips.getString('generic_confirm'),subText:(subMessage)?subMessage:'',callbacks:{ok:function(){window.location=elem.attr('href');}}});},});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.autoSizeIframe',{initialize:function(){this.on('load',this.resizeFrame);},resizeFrame:function(e){setTimeout(function(){e.target.style.height=e.target.contentWindow.document.body.scrollHeight+'px';e.target.style.overflow='hidden';e.target.scrolling="no";e.target.seamless="seamless";},1500);}});}(jQuery,_));;
;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.comment',{_quoteData:null,_commentContents:'',initialize:function(){this.on('click','[data-action="editComment"]',this.editComment);this.on('click','[data-action="cancelEditComment"]',this.cancelEditComment);this.on('click','[data-action="deleteComment"]',this.deleteComment);this.on('click','[data-action="approveComment"]',this.approveComment);this.on('click','[data-action="quoteComment"]',this.quoteComment);this.on('click','[data-action="multiQuoteComment"]',this.multiQuoteComment);this.on('click','[data-action="rateReview"]',this.rateReview);this.on('click','button[type="submit"]',this.submitEdit);this.on('change','input[type="checkbox"][data-role="moderation"]',this.commentCheckbox);this.on('setMultiQuoteEnabled.comment setMultiQuoteDisabled.comment',this.setMultiQuote);this.on('disableQuoting.comment',this.disableQuoting);this.on(document,'getEditFormLoading.comment saveEditCommentLoading.comment '+'deleteCommentLoading.comment',this.commentLoading);this.on(document,'getEditFormDone.comment saveEditCommentDone.comment '+'deleteCommentDone.comment',this.commentDone);this.on(document,'getEditFormDone.comment',this.getEditFormDone);this.on(document,'getEditFormError.comment',this.getEditFormDone);this.on(document,'saveEditCommentDone.comment',this.saveEditCommentDone);this.on(document,'saveEditCommentError.comment',this.saveEditCommentError);this.on(document,'deleteCommentDone.comment',this.deleteCommentDone);this.on(document,'deleteCommentError.comment',this.deleteCommentError);this.on(document,'approveCommentLoading.comment',this.approveCommentLoading);this.on(document,'approveCommentDone.comment',this.approveCommentDone);this.on(document,'approveCommentError.comment',this.approveCommentError);this.setup();},setup:function(){this._commentID=this.scope.attr('data-commentID');var id=this._commentID;},destroy:function(){},commentCheckbox:function(e){var checked=$(e.currentTarget).is(':checked');this.scope.closest('.ipsComment').toggleClass('ipsComment_selected',checked);this.trigger('checkedComment.comment',{commentID:this._commentID,actions:$(e.currentTarget).attr('data-actions'),checked:checked});},disableQuoting:function(){this.scope.find('[data-ipsQuote-editor]').remove();},rateReview:function(e){e.preventDefault();var scope=this.scope
ips.getAjax()($(e.currentTarget).attr('href')).done(function(response){scope.parent().replaceWith($(response));}).fail(function(err){window.location=$(e.currentTarget).attr('href');});},setMultiQuote:function(e,data){var selector='[data-commentApp="'+data.contentapp+'"]';selector+='[data-commentType="'+data.contenttype+'"]';selector+='[data-commentID="'+data.contentcommentid+'"]';if(this.scope.is(selector)){if(!_.isNull(e)&&e.type=='setMultiQuoteEnabled'){this.scope.find('[data-action="multiQuoteComment"]').removeClass('ipsButton_simple').addClass('ipsButton_alternate').attr('data-mqActive',true).html(ips.templates.render('core.posts.multiQuoteOn'));}else if(_.isNull(e)||e.type=='setMultiQuoteDisabled'){this.scope.find('[data-action="multiQuoteComment"]').addClass('ipsButton_simple').removeClass('ipsButton_alternate').removeAttr('data-mqActive').html(ips.templates.render('core.posts.multiQuoteOff'));}}},quoteComment:function(e){e.preventDefault();if(!this._getQuoteData()){Debug.error("Couldn't get quote data");return;}
var html=this._prepareQuote($('
').html(this.scope.find('[data-role="commentContent"]').html()));Debug.log(this._commentID);this.trigger('quoteComment.comment',{userid:this._quoteData.userid,username:this._quoteData.username,timestamp:this._quoteData.timestamp,contentapp:this._quoteData.contentapp,contenttype:this._quoteData.contenttype,contentclass:this._quoteData.contentclass,contentid:this._quoteData.contentid,contentcommentid:this._quoteData.contentcommentid,quoteHtml:html.html()});},multiQuoteComment:function(e){e.preventDefault();if(!this._getQuoteData()){Debug.error("Couldn't get quote data");return;} var button=$(e.currentTarget);var mqActive=button.attr('data-mqActive');var html=this._prepareQuote($('
').html(this.scope.find('[data-role="commentContent"]').html()));this.trigger((mqActive)?'removeMultiQuote.comment':'addMultiQuote.comment',{userid:this._quoteData.userid,username:this._quoteData.username,timestamp:this._quoteData.timestamp,contentapp:this._quoteData.contentapp,contenttype:this._quoteData.contenttype,contentclass:this._quoteData.contentclass,contentid:this._quoteData.contentid,contentcommentid:this._quoteData.contentcommentid,quoteHtml:html.html(),button:button.attr('data-mqId')});if(mqActive){button.removeClass('ipsButton_alternate').addClass('ipsButton_simple').removeAttr('data-mqActive').html(ips.templates.render('core.posts.multiQuoteOff'));}else{button.removeClass('ipsButton_simple').addClass('ipsButton_alternate').attr('data-mqActive',true).html(ips.templates.render('core.posts.multiQuoteOn'));}},editComment:function(e){e.preventDefault();this._commentContents=this.scope.find('[data-role="commentContent"]').html();var url=$(e.currentTarget).attr('href');this.trigger('getEditForm.comment',{url:url,commentID:this._commentID});},cancelEditComment:function(e){e.preventDefault();var self=this;ips.ui.alert.show({type:'confirm',icon:'warn',message:ips.getString('generic_confirm'),subText:'',callbacks:{ok:function(){self.scope.find('[data-role="commentContent"]').html(self._commentContents);self.scope.find('[data-role="commentControls"], [data-action="expandTruncate"]').show();}}});},submitEdit:function(e){e.preventDefault();var instance;var empty=false;for(instance in CKEDITOR.instances){CKEDITOR.instances[instance].updateElement();} var postBody=$.trim(CKEDITOR.instances['comment_value'].editable().getData().replace(/ /g,''));if(postBody==''||postBody.match(/^

(

|<\/p>|\s)*<\/p>$/)){ips.ui.alert.show({type:'alert',icon:'warn',message:ips.getString('cantEmptyEdit'),subText:ips.getString('cantEmptyEditDesc')});return;} var form=this.scope.find('form');var url=form.attr('action');var data=form.serialize();this.trigger('saveEditComment.comment',{form:data,url:url,commentID:this._commentID});},commentLoading:function(e,data){if(data.commentID!=this._commentID){return;} ips.utils.anim.go('fadeIn',this.scope.find('[data-role="commentLoading"]').removeClass('ipsHide'));},commentDone:function(e,data){if(data.commentID!=this._commentID){return;} this.scope.find('[data-role="commentLoading"]').addClass('ipsHide');},getEditFormDone:function(e,data){if(data.commentID!=this._commentID){return;} this.scope.find('[data-action="expandTruncate"], [data-role="commentControls"]').hide();this.scope.find('[data-role="commentContent"]').html(data.response);$(document).trigger('contentChange',[this.scope.find('[data-role="commentContent"]')]);},getEditFormError:function(e,data){if(data.commentID!=this._commentID){return;} window.location=data.url;},saveEditCommentDone:function(e,data){if(data.commentID!=this._commentID){return;} this.scope.find('[data-role="commentContent"]').replaceWith($('

'+data.response+'
').find('[data-role="commentContent"]'));this.scope.trigger('initializeImages');this.scope.find('[data-action="expandTruncate"], [data-role="commentControls"]').show();$(document).trigger('contentChange',[this.scope]);},saveEditCommentError:function(e,data){Debug.log('save comment error');if(data.commentID!=this._commentID){return;} ips.ui.alert.show({type:'alert',icon:'warn',message:ips.getString('editCommentError'),});},approveComment:function(e){e.preventDefault();var url=$(e.currentTarget).attr('href');this.trigger('approveComment.comment',{url:url,commentID:this._commentID});},approveCommentLoading:function(e,data){if(data.commentID!=this._commentID){return;} this.scope.find('[data-role="commentControls"]').addClass('ipsFaded').find('[data-action="approveComment"]').addClass('ipsButton_disabled').text(ips.getString('commentApproving'));},approveCommentDone:function(e,data){if(data.commentID!=this._commentID){return;} var commentHtml=$('
'+data.response+'
').find('[data-controller="core.front.core.comment"]').html();this.scope.html(commentHtml).removeClass('ipsModerated').closest('.ipsComment').removeClass('ipsModerated');$(document).trigger('contentChange',[this.scope]);if(ips.utils.db.isEnabled()){this.scope.find('[data-action="multiQuoteComment"]').removeClass('ipsHide');} ips.ui.flashMsg.show(ips.getString('commentApproved'));},approveCommentError:function(e,data){if(data.commentID!=this._commentID){return;} window.location=data.url;},deleteComment:function(e){e.preventDefault();var self=this;var url=$(e.currentTarget).attr('href');var commentData=this._getQuoteData();var eventData=_.extend(commentData,{url:url,commentID:this._commentID});ips.ui.alert.show({type:'confirm',icon:'warn',message:ips.getString('delete_confirm'),callbacks:{ok:function(){self.trigger('deleteComment.comment',eventData);}}});},deleteCommentDone:function(e,data){if(data.commentID!=this._commentID){return;} var deleteLink=this.scope.find('[data-action="deleteComment"]');var toHide=null;var toShow=null;if(deleteLink.attr('data-hideOnDelete')){toHide=this.scope.find(deleteLink.attr('data-hideOnDelete'));}else{toHide=this.scope.closest('article');} toHide.animationComplete(function(){toHide.remove();});ips.utils.anim.go('fadeOutDown',toHide);if(deleteLink.attr('data-updateOnDelete')){$(deleteLink.attr('data-updateOnDelete')).text(parseInt($(deleteLink.attr('data-updateOnDelete')).text())-1);} if(deleteLink.attr('data-showOnDelete')){toShow=this.scope.find(deleteLink.attr('data-showOnDelete'));ips.utils.anim.go('fadeIn',toShow);} this.trigger('deletedComment.comment',{commentID:this._commentID,response:data.response});},deleteCommentError:function(e,data){if(data.commentID!=this._commentID){return;} window.location=data.url;},_prepareQuote:function(html){if(ips.getSetting('strip_quotes')==1){if(html.find('blockquote.ipsQuote')&&html.find('blockquote.ipsQuote').parent()&&html.find('blockquote.ipsQuote').parent().get(0)&&html.find('blockquote.ipsQuote').parent().get(0).tagName=='DIV'&&html.find('blockquote.ipsQuote').siblings().length==0) {var div=html.find('blockquote.ipsQuote').closest('div');div.next('p').find("br:first-child").remove();div.remove();} else {html.find('blockquote.ipsQuote').remove();}} html.find('blockquote.ipsQuote *').show();html.find('.ipsStyle_spoilerFancy,.ipsStyle_spoiler').replaceWith(ips.templates.render('core.posts.quotedSpoiler'));html.find("[data-excludequote]").remove();html.find('.ipsQuote_citation').remove();html.find('[data-quote-value]').each(function(){$(this).replaceWith('

'+$(this).attr('data-quote-value')+'

');});return html;},_getQuoteData:function(){if(!this._quoteData){try{this._quoteData=$.parseJSON(this.scope.attr('data-quoteData'));return this._quoteData;}catch(err){alert(this.scope.attr('data-quoteData'));Debug.log("Couldn't parse quote data");return{};}} return this._quoteData;}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.commentFeed',{_overlay:null,_commentFeedID:0,_newRepliesFlash:null,_maximumMultiQuote:50,_pageParam:'page',_urlParams:{},_baseURL:'',_doneInitialState:false,_initialURL:'',_pollingEnabled:true,_pollingActive:false,_pollingPaused:false,_initialPoll:60000,_currentPoll:60000,_decay:20000,_maxInterval:300000,_pollingTimeout:null,_pollAjax:null,_pollOnUnpaused:false,initialize:function(){this.on('submit','[data-role="replyArea"]',this.quickReply);this.on('quoteComment.comment',this.quoteComment);this.on('addMultiQuote.comment',this.addMultiQuote);this.on('removeMultiQuote.comment deleteComment.comment',this.removeMultiQuote);this.on('click','[data-action="filterClick"]',this.filterClick);this.on('menuItemSelected','[data-action="ignoreOptions"]',this.commentIgnore);this.on('menuItemSelected','[data-role="signatureOptions"]',this.signatureOptions);this.on('editorCompatibility',this.editorCompatibility);this.on('checkedComment.comment',this.checkedComment);$(document).on('click','[data-role="multiQuote"]',_.bind(this.doMultiQuote,this));$(document).on('click','[data-action="clearQuoted"]',_.bind(this.clearMultiQuote,this));$(document).on('moderationSubmitted',this.clearLocalStorage);this.on('paginationClicked paginationJump',this.paginationClick);this.on(document,'addToCommentFeed',this.addToCommentFeed);this.on('deletedComment.comment',this.deletedComment);this.on(document,'click','[data-action="loadNewPosts"]',this.loadNewPosts);this.on(window,'statechange',this.stateChange);this.setup();},setup:function(){var self=this;var replyForm=this.scope.find('[data-role="replyArea"] form');this._commentFeedID=this.scope.attr('data-feedID');this._urlParams=this._getUrlParams();this._baseURL=this.scope.attr('data-baseURL');this._initialURL=window.location.href;if(this._baseURL.match(/\?/)){if(this._baseURL.slice(-1)!='?'){this._baseURL+='&';}}else{this._baseURL+='?';} if(replyForm.attr('data-noAjax')){this._pollingEnabled=false;} if(!_.isUndefined(this.scope.attr('data-lastPage'))&&this._pollingEnabled){this._startPolling();} $(document).ready(function(){self._setUpMultiQuote();self._findCheckedComments();});},clearLocalStorage:function(){ips.utils.db.remove('moderation',$(document).find("[data-feedID]").attr('data-feedID'));},destroy:function(){this._stopPolling();},_getUrlParams:function(){var sort=this._getSortValue();var obj={sortby:sort.by||'',sortdirection:sort.order||'',};obj[this._pageParam]=ips.utils.url.getParam(this._pageParam)||1 return obj;},_getSortValue:function(){return{by:'',order:''};},stateChange:function(){var state=History.getState();if((_.isUndefined(state.data.controller)||state.data.controller!=this.controllerID||state.data.feedID!=this._commentFeedID)){return;} this._urlParams=state.data;if(this._initialURL==state.url){this._getResults(state.url);}else{this._getResults();}},_getResults:function(url){var self=this;var fetchURL=url||this._baseURL+this._getURL();this._setLoading(true);ips.getAjax()(fetchURL,{showLoading:true}).done(_.bind(this._getResultsDone,this)).fail(_.bind(this._getResultsFail,this)).always(_.bind(this._getResultsAlways,this));},_getResultsDone:function(response){var tmpElement=$('
'+response+'
').find('[data-feedID="'+this.scope.attr('data-feedID')+'"]');var newContents=tmpElement.html();tmpElement.remove();this.cleanContents();this.scope.hide().html(newContents);ips.utils.anim.go('fadeIn',this.scope);this._overlay.hide();this._setUpMultiQuote();$(document).trigger('contentChange',[this.scope]);this._findCheckedComments();},_getResultsFail:function(jqXHR,textStatus,errorThrown){if(Debug.isEnabled()){Debug.error("Ajax request failed ("+textStatus+"): "+errorThrown);Debug.error(jqXHR.responseText);}else{window.location=this._baseURL+this._getURL();}},_getResultsAlways:function(){},_setLoading:function(status){var scope=this.scope;var self=this;var commentFeed=this.scope.find('[data-role="commentFeed"]');if(status){if(!this._overlay){this._overlay=$('
').addClass('ipsLoading').hide();ips.getContainer().append(this._overlay);} var dims=ips.utils.position.getElemDims(commentFeed);var position=ips.utils.position.getElemPosition(commentFeed);this._overlay.show().css({left:position.viewportOffset.left+'px',top:position.viewportOffset.top+'px',width:dims.width+'px',height:dims.height+'px',position:'absolute',zIndex:ips.ui.zIndex()});commentFeed.animate({opacity:0.5});var elemPosition=ips.utils.position.getElemPosition(this.scope);$('html, body').animate({scrollTop:elemPosition.absPos.top+'px'});}else{}},paginationClick:function(e,data){data.originalEvent.preventDefault();if(data.pageNo!=this._urlParams[this._pageParam]){var urlObj=ips.utils.url.getURIObject(data.href);var queryKey=urlObj.queryKey;if(data.lastPage&&!this._pollingActive){this.scope.attr('data-lastPage',true);this._currentPoll=this._initialPoll;this._startPolling();}else if(!data.lastPage){this.scope.removeAttr('data-lastPage');this._stopPolling();} this._updateURL(queryKey);}},_updateURL:function(newParams){_.extend(this._urlParams,newParams);var tmpStateData=_.extend(_.clone(this._urlParams),{controller:this.controllerID,feedID:this._commentFeedID});History.pushState(tmpStateData,document.title,this._baseURL+this._getURL());},_getURL:function(){var tmpUrlParams={};for(var i in this._urlParams){if(this._urlParams[i]!=''&&i!='controller'&&i!='feedID'&&i!='bypassState'){tmpUrlParams[i]=this._urlParams[i];}} return $.param(tmpUrlParams);},editorCompatibility:function(e,data){if(!data.compatible){this.triggerOn('core.front.core.comment','disableQuoting.comment');}},checkedComment:function(e,data){var dataStore=ips.utils.db.get('moderation',this._commentFeedID)||{};if(data.checked){if(_.isUndefined(dataStore[data.commentID])){dataStore[data.commentID]=data.actions;}}else{delete dataStore[data.commentID];} if(_.size(dataStore)){ips.utils.db.set('moderation',this._commentFeedID,dataStore);}else{ips.utils.db.remove('moderation',this._commentFeedID);}},_findCheckedComments:function(){if(!this.scope.find('input[type="checkbox"]').length){return;} var dataStore=ips.utils.db.get('moderation',this._commentFeedID)||{};var self=this;var pageAction=this.scope.find('[data-ipsPageAction]');if(_.size(dataStore)){_.each(dataStore,function(val,key){if(self.scope.find('[data-commentID="'+key+'"]').length){self.scope.find('[data-commentID="'+key+'"] input[type="checkbox"][data-role="moderation"]').attr('checked',true).trigger('change');}else{pageAction.trigger('addManualItem.pageAction',{id:'multimod['+key+']',actions:val});}});}},signatureOptions:function(e,data){data.originalEvent.preventDefault();if(data.selectedItemID=='oneSignature'){this._ignoreSingleSignature($(e.currentTarget).attr('data-memberID'));}else{this._ignoreAllSignatures();}},_ignoreAllSignatures:function(){var self=this;var url=ips.getSetting('baseURL')+'?app=core&module=system&controller=settings&do=toggleSigs';var signatures=this.scope.find('[data-role="memberSignature"]');signatures.slideUp();ips.getAjax()(url).done(function(response){ips.ui.flashMsg.show(ips.getString('signatures_hidden'));signatures.remove();}).fail(function(){signatures.show();ips.ui.alert.show({type:'alert',icon:'warn',message:ips.getString('signatures_error'),callbacks:{}});});},_ignoreSingleSignature:function(memberID){var self=this;var url=ips.getSetting('baseURL')+'?app=core&module=system&controller=ignore&do=ignoreType&type=signatures';var signatures=this.scope.find('[data-role="memberSignature"]').find('[data-memberID="'+memberID+'"]').closest('[data-role="memberSignature"]');signatures.slideUp();ips.getAjax()(url,{data:{member_id:parseInt(memberID)}}).done(function(response){ips.ui.flashMsg.show(ips.getString('single_signature_hidden'));signatures.remove();}).fail(function(){signatures.show();ips.ui.alert.show({type:'alert',icon:'warn',message:ips.getString('single_signature_error'),callbacks:{}});});},commentIgnore:function(e,data){switch(data.selectedItemID){case'showPost':data.originalEvent.preventDefault();this._showHiddenPost(e,data);break;case'stopIgnoring':data.originalEvent.preventDefault();this._stopIgnoringFromComment(e,data);break;}},filterClick:function(e){e.preventDefault();var urlObj=ips.utils.url.getURIObject($(e.target).attr('href'));var queryKey=urlObj.queryKey;this._updateURL(queryKey);},quoteComment:function(e,data){var editorID=this.scope.find('[data-role="replyArea"] [data-role="contentEditor"]').attr('name');if(editorID){this.trigger('insertQuote',_.extend(data,{editorID:editorID}));}},windowBlur:function(e){if(this._pollingEnabled){Debug.log('Window blurred, pausing polling...');this._pollingPaused=true;}},windowFocus:function(e){if(this._pollingEnabled&&this._pollingPaused){Debug.log('Window focused...');this._pollingPaused=false;if(this._pollOnUnpaused){this._pollOnUnpaused=false;this.pollForNewReplies();}}},_startPolling:function(){var self=this;this._pollingActive=true;Debug.log('Starting polling with interval '+(this._currentPoll/1000)+'s');this._pollingTimeout=setTimeout(function(){self.pollForNewReplies();},this._currentPoll);},_stopPolling:function(){this._pollingActive=false;if(this._pollingTimeout){clearTimeout(this._pollingTimeout);}},pollForNewReplies:function(){var self=this;var replyForm=this.scope.find('[data-role="replyArea"] form');var commentsOnThisPage=this.scope.find('[data-commentid]');if(!commentsOnThisPage.length){return;} var lastSeenId=$(commentsOnThisPage[commentsOnThisPage.length-1]).attr('data-commentId');if(this._pollingPaused){Debug.log('Window blurred, delaying poll until focused...');this._pollOnUnpaused=true;return;} if(this._pollAjax&&!_.isUndefined(this._pollAjax.abort)){this._pollAjax.abort();} this._pollAjax=ips.getAjax();this._pollAjax(replyForm.attr('action'),{dataType:'json',data:'do=checkForNewReplies&type=count&lastSeenID='+lastSeenId,type:'post'}).done(function(response){if(parseInt(response.count)>0){self._currentPoll=self._initialPoll;var html='';if(parseInt(response.count)===1&&!_.isUndefined(response.photo)&&!_.isUndefined(response.name)){html=ips.templates.render('core.postNotify.single',{photo:response.photo,text:ips.getString('newPostSingle',{name:response.name})});}else{html=ips.templates.render('core.postNotify.multiple',{text:ips.pluralize(ips.getString('newPostMultiple'),[response.count])});} if($('#elFlashMessage').is(':visible')&&$('#elFlashMessage').find('[data-role="newPostNotification"]').length){$('#elFlashMessage').find('[data-role="newPostNotification"]').replaceWith(html);}else{ips.ui.flashMsg.show(html,{sticky:true,position:'bottom',extraClasses:'cPostFlash ipsPad_half'});}}else{if((self._currentPoll+self._decay)').append(data.content);var comment=content.find('.ipsComment');var commentFeed=this.scope.find('[data-role="commentFeed"]');if(commentFeed.find('[data-role="moderationTools"]').length){commentFeed=commentFeed.find('[data-role="moderationTools"]');} this.scope.find('[data-role="noComments"]').remove();commentFeed.append(comment);if(comment.find('pre.prettyprint').length){comment.find('pre.prettyprint').each(function(){$(this).html(window.PR.prettyPrintOne(_.escape($(this).text())));});} ips.utils.anim.go('fadeInDown',comment);if(_.isUndefined(data.resetEditor)||data.resetEditor!==false){this.trigger('resetEditor',{editorID:textarea.attr('name')});} if(ips.utils.db.isEnabled()){var buttons=comment.find('[data-action="multiQuoteComment"]');buttons.hide().removeClass('ipsHide');ips.utils.anim.go('fadeIn',buttons);} this._updateCount(data.totalItems);$(document).trigger('contentChange',[this.scope]);},deletedComment:function(e,data){data=$.parseJSON(data.response);var self=this;if(data.type=='redirect'){window.location=data.url;} else{this._updateCount(data.total);}},_updateCount:function(newTotal){if($(this.scope).find('[data-role="comment_count"]')){var langString='js_num_comments';if($(this.scope).find('[data-role="comment_count"]').attr('data-commentCountString')){langString=$(this.scope).find('[data-role="comment_count"]').attr('data-commentCountString');} $(this.scope).find('[data-role="comment_count"]').text(ips.pluralize(ips.getString(langString),newTotal));}},doMultiQuote:function(e){var mqData=this._getMultiQuoteData();var replyArea=this.scope.find('[data-role="replyArea"]');var editor=replyArea.find('[data-role="contentEditor"]');var editorID=editor.attr('name');var output=[];var self=this;if(!_.size(mqData)||!replyArea.is(':visible')){return;} _.each(mqData,function(value){output.push(value);});self.trigger('insertQuote',{editorID:editorID,quotes:output});this._removeAllMultiQuoted();},clearMultiQuote:function(e){e.preventDefault();this._removeAllMultiQuoted();},_removeAllMultiQuoted:function(){var mqData=this._getMultiQuoteData();var self=this;ips.utils.db.set('mq','data',{});this._buildMultiQuote(0);if(!_.size(mqData)){return;} _.each(mqData,function(value){self.triggerOn('core.front.core.comment','setMultiQuoteDisabled.comment',{contentapp:value.contentapp,contenttype:value.contenttype,contentcommentid:value.contentcommentid});});},addMultiQuote:function(e,data){var mqData=this._getMultiQuoteData();var key=data.contentapp+'-'+data.contenttype+'-'+data.contentcommentid;if(_.size(mqData)==this._maximumMultiQuote) {ips.ui.alert.show({type:'alert',icon:'warn',message:ips.pluralize(ips.getString('maxmultiquote'),this._maximumMultiQuote),callbacks:{ok:function(){$("button[data-mqId='"+data.button+"']").removeClass('ipsButton_alternate').addClass('ipsButton_simple').removeAttr('data-mqActive').html(ips.templates.render('core.posts.multiQuoteOff'));}}});return false;} mqData[key]=data;ips.utils.db.set('mq','data',mqData);this._buildMultiQuote(_.size(mqData));},removeMultiQuote:function(e,data){var mqData=this._getMultiQuoteData();var key=data.contentapp+'-'+data.contenttype+'-'+data.contentcommentid;if(!_.isUndefined(mqData[key])){mqData=_.omit(mqData,key);ips.utils.db.set('mq','data',mqData);this._buildMultiQuote(_.size(mqData));}},_getMultiQuoteData:function(){var mqData=ips.utils.db.get('mq','data');if(_.isUndefined(mqData)||!_.isObject(mqData)){return{};} return mqData;},_setUpMultiQuote:function(){if(!ips.utils.db.isEnabled()){return;} var buttons=this.scope.find('[data-action="multiQuoteComment"]');var self=this;var mqData=this._getMultiQuoteData();buttons.hide().removeClass('ipsHide');ips.utils.anim.go('fadeIn',buttons);if(_.size(mqData)){this._buildMultiQuote(_.size(mqData));_.each(mqData,function(value){self.triggerOn('core.front.core.comment','setMultiQuoteEnabled.comment',{contentapp:value.contentapp,contenttype:value.contenttype,contentcommentid:value.contentcommentid});});}},_buildMultiQuote:function(count){var quoterElem=$('#ipsMultiQuoter');if(!quoterElem.length&&count){ips.getContainer().append(ips.templates.render('core.posts.multiQuoter',{count:ips.getString('multiquote_count',{count:ips.pluralize(ips.getString('multiquote_count_plural'),[count])})}));ips.utils.anim.go('zoomIn fast',$('#ipsMultiQuoter'));}else{quoterElem.find('[data-role="quotingTotal"]').text(ips.pluralize(ips.getString('multiquote_count_plural'),[count]));if(count&"erElem.is(':visible')){ips.utils.anim.go('pulseOnce fast',quoterElem);}else if(count&&!quoterElem.is(':visible')){ips.utils.anim.go('zoomIn fast',quoterElem);}else{ips.utils.anim.go('zoomOut fast',quoterElem);}}},_showHiddenPost:function(e,data){var ignoreRow=$(data.triggerElem).closest('.ipsComment_ignored');var commentID=ignoreRow.attr('data-ignoreCommentID');var comment=this.scope.find('#'+commentID);ignoreRow.remove();comment.removeClass('ipsHide');},_stopIgnoringFromComment:function(e,data){var ignoreRow=$(data.triggerElem).closest('.ipsComment_ignored');var userID=ignoreRow.attr('data-ignoreUserID');var self=this;var posts=this.scope.find('[data-ignoreUserID="'+userID+'"]');posts.each(function(){self.scope.find('#'+$(this).attr('data-ignoreCommentID')).removeClass('ipsHide');$(this).remove();});var url=ips.getSetting('baseURL')+'?app=core&module=system&controller=ignore&do=ignoreType&type=topics&off=1';ips.getAjax()(url,{data:{member_id:parseInt(userID)}}).done(function(){ips.ui.flashMsg.show(ips.getString('ignore_prefs_updated'));}).fail(function(){window.location=ips.getSetting('baseURL')+'?app=core&module=system&controller=ignore&do=ignoreType&off=1type=topics&member_id='+userID;});}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.commentsWrapper',{initialize:function(){this.on(document,'addToCommentFeed',this.addToCommentFeed);this.on('deletedComment.comment',this.deletedComment);},addToCommentFeed:function(e,data){this._updateCount($(e.target).attr('data-commentsType'),data.totalItems);},deletedComment:function(e,data){this._updateCount($(e.target).closest('[data-commentsType]').attr('data-commentsType'),data.newTotal);},_updateCount:function(type,number){var langString='js_num_'+type;var elem=$('#'+$(this.scope).attr('data-tabsId')+'_tab_'+type);elem.text(ips.pluralize(ips.getString(langString),number));}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.lightboxedImages',{_random:null,initialize:function(){this.on('initializeImages',this.initializeImages);this.setup();},setup:function(){this._random='g'+(Math.round(Math.random()*100000));this._initializeImages();},initializeImages:function(){this._initializeImages();},_initializeImages:function(){var self=this;this.scope.find('img').imagesLoaded(function(images){images.each(function(i,image){if(image.width>=image.naturalWidth&&!$(image).hasClass('ipsImage_thumbnailed')){return;} image=$(image);image.addClass('ipsImage_thumbnailed');if(image.closest('a').length&&image.closest('a').hasClass('ipsAttachLink')&&image.closest('a').hasClass('ipsAttachLink_image')){if(!ips.utils.responsive.enabled()||!ips.utils.responsive.currentIs('phone')){image.closest('a').attr('data-fullURL',image.closest('a').attr('src')).attr('data-ipsLightbox','').attr('data-ipsLightbox-group',self._random);}}else{if(!image.closest('a').length){if(ips.utils.responsive.enabled()&&ips.utils.responsive.currentIs('phone')){image.wrap($(""));}else{image.wrap($(""));}}}});});}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.loginMenu',{initialize:function(){this.on('success.validation','form',this.doSignIn);},doSignIn:function(e){e.preventDefault();var form=this.scope.find('form');var url=form.attr('action');this._loading(true);ips.getAjax()(url,{type:'post',data:form.serialize(),dataType:'json'}).done(function(response){window.location.reload();}).fail(function(jqXHR,textStatus,errorThrown){Debug.log(textStatus);});},_loading:function(doLoading){var dims={width:this.scope.outerWidth(),height:this.scope.outerHeight()};this.scope.css({height:dims.height+'px',width:dims.width+'px'}).addClass('ipsLoading').find('[data-role="loginForm"]').hide();}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.markRead',{initialize:function(){this.on('click',this.markSiteRead);},markSiteRead:function(e){e.preventDefault();ips.ui.alert.show({type:'confirm',icon:'question',message:ips.getString('markAsReadConfirm'),subText:'',callbacks:{ok:function(){var url=ips.getSetting('baseURL')+'?app=core&module=system&controller=markread';ips.getAjax()(url,{showLoading:true}).done(function(){$(document).trigger('markAllRead');}).fail(function(jqXHR,textStatus,errorThrown){window.location=ipsSettings.baseURL+url;});}}});}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.mobileNav',{initialize:function(){this.on('click','[data-action="mobileSearch"]',this.mobileSearch);},mobileSearch:function(e){e.preventDefault();$('body').toggleClass('cSearchOpen');}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.navBar',{initialize:function(){this.on(window,'resize',this.resizeWindow);if($('body').attr('data-controller').indexOf('core.global.customization.visualLang')==-1){this.setup();}else{var self=this;$('body').on('vleDone',function(){self.setup();});}},setup:function(){this._mushMenu();},resizeWindow:function(){this._mushMenu();},_mushMenu:function(){var availableSpace=this.scope.outerWidth()-this.scope.find('#elSearch').outerWidth();var moreItem=this.scope.find('[data-role="navMore"]');var moreMenuSize=moreItem.outerWidth();var menuItems=this.scope.find('[data-role="navItem"]');var sizeIncrem=0;if(!moreItem.is(':visible')){moreMenuSize=moreItem.removeClass('ipsHide').outerWidth();moreItem.addClass('ipsHide');} menuItems.each(function(){var item=$(this);var itemSize=0;if(item.attr('data-originalWidth')){itemSize=parseInt(item.attr('data-originalWidth'));}else{var o=item.outerWidth();item.attr('data-originalWidth',o);itemSize=o;} if((sizeIncrem+itemSize+moreMenuSize)>availableSpace){if(!item.attr('data-mushed')){var newLI=$('
  • ').attr('data-originalItem',item.identify().attr('id')).addClass('ipsMenu_item').append(item.contents());if(newLI.find('.ipsMenu').length){newLI.addClass('ipsMenu_subItems');} $('#elNavigationMore_dropdown_menu').append(newLI);item.addClass('ipsHide').attr('data-mushed',true);}}else if(item.attr('data-mushed')){var mushedItem=$('#elNavigationMore_dropdown_menu').find('[data-originalItem="'+item.identify().attr('id')+'"]');if(mushedItem.length){item.append(mushedItem.contents()).removeClass('ipsHide');mushedItem.remove();} item.removeAttr('data-mushed');} sizeIncrem+=itemSize;});moreItem.toggleClass('ipsHide',!$('#elNavigationMore_dropdown_menu').find('> li').length);}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.pagination',{initialize:function(){this.on('paginationClicked paginationJump',this.paginationClick);},paginationClick:function(e,data){var self=this;if(!data.href){return;} ips.getAjax()(data.href).done(function(response){self.scope.hide().html(response);ips.utils.anim.go('fadeIn',self.scope);}).fail(function(){window.location=data.href;});}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.quickSearch',{_initialSize:0,_expanded:false,_blurTimeout:null,_focused:false,initialize:function(){this.on('focus','#elSearchField',this.focusSearch);this.on('blur','#elSearchField',this.blurSearch);this.on('menuItemSelected','#elSearchFilter',this.menuItemSelected);this.on(document,'menuOpened',this.menuOpened);this.setup();},setup:function(){this._expanded=false;},menuItemSelected:function(e,data){if(!data.selectedItemID){return;} data.originalEvent.preventDefault();for(var i in data.selectedItems) {var selectedItem=$('#'+i);} var form=this.scope.find('form');var title=selectedItem.find('a').html();this.scope.find('[data-role="searchingIn"]').text(title);this.scope.find('[data-role="searchFilter"]').remove();if(data.selectedItemID!='all'){var options=selectedItem.attr('data-options');if(!options){form.append($('').attr('type','hidden').attr('name','type').attr('value',data.selectedItemID).attr('data-role','searchFilter'));return;} try{options=$.parseJSON(options);_.each(options,function(val,i){form.append($('').attr('type','hidden').attr('name',i).attr('value',val).attr('data-role','searchFilter'));});}catch(err){Debug.log('Invalid search options json');return;}}},focusSearch:function(e){if(this._expanded){return;} $('#elSearch').addClass('cSearchExpanded');ips.utils.anim.go('fadeIn',$('#elSearchFilter'));var scope=$(this.scope);ips.getAjax()(ips.getSetting('baseURL')+'?app=core&module=search&controller=search&do=globalFilterOptions').done(function(response){scope.find('[data-role="globalSearchMenuOptions"]').replaceWith(response);});this._expanded=true;},blurSearch:function(){var self=this;this._blurTimeout=setTimeout(function(){self._cancelSearch();},500);},_cancelSearch:function(){if(ips.utils.responsive.currentIs('phone')){ips.utils.anim.go('fadeIn fast',$('#elHeaderNavigation'));} $('#elSearch').removeClass('cSearchExpanded');ips.utils.anim.go('fadeOut fast',$('#elSearchFilter'));this._expanded=false;},menuOpened:function(e,data){Debug.log(data.elemID);if(data.elemID=='elSearchFilter'){clearTimeout(this._blurTimeout);}}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.rating',{initialize:function(){this.on('ratingSaved','[data-ipsRating]',this.ratingClick);var scope=this.scope;},ratingClick:function(e,data){var scope=$(this.scope);ips.getAjax()(scope.attr('action'),{data:scope.serialize(),type:'post'}).done(function(response,textStatus,jqXHR){}).fail(function(){scope.submit();});}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.reputation',{initialize:function(){this.on('click','[data-action="giveReputation"]',this.giveReputation);},giveReputation:function(e){e.preventDefault();var self=this;var url=$(e.currentTarget).attr('href');var thisParent=this.scope.parent();this.scope.css({opacity:0.5});ips.getAjax()(url).done(function(response){var newHTML=$('
    '+response+'
    ').find('[data-controller="core.front.core.reputation"]').html();self.scope.html(newHTML).css({opacity:1});}).fail(function(jqXHR,textStatus,errorThrown){if(jqXHR.responseJSON['error']){ips.ui.alert.show({type:'alert',icon:'warn',message:jqXHR.responseJSON['error'],callbacks:{}});}else{window.location=url;}});}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.sharelink',{initialize:function(){this.on('click','[data-role="shareLink"]',this.launchWindow);},launchWindow:function(e){e.preventDefault();var url=$(e.currentTarget).attr('href');if(!ips.utils.url.getParam('url',url)) {url+="&url="+encodeURIComponent(location.href);} if(!ips.utils.url.getParam('title',url)) {url+="&title="+encodeURIComponent(document.title);} window.open(url,'delicious','toolbar=no,width=550,height=550');},});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.statuses',{initialize:function(){this._hideReplyFields();this.on('click','[data-action="delete"]',this.deleteStatus);this.on('click','[data-action="lock"]',this.lockStatus);this.on('click','[data-action="unlock"]',this.unlockStatus);this.on('click','[data-action="reply"]',this.replyStatus);this.on('click','[data-action="loadPreviousComments"]',this.loadPrevious);this.on('blur','[data-role="replyComment"] input[type="text"]',this.blurCommentField);this.on('keydown','[data-role="replyComment"] input[type="text"]',this.keydownCommentField);this.on(document,'lockingStatus',this.togglingStatus);this.on(document,'lockedStatus',this.lockedStatus);this.on(document,'unlockingStatus',this.togglingStatus);this.on(document,'unlockedStatus',this.unlockedStatus);this.on(document,'deletingStatus deletingComment',this.deletingStatus);this.on(document,'deletedStatus deletedComment',this.deletedStatus);this.on(document,'loadingComments',this.loadingComments);this.on(document,'loadedComments',this.loadedComments);this.on(document,'addingComment',this.addingComment);this.on(document,'addedComment',this.addedComment);},_requestCount:{},_offsets:{},_hideReplyFields:function(){$(this.scope).find('[data-statusid]').not('.ipsComment_hasChildren').find('.ipsComment_subComments').hide().end().end().find('[data-role="submitReply"]').hide();},loadPrevious:function(e){e.preventDefault();var link=$(e.currentTarget),statusElem=link.parents('[data-statusid]'),statusID=$(statusElem).data('statusid');this._offsets[statusID]=(statusElem.find('[data-commentid]').length)*-1;this.trigger('loadComments',{statusID:statusID,offset:this._offsets[statusID]});},loadingComments:function(e,data){var status=$(this.scope).find('[data-statusid="'+data.statusID+'"]');status.find('[data-action="loadPreviousComments"]').html(ips.templates.render('core.statuses.loadingComments'));},loadedComments:function(e,data){var status=$(this.scope).find('[data-statusid="'+data.statusID+'"]'),loadingRow=status.find('[data-action="loadPreviousComments"]');loadingRow.after(data.comments);var totalShown=status.find('[data-commentid]').length;if(data.total<=totalShown){loadingRow.remove();}else{loadingRow.html(ips.templates.render('core.statuses.loadMore')).find("[data-role='remainingCount']").text(data.total-totalShown);} $(document).trigger('contentChange',[status]);},deleteStatus:function(e){e.preventDefault();var link=$(e.currentTarget),statusElem=link.parents('[data-statusid]'),commentElem=link.parents('[data-commentid]'),statusID=$(statusElem).data('statusid'),commentID=$(commentElem).data('commentid');if(commentElem){if(confirm(ips.getString('confirmStatusCommentDelete'))){this.trigger('deleteComment',{statusID:statusID,commentID:commentID});}}else{if(confirm(ips.getString('confirmStatusDelete'))){this.trigger('deleteStatus',{statusID:statusID});}}},deletingStatus:function(e,data){if(data.commentID){$(this.scope).find('[data-commentid="'+data.commentID+'"]').animate({opacity:0.5});}else{$(this.scope).find('[data-statusid="'+data.statusID+'"]').animate({opacity:0.5});}},deletedStatus:function(e,data){if(data.commentID){$(this.scope).find('[data-commentid="'+data.commentID+'"]').remove();}else{$(this.scope).find('[data-statusid="'+data.statusID+'"]').remove();}},lockStatus:function(e){e.preventDefault();var link=$(e.currentTarget),statusElem=link.parents('[data-statusid]'),statusID=$(statusElem).data('statusid');this.trigger('lockStatus',{statusID:statusID});},unlockStatus:function(e){e.preventDefault();var link=$(e.currentTarget),statusElem=link.parents('[data-statusid]'),statusID=$(statusElem).data('statusid');this.trigger('unlockStatus',{statusID:statusID});},lockedStatus:function(e,data){var status=$(this.scope).find('[data-statusid="'+data.statusID+'"]');$(status).find('[data-action="lock"]').first().replaceWith(ips.templates.render('core.statuses.unlock'));this._finishedAction(e,data);},unlockedStatus:function(e,data){var status=$(this.scope).find('[data-statusid="'+data.statusID+'"]');$(status).find('[data-action="unlock"]').first().replaceWith(ips.templates.render('core.statuses.lock'));this._finishedAction(e,data);},togglingStatus:function(e,data){var status=$(this.scope).find('[data-statusid="'+data.statusID+'"]'),loadingThingy=status.find('.cStatusTools_loading');if(!loadingThingy.length){status.find('.cStatusTools').first().append(ips.templates.render('core.statuses.statusAction'));}else{loadingThingy.show();} if(!this._requestCount[data.statusID]){this._requestCount[data.statusID]=1;}else{this._requestCount[data.statusID]++;}},_finishedAction:function(e,data){var status=$(this.scope).find('[data-statusid="'+data.statusID+'"]'),loadingThingy=status.find('.cStatusTools_loading');this._requestCount[data.statusID]--;if(this._requestCount[data.statusID]==0){loadingThingy.remove();}},replyStatus:function(e){e.preventDefault();var link=$(e.currentTarget),statusElem=link.parents('[data-statusid]');if(statusElem.find('[data-commentid]').length>0){statusElem.find('[data-role="replyComment"] input[type="text"]').focus();return;} Debug.log(statusElem.find('.ipsComment_subComments').is(':visible'));if(!statusElem.find('.ipsComment_subComments').is(':visible')){ips.utils.anim.go('fadeIn',statusElem.find('.ipsComment_subComments'));statusElem.addClass('ipsComment_hasChildren').find('[data-role="replyComment"] input[type="text"]').focus();}else{if(statusElem.find('[data-commentid]').length==0&&field.val()==''){statusElem.removeClass('ipsComment_hasChildren').find('.ipsComment_subComments, [data-role="submitReply"]').hide();}}},blurCommentField:function(e){e.preventDefault();var field=$(e.currentTarget),statusElem=field.parents('[data-statusid]'),replyButton=statusElem.find('[data-role="submitReply"]');if(statusElem.find('[data-commentid]').length==0&&field.val()==''){statusElem.removeClass('ipsComment_hasChildren').find('.ipsComment_subComments').hide();}},keydownCommentField:function(e){var field=$(e.currentTarget),statusElem=field.parents('[data-statusid]'),statusID=statusID=$(statusElem).data('statusid');if(e.keyCode==ips.ui.key.ENTER){this.trigger('addComment',{content:field.val(),statusID:statusID});}},addingComment:function(e,data){var statusElem=$(this.scope).find('[data-statusid="'+data.statusID+'"]'),replyRow=statusElem.find('[data-role="replyComment"]');replyRow.find('input[type="text"]').prop('disabled',true).addClass('ipsField_disabled');},addedComment:function(e,data){var statusElem=$(this.scope).find('[data-statusid="'+data.statusID+'"]'),replyRow=statusElem.find('[data-role="replyComment"]'),subComments=statusElem.find('.ipsComment_subComments');if(replyRow.length){replyRow.before(data.comment);}else if(subComments.length){subComments.append(data.comment);} statusElem.find('[data-role="replyComment"] input[type="text"]').val('').blur().prop('disabled',false).removeClass('ipsField_disabled');},});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.userbar',{loaded:{},initialize:function(){this.on(document,'menuOpened',this.menuOpened);},menuOpened:function(e,data){if(data.elemID=='elFullInbox'||data.elemID=='elMobInbox'){this._loadMenu('inbox',ips.getSetting('baseURL')+'?app=core&module=messaging&controller=messenger&overview=1','inbox');}else if(data.elemID=='elFullNotifications'||data.elemID=='elMobNotifications'){this._loadMenu('notify',ips.getSetting('baseURL')+'?app=core&module=system&controller=notifications','notify');}else if(data.elemID=='elFullReports'||data.elemID=='elMobReports'){this._loadMenu('reports',ips.getSetting('baseURL')+'?app=core&module=modcp&controller=modcp&tab=reports&overview=1','reports');}},_loadMenu:function(type,url,contentID){if(!this.loaded[type]){var self=this;var ajaxObj=ips.getAjax();$('[data-role="'+contentID+'List"]').css({height:'100px'}).addClass('ipsLoading');ajaxObj(url,{dataType:'json'}).done(function(returnedData){$('[data-role="'+contentID+'List"]').css({height:'auto'}).removeClass('ipsLoading').html(returnedData.data);self.loaded[type]=true;if(contentID!='reports'){ips.utils.anim.go('fadeOut',$('[data-notificationType="'+contentID+'"]'));} $(document).trigger('contentChange',[$('[data-role="'+contentID+'List"]')]);}).fail(function(){});}}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.model.register('core.comment',{initialize:function(){this.on('getEditForm.comment',this.getEditForm);this.on('saveEditComment.comment',this.saveEditComment);this.on('deleteComment.comment',this.deleteComment);this.on('newComment.comment',this.newComment);this.on('approveComment.comment',this.approveComment);},getEditForm:function(e,data){this.getData({url:data.url,dataType:'html',data:{url:data.url},events:'getEditForm',namespace:'comment'},data);},saveEditComment:function(e,data){var url=data.url;this.getData({url:data.url,dataType:'html',type:'post',data:data.form||{},events:'saveEditComment',namespace:'comment'},data);},approveComment:function(e,data){this.getData({url:data.url,dataType:'html',data:data.form||{},events:'approveComment',namespace:'comment'},data);},deleteComment:function(e,data){this.getData({url:data.url,dataType:'html',data:data.form||{},events:'deleteComment',namespace:'comment'},data);},newComment:function(e,data){this.getData({url:data.url,dataType:'json',data:data.form||{},events:'newComment',namespace:'comment'},data);}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.mixin('contentListing','core.global.core.table',true,function(){this.after('initialize',function(){this.on('menuItemSelected','[data-role="sortButton"]',this.changeSorting);this.on('change','[data-role="moderation"]',this.selectRow);this.on('click','[data-action="markAsRead"]',this.markAsRead);this.on('paginationClicked',this.frontPaginationClicked);this.on('markTableRead',this.markAllRead);$(document).on('markTableRowRead',_.bind(this.markRowRead,this));$(document).on('markAllRead',_.bind(this.markAllRead,this));});this.after('setup',function(){this._tableID=this.scope.attr('data-tableID');});this.before('_getResults',function(){this._setTableLoading(true);});this.after('_getResultsAlways',function(){this._setTableLoading(false);});this.after('_updateTable',function(){this.scope.find('[data-ipsPageAction]').trigger('refresh.pageAction');});this.markAllRead=function(){this.scope.find('.ipsDataItem, .ipsDataItem_subList .ipsDataItem_unread').removeClass('ipsDataItem_unread').find('.ipsItemStatus').addClass('ipsItemStatus_read');},this.markRowRead=function(e,data){if(_.isUndefined(data.tableID)||data.tableID!=this._tableID){return;} this.scope.find('[data-rowID="'+data.rowID+'"]').removeClass('ipsDataItem_unread').find('.ipsItemStatus').addClass('ipsItemStatus_read');},this.frontPaginationClicked=function(){var elemPosition=ips.utils.position.getElemPosition(this.scope);$('html, body').animate({scrollTop:elemPosition.absPos.top+'px'});};this.selectRow=function(e){var row=$(e.currentTarget).closest('.ipsDataItem');row.toggleClass('ipsDataItem_selected',$(e.currentTarget).is(':checked'));};this.markAsRead=function(e){e.preventDefault();var self=this;var item=$(e.currentTarget);var url=item.attr('href');var row=item.closest('.ipsDataItem');row.removeClass('ipsDataItem_unread').find('.ipsItemStatus').addClass('ipsItemStatus_read');row.find('.ipsDataItem_subList .ipsDataItem_unread').removeClass('ipsDataItem_unread');ips.utils.anim.go('fadeOut',$('#ipsTooltip'));item.removeAttr('data-ipstooltip').removeAttr('title');ips.getAjax()(url,{bypassRedirect:true}).done(function(response){item.trigger('markedAsRead');}).fail(function(){item.closest('.ipsDataItem').addClass('ipsDataItem_unread').find('.ipsItemStatus').removeClass('ipsItemStatus_read');ips.ui.alert.show({type:'alert',icon:'error',message:ips.getString('errorMarkingRead'),callbacks:{ok:function(){}}});});};this._setTableLoading=function(loading){var rows=this.scope.find('[data-role="tableRows"]');if(!rows.length){return;} if(!this._tableOverlay){this._tableOverlay=$('
    ').addClass('ipsLoading').hide();ips.getContainer().append(this._tableOverlay);} if(loading){var dims=ips.utils.position.getElemDims(rows);var position=ips.utils.position.getElemPosition(rows);this._tableOverlay.show().css({left:position.viewportOffset.left+'px',top:position.viewportOffset.top+'px',width:dims.width+'px',height:dims.height+'px',position:'absolute',zIndex:ips.ui.zIndex()});rows.css({opacity:0.5});}else{rows.animate({opacity:1});this._tableOverlay.hide();}};this.changeSorting=function(e,data){data.originalEvent.preventDefault();var current=this._getSortValue();var menuItem=data.menuElem.find('[data-ipsMenuValue="'+data.selectedItemID+'"]');var sortBy=data.selectedItemID;var sortDirection=current.order;if(menuItem.attr('data-sortDirection')){sortDirection=menuItem.attr('data-sortDirection');} this.updateURL({sortby:sortBy,sortdirection:sortDirection,page:1});};this._updateFilter=function(newFilter){};this._getSortValue=function(){var by=ips.utils.url.getParam('sortby');var order=ips.utils.url.getParam('sortdirection');return{by:by||'',order:order||''};};this._getFilterValue=function(){var filter=ips.utils.url.getParam('filter');return filter||'';};});}(jQuery,_));; [3] => javascript_global [4] => 1 ) ) [3] => Array ( [file] => /home/active/general/soompi/fr/system/Output/Javascript/Javascript.php [line] => 863 [function] => _writeJavascript [class] => IPS\Output\_Javascript [type] => :: [args] => Array ( [0] => ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.app',{initialize:function(){this.on('click','a[data-confirm]',this.confirmSomething);this.setup();},setup:function(){this.scope.addClass('ipsJS_has').removeClass('ipsJS_none');if(!ips.utils.events.isTouchDevice()){this.scope.addClass('ipsApp_noTouch');} if(typeof jstz!=='undefined'){ips.utils.cookie.set('ipsTimezone',jstz.determine().name());} if($('#elInlineMessage').length){var dialogRef=ips.ui.dialog.create({showFrom:'#inbox',content:'#elInlineMessage',title:$('#elInlineMessage').attr('title')});setTimeout(function(){dialogRef.show();},800);} if(ips.getSetting('links_external')){this.scope.find('a[rel*="external"]').each(function(index,elem){elem.target="_blank";})} prettyPrint();},confirmSomething:function(e){e.preventDefault();var elem=$(e.currentTarget);var customMessage=$(e.currentTarget).attr('data-confirmMessage');var subMessage=$(e.currentTarget).attr('data-confirmSubMessage');ips.ui.alert.show({type:'confirm',icon:'warn',message:(customMessage)?customMessage:ips.getString('generic_confirm'),subText:(subMessage)?subMessage:'',callbacks:{ok:function(){window.location=elem.attr('href');}}});},});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.autoSizeIframe',{initialize:function(){this.on('load',this.resizeFrame);},resizeFrame:function(e){setTimeout(function(){e.target.style.height=e.target.contentWindow.document.body.scrollHeight+'px';e.target.style.overflow='hidden';e.target.scrolling="no";e.target.seamless="seamless";},1500);}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.comment',{_quoteData:null,_commentContents:'',initialize:function(){this.on('click','[data-action="editComment"]',this.editComment);this.on('click','[data-action="cancelEditComment"]',this.cancelEditComment);this.on('click','[data-action="deleteComment"]',this.deleteComment);this.on('click','[data-action="approveComment"]',this.approveComment);this.on('click','[data-action="quoteComment"]',this.quoteComment);this.on('click','[data-action="multiQuoteComment"]',this.multiQuoteComment);this.on('click','[data-action="rateReview"]',this.rateReview);this.on('click','button[type="submit"]',this.submitEdit);this.on('change','input[type="checkbox"][data-role="moderation"]',this.commentCheckbox);this.on('setMultiQuoteEnabled.comment setMultiQuoteDisabled.comment',this.setMultiQuote);this.on('disableQuoting.comment',this.disableQuoting);this.on(document,'getEditFormLoading.comment saveEditCommentLoading.comment '+'deleteCommentLoading.comment',this.commentLoading);this.on(document,'getEditFormDone.comment saveEditCommentDone.comment '+'deleteCommentDone.comment',this.commentDone);this.on(document,'getEditFormDone.comment',this.getEditFormDone);this.on(document,'getEditFormError.comment',this.getEditFormDone);this.on(document,'saveEditCommentDone.comment',this.saveEditCommentDone);this.on(document,'saveEditCommentError.comment',this.saveEditCommentError);this.on(document,'deleteCommentDone.comment',this.deleteCommentDone);this.on(document,'deleteCommentError.comment',this.deleteCommentError);this.on(document,'approveCommentLoading.comment',this.approveCommentLoading);this.on(document,'approveCommentDone.comment',this.approveCommentDone);this.on(document,'approveCommentError.comment',this.approveCommentError);this.setup();},setup:function(){this._commentID=this.scope.attr('data-commentID');var id=this._commentID;},destroy:function(){},commentCheckbox:function(e){var checked=$(e.currentTarget).is(':checked');this.scope.closest('.ipsComment').toggleClass('ipsComment_selected',checked);this.trigger('checkedComment.comment',{commentID:this._commentID,actions:$(e.currentTarget).attr('data-actions'),checked:checked});},disableQuoting:function(){this.scope.find('[data-ipsQuote-editor]').remove();},rateReview:function(e){e.preventDefault();var scope=this.scope ips.getAjax()($(e.currentTarget).attr('href')).done(function(response){scope.parent().replaceWith($(response));}).fail(function(err){window.location=$(e.currentTarget).attr('href');});},setMultiQuote:function(e,data){var selector='[data-commentApp="'+data.contentapp+'"]';selector+='[data-commentType="'+data.contenttype+'"]';selector+='[data-commentID="'+data.contentcommentid+'"]';if(this.scope.is(selector)){if(!_.isNull(e)&&e.type=='setMultiQuoteEnabled'){this.scope.find('[data-action="multiQuoteComment"]').removeClass('ipsButton_simple').addClass('ipsButton_alternate').attr('data-mqActive',true).html(ips.templates.render('core.posts.multiQuoteOn'));}else if(_.isNull(e)||e.type=='setMultiQuoteDisabled'){this.scope.find('[data-action="multiQuoteComment"]').addClass('ipsButton_simple').removeClass('ipsButton_alternate').removeAttr('data-mqActive').html(ips.templates.render('core.posts.multiQuoteOff'));}}},quoteComment:function(e){e.preventDefault();if(!this._getQuoteData()){Debug.error("Couldn't get quote data");return;} var html=this._prepareQuote($('
    ').html(this.scope.find('[data-role="commentContent"]').html()));Debug.log(this._commentID);this.trigger('quoteComment.comment',{userid:this._quoteData.userid,username:this._quoteData.username,timestamp:this._quoteData.timestamp,contentapp:this._quoteData.contentapp,contenttype:this._quoteData.contenttype,contentclass:this._quoteData.contentclass,contentid:this._quoteData.contentid,contentcommentid:this._quoteData.contentcommentid,quoteHtml:html.html()});},multiQuoteComment:function(e){e.preventDefault();if(!this._getQuoteData()){Debug.error("Couldn't get quote data");return;} var button=$(e.currentTarget);var mqActive=button.attr('data-mqActive');var html=this._prepareQuote($('
    ').html(this.scope.find('[data-role="commentContent"]').html()));this.trigger((mqActive)?'removeMultiQuote.comment':'addMultiQuote.comment',{userid:this._quoteData.userid,username:this._quoteData.username,timestamp:this._quoteData.timestamp,contentapp:this._quoteData.contentapp,contenttype:this._quoteData.contenttype,contentclass:this._quoteData.contentclass,contentid:this._quoteData.contentid,contentcommentid:this._quoteData.contentcommentid,quoteHtml:html.html(),button:button.attr('data-mqId')});if(mqActive){button.removeClass('ipsButton_alternate').addClass('ipsButton_simple').removeAttr('data-mqActive').html(ips.templates.render('core.posts.multiQuoteOff'));}else{button.removeClass('ipsButton_simple').addClass('ipsButton_alternate').attr('data-mqActive',true).html(ips.templates.render('core.posts.multiQuoteOn'));}},editComment:function(e){e.preventDefault();this._commentContents=this.scope.find('[data-role="commentContent"]').html();var url=$(e.currentTarget).attr('href');this.trigger('getEditForm.comment',{url:url,commentID:this._commentID});},cancelEditComment:function(e){e.preventDefault();var self=this;ips.ui.alert.show({type:'confirm',icon:'warn',message:ips.getString('generic_confirm'),subText:'',callbacks:{ok:function(){self.scope.find('[data-role="commentContent"]').html(self._commentContents);self.scope.find('[data-role="commentControls"], [data-action="expandTruncate"]').show();}}});},submitEdit:function(e){e.preventDefault();var instance;var empty=false;for(instance in CKEDITOR.instances){CKEDITOR.instances[instance].updateElement();} var postBody=$.trim(CKEDITOR.instances['comment_value'].editable().getData().replace(/ /g,''));if(postBody==''||postBody.match(/^

    (

    |<\/p>|\s)*<\/p>$/)){ips.ui.alert.show({type:'alert',icon:'warn',message:ips.getString('cantEmptyEdit'),subText:ips.getString('cantEmptyEditDesc')});return;} var form=this.scope.find('form');var url=form.attr('action');var data=form.serialize();this.trigger('saveEditComment.comment',{form:data,url:url,commentID:this._commentID});},commentLoading:function(e,data){if(data.commentID!=this._commentID){return;} ips.utils.anim.go('fadeIn',this.scope.find('[data-role="commentLoading"]').removeClass('ipsHide'));},commentDone:function(e,data){if(data.commentID!=this._commentID){return;} this.scope.find('[data-role="commentLoading"]').addClass('ipsHide');},getEditFormDone:function(e,data){if(data.commentID!=this._commentID){return;} this.scope.find('[data-action="expandTruncate"], [data-role="commentControls"]').hide();this.scope.find('[data-role="commentContent"]').html(data.response);$(document).trigger('contentChange',[this.scope.find('[data-role="commentContent"]')]);},getEditFormError:function(e,data){if(data.commentID!=this._commentID){return;} window.location=data.url;},saveEditCommentDone:function(e,data){if(data.commentID!=this._commentID){return;} this.scope.find('[data-role="commentContent"]').replaceWith($('

    '+data.response+'
    ').find('[data-role="commentContent"]'));this.scope.trigger('initializeImages');this.scope.find('[data-action="expandTruncate"], [data-role="commentControls"]').show();$(document).trigger('contentChange',[this.scope]);},saveEditCommentError:function(e,data){Debug.log('save comment error');if(data.commentID!=this._commentID){return;} ips.ui.alert.show({type:'alert',icon:'warn',message:ips.getString('editCommentError'),});},approveComment:function(e){e.preventDefault();var url=$(e.currentTarget).attr('href');this.trigger('approveComment.comment',{url:url,commentID:this._commentID});},approveCommentLoading:function(e,data){if(data.commentID!=this._commentID){return;} this.scope.find('[data-role="commentControls"]').addClass('ipsFaded').find('[data-action="approveComment"]').addClass('ipsButton_disabled').text(ips.getString('commentApproving'));},approveCommentDone:function(e,data){if(data.commentID!=this._commentID){return;} var commentHtml=$('
    '+data.response+'
    ').find('[data-controller="core.front.core.comment"]').html();this.scope.html(commentHtml).removeClass('ipsModerated').closest('.ipsComment').removeClass('ipsModerated');$(document).trigger('contentChange',[this.scope]);if(ips.utils.db.isEnabled()){this.scope.find('[data-action="multiQuoteComment"]').removeClass('ipsHide');} ips.ui.flashMsg.show(ips.getString('commentApproved'));},approveCommentError:function(e,data){if(data.commentID!=this._commentID){return;} window.location=data.url;},deleteComment:function(e){e.preventDefault();var self=this;var url=$(e.currentTarget).attr('href');var commentData=this._getQuoteData();var eventData=_.extend(commentData,{url:url,commentID:this._commentID});ips.ui.alert.show({type:'confirm',icon:'warn',message:ips.getString('delete_confirm'),callbacks:{ok:function(){self.trigger('deleteComment.comment',eventData);}}});},deleteCommentDone:function(e,data){if(data.commentID!=this._commentID){return;} var deleteLink=this.scope.find('[data-action="deleteComment"]');var toHide=null;var toShow=null;if(deleteLink.attr('data-hideOnDelete')){toHide=this.scope.find(deleteLink.attr('data-hideOnDelete'));}else{toHide=this.scope.closest('article');} toHide.animationComplete(function(){toHide.remove();});ips.utils.anim.go('fadeOutDown',toHide);if(deleteLink.attr('data-updateOnDelete')){$(deleteLink.attr('data-updateOnDelete')).text(parseInt($(deleteLink.attr('data-updateOnDelete')).text())-1);} if(deleteLink.attr('data-showOnDelete')){toShow=this.scope.find(deleteLink.attr('data-showOnDelete'));ips.utils.anim.go('fadeIn',toShow);} this.trigger('deletedComment.comment',{commentID:this._commentID,response:data.response});},deleteCommentError:function(e,data){if(data.commentID!=this._commentID){return;} window.location=data.url;},_prepareQuote:function(html){if(ips.getSetting('strip_quotes')==1){if(html.find('blockquote.ipsQuote')&&html.find('blockquote.ipsQuote').parent()&&html.find('blockquote.ipsQuote').parent().get(0)&&html.find('blockquote.ipsQuote').parent().get(0).tagName=='DIV'&&html.find('blockquote.ipsQuote').siblings().length==0) {var div=html.find('blockquote.ipsQuote').closest('div');div.next('p').find("br:first-child").remove();div.remove();} else {html.find('blockquote.ipsQuote').remove();}} html.find('blockquote.ipsQuote *').show();html.find('.ipsStyle_spoilerFancy,.ipsStyle_spoiler').replaceWith(ips.templates.render('core.posts.quotedSpoiler'));html.find("[data-excludequote]").remove();html.find('.ipsQuote_citation').remove();html.find('[data-quote-value]').each(function(){$(this).replaceWith('

    '+$(this).attr('data-quote-value')+'

    ');});return html;},_getQuoteData:function(){if(!this._quoteData){try{this._quoteData=$.parseJSON(this.scope.attr('data-quoteData'));return this._quoteData;}catch(err){alert(this.scope.attr('data-quoteData'));Debug.log("Couldn't parse quote data");return{};}} return this._quoteData;}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.commentFeed',{_overlay:null,_commentFeedID:0,_newRepliesFlash:null,_maximumMultiQuote:50,_pageParam:'page',_urlParams:{},_baseURL:'',_doneInitialState:false,_initialURL:'',_pollingEnabled:true,_pollingActive:false,_pollingPaused:false,_initialPoll:60000,_currentPoll:60000,_decay:20000,_maxInterval:300000,_pollingTimeout:null,_pollAjax:null,_pollOnUnpaused:false,initialize:function(){this.on('submit','[data-role="replyArea"]',this.quickReply);this.on('quoteComment.comment',this.quoteComment);this.on('addMultiQuote.comment',this.addMultiQuote);this.on('removeMultiQuote.comment deleteComment.comment',this.removeMultiQuote);this.on('click','[data-action="filterClick"]',this.filterClick);this.on('menuItemSelected','[data-action="ignoreOptions"]',this.commentIgnore);this.on('menuItemSelected','[data-role="signatureOptions"]',this.signatureOptions);this.on('editorCompatibility',this.editorCompatibility);this.on('checkedComment.comment',this.checkedComment);$(document).on('click','[data-role="multiQuote"]',_.bind(this.doMultiQuote,this));$(document).on('click','[data-action="clearQuoted"]',_.bind(this.clearMultiQuote,this));$(document).on('moderationSubmitted',this.clearLocalStorage);this.on('paginationClicked paginationJump',this.paginationClick);this.on(document,'addToCommentFeed',this.addToCommentFeed);this.on('deletedComment.comment',this.deletedComment);this.on(document,'click','[data-action="loadNewPosts"]',this.loadNewPosts);this.on(window,'statechange',this.stateChange);this.setup();},setup:function(){var self=this;var replyForm=this.scope.find('[data-role="replyArea"] form');this._commentFeedID=this.scope.attr('data-feedID');this._urlParams=this._getUrlParams();this._baseURL=this.scope.attr('data-baseURL');this._initialURL=window.location.href;if(this._baseURL.match(/\?/)){if(this._baseURL.slice(-1)!='?'){this._baseURL+='&';}}else{this._baseURL+='?';} if(replyForm.attr('data-noAjax')){this._pollingEnabled=false;} if(!_.isUndefined(this.scope.attr('data-lastPage'))&&this._pollingEnabled){this._startPolling();} $(document).ready(function(){self._setUpMultiQuote();self._findCheckedComments();});},clearLocalStorage:function(){ips.utils.db.remove('moderation',$(document).find("[data-feedID]").attr('data-feedID'));},destroy:function(){this._stopPolling();},_getUrlParams:function(){var sort=this._getSortValue();var obj={sortby:sort.by||'',sortdirection:sort.order||'',};obj[this._pageParam]=ips.utils.url.getParam(this._pageParam)||1 return obj;},_getSortValue:function(){return{by:'',order:''};},stateChange:function(){var state=History.getState();if((_.isUndefined(state.data.controller)||state.data.controller!=this.controllerID||state.data.feedID!=this._commentFeedID)){return;} this._urlParams=state.data;if(this._initialURL==state.url){this._getResults(state.url);}else{this._getResults();}},_getResults:function(url){var self=this;var fetchURL=url||this._baseURL+this._getURL();this._setLoading(true);ips.getAjax()(fetchURL,{showLoading:true}).done(_.bind(this._getResultsDone,this)).fail(_.bind(this._getResultsFail,this)).always(_.bind(this._getResultsAlways,this));},_getResultsDone:function(response){var tmpElement=$('
    '+response+'
    ').find('[data-feedID="'+this.scope.attr('data-feedID')+'"]');var newContents=tmpElement.html();tmpElement.remove();this.cleanContents();this.scope.hide().html(newContents);ips.utils.anim.go('fadeIn',this.scope);this._overlay.hide();this._setUpMultiQuote();$(document).trigger('contentChange',[this.scope]);this._findCheckedComments();},_getResultsFail:function(jqXHR,textStatus,errorThrown){if(Debug.isEnabled()){Debug.error("Ajax request failed ("+textStatus+"): "+errorThrown);Debug.error(jqXHR.responseText);}else{window.location=this._baseURL+this._getURL();}},_getResultsAlways:function(){},_setLoading:function(status){var scope=this.scope;var self=this;var commentFeed=this.scope.find('[data-role="commentFeed"]');if(status){if(!this._overlay){this._overlay=$('
    ').addClass('ipsLoading').hide();ips.getContainer().append(this._overlay);} var dims=ips.utils.position.getElemDims(commentFeed);var position=ips.utils.position.getElemPosition(commentFeed);this._overlay.show().css({left:position.viewportOffset.left+'px',top:position.viewportOffset.top+'px',width:dims.width+'px',height:dims.height+'px',position:'absolute',zIndex:ips.ui.zIndex()});commentFeed.animate({opacity:0.5});var elemPosition=ips.utils.position.getElemPosition(this.scope);$('html, body').animate({scrollTop:elemPosition.absPos.top+'px'});}else{}},paginationClick:function(e,data){data.originalEvent.preventDefault();if(data.pageNo!=this._urlParams[this._pageParam]){var urlObj=ips.utils.url.getURIObject(data.href);var queryKey=urlObj.queryKey;if(data.lastPage&&!this._pollingActive){this.scope.attr('data-lastPage',true);this._currentPoll=this._initialPoll;this._startPolling();}else if(!data.lastPage){this.scope.removeAttr('data-lastPage');this._stopPolling();} this._updateURL(queryKey);}},_updateURL:function(newParams){_.extend(this._urlParams,newParams);var tmpStateData=_.extend(_.clone(this._urlParams),{controller:this.controllerID,feedID:this._commentFeedID});History.pushState(tmpStateData,document.title,this._baseURL+this._getURL());},_getURL:function(){var tmpUrlParams={};for(var i in this._urlParams){if(this._urlParams[i]!=''&&i!='controller'&&i!='feedID'&&i!='bypassState'){tmpUrlParams[i]=this._urlParams[i];}} return $.param(tmpUrlParams);},editorCompatibility:function(e,data){if(!data.compatible){this.triggerOn('core.front.core.comment','disableQuoting.comment');}},checkedComment:function(e,data){var dataStore=ips.utils.db.get('moderation',this._commentFeedID)||{};if(data.checked){if(_.isUndefined(dataStore[data.commentID])){dataStore[data.commentID]=data.actions;}}else{delete dataStore[data.commentID];} if(_.size(dataStore)){ips.utils.db.set('moderation',this._commentFeedID,dataStore);}else{ips.utils.db.remove('moderation',this._commentFeedID);}},_findCheckedComments:function(){if(!this.scope.find('input[type="checkbox"]').length){return;} var dataStore=ips.utils.db.get('moderation',this._commentFeedID)||{};var self=this;var pageAction=this.scope.find('[data-ipsPageAction]');if(_.size(dataStore)){_.each(dataStore,function(val,key){if(self.scope.find('[data-commentID="'+key+'"]').length){self.scope.find('[data-commentID="'+key+'"] input[type="checkbox"][data-role="moderation"]').attr('checked',true).trigger('change');}else{pageAction.trigger('addManualItem.pageAction',{id:'multimod['+key+']',actions:val});}});}},signatureOptions:function(e,data){data.originalEvent.preventDefault();if(data.selectedItemID=='oneSignature'){this._ignoreSingleSignature($(e.currentTarget).attr('data-memberID'));}else{this._ignoreAllSignatures();}},_ignoreAllSignatures:function(){var self=this;var url=ips.getSetting('baseURL')+'?app=core&module=system&controller=settings&do=toggleSigs';var signatures=this.scope.find('[data-role="memberSignature"]');signatures.slideUp();ips.getAjax()(url).done(function(response){ips.ui.flashMsg.show(ips.getString('signatures_hidden'));signatures.remove();}).fail(function(){signatures.show();ips.ui.alert.show({type:'alert',icon:'warn',message:ips.getString('signatures_error'),callbacks:{}});});},_ignoreSingleSignature:function(memberID){var self=this;var url=ips.getSetting('baseURL')+'?app=core&module=system&controller=ignore&do=ignoreType&type=signatures';var signatures=this.scope.find('[data-role="memberSignature"]').find('[data-memberID="'+memberID+'"]').closest('[data-role="memberSignature"]');signatures.slideUp();ips.getAjax()(url,{data:{member_id:parseInt(memberID)}}).done(function(response){ips.ui.flashMsg.show(ips.getString('single_signature_hidden'));signatures.remove();}).fail(function(){signatures.show();ips.ui.alert.show({type:'alert',icon:'warn',message:ips.getString('single_signature_error'),callbacks:{}});});},commentIgnore:function(e,data){switch(data.selectedItemID){case'showPost':data.originalEvent.preventDefault();this._showHiddenPost(e,data);break;case'stopIgnoring':data.originalEvent.preventDefault();this._stopIgnoringFromComment(e,data);break;}},filterClick:function(e){e.preventDefault();var urlObj=ips.utils.url.getURIObject($(e.target).attr('href'));var queryKey=urlObj.queryKey;this._updateURL(queryKey);},quoteComment:function(e,data){var editorID=this.scope.find('[data-role="replyArea"] [data-role="contentEditor"]').attr('name');if(editorID){this.trigger('insertQuote',_.extend(data,{editorID:editorID}));}},windowBlur:function(e){if(this._pollingEnabled){Debug.log('Window blurred, pausing polling...');this._pollingPaused=true;}},windowFocus:function(e){if(this._pollingEnabled&&this._pollingPaused){Debug.log('Window focused...');this._pollingPaused=false;if(this._pollOnUnpaused){this._pollOnUnpaused=false;this.pollForNewReplies();}}},_startPolling:function(){var self=this;this._pollingActive=true;Debug.log('Starting polling with interval '+(this._currentPoll/1000)+'s');this._pollingTimeout=setTimeout(function(){self.pollForNewReplies();},this._currentPoll);},_stopPolling:function(){this._pollingActive=false;if(this._pollingTimeout){clearTimeout(this._pollingTimeout);}},pollForNewReplies:function(){var self=this;var replyForm=this.scope.find('[data-role="replyArea"] form');var commentsOnThisPage=this.scope.find('[data-commentid]');if(!commentsOnThisPage.length){return;} var lastSeenId=$(commentsOnThisPage[commentsOnThisPage.length-1]).attr('data-commentId');if(this._pollingPaused){Debug.log('Window blurred, delaying poll until focused...');this._pollOnUnpaused=true;return;} if(this._pollAjax&&!_.isUndefined(this._pollAjax.abort)){this._pollAjax.abort();} this._pollAjax=ips.getAjax();this._pollAjax(replyForm.attr('action'),{dataType:'json',data:'do=checkForNewReplies&type=count&lastSeenID='+lastSeenId,type:'post'}).done(function(response){if(parseInt(response.count)>0){self._currentPoll=self._initialPoll;var html='';if(parseInt(response.count)===1&&!_.isUndefined(response.photo)&&!_.isUndefined(response.name)){html=ips.templates.render('core.postNotify.single',{photo:response.photo,text:ips.getString('newPostSingle',{name:response.name})});}else{html=ips.templates.render('core.postNotify.multiple',{text:ips.pluralize(ips.getString('newPostMultiple'),[response.count])});} if($('#elFlashMessage').is(':visible')&&$('#elFlashMessage').find('[data-role="newPostNotification"]').length){$('#elFlashMessage').find('[data-role="newPostNotification"]').replaceWith(html);}else{ips.ui.flashMsg.show(html,{sticky:true,position:'bottom',extraClasses:'cPostFlash ipsPad_half'});}}else{if((self._currentPoll+self._decay)').append(data.content);var comment=content.find('.ipsComment');var commentFeed=this.scope.find('[data-role="commentFeed"]');if(commentFeed.find('[data-role="moderationTools"]').length){commentFeed=commentFeed.find('[data-role="moderationTools"]');} this.scope.find('[data-role="noComments"]').remove();commentFeed.append(comment);if(comment.find('pre.prettyprint').length){comment.find('pre.prettyprint').each(function(){$(this).html(window.PR.prettyPrintOne(_.escape($(this).text())));});} ips.utils.anim.go('fadeInDown',comment);if(_.isUndefined(data.resetEditor)||data.resetEditor!==false){this.trigger('resetEditor',{editorID:textarea.attr('name')});} if(ips.utils.db.isEnabled()){var buttons=comment.find('[data-action="multiQuoteComment"]');buttons.hide().removeClass('ipsHide');ips.utils.anim.go('fadeIn',buttons);} this._updateCount(data.totalItems);$(document).trigger('contentChange',[this.scope]);},deletedComment:function(e,data){data=$.parseJSON(data.response);var self=this;if(data.type=='redirect'){window.location=data.url;} else{this._updateCount(data.total);}},_updateCount:function(newTotal){if($(this.scope).find('[data-role="comment_count"]')){var langString='js_num_comments';if($(this.scope).find('[data-role="comment_count"]').attr('data-commentCountString')){langString=$(this.scope).find('[data-role="comment_count"]').attr('data-commentCountString');} $(this.scope).find('[data-role="comment_count"]').text(ips.pluralize(ips.getString(langString),newTotal));}},doMultiQuote:function(e){var mqData=this._getMultiQuoteData();var replyArea=this.scope.find('[data-role="replyArea"]');var editor=replyArea.find('[data-role="contentEditor"]');var editorID=editor.attr('name');var output=[];var self=this;if(!_.size(mqData)||!replyArea.is(':visible')){return;} _.each(mqData,function(value){output.push(value);});self.trigger('insertQuote',{editorID:editorID,quotes:output});this._removeAllMultiQuoted();},clearMultiQuote:function(e){e.preventDefault();this._removeAllMultiQuoted();},_removeAllMultiQuoted:function(){var mqData=this._getMultiQuoteData();var self=this;ips.utils.db.set('mq','data',{});this._buildMultiQuote(0);if(!_.size(mqData)){return;} _.each(mqData,function(value){self.triggerOn('core.front.core.comment','setMultiQuoteDisabled.comment',{contentapp:value.contentapp,contenttype:value.contenttype,contentcommentid:value.contentcommentid});});},addMultiQuote:function(e,data){var mqData=this._getMultiQuoteData();var key=data.contentapp+'-'+data.contenttype+'-'+data.contentcommentid;if(_.size(mqData)==this._maximumMultiQuote) {ips.ui.alert.show({type:'alert',icon:'warn',message:ips.pluralize(ips.getString('maxmultiquote'),this._maximumMultiQuote),callbacks:{ok:function(){$("button[data-mqId='"+data.button+"']").removeClass('ipsButton_alternate').addClass('ipsButton_simple').removeAttr('data-mqActive').html(ips.templates.render('core.posts.multiQuoteOff'));}}});return false;} mqData[key]=data;ips.utils.db.set('mq','data',mqData);this._buildMultiQuote(_.size(mqData));},removeMultiQuote:function(e,data){var mqData=this._getMultiQuoteData();var key=data.contentapp+'-'+data.contenttype+'-'+data.contentcommentid;if(!_.isUndefined(mqData[key])){mqData=_.omit(mqData,key);ips.utils.db.set('mq','data',mqData);this._buildMultiQuote(_.size(mqData));}},_getMultiQuoteData:function(){var mqData=ips.utils.db.get('mq','data');if(_.isUndefined(mqData)||!_.isObject(mqData)){return{};} return mqData;},_setUpMultiQuote:function(){if(!ips.utils.db.isEnabled()){return;} var buttons=this.scope.find('[data-action="multiQuoteComment"]');var self=this;var mqData=this._getMultiQuoteData();buttons.hide().removeClass('ipsHide');ips.utils.anim.go('fadeIn',buttons);if(_.size(mqData)){this._buildMultiQuote(_.size(mqData));_.each(mqData,function(value){self.triggerOn('core.front.core.comment','setMultiQuoteEnabled.comment',{contentapp:value.contentapp,contenttype:value.contenttype,contentcommentid:value.contentcommentid});});}},_buildMultiQuote:function(count){var quoterElem=$('#ipsMultiQuoter');if(!quoterElem.length&&count){ips.getContainer().append(ips.templates.render('core.posts.multiQuoter',{count:ips.getString('multiquote_count',{count:ips.pluralize(ips.getString('multiquote_count_plural'),[count])})}));ips.utils.anim.go('zoomIn fast',$('#ipsMultiQuoter'));}else{quoterElem.find('[data-role="quotingTotal"]').text(ips.pluralize(ips.getString('multiquote_count_plural'),[count]));if(count&"erElem.is(':visible')){ips.utils.anim.go('pulseOnce fast',quoterElem);}else if(count&&!quoterElem.is(':visible')){ips.utils.anim.go('zoomIn fast',quoterElem);}else{ips.utils.anim.go('zoomOut fast',quoterElem);}}},_showHiddenPost:function(e,data){var ignoreRow=$(data.triggerElem).closest('.ipsComment_ignored');var commentID=ignoreRow.attr('data-ignoreCommentID');var comment=this.scope.find('#'+commentID);ignoreRow.remove();comment.removeClass('ipsHide');},_stopIgnoringFromComment:function(e,data){var ignoreRow=$(data.triggerElem).closest('.ipsComment_ignored');var userID=ignoreRow.attr('data-ignoreUserID');var self=this;var posts=this.scope.find('[data-ignoreUserID="'+userID+'"]');posts.each(function(){self.scope.find('#'+$(this).attr('data-ignoreCommentID')).removeClass('ipsHide');$(this).remove();});var url=ips.getSetting('baseURL')+'?app=core&module=system&controller=ignore&do=ignoreType&type=topics&off=1';ips.getAjax()(url,{data:{member_id:parseInt(userID)}}).done(function(){ips.ui.flashMsg.show(ips.getString('ignore_prefs_updated'));}).fail(function(){window.location=ips.getSetting('baseURL')+'?app=core&module=system&controller=ignore&do=ignoreType&off=1type=topics&member_id='+userID;});}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.commentsWrapper',{initialize:function(){this.on(document,'addToCommentFeed',this.addToCommentFeed);this.on('deletedComment.comment',this.deletedComment);},addToCommentFeed:function(e,data){this._updateCount($(e.target).attr('data-commentsType'),data.totalItems);},deletedComment:function(e,data){this._updateCount($(e.target).closest('[data-commentsType]').attr('data-commentsType'),data.newTotal);},_updateCount:function(type,number){var langString='js_num_'+type;var elem=$('#'+$(this.scope).attr('data-tabsId')+'_tab_'+type);elem.text(ips.pluralize(ips.getString(langString),number));}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.lightboxedImages',{_random:null,initialize:function(){this.on('initializeImages',this.initializeImages);this.setup();},setup:function(){this._random='g'+(Math.round(Math.random()*100000));this._initializeImages();},initializeImages:function(){this._initializeImages();},_initializeImages:function(){var self=this;this.scope.find('img').imagesLoaded(function(images){images.each(function(i,image){if(image.width>=image.naturalWidth&&!$(image).hasClass('ipsImage_thumbnailed')){return;} image=$(image);image.addClass('ipsImage_thumbnailed');if(image.closest('a').length&&image.closest('a').hasClass('ipsAttachLink')&&image.closest('a').hasClass('ipsAttachLink_image')){if(!ips.utils.responsive.enabled()||!ips.utils.responsive.currentIs('phone')){image.closest('a').attr('data-fullURL',image.closest('a').attr('src')).attr('data-ipsLightbox','').attr('data-ipsLightbox-group',self._random);}}else{if(!image.closest('a').length){if(ips.utils.responsive.enabled()&&ips.utils.responsive.currentIs('phone')){image.wrap($(""));}else{image.wrap($(""));}}}});});}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.loginMenu',{initialize:function(){this.on('success.validation','form',this.doSignIn);},doSignIn:function(e){e.preventDefault();var form=this.scope.find('form');var url=form.attr('action');this._loading(true);ips.getAjax()(url,{type:'post',data:form.serialize(),dataType:'json'}).done(function(response){window.location.reload();}).fail(function(jqXHR,textStatus,errorThrown){Debug.log(textStatus);});},_loading:function(doLoading){var dims={width:this.scope.outerWidth(),height:this.scope.outerHeight()};this.scope.css({height:dims.height+'px',width:dims.width+'px'}).addClass('ipsLoading').find('[data-role="loginForm"]').hide();}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.markRead',{initialize:function(){this.on('click',this.markSiteRead);},markSiteRead:function(e){e.preventDefault();ips.ui.alert.show({type:'confirm',icon:'question',message:ips.getString('markAsReadConfirm'),subText:'',callbacks:{ok:function(){var url=ips.getSetting('baseURL')+'?app=core&module=system&controller=markread';ips.getAjax()(url,{showLoading:true}).done(function(){$(document).trigger('markAllRead');}).fail(function(jqXHR,textStatus,errorThrown){window.location=ipsSettings.baseURL+url;});}}});}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.mobileNav',{initialize:function(){this.on('click','[data-action="mobileSearch"]',this.mobileSearch);},mobileSearch:function(e){e.preventDefault();$('body').toggleClass('cSearchOpen');}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.navBar',{initialize:function(){this.on(window,'resize',this.resizeWindow);if($('body').attr('data-controller').indexOf('core.global.customization.visualLang')==-1){this.setup();}else{var self=this;$('body').on('vleDone',function(){self.setup();});}},setup:function(){this._mushMenu();},resizeWindow:function(){this._mushMenu();},_mushMenu:function(){var availableSpace=this.scope.outerWidth()-this.scope.find('#elSearch').outerWidth();var moreItem=this.scope.find('[data-role="navMore"]');var moreMenuSize=moreItem.outerWidth();var menuItems=this.scope.find('[data-role="navItem"]');var sizeIncrem=0;if(!moreItem.is(':visible')){moreMenuSize=moreItem.removeClass('ipsHide').outerWidth();moreItem.addClass('ipsHide');} menuItems.each(function(){var item=$(this);var itemSize=0;if(item.attr('data-originalWidth')){itemSize=parseInt(item.attr('data-originalWidth'));}else{var o=item.outerWidth();item.attr('data-originalWidth',o);itemSize=o;} if((sizeIncrem+itemSize+moreMenuSize)>availableSpace){if(!item.attr('data-mushed')){var newLI=$('
  • ').attr('data-originalItem',item.identify().attr('id')).addClass('ipsMenu_item').append(item.contents());if(newLI.find('.ipsMenu').length){newLI.addClass('ipsMenu_subItems');} $('#elNavigationMore_dropdown_menu').append(newLI);item.addClass('ipsHide').attr('data-mushed',true);}}else if(item.attr('data-mushed')){var mushedItem=$('#elNavigationMore_dropdown_menu').find('[data-originalItem="'+item.identify().attr('id')+'"]');if(mushedItem.length){item.append(mushedItem.contents()).removeClass('ipsHide');mushedItem.remove();} item.removeAttr('data-mushed');} sizeIncrem+=itemSize;});moreItem.toggleClass('ipsHide',!$('#elNavigationMore_dropdown_menu').find('> li').length);}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.pagination',{initialize:function(){this.on('paginationClicked paginationJump',this.paginationClick);},paginationClick:function(e,data){var self=this;if(!data.href){return;} ips.getAjax()(data.href).done(function(response){self.scope.hide().html(response);ips.utils.anim.go('fadeIn',self.scope);}).fail(function(){window.location=data.href;});}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.quickSearch',{_initialSize:0,_expanded:false,_blurTimeout:null,_focused:false,initialize:function(){this.on('focus','#elSearchField',this.focusSearch);this.on('blur','#elSearchField',this.blurSearch);this.on('menuItemSelected','#elSearchFilter',this.menuItemSelected);this.on(document,'menuOpened',this.menuOpened);this.setup();},setup:function(){this._expanded=false;},menuItemSelected:function(e,data){if(!data.selectedItemID){return;} data.originalEvent.preventDefault();for(var i in data.selectedItems) {var selectedItem=$('#'+i);} var form=this.scope.find('form');var title=selectedItem.find('a').html();this.scope.find('[data-role="searchingIn"]').text(title);this.scope.find('[data-role="searchFilter"]').remove();if(data.selectedItemID!='all'){var options=selectedItem.attr('data-options');if(!options){form.append($('').attr('type','hidden').attr('name','type').attr('value',data.selectedItemID).attr('data-role','searchFilter'));return;} try{options=$.parseJSON(options);_.each(options,function(val,i){form.append($('').attr('type','hidden').attr('name',i).attr('value',val).attr('data-role','searchFilter'));});}catch(err){Debug.log('Invalid search options json');return;}}},focusSearch:function(e){if(this._expanded){return;} $('#elSearch').addClass('cSearchExpanded');ips.utils.anim.go('fadeIn',$('#elSearchFilter'));var scope=$(this.scope);ips.getAjax()(ips.getSetting('baseURL')+'?app=core&module=search&controller=search&do=globalFilterOptions').done(function(response){scope.find('[data-role="globalSearchMenuOptions"]').replaceWith(response);});this._expanded=true;},blurSearch:function(){var self=this;this._blurTimeout=setTimeout(function(){self._cancelSearch();},500);},_cancelSearch:function(){if(ips.utils.responsive.currentIs('phone')){ips.utils.anim.go('fadeIn fast',$('#elHeaderNavigation'));} $('#elSearch').removeClass('cSearchExpanded');ips.utils.anim.go('fadeOut fast',$('#elSearchFilter'));this._expanded=false;},menuOpened:function(e,data){Debug.log(data.elemID);if(data.elemID=='elSearchFilter'){clearTimeout(this._blurTimeout);}}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.rating',{initialize:function(){this.on('ratingSaved','[data-ipsRating]',this.ratingClick);var scope=this.scope;},ratingClick:function(e,data){var scope=$(this.scope);ips.getAjax()(scope.attr('action'),{data:scope.serialize(),type:'post'}).done(function(response,textStatus,jqXHR){}).fail(function(){scope.submit();});}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.reputation',{initialize:function(){this.on('click','[data-action="giveReputation"]',this.giveReputation);},giveReputation:function(e){e.preventDefault();var self=this;var url=$(e.currentTarget).attr('href');var thisParent=this.scope.parent();this.scope.css({opacity:0.5});ips.getAjax()(url).done(function(response){var newHTML=$('
    '+response+'
    ').find('[data-controller="core.front.core.reputation"]').html();self.scope.html(newHTML).css({opacity:1});}).fail(function(jqXHR,textStatus,errorThrown){if(jqXHR.responseJSON['error']){ips.ui.alert.show({type:'alert',icon:'warn',message:jqXHR.responseJSON['error'],callbacks:{}});}else{window.location=url;}});}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.sharelink',{initialize:function(){this.on('click','[data-role="shareLink"]',this.launchWindow);},launchWindow:function(e){e.preventDefault();var url=$(e.currentTarget).attr('href');if(!ips.utils.url.getParam('url',url)) {url+="&url="+encodeURIComponent(location.href);} if(!ips.utils.url.getParam('title',url)) {url+="&title="+encodeURIComponent(document.title);} window.open(url,'delicious','toolbar=no,width=550,height=550');},});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.statuses',{initialize:function(){this._hideReplyFields();this.on('click','[data-action="delete"]',this.deleteStatus);this.on('click','[data-action="lock"]',this.lockStatus);this.on('click','[data-action="unlock"]',this.unlockStatus);this.on('click','[data-action="reply"]',this.replyStatus);this.on('click','[data-action="loadPreviousComments"]',this.loadPrevious);this.on('blur','[data-role="replyComment"] input[type="text"]',this.blurCommentField);this.on('keydown','[data-role="replyComment"] input[type="text"]',this.keydownCommentField);this.on(document,'lockingStatus',this.togglingStatus);this.on(document,'lockedStatus',this.lockedStatus);this.on(document,'unlockingStatus',this.togglingStatus);this.on(document,'unlockedStatus',this.unlockedStatus);this.on(document,'deletingStatus deletingComment',this.deletingStatus);this.on(document,'deletedStatus deletedComment',this.deletedStatus);this.on(document,'loadingComments',this.loadingComments);this.on(document,'loadedComments',this.loadedComments);this.on(document,'addingComment',this.addingComment);this.on(document,'addedComment',this.addedComment);},_requestCount:{},_offsets:{},_hideReplyFields:function(){$(this.scope).find('[data-statusid]').not('.ipsComment_hasChildren').find('.ipsComment_subComments').hide().end().end().find('[data-role="submitReply"]').hide();},loadPrevious:function(e){e.preventDefault();var link=$(e.currentTarget),statusElem=link.parents('[data-statusid]'),statusID=$(statusElem).data('statusid');this._offsets[statusID]=(statusElem.find('[data-commentid]').length)*-1;this.trigger('loadComments',{statusID:statusID,offset:this._offsets[statusID]});},loadingComments:function(e,data){var status=$(this.scope).find('[data-statusid="'+data.statusID+'"]');status.find('[data-action="loadPreviousComments"]').html(ips.templates.render('core.statuses.loadingComments'));},loadedComments:function(e,data){var status=$(this.scope).find('[data-statusid="'+data.statusID+'"]'),loadingRow=status.find('[data-action="loadPreviousComments"]');loadingRow.after(data.comments);var totalShown=status.find('[data-commentid]').length;if(data.total<=totalShown){loadingRow.remove();}else{loadingRow.html(ips.templates.render('core.statuses.loadMore')).find("[data-role='remainingCount']").text(data.total-totalShown);} $(document).trigger('contentChange',[status]);},deleteStatus:function(e){e.preventDefault();var link=$(e.currentTarget),statusElem=link.parents('[data-statusid]'),commentElem=link.parents('[data-commentid]'),statusID=$(statusElem).data('statusid'),commentID=$(commentElem).data('commentid');if(commentElem){if(confirm(ips.getString('confirmStatusCommentDelete'))){this.trigger('deleteComment',{statusID:statusID,commentID:commentID});}}else{if(confirm(ips.getString('confirmStatusDelete'))){this.trigger('deleteStatus',{statusID:statusID});}}},deletingStatus:function(e,data){if(data.commentID){$(this.scope).find('[data-commentid="'+data.commentID+'"]').animate({opacity:0.5});}else{$(this.scope).find('[data-statusid="'+data.statusID+'"]').animate({opacity:0.5});}},deletedStatus:function(e,data){if(data.commentID){$(this.scope).find('[data-commentid="'+data.commentID+'"]').remove();}else{$(this.scope).find('[data-statusid="'+data.statusID+'"]').remove();}},lockStatus:function(e){e.preventDefault();var link=$(e.currentTarget),statusElem=link.parents('[data-statusid]'),statusID=$(statusElem).data('statusid');this.trigger('lockStatus',{statusID:statusID});},unlockStatus:function(e){e.preventDefault();var link=$(e.currentTarget),statusElem=link.parents('[data-statusid]'),statusID=$(statusElem).data('statusid');this.trigger('unlockStatus',{statusID:statusID});},lockedStatus:function(e,data){var status=$(this.scope).find('[data-statusid="'+data.statusID+'"]');$(status).find('[data-action="lock"]').first().replaceWith(ips.templates.render('core.statuses.unlock'));this._finishedAction(e,data);},unlockedStatus:function(e,data){var status=$(this.scope).find('[data-statusid="'+data.statusID+'"]');$(status).find('[data-action="unlock"]').first().replaceWith(ips.templates.render('core.statuses.lock'));this._finishedAction(e,data);},togglingStatus:function(e,data){var status=$(this.scope).find('[data-statusid="'+data.statusID+'"]'),loadingThingy=status.find('.cStatusTools_loading');if(!loadingThingy.length){status.find('.cStatusTools').first().append(ips.templates.render('core.statuses.statusAction'));}else{loadingThingy.show();} if(!this._requestCount[data.statusID]){this._requestCount[data.statusID]=1;}else{this._requestCount[data.statusID]++;}},_finishedAction:function(e,data){var status=$(this.scope).find('[data-statusid="'+data.statusID+'"]'),loadingThingy=status.find('.cStatusTools_loading');this._requestCount[data.statusID]--;if(this._requestCount[data.statusID]==0){loadingThingy.remove();}},replyStatus:function(e){e.preventDefault();var link=$(e.currentTarget),statusElem=link.parents('[data-statusid]');if(statusElem.find('[data-commentid]').length>0){statusElem.find('[data-role="replyComment"] input[type="text"]').focus();return;} Debug.log(statusElem.find('.ipsComment_subComments').is(':visible'));if(!statusElem.find('.ipsComment_subComments').is(':visible')){ips.utils.anim.go('fadeIn',statusElem.find('.ipsComment_subComments'));statusElem.addClass('ipsComment_hasChildren').find('[data-role="replyComment"] input[type="text"]').focus();}else{if(statusElem.find('[data-commentid]').length==0&&field.val()==''){statusElem.removeClass('ipsComment_hasChildren').find('.ipsComment_subComments, [data-role="submitReply"]').hide();}}},blurCommentField:function(e){e.preventDefault();var field=$(e.currentTarget),statusElem=field.parents('[data-statusid]'),replyButton=statusElem.find('[data-role="submitReply"]');if(statusElem.find('[data-commentid]').length==0&&field.val()==''){statusElem.removeClass('ipsComment_hasChildren').find('.ipsComment_subComments').hide();}},keydownCommentField:function(e){var field=$(e.currentTarget),statusElem=field.parents('[data-statusid]'),statusID=statusID=$(statusElem).data('statusid');if(e.keyCode==ips.ui.key.ENTER){this.trigger('addComment',{content:field.val(),statusID:statusID});}},addingComment:function(e,data){var statusElem=$(this.scope).find('[data-statusid="'+data.statusID+'"]'),replyRow=statusElem.find('[data-role="replyComment"]');replyRow.find('input[type="text"]').prop('disabled',true).addClass('ipsField_disabled');},addedComment:function(e,data){var statusElem=$(this.scope).find('[data-statusid="'+data.statusID+'"]'),replyRow=statusElem.find('[data-role="replyComment"]'),subComments=statusElem.find('.ipsComment_subComments');if(replyRow.length){replyRow.before(data.comment);}else if(subComments.length){subComments.append(data.comment);} statusElem.find('[data-role="replyComment"] input[type="text"]').val('').blur().prop('disabled',false).removeClass('ipsField_disabled');},});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('core.front.core.userbar',{loaded:{},initialize:function(){this.on(document,'menuOpened',this.menuOpened);},menuOpened:function(e,data){if(data.elemID=='elFullInbox'||data.elemID=='elMobInbox'){this._loadMenu('inbox',ips.getSetting('baseURL')+'?app=core&module=messaging&controller=messenger&overview=1','inbox');}else if(data.elemID=='elFullNotifications'||data.elemID=='elMobNotifications'){this._loadMenu('notify',ips.getSetting('baseURL')+'?app=core&module=system&controller=notifications','notify');}else if(data.elemID=='elFullReports'||data.elemID=='elMobReports'){this._loadMenu('reports',ips.getSetting('baseURL')+'?app=core&module=modcp&controller=modcp&tab=reports&overview=1','reports');}},_loadMenu:function(type,url,contentID){if(!this.loaded[type]){var self=this;var ajaxObj=ips.getAjax();$('[data-role="'+contentID+'List"]').css({height:'100px'}).addClass('ipsLoading');ajaxObj(url,{dataType:'json'}).done(function(returnedData){$('[data-role="'+contentID+'List"]').css({height:'auto'}).removeClass('ipsLoading').html(returnedData.data);self.loaded[type]=true;if(contentID!='reports'){ips.utils.anim.go('fadeOut',$('[data-notificationType="'+contentID+'"]'));} $(document).trigger('contentChange',[$('[data-role="'+contentID+'List"]')]);}).fail(function(){});}}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.model.register('core.comment',{initialize:function(){this.on('getEditForm.comment',this.getEditForm);this.on('saveEditComment.comment',this.saveEditComment);this.on('deleteComment.comment',this.deleteComment);this.on('newComment.comment',this.newComment);this.on('approveComment.comment',this.approveComment);},getEditForm:function(e,data){this.getData({url:data.url,dataType:'html',data:{url:data.url},events:'getEditForm',namespace:'comment'},data);},saveEditComment:function(e,data){var url=data.url;this.getData({url:data.url,dataType:'html',type:'post',data:data.form||{},events:'saveEditComment',namespace:'comment'},data);},approveComment:function(e,data){this.getData({url:data.url,dataType:'html',data:data.form||{},events:'approveComment',namespace:'comment'},data);},deleteComment:function(e,data){this.getData({url:data.url,dataType:'html',data:data.form||{},events:'deleteComment',namespace:'comment'},data);},newComment:function(e,data){this.getData({url:data.url,dataType:'json',data:data.form||{},events:'newComment',namespace:'comment'},data);}});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.mixin('contentListing','core.global.core.table',true,function(){this.after('initialize',function(){this.on('menuItemSelected','[data-role="sortButton"]',this.changeSorting);this.on('change','[data-role="moderation"]',this.selectRow);this.on('click','[data-action="markAsRead"]',this.markAsRead);this.on('paginationClicked',this.frontPaginationClicked);this.on('markTableRead',this.markAllRead);$(document).on('markTableRowRead',_.bind(this.markRowRead,this));$(document).on('markAllRead',_.bind(this.markAllRead,this));});this.after('setup',function(){this._tableID=this.scope.attr('data-tableID');});this.before('_getResults',function(){this._setTableLoading(true);});this.after('_getResultsAlways',function(){this._setTableLoading(false);});this.after('_updateTable',function(){this.scope.find('[data-ipsPageAction]').trigger('refresh.pageAction');});this.markAllRead=function(){this.scope.find('.ipsDataItem, .ipsDataItem_subList .ipsDataItem_unread').removeClass('ipsDataItem_unread').find('.ipsItemStatus').addClass('ipsItemStatus_read');},this.markRowRead=function(e,data){if(_.isUndefined(data.tableID)||data.tableID!=this._tableID){return;} this.scope.find('[data-rowID="'+data.rowID+'"]').removeClass('ipsDataItem_unread').find('.ipsItemStatus').addClass('ipsItemStatus_read');},this.frontPaginationClicked=function(){var elemPosition=ips.utils.position.getElemPosition(this.scope);$('html, body').animate({scrollTop:elemPosition.absPos.top+'px'});};this.selectRow=function(e){var row=$(e.currentTarget).closest('.ipsDataItem');row.toggleClass('ipsDataItem_selected',$(e.currentTarget).is(':checked'));};this.markAsRead=function(e){e.preventDefault();var self=this;var item=$(e.currentTarget);var url=item.attr('href');var row=item.closest('.ipsDataItem');row.removeClass('ipsDataItem_unread').find('.ipsItemStatus').addClass('ipsItemStatus_read');row.find('.ipsDataItem_subList .ipsDataItem_unread').removeClass('ipsDataItem_unread');ips.utils.anim.go('fadeOut',$('#ipsTooltip'));item.removeAttr('data-ipstooltip').removeAttr('title');ips.getAjax()(url,{bypassRedirect:true}).done(function(response){item.trigger('markedAsRead');}).fail(function(){item.closest('.ipsDataItem').addClass('ipsDataItem_unread').find('.ipsItemStatus').removeClass('ipsItemStatus_read');ips.ui.alert.show({type:'alert',icon:'error',message:ips.getString('errorMarkingRead'),callbacks:{ok:function(){}}});});};this._setTableLoading=function(loading){var rows=this.scope.find('[data-role="tableRows"]');if(!rows.length){return;} if(!this._tableOverlay){this._tableOverlay=$('
    ').addClass('ipsLoading').hide();ips.getContainer().append(this._tableOverlay);} if(loading){var dims=ips.utils.position.getElemDims(rows);var position=ips.utils.position.getElemPosition(rows);this._tableOverlay.show().css({left:position.viewportOffset.left+'px',top:position.viewportOffset.top+'px',width:dims.width+'px',height:dims.height+'px',position:'absolute',zIndex:ips.ui.zIndex()});rows.css({opacity:0.5});}else{rows.animate({opacity:1});this._tableOverlay.hide();}};this.changeSorting=function(e,data){data.originalEvent.preventDefault();var current=this._getSortValue();var menuItem=data.menuElem.find('[data-ipsMenuValue="'+data.selectedItemID+'"]');var sortBy=data.selectedItemID;var sortDirection=current.order;if(menuItem.attr('data-sortDirection')){sortDirection=menuItem.attr('data-sortDirection');} this.updateURL({sortby:sortBy,sortdirection:sortDirection,page:1});};this._updateFilter=function(newFilter){};this._getSortValue=function(){var by=ips.utils.url.getParam('sortby');var order=ips.utils.url.getParam('sortdirection');return{by:by||'',order:order||''};};this._getFilterValue=function(){var filter=ips.utils.url.getParam('filter');return filter||'';};});}(jQuery,_));; [1] => front.js [2] => global [3] => root ) ) [4] => Array ( [file] => /home/active/general/soompi/fr/system/Output/Javascript/Javascript.php [line] => 717 [function] => _writeJavascriptFromResultset [class] => IPS\Output\_Javascript [type] => :: [args] => Array ( [0] => Array ( [60] => Array ( [javascript_id] => 60 [javascript_plugin] => [javascript_type] => controller [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.app.js - Front end app controller * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.register('core.front.core.app', { initialize: function () { this.on( 'click', 'a[data-confirm]', this.confirmSomething ); this.setup(); }, /** * Setup method for the front app * * @returns {void} */ setup: function () { // Add a classname to the document for js purposes this.scope.addClass('ipsJS_has').removeClass('ipsJS_none'); if ( !ips.utils.events.isTouchDevice() ) { this.scope.addClass('ipsApp_noTouch'); } // Timezone detection if( typeof jstz !== 'undefined' ) { ips.utils.cookie.set( 'ipsTimezone', jstz.determine().name() ); } // Inline message popup // Create a dialog if it exists if( $('#elInlineMessage').length ){ var dialogRef = ips.ui.dialog.create({ showFrom: '#inbox', content: '#elInlineMessage', title: $('#elInlineMessage').attr('title') }); // Leave a little time setTimeout( function () { dialogRef.show(); }, 800); } // Open external links in a new window if ( ips.getSetting('links_external') ) { this.scope.find('a[rel*="external"]').each( function( index, elem ){ elem.target = "_blank"; }) } // Set up prettyprint prettyPrint(); }, /** * Prompts the user to confirm an action * * @param {event} e Event object * @returns {void} */ confirmSomething: function (e) { e.preventDefault(); var elem = $( e.currentTarget ); var customMessage = $( e.currentTarget ).attr('data-confirmMessage'); var subMessage = $( e.currentTarget ).attr('data-confirmSubMessage'); ips.ui.alert.show( { type: 'confirm', icon: 'warn', message: ( customMessage ) ? customMessage : ips.getString('generic_confirm'), subText: ( subMessage ) ? subMessage : '', callbacks: { ok: function () { window.location = elem.attr('href'); } } }); }, }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => controllers/core [javascript_location] => front [javascript_position] => 1000050 [javascript_name] => ips.core.app.js [javascript_key] => ) [62] => Array ( [javascript_id] => 62 [javascript_plugin] => [javascript_type] => controller [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.autoSizeIframe.js - Controller to automatically adjust the height of an iframe * * Author: Mark Wade */ ;( function($, _, undefined){ "use strict"; ips.controller.register('core.front.core.autoSizeIframe', { initialize: function () { this.on( 'load', this.resizeFrame ); }, /** * Event handler to resize frame * * @param {event} e Event object * @returns {void} */ resizeFrame: function (e) { // I know this seems bad, but there's no easy way to detect when the iframe's contents have loaded setTimeout( function(){ e.target.style.height = e.target.contentWindow.document.body.scrollHeight + 'px'; e.target.style.overflow = 'hidden'; e.target.scrolling = "no"; e.target.seamless = "seamless"; }, 1500 ); } }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => controllers/core [javascript_location] => front [javascript_position] => 1000050 [javascript_name] => ips.core.autoSizeIframe.js [javascript_key] => ) [63] => Array ( [javascript_id] => 63 [javascript_plugin] => [javascript_type] => controller [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.comment.js - General controller for comments * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.register('core.front.core.comment', { _quoteData: null, _commentContents: '', initialize: function () { // Events from within scope this.on( 'click', '[data-action="editComment"]', this.editComment ); this.on( 'click', '[data-action="cancelEditComment"]', this.cancelEditComment ); this.on( 'click', '[data-action="deleteComment"]', this.deleteComment ); this.on( 'click', '[data-action="approveComment"]', this.approveComment ); this.on( 'click', '[data-action="quoteComment"]', this.quoteComment ); this.on( 'click', '[data-action="multiQuoteComment"]', this.multiQuoteComment ); this.on( 'click', '[data-action="rateReview"]', this.rateReview ); this.on( 'click', 'button[type="submit"]', this.submitEdit ); this.on( 'change', 'input[type="checkbox"][data-role="moderation"]', this.commentCheckbox ); // Events sent down by the commentFeed controller this.on( 'setMultiQuoteEnabled.comment setMultiQuoteDisabled.comment', this.setMultiQuote ); this.on( 'disableQuoting.comment', this.disableQuoting ); // Model events that are handled all at once this.on( document, 'getEditFormLoading.comment saveEditCommentLoading.comment ' + 'deleteCommentLoading.comment', this.commentLoading ); this.on( document, 'getEditFormDone.comment saveEditCommentDone.comment ' + 'deleteCommentDone.comment', this.commentDone ); // Model events this.on( document, 'getEditFormDone.comment', this.getEditFormDone ); this.on( document, 'getEditFormError.comment', this.getEditFormDone ); //--- this.on( document, 'saveEditCommentDone.comment', this.saveEditCommentDone ); this.on( document, 'saveEditCommentError.comment', this.saveEditCommentError ); //--- this.on( document, 'deleteCommentDone.comment', this.deleteCommentDone ); this.on( document, 'deleteCommentError.comment', this.deleteCommentError ); //--- this.on( document, 'approveCommentLoading.comment', this.approveCommentLoading ); this.on( document, 'approveCommentDone.comment', this.approveCommentDone ); this.on( document, 'approveCommentError.comment', this.approveCommentError ); this.setup(); }, /** * Setup method for comments * * @returns {void} */ setup: function () { this._commentID = this.scope.attr('data-commentID'); var id = this._commentID; }, destroy: function () { // -- }, /** * Triggered when the moderation checkbox is changed * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ commentCheckbox: function (e) { var checked = $( e.currentTarget ).is(':checked'); this.scope.closest('.ipsComment').toggleClass( 'ipsComment_selected', checked ); this.trigger('checkedComment.comment', { commentID: this._commentID, actions: $( e.currentTarget ).attr('data-actions'), checked: checked }); }, /** * The comment feed has told us we can't support quoting * * @returns {void} */ disableQuoting: function () { this.scope.find('[data-ipsQuote-editor]').remove(); }, /** * Event handler for the Helpful/Unhelpful buttons. * * @param {event} e Event object * @returns {void} */ rateReview: function (e) { e.preventDefault(); var scope = this.scope ips.getAjax()( $( e.currentTarget ).attr('href') ) .done(function(response){ scope.parent().replaceWith( $(response) ); }) .fail(function(err){ window.location = $( e.currentTarget ).attr('href'); }); }, /** * Event fired on this controller by a core.commentFeed controller to tell us which * multiquote buttons are enabled presently. Here we check whether this applies to us, and toggle * the button if so. * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ setMultiQuote: function (e, data) { var selector = '[data-commentApp="' + data.contentapp + '"]'; selector += '[data-commentType="' + data.contenttype + '"]'; selector += '[data-commentID="' + data.contentcommentid + '"]'; if( this.scope.is( selector ) ){ if( !_.isNull( e ) && e.type == 'setMultiQuoteEnabled') { this.scope.find('[data-action="multiQuoteComment"]') .removeClass('ipsButton_simple') .addClass('ipsButton_alternate') .attr( 'data-mqActive', true ) .html( ips.templates.render('core.posts.multiQuoteOn') ); } else if( _.isNull( e ) || e.type == 'setMultiQuoteDisabled' ) { this.scope.find('[data-action="multiQuoteComment"]') .addClass('ipsButton_simple') .removeClass('ipsButton_alternate') .removeAttr( 'data-mqActive' ) .html( ips.templates.render('core.posts.multiQuoteOff') ); } } }, /** * Event handler for the Quote button. Triggers a quoteComment event for the * commentFeed controller to handle. * * @param {event} e Event object * @returns {void} */ quoteComment: function (e) { e.preventDefault(); if( !this._getQuoteData() ){ Debug.error("Couldn't get quote data"); return; } var html = this._prepareQuote( $('
    ').html( this.scope.find('[data-role="commentContent"]').html() ) ); Debug.log( this._commentID ); // Send the event up the chain to the commentFeed controller for handling this.trigger( 'quoteComment.comment', { userid: this._quoteData.userid, username: this._quoteData.username, timestamp: this._quoteData.timestamp, contentapp: this._quoteData.contentapp, contenttype: this._quoteData.contenttype, contentclass: this._quoteData.contentclass, contentid: this._quoteData.contentid, contentcommentid: this._quoteData.contentcommentid, quoteHtml: html.html() }); }, /** * MultiQuote comment handler * * @param {event} e Event object * @returns {void} */ multiQuoteComment: function (e) { e.preventDefault(); if( !this._getQuoteData() ){ Debug.error("Couldn't get quote data"); return; } var button = $( e.currentTarget ); var mqActive = button.attr('data-mqActive'); var html = this._prepareQuote( $('
    ').html( this.scope.find('[data-role="commentContent"]').html() ) ); this.trigger( ( mqActive ) ? 'removeMultiQuote.comment' : 'addMultiQuote.comment', { userid: this._quoteData.userid, username: this._quoteData.username, timestamp: this._quoteData.timestamp, contentapp: this._quoteData.contentapp, contenttype: this._quoteData.contenttype, contentclass: this._quoteData.contentclass, contentid: this._quoteData.contentid, contentcommentid: this._quoteData.contentcommentid, quoteHtml: html.html(), button: button.attr('data-mqId') }); if( mqActive ){ button .removeClass('ipsButton_alternate') .addClass('ipsButton_simple') .removeAttr('data-mqActive') .html( ips.templates.render('core.posts.multiQuoteOff') ); } else { button .removeClass('ipsButton_simple') .addClass('ipsButton_alternate') .attr( 'data-mqActive', true ) .html( ips.templates.render('core.posts.multiQuoteOn') ); } }, /** * Edit comment handler * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ editComment: function (e) { e.preventDefault(); this._commentContents = this.scope.find('[data-role="commentContent"]').html(); var url = $( e.currentTarget ).attr('href'); this.trigger( 'getEditForm.comment', { url: url, commentID: this._commentID }); }, /** * Called when a cancel link is clicked * * @param {event} e Event object * @returns {void} */ cancelEditComment: function (e) { e.preventDefault(); var self = this; ips.ui.alert.show( { type: 'confirm', icon: 'warn', message: ips.getString('generic_confirm'), subText: '', callbacks: { ok: function () { self.scope.find('[data-role="commentContent"]').html( self._commentContents ); self.scope.find('[data-role="commentControls"], [data-action="expandTruncate"]').show(); } } }); }, /** * Called when a comment edit button is clicked * * @param {event} e Event object * @returns {void} */ submitEdit: function (e) { e.preventDefault(); var instance; var empty = false; for( instance in CKEDITOR.instances ){ CKEDITOR.instances[ instance ].updateElement(); } var postBody = $.trim( CKEDITOR.instances['comment_value'].editable().getData().replace( / /g, '' ) ); if( postBody == '' || postBody.match( /^

    (

    |<\/p>|\s)*<\/p>$/ ) ){ ips.ui.alert.show( { type: 'alert', icon: 'warn', message: ips.getString('cantEmptyEdit'), subText: ips.getString('cantEmptyEditDesc') }); return; } var form = this.scope.find('form'); var url = form.attr('action'); var data = form.serialize(); this.trigger( 'saveEditComment.comment', { form: data, url: url, commentID: this._commentID }); }, /** * Model event: something is loading * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ commentLoading: function (e, data) { if( data.commentID != this._commentID ){ return; } ips.utils.anim.go( 'fadeIn', this.scope.find('[data-role="commentLoading"]').removeClass('ipsHide') ); }, /** * Model event: something is done loading * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ commentDone: function (e, data) { if( data.commentID != this._commentID ){ return; } this.scope.find('[data-role="commentLoading"]').addClass('ipsHide'); }, /** * Model event: edit form has loaded * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ getEditFormDone: function (e, data) { if( data.commentID != this._commentID ){ return; } this.scope.find('[data-action="expandTruncate"], [data-role="commentControls"]').hide(); this.scope.find('[data-role="commentContent"]').html( data.response ); $( document ).trigger( 'contentChange', [ this.scope.find('[data-role="commentContent"]') ] ); }, /** * Model event: error loading edit form * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ getEditFormError: function (e, data) { if( data.commentID != this._commentID ){ return; } window.location = data.url; }, /** * Model event: saving an edit is finished * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ saveEditCommentDone: function (e, data) { if( data.commentID != this._commentID ){ return; } this.scope.find('[data-role="commentContent"]').replaceWith( $('

    ' + data.response + '
    ').find('[data-role="commentContent"]') ); this.scope.trigger('initializeImages'); this.scope.find('[data-action="expandTruncate"], [data-role="commentControls"]').show(); $( document ).trigger( 'contentChange', [ this.scope ] ); }, /** * Model event: saving an edit failed * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ saveEditCommentError: function (e, data) { Debug.log( 'save comment error' ); if( data.commentID != this._commentID ){ return; } ips.ui.alert.show( { type: 'alert', icon: 'warn', message: ips.getString('editCommentError'), }); //this.scope.find('form').submit(); }, /** * Handler for approving a comment * * @param {event} e Event object * @returns {void} */ approveComment: function (e) { e.preventDefault(); var url = $( e.currentTarget ).attr('href'); this.trigger( 'approveComment.comment', { url: url, commentID: this._commentID }); }, /** * Model indicates it's starting to approve the comment * * @param {event} e Event object * @param {object} data Data object from model * @returns {void} */ approveCommentLoading: function (e, data) { if( data.commentID != this._commentID ){ return; } this.scope .find('[data-role="commentControls"]') .addClass('ipsFaded') .find('[data-action="approveComment"]') .addClass( 'ipsButton_disabled' ) .text( ips.getString( 'commentApproving' ) ); }, /** * Model returned success for approving the comment * * @param {event} e Event object * @param {object} data Data object from model * @returns {void} */ approveCommentDone: function (e, data) { if( data.commentID != this._commentID ){ return; } var commentHtml = $('
    ' + data.response + '
    ').find('[data-controller="core.front.core.comment"]').html(); // Remove moderated classes and update HTML this.scope .html( commentHtml ) .removeClass('ipsModerated') .closest( '.ipsComment' ) .removeClass('ipsModerated'); // Let document know $( document ).trigger( 'contentChange', [ this.scope ] ); // Set up multiquote in this comment if( ips.utils.db.isEnabled() ){ this.scope.find('[data-action="multiQuoteComment"]').removeClass('ipsHide'); } // And show a flash message ips.ui.flashMsg.show( ips.getString( 'commentApproved' ) ); }, /** * Model returned an error for approving the comment * * @param {event} e Event object * @param {object} data Data object from model * @returns {void} */ approveCommentError: function (e, data) { if( data.commentID != this._commentID ){ return; } window.location = data.url; }, /** * Handler for delete comment * * @param {event} e Event object * @returns {void} */ deleteComment: function (e) { e.preventDefault(); var self = this; var url = $( e.currentTarget ).attr('href'); var commentData = this._getQuoteData(); var eventData = _.extend( commentData, { url: url, commentID: this._commentID }); ips.ui.alert.show( { type: 'confirm', icon: 'warn', message: ips.getString('delete_confirm'), callbacks: { ok: function(){ self.trigger( 'deleteComment.comment', eventData ); } } }); }, /** * Model event: delete comment finished * * @param {event} e Event object * @returns {void} */ deleteCommentDone: function (e, data) { if( data.commentID != this._commentID ){ return; } var deleteLink = this.scope.find('[data-action="deleteComment"]'); // Stuff to HIDE elements on delete var toHide = null; var toShow = null; if( deleteLink.attr('data-hideOnDelete') ){ toHide = this.scope.find( deleteLink.attr('data-hideOnDelete') ); } else { toHide = this.scope.closest('article'); } toHide.animationComplete( function () { toHide.remove(); }); ips.utils.anim.go( 'fadeOutDown', toHide ); // Update count if ( deleteLink.attr('data-updateOnDelete') ) { $( deleteLink.attr('data-updateOnDelete') ).text( parseInt( $( deleteLink.attr('data-updateOnDelete') ).text() ) - 1 ); } // Stuff to SHOW elements on delete if( deleteLink.attr('data-showOnDelete') ) { toShow = this.scope.find( deleteLink.attr('data-showOnDelete') ); ips.utils.anim.go( 'fadeIn', toShow ); } this.trigger( 'deletedComment.comment', { commentID: this._commentID, response: data.response }); }, /** * Model event: delete comment failed * * @param {event} e Event object * @returns {void} */ deleteCommentError: function (e, data) { if( data.commentID != this._commentID ){ return; } window.location = data.url; }, /** * Prepares post data for quoting * * @param {string} html Post contents * @returns {string} Transformed post contents */ _prepareQuote: function (html) { if( ips.getSetting('strip_quotes') == 1 ) { // @link http://community.invisionpower.com/resources/bugs.html/_/4-0-0/empty-line-when-quoting-post-with-quote-while-quote-nesting-is-disabled-r46720 if( html.find('blockquote.ipsQuote') && html.find('blockquote.ipsQuote').parent() && html.find('blockquote.ipsQuote').parent().get( 0 ) && html.find('blockquote.ipsQuote').parent().get( 0 ).tagName == 'DIV' && html.find('blockquote.ipsQuote').siblings().length == 0 ) { var div = html.find('blockquote.ipsQuote').closest('div'); div.next('p').find("br:first-child").remove(); div.remove(); } else { html.find('blockquote.ipsQuote').remove(); } } html.find('blockquote.ipsQuote *').show(); // expand collapsed quotes html.find('.ipsStyle_spoilerFancy,.ipsStyle_spoiler').replaceWith( ips.templates.render( 'core.posts.quotedSpoiler' ) ); // Used for "edited by" byline presently, but can be used by anything html.find("[data-excludequote]").remove(); html.find('.ipsQuote_citation').remove(); html.find( '[data-quote-value]' ).each( function () { $( this ).replaceWith( '

    ' + $( this ).attr('data-quote-value') + '

    ' ); }); return html; }, /** * Parses the JSON object containing quote data for the comment * * @returns {object} Quote data, or else an empty object */ _getQuoteData: function () { if( !this._quoteData ){ try { this._quoteData = $.parseJSON( this.scope.attr('data-quoteData') ); return this._quoteData; } catch (err) { alert(this.scope.attr('data-quoteData')); Debug.log("Couldn't parse quote data"); return {}; } } return this._quoteData; } }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => controllers/core [javascript_location] => front [javascript_position] => 1000050 [javascript_name] => ips.core.comment.js [javascript_key] => ) [64] => Array ( [javascript_id] => 64 [javascript_plugin] => [javascript_type] => controller [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.commentFeed.js - Controller for a stream of comments (e.g. a topic, conversation, etc.) * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.register('core.front.core.commentFeed', { _overlay: null, _commentFeedID: 0, _newRepliesFlash: null, _maximumMultiQuote: 50, // Maximum number of items that can be multiquoted _pageParam: 'page', _urlParams: {}, _baseURL: '', _doneInitialState: false, _initialURL: '', // Polling vars _pollingEnabled: true, // Is polling enabled at all? _pollingActive: false, // Is polling running right now? _pollingPaused: false, // Have we paused polling? _initialPoll: 60000, // Our base polling frequency (1 minute) _currentPoll: 60000, // The current interval _decay: 20000, // Decay (amount added to interval on each false response) _maxInterval: 300000, // Maximum interval possible _pollingTimeout: null, // timeout obj _pollAjax: null, // ajax obj _pollOnUnpaused: false, // If true, when window is focused a poll will fire immediately initialize: function () { this.on( 'submit', '[data-role="replyArea"]', this.quickReply ); this.on( 'quoteComment.comment', this.quoteComment ); this.on( 'addMultiQuote.comment', this.addMultiQuote ); this.on( 'removeMultiQuote.comment deleteComment.comment', this.removeMultiQuote ); this.on( 'click', '[data-action="filterClick"]', this.filterClick ); this.on( 'menuItemSelected', '[data-action="ignoreOptions"]', this.commentIgnore ); this.on( 'menuItemSelected', '[data-role="signatureOptions"]', this.signatureOptions ); //this.on( 'change', '[data-role="moderation"]', this.selectRow ); this.on( 'editorCompatibility', this.editorCompatibility ); this.on( 'checkedComment.comment', this.checkedComment ); $( document ).on( 'click', '[data-role="multiQuote"]', _.bind( this.doMultiQuote, this ) ); $( document ).on( 'click', '[data-action="clearQuoted"]', _.bind( this.clearMultiQuote, this ) ); $( document ).on( 'moderationSubmitted', this.clearLocalStorage ); this.on( 'paginationClicked paginationJump', this.paginationClick ); // Watch events on the document that are actually triggered from within this.quickReply this.on( document, 'addToCommentFeed', this.addToCommentFeed ); this.on( 'deletedComment.comment', this.deletedComment ); // Window events for polling purposes //$( window ).on( 'blur', _.bind( this.windowBlur, this ) ); //$( window ).on( 'focus', _.bind( this.windowFocus, this ) ); // Event we watch for on flash messages this.on( document, 'click', '[data-action="loadNewPosts"]', this.loadNewPosts ); // Watch for state updates ///this._stateChange = _.bind( this.stateChange, this ); this.on( window, 'statechange', this.stateChange ); this.setup(); }, /** * Setup method for comment feeds * * @returns {void} */ setup: function () { var self = this; var replyForm = this.scope.find('[data-role="replyArea"] form'); this._commentFeedID = this.scope.attr('data-feedID'); this._urlParams = this._getUrlParams(); this._baseURL = this.scope.attr('data-baseURL'); this._initialURL = window.location.href; if( this._baseURL.match(/\?/) ) { if( this._baseURL.slice(-1) != '?' ){ this._baseURL += '&'; } } else { this._baseURL += '?'; } if( replyForm.attr('data-noAjax') ){ this._pollingEnabled = false; } if( !_.isUndefined( this.scope.attr('data-lastPage') ) && this._pollingEnabled ){ this._startPolling(); } $( document ).ready( function () { self._setUpMultiQuote(); self._findCheckedComments(); }); }, /** * Clear local storage after form is submitted * * @returns {void} */ clearLocalStorage: function () { ips.utils.db.remove( 'moderation', $( document ).find("[data-feedID]").attr('data-feedID') ); }, /** * Destroy method * * @returns {void} */ destroy: function () { this._stopPolling(); }, /** * Returns an object containing URL parameters * * @returns {object} */ _getUrlParams: function () { var sort = this._getSortValue(); var obj = { sortby: sort.by || '', sortdirection: sort.order || '', }; obj[ this._pageParam ] = ips.utils.url.getParam( this._pageParam ) || 1 return obj; }, /** * Returns the current sort by and sort order value * * @returns {object} Object containing by and order keys */ _getSortValue: function () { return { by: '', order: '' }; }, /** * Responds to state changes triggered by History.js * * @returns {void} */ stateChange: function () { var state = History.getState(); // Make sure the state we're working with belongs to this controller/feed. // removed: && this._initialURL != state.data.url because the state change was // firing even if the controller IDs didn't match. if( ( _.isUndefined( state.data.controller ) || state.data.controller != this.controllerID || state.data.feedID != this._commentFeedID ) /* && this._initialURL != state.data.url */ ) { return; } // Update data this._urlParams = state.data; // Get le new results // If the initial URL matches the URL for this state, then we'll load results by URL instead // of by object (since we don't have an object for the URL on page load) if( this._initialURL == state.url ){ this._getResults( state.url ); } else { this._getResults(); } }, /** * Fetches new results from the server, then calls this._updateTable to update the * content and pagination. Simply redirects to URL on error. * * @param {string} [url] Optional URL to fetch the results from. If omitted the URL will be built based on the current params object * @returns {void} */ _getResults: function (url) { var self = this; var fetchURL = url || this._baseURL + this._getURL(); this._setLoading( true ); ips.getAjax()( fetchURL, { showLoading: true } ) .done( _.bind( this._getResultsDone, this ) ) .fail( _.bind( this._getResultsFail, this ) ) .always( _.bind( this._getResultsAlways, this ) ); }, /** * New results have finished loading * * @param {string} Results HTML from ajax request * @returns {void} */ _getResultsDone: function (response) { var tmpElement = $( '
    ' + response + '
    ' ).find( '[data-feedID="' + this.scope.attr('data-feedID') + '"]' ); var newContents = tmpElement.html(); tmpElement.remove(); this.cleanContents(); //ips.ui.destructAllWidgets( this.scope ); this.scope.hide().html( newContents ); // Show content and hide loading ips.utils.anim.go( 'fadeIn', this.scope ); this._overlay.hide(); // Update multiquote, let document know, then highlight checked comments this._setUpMultiQuote(); $( document ).trigger( 'contentChange', [ this.scope ] ); this._findCheckedComments(); }, /** * Callback when the results ajax fails * * @param {object} jqXHR jQuery XHR object * @param {string} textStatus Error message * @param {string} errorThrown * @returns {void} */ _getResultsFail: function (jqXHR, textStatus, errorThrown) { if( Debug.isEnabled() ){ Debug.error( "Ajax request failed (" + textStatus + "): " + errorThrown ); Debug.error( jqXHR.responseText ); } else { // rut-roh, we'll just do a manual redirect window.location = this._baseURL + this._getURL(); } }, /** * Callback always called after ajax request to load results * * @returns {void} */ _getResultsAlways: function () { // }, /** * Callback always called after ajax request to load results * * @returns {void} */ _setLoading: function (status) { var scope = this.scope; var self = this; var commentFeed = this.scope.find('[data-role="commentFeed"]'); if( status ){ if( !this._overlay ){ this._overlay = $('
    ').addClass('ipsLoading').hide(); ips.getContainer().append( this._overlay ); } // Get dims & position var dims = ips.utils.position.getElemDims( commentFeed ); var position = ips.utils.position.getElemPosition( commentFeed ); this._overlay.show().css({ left: position.viewportOffset.left + 'px', top: position.viewportOffset.top + 'px', width: dims.width + 'px', height: dims.height + 'px', position: 'absolute', zIndex: ips.ui.zIndex() }); commentFeed.animate({ opacity: 0.5 }); // Get top postition of feed var elemPosition = ips.utils.position.getElemPosition( this.scope ); $('html, body').animate( { scrollTop: elemPosition.absPos.top + 'px' } ); } else { // Stop loading } }, /** * Responds to a pagination click * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ paginationClick: function (e, data) { data.originalEvent.preventDefault(); if( data.pageNo != this._urlParams[ this._pageParam ] ){ //var newObj = {}; //newObj[ this._pageParam ] = data.pageNo; var urlObj = ips.utils.url.getURIObject( data.href ); var queryKey = urlObj.queryKey; // If we're now on the last page, start polling again if( data.lastPage && !this._pollingActive ){ this.scope.attr( 'data-lastPage', true ); this._currentPoll = this._initialPoll; this._startPolling(); } else if( !data.lastPage ) { this.scope.removeAttr( 'data-lastPage' ); this._stopPolling(); } this._updateURL( queryKey ); } }, /** * Pushes a new URL state to the browser * * @param {object} newParams Object to be added to the state * @returns {void} */ _updateURL: function (newParams) { // We don't insert a record into the history when the page loads. That means when a user // goes to page 1 -> page 2 then hits back, there's no record of 'page 1' in the history, and it doesn't work. // To fix that, we're tracking a 'doneInitialState' flag in this controller. The first time this method is called // and doneInitialState == false, we insert the *current* url into the stack before changing the URL. This gives // the History manager something to go back to when the user clicks back to the initial page. /*if( !this._doneInitialState ){ History.replaceState( _.extend( _.clone( this._urlParams ), { controller: this.controllerID, feedID: this._commentFeedID, bypassState: true } ), document.title, document.location ); this._doneInitialState = true; }*/ _.extend( this._urlParams, newParams ); var tmpStateData = _.extend( _.clone( this._urlParams ), { controller: this.controllerID, feedID: this._commentFeedID } ); History.pushState( tmpStateData, document.title, this._baseURL + this._getURL() ); }, /** * Builds a param string from values in this._urlParams, excluding empty values * * @returns {string} Param string */ _getURL: function () { var tmpUrlParams = {}; for( var i in this._urlParams ){ if( this._urlParams[ i ] != '' && i != 'controller' && i != 'feedID' && i != 'bypassState' ){ tmpUrlParams[ i ] = this._urlParams[ i ]; } } return $.param( tmpUrlParams ); }, /** * An editor in this feed has indicated its compatibility * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ editorCompatibility: function (e, data) { if( !data.compatible ){ this.triggerOn( 'core.front.core.comment', 'disableQuoting.comment' ); } }, /** * A comment controller triggered an event indicating it was selected * Adds the comment ID and actions to localStorage so it can be tracked across * pages of the feed * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ checkedComment: function (e, data) { var dataStore = ips.utils.db.get( 'moderation', this._commentFeedID ) || {}; if( data.checked ){ if( _.isUndefined( dataStore[ data.commentID ] ) ){ dataStore[ data.commentID ] = data.actions; } } else { delete dataStore[ data.commentID ]; } // Store the updated value, or delete if it's empty now if( _.size( dataStore ) ){ ips.utils.db.set( 'moderation', this._commentFeedID, dataStore ); } else { ips.utils.db.remove( 'moderation', this._commentFeedID ); } }, /** * Called on setup, loops through the selected comments for this feedID from localstorage, * and checks any that are present on this page. For others, instructs the pageAction * widget to add the ID to its store manually so that they can still be worked with. * * @returns {void} */ _findCheckedComments: function () { // Bail if there's no checkboxes anyway if( !this.scope.find('input[type="checkbox"]').length ){ return; } // Fetch the checked comments for this feedID var dataStore = ips.utils.db.get( 'moderation', this._commentFeedID ) || {}; var self = this; var pageAction = this.scope.find('[data-ipsPageAction]'); if( _.size( dataStore ) ){ _.each( dataStore, function (val, key) { if( self.scope.find('[data-commentID="' + key + '"]').length ){ self.scope .find('[data-commentID="' + key + '"] input[type="checkbox"][data-role="moderation"]') .attr( 'checked', true ) .trigger('change'); } else { pageAction.trigger('addManualItem.pageAction', { id: 'multimod[' + key + ']', actions: val }); } }); } }, /** * Options * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ signatureOptions: function (e, data) { data.originalEvent.preventDefault(); if( data.selectedItemID == 'oneSignature' ){ this._ignoreSingleSignature( $( e.currentTarget ).attr('data-memberID') ); } else { this._ignoreAllSignatures(); } }, /** * Fires a request to hide all signatures in the feed * * @returns {void} */ _ignoreAllSignatures: function () { var self = this; var url = ips.getSetting('baseURL') + '?app=core&module=system&controller=settings&do=toggleSigs'; var signatures = this.scope.find('[data-role="memberSignature"]'); // Hide all signatures on the page signatures.slideUp(); ips.getAjax()( url ) .done( function (response) { ips.ui.flashMsg.show( ips.getString('signatures_hidden') ); signatures.remove(); }) .fail( function () { signatures.show(); ips.ui.alert.show( { type: 'alert', icon: 'warn', message: ips.getString('signatures_error'), callbacks: {} }); }); }, /** * Fires a request to hide a single signature (i.e. a single member's signature) * * @param {number} memberID Member ID's signature to hide * @returns {void} */ _ignoreSingleSignature: function (memberID) { var self = this; var url = ips.getSetting('baseURL') + '?app=core&module=system&controller=ignore&do=ignoreType&type=signatures'; var signatures = this.scope.find('[data-role="memberSignature"]').find('[data-memberID="' + memberID + '"]').closest('[data-role="memberSignature"]'); signatures.slideUp(); ips.getAjax()( url, { data: { member_id: parseInt( memberID ) } }) .done( function (response) { ips.ui.flashMsg.show( ips.getString('single_signature_hidden') ); signatures.remove(); }) .fail( function () { signatures.show(); ips.ui.alert.show( { type: 'alert', icon: 'warn', message: ips.getString('single_signature_error'), callbacks: {} }); }); }, /** * Ignore options * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ commentIgnore: function (e, data) { switch( data.selectedItemID ){ case 'showPost': data.originalEvent.preventDefault(); this._showHiddenPost( e, data ); break; case 'stopIgnoring': data.originalEvent.preventDefault(); this._stopIgnoringFromComment( e, data ); break; } }, /** * Filter click * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ filterClick: function(e) { e.preventDefault(); var urlObj = ips.utils.url.getURIObject( $( e.target ).attr('href') ); var queryKey = urlObj.queryKey; this._updateURL( queryKey ); }, /** * Responds to a quote event from a comment controller * Finds the reply box for this feed, and triggers a new event instructing the * editor to insert the quote * * @param {event} e Event object * @param {object} data Event data object (which should contain all of the properties necessary for a quote) * @returns {void} */ quoteComment: function (e, data) { var editorID = this.scope.find('[data-role="replyArea"] [data-role="contentEditor"]').attr('name'); if( editorID ){ this.trigger('insertQuote', _.extend( data, { editorID: editorID } ) ); } }, /** * If the window blurs, we will pause polling, but if a poll is skipped, we'll immediately poll on window focus * * @returns {void} */ windowBlur: function (e) { if( this._pollingEnabled ){ Debug.log( 'Window blurred, pausing polling...' ); this._pollingPaused = true; } }, /** * Window focus - if polling was paused and a poll was skipped, trigger it immediately now * * @returns {void} */ windowFocus: function (e) { if( this._pollingEnabled && this._pollingPaused ){ Debug.log( 'Window focused...' ); this._pollingPaused = false; if( this._pollOnUnpaused ){ this._pollOnUnpaused = false; this.pollForNewReplies(); } } }, /** * Set a timeout for the new post polling process * * @returns {void} */ _startPolling: function () { var self = this; this._pollingActive = true; Debug.log('Starting polling with interval ' + ( this._currentPoll / 1000 ) + 's' ); this._pollingTimeout = setTimeout( function (){ self.pollForNewReplies(); }, this._currentPoll ); }, /** * Clear the new post poll timeout * * @returns {void} */ _stopPolling: function () { this._pollingActive = false; if( this._pollingTimeout ){ clearTimeout( this._pollingTimeout ); } }, /** * Checks for new replies since we opened the page * * @param {event} e Event object * @returns {void} */ pollForNewReplies: function () { var self = this; var replyForm = this.scope.find('[data-role="replyArea"] form'); var commentsOnThisPage = this.scope.find('[data-commentid]'); if( !commentsOnThisPage.length ) { return; } var lastSeenId = $( commentsOnThisPage[ commentsOnThisPage.length - 1 ] ).attr('data-commentId'); if( this._pollingPaused ){ Debug.log('Window blurred, delaying poll until focused...'); this._pollOnUnpaused = true; return; } // Abort any running ajax if( this._pollAjax && !_.isUndefined( this._pollAjax.abort ) ){ this._pollAjax.abort(); } this._pollAjax = ips.getAjax(); this._pollAjax( replyForm.attr('action'), { dataType: 'json', data: 'do=checkForNewReplies&type=count&lastSeenID=' + lastSeenId, type: 'post' }) .done( function (response) { if( parseInt( response.count ) > 0 ) { // Reset the poll interval self._currentPoll = self._initialPoll; var html = ''; if( parseInt( response.count ) === 1 && !_.isUndefined( response.photo ) && !_.isUndefined( response.name ) ){ html = ips.templates.render( 'core.postNotify.single', { photo: response.photo, text: ips.getString( 'newPostSingle', { name: response.name } ) }); } else { html = ips.templates.render( 'core.postNotify.multiple', { text: ips.pluralize( ips.getString( 'newPostMultiple' ), [ response.count ] ) }); } if( $('#elFlashMessage').is(':visible') && $('#elFlashMessage').find('[data-role="newPostNotification"]').length ){ $('#elFlashMessage').find('[data-role="newPostNotification"]').replaceWith( html ); } else { ips.ui.flashMsg.show( html, { sticky: true, position: 'bottom', extraClasses: 'cPostFlash ipsPad_half' } ); } } else { // Add 20 seconds to the poll interval, up to a max of 5 minutes if( ( self._currentPoll + self._decay ) < self._maxInterval ){ self._currentPoll += self._decay; } else { self._currentPoll = self._maxInterval; } } // Start again if we're on the last page if( !_.isUndefined( self.scope.attr('data-lastPage') ) ){ self._startPolling(); } }); }, /** * Adds new replies to the display * * @param {event} e Event object * @returns {void} */ _importNewReplies: function () { var form = this.scope.find('[data-role="replyArea"] form'); var commentsOnThisPage = this.scope.find('[data-commentid]'); var _lastSeenID = $( commentsOnThisPage[ commentsOnThisPage.length - 1 ] ).attr('data-commentId'); var self = this; ips.getAjax()( form.attr('action'), { data: 'do=checkForNewReplies&type=fetch&lastSeenID=' + _lastSeenID, type: 'post' }).done( function (response) { if( _.isArray( response.content ) ) { _.each( response.content, function (item) { self.trigger( 'addToCommentFeed', { content: item, feedID: self._commentFeedID, resetEditor: false, totalItems: response.totalCount }); }); } else { self.trigger( 'addToCommentFeed', { content: response.content, feedID: self._commentFeedID, resetEditor: false, totalItems: response.totalCount }); } self._clearNewPostFlashMsg(); }); }, /** * Close the flash message for new post notifications * * @returns {void} */ _clearNewPostFlashMsg: function () { if( $('#elFlashMessage').find('[data-role="newPostNotification"]').length ){ $('#elFlashMessage').find('[data-role="newPostNotification"]').trigger('closeFlashMsg.flashMsg'); } }, /** * Handles quick-reply functionality for this comment feed. Post the content via ajax, * and trigger events to handle showing the new post (or redirecting to a new page) * * @param {event} e Event object * @returns {void} */ quickReply: function (e) { var form = this.scope.find('[data-role="replyArea"] form'); if ( form.attr('data-noAjax') ) { return; } e.preventDefault(); e.stopPropagation(); var self = this; var replyArea = this.scope.find('[data-role="replyArea"]'); var submit = form.find('[type="submit"]'); var autoFollow = this.scope.find('input[name$="auto_follow_checkbox"]'); // Set the form to loading var initialText = submit.text(); submit .prop( 'disabled', true ) .text( ips.getString('saving') ); var page = ips.utils.url.getParam( this._pageParam ); if( !page ){ page = 1; } ips.getAjax()( form.attr('action'), { data: form.serialize() + '¤tPage=' + page, type: 'post' }) .done( function (response) { if ( response.type == 'error' ) { ips.ui.alert.show( { type: 'alert', icon: 'warn', message: response.message, callbacks: {} }); } else if( response.type == 'redirect' ) { self.paginationClick( e, { href: response.url, originalEvent: e }); } else { self.trigger( 'addToCommentFeed', { content: response.content, totalItems: response.total, feedID: self._commentFeedID }); // If the user is following this item, we can update the follow button too if( autoFollow.length ){ self.trigger( 'followingItem', { feedID: self.scope.attr('data-feedID'), following: autoFollow.is(':checked') }); } } self._clearNewPostFlashMsg(); }) .fail( function () { form.attr('data-noAjax', 'true'); form.submit(); }) .always( function () { submit .prop( 'disabled', false ) .text( initialText ? initialText : ips.getString('submit_reply') ); }); }, /** * Event handler for the 'load new posts' link in flash messages * * @param {event} e Event object * @returns {void} */ loadNewPosts: function (e) { e.preventDefault(); this._importNewReplies(); }, /** * Responds to an event (trigger within this controller) indicating a new comment has been added * Show it, and reset the contents of ckeditor * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ addToCommentFeed: function (e, data) { if( !data.content || data.feedID != this._commentFeedID ){ return; } var textarea = this.scope.find('[data-role="replyArea"] textarea'); var content = $('
    ').append( data.content ); var comment = content.find('.ipsComment'); var commentFeed = this.scope.find('[data-role="commentFeed"]'); if( commentFeed.find('[data-role="moderationTools"]').length ){ commentFeed = commentFeed.find('[data-role="moderationTools"]'); } // Hide the 'no comment' text this.scope.find('[data-role="noComments"]').remove(); // Add comment content commentFeed.append( comment ); // Do we need to syntax highlight anything? if( comment.find('pre.prettyprint').length ){ comment.find('pre.prettyprint').each( function () { $( this ).html( window.PR.prettyPrintOne( _.escape( $( this ).text() ) ) ); }); } ips.utils.anim.go( 'fadeInDown', comment ); if( _.isUndefined( data.resetEditor ) || data.resetEditor !== false ){ this.trigger( 'resetEditor', { editorID: textarea.attr('name') } ); } if( ips.utils.db.isEnabled() ){ var buttons = comment.find('[data-action="multiQuoteComment"]'); buttons.hide().removeClass('ipsHide'); ips.utils.anim.go('fadeIn', buttons); } this._updateCount(data.totalItems); $( document ).trigger( 'contentChange', [ this.scope ] ); }, /** * Responds to an event indicating thay a comment has been deleted * Show it, and reset the contents of ckeditor * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ deletedComment: function( e, data ) { data = $.parseJSON( data.response ); var self = this; if( data.type == 'redirect' ) { window.location = data.url; } else { this._updateCount( data.total ); } }, /** * Update comment count * * @param {int} newTotal The new total * @returns {void} */ _updateCount: function(newTotal) { if ( $(this.scope).find('[data-role="comment_count"]') ) { var langString = 'js_num_comments'; if ( $(this.scope).find('[data-role="comment_count"]').attr('data-commentCountString') ) { langString = $(this.scope).find('[data-role="comment_count"]').attr('data-commentCountString'); } $(this.scope).find('[data-role="comment_count"]').text( ips.pluralize( ips.getString( langString ), newTotal ) ); } }, /** * Event handler for the 'Quote x posts' button in multiquote popup * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ doMultiQuote: function (e) { var mqData = this._getMultiQuoteData(); var replyArea = this.scope.find('[data-role="replyArea"]'); var editor = replyArea.find('[data-role="contentEditor"]'); var editorID = editor.attr('name'); var output = []; var self = this; if( !_.size( mqData ) || !replyArea.is(':visible') ){ return; } // Build quote array and trigger event for the editor widget to deal with _.each( mqData, function (value){ output.push( value ); }); self.trigger( 'insertQuote', { editorID: editorID, quotes: output } ); this._removeAllMultiQuoted(); }, /** * Event handler for the 'clear' button in the multiquote popup * Simply calls _removeAllMultiQuoted to do the clear * * @param {event} e Event object * @returns {void} */ clearMultiQuote: function (e) { e.preventDefault(); this._removeAllMultiQuoted(); }, /** * Removes all quoted posts * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ _removeAllMultiQuoted: function () { var mqData = this._getMultiQuoteData(); var self = this; // Delete all the multi-quoted posts from DB ips.utils.db.set( 'mq', 'data', {} ); // Hide popup this._buildMultiQuote(0); if( !_.size( mqData ) ){ return; } // Loop through each quoted posts and see if it exists on this page by building a selector, // then updating classnames on elements that match it _.each( mqData, function (value) { self.triggerOn( 'core.front.core.comment', 'setMultiQuoteDisabled.comment', { contentapp: value.contentapp, contenttype: value.contenttype, contentcommentid: value.contentcommentid }); }); }, /** * Responds to an addMultiQuote event * Adds the provided post data to the multiquote DB entry and updates the popup * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ addMultiQuote: function (e, data) { var mqData = this._getMultiQuoteData(); var key = data.contentapp + '-' + data.contenttype + '-' + data.contentcommentid; // Have we hit a limit? if( _.size( mqData ) == this._maximumMultiQuote ) { ips.ui.alert.show( { type: 'alert', icon: 'warn', message: ips.pluralize( ips.getString( 'maxmultiquote' ), this._maximumMultiQuote ), callbacks: { ok: function () { $("button[data-mqId='" + data.button + "']").removeClass('ipsButton_alternate') .addClass('ipsButton_simple') .removeAttr('data-mqActive') .html( ips.templates.render('core.posts.multiQuoteOff') ); } } }); return false; } mqData[ key ] = data; ips.utils.db.set( 'mq', 'data', mqData ); this._buildMultiQuote( _.size( mqData ) ); }, /** * Responds to a removeMultiQuote event * Removes the provided post data from the multiquote DB entry and updates the popup * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ removeMultiQuote: function (e, data) { var mqData = this._getMultiQuoteData(); var key = data.contentapp + '-' + data.contenttype + '-' + data.contentcommentid; if( !_.isUndefined( mqData[ key ] ) ){ mqData = _.omit( mqData, key ); ips.utils.db.set( 'mq', 'data', mqData ); this._buildMultiQuote( _.size( mqData ) ); } }, /** * Returns the current multiquote data from the localStorage * * @returns {object} Multiquote data from localStorage */ _getMultiQuoteData: function () { // Get the IDs we already have saved var mqData = ips.utils.db.get('mq', 'data'); if( _.isUndefined( mqData ) || !_.isObject( mqData ) ){ return {}; } return mqData; }, /** * Called when the controller is initialized * Checks whether there's any mq data, and shows the popup if so * * @returns {void} */ _setUpMultiQuote: function () { if( !ips.utils.db.isEnabled() ){ return; } var buttons = this.scope.find('[data-action="multiQuoteComment"]'); var self = this; var mqData = this._getMultiQuoteData(); buttons.hide().removeClass('ipsHide'); ips.utils.anim.go('fadeIn', buttons); if( _.size( mqData ) ){ this._buildMultiQuote( _.size( mqData ) ); // Loop through each quoted posts and see if it exists on this page by building a selector, // then updating classnames on elements that match it _.each( mqData, function (value) { self.triggerOn( 'core.front.core.comment', 'setMultiQuoteEnabled.comment', { contentapp: value.contentapp, contenttype: value.contenttype, contentcommentid: value.contentcommentid }); }); } }, /** * Builds the multiquote popup, either from a template if this is the first time, * or updates the value if it already exists. * * @param {number} count Count of quoted posts * @returns {void} */ _buildMultiQuote: function (count) { var quoterElem = $('#ipsMultiQuoter'); if( !quoterElem.length && count ){ ips.getContainer().append( ips.templates.render('core.posts.multiQuoter', { count: ips.getString('multiquote_count', { count: ips.pluralize( ips.getString( 'multiquote_count_plural' ), [ count ] ) }) })); ips.utils.anim.go( 'zoomIn fast', $('#ipsMultiQuoter') ); } else { quoterElem.find('[data-role="quotingTotal"]').text( ips.pluralize( ips.getString( 'multiquote_count_plural' ), [ count ] ) ); if( count && quoterElem.is(':visible') ){ ips.utils.anim.go( 'pulseOnce fast', quoterElem ); } else if( count && !quoterElem.is(':visible') ){ ips.utils.anim.go( 'zoomIn fast', quoterElem ); } else { ips.utils.anim.go( 'zoomOut fast', quoterElem ); } } }, /** * Shows a hidden post * * @param {event} e Event object from the event handler * @param {object} data Event data object from the event handler * @returns {void} */ _showHiddenPost: function (e, data) { // Hide the ignore row var ignoreRow = $( data.triggerElem ).closest('.ipsComment_ignored'); var commentID = ignoreRow.attr('data-ignoreCommentID'); var comment = this.scope.find( '#' + commentID ); ignoreRow.remove(); comment.removeClass('ipsHide'); }, /** * Stops ignoring posts by a user * * @param {event} e Event object from the event handler * @param {object} data Event data object from the event handler * @returns {void} */ _stopIgnoringFromComment: function (e, data) { var ignoreRow = $( data.triggerElem ).closest('.ipsComment_ignored'); var userID = ignoreRow.attr('data-ignoreUserID'); var self = this; var posts = this.scope.find('[data-ignoreUserID="' + userID + '"]'); posts.each( function () { self.scope.find( '#' + $( this ).attr('data-ignoreCommentID') ).removeClass('ipsHide'); $( this ).remove(); }); var url = ips.getSetting('baseURL') + '?app=core&module=system&controller=ignore&do=ignoreType&type=topics&off=1'; ips.getAjax()( url, { data: { member_id: parseInt( userID ) } }) .done( function () { ips.ui.flashMsg.show( ips.getString('ignore_prefs_updated') ); }) .fail( function () { window.location = ips.getSetting('baseURL') + '?app=core&module=system&controller=ignore&do=ignoreType&off=1type=topics&member_id=' + userID; }); } }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => controllers/core [javascript_location] => front [javascript_position] => 1000050 [javascript_name] => ips.core.commentFeed.js [javascript_key] => ) [65] => Array ( [javascript_id] => 65 [javascript_plugin] => [javascript_type] => controller [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.commentWrapper.js * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.register('core.front.core.commentsWrapper', { initialize: function () { this.on( document, 'addToCommentFeed', this.addToCommentFeed ); this.on( 'deletedComment.comment', this.deletedComment ); }, /** * Responds to an event (trigger within this controller) indicating a new comment has been added * Show it, and reset the contents of ckeditor * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ addToCommentFeed: function(e, data) { this._updateCount( $(e.target).attr('data-commentsType'), data.totalItems ); }, /** * Responds to an event indicating thay a comment has been deleted * Show it, and reset the contents of ckeditor * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ deletedComment: function(e, data) { this._updateCount( $(e.target).closest('[data-commentsType]').attr('data-commentsType'), data.newTotal ); }, /** * Update comment count * * @param {int} newTotal The new total * @returns {void} */ _updateCount: function( type, number ) { var langString = 'js_num_' + type; var elem = $( '#' + $(this.scope).attr('data-tabsId') + '_tab_' + type ); elem.text( ips.pluralize( ips.getString( langString ), number ) ); } }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => controllers/core [javascript_location] => front [javascript_position] => 1000050 [javascript_name] => ips.core.commentsWrapper.js [javascript_key] => ) [74] => Array ( [javascript_id] => 74 [javascript_plugin] => [javascript_type] => controller [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.lightboxedImages.js - Sets up lightbox on user-posted content * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.register('core.front.core.lightboxedImages', { _random: null, initialize: function () { this.on( 'initializeImages', this.initializeImages ); this.setup(); }, /** * Setup method * * @returns {void} */ setup: function () { this._random = 'g' + ( Math.round( Math.random() * 100000 ) ); this._initializeImages(); }, /** * Event handler for main event * * @returns {void} */ initializeImages: function () { this._initializeImages(); }, /** * Initializes images by checking if their full size is larger than shown, and wrapping them * with the lightbox ui widget if so. * * @returns {void} */ _initializeImages: function () { var self = this; this.scope.find('img').imagesLoaded( function (images) { images.each( function (i, image) { if( image.width >= image.naturalWidth && !$( image ).hasClass('ipsImage_thumbnailed') ) { return; } image = $( image ); image.addClass('ipsImage_thumbnailed'); // If the image is already inside an a, then just add the lightbox params; otherwise, wrap in new if( image.closest('a').length && image.closest('a').hasClass('ipsAttachLink') && image.closest('a').hasClass('ipsAttachLink_image') ){ if( !ips.utils.responsive.enabled() || !ips.utils.responsive.currentIs('phone') ){ image.closest('a') .attr( 'data-fullURL',image.closest('a').attr('src') ) .attr( 'data-ipsLightbox', '' ) .attr( 'data-ipsLightbox-group', self._random ); } } else { if( !image.closest('a').length ){ if( ips.utils.responsive.enabled() && ips.utils.responsive.currentIs('phone') ){ image.wrap( $( "" ) ); } else { image.wrap( $( "" ) ); } } } }); }); } }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => controllers/core [javascript_location] => front [javascript_position] => 1000050 [javascript_name] => ips.core.lightboxedImages.js [javascript_key] => ) [76] => Array ( [javascript_id] => 76 [javascript_plugin] => [javascript_type] => controller [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.loginMenu.js - Controller for login popup * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.register('core.front.core.loginMenu', { initialize: function () { // Events to trigger this.on( 'success.validation', 'form', this.doSignIn ); }, doSignIn: function (e) { e.preventDefault(); var form = this.scope.find('form'); var url = form.attr('action'); this._loading( true ); ips.getAjax()( url, { type: 'post', data: form.serialize(), dataType: 'json' }) .done( function (response) { window.location.reload(); }) .fail( function (jqXHR, textStatus, errorThrown) { Debug.log( textStatus ); }); }, _loading: function (doLoading) { var dims = { width: this.scope.outerWidth(), height: this.scope.outerHeight() }; this.scope .css( { height: dims.height + 'px', width: dims.width + 'px' }) .addClass('ipsLoading') .find('[data-role="loginForm"]') .hide(); } }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => controllers/core [javascript_location] => front [javascript_position] => 1000050 [javascript_name] => ips.core.loginMenu.js [javascript_key] => ) [77] => Array ( [javascript_id] => 77 [javascript_plugin] => [javascript_type] => controller [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.markRead.js - Controller for moderation actions in content listings * * Author: Matt Mecham; Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.register('core.front.core.markRead', { initialize: function () { this.on( 'click', this.markSiteRead ); }, /** * Event handler for marking site as read * * @param {event} e Event object * @returns {void} */ markSiteRead: function (e) { e.preventDefault(); ips.ui.alert.show( { type: 'confirm', icon: 'question', message: ips.getString('markAsReadConfirm'), subText: '', callbacks: { ok: function () { var url = ips.getSetting('baseURL') + '?app=core&module=system&controller=markread'; ips.getAjax()( url, { showLoading: true }) .done( function () { $( document ).trigger( 'markAllRead' ); }) .fail( function (jqXHR, textStatus, errorThrown) { window.location = ipsSettings.baseURL + url; }); } } }); } }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => controllers/core [javascript_location] => front [javascript_position] => 1000050 [javascript_name] => ips.core.markRead.js [javascript_key] => ) [79] => Array ( [javascript_id] => 79 [javascript_plugin] => [javascript_type] => controller [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.mobileNav.js - Mobile navigation controller * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.register('core.front.core.mobileNav', { initialize: function () { this.on( 'click', '[data-action="mobileSearch"]', this.mobileSearch ); }, /** * Mobile search; simply adds a class to the body. CSS shows the search box. * * @param {event} e Event object * @returns {void} */ mobileSearch: function (e) { e.preventDefault(); $('body').toggleClass('cSearchOpen'); } }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => controllers/core [javascript_location] => front [javascript_position] => 1000050 [javascript_name] => ips.core.mobileNav.js [javascript_key] => ) [83] => Array ( [javascript_id] => 83 [javascript_plugin] => [javascript_type] => controller [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.navBar.js - Controller for managing the nav bar * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.register('core.front.core.navBar', { initialize: function () { this.on( window, 'resize', this.resizeWindow ); if ( $('body').attr('data-controller').indexOf('core.global.customization.visualLang') == -1 ) { this.setup(); } else { var self = this; $('body').on( 'vleDone', function(){ self.setup(); }); } }, /** * Setup method * * @returns {void} */ setup: function () { this._mushMenu(); }, /** * Event handler for resizing the window * * @returns {void} */ resizeWindow: function () { this._mushMenu(); }, /** * Mush the menu. If the menu is too big, we chop off items and put them in a submenu instead * * @returns {void} */ _mushMenu: function () { var availableSpace = this.scope.outerWidth() - this.scope.find('#elSearch').outerWidth(); var moreItem = this.scope.find('[data-role="navMore"]'); var moreMenuSize = moreItem.outerWidth(); var menuItems = this.scope.find('[data-role="navItem"]'); var sizeIncrem = 0; if( !moreItem.is(':visible') ){ moreMenuSize = moreItem.removeClass('ipsHide').outerWidth(); moreItem.addClass('ipsHide'); } menuItems.each( function () { var item = $( this ); var itemSize = 0; // Check for the original width attr. If it doesn't exist, set it // This means we know how big an item will be, even if we mush it later if( item.attr('data-originalWidth') ){ itemSize = parseInt( item.attr('data-originalWidth') ); } else { var o = item.outerWidth(); item.attr( 'data-originalWidth', o ); itemSize = o; } // If this item will push us over the available space, then we build a new LI for the dropdown // and add the contents of this item to it. if( ( sizeIncrem + itemSize + moreMenuSize ) > availableSpace ){ if( !item.attr('data-mushed') ){ var newLI = $('
  • ') .attr('data-originalItem', item.identify().attr('id') ) .addClass('ipsMenu_item') .append( item.contents() ); if( newLI.find('.ipsMenu').length ){ newLI.addClass('ipsMenu_subItems'); } $('#elNavigationMore_dropdown_menu').append( newLI ); item .addClass('ipsHide') .attr('data-mushed', true); } } else if( item.attr('data-mushed') ) { // If this item has previously been mushed, we can unmush it by moving the contents // back to its original location var mushedItem = $('#elNavigationMore_dropdown_menu').find('[data-originalItem="' + item.identify().attr('id') + '"]'); if( mushedItem.length ){ item.append( mushedItem.contents() ).removeClass('ipsHide'); mushedItem.remove(); } item.removeAttr('data-mushed'); } sizeIncrem += itemSize; }); // Show the "More" item if it has any children in the menu moreItem.toggleClass('ipsHide', !$('#elNavigationMore_dropdown_menu').find('> li').length ); } }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => controllers/core [javascript_location] => front [javascript_position] => 1000050 [javascript_name] => ips.core.navBar.js [javascript_key] => ) [85] => Array ( [javascript_id] => 85 [javascript_plugin] => [javascript_type] => controller [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.pagination.js - Pagination controller * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.register('core.front.core.pagination', { initialize: function () { this.on( 'paginationClicked paginationJump', this.paginationClick ); }, paginationClick: function (e, data) { var self = this; if( !data.href ){ return; } ips.getAjax()( data.href ) .done( function (response) { self.scope.hide().html( response ); ips.utils.anim.go('fadeIn', self.scope); }) .fail( function () { window.location = data.href; }); } }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => controllers/core [javascript_location] => front [javascript_position] => 1000050 [javascript_name] => ips.core.pagination.js [javascript_key] => ) [89] => Array ( [javascript_id] => 89 [javascript_plugin] => [javascript_type] => controller [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.quickSearch.js - Controller for search in header * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.register('core.front.core.quickSearch', { _initialSize: 0, _expanded: false, _blurTimeout: null, _focused: false, initialize: function () { this.on( 'focus', '#elSearchField', this.focusSearch ); this.on( 'blur', '#elSearchField', this.blurSearch ); this.on( 'menuItemSelected', '#elSearchFilter', this.menuItemSelected ); this.on( document, 'menuOpened', this.menuOpened ); this.setup(); }, /** * Setup method * * @returns {void} */ setup: function () { this._expanded = false; }, /** * Event handler for the menu filter * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ menuItemSelected: function (e, data) { if( !data.selectedItemID ){ return; } data.originalEvent.preventDefault(); for( var i in data.selectedItems ) { var selectedItem = $('#'+i); } //var selectedItem = data.menuElem.find('[data-ipsMenuValue="' + data.selectedItemID + '"]'); var form = this.scope.find('form'); // Add correct text var title = selectedItem.find('a').html(); this.scope.find('[data-role="searchingIn"]').text( title ); // Remove form inputs for selected option this.scope.find('[data-role="searchFilter"]').remove(); // Add new inputs if( data.selectedItemID != 'all' ){ var options = selectedItem.attr('data-options'); if( !options ){ form.append( $('') .attr( 'type', 'hidden' ) .attr( 'name', 'type' ) .attr( 'value', data.selectedItemID ) .attr( 'data-role', 'searchFilter' ) ); return; } // Build the form inputs from the options data on this item try { options = $.parseJSON( options ); _.each( options, function (val, i) { form.append( $('') .attr( 'type', 'hidden' ) .attr( 'name', i ) .attr( 'value', val ) .attr( 'data-role', 'searchFilter' ) ); }); } catch (err) { Debug.log('Invalid search options json'); return; } } }, /** * Event handler for focusing the search box * * @param {event} e Event object * @returns {void} */ focusSearch: function (e) { if( this._expanded ){ return; } $('#elSearch') .addClass('cSearchExpanded'); ips.utils.anim.go('fadeIn', $('#elSearchFilter') ); var scope = $(this.scope); ips.getAjax()( ips.getSetting('baseURL') + '?app=core&module=search&controller=search&do=globalFilterOptions' ).done(function( response ){ scope.find('[data-role="globalSearchMenuOptions"]').replaceWith( response ); }); this._expanded = true; }, /** * Shrinks search box when blurred. Sets a timer and hands off to _cancelSearch to actually shrink it. * * @returns {void} */ blurSearch: function () { var self = this; // First set a small timeout so we can cancel this if we want this._blurTimeout = setTimeout( function (){ self._cancelSearch(); }, 500 ); }, /** * Shrinks search box when blurred. * * @param {boolean} loseFocus * @returns {void} */ _cancelSearch: function () { if( ips.utils.responsive.currentIs('phone') ){ ips.utils.anim.go('fadeIn fast', $('#elHeaderNavigation') ); } $('#elSearch') .removeClass('cSearchExpanded'); ips.utils.anim.go('fadeOut fast', $('#elSearchFilter') ); this._expanded = false; }, /** * Event handler for the filter menu being opened * * @param {event} e Event object * @returns {void} */ menuOpened: function (e, data) { Debug.log( data.elemID ); if( data.elemID == 'elSearchFilter' ){ clearTimeout( this._blurTimeout ); } } }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => controllers/core [javascript_location] => front [javascript_position] => 1000050 [javascript_name] => ips.core.quickSearch.js [javascript_key] => ) [90] => Array ( [javascript_id] => 90 [javascript_plugin] => [javascript_type] => controller [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.quickSearch.js - Controller for search in header * * Author: Mark Wade */ ;( function($, _, undefined){ "use strict"; ips.controller.register('core.front.core.rating', { initialize: function () { this.on( 'ratingSaved', '[data-ipsRating]', this.ratingClick ); var scope = this.scope; }, ratingClick: function(e, data){ var scope = $(this.scope); ips.getAjax()( scope.attr('action'), { data: scope.serialize(), type: 'post' }) .done( function (response, textStatus, jqXHR) { // Don't need to actually do anything here }) .fail(function(){ scope.submit(); }); } }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => controllers/core [javascript_location] => front [javascript_position] => 1000050 [javascript_name] => ips.core.rating.js [javascript_key] => ) [91] => Array ( [javascript_id] => 91 [javascript_plugin] => [javascript_type] => controller [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.reputation.js - Controller for reputation controls * * Author: Mark Wade */ ;( function($, _, undefined){ "use strict"; ips.controller.register('core.front.core.reputation', { initialize: function () { this.on( 'click', '[data-action="giveReputation"]', this.giveReputation ); }, /** * Event handler for the reputation buttons. * * @param {event} e Event object * @returns {void} */ giveReputation: function (e) { e.preventDefault(); var self = this; var url = $( e.currentTarget ).attr('href'); var thisParent = this.scope.parent(); this.scope.css({ opacity: 0.5 }); ips.getAjax()( url ) .done( function (response) { var newHTML = $('
    ' + response + '
    ').find('[data-controller="core.front.core.reputation"]').html(); self.scope .html( newHTML ) .css({ opacity: 1 }); }) .fail( function ( jqXHR, textStatus, errorThrown ) { if ( jqXHR.responseJSON['error'] ) { ips.ui.alert.show( { type: 'alert', icon: 'warn', message: jqXHR.responseJSON['error'], callbacks: {} }); } else { window.location = url; } }); } }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => controllers/core [javascript_location] => front [javascript_position] => 1000050 [javascript_name] => ips.core.reputation.js [javascript_key] => ) [93] => Array ( [javascript_id] => 93 [javascript_plugin] => [javascript_type] => controller [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.sharelink.js - Controller to launch link in small window * * Author: Mark Wade */ ;( function($, _, undefined){ "use strict"; ips.controller.register('core.front.core.sharelink', { /** * Initialize the events that this controller will respond to * * @returns {void} */ initialize: function () { this.on( 'click', '[data-role="shareLink"]', this.launchWindow ); }, /** * Filter click * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ launchWindow: function(e) { e.preventDefault(); var url = $( e.currentTarget ).attr('href'); if ( !ips.utils.url.getParam( 'url', url ) ) { url += "&url=" + encodeURIComponent( location.href ); } if ( !ips.utils.url.getParam( 'title', url ) ) { url += "&title=" + encodeURIComponent( document.title ); } window.open( url, 'delicious','toolbar=no,width=550,height=550' ); }, }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => controllers/core [javascript_location] => front [javascript_position] => 1000050 [javascript_name] => ips.core.sharelink.js [javascript_key] => ) [94] => Array ( [javascript_id] => 94 [javascript_plugin] => [javascript_type] => controller [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.statuses.js - Controller for status updates * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.register('core.front.core.statuses', { /** * Initialize the events that this controller will respond to * * @returns {void} */ initialize: function () { this._hideReplyFields(); // Events that originate here this.on( 'click', '[data-action="delete"]', this.deleteStatus ); this.on( 'click', '[data-action="lock"]', this.lockStatus ); this.on( 'click', '[data-action="unlock"]', this.unlockStatus ); this.on( 'click', '[data-action="reply"]', this.replyStatus ); this.on( 'click', '[data-action="loadPreviousComments"]', this.loadPrevious ); this.on( 'blur', '[data-role="replyComment"] input[type="text"]', this.blurCommentField ); this.on( 'keydown', '[data-role="replyComment"] input[type="text"]', this.keydownCommentField ); //this.on( 'focus', '[data-role="replyComment"] input[type="text"]', this.focusCommentField ); // Events we watch for here this.on( document, 'lockingStatus', this.togglingStatus ); this.on( document, 'lockedStatus', this.lockedStatus ); this.on( document, 'unlockingStatus', this.togglingStatus ); this.on( document, 'unlockedStatus', this.unlockedStatus ); this.on( document, 'deletingStatus deletingComment', this.deletingStatus ); this.on( document, 'deletedStatus deletedComment', this.deletedStatus ); this.on( document, 'loadingComments', this.loadingComments ); this.on( document, 'loadedComments', this.loadedComments ); this.on( document, 'addingComment', this.addingComment ); this.on( document, 'addedComment', this.addedComment ); }, _requestCount: {}, _offsets: {}, _hideReplyFields: function () { $( this.scope ) .find('[data-statusid]') .not('.ipsComment_hasChildren') .find('.ipsComment_subComments') .hide() .end() .end() .find('[data-role="submitReply"]') .hide(); }, /** * Display previous comments on a status * * @param {event} e Event * @fires core.statuses#loadComments * @returns {void} */ loadPrevious: function (e) { e.preventDefault(); // Get status ID var link = $( e.currentTarget ), statusElem = link.parents( '[data-statusid]' ), statusID = $( statusElem ).data('statusid'); // Count how many we're showing already this._offsets[ statusID ] = ( statusElem.find('[data-commentid]').length ) * -1; this.trigger( 'loadComments', { statusID: statusID, offset: this._offsets[ statusID ] } ); }, /** * Model is loading comments * * @param {event} e Event * @param {object} data Event data object * @returns {void} */ loadingComments: function (e, data) { // Find relevant status var status = $( this.scope ).find( '[data-statusid="' + data.statusID + '"]' ); status .find('[data-action="loadPreviousComments"]') .html( ips.templates.render('core.statuses.loadingComments') ); }, /** * Comments have been loaded * * @param {event} e Event * @param {object} data Event data object * @returns {void} */ loadedComments: function (e, data) { // Find relevant status var status = $( this.scope ).find( '[data-statusid="' + data.statusID + '"]' ), loadingRow = status.find('[data-action="loadPreviousComments"]'); loadingRow.after( data.comments ); var totalShown = status.find('[data-commentid]').length; if( data.total <= totalShown ){ loadingRow.remove(); } else { loadingRow .html( ips.templates.render('core.statuses.loadMore') ) .find("[data-role='remainingCount']") .text( data.total - totalShown ); } // Let everyone know $( document ).trigger( 'contentChange', [ status ] ); }, /** * User has clicked a delete link * * @param {event} e Event * @fires core.statuses#deleteComment * @fires core.statuses#deleteStatus * @returns {void} */ deleteStatus: function (e) { e.preventDefault(); // Get status ID var link = $( e.currentTarget ), statusElem = link.parents('[data-statusid]'), commentElem = link.parents('[data-commentid]'), statusID = $( statusElem ).data('statusid'), commentID = $( commentElem ).data('commentid'); if( commentElem ){ if( confirm( ips.getString('confirmStatusCommentDelete') ) ){ /** * Requests that a model deletes this status * * @event core.statuses#deleteComment * @type {object} * @property {number} statusID The ID of the parent status * @property {number} commentID The ID of the comment to delete */ this.trigger( 'deleteComment', { statusID: statusID, commentID: commentID } ); } } else { if( confirm( ips.getString('confirmStatusDelete') ) ){ /** * Requests that a model deletes this status * * @event core.statuses#deleteStatus * @type {object} * @property {number} statusID The ID of the status to delete */ this.trigger( 'deleteStatus', { statusID: statusID } ); } } }, /** * A delete request is currently being handled by the model * * @param {event} e Event * @param {object} data Event data object * @returns {void} */ deletingStatus: function (e, data) { // Find relevant status or comment if( data.commentID ){ $( this.scope ) .find( '[data-commentid="' + data.commentID + '"]' ) .animate( { opacity: 0.5 } ); } else { $( this.scope ) .find( '[data-statusid="' + data.statusID + '"]' ) .animate( { opacity: 0.5 } ); } }, /** * Respond to the model deleting a status * * @param {event} e Event * @param {object} data Event data object * @returns {void} */ deletedStatus: function (e, data) { // Find relevant status or comment if( data.commentID ){ $( this.scope ) .find( '[data-commentid="' + data.commentID + '"]' ) .remove(); } else { $( this.scope ) .find( '[data-statusid="' + data.statusID + '"]' ) .remove(); } }, /** * User has clicked a lock status link * * @param {event} e Event * @fires core.statuses#lockStatus * @returns {void} */ lockStatus: function (e) { e.preventDefault(); // Get status ID var link = $( e.currentTarget ), statusElem = link.parents( '[data-statusid]' ), statusID = $( statusElem ).data('statusid'); /** * Requests that a model locks this status * * @event core.statuses#lockStatus * @type {object} * @property {number} statusID The ID of the status to lock */ this.trigger( 'lockStatus', { statusID: statusID } ); }, /** * User has clicked an unlock status link * * @param {event} e Event * @fires core.statuses#unlockStatus * @returns {void} */ unlockStatus: function (e) { e.preventDefault(); // Get status ID var link = $( e.currentTarget ), statusElem = link.parents( '[data-statusid]' ), statusID = $( statusElem ).data('statusid'); /** * Requests that a model locks this status * * @event core.statuses#unlockStatus * @type {object} * @property {number} statusID The ID of the status to unlock */ this.trigger( 'unlockStatus', { statusID: statusID } ); }, /** * Responds to the model locking a status * * @param {event} e Event * @param {object} data Event data object * @returns {void} */ lockedStatus: function (e, data) { // Find relevant status var status = $( this.scope ).find( '[data-statusid="' + data.statusID + '"]' ); // Find loading element $( status ) .find('[data-action="lock"]') .first() .replaceWith( ips.templates.render('core.statuses.unlock') ); this._finishedAction( e, data ); }, /** * Responds to the model unlocking a status * * @param {event} e Event * @param {object} data Event data object * @returns {void} */ unlockedStatus: function (e, data) { // Find relevant status var status = $( this.scope ).find( '[data-statusid="' + data.statusID + '"]' ); // Find loading element $( status ) .find('[data-action="unlock"]') .first() .replaceWith( ips.templates.render('core.statuses.lock') ); this._finishedAction( e, data ); }, /** * A request is currently being handled by the model * * @param {event} e Event * @param {object} data Event data object * @returns {void} */ togglingStatus: function (e, data) { // Find relevant status var status = $( this.scope ).find( '[data-statusid="' + data.statusID + '"]' ), loadingThingy = status.find('.cStatusTools_loading'); if( !loadingThingy.length ){ // Add the loading thingy status .find('.cStatusTools') .first() .append( ips.templates.render('core.statuses.statusAction') ); } else { loadingThingy.show(); } // Update number of requests we're dealing with if( !this._requestCount[ data.statusID ] ){ this._requestCount[ data.statusID ] = 1; } else { this._requestCount[ data.statusID ]++; } }, /** * Hides the loading thingy, if necessary. Called when we've finished handling a * response from the model. * * @param {event} e Event * @param {object} data Event data object * @returns {void} */ _finishedAction: function (e, data) { // Find relevant status var status = $( this.scope ).find( '[data-statusid="' + data.statusID + '"]' ), loadingThingy = status.find('.cStatusTools_loading'); this._requestCount[ data.statusID ]--; if( this._requestCount[ data.statusID ] == 0 ){ loadingThingy.remove(); } }, /** * Shows and/or focuses the comment reply box for a status * * @param {event} e Event * @returns {void} */ replyStatus: function (e) { e.preventDefault(); // Get status ID var link = $( e.currentTarget ), statusElem = link.parents( '[data-statusid]' ); if( statusElem.find('[data-commentid]').length > 0 ){ statusElem .find('[data-role="replyComment"] input[type="text"]') .focus(); return; } Debug.log( statusElem.find('.ipsComment_subComments').is(':visible') ); if( !statusElem.find('.ipsComment_subComments').is(':visible') ){ ips.utils.anim.go('fadeIn', statusElem.find('.ipsComment_subComments') ); statusElem .addClass('ipsComment_hasChildren') .find('[data-role="replyComment"] input[type="text"]') .focus(); } else { if( statusElem.find('[data-commentid]').length == 0 && field.val() == '' ){ statusElem .removeClass('ipsComment_hasChildren') .find('.ipsComment_subComments, [data-role="submitReply"]') .hide(); } } }, /** * User has blurred from the reply text field. Remove the comment box if a) there's no existing comments * b) they haven't typed anything * * @param {event} e Event * @returns {void} */ blurCommentField: function (e) { e.preventDefault(); // Get status ID var field = $( e.currentTarget ), statusElem = field.parents( '[data-statusid]' ), replyButton = statusElem.find('[data-role="submitReply"]'); if( statusElem.find('[data-commentid]').length == 0 && field.val() == '' ){ statusElem .removeClass('ipsComment_hasChildren') .find('.ipsComment_subComments') .hide(); } }, /** * User has blurred from the reply text field. Remove the comment box if a) there's no existing comments * b) they haven't typed anything * * @param {event} e Event * @returns {void} */ keydownCommentField: function (e) { var field = $( e.currentTarget ), statusElem = field.parents( '[data-statusid]' ), statusID = statusID = $( statusElem ).data('statusid'); if( e.keyCode == ips.ui.key.ENTER ){ /** * Adds a new reply to a status * * @event core.statuses#addComment * @type {object} * @property {string} content The text of the reply * @property {number} statusID The ID of the parent status */ this.trigger('addComment', { content: field.val(), statusID: statusID }); } }, /** * The model is saving a comment * * @param {event} e Event * @param {object} data Event data object * @returns {void} */ addingComment: function (e, data) { // Find relevant status var statusElem = $( this.scope ).find( '[data-statusid="' + data.statusID + '"]' ), replyRow = statusElem.find('[data-role="replyComment"]'); replyRow .find('input[type="text"]') .prop('disabled', true) .addClass('ipsField_disabled'); }, /** * A comment has been added by the model * * @param {event} e Event * @param {object} data Event data object * @returns {void} */ addedComment: function (e, data) { // Find relevant status var statusElem = $( this.scope ).find( '[data-statusid="' + data.statusID + '"]' ), replyRow = statusElem.find('[data-role="replyComment"]'), subComments = statusElem.find('.ipsComment_subComments'); if( replyRow.length ){ replyRow.before( data.comment ); } else if( subComments.length ){ subComments.append( data.comment ); } statusElem .find('[data-role="replyComment"] input[type="text"]') .val('') .blur() .prop('disabled', false) .removeClass('ipsField_disabled'); }, /** * User has focused on the reply field, so we show the reply button * * @param {event} e Event * @returns {void} */ /*focusCommentField: function (e) { e.preventDefault(); // Get status ID var field = $( e.currentTarget ), statusElem = field.parents( '[data-statusid]' ), replyButton = statusElem.find('[data-role="submitReply"]'); if( !replyButton.is(':visible') ){ replyButton.show(); } }*/ }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => controllers/core [javascript_location] => front [javascript_position] => 1000050 [javascript_name] => ips.core.statuses.js [javascript_key] => ) [96] => Array ( [javascript_id] => 96 [javascript_plugin] => [javascript_type] => controller [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.userbar.js - Controller for userbar (inbox, notifications, etc.) * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.register('core.front.core.userbar', { loaded: {}, /** * Initialize controller events * Sets up the events from the view that this controller will handle * * @returns {void} */ initialize: function () { // Events initiated here this.on( document, 'menuOpened', this.menuOpened ); }, /** * Event handler for menus being opened. Pass off to the correct method to handle * * @param {event} e Event * @param {object} data Event data object * @returns {void} */ menuOpened: function (e, data) { if( data.elemID == 'elFullInbox' || data.elemID == 'elMobInbox' ){ this._loadMenu( 'inbox', ips.getSetting('baseURL') + '?app=core&module=messaging&controller=messenger&overview=1', 'inbox' ); } else if( data.elemID == 'elFullNotifications' || data.elemID == 'elMobNotifications' ){ this._loadMenu( 'notify', ips.getSetting('baseURL') + '?app=core&module=system&controller=notifications', 'notify' ); } else if( data.elemID == 'elFullReports' || data.elemID == 'elMobReports' ){ this._loadMenu( 'reports', ips.getSetting('baseURL') + '?app=core&module=modcp&controller=modcp&tab=reports&overview=1', 'reports' ); } }, /** * Loads one of the nav bar menus * * @param {string} type Type of content being loaded * @param {string} url URL to fetch the content * @param {string} contentID Prefix used for the elements for this type (e.g. elInbox) * @returns {void} */ _loadMenu: function (type, url, contentID) { if( !this.loaded[ type ] ){ var self = this; var ajaxObj = ips.getAjax(); $('[data-role="' + contentID + 'List"]') .css( { height: '100px' } ) .addClass('ipsLoading'); ajaxObj( url, { dataType: 'json' } ) .done( function (returnedData) { // Add this content to the menu $('[data-role="' + contentID + 'List"]') .css( { height: 'auto' } ) .removeClass('ipsLoading') .html( returnedData.data ); // Remember we've loaded it self.loaded[ type ] = true; // Remove the notification count if( contentID != 'reports' ){ ips.utils.anim.go( 'fadeOut', $('[data-notificationType="' + contentID + '"]') ); } $( document ).trigger( 'contentChange', [ $('[data-role="' + contentID + 'List"]') ] ); }) .fail( function () { //self.trigger('topicLoadError'); }); } } }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => controllers/core [javascript_location] => front [javascript_position] => 1000050 [javascript_name] => ips.core.userbar.js [javascript_key] => ) [173] => Array ( [javascript_id] => 173 [javascript_plugin] => [javascript_type] => model [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.comment.js - Comment model * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.model.register('core.comment', { initialize: function () { this.on( 'getEditForm.comment', this.getEditForm ); this.on( 'saveEditComment.comment', this.saveEditComment ); this.on( 'deleteComment.comment', this.deleteComment ); this.on( 'newComment.comment', this.newComment ); this.on( 'approveComment.comment', this.approveComment ); }, /** * Retrieves edit form * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ getEditForm: function (e, data) { this.getData( { url: data.url, dataType: 'html', data: { url: data.url }, events: 'getEditForm', namespace: 'comment' }, data); }, /** * Saves edit back to server * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ saveEditComment: function (e, data) { var url = data.url; this.getData( { url: data.url, dataType: 'html', type: 'post', data: data.form || {}, events: 'saveEditComment', namespace: 'comment' }, data); }, /** * Approves comment * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ approveComment: function (e, data) { this.getData( { url: data.url, dataType: 'html', data: data.form || {}, events: 'approveComment', namespace: 'comment' }, data); }, /** * Deletes comment * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ deleteComment: function (e, data) { this.getData( { url: data.url, dataType: 'html', data: data.form || {}, events: 'deleteComment', namespace: 'comment' }, data); }, /** * Adds a new comment * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ newComment: function (e, data) { this.getData( { url: data.url, dataType: 'json', data: data.form || {}, events: 'newComment', namespace: 'comment' }, data); } }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => models/core [javascript_location] => front [javascript_position] => 1000050 [javascript_name] => ips.core.comment.js [javascript_key] => ) [172] => Array ( [javascript_id] => 172 [javascript_plugin] => [javascript_type] => mixins [javascript_content] => /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.core.table.js - Front-end mixin for tables * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.mixin('contentListing', 'core.global.core.table', true, function () { /** * Adds front-end table events * * @returns {void} */ this.after('initialize', function () { //this.on( 'submit', '[data-role="moderationTools"]', this.moderationSubmit ); this.on( 'menuItemSelected', '[data-role="sortButton"]', this.changeSorting ); this.on( 'change', '[data-role="moderation"]', this.selectRow ); this.on( 'click', '[data-action="markAsRead"]', this.markAsRead ); this.on( 'paginationClicked', this.frontPaginationClicked ); this.on( 'markTableRead', this.markAllRead ); $( document ).on( 'markTableRowRead', _.bind( this.markRowRead, this ) ); $( document ).on( 'markAllRead', _.bind( this.markAllRead, this ) ); }); this.after('setup', function () { this._tableID = this.scope.attr('data-tableID'); }); /** * Show the table as loading before the ajax * * @returns {void} */ this.before('_getResults', function () { this._setTableLoading( true ); }); /** * Switch off table loading after results are fetched * * @returns {void} */ this.after('_getResultsAlways', function () { this._setTableLoading( false ); }); /** * After the table is updated, check for any pageAction widgets and refresh them * * @returns {void} */ this.after('_updateTable', function () { this.scope.find('[data-ipsPageAction]').trigger('refresh.pageAction'); }); /** * Marks everything in this table as read * * @returns {void} */ this.markAllRead = function () { // Update row this.scope .find('.ipsDataItem, .ipsDataItem_subList .ipsDataItem_unread') .removeClass('ipsDataItem_unread') .find('.ipsItemStatus') .addClass('ipsItemStatus_read'); }, /** * Marks a row in this table read * * @returns {void} */ this.markRowRead = function (e, data) { // Make sure we're working on the right table if( _.isUndefined( data.tableID ) || data.tableID != this._tableID ){ return; } // Update row this.scope .find('[data-rowID="' + data.rowID + '"]') .removeClass('ipsDataItem_unread') .find('.ipsItemStatus') .addClass('ipsItemStatus_read'); }, /** * Scroll to pagination when clicked * * @param {event} e Event object * @returns {void} */ this.frontPaginationClicked = function () { // Get top postition of table var elemPosition = ips.utils.position.getElemPosition( this.scope ); $('html, body').animate( { scrollTop: elemPosition.absPos.top + 'px' } ); }; /** * Toggles classes when the moderation checkbox is checked * * @param {event} e Event object * @returns {void} */ this.selectRow = function (e) { var row = $( e.currentTarget ).closest('.ipsDataItem'); row.toggleClass( 'ipsDataItem_selected', $( e.currentTarget ).is(':checked') ); }; /** * Mark as read functionality for table rows * * @param {event} e Event object * @returns {void} */ this.markAsRead = function (e) { e.preventDefault(); var self = this; var item = $( e.currentTarget ); var url = item.attr('href'); // Update row var row = item.closest('.ipsDataItem'); row.removeClass('ipsDataItem_unread').find('.ipsItemStatus').addClass('ipsItemStatus_read'); row.find('.ipsDataItem_subList .ipsDataItem_unread').removeClass('ipsDataItem_unread'); ips.utils.anim.go( 'fadeOut', $('#ipsTooltip') ); item.removeAttr('data-ipstooltip').removeAttr('title'); // Mark as read on server ips.getAjax()( url, { bypassRedirect: true } ) .done( function (response) { item.trigger('markedAsRead'); }) .fail( function () { // Reset styles item .closest('.ipsDataItem') .addClass('ipsDataItem_unread') .find('.ipsItemStatus') .removeClass('ipsItemStatus_read'); ips.ui.alert.show( { type: 'alert', icon: 'error', message: ips.getString('errorMarkingRead'), callbacks: { ok: function () {} } }); }); }; /** * Update the content and pagination elements * * @param {object} response JSON object containing new HTML pieces * @returns {void} */ this._setTableLoading = function (loading) { var rows = this.scope.find('[data-role="tableRows"]'); if( !rows.length ){ return; } if( !this._tableOverlay ){ this._tableOverlay = $('
    ').addClass('ipsLoading').hide(); ips.getContainer().append( this._tableOverlay ); } if( loading ){ // Get dims & position var dims = ips.utils.position.getElemDims( rows ); var position = ips.utils.position.getElemPosition( rows ); this._tableOverlay.show().css({ left: position.viewportOffset.left + 'px', top: position.viewportOffset.top + 'px', width: dims.width + 'px', height: dims.height + 'px', position: 'absolute', zIndex: ips.ui.zIndex() }); rows.css({ opacity: 0.5 }); } else { rows.animate({ opacity: 1 }); this._tableOverlay.hide(); } }; /** * Change the sorting * * @param {event} e Event object * @param {object} data Event data object * @returns {void} */ this.changeSorting = function (e, data) { data.originalEvent.preventDefault(); var current = this._getSortValue(); var menuItem = data.menuElem.find('[data-ipsMenuValue="' + data.selectedItemID + '"]'); var sortBy = data.selectedItemID; var sortDirection = current.order; // Does this option also have a direction? if( menuItem.attr('data-sortDirection') ){ sortDirection = menuItem.attr('data-sortDirection'); } this.updateURL( { sortby: sortBy, sortdirection: sortDirection, page: 1 }); }; /** * Updates element classnames for filtering * * @param {string} newFilter Filter ID of new filter to select * @returns {void} */ this._updateFilter = function (newFilter) { // This space left intentionally blank }; /** * Returns the current sort by and sort order value * * @returns {object} Object containing by and order keys */ this._getSortValue = function () { var by = ips.utils.url.getParam('sortby'); var order = ips.utils.url.getParam('sortdirection'); return { by: by || '', order: order || '' }; }; /** * Returns the current sort by and sort order value * * @returns {object} Object containing by and order keys */ this._getFilterValue = function () { var filter = ips.utils.url.getParam('filter'); return filter || ''; }; }); }(jQuery, _)); [javascript_version] => 100025 [javascript_app] => global [javascript_path] => mixins [javascript_location] => front [javascript_position] => 1000100 [javascript_name] => ips.core.table.js [javascript_key] => ) ) [1] => front.js [2] => global [3] => root ) ) [5] => Array ( [file] => /home/active/general/soompi/fr/system/Output/Output.php [line] => 446 [function] => compile [class] => IPS\Output\_Javascript [type] => :: [args] => Array ( [0] => global [1] => root [2] => front.js ) ) [6] => Array ( [file] => /home/active/general/soompi/fr/system/Output/Output.php [line] => 232 [function] => _getJavascriptFileObject [class] => IPS\_Output [type] => :: [args] => Array ( [0] => global [1] => root [2] => front.js ) ) [7] => Array ( [file] => /home/active/general/soompi/fr/system/Dispatcher/Front.php [line] => 443 [function] => js [class] => IPS\_Output [type] => -> [args] => Array ( [0] => front.js ) ) [8] => Array ( [file] => /home/active/general/soompi/fr/system/Dispatcher/Front.php [line] => 54 [function] => baseJs [class] => IPS\Dispatcher\_Front [type] => :: [args] => Array ( ) ) [9] => Array ( [file] => /home/active/general/soompi/fr/system/Dispatcher/Dispatcher.php [line] => 86 [function] => init [class] => IPS\Dispatcher\_Front [type] => -> [args] => Array ( ) ) [10] => Array ( [file] => /home/active/general/soompi/fr/index.php [line] => 13 [function] => i [class] => IPS\_Dispatcher [type] => :: [args] => Array ( ) ) ) [previous:Exception:private] => )