diff --git a/link_more_ajax/README.txt b/link_more_ajax/README.txt deleted file mode 100644 index 1596f71..0000000 --- a/link_more_ajax/README.txt +++ /dev/null @@ -1,19 +0,0 @@ -INTRODUCTION --------------------------- - -This is a simple module adds a link to the details in the teaser ajax. -This will in effect create a blog like on facebook -(no need to go back to the blog). - - -CONFIGURATION --------------------------- - -This module requires no configuration. Just install and enjoy. - -INFORMATION FOR DEVELOPERS --------------------------- - -This module is designed for personal needs, and has two objectives: -to make life easier for developers who collect site without delving into -writing code, and the second to show by example the possibility ajax in Drupal. diff --git a/link_more_ajax/link_more_ajax.info b/link_more_ajax/link_more_ajax.info deleted file mode 100644 index 29d0a1f..0000000 --- a/link_more_ajax/link_more_ajax.info +++ /dev/null @@ -1,3 +0,0 @@ -name = Link more ajax -description = Adds a link to a more ajax -core = 7.x diff --git a/link_more_ajax/link_more_ajax.js b/link_more_ajax/link_more_ajax.js deleted file mode 100644 index 6ba4a5f..0000000 --- a/link_more_ajax/link_more_ajax.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @file - * Add custom ajax command, move the scroll to the top of the browser window. - */ - -(function($) { - Drupal.ajax.prototype.commands.link_more_ajax = function(ajax, response, status) { - var item = $('.more-load').offset().top; - $('body,html').animate({ - scrollTop: (item - 10) - }, 350); - $('.more-load').removeClass('more-load'); - } -})(jQuery); diff --git a/link_more_ajax/link_more_ajax.module b/link_more_ajax/link_more_ajax.module deleted file mode 100644 index 5b0f11e..0000000 --- a/link_more_ajax/link_more_ajax.module +++ /dev/null @@ -1,63 +0,0 @@ - 'More node content', - 'page callback' => 'link_more_ajax_callback', - 'page arguments' => array(2), - 'delivery callback' => 'ajax_deliver', - 'access arguments' => array('access content'), - ); - return $items; -} - -/** - * Implements hook_node_view_alter(). - */ -function link_more_ajax_node_view_alter(&$build) { - if (isset($build['links']['node']['#links']['node-readmore'])) { - drupal_add_js(drupal_get_path('module', 'link_more_ajax') . '/link_more_ajax.js'); - drupal_add_library('system', 'drupal.ajax'); - $link = $build['links']['node']['#links']['node-readmore']['href']; - $build['links']['node']['#links']['node-readmore']['href'] = 'more/' . $link; - $build['links']['node']['#links']['node-readmore']['attributes']['class'][] = 'use-ajax'; - } -} - -/** - * Callback menu. - */ -function link_more_ajax_callback($nid, $mode = NULL) { - $commands = array(); - $commands[] = ajax_command_replace('#node-' . $nid, _link_more_ajax_content($nid)); - $commands[] = ajax_command_invoke('#node-' . $nid, 'addClass', array('more-load node-teaser')); - $commands[] = link_more_ajax_command_link_more_ajax(); - return array('#type' => 'ajax', '#commands' => $commands); -} - -/** - * Create node content. - */ -function _link_more_ajax_content($nid) { - $node = node_load($nid); - $node_view = node_view($node, 'full'); - $nodehtml = drupal_render($node_view); - return $nodehtml; -} - -/** - * Add custom ajax command. - */ -function link_more_ajax_command_link_more_ajax() { - return array( - 'command' => 'link_more_ajax', - ); -}