aboutsummaryrefslogtreecommitdiff
path: root/js/panels/components-panel.reel/components-panel.js
diff options
context:
space:
mode:
authorJohn Mayhew2012-05-07 16:30:19 -0700
committerJohn Mayhew2012-05-07 16:30:19 -0700
commitdb4ba95f50148198759dde503ec1c778184d9dbe (patch)
tree8b79ad58108af2f17d15abc8cdc33d35229ab20d /js/panels/components-panel.reel/components-panel.js
parent843d8ea8ee58a54bcb71d7b28dbf78fae153b491 (diff)
parent526e423e4a2734c2b139af23911e912452a4443f (diff)
downloadninja-db4ba95f50148198759dde503ec1c778184d9dbe.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into WorkingBranch
Conflicts: js/components/layout/tools-list.reel/tools-list.html js/components/layout/tools-properties.reel/tools-properties.html js/components/tools-properties/brush-properties.reel/brush-properties.html js/components/tools-properties/fill-properties.reel/fill-properties.html js/components/tools-properties/pen-properties.reel/pen-properties.html js/components/tools-properties/pencil-properties.reel/pencil-properties.html js/components/tools-properties/selection-properties.reel/selection-properties.html js/components/tools-properties/shape-properties.reel/shape-properties.html js/components/tools-properties/tag-properties.reel/tag-properties.html js/components/tools-properties/text-properties.reel/text-properties.html
Diffstat (limited to 'js/panels/components-panel.reel/components-panel.js')
-rwxr-xr-xjs/panels/components-panel.reel/components-panel.js64
1 files changed, 30 insertions, 34 deletions
diff --git a/js/panels/components-panel.reel/components-panel.js b/js/panels/components-panel.reel/components-panel.js
index 79eac37b..4169423b 100755
--- a/js/panels/components-panel.reel/components-panel.js
+++ b/js/panels/components-panel.reel/components-panel.js
@@ -317,81 +317,77 @@ exports.ComponentsPanel = Montage.create(Component, {
317 317
318 switch(name) { 318 switch(name) {
319 case "anchor": 319 case "anchor":
320 el = NJUtils.makeNJElement("a", "Anchor", "component"); 320 el = document.application.njUtils.make("a", null, this.application.ninja.currentDocument);
321 el.elementModel.pi = "AnchorPi"; 321 document.application.njUtils.createModelForComponent(el, "Anchor");
322 el.setAttribute("href", "http://www.motorola.com"); 322 el.setAttribute("href", "http://www.motorola.com");
323 el.innerHTML = "link"; 323 el.innerHTML = "link";
324 break; 324 break;
325 case "button": 325 case "button":
326 el = NJUtils.makeNJElement(name, "Button", "component"); 326 el = document.application.njUtils.make(name, null, this.application.ninja.currentDocument);
327 el.elementModel.pi = "ButtonPi"; 327 document.application.njUtils.createModelForComponent(el, "Button");
328 el.setAttribute("type", "button"); 328 el.setAttribute("type", "button");
329 el.innerHTML = "Button"; 329 el.innerHTML = "Button";
330 break; 330 break;
331 case "checkbox": 331 case "checkbox":
332 el = NJUtils.makeNJElement("input", "Checkbox", "component"); 332 el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument);
333 el.elementModel.pi = "CheckboxPi"; 333 document.application.njUtils.createModelForComponent(el, "Checkbox");
334 el.setAttribute("type", "checkbox"); 334 el.setAttribute("type", "checkbox");
335 break; 335 break;
336 case "imageComponent": 336 case "imageComponent":
337 el = NJUtils.makeNJElement("image", "Image", "component"); 337 el = document.application.njUtils.make("image", null, this.application.ninja.currentDocument);
338 el.elementModel.pi = "ImagePi"; 338 document.application.njUtils.createModelForComponent(el, "Image");
339 el.setAttribute("width", 200); 339 el.setAttribute("width", 200);
340 el.setAttribute("height", 200); 340 el.setAttribute("height", 200);
341 break; 341 break;
342 case "numberInput": 342 case "numberInput":
343 el = NJUtils.makeNJElement("input", "Number Input", "component"); 343 el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument);
344 el.elementModel.pi = "NumberInputPi"; 344 document.application.njUtils.createModelForComponent(el, "Number Input");
345 el.setAttribute("type", "number"); 345 el.setAttribute("type", "number");
346 break; 346 break;
347 case "select": 347 case "select":
348 el = NJUtils.makeNJElement("select", "Select", "component"); 348 el = document.application.njUtils.make("select", null, this.application.ninja.currentDocument);
349 el.elementModel.pi = "SelectInputPi"; 349 document.application.njUtils.createModelForComponent(el, "Select");
350 break; 350 break;
351 case "radioButton": 351 case "radioButton":
352 el = NJUtils.makeNJElement("input", "Radio Button", "component"); 352 el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument);
353 el.elementModel.pi = "RadioButtonPi"; 353 document.application.njUtils.createModelForComponent(el, "Radio Button");
354 el.setAttribute("type", "radio"); 354 el.setAttribute("type", "radio");
355 break; 355 break;
356 case "rangeInput": 356 case "rangeInput":
357 el = NJUtils.makeNJElement("input", "Range Input", "component"); 357 el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument);
358 el.elementModel.pi = "RangeInputPi"; 358 document.application.njUtils.createModelForComponent(el, "Range Input");
359 el.setAttribute("type", "range"); 359 el.setAttribute("type", "range");
360 break; 360 break;
361 case "textfield": 361 case "textfield":
362 case "searchfield": 362 case "searchfield":
363 el = NJUtils.makeNJElement("input", "Textfield", "component"); 363 el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument);
364 el.elementModel.pi = "TextfieldPi"; 364 document.application.njUtils.createModelForComponent(el, "Textfield");
365 el.setAttribute("type", "text"); 365 el.setAttribute("type", "text");
366 break; 366 break;
367 case "textarea": 367 case "textarea":
368 el = NJUtils.makeNJElement("textarea", "TextArea", "component"); 368 el = document.application.njUtils.make("textarea", null, this.application.ninja.currentDocument);
369 el.elementModel.pi = "TextareaPi"; 369 document.application.njUtils.createModelForComponent(el, "TextArea");
370 break; 370 break;
371 case "toggleButton": 371 case "toggleButton":
372 el = NJUtils.makeNJElement("button", "Toggle Button", "component"); 372 el = document.application.njUtils.make("button", null, this.application.ninja.currentDocument);
373 el.elementModel.pi = "ToggleButtonPi"; 373 document.application.njUtils.createModelForComponent(el, "Toggle Button");
374 el.innerHTML = "Off"; 374 el.innerHTML = "Off";
375 break; 375 break;
376 case "map": 376 case "map":
377 el = NJUtils.makeNJElement("div", "Map", "component"); 377 el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument);
378 el.elementModel.pi = "MapPi"; 378 document.application.njUtils.createModelForComponent(el, "Map");
379 el.elementModel.isComponent = true;
380 break; 379 break;
381 case "feedreader": 380 case "feedreader":
382 el = NJUtils.makeNJElement("div", "Feed Reader", "component"); 381 el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument);
383 el.elementModel.pi = "FeedReaderPi"; 382 document.application.njUtils.createModelForComponent(el, "Feed Reader");
384 el.elementModel.isComponent = true;
385 break; 383 break;
386 case "picasa-carousel": 384 case "picasa-carousel":
387 el = NJUtils.makeNJElement("div", "Picasa Carousel", "component"); 385 el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument);
388 el.elementModel.pi = "PicasaCarouselPi"; 386 document.application.njUtils.createModelForComponent(el, "Picasa Carousel");
389 el.elementModel.isComponent = true;
390 break; 387 break;
391 case "youtube-channel": 388 case "youtube-channel":
392 el = NJUtils.makeNJElement("div", "Youtube Channel", "component"); 389 el = document.application.njUtils.make("div", null, this.application.ninja.currentDocument);
393 el.elementModel.pi = "YoutubeChannelPi"; 390 document.application.njUtils.createModelForComponent(el, "Youtube Channel");
394 el.elementModel.isComponent = true;
395 break; 391 break;
396 392
397 } 393 }