Plugin Directory

Changeset 1353438


Ignore:
Timestamp:
02/18/2016 12:37:22 PM (10 years ago)
Author:
niraj.shah
Message:

v1.3 - Added vibration functionality

Location:
android-50-lollipop-status-bar-customiser/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • android-50-lollipop-status-bar-customiser/trunk/android-5.0-status-bar.php

    r1074150 r1353438  
    114114    }
    115115   
     116    if ( isset( $this->options['vibrate'] ) && $this->options['vibrate'] == 1 ) {
     117      $output .= <<<HTML
     118<script type="text/javascript">
     119navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate;
     120// vibrate for 500ms if available
     121if ( navigator.vibrate ) {
     122  navigator.vibrate(500);
     123}
     124</script>
     125HTML;
     126 
     127    }
     128   
    116129    echo $output;
    117130  }
     
    186199      array( 'id' => 'android-icon' )
    187200    );
     201   
     202    add_settings_section(
     203      'misc', // ID
     204      'Misc Settings', // Title
     205      array( $this, 'print_section_info_misc' ), // Callback
     206      'wn-android-statusbar' // Page
     207    );
     208   
     209    add_settings_field(
     210      'vibrate', // ID
     211      'Enable Vibration (if available)', // Title
     212      array( $this, 'vibrate_callback' ), // Callback
     213      'wn-android-statusbar', // Page
     214      'misc', // Section     
     215      array( 'id' => 'vibrate' )
     216    );
    188217  }
    189218 
     
    216245  {
    217246    echo 'Enter a URL or select a file to use from the Media Gallery. For best results, use an absolute URL.';
     247  }
     248 
     249  /**
     250   * Print the Section text for Icons
     251   */
     252  public function print_section_info_misc()
     253  {
     254    echo 'Configure misc settings here.';
    218255  }
    219256 
     
    242279  }
    243280 
     281  /**
     282   * Get the settings option array and print one of its values
     283   */
     284  public function vibrate_callback( $args )
     285  {
     286    printf(
     287      '<input type="checkbox" name="wn_android_statusbar[%s]" value="1" placeholder="" %s />',
     288      $args['id'],
     289      isset( $this->options[ $args['id'] ] ) ? 'checked' : ''
     290    );
     291  }
     292 
    244293}
    245294
  • android-50-lollipop-status-bar-customiser/trunk/readme.txt

    r1237067 r1353438  
    22Contributors: niraj.shah
    33Donate link:
    4 Tags: android 5.0, android lollipop, status bar, browser, chrome
     4Tags: android 5.0, android lollipop, status bar, browser, chrome, vibration
    55Requires at least: 2.7
    66Tested up to: 4.3
    7 Stable tag: 1.2.1
     7Stable tag: 1.3
    88
    99Use this plugin to change the Status Bar of Devices Running Android 5.0 Lollipop.
     
    17171. Upload the `android-50-lollipop-status-bar-customiser` folder to the `/wp-content/plugins/` directory
    18182. Activate the plugin through the 'Plugins' menu in WordPress
    19 3. Set a Colour, Upload a Icon and Save settings.
    20 
     193. Set a Colour, Upload a Icon, Enable or Disable vibration, and Save settings.
     201
    2121== Screenshots ==
    2222
     
    3030
    3131== Changelog ==
     32
     33= 1.3 =
     34* Added vibration option for supported devices
    3235
    3336= 1.2.1 =
Note: See TracChangeset for help on using the changeset viewer.