How can I override core misc js in drupal 8 - drupal-8

I have a problem with dialog in drupal 8, and I found a place that make me stuck.
There is a code in this file not work as my expected. Please see the image
I just want to do the simple thing is comment the line out like below:
I can't do this because this is core file. So I want to override this file or this function only.
I trying to use libraries-override but no hope. This is my code, I am newbie so this code may have mistake or wrong.
"capital" is my theme, not module
below is my theme structure:
Please help... I googled this issue for long time.

Better way would be:
libraries-override:
core/drupal.dialog: captial/dialog

I have solved it by myself:
Step 1: clone core js to your theme js like this:
Step 2: modify template library ([your-theme-name].libraries.yml)
Declare core file your need to add to your theme
Step 3: disable core files using your theme info file ([your-theme-name].info.yml) and add your files as library:
That's it :)
Any better idea? please suggest me more.

Related

Adding preamble.tex and/or modifying css

Thanks for making papaja. It's really terrific!
I just submitted my first journal article using it and ran into problems. The layout staff don't know what to do with the code chunks and listings that are fine in single-column, full page format, but not in their 2-column format. I'm trying use the class 'jou' option to make 2 columns, but I can't figure out how to control the size of code and listing fonts (possibly by modifying the css, as recommended here), or how to using the latex package 'listings' to set listings to wrap (as recommended here).
I'd be grateful for any advice, and my apologies if I've missed how one might do this in the documentation.
If it's only about getting the listings package to work, you can modify the YAML header that it looks similar to the following:
documentclass : "apa6"
classoption : "jou"
output :
papaja::apa6_pdf:
pandoc_args: --listings
header-includes:
- \lstset{breaklines=true}
However, note that using automatic line breaks will most likely break the code at some points. Therefore, it is worthwhile to consider alternatives: For instance, you could try to use a code style that uses more line breaks. The styler package and add-in might be helpful accomplishing this: https://styler.r-lib.org/

How to highlight code in hbs template?

I want to introduce into my project some code to be highlighted on certain pages (like index.hbs) I've searched for libraries that can do this and found tools like highlight.js, but I was unable to use it in my ember project. Can anyone explain how to import a custom library like highlight.js or can someone give me a recomandation for a tool. I've tried to use this tool: ember-cli-eg-code-highlight, but it is not specified how to use it. Ok I have installed it, pasted the {{highlight-js code=file lang=language hasLineNumbers=hasLineNumbers}} in my index.hbs, but it does not work. Also the ENV.emberHighlightJs: { style: 'arta' };I have no ideea where to put it. Tried to put it inember-cli-build.js but it is not working.
I have found also markdown-code-highlighting. But I am lost at this step: "In your Brocfile you'll need to import the CSS styling you want for the highlighter. " So where exactly is my brocfile in my ember project?
Did you restart ember server ?
You can find example of using ember-cli-eg-code-highlight here: https://github.com/EmberGrep/ember-cli-eg-code-highlight/blob/master/tests/dummy/app/templates/application.hbs
But it looks like addon is buggy. So it worth to check this PR https://github.com/EmberGrep/ember-cli-eg-code-highlight/pull/9
P.S. about brocfile -- now it names as ember-cli-build.js at the root of project

Webpack watch not working on Webstorm on Windows?

So basically I have a project using Webpack, if I build using Webpack -w, editing the file with another editor will trigger the watch; however if I edit the file using Webstorm, nothing will happen.
I have came across this post, which seems I'm not the only one, however that solution is for Ubuntu, so I was wondering if there is anything similar for Windows?
Thanks
Seems Webpack watch doesn't work if the file is not saved directly. Please try turning 'Safe write' option ( Settings | Appearance & Behavior | System Settings | Use "safe write" (save changes to temporary file first)) off.
In 2020.* the option name is Back up files before saving
Also make sure you use Node's path construction instead of slashes. Example:
entry: {
'MyPackage': path.join(__dirname, 'modules', 'PkgEntry.js'),
...
instead of:
entry: {
'MyPackage': '\\modules\\PkgEntry.js'),
...
Had the same issue today. And accepted answer didn't help me.
Check this page https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit and try to increase your Inotify Watches Limit. Helped me.

Theming sencha touch list

I want to change the color of the headers in a grouped list. For the moment I've got the default theme. I think I have to use something like "$list-header-bg-color" but :
WHERE can I use it ? I tried to write something like :
$list-header-bg-color = '#CCC'
directly at the end of the "sencha-touch.css" file but it doesn't work at all ... Somebody can explain me how does it works ? (with a little example please). Thanks in advance
First you need to install ruby
then install ruby gems
then install compass
then open your application *.scss file (should be in resources/sass/)
after the line
#import 'sencha-touch/default/all';
include your line
$list-header-bg-color = '#CCC'
Note that by default the value of this var is
$list-header-bg-color: transparentize(saturate($base-color, 10%), .25);
Maybe you can change the base-color to have a more "unified" look (depending on what you want to do ...)
then compile your scss file
compass compile
Now your theme should have been compiled to your app.css and your new color is good :)
For more detail check this article I wrote not long ago : sass-for-sencha-touch-2-windows-7
Sencha is using SASS for theming. So that line should go in the sencha-touch.scss file. Then you should compile that file with compass to get a css file. See this videos:
http://vimeo.com/26506883
http://vimeo.com/17879651
slides from presentation http://www.slideshare.net/senchainc/theming-sencha-touch
reference docs http://dev.sencha.com/deploy/touch/docs/theme/
Check this also http://www.sencha.com/blog/sencha-touch-theme-contest-winners-announced/

Please advice the folder structure for Handling multiple sites in Django

alt text http://www.freeimagehosting.net/image.php?387990357b.jpg
Please see the folder structure image in the above url mentioned please advice which structure would be best suited for better code managibility. If the above image is not gettign please use this url http://www.freeimagehosting.net/image.php?387990357b.jpg
As far as automated deployment goes, It would appear to me that your second option would be better... that will allow you to "pick up" either site 1 or site 2 all at once and drop it anywhere you want.
I use virtualenv to manage multiple sites, which is basically an extension of the second option: each with their own code base and settings file and modules.
this looks good: http://www.mail-archive.com/django-users#googlegroups.com/msg75840.html