Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cryptochat_FR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Siick
Cryptochat_FR
Commits
7b8bec7f
Commit
7b8bec7f
authored
4 years ago
by
Siick
Browse files
Options
Downloads
Patches
Plain Diff
ajout liens vers chatons ismilaires sur l'accueil
parent
4fdd76dd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#4311
passed
4 years ago
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
index.php
+7
-0
7 additions, 0 deletions
index.php
scripts/alternative-chatons-chat.js
+37
-0
37 additions, 0 deletions
scripts/alternative-chatons-chat.js
with
44 additions
and
0 deletions
index.php
+
7
−
0
View file @
7b8bec7f
...
...
@@ -176,6 +176,13 @@
<br
/>
<input
type=
"submit"
value=
"Créer une nouvelle salle de chat"
/>
</form>
<div
class=
"sameservices"
>
<div
class=
"similarHref"
>
Services similaires :
</div>
<div>
<script
type=
"text/javascript"
src=
"scripts/alternative-chatons-chat.js"
></script>
<p
id=
"entraide-chatons-alternative"
></p>
</div>
</div>
</section>
</div>
<footer>
...
...
This diff is collapsed.
Click to expand it.
scripts/alternative-chatons-chat.js
0 → 100644
+
37
−
0
View file @
7b8bec7f
//https://framagit.org/kepon/file2link/-/blob/master/lib/alternative-chatons.js
const
jsonFile
=
"
https://chatons.org/fr/entraide/json
"
;
const
typeFiltre
=
"
Chat IRC ou Jabber (alternative à MSN)
"
const
openFiltre
=
"
Ouvert à tou⋅te⋅s sans inscription
"
const
separateur
=
'
-
'
//console.log('alternative chatons');
// onready : Inspiré : http://jsfiddle.net/electricvisions/Jacck/
document
.
onreadystatechange
=
function
()
{
var
state
=
document
.
readyState
// A la fin du chargement du document
if
(
state
==
'
complete
'
)
{
entraide
=
{};
// start JSON retrieval here
$
.
getJSON
(
jsonFile
,
function
(
data
)
{
entraide
=
data
.
nodes
;
var
x
=
0
;
for
(
var
i
=
0
;
i
<
entraide
.
length
;
i
++
)
{
if
(
entraide
[
i
].
node
.
type
==
typeFiltre
&&
entraide
[
i
].
node
.
open
==
openFiltre
)
{
if
(
x
!=
0
)
{
$
(
"
#entraide-chatons-alternative
"
).
append
(
separateur
);
}
link
=
entraide
[
i
].
node
.
endpoint
;
link
=
link
.
replace
(
'
https://
'
,
''
);
link
=
link
.
replace
(
'
http://
'
,
''
);
//console.log(link);
const
regex
=
/
\/
$/i
;
link
=
link
.
replace
(
regex
,
''
)
$
(
"
#entraide-chatons-alternative
"
).
append
(
'
<a href="
'
+
entraide
[
i
].
node
.
endpoint
+
'
">
'
+
link
+
'
</a>
'
);
x
=
x
+
1
;
}
}
});
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment