Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web-apps
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
Boris Kocherov
web-apps
Commits
bfecf9d5
Commit
bfecf9d5
authored
Nov 18, 2016
by
Maxim Kadushkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved module dependencies
parent
9e9e738d
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
260 additions
and
254 deletions
+260
-254
apps/common/Analytics.js
apps/common/Analytics.js
+29
-27
apps/common/Gateway.js
apps/common/Gateway.js
+197
-194
apps/common/mobile/utils/extendes.js
apps/common/mobile/utils/extendes.js
+34
-33
No files found.
apps/common/Analytics.js
View file @
bfecf9d5
...
...
@@ -35,22 +35,23 @@ if (Common === undefined)
Common
.
component
=
Common
.
component
||
{};
Common
.
Analytics
=
Common
.
component
.
Analytics
=
new
(
function
()
{
var
_category
;
define
([
'
jquery
'
],
function
(
$
){
Common
.
Analytics
=
Common
.
component
.
Analytics
=
new
(
function
()
{
var
_category
;
return
{
initialize
:
function
(
id
,
category
)
{
return
{
initialize
:
function
(
id
,
category
)
{
if
(
typeof
id
===
'
undefined
'
)
throw
'
Analytics: invalid id.
'
;
if
(
typeof
id
===
'
undefined
'
)
throw
'
Analytics: invalid id.
'
;
if
(
typeof
category
===
'
undefined
'
||
Object
.
prototype
.
toString
.
apply
(
category
)
!==
'
[object String]
'
)
throw
'
Analytics: invalid category type.
'
;
if
(
typeof
category
===
'
undefined
'
||
Object
.
prototype
.
toString
.
apply
(
category
)
!==
'
[object String]
'
)
throw
'
Analytics: invalid category type.
'
;
_category
=
category
;
_category
=
category
;
$
(
'
head
'
).
append
(
'
<script type="text/javascript">
'
+
$
(
'
head
'
).
append
(
'
<script type="text/javascript">
'
+
'
var _gaq = _gaq || [];
'
+
'
_gaq.push(["_setAccount", "
'
+
id
+
'
"]);
'
+
'
_gaq.push(["_trackPageview"]);
'
+
...
...
@@ -60,27 +61,28 @@ Common.Analytics = Common.component.Analytics = new(function() {
'
var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);
'
+
'
})();
'
+
'
</script>
'
);
},
);
},
trackEvent
:
function
(
action
,
label
,
value
)
{
trackEvent
:
function
(
action
,
label
,
value
)
{
if
(
typeof
action
!==
'
undefined
'
&&
Object
.
prototype
.
toString
.
apply
(
action
)
!==
'
[object String]
'
)
throw
'
Analytics: invalid action type.
'
;
if
(
typeof
action
!==
'
undefined
'
&&
Object
.
prototype
.
toString
.
apply
(
action
)
!==
'
[object String]
'
)
throw
'
Analytics: invalid action type.
'
;
if
(
typeof
label
!==
'
undefined
'
&&
Object
.
prototype
.
toString
.
apply
(
label
)
!==
'
[object String]
'
)
throw
'
Analytics: invalid label type.
'
;
if
(
typeof
label
!==
'
undefined
'
&&
Object
.
prototype
.
toString
.
apply
(
label
)
!==
'
[object String]
'
)
throw
'
Analytics: invalid label type.
'
;
if
(
typeof
value
!==
'
undefined
'
&&
!
(
Object
.
prototype
.
toString
.
apply
(
value
)
===
'
[object Number]
'
&&
isFinite
(
value
)))
throw
'
Analytics: invalid value type.
'
;
if
(
typeof
value
!==
'
undefined
'
&&
!
(
Object
.
prototype
.
toString
.
apply
(
value
)
===
'
[object Number]
'
&&
isFinite
(
value
)))
throw
'
Analytics: invalid value type.
'
;
if
(
typeof
_gaq
===
'
undefined
'
)
return
;
if
(
typeof
_gaq
===
'
undefined
'
)
return
;
if
(
_category
===
'
undefined
'
)
throw
'
Analytics is not initialized.
'
;
if
(
_category
===
'
undefined
'
)
throw
'
Analytics is not initialized.
'
;
_gaq
.
push
([
'
_trackEvent
'
,
_category
,
action
,
label
,
value
]);
_gaq
.
push
([
'
_trackEvent
'
,
_category
,
action
,
label
,
value
]);
}
}
}
})();
\ No newline at end of file
})();
});
apps/common/Gateway.js
View file @
bfecf9d5
This diff is collapsed.
Click to expand it.
apps/common/mobile/utils/extendes.js
View file @
bfecf9d5
...
...
@@ -39,44 +39,45 @@
*
*/
(
function
()
{
define
(
[
'
jquery
'
,
'
underscore
'
,
'
framework7
'
],
function
()
{
//Extend jQuery functions
jQuery
.
fn
.
extend
(
{
single
:
function
(
types
,
selector
,
data
,
fn
)
{
return
this
.
off
(
types
,
fn
).
on
(
types
,
selector
,
data
,
fn
);
}
});
//Extend jQuery functions
jQuery
.
fn
.
extend
(
{
single
:
function
(
types
,
selector
,
data
,
fn
)
{
return
this
.
off
(
types
,
fn
).
on
(
types
,
selector
,
data
,
fn
);
}
});
//Extend Dom7 functions
var
methods
=
[
'
addClass
'
,
'
toggleClass
'
,
'
removeClass
'
];
//Extend Dom7 functions
var
methods
=
[
'
addClass
'
,
'
toggleClass
'
,
'
removeClass
'
];
_
.
each
(
methods
,
function
(
method
,
index
)
{
var
originalMethod
=
Dom7
.
fn
[
method
];
_
.
each
(
methods
,
function
(
method
,
index
)
{
var
originalMethod
=
Dom7
.
fn
[
method
];
Dom7
.
fn
[
method
]
=
function
(
className
)
{
var
result
=
originalMethod
.
apply
(
this
,
arguments
);
this
.
trigger
(
method
,
className
);
return
result
;
};
});
Dom7
.
fn
[
method
]
=
function
(
className
)
{
var
result
=
originalMethod
.
apply
(
this
,
arguments
);
this
.
trigger
(
method
,
className
);
return
result
;
};
});
//Extend Underscope functions
_
.
buffered
=
function
(
func
,
buffer
,
scope
,
args
)
{
var
timerId
;
//Extend Underscope functions
_
.
buffered
=
function
(
func
,
buffer
,
scope
,
args
)
{
var
timerId
;
return
function
()
{
var
callArgs
=
args
||
Array
.
prototype
.
slice
.
call
(
arguments
,
0
),
me
=
scope
||
this
;
return
function
(
)
{
var
callArgs
=
args
||
Array
.
prototype
.
slice
.
call
(
arguments
,
0
),
me
=
scope
||
this
;
if
(
timerId
)
{
clearTimeout
(
timerId
);
}
if
(
timerId
)
{
clearTimeout
(
timerId
);
}
timerId
=
setTimeout
(
function
(){
func
.
apply
(
me
,
callArgs
);
},
buffer
);
timerId
=
setTimeout
(
function
(){
func
.
apply
(
me
,
callArgs
);
},
buffer
);
};
};
};
})();
\ 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