Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
angular-emoji-popup
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
angular-emoji-popup
Commits
1dde516f
Commit
1dde516f
authored
Dec 24, 2014
by
Madhur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes
parent
4383acbe
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
211 deletions
+30
-211
style.css
css/style.css
+1
-1
index.html
index.html
+12
-13
angular-sanitize.js
js/angular-sanitize.js
+16
-0
app.js
js/app.js
+1
-1
emojiDirectives.js
js/emojiDirectives.js
+0
-196
No files found.
css/style.css
View file @
1dde516f
...
@@ -185,7 +185,7 @@ opacity: 1;
...
@@ -185,7 +185,7 @@ opacity: 1;
.myform
.myform
{
{
position
:
fixed
;
position
:
fixed
;
top
:
5
0%
;
top
:
2
0%
;
width
:
100%
;
width
:
100%
;
left
:
20%
;
left
:
20%
;
}
}
\ No newline at end of file
index.html
View file @
1dde516f
...
@@ -8,24 +8,22 @@
...
@@ -8,24 +8,22 @@
</head>
</head>
<body
ng-controller=
"emojiController"
>
<body
ng-controller=
"emojiController"
>
<!--<h1>Angular Emoji Popup</h1>-->
<h1>
Angular Emoji Popup
</h1>
<p/>
<p/>
<p/>
<p/>
<div
my-form
class=
"myform"
>
<div
class=
"myform"
>
<div
my-form
>
<textarea
id=
"messageInput"
ng-enter=
"replyToUser()"
ng-model=
"messagetext"
placeholder=
"Write a message..."
class=
"ng-untouched ng-valid ng-dirty ng-valid-parse"
style=
"display: none;"
></textarea>
<textarea
id=
"messageInput"
ng-enter=
"replyToUser()"
ng-model=
"messagetext"
placeholder=
"Write a message..."
class=
"ng-untouched ng-valid ng-dirty ng-valid-parse"
style=
"display: none;"
></textarea>
<div
style=
"margin-right:10px;margin-top:5px;"
class=
"im_emoji_btn"
id=
"emojibtn"
style=
"cursor:pointer"
>
<div
style=
"margin-right:10px;margin-top:5px;"
class=
"im_emoji_btn"
id=
"emojibtn"
style=
"cursor:pointer"
>
<i
class=
"icon icon-emoji"
style=
"cursor:pointer; margin-left:20px;margin-top:10px;"
></i>
<i
class=
"icon icon-emoji"
style=
"cursor:pointer; margin-left:20px;margin-top:10px;"
></i>
</div>
</div>
<
br/
>
<
/div
>
<span
style=
"float:clear"
></span>
<div>
String with Colons:
</div>
<div
style=
"text-align:left;height:50px;width:500px"
>
String with Colons:
</div>
<div>
<div>
<
input
class=
"form-control"
ng-model=
"messagetext"
>
<
div
class=
"form-control"
style=
"height:50px;width:500px"
ng-bind-html=
"messagetext"
></div
>
</div>
</div>
<div>
String with UTF Chars: (Will not display fine in input box)
</div>
<div>
String with UTF Chars: (Will not display fine in input box)
</div>
...
@@ -38,6 +36,7 @@
...
@@ -38,6 +36,7 @@
<script
type=
"text/javascript"
src=
"js/angular.min.js"
></script>
<script
type=
"text/javascript"
src=
"js/angular.min.js"
></script>
<script
type=
"text/javascript"
src=
"js/angular-sanitize.js"
></script>
<script
type=
"text/javascript"
src=
"js/jquery-1.11.1.min.js"
></script>
<script
type=
"text/javascript"
src=
"js/jquery-1.11.1.min.js"
></script>
<script
type=
"text/javascript"
src=
"js/emoji.js"
></script>
<script
type=
"text/javascript"
src=
"js/emoji.js"
></script>
...
...
js/angular-sanitize.js
0 → 100644
View file @
1dde516f
/*
AngularJS v1.3.7
(c) 2010-2014 Google, Inc. http://angularjs.org
License: MIT
*/
(
function
(
n
,
h
,
p
){
'
use strict
'
;
function
E
(
a
){
var
d
=
[];
s
(
d
,
h
.
noop
).
chars
(
a
);
return
d
.
join
(
""
)}
function
g
(
a
){
var
d
=
{};
a
=
a
.
split
(
"
,
"
);
var
c
;
for
(
c
=
0
;
c
<
a
.
length
;
c
++
)
d
[
a
[
c
]]
=!
0
;
return
d
}
function
F
(
a
,
d
){
function
c
(
a
,
b
,
c
,
l
){
b
=
h
.
lowercase
(
b
);
if
(
t
[
b
])
for
(;
f
.
last
()
&&
u
[
f
.
last
()];)
e
(
""
,
f
.
last
());
v
[
b
]
&&
f
.
last
()
==
b
&&
e
(
""
,
b
);(
l
=
w
[
b
]
||!!
l
)
||
f
.
push
(
b
);
var
m
=
{};
c
.
replace
(
G
,
function
(
a
,
b
,
d
,
c
,
e
){
m
[
b
]
=
r
(
d
||
c
||
e
||
""
)});
d
.
start
&&
d
.
start
(
b
,
m
,
l
)}
function
e
(
a
,
b
){
var
c
=
0
,
e
;
if
(
b
=
h
.
lowercase
(
b
))
for
(
c
=
f
.
length
-
1
;
0
<=
c
&&
f
[
c
]
!=
b
;
c
--
);
if
(
0
<=
c
){
for
(
e
=
f
.
length
-
1
;
e
>=
c
;
e
--
)
d
.
end
&&
d
.
end
(
f
[
e
]);
f
.
length
=
c
}}
"
string
"
!==
typeof
a
&&
(
a
=
null
===
a
||
"
undefined
"
===
typeof
a
?
""
:
""
+
a
);
var
b
,
k
,
f
=
[],
m
=
a
,
l
;
for
(
f
.
last
=
function
(){
return
f
[
f
.
length
-
1
]};
a
;){
l
=
""
;
k
=!
0
;
if
(
f
.
last
()
&&
x
[
f
.
last
()])
a
=
a
.
replace
(
new
RegExp
(
"
(.*)<
\\
s*
\\
/
\\
s*
"
+
f
.
last
()
+
"
[^>]*>
"
,
"
i
"
),
function
(
a
,
b
){
b
=
b
.
replace
(
H
,
"
$1
"
).
replace
(
I
,
"
$1
"
);
d
.
chars
&&
d
.
chars
(
r
(
b
));
return
""
}),
e
(
""
,
f
.
last
());
else
{
if
(
0
===
a
.
indexOf
(
"
\
x3c!--
"
))
b
=
a
.
indexOf
(
"
--
"
,
4
),
0
<=
b
&&
a
.
lastIndexOf
(
"
--
\
x3e
"
,
b
)
===
b
&&
(
d
.
comment
&&
d
.
comment
(
a
.
substring
(
4
,
b
)),
a
=
a
.
substring
(
b
+
3
),
k
=!
1
);
else
if
(
y
.
test
(
a
)){
if
(
b
=
a
.
match
(
y
))
a
=
a
.
replace
(
b
[
0
],
""
),
k
=!
1
}
else
if
(
J
.
test
(
a
)){
if
(
b
=
a
.
match
(
z
))
a
=
a
.
substring
(
b
[
0
].
length
),
b
[
0
].
replace
(
z
,
e
),
k
=!
1
}
else
K
.
test
(
a
)
&&
((
b
=
a
.
match
(
A
))?(
b
[
4
]
&&
(
a
=
a
.
substring
(
b
[
0
].
length
),
b
[
0
].
replace
(
A
,
c
)),
k
=!
1
):(
l
+=
"
<
"
,
a
=
a
.
substring
(
1
)));
k
&&
(
b
=
a
.
indexOf
(
"
<
"
),
l
+=
0
>
b
?
a
:
a
.
substring
(
0
,
b
),
a
=
0
>
b
?
""
:
a
.
substring
(
b
),
d
.
chars
&&
d
.
chars
(
r
(
l
)))}
if
(
a
==
m
)
throw
L
(
"
badparse
"
,
a
);
m
=
a
}
e
()}
function
r
(
a
){
if
(
!
a
)
return
""
;
var
d
=
M
.
exec
(
a
);
a
=
d
[
1
];
var
c
=
d
[
3
];
if
(
d
=
d
[
2
])
q
.
innerHTML
=
d
.
replace
(
/</g
,
"
<
"
),
d
=
"
textContent
"
in
q
?
q
.
textContent
:
q
.
innerText
;
return
a
+
d
+
c
}
function
B
(
a
){
return
a
.
replace
(
/&/g
,
"
&
"
).
replace
(
N
,
function
(
a
){
var
c
=
a
.
charCodeAt
(
0
);
a
=
a
.
charCodeAt
(
1
);
return
"
&#
"
+
(
1024
*
(
c
-
55296
)
+
(
a
-
56320
)
+
65536
)
+
"
;
"
}).
replace
(
O
,
function
(
a
){
return
"
&#
"
+
a
.
charCodeAt
(
0
)
+
"
;
"
}).
replace
(
/</g
,
"
<
"
).
replace
(
/>/g
,
"
>
"
)}
function
s
(
a
,
d
){
var
c
=!
1
,
e
=
h
.
bind
(
a
,
a
.
push
);
return
{
start
:
function
(
a
,
k
,
f
){
a
=
h
.
lowercase
(
a
);
!
c
&&
x
[
a
]
&&
(
c
=
a
);
c
||!
0
!==
C
[
a
]
||
(
e
(
"
<
"
),
e
(
a
),
h
.
forEach
(
k
,
function
(
c
,
f
){
var
k
=
h
.
lowercase
(
f
),
g
=
"
img
"
===
a
&&
"
src
"
===
k
||
"
background
"
===
k
;
!
0
!==
P
[
k
]
||!
0
===
D
[
k
]
&&!
d
(
c
,
g
)
||
(
e
(
"
"
),
e
(
f
),
e
(
'
="
'
),
e
(
B
(
c
)),
e
(
'
"
'
))}),
e
(
f
?
"
/>
"
:
"
>
"
))},
end
:
function
(
a
){
a
=
h
.
lowercase
(
a
);
c
||!
0
!==
C
[
a
]
||
(
e
(
"
</
"
),
e
(
a
),
e
(
"
>
"
));
a
==
c
&&
(
c
=!
1
)},
chars
:
function
(
a
){
c
||
e
(
B
(
a
))}}}
var
L
=
h
.
$$minErr
(
"
$sanitize
"
),
A
=
/^<
((?:[
a-zA-Z
])[\w
:-
]
*
)((?:\s
+
[\w
:-
]
+
(?:\s
*=
\s
*
(?:(?:
"
[^
"
]
*"
)
|
(?:
'
[^
'
]
*'
)
|
[^
>
\s]
+
))?)
*
)\s
*
(\/?)\s
*
(
>
?)
/
,
z
=
/^<
\/\s
*
([\w
:-
]
+
)[^
>
]
*>/
,
G
=
/
([\w
:-
]
+
)(?:\s
*=
\s
*
(?:(?:
"
((?:[^
"
])
*
)
"
)
|
(?:
'
((?:[^
'
])
*
)
'
)
|
([^
>
\s]
+
)))?
/g
,
K
=
/^</
,
J
=
/^<
\/
/
,
H
=
/
\x
3c!--
(
.*
?)
--
\x
3e/g
,
y
=
/<!DOCTYPE
([^
>
]
*
?)
>/i
,
I
=
/<!
\[
CDATA
\[(
.*
?)
]]
\x
3e/g
,
N
=
/
[\u
D800-
\u
DBFF
][\u
DC00-
\u
DFFF
]
/g
,
O
=
/
([^\#
-~| |!
])
/g
,
w
=
g
(
"
area,br,col,hr,img,wbr
"
);
n
=
g
(
"
colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr
"
);
p
=
g
(
"
rp,rt
"
);
var
v
=
h
.
extend
({},
p
,
n
),
t
=
h
.
extend
({},
n
,
g
(
"
address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul
"
)),
u
=
h
.
extend
({},
p
,
g
(
"
a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var
"
));
n
=
g
(
"
animate,animateColor,animateMotion,animateTransform,circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,set,stop,svg,switch,text,title,tspan,use
"
);
var
x
=
g
(
"
script,style
"
),
C
=
h
.
extend
({},
w
,
t
,
u
,
v
,
n
),
D
=
g
(
"
background,cite,href,longdesc,src,usemap,xlink:href
"
);
n
=
g
(
"
abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,target,title,type,valign,value,vspace,width
"
);
p
=
g
(
"
accent-height,accumulate,additive,alphabetic,arabic-form,ascent,attributeName,attributeType,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan
"
);
var
P
=
h
.
extend
({},
D
,
p
,
n
),
q
=
document
.
createElement
(
"
pre
"
),
M
=
/^
(\s
*
)([\s\S]
*
?)(\s
*
)
$/
;
h
.
module
(
"
ngSanitize
"
,[]).
provider
(
"
$sanitize
"
,
function
(){
this
.
$get
=
[
"
$$sanitizeUri
"
,
function
(
a
){
return
function
(
d
){
var
c
=
[];
F
(
d
,
s
(
c
,
function
(
c
,
b
){
return
!
/^unsafe/
.
test
(
a
(
c
,
b
))}));
return
c
.
join
(
""
)}}]});
h
.
module
(
"
ngSanitize
"
).
filter
(
"
linky
"
,[
"
$sanitize
"
,
function
(
a
){
var
d
=
/
((
ftp|https
?)
:
\/\/
|
(
www
\.)
|
(
mailto:
)?[
A-Za-z0-9._%+-
]
+@
)\S
*
[^\s
.;,(){}<>"
\u
201d
\u
2019
]
/
,
c
=
/^mailto:/
;
return
function
(
e
,
b
){
function
k
(
a
){
a
&&
g
.
push
(
E
(
a
))}
function
f
(
a
,
c
){
g
.
push
(
"
<a
"
);
h
.
isDefined
(
b
)
&&
g
.
push
(
'
target="
'
,
b
,
'
"
'
);
g
.
push
(
'
href="
'
,
a
.
replace
(
/"/g
,
"
"
"
),
'
">
'
);
k
(
c
);
g
.
push
(
"
</a>
"
)}
if
(
!
e
)
return
e
;
for
(
var
m
,
l
=
e
,
g
=
[],
n
,
p
;
m
=
l
.
match
(
d
);)
n
=
m
[
0
],
m
[
2
]
||
m
[
4
]
||
(
n
=
(
m
[
3
]?
"
http://
"
:
"
mailto:
"
)
+
n
),
p
=
m
.
index
,
k
(
l
.
substr
(
0
,
p
)),
f
(
n
,
m
[
0
].
replace
(
c
,
""
)),
l
=
l
.
substring
(
p
+
m
[
0
].
length
);
k
(
l
);
return
a
(
g
.
join
(
""
))}}])})(
window
,
window
.
angular
);
//# sourceMappingURL=angular-sanitize.min.js.map
\ No newline at end of file
js/app.js
View file @
1dde516f
'
use strict
'
;
'
use strict
'
;
var
emojiApp
=
angular
.
module
(
"
emojiApp
"
,
[]);
var
emojiApp
=
angular
.
module
(
"
emojiApp
"
,
[
'
ngSanitize
'
]);
emojiApp
.
config
(
function
(
ConfigProvider
)
emojiApp
.
config
(
function
(
ConfigProvider
)
{
{
...
...
js/emojiDirectives.js
View file @
1dde516f
...
@@ -25,7 +25,6 @@ emojiApp.directive('myForm', ['$http', '$interpolate', function($http, $interpol
...
@@ -25,7 +25,6 @@ emojiApp.directive('myForm', ['$http', '$interpolate', function($http, $interpol
{
{
var
messageField
=
$
(
'
textarea
'
,
element
)[
0
],
var
messageField
=
$
(
'
textarea
'
,
element
)[
0
],
fileSelects
=
$
(
'
input
'
,
element
),
fileSelects
=
$
(
'
input
'
,
element
),
dropbox
=
$
(
'
#dropbox
'
,
element
)[
0
],
emojiButton
=
$
(
'
#emojibtn
'
,
element
)[
0
],
emojiButton
=
$
(
'
#emojibtn
'
,
element
)[
0
],
editorElement
=
messageField
,
editorElement
=
messageField
,
dragStarted
,
dragTimeout
,
dragStarted
,
dragTimeout
,
...
@@ -55,7 +54,6 @@ emojiApp.directive('myForm', ['$http', '$interpolate', function($http, $interpol
...
@@ -55,7 +54,6 @@ emojiApp.directive('myForm', ['$http', '$interpolate', function($http, $interpol
var
updatePromise
;
var
updatePromise
;
$
(
richTextarea
)
$
(
richTextarea
)
.
on
(
'
DOMNodeInserted
'
,
onPastedImageEvent
)
.
on
(
.
on
(
'
keyup
'
,
'
keyup
'
,
function
(
e
)
function
(
e
)
...
@@ -71,34 +69,11 @@ emojiApp.directive('myForm', ['$http', '$interpolate', function($http, $interpol
...
@@ -71,34 +69,11 @@ emojiApp.directive('myForm', ['$http', '$interpolate', function($http, $interpol
});
});
}
}
$timeout
.
cancel
(
updatePromise
);
updatePromise
=
$timeout
(
updateValue
,
1000
);
});
});
}
}
// Head is sometimes slower
/*
* $timeout(function () { fileSelects .on('change',
* function () { var self = this; $scope.$apply(function () {
* $scope.draftMessage.files =
* Array.prototype.slice.call(self.files);
* $scope.draftMessage.isMedia =
* $(self).hasClass('im_media_attach_input') ||
* Config.Mobile; setTimeout(function () { try {
* self.value = ''; } catch (e) {}; }, 1000); }); }); },
* 1000);
*/
var
sendOnEnter
=
true
;
var
sendOnEnter
=
true
;
/*
* updateSendSettings = function () {
* Storage.get('send_ctrlenter').then(function
* (sendOnCtrl) { sendOnEnter = !sendOnCtrl; }); };
*/
// $scope.$on('settings_changed', updateSendSettings);
// updateSendSettings();
$
(
editorElement
).
on
(
$
(
editorElement
).
on
(
'
keydown
'
,
'
keydown
'
,
function
(
e
)
function
(
e
)
...
@@ -143,18 +118,6 @@ emojiApp.directive('myForm', ['$http', '$interpolate', function($http, $interpol
...
@@ -143,18 +118,6 @@ emojiApp.directive('myForm', ['$http', '$interpolate', function($http, $interpol
return
cancelEvent
(
e
);
return
cancelEvent
(
e
);
});
});
/*
* var lastTyping = 0, lastLength;
* $(editorElement).on('keyup', function (e) { var now =
* tsNow(), length = (editorElement[richTextarea ?
* 'textContent' : 'value']).length;
*
*
* if (now - lastTyping > 5000 && length != lastLength) {
* lastTyping = now; lastLength = length;
* $scope.$emit('ui_typing'); } });
*/
function
resetTyping
()
function
resetTyping
()
{
{
// lastTyping = 0;
// lastTyping = 0;
...
@@ -207,28 +170,7 @@ emojiApp.directive('myForm', ['$http', '$interpolate', function($http, $interpol
...
@@ -207,28 +170,7 @@ emojiApp.directive('myForm', ['$http', '$interpolate', function($http, $interpol
}
}
$
(
document
).
on
(
'
keydown
'
,
onKeyDown
);
$
(
document
).
on
(
'
keydown
'
,
onKeyDown
);
$
(
'
body
'
).
on
(
'
dragenter dragleave dragover drop
'
,
onDragDropEvent
);
$
(
document
).
on
(
'
paste
'
,
onPasteEvent
);
/*
* if (!Config.Navigator.touch) {
* $scope.$on('ui_peer_change', focusField);
* $scope.$on('ui_history_focus', focusField);
* $scope.$on('ui_history_change', focusField); }
*
* $scope.$on('ui_peer_change', resetTyping);
* $scope.$on('ui_peer_draft', updateRichTextarea);
*/
var
sendAwaiting
=
false
;
var
sendAwaiting
=
false
;
/*
* $scope.$on('ui_message_before_send', function () {
* sendAwaiting = true; $timeout.cancel(updatePromise);
* updateValue(); }); $scope.$on('ui_message_send',
* function () { sendAwaiting = false; focusField(); });
*/
function
focusField
()
function
focusField
()
{
{
onContentLoaded
(
function
()
onContentLoaded
(
function
()
...
@@ -237,139 +179,6 @@ emojiApp.directive('myForm', ['$http', '$interpolate', function($http, $interpol
...
@@ -237,139 +179,6 @@ emojiApp.directive('myForm', ['$http', '$interpolate', function($http, $interpol
});
});
}
}
function
onPastedImageEvent
(
e
)
{
console
.
log
(
"
onPastedImageEvent
"
);
var
element
=
(
e
.
originalEvent
||
e
).
target
,
src
=
(
element
||
{}).
src
||
''
,
remove
=
false
;
if
(
src
.
substr
(
0
,
5
)
==
'
data:
'
)
{
remove
=
true
;
var
blob
=
dataUrlToBlob
(
src
);
ErrorService
.
confirm
(
{
type
:
'
FILE_CLIPBOARD_PASTE
'
}).
then
(
function
()
{
$scope
.
draftMessage
.
files
=
[
blob
];
$scope
.
draftMessage
.
isMedia
=
true
;
});
setZeroTimeout
(
function
()
{
element
.
parentNode
.
removeChild
(
element
);
})
}
else
if
(
src
&&
!
src
.
match
(
/
\/
blank
\.
gif/
))
{
var
replacementNode
=
document
.
createTextNode
(
'
'
+
src
+
'
'
);
setTimeout
(
function
()
{
element
.
parentNode
.
replaceChild
(
replacementNode
,
element
);
},
100
);
}
};
function
onPasteEvent
(
e
)
{
console
.
log
(
"
onPasteEvent
"
);
var
cData
=
(
e
.
originalEvent
||
e
).
clipboardData
,
items
=
cData
&&
cData
.
items
||
[],
files
=
[],
file
,
i
;
for
(
i
=
0
;
i
<
items
.
length
;
i
++
)
{
if
(
items
[
i
].
kind
==
'
file
'
)
{
file
=
items
[
i
].
getAsFile
();
files
.
push
(
file
);
}
}
if
(
files
.
length
>
0
)
{
ErrorService
.
confirm
(
{
type
:
'
FILES_CLIPBOARD_PASTE
'
,
files
:
files
}).
then
(
function
()
{
$scope
.
draftMessage
.
files
=
files
;
$scope
.
draftMessage
.
isMedia
=
true
;
});
}
}
function
onDragDropEvent
(
e
)
{
var
dragStateChanged
=
false
;
if
(
!
dragStarted
||
dragStarted
==
1
)
{
dragStarted
=
checkDragEvent
(
e
)
?
2
:
1
;
dragStateChanged
=
true
;
}
if
(
dragStarted
==
2
)
{
if
(
dragTimeout
)
{
setTimeout
(
function
()
{
clearTimeout
(
dragTimeout
);
dragTimeout
=
false
;
},
0
);
}
if
(
e
.
type
==
'
dragenter
'
||
e
.
type
==
'
dragover
'
)
{
if
(
dragStateChanged
)
{
/*
* $(dropbox).css( { height :
* $(editorElement) .height() + 12,
* width : $(editorElement) .width() +
* 12 }).show();
*/
}
}
else
{
if
(
e
.
type
==
'
drop
'
)
{
$scope
.
$apply
(
function
()
{
$scope
.
draftMessage
.
files
=
Array
.
prototype
.
slice
.
call
(
e
.
originalEvent
.
dataTransfer
.
files
);
if
(
$scope
.
draftMessage
.
files
.
length
==
1
)
{
$scope
.
draftMessage
.
uploadSingleFile
(
$scope
.
draftMessage
.
files
[
0
]);
}
else
if
(
$scope
.
draftMessage
.
files
.
length
>
1
)
{
alert
(
'
Uploading multiple files is not supported
'
);
return
;
}
});
}
dragTimeout
=
setTimeout
(
function
()
{
// $(dropbox).hide();
dragStarted
=
false
;
dragTimeout
=
false
;
},
300
);
}
}
return
cancelEvent
(
e
);
};
$scope
.
$on
(
'
$destroy
'
,
function
cleanup
()
$scope
.
$on
(
'
$destroy
'
,
function
cleanup
()
{
{
...
@@ -386,10 +195,5 @@ emojiApp.directive('myForm', ['$http', '$interpolate', function($http, $interpol
...
@@ -386,10 +195,5 @@ emojiApp.directive('myForm', ['$http', '$interpolate', function($http, $interpol
}
}
$
(
editorElement
).
off
(
'
keydown
'
);
$
(
editorElement
).
off
(
'
keydown
'
);
});
});
/*
* if (!Config.Navigator.touch) { focusField(); }
*/
}
}
}]);
}]);
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