Commit 056bad4c by Don Mitchell

Time zone prompt change and tooltip

CodeMirror on overview entry
parent d7591bc0
...@@ -125,7 +125,8 @@ CMS.Views.Settings.Main = Backbone.View.extend({ ...@@ -125,7 +125,8 @@ CMS.Views.Settings.Main = Backbone.View.extend({
var now = new Date(); var now = new Date();
var hours = now.getHours(); var hours = now.getHours();
var minutes = now.getMinutes(); var minutes = now.getMinutes();
$(e.currentTarget).attr('title', (hours % 12 == 0 ? 12 : hours % 12) + ":" + (minutes < 10 ? "0" : "") + now.getMinutes() + (hours < 12 ? "am" : "pm")); $(e.currentTarget).attr('title', (hours % 12 == 0 ? 12 : hours % 12) + ":" + (minutes < 10 ? "0" : "")
+ now.getMinutes() + (hours < 12 ? "am" : "pm") + " (current local time)");
}, },
showSettingsTab: function(e) { showSettingsTab: function(e) {
...@@ -147,7 +148,8 @@ CMS.Views.Settings.Details = CMS.Views.ValidatingView.extend({ ...@@ -147,7 +148,8 @@ CMS.Views.Settings.Details = CMS.Views.ValidatingView.extend({
"blur textarea" : "updateModel", "blur textarea" : "updateModel",
'click .remove-course-syllabus' : "removeSyllabus", 'click .remove-course-syllabus' : "removeSyllabus",
'click .new-course-syllabus' : 'assetSyllabus', 'click .new-course-syllabus' : 'assetSyllabus',
'click .remove-course-introduction-video' : "removeVideo" 'click .remove-course-introduction-video' : "removeVideo",
'focus #course-overview' : "codeMirrorize"
}, },
initialize : function() { initialize : function() {
// TODO move the html frag to a loaded asset // TODO move the html frag to a loaded asset
...@@ -264,6 +266,21 @@ CMS.Views.Settings.Details = CMS.Views.ValidatingView.extend({ ...@@ -264,6 +266,21 @@ CMS.Views.Settings.Details = CMS.Views.ValidatingView.extend({
this.$el.find(".current-course-introduction-video iframe").attr("src", ""); this.$el.find(".current-course-introduction-video iframe").attr("src", "");
this.$el.find(this.fieldToSelectorMap['intro_video']).val(""); this.$el.find(this.fieldToSelectorMap['intro_video']).val("");
} }
},
codeMirrors : {},
codeMirrorize : function(e) {
if (!this.codeMirrors[e.currentTarget.id]) {
var cachethis = this;
var field = this.selectorToField['#' + e.currentTarget.id];
this.codeMirrors[e.currentTarget.id] = CodeMirror.fromTextArea(e.currentTarget, {
mode: "text/html", lineNumbers: true, lineWrapping: true,
onBlur : function(mirror) {
mirror.save();
cachethis.clearValidationErrors();
cachethis.model.save(field, mirror.getValue());
}
});
}
} }
}); });
......
...@@ -122,7 +122,7 @@ from contentstore import utils ...@@ -122,7 +122,7 @@ from contentstore import utils
<div class="group"> <div class="group">
<label for="course-start-time">Start Time</label> <label for="course-start-time">Start Time</label>
<input type="text" class="time start timepicker" id="course-start-time" value="" placeholder="HH:MM" autocomplete="off"> <input type="text" class="time start timepicker" id="course-start-time" value="" placeholder="HH:MM" autocomplete="off">
<span class="tip tip-stacked">(UTC/GMT -5 hours)</span> <span class="tip tip-stacked" id="timezone"></span>
</div> </div>
</div> </div>
</div> </div>
...@@ -138,7 +138,7 @@ from contentstore import utils ...@@ -138,7 +138,7 @@ from contentstore import utils
<div class="group"> <div class="group">
<label for="course-end-time">End Time</label> <label for="course-end-time">End Time</label>
<input type="text" class="time end" id="course-end-time" value="" placeholder="HH:MM" autocomplete="off"> <input type="text" class="time end" id="course-end-time" value="" placeholder="HH:MM" autocomplete="off">
<span class="tip tip-stacked">(UTC/GMT -5 hours)</span> <span class="tip tip-stacked" id="timezone"></span>
</div> </div>
</div> </div>
</div> </div>
...@@ -158,7 +158,7 @@ from contentstore import utils ...@@ -158,7 +158,7 @@ from contentstore import utils
<div class="group"> <div class="group">
<label for="course-enrollment-start-time">Start Time</label> <label for="course-enrollment-start-time">Start Time</label>
<input type="text" class="time start" id="course-enrollment-start-time" value="" placeholder="HH:MM" autocomplete="off"> <input type="text" class="time start" id="course-enrollment-start-time" value="" placeholder="HH:MM" autocomplete="off">
<span class="tip tip-stacked">(UTC/GMT -5 hours)</span> <span class="tip tip-stacked" id="timezone"></span>
</div> </div>
</div> </div>
</div> </div>
...@@ -174,7 +174,7 @@ from contentstore import utils ...@@ -174,7 +174,7 @@ from contentstore import utils
<div class="group"> <div class="group">
<label for="course-enrollment-end-time">End Time</label> <label for="course-enrollment-end-time">End Time</label>
<input type="text" class="time end" id="course-enrollment-end-time" value="" placeholder="HH:MM" autocomplete="off"> <input type="text" class="time end" id="course-enrollment-end-time" value="" placeholder="HH:MM" autocomplete="off">
<span class="tip tip-stacked">(UTC/GMT -5 hours)</span> <span class="tip tip-stacked" id="timezone"></span>
</div> </div>
</div> </div>
</div> </div>
......
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