-
Notifications
You must be signed in to change notification settings - Fork 7
/
base.html
166 lines (147 loc) · 6.29 KB
/
base.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<html>
{% load static %}
<head>
<title>
{% block title %}
{{ header }}
{% endblock title %}
</title>
{% block stylesheets %}
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="/static/devops/styles.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<!--Tinymce Text-Editor (Must be in Head Tag) -->
<script src="{% static 'devops/js/tinymce/tinymce.min.js' %}"></script>
<script type="text/javascript" src="{% static 'devops/js/tinymce/custom.js' %}" ></script>
{% endblock stylesheets %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/3.3.0/fuse.min.js">
</script>
</head>
<body class="dashboard">
<div id="container-fluid">
<div id="header" >
<div id="user-tools">
<a href="/" class="header-title">{{ header }}</a>
<div id="navbar">
<a href="/">Home</a>
<a href="/devops/gloss">Glossary</a>
<a href="https://gcallah.pythonanywhere.com/berkeley/">Biblio.</a>
<a href="/devops/about">About</a>
{% if user.is_authenticated %}
<a href="{% url 'participant_logout' %}">Log out</a>
{% else %}
<a href="{% url 'participant_login' %}">Login</a>
{% endif %}
</div>
<form class="form-inline my-2 my-lg-0"
action="{% url 'devops:parse_search' %}"
id="search"
style="position: absolute;top:0.75vh;right:6vw;display: none;" >
<input class="mr-sm-2 header-search-input"
name="query" type="search" aria-label="Search">
<button class="header-button">
search
</button>
</form>
<button class="header-button" id='bt'
style="position: absolute;top:1.2vh;right:3.5vw;">
<i class="material-icons "
style="margin-bottom: 0.3vh;">search</i>
</button>
</div>
</div>
<div id="content" class="container-fluid">
{% block content %}
{% endblock content %}
</div>
</div>
<script>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous">
</script>
</body>
<script src="/static/devops/js/show_searchbar.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"> </script>
<script>
$.support.cors = true;
</script>
<script>
window.onload = getlink;
function getlink()
{
$.ajax({
type: "GET",
crossDomain: true,
headers:
{
'Content-Type': 'application/x-www-form-urlencoded'
},
async :false,
url: "https://cors.io/?http://devops.com/feed/",
dataType: "xml",
success: function(xml) {
var links= [];
var descriptions = [];
var linkt = [];
var imageLins = [];
var cnt= 0;
$(xml).find('item').each(function()
{
var content = $(this).find('description').text();
var linktitle = $(this).find('title').text();
if (content.includes("src"))
{
var a = content.split(" ")[3];
var b = "<img " +a+"/>";
var link1 = a.split("=")[1];
links.push(link1);
var des = content.match("<p>(.*)</p>")[1];
var link = content.match("<a(.*)</a>");
var des= des +"<br>" +"<a " +link[0];
descriptions.push(des);
linkt.push(linktitle);
var cnt =0 ;
var imagel = ((link[0].match("href=(.*)/\"")[0]).split("=")[1]).split("\"")[1];
imageLins.push(imagel);
slider1(links,descriptions,linkt,cnt,imageLins)
}
});
},
error: function(errorThrown)
{
alert(JSON.stringify(errorThrown));
},
});
}
function slider1(links,descriptions,linkt,cnt,imageLins)
{
let timerId = setTimeout(function tick() {
if(cnt >= links.length) {
cnt = 0;
}
document.getElementById('image1').src= links[cnt].split("\"")[1];
document.getElementById('sliderHeader').innerHTML= linkt[cnt]; //or append?
document.getElementById('sliderPara').innerHTML= descriptions[cnt];
document.getElementById('imageLink').href= imageLins[cnt];
cnt++;
timerId = setTimeout(tick, 5000);
}, 1000);
}
}
</script>
</html>