diff --git a/ShareThisForm.js b/ShareThisForm.js index fc78138..5918f41 100644 --- a/ShareThisForm.js +++ b/ShareThisForm.js @@ -4,9 +4,9 @@ */ // Create the drupal ShareThis object for clean code and namespacing: -(function (){ - // adding use_strict as function encapsulation ECMA 6 - 'use_strict'; +(function () { + // Adding use strict as function encapsulation ECMA 6. + 'use strict'; var drupal_st = { // These are handlerd for updating the widget pic class. @@ -61,7 +61,7 @@ return selectedButton; }, setupServiceText: function () { - jQuery('#edit-sharethis-service-option').css({ display:'none' }); + jQuery('#edit-sharethis-service-option').css({display: 'none'}); if (jQuery('input[name=sharethis_callesi]').val() === 1) { drupal_st.getGlobalCNSConfig(); diff --git a/plugins/content_types/sharethis/sharethis.inc b/plugins/content_types/sharethis/sharethis.inc index ef6113b..5920a27 100644 --- a/plugins/content_types/sharethis/sharethis.inc +++ b/plugins/content_types/sharethis/sharethis.inc @@ -82,15 +82,20 @@ function sharethis_sharethis_content_type_edit_form($form, &$form_state) { return $form; } +/** + * Implements sharethis_sharethis_content_type_edit_form_validate(). + */ function sharethis_sharethis_content_type_edit_form_validate($form, &$form_state) { if (($form_state['values']['path'] == 'external') && (!valid_url($form_state['values']['path-external'], TRUE))) { form_set_error('path-external', t('Invalid URL')); } } +/** + * Implements sharethis_sharethis_content_type_edit_form_submit(). + */ function sharethis_sharethis_content_type_edit_form_submit($form, &$form_state) { foreach (array('path', 'path-external') as $key) { $form_state['conf'][$key] = $form_state['values'][$key]; } } - diff --git a/sharethis.admin.inc b/sharethis.admin.inc index b0ce9a3..03b70dd 100644 --- a/sharethis.admin.inc +++ b/sharethis.admin.inc @@ -393,4 +393,3 @@ function sharethis_configuration_form_validate($form, &$form_state) { // Ensure default value for twitter recommends. $form_state['values']['sharethis_twitter_recommends'] = (isset($form_state['values']['sharethis_twitter_recommends'])) ? $form_state['values']['sharethis_twitter_recommends'] : ''; } - diff --git a/sharethis.install b/sharethis.install index d35541d..7f90a74 100644 --- a/sharethis.install +++ b/sharethis.install @@ -77,4 +77,3 @@ function sharethis_update_7001() { return t('Switched from the custom ShareThis table to the Variables table.'); } } - diff --git a/sharethis.module b/sharethis.module index 293b898..859fadf 100644 --- a/sharethis.module +++ b/sharethis.module @@ -9,11 +9,6 @@ * Implements hook_help(). * * Displays help and module information. - * - * @param path - * Which path of the site we're using to display help - * @param arg - * Array that holds the current path as returned from arg() function */ function sharethis_help($path, $arg) { switch ($path) { @@ -33,9 +28,6 @@ function sharethis_help($path, $arg) { /** * Converts given value to boolean. - * - * @param val - * Which value to convert to boolean */ function sharethis_to_boolean($val) { if (strtolower(trim($val)) === 'false') { @@ -102,13 +94,6 @@ function sharethis_menu() { * * Inserts ShareThis widget code onto each node view. * TODO: Want to add the option somewhere to select nodes. - * - * @param node - * The node that is being acted upon - * @param view_mode - * The type of view (teaser, full, etc) - * @param langcode - * Information about the language */ function sharethis_node_view($node, $view_mode, $langcode) { // Don't display if the user is currently searching, or in the RSS feed. @@ -342,8 +327,8 @@ function theme_sharethis($variables) { // Strip the quotes from the element in the array (They are there for javascript) $service = explode(":", $service_full); - // Service names are expected to be parsed by Name:machine_name. If only one - // element in the array is given, it's an invalid service. + // Service names are expected to be parsed by Name:machine_name. + // If only one element in the array is given, it's an invalid service. if (count($service) < 2) { continue; } @@ -541,7 +526,7 @@ function sharethis_comment_view($comment, $view_mode, $langcode) { $html = theme('sharethis', array( 'data_options' => $data_options, 'm_path' => $mPath, - 'm_title' => $mTitle + 'm_title' => $mTitle, )); $comment->content['sharethis'] = array( '#type' => 'html_tag', @@ -580,11 +565,10 @@ function sharethis_views_api() { } /** - * Implements hook_ctools_plugin_directory. + * Implements hook_ctools_plugin_directory(). */ function sharethis_ctools_plugin_directory($module, $plugin) { if ($module == 'panels' || $module == 'ctools') { return 'plugins/' . $plugin; } } - diff --git a/stlib_picker.js b/stlib_picker.js index b3ac732..4b1cfdd 100644 --- a/stlib_picker.js +++ b/stlib_picker.js @@ -8,12 +8,12 @@ // Styling can be found in stlib_picker.css and should be linked in the page. // To get selected services as an array of strings: (ie ["twitter", "sharethis", "facebook"] ) // Call: var answer = stlib_picker.pickerList[uniqueID]["getServices"]();. -(function (){ - // adding use_strict as function encapsulation ECMA 6 - 'use_strict'; +(function () { + // Adding use strict as function encapsulation ECMA 6. + 'use strict'; - var stlib_picker = {}, - isSecure = document.location.protocol === 'https:' ? true : false; + var stlib_picker = {}; + var isSecure = document.location.protocol === 'https:' ? true : false; stlib_picker.pickerList = []; stlib_picker.defaultServices = ['sharethis', 'tumblr', 'bebo']; @@ -85,15 +85,15 @@ jQElement.find('.stp_li').click(function () { jQElement.find('.stp_select').removeClass('stp_select'); jQuery(this).addClass('stp_select'); - stlib_picker.pickerList[jQElement.attr('id')]["isSelect"] = true; + stlib_picker.pickerList[jQElement.attr('id')]['isSelect'] = true; }); var arrowDiv = jQElement.children('.stp_pickerArrow').children('.stp_arrow'); arrowDiv.children('.stp_up').click(function () { - if (stlib_picker.pickerList[jQElement.attr('id')]["isSelect"]) { + if (stlib_picker.pickerList[jQElement.attr('id')]['isSelect']) { var li = jQElement.find('.stp_select'); var prev = li.prev(); - if (prev.length != 0) { + if (prev.length !== 0) { prev.before(li); } if (callback) { @@ -102,7 +102,7 @@ } }); arrowDiv.children('.stp_left').click(function () { - if (stlib_picker.pickerList[jQElement.attr('id')]["isSelect"]) { + if (stlib_picker.pickerList[jQElement.attr('id')]['isSelect']) { var li = jQElement.find('.stp_select'); var ul = jQElement.children('.stp_pickerLeft').children('.stp_ulLeft'); ul.prepend(li); @@ -112,7 +112,7 @@ } }); arrowDiv.children('.stp_right').click(function () { - if (stlib_picker.pickerList[jQElement.attr('id')]["isSelect"]) { + if (stlib_picker.pickerList[jQElement.attr('id')]['isSelect']) { var li = jQElement.find('.stp_select'); var ul = jQElement.children('.stp_pickerRight').children('.stp_ulRight'); ul.prepend(li); @@ -122,7 +122,7 @@ } }); arrowDiv.children('.stp_down').click(function () { - if (stlib_picker.pickerList[jQElement.attr('id')]["isSelect"]) { + if (stlib_picker.pickerList[jQElement.attr('id')]['isSelect']) { var li = jQElement.find('.stp_select'); var next = li.next(); if (next.length !== 0) { @@ -136,5 +136,5 @@ // Save the options (and the picker) globally. stlib_picker.pickerList[jQElement.attr('id')] = optionsArray; - } + }; })(); diff --git a/views/sharethis.views.inc b/views/sharethis.views.inc index 2b013f5..ada1642 100644 --- a/views/sharethis.views.inc +++ b/views/sharethis.views.inc @@ -44,4 +44,3 @@ function sharethis_views_data_alter(&$data) { } } } - diff --git a/views/sharethis_handler_field_link.inc b/views/sharethis_handler_field_link.inc index 2ed119d..bee1504 100644 --- a/views/sharethis_handler_field_link.inc +++ b/views/sharethis_handler_field_link.inc @@ -10,12 +10,18 @@ */ class SharethisHandlerFieldLink extends views_handler_field_entity { + /** + * Render values. + */ public function render($values) { if ($entity = $this->get_value($values)) { return $this->renderSharethisLink($entity); } } + /** + * Renders sharethis link. + */ public function renderSharethisLink($entity) { $path = url('node/' . $entity->nid, array('absolute' => TRUE));