Skip to content

Commit

Permalink
fixing messed up JS files
Browse files Browse the repository at this point in the history
  • Loading branch information
himerus committed Jan 6, 2011
1 parent ec5fbb7 commit 95504c2
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 40 deletions.
42 changes: 21 additions & 21 deletions js/debug.js
Expand Up @@ -4,55 +4,55 @@
Drupal.grid_debug = function (context) {
// add toolbar items
if (Drupal.settings.fluid_grid == 'fluid') {
omega('body').addClass('fluid-grid');
$('body').addClass('fluid-grid');
}
// add an extra identifying class to body
omega('body').addClass('has-grid');
$('body').addClass('has-grid');
if (Drupal.settings.grid_overlay_state) {
// grid is on by default
omega('body:not(.fluid-grid)').addClass('show-grid');
omega('body').addClass('grid-hover');
$('body:not(.fluid-grid)').addClass('show-grid');
$('body').addClass('grid-hover');
var debug_next_state = "Off";
}
else {
// grid is off by default
var debug_next_state = "On";
}
// add toggle button/section
omega('#page').after('<div id="omega-debug"><a href="#">Turn Debug <strong>'+debug_next_state+'</strong></a><div id="omega-debug-info"></div></div>');
$('#page').after('<div id="omega-debug"><a href="#">Turn Debug <strong>'+debug_next_state+'</strong></a><div id="omega-debug-info"></div></div>');
// toggle info between clicks
omega('#omega-debug a').click(function(){
$('#omega-debug a').click(function(){
if (debug_next_state == "Off") {
omega('#omega-debug a').html('Turn Debug <strong>On</strong>');
omega('body:not(.fluid-grid)').removeClass('show-grid');
omega('body').removeClass('grid-hover');
$('#omega-debug a').html('Turn Debug <strong>On</strong>');
$('body:not(.fluid-grid)').removeClass('show-grid');
$('body').removeClass('grid-hover');
debug_next_state = "On";
return false;
}
else {
omega('#omega-debug a').html('Turn Debug <strong>Off</strong>');
omega('body:not(.fluid-grid)').addClass('show-grid');
omega('body').addClass('grid-hover');
$('#omega-debug a').html('Turn Debug <strong>Off</strong>');
$('body:not(.fluid-grid)').addClass('show-grid');
$('body').addClass('grid-hover');
debug_next_state = "Off";
return false;
}
});

// show info on hovering region
omega('.has-grid .grid-1, .has-grid .grid-2, .has-grid .grid-3, .has-grid .grid-4, .has-grid .grid-5, .has-grid .grid-6, .has-grid .grid-7, .has-grid .grid-8, .has-grid .grid-9, .has-grid .grid-10, .has-grid .grid-11, .has-grid .grid-12, .has-grid .grid-13, .has-grid .grid-14, .has-grid .grid-15, .has-grid .grid-16, .has-grid .grid-17, .has-grid .grid-18, .has-grid .grid-19, .has-grid .grid-20, .has-grid .grid-21, .has-grid .grid-22, .has-grid .grid-23, .has-grid .grid-24')
$('.has-grid .grid-1, .has-grid .grid-2, .has-grid .grid-3, .has-grid .grid-4, .has-grid .grid-5, .has-grid .grid-6, .has-grid .grid-7, .has-grid .grid-8, .has-grid .grid-9, .has-grid .grid-10, .has-grid .grid-11, .has-grid .grid-12, .has-grid .grid-13, .has-grid .grid-14, .has-grid .grid-15, .has-grid .grid-16, .has-grid .grid-17, .has-grid .grid-18, .has-grid .grid-19, .has-grid .grid-20, .has-grid .grid-21, .has-grid .grid-22, .has-grid .grid-23, .has-grid .grid-24')
.hover(function(){
if (omega(this).parents('body').hasClass('grid-hover')) {
if ($(this).parents('body').hasClass('grid-hover')) {
var grid_classes = '';
var i = 1;
var grid_size = 'undefined';
for(i = 1; i <= 24; i++) {
var grid_size_test = 'grid-'+i;
if (omega(this).hasClass(grid_size_test)) {
if ($(this).hasClass(grid_size_test)) {
var grid_size = grid_size_test;
}
}

var container_parent = omega(this).parents('div[class*=container]');
var container_parent = $(this).parents('div[class*=container]');
if (container_parent.hasClass('container-12')) {
var container_size = 'container-12';
}
Expand All @@ -62,18 +62,18 @@
if (container_parent.hasClass('container-24')) {
var container_size = 'container-24';
}
omega('#omega-debug-info').html('<hr /><div><strong>Container class: '+container_size+'</div><div><strong>Grid class: </strong>'+grid_size+'</div>');
//omega('#omega-debug-info').html(container_info);
$('#omega-debug-info').html('<hr /><div><strong>Container class: '+container_size+'</div><div><strong>Grid class: </strong>'+grid_size+'</div>');
//$('#omega-debug-info').html(container_info);
}
}, function(){
if (omega(this).parents('body').hasClass('grid-hover')) {
omega('#omega-debug-info').html('');
if ($(this).parents('body').hasClass('grid-hover')) {
$('#omega-debug-info').html('');
}
});

};

omega(document).ready(function(){
$(document).ready(function(){
var debug = new Drupal.grid_debug();
});
})(jQuery);
18 changes: 9 additions & 9 deletions js/omega.js
@@ -1,23 +1,23 @@
// $Id$
(function ($) {
function populateElement(selector, defvalue) {
if (omega.trim(omega(selector).val()) == "") {
omega(selector).val(defvalue);
if (omega.trim($(selector).val()) == "") {
$(selector).val(defvalue);
}
omega(selector).focus(function() {
if(omega(selector).val() == defvalue) {
omega(selector).val("");
$(selector).focus(function() {
if($(selector).val() == defvalue) {
$(selector).val("");
}
});
omega(selector).blur(function() {
if(omega.trim(omega(selector).val()) == "") {
omega(selector).val(defvalue);
$(selector).blur(function() {
if(omega.trim($(selector).val()) == "") {
$(selector).val(defvalue);
}
});
}

omega = jQuery.noConflict();
omega(document).ready(function(){
$(document).ready(function(){
// give the search box some fancy stuff
populateElement('#search-box input.form-text, #search-block-form input.form-text', Drupal.t(Drupal.settings.default_search_text));
populateElement('#search-region input.form-text', Drupal.t(Drupal.settings.default_search_text));
Expand Down
20 changes: 10 additions & 10 deletions js/omega_admin.js
Expand Up @@ -2,13 +2,13 @@

(function ($) {
omega = jQuery.noConflict();
omega(document).ready(function(){
$(document).ready(function(){
// hide all collapsible fieldset stuffs
omega('.omega-accordion-content').hide();
$('.omega-accordion-content').hide();
// show the first fieldset in any group of "accordion" items
firsts = omega([]);
omega('.fieldset-wrapper').each(function(){
var new_first = omega(this).children('.omega-accordion:first');
firsts = $([]);
$('.fieldset-wrapper').each(function(){
var new_first = $(this).children('.omega-accordion:first');
firsts = firsts.add(new_first);
});
firsts
Expand All @@ -19,12 +19,12 @@
.addClass('expanded')
.show();
// provide click/toggle functionality
omega('.omega-accordion a').click(function(){
$('.omega-accordion a').click(function(){
// remove expanded class from all href items
omega(this).parents('.fieldset-wrapper').find('a').removeClass('expanded');
$(this).parents('.fieldset-wrapper').find('a').removeClass('expanded');
// add expanded back to the cliked href
omega(this).addClass('expanded');
var clicked = omega(this).parent('h3');
$(this).addClass('expanded');
var clicked = $(this).parent('h3');
// if we click a header that is already open, do nothing
if(clicked.next('.omega-accordion-content').hasClass('expanded')) {
return false;
Expand All @@ -40,7 +40,7 @@
.children('.omega-accordion-content:not(.active-accordion)')
.removeClass('expanded')
.slideUp('fast');
omega('.omega-accordion-content').removeClass('active-accordion');
$('.omega-accordion-content').removeClass('active-accordion');
return false;
}
});
Expand Down

0 comments on commit 95504c2

Please sign in to comment.