Plugin Directory

Changeset 140600


Ignore:
Timestamp:
07/29/2009 05:49:37 PM (17 years ago)
Author:
zetxek
Message:

Implemented options page: you can now customize the text shown as description of the hidden texts and the "helper text" of the links.

Location:
wplyrics/trunk/wplyrics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wplyrics/trunk/wplyrics/wp_lyrics.php

    r140595 r140600  
    9393        * Tells WordPress to load the scripts
    9494        */
    95         function add_scripts(){
     95        function add_scripts(){         
     96            $options = $this->load_options();
     97           
    9698            wp_enqueue_script('wp_lyrics_script', get_bloginfo('wpurl').'/wp-content/plugins/wplyrics/wplyrics.js', array("jquery") , 0.1);
     99            wp_localize_script( 'wp_lyrics_script', 'WPLyricsSettings', array(
     100                'title' => $options['title'],
     101                'more' => $options['more'],
     102                'less' => $options['less']
     103            ));
     104           
    97105        }
    98106       
  • wplyrics/trunk/wplyrics/wplyrics.js

    r139890 r140600  
    77function open_lyrics(el){
    88    jQuery(el).parent().next('.wplyrics').slideToggle() ;
    9     //cambiar [+]
     9    more = WPLyricsSettings.more;
     10    less = WPLyricsSettings.less;
     11
     12    //change [+]
    1013    if (jQuery(el).html() == '[+]'){
    1114        jQuery(el).html('[-]');
    12         jQuery(el).attr('title', 'Hide the text...');   
     15        jQuery(el).attr('title', less);
    1316    }else{
    14         jQuery(el).html('[+]').attr('title', 'Show the text...');
     17        jQuery(el).html('[+]').attr('title', more);
    1518    }
    1619}
Note: See TracChangeset for help on using the changeset viewer.