How specify link url in json file to open in same window - json

It's possible to set url parameter in json to open link in same window?
target: "_parent"
not work, opens link in new tab/window
Thanks

I think this should work:
target: "_self"

its working see this code:
var headerItems= {
items: [
{
actionId:'logout',
href:'Logout.jsp',
label:'Log Out',
target: "_self"
}
]
};

Try the below one instead of target and all
{
name: 'logout',
isLabel: true,
url: 'Logout.jsp',
icon: 'fa fa-exclamation-triangle',
}

Related

How to upload Image from desktop in CKEditor in Angular 6

I have tried lots of things but I could not find any solution for that, How can I upload an image from the desktop in CK Editor in Angular 6. How can I configure that?
You need to write some code to insert images or links to images from your server path.
Try that:
<ckbutton [name]="'imageExplorer'"
[command]="'openImageExplorer'"
(click)="openImageExplorer($event)"
[icon]="'./images/Icon.png'"
[label]="'Open image explorer'"
[toolbar]="'insert,1'">
</ckbutton>
Config File:
this.ckeConfig = {
height: 400,
language: "en",
allowedContent: true,
toolbar: [
{ name: "clipboard", items: ["Cut", "Copy", "Paste", "PasteText", "PasteFromWord", "-", "Undo", "Redo"] },
{ name: "links", items: ["Link", "Unlink", "Anchor"] },
{ name: "insert", items: ["Image", "Table", "HorizontalRule", "SpecialChar", "Iframe", "imageExplorer"] }
]
};
In your dialog window insert the link:
onAddImage() {
try
{
let link = this.ckeditor.instance.document.createElement("img");
link.setAttribute("alt", "Image");
link.setAttribute("src", "./Images/test.png");
this.ckeditor.instance.insertElement(link);
}
catch(error)
{
console.log((<Error>error).message);
}
this.showFiles = false;
}
For Documentation
Hope it helps thanks.

How to create two level context menu in autodesk forge

I want to creat two level context menu but there is no api for this.Just look like this
level context menu image
what I can do?
It is rather straighforward to acheive a multi level context menu by deriving from Autodesk.Viewing.UI.ObjectContextMenu. Simply provide an array in the target field:
buildMenu (event, node) {
var menu = []
switch (node.type) {
case 'hubs':
menu.push({
title: 'Show details',
className: 'fa fa-share',
target: [{
title: 'Hub details',
className: 'fa fa-cloud',
target: () => {
this.emit('context.details', {
event, node, type: 'hubs'
})
}
}, {
title: 'Projects details',
className: 'fa fa-folder',
target: () => {
this.emit('context.details', {
event, node, type: 'hubs.projects'
})
}
}]
})
break
A complete example of this can be found here: DataContextMenu.js
Unfortunately, it's not available on current viewer version. You might have to write your own context menu in deep. But there is a workaround that you can follow:
Override functions of Autodesk.Viewing.Private.ContextMenu to provide multiple level menus.
Refer codes from Autodesk.Viewing.UI.ObjectContextMenu, then create your owned ObjectContextMenu and replace contextMenu property with the your owned multiple levels ContextMenu from the step 1.
Refer codes from Autodesk.Viewing.Extensions.ViewerObjectContextMenu, then write your owned ViewerObjectContextMenu that inherits the custom ObjectContextMenu from the step 2.
P.S. This is just a workaround, it's not the formal solution, you might have to use it at your own risk.

Adding a Tileset from mapbox into my map

I'm new working with mapbox, and recently I want to create a web map. I uploaded a shape into mapbox tilseset cloud, but when I try to add it into a map it doesn't display. This is the code funtion that I'm using:
map.on('load', function() {
map.addLayer({
'id' : 'Resguardos',
'type' : 'fill',
"source" : {
'type' : 'vector',
'url' : 'mapbox://fabiofz1990.9lhgml6c',
},
'layout' : {},
'paint' : {
'fill-color' : '#0044b2',
'fill-opacity' : 1
}
});
});
Thank you
You can add tilesets directly from the Mapbox studio.
Copy tileset URL.
Add URL like this. url: "mapbox://+tilesetid"
map.addSource('tileset_data', {
"url": "mapbox://abcqqq123.cklxcyxew1b9421lpb8shxf4x-2ikvs",
"type": "vector"
});
Add the source name from above source name "tileset_data" in your layer
and get source-layer from above picture.
map.addLayer({
'id': 'circles',
'type': 'circle',
'source': 'tileset_data',
'source-layer': 'children_obesity',
'paint': {
'circle-color': '#7F3121',
'circle-opacity': 0.75,
'circle-radius': 5
}
});
Then you good to go.
I think to display it you would need to add the tileset data to the style that your are using.
There is an option for that in your mapbox account at: https://www.mapbox.com/studio/tilesets/
you can NOT directly add mapbox TileSet into your browser client.
You have to create a new mapbox style, which use your tileSet.
This is working sample
https://transparentgov.net/cleargov1/766/new-2019-world-press-freedom-ranking-map-180-countries
https://transparentgov.net/json2tree/datahub.io/international/press-freedom-2019-mapbox-style.html

How to use addkml method of gmap4rails gem to draw region boundaries for New York city?

when i search through zip-code, i want to draw boundaries like this http://www.apartments.com/new-york-ny-10128/ or http://streeteasy.com/for-sale/battery-park-city
I am using below code for testing purpose but this isn't working. URL link doesn't exist any more.
var handler = Gmaps.build('Google');
handler.buildMap({ internal: {id: 'with_kml'}}, function(){
var kmls = handler.addKml(
{ url: "http://gmaps-samples.googlecode.com/svn/trunk/ggeoxml/cta.kml" }
);
})
Currently i am using gmaps4rails gem to add markers so is it possible to add region boundaries using gmaps4rails ?
Please Help!
Here is the documentation that show how to display KML using Google-Maps-for-Rails.
<%= gmaps( :kml => {:data => '[{ url: "http://www.searcharoo.net/SearchKml/newyork.kml"},
{ url: "http://gmaps-samples.googlecode.com/svn/trunk/ggeoxml/cta.kml",
options: {clickable: false } }]' } ) %>
For more information about gmaps4rails, check these github:
Gmaps4rails
apneadiving/Google-Maps-for-Rails

ExtJS Combobox not loading up in Panal

I have this panel view. Please check this JSFiddle . So I have a cgi script which returns json for combo-box value and label but its not loading up in combo-box. I am not sure why any help will be appreciated. I just want the options to show up each time combo-box drop down menu is clicked.
var incidentjreader = new Ext.data.JsonReader({},['cid','list']);
var incident_store = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'test.cgi'
}),
reader: incidentjreader
});
var incident_combo = new Ext.form.ComboBox({
store: incident_store,
mode: 'local',
id: 'incidentcombo',
typeAhead: false,
triggerAction: 'all',
width: 130,
fieldLabel: 'Incident',
valueField: 'cid',
displayField: 'list',
emptyText: 'Select Incident...',
});
incident_store.load();
Please check JSFiddle for more mode.
You are mixing ExtJS3.x syntax and 4.x API, use appropriate release examples to get you started.
Here is the same fiddle with fixed syntax and a few modifications:
http://jsfiddle.net/dbrin/QNSCk/4/