Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Thimo Kraemer
KSS
Commits
6ce7fda0
Commit
6ce7fda0
authored
Nov 08, 2018
by
Thimo Kraemer
Browse files
randomString -> uniqueId
parent
6e2bb1b7
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
kss.js
kss.js
+10
-9
kss.min.js
kss.min.js
+2
-2
No files found.
kss.js
View file @
6ce7fda0
/*
* KSS-RPC v0.1
5
-beta
* KSS-RPC v0.1
6
-beta
*
* Copyright (c) 2017, joonis new media
* Author: Thimo Kraemer <thimo.kraemer@joonis.de>
...
...
@@ -61,7 +61,7 @@
******************************************************************************************/
var
kss
=
{
version
:
'
0.1
5
-beta
'
,
version
:
'
0.1
6
-beta
'
,
_initialized
:
false
,
_ruleSheets
:
{},
_eventBinders
:
{},
...
...
@@ -286,8 +286,9 @@ kss.ISO8601toDate = function(date) {
}
};
kss
.
randomString
=
function
()
{
return
Math
.
floor
(
Math
.
random
()
*
1
e16
).
toString
(
16
);
kss
.
uniqueId
=
function
()
{
return
Math
.
random
().
toString
(
36
).
substring
(
2
)
+
(
new
Date
()).
getTime
().
toString
(
36
);
};
kss
.
eval
=
function
(
__expr__
)
{
...
...
@@ -1059,7 +1060,7 @@ kss.RPC.prototype.invoke = function(method, params,
var
request
=
{
method
:
method
,
params
:
params
||
[],
id
:
kss
.
randomString
()
id
:
kss
.
uniqueId
()
};
if
(
this
.
_protocol
!=
'
json-rpc-v1
'
)
{
request
.
jsonrpc
=
'
2.0
'
;
...
...
@@ -2562,10 +2563,10 @@ window.addEventListener('hashchange', function(event) {
kss
.
addHistoryState
=
function
()
{
var
hash
=
window
.
location
.
hash
;
if
(
!
kss
.
_historyre
.
test
(
hash
))
{
kss
.
_historyHash
=
'
#kss-
'
+
kss
.
randomString
();
kss
.
_historyHash
=
'
#kss-
'
+
kss
.
uniqueId
();
window
.
location
.
replace
(
kss
.
_historyHash
);
}
window
.
location
.
hash
=
'
#kss-
'
+
kss
.
randomString
();
window
.
location
.
hash
=
'
#kss-
'
+
kss
.
uniqueId
();
};
kss
.
registerActionProvider
(
'
addHistoryState
'
,
kss
.
addHistoryState
);
...
...
@@ -2796,7 +2797,7 @@ kss._loadAnimationLib = function () {
window
.
history
.
pushState
({},
''
,
'
#
'
+
id
);
}
else
{
window
.
location
.
hash
=
'
#
'
+
kss
.
randomString
();
window
.
location
.
hash
=
'
#
'
+
kss
.
uniqueId
();
}
}
return
container
;
...
...
@@ -3074,7 +3075,7 @@ kss._loadAnimationLib = function () {
}
if
(
!
kss
.
scroll
)
{
kss
.
scroll
=
function
(
node
,
params
)
{
window
.
location
.
hash
=
node
.
id
||
kss
.
randomString
();
window
.
location
.
hash
=
node
.
id
||
kss
.
uniqueId
();
node
.
scrollIntoView
();
};
}
...
...
kss.min.js
View file @
6ce7fda0
This diff is collapsed.
Click to expand it.
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