Skip to content

Commit

Permalink
by Jinqn 视频对话框和按钮名称由insertvideo改成video
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonxu committed Jan 14, 2014
1 parent 8ed7be6 commit 4663ef4
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 44 deletions.
2 changes: 1 addition & 1 deletion _examples/pageeditor.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h3 style="background-image: none; background-color: rgb(255, 255, 255); margin:
'source | undo redo | bold italic underline strikethrough | superscript subscript | forecolor backcolor | removeformat |',
'insertorderedlist insertunorderedlist | selectall cleardoc paragraph | fontfamily fontsize' ,
'| justifyleft justifycenter justifyright justifyjustify |',
'link unlink | emotion image insertvideo | map',
'link unlink | emotion image video | map',
'| horizontal print preview'
]

Expand Down
10 changes: 3 additions & 7 deletions _src/adapter/dialog.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
UM.registerUI('link image map insertvideo formula',function(name){
UM.registerUI('link image video map formula',function(name){

var me = this, currentRange, $dialog,
dialogUrl = {
insertvideo: 'video'
},
curDialogUrl = dialogUrl[ name ] || name,
opt = {
title: (me.options.labelMap && me.options.labelMap[name]) || me.getLang("labelMap." + name),
url: me.options.UMEDITOR_HOME_URL + 'dialogs/' + curDialogUrl + '/' + curDialogUrl + '.js'
url: me.options.UMEDITOR_HOME_URL + 'dialogs/' + name + '/' + name + '.js'
};

var $btn = $.eduibutton({
Expand Down Expand Up @@ -48,7 +44,7 @@ UM.registerUI('link image map insertvideo formula',function(name){

$dialog = $.eduimodal(opt);

$dialog.attr('id', 'edui-dialog-' + name)
$dialog.attr('id', 'edui-dialog-' + name).addClass('edui-dialog-' + name)
.find('.edui-modal-body').addClass('edui-dialog-' + name + '-body');

$dialog.edui().on('beforehide',function () {
Expand Down
12 changes: 6 additions & 6 deletions _test/adapter/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
*/

module('ui.dialog');
test('检查insertvideo的按钮和弹出的dialog面板是否正常显示', function () {
test('检查video的按钮和弹出的dialog面板是否正常显示', function () {
var editor = te.obj[0];
setTimeout(function () {//这句本身没有用,但是当用例自动执行下一个时,时序上可能有问题,所以在这儿先等一下
var $vedioBtn = editor.$container.find('.edui-btn-insertvideo');
var $vedioBtn = editor.$container.find('.edui-btn-video');
ok($vedioBtn.data('$mergeObj').parent()[0] === undefined, '判断点击按钮前dialog是否未插入到dom树里面');
editor.focus();
$vedioBtn.click();
ok($vedioBtn.data('$mergeObj').parent()[0] !== undefined, '判断点击按钮后dialog是否已插入到dom树里面');
$vedioBtn.click();
equal($vedioBtn.edui().disabled(), editor.queryCommandState('insertvideo') == -1, '判断初始化后btn对象disable状态是否正常');
equal($vedioBtn.edui().active(), editor.queryCommandState('insertvideo') == 1, '判断初始化后btn对象active状态是否正常');
equal($vedioBtn.edui().disabled(), editor.queryCommandState('video') == -1, '判断初始化后btn对象disable状态是否正常');
equal($vedioBtn.edui().active(), editor.queryCommandState('video') == 1, '判断初始化后btn对象active状态是否正常');
editor.setContent('<img src="" class="edui-faked-video" />');
setTimeout(function () {
editor.execCommand('selectall');
setTimeout(function () {
equal($vedioBtn.edui().disabled(), editor.queryCommandState('insertvideo') == -1, '判断点击按钮后btn对象disable状态是否正常');
equal($vedioBtn.edui().active(), editor.queryCommandState('insertvideo') == 1, '判断点击按钮后btn对象active状态是否正常');
equal($vedioBtn.edui().disabled(), editor.queryCommandState('video') == -1, '判断点击按钮后btn对象disable状态是否正常');
equal($vedioBtn.edui().active(), editor.queryCommandState('video') == 1, '判断点击按钮后btn对象active状态是否正常');
start();
}, 100);
}, 100);
Expand Down
44 changes: 22 additions & 22 deletions dialogs/video/video.css
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
@charset "utf-8";
.edui-video-wrapper{ width: 570px;_width:575px;margin: 10px auto; zoom:1;position: relative}
.edui-video-tabbody{height:335px;}
.edui-video-panel { position: absolute;width:100%; height:100%;background: #fff;}
.edui-video-panel table td{vertical-align: middle;}
#eduiVideoUrl {
.edui-dialog-video .edui-video-wrapper{ width: 570px;_width:575px;margin: 10px auto; zoom:1;position: relative}
.edui-dialog-video .edui-video-tabbody{height:335px;}
.edui-dialog-video .edui-video-panel { position: absolute;width:100%; height:100%;background: #fff;}
.edui-dialog-video .edui-video-panel table td{vertical-align: middle;}
.edui-dialog-video #eduiVideoUrl {
width: 470px;
height: 21px;
line-height: 21px;
margin: 8px 5px;
background: #FFF;
border: 1px solid #d7d7d7;
}
#eduiVideoSearchTxt{margin-left:15px;background: #FFF;width:200px;height:21px;line-height:21px;border: 1px solid #d7d7d7;}
#searchList{width: 570px;overflow: auto;zoom:1;height: 270px;}
#searchList div{float: left;width: 120px;height: 135px;margin: 5px 15px;}
#searchList img{margin: 2px 8px;cursor: pointer;border: 2px solid #fff} /*不用缩略图*/
#searchList p{margin-left: 10px;}
#eduiVideoType{
.edui-dialog-video #eduiVideoSearchTxt{margin-left:15px;background: #FFF;width:200px;height:21px;line-height:21px;border: 1px solid #d7d7d7;}
.edui-dialog-video #searchList{width: 570px;overflow: auto;zoom:1;height: 270px;}
.edui-dialog-video #searchList div{float: left;width: 120px;height: 135px;margin: 5px 15px;}
.edui-dialog-video #searchList img{margin: 2px 8px;cursor: pointer;border: 2px solid #fff} /*不用缩略图*/
.edui-dialog-video #searchList p{margin-left: 10px;}
.edui-dialog-video #eduiVideoType{
width: 65px;
height: 23px;
line-height: 22px;
border: 1px solid #d7d7d7;
}
#eduiVideoSearchBtn,#eduiVideoSearchReset{
.edui-dialog-video #eduiVideoSearchBtn,.edui-dialog-video #eduiVideoSearchReset{
/*width: 80px;*/
height: 25px;
line-height: 25px;
Expand All @@ -34,26 +34,26 @@



#eduiVideoPreview{width: 420px; margin-left: 10px; _margin-left:5px; height: 280px;background-color: #ddd;float: left}
#eduiVideoInfo {width: 120px;float: left;margin-left: 10px;_margin-left:7px;}
.edui-video-wrapper fieldset{
.edui-dialog-video #eduiVideoPreview{width: 420px; margin-left: 10px; _margin-left:5px; height: 280px;background-color: #ddd;float: left}
.edui-dialog-video #eduiVideoInfo {width: 120px;float: left;margin-left: 10px;_margin-left:7px;}
.edui-dialog-video .edui-video-wrapper fieldset{
border: 1px solid #ddd;
padding-left: 5px;
margin-bottom: 20px;
padding-bottom: 5px;
width: 115px;
}
.edui-video-wrapper fieldset legend{font-weight: bold;}
.edui-video-wrapper fieldset p{line-height: 30px;}
.edui-video-wrapper fieldset input.edui-video-txt{
.edui-dialog-video .edui-video-wrapper fieldset legend{font-weight: bold;}
.edui-dialog-video .edui-video-wrapper fieldset p{line-height: 30px;}
.edui-dialog-video .edui-video-wrapper fieldset input.edui-video-txt{
width: 65px;
height: 21px;
line-height: 21px;
margin: 8px 5px;
background: #FFF;
border: 1px solid #d7d7d7;
}
.edui-video-wrapper label.edui-video-url{font-weight: bold;margin-left: 5px;color: #06c;}
#eduiVideoFloat div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;}
#eduiVideoFloat .edui-video-focus{opacity: 1;filter: alpha(opacity = 100)}
.edui-video-wrapper span.edui-video-view{display: inline-block;width: 30px;float: right;cursor: pointer;color: blue}
.edui-dialog-video .edui-video-wrapper label.edui-video-url{font-weight: bold;margin-left: 5px;color: #06c;}
.edui-dialog-video #eduiVideoFloat div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;}
.edui-dialog-video #eduiVideoFloat .edui-video-focus{opacity: 1;filter: alpha(opacity = 100)}
.edui-dialog-video .edui-video-wrapper span.edui-video-view{display: inline-block;width: 30px;float: right;cursor: pointer;color: blue}
2 changes: 1 addition & 1 deletion dialogs/video/video.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

(function(){
var domUtils = UM.dom.domUtils;
var widgetName = 'insertvideo';
var widgetName = 'video';

UM.registerWidget( widgetName,{

Expand Down
4 changes: 2 additions & 2 deletions lang/en/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ UM.I18N['en'] = {
'mergecells':'MergeCells', 'deletetable':'DeleteTable', 'cleardoc':'Clear', 'insertparagraphbeforetable':"InsertParagraphBeforeTable",
'fontfamily':'FontFamily', 'fontsize':'FontSize', 'paragraph':'Paragraph', 'image':'Image','edittable':'Edit Table', edittd:'Edit Td','link':'Link',
'emotion':'Emotion', 'spechars':'Spechars', 'searchreplace':'SearchReplace', 'map':'BaiduMap', 'gmap':'GoogleMap',
'insertvideo':'Video', 'help':'Help', 'justifyleft':'JustifyLeft', 'justifyright':'JustifyRight', 'justifycenter':'JustifyCenter',
'video':'Video', 'help':'Help', 'justifyleft':'JustifyLeft', 'justifyright':'JustifyRight', 'justifycenter':'JustifyCenter',
'justifyjustify':'Justify', 'forecolor':'FontColor', 'backcolor':'BackColor', 'insertorderedlist':'OL',
'insertunorderedlist':'UL', 'fullscreen':'FullScreen', 'directionalityltr':'EnterFromLeft', 'directionalityrtl':'EnterFromRight',
'rowspacingtop':'RowSpacingTop', 'rowspacingbottom':'RowSpacingBottom', 'highlightcode':'Code', 'pagebreak':'PageBreak', 'insertframe':'Iframe', 'imagenone':'Default',
Expand Down Expand Up @@ -210,7 +210,7 @@ UM.I18N['en'] = {
cityMsg:"Please enter the city name!",
errorMsg:"Can't find the place!"
},
insertvideo:{
video:{
'static':{
lang_tab_insertV:"Video",
// lang_tab_searchV:"Search",
Expand Down
4 changes: 2 additions & 2 deletions lang/zh-cn/zh-cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ UM.I18N['zh-cn'] = {
'deleterow':'删除行', 'deletecol':'删除列', 'splittorows':'拆分成行', 'splittocols':'拆分成列', 'splittocells':'完全拆分单元格',
'mergecells':'合并多个单元格', 'deletetable':'删除表格', 'cleardoc':'清空文档','insertparagraphbeforetable':"表格前插入行",'insertcode':'代码语言','fontfamily':'字体', 'fontsize':'字号', 'paragraph':'段落格式', 'image':'图片',
'edittable':'表格属性','edittd':'单元格属性', 'link':'超链接','emotion':'表情', 'spechars':'特殊字符', 'searchreplace':'查询替换', 'map':'Baidu地图', 'gmap':'Google地图',
'insertvideo':'视频', 'help':'帮助', 'justifyleft':'居左对齐', 'justifyright':'居右对齐', 'justifycenter':'居中对齐',
'video':'视频', 'help':'帮助', 'justifyleft':'居左对齐', 'justifyright':'居右对齐', 'justifycenter':'居中对齐',
'justifyjustify':'两端对齐', 'forecolor':'字体颜色', 'backcolor':'背景色', 'insertorderedlist':'有序列表',
'insertunorderedlist':'无序列表', 'fullscreen':'全屏', 'directionalityltr':'从左向右输入', 'directionalityrtl':'从右向左输入',
'rowspacingtop':'段前距', 'rowspacingbottom':'段后距', 'highlightcode':'插入代码', 'pagebreak':'分页', 'insertframe':'插入Iframe', 'imagenone':'默认',
Expand Down Expand Up @@ -193,7 +193,7 @@ UM.I18N['zh-cn'] = {
cityMsg:"请选择城市",
errorMsg:"抱歉,找不到该位置!"
},
'insertvideo':{
'video':{
'static':{
lang_tab_insertV:"插入视频",
// lang_tab_searchV:"搜索视频",
Expand Down
2 changes: 1 addition & 1 deletion themes/default/_css/buttonicon.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
.edui-btn-toolbar .edui-btn .edui-icon-emotion {
background-position: -60px -20px;
}
.edui-btn-toolbar .edui-btn .edui-icon-insertvideo {
.edui-btn-toolbar .edui-btn .edui-icon-video {
background-position: -320px -20px;
}

Expand Down
2 changes: 1 addition & 1 deletion themes/default/_css/dialogsize.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
height: 400px;
}
/*插入视频*/
.edui-dialog-insertvideo-body{
.edui-dialog-video-body{
width: 600px;
height: 350px;
}
Expand Down
2 changes: 1 addition & 1 deletion umeditor.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
'source | undo redo | bold italic underline strikethrough | superscript subscript | forecolor backcolor | removeformat |',
'insertorderedlist insertunorderedlist | selectall cleardoc paragraph | fontfamily fontsize' ,
'| justifyleft justifycenter justifyright justifyjustify |',
'link unlink | emotion image insertvideo | map',
'link unlink | emotion image video | map',
'| horizontal print preview fullscreen', 'drafts', 'formula'
]

Expand Down

0 comments on commit 4663ef4

Please sign in to comment.