File tree 4 files changed +85
-37
lines changed
4 files changed +85
-37
lines changed Original file line number Diff line number Diff line change
1
+ name : CI Pipeline
2
+
3
+ on :
4
+ release :
5
+ branches : ["main"]
6
+
7
+ jobs :
8
+ build :
9
+ runs-on : ubuntu-latest
10
+
11
+ steps :
12
+ - uses : actions/checkout@v3
13
+ - name : Login Dockerhub
14
+ env :
15
+ DOCKER_USERNAME : ${{secrets.DOCKER_USERNAME}}
16
+ DOCKER_PASSWORD : ${{secrets.DOCKER_PASSWORD}}
17
+ run : docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
18
+
19
+ - name : Build the Docker image
20
+ run : docker build -t mrsunglasses/linkliberate .
21
+ - name : Push to Dockerhub
22
+ run : docker push mrsunglasses/linkliberate:latest
Original file line number Diff line number Diff line change 23
23
}
24
24
25
25
a {
26
- text-decoration : none !important ;
26
+ text-decoration : none !important ;
27
27
}
28
28
29
29
h1 {
59
59
}
60
60
61
61
.tooltip {
62
- position : relative;
63
- display : inline-block;
64
- border-bottom : 1px dotted black;
62
+ position : relative;
63
+ display : inline-block;
64
+ border-bottom : 1px dotted black;
65
65
}
66
66
67
67
.tooltip .tooltiptext {
68
- visibility : hidden;
69
- width : 120px ;
70
- background-color : # 555 ;
71
- color : # fff ;
72
- text-align : center;
73
- padding : 5px 0 ;
74
- border-radius : 6px ;
75
-
76
- position : absolute;
77
- z-index : 1 ;
78
- bottom : 125% ;
79
- left : 50% ;
80
- margin-left : -60px ;
81
-
82
- opacity : 0 ;
83
- transition : opacity 0.3s ;
68
+ visibility : hidden;
69
+ width : 120px ;
70
+ background-color : # 555 ;
71
+ color : # fff ;
72
+ text-align : center;
73
+ padding : 5px 0 ;
74
+ border-radius : 6px ;
75
+
76
+ position : absolute;
77
+ z-index : 1 ;
78
+ bottom : 125% ;
79
+ left : 50% ;
80
+ margin-left : -60px ;
81
+
82
+ opacity : 0 ;
83
+ transition : opacity 0.3s ;
84
84
}
85
85
86
86
.tooltip .tooltiptext ::after {
87
- content : "" ;
88
- position : absolute;
89
- top : 100% ;
90
- left : 50% ;
91
- margin-left : -5px ;
92
- border-width : 5px ;
93
- border-style : solid;
94
- border-color : # 555 transparent transparent transparent;
87
+ content : "" ;
88
+ position : absolute;
89
+ top : 100% ;
90
+ left : 50% ;
91
+ margin-left : -5px ;
92
+ border-width : 5px ;
93
+ border-style : solid;
94
+ border-color : # 555 transparent transparent transparent;
95
95
}
96
96
97
97
.tooltip : hover .tooltiptext {
98
- visibility : visible;
99
- opacity : 1 ;
98
+ visibility : visible;
99
+ opacity : 1 ;
100
+ }
101
+
102
+ .copy-button {
103
+ background-color : # 4CAF50 ;
104
+ color : # fff ;
105
+ padding : 12px 20px ;
106
+ border : none;
107
+ border-radius : 4px ;
108
+ cursor : pointer;
109
+ font-size : 16px ;
110
+ margin-left : 10px ;
111
+ }
112
+
113
+ .copy-button : hover {
114
+ background-color : # 45a049 ;
100
115
}
101
116
</ style >
102
117
< title >
112
127
{% endblock %}
113
128
</ body >
114
129
115
- </ html >
130
+ </ html >
Original file line number Diff line number Diff line change 19
19
< a href ="/ "> < h1 > 🔗LinkLiberate🪽</ h1 > </ a >
20
20
< div class ="form-container ">
21
21
< p > Link: </ p > < a href ="{{ link }} "> {{ link }}</ a >
22
- < p > Short: </ p > < a href ="{{ short }} "> {{ short }}</ a >
22
+ < p > Short: </ p > < a id ="shortLink " href ="{{ short }} "> {{ short }}</ a >
23
+ < button class ="copy-button " onclick ="copyTextToClipboard('shortLink') "> Copy</ button >
24
+
23
25
</ div >
24
26
</ div >
27
+ < script >
28
+ // Javascript to simply copy text in elementID to user's clipboard
29
+ function copyTextToClipboard ( elementId ) {
30
+ var text = document . getElementById ( elementId ) . textContent || document . getElementById ( elementId ) . innerText ;
31
+ navigator . clipboard . writeText ( text ) . then ( function ( ) {
32
+ console . log ( "Text copied to clipboard" ) ;
33
+ } )
34
+ . catch ( function ( err ) {
35
+ console . error ( 'Error in copying text: ' , err ) ;
36
+ } ) ;
37
+ }
38
+ </ script >
39
+
25
40
{% endblock %}
Original file line number Diff line number Diff line change @@ -14,12 +14,8 @@ def generate_uuid() -> str:
14
14
15
15
return random_code
16
16
17
-
18
17
def make_proper_url (url : str ) -> str :
19
- if url .startswith ("http://" ) or url .startswith ("https://" ):
20
- return url
21
- else :
22
- return f"https://{ url } "
18
+ return f"https://{ url } " if not url .startswith (("http://" , "https://" )) else url
23
19
24
20
25
21
def check_link (link : str ) -> bool :
You can’t perform that action at this time.
0 commit comments