Skip to content

Commit 1e8119a

Browse files
Merge pull request #401 from AutomationSolutionz/recorder
New improvements of Recorder
2 parents f343d43 + a83874d commit 1e8119a

File tree

8 files changed

+310
-1133
lines changed

8 files changed

+310
-1133
lines changed

Apps/Web/AI_Recorder/background/back.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function getWindowSize(callback) {
6262
// var width = 1110;
6363
var win = await chrome.windows.getCurrent();
6464
var height = Math.round(win.height*0.9);
65-
var width = Math.round(win.width*0.6);
65+
var width = Math.round(win.width*0.5);
6666
if (result) {
6767
try {
6868
result = result.window;

Apps/Web/AI_Recorder/background/back_reocrder.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ var action_name_convert = {
2424
}
2525

2626
async function start_recording(){
27-
idx = 0;
28-
recorded_actions = [];
27+
let res = await browserAppData.storage.local.get('recorded_actions');
28+
recorded_actions = res.recorded_actions;
29+
idx = recorded_actions.length;
30+
2931
}
3032
async function stop_recording(){
3133
// When there are 2 iframes. it saves 3 times. this is a temporary fix. Should be fixed properly
@@ -118,7 +120,8 @@ async function fetchAIData(idx, command, value, url, document){
118120
value = 10;
119121
}
120122
response[0].short.value = value;
121-
if (value) response[0].data_set[response[0].data_set.length-1][response[0].data_set[0].length-1] = value;
123+
if (command === 'text') response[0].data_set[response[0].data_set.length-1][response[0].data_set[0].length-1] = value;
124+
else if (value) response[0].data_set[response[0].data_set.length-1][response[0].data_set[0].length-1] = value;
122125
recorded_actions[idx] = {
123126
action: response[0].short.action,
124127
data_list: [response[0].short.value],
@@ -139,7 +142,8 @@ async function record_action(command, value, url, document){
139142
if (Object.keys(action_name_convert).includes(command)) command = action_name_convert[command]
140143
console.log("... Action recorder start");
141144
idx += 1;
142-
if (recorded_actions.length === 0 || recorded_actions.length > 0 && recorded_actions[0].action != 'go to link'){
145+
if (recorded_actions.length === 0 ||
146+
recorded_actions.length > 0 && typeof recorded_actions[0] == 'object' && recorded_actions[0].action != 'go to link'){
143147
let go_to_link = {
144148
action: 'go to link',
145149
data_list: [url],

Apps/Web/AI_Recorder/panel/assets/css/mystyle.css

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ body
8080
{
8181
background: white;
8282
}
83-
83+
#content{
84+
background-color: #eeeeee;
85+
}
8486
#header_tab li a {
8587
color: #9FC8FA;
8688
}
@@ -604,11 +606,6 @@ body
604606
display: inline;
605607
}
606608

607-
608-
609-
610-
611-
612609
.bottom_left_icon a
613610
{
614611
background: none;
@@ -628,21 +625,37 @@ body
628625
font-style: italic;
629626
}
630627

631-
.tr{
628+
.tr:not(thead>tr){
632629
background-color:white;
630+
cursor: grab;
631+
border-radius: 15px;
632+
}
633+
#case_data_wrap tr td{
634+
padding: 0;
635+
}
636+
.tr:active:not(thead>tr){
637+
cursor: grabbing;
633638
}
634639
.td-no{
635640
min-width: 75px;
641+
border-radius: 15px;
636642
}
637643
.table-custom{
638644
width: 640px;
639645
}
640646
.del-btn:hover{
641647
opacity: 1;
648+
cursor: pointer;
649+
650+
}
651+
.tr:hover .del-btn{
652+
opacity: 0.75;
642653
}
643654
.del-btn{
644-
/* visibility: hidden; */
645-
opacity: 0.3;
655+
opacity: 0;
656+
}
657+
.opacity1{
658+
opacity: 1;
646659
}
647660
.font_black ::-webkit-input-placeholder
648661
{
@@ -757,9 +770,6 @@ body
757770
height: 41px;
758771
padding-left: 5px;
759772
}
760-
.show_text_box .has-input{
761-
padding: 4px !important;
762-
}
763773

764774
.disabled-case{
765775
opacity: 40%;
@@ -797,11 +807,6 @@ body
797807
.gray-font{
798808
color: #4a4a4acf
799809
}
800-
.case-sub-wrap td:first-child {
801-
padding-left: 0px;
802-
padding-right: 0px;
803-
color: #4a4a4acf
804-
}
805810
.log_section_head_left_text h6{
806811
color: #4a4a4a;
807812
font-weight: bold;

Apps/Web/AI_Recorder/panel/assets/css/style.css

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8220,6 +8220,32 @@ h1, h2, h3, h4, h5,
82208220
/* Support for IE. */
82218221
font-feature-settings: "liga";
82228222
}
8223+
.material-icons-outlined {
8224+
font-family: "Material Symbols Outlined";
8225+
font-weight: normal;
8226+
font-style: normal;
8227+
font-size: 24px; /* Preferred icon size */
8228+
display: inline-block;
8229+
line-height: 1;
8230+
text-transform: none;
8231+
letter-spacing: normal;
8232+
word-wrap: normal;
8233+
white-space: nowrap;
8234+
direction: ltr;
8235+
color: #ef0000;
8236+
8237+
/* Support for all WebKit browsers. */
8238+
-webkit-font-smoothing: antialiased;
8239+
/* Support for Safari and Chrome. */
8240+
text-rendering: optimizeLegibility;
8241+
8242+
/* Support for Firefox. */
8243+
-moz-osx-font-smoothing: grayscale;
8244+
8245+
/* Support for IE. */
8246+
font-feature-settings: "liga";
8247+
}
8248+
82238249
.material-icons-label {
82248250
font-size: 19px;
82258251
color: white;

Apps/Web/AI_Recorder/panel/assets/js/background/play_back.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,25 @@ window.onload = function() {
7979
}
8080
browser.tabs.query({windowId: extCommand.getContentWindowId(), url: "<all_urls>"})
8181
.then(function(tabs) {
82-
for(let tab of tabs) {
83-
browser.tabs.sendMessage(tab.id, {attachRecorder: true});
82+
try {
83+
console.log("attachRecorder=true sendMessage() call");
84+
for(let tab of tabs) {
85+
browser.tabs.sendMessage(tab.id, {attachRecorder: true})
86+
.catch((error)=>{
87+
console.log('error in sendMessage from tab.url=', tab.url);
88+
console.error(error);
89+
if (tab.url.startsWith("http://") || tab.url.startsWith("https://")){
90+
msg = (tabs.length == 1) ?
91+
`Recorder Disconnected!\n 1. Close the Recorder\n 2. Refresh the page (optional)\n 3. Open Recorder again` :
92+
`Recorder Disconnected!\n 1. Close the Recorder\n 2. Close all tabs except the main tab\n 3. Refresh the page (optional)\n 4. Open Recorder again` ;
93+
alert(msg)
94+
}
95+
});
96+
}
97+
} catch (error) {
98+
console.error(error);
8499
}
100+
85101
});
86102
// recordButton.childNodes[1].textContent = " Stop";
87103
// switchRecordButton(false);

Apps/Web/AI_Recorder/panel/assets/js/background/recorder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class BackgroundRecorder {
5656
}
5757
})
5858
return;
59-
}, 10000)
59+
}, 30000)
6060
}
6161

6262
/* Bind initial time */

0 commit comments

Comments
 (0)