Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
0e8ab6e4
Commit
0e8ab6e4
authored
May 11, 2012
by
Tristan Cavelier
Committed by
Sebastien Robin
May 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JIO is now compatible with require.js.
parent
b233a99c
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
176 additions
and
78 deletions
+176
-78
jiotest/index.html
jiotest/index.html
+6
-7
jiotest/index_withoutrequirejs.html
jiotest/index_withoutrequirejs.html
+22
-0
jiotest/jio.dummystorages.js
jiotest/jio.dummystorages.js
+11
-16
jiotest/jiotests.js
jiotest/jiotests.js
+49
-16
jiotest/jiotests.loader.js
jiotest/jiotests.loader.js
+11
-0
jiotest/require/require.js
jiotest/require/require.js
+33
-0
jiotest/unhosted/jio.js
jiotest/unhosted/jio.js
+12
-19
jiotest/unhosted/jio.storage.js
jiotest/unhosted/jio.storage.js
+20
-16
jiotest/unhosted/localorcookiestorage.js
jiotest/unhosted/localorcookiestorage.js
+12
-4
No files found.
jiotest/index.html
View file @
0e8ab6e4
...
@@ -8,14 +8,13 @@
...
@@ -8,14 +8,13 @@
<body>
<body>
<div
id=
"qunit"
></div>
<div
id=
"qunit"
></div>
<script
type=
"text/javascript"
src=
"qunit/qunit-1.5.0.js"
></script>
<script
type=
"text/javascript"
src=
"qunit/qunit-1.5.0.js"
></script>
<script
type=
"text/javascript"
src=
"js/jquery/jquery.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/localorcookiestorage.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/jio.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/base64.js"
></script>
<script
type=
"text/javascript"
src=
"jio.dummystorages.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/jio.storage.js"
></script>
<script
type=
"text/javascript"
src=
"sinon/sinon-1.3.4.js"
></script>
<script
type=
"text/javascript"
src=
"sinon/sinon-1.3.4.js"
></script>
<script
type=
"text/javascript"
src=
"sinon/sinon-qunit-1.0.0.js"
></script>
<script
type=
"text/javascript"
src=
"sinon/sinon-qunit-1.0.0.js"
></script>
<script
type=
"text/javascript"
src=
"jiotests.js"
></script>
<script
type=
"text/javascript"
>
<!--
var
require
=
{};
// IE compatibility
//-->
</script>
<script
data-main=
"jiotests"
src=
"require/require.js"
></script>
</body>
</body>
</html>
</html>
jiotest/
debug
.html
→
jiotest/
index_withoutrequirejs
.html
View file @
0e8ab6e4
...
@@ -2,51 +2,21 @@
...
@@ -2,51 +2,21 @@
<html
lang=
"en"
>
<html
lang=
"en"
>
<head>
<head>
<meta
charset=
"utf-8"
/>
<meta
charset=
"utf-8"
/>
<title>
Test
</title>
<title>
JIO QUnit/Sinon
Test
</title>
<link
rel=
"stylesheet"
href=
"qunit/qunit-1.5.0.css"
/>
<link
rel=
"stylesheet"
href=
"qunit/qunit-1.5.0.css"
/>
</head>
</head>
<body>
<body>
<div
id=
"qunit"
></div>
<script
type=
"text/javascript"
src=
"qunit/qunit-1.5.0.js"
></script>
<script
type=
"text/javascript"
src=
"sinon/sinon-1.3.4.js"
></script>
<script
type=
"text/javascript"
src=
"sinon/sinon-qunit-1.0.0.js"
></script>
<script
type=
"text/javascript"
src=
"js/jquery/jquery.js"
></script>
<script
type=
"text/javascript"
src=
"js/jquery/jquery.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/localorcookiestorage.js"
>
<script
type=
"text/javascript"
src=
"unhosted/localorcookiestorage.js"
>
</script>
</script>
<script
type=
"text/javascript"
src=
"unhosted/jio.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/jio.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/base64.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/base64.js"
></script>
<script
type=
"text/javascript"
src=
"jio.dummystorages.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/jio.storage.js"
></script>
<script
type=
"text/javascript"
src=
"unhosted/jio.storage.js"
></script>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
src=
"jiotests.js"
></script>
<!--
var
maClassPasProtegee
=
function
()
{
this
.
monAttributPasProtegee
=
0
;
};
maClassPasProtegee
.
prototype
=
{
getMonAttribut
:
function
()
{
return
this
.
monAttributPasProtegee
;
},
logMonAttribut
:
function
()
{
console
.
log
(
this
.
monAttributPasProtegee
);
}
};
var
maclass1
=
new
maClassPasProtegee
();
maclass1
.
logMonAttribut
();
maclass1
.
monAttributPasProtegee
++
;
maclass1
.
logMonAttribut
();
var
maClassProtegee
=
function
()
{
var
publ
=
{},
priv
=
{};
priv
.
monAttributProtegee
=
0
;
publ
.
getMonAttribut
=
function
()
{
return
priv
.
monAttributProtegee
;
};
publ
.
logMonAttribut
=
function
()
{
console
.
log
(
priv
.
monAttributProtegee
);
};
return
publ
;
};
var
maclass2
=
new
maClassProtegee
();
maclass2
.
logMonAttribut
();
maclass2
.
monAttributProtegee
++
;
maclass2
.
logMonAttribut
();
//-->
</script>
</body>
</body>
</html>
</html>
jiotest/jio.dummystorages.js
View file @
0e8ab6e4
// Adds 3 dummy storages
for Jio
// Adds 3 dummy storages
to JIO
// type:
// type:
// - dummyallok
// - dummyallok
// - dummyallfail
// - dummyallfail
// - dummyallnotfound
// - dummyallnotfound
// - dummyall3tries
// - dummyall3tries
;(
function
(
Jio
)
{
(
function
()
{
var
jio_dummy_storage_loader
=
function
(
Jio
)
{
// check dependencies
var
errorDependencies
=
function
(){
$
.
error
(
'
Cannot find Jio
'
);};
try
{
if
(
!
Jio
){
errorDependencies
();
return
;
}}
catch
(
e
){
errorDependencies
();
return
;}
////////////////////////////////////////////////////////////////////////////
// globals
var
jioGlobalObj
=
Jio
.
getGlobalObject
(),
// end globals
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// Dummy Storage 1 : all ok
// Dummy Storage 1 : all ok
...
@@ -287,4 +274,12 @@
...
@@ -287,4 +274,12 @@
return
DummyStorageAll3Tries
(
options
);
return
DummyStorageAll3Tries
(
options
);
});
});
})(
JIO
);
};
if
(
window
.
requirejs
)
{
define
(
'
JIODummyStorages
'
,[
'
JIO
'
],
jio_dummy_storage_loader
);
}
else
{
jio_dummy_storage_loader
(
JIO
);
}
})();
\ No newline at end of file
jiotest/jiotests.js
View file @
0e8ab6e4
(
function
()
{
var
thisfun
=
function
(
loader
)
{
var
JIO
=
loader
.
JIO
,
LocalOrCookieStorage
=
loader
.
LocalOrCookieStorage
,
Base64
=
loader
.
Base64
;
(
function
(){
//// clear jio localstorage
//// clear jio localstorage
for
(
var
k
in
LocalOrCookieStorage
.
getAll
())
{
for
(
var
k
in
LocalOrCookieStorage
.
getAll
())
{
var
splitk
=
k
.
split
(
'
/
'
);
var
splitk
=
k
.
split
(
'
/
'
);
...
@@ -271,7 +274,7 @@ test ('Document save', function () {
...
@@ -271,7 +274,7 @@ test ('Document save', function () {
// We launch a saving to localstorage and we check if the file is
// We launch a saving to localstorage and we check if the file is
// realy saved. Then save again and check if
// realy saved. Then save again and check if
var
o
=
{},
clock
=
this
.
sandbox
.
useFakeTimers
(),
t
=
this
,
tmp
,
var
o
=
{},
clock
=
this
.
sandbox
.
useFakeTimers
(),
t
=
this
,
mytest
=
function
(
message
,
value
,
lmcd
){
mytest
=
function
(
message
,
value
,
lmcd
){
o
.
f
=
function
(
result
)
{
o
.
f
=
function
(
result
)
{
deepEqual
(
result
.
isSaved
,
value
,
message
);};
deepEqual
(
result
.
isSaved
,
value
,
message
);};
...
@@ -284,11 +287,12 @@ test ('Document save', function () {
...
@@ -284,11 +287,12 @@ test ('Document save', function () {
ok
(
false
,
'
no response / too much results
'
);
ok
(
false
,
'
no response / too much results
'
);
else
{
else
{
// check content
// check content
tmp
=
LocalOrCookieStorage
.
getItem
(
'
jio/local/MrSaveName/jiotests/file
'
);
o
.
tmp
=
LocalOrCookieStorage
.
getItem
(
tmp
.
lmcd
=
lmcd
(
tmp
.
creationDate
,
tmp
.
lastModified
);
'
jio/local/MrSaveName/jiotests/file
'
);
delete
tmp
.
lastModified
;
o
.
tmp
.
lmcd
=
lmcd
(
o
.
tmp
.
creationDate
,
o
.
tmp
.
lastModified
);
delete
tmp
.
creationDate
;
delete
o
.
tmp
.
lastModified
;
deepEqual
(
tmp
,{
'
fileName
'
:
'
file
'
,
'
fileContent
'
:
'
content
'
,
delete
o
.
tmp
.
creationDate
;
deepEqual
(
o
.
tmp
,{
'
fileName
'
:
'
file
'
,
'
fileContent
'
:
'
content
'
,
'
lmcd
'
:
true
},
'
check content
'
);
'
lmcd
'
:
true
},
'
check content
'
);
}
}
};
};
...
@@ -397,8 +401,9 @@ test ('Document remove', function () {
...
@@ -397,8 +401,9 @@ test ('Document remove', function () {
ok
(
false
,
'
no response / too much results
'
);
ok
(
false
,
'
no response / too much results
'
);
else
{
else
{
// check if the file is still there
// check if the file is still there
var
tmp
=
LocalOrCookieStorage
.
getItem
(
'
jio/local/MrRemoveName/jiotests/file
'
);
o
.
tmp
=
LocalOrCookieStorage
.
getItem
(
ok
(
!
tmp
,
'
check no content
'
);
'
jio/local/MrRemoveName/jiotests/file
'
);
ok
(
!
o
.
tmp
,
'
check no content
'
);
}
}
};
};
o
.
jio
=
JIO
.
createNew
({
'
type
'
:
'
local
'
,
'
userName
'
:
'
MrRemoveName
'
},
o
.
jio
=
JIO
.
createNew
({
'
type
'
:
'
local
'
,
'
userName
'
:
'
MrRemoveName
'
},
...
@@ -502,7 +507,8 @@ test ('Document save', function () {
...
@@ -502,7 +507,8 @@ test ('Document save', function () {
"
PROPFIND
"
,
"
https://ca-davstorage:8080/dav/davsave/jiotests/file
"
,
"
PROPFIND
"
,
"
https://ca-davstorage:8080/dav/davsave/jiotests/file
"
,
[
errnoprop
,{
'
Content-Type
'
:
'
text/xml; charset="utf-8"
'
},
[
errnoprop
,{
'
Content-Type
'
:
'
text/xml; charset="utf-8"
'
},
davsave
]);
davsave
]);
server
.
respondWith
(
"
PUT
"
,
server
.
respondWith
(
"
PUT
"
,
"
https://ca-davstorage:8080/dav/davsave/jiotests/file
"
,
"
https://ca-davstorage:8080/dav/davsave/jiotests/file
"
,
[
errnoput
,
{
'
Content-Type
'
:
'
x-www-form-urlencoded
'
},
[
errnoput
,
{
'
Content-Type
'
:
'
x-www-form-urlencoded
'
},
'
content
'
]);
'
content
'
]);
...
@@ -681,7 +687,8 @@ test ('Check name availability', function () {
...
@@ -681,7 +687,8 @@ test ('Check name availability', function () {
{
'
type
'
:
'
dummyall3tries
'
,
'
userName
'
:
'
3
'
}]},
{
'
type
'
:
'
dummyall3tries
'
,
'
userName
'
:
'
3
'
}]},
{
'
type
'
:
'
dummyall3tries
'
,
'
userName
'
:
'
4
'
}]},
{
'
type
'
:
'
dummyall3tries
'
,
'
userName
'
:
'
4
'
}]},
{
'
ID
'
:
'
jiotests
'
});
{
'
ID
'
:
'
jiotests
'
});
mytest
(
'
DummyStorageAll{3tries,{3tries,3tries},3tries} : name available
'
,
true
);
mytest
(
'
DummyStorageAll{3tries,{3tries,3tries},3tries} : name available
'
,
true
);
o
.
jio
.
stop
();
o
.
jio
.
stop
();
});
});
...
@@ -804,5 +811,31 @@ test ('Remove document', function () {
...
@@ -804,5 +811,31 @@ test ('Remove document', function () {
mytest
(
'
DummyStorageAllOK,3tries: remove document .
'
,
true
);
mytest
(
'
DummyStorageAllOK,3tries: remove document .
'
,
true
);
o
.
jio
.
stop
();
o
.
jio
.
stop
();
});
});
// end require
};
// end thisfun
if
(
window
.
requirejs
)
{
require
.
config
({
paths
:
{
jiotestsloader
:
'
jiotests.loader
'
,
LocalOrCookieStorage
:
'
unhosted/localorcookiestorage
'
,
jQuery
:
'
js/jquery/jquery
'
,
JIO
:
'
unhosted/jio
'
,
Base64
:
'
unhosted/base64
'
,
JIODummyStorages
:
'
jio.dummystorages
'
,
JIOStorages
:
'
unhosted/jio.storage
'
,
QUnit
:
'
qunit/qunit-1.5.0
'
,
Sinon
:
'
sinon/sinon-1.3.4
'
,
SinonQUnit
:
'
sinon/sinon-qunit-1.0.0
'
}
});
require
([
'
jiotestsloader
'
],
thisfun
);
}
else
{
thisfun
({
LocalOrCookieStorage
:
LocalOrCookieStorage
,
JIO
:
JIO
,
Base64
:
Base64
});
}
})();
})();
jiotest/jiotests.loader.js
0 → 100644
View file @
0e8ab6e4
define
(
'
jiotestsloader
'
,[
'
LocalOrCookieStorage
'
,
'
JIO
'
,
'
Base64
'
,
'
JIODummyStorages
'
,
'
JIOStorages
'
,
'
jQuery
'
],
function
(
LocalOrCookieStorage
,
JIO
,
Base64
)
{
return
{
LocalOrCookieStorage
:
LocalOrCookieStorage
,
JIO
:
JIO
,
Base64
:
Base64
};
});
jiotest/require/require.js
0 → 100644
View file @
0e8ab6e4
This diff is collapsed.
Click to expand it.
jiotest/unhosted/jio.js
View file @
0e8ab6e4
;
var
JIO
=
;
var
JIO
=
(
function
()
{
(
function
()
{
var
jio_loader_function
=
function
(
LocalOrCookieStorage
)
{
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// constants
// constants
...
@@ -181,20 +181,7 @@
...
@@ -181,20 +181,7 @@
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// Tools
// Tools
checkJioDependencies
=
function
()
{
var
retval
=
true
,
err
=
function
(
name
)
{
console
.
error
(
'
Fail to load
'
+
name
);
retval
=
false
;
};
try
{
if
(
!
JSON
)
{
err
(
'
JSON
'
);
}
}
catch
(
e
)
{
err
(
'
JSON
'
);
}
try
{
if
(
!
jQuery
)
{
err
(
'
jQuery
'
);
}
}
catch
(
e
)
{
err
(
'
jQuery
'
);
}
try
{
if
(
!
LocalOrCookieStorage
)
{
err
(
'
LocalOrCookieStorage
'
);
}
}
catch
(
e
)
{
err
(
'
LocalOrCookieStorage
'
);
}
return
retval
;
},
// end Tools
// end Tools
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
...
@@ -204,9 +191,6 @@
...
@@ -204,9 +191,6 @@
// end Classes
// end Classes
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// check dependencies
if
(
!
checkJioDependencies
())
{
return
;
}
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// Publisher Subcriber
// Publisher Subcriber
PubSub
=
function
()
{
PubSub
=
function
()
{
...
@@ -1206,4 +1190,13 @@
...
@@ -1206,4 +1190,13 @@
return
new
JioCreator
();
return
new
JioCreator
();
// end Jio Creator
// end Jio Creator
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
};
if
(
window
.
requirejs
)
{
define
(
'
JIO
'
,[
'
LocalOrCookieStorage
'
,
'
jQuery
'
],
jio_loader_function
);
return
undefined
;
}
else
{
return
jio_loader_function
(
LocalOrCookieStorage
,
jQuery
);
}
})();
})();
\ No newline at end of file
jiotest/unhosted/jio.storage.js
View file @
0e8ab6e4
// Adds 3 storages
for Jio
// Adds 3 storages
to JIO
// type:
// type:
// - local
// - local
// - dav
// - dav
// - replicate
// - replicate
;(
function
(
Jio
)
{
(
function
()
{
var
jio_storage_loader
=
function
(
LocalOrCookieStorage
,
Jio
)
{
////////////////////////////////////////////////////////////////////////////
// globals
var
jioGlobalObj
=
Jio
.
getGlobalObject
(),
// end globals
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// Tools
// Tools
checkJioDependencies
=
function
()
{
var
checkJioDependencies
=
function
()
{
var
retval
=
true
,
var
retval
=
true
,
err
=
function
(
name
)
{
err
=
function
(
name
)
{
console
.
error
(
'
Fail to load
'
+
name
);
console
.
error
(
'
Fail to load
'
+
name
);
...
@@ -51,7 +45,7 @@
...
@@ -51,7 +45,7 @@
setTimeout
(
function
()
{
setTimeout
(
function
()
{
var
localStorageObject
=
null
;
var
localStorageObject
=
null
;
localStorageObject
=
jioGlobalObj
.
local
Storage
.
getAll
();
localStorageObject
=
LocalOrCookie
Storage
.
getAll
();
for
(
var
k
in
localStorageObject
)
{
for
(
var
k
in
localStorageObject
)
{
var
splitk
=
k
.
split
(
'
/
'
);
var
splitk
=
k
.
split
(
'
/
'
);
if
(
splitk
[
0
]
===
'
jio
'
&&
if
(
splitk
[
0
]
===
'
jio
'
&&
...
@@ -77,7 +71,7 @@
...
@@ -77,7 +71,7 @@
var
doc
=
null
;
var
doc
=
null
;
// reading
// reading
doc
=
jioGlobalObj
.
local
Storage
.
getItem
(
doc
=
LocalOrCookie
Storage
.
getItem
(
'
jio/local/
'
+
that
.
getStorageUserName
()
+
'
/
'
+
'
jio/local/
'
+
that
.
getStorageUserName
()
+
'
/
'
+
that
.
getApplicantID
()
+
'
/
'
+
that
.
getApplicantID
()
+
'
/
'
+
that
.
getFileName
());
that
.
getFileName
());
...
@@ -94,7 +88,7 @@
...
@@ -94,7 +88,7 @@
doc
.
lastModified
=
Date
.
now
();
doc
.
lastModified
=
Date
.
now
();
doc
.
fileContent
=
that
.
getFileContent
();
doc
.
fileContent
=
that
.
getFileContent
();
}
}
jioGlobalObj
.
local
Storage
.
setItem
(
LocalOrCookie
Storage
.
setItem
(
'
jio/local/
'
+
that
.
getStorageUserName
()
+
'
/
'
+
'
jio/local/
'
+
that
.
getStorageUserName
()
+
'
/
'
+
that
.
getApplicantID
()
+
'
/
'
+
that
.
getApplicantID
()
+
'
/
'
+
that
.
getFileName
(),
doc
);
that
.
getFileName
(),
doc
);
...
@@ -116,7 +110,7 @@
...
@@ -116,7 +110,7 @@
var
doc
=
null
,
settings
=
$
.
extend
(
var
doc
=
null
,
settings
=
$
.
extend
(
{
'
getContent
'
:
true
},
that
.
cloneOptionObject
());
{
'
getContent
'
:
true
},
that
.
cloneOptionObject
());
doc
=
jioGlobalObj
.
local
Storage
.
getItem
(
doc
=
LocalOrCookie
Storage
.
getItem
(
'
jio/local/
'
+
that
.
getStorageUserName
()
+
'
/
'
+
'
jio/local/
'
+
that
.
getStorageUserName
()
+
'
/
'
+
that
.
getApplicantID
()
+
'
/
'
+
that
.
getFileName
());
that
.
getApplicantID
()
+
'
/
'
+
that
.
getFileName
());
if
(
!
doc
)
{
if
(
!
doc
)
{
...
@@ -144,7 +138,7 @@
...
@@ -144,7 +138,7 @@
var
list
=
[],
localStorageObject
=
null
,
k
=
'
key
'
,
var
list
=
[],
localStorageObject
=
null
,
k
=
'
key
'
,
splitk
=
[
'
splitedkey
'
],
fileObject
=
{};
splitk
=
[
'
splitedkey
'
],
fileObject
=
{};
localStorageObject
=
jioGlobalObj
.
local
Storage
.
getAll
();
localStorageObject
=
LocalOrCookie
Storage
.
getAll
();
for
(
k
in
localStorageObject
)
{
for
(
k
in
localStorageObject
)
{
splitk
=
k
.
split
(
'
/
'
);
splitk
=
k
.
split
(
'
/
'
);
if
(
splitk
[
0
]
===
'
jio
'
&&
if
(
splitk
[
0
]
===
'
jio
'
&&
...
@@ -170,7 +164,7 @@
...
@@ -170,7 +164,7 @@
setTimeout
(
function
()
{
setTimeout
(
function
()
{
// deleting
// deleting
jioGlobalObj
.
local
Storage
.
deleteItem
(
LocalOrCookie
Storage
.
deleteItem
(
'
jio/local/
'
+
'
jio/local/
'
+
that
.
getStorageUserName
()
+
'
/
'
+
that
.
getStorageUserName
()
+
'
/
'
+
that
.
getApplicantID
()
+
'
/
'
+
that
.
getApplicantID
()
+
'
/
'
+
...
@@ -729,4 +723,14 @@
...
@@ -729,4 +723,14 @@
return
new
ReplicateStorage
(
options
);
return
new
ReplicateStorage
(
options
);
});
});
})(
JIO
);
};
if
(
window
.
requirejs
)
{
define
(
'
JIOStorages
'
,
[
'
LocalOrCookieStorage
'
,
'
JIO
'
,
'
jQuery
'
],
jio_storage_loader
);
}
else
{
jio_storage_loader
(
LocalOrCookieStorage
,
JIO
,
jQuery
);
}
})();
\ No newline at end of file
jiotest/unhosted/localorcookiestorage.js
View file @
0e8ab6e4
;
var
LocalOrCookieStorage
=
;
var
LocalOrCookieStorage
=
(
function
()
{
(
function
()
{
var
local_cookie_loader_function
=
function
()
{
// localorcookiestorage.js
// localorcookiestorage.js
// Creates an object that can store persistent information in localStorage.
// Creates an object that can store persistent information in localStorage.
// If it is not supported by the browser, it will store in cookies.
// If it is not supported by the browser, it will store in cookies.
...
@@ -89,4 +88,13 @@
...
@@ -89,4 +88,13 @@
// end cookies & localStorages
// end cookies & localStorages
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
};
if
(
window
.
requirejs
)
{
define
(
'
LocalOrCookieStorage
'
,[],
local_cookie_loader_function
);
return
undefined
;
}
else
{
return
local_cookie_loader_function
();
}
})();
})();
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