[LON-CAPA-cvs] cvs: loncom(bz6209) /interface lonhtmlcommon.pm lonsyllabus.pm
faziophi
faziophi@source.lon-capa.org
Wed, 17 Feb 2010 18:42:38 -0000
This is a MIME encoded message
--faziophi1266432158
Content-Type: text/plain
faziophi Wed Feb 17 18:42:38 2010 EDT
Modified files: (Branch: bz6209)
/loncom/interface lonsyllabus.pm lonhtmlcommon.pm
Log:
Work-in-progress commit on bug 6209.
--> New (still non-functional) contextual section bar and section title bar
--> Disable "Enable/Disable WYSIWYG" link
--> Hide unnecessary fields in .LC_Box'es temporarily for display purposes
--> No longer preview content above edit box
--> This will eventually be replaced by a "Preview" button which
will generate a processed copy of the field via an AJAX request.
--> No longer print "Save all", "Delete", etc. fields beneath edit box,
because I am masochistic and wanted to get rid of the only part
of the interface that actually works as advertised right now.
STILL NOT TOUCHED:
-- same as last commit
New pretty screenshot attached on Bugzilla.
--faziophi1266432158
Content-Type: text/plain
Content-Disposition: attachment; filename="faziophi-20100217184238.txt"
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.106.2.4 loncom/interface/lonsyllabus.pm:1.106.2.5
--- loncom/interface/lonsyllabus.pm:1.106.2.4 Wed Feb 17 04:48:09 2010
+++ loncom/interface/lonsyllabus.pm Wed Feb 17 18:42:38 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Syllabus
#
-# $Id: lonsyllabus.pm,v 1.106.2.4 2010/02/17 04:48:09 faziophi Exp $
+# $Id: lonsyllabus.pm,v 1.106.2.5 2010/02/17 18:42:38 faziophi Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -159,9 +159,15 @@
.LC_ActivityBarButton-IconLeft .ui-icon { float:left; margin-left: -18px; }
#scrollable-fields-container {float:left; background-color: white; width: 235px; border: 1px solid grey; margin: 0px; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;}
#syllabus-fields-actions {text-align: center}
- #syllabus-content {margin-left: 245px}
+ #syllabus-content {-moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; margin: -6px 0 0 239px; position: relative; z-index: 2; padding: 9px 5px 5px 5px; background-color: #fafafa; border:solid 1px grey}
#activity-bar {-moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; border: solid 1px grey; background-color: #dddddd; padding: 0px 0px;margin: 5px 0 2px 0;}
#activity-bar button { font-size: 100%; vertical-align: middle }
+ #context-bar {z-index: 4; position: relative; -moz-border-bottom-left-radius: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-bottom-right-radius: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; border: solid 1px grey; background-color: #eeeeee; padding: 0px 0px;margin:-1px 0 0px 239px;}
+ #title-bar {-moz-border-top-left-radius: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-top-right-radius: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; border: solid 1px grey; background-color: #eaeaea; padding: 0px 0px;margin: 2px 0 0 239px}
+ #title-bar img {vertical-align: middle}
+ #title-bar button {vertical-align: middle}
+ #title-bar h4 {padding:0px}
+ #section-type-button {padding: 2px;margin-left:2px;}
</style>
<script type="text/javascript">
@@ -220,6 +226,12 @@
var id = /title-([0-9_]+)/i.exec(jQuery(this).attr('id'));
jQuery('#syllabus-form .LC_Box').hide();
jQuery('#box-'+id[1]).show();
+ // START TEMPORARY CODE FOR DEMO'S SAKE
+ jQuery('#syllabus-form .LC_hcell').hide();
+ jQuery('#section-title-text').html(
+ jQuery('#box-'+id[1]).find('.LC_hcell').html()
+ );
+ // END TEMPORARY CODE
});
jQuery('#syllabus-fields').sortable({
revert: true,
@@ -641,9 +653,11 @@
my $day = &Apache::lonannounce::showday(time,2,
&Apache::lonannounce::readcalendar($cdom.'_'.$cnum));
if ($target ne 'tex') {
- if (($syllabus{'uploaded.lastmodified'}) || ($allowed)) {
+ if ($allowed) {
&print_activity_bar($r, \%data, $target, $allowed, Apache::lontemplate->RICH_TEXT_DETECT_HTML);
&print_field_sortable($r, \%data, $target, $allowed, Apache::lontemplate->RICH_TEXT_DETECT_HTML);
+ &print_title_bar($r, \%data, $target, $allowed, Apache::lontemplate->RICH_TEXT_DETECT_HTML);
+ &print_context_bar($r, \%data, $target, $allowed, Apache::lontemplate->RICH_TEXT_DETECT_HTML);
}
$r->print("<div id='syllabus-content'>\n");
@@ -703,7 +717,7 @@
$target, $allowed, Apache::lontemplate->RICH_TEXT_DETECT_HTML, \%custom_hash);
if ($allowed) {
$r->print('</form>');
- #&Apache::lonhtmlcommon::htmlareaselectactive(@htmlids));
+ $r->print(&Apache::lonhtmlcommon::htmlareaselectactive(@htmlids));
}
if ($target ne 'tex') {$r->print('</div><p style="clear:both"> </p>');}
if ($allowed) {
@@ -745,6 +759,35 @@
</div>");
}
+sub print_title_bar {
+ my ($r, $data_ref, $target, $allowed, $default_rich_text, $group) = @_;
+ $r->print("<div id='title-bar'><h4>
+<button id='section-type-button' type='button' class='LC_ActivityBarButton ui-helper-reset ui-state-default ui-corner-all'>
+ <img src='/adm/lonIcons/text-rich.png' title='Rich Text Section'/>
+</button>
+<span id='section-title-text'>Title Goes Here</span>
+</h4>
+</div>");
+}
+
+sub print_context_bar {
+ my ($r, $data_ref, $target, $allowed, $default_rich_text, $group) = @_;
+ $r->print("<div id='context-bar'>
+<button id='add-section-button' type='button' class='LC_ActivityBarButton LC_ActivityBarButton-IconLeft ui-state-default ui-corner-all'>
+ <span class='ui-icon ui-icon-triangle-1-n'></span><a href='#'>Move Up</a>
+</button>
+<button id='add-section-button' type='button' class='LC_ActivityBarButton LC_ActivityBarButton-IconLeft ui-state-default ui-corner-all'>
+ <span class='ui-icon ui-icon-triangle-1-s'></span><a href='#'>Move Down</a>
+</button>
+<button id='add-section-button' type='button' class='LC_ActivityBarButton LC_ActivityBarButton-IconLeft ui-state-default ui-corner-all'>
+ <span class='ui-icon ui-icon-pencil'></span><a href='#'>Rename</a>
+</button>
+<button id='add-section-button' type='button' class='LC_ActivityBarButton LC_ActivityBarButton-IconLeft ui-state-default ui-corner-all'>
+ <span class='ui-icon ui-icon-closethick'></span><a href='#'>Delete</a>
+</button>
+</div>");
+}
+
sub print_field_sortable {
my ($r, $data_ref, $target, $allowed, $default_rich_text, $group) = @_;
my %data = %{$data_ref};
@@ -760,10 +803,10 @@
</ui>
</div>
<div id='syllabus-fields-actions'>
-<button id='add-section-button' type='button' class='LC_ActivityBarButton LC_ActivityBarButton-IconLeft ui-state-default ui-priority-secondary ui-corner-all'>
+<button id='add-section-button' type='button' class='LC_ActivityBarButton LC_ActivityBarButton-IconLeft ui-state-default ui-corner-all'>
<span class='ui-icon ui-icon-circle-plus'></span><a href='#'>Add Section</a>
</button>
-<button id='revert-order-button' type='button' class='LC_ActivityBarButton LC_ActivityBarButton-IconLeft ui-state-default ui-priority-secondary ui-corner-all'>
+<button id='revert-order-button' type='button' class='LC_ActivityBarButton LC_ActivityBarButton-IconLeft ui-state-default ui-corner-all'>
<span class='ui-icon ui-icon-arrowreturnthick-1-w'></span><a href='#'>Revert Order</a>
</button>
</div>
@@ -800,16 +843,16 @@
if ($target ne 'tex') {
#output of syllabusfields will be generated here.
&Apache::lontemplate::print_start_template($r,$title,'LC_Box', 'box-'.$key);
- $r->print($message);
+ #$r->print($message);
if ($allowed) {
- $r->print("<br /><div>");
+ $r->print("<div>");
&Apache::lontemplate::print_textarea_template($r, $raw_message,
$key, $default_rich_text);
- &Apache::lontemplate::print_saveall_template($r);
- if (!exists($data{'properties.v2_converted'})) {
- $r->print("<a href='?delete=$key&forceedit=1'>Delete</a> ");
- $r->print("<a href='?rename=$key&forceedit=1'>Rename to \"Hello, World!\"</a>");
- }
+# &Apache::lontemplate::print_saveall_template($r);
+# if (!exists($data{'properties.v2_converted'})) {
+# $r->print("<a href='?delete=$key&forceedit=1'>Delete</a> ");
+# $r->print("<a href='?rename=$key&forceedit=1'>Rename to \"Hello, World!\"</a>");
+# }
$r->print("</div>");
}
&Apache::lontemplate::print_end_template($r);
@@ -820,7 +863,7 @@
}
push(@html_ids,"hello");
}
- }
+ }
}
return @html_ids;
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.265 loncom/interface/lonhtmlcommon.pm:1.265.2.1
--- loncom/interface/lonhtmlcommon.pm:1.265 Tue Jan 26 13:08:08 2010
+++ loncom/interface/lonhtmlcommon.pm Wed Feb 17 18:42:38 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.265 2010/01/26 13:08:08 wenzelju Exp $
+# $Id: lonhtmlcommon.pm,v 1.265.2.1 2010/02/17 18:42:38 faziophi Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1258,7 +1258,7 @@
if (defined($#fields)) {
unless ($#fields>=0) { return ''; }
}
- return '<a href="'.&HTML::Entities::encode('/adm/preferences?action=set_wysiwyg&wysiwyg=off&returnurl=','<>&"').&escape($ENV{'REQUEST_URI'}).'">'.&mt('Disable WYSIWYG Editor').'</a>';
+ return ''; #'<a href="'.&HTML::Entities::encode('/adm/preferences?action=set_wysiwyg&wysiwyg=off&returnurl=','<>&"').&escape($ENV{'REQUEST_URI'}).'">'.&mt('Disable WYSIWYG Editor').'</a>';
}
sub enablelink {
--faziophi1266432158--