Download all blog post webpages

This commit is contained in:
Anthony Wang 2022-05-20 13:50:33 -05:00
parent fd17f3fb0d
commit 9631228e23
Signed by: a
GPG key ID: BC96B00AEC5F2D76
956 changed files with 422563 additions and 0 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View file

@ -0,0 +1,531 @@
@import url("https://fonts.googleapis.com/css?family=Titillium+Web:100,200,300,375,400,500,600,700,800,900");
@import url("https://fonts.googleapis.com/css?family=VT323:100,200,300,375,400,500,600,700,800,900");
body {
font-family:'Titillium Web', sans-serif;
}
#navigation_box{
height:40px;
position:fixed;
top:0;
border-style:none;
padding:0;
transition:0.25s;
color:rgba(0,0,0,0);
}
#left_navigation_box{
color: rgba(0,0,0,0);
padding:0;
}
#right_navigation_box{
color: rgba(0,0,0,0);
}
#navigation_box a{
font-size:18px;
padding:10px;
padding-top:13px;
padding-bottom:13px;
transition:0.25s;
font-family:'Titillium Web', sans-serif;
font-weight:100;
}
#navigation_box a:nth-child(2){
border-left-style:solid;
border-right-style:solid;
border-width:1px;
border-color:#f2f2f2;
}
#navigation_box a:nth-last-child(2){
border-right-style:solid;
border-width:1px;
border-color:#f2f2f2;
}
#right_navigation_box a:nth-child(3){
border-right-style:solid;
border-right-width:1px;
border-color:#f2f2f2;
}
#left_navigation_box a{
margin-left:-9px;
margin-right:-9px;
}
#right_navigation_box a{
margin-left:-7px;
margin-right:-7px;
}
#left_navigation_box{
margin-left:9px;
}
#right_navigation_box {
margin-left:7px;
}
#navigation_box a:hover{
background-color:#f2f2f2;
color:#20458c;
}
#header{
margin-top:34px;
}
#wrapper{
border-style:none;
width:100%;
background: #f9f9f9 !important;
padding:0;
}
#content{
max-width:1100px;
background: #f9f9f9 !important;
margin:auto;
}
#header{
border-style:none;
height: calc( 50vh - 34px);
margin-top: 34px;
background: black url("https://cdn.artofproblemsolving.com/images/1/5/2/1526cab286b14e1b92ce583f7d82cc322ad746a2.gif") no-repeat fixed top / 40%;
}
#header h1{
font-size: 150px;
height: 150px;
text-decoration: none;
cursor: default;
font-family: VT323;
font-weight: 25;
padding:0;
margin-top: calc(30vh - 82px);
color: white;
word-wrap: break-word;
}
#feed-wrapper{
display:none;
}
#main{
width:calc(100% - 270px);
}
#post-new-entry-p img{
display:none;
}
#post-new-entry-p{
text-align:center;
margin-bottom:0;
}
.entry{
margin-top:15px !important;
padding-bottom:10px !important;
border-style:none !important
}
.entry h1 a{
font-size:40px;
font-weight:200;
line-height:40px;
}
.entry h2{
color:black;
font-weight:375;
padding-left: 4px;
}
.entry h2 img{
display:none;
}
.entry h2 strong a{
color:black !important;
font-weight:375 !important;
}
.entrywrap{
margin-left:2px !important;
}
.message{
margin-left:4px;
border-style:none !important;
border-left-style:solid !important;
margin-left:4px !important;
background-color:#eaf0fa !important;
border-left-width:5px !important;
border-left-color:#20458c!important;
margin:0 !important;
padding:7px !important;
color:black;
}
.entrywrap .actions{
padding-left:0;
}
.entrywrap{
background-color:transparent !important;
padding:0!important;
border-style:none !important;
}
.entrywrap .cmty-post-edit-info{
display:none !important;
}
.aops-scroll-outer.aops-scrollbar-not-visible.blog-scroll-outer{
padding:0;
}
.aops-scroll-content{
margin-right:0 !important;
width:100% !important;
}
.aops-scroll-outer.aops-scrollbar-not-visible.blog-scroll-outer .aops-scroll-bar{
display:none !important;
}
.aops-scroll-outer.blog-scroll-outer.aops-scrollbar-visible .aops-scroll-bar{
display:none !important;
}
.aops-scroll-outer.blog-scroll-outer.aops-scrollbar-visible{
padding:0;
}
.aops-scroll-content li{
padding:6px !important;
}
.aops-scroll-inner{
width:240px !important;
}
.blog-shout-wrapper{
border-width:1px !important;
}
.blog-tag-wrapper{
border-width:1px !important;
}
#message-box{
width:242px !important;
background-color:transparent !important;
border-width:1px;
border-color:black;
box-sizing: none !important;
}
#message{
width:242px !important;
margin-right:0;
border-width:1px;
border-color:black !important;
background-color:transparent;
}
#shouts-widget .widget-content{
width:240px !important;
}
.blog-shout-wrapper{
width:240px !important;
border-color:#7a7a7a !important;
}
#tags-widget .widget-content{
width:240px !important;
}
.blog-tag-wrapper{
width:240px !important;
border-color:#7a7a7a !important;
}
.cmty-subject-input{
font-family:'Titillium Web', sans-serif;
font-size:15px;
padding-left:3px !important;
}
.cmty-post-textarea{
padding:3px;
font-family:'Titillium Web', sans-serif;
font-size:15px;
}
.cmty-posting-button-row{
background-color:white;
border-color:white;
}
.cmty-bbcode-other.clickable.cmty-bbcode-btn{
color:black;
}
.aops-modal-frame.cmty-posting-modal.ui-draggable{
border-color:white;
}
#side{
float:left;
}
#main{
float:right;
}
#archive-widget{
margin-top:5px;
padding-bottom:10px !important;
margin-bottom:20px !important;
border-bottom-style:dashed;
border-bottom-color: #7a7a7a;
border-bottom-width: 1px;
}
#archive-widget img{
display:none;
}
#archive-widget .widget-header .widget-title{
font-weight:50;
font-size:30px;
margin-bottom:5px;
color:black !important;
}
#shouts-widget .widget-header .widget-title{
font-weight:50;
font-size:30px;
margin-bottom:10px;
color:black !important;
}
#shouts-widget{
margin-top:5px;
padding-bottom:30px !important;
margin-bottom:20px !important;
border-bottom-style:dashed;
border-bottom-color: #7a7a7a;
border-bottom-width: 1px;
}
.blog-num-shouts{
display:none!important;
}
#tags-widget{
margin-top:5px;
padding-bottom:10px !important;
margin-bottom:20px !important;
border-bottom-style:dashed;
border-bottom-color: #7a7a7a;
border-bottom-width: 1px;
}
#tags-widget .widget-header .widget-title{
font-weight:50;
font-size:30px;
margin-bottom:5px;
color:black !important;
}
#tags-widget .widget-header .widget-title{
font-weight:50;
font-size:30px;
margin-bottom:5px;
color:black !important;
}
#stats-widget{
margin-top:5px;
padding-bottom:20px !important;
margin-bottom:20px !important;
border-bottom-style:dashed;
border-bottom-color: #7a7a7a;
border-bottom-width: 1px;
}
#stats-widget img{
display:none;
}
#stats-widget .widget-header .widget-title{
font-weight:50;
font-size:30px;
margin-bottom:5px;
color:black !important;
}
#search-widget .widget-header{
background-color:transparent;
display:none;
}
#search-widget .widget-settings{
display:none;
}
#search-widget .widget-content{
background-color:transparent;
border-style:none;
padding:0;
}
#search-widget .widget-footer{
background-color:transparent;
border-style:none;
}
#blog_searchform input{
background-color:transparent;
}
#blog_searchform fieldset{
border-style:none !important;
width:248px; !important;;
display:inline-block !important;
margin:0 !important;
}
#blog_searchform fieldset input#blog_keywords{
width:calc(100% - 60px);
font-family:'Titillium Web', sans-serif;
border-color:black;
color:black;
}
#blog_searchform fieldset div{
width:4;
float:right;
margin-top:0 !important;
border-color:black !important;
}
#blog_searchform fieldset div input{
height:22px;
font-size:12px;
font-family:'Titillium Web', sans-serif;
font-weight:300;
margin-top:0;
border-color:black;
color:black;
}
#blog_searchform{
margin:0;
}
#search-widget .widget-footer{
display:none;
}
#search-widget{
margin:0 !important;
padding-bottom:px;
}
#search-widget .widget-content{
margin:0;
}
#search-widget{
position:fixed !important;
z-index:1000000000000000000 !important;
top:4px !important;
right:50px !important;
padding:0 !important;
}
#right_navigation_box{
right:210px;
}
#search-widget .button2{
display:inline;
}
#message-box{
height:99px !important;
}
#user-menu-widget{
padding-bottom:10px !important;
border-bottom-style:dashed;
border-color:#7a7a7a;
border-width:1px;
margin-bottom:17px!important;
}
.user-full a{
font-weight:300 !important;
}
.message{
word-wrap:break-word;
}
#right_navigation_box{
right:210px;
}
.entry h2 a {
color: white;
}
a {
}
a:hover {
color: orange !important;
transition: all 0.5s;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
-o-transition: all 0.5s;
}
div.total-posts , div.total-posts a{
color: white;
}
#blog_keywords{
border-style:none;
font-size:18px;
font-weight:300;
color:white !important;
}
#blog_keywords::placeholder{
color:white;
font-style:italic;
}
#main::after {
/* Rule extends %modal-font */
content: "CSS credit to Mathlete2017";
position: relative;
top: 2em;
display: block;
color: #aaa;
font-size: 6pt;
text-align: center;
}
/*Loading bar*/
@keyframes loading{
0%{
width: 0px;
top: calc(50vh - 50px);
font-family: VT323;
content: "Loading...";
transition: ease;
text-align: center;
}
75%{
width: 300px;
top: calc(50vh - 50px);
font-family: VT323;
content: "Loading...";
text-align: center;
}
75.1%{
width: 300px;
top: calc(50vh - 50px);
font-family: VT323;
content: "Done!";
text-align: center;
}
85%{
top: calc(50vh - 100px);
width: 300px;
font-family: VT323;
content: "Done!";
text-align: center;
}
100%{
top: calc(150vh - 50px);
width: 300px;
font-family: VT323;
content: "Done!";
text-align: center;
}
}
html::before{
font-family: VT323;
content: "Loading...";
height: 100px;
position: fixed !important;
margin: 0px;
padding: 0px;
top: calc(150vh - 50px);
left: calc(50vw - 150px);
background-color: black;
color: white !important;
line-height: 100px;
white-space: nowrap;
font-size: 50px !important;
z-index: 1000000000 !important;
animation: loading 2s ease !important;
width: 300px !important;
box-shadow: 0px 0px 0px 5px white, 0px 50vw 0px calc(50vw + 50vh - 50px) black, 0px 0px 0px 5px white !important;
/*The box shadow that makes the border is put before and after the background shadow, because of order issues (Firefox displays the first one on top, chrome displays the last one on top)*/
display: block !important;
}
html::after{
font-family: VT323;
content: "Loading... please wait";
height: 100px;
width: 0px;
position: fixed !important;
margin: 0px;
padding: 0px;
top: calc(150vh - 50px);
left: calc(50vw - 150px);
background-color: white;
color: black !important;
line-height: 100px;
z-index: 1000000001 !important;
white-space: nowrap;
font-size: 50px !important;
animation: loading 2s ease !important;
overflow: hidden !important;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

View file

@ -0,0 +1,582 @@
/**
* blog_router.js Holds the router for Blogs. It gets the ball rolling once the page is loaded.
*
*/
AoPS.Blog = (function (Blog) {
var Lang = AoPS.Community.Lang,
Constants = AoPS.Community.Constants;
Blog.Router = AoPS.Community.Utils.routerBase.extend({
routes: {
"": "constructAoPSMasterCollection",
},
initialize: function (options) {
var self = this;
this.models = {};
this.models.search_categories = {};
this.models.master = options.master;
// Will this take care of everything?
this.myPage = AoPS.Page.constructPage("wrapper");
this.route(
/((?:c\d+)?(?:t\d+)?(?:f\d+)?(?:h\d+)?(?:p\d+)?(?:s\d+)?)/,
"parseEncodedUrl"
);
this.route(/((?:c\d+)(.*)\/(.*))/, "search");
this.bind("route", this.onFinishRoute);
this.first_pass = true;
// If there is a preloaded topic for directly navigating to a topic on page load,
// then this will be set to the preloaded id when the preloaded data is parsed.
// We then set this back to -1 once the preloaded topic is set as the focus_topic.
// This flag is used to prevent a redundant Ajax call (change_focus_topic) when the topic is built.
this.preloaded_topic_id = -1;
Backbone.on("logged_out", this.onAjaxDetectLogout);
Backbone.on("logged_in", this.onAjaxDetectLogin);
if (AoPS.bootstrap_data.hasOwnProperty("blog_base")) {
this.models.blog = this.models.master.constructNewCategory(
AoPS.bootstrap_data.blog_base
);
// TODO : check that topics exist
_.each(AoPS.bootstrap_data.blog_topics.topics_data, function (topic) {
self.models.master.processPotentialNewTopic(topic, true);
});
if (String(AoPS.bootstrap_data.blog_topics.no_more_topics) === "1") {
this.models.blog.set("all_topics_loaded", true);
}
} else {
// TODO : Throw error, you are in the wrong place.
}
this.models.master.set("focus_category", this.models.blog);
AoPS.Community.Utils.activateLatexOnclick();
$("body").addClass("community");
},
goToTopic: function (args) {
var url = "#";
if (args.hasOwnProperty("category_id")) {
url += "c" + args.category_id;
}
url += "h" + args.topic_id;
this.navigate(url, {
trigger: true,
replace: true, //(args.hasOwnProperty('replace') ? args.replace : false)
});
},
buildBreadcrumbs: function (data) {
var input = '<a href="/community">Community</a> &raquo; ';
input +=
'<a href="/community/c' +
Constants.aops_blogroll_id +
'">Blogs</a> &raquo; '; // TODO : POINT THIS AT THE BLOGS CATEGORY
input +=
'<a data-blog href="/community/c' +
data.blog.category_id +
'">' +
data.blog.name +
"</a>";
if (data.hasOwnProperty("topic")) {
input +=
' &raquo; <a data-blog href="/community/c' +
data.blog.category_id +
"h" +
data.topic.topic_id +
'">' +
data.topic.title +
"</a>";
}
$("#left_navigation_box").html(input);
},
onFinishRoute: function (name, args) {
this.previous_route = name;
if (!this.keep_fullscreen_mode) {
$("body").removeClass("fullscreen");
}
$(window).trigger("resize");
this.keep_fullscreen_mode = false;
},
/**
* Search this blog
*
* @param string of form /c<id>/<encoded search text>
**/
search: function (url) {
var pieces, str, coords, search_settings;
pieces = url.split("/");
if (pieces[1].length === 0) {
this.parseEncodedUrl(pieces[0]);
return;
}
str = pieces[1];
coords = {
category_id: 0,
tag_id: 0,
tag_forum_id: 0,
search_text: str,
is_search: true,
};
if (this.models.search_categories.hasOwnProperty(str)) {
coords.category = this.models.search_categories[str].category;
coords.topic_list = this.models.search_categories[str].topic_list;
} else {
search_settings = {
blog_id: this.models.blog.get("category_id"),
search_text: decodeURIComponent(pieces[1]),
};
coords.category =
this.models.master.buildSearchCategory(search_settings);
this.models.search_categories[str] = {
category: coords.category,
};
}
this.startConstructingPage(coords);
},
/** Start functions for building pages that have ids encoded in URL **/
/**
* parseEncodedUrl parses the url and then routes us to the appropriate function
* to construct the page once we're sure we have some topics to play with.
* (We'll likely handle that "check for some topics" differently when we build the real system.)
*
* @param url: everything after # in the url.
*
*/
parseEncodedUrl: function (url) {
var coords = {
topic: null,
category: null,
};
function extractValueFromUrl(stub, url_in) {
var match_array;
if (_.isNull(url_in)) {
return 0;
}
match_array = url_in.match(new RegExp(stub + "(\\d+)"));
if (_.isNull(match_array)) {
return 0;
} else {
return parseInt(match_array[1]);
}
}
/**
* If we're hitting a category, topic, or post on page load (first_pass through the
* router), then we check the preload_cmty_data property of bootstrap to see if
* there's anything we can preload, and to see if we need to rewrite the url.
*
* There are later url rewrite checks, but they shouldn't ever be triggered.
* I'm leaving them in, in case down the line we introduce ways that users can
* travel down routes missing properties (like topic id with no category id) in
* some way other than the initial page load.
**/
if (this.first_pass) {
if (AoPS.bootstrap_data.hasOwnProperty("preload_cmty_data")) {
this.first_pass = false;
if (this.parsePreloadedData()) {
return;
}
}
}
// Fill coords object from url
_.each(this.url_parameters, function (item) {
coords[item.property] = extractValueFromUrl(item.letter, url);
});
coords.is_search = false;
this.startConstructingPage(coords);
},
startConstructingPage: function (coords) {
this.myPage.clearPage();
this.myPage.showElement({
id: "blog-top",
constructor: _.bind(function () {
return new AoPS.Community.Views.CategoryCellBlogHeading({
model: this.models.blog,
});
}, this),
});
if (coords.is_search) {
if (coords.hasOwnProperty("topic_list")) {
this.prepareBlogFront(coords);
} else {
this.checkTopicListThenContinue(coords);
}
} else if (coords.topic_id > 0) {
this.prepareBlogTopic(coords);
} else {
this.prepareBlogFront(coords);
}
return;
},
/**
* The sidebar and the clearfix are needed everywhere.
**/
finishBuildingPage: function (coords) {
this.myPage.showElement({
id: "blog-sidebar",
constructor: _.bind(function () {
return new AoPS.Community.Views.BlogSidebar({
model: this.models.blog,
});
}, this),
location: "content",
});
this.myPage.showElement({
id: "blog-clearfix",
type: "jQuery_object",
jQuery_object: $('<div class="clear"></div>'),
location: "content",
});
},
prepareBlogTopic: function (coords) {
var self = this;
coords.topic = this.models.master.fetchTopicById(coords.topic_id);
if (_.isNull(coords.topic) && !_.isUndefined(coords.topic)) {
this.listenTo(
this.models.master,
"single_topic_load",
_.bind(function (obj) {
self.myPage.hideLoader();
if (obj.topic_id === coords.topic_id) {
// We found the topic
this.stopListening(this.models.master, "single_topic_load");
if (obj.ok) {
coords.topic = obj.topic;
this.buildBlogTopic(coords);
} else {
// Database fetch failed dues to lack of permissions
if (obj.error_code === "E_NO_PERMISSION") {
if (AoPS.session.logged_in) {
this.throwError(
Lang["router-err-no-topic-perms-logged-in"]
);
} else {
this.throwError(
Lang["router-err-no-topic-perms-logged-out"]
);
}
} else if (obj.error_code === "E_NO_SUCH_TOPIC") {
this.throwError(Lang["router-err-no-topic"]);
}
}
}
}, this)
);
this.myPage.showLoader();
this.models.master.fetchTopicFromDb({
topic_id: coords.topic_id,
});
return;
} else {
// If we have a topic, process all the tags on it (add them to their categories).
this.buildBlogTopic(coords);
return;
}
},
buildBlogTopic: function (coords) {
var topic_page_element,
blog_name = this.models.blog.get("category_name"),
topic_title = coords.topic.get("topic_title");
this.myPage.setTitle(
_.unescape(blog_name) + " : " + _.unescape(topic_title)
);
coords.topic.set("category", this.models.blog);
this.models.master.set("focus_topic", coords.topic, {
suppress_ajax: coords.topic_id === this.preloaded_topic_id,
fetch_all: true,
});
this.preloaded_topic_id = -1;
/**
* If we navigate in the blog to this top, the scrollbar might be set somewhere
* far down the page
**/
$(window).scrollTop(0);
topic_page_element = this.myPage.showElement({
id: "blog-topic-" + coords.topic_id,
constructor: _.bind(function () {
return new AoPS.Community.Views.BlogTopicFull({
model: coords.topic,
post_id: coords.post_id,
});
}, this),
on_add_settings: {
post_id: coords.post_id,
},
location: "content",
});
this.finishBuildingPage(coords);
// Reply triggered
if (coords.state === 3) {
if (coords.topic.getPermission("c_can_reply")) {
topic_page_element.dom_element.trigger("open_reply");
}
}
this.buildBreadcrumbs({
blog: {
category_id: this.models.blog.get("category_id"),
name: blog_name,
},
topic: {
title: topic_title,
topic_id: coords.topic.get("topic_id"),
},
});
},
buildBlogFrontPage: function (coords) {
var topic_list,
blog_name = this.models.blog.get("category_name");
if (coords.hasOwnProperty("topic_list")) {
topic_list = coords.topic_list;
} else {
topic_list = this.models.master.fetchFilteredTopicList({
category: this.models.blog,
category_id: this.models.blog.get("category_id"),
tag_ids: [],
});
if (coords.is_search) {
this.models.search_categories[coords.search_text].topic_list =
topic_list;
}
}
this.myPage.hideLoader();
this.myPage.setTitle(_.unescape(blog_name));
this.myPage.showElement({
id:
"blog-topics" +
coords.tag_id +
(coords.hasOwnProperty("search_text") ? coords.search_text : ""),
constructor: _.bind(function () {
return new AoPS.Community.Views.TopicsListBlog({
collection: topic_list,
blog: this.models.blog,
});
}, this),
location: "content",
});
this.models.master.set("focus_topic", null);
this.buildBreadcrumbs({
blog: {
category_id: this.models.blog.get("category_id"),
name: blog_name,
},
});
this.finishBuildingPage(coords);
},
/***
* Construct the topic list that we use for the page. If the topic list
* has no topics, then we go get some topics before building.
*
* @param coords: settings used to build the page.
*/
checkTopicListThenContinue: function (coords) {
var self = this;
// Construct or fetch the Community.Models.FilteredTopicList that matches
// the set of parameters we seek.
// Gets called twice for topics that are shorn of tags, but we can live with that, I think
// That will be rare. We could do a property check, though. Might be more expensive than it's worth.
coords.topic_list = this.models.master.fetchFilteredTopicList({
category:
coords.hasOwnProperty("category") && !_.isNull(coords.category)
? coords.category
: this.models.blog,
category_id: coords.category_id,
tag_ids:
coords.tag_id > 0
? [
{
tag_id: coords.tag_id,
tag_forum_id: coords.tag_forum_id,
},
]
: [], //currently assumes at most one tag_id.
});
// Not enough topics in this list; I'm gonna get more.
if (
coords.topic_list.length <=
AoPS.Community.Constants.min_topic_list_initial_length &&
!coords.topic_list.all_topics_fetched
) {
this.myPage.showLoader();
coords.topic_list.fetchMoreTopics({
onFinish: _.bind(function () {
this.buildBlogFrontPage(coords);
}, this),
onError: function (data) {
var msg;
if (data.error_code === "E_AJAX_CANCEL") {
return;
}
if (
typeof Lang["initial-fetch-err-" + data.error_code] === "string"
) {
msg = AoPS.Community.Utils.formatString(
Lang["initial-fetch-blog-err-" + data.error_code],
[coords.category_id]
);
console.log(msg);
console.log(coords.category_id);
} else {
msg = Lang["unexpected-error-code"] + data.error_code;
}
// Force page reload after error
$("a[data-blog]").removeAttr("data-blog");
self.throwError(msg);
},
});
} else {
this.buildBlogFrontPage(coords);
}
},
prepareBlogFront: function (coords) {
if (coords.tag_id > 0) {
coords.tag_forum_id = coords.category_id;
this.checkTopicListThenContinue(coords);
} else {
this.buildBlogFrontPage(coords);
}
},
setBreadcrumbs: function (crumbs) {
crumbs = _.map(crumbs, function (crumb) {
crumb.data = "data-cmty";
return crumb;
});
this.myPage.setBreadcrumbs(this.breadcrumb_base.concat(crumbs));
},
onAjaxDetectLogout: function () {
if (!AoPS.login.user_clicked_logout) {
AoPS.Ui.buildLoginConfirm(Lang["unexpected-logout"]);
AoPS.login.onUserAjaxLogout();
}
},
onAjaxDetectLogin: function () {
if (!AoPS.login.user_clicked_login) {
document.location.reload(true);
}
},
onAjaxDetectLoginChange: function () {
//if (
},
});
$(window).load(function () {
var master, app;
master = new AoPS.Community.Models.Master();
app = new Blog.Router({
master: master,
});
$("#page-wrapper").append(app.myPage.el);
Backbone.history.start({
pushState: true,
root: "community",
});
$("a.blog-login").on("click", function (e) {
AoPS.login.display();
e.stopPropagation();
e.preventDefault();
});
$("a.blog-logout").on("click", function (e) {
AoPS.login.logout(e);
e.stopPropagation();
e.preventDefault();
});
$(document).on("click", "a[data-blog]", function (e) {
e.stopPropagation();
e.preventDefault();
Backbone.history.navigate($(this).attr("href").substring(10), {
trigger: true,
});
});
if (AoPS.session.logged_in) {
$("#blog-subscribe").on("click", function (e) {
AoPS.Community.Views.toggleBlogSubscription({
blog: app.models.blog,
user: master.get("current_user"),
});
e.stopPropagation();
e.preventDefault();
});
}
/* FEED MUST COME AFTER Backbone start!*/
// experimenting with delay to let the page render before Feed is built.
// If this seems to work well, we'll want to animate the feed in.
setTimeout(function () {
var feed = new AoPS.Community.Models.Feed({
master: master,
}),
feed_view = new AoPS.Feed.Views.FeedMaster({
model: feed,
});
$("body").append(feed_view.$el);
}, 100);
// console.log('end page ' + (new Date().getTime() - start));
// });
});
return Blog;
})(AoPS.Blog || {});

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,627 @@
/* BASICS */
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
height: auto;
}
.CodeMirror-scroll {
/* Set scrolling behaviour here */
overflow-y: hidden;
overflow-x: auto;
}
/* PADDING */
.CodeMirror-lines {
padding: 4px 0; /* Vertical padding around content */
}
.CodeMirror pre {
padding: 0 4px; /* Horizontal padding of content */
}
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
background-color: white; /* The little square between H and V scrollbars */
}
/* GUTTER */
.CodeMirror-gutters {
border-right: 1px solid #ddd;
background-color: #f7f7f7;
white-space: nowrap;
}
.CodeMirror-linenumbers {}
.CodeMirror-linenumber {
padding: 0 3px 0 5px;
min-width: 20px;
text-align: right;
color: #999;
}
/* CURSOR */
.CodeMirror div.CodeMirror-cursor {
border-left: 1px solid black;
z-index: 3;
}
/* Shown when moving in bi-directional text */
.CodeMirror div.CodeMirror-secondarycursor {
border-left: 1px solid silver;
}
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
width: auto;
border: 0;
background: #7e7;
z-index: 1;
}
/* Can style cursor different in overwrite (non-insert) mode */
.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
.cm-tab { display: inline-block; }
/* DEFAULT THEME */
.cm-s-default .cm-keyword {color: #ff7700;}
.cm-s-default .cm-atom {color: #219;}
.cm-s-default .cm-number {color: #000000;}
.cm-s-default .cm-def {color: #00f;}
.cm-s-default .cm-variable {color: black;}
.cm-s-default .cm-variable-2 {color: #05a;}
.cm-s-default .cm-variable-3 {color: #085;}
.cm-s-default .cm-property {color: black;}
.cm-s-default .cm-operator {color: black;}
.cm-s-default .cm-comment {color: #dd0000;}
.cm-s-default .cm-string {color: #00aa00;}
.cm-s-default .cm-string-2 {color: #f50;}
.cm-s-default .cm-meta {color: #555;}
.cm-s-default .cm-qualifier {color: #555;}
.cm-s-default .cm-builtin {color: #900090;}
.cm-s-default .cm-bracket {color: #997;}
.cm-s-default .cm-tag {color: #170;}
.cm-s-default .cm-attribute {color: #00c;}
.cm-s-default .cm-header {color: blue;}
.cm-s-default .cm-quote {color: #090;}
.cm-s-default .cm-hr {color: #999;}
.cm-s-default .cm-link {color: #00c;}
.cm-negative {color: #d44;}
.cm-positive {color: #292;}
.cm-header, .cm-strong {font-weight: bold;}
.cm-em {font-style: italic;}
.cm-link {text-decoration: underline;}
.cm-s-default .cm-error {color: #f00;}
.cm-invalidchar {color: #f00;}
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
.CodeMirror-activeline-background {background: #e8f2ff;}
/* STOP */
/* The rest of this file contains styles related to the mechanics of
the editor. You probably shouldn't touch them. */
.CodeMirror {
line-height: 1;
position: relative;
overflow: hidden;
background: white;
color: black;
}
.CodeMirror-scroll {
/* 30px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror */
margin-bottom: -30px; margin-right: -30px;
padding-bottom: 30px; padding-right: 30px;
height: 100%;
outline: none; /* Prevent dragging from highlighting the element */
position: relative;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.CodeMirror-sizer {
position: relative;
}
/* The fake, visible scrollbars. Used to force redraw during scrolling
before actuall scrolling happens, thus preventing shaking and
flickering artifacts. */
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
position: absolute;
z-index: 6;
display: none;
}
.CodeMirror-vscrollbar {
right: 0; top: 0;
overflow-x: hidden;
overflow-y: scroll;
}
.CodeMirror-hscrollbar {
bottom: 0; left: 0;
overflow-y: hidden;
overflow-x: scroll;
}
.CodeMirror-scrollbar-filler {
right: 0; bottom: 0;
}
.CodeMirror-gutter-filler {
left: 0; bottom: 0;
}
.CodeMirror-gutters {
position: absolute; left: 0; top: 0;
padding-bottom: 30px;
z-index: 3;
}
.CodeMirror-gutter {
white-space: normal;
height: 100%;
-moz-box-sizing: content-box;
box-sizing: content-box;
padding-bottom: 30px;
margin-bottom: -32px;
display: inline-block;
/* Hack to make IE7 behave */
*zoom:1;
*display:inline;
}
.CodeMirror-gutter-elt {
position: absolute;
cursor: default;
z-index: 4;
}
.CodeMirror-lines {
cursor: text;
}
.CodeMirror pre {
/* Reset some styles that the rest of the page might have set */
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
border-width: 0;
background: transparent;
font-family: inherit;
font-size: inherit;
margin: 0;
white-space: pre;
word-wrap: normal;
line-height: inherit;
color: inherit;
z-index: 2;
position: relative;
overflow: visible;
}
.CodeMirror-wrap pre {
word-wrap: break-word;
white-space: pre-wrap;
word-break: normal;
}
.CodeMirror-code pre {
border-right: 30px solid transparent;
width: -webkit-fit-content;
width: -moz-fit-content;
width: fit-content;
}
.CodeMirror-wrap .CodeMirror-code pre {
border-right: none;
width: auto;
}
.CodeMirror-linebackground {
position: absolute;
left: 0; right: 0; top: 0; bottom: 0;
z-index: 0;
}
.CodeMirror-linewidget {
position: relative;
z-index: 2;
overflow: auto;
}
.CodeMirror-widget {}
.CodeMirror-wrap .CodeMirror-scroll {
overflow-x: hidden;
}
.CodeMirror-measure {
position: absolute;
width: 100%;
height: 0;
overflow: hidden;
visibility: hidden;
}
.CodeMirror-measure pre { position: static; }
.CodeMirror div.CodeMirror-cursor {
position: absolute;
visibility: hidden;
border-right: none;
width: 0;
}
.CodeMirror-focused div.CodeMirror-cursor {
visibility: visible;
}
.CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
.cm-searching {
background: #ffa;
background: rgba(255, 255, 0, .4);
}
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
.CodeMirror span { *vertical-align: text-bottom; }
@media print {
/* Hide the cursor when printing */
.CodeMirror div.CodeMirror-cursor {
visibility: hidden;
}
}
.error {
background-color: #fdd;
}
#tab-grader .pywindow, #tab-homework .pywindow {
/* background-color: #c5f0e5;*/
/* background-color: #eefaf8;*/
/* padding: 10px 15px 15px 15px;*/
/* margin: 5px 0px 5px 0px;*/
/* border-radius: 15px*/
}
.pywindow .CodeMirror {
border: 2px solid #ccc;
border-radius: 4px;
}
.pywindow > pre, .pywindow .error pre {
font-family: 'Consolas', 'Deja Vu Sans Mono',
'Bitstream Vera Sans Mono', monospace;
/* font-size: 0.95em;*/
letter-spacing: 0.015em;
line-height: 120%;
/* border: 1px solid #ccc;*/
/* background-color: #f8f8f8;*/
display: block;
padding: 9.5px;
margin: 5px 0 10px;
font-size: 13px;
/* line-height: 1.428571429;*/
color: #333;
/* word-break: break-all;*/
/* word-wrap: break-word;*/
background-color: #f5f5f5;
border: 1px solid #ccc;
border-radius: 4px;
min-height: 20px;
/* max-height: 500px;*/
resize: vertical;
overflow: auto;
}
.pywindow > pre a, .pywindow .error pre a {
color: inherit;
text-decoration: underline;
}
.pywindow .btn, .btn.pywindow-preview-popout{
display: inline-block;
margin: 5px 10px;
padding: 3px 6px;
height: 24px;
line-height: 16px;
/*font-weight: normal;*/
text-align: center;
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
border: 1px solid transparent;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
font-size: 1em;
/*font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;*/
float: right;
}
.pywindow .btn-link, .btn-link.pywindow-preview-popout{
outline: 0px;
font-size: 15px;
}
.pyfile-preview-modal-holder .aops-modal-title {
text-align: center;
font-size: 150%;
}
.pyfile-preview-modal-holder textarea {
padding: 20px!important;
}
.pywindow .btn-run, .pywindow .btn-run-disabled {
float: left;
margin: 5px 0px;
}
.pywindow .btn-reset {
margin: 5px 0px;
}
.pywindow .btn-run:hover, .pywindow .btn-run:focus,
.pywindow .btn-reset:hover, .pywindow .btn-reset:focus {