Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ecommerce-ui
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
ecommerce-ui
Commits
fd8bbe5a
Commit
fd8bbe5a
authored
Nov 19, 2013
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed IE8 shims to separate file
parent
b265c991
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
90 deletions
+104
-90
index.html
index.html
+12
-11
js/erp5_loader.js
js/erp5_loader.js
+3
-79
js/shims.js
js/shims.js
+89
-0
No files found.
index.html
View file @
fd8bbe5a
...
...
@@ -29,22 +29,23 @@
<!-- global popup -->
<!-- JQM -->
<script
src=
"js/libs/jquery/jquery.js"
></script>
<script
src=
"js/libs/jquery-mobile/jquery-mobile.js"
></script>
<script
src=
"js/extensions.js"
></script>
<script
type=
"text/javascript"
src=
"js/libs/jquery/jquery.js"
></script>
<script
type=
"text/javascript"
src=
"js/libs/jquery-mobile/jquery-mobile.js"
></script>
<script
type=
"text/javascript"
src=
"js/extensions.js"
></script>
<!-- JIO -->
<script
src=
"js/libs/jio/sha256.amd.js"
></script>
<script
src=
"js/libs/jio/rsvp-custom.js"
></script>
<script
src=
"js/libs/jio/jio.js"
></script>
<script
src=
"js/libs/jio/complex_queries.js"
></script>
<script
src=
"js/libs/jio/localstorage.js"
></script>
<script
type=
"text/javascript"
src=
"js/libs/jio/sha256.amd.js"
></script>
<script
type=
"text/javascript"
src=
"js/libs/jio/rsvp-custom.js"
></script>
<script
type=
"text/javascript"
src=
"js/libs/jio/jio.js"
></script>
<script
type=
"text/javascript"
src=
"js/libs/jio/complex_queries.js"
></script>
<script
type=
"text/javascript"
src=
"js/libs/jio/localstorage.js"
></script>
<!-- plugins -->
<script
src=
"js/plugins/validval/jquery.validVal.js"
></script>
<script
src=
"js/plugins/i18next/i18next.js"
></script>
<script
type=
"text/javascript"
src=
"js/plugins/validval/jquery.validVal.js"
></script>
<script
type=
"text/javascript"
src=
"js/plugins/i18next/i18next.js"
></script>
<!-- stuff happens here -->
<script
src=
"js/erp5_loader.js"
></script>
<script
type=
"text/javascript"
src=
"js/erp5_loader.js"
></script>
<script
type=
"text/javascript"
src=
"js/shims.js"
></script>
</body>
</html>
js/erp5_loader.js
View file @
fd8bbe5a
...
...
@@ -13,89 +13,11 @@
erp5
=
{},
// JQM content erateerator
factory
=
{},
// Shims
shim_dict
=
{},
// renderJS
javascript_registration_dict
=
{},
renderJS
=
{};
/* ====================================================================== */
/* SHIMS */
/* ====================================================================== */
// NOTE: to support IE8+/Windows Mobile where possible, test via modernizr
// https://gist.github.com/yahiko/229984
shim_dict
.
Base64
=
{
characters
:
"
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
"
,
/**
* Shim for atob (not available on IE8+9+Windows Mobile?)
* @method Base64.encode
* @param {string} string String to be hashed
* @return {string} encoded string
*/
encode
:
function
(
string
)
{
var
characters
=
shim_dict
.
Base64
.
characters
;
var
result
=
''
;
var
i
=
0
;
do
{
var
a
=
string
.
charCodeAt
(
i
++
);
var
b
=
string
.
charCodeAt
(
i
++
);
var
c
=
string
.
charCodeAt
(
i
++
);
a
=
a
?
a
:
0
;
b
=
b
?
b
:
0
;
c
=
c
?
c
:
0
;
var
b1
=
(
a
>>
2
)
&
0x3F
;
var
b2
=
(
(
a
&
0x3
)
<<
4
)
|
(
(
b
>>
4
)
&
0xF
);
var
b3
=
(
(
b
&
0xF
)
<<
2
)
|
(
(
c
>>
6
)
&
0x3
);
var
b4
=
c
&
0x3F
;
if
(
!
b
)
{
b3
=
b4
=
64
;
}
else
if
(
!
c
)
{
b4
=
64
;
}
result
+=
characters
.
charAt
(
b1
)
+
characters
.
charAt
(
b2
)
+
characters
.
charAt
(
b3
)
+
characters
.
charAt
(
b4
);
}
while
(
i
<
string
.
length
);
return
result
;
},
/**
* Shim for btoa (not available on IE8+9+Windows Mobile?)
* @method Base64.decode
* @param {string} string String to be hashed
* @return {string} encoded string
*/
decode
:
function
(
string
)
{
var
characters
=
shim_dict
.
Base64
.
characters
;
var
result
=
''
;
var
i
=
0
;
do
{
var
b1
=
characters
.
indexOf
(
string
.
charAt
(
i
++
)
);
var
b2
=
characters
.
indexOf
(
string
.
charAt
(
i
++
)
);
var
b3
=
characters
.
indexOf
(
string
.
charAt
(
i
++
)
);
var
b4
=
characters
.
indexOf
(
string
.
charAt
(
i
++
)
);
var
a
=
(
(
b1
&
0x3F
)
<<
2
)
|
(
(
b2
>>
4
)
&
0x3
);
var
b
=
(
(
b2
&
0xF
)
<<
4
)
|
(
(
b3
>>
2
)
&
0xF
);
var
c
=
(
(
b3
&
0x3
)
<<
6
)
|
(
b4
&
0x3F
);
result
+=
String
.
fromCharCode
(
a
)
+
(
b
?
String
.
fromCharCode
(
b
):
''
)
+
(
c
?
String
.
fromCharCode
(
c
):
''
);
}
while
(
i
<
string
.
length
);
return
result
;
}
};
/* ====================================================================== */
/* MAPPING ERP5 */
/* ====================================================================== */
...
...
@@ -1579,7 +1501,7 @@
// secure
if
(
i
===
0
&&
secure
===
"
default
"
)
{
stamp
=
new
Date
().
getTime
();
encode
=
window
.
btoa
||
shim_dict
.
Base64
.
encode
;
encode
=
window
.
btoa
||
window
.
shim
.
Base64
.
encode
;
// TODO: include client IP in hash to block submission serverside
sauce
=
encode
(
stamp
.
toString
()
+
spec
.
property_dict
.
secret_hash
);
...
...
@@ -4907,6 +4829,8 @@
/* ====================================================================== */
init
.
contentLoaded
(
window
,
function
()
{
// TODO: modernizr check and shim test here
// HACK: don't!
window
.
localStorage
.
clear
();
...
...
js/shims.js
0 → 100644
View file @
fd8bbe5a
/*jslint indent: 2, maxlen: 80, nomen: true, sloppy: true, todo: true */
/*global console, window, document */
(
function
(
window
,
document
)
{
"
use strict
"
;
// NOTE: old browsers need all of these
var
shim_dict
=
{};
/* ====================================================================== */
/* SHIMS */
/* ====================================================================== */
// NOTE: to support IE8+/Windows Mobile where possible, test via modernizr
// https://gist.github.com/yahiko/229984
shim_dict
.
Base64
=
{
characters
:
"
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
"
,
/**
* Shim for atob (not available on IE8+9+Windows Mobile?)
* @method Base64.encode
* @param {string} string String to be hashed
* @return {string} encoded string
*/
encode
:
function
(
string
)
{
var
characters
=
shim_dict
.
Base64
.
characters
;
var
result
=
''
;
var
i
=
0
;
do
{
var
a
=
string
.
charCodeAt
(
i
++
);
var
b
=
string
.
charCodeAt
(
i
++
);
var
c
=
string
.
charCodeAt
(
i
++
);
a
=
a
?
a
:
0
;
b
=
b
?
b
:
0
;
c
=
c
?
c
:
0
;
var
b1
=
(
a
>>
2
)
&
0x3F
;
var
b2
=
(
(
a
&
0x3
)
<<
4
)
|
(
(
b
>>
4
)
&
0xF
);
var
b3
=
(
(
b
&
0xF
)
<<
2
)
|
(
(
c
>>
6
)
&
0x3
);
var
b4
=
c
&
0x3F
;
if
(
!
b
)
{
b3
=
b4
=
64
;
}
else
if
(
!
c
)
{
b4
=
64
;
}
result
+=
characters
.
charAt
(
b1
)
+
characters
.
charAt
(
b2
)
+
characters
.
charAt
(
b3
)
+
characters
.
charAt
(
b4
);
}
while
(
i
<
string
.
length
);
return
result
;
},
/**
* Shim for btoa (not available on IE8+9+Windows Mobile?)
* @method Base64.decode
* @param {string} string String to be hashed
* @return {string} encoded string
*/
decode
:
function
(
string
)
{
var
characters
=
shim_dict
.
Base64
.
characters
;
var
result
=
''
;
var
i
=
0
;
do
{
var
b1
=
characters
.
indexOf
(
string
.
charAt
(
i
++
)
);
var
b2
=
characters
.
indexOf
(
string
.
charAt
(
i
++
)
);
var
b3
=
characters
.
indexOf
(
string
.
charAt
(
i
++
)
);
var
b4
=
characters
.
indexOf
(
string
.
charAt
(
i
++
)
);
var
a
=
(
(
b1
&
0x3F
)
<<
2
)
|
(
(
b2
>>
4
)
&
0x3
);
var
b
=
(
(
b2
&
0xF
)
<<
4
)
|
(
(
b3
>>
2
)
&
0xF
);
var
c
=
(
(
b3
&
0x3
)
<<
6
)
|
(
b4
&
0x3F
);
result
+=
String
.
fromCharCode
(
a
)
+
(
b
?
String
.
fromCharCode
(
b
):
''
)
+
(
c
?
String
.
fromCharCode
(
c
):
''
);
}
while
(
i
<
string
.
length
);
return
result
;
}
};
window
.
shim
=
shim_dict
;
}(
window
,
document
));
\ No newline at end of file
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