AEM 6.1: How to get the warning icon in a cq:dialog - warnings

AEM 6.1: How to get the warning icon in a cq:dialog. Is it some xtype that would help? If it were a pop up then,
CQ.Ext.Msg.show({ "icon":CQ.Ext.MessageBox.WARNIN, }) helps
but for "cq:Dialog", How should one **
Display the warning icon
With the warning message in a cq:dialog.
"jcr:primaryType": "cq:Dialog",
"height": 240,
"title":CQ.I18n.getMessage("Activate Later"),
"id": CQ.Util.createId("cq-activate-later-dialog"),
"params": {
"_charset_":"utf-8"
},
"items": {
"jcr:primaryType": "cq:Panel",
"items": {
"jcr:primaryType": "cq:WidgetCollection",
**"warnMsg": {
"xtype": "displayfield",
"html":CQ.I18n.getMessage("my warning message here."),
"hideLabel":true,
"hidden":flagHidden,
"name":"warnMsg",
},**
"absTime": {
"xtype": "datetime",
"fieldLabel":CQ.I18n.getMessage("Activation Date"),
"name":"absTime",
"allowBlank": false
}
}
},

You can use the display field and specify the required output in the html property as shown below.
"warnMsg": {
"html": "<img style='vertical-align:middle;' src='/libs/cq/ui/widgets/themes/default/ext/window/icon-warning.gif'><div style='vertical-align:middle; display:inline;'>Warning</div>",
"xtype": "displayfield",
"hideLabel": true
}
A similar SO question has been answered here too.

This code removes the text from wrapping around the icon displayed
"warnMsg": {
"xtype": "dialogfieldset",
"hideLabel":true,
"hidden":flagHidden,
"html": "<div><img style='float:left; padding-right:10px' src='/libs/cq/ui/widgets/themes/default/ext/window/icon-warning.gif'></div><div style='font-size:12px; margin-left: 40px;'> Your text here</div>",
"title":"Warning",
"name":"warnMsg"
},

Related

'Add theme settings for configuration' in shopify - Error message 'unexpected token' keeps coming up?

I'm following instructions on shopify developers to create a 'How did you hear about us form field' for my website. FYI I am using safari on a Mac. Everything was working fine until I got to the step of 'Add theme settings for configuration.' In the Config. directory of settings_schema-json, the current code (below) already exists:
[
{
"name": "theme_info",
"theme_name": "Themekit template theme",
"theme_version": "1.0.0",
"theme_author": "Shopify",
"theme_documentation_url": "https:\/\/github.com\/Shopify\/themekit",
"theme_support_url": "https:\/\/github.com\/Shopify\/themekit\/issues"
}
]
I'm trying to add to that code with the code pasted below from shopify developers, which I'm told to paste on a new line below the closing curly bracket (above). But each time I do that and hit save, two error messages come up (see attached screenshot at bottom of post). The messages read 'An error prevented settings_schema.json from being saved' and 'Invalid JSON: unexpected token.' Does anybody have any idea what's going wrong here? I would be very grateful as I'm brand new to coding and this is the first time I've tried to make any changes to my website!
Thanks, Cosmo.
{
"name": "Hear About Us",
"settings": [
{
"type": "text",
"id": "hau_form_options",
"label": "Form options",
"default": "Facebook, Twitter, Google, Instagram, Youtube",
"info": "Separate each option with a comma"
},
{
"type": "header",
"content": "Form validation"
},
{
"type": "checkbox",
"id": "hau_form_validation",
"label": "Enable form validation",
"default": true
},
{
"type": "text",
"id": "hau_error_message",
"label": "Error message",
"info": "The error message that is displayed when no selection is made",
"default": "Please select an option below"
},
{
"type": "text",
"id": "hau_error_message_other",
"label": "Other field error message",
"info": "The error message that is displayed when there is no input in the 'Other' field",
"default": "Please fill the text field below"
},
{
"type": "header",
"content": "Error styling"
},
{
"type": "color",
"id": "hau_error_color",
"label": "Color",
"default": "#ff0000"
}
]
},
screenshot error message
Missing a comma ,, correct it and works fine
Update:

MediaWiki template with links and inline html tag

i am trying to create a simple template that has 2 variable in Mediawiki.
variable 1 is the link whatever someone type: file://test.txt
variable 2 is the title: Test Document
The template would generate the hyperlink such as this:
TestDocument
But behind this test document link it has this wiki syntax:
<ext>file://test.txt</ext>
Could someone assist with this?
Here is the sample of wiki syntax i tried testing:
<ext>{{{1}}}|{{{2}}}</ext>
<noinclude>
<ext>{{{1}}}|{{{2}}}</ext>
<noinclude>
<templatedata>
{
"params": {
"1": {
"label": "Link",
"description": "Link",
"type": "string",
"default": "file://test.txt",
"required": true
},
"2": {
"label": "Description:",
"description": "Text",
"type": "string",
"required": true
}
},
"description": "links",
"paramOrder": [
"1",
"2"
]
}
</templatedata>
</noinclude>
If you add $wgUrlProtocols [] = 'file://'; to your LocalSettings.php, you can simply use external link syntax: [{{{1}}} {{{2}}}].

Basic Card is not displayed in the Google action simulator console, and also not on my iPhone using google assistant

Basic Card is not displayed in the Google action simulator console, and also not on my iPhone using Google Assistant
Here is the JSON code I send :
{
"expectUserResponse": true,
"expectedInputs": [
{
"possibleIntents": [
{
"intent": "actions.intent.TEXT"
}
],
"inputPrompt": {
"richInitialPrompt": {
"items": [
{
"simpleResponse": {
"textToSpeech": "This is a basic card example."
}
},
{
"basicCard": {
"title": "Title: this is a title",
"subtitle": "This is a subtitle",
"formattedText": "This is a basic card. Text in a basic card can include \"quotes\" and\n most other unicode characters including emoji 📱. Basic cards also support\n some markdown formatting like *emphasis* or _italics_, **strong** or\n __bold__, and ***bold itallic*** or ___strong emphasis___ as well as other\n things like line \nbreaks",
"image": {
"url": "https://example.com/image.png",
"accessibilityText": "Image alternate text"
},
"buttons": [
{
"title": "This is a button",
"openUrlAction": {
"url": "https://assistant.google.com/"
}
}
],
"imageDisplayOptions": "CROPPED"
}
}
]
}
}
}
]
}
and here is what I get in the simulator and on the iPhone using Google assistant :
[object Object]
The debug in the simulator returns :
{
"response": "[object Object]",
"expectUserResponse": true,
"conversationToken": "EroCS2w1Tm...",
"audioResponse": "//NExAAAAA...",
"ssmlMarkList": [],
"debugInfo": {
"assistantToAgentDebug": {
"curlCommand": "curl -v https://88.176.64.72:8081/ -H 'Content-Type: application/json;charset=UTF-8' -H 'Google-Actions-API-Version: 2' -H 'Authorization: eyJhbGciOiJSUzI1NiIsImtpZCI6IjM3ODJkM2YwYmM4OTAwOGQ5ZDJjMDE3MzBmNzY1Y2ZiMTlkM2I3MGUiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJhdWQiOiJteS10ZXN0LWFwcC1kMTNkZSIsIm5iZiI6MTU1NTI3NTE2OCwiaWF0IjoxNTU1Mjc1NDY4LCJleHAiOjE1NTUyNzU1ODgsImp0aSI6IjVhZWM0ZjAwNzJiNmNjMTcyMDlmZTdiMmJlZDhjZDRlZTI4ZjExYTIifQ.P-SnzkjiWcr-GubTRdT_juTUVAPBn9J6spSRHPqykwsBq3AppsHg2GNBzlDfwhAXbxZAogW-Mdr4k_U2E1cQMGu-fdGnrkkg4UmjGvYz8za5SGaN-OVx3TNYsoayGIgTFn01gmZOIZfI_33-OucZtFSQCHo82YEmK6ypz3kBq5_vGAjdu01cgYEHAXdT6c53LGSEoewhK4F2M-KphlSx3eFYj2yLWJFn7w9w-Yf3W1n5Rm9q9ZGFJ4vNKIZlX0_J-T-6HhB84OX6k9qJYZ8_1FXp6CS9bPOAo_Nid9k1OeONDIJcCwp1GnQTQB4dek77xybmUn5Qo4-ad1IOzHOkNA' -A 'Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)' -X POST -d '{\"user\":{\"userId\":\"ABwppHGZMM6CHA-JcPkrCzVpkgGv953hFvVdAGAEGOWQSETGxFO18zXyIbXrhHAlw63M9Gz7dKcFxn3fIGKd2sw\",\"locale\":\"fr-CA\",\"lastSeen\":\"2019-04-14T20:53:31Z\",\"userStorage\":\"{\\\"data\\\":{}}\"},\"conversation\":{\"conversationId\":\"ABwppHEJaVmbTFuCLu0rK3SBxm_bviFYhyoY6oIa8o3MNqI2gHalTVPumj9cetdIsmtbVlfU-vNhIxBGsYRmWvs\",\"type\":\"ACTIVE\",\"conversationToken\":\"{}\"},\"inputs\":[{\"intent\":\"actions.intent.TEXT\",\"rawInputs\":[{\"inputType\":\"KEYBOARD\",\"query\":\"image\"}],\"arguments\":[{\"name\":\"text\",\"rawText\":\"image\",\"textValue\":\"image\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.MEDIA_RESPONSE_AUDIO\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.WEB_BROWSER\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.ACCOUNT_LINKING\"}]},\"isInSandbox\":true,\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.WEB_BROWSER\"}]}],\"requestType\":\"SIMULATOR\"}'",
"assistantToAgentJson": "{\"user\":{\"userId\":\"ABwppHGZMM6CHA-JcPkrCzVpkgGv953hFvVdAGAEGOWQSETGxFO18zXyIbXrhHAlw63M9Gz7dKcFxn3fIGKd2sw\",\"locale\":\"fr-CA\",\"lastSeen\":\"2019-04-14T20:53:31Z\",\"userStorage\":\"{\\\"data\\\":{}}\"},\"conversation\":{\"conversationId\":\"ABwppHEJaVmbTFuCLu0rK3SBxm_bviFYhyoY6oIa8o3MNqI2gHalTVPumj9cetdIsmtbVlfU-vNhIxBGsYRmWvs\",\"type\":\"ACTIVE\",\"conversationToken\":\"{}\"},\"inputs\":[{\"intent\":\"actions.intent.TEXT\",\"rawInputs\":[{\"inputType\":\"KEYBOARD\",\"query\":\"image\"}],\"arguments\":[{\"name\":\"text\",\"rawText\":\"image\",\"textValue\":\"image\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.MEDIA_RESPONSE_AUDIO\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.WEB_BROWSER\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.ACCOUNT_LINKING\"}]},\"isInSandbox\":true,\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.WEB_BROWSER\"}]}],\"requestType\":\"SIMULATOR\"}",
"delegatedRequest": {
"delegatedRequest": ""
}
},
"agentToAssistantDebug": {
"agentToAssistantJson": "{\"conversationToken\":\"{}\",\"expectUserResponse\":true,\"expectedInputs\":[{\"inputPrompt\":{\"initialPrompts\":[{\"textToSpeech\":\"[object Object]\"}],\"noInputPrompts\":[]},\"possibleIntents\":[{\"intent\":\"actions.intent.TEXT\"}]}]}",
"delegatedResponse": {
"delegatedResponse": ""
}
},
"sharedDebugInfoList": []
},
"visualResponse": {
"visualElementsList": [
{
"displayText": {
"content": "[object Object]"
}
}
],
"suggestionsList": [],
"agentLogoUrl": "https://www.gstatic.com/voice/opa/partner_icons/generic_3p_avatar.png",
"agentStyle": {
"primaryColor": "",
"fontFamily": "",
"borderRadius": 0,
"backgroundColor": "",
"backgroundImageUrl": ""
}
},
"clientError": 0,
"is3pResponse": true,
"clientOperationList": [
{
"operationType": 1,
"micUpdatePayLoad": {
"micMode": 1
}
}
],
"projectName": ""
}
Why am I not getting the correct results?
I use Node-Red and the google-action-contrib to make the link beetween ation-on-google and my machine. Everything works fine, I can create a dialog, receive and send sentences... Now, I would like to send a BasicCard (because it seems hat is the correct way to send an image, and many other things, like a button, etc...)
I have put as many datas as possble in this forum, with attached files (wireshark capture, debug information, code):
https://discourse.nodered.org/t/google-action-response-with-an-image-basic-card/10145/7
Thanks for your help
It looks like you're not actually sending the JSON as JSON, but rather you've built an object, and are sending the toString version of it. This is suggested by the part of the response logged that says
"response": "[object Object]"
Without seeing the code you are using to send the response, it is pretty difficult to help further.
I assume you've used the sample code in your action. However, unless you changed the url fields, your action can not find the imageUrl and openUrlAction.
If you change url fields with actual(not "http://example.com") links, your app will respond properly.
Also make sure you've added necessary classes.
e.g.
const { dialogflow, BasicCard, Image, Button } = require('actions-on-google');

add link in legend text in fusion chart

How can I add link in legend text in fusion chart?
I tried below code but it is adding link in chart not on legend's text:
"data": [{
"label": "Workplace Services",
"value": "24",
"color": "#81cee3",
"link": "http://google.com" // added this
}]
For adding a link to the legend you need to use FusionCharts legendItemClicked API event, to know more check this link - https://www.fusioncharts.com/dev/api/fusioncharts/fusioncharts-events#legenditemclicked-97
Refer this snippet - "events": {
"legendItemClicked": function(eventObj, dataObj) {
if( eventObj.data.datasetName==="Food"){
window.location.href= "https://www.fusioncharts.com/dev/";
}
}
}

vscode new language configuration not changing syntax colors

I'm trying to create a new language for syntax highighting in Visual Studio Code for the CPU12 assembly language. When I use the new language in a new .asm file, the editor knows that the comment character is (it adds a semicolon to a line when I type ctrl-k ctrl-c), but the text is white instead of the default comment color green. Do I need to specify to use the default vscode theme? If so, where?
package.json
{
"name": "cpu12",
"displayName": "cpu12",
"description": "cpu12",
"version": "0.0.1",
"publisher": "https://github.com/me",
"engines": {
"vscode": "^1.15.0"
},
"categories": [
"Languages"
],
"contributes": {
"languages": [{
"id": "cpu12",
"aliases": ["CPU12", "cpu12"],
"extensions": [".asm",".inc"],
"configuration": "./language-configuration.json"
}],
"grammars": [{
"language": "cpu12",
"scopeName": "source.cpu12",
"path": "./syntaxes/cpu12.tmLanguage.json"
}]
}
}
language-configuration.json
{
"comments": {
// symbol used for single line comment. Remove this entry if your language does not support line comments
"lineComment": ";"
},
// symbols used as brackets
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
// symbols that are auto closed when typing
"autoClosingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
],
// symbols that that can be used to surround a selection
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
]
}
(My ./syntaxes/cpu12.tmLanguage.json is empty.)
The problem was actually because ./syntaxes/cpu12.tmLanguage.json was empty. You need to specify in the .json file how to color line comments:
./syntaxes/cpu12.tmLanguage.json
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "cpu12",
"scopeName": "source.cpu12",
"patterns": [
{
"comment": "Line Comments -- Asterisk only works at beginning of line",
"match": "((;|^\\*).*$)",
"captures": {
"1" :{
"name": "comment.line.cpu12"
}
}
}
]
}