Positioning Onsen UI Tabs within page content - onsen-ui

I am creating a page with conference speaker information and would like to have his picture below the main tool bar then have profile, rating and contact information below the picture in tabs format so as not to have long pages on the mobile app.
The examples have seen so far only place the tabs top or bottom which is not always the only way to use them in real life applications.
How would I implement this in a clean way if there's one already provided by the framework?

Instead of using the <ons-tabbar> custom element you can use just the CSS.
The CSS is available at:
http://components.onsen.io/
<div class="my-tab-bar tab-bar">
<label class="tab-bar__item">
<input type="radio" name="tab-bar-a" checked="checked">
<button class="tab-bar__button">
<i class="tab-bar__icon ion-stop"></i>
<div class="tab-bar__label">One</div>
</button>
</label>
<label class="tab-bar__item">
<input type="radio" name="tab-bar-a">
<button class="tab-bar__button">
<i class="tab-bar__icon ion-record"></i>
<div class="tab-bar__label">Two</div>
</button>
</label>
<label class="tab-bar__item">
<input type="radio" name="tab-bar-a">
<button class="tab-bar__button">
<i class="tab-bar__icon ion-star"></i>
<div class="tab-bar__label">Three</div>
</button>
</label>
</div>
But this is positioned in the top so you will have to override the CSS:
.my-tab-bar {
position: initial;
}
http://codepen.io/argelius/pen/dPEpbV

Related

Office UI Fabric JS Dialog Component

I'm currently using Office-UI-Fabric-JS to build a UI for an Outlook Web Add-In. I will eventually switch over to React.
I've gone over the examples and what I'm not clear about is from where will the HTML for the Dialog box reside?
Calling the Fabric Dialog's "open" API from a TaskPane centers the Dialog within the TaskPane. I would like it centered on the screen.
However, I'm not sure where the HTML for the dialog should go?
Do I put it in the non-UI Html file ("FunctionFile.html"), then use div tags?
Do I create an entirely separate HTML page, then load that HTML using Javascript (window.location = "mydialog.html")?
HERE'S A SAMPLE (Where would this HTML go?)
<div class="docs-DialogExample-default">
<div class="ms-Dialog">
<div class="ms-Dialog-title">All emails together</div>
<div class="ms-Dialog-content">
<p class="ms-Dialog-subText">Your Inbox has changed. No longer does it include favorites, it is a singular destination for your emails.</p>
<div class="ms-CheckBox">
<input tabindex="-1" type="checkbox" class="ms-CheckBox-input">
<label role="checkbox" ...>
<span class="ms-Label">Option1</span>
</label>
</div>
<div class="ms-CheckBox">
<input tabindex="-1" type="checkbox" class="ms-CheckBox-input">
<label role="checkbox" class="ms-CheckBox-field" tabindex="0" aria- checked="false" name="checkboxa">
<span class="ms-Label">Option2</span>
</label>
</div>
</div>
<div class="ms-Dialog-actions">
<button class="ms-Button ms-Dialog-action ms-Button--primary">
<span class="ms-Button-label">Save</span>
</button>
<button class="ms-Button ms-Dialog-action">
<span class="ms-Button-label">Cancel</span>
</button>
</div>
</div>
<button class="ms-Button docs-DialogExample-button">Open Dialog</button>
<label class="docs-DialogExample-label"></label>
</div>
To open a dialog from web addin use the displayDialogAsync API provided by Office.js. Some additional documentation can be found here:
https://learn.microsoft.com/en-us/office/dev/add-ins/develop/dialog-api-in-office-add-ins

How to display image inside image tag using Angular.js

I need some help.i need to display multiple image and when also user will select the image it will push into array.I am explaining my code below.
<div class="input-group bmargindiv1 col-md-12" ng-repeat="mul in mulImage">
<span class="input-group-addon ndrftextwidth text-right" style="width:180px">Image{{$index+1}}:</span>
<div>
<div ng-class="{'myError': billdata.upload_{{$index}}.$touched && billdata.upload_{{$index}}.$invalid }">
<input type="file" class="filestyle form-control" data-size="lg" name="upload_{{$index}}" id="bannerimage_{{$index}}" ng-model="mul.image" ngf-pattern="'image/*'" accept="image/*" ngf-max-size="2MB" ngf-min-height="400" ngf-resize="{width: 400, height:400}" ngf-select="onFileSelect1('upload_{{$index}}',mul.image);">
<div style="clear:both;"></div>
<input type="text" id="hidn_{{$index}}" ng-model="attach_{{$index}}" style="display:none" />
</div>
</div>
<span class="input-group-btn" ng-show="mulImage.length>0">
<img ngf-thumbnail="mul.image" name="pro" border="0" style="width:32px; height:32px; border:#808080 1px solid;">
<input type="button" class="btn btn-success" name="plus" id="plus" value="+" ng-click="addNewImageRow(mulImage);" ng-show="$last"> <input type="button" class="btn btn-danger" name="minus" id="minus" value="-" ng-show="mulImage.length>1" ng-click="deleteNewImageRow(mulImage,$index);">
</span>
</div>
</div>
Here i am using ng-file-upload to upload the multiple image by plus button.When user will select the image from local drive the the images are displaying.But there is an additional case i have some image name i need to display those first and if user will select more it can be also possible.
$scope.mulImage=[];
$scope.mulImage.push({'image':null});
$scope.addNewImageRow=function(mulImage){
mulImage.push({'image':null});
}
$scope.deleteNewImageRow=function(mulImage,index){
mulImage.splice(index,1);
console.log('file',$scope.mulImage[0]['image'].name);
}
The above is my controller side code.
var arr=["10lx18i3ciyhkt9_de021b24.jpg", "ajqgis4v1wi2j4i_a6d6c48a.jpg", "7pxknunjop9cnmi_silu nana.jpg"]
Suppose i have the above images before.When the page will refresh the first 3 images will display to user like upload/10lx18i3ciyhkt9_de021b24.jpg and 3 image row also will create.if user wants to add/delete it can be also possible.Please help me.

Angular - Hide Div when form text input is not blank

Basically i would like for one dive to be hidden when someone adds text to a box.
I have a form where someone can either upload an image or add a link to an image. When the user adds an image link i would like to hide the upload button
Right now i have it that when they select an image to upload the text box will be hidden but i cant get the vice versa working.
Id like to hide the div "manual-upload" when a user adds text to the data-ng-model="dealsCTRL.urlimage"
<div class="manual-upload">
<div class="text-center form-group controls" ng-hide="uploaderProduct.queue.length">
<span class="btn btn-default btn-file">
Select Image <input type="file" nv-file-select uploader="uploaderProduct">
</span>
</div>
<div class="sub-label"> Upload an image of product.</div></br>
<div class="text-center form-group" ng-show="uploaderProduct.queue.length">
<button class="btn btn-primary" ng-click="uploadProductPicture();">Upload</button>
<button class="btn btn-default" ng-click="cancelProductUpload();">Delete</button>
</div>
<div ng-show="success" class="text-center text-success">
<strong>Upload Successful</strong>
</div>
<div ng-show="error" class="text-center text-danger">
<strong ng-bind="error"></strong>
</div>
</div>
<div class="add-image-link">
<label class="control-label" for="urlimage" ng-hide="uploaderProduct.queue.length">IMAGE URL</label>
<div class="controls" ng-hide="uploaderProduct.queue.length">
<input type="url" data-ng-model="dealsCTRL.urlimage" id="urlimage" class="form-control"
placeholder="Image URL" ng-change="blankPhoto()" required>
<div class="sub-label">Manually enter an image URL.</div>
</div>
</div>
You want to hide the element when you start typing so
div class="manual-upload" ng-hide="dealsCTRL.urlimage.length > 0"
Please try the following:
<div class="manual-upload" ng-show="dealsCTRL.urlimage.length === 0">

How to show accessory input toolbar using forms in ionicframework?

This is from the docs
This is my code and output
What should be added to show the toolbar with done button?
To be able to see the Done button, you will need to download Cordova keyboard plugin: http://ngcordova.com/docs/plugins/keyboard/
Then use this line:
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false);
Something like this:
module.controller('MyCtrl', function($scope, $cordovaKeyboard) {
$cordovaKeyboard.hideAccessoryBar(false)
});
This example will work only if you include ngCordova to your Ionic project.
More information can be found here: https://github.com/driftyco/ionic-plugin-keyboard
Keyboard.hideKeyboardAccessoryBar Hide the keyboard accessory bar with
the next, previous and done buttons.
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false);
Precisely the buttons you can see on a top image.
I think it may have to be a form...so our app shows the word done in the toolbar and this is what our code looks like. I don't know for sure but I am guessing the done button shows up when there is a form to be submitted. Give it a go and let me know.
<form ng-submit="authenticate(user)" name="loginform" id="loginform">
<div class="list has-header padding">
<div style="height: 48px;" class="item item-input">
<input type="text" placeholder="Username" ng-model="user.username">
<i class="icon ion-close-circled padding" ng-if="user.username.length" ng-click="resetUsername()"></i>
</div>
<div style="height: 48px;" class="item item-input">
<input type="password" placeholder="Password" ng-model="user.password">
<i class="icon ion-close-circled padding" ng-if="user.password.length" ng-click="resetPassword()"></i>
</div>
</div>
<div style="text-align: center;">
<button type="submit" class=" login button button-full button-positive">Login</button>
</div>
</form>

Implementing POP UP in Angular+Node

Can anyone please suggest me How to implement a POP UP function in Angular + Node js?
I want to implement a login which should pop up when the user clicks login button.
Thanks
Depends on what CSS framework you are using. I often use Bootstrap, and the ui-bootstrap directives. This allows easy modal dialog display.
This is dummy html with bootstrap content that will trigger pop up on button click. You will notice I've placed ng-click directive on the login button, so you should just create angular function on your controller that is combined with this view.
<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".modalExample">Login modal</button>
<div class="modal fade modalExample" tabindex="-1" role="dialog" aria-labelledby="myModallable">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<form>
<div class="form-group">
<input type="email" class="form-control" ng-model="username" placeholder="Username" />
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Password" ng-model="password" />
</div>
<div class="form-group">
<button class="btn btn-default" ng-click="login(username,password)">Login</button>
</div>
</form>
</div>
</div>
</div>
This will handle your problem on the client side, and related to Node.js I suppose you will have some api controller that will listen for the request that you can send from angular factory that represents service.
Several ways of doing this either with jQuery or angular.js.
ngDialog plugin is available you can go through it if you want popup with pure angular.

Resources