--- /dev/null
+$(function() {
+
+ // change for dropdown
+ $('#embed_upload').live('change', function() {
+ var upload_section = $(this).val();
+ var url = elgg.get_site_url() + 'embed/embed?active_section=upload&active_upload_section=' + upload_section;
+ $('#facebox .body .content').load(url);
+ });
+
+});
\ No newline at end of file
function embed_init() {
elgg_extend_view('css/elgg', 'embed/css');
elgg_extend_view('js/elgg', 'embed/js');
- elgg_extend_view('footer/analytics', 'embed/lightbox_init');
+ elgg_extend_view('js/elgg', 'embed/lightbox_init');
elgg_register_plugin_hook_handler('register', 'menu:longtext', 'embed_longtext_menu');
// Page handler for the modal media embed
elgg_register_page_handler('embed', 'embed_page_handler');
+
+ elgg_register_js('elgg.embed', 'mod/embed/js/embed.js', 'footer');
}
function embed_longtext_menu($hook, $type, $items, $vars) {
<?php //@todo: JS 1.8: ugly ?>
<script type="text/javascript">
-$(document).ready(function() {
+$(function() {
var internal_name = '<?php echo addslashes($internal_name); ?>';
// insert embed codes
});
// tabs
- $('.embed_section').click(function() {
+ $('.embed_section').live('click', function() {
var section = $(this).attr('id');
var url = elgg.config.wwwroot + 'embed/embed?active_section=' + section + '&internal_name=' + internal_name;
$('#facebox .body .content').load(url);
return false;
}
- $('.pagination-number').click(elggPaginationClick);
- $('.pagination-next').click(elggPaginationClick);
- $('.pagination-previous').click(elggPaginationClick);
+ $('.pagination-number').live('click', elggPaginationClick);
+ $('.pagination-next').live('click', elggPaginationClick);
+ $('.pagination-previous').live('click', elggPaginationClick);
});
</script>
*/
?>
+$(function() {
+ $('a[rel*=facebox]').facebox();
+
+ // fire off the ajax upload
+ $('#file_embed_upload').submit(function() {
+ var options = {
+ success: function(data) {
+ var info = jQuery.parseJSON(data);
+
+ if (info.status == 'success') {
+ $('.popup .content').load(elgg.get_site_url() + 'embed/embed?active_section=file');
+ } else {
+ $('.popup .content').find('form').prepend('<p>' + info.message + '</p>');
+ }
+ }
+ };
+ $(this).ajaxSubmit(options);
+ return false;
+ });
+});
function elggEmbedInsertContent(content, textAreaName) {
content = ' ' + content + ' ';
$.facebox.close();
}
-
/*
* Facebox (for jQuery)
* version: 1.2 (05/05/2008)
+++ /dev/null
-<?php //@todo JS 1.8: no ?>
-<script type="text/javascript">
- $(function() { $('a[rel*=facebox]').facebox() });
-</script>
echo $upload_content . "</div>";
-?>
- <?php //@todo: JS 1.8: ugly ?>
- <script type="text/javascript">
- $(function() {
-
- // change for dropdown
- $('#embed_upload').change(function() {
- var upload_section = $(this).val();
- var url = elgg.get_site_url() + 'embed/embed?active_section=upload&active_upload_section=' + upload_section;
- $('#facebox .body .content').load(url);
- });
-
- });
- </script>
-<?php
+ elgg_load_js('elgg.embed');
} else {
echo elgg_echo('embed:no_upload_sections');
echo elgg_view_form('file/upload', array('id' => 'file_embed_upload'), array('ajax' => TRUE));
-?>
-<?php //@todo JS 1.8: no ?>
-<script type="text/javascript">
-$(document).ready(function() {
- // fire off the ajax upload
- $('#file_embed_upload').submit(function() {
- var options = {
- success: function(data) {
- var info = jQuery.parseJSON(data);
-
- if (info.status == 'success') {
- $('.popup .content').load('<?php echo elgg_get_site_url() . 'embed/embed'; ?>?active_section=file');
- } else {
- $('.popup .content').find('form').prepend('<p>' + info.message + '</p>');
- }
- }
- };
- $(this).ajaxSubmit(options);
- return false;
- });
-});
-</script>
//extend some views
elgg_extend_view('css/elgg', 'groups/css');
+ elgg_extend_view('js/elgg', 'groups/js');
// Access permissions
elgg_register_plugin_hook_handler('access:collections:write', 'all', 'groups_write_acl_plugin_hook');
--- /dev/null
+$(function() {
+ $('#groups-tools').find('.elgg-module:odd').addClass('odd');
+});
\ No newline at end of file
echo elgg_view("groups/tool_latest", array('entity' => $vars['entity']));
echo "</div>";
-?>
-<?php //@todo JS 1.8: no ?>
-<script type="text/javascript">
-$(function () { // subclass every other group tool widget
- $('#groups-tools').find('.elgg-module:odd').addClass('odd');
-});
-</script>
// Extend system CSS with our own styles, which are defined in the messages/css view
elgg_extend_view('css/elgg', 'messages/css');
-
+ elgg_extend_view('js/elgg', 'messages/js');
+
// Register a page handler, so we can have nice URLs
elgg_register_page_handler('messages', 'messages_page_handler');
));
echo '</div>';
-
-?>
-<?php //@todo JS 1.8: no ?>
-<script type="text/javascript">
-$(document).ready(function() {
- $("#messages-toggle").click(function() {
- $('input[type=checkbox]').click();
- });
-});
-</script>
</div>
<div>
<?php echo elgg_view('input/submit', array('value' => elgg_echo('messages:send'))); ?>
-</div>
-
-<script type="text/javascript">
-$(document).ready(function() {
- $("#messages-show-reply").click(function() {
- $('#messages-reply-form').slideToggle('medium');
- });
-});
-
-</script>
\ No newline at end of file
+</div>
\ No newline at end of file
--- /dev/null
+$(function() {
+ $("#messages-toggle").click(function() {
+ $('input[type=checkbox]').click();
+ });
+
+ $("#messages-show-reply").click(function() {
+ $('#messages-reply-form').slideToggle('medium');
+ });
+});
\ No newline at end of file
elgg_extend_view('html_head/extend', 'profile/metatags');
elgg_extend_view('css/elgg', 'profile/css');
+ elgg_extend_view('js/elgg', 'profile/js');
// allow ECML in parts of the profile
elgg_register_plugin_hook_handler('get_views', 'ecml', 'profile_ecml_views_hook');
--- /dev/null
+elgg.register_hook_handler('init', 'system', function() {
+ $('#elgg-widget-col-1').css('min-height', $('.profile').outerHeight(true) + 1);
+});
\ No newline at end of file
<?php echo elgg_view('profile/owner_block'); ?>
<?php echo elgg_view('profile/details'); ?>
</div>
-</div>
-<?php //@todo JS 1.8: no ?>
-<script type="text/javascript">
- $(document).ready(function() {
- $('#elgg-widget-col-1').css('min-height', $('.profile').outerHeight(true) + 1);
- });
-</script>
\ No newline at end of file
+</div>
\ No newline at end of file
if (!update_subtype('object', 'thewire', 'ElggWire')) {\r
add_subtype('object', 'thewire', 'ElggWire');\r
}\r
+ \r
+ elgg_register_js('elgg.thewire', 'mod/thewire/js/thewire.js', 'footer');\r
\r
// add a site navigation item\r
$item = new ElggMenuItem('thewire', elgg_echo('thewire'), 'thewire/all');\r
if ($parent_guid) {\r
$post->addRelationship($parent_guid, 'parent');\r
\r
- // name conversation threads by guid of first post (works even if first post deleted)\r
+ // name conversation threads by guid of first post (works even if first post deleted)\r
$parent_post = get_entity($parent_guid);\r
$post->wire_thread = $parent_post->wire_thread;\r
} else {\r
* @uses $vars['post']
*/
+elgg_load_js('elgg.thewire');
+
$post = elgg_extract('post', $vars);
$text = elgg_echo('post');
'value' => $text,
'id' => 'thewire-submit-button',
));
-
?>
-</div>
-<script type="text/javascript">
-
-$(document).ready(function() {
- $("#thewire-textarea").bind('keydown', function() {
- textCounter(this, $("#thewire-characters-remaining span"), 140);
- });
- $("#thewire-textarea").bind('keyup', function() {
- textCounter(this, $("#thewire-characters-remaining span"), 140);
- });
-});
-
-function textCounter(textarea, status, limit) {
-
- var remaining_chars = limit - textarea.value.length;
- status.html(remaining_chars);
-
- if (remaining_chars < 0) {
- status.parent().css("color", "#D40D12");
- $("#thewire-submit-button").attr('disabled', 'disabled');
- $("#thewire-submit-button").css('background', '#999999');
- $("#thewire-submit-button").css('border-color', '#999999');
- $("#thewire-submit-button").css('cursor', 'default');
- } else {
- status.parent().css("color", "");
- $("#thewire-submit-button").removeAttr('disabled', 'disabled');
- $("#thewire-submit-button").css('background', '#4690d6');
- $("#thewire-submit-button").css('border-color', '#4690d6');
- $("#thewire-submit-button").css('cursor', 'pointer');
- }
-}
-</script>
+</div>
\ No newline at end of file
background: #0054a7 url(<?php echo elgg_get_site_url(); ?>_graphics/button_graduation.png) repeat-x left 10px;
}
+.elgg-button-submit.elgg-state-disabled {
+ background: #999;
+ border-color: #999;
+ cursor: default;
+}
+
/* Cancel: This button should convey a negative but easily reversible action (e.g., turning off a plugin) */
.elgg-button-cancel {
color: #333;