aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-02 03:29:06 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-02 03:29:06 +0000
commitab36344d8e480b7c1b053130f2afc19ed2cf9e6c (patch)
tree71a4c5b7233593cbd781738e932db35370f4771a
parent4d80bc33b8924038bd1ca57d548828afe661bb42 (diff)
downloadelgg-ab36344d8e480b7c1b053130f2afc19ed2cf9e6c.tar.gz
elgg-ab36344d8e480b7c1b053130f2afc19ed2cf9e6c.tar.bz2
Refs #2700 fixed the widget code with the new CSS element names
git-svn-id: http://code.elgg.org/elgg/trunk@7494 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--js/lib/ui.js2
-rw-r--r--js/lib/ui.widgets.js82
-rw-r--r--views/default/js/initialise_elgg.php4
-rw-r--r--views/default/layouts/widgets.php4
-rw-r--r--views/default/widgets/add_panel.php8
-rw-r--r--views/default/widgets/wrapper.php4
6 files changed, 52 insertions, 52 deletions
diff --git a/js/lib/ui.js b/js/lib/ui.js
index c079abda2..01e6b6589 100644
--- a/js/lib/ui.js
+++ b/js/lib/ui.js
@@ -2,7 +2,7 @@ elgg.provide('elgg.ui');
elgg.ui.init = function () {
//if the user clicks a system message, make it disappear
- $('.elgg_system_message').live('click', function() {
+ $('.elgg-system-message').live('click', function() {
$(this).stop().fadeOut('fast');
});
diff --git a/js/lib/ui.widgets.js b/js/lib/ui.widgets.js
index 1f11f3465..c33056d7c 100644
--- a/js/lib/ui.widgets.js
+++ b/js/lib/ui.widgets.js
@@ -8,33 +8,33 @@ elgg.provide('elgg.ui.widgets');
elgg.ui.widgets.init = function() {
// widget layout?
- if ($(".widget_column").length == 0) {
+ if ($(".widget-column").length == 0) {
return;
}
- $(".widget_column").sortable({
+ $(".widget-column").sortable({
items: 'div.widget',
- connectWith: '.widget_column',
- handle: 'div.drag_handle',
+ connectWith: '.widget-column',
+ handle: 'div.drag-handle',
forcePlaceholderSize: true,
- placeholder: 'widget_placeholder',
+ placeholder: 'widget-placeholder',
opacity: 0.8,
revert: 500,
stop: elgg.ui.widgets.move
});
- $('#widget_add_button a').bind('click', function(event) {
- $('.widgets_add_panel').slideToggle('medium');
+ $('#widget-add-button a').bind('click', function(event) {
+ $('.widgets-add-panel').slideToggle('medium');
event.preventDefault();
});
- $('.widgets_add_panel li.widget_available').click(elgg.ui.widgets.add);
- $('a.widget_delete_button').click(elgg.ui.widgets.remove);
- $('a.widget_edit_button').click(elgg.ui.widgets.editToggle);
- $('.widget_edit > form ').submit(elgg.ui.widgets.saveSettings);
- $('a.widget_collapse_button').click(elgg.ui.widgets.collapseToggle);
+ $('.widgets-add-panel li.widget-available').click(elgg.ui.widgets.add);
+ $('a.widget-delete-button').click(elgg.ui.widgets.remove);
+ $('a.widget-edit-button').click(elgg.ui.widgets.editToggle);
+ $('.widget-edit > form ').submit(elgg.ui.widgets.saveSettings);
+ $('a.widget-collapse-button').click(elgg.ui.widgets.collapseToggle);
- elgg.ui.widgets.equalHeight(".widget_column");
+ elgg.ui.widgets.equalHeight(".widget-column");
};
/**
@@ -46,15 +46,15 @@ elgg.ui.widgets.init = function() {
* @return void
*/
elgg.ui.widgets.add = function(event) {
- // widget_type_<type>
+ // widget-type-<type>
var type = $(this).attr('id');
- type = type.substr(type.indexOf('widget_type_') + "widget_type_".length);
+ type = type.substr(type.indexOf('widget-type-') + "widget-type-".length);
// if multiple instances not allow, disable this widget type add button
- var multiple = $(this).attr('class').indexOf('widget_multiple') != -1;
+ var multiple = $(this).attr('class').indexOf('widget-multiple') != -1;
if (multiple == false) {
- $(this).addClass('widget_unavailable');
- $(this).removeClass('widget_available');
+ $(this).addClass('widget-unavailable');
+ $(this).removeClass('widget-available');
$(this).unbind('click', elgg.ui.widgets.add);
}
@@ -62,15 +62,15 @@ elgg.ui.widgets.add = function(event) {
data: {
handler: type,
user_guid: elgg.get_loggedin_userid(),
- context: $("input[name='widget_context']").val()
+ context: $("input[name='widget-context']").val()
},
success: function(json) {
- $('#widget_col_1').prepend(json.output);
- var $widget = $('#widget_col_1').children(":first");
- $widget.find('a.widget_delete_button').click(elgg.ui.widgets.remove);
- $widget.find('a.widget_edit_button').click(elgg.ui.widgets.editToggle);
- $widget.find('a.widget_collapse_button').click(elgg.ui.widgets.collapseToggle);
- $widget.find('.widget_edit > form ').submit(elgg.ui.widgets.saveSettings);
+ $('#widget-col-1').prepend(json.output);
+ var $widget = $('#widget-col-1').children(":first");
+ $widget.find('a.widget-delete-button').click(elgg.ui.widgets.remove);
+ $widget.find('a.widget-edit-button').click(elgg.ui.widgets.editToggle);
+ $widget.find('a.widget-collapse-button').click(elgg.ui.widgets.collapseToggle);
+ $widget.find('.widget-edit > form ').submit(elgg.ui.widgets.saveSettings);
}
});
event.preventDefault();
@@ -86,13 +86,13 @@ elgg.ui.widgets.add = function(event) {
*/
elgg.ui.widgets.move = function(event, ui) {
- // widget_<guid>
+ // widget-<guid>
var guidString = ui.item.attr('id');
- guidString = guidString.substr(guidString.indexOf('widget_') + "widget_".length);
+ guidString = guidString.substr(guidString.indexOf('widget-') + "widget-".length);
- // widget_col_<column>
+ // widget-col-<column>
var col = ui.item.parent().attr('id');
- col = col.substr(col.indexOf('widget_col_') + "widget_col_".length);
+ col = col.substr(col.indexOf('widget-col-') + "widget-col-".length);
elgg.action('widgets/move', {
data: {
@@ -120,22 +120,22 @@ elgg.ui.widgets.remove = function(event) {
// if widget type is single instance type, enable the add buton
var type = $widget.attr('class');
- // widget_instance_<type>
- type = type.substr(type.indexOf('widget_instance_') + "widget_instance_".length);
- $button = $('#widget_type_' + type);
- var multiple = $button.attr('class').indexOf('widget_multiple') != -1;
+ // widget-instance-<type>
+ type = type.substr(type.indexOf('widget-instance-') + "widget-instance-".length);
+ $button = $('#widget-type-' + type);
+ var multiple = $button.attr('class').indexOf('widget-multiple') != -1;
if (multiple == false) {
- $button.addClass('widget_available');
- $button.removeClass('widget_unavailable');
+ $button.addClass('widget-available');
+ $button.removeClass('widget-unavailable');
$button.unbind('click', elgg.ui.widgets.add); // make sure we don't bind twice
$button.click(elgg.ui.widgets.add);
}
$widget.remove();
- // widget_delete_button_<guid>
+ // widget-delete-button-<guid>
var id = $(this).attr('id');
- id = id.substr(id.indexOf('widget_delete_button_') + "widget_delete_button_".length);
+ id = id.substr(id.indexOf('widget-delete-button-') + "widget-delete-button-".length);
elgg.action('widgets/delete', {
data: {
@@ -154,7 +154,7 @@ elgg.ui.widgets.remove = function(event) {
* @return void
*/
elgg.ui.widgets.editToggle = function(event) {
- $(this).parent().parent().find('.widget_edit').slideToggle('medium');
+ $(this).parent().parent().find('.widget-edit').slideToggle('medium');
event.preventDefault();
}
@@ -165,8 +165,8 @@ elgg.ui.widgets.editToggle = function(event) {
* @return void
*/
elgg.ui.widgets.collapseToggle = function(event) {
- $(this).toggleClass('widget_collapsed');
- $(this).parent().parent().find('.widget_container').slideToggle('medium');
+ $(this).toggleClass('widget-collapsed');
+ $(this).parent().parent().find('.widget-container').slideToggle('medium');
event.preventDefault();
}
@@ -180,7 +180,7 @@ elgg.ui.widgets.collapseToggle = function(event) {
*/
elgg.ui.widgets.saveSettings = function(event) {
$(this).parent().slideToggle('medium');
- var $widgetContent = $(this).parent().parent().children('.widget_content');
+ var $widgetContent = $(this).parent().parent().children('.widget-content');
// @todo - change to ajax loader
$widgetContent.html('loading');
elgg.action('widgets/save', {
diff --git a/views/default/js/initialise_elgg.php b/views/default/js/initialise_elgg.php
index 5157bb8bc..0db4b88bb 100644
--- a/views/default/js/initialise_elgg.php
+++ b/views/default/js/initialise_elgg.php
@@ -145,14 +145,14 @@ $(document).ready(function () {
}
});
- elgg-system-message();
+ elgg_system_message();
}); /* end document ready function */
// display & hide elgg system messages
-function elgg-system-message() {
+function elgg_system_message() {
$("#elgg-system-message").animate({opacity: 0.9}, 1000);
$("#elgg-system-message").animate({opacity: 0.9}, 5000);
$("#elgg-system-message").fadeOut('slow');
diff --git a/views/default/layouts/widgets.php b/views/default/layouts/widgets.php
index c5607314a..130b2eaad 100644
--- a/views/default/layouts/widgets.php
+++ b/views/default/layouts/widgets.php
@@ -30,11 +30,11 @@ if (elgg_can_edit_widget_layout($context)) {
echo $vars['box'];
-$widget_class = "widget_{$num_columns}_columns";
+$widget_class = "widget-{$num_columns}-columns";
for ($column_index = 1; $column_index <= $num_columns; $column_index++) {
$column_widgets = $widgets[$column_index];
- echo "<div class=\"widget-column $widget_class\" id=\"widget_col_$column_index\">";
+ echo "<div class=\"widget-column $widget_class\" id=\"widget-col-$column_index\">";
if (is_array($column_widgets) && sizeof($column_widgets) > 0) {
foreach ($column_widgets as $widget) {
echo elgg_view_entity($widget);
diff --git a/views/default/widgets/add_panel.php b/views/default/widgets/add_panel.php
index 9dbc8f78f..d9acc5518 100644
--- a/views/default/widgets/add_panel.php
+++ b/views/default/widgets/add_panel.php
@@ -20,7 +20,7 @@ foreach ($widgets as $column_widgets) {
<ul>
<?php
foreach ($widget_types as $handler => $widget_type) {
- $id = "widget_type_$handler";
+ $id = "widget-type-$handler";
// check if widget added and only one instance allowed
if ($widget_type->multiple == false && in_array($handler, $current_handlers)) {
$class = 'widget-unavailable';
@@ -31,9 +31,9 @@ foreach ($widgets as $column_widgets) {
}
if ($widget_type->multiple) {
- $class .= ' widget_multiple';
+ $class .= ' widget-multiple';
} else {
- $class .= ' widget_single';
+ $class .= ' widget-single';
}
echo "<li title=\"$tooltip\" id=\"$id\" class=\"$class\">$widget_type->name</li>";
@@ -42,7 +42,7 @@ foreach ($widgets as $column_widgets) {
</ul>
<?php
$params = array(
- 'internalname' => 'widget_context',
+ 'internalname' => 'widget-context',
'value' => $context
);
echo elgg_view('input/hidden', $params);
diff --git a/views/default/widgets/wrapper.php b/views/default/widgets/wrapper.php
index 4483be887..2f82426ab 100644
--- a/views/default/widgets/wrapper.php
+++ b/views/default/widgets/wrapper.php
@@ -20,8 +20,8 @@ $title = $widget->getTitle();
$can_edit = $widget->canEdit();
-$widget_id = "widget_$widget->guid";
-$widget_instance = "widget_instance_$handler";
+$widget_id = "widget-$widget->guid";
+$widget_instance = "widget-instance-$handler";
?>
<div class="widget draggable <?php echo $widget_instance?>" id="<?php echo $widget_id; ?>">