CodeMirror with Timestamp.

Community Driven Extensions Project
Post Reply
cri_sys
Posts: 22
Joined: 17 Jul 2012, 11:47

17 Jul 2012, 12:10

Hello,

I would like to implement the CodeMirror, but a little bit different.
I wont need any CSS since the text it will be plain text, the main idea it is that i want to set time stamp instead of numbers in the marker column.
An example,
let say that i write in the text box several lines, then it looks like this:

{timestamp|textbox}

|Car 1
|Car 2
|Car 3 Red
|Car 4 Blue

it will be several lines, with any information, and the marker will be empty.
And i will have a button to set the markers of the current line where the cursor is, everytime i press the button the marker should go down from current cursor position and set the current marker from that line with a parameter passed, for example a time stamp. then after pressing the button 4 times would be something like:

12:01.03|Car 1
12:01.10|Car 2
12:01.16|Car 3 Red
12:02.05|Car 4 Blue

it would be even better if the marker field would be editable.
afterwards i need to get all that information in my bean in one string as:
12:01.03;Car 1\n12:01.10;Car 2\n12:01.16;Car 3 Red\n12:02.05;Car 4 Blue

I have been trying to override some function in the javascript code from the Codemirror without success, is there a easy way to do that? or someother suggestion to do this easier. Thanks

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

17 Jul 2012, 12:43

CodeMirror with Timestamp? I think it's not a CodeMirror then. If you will not figure out how to do this here http://codemirror.net/ then it's not possible.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

cri_sys
Posts: 22
Joined: 17 Jul 2012, 11:47

18 Jul 2012, 08:14

Hello,
Its not need it exactly a timestamp but any data, in the beggining of the focused line when a external botton would be selected.
I decided to try the link you sent me, it seems i can make it work with http://codemirror.net/demo/activeline.html, everytime a line is clicked then insert the "timestamp" at the beggining of this line, in case if its not there.
I will make some changes in that javascript code.

Thanks!

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

18 Jul 2012, 10:08

Ok. If you think this is an usefull feature, create a feature request in our issue tracker. Thanks.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests