http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/field/form-control-feedback.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/field/form-control-feedback.directive.js b/modules/web-console/src/main/js/app/modules/form/field/form-control-feedback.directive.js deleted file mode 100644 index 058bcc3..0000000 --- a/modules/web-console/src/main/js/app/modules/form/field/form-control-feedback.directive.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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. - */ - -export default ['formControlFeedback', [() => { - const link = ($scope, $element, $attrs, [form]) => { - let name = $scope.name; - - if (_.isNil(name)) - name = $attrs.name; - - const err = $attrs.igniteError; - const msg = $attrs.igniteErrorMessage; - - if (name && err && msg) { - form.$errorMessages = form.$errorMessages || {}; - form.$errorMessages[name] = form.$errorMessages[name] || {}; - form.$errorMessages[name][err] = msg; - } - }; - - return { - restrict: 'C', - link, - require: ['^form'] - }; -}]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/field/input/autofocus.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/field/input/autofocus.directive.js b/modules/web-console/src/main/js/app/modules/form/field/input/autofocus.directive.js deleted file mode 100644 index c963cc1..0000000 --- a/modules/web-console/src/main/js/app/modules/form/field/input/autofocus.directive.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -export default ['igniteFormFieldInputAutofocus', [() => { - const link = (scope, el, attrs) => { - if (_.isUndefined(attrs.igniteFormFieldInputAutofocus) || attrs.igniteFormFieldInputAutofocus !== 'true') - return; - - el.focus(); - }; - - return { - restrict: 'A', - link - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/field/input/checkbox.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/field/input/checkbox.directive.js b/modules/web-console/src/main/js/app/modules/form/field/input/checkbox.directive.js deleted file mode 100644 index 3d84b4e..0000000 --- a/modules/web-console/src/main/js/app/modules/form/field/input/checkbox.directive.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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. - */ - -import templateUrl from './checkbox.jade'; - -export default ['igniteFormFieldInputCheckbox', ['IgniteFormGUID', 'IgniteLegacyTable', (guid, LegacyTable) => { - const link = (scope, el, attrs, [form, label]) => { - const {id, name} = scope; - const field = form[name]; - - scope.field = field; - label.for = scope.id = id || guid(); - - label.type = 'internal'; - - form.$defaults = form.$defaults || {}; - form.$defaults[name] = _.cloneDeep(scope.value); - - const setAsDefault = () => { - if (!form.$pristine) return; - - form.$defaults = form.$defaults || {}; - form.$defaults[name] = _.cloneDeep(scope.value); - }; - - scope.$watch(() => form.$pristine, setAsDefault); - scope.$watch('value', setAsDefault); - - scope.tableReset = () => { - LegacyTable.tableSaveAndReset(); - }; - }; - - return { - restrict: 'E', - scope: { - id: '@', - name: '@', - required: '=ngRequired', - disabled: '=ngDisabled', - - focus: '=ngFocus', - - value: '=ngModel' - }, - link, - templateUrl, - replace: true, - transclude: true, - require: ['^form', '?^igniteFormField'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/field/input/checkbox.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/field/input/checkbox.jade b/modules/web-console/src/main/js/app/modules/form/field/input/checkbox.jade deleted file mode 100644 index 477d4b2..0000000 --- a/modules/web-console/src/main/js/app/modules/form/field/input/checkbox.jade +++ /dev/null @@ -1,30 +0,0 @@ -//- - 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. - -.input-tip - input( - id='{{ id }}' - name='{{ name }}' - type='checkbox' - - data-ng-model='value' - data-ng-required='required || false' - data-ng-disabled='disabled || false' - - data-ng-focus='tableReset()' - ) - - span(ng-transclude='') http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/field/input/datalist.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/field/input/datalist.directive.js b/modules/web-console/src/main/js/app/modules/form/field/input/datalist.directive.js deleted file mode 100644 index 6c43a2a..0000000 --- a/modules/web-console/src/main/js/app/modules/form/field/input/datalist.directive.js +++ /dev/null @@ -1,122 +0,0 @@ -/* - * 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. - */ - -import templateUrl from './datalist.jade'; - -export default ['igniteFormFieldInputDatalist', ['IgniteFormGUID', 'IgniteLegacyTable', (guid, LegacyTable) => { - const link = (scope, element, attrs, [ngModel, form, label], transclude) => { - const {id, ngModelName} = scope; - - const name = ngModelName; - - scope.id = id || guid(); - scope.form = form; - scope.name = ngModelName + 'TextInput'; - scope.ngModel = ngModel; - - Object.defineProperty(scope, 'field', { - get: () => scope.form[scope.name] - }); - - if (label) { - label.for = scope.id; - - scope.label = label; - - scope.$watch('required', (required) => { - label.required = required || false; - }); - } - - form.$defaults = form.$defaults || {}; - - if (form.$pristine) { - if (!(_.isNull(form.$defaults[name]) || _.isUndefined(form.$defaults[name]))) { - scope.value = form.$defaults[name]; - ngModel.$setViewValue(scope.value); - } else - form.$defaults[name] = _.cloneDeep(scope.value); - } - - const setAsDefault = () => { - if (!form.$pristine) return; - - form.$defaults = form.$defaults || {}; - form.$defaults[name] = _.cloneDeep(scope.value); - }; - - scope.$watch(() => form.$pristine, setAsDefault); - scope.$watch('value', setAsDefault); - - const checkValid = () => { - const input = element.find('input'); - - const invalid = ngModel.$invalid || (input[0].required && !input[0].value); - - input.removeClass(invalid ? 'ng-valid' : 'ng-invalid'); - input.addClass(invalid ? 'ng-invalid' : 'ng-valid'); - }; - - scope.ngChange = () => { - ngModel.$setViewValue(scope.value); - - if (_.isEqual(scope.value, form.$defaults[name])) - ngModel.$setPristine(); - else - ngModel.$setDirty(); - - setTimeout(checkValid, 100); // Use setTimeout() workaround of problem of two controllers. - }; - - ngModel.$render = () => { - scope.value = ngModel.$modelValue; - }; - - scope.tableReset = () => { - LegacyTable.tableSaveAndReset(); - }; - - transclude(scope.$parent, function(clone, tscope) { - tscope.form = form; - tscope.ngModelName = ngModelName; - - element.find('.transclude-here').append(clone); - }); - }; - - return { - restrict: 'E', - scope: { - id: '@', - ngModelName: '@name', - placeholder: '@', - required: '=ngRequired', - disabled: '=ngDisabled', - ngBlur: '&', - - options: '=', - - focus: '=ngFocus', - autofocus: '=igniteFormFieldInputAutofocus' - }, - link, - templateUrl, - replace: true, - transclude: true, - require: ['ngModel', '^form', '?^igniteFormField'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/field/input/datalist.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/field/input/datalist.jade b/modules/web-console/src/main/js/app/modules/form/field/input/datalist.jade deleted file mode 100644 index 7ae1411..0000000 --- a/modules/web-console/src/main/js/app/modules/form/field/input/datalist.jade +++ /dev/null @@ -1,51 +0,0 @@ -//- - 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 feedback(isCheckPristine, error, errorMessage) - -var checkPristine = isCheckPristine ? '!field.$pristine && ' : '' - - i.fa.fa-exclamation-triangle.form-control-feedback( - ng-if='#{checkPristine}field.$error.#{error}' - bs-tooltip='"#{errorMessage}"' - ignite-error=error - ignite-error-message=errorMessage - ) - -.input-tip - input.form-control( - id='{{ id }}' - name='{{ name }}' - placeholder='{{ placeholder }}' - - data-ng-model='value' - - data-ng-blur='ngBlur()' - data-ng-change='ngChange()' - data-ng-required='required || false' - data-ng-disabled='disabled || false' - - data-ignite-form-field-input-autofocus='{{autofocus}}' - - bs-typeahead - bs-options='item for item in options' - container='body' - data-min-length='1' - ignite-retain-selection - ) - - +feedback(true, 'required', '{{ label.name }} could not be empty!') - - span.transclude-here http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/field/input/number.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/field/input/number.directive.js b/modules/web-console/src/main/js/app/modules/form/field/input/number.directive.js deleted file mode 100644 index 0d21f5b..0000000 --- a/modules/web-console/src/main/js/app/modules/form/field/input/number.directive.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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. - */ - -import templateUrl from './number.jade'; - -export default ['igniteFormFieldInputNumber', ['IgniteFormGUID', 'IgniteLegacyTable', (guid, LegacyTable) => { - const link = (scope, el, attrs, [form, label]) => { - const {id, name} = scope; - const field = form[name]; - - scope.id = id || guid(); - scope.field = field; - - if (label) { - label.for = scope.id; - - scope.$watch('required', (required) => { - label.required = required || false; - }); - } - - form.$defaults = form.$defaults || {}; - form.$defaults[name] = _.cloneDeep(scope.value); - - const setAsDefault = () => { - if (!form.$pristine) return; - - form.$defaults = form.$defaults || {}; - form.$defaults[name] = _.cloneDeep(scope.value); - }; - - scope.$watch(() => form.$pristine, setAsDefault); - scope.$watch('value', setAsDefault); - - scope.tableReset = () => { - LegacyTable.tableSaveAndReset(); - }; - }; - - return { - restrict: 'E', - scope: { - id: '@', - name: '@', - placeholder: '@', - required: '=ngRequired', - disabled: '=ngDisabled', - - focus: '=ngFocus', - - min: '@', - max: '@', - step: '@', - value: '=ngModel' - }, - link, - templateUrl, - replace: true, - transclude: true, - require: ['^form', '?^igniteFormField'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/field/input/number.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/field/input/number.jade b/modules/web-console/src/main/js/app/modules/form/field/input/number.jade deleted file mode 100644 index e72a1d0..0000000 --- a/modules/web-console/src/main/js/app/modules/form/field/input/number.jade +++ /dev/null @@ -1,50 +0,0 @@ -//- - 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 feedback(isCheckPristine, error, errorMessage) - -var checkPristine = isCheckPristine ? '!field.$pristine && ' : '' - - i.fa.fa-exclamation-triangle.form-control-feedback( - ng-if='#{checkPristine}field.$error.#{error}' - bs-tooltip='"#{errorMessage}"' - ignite-error=error - ignite-error-message=errorMessage - ) - -.input-tip - input.form-control( - id='{{ id }}' - name='{{ name }}' - placeholder='{{ placeholder }}' - type='number' - min='{{ min || 0 }}' - max='{{ max || Number.MAX_VALUE }}' - step='{{ step || 1 }}' - - data-ng-model='value' - - data-ng-required='required || false' - data-ng-disabled='disabled || false' - - data-ng-focus='tableReset()' - ) - - +feedback(true, 'required', 'This field could not be empty') - +feedback(false, 'min', 'Value is less than allowable minimum: {{ min || 0 }}') - +feedback(false, 'max', 'Value is more than allowable maximum: {{ max }}') - +feedback(false, 'number', 'Only numbers allowed') - - span(ng-transclude='') http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/field/input/text.css ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/field/input/text.css b/modules/web-console/src/main/js/app/modules/form/field/input/text.css deleted file mode 100644 index c76bebd..0000000 --- a/modules/web-console/src/main/js/app/modules/form/field/input/text.css +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -.checkbox label .input-tip { - position: initial; -} - -.input-tip .fa-floppy-o { - position: absolute; - top: 0; - right: 0; - z-index: 2; - - width: 34px; - height: 34px; - - text-align: center; - - display: inline-block; - line-height: 28px; - pointer-events: initial; -} - -.input-tip .form-control-feedback { - height: auto; -} - http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/field/input/text.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/field/input/text.directive.js b/modules/web-console/src/main/js/app/modules/form/field/input/text.directive.js deleted file mode 100644 index 56c02b5..0000000 --- a/modules/web-console/src/main/js/app/modules/form/field/input/text.directive.js +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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. - */ - -import templateUrl from './text.jade'; -import './text.css'; - -export default ['igniteFormFieldInputText', ['IgniteFormGUID', 'IgniteLegacyTable', (guid, LegacyTable) => { - const link = (scope, element, attrs, [ngModel, form, label], transclude) => { - const {id, ngModelName} = scope; - - const name = ngModelName; - - scope.id = id || guid(); - scope.form = form; - scope.name = ngModelName + 'TextInput'; - scope.ngModel = ngModel; - - Object.defineProperty(scope, 'field', { - get: () => scope.form[scope.name] - }); - - if (label) { - label.for = scope.id; - - scope.label = label; - scope.labelName = label.name; - - scope.$watch('required', (required) => { - label.required = required || false; - }); - } - else - scope.labelName = attrs.igniteLabelName || 'Value'; - - form.$defaults = form.$defaults || {}; - - if (form.$pristine) { - if (!(_.isNull(form.$defaults[name]) || _.isUndefined(form.$defaults[name]))) { - scope.value = form.$defaults[name]; - ngModel.$setViewValue(scope.value); - } else - form.$defaults[name] = _.cloneDeep(scope.value); - } - - const setAsDefault = () => { - if (!form.$pristine) return; - - form.$defaults = form.$defaults || {}; - form.$defaults[name] = _.cloneDeep(scope.value); - }; - - scope.$watch(() => form.$pristine, setAsDefault); - scope.$watch('value', setAsDefault); - - const checkValid = () => { - const input = element.find('input'); - - const invalid = ngModel.$invalid || (input[0].required && !input[0].value); - - input.removeClass(invalid ? 'ng-valid' : 'ng-invalid'); - input.addClass(invalid ? 'ng-invalid' : 'ng-valid'); - }; - - scope.ngChange = () => { - ngModel.$setViewValue(scope.value); - - if (_.isEqual(scope.value, form.$defaults[name])) - ngModel.$setPristine(); - else - ngModel.$setDirty(); - - setTimeout(checkValid, 100); // Use setTimeout() workaround of problem of two controllers. - }; - - ngModel.$render = () => { - scope.value = ngModel.$modelValue; - }; - - scope.tableReset = () => { - LegacyTable.tableSaveAndReset(); - }; - - transclude(scope.$parent, function(clone, tscope) { - tscope.form = form; - tscope.ngModelName = ngModelName; - - element.find('.transclude-here').append(clone); - }); - }; - - return { - restrict: 'E', - scope: { - id: '@', - ngModelName: '@name', - placeholder: '@', - required: '=ngRequired', - disabled: '=ngDisabled', - - focus: '=ngFocus', - - ngBlur: '&', - - autofocus: '=igniteFormFieldInputAutofocus' - }, - link, - templateUrl, - replace: true, - transclude: true, - require: ['ngModel', '^form', '?^igniteFormField'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/field/input/text.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/field/input/text.jade b/modules/web-console/src/main/js/app/modules/form/field/input/text.jade deleted file mode 100644 index 8a1dfc2..0000000 --- a/modules/web-console/src/main/js/app/modules/form/field/input/text.jade +++ /dev/null @@ -1,48 +0,0 @@ -//- - 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 feedback(isCheckPristine, error, errorMessage) - -var checkPristine = isCheckPristine ? '!field.$pristine && ' : '' - - i.fa.fa-exclamation-triangle.form-control-feedback( - ng-if='#{checkPristine}field.$error.#{error}' - bs-tooltip='"#{errorMessage}"' - ignite-error=error - ignite-error-message=errorMessage - ) - -.input-tip - input.form-control( - id='{{ id }}' - name='{{ name }}' - placeholder='{{ placeholder }}' - type='text' - - data-ng-model='value' - - data-ng-blur='ngBlur()' - data-ng-change='ngChange()' - data-ng-required='required || false' - data-ng-disabled='disabled || false' - - data-ignite-form-field-input-autofocus='{{autofocus}}' - - data-ng-focus='tableReset()' - ) - - +feedback(true, 'required', '{{ labelName }} could not be empty!') - - span.transclude-here http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/field/label.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/field/label.directive.js b/modules/web-console/src/main/js/app/modules/form/field/label.directive.js deleted file mode 100644 index 9b812d7..0000000 --- a/modules/web-console/src/main/js/app/modules/form/field/label.directive.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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. - */ - -export default ['igniteFormFieldLabel', [() => { - return { - restrict: 'E', - compile() { - return { - post($scope, $element, $attrs, [form, field], $transclude) { - $transclude($scope, function(clone) { - const text = clone.text(); - - if (/(.*):$/.test(text)) - field.name = /(.*):$/.exec(text)[1]; - - const $label = $element.parent().parent().find('label'); - - if ($element[0].id) { - const id = $element[0].id; - - $label[0].id = id.indexOf('+') >= 0 ? $scope.$eval(id) : id; - } - - $label.append(clone); - }); - } - }; - }, - replace: true, - transclude: true, - require: ['^form', '?^igniteFormField'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/field/tooltip.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/field/tooltip.directive.js b/modules/web-console/src/main/js/app/modules/form/field/tooltip.directive.js deleted file mode 100644 index 5005280..0000000 --- a/modules/web-console/src/main/js/app/modules/form/field/tooltip.directive.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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. - */ - -const template = '<i class="tipField fa fa-question-circle"></i>'; - -export default ['igniteFormFieldTooltip', ['$tooltip', ($tooltip) => { - const link = ($scope, $element, $attrs, [form, field], $transclude) => { - const content = Array.prototype.slice - .apply($transclude($scope)) - .reduce((html, el) => html += el.outerHTML || el.textContent || el, ''); - - $tooltip($element, { title: content }); - - if (field) - $element.attr('id', field.for + 'Tooltip'); - - // TODO cleanup css styles. - if ($element.hasClass('tipLabel')) - $element.removeClass('tipField'); - - if ($element.parent('label').length) - $element.addClass('tipLabel').removeClass('tipField'); - }; - - return { - priority: 1, - restrict: 'E', - scope: {}, - template, - link, - replace: true, - transclude: true, - require: ['^form', '?^igniteFormField'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/field/up.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/field/up.directive.js b/modules/web-console/src/main/js/app/modules/form/field/up.directive.js deleted file mode 100644 index d31bdc5..0000000 --- a/modules/web-console/src/main/js/app/modules/form/field/up.directive.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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. - */ - -const template = '<i class="tipField fa fa-arrow-up ng-scope" ng-click="up()"></i>'; - -export default ['igniteFormFieldUp', ['$tooltip', ($tooltip) => { - const link = (scope, $element) => { - $tooltip($element, { title: 'Move item up' }); - - scope.up = () => { - const idx = scope.models.indexOf(scope.model); - - scope.models.splice(idx, 1); - scope.models.splice(idx - 1, 0, scope.model); - }; - }; - - return { - restrict: 'E', - scope: { - model: '=ngModel', - models: '=models' - }, - template, - link, - replace: true, - transclude: true, - require: '^form' - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/form.module.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/form.module.js b/modules/web-console/src/main/js/app/modules/form/form.module.js deleted file mode 100644 index 57a92fa..0000000 --- a/modules/web-console/src/main/js/app/modules/form/form.module.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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. - */ - -import angular from 'angular'; - -// Panel. -import igniteFormPanel from './panel/panel.directive'; -import igniteFormPanelChevron from './panel/chevron.directive'; -import igniteFormRevert from './panel/revert.directive'; - -// Field. -import igniteFormField from './field/field.directive'; -import igniteFormFieldLabel from './field/label.directive'; -import igniteFormFieldTooltip from './field/tooltip.directive'; -import igniteFormFieldDropdown from './field/dropdown.directive'; -import igniteFormFieldInputNumber from './field/input/number.directive'; -import igniteFormFieldInputText from './field/input/text.directive'; -import igniteFormFieldInputCheckbox from './field/input/checkbox.directive'; -import igniteFormFieldInputDatalist from './field/input/datalist.directive'; - -import placeholder from './field/bs-select-placeholder.directive'; - -// Group. -import igniteFormGroup from './group/group.directive'; -import igniteFormGroupAdd from './group/add.directive'; -import igniteFormGroupTooltip from './group/tooltip.directive'; - -// Validators. -import ipaddress from './validator/ipaddress.directive'; -import javaKeywords from './validator/java-keywords.directive'; -import javaPackageSpecified from './validator/java-package-specified.directive'; -import javaBuiltInClass from './validator/java-built-in-class.directive'; -import javaIdentifier from './validator/java-identifier.directive'; -import javaPackageName from './validator/java-package-name.directive'; -import propertyValueSpecified from './validator/property-value-specified.directive'; -import propertyUnique from './validator/property-unique.directive'; -import unique from './validator/unique.directive'; - -// Helpers. -import igniteFormFieldInputAutofocus from './field/input/autofocus.directive'; -import igniteFormFieldUp from './field/up.directive'; -import igniteFormFieldDown from './field/down.directive'; -import igniteFormControlFeedback from './field/form-control-feedback.directive'; - -angular -.module('ignite-console.Form', [ - -]) -// Panel. -.directive(...igniteFormPanel) -.directive(...igniteFormPanelChevron) -.directive(...igniteFormRevert) -// Field. -.directive(...igniteFormField) -.directive(...igniteFormFieldLabel) -.directive(...igniteFormFieldTooltip) -.directive(...igniteFormFieldDropdown) -.directive(...igniteFormFieldInputNumber) -.directive(...igniteFormFieldInputText) -.directive(...igniteFormFieldInputCheckbox) -.directive(...igniteFormFieldInputDatalist) -.directive(...placeholder) -// Group. -.directive(...igniteFormGroup) -.directive(...igniteFormGroupAdd) -.directive(...igniteFormGroupTooltip) -// Validators. -.directive(...ipaddress) -.directive(...javaKeywords) -.directive(...javaPackageSpecified) -.directive(...javaBuiltInClass) -.directive(...javaIdentifier) -.directive(...javaPackageName) -.directive(...propertyValueSpecified) -.directive(...propertyUnique) -.directive(...unique) -// Helpers. -.directive(...igniteFormFieldInputAutofocus) -.directive(...igniteFormFieldUp) -.directive(...igniteFormFieldDown) -.directive(...igniteFormControlFeedback) -// Generator of globally unique identifier. -.factory('IgniteFormGUID', [() => { - let guid = 0; - - return () => `form-field-${guid++}`; -}]); http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/group/add.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/group/add.directive.js b/modules/web-console/src/main/js/app/modules/form/group/add.directive.js deleted file mode 100644 index 98560b5..0000000 --- a/modules/web-console/src/main/js/app/modules/form/group/add.directive.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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. - */ - -const template = '<i class="group-legend-btn fa fa-plus"></i>'; - -export default ['igniteFormGroupAdd', ['$tooltip', ($tooltip) => { - const link = ($scope, $element, $attrs, $ctrls, $transclude) => { - const content = Array.prototype.slice - .apply($transclude($scope)) - .reduce((html, el) => html += el.outerHTML || el.textContent || el, ''); - - $tooltip($element, { title: content }); - - $element.closest('.group').find('.group-legend').append($element); - }; - - return { - restrict: 'E', - scope: {}, - template, - link, - replace: true, - transclude: true, - require: ['^form', '^igniteFormGroup'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/group/group.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/group/group.directive.js b/modules/web-console/src/main/js/app/modules/form/group/group.directive.js deleted file mode 100644 index 20cad22..0000000 --- a/modules/web-console/src/main/js/app/modules/form/group/group.directive.js +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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. - */ - -import templateUrl from './group.jade'; - -export default ['igniteFormGroup', [() => { - const controller = [function() { }]; - - const link = (scope, el, attrs, [ngModelCtrl, ownFormCtrl, parentFormCtrl]) => { - if (!ownFormCtrl) - return; - - const name = attrs.ngForm; - ngModelCtrl.$name = name; - - parentFormCtrl.$addControl(ngModelCtrl); - parentFormCtrl.$removeControl(ownFormCtrl); - - scope.ngModel = scope.ngModel || []; - parentFormCtrl.$defaults = parentFormCtrl.$defaults || {}; - - if (parentFormCtrl.$pristine) { - if (!(_.isNull(parentFormCtrl.$defaults[name]) || _.isUndefined(parentFormCtrl.$defaults[name]))) - scope.ngModel = parentFormCtrl.$defaults[name]; - else - parentFormCtrl.$defaults[name] = _.cloneDeep(scope.ngModel); - } - - const setAsDefault = () => { - if (!parentFormCtrl.$pristine) - return; - - scope.ngModel = scope.ngModel || []; - parentFormCtrl.$defaults = parentFormCtrl.$defaults || {}; - parentFormCtrl.$defaults[name] = _.cloneDeep(scope.ngModel); - }; - - const setAsDirty = () => { - if (_.isEqual(scope.ngModel, parentFormCtrl.$defaults[name])) - ngModelCtrl.$setPristine(); - else - ngModelCtrl.$setDirty(); - }; - - scope.$watch(() => parentFormCtrl.$pristine, setAsDefault); - - scope.$watch('ngModel', setAsDefault); - scope.$watch('ngModel', setAsDirty, true); - }; - - return { - restrict: 'E', - scope: { - ngModel: '=ngModel' - }, - bindToController: { - label: '@' - }, - link, - templateUrl, - controller, - controllerAs: 'group', - replace: true, - transclude: true, - require: ['?ngModel', '?form', '^^form'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/group/group.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/group/group.jade b/modules/web-console/src/main/js/app/modules/form/group/group.jade deleted file mode 100644 index ba3a8f2..0000000 --- a/modules/web-console/src/main/js/app/modules/form/group/group.jade +++ /dev/null @@ -1,21 +0,0 @@ -//- - 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. - -.group-section - .group - .group-legend - label {{::group.label}} - div(ng-transclude='') http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/group/table.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/group/table.directive.js b/modules/web-console/src/main/js/app/modules/form/group/table.directive.js deleted file mode 100644 index 8c4d0ed..0000000 --- a/modules/web-console/src/main/js/app/modules/form/group/table.directive.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ - -import templateUrl from './table.jade'; - -export default ['igniteFormGroupTable', [() => { - return { - restrict: 'E', - scope: {}, - templateUrl, - replace: true, - transclude: true, - require: ['^form', '^igniteFormGroup'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/group/table.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/group/table.jade b/modules/web-console/src/main/js/app/modules/form/group/table.jade deleted file mode 100644 index 6f9486d..0000000 --- a/modules/web-console/src/main/js/app/modules/form/group/table.jade +++ /dev/null @@ -1,17 +0,0 @@ -//- - 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. - -div \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/group/tooltip.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/group/tooltip.directive.js b/modules/web-console/src/main/js/app/modules/form/group/tooltip.directive.js deleted file mode 100644 index 2202e7b..0000000 --- a/modules/web-console/src/main/js/app/modules/form/group/tooltip.directive.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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. - */ - -const template = '<i class="group-legend-btn fa fa-question-circle"></i>'; - -export default ['igniteFormGroupTooltip', ['$tooltip', ($tooltip) => { - const link = ($scope, $element, $attrs, $ctrls, $transclude) => { - const content = Array.prototype.slice - .apply($transclude($scope)) - .reduce((html, el) => html += el.outerHTML || el.textContent || el, ''); - - $tooltip($element, { title: content }); - - $element.closest('.group').find('.group-legend').append($element); - }; - - return { - restrict: 'E', - scope: {}, - template, - link, - replace: true, - transclude: true, - require: ['^form', '^igniteFormGroup'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/panel/chevron.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/panel/chevron.directive.js b/modules/web-console/src/main/js/app/modules/form/panel/chevron.directive.js deleted file mode 100644 index 6af560b..0000000 --- a/modules/web-console/src/main/js/app/modules/form/panel/chevron.directive.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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. - */ - -const template = `<i class='fa' ng-class='isOpen ? "fa-chevron-circle-down" : "fa-chevron-circle-right"'></i>`; // eslint-disable-line quotes - -export default ['igniteFormPanelChevron', [() => { - const controller = [() => {}]; - - const link = ($scope, $element, $attrs, [bsCollapseCtrl]) => { - const $target = $element.parent().parent().find('.panel-collapse'); - - bsCollapseCtrl.$viewChangeListeners.push(function() { - const index = bsCollapseCtrl.$targets.reduce((acc, el, i) => { - if (el[0] === $target[0]) - acc.push(i); - - return acc; - }, [])[0]; - - $scope.isOpen = false; - - const active = bsCollapseCtrl.$activeIndexes(); - - if ((active instanceof Array) && active.indexOf(index) !== -1 || active === index) - $scope.isOpen = true; - }); - }; - - return { - restrict: 'E', - scope: {}, - link, - template, - controller, - replace: true, - transclude: true, - require: ['^bsCollapse'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/panel/panel.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/panel/panel.directive.js b/modules/web-console/src/main/js/app/modules/form/panel/panel.directive.js deleted file mode 100644 index b8e7c25..0000000 --- a/modules/web-console/src/main/js/app/modules/form/panel/panel.directive.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -export default ['form', [() => { - const link = (scope, $element, $attrs, [form]) => { - const $form = $element.parent().closest('form'); - - scope.$watch(() => { - return $form.hasClass('ng-pristine'); - }, (value) => { - if (!value) - return; - - form.$setPristine(); - }); - }; - - return { - restrict: 'E', - link, - require: ['^form'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/panel/revert.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/panel/revert.directive.js b/modules/web-console/src/main/js/app/modules/form/panel/revert.directive.js deleted file mode 100644 index d60efb8..0000000 --- a/modules/web-console/src/main/js/app/modules/form/panel/revert.directive.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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. - */ - -const template = '<i ng-show="form.$dirty" class="fa fa-undo pull-right" ng-click="revert($event)"></i>'; - -export default ['igniteFormRevert', ['$tooltip', 'IgniteLegacyTable', ($tooltip, LegacyTable) => { - const link = (scope, $element, $attrs, [form]) => { - $tooltip($element, { title: 'Undo unsaved changes' }); - - scope.form = form; - - scope.revert = (e) => { - e.stopPropagation(); - - LegacyTable.tableReset(); - - _.forOwn(form.$defaults, (value, name) => { - const field = form[name]; - - if (field) { - field.$setViewValue(value); - field.$setPristine(); - field.$render(); - } - }); - - form.$setPristine(); - }; - }; - - return { - restrict: 'E', - scope: { }, - template, - link, - replace: true, - require: ['^form'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/validator/ipaddress.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/validator/ipaddress.directive.js b/modules/web-console/src/main/js/app/modules/form/validator/ipaddress.directive.js deleted file mode 100644 index 2ddc786..0000000 --- a/modules/web-console/src/main/js/app/modules/form/validator/ipaddress.directive.js +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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. - */ - -export default ['ipaddress', ['IgniteInetAddress', (InetAddress) => { - const onlyDigits = (str) => (/^\d+$/.test(str)); - - const strictParseInt = (str) => onlyDigits(str) ? parseInt(str, 10) : Number.NaN; - - const parse = (commonIpAddress) => { - const [ipOrHost, portRange] = commonIpAddress.split(':'); - const ports = _.isUndefined(portRange) ? [] : portRange.split('..').map(strictParseInt); - - return {ipOrHost, ports}; - }; - - const link = (scope, el, attrs, [ngModel]) => { - const isEmpty = (modelValue) => { - return ngModel.$isEmpty(modelValue) || _.isUndefined(attrs.ipaddress) || attrs.ipaddress !== 'true'; - }; - - const portRange = !_.isNil(attrs.ipaddressWithPortRange); - - if (attrs.ipaddressWithPort) { - ngModel.$validators.ipaddressPort = (modelValue, viewValue) => { - if (isEmpty(modelValue) || viewValue.indexOf(':') === -1) - return true; - - if ((viewValue.match(/:/g) || []).length > 1) - return false; - - const {ports} = parse(viewValue); - - if (ports.length !== 1) - return portRange; - - return InetAddress.validPort(ports[0]); - }; - } - - if (portRange) { - ngModel.$validators.ipaddressPortRange = (modelValue, viewValue) => { - if (isEmpty(modelValue) || viewValue.indexOf('..') === -1) - return true; - - const {ports} = parse(viewValue); - - if (ports.length !== 2) - return false; - - return InetAddress.validPort(ports[0]) && InetAddress.validPort(ports[1]) && ports[0] < ports[1]; - }; - } - - ngModel.$validators.ipaddress = (modelValue, viewValue) => { - if (isEmpty(modelValue)) - return true; - - const {ipOrHost, ports} = parse(viewValue); - - if (attrs.ipaddressWithPort || attrs.ipaddressWithPortRange || ports.length === 0) - return InetAddress.validHost(ipOrHost); - - return false; - }; - }; - - return { - restrict: 'A', - link, - require: ['ngModel'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/validator/java-built-in-class.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/validator/java-built-in-class.directive.js b/modules/web-console/src/main/js/app/modules/form/validator/java-built-in-class.directive.js deleted file mode 100644 index 1a4b504..0000000 --- a/modules/web-console/src/main/js/app/modules/form/validator/java-built-in-class.directive.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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. - */ - -export default ['javaBuiltInClass', ['JavaTypes', (JavaTypes) => { - const link = (scope, el, attrs, [ngModel]) => { - if (_.isUndefined(attrs.javaBuiltInClass) || !attrs.javaBuiltInClass) - return; - - ngModel.$validators.javaBuiltInClass = (value) => JavaTypes.nonBuiltInClass(value); - }; - - return { - restrict: 'A', - link, - require: ['ngModel'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/validator/java-identifier.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/validator/java-identifier.directive.js b/modules/web-console/src/main/js/app/modules/form/validator/java-identifier.directive.js deleted file mode 100644 index 5cbf7fb..0000000 --- a/modules/web-console/src/main/js/app/modules/form/validator/java-identifier.directive.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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. - */ - -export default ['javaIdentifier', ['JavaTypes', (JavaTypes) => { - const link = (scope, el, attrs, [ngModel]) => { - if (_.isUndefined(attrs.javaIdentifier) || !attrs.javaIdentifier) - return; - - ngModel.$validators.javaIdentifier = (value) => JavaTypes.validIdentifier(value); - }; - - return { - restrict: 'A', - link, - require: ['ngModel'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/validator/java-keywords.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/validator/java-keywords.directive.js b/modules/web-console/src/main/js/app/modules/form/validator/java-keywords.directive.js deleted file mode 100644 index d97e59a..0000000 --- a/modules/web-console/src/main/js/app/modules/form/validator/java-keywords.directive.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -export default ['javaKeywords', ['JavaTypes', (JavaTypes) => { - const link = (scope, el, attrs, [ngModel]) => { - if (_.isUndefined(attrs.javaKeywords) || !attrs.javaKeywords) - return; - - const packageOnly = attrs.javaPackageName === 'package-only'; - - ngModel.$validators.javaKeywords = (value) => { - if (value) { - if (!JavaTypes.validIdentifier(value) || (!packageOnly && !JavaTypes.packageSpecified(value))) - return true; - - return _.findIndex(value.split('.'), JavaTypes.isKeywords) < 0; - } - - return true; - }; - }; - - return { - restrict: 'A', - link, - require: ['ngModel'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/validator/java-package-name.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/validator/java-package-name.directive.js b/modules/web-console/src/main/js/app/modules/form/validator/java-package-name.directive.js deleted file mode 100644 index ac38179..0000000 --- a/modules/web-console/src/main/js/app/modules/form/validator/java-package-name.directive.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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. - */ - -export default ['javaPackageName', ['JavaTypes', (JavaTypes) => { - const link = (scope, el, attrs, [ngModel]) => { - if (_.isUndefined(attrs.javaPackageName) || !attrs.javaPackageName) - return; - - ngModel.$validators.javaPackageName = (value) => JavaTypes.validPackage(value); - }; - - return { - restrict: 'A', - link, - require: ['ngModel'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/validator/java-package-specified.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/validator/java-package-specified.directive.js b/modules/web-console/src/main/js/app/modules/form/validator/java-package-specified.directive.js deleted file mode 100644 index 451d7ec..0000000 --- a/modules/web-console/src/main/js/app/modules/form/validator/java-package-specified.directive.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ - -export default ['javaPackageSpecified', ['JavaTypes', (JavaTypes) => { - const link = (scope, el, attrs, [ngModel]) => { - if (_.isUndefined(attrs.javaPackageSpecified)) - return; - - const allowBuiltIn = attrs.javaPackageSpecified === 'allow-built-in'; - - ngModel.$validators.javaPackageSpecified = (value) => !value || !JavaTypes.validIdentifier(value) || JavaTypes.packageSpecified(value) || - (allowBuiltIn && !JavaTypes.nonBuiltInClass(value)); - }; - - return { - restrict: 'A', - link, - require: ['ngModel'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/validator/property-unique.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/validator/property-unique.directive.js b/modules/web-console/src/main/js/app/modules/form/validator/property-unique.directive.js deleted file mode 100644 index 8cfae89..0000000 --- a/modules/web-console/src/main/js/app/modules/form/validator/property-unique.directive.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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. - */ - -export default ['ignitePropertyUnique', ['$parse', ($parse) => { - const link = (scope, el, attrs, [ngModel]) => { - if (_.isUndefined(attrs.ignitePropertyUnique) || !attrs.ignitePropertyUnique) - return; - - ngModel.$validators.ignitePropertyUnique = (value) => { - const arr = $parse(attrs.ignitePropertyUnique)(scope); - - // Return true in case if array not exist, array empty. - if (!value || !arr || !arr.length) - return true; - - const key = value.split('=')[0]; - const idx = _.findIndex(arr, (item) => item.split('=')[0] === key); - - // In case of new element check all items. - if (attrs.name === 'new') - return idx < 0; - - // Check for $index in case of editing in-place. - return (_.isNumber(scope.$index) && (idx < 0 || scope.$index === idx)); - }; - }; - - return { - restrict: 'A', - link, - require: ['ngModel'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/validator/property-value-specified.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/validator/property-value-specified.directive.js b/modules/web-console/src/main/js/app/modules/form/validator/property-value-specified.directive.js deleted file mode 100644 index d113a4f..0000000 --- a/modules/web-console/src/main/js/app/modules/form/validator/property-value-specified.directive.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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. - */ - -export default ['ignitePropertyValueSpecified', [() => { - const link = (scope, el, attrs, [ngModel]) => { - if (_.isUndefined(attrs.ignitePropertyValueSpecified) || !attrs.ignitePropertyValueSpecified) - return; - - ngModel.$validators.ignitePropertyValueSpecified = (value) => value ? value.indexOf('=') > 0 : true; - }; - - return { - restrict: 'A', - link, - require: ['ngModel'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/form/validator/unique.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/form/validator/unique.directive.js b/modules/web-console/src/main/js/app/modules/form/validator/unique.directive.js deleted file mode 100644 index 0e6af18..0000000 --- a/modules/web-console/src/main/js/app/modules/form/validator/unique.directive.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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. - */ - -export default ['igniteUnique', ['$parse', ($parse) => { - const link = (scope, el, attrs, [ngModel]) => { - if (_.isUndefined(attrs.igniteUnique) || !attrs.igniteUnique) - return; - - const isNew = _.startsWith(attrs.name, 'new'); - const property = attrs.igniteUniqueProperty; - - ngModel.$validators.igniteUnique = (value) => { - const arr = $parse(attrs.igniteUnique)(scope); - - // Return true in case if array not exist, array empty. - if (!arr || !arr.length) - return true; - - const idx = _.findIndex(arr, (item) => (property ? item[property] : item) === value); - - // In case of new element check all items. - if (isNew) - return idx < 0; - - // Check for $index in case of editing in-place. - return (_.isNumber(scope.$index) && (idx < 0 || scope.$index === idx)); - }; - }; - - return { - restrict: 'A', - link, - require: ['ngModel'] - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/getting-started/GettingStarted.provider.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/getting-started/GettingStarted.provider.js b/modules/web-console/src/main/js/app/modules/getting-started/GettingStarted.provider.js deleted file mode 100644 index cf9f561..0000000 --- a/modules/web-console/src/main/js/app/modules/getting-started/GettingStarted.provider.js +++ /dev/null @@ -1,112 +0,0 @@ -/* - * 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. - */ - -import angular from 'angular'; - -// Getting started pages. -import PAGES from 'app/data/getting-started.json'; - -angular - .module('ignite-console.getting-started', []) - .provider('igniteGettingStarted', function() { - const items = PAGES; - - this.push = (before, data) => { - const idx = _.findIndex(items, {title: before}); - - if (idx < 0) - items.push(data); - else - items.splice(idx, 0, data); - }; - - this.update = (before, data) => { - const idx = _.findIndex(items, {title: before}); - - if (idx >= 0) - items[idx] = data; - }; - - this.$get = [function() { - return items; - }]; - }) - .service('gettingStarted', ['$rootScope', '$modal', 'igniteGettingStarted', function($root, $modal, igniteGettingStarted) { - const _model = igniteGettingStarted; - - let _page = 0; - - const scope = $root.$new(); - - scope.ui = { - showGettingStarted: false - }; - - function _fillPage() { - scope.title = _model[_page].title; - scope.message = _model[_page].message.join(' '); - } - - scope.isFirst = () => _page === 0; - - scope.isLast = () => _page === _model.length - 1; - - scope.next = () => { - _page += 1; - - _fillPage(); - }; - - scope.prev = () => { - _page -= 1; - - _fillPage(); - }; - - const dialog = $modal({templateUrl: '/templates/getting-started.html', scope, placement: 'center', show: false, backdrop: 'static'}); - - scope.close = () => { - try { - localStorage.showGettingStarted = scope.ui.showGettingStarted; - } - catch (ignore) { - // No-op. - } - - dialog.hide(); - }; - - return { - tryShow: (force) => { - try { - scope.ui.showGettingStarted = _.isNil(localStorage.showGettingStarted) - || localStorage.showGettingStarted === 'true'; - } - catch (ignore) { - // No-op. - } - - if (force || scope.ui.showGettingStarted) { - _page = 0; - - _fillPage(); - - dialog.$promise.then(dialog.show); - } - } - }; - }]); http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/loading/loading.css ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/loading/loading.css b/modules/web-console/src/main/js/app/modules/loading/loading.css deleted file mode 100644 index 87bbc6a..0000000 --- a/modules/web-console/src/main/js/app/modules/loading/loading.css +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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. - */ - -[ignite-loading] { - position: relative; -} - -.loading { - position: absolute; - bottom: 0; - left: 0; - right: 0; - top: 0; - z-index: 1001; - opacity: 0; - visibility: hidden; - background-color: white; - transition: visibility 0s 0.5s, opacity 0.5s linear; -} - -.loading-active { - opacity: 1; - visibility: visible; - transition: opacity 0.5s linear; -} - -.loading:before { - content: ''; - display: inline-block; - height: 100%; - vertical-align: middle; -} - -.loading .loading-wrapper { - display: inline-block; - vertical-align: middle; - position: relative; - width: 100%; -} - -.loading.loading-top .loading-wrapper { - position: absolute; - top: 100px; - display: block; -} - -.loading .loading-text { - font-size: 18px; - margin: 20px 0; - text-align: center; -} - -.loading-opacity-80 { - opacity: 0.8; -} - -.loading-max-foreground { - z-index: 99999; -} http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/loading/loading.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/loading/loading.directive.js b/modules/web-console/src/main/js/app/modules/loading/loading.directive.js deleted file mode 100644 index 064b4c2..0000000 --- a/modules/web-console/src/main/js/app/modules/loading/loading.directive.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -import templateUrl from './loading.jade'; -import './loading.css'; - -export default ['igniteLoading', ['IgniteLoading', '$templateCache', '$compile', (Loading, $templateCache, $compile) => { - const link = (scope, element) => { - const compiledTemplate = $compile($templateCache.get(templateUrl)); - - const build = () => { - scope.position = scope.position || 'middle'; - - const loading = compiledTemplate(scope); - - if (!scope.loading) { - scope.loading = loading; - - Loading.add(scope.key || 'defaultSpinnerKey', scope.loading); - element.append(scope.loading); - } - }; - - build(); - }; - - return { - scope: { - key: '@igniteLoading', - text: '@?igniteLoadingText', - class: '@?igniteLoadingClass', - position: '@?igniteLoadingPosition' - }, - restrict: 'A', - link - }; -}]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/6af6560a/modules/web-console/src/main/js/app/modules/loading/loading.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/modules/loading/loading.jade b/modules/web-console/src/main/js/app/modules/loading/loading.jade deleted file mode 100644 index cc6cf45..0000000 --- a/modules/web-console/src/main/js/app/modules/loading/loading.jade +++ /dev/null @@ -1,23 +0,0 @@ -//- - 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. - -.loading.loading-opacity-80(ng-class='[class, "loading-" + position]') - .loading-wrapper - .spinner - .bounce1 - .bounce2 - .bounce3 - .loading-text {{ text }}
