aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorValerio Virgillito2012-06-11 14:10:08 -0700
committerValerio Virgillito2012-06-11 14:10:08 -0700
commitf4ad120c1a0d8594b8741eb1b07fdbd4fefcadeb (patch)
tree5dff803d67722595418e69f6cce9ec8a1a616f2f /js
parent30f17ae934ee60ed6e4ce52fad1eebc35fc5914a (diff)
parent756cbfad2b98b300af8db3793aa21718b88dd950 (diff)
downloadninja-f4ad120c1a0d8594b8741eb1b07fdbd4fefcadeb.tar.gz
Merge branch 'refs/heads/master' into dom-container
Diffstat (limited to 'js')
-rwxr-xr-xjs/data/pi/pi-data.js10
-rwxr-xr-xjs/document/mediators/template.js12
-rwxr-xr-xjs/document/templates/banner/index.html23
-rwxr-xr-xjs/document/templates/html/index.html23
-rwxr-xr-xjs/lib/geom/brush-stroke.js1423
-rw-r--r--js/panels/resize-composer.js5
-rw-r--r--js/tools/BrushTool.js2
7 files changed, 809 insertions, 689 deletions
diff --git a/js/data/pi/pi-data.js b/js/data/pi/pi-data.js
index 157cbc64..92d70141 100755
--- a/js/data/pi/pi-data.js
+++ b/js/data/pi/pi-data.js
@@ -703,13 +703,14 @@ exports.PiData = Montage.create( Montage, {
703 { 703 {
704 type : "color", 704 type : "color",
705 prop: "border", 705 prop: "border",
706 id : "stroke" 706 id : "stroke",
707 visible: false
707 }, 708 },
708 { 709 {
709 type : "color", 710 type : "color",
710 id : "fill", 711 id : "fill",
711 prop: "background", 712 prop: "background",
712 visible : false, 713 visible : true,
713 divider : true 714 divider : true
714 } 715 }
715 ], 716 ],
@@ -761,7 +762,9 @@ exports.PiData = Montage.create( Montage, {
761 valueMutator: parseFloat, 762 valueMutator: parseFloat,
762 min : 0, 763 min : 0,
763 max : 100, 764 max : 100,
764 value : 0 765 value : 0,
766 acceptableUnits: [" "],
767 unit: " "
765 } 768 }
766 ] 769 ]
767 ] 770 ]
@@ -788,6 +791,7 @@ exports.PiData = Montage.create( Montage, {
788 min : -90, 791 min : -90,
789 max : 90, 792 max : 90,
790 value : 0, 793 value : 0,
794 acceptableUnits: ["deg."],
791 unit : "deg." 795 unit : "deg."
792 } 796 }
793 ] 797 ]
diff --git a/js/document/mediators/template.js b/js/document/mediators/template.js
index e04c16d9..50fad1c3 100755
--- a/js/document/mediators/template.js
+++ b/js/document/mediators/template.js
@@ -93,9 +93,11 @@ exports.TemplateDocumentMediator = Montage.create(Component, {
93 hackTag = hackHtml.getElementsByTagName('ninjahtmlhack')[0]; 93 hackTag = hackHtml.getElementsByTagName('ninjahtmlhack')[0];
94 docHtmlTag = doc.getElementsByTagName('html')[0]; 94 docHtmlTag = doc.getElementsByTagName('html')[0];
95 //Looping through the attributes to copy them 95 //Looping through the attributes to copy them
96 for (var m in hackTag.attributes) { 96 if (hackTag) {
97 if (hackTag.attributes[m].value) { 97 for (var m in hackTag.attributes) {
98 docHtmlTag.setAttribute(hackTag.attributes[m].name.replace(/ninjahtmlhack/gi, 'html'), hackTag.attributes[m].value.replace(/ninjahtmlhack/gi, 'html')); 98 if (hackTag.attributes[m].value) {
99 docHtmlTag.setAttribute(hackTag.attributes[m].name.replace(/ninjahtmlhack/gi, 'html'), hackTag.attributes[m].value.replace(/ninjahtmlhack/gi, 'html'));
100 }
99 } 101 }
100 } 102 }
101 //Garbage collection 103 //Garbage collection
@@ -611,8 +613,8 @@ exports.TemplateDocumentMediator = Montage.create(Component, {
611 } else { 613 } else {
612 cleanHTML = template.file.content.document.documentElement.outerHTML.replace(/(\b(?:(?:https?|ftp|file|[A-Za-z]+):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))/gi, parseNinjaRootUrl.bind(this)); 614 cleanHTML = template.file.content.document.documentElement.outerHTML.replace(/(\b(?:(?:https?|ftp|file|[A-Za-z]+):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))/gi, parseNinjaRootUrl.bind(this));
613 } 615 }
614 //TODO: Remove, this is a temp hack 616 //TODO: Remove, this is a temp hack to maintain a doc type on HTML files
615 cleanHTML = '<!DOCTYPE html>\n'+cleanHTML; 617 cleanHTML = '<!DOCTYPE html>'+cleanHTML;
616 // 618 //
617 function parseNinjaRootUrl(url) { 619 function parseNinjaRootUrl(url) {
618 if (url.indexOf(this.application.ninja.coreIoApi.rootUrl) !== -1) { 620 if (url.indexOf(this.application.ninja.coreIoApi.rootUrl) !== -1) {
diff --git a/js/document/templates/banner/index.html b/js/document/templates/banner/index.html
index 08a998e5..626dc0bc 100755
--- a/js/document/templates/banner/index.html
+++ b/js/document/templates/banner/index.html
@@ -71,6 +71,29 @@
71 -webkit-transform-style: preserve-3d; 71 -webkit-transform-style: preserve-3d;
72 -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); 72 -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
73 } 73 }
74
75 ::-webkit-scrollbar { width: 11px; height: 11px; }
76 ::-webkit-scrollbar-button:start:decrement, ::-webkit-scrollbar-button:end:increment { display: none; }
77 ::-webkit-scrollbar-button:vertical:start:increment, body::-webkit-scrollbar-button:vertical:end:decrement { display: none; }
78 ::-webkit-scrollbar-button:horizontal:start:increment, body::-webkit-scrollbar-button:horizontal:end:decrement { display: none; }
79 ::-webkit-scrollbar-track:vertical { background-color: black; }
80 ::-webkit-scrollbar-track:horizontal { background-color: black; }
81 ::-webkit-scrollbar-track-piece:vertical:start { background-color: transparent; }
82 ::-webkit-scrollbar-track-piece:horizontal:start { background-color: transparent; }
83 ::-webkit-scrollbar-track-piece:vertical:end { background-color: transparent; }
84 ::-webkit-scrollbar-track-piece:horizontal:end { background-color: transparent; }
85 ::-webkit-scrollbar-thumb:vertical { border-color: black; border-style: solid; border-width: 2px; -webkit-border-radius: 6px; background: -webkit-gradient(linear, left top, right top, color-stop(0.16, #8c8c8c), color-stop(0.49, #adadad), color-stop(0.82, #8c8c8c)); }
86 ::-webkit-scrollbar-thumb:vertical:hover { border-color: black; border-style: solid; border-width: 2px; -webkit-border-radius: 6px; background: -webkit-gradient(linear, left top, right top, color-stop(0.1, #bebebe), color-stop(0.5, white), color-stop(0.9, #bebebe)); }
87 ::-webkit-scrollbar-thumb:horizontal { border-color: black; border-style: solid; border-width: 2px; -webkit-border-radius: 6px; background: -webkit-gradient(linear, left top, left bottom, color-stop(0.1, #8c8c8c), color-stop(0.5, #adadad), color-stop(0.9, #8c8c8c)); }
88 ::-webkit-scrollbar-thumb:horizontal:hover { border-color: black; border-style: solid; border-width: 2px; -webkit-border-radius: 6px; background: -webkit-gradient(linear, left top, left bottom, color-stop(0.16, #bebebe), color-stop(0.49, white), color-stop(0.82, #bebebe)); }
89 ::-webkit-scrollbar-corner { background-color: black; }
90 ::-webkit-scrollbar-corner:window-inactive { background-color: black; }
91 ::-webkit-scrollbar-track:vertical:disabled { display: block; }
92 ::-webkit-scrollbar-track:horizontal:disabled { display: block; }
93 ::-webkit-scrollbar-track-piece:disabled { display: block; }
94 ::-webkit-scrollbar-corner:disabled { display: block; }
95 ::-webkit-resizer:disabled { display: block; }
96
74 </style> 97 </style>
75 98
76 <script type="text/javascript" data-ninja-template="true"> 99 <script type="text/javascript" data-ninja-template="true">
diff --git a/js/document/templates/html/index.html b/js/document/templates/html/index.html
index c74a7251..8fc0d82f 100755
--- a/js/document/templates/html/index.html
+++ b/js/document/templates/html/index.html
@@ -58,6 +58,29 @@
58 .nj-element-highlight { 58 .nj-element-highlight {
59 outline: 4px solid #ff0000; 59 outline: 4px solid #ff0000;
60 } 60 }
61
62 ::-webkit-scrollbar { width: 11px; height: 11px; }
63 ::-webkit-scrollbar-button:start:decrement, ::-webkit-scrollbar-button:end:increment { display: none; }
64 ::-webkit-scrollbar-button:vertical:start:increment, body::-webkit-scrollbar-button:vertical:end:decrement { display: none; }
65 ::-webkit-scrollbar-button:horizontal:start:increment, body::-webkit-scrollbar-button:horizontal:end:decrement { display: none; }
66 ::-webkit-scrollbar-track:vertical { background-color: black; }
67 ::-webkit-scrollbar-track:horizontal { background-color: black; }
68 ::-webkit-scrollbar-track-piece:vertical:start { background-color: transparent; }
69 ::-webkit-scrollbar-track-piece:horizontal:start { background-color: transparent; }
70 ::-webkit-scrollbar-track-piece:vertical:end { background-color: transparent; }
71 ::-webkit-scrollbar-track-piece:horizontal:end { background-color: transparent; }
72 ::-webkit-scrollbar-thumb:vertical { border-color: black; border-style: solid; border-width: 2px; -webkit-border-radius: 6px; background: -webkit-gradient(linear, left top, right top, color-stop(0.16, #8c8c8c), color-stop(0.49, #adadad), color-stop(0.82, #8c8c8c)); }
73 ::-webkit-scrollbar-thumb:vertical:hover { border-color: black; border-style: solid; border-width: 2px; -webkit-border-radius: 6px; background: -webkit-gradient(linear, left top, right top, color-stop(0.1, #bebebe), color-stop(0.5, white), color-stop(0.9, #bebebe)); }
74 ::-webkit-scrollbar-thumb:horizontal { border-color: black; border-style: solid; border-width: 2px; -webkit-border-radius: 6px; background: -webkit-gradient(linear, left top, left bottom, color-stop(0.1, #8c8c8c), color-stop(0.5, #adadad), color-stop(0.9, #8c8c8c)); }
75 ::-webkit-scrollbar-thumb:horizontal:hover { border-color: black; border-style: solid; border-width: 2px; -webkit-border-radius: 6px; background: -webkit-gradient(linear, left top, left bottom, color-stop(0.16, #bebebe), color-stop(0.49, white), color-stop(0.82, #bebebe)); }
76 ::-webkit-scrollbar-corner { background-color: black; }
77 ::-webkit-scrollbar-corner:window-inactive { background-color: black; }
78 ::-webkit-scrollbar-track:vertical:disabled { display: block; }
79 ::-webkit-scrollbar-track:horizontal:disabled { display: block; }
80 ::-webkit-scrollbar-track-piece:disabled { display: block; }
81 ::-webkit-scrollbar-corner:disabled { display: block; }
82 ::-webkit-resizer:disabled { display: block; }
83
61 </style> 84 </style>
62 85
63 <script type="text/javascript" data-ninja-template="true"> 86 <script type="text/javascript" data-ninja-template="true">
diff --git a/js/lib/geom/brush-stroke.js b/js/lib/geom/brush-stroke.js
index 09a7023c..d9c2ab53 100755
--- a/js/lib/geom/brush-stroke.js
+++ b/js/lib/geom/brush-stroke.js
@@ -45,7 +45,7 @@ var BrushStroke = function GLBrushStroke() {
45 this._strokeAmountSmoothing = 0; 45 this._strokeAmountSmoothing = 0;
46 46
47 // currently, brush does not support a fill region 47 // currently, brush does not support a fill region
48 this.canFill = false; 48 this.canFill = true;
49 49
50 //threshold that tells us whether two samples are too far apart 50 //threshold that tells us whether two samples are too far apart
51 this._MAX_SAMPLE_DISTANCE_THRESHOLD = 5; 51 this._MAX_SAMPLE_DISTANCE_THRESHOLD = 5;
@@ -65,777 +65,840 @@ var BrushStroke = function GLBrushStroke() {
65 this._planeMatInv = null; 65 this._planeMatInv = null;
66 this._planeCenter = null; 66 this._planeCenter = null;
67 this._dragPlane = null; 67 this._dragPlane = null;
68}; //BrushStroke class defition
68 69
69 ///////////////////////////////////////////////////////// 70BrushStroke.prototype = Object.create(GeomObj, {});
70 // Property Accessors/Setters
71 /////////////////////////////////////////////////////////
72 this.setCanvas = function(c) {
73 this._canvas = c;
74 }
75
76 this.setWorld = function (world) {
77 this._world = world;
78 };
79
80 this.getWorld = function () {
81 return this._world;
82 };
83
84 this.geomType = function () {
85 return this.GEOM_TYPE_BRUSH_STROKE;
86 };
87
88 this.setDrawingTool = function (tool) {
89 this._drawingTool = tool;
90 };
91
92 this.getDrawingTool = function () {
93 return this._drawingTool;
94 };
95
96 this.setPlaneMatrix = function(planeMat){
97 this._planeMat = planeMat;
98 };
99
100 this.setPlaneMatrixInverse = function(planeMatInv){
101 this._planeMatInv = planeMatInv;
102 };
103