On Arch Linux I was able to switch tabs by pressing Alt+[tab_num].
I have to work on Windows, where firefox uses Ctrl+[tab_num].
It's really annoying. Ctrl is not very well positioned for this kind of switching + I am used to Alt+[tab_num] instead of Ctrl+[tab_num].
Is there an easy way how to manage/change this in Firefox ? Any extention that does exactly this ?
I was annoyed at this too, and made an addon to deal with it which you should be able to install from the official website.
Following the script in https://gist.github.com/zbraniecki/000268ea27154bbccaad190dd479d226. I write a working code(at least in my Firefox) below
manifest.json
{
"applications": {
"gecko": {
"id": "selecttab#braniecki.net",
"strict_min_version": "48.0"
}
},
"manifest_version": 2,
"name": "SelectTab Gnome Shortcut Override",
"version": "1.0",
"description": "An extension that overrides the default select-tab modifier key.",
"permissions": ["tabs"],
"background": {
"scripts": ["background.js"]
},
"commands": {
"selectTab1": {
"suggested_key": { "default": "Alt+1" },
"description": "Activate Tab 1"
},
"selectTab2": {
"suggested_key": { "default": "Alt+2" },
"description": "Activate Tab 2"
},
"selectTab3": {
"suggested_key": { "default": "Alt+3" },
"description": "Activate Tab 3"
},
"selectTab4": {
"suggested_key": { "default": "Alt+4" },
"description": "Activate Tab 4"
},
"selectTab5": {
"suggested_key": { "default": "Alt+5" },
"description": "Activate Tab 5"
},
"selectTab6": {
"suggested_key": { "default": "Alt+6" },
"description": "Activate Tab 6"
},
"selectTab7": {
"suggested_key": { "default": "Alt+7" },
"description": "Activate Tab 7"
},
"selectTab8": {
"suggested_key": { "default": "Alt+8" },
"description": "Activate Tab 8"
},
"selectTab9": {
"suggested_key": { "default": "Alt+9" },
"description": "Activate Tab 9"
}
}
}
backgroud.js
browser.commands.onCommand.addListener(async (command) => {
let num = parseInt(command.substr(9, 10)) - 1;
let tabs = await browser.tabs.query({currentWindow: true});
if (tabs.length < num) {
return;
}
if (num === 8) {
browser.tabs.update(tabs[tabs.length-1].id, {active: true});
} else {
browser.tabs.update(tabs[num].id, {active: true});
}
});
Then you may refer to How to publish a FireFox WebExtension for local installation only? to install it permanently.
Related
I am developing a Slack app with Slack's Block Kit.
In Block Kit, I can create a list by using static_select, and I can confirm that action_id is requested when an option is selected.
However, when we checked the behavior on a smart phone, we noticed that there is no action_id response when an option is selected.
I have confirmed that this is not a problem with the Slack app on Mac and Chrome browser, but I have confirmed that the problem occurs with the Slack app on iPhone.
This problem does not occur if I place a static_select under type: actions.
As a solution, I feel that we should have a Submit button separate from the list, but I feel that it would be delicate to add more buttons due to differences in behavior in different environments.
Please let me know if you have any ideas.
# iPhone does not respond to action_id
# (I checked the access log in real time on the server that receives the action_id, but it seems that no request was generated in the first place.)
{
"blocks": [
{
"type": "input",
"element": {
"type": "static_select",
"placeholder": {
"type": "plain_text",
"text": "Select an item",
"emoji": true
},
"options": [
{
"text": {
"type": "plain_text",
"text": "*this is plain_text text*",
"emoji": true
},
"value": "value-0"
}
],
"action_id": "static_select-action"
},
"label": {
"type": "plain_text",
"text": "Label",
"emoji": true
}
}
]
}
# iPhone reacts to action_id
{
"blocks": [
{
"type": "actions",
"elements": [
{
"type": "static_select",
"placeholder": {
"type": "plain_text",
"text": "Select an item",
"emoji": true
},
"options": [
{
"text": {
"type": "plain_text",
"text": "*this is plain_text text*",
"emoji": true
},
"value": "value-0"
}
],
"action_id": "actionId-3"
}
]
}
]
}
I would like to have the same behavior between the Slack app on Mac and the Slack app on iPhone.
We have created bot using Microsoft bot-framework which is integrated to Microsoft teams. We have created few adaptive cards for interactive conversation with bot. One of the Adaptive card is causing design issue in IPhone X Microsoft Teams Application.
We used Adaptive card template for building this card which displays the list of Tasks along with status of the task. Each task has Input.Toggle (Checkbox) and at the end a button will be displayed. When Checkbox's are selected and button is clicked
We are sending new card with task details where they can edit the status and so on. Please find the JSON data below.
Card Payload Editor Json Data:
{
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "Container",
"border": true,
"items": [
{
"$data": "{properties}",
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"id": "{id}",
"type": "Input.Toggle",
"title": " ",
"value": "false",
"wrap": false
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "Container",
"items": [
{
"type": "FactSet",
"facts": [
{
"$data": "{peers}",
"title": "{key}",
"value": "{value}"
}
]
}
],
"style": "emphasis"
}
]
}
]
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"title": "{actionSubmitTitle}",
"horizontalAlignment": "center"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
Sample Data Editor:
"properties":[
{
"id":"InputToggle1",
"peers":[
{
"key":"Project",
"value":"' .$task->project_name. '"
},
{
"key":"Task",
"value":"'.$task->id.' - '.$task->heading.'"
},
{
"key":"Status",
"value":"'.$task->board_column.'"
}
]
},
{
"id":"InputToggle2",
"peers":[
{
"key":"Project",
"value":"' .$task->project_name. '"
},
{
"key":"Task",
"value":"'.$task->id.' - '.$task->heading.'"
},
{
"key":"Status",
"value":"'.$task->board_column.'"
}
]
},
{
"id":"InputToggle3",
"peers":[
{
"key":"Project",
"value":"' .$task->project_name. '"
},
{
"key":"Task",
"value":"'.$task->id.' - '.$task->heading.'"
},
{
"key":"Status",
"value":"'.$task->board_column.'"
}
]
},
{
"id":"InputToggle4",
"peers":[
{
"key":"Project",
"value":"' .$task->project_name. '"
},
{
"key":"Task",
"value":"'.$task->id.' - '.$task->heading.'"
},
{
"key":"Status",
"value":"'.$task->board_column.'"
}
]
}
],
"actionSubmitTitle":"Update Timesheet"
}
The InputToggle is inside the column set with width as auto and it is perfectly rendering in Microsoft Desktop and Android App but whereas in IOS app it is not showing
When we set the width property to stretch, InputToggle is getting displayed in IOS App in big size but in Desktop App and Android App the column is pushing and occupying much space.
Please help me so that we can display the Input.Toggle in IOS Microsoft Teams without breaking the design in Desktop and Android Teams App.
Edit: Adding final JSON sent to the bot. The columns in the column set will be changed dynamically based on the ask list in database.
{
"type":"AdaptiveCard",
"version":"1.0",
"body":[
{
"type":"Container",
"border":true,
"items":[
{
"type":"ColumnSet",
"columns":[
{
"type":"Column",
"width":"auto",
"items":[
{
"id":"inputToggle1",
"type":"Input.Toggle",
"title":" ",
"value":"false",
"wrap":false
}
]
},
{
"type":"Column",
"width":"stretch",
"items":[
{
"type":"Container",
"items":[
{
"type":"FactSet",
"facts":[
{
"title":"Project",
"value":"Project 1"
},
{
"title":"Task",
"value":"Task 1"
},
{
"title":"Status",
"value":"Pending"
}
]
}
],
"style":"emphasis"
}
]
}
]
},
{
"type":"ColumnSet",
"columns":[
{
"type":"Column",
"width":"auto",
"items":[
{
"id":"inputToggle2",
"type":"Input.Toggle",
"title":" ",
"value":"false",
"wrap":false
}
]
},
{
"type":"Column",
"width":"stretch",
"items":[
{
"type":"Container",
"items":[
{
"type":"FactSet",
"facts":[
{
"title":"Project",
"value":"Project 1"
},
{
"title":"Task",
"value":" Task 2"
},
{
"title":"Status",
"value":"Completed"
}
]
}
],
"style":"emphasis"
}
]
}
]
}
]
}
],
"actions":[
{
"type":"Action.Submit",
"title":"Update Timesheet",
"horizontalAlignment":"center"
}
],
"$schema":"http://adaptivecards.io/schemas/adaptive-card.json"
}
Thank you.
For completion, this was caused by a bug and is tracked as an Github Issue here:
https://github.com/microsoft/AdaptiveCards/issues/4052#
I want to enable alexa voice control for my smart home device. I was able to discover device. Now all devices are showing in alexa app. But when I try to turn on the device from my alexa app it is getting stuck. Loader is moving unlimited period of time. It is actually calling ReportStatus directive.
This is the json that I am getting from alexa app for a light. The light has only turn on and turn off capabilities.
{
"directive": {
"endpoint": {
"cookie": {
"detail1": "For simplicity, this is the only appliance",
"detail2": "that has some values in the additionalApplianceDetails"
},
"endpointId": "endpoint-001",
"scope": {
"token": "weza|IwEBIGu_tmpSTQaEPvhm0OYy-4ncjve_Au1788TAWR2DC8b7xJlPDiX3HV3rJUtG0qyauIlman4bX4ZCK0-6NvKWagqXNLSdH3bDBLxD_9VtgCQo6wUlEd4DNmL9Yf5sWuUCkV1ALAxxbhqPs3QlTofubxtpSnF05ZWOSjyNUlM3ShryLh7owTywFa_7oXCCaLdLCTiqOm27aPn-yyJEDNG57Sc9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tivhUTZXg==",
"messageId": "dd8670d5-3afa-483a-93a3-f0fff0ab6572",
"name": "ReportState",
"namespace": "Alexa",
"payloadVersion": "3"
},
"payload": {}
}
}
This is the response I am sending from lambda function. It is written in python 3.6.
{
"event": {
"context": {
"properties": [
{
"name": "powerState",
"namespace": "Alexa.PowerController",
"timeOfSample": "2018-12-17T18:17:35.00Z",
"uncertaintyInMilliseconds": 500,
"value": "ON"
}
]
},
"endpoint": {
"cookie": {
"detail1": "For simplicity, this is the only appliance",
"detail2": "that has some values in the additionalApplianceDetails"
},
"endpointId": "endpoint-001",
"scope": {
"token": "weza|IwEBIGu_tmpSTQaEPvhm0OYy-4ncjve_Au1788TAWR2DC8b7xJlPDiX3HV3rJUtG0qyauIlman4bX4ZCK0-6NvKWagqXNLSdH3bDBLxD_9VtgCQo6wUlEd4DNmL9Yf5sWuUCkV1ALAxxbhqPs3QlTofubxtpSnF05ZWOSjyNUlM3ShryLh7owTywFa_7oXCCaLdLCTiqOm27aPn-yyJEDNG57Sc9iysrZkJHaxVPbdZdcqRmaw9zFGVWOqsgjqiojkKrfztslVL1Ggo6v7Teg8isrZD8osr5HFkWAmZHi8K7UrHmwQnsD9CosgSxSG0avnUoomdsZx3_LPjLJKf5twJrN1vbLolzOgxUbVuAVPVrs8UN40KFEu6eCv_7rYz9AER_61di-4w1K27kjeJvzPMIKlLXLvv6Z-2GyuQq_8M1fUdM0SgiAkqjf92S9SNxezTUiDYdOjB1JrktbQc0WM6OYYXOMjtXcCPx3bqNwWoPZWBk7qptLTurCHcYnnDl27Q0RcJ3u1vFvMaT8l0x87K6wqW2",
"type": "BearerToken"
}
},
"header": {
"correlationToken": "AAAAAAQAeXUb9VLQcUVXClbXZQBvIDAIAAAAAAAAiBMdYahxBjRIHYbFACdRe+68uyc0KiCkClvpOCfh5dZw7NlTHoqnbbjPPydl4Nmkh4KLuFtKboYiwENwsVa9Q2WwAgRlEM+SR9PSNrWqnKvKDtulnkVXuTDkHf8f4LskbFd4VhX6cN518TA0MaZZvSfli9CN7KNY7m07P+eIv71nwxUFP5UN4xe4Jsz1V6nLzUGAG2jJIW4Lg0ARHENqDhbFtra4SV+vPXUN8L4qIwvC5xD6/mjsdN7B1ihGy/8djQA2+cxZ3XOEz2UOATyPEDlpVw5PBasQiJbRiSFSZZqEvQ0NHNfPWAWz5ieQXO1z1NAE5RMgn9d5gcEfDecjScP9DE2Yw43MypX/3VMDJmbjuTlhg9AabxLTQndKV8w9JNM1lLXcdp7i2JShOLO0bDDBPqJH1zsiZGJ93zWn+VDOTzDt+482V/AWgcHOWYnB+UZnL9GZFwEKVWTcQ20u2inFK9J11M5wr3ia57WDP6SQ7zkAmERDGfL0wswN/j0vFpqw+0/G7vjAUs2hGyg9oOy7fN2PFntk6IHV8mh47sC+ENj9dujJ9+ENwfEwEi792m7WlA8PGtvxdEqyVib5hY3qfNirqPMhMmPBf2hZlpbUfpf69q9R8GNFq41EZnTlg/AxSBjjLUJazaKQ8RU1VgipcdK1aGupJf5Oi85uEuYWN96OoEtivhUTZXg==",
"messageId": "dd8670d5-3afa-483a-93a3-f0fff0ab6572",
"name": "StateReport",
"namespace": "Alexa",
"payloadVersion": "3"
},
"payload": {}
}
}
Please help me. I am stuck in this for last 2 days.
Not sure if this is related to your problem. In your response, the context element is inside event. But according to the documentation and code sample, context and event should be at the same level.
{
"context": {
"properties": [...]
},
"event": {
"header": ...,
"endpoint": ...,
"payload": {}
}
}
I'm develop an chrome extension for jira which get a data from a DIV element of another website and use the data to raise a jira ticket by my chrome extension automatically.
the issue is when I call below jira api in my code I faced below error
content.js:107 POST http://myjira.com:9090/rest/api/2/issue/ 403 (Forbidden)
but as I checked my request in Post Man app everything is fine and new ticket raise in Jira.
I'm really appreciated if someone can help me to fix the issue.
moreover, I used my personal computer and the jira is on another server.
totally I want to have a extension to integrate a ticketing system with jira, without access to that site.
please have following code.
content.js
$(document).ready(function () {
var key = '';
var summary = 'undefined';
var description = '';
var comment = '';
window.setInterval(function () {
/// call your function here
console.log($('Div1').html());
console.log($('Div2').html());
console.log($('#Div3').html());
console.log($('Div4').html());
key = $('.a span:first').html();
summary = $('#b').html();
description = $('#r'')').html();
comment = $('#u').html();
if (summary == 'undefined') {
return;
}
var data = JSON.stringify({
"fields": {
"project": {
"key": "RTF"
},
"summary": "" + summary + "",
"description": "" + description + "",
"issuetype": {
"self": "http://myjira.com/rest/api/2/issuetype/10111",
"id": "10111",
"description": "Service Request",
"iconUrl": "http:/myjira.com/secure/viewavatar?size=xsmall&avatarId=10720&avatarType=issuetype",
"name": "MS Task (SR)",
"subtask": false,
"avatarId": 10720
},
"customfield_10106": {
"self": "http://myjira.com/rest/api/2/customFieldOption/10476",
"value": "EMAIL",
"id": "10476"
},
"customfield_10129": [
{
"self": "http://myjira.com/rest/api/2/customFieldOption/10450",
"value": "TEST",
"id": "10450"
}
],
"customfield_10188": [
{
"self": "http://myjira.com/rest/api/2/customFieldOption/10469",
"value": "Billing",
"id": "10469"
}
],
"customfield_10180": {
"self": "http://myjira.com/rest/api/2/customFieldOption/11000",
"value": "Support",
"id": "11000"
},
"assignee": {
"self": "http://myjira.com/rest/api/2/user?username=e.pirjahandideh",
"name": "e.jj",
"key": "e.jj",
"emailAddress": "e.jj#jj.com",
"avatarUrls": {
"48x48": "http://www.gravatar.com/avatar/68e54d1c135e85b994eb12cb9a3b7b9b?d=mm&s=48",
"24x24": "http://www.gravatar.com/avatar/68e54d1c135e85b994eb12cb9a3b7b9b?d=mm&s=24",
"16x16": "http://www.gravatar.com/avatar/68e54d1c135e85b994eb12cb9a3b7b9b?d=mm&s=16",
"32x32": "http://www.gravatar.com/avatar/68e54d1c135e85b994eb12cb9a3b7b9b?d=mm&s=32"
},
"displayName": "Emil jj",
"active": true,
"timeZone": "Asia/Tehran"
},
"components": [
{
"self": "http://myjira.com/rest/api/2/component/10071",
"id": "10071",
"name": "RR",
"description": "Managed RR"
}
],
"customfield_10189": {
"self": "http://myjira.com/rest/api/2/customFieldOption/10489",
"value": "RR/IT",
"id": "10489"
}
}
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "myjira.com/rest/api/2/issue/");
xhr.setRequestHeader("authorization", "Basic dasfasegsdfgsdfgsdfg");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");
xhr.setRequestHeader("postman-token", "c6475a5e-6741-6894-5b8e-2350c7c5a176");
xhr.send(data);
}, 10000);
});
manifest.json
{
"manifest_version": 2,
"name": "Name",
"description": "Description",
"browser_action": {
"default_popup": "popup.html"
},
"background": {
"page": "background.html"
},
"version": "1.0",
"permissions": [
"http://myjira.com/",
"http://ticketing2.com"
],
"content_scripts": [
{
"matches": [ "http://*/*", "https://*/*"],
"js": [
"jquery.js",
"jquery-ui.min.js",
"content.js"
],
"run_at": "document_end",
"all_frames": true
}
]
}
This question already has answers here:
How to change style of matched brackets in Sublime Text 2 / 3?
(6 answers)
Closed 6 years ago.
For now open and close brackets { } highlights as underline _
I don't like it
But I can't find, is there way to change it to bolding or / and background change as in most of other editors?
Take a look at the BracketHighlighter plugin.
Edit
Try this for your Packages/User/bh_core.sublime-settings
{
// Define region highlight styles
"bracket_styles": {
// "default" and "unmatched" styles are special
// styles. If they are not defined here,
// they will be generated internally with
// internal defaults.
// "default" style defines attributes that
// will be used for any style that does not
// explicitly define that attribute. So if
// a style does not define a color, it will
// use the color from the "default" style.
"default": {
"icon": "dot",
// BH1's original default color for reference
// "color": "entity.name.class",
"color": "brackethighlighter.default",
"style": "underline"
},
// This particular style is used to highlight
// unmatched bracekt pairs. It is a special
// style.
"unmatched": {
"icon": "question",
// "color": "brackethighlighter.unmatched",
"style": "outline"
},
// User defined region styles
"curly": {
"icon": "curly_bracket",
// "color": "brackethighlighter.curly",
"style": "full"
},
"round": {
"icon": "round_bracket",
// "color": "brackethighlighter.round",
"style": "full"
},
"square": {
"icon": "square_bracket",
// "color": "brackethighlighter.square",
"style": "full"
},
"angle": {
"icon": "angle_bracket",
// "color": "brackethighlighter.angle",
"style": "full"
},
"tag": {
"icon": "tag",
// "color": "brackethighlighter.tag",
"style": "outline"
},
"single_quote": {
"icon": "single_quote",
// "color": "brackethighlighter.quote",
"style": "full"
},
"double_quote": {
"icon": "double_quote",
// "color": "brackethighlighter.quote",
"style": "full"
},
"regex": {
"icon": "regex",
// "color": "brackethighlighter.quote",
"style": "full"
}
}
}
Just go "Sublime Text -> Preferences -> Package Settings -> Bracket Highlighter -> Bracket Setting - User".
Then paste the following configuration and press "Save". That should fix it.
{
"bracket_styles": {
"default": {
"icon": "dot",
"color": "brackethighlighter.default",
"style": "none"
},
"unmatched": {
"icon": "question",
"style": "outline"
},
"curly": {
"icon": "curly_bracket"
},
"round": {
"icon": "round_bracket"
},
"square": {
"icon": "square_bracket"
},
"angle": {
"icon": "angle_bracket"
},
"tag": {
"icon": "tag"
},
"c_define": {
"icon": "hash"
},
"single_quote": {
"icon": "single_quote"
},
"double_quote": {
"icon": "double_quote"
},
"regex": {
"icon": "regex"
}
}
}
p.s.
I'm aware that this is an old question - this is for reference!
Paste this to your Theme_of_choise.tmTheme next to other stuff in settings. And no there are no bracketBackground key :(
<key>bracketsForeground</key>
<string>#FF0000</string>
<key>bracketsOptions</key>
<string>foreground</string>
<key>bracketContentsForeground</key>
<string>#FF0000</string>
<key>bracketContentsOptions</key>
<string>foreground</string>