Skip to content

Commit

Permalink
Update VolumeSlider for Cordova 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
devgeeks committed Jul 30, 2012
1 parent 7765b54 commit 46f7d41
Showing 1 changed file with 38 additions and 37 deletions.
75 changes: 38 additions & 37 deletions iOS/VolumeSlider/VolumeSlider.js
@@ -1,41 +1,42 @@
//
// VolumeSlider.js
// Volume Slider Cordova Plugin
// VolumeSlider.js
// Volume Slider Cordova Plugin
//
// Created by Tommy-Carlos Williams on 20/07/11.
// Copyright 2011 Tommy-Carlos Williams. All rights reserved.
// Created by Tommy-Carlos Williams on 20/07/11.
// Copyright 2011 Tommy-Carlos Williams. All rights reserved.
// MIT Licensed
//

var VolumeSlider = function(){

}

/**
* Create a volume slider.
*/
VolumeSlider.prototype.createVolumeSlider = function(originx,originy,width,height) {
Cordova.exec(null, null, "VolumeSlider","createVolumeSlider", [originx, originy, width, height]);
};

/**
* Show the volume slider
*/
VolumeSlider.prototype.showVolumeSlider = function() {
Cordova.exec(null, null, "VolumeSlider","showVolumeSlider", []);
};
/**
* Hide the volume slider
*/
VolumeSlider.prototype.hideVolumeSlider = function() {
Cordova.exec(null, null, "VolumeSlider","hideVolumeSlider", []);
};


Cordova.addConstructor(function(){
if(!window.plugins)
{
window.plugins = {};
}
window.plugins.volumeSlider = new VolumeSlider();
});
(function(){
var cordovaRef = window.PhoneGap || window.Cordova || window.cordova; // old to new fallbacks
var VolumeSlider = function(){
};

/**
* Create a volume slider.
*/
VolumeSlider.prototype.createVolumeSlider = function(originx,originy,width,height) {
cordovaRef.exec(null, null, "VolumeSlider","createVolumeSlider", [originx, originy, width, height]);
};

/**
* Show the volume slider
*/
VolumeSlider.prototype.showVolumeSlider = function() {
cordovaRef.exec(null, null, "VolumeSlider","showVolumeSlider", []);
};
/**
* Hide the volume slider
*/
VolumeSlider.prototype.hideVolumeSlider = function() {
cordovaRef.exec(null, null, "VolumeSlider","hideVolumeSlider", []);
};


cordovaRef.addConstructor(function(){
if(!window.plugins)
{
window.plugins = {};
}
window.plugins.volumeSlider = new VolumeSlider();
});
})();

0 comments on commit 46f7d41

Please sign in to comment.