am using angular 10 and included ngx quill editor to show the rich text editor.
when we save the html content into database, it saves with html class type like below:
<li class="ql-indent-2">lbmlkfdnblblfdsb</li>
and when we send an email through our app, we send the above content in the email body but the css class won't available.so it is not displaying the style.
How can we achieve this in Angular ?
I tried below code and didnt get any luck :
https://github.com/quilljs/quill/issues/1451
<quill-editor #body name="body" id="body" [(ngModel)]="studyNotification.messageText" (onSelectionChanged)="editorSelectionChanged($event)"
(onEditorCreated)="editorCreated($event)" [style]="{height: '250px', background: 'white'}">
<div id="toolbar-container" quill-editor-toolbar>
<!-- Text Size -->
<span class="ql-formats">
<select class="ql-font"></select>
<select class="ql-size"></select>
</span>
<!-- Text Formatting -->
<span class="ql-formats">
<button class="ql-bold"></button>
<button class="ql-italic"></button>
<button class="ql-underline"></button>
<button class="ql-strike"></button>
</span>
<span class="ql-formats">
<select class="ql-color"></select>
<select class="ql-background"></select>
</span>
<!-- Subscript/superscript -->
<span class="ql-formats">
<button class="ql-script" value="sub"></button>
<button class="ql-script" value="super"></button>
</span>
<!-- Text Block format -->
<!-- Header Sizes -->
<span class="ql-formats">
<button class="ql-header" value="1"></button>
<button class="ql-header" value="2"></button>
<!-- <button class="ql-blockquote"></button>
<button class="ql-code-block"></button> -->
</span>
<!-- Ordered List / Bullets -->
<!-- Indenting -->
<span class="ql-formats">
<button class="ql-list" value="ordered"></button>
<!-- <button class="ql-list" value="bullet"></button> -->
<button class="ql-indent" value="-1"></button>
<button class="ql-indent" value="+1"></button>
</span>
<span class="ql-formats">
<!-- <button class="ql-direction" value="rtl"></button> -->
<select class="ql-align"></select>
</span>
<span class="ql-formats">
<button class="ql-link"></button>
<button class="ql-image"></button>
<button class="ql-video"></button>
<!-- <button class="ql-formula"></button> -->
</span>
<!-- <span class="ql-formats">
<button class="ql-clean"></button>
</span> -->
</div>
</quill-editor>
Related
I am having issues styling the buttons in the Primefaces text editor. I was able to find the documentation here: link to quill. Unfortunately, I can' figure out how to do the styling for a simple dark mode. Every icon and text in the menubar should be white, the background should be dark. So far I've tried inline style, assigning a class. Nothing seems to lead to success. Even primetek itself doesn't seem to be very successful with that.
Minimal reproducible example:
<p:textEditor widgetVar="editor1" value="#{editorView.text}" height="300" />
<p:textEditor
widgetVar="editor2"
value="#{editorView.text2}"
height="300"
placeholder="Enter your content"
>
<f:facet name="toolbar">
<span class="ql-formats">
<select class="ql-font" />
</span>
<span class="ql-formats">
<button class="ql-bold" />
<button class="ql-italic" />
<button class="ql-underline" />
</span>
<span class="ql-formats">
<select class="ql-color" />
<select class="ql-background" />
</span>
<span class="ql-formats">
<button class="ql-script" value="sub" />
<button class="ql-script" value="super" />
</span>
<span class="ql-formats">
<button class="ql-code-block" />
</span>
<span class="ql-formats">
<button class="ql-list" value="bullet" />
</span>
<span class="ql-formats">
<button class="ql-link" />
</span>
</f:facet>
</p:textEditor>
Simply add this code to a JSF-page and try to style the top toolbar with bold, italic, etc.
Given the following design:
I'd like to hide the 'magnifier' icon and show the 'close' X icon in case the the input's placeholder is not shown.
My markup is:
input:not(:placeholder-shown) {
// hide 'magnifier' icon
// show 'close' icon
}
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" rel="stylesheet"/>
<div class="input-group input-group-sm w-50" id="search-box">
<div class="input-group-prepend">
<span class="input-group-text bg-white" id="input-magnifier">
<i class="fa fa-search text-muted"></i>
</span>
<span class="input-group-text bg-white">
<i class="fa fa-close text-muted"></i>
</span>
</div>
<input type="search" placeholder="Search with 'exact match'" class="form-control" />
<div class="input-group-append">
<div class="dropdown btn-group" role="group">
<button class="btn btn-light btn-sm dropdown-toggle" data-toggle="dropdown" aria-expanded="false" type="button">filters</button>
</div>
</div>
</div>
How to make this input group behave in that way? Or in another words, how do I access the icons from my input element in Scss?
Due to the way CSS works, there is no way to do this without javascript given your current html markup. CSS sibling and adjacent selectors can only select elements that come after a given element, because css "cascades" through the markup from top to bottom.
That said, if you switch around your markup you can absolutely achieve this. Luckily, the input-group class already has display:flex;, so if you move the children elements, you can still control the display order with the order property.
Then all you need to do is use the + (adjacent) selector. See the attached code.
/* CSS adjacent selectors used here, to select the prepend
class only when the placeholder is shown or not shown */
input:not(:placeholder-shown)+.input-group-prepend #input-magnifier {
display: none;
}
input:placeholder-shown+.input-group-prepend #input-delete {
display: none;
}
/* This is the code used to reorder the elements so that
the buttons still appear before the input */
.input-group-prepend {
order: -1;
}
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" rel="stylesheet" />
<div class="input-group input-group-sm w-50" id="search-box">
<input type="search" placeholder="Search with 'exact match'" class="form-control" />
<!-- moved .input-group-prepend div to here so that the adjacent selector works -->
<div class="input-group-prepend">
<span class="input-group-text bg-white" id="input-magnifier">
<i class="fa fa-search text-muted"></i>
</span>
<span class="input-group-text bg-white" id="input-delete">
<i class="fa fa-close text-muted"></i>
</span>
</div>
<div class="input-group-append">
<div class="dropdown btn-group" role="group">
<button class="btn btn-light btn-sm dropdown-toggle" data-toggle="dropdown" aria-expanded="false" type="button">filters</button>
</div>
</div>
</div>
I have a problem with Internet Explorer and HTML code. With Chrome, Edge and firefox all work fine, but in Explorer I have this
instead of
In debug mode I see some error into html code only with explorer:
-Translate:
It has been found tag in excess. In a document is allowed only one body tag.
element or end not expected. All the elements opened have to be closed before the second document end.
Token not expected
The body tag is added by browser. All other page works fine. Do you see something wrong in my code?
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head>
<!-- Spring csrf -->
<meta name="_csrf" th:content="${_csrf.token}" />
<!-- default header name is X-CSRF-TOKEN -->
<meta name="_csrf_header" th:content="${_csrf.headerName}" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Fleets & cars</title>
<!-- Tell the browser to be responsive to screen width -->
<meta
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
name="viewport">
<!-- Bootstrap Core CSS -->
<link th:href="#{/static/assets/bootstrap/css/bootstrap.css}"
rel="stylesheet">
<!-- Font Awesome -->
<link rel="stylesheet"
th:href="#{/static/assets/component/font-awesome-4.4.0/css/font-awesome.min.css}">
<!-- DataTables -->
<link rel="stylesheet"
th:href="#{/static/assets/plugins/datatables/dataTables.bootstrap.css}">
<link rel="stylesheet"
th:href="#{/static/assets/plugins/datatables/extensions/Responsive/css/responsive.bootstrap.min.css}">
<!-- Theme style -->
<link rel="stylesheet"
th:href="#{/static/assets/dist/css/AdminLTE.min.css}">
<!-- AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet"
th:href="#{/static/assets/dist/css/skins/_all-skins.min.css}">
<!-- Select2 angular -->
<link rel="stylesheet"
th:href="#{/static/assets/plugins/select2Angular/select.css}">
<!-- jQuery 2.1.4 -->
<script th:src="#{/static/assets/plugins/jQuery/jQuery-2.1.4.min.js}"
type="text/javascript"></script>
<!-- Bootstrap 3.3.5 -->
<script th:src="#{/static/assets/bootstrap/js/bootstrap.min.js}"
type="text/javascript"></script>
<!-- DataTables -->
<script type="text/javascript"
th:src="#{/static/assets/plugins/datatables/jquery.dataTables.min.js}"></script>
<script type="text/javascript"
th:src="#{/static/assets/plugins/datatables/dataTables.bootstrap.min.js}"></script>
<script type="text/javascript"
th:src="#{/static/assets/plugins/datatables/extensions/Responsive/js/dataTables.responsive.min.js}"></script>
<script type="text/javascript"
th:src="#{/static/assets/plugins/datatables/extensions/Responsive/js/responsive.bootstrap.min.js}"></script>
<!-- Slimscroll -->
<script type="text/javascript"
th:src="#{/static/assets/plugins/slimScroll/jquery.slimscroll.min.js}"></script>
<!-- FastClick -->
<script type="text/javascript"
th:src="#{/static/assets/plugins/fastclick/fastclick.min.js}"></script>
<!-- Bootstrap-growl -->
<script type="text/javascript"
th:src="#{/static/assets/plugins/notify/jquery.bootstrap-growl.js}"></script>
<!-- AdminLTE App -->
<script type="text/javascript"
th:src="#{/static/assets/dist/js/app.min.js}"></script>
<!-- Angularjs -->
<script th:src="#{/static/assets/js/angular.min.js}"
type="text/javascript"></script>
<!-- Select2 angular -->
<script type="text/javascript"
th:src="#{/static/assets/plugins/select2Angular/select.js}"></script>
<!-- Waiting modal -->
<script
th:src="#{/static/assets/plugins/waiting-modal/waiting-modal.js}"
type="text/javascript"></script>
<script type="text/javascript"
th:src="#{/static/assets/js/fleetAndCar.js}"></script>
</head>
<body class="hold-transition skin-blue sidebar-mini" data-ng-app="myApp">
<input type="hidden" id="role"
th:value="${#authentication.getAuthorities()}">
<div class="wrapper" data-ng-controller="createFleetController"
id="createFleetControllerId">
<!-- Header nd menu fragment -->
<div th:replace="../fragments/dashboard-header :: dashboard-header"></div>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>Fleets Management</h1>
<ol class="breadcrumb">
<li><a th:href="#{/}"><i class="fa fa-dashboard"></i> Home</a></li>
<li class="active">Fleets management</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title">Fleets</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<!-- Fleets table -->
<table id="fleetsTable"
class="table table-bordered table-striped">
<thead>
<tr>
<th>Application</th>
<th>Cubic</th>
<th>Power</th>
<th>Euro class</th>
<th>Engine Type</th>
<th>Traction</th>
<th>Transmission</th>
<th>Managed by</th>
<th>Cars</th>
<th>Add User</th>
<th>Delete</th>
</tr>
</thead>
</table>
<!-- Create two equals button because when I am on desktop I show the text add fleet otherwise the + and the tooltip.
This is need because otherwise the text goes out the button -->
<button id="addFleetButton" type="button"
class="btn btn-primary visible-lg col-lg-1 col-lg-offset-11"
data-toggle="modal" data-target="#addFleetModal">Add
fleet</button>
<button id="addFleetButton" type="button"
class="btn btn-primary hidden-lg col-xs-1 col-xs-offset-11"
data-toggle="modal" data-target="#addFleetModal">
<span class="glyphicon glyphicon-plus" data-toggle="tooltip"
title="Add fleet"></span>
</button>
</div>
</div>
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->
</div>
<!-- Modal to add car -->
<div class="modal" id="addFleetModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title">Fleet parameters</h4>
</div>
<div class="modal-body">
<!-- form start -->
<form novalidate class="simple-form" name="newFleetForm">
<div class="box-body">
<div class="form-group">
<label>Application</label> <input
data-ng-model="newFleet.application" id="application"
type="text" class="form-control" placeholder="Application"
name="application" required>
</div>
<div class="form-group">
<label>Cubic</label> <input id="cubic"
data-ng-model="newFleet.cubic" type="text"
class="form-control" placeholder="Cubic" required>
</div>
<div class="form-group">
<label>Power</label> <input data-ng-model="newFleet.power"
id="power" type="number" min="0" step="1" class="form-control"
placeholder="Power" required>
</div>
<div class="form-group">
<label>Euro class</label> <input
data-ng-model="newFleet.euroClass" id="euroClass" type="text"
class="form-control" placeholder="Euro Class" required>
</div>
<div class="form-group">
<label>Engine type</label> <input
data-ng-model="newFleet.engineType" id="engineType"
type="text" class="form-control" placeholder="Engine type"
required>
</div>
<div class="form-group">
<label>Traction</label> <input
data-ng-model="newFleet.traction" id="traction" type="text"
class="form-control" placeholder="Traction" required>
</div>
<div class="form-group">
<label>Transmission</label> <input
data-ng-model="newFleet.transmission" id="transmission"
type="text" class="form-control" placeholder="Transmission"
required>
</div>
<div class="form-group">
<label>Note </label>(optional)
<textarea data-ng-model="newFleet.note" class="form-control"
rows="3" maxlength="1000"></textarea>
</div>
<div class="form-group" id=existingEcu>
<label>Ecu</label>
<ui-select theme="bootstrap" style="width: 100%;"
data-ng-model="newFleet.ecu" required> <ui-select-match
placeholder="Select ecu">
{{$select.selected.note}}</ui-select-match> <ui-select-choices
repeat="ecu.idEcu as ecu in (ecuList | filter: $select.search) track by ecu.note">
<span data-ng-bind="ecu.note"></span> </ui-select-choices> </ui-select>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left"
data-dismiss="modal">Close</button>
<button data-ng-disabled="newFleetForm.$invalid"
data-ng-click="createFleet(newFleet)" id="createFleetButton"
type="button" class="btn btn-primary">Create fleet</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- Modal delete Fleet -->
<div class="modal" id="deleteFleetModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title">Delete fleet</h4>
</div>
<div class="modal-body">
<div class="box-body">Are you sure? The fleet will be
deleted permanently, you won't be able to recover it.</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left"
data-dismiss="modal">Cancel</button>
<button class="btn btn-danger btn-ok"
data-ng-click="deleteFleet()" id="deleteFleetButton">Delete</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- Modal delete User from Fleet -->
<div class="modal" id="deleteUserFleetModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title">Delete user from fleet</h4>
</div>
<div class="modal-body">
<div class="box-body">
Are you sure to remove <label data-ng-bind="user"></label>
management from fleet <label data-ng-bind="fleetApplication"></label>?
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left"
data-dismiss="modal">Cancel</button>
<button class="btn btn-danger btn-ok"
data-ng-click="deleteUserFleet(user,fleetId)"
id="deleteUserFleetButton">Delete</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- Modal add User from Fleet -->
<div class="modal" id="addUserFleetModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title">Add user to fleet</h4>
</div>
<div class="modal-body">
<div class="box-body">
<div class="form-group" id=fleetUser>
<label>Select user</label>
<ui-select theme="bootstrap" style="width: 100%;"
data-ng-model="username" required> <ui-select-match>
{{$select.selected}}</ui-select-match> <ui-select-choices
repeat="username in (fleetUserList | filter: $select.search) track by username">
<span data-ng-bind="username"></span> </ui-select-choices> </ui-select>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left"
data-dismiss="modal">Cancel</button>
<button class="btn btn-primary btn-ok"
data-ng-click="addUserFleet(username)" id="addUserFleetButton">Add</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
</div>
</body>
</html>
I want to make this page fill out the mobile screen so buttons and text maximizes on this template.
<template name="adminClub">
<div class="container">
<div class="well well-sm">
<h3>{{clubname}}</h3>
<a id="plus" class="btn btn-info btn-lg">
<span class="glyphicon glyphicon-chevron-up"></span>
</a>
<br>
{{occupancy}}%
<input type="text" value="{{visitors}}" id="visitors">
of {{capacity}}
<br>
<a id="minus" class="btn btn-info btn-lg">
<span class="glyphicon glyphicon-chevron-down"></span>
</a>
</div>
</div>
</template>
I would like i to look like this (without zomming)
And not like this.
Now the div seem to fill out to much of the page with. I have installed twbs:bootstrap 3.3.6.
Assuming that you know how to update the <head>...</head> section in your html in meteor, add the following in your head:
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
Also I noticed you're html structure is a bit incorrect for bootstrap. Try something like this and see if you get any luck:
<template name="adminClub">
<div class="container">
<div class="row">
<div class="col-xs-12>
<div class="well well-sm">
<h3>{{clubname}}</h3>
<a id="plus" class="btn btn-info btn-lg">
<span class="glyphicon glyphicon-chevron-up"></span>
</a>
<br>
{{occupancy}}%
<input type="text" value="{{visitors}}" id="visitors">
of {{capacity}}
<br>
<a id="minus" class="btn btn-info btn-lg">
<span class="glyphicon glyphicon-chevron-down"></span>
</a>
</div>
</div>
</div>
</div>
</template>
Change you class="btn btn-info btn-lg" by class="btn btn-large btn-info" and so the entire width of mobile extends
you also can insert query media to set the CSS in mobile mode
Example:
#media (max-width: 767px){
}
Bootstrap
Please refer to the code fragment below. It is a simple navbar.
Unfortunately, the collapse-toggle button appears above the brand (because it breaks the line, behaving like a block), what is unexpected. The expected behavior is that it appears beside. Further, if I try to float it with .navbar-right, it doesn't work. What could it be?
http://jsfiddle.net/X3pVX/
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="container">
<div class="navbar-header">
<button type="button" class="btn btn-default btn-sm navbar-btn" data-toggle="collapse" data-target="#navbar-collapse">
<span class="glyphicon glyphicon-chevron-down"></span>
</button>
<a class="navbar-brand" href="#">Projeto Si</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="navbar-collapse">
<form class="navbar-form form-inline navbar-right">
<div class="input-group" style="max-width: 400px">
<input id="filter" class="form-control input-sm" type="text" placeholder="O que você está procurando?"/>
<span class="input-group-btn">
<button id="clearfilter" type="button" class="btn btn-sm btn-default"><span class="glyphicon glyphicon-search"></button>
</span>
</div>
</form>
</div><!-- /.navbar-collapse -->
</div><!-- /.container -->
</nav>
Hey whats sup? I'm from Brazil too.
You only have the html file?
if yes you need to use css. never use style on html, HTML is for content and CSS for style.
create a css file and put the code below between the head tag.
<head>
<link rel="stylesheet" type="text/css" href="FileName.css" />
</head>
after that choose the class that you want to modify the position and try the code below
.navbar-right {
position:absolute;
left:150px;
}
try different pixels values and see which one works better for you.
If you don't know anything about css i recommend http://www.w3schools.com/
study there just for have a notion.