-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjs.php
213 lines (191 loc) · 5.72 KB
/
js.php
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<div class="skiyen_modal" id="skiyen_modal">
<div class="wd100 skiyen_moda_head skiyen_background text-white shadow-sm p-3 mb-2">
<span id="skiyen_modal_title"></span>
<span class="right">
<span class="close_skiyen_modal fa-2x pointer" onclick="close_skiyen_modal()">×</span>
</span>
</div>
<main class="container" role="main">
<div class="wd100" id="skiyen_modal_content">
</div>
</main>
</div>
<div id="xhttp_hidden" style="display: none!important;"></div>
<script type="text/javascript">
var welcome_dir = "welcome/";
function _(el){
return document.getElementById(el);
}
function my_ajax(page,divid,type){
var div = _(divid);
var xhttp;
div.innerHTML = "<span class='spinner-border text-primary'></span>";
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
div.innerHTML = this.responseText;
if(type == "jquerytime"){
$("time.timeago").timeago();
}
}
};
xhttp.open("GET",page, true);
xhttp.send();
}
function my_ajax2(page,divid){
var div = _(divid);
var xhttp;
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
div.innerHTML = this.responseText;
}
};
xhttp.open("GET",page, true);
xhttp.send();
}
function last_activity(){
var xhttp;
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
// console.log('User active');
}
};
xhttp.open("GET","/welcome/last_activity.php", true);
xhttp.send();
setTimeout(last_activity,60000);
}
last_activity();
function _(el){
return document.getElementById(el);
}
var ph = _('profile_picture_height');
var pw = _('profile_picture_width');
var sps = ('set_profile_size');
var upp = _('user_profile_picture');
function set_size(){
upp.style.height = ph.value;
upp.style.width = pw.value;
}
function move_window(page){
return window.location = page;
}
function prev_page(){
return window.history.back();
}
function next_page(){
return window.history.back();
}
function linkify(text) {
var exp = /(\b(https?|ftp|file|):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
return text.replace(exp, "<a href='$1' target='_blank' class='check_chat_link'>$1</a>");
// linkify1(text);
}
</script>
<script type="text/javascript">
function scroller_btn(){
var hideMe = _('upper_btn');
$(document).ready(function(){
$(window).scroll(function(){
if($(window).scrollTop() <= 50){
hideMe.style.opacity = "0";
}else{
hideMe.style.opacity = "1";
}
})
})
}
function _cc(){
console.clear();
}
function goto(dir){
return window.location = dir;
}
function share_to_facebook(text){
url = 'https://work.facebook.com/sharer.php?display=popup&u=' + window.location.href+"&t="+text;
options = 'toolbar=0,status=0,resizable=1,width=626,height=436';
window.open(url,'sharer',options);
}
</script>
<script type="text/javascript">
function send_emoji(divid,value){
_(divid).value += value;
}
function showemoji(){
var emojimodal = document.getElementById("skiyen_emoji_modal");
emojimodal.style.display = "block";
}
function closeemoji(){
var emojimodal = document.getElementById("skiyen_emoji_modal");
emojimodal.style.display = "none";
}
function scroll_down(div){
$(div).scrollTop($(div)[0].scrollHeight);
}
function share_post(item){
var xhttp;
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
}
};
xhttp.open("GET",item, true);
xhttp.send();
}
function close_swal(){
}
function scroll_up(){
$("html").animate({scrollTop:0});
}
var skiyen_modal = _('skiyen_modal');
function close_skiyen_modal(){
skiyen_modal.style.display = "none";
}
function open_skiyen_modal(title,content){
skiyen_modal.style.display = "block";
_('skiyen_modal_content').innerHTML = content;
_('skiyen_modal_title').innerHTML = title;
}
function get_do_you_know(){
my_ajax('/'+welcome_dir+'do_you_know.php','do_you_know');
}
function open_mess(id){
window.location = '/welcome/skiyen_zqq/add.php?rec='+id;
}
var site_whole_page = document.documentElement;
function openFullscreen() {
if (site_whole_page.requestFullscreen) {
site_whole_page.requestFullscreen();
} else if (site_whole_page.mozRequestFullScreen) { /* Firefox */
site_whole_page.mozRequestFullScreen();
} else if (site_whole_page.webkitRequestFullscreen) { /* Chrome, Safari and Opera */
site_whole_page.webkitRequestFullscreen();
} else if (site_whole_page.msRequestFullscreen) { /* IE/Edge */
site_whole_page.msRequestFullscreen();
}
}
function closeFullscreen() {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.mozCancelFullScreen) { /* Firefox */
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) { /* Chrome, Safari and Opera */
document.webkitExitFullscreen();
} else if (document.msExitFullscreen) { /* IE/Edge */
document.msExitFullscreen();
}
}
function open_skiyen_post_page(add){
var url = '/welcome/post/';
goto(url+'?r=load'+add);
}
function set_post_textarea_style(type,bg,col){
var textarea = _('skiyen_post_textarea');
if(type == 'text'){
_('me').innerHTML = 'What\'s on your mind '+bg;
textarea.style.background = bg;
textarea.style.color = col;
}
}
</script>