version 1.106.2.3, 2010/02/15 20:28:51
|
version 1.106.2.5, 2010/02/17 18:42:38
|
Line 151 ENDSCRIPT
|
Line 151 ENDSCRIPT
|
|
|
<style type="text/css"> |
<style type="text/css"> |
.LC_Sortable ul { list-style-type: none; margin: 0px; padding: 0px} |
.LC_Sortable ul { list-style-type: none; margin: 0px; padding: 0px} |
.LC_Sortable li { list-style-type: none; margin: 0px 5px 5px 5px; padding: 5px; padding-left: 1.5em; width: 175px; font-size:90% } |
.LC_Sortable li { list-style-type: none; cursor: pointer; margin: 0px 5px 5px 5px; padding: 5px; padding-left: 1.5em; width: 200px; font-size:90% } |
.LC_Sortable li span { float: left; margin-left: -1.5em; } |
.LC_Sortable li span.left { float: left; cursor: move; margin-left: -1.5em; } |
|
.LC_Sortable li span.right { float: right; cursor: auto; margin-right: 0em } |
.LC_EllipseOverflow { overflow: hidden; text-overflow: ellipsis; -o-text-overflow: ellipsis; white-space: nowrap; } |
.LC_EllipseOverflow { overflow: hidden; text-overflow: ellipsis; -o-text-overflow: ellipsis; white-space: nowrap; } |
#scrollable-fields-container {float: left; background-color: white; width: 235px; border: 1px solid grey; margin: 0px} |
.LC_ActivityBarButton-IconLeft { padding-left: 20px } |
#syllabus-fields {position:relative; top: 0;} |
.LC_ActivityBarButton-IconLeft .ui-icon { float:left; margin-left: -18px; } |
#syllabus-fields-container {padding: 0 0 0 0} |
#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-content {margin-left: 245px} |
#syllabus-fields-actions {text-align: center} |
|
#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> |
</style> |
|
|
<script type="text/javascript"> |
<script type="text/javascript"> |
Line 205 ENDSCRIPT
|
Line 215 ENDSCRIPT
|
}; |
}; |
})(jQuery); |
})(jQuery); |
|
|
|
var changesMade = false; |
|
var changesBreakVersion = false; |
|
|
jQuery(document).ready(function() { |
jQuery(document).ready(function() { |
jQuery('.LC_EllipseOverflow').ellipsis(); |
jQuery('.LC_EllipseOverflow').ellipsis(); |
|
jQuery('#syllabus-fields li').click(function() { |
|
jQuery(this).parent().children('li').removeClass('ui-state-highlight'); |
|
jQuery(this).addClass('ui-state-highlight'); |
|
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({ |
jQuery('#syllabus-fields').sortable({ |
revert: true, |
revert: true, |
|
axis: 'y', |
|
cursor: 'move', |
|
placeholder: 'ui-state-highlight', |
|
handle: 'span.ui-icon-arrowthick-2-n-s', |
|
forcePlaceholderSize: true, |
start: function(event, ui) { |
start: function(event, ui) { |
jQuery(ui.item).css('font-style', 'italic'); |
jQuery(ui.item).css('font-style', 'italic'); |
}, |
}, |
Line 219 ENDSCRIPT
|
Line 249 ENDSCRIPT
|
var id = /title-([0-9_]+)/i.exec(jQuery(this).attr('id')); |
var id = /title-([0-9_]+)/i.exec(jQuery(this).attr('id')); |
order.push(id[1]); |
order.push(id[1]); |
}); |
}); |
|
if (!changesMade) { |
|
changesMade = true; |
|
$('#save-button').addClass('ui-state-highlight'); |
|
$('#save-button').removeClass('ui-state-disabled'); |
|
} |
} |
} |
}); |
}); |
jQuery('#syllabus-fields li').click(function() { |
jQuery('#syllabus-fields li').disableSelection(); |
jQuery(this).parent().children('li').removeClass('ui-state-highlight'); |
jQuery('.RemoveSection').hide(); |
jQuery(this).addClass('ui-state-highlight'); |
jQuery('#syllabus-fields li').hover( |
var id = /title-([0-9_]+)/i.exec(jQuery(this).attr('id')); |
function(){ |
jQuery('#syllabus-form .LC_Box').hide(); |
jQuery(this).find('.RemoveSection').toggle(); |
jQuery('#box-'+id[1]).show(); |
}, |
}); |
function(){ |
jQuery('#syllabus-fields ui, li').disableSelection(); |
jQuery(this).find('.RemoveSection').toggle(); |
jQuery('#syllabus-fields-container').height('500px'); |
} |
jQuery('#syllabus-fields-container').css('overflow-x', 'hidden'); |
); |
jQuery('#syllabus-fields-container').css('overflow-y', 'auto'); |
jQuery('#syllabus-fields li span.right').hover( |
jQuery('#syllabus-fields-container').css('position', 'relative'); |
function(){ |
jQuery('#syllabus-fields').css('position', 'relative'); |
jQuery(this).css('background-image', 'url("/adm/jQuery/css/smoothness/images/ui-icons_2e83ff_256x240.png")'); |
jQuery('#syllabus-fields').css('top', '0px'); |
}, |
jQuery('#syllabus-fields').css('display','block'); |
function(){ |
jQuery('#syllabus-fields-container').scroll(function() { |
jQuery(this).css('background-image', 'url("/adm/jQuery/css/smoothness/images/ui-icons_454545_256x240.png")'); |
jQuery('#syllabus-fields').sortable('refreshPositions'); |
} |
}); |
); |
jQuery('#syllabus-form .LC_Box').hide(); |
jQuery('#syllabus-form .LC_Box').hide(); |
|
jQuery('.LC_ActivityBarButton').hover( |
|
function(){ |
|
$(this).addClass("ui-state-hover"); |
|
}, |
|
function(){ |
|
$(this).removeClass("ui-state-hover"); |
|
} |
|
); |
}); |
}); |
</script> |
</script> |
ENDSCRIPT |
ENDSCRIPT |
Line 610 ENDSCRIPT
|
Line 653 ENDSCRIPT
|
my $day = &Apache::lonannounce::showday(time,2, |
my $day = &Apache::lonannounce::showday(time,2, |
&Apache::lonannounce::readcalendar($cdom.'_'.$cnum)); |
&Apache::lonannounce::readcalendar($cdom.'_'.$cnum)); |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
if (($syllabus{'uploaded.lastmodified'}) || ($allowed)) { |
if ($allowed) { |
$r->print("<br />"); |
&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_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"); |
$r->print("<div id='syllabus-content'>\n"); |
|
|
Line 671 ENDSCRIPT
|
Line 716 ENDSCRIPT
|
@htmlids = &print_template_new_fields($r, \%data, |
@htmlids = &print_template_new_fields($r, \%data, |
$target, $allowed, Apache::lontemplate->RICH_TEXT_DETECT_HTML, \%custom_hash); |
$target, $allowed, Apache::lontemplate->RICH_TEXT_DETECT_HTML, \%custom_hash); |
if ($allowed) { |
if ($allowed) { |
$r->print('</form>'. |
$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 ($target ne 'tex') {$r->print('</div><p style="clear:both"> </p>');} |
if ($allowed) { |
if ($allowed) { |
Line 704 ENDSCRIPT
|
Line 749 ENDSCRIPT
|
return OK; |
return OK; |
} |
} |
|
|
|
sub print_activity_bar { |
|
my ($r, $data_ref, $target, $allowed, $default_rich_text, $group) = @_; |
|
$r->print("<div id='activity-bar'> |
|
<button id='save-button' type='button' class='LC_ActivityBarButton LC_ActivityBarButton-IconLeft ui-state-default ui-priority-primary ui-corner-all'> |
|
<span class='ui-icon ui-icon-disk'></span><a href='#'>Save</a> |
|
</button> |
|
|
|
</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 { |
sub print_field_sortable { |
my ($r, $data_ref, $target, $allowed, $default_rich_text, $group) = @_; |
my ($r, $data_ref, $target, $allowed, $default_rich_text, $group) = @_; |
my %data = %{$data_ref}; |
my %data = %{$data_ref}; |
my @fields = @{thaw($data{'data.fields'})}; |
my @fields = @{thaw($data{'data.fields'})}; |
$r->print("<div id='scrollable-fields-container'> |
$r->print("<div id='scrollable-fields-container'> |
<!--<div id='syllabus-fields-up' class='ui-state-default' style='text-align:center'>Up</div>--> |
|
<div id='syllabus-fields-container'> |
<div id='syllabus-fields-container'> |
<ui id='syllabus-fields' class='LC_Sortable LC_SyllabusFields'>\n"); |
<ui id='syllabus-fields' class='LC_Sortable LC_SyllabusFields'>\n"); |
foreach my $key (@fields) { |
foreach my $key (@fields) { |
my %field = %{thaw($data{'data.field.'.$key})}; |
my %field = %{thaw($data{'data.field.'.$key})}; |
$r->print("<li id='title-$key' class='ui-state-default LC_EllipseOverflow' title='$field{title}'><span class='ui-icon ui-icon-arrowthick-2-n-s'></span>$field{title}</li>\n"); |
$r->print("<li id='title-$key' class='ui-state-default LC_EllipseOverflow' title='$field{title}'><span class='ui-icon ui-icon-arrowthick-2-n-s left'></span><span id='remove-$key' class='RemoveSection right ui-icon ui-icon-closethick' title='Delete'></span>$field{title}</li>\n"); |
} |
} |
$r->print(" |
$r->print(" |
</ui> |
</ui> |
</div> |
</div> |
<!--<div id='syllabus-fields-down' class='ui-state-default' style='text-align:center'>Down</div>--> |
<div id='syllabus-fields-actions'> |
|
<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-corner-all'> |
|
<span class='ui-icon ui-icon-arrowreturnthick-1-w'></span><a href='#'>Revert Order</a> |
|
</button> |
|
</div> |
</div>\n"); |
</div>\n"); |
} |
} |
|
|
Line 753 sub print_template_new_fields {
|
Line 843 sub print_template_new_fields {
|
if ($target ne 'tex') { |
if ($target ne 'tex') { |
#output of syllabusfields will be generated here. |
#output of syllabusfields will be generated here. |
&Apache::lontemplate::print_start_template($r,$title,'LC_Box', 'box-'.$key); |
&Apache::lontemplate::print_start_template($r,$title,'LC_Box', 'box-'.$key); |
$r->print($message); |
#$r->print($message); |
if ($allowed) { |
if ($allowed) { |
$r->print("<br /><div>"); |
$r->print("<div>"); |
&Apache::lontemplate::print_textarea_template($r, $raw_message, |
&Apache::lontemplate::print_textarea_template($r, $raw_message, |
$key, $default_rich_text); |
$key, $default_rich_text); |
&Apache::lontemplate::print_saveall_template($r); |
# &Apache::lontemplate::print_saveall_template($r); |
if (!exists($data{'properties.v2_converted'})) { |
# if (!exists($data{'properties.v2_converted'})) { |
$r->print("<a href='?delete=$key&forceedit=1'>Delete</a> "); |
# $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("<a href='?rename=$key&forceedit=1'>Rename to \"Hello, World!\"</a>"); |
} |
# } |
$r->print("</div>"); |
$r->print("</div>"); |
} |
} |
&Apache::lontemplate::print_end_template($r); |
&Apache::lontemplate::print_end_template($r); |
Line 773 sub print_template_new_fields {
|
Line 863 sub print_template_new_fields {
|
} |
} |
push(@html_ids,"hello"); |
push(@html_ids,"hello"); |
} |
} |
} |
} |
} |
} |
|
|
return @html_ids; |
return @html_ids; |