Commit 00e96e99 authored by Robert Lyon's avatar Robert Lyon

Alterations to Mahara to use jquery 1.11.4 (Bug #1384480)

This fixes a bug with long page names in the collection management
screen and tidies up some other drag and drop weirdness.

behatnotneeded: exisiting test coverage should cover this

Change-Id: I44ee2f91b4e6ff3c612584d10abe79fc18693752
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent b5a7abd3
......@@ -157,7 +157,7 @@ if ($available = Collection::available_views($owner, $groupid, $institutionname)
));
}
$noviewsavailable = get_string('noviewsavailable', 'collection');
$smarty = smarty(array('jquery','js/jquery/jquery-ui/js/jquery-ui-1.10.2.min.js','js/jquery/jquery-ui/js/jquery-ui.touch-punch.min.js', 'manage-collection-pages'));
$smarty = smarty(array('jquery','js/jquery/jquery-ui/js/jquery-ui.min.js','js/jquery/jquery-ui/js/jquery-ui.touch-punch.min.js', 'manage-collection-pages'));
setpageicon($smarty, 'icon-folder-open');
if (!empty($groupid)) {
......
......@@ -9,7 +9,8 @@ Dependency package: jquery 2.1.1
Changes:
* None
* Added call to function after datepicker arrow key is pressed - to
allow the year arrows to be re-added on day change
Notes:
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -9,14 +9,6 @@
*
*/
jQuery(function($) {
var fixhelper = function(e, div) {
var originals = div.children();
var helper = div.clone();
helper.children().each(function(index) {
$(this).width(originals.eq(index).width());
});
return helper;
};
var updaterows = function(viewid) {
var sortorder = $('#collectionviews').sortable('serialize');
......@@ -61,9 +53,9 @@ jQuery(function($) {
var wiresortables = function() {
$('#collectionviews').sortable({
items: '> li',
appendTo: document.body,
appendTo: '#collectionpages',
cursor: 'move',
helper: fixhelper,
helper: 'clone',
opacity: 0.8,
placeholder: 'highlight',
stop: function(e, ui) {
......@@ -92,7 +84,7 @@ jQuery(function($) {
connectToSortable: '#collectionviews',
cursor: 'move',
revert: 'invalid',
helper: 'clone',
helper: 'clone'
}).hover(function() {
$(this).css('cursor', 'move');
});
......
......@@ -344,7 +344,7 @@
if (ui.helper.find('.blocktype-radio').length) {
addNewBlock(whereTo, ui.helper.find('input.blocktype-radio').val());
$('.block-placeholder').siblings('.blocktype-drag').remove();
$('.ui-draggable-dragging').remove();
} else {
//move existing block
......
......@@ -141,8 +141,8 @@ function pieform_element_calendar_get_headdata($element) {
global $THEME;
$themefile = $THEME->get_url('style/datepicker.css');
$libjs = $element['jsroot'] . 'js/jquery-ui-1.10.2.min.js';
$libcss = $element['jsroot'] . 'css/ui-lightness/jquery-ui-1.10.2.min.css';
$libjs = $element['jsroot'] . 'js/jquery-ui.min.js';
$libcss = $element['jsroot'] . 'css/smoothness/jquery-ui.min.css';
$timeaddonjs = $element['jsroot'] . 'js/jquery-ui-timepicker-addon.js';
$prev = get_string('datepicker_prevText');
$next = get_string('datepicker_nextText');
......
/*
Additional styles for the configurable theme.
The bulk of the styles live in htdocs/theme/raw/templates/customcss.tpl
*/
......@@ -13,4 +13,4 @@
&:hover {
background-color: rgba(250, 255, 234, 0.2);
}
}
\ No newline at end of file
}
......@@ -122,17 +122,33 @@
}
}
.collection-pages {
.list-group {
.highlight {
padding: 20px;
}
.collection-pages .list-group .highlight {
padding: 20px;
}
.list-group-item {
.text-link {
display: block;
padding-left: 60px;
padding-right: 30px;
}
.single-arrow-up {
padding-right: 32px;
}
.single-arrow-down {
padding-left: 38px;
padding-left: 32px;
.icon-long-arrow-down {
padding-left: 3px !important;
}
}
.order-sort-control {
float: left;
}
form[name^="removeview"] {
position: absolute;
top: 7px;
right: 7px;
}
}
}
......
......@@ -5,7 +5,6 @@
display: table;
border: 1px solid $panel-default-border;
overflow: hidden;
z-index: 1;
position: relative;
......
......@@ -2,11 +2,15 @@
@extend .btn-default; // Button like styling for drag element
background-color: #ffffff;
border-color: $list-group-border;
}
.drag-default-button:not(.ui-draggable-dragging) {
border-left: none; // Don't need side borders because the elements are inside panel
border-right: none;
}
.btn-draggable .btn-group-vertical > .btn {
.btn-draggable .btn-group-vertical > .btn,
.list-group.ui-sortable .ui-draggable-dragging {
@extend .icon;
font-family: $font-family-base;
font-size: $font-size-base;
......@@ -36,6 +40,7 @@
}
label {
font-size: $font-size-base;
white-space: normal;
}
}
.draggable {
......@@ -62,26 +67,8 @@
min-width: 200px;
}
.ui-draggable-dragging {
.blocktype-drag {
overflow: hidden;
min-width: 200px;
}
label {
@include text-overflow;
max-width: 80%;
line-height: 1em;
padding-top: 3px;
margin:0;
}
.icon, .indicator {
padding-top: 3px;
vertical-align: top;
}
.indicator {
padding-top: 5px;
}
#addviews .ui-draggable-dragging {
width: 100% !important;
}
// Droppable area background indicator
......
......@@ -3,21 +3,21 @@
<li class="list-group-item" id="row_{$view->view}">
{if $views.count > 1}
{if $view->displayorder == $views.min}
<a class="btn btn-xs text-default single-arrow-down" href="{$displayurl}&amp;view={$view->view}&amp;direction=down">
<span class="icon icon-lg icon-long-arrow-down prs"></span>
<a class="btn btn-xs text-default order-sort-control single-arrow-down" href="{$displayurl}&amp;view={$view->view}&amp;direction=down">
<span class="icon icon-lg icon-long-arrow-down"></span>
<span class="sr-only">{str tag=moveitemdown}</span>
</a>
{elseif $view->displayorder == $views.max}
<a class="btn btn-xs text-default single-arrow-up" href="{$displayurl}&amp;view={$view->view}&amp;direction=up">
<a class="btn btn-xs text-default order-sort-control single-arrow-up" href="{$displayurl}&amp;view={$view->view}&amp;direction=up">
<span class="icon icon-lg icon-long-arrow-up prs"></span>
<span class="sr-only">{str tag=moveitemup}</span>
</a>
{else}
<a class="btn btn-xs text-default" href="{$displayurl}&amp;view={$view->view}&amp;direction=up">
<a class="btn btn-xs text-default order-sort-control" href="{$displayurl}&amp;view={$view->view}&amp;direction=up">
<span class="icon icon-lg icon-long-arrow-up prs"></span>
<span class="sr-only">{str tag=moveitemup}</span>
</a>
<a class="btn btn-xs text-default" href="{$displayurl}&amp;view={$view->view}&amp;direction=down">
<a class="btn btn-xs text-default order-sort-control" href="{$displayurl}&amp;view={$view->view}&amp;direction=down">
<span class="icon icon-lg icon-long-arrow-down "></span>
<span class="sr-only">{str tag=moveitemdown}</span>
</a>
......
......@@ -39,21 +39,21 @@
<li class="list-group-item" id="row_{$view->view}">
{if $views.count > 1}
{if $view->displayorder == $views.min}
<a class="btn btn-xs text-default single-arrow-down" href="{$displayurl}&amp;view={$view->view}&amp;direction=down">
<span class="icon icon-lg icon-long-arrow-down prs"></span>
<a class="btn btn-xs text-default order-sort-control single-arrow-down" href="{$displayurl}&amp;view={$view->view}&amp;direction=down">
<span class="icon icon-lg icon-long-arrow-down"></span>
<span class="sr-only">{str tag=moveitemdown}</span>
</a>
{elseif $view->displayorder == $views.max}
<a class="btn btn-xs text-default single-arrow-up" href="{$displayurl}&amp;view={$view->view}&amp;direction=up">
<a class="btn btn-xs text-default order-sort-control single-arrow-up" href="{$displayurl}&amp;view={$view->view}&amp;direction=up">
<span class="icon icon-lg icon-long-arrow-up prs"></span>
<span class="sr-only">{str tag=moveitemup}</span>
</a>
{else}
<a class="btn btn-xs text-default" href="{$displayurl}&amp;view={$view->view}&amp;direction=up">
<a class="btn btn-xs text-default order-sort-control" href="{$displayurl}&amp;view={$view->view}&amp;direction=up">
<span class="icon icon-lg icon-long-arrow-up prs"></span>
<span class="sr-only">{str tag=moveitemup}</span>
</a>
<a class="btn btn-xs text-default" href="{$displayurl}&amp;view={$view->view}&amp;direction=down">
<a class="btn btn-xs text-default order-sort-control" href="{$displayurl}&amp;view={$view->view}&amp;direction=down">
<span class="icon icon-lg icon-long-arrow-down"></span>
<span class="sr-only">{str tag=moveitemdown}</span>
</a>
......
......@@ -123,6 +123,16 @@ jQuery(function($) {
showOtherMonths: true,
selectOtherMonths: true,
showButtonPanel: true,
beforeShow: function(input, inst) {
setTimeout(function() {
add_prev_next_year(inst);
}, 1);
},
onChangeMonthYear: function(y, m, inst) {
setTimeout(function() {
add_prev_next_year(inst);
}, 1);
},
onClose: function( selectedDate ) {
var setmin = $(this).attr('data-setmin'),
setmax = $(this).attr('data-setmax'),
......
......@@ -145,7 +145,7 @@ if ($viewtheme && !isset($allowedthemes[$viewtheme])) {
exit;
}
$javascript = array('views', 'tinymce', 'paginator', 'js/jquery/jquery-ui/js/jquery-ui-1.10.2.min.js',
$javascript = array('views', 'tinymce', 'paginator', 'js/jquery/jquery-ui/js/jquery-ui.min.js',
'js/jquery/jquery-ui/js/jquery-ui.touch-punch.min.js', 'tablerenderer', 'artefact/file/js/filebrowser.js',
'lib/pieforms/static/core/pieforms.js','js/jquery/modernizr.custom.js');
$blocktype_js = $view->get_all_blocktype_javascript();
......
......@@ -173,8 +173,8 @@ $layoutform = array(
$layoutform = pieform($layoutform);
$javascript = array('jquery','js/jquery/jquery-ui/js/jquery-ui-1.10.2.min.js', 'js/customlayout.js','js/jquery/modernizr.custom.js');
$stylesheets[] = '<link rel="stylesheet" type="text/css" href="' . append_version_number(get_config('wwwroot') . 'js/jquery/jquery-ui/css/ui-lightness/jquery-ui-1.10.2.min.css') . '">';
$javascript = array('jquery','js/jquery/jquery-ui/js/jquery-ui.min.js', 'js/customlayout.js','js/jquery/modernizr.custom.js');
$stylesheets[] = '<link rel="stylesheet" type="text/css" href="' . append_version_number(get_config('wwwroot') . 'js/jquery/jquery-ui/css/smoothness/jquery-ui.min.css') . '">';
$smarty = smarty($javascript, $stylesheets, array('view' => array('Row', 'removethisrow', 'rownr', 'nrrows')), array('sidebars' => false));
......
......@@ -224,7 +224,7 @@ if ($viewtheme && $THEME->basename != $viewtheme) {
$THEME = new Theme($viewtheme);
}
$headers = array();
$headers[] = '<link rel="stylesheet" type="text/css" href="' . append_version_number(get_config('wwwroot') . 'js/jquery/jquery-ui/css/ui-lightness/jquery-ui-1.10.2.min.css') . '">';
$headers[] = '<link rel="stylesheet" type="text/css" href="' . append_version_number(get_config('wwwroot') . 'js/jquery/jquery-ui/css/smoothness/jquery-ui.min.css') . '">';
$headers = array_merge($headers, $view->get_all_blocktype_css());
// Set up skin, if the page has one
$viewskin = $view->get('skin');
......
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