diff --git a/src/css/general.css b/src/css/general.css new file mode 100644 index 0000000..6215eae --- /dev/null +++ b/src/css/general.css @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2015 SugarCRM Inc. Licensed by SugarCRM under the Apache 2.0 license. + */ +.general .features .pricing-table { + cursor: pointer; } + .general .features .pricing-table.columns { + padding: 0; } + .general .features .pricing-table .title { + background-color: #282828; + box-shadow: 0 4px 0 #e61718; + font-size: 1.2rem; } + .general .features .pricing-table .description { + margin-top: 4px; + font-size: 1rem; } +.general .features .small-6 { + width: 48%; } + +/*# sourceMappingURL=general.css.map */ diff --git a/src/css/general.css.map b/src/css/general.css.map new file mode 100644 index 0000000..a1fce91 --- /dev/null +++ b/src/css/general.css.map @@ -0,0 +1,7 @@ +{ +"version": 3, +"mappings": "AAAA;;GAEG;AAIC,iCAAe;EACb,MAAM,EAAE,OAAO;EACf,yCAAU;IACR,OAAO,EAAE,CAAC;EAEZ,wCAAM;IACJ,gBAAgB,EAAE,OAAO;IACzB,UAAU,EAAE,eAAe;IAC3B,SAAS,EAAE,MAAM;EAEnB,8CAAa;IACX,UAAU,EAAE,GAAG;IACf,SAAS,EAAE,IAAI;AAGnB,2BAAS;EACP,KAAK,EAAC,GAAG", +"sources": ["../scss/general.scss"], +"names": [], +"file": "general.css" +} diff --git a/src/css/panel.css b/src/css/panel.css index fad7ba8..8836ccc 100644 --- a/src/css/panel.css +++ b/src/css/panel.css @@ -29,6 +29,8 @@ html, body { color: #f2f2f2; } #menu a:hover { background-color: #0e0e0e; } + #menu img#sugar-cube { + height: 22px; } #main { width: inherit; diff --git a/src/css/panel.css.map b/src/css/panel.css.map index 8a1eb3f..7b46805 100644 --- a/src/css/panel.css.map +++ b/src/css/panel.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AAAA;;GAEG;AACH,UAAW;EACT,QAAQ,EAAE,QAAQ;EAClB,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;EACV,KAAK,EAAE,IAAI;EACX,MAAM,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M,EAAE,CAAC;EACT,UAAU,EAAE,MAAM;EAClB,UAAU,EAAE,IAAI;;AAGlB,eAAgB;EACd,KAAK,EAAC,IAAI;EACV,YAAY,EAAE,IAAI;EAClB,WAAW,EAAE,GAAG;;AAGlB,QAAS;EACL,SAAS,EAAE,KAAK;EAChB,WAAW,EAAE,KAAK;;AAGtB,sCAAuC;EACrC,KAAK,EAAE,KAAK;EACZ,UAAU,EAAE,GAAG;;AAGjB,YAAa;EACX,YAAY,EAAE,IAAI;EAClB,kBAAQ;IACN,KAAK,EAAE,OAAO;EAEhB,iBAAO;IACL,KAAK,EAAE,OAAO;;AAIlB,IAAK;EACH,KAAK,EAAE,OAAO;;AAGhB,yBAA0B;EACxB,SAAS,EAAE,GAAG;EACd,WAAW,EAAE,KAAK", "sources": ["../scss/panel.scss"], "names": [], "file": "panel.css" diff --git a/src/html/panel.html b/src/html/panel.html index 1d2df98..da52847 100644 --- a/src/html/panel.html +++ b/src/html/panel.html @@ -9,6 +9,7 @@ + diff --git a/src/js/views/general.js b/src/js/views/general.js index 1b11c3b..fbdbc6b 100644 --- a/src/js/views/general.js +++ b/src/js/views/general.js @@ -11,6 +11,7 @@ template: BDT.templates['general'], events: { + 'click ul[data-menu]': 'selectItem', 'change [name="tooltips"]': 'toggleTooltips', 'change [name="timeout"]': 'updateTimeout' }, @@ -40,6 +41,11 @@ var seconds = parseFloat(this.$(evt.currentTarget).val()); var ms = Math.round(seconds * 1000); BDT.page.eval('updateTimeout', [ms]); + }, + + selectItem: function(evt) { + var itemId = $(evt.currentTarget).data('menu'); + $('nav a[href=' + itemId + ']').click(); } }); diff --git a/src/js/views/navbar.js b/src/js/views/navbar.js index 8a0edc7..11ad593 100644 --- a/src/js/views/navbar.js +++ b/src/js/views/navbar.js @@ -8,11 +8,12 @@ BDT.views.Navbar = Backbone.View.extend({ template: BDT.templates['navbar'], + defaultView: '#general', render: function() { this.$el.empty().append(this.template()); this.$el.attr('tabindex', 0); - this.trigger('select', '#general'); + this.selectItem(); return this; }, @@ -25,8 +26,11 @@ if (isException) { } else { BDT.debugMode = result; - evt.preventDefault(); - var anchor = $(evt.currentTarget); + let anchor = this.$('[href=' + this.defaultView + ']'); + if (evt) { + evt.preventDefault(); + anchor = $(evt.currentTarget); + } anchor.addClass('selected').siblings().removeClass('selected'); this.trigger('select', anchor.attr('href')); } diff --git a/src/scss/general.scss b/src/scss/general.scss new file mode 100644 index 0000000..1928d4e --- /dev/null +++ b/src/scss/general.scss @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2015 SugarCRM Inc. Licensed by SugarCRM under the Apache 2.0 license. + */ + +.general { + .features { + .pricing-table { + cursor: pointer; + &.columns { + padding: 0; + } + .title{ + background-color: #282828; + box-shadow: 0 4px 0 #e61718; + font-size: 1.2rem; + } + .description { + margin-top: 4px; + font-size: 1rem; + } + } + .small-6 { + width:48%; + } + } +} diff --git a/src/scss/panel.scss b/src/scss/panel.scss index cdab7c8..8c506a5 100644 --- a/src/scss/panel.scss +++ b/src/scss/panel.scss @@ -33,6 +33,9 @@ html, body { background-color: #0e0e0e; } } + img#sugar-cube { + height: 22px; + } } #main { diff --git a/src/templates/appstream.handlebars b/src/templates/appstream.handlebars index 7854496..c05c433 100644 --- a/src/templates/appstream.handlebars +++ b/src/templates/appstream.handlebars @@ -9,7 +9,7 @@
{{else}} -
+
Please activate the debug mode by clicking on the Sugar cube in your browser header bar to access to this feature.
{{/if_debugMode}} diff --git a/src/templates/general.handlebars b/src/templates/general.handlebars index 7c10956..272682e 100644 --- a/src/templates/general.handlebars +++ b/src/templates/general.handlebars @@ -1,21 +1,41 @@

Sidecar Debugger Tool

- -
-
-
-

* Requires page reload

- -

Features

-
+
+ + +
+
+ +
+ +
+{{#if_debugMode}} +
+ $view feature activated! Select a DOM element with the default chrome element selector, + the corresponding sidecar component will be set globally in $view variable so you can access it from the console. +
+{{else}} +
+ Please activate the debug mode by clicking on the Sugar cube in your browser header bar to activate the amazing $view feature! +
+{{/if_debugMode}} diff --git a/src/templates/navbar.handlebars b/src/templates/navbar.handlebars index 8fcfeb8..2e9983a 100644 --- a/src/templates/navbar.handlebars +++ b/src/templates/navbar.handlebars @@ -1 +1 @@ -SettingsApplication StreamStructurePerf reportRender timesGenerate records +Application StreamStructurePerf reportRender timesGenerate records diff --git a/src/templates/perf-report.handlebars b/src/templates/perf-report.handlebars index 819ea17..ddea989 100644 --- a/src/templates/perf-report.handlebars +++ b/src/templates/perf-report.handlebars @@ -109,7 +109,7 @@ {{else}} -
+
Please activate the debug mode by clicking on the Sugar cube in your browser header bar to access to this feature.
{{/if_debugMode}} \ No newline at end of file diff --git a/src/templates/structure.handlebars b/src/templates/structure.handlebars index 02d1cec..209ddd3 100644 --- a/src/templates/structure.handlebars +++ b/src/templates/structure.handlebars @@ -12,7 +12,7 @@
{{else}} -
+
Please activate the debug mode by clicking on the Sugar cube in your browser header bar to access to this feature.
{{/if_debugMode}} diff --git a/src/templates/templates.js b/src/templates/templates.js index a2050e2..4561d10 100644 --- a/src/templates/templates.js +++ b/src/templates/templates.js @@ -137,7 +137,7 @@ this["Handlebars"]["templates"]["appstream"] = Handlebars.template({"1":function },"3":function(depth0,helpers,partials,data) { return " \n\n
\n"; },"5":function(depth0,helpers,partials,data) { - return "
\n Please activate the debug mode by clicking on the Sugar cube in your browser header bar to access to this feature.\n
\n"; + return "
\n Please activate the debug mode by clicking on the Sugar cube in your browser header bar to access to this feature.\n
\n"; },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { var stack1, helper, options, buffer = "

Application Stream

\n\n
= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - return "

Sidecar Debugger Tool

\n\n
\n
\n
\n

* Requires page reload

\n\n

Features

\n\n\n"; +this["Handlebars"]["templates"]["general"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { + return "
\n $view feature activated! Select a DOM element with the default chrome element selector,\n the corresponding sidecar component will be set globally in $view variable so you can access it from the console.\n
\n"; +},"3":function(depth0,helpers,partials,data) { + return "
\n Please activate the debug mode by clicking on the Sugar cube in your browser header bar to activate the amazing $view feature!\n
\n"; +},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { + var stack1, helper, options, buffer = + "

Sidecar Debugger Tool

\n
\n
\n
\n
    \n
  • Application Stream
  • \n
  • A timeline of what is happening in the app. It shows the methods that are called and the events that are triggered. For each of them, you have access to the passed arguments and the component object.
  • \n
\n
    \n
  • Performance reports
  • \n
  • A table showing the render times and the number of renders of the components on the page
  • \n
\n
\n
\n
    \n
  • Structure
  • \n
  • A hierarchical tree representing the Sugar components of the current page.
  • \n
\n
    \n
  • Generate records
  • \n
  • Generate Sugar records in the one click!
  • \n
\n
\n
\n
    \n
  • Render times
  • \n
  • Measure the render duration of the different fields to detect performance drops.
  • \n
\n
\n
\n
\n"; + stack1 = ((helper = (helper = helpers.if_debugMode || (depth0 != null ? depth0.if_debugMode : depth0)) != null ? helper : helpers.helperMissing),(options={"name":"if_debugMode","hash":{},"fn":this.program(1, data, 0),"inverse":this.program(3, data, 0),"data":data}),(typeof helper === "function" ? helper.call(depth0,options) : helper)); + if (!helpers.if_debugMode) { stack1 = helpers.blockHelperMissing.call(depth0,stack1,options)} + if (stack1 != null) { buffer += stack1; } + return buffer; },"useData":true}); this["Handlebars"]["templates"]["generate"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { @@ -264,7 +273,7 @@ this["Handlebars"]["templates"]["metrics"] = Handlebars.template({"1":function(d },"useData":true}); this["Handlebars"]["templates"]["navbar"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - return "SettingsApplication StreamStructurePerf reportRender timesGenerate records\n"; + return "Application StreamStructurePerf reportRender timesGenerate records\n"; },"useData":true}); this["Handlebars"]["templates"]["perf-report"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { @@ -294,7 +303,7 @@ this["Handlebars"]["templates"]["perf-report"] = Handlebars.template({"1":functi + alias3(((helper = (helper = helpers.renderCount || (depth0 != null ? depth0.renderCount : depth0)) != null ? helper : alias1),(typeof helper === alias2 ? helper.call(depth0,{"name":"renderCount","hash":{},"data":data}) : helper))) + "\n \n"; },"6":function(depth0,helpers,partials,data) { - return "
\n Please activate the debug mode by clicking on the Sugar cube in your browser header bar to access to this feature.\n
\n"; + return "
\n Please activate the debug mode by clicking on the Sugar cube in your browser header bar to access to this feature.\n
\n"; },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data,blockParams,depths) { var stack1, helper, options, buffer = "

Performance report

\n\n
\n
\n
    \n
\n
\n
\n"; },"5":function(depth0,helpers,partials,data) { - return "
\n Please activate the debug mode by clicking on the Sugar cube in your browser header bar to access to this feature.\n
\n"; + return "
\n Please activate the debug mode by clicking on the Sugar cube in your browser header bar to access to this feature.\n
\n"; },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { var stack1, helper, options, buffer = "

Page structure

\n\n