Twilio sample react app trying to pass a room name in the URL and put it into a hidden field? - reactjs

I know this sounds like a big ask, but I'm assuming someone else has already done this and has a simple answer because it seems like an obvious use case.
Twilio has a sample app available on GitHub for their video service. Unfortunately, I don't know much about react, so I was able to make a couple of little changes, but this one has me stumped.
The code is called: Twilio / twilio-video-app-react
https://github.com/twilio/twilio-video-app-react
When you launch the code to enter a video room, you are presented with a form to enter your name and the name of a video room. I need to remove that room name input field and replace it with a hidden variable that was provided in the URL. In other words:
Get a room name variable that was passed as a query parameter on the URL
Make sure the room name is "safe" (alphanumeric) and then put it into a hidden variable in the form
Remove the visible input field (room name) from the form
That would take me two minutes in PHP, and it's probably really easy in react as well, but I can't figure it out. Hope someone can point me in the right direction.

Related

Is there a way to change the name that the NAO-robot uses in the Basic channel?

I want that my NAO-robot (Version 6) uses another name than NAO, when someone asks "What is your name?". I already changed it's name in the settings, but it doesnt use it by the voice recognition.
The basic channel's content is probably generic and might not adapt to your robot's actual name. But by making a small app reacting on the same trigger sentence, you might be able to override the current behavior.

ReactJS - first entry point

I am trying to work out if a visitor is entering / first page they visit is site.com/life
As we need a change a few things like:
CSS
Audio Playing in Background
etc etc.
I am wondering is their a function that allows us to work out if a path was the first entry point for that visitor?
I was thinking we could check to see if their is a back history but not sure if this would work?
Any advice would be great.
If your app is using react-router, you can access the history object and see where the oldest entry is.

What field needs to be changed to update this specific header?

In my mobile app, we use the docusign API to create a pdf enveloppe in a mobile app and change its content to match our customers expectations.
There are text components of the pdf that I'm supposed to be able to change, like DocuSign_SignerPlacedCompleteConfirm. Problem is, when changing the value, nothing appears on the enveloppe, while the change does happen for other fields.
Our doc includes the Docusign-Signing-Resource-File pdf v2.0 and the original resource file from docusign (master downloaded on their site).
I've already observed a difference between our master resource file and what the doc says about what's inside.
So I guessed that the field key was not the right one and I tried other names for the key, like placing "_Mobile" at the end.
But it still doesn't work.
I really feel like the doc is missing something, and it bothers me as everything looks changeable and this item is supposed to be but I can't get it to change.
<data name="DocuSign_SignerPlacedCompleteConfirm">Bla bla bla</data>
doesn't change the field I want. But
<data name="DocuSign_HelpfulStart_Mobile">Click on START to start</data>
does change something, a text which is near the previous one.
The field I want to change is circled in black here :
Field to change
App is coded in React Native, opens a WebView in which you can see above page, generated by DocuSign.
I can't see any error log from docusign, and I just expect my text in the header to be set at 'Bla bla bla' for example. Instead, it's set at the default value.
I'm sorry Axel, but I'm afraid what you are asking is not possible.
Changing the UI of the actual signature tabs in a signed envelope is not supported at this time.
It is a major security concern to enable this type of change, as it would potentially allow someone to make it look like someone else signed their envelope.

How to display dynamic marker label info from database

For the past month or so I have been trying to solve this problem. I checked the website extensively, including all tutorials I could find, and even bought a book. I previously posted but have had no luck. Hopefully I have more info to get some help.
Basically I have a map in my FileMaker database. Everything works fine, except for one thing I would like to change. When I roll over each marker I would like to see the label show the customers name, instead of the static "Marker 1", "Marker 2", etc.
I included a link to dropbox that has the html, the MarkersArray custom function and hopefully all the info that's passed to the Html that may be needed. Through much trial and terror, I can't figure out how to make it happen. Any help or guidance would be greatly appreciated.
Thanks
Steve
https://dl.dropboxusercontent.com/u/71328624/GoogleMapsDocs/html.txt
https://dl.dropboxusercontent.com/u/71328624/GoogleMapsDocs/ss1geo.png
instantiate a variable that calculates the company name inside of your for loop. replace "Marker" +i with the variable.

How to add a custom field into template.php using Zen sub theme

First time poster here, I'm a designer not skilled at all with php and I have a small issue I don't seem to be able to solve. I'm making a site in drupal 7 using a sub theme on zen.
Btw this is a great CMS, even though people say it's really more a developers CMS. I have no trouble to do what I need using views, rules, display suite etc. So a big thank you for all the developers out there making this such a good CMS. But for this apparently simple problem... no module will help me (I think) and I'm kinda stuck.
So here it is: I'd like to add a subtitle next to the title in all my pages.
So what I did was to add a custom field into the content type basic page (machine name: field_sub_title) which is a simple text field.
I uncommented the following line in my template.php
function mytheme_preprocess_page(&$variables, $hook) {
$variables['sub_title'] = t('field_sub_title');
}
Now my question is how do I load the content of my custom field into that variable?
I know i need to change the second part, but I don't have a clue as into what I need to change this.
Displaying the variable into the the page.tpl.php is something I know about so I only need help with the first part.
{EDIT}
Ok I found how to do this :)
I was looking for a solution in the wrong place. I don't need to change any thing in the template.php file.
Just needed to add this bit of code into my page.tpl.php:
<?php
print $node->field_sub_title['und'][0]['value'];
?>
So I'm posting this here for other Drupal newbies struggling with this....
Your solution may work for now, but there may be a more Drupal-y way to handle a problem like this. If you haven't noticed any problems yet, you may find one or more of the following issues down the road:
Someone who doesn't know php or Drupal theming may need to change the way this works.
If you're like me, you may forget where exactly in code this was implemented.
You may see superfluous markup and/or errors on nodes (content) that do not have this sub-title field (ie. event content not having a sub-title field while basic pages and news articles do).
When you add a field to a content type, it will automatically appear anytime content in that content type is displayed. You should be able to add the sub-title field for your page, event or whatever else you need and have it automatically appear in the markup.
You can 'manage display' of a content type to drag and drop the order for fields to appear. You could take it a step further by using a module like Display Suite to add formatting or layout per-content type.
If you feel like this isn't good enough and the markup for the subtitle must be at the same level as the page title (which is rare), at least add an if statement to make your code check to see if the variable is present before trying to print it. I'd also add a new variable and comments for code readability.
<?php
$subtitle = $node->field_sub_title['und'][0]['value'];
if($subtitle){
print $subtitle;
}
?>
Consider using field_get_items or field_view_value, or at least use the LANGUAGE_NONE constant instead of 'und'
See https://api.drupal.org/api/drupal/modules%21field%21field.module/function/field_get_items/7 and https://api.drupal.org/api/drupal/modules!field!field.module/function/field_view_value/7
This has the added benefit of reducing the number of potential security holes you create.

Resources