I'm using the ng2-pdfjs-viewer v13.2.2 package in an Angular 10.2.4 project.
I would like to replace in the assets/pdfjs folder, the pdfjs-dist version of 2.2.171 (project original), with version 2.10.377.
The reason is because the most current version shows fewer errors in SonarQuebe.
When I do the replacement, the component continues to work normally, however, the options to disable buttons are no longer working. With the original version it worked correctly. I'm trying to disable the openFile button.
<div style="height: 1600px">
<ng2-pdfjs-viewer
#pdfViewer
*ngIf="pdfPronto"
[pdfSrc]="pdf"
download="true"
openFile="false"
print="false"
find="true"
fullScreen="false"
showSpinner="true"
>
</ng2-pdfjs-viewer>
</div>
Any tips on what I can change to make it work?
Variable
From the controller I sent:
model.addAttribute("theme", "holmes");
html
<!--<p th:text="${'themes/' + theme + '/general/footer::footer(theme=' + theme +')'}">test</p>-->
<footer th:replace="${'themes/' + theme + '/general/footer::footer(theme=' + theme +')'}">Footer</footer>
Exception
org.thymeleaf.exceptions.TemplateInputException: Error resolving template [${'themes/' + theme + '/general/footer], template might not exist or might not be accessible by any of the configured Template Resolvers (template: "themes/holmes/posts/postList" - line 25, col 9)
Proof that the commented expression works
Problem
The commented out expression works. But the uncommented one blows up.
To the best of my ability I understand that the compiler sees a string rather than an expression here.
I am keen to understand:
What the difference is between the commented and uncommented lines.
How to write the replacement expression correctly.
I think you are very close. This works for me:
<footer th:replace="'themes/' + ${theme} + '/general/footer' :: footer(theme=${theme})">Footer</footer>
The reason this works is (probably) because of the way the fragment specification syntax is evaluated:
templatename::selector
Each part on either side of the :: needs to be handled as a separate component. Putting the :: in the string (as in your example) misleads the Thymeleaf renderer. I asssume it tries to find a template whose name is the entire string (including the ::) and the selector part is lost.
I have a MediaWiki installation (1.23) with the Scribunto extension and Module:Listen. I try to invoke this module from an article like so:
{{Listen
|filename = Noise.ogg
|title = Noise
|description = Some noise
}}
This generates the little infobox, but the embedded sound player itself does not appear. I looked at the generated HTML, and the module is just making a second ordinary href to the file:
<div class="haudio">
<div style="padding:2px 0;">Noise</div>
<div style="padding-right:4px;">File:Noise.ogg</div>
<div class="description" style="padding:2px 0 0 0;">Some noise</div></div>
Rather than the second href to the file, I'd expect to see a or similar. Am I missing some template or Lua module?
You need to have TimedMediaHandler installed for the sound player to show up!
I am using Asp.net MVC 4 bundler to bundle and minify my Css files.
YSlow is showing this error below
/* Minification failed. Returning unminified contents.
(1442,26): run-time error CSS1019: Unexpected token, found ':'
(1442,26): run-time error CSS1042: Expected function, found ':'
(1442,26): run-time error CSS1062: Expected semicolon or closing curly-brace, found ':'
*/
This is my bundle code,
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/site.css",
"~/Content/fullcalendar.css",
"~/Content/jquery.dropdown.css",
"~/Content/jquery.tagit.css",
"~/Content/tipsy.css"
));
Now how will i find out which css file is causing the problem ? How can i debug to find the line that is causing the problem ? site.css is the only css file that i wrote.
In case someone is still dealing with problems like this.
In the example above: (1442,26) 1442 is the line number and 26 is the character offset. HOWEVER, for this to be exact, you need remove the whole comment where this error is indicated:
/* Minification failed. Returning unminified contents.
(1442,26): run-time error CSS1019: Unexpected token, found ':'
(1442,26): run-time error CSS1042: Expected function, found ':'
(1442,26): run-time error CSS1062: Expected semicolon or closing curly-brace, found ':'
*/
Here's two possible causes:
The invalid CSS files that should be validated before bundling. here
is W3C CSS validation service to meet this purpose.
Also considering that Microsoft Optimizer reads content of target
resources for minification process, so by using some special phrases
like # sourceMappingURL=jquery.min.map in a JavaScript file or
#charset "UTF-8"; in a styleSheet file, the Minification will be
failed again. So try to remove or commentize them.
Note that by default, Bundling process can't build relative path of image resources in css or js files.
Relative Image Path Solution:
You can use the same path as bundling path like:
bundles.Add(new StyleBundle("~/Content/css/jquery-ui/bundle")
.Include("~/Content/css/jquery-ui/*.css"));
Where you define the bundle on the same path as the source files that made up the bundle, the relative path of image resources will still work( i.e. /bundle can be any name you like).
Or using new CssRewriteUrlTransform() as second parameter like:
bundles.Add(new StyleBundle("~/Content/css/bundle")
.Include("~/Content/css/*.css", new CssRewriteUrlTransform()));
filter: alpha(opacity: 0); was the line that was causing the issue. After i removed this line
i was able to minify the css file without any issue,
We're on Rails (3.0.3 / 1.9) using Jammit for static compression and all the other front-end goodies it provides.
I'm trying to work Javscript templates in to replace some ugly front-end code, but it looks like the default JST compiler can't handle Windows line breaks:
assets.yml file:
embed_assets: on
javascripts:
plugins:
- app/views/**/*.jst
When I have _topicPreview.jst all on one line it compiles fine:
<div class='TopicPreview <%= typeName %>'><div class='Title'> <%= summary %> </div><div class='Meta'> <span class='LastUpdate'> <%= updatedAt %> </span> <span class='PostCount'> | <%= postsCount %> Posts | </span> <span class='LikeCount'> <%= likesCount %> Likes </span> </div></div>
The page loads and I have the JST._topicPreview([JSON version of topic]) method available. Beautiful.
Half the appeal of JST is the readability / maintainability though, so I would like my JST to have proper formatting. As soon as I add line breaks into the JST file the page throws Uncaught SyntaxError: Unexpected Token ILLEGAL in window.JST['_topicPreview'] = template('...[the escaped JST file]...')
In the code trace I can see that it parses and escapes single quotes, so I was surprised it couldn't handle the line breaks.
Has anyone else encountered this problem?
Is there a cleaner fix than hacking some extra string replaces into the template generation code?
Meta:
I'm pretty new to javascript templates, but should they have their own StackOverflow tag?
Edit
Looks like this is a known issue with a pending fix to be merged into the gem.
Windows line breaks in Jammit JST compiler
Fix has been added to the gem. Windows developers rejoice.