Commit 5ba34184 authored by Naomi Guyer's avatar Naomi Guyer Committed by Aaron Wells

BUG: Fix fieldsets

Bug 1465107: Use Bootstrap CSS Framework

Change-Id: I3257f5d5aab81fcb6df6497a388fb9224344e78d
parent b9a75deb
......@@ -154,7 +154,7 @@ $elements = array(
'contact' => array(
'type' => 'fieldset',
'legend' => get_string('contact', 'artefact.internal'),
'class' => $fieldset != 'contact' ? 'collapsed' : '',
'class' => $fieldset != 'contact' ? '' : '',
'elements' => get_desired_fields($items, array('email', 'maildisabled', 'officialwebsite', 'personalwebsite', 'blogaddress', 'address', 'town', 'city', 'country', 'homenumber', 'businessnumber', 'mobilenumber', 'faxnumber'), 'contact'),
),
'social' => array(
......@@ -192,7 +192,7 @@ $profileform = pieform(array(
// will be uncommented when js for tabbed interface is called again after form submit
// 'jsform' => true,
'method' => 'post',
'renderer' => 'div', // don't change unless you also modify tabs.js to not require tables.
'renderer' => 'div',
'elements' => $elements,
'autofocus' => false,
));
......
......@@ -5343,8 +5343,243 @@ define("tinymce/dom/DOMUtils", [
* // Sets class attribute on a specific element in the current page
* tinymce.dom.setAttrib('mydiv', 'class', 'myclass');
*/
<<<<<<< HEAD
setAttrib: function(elm, name, value) {
var self = this, originalValue, hook, settings = self.settings;
=======
documentMode: ie ? (document.documentMode || 7) : 10
};
});
// Included from: js/tinymce/classes/dom/StyleSheetLoader.js
/**
* StyleSheetLoader.js
*
* Copyright, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
/**
* This class handles loading of external stylesheets and fires events when these are loaded.
*
* @class tinymce.dom.StyleSheetLoader
* @private
*/
define("tinymce/dom/StyleSheetLoader", [], function() {
"use strict";
return function(document, settings) {
var idCount = 0, loadedStates = {}, maxLoadTime;
settings = settings || {};
maxLoadTime = settings.maxLoadTime || 5000;
function appendToHead(node) {
document.getElementsByTagName('head')[0].appendChild(node);
}
/**
* Loads the specified css style sheet file and call the loadedCallback once it's finished loading.
*
* @method load
* @param {String} url Url to be loaded.
* @param {Function} loadedCallback Callback to be executed when loaded.
* @param {Function} errorCallback Callback to be executed when failed loading.
*/
function load(url, loadedCallback, errorCallback) {
var link, style, startTime, state;
function passed() {
var callbacks = state.passed, i = callbacks.length;
while (i--) {
callbacks[i]();
}
state.status = 2;
state.passed = [];
state.failed = [];
}
function failed() {
var callbacks = state.failed, i = callbacks.length;
while (i--) {
callbacks[i]();
}
state.status = 3;
state.passed = [];
state.failed = [];
}
// Sniffs for older WebKit versions that have the link.onload but a broken one
function isOldWebKit() {
var webKitChunks = navigator.userAgent.match(/WebKit\/(\d*)/);
return !!(webKitChunks && webKitChunks[1] < 536);
}
// Calls the waitCallback until the test returns true or the timeout occurs
function wait(testCallback, waitCallback) {
if (!testCallback()) {
// Wait for timeout
if ((new Date().getTime()) - startTime < maxLoadTime) {
window.setTimeout(waitCallback, 0);
} else {
failed();
}
}
}
// Workaround for WebKit that doesn't properly support the onload event for link elements
// Or WebKit that fires the onload event before the StyleSheet is added to the document
function waitForWebKitLinkLoaded() {
wait(function() {
var styleSheets = document.styleSheets, styleSheet, i = styleSheets.length, owner;
while (i--) {
styleSheet = styleSheets[i];
owner = styleSheet.ownerNode ? styleSheet.ownerNode : styleSheet.owningElement;
if (owner && owner.id === link.id) {
passed();
return true;
}
}
}, waitForWebKitLinkLoaded);
}
// Workaround for older Geckos that doesn't have any onload event for StyleSheets
function waitForGeckoLinkLoaded() {
wait(function() {
try {
// Accessing the cssRules will throw an exception until the CSS file is loaded
var cssRules = style.sheet.cssRules;
passed();
return !!cssRules;
} catch (ex) {
// Ignore
}
}, waitForGeckoLinkLoaded);
}
if (!loadedStates[url]) {
state = {
passed: [],
failed: []
};
loadedStates[url] = state;
} else {
state = loadedStates[url];
}
if (loadedCallback) {
state.passed.push(loadedCallback);
}
if (errorCallback) {
state.failed.push(errorCallback);
}
// Is loading wait for it to pass
if (state.status == 1) {
return;
}
// Has finished loading and was success
if (state.status == 2) {
passed();
return;
}
// Has finished loading and was a failure
if (state.status == 3) {
failed();
return;
}
// Start loading
state.status = 1;
link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.id = 'u' + (idCount++);
link.async = false;
link.defer = false;
startTime = new Date().getTime();
// Feature detect onload on link element and sniff older webkits since it has an broken onload event
if ("onload" in link && !isOldWebKit()) {
link.onload = waitForWebKitLinkLoaded;
link.onerror = failed;
} else {
// Sniff for old Firefox that doesn't support the onload event on link elements
// TODO: Remove this in the future when everyone uses modern browsers
if (navigator.userAgent.indexOf("Firefox") > 0) {
style = document.createElement('style');
style.textContent = '@import "' + url + '"';
waitForGeckoLinkLoaded();
appendToHead(style);
return;
} else {
// Use the id owner on older webkits
waitForWebKitLinkLoaded();
}
}
appendToHead(link);
link.href = url;
}
this.load = load;
};
});
// Included from: js/tinymce/classes/dom/DOMUtils.js
/**
* DOMUtils.js
*
* Copyright, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
/**
* Utility class for various DOM manipulation and retrieval functions.
*
* @class tinymce.dom.DOMUtils
* @example
* // Add a class to an element by id in the page
* tinymce.DOM.addClass('someid', 'someclass');
*
* // Add a class to an element by id inside the editor
* tinymce.activeEditor.dom.addClass('someid', 'someclass');
*/
define("tinymce/dom/DOMUtils", [
"tinymce/dom/Sizzle",
"tinymce/html/Styles",
"tinymce/dom/EventUtils",
"tinymce/dom/TreeWalker",
"tinymce/dom/Range",
"tinymce/html/Entities",
"tinymce/Env",
"tinymce/util/Tools",
"tinymce/dom/StyleSheetLoader"
], function(Sizzle, Styles, EventUtils, TreeWalker, Range, Entities, Env, Tools, StyleSheetLoader) {
// Shorten names
var each = Tools.each, is = Tools.is, grep = Tools.grep, trim = Tools.trim, extend = Tools.extend;
var isWebKit = Env.webkit, isIE = Env.ie;
var simpleSelectorRe = /^([a-z0-9],?)+$/i;
var whiteSpaceRegExp = /^[ \t\r\n]*$/;
var numericCssMap = Tools.makeMap('fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom', ' ');
>>>>>>> BUG: Fix fieldsets
if (value === '') {
value = null;
......
......@@ -45,17 +45,20 @@ function pieform_element_fieldset(Pieform $form, $element) {
$iscollapsible = pieform_is_collapsible($element);
$iscollapsed = pieform_is_collapsed($form, $element);
$classes = array('pieform-fieldset', 'collapsible');
$classes = array('pieform-fieldset');
if (!empty($element['class'])) {
$classes[] = Pieform::hsc($element['class']);
}
$fieldset = '<fieldset class="' . implode(' ', $classes) . '">';
// if fieldset is collapsible, we need to adjust the legend html
if ($iscollapsible) {
$classes[] = 'collapsible';
// Why is this here? What does it do that is different with collapsible fieldsets?
if (!isset($_PIEFORM_FIELDSETS['forms'][$formname])) {
$_PIEFORM_FIELDSETS['forms'][$formname] = array('formname' => $formname);
......@@ -78,6 +81,8 @@ function pieform_element_fieldset(Pieform $form, $element) {
$legendcontent .= '</a>';
}
$fieldset = '<fieldset class="' . implode(' ', $classes) . '">';
// Render legend and associated objects
if (isset($element['legend'])) {
$fieldset .= '<legend><h4>' . $legendcontent;
......
......@@ -3,7 +3,7 @@
jQuery(function($) {
"use strict";
$('.notification-item .control-wrapper').click(function(event) {
event.stopPropagation();
$('.notification-item .control-wrapper').click(function(e) {
e.stopPropagation();
});
});
\ No newline at end of file
......@@ -32,11 +32,18 @@ jQuery(function($) {
tabnav.find('li:first-child').addClass('active');
// Remove extra padding when there is no site message
// Remove extra padding when there are no site message
if ($('.site-messages').length === 0) {
$('.header').addClass('no-site-messages');
$('.main-nav').addClass('no-site-messages');
}
// Add markup to switch type input
$('.switch').each(function(index){
......@@ -46,6 +53,10 @@ jQuery(function($) {
'<label class="switch-label" for="'+ inputId +'"><span class="switch-inner"></span><span class="switch-switch"></span></label>'
);
});
// Add bootstrap class to the add file content for filebrowser
// modal screen
$('#js-filebrowser').wrapInner('<div class="modal-dialog modal-lg"><div class="modal-content modal-filebrowser"></div></div>');
......
......@@ -25,8 +25,6 @@ label.sr-only + div.mce-tinymce {
}
.main form .form-group {
margin: 20px 0;
label,
.pseudolabel {
@extend .control-label;
......
......@@ -69,17 +69,26 @@
}
a.panel-footer {
text-align:center;
color: #555;
display: block;
&:hover {
color: #222;
background: $gray-lighter;
.fa {
color: $link-color;
}
}
.fa.pull-right {
margin-top: 3px;
text-align:center;
color: #555;
display: block;
&:hover {
color: #222;
background: $gray-lighter;
.fa {
color: $link-color;
}
}
\ No newline at end of file
}
.fa.pull-right {
margin-top: 3px;
}
}
//Dispaly ul's in panels differentyly
.panel-body {
ul {
padding-left: 20px;
margin: 0 0 20px;
font-size: 0.9em;
}
}
......@@ -62,6 +62,9 @@
padding: 10px 15px;
background: #fff;
margin-bottom: -1px; //remove double border
.jstabs & {
border: 0;
}
}
.collapsible-group & {
.form-group {
......
.tab-content {
padding-top: $grid-gutter-width;
}
}
\ No newline at end of file
......@@ -81,14 +81,3 @@ img {
}
}
}
.panel-body {
ul {
padding-left: 20px;
margin: 0 0 20px;
font-size: 0.9em;
}
}
fieldset {
margin-bottom: 20px;
}
\ No newline at end of file
......@@ -88,11 +88,11 @@
@import "components/layout";
@import "components/header";
@import "components/top-nav";
@import "components/tabs";
@import "components/navbar";
@import "components/minor-nav";
@import "components/main-nav";
@import "components/toggles";
@import "components/tabs";
@import "components/contextual-help";
@import "components/fonts";
@import "components/site-messages";
......@@ -107,7 +107,7 @@
@import "components/dropzone-previews";
@import "components/post";
@import "components/attachments";
@import "components/panel-items";
@import "components/panel";
@import "components/pieform-fieldset";
@import "components/input-as-icon";
@import "components/ui-draggable";
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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