I was curious how I can add this type of textarea to my CSHTML page (MVC .NetCore)
You can use Summernote.
I am currently using one in my project
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/summernote#0.8.18/dist/summernote-lite.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/summernote#0.8.18/dist/summernote-lite.min.js"></script>
</head>
<body>
<textarea asp-for="Description" id="summernote"></textarea>
<script>
$('#summernote').summernote({
placeholder: 'Description goes here....',
height:'25vh',
toolbar: [
['style', ['style']],
['font', ['bold', 'underline', 'clear']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['table', ['table']],
['insert', ['link', 'picture']],
['view', ['fullscreen', 'codeview', 'help']]
]
});
</script>
</body>
</html>
I've build an webcomponent with Polymer, and it works on all browsers except for IE11.
I've tried everything but can't figure out why it doesn't work.
Attached is the code, could you help me figure out why?
It remains at the loading.
<!DOCTYPE html><html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1, initial scale=1, user-scalable=yes">
<title>wc test</title>
<link rel="manifest" href="/manifest.json">
<script src="/node_modules/#webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script>if(!window.customElements){document.write("<!--")}</script>
<script type="text/javascript" src="/node_modules/#webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"></script>
<!-- do not remove -->
<script src="/node_modules/#webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script type="module" src="/src/klantenvertellen-app/klantenvertellen-app.js"></script>
</head>
<body>
<klantenvertellen-app>Loading...</klantenvertellen-app>
</body>
</html>
I have build for popup on a page (Inspirations page in this case). This page is a directive included in main 'product_chat.html' which is connected to 'product_chat.js'. All these files are initiated from index.html
index.html
<!DOCTYPE html>
<html ng-app="myApp" lang="en" class="no-js" xmlns="http://www.w3.org/1999/html"> <!--<![endif]-->
<head data-ng-app="app">
<meta charset="utf-8">
<meta name="verify-admitad" content="ed499e6bac"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="wot-verification" content="591de88d2ae5d58564c7"/>
<title ng-bind="title">"Online shopping site | Women fashion | Personal styling - Selekt"</title>
<link rel="icon" href="/pics/favicon.png">
<meta name="description" content="{{meta_desc}}">
<meta itemprop="description" content="Application wide description for Schema.org (Google+ uses this)">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href='https://fonts.googleapis.com/css?family=Montserrat:400,700,200,300' rel='stylesheet' type='text/css'>
<link rel="canonical" href="{{canonical_url}}">
<link rel="stylesheet" href="bower_components/html5-boilerplate/dist/css/normalize.css">
<link rel="stylesheet" href="bower_components/html5-boilerplate/dist/css/main.css">
<link rel="stylesheet" href="bower_components/dist/angular-typewrite.css"/>
<link rel="stylesheet" href="css/isteven-multi-select.css"/>
<link rel="stylesheet" href="css/app.css">
<link rel="stylesheet" href="css/select-css.css">
<link rel="stylesheet" href="css/style_find.css">
<link rel="stylesheet" href="css/select-css-compact.css">
<link rel="stylesheet" href="css/searchSelect.css">
<link rel="stylesheet" href="css/style_load.css">
<link rel="stylesheet" href="css/popup.css">
<!--<script src="bower_components/html5-boilerplate/dist/js/vendor/modernizr-2.8.3.min.js"></script>-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-select.css">
<link rel="stylesheet" href="bower_components/ngModal/ng-model.css">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-92766347-1', 'auto');
ga('send', 'pageview');
</script>
<style>
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
display: none !important;
}
.main_banner {
background-image: url('pics/banner.png');
background-repeat: no-repeat;
min-height: 100vh;
display: block;
overflow-x: hidden;
background-size: 1600px 900px;
}
</style>
<base href="/"/>
</head>
<body class="main_banner">
<div class="">
<div ng-view>
</div>
</div>
<!--In production use:-->
<!--
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.9/angular.min.js"></script>
-->
<script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.min.js"></script>
<script src="node_modules/socket.io/socket.io.js"></script>
<!--<script src="bower_components/socket.io-client/socket.io.js"></script>-->
<!--<script src="bower_components/angular-socket-io/socket.js"></script>-->
<script src="js/angular-searchAndSelect.js"></script>
<script src="product-app-services/app-services.js"></script>
<script src="publish/wedding-dresses-for-women/product-chat.js"></script>
<script src="publish/home/product-chat.js"></script>
<script src="publish/search/product-chat.js"></script>
<script src="publish/find/product-chat.js"></script>
<script src="app-services/app.module.js"></script>
<script src="app.js"></script>
<script src="bower_components/angular-typewrite/dist/angular-typewrite.js"></script>
<!--//custom dialog-->
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ngStorage/0.3.6/ngStorage.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="bower_components/bootbox/bootbox.js"></script>
<script src="bower_components/ngBootbox/dist/ngBootbox.min.js"></script>
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
</body>
</html>
product_chat.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Private Chat Application with Node.js, Socket.IO and AngularJS</title>
<meta name="generator" content="Bootply">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="css/style_find.css">
</head>
<body cz-shortcut-listen="true" style="background: white">
<div id="main_page" ng-show="show_page" scroll >
<nav_header></nav_header>
<div>
<div>
<inspirations ng-if="inspirations_dir"; ng-init="myDialog()"></inspirations>
</div>
</div>
</div>
</body>
</html>
in the above code, I am calling popup function in 'inspirations' tag
Here is my product_chat.js file (Only relevant part of the code is attached)
var app = angular.module("WeddingDressesForWomen", ['ui.bootstrap']);
app.controller("WeddingDressesForWomen", ["$http","$rootScope", '$scope', '$window', 'socket', "$location", "$anchorScroll", "$timeout", '$routeParams', 'title', 'userService', '$filter', '$document', '$localStorage','$uibModal',
function ($http,$rootScope, $scope, $window, socket, $location, $anchorScroll, $timeout, $routeParams, title, userService, $filter, $document, $localStorage,$uibModal) {
$scope.myDialog = function () {
$uibModal.open({
templateUrl: 'template/popup.html',
backdrop: 'static',
windowClass: 'modal',
size: 'lg',
controller: function ($scope, $uibModalInstance) {
$scope.cancel = function () {
$uibModalInstance.dismiss();
};
}
});
};
}]);
popup.html template
<div class="modal-header">
<h3 class="modal-title">Note</h3>
</div>
<div class="modal-body">
Selekt will be functionally live with Women's Fashion by 10th May and Men's Fashion by 30th May. It is currently in Beta phase.
</div>
<div class="modal-footer">
<button class="btn btn-warning" type="button" style="background-color:#337ab7; border-color:#2e6da4"
ng-click="cancel()">Okay</button>
</div>
I can't comment on this because of my reputation! But do you minify the javascript? I can see you've used implicit dependency injection for $uibModalInstance in the controller - you should be using the property annotation as well, when you declare the controllers dependencies for $uibModalInstance otherwise the code will be broken when the javascript is minified.
Also for the bootstrap library. You can log the service to the console.. i.e console.log($nameOfService)... Are you not able to download the bootstrap javascript and add it to the project?
I'm working on a boilerplate with 3 fallbacks: jQuery, Bootstrap.js and Bootstrap.css. The first 2 are working fine, but I can't make the css fallback work properly (I'm using this reference: Should I use Bootstrap from CDN or make a copy on my server?)
Here's the markup:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title></title>
<meta name="description" content="" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/{{BOOTSTRAP_VERSION}}/css/bootstrap.min.css" rel="stylesheet" integrity="{{BOOTSTRAP_SRI_HASH}}" crossorigin="anonymous">
<link rel="stylesheet" href="css/main.min.css" />
</head>
<body>
<h1>Hello World!</h1>
</body>
<script src="https://code.jquery.com/jquery-{{JQUERY_VERSION}}.min.js" integrity="{{JQUERY_SRI_HASH}}" crossorigin="anonymous"></script>
<script>
window.jQuery || document.write('<script src="js/vendor/jquery/dist/jquery/jquery.min.js"><\/script>')
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/{{BOOTSTRAP_VERSION}}/js/bootstrap.min.js" integrity="{{BOOTSTRAP_SRI_HASH}}" crossorigin="anonymous"></script>
<div class="hidden" id="bootstrapCssTest"></div>
<script>
if (typeof($.fn.modal) === 'undefined') {
document.write('<script src="/js/vendor/bootstrap/dist/js/bootstrap.min.js"><\/script>');
}
</script>
<script>
$(function() {
if ($('#bootstrapCssTest').is('visible')) {
$('head').prepend('<link rel="stylesheet" href="/js/vendor/bootstrap/dist/css/bootstrap.min.css">');
}
});
</script>
<script src="js/bundle.min.js"></script>
</html>
You mistyped the selector. You need :visible, not visible
$(function() {
if ($('#bootstrapCssTest').is(':visible')) {
$('head').prepend('<link rel="stylesheet" href="/js/vendor/bootstrap/dist/css/bootstrap.min.css">');
}
})
I am trying to load my external style sheet . It is loading but the style is being overrided by some other file.
How can i load my styles using ec
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Required meta tags always come first -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" integrity="sha384-y3tfxAZXuh4HwSYylfB+J125MxIs6mR5FOHamPBG064zB+AFeWH94NdvaCBm8qnd" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="css/normalize.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<body>
<h1>Hello, world!</h1>
<button type="button" class="btn btn-primary">Primary</button>
<!-- jQuery first, then Bootstrap JS. -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/js/bootstrap.min.js" integrity="sha384-vZ2WRJMwsjRMW/8U7i6PWi6AlO1L79snBrmgiDpgIWJ82z8eA5lenwvxbMV1PAh7" crossorigin="anonymous"></script>
</body>
</html>
Try adding !important attribute to css rule you are trying to implement. It will force your rules to the matched set of element or classes!