Changing the theme with jstree 3.0.0 - jstree

I'm trying to change the theme as follows:
I copied the contents of the default folder and copied them into a folder called david
I used replace all in style.css to change instances of .jstree-default with .jstree-david in my editor
I linked to the david stylesheet
I added this code to the core object of the jstree config object
"themes": {
"name": "david",
"dots": true,
"icons": true
}
The tree renders with none of the usual dots and icons and click does not expand the root nodes.
How do you create a theme for this new jstree? The style.css file and associated sprites are different from the version 1 themes I used to work with.
Are there any themes available already created for jstree 3.0.0?
UPDATE:
So used to getting my information from StackOverflow, I was delighted to get help on this issue directly from jstree's author in a very timely manner.

Do your remember include your css file successfully?
I use the following code to change the theme to dark. Hope to help you.
$('#jstree_demo_div').jstree({
'core' : {
"themes": {
"name": "default-dark",
"dots": true,
"icons": true
},
...
<link rel="stylesheet" href="/media/images/jstree_themes/default-dark/style.min.css" />

Related

Is it possible to build chrome extension with any flutter project?

I have never build chrome extension with flutter, i want to try it but i have a question.
Is it possible to build chrome extension with any flutter project ?
According to the article referenced:
Three steps…
Remove non-supported scripts from index.html
Navigate to web/index.html file and remove all the .. tags:
Then only insert the following tag inside the :
<script src="main.dart.js" type="application/javascript"></script>
Set the extension view dimensions
Extensions have a fixed dimension, so you need to explicitly specify the width and height values of the extension view inside the HTML.
Just replace the starting <html> tag with the following:
<html style="height: 600px; width: 350px">
This will set the extension view’s height and width to 600 pixels and 350 pixels respectively.
Make some changes in manifest.json
Navigate to web/manifest.json file and replace the entire content with the following:
{
"name": "QR Code Extension",
"description": "QR Code Extension",
"version": "1.0.0",
"content_security_policy": {
"extension_pages": "script-src 'self' ; object-src 'self'"
},
"action": {
"default_popup": "index.html",
"default_icon": "icons/Icon-192.png"
},
"manifest_version": 3
}
Trying out the extension
With the required changes done, you are ready to build and run it as a Chrome extension.
By default, when you run a Flutter web build using the following command:
flutter build web
It uses the HTML renderer for a mobile browser and CanvasKit renderer for a desktop browser.
To give a little bit of context, Flutter web has support for two types of renderers (according to the Docs):
HTML renderer
Uses a combination of HTML elements, CSS, Canvas elements, and SVG elements. This renderer has a smaller download size.
CanvasKit renderer
This renderer has faster performance with higher widget density (supports operation on pixel level) but adds about 2MB in download size.
But in order to use it as an extension, you have to specifically generate the build only using the HTML renderer. It can be done using the following command:
flutter build web --web-renderer html
🛑 Don’t run the command yet!
Finally, you have to use the --csp flag in order to disable the dynamic generation of code in the generated output which is necessary to satisfy CSP restrictions.
🟢 RUN this command:
flutter build web --web-renderer html --csp
You will find the generated files inside build/web folder present in your root Flutter project directory.
I haven't tried it but it might be possible to do so with flutter web. Just few changes here and there and it should be ready.
But there must be some limitations too.

Tinymce UI issues and version

I have just started with Tinymce and am trying to build rich text editor on my web page using self-hosted package. After integration, setting the Theme to Advanced and Plugin to autoresize, I see the editor as -
Tinymce editor on web page (UI editor options looks distorted and not properly formatted)
I was expecting it to be something similar to what I see on Tinymce docs -
Tinymce editor on docs
Is this a Tinymce version specific or browser related issue? I tried downloading the latest version 5.8.2 (Development & Production), however the Themes I see are Silver & Mobile while it should be Simple & Advanced as I see in the official Tinymce documentations.
Also if I try to add multiple Plugins or Themes to my deployment as guided here, it doesn't reflect on my web page.
These is how I have initialized my Tinymce -
<script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
<script>
$(document).ready(function(){
if ($("#Test").length) {
tinyMCE.init({
// General options
mode : "exact",
elements : "Test",
theme : "advanced",
width : 800,
plugins : "autoresize",
content_style: " div, p { font-size: 14px; }"
});
}
});
</script>
It looks like you are using version 3 of TinyMCE (9+ years old). Upgrade to version 5 and it should be a lot better.

why does the main app scss file in ionic 4 not work?

I've been working on an ionic app, I've come to do some styling on it and I'm having issues with app.scss.
According to the ionic documents I should be able to use app.scss for app-wide styles such as the toolbar etc. but nothing happens when I try to style anything from this file, it's like it's not being included in the build?
The initial project was done by creating the app in CLI with the sidebar menu option as the template and all the scss files work fine in the individual components.
Any idea why the app.scss file isn't working? I've inspected elements I've tried to style and they are not being picked up at all.
An example:
ion-title {
background: red;
}
this doesn't work, the toolbar background doesn't change, but it does through chrome inspector.
I have tried this in global.scss too and still nothing, funny thing is if I apply a display:none to all elements it works:
* {
display: none;
}
it just doesn't seem to want to style individual elements like the "ion-title"
UPDATE:
There seems to be a bug in ionic 4, the styleUrls won't accept me adding ../app.scss , it throws an error, but I can include ../app.css so I'm just going to auto-compile the scss to css.
I can then include the app.css file in each component and it's working!
In Ionic 4, global styles are saved by default in src/app/global.scss
If this is an Angular project that you are converting from an Ionic 3 template, you must add a reference to your global scss file in your angular.json file in under projects/app/architect/build/styles, like below
"styles": [
{
"input": "src/theme/variables.scss"
},
{
"input": "src/global.scss"
}
],
This is a change from Ionic 3 where it used to be in src/app/app.scss. If you created a project in Ionic 3 or earlier, you must move your styles into a new global.scss for them to be applied throughout the whole app
There seems to be a bug in ionic 4, the styleUrls won't accept me adding ../app.scss , it throws an error, but I can include ../app.css so I'm just going to auto-compile the scss to css.
I can then include the app.css file in each component and it's working!
You must include the path of app.scss file in your app.component.ts like this
styleUrls: ['app.scss']
Then you will be able to use your scss file

Custom icon of status bar item in vscode extensions

The documentation https://code.visualstudio.com/docs/extensionAPI/vscode-api says that icon-name can be taken from the octicon, is it possible to insert icon that is not an octicon?
No, you can't, at least, not yet.
There is an open issue asking to support more icons, but no Milestone defined.
You can add your custom icon.
https://glyphter.com/
add your 5 X 5 svg logo here in section A, then Download the font.
in vscode's package.json
"contributes": {
"icons": {
"custom-icon-id": {
"description": "custom descr",
"default": {
"fontPath": "./customicon.woff", //woff file
"fontCharacter": "\\41" //you added svg logo in section A
}
}}

MapBox studio, style in edit mode does not display the map image

I want to create a map starting from the basic template but when I open the template in the editor I do not see the map.Even in preview mode the map does not appear
In red is where it should appear the map or am I doing something wrong?
I downloaded json file from mapbox has more than 800 lines of code, it seems that is not empty.
I created a new map from street template and still not showing nothing in edit mode
I would recommend deleting that style and creating a new one based on the style Basic. I just attempted what you described and it works fine.
To create a new Style in Mapbox Studio. You can also follow the Get started with Mapbox Studio docs.
Login into Studio
Home > New Style
Pick a template, I would recommend starting with Streets
To verify, you created a new style based on Basic and not on the Style Empty, correct? The screen capture you have above looks like Empty. You can download your Style to compare.
This is what an Empty style looks like. Empty will have no map, giving you the power to build your own map literally from the ground up.
{
"version": 8,
"name": "Empty",
"metadata": {
"mapbox:autocomposite": true,
"mapbox:type": "template"
},
"sources": {
},
"glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf",
"layers": [
{
"id": "background",
"type": "background",
"interactive": true,
"paint": {
"background-color": "rgba(0,0,0,0)"
}
}
]
}
I was able to resolve this issue by changing out my video card. (I worked with Mapbox support for a while but they were unable to help.) On a whim I swapped out my BFGE Tech GeForce GTS 250 for a NVIDIA GeForce GTX 670 and it started working.
I suspected a hardware issue as the problem persisted after upgrading to Windows 10.