Permalink
Browse files

Made ice fully instance based; cleaned up constructor and added start…

…Tracking() to the API; added better user action descriptions for change types; clean up
  • Loading branch information...
1 parent 55b986e commit 81afb14a04620480edc4e1479f5384916d1362fe @delambo delambo committed Jan 23, 2012
View
@@ -27,8 +27,10 @@ Ice is a track changes implementation, built in javascript, for anything that is
// set a user object to associate with each change
currentUser: { id: 1, name: 'Miss T' }
});
+ // setup and start event handling for track changes
+ tracker.startTracking();
-Additional options and post-init callback:
+Additional options:
var tracker = new ice.InlineChangeEditor({
element: document.getElementById('mytextelement'),
@@ -49,7 +51,7 @@ Additional options and post-init callback:
}
}
]
- }, function() { console.log('ice post-init callback') });
+ }).startTracking();
***
View
@@ -16,7 +16,6 @@ javascripts:
- src/dom.js
- src/bookmark.js
- src/selection.js
- - src/range.js
- src/icePlugin.js
- src/icePluginManager.js
- src/plugins/IceAddTitlePlugin/IceAddTitlePlugin.js
View
@@ -1,82 +0,0 @@
-<!DOCTYPE HTML>
-<head>
-
- <link rel="stylesheet" href="demo.css" type="text/css" media="screen" />
-
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
- <script type="text/javascript" src='../lib/rangy-1.2/rangy-core.js'></script>
- <script type="text/javascript" src='../lib/rangy-1.2/rangy-cssclassapplier.js'></script>
- <script type="text/javascript" src='../lib/rangy-1.2/rangy-selectionsaverestore.js'></script>
- <script type="text/javascript" src='../lib/rangy-1.2/rangy-serializer.js'></script>
- <script type="text/javascript" src='../src/ice.js'></script>
- <script type="text/javascript" src='../src/dom.js'></script>
- <script type="text/javascript" src='../src/icePlugin.js'></script>
- <script type="text/javascript" src='../src/icePluginManager.js'></script>
- <script type="text/javascript" src='../src/bookmark.js'></script>
- <script type="text/javascript" src='../src/selection.js'></script>
- <script type="text/javascript" src='../src/range.js'></script>
- <script type="text/javascript" src='../src/plugins/IceAddTitlePlugin/IceAddTitlePlugin.js'></script>
- <script type="text/javascript" src='../src/plugins/IceCopyPastePlugin/IceCopyPastePlugin.js'></script>
- <script type="text/javascript" src='../src/plugins/IceEmdashPlugin/IceEmdashPlugin.js'></script>
- <script type="text/javascript" src='../src/plugins/IceSmartQuotesPlugin/IceSmartQuotesPlugin.js'></script>
- <script type="text/javascript" src="../lib/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
- <script type="text/javascript">
-
- tinymce.init({
- mode: "exact",
- elements: "tinymce",
- theme: "advanced",
- plugins: 'ice,icesearchreplace',
- theme_advanced_buttons1: "bold,italic,underline,|,undo,redo,|,search,replace,|,ice_togglechanges,ice_toggleshowchanges,iceacceptall,icerejectall,iceaccept,icereject",
- theme_advanced_buttons2: "",
- theme_advanced_buttons3: "",
- theme_advanced_buttons4: "",
- theme_advanced_toolbar_location: "top",
- theme_advanced_toolbar_align: "left",
- extended_valid_elements: "p,span[*],delete[*],insert[*]",
- ice: {
- user: { name: 'Geoffrey Jellineck', id: 11},
- preserveOnPaste: 'p,a[href],i,em,b,span'
- },
- height: '400'
- });
-
- function setUser(el) {
- var name = $(el).find(':selected').data('username');
- var id = $(el).find(':selected').data('userid');
- tinymce.execCommand('ice_changeuser', {id: id, name: name});
- }
-
-</script>
-</head>
-<body>
- <div class="control">
- <strong>Set User:</strong>
- <select onchange="setUser(this)">
- <option data-userid="11" data-username="Geoffrey Jellineck">Geoffrey Jellineck</option>
- <option data-userid="22" data-username="Chuck Noblet">Chuck Noblet</option>
- <option data-userid="33" data-username="Jerri Blank">Jerri Blank</option>
- </select>
- </div>
- <div id="content">
- <div id="tinymce-wrapper">
- <textarea id="tinymce" style="width: 100%">
- <p><delete class="del cts-1" data-cid="2" data-userid="33" data-username="Jerri Blank" data-time="1326764311895" title="Modified by Jerri Blank - 01/16/2012 8:38pm">Brooklyn</delete><insert class="ins cts-1" data-cid="3" data-userid="33" data-username="Jerri Blank" data-time="1326764319303" title="Modified by Jerri Blank - 01/16/2012 8:38pm">Kings Point</insert>, N.Y. &mdash; Adam Katz is happy to talk to reporters when he is promoting his business, a charter flight company based on Long Island called Talon Air.</p><p>
-But when the subject was his position as one of America's top earners, he <delete class="del cts-1" data-cid="23" data-userid="33" data-username="Jerri Blank" data-time="1326765043953" title="Modified by Jerri Blank - 01/16/2012 8:50pm">hesitated</delete><insert class="ins cts-1" data-cid="24" data-userid="33" data-username="Jerri Blank" data-time="1326765049283" title="Modified by Jerri Blank - 01/16/2012 8:50pm">balked</insert>. Seated at a desk fashioned from a jet fuel cell<insert title="Modified by Geoffrey Jellineck - 01/16/2012 8:42pm" data-time="1326764560331" data-username="Geoffrey Jellineck" data-userid="11" data-cid="20" class="ins cts-3">, wearing a button-down shirt with the company logo,</insert> he considered the public relations benefits and found them lacking: "It's not very popular to be in the 1 percent these days, is it?"</p><p><insert class="ins cts-2" data-cid="14" data-userid="22" data-username="Chuck Noblet" data-time="1326764402035" title="Modified by Chuck Noblet - 01/16/2012 8:40pm">A few months ago, Mr. Katz was just a successful businessman with <delete class="del cts-3" data-cid="15" data-userid="11" data-username="Geoffrey Jellineck" data-time="1326764492624" title="Modified by Geoffrey Jellineck - 01/16/2012 8:41pm">four</delete><insert class="ins cts-3" data-cid="16" data-userid="11" data-username="Geoffrey Jellineck" data-time="1326764495239" title="Modified by Geoffrey Jellineck - 01/16/2012 8:41pm">five</insert> children, an $8 million home, a family real estate company in Manhattan and his passion, 10-year-old Talon Air.</insert></p><p>
-Now, the colossal gap between the very rich and everyone else <insert title="Modified by Geoffrey Jellineck - 01/16/2012 8:46pm" data-time="1326764809499" data-username="Geoffrey Jellineck" data-userid="11" data-cid="22" class="ins cts-3">&mdash; the 1 percent versus the 99 percent &mdash; </insert>has become a rallying point in this election season. As President Obama positions himself as a defender of the middle class, and Mitt Romney, the wealthiest of the Republican presidential candidates, decries such talk as "the bitter politics of envy," Mr. Katz has found himself on the wrong end of a new paradigm.</p><p><insert class="ins cts-1" data-cid="30" data-userid="33" data-username="Jerri Blank" data-time="1326765098946" title="Modified by Jerri Blank - 01/16/2012 8:51pm">As a member of the 1 percent, he is part of a club whose name conjures images of Wall Street bosses who are chauffeured from manse to Manhattan and fat cats who have armies of lobbyists at the ready.</insert></p> <p>
-But in reality it is a far larger and more varied group, one that includes podiatrists and actuaries, executives and entrepreneurs, the self-made and the silver spoon set. They are clustered not just in New York and Los Angeles, but also in Denver and Dallas. The range of wealth in the 1 percent is vast &mdash; from households that bring in $380,000 a year, according to census data, up to billionaires like Warren E. Buffett and Bill Gates.</p><p>
-The top 1 percent of earners in a given year receives <a title="Related data from the Tax Policy Center." href="http://www.taxpolicycenter.org/numbers/displayatab.cfm?DocID=2972">just under a fifth</a> of the country's pretax income, <a title="A Congressional Budget Office report." href="http://www.cbo.gov/publications/collections/tax/2010/pre-tax_income_shares.pdf">about double their share</a> 30 years ago. They pay just over a fourth of all federal taxes, according to the Tax Policy Center. In 2007, they accounted for about 30 percent of philanthropic giving, according to Federal Reserve data. They received 22 percent of their income from capital gains, compared with 2 percent for everybody else.</p><p><insert class="ins cts-3" data-cid="21" data-userid="11" data-username="Geoffrey Jellineck" data-time="1326764626633" title="Modified by Geoffrey Jellineck - 01/16/2012 8:43pm">Still, they are not necessarily the idle rich. Mr. Katz, who sometimes commutes by amphibious plane and sometimes carries luggage for Talon Air passengers, likes to say he works "26/9."</insert></p> <p>
-Most 1 percenters were born with socioeconomic advantages, which helps explain why the 1 percent is more likely than other Americans to have jobs, according to census data. They work longer hours, being three times more likely than the 99 percent to work more than 50 hours a week, and are more likely to be self-employed. Married 1 percenters are just as likely as other couples to have two incomes, but men are the big breadwinners, earning 75 percent of the money, compared with 64 percent of the income in other households.</p><p>
-Though many of the wealthy lean toward the Republican Party, in interviews, 1 percenters expressed a broad range of views on how to fix the economy. They think that President Obama is ruining it, or that Republicans in Congress have gone off the deep end. They favor a flat tax, or they believe the rich should pay a higher marginal rate. Some cheered on Occupy Wall Street, saying it was about time, while others wished the protesters would just get a job or take a bath. Still others were philosophical &mdash; perhaps because they could afford to be &mdash; viewing the <a href="http://topics.nytimes.com/top/reference/timestopics/subjects/r/recession_and_depression/index.html?inline=nyt-classifier" title="More articles about the recession." class="meta-classifier">recession</a> as something that would pass, like so many previous ups and downs.</p><p><insert class="ins cts-2" data-cid="31" data-userid="22" data-username="Chuck Noblet" data-time="1326765165952" title="Modified by Chuck Noblet - 01/16/2012 8:52pm">Of the 1 percenters interviewed for this article, almost all &amp;mdash; conservatives and liberals alike &amp;mdash; said the wealthy could and should shoulder more of the country's financial burden, and almost all said they viewed the current system as unfair. But they may prefer facing cuts to their own benefits like &lt;a href="http://topics.nytimes.com/top/reference/timestopics/subjects/s/social_security_us/index.html?inline=nyt-classifier" title="More articles about Social Security." class="meta-classifier"&gt;Social Security&lt;/a&gt; than paying more taxes. In &lt;a title="The survey, by the Russell Sage Foundation." href="http://www.russellsage.org/blog/r-mascarenhas/wealthiest-1-percent-and-common-good"&gt;one survey&lt;/a&gt; of wealthy Chicago families, almost twice as many respondents said they would cut government spending as those who said they would cut spending and raise revenue.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</insert></p><p>
-Even those who said the deck was stacked in their favor did not appreciate anti-rich rhetoric.</p><p>
-"I don't mind paying a little bit more in taxes. I don't mind putting money to programs that help the poor," said Anthony J. Bonomo of Manhasset, N.Y., who runs a medical malpractice insurance company and is a Republican. But, he said, he did mind taking a hit for the country's woes. "If those people could camp out in that park all day, why aren't they out looking for a job? Why are they blaming others?"</p><p>
-To many, 99 vs. 1 was an artificial distinction that overlooked hard work and moral character. "It shouldn't be relevant," said Mr. Katz , who said he both creates job and contributes to charitable causes. "I'm not hurting anyone. I'm helping a lot of people."</p><p>
-<strong> The Enclave</strong></p><p>
-The placid sliver of Long Island that F. Scott Fitzgerald immortalized in "The Great Gatsby" as West Egg and East Egg seems almost to have shrugged off the recession.</p><p>
-A stretch of northwest Nassau County that includes Great Neck, Manhasset and Port Washington, this area has the country's highest concentration of 1 percenters, and one of the lowest unemployment rates in the state. Houses in Port Washington are worth only 10 percent less than they were at their peak, according to the <a href="http://topics.nytimes.com/top/reference/timestopics/subjects/s/standard_poors_caseshiller_home_price_index/index.html?inline=nyt-classifier" title="More articles about the Case-Shiller Home Price Index." class="meta-classifier">Standard &amp; Poor's Case-Shiller Home Price Index</a>, a far smaller decline than in the rest of the country. Yearly sales at the Americana Manhasset, the upscale granite and glass shopping center, have already exceeded their prerecession high. Even in down times, the 1 percent has <a title="Tables 1 and 2 in a related study (PDF). " href="http://www.treasury.gov/resource-center/tax-policy/Documents/incomemobilitystudy03-08revise.pdf">staying power</a>, being far more likely than any other group to stay where they are rather than slip to lower rungs of the economic ladder.</p>
- </textarea>
- </div>
- </div>
-
-</body>
-</html>
View
@@ -1,9 +1,34 @@
+body {
+ font-size: 16px;
+ line-height: 24px;
+ background: #EFEFEF;
+ height: 100%;
+ color: #6F6F6F;
+ font-family: Helvetica Neue,Helvetica,Arial;
+}
+div.container {
+ width: 720px;
+ margin: 0 auto;
+}
+.editor {
+ box-shadow: rgba(0, 0, 0, 0.4) 0 1px 3px 0;
+ -moz-box-shadow: rgba(0, 0, 0, 0.4) 0 1px 3px 0;
+ -webkit-box-shadow: rgba(0, 0, 0, 0.4) 0 1px 3px 0;
+ margin-bottom: 30px;
+ padding: 10px;
+ width: 700px;
+ height: 440px;
+}
+h1, h3 {
+ color: #7F7F7F;
+ text-shadow: 0 1px 0 white;
+}
.control { font: 12px Arial; padding: 5px; display: inline-block; margin-bottom: 5px; }
.control button { margin-right: 5px; }
#content { color: #333333; font: 14px; }
#content, #tinymce-wrapper { height: 300px; }
#text-wrapper {
- width: 623px;
+ width: 620px;
background: #CFCFCF;
min-height: 300px;
max-height: 300px;
@@ -29,7 +54,7 @@ a.mceButton16 img.mceIcon { width: 16px; height: 16px; padding: 2px;}
.CT-hide .ins, .CT-hide .ins {
color: #333333;
background: none !important;
- border: none !important;
+ border: none !important;
text-decoration: none;
}
Oops, something went wrong.

0 comments on commit 81afb14

Please sign in to comment.