How to change the icon of NWJS APP on taskbar? - javascript

Ive tried 64, 32px, 24px, 16px FAVICON.png in the same DIR as the manifest file. No luck. I also tried and ICO with ever 32bit size.
package.json
{
"main": "INDEX.html",
"name": "cacluclator",
"description": "NWJS SMART CALCULATOR",
"version": "00.00.00",
"keywords": [ "SMART CALCULATOR", "INSECURITY" ],
"window": {
"title": "SMART CALCULATOR",
"icon": "FAVICON 32.png",
"frame": false,
"toolbar": true,
"transparent": true,
"position": "center",
"height": 500,
"min_height": 500,
"max_height": 500,
"width": 400,
"min_width": 400,
"max_width": 400
},
"webkit": {
"plugin": true
}
}

Related

Joined member avatar displayed in thumbnail of embed

so i tried User Avatar shows up in Thumbnail here's my code
if (generalChannel) {
await lib.discord.channels['#0.0.3'].messages.create({
channel_id: generalChannel.id,
"content": "",
"tts": false,
"embed": {
"type": "rich",
"title": `Rage Of Destiny`,
"description": `<#!${event.user.id}> Welcome to the Official Rage Of Destiny Discord Server! \n\nWe hope you enjoy your stay\n\nRemember to read #rules unless you wan't Thordin to punish you 😜`,
"color": 0xff2200,
"image": {
"url": `https://media.discordapp.net/attachments/854601844905738260/866527689720070154/welcome-left.jpeg`,
"height": 0,
"width": 0
},
"thumbnail": {
"url": `(message.author.avatarURL())`,
"height": 0,
"width": 0
}
}
});
}
};
but this is not working, did try to search about it but nothing
"thumbnail": {
"url": `(message.author.avatarURL())`,
"height": 0,
"width": 0
}

What is the purpose of assigning an object's property to itself? foo.bar = foo.bar

My media host is using JSONP to embed videos. I embed this script, along with a few others, in order to embed videos. My understanding is that it's using JSONP in order to overcome CORS issues.
What I do not understand is the last line of the script.
window['wistiajsonp-/embed/medias/8up1lc9606.jsonp'] = window['wistiajsonp-/embed/medias/8up1lc9606.jsonp'];
window['wistiajsonp-/embed/medias/8up1lc9606.jsonp'] = {
"media": {
"assets": [{
"type": "original",
"slug": "original",
"display_name": "Original file",
"width": 1920,
"height": 1080,
"ext": "mp4",
"size": 109515791,
"bitrate": 16127,
"public": true,
"status": 2,
"progress": 1.0,
"url": "https://embed-ssl.wistia.com/deliveries/9b53a11c8a871733aadd479d26a10d4555de2d66.bin",
"created_at": 1522785172
}, {
"type": "still_image",
"slug": "still_image_1920x1080",
"display_name": "Image",
"width": 1920,
"height": 1080,
"ext": "jpg",
"size": 216848,
"bitrate": 0,
"public": true,
"status": 2,
"progress": 1.0,
"url": "https://embed-ssl.wistia.com/deliveries/bf2cc0bf9de369545df9c9fa8be8371ab8b12f56.bin",
"created_at": 1522785744
}],
"options": {}
};
window['wistiajsonp-/embed/medias/8up1lc9606.jsonp'] = window['wistiajsonp-/embed/medias/8up1lc9606.jsonp'];
(Redacted for the sake of brevity)
Regarding the linked question: I am not talking about Swift; I am talking about JavaScript. Secondly, what I'm asking is directed at the purpose, not the implementation of such "self-assignment".

Enabling "maximize" button using NWJS

I'm developping a desktop app using NWJS. I have a problem when I try to maximize the window. The button appears disabled, so I can`t maximize the window, only let me closing and minimizing the window.
Thats my package.json:
{
"name": "APP",
"main": "index.html",
"icon": "icon.png",
"version": "0.0.1",
"window": {
"title": "APP",
"icon": "icon.png",
"toolbar": false,
"resizable": true,
"frame": true,
"fullscreen": false,
"width": 1280,
"height": 1024,
"min_width": 360,
"min_height": 640,
"max_width": 1920,
"max_height": 1080,
"position": "center"
}
}
Anyone could help me? It was grateful. Thanks!
When your app starts do something like this...
var MaxWin=require('nw.gui').Window.get();
MaxWin.setMaximumSize(0,screen.availHeight);
And later use a couple of icons or buttons to maximize/minimize like this...
<input type="button" onclick="MaxWin.minimize();" value="Minimize">
<input type="button" onclick="MaxWin.maximize();" value="Maximize">

node-webkit app package creates nw.js empty screen

I have created the app using node-webkit . But when i click on gte.exe it giving nw.js empty scree.
my JSON file is:
{
"main": "index.html",
"name": "app",
"description": "app",
"version": "0.2.3",
"nodejs": true,
"window": {
"title": "app",
"icon": "favicon.ico",
"toolbar": false,
"frame": true,
"width": 1200,
"height": 768,
"min_width": 1024,
"min_height": 768,
"resizable": true
},
"webkit" :{
"plugin":true
},
"chromium-args": "--disable-web-security --experimental-location-features --enable-geolocation --allow-file-access-from-files --allow-file-access --enable-device-policy"
}
I changed my folder into zip and changed to .nw extension. After that i ran D:\nw>copy /b nw.exe+app.nw gte.exe .
Please any one help me out

node-webkit window width issue

Before minimizing the node-webkit window it looked like this:
After restoring the node-webkit window it looked like this:
package.json
{
"name": "Gallay",
"description": "Simplified Billing",
"version": "0.1",
"main": "index.html",
"window": {
"icon": "icons/16.png",
"show": true,
"toolbar": false,
"frame": true,
"position": "center",
"width": 507,
"height": 570,
"min_width": 507,
"min_height": 570,
"max_width": 507,
"max_height": 570
}
}
I need fixed width while minimizing and restoring the node-webkit window. How can I solve the above problem?
After including jQuery and the following JavaScript, the problem can be solved.
$(document).ready(function(){
$(window).resize(function(){
window.resizeTo(507,570);
window.focus();
});
});
Add to package.json: "resizable": false and remove min_width, min_height, max_width, max_height.

Categories