update link and note editor

This commit is contained in:
Mariela Michalek 2014-04-02 15:57:32 -03:00
parent 5d8dc697b0
commit 8823303442
2 changed files with 41 additions and 22 deletions

View File

@ -61,24 +61,27 @@ mindplot.widget.LinkEditor = new Class({
// this.overlay.destroy(); // this.overlay.destroy();
// } // }
// }); // });
this.appendToContent(panel); this.setContent(panel);
}, },
_buildPanel:function (model) { _buildPanel:function (model) {
var result = $('<div></div>').css("padding-top", "5px"); var result = $('<div></div>').css("padding-top", "5px");
var form = $('<form></form>').attr('action','none').attr('id','linkFormId'); var form = $('<form></form>').attr({
'action':'none',
'id':'linkFormId'
});
var text = $('<p></p>').text("Paste your url here:"); var text = $('<p></p>').text("Paste your url here:");
text.css('margin','0px 0px 10px'); text.css('margin','0px 0px 10px');
form.append(text); form.append(text);
// Add Input // Add Input
var input = $('<input>').attr( var input = $('<input>').attr({
'placeholder','http://www.example.com/').attr( 'placeholder':'http://www.example.com/',
'type','url').attr( 'type':'url',
'required','true').attr( 'required':'true',
'autofocus','autofocus' 'autofocus':'autofocus'
); });
input.css('width','70%').css('margin','0px 20px'); input.css('width','70%').css('margin','0px 20px');
if (model.getValue() != null){ if (model.getValue() != null){
@ -86,9 +89,10 @@ mindplot.widget.LinkEditor = new Class({
// type:Browser.ie ? 'text' : 'url', // IE workaround // type:Browser.ie ? 'text' : 'url', // IE workaround
// Open Button // Open Button
var open = $('<input/>').attr( var open = $('<input/>').attr({
'type','button').attr( 'type':'button',
'value',$msg('OPEN_LINK')); 'value':$msg('OPEN_LINK')
});
open.click(function(){ open.click(function(){
alert('clicked!'); alert('clicked!');

View File

@ -62,20 +62,27 @@ mindplot.widget.NoteEditor = new Class({
// } // }
// }); // });
// this.setContent(panel); // this.setContent(panel);
this.appendToContent(panel); this.setContent(panel);
}, },
_buildPanel:function (model) { _buildPanel:function (model) {
var result = $('<div></div>').css("padding-top", "5px"); var result = $('<div></div>').css("padding-top", "5px");
var form = $('<form></form>').attr('action','none').attr('id','noteFormId'); var form = $('<form></form>').attr({
'action':'none',
'id':'noteFormId'
});
// Add textarea // Add textarea
var textArea = $('<textarea></textarea>').attr({
var textArea = $('<textarea></textarea>').attr( 'placeholder':$msg('WRITE_YOUR_TEXT_HERE'),
'placeholder',$msg('WRITE_YOUR_TEXT_HERE')).attr( 'required':'true',
'required','true').attr( 'autofocus':'autofocus'
'autofocus','autofocus'); });
textArea.css( 'width','100%').css('height',80).css('resize','none'); textArea.css({
'width':'100%',
'height':80,
'resize':'none'
});
form.append(textArea); form.append(textArea);
// var textArea = new Element('textarea', // var textArea = new Element('textarea',
@ -114,8 +121,10 @@ mindplot.widget.NoteEditor = new Class({
// Add buttons ... // Add buttons ...
var buttonContainer = $('<div></div>'); var buttonContainer = $('<div></div>');
buttonContainer.css('paddingTop','5').css('textAlign','center'); buttonContainer.css({
// var buttonContainer = new Element('div').setStyles({paddingTop:5, textAlign:'right'}); 'paddingTop':'5',
'textAlign':'center'
});
// Create accept button ... // Create accept button ...
var okButton = $('<input>'); var okButton = $('<input>');
@ -147,7 +156,13 @@ mindplot.widget.NoteEditor = new Class({
'value',$msg('CANCEL')).attr( 'value',$msg('CANCEL')).attr(
'class','btn-secondary'); 'class','btn-secondary');
cancelButton.css('margin','5px'); cancelButton.css('margin','5px');
cancelButton.click(function () {this.close();}); // cancelButton.on('click','input', function (e) {
// console.log('this is the click');
// e.preventDefault();
// });
$(document).on('click', "input.btn-secondary", function () {
$(modal-dialog).hide();
});
buttonContainer.append(cancelButton); buttonContainer.append(cancelButton);
form.append(buttonContainer); form.append(buttonContainer);