Code Monkey home page Code Monkey logo

Comments (17)

EddyVerbruggen avatar EddyVerbruggen commented on August 18, 2024 1

@GabrielStetco You're right, but IMO that's not really up to this plugin. It would be cool to have a browser version but it's not where my expertise is. Also, if it wouldn't suck I would undermine the usefulness of this plugin in a way 😉

from cordova-plugin-native-keyboard.

EddyVerbruggen avatar EddyVerbruggen commented on August 18, 2024

Can you share the code snippet with me?

from cordova-plugin-native-keyboard.

DaveRand avatar DaveRand commented on August 18, 2024

Here you go:

NativeKeyboard.showMessenger({
animated: true,
// type: 'default', // Options are:
"default", "decimalpad", "phonepad", "numberpad",
"namephonepad", "number", "email", "twitter",
"url", "alphabet", "search", "ascii"
placeholder: 'Type your message..',
placeholderColor: '#DDDDDD',
textViewBackgroundColor: '#F6F6F6',
backgroundColor: '#F6F6F6', // Appears to be Android only
textViewBorderColor: '#777777', // iOS only
textColor: '#555555', // Appears to be Android only
autocorrectionEnabled: false, // on iOS
this hides the 'predictive text' bar
appearance: 'light', // iOS only, light (default) | dark
// autoscrollElement:
'DLG1.R1.PANEL.1.PANEL.1.PANEL.0.BODY.CONTENTWRAPPER.SCROLLWRAPPER',
onSubmit: function(text) {
SendMessage(text);
},
onKeyboardDidShow: function() {
var listObj = {dialog.object}.getControl('list1');
listObj.scrollToItem({dialog.object}.appVars.totRows);
console.log('onKeyboardDidShow');
},
onKeyboardDidHide: function() {
var listObj = {dialog.object}.getControl('list1');
listObj.scrollToItem({dialog.object}.appVars.totRows);
console.log('onKeyboardDidHide');
},
leftButton: {
type: 'ionicon', // or 'text' (Android
only currently) or 'fontawesome'
value: '\uf48a', // http://ionicons.com/

  • right-click and inspect the :before value (don't forget the \uf !)
    //color: '#ff0000', // default blue on iOS, grey on Android
    textStyle: 'normal', // if type is
    'text', you can set this to 'normal' (default), 'bold', 'italic'
    disabledWhenTextEntered: false, // default false
    onPress: function () {
    if (window.plugins && window.plugins.actionsheet) {
    window.plugins.actionsheet.show({
    androidTheme:
    window.plugins.actionsheet.ANDROID_THEMES.THEME_DEVICE_DEFAULT_LIGHT,
    buttonLabels:
    ['Take Photo or Video', 'Use Last Photo Taken', 'Choose From Library'],
    addCancelButtonWithLabel: 'Cancel'
    }, function(index) {
    if (index == 1)
    {dialog.object}.runAction('TakePicture');
    if (index == 3)
    {dialog.object}.runAction('SelectPicture');
    });
    }
    else
    {
    // alert("Left
    button pressed - if you install
    cordova-plugin-actionsheet you'll see a nice ActionSheet in this demo.");
    }
    }
    },
    rightButton: { // necessary for Android only
    type: 'text', // or 'fontawesome' or 'ionicon', default 'text'
    value: 'Send', //
    'fa-battery-quarter', // '\uf2c3', // 'Send', // default 'Send'
    textStyle: 'bold', // 'normal' (default), 'bold', 'italic'
    //color: '#FF0000', // default iOS blue
    onPress: function () {
    // alert("Right button was
    pressed - text was passed to 'onSubmit' if provided.");
    }
    }
    });

At 11:48 PM 11/17/2016, you wrote:

Can you share the code snippet with me?

­
You are receiving this because you authored the thread.
Reply to this email directly,
#7 (comment)
it on GitHub, or
https://github.com/notifications/unsubscribe-auth/AEX-mx8rbBOI1p838cgItn-tSb9OHyqaks5q_VhLgaJpZM4K0qENmute
the thread.

from cordova-plugin-native-keyboard.

EddyVerbruggen avatar EddyVerbruggen commented on August 18, 2024

(copied the code above into a new reply as GitHub doesn't support Markdown in email replies:)

NativeKeyboard.showMessenger({
         animated: true,
//      type: 'default', // Options are: "default", "decimalpad", "phonepad", "numberpad", "namephonepad", "number", "email", "twitter", "url", "alphabet", "search", "ascii"
         placeholder: 'Type your message..',
         placeholderColor: '#DDDDDD',
         textViewBackgroundColor: '#F6F6F6',
         backgroundColor: '#F6F6F6', // Appears to be Android only
         textViewBorderColor: '#777777', // iOS only
         textColor: '#555555', // Appears to be Android only
         autocorrectionEnabled: false, // on iOS this hides the 'predictive text' bar
         appearance: 'light', // iOS only,  light (default) | dark
//      autoscrollElement: 'DLG1.R1.PANEL.1.PANEL.1.PANEL.0.BODY.CONTENTWRAPPER.SCROLLWRAPPER',
         onSubmit: function(text) {
                 SendMessage(text);
         },
         onKeyboardDidShow: function() {
                 var listObj = {dialog.object}.getControl('list1');
                 listObj.scrollToItem({dialog.object}.appVars.totRows);
                 console.log('onKeyboardDidShow');
         },
         onKeyboardDidHide: function() {
                 var listObj = {dialog.object}.getControl('list1');
                 listObj.scrollToItem({dialog.object}.appVars.totRows);
                 console.log('onKeyboardDidHide');
         },
         leftButton: {
         type: 'ionicon', // or 'text' (Android only currently) or 'fontawesome'
         value: '\uf48a', // http://ionicons.com/ - right-click and inspect the :before value (don't forget the \uf !)
         //color: '#ff0000', // default blue on iOS, grey on Android
         textStyle: 'normal', // if type is 'text', you can set this to 'normal' (default), 'bold', 'italic'
         disabledWhenTextEntered: false, // default false
         onPress: function () {
                         if (window.plugins && window.plugins.actionsheet) {
                                 window.plugins.actionsheet.show({
                                         androidTheme: 
window.plugins.actionsheet.ANDROID_THEMES.THEME_DEVICE_DEFAULT_LIGHT,
                                         buttonLabels: 
['Take Photo or Video', 'Use Last Photo Taken', 'Choose From Library'],
                                         addCancelButtonWithLabel: 'Cancel'
                         }, function(index) {
                                         if (index == 1)
                                                 {dialog.object}.runAction('TakePicture');
                                         if (index == 3)
                                                 {dialog.object}.runAction('SelectPicture');
                                 });
                         }
                         else
                         {
//                              alert("Left button pressed - if you install cordova-plugin-actionsheet you'll see a nice ActionSheet in this demo.");
                         }
                 }
         },
         rightButton: { // necessary for Android only
                 type: 'text', // or 'fontawesome' or 'ionicon', default 'text'
                 value: 'Send', // 'fa-battery-quarter', // '\uf2c3', // 'Send', // default 'Send'
                 textStyle: 'bold', // 'normal' (default), 'bold', 'italic'
                 //color: '#FF0000', // default iOS blue
                 onPress: function () {
//                      alert("Right button was pressed - text was passed to 'onSubmit' if provided.");
                 }
         }
});

from cordova-plugin-native-keyboard.

EddyVerbruggen avatar EddyVerbruggen commented on August 18, 2024

Hmm, narrowed it down to the maxChars property: if you add it you will get the placeholder to appear. There's 2 options to fix this:

  • Add maxChars: 0, or
  • Update to 1.1.1

from cordova-plugin-native-keyboard.

DaveRand avatar DaveRand commented on August 18, 2024

Great! Thanks so much!

At 05:30 AM 11/18/2016, you wrote:

Hmm, narrowed it down to the maxChars property:
if you add it you will get the placeholder to
appear. There's 2 options to fix this:

  • Add maxChars: 0, or
  • Update to 1.1.1

­
You are receiving this because you authored the thread.
Reply to this email directly,
#7 (comment)
it on GitHub, or
https://github.com/notifications/unsubscribe-auth/AEX-m5Ha_NK9UHcoLz_4NcqyXCIuTrS7ks5q_ah8gaJpZM4K0qENmute
the thread.

from cordova-plugin-native-keyboard.

DaveRand avatar DaveRand commented on August 18, 2024

from cordova-plugin-native-keyboard.

GabrielStetco avatar GabrielStetco commented on August 18, 2024

+1
This plugin is really useful.
I have already implemented something similar in my current project, but this is better.
The problem is that if I start using it I cannot modify it on my own and I'm not sure that Eddy can dedicate additional time and continuity to this project.
I see that he's also busy on other projects.

Gabriel

from cordova-plugin-native-keyboard.

EddyVerbruggen avatar EddyVerbruggen commented on August 18, 2024

@DaveRand Let me look into that this weekend.

@GabrielStetco That's the exact reason this is a commercial plugin. If it would be free I would not be able to spend any time on it (and would have never created it in the first place). Thanks for considering using it!

from cordova-plugin-native-keyboard.

GabrielStetco avatar GabrielStetco commented on August 18, 2024

I completely agree, free work does not put food on the table :)
The reality is that I'd gladly pay for this addition.
Is just that I sent you more than a week ago an email regarding any possible implementation for browser support. Not received any answer I assumed you were busy.

I appreciate your work
Gabriel

from cordova-plugin-native-keyboard.

DaveRand avatar DaveRand commented on August 18, 2024

from cordova-plugin-native-keyboard.

EddyVerbruggen avatar EddyVerbruggen commented on August 18, 2024

Hey @DaveRand you can now pass in a onTextEntered event listener function. Update to 1.1.3 and see the readme.

from cordova-plugin-native-keyboard.

DaveRand avatar DaveRand commented on August 18, 2024

from cordova-plugin-native-keyboard.

DaveRand avatar DaveRand commented on August 18, 2024

from cordova-plugin-native-keyboard.

EddyVerbruggen avatar EddyVerbruggen commented on August 18, 2024

Hey @DaveRand, I could change the native implementation to only send text to JS when something is in there, but I'd also like to handle the case where the user deleted everything (backspace event).

I'm not sure what your usecase is, but can you just check what is returned and act upon that?

from cordova-plugin-native-keyboard.

DaveRand avatar DaveRand commented on August 18, 2024

from cordova-plugin-native-keyboard.

EddyVerbruggen avatar EddyVerbruggen commented on August 18, 2024

Sounds like a nice feature!

I'll see if it can be cleaned up a bit, but perhaps you can indeed show the indicator (gif) as long as the onTextUpdated function returns anything but an empty string.

from cordova-plugin-native-keyboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.