You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2013/06/13 01:17:21 UTC
svn commit: r1492477 - in /incubator/climate/trunk/rcmet/src/main/ui/app:
index.html js/directives.js js/directives/BootstrapModalOpen.js
Author: joyce
Date: Wed Jun 12 23:17:19 2013
New Revision: 1492477
URL: http://svn.apache.org/r1492477
Log:
CLIMATE-96 progress - Moves BootstrapModalOpen directive to new file
Added:
incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/BootstrapModalOpen.js
Modified:
incubator/climate/trunk/rcmet/src/main/ui/app/index.html
incubator/climate/trunk/rcmet/src/main/ui/app/js/directives.js
Modified: incubator/climate/trunk/rcmet/src/main/ui/app/index.html
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/index.html?rev=1492477&r1=1492476&r2=1492477&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/index.html (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/index.html Wed Jun 12 23:17:19 2013
@@ -239,5 +239,6 @@
<script src="js/directives.js"></script>
<script src="js/directives/LeafletMap.js"></script>
<script src="js/directives/BootstrapModal.js"></script>
+ <script src="js/directives/BootstrapModalOpen.js"></script>
</body>
</html>
Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/directives.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/directives.js?rev=1492477&r1=1492476&r2=1492477&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/directives.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/directives.js Wed Jun 12 23:17:19 2013
@@ -1,24 +1,7 @@
'use strict';
-// This directive process bootstrap-modal-open attributes. This lets the user bind the opening of a specific modal
-// as well as specifying how that modal should open.
-angular.module('rcmes').
-directive('bootstrapModalOpen', function() {
- return {
- restrict: 'A',
- link: function(scope, elem, attrs) {
- // Default to showing the background if the user didn't specify a value for this.
- var hasBackground = (attrs.background === undefined ? true : (attrs.background == "true"));
- // Enable keyboard closing of modal with escape key.
- var hasKeyboardEscape = (attrs.keyboard === undefined ? true : (attrs.keyboard == "true"));
-
- $(elem).bind('click', function() {
- $('#' + attrs.bootstrapModalOpen).trigger('modalOpen', [hasBackground, hasKeyboardEscape]);
- });
- }
- };
-}).
// Setup a text input that the user will use to input a path to a local file.
+angular.module('rcmes').
directive('predictiveFileBrowserInput', function() {
var link = function($scope, $elem, $attrs) {
$scope.autocomplete = [];
Added: incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/BootstrapModalOpen.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/BootstrapModalOpen.js?rev=1492477&view=auto
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/BootstrapModalOpen.js (added)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/BootstrapModalOpen.js Wed Jun 12 23:17:19 2013
@@ -0,0 +1,37 @@
+//
+// 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.
+//
+
+// This directive processes bootstrap-modal-open attributes. This lets the user bind
+// the opening of a specific modal to a button/link. It also lets the user specify
+// what features the modal should have. The user can turn off the semi-opaque background
+// by having the background attribute set to 'false'. The user can also turn off the
+// ability to close the modal with ESC by having the keyboard attribute set to 'false'.
+angular.module('rcmes').directive('bootstrapModalOpen', function() {
+ return {
+ restrict: 'A',
+ link: function(scope, elem, attrs) {
+ // Default to showing the background if the user didn't specify a value for this.
+ var hasBackground = (attrs.background === undefined ? true : (attrs.background == "true"));
+ // Enable keyboard closing of modal with escape key.
+ var hasKeyboardEscape = (attrs.keyboard === undefined ? true : (attrs.keyboard == "true"));
+
+ $(elem).bind('click', function() {
+ $('#' + attrs.bootstrapModalOpen).trigger('modalOpen', [hasBackground, hasKeyboardEscape]);
+ });
+ }
+ };
+});