forked from alexrk/mercury-rails
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jeremy Jackson & Terrence Lee
committed
May 17, 2011
1 parent
40c1228
commit 2d1fbc5
Showing
10 changed files
with
193 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
pairs: | ||
aw: Alex Welch; alex.welch | ||
an: Anthony Navarre; anthony.navarre | ||
jz: Jay Zeschin; jay.zeschin | ||
br: Brian Rose; brian.rose | ||
dp: Don Petersen; don.petersen | ||
jj: Jeremy Jackson; jeremy.jackson | ||
aj: Andrew Jaswa; andrew.jaswa | ||
jg: Justin Gitlin; justin.gitlin | ||
gv: Gabe Varela; gabe.varela | ||
mk: Matt Kitt; matt.kitt | ||
cw: Craig Williams; craig.williams | ||
tl: Terrence Lee; terrence.lee | ||
email: | ||
prefix: pair | ||
domain: factorylabs.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,29 @@ | ||
class HistoryBuffer extends Array | ||
class Carmenta.HistoryBuffer | ||
|
||
constructor: -> | ||
@push(arguments) | ||
constructor: (@maxLength = 200) -> | ||
@index = 0 | ||
@stack = [] | ||
|
||
|
||
push: (item) -> | ||
return if @stack[@index] && @stack[@index].replace(/<em class="carmenta-marker"><\/em>/g, '') == item.replace(/<em class="carmenta-marker"><\/em>/g, '') # if it's the same, don't do anything | ||
|
||
@stack = @stack[0...@index + 1] | ||
@stack.push(item) | ||
@stack.shift() if @stack.length > @maxLength | ||
@index = @stack.length - 1 | ||
|
||
console.debug('----------------------------------------------------------------', @stack.length) | ||
console.debug(@stack[0...@stack.length]) | ||
|
||
|
||
undo: -> | ||
return null if @index < 1 | ||
@index -= 1 | ||
return @stack[@index] | ||
|
||
|
||
redo: -> | ||
return null if @index > @stack.length - 2 | ||
@index += 1 | ||
return @stack[@index] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
%form#carmenta_table{ :style => 'width:700px' } | ||
|
||
.carmenta-modal-pane-container | ||
.carmenta-modal-pane | ||
#table_display | ||
%table{ :style => 'width:100%;height:300px;', :border => '1', :cellpadding => '1' } | ||
%tr | ||
%td | ||
%td | ||
%tr | ||
%td | ||
%td | ||
|
||
#table_options | ||
.legend Structure Options | ||
%fieldset | ||
%p | ||
%input{ :type => 'button', :value => '+' }/ | ||
%input{ :type => 'button', :value => '-' }/ | ||
|
||
.legend Display Options | ||
%fieldset | ||
%p | ||
%label{ :for => 'alignment' } Alignment | ||
%select#alignment{ :name => 'alignment' } | ||
%option{ :value => '', :selected => true } None | ||
%option{ :value => 'left' } Left | ||
%option{ :value => 'right' } Right | ||
|
||
.carmenta-modal-controls | ||
%input{ :type => 'submit', :value => 'Insert Table' } |