Skip to content

Commit

Permalink
daisy
Browse files Browse the repository at this point in the history
  • Loading branch information
YuhangGe authored and YuhangGe committed May 18, 2012
1 parent 76d6671 commit bc816ec
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 91 deletions.
4 changes: 2 additions & 2 deletions bug&todo&tip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ bug:

1������Ƥ����Ƕ��Ⱥ��᲻����ȷ���ơ������ڴ�������ע��˵����

2. ��firefox����˫��ʱ���������˫���ڹ���ϻ�ʧЧ����firefox���治�ܴ���doubleclick�¼����������mousedownʱ������λ�øı��������chrome��ie9����û��������⡣������firefox��bug����
2. ie �����겻����͸����

todo:

doodle���϶��Ż��͵���ѡ��Ȼ���ǵ�����λ�ã�Ȼ����link��todo���߼���freenote ���۵�

˫������ѡ�У�������bug���������һ�еij��ı��Զ����к�ĵ�һ�����ʻ������⣩

1��doodle �ĸ���ճ��
3. ��firefox����doodleѡ��������ߡ�
12 changes: 8 additions & 4 deletions js/editor/clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,21 @@
var C = Daisy.Clipboard;
C.prototype = {
getData : function(e, callback) {
//$.log(e)
this.saved_event = e;
this.saved_callback = callback;
if(e && e.clipboardData && e.clipboardData.types) {
/**
* chrome safari
*/
var d_type = e.clipboardData.types[0];
//$.log(e.clipboardData.types);
//$.log(e.clipboardData.items);
$.log(e.clipboardData.types);
$.log(e.clipboardData.items);
$.log(e.clipboardData.getData("text/plain"));
if(d_type === "text/html") {
this.data = {
type : 'html',
value : e.clipboardData.getData("text/html")
value : [e.clipboardData.getData("text/html"), e.clipboardData.getData("text/plain")]
}
this._checkData();
} else if(d_type === "text/uri-list") {
Expand All @@ -36,7 +38,7 @@
value : e.clipboardData.getData("text/uri-list")
}
this._checkData();
} else if(/image/.test(d_type)) {
} else if(d_type === 'Files' || /image/.test(d_type)) {
var reader = new FileReader();

reader.onload = this._image_delegate;
Expand Down Expand Up @@ -102,6 +104,8 @@
this.data.value = this.inner_data;
}
}
//$.log(this.data.type)
$.log(this.data)
this.saved_callback(this.data);
},
_item2Text : function(items) {
Expand Down
6 changes: 3 additions & 3 deletions js/editor/doodle_edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@
if(this.select_doodle === null) {
return;
}
if(this.edit_doodle.isPointInClose(point)) {
this.__doodle_close__ = true;
} else if(this.edit_doodle.isPointInRotate(point)) {
if(this.edit_doodle.isPointInRotate(point)) {
this.__doodle_rotate__ = true;
this.select_doodle.editStart(point);
this.edit_doodle.editStart(point);
this.canvas.style.cursor = "pointer";
} else if(this.edit_doodle.isPointInClose(point)) {
this.__doodle_close__ = true;
} else if(this.edit_doodle.isPointIn(point)) {
this.__doodle_move__ = true;
this.select_doodle.editStart(point);
Expand Down
28 changes: 23 additions & 5 deletions js/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,20 +135,35 @@

}
Daisy.WebNote.prototype = {
_setCaretOpacity : function(v){
if($.ie){
this.caret.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity="+(v*100)+");";
}else{
this.caret.style.opactiy = v.toString();
$.log(this.caret.style.opactiy)
}

$.log(v)
},
setMode : function(mode) {
this.select_doodle = null;
if(mode === 'doodle') {
this.canvas.style.cursor = "crosshair";
this.caret.style.opacity = "0";
//this.caret.style.opactiy = "0";
this.caret.style.color = "rgba(0,0,0,0)";
this.caret.style.opactiy = "0";
//$.log("ie rg")
} else if(mode === 'doodle-edit') {
this.canvas.style.cursor = "default";
//$.log(this.cur_page.doodle_list)
if(this.cur_page.doodle_list.length > 0) {
this.select_doodle = this.cur_page.doodle_list[0];
this.edit_doodle.attachDoodle(this.select_doodle);
}
this.caret.style.opacity = "0";
//this.caret.style.opactiy = 0;
this.caret.style.color = "rgba(0,0,0,0)";
} else if(mode === 'handword' || mode === 'readonly') {
this.caret.style.opacity = "1";
this.caret.style.color = "black";
this.canvas.style.cursor = "text";
} else {
throw 'unknown mode';
Expand Down Expand Up @@ -294,8 +309,10 @@
this.caret.style.top = t + "px";
},
focus : function() {
this.focused = true;
this.caret.focus();
//if(this.cur_mode==="handword" || this.cur_mode==="readonly"){
this.focused = true;
this.caret.focus();
//}
},
_insertText : function(text, caret) {
var e_arr = [], re;
Expand Down Expand Up @@ -437,6 +454,7 @@
var to = this.caret_pos, from = null;
if(to.index < 0)
return;
if(this.cur_page.isCaretInLink())
from = {
para : to.para,
para_at : to.para_at - 1,
Expand Down
Loading

0 comments on commit bc816ec

Please sign in to comment.