Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Douglas
jio
Commits
7cb308c7
Commit
7cb308c7
authored
Apr 19, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
complex_example.html reworked and renamed to jio_dashboard.html
parent
49e9f1db
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
124 additions
and
109 deletions
+124
-109
examples/jio_dashboard.html
examples/jio_dashboard.html
+124
-109
No files found.
examples/
complex_example
.html
→
examples/
jio_dashboard
.html
View file @
7cb308c7
...
@@ -2,38 +2,38 @@
...
@@ -2,38 +2,38 @@
<html
lang=
"en"
>
<html
lang=
"en"
>
<head>
<head>
<meta
charset=
"utf-8"
/>
<meta
charset=
"utf-8"
/>
<title>
jIO
Complex Example
</title>
<title>
jIO
Dashboard
</title>
</head>
</head>
<body>
<body>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
<!--
<!--
var
logcolor
=
'
cyan
'
;
var
log
_
color
=
'
cyan
'
;
var
logGetColor
=
function
()
{
var
logGetColor
=
function
()
{
if
(
log
color
===
'
white
'
)
{
if
(
log_
color
===
'
white
'
)
{
log
color
=
'
cyan
'
;
log_
color
=
'
cyan
'
;
}
else
{
}
else
{
log
color
=
'
white
'
;
log_
color
=
'
white
'
;
}
}
return
log
color
;
return
log_
color
;
};
};
var
log
=
function
(
o
)
{
var
log
=
function
(
o
)
{
var
node
=
document
.
createElement
(
'
div
'
);
var
node
=
document
.
createElement
(
'
div
'
);
node
.
setAttribute
(
'
style
'
,
'
background-color:
'
+
logGetColor
()
+
'
;
'
);
node
.
setAttribute
(
'
style
'
,
'
background-color:
'
+
logGetColor
()
+
'
;
'
);
if
(
typeof
o
===
'
string
'
)
{
if
(
typeof
o
===
'
string
'
)
{
node
.
textContent
=
o
;
node
.
textContent
=
o
;
}
else
{
}
else
{
node
.
textContent
=
JSON
.
stringify
(
o
);
node
.
textContent
=
JSON
.
stringify
(
o
);
}
}
document
.
getElementById
(
'
log
'
).
appendChild
(
node
);
document
.
getElementById
(
'
log
'
).
appendChild
(
node
);
};
};
var
error
=
function
(
o
)
{
var
error
=
function
(
o
)
{
var
node
=
document
.
createElement
(
'
div
'
);
var
node
=
document
.
createElement
(
'
div
'
);
node
.
setAttribute
(
'
style
'
,
'
background-color:
'
+
logGetColor
()
+
node
.
setAttribute
(
'
style
'
,
'
background-color:
'
+
logGetColor
()
+
'
;color:red;font-weight:bold
'
);
'
;color:red;font-weight:bold
'
);
if
(
typeof
o
===
'
string
'
)
{
if
(
typeof
o
===
'
string
'
)
{
node
.
textContent
=
o
;
node
.
textContent
=
o
;
}
else
{
}
else
{
node
.
textContent
=
JSON
.
stringify
(
o
);
node
.
textContent
=
JSON
.
stringify
(
o
);
}
}
document
.
getElementById
(
'
log
'
).
appendChild
(
node
);
document
.
getElementById
(
'
log
'
).
appendChild
(
node
);
};
};
...
@@ -62,10 +62,10 @@ var clearlog = function () {
...
@@ -62,10 +62,10 @@ var clearlog = function () {
<input
type=
"password"
id=
"cryptpassword"
value=
"pwd"
placeholder=
"password"
/><br
/>
<input
type=
"password"
id=
"cryptpassword"
value=
"pwd"
placeholder=
"password"
/><br
/>
</th>
</th>
<th>
<th>
<input
type=
"text"
id=
"davu
ser"
value=
""
placeholder=
"username
"
/><br
/>
<input
type=
"text"
id=
"davu
rl"
value=
"http://dav.com/uploads"
placeholder=
"url
"
/><br
/>
<input
type=
"text"
id=
"dava
pp"
value=
""
placeholder=
"application_name"
/>
<br
/>
<input
type=
"text"
id=
"dava
uthtype"
value=
"basic"
placeholder=
"auth_type"
disabled
/>
<br
/>
<input
type=
"
password"
id=
"davpassword"
value=
""
placeholder=
"password
"
/><br
/>
<input
type=
"
text"
id=
"davuser"
value=
"davuser"
placeholder=
"username
"
/><br
/>
<input
type=
"
text"
id=
"davurl"
value=
""
placeholder=
"url
"
/><br
/>
<input
type=
"
password"
id=
"davpassword"
value=
"pwd"
placeholder=
"password
"
/><br
/>
</th>
</th>
<th>
<th>
<input
type=
"text"
id=
"revisionuser"
value=
"localuser"
placeholder=
"username"
/><br
/>
<input
type=
"text"
id=
"revisionuser"
value=
"localuser"
placeholder=
"username"
/><br
/>
...
@@ -92,6 +92,8 @@ var clearlog = function () {
...
@@ -92,6 +92,8 @@ var clearlog = function () {
</td>
</td>
<td
colspan=
"1"
style=
"text-align: center;"
>
<td
colspan=
"1"
style=
"text-align: center;"
>
Options:
<br
/>
Options:
<br
/>
<label
for=
"include_docs"
>
Include Docs
</label>
<input
type=
"checkbox"
id=
"include_docs"
/><br
/>
<label
for=
"show_conflicts"
>
Get Conflicts
</label>
<label
for=
"show_conflicts"
>
Get Conflicts
</label>
<input
type=
"checkbox"
id=
"show_conflicts"
/><br
/>
<input
type=
"checkbox"
id=
"show_conflicts"
/><br
/>
<label
for=
"show_revision_history"
>
Get Revision History
</label>
<label
for=
"show_revision_history"
>
Get Revision History
</label>
...
@@ -113,6 +115,8 @@ var clearlog = function () {
...
@@ -113,6 +115,8 @@ var clearlog = function () {
<!-- </td> -->
<!-- </td> -->
<!-- <td style="text-align: center;"> -->
<!-- <td style="text-align: center;"> -->
-
<button
onclick=
"putAttachment()"
>
putAttachment
</button>
-
<button
onclick=
"putAttachment()"
>
putAttachment
</button>
<button
onclick=
"getAttachment()"
>
getAttachment
</button>
<button
onclick=
"removeAttachment()"
>
removeAttachment
</button>
</td>
</td>
</tr>
</tr>
</table>
</table>
...
@@ -132,6 +136,8 @@ var clearlog = function () {
...
@@ -132,6 +136,8 @@ var clearlog = function () {
<script
type=
"text/javascript"
src=
"../lib/jquery/jquery.min.js"
></script>
<script
type=
"text/javascript"
src=
"../lib/jquery/jquery.min.js"
></script>
<script
type=
"text/javascript"
src=
"../src/jio.storage/davstorage.js"
>
<script
type=
"text/javascript"
src=
"../src/jio.storage/davstorage.js"
>
</script>
</script>
<script
type=
"text/javascript"
src=
"../src/jio.storage/erp5storage.js"
>
</script>
<script
type=
"text/javascript"
src=
"../lib/jsSha2/sha2.js"
></script>
<script
type=
"text/javascript"
src=
"../lib/jsSha2/sha2.js"
></script>
<script
type=
"text/javascript"
src=
"../src/jio.storage/revisionstorage.js"
>
<script
type=
"text/javascript"
src=
"../src/jio.storage/revisionstorage.js"
>
</script>
</script>
...
@@ -145,7 +151,7 @@ var newLocalJio = function () {
...
@@ -145,7 +151,7 @@ var newLocalJio = function () {
localapp
=
$
(
'
#localapp
'
).
attr
(
'
value
'
);
localapp
=
$
(
'
#localapp
'
).
attr
(
'
value
'
);
var
spec
=
{
type
:
'
local
'
,
username
:
localuser
,
application_name
:
localapp
};
var
spec
=
{
type
:
'
local
'
,
username
:
localuser
,
application_name
:
localapp
};
if
(
my_jio
)
{
log
(
'
closing older jio
'
);
my_jio
.
close
();
}
if
(
my_jio
)
{
log
(
'
closing older jio
'
);
my_jio
.
close
();
}
log
(
'
local storage description object:
'
+
JSON
.
stringify
(
spec
));
log
(
'
local storage description object:
'
+
JSON
.
stringify
(
spec
));
my_jio
=
jIO
.
newJio
(
spec
);
my_jio
=
jIO
.
newJio
(
spec
);
};
};
var
newCryptJio
=
function
()
{
var
newCryptJio
=
function
()
{
...
@@ -157,21 +163,23 @@ var newCryptJio = function () {
...
@@ -157,21 +163,23 @@ var newCryptJio = function () {
type
:
'
local
'
,
username
:
user
,
application_name
:
app
type
:
'
local
'
,
username
:
user
,
application_name
:
app
}};
}};
if
(
my_jio
)
{
log
(
'
closing older jio
'
);
my_jio
.
close
();
}
if
(
my_jio
)
{
log
(
'
closing older jio
'
);
my_jio
.
close
();
}
log
(
'
crypt storage description object:
'
+
JSON
.
stringify
(
spec
));
log
(
'
crypt storage description object:
'
+
JSON
.
stringify
(
spec
));
my_jio
=
jIO
.
newJio
(
spec
);
my_jio
=
jIO
.
newJio
(
spec
);
};
};
var
newDavJio
=
function
()
{
var
newDavJio
=
function
()
{
var
user
,
app
,
pwd
,
url
;
var
user
,
app
,
pwd
,
url
;
user
=
$
(
'
#davuser
'
).
attr
(
'
value
'
);
user
=
$
(
'
#davuser
'
).
attr
(
'
value
'
);
app
=
$
(
'
#davapp
'
).
attr
(
'
value
'
);
pwd
=
$
(
'
#davpassword
'
).
attr
(
'
value
'
);
pwd
=
$
(
'
#davpassword
'
).
attr
(
'
value
'
);
url
=
$
(
'
#davurl
'
).
attr
(
'
value
'
);
url
=
$
(
'
#davurl
'
).
attr
(
'
value
'
);
var
spec
=
{
var
spec
=
{
type
:
'
dav
'
,
username
:
user
,
application_name
:
app
,
"
type
"
:
"
dav
"
,
password
:
pwd
,
url
:
url
"
url
"
:
url
,
"
auth_type
"
:
"
basic
"
,
"
username
"
:
user
,
"
password
"
:
pwd
};
};
if
(
my_jio
)
{
log
(
'
closing older jio
'
);
my_jio
.
close
();
}
if
(
my_jio
)
{
log
(
'
closing older jio
'
);
my_jio
.
close
();
}
log
(
'
dav storage description object:
'
+
JSON
.
stringify
(
spec
));
log
(
'
dav storage description object:
'
+
JSON
.
stringify
(
spec
));
my_jio
=
jIO
.
newJio
(
spec
);
my_jio
=
jIO
.
newJio
(
spec
);
};
};
var
newRevisionJio
=
function
()
{
var
newRevisionJio
=
function
()
{
...
@@ -184,48 +192,49 @@ var newRevisionJio = function () {
...
@@ -184,48 +192,49 @@ var newRevisionJio = function () {
}
}
};
};
if
(
my_jio
)
{
log
(
'
closing older jio
'
);
my_jio
.
close
();
}
if
(
my_jio
)
{
log
(
'
closing older jio
'
);
my_jio
.
close
();
}
log
(
'
revision storage description object:
'
+
JSON
.
stringify
(
spec
));
log
(
'
revision storage description object:
'
+
JSON
.
stringify
(
spec
));
my_jio
=
jIO
.
newJio
(
spec
);
my_jio
=
jIO
.
newJio
(
spec
);
};
};
var
newCustomJio
=
function
()
{
var
newCustomJio
=
function
()
{
var
spec
=
JSON
.
parse
(
$
(
'
#customstorage
'
).
attr
(
'
value
'
));
var
spec
=
JSON
.
parse
(
$
(
'
#customstorage
'
).
attr
(
'
value
'
));
if
(
my_jio
)
{
log
(
'
closing older jio
'
);
my_jio
.
close
();
}
if
(
my_jio
)
{
log
(
'
closing older jio
'
);
my_jio
.
close
();
}
log
(
'
custom storage description object:
'
+
JSON
.
stringify
(
spec
));
log
(
'
custom storage description object:
'
+
JSON
.
stringify
(
spec
));
my_jio
=
jIO
.
newJio
(
spec
);
my_jio
=
jIO
.
newJio
(
spec
);
};
};
var
printLocalStorage
=
function
()
{
var
printLocalStorage
=
function
()
{
var
i
;
var
i
;
log
(
'
LOCALSTORAGE
'
);
log
(
'
LOCALSTORAGE
'
);
for
(
i
in
localStorage
)
{
for
(
i
in
localStorage
)
{
log
(
'
-
'
+
i
+
'
:
'
+
localStorage
[
i
]);
log
(
'
-
'
+
i
+
'
:
'
+
localStorage
[
i
]);
}
}
log
(
'
------------------------------
'
);
log
(
'
------------------------------
'
);
};
};
var
callback
=
function
(
err
,
val
,
begin_date
)
{
var
callback
=
function
(
err
,
val
,
begin_date
)
{
log
(
'
time :
'
+
(
Date
.
now
()
-
begin_date
));
log
(
'
time :
'
+
(
Date
.
now
()
-
begin_date
));
if
(
err
)
{
if
(
err
)
{
return
error
(
'
return :
'
+
JSON
.
stringify
(
err
));
return
error
(
'
return :
'
+
JSON
.
stringify
(
err
));
}
}
log
(
'
return :
'
+
JSON
.
stringify
(
val
));
log
(
'
return :
'
+
JSON
.
stringify
(
val
));
};
};
var
command
=
function
(
method
)
{
var
command
=
function
(
method
)
{
var
begin_date
=
Date
.
now
(),
doc
=
{},
opts
=
{};
var
begin_date
=
Date
.
now
(),
doc
=
{},
opts
=
{};
log
(
method
);
log
(
method
);
if
(
!
my_jio
)
{
if
(
!
my_jio
)
{
return
error
(
'
no jio set
'
);
return
error
(
'
no jio set
'
);
}
}
opts
.
conflicts
=
$
(
'
#show_conflicts
'
).
attr
(
'
checked
'
)?
true
:
false
;
opts
.
include_docs
=
$
(
'
#include_docs
'
).
attr
(
'
checked
'
)
?
true
:
false
;
opts
.
revs
=
$
(
'
#show_revision_history
'
).
attr
(
'
checked
'
)?
true
:
false
;
opts
.
conflicts
=
$
(
'
#show_conflicts
'
).
attr
(
'
checked
'
)
?
true
:
false
;
opts
.
revs_info
=
$
(
'
#show_revision_info
'
).
attr
(
'
checked
'
)?
true
:
false
;
opts
.
revs
=
$
(
'
#show_revision_history
'
).
attr
(
'
checked
'
)
?
true
:
false
;
opts
.
revs_info
=
$
(
'
#show_revision_info
'
).
attr
(
'
checked
'
)
?
true
:
false
;
opts
.
max_retry
=
parseInt
(
$
(
'
#max_retry
'
).
attr
(
'
value
'
)
||
'
0
'
);
opts
.
max_retry
=
parseInt
(
$
(
'
#max_retry
'
).
attr
(
'
value
'
)
||
'
0
'
);
doc
=
JSON
.
parse
(
$
(
'
#metadata
'
).
attr
(
'
value
'
));
doc
=
JSON
.
parse
(
$
(
'
#metadata
'
).
attr
(
'
value
'
));
log
(
'
doc:
'
+
JSON
.
stringify
(
doc
));
log
(
'
doc:
'
+
JSON
.
stringify
(
doc
));
log
(
'
opts:
'
+
JSON
.
stringify
(
opts
));
log
(
'
opts:
'
+
JSON
.
stringify
(
opts
));
my_jio
[
method
](
doc
,
opts
,
function
(
err
,
val
)
{
my_jio
[
method
](
doc
,
opts
,
function
(
err
,
val
)
{
callback
(
err
,
val
,
begin_date
);
callback
(
err
,
val
,
begin_date
);
});
});
};
};
var
post
=
function
()
{
var
post
=
function
()
{
...
@@ -245,6 +254,12 @@ var allDocs = function () {
...
@@ -245,6 +254,12 @@ var allDocs = function () {
};
};
var
putAttachment
=
function
()
{
var
putAttachment
=
function
()
{
command
(
'
putAttachment
'
);
command
(
'
putAttachment
'
);
};
var
getAttachment
=
function
()
{
command
(
'
getAttachment
'
);
};
var
removeAttachment
=
function
()
{
command
(
'
removeAttachment
'
);
};
};
//-->
//-->
</script>
</script>
...
...
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