You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by an...@apache.org on 2015/06/05 05:14:56 UTC

incubator-ignite git commit: # ignite-843 WIP mixin.

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-843 6a9b8823d -> 7294632d6


# ignite-843 WIP mixin.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7294632d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7294632d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7294632d

Branch: refs/heads/ignite-843
Commit: 7294632d6165edbd238f22c988659ae9b1d16bad
Parents: 6a9b882
Author: Andrey <an...@gridgain.com>
Authored: Fri Jun 5 10:15:14 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Fri Jun 5 10:15:14 2015 +0700

----------------------------------------------------------------------
 .../public/javascripts/controllers/common.js    |  8 +++++
 .../nodejs/public/stylesheets/style.less        |  1 +
 modules/webconfig/nodejs/views/caches.jade      | 24 +++-----------
 .../nodejs/views/includes/controls.jade         | 34 ++++++++++++++++++++
 4 files changed, 48 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7294632d/modules/webconfig/nodejs/public/javascripts/controllers/common.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/public/javascripts/controllers/common.js b/modules/webconfig/nodejs/public/javascripts/controllers/common.js
index cead98f..d940078 100644
--- a/modules/webconfig/nodejs/public/javascripts/controllers/common.js
+++ b/modules/webconfig/nodejs/public/javascripts/controllers/common.js
@@ -17,6 +17,14 @@
 
 var configuratorModule =  angular.module('ignite-web-configurator', ['smart-table', 'mgcrea.ngStrap', 'ngSanitize']);
 
+configuratorModule.config(function($tooltipProvider) {
+    angular.extend($tooltipProvider.defaults, {
+        placement: 'right',
+        html: 'true',
+        trigger: 'click hover'
+    });
+});
+
 configuratorModule.config(function($selectProvider) {
     angular.extend($selectProvider.defaults, {
         allText: 'Select All',

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7294632d/modules/webconfig/nodejs/public/stylesheets/style.less
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/public/stylesheets/style.less b/modules/webconfig/nodejs/public/stylesheets/style.less
index b40c4c2..b1b4b21 100644
--- a/modules/webconfig/nodejs/public/stylesheets/style.less
+++ b/modules/webconfig/nodejs/public/stylesheets/style.less
@@ -998,5 +998,6 @@ label {
 }
 
 .tip {
+  &:extend(.fa, .fa-question-circle);
   margin-left: 5px;
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7294632d/modules/webconfig/nodejs/views/caches.jade
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/views/caches.jade b/modules/webconfig/nodejs/views/caches.jade
index 132dd1a..9784cf3 100644
--- a/modules/webconfig/nodejs/views/caches.jade
+++ b/modules/webconfig/nodejs/views/caches.jade
@@ -19,8 +19,7 @@ extends layout-sidebar
 append scripts
     script(src='/javascripts/controllers/caches.js')
 
-mixin tip(title)
-    i.tip.fa.fa-question-circle(bs-tooltip ng-if='field.tip' type='button' data-placement='right' data-trigger='click' data-title='{{field.tip.join("")}}' data-html='true')
+include includes/controls
 
 block content
     .docs-header
@@ -43,28 +42,15 @@ block content
         form.form-horizontal(name='editForm' ng-if='backupItem')
             h3 General
             .settings-row(ng-repeat='field in general')
-                label.col-sm-2 {{field.label}}:
-                .col-sm-3(ng-switch on='field.type')
-                    div(ng-switch-when='text')
-                        input.form-control(type='text' ng-model='backupItem[field.model]' placeholder='{{field.placeholder}}')
-                    div(ng-switch-when='dropdown')
-                        button.form-control(bs-select ng-model='backupItem[field.model]' data-template='/select' data-placeholder='{{field.placeholder}}' bs-options='item.value as item.label for item in {{field.items}}')
-                i.tip.fa.fa-question-circle(bs-tooltip ng-if='field.tip' type='button' data-placement='right' data-trigger='hover' data-title='{{field.tip.join("")}}' data-html='true')
+                div(ng-switch on='field.type')
+                    +form-row
             .panel(bs-collapse data-start-collapsed='true')
                 .panel-collapse(bs-collapse-target)
                     div(ng-repeat='group in advanced')
                         h3 {{group.label}}
                         .settings-row(ng-repeat='field in group.fields')
-                            div(ng-if='field.type != "check"')
-                                label.col-sm-2 {{field.label}}:
-                                .col-sm-3
-                                    input.form-control(ng-if='field.type == "text"' type='text' ng-model='backupItem[field.model]' placeholder='{{field.placeholder}}')
-                                    button.form-control(ng-if='field.type == "dropdown"' bs-select ng-model='backupItem[field.model]' data-template='/select' data-placeholder='{{field.placeholder}}' bs-options='item.value as item.label for item in {{field.items}}')
-                                +tip
-                            div(ng-if='field.type == "check"')
-                                input(type='checkbox' ng-model='backupItem[field.model]')
-                                label(ng-click='backupItem[field.model] = !backupItem[field.model]') {{field.label}}
-                                +tip
+                            div(ng-switch on='field.type')
+                                +form-row
                 .panel-heading
                     .panel-title
                         span(bs-collapse-toggle)

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7294632d/modules/webconfig/nodejs/views/includes/controls.jade
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/views/includes/controls.jade b/modules/webconfig/nodejs/views/includes/controls.jade
new file mode 100644
index 0000000..f24f70d
--- /dev/null
+++ b/modules/webconfig/nodejs/views/includes/controls.jade
@@ -0,0 +1,34 @@
+//-
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+mixin tip
+    i.tip.fa.fa-question-circle(ng-if='field.tip' bs-tooltip='field.tip.join("")' type='button')
+
+mixin form-row
+    div(ng-switch-when='check')
+        input(type='checkbox' ng-model='backupItem[field.model]')
+        label(ng-click='backupItem[field.model] = !backupItem[field.model]') {{field.label}}
+        +tip
+    div(ng-switch-when='text')
+        label.col-sm-2 {{field.label}}:
+        .col-sm-3
+            input.form-control(type='text' ng-model='backupItem[field.model]' placeholder='{{field.placeholder}}')
+        +tip
+    div(ng-switch-when='dropdown')
+        label.col-sm-2 {{field.label}}:
+        .col-sm-3
+            button.form-control(bs-select ng-model='backupItem[field.model]' data-template='/select' data-placeholder='{{field.placeholder}}' bs-options='item.value as item.label for item in {{field.items}}')
+        +tip
\ No newline at end of file