Commit 63e6ff16 by Steve Strassmann

merge with master

parents 55dd0fc8 dea1198d
......@@ -10,7 +10,7 @@ var $newComponentTypePicker;
var $newComponentTemplatePickers;
var $newComponentButton;
$(document).ready(function () {
$(document).ready(function() {
$body = $('body');
$modal = $('.history-modal');
$modalCover = $('<div class="modal-cover">');
......@@ -35,7 +35,7 @@ $(document).ready(function () {
$('.uploads .upload-button').bind('click', showUploadModal);
$('.upload-modal .close-button').bind('click', hideModal);
$body.on('click', '.embeddable-xml-input', function () {
$body.on('click', '.embeddable-xml-input', function() {
$(this).select();
});
......@@ -45,8 +45,11 @@ $(document).ready(function () {
$('.new-unit-item').bind('click', createNewUnit);
// lean/simple modal
$('a[rel*=modal]').leanModal({overlay : 0.80, closeButton: '.action-modal-close' });
$('a.action-modal-close').click(function(e){
$('a[rel*=modal]').leanModal({
overlay: 0.80,
closeButton: '.action-modal-close'
});
$('a.action-modal-close').click(function(e) {
(e).preventDefault();
});
......@@ -55,12 +58,12 @@ $(document).ready(function () {
$('.action-notification-close').bind('click', hideNotification);
// nav - dropdown related
$body.click(function (e) {
$body.click(function(e) {
$('.nav-dropdown .nav-item .wrapper-nav-sub').removeClass('is-shown');
$('.nav-dropdown .nav-item .title').removeClass('is-selected');
});
$('.nav-dropdown .nav-item .title').click(function (e) {
$('.nav-dropdown .nav-item .title').click(function(e) {
$subnav = $(this).parent().find('.wrapper-nav-sub');
$title = $(this).parent().find('.title');
......@@ -70,9 +73,7 @@ $(document).ready(function () {
if ($subnav.hasClass('is-shown')) {
$subnav.removeClass('is-shown');
$title.removeClass('is-selected');
}
else {
} else {
$('.nav-dropdown .nav-item .title').removeClass('is-selected');
$('.nav-dropdown .nav-item .wrapper-nav-sub').removeClass('is-shown');
$title.addClass('is-selected');
......@@ -84,8 +85,11 @@ $(document).ready(function () {
$('a[rel="external"]').attr('title', 'This link will open in a new browser window/tab').bind('click', linkNewWindow);
// general link management - lean modal window
$('a[rel="modal"]').attr('title', 'This link will open in a modal window').leanModal({overlay: 0.50, closeButton: '.action-modal-close' });
$('.action-modal-close').click(function (e) {
$('a[rel="modal"]').attr('title', 'This link will open in a modal window').leanModal({
overlay: 0.50,
closeButton: '.action-modal-close'
});
$('.action-modal-close').click(function(e) {
(e).preventDefault();
});
......@@ -99,7 +103,7 @@ $(document).ready(function () {
$('.cta-show-sock').bind('click', toggleSock);
// toggling overview section details
$(function () {
$(function() {
if ($('.courseware-section').length > 0) {
$('.toggle-button-sections').addClass('is-shown');
}
......@@ -108,7 +112,7 @@ $(document).ready(function () {
// autosave when leaving input field
$body.on('change', '.subsection-display-name-input', saveSubsection);
$('.subsection-display-name-input').each(function () {
$('.subsection-display-name-input').each(function() {
this.val = $(this).val();
});
$("#start_date, #start_time, #due_date, #due_time").bind('change', autosaveInput);
......@@ -129,7 +133,7 @@ $(document).ready(function () {
// import form setup
$('.import .file-input').bind('change', showImportSubmit);
$('.import .choose-file-button, .import .choose-file-button-inline').bind('click', function (e) {
$('.import .choose-file-button, .import .choose-file-button-inline').bind('click', function(e) {
e.preventDefault();
$('.import .file-input').click();
});
......@@ -152,12 +156,12 @@ $(document).ready(function () {
$body.on('click', '.section-published-date .schedule-button', editSectionPublishDate);
$body.on('click', '.edit-subsection-publish-settings .save-button', saveSetSectionScheduleDate);
$body.on('click', '.edit-subsection-publish-settings .cancel-button', hideModal);
$body.on('change', '.edit-subsection-publish-settings .start-date', function () {
$body.on('change', '.edit-subsection-publish-settings .start-date', function() {
if ($('.edit-subsection-publish-settings').find('.start-time').val() == '') {
$('.edit-subsection-publish-settings').find('.start-time').val('12:00am');
}
});
$('.edit-subsection-publish-settings').on('change', '.start-date, .start-time', function () {
$('.edit-subsection-publish-settings').on('change', '.start-date, .start-time', function() {
$('.edit-subsection-publish-settings').find('.save-button').show();
});
});
......@@ -177,7 +181,7 @@ function smoothScrollLink(e) {
// On AWS instances, this base.js gets wrapped in a separate scope as part of Django static
// pipelining (note, this doesn't happen on local runtimes). So if we set it on window,
// when we can access it from other scopes (namely Course Advanced Settings).
window.CmsUtils.smoothScrollTop = function (e) {
window.CmsUtils.smoothScrollTop = function(e) {
(e).preventDefault();
$.smoothScroll({
......@@ -260,8 +264,7 @@ function getEdxTimeFromDateTimeVals(date_val, time_val) {
var edxTimeStr = null;
if (date_val != '') {
if (time_val == '')
time_val = '00:00';
if (time_val == '') time_val = '00:00';
// Note, we are using date.js utility which has better parsing abilities than the built in JS date parsing
var date = Date.parse(date_val + " " + time_val);
......@@ -284,7 +287,7 @@ function autosaveInput(e) {
clearTimeout(this.saveTimer);
}
this.saveTimer = setTimeout(function () {
this.saveTimer = setTimeout(function() {
$changedInput = $(e.target);
saveSubsection();
self.saveTimer = null;
......@@ -324,12 +327,15 @@ function saveSubsection() {
type: "POST",
dataType: "json",
contentType: "application/json",
data: JSON.stringify({ 'id': id, 'metadata': metadata}),
success: function () {
data: JSON.stringify({
'id': id,
'metadata': metadata
}),
success: function() {
$spinner.delay(500).fadeOut(150);
$changedInput = null;
},
error: function () {
error: function() {
showToastMessage('There has been an error while saving your changes.');
}
});
......@@ -348,12 +354,13 @@ function createNewUnit(e) {
});
$.post('/clone_item',
{'parent_location': parent,
$.post('/clone_item', {
'parent_location': parent,
'template': template,
'display_name': 'New Unit'
},
function (data) {
function(data) {
// redirect to the edit page
window.location = "/edit/" + data['id'];
});
......@@ -375,8 +382,7 @@ function deleteSection(e) {
}
function _deleteItem($el) {
if (!confirm('Are you sure you wish to delete this item. It cannot be reversed!'))
return;
if (!confirm('Are you sure you wish to delete this item. It cannot be reversed!')) return;
var id = $el.data('id');
......@@ -386,9 +392,13 @@ function _deleteItem($el) {
});
$.post('/delete_item',
{'id': id, 'delete_children': true, 'delete_all_versions': true},
function (data) {
$.post('/delete_item', {
'id': id,
'delete_children': true,
'delete_all_versions': true
},
function(data) {
$el.remove();
});
}
......@@ -499,11 +509,9 @@ function toggleSock(e) {
scrollTarget: $sock
});
if($sock.hasClass('is-shown')) {
if ($sock.hasClass('is-shown')) {
$btnLabel.text(gettext('Hide Studio Help'));
}
else {
} else {
$btnLabel.text(gettext('Looking for Help with Studio?'));
}
}
......@@ -549,7 +557,7 @@ function removeDateSetter(e) {
function hideNotification(e) {
(e).preventDefault();
$(this).closest('.wrapper-notification').removeClass('is-shown').addClass('is-hiding').attr('aria-hidden','true');
$(this).closest('.wrapper-notification').removeClass('is-shown').addClass('is-hiding').attr('aria-hidden', 'true');
}
function hideAlert(e) {
......@@ -580,7 +588,7 @@ function showToastMessage(message, $button, lifespan) {
$toast.fadeIn(200);
if (lifespan) {
$toast.timer = setTimeout(function () {
$toast.timer = setTimeout(function() {
$toast.fadeOut(300);
}, lifespan * 1000);
}
......@@ -602,7 +610,9 @@ function addNewSection(e, isTemplate) {
$newSection.find('.new-section-name').focus().select();
$newSection.find('.section-name-form').bind('submit', saveNewSection);
$cancelButton.bind('click', cancelNewSection);
$body.bind('keyup', { $cancelButton: $cancelButton }, checkForCancel);
$body.bind('keyup', {
$cancelButton: $cancelButton
}, checkForCancel);
}
function checkForCancel(e) {
......@@ -631,11 +641,10 @@ function saveNewSection(e) {
'template': template,
'display_name': display_name,
},
function (data) {
if (data.id != undefined)
location.reload();
}
);
function(data) {
if (data.id != undefined) location.reload();
});
}
function cancelNewSection(e) {
......@@ -654,7 +663,9 @@ function addNewCourse(e) {
$newCourse.find('.new-course-name').focus().select();
$newCourse.find('form').bind('submit', saveNewCourse);
$cancelButton.bind('click', cancelNewCourse);
$body.bind('keyup', { $cancelButton: $cancelButton }, checkForCancel);
$body.bind('keyup', {
$cancelButton: $cancelButton
}, checkForCancel);
}
function saveNewCourse(e) {
......@@ -683,7 +694,8 @@ function saveNewCourse(e) {
'number': number,
'display_name': display_name
},
function (data) {
function(data) {
if (data.id != undefined) {
window.location = '/' + data.id.replace(/.*:\/\//, '');
} else if (data.ErrMsg != undefined) {
......@@ -715,7 +727,9 @@ function addNewSubsection(e) {
$newSubsection.find('.new-subsection-form').bind('submit', saveNewSubsection);
$cancelButton.bind('click', cancelNewSubsection);
$body.bind('keyup', { $cancelButton: $cancelButton }, checkForCancel);
$body.bind('keyup', {
$cancelButton: $cancelButton
}, checkForCancel);
}
function saveNewSubsection(e) {
......@@ -736,12 +750,12 @@ function saveNewSubsection(e) {
'template': template,
'display_name': display_name
},
function (data) {
function(data) {
if (data.id != undefined) {
location.reload();
}
}
);
});
}
function cancelNewSubsection(e) {
......@@ -757,7 +771,9 @@ function editSectionName(e) {
$(this).children('.section-name-span').hide();
$(this).find('.section-name-edit').bind('submit', saveEditSectionName);
$(this).find('.edit-section-name-cancel').bind('click', cancelNewSection);
$body.bind('keyup', { $cancelButton: $(this).find('.edit-section-name-cancel') }, checkForCancel);
$body.bind('keyup', {
$cancelButton: $(this).find('.edit-section-name-cancel')
}, checkForCancel);
}
function cancelEditSectionName(e) {
......@@ -798,8 +814,13 @@ function saveEditSectionName(e) {
type: "POST",
dataType: "json",
contentType: "application/json",
data: JSON.stringify({ 'id': id, 'metadata': {'display_name': display_name}})
}).success(function () {
data: JSON.stringify({
'id': id,
'metadata': {
'display_name': display_name
}
})
}).success(function() {
$spinner.delay(250).fadeOut(250);
$_this.closest('h3').find('.section-name-span').html(display_name).show();
$_this.hide();
......@@ -842,18 +863,26 @@ function saveSetSectionScheduleDate(e) {
type: "POST",
dataType: "json",
contentType: "application/json",
data: JSON.stringify({ 'id': id, 'metadata': {'start': start}})
}).success(function () {
data: JSON.stringify({
'id': id,
'metadata': {
'start': start
}
})
}).success(function() {
var $thisSection = $('.courseware-section[data-id="' + id + '"]');
var format = gettext('<strong>Will Release:</strong> %(date)s at $(time)s UTC');
var willReleaseAt = interpolate(format, [input_date, input_time], true);
var format = gettext('<strong>Will Release:</strong> %(date)s at %(time)s UTC');
var willReleaseAt = interpolate(format, {
'date': input_date,
'time': input_time
},
true);
$thisSection.find('.section-published-date').html(
'<span class="published-status">' + willReleaseAt + '</span>' +
'<a href="#" class="edit-button" ' +
'" data-date="' + input_date +
'" data-time="' + input_time +
'" data-id="' + id + '">' +
gettext('Edit') + '</a>');
'" data-id="' + id + '">' + gettext('Edit') + '</a>');
$thisSection.find('.section-published-date').animate({
'background-color': 'rgb(182,37,104)'
}, 300).animate({
......
......@@ -77,7 +77,8 @@ def index(request, extra_context={}, user=None):
# The course selection work is done in courseware.courses.
domain = settings.MITX_FEATURES.get('FORCE_UNIVERSITY_DOMAIN') # normally False
if domain == False: # do explicit check, because domain=None is valid
# do explicit check, because domain=None is valid
if domain == False:
domain = request.META.get('HTTP_HOST')
courses = get_courses(None, domain=domain)
......
......@@ -6,9 +6,18 @@
<link type="text/html" rel="alternate" href="http://blog.edx.org/"/>
<link type="application/atom+xml" rel="self" href="https://github.com/blog.atom"/>
<title>EdX Blog</title>
<updated>2013-04-03T14:00:12-07:00</updated>
<updated>2013-05-03T14:00:12-07:00</updated>
<entry>
<id>tag:www.edx.org,2012:Post/17</id>
<id>tag:www.edx.org,2013:Post/18</id>
<published>2013-05-02T14:00:00-07:00</published>
<updated>2013-05-02T14:00:00-07:00</updated>
<link type="text/html" rel="alternate" href="http://www.nytimes.com/2013/04/30/education/colleges-adapt-online-courses-to-ease-burden.html?pagewanted=all"/>
<title>edX project at San Jose State featured in New York Times</title>
<content type="html">&lt;img src=&quot;${static.url('images/press/nytimes_240x180.png')}&quot; /&gt;
&lt;p&gt;&lt;/p&gt;</content>
</entry>
<entry>
<id>tag:www.edx.org,2013:Post/17</id>
<published>2012-12-19T14:00:00-07:00</published>
<updated>2012-12-19T14:00:00-07:00</updated>
<link type="text/html" rel="alternate" href="${reverse('press_release', args=['stanford-to-work-with-edx'])}"/>
......
......@@ -190,18 +190,11 @@
</section>
<section class="press-links">
<h3>edX in the News:</h3>
<a target="_blank" href="http://www.bbc.co.uk/news/business-19661899">BBC</a>,
<a target="_blank" href="http://www.technologyreview.com/news/506351/the-most-important-education-technology-in-200-years/">Technology Review</a>,
<a target="_blank" href="http://tech.mit.edu/V132/N48/edxvmware.html">The Tech</a>,
<a target="_blank" href="http://www.nytimes.com/2012/11/04/education/edlife/massive-open-online-courses-are-multiplying-at-a-rapid-pace.html">The New York Times</a>,
<a target="_blank" href="http://www.reuters.com/article/2012/10/19/us-education-courses-online-idUSBRE89I17120121019">Reuters</a>,
<a target="_blank" href="http://www.ft.com/intl/cms/s/2/73030f44-d4dd-11e1-9444-00144feabdc0.html#axzz2A9qvk48A">Financial Times</a>,
<a target="_blank" href="http://campustechnology.com/articles/2012/10/25/vmware-offers-free-virtualization-software-for-edx-computer-science-students.aspx">Campus Technology</a>,
<a target="_blank" href="http://chronicle.com/blogs/wiredcampus/san-jose-state-u-says-replacing-live-lectures-with-videos-increased-test-scores/40470">Chronicle of Higher Education</a>,
<a target="_blank" href="http://www.timeshighereducation.co.uk/story.asp?sectioncode=26&storycode=421577&c=1">Times Higher Education</a>,
<a target="_blank" href="http://www.bloomberg.com/news/2012-10-15/university-of-texas-joining-harvard-mit-online-venture.html">Bloomberg.com</a>,
<a target="_blank" href="http://www.businessweek.com/news/2012-10-15/university-of-texas-joining-harvard-mit-online-venture">BusinessWeek</a>,
<a target="_blank" href="http://news.yahoo.com/univ-texas-joins-online-course-program-edx-172202035--finance.html">Associated Press</a>
<a target="_blank" href="http://www.nytimes.com/2013/04/30/education/adapting-to-blended-courses-and-finding-early-benefits.html?ref=education">The New York Times</a>,
<a target="_blank" href="http://online.wsj.com/article/SB10001424127887323741004578414861572832182.html?mod=googlenews_wsj">The Wall Street Journal</a>,
<a target="_blank" href="http://www.washingtonpost.com/local/education/stanford-to-help-build-edx-mooc-platform/2013/04/02/5b53bb3e-9bbe-11e2-9a79-eb5280c81c63_story.html">The Washington Post</a>,
<a target="_blank" href="http://www.cbsnews.com/video/watch/?id=50143164n">CBS Television</a>,
<a target="_blank" href="http://bostonglobe.com/2012/12/04/edx/AqnQ808q4IEcaUa8KuZuBO/story.html">The Boston Globe</a>
<a href="${reverse('press')}" class="read-more">Read More &rarr;</a>
</section>
</section>
......
[
{
"title": "Adapting to Blended Courses, and Finding Early Benefits",
"url": "http://www.nytimes.com/2013/04/30/education/adapting-to-blended-courses-and-finding-early-benefits.html?ref=education",
"author": "Tamar Lewin",
"image": "nyt_logo_178x138.jpeg",
"deck": null,
"publication": "The New York Times",
"publish_date": "April 29, 2013"
},
{
"title": "Colleges Adapt Online Courses to Ease Burden",
"url": "http://www.nytimes.com/2013/04/30/education/colleges-adapt-online-courses-to-ease-burden.html?pagewanted=all",
"author": "Tamar Lewin",
"image": "nyt_logo_178x138.jpeg",
"deck": null,
"publication": "The New York Times",
"publish_date": "April 29, 2013"
},
{
"title": "Online Education Lifts Pass Rates at University",
"url": "http://online.wsj.com/article/SB10001424127887323741004578414861572832182.html?mod=googlenews_wsj",
"author": "Geoffrey Fowler",
"image": "wsj_logo_178x138.jpg",
"deck": null,
"publication": "The Wall Street Journal",
"publish_date": "April 10, 2013"
},
{
"title": "Software Seen Giving Grades on Essay Tests",
"url": "http://www.nytimes.com/2013/04/05/science/new-test-for-computers-grading-essays-at-college-level.html?pagewanted=all&_r=0",
"author": "John Markoff",
"image": "nyt_logo_178x138.jpeg",
"deck": null,
"publication": "The New York Times",
"publish_date": "April 4, 2013"
},
{
"title": "Stanford to help build edX MOOC platform",
"url": "http://www.washingtonpost.com/local/education/stanford-to-help-build-edx-mooc-platform/2013/04/02/5b53bb3e-9bbe-11e2-9a79-eb5280c81c63_story.html",
"author": "Nick Anderson",
"image": "wash_post_logo_178x138.jpg",
"deck": null,
"publication": "The Washington Post",
"publish_date": "April 3, 2013"
},
{
"title": "Could online ed end college as we know it?",
"url": "http://www.cbsnews.com/video/watch/?id=50143164n",
"author": "CBS This Morning",
"image": "cbsnews_178x138.jpg",
"deck": null,
"publication": "CBS Television Network",
"publish_date": "March 19, 2013"
},
{
"title": "The Professors’ Big Stage",
"url": "http://www.nytimes.com/2013/03/06/opinion/friedman-the-professors-big-stage.html?_r=1&#commentsContainer",
"author": "Thomas L. Friedman",
"image": "nyt_logo_178x138.jpeg",
"deck": null,
"publication": "The New York Times",
"publish_date": "March 6, 2013"
},
{
"title": "Universities Abroad Join Partnerships On the Web",
"url": "http://www.nytimes.com/2013/02/21/education/universities-abroad-join-mooc-course-projects.html",
"author": "Tamar Lewin",
"image": "nyt_logo_178x138.jpeg",
"deck": null,
"publication": "The New York Times",
"publish_date": "February 20, 2013"
},
{
"title": "Georgetown to offer free online courses",
"url": "http://www.washingtonpost.com/local/education/georgetown-to-offer-free-online-courses/2012/12/09/365c4612-3fd3-11e2-bca3-aadc9b7e29c5_story.html",
"author": "Nick Anderson",
"image": "wash_post_logo_178x138.jpg",
"deck": null,
"publication": "The Washington Post",
"publish_date": "December 9, 2012"
},
{
"title": "Wellesley College teams up with online provider edX",
"url": "http://bostonglobe.com/2012/12/04/edx/AqnQ808q4IEcaUa8KuZuBO/story.html",
"author": "Peter Schworm",
"image": "bostonglobe_logo_178x138.jpeg",
"deck": null,
"publication": "The Boston Globe",
"publish_date": "December 4, 2012"
},
{
"title": "The Year of the MOOC",
"url": "http://www.nytimes.com/2012/11/04/education/edlife/massive-open-online-courses-are-multiplying-at-a-rapid-pace.html",
"author": "Laura Pappano",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment