浏览代码

HUE-6347 [presentation] Rename playerMode to Presentation mode

Romain Rigaux 8 年之前
父节点
当前提交
cd87ee279b

+ 2 - 2
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -2697,7 +2697,7 @@ var EditorViewModel = (function() {
 
       self.isEditing(! self.isEditing());
       //self.isFullscreenMode(! self.isFullscreenMode());
-      self.isPlayerMode(! self.isPlayerMode());
+      self.isPresentationMode(! self.isPresentationMode());
 
       if (options.editor_type != 'notebook') {
         self.toggleEditorMode();
@@ -2714,7 +2714,7 @@ var EditorViewModel = (function() {
     self.selectedNotebook = ko.observable();
 
     self.combinedContent = ko.observable();
-    self.isPlayerMode = ko.observable(false);
+    self.isPresentationMode = ko.observable(false);
     //self.isFullscreenMode = ko.observable(false);
     self.successUrl = ko.observable(options.success_url); // Deprecated
     self.isOptimizerEnabled = ko.observable(options.is_optimizer_enabled);

+ 18 - 18
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -197,7 +197,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
   <img class="pull-right" src="${ static('desktop/art/icon_hue_48.png') }"  alt="${ _('Hue logo') }"/>
 </div>
 
-<div class="navbar hue-title-bar" data-bind="visible: ! $root.isPlayerMode()">
+<div class="navbar hue-title-bar" data-bind="visible: ! $root.isPresentationMode()">
   <div class="navbar-inner">
     <div class="container-fluid">
       <div class="pull-right margin-right-10">
@@ -205,7 +205,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
         <div class="btn-group">
           <a class="share-link btn" rel="tooltip" data-placement="bottom" data-bind="click: $root.togglePresentationMode,
             attr: {'data-original-title': '${ _ko("View as a report") } '},
-            css: {'btn-inverse': $root.isPlayerMode(), 'btn': true}">
+            css: {'btn-inverse': $root.isPresentationMode(), 'btn': true}">
             <i class="fa fa-line-chart"></i>
           </a>
 
@@ -372,10 +372,10 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
   </div>
 </div>
 
- <div class="player-toolbar" data-bind="visible: $root.isPlayerMode()" style="display: none;">
-    <div class="pull-right pointer" data-bind="click: function(){ $root.togglePresentationMode();  }">
-      <i class="fa fa-times"></i>
-    </div>
+ <div class="player-toolbar" data-bind="visible: $root.isPresentationMode()" style="display: none;">
+    <a class="hueAnchor collapse-results" href="javascript:void(0)" title="${ _('Exit presentation') }" data-bind="click: function(){ $root.togglePresentationMode(); }">
+      <i class="fa fa-times fa-fw"></i>
+    </a>
 
     <!-- ko if: $root.selectedNotebook() -->
       Title            | buttons
@@ -440,7 +440,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
 
 
 <div data-bind="css: {'main-content': true, 'editor-mode': $root.editorMode()}">
-  <div class="vertical-full container-fluid" data-bind="style: { 'padding-left' : $root.isLeftPanelVisible() || $root.isPlayerMode() ? '0' : '20px' }" >
+  <div class="vertical-full container-fluid" data-bind="style: { 'padding-left' : $root.isLeftPanelVisible() || $root.isPresentationMode() ? '0' : '20px' }" >
     <div class="vertical-full">
       <div class="vertical-full tab-pane row-fluid panel-container" data-bind="css: { active: selectedNotebook() === $data }, template: { name: 'notebook${ suffix }'}">
       </div>
@@ -690,8 +690,8 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
             <!-- ko if: showGrid -->
             <div class="inline-block inactive-action pointer margin-left-10" title="${_('Search the results')}" data-bind="click: function(data, e){ $(e.target).parents('.snippet').find('.resultTable').hueDataTable().fnShowSearch() }"><i class="snippet-icon fa fa-search"></i></div>
             <!-- /ko -->
-            <div class="inline-block inactive-action pointer" title="${_('Expand results')}" rel="tooltip" data-bind="css: { 'margin-left-10': !showGrid()}, visible: !$root.isPlayerMode(), click: function(){ $root.isPlayerMode(true); }"><i class="snippet-icon fa fa-expand"></i></div>
-            <div class="inline-block inactive-action pointer" title="${_('Collapse results')}" rel="tooltip" data-bind="visible: $root.isPlayerMode(), click: function(){ $root.isPlayerMode(false); }"><i class="snippet-icon fa fa-compress"></i></div>
+            <div class="inline-block inactive-action pointer" title="${_('Expand results')}" rel="tooltip" data-bind="css: { 'margin-left-10': !showGrid()}, visible: !$root.isPresentationMode(), click: function(){ $root.isPresentationMode(true); }"><i class="snippet-icon fa fa-expand"></i></div>
+            <div class="inline-block inactive-action pointer" title="${_('Collapse results')}" rel="tooltip" data-bind="visible: $root.isPresentationMode(), click: function(){ $root.isPresentationMode(false); }"><i class="snippet-icon fa fa-compress"></i></div>
           </a>
         </li>
         <!-- /ko -->
@@ -887,7 +887,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
 </script>
 
 <script type="text/html" id="editor-snippet-header${ suffix }">
-  <div class="hover-actions inline pull-right" style="font-size: 15px; position: relative;" data-bind="style: { 'marginRight': $root.isPlayerMode() ? '40px' : '0' }">
+  <div class="hover-actions inline pull-right" style="font-size: 15px; position: relative;" data-bind="style: { 'marginRight': $root.isPresentationMode() ? '40px' : '0' }">
     <!-- ko template: { name: 'query-redacted${ suffix }' } --><!-- /ko -->
     <!-- ko template: { name: 'longer-operation${ suffix }' } --><!-- /ko -->
     <span class="execution-timer" data-bind="visible: type() != 'text' && status() != 'ready' && status() != 'loading', text: result.executionTime().toHHMMSS()" title="${ _('Execution time') }"></span>
@@ -901,7 +901,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
     <a class="inactive-action margin-left-10" href="javascript:void(0)" data-bind="toggle: settingsVisible, visible: hasProperties, css: { 'blue' : settingsVisible }" title="${ _('Settings and properties') }"><i class="fa fa-cog"></i></a>
     <a class="inactive-action margin-left-10 pointer" title="${ _('Show editor shortcuts') }" data-toggle="modal" data-target="#helpModal${ suffix }"><i class="fa fa-question"></i></a>
   </div>
-  <a class="hueAnchor collapse-results" href="javascript:void(0)" title="${ _('Collapse results') }" data-bind="visible: $root.isPlayerMode(), click: function(){ $root.isPlayerMode(false); }" style="display: none;"><i class="fa fa-times fa-fw"></i></a>
+  <a class="hueAnchor collapse-results" href="javascript:void(0)" title="${ _('Collapse results') }" data-bind="visible: $root.isPresentationMode(), click: function(){ $root.isPresentationMode(false); }" style="display: none;"><i class="fa fa-times fa-fw"></i></a>
 </script>
 
 
@@ -1435,7 +1435,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
 
 
 <script type="text/html" id="markdown-snippet-body${ suffix }">
-  <!-- ko ifnot: $root.isPlayerMode() -->
+  <!-- ko ifnot: $root.isPresentationMode() -->
   <div class="row-fluid">
     <div class="span6" data-bind="clickForAceFocus: ace">
       <div class="ace-editor" data-bind="attr: { id: id() }, aceEditor: {
@@ -1448,7 +1448,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
     </div>
   </div>
   <!-- /ko -->
-  <!-- ko if: $root.isPlayerMode() -->
+  <!-- ko if: $root.isPresentationMode() -->
   <div data-bind="html: renderMarkdown(statement_raw(), id())"></div>
   <!-- /ko -->
 </script>
@@ -2026,7 +2026,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
           % if is_embeddable:
           stickToTopPosition: 48 + bannerTopHeight + ${ conf.CUSTOM.BANNER_TOP_HTML.get() and '0' or '2' },
           % else:
-          stickToTopPosition: function() { return vm.isPlayerMode() ? 1 + bannerTopHeight : 76 + bannerTopHeight },
+          stickToTopPosition: function() { return vm.isPresentationMode() ? 1 + bannerTopHeight : 76 + bannerTopHeight },
           % endif
           parentId: 'snippet_' + snippet.id(),
           clonedContainerPosition: 'fixed',
@@ -2101,7 +2101,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
         if (snippetEl.find('.dataTables_wrapper').length > 0 && snippet.showGrid()) {
           window.clearTimeout(resultFollowTimeout);
           resultFollowTimeout = window.setTimeout(function () {
-            var topCoord = vm.isPlayerMode() ? 1 : 73;
+            var topCoord = vm.isPresentationMode() ? 1 : 73;
             var offsetTop = 0;
             if (snippetEl.find('.dataTables_wrapper').length > 0 && snippetEl.find('.dataTables_wrapper').offset()){
               offsetTop = (snippetEl.find('.dataTables_wrapper').offset().top - topCoord) * -1;
@@ -3098,11 +3098,11 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
       var wasRightPanelVisible = viewModel.isRightPanelVisible();
 
       function exitPlayerMode() {
-        //viewModel.isPlayerMode(false);
+        //viewModel.isPresentationMode(false);
         viewModel.togglePresentationMode();
       }
 
-      viewModel.isPlayerMode.subscribe(function (value) {
+      viewModel.isPresentationMode.subscribe(function (value) {
         if (value){
           $(".jHueNotify").remove();
           huePubSub.publish('side.panels.hide');
@@ -3371,7 +3371,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
         var _dtElement;
         if (snippet.showGrid()) {
           _dtElement = $("#snippet_" + snippet.id()).find(".dataTables_wrapper");
-          var topCoord = viewModel.isPlayerMode() ? ${ conf.CUSTOM.BANNER_TOP_HTML.get() and '31' or '1' } : 73;
+          var topCoord = viewModel.isPresentationMode() ? ${ conf.CUSTOM.BANNER_TOP_HTML.get() and '31' or '1' } : 73;
           $("#snippet_" + snippet.id()).find(".snippet-grid-settings").css({
             "height": Math.ceil($(window).height() - Math.max($('.result-settings').length > 0 ? $('.result-settings').offset().top : 0, topCoord)) + 'px'
           });

+ 1 - 1
desktop/libs/notebook/src/notebook/templates/notebooks.mako

@@ -23,7 +23,7 @@
 ${ commonheader(_("Notebooks"), "spark", user, request, "60px") | n,unicode }
 
 
-<div class="navbar hue-title-bar" data-bind="visible: ! $root.isPlayerMode()">
+<div class="navbar hue-title-bar" data-bind="visible: ! $root.isPresentationMode()">
   <div class="navbar-inner">
     <div class="container-fluid">
       <div class="nav-collapse">