zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k..@apache.org
Subject zeppelin git commit: Zeppelin 2701 - Set HTML title for notebook page
Date Thu, 20 Jul 2017 03:26:21 GMT
Repository: zeppelin
Updated Branches:
  refs/heads/master 3dd25c24e -> 05870a96c


Zeppelin 2701 - Set HTML title for notebook page

### What is this PR for?

>From https://issues.apache.org/jira/browse/ZEPPELIN-2701, this set a HTML title for notebook
page, very good when you have multiple tabs opened.

### What type of PR is it?
Feature

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-2701

### How should this be tested?
- title is always blank except for notebook page

Author: Thomas Decaux <ebuildy@gmail.com>

Closes #2458 from ebuildy/ZEPPELIN-2701 and squashes the following commits:

0f14d252 [Thomas Decaux] Add default title if note is null
bd0a6bd9 [Thomas Decaux] Fix lint issues, add default title
f124486d [Thomas Decaux] [ZEPPELIN-2701] Use $watch
0d6d7deb [Thomas Decaux] [ZEPPELIN-2701] Use ng-bind for HTML title
b6a5bc14 [Thomas Decaux] Merge branch 'master' of github.com:ebuildy/zeppelin
12b18662 [Thomas Decaux] [ZEPPELIN-2701] add HTML title for notebook


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/05870a96
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/05870a96
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/05870a96

Branch: refs/heads/master
Commit: 05870a96cddd2b1beb7cc35ce15b133e754bad98
Parents: 3dd25c2
Author: Thomas Decaux <ebuildy@gmail.com>
Authored: Sat Jul 15 20:25:22 2017 +0200
Committer: 1ambda <1amb4a@gmail.com>
Committed: Thu Jul 20 12:26:11 2017 +0900

----------------------------------------------------------------------
 zeppelin-web/src/app/app.js                          | 1 +
 zeppelin-web/src/app/notebook/notebook.controller.js | 5 +++++
 zeppelin-web/src/index.html                          | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/05870a96/zeppelin-web/src/app/app.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/app.js b/zeppelin-web/src/app/app.js
index 9878d56..034de2a 100644
--- a/zeppelin-web/src/app/app.js
+++ b/zeppelin-web/src/app/app.js
@@ -203,6 +203,7 @@ function auth () {
 function bootstrapApplication () {
   zeppelinWebApp.run(function ($rootScope, $location) {
     $rootScope.$on('$routeChangeStart', function (event, next, current) {
+      $rootScope.pageTitle = 'Zeppelin'
       if (!$rootScope.ticket && next.$$route && !next.$$route.publicAccess)
{
         $location.path('/')
       }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/05870a96/zeppelin-web/src/app/notebook/notebook.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/notebook.controller.js b/zeppelin-web/src/app/notebook/notebook.controller.js
index 7504807..bc6cb63 100644
--- a/zeppelin-web/src/app/notebook/notebook.controller.js
+++ b/zeppelin-web/src/app/notebook/notebook.controller.js
@@ -62,6 +62,10 @@ function NotebookCtrl ($scope, $route, $routeParams, $location, $rootScope,
   $scope.currentRevision = 'Head'
   $scope.revisionView = isRevisionPath($location.path())
 
+  $scope.$watch('note', function (value) {
+    $rootScope.pageTitle = value ? value.name : 'Zeppelin'
+  }, true)
+
   $scope.$on('setConnectedStatus', function (event, param) {
     if (connectedOnce && param) {
       initNotebook()
@@ -443,6 +447,7 @@ function NotebookCtrl ($scope, $route, $routeParams, $location, $rootScope,
     if ($scope.note.paragraphs && $scope.note.paragraphs[0]) {
       $scope.note.paragraphs[0].focus = true
     }
+
     $rootScope.$broadcast('setLookAndFeel', $scope.note.config.looknfeel)
   }
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/05870a96/zeppelin-web/src/index.html
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/index.html b/zeppelin-web/src/index.html
index 90631eb..97a8600 100644
--- a/zeppelin-web/src/index.html
+++ b/zeppelin-web/src/index.html
@@ -16,7 +16,7 @@ limitations under the License.
   <head>
     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
     <meta charset="utf-8" />
-    <title></title>
+    <title ng-bind="$root.pageTitle">Zeppelin</title>
     <!-- disable caches for all browser -->
     <meta http-equiv="cache-control" content="max-age=0" />
     <meta http-equiv="cache-control" content="no-cache" />


Mime
View raw message