On 10/25/2010 11:26 AM, Adam Young wrote:
On 10/25/2010 10:52 AM, Rob Crittenden wrote:
Adam Young wrote:
Implementation of the UI for DNS records.
Search uses filters.
Much of the code has been cut and pasted from search.js and add.js, but
then significantly modified. Moving forward, we'll have to determine if
it is worth the effort to integrate.
ack
Actually, NACKed byu edewata due to commentes made on review board.
Fixes being made now.
___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel
Updated with fixes from https://fedorahosted.org/reviewboard/r/96/
From 1a676fc14b98d4c39b75f7f4c10f5dce0522e91d Mon Sep 17 00:00:00 2001
From: Adam Young
Date: Fri, 22 Oct 2010 09:41:34 -0400
Subject: [PATCH] dns work
without the details change
including changes from Reviewboard https://fedorahosted.org/reviewboard/r/96/
Fixed pages that use unspecified (krb ticket policy, config)
Facet name comes out of the facet, not hard coded.
---
install/static/entity.js | 209 --
install/static/policy.js | 380 ++
2 files changed, 509 insertions(+), 80 deletions(-)
diff --git a/install/static/entity.js b/install/static/entity.js
index 9f3149b..f632964 100644
--- a/install/static/entity.js
+++ b/install/static/entity.js
@@ -28,6 +28,13 @@ var ipa_entity_add_list = {};
//var ipa_entity_details_list = {};
var ipa_entity_association_list = {};
+var ipa_entity_facet_list = {};
+
+function ipa_facet(spec){
+return spec;
+};
+
+
/* use this to track individual changes between two hashchange events */
var window_hash_cache = {};
@@ -59,49 +66,75 @@ function ipa_entity_set_association_definition(obj_name, data)
}
+function ipa_entity_set_facet_definition(obj_name, data)
+{
+function facet(spec){
+return spec;
+}
+
+ipa_entity_facet_list[obj_name] = data;
+}
+
+
function ipa_details_only_setup(container){
ipa_entity_setup(container, 'details');
}
function ipa_entity_setup(container, unspecified)
{
-var id = container.attr('id');
+var id = container.attr('id');
var state = id + '-facet';
var facet = $.bbq.getState(state, true) || unspecified || 'search';
var last_facet = window_hash_cache[state];
+var facet_renders = {
+search : function(){
+state = id + '-filter';
+var filter = $.bbq.getState(state, true);
+var last_filter = window_hash_cache[state];
+if (filter == last_filter) return;
+_ipa_entity_setup(container);
+window_hash_cache[state] = filter;
+
+},
+details : function (){
+state = id + '-pkey';
+var pkey = $.bbq.getState(state, true);
+var last_pkey = window_hash_cache[state];
+if (pkey == last_pkey) return;
+_ipa_entity_setup(container);
+window_hash_cache[state] = pkey;
+},
+associate : function () {
+state = id + '-enroll';
+var enroll = $.bbq.getState(state, true);
+var last_enroll = window_hash_cache[state];
+if (enroll == last_enroll) return;
+_ipa_entity_setup(container);
+window_hash_cache[state] = enroll;
+},
+records : function () {
+state = id + '-record';
+var records = $.bbq.getState(state, true);
+var last_records = window_hash_cache[state];
+if (records == last_records) return;
+_ipa_entity_setup(container);
+window_hash_cache[state] = record;
+}
+};
+
if (facet != last_facet) {
_ipa_entity_setup(container,unspecified);
window_hash_cache[state] = facet;
-
-} else if (facet == 'search') {
-state = id + '-filter';
-var filter = $.bbq.getState(state, true);
-var last_filter = window_hash_cache[state];
-if (filter == last_filter) return;
-
-_ipa_entity_setup(container);
-window_hash_cache[state] = filter;
-
-} else if (facet == 'details') {
-state = id + '-pkey';
-var pkey = $.bbq.getState(state, true);
-var last_pkey = window_hash_cache[state];
-if (pkey == last_pkey) return;
-
-_ipa_entity_setup(container);
-window_hash_cache[state] = pkey;
-
-} else if (facet == 'associate') {
-state = id + '-enroll';
-var enroll = $.bbq.getState(state, true);
-var last_enroll = window_hash_cache[state];
-if (enroll == last_enroll) return;
-
-_ipa_entity_setup(container);
-window_hash_cache[state] = enroll;
+} else{
+var render = facet_renders[facet];
+if (render) {
+render();
+}
+//TODO handle error.
}
+
}
function _ipa_entity_setup(container, unspecified) {
@@ -127,7 +160,9 @@ function