Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
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
TeDomum
Matrix
Commits
c80f7394
Commit
c80f7394
authored
10 years ago
by
Kegan Dougal
Browse files
Options
Downloads
Patches
Plain Diff
Added webclient config.js for storing recaptcha public key.
parent
13045838
Loading
Loading
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
webclient/README
+15
-3
15 additions, 3 deletions
webclient/README
webclient/index.html
+1
-0
1 addition, 0 deletions
webclient/index.html
webclient/login/register-controller.js
+13
-2
13 additions, 2 deletions
webclient/login/register-controller.js
with
31 additions
and
5 deletions
.gitignore
+
2
−
0
View file @
c80f7394
...
...
@@ -24,4 +24,6 @@ graph/*.svg
graph/*.png
graph/*.dot
webclient/config.js
uploads
This diff is collapsed.
Click to expand it.
webclient/README
+
15
−
3
View file @
c80f7394
Basic Usage
-----------
The Synapse web client needs to be hosted by a basic HTTP server.
You can use the Python simple HTTP server::
The web client should automatically run when running the home server. Alternatively, you can run
it stand-alone:
$ python -m SimpleHTTPServer
Then, open this URL in a WEB browser::
http://127.0.0.1:8000/
ReCaptcha Keys
--------------
The web client will look for the global variable webClientConfig for config options. You should
put your ReCaptcha public key there like so:
webClientConfig = {
recaptcha_public_key: "YOUR_PUBLIC_KEY"
}
This should be put in webclient/config.js which is already .gitignored, rather than in the web
client source files.
This diff is collapsed.
Click to expand it.
webclient/index.html
+
1
−
0
View file @
c80f7394
...
...
@@ -17,6 +17,7 @@
<script
src=
"js/angular-sanitize.min.js"
></script>
<script
type=
'text/javascript'
src=
'js/ng-infinite-scroll-matrix.js'
></script>
<script
src=
"app.js"
></script>
<script
src=
"config.js"
></script>
<script
src=
"app-controller.js"
></script>
<script
src=
"app-directive.js"
></script>
<script
src=
"app-filter.js"
></script>
...
...
This diff is collapsed.
Click to expand it.
webclient/login/register-controller.js
+
13
−
2
View file @
c80f7394
...
...
@@ -19,7 +19,7 @@ angular.module('RegisterController', ['matrixService'])
function
(
$scope
,
$rootScope
,
$location
,
matrixService
,
eventStreamService
)
{
'
use strict
'
;
var
useCaptcha
=
fals
e
;
var
useCaptcha
=
tru
e
;
// FIXME: factor out duplication with login-controller.js
...
...
@@ -147,7 +147,18 @@ angular.module('RegisterController', ['matrixService'])
var
setupCaptcha
=
function
()
{
console
.
log
(
"
Setting up ReCaptcha
"
)
Recaptcha
.
create
(
"
6Le31_kSAAAAAK-54VKccKamtr-MFA_3WS1d_fGV
"
,
var
config
=
window
.
webClientConfig
;
var
public_key
=
undefined
;
if
(
config
===
undefined
)
{
console
.
error
(
"
Couldn't find webClientConfig. Cannot get public key for captcha.
"
);
}
else
{
public_key
=
webClientConfig
.
recaptcha_public_key
;
if
(
public_key
===
undefined
)
{
console
.
error
(
"
No public key defined for captcha!
"
)
}
}
Recaptcha
.
create
(
public_key
,
"
regcaptcha
"
,
{
theme
:
"
red
"
,
...
...
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