Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sd-doc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Skripnikov
sd-doc
Commits
25308697
Commit
25308697
authored
Nov 06, 2017
by
Valentin Skripnikov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-
parent
a5d20994
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
110 additions
and
0 deletions
+110
-0
docs/_static/html/forms/widgets/unauthorized.html
docs/_static/html/forms/widgets/unauthorized.html
+78
-0
docs/forms/widgets-examples/unauthorized.rst
docs/forms/widgets-examples/unauthorized.rst
+24
-0
docs/forms/widgets.rst
docs/forms/widgets.rst
+8
-0
No files found.
docs/_static/html/forms/widgets/unauthorized.html
0 → 100644
View file @
25308697
<!DOCTYPE html>
<html>
<head
lang=
"en"
>
<meta
charset=
"UTF-8"
>
<title>
unAuthorized
</title>
<script>
FORM_PLAYER_URL_PREFIX
=
"
http://192.168.3.16:8080/Synergy/
"
;
<!--
служебная
переменная
для
корректной
работы
компонента
"
HTD-редактор
"
-->
</script>
<link
rel=
"stylesheet"
href=
"http://192.168.3.16:8080/Synergy/js/form.player.css"
/>
<!--стандартный стиль компонентов формы-->
<script
src=
"http://192.168.3.16:8080/Synergy/js/vendor.js"
type=
"text/javascript"
></script>
<!--ссылка на сторонние библиотеки-->
<script
src=
"http://192.168.3.16:8080/Synergy/js/form.player.js"
type=
"text/javascript"
></script>
<!--ссылка на проигрыватель форм-->
<style>
.error-message
{
color
:
red
;
text-align
:
center
;
}
</style>
</head>
<body>
<div
id=
"form_player_container"
>
<div
id=
"form_player_div"
></div>
</div>
<script>
'
use strict
'
;
AS
.
OPTIONS
.
locale
=
"
ru
"
;
AS
.
OPTIONS
.
coreUrl
=
"
http://192.168.3.16:8080/Synergy/
"
;
/**
* Перехватываем событие неуспешной авторизации
*/
AS
.
SERVICES
.
unAuthorized
=
function
()
{
$
(
"
#form_player_div
"
).
addClass
(
"
error-message
"
);
$
(
"
#form_player_div
"
).
text
(
"
Ошибка авторизации. Доступ запрещен.
"
);
};
var
portal
=
{
player
:
null
,
/**
* очистить текущий проигрыватель форм
*/
clearPlayer
:
function
()
{
if
(
portal
.
player
)
{
portal
.
player
.
destroy
();
}
},
/**
* добавить новый проигрыватель форм
*/
createPlayer
:
function
(
formCode
)
{
portal
.
clearPlayer
();
portal
.
player
=
AS
.
FORMS
.
createPlayer
();
portal
.
player
.
showFormByCode
(
formCode
);
portal
.
player
.
view
.
setEditable
(
true
);
portal
.
player
.
view
.
appendTo
(
$
(
'
#form_player_div
'
));
}
};
$
(
document
).
ready
(
function
()
{
AS
.
OPTIONS
.
login
=
"
11
"
;
AS
.
OPTIONS
.
password
=
"
11
"
;
portal
.
createPlayer
(
"
sd-doc-widget-examples
"
);
});
</script>
</body>
</html>
docs/forms/widgets-examples/unauthorized.rst
0 → 100644
View file @
25308697
.. _widgets-examples-unauthorized:
Пример использования AS.SERVICES.unAuthorized
"""""""""""""""""""""""""""""""""""""""""""""
.. raw:: html
<iframe src="../../_static/html/forms/widgets/unauthorized.html" scrolling='no' frameBorder="1" height="200px" width="100%"></iframe>
Исходный код функции
.. code-block:: js
AS.SERVICES.unAuthorized = function () {
$("#form_player_div").addClass("error-message");
$("#form_player_div").text("Ошибка авторизации. Доступ запрещен.");
};
Полный исходный код
.. literalinclude:: ../../_static/html/forms/widgets/unauthorized.html
:language: html
:emphasize-lines: 42-45
:encoding: utf-8
docs/forms/widgets.rst
View file @
25308697
...
...
@@ -57,3 +57,11 @@
:ref:`widgets-examples-waitwindow`
.. js:function:: AS.SERVICES.unAuthorized()
Функция, которая будет вызвана в случае неуспешной авторизации при вызове
методов REST API Synergy.
Приложения могут использовать данный метод реализации обработки случаев
некорректного ввода логина или пароля пользователя.
:ref:`widgets-examples-unauthorized`
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment