Meteor: How to override verify email popup dialog which appears after clicking email verification link - meteor

I want to add some fields to popup dialog which appears when user click on verification email link sent to there email. Actually i want to extend the sign up process. So when user clicked on verify link i want to show some more fields like zip code and date of birth in popup and on clicking save those fields should save to user modal.
Any help will be highly appreciated. I am new to meteor.
I am using ian:accounts-ui-bootstrap-3 for sign up process.

Some more details if needed !
With the following package, you can replace templates :
https://github.com/aldeed/meteor-template-extension
So you create your own template, then replace the default one :
Template.emailVerifiedDialog.replaces("_justVerifiedEmailDialog")
Your dialog will be shown on every pages, you have to add the behaviour to make it visible when necessary
Template.emailVerifiedDialog.helpers({
visible: function () {
return loginButtonsSession.get('justVerifiedEmail');
}
And manage click button event :
Template.emailVerifiedDialog.events({
'click #just-verified-dismiss-button': function () {
loginButtonsSession.set('justVerifiedEmail', false);
}
});

Ok, i found solution myself.
Here it is if some one else also looking for this.
We can override email popup dialog by overriding login_buttons_dialogs.html file in /meteor-accounts-ui-bootstrap-3 folder.

Related

Refreshing values on fields

I have multiple pages in my applications, one of them is to add a driver information.
When i go to add driver information page and fill some of the fields like "driver licence" text box, then i do not add this to DB and click "go back" button (that discard the changes and come back to home page) when i enter again to this page the fields that i have previously filled in with data do not clear and refresh (its supposed to all fields be clear and empty)
Does anyone have a solution for that?
code for "go back button:
app.datasources.driver.clearChanges(function() {
console.log("cleared changes");
});
returnToDriver();
returnToDriver() code is:
app.datasources.DRIVERS_LIST.query.clearFilters();
app.datasources.DRIVERS_LIST.load();
app.showPage(app.pages.Driver);
Already tried:
widget.root.descendants.TextBox1.value = "";
widget.root.descendants.TextBox1.value = null;
but do not work for me.
Regards
Potentially there are can be multiple ways to leave the page:
browser navigation including navigation hotkeys
links on the page that can navigate to other pages
in-app navigation buttons/hotkeys
etc...
The best way to handle all possible navigation scenarios is using onDetach page event
// Implicit way
// page onDetach event handler, assuming that page
// is bound to appropriate datasource:
// #datasources.<MyDatasource>.modes.create
widget.datasource.clearChanges();
// Explicit way
// Explicitly clearing changes for create datasources in
// page onDetach event handler
app.datasources.<MyDatasource1>.modes.create.clearChanges();
app.datasources.<MyDatasource2>.modes.create.clearChanges();
...
Once you add this code to the onDetach page's event handler you can remove all other clearChanges occurrences from the page.

CRM Ribbon Workbench - Hide + Button on Sub-Grid

I have a sub grid on a new entity called Issues, the sub grid is for another new entity called Cost Detail.
I have them both loaded into my solution called Issue, and have opened issue in the ribbon workbench.
What I want to do is when you are on the Issue form and can see the sub-grid I want to be able to hide the + button which is displayed. However when I have hidden this button in the ribbon workbench it also hides the add new button in the 'Associated View' therefore no records can be added.
How do I do it so that only the + button on the sub grid is hidden and not the other view?
EDIT:
In order to hide the add button, you either need to take away create privileges to the role that the user is in or you could do a hack(unsupported) like this:
function hideAddButton(){
var addButton = $('#NameOfGrid_addImageButton');
if(addButton.size())
addButton.hide();
else
setTimeout(hideAddButton, 1000);//checks every second to see if the button exists yet
}
and call the hideAddButton function on form load
There is one answer that I found. If you have a field that unique for that entity, then you can do it with a simple javascript code.
Here is steps that you must follow in ribbon workbench:
Right click the button and customise button.
Add an enable rule, in Steps section add an Custom Javascript Rule, that contains your library and function name, please make sure that default is true.
This must be in your javascirpt library :
function hideAddNew(){
if(Xrm.Page.getAttribute("yourField")){
return false;
}
else {
return true;
}
}
Add a command that contains the enable rule we created.
Add the command to button.
That's it. I test it, it is working.

How to get AppointmentID on a buttonclick

I have created an outlook add-in where i have a ribbon that adds a button to the appointment tab. This button has a callback method that opens IE and goes to a specific page.
What i need: When you create an appointmnet and ID is stored somewhere(i assume).
I need to get the ID of the appointment that i have opend when i click on my button.
Simplify:
click on an appointment----->appointmnet has a costom button---->click the button--->open a page with the appointmentID.
I need to get the ID and add it to the url paramater when i open the page.
I have been reading up on the appointment global ID here:
http://msdn.microsoft.com/en-us/library/office/ff863645.aspx
And all the links that follow that article but I have not found anything that can help.
Im glad i have friends who know this better than me...
soloution here:
Outlook Ribbon Load Inspector.CurrentItem is null

use a shortcut key to jump to a "settings page"(AIR desktop)

When my video is playing I want to be able to use a shortcut key to jump to a "settings page"(AIR desktop). How should I go about this.
[The video is using stagevideo class in as file and link to master mxml.file]
At the moment I am using different packages (for the "settings page") linked to my master mxml file. However when I run it, the "settings page" overlay with my video, I do not know to make it jump to another window by using a shortcut key, like say F1 key. It's there anything I miss ?
Hope someone can help me out. Thanks.
Somewhere, you need to add an event listener to the stage that will listen for KeyboardEvent.KEY_UP. In that event, you verify the key that is being pressed and if it is the hotkey, you send the user to a different page.
stage.addEventListener( KeyboardEvent.KEY_UP, settingsHotkeyHandler );
function settingsHotkeyHandler( e:KeyboardEvent ):void {
if ( e.charCode == Keyboard.F1 ) {
// send user here
}
}
Don't forget to remove the event listener when you leave the video page. It could cause a memory issue if you don't

How to embed "Share on Facebook" button into Flex application?

I'm trying to duplicate the behaviour of the "Share on Facebook" button from Youtube. Basically, inside a Flex app I'll have a button and when I click it I want a popup that enables me to post something on the wall.
While it is possible to make a call to javascript to open the pop-up I want to be able to set the images and the text of my posting.
Do you know how I could set the images or text as a paramter to the sharer window?
Thank you!
This is fairly straightforward to do. Youtube uses the Facebook API which pops up a new window (Info on Facebook sharer API).
To do this in flex,
Create a button that onClick will call a javascript method, ExternalInterface.call("fbLink", "www.yahoo.com");
In your HTML file (most likely index.template.html) add the JavaScript method, fbLink which does the following:
function fbLink(url) {
window.popup("http://www.facebook.com/sharer.php?u=" + url, {height:440, width:620, scrollbars:true})
}
Now when a user clicks on the button they will be sharing the link "yahoo.com" with facebook account.
as I understood you asking for some help in accessing js popup in html page of facebook share button, so you should use ExternalInterface in this casa and access needed DOM node using getElementById function in your js interface.
In other case I want propose you to read another one way http://www.riaxe.com/blog/flex/publish-into-facebook-wall-from-flex/
It seems that you want to have a button on the flash application and once clicked it opens the facebook page that shares the video/image that pertains to the clicked button. What you want to do is simply create a button that on click opens a new website to facebook using their share api which has the following format:
var facebookShare:String = "http://www.facebook.com/share.php?u=' + encodedVideoLink + '&t='+ encodedVideoText";
Where the u parameter stands for the link that you wish to share, and the t parameter stands for the title of the piece that you want to share, whether it be a picture or video.
You want to add an event listener on MouseEvent.CLICK that has as its callback function a method that handles the opening of the facebook page passing the facebookShare variable as shown above. To open another page on your browser you can use this AS3 Class called URLNavigator: http://www.danishmetal.dk/project/source/com/zorked/URLNavigator.as
To sum it up, something along these lines would do:
var facebookShare:String = "http://www.facebook.com/share.php?u=' + encodedVideoLink + '&t='+ encodedVideoText";
facebookButton.addEventListener(MouseEvent.CLICK, this._goToUrl(facebookShare));
private function _goToUrl(link:String):Function {
var window:String = "_blank",
feats = "",
thisOverlay:Object = this; // to not lose scope when returning a func
return function (e:MouseEvent):void {
trace("Opening link to:"+link);
try { URLNavigator.ChangePage(link, window, feats); }
catch (e:Error) { trace("error launching "+link+" in "+window+" with feature set "+feats); }
}
}
I hope that helps. If you have questions regarding the code please let me know.

Resources