title: javascript mvc framework design practice for edit-in-place interface
body: <p>I am programming a CMS that allows creating and editing elements (content blocks) on the site in a WYSIWYG manner. basically, when logged in, you see visually the same website, but hovering and clicking on elements brings up either editors (like Aloha) or additional controls. </p>
  
  <p>For instance:</p>
  
  <ul>
  <li>hovering a paragraph would display a
  small menu on its side which allows
  selecting between left, center and
  right alignment</li>
  <li>clicking on a paragraph would make it editable</li>
  <li>hovering over an image would display a dot on the right side of the image, which can be dragged thus changing the width of the image (height would update proportionally)</li>
  <li>hovering any of the blocks in the website would bring up a "+" button that allows to create another block before the hovered block.</li>
  <li>etc.</li>
  </ul>
  
  <p>My current strategy is to use a similar technique that i saw used on <a href="http://www.nikebetterworld.com" rel="nofollow">Nike Better World</a> and have been using ever since: there's an instantiating javascript that invokes jquery plugin on each html element that has a data-controller attribute, the name of the plugin being specified by the data-controller attribute. </p>
  
  <p>Slightly extending this concept i would use it to attach all kinds of controls to the content blocks.</p>
  
  <p>But, being a noob, only recently i came across javascript mvc frameworks like backbone.js. I've been working with MVC on the server side (in Kohana), but never yet in javascript. It seems that i can use it, but it's unclear to me, what would be the strategy. The CMS i'm working on is a kind of a hybrid between a proper javascript application, and an old-school html website. I don't understand, how can i use, e.g., backbone.js's collection object for content blocks, if they are already loaded in the page html (that doesn't make sense to me to load them with javascript).</p>
  
  <p>does anybody have any suggestions?</p>