This repository has been archived on 2022-05-20. You can view files and clone it, but cannot push or open issues or pull requests.
Calculators/Download/Calculators A First Look at the TI-Nspire CX II_files/cmty_core.js

8 lines
655 KiB
JavaScript
Raw Normal View History

2022-05-20 18:50:33 +00:00
AoPS.hasOwnProperty("Community")||(AoPS.Community={}),AoPS.Community.Constants={base_url:"https://"+location.hostname,community_main_color:"#009fad",community_secondary_color:"#dae7f6",privates_main_color:"#009fad",privates_secondary_color:"#dae7f6",time_limits:{watched_times_short:3600,watched_times_long:21600},max_times_to_watch:{watched_times_short:1e3,watched_times_long:1500},very_large_time:6e9,old_topic_age_in_seconds:43200,intervals:{current:{new_item_check_interval:12e4,new_item_check_interval_long:24e4,topic_update_interval:6e4,topic_update_interval_long:3e5,reported_posts_interval:2e4,watchers_updates_check_interval:3e5,fetch_forum_users_interval:3e5,put_community_to_sleep_limit:12e5},active:{new_item_check_interval:12e4,new_item_check_interval_long:24e4,topic_update_interval:6e4,topic_update_interval_long:3e5,reported_posts_interval:2e4,watchers_updates_check_interval:3e5,fetch_forum_users_interval:3e5,put_community_to_sleep_limit:12e5},slow:{new_item_check_interval:24e4,new_item_check_interval_long:48e4,topic_update_interval:12e4,topic_update_interval_long:6e5,reported_posts_interval:12e4,watchers_updates_check_interval:6e5,fetch_forum_users_interval:6e5,put_community_to_sleep_limit:9e5},disabled:{new_item_check_interval:2147483647,topic_update_interval:2147483647,topic_update_interval_long:2147483647,reported_posts_interval:2147483647,watchers_updates_check_interval:2147483647,fetch_forum_users_interval:2147483647}},idle_monitor_interval:1e3,fetch_office_hours_interval:3e4,moment_offset:0,base_delay_internet_issue:10,time_limit_for_calendar_style:172800,time_limit_edit_own:1209600,time_limit_delete_own:1209600,watched_times_short_interval:59800,watched_times_long_interval:1200137,UNUSED_new_item_check_interval:60103,UNUSED_new_item_check_interval_short:60103,UNUSED_new_item_check_interval_long:240103,UNUSED_topic_update_interval:38741,UNUSED_topic_update_interval_long:218741,UNUSED_reported_posts_interval:20341,UNUSED_watchers_updates_check_interval:195091,UNUSED_fetch_forum_users_interval:81137,phone_mode_max_width:768,min_preview_height:320,min_draggable_reply_height:290,min_posts_window_height:50,min_stupid_view_reply_textarea:50,max_conversation_participants:10,max_forums_user_update:50,min_topic_list_initial_length:6,max_num_shown_topics:78,num_topics_to_hide:20,num_topics_to_reveal:10,master_category_id:2,portal_category_id:89,private_messages_id:1,aops_forums_id:11,other_forums_id:9,olympiad_forum_id:6,college_math_forum_id:7,recycle_bin_id:22,blog_recycle_bin_id:104,aops_videos_id:64,aops_wiki_id:65,aops_blogroll_id:88,halp_user_id:10,unsearchable_fora:[50,63],essential_tags_olympiad:["algebra","geometry","combinatorics","number theory","inequalities","imo"],essential_tags_college:["calculus","real analysis","linear algebra","superior algebra","complex analysis","advanced fields","probability and stats","number theory","topology","putnam","college contests"],private_archive_url:"/my-messages-archive/",reply_jump_to_bottom_window:100,move_topic_quick_links:{3:[4,5,6,7],4:[3,5,6,7],5:[3,4,6,7],6:[3,4,5,7],7:[3,4,5,6]},min_topic_title_length:8,max_topic_title_length:80,max_tags_per_topic:7,min_poll_question_length:8,max_poll_question_length:255,min_post_length:8,max_post_length:4e4,max_source_length:128,posting_ajax_timeout:6e4,posting_warn_limit:20,time_hack_nudge:2e4,new_topic_modal_delay:1200,new_reply_modal_delay:1200,message_readability_delay:1200,message_readability_delay_short:1200,num_posts_to_fetch:20,topic_move_length_limit:250,user_path:"/community/user/",max_shout_length:255,itembox_input_width:150,max_categories_to_load:10,category_autocomplete_width:275,tag_autocomplete_width:250,num_users_whois_online:120,profile_field_length_limit:120,min_password_length:4,max_password_length:128,max_avatar_file_size:24,max_attachment_size:512,max_attachments_per_post:3,default_avatar:"//avatar.artofproblemsolving.com/no-avatar.png",attachment_path:AoPS.bootstrap_data.cmty_attachment_path,max_length_feed_list_read_check:100,view_post_max_label_len:12,view_post_max_hide_label_len:255,can_oneclick_ban:[11
;AoPS.Community.Lang={"Add-Note":"Add Note",Admin:"Admin",Administrators:"Administrators",At:"At","Back-to":"Back to",Banned:"Banned",blog:"blog",Bookmarks:"Bookmarks",Build:"Build",by:"by",By:"By",cancel:"cancel",Cancel:"Cancel",collection:"collection","command-click":"command-click",Community:"Community",Contributors:"Contributors","control-click":"control-click",Conversations:"Conversations",create:"create",Create:"Create",Custom:"Custom","data-saved":"Data saved!","data-saved-reload":"Data saved! You will see your changes when you reload the community",Delete:"Delete",Email:"Email","Enter-username":"Enter username",FAQ:"Help",Flyout:"Flyout",forum:"forum",Forum:"Forum",Full:"Full",in:"in",Info:"Info",information:"information",IP:"IP","logged-out":"You have been signed out. Please sign back in and try again.","Login/Join":"Login / Join",Message:"Message",Messages:"Messages",Mod:"Mod",Modal:"Modal",Moderators:"Moderators",MyAoPS:"My AoPS",no:"No",No:"No",NO:"NO",None:"None",Note:"Note",Notes:"Notes","permanent-link":"Permanent Link",Popup:"Pop-up",Private:"Private","Private-Messages":"Private Messages","Private-Message-Search":"Private Message Search",Profile:"Profile",Public:"Public",Readers:"Readers",Reason:"Reason",Reset:"Reset",Save:"Save",saved:"saved","saving-blocker":"Saving data... Back soon.",SEARCH:"SEARCH","search-no-match":"Nothing matches your input.",Search:"Search","Search-Results":"Search Results",Short:"Short",Submit:"Submit",Subscribe:"Subscribe",Tag:"Tag",Tall:"Tall","unexpected-error-code":"There has been an unexpected error. Please contact tech-support@aops.com and tell them exactly\t\t what you were doing to trigger this, and include this magic code: ","unexpected-logout":"You have been signed out\t\t\t\t\tby nefarious computer gremlins. If you are in the middle\t\t\t\t\tof entering text, you should copy your work before logging back in.",Users:"Users",Unsubscribe:"Unsubscribe",Username:"Username",views:"views",viewing:"viewing",view:"view",Welcome:"Welcome",yes:"Yes",Yes:"Yes",YES:"YES","month-01":"January","month-02":"February","month-03":"March","month-04":"April","month-05":"May","month-06":"June","month-07":"July","month-08":"August","month-09":"September","month-10":"October","month-11":"November","month-12":"December","admin-validation":'<div>Enter magic admin phrase<br><input name="admin-validate" type="password"></input></div>',"admin-validate-failed":"Validation failed","ajax-error-delay":"Error talking to the server. Check your internet connection. We'll try again in {0} seconds.","ajax-error-E_AJAX_UNKNOWN":"An error has occurred that is preventing your computer from connecting to the \t\tAoPS site. Please check your internet connection and then refresh the page. If you are working on something, please save your work \t\tbefore refreshing.","user-item-online":'<span class="cmty-user-online">Online</span>',"invalid-user":"The username <b>{0}</b> is not a valid username.","tag-tooltip-forum":"In forum: ","error-timeout":"The server has timed out while working on your request. Please\t\trefresh the page to see if it finished what it was supposed to do before so\t\tignominiously giving up.","err-no-such-session":"Sorry, your session appears to have changed, so you must refresh \t\tyour browser before continuing to use the site. This can happen when you \t\tare logged in to Art of Problem Solving on multiple tabs of the same browser, and then \t\tsign out on one of those tabs. Please refresh your browser after saving any work you have \t\tin progress.","err-dropzone-fallback":"Sorry, attaching documents in our community is not supported by your browser. Please choose another browser.","err-unknown":"Unknown error occurred. Here's the code they gave me: <b>{0}</b>.","err-no-permission":"Sorry, you do not have permission to perform this action.","editable-length-limit-exceeded-on-paste":"You pasted too much! I'm cutting some out.","user-list-validation-blocker":"Validating username...","err-bookmark-limit-reached":"Bookmark limit reached. This item was not bookmarked.","err-co
;function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}AoPS.hasOwnProperty("Community")||(AoPS.Community={}),AoPS.Community.is_active=AoPS.bootstrap_data.hasOwnProperty("is_community_active")&&AoPS.bootstrap_data.is_community_active,AoPS.Community.Utils={ajax_runner:new AoPS.Ajax.ScriptRunner("/m/community/ajax.php"),onclick_latex_activated:!1,activateLatexOnclick:function(){AoPS.Community.Utils.onclick_latex_activated||($(document).on("click","img.latex, img.latexcenter",(function(t){AoPS.bootstrap_data.is_sp2&&$(this).parents(".aops-transporter-main").length||t.metaKey||t.ctrlKey||$(this).attr("alt")&&0===$(this).closest(".aops-modal-body").length&&AoPS.Community.Utils.throwLaTeXOnModal({event:t,latex_image:this})})),$(document).on("click","img.asy-image",(function(t){AoPS.bootstrap_data.is_sp2&&$(this).parents(".aops-transporter-main").length||$(this).parents(".motor-homework-body").length||t.metaKey||t.ctrlKey||$(this).attr("alt")&&0===$(this).closest(".aops-modal-body").length&&AoPS.Community.Utils.throwAsyOnModal({event:t,asy_image:this})})),AoPS.Community.Utils.onclick_latex_activated=!0)},throwLaTeXOnModal:function(t){var e,o=t.latex_image.cloneNode(!1),r=$.trim(_.escape(t.latex_image.alt)).replace(/(?:\r\n|\r|\n)/g,"<br />");(e=$('<div class="latex-modal"></div>').append(o)).append('<div class="latex-modal-bottom">\t\t\t\t\t\t\t<div class="latex-modal-bottom-title"><u>LaTeX code below</u></div>\t\t\t\t\t\t\t<div class="latex-modal-code">'+r+"</div>\t\t\t\t\t\t</div>"),e.showModal&&e.showModal({frame_class:"latex-modal-wrapper",max_width:"500px",scrollable:!0})},formatUrl:function(t){return"http://"===t.substr(0,7)||"https://"===t.substr(0,8)?t:"http://"+t},idler_started:!1,is_cmty_asleep:!1,putCommunityToSleep:function(t){AoPS.Community.Utils.cmty_ajax.ajax_active=!1,AoPS.Community.Utils.is_cmty_asleep=!0,t&&"E_INVALID_SESSION_WRONG"===t.error_type&&(AoPS.Community.Lang["community-asleep"]=AoPS.Community.Lang["community-asleep-session"],AoPS.Community.Lang["community-asleep-save"]=AoPS.Community.Lang["community-asleep-save-session"],AoPS.Community.Lang["community-asleep-reminder"]=AoPS.Community.Lang["community-asleep-reminder-session"]),AoPS.Ui.Modal.showMessage(AoPS.Community.Lang["community-asleep"],{width:"450px"}),_.isUndefined(AoPS.Community.Utils.idle_monitor_interval)||(clearInterval(AoPS.Community.Utils.idle_monitor_interval),this.idler_started=!1),"object"===_typeof(AoPS.Community.MasterModel)&&AoPS.Community.MasterModel.set("cmty_status","disabled")},startIdleMonitor:function(){var t=Date.now();this.idler_started||($(document).on("mousemove touchmove click keypress",(function(e){t=Date.now()})),AoPS.Community.Utils.idle_monitor_interval=setInterval((function(){var e=Date.now(),o=AoPS.Community.Constants.intervals.current.put_community_to_sleep_limit;e-t>=o&&AoPS.Community.Utils.putCommunityToSleep()}),AoPS.Community.Constants.idle_monitor_interval))},throwAsyOnModal:function(t){var e,o=t.asy_image.cloneNode(!1),r=$.trim(_.escape(t.asy_image.alt)).replace(/(?:\r\n|\r|\n)/g,"<br />");(e=$('<div class="latex-modal"></div>').append(o)).append('<div class="latex-modal-bottom">\t\t\t\t\t\t\t<div class="latex-modal-bottom-title"><u>Asymptote code below</u></div>\t\t\t\t\t\t\t<div class="latex-modal-code">'+r+"</div>\t\t\t\t\t\t</div>"),e.showModal({frame_class:"latex-modal-wrapper",max_width:"500px",scrollable:!0})},extractValueFromUrl:function(t,e){var o;return _.isNull(e)?0:(o=e.match(new RegExp(t+"(\\d+)")),_.isNull(o)?0:parseInt(o[1]))},hexToRgb:function(t){var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null},cmty_ajax:{queue:[],has_active_call:!1,time_profiling:!0,ajax_active:!0,fail_level:0,add:function(t){var e=_.extend({never_cancel:!1,source:"master",call_cancel_on_timeout:!1},t);this.ajax_active?this.has_active_call?(e.hasOwnP
;function _createForOfIteratorHelper(t,e){var s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!s){if(Array.isArray(t)||(s=_unsupportedIterableToArray(t))||e&&t&&"number"==typeof t.length){s&&(t=s);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,r=!0,n=!1;return{s:function(){s=s.call(t)},n:function(){var t=s.next();return r=t.done,t},e:function(t){n=!0,a=t},f:function(){try{r||null==s.return||s.return()}finally{if(n)throw a}}}}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var s=Object.prototype.toString.call(t).slice(8,-1);return"Object"===s&&t.constructor&&(s=t.constructor.name),"Map"===s||"Set"===s?Array.from(t):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,i=new Array(e);s<e;s++)i[s]=t[s];return i}function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}AoPS.Community.Models=function(t){var e,s=AoPS.Community.Lang,i=AoPS.Community.Constants,o=AoPS.Community.Utils;return e=o.cmty_ajax,t.Model=Backbone.Model.extend({setDefault:function(t,e){this.has(t)||this.set(t,e)}}),t.Master=Backbone.Model.extend({defaults:{all_past_reported_posts_fetched:!1,loading_post_reports:!1,topic_data_loaded:!1,fullscreen_mode:!1,topics_loading:!1,focus_topic:null,focus_tag:null,topic_lists:{},ajax_data_queue:[],is_fetching_topics:!1,is_stretch_class:!1,watched_users:[],my_aops:null,my_books:null,my_classes:null,my_forums:null,my_bookmarks:null,my_collections:null,my_blogs:null,monitoring_office_hours:!1,watched_times_short:[],watched_times_long:[],last_reported_posts_fetch_time:0,in_change_focus_topic:!1,private_items_fetched:!1,in_community:!1,is_parsing_bbcode:!1},initialize:function(){var e,s,o,a,r=this,n={};AoPS.Community.MasterModel=this,AoPS.Community.Constants.moment_offset=moment(AoPS.bootstrap_data.server_time).diff(new Date),this.set("topics",new(Backbone.Collection.extend({model:t.Topic}))),this.set("global_announcements",new(Backbone.Collection.extend({model:t.Topic}))),this.listenTo(this.get("global_announcements"),"change:announce_type",this.onGlobalAnnounceDemote),this.get("topics").comparator=function(t){return t.get("topic_id")},this.set("users",new(Backbone.Collection.extend({model:t.User}))),this.get("users").comparator=function(t){return t.get("user_id")},"string"==typeof AoPS.bootstrap_data.cmty_status?this.set("cmty_status",AoPS.bootstrap_data.cmty_status):this.set("cmty_status","normal"),this.listenTo(this,"change:cmty_status",this.setIntervals),this.setIntervals(),this.constructIntervalAjax({method:function(){r.rebuildWatchedTimes("watched_times_short")},interval_property:"watched_times_short_interval"}),this.constructIntervalAjax({method:function(){r.rebuildWatchedTimes("watched_times_long")},interval_property:"watched_times_long_interval"}),this.set("cached_tag_ids",{}),this.set("topic_lists",new(Backbone.Collection.extend({model:t.TopicList}))),this.set("categories",new(Backbone.Collection.extend({model:t.Category}))),this.set("priv_categories",new(Backbone.Collection.extend({model:t.CategoryPriv}))),this.set("user_search_categories",new(Backbone.Collection.extend({model:t.Category}))),this.set("search_categories",new(Backbone.Collection.extend({model:t.CategorySearch}))),this.set("last_topic_fetch_time",parseInt(AoPS.bootstrap_data.init_time));var c="new_item_check_interval";this.hasLongNewItemInterval()&&(c="new_item_check_interval_long"),this.constructIntervalAjax({interval_property:c,method:function(){r.fetchNewTopics()}}),this.set("last_watcher_fetch_time",parseInt(AoPS.bootstrap
;function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}AoPS.Community.Views=function(t){var e=AoPS.Community.Lang,i=AoPS.Community.Constants,o=AoPS.Community.Utils,s=AoPS.Ui.Modal,n=AoPS.Ui.Flyout;return t.in_academy=AoPS.in_academy,t.clicking=!1,$(document).on("mousedown.watcher",(function(){t.clicking=!0})).on("mouseup.watcher",(function(){t.clicking=!1})),t.isIOS=navigator.userAgent.match(/iPhone|iPad|iPod/i),t.isIOS&&(i.max_num_shown_topics=170,i.num_topics_to_hide=80,i.num_topics_to_reveal=40),jQuery.fn.extendedHighlightText=function(t,e){var i,o=$(this);i=(e=e.replace(/[^a-zA-Z0-9\' _-]/g," ").replace(/ +(?= )/g,"")).split(" "),_.each(i,(function(e){o.highlightText(t,e)}))},jQuery.fn.cmtyLoadFromFile=function(t){var e=$(this);o.cmty_ajax.add({a:"load_file",params:{filename:t.filename},main_handler:function(t,i){t&&e.html(i.response.file_contents)},extra_handlers:t})},jQuery.fn.highlightText=function(t,e){var i=new RegExp(e.toUpperCase().replace(/\*/,".*"));function o(e,s){var n,a,r,l,c,d=0;if(3===e.nodeType)n=e.data.toUpperCase().match(i),_.isNull(n)||((a=document.createElement("span")).className=t,l=(r=e.splitText(n.index)).cloneNode(!0),a.appendChild(l),r.parentNode.replaceChild(a,r),d=1);else if(1===e.nodeType&&e.childNodes&&!/(script|style)/i.test(e.tagName))for(c=0;c<e.childNodes.length;++c)c+=o(e.childNodes[c],s);return d}return this.length&&e&&e.length?this.each((function(){o(this,e.toUpperCase())})):this},jQuery.fn.stripSpansByClass=function(t){return this.find("span."+t).each((function(){this.parentNode.replaceChild(this.firstChild,this),this.parentNode.normalize()})).end()},t.buildCommunityScrollbar=function(t){if(t){var e={fade_start_class:"aops-scroll-fade-top",fade_end_class:"aops-scroll-fade-bottom",slider_end_tolerance:2,autosize:!0,autosize_nudge:8,stop_scroll_propagation:!0},i=1===arguments.length?e:_.extend(e,arguments[1]),o=t.wrapWithScroll(i);return o.addClass("cmty-scroll-outer"),o}},t.inCmtyRouter=function(){return AoPS.hasOwnProperty("pushState_attr")&&"data-cmty"===AoPS.pushState_attr},t.throwAjaxError=function(t){var i;if("E_NO_PERMISSION"===t.error_code)i=e["err-no-permission"];else i=o.formatString(e["err-unknown"],[t.error_code]);s.showAlert(i,{onClose:function(){s.closeAllModals()}})},t.onPMPage=function(){return"my-message"===Backbone.history.fragment.substring(0,10)},t.setTabTarget=function(t,e){t.on("keydown",(function(i){var o=i.which||i.keyCode;!0!==t.data("suppress_tab")&&(9!==o||i.shiftKey||(e.focus(),i.stopPropagation(),i.preventDefault()))})),e.on("keydown",(function(i){var o=i.which||i.keyCode;!0!==e.data("suppress_tab")&&9===o&&i.shiftKey&&(t.focus(),i.stopPropagation(),i.preventDefault())}))},t.setRouteInfo=function(t,e){var i=function(i,o){return"string"==typeof e[i]?e[i]:"string"==typeof t[i]?t[i]:o};t.url_cmty_path=i("url_cmty_path",""),t.url_router_base=i("url_router_base","/community"),t.push_state_attribute=i("push_state_attribute","data-cmty")},t.launchNewPrivateMessage=function(e){return"boolean"==typeof e.is_admin&&(e.is_admin=e.is_admin?1:0),new t.NewPrivateConversation({category_name:"",category_id:i.private_messages_id,model:AoPS.Community.MasterModel.get("my_privates"),preset_recipients:[{label:e.username,user_id:e.user_id,is_visible:!0,is_admin:e.is_admin}],master:AoPS.Community.MasterModel})},t.buildSelectRow=function(t){var e=$('<div class="cmty-select-row"></div>'),i=$("<select></select>"),o=t.hasOwnProperty("bold")&&t.bold,s=t.hasOwnProperty("selected")?t.selected:"";return _.each(t.options,(function(t){i.append('<option value="'+t.value+'" '+(t.value===s?"selected":"")+">"+t.label+"</option>")})),i.change((function(){t.action(i.val())})),e.append($('<div class="cmty-select-row-select"></div>').append(i)),e.append($('<div class="cmty-select-row-text">'+(o?"<b>":"")+t.text+(o?"</b>":"")+"</div>")),e},t.buildLinkLabelRow=function(t){var e=$('<div class="cmty-link-labe
;function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}AoPS.Feed=function(e){var t=AoPS.Community.Lang;return e.preloaded_topic=null,e.preload_feed_tag_id=0,e.preload_feed_tag_text="",e.constructFeed=function(){var e,t;if(AoPS.Community.is_active)return"object"===_typeof(this.community_master)||(AoPS.Community.hasOwnProperty("MasterModel")||(AoPS.Community.MasterModel=new AoPS.Community.Models.Master({in_community:!1})),this.community_master=AoPS.Community.MasterModel,this.feed_master=new AoPS.Community.Models.Feed({master:this.community_master}),this.feed_view=new AoPS.Feed.Views.FeedMaster({model:this.feed_master}),AoPS.Feed.Master=this.feed_master,AoPS.bootstrap_data.hasOwnProperty("preload_feed_focus_topic")&&(AoPS.Feed.preloaded_topic=this.community_master.processPotentialNewTopic(AoPS.bootstrap_data.preload_feed_focus_topic)),AoPS.bootstrap_data.hasOwnProperty("preload_feed_tag_id")&&(AoPS.Feed.preload_feed_tag_id=parseInt(AoPS.bootstrap_data.preload_feed_tag_id)),AoPS.bootstrap_data.hasOwnProperty("preload_feed_tag_text")&&(AoPS.Feed.preload_feed_tag_text=AoPS.bootstrap_data.preload_feed_tag_text),_.isNull(AoPS.Feed.preloaded_topic)||(e=AoPS.Feed.preloaded_topic.get("category_id"),this.feed_view.$el.addClass("feed-preloaded-topic")),$("body").append(this.feed_view.$el),_.isNull(AoPS.Feed.preloaded_topic)||(t="string"==typeof AoPS.bootstrap_data.page_feed_preload_title?AoPS.bootstrap_data.page_feed_preload_title:"Linked Item Topics",this.openPageFeed({category_id:e,tag_id:AoPS.Feed.preload_feed_tag_id,tag_text:AoPS.Feed.preload_feed_tag_text,subtitle:t}),this.feed_master.set("focus_topic",AoPS.Feed.preloaded_topic))),{community_master:this.community_master,feed_master:this.feed_master,feed_view:this.feed_view}},e.setPageFeedSubtitle=function(e){var t;AoPS.Community.is_active&&(t=this.feed_view.page_subfeed.view.$el.find(".feed-subtitle"),this.feed_master.get("page_subfeed_settings").subtitle=e,0===e.length?this.feed_view.page_subfeed.view.$el.find(".feed-subtitle").remove():t.length>0?t.html(e):(t='<div class="feed-subtitle">'+e+"</div>",this.feed_view.page_subfeed.view.$el.find(".feed-subfeed-header").after(t)))},e.setPageFeed=function(e){var t,o=!1;if(AoPS.Community.is_active){if(t=this.feed_master.get("page_subfeed_settings"),this.feed_view.$el.removeClass("feed-hide-page-feed"),"number"==typeof arguments[0]){if(0===e)return;e={category_id:arguments[0]},1===arguments.length?e.tag_id=0:("number"==typeof arguments[1]?e.tag_id=arguments[1]:e.tag_text=arguments[1],3===arguments.length&&(e.subtitle=arguments[2]))}else e=_.extend({tag_id:0,subtitle:""},e);return t.hasOwnProperty("category_id")&&e.hasOwnProperty("category_id")&&t.category_id===e.category_id?e.hasOwnProperty("tag_id")&&e.tag_id>0?t.hasOwnProperty("tag_id")&&parseInt(t.tag_id)===e.tag_id||(o=!0):e.hasOwnProperty("tag_text")&&e.tag_text.length>0?t.hasOwnProperty("tag_text")&&t.tag_text===e.tag_text||(o=!0):t.hasOwnProperty("tag_id")&&parseInt(t.tag_id)>0&&(o=!0):o=!0,o&&this.feed_master.set("page_subfeed_settings",e),o}},e.hidePageFeed=function(){AoPS.Community.is_active&&(this.feed_view.$el.addClass("feed-hide-page-feed"),this.feed_view.page_subfeed===this.feed_view.active_subfeed&&this.feed_view.closeFeed())},e.closePageFeed=function(){AoPS.Community.is_active&&this.feed_view.page_subfeed===this.feed_view.active_subfeed&&(AoPS.Feed.feed_master.set("focus_topic",null),this.feed_view.closeFeed())},e.openPageFeed=function(e){if(AoPS.Community.is_active){if("number"==typeof arguments[0]){if(0===e)return;e={category_id:arguments[0],subtitle:""},1===arguments.length?e.tag_id=0:"number"==typeof arguments[1]?e.tag_id=arguments[1]:(e.tag_id=0,e.tag_text=arguments[1]),3===arguments.length&&(e.subtitle=arguments[2])}else e=_.extend({tag_id:0},e);this.setPageFeed(e)||!AoPS.Feed.feed_view.isPageSubfeedOpen()||e.hasOwnProperty("force_open")&&e.force_open?this.activatePageSubf
;AoPS.Feed=AoPS.Feed||{},AoPS.Feed.Views=function(e){var t=AoPS.Community.Lang,i=AoPS.Community.Utils,s=AoPS.Ui.Flyout;return e.processFeedTopicIsReadChange=function(t){t.topic.get("is_read")&&t.$button.hasClass("feed-subfeed-new-topic")&&e.checkSubfeedUnread(t)},e.checkSubfeedUnread=function(e){if(!(e.list.length>AoPS.Community.Constants.max_length_feed_list_read_check)){var t=e.list.findWhere({is_read:!1});_.isUndefined(t)?e.$button.removeClass("feed-subfeed-new-topic"):e.list.length>0&&e.$button.addClass("feed-subfeed-new-topic")}},e.FeedMaster=AoPS.View.extend({template_id:"#feed-master-tpl",feed_open:!1,animate_speed:200,active_subfeed:null,active_topic_view:null,id:"feed-wrapper",topic_views:[],subfeeds:[],has_page_feed:!1,cached_page_subfeed_views:{},initialize:function(){var e=this;this.$el.html(this.getTemplate(this.template_id,{})),this.$tabs=this.$el.find("#feed-tabs"),this.$topics_list=this.$el.find("#feed-topic-list"),this.$topic=this.$el.find("#feed-topic"),this.$topic_loader=AoPS.Page.buildLoader(),this.$el.on("mousedown",(function(e){e.stopPropagation()})),e.past_topic_id=0,$("body").on("click.feed",(function(t){e.past_topic_id=0})),this.feed_animated=!1,this.community_master=this.model.get("master"),this.model=this.community_master.get("feed"),this.constructSubfeeds(),this.listenTo(this.model,"change:focus_topic",this.buildTopic),this.listenTo(this.community_master.get("current_user"),"change:show_tags_on_feed",this.processShowTags),this.processShowTags(),this.listenTo(this.model,"change:page_subfeed_settings",this.onNewPageSubfeed),this.listenTo(this.community_master,"change:fullscreen_mode",(function(t){"feed"===e.community_master.previous("fullscreen_mode")?e.offFullscreen():"feed"===e.community_master.get("fullscreen_mode")&&e.onFullscreen()})),this.setVisibility(),AoPS.session.logged_in&&this.listenTo(this.community_master.get("current_user"),"change:hide_feed",this.setVisibility),this.community_master.get("current_user").get("hide_avatars")&&this.$el.addClass("cmty-hide-avatars"),this.listenTo(this.community_master.get("current_user"),"change:hide_avatars",(function(){e.$el.toggleClass("cmty-hide-avatars",e.community_master.get("current_user"))})),this.listenTo(Backbone,"community_disabled",this.onCommunityDisabled),this.listenTo(Backbone,"close_feed_topic",this.onTriggerCloseFeedTopic),i.startIdleMonitor(),i.activateLatexOnclick()},events:{"click .feed-subfeed-header":"closeFeed","click .feed-resort":"onClickResort"},onCommunityDisabled:function(){s.display(t["feed-community-disabled"]),this.hideFeed()},onFullscreen:function(){this.$topic.left_css=this.$topic.is_dragged?this.$topic.css("left"):"",this.$topic.top_css=this.$topic.is_dragged?this.$topic.css("top"):"",this.$topic.css({left:"",top:""}),this.$topic.draggable("disable")},offFullscreen:function(){this.$topic.css({left:this.$topic.left_css,top:this.$topic.top_css}),this.$topic.draggable("enable")},setVisibility:function(){AoPS.session.logged_in&&1===Number(this.community_master.get("current_user").get("hide_feed"))?this.hideFeed():this.showFeed()},processShowTags:function(){this.$el.toggleClass("cmty-show-feed-tags",this.community_master.get("current_user").get("show_tags_on_feed"))},hideFeed:function(){this.$el.addClass("feed-hidden")},showFeed:function(){AoPS.Community.is_active&&this.$el.removeClass("feed-hidden")},onTriggerCloseFeedTopic:function(){this.model.set("focus_topic",null),"feed"===this.community_master.get("fullscreen_mode")&&(this.community_master.set("fullscreen_mode","none"),$(window).trigger("resize"))},constructSubfeeds:function(){var e,i,s,o=[];for(this.global_subfeed=this.addSubfeed({header_text:t["feed-global-subfeed-header"],id:"feed-global-tab",title:"full"===this.model.get("global_feed_type")?t["feed-tab-global-title"]:t["feed-tab-global-custom-title"],icon_letter:"a",category:new AoPS.Community.Models.CategoryGlobal({master:this.community_master})}),AoPS.session.logged_in&&(this.addSubfeed({header_text:t["feed-ego-subfeed-header"],id:"feed-egosearch-tab",title:t["feed-tab-my-topics-title"],icon_letter:"w",catego
;//# sourceMappingURL=cmty_core.js.map