summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa/_base/construct.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2013-04-05 18:38:02 +0200
committerPetr Vobornik <pvoborni@redhat.com>2013-05-06 16:22:23 +0200
commitabdb5455d1954f2fab4d5def42c6b99590067eae (patch)
tree213fe89364b7a363ec3a3df11c47e163761cafa6 /install/ui/src/freeipa/_base/construct.js
parent03d3742376739aaa28b142b81d757ffeee2ed4ce (diff)
downloadfreeipa-abdb5455d1954f2fab4d5def42c6b99590067eae.tar.gz
freeipa-abdb5455d1954f2fab4d5def42c6b99590067eae.tar.xz
freeipa-abdb5455d1954f2fab4d5def42c6b99590067eae.zip
Add pre and post build operations
https://fedorahosted.org/freeipa/ticket/3235
Diffstat (limited to 'install/ui/src/freeipa/_base/construct.js')
-rw-r--r--install/ui/src/freeipa/_base/construct.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/install/ui/src/freeipa/_base/construct.js b/install/ui/src/freeipa/_base/construct.js
index 77a5e1726..91e5a0bb2 100644
--- a/install/ui/src/freeipa/_base/construct.js
+++ b/install/ui/src/freeipa/_base/construct.js
@@ -37,6 +37,26 @@ define(['dojo/_base/declare',
// TODO: Find better method. Check by extend might not be very
// reliable.
return typeof obj === 'function' && typeof obj.extend === 'function';
+ },
+
+ /**
+ * Creates copy of construction specification
+ *
+ * It makes sure that pre_ops, post_ops and spec are new Arrays/Object
+ */
+ copy_cs: function(org_cs) {
+ var cs = lang.clone(org_cs);
+ if (cs.spec) cs.spec = lang.clone(cs.spec);
+ cs.pre_ops = cs.pre_ops.slice(0);
+ cs.post_ops = cs.pre_ops.slice(0);
+ return cs;
+ },
+
+ no_cs_for_type_error: function(type) {
+ return {
+ error: 'No construction specification for given type',
+ type: type
+ };
}
};
return construct;