Is the purpose to place web components under the web folder somewhere, or under the lib folder?
I'm asking because I'm unsure and it's not mentioned as far as I can tell.
Put your components under the lib directory.
lib/
control1.html
control2.html
control3.html
Let's say you configure your pubspec.yaml file and name your package 'my_controls'.
name: my_controls
dependencies:
html5lib: '>=0.3.1+2'
web_ui: '>=0.3.2'
Since your project now defines a package, you can reference files in your lib directory as:
<link rel="components" href="packages/my_controls/control1.html">
<link rel="components" href="packages/my_controls/control2.html">
<link rel="components" href="packages/my_controls/control3.html">
You can point to components:
<link rel="components" href="component/ui/login.html">
in which case your components are in web/component/
and in web/component/ui/
you have the login.html file
Related
I am using the ruby Gem cssbundling-rails and dart-sass to process Sass in a Rails 7 app (and I am fairly new to Rails).
In the package.json file I define the build:css script:
"build:css": "sass ./app/assets/stylesheets/application.scss ./app/assets/builds/application.css --no-source-map --load-path=. --load-path=./node_modules --load-path=./node_modules/#rpf/sauce --load-path=app/assets/stylesheets/"
This appears to be working; I see the results of several Sass files bundled and processed into one CSS file: app/builds/application.css.
However I cannot see how to add this file to my page. We use Slim so I include the line
= stylesheet_link_tag 'application'
in the app/views/components/_head.html.slim file. That results in this fragment in the final HTML:
<link rel="stylesheet" href="/assets/application-e0cf9d8fcb18bf7f909d8d91a5e78499f82ac29523d475bf3a9ab265d5e2b451.css" />
If I load that file (application-e0cf9d8fcb18bf7f909d8d91a5e78499f82ac29523d475bf3a9ab265d5e2b451.css) into my browser I see it is an empty manifest file which starts
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
and has no files listed below.
What am I missing? How do I load the CSS that was bundled and processed from Sass files into the app/builds/application.css file into my Slim page?
A simple fix is to add
link rel="stylesheet" href="/assets/application.css" type="text/css"
to app/views/components/_head.html.slim instead.
I am using Grails 2.5.6. I am editing spring-security-plugin.
My spring-security-plugin version is 2.0-RC5. I need to link a
javascript file in my view. But it shows file not found. Here are my attepmts below:
in my view >>>
<head>
<title>Royal Page</title>
<link href="${resource(dir: 'css', file: 'common.css')}" type="text/css" rel="stylesheet">
my directory structure >>>
From this link, it says :
Once an application is cached, it remains cached until one of the
following happens:
The user clears the browser's cache
The manifest file is modified (see tip below)
The application cache is programmatically updated
Following the instruction from the internet, for the manifest file I use a version number. When I change the content of the index.html with 01.jpg to 02.jpg - I also changed the version number of the manifest file.
With the steps above, it works within my Win7 Wamp Server Local Host. But once I do the same steps in my web server (after uploading the file to the web server) - it doesn't work.
Can somebody please help me what did I do wrong ?
Document was loaded from Application Cache with manifest http://www.example.com/test/offline.appcache
Application Cache Checking event
Navigated to http://www.example.com/test/
Application Cache NoUpdate event
Above is from the Chrome browser console after I modified the version number of the manifest file (from #01 to #02) and the jpg file (from 01.jpg to 02.jpg) in the index.html file.
The offline.appcache CACHE file list no change, except the version number :
CACHE MANIFEST
# 2017-03-25 version#01
uploads/event.jpg
uploads/baby.jpg
/favicon.ico
NETWORK:
indexPHP.php
The index.html file :
<!DOCTYPE html>
<html manifest="offline.appcache">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style></style>
</head>
<body>
<img src="uploads/01.jpg">
</body>
</html>
<script type="text/javascript">
function onUpdateReady() {
alert("offline files will be updated");
window.location.reload();
}
window.applicationCache.addEventListener('updateready', onUpdateReady);
if(window.applicationCache.status === window.applicationCache.UPDATEREADY) {
onUpdateReady();}
</script>
the .htaccess file :
AddType text/cache-manifest .appcache
the "tree" :
example.com/.htaccess
example.com/favicon.ico
example.com/test/index.html
example.com/test/offline.appcache
example.com/test/uploads/01.jpg
example.com/test/uploads/02.jpg
Thank you in advanced.
I'm trying to do the example from the Manning "Grails in Action": the gsp's
<g:javascript library="jquery" />
is becoming
<script src="/qotd/js/jquery/jquery-1.11.1.js" type="text/javascript" library="jquery"></script>
but that URL doesn't work. BuildConfig.groovy has
plugins {
//...
runtime ":jquery:1.11.1"
I might have missed a step in typing things in, or it might be a 2.3->2.4 Asset issue?
I'm trying to configure CometD in my web application. This web application is the client of CometD, it uses JSF 2.0, primefaces 3.3.1 and run on glassfish. In this application this global var is undefined:
var cometd = $.cometd;
Probably the source of my problem is the linkage of javascript libraries:
<script type="text/javascript" src="${pageContext.request.contextPath}/jquery/jquery-1.7.2.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jquery/json2.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/org/cometd.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jquery/jquery.cometd.js"></script>
I know this is JSP way to import javascript files, but I simply don't know which path to use for h:outputScript...
PS. I just added this dependency for this module:
<dependency>
<groupId>org.cometd.javascript</groupId>
<artifactId>cometd-javascript-jquery</artifactId>
<version>2.4.3</version>
<type>war</type>
</dependency>
It was my fault, I didn't see that maven archetype created all javascripts files in a directory of the project...