Skip to content

Commit

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

The following comments is a mash of commits for reference only:

Squashed commit of the following:

commit a6ab42de71e41c0760d6d99dec7a3ec6ef8b7e52
Author: Mary Evans <lazydaisy@visible-expression.co.uk>
Date:   Sat Feb 23 15:34:12 2013 +0000

    MDL-33934 theme_mymobile: fixing whitspace and undoing some previous confict changes fixing where broken.

commit a5abe86fad012f2face9dbd98826583499f46b88
Merge: 89c04c2 13c3ee1
Author: Mary Evans <lazydaisy@visible-expression.co.uk>
Date:   Sat Feb 23 15:18:17 2013 +0000

    Merge branch 'wip-MDL-33934_master' of github.com:lazydaisy/moodle into wip-MDL-33934_master

    Conflicts:
        theme/mymobile/javascript/custom.js
        theme/mymobile/style/core.css

commit 89c04c2bee75938ba5e6f6b54f43ff866c6119b6
Author: Mary Evans <lazydaisy@visible-expression.co.uk>
Date:   Sat Feb 23 15:01:43 2013 +0000

    MDL-33934 theme_mymobile: Removed collapsed topic contributed plugin css/js from style/core.css & javascript/custom.js

commit ddee12ebd2083af0ebebd747e867957d46a10af7
Author: Mary Evans <lazydaisy@visible-expression.co.uk>
Date:   Tue Feb 19 11:05:35 2013 +0000

    MDL-33934 theme-mymobile: un-commenting $(document).ready(function() in javascript/custom.js.

commit 365bb2d9772f9fd2cb55139f728fa9611dac7b4d
Author: Mary Evans <lazydaisy@visible-expression.co.uk>
Date:   Sun Feb 17 17:41:47 2013 +0000

    MDL-33934 theme_mymobile: updates to javascript and css

commit 13c3ee133945ce0e2a55dd54e0c8b8e2a35f76c5
Author: Mary Evans <lazydaisy@visible-expression.co.uk>
Date:   Tue Feb 19 11:05:35 2013 +0000

    MDL-33934 theme-mymobile: un-commenting $(document).ready(function() in javascript/custom.js.

commit c9e626adf810e3d8d3f776b99d648017033fdb39
Author: Mary Evans <lazydaisy@visible-expression.co.uk>
Date:   Sun Feb 17 17:41:47 2013 +0000

    MDL-33934 theme_mymobile: updates to javascript and css
  • Loading branch information
Mary Evans committed Feb 23, 2013
1 parent f29e62c commit c443c95
Show file tree
Hide file tree
Showing 185 changed files with 9,113 additions and 7,390 deletions.
19 changes: 9 additions & 10 deletions theme/mymobile/config.php 100644 → 100755
Expand Up @@ -34,8 +34,7 @@

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

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

// Sets a custom render factory to use with the theme, used when working with custom renderers.
Expand Down
60 changes: 29 additions & 31 deletions theme/mymobile/javascript/custom.js 100644 → 100755
@@ -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 = $('.mobilesiteurl').attr("id");
var mytheme = $(".datatheme").attr("id");
var mythemeb = $(".datathemeb").attr("id");

var siteurl = $('head meta[name=wwwroot]').attr('wwwroot');
var mytheme = $('head meta[name=datatheme]').attr('datatheme');
var mythemeb = $('head meta[name=datathemeb]').attr('datathemeb');

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').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, .settingsul li a, .foldertree li 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,6 +81,7 @@ $(document).ready(function() {
var meb = encodeURI($(this).val());
$(this).val("-1");
if (meb != "" && meb != "-1") {
$.mobile.showPageLoadingMsg();
$.mobile.changePage(meb);
}
});
Expand All @@ -89,13 +90,19 @@ $(document).ready(function() {


//course page only js
$('div.path-site, div.path-course-view, .path-course-view div.generalpage').live('pagebeforecreate', function(event, ui) {
$('div.path-course-view, .path-course-view div.generalpage').live('pagebeforecreate', function(event, ui) {
//course listing
$('.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);
$('.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");
$('.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 @@ -107,12 +114,6 @@ $(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 @@ -132,10 +133,18 @@ $(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-inline", "true");
$('.options div.commands a').attr("data-role", "button").attr("data-ajax", "false").attr("data-mini", "true").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 @@ -150,6 +159,7 @@ $(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 @@ -243,21 +253,9 @@ $(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: 0 additions & 4 deletions theme/mymobile/javascript/jquery-1.7.1.min.js

This file was deleted.

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

Large diffs are not rendered by default.

0 comments on commit c443c95

Please sign in to comment.