Skip to content
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.

Commit

Permalink
Revert "MDL-33934 theme_mymobile: Updates to CSS & Javascript - inclu…
Browse files Browse the repository at this point in the history
…ding MDL-38072 removing css/js for collapsed topic."

This reverts commit 7e6c674.
This reverts commit c443c95.

This issue needs more work and will be delayed.
  • Loading branch information
Damyon Wiese committed Feb 28, 2013
1 parent 4e51613 commit 01ac2cd
Show file tree
Hide file tree
Showing 19 changed files with 7,081 additions and 8,802 deletions.
19 changes: 10 additions & 9 deletions theme/mymobile/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@

// Set the stylesheets that we want to include for this theme
$THEME->sheets = array(
'jmobile120',
'jmobile11',
'jmobile11_rtl',
'core',
'media'
);
Expand Down Expand Up @@ -104,34 +105,34 @@
'popup' => array(
'file' => 'embedded.php',
'regions' => array(),
'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>true),
'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>true, 'nocourseheaderfooter'=>true),
),
'frametop' => array(
'file' => 'general.php',
'regions' => array(),
'options' => array('nofooter'=>true),
'options' => array('nofooter'=>true, 'nocoursefooter'=>true),
),
'maintenance' => array(
'file' => 'general.php',
'regions' => array(),
'options' => array('nofooter'=>true, 'nonavbar'=>true),
'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocourseheaderfooter'=>true),
),
'embedded' => array(
'file' => 'embedded.php',
'regions' => array(),
'options' => array('nofooter'=>true, 'nonavbar'=>true),
'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocourseheaderfooter'=>true),
),
// Should display the content and basic headers only.
'print' => array(
'file' => 'general.php',
'regions' => array(),
'options' => array('nofooter'=>true, 'nonavbar'=>false, 'noblocks'=>true),
'options' => array('nofooter'=>true, 'nonavbar'=>false, 'noblocks'=>true, 'nocourseheaderfooter'=>true),
),
// The pagelayout used when a redirection is occuring.
'redirect' => array(
'file' => 'embedded.php',
'regions' => array(),
'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true),
'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
// The pagelayout used for reports
'report' => array(
Expand All @@ -155,9 +156,9 @@

// Add the required JavaScript to the page
$THEME->javascripts = array(
'jquery-1.8.2.min',
'jquery-1.7.1.min',
'custom',
'jquery.mobile-1.2.0'
'jquery.mobile-1.1.1'
);

// Sets a custom render factory to use with the theme, used when working with custom renderers.
Expand Down
60 changes: 31 additions & 29 deletions theme/mymobile/javascript/custom.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
$(document).bind("mobileinit", function(){
//mobile init stuff 11/12/10
//turn off ajax forms...
$.mobile.defaultPageTransition = "slide";
});

$(document).ready(function() {
//get some vars to start
var siteurl = $('head meta[name=wwwroot]').attr('wwwroot');
var mytheme = $('head meta[name=datatheme]').attr('datatheme');
var mythemeb = $('head meta[name=datathemeb]').attr('datathemeb');
var siteurl = $('.mobilesiteurl').attr("id");
var mytheme = $(".datatheme").attr("id");
var mythemeb = $(".datathemeb").attr("id");


if ($('body').hasClass('ajaxno')) {
$.mobile.ajaxEnabled = false;
}
//function below does generic stuff before creating all pages...
$('div').live('pagebeforecreate', function(event, ui) {
//turn off ajax on all forms for now as of beta1
Expand Down Expand Up @@ -60,8 +60,8 @@ $(document).ready(function() {
return false;
});

//calendar and other links that need to be external
$('.maincalendar .filters a, li.activity.scorm a, div.files a, #page-user-filesPAGE li div a, .maincalendar .bottom a, .section li.url.modtype_url a, .resourcecontent .resourcemediaplugin a, #underfooter .noajax a, .block_mnet_hosts .content a, .block_private_files .content a, a.portfolio-add-link, #attempts td a, .settingsul li a, .foldertree li a').attr("data-ajax", "false");
//calendar and other links that need to be external
$('.maincalendar .filters a, li.activity.scorm a, div.files a, #page-user-filesPAGE li div a, .maincalendar .bottom a, .section li.url.modtype_url a, .resourcecontent .resourcemediaplugin a, #underfooter .noajax a, .block_mnet_hosts .content a, .block_private_files .content a, a.portfolio-add-link, #attempts td a').attr("data-ajax", "false");

//add blank to open in window for some
$('#page-mod-url-viewPAGE div.urlworkaround a, #page-mod-resource-viewPAGE div.resourceworkaround a, .mediaplugin a.mediafallbacklink, #page-mod-resource-viewPAGE .resourcemp3 a, .foldertree li a').attr("target", "_blank").attr("data-role", "button").attr("data-icon", "plus");
Expand All @@ -81,7 +81,6 @@ $(document).ready(function() {
var meb = encodeURI($(this).val());
$(this).val("-1");
if (meb != "" && meb != "-1") {
$.mobile.showPageLoadingMsg();
$.mobile.changePage(meb);
}
});
Expand All @@ -90,19 +89,13 @@ $(document).ready(function() {


//course page only js
$('div.path-course-view, .path-course-view div.generalpage').live('pagebeforecreate', function(event, ui) {
$('div.path-site, div.path-course-view, .path-course-view div.generalpage').live('pagebeforecreate', function(event, ui) {
//course listing
$('.section li img').addClass("ui-li-icon");
$('.course-content ul.section').attr("data-role", "listview").attr("data-inset", "true").attr("data-theme", mythemeb);
$('.sitetopic ul.section').attr("data-role", "listview").attr("data-inset", "true").attr("data-theme", mythemeb);
$('.section-navigation.header.headingblock, .section-navigation.mdl-bottom').attr("data-role", "controlgroup");
$('.section-navigation.header.headingblock .mdl-left a, .section-navigation.mdl-bottom .mdl-left a').attr("data-role", "button").attr("data-icon", "arrow-l");
$('.section-navigation.header.headingblock .mdl-right a, .section-navigation.mdl-bottom .mdl-right a').attr("data-role", "button").attr("data-icon", "arrow-r").attr("data-iconpos", "right");
$('.section-navigation.header.headingblock .mdl-align.title, .section-navigation.mdl-bottom .mdl-align a').attr("data-role", "button");
$('.section li img.activityicon').addClass("ui-li-icon");
$('.course-content ul.section, .sitetopic ul.section').attr("data-role", "listview").attr("data-inset", "true").attr("data-theme", mythemeb);
$('.topics div.left.side').addClass("ui-bar-" + mytheme);
$('.section.hidden div.headingwrap').attr("data-theme", mythemeb);
//$('.topics #section-0 div.left.side').removeClass("ui-li ui-li-divider ui-btn ui-bar-a");
$('h3.section-title a').attr("data-role", "button");
$('.section .resource.modtype_resource a, .section .modtype_survey a').attr("data-ajax", "false");

//toggle completion checkmarks and form fixes
Expand All @@ -114,6 +107,12 @@ $(document).ready(function() {
this.form.submit();
return false;
});

// Force the class ui-li-desc on non-detected elements.
$('ul.section div.availabilityinfo, ul.section div.contentafterlink').addClass('ui-li-desc');

// Force some classes on dimmed elements.
$('ul.section div.dimmed_text > span').addClass('instancename');
});

//forum listing only stuff
Expand All @@ -133,18 +132,10 @@ $(document).ready(function() {

//forum discussion page only stuff
$('div#page-mod-forum-discussPAGE, #page-mod-forum-discuss div.generalpage, div.forumtype-single, .forumtype-single div.generalpage, div#page-mod-forum-postPAGE').live('pagebeforecreate',function(event, ui){
//remove parent post because of hash remove this if has listening is fixed
$('.options div.commands a').each(function(index) {
var url = $(this).attr("href");
if (url.indexOf("#") != -1) {
$(this).remove();
}
});

//actual forum posting
$('.forumpost div.row.header').addClass("ui-li ui-li-divider ui-btn ui-bar-" + mytheme);
$('.options div.commands').attr("data-role", "controlgroup").attr("data-type", "horizontal");
$('.options div.commands a').attr("data-role", "button").attr("data-ajax", "false").attr("data-mini", "true").attr("data-inline", "true");
$('.options div.commands a').attr("data-role", "button").attr("data-ajax", "false").attr("data-inline", "true");
$('.forumpost div.author a').attr("data-inline", "true");
$('.options div.commands').contents().filter(function() {
return this.nodeType == 3; //Node.TEXT_NODE
Expand All @@ -159,7 +150,6 @@ $(document).ready(function() {
$('.forumpost div.row.header').addClass("ui-li ui-li-divider ui-btn ui-bar-" + mytheme);
$('div.subscribelink a').attr("data-role", "button").attr("data-inline", "true");
$('.unlist').attr("data-role", "controlgroup");
//$('.unlist li:last-child div.coursebox h3 a').addClass("ui-corner-bottom ui-controlgroup-last"); moved to init at bottom
$('div.coursebox a').attr("data-role", "button").attr("data-icon", "arrow-r").attr("data-iconpos", "right").attr("data-theme", mythemeb);
$('.box.categorybox').attr("data-role", "controlgroup");
$('div.categorylist div.category a').attr("data-role", "button").attr("data-theme", mythemeb);
Expand Down Expand Up @@ -253,9 +243,21 @@ $(document).ready(function() {
$('.path-mod-hotpot button').attr("data-role", "none");
});

//collapsed topic only stuff
$('div#page-course-view-topcollPAGE').live('pagebeforecreate',function(event, ui){
$('#page-course-view-topcollPAGE ul.section').attr("data-role", "none");
$('.section li img').removeClass("ui-li-icon");
$.getScript('../course/format/topcoll/module.js');
$('#page-course-view-topcollPAGE tr.cps a').attr("data-role", "button").attr("data-icon", "arrow-r");
$('#page-course-view-topcollPAGE #thetopics').attr("data-role", "controlgroup");
$('#page-course-view-topcollPAGE td.cps_centre').each(function(index) {
var cpsc = $(this).text().replace('<br>','').replace(')','');
$(this).prev('td').find('a').append('<span class="ui-li-count ui-btn-up-a ui-btn-corner-all">' + cpsc + '</span>');
});
});

///// functions below does stuff after creating page for some cleaning...
$('div').live('pageinit',function(event, ui){
$('div#page-site-indexPAGE .unlist li:last-child div.coursebox h3 a').addClass("ui-corner-bottom ui-controlgroup-last");
$('.path-calendar div.ui-radio label:first-child, .path-mod-lesson div.ui-radio label:first-child, #page-mod-wiki-createPAGE div.ui-radio label:first-child').addClass("afirst");
$('.forumpost div.author a').removeAttr('data-role');
//$('.questionflagimage2').removeClass("ui-btn-hidden");a#notificationyes
Expand Down
4 changes: 4 additions & 0 deletions theme/mymobile/javascript/jquery-1.7.1.min.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions theme/mymobile/javascript/jquery-1.8.2.min.js

This file was deleted.

Loading

0 comments on commit 01ac2cd

Please sign in to comment.