File tree Expand file tree Collapse file tree 8 files changed +30
-27
lines changed
assets/javascripts/controllers Expand file tree Collapse file tree 8 files changed +30
-27
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,17 @@ import { Controller } from '@hotwired/stimulus';
2
2
3
3
export default class extends Controller {
4
4
static get targets ( ) {
5
- return [ 'input' , 'message' , 'suggestion' ] ;
5
+ return [ 'input' , 'message' ] ;
6
+ }
7
+
8
+ static values = {
9
+ url : String ,
6
10
}
7
11
8
12
change ( event ) {
9
13
event . preventDefault ( ) ;
10
14
11
- this . inputTarget . value = this . suggestionTarget . innerHTML ;
15
+ this . inputTarget . value = this . urlValue ;
12
16
this . messageTarget . hidden = true ;
13
17
this . inputTarget . focus ( ) ;
14
18
}
Original file line number Diff line number Diff line change 8
8
9
9
<?= $ this ->include ('collections/shares/_index.phtml ' , [
10
10
'collection ' => $ collection ,
11
- 'type ' => $ type ,
12
- 'user_id ' => $ user_id ,
13
- 'from ' => $ from ,
11
+ 'type ' => $ this -> safe ( ' type ' ) ,
12
+ 'user_id ' => $ this -> safe ( ' user_id ' ) ,
13
+ 'from ' => $ this -> safe ( ' from ' ) ,
14
14
'errors ' => $ errors ,
15
- 'error ' => $ error ,
15
+ 'error ' => $ this -> safe ( ' error ' ) ,
16
16
]); ?>
Original file line number Diff line number Diff line change 2
2
<template>
3
3
<?= $ this ->include ('collections/shares/_index.phtml ' , [
4
4
'collection ' => $ collection ,
5
- 'type ' => $ type ,
6
- 'user_id ' => $ user_id ,
7
- 'from ' => $ from ,
5
+ 'type ' => $ this -> safe ( ' type ' ) ,
6
+ 'user_id ' => $ this -> safe ( ' user_id ' ) ,
7
+ 'from ' => $ this -> safe ( ' from ' ) ,
8
8
'errors ' => $ errors ,
9
- 'error ' => $ error ,
9
+ 'error ' => $ this -> safe ( ' error ' ) ,
10
10
]); ?>
11
11
</template>
12
12
</turbo-stream>
Original file line number Diff line number Diff line change 8
8
?>
9
9
10
10
<?= $ this ->include ('feeds/_new.phtml ' , [
11
- 'url ' => $ url ,
12
- 'from ' => $ from ,
11
+ 'url ' => $ this -> safe ( ' url ' ) ,
12
+ 'from ' => $ this -> safe ( ' from ' ) ,
13
13
'errors ' => $ errors ,
14
- 'error ' => $ error ,
14
+ 'error ' => $ this -> safe ( ' error ' ) ,
15
15
]); ?>
Original file line number Diff line number Diff line change 1
1
<turbo-stream action="replace" target="modal-feeds-new">
2
2
<template>
3
3
<?= $ this ->include ('feeds/_new.phtml ' , [
4
- 'url ' => $ url ,
5
- 'from ' => $ from ,
4
+ 'url ' => $ this -> safe ( ' url ' ) ,
5
+ 'from ' => $ this -> safe ( ' from ' ) ,
6
6
'errors ' => $ errors ,
7
- 'error ' => $ error ,
7
+ 'error ' => $ this -> safe ( ' error ' ) ,
8
8
]); ?>
9
9
</template>
10
10
</turbo-stream>
Original file line number Diff line number Diff line change 17
17
<div
18
18
class="form-group <?= isset ($ errors ['url ' ]) ? 'form-group--invalid ' : '' ?> "
19
19
data-controller="link-suggestion"
20
+ data-link-suggestion-url-value="<?= $ this ->safe ('url_cleared ' ) ?> "
20
21
>
21
22
<label for="url">
22
23
<?= _ ('What’s the address of the link? ' ) ?>
47
48
<p class="form-group__error" data-link-suggestion-target="message">
48
49
<?= _f ('%s has detected trackers in this <abbr>URL</abbr>. Suggestion: ' , $ brand ) ?>
49
50
50
- <span data-link-suggestion-target="suggestion">
51
- <?= $ url_cleared ?>
52
- </span>
51
+ <?= $ url_cleared ?>
53
52
54
53
<button
55
54
class="button--small"
Original file line number Diff line number Diff line change 8
8
9
9
<?= $ this ->include ('links/repairing/_new.phtml ' , [
10
10
'link ' => $ link ,
11
- 'url ' => $ url ,
12
- 'url_cleared ' => $ url_cleared ,
11
+ 'url ' => $ this -> safe ( ' url ' ) ,
12
+ 'url_cleared ' => $ this -> safe ( ' url_cleared ' ) ,
13
13
'ask_sync ' => $ ask_sync ,
14
- 'from ' => $ from ,
14
+ 'from ' => $ this -> safe ( ' from ' ) ,
15
15
'errors ' => $ errors ,
16
- 'error ' => $ error ,
16
+ 'error ' => $ this -> safe ( ' error ' ) ,
17
17
]); ?>
Original file line number Diff line number Diff line change 2
2
<template>
3
3
<?= $ this ->include ('links/repairing/_new.phtml ' , [
4
4
'link ' => $ link ,
5
- 'url ' => $ url ,
6
- 'url_cleared ' => $ url_cleared ,
5
+ 'url ' => $ this -> safe ( ' url ' ) ,
6
+ 'url_cleared ' => $ this -> safe ( ' url_cleared ' ) ,
7
7
'ask_sync ' => $ ask_sync ,
8
- 'from ' => $ from ,
8
+ 'from ' => $ this -> safe ( ' from ' ) ,
9
9
'errors ' => $ errors ,
10
- 'error ' => $ error ,
10
+ 'error ' => $ this -> safe ( ' error ' ) ,
11
11
]); ?>
12
12
</template>
13
13
</turbo-stream>
You can’t perform that action at this time.
0 commit comments