PATH:
home
/
letacommog
/
letaweb
/
admin
/
modules
/
audio_player
define(['module/base'],function(base) { return createModuleDefinition([base], function($file_manager,$dialog) { this.initializeData = {src:window.top.basePath + '/sample_images/audio/sample.mp3', autoPlay:false, loop:false,controls:true, volume:100}; this.controller = function($scope, $moduleInstance) { $scope.enter_url_mode = 0; $scope.selectFile = function() { $file_manager.open().result.then(function(images) { if(images.length == 0) return; var image = images[0]; $scope.data.src = (image.full_url); $scope.changeSource(); }); } $scope.onUploadComplete = function(files) { if(files!= undefined && files.length > 0) { var file = files[0].response; $scope.data.src = (file.full_url); $scope.changeSource(); } }; $scope.changeSource = function() { $moduleInstance.module_data.src = $scope.data.src; $moduleInstance.changeSource(); } $scope.changeSettings = function() { $moduleInstance.module_data = $scope.data; $moduleInstance.changeSettings(); } }; this.changeSource = function() { var id = this.page_id; var player = this.player || jQuery('#audio' + id).data('player'); player.pause(); player.setSrc(this.module_data.src); player.play(); }; this.changeSettings = function() { var id = this.page_id; var audio = jQuery('#audio' + id); var player = this.player || audio.data('player'); audio.attr('autoPlay', this.module_data.autoPlay ); audio.attr('controls', this.module_data.controls); player.options.loop = this.module_data.loop; player.setVolume(this.module_data.volume / 100); }; }); });
[+]
..
[-] frontend_script.php
[edit]
[-] backend.js
[edit]
[-] backend.php
[edit]
[-] frontend_view.php
[edit]
[-] frontend_class.php
[edit]