Changeset 2281782
- Timestamp:
- 04/12/2020 09:00:23 AM (6 years ago)
- Location:
- wp-assistance
- Files:
-
- 8 added
- 4 edited
-
assets/icon-256x256.png (added)
-
trunk/admin (added)
-
trunk/admin/CWAAdmin.class.php (added)
-
trunk/admin/images (added)
-
trunk/admin/images/wp-icon-256.png (added)
-
trunk/admin/images/wp-icon.png (added)
-
trunk/admin/view (added)
-
trunk/admin/view/wa-settings.php (added)
-
trunk/css/wp-assistance-main.css (modified) (1 diff)
-
trunk/index.php (modified) (3 diffs)
-
trunk/js/wp-assistance-essential.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-assistance/trunk/css/wp-assistance-main.css
r2280676 r2281782 62 62 } 63 63 } 64 65 #fe-wpa-id { 66 width: 350px; 67 height: 160px; 68 padding: 20px; 69 position:fixed; 70 bottom:10px; 71 right: 10px; 72 } 73 74 #fe-wpa-id .fe-wpa-mic { 75 width: 50px; 76 height: 50px; 77 font-size: 50px; 78 } 79 80 #fe-wpa-text { 81 82 width: 180px; 83 float: left; 84 border-radius: 33px; 85 height: 95px; 86 float: left; 87 } 88 89 90 #speech.btn { 91 float:right; 92 border: none; 93 padding: 0; 94 border-radius: 100%; 95 width: 100px; 96 height: 100px; 97 font-size: 1.5em; 98 color: #fff; 99 padding: 0; 100 margin: 0; 101 background: #FF3D7F; 102 position: relative; 103 display: inline-block; 104 line-height: 50px; 105 text-align: center; 106 white-space: nowrap; 107 vertical-align: middle; 108 -ms-touch-action: manipulation; 109 touch-action: manipulation; 110 cursor: pointer; 111 -webkit-user-select: none; 112 -moz-user-select: none; 113 -ms-user-select: none; 114 user-select: none; 115 background-image: none; 116 } 117 118 .pulse-ring { 119 content: ''; 120 width: 100px; 121 height: 100px; 122 border: 5px solid #FF3D7F; 123 border-radius: 50%; 124 position: absolute; 125 top: -5px; 126 left: -5px; 127 animation: pulsate infinite 2s; 128 } 129 130 131 #fe-wpa-id .pulse-ring { 132 top: 0px; 133 left: 0px; 134 } 135 136 @-webkit-keyframes pulsate { 137 0% { 138 -webkit-transform: scale(1, 1); 139 opacity: 1; 140 } 141 100% { 142 -webkit-transform: scale(1.2, 1.2); 143 opacity: 0; 144 } 145 } -
wp-assistance/trunk/index.php
r2281497 r2281782 11 11 12 12 define( 'WP_ASISTANCE_URL', plugins_url( '/', __FILE__ ) ); 13 define( 'WP_ASISTANCE_PATH', plugin_dir_path( __FILE__ ) ); 13 14 14 15 function WpAssistanceMicIcon( \WP_Admin_Bar $bar ) { … … 45 46 wp_enqueue_style('dashicons'); 46 47 wp_enqueue_script('wp-assistance-essential'); 47 48 48 } 49 49 50 add_action( 'wp_enqueue_scripts', function() { 51 wp_enqueue_style( 'dashicons' ); 52 } ); 53 54 function loadWpAssistance() { 55 $objSettings = get_option( 'WP_ASSISTANCE_SETTINGS' ); 56 57 if( true == $objSettings->is_front_end_enable ) 58 echo '<div class="fe-wpa" id="fe-wpa-id"></div><script> var search_url = \'' . home_url() . '\'</script>'; 59 } 60 61 wp_enqueue_script( 'jquery' ); 50 62 wp_enqueue_script('wp-assistance-essential', WP_ASISTANCE_URL . 'js/wp-assistance-essential.js' ); 51 63 wp_enqueue_style( 'wp-assistance-main', WP_ASISTANCE_URL . 'css/wp-assistance-main.css' ); … … 53 65 add_action('wp_enqueue_scripts', 'WpAssistanceDashIcons'); 54 66 67 add_action( 'wp_footer', 'loadWpAssistance' ); 68 69 if( true == is_admin() ) { 70 include_once( WP_ASISTANCE_PATH . 'admin/CWAAdmin.class.php'); 71 } 72 55 73 ?> -
wp-assistance/trunk/js/wp-assistance-essential.js
r2280676 r2281782 53 53 if ( interim_transcript) { 54 54 jQuery('#wp-assistance-text').text( interim_transcript ) 55 if( jQuery('#fe-wpa-text').length > 0 ) { 56 jQuery('#fe-wpa-text').val( interim_transcript ); 57 } 55 58 } 56 59 if ( final_transcript) { 57 60 jQuery('#wp-assistance-text').text( final_transcript ) 61 if( jQuery('#fe-wpa-text').length > 0 ) { 62 jQuery('#fe-wpa-text').val( final_transcript ); 63 } 58 64 } 59 65 }; … … 91 97 }); 92 98 99 jQuery(function() { 100 101 if ( !('webkitSpeechRecognition' in window) ) { 102 return false; 103 } 104 105 if( jQuery('#fe-wpa-id').length <= 0 ) { 106 return false; 107 } 108 109 jQuery('#fe-wpa-id').html( '<form id="fe-wpa-search" action="' + search_url + '"><input id="fe-wpa-text" type="text" name="s" value="" placeholder="Search" style="display: none" /> <button id="speech" class="btn"><span class="dashicons dashicons-microphone fe-wpa-mic"></span><div class="pulse-ring" style="display:none;"></div></form>' ); 110 111 jQuery('#fe-wpa-id').click( function( e ) { 112 e.preventDefault(); 113 if( true == jQuery( '.fe-wpa-mic ').hasClass( 'dashicons-microphone' ) ) { 114 jQuery( '#fe-wpa-id .pulse-ring').show(); 115 jQuery( '#fe-wpa-text' ).show(); 116 jQuery( '.fe-wpa-mic' ).removeClass( 'dashicons-microphone' ); 117 jQuery( '.fe-wpa-mic' ).addClass( 'dashicons-search' ); 118 recognition.start(); 119 120 } else { 121 jQuery( '#fe-wpa-id .pulse-ring').hide(); 122 jQuery( '#fe-wpa-text' ).hide(); 123 jQuery( '.fe-wpa-mic' ).addClass( 'dashicons-microphone' ); 124 jQuery( '.fe-wpa-mic' ).removeClass( 'dashicons-search' ); 125 jQuery( '#fe-wpa-search').submit(); 126 recognition.stop(); 127 } 128 }); 129 }); 130 -
wp-assistance/trunk/readme.txt
r2281497 r2281782 18 18 Improve your speed of typing posts and pages by using your voice or speech. The plugin is usefull for you to automatically type into your WordPress using your voice. 19 19 20 Do you want to give a voice based user interface for your customer or users. then just configure the plugin and your users can search through your website using this plugin. 21 20 22 Releases: 21 0.0.2 - PHP 5.6 and 7.4 compatibility. 23 0.0.3 - Allow users to configure front end search. 24 0.0.2 - PHP 5.6 or greater version compatibility. 22 25 0.0.1 - Allow wordpress user to convert speech into text by talking with wordpress. 26 27 Upcomming features: 28 1. A bot which talks with users. 29 2. A customizable commands. 23 30 24 31 == Installation ==
Note: See TracChangeset
for help on using the changeset viewer.