From f6ce18bfb4f6d4064cb0ca3b0aa8fcca8c50bc45 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Thu, 10 Nov 2011 11:15:58 +0100 Subject: [PATCH 001/157] feature #863: Change the OpenNebula Core to VMM Driver protocol now all messages have the same format: ACTION ID XML_B64_DATA The B64 data includes the parameters for each action plus a new field for the network driver used by the target host. Also this commit changes the tree for the networking drivers. --- include/PoolObjectSQL.h | 4 +- include/VirtualMachine.h | 26 ++ include/VirtualMachineManager.h | 34 +++ include/VirtualMachineManagerDriver.h | 80 ++---- src/vmm/VirtualMachineManager.cc | 265 +++++++++++++++--- src/vmm/VirtualMachineManagerDriver.cc | 44 ++- src/vmm/XMLDriver.cc | 4 +- .../{ => remotes/802.1Q}/HostManaged.rb | 0 src/vnm_mad/{ => remotes/802.1Q}/hm-vlan | 0 .../{ => remotes}/OpenNebulaNetwork.rb | 0 src/vnm_mad/{ => remotes}/OpenNebulaNic.rb | 0 .../{ => remotes/ebtables}/Ebtables.rb | 0 .../{ => remotes/ebtables}/ebtables-vlan | 0 src/vnm_mad/{ => remotes/fw}/Firewall.rb | 0 src/vnm_mad/{ => remotes/fw}/firewall | 0 .../{ => remotes/ovswtich}/OpenvSwitch.rb | 0 .../{ => remotes/ovswtich}/openvswitch-vlan | 0 .../test/OpenNebulaNetwork_spec.rb | 0 src/vnm_mad/{ => remotes}/test/SystemMock.rb | 0 .../{ => remotes}/test/output/brctl_show | 0 .../{ => remotes}/test/output/kvm_lsmod | 0 .../{ => remotes}/test/output/kvm_uname_a | 0 .../{ => remotes}/test/output/onevm_show | 0 .../test/output/onevm_show_phydev_kvm | 0 .../test/output/onevm_show_vlan_id_kvm | 0 .../{ => remotes}/test/output/onevm_show_xen | 0 .../{ => remotes}/test/output/virsh_dumpxml | 0 .../test/output/virsh_dumpxml_phydev | 0 .../test/output/virsh_dumpxml_vlan_id | 0 .../{ => remotes}/test/output/xen_lsmod | 0 .../{ => remotes}/test/output/xen_uname_a | 0 .../{ => remotes}/test/output/xm_domid | 0 .../{ => remotes}/test/output/xm_network_list | 0 33 files changed, 334 insertions(+), 123 deletions(-) rename src/vnm_mad/{ => remotes/802.1Q}/HostManaged.rb (100%) rename src/vnm_mad/{ => remotes/802.1Q}/hm-vlan (100%) rename src/vnm_mad/{ => remotes}/OpenNebulaNetwork.rb (100%) rename src/vnm_mad/{ => remotes}/OpenNebulaNic.rb (100%) rename src/vnm_mad/{ => remotes/ebtables}/Ebtables.rb (100%) rename src/vnm_mad/{ => remotes/ebtables}/ebtables-vlan (100%) rename src/vnm_mad/{ => remotes/fw}/Firewall.rb (100%) rename src/vnm_mad/{ => remotes/fw}/firewall (100%) rename src/vnm_mad/{ => remotes/ovswtich}/OpenvSwitch.rb (100%) rename src/vnm_mad/{ => remotes/ovswtich}/openvswitch-vlan (100%) rename src/vnm_mad/{ => remotes}/test/OpenNebulaNetwork_spec.rb (100%) rename src/vnm_mad/{ => remotes}/test/SystemMock.rb (100%) rename src/vnm_mad/{ => remotes}/test/output/brctl_show (100%) rename src/vnm_mad/{ => remotes}/test/output/kvm_lsmod (100%) rename src/vnm_mad/{ => remotes}/test/output/kvm_uname_a (100%) rename src/vnm_mad/{ => remotes}/test/output/onevm_show (100%) rename src/vnm_mad/{ => remotes}/test/output/onevm_show_phydev_kvm (100%) rename src/vnm_mad/{ => remotes}/test/output/onevm_show_vlan_id_kvm (100%) rename src/vnm_mad/{ => remotes}/test/output/onevm_show_xen (100%) rename src/vnm_mad/{ => remotes}/test/output/virsh_dumpxml (100%) rename src/vnm_mad/{ => remotes}/test/output/virsh_dumpxml_phydev (100%) rename src/vnm_mad/{ => remotes}/test/output/virsh_dumpxml_vlan_id (100%) rename src/vnm_mad/{ => remotes}/test/output/xen_lsmod (100%) rename src/vnm_mad/{ => remotes}/test/output/xen_uname_a (100%) rename src/vnm_mad/{ => remotes}/test/output/xm_domid (100%) rename src/vnm_mad/{ => remotes}/test/output/xm_network_list (100%) diff --git a/include/PoolObjectSQL.h b/include/PoolObjectSQL.h index 6f357b23e7..4aa66c4235 100644 --- a/include/PoolObjectSQL.h +++ b/include/PoolObjectSQL.h @@ -259,9 +259,9 @@ public: * Generates a XML string for the template of the Object * @param xml the string to store the XML description. */ - void template_to_xml(string &xml) const + string& template_to_xml(string &xml) const { - obj_template->to_xml(xml); + return obj_template->to_xml(xml); } /** diff --git a/include/VirtualMachine.h b/include/VirtualMachine.h index 568c48ceee..7d93020fd8 100644 --- a/include/VirtualMachine.h +++ b/include/VirtualMachine.h @@ -273,6 +273,32 @@ public: return previous_history->vmm_mad_name; }; + /** + * Returns the VNM driver name for the current host. The hasHistory() + * function MUST be called before this one. + * @return the VMM mad name + */ + // const string & get_vnm_mad() const + string get_vnm_mad() const + { + string tmp = "TODO"; + return tmp; + //TODO return history->vnm_mad_name; + }; + + /** + * Returns the VNM driver name for the previous host. The hasPreviousHistory() + * function MUST be called before this one. + * @return the VMM mad name + */ + // const string & get_previous_vnm_mad() const + string get_previous_vnm_mad() const + { + string tmp = "TODO"; + return tmp; + //return previous_history->vnm_mad_name; + }; + /** * Returns the TM driver name for the current host. The hasHistory() * function MUST be called before this one. diff --git a/include/VirtualMachineManager.h b/include/VirtualMachineManager.h index 03fea34a94..1c41918288 100644 --- a/include/VirtualMachineManager.h +++ b/include/VirtualMachineManager.h @@ -175,6 +175,40 @@ private: const string & action, void * arg); + /** + * Function to format a VMM Driver message in the form: + * + * hostname + * net_drv + * m_hostname + * m_net_drv + * domain_id + * dfile + * cfile + * + * VM representation in XML + * + * + * + * @param hostname of the host to perform the action + * @param net_drv name of the vlan driver + * @param m_hostname name of the host to migrate the VM + * @param m_net_drv name of the vlan driver + * @param domain domain id as returned by the hypervisor + * @param dfile deployment file to boot the VM + * @param cfile checkpoint file to save the VM + * @param tmpl the VM information in XML + */ + string * format_message( + const string& hostname, + const string& net_drv, + const string& m_hostname, + const string& m_net_drv, + const string& domain, + const string& dfile, + const string& cfile, + const string& tmpl); + /** * Function executed when a DEPLOY action is received. It deploys a VM on * a Host. diff --git a/include/VirtualMachineManagerDriver.h b/include/VirtualMachineManagerDriver.h index a1f219e4e3..2d75485ed4 100644 --- a/include/VirtualMachineManagerDriver.h +++ b/include/VirtualMachineManagerDriver.h @@ -110,108 +110,76 @@ private: friend class VirtualMachineManager; /** - * Sends a deploy request to the MAD: "DEPLOY ID HOST CONF -" + * Sends a deploy request to the MAD: "DEPLOY ID XML_DRV_MSG" * @param oid the virtual machine id. - * @param host the hostname - * @param conf the filename of the deployment file + * @param drv_msg xml data for the mad operation */ void deploy ( const int oid, - const string& host, - const string& conf) const; + const string& drv_msg) const; /** - * Sends a shutdown request to the MAD: "SHUTDOWN ID HOST NAME -" + * Sends a shutdown request to the MAD: "SHUTDOWN ID XML_DRV_MSG" * @param oid the virtual machine id. - * @param host the hostname - * @param name of the Virtual Machine (deployment id), as returned by the - * driver + * @param drv_msg xml data for the mad operation */ void shutdown ( const int oid, - const string& host, - const string& name) const; + const string& drv_msg) const; /** - * Sends a cancel request to the MAD: "CANCEL ID HOST NAME -" + * Sends a cancel request to the MAD: "CANCEL ID XML_DRV_MSG" * @param oid the virtual machine id. - * @param host the hostname - * @param name of the Virtual Machine (deployment id), as returned by the - * driver + * @param drv_msg xml data for the mad operation */ void cancel ( const int oid, - const string& host, - const string& name) const; + const string& drv_msg) const; /** - * Sends a checkpoint request to the MAD: "CHECKPOINT ID HOST NAME FILE" + * Sends a checkpoint request to the MAD: "CHECKPOINT ID XML_DRV_MSG" * @param oid the virtual machine id. - * @param host the hostname - * @param name of the Virtual Machine (deployment id), as returned by the - * driver - * @param file the filename to generate the checkpoint file + * @param drv_msg xml data for the mad operation */ void checkpoint ( const int oid, - const string& host, - const string& name, - const string& file) const; + const string& drv_msg) const; /** - * Sends a save request to the MAD: "SAVE ID HOST NAME FILE" + * Sends a save request to the MAD: "SAVE ID XML_DRV_MSG" * @param oid the virtual machine id. - * @param host the hostname - * @param name of the Virtual Machine (deployment id), as returned by the - * driver - * @param file the filename to generate the checkpoint file + * @param drv_msg xml data for the mad operation */ void save ( const int oid, - const string& host, - const string& name, - const string& file) const; + const string& drv_msg) const; /** - * Sends a save request to the MAD: "RESTORE ID HOST FILE -" + * Sends a save request to the MAD: "RESTORE ID XML_DRV_MSG" * @param oid the virtual machine id. - * @param host the hostname - * @param name of the Virtual Machine (deployment id), as returned by the - * driver - * @param file the filename of the checkpoint file to restore the VM - * from + * @param drv_msg xml data for the mad operation */ void restore ( const int oid, - const string& host, - const string& name, - const string& file) const; + const string& drv_msg) const; /** - * Sends a migrate request to the MAD: "MIGRATE ID HOST NAME DEST" + * Sends a migrate request to the MAD: "MIGRATE ID XML_DRV_MSG" * @param oid the virtual machine id. - * @param shost the original host (source) - * @param name of the Virtual Machine (deployment id), as returned by the - * driver - * @param dhost the destination host + * @param drv_msg xml data for the mad operation */ void migrate ( const int oid, - const string& shost, - const string& name, - const string& dhost) const; + const string& drv_msg) const; /** - * Sends a poll request to the MAD: "POLL ID HOST NAME -" + * Sends a poll request to the MAD: "POLL ID XML_DRV_MSG" * @param oid the virtual machine id. - * @param host the hostname - * @param name of the Virtual Machine (deployment id), as returned by the - * driver + * @param drv_msg xml data for the mad operation */ void poll ( const int oid, - const string& host, - const string& name) const; + const string& drv_msg) const; }; /* -------------------------------------------------------------------------- */ diff --git a/src/vmm/VirtualMachineManager.cc b/src/vmm/VirtualMachineManager.cc index fc43d3380f..d7a8720bfc 100644 --- a/src/vmm/VirtualMachineManager.cc +++ b/src/vmm/VirtualMachineManager.cc @@ -245,12 +245,77 @@ void VirtualMachineManager::do_action(const string &action, void * arg) /* Manager Actions */ /* ************************************************************************** */ +string * VirtualMachineManager::format_message( + const string& hostname, + const string& net_drv, + const string& m_hostname, + const string& m_net_drv, + const string& domain, + const string& dfile, + const string& cfile, + const string& tmpl) +{ + ostringstream oss; + + oss << "" + << "" << hostname << "" + << "" << net_drv << ""; + + if (!m_hostname.empty()) + { + oss << "" << m_hostname << "" + << ""<< m_net_drv << ""; + } + else + { + oss << ""; + } + + if (!domain.empty()) + { + oss << "" << domain << ""; + } + else + { + oss << ""; + } + + if (!dfile.empty()) + { + oss << "" << dfile << ""; + } + else + { + oss << ""; + } + + if (!cfile.empty()) + { + oss << "" << cfile << ""; + } + else + { + oss << ""; + } + + oss << "" << tmpl << "" + << ""; + + return SSLTools::base64_encode(oss.str()); +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + void VirtualMachineManager::deploy_action(int vid) { - VirtualMachine * vm; - const VirtualMachineManagerDriver * vmd; - int rc; - ostringstream os; + VirtualMachine * vm; + const VirtualMachineManagerDriver * vmd; + int rc; + + ostringstream os; + string vm_tmpl; + string * drv_msg; // Get the VM from the pool vm = vmpool->get(vid,true); @@ -287,7 +352,19 @@ void VirtualMachineManager::deploy_action(int vid) } // Invoke driver method - vmd->deploy(vid,vm->get_hostname(),vm->get_remote_deployment_file()); + drv_msg = format_message( + vm->get_hostname(), + vm->get_vnm_mad(), + "", + "", + "", + vm->get_remote_deployment_file(), + "", + vm->template_to_xml(vm_tmpl)); + + vmd->deploy(vid, *drv_msg); + + delete drv_msg; vm->unlock(); @@ -326,8 +403,11 @@ void VirtualMachineManager::save_action( { VirtualMachine * vm; const VirtualMachineManagerDriver * vmd; - string hostname; - ostringstream os; + + string hostname, vnm_mad; + string vm_tmpl; + string * drv_msg; + ostringstream os; // Get the VM from the pool vm = vmpool->get(vid,true); @@ -359,20 +439,31 @@ void VirtualMachineManager::save_action( } hostname = vm->get_previous_hostname(); + vnm_mad = vm->get_previous_vnm_mad(); } else { - hostname=vm->get_hostname(); + hostname = vm->get_hostname(); + vnm_mad = vm->get_vnm_mad(); } // Invoke driver method - vmd->save( - vid, + drv_msg = format_message( hostname, + vnm_mad, + "", + "", vm->get_deploy_id(), - vm->get_checkpoint_file()); + "", + vm->get_checkpoint_file(), + vm->to_xml(vm_tmpl)); + + vmd->save(vid, *drv_msg); + + delete drv_msg; vm->unlock(); + return; error_history: @@ -406,9 +497,12 @@ error_common: void VirtualMachineManager::shutdown_action( int vid) { - VirtualMachine * vm; - const VirtualMachineManagerDriver * vmd; - ostringstream os; + VirtualMachine * vm; + const VirtualMachineManagerDriver * vmd; + + string vm_tmpl; + string * drv_msg; + ostringstream os; // Get the VM from the pool vm = vmpool->get(vid,true); @@ -432,9 +526,22 @@ void VirtualMachineManager::shutdown_action( } // Invoke driver method - vmd->shutdown(vid,vm->get_hostname(),vm->get_deploy_id()); + drv_msg = format_message( + vm->get_hostname(), + vm->get_vnm_mad(), + "", + "", + vm->get_deploy_id(), + "", + "", + vm->to_xml(vm_tmpl)); + + vmd->shutdown(vid, *drv_msg); + + delete drv_msg; vm->unlock(); + return; error_history: @@ -466,6 +573,9 @@ void VirtualMachineManager::cancel_action( VirtualMachine * vm; ostringstream os; + string vm_tmpl; + string * drv_msg; + const VirtualMachineManagerDriver * vmd; // Get the VM from the pool @@ -490,9 +600,22 @@ void VirtualMachineManager::cancel_action( } // Invoke driver method - vmd->cancel(vid,vm->get_hostname(),vm->get_deploy_id()); + drv_msg = format_message( + vm->get_hostname(), + vm->get_vnm_mad(), + "", + "", + vm->get_deploy_id(), + "", + "", + vm->to_xml(vm_tmpl)); + + vmd->cancel(vid, *drv_msg); + + delete drv_msg; vm->unlock(); + return; error_history: @@ -527,6 +650,9 @@ void VirtualMachineManager::cancel_previous_action( VirtualMachine * vm; ostringstream os; + string vm_tmpl; + string * drv_msg; + const VirtualMachineManagerDriver * vmd; // Get the VM from the pool @@ -551,9 +677,22 @@ void VirtualMachineManager::cancel_previous_action( } // Invoke driver method - vmd->cancel(vid,vm->get_previous_hostname(),vm->get_deploy_id()); + drv_msg = format_message( + vm->get_previous_hostname(), + vm->get_previous_vnm_mad(), + "", + "", + vm->get_deploy_id(), + "", + "", + vm->to_xml(vm_tmpl)); + + vmd->cancel(vid, *drv_msg); + + delete drv_msg; vm->unlock(); + return; error_history: @@ -579,7 +718,10 @@ void VirtualMachineManager::migrate_action( { VirtualMachine * vm; const VirtualMachineManagerDriver * vmd; - ostringstream os; + + ostringstream os; + string vm_tmpl; + string * drv_msg; // Get the VM from the pool vm = vmpool->get(vid,true); @@ -608,10 +750,19 @@ void VirtualMachineManager::migrate_action( } // Invoke driver method - vmd->migrate(vid, - vm->get_previous_hostname(), - vm->get_deploy_id(), - vm->get_hostname()); + drv_msg = format_message( + vm->get_previous_hostname(), + vm->get_previous_vnm_mad(), + vm->get_hostname(), + vm->get_vnm_mad(), + vm->get_deploy_id(), + "", + "", + vm->to_xml(vm_tmpl)); + + vmd->migrate(vid, *drv_msg); + + delete drv_msg; vm->unlock(); @@ -648,9 +799,13 @@ error_common: void VirtualMachineManager::restore_action( int vid) { - VirtualMachine * vm; - const VirtualMachineManagerDriver * vmd; - ostringstream os; + VirtualMachine * vm; + const VirtualMachineManagerDriver * vmd; + + ostringstream os; + + string vm_tmpl; + string * drv_msg; // Get the VM from the pool vm = vmpool->get(vid,true); @@ -674,12 +829,22 @@ void VirtualMachineManager::restore_action( } // Invoke driver method - vmd->restore(vid, - vm->get_hostname(), - vm->get_deploy_id(), - vm->get_checkpoint_file()); + drv_msg = format_message( + vm->get_hostname(), + vm->get_vnm_mad(), + "", + "", + vm->get_deploy_id(), + "", + vm->get_checkpoint_file(), + vm->to_xml(vm_tmpl)); + + vmd->restore(vid, *drv_msg); + + delete drv_msg; vm->unlock(); + return; error_history: @@ -708,9 +873,13 @@ error_common: void VirtualMachineManager::poll_action( int vid) { - VirtualMachine * vm; - const VirtualMachineManagerDriver * vmd; - ostringstream os; + VirtualMachine * vm; + const VirtualMachineManagerDriver * vmd; + + ostringstream os; + + string vm_tmpl; + string * drv_msg; // Get the VM from the pool vm = vmpool->get(vid,true); @@ -734,9 +903,22 @@ void VirtualMachineManager::poll_action( } // Invoke driver method - vmd->poll(vid,vm->get_hostname(),vm->get_deploy_id()); + drv_msg = format_message( + vm->get_hostname(), + vm->get_vnm_mad(), + "", + "", + vm->get_deploy_id(), + "", + "", + vm->to_xml(vm_tmpl)); + + vmd->poll(vid, *drv_msg); + + delete drv_msg; vm->unlock(); + return; error_history: @@ -824,6 +1006,9 @@ void VirtualMachineManager::timer_action() const VirtualMachineManagerDriver * vmd; + string vm_tmpl; + string * drv_msg; + mark = mark + timer_period; if ( mark >= 600 ) @@ -874,7 +1059,19 @@ void VirtualMachineManager::timer_action() continue; } - vmd->poll(*it,vm->get_hostname(),vm->get_deploy_id()); + drv_msg = format_message( + vm->get_hostname(), + vm->get_vnm_mad(), + "", + "", + vm->get_deploy_id(), + "", + "", + vm->to_xml(vm_tmpl)); + + vmd->poll(*it, *drv_msg); + + delete drv_msg; vmpool->update(vm); diff --git a/src/vmm/VirtualMachineManagerDriver.cc b/src/vmm/VirtualMachineManagerDriver.cc index 4b58f06f2f..c186afd927 100644 --- a/src/vmm/VirtualMachineManagerDriver.cc +++ b/src/vmm/VirtualMachineManagerDriver.cc @@ -104,12 +104,11 @@ void VirtualMachineManagerDriver::get_default( void VirtualMachineManagerDriver::deploy ( const int oid, - const string& host, - const string& conf) const + const string& drv_msg) const { ostringstream os; - os << "DEPLOY " << oid << " " << host << " " << conf << " -" << endl; + os << "DEPLOY " << oid << " " << drv_msg << endl; write(os); }; @@ -119,12 +118,11 @@ void VirtualMachineManagerDriver::deploy ( void VirtualMachineManagerDriver::shutdown ( const int oid, - const string& host, - const string& name) const + const string& drv_msg) const { ostringstream os; - os << "SHUTDOWN " << oid << " " << host << " " << name << " -" << endl; + os << "SHUTDOWN " << oid << " " << drv_msg << endl; write(os); }; @@ -134,12 +132,11 @@ void VirtualMachineManagerDriver::shutdown ( void VirtualMachineManagerDriver::cancel ( const int oid, - const string& host, - const string& name) const + const string& drv_msg) const { ostringstream os; - os << "CANCEL " << oid << " " << host << " " << name << " -" << endl; + os << "CANCEL " << oid << " " << drv_msg << endl; write(os); }; @@ -149,13 +146,11 @@ void VirtualMachineManagerDriver::cancel ( void VirtualMachineManagerDriver::checkpoint ( const int oid, - const string& host, - const string& name, - const string& file) const + const string& drv_msg) const { ostringstream os; - os<< "CHECKPOINT " << oid<< " "<< host<< " "<< name<< " "<< file<< endl; + os<< "CHECKPOINT " << oid << " " << drv_msg << endl; write(os); }; @@ -165,13 +160,11 @@ void VirtualMachineManagerDriver::checkpoint ( void VirtualMachineManagerDriver::save ( const int oid, - const string& host, - const string& name, - const string& file) const + const string& drv_msg) const { ostringstream os; - os<< "SAVE " << oid << " " << host << " " << name << " "<< file << endl; + os<< "SAVE " << oid << " " << drv_msg << endl; write(os); }; @@ -181,13 +174,11 @@ void VirtualMachineManagerDriver::save ( void VirtualMachineManagerDriver::restore ( const int oid, - const string& host, - const string& name, - const string& file) const + const string& drv_msg) const { ostringstream os; - os << "RESTORE " << oid << " " << host << " " << name << " " << file<< endl; + os << "RESTORE " << oid << " " << drv_msg << endl; write(os); }; @@ -197,13 +188,11 @@ void VirtualMachineManagerDriver::restore ( void VirtualMachineManagerDriver::migrate ( const int oid, - const string& shost, - const string& name, - const string& dhost) const + const string& drv_msg) const { ostringstream os; - os<< "MIGRATE " << oid << " "<< shost<< " "<< name<< " "<< dhost<< endl; + os<< "MIGRATE " << oid << " " << drv_msg << endl; write(os); }; @@ -213,12 +202,11 @@ void VirtualMachineManagerDriver::migrate ( void VirtualMachineManagerDriver::poll ( const int oid, - const string& host, - const string& name) const + const string& drv_msg) const { ostringstream os; - os << "POLL " << oid << " " << host << " " << name << " -" << endl; + os << "POLL " << oid << " " << drv_msg << endl; write(os); }; diff --git a/src/vmm/XMLDriver.cc b/src/vmm/XMLDriver.cc index 2879211e64..4329b71f30 100644 --- a/src/vmm/XMLDriver.cc +++ b/src/vmm/XMLDriver.cc @@ -35,9 +35,7 @@ int XMLDriver::deployment_description( return -1; } - vm->template_to_xml(xml); - - file << xml ; + file << vm->template_to_xml(xml); file.close(); diff --git a/src/vnm_mad/HostManaged.rb b/src/vnm_mad/remotes/802.1Q/HostManaged.rb similarity index 100% rename from src/vnm_mad/HostManaged.rb rename to src/vnm_mad/remotes/802.1Q/HostManaged.rb diff --git a/src/vnm_mad/hm-vlan b/src/vnm_mad/remotes/802.1Q/hm-vlan similarity index 100% rename from src/vnm_mad/hm-vlan rename to src/vnm_mad/remotes/802.1Q/hm-vlan diff --git a/src/vnm_mad/OpenNebulaNetwork.rb b/src/vnm_mad/remotes/OpenNebulaNetwork.rb similarity index 100% rename from src/vnm_mad/OpenNebulaNetwork.rb rename to src/vnm_mad/remotes/OpenNebulaNetwork.rb diff --git a/src/vnm_mad/OpenNebulaNic.rb b/src/vnm_mad/remotes/OpenNebulaNic.rb similarity index 100% rename from src/vnm_mad/OpenNebulaNic.rb rename to src/vnm_mad/remotes/OpenNebulaNic.rb diff --git a/src/vnm_mad/Ebtables.rb b/src/vnm_mad/remotes/ebtables/Ebtables.rb similarity index 100% rename from src/vnm_mad/Ebtables.rb rename to src/vnm_mad/remotes/ebtables/Ebtables.rb diff --git a/src/vnm_mad/ebtables-vlan b/src/vnm_mad/remotes/ebtables/ebtables-vlan similarity index 100% rename from src/vnm_mad/ebtables-vlan rename to src/vnm_mad/remotes/ebtables/ebtables-vlan diff --git a/src/vnm_mad/Firewall.rb b/src/vnm_mad/remotes/fw/Firewall.rb similarity index 100% rename from src/vnm_mad/Firewall.rb rename to src/vnm_mad/remotes/fw/Firewall.rb diff --git a/src/vnm_mad/firewall b/src/vnm_mad/remotes/fw/firewall similarity index 100% rename from src/vnm_mad/firewall rename to src/vnm_mad/remotes/fw/firewall diff --git a/src/vnm_mad/OpenvSwitch.rb b/src/vnm_mad/remotes/ovswtich/OpenvSwitch.rb similarity index 100% rename from src/vnm_mad/OpenvSwitch.rb rename to src/vnm_mad/remotes/ovswtich/OpenvSwitch.rb diff --git a/src/vnm_mad/openvswitch-vlan b/src/vnm_mad/remotes/ovswtich/openvswitch-vlan similarity index 100% rename from src/vnm_mad/openvswitch-vlan rename to src/vnm_mad/remotes/ovswtich/openvswitch-vlan diff --git a/src/vnm_mad/test/OpenNebulaNetwork_spec.rb b/src/vnm_mad/remotes/test/OpenNebulaNetwork_spec.rb similarity index 100% rename from src/vnm_mad/test/OpenNebulaNetwork_spec.rb rename to src/vnm_mad/remotes/test/OpenNebulaNetwork_spec.rb diff --git a/src/vnm_mad/test/SystemMock.rb b/src/vnm_mad/remotes/test/SystemMock.rb similarity index 100% rename from src/vnm_mad/test/SystemMock.rb rename to src/vnm_mad/remotes/test/SystemMock.rb diff --git a/src/vnm_mad/test/output/brctl_show b/src/vnm_mad/remotes/test/output/brctl_show similarity index 100% rename from src/vnm_mad/test/output/brctl_show rename to src/vnm_mad/remotes/test/output/brctl_show diff --git a/src/vnm_mad/test/output/kvm_lsmod b/src/vnm_mad/remotes/test/output/kvm_lsmod similarity index 100% rename from src/vnm_mad/test/output/kvm_lsmod rename to src/vnm_mad/remotes/test/output/kvm_lsmod diff --git a/src/vnm_mad/test/output/kvm_uname_a b/src/vnm_mad/remotes/test/output/kvm_uname_a similarity index 100% rename from src/vnm_mad/test/output/kvm_uname_a rename to src/vnm_mad/remotes/test/output/kvm_uname_a diff --git a/src/vnm_mad/test/output/onevm_show b/src/vnm_mad/remotes/test/output/onevm_show similarity index 100% rename from src/vnm_mad/test/output/onevm_show rename to src/vnm_mad/remotes/test/output/onevm_show diff --git a/src/vnm_mad/test/output/onevm_show_phydev_kvm b/src/vnm_mad/remotes/test/output/onevm_show_phydev_kvm similarity index 100% rename from src/vnm_mad/test/output/onevm_show_phydev_kvm rename to src/vnm_mad/remotes/test/output/onevm_show_phydev_kvm diff --git a/src/vnm_mad/test/output/onevm_show_vlan_id_kvm b/src/vnm_mad/remotes/test/output/onevm_show_vlan_id_kvm similarity index 100% rename from src/vnm_mad/test/output/onevm_show_vlan_id_kvm rename to src/vnm_mad/remotes/test/output/onevm_show_vlan_id_kvm diff --git a/src/vnm_mad/test/output/onevm_show_xen b/src/vnm_mad/remotes/test/output/onevm_show_xen similarity index 100% rename from src/vnm_mad/test/output/onevm_show_xen rename to src/vnm_mad/remotes/test/output/onevm_show_xen diff --git a/src/vnm_mad/test/output/virsh_dumpxml b/src/vnm_mad/remotes/test/output/virsh_dumpxml similarity index 100% rename from src/vnm_mad/test/output/virsh_dumpxml rename to src/vnm_mad/remotes/test/output/virsh_dumpxml diff --git a/src/vnm_mad/test/output/virsh_dumpxml_phydev b/src/vnm_mad/remotes/test/output/virsh_dumpxml_phydev similarity index 100% rename from src/vnm_mad/test/output/virsh_dumpxml_phydev rename to src/vnm_mad/remotes/test/output/virsh_dumpxml_phydev diff --git a/src/vnm_mad/test/output/virsh_dumpxml_vlan_id b/src/vnm_mad/remotes/test/output/virsh_dumpxml_vlan_id similarity index 100% rename from src/vnm_mad/test/output/virsh_dumpxml_vlan_id rename to src/vnm_mad/remotes/test/output/virsh_dumpxml_vlan_id diff --git a/src/vnm_mad/test/output/xen_lsmod b/src/vnm_mad/remotes/test/output/xen_lsmod similarity index 100% rename from src/vnm_mad/test/output/xen_lsmod rename to src/vnm_mad/remotes/test/output/xen_lsmod diff --git a/src/vnm_mad/test/output/xen_uname_a b/src/vnm_mad/remotes/test/output/xen_uname_a similarity index 100% rename from src/vnm_mad/test/output/xen_uname_a rename to src/vnm_mad/remotes/test/output/xen_uname_a diff --git a/src/vnm_mad/test/output/xm_domid b/src/vnm_mad/remotes/test/output/xm_domid similarity index 100% rename from src/vnm_mad/test/output/xm_domid rename to src/vnm_mad/remotes/test/output/xm_domid diff --git a/src/vnm_mad/test/output/xm_network_list b/src/vnm_mad/remotes/test/output/xm_network_list similarity index 100% rename from src/vnm_mad/test/output/xm_network_list rename to src/vnm_mad/remotes/test/output/xm_network_list From 5571bd81c0373f0a1b0b03737a7aa4b62a8f0a0f Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Thu, 10 Nov 2011 11:20:49 +0100 Subject: [PATCH 002/157] feature #863: Fix comment on for the XML format of the driver message --- include/VirtualMachineManager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/VirtualMachineManager.h b/include/VirtualMachineManager.h index 1c41918288..8df8df3b1e 100644 --- a/include/VirtualMachineManager.h +++ b/include/VirtualMachineManager.h @@ -185,9 +185,9 @@ private: * domain_id * dfile * cfile - * + * * VM representation in XML - * + * * * * @param hostname of the host to perform the action From 665036efcf67c919fccebf11d5b00a047edac2c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 10 Nov 2011 17:28:32 +0100 Subject: [PATCH 003/157] Feature #863: Add Virtual Network MAD to hosts --- include/History.h | 2 ++ include/Host.h | 15 +++++++++++++++ include/HostPool.h | 1 + include/RequestManagerVirtualMachine.h | 5 +++-- include/VirtualMachine.h | 9 +++------ src/host/Host.cc | 4 ++++ src/host/HostPool.cc | 13 ++++++++++++- src/rm/RequestManagerAllocate.cc | 6 ++++-- src/rm/RequestManagerVirtualMachine.cc | 17 +++++++++++------ src/vm/History.cc | 5 +++++ src/vm/VirtualMachine.cc | 5 ++++- 11 files changed, 64 insertions(+), 18 deletions(-) diff --git a/include/History.h b/include/History.h index 35e38a3569..0f46fc86f2 100644 --- a/include/History.h +++ b/include/History.h @@ -46,6 +46,7 @@ public: const string& hostname, const string& vm_dir, const string& vmm, + const string& vnm, const string& tm); ~History(){}; @@ -91,6 +92,7 @@ private: int hid; string vmm_mad_name; + string vnm_mad_name; string tm_mad_name; time_t stime; diff --git a/include/Host.h b/include/Host.h index f112532aa0..cb9403cdf4 100644 --- a/include/Host.h +++ b/include/Host.h @@ -130,6 +130,15 @@ public: return vmm_mad_name; }; + /** + * Retrives VNM mad name + * @return string vnm mad name + */ + const string& get_vnm_mad() const + { + return vnm_mad_name; + }; + /** * Retrives TM mad name * @return string tm mad name @@ -311,6 +320,11 @@ private: */ string vmm_mad_name; + /** + * Name of the VN driver used to manage networking in this host + */ + string vnm_mad_name; + /** * Name of the TM driver used to transfer file to and from this host */ @@ -338,6 +352,7 @@ private: const string& hostname="", const string& im_mad_name="", const string& vmm_mad_name="", + const string& vnm_mad_name="", const string& tm_mad_name=""); virtual ~Host(); diff --git a/include/HostPool.h b/include/HostPool.h index 89a516218e..50686a60fe 100644 --- a/include/HostPool.h +++ b/include/HostPool.h @@ -51,6 +51,7 @@ public: const string& hostname, const string& im_mad_name, const string& vmm_mad_name, + const string& vnm_mad_name, const string& tm_mad_name, string& error_str); diff --git a/include/RequestManagerVirtualMachine.h b/include/RequestManagerVirtualMachine.h index ea70ad35f5..0c06b4582b 100644 --- a/include/RequestManagerVirtualMachine.h +++ b/include/RequestManagerVirtualMachine.h @@ -51,13 +51,14 @@ protected: bool vm_authorization(int id, int hid, ImageTemplate *tmpl, RequestAttributes& att); - int get_host_information(int hid, string& name, string& vmm, string& tm, - RequestAttributes& att); + int get_host_information(int hid, string& name, string& vmm, string& vnm, + string& tm, RequestAttributes& att); int add_history(VirtualMachine * vm, int hid, const string& hostname, const string& vmm_mad, + const string& vnm_mad, const string& tm_mad, RequestAttributes& att); diff --git a/include/VirtualMachine.h b/include/VirtualMachine.h index 7d93020fd8..357ccb75a1 100644 --- a/include/VirtualMachine.h +++ b/include/VirtualMachine.h @@ -217,6 +217,7 @@ public: const string& hostname, const string& vm_dir, const string& vmm_mad, + const string& vnm_mad, const string& tm_mad); /** @@ -281,9 +282,7 @@ public: // const string & get_vnm_mad() const string get_vnm_mad() const { - string tmp = "TODO"; - return tmp; - //TODO return history->vnm_mad_name; + return history->vnm_mad_name; }; /** @@ -294,9 +293,7 @@ public: // const string & get_previous_vnm_mad() const string get_previous_vnm_mad() const { - string tmp = "TODO"; - return tmp; - //return previous_history->vnm_mad_name; + return previous_history->vnm_mad_name; }; /** diff --git a/src/host/Host.cc b/src/host/Host.cc index 52361a96ed..484a44953b 100644 --- a/src/host/Host.cc +++ b/src/host/Host.cc @@ -33,11 +33,13 @@ Host::Host( const string& _hostname, const string& _im_mad_name, const string& _vmm_mad_name, + const string& _vnm_mad_name, const string& _tm_mad_name): PoolObjectSQL(id,_hostname,-1,-1,"","",table), state(INIT), im_mad_name(_im_mad_name), vmm_mad_name(_vmm_mad_name), + vnm_mad_name(_vnm_mad_name), tm_mad_name(_tm_mad_name), last_monitored(0) { @@ -200,6 +202,7 @@ string& Host::to_xml(string& xml) const "" << state << "" << "" << im_mad_name << "" << "" << vmm_mad_name << "" << + "" << vnm_mad_name << "" << "" << tm_mad_name << "" << "" << last_monitored << "" << host_share.to_xml(share_xml) << @@ -231,6 +234,7 @@ int Host::from_xml(const string& xml) rc += xpath(im_mad_name, "/HOST/IM_MAD", "not_found"); rc += xpath(vmm_mad_name, "/HOST/VM_MAD", "not_found"); + rc += xpath(vnm_mad_name, "/HOST/VN_MAD", "not_found"); rc += xpath(tm_mad_name, "/HOST/TM_MAD", "not_found"); rc += xpath(last_monitored, "/HOST/LAST_MON_TIME", 0); diff --git a/src/host/HostPool.cc b/src/host/HostPool.cc index d33529cbad..b3d404a1a0 100644 --- a/src/host/HostPool.cc +++ b/src/host/HostPool.cc @@ -139,6 +139,7 @@ int HostPool::allocate ( const string& hostname, const string& im_mad_name, const string& vmm_mad_name, + const string& vnm_mad_name, const string& tm_mad_name, string& error_str) { @@ -165,6 +166,11 @@ int HostPool::allocate ( goto error_vmm; } + if ( vnm_mad_name.empty() ) + { + goto error_vnm; + } + if ( tm_mad_name.empty() ) { goto error_tm; @@ -179,7 +185,8 @@ int HostPool::allocate ( // Build a new Host object - host = new Host(-1, hostname, im_mad_name, vmm_mad_name, tm_mad_name); + host = new Host(-1, hostname, im_mad_name, vmm_mad_name, vnm_mad_name, + tm_mad_name); // Insert the Object in the pool @@ -204,6 +211,10 @@ error_vmm: oss << "VMM_MAD_NAME cannot be empty."; goto error_common; +error_vnm: + oss << "VNM_MAD_NAME cannot be empty."; + goto error_common; + error_tm: oss << "TM_MAD_NAME cannot be empty."; goto error_common; diff --git a/src/rm/RequestManagerAllocate.cc b/src/rm/RequestManagerAllocate.cc index eb60f27e08..6d0eded4cc 100644 --- a/src/rm/RequestManagerAllocate.cc +++ b/src/rm/RequestManagerAllocate.cc @@ -212,11 +212,13 @@ int HostAllocate::pool_allocate(xmlrpc_c::paramList const& paramList, string host = xmlrpc_c::value_string(paramList.getString(1)); string im_mad = xmlrpc_c::value_string(paramList.getString(2)); string vmm_mad = xmlrpc_c::value_string(paramList.getString(3)); - string tm_mad = xmlrpc_c::value_string(paramList.getString(4)); + string vnm_mad = xmlrpc_c::value_string(paramList.getString(4)); + string tm_mad = xmlrpc_c::value_string(paramList.getString(5)); HostPool * hpool = static_cast(pool); - return hpool->allocate(&id, host, im_mad, vmm_mad, tm_mad, error_str); + return hpool->allocate(&id, host, im_mad, vmm_mad, vnm_mad, tm_mad, + error_str); } /* -------------------------------------------------------------------------- */ diff --git a/src/rm/RequestManagerVirtualMachine.cc b/src/rm/RequestManagerVirtualMachine.cc index 17dd537084..ff74188a51 100644 --- a/src/rm/RequestManagerVirtualMachine.cc +++ b/src/rm/RequestManagerVirtualMachine.cc @@ -88,7 +88,8 @@ bool RequestManagerVirtualMachine::vm_authorization(int oid, int RequestManagerVirtualMachine::get_host_information(int hid, string& name, - string& vmm, + string& vmm, + string& vnm, string& tm, RequestAttributes& att) { @@ -110,6 +111,7 @@ int RequestManagerVirtualMachine::get_host_information(int hid, name = host->get_name(); vmm = host->get_vmm_mad(); + vnm = host->get_vnm_mad(); tm = host->get_tm_mad(); host->unlock(); @@ -142,6 +144,7 @@ int RequestManagerVirtualMachine::add_history(VirtualMachine * vm, int hid, const string& hostname, const string& vmm_mad, + const string& vnm_mad, const string& tm_mad, RequestAttributes& att) { @@ -154,7 +157,7 @@ int RequestManagerVirtualMachine::add_history(VirtualMachine * vm, nd.get_configuration_attribute("VM_DIR",vmdir); - vm->add_history(hid,hostname,vmdir,vmm_mad,tm_mad); + vm->add_history(hid,hostname,vmdir,vmm_mad,vnm_mad,tm_mad); rc = vmpool->update_history(vm); @@ -273,6 +276,7 @@ void VirtualMachineDeploy::request_execute(xmlrpc_c::paramList const& paramList, string hostname; string vmm_mad; + string vnm_mad; string tm_mad; int id = xmlrpc_c::value_int(paramList.getInt(1)); @@ -283,7 +287,7 @@ void VirtualMachineDeploy::request_execute(xmlrpc_c::paramList const& paramList, return; } - if (get_host_information(hid,hostname,vmm_mad,tm_mad, att) != 0) + if (get_host_information(hid,hostname,vmm_mad,vnm_mad,tm_mad, att) != 0) { return; } @@ -303,7 +307,7 @@ void VirtualMachineDeploy::request_execute(xmlrpc_c::paramList const& paramList, return; } - if ( add_history(vm,hid,hostname,vmm_mad,tm_mad,att) != 0) + if ( add_history(vm,hid,hostname,vmm_mad,vnm_mad,tm_mad,att) != 0) { vm->unlock(); return; @@ -329,6 +333,7 @@ void VirtualMachineMigrate::request_execute(xmlrpc_c::paramList const& paramList string hostname; string vmm_mad; + string vnm_mad; string tm_mad; int id = xmlrpc_c::value_int(paramList.getInt(1)); @@ -340,7 +345,7 @@ void VirtualMachineMigrate::request_execute(xmlrpc_c::paramList const& paramList return; } - if (get_host_information(hid,hostname,vmm_mad,tm_mad,att) != 0) + if (get_host_information(hid,hostname,vmm_mad,vnm_mad,tm_mad,att) != 0) { return; } @@ -362,7 +367,7 @@ void VirtualMachineMigrate::request_execute(xmlrpc_c::paramList const& paramList return; } - if ( add_history(vm,hid,hostname,vmm_mad,tm_mad,att) != 0) + if ( add_history(vm,hid,hostname,vmm_mad,vnm_mad,tm_mad,att) != 0) { vm->unlock(); return; diff --git a/src/vm/History.cc b/src/vm/History.cc index 3bef2c4eb6..f2a52ccb3c 100644 --- a/src/vm/History.cc +++ b/src/vm/History.cc @@ -43,6 +43,7 @@ History::History( vm_dir(""), hid(-1), vmm_mad_name(""), + vnm_mad_name(""), tm_mad_name(""), stime(0), etime(0), @@ -63,6 +64,7 @@ History::History( const string& _hostname, const string& _vm_dir, const string& _vmm, + const string& _vnm, const string& _tm): oid(_oid), seq(_seq), @@ -70,6 +72,7 @@ History::History( vm_dir(_vm_dir), hid(_hid), vmm_mad_name(_vmm), + vnm_mad_name(_vnm), tm_mad_name(_tm), stime(0), etime(0), @@ -267,6 +270,7 @@ string& History::to_xml(string& xml) const "" << stime << "" << "" << etime << "" << "" << vmm_mad_name << ""<< + "" << vnm_mad_name << ""<< "" << tm_mad_name << "" << "" << prolog_stime << ""<< "" << prolog_etime << ""<< @@ -297,6 +301,7 @@ int History::rebuild_attributes() rc += xpath(stime , "/HISTORY/STIME", 0); rc += xpath(etime , "/HISTORY/ETIME", 0); rc += xpath(vmm_mad_name , "/HISTORY/VMMMAD", "not_found"); + rc += xpath(vnm_mad_name , "/HISTORY/VNMMAD", "not_found"); rc += xpath(tm_mad_name , "/HISTORY/TMMAD", "not_found"); rc += xpath(prolog_stime , "/HISTORY/PSTIME", 0); rc += xpath(prolog_etime , "/HISTORY/PETIME", 0); diff --git a/src/vm/VirtualMachine.cc b/src/vm/VirtualMachine.cc index 349f57b8ba..1ca014f8db 100644 --- a/src/vm/VirtualMachine.cc +++ b/src/vm/VirtualMachine.cc @@ -581,6 +581,7 @@ void VirtualMachine::add_history( const string& hostname, const string& vm_dir, const string& vmm_mad, + const string& vnm_mad, const string& tm_mad) { ostringstream os; @@ -597,7 +598,7 @@ void VirtualMachine::add_history( previous_history = history; } - history = new History(oid,seq,hid,hostname,vm_dir,vmm_mad,tm_mad); + history = new History(oid,seq,hid,hostname,vm_dir,vmm_mad,vnm_mad,tm_mad); history_records.push_back(history); }; @@ -620,6 +621,7 @@ void VirtualMachine::cp_history() history->hostname, history->vm_dir, history->vmm_mad_name, + history->vnm_mad_name, history->tm_mad_name); @@ -647,6 +649,7 @@ void VirtualMachine::cp_previous_history() previous_history->hostname, previous_history->vm_dir, previous_history->vmm_mad_name, + previous_history->vnm_mad_name, previous_history->tm_mad_name); previous_history = history; From fc848e27275da04c9c889c58ecf16787335a2193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 10 Nov 2011 09:14:37 -0800 Subject: [PATCH 004/157] Feature #863: Fix tests --- src/host/test/HostHookTest.cc | 8 ++--- src/host/test/HostPoolTest.cc | 51 ++++++++++++++------------- src/lcm/test/LifeCycleManagerTest.cc | 23 ++++++------ src/vm/test/VirtualMachinePoolTest.cc | 12 ++++--- 4 files changed, 49 insertions(+), 45 deletions(-) diff --git a/src/host/test/HostHookTest.cc b/src/host/test/HostHookTest.cc index 406241597e..62361519ef 100644 --- a/src/host/test/HostHookTest.cc +++ b/src/host/test/HostHookTest.cc @@ -96,7 +96,7 @@ public: { string err; - hpool->allocate(&oid, "host_test", "im_mad", "vmm_mad", "tm_mad", err); + hpool->allocate(&oid, "host_test", "im_mad", "vmm_mad", "vnm_mad", "tm_mad", err); CPPUNIT_ASSERT( oid >= 0 ); sleep(1); @@ -114,7 +114,7 @@ public: { string err; - hpool->allocate(&oid, "host_test", "im_mad", "vmm_mad", "tm_mad", err); + hpool->allocate(&oid, "host_test", "im_mad", "vmm_mad", "vnm_mad", "tm_mad", err); CPPUNIT_ASSERT( oid >= 0 ); host = hpool->get(oid, true); @@ -140,7 +140,7 @@ public: { string err; - hpool->allocate(&oid, "host_test", "im_mad", "vmm_mad", "tm_mad", err); + hpool->allocate(&oid, "host_test", "im_mad", "vmm_mad", "vnm_mad", "tm_mad", err); CPPUNIT_ASSERT( oid >= 0 ); host = hpool->get(oid, true); @@ -166,7 +166,7 @@ public: { string err; - hpool->allocate(&oid, "host_test", "im_mad", "vmm_mad", "tm_mad", err); + hpool->allocate(&oid, "host_test", "im_mad", "vmm_mad", "vnm_mad", "tm_mad", err); CPPUNIT_ASSERT( oid >= 0 ); host = hpool->get(oid, true); diff --git a/src/host/test/HostPoolTest.cc b/src/host/test/HostPoolTest.cc index 2b63af6a50..1dab8f08d5 100644 --- a/src/host/test/HostPoolTest.cc +++ b/src/host/test/HostPoolTest.cc @@ -25,6 +25,7 @@ using namespace std; const string im_mad = "im_mad"; const string vmm_mad = "vmm_mad"; +const string vnm_mad = "vnm_mad"; const string tm_mad = "tm_mad"; const string names[] = {"Host one", "Second host"}; @@ -32,7 +33,7 @@ const string names[] = {"Host one", "Second host"}; const string xmls[] = { "0Host one0" - "im_madvmm_madtm_mad" + "im_madvmm_madvnm_madtm_mad" "0" "000" "000" @@ -41,7 +42,7 @@ const string xmls[] = "0", "1Second host0" - "im_madvmm_madtm_mad" + "im_madvmm_madvnm_madtm_mad" "0" "000" "000" @@ -53,34 +54,34 @@ const string xmls[] = // This xml dump result has the LAST_MON_TIMEs modified to 0000000000 const string xml_dump = "0a0im_madvmm_madtm_mad0" + "M_MAD>vmm_madvnm_madtm_mad0" "0000000000000" "1a name0im_madvmm_madtm_mad0vmm_madvnm_madtm_mad000000" "000000002a_name0im_madvmm_madtm_mad0vnm_madtm_mad000000000000003another " "name0im_madvmm_mad" - "tm_mad0vnm_madtm_mad000000000000004host0im_madvmm_madtm_mad" + "ATE>0im_madvmm_madvnm_madtm_mad" "0" "000" "0000" @@ -90,28 +91,28 @@ const string xml_dump = const string xml_dump_like_a = "0a0im_madvmm_madtm_mad0" + "M_MAD>vmm_madvnm_madtm_mad0" "0000000000000" "1a name0im_madvmm_madtm_mad0vmm_madvnm_madtm_mad000000" "000000002a_name0im_madvmm_madtm_mad0vnm_madtm_mad000000000000003another " "name0im_madvmm_mad" - "tm_mad0vnm_madtm_mad00000000000Host one0im_madvmm_madtm_mad00000000000000"; + "0Host one0im_madvmm_madvnm_madtm_mad00000000000000"; const string host_0_cluster = - "0Host one0im_madvmm_madtm_mad0cluster_a0000000000000"; + "0Host one0im_madvmm_madvnm_madtm_mad0cluster_a0000000000000"; /* ************************************************************************* */ /* ************************************************************************* */ @@ -162,7 +163,7 @@ protected: int oid; string err; return ((HostPool*)pool)->allocate(&oid, names[index], im_mad, - vmm_mad, tm_mad, err); + vmm_mad, vnm_mad, tm_mad, err); }; void check(int index, PoolObjectSQL* obj) @@ -184,7 +185,7 @@ protected: if( xml_str != xmls[index] ) { cout << endl << xml_str << endl << "========" - << endl << xmls[index]; + << endl << xmls[index] << endl; } //*/ CPPUNIT_ASSERT( xml_str == xmls[index]); @@ -242,16 +243,16 @@ public: // If we try to allocate two hosts with the same name and drivers, // should fail - rc = hp->allocate(&oid_0, names[0], im_mad, vmm_mad, tm_mad, err); + rc = hp->allocate(&oid_0, names[0], im_mad, vmm_mad, vnm_mad, tm_mad, err); CPPUNIT_ASSERT( oid_0 == 0 ); CPPUNIT_ASSERT( rc == oid_0 ); - rc = hp->allocate(&oid_1, names[0], im_mad, vmm_mad, tm_mad, err); + rc = hp->allocate(&oid_1, names[0], im_mad, vmm_mad, vnm_mad, tm_mad, err); CPPUNIT_ASSERT( oid_1 == -1 ); CPPUNIT_ASSERT( rc == oid_1 ); // the hostname can not be repeated if the drivers change - rc = hp->allocate(&oid_1, names[0], im_mad, vmm_mad, tm_mad_2, err); + rc = hp->allocate(&oid_1, names[0], im_mad, vmm_mad, vnm_mad, tm_mad_2, err); CPPUNIT_ASSERT( oid_1 == -1 ); CPPUNIT_ASSERT( rc == oid_1 ); @@ -272,7 +273,7 @@ public: for(int i=0; i<5; i++) { ((HostPool*)pool)->allocate(&oid, names[i], - im_mad, vmm_mad, tm_mad, err); + im_mad, vmm_mad, vnm_mad, tm_mad, err); } ostringstream oss; @@ -287,7 +288,7 @@ public: if( result != xml_dump ) { cout << endl << result << endl << "========" - << endl << xml_dump; + << endl << xml_dump << endl; } //*/ @@ -305,7 +306,7 @@ public: for(int i=0; i<5; i++) { ((HostPool*)pool)->allocate(&oid, names[i], - im_mad, vmm_mad, tm_mad, err); + im_mad, vmm_mad, vnm_mad, tm_mad, err); } @@ -321,7 +322,7 @@ public: if( result != xml_dump_like_a ) { cout << endl << result << endl << "========" - << endl << xml_dump_like_a; + << endl << xml_dump_like_a << endl; } //*/ @@ -346,7 +347,7 @@ public: { oss << "host" << i; - hp->allocate(&oid, oss.str().c_str(), im_mad, vmm_mad, tm_mad, err); + hp->allocate(&oid, oss.str().c_str(), im_mad, vmm_mad, vnm_mad, tm_mad, err); CPPUNIT_ASSERT(oid == i); if (i >=8 ) @@ -404,7 +405,7 @@ public: { oss << "host" << j; - hp->allocate(&oid, oss.str().c_str(),im_mad,vmm_mad,tm_mad,err); + hp->allocate(&oid, oss.str().c_str(),im_mad,vmm_mad,vnm_mad,tm_mad,err); } the_time2 = time(0) - the_time; @@ -433,7 +434,7 @@ public: for (i=10000,oss.str(""); i<30000 ; i++,oss.str("")) { oss << "host" << i; - hp->allocate(&oid,oss.str().c_str(),im_mad,vmm_mad,tm_mad,err); + hp->allocate(&oid,oss.str().c_str(),im_mad,vmm_mad,vnm_mad,tm_mad,err); host = hp->get(oid, false); diff --git a/src/lcm/test/LifeCycleManagerTest.cc b/src/lcm/test/LifeCycleManagerTest.cc index c2d4386d2e..2f333133d5 100644 --- a/src/lcm/test/LifeCycleManagerTest.cc +++ b/src/lcm/test/LifeCycleManagerTest.cc @@ -47,6 +47,7 @@ const string templates[] = static int hid = 123; static string hostname = "test_hostname"; static string vmm_mad = "vmm_mad"; +static string vnm_mad = "vnm_mad"; static string tm_mad = "tm_mad"; static string vmdir = "vmdir"; @@ -225,7 +226,7 @@ private: vm->lock(); - vm->add_history(hid,hostname,vmdir,vmm_mad,tm_mad); + vm->add_history(hid,hostname,vmdir,vmm_mad,vnm_mad,tm_mad); rc = vmpool->update_history(vm); CPPUNIT_ASSERT( rc == 0 ); @@ -489,7 +490,7 @@ public: { vm = allocate_running(0); - vm->add_history(hid,hostname,vmdir,vmm_mad,tm_mad); + vm->add_history(hid,hostname,vmdir,vmm_mad,vnm_mad,tm_mad); rc = vmpool->update_history(vm); CPPUNIT_ASSERT( rc == 0 ); @@ -573,7 +574,7 @@ public: { vm = allocate_running(0); - vm->add_history(hid,hostname,vmdir,vmm_mad,tm_mad); + vm->add_history(hid,hostname,vmdir,vmm_mad,vnm_mad,tm_mad); rc = vmpool->update_history(vm); CPPUNIT_ASSERT( rc == 0 ); @@ -594,7 +595,7 @@ public: { vm = allocate_running(0); - vm->add_history(hid,hostname,vmdir,vmm_mad,tm_mad); + vm->add_history(hid,hostname,vmdir,vmm_mad,vnm_mad,tm_mad); rc = vmpool->update_history(vm); CPPUNIT_ASSERT( rc == 0 ); @@ -615,7 +616,7 @@ public: { vm = allocate_running(0); - vm->add_history(hid,hostname,vmdir,vmm_mad,tm_mad); + vm->add_history(hid,hostname,vmdir,vmm_mad,vnm_mad,tm_mad); rc = vmpool->update_history(vm); CPPUNIT_ASSERT( rc == 0 ); @@ -637,7 +638,7 @@ public: { vm = allocate_running(0); - vm->add_history(hid,hostname,vmdir,vmm_mad,tm_mad); + vm->add_history(hid,hostname,vmdir,vmm_mad,vnm_mad,tm_mad); rc = vmpool->update_history(vm); CPPUNIT_ASSERT( rc == 0 ); @@ -661,7 +662,7 @@ public: { vm = allocate_running(0); - vm->add_history(hid,hostname,vmdir,vmm_mad,tm_mad); + vm->add_history(hid,hostname,vmdir,vmm_mad,vnm_mad,tm_mad); rc = vmpool->update_history(vm); CPPUNIT_ASSERT( rc == 0 ); @@ -685,7 +686,7 @@ public: { vm = allocate_running(0); - vm->add_history(hid,hostname,vmdir,vmm_mad,tm_mad); + vm->add_history(hid,hostname,vmdir,vmm_mad,vnm_mad,tm_mad); rc = vmpool->update_history(vm); CPPUNIT_ASSERT( rc == 0 ); @@ -749,7 +750,7 @@ public: { vm = allocate_running(0); - vm->add_history(hid,hostname,vmdir,vmm_mad,tm_mad); + vm->add_history(hid,hostname,vmdir,vmm_mad,vnm_mad,tm_mad); rc = vmpool->update_history(vm); CPPUNIT_ASSERT( rc == 0 ); @@ -772,7 +773,7 @@ public: { vm = allocate_running(0); - vm->add_history(hid,hostname,vmdir,vmm_mad,tm_mad); + vm->add_history(hid,hostname,vmdir,vmm_mad,vnm_mad,tm_mad); rc = vmpool->update_history(vm); CPPUNIT_ASSERT( rc == 0 ); @@ -795,7 +796,7 @@ public: { vm = allocate_running(0); - vm->add_history(hid,hostname,vmdir,vmm_mad,tm_mad); + vm->add_history(hid,hostname,vmdir,vmm_mad,vnm_mad,tm_mad); rc = vmpool->update_history(vm); CPPUNIT_ASSERT( rc == 0 ); diff --git a/src/vm/test/VirtualMachinePoolTest.cc b/src/vm/test/VirtualMachinePoolTest.cc index 5bcd6c1e7d..10f87c22ff 100644 --- a/src/vm/test/VirtualMachinePoolTest.cc +++ b/src/vm/test/VirtualMachinePoolTest.cc @@ -302,6 +302,7 @@ public: string hostnames[] = {"A_hostname", "B_hostname", "C_hostname"}; string vm_dirs[] = {"A_vm_dir", "B_vm_dir", "C_vm_dir"}; string vmm_mads[] = {"A_vmm_mad", "B_vmm_mad", "C_vmm_mad"}; + string vnm_mads[] = {"A_vnm_mad", "B_vnm_mad", "C_vnm_mad"}; string tm_mads[] = {"A_tm_mad", "B_tm_mad", "C_tm_mad"}; int oid, rc; @@ -324,7 +325,7 @@ public: CPPUNIT_ASSERT( vm != 0 ); // Add a history item - vm->add_history(0, hostnames[0], vm_dirs[0], vmm_mads[0], tm_mads[0]); + vm->add_history(0, hostnames[0], vm_dirs[0], vmm_mads[0], vnm_mads[0], tm_mads[0]); rc = vmp->update(vm); CPPUNIT_ASSERT( rc == 0 ); @@ -342,7 +343,7 @@ public: CPPUNIT_ASSERT( vm != 0 ); // Add a history item - vm->add_history(1, hostnames[1], vm_dirs[1], vmm_mads[1], tm_mads[1]); + vm->add_history(1, hostnames[1], vm_dirs[1], vmm_mads[1], vnm_mads[1], tm_mads[1]); rc = vmp->update(vm); CPPUNIT_ASSERT( rc == 0 ); @@ -351,7 +352,7 @@ public: CPPUNIT_ASSERT( rc == 0 ); // Add another history item - vm->add_history(2, hostnames[2], vm_dirs[2], vmm_mads[2], tm_mads[2]); + vm->add_history(2, hostnames[2], vm_dirs[2], vmm_mads[2], vnm_mads[2], tm_mads[2]); rc = vmp->update(vm); CPPUNIT_ASSERT( rc == 0 ); @@ -408,6 +409,7 @@ public: string new_hostname = "new_hostname"; string vm_dir = "vm_dir"; string vmm_mad = "vm_mad"; + string vnm_mad = "vn_mad"; string tm_mad = "tm_mad"; // Allocate a VM @@ -418,7 +420,7 @@ public: CPPUNIT_ASSERT( vm != 0 ); // Add a history item - vm->add_history(0, hostname, vm_dir, vmm_mad, tm_mad); + vm->add_history(0, hostname, vm_dir, vmm_mad, vnm_mad, tm_mad); rc = vmp->update(vm); CPPUNIT_ASSERT( rc == 0 ); @@ -426,7 +428,7 @@ public: rc = vmp->update_history(vm); CPPUNIT_ASSERT( rc == 0 ); - vm->add_history(0, new_hostname, vm_dir, vmm_mad, tm_mad); + vm->add_history(0, new_hostname, vm_dir, vmm_mad, vnm_mad, tm_mad); rc = vmp->update(vm); CPPUNIT_ASSERT( rc == 0 ); From 1788425c94663bb55140dc03132b69a7f1acf2a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 10 Nov 2011 18:27:04 +0100 Subject: [PATCH 005/157] Feature #863: Add new vn_mad to ruby oca and onehost command --- src/cli/one_helper/onehost_helper.rb | 1 + src/cli/onehost | 5 +++-- src/oca/ruby/OpenNebula/Host.rb | 16 ++++++++-------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/cli/one_helper/onehost_helper.rb b/src/cli/one_helper/onehost_helper.rb index 2a23aab046..d517978664 100644 --- a/src/cli/one_helper/onehost_helper.rb +++ b/src/cli/one_helper/onehost_helper.rb @@ -59,6 +59,7 @@ class OneHostHelper < OpenNebulaHelper::OneHelper puts str % ["STATE", host.state_str] puts str % ["IM_MAD", host['IM_MAD']] puts str % ["VM_MAD", host['VM_MAD']] + puts str % ["VN_MAD", host['VN_MAD']] puts str % ["TM_MAD", host['TM_MAD']] puts diff --git a/src/cli/onehost b/src/cli/onehost index 6f7b5f5c81..adf060ba36 100755 --- a/src/cli/onehost +++ b/src/cli/onehost @@ -60,9 +60,10 @@ cmd=CommandParser::CmdParser.new(ARGV) do Creates a new Host EOT - command :create, create_desc, :hostname, :im_mad, :vmm_mad, :tm_mad do + command :create, create_desc, :hostname, :im_mad, :vmm_mad, :vnm_mad, + :tm_mad do helper.create_resource(options) do |host| - host.allocate(args[0], args[1], args[2], args[3]) + host.allocate(args[0], args[1], args[2], args[3], args[4]) end end diff --git a/src/oca/ruby/OpenNebula/Host.rb b/src/oca/ruby/OpenNebula/Host.rb index 24f205663c..7a66b9ee86 100644 --- a/src/oca/ruby/OpenNebula/Host.rb +++ b/src/oca/ruby/OpenNebula/Host.rb @@ -78,15 +78,15 @@ module OpenNebula # Allocates a new Host in OpenNebula # - # +hostname+ A string containing the name of the new Host. + # @param hostname [String] Name of the new Host. + # @param im [String] Name of the im_driver + # @param vmm [String] Name of the vmm_driver + # @param tm [String] Name of the tm_driver # - # +im+ A string containing the name of the im_driver - # - # +vmm+ A string containing the name of the vmm_driver - # - # +tm+ A string containing the name of the tm_driver - def allocate(hostname,im,vmm,tm) - super(HOST_METHODS[:allocate],hostname,im,vmm,tm) + # @return [Integer, OpenNebula::Error] the new VM ID in case of + # success, error otherwise + def allocate(hostname,im,vmm,vnm,tm) + super(HOST_METHODS[:allocate],hostname,im,vmm,vnm,tm) end # Deletes the Host From 50bb7f3ed410c9397cd62f1befed8e3c2f23a77e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 10 Nov 2011 18:51:08 +0100 Subject: [PATCH 006/157] Feature #863: Add new vn_mad to java oca --- src/oca/java/src/org/opennebula/client/host/Host.java | 6 +++++- src/oca/java/test/HostTest.java | 6 ++++-- src/oca/java/test/VirtualMachineTest.java | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/oca/java/src/org/opennebula/client/host/Host.java b/src/oca/java/src/org/opennebula/client/host/Host.java index 20a82df64b..0cc9d646d7 100644 --- a/src/oca/java/src/org/opennebula/client/host/Host.java +++ b/src/oca/java/src/org/opennebula/client/host/Host.java @@ -72,6 +72,9 @@ public class Host extends PoolElement{ * @param vmm The name of the virtual machine manager mad name * (vmm_mad_name), this values are taken from the oned.conf with the * tag name VM_MAD (name) + * @param vnm The name of the virtual network manager mad name + * (vnm_mad_name), this values are taken from the oned.conf with the + * tag name VN_MAD (name) * @param tm The transfer manager mad name to be used with this host * @return If successful the message contains the associated * id generated for this host @@ -80,9 +83,10 @@ public class Host extends PoolElement{ String hostname, String im, String vmm, + String vnm, String tm) { - return client.call(ALLOCATE, hostname, im, vmm, tm); + return client.call(ALLOCATE, hostname, im, vmm, vnm, tm); } /** diff --git a/src/oca/java/test/HostTest.java b/src/oca/java/test/HostTest.java index 81f1878b6a..dfb58022fc 100644 --- a/src/oca/java/test/HostTest.java +++ b/src/oca/java/test/HostTest.java @@ -63,7 +63,8 @@ public class HostTest @Before public void setUp() throws Exception { - res = Host.allocate(client, name, "im_dummy", "vmm_dummy", "tm_dummy"); + res = Host.allocate(client, name, "im_dummy", "vmm_dummy", "vnm_dummy", + "tm_dummy"); int hid = !res.isError() ? Integer.parseInt(res.getMessage()) : -1; host = new Host(hid, client); @@ -83,7 +84,8 @@ public class HostTest { String name = "allocate_test"; - res = Host.allocate(client, name, "im_dummy", "vmm_dummy", "tm_dummy"); + res = Host.allocate(client, name, "im_dummy", "vmm_dummy", "vmm_dummy", + "tm_dummy"); assertTrue( !res.isError() ); // assertTrue( res.getMessage().equals("0") ); diff --git a/src/oca/java/test/VirtualMachineTest.java b/src/oca/java/test/VirtualMachineTest.java index 115042df16..1f2bacd492 100644 --- a/src/oca/java/test/VirtualMachineTest.java +++ b/src/oca/java/test/VirtualMachineTest.java @@ -80,11 +80,11 @@ public class VirtualMachineTest res = Host.allocate(client, "host_A", - "im_dummy", "vmm_dummy", "tm_dummy"); + "im_dummy", "vmm_dummy", "vmm_dummy", "tm_dummy"); hid_A = Integer.parseInt( res.getMessage() ); res = Host.allocate(client, "host_B", - "im_dummy", "vmm_dummy", "tm_dummy"); + "im_dummy", "vmm_dummy", "vmm_dummy", "tm_dummy"); hid_B = Integer.parseInt( res.getMessage() ); } From fbcc340c8ae5a2050ce105a282d9870eb77e1fce Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Thu, 10 Nov 2011 22:53:39 +0100 Subject: [PATCH 007/157] feature #863: change prototype for vnm_mad functions --- include/VirtualMachine.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/VirtualMachine.h b/include/VirtualMachine.h index 357ccb75a1..159d7b34e0 100644 --- a/include/VirtualMachine.h +++ b/include/VirtualMachine.h @@ -279,8 +279,7 @@ public: * function MUST be called before this one. * @return the VMM mad name */ - // const string & get_vnm_mad() const - string get_vnm_mad() const + const string & get_vnm_mad() const { return history->vnm_mad_name; }; @@ -290,8 +289,7 @@ public: * function MUST be called before this one. * @return the VMM mad name */ - // const string & get_previous_vnm_mad() const - string get_previous_vnm_mad() const + const string & get_previous_vnm_mad() const { return previous_history->vnm_mad_name; }; From f74108e4ebcc67b6ede41ce02d3c14c9fcdab81e Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Thu, 10 Nov 2011 23:15:04 +0100 Subject: [PATCH 008/157] feature #863: uses VM xml instead of just the template for deploy --- src/vmm/VirtualMachineManager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vmm/VirtualMachineManager.cc b/src/vmm/VirtualMachineManager.cc index d7a8720bfc..04919e8903 100644 --- a/src/vmm/VirtualMachineManager.cc +++ b/src/vmm/VirtualMachineManager.cc @@ -360,7 +360,7 @@ void VirtualMachineManager::deploy_action(int vid) "", vm->get_remote_deployment_file(), "", - vm->template_to_xml(vm_tmpl)); + vm->to_xml(vm_tmpl)); vmd->deploy(vid, *drv_msg); From a06b5f84d06b98b669b4ba94eb045d719a77d417 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Thu, 10 Nov 2011 23:35:12 +0100 Subject: [PATCH 009/157] Feature: Enable use of user metadata in context --- src/template/template_syntax.cc | 462 ++++++++++++++++------------- src/template/template_syntax.h | 13 +- src/vm/vm_var_syntax.cc | 477 +++++++++++++++++------------- src/vm/vm_var_syntax.h | 15 +- src/vm/vm_var_syntax.y | 17 +- src/xml/expr_arith.cc | 474 ++++++++++++++++-------------- src/xml/expr_arith.h | 13 +- src/xml/expr_bool.cc | 494 ++++++++++++++++++-------------- src/xml/expr_bool.h | 13 +- 9 files changed, 1100 insertions(+), 878 deletions(-) diff --git a/src/template/template_syntax.cc b/src/template/template_syntax.cc index 3aadc30534..3b547760de 100644 --- a/src/template/template_syntax.cc +++ b/src/template/template_syntax.cc @@ -1,9 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.4.2. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software - Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.2" +#define YYBISON_VERSION "2.5" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -74,7 +73,7 @@ /* Copy the first part of user declarations. */ -/* Line 189 of yacc.c */ +/* Line 268 of yacc.c */ #line 17 "template_syntax.y" #include @@ -127,8 +126,8 @@ extern "C" -/* Line 189 of yacc.c */ -#line 132 "template_syntax.cc" +/* Line 268 of yacc.c */ +#line 131 "template_syntax.cc" /* Enabling traces. */ #ifndef YYDEBUG @@ -171,7 +170,7 @@ extern "C" typedef union YYSTYPE { -/* Line 214 of yacc.c */ +/* Line 293 of yacc.c */ #line 74 "template_syntax.y" char * val_str; @@ -179,8 +178,8 @@ typedef union YYSTYPE -/* Line 214 of yacc.c */ -#line 184 "template_syntax.cc" +/* Line 293 of yacc.c */ +#line 183 "template_syntax.cc" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -204,8 +203,8 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ -/* Line 264 of yacc.c */ -#line 209 "template_syntax.cc" +/* Line 343 of yacc.c */ +#line 208 "template_syntax.cc" #ifdef short # undef short @@ -308,11 +307,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # endif @@ -335,24 +334,24 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined _STDLIB_H \ +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -383,23 +382,7 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM) -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif +# define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of @@ -419,6 +402,26 @@ union yyalloc #endif +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + /* YYFINAL -- State number of the termination state. */ #define YYFINAL 6 /* YYLAST -- Last index in YYTABLE. */ @@ -528,8 +531,8 @@ static const yytype_uint8 yyr2[] = 0, 2, 1, 2, 3, 5, 2, 3, 5 }; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { @@ -560,8 +563,7 @@ static const yytype_int8 yypgoto[] = /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ + number is the opposite. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { @@ -569,6 +571,12 @@ static const yytype_uint8 yytable[] = 12, 15, 17, 16, 18, 7 }; +#define yypact_value_is_default(yystate) \ + ((yystate) == (-8)) + +#define yytable_value_is_error(yytable_value) \ + YYID (0) + static const yytype_uint8 yycheck[] = { 0, 3, 9, 9, 5, 7, 4, 8, 6, 9, @@ -616,7 +624,6 @@ do \ { \ yychar = (Token); \ yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ @@ -880,7 +887,6 @@ int yydebug; # define YYMAXDEPTH 10000 #endif - #if YYERROR_VERBOSE @@ -983,115 +989,142 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) { - int yyn = yypact[yystate]; + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = 0; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else + /* There are many possibilities here to consider: + - Assume YYFAIL is not used. It's too flawed to consider. See + + for details. YYERROR is fine as it does not invoke this + function. + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; } #endif /* YYERROR_VERBOSE */ - /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -1132,6 +1165,7 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, mc, tmpl, error_msg) } } + /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus @@ -1148,12 +1182,9 @@ int yyparse (); #endif /* ! YYPARSE_PARAM */ - - - -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ +/*----------. +| yyparse. | +`----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1219,7 +1250,7 @@ YYLTYPE yylloc; YYLTYPE *yylsp; /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[2]; + YYLTYPE yyerror_range[3]; YYSIZE_T yystacksize; @@ -1368,7 +1399,7 @@ yybackup: /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ @@ -1399,8 +1430,8 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; + if (yytable_value_is_error (yyn)) + goto yyerrlab; yyn = -yyn; goto yyreduce; } @@ -1456,7 +1487,7 @@ yyreduce: { case 4: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 99 "template_syntax.y" { Attribute * pattr; @@ -1466,12 +1497,12 @@ yyreduce: pattr = new SingleAttribute(name,unescape(value)); tmpl->set(pattr); - ;} + } break; case 5: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 109 "template_syntax.y" { Attribute * pattr; @@ -1484,12 +1515,12 @@ yyreduce: tmpl->set(pattr); delete amap; - ;} + } break; case 6: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 122 "template_syntax.y" { Attribute * pattr; @@ -1499,12 +1530,12 @@ yyreduce: pattr = new SingleAttribute(name,value); tmpl->set(pattr); - ;} + } break; case 7: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 134 "template_syntax.y" { map* vattr; @@ -1517,12 +1548,12 @@ yyreduce: vattr->insert(make_pair(name,unescape(value))); (yyval.val_attr) = static_cast(vattr); - ;} + } break; case 8: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 147 "template_syntax.y" { string name((yyvsp[(3) - (5)].val_str)); @@ -1535,15 +1566,26 @@ yyreduce: attrmap->insert(make_pair(name,unescape(value))); (yyval.val_attr) = (yyvsp[(1) - (5)].val_attr); - ;} + } break; -/* Line 1464 of yacc.c */ -#line 1545 "template_syntax.cc" +/* Line 1806 of yacc.c */ +#line 1576 "template_syntax.cc" default: break; } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -1572,6 +1614,10 @@ yyreduce: | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -1579,41 +1625,40 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (&yylloc, mc, tmpl, error_msg, YY_("syntax error")); #else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (&yylloc, mc, tmpl, error_msg, yymsg); - } - else - { - yyerror (&yylloc, mc, tmpl, error_msg, YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (&yylloc, mc, tmpl, error_msg, yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; } +# undef YYSYNTAX_ERROR #endif } - yyerror_range[0] = yylloc; + yyerror_range[1] = yylloc; if (yyerrstatus == 3) { @@ -1650,7 +1695,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - yyerror_range[0] = yylsp[1-yylen]; + yyerror_range[1] = yylsp[1-yylen]; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); @@ -1669,7 +1714,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) + if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -1684,7 +1729,7 @@ yyerrlab1: if (yyssp == yyss) YYABORT; - yyerror_range[0] = *yylsp; + yyerror_range[1] = *yylsp; yydestruct ("Error: popping", yystos[yystate], yyvsp, yylsp, mc, tmpl, error_msg); YYPOPSTACK (1); @@ -1694,10 +1739,10 @@ yyerrlab1: *++yyvsp = yylval; - yyerror_range[1] = yylloc; + yyerror_range[2] = yylloc; /* Using YYLLOC is tempting, but would change the location of the lookahead. YYLOC is available though. */ - YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); + YYLLOC_DEFAULT (yyloc, yyerror_range, 2); *++yylsp = yyloc; /* Shift the error token. */ @@ -1733,8 +1778,13 @@ yyexhaustedlab: yyreturn: if (yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, &yylloc, mc, tmpl, error_msg); + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, &yylloc, mc, tmpl, error_msg); + } /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -1759,7 +1809,7 @@ yyreturn: -/* Line 1684 of yacc.c */ +/* Line 2067 of yacc.c */ #line 160 "template_syntax.y" diff --git a/src/template/template_syntax.h b/src/template/template_syntax.h index dcef6a9d96..aa9ae6b64b 100644 --- a/src/template/template_syntax.h +++ b/src/template/template_syntax.h @@ -1,9 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.4.2. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton interface for Bison's Yacc-like parsers in C +/* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software - Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -54,7 +53,7 @@ typedef union YYSTYPE { -/* Line 1685 of yacc.c */ +/* Line 2068 of yacc.c */ #line 74 "template_syntax.y" char * val_str; @@ -62,8 +61,8 @@ typedef union YYSTYPE -/* Line 1685 of yacc.c */ -#line 67 "template_syntax.hh" +/* Line 2068 of yacc.c */ +#line 66 "template_syntax.hh" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/src/vm/vm_var_syntax.cc b/src/vm/vm_var_syntax.cc index 30866385ae..6a75d06320 100644 --- a/src/vm/vm_var_syntax.cc +++ b/src/vm/vm_var_syntax.cc @@ -1,9 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.4.3. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.3" +#define YYBISON_VERSION "2.5" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -74,7 +73,7 @@ /* Copy the first part of user declarations. */ -/* Line 189 of yacc.c */ +/* Line 268 of yacc.c */ #line 17 "vm_var_syntax.y" #include @@ -307,7 +306,7 @@ void get_network_attribute(VirtualMachine * vm, /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -/* + void get_user_attribute(VirtualMachine * vm, const string& attr_name, string& attr_value) @@ -337,7 +336,7 @@ void get_user_attribute(VirtualMachine * vm, user->unlock(); } -*/ + /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ @@ -408,6 +407,19 @@ void insert_vector(VirtualMachine * vm, return; } + else if (name == "USER") + { + string value; + + get_user_attribute(vm, vname, value); + + if (!value.empty()) + { + parsed << value; + } + + return; + } else { if ( ( num = vm->get_template_attribute(name.c_str(),values) ) <= 0 ) @@ -447,8 +459,8 @@ void insert_vector(VirtualMachine * vm, -/* Line 189 of yacc.c */ -#line 452 "vm_var_syntax.cc" +/* Line 268 of yacc.c */ +#line 464 "vm_var_syntax.cc" /* Enabling traces. */ #ifndef YYDEBUG @@ -493,8 +505,8 @@ void insert_vector(VirtualMachine * vm, typedef union YYSTYPE { -/* Line 214 of yacc.c */ -#line 395 "vm_var_syntax.y" +/* Line 293 of yacc.c */ +#line 408 "vm_var_syntax.y" char * val_str; int val_int; @@ -502,8 +514,8 @@ typedef union YYSTYPE -/* Line 214 of yacc.c */ -#line 507 "vm_var_syntax.cc" +/* Line 293 of yacc.c */ +#line 519 "vm_var_syntax.cc" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -527,8 +539,8 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ -/* Line 264 of yacc.c */ -#line 532 "vm_var_syntax.cc" +/* Line 343 of yacc.c */ +#line 544 "vm_var_syntax.cc" #ifdef short # undef short @@ -631,11 +643,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # endif @@ -658,24 +670,24 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined _STDLIB_H \ +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -706,23 +718,7 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM) -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif +# define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of @@ -742,6 +738,26 @@ union yyalloc #endif +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + /* YYFINAL -- State number of the termination state. */ #define YYFINAL 7 /* YYLAST -- Last index in YYTABLE. */ @@ -814,7 +830,7 @@ static const yytype_int8 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 419, 419, 420, 423, 427, 440, 455 + 0, 432, 432, 433, 436, 440, 453, 468 }; #endif @@ -851,8 +867,8 @@ static const yytype_uint8 yyr2[] = 0, 2, 1, 2, 1, 2, 5, 9 }; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { @@ -883,8 +899,7 @@ static const yytype_int8 yypgoto[] = /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ + number is the opposite. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { @@ -892,6 +907,12 @@ static const yytype_uint8 yytable[] = 2, 12, 13, 14, 15, 16, 8, 0, 17 }; +#define yypact_value_is_default(yystate) \ + ((yystate) == (-5)) + +#define yytable_value_is_error(yytable_value) \ + YYID (0) + static const yytype_int8 yycheck[] = { 0, 5, 4, 7, 6, -1, 9, 10, 9, 9, @@ -939,7 +960,6 @@ do \ { \ yychar = (Token); \ yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ @@ -1207,7 +1227,6 @@ int yydebug; # define YYMAXDEPTH 10000 #endif - #if YYERROR_VERBOSE @@ -1310,115 +1329,142 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) { - int yyn = yypact[yystate]; + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = 0; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else + /* There are many possibilities here to consider: + - Assume YYFAIL is not used. It's too flawed to consider. See + + for details. YYERROR is fine as it does not invoke this + function. + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; } #endif /* YYERROR_VERBOSE */ - /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -1461,6 +1507,7 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, mc, vm, parsed, errmsg) } } + /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus @@ -1477,12 +1524,9 @@ int yyparse (); #endif /* ! YYPARSE_PARAM */ - - - -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ +/*----------. +| yyparse. | +`----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1698,7 +1742,7 @@ yybackup: /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ @@ -1729,8 +1773,8 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; + if (yytable_value_is_error (yyn)) + goto yyerrlab; yyn = -yyn; goto yyreduce; } @@ -1786,17 +1830,17 @@ yyreduce: { case 4: -/* Line 1464 of yacc.c */ -#line 424 "vm_var_syntax.y" +/* Line 1806 of yacc.c */ +#line 437 "vm_var_syntax.y" { (*parsed) << (yyvsp[(1) - (1)].val_str); - ;} + } break; case 5: -/* Line 1464 of yacc.c */ -#line 428 "vm_var_syntax.y" +/* Line 1806 of yacc.c */ +#line 441 "vm_var_syntax.y" { string name((yyvsp[(1) - (2)].val_str)); @@ -1808,13 +1852,13 @@ yyreduce: { (*parsed) << (yyvsp[(2) - (2)].val_char); } - ;} + } break; case 6: -/* Line 1464 of yacc.c */ -#line 441 "vm_var_syntax.y" +/* Line 1806 of yacc.c */ +#line 454 "vm_var_syntax.y" { string name((yyvsp[(1) - (5)].val_str)); string vname((yyvsp[(3) - (5)].val_str)); @@ -1828,13 +1872,13 @@ yyreduce: { (*parsed) << (yyvsp[(5) - (5)].val_char); } - ;} + } break; case 7: -/* Line 1464 of yacc.c */ -#line 456 "vm_var_syntax.y" +/* Line 1806 of yacc.c */ +#line 469 "vm_var_syntax.y" { string name((yyvsp[(1) - (9)].val_str)); string vname((yyvsp[(3) - (9)].val_str)); @@ -1851,15 +1895,26 @@ yyreduce: { (*parsed) << (yyvsp[(9) - (9)].val_char); } - ;} + } break; -/* Line 1464 of yacc.c */ -#line 1861 "vm_var_syntax.cc" +/* Line 1806 of yacc.c */ +#line 1905 "vm_var_syntax.cc" default: break; } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -1888,6 +1943,10 @@ yyreduce: | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -1895,37 +1954,36 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (&yylloc, mc, vm, parsed, errmsg, YY_("syntax error")); #else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (&yylloc, mc, vm, parsed, errmsg, yymsg); - } - else - { - yyerror (&yylloc, mc, vm, parsed, errmsg, YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (&yylloc, mc, vm, parsed, errmsg, yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; } +# undef YYSYNTAX_ERROR #endif } @@ -1985,7 +2043,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) + if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -2049,8 +2107,13 @@ yyexhaustedlab: yyreturn: if (yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, &yylloc, mc, vm, parsed, errmsg); + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, &yylloc, mc, vm, parsed, errmsg); + } /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -2075,8 +2138,8 @@ yyreturn: -/* Line 1684 of yacc.c */ -#line 474 "vm_var_syntax.y" +/* Line 2067 of yacc.c */ +#line 487 "vm_var_syntax.y" extern "C" void vm_var__error( diff --git a/src/vm/vm_var_syntax.h b/src/vm/vm_var_syntax.h index 8d099c1d0a..d40f8d1d51 100644 --- a/src/vm/vm_var_syntax.h +++ b/src/vm/vm_var_syntax.h @@ -1,9 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.4.3. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton interface for Bison's Yacc-like parsers in C +/* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -56,8 +55,8 @@ typedef union YYSTYPE { -/* Line 1685 of yacc.c */ -#line 395 "vm_var_syntax.y" +/* Line 2068 of yacc.c */ +#line 408 "vm_var_syntax.y" char * val_str; int val_int; @@ -65,8 +64,8 @@ typedef union YYSTYPE -/* Line 1685 of yacc.c */ -#line 70 "vm_var_syntax.hh" +/* Line 2068 of yacc.c */ +#line 69 "vm_var_syntax.hh" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/src/vm/vm_var_syntax.y b/src/vm/vm_var_syntax.y index ae83471f07..bd75e41a02 100644 --- a/src/vm/vm_var_syntax.y +++ b/src/vm/vm_var_syntax.y @@ -245,7 +245,7 @@ void get_network_attribute(VirtualMachine * vm, /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -/* + void get_user_attribute(VirtualMachine * vm, const string& attr_name, string& attr_value) @@ -275,7 +275,7 @@ void get_user_attribute(VirtualMachine * vm, user->unlock(); } -*/ + /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ @@ -346,6 +346,19 @@ void insert_vector(VirtualMachine * vm, return; } + else if (name == "USER") + { + string value; + + get_user_attribute(vm, vname, value); + + if (!value.empty()) + { + parsed << value; + } + + return; + } else { if ( ( num = vm->get_template_attribute(name.c_str(),values) ) <= 0 ) diff --git a/src/xml/expr_arith.cc b/src/xml/expr_arith.cc index b8c9394fbf..a27aa8c15b 100644 --- a/src/xml/expr_arith.cc +++ b/src/xml/expr_arith.cc @@ -1,9 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.4.3. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.3" +#define YYBISON_VERSION "2.5" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -74,7 +73,7 @@ /* Copy the first part of user declarations. */ -/* Line 189 of yacc.c */ +/* Line 268 of yacc.c */ #line 17 "expr_arith.y" #include @@ -130,8 +129,8 @@ extern "C" -/* Line 189 of yacc.c */ -#line 135 "expr_arith.cc" +/* Line 268 of yacc.c */ +#line 134 "expr_arith.cc" /* Enabling traces. */ #ifndef YYDEBUG @@ -170,7 +169,7 @@ extern "C" typedef union YYSTYPE { -/* Line 214 of yacc.c */ +/* Line 293 of yacc.c */ #line 78 "expr_arith.y" char * val_str; @@ -179,8 +178,8 @@ typedef union YYSTYPE -/* Line 214 of yacc.c */ -#line 184 "expr_arith.cc" +/* Line 293 of yacc.c */ +#line 183 "expr_arith.cc" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -204,8 +203,8 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ -/* Line 264 of yacc.c */ -#line 209 "expr_arith.cc" +/* Line 343 of yacc.c */ +#line 208 "expr_arith.cc" #ifdef short # undef short @@ -308,11 +307,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # endif @@ -335,24 +334,24 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined _STDLIB_H \ +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -383,23 +382,7 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM) -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif +# define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of @@ -419,6 +402,26 @@ union yyalloc #endif +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + /* YYFINAL -- State number of the termination state. */ #define YYFINAL 10 /* YYLAST -- Last index in YYTABLE. */ @@ -532,8 +535,8 @@ static const yytype_uint8 yyr2[] = 3, 2, 3 }; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { @@ -564,8 +567,7 @@ static const yytype_int8 yypgoto[] = /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ + number is the opposite. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { @@ -574,6 +576,12 @@ static const yytype_uint8 yytable[] = 4, 5, 11, 12, 13, 14 }; +#define yypact_value_is_default(yystate) \ + ((yystate) == (-5)) + +#define yytable_value_is_error(yytable_value) \ + YYID (0) + static const yytype_int8 yycheck[] = { 1, 5, 6, -1, 5, 0, 3, 4, 5, 6, @@ -622,7 +630,6 @@ do \ { \ yychar = (Token); \ yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ @@ -890,7 +897,6 @@ int yydebug; # define YYMAXDEPTH 10000 #endif - #if YYERROR_VERBOSE @@ -993,115 +999,142 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) { - int yyn = yypact[yystate]; + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = 0; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else + /* There are many possibilities here to consider: + - Assume YYFAIL is not used. It's too flawed to consider. See + + for details. YYERROR is fine as it does not invoke this + function. + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; } #endif /* YYERROR_VERBOSE */ - /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -1144,6 +1177,7 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, mc, oxml, result, error_msg) } } + /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus @@ -1160,12 +1194,9 @@ int yyparse (); #endif /* ! YYPARSE_PARAM */ - - - -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ +/*----------. +| yyparse. | +`----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1381,7 +1412,7 @@ yybackup: /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ @@ -1412,8 +1443,8 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; + if (yytable_value_is_error (yyn)) + goto yyerrlab; yyn = -yyn; goto yyreduce; } @@ -1469,21 +1500,21 @@ yyreduce: { case 2: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 100 "expr_arith.y" - { result = static_cast((yyvsp[(1) - (1)].val_float));;} + { result = static_cast((yyvsp[(1) - (1)].val_float));} break; case 3: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 101 "expr_arith.y" - { result = 0; ;} + { result = 0; } break; case 4: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 104 "expr_arith.y" { float val = 0.0; @@ -1509,71 +1540,82 @@ yyreduce: } (yyval.val_float) = val; - ;} + } break; case 5: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 129 "expr_arith.y" - { (yyval.val_float) = (yyvsp[(1) - (1)].val_float); ;} + { (yyval.val_float) = (yyvsp[(1) - (1)].val_float); } break; case 6: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 130 "expr_arith.y" - { (yyval.val_float) = static_cast((yyvsp[(1) - (1)].val_int)); ;} + { (yyval.val_float) = static_cast((yyvsp[(1) - (1)].val_int)); } break; case 7: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 131 "expr_arith.y" - { (yyval.val_float) = (yyvsp[(1) - (3)].val_float) + (yyvsp[(3) - (3)].val_float);;} + { (yyval.val_float) = (yyvsp[(1) - (3)].val_float) + (yyvsp[(3) - (3)].val_float);} break; case 8: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 132 "expr_arith.y" - { (yyval.val_float) = (yyvsp[(1) - (3)].val_float) - (yyvsp[(3) - (3)].val_float);;} + { (yyval.val_float) = (yyvsp[(1) - (3)].val_float) - (yyvsp[(3) - (3)].val_float);} break; case 9: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 133 "expr_arith.y" - { (yyval.val_float) = (yyvsp[(1) - (3)].val_float) * (yyvsp[(3) - (3)].val_float);;} + { (yyval.val_float) = (yyvsp[(1) - (3)].val_float) * (yyvsp[(3) - (3)].val_float);} break; case 10: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 134 "expr_arith.y" - { (yyval.val_float) = (yyvsp[(1) - (3)].val_float) / (yyvsp[(3) - (3)].val_float);;} + { (yyval.val_float) = (yyvsp[(1) - (3)].val_float) / (yyvsp[(3) - (3)].val_float);} break; case 11: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 135 "expr_arith.y" - { (yyval.val_float) = - (yyvsp[(2) - (2)].val_float);;} + { (yyval.val_float) = - (yyvsp[(2) - (2)].val_float);} break; case 12: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 136 "expr_arith.y" - { (yyval.val_float) = (yyvsp[(2) - (3)].val_float);;} + { (yyval.val_float) = (yyvsp[(2) - (3)].val_float);} break; -/* Line 1464 of yacc.c */ -#line 1575 "expr_arith.cc" +/* Line 1806 of yacc.c */ +#line 1606 "expr_arith.cc" default: break; } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -1602,6 +1644,10 @@ yyreduce: | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -1609,37 +1655,36 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (&yylloc, mc, oxml, result, error_msg, YY_("syntax error")); #else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (&yylloc, mc, oxml, result, error_msg, yymsg); - } - else - { - yyerror (&yylloc, mc, oxml, result, error_msg, YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (&yylloc, mc, oxml, result, error_msg, yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; } +# undef YYSYNTAX_ERROR #endif } @@ -1699,7 +1744,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) + if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -1763,8 +1808,13 @@ yyexhaustedlab: yyreturn: if (yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, &yylloc, mc, oxml, result, error_msg); + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, &yylloc, mc, oxml, result, error_msg); + } /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -1789,7 +1839,7 @@ yyreturn: -/* Line 1684 of yacc.c */ +/* Line 2067 of yacc.c */ #line 139 "expr_arith.y" diff --git a/src/xml/expr_arith.h b/src/xml/expr_arith.h index 66cd7ebbb4..8dec688916 100644 --- a/src/xml/expr_arith.h +++ b/src/xml/expr_arith.h @@ -1,9 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.4.3. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton interface for Bison's Yacc-like parsers in C +/* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -50,7 +49,7 @@ typedef union YYSTYPE { -/* Line 1685 of yacc.c */ +/* Line 2068 of yacc.c */ #line 78 "expr_arith.y" char * val_str; @@ -59,8 +58,8 @@ typedef union YYSTYPE -/* Line 1685 of yacc.c */ -#line 64 "expr_arith.hh" +/* Line 2068 of yacc.c */ +#line 63 "expr_arith.hh" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/src/xml/expr_bool.cc b/src/xml/expr_bool.cc index 0d9c80598f..be3802607f 100644 --- a/src/xml/expr_bool.cc +++ b/src/xml/expr_bool.cc @@ -1,9 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.4.3. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.3" +#define YYBISON_VERSION "2.5" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -74,7 +73,7 @@ /* Copy the first part of user declarations. */ -/* Line 189 of yacc.c */ +/* Line 268 of yacc.c */ #line 17 "expr_bool.y" #include @@ -135,8 +134,8 @@ void get_xml_attribute(ObjectXML * oxml, const char* attr, string& val); -/* Line 189 of yacc.c */ -#line 140 "expr_bool.cc" +/* Line 268 of yacc.c */ +#line 139 "expr_bool.cc" /* Enabling traces. */ #ifndef YYDEBUG @@ -175,7 +174,7 @@ void get_xml_attribute(ObjectXML * oxml, const char* attr, string& val); typedef union YYSTYPE { -/* Line 214 of yacc.c */ +/* Line 293 of yacc.c */ #line 83 "expr_bool.y" char * val_str; @@ -184,8 +183,8 @@ typedef union YYSTYPE -/* Line 214 of yacc.c */ -#line 189 "expr_bool.cc" +/* Line 293 of yacc.c */ +#line 188 "expr_bool.cc" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -209,8 +208,8 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ -/* Line 264 of yacc.c */ -#line 214 "expr_bool.cc" +/* Line 343 of yacc.c */ +#line 213 "expr_bool.cc" #ifdef short # undef short @@ -313,11 +312,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # endif @@ -340,24 +339,24 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined _STDLIB_H \ +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -388,23 +387,7 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM) -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif +# define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of @@ -424,6 +407,26 @@ union yyalloc #endif +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + /* YYFINAL -- State number of the termination state. */ #define YYFINAL 12 /* YYLAST -- Last index in YYTABLE. */ @@ -540,8 +543,8 @@ static const yytype_uint8 yyr2[] = 3, 3, 3, 4, 3, 3, 2, 3 }; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { @@ -574,8 +577,7 @@ static const yytype_int8 yypgoto[] = /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ + number is the opposite. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { @@ -584,6 +586,12 @@ static const yytype_uint8 yytable[] = 16, 17, 18, 26, 27, 28, 19, 21, 20, 22 }; +#define yypact_value_is_default(yystate) \ + ((yystate) == (-6)) + +#define yytable_value_is_error(yytable_value) \ + YYID (0) + static const yytype_int8 yycheck[] = { 1, 3, 3, 0, 9, 7, 4, 5, 4, 5, @@ -633,7 +641,6 @@ do \ { \ yychar = (Token); \ yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ @@ -901,7 +908,6 @@ int yydebug; # define YYMAXDEPTH 10000 #endif - #if YYERROR_VERBOSE @@ -1004,115 +1010,142 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) { - int yyn = yypact[yystate]; + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = 0; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else + /* There are many possibilities here to consider: + - Assume YYFAIL is not used. It's too flawed to consider. See + + for details. YYERROR is fine as it does not invoke this + function. + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; } #endif /* YYERROR_VERBOSE */ - /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -1155,6 +1188,7 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, mc, oxml, result, error_msg) } } + /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus @@ -1171,12 +1205,9 @@ int yyparse (); #endif /* ! YYPARSE_PARAM */ - - - -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ +/*----------. +| yyparse. | +`----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1392,7 +1423,7 @@ yybackup: /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ @@ -1423,8 +1454,8 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; + if (yytable_value_is_error (yyn)) + goto yyerrlab; yyn = -yyn; goto yyreduce; } @@ -1480,152 +1511,163 @@ yyreduce: { case 2: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 103 "expr_bool.y" - { result=(yyvsp[(1) - (1)].val_int); ;} + { result=(yyvsp[(1) - (1)].val_int); } break; case 3: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 104 "expr_bool.y" - { result=true; ;} + { result=true; } break; case 4: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 107 "expr_bool.y" { int val; get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val); - (yyval.val_int) = val == (yyvsp[(3) - (3)].val_int);;} + (yyval.val_int) = val == (yyvsp[(3) - (3)].val_int);} break; case 5: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 112 "expr_bool.y" { int val; get_xml_attribute(oxml,(yyvsp[(1) - (4)].val_str),val); - (yyval.val_int) = val != (yyvsp[(4) - (4)].val_int);;} + (yyval.val_int) = val != (yyvsp[(4) - (4)].val_int);} break; case 6: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 117 "expr_bool.y" { int val; get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val); - (yyval.val_int) = val > (yyvsp[(3) - (3)].val_int);;} + (yyval.val_int) = val > (yyvsp[(3) - (3)].val_int);} break; case 7: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 122 "expr_bool.y" { int val; get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val); - (yyval.val_int) = val < (yyvsp[(3) - (3)].val_int);;} + (yyval.val_int) = val < (yyvsp[(3) - (3)].val_int);} break; case 8: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 127 "expr_bool.y" { float val; get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val); - (yyval.val_int) = val == (yyvsp[(3) - (3)].val_float);;} + (yyval.val_int) = val == (yyvsp[(3) - (3)].val_float);} break; case 9: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 132 "expr_bool.y" { float val; get_xml_attribute(oxml,(yyvsp[(1) - (4)].val_str),val); - (yyval.val_int) = val != (yyvsp[(4) - (4)].val_float);;} + (yyval.val_int) = val != (yyvsp[(4) - (4)].val_float);} break; case 10: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 137 "expr_bool.y" { float val; get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val); - (yyval.val_int) = val > (yyvsp[(3) - (3)].val_float);;} + (yyval.val_int) = val > (yyvsp[(3) - (3)].val_float);} break; case 11: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 142 "expr_bool.y" { float val; get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val); - (yyval.val_int) = val < (yyvsp[(3) - (3)].val_float);;} + (yyval.val_int) = val < (yyvsp[(3) - (3)].val_float);} break; case 12: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 147 "expr_bool.y" { string val; get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val); - (yyval.val_int) = (val.empty() || (yyvsp[(3) - (3)].val_str)==0) ? false : fnmatch((yyvsp[(3) - (3)].val_str),val.c_str(),0)==0;;} + (yyval.val_int) = (val.empty() || (yyvsp[(3) - (3)].val_str)==0) ? false : fnmatch((yyvsp[(3) - (3)].val_str),val.c_str(),0)==0;} break; case 13: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 152 "expr_bool.y" { string val; get_xml_attribute(oxml,(yyvsp[(1) - (4)].val_str),val); - (yyval.val_int) = (val.empty() || (yyvsp[(4) - (4)].val_str)==0) ? false : fnmatch((yyvsp[(4) - (4)].val_str),val.c_str(),0)!=0;;} + (yyval.val_int) = (val.empty() || (yyvsp[(4) - (4)].val_str)==0) ? false : fnmatch((yyvsp[(4) - (4)].val_str),val.c_str(),0)!=0;} break; case 14: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 157 "expr_bool.y" - { (yyval.val_int) = (yyvsp[(1) - (3)].val_int) && (yyvsp[(3) - (3)].val_int); ;} + { (yyval.val_int) = (yyvsp[(1) - (3)].val_int) && (yyvsp[(3) - (3)].val_int); } break; case 15: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 158 "expr_bool.y" - { (yyval.val_int) = (yyvsp[(1) - (3)].val_int) || (yyvsp[(3) - (3)].val_int); ;} + { (yyval.val_int) = (yyvsp[(1) - (3)].val_int) || (yyvsp[(3) - (3)].val_int); } break; case 16: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 159 "expr_bool.y" - { (yyval.val_int) = ! (yyvsp[(2) - (2)].val_int); ;} + { (yyval.val_int) = ! (yyvsp[(2) - (2)].val_int); } break; case 17: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 160 "expr_bool.y" - { (yyval.val_int) = (yyvsp[(2) - (3)].val_int); ;} + { (yyval.val_int) = (yyvsp[(2) - (3)].val_int); } break; -/* Line 1464 of yacc.c */ -#line 1627 "expr_bool.cc" +/* Line 1806 of yacc.c */ +#line 1658 "expr_bool.cc" default: break; } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -1654,6 +1696,10 @@ yyreduce: | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -1661,37 +1707,36 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (&yylloc, mc, oxml, result, error_msg, YY_("syntax error")); #else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (&yylloc, mc, oxml, result, error_msg, yymsg); - } - else - { - yyerror (&yylloc, mc, oxml, result, error_msg, YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (&yylloc, mc, oxml, result, error_msg, yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; } +# undef YYSYNTAX_ERROR #endif } @@ -1751,7 +1796,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) + if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -1815,8 +1860,13 @@ yyexhaustedlab: yyreturn: if (yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, &yylloc, mc, oxml, result, error_msg); + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, &yylloc, mc, oxml, result, error_msg); + } /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -1841,7 +1891,7 @@ yyreturn: -/* Line 1684 of yacc.c */ +/* Line 2067 of yacc.c */ #line 163 "expr_bool.y" diff --git a/src/xml/expr_bool.h b/src/xml/expr_bool.h index 3e0c95e1f6..0f561150f4 100644 --- a/src/xml/expr_bool.h +++ b/src/xml/expr_bool.h @@ -1,9 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.4.3. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton interface for Bison's Yacc-like parsers in C +/* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -50,7 +49,7 @@ typedef union YYSTYPE { -/* Line 1685 of yacc.c */ +/* Line 2068 of yacc.c */ #line 83 "expr_bool.y" char * val_str; @@ -59,8 +58,8 @@ typedef union YYSTYPE -/* Line 1685 of yacc.c */ -#line 64 "expr_bool.hh" +/* Line 2068 of yacc.c */ +#line 63 "expr_bool.hh" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ From 20f8b684e64fe63656a340b84459d959f2d54878 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Thu, 10 Nov 2011 23:45:20 +0100 Subject: [PATCH 010/157] Bug: Default sunstone server conf file cannot be parsed --- src/sunstone/etc/sunstone-server.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sunstone/etc/sunstone-server.conf b/src/sunstone/etc/sunstone-server.conf index 2311501782..b636b1480d 100644 --- a/src/sunstone/etc/sunstone-server.conf +++ b/src/sunstone/etc/sunstone-server.conf @@ -16,7 +16,7 @@ :core_auth: cipher # Life-time in seconds for token renewal (that used to handle OpenNebula auths) :token_expiration_delta: 1800 - + # VNC Configuration :vnc_proxy_base_port: 29876 :novnc_path: From 3eceea78c2df5f9f7bdec8c90cfc2c997ac3bdde Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Fri, 11 Nov 2011 00:43:46 +0100 Subject: [PATCH 011/157] feature #863: Dummy VM drivers updated --- src/vmm_mad/dummy/one_vmm_dummy.rb | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/vmm_mad/dummy/one_vmm_dummy.rb b/src/vmm_mad/dummy/one_vmm_dummy.rb index 1d7b84470b..dad6596de4 100755 --- a/src/vmm_mad/dummy/one_vmm_dummy.rb +++ b/src/vmm_mad/dummy/one_vmm_dummy.rb @@ -30,6 +30,8 @@ $: << RUBY_LIB_LOCATION require "VirtualMachineDriver" require "CommandManager" +require 'base64' +require 'rexml/document' class DummyDriver < VirtualMachineDriver def initialize @@ -39,31 +41,43 @@ class DummyDriver < VirtualMachineDriver ) end - def deploy(id, host, remote_dfile, not_used) - send_message(ACTION[:deploy],RESULT[:success],id,"dummy") + def decode(drv_msg) + message = Base64.decode64(drv_msg) + xml_doc = REXML::Document.new(message) + + xml_doc.root end - def shutdown(id, host, deploy_id, not_used) + def deploy(id, drv_msg) + msg = decode(drv_msg) + + host = msg.elements["HOST"].text + name = msg.elements["VM/NAME"].text + + send_message(ACTION[:deploy],RESULT[:success],id,"#{host}:#{name}:dummy") + end + + def shutdown(id, drv_message) send_message(ACTION[:shutdown],RESULT[:success],id) end - def cancel(id, host, deploy_id, not_used) + def cancel(id, drv_message) send_message(ACTION[:cancel],RESULT[:success],id) end - def save(id, host, deploy_id, file) + def save(id, drv_message) send_message(ACTION[:save],RESULT[:success],id) end - def restore(id, host, deploy_id , file) + def restore(id, drv_message) send_message(ACTION[:restore],RESULT[:success],id) end - def migrate(id, host, deploy_id, dest_host) + def migrate(id, drv_message) send_message(ACTION[:migrate],RESULT[:success],id) end - def poll(id, host, deploy_id, not_used) + def poll(id, drv_message) # monitor_info: string in the form "VAR=VAL VAR=VAL ... VAR=VAL" # known VAR are in POLL_ATTRIBUTES. VM states VM_STATES monitor_info = "#{POLL_ATTRIBUTE[:state]}=#{VM_STATE[:active]} " \ From 504f0f557d0c3cdc49abbabb2e983f96bb5907ca Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Fri, 11 Nov 2011 00:45:08 +0100 Subject: [PATCH 012/157] feature #863: Update VirtualMachine Driver base class to new protocol --- src/mad/ruby/VirtualMachineDriver.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mad/ruby/VirtualMachineDriver.rb b/src/mad/ruby/VirtualMachineDriver.rb index 06240a8ac1..fa3249824d 100644 --- a/src/mad/ruby/VirtualMachineDriver.rb +++ b/src/mad/ruby/VirtualMachineDriver.rb @@ -118,37 +118,37 @@ class VirtualMachineDriver < OpenNebulaDriver end # Virtual Machine Manager Protocol Actions (generic implementation) - def deploy(id, host, remote_dfile, not_used) + def deploy(id, drv_message) error = "Action not implemented by driver #{self.class}" send_message(ACTION[:deploy],RESULT[:failure],id,error) end - def shutdown(id, host, deploy_id, not_used) + def shutdown(id, drv_message) error = "Action not implemented by driver #{self.class}" send_message(ACTION[:shutdown],RESULT[:failure],id,error) end - def cancel(id, host, deploy_id, not_used) + def cancel(id, drv_message) error = "Action not implemented by driver #{self.class}" send_message(ACTION[:cancel],RESULT[:failure],id,error) end - def save(id, host, deploy_id, file) + def save(id, drv_message) error = "Action not implemented by driver #{self.class}" send_message(ACTION[:save],RESULT[:failure],id,error) end - def restore(id, host, deploy_id, file) + def restore(id, drv_message) error = "Action not implemented by driver #{self.class}" send_message(ACTION[:restore],RESULT[:failure],id,error) end - def migrate(id, host, deploy_id, dest_host) + def migrate(id, drv_message) error = "Action not implemented by driver #{self.class}" send_message(ACTION[:migrate],RESULT[:failure],id,error) end - def poll(id, host, deploy_id, not_used) + def poll(id, drv_message) error = "Action not implemented by driver #{self.class}" send_message(ACTION[:poll],RESULT[:failure],id,error) end From 744ab1faca2eea87fa41014d145b2e06f57c905b Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Fri, 11 Nov 2011 00:45:33 +0100 Subject: [PATCH 013/157] feature #863: Fix XML for the driver message --- include/VirtualMachineManager.h | 4 ++-- src/vmm/VirtualMachineManager.cc | 10 +++++----- src/vmm/VirtualMachineManagerDriver.cc | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/VirtualMachineManager.h b/include/VirtualMachineManager.h index 8df8df3b1e..1c41918288 100644 --- a/include/VirtualMachineManager.h +++ b/include/VirtualMachineManager.h @@ -185,9 +185,9 @@ private: * domain_id * dfile * cfile - * + * * VM representation in XML - * + * * * * @param hostname of the host to perform the action diff --git a/src/vmm/VirtualMachineManager.cc b/src/vmm/VirtualMachineManager.cc index 04919e8903..37539374a7 100644 --- a/src/vmm/VirtualMachineManager.cc +++ b/src/vmm/VirtualMachineManager.cc @@ -268,7 +268,7 @@ string * VirtualMachineManager::format_message( } else { - oss << ""; + oss << ""; } if (!domain.empty()) @@ -277,7 +277,7 @@ string * VirtualMachineManager::format_message( } else { - oss << ""; + oss << ""; } if (!dfile.empty()) @@ -286,7 +286,7 @@ string * VirtualMachineManager::format_message( } else { - oss << ""; + oss << ""; } if (!cfile.empty()) @@ -295,10 +295,10 @@ string * VirtualMachineManager::format_message( } else { - oss << ""; + oss << ""; } - oss << "" << tmpl << "" + oss << tmpl << ""; return SSLTools::base64_encode(oss.str()); diff --git a/src/vmm/VirtualMachineManagerDriver.cc b/src/vmm/VirtualMachineManagerDriver.cc index c186afd927..d20db0f5e0 100644 --- a/src/vmm/VirtualMachineManagerDriver.cc +++ b/src/vmm/VirtualMachineManagerDriver.cc @@ -109,7 +109,7 @@ void VirtualMachineManagerDriver::deploy ( ostringstream os; os << "DEPLOY " << oid << " " << drv_msg << endl; - + write(os); }; From 7efcb0e140c3fd6b1df878a9001c65003e3d8efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 11 Nov 2011 14:55:18 +0100 Subject: [PATCH 014/157] Feature #863: Small comment fix --- include/VirtualMachine.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/VirtualMachine.h b/include/VirtualMachine.h index 159d7b34e0..a375b97242 100644 --- a/include/VirtualMachine.h +++ b/include/VirtualMachine.h @@ -277,7 +277,7 @@ public: /** * Returns the VNM driver name for the current host. The hasHistory() * function MUST be called before this one. - * @return the VMM mad name + * @return the VNM mad name */ const string & get_vnm_mad() const { @@ -287,7 +287,7 @@ public: /** * Returns the VNM driver name for the previous host. The hasPreviousHistory() * function MUST be called before this one. - * @return the VMM mad name + * @return the VNM mad name */ const string & get_previous_vnm_mad() const { From bea7da7475f7c6ab9ecb0395d805526ba99fdd86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 11 Nov 2011 17:09:26 +0100 Subject: [PATCH 015/157] Feature #863: Change old net hooks to act as mad scripts --- src/vnm_mad/remotes/802.1Q/HostManaged.rb | 16 ++++++------ src/vnm_mad/remotes/802.1Q/clean | 19 ++++++++++++++ src/vnm_mad/remotes/802.1Q/post | 19 ++++++++++++++ src/vnm_mad/remotes/802.1Q/pre | 25 +++++++++++++++++++ src/vnm_mad/remotes/OpenNebulaNetwork.rb | 6 +++++ src/vnm_mad/remotes/dummy/clean | 19 ++++++++++++++ src/vnm_mad/remotes/dummy/post | 19 ++++++++++++++ src/vnm_mad/remotes/dummy/pre | 19 ++++++++++++++ src/vnm_mad/remotes/ebtables/Ebtables.rb | 12 +++++++-- .../{802.1Q/hm-vlan => ebtables/clean} | 11 ++++---- .../remotes/ebtables/{ebtables-vlan => post} | 18 +++---------- src/vnm_mad/remotes/ebtables/pre | 19 ++++++++++++++ src/vnm_mad/remotes/ovswtich/OpenvSwitch.rb | 6 ++++- src/vnm_mad/remotes/ovswtich/clean | 19 ++++++++++++++ .../ovswtich/{openvswitch-vlan => post} | 8 ++---- src/vnm_mad/remotes/ovswtich/pre | 19 ++++++++++++++ 16 files changed, 216 insertions(+), 38 deletions(-) create mode 100755 src/vnm_mad/remotes/802.1Q/clean create mode 100755 src/vnm_mad/remotes/802.1Q/post create mode 100755 src/vnm_mad/remotes/802.1Q/pre create mode 100755 src/vnm_mad/remotes/dummy/clean create mode 100755 src/vnm_mad/remotes/dummy/post create mode 100755 src/vnm_mad/remotes/dummy/pre rename src/vnm_mad/remotes/{802.1Q/hm-vlan => ebtables/clean} (89%) rename src/vnm_mad/remotes/ebtables/{ebtables-vlan => post} (80%) create mode 100755 src/vnm_mad/remotes/ebtables/pre create mode 100755 src/vnm_mad/remotes/ovswtich/clean rename src/vnm_mad/remotes/ovswtich/{openvswitch-vlan => post} (90%) create mode 100755 src/vnm_mad/remotes/ovswtich/pre diff --git a/src/vnm_mad/remotes/802.1Q/HostManaged.rb b/src/vnm_mad/remotes/802.1Q/HostManaged.rb index bda6286ef1..631d4ec2dc 100644 --- a/src/vnm_mad/remotes/802.1Q/HostManaged.rb +++ b/src/vnm_mad/remotes/802.1Q/HostManaged.rb @@ -14,6 +14,8 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +require 'OpenNebulaNetwork' + class OpenNebulaHM < OpenNebulaNetwork def initialize(vm, hypervisor = nil) super(vm,hypervisor) @@ -48,12 +50,8 @@ class OpenNebulaHM < OpenNebulaNetwork end end end - end - def deactivate - vm_id = @vm['ID'] - process do |nic| - end + return 0 end def bridge_exists?(bridge) @@ -61,7 +59,7 @@ class OpenNebulaHM < OpenNebulaNetwork end def create_bridge(bridge) - system("#{COMMANDS[:brctl]} addbr #{bridge}") + exec_and_log("#{COMMANDS[:brctl]} addbr #{bridge}") end def device_exists?(dev, vlan=nil) @@ -70,7 +68,7 @@ class OpenNebulaHM < OpenNebulaNetwork end def create_dev_vlan(dev, vlan) - system("#{COMMANDS[:vconfig]} add #{dev} #{vlan}") + exec_and_log("#{COMMANDS[:vconfig]} add #{dev} #{vlan}") end def attached_bridge_dev?(bridge, dev, vlan=nil) @@ -81,11 +79,11 @@ class OpenNebulaHM < OpenNebulaNetwork def attach_brigde_dev(bridge, dev, vlan=nil) dev = "#{dev}.#{vlan}" if vlan - system("#{COMMANDS[:brctl]} addif #{bridge} #{dev}") + exec_and_log("#{COMMANDS[:brctl]} addif #{bridge} #{dev}") end def ifup(dev, vlan=nil) dev = "#{dev}.#{vlan}" if vlan - system("#{COMMANDS[:ip]} link set #{dev} up") + exec_and_log("#{COMMANDS[:ip]} link set #{dev} up") end end diff --git a/src/vnm_mad/remotes/802.1Q/clean b/src/vnm_mad/remotes/802.1Q/clean new file mode 100755 index 0000000000..44337c50d2 --- /dev/null +++ b/src/vnm_mad/remotes/802.1Q/clean @@ -0,0 +1,19 @@ +#!/bin/bash + +# -------------------------------------------------------------------------- # +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# # +# Licensed 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. # +#--------------------------------------------------------------------------- # + +exit 0 \ No newline at end of file diff --git a/src/vnm_mad/remotes/802.1Q/post b/src/vnm_mad/remotes/802.1Q/post new file mode 100755 index 0000000000..44337c50d2 --- /dev/null +++ b/src/vnm_mad/remotes/802.1Q/post @@ -0,0 +1,19 @@ +#!/bin/bash + +# -------------------------------------------------------------------------- # +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# # +# Licensed 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. # +#--------------------------------------------------------------------------- # + +exit 0 \ No newline at end of file diff --git a/src/vnm_mad/remotes/802.1Q/pre b/src/vnm_mad/remotes/802.1Q/pre new file mode 100755 index 0000000000..c7ce885d28 --- /dev/null +++ b/src/vnm_mad/remotes/802.1Q/pre @@ -0,0 +1,25 @@ +#!/usr/bin/env ruby + +# -------------------------------------------------------------------------- # +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# # +# Licensed 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. # +#--------------------------------------------------------------------------- # + +$: << File.dirname(__FILE__) +$: << File.join(File.dirname(__FILE__), "..") + +require 'HostManaged' + +hm = OpenNebulaHM.from_base64(ARGV[0]) +exit hm.activate diff --git a/src/vnm_mad/remotes/OpenNebulaNetwork.rb b/src/vnm_mad/remotes/OpenNebulaNetwork.rb index c837e88214..fc49236d73 100644 --- a/src/vnm_mad/remotes/OpenNebulaNetwork.rb +++ b/src/vnm_mad/remotes/OpenNebulaNetwork.rb @@ -20,6 +20,7 @@ $: << File.dirname(__FILE__) require 'rexml/document' require 'OpenNebulaNic' +require 'base64' CONF = { :start_vlan => 2 @@ -98,6 +99,11 @@ end class OpenNebulaNetwork attr_reader :hypervisor, :vm + def self.from_base64(vm_64, hypervisor=nil) + vm_xml = Base64::decode64(vm_64) + self.new(vm_xml, hypervisor) + end + def initialize(vm_tpl, hypervisor=nil) if !hypervisor @hypervisor = detect_hypervisor diff --git a/src/vnm_mad/remotes/dummy/clean b/src/vnm_mad/remotes/dummy/clean new file mode 100755 index 0000000000..44337c50d2 --- /dev/null +++ b/src/vnm_mad/remotes/dummy/clean @@ -0,0 +1,19 @@ +#!/bin/bash + +# -------------------------------------------------------------------------- # +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# # +# Licensed 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. # +#--------------------------------------------------------------------------- # + +exit 0 \ No newline at end of file diff --git a/src/vnm_mad/remotes/dummy/post b/src/vnm_mad/remotes/dummy/post new file mode 100755 index 0000000000..44337c50d2 --- /dev/null +++ b/src/vnm_mad/remotes/dummy/post @@ -0,0 +1,19 @@ +#!/bin/bash + +# -------------------------------------------------------------------------- # +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# # +# Licensed 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. # +#--------------------------------------------------------------------------- # + +exit 0 \ No newline at end of file diff --git a/src/vnm_mad/remotes/dummy/pre b/src/vnm_mad/remotes/dummy/pre new file mode 100755 index 0000000000..44337c50d2 --- /dev/null +++ b/src/vnm_mad/remotes/dummy/pre @@ -0,0 +1,19 @@ +#!/bin/bash + +# -------------------------------------------------------------------------- # +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# # +# Licensed 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. # +#--------------------------------------------------------------------------- # + +exit 0 \ No newline at end of file diff --git a/src/vnm_mad/remotes/ebtables/Ebtables.rb b/src/vnm_mad/remotes/ebtables/Ebtables.rb index 71f9bb1e8e..860a56fb0a 100644 --- a/src/vnm_mad/remotes/ebtables/Ebtables.rb +++ b/src/vnm_mad/remotes/ebtables/Ebtables.rb @@ -14,15 +14,19 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +require 'OpenNebulaNetwork' + class EbtablesVLAN < OpenNebulaNetwork def initialize(vm, hypervisor = nil) super(vm,hypervisor) end def ebtables(rule) - system("#{COMMANDS[:ebtables]} -A #{rule}") + exec_and_log("#{COMMANDS[:ebtables]} -A #{rule}") end + # Activates ebtables rules + # def activate process do |nic| tap = nic[:tap] @@ -42,6 +46,8 @@ class EbtablesVLAN < OpenNebulaNetwork ebtables(out_rule) end end + + return 0 end def deactivate @@ -59,6 +65,8 @@ class EbtablesVLAN < OpenNebulaNetwork end remove_rules(tap) end + + return 0 end def rules @@ -74,6 +82,6 @@ class EbtablesVLAN < OpenNebulaNetwork end def remove_rule(rule) - system("#{COMMANDS[:ebtables]} -D FORWARD #{rule}") + exec_and_log("#{COMMANDS[:ebtables]} -D FORWARD #{rule}") end end diff --git a/src/vnm_mad/remotes/802.1Q/hm-vlan b/src/vnm_mad/remotes/ebtables/clean similarity index 89% rename from src/vnm_mad/remotes/802.1Q/hm-vlan rename to src/vnm_mad/remotes/ebtables/clean index 63f1dc53e1..0aaefc7e02 100755 --- a/src/vnm_mad/remotes/802.1Q/hm-vlan +++ b/src/vnm_mad/remotes/ebtables/clean @@ -17,13 +17,12 @@ #--------------------------------------------------------------------------- # $: << File.dirname(__FILE__) +$: << File.join(File.dirname(__FILE__), "..") -require 'base64' -require 'OpenNebulaNetwork' -require 'HostManaged' +require 'Ebtables' template = ARGV[0] -vm_xml = Base64::decode64(template) -hm = OpenNebulaHM.new(vm_xml) -hm.activate +onevlan = EbtablesVLAN.from_base64(template) + +exit onevlan.deactivate diff --git a/src/vnm_mad/remotes/ebtables/ebtables-vlan b/src/vnm_mad/remotes/ebtables/post similarity index 80% rename from src/vnm_mad/remotes/ebtables/ebtables-vlan rename to src/vnm_mad/remotes/ebtables/post index d4e72abe34..e69f291c26 100755 --- a/src/vnm_mad/remotes/ebtables/ebtables-vlan +++ b/src/vnm_mad/remotes/ebtables/post @@ -17,24 +17,14 @@ #--------------------------------------------------------------------------- # $: << File.dirname(__FILE__) +$: << File.join(File.dirname(__FILE__), "..") -require 'base64' -require 'OpenNebulaNetwork' require 'Ebtables' -action = ARGV[0] -template = ARGV[1] - # Uncomment to act only on the listed bridges. #FILTERED_BRIDGES = ['br0'] -vm_xml = Base64::decode64(template) -onevlan = EbtablesVLAN.new(vm_xml) +onevlan = EbtablesVLAN.from_base64(ARGV[0]) -case action -when "on" - onevlan.filter(:bridge => FILTERED_BRIDGES) if defined? FILTERED_BRIDGES - onevlan.activate -when "off" - onevlan.deactivate -end +onevlan.filter(:bridge => FILTERED_BRIDGES) if defined? FILTERED_BRIDGES +exit onevlan.activate diff --git a/src/vnm_mad/remotes/ebtables/pre b/src/vnm_mad/remotes/ebtables/pre new file mode 100755 index 0000000000..44337c50d2 --- /dev/null +++ b/src/vnm_mad/remotes/ebtables/pre @@ -0,0 +1,19 @@ +#!/bin/bash + +# -------------------------------------------------------------------------- # +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# # +# Licensed 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. # +#--------------------------------------------------------------------------- # + +exit 0 \ No newline at end of file diff --git a/src/vnm_mad/remotes/ovswtich/OpenvSwitch.rb b/src/vnm_mad/remotes/ovswtich/OpenvSwitch.rb index 2ba84ca1ea..fdbf91c21e 100644 --- a/src/vnm_mad/remotes/ovswtich/OpenvSwitch.rb +++ b/src/vnm_mad/remotes/ovswtich/OpenvSwitch.rb @@ -14,6 +14,8 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +require 'OpenNebulaNetwork' + class OpenvSwitchVLAN < OpenNebulaNetwork def initialize(vm, hypervisor = nil) super(vm,hypervisor) @@ -30,7 +32,9 @@ class OpenvSwitchVLAN < OpenNebulaNetwork cmd = "#{COMMANDS[:ovs_vsctl]} set Port #{nic[:tap]} " cmd << "tag=#{vlan}" - system(cmd) + exec_and_log(cmd) end + + return 0 end end diff --git a/src/vnm_mad/remotes/ovswtich/clean b/src/vnm_mad/remotes/ovswtich/clean new file mode 100755 index 0000000000..44337c50d2 --- /dev/null +++ b/src/vnm_mad/remotes/ovswtich/clean @@ -0,0 +1,19 @@ +#!/bin/bash + +# -------------------------------------------------------------------------- # +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# # +# Licensed 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. # +#--------------------------------------------------------------------------- # + +exit 0 \ No newline at end of file diff --git a/src/vnm_mad/remotes/ovswtich/openvswitch-vlan b/src/vnm_mad/remotes/ovswtich/post similarity index 90% rename from src/vnm_mad/remotes/ovswtich/openvswitch-vlan rename to src/vnm_mad/remotes/ovswtich/post index 1cd64fcf1b..5a1bb54a76 100755 --- a/src/vnm_mad/remotes/ovswtich/openvswitch-vlan +++ b/src/vnm_mad/remotes/ovswtich/post @@ -18,12 +18,8 @@ $: << File.dirname(__FILE__) -require 'base64' require 'OpenNebulaNetwork' require 'OpenvSwitch' -template = ARGV[0] -vm_xml = Base64::decode64(template) - -onevlan = OpenvSwitchVLAN.new(vm_xml) -onevlan.activate +onevlan = OpenvSwitchVLAN.from_base64(ARGV[0]) +exit onevlan.activate() diff --git a/src/vnm_mad/remotes/ovswtich/pre b/src/vnm_mad/remotes/ovswtich/pre new file mode 100755 index 0000000000..44337c50d2 --- /dev/null +++ b/src/vnm_mad/remotes/ovswtich/pre @@ -0,0 +1,19 @@ +#!/bin/bash + +# -------------------------------------------------------------------------- # +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# # +# Licensed 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. # +#--------------------------------------------------------------------------- # + +exit 0 \ No newline at end of file From 0401048bea9677ca033fa529c910908da41a3bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 11 Nov 2011 08:52:27 -0800 Subject: [PATCH 016/157] Feature #863: Small fix in vnm mad ruby requirement --- src/vnm_mad/remotes/ovswtich/post | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vnm_mad/remotes/ovswtich/post b/src/vnm_mad/remotes/ovswtich/post index 5a1bb54a76..e59bd2ead6 100755 --- a/src/vnm_mad/remotes/ovswtich/post +++ b/src/vnm_mad/remotes/ovswtich/post @@ -17,8 +17,8 @@ #--------------------------------------------------------------------------- # $: << File.dirname(__FILE__) +$: << File.join(File.dirname(__FILE__), "..") -require 'OpenNebulaNetwork' require 'OpenvSwitch' onevlan = OpenvSwitchVLAN.from_base64(ARGV[0]) From 87f099390488dff4bc5c00b6fce824cc1bf4c04e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 15 Nov 2011 12:44:50 +0100 Subject: [PATCH 017/157] Feaure #863 - #975: Update install.sh, and rename ovswitch drivers --- install.sh | 58 ++++++++++++++----- .../{ovswtich => ovswitch}/OpenvSwitch.rb | 0 .../remotes/{ovswtich => ovswitch}/clean | 0 .../remotes/{ovswtich => ovswitch}/post | 0 .../remotes/{ovswtich => ovswitch}/pre | 0 5 files changed, 43 insertions(+), 15 deletions(-) rename src/vnm_mad/remotes/{ovswtich => ovswitch}/OpenvSwitch.rb (100%) rename src/vnm_mad/remotes/{ovswtich => ovswitch}/clean (100%) rename src/vnm_mad/remotes/{ovswtich => ovswitch}/post (100%) rename src/vnm_mad/remotes/{ovswtich => ovswitch}/pre (100%) diff --git a/install.sh b/install.sh index e68a8ca288..310a15af65 100755 --- a/install.sh +++ b/install.sh @@ -223,8 +223,13 @@ VAR_DIRS="$VAR_LOCATION/remotes \ $VAR_LOCATION/remotes/im/ganglia.d \ $VAR_LOCATION/remotes/vmm/xen \ $VAR_LOCATION/remotes/vmm/kvm \ + $VAR_LOCATION/remotes/vnm \ + $VAR_LOCATION/remotes/vnm/802.1Q \ + $VAR_LOCATION/remotes/vnm/dummy \ + $VAR_LOCATION/remotes/vnm/ebtables \ + $VAR_LOCATION/remotes/vnm/fw \ + $VAR_LOCATION/remotes/vnm/ovswitch \ $VAR_LOCATION/remotes/hooks \ - $VAR_LOCATION/remotes/hooks/vnm \ $VAR_LOCATION/remotes/hooks/ft \ $VAR_LOCATION/remotes/image \ $VAR_LOCATION/remotes/image/fs \ @@ -342,13 +347,17 @@ INSTALL_FILES=( DUMMY_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/dummy LVM_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/lvm IMAGE_DRIVER_FS_SCRIPTS:$VAR_LOCATION/remotes/image/fs - NETWORK_HOOK_SCRIPTS:$VAR_LOCATION/remotes/vnm + NETWORK_FILES:$VAR_LOCATION/remotes/vnm + NETWORK_8021Q_FILES:$VAR_LOCATION/remotes/vnm/802.1Q + NETWORK_DUMMY_FILES:$VAR_LOCATION/remotes/vnm/dummy + NETWORK_EBTABLES_FILES:$VAR_LOCATION/remotes/vnm/ebtables + NETWORK_FW_FILES:$VAR_LOCATION/remotes/vnm/fw + NETWORK_OVSWITCH_FILES:$VAR_LOCATION/remotes/vnm/ovswitch EXAMPLE_SHARE_FILES:$SHARE_LOCATION/examples INSTALL_NOVNC_SHARE_FILE:$SHARE_LOCATION INSTALL_GEMS_SHARE_FILE:$SHARE_LOCATION TM_EXAMPLE_SHARE_FILES:$SHARE_LOCATION/examples/tm HOOK_FT_FILES:$VAR_LOCATION/remotes/hooks/ft - HOOK_NETWORK_FILES:$VAR_LOCATION/remotes/hooks/vnm COMMON_CLOUD_LIB_FILES:$LIB_LOCATION/ruby/cloud CLOUD_AUTH_LIB_FILES:$LIB_LOCATION/ruby/cloud/CloudAuth ECO_LIB_FILES:$LIB_LOCATION/ruby/cloud/econe @@ -611,6 +620,36 @@ AUTH_PLAIN_FILES="src/authm_mad/remotes/plain/authenticate" AUTH_QUOTA_FILES="src/authm_mad/remotes/quota/authorize" +#------------------------------------------------------------------------------- +# Virtual Network Manager drivers to be installed under $REMOTES_LOCATION/vnm +#------------------------------------------------------------------------------- + +NETWORK_FILES="src/vnm_mad/remotes/OpenNebulaNetwork.rb \ + src/vnm_mad/remotes/OpenNebulaNic.rb" + +NETWORK_8021Q_FILES="src/vnm_mad/remotes/802.1Q/clean \ + src/vnm_mad/remotes/802.1Q/post \ + src/vnm_mad/remotes/802.1Q/pre \ + src/vnm_mad/remotes/802.1Q/HostManaged.rb" + +NETWORK_DUMMY_FILES="src/vnm_mad/remotes/dummy/clean \ + src/vnm_mad/remotes/dummy/post \ + src/vnm_mad/remotes/dummy/pre" + +NETWORK_EBTABLES_FILES="src/vnm_mad/remotes/ebtables/clean \ + src/vnm_mad/remotes/ebtables/post \ + src/vnm_mad/remotes/ebtables/pre \ + src/vnm_mad/remotes/ebtables/Ebtables.rb" + +NETWORK_FW_FILES="src/vnm_mad/remotes/fw/firewall \ + src/vnm_mad/remotes/fw/Firewall.rb" + +NETWORK_OVSWITCH_FILES="src/vnm_mad/remotes/ovswitch/clean \ + src/vnm_mad/remotes/ovswitch/post \ + src/vnm_mad/remotes/ovswitch/pre \ + src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb" + + #------------------------------------------------------------------------------- # Transfer Manager commands, to be installed under $LIB_LOCATION/tm_commands # - SHARED TM, $LIB_LOCATION/tm_commands/shared @@ -756,20 +795,9 @@ TM_EXAMPLE_SHARE_FILES="share/examples/tm/tm_clone.sh \ HOOK_FT_FILES="share/hooks/host_error.rb" #------------------------------------------------------------------------------- -# Network Hook scripts, to be installed under $VAR_LOCATION/remotes/hooks +# Installation scripts, to be installed under $SHARE_LOCATION #------------------------------------------------------------------------------- -HOOK_NETWORK_FILES="src/vnm_mad/hm-vlan \ - src/vnm_mad/ebtables-vlan \ - src/vnm_mad/firewall \ - src/vnm_mad/HostManaged.rb \ - src/vnm_mad/OpenNebulaNetwork.rb \ - src/vnm_mad/OpenNebulaNic.rb \ - src/vnm_mad/OpenvSwitch.rb \ - src/vnm_mad/openvswitch-vlan \ - src/vnm_mad/Firewall.rb \ - src/vnm_mad/Ebtables.rb" - INSTALL_NOVNC_SHARE_FILE="share/install_novnc.sh" INSTALL_GEMS_SHARE_FILE="share/install_gems/install_gems" diff --git a/src/vnm_mad/remotes/ovswtich/OpenvSwitch.rb b/src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb similarity index 100% rename from src/vnm_mad/remotes/ovswtich/OpenvSwitch.rb rename to src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb diff --git a/src/vnm_mad/remotes/ovswtich/clean b/src/vnm_mad/remotes/ovswitch/clean similarity index 100% rename from src/vnm_mad/remotes/ovswtich/clean rename to src/vnm_mad/remotes/ovswitch/clean diff --git a/src/vnm_mad/remotes/ovswtich/post b/src/vnm_mad/remotes/ovswitch/post similarity index 100% rename from src/vnm_mad/remotes/ovswtich/post rename to src/vnm_mad/remotes/ovswitch/post diff --git a/src/vnm_mad/remotes/ovswtich/pre b/src/vnm_mad/remotes/ovswitch/pre similarity index 100% rename from src/vnm_mad/remotes/ovswtich/pre rename to src/vnm_mad/remotes/ovswitch/pre From 9d50b437c65df2b07e8e722ed3b785732b728ceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 15 Nov 2011 07:30:53 -0800 Subject: [PATCH 018/157] Feature #863: Remove networking hooks from oned.conf --- share/etc/oned.conf | 130 -------------------------------------------- 1 file changed, 130 deletions(-) diff --git a/share/etc/oned.conf b/share/etc/oned.conf index 630303e906..3c4f9f629f 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -405,136 +405,6 @@ HM_MAD = [ # arguments = "$VMID" ] #------------------------------------------------------------------------------- -#******************************************************************************* -# Networking Hooks -#******************************************************************************* -# The following network hooks can be activated in order to manage network -# isolation and firewalls. -#******************************************************************************* -#------------------------------------------------------------------------------- -# Firewall -#------------------------------------------------------------------------------- -# -# Firewalling rules activated in the physical host executing the VM. Can be used -# to filter TCP and UDP ports, and to define a policy for ICMP connections. To -# use it specify under the NIC section of the VM one or more of the following -# attributes: -# -# - WHITE_PORTS_TCP = iptables_range -# Permits access to the VM only through the specified ports in the TCP -# protocol. Supersedes BLACK_PORTS_TCP if defined. -# -# - BLACK_PORTS_TCP = iptables_range -# Doesn't permit access to the VM through the specified ports in the TCP -# protocol. Superseded by WHITE_PORTS_TCP if defined. -# -# - WHITE_PORTS_UDP = iptables_range -# Permits access to the VM only through the specified ports in the UDP -# protocol. Supersedes BLACK_PORTS_UDP if defined. -# -# - BLACK_PORTS_UDP = iptables_range -# Doesn't permit access to the VM through the specified ports in the UDP -# protocol. Superseded by WHITE_PORTS_UDP if defined. -# -# - ICMP = no | drop -# Blocks ICMP connections to the VM. By default it's enabled. -# -# This hook requires the sudoers file to be configured so oneadmin can execute -# iptables without a password. -# -#------------------------------------------------------------------------------- -# -# VM_HOOK = [ -# name = "firewall-on", -# on = "RUNNING", -# command = "vnm/firewall", -# arguments = "on $TEMPLATE", -# remote = "yes" ] -# -# VM_HOOK = [ -# name = "firewall-off", -# on = "DONE", -# command = "vnm/firewall", -# arguments = "off $TEMPLATE", -# remote = "yes" ] -#------------------------------------------------------------------------------- -# Host-managed VLANs -#------------------------------------------------------------------------------- -# -# Network isolation provided through host-managed vlans. This hook will create a -# bridge for each OpenNebula virtual network and attach a tagged network -# interface to the bridge. -# -# For this hook to be effective you need to specify the attribute PHYDEV in your -# VNET template, which should contain the name of the physical network interface -# each VM should be attached to. If BRIDGE is not defined it will be -# automatically generated. -# -# In order to use this hook you need to: -# - load module 8021q -# - install vconfig -# - configure passwordless sudo in the worker nodes for oneadmin for these -# commands: brctl, ip, vconfig. -# -#------------------------------------------------------------------------------- -# -# VM_HOOK = [ -# name = "hm-vlan", -# on = "PROLOG", -# command = "vnm/hm-vlan", -# arguments = "$TEMPLATE", -# remote = "yes" ] -# -#------------------------------------------------------------------------------- -# Ebtables Network Isolation -#------------------------------------------------------------------------------- -# -# Network isolation provided through ebtables rules applied on the bridges. This -# method will only permit isolation with a mask of 255.255.255.0. -# -# This hook requires the sudoers file to be configured so oneadmin can execute -# ebtables without a password, and the ebtables package to be installed. -# -#------------------------------------------------------------------------------- -# -# VM_HOOK = [ -# name = "ebtables-vlan-on", -# on = "RUNNING", -# command = "vnm/ebtables-vlan", -# arguments = "on $TEMPLATE", -# remote = "yes" ] -# -# VM_HOOK = [ -# name = "ebtables-vlan-off", -# on = "DONE", -# command = "vnm/ebtables-vlan", -# arguments = "off $TEMPLATE", -# remote = "yes" ] -# -#------------------------------------------------------------------------------- -# Open vSwitch Network Isolation -#------------------------------------------------------------------------------- -# -# Network isolation provided through Open vSwitch. Each virtual network -# interface will receive an VLAN tag enabling network isolation. -# -# This hook requires Open vSwitch to be installed along with the Open vSwitch -# compatibility layer for Linux bridging, on each worker node. -# See http://openvswitch.org/ for more information. -# -# Passwordless sudo permissions for oneadmin to execute ovs_vsctl. -# -#------------------------------------------------------------------------------- -# -# VM_HOOK = [ -# name = "openvswitch-vlan", -# on = "RUNNING", -# command = "vnm/openvswitch-vlan", -# arguments = "$TEMPLATE", -# remote = "yes" ] -# -#------------------------------------------------------------------------------- - #******************************************************************************* # Auth Manager Configuration #******************************************************************************* From 85a676e9594644f72e863724e28a71e94da5a4dc Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Wed, 16 Nov 2011 18:11:43 +0100 Subject: [PATCH 019/157] now vmm deploy gets local and remote deployment paths --- include/VirtualMachineManager.h | 3 ++- src/vmm/VirtualMachineManager.cc | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/include/VirtualMachineManager.h b/include/VirtualMachineManager.h index 1c41918288..cab1799800 100644 --- a/include/VirtualMachineManager.h +++ b/include/VirtualMachineManager.h @@ -205,7 +205,8 @@ private: const string& m_hostname, const string& m_net_drv, const string& domain, - const string& dfile, + const string& ldfile, + const string& rdfile, const string& cfile, const string& tmpl); diff --git a/src/vmm/VirtualMachineManager.cc b/src/vmm/VirtualMachineManager.cc index 37539374a7..31edfe92a4 100644 --- a/src/vmm/VirtualMachineManager.cc +++ b/src/vmm/VirtualMachineManager.cc @@ -251,7 +251,8 @@ string * VirtualMachineManager::format_message( const string& m_hostname, const string& m_net_drv, const string& domain, - const string& dfile, + const string& ldfile, + const string& rdfile, const string& cfile, const string& tmpl) { @@ -280,13 +281,15 @@ string * VirtualMachineManager::format_message( oss << ""; } - if (!dfile.empty()) + if (!ldfile.empty()) { - oss << "" << dfile << ""; + oss << "" << ldfile << ""; + oss << "" << rdfile << ""; } else { - oss << ""; + oss << ""; + oss << ""; } if (!cfile.empty()) @@ -358,6 +361,7 @@ void VirtualMachineManager::deploy_action(int vid) "", "", "", + vm->get_deployment_file(), vm->get_remote_deployment_file(), "", vm->to_xml(vm_tmpl)); @@ -455,6 +459,7 @@ void VirtualMachineManager::save_action( "", vm->get_deploy_id(), "", + "", vm->get_checkpoint_file(), vm->to_xml(vm_tmpl)); @@ -534,6 +539,7 @@ void VirtualMachineManager::shutdown_action( vm->get_deploy_id(), "", "", + "", vm->to_xml(vm_tmpl)); vmd->shutdown(vid, *drv_msg); @@ -608,6 +614,7 @@ void VirtualMachineManager::cancel_action( vm->get_deploy_id(), "", "", + "", vm->to_xml(vm_tmpl)); vmd->cancel(vid, *drv_msg); @@ -685,6 +692,7 @@ void VirtualMachineManager::cancel_previous_action( vm->get_deploy_id(), "", "", + "", vm->to_xml(vm_tmpl)); vmd->cancel(vid, *drv_msg); @@ -758,6 +766,7 @@ void VirtualMachineManager::migrate_action( vm->get_deploy_id(), "", "", + "", vm->to_xml(vm_tmpl)); vmd->migrate(vid, *drv_msg); @@ -836,6 +845,7 @@ void VirtualMachineManager::restore_action( "", vm->get_deploy_id(), "", + "", vm->get_checkpoint_file(), vm->to_xml(vm_tmpl)); @@ -911,6 +921,7 @@ void VirtualMachineManager::poll_action( vm->get_deploy_id(), "", "", + "", vm->to_xml(vm_tmpl)); vmd->poll(vid, *drv_msg); @@ -1067,6 +1078,7 @@ void VirtualMachineManager::timer_action() vm->get_deploy_id(), "", "", + "", vm->to_xml(vm_tmpl)); vmd->poll(*it, *drv_msg); From b7fda37436219cffefc761a34336fa2347567037 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Wed, 16 Nov 2011 19:05:16 +0100 Subject: [PATCH 020/157] changed domain by deploy_id in the vmm driver xml --- src/vmm/VirtualMachineManager.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vmm/VirtualMachineManager.cc b/src/vmm/VirtualMachineManager.cc index 31edfe92a4..94706f35f8 100644 --- a/src/vmm/VirtualMachineManager.cc +++ b/src/vmm/VirtualMachineManager.cc @@ -274,11 +274,11 @@ string * VirtualMachineManager::format_message( if (!domain.empty()) { - oss << "" << domain << ""; + oss << "" << domain << ""; } else { - oss << ""; + oss << ""; } if (!ldfile.empty()) From 048364353c1b4ed2622f1a7180b16b0686e1c2a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 16 Nov 2011 19:05:09 +0100 Subject: [PATCH 021/157] Feature #863 - #974: Update ec2 hybrid driver for the new protocol --- src/mad/ruby/VirtualMachineDriver.rb | 29 ++++++++++------------------ src/vmm_mad/dummy/one_vmm_dummy.rb | 13 ++----------- src/vmm_mad/ec2/one_vmm_ec2.rb | 27 +++++++++++++++++++++----- 3 files changed, 34 insertions(+), 35 deletions(-) diff --git a/src/mad/ruby/VirtualMachineDriver.rb b/src/mad/ruby/VirtualMachineDriver.rb index fa3249824d..f9f5fc1c21 100644 --- a/src/mad/ruby/VirtualMachineDriver.rb +++ b/src/mad/ruby/VirtualMachineDriver.rb @@ -15,6 +15,8 @@ #--------------------------------------------------------------------------- # require "OpenNebulaDriver" require "CommandManager" +require 'base64' +require 'rexml/document' # Author:: dsa-research.org # Copyright:: (c) 2011 Universidad Computense de Madrid @@ -85,26 +87,15 @@ class VirtualMachineDriver < OpenNebulaDriver register_action(ACTION[:poll].to_sym, method("poll")) end - # Converts a deployment file from its remote path to the local (front-end) - # path - def get_local_deployment_file(rfile) - lfile = nil + # Decodes the encoded XML driver message received from the core + # + # @param [String] drv_message the driver message + # @return [REXML::Element] the root element of the decoded XML message + def decode(drv_message) + message = Base64.decode64(drv_message) + xml_doc = REXML::Document.new(message) - one_location = ENV["ONE_LOCATION"] - - if one_location == nil - var_location = "/var/lib/one/" - else - var_location = one_location + "/var/" - end - - m = rfile.match(/.*?\/(\d+)\/images\/(deployment.\d+)$/) - - lfile = "#{var_location}#{m[1]}/#{m[2]}" if m - - lfile = nil if lfile and !File.exists?(lfile) - - return lfile + xml_doc.root end # Execute a command associated to an action and id in a remote host. diff --git a/src/vmm_mad/dummy/one_vmm_dummy.rb b/src/vmm_mad/dummy/one_vmm_dummy.rb index dad6596de4..f424a12c13 100755 --- a/src/vmm_mad/dummy/one_vmm_dummy.rb +++ b/src/vmm_mad/dummy/one_vmm_dummy.rb @@ -30,8 +30,6 @@ $: << RUBY_LIB_LOCATION require "VirtualMachineDriver" require "CommandManager" -require 'base64' -require 'rexml/document' class DummyDriver < VirtualMachineDriver def initialize @@ -41,15 +39,8 @@ class DummyDriver < VirtualMachineDriver ) end - def decode(drv_msg) - message = Base64.decode64(drv_msg) - xml_doc = REXML::Document.new(message) - - xml_doc.root - end - - def deploy(id, drv_msg) - msg = decode(drv_msg) + def deploy(id, drv_message) + msg = decode(drv_message) host = msg.elements["HOST"].text name = msg.elements["VM/NAME"].text diff --git a/src/vmm_mad/ec2/one_vmm_ec2.rb b/src/vmm_mad/ec2/one_vmm_ec2.rb index 10441c1115..f5346e58f9 100755 --- a/src/vmm_mad/ec2/one_vmm_ec2.rb +++ b/src/vmm_mad/ec2/one_vmm_ec2.rb @@ -89,9 +89,12 @@ class EC2Driver < VirtualMachineDriver end # DEPLOY action, also sets ports and ip if needed - def deploy(id, host, remote_dfile, not_used) + def deploy(id, drv_message) + msg = decode(drv_message) - local_dfile = get_local_deployment_file(remote_dfile) + host = msg.elements["HOST"].text + + local_dfile = msg.elements["LOCAL_DEPLOYMENT_FILE"].text if !local_dfile send_message(ACTION[:deploy],RESULT[:failure],id, @@ -175,17 +178,31 @@ class EC2Driver < VirtualMachineDriver end # Shutdown a EC2 instance - def shutdown(id, host, deploy_id, not_used) + def shutdown(id, drv_message) + msg = decode(drv_message) + + host = msg.elements["HOST"].text + deploy_id = msg.elements["DEPLOY_ID"].text + ec2_terminate(ACTION[:shutdown], id, deploy_id) end # Cancel a EC2 instance - def cancel(id, host, deploy_id, not_used) + def cancel(id, drv_message) + msg = decode(drv_message) + + host = msg.elements["HOST"].text + deploy_id = msg.elements["DEPLOY_ID"].text + ec2_terminate(ACTION[:cancel], id, deploy_id) end # Get info (IP, and state) for a EC2 instance - def poll(id, host, deploy_id, not_used) + def poll(id, drv_message) + msg = decode(drv_message) + + host = msg.elements["HOST"].text + deploy_id = msg.elements["DEPLOY_ID"].text info = "#{POLL_ATTRIBUTE[:usedmemory]}=0 " \ "#{POLL_ATTRIBUTE[:usedcpu]}=0 " \ From 84f912866bcba863f601be8c562b4ea16e7f506e Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Thu, 17 Nov 2011 12:13:51 +0100 Subject: [PATCH 022/157] decode vmm_exec parameters --- src/vmm_mad/exec/one_vmm_exec.rb | 44 ++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index fff1872265..7b5e0c0e4d 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -49,8 +49,11 @@ class ExecDriver < VirtualMachineDriver end # DEPLOY action, sends the deployment file to remote host - def deploy(id, host, remote_dfile, not_used) - local_dfile = get_local_deployment_file(remote_dfile) + def deploy(id, drv_message) + data = decode(drv_message) + + local_dfile = data['LOCAL_DEPLOYMENT_DATA'] + host= data['HOST'] if !local_dfile || File.zero?(local_dfile) send_message(ACTION[:deploy],RESULT[:failure],id, @@ -74,27 +77,52 @@ class ExecDriver < VirtualMachineDriver # Basic Domain Management Operations - def shutdown(id, host, deploy_id, not_used) + def shutdown(id, drv_message) + data = decode(drv_message) + host = data['HOST'] + deploy_id = data['DEPLOY_ID'] + do_action("#{deploy_id} #{host}", id, host, :shutdown) end - def cancel(id, host, deploy_id, not_used) + def cancel(id, drv_message) + data = decode(drv_message) + host = data['HOST'] + deploy_id = data['DEPLOY_ID'] + do_action("#{deploy_id} #{host}", id, host, :cancel) end - def save(id, host, deploy_id, file) + def save(id, drv_message) + data = decode(drv_message) + host = data['HOST'] + deploy_id = data['DEPLOY_ID'] + file = data['CHECKPOINT_FILE'] + do_action("#{deploy_id} #{file} #{host}", id, host, :save) end - def restore(id, host, deploy_id, file) + def restore(id, drv_message) + data = decode(drv_message) + host = data['HOST'] + file = data['CHECKPOINT_FILE'] + do_action("#{file} #{host}", id, host, :restore) end - def migrate(id, host, deploy_id, dest_host) + def migrate(id, drv_message) + data = decode(drv_message) + host = data['HOST'] + deploy_id = data['DEPLOY_ID'] + do_action("#{deploy_id} #{dest_host} #{host}", id, host, :migrate) end - def poll(id, host, deploy_id, not_used) + def poll(id, drv_message) + data = decode(drv_message) + host = data['HOST'] + deploy_id = data['DEPLOY_ID'] + do_action("#{deploy_id} #{host}", id, host, :poll) end end From 8a68b8eef256dfd7866ab82ddf2a203359eab68f Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Fri, 18 Nov 2011 17:31:18 +0100 Subject: [PATCH 023/157] added ssh_stream --- src/mad/ruby/ssh_stream.rb | 175 +++++++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 src/mad/ruby/ssh_stream.rb diff --git a/src/mad/ruby/ssh_stream.rb b/src/mad/ruby/ssh_stream.rb new file mode 100644 index 0000000000..38da9241dc --- /dev/null +++ b/src/mad/ruby/ssh_stream.rb @@ -0,0 +1,175 @@ + +require 'CommandManager' +require 'open3' + +class SshStream + attr_reader :stream_out, :stream_err, :stdin + attr_reader :out, :err + + # + # + EOF_ERR = "EOF_ERR" + EOF_OUT = "EOF_OUT" + RC_STR = "ExitCode: " + + EOF_CMD = "echo \"#{RC_STR}$?#{EOF_ERR}\" 1>&2; echo \"#{EOF_OUT}\"" + SSH_CMD = "ssh" + # + # + # + def initialize(host) + @host = host + end + + def opened? + defined?(@stdin) + end + + def open + @stdin, @stdout, @stderr=Open3::popen3("#{SSH_CMD} #{@host} bash -s") + + @stream_out = "" + @stream_err = "" + + @out = "" + @err = "" + end + + def close + @stdin.puts "\nexit" + + @stdin.close if not @stdin.closed? + @stdout.close if not @stdout.closed? + @stderr.close if not @stderr.closed? + end + + def exec(command) + @out = "" + @err = "" + + begin + @stdin.write "(#{command}); #{EOF_CMD}\n" + @stdin.flush + rescue + + end + end + + def wait_for_command + done_out = false + done_err = false + + code = -1 + + while not (done_out and done_err) + rc, rw, = IO.select([@stdout, @stderr],[],[]) + + rc.each { |fd| + c = fd.read_nonblock(1) + + if !c + done = true + break + end + + if fd == @stdout + @out << c + done_out = true if @out.slice!("#{EOF_OUT}\n") + else + @err << c + + tmp = @err.scan(/^#{RC_STR}(\d*)#{EOF_ERR}\n/) + + if tmp[0] + code = tmp[0][0].to_i + done_err = true + + @err.slice!("#{EOF_ERR}\n") + end + end + } + end + + @stream_out << @out + @stream_err << @err + + return code + end + + def exec_and_wait(command) + exec(command) + wait_for_command + end +end + + +class SshStreamCommand < GenericCommand + def initialize(host, logger=nil, stdin=nil) + @host=host + super('true', logger, stdin) + + @stream=SshStream.new(host) + @stream.open + end + + def run(command, stdin=nil) + @stream.open unless @stream.opened? + + @stream.exec(command) + @stream.stdin.write(stdin) if stdin + + code=@stream.wait_for_command + + @stdout=@stream.out + @stderr=@stream.err + + if code!=0 + log("Command execution fail: #{command}") + end + + log(@stderr) + + return code + end +end + + +if $0 == __FILE__ + + ssh=SshStream.new('localhost') + + ssh.open + + ssh.exec("date | tee /tmp/test.javi") + code=ssh.wait_for_command + + puts "Code: #{code}" + puts "output: #{ssh.out}" + + ssh.exec "cat << EOT | cat" + ssh.stdin.puts "blah blah\nmas blah\nrequeteblah" + ssh.stdin.puts "EOT" + + code=ssh.wait_for_command + + puts "Code: #{code}" + puts "output: #{ssh.out}" + + code=ssh.exec_and_wait("whoami") + + puts "Code: #{code}" + puts "output: #{ssh.out}" + + code=ssh.exec_and_wait("touch /etc/pepe.txt") + + puts "Code: #{code}" + puts "output: #{ssh.out}" + puts "output err: #{ssh.err}" + + + ssh.close + +end + + + From 80efad700b070da00ded6372354ee37f63e4fd5a Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Fri, 18 Nov 2011 17:32:17 +0100 Subject: [PATCH 024/157] feature #863: added execute_network_script to one_vmm_exec --- src/vmm_mad/exec/one_vmm_exec.rb | 72 ++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 4 deletions(-) diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 7b5e0c0e4d..49b34124e9 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -1,5 +1,6 @@ #!/usr/bin/env ruby + # -------------------------------------------------------------------------- # # Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # # # @@ -34,6 +35,9 @@ $: << RUBY_LIB_LOCATION require "VirtualMachineDriver" require 'getoptlong' +require 'ssh_stream' +require 'pp' + # The main class for the Sh driver class ExecDriver < VirtualMachineDriver @@ -48,12 +52,60 @@ class ExecDriver < VirtualMachineDriver @hypervisor = hypervisor end + # network script actions + + def execute_network_script(action, connection, message) + driver=message.elements['NET_DRV'].text + id=message.elements['VM/ID'].text + + vm_encoded=Base64.encode64(message.elements['VM'].to_s).delete("\n") + + result=[false, ''] + + if(action_is_local?(action.to_s)) + script_path=File.join( + @local_scripts_base_path, + 'vnm', + driver, + action.to_s) + + command="#{script_path} #{vm_encoded}" + + command_exe = LocalCommand.run(command, log_method(id)) + + code=(command_exe.code==0) + + result=[code, command_exe] + else + script_path=File.join( + @remote_scripts_base_path, + 'vnm', + driver, + action.to_s) + + command="#{script_path} #{vm_encoded}" + + pp command + + error_code=connection.run(command) + + pp error_code + pp connection.stderr + + code=(error_code==0) + + result=[code, connection] + end + end + + # DEPLOY action, sends the deployment file to remote host def deploy(id, drv_message) data = decode(drv_message) - local_dfile = data['LOCAL_DEPLOYMENT_DATA'] - host= data['HOST'] + local_dfile = data.elements['LOCAL_DEPLOYMENT_FILE'].text + remote_dfile = data.elements['REMOTE_DEPLOYMENT_FILE'].text + host= data.elements['HOST'].text if !local_dfile || File.zero?(local_dfile) send_message(ACTION[:deploy],RESULT[:failure],id, @@ -71,8 +123,20 @@ class ExecDriver < VirtualMachineDriver dfile=remote_dfile end - do_action("#{dfile} #{host}", id, host, :deploy, - :stdin => domain) + ssh=SshStreamCommand.new(host, log_method(id)) + + execute_network_script(:pre, ssh, data) + + pp ssh.run("cat << EOT | #{remote_scripts_path}/deploy #{dfile} #{host}", + domain+"\nEOT\n") + + execute_network_script(:post, ssh, data) + + pp ssh.stdout + pp ssh.stderr + + #do_action("#{dfile} #{host}", id, host, :deploy, + # :stdin => domain) end # Basic Domain Management Operations From d4508e54a7a4d84cece84a2828ebee82aed9a437 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Mon, 21 Nov 2011 16:43:08 +0100 Subject: [PATCH 025/157] feature #863: refactored do_action --- src/authm_mad/one_auth_mad.rb | 6 ++-- src/image_mad/one_image.rb | 12 ++++--- src/mad/ruby/OpenNebulaDriver.rb | 55 ++++++++++++++++---------------- 3 files changed, 39 insertions(+), 34 deletions(-) diff --git a/src/authm_mad/one_auth_mad.rb b/src/authm_mad/one_auth_mad.rb index 81ea494ecf..7a244519e9 100755 --- a/src/authm_mad/one_auth_mad.rb +++ b/src/authm_mad/one_auth_mad.rb @@ -111,7 +111,8 @@ class AuthDriver < OpenNebulaDriver command = File.join(authN_path,ACTION[:authN].downcase) command << ' ' << user << ' ' << password << ' ' << secret - local_action(command, request_id, ACTION[:authN]) + do_action(command, request_id, nil, ACTION[:authN], + :local => true) end # Authenticate a user based in a string of the form user:secret when using the @@ -141,7 +142,8 @@ class AuthDriver < OpenNebulaDriver command = @authZ_cmd.clone command << ' ' << user_id << ' ' << requests.join(' ') - local_action(command, request_id, ACTION[:authZ]) + do_action(command, request_id, nil, ACTION[:authZ], + :local => true) end end end diff --git a/src/image_mad/one_image.rb b/src/image_mad/one_image.rb index 72bb6fbbbe..358972a879 100755 --- a/src/image_mad/one_image.rb +++ b/src/image_mad/one_image.rb @@ -69,19 +69,23 @@ class ImageDriver < OpenNebulaDriver # Image Manager Protocol Actions (generic implementation def mv(id, src, dst) - local_action("#{@actions_path}/mv #{src} #{dst} #{id}",id,ACTION[:mv]) + do_action("#{@actions_path}/mv #{src} #{dst} #{id}", id, nil, + ACTION[:mv], :local => true) end def cp(id, src) - local_action("#{@actions_path}/cp #{src} #{id}",id,ACTION[:cp]) + do_action("#{@actions_path}/cp #{src} #{id}", id, nil, ACTION[:cp], + :local => true) end def rm(id, dst) - local_action("#{@actions_path}/rm #{dst} #{id}",id,ACTION[:rm]) + do_action("#{@actions_path}/rm #{dst} #{id}", id, nil, ACTION[:rm], + :local => true) end def mkfs(id, fs, size) - local_action("#{@actions_path}/mkfs #{fs} #{size} #{id}",id,ACTION[:mkfs]) + do_action("#{@actions_path}/mkfs #{fs} #{size} #{id}", id, nil, + ACTION[:mkfs], :local => true) end end diff --git a/src/mad/ruby/OpenNebulaDriver.rb b/src/mad/ruby/OpenNebulaDriver.rb index 6129795d3a..d69d616456 100644 --- a/src/mad/ruby/OpenNebulaDriver.rb +++ b/src/mad/ruby/OpenNebulaDriver.rb @@ -141,21 +141,43 @@ class OpenNebulaDriver < ActionManager def do_action(parameters, id, host, aname, ops={}) options={ :stdin => nil, - :script_name => nil + :script_name => nil, + :respond => true }.merge(ops) params=parameters+" #{id} #{host}" command=action_command_line(aname, params, options[:script_name]) - if action_is_local? aname - local_action(command, id, aname) + if ops[:local] || action_is_local? aname + execution=local_action(command, id, aname) else - remotes_action(command, id, host, aname, @remote_scripts_base_path, - options[:stdin]) + execution=remotes_action(command, id, host, aname, + @remote_scripts_base_path, options[:stdin]) + end + + if ops[:respond] + send_message_from_execution(aname, id, execution) + else + execution end end + def send_message_from_execution(aname, id, command_exe) + if command_exe.code == 0 + result = RESULT[:success] + info = command_exe.stdout + else + result = RESULT[:failure] + info = command_exe.get_error_message + end + + info = "-" if info == nil || info.empty? + + send_message(aname,result,id,info) + end + + # Given the action name and the parameter returns full path of the script # and appends its parameters. It uses @local_actions hash to know if the # actions is remote or local. If the local actions has defined an special @@ -213,17 +235,6 @@ class OpenNebulaDriver < ActionManager log_method(id), std_in, @retries) - if command_exe.code == 0 - result = RESULT[:success] - info = command_exe.stdout - else - result = RESULT[:failure] - info = command_exe.get_error_message - end - - info = "-" if info == nil || info.empty? - - send_message(aname,result,id,info) end # Execute a command associated to an action and id on localhost @@ -233,18 +244,6 @@ class OpenNebulaDriver < ActionManager # @param [String, Symbol] aname name of the action def local_action(command, id, aname) command_exe = LocalCommand.run(command, log_method(id)) - - if command_exe.code == 0 - result = RESULT[:success] - info = command_exe.stdout - else - result = RESULT[:failure] - info = command_exe.get_error_message - end - - info = "-" if info == nil || info.empty? - - send_message(aname,result,id,info) end # Sends a log message to ONE. The +message+ can be multiline, it will From 24ad9bf49e5dd532ec32b92694f8fdd5f0d7967f Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Mon, 21 Nov 2011 18:14:04 +0100 Subject: [PATCH 026/157] feature #863: Work on driver design --- src/mad/ruby/OpenNebulaDriver.rb | 220 +++++++------------------------ src/mad/ruby/ssh_stream.rb | 12 +- src/vmm_mad/exec/one_vmm_exec.rb | 7 +- 3 files changed, 61 insertions(+), 178 deletions(-) diff --git a/src/mad/ruby/OpenNebulaDriver.rb b/src/mad/ruby/OpenNebulaDriver.rb index d69d616456..4833d7bdd4 100644 --- a/src/mad/ruby/OpenNebulaDriver.rb +++ b/src/mad/ruby/OpenNebulaDriver.rb @@ -30,44 +30,13 @@ require "CommandManager" # for each action it wants to receive. The method must be associated # with the action name through the register_action function class OpenNebulaDriver < ActionManager + include DriverExecHelper + # @return [String] Base path for scripts attr_reader :local_scripts_base_path, :remote_scripts_base_path # @return [String] Path for scripts attr_reader :local_scripts_path, :remote_scripts_path - # This function parses a string with this form: - # - # 'deploy,shutdown,poll=poll_ganglia, cancel ' - # - # and returns a hash: - # - # {"POLL"=>"poll_ganglia", "DEPLOY"=>nil, "SHUTDOWN"=>nil, - # "CANCEL"=>nil} - # - # @param [String] str imput string to parse - # @return [Hash] parsed actions - def self.parse_actions_list(str) - actions=Hash.new - str_splitted=str.split(/\s*,\s*/).map {|s| s.strip } - - str_splitted.each do |a| - m=a.match(/([^=]+)(=(.*))?/) - next if !m - - action=m[1].upcase - - if m[2] - script=m[3] - script.strip! if script - else - script=nil - end - - actions[action]=script - end - - actions - end # Action result strings for messages RESULT = { @@ -98,23 +67,11 @@ class OpenNebulaDriver < ActionManager super(@options[:concurrency], @options[:threaded]) @retries = @options[:retries] - @local_actions = @options[:local_actions] @send_mutex = Mutex.new - - # set default values - @config = read_configuration - @remote_scripts_base_path = @config['SCRIPTS_REMOTE_DIR'] - - if ENV['ONE_LOCATION'] == nil - @local_scripts_base_path = "/var/lib/one/remotes" - else - @local_scripts_base_path = "#{ENV['ONE_LOCATION']}/var/remotes" - end - - # dummy paths - @remote_scripts_path = File.join(@remote_scripts_base_path, directory) - @local_scripts_path = File.join(@local_scripts_base_path, directory) + + #Set default values + initialize_helper(directory, @options) register_action(:INIT, method("init")) end @@ -150,100 +107,23 @@ class OpenNebulaDriver < ActionManager command=action_command_line(aname, params, options[:script_name]) if ops[:local] || action_is_local? aname - execution=local_action(command, id, aname) + execution = LocalCommand.run(command, log_method(id)) else - execution=remotes_action(command, id, host, aname, - @remote_scripts_base_path, options[:stdin]) + execution = RemotesCommand.run(command, + host, + @remote_scripts_base_path, + log_method(id), + options[:stdin], + @retries) end + result, info = get_info_from_execution(command_exe) + if ops[:respond] - send_message_from_execution(aname, id, execution) - else - execution - end - end - - def send_message_from_execution(aname, id, command_exe) - if command_exe.code == 0 - result = RESULT[:success] - info = command_exe.stdout - else - result = RESULT[:failure] - info = command_exe.get_error_message + send_message(aname,result,id,info) end - info = "-" if info == nil || info.empty? - - send_message(aname,result,id,info) - end - - - # Given the action name and the parameter returns full path of the script - # and appends its parameters. It uses @local_actions hash to know if the - # actions is remote or local. If the local actions has defined an special - # script name this is used, otherwise the action name in downcase is - # used as the script name. - # - # @param [String, Symbol] action name of the action - # @param [String] parameters arguments for the script - # @param [String, nil] default_name alternative name for the script - # @return [String] command line needed to execute the action - def action_command_line(action, parameters, default_name=nil) - if action_is_local? action - script_path=@local_scripts_path - else - script_path=@remote_scripts_path - end - - File.join(script_path, action_script_name(action, default_name))+ - " "+parameters - end - - # True if the action is meant to be executed locally - # - # @param [String, Symbol] action name of the action - def action_is_local?(action) - @local_actions.include? action.to_s.upcase - end - - # Name of the script file for the given action - # - # @param [String, Symbol] action name of the action - # @param [String, nil] default_name alternative name for the script - def action_script_name(action, default_name=nil) - name=@local_actions[action.to_s.upcase] - - if name - name - else - default_name || action.to_s.downcase - end - end - - # Execute a command associated to an action and id in a remote host. - # - # @param [String] command command line to execute the script - # @param [Number, String] id action identifier - # @param [String] host hostname where the action is going to be executed - # @param [String, Symbol] aname name of the action - # @param [String] remote_dir path where the remotes reside - # @param [String, nil] std_in input of the string from the STDIN - def remotes_action(command, id, host, aname, remote_dir, std_in=nil) - command_exe = RemotesCommand.run(command, - host, - remote_dir, - log_method(id), - std_in, - @retries) - end - - # Execute a command associated to an action and id on localhost - # - # @param [String] command command line to execute the script - # @param [Number, String] id action identifier - # @param [String, Symbol] aname name of the action - def local_action(command, id, aname) - command_exe = LocalCommand.run(command, log_method(id)) + [result, info] end # Sends a log message to ONE. The +message+ can be multiline, it will @@ -300,6 +180,40 @@ class OpenNebulaDriver < ActionManager loop_thread.kill end + # This function parses a string with this form: + # + # 'deploy,shutdown,poll=poll_ganglia, cancel ' + # + # and returns a hash: + # + # {"POLL"=>"poll_ganglia", "DEPLOY"=>nil, "SHUTDOWN"=>nil, + # "CANCEL"=>nil} + # + # @param [String] str imput string to parse + # @return [Hash] parsed actions + def self.parse_actions_list(str) + actions=Hash.new + str_splitted=str.split(/\s*,\s*/).map {|s| s.strip } + + str_splitted.each do |a| + m=a.match(/([^=]+)(=(.*))?/) + next if !m + + action=m[1].upcase + + if m[2] + script=m[3] + script.strip! if script + else + script=nil + end + + actions[action]=script + end + + actions + end + private def init @@ -332,40 +246,6 @@ private end end end - - def read_configuration - one_config=nil - - if ENV['ONE_LOCATION'] - one_config=ENV['ONE_LOCATION']+'/var/config' - else - one_config='/var/lib/one/config' - end - - config=Hash.new - cfg='' - - begin - open(one_config) do |file| - cfg=file.read - end - - cfg.split(/\n/).each do |line| - m=line.match(/^([^=]+)=(.*)$/) - - if m - name=m[1].strip.upcase - value=m[2].strip - config[name]=value - end - end - rescue Exception => e - STDERR.puts "Error reading config: #{e.inspect}" - STDERR.flush - end - - config - end end ################################################################ diff --git a/src/mad/ruby/ssh_stream.rb b/src/mad/ruby/ssh_stream.rb index 38da9241dc..2ae9167471 100644 --- a/src/mad/ruby/ssh_stream.rb +++ b/src/mad/ruby/ssh_stream.rb @@ -108,7 +108,7 @@ class SshStreamCommand < GenericCommand @host=host super('true', logger, stdin) - @stream=SshStream.new(host) + @stream = SshStream.new(host) @stream.open end @@ -118,18 +118,18 @@ class SshStreamCommand < GenericCommand @stream.exec(command) @stream.stdin.write(stdin) if stdin - code=@stream.wait_for_command + @code = @stream.wait_for_command - @stdout=@stream.out - @stderr=@stream.err + @stdout = @stream.out + @stderr = @stream.err - if code!=0 + if @code != 0 log("Command execution fail: #{command}") end log(@stderr) - return code + return @code end end diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 49b34124e9..7a42b35af7 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -123,9 +123,12 @@ class ExecDriver < VirtualMachineDriver dfile=remote_dfile end - ssh=SshStreamCommand.new(host, log_method(id)) - execute_network_script(:pre, ssh, data) + ssh=SshStreamCommand.new(host, log_method(id)) + vnm=crea nuevo driver(:ssh_stream => ssh) + + #execute_network_script(:pre, ssh, data) + vnm.action_pre(data) pp ssh.run("cat << EOT | #{remote_scripts_path}/deploy #{dfile} #{host}", domain+"\nEOT\n") From aee7cf809403154f44d634a75800d647a0cdd76a Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Mon, 21 Nov 2011 19:09:04 +0100 Subject: [PATCH 027/157] feature #863: Added files --- src/mad/ruby/DriverExecHelper.rb | 129 +++++++++++++++++++++++++++++++ src/mad/ruby/StreamDriver.rb | 46 +++++++++++ 2 files changed, 175 insertions(+) create mode 100644 src/mad/ruby/DriverExecHelper.rb create mode 100644 src/mad/ruby/StreamDriver.rb diff --git a/src/mad/ruby/DriverExecHelper.rb b/src/mad/ruby/DriverExecHelper.rb new file mode 100644 index 0000000000..ff43bdbfcd --- /dev/null +++ b/src/mad/ruby/DriverExecHelper.rb @@ -0,0 +1,129 @@ +# -------------------------------------------------------------------------- # +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# # +# Licensed 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 module provides an abstraction to generate an execution context for +# OpenNebula Drivers +module DriverExecHelper + #Initialize module variables + def initialize_helper(directory, options) + @config = read_configuration + @remote_scripts_base_path = @config['SCRIPTS_REMOTE_DIR'] + + @local_actions = options[:local_actions] + + if ENV['ONE_LOCATION'] == nil + @local_scripts_base_path = "/var/lib/one/remotes" + else + @local_scripts_base_path = "#{ENV['ONE_LOCATION']}/var/remotes" + end + + # dummy paths + @remote_scripts_path = File.join(@remote_scripts_base_path, directory) + @local_scripts_path = File.join(@local_scripts_base_path, directory) + end + + # Given the action name and the parameter returns full path of the script + # and appends its parameters. It uses @local_actions hash to know if the + # actions is remote or local. If the local actions has defined an special + # script name this is used, otherwise the action name in downcase is + # used as the script name. + # + # @param [String, Symbol] action name of the action + # @param [String] parameters arguments for the script + # @param [String, nil] default_name alternative name for the script + # @return [String] command line needed to execute the action + def action_command_line(action, parameters, default_name=nil) + if action_is_local? action + script_path=@local_scripts_path + else + script_path=@remote_scripts_path + end + + File.join(script_path, action_script_name(action, default_name))+ + " "+parameters + end + + # True if the action is meant to be executed locally + # + # @param [String, Symbol] action name of the action + def action_is_local?(action) + @local_actions.include? action.to_s.upcase + end + + # Name of the script file for the given action + # + # @param [String, Symbol] action name of the action + # @param [String, nil] default_name alternative name for the script + def action_script_name(action, default_name=nil) + name=@local_actions[action.to_s.upcase] + + if name + name + else + default_name || action.to_s.downcase + end + end + + def get_info_from_execution(command_exe) + if command_exe.code == 0 + result = RESULT[:success] + info = command_exe.stdout + else + result = RESULT[:failure] + info = command_exe.get_error_message + end + + info = "-" if info == nil || info.empty? + + [result, info] + end + + # Simple parser for the config file generated by OpenNebula + def read_configuration + one_config=nil + + if ENV['ONE_LOCATION'] + one_config=ENV['ONE_LOCATION']+'/var/config' + else + one_config='/var/lib/one/config' + end + + config=Hash.new + cfg='' + + begin + open(one_config) do |file| + cfg=file.read + end + + cfg.split(/\n/).each do |line| + m=line.match(/^([^=]+)=(.*)$/) + + if m + name=m[1].strip.upcase + value=m[2].strip + config[name]=value + end + end + rescue Exception => e + STDERR.puts "Error reading config: #{e.inspect}" + STDERR.flush + end + + config + end +end \ No newline at end of file diff --git a/src/mad/ruby/StreamDriver.rb b/src/mad/ruby/StreamDriver.rb new file mode 100644 index 0000000000..e07b8ef428 --- /dev/null +++ b/src/mad/ruby/StreamDriver.rb @@ -0,0 +1,46 @@ +# -------------------------------------------------------------------------- # +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# # +# Licensed 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 module provides an abstraction to generate an execution context for +# OpenNebula Drivers + +class VirtualNetworkDriver + include DriverExecHelper + + def initialize(directory, options={}) + + @options = options + @ssh_stream = options[:ssh_stream] + + + initialize_helper("vnet/#{directory}", options) + end + + def do_action(parameters, aname) + vm_encoded = Base64.encode64(message.elements['VM'].to_s).delete("\n") + + command = action_command_line(aname, @vm_encoded, options[:script_name]) + + if action_is_local? aname + execution = LocalCommand.run(command, log_method(id)) + else + execution = @ssh_stream.run(command) + end + + result, info = get_info_from_execution(command_exe) + end +end From c061648b62e1bc8f70afde5c6c6231057ba4a620 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Mon, 21 Nov 2011 19:29:21 +0100 Subject: [PATCH 028/157] feature #863: changed StreamSriver to one_vnm --- src/{mad/ruby/StreamDriver.rb => vnm_mad/one_vnm.rb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{mad/ruby/StreamDriver.rb => vnm_mad/one_vnm.rb} (100%) diff --git a/src/mad/ruby/StreamDriver.rb b/src/vnm_mad/one_vnm.rb similarity index 100% rename from src/mad/ruby/StreamDriver.rb rename to src/vnm_mad/one_vnm.rb From 9624dd4b034c9a859583d4e1ddf5b8fe241c4864 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Tue, 22 Nov 2011 11:01:18 +0100 Subject: [PATCH 029/157] changes to vnm_driver --- src/mad/ruby/DriverExecHelper.rb | 6 +++--- src/vnm_mad/one_vnm.rb | 23 ++++++++++++----------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/mad/ruby/DriverExecHelper.rb b/src/mad/ruby/DriverExecHelper.rb index ff43bdbfcd..d857dec8ab 100644 --- a/src/mad/ruby/DriverExecHelper.rb +++ b/src/mad/ruby/DriverExecHelper.rb @@ -78,7 +78,7 @@ module DriverExecHelper end end - def get_info_from_execution(command_exe) + def get_info_from_execution(command_exe) if command_exe.code == 0 result = RESULT[:success] info = command_exe.stdout @@ -90,7 +90,7 @@ module DriverExecHelper info = "-" if info == nil || info.empty? [result, info] - end + end # Simple parser for the config file generated by OpenNebula def read_configuration @@ -126,4 +126,4 @@ module DriverExecHelper config end -end \ No newline at end of file +end diff --git a/src/vnm_mad/one_vnm.rb b/src/vnm_mad/one_vnm.rb index e07b8ef428..586f24c7eb 100644 --- a/src/vnm_mad/one_vnm.rb +++ b/src/vnm_mad/one_vnm.rb @@ -19,21 +19,21 @@ # OpenNebula Drivers class VirtualNetworkDriver - include DriverExecHelper + include DriverExecHelper - def initialize(directory, options={}) + def initialize(directory, options={}) - @options = options - @ssh_stream = options[:ssh_stream] + @options = options + @ssh_stream = options[:ssh_stream] + @message = options[:message] + @vm_encoded = Base64.encode64(@message.elements['VM'].to_s).delete("\n") - initialize_helper("vnet/#{directory}", options) - end + initialize_helper("vnet/#{directory}", options) + end - def do_action(parameters, aname) - vm_encoded = Base64.encode64(message.elements['VM'].to_s).delete("\n") - - command = action_command_line(aname, @vm_encoded, options[:script_name]) + def do_action(parameters, aname) + command = action_command_line(aname, @vm_encoded, options[:script_name]) if action_is_local? aname execution = LocalCommand.run(command, log_method(id)) @@ -42,5 +42,6 @@ class VirtualNetworkDriver end result, info = get_info_from_execution(command_exe) - end + end end + From d62d57ece67ddf87adcb59000174e0e3f0a02ba4 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Tue, 22 Nov 2011 12:08:14 +0100 Subject: [PATCH 030/157] Do not SHA1-hash passwords when creating or passwd-ing users in Sunstone. One Core takes care of it now. --- src/sunstone/models/OpenNebulaJSON/UserJSON.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/sunstone/models/OpenNebulaJSON/UserJSON.rb b/src/sunstone/models/OpenNebulaJSON/UserJSON.rb index 0fe15fdcc5..726845d23c 100644 --- a/src/sunstone/models/OpenNebulaJSON/UserJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/UserJSON.rb @@ -26,9 +26,9 @@ module OpenNebulaJSON return user_hash end - password = Digest::SHA1.hexdigest(user_hash['password']) - - self.allocate(user_hash['name'], password, user_hash['auth_driver']) + self.allocate(user_hash['name'], + user_hash['password'], + user_hash['auth_driver']) end def perform_action(template_json) @@ -40,7 +40,7 @@ module OpenNebulaJSON rc = case action_hash['perform'] when "passwd" then self.passwd(action_hash['params']) when "chgrp" then self.chgrp(action_hash['params']) - when "chauth" then self.chauth(action_hash['params']) + when "chauth" then self.chauth(action_hash['params']) when "update" then self.update(action_hash['params']) when "addgroup" then self.addgroup(action_hash['params']) when "delgroup" then self.delgroup(action_hash['params']) @@ -52,8 +52,7 @@ module OpenNebulaJSON end def passwd(params=Hash.new) - password = Digest::SHA1.hexdigest(params['password']) - super(password) + super(params['password']) end def chgrp(params=Hash.new) From 122bd19678d538f7de20d722ac7a6b0ed518ab8d Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 22 Nov 2011 12:08:56 +0100 Subject: [PATCH 031/157] feature #863: Increased buffer read to 80, in ssh streamer --- src/mad/ruby/ssh_stream.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mad/ruby/ssh_stream.rb b/src/mad/ruby/ssh_stream.rb index 2ae9167471..b2e9595a4a 100644 --- a/src/mad/ruby/ssh_stream.rb +++ b/src/mad/ruby/ssh_stream.rb @@ -65,7 +65,7 @@ class SshStream rc, rw, = IO.select([@stdout, @stderr],[],[]) rc.each { |fd| - c = fd.read_nonblock(1) + c = fd.read_nonblock(80) if !c done = true From 7d89b719a59a5f563674e5d75681331cbcee2da6 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 22 Nov 2011 12:09:41 +0100 Subject: [PATCH 032/157] feature #863: Moved RESULT constants to base module for get_info_from_execution --- src/mad/ruby/DriverExecHelper.rb | 14 +++++++++++--- src/mad/ruby/OpenNebulaDriver.rb | 7 ------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/mad/ruby/DriverExecHelper.rb b/src/mad/ruby/DriverExecHelper.rb index d857dec8ab..9ea245f8c6 100644 --- a/src/mad/ruby/DriverExecHelper.rb +++ b/src/mad/ruby/DriverExecHelper.rb @@ -16,8 +16,15 @@ # This module provides an abstraction to generate an execution context for -# OpenNebula Drivers +# OpenNebula Drivers. The module has been designed to be included as part +# of a driver and not to be used standalone. module DriverExecHelper + # Action result strings for messages + RESULT = { + :success => "SUCCESS", + :failure => "FAILURE" + } + #Initialize module variables def initialize_helper(directory, options) @config = read_configuration @@ -78,6 +85,7 @@ module DriverExecHelper end end + #This method returns the result in terms def get_info_from_execution(command_exe) if command_exe.code == 0 result = RESULT[:success] @@ -97,9 +105,9 @@ module DriverExecHelper one_config=nil if ENV['ONE_LOCATION'] - one_config=ENV['ONE_LOCATION']+'/var/config' + one_config = ENV['ONE_LOCATION']+'/var/config' else - one_config='/var/lib/one/config' + one_config = '/var/lib/one/config' end config=Hash.new diff --git a/src/mad/ruby/OpenNebulaDriver.rb b/src/mad/ruby/OpenNebulaDriver.rb index 4833d7bdd4..174e65a9db 100644 --- a/src/mad/ruby/OpenNebulaDriver.rb +++ b/src/mad/ruby/OpenNebulaDriver.rb @@ -37,13 +37,6 @@ class OpenNebulaDriver < ActionManager # @return [String] Path for scripts attr_reader :local_scripts_path, :remote_scripts_path - - # Action result strings for messages - RESULT = { - :success => "SUCCESS", - :failure => "FAILURE" - } - # Initialize OpenNebulaDriver object # # @param [String] directory path inside the remotes directory where the From 0143a6d5204081e7a1f032e8d7afe28fc98e0ae7 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 22 Nov 2011 12:19:26 +0100 Subject: [PATCH 033/157] feature #863: Moved Log methods to base driver module --- src/mad/ruby/DriverExecHelper.rb | 56 +++++++++++++++++++++++++++++++- src/mad/ruby/OpenNebulaDriver.rb | 51 ++--------------------------- 2 files changed, 58 insertions(+), 49 deletions(-) diff --git a/src/mad/ruby/DriverExecHelper.rb b/src/mad/ruby/DriverExecHelper.rb index 9ea245f8c6..d3d440b7d3 100644 --- a/src/mad/ruby/DriverExecHelper.rb +++ b/src/mad/ruby/DriverExecHelper.rb @@ -42,7 +42,10 @@ module DriverExecHelper @remote_scripts_path = File.join(@remote_scripts_base_path, directory) @local_scripts_path = File.join(@local_scripts_base_path, directory) end - + + # + # METHODS FOR COMMAND LINE & ACTION PATHS + # # Given the action name and the parameter returns full path of the script # and appends its parameters. It uses @local_actions hash to know if the # actions is remote or local. If the local actions has defined an special @@ -85,6 +88,55 @@ module DriverExecHelper end end + # + # METHODS FOR LOGS & COMMAND OUTPUT + # + # Sends a log message to ONE. The +message+ can be multiline, it will + # be automatically splitted by lines. + def log(number, message) + in_error_message=false + msg=message.strip + msg.each_line {|line| + severity='I' + + l=line.strip + + if l=='ERROR MESSAGE --8<------' + in_error_message=true + next + elsif l=='ERROR MESSAGE ------>8--' + in_error_message=false + next + else + if in_error_message + severity='E' + elsif line.match(/^(ERROR|DEBUG|INFO):(.*)$/) + line=$2 + case $1 + when 'ERROR' + severity='E' + when 'DEBUG' + severity='D' + when 'INFO' + severity='I' + else + severity='I' + end + end + end + + send_message("LOG", severity, number, line.strip) + } + end + + # Generates a proc with that calls log with a hardcoded number. It will + # be used to add loging to command actions + def log_method(num) + lambda {|message| + log(num, message) + } + end + #This method returns the result in terms def get_info_from_execution(command_exe) if command_exe.code == 0 @@ -100,6 +152,8 @@ module DriverExecHelper [result, info] end + # + # # Simple parser for the config file generated by OpenNebula def read_configuration one_config=nil diff --git a/src/mad/ruby/OpenNebulaDriver.rb b/src/mad/ruby/OpenNebulaDriver.rb index 174e65a9db..117706ae89 100644 --- a/src/mad/ruby/OpenNebulaDriver.rb +++ b/src/mad/ruby/OpenNebulaDriver.rb @@ -88,6 +88,7 @@ class OpenNebulaDriver < ActionManager # @option ops [String] :stdin text to be writen to stdin # @option ops [String] :script_name default script name for the action, # action name is used by defaults + # @option ops [String] :respond if defined will send result to ONE core def do_action(parameters, id, host, aname, ops={}) options={ :stdin => nil, @@ -95,9 +96,9 @@ class OpenNebulaDriver < ActionManager :respond => true }.merge(ops) - params=parameters+" #{id} #{host}" + params = parameters+" #{id} #{host}" - command=action_command_line(aname, params, options[:script_name]) + command = action_command_line(aname, params, options[:script_name]) if ops[:local] || action_is_local? aname execution = LocalCommand.run(command, log_method(id)) @@ -119,52 +120,6 @@ class OpenNebulaDriver < ActionManager [result, info] end - # Sends a log message to ONE. The +message+ can be multiline, it will - # be automatically splitted by lines. - def log(number, message) - in_error_message=false - msg=message.strip - msg.each_line {|line| - severity='I' - - l=line.strip - - if l=='ERROR MESSAGE --8<------' - in_error_message=true - next - elsif l=='ERROR MESSAGE ------>8--' - in_error_message=false - next - else - if in_error_message - severity='E' - elsif line.match(/^(ERROR|DEBUG|INFO):(.*)$/) - line=$2 - case $1 - when 'ERROR' - severity='E' - when 'DEBUG' - severity='D' - when 'INFO' - severity='I' - else - severity='I' - end - end - end - - send_message("LOG", severity, number, line.strip) - } - end - - # Generates a proc with that calls log with a hardcoded number. It will - # be used to add loging to command actions - def log_method(num) - lambda {|message| - log(num, message) - } - end - # Start the driver. Reads from STDIN and executes methods associated with # the messages def start_driver From 6397c362ace92abb3b17d83b31dd9beb290f4eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 22 Nov 2011 03:33:01 -0800 Subject: [PATCH 034/157] Bug #998: Duplicate the password argument object in oneuser, to avoid frozen string error --- src/cli/one_helper/oneuser_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/one_helper/oneuser_helper.rb b/src/cli/one_helper/oneuser_helper.rb index 48b87abead..187e8f8584 100644 --- a/src/cli/one_helper/oneuser_helper.rb +++ b/src/cli/one_helper/oneuser_helper.rb @@ -37,7 +37,7 @@ class OneUserHelper < OpenNebulaHelper::OneHelper return -1, "Can not read file: #{arg}" end else - password = arg + password = arg.dup end if options[:driver] == OpenNebula::User::X509_AUTH From 594f49505038458f5307fb168cdad5a90448ff9f Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 22 Nov 2011 12:44:37 +0100 Subject: [PATCH 035/157] feature #863: Fixes var name --- src/mad/ruby/OpenNebulaDriver.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mad/ruby/OpenNebulaDriver.rb b/src/mad/ruby/OpenNebulaDriver.rb index 117706ae89..bf2ebcede2 100644 --- a/src/mad/ruby/OpenNebulaDriver.rb +++ b/src/mad/ruby/OpenNebulaDriver.rb @@ -89,6 +89,7 @@ class OpenNebulaDriver < ActionManager # @option ops [String] :script_name default script name for the action, # action name is used by defaults # @option ops [String] :respond if defined will send result to ONE core + # @option ops [String] :local if defined will execute the action locally def do_action(parameters, id, host, aname, ops={}) options={ :stdin => nil, @@ -111,7 +112,7 @@ class OpenNebulaDriver < ActionManager @retries) end - result, info = get_info_from_execution(command_exe) + result, info = get_info_from_execution(execution) if ops[:respond] send_message(aname,result,id,info) From e4cae17f92cc3ca583ea43a3c0b4bfcd8ee628fe Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 22 Nov 2011 12:44:51 +0100 Subject: [PATCH 036/157] feature #863: Add support to stdin to the VirtualNetwork driver --- src/vnm_mad/one_vnm.rb | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/vnm_mad/one_vnm.rb b/src/vnm_mad/one_vnm.rb index 586f24c7eb..a48a374e20 100644 --- a/src/vnm_mad/one_vnm.rb +++ b/src/vnm_mad/one_vnm.rb @@ -21,6 +21,10 @@ class VirtualNetworkDriver include DriverExecHelper + # Inits the VNET Driver + # @param [String] name of the vnet driver to use, as listed in remotes/vnet + # @option ops [String] :ssh_stream to be used for command execution + # @option ops [String] :message from ONE def initialize(directory, options={}) @options = options @@ -32,16 +36,33 @@ class VirtualNetworkDriver initialize_helper("vnet/#{directory}", options) end - def do_action(parameters, aname) - command = action_command_line(aname, @vm_encoded, options[:script_name]) + # Calls remotes or local action checking the action name and + # @local_actions. Optional arguments can be specified as a hash + # + # @param [Number, String] id action identifier + # @param [String, Symbol] aname name of the action + # @param [Hash] ops extra options for the command + # @option ops [String] :stdin text to be writen to stdin + def do_action(id, aname, ops = {}) + options={ + :stdin => nil, + }.merge(ops) + + command = action_command_line(aname, @vm_encoded) if action_is_local? aname execution = LocalCommand.run(command, log_method(id)) else - execution = @ssh_stream.run(command) + if options[:stdin] + command = "cat << EOT | #{command}" + stdin = "#{options[:stdin]\nEOT\n}" + else + stdin = nil + end + + execution = @ssh_stream.run(command,stdin) end - result, info = get_info_from_execution(command_exe) + result, info = get_info_from_execution(execution) end -end - +end \ No newline at end of file From 300f2a6633ca3dde5ccbccf8b303983b77a8f8db Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 22 Nov 2011 12:52:33 +0100 Subject: [PATCH 037/157] feature #863: Adds support for ssh_streams to OpenNebulaDriver --- src/mad/ruby/OpenNebulaDriver.rb | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/mad/ruby/OpenNebulaDriver.rb b/src/mad/ruby/OpenNebulaDriver.rb index bf2ebcede2..549a91614e 100644 --- a/src/mad/ruby/OpenNebulaDriver.rb +++ b/src/mad/ruby/OpenNebulaDriver.rb @@ -92,17 +92,27 @@ class OpenNebulaDriver < ActionManager # @option ops [String] :local if defined will execute the action locally def do_action(parameters, id, host, aname, ops={}) options={ - :stdin => nil, + :stdin => nil, :script_name => nil, - :respond => true + :respond => true, + :ssh_stream => nil }.merge(ops) params = parameters+" #{id} #{host}" - command = action_command_line(aname, params, options[:script_name]) - if ops[:local] || action_is_local? aname + if options[:local] || action_is_local? aname execution = LocalCommand.run(command, log_method(id)) + elsif options[:ssh_stream] + if options[:stdin] + command = "cat << EOT | #{command}" + stdin = "#{options[:stdin]\nEOT\n}" + else + stdin = nil + end + + execution = options[:ssh_stream].run(command,stdin) + else execution = RemotesCommand.run(command, host, @@ -114,13 +124,14 @@ class OpenNebulaDriver < ActionManager result, info = get_info_from_execution(execution) - if ops[:respond] + if options[:respond] send_message(aname,result,id,info) end [result, info] end + # Start the driver. Reads from STDIN and executes methods associated with # the messages def start_driver From fa0cdade1dc871c706a162f19777efa34c771d6a Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 22 Nov 2011 13:15:09 +0100 Subject: [PATCH 038/157] feature #863: Use new VirtualNetworkDriver & VM Driver --- src/mad/ruby/DriverExecHelper.rb | 4 ++ src/vmm_mad/exec/one_vmm_exec.rb | 98 +++++++++++--------------------- 2 files changed, 37 insertions(+), 65 deletions(-) diff --git a/src/mad/ruby/DriverExecHelper.rb b/src/mad/ruby/DriverExecHelper.rb index d3d440b7d3..478ab49260 100644 --- a/src/mad/ruby/DriverExecHelper.rb +++ b/src/mad/ruby/DriverExecHelper.rb @@ -25,6 +25,10 @@ module DriverExecHelper :failure => "FAILURE" } + def failed?(rc_str) + return rc_str == RESULT[:failure] + end + #Initialize module variables def initialize_helper(directory, options) @config = read_configuration diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 7a42b35af7..42be7534cc 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -52,60 +52,14 @@ class ExecDriver < VirtualMachineDriver @hypervisor = hypervisor end - # network script actions - - def execute_network_script(action, connection, message) - driver=message.elements['NET_DRV'].text - id=message.elements['VM/ID'].text - - vm_encoded=Base64.encode64(message.elements['VM'].to_s).delete("\n") - - result=[false, ''] - - if(action_is_local?(action.to_s)) - script_path=File.join( - @local_scripts_base_path, - 'vnm', - driver, - action.to_s) - - command="#{script_path} #{vm_encoded}" - - command_exe = LocalCommand.run(command, log_method(id)) - - code=(command_exe.code==0) - - result=[code, command_exe] - else - script_path=File.join( - @remote_scripts_base_path, - 'vnm', - driver, - action.to_s) - - command="#{script_path} #{vm_encoded}" - - pp command - - error_code=connection.run(command) - - pp error_code - pp connection.stderr - - code=(error_code==0) - - result=[code, connection] - end - end - - # DEPLOY action, sends the deployment file to remote host def deploy(id, drv_message) data = decode(drv_message) - local_dfile = data.elements['LOCAL_DEPLOYMENT_FILE'].text + local_dfile = data.elements['LOCAL_DEPLOYMENT_FILE'].text remote_dfile = data.elements['REMOTE_DEPLOYMENT_FILE'].text - host= data.elements['HOST'].text + + host = data.elements['HOST'].text if !local_dfile || File.zero?(local_dfile) send_message(ACTION[:deploy],RESULT[:failure],id, @@ -113,33 +67,47 @@ class ExecDriver < VirtualMachineDriver return end - tmp = File.new(local_dfile) - domain = tmp.read - tmp.close() + domain = File.read(local_dfile) if action_is_local?(:deploy) - dfile=local_dfile + dfile = local_dfile else - dfile=remote_dfile + dfile = remote_dfile end + ssh = SshStreamCommand.new(host, log_method(id)) + vnm = VirtualNetworkDriver.new(data.elements['NET_DRV'].text, + :local_actions => @options[:local_actions], + :message => data, + :ssh_stream => ssh) + + result, info = vnm.do_action(id, :pre) - ssh=SshStreamCommand.new(host, log_method(id)) - vnm=crea nuevo driver(:ssh_stream => ssh) + if failed?(result) + send_message(:deploy,result,id,info) + return + end - #execute_network_script(:pre, ssh, data) - vnm.action_pre(data) + result, info = do_action("#{dfile} #{host}", id, host, :deploy, + :stdin => domain, + :ssh_stream => ssh, + :respond => false) - pp ssh.run("cat << EOT | #{remote_scripts_path}/deploy #{dfile} #{host}", - domain+"\nEOT\n") + if failed?(result) + send_message(:deploy,result,id,info) + return + end - execute_network_script(:post, ssh, data) + domain_id = info - pp ssh.stdout - pp ssh.stderr + result, info = vnm.do_action(id, :post) - #do_action("#{dfile} #{host}", id, host, :deploy, - # :stdin => domain) + if failed?(result) + send_message(:deploy,result,id,info) + return + end + + send_message(:deploy,RESULT[:success],id,domain_id) end # Basic Domain Management Operations From 041e58bbf4e2b908ced67225463874364d312c93 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 22 Nov 2011 13:35:46 +0100 Subject: [PATCH 039/157] feature #863: Use action names in messages --- src/vmm_mad/exec/one_vmm_exec.rb | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 42be7534cc..a9e012f0fb 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -84,30 +84,28 @@ class ExecDriver < VirtualMachineDriver result, info = vnm.do_action(id, :pre) if failed?(result) - send_message(:deploy,result,id,info) + send_message(ACTION[:deploy],result,id,info) return end - result, info = do_action("#{dfile} #{host}", id, host, :deploy, - :stdin => domain, - :ssh_stream => ssh, - :respond => false) - + result, domain_id = do_action("#{dfile} #{host}", id, host, :deploy, + :stdin => domain, + :ssh_stream => ssh, + :respond => false) if failed?(result) - send_message(:deploy,result,id,info) + send_message(ACTION[:deploy],result,id,info) return end - domain_id = info - result, info = vnm.do_action(id, :post) + #TODO: Need to rollback (VM is running) or send success and log error if failed?(result) - send_message(:deploy,result,id,info) + send_message(ACTION[:deploy],result,id,info) return end - send_message(:deploy,RESULT[:success],id,domain_id) + send_message(ACTION[:deploy],RESULT[:success],id,domain_id) end # Basic Domain Management Operations From 36127a584a21678363f4436dd6674af123efa5f0 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 22 Nov 2011 13:49:41 +0100 Subject: [PATCH 040/157] feature #863: Fix syntax errors --- install.sh | 3 +++ src/mad/ruby/DriverExecHelper.rb | 1 - src/mad/ruby/OpenNebulaDriver.rb | 6 ++++-- src/mad/ruby/ssh_stream.rb | 15 +++++++++++++++ src/vmm_mad/exec/one_vmm_exec.rb | 4 +--- src/vnm_mad/one_vnm.rb | 5 +++-- 6 files changed, 26 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index 310a15af65..151e6fcd5e 100755 --- a/install.sh +++ b/install.sh @@ -507,6 +507,9 @@ RUBY_LIB_FILES="src/mad/ruby/ActionManager.rb \ src/mad/ruby/CommandManager.rb \ src/mad/ruby/OpenNebulaDriver.rb \ src/mad/ruby/VirtualMachineDriver.rb \ + src/mad/ruby/DriverExecHelper.rb \ + src/mad/ruby/ssh_stream.rb \ + src/vnm_mad/one_vnm.rb \ src/mad/ruby/Ganglia.rb \ src/oca/ruby/OpenNebula.rb \ src/tm_mad/TMScript.rb \ diff --git a/src/mad/ruby/DriverExecHelper.rb b/src/mad/ruby/DriverExecHelper.rb index 478ab49260..37581568fd 100644 --- a/src/mad/ruby/DriverExecHelper.rb +++ b/src/mad/ruby/DriverExecHelper.rb @@ -14,7 +14,6 @@ # limitations under the License. # #--------------------------------------------------------------------------- # - # This module provides an abstraction to generate an execution context for # OpenNebula Drivers. The module has been designed to be included as part # of a driver and not to be used standalone. diff --git a/src/mad/ruby/OpenNebulaDriver.rb b/src/mad/ruby/OpenNebulaDriver.rb index 549a91614e..5e8f6126a3 100644 --- a/src/mad/ruby/OpenNebulaDriver.rb +++ b/src/mad/ruby/OpenNebulaDriver.rb @@ -17,6 +17,8 @@ require "ActionManager" require "CommandManager" +require "DriverExecHelper" + # Author:: dsa-research.org # Copyright:: (c) OpenNebula Project Leads (OpenNebula.org) # License:: Apache License @@ -101,12 +103,12 @@ class OpenNebulaDriver < ActionManager params = parameters+" #{id} #{host}" command = action_command_line(aname, params, options[:script_name]) - if options[:local] || action_is_local? aname + if options[:local] || action_is_local?(aname) execution = LocalCommand.run(command, log_method(id)) elsif options[:ssh_stream] if options[:stdin] command = "cat << EOT | #{command}" - stdin = "#{options[:stdin]\nEOT\n}" + stdin = "#{options[:stdin]}\nEOT\n" else stdin = nil end diff --git a/src/mad/ruby/ssh_stream.rb b/src/mad/ruby/ssh_stream.rb index b2e9595a4a..c67988b5d9 100644 --- a/src/mad/ruby/ssh_stream.rb +++ b/src/mad/ruby/ssh_stream.rb @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# # +# Licensed 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. # +#--------------------------------------------------------------------------- # require 'CommandManager' require 'open3' diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index a9e012f0fb..4203210a24 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -1,6 +1,5 @@ #!/usr/bin/env ruby - # -------------------------------------------------------------------------- # # Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # # # @@ -17,7 +16,6 @@ # limitations under the License. # #--------------------------------------------------------------------------- # - # Set up the environment for the driver ONE_LOCATION = ENV["ONE_LOCATION"] @@ -33,9 +31,9 @@ end $: << RUBY_LIB_LOCATION require "VirtualMachineDriver" +require 'one_vnm' require 'getoptlong' -require 'ssh_stream' require 'pp' # The main class for the Sh driver diff --git a/src/vnm_mad/one_vnm.rb b/src/vnm_mad/one_vnm.rb index a48a374e20..4847c4deea 100644 --- a/src/vnm_mad/one_vnm.rb +++ b/src/vnm_mad/one_vnm.rb @@ -14,6 +14,7 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +require "DriverExecHelper" # This module provides an abstraction to generate an execution context for # OpenNebula Drivers @@ -50,12 +51,12 @@ class VirtualNetworkDriver command = action_command_line(aname, @vm_encoded) - if action_is_local? aname + if action_is_local?(aname) execution = LocalCommand.run(command, log_method(id)) else if options[:stdin] command = "cat << EOT | #{command}" - stdin = "#{options[:stdin]\nEOT\n}" + stdin = "#{options[:stdin]}\nEOT\n" else stdin = nil end From 8153b4d5e67a6ab047cfd6a33758a27d71bcdd82 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Tue, 22 Nov 2011 12:08:14 +0100 Subject: [PATCH 041/157] Do not SHA1-hash passwords when creating or passwd-ing users in Sunstone. One Core takes care of it now. (cherry picked from commit d62d57ece67ddf87adcb59000174e0e3f0a02ba4) --- src/sunstone/models/OpenNebulaJSON/UserJSON.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/sunstone/models/OpenNebulaJSON/UserJSON.rb b/src/sunstone/models/OpenNebulaJSON/UserJSON.rb index 0fe15fdcc5..726845d23c 100644 --- a/src/sunstone/models/OpenNebulaJSON/UserJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/UserJSON.rb @@ -26,9 +26,9 @@ module OpenNebulaJSON return user_hash end - password = Digest::SHA1.hexdigest(user_hash['password']) - - self.allocate(user_hash['name'], password, user_hash['auth_driver']) + self.allocate(user_hash['name'], + user_hash['password'], + user_hash['auth_driver']) end def perform_action(template_json) @@ -40,7 +40,7 @@ module OpenNebulaJSON rc = case action_hash['perform'] when "passwd" then self.passwd(action_hash['params']) when "chgrp" then self.chgrp(action_hash['params']) - when "chauth" then self.chauth(action_hash['params']) + when "chauth" then self.chauth(action_hash['params']) when "update" then self.update(action_hash['params']) when "addgroup" then self.addgroup(action_hash['params']) when "delgroup" then self.delgroup(action_hash['params']) @@ -52,8 +52,7 @@ module OpenNebulaJSON end def passwd(params=Hash.new) - password = Digest::SHA1.hexdigest(params['password']) - super(password) + super(params['password']) end def chgrp(params=Hash.new) From 2bce90b59b98a518897069a3c6b73f9c241a5b1d Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Wed, 23 Nov 2011 11:41:29 +0100 Subject: [PATCH 042/157] DATABLOCK support for quotas --- src/authm_mad/remotes/quota/quota.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/authm_mad/remotes/quota/quota.rb b/src/authm_mad/remotes/quota/quota.rb index 4231c105ce..046bdc9493 100644 --- a/src/authm_mad/remotes/quota/quota.rb +++ b/src/authm_mad/remotes/quota/quota.rb @@ -78,7 +78,13 @@ class Quota IMAGE_USAGE = { :STORAGE => { - :proc_info => lambda {|template| File.size(template['PATH']) }, + :proc_info => lambda {|template| + if template['TYPE'] == 'DATABLOCK' + template['SIZE'].to_i + else + File.size(template['PATH']) + end + }, :xpath => 'SIZE' } } From c36ad64bf7eaea75f2e187ef9cc33e4a6d84dbf5 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Wed, 23 Nov 2011 11:41:47 +0100 Subject: [PATCH 043/157] Use GNAME instead of GID in oneuser show --- src/cli/one_helper/oneuser_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/one_helper/oneuser_helper.rb b/src/cli/one_helper/oneuser_helper.rb index 48b87abead..1ce8cd4b59 100644 --- a/src/cli/one_helper/oneuser_helper.rb +++ b/src/cli/one_helper/oneuser_helper.rb @@ -166,7 +166,7 @@ class OneUserHelper < OpenNebulaHelper::OneHelper CLIHelper.print_header(str_h1 % "USER #{user['ID']} INFORMATION") puts str % ["ID", user.id.to_s] puts str % ["NAME", user.name] - puts str % ["GROUP", user.gid] + puts str % ["GROUP", user['GNAME']] puts str % ["PASSWORD", user['PASSWORD']] puts str % ["AUTH_DRIVER", user['AUTH_DRIVER']] From 9f279a004ace78295db0f009cf4b046d9baeca96 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Wed, 23 Nov 2011 12:33:18 +0100 Subject: [PATCH 044/157] bug #1001: oneadmin_token is regenerated if it expires --- src/cloud/common/CloudAuth.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/cloud/common/CloudAuth.rb b/src/cloud/common/CloudAuth.rb index c11f7b4a54..f3fe29ca15 100644 --- a/src/cloud/common/CloudAuth.rb +++ b/src/cloud/common/CloudAuth.rb @@ -64,15 +64,16 @@ class CloudAuth begin require core_auth[0] @server_auth = Kernel.const_get(core_auth[1]).new_client - - token = @server_auth.login_token(expiration_time) - @oneadmin_client ||= OpenNebula::Client.new(token, @conf[:one_xmlrpc]) rescue => e raise e.message end end - def client(username) + # Generate a new OpenNebula client for the target User, if the username + # is nil the Client is generated for the server_admin + # ussername:: _String_ Name of the User + # [return] _Client_ + def client(username=nil) token = @server_auth.login_token(expiration_time,username) Client.new(token,@conf[:one_xmlrpc]) end @@ -97,7 +98,7 @@ class CloudAuth end def update_userpool_cache - @user_pool ||= OpenNebula::UserPool.new(@oneadmin_client) + @user_pool = OpenNebula::UserPool.new(client) rc = @user_pool.info if OpenNebula.is_error?(rc) From 2e508eb3396898a3b679e5f652c4cf4894cd085c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 23 Nov 2011 12:52:42 +0100 Subject: [PATCH 045/157] Bug #999: Enclose auth driver scripts paramenters in single quotes. Quotes inside the parameters are escaped --- src/authm_mad/one_auth_mad.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/authm_mad/one_auth_mad.rb b/src/authm_mad/one_auth_mad.rb index 81ea494ecf..46d8136344 100755 --- a/src/authm_mad/one_auth_mad.rb +++ b/src/authm_mad/one_auth_mad.rb @@ -107,9 +107,9 @@ class AuthDriver < OpenNebulaDriver #build path for the auth action #/var/lib/one/remotes/auth//authenticate authN_path = File.join(@local_scripts_path, driver) - - command = File.join(authN_path,ACTION[:authN].downcase) - command << ' ' << user << ' ' << password << ' ' << secret + + command = File.join(authN_path,ACTION[:authN].downcase) + command << " '" << user.gsub("'", '\'"\'"\'') << "' '" << password.gsub("'", '\'"\'"\'') << "' " << secret local_action(command, request_id, ACTION[:authN]) end From 82a78bb9a60e2130139a1608f415296981207a05 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Thu, 24 Nov 2011 18:31:07 +0100 Subject: [PATCH 046/157] feature #863: write 100 byte blocks to ssh so the pipe is not filled --- src/mad/ruby/ssh_stream.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mad/ruby/ssh_stream.rb b/src/mad/ruby/ssh_stream.rb index c67988b5d9..d055c33c9d 100644 --- a/src/mad/ruby/ssh_stream.rb +++ b/src/mad/ruby/ssh_stream.rb @@ -63,7 +63,16 @@ class SshStream @err = "" begin - @stdin.write "(#{command}); #{EOF_CMD}\n" + cmd="(#{command}); #{EOF_CMD}\n" + + sliced=cmd.scan(/.{1,100}/) + + sliced.each do |slice| + @stdin.write slice + @stdin.flush + end + + @stdin.puts @stdin.flush rescue From c04e4da220fb39f8c13b3709366281dbf1735f00 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Thu, 24 Nov 2011 18:32:25 +0100 Subject: [PATCH 047/157] feature #863: bug fixes and cosmetic changes --- src/mad/ruby/ssh_stream.rb | 10 +++++++--- src/vmm_mad/exec/one_vmm_exec.rb | 1 + src/vnm_mad/one_vnm.rb | 6 +++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/mad/ruby/ssh_stream.rb b/src/mad/ruby/ssh_stream.rb index d055c33c9d..6feb379752 100644 --- a/src/mad/ruby/ssh_stream.rb +++ b/src/mad/ruby/ssh_stream.rb @@ -86,10 +86,14 @@ class SshStream code = -1 while not (done_out and done_err) - rc, rw, = IO.select([@stdout, @stderr],[],[]) + rc, rw, re= IO.select([@stdout, @stderr],[],[]) rc.each { |fd| - c = fd.read_nonblock(80) + begin + c = fd.read_nonblock(50) + rescue EOFError => e + next + end if !c done = true @@ -153,7 +157,7 @@ class SshStreamCommand < GenericCommand log(@stderr) - return @code + return self end end diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 4203210a24..83043836d1 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -33,6 +33,7 @@ $: << RUBY_LIB_LOCATION require "VirtualMachineDriver" require 'one_vnm' require 'getoptlong' +require 'ssh_stream' require 'pp' diff --git a/src/vnm_mad/one_vnm.rb b/src/vnm_mad/one_vnm.rb index 4847c4deea..a5f069b1c5 100644 --- a/src/vnm_mad/one_vnm.rb +++ b/src/vnm_mad/one_vnm.rb @@ -34,7 +34,7 @@ class VirtualNetworkDriver @vm_encoded = Base64.encode64(@message.elements['VM'].to_s).delete("\n") - initialize_helper("vnet/#{directory}", options) + initialize_helper("vnm/#{directory}", options) end # Calls remotes or local action checking the action name and @@ -61,9 +61,9 @@ class VirtualNetworkDriver stdin = nil end - execution = @ssh_stream.run(command,stdin) + execution = @ssh_stream.run(command, stdin) end result, info = get_info_from_execution(execution) end -end \ No newline at end of file +end From 93fbaab0c956077b5be916a51d9af8436ee75d6d Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Thu, 24 Nov 2011 18:33:52 +0100 Subject: [PATCH 048/157] feature #863: detect ssh errors --- src/mad/ruby/ssh_stream.rb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/mad/ruby/ssh_stream.rb b/src/mad/ruby/ssh_stream.rb index 6feb379752..7679f7e757 100644 --- a/src/mad/ruby/ssh_stream.rb +++ b/src/mad/ruby/ssh_stream.rb @@ -26,6 +26,7 @@ class SshStream EOF_ERR = "EOF_ERR" EOF_OUT = "EOF_OUT" RC_STR = "ExitCode: " + SSH_RC_STR = "ExitSSHCode: " EOF_CMD = "echo \"#{RC_STR}$?#{EOF_ERR}\" 1>&2; echo \"#{EOF_OUT}\"" SSH_CMD = "ssh" @@ -41,7 +42,7 @@ class SshStream end def open - @stdin, @stdout, @stderr=Open3::popen3("#{SSH_CMD} #{@host} bash -s") + @stdin, @stdout, @stderr=Open3::popen3("#{SSH_CMD} #{@host} bash -s ; echo #{SSH_RC_STR} $? 1>&2") @stream_out = "" @stream_err = "" @@ -106,13 +107,23 @@ class SshStream else @err << c - tmp = @err.scan(/^#{RC_STR}(\d*)#{EOF_ERR}\n/) + tmp = @err.scan(/^#{SSH_RC_STR}(\d+)$/) + + if tmp[0] + @err << "\n" + @err << "ERROR MESSAGE --8<------\n" + @err << "Error connecting to #{@host}\n" + @err << "ERROR MESSAGE ------>8--\n" + return tmp[0][0].to_i + end + + tmp = @err.scan(/^#{RC_STR}(\d*) #{EOF_ERR}\n/) if tmp[0] code = tmp[0][0].to_i done_err = true - @err.slice!("#{EOF_ERR}\n") + @err.slice!(" #{EOF_ERR}\n") end end } From 1a1529390387635e4cb25d16d6d9ab4fd7053a32 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Thu, 24 Nov 2011 18:35:30 +0100 Subject: [PATCH 049/157] feature #863: make end of stderr tag more readable --- src/mad/ruby/ssh_stream.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mad/ruby/ssh_stream.rb b/src/mad/ruby/ssh_stream.rb index 7679f7e757..664a469b20 100644 --- a/src/mad/ruby/ssh_stream.rb +++ b/src/mad/ruby/ssh_stream.rb @@ -17,6 +17,7 @@ require 'CommandManager' require 'open3' + class SshStream attr_reader :stream_out, :stream_err, :stdin attr_reader :out, :err @@ -28,7 +29,7 @@ class SshStream RC_STR = "ExitCode: " SSH_RC_STR = "ExitSSHCode: " - EOF_CMD = "echo \"#{RC_STR}$?#{EOF_ERR}\" 1>&2; echo \"#{EOF_OUT}\"" + EOF_CMD = "echo \"#{RC_STR}$? #{EOF_ERR}\" 1>&2; echo \"#{EOF_OUT}\"" SSH_CMD = "ssh" # # From 800ee164cf913ca6ca8ac212782dc3ee8946f6eb Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Fri, 25 Nov 2011 00:30:58 +0100 Subject: [PATCH 050/157] feature #863: uses scripts_common for error_messages, added more rescue if ssh command fails. --- src/mad/ruby/scripts_common.rb | 13 +++++++++--- src/mad/ruby/ssh_stream.rb | 38 +++++++++++++++++----------------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/src/mad/ruby/scripts_common.rb b/src/mad/ruby/scripts_common.rb index ba24205e20..8251ae48ff 100644 --- a/src/mad/ruby/scripts_common.rb +++ b/src/mad/ruby/scripts_common.rb @@ -43,11 +43,18 @@ module OpenNebula # This function is used to pass error message to the mad def self.error_message(message) - STDERR.puts "ERROR MESSAGE --8<------" - STDERR.puts message - STDERR.puts "ERROR MESSAGE ------>8--" + STDERR.puts format_error_message(message) end + #This function formats an error message for OpenNebula Copyright e + def self.format_error_message(message) + error_str = "ERROR MESSAGE --8<------\n" + error_str << message + error_str << "\nERROR MESSAGE ------>8--" + + return error_str + end + # Executes a command, if it fails returns error message and exits # If a second parameter is present it is used as the error message when # the command fails diff --git a/src/mad/ruby/ssh_stream.rb b/src/mad/ruby/ssh_stream.rb index 664a469b20..b0de36b72f 100644 --- a/src/mad/ruby/ssh_stream.rb +++ b/src/mad/ruby/ssh_stream.rb @@ -16,7 +16,7 @@ require 'CommandManager' require 'open3' - +require 'scripts_common' class SshStream attr_reader :stream_out, :stream_err, :stdin @@ -53,7 +53,10 @@ class SshStream end def close - @stdin.puts "\nexit" + begin + @stdin.puts "\nexit" + rescue #rescue from EPIPE if ssh command exited already + end @stdin.close if not @stdin.closed? @stdout.close if not @stdout.closed? @@ -93,15 +96,11 @@ class SshStream rc.each { |fd| begin c = fd.read_nonblock(50) - rescue EOFError => e + next if !c + rescue #rescue from EOF if ssh command finishes and closes fds next end - - if !c - done = true - break - end - + if fd == @stdout @out << c done_out = true if @out.slice!("#{EOF_OUT}\n") @@ -111,11 +110,14 @@ class SshStream tmp = @err.scan(/^#{SSH_RC_STR}(\d+)$/) if tmp[0] - @err << "\n" - @err << "ERROR MESSAGE --8<------\n" - @err << "Error connecting to #{@host}\n" - @err << "ERROR MESSAGE ------>8--\n" - return tmp[0][0].to_i + message = "Error connecting to #{@host}" + code = tmp[0][0].to_i + + @err << OpenNebula.format_error_message(message) + + done_out = true + done_err = true + break end tmp = @err.scan(/^#{RC_STR}(\d*) #{EOF_ERR}\n/) @@ -182,7 +184,7 @@ if $0 == __FILE__ ssh.exec("date | tee /tmp/test.javi") code=ssh.wait_for_command - + puts "Code: #{code}" puts "output: #{ssh.out}" @@ -206,10 +208,8 @@ if $0 == __FILE__ puts "output: #{ssh.out}" puts "output err: #{ssh.err}" - ssh.close + cssh = SshStreamCommand.new('no_host',lambda { |e| STDOUT.puts "error: #{e}" }, nil) + cssh.run('whoami') end - - - From f432498166d30f8b67706456effe2a3c0d340f28 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Fri, 25 Nov 2011 16:12:21 +0100 Subject: [PATCH 051/157] bug #845 and #995: compare src and dst in mv from ssh tm driver --- src/tm_mad/ssh/tm_mv.sh | 17 +++++++++++------ src/tm_mad/tm_common.sh | 14 ++++++++++++++ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/tm_mad/ssh/tm_mv.sh b/src/tm_mad/ssh/tm_mv.sh index 3f10354e8b..11bb1a5068 100755 --- a/src/tm_mad/ssh/tm_mv.sh +++ b/src/tm_mad/ssh/tm_mv.sh @@ -35,9 +35,14 @@ DST_HOST=`arg_host $DST` DST_DIR=`dirname $DST_PATH` -log "Moving $SRC_PATH" -exec_and_log "$SSH $DST_HOST mkdir -p $DST_DIR" \ - "Unable to create directory $DST_DIR" -exec_and_log "$SCP -r $SRC $DST" \ - "Could not copy $SRC to $DST" -exec_and_log "$SSH $SRC_HOST rm -rf $SRC_PATH" +if full_src_and_dst_equal; then + log "Not moving $SRC to $DST, they are the same path" +else + log "Moving $SRC_PATH" + exec_and_log "$SSH $DST_HOST mkdir -p $DST_DIR" \ + "Unable to create directory $DST_DIR" + exec_and_log "$SCP -r $SRC $DST" \ + "Could not copy $SRC to $DST" + exec_and_log "$SSH $SRC_HOST rm -rf $SRC_PATH" +fi + diff --git a/src/tm_mad/tm_common.sh b/src/tm_mad/tm_common.sh index 00ad3fb18a..957027deff 100644 --- a/src/tm_mad/tm_common.sh +++ b/src/tm_mad/tm_common.sh @@ -49,6 +49,20 @@ function fix_dir_slashes dirname "$1/file" | $SED 's/\/+/\//g' } +function get_compare_target +{ + echo "$1" | $SED 's/\/+/\//g' | $SED 's/\\/images$//' +} + +function full_src_and_dst_equal +{ + s=`get_compare_target "$SRC"` + d=`get_compare_target "$DST"` + + [ "$s" == "$d" ] + +} + function fix_var_slashes { ONE_LOCAL_VAR=`fix_dir_slashes "$ONE_LOCAL_VAR"` From f3eee993f338b8a637fe10d1cf853317a315c7e6 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Fri, 25 Nov 2011 16:46:15 +0100 Subject: [PATCH 052/157] bug #991: server_cipher passwords are hashed --- src/cli/one_helper/oneuser_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/one_helper/oneuser_helper.rb b/src/cli/one_helper/oneuser_helper.rb index adeead6767..15e9c9c4a9 100644 --- a/src/cli/one_helper/oneuser_helper.rb +++ b/src/cli/one_helper/oneuser_helper.rb @@ -44,7 +44,7 @@ class OneUserHelper < OpenNebulaHelper::OneHelper password.delete!("\s") end - if options[:sha1] + if options[:sha1] || options[:driver] == OpenNebula::User::CIPHER_AUTH require 'digest/sha1' password = Digest::SHA1.hexdigest(password) end From d564f2cb5bc5d115ee54e492f40269613ddf8468 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Fri, 25 Nov 2011 16:47:30 +0100 Subject: [PATCH 053/157] bug #996: oneuser chauth requires the driver twice --- src/cli/oneuser | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/cli/oneuser b/src/cli/oneuser index 293ecbcac1..75501a49fe 100755 --- a/src/cli/oneuser +++ b/src/cli/oneuser @@ -275,11 +275,25 @@ cmd=CommandParser::CmdParser.new(ARGV) do end chauth_desc = <<-EOT.unindent - Changes the User's auth driver + Changes the User's auth driver and its password (optional) + Examples: + oneuser chauth my_user core + oneuser chauth my_user core new_password + oneuser chauth my_user core -r /tmp/mypass + oneuser chauth my_user --ssh --key /home/oneadmin/.ssh/id_rsa + oneuser chauth my_user --ssh -r /tmp/public_key + oneuser chauth my_user --x509 --cert /tmp/my_cert.pem EOT - command :chauth, chauth_desc, :userid, :auth, [:password, nil], + command :chauth, chauth_desc, :userid, [:auth, nil], [:password, nil], :options=>create_options do + if options[:driver] + driver = options[:driver] + elsif args[1] + driver = args[1] + else + exit_with_code 0, "An Auth driver should be specified" + end helper = OneUserHelper.new @@ -297,7 +311,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do helper.perform_action(args[0], options, "Auth driver and password changed") do |user| - user.chauth(args[1], pass) + user.chauth(driver, pass) end end From 007e396e62f67d850f380d278c23cf24cafb2517 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Fri, 25 Nov 2011 16:47:49 +0100 Subject: [PATCH 054/157] bug #991: Add cipher auth constant --- src/oca/ruby/OpenNebula/User.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/oca/ruby/OpenNebula/User.rb b/src/oca/ruby/OpenNebula/User.rb index e9b44e8cef..51eb331ed4 100644 --- a/src/oca/ruby/OpenNebula/User.rb +++ b/src/oca/ruby/OpenNebula/User.rb @@ -38,6 +38,9 @@ module OpenNebula # Driver name for default core authentication CORE_AUTH = "core" + # Driver name for default core authentication + CIPHER_AUTH = "server_cipher" + # Driver name for ssh authentication SSH_AUTH = "ssh" From 053efd8854737371620223d1fc074fe9eb05fdc5 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Fri, 25 Nov 2011 17:03:31 +0100 Subject: [PATCH 055/157] feature #863: get xml values in all vmm actions --- src/vmm_mad/exec/one_vmm_exec.rb | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 83043836d1..659c37767c 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -111,49 +111,49 @@ class ExecDriver < VirtualMachineDriver def shutdown(id, drv_message) data = decode(drv_message) - host = data['HOST'] - deploy_id = data['DEPLOY_ID'] + host = data.elements['HOST'].text + deploy_id = data.elements['DEPLOY_ID'].text do_action("#{deploy_id} #{host}", id, host, :shutdown) end def cancel(id, drv_message) data = decode(drv_message) - host = data['HOST'] - deploy_id = data['DEPLOY_ID'] + host = data.elements['HOST'].text + deploy_id = data.elements['DEPLOY_ID'].text do_action("#{deploy_id} #{host}", id, host, :cancel) end def save(id, drv_message) data = decode(drv_message) - host = data['HOST'] - deploy_id = data['DEPLOY_ID'] - file = data['CHECKPOINT_FILE'] + host = data.elements['HOST'].text + deploy_id = data.elements['DEPLOY_ID'].text + file = data.elements['CHECKPOINT_FILE'].text do_action("#{deploy_id} #{file} #{host}", id, host, :save) end def restore(id, drv_message) data = decode(drv_message) - host = data['HOST'] - file = data['CHECKPOINT_FILE'] + host = data.elements['HOST'].text + file = data.elements['CHECKPOINT_FILE'].text do_action("#{file} #{host}", id, host, :restore) end def migrate(id, drv_message) data = decode(drv_message) - host = data['HOST'] - deploy_id = data['DEPLOY_ID'] + host = data.elements['HOST'].text + deploy_id = data.elements['DEPLOY_ID'].text do_action("#{deploy_id} #{dest_host} #{host}", id, host, :migrate) end def poll(id, drv_message) data = decode(drv_message) - host = data['HOST'] - deploy_id = data['DEPLOY_ID'] + host = data.elements['HOST'].text + deploy_id = data.elements['DEPLOY_ID'].text do_action("#{deploy_id} #{host}", id, host, :poll) end From 83e82830c8fa6951e21f5f2d7fd8270d8dc55e59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 25 Nov 2011 10:02:17 -0800 Subject: [PATCH 056/157] Feature #602: Refactor Ranged VNets to store first and last IP of the range --- include/FixedLeases.h | 8 +--- include/Leases.h | 25 ++++++----- include/RangedLeases.h | 14 ++---- include/VirtualNetwork.h | 3 ++ src/vnm/FixedLeases.cc | 2 +- src/vnm/RangedLeases.cc | 29 ++++-------- src/vnm/VirtualNetwork.cc | 92 ++++++++++++++++++++++----------------- 7 files changed, 83 insertions(+), 90 deletions(-) diff --git a/include/FixedLeases.h b/include/FixedLeases.h index 399afb02d7..d194a8130c 100644 --- a/include/FixedLeases.h +++ b/include/FixedLeases.h @@ -44,8 +44,7 @@ public: FixedLeases(SqlDB * db, int _oid, unsigned int _mac_prefix): - Leases(db,_oid,0), - mac_prefix(_mac_prefix), + Leases(db,_oid,0,_mac_prefix), current(leases.begin()){}; ~FixedLeases(){}; @@ -112,11 +111,6 @@ public: private: - /** - * The default MAC prefix for the Leases - */ - unsigned int mac_prefix; - /** * Current lease pointer */ diff --git a/include/Leases.h b/include/Leases.h index ef38c2c13b..5927f36f14 100644 --- a/include/Leases.h +++ b/include/Leases.h @@ -40,7 +40,7 @@ public: * @param _oid the virtual network unique identifier * @param _size the max number of leases */ - Leases(SqlDB * _db, int _oid, unsigned long _size): + Leases(SqlDB * _db, int _oid, unsigned long _size, unsigned int _mac_prefix): ObjectSQL(), oid(_oid), size(_size), n_used(0), db(_db){}; @@ -230,13 +230,13 @@ protected: // Leases fields // ------------------------------------------------------------------------- /** - * Leases indentifier. Connects it to a Virtual Network - */ + * Leases identifier. Connects it to a Virtual Network + */ int oid; /** - * Number of possible leases (free + asigned) - */ + * Number of possible leases (free + assigned) + */ unsigned int size; /** @@ -249,6 +249,11 @@ protected: */ int n_used; + /** + * The default MAC prefix for the Leases + */ + unsigned int mac_prefix; + // ------------------------------------------------------------------------- // DataBase implementation variables // ------------------------------------------------------------------------- @@ -286,11 +291,11 @@ protected: friend ostream& operator<<(ostream& os, Lease& _lease); /** - * Function to print the Leases object into a string in - * XML format - * @param xml the resulting XML string - * @return a reference to the generated string - */ + * Function to print the Leases object into a string in + * XML format + * @param xml the resulting XML string + * @return a reference to the generated string + */ string& to_xml(string& xml) const; private: diff --git a/include/RangedLeases.h b/include/RangedLeases.h index 946db6f349..4f97acb821 100644 --- a/include/RangedLeases.h +++ b/include/RangedLeases.h @@ -30,9 +30,9 @@ public: // ************************************************************************* RangedLeases(SqlDB * db, int _oid, - unsigned long _size, unsigned int _mac_prefix, - const string& _network_address); + unsigned int _ip_start, + unsigned int _ip_end); ~RangedLeases(){}; @@ -105,15 +105,9 @@ public: } private: - /** - * The default MAC prefix for the Leases - */ - unsigned int mac_prefix; - /** - * The Network address to generate leases - */ - unsigned int network_address; + unsigned int ip_start; + unsigned int ip_end; unsigned int current; diff --git a/include/VirtualNetwork.h b/include/VirtualNetwork.h index be02e86954..9146d69f97 100644 --- a/include/VirtualNetwork.h +++ b/include/VirtualNetwork.h @@ -222,6 +222,9 @@ private: */ Leases * leases; + unsigned int ip_start; + unsigned int ip_end; + // ************************************************************************* // DataBase implementation (Private) // ************************************************************************* diff --git a/src/vnm/FixedLeases.cc b/src/vnm/FixedLeases.cc index 83180c2a92..fc14480c74 100644 --- a/src/vnm/FixedLeases.cc +++ b/src/vnm/FixedLeases.cc @@ -25,7 +25,7 @@ FixedLeases::FixedLeases( int _oid, unsigned int _mac_prefix, vector& vector_leases): - Leases(db,_oid,0),mac_prefix(_mac_prefix),current(leases.begin()) + Leases(db,_oid,0,_mac_prefix),current(leases.begin()) { const VectorAttribute * single_attr_lease; string _mac; diff --git a/src/vnm/RangedLeases.cc b/src/vnm/RangedLeases.cc index d74f599e17..c94d59118b 100644 --- a/src/vnm/RangedLeases.cc +++ b/src/vnm/RangedLeases.cc @@ -17,7 +17,6 @@ #include "RangedLeases.h" #include "Nebula.h" -#include /* ************************************************************************** */ /* Ranged Leases class */ @@ -26,21 +25,13 @@ RangedLeases::RangedLeases( SqlDB * db, int _oid, - unsigned long _size, unsigned int _mac_prefix, - const string& _network_address): - Leases(db,_oid,_size),mac_prefix(_mac_prefix),current(0) + unsigned int _ip_start, + unsigned int _ip_end): + Leases(db,_oid,0,_mac_prefix), + ip_start(_ip_start),ip_end(_ip_end),current(0) { - unsigned int net_addr; - - Leases::Lease::ip_to_number(_network_address,net_addr); - - //size is the number of hosts in the network - size = _size + 2; - - network_address = 0xFFFFFFFF << (int) ceil(log(size)/log(2)); - - network_address &= net_addr; + size = ip_end - ip_start + 1; } /* ************************************************************************** */ @@ -52,9 +43,9 @@ int RangedLeases::get(int vid, string& ip, string& mac) unsigned int num_ip; int rc = -1; - for (unsigned int i=0; i + /* ************************************************************************** */ /* Virtual Network :: Constructor/Destructor */ /* ************************************************************************** */ @@ -119,49 +121,16 @@ int VirtualNetwork::select_leases(SqlDB * db) string network_address; - unsigned int default_size = VirtualNetworkPool::default_size(); unsigned int mac_prefix = VirtualNetworkPool::mac_prefix(); //Get the leases if (type == RANGED) { - string nclass = ""; - int size = 0; - - // retrieve specific information from the template - get_template_attribute("NETWORK_ADDRESS",network_address); - - if (network_address.empty()) - { - goto error_addr; - } - - get_template_attribute("NETWORK_SIZE",nclass); - - if ( nclass == "B" || nclass == "b" ) - { - size = 65534; - } - else if ( nclass == "C" || nclass == "c" ) - { - size = 254; - } - else if (!nclass.empty()) //Assume it's a number - { - istringstream iss(nclass); - iss >> size; - } - - if (size == 0) - { - size = default_size; - } - leases = new RangedLeases(db, oid, - size, mac_prefix, - network_address); + ip_start, + ip_end); } else if(type == FIXED) { @@ -190,9 +159,6 @@ error_type: ose << "Wrong type of Virtual Network: " << type; goto error_common; -error_addr: - ose << "Network address is not defined nid: " << oid; - error_common: NebulaLog::log("VNM", Log::ERROR, ose); return -1; @@ -292,6 +258,7 @@ int VirtualNetwork::insert(SqlDB * db, string& error_str) string nclass = ""; string naddr = ""; int size = 0; + unsigned int net_addr; // retrieve specific information from template get_template_attribute("NETWORK_ADDRESS",naddr); @@ -311,7 +278,7 @@ int VirtualNetwork::insert(SqlDB * db, string& error_str) { size = 254; } - else if (!nclass.empty())//Assume its a number + else if (!nclass.empty())//Assume it's a number { istringstream iss(nclass); @@ -323,11 +290,26 @@ int VirtualNetwork::insert(SqlDB * db, string& error_str) size = default_size; } + Leases::Lease::ip_to_number(naddr,net_addr); + + int shift; + shift = (int) ceil(log(size+2)/log(2)); + size = (1 << shift) - 2; + unsigned int network_mask = 0xFFFFFFFF << shift; + + if (net_addr != (network_mask & net_addr) ) + { + // TODO: net_addr is not a valid network address, should end with 0s + } + + ip_start = net_addr + 1; + ip_end = ip_start + size -1; + leases = new RangedLeases(db, oid, - size, mac_prefix, - naddr); + ip_start, + ip_end); } else // VirtualNetwork::FIXED { @@ -527,6 +509,21 @@ string& VirtualNetwork::to_xml_extended(string& xml, bool extended) const os << "" << vlan_id << ""; } + if ( type == RANGED ) + { + string st_ip_start; + string st_ip_end; + + Leases::Lease::ip_to_string(ip_start, st_ip_start); + Leases::Lease::ip_to_string(ip_end, st_ip_end); + + os << + "" << + "" << st_ip_start << "" << + "" << st_ip_end << "" << + ""; + } + os << "" << public_obj << "" << ""<< total_leases << ""<< obj_template->to_xml(template_xml); @@ -585,6 +582,19 @@ int VirtualNetwork::from_xml(const string &xml_str) ObjectXML::free_nodes(content); + // Ranged Leases + if (type == RANGED) + { + string st_ip_start; + string st_ip_end; + + rc += xpath(st_ip_start, "/VNET/RANGE/IP_START", "0"); + rc += xpath(st_ip_end, "/VNET/RANGE/IP_END", "0"); + + Leases::Lease::ip_to_number(st_ip_start, ip_start); + Leases::Lease::ip_to_number(st_ip_end, ip_end); + } + if (rc != 0) { return -1; From 23e33e32003ea08cda38c66bc3df1be112c23afc Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Sat, 26 Nov 2011 01:12:24 +0100 Subject: [PATCH 057/157] feature #863: Update remotes in sshtream. Checks if the stream is alive before using it --- src/mad/ruby/ssh_stream.rb | 53 +++++++++++++++++++++++--------- src/vmm_mad/exec/one_vmm_exec.rb | 5 ++- src/vnm_mad/one_vnm.rb | 15 ++++----- 3 files changed, 50 insertions(+), 23 deletions(-) diff --git a/src/mad/ruby/ssh_stream.rb b/src/mad/ruby/ssh_stream.rb index b0de36b72f..067227beeb 100644 --- a/src/mad/ruby/ssh_stream.rb +++ b/src/mad/ruby/ssh_stream.rb @@ -42,6 +42,10 @@ class SshStream defined?(@stdin) end + def alive? + @alive == true + end + def open @stdin, @stdout, @stderr=Open3::popen3("#{SSH_CMD} #{@host} bash -s ; echo #{SSH_RC_STR} $? 1>&2") @@ -50,6 +54,8 @@ class SshStream @out = "" @err = "" + + @alive = true end def close @@ -61,14 +67,18 @@ class SshStream @stdin.close if not @stdin.closed? @stdout.close if not @stdout.closed? @stderr.close if not @stderr.closed? + + @alive = false end def exec(command) + return if ! @alive + @out = "" @err = "" begin - cmd="(#{command}); #{EOF_CMD}\n" + cmd="(#{command}); #{EOF_CMD}" sliced=cmd.scan(/.{1,100}/) @@ -77,7 +87,7 @@ class SshStream @stdin.flush end - @stdin.puts + @stdin.write "\n" @stdin.flush rescue @@ -90,12 +100,12 @@ class SshStream code = -1 - while not (done_out and done_err) + while not (done_out and done_err ) and @alive rc, rw, re= IO.select([@stdout, @stderr],[],[]) rc.each { |fd| begin - c = fd.read_nonblock(50) + c = fd.read_nonblock(100) next if !c rescue #rescue from EOF if ssh command finishes and closes fds next @@ -115,8 +125,7 @@ class SshStream @err << OpenNebula.format_error_message(message) - done_out = true - done_err = true + @alive = false break end @@ -145,18 +154,29 @@ class SshStream end -class SshStreamCommand < GenericCommand - def initialize(host, logger=nil, stdin=nil) - @host=host - super('true', logger, stdin) +class SshStreamCommand < RemotesCommand + def initialize(host, remote_dir, logger=nil, stdin=nil) + super('true', host, logger, stdin) + + @remote_dir = remote_dir + @stream = SshStream.new(host) - @stream = SshStream.new(host) @stream.open end - def run(command, stdin=nil) + def run(command, stdin=nil, base_cmd = nil) @stream.open unless @stream.opened? + if base_cmd #Check if base command is on remote host + chk_cmd = "if [ ! -x \"#{base_cmd.match(/\S*/)[0]}\" ]; \ + then exit #{MAGIC_RC} 1>&2; \ + fi" + + if @stream.exec_and_wait(chk_cmd) == MAGIC_RC + RemotesCommand.update_remotes(@host, @remote_dir, @logger) + end + end + @stream.exec(command) @stream.stdin.write(stdin) if stdin @@ -184,7 +204,7 @@ if $0 == __FILE__ ssh.exec("date | tee /tmp/test.javi") code=ssh.wait_for_command - + puts "Code: #{code}" puts "output: #{ssh.out}" @@ -210,6 +230,9 @@ if $0 == __FILE__ ssh.close - cssh = SshStreamCommand.new('no_host',lambda { |e| STDOUT.puts "error: #{e}" }, nil) + cssh = SshStreamCommand.new('no_host', + '/tmp', + lambda { |e| STDOUT.puts "error: #{e}" }, + nil) cssh.run('whoami') -end +end \ No newline at end of file diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 659c37767c..c79d789410 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -74,7 +74,10 @@ class ExecDriver < VirtualMachineDriver dfile = remote_dfile end - ssh = SshStreamCommand.new(host, log_method(id)) + ssh = SshStreamCommand.new(host, + @remote_scripts_base_path, + log_method(id)) + vnm = VirtualNetworkDriver.new(data.elements['NET_DRV'].text, :local_actions => @options[:local_actions], :message => data, diff --git a/src/vnm_mad/one_vnm.rb b/src/vnm_mad/one_vnm.rb index a5f069b1c5..aba0339611 100644 --- a/src/vnm_mad/one_vnm.rb +++ b/src/vnm_mad/one_vnm.rb @@ -49,21 +49,22 @@ class VirtualNetworkDriver :stdin => nil, }.merge(ops) - command = action_command_line(aname, @vm_encoded) + cmd = action_command_line(aname, @vm_encoded) if action_is_local?(aname) - execution = LocalCommand.run(command, log_method(id)) + execution = LocalCommand.run(cmd, log_method(id)) else if options[:stdin] - command = "cat << EOT | #{command}" - stdin = "#{options[:stdin]}\nEOT\n" + cmdin = "cat << EOT | #{cmd}" + stdin = "#{options[:stdin]}\nEOT\n" else - stdin = nil + cmdin = cmd + stdin = nil end - execution = @ssh_stream.run(command, stdin) + execution = @ssh_stream.run(cmdin, stdin, cmd) end result, info = get_info_from_execution(execution) end -end +end \ No newline at end of file From 0a191e113b48cd3bc7be59e7dc75ea2a7f4501f7 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Sat, 26 Nov 2011 01:41:02 +0100 Subject: [PATCH 058/157] feature #863: update remotes in OpenNebula driver when re-using a ssh stream --- src/mad/ruby/OpenNebulaDriver.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mad/ruby/OpenNebulaDriver.rb b/src/mad/ruby/OpenNebulaDriver.rb index 5e8f6126a3..3ecbdd23bb 100644 --- a/src/mad/ruby/OpenNebulaDriver.rb +++ b/src/mad/ruby/OpenNebulaDriver.rb @@ -107,13 +107,14 @@ class OpenNebulaDriver < ActionManager execution = LocalCommand.run(command, log_method(id)) elsif options[:ssh_stream] if options[:stdin] - command = "cat << EOT | #{command}" - stdin = "#{options[:stdin]}\nEOT\n" + cmdin = "cat << EOT | #{command}" + stdin = "#{options[:stdin]}\nEOT\n" else - stdin = nil + cmdin = command + stdin = nil end - execution = options[:ssh_stream].run(command,stdin) + execution = options[:ssh_stream].run(cmdin, stdin, command) else execution = RemotesCommand.run(command, From 476fb23c5c66211b2566b82f4a8c88bed37ff877 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Sat, 26 Nov 2011 01:41:56 +0100 Subject: [PATCH 059/157] feature #863: Log deploy operations, rollback deployment if post-boot fails --- src/vmm_mad/exec/one_vmm_exec.rb | 39 ++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index c79d789410..5c6100dd71 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -53,12 +53,17 @@ class ExecDriver < VirtualMachineDriver # DEPLOY action, sends the deployment file to remote host def deploy(id, drv_message) + # ---------------------------------------------------------------------- + # Initialization of deployment data + # ---------------------------------------------------------------------- + data = decode(drv_message) local_dfile = data.elements['LOCAL_DEPLOYMENT_FILE'].text remote_dfile = data.elements['REMOTE_DEPLOYMENT_FILE'].text - host = data.elements['HOST'].text + host = data.elements['HOST'].text + net_drv = data.elements['NET_DRV'].text if !local_dfile || File.zero?(local_dfile) send_message(ACTION[:deploy],RESULT[:failure],id, @@ -78,11 +83,15 @@ class ExecDriver < VirtualMachineDriver @remote_scripts_base_path, log_method(id)) - vnm = VirtualNetworkDriver.new(data.elements['NET_DRV'].text, + vnm = VirtualNetworkDriver.new(net_drv, :local_actions => @options[:local_actions], - :message => data, - :ssh_stream => ssh) + :message => data, + :ssh_stream => ssh) + # ---------------------------------------------------------------------- + # Execute pre-boot action of the network driver + # ---------------------------------------------------------------------- + result, info = vnm.do_action(id, :pre) if failed?(result) @@ -90,6 +99,12 @@ class ExecDriver < VirtualMachineDriver return end + log(id, "Successfully executed network driver #{net_drv} (pre-boot)") + + # ---------------------------------------------------------------------- + # Boot the VM + # ---------------------------------------------------------------------- + result, domain_id = do_action("#{dfile} #{host}", id, host, :deploy, :stdin => domain, :ssh_stream => ssh, @@ -99,14 +114,28 @@ class ExecDriver < VirtualMachineDriver return end + log(id, "Successfully booted VM with id: #{domain_id}") + + # ---------------------------------------------------------------------- + # Execute post-boot action of the network driver + # ---------------------------------------------------------------------- + result, info = vnm.do_action(id, :post) - #TODO: Need to rollback (VM is running) or send success and log error if failed?(result) + log(id, "Failed to executed network driver #{net_drv} (post-boot)") + log(id, "Cancelling VM with id: #{domain_id}") + + do_action("#{domain_id} #{host}", id, host, :cancel, + :ssh_stream => ssh, + :respond => false) + send_message(ACTION[:deploy],result,id,info) return end + log(id, "Successfully executed network driver #{net_drv} (post-boot)") + send_message(ACTION[:deploy],RESULT[:success],id,domain_id) end From c046ad0d5a41e0ebb9a81a41b75aeb8dd5d59cc9 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Sat, 26 Nov 2011 23:49:59 +0100 Subject: [PATCH 060/157] bug: Solve search by name when deleting and creating resources with the same name --- src/pool/PoolSQL.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/pool/PoolSQL.cc b/src/pool/PoolSQL.cc index d615d9dce0..33e630a53a 100644 --- a/src/pool/PoolSQL.cc +++ b/src/pool/PoolSQL.cc @@ -198,6 +198,8 @@ PoolObjectSQL * PoolSQL::get( } else { + map::iterator name_index; + objectsql = create(); objectsql->oid = oid; @@ -214,6 +216,19 @@ PoolObjectSQL * PoolSQL::get( } string okey = key(objectsql->name,objectsql->uid); + name_index = name_pool.find(okey); + + if ( name_index != name_pool.end() ) + { + name_index->second->lock(); + + PoolObjectSQL * tmp_ptr = name_index->second; + + name_pool.erase(okey); + pool.erase(tmp_ptr->oid); + + delete tmp_ptr; + } pool.insert(make_pair(objectsql->oid,objectsql)); name_pool.insert(make_pair(okey, objectsql)); From ee3682bd2c4e339b72018c9013425a9ead613818 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Sun, 27 Nov 2011 01:01:03 +0100 Subject: [PATCH 061/157] bug: fix pool tests --- src/pool/test/pool.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/pool/test/pool.cc b/src/pool/test/pool.cc index d689660cf4..15f5f47eef 100644 --- a/src/pool/test/pool.cc +++ b/src/pool/test/pool.cc @@ -170,7 +170,10 @@ public: //Should be set to MAX_POOL -1 for (int i=0 ; i < 14999 ; i++) { - create_allocate(i,"A Test object"); + ostringstream name; + name << "A Test object " << i; + + create_allocate(i,name.str()); obj_lock = pool->get(i, true); CPPUNIT_ASSERT(obj_lock != 0); @@ -178,16 +181,22 @@ public: for (int i=14999 ; i < 15200 ; i++) //Works with just 1 cache line { - create_allocate(i,"A Test object"); + ostringstream name; + name << "A Test object " << i; + + create_allocate(i,name.str()); } for (int i=14999; i < 15200 ; i++) { + ostringstream name; + name << "A Test object " << i; + obj = pool->get(i, true); CPPUNIT_ASSERT(obj != 0); CPPUNIT_ASSERT(obj->number == i); - CPPUNIT_ASSERT(obj->text == "A Test object"); + CPPUNIT_ASSERT(obj->text == name.str()); obj->unlock(); } From bb4b0c6cea9e6eecef1daaa7c24fda207d5ab0d1 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Mon, 28 Nov 2011 12:54:33 +0100 Subject: [PATCH 062/157] bug #845 and #995: fix extra slash in sed command --- src/tm_mad/tm_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tm_mad/tm_common.sh b/src/tm_mad/tm_common.sh index 957027deff..5970606ffa 100644 --- a/src/tm_mad/tm_common.sh +++ b/src/tm_mad/tm_common.sh @@ -51,7 +51,7 @@ function fix_dir_slashes function get_compare_target { - echo "$1" | $SED 's/\/+/\//g' | $SED 's/\\/images$//' + echo "$1" | $SED 's/\/+/\//g' | $SED 's/\/images$//' } function full_src_and_dst_equal From e894fb5d373508c789866075a9b697e9c2ae7600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 28 Nov 2011 16:30:08 +0100 Subject: [PATCH 063/157] Feature #602: Make Network size definition more flexible. The netmask is generated from the given size The Network size can be defined as: * NETWORK_ADDRESS attribute: 19.2168.30.0/24 * SIZE: Letter (a,b,c) or number of hosts * NETWORK_MASK: 255.255.255.0 creates a network of 254 hosts --- src/vnm/VirtualNetwork.cc | 115 +++++++++++++++++++++++++++++--------- 1 file changed, 88 insertions(+), 27 deletions(-) diff --git a/src/vnm/VirtualNetwork.cc b/src/vnm/VirtualNetwork.cc index c3c125cbbb..899154538d 100644 --- a/src/vnm/VirtualNetwork.cc +++ b/src/vnm/VirtualNetwork.cc @@ -255,53 +255,114 @@ int VirtualNetwork::insert(SqlDB * db, string& error_str) //-------------------------------------------------------------------------- if (type == VirtualNetwork::RANGED) { - string nclass = ""; - string naddr = ""; - int size = 0; + string st_size = ""; + string st_addr = ""; + string st_mask = ""; + + unsigned int size = default_size; + unsigned int host_bits; + unsigned int network_bits; + unsigned int net_addr; + unsigned int net_mask; + size_t pos; // retrieve specific information from template - get_template_attribute("NETWORK_ADDRESS",naddr); - if (naddr.empty()) + erase_template_attribute("NETWORK_ADDRESS",st_addr); + + if (st_addr.empty()) { goto error_addr; } - get_template_attribute("NETWORK_SIZE",nclass); + // Check if the IP has a network prefix + pos = st_addr.find("/"); - if ( nclass == "B" || nclass == "b" ) + if ( pos != string::npos ) { - size = 65534; - } - else if ( nclass == "C" || nclass == "c" ) - { - size = 254; - } - else if (!nclass.empty())//Assume it's a number - { - istringstream iss(nclass); + string st_network_bits; - iss >> size; + st_network_bits = st_addr.substr(pos+1); + st_addr = st_addr.substr(0,pos); + + istringstream iss(st_network_bits); + iss >> network_bits; + + if ( network_bits > 32 ) + { + // TODO wrong prefix + } + + host_bits = 32 - network_bits; + } + else + { + erase_template_attribute("NETWORK_MASK", st_mask); + + if ( !st_mask.empty() ) + { + // st_mask is in decimal format, e.g. 255.255.0.0 + // The number of trailing 0s is needed + + Leases::Lease::ip_to_number(st_mask, net_mask); + + host_bits = 0; + + while ( host_bits < 32 && + ((net_mask >> host_bits) & 1) != 1 ) + { + host_bits++; + } + } + else + { + erase_template_attribute("NETWORK_SIZE",st_size); + + if ( st_size == "C" || st_size == "c" ) + { + host_bits = 8; + } + else if ( st_size == "B" || st_size == "b" ) + { + host_bits = 16; + } + else if ( st_size == "A" || st_size == "a" ) + { + host_bits = 24; + } + else + { + size = default_size; + + if (!st_size.empty())//Assume it's a number + { + istringstream iss(st_size); + + iss >> size; + } + + host_bits = (int) ceil(log(size+2)/log(2)); + } + } } - if (size == 0) - { - size = default_size; - } + remove_template_attribute("NETWORK_SIZE"); - Leases::Lease::ip_to_number(naddr,net_addr); + // Set the network mask + net_mask = ( 0xFFFFFFFF << host_bits ) & 0xFFFFFFFF; + Leases::Lease::ip_to_string(net_mask, st_mask); + replace_template_attribute("NETWORK_MASK", st_mask); - int shift; - shift = (int) ceil(log(size+2)/log(2)); - size = (1 << shift) - 2; - unsigned int network_mask = 0xFFFFFFFF << shift; + Leases::Lease::ip_to_number(st_addr,net_addr); - if (net_addr != (network_mask & net_addr) ) + if (net_addr != (net_mask & net_addr) ) { // TODO: net_addr is not a valid network address, should end with 0s } + size = (1 << host_bits) - 2; + ip_start = net_addr + 1; ip_end = ip_start + size -1; From 4fcf406c0c8b51e05007f04ddb5bb95ffa8a06d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 28 Nov 2011 16:47:11 +0100 Subject: [PATCH 064/157] Feature #602: Show RANGE/IP_START and RANGE/IP_END in 'onevnet show' --- src/cli/one_helper/onevnet_helper.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cli/one_helper/onevnet_helper.rb b/src/cli/one_helper/onevnet_helper.rb index 3d72e196af..71ead0d55f 100644 --- a/src/cli/one_helper/onevnet_helper.rb +++ b/src/cli/one_helper/onevnet_helper.rb @@ -66,6 +66,13 @@ class OneVNetHelper < OpenNebulaHelper::OneHelper puts vn.template_str(false) + if vn.type_str == "RANGED" + puts + CLIHelper.print_header(str_h1 % ["RANGE"], false) + puts str % ["IP_START", vn['RANGE/IP_START']] + puts str % ["IP_END", vn['RANGE/IP_END']] + end + leases_str = vn.template_like_str('/VNET/LEASES', false) if !leases_str.empty? From 37debbf02ff5a2f2bbed162e013abab4111485e9 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Mon, 28 Nov 2011 17:07:28 +0100 Subject: [PATCH 065/157] feature #863: added calls to network actions in vmm --- src/vmm_mad/exec/one_vmm_exec.rb | 259 +++++++++++++++++++++++++++++-- 1 file changed, 242 insertions(+), 17 deletions(-) diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 5c6100dd71..1ce1bc9c79 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -79,15 +79,15 @@ class ExecDriver < VirtualMachineDriver dfile = remote_dfile end - ssh = SshStreamCommand.new(host, - @remote_scripts_base_path, - log_method(id)) + ssh = SshStreamCommand.new(host, + @remote_scripts_base_path, + log_method(id)) vnm = VirtualNetworkDriver.new(net_drv, :local_actions => @options[:local_actions], :message => data, :ssh_stream => ssh) - + # ---------------------------------------------------------------------- # Execute pre-boot action of the network driver # ---------------------------------------------------------------------- @@ -95,7 +95,7 @@ class ExecDriver < VirtualMachineDriver result, info = vnm.do_action(id, :pre) if failed?(result) - send_message(ACTION[:deploy],result,id,info) + send_message(ACTION[:deploy], result, id,info) return end @@ -105,16 +105,18 @@ class ExecDriver < VirtualMachineDriver # Boot the VM # ---------------------------------------------------------------------- - result, domain_id = do_action("#{dfile} #{host}", id, host, :deploy, + result, info = do_action("#{dfile} #{host}", id, host, :deploy, :stdin => domain, :ssh_stream => ssh, :respond => false) if failed?(result) - send_message(ACTION[:deploy],result,id,info) + send_message(ACTION[:deploy], result, id, info) return end - log(id, "Successfully booted VM with id: #{domain_id}") + deploy_id = info + + log(id, "Successfully booted VM with id: #{deploy_id}") # ---------------------------------------------------------------------- # Execute post-boot action of the network driver @@ -124,19 +126,19 @@ class ExecDriver < VirtualMachineDriver if failed?(result) log(id, "Failed to executed network driver #{net_drv} (post-boot)") - log(id, "Cancelling VM with id: #{domain_id}") + log(id, "Canceling VM with id: #{deploy_id}") - do_action("#{domain_id} #{host}", id, host, :cancel, + do_action("#{deploy_id} #{host}", id, host, :cancel, :ssh_stream => ssh, :respond => false) - send_message(ACTION[:deploy],result,id,info) + send_message(ACTION[:deploy], result, id, info) return end log(id, "Successfully executed network driver #{net_drv} (post-boot)") - send_message(ACTION[:deploy],RESULT[:success],id,domain_id) + send_message(ACTION[:deploy], RESULT[:success], id, deploy_id) end # Basic Domain Management Operations @@ -144,26 +146,130 @@ class ExecDriver < VirtualMachineDriver def shutdown(id, drv_message) data = decode(drv_message) host = data.elements['HOST'].text + net_drv = data.elements['NET_DRV'].text deploy_id = data.elements['DEPLOY_ID'].text - do_action("#{deploy_id} #{host}", id, host, :shutdown) + ssh = SshStreamCommand.new(host, + @remote_scripts_base_path, + log_method(id)) + + vnm = VirtualNetworkDriver.new(net_drv, + :local_actions => @options[:local_actions], + :message => data, + :ssh_stream => ssh) + + result, info = do_action("#{deploy_id} #{host}", id, host, :shutdown, + :ssh_stream => ssh, + :respond => false) + + if failed?(result) + send_message(ACTION[:shutdown], result, id,info) + return + end + + log(id, "Successfully shut down VM with id: #{deploy_id}") + + # ---------------------------------------------------------------------- + # Execute clean action of the network driver + # ---------------------------------------------------------------------- + + result, info = vnm.do_action(id, :clean) + + if failed?(result) + send_message(ACTION[:shutdown], result, id,info) + return + end + + log(id, "Successfully executed network driver #{net_drv}" << + " (clean-shutdown)") end def cancel(id, drv_message) data = decode(drv_message) host = data.elements['HOST'].text + net_drv = data.elements['NET_DRV'].text deploy_id = data.elements['DEPLOY_ID'].text - do_action("#{deploy_id} #{host}", id, host, :cancel) + ssh = SshStreamCommand.new(host, + @remote_scripts_base_path, + log_method(id)) + + vnm = VirtualNetworkDriver.new(net_drv, + :local_actions => @options[:local_actions], + :message => data, + :ssh_stream => ssh) + + result, info = do_action("#{deploy_id} #{host}", id, host, :cancel, + :ssh_stream => ssh, + :respond => false) + + if failed?(result) + send_message(ACTION[:cancel], result, id,info) + return + end + + log(id, "Successfully canceled VM with id: #{deploy_id}") + + # ---------------------------------------------------------------------- + # Execute clean action of the network driver + # ---------------------------------------------------------------------- + + result, info = vnm.do_action(id, :clean) + + if failed?(result) + send_message(ACTION[:cancel], result, id,info) + return + end + + log(id, "Successfully executed network driver #{net_drv}" << + " (clean-cancel)") + + send_message(ACTION[:shutdown], RESULT[:success], id, domain_id) end def save(id, drv_message) data = decode(drv_message) host = data.elements['HOST'].text + net_drv = data.elements['NET_DRV'].text deploy_id = data.elements['DEPLOY_ID'].text file = data.elements['CHECKPOINT_FILE'].text - do_action("#{deploy_id} #{file} #{host}", id, host, :save) + ssh = SshStreamCommand.new(host, + @remote_scripts_base_path, + log_method(id)) + + vnm = VirtualNetworkDriver.new(net_drv, + :local_actions => @options[:local_actions], + :message => data, + :ssh_stream => ssh) + + result, info = do_action("#{deploy_id} #{file} #{host}", id, host, + :save, + :ssh_stream => ssh, + :respond => false) + + if failed?(result) + send_message(ACTION[:save], result, id,info) + return + end + + log(id, "Successfully saved VM with id: #{deploy_id}") + + # ---------------------------------------------------------------------- + # Execute clean action of the network driver + # ---------------------------------------------------------------------- + + result, info = vnm.do_action(id, :clean) + + if failed?(result) + send_message(ACTION[:save], result, id,info) + return + end + + log(id, "Successfully executed network driver #{net_drv}" << + " (clean-save)") + + send_message(ACTION[:save], RESULT[:success], id, domain_id) end def restore(id, drv_message) @@ -171,15 +277,134 @@ class ExecDriver < VirtualMachineDriver host = data.elements['HOST'].text file = data.elements['CHECKPOINT_FILE'].text - do_action("#{file} #{host}", id, host, :restore) + ssh = SshStreamCommand.new(host, + @remote_scripts_base_path, + log_method(id)) + + vnm = VirtualNetworkDriver.new(net_drv, + :local_actions => @options[:local_actions], + :message => data, + :ssh_stream => ssh) + + # ---------------------------------------------------------------------- + # Execute pre-boot action of the network driver + # ---------------------------------------------------------------------- + + result, info = vnm.do_action(id, :pre) + + if failed?(result) + send_message(ACTION[:restore], result, id,info) + return + end + + log(id, "Successfully executed network driver #{net_drv} (pre-restore)") + + result, info = do_action("#{file} #{host}", id, host, :restore, + :save, + :ssh_stream => ssh, + :respond => false) + if failed?(result) + send_message(ACTION[:restore], result, id, info) + return + end + + log(id, "Successfully restored VM with id: #{info}") + + # ---------------------------------------------------------------------- + # Execute post-restore action of the network driver + # ---------------------------------------------------------------------- + + result, info = vnm.do_action(id, :post) + + if failed?(result) + log(id, "Failed to executed network driver #{net_drv} (post-restore)") + log(id, "Canceling VM with id: #{domain_id}") + + do_action("#{domain_id} #{host}", id, host, :cancel, + :ssh_stream => ssh, + :respond => false) + + send_message(ACTION[:restore], result, id, info) + return + end + + log(id, "Successfully executed network driver #{net_drv} (post-restore)") + + send_message(ACTION[:restore], RESULT[:success], id, domain_id) end def migrate(id, drv_message) data = decode(drv_message) + net_drv = data.elements['NET_DRV'].text host = data.elements['HOST'].text deploy_id = data.elements['DEPLOY_ID'].text + dest_host = data.elements['MIGR_HOST'].text + dest_driver = data.elements['MIGR_NET_DRV'].text - do_action("#{deploy_id} #{dest_host} #{host}", id, host, :migrate) + ssh_src = SshStreamCommand.new(host, + @remote_scripts_base_path, + log_method(id)) + + ssh_dst = SshStreamCommand.new(dest_host, + @remote_scripts_base_path, + log_method(id)) + + vnm_src = VirtualNetworkDriver.new(net_drv, + :local_actions => @options[:local_actions], + :message => data, + :ssh_stream => ssh_src) + + vnm_dst = VirtualNetworkDriver.new(dest_driver, + :local_actions => @options[:local_actions], + :message => data, + :ssh_stream => ssh_dst) + + # ---------------------------------------------------------------------- + # Execute pre-boot action of the network driver + # ---------------------------------------------------------------------- + + result, info = vnm_dst.do_action(id, :pre) + + if failed?(result) + send_message(ACTION[:migrate], result, id,info) + return + end + + log(id, "Successfully executed network driver #{net_drv} (pre-migrate)") + + result, info = do_action("#{deploy_id} #{dest_host} #{host}", id, host, + :migrate, + :save, + :ssh_stream => ssh_src, + :respond => false) + if failed?(result) + send_message(ACTION[:migrate], result, id, info) + return + end + + log(id, "Successfully migrated VM with id: #{deploy_id}") + + # ---------------------------------------------------------------------- + # Execute post-migrate action of the network driver + # ---------------------------------------------------------------------- + + result, info = vnm_dst.do_action(id, :post) + + if failed?(result) + log(id, "Failed to executed network driver #{dest_driver} (post-migrate)") + log(id, "Canceling VM with id: #{deploy_id}") + + do_action("#{deploy_id} #{host}", id, dest_host, :cancel, + :ssh_stream => ssh_dst, + :respond => false) + + send_message(ACTION[:restore], result, id, info) + return + end + + log(id, "Successfully executed network driver #{net_drv} (post-restore)") + + send_message(ACTION[:restore], RESULT[:success], id, deploy_id) end def poll(id, drv_message) From effb4a57126b862b247916675ee71fa326fbd233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 28 Nov 2011 17:24:46 +0100 Subject: [PATCH 066/157] Feature #602: Refactorin of the Range creation code. New method RangedLeases::process_template --- include/RangedLeases.h | 12 ++++ src/vnm/RangedLeases.cc | 132 ++++++++++++++++++++++++++++++++++++++ src/vnm/VirtualNetwork.cc | 118 +++------------------------------- 3 files changed, 152 insertions(+), 110 deletions(-) diff --git a/include/RangedLeases.h b/include/RangedLeases.h index 4f97acb821..a8a81d9968 100644 --- a/include/RangedLeases.h +++ b/include/RangedLeases.h @@ -18,6 +18,7 @@ #define RANGED_LEASES_H_ #include "Leases.h" +#include "VirtualNetwork.h" using namespace std; @@ -36,6 +37,17 @@ public: ~RangedLeases(){}; + /** + * Reads (and clears) the necessary attributes to define a Ranged VNet + * @param vn Virtual Network + * @param ip_start First IP of the range + * @param ip_end Last IP of the range + * @param error_str Error reason, if any + * @return 0 on success, -1 otherwise + */ + static int process_template(VirtualNetwork * vn, + unsigned int& ip_start, unsigned int& ip_end, string& error_str); + /** * Returns an unused lease, which becomes used * @param vid identifier of the VM getting this lease diff --git a/src/vnm/RangedLeases.cc b/src/vnm/RangedLeases.cc index c94d59118b..26fb6940dd 100644 --- a/src/vnm/RangedLeases.cc +++ b/src/vnm/RangedLeases.cc @@ -18,6 +18,8 @@ #include "RangedLeases.h" #include "Nebula.h" +#include + /* ************************************************************************** */ /* Ranged Leases class */ /* ************************************************************************** */ @@ -37,6 +39,136 @@ RangedLeases::RangedLeases( /* ************************************************************************** */ /* Ranged Leases :: Methods */ /* ************************************************************************** */ +int RangedLeases::process_template(VirtualNetwork* vn, + unsigned int& ip_start, unsigned int& ip_end, string& error_str) +{ + ostringstream oss; + + string st_size = ""; + string st_addr = ""; + string st_mask = ""; + + int default_size = VirtualNetworkPool::default_size(); + unsigned int size = default_size; + unsigned int host_bits; + unsigned int network_bits; + + unsigned int net_addr; + unsigned int net_mask; + size_t pos; + + // retrieve specific information from template + + vn->erase_template_attribute("NETWORK_ADDRESS",st_addr); + + if (st_addr.empty()) + { + goto error_addr; + } + + // Check if the IP has a network prefix + pos = st_addr.find("/"); + + if ( pos != string::npos ) + { + string st_network_bits; + + st_network_bits = st_addr.substr(pos+1); + st_addr = st_addr.substr(0,pos); + + istringstream iss(st_network_bits); + iss >> network_bits; + + if ( network_bits > 32 ) + { + // TODO wrong prefix + } + + host_bits = 32 - network_bits; + } + else + { + vn->erase_template_attribute("NETWORK_MASK", st_mask); + + if ( !st_mask.empty() ) + { + // st_mask is in decimal format, e.g. 255.255.0.0 + // The number of trailing 0s is needed + + Leases::Lease::ip_to_number(st_mask, net_mask); + + host_bits = 0; + + while ( host_bits < 32 && + ((net_mask >> host_bits) & 1) != 1 ) + { + host_bits++; + } + } + else + { + vn->erase_template_attribute("NETWORK_SIZE",st_size); + + if ( st_size == "C" || st_size == "c" ) + { + host_bits = 8; + } + else if ( st_size == "B" || st_size == "b" ) + { + host_bits = 16; + } + else if ( st_size == "A" || st_size == "a" ) + { + host_bits = 24; + } + else + { + size = default_size; + + if (!st_size.empty())//Assume it's a number + { + istringstream iss(st_size); + + iss >> size; + } + + host_bits = (int) ceil(log(size+2)/log(2)); + } + } + } + + vn->remove_template_attribute("NETWORK_SIZE"); + + // Set the network mask + net_mask = ( 0xFFFFFFFF << host_bits ) & 0xFFFFFFFF; + Lease::ip_to_string(net_mask, st_mask); + vn->replace_template_attribute("NETWORK_MASK", st_mask); + + Leases::Lease::ip_to_number(st_addr,net_addr); + + if (net_addr != (net_mask & net_addr) ) + { + // TODO: net_addr is not a valid network address, should end with 0s + } + + size = (1 << host_bits) - 2; + + ip_start = net_addr + 1; + ip_end = ip_start + size -1; + + return 0; + +error_addr: + oss << "No NETWORK_ADDRESS in template for Virtual Network."; + goto error_common; + +error_common: + error_str = oss.str(); + return -1; +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ int RangedLeases::get(int vid, string& ip, string& mac) { diff --git a/src/vnm/VirtualNetwork.cc b/src/vnm/VirtualNetwork.cc index 899154538d..72a833d407 100644 --- a/src/vnm/VirtualNetwork.cc +++ b/src/vnm/VirtualNetwork.cc @@ -25,8 +25,6 @@ #include "AuthManager.h" -#include - /* ************************************************************************** */ /* Virtual Network :: Constructor/Destructor */ /* ************************************************************************** */ @@ -174,8 +172,8 @@ int VirtualNetwork::insert(SqlDB * db, string& error_str) string pub; string s_type; + string ranged_error_str; - unsigned int default_size = VirtualNetworkPool::default_size(); unsigned int mac_prefix = VirtualNetworkPool::mac_prefix(); //-------------------------------------------------------------------------- @@ -255,117 +253,17 @@ int VirtualNetwork::insert(SqlDB * db, string& error_str) //-------------------------------------------------------------------------- if (type == VirtualNetwork::RANGED) { - string st_size = ""; - string st_addr = ""; - string st_mask = ""; - unsigned int size = default_size; - unsigned int host_bits; - unsigned int network_bits; + int rc; - unsigned int net_addr; - unsigned int net_mask; - size_t pos; + rc = RangedLeases::process_template(this, ip_start, ip_end, + ranged_error_str); - // retrieve specific information from template - - erase_template_attribute("NETWORK_ADDRESS",st_addr); - - if (st_addr.empty()) + if ( rc != 0 ) { - goto error_addr; + goto error_ranged; } - // Check if the IP has a network prefix - pos = st_addr.find("/"); - - if ( pos != string::npos ) - { - string st_network_bits; - - st_network_bits = st_addr.substr(pos+1); - st_addr = st_addr.substr(0,pos); - - istringstream iss(st_network_bits); - iss >> network_bits; - - if ( network_bits > 32 ) - { - // TODO wrong prefix - } - - host_bits = 32 - network_bits; - } - else - { - erase_template_attribute("NETWORK_MASK", st_mask); - - if ( !st_mask.empty() ) - { - // st_mask is in decimal format, e.g. 255.255.0.0 - // The number of trailing 0s is needed - - Leases::Lease::ip_to_number(st_mask, net_mask); - - host_bits = 0; - - while ( host_bits < 32 && - ((net_mask >> host_bits) & 1) != 1 ) - { - host_bits++; - } - } - else - { - erase_template_attribute("NETWORK_SIZE",st_size); - - if ( st_size == "C" || st_size == "c" ) - { - host_bits = 8; - } - else if ( st_size == "B" || st_size == "b" ) - { - host_bits = 16; - } - else if ( st_size == "A" || st_size == "a" ) - { - host_bits = 24; - } - else - { - size = default_size; - - if (!st_size.empty())//Assume it's a number - { - istringstream iss(st_size); - - iss >> size; - } - - host_bits = (int) ceil(log(size+2)/log(2)); - } - } - } - - remove_template_attribute("NETWORK_SIZE"); - - // Set the network mask - net_mask = ( 0xFFFFFFFF << host_bits ) & 0xFFFFFFFF; - Leases::Lease::ip_to_string(net_mask, st_mask); - replace_template_attribute("NETWORK_MASK", st_mask); - - Leases::Lease::ip_to_number(st_addr,net_addr); - - if (net_addr != (net_mask & net_addr) ) - { - // TODO: net_addr is not a valid network address, should end with 0s - } - - size = (1 << host_bits) - 2; - - ip_start = net_addr + 1; - ip_end = ip_start + size -1; - leases = new RangedLeases(db, oid, mac_prefix, @@ -423,8 +321,8 @@ error_update: ose << "Can not update Virtual Network."; goto error_common; -error_addr: - ose << "No NETWORK_ADDRESS in template for Virtual Network."; +error_ranged: + ose << ranged_error_str; goto error_common; error_null_leases: From 9791ece838364d7992911b98bac0d03c240d3194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 28 Nov 2011 18:10:00 +0100 Subject: [PATCH 067/157] Feature #602: Add support for IP_START and IP_END redefinition in Ranged networks --- src/vnm/Leases.cc | 5 ++++ src/vnm/RangedLeases.cc | 64 +++++++++++++++++++++++++++++++++++------ 2 files changed, 60 insertions(+), 9 deletions(-) diff --git a/src/vnm/Leases.cc b/src/vnm/Leases.cc index 17dc998d07..fa0eedabb1 100644 --- a/src/vnm/Leases.cc +++ b/src/vnm/Leases.cc @@ -66,6 +66,11 @@ int Leases::Lease::ip_to_number(const string& _ip, unsigned int& i_ip) { iss >> dec >> tmp >> ws; + if ( tmp > 255 ) + { + return -1; + } + i_ip <<= 8; i_ip += tmp; } diff --git a/src/vnm/RangedLeases.cc b/src/vnm/RangedLeases.cc index 26fb6940dd..ce860d673b 100644 --- a/src/vnm/RangedLeases.cc +++ b/src/vnm/RangedLeases.cc @@ -48,8 +48,10 @@ int RangedLeases::process_template(VirtualNetwork* vn, string st_addr = ""; string st_mask = ""; - int default_size = VirtualNetworkPool::default_size(); - unsigned int size = default_size; + string st_ip_start = ""; + string st_ip_end = ""; + + unsigned int size = VirtualNetworkPool::default_size(); unsigned int host_bits; unsigned int network_bits; @@ -57,13 +59,41 @@ int RangedLeases::process_template(VirtualNetwork* vn, unsigned int net_mask; size_t pos; - // retrieve specific information from template + ip_start = 0; + ip_end = 0; - vn->erase_template_attribute("NETWORK_ADDRESS",st_addr); + // retrieve specific information from template + vn->erase_template_attribute("IP_START", st_ip_start); + vn->erase_template_attribute("IP_END", st_ip_end); + + if ( !st_ip_start.empty() ) + { + if ( Leases::Lease::ip_to_number(st_ip_start, ip_start) != 0 ) + { + goto error_ip_start; + } + } + + if ( !st_ip_end.empty() ) + { + if ( Leases::Lease::ip_to_number(st_ip_end, ip_end) != 0 ) + { + goto error_ip_end; + } + } + + vn->erase_template_attribute("NETWORK_ADDRESS", st_addr); if (st_addr.empty()) { - goto error_addr; + if ( ip_start != 0 && ip_end != 0 ) + { + return 0; + } + else + { + goto error_addr; + } } // Check if the IP has a network prefix @@ -123,8 +153,6 @@ int RangedLeases::process_template(VirtualNetwork* vn, } else { - size = default_size; - if (!st_size.empty())//Assume it's a number { istringstream iss(st_size); @@ -153,11 +181,29 @@ int RangedLeases::process_template(VirtualNetwork* vn, size = (1 << host_bits) - 2; - ip_start = net_addr + 1; - ip_end = ip_start + size -1; + // TODO: check that start < end; ip_start & ip_end are part of the network + + if ( ip_start == 0 ) + { + ip_start = net_addr + 1; + } + + if ( ip_end == 0 ) + { + ip_end = net_addr + size; + } return 0; + +error_ip_start: + oss << "IP_START is not a valid IP."; + goto error_common; + +error_ip_end: + oss << "IP_END is not a valid IP."; + goto error_common; + error_addr: oss << "No NETWORK_ADDRESS in template for Virtual Network."; goto error_common; From 07bc7d01549178defbef55205f22b4ce3e44ad6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 28 Nov 2011 19:07:44 +0100 Subject: [PATCH 068/157] Feature #602: Add error checks in Ranged network creation --- src/vnm/RangedLeases.cc | 78 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 70 insertions(+), 8 deletions(-) diff --git a/src/vnm/RangedLeases.cc b/src/vnm/RangedLeases.cc index ce860d673b..84c1bddaf0 100644 --- a/src/vnm/RangedLeases.cc +++ b/src/vnm/RangedLeases.cc @@ -88,6 +88,11 @@ int RangedLeases::process_template(VirtualNetwork* vn, { if ( ip_start != 0 && ip_end != 0 ) { + if ( ip_end < ip_start ) + { + goto error_greater; + } + return 0; } else @@ -111,7 +116,7 @@ int RangedLeases::process_template(VirtualNetwork* vn, if ( network_bits > 32 ) { - // TODO wrong prefix + goto error_prefix; } host_bits = 32 - network_bits; @@ -125,7 +130,10 @@ int RangedLeases::process_template(VirtualNetwork* vn, // st_mask is in decimal format, e.g. 255.255.0.0 // The number of trailing 0s is needed - Leases::Lease::ip_to_number(st_mask, net_mask); + if ( Leases::Lease::ip_to_number(st_mask, net_mask) != 0 ) + { + goto error_netmask; + } host_bits = 0; @@ -172,17 +180,19 @@ int RangedLeases::process_template(VirtualNetwork* vn, Lease::ip_to_string(net_mask, st_mask); vn->replace_template_attribute("NETWORK_MASK", st_mask); - Leases::Lease::ip_to_number(st_addr,net_addr); + if ( Leases::Lease::ip_to_number(st_addr,net_addr) != 0 ) + { + goto error_net_addr; + } if (net_addr != (net_mask & net_addr) ) { - // TODO: net_addr is not a valid network address, should end with 0s + goto error_not_base_addr; } size = (1 << host_bits) - 2; - // TODO: check that start < end; ip_start & ip_end are part of the network - + // Set IP start/end if ( ip_start == 0 ) { ip_start = net_addr + 1; @@ -193,21 +203,73 @@ int RangedLeases::process_template(VirtualNetwork* vn, ip_end = net_addr + size; } + // Check range restrictions + if ( (ip_start & net_mask) != net_addr ) + { + goto error_range_ip_start; + } + + if ( (ip_end & net_mask) != net_addr ) + { + goto error_range_ip_end; + } + + if ( ip_end < ip_start ) + { + goto error_greater; + } + return 0; error_ip_start: - oss << "IP_START is not a valid IP."; + oss << "IP_START " << st_ip_start << " is not a valid IP."; goto error_common; error_ip_end: - oss << "IP_END is not a valid IP."; + oss << "IP_END " << st_ip_end << " is not a valid IP."; + goto error_common; + +error_not_base_addr: + oss << "NETWORK_ADDRESS " << st_addr + << " is not a base address for the network mask " << st_mask << "."; + goto error_common; + +error_net_addr: + oss << "NETWORK_ADDRESS " << st_addr << " is not a valid IP."; + goto error_common; + +error_netmask: + oss << "NETWORK_MASK " << st_mask << " is not a valid network mask."; + goto error_common; + +error_prefix: + oss << "A CIDR prefix of " << network_bits << " bits is not valid."; goto error_common; error_addr: oss << "No NETWORK_ADDRESS in template for Virtual Network."; goto error_common; +error_range_ip_start: + oss << "IP_START " << st_ip_start << " is not part of the network " + << st_addr << "/" << 32-host_bits << "."; + goto error_common; + +error_range_ip_end: + oss << "IP_END " << st_ip_end << " is not part of the network " + << st_addr << "/" << 32-host_bits << "."; + goto error_common; + +error_greater: + Leases::Lease::ip_to_string(ip_start, st_ip_start); + Leases::Lease::ip_to_string(ip_end, st_ip_end); + + oss << "IP_START " << st_ip_start << " cannot be greater than the IP_END " + << st_ip_end << "."; + goto error_common; + + error_common: error_str = oss.str(); return -1; From 33d157cc7ff9f0175bcd744a194d86bf0b530b12 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Mon, 28 Nov 2011 20:50:01 +0100 Subject: [PATCH 069/157] oZones: small fixes Improve the regexp matching zone endpoint urls for the vdc information to display sunstone and onexml_rpc variable addresses. Enlarge the hosts boxes when creating an VDC. Set variable dialog height. --- .../Server/public/js/plugins/vdcs-tab.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/ozones/Server/public/js/plugins/vdcs-tab.js b/src/ozones/Server/public/js/plugins/vdcs-tab.js index 06ae83e6d5..3f15e02315 100644 --- a/src/ozones/Server/public/js/plugins/vdcs-tab.js +++ b/src/ozones/Server/public/js/plugins/vdcs-tab.js @@ -51,12 +51,12 @@ var create_vdc_tmpl = \
Allows hosts belonging to other VDCs to be re-added to this one. They will appear greyed-out in the lists.
\
\ - \ - \ + \ + \ \ -
\ -
    \ -
      \ +
      \ +
        \ +
          \
          \ \
          \ @@ -278,7 +278,7 @@ function updateVDCInfo(req,vdc_json){ var zone_host = ""; var zone_port = ""; var sun_link = ""; - var zone_match = zone_endpoint.match(/^http:\/\/(\w+):(\d+)\/RPC2$/); + var zone_match = zone_endpoint.match(/^https?:\/\/([\w.]+):(\d+)\/([\W\w]+)$/); if (zone_match){ zone_host = zone_match[1]; @@ -428,10 +428,14 @@ function setupCreateVDCDialog(){ $('div#dialogs').append('
          '); var dialog = $('div#create_vdc_dialog'); dialog.html(create_vdc_tmpl); + + var height = Math.floor($(window).height()*0.8); + dialog.dialog({ autoOpen: false, modal: true, - width: 420 + height: height, + width: 500 }); $('button',dialog).button(); From c472c6c9f570add9a1032516ff321868f448551e Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 16 Nov 2011 16:36:35 +0100 Subject: [PATCH 070/157] Task #972: Add VNM driver to Sunstone. Updated server, host info and host creation dialog. (cherry picked from commit bccc091d8ed5bd9f44aa6cf6f0f8447ee63bf6e5) --- src/sunstone/models/OpenNebulaJSON/HostJSON.rb | 7 ++++--- src/sunstone/public/js/plugins/hosts-tab.js | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/sunstone/models/OpenNebulaJSON/HostJSON.rb b/src/sunstone/models/OpenNebulaJSON/HostJSON.rb index d4395231bb..cf24bb1ee9 100644 --- a/src/sunstone/models/OpenNebulaJSON/HostJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/HostJSON.rb @@ -27,9 +27,10 @@ module OpenNebulaJSON end self.allocate(host_hash['name'], - host_hash['im_mad'], - host_hash['vm_mad'], - host_hash['tm_mad']) + host_hash['im_mad'], + host_hash['vm_mad'], + host_hash['vnm_mad'], + host_hash['tm_mad']) end def delete diff --git a/src/sunstone/public/js/plugins/hosts-tab.js b/src/sunstone/public/js/plugins/hosts-tab.js index c54d9a78d9..cfbf85d2f7 100644 --- a/src/sunstone/public/js/plugins/hosts-tab.js +++ b/src/sunstone/public/js/plugins/hosts-tab.js @@ -80,10 +80,19 @@ var create_host_tmpl = \ \
          \ +
          \ + \ + \ +
          \
          \ \ \ @@ -443,6 +452,10 @@ function updateHostInfo(request,host){ VM MAD\ '+host_info.VM_MAD+'\ \ + \ + VN MAD\ + '+host_info.VN_MAD+'\ + \ \ TM MAD\ '+host_info.TM_MAD+'\ @@ -537,6 +550,7 @@ function setupCreateHostDialog(){ "name": $('#name',this).val(), "tm_mad": $('#tm_mad :selected',this).val(), "vm_mad": $('#vmm_mad :selected',this).val(), + "vnm_mad": $('#vnm_mad :selected',this).val(), "im_mad": $('#im_mad :selected',this).val() } } From c45890e15c144e1da39ed5eccbef3bc0de0a1226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 29 Nov 2011 15:50:54 +0100 Subject: [PATCH 071/157] Bug in FixedLeases::add_leases, fix potential pointer exception --- src/vnm/FixedLeases.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/vnm/FixedLeases.cc b/src/vnm/FixedLeases.cc index 83180c2a92..abfd653ef9 100644 --- a/src/vnm/FixedLeases.cc +++ b/src/vnm/FixedLeases.cc @@ -365,13 +365,17 @@ int FixedLeases::update_lease(Lease * lease) int FixedLeases::add_leases(vector& vector_leases, string& error_msg) { - const VectorAttribute * single_attr_lease; + const VectorAttribute * single_attr_lease = 0; int rc = -1; string _mac; string _ip; - single_attr_lease = dynamic_cast(vector_leases[0]); + if ( vector_leases.size() > 0 ) + { + single_attr_lease = + dynamic_cast(vector_leases[0]); + } if( single_attr_lease != 0 ) { @@ -400,11 +404,15 @@ int FixedLeases::add_leases(vector& vector_leases, int FixedLeases::remove_leases(vector& vector_leases, string& error_msg) { - const VectorAttribute * single_attr_lease; + const VectorAttribute * single_attr_lease = 0; int rc = -1; string _ip; - single_attr_lease = dynamic_cast(vector_leases[0]); + if ( vector_leases.size() > 0 ) + { + single_attr_lease = + dynamic_cast(vector_leases[0]); + } if( single_attr_lease != 0 ) { From 4904cc964beb37122f169eaaaf935f3ed24be160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 29 Nov 2011 16:12:00 +0100 Subject: [PATCH 072/157] Feature #965: New one.vn.hold and one.vn.release methods to mark IPs as used, without an associated VM. Includes Ruby OCA and CLI --- include/Leases.h | 20 +++++ include/RequestManagerVirtualNetwork.h | 38 ++++++++ include/VirtualNetwork.h | 23 ++++- src/cli/onevnet | 23 ++++- src/oca/ruby/OpenNebula/VirtualNetwork.rb | 30 ++++++- src/rm/RequestManager.cc | 4 + src/rm/RequestManagerVirtualNetwork.cc | 2 +- src/vnm/Leases.cc | 103 +++++++++++++++++++--- src/vnm/VirtualNetwork.cc | 26 ++++++ 9 files changed, 250 insertions(+), 19 deletions(-) diff --git a/include/Leases.h b/include/Leases.h index 5927f36f14..bb8453e53b 100644 --- a/include/Leases.h +++ b/include/Leases.h @@ -102,6 +102,26 @@ public: virtual int remove_leases(vector& vector_leases, string& error_msg) = 0; + /** + * Holds a Lease, marking it as used + * @param vector_leases vector of VectorAttribute objects. For the + * moment, the vector can only contain one LEASE. + * @param error_msg If the action fails, this message contains + * the reason. + * @return 0 on success + */ + int hold_leases(vector& vector_leases, string& error_msg); + + /** + * Releases a Lease on hold + * @param vector_leases vector of VectorAttribute objects. For the + * moment, the vector can only contain one LEASE. + * @param error_msg If the action fails, this message contains + * the reason. + * @return 0 on success + */ + int free_leases(vector& vector_leases, string& error_msg); + // ------------------------------------------------------------------------- // ------------------------------------------------------------------------- diff --git a/include/RequestManagerVirtualNetwork.h b/include/RequestManagerVirtualNetwork.h index f402499ac2..4a6245754b 100644 --- a/include/RequestManagerVirtualNetwork.h +++ b/include/RequestManagerVirtualNetwork.h @@ -93,6 +93,44 @@ public: } }; +/* ------------------------------------------------------------------------- */ +/* ------------------------------------------------------------------------- */ + +class VirtualNetworkHold : public RequestManagerVirtualNetwork +{ +public: + VirtualNetworkHold(): + RequestManagerVirtualNetwork("VirtualNetworkHold", + "Holds a virtual network Lease as used"){}; + ~VirtualNetworkHold(){}; + + int leases_action(VirtualNetwork * vn, + VirtualNetworkTemplate * tmpl, + string& error_str) + { + return vn->hold_leases(tmpl, error_str); + } +}; + +/* ------------------------------------------------------------------------- */ +/* ------------------------------------------------------------------------- */ + +class VirtualNetworkRelease : public RequestManagerVirtualNetwork +{ +public: + VirtualNetworkRelease(): + RequestManagerVirtualNetwork("VirtualNetworkRelease", + "Releases a virtual network Lease on hold"){}; + ~VirtualNetworkRelease(){}; + + int leases_action(VirtualNetwork * vn, + VirtualNetworkTemplate * tmpl, + string& error_str) + { + return vn->free_leases(tmpl, error_str); + } +}; + /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ diff --git a/include/VirtualNetwork.h b/include/VirtualNetwork.h index 9146d69f97..6625c260b4 100644 --- a/include/VirtualNetwork.h +++ b/include/VirtualNetwork.h @@ -85,7 +85,7 @@ public: /** * Adds Leases to the virtual network (Only implemented for FIXED networks) - * @param leases_template template in the form LEASES = [IP=XX, MAC=XX]. + * @param leases template in the form LEASES = [IP=XX, MAC=XX]. * MAC is optional. The template can only contain one LEASE * definition. * @param error_msg If the action fails, this message contains the reason. @@ -96,7 +96,7 @@ public: /** * Removes Leases from the virtual network; if they are not used.(Only * implemented for FIXED networks) - * @param leases_template template in the form LEASES = [IP=XX]. + * @param leases template in the form LEASES = [IP=XX]. * The template can only contain one LEASE definition. * @param error_msg If the action fails, this message contains * the reason. @@ -104,6 +104,25 @@ public: */ int remove_leases(VirtualNetworkTemplate* leases, string& error_msg); + /** + * Holds a Lease, marking it as used + * @param leases template in the form LEASES = [IP=XX]. + * The template can only contain one LEASE definition. + * @param error_msg If the action fails, this message contains the reason. + * @return 0 on success + */ + int hold_leases(VirtualNetworkTemplate * leases, string& error_msg); + + /** + * Releases a Lease on hold + * @param leases template in the form LEASES = [IP=XX]. + * The template can only contain one LEASE definition. + * @param error_msg If the action fails, this message contains + * the reason. + * @return 0 on success + */ + int free_leases(VirtualNetworkTemplate* leases, string& error_msg); + /** * Gets a new lease for a specific VM * @param vid VM identifier diff --git a/src/cli/onevnet b/src/cli/onevnet index 72ab53716a..b2ba672371 100755 --- a/src/cli/onevnet +++ b/src/cli/onevnet @@ -93,8 +93,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do Adds a lease to the Virtual Network EOT - command :addleases, 'Adds a lease to the Virtual Network', :vnetid, :ip, - [:mac, nil] do + command :addleases, addleases_desc, :vnetid, :ip, [:mac, nil] do helper.perform_action(args[0],options,"lease added") do |vn| vn.addleases(args[1], args[2]) end @@ -110,6 +109,26 @@ cmd=CommandParser::CmdParser.new(ARGV) do end end + hold_desc = <<-EOT.unindent + Holds a Virtual Network lease, marking it as used + EOT + + command :hold, hold_desc, :vnetid, :ip do + helper.perform_action(args[0],options,"lease on hold") do |vn| + vn.hold(args[1]) + end + end + + release_desc = <<-EOT.unindent + Releases a Virtual Network lease on hold + EOT + + command :release, release_desc, :vnetid, :ip do + helper.perform_action(args[0],options,"lease released") do |vn| + vn.release(args[1]) + end + end + publish_desc = <<-EOT.unindent Publishes the given Virtual Network. A public Virtual Network can be seen and used by other Users in the Virtual Network's group diff --git a/src/oca/ruby/OpenNebula/VirtualNetwork.rb b/src/oca/ruby/OpenNebula/VirtualNetwork.rb index 7020bac0fc..b932d7cbe8 100644 --- a/src/oca/ruby/OpenNebula/VirtualNetwork.rb +++ b/src/oca/ruby/OpenNebula/VirtualNetwork.rb @@ -32,7 +32,9 @@ module OpenNebula :addleases => "vn.addleases", :rmleases => "vn.rmleases", :chown => "vn.chown", - :update => "vn.update" + :update => "vn.update", + :hold => "vn.hold", + :release => "vn.release" } VN_TYPES=%w{RANGED FIXED} @@ -128,6 +130,32 @@ module OpenNebula return rc end + # Holds a virtual network Lease as used + # @param ip [String] IP to hold + def hold(ip) + return Error.new('ID not defined') if !@pe_id + + lease_template = "LEASES = [ IP = #{ip} ]" + + rc = @client.call(VN_METHODS[:hold], @pe_id, lease_template) + rc = nil if !OpenNebula.is_error?(rc) + + return rc + end + + # Releases a virtual network Lease on hold + # @param ip [String] IP to release + def release(ip) + return Error.new('ID not defined') if !@pe_id + + lease_template = "LEASES = [ IP = #{ip} ]" + + rc = @client.call(VN_METHODS[:release], @pe_id, lease_template) + rc = nil if !OpenNebula.is_error?(rc) + + return rc + end + # Changes the owner/group # uid:: _Integer_ the new owner id. Set to -1 to leave the current one # gid:: _Integer_ the new group id. Set to -1 to leave the current one diff --git a/src/rm/RequestManager.cc b/src/rm/RequestManager.cc index 6c3ca96d3e..08dd938794 100644 --- a/src/rm/RequestManager.cc +++ b/src/rm/RequestManager.cc @@ -246,6 +246,8 @@ void RequestManager::register_xml_methods() // VirtualNetwork Methods xmlrpc_c::methodPtr vn_addleases(new VirtualNetworkAddLeases()); xmlrpc_c::methodPtr vn_rmleases(new VirtualNetworkRemoveLeases()); + xmlrpc_c::methodPtr vn_hold(new VirtualNetworkHold()); + xmlrpc_c::methodPtr vn_release(new VirtualNetworkRelease()); // Update Template Methods xmlrpc_c::methodPtr image_update(new ImageUpdateTemplate()); @@ -357,6 +359,8 @@ void RequestManager::register_xml_methods() /* Network related methods*/ RequestManagerRegistry.addMethod("one.vn.addleases", vn_addleases); RequestManagerRegistry.addMethod("one.vn.rmleases", vn_rmleases); + RequestManagerRegistry.addMethod("one.vn.hold", vn_hold); + RequestManagerRegistry.addMethod("one.vn.release", vn_release); RequestManagerRegistry.addMethod("one.vn.allocate", vn_allocate); RequestManagerRegistry.addMethod("one.vn.publish", vn_publish); RequestManagerRegistry.addMethod("one.vn.update", vn_update); diff --git a/src/rm/RequestManagerVirtualNetwork.cc b/src/rm/RequestManagerVirtualNetwork.cc index af410a025f..b3bb5ed0b8 100644 --- a/src/rm/RequestManagerVirtualNetwork.cc +++ b/src/rm/RequestManagerVirtualNetwork.cc @@ -80,7 +80,7 @@ void RequestManagerVirtualNetwork:: if ( rc < 0 ) { failure_response(INTERNAL, - request_error("Error modifiying network leases",error_str), + request_error("Error modifying network leases",error_str), att); vn->unlock(); diff --git a/src/vnm/Leases.cc b/src/vnm/Leases.cc index fa0eedabb1..c159294625 100644 --- a/src/vnm/Leases.cc +++ b/src/vnm/Leases.cc @@ -386,23 +386,11 @@ int Leases::update(SqlDB * db) bool Leases::check(const string& ip) { - map::iterator it; - unsigned int _ip; Leases::Lease::ip_to_number(ip,_ip); - - it=leases.find(_ip); - - if (it!=leases.end()) - { - return it->second->used; - } - else - { - return false; - } + return check(_ip); } /* -------------------------------------------------------------------------- */ @@ -424,6 +412,95 @@ bool Leases::check(unsigned int ip) } } +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +int Leases::hold_leases(vector& vector_leases, + string& error_msg) +{ + const VectorAttribute * single_attr_lease = 0; + + int rc; + string ip; + string mac; + + if ( vector_leases.size() > 0 ) + { + single_attr_lease = + dynamic_cast(vector_leases[0]); + } + + if ( single_attr_lease == 0 ) + { + error_msg = "Empty lease description."; + return -1; + } + + ip = single_attr_lease->vector_value("IP"); + + if ( check(ip) ) + { + error_msg = "Lease is in use."; + return -1; + } + + rc = set(-1, ip, mac); + + if ( rc != 0 ) + { + error_msg = "Lease is not part of the NET."; + return -1; + } + + return 0; +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +int Leases::free_leases(vector& vector_leases, + string& error_msg) +{ + const VectorAttribute * single_attr_lease = 0; + map::iterator it; + + unsigned int i_ip; + string st_ip; + string mac; + + if ( vector_leases.size() > 0 ) + { + single_attr_lease = + dynamic_cast(vector_leases[0]); + } + + if ( single_attr_lease == 0 ) + { + error_msg = "Empty lease description."; + return -1; + } + + st_ip = single_attr_lease->vector_value("IP"); + + if ( Leases::Lease::ip_to_number(st_ip,i_ip) != 0 ) + { + error_msg = "Wrong Lease format."; + return -1; + } + + it = leases.find(i_ip); + + if ( it == leases.end() || (it->second->used && it->second->vid != -1) ) + { + error_msg = "Lease is not on hold."; + return -1; + } + + release(st_ip); + + return 0; +} + /* ************************************************************************** */ /* Leases :: Misc */ /* ************************************************************************** */ diff --git a/src/vnm/VirtualNetwork.cc b/src/vnm/VirtualNetwork.cc index 72a833d407..5fa53f2115 100644 --- a/src/vnm/VirtualNetwork.cc +++ b/src/vnm/VirtualNetwork.cc @@ -646,3 +646,29 @@ int VirtualNetwork::remove_leases(VirtualNetworkTemplate * leases_template, /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ + +int VirtualNetwork::hold_leases(VirtualNetworkTemplate * leases_template, + string& error_msg) +{ + vector vector_leases; + + leases_template->get("LEASES", vector_leases); + + return leases->hold_leases(vector_leases, error_msg); +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +int VirtualNetwork::free_leases(VirtualNetworkTemplate * leases_template, + string& error_msg) +{ + vector vector_leases; + + leases_template->get("LEASES", vector_leases); + + return leases->free_leases(vector_leases, error_msg); +} + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ From f95115ae12085c191b5b426fbf01b3fd07858216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tino=20V=C3=A1zquez?= Date: Tue, 29 Nov 2011 16:37:01 +0100 Subject: [PATCH 073/157] Feature VMWARE: Added VMware drivers to OpenNebula. Contributed by C12G --- NOTICE | 6 +- SConstruct | 1 + install.sh | 62 +++++++--- share/etc/oned.conf | 33 +++++ src/im_mad/remotes/vmware.d/vmware.rb | 118 ++++++++++++++++++ src/image_mad/remotes/fs/cp | 25 +++- src/image_mad/remotes/fs/fsrc | 10 ++ src/image_mad/remotes/fs/mv | 8 +- src/image_mad/remotes/fs/rm | 2 +- src/mad/ruby/ActionManager.rb | 2 - src/mad/ruby/vmwarelib.rb | 60 +++++++++ src/mad/utils/SConstruct | 22 ++++ src/mad/utils/tty_expect.c | 168 ++++++++++++++++++++++++++ src/tm_mad/vmware/tm_clone.sh | 70 +++++++++++ src/tm_mad/vmware/tm_ln.sh | 60 +++++++++ src/tm_mad/vmware/tm_mv.sh | 52 ++++++++ src/tm_mad/vmware/tm_vmware.conf | 22 ++++ src/vmm_mad/exec/vmm_exec_vmware.conf | 35 ++++++ src/vmm_mad/remotes/vmware/cancel | 54 +++++++++ src/vmm_mad/remotes/vmware/checkpoint | 1 + src/vmm_mad/remotes/vmware/deploy | 92 ++++++++++++++ src/vmm_mad/remotes/vmware/migrate | 21 ++++ src/vmm_mad/remotes/vmware/poll | 77 ++++++++++++ src/vmm_mad/remotes/vmware/restore | 89 ++++++++++++++ src/vmm_mad/remotes/vmware/save | 68 +++++++++++ src/vmm_mad/remotes/vmware/shutdown | 62 ++++++++++ src/vmm_mad/remotes/vmware/vmwarerc | 41 +++++++ 27 files changed, 1240 insertions(+), 21 deletions(-) create mode 100755 src/im_mad/remotes/vmware.d/vmware.rb create mode 100644 src/mad/ruby/vmwarelib.rb create mode 100644 src/mad/utils/SConstruct create mode 100644 src/mad/utils/tty_expect.c create mode 100755 src/tm_mad/vmware/tm_clone.sh create mode 100755 src/tm_mad/vmware/tm_ln.sh create mode 100755 src/tm_mad/vmware/tm_mv.sh create mode 100644 src/tm_mad/vmware/tm_vmware.conf create mode 100644 src/vmm_mad/exec/vmm_exec_vmware.conf create mode 100755 src/vmm_mad/remotes/vmware/cancel create mode 100644 src/vmm_mad/remotes/vmware/checkpoint create mode 100755 src/vmm_mad/remotes/vmware/deploy create mode 100755 src/vmm_mad/remotes/vmware/migrate create mode 100755 src/vmm_mad/remotes/vmware/poll create mode 100755 src/vmm_mad/remotes/vmware/restore create mode 100755 src/vmm_mad/remotes/vmware/save create mode 100755 src/vmm_mad/remotes/vmware/shutdown create mode 100644 src/vmm_mad/remotes/vmware/vmwarerc diff --git a/NOTICE b/NOTICE index 49f4ba2871..badbb70770 100644 --- a/NOTICE +++ b/NOTICE @@ -1,6 +1,8 @@ OpenNebula Open Source Project +-------------------------------------------------------------------------------- Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) ------------------------------------------ +Copyright 2010-2011, C12G Labs S.L. (C12G.com) +-------------------------------------------------------------------------------- You can find more information about the project, release notes and documentation at www.OpenNebula.org @@ -20,6 +22,8 @@ The following people have contributed to the development of the technology - Daniel Molina Aranda (dmolina@opennebula.org) - Hector Sanjuan Redondo (hsanjuan@opennebula.org) +OpenNebula Project also acknowledges the contributions of C12G Labs developers. + LICENSE OpenNebula is licensed under the Apache License, Version 2.0 (the diff --git a/SConstruct b/SConstruct index 506738d5e5..678ff0dc7e 100644 --- a/SConstruct +++ b/SConstruct @@ -189,6 +189,7 @@ build_scripts=[ 'src/host/SConstruct', 'src/group/SConstruct', 'src/mad/SConstruct', + 'src/mad/utils/SConstruct', 'src/nebula/SConstruct', 'src/pool/SConstruct', 'src/vm/SConstruct', diff --git a/install.sh b/install.sh index fcbc67b326..7b24048a51 100755 --- a/install.sh +++ b/install.sh @@ -180,14 +180,13 @@ fi SHARE_DIRS="$SHARE_LOCATION/examples \ $SHARE_LOCATION/examples/tm" -ETC_DIRS="$ETC_LOCATION/im_kvm \ - $ETC_LOCATION/im_xen \ - $ETC_LOCATION/im_ec2 \ +ETC_DIRS="$ETC_LOCATION/im_ec2 \ $ETC_LOCATION/vmm_ec2 \ $ETC_LOCATION/vmm_exec \ $ETC_LOCATION/tm_shared \ $ETC_LOCATION/tm_ssh \ $ETC_LOCATION/tm_dummy \ + $ETC_LOCATION/tm_vmware \ $ETC_LOCATION/tm_lvm \ $ETC_LOCATION/hm \ $ETC_LOCATION/auth \ @@ -210,6 +209,7 @@ LIB_DIRS="$LIB_LOCATION/ruby \ $LIB_LOCATION/tm_commands/ssh \ $LIB_LOCATION/tm_commands/dummy \ $LIB_LOCATION/tm_commands/lvm \ + $LIB_LOCATION/tm_commands/vmware \ $LIB_LOCATION/mads \ $LIB_LOCATION/sh \ $LIB_LOCATION/ruby/cli \ @@ -220,9 +220,11 @@ VAR_DIRS="$VAR_LOCATION/remotes \ $VAR_LOCATION/remotes/im \ $VAR_LOCATION/remotes/im/kvm.d \ $VAR_LOCATION/remotes/im/xen.d \ + $VAR_LOCATION/remotes/im/vmware.d \ $VAR_LOCATION/remotes/im/ganglia.d \ - $VAR_LOCATION/remotes/vmm/xen \ $VAR_LOCATION/remotes/vmm/kvm \ + $VAR_LOCATION/remotes/vmm/xen \ + $VAR_LOCATION/remotes/vmm/vmware \ $VAR_LOCATION/remotes/hooks \ $VAR_LOCATION/remotes/hooks/vnm \ $VAR_LOCATION/remotes/hooks/ft \ @@ -327,6 +329,7 @@ INSTALL_FILES=( IM_PROBES_FILES:$VAR_LOCATION/remotes/im IM_PROBES_KVM_FILES:$VAR_LOCATION/remotes/im/kvm.d IM_PROBES_XEN_FILES:$VAR_LOCATION/remotes/im/xen.d + IM_PROBES_VMWARE_FILES:$VAR_LOCATION/remotes/im/vmware.d IM_PROBES_GANGLIA_FILES:$VAR_LOCATION/remotes/im/ganglia.d AUTH_SSH_FILES:$VAR_LOCATION/remotes/auth/ssh AUTH_X509_FILES:$VAR_LOCATION/remotes/auth/x509 @@ -337,10 +340,13 @@ INSTALL_FILES=( AUTH_QUOTA_FILES:$VAR_LOCATION/remotes/auth/quota VMM_EXEC_KVM_SCRIPTS:$VAR_LOCATION/remotes/vmm/kvm VMM_EXEC_XEN_SCRIPTS:$VAR_LOCATION/remotes/vmm/xen + VMM_EXEC_VMWARE_SCRIPTS:$VAR_LOCATION/remotes/vmm/vmware SHARED_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/shared SSH_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/ssh + VMWARE_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/vmware DUMMY_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/dummy LVM_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/lvm + VMWARE_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/vmware IMAGE_DRIVER_FS_SCRIPTS:$VAR_LOCATION/remotes/image/fs NETWORK_HOOK_SCRIPTS:$VAR_LOCATION/remotes/vnm EXAMPLE_SHARE_FILES:$SHARE_LOCATION/examples @@ -446,6 +452,7 @@ INSTALL_OZONES_ETC_FILES=( INSTALL_ETC_FILES=( ETC_FILES:$ETC_LOCATION + VMWARE_ETC_FILES:$ETC_LOCATION VMM_EC2_ETC_FILES:$ETC_LOCATION/vmm_ec2 VMM_EXEC_ETC_FILES:$ETC_LOCATION/vmm_exec IM_EC2_ETC_FILES:$ETC_LOCATION/im_ec2 @@ -453,6 +460,7 @@ INSTALL_ETC_FILES=( TM_SSH_ETC_FILES:$ETC_LOCATION/tm_ssh TM_DUMMY_ETC_FILES:$ETC_LOCATION/tm_dummy TM_LVM_ETC_FILES:$ETC_LOCATION/tm_lvm + TM_VMWARE_ETC_FILES:$ETC_LOCATION/tm_vmware HM_ETC_FILES:$ETC_LOCATION/hm AUTH_ETC_FILES:$ETC_LOCATION/auth ECO_ETC_FILES:$ETC_LOCATION @@ -479,6 +487,7 @@ BIN_FILES="src/nebula/oned \ src/cli/oneacl \ src/onedb/onedb \ src/authm_mad/remotes/quota/onequota \ + src/mad/utils/tty_expect \ share/scripts/one" #------------------------------------------------------------------------------- @@ -499,6 +508,7 @@ RUBY_LIB_FILES="src/mad/ruby/ActionManager.rb \ src/mad/ruby/OpenNebulaDriver.rb \ src/mad/ruby/VirtualMachineDriver.rb \ src/mad/ruby/Ganglia.rb \ + src/mad/ruby/vmwarelib.rb \ src/oca/ruby/OpenNebula.rb \ src/tm_mad/TMScript.rb \ src/authm_mad/remotes/ssh/ssh_auth.rb \ @@ -575,21 +585,36 @@ VMM_EXEC_XEN_SCRIPTS="src/vmm_mad/remotes/xen/cancel \ src/vmm_mad/remotes/xen/poll_ganglia \ src/vmm_mad/remotes/xen/shutdown" +#------------------------------------------------------------------------------- +# VMM Driver VMWARE scripts, to be installed under $REMOTES_LOCATION/vmm/vmware +#------------------------------------------------------------------------------- + +VMM_EXEC_VMWARE_SCRIPTS="src/vmm_mad/remotes/vmware/cancel \ + src/vmm_mad/remotes/vmware/deploy \ + src/vmm_mad/remotes/vmware/migrate \ + src/vmm_mad/remotes/vmware/restore \ + src/vmm_mad/remotes/vmware/save \ + src/vmm_mad/remotes/vmware/poll \ + src/vmm_mad/remotes/vmware/checkpoint \ + src/vmm_mad/remotes/vmware/shutdown" + #------------------------------------------------------------------------------- # Information Manager Probes, to be installed under $REMOTES_LOCATION/im #------------------------------------------------------------------------------- IM_PROBES_FILES="src/im_mad/remotes/run_probes" -IM_PROBES_XEN_FILES="src/im_mad/remotes/xen.d/xen.rb \ - src/im_mad/remotes/xen.d/architecture.sh \ - src/im_mad/remotes/xen.d/cpu.sh \ - src/im_mad/remotes/xen.d/name.sh" - IM_PROBES_KVM_FILES="src/im_mad/remotes/kvm.d/kvm.rb \ - src/im_mad/remotes/kvm.d/architecture.sh \ - src/im_mad/remotes/kvm.d/cpu.sh \ - src/im_mad/remotes/kvm.d/name.sh" + src/im_mad/remotes/kvm.d/architecture.sh \ + src/im_mad/remotes/kvm.d/cpu.sh \ + src/im_mad/remotes/kvm.d/name.sh" + +IM_PROBES_XEN_FILES="src/im_mad/remotes/xen.d/xen.rb \ + src/im_mad/remotes/xen.d/architecture.sh \ + src/im_mad/remotes/xen.d/cpu.sh \ + src/im_mad/remotes/xen.d/name.sh" + +IM_PROBES_VMWARE_FILES="src/im_mad/remotes/vmware.d/vmware.rb" IM_PROBES_GANGLIA_FILES="src/im_mad/remotes/ganglia.d/ganglia_probe" @@ -645,8 +670,12 @@ LVM_TM_COMMANDS_LIB_FILES="src/tm_mad/lvm/tm_clone.sh \ src/tm_mad/lvm/tm_mv.sh \ src/tm_mad/lvm/tm_context.sh" +VMWARE_TM_COMMANDS_LIB_FILES="src/tm_mad/vmware/tm_clone.sh \ + src/tm_mad/vmware/tm_ln.sh \ + src/tm_mad/vmware/tm_mv.sh" + #------------------------------------------------------------------------------- -# Image Repository drivers, to be installed under $REMOTES_LOCTION/image +# Image Repository drivers, to be installed under $REMOTES_LOCATION/image # - FS based Image Repository, $REMOTES_LOCATION/image/fs #------------------------------------------------------------------------------- IMAGE_DRIVER_FS_SCRIPTS="src/image_mad/remotes/fs/cp \ @@ -675,6 +704,8 @@ ETC_FILES="share/etc/oned.conf \ share/etc/defaultrc \ src/cli/etc/group.default" +VMWARE_ETC_FILES="src/vmm_mad/remotes/vmware/vmwarerc" + #------------------------------------------------------------------------------- # Virtualization drivers config. files, to be installed under $ETC_LOCATION # - ec2, $ETC_LOCATION/vmm_ec2 @@ -686,7 +717,8 @@ VMM_EC2_ETC_FILES="src/vmm_mad/ec2/vmm_ec2rc \ VMM_EXEC_ETC_FILES="src/vmm_mad/exec/vmm_execrc \ src/vmm_mad/exec/vmm_exec_kvm.conf \ - src/vmm_mad/exec/vmm_exec_xen.conf" + src/vmm_mad/exec/vmm_exec_xen.conf \ + src/vmm_mad/exec/vmm_exec_vmware.conf" #------------------------------------------------------------------------------- # Information drivers config. files, to be installed under $ETC_LOCATION @@ -716,6 +748,8 @@ TM_DUMMY_ETC_FILES="src/tm_mad/dummy/tm_dummy.conf \ TM_LVM_ETC_FILES="src/tm_mad/lvm/tm_lvm.conf \ src/tm_mad/lvm/tm_lvmrc" +TM_VMWARE_ETC_FILES="src/tm_mad/vmware/tm_vmware.conf" + #------------------------------------------------------------------------------- # Hook Manager driver config. files, to be installed under $ETC_LOCATION/hm #------------------------------------------------------------------------------- diff --git a/share/etc/oned.conf b/share/etc/oned.conf index 630303e906..493890978d 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -139,6 +139,17 @@ IM_MAD = [ # arguments = "xen" ] #------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +# VMware Information Driver Manager Configuration +# -r number of retries when monitoring a host +# -t number of threads, i.e. number of hosts monitored at the same time +#------------------------------------------------------------------------------- +#IM_MAD = [ +# name = "im_vmware", +# executable = "one_im_sh", +# arguments = "-t 15 -r 0 vmware" ] +#------------------------------------------------------------------------------- + #------------------------------------------------------------------------------- # EC2 Information Driver Manager Configuration #------------------------------------------------------------------------------- @@ -218,6 +229,19 @@ VM_MAD = [ # type = "xen" ] #------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +# VMware Virtualization Driver Manager Configuration +# -r number of retries when monitoring a host +# -t number of threads, i.e. number of hosts monitored at the same time +#------------------------------------------------------------------------------- +#VM_MAD = [ +# name = "vmm_vmware", +# executable = "one_vmm_sh", +# arguments = "-t 15 -r 0 vmware", +# default = "vmm_exec/vmm_exec_vmware.conf", +# type = "vmware" ] +#------------------------------------------------------------------------------- + #------------------------------------------------------------------------------- # EC2 Virtualization Driver Manager Configuration # arguments: default values for the EC2 driver, can be an absolute path or @@ -289,6 +313,15 @@ TM_MAD = [ # arguments = "tm_lvm/tm_lvm.conf" ] #------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +# VMware DataStore Transfer Manager Driver Configuration +#------------------------------------------------------------------------------- +#TM_MAD = [ +# name = "tm_vmware", +# executable = "one_tm", +# arguments = "tm_vmware/tm_vmware.conf" ] +#------------------------------------------------------------------------------- + #******************************************************************************* # Image Manager Driver Configuration #******************************************************************************* diff --git a/src/im_mad/remotes/vmware.d/vmware.rb b/src/im_mad/remotes/vmware.d/vmware.rb new file mode 100755 index 0000000000..5552818cf3 --- /dev/null +++ b/src/im_mad/remotes/vmware.d/vmware.rb @@ -0,0 +1,118 @@ +#!/usr/bin/env ruby + +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +ONE_LOCATION=ENV["ONE_LOCATION"] if !defined?(ONE_LOCATION) + +if !ONE_LOCATION + ETC_LOCATION = "/etc/one" if !defined?(ETC_LOCATION) + RUBY_LIB_LOCATION = "/usr/lib/one/ruby" if !defined?(RUBY_LIB_LOCATION) +else + ETC_LOCATION = ONE_LOCATION+"/etc" if !defined?(ETC_LOCATION) + RUBY_LIB_LOCATION = ONE_LOCATION+"/lib/ruby" if !defined?(RUBY_LIB_LOCATION) +end + +$: << RUBY_LIB_LOCATION + +require 'OpenNebula' +include OpenNebula + +begin + client = Client.new() +rescue Exception => e + puts "Error: #{e}" + exit(-1) +end + +def add_info(name, value) + value = "0" if value.nil? or value.to_s.empty? + @result_str << "#{name}=#{value} " +end + +def print_info + puts @result_str +end + +@result_str = "" + +@host = ARGV[2] + +if !@host + exit -1 +end + +load ETC_LOCATION + "/vmwarerc" + +if USERNAME.class!=String || PASSWORD.class!=String + warn "Bad ESX credentials, aborting" + exit -1 +end + +data = perform_action("virsh -c #{LIBVIRT_URI} --readonly nodeinfo") + +data.split(/\n/).each{|line| + if line.match('^CPU\(s\)') + $total_cpu = line.split(":")[1].strip.to_i * 100 + elsif line.match('^CPU frequency') + $cpu_speed = line.split(":")[1].strip.split(" ")[0] + elsif line.match('^Memory size') + $total_memory = line.split(":")[1].strip.split(" ")[0] + end +} + +# Loop through all vms +used_memory = 0 +used_cpu = 0 + +vms = VirtualMachinePool.new(client) + +rc = vms.info +if OpenNebula.is_error?(rc) + warn "Couldn't reach OpenNebula, aborting." + exit -1 +end + +vm_ids_array = vms.retrieve_elements("/VM_POOL/VM[STATE=3 or STATE=5]/HISTORY_RECORDS/HISTORY[HOSTNAME=\"#{@host}\"]/../ID") + +if vm_ids_array + vm_ids_array.each do |vm_id| + vm=OpenNebula::VirtualMachine.new_with_id(vm_id, client) + rc = vm.info + + if OpenNebula.is_error?(rc) + warn "Couldn't reach OpenNebula, aborting." + exit -1 + end + + used_memory = used_memory + (vm['TEMPLATE/MEMORY'].to_i * 1024) + used_cpu = used_cpu + (vm['TEMPLATE/CPU'].to_f * 100) + end +end + +# 80% of the total free calculated memory to take hypervisor into account +free_memory = ($total_memory.to_i - used_memory) * 0.8 +# assume all the host's CPU is devoted to running Virtual Machines +free_cpu = ($total_cpu.to_f - used_cpu) + +add_info("HYPERVISOR","vmware") +add_info("TOTALCPU",$total_cpu) +add_info("FREECPU",free_cpu.to_i) +add_info("CPUSPEED",$cpu_speed) +add_info("TOTALMEMORY",$total_memory) +add_info("FREEMEMORY",free_memory.to_i) + +print_info diff --git a/src/image_mad/remotes/fs/cp b/src/image_mad/remotes/fs/cp index f8c6b85b7e..bbb2a67783 100755 --- a/src/image_mad/remotes/fs/cp +++ b/src/image_mad/remotes/fs/cp @@ -41,8 +41,28 @@ DST=`generate_image_path` case $SRC in http://*) log "Downloading $SRC to the image repository" + exec_and_log "$WGET -O $DST $SRC" \ "Error downloading $SRC" + + exec_and_log "chmod 0660 $DST" + ;; + +vmware://*) + SRC=`echo $SRC|sed 's/vmware:\/\///g'` + + if [ `check_restricted $SRC` -eq 1 ]; then + log_error "Not allowed to copy images from $RESTRICTED_DIRS" + error_message "Not allowed to copy image file $SRC" + exit -1 + fi + + log "Copying local disk folder $SRC to the image repository" + + exec_and_log "cp -rf $SRC $DST" \ + "Error copying $SRC to $DST" + + exec_and_log "chmod 0770 $DST" ;; *) @@ -53,13 +73,16 @@ http://*) fi log "Copying local image $SRC to the image repository" + exec_and_log "cp -f $SRC $DST" \ "Error copying $SRC to $DST" + + exec_and_log "chmod 0660 $DST" ;; esac # ---------------- Get the size of the image & fix perms ------------ -exec_and_log "chmod 0660 $DST" + SIZE=`fs_du $DST` diff --git a/src/image_mad/remotes/fs/fsrc b/src/image_mad/remotes/fs/fsrc index fb3980a2af..c8e7a58d3a 100644 --- a/src/image_mad/remotes/fs/fsrc +++ b/src/image_mad/remotes/fs/fsrc @@ -82,4 +82,14 @@ function check_restricted { done echo 0 +} + +# Change the permissions of all the files inside directoriers (= VMware disks) +function fix_owner_perms { + + find $IMAGE_REPOSITORY_PATH -type d \ + -mindepth 1 \ + -maxdepth 1 \ + -execdir chown \ + -R $SUDO_USER '{}' \; } \ No newline at end of file diff --git a/src/image_mad/remotes/fs/mv b/src/image_mad/remotes/fs/mv index 121bdf9e11..84c845803e 100755 --- a/src/image_mad/remotes/fs/mv +++ b/src/image_mad/remotes/fs/mv @@ -44,7 +44,6 @@ fi # ------------ Move the image to the repository ------------ - case $SRC in http://*) log "Downloading $SRC to the image repository" @@ -62,7 +61,12 @@ http://*) ;; esac -exec_and_log "chmod 0660 $DST" +if [ -d $DST ]; then + exec_and_log "chmod 0770 $DST" + fix_owner_perms +else + exec_and_log "chmod 0660 $DST" +fi # ---------------- Get the size of the image ------------ SIZE=`fs_du $DST` diff --git a/src/image_mad/remotes/fs/rm b/src/image_mad/remotes/fs/rm index a8abe73c76..a8574e1038 100755 --- a/src/image_mad/remotes/fs/rm +++ b/src/image_mad/remotes/fs/rm @@ -37,6 +37,6 @@ SRC=$1 if [ -e $SRC ] ; then log "Removing $SRC from the image repository" - exec_and_log "rm $SRC" \ + exec_and_log "rm -r $SRC" \ "Error deleting $SRC" fi diff --git a/src/mad/ruby/ActionManager.rb b/src/mad/ruby/ActionManager.rb index abc66bab48..fe0eb02f55 100644 --- a/src/mad/ruby/ActionManager.rb +++ b/src/mad/ruby/ActionManager.rb @@ -16,8 +16,6 @@ require 'thread' =begin rdoc -Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) - This class provides support to handle actions. Class methods, or actions, can be registered in the action manager. The manager will wait for actions to be triggered (thread-safe), and will execute them concurrently. The action manager diff --git a/src/mad/ruby/vmwarelib.rb b/src/mad/ruby/vmwarelib.rb new file mode 100644 index 0000000000..a763e7f660 --- /dev/null +++ b/src/mad/ruby/vmwarelib.rb @@ -0,0 +1,60 @@ +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +# ---------------------------------------------------------------------------- # +# Set up the environment for the driver # +# ---------------------------------------------------------------------------- # + +ONE_LOCATION = ENV["ONE_LOCATION"] if !defined?(ONE_LOCATION) + +if !ONE_LOCATION + BIN_LOCATION = "/usr/bin" if !defined?(BIN_LOCATION) + ETC_LOCATION = "/etc/one/" if !defined?(ETC_LOCATION) + RUBY_LIB_LOCATION = "/usr/lib/one/ruby" if !defined?(RUBY_LIB_LOCATION) +else + BIN_LOCATION = ONE_LOCATION + "/bin" if !defined?(BIN_LOCATION) + ETC_LOCATION = ONE_LOCATION + "/etc/" if !defined?(ETC_LOCATION) + if !defined?(RUBY_LIB_LOCATION) + RUBY_LIB_LOCATION = ONE_LOCATION + "/lib/ruby" + end +end + +$: << RUBY_LIB_LOCATION + +require "OpenNebulaDriver" +require "CommandManager" + +# Do host sustitution in the libvirt URI +LIBVIRT_URI.gsub!('@HOST@', @host) + +# Common functions +def perform_action(command) + command = BIN_LOCATION + "/tty_expect -u " + USERNAME + " -p " + PASSWORD + " " + command + + action_result = LocalCommand.run(command) + + if action_result.code == 0 + return action_result.stdout + else + log(command, action_result.stderr, action_result.stdout) + return action_result.code + end +end + +def log(cmd, stdout, stderr) + STDERR.puts "[VMWARE] cmd failed [" + cmd + + "]. Stderr: " + stderr + ". Stdout: " + stdout +end diff --git a/src/mad/utils/SConstruct b/src/mad/utils/SConstruct new file mode 100644 index 0000000000..d99dbd44ea --- /dev/null +++ b/src/mad/utils/SConstruct @@ -0,0 +1,22 @@ +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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('env') +import os + +env['LIBS'] = "util" + +env.Program('tty_expect.c') diff --git a/src/mad/utils/tty_expect.c b/src/mad/utils/tty_expect.c new file mode 100644 index 0000000000..3b2a7e8161 --- /dev/null +++ b/src/mad/utils/tty_expect.c @@ -0,0 +1,168 @@ +/* -------------------------------------------------------------------------- */ +/* Copyright 2010-2011, C12G Labs S.L. */ +/* */ +/* Licensed 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. */ +/* -------------------------------------------------------------------------- */ + +#include + +#include +#include +#include + +#include + +#include +#include + +int expect_char(int pty, char * expected, int seconds) +{ + fd_set rfds; + struct timeval tv; + + int rc; + char c; + + do + { + if (seconds != 0) + { + FD_ZERO(&rfds); + FD_SET(pty, &rfds); + + tv.tv_sec = seconds; + tv.tv_usec = 0; + + rc = select(pty+1,&rfds,0,0, &tv); + + if ( rc <= 0 ) // timeout + { + return -1; + } + } + + rc = read(pty, (void *) &c, sizeof(char)); + + if ( rc > 0 ) + { + if(expected == 0) + { + write(1,&c,sizeof(char)); + } + + if (expected != 0 && c == *expected) + { + return 0; + } + } + } + while ( rc > 0 ); + + return -1; +} + +void write_answer(int pty, const char * answer) +{ + int len, i; + + len = strlen(answer); + + for (i=0; i <-u username> \n\n" +"SYNOPSIS\n" +" Wraps the execution of a command and sends username & password\n\n" +"OPTIONS\n" +"\t-h\tprints this help.\n" +"\t-p\tthe password\n" +"\t-u\tthe username\n" +"\t\tcomplete virsh command\n"; + +int main (int argc, char **argv) +{ + char * password = 0; + char * username = 0; + + char expect = ':'; + + int opt, pty, pid, rc; + + while((opt = getopt(argc,argv,"+hp:u:")) != -1) + switch(opt) + { + case 'h': + printf("%s",myexpect_usage); + exit(0); + break; + case 'p': + password = strdup(optarg); + break; + case 'u': + username = strdup(optarg); + break; + default: + fprintf(stderr,"Wrong option. Check usage\n"); + fprintf(stderr,"%s",myexpect_usage); + exit(-1); + break; + } + + if (password == 0 || username == 0 || optind >= argc ) + { + fprintf(stderr,"Wrong number of arguments. Check usage\n"); + fprintf(stderr,"%s",myexpect_usage); + exit(-1); + } + + pid = forkpty(&pty,0,0,0); + + if(pid == 0) + { + struct termios tios; + + tcgetattr(pty, &tios); + + tios.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL); + tios.c_oflag &= ~(ONLCR); + + tcsetattr(pty, TCSANOW, &tios); + + execvp(argv[optind],&(argv[optind])); + + exit(-1); + } + else if (pid == -1) + { + perror("fork\n"); + } + + expect_char(pty,&expect,1); + sleep(1); + write_answer(pty,username); + expect_char(pty,&expect,1); + sleep(1); + write_answer(pty,password); + + expect_char(pty,0,0); + + wait(&rc); + + return WEXITSTATUS(rc); +} diff --git a/src/tm_mad/vmware/tm_clone.sh b/src/tm_mad/vmware/tm_clone.sh new file mode 100755 index 0000000000..09a337fb03 --- /dev/null +++ b/src/tm_mad/vmware/tm_clone.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +SRC=$1 +DST=$2 + +if [ -z "${ONE_LOCATION}" ]; then + TMCOMMON=/usr/lib/one/mads/tm_common.sh +else + TMCOMMON=$ONE_LOCATION/lib/mads/tm_common.sh +fi + +. $TMCOMMON + +get_vmdir + +SRC_PATH=`arg_path $SRC` +DST_PATH=`arg_path $DST` + +fix_paths + +log_debug "$1 $2" +log_debug "DST: $DST_PATH" + +DST_DIR=`dirname $DST_PATH` + +log "Creating directory $DST_DIR" +exec_and_log "rm -rf $DST_DIR" +exec_and_log "mkdir -p $DST_PATH" +exec_and_log "chmod a+w $DST_PATH" + +case $SRC in +http://*) + log "Downloading $SRC" + exec_and_log "$WGET -O $DST_PATH $SRC" \ + "Error downloading $SRC" + ;; + +*) + log "Cloning $SRC_PATH" + exec_and_log "cp -r $SRC_PATH/* $DST_PATH" \ + "Error copying $SRC to $DST" + ;; +esac + +SRC_FILE_SUFFIX=`echo ${SRC_PATH##*.}` + +if [ "x$SRC_FILE_SUFFIX" == "xiso" ]; then + cd $DST_DIR + DISK_NAME = `basename $DST_PATH` + ln -s $DISK_NAME $DISK_NAME.iso +fi + +exec_and_log "chmod a+rw $DST_PATH" + diff --git a/src/tm_mad/vmware/tm_ln.sh b/src/tm_mad/vmware/tm_ln.sh new file mode 100755 index 0000000000..878b0785f7 --- /dev/null +++ b/src/tm_mad/vmware/tm_ln.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +SRC=$1 +DST=$2 + +if [ -z "${ONE_LOCATION}" ]; then + TMCOMMON=/usr/lib/one/mads/tm_common.sh +else + TMCOMMON=$ONE_LOCATION/lib/mads/tm_common.sh +fi + +. $TMCOMMON + +get_vmdir + +SRC_PATH=`arg_path $SRC` +DST_PATH=`arg_path $DST` + +fix_dst_path + +DST_DIR=`dirname $DST_PATH` + +# SRC_PATH needs to be made relative to $ONE_LOCATION/var +VM_FOLDER_NAME=`basename $SRC_PATH` +REPO_NAME="images" +RELATIVE_SRC_PATH="../../$REPO_NAME/$VM_FOLDER_NAME" + +log "Creating directory $DST_PATH" +exec_and_log "rm -rf $DST_PATH" +exec_and_log "mkdir -p $DST_PATH" +exec_and_log "chmod a+w $DST_PATH" + +log "Link all files in $SRC_PATH to $DST_PATH" +IMAGE_DIR=`dirname $DST_PATH` + +cd $IMAGE_DIR + +for file in `find $RELATIVE_SRC_PATH/* -type f`; do + file_name=`basename $file` + exec_and_log "ln -sf ../$file $DST_PATH/$file_name" +done + + + diff --git a/src/tm_mad/vmware/tm_mv.sh b/src/tm_mad/vmware/tm_mv.sh new file mode 100755 index 0000000000..29d895a212 --- /dev/null +++ b/src/tm_mad/vmware/tm_mv.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +SRC=$1 +DST=$2 + +if [ -z "${ONE_LOCATION}" ]; then + TMCOMMON=/usr/lib/one/mads/tm_common.sh + VAR_LOCATION=/var/lib/one/ +else + TMCOMMON=$ONE_LOCATION/lib/mads/tm_common.sh + VAR_LOCATION=$ONE_LOCATION/var/ +fi + +. $TMCOMMON + +get_vmdir + +SRC_PATH=`arg_path $SRC` +DST_PATH=`arg_path $DST` + +fix_paths + +DST_PATH=`fix_dir_slashes "$DST_PATH"` +SRC_PATH=`fix_dir_slashes "$SRC_PATH"` + +if [ "$SRC_PATH" = "$DST_PATH" ]; then + log "Will not move, source and destination are equal" +elif echo $SRC_PATH | grep -q 'disk\.[0-9]\+$'; then + log "Moving $SRC_PATH" + exec_and_log "mv $SRC_PATH $DST_PATH" +elif [ -d $SRC_PATH ]; then + log "Will not move, is not saving image" +else + log "Moving $SRC_PATH" + exec_and_log "mv $SRC_PATH $DST_PATH" +fi diff --git a/src/tm_mad/vmware/tm_vmware.conf b/src/tm_mad/vmware/tm_vmware.conf new file mode 100644 index 0000000000..c7fc099ed3 --- /dev/null +++ b/src/tm_mad/vmware/tm_vmware.conf @@ -0,0 +1,22 @@ +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +CLONE = vmware/tm_clone.sh +LN = vmware/tm_ln.sh +MKSWAP = dummy/tm_dummy.sh +MKIMAGE = dummy/tm_dummy.sh +DELETE = shared/tm_delete.sh +MV = vmware/tm_mv.sh diff --git a/src/vmm_mad/exec/vmm_exec_vmware.conf b/src/vmm_mad/exec/vmm_exec_vmware.conf new file mode 100644 index 0000000000..3075ff7625 --- /dev/null +++ b/src/vmm_mad/exec/vmm_exec_vmware.conf @@ -0,0 +1,35 @@ +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +# Default configuration attributes for the VMware driver +# (all domains will use these values as defaults) +# Valid atributes: +# - memory +# - cpu +# - os[arch] +# - disk[dirver] +# - datastore + +CPU = 1 +MEMORY = 256 +OS = [ ARCH = i686 ] +DISK = [ DRIVER = file ] + +# Name of the datastore in the remote VMware hypervisors +# mounting $ONE_LOCATION/var exported as a nfs share +# by the OpenNebula front-end + +DATASTORE = images diff --git a/src/vmm_mad/remotes/vmware/cancel b/src/vmm_mad/remotes/vmware/cancel new file mode 100755 index 0000000000..aa01113c91 --- /dev/null +++ b/src/vmm_mad/remotes/vmware/cancel @@ -0,0 +1,54 @@ +#!/usr/bin/env ruby + +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +ONE_LOCATION=ENV["ONE_LOCATION"] if !defined?(ONE_LOCATION) + +if !ONE_LOCATION + ETC_LOCATION="/etc/one" if !defined?(ETC_LOCATION) +else + ETC_LOCATION=ONE_LOCATION+"/etc" if !defined?(ETC_LOCATION) +end + +deploy_id = ARGV[0] +@host = ARGV[1] + +if !@host or !deploy_id + exit -1 +end + +load ETC_LOCATION + "/vmwarerc" + +if USERNAME.class!=String || PASSWORD.class!=String + warn "Bad ESX credentials, aborting" + exit -1 +end + +# Destroy the VM +data = perform_action("virsh -c #{LIBVIRT_URI} destroy #{deploy_id}") + +if data.class == Fixnum + exit data +end + +# Undefine the VM +data = perform_action("virsh -c #{LIBVIRT_URI} undefine #{deploy_id}") + +if data.class == Fixnum + exit data +end + diff --git a/src/vmm_mad/remotes/vmware/checkpoint b/src/vmm_mad/remotes/vmware/checkpoint new file mode 100644 index 0000000000..b49673a614 --- /dev/null +++ b/src/vmm_mad/remotes/vmware/checkpoint @@ -0,0 +1 @@ +checkpoint \ No newline at end of file diff --git a/src/vmm_mad/remotes/vmware/deploy b/src/vmm_mad/remotes/vmware/deploy new file mode 100755 index 0000000000..24b3623ba6 --- /dev/null +++ b/src/vmm_mad/remotes/vmware/deploy @@ -0,0 +1,92 @@ +#!/usr/bin/env ruby + +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +ONE_LOCATION=ENV["ONE_LOCATION"] if !defined?(ONE_LOCATION) + +if !ONE_LOCATION + ETC_LOCATION="/etc/one" if !defined?(ETC_LOCATION) +else + ETC_LOCATION=ONE_LOCATION+"/etc" if !defined?(ETC_LOCATION) +end + +deployment_file = ARGV[0] +@host = ARGV[1] + +if !@host or !deployment_file + exit -1 +end + +load ETC_LOCATION + "/vmwarerc" + +if USERNAME.class!=String || PASSWORD.class!=String + warn "Bad ESX credentials, aborting" + exit -1 +end + +# Define the VM +data = perform_action("virsh -c #{LIBVIRT_URI} define #{deployment_file}") + +if data.class == Fixnum + exit data +end + +domainname = "" +success = false + +data.split('\n').each{ |line| + domainname = line.match("Domain (.*) defined from (.*)") + if domainname + success = true + break + end +} + +if !success + exit -1 +end + +domainname = domainname[1] + +# Start the VM +data = perform_action("virsh -c #{LIBVIRT_URI} start #{domainname}") + +if data.class == Fixnum + exit data +end + +definedname = domainname +domainname = "" +success = false + +data.split('\n').each{ |line| + domainname = line.match("Domain (.*) started") + if domainname + success = true + break + end +} + +if !success + exit -1 +end + +if definedname != domainname[1] + exit -1 +else + puts definedname +end diff --git a/src/vmm_mad/remotes/vmware/migrate b/src/vmm_mad/remotes/vmware/migrate new file mode 100755 index 0000000000..198a9e6d79 --- /dev/null +++ b/src/vmm_mad/remotes/vmware/migrate @@ -0,0 +1,21 @@ +#!/usr/bin/env ruby + +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +# Action not supported +exit -1 + diff --git a/src/vmm_mad/remotes/vmware/poll b/src/vmm_mad/remotes/vmware/poll new file mode 100755 index 0000000000..c304b45f3b --- /dev/null +++ b/src/vmm_mad/remotes/vmware/poll @@ -0,0 +1,77 @@ +#!/usr/bin/env ruby + +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +ONE_LOCATION=ENV["ONE_LOCATION"] if !defined?(ONE_LOCATION) + +if !ONE_LOCATION + ETC_LOCATION="/etc/one" if !defined?(ETC_LOCATION) +else + ETC_LOCATION=ONE_LOCATION+"/etc" if !defined?(ETC_LOCATION) +end + + +deploy_id = ARGV[0] +@host = ARGV[1] + +if !@host or !deploy_id + exit -1 +end + +load ETC_LOCATION + "/vmwarerc" + +if USERNAME.class!=String || PASSWORD.class!=String + warn "Bad ESX credentials, aborting" + exit -1 +end + +data = perform_action( + "virsh -c #{LIBVIRT_URI} --readonly dominfo #{deploy_id}") + + if data.class == Fixnum + puts "STATE=d" + exit 0 + end + +state = "" + +data.split('\n').each{ |line| + state = line.match("^State: (.*)") + + if state + state = state[1].strip + break + end +} + +state_short = "" + +case state + when "running","blocked","shutdown","dying" + state_short = 'a' + when "paused" + state_short = 'p' + when "crashed" + state_short = 'c' + else + state_short = 'd' +end + +puts "STATE=#{state_short}" + + + diff --git a/src/vmm_mad/remotes/vmware/restore b/src/vmm_mad/remotes/vmware/restore new file mode 100755 index 0000000000..f50ac54d36 --- /dev/null +++ b/src/vmm_mad/remotes/vmware/restore @@ -0,0 +1,89 @@ +#!/usr/bin/env ruby + +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +ONE_LOCATION=ENV["ONE_LOCATION"] if !defined?(ONE_LOCATION) + +if !ONE_LOCATION + ETC_LOCATION="/etc/one" if !defined?(ETC_LOCATION) +else + ETC_LOCATION=ONE_LOCATION+"/etc" if !defined?(ETC_LOCATION) +end + +file = ARGV[0] +@host = ARGV[1] + +if !@host or !file + exit -1 +end + +load ETC_LOCATION + "/vmwarerc" + +if USERNAME.class!=String || PASSWORD.class!=String + warn "Bad ESX credentials, aborting" + exit -1 +end + +# Define the VM +deployment_file = File.dirname(File.dirname(file)) + "/deployment.0" + +data = perform_action("virsh -c #{LIBVIRT_URI} define #{deployment_file}") + +if data.class == Fixnum + exit data +end + +domainname = "" +success = false + +data.split('\n').each{ |line| + domainname = line.match("Domain (.*) defined from (.*)") + if domainname + success = true + break + end +} + +if !success + exit -1 +end + +domainname = domainname[1] + +# Revert snapshot VM +# Note: This assumes the checkpoint name is "checkpoint", to change this +# it is needed to change also +# $ONE_LOCATION/lib/remotes/vmm/vmware/checkpoint + +data = perform_action( + "virsh -c #{LIBVIRT_URI} snapshot-revert #{domainname} checkpoint") + +if data.class == Fixnum + exit data +end + +# Delete checkpoint +data = perform_action( + "virsh -c #{LIBVIRT_URI} snapshot-delete #{domainname} checkpoint") + +if data.class == Fixnum + exit data +end + + + + diff --git a/src/vmm_mad/remotes/vmware/save b/src/vmm_mad/remotes/vmware/save new file mode 100755 index 0000000000..d88d1923ce --- /dev/null +++ b/src/vmm_mad/remotes/vmware/save @@ -0,0 +1,68 @@ +#!/usr/bin/env ruby + +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +ONE_LOCATION=ENV["ONE_LOCATION"] if !defined?(ONE_LOCATION) + +if !ONE_LOCATION + ETC_LOCATION = "/etc/one" if !defined?(ETC_LOCATION) + VAR_LOCATION = "/var/lib/one" if !defined?(VAR_LOCATION) +else + ETC_LOCATION = ONE_LOCATION + "/etc" if !defined?(ETC_LOCATION) + VAR_LOCATION = ONE_LOCATION + "/var" if !defined?(VAR_LOCATION) +end + +deploy_id = ARGV[0] +file = ARGV[1] +@host = ARGV[2] + +if !@host or !deploy_id or !file + exit -1 +end + +load ETC_LOCATION + "/vmwarerc" + +if USERNAME.class!=String || PASSWORD.class!=String + warn "Bad ESX credentials, aborting" + exit -1 +end + +# Create snapshot +checkpoint_xml_file = VAR_LOCATION + "/remotes/vmm/vmware/checkpoint" + +data = perform_action( + "virsh -c #{LIBVIRT_URI} snapshot-create #{deploy_id} #{checkpoint_xml_file}") + +if data.class == Fixnum + exit data +end + +# Suspend VM +data = perform_action("virsh -c #{LIBVIRT_URI} suspend #{deploy_id}") + +if data.class == Fixnum + exit data +end + +# Undefine VM +data = perform_action("virsh -c #{LIBVIRT_URI} undefine #{deploy_id}") + +if data.class == Fixnum + exit data +end + + diff --git a/src/vmm_mad/remotes/vmware/shutdown b/src/vmm_mad/remotes/vmware/shutdown new file mode 100755 index 0000000000..04bcb64238 --- /dev/null +++ b/src/vmm_mad/remotes/vmware/shutdown @@ -0,0 +1,62 @@ +#!/usr/bin/env ruby + +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +ONE_LOCATION=ENV["ONE_LOCATION"] if !defined?(ONE_LOCATION) + +if !ONE_LOCATION + ETC_LOCATION="/etc/one" if !defined?(ETC_LOCATION) +else + ETC_LOCATION=ONE_LOCATION+"/etc" if !defined?(ETC_LOCATION) +end + +deploy_id = ARGV[0] +@host = ARGV[1] + +if !@host or !deploy_id + exit -1 +end + +load ETC_LOCATION + "/vmwarerc" + +if USERNAME.class!=String || PASSWORD.class!=String + warn "Bad ESX credentials, aborting" + exit -1 +end + +data = perform_action("virsh -c #{LIBVIRT_URI} shutdown #{deploy_id}") + +if data.class == Fixnum + exit data +end + +begin + data = perform_action("virsh -c #{LIBVIRT_URI} list") + if data.class == Fixnum + exit data + end + sleep 2 +end while data.match(deploy_id) + +data = perform_action("virsh -c #{LIBVIRT_URI} undefine #{deploy_id}") + +if data.class == Fixnum + exit data +end + + + diff --git a/src/vmm_mad/remotes/vmware/vmwarerc b/src/vmm_mad/remotes/vmware/vmwarerc new file mode 100644 index 0000000000..e3267f3ea6 --- /dev/null +++ b/src/vmm_mad/remotes/vmware/vmwarerc @@ -0,0 +1,41 @@ +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +# User configurable variables (Ruby syntax) +LIBVIRT_URI = "esx://@HOST@/?no_verify=1" +QEMU_PROTOCOL = "qemu" + +# Username and password of the VMware hypervisor +USERNAME = "oneadmin" +PASSWORD = + +# Loading the vmware library for mads +# Please leave this uncommented +ONE_LOCATION=ENV["ONE_LOCATION"] if !defined?(ONE_LOCATION) + +if !ONE_LOCATION + LIB_LOCATION = "/usr/lib/one" if !defined?(LIB_LOCATION) +else + LIB_LOCATION = ONE_LOCATION+"/lib" if !defined?(LIB_LOCATION) +end + +load LIB_LOCATION + "/ruby/vmwarelib.rb" + +ENV['LANG']='C' + + + + From 955e8867d0cc19c84fa7e3b2818dc99b0fb071d1 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Mon, 28 Nov 2011 20:50:01 +0100 Subject: [PATCH 074/157] oZones: small fixes Improve the regexp matching zone endpoint urls for the vdc information to display sunstone and onexml_rpc variable addresses. Enlarge the hosts boxes when creating an VDC. Set variable dialog height. (cherry picked from commit 33d157cc7ff9f0175bcd744a194d86bf0b530b12) --- .../Server/public/js/plugins/vdcs-tab.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/ozones/Server/public/js/plugins/vdcs-tab.js b/src/ozones/Server/public/js/plugins/vdcs-tab.js index 06ae83e6d5..3f15e02315 100644 --- a/src/ozones/Server/public/js/plugins/vdcs-tab.js +++ b/src/ozones/Server/public/js/plugins/vdcs-tab.js @@ -51,12 +51,12 @@ var create_vdc_tmpl = \
          Allows hosts belonging to other VDCs to be re-added to this one. They will appear greyed-out in the lists.
          \
          \ - \ - \ + \ + \ \ -
          \ -
            \ -
              \ +
              \ +
                \ +
                  \
                  \ \
                  \ @@ -278,7 +278,7 @@ function updateVDCInfo(req,vdc_json){ var zone_host = ""; var zone_port = ""; var sun_link = ""; - var zone_match = zone_endpoint.match(/^http:\/\/(\w+):(\d+)\/RPC2$/); + var zone_match = zone_endpoint.match(/^https?:\/\/([\w.]+):(\d+)\/([\W\w]+)$/); if (zone_match){ zone_host = zone_match[1]; @@ -428,10 +428,14 @@ function setupCreateVDCDialog(){ $('div#dialogs').append('
                  '); var dialog = $('div#create_vdc_dialog'); dialog.html(create_vdc_tmpl); + + var height = Math.floor($(window).height()*0.8); + dialog.dialog({ autoOpen: false, modal: true, - width: 420 + height: height, + width: 500 }); $('button',dialog).button(); From 4c8f0467d5d117d12691917ba4a040834df3a03a Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Tue, 29 Nov 2011 12:36:16 +0100 Subject: [PATCH 075/157] Feature #1012: Vendor libraries for GUIs updated jQuery, jQueryLayout, jQueryUI, flot, Datatables, jGrowl have been updated to latest versions. Due to that, some corrections have been made to css (applilcation.css has been additionaly whitespace-cleaned). Templates, views and install.sh script have been updated accordingly. (cherry picked from commit f9769932cb44d100d015981ca58b55bba3fa2310) --- install.sh | 46 +- src/ozones/Server/templates/index.html | 8 +- src/ozones/Server/templates/login.html | 2 +- src/sunstone/public/css/application.css | 339 ++++---- src/sunstone/public/css/layout.css | 32 +- src/sunstone/public/js/layout.js | 6 +- src/sunstone/public/vendor/dataTables/NOTICE | 2 +- .../vendor/dataTables/demo_table_jui.css | 18 +- .../dataTables/jquery.dataTables.min.js | 267 +++--- src/sunstone/public/vendor/flot/NOTICE | 2 +- .../public/vendor/jGrowl/jquery.jgrowl.css | 20 +- .../vendor/jGrowl/jquery.jgrowl_minimized.js | 11 +- src/sunstone/public/vendor/jQuery/NOTICE | 2 +- .../public/vendor/jQuery/jquery-1.4.4.min.js | 167 ---- .../public/vendor/jQuery/jquery-1.7.1.min.js | 4 + .../jQueryLayout/jquery.layout-latest.min.js | 108 +++ .../jQueryLayout/jquery.layout.min-1.2.0.js | 80 -- .../jQueryLayout/layout-default-latest.css | 34 +- src/sunstone/public/vendor/jQueryUI/NOTICE | 2 +- .../ui-bg_flat_0_aaaaaa_40x100.png | Bin .../ui-bg_flat_75_ffffff_40x100.png | Bin .../ui-bg_glass_55_fbf9ee_1x400.png | Bin .../ui-bg_glass_65_ffffff_1x400.png | Bin .../ui-bg_glass_75_dadada_1x400.png | Bin .../ui-bg_glass_75_e6e6e6_1x400.png | Bin .../ui-bg_glass_95_fef1ec_1x400.png | Bin .../ui-bg_highlight-soft_75_cccccc_1x100.png | Bin .../{ => images}/ui-icons_222222_256x240.png | Bin .../{ => images}/ui-icons_2e83ff_256x240.png | Bin .../{ => images}/ui-icons_454545_256x240.png | Bin .../{ => images}/ui-icons_888888_256x240.png | Bin .../{ => images}/ui-icons_cd0a0a_256x240.png | Bin ...custom.css => jquery-ui-1.8.16.custom.css} | 124 ++- .../jQueryUI/jquery-ui-1.8.16.custom.min.js | 791 ++++++++++++++++++ .../jQueryUI/jquery-ui-1.8.7.custom.min.js | 781 ----------------- .../jQueryUI/ui-bg_flat_0_575c5b_40x100.png | Bin 224 -> 0 bytes .../jQueryUI/ui-bg_flat_0_8f9392_40x100.png | Bin 224 -> 0 bytes src/sunstone/templates/login.html | 2 +- src/sunstone/templates/login_x509.html | 2 +- src/sunstone/views/index.erb | 8 +- 40 files changed, 1387 insertions(+), 1471 deletions(-) mode change 100644 => 100755 src/sunstone/public/vendor/jGrowl/jquery.jgrowl.css delete mode 100644 src/sunstone/public/vendor/jQuery/jquery-1.4.4.min.js create mode 100644 src/sunstone/public/vendor/jQuery/jquery-1.7.1.min.js create mode 100644 src/sunstone/public/vendor/jQueryLayout/jquery.layout-latest.min.js delete mode 100644 src/sunstone/public/vendor/jQueryLayout/jquery.layout.min-1.2.0.js rename src/sunstone/public/vendor/jQueryUI/{ => images}/ui-bg_flat_0_aaaaaa_40x100.png (100%) rename src/sunstone/public/vendor/jQueryUI/{ => images}/ui-bg_flat_75_ffffff_40x100.png (100%) rename src/sunstone/public/vendor/jQueryUI/{ => images}/ui-bg_glass_55_fbf9ee_1x400.png (100%) rename src/sunstone/public/vendor/jQueryUI/{ => images}/ui-bg_glass_65_ffffff_1x400.png (100%) rename src/sunstone/public/vendor/jQueryUI/{ => images}/ui-bg_glass_75_dadada_1x400.png (100%) rename src/sunstone/public/vendor/jQueryUI/{ => images}/ui-bg_glass_75_e6e6e6_1x400.png (100%) rename src/sunstone/public/vendor/jQueryUI/{ => images}/ui-bg_glass_95_fef1ec_1x400.png (100%) rename src/sunstone/public/vendor/jQueryUI/{ => images}/ui-bg_highlight-soft_75_cccccc_1x100.png (100%) rename src/sunstone/public/vendor/jQueryUI/{ => images}/ui-icons_222222_256x240.png (100%) rename src/sunstone/public/vendor/jQueryUI/{ => images}/ui-icons_2e83ff_256x240.png (100%) rename src/sunstone/public/vendor/jQueryUI/{ => images}/ui-icons_454545_256x240.png (100%) rename src/sunstone/public/vendor/jQueryUI/{ => images}/ui-icons_888888_256x240.png (100%) rename src/sunstone/public/vendor/jQueryUI/{ => images}/ui-icons_cd0a0a_256x240.png (100%) rename src/sunstone/public/vendor/jQueryUI/{jquery-ui-1.8.7.custom.css => jquery-ui-1.8.16.custom.css} (85%) create mode 100644 src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.16.custom.min.js delete mode 100644 src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.7.custom.min.js delete mode 100644 src/sunstone/public/vendor/jQueryUI/ui-bg_flat_0_575c5b_40x100.png delete mode 100644 src/sunstone/public/vendor/jQueryUI/ui-bg_flat_0_8f9392_40x100.png diff --git a/install.sh b/install.sh index 7b24048a51..ef5202d024 100755 --- a/install.sh +++ b/install.sh @@ -250,6 +250,7 @@ SUNSTONE_DIRS="$SUNSTONE_LOCATION/models \ $SUNSTONE_LOCATION/public/vendor/jQueryLayout \ $SUNSTONE_LOCATION/public/vendor/dataTables \ $SUNSTONE_LOCATION/public/vendor/jQueryUI \ + $SUNSTONE_LOCATION/public/vendor/jQueryUI/images \ $SUNSTONE_LOCATION/public/vendor/jQuery \ $SUNSTONE_LOCATION/public/vendor/jGrowl \ $SUNSTONE_LOCATION/public/vendor/flot \ @@ -267,6 +268,7 @@ OZONES_DIRS="$OZONES_LOCATION/lib \ $OZONES_LOCATION/public/vendor/jQueryLayout \ $OZONES_LOCATION/public/vendor/dataTables \ $OZONES_LOCATION/public/vendor/jQueryUI \ + $OZONES_LOCATION/public/vendor/jQueryUI/images \ $OZONES_LOCATION/public/vendor/jGrowl \ $OZONES_LOCATION/public/js \ $OZONES_LOCATION/public/js/plugins \ @@ -409,6 +411,7 @@ INSTALL_SUNSTONE_FILES=( SUNSTONE_PUBLIC_VENDOR_JGROWL:$SUNSTONE_LOCATION/public/vendor/jGrowl SUNSTONE_PUBLIC_VENDOR_JQUERY:$SUNSTONE_LOCATION/public/vendor/jQuery SUNSTONE_PUBLIC_VENDOR_JQUERYUI:$SUNSTONE_LOCATION/public/vendor/jQueryUI + SUNSTONE_PUBLIC_VENDOR_JQUERYUIIMAGES:$SUNSTONE_LOCATION/public/vendor/jQueryUI/images SUNSTONE_PUBLIC_VENDOR_JQUERYLAYOUT:$SUNSTONE_LOCATION/public/vendor/jQueryLayout SUNSTONE_PUBLIC_VENDOR_FLOT:$SUNSTONE_LOCATION/public/vendor/flot SUNSTONE_PUBLIC_IMAGES_FILES:$SUNSTONE_LOCATION/public/images @@ -434,6 +437,7 @@ INSTALL_OZONES_FILES=( OZONES_PUBLIC_VENDOR_DATATABLES:$OZONES_LOCATION/public/vendor/dataTables OZONES_PUBLIC_VENDOR_JGROWL:$OZONES_LOCATION/public/vendor/jGrowl OZONES_PUBLIC_VENDOR_JQUERYUI:$OZONES_LOCATION/public/vendor/jQueryUI + OZONES_PUBLIC_VENDOR_JQUERYUIIMAGES:$OZONES_LOCATION/public/vendor/jQueryUI/images OZONES_PUBLIC_VENDOR_JQUERYLAYOUT:$OZONES_LOCATION/public/vendor/jQueryLayout OZONES_PUBLIC_JS_FILES:$OZONES_LOCATION/public/js OZONES_PUBLIC_IMAGES_FILES:$OZONES_LOCATION/public/images @@ -1020,34 +1024,36 @@ SUNSTONE_PUBLIC_VENDOR_JGROWL="\ src/sunstone/public/vendor/jGrowl/NOTICE" SUNSTONE_PUBLIC_VENDOR_JQUERY="\ - src/sunstone/public/vendor/jQuery/jquery-1.4.4.min.js \ + src/sunstone/public/vendor/jQuery/jquery-1.7.1.min.js \ src/sunstone/public/vendor/jQuery/MIT-LICENSE.txt \ src/sunstone/public/vendor/jQuery/NOTICE" SUNSTONE_PUBLIC_VENDOR_JQUERYUI="\ -src/sunstone/public/vendor/jQueryUI/ui-bg_glass_75_dadada_1x400.png \ -src/sunstone/public/vendor/jQueryUI/ui-icons_cd0a0a_256x240.png \ -src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.7.custom.css \ -src/sunstone/public/vendor/jQueryUI/ui-bg_flat_0_aaaaaa_40x100.png \ -src/sunstone/public/vendor/jQueryUI/ui-bg_flat_0_8f9392_40x100.png \ +src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.16.custom.css \ src/sunstone/public/vendor/jQueryUI/MIT-LICENSE.txt \ -src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.7.custom.min.js \ -src/sunstone/public/vendor/jQueryUI/ui-bg_highlight-soft_75_cccccc_1x100.png \ -src/sunstone/public/vendor/jQueryUI/ui-bg_glass_95_fef1ec_1x400.png \ -src/sunstone/public/vendor/jQueryUI/ui-bg_glass_55_fbf9ee_1x400.png \ -src/sunstone/public/vendor/jQueryUI/ui-icons_888888_256x240.png \ -src/sunstone/public/vendor/jQueryUI/ui-bg_glass_75_e6e6e6_1x400.png \ -src/sunstone/public/vendor/jQueryUI/ui-bg_flat_0_575c5b_40x100.png \ -src/sunstone/public/vendor/jQueryUI/ui-bg_glass_65_ffffff_1x400.png \ -src/sunstone/public/vendor/jQueryUI/ui-bg_flat_75_ffffff_40x100.png \ -src/sunstone/public/vendor/jQueryUI/ui-icons_2e83ff_256x240.png \ -src/sunstone/public/vendor/jQueryUI/ui-icons_454545_256x240.png \ +src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.16.custom.min.js \ src/sunstone/public/vendor/jQueryUI/NOTICE \ -src/sunstone/public/vendor/jQueryUI/ui-icons_222222_256x240.png \ " + +SUNSTONE_PUBLIC_VENDOR_JQUERYUIIMAGES="\ +src/sunstone/public/vendor/jQueryUI/images/ui-bg_flat_0_aaaaaa_40x100.png \ +src/sunstone/public/vendor/jQueryUI/images/ui-bg_flat_75_ffffff_40x100.png \ +src/sunstone/public/vendor/jQueryUI/images/ui-bg_glass_55_fbf9ee_1x400.png \ +src/sunstone/public/vendor/jQueryUI/images/ui-bg_glass_65_ffffff_1x400.png \ +src/sunstone/public/vendor/jQueryUI/images/ui-bg_glass_75_dadada_1x400.png \ +src/sunstone/public/vendor/jQueryUI/images/ui-bg_glass_75_e6e6e6_1x400.png \ +src/sunstone/public/vendor/jQueryUI/images/ui-bg_glass_95_fef1ec_1x400.png \ +src/sunstone/public/vendor/jQueryUI/images/ui-bg_highlight-soft_75_cccccc_1x100.png \ +src/sunstone/public/vendor/jQueryUI/images/ui-icons_222222_256x240.png \ +src/sunstone/public/vendor/jQueryUI/images/ui-icons_2e83ff_256x240.png \ +src/sunstone/public/vendor/jQueryUI/images/ui-icons_454545_256x240.png \ +src/sunstone/public/vendor/jQueryUI/images/ui-icons_888888_256x240.png \ +src/sunstone/public/vendor/jQueryUI/images/ui-icons_cd0a0a_256x240.png \ +" + SUNSTONE_PUBLIC_VENDOR_JQUERYLAYOUT="\ src/sunstone/public/vendor/jQueryLayout/layout-default-latest.css \ - src/sunstone/public/vendor/jQueryLayout/jquery.layout.min-1.2.0.js \ + src/sunstone/public/vendor/jQueryLayout/jquery.layout-latest.min.js \ src/sunstone/public/vendor/jQueryLayout/NOTICE" SUNSTONE_PUBLIC_VENDOR_FLOT="\ @@ -1119,6 +1125,8 @@ OZONES_PUBLIC_VENDOR_JGROWL=$SUNSTONE_PUBLIC_VENDOR_JGROWL OZONES_PUBLIC_VENDOR_JQUERYUI=$SUNSTONE_PUBLIC_VENDOR_JQUERYUI +OZONES_PUBLIC_VENDOR_JQUERYUIIMAGES=$SUNSTONE_PUBLIC_VENDOR_JQUERYUIIMAGES + OZONES_PUBLIC_VENDOR_JQUERYLAYOUT=$SUNSTONE_PUBLIC_VENDOR_JQUERYLAYOUT OZONES_PUBLIC_JS_FILES="src/ozones/Server/public/js/ozones.js \ diff --git a/src/ozones/Server/templates/index.html b/src/ozones/Server/templates/index.html index b198aad3af..bcfd3b310c 100644 --- a/src/ozones/Server/templates/index.html +++ b/src/ozones/Server/templates/index.html @@ -6,14 +6,14 @@ - + - + - - + + diff --git a/src/ozones/Server/templates/login.html b/src/ozones/Server/templates/login.html index 89847c4c35..6038b56e55 100644 --- a/src/ozones/Server/templates/login.html +++ b/src/ozones/Server/templates/login.html @@ -5,7 +5,7 @@ - + diff --git a/src/sunstone/public/css/application.css b/src/sunstone/public/css/application.css index 8c42dae392..03dc2c0a14 100644 --- a/src/sunstone/public/css/application.css +++ b/src/sunstone/public/css/application.css @@ -18,45 +18,45 @@ body { font: 9pt Arial, Verdana, Geneva, Helvetica, sans-serif; } -p{ - margin:0 10px 10px; - } +p { + margin:0 10px 10px; +} a { - color: #000C96; text-decoration: none; - } + color: #000C96; text-decoration: none; +} a:hover { - color: #127FE4; text-decoration: none; - } + color: #127FE4; text-decoration: none; +} select, button { - padding: 2px; - } + padding: 2px; +} h2 { - float:left; - font-size:20px; - margin-bottom: 5px; - padding-bottom: 0} + float:left; + font-size:20px; + margin-bottom: 5px; + padding-bottom: 0} h3 { - border-bottom: 1px solid #CCCCCC; - color: #353735; - font-size: 14px; - font-weight: normal; - padding: 5px 8px; - margin: 0 0; + border-bottom: 1px solid #CCCCCC; + color: #353735; + font-size: 14px; + font-weight: normal; + padding: 5px 8px; + margin: 0 0; } table#dashboard_table{ - width:100%; - margin: 0; - } + width:100%; + margin: 0; +} table#dashboard_table tr { vertical-align: top; } table#dashboard_table > tbody > tr > td{ - width:50%; + width:50%; } div.panel { @@ -130,16 +130,16 @@ ul.multi_action_menu li:hover { background-color: #D3D3D3;} div.action_block { - display:inline; - margin-right: 5px; - border-right: 1px solid #D3D3D3; - } + display:inline; + margin-right: 5px; + border-right: 1px solid #D3D3D3; +} div.action_blocks { - margin-bottom: 0.5em; - text-align: right; - margin-top: 0.5em; - } + margin-bottom: 0.5em; + text-align: right; + margin-top: 0.5em; +} input, textarea, select { border: 0; @@ -148,51 +148,51 @@ input, textarea, select { input, textarea { -webkit-border-radius: 3px; - -moz-border-radius: 3px; + -moz-border-radius: 3px; } form.create_form{ - margin:0; - padding:0;} + margin:0; + padding:0;} fieldset{ - margin:0 0; - border:none; - border-top:1px solid #ccc; - padding: 10px 5px;} + margin:0 0; + border:none; + border-top:1px solid #ccc; + padding: 10px 5px;} fieldset div{ - margin-bottom:.5em; - padding:0; - display:block; - } + margin-bottom:.5em; + padding:0; + display:block; +} fieldset input, fieldset textarea{ - width:180px; - /*border-top:1px solid #555; - border-left:1px solid #555; - border-bottom:1px solid #ccc; - border-right:1px solid #ccc;*/ - padding:1px;color:#333; - vertical-align: top; - margin: 0 2px; - margin-bottom: 4px; - } + width:180px; + /*border-top:1px solid #555; + border-left:1px solid #555; + border-bottom:1px solid #ccc; + border-right:1px solid #ccc;*/ + padding:1px;color:#333; + vertical-align: top; + margin: 0 2px; + margin-bottom: 4px; +} fieldset select{ - width:184px; - /*border-top:1px solid #555; - border-left:1px solid #555; - border-bottom:1px solid #ccc; - border-right:1px solid #ccc;*/ - padding:1px; - color:#333; - vertical-align: top; - margin: 0 2px; - margin-bottom: 4px; - } + width:184px; + /*border-top:1px solid #555; + border-left:1px solid #555; + border-bottom:1px solid #ccc; + border-right:1px solid #ccc;*/ + padding:1px; + color:#333; + vertical-align: top; + margin: 0 2px; + margin-bottom: 4px; +} /*Chrome hack*/ input[type="radio"],input[type="checkbox"] { @@ -200,14 +200,14 @@ input[type="radio"],input[type="checkbox"] { } legend{ - margin-top:0; - margin-bottom: 5px; - padding:0 .5em; - color:#036; - background:transparent; - font-size:1.0em; - font-weight:bold; - } + margin-top:0; + margin-bottom: 5px; + padding:0 .5em; + color:#036; + background:transparent; + font-size:1.0em; + font-weight:bold; +} label{ float: left; @@ -216,23 +216,30 @@ label{ text-align:left; } +.dataTables_wrapper label { + float: none; + width: auto; + padding: 0 0; + text-align:right; +} + div.tip { - display: inline-block; - padding-left: 5px; - vertical-align: middle; - float:none; - } + display: inline-block; + padding-left: 5px; + vertical-align: middle; + float:none; +} div.tip span.ui-icon{ - display:inline-block; + display:inline-block; } div.tip span.man_icon { - display:none; + display:none; } .img_man .man_icon { - display:inline-block!important; + display:inline-block!important; } span.tipspan,div.full_info { @@ -250,51 +257,51 @@ span.tipspan,div.full_info { font-size:10px; } .vm_section input { - float:none; + float:none; } .vm_section legend{ - display:none!important; + display:none!important; } .vm_section fieldset { - border:none!important; + border:none!important; } div.show_hide { - float:none; - clear:both; + float:none; + clear:both; } .vm_param label{ - float:left; + float:left; } fieldset div.vm_section { - margin-top:-8px; - margin-bottom:0px; + margin-top:-8px; + margin-bottom:0px; } input:focus, textarea:focus{ - background:#efefef; - color:#000; + background:#efefef; + color:#000; } .form_buttons { - margin-top:25px; - text-align:right; + margin-top:25px; + text-align:right; } .add_remove_button { - font-size:0.8em; - height:25px; - margin-bottom:4px; + font-size:0.8em; + height:25px; + margin-bottom:4px; } .add_button { - margin-left:148px; - width:74px; + margin-left:148px; + width:74px; } .remove_button { @@ -312,15 +319,15 @@ tr.odd td, tr.even td{ } tr.odd:hover{ - background-color: #E69138 !important; + background-color: #E69138 !important; } tr.even:hover{ - background-color: #E69138 !important; + background-color: #E69138 !important; } .show_hide label{ - width: 100%; + width: 100%; } .clear { @@ -334,8 +341,8 @@ tr.even:hover{ } .action_block_info{ - width: 235px; - margin: auto; + width: 235px; + margin: auto; } .icon_right { @@ -343,34 +350,34 @@ tr.even:hover{ margin-left: 20px; position: relative; top: 2px; - } +} .icon_left { float: left; margin-right: 20px; position: relative; top: 0px; - /*border:1px solid;*/ +/*border:1px solid;*/ } .info_table{ - background: none repeat scroll 0 0 #FFFFFF; - border-collapse: collapse; - margin: 20px; - text-align: left; - display: inline-block; - width:43%; - vertical-align:top; - overflow:auto; - } + background: none repeat scroll 0 0 #FFFFFF; + border-collapse: collapse; + margin: 20px; + text-align: left; + display: inline-block; + width:43%; + vertical-align:top; + overflow:auto; +} .info_table > thead th,h3 { - border-bottom: 2px solid #353735; - color: #353735; - font-size: 14px; - font-weight: normal; - padding: 10px 8px; + border-bottom: 2px solid #353735; + color: #353735; + font-size: 14px; + font-weight: normal; + padding: 10px 8px; } @@ -381,16 +388,16 @@ tr.even:hover{ padding-bottom: 6px; padding-left: 8px; padding-right: 8px; - } +} /*.info_table > tbody, .info_table > thead, info_table > tbody > tr { - width: 100%; -}*/ + width: 100%; + }*/ .info_table td.key_td{ - min-width: 150px; - text-align:left; - font-weight:bold; + min-width: 150px; + text-align:left; + font-weight:bold; } .info_table td.graph_td{ @@ -400,8 +407,8 @@ tr.even:hover{ } .info_table td.value_td{ - text-align:left; - width:100%; + text-align:left; + width:100%; } #dialog > div > div { @@ -410,43 +417,43 @@ tr.even:hover{ } .loading_img { - vertical-align:middle; - display:inline; - overflow:hide; + vertical-align:middle; + display:inline; + overflow:hide; } .top_button { - font-size: 0.8em; + font-size: 0.8em!important; height: 25px; margin: 3px 2px; vertical-align: middle; - /*width: 89px;*/ +/*width: 89px;*/ } .top_button button { - font-size: 0.9em; - height: 25px; - vertical-align: middle; + font-size: 0.9em; + height: 25px; + vertical-align: middle; } .image_button { - font-size: 0.8em; - margin: 3px 2px; - vertical-align: middle; - border:0; + font-size: 0.8em; + margin: 3px 2px; + vertical-align: middle; + border:0; } /* -.multi_action_slct{ - font-size: 0.7em; - vertical-align:middle; - margin:3px 0; - height: 25px; -}*/ + .multi_action_slct{ + font-size: 0.7em; + vertical-align:middle; + margin:3px 0; + height: 25px; + }*/ .ui-icon-refresh{ - position:relative!important; - top:14px!important; + position:relative!important; + top:14px!important; } #vm_log { @@ -508,21 +515,21 @@ tr.even:hover{ ul.action_list{ - /*background: #EDEDED;*/ - border: 1px solid #525252; - background-image: -webkit-gradient( - linear, - left bottom, - left top, - color-stop(0.25, #E9E9E9), - color-stop(0.63, #F5F5F5) - ); - background-image: -moz-linear-gradient( - center bottom, - #E9E9E9 25%, - #F5F5F5 63% - ); - position:absolute; + /*background: #EDEDED;*/ + border: 1px solid #525252; + background-image: -webkit-gradient( + linear, + left bottom, + left top, + color-stop(0.25, #E9E9E9), + color-stop(0.63, #F5F5F5) + ); + background-image: -moz-linear-gradient( + center bottom, + #E9E9E9 25%, + #F5F5F5 63% + ); + position:absolute; z-index:1; list-style-type:none; text-align:left; @@ -549,7 +556,15 @@ ul.action_list li a:hover{ } .progress_bar{ - height:10px; - background: #8F9392; + height:10px; + background: #8F9392; } +.ui-widget{ + font: 10pt Arial, Verdana, Geneva, Helvetica, sans-serif; +} + +.ui-layout-resizer-open-hover, /* hover-color to 'resize' */ +.ui-layout-resizer-dragging { + background: #EEE; +} \ No newline at end of file diff --git a/src/sunstone/public/css/layout.css b/src/sunstone/public/css/layout.css index d713822e56..f5fbf16d98 100644 --- a/src/sunstone/public/css/layout.css +++ b/src/sunstone/public/css/layout.css @@ -44,19 +44,28 @@ body { } #header { - padding:0; + padding: 0 10px 0 10px; background-color: #353735; + border:0; } #footer { - padding:0; + padding-top: 9px; + font-size: 0.8em; + color: white; + text-align: center; background-color: #353735; + border:0; + } -#header { - padding: 0 10px 0 10px; - background-color: #353735; +#footer a { + color: white; + text-decoration: underline; } + + + #logo { padding-top: 6px; font-weight: bold; @@ -87,18 +96,6 @@ body { color: #E69138; } -#footer { - padding-top: 9px; - font-size: 0.8em; - color: white; - text-align: center; -} - -#footer a { - color: white; - text-decoration: underline; -} - #logo-wrapper { float: right; margin-top: 0px; @@ -108,6 +105,7 @@ body { #menu { padding-right: 0; padding-left: 0; + border:0; border-right: 1px solid #353735; background-image: -webkit-gradient( linear, diff --git a/src/sunstone/public/js/layout.js b/src/sunstone/public/js/layout.js index aaf21f9b1c..ab4f193001 100644 --- a/src/sunstone/public/js/layout.js +++ b/src/sunstone/public/js/layout.js @@ -75,7 +75,7 @@ $(document).ready(function () { applyDefaultStyles: false , center__paneSelector: ".outer-center" , west__paneSelector: ".outer-west" - , west__size: 130 + , west__size: 133 , north__size: 26 , south__size: 26 , spacing_open: 0 // ALL panes @@ -101,8 +101,8 @@ $(document).ready(function () { , center__paneSelector: ".inner-center" , south__paneSelector: ".inner-south" , south__size: dialog_height - , spacing_open: 8 // ALL panes - , spacing_closed: 12 // ALL panes + , spacing_open: 5 // ALL panes + , spacing_closed: 5 // ALL panes }); }); diff --git a/src/sunstone/public/vendor/dataTables/NOTICE b/src/sunstone/public/vendor/dataTables/NOTICE index 3297dd4548..cd5f2596c6 100644 --- a/src/sunstone/public/vendor/dataTables/NOTICE +++ b/src/sunstone/public/vendor/dataTables/NOTICE @@ -2,5 +2,5 @@ THIRD-PARTY SOFTWARE * Author: Allan Jardine (www.sprymedia.co.uk) * Info: www.datatables.net - * Copyright: Copyright 2008-2010 Allan Jardine, all rights reserved. + * Copyright: Copyright 2008-2012 Allan Jardine, all rights reserved. * License: BSD License. See BSD-LICENSE.txt diff --git a/src/sunstone/public/vendor/dataTables/demo_table_jui.css b/src/sunstone/public/vendor/dataTables/demo_table_jui.css index b81a1cf99d..84268caa71 100644 --- a/src/sunstone/public/vendor/dataTables/demo_table_jui.css +++ b/src/sunstone/public/vendor/dataTables/demo_table_jui.css @@ -44,7 +44,7 @@ * cursor: hand; } -.ui-buttonset .ui-button { +.dataTables_paginate .ui-button { margin-right: -0.1em !important; } @@ -52,7 +52,7 @@ width: 350px !important; } -.ui-toolbar { +.dataTables_wrapper .ui-toolbar { padding: 5px; } @@ -209,15 +209,23 @@ table.display td.center { */ .sorting_asc { - background: url('../images/sort_asc.jpg') no-repeat center right; + background: url('../images/sort_asc.png') no-repeat center right; } .sorting_desc { - background: url('../images/sort_desc.jpg') no-repeat center right; + background: url('../images/sort_desc.png') no-repeat center right; } .sorting { - background: url('../images/sort_both.jpg') no-repeat center right; + background: url('../images/sort_both.png') no-repeat center right; +} + +.sorting_asc_disabled { + background: url('../images/sort_asc_disabled.png') no-repeat center right; +} + +.sorting_desc_disabled { + background: url('../images/sort_desc_disabled.png') no-repeat center right; } diff --git a/src/sunstone/public/vendor/dataTables/jquery.dataTables.min.js b/src/sunstone/public/vendor/dataTables/jquery.dataTables.min.js index cd6587553c..4280c6d631 100644 --- a/src/sunstone/public/vendor/dataTables/jquery.dataTables.min.js +++ b/src/sunstone/public/vendor/dataTables/jquery.dataTables.min.js @@ -1,10 +1,10 @@ /* * File: jquery.dataTables.min.js - * Version: 1.7.5 + * Version: 1.8.2 * Author: Allan Jardine (www.sprymedia.co.uk) * Info: www.datatables.net * - * Copyright 2008-2010 Allan Jardine, all rights reserved. + * Copyright 2008-2011 Allan Jardine, all rights reserved. * * This source file is free software, under either the GPL v2 license or a * BSD style license, as supplied with this software. @@ -13,130 +13,139 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. */ -(function(j,qa,p){j.fn.dataTableSettings=[];var D=j.fn.dataTableSettings;j.fn.dataTableExt={};var n=j.fn.dataTableExt;n.sVersion="1.7.5";n.sErrMode="alert";n.iApiIndex=0;n.oApi={};n.afnFiltering=[];n.aoFeatures=[];n.ofnSearch={};n.afnSortData=[];n.oStdClasses={sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active", -sPageButtonStaticDisabled:"paginate_button",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripOdd:"odd",sStripEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled", -sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:""};n.oJUIClasses={sPagePrevEnabled:"fg-button ui-button ui-state-default ui-corner-left",sPagePrevDisabled:"fg-button ui-button ui-state-default ui-corner-left ui-state-disabled", -sPageNextEnabled:"fg-button ui-button ui-state-default ui-corner-right",sPageNextDisabled:"fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",sPageJUINext:"ui-icon ui-icon-circle-arrow-e",sPageJUIPrev:"ui-icon ui-icon-circle-arrow-w",sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"fg-button ui-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-button ui-button ui-state-default ui-state-disabled",sPageFirst:"first ui-corner-tl ui-corner-bl", -sPagePrevious:"previous",sPageNext:"next",sPageLast:"last ui-corner-tr ui-corner-br",sStripOdd:"odd",sStripEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"ui-state-default",sSortDesc:"ui-state-default",sSortable:"ui-state-default",sSortableAsc:"ui-state-default", -sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",sSortColumn:"sorting_",sSortJUIAsc:"css_right ui-icon ui-icon-triangle-1-n",sSortJUIDesc:"css_right ui-icon ui-icon-triangle-1-s",sSortJUI:"css_right ui-icon ui-icon-carat-2-n-s",sSortJUIAscAllowed:"css_right ui-icon ui-icon-carat-1-n",sSortJUIDescAllowed:"css_right ui-icon ui-icon-carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead ui-state-default",sScrollHeadInner:"dataTables_scrollHeadInner", -sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot ui-state-default",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:"ui-state-default"};n.oPagination={two_button:{fnInit:function(g,m,r){var s,w,y;if(g.bJUI){s=p.createElement("a");w=p.createElement("a");y=p.createElement("span");y.className=g.oClasses.sPageJUINext;w.appendChild(y);y=p.createElement("span");y.className=g.oClasses.sPageJUIPrev;s.appendChild(y)}else{s=p.createElement("div");w=p.createElement("div")}s.className= -g.oClasses.sPagePrevDisabled;w.className=g.oClasses.sPageNextDisabled;s.title=g.oLanguage.oPaginate.sPrevious;w.title=g.oLanguage.oPaginate.sNext;m.appendChild(s);m.appendChild(w);j(s).click(function(){g.oApi._fnPageChange(g,"previous")&&r(g)});j(w).click(function(){g.oApi._fnPageChange(g,"next")&&r(g)});j(s).bind("selectstart",function(){return false});j(w).bind("selectstart",function(){return false});if(g.sTableId!==""&&typeof g.aanFeatures.p=="undefined"){m.setAttribute("id",g.sTableId+"_paginate"); -s.setAttribute("id",g.sTableId+"_previous");w.setAttribute("id",g.sTableId+"_next")}},fnUpdate:function(g){if(g.aanFeatures.p)for(var m=g.aanFeatures.p,r=0,s=m.length;r=w-s){s=w-r+1;x=w}else{s=y-Math.ceil(r/2)+1;x=s+r-1}for(r=s;r<= -x;r++)F+=y!=r?''+r+"":''+r+"";x=g.aanFeatures.p;var z,U=function(){g._iDisplayStart=(this.innerHTML*1-1)*g._iDisplayLength;m(g);return false},C=function(){return false};r=0;for(s=x.length;rm?1:0},"string-desc":function(g,m){g=g.toLowerCase();m=m.toLowerCase();return gm?-1:0},"html-asc":function(g,m){g=g.replace(/<.*?>/g,"").toLowerCase();m=m.replace(/<.*?>/g,"").toLowerCase();return gm?1:0},"html-desc":function(g,m){g=g.replace(/<.*?>/g,"").toLowerCase();m=m.replace(/<.*?>/g,"").toLowerCase();return gm?-1:0},"date-asc":function(g,m){g=Date.parse(g);m=Date.parse(m);if(isNaN(g)||g==="")g=Date.parse("01/01/1970 00:00:00");if(isNaN(m)|| -m==="")m=Date.parse("01/01/1970 00:00:00");return g-m},"date-desc":function(g,m){g=Date.parse(g);m=Date.parse(m);if(isNaN(g)||g==="")g=Date.parse("01/01/1970 00:00:00");if(isNaN(m)||m==="")m=Date.parse("01/01/1970 00:00:00");return m-g},"numeric-asc":function(g,m){return(g=="-"||g===""?0:g*1)-(m=="-"||m===""?0:m*1)},"numeric-desc":function(g,m){return(m=="-"||m===""?0:m*1)-(g=="-"||g===""?0:g*1)}};n.aTypes=[function(g){if(g.length===0)return"numeric";var m,r=false;m=g.charAt(0);if("0123456789-".indexOf(m)== --1)return null;for(var s=1;s")!=-1)return"html";return null}];n.fnVersionCheck=function(g){var m=function(x,v){for(;x.length=parseInt(w,10)};n._oExternConfig={iNextUnique:0};j.fn.dataTable=function(g){function m(){this.fnRecordsTotal=function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,10):this.aiDisplayMaster.length};this.fnRecordsDisplay=function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay,10):this.aiDisplay.length};this.fnDisplayEnd=function(){return this.oFeatures.bServerSide?this.oFeatures.bPaginate===false||this._iDisplayLength==-1? -this._iDisplayStart+this.aiDisplay.length:Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd};this.sInstance=this.oInstance=null;this.oFeatures={bPaginate:true,bLengthChange:true,bFilter:true,bSort:true,bInfo:true,bAutoWidth:true,bProcessing:false,bSortClasses:true,bStateSave:false,bServerSide:false};this.oScroll={sX:"",sXInner:"",sY:"",bCollapse:false,bInfinite:false,iLoadGap:100,iBarWidth:0,bAutoCss:true};this.aanFeatures=[];this.oLanguage={sProcessing:"Processing...", -sLengthMenu:"Show _MENU_ entries",sZeroRecords:"No matching records found",sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sSearch:"Search:",sUrl:"",oPaginate:{sFirst:"First",sPrevious:"Previous",sNext:"Next",sLast:"Last"},fnInfoCallback:null};this.aoData=[];this.aiDisplay=[];this.aiDisplayMaster=[];this.aoColumns=[];this.iNextId=0;this.asDataSearch= -[];this.oPreviousSearch={sSearch:"",bRegex:false,bSmart:true};this.aoPreSearchCols=[];this.aaSorting=[[0,"asc",0]];this.aaSortingFixed=null;this.asStripClasses=[];this.asDestoryStrips=[];this.sDestroyWidth=0;this.fnFooterCallback=this.fnHeaderCallback=this.fnRowCallback=null;this.aoDrawCallback=[];this.fnInitComplete=null;this.sTableId="";this.nTableWrapper=this.nTBody=this.nTFoot=this.nTHead=this.nTable=null;this.bInitialised=false;this.aoOpenRows=[];this.sDom="lfrtip";this.sPaginationType="two_button"; -this.iCookieDuration=7200;this.sCookiePrefix="SpryMedia_DataTables_";this.fnCookieCallback=null;this.aoStateSave=[];this.aoStateLoad=[];this.sAjaxSource=this.oLoadedState=null;this.bAjaxDataGet=true;this.fnServerData=function(a,b,c){j.ajax({url:a,data:b,success:c,dataType:"json",cache:false,error:function(d,f){f=="parsererror"&&alert("DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})};this.fnFormatNumber=function(a){if(a<1E3)return a;else{var b= -a+"";a=b.split("");var c="";b=b.length;for(var d=0;d=a.fnRecordsDisplay()?0:a.iInitDisplayStart;a.iInitDisplayStart=-1;E(a)}if(!(!a.bDestroying&&a.oFeatures.bServerSide&&!sa(a))){a.oFeatures.bServerSide||a.iDraw++;if(a.aiDisplay.length!==0){var i=a._iDisplayStart,h=a._iDisplayEnd;if(a.oFeatures.bServerSide){i=0;h=a.aoData.length}for(i= -i;itr",a.nTHead)[0],V(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay); -typeof a.fnFooterCallback=="function"&&a.fnFooterCallback.call(a.oInstance,j(">tr",a.nTFoot)[0],V(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay);f=p.createDocumentFragment();b=p.createDocumentFragment();if(a.nTBody){e=a.nTBody.parentNode;b.appendChild(a.nTBody);if(!a.oScroll.bInfinite||!a._bInitComplete||a.bSorted||a.bFiltered){c=a.nTBody.childNodes;for(b=c.length-1;b>=0;b--)c[b].parentNode.removeChild(c[b])}b=0;for(c=d.length;b=0;b--)a.aoDrawCallback[b].fn.call(a.oInstance,a);a.bSorted=false;a.bFiltered=false;a.bDrawing=false;if(a.oFeatures.bServerSide){K(a,false);typeof a._bInitComplete=="undefined"&&w(a)}}}function W(a){if(a.oFeatures.bSort)O(a,a.oPreviousSearch);else if(a.oFeatures.bFilter)P(a,a.oPreviousSearch);else{E(a);C(a)}}function sa(a){if(a.bAjaxDataGet){K(a,true);var b=a.aoColumns.length,c=[],d;a.iDraw++;c.push({name:"sEcho",value:a.iDraw});c.push({name:"iColumns",value:b});c.push({name:"sColumns", -value:ca(a)});c.push({name:"iDisplayStart",value:a._iDisplayStart});c.push({name:"iDisplayLength",value:a.oFeatures.bPaginate!==false?a._iDisplayLength:-1});if(a.oFeatures.bFilter!==false){c.push({name:"sSearch",value:a.oPreviousSearch.sSearch});c.push({name:"bRegex",value:a.oPreviousSearch.bRegex});for(d=0;d")c=c.parentNode; -else if(i=="l"&&a.oFeatures.bPaginate&&a.oFeatures.bLengthChange){f=va(a);e=1}else if(i=="f"&&a.oFeatures.bFilter){f=wa(a);e=1}else if(i=="r"&&a.oFeatures.bProcessing){f=xa(a);e=1}else if(i=="t"){f=ya(a);e=1}else if(i=="i"&&a.oFeatures.bInfo){f=za(a);e=1}else if(i=="p"&&a.oFeatures.bPaginate){f=Aa(a);e=1}else if(n.aoFeatures.length!==0){h=n.aoFeatures;q=0;for(k=h.length;qcaption",a.nTable);i=0;for(k=d.length;ij(a.nTable).height()-a.oScroll.iLoadGap)if(a.fnDisplayEnd()0&&a.nTable.removeChild(i[0]);if(a.nTFoot!==null){k=a.nTable.getElementsByTagName("tfoot");k.length>0&&a.nTable.removeChild(k[0])}i=a.nTHead.cloneNode(true);a.nTable.insertBefore(i,a.nTable.childNodes[0]);if(a.nTFoot!==null){k=a.nTFoot.cloneNode(true);a.nTable.insertBefore(k,a.nTable.childNodes[1])}var J=fa(i);f=0;for(e=J.length;ff-a.oScroll.iBarWidth)a.nTable.style.width=u(f)}else a.nTable.style.width= -u(f);f=j(a.nTable).outerWidth();e=a.nTHead.getElementsByTagName("tr");i=i.getElementsByTagName("tr");L(function(B,I){l=B.style;l.paddingTop="0";l.paddingBottom="0";l.borderTopWidth="0";l.borderBottomWidth="0";l.height=0;t=j(B).width();I.style.width=u(t);G.push(t)},i,e);j(i).height(0);if(a.nTFoot!==null){h=k.getElementsByTagName("tr");k=a.nTFoot.getElementsByTagName("tr");L(function(B,I){l=B.style;l.paddingTop="0";l.paddingBottom="0";l.borderTopWidth="0";l.borderBottomWidth="0";t=j(B).width();I.style.width= -u(t);G.push(t)},h,k);j(h).height(0)}L(function(B){B.innerHTML="";B.style.width=u(G.shift())},i);a.nTFoot!==null&&L(function(B){B.innerHTML="";B.style.width=u(G.shift())},h);if(j(a.nTable).outerWidth()d.offsetWidth?a.oScroll.iBarWidth:0;if(a.nTable.offsetHeight';var c=j("input",b);c.val(a.oPreviousSearch.sSearch.replace('"',"""));c.keyup(function(){for(var d=a.aanFeatures.f,f=0,e=d.length;f=0;d--){f=ja(a.aoData[a.aiDisplay[d]]._aData[c],a.aoColumns[c].sType);if(!b.test(f)){a.aiDisplay.splice(d,1);e++}}}}function Ca(a,b,c,d,f){var e=ia(b,d,f);if(typeof c=="undefined"||c===null)c=0;if(n.afnFiltering.length!==0)c=1;if(b.length<=0){a.aiDisplay.splice(0,a.aiDisplay.length);a.aiDisplay=a.aiDisplayMaster.slice()}else if(a.aiDisplay.length==a.aiDisplayMaster.length||a.oPreviousSearch.sSearch.length>b.length||c==1||b.indexOf(a.oPreviousSearch.sSearch)!== -0){a.aiDisplay.splice(0,a.aiDisplay.length);ha(a,1);for(c=0;c/g,"");else if(typeof a=="string")return a.replace(/\n/g," ");return a}function O(a,b){var c,d,f,e,i,h,k=[],l=[],q=n.oSort,t=a.aoData,G=a.aoColumns;if(!a.oFeatures.bServerSide&&(a.aaSorting.length!==0||a.aaSortingFixed!==null)){k=a.aaSortingFixed!==null?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(f=0;f=i)for(b=0;b=0?a._iDisplayStart-a._iDisplayLength:0;if(a._iDisplayStart<0)a._iDisplayStart=0}else if(b=="next")if(a._iDisplayLength>=0){if(a._iDisplayStart+a._iDisplayLength=0){b=parseInt((a.fnRecordsDisplay()-1)/a._iDisplayLength,10)+1;a._iDisplayStart=(b-1)*a._iDisplayLength}else a._iDisplayStart=0;else H(a,0,"Unknown paging action: "+b);return c!=a._iDisplayStart}function za(a){var b=p.createElement("div");b.className=a.oClasses.sInfo;if(typeof a.aanFeatures.i=="undefined"){a.aoDrawCallback.push({fn:Fa,sName:"information"});a.sTableId!==""&&b.setAttribute("id",a.sTableId+"_info")}return b} -function Fa(a){if(!(!a.oFeatures.bInfo||a.aanFeatures.i.length===0)){var b=a._iDisplayStart+1,c=a.fnDisplayEnd(),d=a.fnRecordsTotal(),f=a.fnRecordsDisplay(),e=a.fnFormatNumber(b),i=a.fnFormatNumber(c),h=a.fnFormatNumber(d),k=a.fnFormatNumber(f);if(a.oScroll.bInfinite)e=a.fnFormatNumber(1);e=a.fnRecordsDisplay()===0&&a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfoEmpty+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()===0?a.oLanguage.sInfoEmpty+" "+a.oLanguage.sInfoFiltered.replace("_MAX_", -h)+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfo.replace("_START_",e).replace("_END_",i).replace("_TOTAL_",k)+a.oLanguage.sInfoPostFix:a.oLanguage.sInfo.replace("_START_",e).replace("_END_",i).replace("_TOTAL_",k)+" "+a.oLanguage.sInfoFiltered.replace("_MAX_",a.fnFormatNumber(a.fnRecordsTotal()))+a.oLanguage.sInfoPostFix;if(a.oLanguage.fnInfoCallback!==null)e=a.oLanguage.fnInfoCallback(a,b,c,d,f,e);a=a.aanFeatures.i;b=0;for(c=a.length;b",c,d;if(a.aLengthMenu.length==2&&typeof a.aLengthMenu[0]=="object"&&typeof a.aLengthMenu[1]=="object"){c=0;for(d=a.aLengthMenu[0].length;c'+a.aLengthMenu[1][c]+""}else{c=0;for(d=a.aLengthMenu.length;c'+a.aLengthMenu[c]+""}b+="";var f=p.createElement("div"); -a.sTableId!==""&&typeof a.aanFeatures.l=="undefined"&&f.setAttribute("id",a.sTableId+"_length");f.className=a.oClasses.sLength;f.innerHTML=a.oLanguage.sLengthMenu.replace("_MENU_",b);j('select option[value="'+a._iDisplayLength+'"]',f).attr("selected",true);j("select",f).change(function(){var e=j(this).val(),i=a.aanFeatures.l;c=0;for(d=i.length;ca.aiDisplay.length||a._iDisplayLength==-1?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength}function Ga(a,b){if(!a||a===null||a==="")return 0;if(typeof b=="undefined")b=p.getElementsByTagName("body")[0];var c=p.createElement("div");c.style.width=a;b.appendChild(c);a=c.offsetWidth; -b.removeChild(c);return a}function $(a){var b=0,c,d=0,f=a.aoColumns.length,e,i=j("th",a.nTHead);for(e=0;etd",b);e.each(function(h){this.style.width="";h=ga(a,h);if(h!==null&&a.aoColumns[h].sWidthOrig!=="")this.style.width=a.aoColumns[h].sWidthOrig});for(e=0;etd",b);if(f.length===0)f=j("thead tr:eq(0)>th",b);for(e=c=0;e -0)a.aoColumns[e].sWidth=u(d);c++}a.nTable.style.width=u(j(b).outerWidth());b.parentNode.removeChild(b)}}function Ia(a,b){if(a.oScroll.sX===""&&a.oScroll.sY!==""){j(b).width();b.style.width=u(j(b).outerWidth()-a.oScroll.iBarWidth)}else if(a.oScroll.sX!=="")b.style.width=u(j(b).outerWidth())}function Ha(a,b,c){if(typeof c=="undefined"||c){c=Ja(a,b);b=M(a,b);if(c<0)return null;return a.aoData[c].nTr.getElementsByTagName("td")[b]}var d=-1,f,e;c=-1;var i=p.createElement("div");i.style.visibility="hidden"; -i.style.position="absolute";p.body.appendChild(i);f=0;for(e=a.aoData.length;fd){d=i.offsetWidth;c=f}}p.body.removeChild(i);if(c>=0){b=M(a,b);if(a=a.aoData[c].nTr.getElementsByTagName("td")[b])return a}return null}function Ja(a,b){for(var c=-1,d=-1,f=0;fc){c=e.length;d=f}}return d}function u(a){if(a===null)return"0px";if(typeof a=="number"){if(a<0)return"0px";return a+"px"}var b= -a.charCodeAt(a.length-1);if(b<48||b>57)return a;return a+"px"}function Oa(a,b){if(a.length!=b.length)return 1;for(var c=0;cb&&a[d]--;c!=-1&&a.splice(c,1)}function ua(a,b){b=b.split(",");for(var c=[],d=0,f=a.aoColumns.length;d4096){a=p.cookie.split(";");for(var h=0,k=a.length;h=d.aiDisplay.length){d._iDisplayStart-=d._iDisplayLength;if(d._iDisplayStart<0)d._iDisplayStart=0}if(typeof c=="undefined"||c){E(d);C(d)}return f};this.fnClearTable=function(a){var b=A(this[n.iApiIndex]);da(b);if(typeof a=="undefined"||a)C(b)};this.fnOpen=function(a,b,c){var d=A(this[n.iApiIndex]);this.fnClose(a);var f= -p.createElement("tr"),e=p.createElement("td");f.appendChild(e);e.className=c;e.colSpan=S(d);e.innerHTML=b;b=j("tr",d.nTBody);j.inArray(a,b)!=-1&&j(f).insertAfter(a);d.aoOpenRows.push({nTr:f,nParent:a});return f};this.fnClose=function(a){for(var b=A(this[n.iApiIndex]),c=0;ctr",d.nTHead)[0];i=j(">tr",d.nTFoot)[0];q=[];h=[];for(f=0;f=S(d)){l.appendChild(q[a]);l=j(">tr",d.nTHead);f=1;for(e=l.length;ftr",d.nTFoot);f=1;for(e=l.length;ftr",d.nTHead);f=1;for(e=l.length;ftr",d.nTFoot);f=1;for(e=l.length;ftd:eq("+k+")",d.aoData[f].nTr)[0])}}d.aoColumns[a].bVisible=true}else{l.removeChild(q[a]);f=0;for(e=d.aoColumns[a].anThExtra.length;ftr>td."+a.oClasses.sRowEmpty,a.nTable).parent().remove();if(a.nTable!=a.nTHead.parentNode){j(">thead",a.nTable).remove();a.nTable.appendChild(a.nTHead)}if(a.nTFoot&&a.nTable!=a.nTFoot.parentNode){j(">tfoot",a.nTable).remove();a.nTable.appendChild(a.nTFoot)}a.nTable.parentNode.removeChild(a.nTable);j(a.nTableWrapper).remove();a.aaSorting=[];a.aaSortingFixed=[];T(a);j(R(a)).removeClass(a.asStripClasses.join(" "));if(a.bJUI){j("th",a.nTHead).removeClass([n.oStdClasses.sSortable,n.oJUIClasses.sSortableAsc, -n.oJUIClasses.sSortableDesc,n.oJUIClasses.sSortableNone].join(" "));j("th span",a.nTHead).remove()}else j("th",a.nTHead).removeClass([n.oStdClasses.sSortable,n.oStdClasses.sSortableAsc,n.oStdClasses.sSortableDesc,n.oStdClasses.sSortableNone].join(" "));b.appendChild(a.nTable);d=0;for(f=a.aoData.length;dtr:even",c).addClass(a.asDestoryStrips[0]);j(">tr:odd",c).addClass(a.asDestoryStrips[1]);d=0;for(f=D.length;dt<"F"ip>'}if(e.oScroll.sX!==""||e.oScroll.sY!=="")e.oScroll.iBarWidth=Ma();if(typeof g.iDisplayStart!="undefined"&&typeof e.iInitDisplayStart=="undefined"){e.iInitDisplayStart=g.iDisplayStart;e._iDisplayStart=g.iDisplayStart}if(typeof g.bStateSave!="undefined"){e.oFeatures.bStateSave=g.bStateSave;La(e,g);e.aoDrawCallback.push({fn:na,sName:"state_save"})}if(typeof g.aaData!="undefined")h= -true;if(typeof g!="undefined"&&typeof g.aoData!="undefined")g.aoColumns=g.aoData;if(typeof g.oLanguage!="undefined")if(typeof g.oLanguage.sUrl!="undefined"&&g.oLanguage.sUrl!==""){e.oLanguage.sUrl=g.oLanguage.sUrl;j.getJSON(e.oLanguage.sUrl,null,function(q){y(e,q,true)});i=true}else y(e,g.oLanguage,false)}else g={};if(typeof g.asStripClasses=="undefined"){e.asStripClasses.push(e.oClasses.sStripOdd);e.asStripClasses.push(e.oClasses.sStripEven)}c=false;d=j("tbody>tr",this);a=0;for(b=e.asStripClasses.length;a< -b;a++)if(d.filter(":lt(2)").hasClass(e.asStripClasses[a])){c=true;break}if(c){e.asDestoryStrips=["",""];if(j(d[0]).hasClass(e.oClasses.sStripOdd))e.asDestoryStrips[0]+=e.oClasses.sStripOdd+" ";if(j(d[0]).hasClass(e.oClasses.sStripEven))e.asDestoryStrips[0]+=e.oClasses.sStripEven;if(j(d[1]).hasClass(e.oClasses.sStripOdd))e.asDestoryStrips[1]+=e.oClasses.sStripOdd+" ";if(j(d[1]).hasClass(e.oClasses.sStripEven))e.asDestoryStrips[1]+=e.oClasses.sStripEven;d.removeClass(e.asStripClasses.join(" "))}a=this.getElementsByTagName("thead"); -c=a.length===0?[]:fa(a[0]);var k;if(typeof g.aoColumns=="undefined"){k=[];a=0;for(b=c.length;a=0;a--){var l=g.aoColumnDefs[a].aTargets;j.isArray(l)||H(e,1,"aTargets must be an array of targets, not a "+typeof l); -c=0;for(d=l.length;c=0){for(;e.aoColumns.length<=l[c];)F(e);x(e,l[c],g.aoColumnDefs[a])}else if(typeof l[c]=="number"&&l[c]<0)x(e,e.aoColumns.length+l[c],g.aoColumnDefs[a]);else if(typeof l[c]=="string"){b=0;for(f=e.aoColumns.length;b=e.aoColumns.length)e.aaSorting[a][0]= -0;k=e.aoColumns[e.aaSorting[a][0]];if(typeof e.aaSorting[a][2]=="undefined")e.aaSorting[a][2]=0;if(typeof g.aaSorting=="undefined"&&typeof e.saved_aaSorting=="undefined")e.aaSorting[a][1]=k.asSorting[0];c=0;for(d=k.asSorting.length;c0)e.nTFoot=this.getElementsByTagName("tfoot")[0];if(h)for(a=0;a=w-t){t=w-s+1;x=w}else{t=y-Math.ceil(s/2)+1;x=t+s-1}for(s=t;s<=x;s++)F+=y!=s?''+s+"":''+s+"";x=g.aanFeatures.p;var z,$=function(M){g._iDisplayStart=(this.innerHTML*1-1)*g._iDisplayLength;l(g);M.preventDefault()},X=function(){return false};s=0;for(t=x.length;sl?1:0},"string-desc":function(g,l){if(typeof g!="string")g="";if(typeof l!="string")l="";g=g.toLowerCase();l=l.toLowerCase();return gl?-1:0},"html-asc":function(g,l){g=g.replace(/<.*?>/g,"").toLowerCase();l=l.replace(/<.*?>/g,"").toLowerCase();return g< +l?-1:g>l?1:0},"html-desc":function(g,l){g=g.replace(/<.*?>/g,"").toLowerCase();l=l.replace(/<.*?>/g,"").toLowerCase();return gl?-1:0},"date-asc":function(g,l){g=Date.parse(g);l=Date.parse(l);if(isNaN(g)||g==="")g=Date.parse("01/01/1970 00:00:00");if(isNaN(l)||l==="")l=Date.parse("01/01/1970 00:00:00");return g-l},"date-desc":function(g,l){g=Date.parse(g);l=Date.parse(l);if(isNaN(g)||g==="")g=Date.parse("01/01/1970 00:00:00");if(isNaN(l)||l==="")l=Date.parse("01/01/1970 00:00:00");return l- +g},"numeric-asc":function(g,l){return(g=="-"||g===""?0:g*1)-(l=="-"||l===""?0:l*1)},"numeric-desc":function(g,l){return(l=="-"||l===""?0:l*1)-(g=="-"||g===""?0:g*1)}};n.aTypes=[function(g){if(typeof g=="number")return"numeric";else if(typeof g!="string")return null;var l,s=false;l=g.charAt(0);if("0123456789-".indexOf(l)==-1)return null;for(var t=1;t")!=-1)return"html";return null}];n.fnVersionCheck=function(g){var l=function(x,v){for(;x.length=parseInt(w,10)};n._oExternConfig={iNextUnique:0};i.fn.dataTable=function(g){function l(){this.fnRecordsTotal= +function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,10):this.aiDisplayMaster.length};this.fnRecordsDisplay=function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay,10):this.aiDisplay.length};this.fnDisplayEnd=function(){return this.oFeatures.bServerSide?this.oFeatures.bPaginate===false||this._iDisplayLength==-1?this._iDisplayStart+this.aiDisplay.length:Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd};this.sInstance= +this.oInstance=null;this.oFeatures={bPaginate:true,bLengthChange:true,bFilter:true,bSort:true,bInfo:true,bAutoWidth:true,bProcessing:false,bSortClasses:true,bStateSave:false,bServerSide:false,bDeferRender:false};this.oScroll={sX:"",sXInner:"",sY:"",bCollapse:false,bInfinite:false,iLoadGap:100,iBarWidth:0,bAutoCss:true};this.aanFeatures=[];this.oLanguage={sProcessing:"Processing...",sLengthMenu:"Show _MENU_ entries",sZeroRecords:"No matching records found",sEmptyTable:"No data available in table", +sLoadingRecords:"Loading...",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sInfoThousands:",",sSearch:"Search:",sUrl:"",oPaginate:{sFirst:"First",sPrevious:"Previous",sNext:"Next",sLast:"Last"},fnInfoCallback:null};this.aoData=[];this.aiDisplay=[];this.aiDisplayMaster=[];this.aoColumns=[];this.aoHeader=[];this.aoFooter=[];this.iNextId=0;this.asDataSearch=[];this.oPreviousSearch={sSearch:"", +bRegex:false,bSmart:true};this.aoPreSearchCols=[];this.aaSorting=[[0,"asc",0]];this.aaSortingFixed=null;this.asStripeClasses=[];this.asDestroyStripes=[];this.sDestroyWidth=0;this.fnFooterCallback=this.fnHeaderCallback=this.fnRowCallback=null;this.aoDrawCallback=[];this.fnInitComplete=this.fnPreDrawCallback=null;this.sTableId="";this.nTableWrapper=this.nTBody=this.nTFoot=this.nTHead=this.nTable=null;this.bInitialised=this.bDeferLoading=false;this.aoOpenRows=[];this.sDom="lfrtip";this.sPaginationType= +"two_button";this.iCookieDuration=7200;this.sCookiePrefix="SpryMedia_DataTables_";this.fnCookieCallback=null;this.aoStateSave=[];this.aoStateLoad=[];this.sAjaxSource=this.oLoadedState=null;this.sAjaxDataProp="aaData";this.bAjaxDataGet=true;this.jqXHR=null;this.fnServerData=function(a,b,c,d){d.jqXHR=i.ajax({url:a,data:b,success:function(f){i(d.oInstance).trigger("xhr",d);c(f)},dataType:"json",cache:false,error:function(f,e){e=="parsererror"&&alert("DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})}; +this.aoServerParams=[];this.fnFormatNumber=function(a){if(a<1E3)return a;else{var b=a+"";a=b.split("");var c="";b=b.length;for(var d=0;d=0;e--)!a.aoColumns[e].bVisible&&!c&&h[d].splice(e,1);j.push([])}d=0;for(f=h.length;d=a.fnRecordsDisplay()?0:a.iInitDisplayStart;a.iInitDisplayStart=-1;E(a)}if(a.bDeferLoading){a.bDeferLoading=false;a.iDraw++}else if(a.oFeatures.bServerSide){if(!a.bDestroying&&!Ca(a))return}else a.iDraw++;if(a.aiDisplay.length!==0){var h=a._iDisplayStart,j=a._iDisplayEnd;if(a.oFeatures.bServerSide){h=0;j=a.aoData.length}for(h= +h;h=0;b--)c[b].parentNode.removeChild(c[b])}b=0;for(c=d.length;b=0;b--)a.aoDrawCallback[b].fn.call(a.oInstance,a);i(a.oInstance).trigger("draw",a);a.bSorted=false;a.bFiltered=false;a.bDrawing=false;if(a.oFeatures.bServerSide){K(a,false);typeof a._bInitComplete=="undefined"&&w(a)}}}function da(a){if(a.oFeatures.bSort)R(a,a.oPreviousSearch);else if(a.oFeatures.bFilter)N(a, +a.oPreviousSearch);else{E(a);C(a)}}function Ca(a){if(a.bAjaxDataGet){a.iDraw++;K(a,true);var b=Da(a);ha(a,b);a.fnServerData.call(a.oInstance,a.sAjaxSource,b,function(c){Ea(a,c)},a);return false}else return true}function Da(a){var b=a.aoColumns.length,c=[],d,f;c.push({name:"sEcho",value:a.iDraw});c.push({name:"iColumns",value:b});c.push({name:"sColumns",value:ka(a)});c.push({name:"iDisplayStart",value:a._iDisplayStart});c.push({name:"iDisplayLength",value:a.oFeatures.bPaginate!==false?a._iDisplayLength: +-1});for(f=0;f")c=c.parentNode;else if(h=="l"&&a.oFeatures.bPaginate&&a.oFeatures.bLengthChange){f=Ga(a);e=1}else if(h=="f"&&a.oFeatures.bFilter){f=Ha(a);e=1}else if(h=="r"&&a.oFeatures.bProcessing){f=Ia(a);e=1}else if(h=="t"){f=Ja(a);e=1}else if(h=="i"&&a.oFeatures.bInfo){f=Ka(a);e=1}else if(h=="p"&&a.oFeatures.bPaginate){f=La(a);e=1}else if(n.aoFeatures.length!==0){j=n.aoFeatures;u=0;for(k=j.length;ui(a.nTable).height()-a.oScroll.iLoadGap)if(a.fnDisplayEnd()0&&a.nTable.removeChild(h[0]);if(a.nTFoot!==null){k=a.nTable.getElementsByTagName("tfoot");k.length>0&&a.nTable.removeChild(k[0])}h=a.nTHead.cloneNode(true);a.nTable.insertBefore(h,a.nTable.childNodes[0]);if(a.nTFoot!==null){k=a.nTFoot.cloneNode(true); +a.nTable.insertBefore(k,a.nTable.childNodes[1])}if(a.oScroll.sX===""){d.style.width="100%";b.parentNode.style.width="100%"}var U=S(a,h);f=0;for(e=U.length;fd.offsetHeight||i(d).css("overflow-y")=="scroll"))a.nTable.style.width=q(i(a.nTable).outerWidth()-a.oScroll.iBarWidth)}else if(a.oScroll.sXInner!== +"")a.nTable.style.width=q(a.oScroll.sXInner);else if(f==i(d).width()&&i(d).height()f-a.oScroll.iBarWidth)a.nTable.style.width=q(f)}else a.nTable.style.width=q(f);f=i(a.nTable).outerWidth();e=a.nTHead.getElementsByTagName("tr");h=h.getElementsByTagName("tr");P(function(I,na){m=I.style;m.paddingTop="0";m.paddingBottom="0";m.borderTopWidth="0";m.borderBottomWidth="0";m.height=0;r=i(I).width();na.style.width= +q(r);H.push(r)},h,e);i(h).height(0);if(a.nTFoot!==null){j=k.getElementsByTagName("tr");k=a.nTFoot.getElementsByTagName("tr");P(function(I,na){m=I.style;m.paddingTop="0";m.paddingBottom="0";m.borderTopWidth="0";m.borderBottomWidth="0";m.height=0;r=i(I).width();na.style.width=q(r);H.push(r)},j,k);i(j).height(0)}P(function(I){I.innerHTML="";I.style.width=q(H.shift())},h);a.nTFoot!==null&&P(function(I){I.innerHTML="";I.style.width=q(H.shift())},j);if(i(a.nTable).outerWidth()d.offsetHeight|| +i(d).css("overflow-y")=="scroll"?f+a.oScroll.iBarWidth:f;if(B&&(d.scrollHeight>d.offsetHeight||i(d).css("overflow-y")=="scroll"))a.nTable.style.width=q(j-a.oScroll.iBarWidth);d.style.width=q(j);b.parentNode.style.width=q(j);if(a.nTFoot!==null)L.parentNode.style.width=q(j);if(a.oScroll.sX==="")J(a,1,"The table cannot fit into the current element which will cause column misalignment. The table has been drawn at its minimum possible width.");else a.oScroll.sXInner!==""&&J(a,1,"The table cannot fit into the current element which will cause column misalignment. Increase the sScrollXInner value or remove it to allow automatic calculation")}else{d.style.width= +q("100%");b.parentNode.style.width=q("100%");if(a.nTFoot!==null)L.parentNode.style.width=q("100%")}if(a.oScroll.sY==="")if(B)d.style.height=q(a.nTable.offsetHeight+a.oScroll.iBarWidth);if(a.oScroll.sY!==""&&a.oScroll.bCollapse){d.style.height=q(a.oScroll.sY);B=a.oScroll.sX!==""&&a.nTable.offsetWidth>d.offsetWidth?a.oScroll.iBarWidth:0;if(a.nTable.offsetHeight'):b===""?'':b+' ';var c=p.createElement("div"); +c.className=a.oClasses.sFilter;c.innerHTML="";a.sTableId!==""&&typeof a.aanFeatures.f=="undefined"&&c.setAttribute("id",a.sTableId+"_filter");b=i("input",c);b.val(a.oPreviousSearch.sSearch.replace('"',"""));b.bind("keyup.DT",function(){for(var d=a.aanFeatures.f,f=0,e=d.length;f=0;d--){f=qa(G(a,a.aiDisplay[d],c,"filter"),a.aoColumns[c].sType);if(!b.test(f)){a.aiDisplay.splice(d,1);e++}}}}function Oa(a,b,c,d,f){var e=pa(b,d,f);if(typeof c=="undefined"||c===null)c=0;if(n.afnFiltering.length!==0)c=1;if(b.length<=0){a.aiDisplay.splice(0,a.aiDisplay.length);a.aiDisplay=a.aiDisplayMaster.slice()}else if(a.aiDisplay.length==a.aiDisplayMaster.length|| +a.oPreviousSearch.sSearch.length>b.length||c==1||b.indexOf(a.oPreviousSearch.sSearch)!==0){a.aiDisplay.splice(0,a.aiDisplay.length);oa(a,1);for(c=0;c/g,"");else if(typeof a=="string")return a.replace(/\n/g," ");else if(a===null)return"";return a}function R(a,b){var c,d,f,e,h=[],j=[],k=n.oSort;d=a.aoData;var m=a.aoColumns;if(!a.oFeatures.bServerSide&& +(a.aaSorting.length!==0||a.aaSortingFixed!==null)){h=a.aaSortingFixed!==null?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(c=0;c=h)for(b=0;b=0?a._iDisplayStart-a._iDisplayLength:0;if(a._iDisplayStart<0)a._iDisplayStart=0}else if(b=="next")if(a._iDisplayLength>=0){if(a._iDisplayStart+a._iDisplayLength=0){b=parseInt((a.fnRecordsDisplay()- +1)/a._iDisplayLength,10)+1;a._iDisplayStart=(b-1)*a._iDisplayLength}else a._iDisplayStart=0;else J(a,0,"Unknown paging action: "+b);i(a.oInstance).trigger("page",a);return c!=a._iDisplayStart}function Ka(a){var b=p.createElement("div");b.className=a.oClasses.sInfo;if(typeof a.aanFeatures.i=="undefined"){a.aoDrawCallback.push({fn:Ra,sName:"information"});a.sTableId!==""&&b.setAttribute("id",a.sTableId+"_info")}return b}function Ra(a){if(!(!a.oFeatures.bInfo||a.aanFeatures.i.length===0)){var b=a._iDisplayStart+ +1,c=a.fnDisplayEnd(),d=a.fnRecordsTotal(),f=a.fnRecordsDisplay(),e=a.fnFormatNumber(b),h=a.fnFormatNumber(c),j=a.fnFormatNumber(d),k=a.fnFormatNumber(f);if(a.oScroll.bInfinite)e=a.fnFormatNumber(1);e=a.fnRecordsDisplay()===0&&a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfoEmpty+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()===0?a.oLanguage.sInfoEmpty+" "+a.oLanguage.sInfoFiltered.replace("_MAX_",j)+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfo.replace("_START_", +e).replace("_END_",h).replace("_TOTAL_",k)+a.oLanguage.sInfoPostFix:a.oLanguage.sInfo.replace("_START_",e).replace("_END_",h).replace("_TOTAL_",k)+" "+a.oLanguage.sInfoFiltered.replace("_MAX_",a.fnFormatNumber(a.fnRecordsTotal()))+a.oLanguage.sInfoPostFix;if(a.oLanguage.fnInfoCallback!==null)e=a.oLanguage.fnInfoCallback(a,b,c,d,f,e);a=a.aanFeatures.i;b=0;for(c=a.length;b",c,d;if(a.aLengthMenu.length==2&&typeof a.aLengthMenu[0]=="object"&&typeof a.aLengthMenu[1]=="object"){c=0;for(d=a.aLengthMenu[0].length;c'+a.aLengthMenu[1][c]+""}else{c=0;for(d=a.aLengthMenu.length;c'+a.aLengthMenu[c]+""}b+="";var f=p.createElement("div");a.sTableId!==""&&typeof a.aanFeatures.l=="undefined"&&f.setAttribute("id",a.sTableId+"_length"); +f.className=a.oClasses.sLength;f.innerHTML="";i('select option[value="'+a._iDisplayLength+'"]',f).attr("selected",true);i("select",f).bind("change.DT",function(){var e=i(this).val(),h=a.aanFeatures.l;c=0;for(d=h.length;ca.aiDisplay.length||a._iDisplayLength==-1?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength}function Sa(a,b){if(!a||a===null||a==="")return 0;if(typeof b=="undefined")b=p.getElementsByTagName("body")[0];var c=p.createElement("div");c.style.width=q(a);b.appendChild(c);a=c.offsetWidth;b.removeChild(c);return a}function ga(a){var b=0,c,d=0,f=a.aoColumns.length,e,h=i("th", +a.nTHead);for(e=0;etd",b);h=S(a,e);for(e=d=0;e0)a.aoColumns[e].sWidth=q(c);d++}a.nTable.style.width=q(i(b).outerWidth());b.parentNode.removeChild(b)}}function Ua(a,b){if(a.oScroll.sX===""&&a.oScroll.sY!==""){i(b).width();b.style.width=q(i(b).outerWidth()-a.oScroll.iBarWidth)}else if(a.oScroll.sX!== +"")b.style.width=q(i(b).outerWidth())}function Ta(a,b){var c=Va(a,b);if(c<0)return null;if(a.aoData[c].nTr===null){var d=p.createElement("td");d.innerHTML=G(a,c,b,"");return d}return Q(a,c)[b]}function Va(a,b){for(var c=-1,d=-1,f=0;f/g,"");if(e.length>c){c=e.length;d=f}}return d}function q(a){if(a===null)return"0px";if(typeof a=="number"){if(a<0)return"0px";return a+"px"}var b=a.charCodeAt(a.length-1);if(b<48||b>57)return a;return a+ +"px"}function Za(a,b){if(a.length!=b.length)return 1;for(var c=0;cb&&a[d]--;c!=-1&&a.splice(c,1)}function Fa(a,b){b=b.split(",");for(var c=[],d=0,f=a.aoColumns.length;d4096){a=p.cookie.split(";");for(var j=0,k=a.length;j=d.aiDisplay.length){d._iDisplayStart-=d._iDisplayLength;if(d._iDisplayStart<0)d._iDisplayStart=0}if(typeof c=="undefined"||c){E(d);C(d)}return f};this.fnClearTable=function(a){var b=A(this[n.iApiIndex]);la(b);if(typeof a=="undefined"||a)C(b)};this.fnOpen=function(a,b,c){var d=A(this[n.iApiIndex]);this.fnClose(a);var f=p.createElement("tr"),e=p.createElement("td");f.appendChild(e);e.className=c; +e.colSpan=Z(d);if(typeof b.jquery!="undefined"||typeof b=="object")e.appendChild(b);else e.innerHTML=b;b=i("tr",d.nTBody);i.inArray(a,b)!=-1&&i(f).insertAfter(a);d.aoOpenRows.push({nTr:f,nParent:a});return f};this.fnClose=function(a){for(var b=A(this[n.iApiIndex]),c=0;c=Z(d);if(!j)for(f=a;ftr>td."+a.oClasses.sRowEmpty,a.nTable).parent().remove(); +if(a.nTable!=a.nTHead.parentNode){i(a.nTable).children("thead").remove();a.nTable.appendChild(a.nTHead)}if(a.nTFoot&&a.nTable!=a.nTFoot.parentNode){i(a.nTable).children("tfoot").remove();a.nTable.appendChild(a.nTFoot)}a.nTable.parentNode.removeChild(a.nTable);i(a.nTableWrapper).remove();a.aaSorting=[];a.aaSortingFixed=[];V(a);i(ba(a)).removeClass(a.asStripeClasses.join(" "));if(a.bJUI){i("th",a.nTHead).removeClass([n.oStdClasses.sSortable,n.oJUIClasses.sSortableAsc,n.oJUIClasses.sSortableDesc,n.oJUIClasses.sSortableNone].join(" ")); +i("th span."+n.oJUIClasses.sSortIcon,a.nTHead).remove();i("th",a.nTHead).each(function(){var e=i("div."+n.oJUIClasses.sSortJUIWrapper,this),h=e.contents();i(this).append(h);e.remove()})}else i("th",a.nTHead).removeClass([n.oStdClasses.sSortable,n.oStdClasses.sSortableAsc,n.oStdClasses.sSortableDesc,n.oStdClasses.sSortableNone].join(" "));a.nTableReinsertBefore?b.insertBefore(a.nTable,a.nTableReinsertBefore):b.appendChild(a.nTable);d=0;for(f=a.aoData.length;dt<"F"ip>'}if(e.oScroll.sX!==""||e.oScroll.sY!== +"")e.oScroll.iBarWidth=Ya();if(typeof g.iDisplayStart!="undefined"&&typeof e.iInitDisplayStart=="undefined"){e.iInitDisplayStart=g.iDisplayStart;e._iDisplayStart=g.iDisplayStart}if(typeof g.bStateSave!="undefined"){e.oFeatures.bStateSave=g.bStateSave;Xa(e,g);e.aoDrawCallback.push({fn:va,sName:"state_save"})}if(typeof g.iDeferLoading!="undefined"){e.bDeferLoading=true;e._iRecordsTotal=g.iDeferLoading;e._iRecordsDisplay=g.iDeferLoading}if(typeof g.aaData!="undefined")j=true;if(typeof g!="undefined"&& +typeof g.aoData!="undefined")g.aoColumns=g.aoData;if(typeof g.oLanguage!="undefined")if(typeof g.oLanguage.sUrl!="undefined"&&g.oLanguage.sUrl!==""){e.oLanguage.sUrl=g.oLanguage.sUrl;i.getJSON(e.oLanguage.sUrl,null,function(u){y(e,u,true)});h=true}else y(e,g.oLanguage,false)}else g={};if(typeof g.asStripClasses=="undefined"&&typeof g.asStripeClasses=="undefined"){e.asStripeClasses.push(e.oClasses.sStripeOdd);e.asStripeClasses.push(e.oClasses.sStripeEven)}c=false;d=i(this).children("tbody").children("tr"); +a=0;for(b=e.asStripeClasses.length;a=0;a--){var m= +g.aoColumnDefs[a].aTargets;i.isArray(m)||J(e,1,"aTargets must be an array of targets, not a "+typeof m);c=0;for(d=m.length;c=0){for(;e.aoColumns.length<=m[c];)F(e);x(e,m[c],g.aoColumnDefs[a])}else if(typeof m[c]=="number"&&m[c]<0)x(e,e.aoColumns.length+m[c],g.aoColumnDefs[a]);else if(typeof m[c]=="string"){b=0;for(f=e.aoColumns.length;b=e.aoColumns.length)e.aaSorting[a][0]=0;k=e.aoColumns[e.aaSorting[a][0]];if(typeof e.aaSorting[a][2]=="undefined")e.aaSorting[a][2]=0;if(typeof g.aaSorting=="undefined"&&typeof e.saved_aaSorting=="undefined")e.aaSorting[a][1]=k.asSorting[0];c=0;for(d=k.asSorting.length;c0){e.nTFoot=a[0];Y(e.aoFooter,e.nTFoot)}if(j)for(a=0;a
                  ').addClass((o&&o.position)?o.position:$.jGrowl.defaults.position).appendTo('body');$('#jGrowl').jGrowl(m,o);};$.fn.jGrowl=function(m,o){if($.isFunction(this.each)){var args=arguments;return this.each(function(){var self=this;if($(this).data('jGrowl.instance')==undefined){$(this).data('jGrowl.instance',$.extend(new $.fn.jGrowl(),{notifications:[],element:null,interval:null}));$(this).data('jGrowl.instance').startup(this);} if($.isFunction($(this).data('jGrowl.instance')[m])){$(this).data('jGrowl.instance')[m].apply($(this).data('jGrowl.instance'),$.makeArray(args).slice(1));}else{$(this).data('jGrowl.instance').create(m,o);}});};};$.extend($.fn.jGrowl.prototype,{defaults:{pool:0,header:'',group:'',sticky:false,position:'top-right',glue:'after',theme:'default',themeState:'highlight',corners:'10px',check:250,life:3000,closeDuration:'normal',openDuration:'normal',easing:'swing',closer:true,closeTemplate:'×',closerTemplate:'
                  [ close all ]
                  ',log:function(e,m,o){},beforeOpen:function(e,m,o){},afterOpen:function(e,m,o){},open:function(e,m,o){},beforeClose:function(e,m,o){},close:function(e,m,o){},animateOpen:{opacity:'show'},animateClose:{opacity:'hide'}},notifications:[],element:null,interval:null,create:function(message,o){var o=$.extend({},this.defaults,o);if(typeof o.speed!=='undefined'){o.openDuration=o.speed;o.closeDuration=o.speed;} this.notifications.push({message:message,options:o});o.log.apply(this.element,[this.element,message,o]);},render:function(notification){var self=this;var message=notification.message;var o=notification.options;var notification=$('
                  '+'
                  '+o.closeTemplate+'
                  '+'
                  '+o.header+'
                  '+'
                  '+message+'
                  ').data("jGrowl",o).addClass(o.theme).children('div.jGrowl-close').bind("click.jGrowl",function(){$(this).parent().trigger('jGrowl.close');}).parent();$(notification).bind("mouseover.jGrowl",function(){$('div.jGrowl-notification',self.element).data("jGrowl.pause",true);}).bind("mouseout.jGrowl",function(){$('div.jGrowl-notification',self.element).data("jGrowl.pause",false);}).bind('jGrowl.beforeOpen',function(){if(o.beforeOpen.apply(notification,[notification,message,o,self.element])!=false){$(this).trigger('jGrowl.open');}}).bind('jGrowl.open',function(){if(o.open.apply(notification,[notification,message,o,self.element])!=false){if(o.glue=='after'){$('div.jGrowl-notification:last',self.element).after(notification);}else{$('div.jGrowl-notification:first',self.element).before(notification);} $(this).animate(o.animateOpen,o.openDuration,o.easing,function(){if($.browser.msie&&(parseInt($(this).css('opacity'),10)===1||parseInt($(this).css('opacity'),10)===0)) -this.style.removeAttribute('filter');$(this).data("jGrowl").created=new Date();$(this).trigger('jGrowl.afterOpen');});}}).bind('jGrowl.afterOpen',function(){o.afterOpen.apply(notification,[notification,message,o,self.element]);}).bind('jGrowl.beforeClose',function(){if(o.beforeClose.apply(notification,[notification,message,o,self.element])!=false) -$(this).trigger('jGrowl.close');}).bind('jGrowl.close',function(){$(this).data('jGrowl.pause',true);$(this).animate(o.animateClose,o.closeDuration,o.easing,function(){$(this).remove();var close=o.close.apply(notification,[notification,message,o,self.element]);if($.isFunction(close)) -close.apply(notification,[notification,message,o,self.element]);});}).trigger('jGrowl.beforeOpen');if(o.corners!=''&&$.fn.corner!=undefined)$(notification).corner(o.corners);if($('div.jGrowl-notification:parent',self.element).size()>1&&$('div.jGrowl-closer',self.element).size()==0&&this.defaults.closer!=false){$(this.defaults.closerTemplate).addClass('jGrowl-closer ui-state-highlight ui-corner-all').addClass(this.defaults.theme).appendTo(self.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){$(this).siblings().trigger("jGrowl.beforeClose");if($.isFunction(self.defaults.closer)){self.defaults.closer.apply($(this).parent()[0],[$(this).parent()[0]]);}});};},update:function(){$(this.element).find('div.jGrowl-notification:parent').each(function(){if($(this).data("jGrowl")!=undefined&&$(this).data("jGrowl").created!=undefined&&($(this).data("jGrowl").created.getTime()+parseInt($(this).data("jGrowl").life))<(new Date()).getTime()&&$(this).data("jGrowl").sticky!=true&&($(this).data("jGrowl.pause")==undefined||$(this).data("jGrowl.pause")!=true)){$(this).trigger('jGrowl.beforeClose');}});if(this.notifications.length>0&&(this.defaults.pool==0||$(this.element).find('div.jGrowl-notification:parent').size()
                  ');this.interval=setInterval(function(){$(e).data('jGrowl.instance').update();},parseInt(this.defaults.check));if($.browser.msie&&parseInt($.browser.version)<7&&!window["XMLHttpRequest"]){$(this.element).addClass('ie6');}},shutdown:function(){$(this.element).removeClass('jGrowl').find('div.jGrowl-notification').remove();clearInterval(this.interval);},close:function(){$(this.element).find('div.jGrowl-notification').each(function(){$(this).trigger('jGrowl.beforeClose');});}});$.jGrowl.defaults=$.fn.jGrowl.prototype.defaults;})(jQuery); +this.style.removeAttribute('filter');if($(this).data("jGrowl")!=null) +$(this).data("jGrowl").created=new Date();$(this).trigger('jGrowl.afterOpen');});}}).bind('jGrowl.afterOpen',function(){o.afterOpen.apply(notification,[notification,message,o,self.element]);}).bind('jGrowl.beforeClose',function(){if(o.beforeClose.apply(notification,[notification,message,o,self.element])!=false) +$(this).trigger('jGrowl.close');}).bind('jGrowl.close',function(){$(this).data('jGrowl.pause',true);$(this).animate(o.animateClose,o.closeDuration,o.easing,function(){if($.isFunction(o.close)){if(o.close.apply(notification,[notification,message,o,self.element])!==false) +$(this).remove();}else{$(this).remove();}});}).trigger('jGrowl.beforeOpen');if(o.corners!=''&&$.fn.corner!=undefined)$(notification).corner(o.corners);if($('div.jGrowl-notification:parent',self.element).size()>1&&$('div.jGrowl-closer',self.element).size()==0&&this.defaults.closer!=false){$(this.defaults.closerTemplate).addClass('jGrowl-closer ui-state-highlight ui-corner-all').addClass(this.defaults.theme).appendTo(self.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){$(this).siblings().trigger("jGrowl.beforeClose");if($.isFunction(self.defaults.closer)){self.defaults.closer.apply($(this).parent()[0],[$(this).parent()[0]]);}});};},update:function(){$(this.element).find('div.jGrowl-notification:parent').each(function(){if($(this).data("jGrowl")!=undefined&&$(this).data("jGrowl").created!=undefined&&($(this).data("jGrowl").created.getTime()+parseInt($(this).data("jGrowl").life))<(new Date()).getTime()&&$(this).data("jGrowl").sticky!=true&&($(this).data("jGrowl.pause")==undefined||$(this).data("jGrowl.pause")!=true)){$(this).trigger('jGrowl.beforeClose');}});if(this.notifications.length>0&&(this.defaults.pool==0||$(this.element).find('div.jGrowl-notification:parent').size()');this.interval=setInterval(function(){$(e).data('jGrowl.instance').update();},parseInt(this.defaults.check));if($.browser.msie&&parseInt($.browser.version)<7&&!window["XMLHttpRequest"]){$(this.element).addClass('ie6');}},shutdown:function(){$(this.element).removeClass('jGrowl').find('div.jGrowl-notification').remove();clearInterval(this.interval);},close:function(){$(this.element).find('div.jGrowl-notification').each(function(){$(this).trigger('jGrowl.beforeClose');});}});$.jGrowl.defaults=$.fn.jGrowl.prototype.defaults;})(jQuery); \ No newline at end of file diff --git a/src/sunstone/public/vendor/jQuery/NOTICE b/src/sunstone/public/vendor/jQuery/NOTICE index ba5558c085..796234964d 100644 --- a/src/sunstone/public/vendor/jQuery/NOTICE +++ b/src/sunstone/public/vendor/jQuery/NOTICE @@ -2,5 +2,5 @@ THIRD-PARTY SOFTWARE * Author: John Resig (www.sprymedia.co.uk) * Info: http://jquery.com/ - * Copyright: Copyright (c) 2011 John Resig, http://jquery.com/ + * Copyright: Copyright (c) 2012 John Resig, http://jquery.com/ * License: MIT License: See MIT-LICENSE.txt diff --git a/src/sunstone/public/vendor/jQuery/jquery-1.4.4.min.js b/src/sunstone/public/vendor/jQuery/jquery-1.4.4.min.js deleted file mode 100644 index 8f3ca2e2da..0000000000 --- a/src/sunstone/public/vendor/jQuery/jquery-1.4.4.min.js +++ /dev/null @@ -1,167 +0,0 @@ -/*! - * jQuery JavaScript Library v1.4.4 - * http://jquery.com/ - * - * Copyright 2010, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2010, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Thu Nov 11 19:04:53 2010 -0500 - */ -(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h= -h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;kd)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La, -"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this, -e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a, -"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+ -a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/, -C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j, -s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this, -j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length}, -toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j=== --1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false; -if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload", -b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&& -!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&& -l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H
                  a";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"), -k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false, -scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent= -false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom= -1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="
                  ";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="
                  t
                  ";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display= -"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h= -c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando); -else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one"; -if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true}, -attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&& -b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0}; -c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem, -arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid= -d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+ -c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType=== -8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k=== -"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+ -d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired= -B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type=== -"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]=== -0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); -(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3]; -break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr, -q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h= -l;g.sort(w);if(h)for(var i=1;i0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n, -m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled=== -true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"=== -g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return in[3]-0},nth:function(g,i,n){return n[3]- -0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()=== -i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]]; -if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m, -g);else if(typeof g.length==="number")for(var p=g.length;n";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g); -n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&& -function(){var g=k,i=t.createElement("div");i.innerHTML="

                  ";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F|| -p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g= -t.createElement("div");g.innerHTML="
                  ";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition? -function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n0)for(var h=d;h0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h= -h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context): -c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a, -2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a, -b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&& -e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/\s]+\/)>/g,P={option:[1, -""],legend:[1,"
                  ","
                  "],thead:[1,"","
                  "],tr:[2,"","
                  "],td:[3,"","
                  "],col:[2,"","
                  "],area:[1,"",""],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div
                  ","
                  "];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= -c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, -wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, -prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, -this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); -return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null; -else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1>");try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append", -prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument|| -b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]===""&&!x?r.childNodes:[];for(o=k.length- -1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script")))); -d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i, -jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true, -zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b), -h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b); -if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f= -d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left; -e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/)<[^<]*)*<\/script>/gi, -ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b=== -"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("
                  ").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& -!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})}, -getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html", -script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data|| -!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache= -false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset; -A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type", -b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& -c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| -c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]= -encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess", -[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"), -e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}}); -if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show", -3),a,b,d);else{d=0;for(var e=this.length;d=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b, -d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a* -Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)} -var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true; -this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide|| -this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a= -c.timers,b=0;b-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a, -e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&& -c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase(); -c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+ -b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window); diff --git a/src/sunstone/public/vendor/jQuery/jquery-1.7.1.min.js b/src/sunstone/public/vendor/jQuery/jquery-1.7.1.min.js new file mode 100644 index 0000000000..198b3ff07d --- /dev/null +++ b/src/sunstone/public/vendor/jQuery/jquery-1.7.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
                  a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
                  "+""+"
                  ",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
                  t
                  ",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
                  ",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

                  ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
                  ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
                  ","
                  "],thead:[1,"","
                  "],tr:[2,"","
                  "],td:[3,"","
                  "],col:[2,"","
                  "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
                  ","
                  "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
                  ").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/src/sunstone/public/vendor/jQueryLayout/jquery.layout-latest.min.js b/src/sunstone/public/vendor/jQueryLayout/jquery.layout-latest.min.js new file mode 100644 index 0000000000..326aacefbe --- /dev/null +++ b/src/sunstone/public/vendor/jQueryLayout/jquery.layout-latest.min.js @@ -0,0 +1,108 @@ +/* + jquery.layout 1.3.0 - Release Candidate 29.15 + $Date: 2011-06-25 08:00:00 (Sat, 25 Jun 2011) $ + $Rev: 302915 $ + + Copyright (c) 2010 + Fabrizio Balliano (http://www.fabrizioballiano.net) + Kevin Dalman (http://allpro.net) + + Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) + and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. + + Changelog: http://layout.jquery-dev.net/changelog.cfm#1.3.0.rc29.15 + + Docs: http://layout.jquery-dev.net/documentation.html + Tips: http://layout.jquery-dev.net/tips.html + Help: http://groups.google.com/group/jquery-ui-layout +*/ +(function(f){f.layout={version:"1.3.rc29.15",revision:0.032915,language:{Open:"Open",Close:"Close",Resize:"Resize",Slide:"Slide Open",Pin:"Pin",Unpin:"Un-Pin",noRoomToOpenTip:"Not enough room to show this pane.",pane:"pane",selector:"selector",errButton:"Error Adding Button \n\nInvalid ",errContainerMissing:"UI Layout Initialization Error\n\nThe specified layout-container does not exist.",errCenterPaneMissing:"UI Layout Initialization Error\n\nThe center-pane element does not exist.\n\nThe center-pane is a required element.", +errContainerHeight:"UI Layout Initialization Warning\n\nThe layout-container \"CONTAINER\" has no height.\n\nTherefore the layout is 0-height and hence 'invisible'!"},browser:{mozilla:!!f.browser.mozilla,webkit:!!f.browser.webkit||!!f.browser.safari,msie:!!f.browser.msie,isIE6:!!f.browser.msie&&6==f.browser.version,boxModel:!1},scrollbarWidth:function(){return window.scrollbarWidth||f.layout.getScrollbarSize("width")},scrollbarHeight:function(){return window.scrollbarHeight||f.layout.getScrollbarSize("height")}, +getScrollbarSize:function(h){var p=f('
                  ').appendTo("body"),o={width:p.width()-p[0].clientWidth,height:p.height()-p[0].clientHeight};p.remove();window.scrollbarWidth=o.width;window.scrollbarHeight=o.height;return h.match(/^(width|height)$/i)?o[h]:o},showInvisibly:function(h,p){if(!h)return{};h.jquery||(h=f(h));var o={display:h.css("display"),visibility:h.css("visibility")};return p|| +"none"==o.display?(h.css({display:"block",visibility:"hidden"}),o):{}},getElementDimensions:function(h){var p={},o=p.css={},t={},F,L,A=f.layout.cssNum,y=h.offset();p.offsetLeft=y.left;p.offsetTop=y.top;f.each("Left,Right,Top,Bottom".split(","),function(y,A){F=o["border"+A]=f.layout.borderWidth(h,A);L=o["padding"+A]=f.layout.cssNum(h,"padding"+A);t[A]=F+L;p["inset"+A]=L});p.offsetWidth=h.innerWidth();p.offsetHeight=h.innerHeight();p.outerWidth=h.outerWidth();p.outerHeight=h.outerHeight();p.innerWidth= +Math.max(0,p.outerWidth-t.Left-t.Right);p.innerHeight=Math.max(0,p.outerHeight-t.Top-t.Bottom);o.width=h.width();o.height=h.height();o.top=A(h,"top",!0);o.bottom=A(h,"bottom",!0);o.left=A(h,"left",!0);o.right=A(h,"right",!0);return p},getElementCSS:function(f,p){var o={},t=f[0].style,F=p.split(","),L="Top,Bottom,Left,Right".split(","),A="Color,Style,Width".split(","),y,T,ca,U,V,Z;for(U=0;UV;V++)if(T=L[V],"border"==y)for(Z=0;3>Z;Z++)ca= +A[Z],o[y+T+ca]=t[y+T+ca];else o[y+T]=t[y+T];else o[y]=t[y];return o},cssWidth:function(h,p){var o=f.layout.borderWidth,t=f.layout.cssNum;if(0>=p)return 0;if(!f.layout.browser.boxModel)return p;o=p-o(h,"Left")-o(h,"Right")-t(h,"paddingLeft")-t(h,"paddingRight");return Math.max(0,o)},cssHeight:function(h,p){var o=f.layout.borderWidth,t=f.layout.cssNum;if(0>=p)return 0;if(!f.layout.browser.boxModel)return p;o=p-o(h,"Top")-o(h,"Bottom")-t(h,"paddingTop")-t(h,"paddingBottom");return Math.max(0,o)},cssNum:function(h, +p,o){h.jquery||(h=f(h));var t=f.layout.showInvisibly(h),p=f.curCSS(h[0],p,!0),o=o&&"auto"==p?p:parseInt(p,10)||0;h.css(t);return o},borderWidth:function(h,p){h.jquery&&(h=h[0]);var o="border"+p.substr(0,1).toUpperCase()+p.substr(1);return"none"==f.curCSS(h,o+"Style",!0)?0:parseInt(f.curCSS(h,o+"Width",!0),10)||0},isMouseOverElem:function(h,p){var o=f(p||this),t=o.offset(),F=t.top,t=t.left,L=t+o.outerWidth(),o=F+o.outerHeight(),A=h.pageX,y=h.pageY;return f.layout.browser.msie&&0>A&&0>y||A>=t&&A<=L&& +y>=F&&y<=o}};f.fn.layout=function(h){function p(a){if(!a)return!0;var b=a.keyCode;if(33>b)return!0;var c={38:"north",40:"south",37:"west",39:"east"},e=a.shiftKey,d=a.ctrlKey,j,g,i,m;d&&37<=b&&40>=b&&n[c[b]].enableCursorHotkey?m=c[b]:(d||e)&&f.each(k.borderPanes.split(","),function(a,c){j=n[c];g=j.customHotkey;i=j.customHotkeyModifier;if(e&&"SHIFT"==i||d&&"CTRL"==i||d&&e)if(g&&b==(isNaN(g)||9>=g?g.toUpperCase().charCodeAt(0):g))return m=c,!1});if(!m||!r[m]||!n[m].closable||l[m].isHidden)return!0;da(m); +a.stopPropagation();return a.returnValue=!1}function o(a){if(w()){this&&this.tagName&&(a=this);var b;G(a)?b=r[a]:f(a).data("layoutRole")?b=f(a):f(a).parents().each(function(){if(f(this).data("layoutRole"))return b=f(this),!1});if(b&&b.length){var c=b.data("layoutEdge"),a=l[c];a.cssSaved&&t(c);if(a.isSliding||a.isResizing||a.isClosed)a.cssSaved=!1;else{var e={zIndex:k.zIndex.pane_normal+2},d={},j=b.css("overflow"),g=b.css("overflowX"),i=b.css("overflowY");if("visible"!=j)d.overflow=j,e.overflow="visible"; +if(g&&!g.match(/visible|auto/))d.overflowX=g,e.overflowX="visible";if(i&&!i.match(/visible|auto/))d.overflowY=g,e.overflowY="visible";a.cssSaved=d;b.css(e);f.each(k.allPanes.split(","),function(a,b){b!=c&&t(b)})}}}}function t(a){if(w()){this&&this.tagName&&(a=this);var b;G(a)?b=r[a]:f(a).data("layoutRole")?b=f(a):f(a).parents().each(function(){if(f(this).data("layoutRole"))return b=f(this),!1});if(b&&b.length){var a=b.data("layoutEdge"),a=l[a],c=a.cssSaved||{};!a.isSliding&&!a.isResizing&&b.css("zIndex", +k.zIndex.pane_normal);b.css(c);a.cssSaved=!1}}}function F(a,b,c){var e=f(a),d=n.showErrorMessages;if(e.length)if(-1==k.borderPanes.indexOf(b))d&&alert(C.errButton+C.pane+": "+b);else return a=n[b].buttonClass+"-"+c,e.addClass(a+" "+a+"-"+b).data("layoutName",n.name),e;else d&&alert(C.errButton+C.selector+": "+a);return null}function L(a,b,c){switch(b.toLowerCase()){case "toggle":A(a,c);break;case "open":y(a,c);break;case "close":T(a,c);break;case "pin":ca(a,c);break;case "toggle-slide":A(a,c,!0); +break;case "open-slide":y(a,c,!0)}}function A(a,b,c){(a=F(a,b,"toggle"))&&a.click(function(a){da(b,!!c);a.stopPropagation()})}function y(a,b,c){(a=F(a,b,"open"))&&a.attr("title",C.Open).click(function(a){M(b,!!c);a.stopPropagation()})}function T(a,b){var c=F(a,b,"close");c&&c.attr("title",C.Close).click(function(a){H(b);a.stopPropagation()})}function ca(a,b){var c=F(a,b,"pin");if(c){var e=l[b];c.click(function(a){V(f(this),b,e.isSliding||e.isClosed);e.isSliding||e.isClosed?M(b):H(b);a.stopPropagation()}); +V(c,b,!e.isClosed&&!e.isSliding);k[b].pins.push(a)}}function U(a,b){f.each(k[a].pins,function(c,e){V(f(e),a,b)})}function V(a,b,c){var e=a.attr("pin");if(!(e&&c==("down"==e))){var e=n[b].buttonClass+"-pin",d=e+"-"+b,b=e+"-up "+d+"-up",e=e+"-down "+d+"-down";a.attr("pin",c?"down":"up").attr("title",c?C.Unpin:C.Pin).removeClass(c?b:e).addClass(c?e:b)}}function Z(a){for(var a=f.extend({},n.cookie,a||{}).name||n.name||"Layout",b=document.cookie,b=b?b.split(";"):[],c,e=0,d=b.length;ek.allPanes.indexOf(d)||(j=l[d][e],void 0!=j&&("isClosed"==e&&l[d].isSliding&&(j=!0),(b[d]||(b[d]={}))[c[e]?c[e]:e]=j));return b}function Ba(a){function b(a){var e=[],d=0,f,g,i;for(f in a)g=a[f],i=typeof g,"string"==i?g='"'+g+'"':"object"==i&&(g=b(g)),e[d++]='"'+f+'":'+g;return"{"+e.join(",")+"}"}return b(a)}function Aa(a){try{return window.eval("("+a+")")||{}}catch(b){return{}}}var C=f.layout.language, +n={name:"",containerClass:"ui-layout-container",scrollToBookmarkOnLoad:!0,resizeWithWindow:!0,resizeWithWindowDelay:200,resizeWithWindowMaxDelay:0,onresizeall_start:null,onresizeall_end:null,onload_start:null,onload_end:null,onunload_start:null,onunload_end:null,autoBindCustomButtons:!1,zIndex:null,initPanes:!0,showErrorMessages:!0,defaults:{applyDemoStyles:!1,closable:!0,resizable:!0,slidable:!0,initClosed:!1,initHidden:!1,contentSelector:".ui-layout-content",contentIgnoreSelector:".ui-layout-ignore", +findNestedContent:!1,paneClass:"ui-layout-pane",resizerClass:"ui-layout-resizer",togglerClass:"ui-layout-toggler",buttonClass:"ui-layout-button",minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerTip_open:C.Close,togglerTip_closed:C.Open,togglerContent_open:"",togglerContent_closed:"",resizerDblClickToggle:!0,autoResize:!0,autoReopen:!0,resizerDragOpacity:1,maskIframesOnResize:!0,resizeNestedLayout:!0, +resizeWhileDragging:!1,resizeContentWhileDragging:!1,noRoomToOpenTip:C.noRoomToOpenTip,resizerTip:C.Resize,sliderTip:C.Slide,sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseleave",slideDelay_open:300,slideDelay_close:300,hideTogglerOnSlide:!1,preventQuickSlideClose:f.layout.browser.webkit,preventPrematureSlideClose:!1,showOverflowOnHover:!1,enableCursorHotkey:!0,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},fxOpacityFix:!0,triggerEventsOnLoad:!1, +triggerEventsWhileDragging:!0,onshow_start:null,onshow_end:null,onhide_start:null,onhide_end:null,onopen_start:null,onopen_end:null,onclose_start:null,onclose_end:null,onresize_start:null,onresize_end:null,onsizecontent_start:null,onsizecontent_end:null,onswap_start:null,onswap_end:null,ondrag_start:null,ondrag_end:null},north:{paneSelector:".ui-layout-north",size:"auto",resizerCursor:"n-resize",customHotkey:""},south:{paneSelector:".ui-layout-south",size:"auto",resizerCursor:"s-resize",customHotkey:""}, +east:{paneSelector:".ui-layout-east",size:200,resizerCursor:"e-resize",customHotkey:""},west:{paneSelector:".ui-layout-west",size:200,resizerCursor:"w-resize",customHotkey:""},center:{paneSelector:".ui-layout-center",minWidth:0,minHeight:0},useStateCookie:!1,cookie:{name:"",autoSave:!0,autoLoad:!0,domain:"",path:"",expires:"",secure:!1,keys:"north.size,south.size,east.size,west.size,north.isClosed,south.isClosed,east.isClosed,west.isClosed,north.isHidden,south.isHidden,east.isHidden,west.isHidden"}}, +pa={slide:{all:{duration:"fast"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},drop:{all:{duration:"slow"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},scale:{all:{duration:"fast"}}},l={id:"layout"+(new Date).getTime(),initialized:!1,container:{},north:{},south:{},east:{},west:{},center:{},cookie:{}},k={allPanes:"north,south,west,east,center",borderPanes:"north,south,west,east",altSide:{north:"south", +south:"north",east:"west",west:"east"},hidden:{visibility:"hidden"},visible:{visibility:"visible"},zIndex:{pane_normal:1,resizer_normal:2,iframe_mask:2,pane_sliding:100,pane_animate:1E3,resizer_drag:1E4},resizers:{cssReq:{position:"absolute",padding:0,margin:0,fontSize:"1px",textAlign:"left",overflow:"hidden"},cssDemo:{background:"#DDD",border:"none"}},togglers:{cssReq:{position:"absolute",display:"block",padding:0,margin:0,overflow:"hidden",textAlign:"center",fontSize:"1px",cursor:"pointer",zIndex:1}, +cssDemo:{background:"#AAA"}},content:{cssReq:{position:"relative"},cssDemo:{overflow:"auto",padding:"10px"},cssDemoPane:{overflow:"hidden",padding:0}},panes:{cssReq:{position:"absolute",margin:0},cssDemo:{padding:"10px",background:"#FFF",border:"1px solid #BBB",overflow:"auto"}},north:{side:"Top",sizeType:"Height",dir:"horz",cssReq:{top:0,bottom:"auto",left:0,right:0,width:"auto"},pins:[]},south:{side:"Bottom",sizeType:"Height",dir:"horz",cssReq:{top:"auto",bottom:0,left:0,right:0,width:"auto"},pins:[]}, +east:{side:"Right",sizeType:"Width",dir:"vert",cssReq:{left:"auto",right:0,top:"auto",bottom:"auto",height:"auto"},pins:[]},west:{side:"Left",sizeType:"Width",dir:"vert",cssReq:{left:0,right:"auto",top:"auto",bottom:"auto",height:"auto"},pins:[]},center:{dir:"center",cssReq:{left:"auto",right:"auto",top:"auto",bottom:"auto",height:"auto",width:"auto"}}},E={data:{},set:function(a,b,c){E.clear(a);E.data[a]=setTimeout(b,c)},clear:function(a){var b=E.data;b[a]&&(clearTimeout(b[a]),delete b[a])}},G=function(a){try{return"string"== +typeof a||"object"==typeof a&&null!==a.constructor.toString().match(/string/i)}catch(b){return!1}},z=function(a,b){return Math.max(a,b)},Ea=function(a){var b,c={cookie:{},defaults:{fxSettings:{}},north:{fxSettings:{}},south:{fxSettings:{}},east:{fxSettings:{}},west:{fxSettings:{}},center:{fxSettings:{}}},a=a||{};a.effects||a.cookie||a.defaults||a.north||a.south||a.west||a.east||a.center?c=f.extend(!0,c,a):f.each(a,function(a,d){b=a.split("__");if(!b[1]||c[b[0]])c[b[1]?b[0]:"defaults"][b[1]?b[1]:b[0]]= +d});return c},Fa=function(a,b,c){function e(j){var g=k[j];g.doCallback?(d.push(j),j=g.callback.split(",")[1],j!=b&&0<=!f.inArray(j,d)&&e(j)):(g.doCallback=!0,g.callback=a+","+b+","+(c?1:0))}var d=[];f.each(k.borderPanes.split(","),function(a,b){if(k[b].isMoving)return e(b),!1})},Ga=function(a){a=k[a];k.isLayoutBusy=!1;delete a.isMoving;if(a.doCallback&&a.callback){a.doCallback=!1;var b=a.callback.split(","),c=0a&&(a=100);E.clear("winResize");E.set("winResize",function(){E.clear("winResize");E.clear("winResizeRepeater");var a=O(q);(a.innerWidth!==u.innerWidth||a.innerHeight!==u.innerHeight)&&ga()},a);E.data.winResizeRepeater||Ka()},Ka=function(){var a=Number(n.resizeWithWindowMaxDelay);0q.innerHeight()&&alert(C.errContainerHeight.replace(/CONTAINER/,u.ref))},Na=function(a,b){if(b||w()){var c=n[a],e=l[a],d=k[a],j=d.dir,g="center"==a,i={},m=r[a],h;m?va(a):P[a]=!1;m=r[a]=Ja(a);if(m.length){m.data("layoutCSS")||m.data("layoutCSS",f.layout.getElementCSS(m,"position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border"));m.data("parentLayout",ea).data("layoutRole","pane").data("layoutEdge",a).css(d.cssReq).css("zIndex",k.zIndex.pane_normal).css(c.applyDemoStyles? +d.cssDemo:{}).addClass(c.paneClass+" "+c.paneClass+"-"+a).bind("mouseenter."+B,ra).bind("mouseleave."+B,S);Oa(a,!1);if(!g)h=e.size=W(a,c.size),d=W(a,c.minSize)||1,g=W(a,c.maxSize)||1E5,0
                  "),h=e.closable?D[c]=f("
                  "):!1;!d.isVisible&&e.slidable&&m.attr("title",e.sliderTip).css("cursor",e.sliderCursor);m.attr("id","#"==e.paneSelector.substr(0,1)?e.paneSelector.substr(1)+"-resizer":"").data("parentLayout",ea).data("layoutRole","resizer").data("layoutEdge",c).css(k.resizers.cssReq).css("zIndex",k.zIndex.resizer_normal).css(e.applyDemoStyles? +k.resizers.cssDemo:{}).addClass(j+" "+j+i).appendTo(q);h&&(h.attr("id","#"==e.paneSelector.substr(0,1)?e.paneSelector.substr(1)+"-toggler":"").data("parentLayout",ea).data("layoutRole","toggler").data("layoutEdge",c).css(k.togglers.cssReq).css(e.applyDemoStyles?k.togglers.cssDemo:{}).addClass(g+" "+g+i).appendTo(m),e.togglerContent_open&&f(""+e.togglerContent_open+"").data("layoutRole","togglerContent").data("layoutEdge",c).addClass("content content-open").css("display","none").appendTo(h), +e.togglerContent_closed&&f(""+e.togglerContent_closed+"").data("layoutRole","togglerContent").data("layoutEdge",c).addClass("content content-closed").css("display","none").appendTo(h),Pa(c));Va(c);d.isVisible?wa(c):(xa(c),ba(c,!0))}});ia("all")},Oa=function(a,b){if(w()){var c=n[a],e=c.contentSelector,d=r[a],j;e&&(j=P[a]=c.findNestedContent?d.find(e).eq(0):d.children(e).eq(0));j&&j.length?(j.data("layoutCSS")||j.data("layoutCSS",f.layout.getElementCSS(j,"height")),j.css(k.content.cssReq), +c.applyDemoStyles&&(j.css(k.content.cssDemo),d.css(k.content.cssDemoPane)),l[a].content={},!1!==b&&fa(a)):P[a]=!1}},Wa=function(){var a;f.each("toggle,open,close,pin,toggle-slide,open-slide".split(","),function(b,c){f.each(k.borderPanes.split(","),function(b,d){f(".ui-layout-button-"+c+"-"+d).each(function(){a=f(this).data("layoutName")||f(this).attr("layoutName");(void 0==a||a==n.name)&&L(this,c,d)})})})},Va=function(a){var b="function"==typeof f.fn.draggable,c;if(!a||"all"==a)a=k.borderPanes;f.each(a.split(","), +function(a,d){var j=n[d],g=l[d],i=k[d],m="horz"==i.dir?"top":"left",h,I;if(!b||!r[d]||!j.resizable)return j.resizable=!1,!0;var o=x[d],p=j.resizerClass,t=p+"-drag",w=p+"-"+d+"-drag",z=p+"-dragging",A=p+"-"+d+"-dragging",y=p+"-dragging-limit",C=p+"-"+d+"-dragging-limit",D=!1;g.isClosed||o.attr("title",j.resizerTip).css("cursor",j.resizerCursor);o.bind("mouseenter."+B,Ia).bind("mouseleave."+B,sa);o.draggable({containment:q[0],axis:"horz"==i.dir?"y":"x",delay:0,distance:1,helper:"clone",opacity:j.resizerDragOpacity, +addClasses:!1,zIndex:k.zIndex.resizer_drag,start:function(){j=n[d];g=l[d];I=j.resizeWhileDragging;if(!1===v(d,j.ondrag_start))return!1;k.isLayoutBusy=!0;g.isResizing=!0;E.clear(d+"_closeSlider");N(d);h=g.resizerPosition;o.addClass(t+" "+w);D=!1;c=f(!0===j.maskIframesOnResize?"iframe":j.maskIframesOnResize).filter(":visible");var a,b=0;c.each(function(){a="ui-layout-mask-"+ ++b;f(this).data("layoutMaskID",a);f('
                  ').css({background:"#fff", +opacity:"0.001",zIndex:k.zIndex.iframe_mask,position:"absolute",width:this.offsetWidth+"px",height:this.offsetHeight+"px"}).css(f(this).position()).appendTo(this.parentNode)});f("body").disableSelection()},drag:function(a,b){D||(b.helper.addClass(z+" "+A).css({right:"auto",bottom:"auto"}).children().css("visibility","hidden"),D=!0,g.isSliding&&r[d].css("zIndex",k.zIndex.pane_sliding));var c=0;if(b.position[m]h.max)b.position[m]=h.max,c=1;c?(b.helper.addClass(y+ +" "+C),window.defaultStatus="Panel has reached its "+(0c&&d.match(/south|east/)?"maximum":"minimum")+" size"):(b.helper.removeClass(y+" "+C),window.defaultStatus="");I&&F(a,b,d)},stop:function(a,b){f("body").enableSelection();window.defaultStatus="";o.removeClass(t+" "+w);g.isResizing=!1;k.isLayoutBusy=!1;F(a,b,d,!0)}});var F=function(a,b,d,e){var a=b.position,b=k[d],g;switch(d){case "north":g=a.top;break;case "west":g=a.left;break;case "south":g=u.offsetHeight-a.top- +j.spacing_open;break;case "east":g=u.offsetWidth-a.left-j.spacing_open}if(e){if(f("div.ui-layout-mask").each(function(){this.parentNode.removeChild(this)}),!1===v(d,j.ondrag_end||j.ondrag))return!1}else c.each(function(){f("#"+f(this).data("layoutMaskID")).css(f(this).position()).css({width:this.offsetWidth+"px",height:this.offsetHeight+"px"})});ya(d,g-u["inset"+b.side])}})},va=function(a,b,c){if(w()&&r[a]){var e=r[a],d=P[a],j=x[a],g=D[a],i=n[a].paneClass,m=i+"-"+a,i=[i,i+"-open",i+"-closed",i+"-sliding", +m,m+"-open",m+"-closed",m+"-sliding"];f.merge(i,qa(e,!0));e&&e.length&&(b&&!e.data("layoutContainer")&&(!d||!d.length||!d.data("layoutContainer"))?e.remove():(e.removeClass(i.join(" ")).removeData("layoutParent").removeData("layoutRole").removeData("layoutEdge").removeData("autoHidden").unbind("."+B),e.data("layoutContainer")||e.css(e.data("layoutCSS")).removeData("layoutCSS"),d&&d.length&&!d.data("layoutContainer")&&d.css(d.data("layoutCSS")).removeData("layoutCSS")));g&&g.length&&g.remove();j&& +j.length&&j.remove();r[a]=P[a]=x[a]=D[a]=!1;c||(ga(),l[a]={})}},ka=function(a,b){if(w()){var c=n[a],e=l[a],d=r[a],f=x[a];if(d&&!e.isHidden&&!(l.initialized&&!1===v(a,c.onhide_start)))if(e.isSliding=!1,f&&f.hide(),!l.initialized||e.isClosed){if(e.isClosed=!0,e.isHidden=!0,e.isVisible=!1,d.hide(),Y("horz"==k[a].dir?"all":"center"),l.initialized||c.triggerEventsOnLoad)v(a,c.onhide_end||c.onhide)}else e.isHiding=!0,H(a,!1,b)}},ha=function(a,b,c,e){if(w()){var d=l[a];if(r[a]&&d.isHidden&&!1!==v(a,n[a].onshow_start))d.isSliding= +!1,d.isShowing=!0,!1===b?H(a,!0):M(a,!1,c,e)}},da=function(a,b){if(w()){G(a)||(a.stopImmediatePropagation(),a=f(this).data("layoutEdge"));var c=l[G(a)?f.trim(a):void 0==a||null==a?"":a];c.isHidden?ha(a):c.isClosed?M(a,!!b):H(a)}},Xa=function(a){var b=l[a];r[a].hide();b.isClosed=!0;b.isVisible=!1},H=function(a,b,c,e){function d(){if(i.isClosed){ba(a,!0);var b=k.altSide[a];l[b].noRoom&&(N(b),X(b));if(!e&&(l.initialized||g.triggerEventsOnLoad))m||v(a,g.onclose_end||g.onclose),m&&v(a,g.onshow_end||g.onshow), +h&&v(a,g.onhide_end||g.onhide)}Ga(a)}if(!l.initialized&&r[a])Xa(a);else if(w()){var f=r[a],g=n[a],i=l[a],c=!c&&!i.isClosed&&"none"!=g.fxName_close,m=i.isShowing,h=i.isHiding;delete i.isShowing;delete i.isHiding;if(f&&(g.closable||m||h)&&(b||!i.isClosed||m))if(k.isLayoutBusy)Fa("close",a,b);else if(m||!1!==v(a,g.onclose_start)){k[a].isMoving=!0;k.isLayoutBusy=!0;i.isClosed=!0;i.isVisible=!1;if(h)i.isHidden=!0;else if(m)i.isHidden=!1;i.isSliding?ja(a,!1):Y("horz"==k[a].dir?"all":"center",!1);xa(a); +c?(ma(a,!0),f.hide(g.fxName_close,g.fxSettings_close,g.fxSpeed_close,function(){ma(a,!1);d()})):(f.hide(),d())}}},xa=function(a){var b=x[a],c=D[a],e=n[a],d=k[a].side.toLowerCase(),j=e.resizerClass,g=e.togglerClass,i="-"+a;b.css(d,u["inset"+k[a].side]).removeClass(j+"-open "+j+i+"-open").removeClass(j+"-sliding "+j+i+"-sliding").addClass(j+"-closed "+j+i+"-closed").unbind("dblclick."+B);e.resizable&&"function"==typeof f.fn.draggable&&b.draggable("disable").removeClass("ui-state-disabled").css("cursor", +"default").attr("title","");c&&(c.removeClass(g+"-open "+g+i+"-open").addClass(g+"-closed "+g+i+"-closed").attr("title",e.togglerTip_closed),c.children(".content-open").hide(),c.children(".content-closed").css("display","block"));U(a,!1);l.initialized&&ia("all")},M=function(a,b,c,e){function d(){i.isVisible&&(Ha(a),i.isSliding||Y("vert"==k[a].dir?"center":"all",!1),wa(a));Ga(a)}if(w()){var f=r[a],g=n[a],i=l[a],c=!c&&i.isClosed&&"none"!=g.fxName_open,m=i.isShowing;delete i.isShowing;if(f&&(g.resizable|| +g.closable||m)&&(!i.isVisible||i.isSliding))if(i.isHidden&&!m)ha(a,!0);else if(k.isLayoutBusy)Fa("open",a,b);else if(N(a,b),!1!==v(a,g.onopen_start))if(N(a,b),i.minSize>i.maxSize)U(a,!1),!e&&g.noRoomToOpenTip&&alert(g.noRoomToOpenTip);else{k[a].isMoving=!0;k.isLayoutBusy=!0;b?ja(a,!0):i.isSliding?ja(a,!1):g.slidable&&ba(a,!1);i.noRoom=!1;X(a);i.isVisible=!0;i.isClosed=!1;if(m)i.isHidden=!1;c?(ma(a,!0),f.show(g.fxName_open,g.fxSettings_open,g.fxSpeed_open,function(){ma(a,!1);d()})):(f.show(),d())}}}, +wa=function(a,b){var c=r[a],e=x[a],d=D[a],j=n[a],g=l[a],i=k[a].side.toLowerCase(),m=j.resizerClass,h=j.togglerClass,I="-"+a;e.css(i,u["inset"+k[a].side]+R(a)).removeClass(m+"-closed "+m+I+"-closed").addClass(m+"-open "+m+I+"-open");g.isSliding?e.addClass(m+"-sliding "+m+I+"-sliding"):e.removeClass(m+"-sliding "+m+I+"-sliding");j.resizerDblClickToggle&&e.bind("dblclick",da);S(0,e);j.resizable&&"function"==typeof f.fn.draggable?e.draggable("enable").css("cursor",j.resizerCursor).attr("title",j.resizerTip): +g.isSliding||e.css("cursor","default");d&&(d.removeClass(h+"-closed "+h+I+"-closed").addClass(h+"-open "+h+I+"-open").attr("title",j.togglerTip_open),S(0,d),d.children(".content-closed").hide(),d.children(".content-open").css("display","block"));U(a,!g.isSliding);f.extend(g,O(c));l.initialized&&(ia("all"),fa(a,!0));if(!b&&(l.initialized||j.triggerEventsOnLoad)&&c.is(":visible"))v(a,j.onopen_end||j.onopen),g.isShowing&&v(a,j.onshow_end||j.onshow),l.initialized&&(v(a,j.onresize_end||j.onresize),aa(a))}, +Qa=function(a){function b(){d.isClosed?k[e].isMoving||M(e,!0):ja(e,!0)}if(w()){var c=G(a)?null:a,e=c?f(this).data("layoutEdge"):a,d=l[e],a=n[e].slideDelay_open;c&&c.stopImmediatePropagation();d.isClosed&&c&&"mouseenter"==c.type&&0d.maxSize?$(a,d.maxSize,c,e):d.sizeo&&(w=z(q-o,q-k),k-=q-w);0p&&(x=z(t-p,t-k),k-=t-x);if(0==k){q!=o&&$("east",w,!0);t!=p&&$("west",x,!0);Y("center",b,c);return}}}else{g.isVisible&&!g.noVerticalRoom&& +f.extend(g,O(i),la(d));if(!c&&!g.noVerticalRoom&&m.height==g.outerHeight)return!0;h.top=m.top;h.bottom=m.bottom;h.height=K(d,m.height);g.maxHeight=z(0,h.height);m=0v)o=v,t= +0;else if(G(t))switch(t){case "top":case "left":t=0;break;case "bottom":case "right":t=v-o;break;default:t=Math.floor((v-o)/2)}else h=parseInt(t,10),t=0<=t?h:v-o+h;if("horz"==p){var w=J(i,o);i.css({width:z(0,w),height:z(1,K(i,q)),left:t,top:0});i.children(".content").each(function(){m=f(this);m.css("marginLeft",Math.floor((w-m.outerWidth())/2))})}else{var y=K(i,o);i.css({height:z(0,y),width:z(1,J(i,q)),top:t,left:0});i.children(".content").each(function(){m=f(this);m.css("marginTop",Math.floor((y- +m.outerHeight())/2))})}S(0,i)}if(!l.initialized&&(e.initHidden||d.noRoom))g.hide(),i&&i.hide()}}})},Pa=function(a){if(w()){var b=D[a],c=n[a];if(b)c.closable=!0,b.bind("click."+B,function(b){b.stopPropagation();da(a)}).bind("mouseenter."+B,ra).bind("mouseleave."+B,S).css("visibility","visible").css("cursor","pointer").attr("title",l[a].isClosed?c.togglerTip_closed:c.togglerTip_open).show()}},q=f(this).eq(0);if(!q.length)return n.showErrorMessages&&alert(C.errContainerMissing),null;if(q.data("layoutContainer")&& +q.data("layout"))return q.data("layout");var r={},P={},x={},D={},u=l.container,B=l.id,ea={options:n,state:l,container:q,panes:r,contents:P,resizers:x,togglers:D,toggle:da,hide:ka,show:ha,open:M,close:H,slideOpen:Qa,slideClose:za,slideToggle:function(a){da(a,!0)},initContent:Oa,sizeContent:fa,sizePane:ya,swapPanes:function(a,b){function c(a){var b=r[a],c=P[a];return!b?!1:{pane:a,P:b?b[0]:!1,C:c?c[0]:!1,state:f.extend({},l[a]),options:f.extend({},n[a])}}function e(a,b){if(a){var c=a.P,d=a.C,e=a.pane, +h=k[b],j=h.side.toLowerCase(),o="inset"+h.side,p=f.extend({},l[b]),q=n[b],t={resizerCursor:q.resizerCursor};f.each("fxName,fxSpeed,fxSettings".split(","),function(a,b){t[b]=q[b];t[b+"_open"]=q[b+"_open"];t[b+"_close"]=q[b+"_close"]});r[b]=f(c).data("layoutEdge",b).css(k.hidden).css(h.cssReq);P[b]=d?f(d):!1;n[b]=f.extend({},a.options,t);l[b]=f.extend({},a.state);c.className=c.className.replace(RegExp(q.paneClass+"-"+e,"g"),q.paneClass+"-"+b);ua(b);h.dir!=k[e].dir?(c=g[b]||0,N(b),c=z(c,l[b].minSize), +ya(b,c,!0)):x[b].css(j,u[o]+(l[b].isVisible?R(b):0));a.state.isVisible&&!p.isVisible?wa(b,!0):(xa(b),ba(b,!0));a=null}}if(w()){l[a].edge=b;l[b].edge=a;var d=!1;!1===v(a,n[a].onswap_start)&&(d=!0);!d&&!1===v(b,n[b].onswap_start)&&(d=!0);if(d)l[a].edge=a,l[b].edge=b;else{var d=c(a),h=c(b),g={};g[a]=d?d.state.size:0;g[b]=h?h.state.size:0;r[a]=!1;r[b]=!1;l[a]={};l[b]={};D[a]&&D[a].remove();D[b]&&D[b].remove();x[a]&&x[a].remove();x[b]&&x[b].remove();x[a]=x[b]=D[a]=D[b]=!1;e(d,b);e(h,a);d=h=g=null;r[a]&& +r[a].css(k.visible);r[b]&&r[b].css(k.visible);ga();v(a,n[a].onswap_end||n[a].onswap);v(b,n[b].onswap_end||n[b].onswap)}}},resizeAll:ga,initPanes:w,destroy:function(){f(window).unbind("."+B);f(document).unbind("."+B);f.each(k.allPanes.split(","),function(a,b){va(b,!1,!0)});q.removeData("layout").removeData("layoutContainer").removeClass(n.containerClass);!q.data("layoutEdge")&&q.data("layoutCSS")&&q.css(q.data("layoutCSS")).removeData("layoutCSS");"BODY"==u.tagName&&(q=f("html")).data("layoutCSS")&& +q.css(q.data("layoutCSS")).removeData("layoutCSS");La()},addPane:Na,removePane:va,setSizeLimits:N,bindButton:L,addToggleBtn:A,addOpenBtn:y,addCloseBtn:T,addPinBtn:ca,allowOverflow:o,resetOverflow:t,encodeJSON:Ba,decodeJSON:Aa,getState:oa,getCookie:Z,saveCookie:na,deleteCookie:function(){na("",{expires:-1})},loadCookie:Ca,loadState:Da,cssWidth:J,cssHeight:K,enableClosable:Pa,disableClosable:function(a,b){if(w()){var c=D[a];if(c)n[a].closable=!1,l[a].isClosed&&M(a,!1,!0),c.unbind("."+B).css("visibility", +b?"hidden":"visible").css("cursor","default").attr("title","")}},enableSlidable:function(a){if(w()){var b=x[a];if(b&&b.data("draggable"))n[a].slidable=!0,s.isClosed&&ba(a,!0)}},disableSlidable:function(a){if(w()){var b=x[a];if(b)n[a].slidable=!1,l[a].isSliding?H(a,!1,!0):(ba(a,!1),b.css("cursor","default").attr("title",""),S(null,b[0]))}},enableResizable:function(a){if(w()){var b=x[a],c=n[a];if(b&&b.data("draggable"))c.resizable=!0,b.draggable("enable").bind("mouseenter."+B,Ia).bind("mouseleave."+ +B,sa),l[a].isClosed||b.css("cursor",c.resizerCursor).attr("title",c.resizerTip)}},disableResizable:function(a){if(w()){var b=x[a];if(b&&b.data("draggable"))n[a].resizable=!1,b.draggable("disable").unbind("."+B).css("cursor","default").attr("title",""),S(null,b[0])}}};return"cancel"===function(){Ua();var a=n;f.layout.browser.boxModel=f.support.boxModel;a.useStateCookie&&a.cookie.autoLoad&&Ca();l.creatingLayout=!0;if(!1===v(null,a.onload_start))return"cancel";var b=u.tagName=q[0].tagName,c=n,e="BODY"== +b,d={},h=q.is(":visible");u.selector=q.selector.split(".slice")[0];u.ref=b+"/"+u.selector;q.data("layout",ea).data("layoutContainer",B).addClass(c.containerClass);q.data("layoutCSS")||(e?(d=f.extend(f.layout.getElementCSS(q,"overflow,position,margin,padding,border"),{height:q.css("height"),overflow:q.css("overflow"),overflowX:q.css("overflowX"),overflowY:q.css("overflowY")}),b=f("html"),b.data("layoutCSS",{height:"auto",overflow:b.css("overflow"),overflowX:b.css("overflowX"),overflowY:b.css("overflowY")})): +d=f.layout.getElementCSS(q,"overflow,position,margin,padding,border,top,bottom,left,right,width,height,overflow,overflowX,overflowY"),q.data("layoutCSS",d));try{if(e)f("html").css({height:"100%",overflow:"hidden",overflowX:"hidden",overflowY:"hidden"}),f("body").css({position:"relative",height:"100%",overflow:"hidden",overflowX:"hidden",overflowY:"hidden",margin:0,padding:0,border:"none"}),f.extend(u,O(q));else{var d={overflow:"hidden",overflowX:"hidden",overflowY:"hidden"},g=q.css("position");q.css("height"); +if(!q.data("layoutRole")&&(!g||!g.match(/fixed|absolute|relative/)))d.position="relative";q.css(d);h&&(f.extend(u,O(q)),c.showErrorMessages&&2>u.innerHeight&&alert(C.errContainerHeight.replace(/CONTAINER/,u.ref)))}}catch(i){}Ma();a.autoBindCustomButtons&&Wa();f(window).bind("unload."+B,La);a.initPanes&&ta();delete l.creatingLayout;return l.initialized}()?null:ea}})(jQuery); diff --git a/src/sunstone/public/vendor/jQueryLayout/jquery.layout.min-1.2.0.js b/src/sunstone/public/vendor/jQueryLayout/jquery.layout.min-1.2.0.js deleted file mode 100644 index bcc2f0f227..0000000000 --- a/src/sunstone/public/vendor/jQueryLayout/jquery.layout.min-1.2.0.js +++ /dev/null @@ -1,80 +0,0 @@ -/* - * jquery.layout 1.2.0 - * - * Copyright (c) 2008 - * Fabrizio Balliano (http://www.fabrizioballiano.net) - * Kevin Dalman (http://allpro.net) - * - * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) - * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. - * - * $Date: 2008-12-27 02:17:22 +0100 (sab, 27 dic 2008) $ - * $Rev: 203 $ - * - * NOTE: For best code readability, view this with a fixed-space font and tabs equal to 4-chars - */ -(function($){$.fn.layout=function(opts){var -prefix="ui-layout-",defaults={paneClass:prefix+"pane",resizerClass:prefix+"resizer",togglerClass:prefix+"toggler",togglerInnerClass:prefix+"",buttonClass:prefix+"button",contentSelector:"."+prefix+"content",contentIgnoreSelector:"."+prefix+"ignore"};var options={name:"",scrollToBookmarkOnLoad:true,defaults:{applyDefaultStyles:false,closable:true,resizable:true,slidable:true,contentSelector:defaults.contentSelector,contentIgnoreSelector:defaults.contentIgnoreSelector,paneClass:defaults.paneClass,resizerClass:defaults.resizerClass,togglerClass:defaults.togglerClass,buttonClass:defaults.buttonClass,resizerDragOpacity:1,maskIframesOnResize:true,minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerTip_open:"Close",togglerTip_closed:"Open",resizerTip:"Resize",sliderTip:"Slide Open",sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseout",hideTogglerOnSlide:false,togglerContent_open:"",togglerContent_closed:"",showOverflowOnHover:false,enableCursorHotkey:true,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},initClosed:false,initHidden:false},north:{paneSelector:"."+prefix+"north",size:"auto",resizerCursor:"n-resize"},south:{paneSelector:"."+prefix+"south",size:"auto",resizerCursor:"s-resize"},east:{paneSelector:"."+prefix+"east",size:200,resizerCursor:"e-resize"},west:{paneSelector:"."+prefix+"west",size:200,resizerCursor:"w-resize"},center:{paneSelector:"."+prefix+"center"}};var effects={slide:{all:{duration:"fast"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},drop:{all:{duration:"slow"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},scale:{all:{duration:"fast"}}};var config={allPanes:"north,south,east,west,center",borderPanes:"north,south,east,west",zIndex:{resizer_normal:1,pane_normal:2,mask:4,sliding:100,resizing:10000,animation:10000},resizers:{cssReq:{position:"absolute",padding:0,margin:0,fontSize:"1px",textAlign:"left",overflow:"hidden",zIndex:1},cssDef:{background:"#DDD",border:"none"}},togglers:{cssReq:{position:"absolute",display:"block",padding:0,margin:0,overflow:"hidden",textAlign:"center",fontSize:"1px",cursor:"pointer",zIndex:1},cssDef:{background:"#AAA"}},content:{cssReq:{overflow:"auto"},cssDef:{}},defaults:{cssReq:{position:"absolute",margin:0,zIndex:2},cssDef:{padding:"10px",background:"#FFF",border:"1px solid #BBB",overflow:"auto"}},north:{edge:"top",sizeType:"height",dir:"horz",cssReq:{top:0,bottom:"auto",left:0,right:0,width:"auto"}},south:{edge:"bottom",sizeType:"height",dir:"horz",cssReq:{top:"auto",bottom:0,left:0,right:0,width:"auto"}},east:{edge:"right",sizeType:"width",dir:"vert",cssReq:{left:"auto",right:0,top:"auto",bottom:"auto",height:"auto"}},west:{edge:"left",sizeType:"width",dir:"vert",cssReq:{left:0,right:"auto",top:"auto",bottom:"auto",height:"auto"}},center:{dir:"center",cssReq:{left:"auto",right:"auto",top:"auto",bottom:"auto",height:"auto",width:"auto"}}};var state={id:Math.floor(Math.random()*10000),container:{},north:{},south:{},east:{},west:{},center:{}};var -altEdge={top:"bottom",bottom:"top",left:"right",right:"left"},altSide={north:"south",south:"north",east:"west",west:"east"};var isStr=function(o){if(typeof o=="string")return true;else if(typeof o=="object"){try{var match=o.constructor.toString().match(/string/i);return(match!==null);}catch(e){}}return false;};var str=function(o){if(typeof o=="string"||isStr(o))return $.trim(o);else return o;};var min=function(x,y){return Math.min(x,y);};var max=function(x,y){return Math.max(x,y);};var transformData=function(d){var json={defaults:{fxSettings:{}},north:{fxSettings:{}},south:{fxSettings:{}},east:{fxSettings:{}},west:{fxSettings:{}},center:{fxSettings:{}}};d=d||{};if(d.effects||d.defaults||d.north||d.south||d.west||d.east||d.center)json=$.extend(json,d);else -$.each(d,function(key,val){a=key.split("__");json[a[1]?a[0]:"defaults"][a[1]?a[1]:a[0]]=val;});return json;};var setFlowCallback=function(action,pane,param){var -cb=action+","+pane+","+(param?1:0),cP,cbPane;$.each(c.borderPanes.split(","),function(i,p){if(c[p].isMoving){bindCallback(p);return false;}});function bindCallback(p,test){cP=c[p];if(!cP.doCallback){cP.doCallback=true;cP.callback=cb;}else{cpPane=cP.callback.split(",")[1];if(cpPane!=p&&cpPane!=pane)bindCallback(cpPane,true);}}};var execFlowCallback=function(pane){var cP=c[pane];c.isLayoutBusy=false;delete cP.isMoving;if(!cP.doCallback||!cP.callback)return;cP.doCallback=false;var -cb=cP.callback.split(","),param=(cb[2]>0?true:false);if(cb[0]=="open")open(cb[1],param);else if(cb[0]=="close")close(cb[1],param);if(!cP.doCallback)cP.callback=null;};var execUserCallback=function(pane,v_fn){if(!v_fn)return;var fn;try{if(typeof v_fn=="function")fn=v_fn;else if(typeof v_fn!="string")return;else if(v_fn.indexOf(",")>0){var -args=v_fn.split(","),fn=eval(args[0]);if(typeof fn=="function"&&args.length>1)return fn(args[1]);}else -fn=eval(v_fn);if(typeof fn=="function")return fn(pane,$Ps[pane],$.extend({},state[pane]),$.extend({},options[pane]),options.name);}catch(ex){}};var cssNum=function($E,prop){var -val=0,hidden=false,visibility="";if(!$.browser.msie){if($.curCSS($E[0],"display",true)=="none"){hidden=true;visibility=$.curCSS($E[0],"visibility",true);$E.css({display:"block",visibility:"hidden"});}}val=parseInt($.curCSS($E[0],prop,true),10)||0;if(hidden){$E.css({display:"none"});if(visibility&&visibility!="hidden")$E.css({visibility:visibility});}return val;};var cssW=function(e,outerWidth){var $E;if(isStr(e)){e=str(e);$E=$Ps[e];}else -$E=$(e);if(outerWidth<=0)return 0;else if(!(outerWidth>0))outerWidth=isStr(e)?getPaneSize(e):$E.outerWidth();if(!$.boxModel)return outerWidth;else -return outerWidth --cssNum($E,"paddingLeft")-cssNum($E,"paddingRight")-($.curCSS($E[0],"borderLeftStyle",true)=="none"?0:cssNum($E,"borderLeftWidth"))-($.curCSS($E[0],"borderRightStyle",true)=="none"?0:cssNum($E,"borderRightWidth"));};var cssH=function(e,outerHeight){var $E;if(isStr(e)){e=str(e);$E=$Ps[e];}else -$E=$(e);if(outerHeight<=0)return 0;else if(!(outerHeight>0))outerHeight=(isStr(e))?getPaneSize(e):$E.outerHeight();if(!$.boxModel)return outerHeight;else -return outerHeight --cssNum($E,"paddingTop")-cssNum($E,"paddingBottom")-($.curCSS($E[0],"borderTopStyle",true)=="none"?0:cssNum($E,"borderTopWidth"))-($.curCSS($E[0],"borderBottomStyle",true)=="none"?0:cssNum($E,"borderBottomWidth"));};var cssSize=function(pane,outerSize){if(c[pane].dir=="horz")return cssH(pane,outerSize);else -return cssW(pane,outerSize);};var getPaneSize=function(pane,inclSpace){var -$P=$Ps[pane],o=options[pane],s=state[pane],oSp=(inclSpace?o.spacing_open:0),cSp=(inclSpace?o.spacing_closed:0);if(!$P||s.isHidden)return 0;else if(s.isClosed||(s.isSliding&&inclSpace))return cSp;else if(c[pane].dir=="horz")return $P.outerHeight()+oSp;else -return $P.outerWidth()+oSp;};var setPaneMinMaxSizes=function(pane){var -d=cDims,edge=c[pane].edge,dir=c[pane].dir,o=options[pane],s=state[pane],$P=$Ps[pane],$altPane=$Ps[altSide[pane]],paneSpacing=o.spacing_open,altPaneSpacing=options[altSide[pane]].spacing_open,altPaneSize=(!$altPane?0:(dir=="horz"?$altPane.outerHeight():$altPane.outerWidth())),containerSize=(dir=="horz"?d.innerHeight:d.innerWidth),limitSize=containerSize-paneSpacing-altPaneSize-altPaneSpacing,minSize=s.minSize||0,maxSize=Math.min(s.maxSize||9999,limitSize),minPos,maxPos;switch(pane){case"north":minPos=d.offsetTop+minSize;maxPos=d.offsetTop+maxSize;break;case"west":minPos=d.offsetLeft+minSize;maxPos=d.offsetLeft+maxSize;break;case"south":minPos=d.offsetTop+d.innerHeight-maxSize;maxPos=d.offsetTop+d.innerHeight-minSize;break;case"east":minPos=d.offsetLeft+d.innerWidth-maxSize;maxPos=d.offsetLeft+d.innerWidth-minSize;break;}$.extend(s,{minSize:minSize,maxSize:maxSize,minPosition:minPos,maxPosition:maxPos});};var getPaneDims=function(){var d={top:getPaneSize("north",true),bottom:getPaneSize("south",true),left:getPaneSize("west",true),right:getPaneSize("east",true),width:0,height:0};with(d){width=cDims.innerWidth-left-right;height=cDims.innerHeight-bottom-top;top+=cDims.top;bottom+=cDims.bottom;left+=cDims.left;right+=cDims.right;}return d;};var getElemDims=function($E){var -d={},e,b,p;$.each("Left,Right,Top,Bottom".split(","),function(){e=str(this);b=d["border"+e]=cssNum($E,"border"+e+"Width");p=d["padding"+e]=cssNum($E,"padding"+e);d["offset"+e]=b+p;if($E==$Container)d[e.toLowerCase()]=($.boxModel?p:0);});d.innerWidth=d.outerWidth=$E.outerWidth();d.innerHeight=d.outerHeight=$E.outerHeight();if($.boxModel){d.innerWidth-=(d.offsetLeft+d.offsetRight);d.innerHeight-=(d.offsetTop+d.offsetBottom);}return d;};var setTimer=function(pane,action,fn,ms){var -Layout=window.layout=window.layout||{},Timers=Layout.timers=Layout.timers||{},name="layout_"+state.id+"_"+pane+"_"+action;if(Timers[name])return;else Timers[name]=setTimeout(fn,ms);};var clearTimer=function(pane,action){var -Layout=window.layout=window.layout||{},Timers=Layout.timers=Layout.timers||{},name="layout_"+state.id+"_"+pane+"_"+action;if(Timers[name]){clearTimeout(Timers[name]);delete Timers[name];return true;}else -return false;};var create=function(){initOptions();initContainer();initPanes();initHandles();initResizable();sizeContent("all");if(options.scrollToBookmarkOnLoad)with(self.location)if(hash)replace(hash);initHotkeys();$(window).resize(function(){var timerID="timerLayout_"+state.id;if(window[timerID])clearTimeout(window[timerID]);window[timerID]=null;if(true||$.browser.msie)window[timerID]=setTimeout(resizeAll,100);else -resizeAll();});};var initContainer=function(){try{if($Container[0].tagName=="BODY"){$("html").css({height:"100%",overflow:"hidden"});$("body").css({position:"relative",height:"100%",overflow:"hidden",margin:0,padding:0,border:"none"});}else{var -CSS={overflow:"hidden"},p=$Container.css("position"),h=$Container.css("height");if(!$Container.hasClass("ui-layout-pane")){if(!p||"fixed,absolute,relative".indexOf(p)<0)CSS.position="relative";if(!h||h=="auto")CSS.height="100%";}$Container.css(CSS);}}catch(ex){}cDims=state.container=getElemDims($Container);};var initHotkeys=function(){$.each(c.borderPanes.split(","),function(i,pane){var o=options[pane];if(o.enableCursorHotkey||o.customHotkey){$(document).keydown(keyDown);return false;}});};var initOptions=function(){opts=transformData(opts);if(opts.effects){$.extend(effects,opts.effects);delete opts.effects;}$.each("name,scrollToBookmarkOnLoad".split(","),function(idx,key){if(opts[key]!==undefined)options[key]=opts[key];else if(opts.defaults[key]!==undefined){options[key]=opts.defaults[key];delete opts.defaults[key];}});$.each("paneSelector,resizerCursor,customHotkey".split(","),function(idx,key){delete opts.defaults[key];});$.extend(options.defaults,opts.defaults);c.center=$.extend(true,{},c.defaults,c.center);$.extend(options.center,opts.center);var o_Center=$.extend(true,{},options.defaults,opts.defaults,options.center);$.each("paneClass,contentSelector,contentIgnoreSelector,applyDefaultStyles,showOverflowOnHover".split(","),function(idx,key){options.center[key]=o_Center[key];});var defs=options.defaults;$.each(c.borderPanes.split(","),function(i,pane){c[pane]=$.extend(true,{},c.defaults,c[pane]);o=options[pane]=$.extend(true,{},options.defaults,options[pane],opts.defaults,opts[pane]);if(!o.paneClass)o.paneClass=defaults.paneClass;if(!o.resizerClass)o.resizerClass=defaults.resizerClass;if(!o.togglerClass)o.togglerClass=defaults.togglerClass;$.each(["_open","_close",""],function(i,n){var -sName="fxName"+n,sSpeed="fxSpeed"+n,sSettings="fxSettings"+n;o[sName]=opts[pane][sName]||opts[pane].fxName||opts.defaults[sName]||opts.defaults.fxName||o[sName]||o.fxName||defs[sName]||defs.fxName||"none";var fxName=o[sName];if(fxName=="none"||!$.effects||!$.effects[fxName]||(!effects[fxName]&&!o[sSettings]&&!o.fxSettings))fxName=o[sName]="none";var -fx=effects[fxName]||{},fx_all=fx.all||{},fx_pane=fx[pane]||{};o[sSettings]=$.extend({},fx_all,fx_pane,defs.fxSettings||{},defs[sSettings]||{},o.fxSettings,o[sSettings],opts.defaults.fxSettings,opts.defaults[sSettings]||{},opts[pane].fxSettings,opts[pane][sSettings]||{});o[sSpeed]=opts[pane][sSpeed]||opts[pane].fxSpeed||opts.defaults[sSpeed]||opts.defaults.fxSpeed||o[sSpeed]||o[sSettings].duration||o.fxSpeed||o.fxSettings.duration||defs.fxSpeed||defs.fxSettings.duration||fx_pane.duration||fx_all.duration||"normal";});});};var initPanes=function(){$.each(c.allPanes.split(","),function(){var -pane=str(this),o=options[pane],s=state[pane],fx=s.fx,dir=c[pane].dir,size=o.size=="auto"||isNaN(o.size)?0:o.size,minSize=o.minSize||1,maxSize=o.maxSize||9999,spacing=o.spacing_open||0,sel=o.paneSelector,isIE6=($.browser.msie&&$.browser.version<7),CSS={},$P,$C;$Cs[pane]=false;if(sel.substr(0,1)==="#")$P=$Ps[pane]=$Container.find(sel+":first");else{$P=$Ps[pane]=$Container.children(sel+":first");if(!$P.length)$P=$Ps[pane]=$Container.children("form:first").children(sel+":first");}if(!$P.length){$Ps[pane]=false;return true;}$P.attr("pane",pane).addClass(o.paneClass+" "+o.paneClass+"-"+pane);if(pane!="center"){s.isClosed=false;s.isSliding=false;s.isResizing=false;s.isHidden=false;s.noRoom=false;c[pane].pins=[];}CSS=$.extend({visibility:"visible",display:"block"},c.defaults.cssReq,c[pane].cssReq);if(o.applyDefaultStyles)$.extend(CSS,c.defaults.cssDef,c[pane].cssDef);$P.css(CSS);CSS={};switch(pane){case"north":CSS.top=cDims.top;CSS.left=cDims.left;CSS.right=cDims.right;break;case"south":CSS.bottom=cDims.bottom;CSS.left=cDims.left;CSS.right=cDims.right;break;case"west":CSS.left=cDims.left;break;case"east":CSS.right=cDims.right;break;case"center":}if(dir=="horz"){if(size===0||size=="auto"){$P.css({height:"auto"});size=$P.outerHeight();}size=max(size,minSize);size=min(size,maxSize);size=min(size,cDims.innerHeight-spacing);CSS.height=max(1,cssH(pane,size));s.size=size;s.maxSize=maxSize;s.minSize=max(minSize,size-CSS.height+1);$P.css(CSS);}else if(dir=="vert"){if(size===0||size=="auto"){$P.css({width:"auto",float:"left"});size=$P.outerWidth();$P.css({float:"none"});}size=max(size,minSize);size=min(size,maxSize);size=min(size,cDims.innerWidth-spacing);CSS.width=max(1,cssW(pane,size));s.size=size;s.maxSize=maxSize;s.minSize=max(minSize,size-CSS.width+1);$P.css(CSS);sizeMidPanes(pane,null,true);}else if(pane=="center"){$P.css(CSS);sizeMidPanes("center",null,true);}if(o.initClosed&&o.closable){$P.hide().addClass("closed");s.isClosed=true;}else if(o.initHidden||o.initClosed){hide(pane,true);s.isHidden=true;}else -$P.addClass("open");if(o.showOverflowOnHover)$P.hover(allowOverflow,resetOverflow);if(o.contentSelector){$C=$Cs[pane]=$P.children(o.contentSelector+":first");if(!$C.length){$Cs[pane]=false;return true;}$C.css(c.content.cssReq);if(o.applyDefaultStyles)$C.css(c.content.cssDef);$P.css({overflow:"hidden"});}});};var initHandles=function(){$.each(c.borderPanes.split(","),function(){var -pane=str(this),o=options[pane],s=state[pane],rClass=o.resizerClass,tClass=o.togglerClass,$P=$Ps[pane];$Rs[pane]=false;$Ts[pane]=false;if(!$P||(!o.closable&&!o.resizable))return;var -edge=c[pane].edge,isOpen=$P.is(":visible"),spacing=(isOpen?o.spacing_open:o.spacing_closed),_pane="-"+pane,_state=(isOpen?"-open":"-closed"),$R,$T;$R=$Rs[pane]=$("");if(isOpen&&o.resizable);else if(!isOpen&&o.slidable)$R.attr("title",o.sliderTip).css("cursor",o.sliderCursor);$R.attr("id",(o.paneSelector.substr(0,1)=="#"?o.paneSelector.substr(1)+"-resizer":"")).attr("resizer",pane).css(c.resizers.cssReq).css(edge,cDims[edge]+getPaneSize(pane)).addClass(rClass+" "+rClass+_pane+" "+rClass+_state+" "+rClass+_pane+_state).appendTo($Container);if(o.applyDefaultStyles)$R.css(c.resizers.cssDef);if(o.closable){$T=$Ts[pane]=$("
                  ");$T.attr("id",(o.paneSelector.substr(0,1)=="#"?o.paneSelector.substr(1)+"-toggler":"")).css(c.togglers.cssReq).attr("title",(isOpen?o.togglerTip_open:o.togglerTip_closed)).click(function(evt){toggle(pane);evt.stopPropagation();}).mouseover(function(evt){evt.stopPropagation();}).addClass(tClass+" "+tClass+_pane+" "+tClass+_state+" "+tClass+_pane+_state).appendTo($R);if(o.togglerContent_open)$(""+o.togglerContent_open+"").addClass("content content-open").css("display",s.isClosed?"none":"block").appendTo($T);if(o.togglerContent_closed)$(""+o.togglerContent_closed+"").addClass("content content-closed").css("display",s.isClosed?"block":"none").appendTo($T);if(o.applyDefaultStyles)$T.css(c.togglers.cssDef);if(!isOpen)bindStartSlidingEvent(pane,true);}});sizeHandles("all",true);};var initResizable=function(){var -draggingAvailable=(typeof $.fn.draggable=="function"),minPosition,maxPosition,edge;$.each(c.borderPanes.split(","),function(){var -pane=str(this),o=options[pane],s=state[pane];if(!draggingAvailable||!$Ps[pane]||!o.resizable){o.resizable=false;return true;}var -rClass=o.resizerClass,dragClass=rClass+"-drag",dragPaneClass=rClass+"-"+pane+"-drag",draggingClass=rClass+"-dragging",draggingPaneClass=rClass+"-"+pane+"-dragging",draggingClassSet=false,$P=$Ps[pane],$R=$Rs[pane];if(!s.isClosed)$R.attr("title",o.resizerTip).css("cursor",o.resizerCursor);$R.draggable({containment:$Container[0],axis:(c[pane].dir=="horz"?"y":"x"),delay:200,distance:1,helper:"clone",opacity:o.resizerDragOpacity,zIndex:c.zIndex.resizing,start:function(e,ui){if(false===execUserCallback(pane,o.onresize_start))return false;s.isResizing=true;clearTimer(pane,"closeSlider");$R.addClass(dragClass+" "+dragPaneClass);draggingClassSet=false;var resizerWidth=(pane=="east"||pane=="south"?o.spacing_open:0);setPaneMinMaxSizes(pane);s.minPosition-=resizerWidth;s.maxPosition-=resizerWidth;edge=(c[pane].dir=="horz"?"top":"left");$(o.maskIframesOnResize===true?"iframe":o.maskIframesOnResize).each(function(){$('
                  ').css({background:"#fff",opacity:"0.001",zIndex:9,position:"absolute",width:this.offsetWidth+"px",height:this.offsetHeight+"px"}).css($(this).offset()).appendTo(this.parentNode);});},drag:function(e,ui){if(!draggingClassSet){$(".ui-draggable-dragging").addClass(draggingClass+" "+draggingPaneClass).children().css("visibility","hidden");draggingClassSet=true;if(s.isSliding)$Ps[pane].css("zIndex",c.zIndex.sliding);}if(ui.position[edge]s.maxPosition)ui.position[edge]=s.maxPosition;},stop:function(e,ui){var -dragPos=ui.position,resizerPos,newSize;$R.removeClass(dragClass+" "+dragPaneClass);switch(pane){case"north":resizerPos=dragPos.top;break;case"west":resizerPos=dragPos.left;break;case"south":resizerPos=cDims.outerHeight-dragPos.top-$R.outerHeight();break;case"east":resizerPos=cDims.outerWidth-dragPos.left-$R.outerWidth();break;}newSize=resizerPos-cDims[c[pane].edge];sizePane(pane,newSize);$("div.ui-layout-mask").remove();s.isResizing=false;}});});};var hide=function(pane,onInit){var -o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane];if(!$P||s.isHidden)return;if(false===execUserCallback(pane,o.onhide_start))return;s.isSliding=false;if($R)$R.hide();if(onInit||s.isClosed){s.isClosed=true;s.isHidden=true;$P.hide();sizeMidPanes(c[pane].dir=="horz"?"all":"center");execUserCallback(pane,o.onhide_end||o.onhide);}else{s.isHiding=true;close(pane,false);}};var show=function(pane,openPane){var -o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane];if(!$P||!s.isHidden)return;if(false===execUserCallback(pane,o.onshow_start))return;s.isSliding=false;s.isShowing=true;if($R&&o.spacing_open>0)$R.show();if(openPane===false)close(pane,true);else -open(pane);};var toggle=function(pane){var s=state[pane];if(s.isHidden)show(pane);else if(s.isClosed)open(pane);else -close(pane);};var close=function(pane,force,noAnimation){var -$P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane],o=options[pane],s=state[pane],doFX=!noAnimation&&!s.isClosed&&(o.fxName_close!="none"),edge=c[pane].edge,rClass=o.resizerClass,tClass=o.togglerClass,_pane="-"+pane,_open="-open",_sliding="-sliding",_closed="-closed",isShowing=s.isShowing,isHiding=s.isHiding;delete s.isShowing;delete s.isHiding;if(!$P||(!o.resizable&&!o.closable))return;else if(!force&&s.isClosed&&!isShowing)return;if(c.isLayoutBusy){setFlowCallback("close",pane,force);return;}if(!isShowing&&false===execUserCallback(pane,o.onclose_start))return;c[pane].isMoving=true;c.isLayoutBusy=true;s.isClosed=true;if(isHiding)s.isHidden=true;else if(isShowing)s.isHidden=false;syncPinBtns(pane,false);if(!s.isSliding)sizeMidPanes(c[pane].dir=="horz"?"all":"center");if($R){$R.css(edge,cDims[edge]).removeClass(rClass+_open+" "+rClass+_pane+_open).removeClass(rClass+_sliding+" "+rClass+_pane+_sliding).addClass(rClass+_closed+" "+rClass+_pane+_closed);if(o.resizable)$R.draggable("disable").css("cursor","default").attr("title","");if($T){$T.removeClass(tClass+_open+" "+tClass+_pane+_open).addClass(tClass+_closed+" "+tClass+_pane+_closed).attr("title",o.togglerTip_closed);}sizeHandles();}if(doFX){lockPaneForFX(pane,true);$P.hide(o.fxName_close,o.fxSettings_close,o.fxSpeed_close,function(){lockPaneForFX(pane,false);if(!s.isClosed)return;close_2();});}else{$P.hide();close_2();}function close_2(){bindStartSlidingEvent(pane,true);if(!isShowing)execUserCallback(pane,o.onclose_end||o.onclose);if(isShowing)execUserCallback(pane,o.onshow_end||o.onshow);if(isHiding)execUserCallback(pane,o.onhide_end||o.onhide);execFlowCallback(pane);}};var open=function(pane,slide,noAnimation){var -$P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane],o=options[pane],s=state[pane],doFX=!noAnimation&&s.isClosed&&(o.fxName_open!="none"),edge=c[pane].edge,rClass=o.resizerClass,tClass=o.togglerClass,_pane="-"+pane,_open="-open",_closed="-closed",_sliding="-sliding",isShowing=s.isShowing;delete s.isShowing;if(!$P||(!o.resizable&&!o.closable))return;else if(!s.isClosed&&!s.isSliding)return;if(s.isHidden&&!isShowing){show(pane,true);return;}if(c.isLayoutBusy){setFlowCallback("open",pane,slide);return;}if(false===execUserCallback(pane,o.onopen_start))return;c[pane].isMoving=true;c.isLayoutBusy=true;if(s.isSliding&&!slide)bindStopSlidingEvents(pane,false);s.isClosed=false;if(isShowing)s.isHidden=false;setPaneMinMaxSizes(pane);if(s.size>s.maxSize)$P.css(c[pane].sizeType,max(1,cssSize(pane,s.maxSize)));bindStartSlidingEvent(pane,false);if(doFX){lockPaneForFX(pane,true);$P.show(o.fxName_open,o.fxSettings_open,o.fxSpeed_open,function(){lockPaneForFX(pane,false);if(s.isClosed)return;open_2();});}else{$P.show();open_2();}function open_2(){if(!s.isSliding)sizeMidPanes(c[pane].dir=="vert"?"center":"all");if($R){$R.css(edge,cDims[edge]+getPaneSize(pane)).removeClass(rClass+_closed+" "+rClass+_pane+_closed).addClass(rClass+_open+" "+rClass+_pane+_open).addClass(!s.isSliding?"":rClass+_sliding+" "+rClass+_pane+_sliding);if(o.resizable)$R.draggable("enable").css("cursor",o.resizerCursor).attr("title",o.resizerTip);else -$R.css("cursor","default");if($T){$T.removeClass(tClass+_closed+" "+tClass+_pane+_closed).addClass(tClass+_open+" "+tClass+_pane+_open).attr("title",o.togglerTip_open);}sizeHandles("all");}sizeContent(pane);syncPinBtns(pane,!s.isSliding);execUserCallback(pane,o.onopen_end||o.onopen);if(isShowing)execUserCallback(pane,o.onshow_end||o.onshow);execFlowCallback(pane);}};var lockPaneForFX=function(pane,doLock){var $P=$Ps[pane];if(doLock){$P.css({zIndex:c.zIndex.animation});if(pane=="south")$P.css({top:cDims.top+cDims.innerHeight-$P.outerHeight()});else if(pane=="east")$P.css({left:cDims.left+cDims.innerWidth-$P.outerWidth()});}else{if(!state[pane].isSliding)$P.css({zIndex:c.zIndex.pane_normal});if(pane=="south")$P.css({top:"auto"});else if(pane=="east")$P.css({left:"auto"});}};var bindStartSlidingEvent=function(pane,enable){var -o=options[pane],$R=$Rs[pane],trigger=o.slideTrigger_open;if(!$R||!o.slidable)return;if(trigger!="click"&&trigger!="dblclick"&&trigger!="mouseover")trigger="click";$R -[enable?"bind":"unbind"](trigger,slideOpen).css("cursor",(enable?o.sliderCursor:"default")).attr("title",(enable?o.sliderTip:""));};var bindStopSlidingEvents=function(pane,enable){var -o=options[pane],s=state[pane],trigger=o.slideTrigger_close,action=(enable?"bind":"unbind"),$P=$Ps[pane],$R=$Rs[pane];s.isSliding=enable;clearTimer(pane,"closeSlider");$P.css({zIndex:(enable?c.zIndex.sliding:c.zIndex.pane_normal)});$R.css({zIndex:(enable?c.zIndex.sliding:c.zIndex.resizer_normal)});if(trigger!="click"&&trigger!="mouseout")trigger="mouseout";if(enable){$P.bind(trigger,slideClosed);$R.bind(trigger,slideClosed);if(trigger="mouseout"){$P.bind("mouseover",cancelMouseOut);$R.bind("mouseover",cancelMouseOut);}}else{$P.unbind(trigger);$R.unbind(trigger);if(trigger="mouseout"){$P.unbind("mouseover");$R.unbind("mouseover");clearTimer(pane,"closeSlider");}}function cancelMouseOut(evt){clearTimer(pane,"closeSlider");evt.stopPropagation();}};var slideOpen=function(){var pane=$(this).attr("resizer");if(state[pane].isClosed){bindStopSlidingEvents(pane,true);open(pane,true);}};var slideClosed=function(){var -$E=$(this),pane=$E.attr("pane")||$E.attr("resizer"),o=options[pane],s=state[pane];if(s.isClosed||s.isResizing)return;else if(o.slideTrigger_close=="click")close_NOW();else -setTimer(pane,"closeSlider",close_NOW,300);function close_NOW(){bindStopSlidingEvents(pane,false);if(!s.isClosed)close(pane);}};var sizePane=function(pane,size){var -edge=c[pane].edge,dir=c[pane].dir,o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane];setPaneMinMaxSizes(pane);s.minSize=max(s.minSize,o.minSize);if(o.maxSize>0)s.maxSize=min(s.maxSize,o.maxSize);size=max(size,s.minSize);size=min(size,s.maxSize);s.size=size;$R.css(edge,size+cDims[edge]);$P.css(c[pane].sizeType,max(1,cssSize(pane,size)));if(!s.isSliding)sizeMidPanes(dir=="horz"?"all":"center");sizeHandles();sizeContent(pane);execUserCallback(pane,o.onresize_end||o.onresize);};var sizeMidPanes=function(panes,overrideDims,onInit){if(!panes||panes=="all")panes="east,west,center";var d=getPaneDims();if(overrideDims)$.extend(d,overrideDims);$.each(panes.split(","),function(){if(!$Ps[this])return;var -pane=str(this),o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane],hasRoom=true,CSS={};if(pane=="center"){d=getPaneDims();CSS=$.extend({},d);CSS.width=max(1,cssW(pane,CSS.width));CSS.height=max(1,cssH(pane,CSS.height));hasRoom=(CSS.width>1&&CSS.height>1);if($.browser.msie&&(!$.boxModel||$.browser.version<7)){if($Ps.north)$Ps.north.css({width:cssW($Ps.north,cDims.innerWidth)});if($Ps.south)$Ps.south.css({width:cssW($Ps.south,cDims.innerWidth)});}}else{CSS.top=d.top;CSS.bottom=d.bottom;CSS.height=max(1,cssH(pane,d.height));hasRoom=(CSS.height>1);}if(hasRoom){$P.css(CSS);if(s.noRoom){s.noRoom=false;if(s.isHidden)return;else show(pane,!s.isClosed);}if(!onInit){sizeContent(pane);execUserCallback(pane,o.onresize_end||o.onresize);}}else if(!s.noRoom){s.noRoom=true;if(s.isHidden)return;if(onInit){$P.hide();if($R)$R.hide();}else hide(pane);}});};var sizeContent=function(panes){if(!panes||panes=="all")panes=c.allPanes;$.each(panes.split(","),function(){if(!$Cs[this])return;var -pane=str(this),ignore=options[pane].contentIgnoreSelector,$P=$Ps[pane],$C=$Cs[pane],e_C=$C[0],height=cssH($P);;$P.children().each(function(){if(this==e_C)return;var $E=$(this);if(!ignore||!$E.is(ignore))height-=$E.outerHeight();});if(height>0)height=cssH($C,height);if(height<1)$C.hide();else -$C.css({height:height}).show();});};var sizeHandles=function(panes,onInit){if(!panes||panes=="all")panes=c.borderPanes;$.each(panes.split(","),function(){var -pane=str(this),o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane];if(!$P||!$R||(!o.resizable&&!o.closable))return;var -dir=c[pane].dir,_state=(s.isClosed?"_closed":"_open"),spacing=o["spacing"+_state],togAlign=o["togglerAlign"+_state],togLen=o["togglerLength"+_state],paneLen,offset,CSS={};if(spacing==0){$R.hide();return;}else if(!s.noRoom&&!s.isHidden)$R.show();if(dir=="horz"){paneLen=$P.outerWidth();$R.css({width:max(1,cssW($R,paneLen)),height:max(1,cssH($R,spacing)),left:cssNum($P,"left")});}else{paneLen=$P.outerHeight();$R.css({height:max(1,cssH($R,paneLen)),width:max(1,cssW($R,spacing)),top:cDims.top+getPaneSize("north",true)});}if($T){if(togLen==0||(s.isSliding&&o.hideTogglerOnSlide)){$T.hide();return;}else -$T.show();if(!(togLen>0)||togLen=="100%"||togLen>paneLen){togLen=paneLen;offset=0;}else{if(typeof togAlign=="string"){switch(togAlign){case"top":case"left":offset=0;break;case"bottom":case"right":offset=paneLen-togLen;break;case"middle":case"center":default:offset=Math.floor((paneLen-togLen)/2);}}else{var x=parseInt(togAlign);if(togAlign>=0)offset=x;else offset=paneLen-togLen+x;}}var -$TC_o=(o.togglerContent_open?$T.children(".content-open"):false),$TC_c=(o.togglerContent_closed?$T.children(".content-closed"):false),$TC=(s.isClosed?$TC_c:$TC_o);if($TC_o)$TC_o.css("display",s.isClosed?"none":"block");if($TC_c)$TC_c.css("display",s.isClosed?"block":"none");if(dir=="horz"){var width=cssW($T,togLen);$T.css({width:max(0,width),height:max(1,cssH($T,spacing)),left:offset});if($TC)$TC.css("marginLeft",Math.floor((width-$TC.outerWidth())/2));}else{var height=cssH($T,togLen);$T.css({height:max(0,height),width:max(1,cssW($T,spacing)),top:offset});if($TC)$TC.css("marginTop",Math.floor((height-$TC.outerHeight())/2));}}if(onInit&&o.initHidden){$R.hide();if($T)$T.hide();}});};var resizeAll=function(){var -oldW=cDims.innerWidth,oldH=cDims.innerHeight;cDims=state.container=getElemDims($Container);var -checkH=(cDims.innerHeights.maxSize)sizePane(pane,s.maxSize);}});sizeMidPanes("all");sizeHandles("all");};function keyDown(evt){if(!evt)return true;var code=evt.keyCode;if(code<33)return true;var -PANE={38:"north",40:"south",37:"west",39:"east"},isCursorKey=(code>=37&&code<=40),ALT=evt.altKey,SHIFT=evt.shiftKey,CTRL=evt.ctrlKey,pane=false,s,o,k,m,el;if(!CTRL&&!SHIFT)return true;else if(isCursorKey&&options[PANE[code]].enableCursorHotkey)pane=PANE[code];else -$.each(c.borderPanes.split(","),function(i,p){o=options[p];k=o.customHotkey;m=o.customHotkeyModifier;if((SHIFT&&m=="SHIFT")||(CTRL&&m=="CTRL")||(CTRL&&SHIFT)){if(k&&code==(isNaN(k)||k<=9?k.toUpperCase().charCodeAt(0):k)){pane=p;return false;}}});if(!pane)return true;o=options[pane];s=state[pane];if(!o.enableCursorHotkey||s.isHidden||!$Ps[pane])return true;el=evt.target||evt.srcElement;if(el&&SHIFT&&isCursorKey&&(el.tagName=="TEXTAREA"||(el.tagName=="INPUT"&&(code==37||code==39))))return true;toggle(pane);evt.stopPropagation();evt.returnValue=false;return false;};function allowOverflow(elem){if(this&&this.tagName)elem=this;var $P;if(typeof elem=="string")$P=$Ps[elem];else{if($(elem).attr("pane"))$P=$(elem);else $P=$(elem).parents("div[pane]:first");}if(!$P.length)return;var -pane=$P.attr("pane"),s=state[pane];if(s.cssSaved)resetOverflow(pane);if(s.isSliding||s.isResizing||s.isClosed){s.cssSaved=false;return;}var -newCSS={zIndex:(c.zIndex.pane_normal+1)},curCSS={},of=$P.css("overflow"),ofX=$P.css("overflowX"),ofY=$P.css("overflowY");if(of!="visible"){curCSS.overflow=of;newCSS.overflow="visible";}if(ofX&&ofX!="visible"&&ofX!="auto"){curCSS.overflowX=ofX;newCSS.overflowX="visible";}if(ofY&&ofY!="visible"&&ofY!="auto"){curCSS.overflowY=ofX;newCSS.overflowY="visible";}s.cssSaved=curCSS;$P.css(newCSS);$.each(c.allPanes.split(","),function(i,p){if(p!=pane)resetOverflow(p);});};function resetOverflow(elem){if(this&&this.tagName)elem=this;var $P;if(typeof elem=="string")$P=$Ps[elem];else{if($(elem).hasClass("ui-layout-pane"))$P=$(elem);else $P=$(elem).parents("div[pane]:first");}if(!$P.length)return;var -pane=$P.attr("pane"),s=state[pane],CSS=s.cssSaved||{};if(!s.isSliding&&!s.isResizing)$P.css("zIndex",c.zIndex.pane_normal);$P.css(CSS);s.cssSaved=false;};function getBtn(selector,pane,action){var -$E=$(selector),err="Error Adding Button \n\nInvalid ";if(!$E.length)alert(err+"selector: "+selector);else if(c.borderPanes.indexOf(pane)==-1)alert(err+"pane: "+pane);else{var btn=options[pane].buttonClass+"-"+action;$E.addClass(btn+" "+btn+"-"+pane);return $E;}return false;};function addToggleBtn(selector,pane){var $E=getBtn(selector,pane,"toggle");if($E)$E.attr("title",state[pane].isClosed?"Open":"Close").click(function(evt){toggle(pane);evt.stopPropagation();});};function addOpenBtn(selector,pane){var $E=getBtn(selector,pane,"open");if($E)$E.attr("title","Open").click(function(evt){open(pane);evt.stopPropagation();});};function addCloseBtn(selector,pane){var $E=getBtn(selector,pane,"close");if($E)$E.attr("title","Close").click(function(evt){close(pane);evt.stopPropagation();});};function addPinBtn(selector,pane){var $E=getBtn(selector,pane,"pin");if($E){var s=state[pane];$E.click(function(evt){setPinState($(this),pane,(s.isSliding||s.isClosed));if(s.isSliding||s.isClosed)open(pane);else close(pane);evt.stopPropagation();});setPinState($E,pane,(!s.isClosed&&!s.isSliding));c[pane].pins.push(selector);}};function syncPinBtns(pane,doPin){$.each(c[pane].pins,function(i,selector){setPinState($(selector),pane,doPin);});};function setPinState($Pin,pane,doPin){var updown=$Pin.attr("pin");if(updown&&doPin==(updown=="down"))return;var -root=options[pane].buttonClass,class1=root+"-pin",class2=class1+"-"+pane,UP1=class1+"-up",UP2=class2+"-up",DN1=class1+"-down",DN2=class2+"-down";$Pin.attr("pin",doPin?"down":"up").attr("title",doPin?"Un-Pin":"Pin").removeClass(doPin?UP1:DN1).removeClass(doPin?UP2:DN2).addClass(doPin?DN1:UP1).addClass(doPin?DN2:UP2);};var -$Container=$(this).css({overflow:"hidden"}),$Ps={},$Cs={},$Rs={},$Ts={},c=config,cDims=state.container;create();return{options:options,state:state,panes:$Ps,toggle:toggle,open:open,close:close,hide:hide,show:show,resizeContent:sizeContent,sizePane:sizePane,resizeAll:resizeAll,addToggleBtn:addToggleBtn,addOpenBtn:addOpenBtn,addCloseBtn:addCloseBtn,addPinBtn:addPinBtn,allowOverflow:allowOverflow,resetOverflow:resetOverflow,cssWidth:cssW,cssHeight:cssH};}})(jQuery); \ No newline at end of file diff --git a/src/sunstone/public/vendor/jQueryLayout/layout-default-latest.css b/src/sunstone/public/vendor/jQueryLayout/layout-default-latest.css index 8575005874..8bdad95e01 100644 --- a/src/sunstone/public/vendor/jQueryLayout/layout-default-latest.css +++ b/src/sunstone/public/vendor/jQueryLayout/layout-default-latest.css @@ -1,9 +1,9 @@ /* * Default Layout Theme * - * Created for jquery.layout + * Created for jquery.layout * - * Copyright (c) 2010 + * Copyright (c) 2010 * Fabrizio Balliano (http://www.fabrizioballiano.net) * Kevin Dalman (http://allpro.net) * @@ -14,15 +14,26 @@ * NOTE: For best code readability, view this with a fixed-space font and tabs equal to 4-chars */ +/* + * DEFAULT FONT + * Just to make demo-pages look better - not actually relevant to Layout! + */ +body { + font-family: Geneva, Arial, Helvetica, sans-serif; + font-size: 100%; + *font-size: 80%; +} + /* * PANES & CONTENT-DIVs */ .ui-layout-pane { /* all 'panes' */ - background: #f5f5f5; + background: #FFF; + border: 1px solid #BBB; /* DO NOT add scrolling (or padding) to 'panes' that have a content-div, otherwise you may get double-scrollbars - on the pane AND on the content-div */ - padding: 10px; + padding: 10px; overflow: auto; } /* (scrolling) content-div inside pane allows for fixed header(s) and/or footer(s) */ @@ -37,9 +48,8 @@ */ .ui-layout-resizer { /* all 'resizer-bars' */ background: #DDD; - /*border: 1px solid #BBB; - border-width: 0;*/ - border: 1px #BBB solid; + border: 1px solid #BBB; + border-width: 0; } .ui-layout-resizer-drag { /* REAL resizer while resize in progress */ } @@ -49,9 +59,7 @@ otherwise color shifts while dragging when bar can't keep up with mouse */ .ui-layout-resizer-open-hover , /* hover-color to 'resize' */ .ui-layout-resizer-dragging { /* resizer beging 'dragging' */ - border-top: 1px solid #BBB; - border-bottom: 1px solid #BBB; - background: #DDD; + background: #C4E1A4; } .ui-layout-resizer-dragging { /* CLONED resizer being dragged */ border-left: 1px solid #BBB; @@ -73,7 +81,7 @@ opacity: 1.00; /* on-hover, show the resizer-bar normally */ filter: alpha(opacity=100); } - /* sliding resizer - add 'outside-border' to resizer on-hover + /* sliding resizer - add 'outside-border' to resizer on-hover * this sample illustrates how to target specific panes and states */ .ui-layout-resizer-north-sliding-hover { border-bottom-width: 1px; } .ui-layout-resizer-south-sliding-hover { border-top-width: 1px; } @@ -120,7 +128,3 @@ padding-bottom: 0.35ex; /* to 'vertically center' text inside text-span */ } -.ui-layout-resizer-south{ - border-left: 0; - border-right: 0; -} diff --git a/src/sunstone/public/vendor/jQueryUI/NOTICE b/src/sunstone/public/vendor/jQueryUI/NOTICE index ba5558c085..796234964d 100644 --- a/src/sunstone/public/vendor/jQueryUI/NOTICE +++ b/src/sunstone/public/vendor/jQueryUI/NOTICE @@ -2,5 +2,5 @@ THIRD-PARTY SOFTWARE * Author: John Resig (www.sprymedia.co.uk) * Info: http://jquery.com/ - * Copyright: Copyright (c) 2011 John Resig, http://jquery.com/ + * Copyright: Copyright (c) 2012 John Resig, http://jquery.com/ * License: MIT License: See MIT-LICENSE.txt diff --git a/src/sunstone/public/vendor/jQueryUI/ui-bg_flat_0_aaaaaa_40x100.png b/src/sunstone/public/vendor/jQueryUI/images/ui-bg_flat_0_aaaaaa_40x100.png similarity index 100% rename from src/sunstone/public/vendor/jQueryUI/ui-bg_flat_0_aaaaaa_40x100.png rename to src/sunstone/public/vendor/jQueryUI/images/ui-bg_flat_0_aaaaaa_40x100.png diff --git a/src/sunstone/public/vendor/jQueryUI/ui-bg_flat_75_ffffff_40x100.png b/src/sunstone/public/vendor/jQueryUI/images/ui-bg_flat_75_ffffff_40x100.png similarity index 100% rename from src/sunstone/public/vendor/jQueryUI/ui-bg_flat_75_ffffff_40x100.png rename to src/sunstone/public/vendor/jQueryUI/images/ui-bg_flat_75_ffffff_40x100.png diff --git a/src/sunstone/public/vendor/jQueryUI/ui-bg_glass_55_fbf9ee_1x400.png b/src/sunstone/public/vendor/jQueryUI/images/ui-bg_glass_55_fbf9ee_1x400.png similarity index 100% rename from src/sunstone/public/vendor/jQueryUI/ui-bg_glass_55_fbf9ee_1x400.png rename to src/sunstone/public/vendor/jQueryUI/images/ui-bg_glass_55_fbf9ee_1x400.png diff --git a/src/sunstone/public/vendor/jQueryUI/ui-bg_glass_65_ffffff_1x400.png b/src/sunstone/public/vendor/jQueryUI/images/ui-bg_glass_65_ffffff_1x400.png similarity index 100% rename from src/sunstone/public/vendor/jQueryUI/ui-bg_glass_65_ffffff_1x400.png rename to src/sunstone/public/vendor/jQueryUI/images/ui-bg_glass_65_ffffff_1x400.png diff --git a/src/sunstone/public/vendor/jQueryUI/ui-bg_glass_75_dadada_1x400.png b/src/sunstone/public/vendor/jQueryUI/images/ui-bg_glass_75_dadada_1x400.png similarity index 100% rename from src/sunstone/public/vendor/jQueryUI/ui-bg_glass_75_dadada_1x400.png rename to src/sunstone/public/vendor/jQueryUI/images/ui-bg_glass_75_dadada_1x400.png diff --git a/src/sunstone/public/vendor/jQueryUI/ui-bg_glass_75_e6e6e6_1x400.png b/src/sunstone/public/vendor/jQueryUI/images/ui-bg_glass_75_e6e6e6_1x400.png similarity index 100% rename from src/sunstone/public/vendor/jQueryUI/ui-bg_glass_75_e6e6e6_1x400.png rename to src/sunstone/public/vendor/jQueryUI/images/ui-bg_glass_75_e6e6e6_1x400.png diff --git a/src/sunstone/public/vendor/jQueryUI/ui-bg_glass_95_fef1ec_1x400.png b/src/sunstone/public/vendor/jQueryUI/images/ui-bg_glass_95_fef1ec_1x400.png similarity index 100% rename from src/sunstone/public/vendor/jQueryUI/ui-bg_glass_95_fef1ec_1x400.png rename to src/sunstone/public/vendor/jQueryUI/images/ui-bg_glass_95_fef1ec_1x400.png diff --git a/src/sunstone/public/vendor/jQueryUI/ui-bg_highlight-soft_75_cccccc_1x100.png b/src/sunstone/public/vendor/jQueryUI/images/ui-bg_highlight-soft_75_cccccc_1x100.png similarity index 100% rename from src/sunstone/public/vendor/jQueryUI/ui-bg_highlight-soft_75_cccccc_1x100.png rename to src/sunstone/public/vendor/jQueryUI/images/ui-bg_highlight-soft_75_cccccc_1x100.png diff --git a/src/sunstone/public/vendor/jQueryUI/ui-icons_222222_256x240.png b/src/sunstone/public/vendor/jQueryUI/images/ui-icons_222222_256x240.png similarity index 100% rename from src/sunstone/public/vendor/jQueryUI/ui-icons_222222_256x240.png rename to src/sunstone/public/vendor/jQueryUI/images/ui-icons_222222_256x240.png diff --git a/src/sunstone/public/vendor/jQueryUI/ui-icons_2e83ff_256x240.png b/src/sunstone/public/vendor/jQueryUI/images/ui-icons_2e83ff_256x240.png similarity index 100% rename from src/sunstone/public/vendor/jQueryUI/ui-icons_2e83ff_256x240.png rename to src/sunstone/public/vendor/jQueryUI/images/ui-icons_2e83ff_256x240.png diff --git a/src/sunstone/public/vendor/jQueryUI/ui-icons_454545_256x240.png b/src/sunstone/public/vendor/jQueryUI/images/ui-icons_454545_256x240.png similarity index 100% rename from src/sunstone/public/vendor/jQueryUI/ui-icons_454545_256x240.png rename to src/sunstone/public/vendor/jQueryUI/images/ui-icons_454545_256x240.png diff --git a/src/sunstone/public/vendor/jQueryUI/ui-icons_888888_256x240.png b/src/sunstone/public/vendor/jQueryUI/images/ui-icons_888888_256x240.png similarity index 100% rename from src/sunstone/public/vendor/jQueryUI/ui-icons_888888_256x240.png rename to src/sunstone/public/vendor/jQueryUI/images/ui-icons_888888_256x240.png diff --git a/src/sunstone/public/vendor/jQueryUI/ui-icons_cd0a0a_256x240.png b/src/sunstone/public/vendor/jQueryUI/images/ui-icons_cd0a0a_256x240.png similarity index 100% rename from src/sunstone/public/vendor/jQueryUI/ui-icons_cd0a0a_256x240.png rename to src/sunstone/public/vendor/jQueryUI/images/ui-icons_cd0a0a_256x240.png diff --git a/src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.7.custom.css b/src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.16.custom.css similarity index 85% rename from src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.7.custom.css rename to src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.16.custom.css index 15e2706919..0f1a7e770e 100644 --- a/src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.7.custom.css +++ b/src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.16.custom.css @@ -1,7 +1,7 @@ /* - * jQuery UI CSS Framework 1.8.7 + * jQuery UI CSS Framework 1.8.16 * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -42,9 +42,9 @@ /* - * jQuery UI CSS Framework 1.8.7 + * jQuery UI CSS Framework 1.8.16 * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -56,29 +56,29 @@ /* Component containers ----------------------------------*/ -/*.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } -.ui-widget .ui-widget { font-size: 1em; }*/ -/*.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }*/ -.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } +.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } .ui-widget-content a { color: #222222; } -.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } +.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } .ui-widget-header a { color: #222222; } /* Interaction states ----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } .ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } -.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } .ui-widget :active { outline: none; } /* Interaction Cues ----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } @@ -89,14 +89,14 @@ ----------------------------------*/ /* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(ui-icons_222222_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(ui-icons_222222_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(ui-icons_222222_256x240.png); } -.ui-state-default .ui-icon { background-image: url(ui-icons_888888_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(ui-icons_454545_256x240.png); } -.ui-state-active .ui-icon {background-image: url(ui-icons_454545_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(ui-icons_2e83ff_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(ui-icons_cd0a0a_256x240.png); } +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } /* positioning */ .ui-icon-carat-1-n { background-position: 0 0; } @@ -280,29 +280,24 @@ ----------------------------------*/ /* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; } -.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } -.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } -.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } +.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; } +.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } /* Overlays */ -.ui-widget-overlay { background: #575c5b url(ui-bg_flat_0_575c5b_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } -.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* - * jQuery UI Resizable 1.8.7 +.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* + * jQuery UI Resizable 1.8.16 * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Resizable#theming */ .ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; } .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } @@ -312,9 +307,9 @@ .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* - * jQuery UI Selectable 1.8.7 + * jQuery UI Selectable 1.8.16 * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -322,9 +317,9 @@ */ .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } /* - * jQuery UI Accordion 1.8.7 + * jQuery UI Accordion 1.8.16 * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -339,22 +334,23 @@ .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } -.ui-accordion .ui-accordion-content-active { display: block; }/* - * jQuery UI Autocomplete 1.8.7 +.ui-accordion .ui-accordion-content-active { display: block; } +/* + * jQuery UI Autocomplete 1.8.16 * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Autocomplete#theming */ -.ui-autocomplete { position: absolute; cursor: default; } +.ui-autocomplete { position: absolute; cursor: default; } /* workarounds */ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ /* - * jQuery UI Menu 1.8.7 + * jQuery UI Menu 1.8.16 * * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. @@ -393,9 +389,9 @@ margin: -1px; } /* - * jQuery UI Button 1.8.7 + * jQuery UI Button 1.8.16 * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -404,8 +400,8 @@ .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ -.ui-button-icons-only { width: 3.4em; } -button.ui-button-icons-only { width: 3.7em; } +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } /*button text element */ .ui-button .ui-button-text { display: block; line-height: 1.4; } @@ -431,17 +427,17 @@ input.ui-button { padding: .4em 1em; } /* workarounds */ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ /* - * jQuery UI Dialog 1.8.7 + * jQuery UI Dialog 1.8.16 * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Dialog#theming */ .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } -.ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } +.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } @@ -452,9 +448,9 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } .ui-draggable .ui-dialog-titlebar { cursor: move; } /* - * jQuery UI Slider 1.8.7 + * jQuery UI Slider 1.8.16 * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -475,9 +471,9 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } .ui-slider-vertical .ui-slider-range-min { bottom: 0; } .ui-slider-vertical .ui-slider-range-max { top: 0; }/* - * jQuery UI Tabs 1.8.7 + * jQuery UI Tabs 1.8.16 * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -493,9 +489,9 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } .ui-tabs .ui-tabs-hide { display: none !important; } /* - * jQuery UI Datepicker 1.8.7 + * jQuery UI Datepicker 1.8.16 * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -513,7 +509,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } .ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year { width: 49%;} .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } @@ -533,7 +529,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } +.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } /* RTL support */ .ui-datepicker-rtl { direction: rtl; } @@ -560,13 +556,13 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad width: 200px; /*must have*/ height: 200px; /*must have*/ }/* - * jQuery UI Progressbar 1.8.7 + * jQuery UI Progressbar 1.8.16 * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Progressbar#theming */ .ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.16.custom.min.js b/src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.16.custom.min.js new file mode 100644 index 0000000000..14c9064f7f --- /dev/null +++ b/src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.16.custom.min.js @@ -0,0 +1,791 @@ +/*! + * jQuery UI 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.16", +keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({propAttr:c.fn.prop||c.fn.attr,_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d= +this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this, +"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart": +"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight, +outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a, +"tabindex"),d=isNaN(b);return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&& +a.element[0].parentNode)for(var e=0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted= +false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); +;/* + * jQuery UI Position 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Position + */ +(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, +left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= +k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-= +m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left= +d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= +a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), +g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); +;/* + * jQuery UI Draggable 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== +"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= +this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;if(b.iframeFix)d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('
                  ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options; +this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}); +this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true}, +_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b= +false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration, +10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle|| +!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&& +a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent= +this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"), +10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"), +10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top, +(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!= +"hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"), +10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+ +this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&& +!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.leftg[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.topg[3])?h:!(h-this.offset.click.topg[2])?e:!(e-this.offset.click.left=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>= +i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f
                  ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), +top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= +this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", +nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d
                  ');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== +String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection(); +this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){if(!a.disabled){e(this).removeClass("ui-resizable-autohide");b._handles.show()}},function(){if(!a.disabled)if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy(); +var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a= +false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"}); +this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff= +{width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis]; +if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false}, +_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f, +{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries:function(b){var a=this.options,c,d,f;a={minWidth:k(a.minWidth)?a.minWidth:0,maxWidth:k(a.maxWidth)?a.maxWidth:Infinity,minHeight:k(a.minHeight)?a.minHeight:0,maxHeight:k(a.maxHeight)?a.maxHeight: +Infinity};if(this._aspectRatio||b){b=a.minHeight*this.aspectRatio;d=a.minWidth/this.aspectRatio;c=a.maxHeight*this.aspectRatio;f=a.maxWidth/this.aspectRatio;if(b>a.minWidth)a.minWidth=b;if(d>a.minHeight)a.minHeight=d;if(cb.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height,l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&l)b.left=i-a.minWidth;if(d&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left= +null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+ +a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+ +c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]); +b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.16"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(), +10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top- +f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var l=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:l.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(l.css("position"))){c._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType? +e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a= +e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing, +step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement= +e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset; +var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left: +a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top- +d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition, +f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25, +display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b= +e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height= +d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery); +;/* + * jQuery UI Selectable 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), +selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("
                  ")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, +c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting", +c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d= +this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.righti||a.bottomb&&a.rightg&&a.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable"); +this.refresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a=== +"disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&& +!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top, +left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]}; +this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!= +document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a); +return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0], +e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset(); +c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"): +this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null, +dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")}, +toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith(); +if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), +this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h=0;b--){var c=this.items[b];if(!(c.instance!=this.currentContainer&&this.currentContainer&&c.item[0]!=this.currentItem[0])){var e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b= +this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f= +d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")|| +0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out", +a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h- +f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g- +this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this, +this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop", +a,this._uiHash());for(e=0;e li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"); +a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); +if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var h=d.closest(".ui-accordion-header");a.active=h.length?h:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion", +function(f){return a._keydown(f)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(f){a._clickHandler.call(a,f,this);f.preventDefault()})},_createIcons:function(){var a= +this.options;if(a.icons){c("").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"); +this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons(); +b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,h=this.headers.index(a.target),f=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:f=this.headers[(h+1)%d];break;case b.LEFT:case b.UP:f=this.headers[(h-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target); +a.preventDefault()}if(f){c(a.target).attr("tabIndex",-1);c(f).attr("tabIndex",0);f.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+ +c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options; +if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){var h=this.active;j=a.next();g=this.active.next();e={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):j,oldContent:g};var f=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(j,g,e,b,f);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); +if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);a.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(), +e={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:g},j=this.active=c([]);this._toggle(j,g,e)}},_toggle:function(a,b,d,h,f){var g=this,e=g.options;g.toShow=a;g.toHide=b;g.data=d;var j=function(){if(g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&h?{toShow:c([]),toHide:b,complete:j,down:f,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:f,autoHeight:e.autoHeight|| +e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;h=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!h[k]&&!c.easing[k])k="slide";h[k]||(h[k]=function(l){this.slide(l,{easing:k,duration:i||700})});h[k](d)}else{if(e.collapsible&&h)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false", +"aria-selected":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.16", +animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),h=0,f={},g={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){g[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/); +f[i]={value:j[1],unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(g,{step:function(j,i){if(i.prop=="height")h=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=h*f[i.prop].value+f[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide", +paddingTop:"hide",paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery); +;/* + * jQuery UI Autocomplete 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.position.js + */ +(function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.propAttr("readOnly"))){g= +false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!= +a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)}; +this.menu=d("
                    ").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&& +a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"),i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"); +d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&& +b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else this.source= +this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length").data("item.autocomplete",b).append(d("").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, +"\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery); +(function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", +-1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.scrollTop(),c=this.element.height();if(b<0)this.element.scrollTop(g+b);else b>=c&&this.element.scrollTop(g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id"); +this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0);e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else this.activate(b, +this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e,g)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active|| +this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active|| +this.first()?":last":":first"))},hasScroll:function(){return this.element.height()").addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(),e=this.options.icons,f=e.primary&&e.secondary,d=[];if(e.primary||e.secondary){if(this.options.text)d.push("ui-button-text-icon"+(f?"s":e.primary?"-primary":"-secondary"));e.primary&&a.prepend("");e.secondary&&a.append("");if(!this.options.text){d.push(f?"ui-button-icons-only": +"ui-button-icon-only");this.hasTitle||a.attr("title",c)}}else d.push("ui-button-text-only");a.addClass(d.join(" "))}}});b.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(a,c){a==="disabled"&&this.buttons.button("option",a,c);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var a=this.element.css("direction")=== +"ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(a?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(a?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"); +b.Widget.prototype.destroy.call(this)}})})(jQuery); +;/* + * jQuery UI Dialog 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.button.js + * jquery.ui.draggable.js + * jquery.ui.mouse.js + * jquery.ui.position.js + * jquery.ui.resizable.js + */ +(function(c,l){var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false, +position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
                    ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+ +b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&!i.isDefaultPrevented()&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("
                    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g), +h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id", +e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); +a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!== +b.uiDialog[0]){e=c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()};c.ui.dialog.maxZ+=1; +d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target=== +f[0]&&e.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("
                    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("
                    ").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a, +function(){return!(d=true)});if(d){c.each(a,function(f,h){h=c.isFunction(h)?{click:h,text:f}:h;var i=c('').click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.each(h,function(j,k){if(j!=="click")j in o?i[j](k):i.attr(j,k)});c.fn.button&&i.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close", +handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition, +originalSize:f.originalSize,position:f.position,size:f.size}}a=a===l?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize", +f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "): +[a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f); +if(g in m)e=true;if(g in n)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"): +e.removeClass("ui-dialog-disabled");break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a= +this.options,b,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height- +b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.16",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "), +create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&& +c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(b.range==="min"||b.range==="max"?" ui-slider-range-"+b.range:""))}for(var j=c.length;j"); +this.handles=c.add(d(e.join("")).appendTo(a.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle", +g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!a.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");i=a._start(g,l);if(i===false)return}break}m=a.options.step;i=a.options.values&&a.options.values.length? +(h=a.values(l)):(h=a.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=a._valueMin();break;case d.ui.keyCode.END:h=a._valueMax();break;case d.ui.keyCode.PAGE_UP:h=a._trimAlignValue(i+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=a._trimAlignValue(i-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===a._valueMax())return;h=a._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===a._valueMin())return;h=a._trimAlignValue(i- +m);break}a._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(g,k);a._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy(); +return this},_mouseCapture:function(a){var b=this.options,c,f,e,j,g;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(b.range===true&&this.values(1)===b.min){g+=1;e=d(this.handles[g])}if(this._start(a,g)===false)return false; +this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();b=e.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-e.width()/2,top:a.pageY-b.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(a,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(a){var b= +this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;if(this.orientation==="horizontal"){b= +this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b); +c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var f;if(this.options.values&&this.options.values.length){f=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>f||b===1&&c1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a= +this.options.range,b=this.options,c=this,f=!this._animateOff?b.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({width:e- +g+"%"},{queue:false,duration:b.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:b.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[f?"animate":"css"]({width:e+"%"}, +b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.16"})})(jQuery); +;/* + * jQuery UI Tabs 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
                    ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
                  • #{label}
                  • "},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&& +e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b= +d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]|| +(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); +this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected= +this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); +if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); +this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+ +g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal", +function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")}; +this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected= +-1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier."; +d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e= +d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b, +e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]); +j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove(); +if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null, +this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this}, +load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c, +"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this}, +url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.16"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k'))}function N(a){return a.bind("mouseout", +function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");b.length&&b.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(d.datepicker._isDisabledDatepicker(J.inline?a.parent()[0]:J.input[0])||!b.length)){b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"); +b.addClass("ui-state-hover");b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover");b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")}})}function H(a,b){d.extend(a,b);for(var c in b)if(b[c]==null||b[c]==C)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.16"}});var B=(new Date).getTime(),J;d.extend(M.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv}, +setDefaults:function(a){H(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g, +"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('
                    '))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker", +function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b);b.settings.disabled&&this._disableDatepicker(a)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d(''+c+"");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c== +"focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('').addClass(this._triggerClass).html(f==""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker(): +d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a, +b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.settings.disabled&&this._disableDatepicker(a);b.dpDiv.css("display","block")}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+= +1;this._dialogInput=d('');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/ +2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b= +d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e= +a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a, +"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f== +a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input", +a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!=b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst);d.datepicker._curInst.dpDiv.stop(true,true)}var c=d.datepicker._get(b,"beforeShow");c=c?c.apply(a,[a,b]):{};if(c!==false){H(b.settings,c);b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value= +"";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b); +c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing= +true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}); +a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&& +!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(), +h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b= +this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b); +this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")}, +_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"): +0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e["selected"+(c=="M"? +"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a); +this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField"); +if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"? +b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=A+1-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd", +COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames: +null)||this._defaults.monthNames;var i=function(o){(o=k+1 +12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&& +a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay? +new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a)); +n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+n+"";var s=this._get(a,"nextText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m, +g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+s+"":f?"":''+s+"";j=this._get(a,"currentText");s=this._get(a,"gotoCurrent")&& +a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
                    '+(c?h:"")+(this._isInRange(a,s)?'":"")+(c?"":h)+"
                    ":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"dayNamesMin"),A=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x1)switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break}y+='">'}y+='
                    '+(/all|left/.test(t)&& +x==0?c?f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,A,v)+'
                    ';var z=j?'":"";for(t=0;t<7;t++){var r=(t+h)%7;z+="=5?' class="ui-datepicker-week-end"':"")+'>'+q[r]+""}y+=z+"";z=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay, +z);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7);this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q";var R=!j?"":'";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||!I[0]||k&&ro;R+='";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r)}y+=R+""}g++;if(g>11){g=0;m++}y+="
                    '+this._get(a,"weekHeader")+"
                    '+this._get(a,"calculateWeek")(r)+""+(F&&!D?" ":L?''+ +r.getDate()+"":''+r.getDate()+"")+"
                    "+(l?""+(i[0]>0&&G==i[1]-1?'
                    ':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'': +"");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='
                    ',o="";if(h||!j)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(k+=o+(h||!(j&&l)?" ":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+=''+c+"";else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b, +e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="
                    ";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c=="Y"?b:0),f=a.drawMonth+ +(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b)b.apply(a.input? +a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c, +e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a, +"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length)return this; +if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));return this.each(function(){typeof a== +"string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.16";window["DP_jQuery_"+B]=d})(jQuery); +;/* + * jQuery UI Progressbar 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("
                    ").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); +this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100* +this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.16"})})(jQuery); +;/* + * jQuery UI Effects 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/ + */ +jQuery.effects||function(f,j){function m(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], +16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return n.transparent;return n[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return m(b)}function o(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, +a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function p(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d= +a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function l(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor", +"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=m(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0, +0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211, +211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},q=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b, +d){if(f.isFunction(b)){d=b;b=null}return this.queue(function(){var e=f(this),g=e.attr("style")||" ",h=p(o.call(this)),r,v=e.attr("class");f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});r=p(o.call(this));e.attr("class",v);e.animate(u(h,r),{queue:false,duration:a,easing:b,complete:function(){f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments);f.dequeue(this)}})})}; +f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this, +[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.16",save:function(c,a){for(var b=0;b").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}), +d=document.activeElement;c.wrap(b);if(c[0]===d||f.contains(c[0],d))f(d).focus();b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(e,g){a[g]=c.css(g);if(isNaN(parseInt(a[g],10)))a[g]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){var a,b=document.activeElement; +if(c.parent().is(".ui-effects-wrapper")){a=c.parent().replaceWith(c);if(c[0]===b||f.contains(c[0],b))f(b).focus();return a}return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)}); +return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this, +arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/ +2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b, +d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c, +a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b, +d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ +e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); +;/* + * jQuery UI Effects Fade 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fade + * + * Depends: + * jquery.effects.core.js + */ +(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery); +;/* + * jQuery UI Effects Fold 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fold + * + * Depends: + * jquery.effects.core.js + */ +(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1], +10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); +;/* + * jQuery UI Effects Highlight 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Highlight + * + * Depends: + * jquery.effects.core.js + */ +(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& +this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); +;/* + * jQuery UI Effects Pulsate 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Pulsate + * + * Depends: + * jquery.effects.core.js + */ +(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); +b.dequeue()})})}})(jQuery); +; \ No newline at end of file diff --git a/src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.7.custom.min.js b/src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.7.custom.min.js deleted file mode 100644 index b03a87e844..0000000000 --- a/src/sunstone/public/vendor/jQueryUI/jquery-ui-1.8.7.custom.min.js +++ /dev/null @@ -1,781 +0,0 @@ -/*! - * jQuery UI 1.8.7 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI - */ -(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.7",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106, -NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this, -"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position"); -if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f, -"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h, -d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}}); -c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a); -return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&c.data(a.target,this.widgetName+".preventClickEvent", -true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); -;/* - * jQuery UI Position 1.8.7 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Position - */ -(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, -left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= -k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+parseInt(c.curCSS(this,"marginRight",true))||0,w=m+q+parseInt(c.curCSS(this,"marginBottom",true))||0,i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-=m/2; -i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left= -d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= -a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), -g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); -;/* - * jQuery UI Draggable 1.8.7 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Draggables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== -"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= -this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top- -this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions(); -d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis|| -this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode)return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element, -b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this== -a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]|| -0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], -this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top- -(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment== -"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[(a.containment=="document"?0:d(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(a.containment=="document"?0:d(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"? -0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"), -10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor== -Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop(): -f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY; -if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.leftthis.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/ -b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?e:!(e-this.offset.click.left').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})}, -stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!= -document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>= -i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), -top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= -this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", -nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== -String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),k=0;k=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,k);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection(); -this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){e(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}; -if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(), -d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset= -this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio: -this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize", -b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height; -f={width:c.size.width-(f?0:c.sizeDiff.width),height:c.size.height-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop", -b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(l(b.left))this.position.left=b.left;if(l(b.top))this.position.top=b.top;if(l(b.height))this.size.height=b.height;if(l(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top= -a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,d=l(b.width)&&a.maxWidth&&a.maxWidthb.width,h=l(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height, -k=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&k)b.left=i-a.minWidth;if(d&&k)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+ -a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this, -arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable, -{version:"1.8.7"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize, -function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var k=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:k.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n= -(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(k.css("position"))){c._revertToRelativePosition=true;k.css({position:"absolute",top:"auto",left:"auto"})}k.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition= -false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left- -a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize", -b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top", -"Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset, -f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left= -a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+ -a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&& -e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative", -height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width= -d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},l=function(b){return!isNaN(parseInt(b,10))}})(jQuery); -;/* - * jQuery UI Selectable 1.8.7 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Selectables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), -selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("
                    ")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, -c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting", -c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d= -this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.righti||a.bottomb&&a.rightg&&a.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable"); -this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this, -arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem= -c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset, -{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment(); -if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start", -a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute"); -if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a, -c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]== -document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp();this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate", -null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem): -d(this.domPosition.parent).prepend(this.currentItem);return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute|| -"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")}, -_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!= -this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a= -this.currentItem.find(":data(sortable-item)"),b=0;b=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable"); -if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h= -0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width= -this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f}, -update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b= -null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this)); -this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])? -g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive", -g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over= -0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"); -a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); -if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var f=d.closest(".ui-accordion-header");a.active=f.length?f:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion", -function(g){return a._keydown(g)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(g){a._clickHandler.call(a,g,this);g.preventDefault()})},_createIcons:function(){var a=this.options;if(a.icons){c("").addClass("ui-icon "+ -a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex"); -this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons(); -b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,f=this.headers.index(a.target),g=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:g=this.headers[(f+1)%d];break;case b.LEFT:case b.UP:g=this.headers[(f-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target); -a.preventDefault()}if(g){c(a.target).attr("tabIndex",-1);c(g).attr("tabIndex",0);g.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+ -c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options; -if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected); -a.next().addClass("ui-accordion-content-active")}h=a.next();f=this.active.next();g={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):h,oldContent:f};d=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(h,f,g,b,d)}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); -this.active.next().addClass("ui-accordion-content-active");var f=this.active.next(),g={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:f},h=this.active=c([]);this._toggle(h,f,g)}},_toggle:function(a,b,d,f,g){var h=this,e=h.options;h.toShow=a;h.toHide=b;h.data=d;var j=function(){if(h)return h._completed.apply(h,arguments)};h._trigger("changestart",null,h.data);h.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&f?{toShow:c([]),toHide:b,complete:j, -down:g,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:g,autoHeight:e.autoHeight||e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;f=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!f[k]&&!c.easing[k])k="slide";f[k]||(f[k]=function(l){this.slide(l,{easing:k,duration:i||700})}); -f[k](d)}else{if(e.collapsible&&f)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.7",animations:{slide:function(a, -b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),f=0,g={},h={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){h[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/);g[i]={value:j[1], -unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(h,{step:function(j,i){if(i.prop=="height")f=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=f*g[i.prop].value+g[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide",paddingTop:"hide", -paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery); -;/* - * jQuery UI Autocomplete 1.8.7 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Autocomplete - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - * jquery.ui.position.js - */ -(function(d){d.widget("ui.autocomplete",{options:{appendTo:"body",delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},_create:function(){var a=this,b=this.element[0].ownerDocument,f;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.attr("readonly"))){f=false;var e=d.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:a._move("previousPage", -c);break;case e.PAGE_DOWN:a._move("nextPage",c);break;case e.UP:a._move("previous",c);c.preventDefault();break;case e.DOWN:a._move("next",c);c.preventDefault();break;case e.ENTER:case e.NUMPAD_ENTER:if(a.menu.active){f=true;c.preventDefault()}case e.TAB:if(!a.menu.active)return;a.menu.select(c);break;case e.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay); -break}}}).bind("keypress.autocomplete",function(c){if(f){f=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)};this.menu=d("
                      ").addClass("ui-autocomplete").appendTo(d(this.options.appendTo|| -"body",b)[0]).mousedown(function(c){var e=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(g){g.target!==a.element[0]&&g.target!==e&&!d.ui.contains(e,g.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,e){e=e.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:e})&&/^key/.test(c.originalEvent.type)&&a.element.val(e.value)},selected:function(c,e){var g=e.item.data("item.autocomplete"), -h=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=h;setTimeout(function(){a.previous=h;a.selectedItem=g},1)}false!==a._trigger("select",c,{item:g})&&a.element.val(g.value);a.term=a.element.val();a.close(c);a.selectedItem=g},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"); -this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0])},_initSource:function(){var a=this,b,f;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,e){e(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string"){f=this.options.source;this.source= -function(c,e){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:f,data:c,dataType:"json",success:function(g,h,i){i===a.xhr&&e(g);a.xhr=null},error:function(g){g===a.xhr&&e([]);a.xhr=null}})}}else this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length").data("item.autocomplete",b).append(d("").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}}); -d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(a,b){var f=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return f.test(c.label||c.value||c)})}})})(jQuery); -(function(d){d.widget("ui.menu",{_create:function(){var a=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(b){if(d(b.target).closest(".ui-menu-item a").length){b.preventDefault();a.select(b)}});this.refresh()},refresh:function(){var a=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", --1).mouseenter(function(b){a.activate(b,d(this).parent())}).mouseleave(function(){a.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var f=b.offset().top-this.element.offset().top,c=this.element.attr("scrollTop"),e=this.element.height();if(f<0)this.element.attr("scrollTop",c+f);else f>=e&&this.element.attr("scrollTop",c+f-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",a,{item:b})}, -deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null}},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,f){if(this.active){a=this.active[a+"All"](".ui-menu-item").eq(0); -a.length?this.activate(f,a):this.activate(f,this.element.children(b))}else this.activate(f,this.element.children(b))},nextPage:function(a){if(this.hasScroll())if(!this.active||this.last())this.activate(a,this.element.children(".ui-menu-item:first"));else{var b=this.active.offset().top,f=this.element.height(),c=this.element.children(".ui-menu-item").filter(function(){var e=d(this).offset().top-b-f+d(this).height();return e<10&&e>-10});c.length||(c=this.element.children(".ui-menu-item:last"));this.activate(a, -c)}else this.activate(a,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(a){if(this.hasScroll())if(!this.active||this.first())this.activate(a,this.element.children(".ui-menu-item:last"));else{var b=this.active.offset().top,f=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-b+f-d(this).height();return c<10&&c>-10});result.length||(result=this.element.children(".ui-menu-item:first")); -this.activate(a,result)}else this.activate(a,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary;if(d.primary||d.secondary){b.addClass("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary"));d.primary&&b.prepend("");d.secondary&&b.append("");if(!this.options.text){b.addClass(e?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary"); -this.hasTitle||b.attr("title",c)}}else b.addClass("ui-button-text-only")}}});a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end()}, -destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");a.Widget.prototype.destroy.call(this)}})})(jQuery); -;/* - * jQuery UI Dialog 1.8.7 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Dialog - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - * jquery.ui.button.js - * jquery.ui.draggable.js - * jquery.ui.mouse.js - * jquery.ui.position.js - * jquery.ui.resizable.js - */ -(function(c,j){var k={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},l={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&& -c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
                      ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex", --1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("
                      ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role", -"button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id",e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose= -b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");a.uiDialog.remove();a.originalTitle&& -a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!==b.uiDialog[0]){e=c(this).css("z-index"); -isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=1;d.uiDialog.css("z-index",c.ui.dialog.maxZ); -d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target===f[0]&&e.shiftKey){g.focus(1);return false}}}); -c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("
                      ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("
                      ").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,function(){return!(d=true)});if(d){c.each(a,function(f, -h){h=c.isFunction(h)?{click:h,text:f}:h;f=c('').attr(h,true).unbind("click").click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.fn.button&&f.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g= -d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition,originalSize:f.originalSize, -position:f.position,size:f.size}}a=a===j?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize",f,b(h))},stop:function(f, -h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):[a[0],a[1]];if(b.length=== -1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f);if(g in k)e=true;if(g in -l)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"):e.removeClass("ui-dialog-disabled"); -break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a=this.options,b,d,e= -this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height-b,0));this.uiDialog.is(":data(resizable)")&& -this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.7",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(a){if(this.instances.length=== -0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(), -height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight); -b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a");if(!a.values)a.values=[this._valueMin(),this._valueMin()];if(a.values.length&&a.values.length!==2)a.values=[a.values[0],a.values[0]]}else this.range=d("
                      ");this.range.appendTo(this.element).addClass("ui-slider-range");if(a.range==="min"||a.range==="max")this.range.addClass("ui-slider-range-"+a.range);this.range.addClass("ui-widget-header")}d(".ui-slider-handle",this.element).length===0&&d("").appendTo(this.element).addClass("ui-slider-handle"); -if(a.values&&a.values.length)for(;d(".ui-slider-handle",this.element).length").appendTo(this.element).addClass("ui-slider-handle");this.handles=d(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){a.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(a.disabled)d(this).blur(); -else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(c){d(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var e=true,f=d(this).data("index.ui-slider-handle"),h,g,i;if(!b.options.disabled){switch(c.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:e= -false;if(!b._keySliding){b._keySliding=true;d(this).addClass("ui-state-active");h=b._start(c,f);if(h===false)return}break}i=b.options.step;h=b.options.values&&b.options.values.length?(g=b.values(f)):(g=b.value());switch(c.keyCode){case d.ui.keyCode.HOME:g=b._valueMin();break;case d.ui.keyCode.END:g=b._valueMax();break;case d.ui.keyCode.PAGE_UP:g=b._trimAlignValue(h+(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:g=b._trimAlignValue(h-(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(h=== -b._valueMax())return;g=b._trimAlignValue(h+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(h===b._valueMin())return;g=b._trimAlignValue(h-i);break}b._slide(c,f,g);return e}}).keyup(function(c){var e=d(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(c,e);b._change(c,e);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"); -this._mouseDestroy();return this},_mouseCapture:function(b){var a=this.options,c,e,f,h,g;if(a.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:b.pageX,y:b.pageY});e=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(i){var j=Math.abs(c-h.values(i));if(e>j){e=j;f=d(this);g=i}});if(a.range===true&&this.values(1)===a.min){g+=1;f=d(this.handles[g])}if(this._start(b, -g)===false)return false;this._mouseSliding=true;h._handleIndex=g;f.addClass("ui-state-active").focus();a=f.offset();this._clickOffset=!d(b.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:b.pageX-a.left-f.width()/2,top:b.pageY-a.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(b,g,c);return this._animateOff=true},_mouseStart:function(){return true}, -_mouseDrag:function(b){var a=this._normValueFromMouse({x:b.pageX,y:b.pageY});this._slide(b,this._handleIndex,a);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(b){var a; -if(this.orientation==="horizontal"){a=this.elementSize.width;b=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{a=this.elementSize.height;b=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}a=b/a;if(a>1)a=1;if(a<0)a=0;if(this.orientation==="vertical")a=1-a;b=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+a*b)},_start:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value= -this.values(a);c.values=this.values()}return this._trigger("start",b,c)},_slide:function(b,a,c){var e;if(this.options.values&&this.options.values.length){e=this.values(a?0:1);if(this.options.values.length===2&&this.options.range===true&&(a===0&&c>e||a===1&&c1){this.options.values[b]=this._trimAlignValue(a);this._refreshValue();this._change(null,b)}if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var a=this.options.step>0?this.options.step:1,c=(b-this._valueMin())%a;alignValue=b-c;if(Math.abs(c)*2>=a)alignValue+=c>0?a:-a;return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max}, -_refreshValue:function(){var b=this.options.range,a=this.options,c=this,e=!this._animateOff?a.animate:false,f,h={},g,i,j,l;if(this.options.values&&this.options.values.length)this.handles.each(function(k){f=(c.values(k)-c._valueMin())/(c._valueMax()-c._valueMin())*100;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";d(this).stop(1,1)[e?"animate":"css"](h,a.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(k===0)c.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},a.animate); -if(k===1)c.range[e?"animate":"css"]({width:f-g+"%"},{queue:false,duration:a.animate})}else{if(k===0)c.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},a.animate);if(k===1)c.range[e?"animate":"css"]({height:f-g+"%"},{queue:false,duration:a.animate})}g=f});else{i=this.value();j=this._valueMin();l=this._valueMax();f=l!==j?(i-j)/(l-j)*100:0;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](h,a.animate);if(b==="min"&&this.orientation==="horizontal")this.range.stop(1, -1)[e?"animate":"css"]({width:f+"%"},a.animate);if(b==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:a.animate});if(b==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},a.animate);if(b==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:a.animate})}}});d.extend(d.ui.slider,{version:"1.8.7"})})(jQuery); -;/* - * jQuery UI Tabs 1.8.7 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Tabs - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
                      ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
                    • #{label}
                    • "},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&& -e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b= -d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]|| -(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); -this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected= -this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); -if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); -this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+ -g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal", -function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")}; -this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected= --1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier."; -d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e= -d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b, -e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]); -j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove(); -if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null, -this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this}, -load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c, -"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this}, -url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.7"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k')}function E(a,b){d.extend(a,b);for(var c in b)if(b[c]== -null||b[c]==G)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.7"}});var y=(new Date).getTime();d.extend(K.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){E(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase(); -f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('
                      ')}}, -_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&& -b.append.remove();if(c){b.append=d(''+c+"");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('').addClass(this._triggerClass).html(f== -""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a, -c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b), -true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}E(a.settings,e||{}); -b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass); -this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup", -this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs, -function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null: -f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true}, -_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");E(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos= -d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b, -c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&& -d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a));var e=a.dpDiv.find("iframe.ui-datepicker-cover");e.length&&e.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout", -function(){d(this).removeClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!= --1&&d(this).addClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a, -"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input.focus();if(a.yearshtml){var f=a.yearshtml;setTimeout(function(){f===a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);f=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]}, -_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e- -g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1);)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]? -b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")}, -_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"): -0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear= -false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay= -d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a); -else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b= -a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;for(var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff,f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames, -j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=z+1-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}w=this._daylightSavingAdjust(new Date(c,j-1,l));if(w.getFullYear()!=c||w.getMonth()+1!=j||w.getDate()!=l)throw"Invalid date";return w},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y", -RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay= -a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(), -b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n= -this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+n+"";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+r+"":f?"":''+r+"";j=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,r,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
                      '+(c?h:"")+(this._isInRange(a,r)?'":"")+(c?"":h)+"
                      ":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z= -this._get(a,"monthNames"),w=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),v=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var L=this._getDefaultDate(a),I="",C=0;C1)switch(D){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]- -1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='
                      '+(/all|left/.test(t)&&C==0?c?f:n:"")+(/all|right/.test(t)&&C==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,C>0||D>0,z,w)+'
                      ';var A=j?'":"";for(t=0;t<7;t++){var q= -(t+h)%7;A+="=5?' class="ui-datepicker-week-end"':"")+'>'+s[q]+""}x+=A+"";A=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,A);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;A=l?6:Math.ceil((t+A)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var O=0;O";var P=!j?"":'";for(t=0;t<7;t++){var F= -p?p.apply(a.input?a.input[0]:null,[q]):[true,""],B=q.getMonth()!=g,J=B&&!H||!F[0]||k&&qo;P+='";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+= -P+""}g++;if(g>11){g=0;m++}x+="
                      '+this._get(a,"weekHeader")+"
                      '+this._get(a,"calculateWeek")(q)+""+(B&&!v?" ":J?''+q.getDate()+"":''+q.getDate()+"")+"
                      "+(l?""+(i[0]>0&&D==i[1]-1?'
                      ':""):"");M+=x}I+=M}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'':"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='
                      ', -o="";if(h||!j)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(k+=o+(h||!(j&& -l)?" ":""));a.yearshtml="";if(h||!l)k+=''+c+"";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='";if(d.browser.mozilla)k+='";else{k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="
                      ";return k},_adjustInstDate:function(a,b,c){var e= -a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a, -"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a); -c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a, -"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker= -function(a){if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b)); -return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new K;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.7";window["DP_jQuery_"+y]=d})(jQuery); -;/* - * jQuery UI Progressbar 1.8.7 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Progressbar - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("
                      ").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); -this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100* -this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.7"})})(jQuery); -;/* - * jQuery UI Effects 1.8.7 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/ - */ -jQuery.effects||function(f,j){function n(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], -16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return o.transparent;return o[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return n(b)}function p(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, -a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function q(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d= -a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function m(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor", -"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=n(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var o={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0, -0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211, -211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},r=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b, -d){if(f.isFunction(b)){d=b;b=null}return this.each(function(){f.queue(this,"fx",function(){var e=f(this),g=e.attr("style")||" ",h=q(p.call(this)),l,v=e.attr("className");f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});l=q(p.call(this));e.attr("className",v);e.animate(u(h,l),a,b,function(){f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments)});h=f.queue(this);l= -h.splice(h.length-1,1)[0];h.splice(1,0,l);f.dequeue(this)})})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c}, -b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.7",save:function(c,a){for(var b=0;b").addClass("ui-effects-wrapper").css({fontSize:"100%", -background:"transparent",border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c); -return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(m(c))return this._show.apply(this,arguments); -else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(m(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(m(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c), -b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c, -a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c, -a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a== -e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ -e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); -;/* - * jQuery UI Effects Fade 1.8.7 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Fade - * - * Depends: - * jquery.effects.core.js - */ -(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery); -;/* - * jQuery UI Effects Fold 1.8.7 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Fold - * - * Depends: - * jquery.effects.core.js - */ -(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","left"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],10)/100* -f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); -;/* - * jQuery UI Effects Highlight 1.8.7 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Highlight - * - * Depends: - * jquery.effects.core.js - */ -(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& -this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); -;/* - * jQuery UI Effects Pulsate 1.8.7 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Pulsate - * - * Depends: - * jquery.effects.core.js - */ -(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); -b.dequeue()})})}})(jQuery); -; \ No newline at end of file diff --git a/src/sunstone/public/vendor/jQueryUI/ui-bg_flat_0_575c5b_40x100.png b/src/sunstone/public/vendor/jQueryUI/ui-bg_flat_0_575c5b_40x100.png deleted file mode 100644 index f6faa0f3d8980d9bc7e3f63d0cb999d86d8d4810..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 224 zcmeAS@N?(olHy`uVBq!ia0vp^8bF-F!3HG1q!d*FDaPU;cPEB*=VV?2Ic!PZ?k+$Y z2!1;6t_M<_1s;*b3=G`DAk4@xYmNj^kiEpy*OmP?lMs(6)03DlDL|nFPZ!6KjC*g- z88R{`a4;AwSmdKI;Vst E0KIN6asU7T diff --git a/src/sunstone/public/vendor/jQueryUI/ui-bg_flat_0_8f9392_40x100.png b/src/sunstone/public/vendor/jQueryUI/ui-bg_flat_0_8f9392_40x100.png deleted file mode 100644 index 1e8453f2559e902b6e047225328c1de62c5c6dbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 224 zcmeAS@N?(olHy`uVBq!ia0vp^8bF-F!3HG1q!d*FDaPU;cPEB*=VV?2Ic!PZ?k+$Y z2!1;6t_M<_1s;*b3=G`DAk4@xYmNj^kiEpy*OmP?lMs)9)ke)7`+-6Uo-U3d8Ta0v z+sMnHz` - + diff --git a/src/sunstone/templates/login_x509.html b/src/sunstone/templates/login_x509.html index 790e52028c..a0b1cd0614 100644 --- a/src/sunstone/templates/login_x509.html +++ b/src/sunstone/templates/login_x509.html @@ -5,7 +5,7 @@ - + diff --git a/src/sunstone/views/index.erb b/src/sunstone/views/index.erb index bf081e72a8..9140aafa6e 100644 --- a/src/sunstone/views/index.erb +++ b/src/sunstone/views/index.erb @@ -6,15 +6,15 @@ - + - + - - + + From d756ffe0623dcab37cd50db6ed098318505826dd Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Tue, 29 Nov 2011 17:02:43 +0100 Subject: [PATCH 076/157] Feature: Added LDAP drivers for OpenNebula. Contributed by C12G --- install.sh | 6 ++ share/etc/oned.conf | 4 +- src/authm_mad/remotes/ldap/authenticate | 63 ++++++++++++ src/authm_mad/remotes/ldap/ldap_auth.conf | 35 +++++++ src/authm_mad/remotes/ldap/ldap_auth.rb | 96 +++++++++++++++++++ .../remotes/ldap/test/ldap_auth_spec.rb | 70 ++++++++++++++ 6 files changed, 272 insertions(+), 2 deletions(-) create mode 100755 src/authm_mad/remotes/ldap/authenticate create mode 100644 src/authm_mad/remotes/ldap/ldap_auth.conf create mode 100644 src/authm_mad/remotes/ldap/ldap_auth.rb create mode 100644 src/authm_mad/remotes/ldap/test/ldap_auth_spec.rb diff --git a/install.sh b/install.sh index ef5202d024..669dfeee3c 100755 --- a/install.sh +++ b/install.sh @@ -234,6 +234,7 @@ VAR_DIRS="$VAR_LOCATION/remotes \ $VAR_LOCATION/remotes/auth/plain \ $VAR_LOCATION/remotes/auth/ssh \ $VAR_LOCATION/remotes/auth/x509 \ + $VAR_LOCATION/remotes/auth/ldap \ $VAR_LOCATION/remotes/auth/server_x509 \ $VAR_LOCATION/remotes/auth/server_cipher \ $VAR_LOCATION/remotes/auth/quota \ @@ -335,6 +336,7 @@ INSTALL_FILES=( IM_PROBES_GANGLIA_FILES:$VAR_LOCATION/remotes/im/ganglia.d AUTH_SSH_FILES:$VAR_LOCATION/remotes/auth/ssh AUTH_X509_FILES:$VAR_LOCATION/remotes/auth/x509 + AUTH_LDAP_FILES:$VAR_LOCATION/remotes/auth/ldap AUTH_SERVER_X509_FILES:$VAR_LOCATION/remotes/auth/server_x509 AUTH_SERVER_CIPHER_FILES:$VAR_LOCATION/remotes/auth/server_cipher AUTH_DUMMY_FILES:$VAR_LOCATION/remotes/auth/dummy @@ -519,6 +521,7 @@ RUBY_LIB_FILES="src/mad/ruby/ActionManager.rb \ src/authm_mad/remotes/quota/quota.rb \ src/authm_mad/remotes/server_x509/server_x509_auth.rb \ src/authm_mad/remotes/server_cipher/server_cipher_auth.rb \ + src/authm_mad/remotes/ldap/ldap_auth.rb \ src/authm_mad/remotes/x509/x509_auth.rb" #----------------------------------------------------------------------------- @@ -632,6 +635,8 @@ AUTH_SERVER_X509_FILES="src/authm_mad/remotes/server_x509/authenticate" AUTH_X509_FILES="src/authm_mad/remotes/x509/authenticate" +AUTH_LDAP_FILES="src/authm_mad/remotes/ldap/authenticate" + AUTH_SSH_FILES="src/authm_mad/remotes/ssh/authenticate" AUTH_DUMMY_FILES="src/authm_mad/remotes/dummy/authenticate" @@ -766,6 +771,7 @@ HM_ETC_FILES="src/hm_mad/hmrc" AUTH_ETC_FILES="src/authm_mad/remotes/server_x509/server_x509_auth.conf \ src/authm_mad/remotes/quota/quota.conf \ + src/authm_mad/remotes/ldap/ldap_auth.conf \ src/authm_mad/remotes/x509/x509_auth.conf" #------------------------------------------------------------------------------- diff --git a/share/etc/oned.conf b/share/etc/oned.conf index 493890978d..2055202425 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -591,8 +591,8 @@ HM_MAD = [ AUTH_MAD = [ executable = "one_auth_mad", - arguments = "--authn ssh,x509,server_cipher,server_x509" -# arguments = "--authz quota --authn ssh,x509,server_cipher,server_x509" + arguments = "--authn ssh,x509,ldap,server_cipher,server_x509" +# arguments = "--authz quota --authn ssh,x509,ldap,server_cipher,server_x509" ] SESSION_EXPIRATION_TIME = 900 diff --git a/src/authm_mad/remotes/ldap/authenticate b/src/authm_mad/remotes/ldap/authenticate new file mode 100755 index 0000000000..90501553f1 --- /dev/null +++ b/src/authm_mad/remotes/ldap/authenticate @@ -0,0 +1,63 @@ +#!/usr/bin/ruby + +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +ONE_LOCATION=ENV["ONE_LOCATION"] + +if !ONE_LOCATION + RUBY_LIB_LOCATION="/usr/lib/one/ruby" + ETC_LOCATION="/etc/one/" +else + RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" + ETC_LOCATION=ONE_LOCATION+"/etc/" +end + +$: << RUBY_LIB_LOCATION + +require 'yaml' +require 'ldap_auth' + +user=ARGV[0] +pass=ARGV[1] +secret=ARGV[2] + +options=YAML.load(File.read(ETC_LOCATION+'/auth/ldap_auth.conf')) + +ldap=LdapAuth.new(options) + +user_name=ldap.find_user(user) + +if !user_name + STDERR.puts "User #{user} not found" + exit(-1) +end + +if options[:group] + if !ldap.is_in_group?(user_name, options[:group]) + STDERR.puts "User #{user} is not in group #{options[:group]}" + exit(-1) + end +end + +if ldap.authenticate(user_name, secret) + puts "#{user} #{user_name}" + exit(0) +else + STDERR.puts "Bad user/password" + exit(-1) +end + diff --git a/src/authm_mad/remotes/ldap/ldap_auth.conf b/src/authm_mad/remotes/ldap/ldap_auth.conf new file mode 100644 index 0000000000..8504df1ce8 --- /dev/null +++ b/src/authm_mad/remotes/ldap/ldap_auth.conf @@ -0,0 +1,35 @@ +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +# Ldap user able to query, if not set connects as anonymous +#:user: 'admin' +#:password: 'password' + +# Ldap authentication method +:auth_method: :simple + +# Ldap server +:host: localhost +:port: 389 + +# base hierarchy where to search for users and groups +:base: 'dc=domain' + +# group the users need to belong to. If not set any user will do +:group: 'cn=cloud,ou=groups,dc=domain' + +# field that holds the user name, if not set 'cn' will be used +:user_field: 'cn' diff --git a/src/authm_mad/remotes/ldap/ldap_auth.rb b/src/authm_mad/remotes/ldap/ldap_auth.rb new file mode 100644 index 0000000000..8d30eb153e --- /dev/null +++ b/src/authm_mad/remotes/ldap/ldap_auth.rb @@ -0,0 +1,96 @@ +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +require 'rubygems' +require 'net/ldap' + +class LdapAuth + def initialize(options) + @options={ + :host => 'localhost', + :port => 389, + :user => nil, + :password => nil, + :base => nil, + :auth_method => :simple, + :user_field => 'cn' + }.merge(options) + + ops={} + + if @options[:user] + ops[:auth] = { + :method => @options[:auth_method], + :username => @options[:user], + :password => @options[:password] + } + end + + ops[:host]=@options[:host] if @options[:host] + ops[:port]=@options[:port].to_i if @options[:port] + + @ldap=Net::LDAP.new(ops) + end + + def find_user(name) + begin + result=@ldap.search( + :base => @options[:base], + :filter => "#{@options[:user_field]}=#{name}") + + if result && result.first + result.first.dn + else + result=@ldap.search(:base => name) + + if result && result.first + name + else + nil + end + end + rescue + nil + end + end + + def is_in_group?(user, group) + result=@ldap.search(:base => group, :filter => "(member=#{user})") + + if result && result.first + true + else + false + end + end + + def authenticate(user, password) + ldap=@ldap.clone + + auth={ + :method => @options[:auth_method], + :username => user, + :password => password + } + + if ldap.bind(auth) + true + else + false + end + end +end + diff --git a/src/authm_mad/remotes/ldap/test/ldap_auth_spec.rb b/src/authm_mad/remotes/ldap/test/ldap_auth_spec.rb new file mode 100644 index 0000000000..13a0c43f7e --- /dev/null +++ b/src/authm_mad/remotes/ldap/test/ldap_auth_spec.rb @@ -0,0 +1,70 @@ +# ---------------------------------------------------------------------------- # +# Copyright 2010-2011, C12G Labs S.L # +# # +# Licensed 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. # +# ---------------------------------------------------------------------------- # + +$: << ".." + +require 'ldap_auth' + +options={ + :host => 'ubuntu-test', + :base => 'dc=localdomain' +} + +describe LdapAuth do + before(:all) do + @ldap=LdapAuth.new(options) + end + + it 'should find user dn' do + name=@ldap.find_user('user01') + name.should=='cn=user01,dc=localdomain' + + name=@ldap.find_user('user02') + name.should=='cn=user02,dc=localdomain' + + name=@ldap.find_user('user03') + name.should==nil + + name=@ldap.find_user('cn=user01,dc=localdomain') + name.should=='cn=user01,dc=localdomain' + end + + it 'should tell if a user is in a group' do + group='cn=cloud,ou=groups,dc=localdomain' + + result=@ldap.is_in_group?('cn=user01,dc=localdomain', group) + result.should==true + + result=@ldap.is_in_group?('cn=user02,dc=localdomain', group) + result.should==false + end + + it 'should authenticate user' do + result=@ldap.authenticate('cn=user01,dc=localdomain', 'password01') + result.should==true + + result=@ldap.authenticate('cn=user02,dc=localdomain', 'password02') + result.should==true + + result=@ldap.authenticate('cn=user01,dc=localdomain', 'password02') + result.should==false + + result=@ldap.authenticate('user01,dc=localdomain', 'password01') + result.should==false + end + +end + From 61962e5dc3b5573ab6495bcd25d809480a45f8f2 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Tue, 29 Nov 2011 17:17:53 +0100 Subject: [PATCH 077/157] Feature: Added accounting tools for OpenNebula. Contributed by C12G --- install.sh | 2 + src/acct/oneacct.rb | 183 ++++++++++++++++++++++++++++++++++ src/cli/oneacct | 235 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 420 insertions(+) create mode 100644 src/acct/oneacct.rb create mode 100755 src/cli/oneacct diff --git a/install.sh b/install.sh index 669dfeee3c..6a9cccc32a 100755 --- a/install.sh +++ b/install.sh @@ -484,6 +484,7 @@ INSTALL_ETC_FILES=( BIN_FILES="src/nebula/oned \ src/scheduler/src/sched/mm_sched \ src/cli/onevm \ + src/cli/oneacct \ src/cli/onehost \ src/cli/onevnet \ src/cli/oneuser \ @@ -1180,6 +1181,7 @@ ACCT_BIN_FILES="src/acct/oneacctd" ACCT_LIB_FILES="src/acct/monitoring.rb \ src/acct/accounting.rb \ src/acct/acctd.rb \ + src/acct/oneacct.rb \ src/acct/watch_helper.rb \ src/acct/watch_client.rb" diff --git a/src/acct/oneacct.rb b/src/acct/oneacct.rb new file mode 100644 index 0000000000..2ad12cd891 --- /dev/null +++ b/src/acct/oneacct.rb @@ -0,0 +1,183 @@ +# -------------------------------------------------------------------------- +# Copyright 2010-2011, C12G Labs S.L. +# +# This file is part of OpenNebula addons. +# +# OpenNebula addons are free software: you can redistribute it +# and/or modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 of +# the License, or the hope That it will be useful, but (at your +# option) any later version. +# +# OpenNebula addons are distributed in WITHOUT ANY WARRANTY; +# without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License +# along with OpenNebula addons. If not, see +# +# -------------------------------------------------------------------------- + + + +require 'acct/watch_helper' + +class AcctClient + def initialize(filters={}) + @filters=filters + @deltas=[] + @users={} + end + + def account(time_start=nil, time_end=nil, user_id=nil) + @filters[:start]=time_start if time_start + @filters[:end]=time_end if time_end + @filters[:user]=user_id if user_id + + get_users_consumption + + @users + end + +private + + def get_users_consumption + # Get all the deltas that match the filters + @deltas=calculate_deltas.map {|q| q.values } + + @users=slices_by_user + + user_slices_and_deltas_to_vms + end + + def slices_by_user + # Get all VM slices that match the filters + query=get_vm_slices(@filters) + + # This hash will hold the users with the resources consumed + users={} + + query.each do |reg| + vm=reg.vm + uid=vm.uid.to_i + + # Create a new user register if it still does not exist + user=users[uid]||={ + :vm_slices => [], + } + + user[:vm_slices] << reg.values + end + + users + end + + def user_slices_and_deltas_to_vms + @users.each do |user, data| + # Get the VM ids array for this user + vms=data[:vm_slices].map {|vm| vm[:id] }.sort.uniq + + data[:vms]={} + + vms.each do |vm| + # Get the slices array for this VM + slices=data[:vm_slices].select {|slice| slice[:id]==vm } + + data[:vms][vm]={ + :slices => [], + :time => 0, + } + + # Get the deltas sum for this VM + vm_delta=@deltas.find {|d| d[:vm_id]==vm } + + data[:vms][vm][:network]=vm_delta + data[:vms][vm][:vmid]=vm + + # Calculate the time consumed by the VM + slices.each do |slice| + data[:vms][vm][:slices] << slice + + time=calculate_time(slice, + @filters[:start], @filters[:end]) + data[:vms][vm][:time]+=time + end + end + + # Delete redundant slices data + data.delete(:vm_slices) + end + end + + def get_vm_slices(filters={}) + vms=WatchHelper::Register + + query=vms.join(:vms, :id => :vm_id) + query=query.filter({:vms__uid => filters[:user]}) if filters[:user] + query=query.filter( + {:retime => 0} | (:retime > filters[:start])) if filters[:start] + query=query.filter(:rstime <= filters[:end]) if filters[:end] + + query + end + + def get_deltas(filters={}) + if filters[:data] + query=filters[:data] + else + query=WatchHelper::VmDelta + end + + query=query.filter( :ptimestamp >= filters[:start] ) if filters[:start] + query=query.filter( :ptimestamp <= filters[:end] ) if filters[:end] + query=query.filter( { :vm_id => filters[:vmid] } ) if filters[:vmid] + + query + end + + def calculate_deltas + query=WatchHelper::VmDelta.select( + :ptimestamp, :vm_id, + 'sum(net_tx) AS net_tx'.lit, 'sum(net_rx) AS net_rx'.lit) + + query=query.group(:vm_id) + + new_filters=@filters.merge(:data => query) + + get_deltas(new_filters) + end + + def calculate_time(slice, period_start, period_end) + ts=slice[:rstime].to_i + te=slice[:retime].to_i + + pstart=period_start.to_i + pend=period_end.to_i + + pend=Time.now.to_i if pend==0 + + ts=pstart if tspend or te==0 + te=pend + end + + te-ts + end +end + +if $0 == __FILE__ + + require 'json' + + acct=AcctClient.new( + :start => 1319476322, + :end => 1319637455 + ) + + a=acct.account() + + puts JSON.pretty_generate(a) + +end + diff --git a/src/cli/oneacct b/src/cli/oneacct new file mode 100755 index 0000000000..065d2c09eb --- /dev/null +++ b/src/cli/oneacct @@ -0,0 +1,235 @@ +#!/usr/bin/env ruby + +# -------------------------------------------------------------------------- +# Copyright 2010-2011, C12G Labs S.L. +# +# This file is part of OpenNebula addons. +# +# OpenNebula addons are free software: you can redistribute it +# and/or modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 of +# the License, or the hope That it will be useful, but (at your +# option) any later version. +# +# OpenNebula addons are distributed in WITHOUT ANY WARRANTY; +# without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License +# along with OpenNebula addons. If not, see +# +# -------------------------------------------------------------------------- + + +ONE_LOCATION=ENV['ONE_LOCATION'] + +$: << ONE_LOCATION+'/lib/ruby' +$: << ONE_LOCATION+'/lib/ruby/cli' + +require 'rubygems' + +require 'acct/oneacct' +require 'cli/one_helper' +require 'cli/command_parser' +require 'json' + +require 'optparse' +require 'optparse/time' + +REG_DATE=/((\d{4})\/)?(\d\d?)(\/(\d\d?))?/ +REG_TIME=/(\d\d?):(\d\d?)(:(\d\d?))?/ + +class AcctHelper + + def format_vm(options=nil) + table = CLIHelper::ShowTable.new(nil, nil) do + column :VMID, "VM ID", :size=>4 do |d| + d[:vmid] + end + + column :MEMORY, "Consumed memory", :right, :size=>8 do |d| + OpenNebulaHelper.unit_to_str( + d[:slices].first[:mem]*1024, + {}) + end + + column :CPU, "Group of the User", :right, :size=>8 do |d| + d[:slices].first[:cpu] + end + + column :NETRX, "Group of the User", :right, :size=>10 do |d| + OpenNebulaHelper.unit_to_str( + d[:network][:net_rx]/1024.0, + {}) + end + + column :NETTX, "Group of the User", :right, :size=>10 do |d| + OpenNebulaHelper.unit_to_str( + d[:network][:net_tx]/1024.0, + {}) + end + + column :TIME, "Group of the User", :right, :size=>15 do |d| + OpenNebulaHelper.time_to_str(d[:time]) + end + + default :VMID, :MEMORY, :CPU, :NETRX, :NETTX, :TIME + end + + table + end + + def list_vms(data) + format_vm().show(data) + end + + def list_users(filters) + a=gen_accounting(filters) + + a.each do |user, data| + + CLIHelper.scr_bold + CLIHelper.scr_underline + puts "# User #{user}" + CLIHelper.scr_restore + puts + + vms=data[:vms].map do |k, v| + v + end + + self.list_vms(vms) + + puts + puts + + end + end + + def gen_accounting(filters) + acct=AcctClient.new(filters) + acct.account() + end + + def gen_json(filters) + begin + require 'json' + rescue LoadError + STDERR.puts "JSON gem is needed to give the result in this format" + exit(-1) + end + + acct=gen_accounting(filters) + acct.to_json + end + + def xml_tag(tag, value) + "<#{tag}>#{value}\n" + end + + def gen_xml(filters) + acct=gen_accounting(filters) + + xml="" + + acct.each do |user, data| + xml<<"\n" + + data[:vms].each do |vmid, vm| + xml<<" \n" + + xml<<" "<\n" + + slice.each do |key, value| + xml<<" "<\n" + end + + xml<<" \n" + end + + xml<<"\n" + end + + xml + end +end + + +@options=Hash.new + +@options[:format]=:table + +opts=OptionParser.new do |opts| + opts.on('-s', '--start TIME', Time, + 'Start date and time to take into account') do |ext| + @options[:start]=ext + end + + opts.on("-e", "--end TIME", Time, + "End date and time" ) do |ext| + @options[:end]=ext + end + + opts.on("-u", "--user user", Integer, + "User id to make accounting" ) do |ext| + @options[:user]=ext.to_i + end + + opts.on("-j", "--json", + "Output in json format" ) do |ext| + @options[:format]=:json + end + + opts.on("-x", "--xml", + "Output in xml format" ) do |ext| + @options[:format]=:xml + end + + opts.on() +end + + +begin + opts.parse!(ARGV) +rescue OptionParser::ParseError => e + STDERR.puts "Error: " << e.message + exit(-1) +end + + +acct_helper=AcctHelper.new + + +filters=Hash.new + +filters[:start]=@options[:start].to_i if @options[:start] +filters[:end]=@options[:end].to_i if @options[:end] +filters[:user]=@options[:user].to_i if @options[:user] + + +case @options[:format] +when :table + acct_helper.list_users(filters) +when :json + puts acct_helper.gen_json(filters) +when :xml + puts acct_helper.gen_xml(filters) +end + + + + + + From 05e40b5b6f41c3691e0e0b7a8ea6d99ad80056d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 29 Nov 2011 18:09:19 +0100 Subject: [PATCH 078/157] Feature #602: Small bugfixes --- include/Leases.h | 2 +- src/vnm/RangedLeases.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/Leases.h b/include/Leases.h index bb8453e53b..74a04d7928 100644 --- a/include/Leases.h +++ b/include/Leases.h @@ -42,7 +42,7 @@ public: */ Leases(SqlDB * _db, int _oid, unsigned long _size, unsigned int _mac_prefix): ObjectSQL(), - oid(_oid), size(_size), n_used(0), db(_db){}; + oid(_oid), size(_size), n_used(0), mac_prefix(_mac_prefix), db(_db){}; virtual ~Leases() { diff --git a/src/vnm/RangedLeases.cc b/src/vnm/RangedLeases.cc index 84c1bddaf0..d992ad29c0 100644 --- a/src/vnm/RangedLeases.cc +++ b/src/vnm/RangedLeases.cc @@ -176,7 +176,7 @@ int RangedLeases::process_template(VirtualNetwork* vn, vn->remove_template_attribute("NETWORK_SIZE"); // Set the network mask - net_mask = ( 0xFFFFFFFF << host_bits ) & 0xFFFFFFFF; + net_mask = 0xFFFFFFFF << host_bits; Lease::ip_to_string(net_mask, st_mask); vn->replace_template_attribute("NETWORK_MASK", st_mask); From 8ef3c966a4ea28c265ffe74e7dc183187c809587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 29 Nov 2011 18:10:05 +0100 Subject: [PATCH 079/157] Feature #602: Fix tests --- src/vnm/test/VirtualNetworkPoolTest.cc | 36 +++++++++++++++++++------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/src/vnm/test/VirtualNetworkPoolTest.cc b/src/vnm/test/VirtualNetworkPoolTest.cc index 2d5801309c..556f6884a6 100644 --- a/src/vnm/test/VirtualNetworkPoolTest.cc +++ b/src/vnm/test/VirtualNetworkPoolTest.cc @@ -73,16 +73,16 @@ const string xmls[] = { "01230the_useroneadminNet number one1br100130.10.0.150:20:20:20:20:200-1", - "12610the_useroneadminA virtual network0br010", + "12610the_useroneadminA virtual network0br0192.168.0.1192.168.0.25410", "01330the_useroneadminNet number two1br100130.10.2.150:20:20:20:20:200-1", }; const string xml_dump = - "010the_useroneadminNet number one1br100120the_useroneadminA virtual network0br010"; + "010the_useroneadminNet number one1br100120the_useroneadminA virtual network0br0192.168.0.1192.168.0.25410"; const string xml_dump_where = - "120the_useroneadminA virtual network0br010"; + "120the_useroneadminA virtual network0br0192.168.0.1192.168.0.25410"; /* ************************************************************************* */ /* ************************************************************************* */ @@ -411,16 +411,16 @@ public: "TYPE = RANGED\n" "BRIDGE = br0\n" "NETWORK_SIZE = B\n" - "NETWORK_ADDRESS = 192.168.1.0\n", + "NETWORK_ADDRESS = 192.168.0.0\n", - // Size "X", defaults to 128 + // Size 126 "NAME = \"Net D\"\n" "TYPE = RANGED\n" "BRIDGE = br0\n" - "NETWORK_SIZE = X\n" + "NETWORK_SIZE = 126\n" "NETWORK_ADDRESS = 192.168.1.0\n", - // Size 32 + // Size 30 "NAME = \"Net E\"\n" "TYPE = RANGED\n" "BRIDGE = br0\n" @@ -428,7 +428,7 @@ public: "NETWORK_ADDRESS = 192.168.1.0\n" }; - unsigned int sizes[7]={1,3,256,256,65536,128,32}; + unsigned int sizes[7]={1,3,254,254,65534,126,30}; int oid[7]; for (int i = 0 ; i < 7 ; i++) @@ -695,7 +695,7 @@ public: CPPUNIT_ASSERT( rc != 0 ); - // Ask for two more IPs + // Ask for the rest of IPs vn->lock(); rc = vn->get_lease(123, ip, mac, bridge); vn->unlock(); @@ -708,12 +708,28 @@ public: CPPUNIT_ASSERT( rc == 0 ); + vn->lock(); + rc = vn->get_lease(457, ip, mac, bridge); + vn->unlock(); + + CPPUNIT_ASSERT( rc == 0 ); + + vn->lock(); + rc = vn->get_lease(458, ip, mac, bridge); + vn->unlock(); + + CPPUNIT_ASSERT( rc == 0 ); + + vn->lock(); + rc = vn->get_lease(459, ip, mac, bridge); + vn->unlock(); + + CPPUNIT_ASSERT( rc == 0 ); // All IPs are now used vn->lock(); rc = vn->get_lease(789, ip, mac, bridge); vn->unlock(); - CPPUNIT_ASSERT( rc != 0 ); // Release one of the 3 IPs From 09fe832399d175dcb12884d4f817788ad3b03fd9 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Tue, 29 Nov 2011 11:51:27 +0100 Subject: [PATCH 080/157] feature #863: fix some bugs introduced with library changes --- src/image_mad/one_image.rb | 26 ++++++++++++++------------ src/vmm_mad/exec/one_vmm_exec.rb | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/image_mad/one_image.rb b/src/image_mad/one_image.rb index 358972a879..2cde2db22b 100755 --- a/src/image_mad/one_image.rb +++ b/src/image_mad/one_image.rb @@ -54,12 +54,16 @@ class ImageDriver < OpenNebulaDriver @options={ :concurrency => 10, :threaded => true, - :retries => 0 + :retries => 0, + :local_actions => { + 'MV' => nil, + 'CP' => nil, + 'RM' => nil, + 'MKFS' => nil + } }.merge!(options) - super('', @options) - - @actions_path = "#{VAR_LOCATION}/remotes/image/#{fs_type}" + super("image/#{fs_type}", @options) register_action(ACTION[:mv].to_sym, method("mv")) register_action(ACTION[:cp].to_sym, method("cp")) @@ -69,23 +73,21 @@ class ImageDriver < OpenNebulaDriver # Image Manager Protocol Actions (generic implementation def mv(id, src, dst) - do_action("#{@actions_path}/mv #{src} #{dst} #{id}", id, nil, - ACTION[:mv], :local => true) + do_action("#{src} #{dst} #{id}", id, nil, + ACTION[:mv]) end def cp(id, src) - do_action("#{@actions_path}/cp #{src} #{id}", id, nil, ACTION[:cp], - :local => true) + do_action("#{src} #{id}", id, nil, ACTION[:cp]) end def rm(id, dst) - do_action("#{@actions_path}/rm #{dst} #{id}", id, nil, ACTION[:rm], - :local => true) + do_action("#{dst} #{id}", id, nil, ACTION[:rm]) end def mkfs(id, fs, size) - do_action("#{@actions_path}/mkfs #{fs} #{size} #{id}", id, nil, - ACTION[:mkfs], :local => true) + do_action("#{fs} #{size} #{id}", id, nil, + ACTION[:mkfs]) end end diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 1ce1bc9c79..6e73a14d09 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -224,7 +224,7 @@ class ExecDriver < VirtualMachineDriver log(id, "Successfully executed network driver #{net_drv}" << " (clean-cancel)") - send_message(ACTION[:shutdown], RESULT[:success], id, domain_id) + send_message(ACTION[:shutdown], RESULT[:success], id, deploy_id) end def save(id, drv_message) From ab10f16d507f5d0e1db22c5c999a90851768e6c6 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Tue, 29 Nov 2011 19:43:13 +0100 Subject: [PATCH 081/157] feature #863: added a configurable action system and changed some actions to use it --- src/vmm_mad/exec/one_vmm_exec.rb | 501 ++++++++++++++++--------------- 1 file changed, 264 insertions(+), 237 deletions(-) diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 6e73a14d09..6a6b021e73 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -37,8 +37,148 @@ require 'ssh_stream' require 'pp' +class VmmAction + attr_reader :data + + def initialize(driver, id, action, xml_data) + @vmm=driver + @id=id + @main_action=action + @xml_data=@vmm.decode(xml_data) + + @data=Hash.new + + get_data(:host) + get_data(:net_drv) + get_data(:deploy_id) + get_data(:checkpoint_file) + + get_data(:local_dfile, :LOCAL_DEPLOYMENT_FILE) + get_data(:remote_dfile, :REMOTE_DEPLOYMENT_FILE) + + # For migration + get_data(:dest_host, :MIGR_HOST) + get_data(:dest_driver, :MIGR_NET_DRV) + + # Initialize streams and vnm + @ssh_src = @vmm.get_ssh_stream(@data[:host], @id) + @vnm_src = VirtualNetworkDriver.new(@data[:net_drv], + :local_actions => @vmm.options[:local_actions], + :message => @xml_data, + :ssh_stream => @ssh_src) + + if @data[:dest_host] and !@data[:dest_host].empty? + @ssh_dst = @vmm.get_ssh_stream(@data[:dest_host], @id) + @vnm_dst = VirtualNetworkDriver.new(@data[:dest_driver], + :local_actions => @vmm.options[:local_actions], + :message => @xml_data, + :ssh_stream => @ssh_dst) + end + end + + def get_data(name, xml_path=nil) + if xml_path + path=xml_path.to_s + else + path=name.to_s.upcase + end + + @data[name]=@xml_data.elements[path].text + end + +=begin + { + :driver => :vmm, + :action => :deploy, + :parameters => [:host, :deploy_id], + :destination => false + :save_info => :deploy_id, + :fail_actions => [], + :pre_log => "", + :post_log => "", + :stdin => nil + } +=end + + def execute_steps(steps) + result=false + info='Action #{step[:action]} not found' + + steps.each do |step| + + driver=step[:driver] || :vmm + + @vmm.log(@id, @data[:pre_log]) if @data[:pre_log] + + case driver + when :vmm + if step[:destination] + host = @data[:dest_host] + ssh = @ssh_dst + else + host = @data[:host] + ssh = @ssh_src + end + + result, info=@vmm.do_action(get_parameters(step), @id, host, + step[:action], + :ssh_stream => ssh, + :respond => false, + :stdin => step[:stdin]) + + when :vnm + if step[:destination] + vnm=@vnm_dst + else + vnm=@vnm_src + end + + result, info=vnm.do_action(@id, step[:action]) + else + end + + # Save the info variable if asked for + if @data[:save_info] + @data[@data[:save_info]]=info + end + + if @vmm.failed?(result) + if @data[:fail_actions] + execute_steps(@data[:fail_actions]) + end + + break + end + + @vmm.log(@id, @data[:post_log]) if @data[:post_log] + end + + return result, info + end + + def run(steps) + result, info=execute_steps(steps) + + @vmm.send_message(VirtualMachineDriver::ACTION[@main_action], + result, @id, info) + end + + def get_parameters(step) + parameters=step[:parameters] || [] + parameters.map do |param| + if Symbol===param + @data[param].to_s + else + param + end + end.join(' ') + end +end + + # The main class for the Sh driver class ExecDriver < VirtualMachineDriver + attr_reader :options # SshDriver constructor def initialize(hypervisor, options={}) @@ -51,19 +191,21 @@ class ExecDriver < VirtualMachineDriver @hypervisor = hypervisor end + def get_ssh_stream(host, id) + SshStreamCommand.new(host, + @remote_scripts_base_path, + log_method(id)) + end + # DEPLOY action, sends the deployment file to remote host def deploy(id, drv_message) # ---------------------------------------------------------------------- # Initialization of deployment data # ---------------------------------------------------------------------- - data = decode(drv_message) + action=VmmAction.new(self, id, :deploy, drv_message) - local_dfile = data.elements['LOCAL_DEPLOYMENT_FILE'].text - remote_dfile = data.elements['REMOTE_DEPLOYMENT_FILE'].text - - host = data.elements['HOST'].text - net_drv = data.elements['NET_DRV'].text + local_dfile=action.data[:local_dfile] if !local_dfile || File.zero?(local_dfile) send_message(ACTION[:deploy],RESULT[:failure],id, @@ -74,263 +216,146 @@ class ExecDriver < VirtualMachineDriver domain = File.read(local_dfile) if action_is_local?(:deploy) - dfile = local_dfile + dfile = action.data[:local_dfile] else - dfile = remote_dfile + dfile = action.data[:remote_dfile] end - ssh = SshStreamCommand.new(host, - @remote_scripts_base_path, - log_method(id)) + steps=[ + { + :driver => :vnm, + :action => :pre, + :post_log => "Successfully executed network driver " << + "#{action.data[:net_drv]} (pre-boot)" + }, + { + :driver => :vmm, + :action => :deploy, + :parameters => [dfile, :host], + :stdin => domain, + :save_info => :deploy_id + }, + { + :driver => :vnm, + :action => :post, + :fail_actions => [ + { + :driver => :vmm, + :action => :cancel, + :parameters => [:deploy_id, :host] + } + ] + } + ] - vnm = VirtualNetworkDriver.new(net_drv, - :local_actions => @options[:local_actions], - :message => data, - :ssh_stream => ssh) - - # ---------------------------------------------------------------------- - # Execute pre-boot action of the network driver - # ---------------------------------------------------------------------- - - result, info = vnm.do_action(id, :pre) - - if failed?(result) - send_message(ACTION[:deploy], result, id,info) - return - end - - log(id, "Successfully executed network driver #{net_drv} (pre-boot)") - - # ---------------------------------------------------------------------- - # Boot the VM - # ---------------------------------------------------------------------- - - result, info = do_action("#{dfile} #{host}", id, host, :deploy, - :stdin => domain, - :ssh_stream => ssh, - :respond => false) - if failed?(result) - send_message(ACTION[:deploy], result, id, info) - return - end - - deploy_id = info - - log(id, "Successfully booted VM with id: #{deploy_id}") - - # ---------------------------------------------------------------------- - # Execute post-boot action of the network driver - # ---------------------------------------------------------------------- - - result, info = vnm.do_action(id, :post) - - if failed?(result) - log(id, "Failed to executed network driver #{net_drv} (post-boot)") - log(id, "Canceling VM with id: #{deploy_id}") - - do_action("#{deploy_id} #{host}", id, host, :cancel, - :ssh_stream => ssh, - :respond => false) - - send_message(ACTION[:deploy], result, id, info) - return - end - - log(id, "Successfully executed network driver #{net_drv} (post-boot)") - - send_message(ACTION[:deploy], RESULT[:success], id, deploy_id) + action.run(steps) end # Basic Domain Management Operations def shutdown(id, drv_message) - data = decode(drv_message) - host = data.elements['HOST'].text - net_drv = data.elements['NET_DRV'].text - deploy_id = data.elements['DEPLOY_ID'].text + action=VmmAction.new(self, id, :shutdown, drv_message) - ssh = SshStreamCommand.new(host, - @remote_scripts_base_path, - log_method(id)) + steps=[ + { + :driver => :vmm, + :action => :shutdown, + :parameters => [:deploy_id, :host], + :post_log => "Successfully shut down VM with id: " << + action.data[:deploy_id] + }, + { + :driver => :vnm, + :action => :clean, + :post_log => "Successfully executed network driver " << + "#{action.data[:net_drv]} (clean-shutdown)" + } + } - vnm = VirtualNetworkDriver.new(net_drv, - :local_actions => @options[:local_actions], - :message => data, - :ssh_stream => ssh) - - result, info = do_action("#{deploy_id} #{host}", id, host, :shutdown, - :ssh_stream => ssh, - :respond => false) - - if failed?(result) - send_message(ACTION[:shutdown], result, id,info) - return - end - - log(id, "Successfully shut down VM with id: #{deploy_id}") - - # ---------------------------------------------------------------------- - # Execute clean action of the network driver - # ---------------------------------------------------------------------- - - result, info = vnm.do_action(id, :clean) - - if failed?(result) - send_message(ACTION[:shutdown], result, id,info) - return - end - - log(id, "Successfully executed network driver #{net_drv}" << - " (clean-shutdown)") + action.run(steps) end def cancel(id, drv_message) - data = decode(drv_message) - host = data.elements['HOST'].text - net_drv = data.elements['NET_DRV'].text - deploy_id = data.elements['DEPLOY_ID'].text + action=VmmAction.new(self, id, :cancel, drv_message) - ssh = SshStreamCommand.new(host, - @remote_scripts_base_path, - log_method(id)) + steps=[ + { + :driver => :vmm, + :action => :cancel, + :parameters => [:deploy_id, :host], + :post_log => "Successfully canceled VM with id: " << + action.data[:deploy_id] + }, + { + :driver => :vnm, + :action => :clean, + :post_log => "Successfully executed network driver " << + "#{action.data[:net_drv]} (clean-cancel)" + } + ] - vnm = VirtualNetworkDriver.new(net_drv, - :local_actions => @options[:local_actions], - :message => data, - :ssh_stream => ssh) - - result, info = do_action("#{deploy_id} #{host}", id, host, :cancel, - :ssh_stream => ssh, - :respond => false) - - if failed?(result) - send_message(ACTION[:cancel], result, id,info) - return - end - - log(id, "Successfully canceled VM with id: #{deploy_id}") - - # ---------------------------------------------------------------------- - # Execute clean action of the network driver - # ---------------------------------------------------------------------- - - result, info = vnm.do_action(id, :clean) - - if failed?(result) - send_message(ACTION[:cancel], result, id,info) - return - end - - log(id, "Successfully executed network driver #{net_drv}" << - " (clean-cancel)") - - send_message(ACTION[:shutdown], RESULT[:success], id, deploy_id) + action.run(steps) end def save(id, drv_message) - data = decode(drv_message) - host = data.elements['HOST'].text - net_drv = data.elements['NET_DRV'].text - deploy_id = data.elements['DEPLOY_ID'].text - file = data.elements['CHECKPOINT_FILE'].text + action=VmmAction.new(self, id, :save, drv_message) - ssh = SshStreamCommand.new(host, - @remote_scripts_base_path, - log_method(id)) + steps=[ + { + :driver => :vmm, + :action => :save, + :parameters => [:deploy_id, :checkpoint_file, :host], + :post_log => "Successfully saved VM with id: " << + action.data[:deploy_id] + }, + { + :driver => :vnm, + :action => :clean, + :post_log => "Successfully executed network driver " << + "#{action.data[:net_drv]} (clean-save)" + } + ] - vnm = VirtualNetworkDriver.new(net_drv, - :local_actions => @options[:local_actions], - :message => data, - :ssh_stream => ssh) - - result, info = do_action("#{deploy_id} #{file} #{host}", id, host, - :save, - :ssh_stream => ssh, - :respond => false) - - if failed?(result) - send_message(ACTION[:save], result, id,info) - return - end - - log(id, "Successfully saved VM with id: #{deploy_id}") - - # ---------------------------------------------------------------------- - # Execute clean action of the network driver - # ---------------------------------------------------------------------- - - result, info = vnm.do_action(id, :clean) - - if failed?(result) - send_message(ACTION[:save], result, id,info) - return - end - - log(id, "Successfully executed network driver #{net_drv}" << - " (clean-save)") - - send_message(ACTION[:save], RESULT[:success], id, domain_id) + action.run(steps) end def restore(id, drv_message) - data = decode(drv_message) - host = data.elements['HOST'].text - file = data.elements['CHECKPOINT_FILE'].text + action=VmmAction.new(self, id, :restore, drv_message) - ssh = SshStreamCommand.new(host, - @remote_scripts_base_path, - log_method(id)) + steps=[ + { + :driver => :vnm, + :action => :pre, + :post_log => "Successfully executed network driver " << + "#{action.data[:net_drv]} (pre-restore)" + }, + { + :driver => :vmm, + :action => :restore, + :parameters => [:checkpoint_file, :host], + :save_info => :deploy_id, + :post_log => "Successfully restored VM with id: " << + action.data[:deploy_id] + }, + { + :driver => :vnm, + :action => :post, + :fail_actions => [ + { + :pre_log => "Failed to execute network driver" << + "#{action.data[:net_drv]} (post-restore). " << + "Cancelling VM with id: #{action.data[:deploy_id]}" + :driver => :vmm, + :action => :cancel, + :parameters => [:deploy_id, :host] + } + ], + :post_log => "Successfully executed network driver " << + "#{action.data[:net_drv]} (post-restore)" + } + ] - vnm = VirtualNetworkDriver.new(net_drv, - :local_actions => @options[:local_actions], - :message => data, - :ssh_stream => ssh) - - # ---------------------------------------------------------------------- - # Execute pre-boot action of the network driver - # ---------------------------------------------------------------------- - - result, info = vnm.do_action(id, :pre) - - if failed?(result) - send_message(ACTION[:restore], result, id,info) - return - end - - log(id, "Successfully executed network driver #{net_drv} (pre-restore)") - - result, info = do_action("#{file} #{host}", id, host, :restore, - :save, - :ssh_stream => ssh, - :respond => false) - if failed?(result) - send_message(ACTION[:restore], result, id, info) - return - end - - log(id, "Successfully restored VM with id: #{info}") - - # ---------------------------------------------------------------------- - # Execute post-restore action of the network driver - # ---------------------------------------------------------------------- - - result, info = vnm.do_action(id, :post) - - if failed?(result) - log(id, "Failed to executed network driver #{net_drv} (post-restore)") - log(id, "Canceling VM with id: #{domain_id}") - - do_action("#{domain_id} #{host}", id, host, :cancel, - :ssh_stream => ssh, - :respond => false) - - send_message(ACTION[:restore], result, id, info) - return - end - - log(id, "Successfully executed network driver #{net_drv} (post-restore)") - - send_message(ACTION[:restore], RESULT[:success], id, domain_id) + action.run(steps) end def migrate(id, drv_message) @@ -455,3 +480,5 @@ exec_driver = ExecDriver.new(hypervisor, :local_actions => local_actions) exec_driver.start_driver + + From a59859ce988a72a0221f68be44da47f83f90b77e Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 30 Nov 2011 11:41:03 +0100 Subject: [PATCH 082/157] OZones GUI: Style fixes after vendor update --- src/ozones/Server/public/css/application.css | 17 ++++++++++- src/ozones/Server/public/css/layout.css | 30 ++++++++----------- .../Server/public/js/plugins/vdcs-tab.js | 7 +++-- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/src/ozones/Server/public/css/application.css b/src/ozones/Server/public/css/application.css index c99f7b641e..1ecaeec46d 100644 --- a/src/ozones/Server/public/css/application.css +++ b/src/ozones/Server/public/css/application.css @@ -215,6 +215,12 @@ label{ text-align:left; } +.dataTables_wrapper label { + float: none; + width: auto; + padding: 0 0; + text-align:right; +} div.tip { display: inline-block; @@ -411,7 +417,7 @@ tr.even:hover{ } .top_button { - font-size: 0.8em; + font-size: 0.8em!important; height: 25px; margin: 3px 2px; vertical-align: middle; @@ -578,4 +584,13 @@ ul.dd_right{ } ul.dd_left{ +} + +.ui-widget{ + font: 10pt Arial, Verdana, Geneva, Helvetica, sans-serif; +} + +.ui-layout-resizer-open-hover, /* hover-color to 'resize' */ +.ui-layout-resizer-dragging { + background: #EEE; } \ No newline at end of file diff --git a/src/ozones/Server/public/css/layout.css b/src/ozones/Server/public/css/layout.css index e4d6e2864a..b61f0b6ea6 100644 --- a/src/ozones/Server/public/css/layout.css +++ b/src/ozones/Server/public/css/layout.css @@ -44,19 +44,26 @@ body { } #header { - padding:0; + padding: 0 10px 0 10px; background-color: #353735; + border:0; } #footer { - padding:0; + padding-top: 9px; + font-size: 0.8em; + color: white; + text-align: center; background-color: #353735; + border:0; + } -#header { - padding: 0 10px 0 10px; - background-color: #353735; +#footer a { + color: white; + text-decoration: underline; } + #logo { padding-top: 6px; font-weight: bold; @@ -87,18 +94,6 @@ body { color: #88C140; } -#footer { - padding-top: 9px; - font-size: 0.8em; - color: white; - text-align: center; -} - -#footer a { - color: white; - text-decoration: underline; -} - #logo-wrapper { float: right; margin-top: 0px; @@ -108,6 +103,7 @@ body { #menu { padding-right: 0; padding-left: 0; + border:0; border-right: 1px solid #353735; background-image: -webkit-gradient( linear, diff --git a/src/ozones/Server/public/js/plugins/vdcs-tab.js b/src/ozones/Server/public/js/plugins/vdcs-tab.js index 3f15e02315..d46b8edacd 100644 --- a/src/ozones/Server/public/js/plugins/vdcs-tab.js +++ b/src/ozones/Server/public/js/plugins/vdcs-tab.js @@ -42,7 +42,7 @@ var create_vdc_tmpl = \
                      \ \ - \ +
                      \ \
                      \ @@ -52,7 +52,8 @@ var create_vdc_tmpl =
                      Allows hosts belonging to other VDCs to be re-added to this one. They will appear greyed-out in the lists.
                      \
                      \ \ - \ +
                      \ +
                      \ \
                      \
                        \ @@ -278,7 +279,7 @@ function updateVDCInfo(req,vdc_json){ var zone_host = ""; var zone_port = ""; var sun_link = ""; - var zone_match = zone_endpoint.match(/^https?:\/\/([\w.]+):(\d+)\/([\W\w]+)$/); + var zone_match = zone_endpoint.match(/^https?:\/\/([\w.-]+):(\d+)\/([\W\w]+)$/); if (zone_match){ zone_host = zone_match[1]; From 0204a013fdc7fc5fd02982250a26d4d808ad4562 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 30 Nov 2011 11:41:03 +0100 Subject: [PATCH 083/157] OZones GUI: Style fixes after vendor update --- src/ozones/Server/public/css/application.css | 17 ++++++++++- src/ozones/Server/public/css/layout.css | 30 ++++++++----------- .../Server/public/js/plugins/vdcs-tab.js | 7 +++-- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/src/ozones/Server/public/css/application.css b/src/ozones/Server/public/css/application.css index c99f7b641e..1ecaeec46d 100644 --- a/src/ozones/Server/public/css/application.css +++ b/src/ozones/Server/public/css/application.css @@ -215,6 +215,12 @@ label{ text-align:left; } +.dataTables_wrapper label { + float: none; + width: auto; + padding: 0 0; + text-align:right; +} div.tip { display: inline-block; @@ -411,7 +417,7 @@ tr.even:hover{ } .top_button { - font-size: 0.8em; + font-size: 0.8em!important; height: 25px; margin: 3px 2px; vertical-align: middle; @@ -578,4 +584,13 @@ ul.dd_right{ } ul.dd_left{ +} + +.ui-widget{ + font: 10pt Arial, Verdana, Geneva, Helvetica, sans-serif; +} + +.ui-layout-resizer-open-hover, /* hover-color to 'resize' */ +.ui-layout-resizer-dragging { + background: #EEE; } \ No newline at end of file diff --git a/src/ozones/Server/public/css/layout.css b/src/ozones/Server/public/css/layout.css index e4d6e2864a..b61f0b6ea6 100644 --- a/src/ozones/Server/public/css/layout.css +++ b/src/ozones/Server/public/css/layout.css @@ -44,19 +44,26 @@ body { } #header { - padding:0; + padding: 0 10px 0 10px; background-color: #353735; + border:0; } #footer { - padding:0; + padding-top: 9px; + font-size: 0.8em; + color: white; + text-align: center; background-color: #353735; + border:0; + } -#header { - padding: 0 10px 0 10px; - background-color: #353735; +#footer a { + color: white; + text-decoration: underline; } + #logo { padding-top: 6px; font-weight: bold; @@ -87,18 +94,6 @@ body { color: #88C140; } -#footer { - padding-top: 9px; - font-size: 0.8em; - color: white; - text-align: center; -} - -#footer a { - color: white; - text-decoration: underline; -} - #logo-wrapper { float: right; margin-top: 0px; @@ -108,6 +103,7 @@ body { #menu { padding-right: 0; padding-left: 0; + border:0; border-right: 1px solid #353735; background-image: -webkit-gradient( linear, diff --git a/src/ozones/Server/public/js/plugins/vdcs-tab.js b/src/ozones/Server/public/js/plugins/vdcs-tab.js index 3f15e02315..d46b8edacd 100644 --- a/src/ozones/Server/public/js/plugins/vdcs-tab.js +++ b/src/ozones/Server/public/js/plugins/vdcs-tab.js @@ -42,7 +42,7 @@ var create_vdc_tmpl = \
                        \ \ - \ +
                        \ \
                        \ @@ -52,7 +52,8 @@ var create_vdc_tmpl =
                        Allows hosts belonging to other VDCs to be re-added to this one. They will appear greyed-out in the lists.
                        \
                        \ \ - \ +
                        \ +
                        \ \
                        \
                          \ @@ -278,7 +279,7 @@ function updateVDCInfo(req,vdc_json){ var zone_host = ""; var zone_port = ""; var sun_link = ""; - var zone_match = zone_endpoint.match(/^https?:\/\/([\w.]+):(\d+)\/([\W\w]+)$/); + var zone_match = zone_endpoint.match(/^https?:\/\/([\w.-]+):(\d+)\/([\W\w]+)$/); if (zone_match){ zone_host = zone_match[1]; From ee6888567a754a57b76837042b11094c748f41bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 30 Nov 2011 11:41:41 +0100 Subject: [PATCH 084/157] Feature #602: Add tests for range definition --- src/vnm/test/VirtualNetworkPoolTest.cc | 130 +++++++++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/src/vnm/test/VirtualNetworkPoolTest.cc b/src/vnm/test/VirtualNetworkPoolTest.cc index 556f6884a6..2a26cbef48 100644 --- a/src/vnm/test/VirtualNetworkPoolTest.cc +++ b/src/vnm/test/VirtualNetworkPoolTest.cc @@ -180,6 +180,8 @@ class VirtualNetworkPoolTest : public PoolTest CPPUNIT_TEST (del_lease_nonexistent_ip); CPPUNIT_TEST (del_lease_used_ip); + CPPUNIT_TEST (range_definition); + CPPUNIT_TEST_SUITE_END (); protected: @@ -1642,6 +1644,134 @@ public: CPPUNIT_ASSERT( rc != 0 ); CPPUNIT_ASSERT( error_str != "" ); } + +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + + void range_definition() + { + VirtualNetworkPoolFriend * vnpool = + static_cast(pool); + + int rc; + VirtualNetwork* vnet; + + int oid; + string xml_str; + string xpath; + string err; + + // All these templates should create the same range + string templ[] = { + "NAME = R\n" + "TYPE = RANGED\n" + "BRIDGE = vbr0\n" + "NETWORK_ADDRESS = 10.10.10.0\n" + "NETWORK_SIZE = C\n", + + "NAME = R\n" + "TYPE = RANGED\n" + "BRIDGE = vbr0\n" + "NETWORK_ADDRESS = 10.10.10.0\n" + "NETWORK_SIZE = 254\n", + + "NAME = R\n" + "TYPE = RANGED\n" + "BRIDGE = vbr0\n" + "NETWORK_ADDRESS = 10.10.10.0/24\n", + + "NAME = R\n" + "TYPE = RANGED\n" + "BRIDGE = vbr0\n" + "NETWORK_ADDRESS = 10.10.10.0\n" + "NETWORK_MASK = 255.255.255.0\n", + + + + "NAME = R\n" + "TYPE = RANGED\n" + "BRIDGE = vbr0\n" + "NETWORK_ADDRESS = 10.10.10.0/24\n" + "IP_START = 10.10.10.17\n", + + "NAME = R\n" + "TYPE = RANGED\n" + "BRIDGE = vbr0\n" + "NETWORK_ADDRESS = 10.10.10.0/24\n" + "IP_END = 10.10.10.41\n", + + "NAME = R\n" + "TYPE = RANGED\n" + "BRIDGE = vbr0\n" + "NETWORK_ADDRESS = 10.10.10.0/24\n" + "IP_START = 10.10.10.17\n" + "IP_END = 10.10.10.41\n", + + + + "NAME = R\n" + "TYPE = RANGED\n" + "BRIDGE = vbr0\n" + "IP_START = 10.10.10.17\n" + "IP_END = 10.10.10.41\n", + + "NAME = R\n" + "TYPE = RANGED\n" + "BRIDGE = vbr0\n" + "NETWORK_ADDRESS = 10.10.10.0\n", + }; + + string ip_start[] = { + "10.10.10.1", + "10.10.10.1", + "10.10.10.1", + "10.10.10.1", + + "10.10.10.17", + "10.10.10.1", + "10.10.10.17", + + "10.10.10.17", + + "10.10.10.1", + }; + + string ip_end[] = { + "10.10.10.254", + "10.10.10.254", + "10.10.10.254", + "10.10.10.254", + + "10.10.10.254", + "10.10.10.41", + "10.10.10.41", + + "10.10.10.41", + + "10.10.10.126", + }; + + + for (int i = 0 ; i < 9 ; i++) + { + rc = vnpool->allocate(uids[0], templ[i], &oid); + + CPPUNIT_ASSERT( rc >= 0 ); + + vnet = vnpool->get(oid, false); + CPPUNIT_ASSERT( vnet != 0 ); + + vnet->to_xml_extended(xml_str); + + ObjectXML::xpath_value(xpath, xml_str.c_str(), "/VNET/RANGE/IP_START" ); + CPPUNIT_ASSERT( xpath == ip_start[i] ); + + ObjectXML::xpath_value(xpath, xml_str.c_str(), "/VNET/RANGE/IP_END" ); + CPPUNIT_ASSERT( xpath == ip_end[i] ); + + vnpool->drop(vnet, err); + } + } }; /* ************************************************************************* */ From a173e7bd754abc0b372aae76fb6267d4f5883ea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 30 Nov 2011 12:43:36 +0100 Subject: [PATCH 085/157] Feature #602: onevnet release returns error if a Lease is not used, this achieves the same behaviour for fixed and ranged networks --- src/vnm/Leases.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vnm/Leases.cc b/src/vnm/Leases.cc index c159294625..98cf0e38dc 100644 --- a/src/vnm/Leases.cc +++ b/src/vnm/Leases.cc @@ -490,7 +490,7 @@ int Leases::free_leases(vector& vector_leases, it = leases.find(i_ip); - if ( it == leases.end() || (it->second->used && it->second->vid != -1) ) + if ( it == leases.end() || !it->second->used || it->second->vid != -1 ) { error_msg = "Lease is not on hold."; return -1; From f0efbf09b6b36bfc7c1b9dd57e737fc908b02878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 30 Nov 2011 13:19:15 +0100 Subject: [PATCH 086/157] Feature #602: Add VNet hold and release methods in Java OCA --- .../client/vnet/VirtualNetwork.java | 53 ++++++++++++++++++- src/oca/java/test/VirtualNetworkTest.java | 48 +++++++++++++++++ 2 files changed, 100 insertions(+), 1 deletion(-) diff --git a/src/oca/java/src/org/opennebula/client/vnet/VirtualNetwork.java b/src/oca/java/src/org/opennebula/client/vnet/VirtualNetwork.java index ac58d7a316..9bd60df8d3 100644 --- a/src/oca/java/src/org/opennebula/client/vnet/VirtualNetwork.java +++ b/src/oca/java/src/org/opennebula/client/vnet/VirtualNetwork.java @@ -36,7 +36,8 @@ public class VirtualNetwork extends PoolElement{ private static final String RMLEASES = METHOD_PREFIX + "rmleases"; private static final String CHOWN = METHOD_PREFIX + "chown"; private static final String UPDATE = METHOD_PREFIX + "update"; - + private static final String HOLD = METHOD_PREFIX + "hold"; + private static final String RELEASE = METHOD_PREFIX + "release"; /** * Creates a new virtual network representation. @@ -140,6 +141,32 @@ public class VirtualNetwork extends PoolElement{ return client.call(RMLEASES, id, template); } + /** + * Holds a VirtualNetwork lease, marking it as used + * + * @param client XML-RPC Client. + * @param id The virtual network id (nid) of the target network. + * @param template IP to hold, e.g. "LEASES = [ IP = 192.168.0.5 ]" + * @return A encapsulated response. + */ + public static OneResponse hold(Client client, int id, String template) + { + return client.call(HOLD, id, template); + } + + /** + * Releases a VirtualNetwork lease on hold + * + * @param client XML-RPC Client. + * @param id The virtual network id (nid) of the target network. + * @param template IP to release, e.g. "LEASES = [ IP = 192.168.0.5 ]" + * @return A encapsulated response. + */ + public static OneResponse release(Client client, int id, String template) + { + return client.call(RELEASE, id, template); + } + /** * Changes the owner/group * @@ -271,6 +298,30 @@ public class VirtualNetwork extends PoolElement{ return rmLeases(client, id, lease_template); } + /** + * Holds a VirtualNetwork lease, marking it as used + * + * @param ip IP to hold, e.g. "192.168.0.5" + * @return A encapsulated response. + */ + public OneResponse hold(String ip) + { + String lease_template = "LEASES = [ IP = " + ip + " ]"; + return hold(client, id, lease_template); + } + + /** + * Releases a VirtualNetwork lease on hold + * + * @param ip IP to release, e.g. "192.168.0.5" + * @return A encapsulated response. + */ + public OneResponse release(String ip) + { + String lease_template = "LEASES = [ IP = " + ip + " ]"; + return release(client, id, lease_template); + } + /** * Changes the owner/group * diff --git a/src/oca/java/test/VirtualNetworkTest.java b/src/oca/java/test/VirtualNetworkTest.java index dcea0775e6..6a0c86537b 100644 --- a/src/oca/java/test/VirtualNetworkTest.java +++ b/src/oca/java/test/VirtualNetworkTest.java @@ -209,6 +209,54 @@ public class VirtualNetworkTest fixed_vnet.delete(); } + @Test + public void holdFixed() + { + res = VirtualNetwork.allocate(client, fixed_template); + assertTrue( !res.isError() ); + + VirtualNetwork fixed_vnet = + new VirtualNetwork(Integer.parseInt(res.getMessage()), client); + + res = fixed_vnet.hold("130.10.0.1"); + assertTrue( !res.isError() ); + + res = fixed_vnet.hold("130.10.0.5"); + assertTrue( res.isError() ); + + res = fixed_vnet.release("130.10.0.1"); + assertTrue( !res.isError() ); + + res = fixed_vnet.release("130.10.0.1"); + assertTrue( res.isError() ); + + res = fixed_vnet.release("130.10.0.5"); + assertTrue( res.isError() ); + + fixed_vnet.delete(); + } + + @Test + public void holdRanged() + { + res = vnet.hold("192.168.0.10"); + assertTrue( !res.isError() ); + + res = vnet.hold("192.168.100.1"); + assertTrue( res.isError() ); + + res = vnet.release("192.168.0.10"); + assertTrue( !res.isError() ); + + res = vnet.release("192.168.0.10"); + assertTrue( res.isError() ); + + res = vnet.release("192.168.100.1"); + assertTrue( res.isError() ); + + vnet.delete(); + } + @Test public void update() { From f2c4e970838436b3c574b9aa8d6c20d70e5fde71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 30 Nov 2011 13:20:23 +0100 Subject: [PATCH 087/157] Add PHYDEV and VLAN_ID attributes to the onevnet show output --- src/cli/one_helper/onevnet_helper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cli/one_helper/onevnet_helper.rb b/src/cli/one_helper/onevnet_helper.rb index 3d72e196af..5dd769841b 100644 --- a/src/cli/one_helper/onevnet_helper.rb +++ b/src/cli/one_helper/onevnet_helper.rb @@ -59,6 +59,8 @@ class OneVNetHelper < OpenNebulaHelper::OneHelper puts str % ["PUBLIC", OpenNebulaHelper.boolean_to_str(vn['PUBLIC'])] puts str % ["TYPE", vn.type_str] puts str % ["BRIDGE", vn["BRIDGE"]] + puts str % ["PHYSICAL DEVICE", vn["PHYDEV"]] if vn["PHYDEV"] + puts str % ["VLAN ID", vn["VLAN_ID"]] if vn["VLAN_ID"] puts str % ["USED LEASES", vn['TOTAL_LEASES']] puts From 48f83532a210685d8d3e7cca96b1a0ed46e78a1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 30 Nov 2011 05:50:27 -0800 Subject: [PATCH 088/157] Feature VMWARE: Remove duplicated files from install.sh --- install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install.sh b/install.sh index 6a9cccc32a..a8ded00a12 100755 --- a/install.sh +++ b/install.sh @@ -350,7 +350,6 @@ INSTALL_FILES=( VMWARE_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/vmware DUMMY_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/dummy LVM_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/lvm - VMWARE_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/vmware IMAGE_DRIVER_FS_SCRIPTS:$VAR_LOCATION/remotes/image/fs NETWORK_HOOK_SCRIPTS:$VAR_LOCATION/remotes/vnm EXAMPLE_SHARE_FILES:$SHARE_LOCATION/examples From bd2d5b557c3b973652e8760447a958a576450b53 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 30 Nov 2011 16:09:03 +0100 Subject: [PATCH 089/157] Minor fixes to GUIs style. --- src/ozones/Server/public/css/application.css | 6 +++--- src/sunstone/public/css/application.css | 6 +++--- src/sunstone/public/js/sunstone.js | 6 ++++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ozones/Server/public/css/application.css b/src/ozones/Server/public/css/application.css index 1ecaeec46d..e8212b067b 100644 --- a/src/ozones/Server/public/css/application.css +++ b/src/ozones/Server/public/css/application.css @@ -471,15 +471,15 @@ tr.even:hover{ font-size: 1.2em; } -.jGrowl-notification, .jGrowl-closer, .jGrowl-notify-submit { +.jGrowl-notification, .jGrowl-notify-submit { border: 2px #444444 solid; - background-color: #F3F3F3; + background-color: #F3F3F3!important; color: #666666; } .jGrowl-notify-error { border: 2px #660000 solid; - background-color: #F39999; + background-color: #F39999!important; color: #660000; } diff --git a/src/sunstone/public/css/application.css b/src/sunstone/public/css/application.css index 03dc2c0a14..612e9fd012 100644 --- a/src/sunstone/public/css/application.css +++ b/src/sunstone/public/css/application.css @@ -478,15 +478,15 @@ tr.even:hover{ font-size: 1.2em; } -.jGrowl-notification, .jGrowl-closer, .jGrowl-notify-submit { +.jGrowl-notification, .jGrowl-notify-submit { border: 2px #444444 solid; - background-color: #F3F3F3; + background-color: #F3F3F3!important; color: #666666; } .jGrowl-notify-error { border: 2px #660000 solid; - background-color: #F39999; + background-color: #F39999!important; color: #660000; } diff --git a/src/sunstone/public/js/sunstone.js b/src/sunstone/public/js/sunstone.js index 99bff73ac0..69ec72f0ed 100644 --- a/src/sunstone/public/js/sunstone.js +++ b/src/sunstone/public/js/sunstone.js @@ -686,6 +686,12 @@ function setupConfirmDialogs(){ var value = $(this).val(); var action = SunstoneCfg["actions"][value]; var param = $('select#confirm_select',context).val(); + + if (!param.length){ + notifyError("You must select a value"); + return false; + }; + if (!action) { notifyError("Action "+value+" not defined."); return false;}; switch (action.type){ case "multiple": //find the datatable From b2c04d65cdd9ddfd60862aad5f47e41346c0fd52 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Wed, 30 Nov 2011 22:56:30 +0100 Subject: [PATCH 090/157] feature #863: Removed uneeded copyright comments --- src/mad/ruby/ActionManager.rb | 1 - src/mad/ruby/OpenNebulaDriver.rb | 4 ---- 2 files changed, 5 deletions(-) diff --git a/src/mad/ruby/ActionManager.rb b/src/mad/ruby/ActionManager.rb index abc66bab48..dfdea8aa8c 100644 --- a/src/mad/ruby/ActionManager.rb +++ b/src/mad/ruby/ActionManager.rb @@ -16,7 +16,6 @@ require 'thread' =begin rdoc -Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) This class provides support to handle actions. Class methods, or actions, can be registered in the action manager. The manager will wait for actions to be diff --git a/src/mad/ruby/OpenNebulaDriver.rb b/src/mad/ruby/OpenNebulaDriver.rb index 3ecbdd23bb..316ca92af2 100644 --- a/src/mad/ruby/OpenNebulaDriver.rb +++ b/src/mad/ruby/OpenNebulaDriver.rb @@ -19,10 +19,6 @@ require "CommandManager" require "DriverExecHelper" -# Author:: dsa-research.org -# Copyright:: (c) OpenNebula Project Leads (OpenNebula.org) -# License:: Apache License - # This class provides basic messaging and logging functionality # to implement OpenNebula Drivers. A driver is a program that # specialize the OpenNebula behavior by interfacing with specific From 5414c030288627e8e8a80741425ae29aeb803ffa Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Wed, 30 Nov 2011 22:56:52 +0100 Subject: [PATCH 091/157] feature #863: added comments, simpler log messages. Now the main action info is the one returned to OpenNebula core --- src/mad/ruby/DriverExecHelper.rb | 2 +- src/vmm_mad/exec/one_vmm_exec.rb | 452 ++++++++++++++++--------------- 2 files changed, 231 insertions(+), 223 deletions(-) diff --git a/src/mad/ruby/DriverExecHelper.rb b/src/mad/ruby/DriverExecHelper.rb index 37581568fd..d6b632b7e0 100644 --- a/src/mad/ruby/DriverExecHelper.rb +++ b/src/mad/ruby/DriverExecHelper.rb @@ -24,7 +24,7 @@ module DriverExecHelper :failure => "FAILURE" } - def failed?(rc_str) + def self.failed?(rc_str) return rc_str == RESULT[:failure] end diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 6a6b021e73..6d1c9130ca 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -40,13 +40,20 @@ require 'pp' class VmmAction attr_reader :data + # Initialize a VmmAction object + # @param[OpenNebula::ExecDriver] Driver to be used for the actions + # @param[String] Id of the VM + # @param[String] name of the actions as described in the VMM protocol + # @param[xml_data] data sent from OpenNebula core def initialize(driver, id, action, xml_data) - @vmm=driver - @id=id - @main_action=action - @xml_data=@vmm.decode(xml_data) + # Initialize object with xml data + @vmm = driver + @id = id - @data=Hash.new + @main_action = action + @xml_data = @vmm.decode(xml_data) + + @data = Hash.new get_data(:host) get_data(:net_drv) @@ -76,6 +83,115 @@ class VmmAction end end + #Execute a set of steps defined with + # - :driver :vmm or :vnm to execute the step + # - :action for the step + # - :parameters command line paremeters for the action + # - :destination use next host + # - :fail_action steps to be executed if steps fail + # - :stdin for the action + # @param [Array] of steps + def run(steps, info_on_success = nil) + result = execute_steps(steps) + + #Prepare the info for the OpenNebula core + if DriverExecHelper.failed?(result) + info = @data[:failed_info] + else + info = @data["#{@main_action.to_s}_info".to_sym] + end + + @vmm.send_message(VirtualMachineDriver::ACTION[@main_action], + result, @id, info) + end + + private + + DRIVER_NAMES = { + :vmm => "virtualization driver" + :vnm => "network driver" + } + + # Executes a set of steps. If one step fails any recover action is performed + # and the step execution breaks. + # @param [Array] array of steps to be executed + # @return [String, Hash] "SUCCESS/FAILURE" for the step set, and + # information associated to each step (by :_info). In case of + # failure information is also in [:failed_info] + def execute_steps(steps) + steps.each do |step| + # Execute Step + case step[:driver] + when :vmm + if step[:destination] + host = @data[:dest_host] + ssh = @ssh_dst + else + host = @data[:host] + ssh = @ssh_src + end + + result, info = @vmm.do_action(get_parameters(step[:parameters]), + @id, + host, + step[:action], + :ssh_stream => ssh, + :respond => false, + :stdin => step[:stdin]) + when :vnm + if step[:destination] + vnm = @vnm_dst + else + vnm = @vnm_src + end + + result, info = vnm.do_action(@id, step[:action]) + else + result = DriverExecHelper.RESULT[:failure] + info = "No driver in #{step[:action]}"} + end + + # Save the step info + @data["#{step[:action]}_info".to_sym] = info + + # Roll back steps, store failed info and break steps + if DriverExecHelper.failed?(result) + execute_steps(@data[:fail_actions]) if @data[:fail_actions] + @data[:failed_info] = info + + @vmm.log(@id, + "Failed to execute #{DRIVER_NAMES[step[:driver]]} " \ + "operation: #{step[:action]}.") + break + else + @vmm.log(@id, + "Sussecfully execute #{DRIVER_NAMES[step[:driver]]} " \ + "operation: #{step[:action]}.") + end + end + + return result + end + + # Prepare the parameters for the action step generating a blanck separated + # list of command arguments + # @param [Hash] an action step + def get_parameters(step_params) + parameters = step_params || [] + + parameters.map do |param| + if Symbol===param + @data[param].to_s + else + param + end + end.join(' ') + end + + # Extracts data from the XML argument of the VMM action + # @param [Symbol] corresponding to a XML element + # @param [String] an xpath for the XML element + # @return [String] the element value def get_data(name, xml_path=nil) if xml_path path=xml_path.to_s @@ -85,94 +201,6 @@ class VmmAction @data[name]=@xml_data.elements[path].text end - -=begin - { - :driver => :vmm, - :action => :deploy, - :parameters => [:host, :deploy_id], - :destination => false - :save_info => :deploy_id, - :fail_actions => [], - :pre_log => "", - :post_log => "", - :stdin => nil - } -=end - - def execute_steps(steps) - result=false - info='Action #{step[:action]} not found' - - steps.each do |step| - - driver=step[:driver] || :vmm - - @vmm.log(@id, @data[:pre_log]) if @data[:pre_log] - - case driver - when :vmm - if step[:destination] - host = @data[:dest_host] - ssh = @ssh_dst - else - host = @data[:host] - ssh = @ssh_src - end - - result, info=@vmm.do_action(get_parameters(step), @id, host, - step[:action], - :ssh_stream => ssh, - :respond => false, - :stdin => step[:stdin]) - - when :vnm - if step[:destination] - vnm=@vnm_dst - else - vnm=@vnm_src - end - - result, info=vnm.do_action(@id, step[:action]) - else - end - - # Save the info variable if asked for - if @data[:save_info] - @data[@data[:save_info]]=info - end - - if @vmm.failed?(result) - if @data[:fail_actions] - execute_steps(@data[:fail_actions]) - end - - break - end - - @vmm.log(@id, @data[:post_log]) if @data[:post_log] - end - - return result, info - end - - def run(steps) - result, info=execute_steps(steps) - - @vmm.send_message(VirtualMachineDriver::ACTION[@main_action], - result, @id, info) - end - - def get_parameters(step) - parameters=step[:parameters] || [] - parameters.map do |param| - if Symbol===param - @data[param].to_s - else - param - end - end.join(' ') - end end @@ -180,7 +208,9 @@ end class ExecDriver < VirtualMachineDriver attr_reader :options - # SshDriver constructor + # Initializes the VMM driver + # @param [String] hypervisor name identifies the plugin + # @param [OpenNebulaDriver::options] def initialize(hypervisor, options={}) @options={ :threaded => true @@ -191,20 +221,26 @@ class ExecDriver < VirtualMachineDriver @hypervisor = hypervisor end + # Creates an SshStream to execute commands on the target host + # @param[String] the hostname of the host + # @param[String] id of the VM to log messages + # @return [SshStreamCommand] def get_ssh_stream(host, id) SshStreamCommand.new(host, @remote_scripts_base_path, log_method(id)) end + #--------------------------------------------------------------------------- + # Virtual Machine Manager Protocol Actions + #--------------------------------------------------------------------------- + # # DEPLOY action, sends the deployment file to remote host + # def deploy(id, drv_message) # ---------------------------------------------------------------------- # Initialization of deployment data # ---------------------------------------------------------------------- - - action=VmmAction.new(self, id, :deploy, drv_message) - local_dfile=action.data[:local_dfile] if !local_dfile || File.zero?(local_dfile) @@ -221,28 +257,33 @@ class ExecDriver < VirtualMachineDriver dfile = action.data[:remote_dfile] end + # ---------------------------------------------------------------------- + # Deployment Steps + # ---------------------------------------------------------------------- + action = VmmAction.new(self, id, :deploy, drv_message) + steps=[ + # Execute pre-boot networking setup { - :driver => :vnm, - :action => :pre, - :post_log => "Successfully executed network driver " << - "#{action.data[:net_drv]} (pre-boot)" + :driver => :vnm, + :action => :pre }, + # Boot the Virtual Machine { - :driver => :vmm, - :action => :deploy, - :parameters => [dfile, :host], - :stdin => domain, - :save_info => :deploy_id - }, + :driver => :vmm, + :action => :deploy, + :parameters => [dfile, :host], + :stdin => domain + }, + # Execute post-boot networking setup { - :driver => :vnm, - :action => :post, - :fail_actions => [ + :driver => :vnm, + :action => :post, + :fail_actions => [ { :driver => :vmm, :action => :cancel, - :parameters => [:deploy_id, :host] + :parameters => [:deploy_info, :host] } ] } @@ -251,187 +292,149 @@ class ExecDriver < VirtualMachineDriver action.run(steps) end - # Basic Domain Management Operations - + # + # SHUTDOWN action, graceful shutdown and network clean up + # def shutdown(id, drv_message) - action=VmmAction.new(self, id, :shutdown, drv_message) + action = VmmAction.new(self, id, :shutdown, drv_message) steps=[ + # Shutdown the Virtual Machine { :driver => :vmm, :action => :shutdown, - :parameters => [:deploy_id, :host], - :post_log => "Successfully shut down VM with id: " << - action.data[:deploy_id] + :parameters => [:deploy_id, :host] }, + # Execute networking clean up operations { - :driver => :vnm, - :action => :clean, - :post_log => "Successfully executed network driver " << - "#{action.data[:net_drv]} (clean-shutdown)" + :driver => :vnm, + :action => :clean } } action.run(steps) end + # + # CANCEL action, destroys a VM and network clean up + # def cancel(id, drv_message) - action=VmmAction.new(self, id, :cancel, drv_message) + action = VmmAction.new(self, id, :cancel, drv_message) steps=[ + # Cancel the Virtual Machine { :driver => :vmm, :action => :cancel, - :parameters => [:deploy_id, :host], - :post_log => "Successfully canceled VM with id: " << - action.data[:deploy_id] + :parameters => [:deploy_id, :host] }, + # Execute networking clean up operations { - :driver => :vnm, - :action => :clean, - :post_log => "Successfully executed network driver " << - "#{action.data[:net_drv]} (clean-cancel)" + :driver => :vnm, + :action => :clean } ] action.run(steps) end + # + # SAVE action, stops the VM and saves its state, network is cleaned up + # def save(id, drv_message) - action=VmmAction.new(self, id, :save, drv_message) + action = VmmAction.new(self, id, :save, drv_message) steps=[ + # Save the Virtual Machine state { :driver => :vmm, :action => :save, - :parameters => [:deploy_id, :checkpoint_file, :host], - :post_log => "Successfully saved VM with id: " << - action.data[:deploy_id] + :parameters => [:deploy_id, :checkpoint_file, :host] }, + # Execute networking clean up operations { - :driver => :vnm, - :action => :clean, - :post_log => "Successfully executed network driver " << - "#{action.data[:net_drv]} (clean-save)" + :driver => :vnm, + :action => :clean } ] action.run(steps) end + # + # RESTORE action, restore a VM from a previous state, and restores network + # def restore(id, drv_message) action=VmmAction.new(self, id, :restore, drv_message) steps=[ + # Execute pre-boot networking setup { :driver => :vnm, - :action => :pre, - :post_log => "Successfully executed network driver " << - "#{action.data[:net_drv]} (pre-restore)" + :action => :pre }, + # Restore the Virtual Machine from checkpoint { :driver => :vmm, :action => :restore, - :parameters => [:checkpoint_file, :host], - :save_info => :deploy_id, - :post_log => "Successfully restored VM with id: " << - action.data[:deploy_id] + :parameters => [:checkpoint_file, :host] }, + # Execute post-boot networking setup { - :driver => :vnm, - :action => :post, - :fail_actions => [ + :driver => :vnm, + :action => :post, + :fail_actions => [ { - :pre_log => "Failed to execute network driver" << - "#{action.data[:net_drv]} (post-restore). " << - "Cancelling VM with id: #{action.data[:deploy_id]}" :driver => :vmm, :action => :cancel, :parameters => [:deploy_id, :host] } ], - :post_log => "Successfully executed network driver " << - "#{action.data[:net_drv]} (post-restore)" } ] action.run(steps) end + # + # MIGRATE (live) action, migrates a VM to another host creating network + # def migrate(id, drv_message) - data = decode(drv_message) - net_drv = data.elements['NET_DRV'].text - host = data.elements['HOST'].text - deploy_id = data.elements['DEPLOY_ID'].text - dest_host = data.elements['MIGR_HOST'].text - dest_driver = data.elements['MIGR_NET_DRV'].text + action=VmmAction.new(self, id, :migrate, drv_message) - ssh_src = SshStreamCommand.new(host, - @remote_scripts_base_path, - log_method(id)) + steps=[ + # Execute pre-boot networking setup on migrating host + { + :driver => :vnm, + :action => :pre, + :destination => true + }, + # Migrate the Virtual Machine + { + :driver => :vmm, + :action => :migrate, + :parameters => [:deploy_id, :migr_host, :host] + }, + # Execute networking clean up operations + { + :driver => :vnm, + :action => :clean + }, + # Execute post-boot networking setup on migrating host + { + :driver => :vnm, + :action => :post, + :destination => :true + #TODO :fail_action what to do here? cancel VM? + }, + ] - ssh_dst = SshStreamCommand.new(dest_host, - @remote_scripts_base_path, - log_method(id)) - - vnm_src = VirtualNetworkDriver.new(net_drv, - :local_actions => @options[:local_actions], - :message => data, - :ssh_stream => ssh_src) - - vnm_dst = VirtualNetworkDriver.new(dest_driver, - :local_actions => @options[:local_actions], - :message => data, - :ssh_stream => ssh_dst) - - # ---------------------------------------------------------------------- - # Execute pre-boot action of the network driver - # ---------------------------------------------------------------------- - - result, info = vnm_dst.do_action(id, :pre) - - if failed?(result) - send_message(ACTION[:migrate], result, id,info) - return - end - - log(id, "Successfully executed network driver #{net_drv} (pre-migrate)") - - result, info = do_action("#{deploy_id} #{dest_host} #{host}", id, host, - :migrate, - :save, - :ssh_stream => ssh_src, - :respond => false) - if failed?(result) - send_message(ACTION[:migrate], result, id, info) - return - end - - log(id, "Successfully migrated VM with id: #{deploy_id}") - - # ---------------------------------------------------------------------- - # Execute post-migrate action of the network driver - # ---------------------------------------------------------------------- - - result, info = vnm_dst.do_action(id, :post) - - if failed?(result) - log(id, "Failed to executed network driver #{dest_driver} (post-migrate)") - log(id, "Canceling VM with id: #{deploy_id}") - - do_action("#{deploy_id} #{host}", id, dest_host, :cancel, - :ssh_stream => ssh_dst, - :respond => false) - - send_message(ACTION[:restore], result, id, info) - return - end - - log(id, "Successfully executed network driver #{net_drv} (post-restore)") - - send_message(ACTION[:restore], RESULT[:success], id, deploy_id) + action.run(steps) end + # + # POLL action, gets information of a VM + # def poll(id, drv_message) data = decode(drv_message) host = data.elements['HOST'].text @@ -441,7 +444,12 @@ class ExecDriver < VirtualMachineDriver end end -# SshDriver Main program +################################################################################ +# +# Virtual Machine Manager Execution Driver - Main Program +# +################################################################################ + opts = GetoptLong.new( [ '--retries', '-r', GetoptLong::OPTIONAL_ARGUMENT ], [ '--threads', '-t', GetoptLong::OPTIONAL_ARGUMENT ], From e5c4aeaba2b9436119041cbac0b8bf3ab7bc748e Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 30 Nov 2011 16:09:03 +0100 Subject: [PATCH 092/157] Minor fixes to GUIs style. (cherry picked from commit bd2d5b557c3b973652e8760447a958a576450b53) --- src/ozones/Server/public/css/application.css | 6 +++--- src/sunstone/public/css/application.css | 6 +++--- src/sunstone/public/js/sunstone.js | 6 ++++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ozones/Server/public/css/application.css b/src/ozones/Server/public/css/application.css index 1ecaeec46d..e8212b067b 100644 --- a/src/ozones/Server/public/css/application.css +++ b/src/ozones/Server/public/css/application.css @@ -471,15 +471,15 @@ tr.even:hover{ font-size: 1.2em; } -.jGrowl-notification, .jGrowl-closer, .jGrowl-notify-submit { +.jGrowl-notification, .jGrowl-notify-submit { border: 2px #444444 solid; - background-color: #F3F3F3; + background-color: #F3F3F3!important; color: #666666; } .jGrowl-notify-error { border: 2px #660000 solid; - background-color: #F39999; + background-color: #F39999!important; color: #660000; } diff --git a/src/sunstone/public/css/application.css b/src/sunstone/public/css/application.css index 03dc2c0a14..612e9fd012 100644 --- a/src/sunstone/public/css/application.css +++ b/src/sunstone/public/css/application.css @@ -478,15 +478,15 @@ tr.even:hover{ font-size: 1.2em; } -.jGrowl-notification, .jGrowl-closer, .jGrowl-notify-submit { +.jGrowl-notification, .jGrowl-notify-submit { border: 2px #444444 solid; - background-color: #F3F3F3; + background-color: #F3F3F3!important; color: #666666; } .jGrowl-notify-error { border: 2px #660000 solid; - background-color: #F39999; + background-color: #F39999!important; color: #660000; } diff --git a/src/sunstone/public/js/sunstone.js b/src/sunstone/public/js/sunstone.js index 99bff73ac0..69ec72f0ed 100644 --- a/src/sunstone/public/js/sunstone.js +++ b/src/sunstone/public/js/sunstone.js @@ -686,6 +686,12 @@ function setupConfirmDialogs(){ var value = $(this).val(); var action = SunstoneCfg["actions"][value]; var param = $('select#confirm_select',context).val(); + + if (!param.length){ + notifyError("You must select a value"); + return false; + }; + if (!action) { notifyError("Action "+value+" not defined."); return false;}; switch (action.type){ case "multiple": //find the datatable From 536d69b5ab017f2a04facc865d810b5c6561e485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 1 Dec 2011 07:50:37 -0800 Subject: [PATCH 093/157] Feature #602: Change onevnet show format to separate used, free and 'on hold' leases --- src/cli/one_helper/onevnet_helper.rb | 18 ++++++++++++------ src/oca/ruby/OpenNebula/XMLUtils.rb | 4 ++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/cli/one_helper/onevnet_helper.rb b/src/cli/one_helper/onevnet_helper.rb index 71ead0d55f..3a59dac76a 100644 --- a/src/cli/one_helper/onevnet_helper.rb +++ b/src/cli/one_helper/onevnet_helper.rb @@ -73,13 +73,19 @@ class OneVNetHelper < OpenNebulaHelper::OneHelper puts str % ["IP_END", vn['RANGE/IP_END']] end - leases_str = vn.template_like_str('/VNET/LEASES', false) + lease_types = [ ["LEASES ON HOLD", 'LEASE[USED=1 and VID=-1]'], + ["USED LEASES", 'LEASE[USED=1 and VID>-1]'], + ["FREE LEASES", 'LEASE[USED=0]'] ] - if !leases_str.empty? - puts - CLIHelper.print_header(str_h1 % ["LEASES INFORMATION"], false) - puts leases_str - end + lease_types.each { |pair| + leases_str = vn.template_like_str('/VNET/LEASES', false, pair[1]) + + if !leases_str.empty? + puts + CLIHelper.print_header(str_h1 % [pair[0]], false) + puts leases_str + end + } end def format_pool(options) diff --git a/src/oca/ruby/OpenNebula/XMLUtils.rb b/src/oca/ruby/OpenNebula/XMLUtils.rb index 1dfa884532..3505fb9cc6 100644 --- a/src/oca/ruby/OpenNebula/XMLUtils.rb +++ b/src/oca/ruby/OpenNebula/XMLUtils.rb @@ -201,7 +201,7 @@ module OpenNebula template_like_str('TEMPLATE', indent) end - def template_like_str(root_element, indent=true) + def template_like_str(root_element, indent=true, xpath_exp=nil) if NOKOGIRI xml_template=@xml.xpath(root_element).to_s rexml=REXML::Document.new(xml_template).root @@ -217,7 +217,7 @@ module OpenNebula ind_tab=' ' end - str=rexml.collect {|n| + str=rexml.elements.collect(xpath_exp) {|n| if n.class==REXML::Element str_line="" if n.has_elements? From dfb7efc4cfc3d6a1cf2e4551238c24fa1ee526e8 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 1 Dec 2011 18:02:49 +0100 Subject: [PATCH 094/157] bug #1011: Update user_pool_cache in Sunstone when logging --- src/cloud/common/CloudAuth.rb | 25 ++++++++++++++----------- src/sunstone/sunstone-server.rb | 1 + 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/cloud/common/CloudAuth.rb b/src/cloud/common/CloudAuth.rb index f3fe29ca15..b69934dd81 100644 --- a/src/cloud/common/CloudAuth.rb +++ b/src/cloud/common/CloudAuth.rb @@ -44,8 +44,11 @@ class CloudAuth def initialize(conf) @conf = conf + # @token_expiration_delta: Number of seconds that will be used + # the same timestamp for the token generation + # @token_expiration_time: Current timestamp to be used in tokens. @token_expiration_delta = @conf[:token_expiration_delta] || EXPIRE_DELTA - @token_expiration_time = Time.now.to_i + @token_expiration_delta + @token_expiration_time = Time.now.to_i + @token_expiration_delta if AUTH_MODULES.include?(@conf[:auth]) require 'CloudAuth/' + AUTH_MODULES[@conf[:auth]] @@ -78,14 +81,23 @@ class CloudAuth Client.new(token,@conf[:one_xmlrpc]) end + def update_userpool_cache + @user_pool = OpenNebula::UserPool.new(client) + + rc = @user_pool.info + if OpenNebula.is_error?(rc) + raise rc.message + end + end + protected def expiration_time time_now = Time.now.to_i if time_now > @token_expiration_time - EXPIRE_MARGIN - update_userpool_cache @token_expiration_time = time_now + @token_expiration_delta + update_userpool_cache end @token_expiration_time @@ -97,15 +109,6 @@ class CloudAuth @user_pool end - def update_userpool_cache - @user_pool = OpenNebula::UserPool.new(client) - - rc = @user_pool.info - if OpenNebula.is_error?(rc) - raise rc.message - end - end - def get_password(username, non_public_user=false) if non_public_user == true xp="USER[NAME=\"#{username}\" and AUTH_DRIVER!=\"public\"]/PASSWORD" diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index e901caa82c..009072ae38 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -89,6 +89,7 @@ helpers do def build_session begin + settings.cloud_auth.update_userpool_cache result = settings.cloud_auth.auth(request.env, params) rescue Exception => e error 500, e.message From d3a88ab53b134ae3a06a67e40ed687e26424d7e9 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 1 Dec 2011 18:05:31 +0100 Subject: [PATCH 095/157] bug #923: Use Image SIZE attribute for STORAGE resources --- src/cloud/occi/lib/ImageOCCI.rb | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/cloud/occi/lib/ImageOCCI.rb b/src/cloud/occi/lib/ImageOCCI.rb index 11c60ae79a..cd573554c3 100755 --- a/src/cloud/occi/lib/ImageOCCI.rb +++ b/src/cloud/occi/lib/ImageOCCI.rb @@ -23,17 +23,15 @@ class ImageOCCI < Image <%= self.id.to_s %> <%= self.name %> - <% if self['TEMPLATE/TYPE'] != nil %> - <%= self['TEMPLATE/TYPE'] %> + <% if self['TYPE'] != nil %> + <%= self['TYPE'] %> <% end %> <% if self['TEMPLATE/DESCRIPTION'] != nil %> <%= self['TEMPLATE/DESCRIPTION'] %> <% end %> - <% if size != nil %> - <%= size.to_i / 1024 %> - <% end %> - <% if fstype != nil %> - <%= fstype %> + <%= self['SIZE'] %> + <% if self['FSTYPE'] != nil %> + <%= self['FSTYPE'] %> <% end %> <%= self['PUBLIC'] == "0" ? "NO" : "YES"%> <%= self['PERSISTENT'] == "0" ? "NO" : "YES"%> @@ -84,25 +82,18 @@ class ImageOCCI < Image # Creates the OCCI representation of an Image def to_occi(base_url) - size = nil - begin - if self['SOURCE'] != nil and File.exists?(self['SOURCE']) - size = File.stat(self['SOURCE']).size - size = size / 1024 - end - - fstype = self['TEMPLATE/FSTYPE'] if self['TEMPLATE/FSTYPE'] + occi_im = ERB.new(OCCI_IMAGE) + occi_im_text = occi_im.result(binding) rescue Exception => e error = OpenNebula::Error.new(e.message) return error end - occi = ERB.new(OCCI_IMAGE) - return occi.result(binding).gsub(/\n\s*/,'') + return occi_im_text.gsub(/\n\s*/,'') end - def to_one_template() + def to_one_template if @image_info == nil error_msg = "Missing STORAGE section in the XML body" error = OpenNebula::Error.new(error_msg) From b0baf862db8db71d6b1496ad602be29f0ad9eed6 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 1 Dec 2011 18:35:01 +0100 Subject: [PATCH 096/157] Fix typo in onevnet chgrp --- src/cli/onevnet | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cli/onevnet b/src/cli/onevnet index 72ab53716a..b5101c05a6 100755 --- a/src/cli/onevnet +++ b/src/cli/onevnet @@ -136,7 +136,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do Changes the Virtual Network group EOT - command :chgrp, chgrp_desc,[:range, :vnid_list], :groupid do + command :chgrp, chgrp_desc,[:range, :vnetid_list], :groupid do helper.perform_actions(args[0],options,"Group changed") do |vn| vn.chown(-1, args[1].to_i) end @@ -146,7 +146,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do Changes the Virtual Network owner and group EOT - command :chown, chown_desc, [:range, :vnid_list], :userid, + command :chown, chown_desc, [:range, :vnetid_list], :userid, [:groupid,nil] do gid = args[2].nil? ? -1 : args[2].to_i helper.perform_actions(args[0],options,"Owner/Group changed") do |vn| From 4036e5d1ea24e6ea0e8743f9137733366b8f0c9b Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Thu, 1 Dec 2011 19:25:17 +0100 Subject: [PATCH 097/157] Feature #1004: Add internationalization support for Sunstone This commit enables internationalization support for the Sunstone interface. Language is chosen according to the variable LANG in user's template. This variable is automaticly set when users chooses a new language from the select field on top, so that it is preserved on future logins. If no LANG is set, language is chosen according to the :lang: variable of the configuration. Otherwise it defaults to English. Special thanks to ZAO VIVOSS i OI for contributing the initial patch for OpenNebula Sunstone 3.0 and the first translation: russian. The contents from this patch have been partially applied with the necessary corrections and improvements to the master branch, which was ahead on many aspects to the 3.0 release. --- install.sh | 19 +- src/sunstone/etc/sunstone-server.conf | 3 + .../models/OpenNebulaJSON/UserJSON.rb | 2 +- src/sunstone/public/css/layout.css | 12 + src/sunstone/public/js/locale.js | 48 + src/sunstone/public/js/plugins/acls-tab.js | 122 +- .../public/js/plugins/dashboard-tab.js | 52 +- .../public/js/plugins/dashboard-users-tab.js | 32 +- src/sunstone/public/js/plugins/groups-tab.js | 30 +- src/sunstone/public/js/plugins/hosts-tab.js | 124 +- src/sunstone/public/js/plugins/images-tab.js | 243 ++-- .../public/js/plugins/templates-tab.js | 529 ++++----- src/sunstone/public/js/plugins/users-tab.js | 82 +- src/sunstone/public/js/plugins/vms-tab.js | 212 ++-- src/sunstone/public/js/plugins/vnets-tab.js | 158 +-- src/sunstone/public/js/sunstone-util.js | 32 +- src/sunstone/public/js/sunstone.js | 20 +- src/sunstone/public/locale/ru/ru.js | 1036 +++++++++++++++++ .../public/locale/ru/ru_datatable.txt | 17 + src/sunstone/sunstone-server.rb | 22 +- src/sunstone/views/index.erb | 18 +- 21 files changed, 2007 insertions(+), 806 deletions(-) create mode 100644 src/sunstone/public/js/locale.js create mode 100644 src/sunstone/public/locale/ru/ru.js create mode 100644 src/sunstone/public/locale/ru/ru_datatable.txt diff --git a/install.sh b/install.sh index 6a9cccc32a..02c1626db8 100755 --- a/install.sh +++ b/install.sh @@ -247,6 +247,9 @@ SUNSTONE_DIRS="$SUNSTONE_LOCATION/models \ $SUNSTONE_LOCATION/public/js/plugins \ $SUNSTONE_LOCATION/public/js/user-plugins \ $SUNSTONE_LOCATION/public/css \ + $SUNSTONE_LOCATION/public/locale \ + $SUNSTONE_LOCATION/public/locale/en_US \ + $SUNSTONE_LOCATION/public/locale/ru \ $SUNSTONE_LOCATION/public/vendor \ $SUNSTONE_LOCATION/public/vendor/jQueryLayout \ $SUNSTONE_LOCATION/public/vendor/dataTables \ @@ -417,6 +420,8 @@ INSTALL_SUNSTONE_FILES=( SUNSTONE_PUBLIC_VENDOR_JQUERYLAYOUT:$SUNSTONE_LOCATION/public/vendor/jQueryLayout SUNSTONE_PUBLIC_VENDOR_FLOT:$SUNSTONE_LOCATION/public/vendor/flot SUNSTONE_PUBLIC_IMAGES_FILES:$SUNSTONE_LOCATION/public/images + SUNSTONE_PUBLIC_LOCALE_EN_US:$SUNSTONE_LOCATION/public/locale/en_US + SUNSTONE_PUBLIC_LOCALE_RU:$SUNSTONE_LOCATION/public/locale/ru ) INSTALL_SUNSTONE_ETC_FILES=( @@ -1001,7 +1006,8 @@ SUNSTONE_PUBLIC_JS_FILES="src/sunstone/public/js/layout.js \ src/sunstone/public/js/login.js \ src/sunstone/public/js/sunstone.js \ src/sunstone/public/js/sunstone-util.js \ - src/sunstone/public/js/opennebula.js" + src/sunstone/public/js/opennebula.js \ + src/sunstone/public/js/locale.js" SUNSTONE_PUBLIC_JS_PLUGINS_FILES="\ src/sunstone/public/js/plugins/dashboard-tab.js \ @@ -1082,6 +1088,14 @@ SUNSTONE_PUBLIC_IMAGES_FILES="src/sunstone/public/images/ajax-loader.gif \ src/sunstone/public/images/vnc_off.png \ src/sunstone/public/images/vnc_on.png" +SUNSTONE_PUBLIC_LOCALE_EN_US="" + +SUNSTONE_PUBLIC_LOCALE_RU=" +src/sunstone/public/locale/ru/ru.js \ +src/sunstone/public/locale/ru/ru_datatable.txt" + + + #----------------------------------------------------------------------------- # Ozones files #----------------------------------------------------------------------------- @@ -1141,7 +1155,8 @@ OZONES_PUBLIC_JS_FILES="src/ozones/Server/public/js/ozones.js \ src/ozones/Server/public/js/ozones-util.js \ src/sunstone/public/js/layout.js \ src/sunstone/public/js/sunstone.js \ - src/sunstone/public/js/sunstone-util.js" + src/sunstone/public/js/sunstone-util.js \ + src/sunstone/public/js/locale.js" OZONES_PUBLIC_CSS_FILES="src/ozones/Server/public/css/application.css \ src/ozones/Server/public/css/layout.css \ diff --git a/src/sunstone/etc/sunstone-server.conf b/src/sunstone/etc/sunstone-server.conf index 2311501782..4993e571d9 100644 --- a/src/sunstone/etc/sunstone-server.conf +++ b/src/sunstone/etc/sunstone-server.conf @@ -20,3 +20,6 @@ # VNC Configuration :vnc_proxy_base_port: 29876 :novnc_path: + +# Default language setting +:lang: en_US \ No newline at end of file diff --git a/src/sunstone/models/OpenNebulaJSON/UserJSON.rb b/src/sunstone/models/OpenNebulaJSON/UserJSON.rb index 726845d23c..a2d89476a4 100644 --- a/src/sunstone/models/OpenNebulaJSON/UserJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/UserJSON.rb @@ -64,7 +64,7 @@ module OpenNebulaJSON end def update(params=Hash.new) - super(params['raw_template']) + super(params['template_raw']) end def addgroup(params=Hash.new) diff --git a/src/sunstone/public/css/layout.css b/src/sunstone/public/css/layout.css index f5fbf16d98..63630c8911 100644 --- a/src/sunstone/public/css/layout.css +++ b/src/sunstone/public/css/layout.css @@ -169,3 +169,15 @@ background-image: -moz-linear-gradient( #navigation li:hover a, .navigation-active-li-a { color: #ffffff !important; } + +#language { + float:right; + margin-top:2px; + margin-right:25px; + width: 100px; +} + +#language select { + width: 100px; + height: 22px; +} diff --git a/src/sunstone/public/js/locale.js b/src/sunstone/public/js/locale.js new file mode 100644 index 0000000000..5aa681fe6c --- /dev/null +++ b/src/sunstone/public/js/locale.js @@ -0,0 +1,48 @@ +var lang="" +var locale = {}; +var datatable_lang = ""; + +function tr(str){ + var tmp = locale[str]; + if ( tmp == null || tmp == "" ) { + //console.debug("trans: "+str); + tmp = str; + } + return tmp; +}; + +function setLang(lang_str){ + $('
                          Loading new language... please wait '+spinner+'
                          ').dialog({ + draggable:false, + modal:true, + resizable:false, + buttons:{}, + width: 460, + minHeight: 50 + + }); + + var template = "LANG="+lang_str; + var obj = { + data: { + id: uid, + extra_param: template + }, + error: onError + }; + OpenNebula.User.update(obj); + $.post('config',JSON.stringify({lang:lang_str}),refreshLang); +}; + +function refreshLang(){ + window.location.href = "."; +}; + +$(document).ready(function(){ + if (lang) + $('#lang_sel option[value="'+lang+'"]').attr("selected","selected"); + $('#lang_sel').change(function(){ + setLang($(this).val()); + }); + +}); \ No newline at end of file diff --git a/src/sunstone/public/js/plugins/acls-tab.js b/src/sunstone/public/js/plugins/acls-tab.js index ad94ffd2b6..3dfd077b6d 100644 --- a/src/sunstone/public/js/plugins/acls-tab.js +++ b/src/sunstone/public/js/plugins/acls-tab.js @@ -25,12 +25,12 @@ var acls_tab_content = \ \ \ - \ - \ - \ - \ - \ - \ + \ + \ + \ + \ + \ + \ \ \ \ @@ -42,48 +42,48 @@ var create_acl_tmpl = '\
                          \
                          \ - \ + \ \
                          \ - \ - Hosts
                          \ - Virtual Machines
                          \ - Virtual Networks
                          \ - Images
                          \ - Templates
                          \ - Users
                          \ - Groups
                          \ + \ + '+tr("Hosts")+'
                          \ + '+tr("Virtual Machines")+'
                          \ + '+tr("Virtual Networks")+'
                          \ + '+tr("Images")+'
                          \ + '+tr("Templates")+'
                          \ + '+tr("Users")+'
                          \ + '+tr("Groups")+'
                          \
                          \ - \ - All
                          \ - Specific ID
                          \ - Owned by group
                          \ + \ + '+tr("All")+'
                          \ + '+tr("Specific ID")+'
                          \ + '+tr("Owned by group")+'
                          \
                          \ - \ + \ \
                          \ - \ + \ \
                          \ - \ - Create
                          \ - Delete
                          \ - Use
                          \ - Manage
                          \ - Get Information
                          \ - Get Pool of resources
                          \ - Get Pool of my/group\'s resources
                          \ - Change owner
                          \ - Deploy
                          \ + \ + '+tr("Create")+'
                          \ + '+tr("Delete")+'
                          \ + '+tr("Use")+'
                          \ + '+tr("Manage")+'
                          \ + '+tr("Get Information")+'
                          \ + '+tr("Get Pool of resources")+'
                          \ + '+tr("Get Pool of my/group\'s resources")+'
                          \ + '+tr("Change owner")+'
                          \ + '+tr("Deploy")+'
                          \
                          \ - \ + \ \
                          \
                          \
                          \
                          \ - \ - \ + \ + \
                          \
                          \ '; @@ -143,21 +143,21 @@ var acl_actions = { var acl_buttons = { "Acl.refresh" : { type: "image", - text: "Refresh list", + text: tr("Refresh list"), img: "images/Refresh-icon.png" }, "Acl.create_dialog" : { type: "create_dialog", - text: "+ New" + text: tr("+ New") }, "Acl.delete" : { type: "action", - text: "Delete" + text: tr("Delete") } } var acls_tab = { - title: "ACLs", + title: tr("ACLs"), content: acls_tab_content, buttons: acl_buttons } @@ -179,14 +179,14 @@ function aclElements(){ function parseUserAcl(user){ var user_str=""; if (user[0] == '*'){ - user_str = "All"; + user_str = tr("All"); } else { if (user[0] == '#'){ - user_str="User "; + user_str=tr("User")+" "; user_str+= getUserName(user.substring(1)); } else if (user[0] == '@'){ - user_str="Group "; + user_str=tr("Group "); user_str+= getGroupName(user.substring(1)); }; }; @@ -197,14 +197,14 @@ function parseUserAcl(user){ function parseResourceAcl(user){ var user_str=""; if (user[0] == '*'){ - user_str = "All"; + user_str = tr("All"); } else { if (user[0] == '#'){ - user_str="ID "; + user_str=tr("ID")+" "; user_str+= user.substring(1); } else if (user[0] == '@'){ - user_str="Group "; + user_str=tr("Group")+" "; user_str+= getGroupName(user.substring(1)); }; }; @@ -232,25 +232,25 @@ function parseAclString(string) { for (var i=0; i'); + dialogs_context.append('
                          '); $create_acl_dialog = $('#create_acl_dialog',dialogs_context); var dialog = $create_acl_dialog; dialog.html(create_acl_tmpl); @@ -391,13 +391,13 @@ function setupCreateAclDialog(){ $('#create_acl_form',dialog).submit(function(){ var user = $('#applies',this).val(); if (!user.length) { - notifyError("Please specify to who this ACL applies"); + notifyError(tr("Please specify to who this ACL applies")); return false; }; var resources = $('.resource_cb:checked',this).length; if (!resources) { - notifyError("Please select at least one resource"); + notifyError(tr("Please select at least one resource")); return false; } @@ -406,7 +406,7 @@ function setupCreateAclDialog(){ case "res_id": var l=$('#res_id',this).val().length; if (!l){ - notifyError("Please provide a resource ID for the resource(s) in this rule"); + notifyError(tr("Please provide a resource ID for the resource(s) in this rule")); return false; } break; @@ -441,15 +441,15 @@ function popUpCreateAclDialog(){ var users = $(''); $('.empty_value',users).remove(); $('option',users).addClass("user"); - users.prepend(''); + users.prepend(''); var groups = $(''); $('.empty_value',groups).remove(); $('option',groups).addClass("group"); - groups.prepend(''); + groups.prepend(''); var dialog = $create_acl_dialog; - $('#applies',dialog).html(''+ + $('#applies',dialog).html(''+ users.html()+groups.html()); $('#belonging_to',dialog).html(groups_select); @@ -480,7 +480,11 @@ $(document).ready(function(){ { "bSortable": false, "aTargets": ["check"] }, { "sWidth": "60px", "aTargets": [0] }, { "sWidth": "35px", "aTargets": [1] } - ] + ], + "oLanguage": (datatable_lang != "") ? + { + sUrl: "locale/"+lang+"/"+datatable_lang + } : "" }); dataTable_acls.fnClearTable(); addElement([ diff --git a/src/sunstone/public/js/plugins/dashboard-tab.js b/src/sunstone/public/js/plugins/dashboard-tab.js index 92a38ba49c..d573a6ca23 100644 --- a/src/sunstone/public/js/plugins/dashboard-tab.js +++ b/src/sunstone/public/js/plugins/dashboard-tab.js @@ -50,40 +50,40 @@ var dashboard_tab_content =
                          \ \ \ @@ -118,19 +118,19 @@ var dashboard_tab_content = \
                          AllIDApplies toAffected resourcesResource ID / Owned byAllowed operations'+tr("All")+''+tr("ID")+''+tr("Applies to")+''+tr("Affected resources")+''+tr("Resource ID / Owned by")+''+tr("Allowed operations")+'
                          \
                          \ -

                          Summary of resources

                          \ +

                          ' + tr('Summary of resources') + '

                          \
                          \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \
                          Hosts (total/active)' + tr('Hosts (total/active)') + '
                          Groups' + tr('Groups') + '
                          VM Templates (total/public)' + tr('VM Templates (total/public)') + '
                          VM Instances (total/running/failed)' + tr('VM Instances')+' (' + tr('total') + '/' + tr('running') + '/' + tr('failed') + ')
                          Virtual Networks (total/public)' + tr('Virtual Networks (total/public)') + '
                          Images (total/public)' + tr('Images (total/public)') + '
                          Users' + tr('Users')+'
                          ACL Rules' + tr('ACL Rules') + '
                          \ @@ -95,18 +95,18 @@ var dashboard_tab_content =
                          \
                          \ -

                          Quickstart

                          \ +

                          ' + tr('Quickstart') + '

                          \
                          \
                          \ - \ - Host
                          \ - VM Instance
                          \ - VM Template
                          \ - Virtual Network
                          \ - Image
                          \ - User
                          \ - Group
                          \ - Acl
                          \ + \ + ' + tr('Host') + '
                          \ + ' + tr('VM Instance') + '
                          \ + ' + tr('VM Template') + '
                          \ + ' + tr('Virtual Network') + '
                          \ + ' + tr('Image') + '
                          \ + ' + tr('User') + '
                          \ + ' + tr('Group') + '
                          \ + ' + tr('Acl') + '
                          \
                          \
                          \
                          \
                          \ -

                          Historical monitoring information

                          \ +

                          ' + tr('Historical monitoring information') + '

                          \
                          \ \ - \ + \ \ \ - \ + \ \ \ - \ + \ \ \ - \ + \ \ \
                          Hosts CPU
                          ' + tr('Hosts CPU') + '
                          '+spinner+'
                          Hosts memory
                          ' + tr('Hosts memory') + '
                          '+spinner+'
                          Total VM count
                          ' + tr('Total VM count') + '
                          '+spinner+'
                          VM Network stats
                          ' + tr('VM Network stats') + '
                          '+spinner+'
                          \ @@ -143,7 +143,7 @@ var dashboard_tab_content =
                          '; var dashboard_tab = { - title: 'Dashboard', + title: tr('Dashboard'), content: dashboard_tab_content } @@ -163,7 +163,7 @@ function plot_global_graph(data,info){ for (var i=0; i\ \
                          \ -

                          Summary of resources

                          \ +

                          '+tr('Summary of resources')+'

                          \
                          \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \
                          VM Templates (total/public)'+tr('VM Templates (total/public)')+'
                          VM Instances (total/running/failed)'+tr('VM Instances')+' ('+tr('total')+'/'+tr('running')+'/'+tr('failed')+')
                          Virtual Networks (total/public)'+tr('Virtual Networks (total/public)')+'
                          Images (total/public)'+tr('Images (total/public)')+'
                          \ @@ -79,14 +79,14 @@ var dashboard_tab_content = \ \
                          \ -

                          Quickstart

                          \ +

                          '+tr('Quickstart')+'

                          \
                          \
                          \ \ - VM Template
                          \ - VM Instance
                          \ - Virtual Network
                          \ - Image
                          \ + '+tr('VM Template')+'
                          \ + '+tr('VM Instance')+'
                          \ + '+tr('Virtual Network')+'
                          \ + '+tr('Image')+'
                          \
                          \
                          \ \ @@ -98,19 +98,19 @@ var dashboard_tab_content = \ \
                          \ -

                          Historical monitoring information

                          \ +

                          '+tr('Historical monitoring information')+'

                          \
                          \ \ - \ + \ \ \ - \ + \ \ \ - \ + \ \ \ - \ + \ \ \
                          Total VM count
                          '+tr('Total VM count')+'
                          '+spinner+'
                          Total VM CPU
                          '+tr('Total VM CPU')+'
                          '+spinner+'
                          Total VM Memory
                          '+tr('Total VM Memory')+'
                          '+spinner+'
                          VM Network stats
                          '+tr('VM Network stats')+'
                          '+spinner+'
                          \ @@ -123,7 +123,7 @@ var dashboard_tab_content = '; var dashboard_tab = { - title: 'Dashboard', + title: tr('Dashboard'), content: dashboard_tab_content } diff --git a/src/sunstone/public/js/plugins/groups-tab.js b/src/sunstone/public/js/plugins/groups-tab.js index 0f1b39a5c9..caea4ff5bb 100644 --- a/src/sunstone/public/js/plugins/groups-tab.js +++ b/src/sunstone/public/js/plugins/groups-tab.js @@ -25,10 +25,10 @@ var groups_tab_content = \ \ \ - \ - \ - \ - \ + \ + \ + \ + \ \ \ \ @@ -40,14 +40,14 @@ var create_group_tmpl = '\
                          \
                          \ - \ + \
                          \
                          \
                          \
                          \
                          \ - \ - \ + \ + \
                          \
                          \ '; @@ -118,12 +118,12 @@ var group_actions = { var group_buttons = { "Group.refresh" : { type: "image", - text: "Refresh list", + text: tr("Refresh list"), img: "images/Refresh-icon.png" }, "Group.create_dialog" : { type: "create_dialog", - text: "+ New Group" + text: tr("+ New Group") }, // "Group.chown" : { // type: "confirm_with_select", @@ -135,12 +135,12 @@ var group_buttons = { "Group.delete" : { type: "action", - text: "Delete" + text: tr("Delete") } }; var groups_tab = { - title: 'Groups', + title: tr("Groups"), content: groups_tab_content, buttons: group_buttons } @@ -228,7 +228,7 @@ function updateGroupsView(request, group_list){ //Prepares the dialog to create function setupCreateGroupDialog(){ - dialogs_context.append('
                          '); + dialogs_context.append('
                          '); $create_group_dialog = $('#create_group_dialog',dialogs_context); var dialog = $create_group_dialog; @@ -276,7 +276,11 @@ $(document).ready(function(){ { "bSortable": false, "aTargets": ["check"] }, { "sWidth": "60px", "aTargets": [0] }, { "sWidth": "35px", "aTargets": [1] } - ] + ], + "oLanguage": (datatable_lang != "") ? + { + sUrl: "locale/"+lang+"/"+datatable_lang + } : "" }); dataTable_groups.fnClearTable(); diff --git a/src/sunstone/public/js/plugins/hosts-tab.js b/src/sunstone/public/js/plugins/hosts-tab.js index c54d9a78d9..98b3a07ea8 100644 --- a/src/sunstone/public/js/plugins/hosts-tab.js +++ b/src/sunstone/public/js/plugins/hosts-tab.js @@ -19,13 +19,13 @@ var HOST_HISTORY_LENGTH = 40; var host_graphs = [ { - title : "CPU Monitoring information", + title : tr("CPU Monitoring information"), monitor_resources : "cpu_usage,used_cpu,max_cpu", humanize_figures : false, history_length : HOST_HISTORY_LENGTH }, { - title: "Memory monitoring information", + title: tr("Memory monitoring information"), monitor_resources : "mem_usage,used_mem,max_mem", humanize_figures : true, history_length : HOST_HISTORY_LENGTH @@ -40,13 +40,13 @@ var hosts_tab_content =
                          AllIDNameUsers'+tr("All")+''+tr("ID")+''+tr("Name")+''+tr("Users")+'
                          \ \ \ - \ - \ - \ - \ - \ - \ - \ + \ + \ + \ + \ + \ + \ + \ \ \ \ @@ -57,42 +57,42 @@ var hosts_tab_content = var create_host_tmpl = '
                          \
                          \ - Host parameters\ - \ + ' + tr('Host parameters') + '\ + \
                          \ -

                          Drivers

                          \ +

                          ' + tr('Drivers') + '

                          \
                          \
                          \ - \ + \ \
                          \
                          \ - \ + \ \
                          \
                          \ - \ + \ \
                          \
                          \
                          \
                          \ -
                          \ -
                          \ +
                          \ +
                          \
                          \
                          \
                          '; @@ -233,7 +233,7 @@ var host_actions = { type: "single", call: OpenNebula.Host.update, callback: function() { - notifyMessage("Template updated correctly"); + notifyMessage(tr("Template updated correctly")); }, error: onError } @@ -242,51 +242,51 @@ var host_actions = { var host_buttons = { "Host.refresh" : { type: "image", - text: "Refresh list", + text: tr("Refresh list"), img: "images/Refresh-icon.png" }, "Host.create_dialog" : { type: "create_dialog", - text: "+ New" + text: tr("+ New") }, "Host.update_dialog" : { type: "action", - text: "Update a template", + text: tr("Update a template"), alwaysActive: true }, "Host.enable" : { type: "action", - text: "Enable" + text: tr("Enable") }, "Host.disable" : { type: "action", - text: "Disable" + text: tr("Disable") }, "Host.delete" : { type: "action", - text: "Delete host" + text: tr("Delete host") } }; var host_info_panel = { "host_info_tab" : { - title: "Host information", + title: tr("Host information"), content:"" }, "host_template_tab" : { - title: "Host template", + title: tr("Host template"), content: "" }, "host_monitoring_tab": { - title: "Monitoring information", + title: tr("Monitoring information"), content: "" } }; var hosts_tab = { - title: 'Hosts', + title: tr('Hosts'), content: hosts_tab_content, buttons: host_buttons } @@ -420,62 +420,62 @@ function updateHostInfo(request,host){ //Information tab var info_tab = { - title : "Host information", + title : tr("Host information"), content : '
                          AllIDNameRunning VMsCPU UseMemory useStatus' + tr('All') + '' + tr('id') + '' + tr('Name') + '' + tr('Running VMs') + '' + tr('CPU Use') + '' + tr('Memory use') + '' + tr('Status') + '
                          \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ - \ + \ + \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \
                          Host information - '+host_info.NAME+'
                          ' + tr('Host information') + ' - '+host_info.NAME+'
                          ID' + tr('id') + ''+host_info.ID+'
                          State'+OpenNebula.Helper.resource_state("host",host_info.STATE)+'' + tr('State') + ''+tr(OpenNebula.Helper.resource_state("host",host_info.STATE))+'
                          IM MAD' + tr('IM MAD') + ''+host_info.IM_MAD+'
                          VM MAD' + tr('VM MAD') + ''+host_info.VM_MAD+'
                          TM MAD' + tr('TM MAD') + ''+host_info.TM_MAD+'
                          \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ @@ -484,16 +484,16 @@ function updateHostInfo(request,host){ //Template tab var template_tab = { - title : "Host template", + title : tr("Host template"), content : '
                          Host shares
                          ' + tr('Host shares') + '
                          Max Mem' + tr('Max Mem') + ''+humanize_size(host_info.HOST_SHARE.MAX_MEM)+'
                          Used Mem (real)' + tr('Used Mem (real)') + ''+humanize_size(host_info.HOST_SHARE.USED_MEM)+'
                          Used Mem (allocated)' + tr('Used Mem (allocated)') + ''+humanize_size(host_info.HOST_SHARE.MAX_USAGE)+'
                          Used CPU (real)' + tr('Used CPU (real)') + ''+host_info.HOST_SHARE.USED_CPU+'
                          Used CPU (allocated)' + tr('Used CPU (allocated)') + ''+host_info.HOST_SHARE.CPU_USAGE+'
                          Running VMs' + tr('Running VMs') + ''+host_info.HOST_SHARE.RUNNING_VMS+'
                          \ - '+ + '+ prettyPrintJSON(host_info.TEMPLATE)+ '
                          Host template
                          ' + tr('Host template') + '
                          ' } var monitor_tab = { - title: "Monitoring information", + title: tr("Monitoring information"), content : generateMonitoringDivs(host_graphs,"host_monitor_") } @@ -513,7 +513,7 @@ function updateHostInfo(request,host){ //Prepares the host creation dialog function setupCreateHostDialog(){ - dialogs_context.append('
                          '); + dialogs_context.append('
                          '); $create_host_dialog = $('div#create_host_dialog'); var dialog = $create_host_dialog; @@ -529,7 +529,7 @@ function setupCreateHostDialog(){ //Handle the form submission $('#create_host_form',dialog).submit(function(){ if (!($('#name',this).val().length)){ - notifyError("Host name missing!"); + notifyError(tr("Host name missing!")); return false; } var host_json = { @@ -596,7 +596,11 @@ $(document).ready(function(){ { "sWidth": "35px", "aTargets": [1] }, { "sWidth": "100px", "aTargets": [6] }, { "sWidth": "200px", "aTargets": [4,5] } - ] + ], + "oLanguage": (datatable_lang != "") ? + { + sUrl: "locale/"+lang+"/"+datatable_lang + } : "" }); //preload it diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index d8fd88bac8..2ec58f4cd6 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -23,18 +23,18 @@ var images_tab_content = \ \ \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ \ \ \ @@ -44,114 +44,114 @@ var images_tab_content = var create_image_tmpl = '
                          \ -
                          • Wizard
                          • \ -
                          • Advanced mode
                          • \ + \
                            \
                            \ -

                            Fields marked with are mandatory
                            \ +

                            '+tr('Fields marked with')+' '+tr('are mandatory')+'
                            \

                            \
                            \ - \ + \ \ -
                            Name that the Image will get. Every image must have a unique name.
                            \ +
                            '+tr('Name that the Image will get. Every image must have a unique name.')+'
                            \
                            \
                            \ - \ + \ \ -
                            Human readable description of the image for other users.
                            \ +
                            '+tr('Human readable description of the image for other users.')+'
                            \
                            \
                            \
                            \
                            \ - \ + \ \ -
                            Type of the image, explained in detail in the following section. If omitted, the default value is the one defined in oned.conf (install default is OS).
                            \ +
                            '+tr('Type of the image, explained in detail in the following section. If omitted, the default value is the one defined in oned.conf (install default is OS).')+'
                            \
                            \
                            \ - \ + \ \ -
                            Public scope of the image
                            \ +
                            '+tr('Public scope of the image')+'
                            \
                            \
                            \ - \ + \ \ -
                            Persistence of the image
                            \ +
                            '+tr('Persistence of the image')+'
                            \
                            \
                            \ - \ + \ \ -
                            Prefix for the emulated device this image will be mounted at. For instance, “hd”, “sd”. If omitted, the default value is the one defined in oned.conf (installation default is “hd”).
                            \ +
                            '+tr('Prefix for the emulated device this image will be mounted at. For instance, “hd”, “sd”. If omitted, the default value is the one defined in oned.conf (installation default is “hd”).')+'
                            \
                            \
                            \ - \ + \ \ -
                            Type of disk device to emulate.
                            \ +
                            '+tr('Type of disk device to emulate.')+'
                            \
                            \
                            \ - \ + \ \ -
                            Specific image mapping driver. KVM: raw, qcow2 and Xen:tap:aio:, file:
                            \ +
                            '+tr('Specific image mapping driver. KVM: raw, qcow2. XEN: tap:aio, file:')+'
                            \
                            \
                            \
                            \
                            \ - \ + \ \ -
                            \ +
                            \ \ -
                            \ +
                            \ \ - \ -
                            Please choose path if you have a file-based image. Choose source otherwise or create an empty datablock disk.

                            \ + \ +
                            '+tr('Please choose path if you have a file-based image. Choose source otherwise or create an empty datablock disk.')+'

                            \
                            \
                            \ - \ + \ \ -
                            Path to the original file that will be copied to the image repository. If not specified for a DATABLOCK type image, an empty image will be created.
                            \ +
                            '+tr('Path to the original file that will be copied to the image repository. If not specified for a DATABLOCK type image, an empty image will be created.')+'
                            \
                            \
                            \ - \ + \ \ -
                            Source to be used in the DISK attribute. Useful for not file-based images.
                            \ +
                            '+tr('Source to be used in the DISK attribute. Useful for not file-based images.')+'
                            \
                            \
                            \ - \ + \ \ -
                            Size of the datablock in MB.
                            \ +
                            '+tr('Size of the datablock in MB.')+'
                            \
                            \
                            \ - \ + \ \ -
                            Type of file system to be built. This can be any value understood by mkfs unix command.
                            \ +
                            '+tr('Type of file system to be built. This can be any value understood by mkfs unix command.')+'
                            \
                            \
                            \
                            \
                            \ - \ + \ \ - \ + \ \ - \ - \ + \ + \
                            \ - \ + \ \
                            \
                            \
                            \
                            \ - \ - \ + \ + \
                            \
                            \ \ @@ -159,16 +159,16 @@ var create_image_tmpl =
                            \
                            \
                            \ -

                            Write the image template here

                            \ +

                            '+tr('Write the image template here')+'

                            \ \
                            \
                            \
                            \ \ - \ + \
                            \
                            \ \ @@ -177,27 +177,26 @@ var create_image_tmpl = var update_image_tmpl = '
                            \ -

                            Please, choose and modify the image you want to update:

                            \ +

                            '+tr('Please, choose and modify the image you want to update')+':

                            \
                            \ - \ + \ \
                            \
                            \ - \ + \ \
                            \
                            \ - \ + \ \
                            \ - \ + \
                            \ \
                            \
                            \
                            \ - \
                            \
                            \ @@ -277,7 +276,7 @@ var image_actions = { type: "single", call: OpenNebula.Image.update, callback: function() { - notifyMessage("Template updated correctly"); + notifyMessage(tr("Template updated correctly")); }, error: onError }, @@ -396,30 +395,30 @@ var image_actions = { var image_buttons = { "Image.refresh" : { type: "image", - text: "Refresh list", + text: tr("Refresh list"), img: "images/Refresh-icon.png" }, "Image.create_dialog" : { type: "create_dialog", - text: "+ New" + text: tr('+ New') }, "Image.update_dialog" : { type: "action", - text: "Update a template", + text: tr("Update a template"), alwaysActive: true }, "Image.chown" : { type: "confirm_with_select", - text: "Change owner", + text: tr("Change owner"), select: users_sel, - tip: "Select the new owner:", + tip: tr("Select the new owner:"), condition: mustBeAdmin }, "Image.chgrp" : { type: "confirm_with_select", - text: "Change group", + text: tr("Change group"), select: groups_sel, - tip: "Select the new group:", + tip: tr("Select the new group:"), condition: mustBeAdmin }, "action_list" : { @@ -427,51 +426,51 @@ var image_buttons = { actions: { "Image.enable" : { type: "action", - text: "Enable" + text: tr("Enable") }, "Image.disable" : { type: "action", - text: "Disable" + text: tr("Disable") }, "Image.publish" : { type: "action", - text: "Publish" + text: tr("Publish") }, "Image.unpublish" : { type: "action", - text: "Unpublish" + text: tr("Unpublish") }, "Image.persistent" : { type: "action", - text: "Make persistent" + text: tr("Make persistent") }, "Image.nonpersistent" : { type: "action", - text: "Make non persistent" + text: tr("Make non persistent") } } }, "Image.delete" : { type: "action", - text: "Delete" + text: tr("Delete") } } var image_info_panel = { "image_info_tab" : { - title: "Image information", + title: tr("Image information"), content: "" }, "image_template_tab" : { - title: "Image template", + title: tr("Image template"), content: "" } } var images_tab = { - title: "Images", + title: tr("Images"), content: images_tab_content, buttons: image_buttons } @@ -492,13 +491,13 @@ function imageElementArray(image_json){ var image = image_json.IMAGE; var type = $(''); var value = OpenNebula.Helper.image_type(image.TYPE); - $('option[value="'+value+'"]',type).replaceWith(''); + $('option[value="'+value+'"]',type).replaceWith(''); @@ -570,75 +569,75 @@ function updateImagesView(request, images_list){ function updateImageInfo(request,img){ var img_info = img.IMAGE; var info_tab = { - title: "Image information", + title: tr("Image information"), content: '
                          AllIDOwnerGroupNameSizeTypeRegistration timePublicPersistentStatus#VMS'+tr('All')+''+tr('ID')+''+tr('Owner')+''+tr('Group')+''+tr('Name')+''+tr('Size')+''+tr('Type')+''+tr('Registration time')+''+tr('Public')+''+tr('Persistent')+''+tr('Status')+''+tr('#VMS')+'
                          \ \ - \ + \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ - \ + \ + \ \ \ - \ - \ + \ + \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \
                          Image "'+img_info.NAME+'" information
                          '+tr('Image')+' "'+img_info.NAME+'" '+tr('information')+'
                          ID'+tr('ID')+''+img_info.ID+'
                          Name'+tr('Name')+''+img_info.NAME+'
                          Owner'+tr('Owner')+''+img_info.UNAME+'
                          Group'+tr('Group')+''+img_info.GNAME+'
                          Type'+tr('Type')+''+OpenNebula.Helper.image_type(img_info.TYPE)+'
                          Register time'+tr('Register time')+''+pretty_time(img_info.REGTIME)+'
                          Public'+(parseInt(img_info.PUBLIC) ? "yes" : "no")+''+tr('Public')+''+(parseInt(img_info.PUBLIC) ? tr("yes") : tr("no"))+'
                          Persistent'+(parseInt(img_info.PERSISTENT) ? "yes" : "no")+''+tr('Persistent')+''+(parseInt(img_info.PERSISTENT) ? tr("yes") : tr("no"))+'
                          Source'+tr('Source')+''+(typeof img_info.SOURCE === "string" ? img_info.SOURCE : "--")+'
                          Path'+tr('Path')+''+(typeof img_info.PATH === "string" ? img_info.PATH : "--")+'
                          Filesystem type'+tr('Filesystem type')+''+(typeof img_info.FSTYPE === "string" ? img_info.FSTYPE : "--")+'
                          Size (Mb)'+tr('Size (Mb)')+''+img_info.SIZE+'
                          State'+tr('State')+''+OpenNebula.Helper.resource_state("image",img_info.STATE)+'
                          Running #VMS'+tr('Running #VMS')+''+img_info.RUNNING_VMS+'
                          ' } var template_tab = { - title: "Image template", + title: tr("Image template"), content: '\ - '+ + '+ prettyPrintJSON(img_info.TEMPLATE)+ '
                          Image template
                          '+tr('Image template')+'
                          ' } @@ -652,7 +651,7 @@ function updateImageInfo(request,img){ // Prepare the image creation dialog function setupCreateImageDialog(){ - dialogs_context.append('
                          '); + dialogs_context.append('
                          '); $create_image_dialog = $('#create_image_dialog',dialogs_context); var dialog = $create_image_dialog; dialog.html(create_image_tmpl); @@ -732,7 +731,7 @@ function setupCreateImageDialog(){ var name = $('#custom_var_image_name',$create_image_dialog).val(); var value = $('#custom_var_image_value',$create_image_dialog).val(); if (!name.length || !value.length) { - notifyError("Custom attribute name and value must be filled in"); + notifyError(tr("Custom attribute name and value must be filled in")); return false; } option= '' : ""; + var new_select= sel_elems.length > 1? '' : ""; $('option','').each(function(){ var val = $(this).val(); if ($.inArray(val,sel_elems) >= 0){ @@ -983,7 +982,7 @@ function setupImageActionCheckboxes(){ if (!is_persistent_image(id)) Sunstone.runAction("Image.publish",id); else { - notifyError("Image cannot be public and persistent"); + notifyError(tr("Image cannot be public and persistent")); return false; }; } else Sunstone.runAction("Image.unpublish",id); @@ -998,7 +997,7 @@ function setupImageActionCheckboxes(){ if (!is_public_image(id)) Sunstone.runAction("Image.persistent",id); else { - notifyError("Image cannot be public and persistent"); + notifyError(tr("Image cannot be public and persistent")); return false; }; } else Sunstone.runAction("Image.nonpersistent",id); @@ -1030,7 +1029,11 @@ $(document).ready(function(){ { "sWidth": "35px", "aTargets": [1,5,11] }, { "sWidth": "100px", "aTargets": [6] }, { "sWidth": "150px", "aTargets": [7] } - ] + ], + "oLanguage": (datatable_lang != "") ? + { + sUrl: "locale/"+lang+"/"+datatable_lang + } : "" }); dataTable_images.fnClearTable(); @@ -1048,4 +1051,6 @@ $(document).ready(function(){ initCheckAllBoxes(dataTable_images); tableCheckboxesListener(dataTable_images); imageInfoListener(); + + }) diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 18c185f64a..5a3c890a6c 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -23,13 +23,13 @@ var templates_tab_content = \ \ \ - \ - \ - \ - \ - \ - \ - \ + \ + \ + \ + \ + \ + \ + \ \ \ \ @@ -39,10 +39,10 @@ var templates_tab_content = var create_template_tmpl = '
                          \ \
                          \ \ @@ -54,35 +54,35 @@ var create_template_tmpl = '
                          \ XEN\
                          \ -->\ -

                          Fields marked with are mandatory
                          \ - Fold / Unfold all sections

                          \ +

                          '+tr("Fields marked with")+''+tr("are mandatory")+'
                          \ + '+tr("Fold / Unfold all sections")+'

                          \
                          \ \ \
                          \
                          \ -

                          Capacity options

                          \ +

                          '+tr("Capacity options")+'

                          \
                          \ -
                          Capacity\ +
                          '+tr("Capacity")+'\
                          \ - \ + \ \ -
                          Name that the VM will get for description purposes. If NAME is not supplied a name generated by one will be in the form of one-<VID>.
                          \ +
                          '+tr("Name that the VM will get for description purposes. If NAME is not supplied a name generated by one will be in the form of one-<VID>.")+'
                          \
                          \
                          \ - \ + \ \ -
                          Amount of RAM required for the VM, in Megabytes.
                          \ +
                          '+tr("Amount of RAM required for the VM, in Megabytes.")+'
                          \
                          \
                          \ - \ + \ \ -
                          Percentage of CPU divided by 100 required for the Virtual Machine. Half a processor is written 0.5.
                          \ +
                          '+tr("Percentage of CPU divided by 100 required for the Virtual Machine. Half a processor is written 0.5.")+'
                          \
                          \
                          \ - \ + \ \ -
                          Number of virtual cpus. This value is optional, the default hypervisor behavior is used, usually one virtual CPU.
                          \ +
                          '+tr("Number of virtual cpus. This value is optional, the default hypervisor behavior is used, usually one virtual CPU.")+'
                          \
                          \
                          \
                          \ @@ -91,58 +91,58 @@ var create_template_tmpl = '
                          \ -->\
                          \
                          \ -

                          Boot/OS options

                          \ +

                          '+tr("Boot/OS options")+'

                          \
                          \ -
                          OS and Boot options\ +
                          '+tr("OS and Boot options")+'\
                          \ - \ + \ \ -
                          CPU architecture to virtualization
                          \ +
                          '+tr("CPU architecture to virtualization")+'
                          \
                          \ \
                          \ - \ + \ \ -
                          Select boot method
                          \ +
                          '+tr("Select boot method")+'
                          \
                          \
                          \ - \ + \ \ -
                          Path to the OS kernel to boot the image
                          \ +
                          '+tr("Path to the OS kernel to boot the image")+'
                          \
                          \
                          \ - \ + \ \ -
                          Path to the initrd image
                          \ +
                          '+tr("Path to the initrd image")+'
                          \
                          \
                          \ - \ + \ \ -
                          Device to be mounted as root
                          \ +
                          '+tr("Device to be mounted as root")+'
                          \
                          \
                          \ - \ + \ \ -
                          Arguments for the booting kernel
                          \ +
                          '+tr("Arguments for the booting kernel")+'
                          \
                          \
                          \ - \ + \ \ -
                          Path to the bootloader executable
                          \ +
                          '+tr("Path to the bootloader executable")+'
                          \
                          \
                          \ - \ + \ \ -
                          Boot device type
                          \ +
                          '+tr("Boot device type")+'
                          \
                          \
                          \
                          \ @@ -151,26 +151,26 @@ var create_template_tmpl = '
                          \ \
                          \
                          \ -

                          Features

                          \ +

                          '+tr("Features")+'

                          \
                          \ -
                          Features\ +
                          '+tr("Features")+'\
                          \ - \ + \ \ -
                          Physical address extension mode allows 32-bit guests to address more than 4 GB of memory
                          \ +
                          '+tr("Physical address extension mode allows 32-bit guests to address more than 4 GB of memory")+'
                          \
                          \
                          \ - \ + \ \ -
                          Useful for power management, for example, normally required for graceful shutdown to work
                          \ +
                          '+tr("Useful for power management, for example, normally required for graceful shutdown to work")+'
                          \
                          \
                          \
                          \ @@ -182,92 +182,92 @@ var create_template_tmpl = '
                          \ readonly SEVERAL DISKS-->\
                          \
                          \ -

                          Add disks/images

                          \ -
                          \ -
                          Disks\ +

                          '+tr('Add disks/images')+'

                          \ +
                          \ +
                          '+tr('Disks')+'\
                          \ - \ - Disk\ + \ + '+tr('Disk')+'\ \ - Image\ + '+tr('Image')+'\ \
                          \
                          \
                          \ - \ + \ \ -
                          Name of the image to use
                          \ +
                          '+tr('Name of the image to use')+'
                          \ \
                          \
                          \ - \ + \ \ -
                          Type of disk device to emulate: ide, scsi
                          \ +
                          '+tr('Type of disk device to emulate: ide, scsi')+'
                          \
                          \
                          \ - \ + \ \ -
                          Device to map image disk. If set, it will overwrite the default device mapping
                          \ +
                          '+tr('Device to map image disk. If set, it will overwrite the default device mapping')+'
                          \
                          \
                          \ - \ + \ \ -
                          Specific image mapping driver. KVM: raw, qcow2. Xen:tap:aio:, file:. VMware unsupported
                          \ +
                          '+tr('Specific image mapping driver. KVM: raw, qcow2. Xen:tap:aio:, file:. VMware unsupported')+'
                          \
                          \
                          \ - \ + \ \ -
                          Disk type
                          \ +
                          '+tr('Disk type')+'
                          \
                          \
                          \ - \ + \ \ -
                          Disk file location path or URL
                          \ +
                          '+tr('Disk file location path or URL')+'
                          \
                          \
                          \ \ - \ + \ \ -
                          Size in MB
                          \ +
                          '+tr('Size in MB')+'
                          \
                          \
                          \ \ - \ + \ \ -
                          Filesystem type for the fs images
                          \ +
                          '+tr('Filesystem type for the fs images')+'
                          \
                          \
                          \ - \ + \ \ -
                          Clone this image
                          \ +
                          '+tr('Clone this image')+'
                          \
                          \
                          \ - \ + \ \ -
                          Save this image after shutting down the VM
                          \ +
                          '+tr('Save this image after shutting down the VM')+'
                          \
                          \
                          \ - \ + \ \ -
                          Mount image as read-only
                          \ +
                          '+tr('Mount image as read-only')+'
                          \
                          \
                          \ - \ - \ + \ + \
                          \ - \ + \ \
                          \ @@ -279,107 +279,107 @@ var create_template_tmpl = '
                          \ bridge, target, script, model -->\
                          \
                          \ -

                          Setup Networks

                          \ +

                          '+tr('Setup Networks')+'

                          \
                          \ -
                          Network\ +
                          '+tr('Network')+'\
                          \ - \ - Predefined\ + \ + '+tr('Predefined')+'\ \ - Manual\ + '+tr('Manual')+'\ \ \
                          \
                          \
                          \ - \ + \ \ -
                          Name of the network to attach this device
                          \ +
                          '+tr('Name of the network to attach this device')+'
                          \ \
                          \
                          \ - \ + \ \ -
                          Request an specific IP from the Network
                          \ +
                          '+tr('Request an specific IP from the Network')+'
                          \
                          \
                          \ - \ + \ \ -
                          HW address associated with the network interface
                          \ +
                          '+tr('HW address associated with the network interface')+'
                          \
                          \
                          \ - \ + \ \ -
                          Name of the bridge the network device is going to be attached to
                          \ +
                          '+tr('Name of the bridge the network device is going to be attached to')+'
                          \
                          \
                          \ - \ + \ \ -
                          Name for the tun device created for the VM
                          \ +
                          '+tr('Name for the tun device created for the VM')+'
                          \
                          \
                          \ - \ + \ \ -
                          Name of a shell script to be executed after creating the tun device for the VM
                          \ +
                          '+tr('Name of a shell script to be executed after creating the tun device for the VM')+'
                          \
                          \
                          \ - \ + \ \ -
                          Hardware that will emulate this network interface. With Xen this is the type attribute of the vif.
                          \ +
                          '+tr('Hardware that will emulate this network interface. With Xen this is the type attribute of the vif.')+'
                          \
                          \
                          \ - \ + \ \
                          \
                          \
                          \ - \ + \ \ -
                          Permits access to the VM only through the specified ports in the TCP protocol
                          \ +
                          '+tr('Permits access to the VM only through the specified ports in the TCP protocol')+'
                          \
                          \
                          \ - \ + \ \ -
                          Disallow access to the VM through the specified ports in the TCP protocol
                          \ +
                          '+tr('Disallow access to the VM through the specified ports in the TCP protocol')+'
                          \
                          \
                          \ - \ + \ \
                          \
                          \
                          \ - \ + \ \ -
                          Permits access to the VM only through the specified ports in the UDP protocol
                          \ +
                          '+tr('Permits access to the VM only through the specified ports in the UDP protocol')+'
                          \
                          \
                          \ - \ + \ \ -
                          Disallow access to the VM through the specified ports in the UDP protocol
                          \ +
                          '+tr('Disallow access to the VM through the specified ports in the UDP protocol')+'
                          \
                          \
                          \ - \ + \ \ -
                          ICMP policy
                          \ +
                          '+tr('ICMP policy')+'
                          \
                          \
                          \
                          \ - \ - \ + \ + \
                          \ - \ + \ \
                          \ @@ -390,31 +390,31 @@ var create_template_tmpl = '
                          \ \
                          \
                          \ -

                          Add inputs

                          \ +

                          '+tr("Add inputs")+'

                          \
                          \ -
                          Inputs\ +
                          '+tr("Inputs")+'\
                          \ - \ + \ \
                          \
                          \
                          \ - \ + \ \
                          \
                          \
                          \ - \ - \ + \ + \
                          \ - \ + \ \
                          \ @@ -425,37 +425,37 @@ var create_template_tmpl = '
                          \ \
                          \
                          \ -

                          Add Graphics

                          \ +

                          '+tr("Add Graphics")+'

                          \
                          \ -
                          Graphics\ +
                          '+tr("Graphics")+'\
                          \ - \ + \ \
                          \
                          \
                          \ - \ + \ \ -
                          IP to listen on
                          \ +
                          '+tr("IP to listen on")+'
                          \
                          \
                          \ - \ + \ \ -
                          Port for the VNC server
                          \ +
                          '+tr("Port for the VNC server")+'
                          \
                          \
                          \ - \ + \ \ -
                          Password for the VNC server
                          \ +
                          '+tr("Password for the VNC server")+'
                          \
                          \
                          \ - \ + \ \ -
                          Keyboard configuration locale to use in the VNC display
                          \ +
                          '+tr("Keyboard configuration locale to use in the VNC display")+'
                          \
                          \
                          \
                          \ @@ -464,24 +464,24 @@ var create_template_tmpl = '
                          \ \
                          \
                          \ -

                          Add context variables

                          \ +

                          '+tr("Add context variables")+'

                          \
                          \ -
                          Context\ +
                          '+tr("Context")+'\
                          \ - \ + \ \ -
                          Name for the context variable
                          \ +
                          '+tr("Name for the context variable")+'
                          \
                          \
                          \ - \ + \ \ -
                          Value of the context variable
                          \ +
                          '+tr("Value of the context variable")+'
                          \
                          \
                          \ - \ - \ + \ + \
                          \ - \ + \ \
                          \ @@ -492,18 +492,18 @@ var create_template_tmpl = '
                          \ \
                          \
                          \ -

                          Add placement options

                          \ +

                          '+tr("Add placement options")+'

                          \
                          \ -
                          Placement\ +
                          '+tr("Placement")+'\
                          \ - \ + \ \ -
                          Boolean expression that rules out provisioning hosts from list of machines suitable to run this VM
                          \ +
                          '+tr("Boolean expression that rules out provisioning hosts from list of machines suitable to run this VM")+'
                          \
                          \
                          \ - \ + \ \ -
                          This field sets which attribute will be used to sort the suitable hosts for this VM. Basically, it defines which hosts are more suitable than others
                          \ +
                          '+tr("This field sets which attribute will be used to sort the suitable hosts for this VM. Basically, it defines which hosts are more suitable than others")+'
                          \
                          \
                          \
                          \ @@ -512,15 +512,15 @@ var create_template_tmpl = '
                          \ \
                          \
                          \ -

                          Add Hypervisor raw options

                          \ +

                          '+tr("Add Hypervisor raw options")+'

                          \
                          \ -
                          Raw\ +
                          '+tr("Raw")+'\ \
                          \ - \ + \ \ \ -
                          Raw data to be passed directly to the hypervisor
                          \ +
                          '+tr("Raw data to be passed directly to the hypervisor")+'
                          \
                          \
                          \
                          \ @@ -529,24 +529,24 @@ var create_template_tmpl = '
                          \ \
                          \
                          \ -

                          Add custom variables

                          \ +

                          '+tr('Add custom variables')+'

                          \
                          \ -
                          Custom variables\ +
                          '+tr('Custom variables')+'\
                          \ - \ + \ \ -
                          Name for the custom variable
                          \ +
                          '+tr('Name for the custom variable')+'
                          \
                          \
                          \ - \ + \ \ -
                          Value of the custom variable
                          \ +
                          '+tr('Value of the custom variable')+'
                          \
                          \
                          \ - \ - \ + \ + \
                          \ - \ + \ \
                          \ @@ -556,16 +556,16 @@ var create_template_tmpl = '
                          \
                          \
                          \ \ - \ + \
                          \
                          \ \
                          \
                          \
                          \ -

                          Write the Virtual Machine template here

                          \ +

                          '+tr("Write the Virtual Machine template here")+'

                          \
                          \ \
                          \ @@ -573,9 +573,9 @@ var create_template_tmpl = '
                          \
                          \
                          \ \ - \ + \
                          \
                          \ \ @@ -584,16 +584,16 @@ var create_template_tmpl = '
                          \ var update_template_tmpl = '
                          \ -

                          Please, choose and modify the template you want to update:

                          \ +

                          '+tr('Please, choose and modify the template you want to update')+':

                          \
                          \ - \ + \ \
                          \
                          \ - \ + \ \
                          \ - \ + \
                          \ \
                          \ @@ -606,7 +606,6 @@ var update_template_tmpl =
                          \ '; -var templates_select = ""; var dataTable_templates; var $create_template_dialog; @@ -672,7 +671,7 @@ var template_actions = { type: "single", call: OpenNebula.Template.update, callback: function() { - notifyMessage("Template updated correctly"); + notifyMessage(tr("Template updated correctly")); }, error: onError }, @@ -751,34 +750,34 @@ var template_actions = { var template_buttons = { "Template.refresh" : { type: "image", - text: "Refresh list", + text: tr("Refresh list"), img: "images/Refresh-icon.png" }, "Template.create_dialog" : { type: "create_dialog", - text: "+ New" + text: tr("+ New") }, "Template.update_dialog" : { type: "action", - text: "Update a template", + text: tr("Update a template"), alwaysActive: true }, "Template.instantiate_vms" : { type: "action", - text: "Instantiate" + text: tr("Instantiate") }, "Template.chown" : { type: "confirm_with_select", - text: "Change owner", + text: tr("Change owner"), select: users_sel, - tip: "Select the new owner:", + tip: tr("Select the new owner:"), condition: mustBeAdmin }, "Template.chgrp" : { type: "confirm_with_select", - text: "Change group", + text: tr("Change group"), select: groups_sel, - tip: "Select the new group:", + tip: tr("Select the new group:"), condition: mustBeAdmin }, "action_list" : { @@ -786,29 +785,29 @@ var template_buttons = { actions: { "Template.publish" : { type: "action", - text: "Publish" + text: tr("Publish") }, "Template.unpublish" : { type: "action", - text: "Unpublish" + text: tr("Unpublish") }, } }, "Template.delete" : { type: "action", - text: "Delete" + text: tr("Delete") } } var template_info_panel = { "template_info_tab" : { - title: "Template information", + title: tr("Template information"), content: "" } } var templates_tab = { - title: "Templates", + title: tr("Templates"), content: templates_tab_content, buttons: template_buttons } @@ -857,12 +856,12 @@ function templateInfoListener(){ //Updates the select input field with an option for each template function updateTemplateSelect(){ - templates_select = + var templates_select = makeSelectOptions(dataTable_templates, 1,//id_col 4,//name_col - [7],//enabled_col - ["no"]//bad status col + [],//status_cols + []//bad status values ); //update static selectors: @@ -908,42 +907,42 @@ function updateTemplatesView(request, templates_list){ function updateTemplateInfo(request,template){ var template_info = template.VMTEMPLATE; var info_tab = { - title: "Information", + title: tr("Information"), content: '
                          AllIDOwnerGroupNameRegistration timePublic'+tr("All")+''+tr("ID")+''+tr("Owner")+''+tr("Group")+''+tr("Name")+''+tr("Registration time")+''+tr("Public")+'
                          \ \ - \ + \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ + \ \ \ \ - \ - \ + \ + \ \
                          Template "'+template_info.NAME+'" information
                          '+tr("Template")+' \"'+template_info.NAME+'\" '+tr("information")+'
                          ID'+tr("ID")+''+template_info.ID+'
                          Name'+tr("Name")+''+template_info.NAME+'
                          Owner'+tr("Owner")+''+template_info.UNAME+'
                          Group'+tr("Group")+''+template_info.GNAME+'
                          Register time'+tr("Register time")+''+pretty_time(template_info.REGTIME)+'
                          Public'+(parseInt(template_info.PUBLIC) ? "yes" : "no")+''+tr("Public")+''+(parseInt(template_info.PUBLIC) ? tr("yes") : tr("no"))+'
                          ' }; var template_tab = { - title: "Template", + title: tr("Template"), content: '\ - '+ + '+ prettyPrintJSON(template_info.TEMPLATE)+ '
                          Template
                          '+tr("Template")+'
                          ' }; @@ -1043,30 +1042,30 @@ function setupCreateTemplateDialog(){ // * Show the inputs and graphics section var type_opts = - '\ - \ - \ - \ - \ - \ - '; + '\ + \ + \ + \ + \ + \ + '; $('select#TYPE',section_disks).html(type_opts); var boot_opts = - '\ - \ - \ - '; + '\ + \ + \ + '; $('select#BOOT',section_os_boot).html(boot_opts); $('select#BOOT',section_os_boot).parent().show(); - $('select#boot_method option#no_boot',section_os_boot).html("Driver default"); + $('select#boot_method option#no_boot',section_os_boot).html(tr("Driver default")); var bus_opts = - '\ - \ - '; + '\ + \ + '; $('select#BUS',section_disks).html(bus_opts); @@ -1091,20 +1090,20 @@ function setupCreateTemplateDialog(){ // * Show the graphics section var type_opts = - '\ - \ - \ - \ - \ - '; + '\ + \ + \ + \ + \ + '; $('select#TYPE',section_disks).html(type_opts); - $('select#boot_method option#no_boot',section_os_boot).html("Please choose"); + $('select#boot_method option#no_boot',section_os_boot).html(tr("Please choose")); var bus_opts = - '\ - '; + '\ + '; $('select#BUS',section_disks).html(bus_opts); @@ -1126,17 +1125,17 @@ function setupCreateTemplateDialog(){ // * Set the raw type to vmware var type_opts = - '\ - \ - '; + '\ + \ + '; $('select#TYPE',section_disks).html(type_opts); $('div#kernel_bootloader',section_os_boot).hide(); var bus_opts = - '\ - '; + '\ + '; $('select#BUS',section_disks).html(bus_opts); $('input#TYPE', section_raw).val("vmware"); @@ -1175,7 +1174,7 @@ function setupCreateTemplateDialog(){ //are fields passing the filter? var result = filter(); if (!result) { - notifyError("There are mandatory parameters missing in this section"); + notifyError(tr("There are mandatory parameters missing in this section")); return false; } @@ -1708,7 +1707,7 @@ function setupCreateTemplateDialog(){ var name = $('#var_name',section_context).val(); var value = $('#var_value',section_context).val(); if (!name.length || !value.length) { - notifyError("Context variable name and value must be filled in"); + notifyError(tr("Context variable name and value must be filled in")); return false; } option= '
                          '); + dialogs_context.append('
                          '); var dialog = $('#template_update_dialog',dialogs_context); //Put HTML in place dialog.html( '
                          \ -

                          Please, choose and modify the template you want to update:

                          \ +

                          '+tr("Please, choose and modify the template you want to update:")+'

                          \
                          \ - \ + \ \
                          \ - \ + \
                          \
                          \
                          \ \
                          \
                          \ @@ -706,7 +708,7 @@ function popUpTemplateUpdateDialog(elem_str,select_items,sel_elems){ if (sel_elems.length >= 1){ //several items in the list are selected //grep them - var new_select= sel_elems.length > 1? '' : ""; + var new_select= sel_elems.length > 1? '' : ""; $('option','').each(function(){ var val = $(this).val(); if ($.inArray(val,sel_elems) >= 0){ diff --git a/src/sunstone/public/js/sunstone.js b/src/sunstone/public/js/sunstone.js index 99bff73ac0..b23bb3f279 100644 --- a/src/sunstone/public/js/sunstone.js +++ b/src/sunstone/public/js/sunstone.js @@ -549,7 +549,7 @@ function initListButtons(){ $('.multi_action_slct',main_tabs_context).each(function(){ //prepare replacement buttons var buttonset = $('
                          Previous action').button(); + var button1 = $('').button(); button1.attr("disabled","disabled"); var button2 = $('').button({ text:false, @@ -612,19 +612,19 @@ function initListButtons(){ //Prepares the standard confirm dialogs function setupConfirmDialogs(){ - dialogs_context.append('
                          '); + dialogs_context.append('
                          '); var dialog = $('div#confirm_dialog',dialogs_context); //add the HTML with the standard question and buttons. dialog.html( '\ -
                          You have to confirm this action.
                          \ +
                          '+tr("You have to confirm this action.")+'
                          \
                          \ -
                          Do you want to proceed?
                          \ +
                          '+tr("Do you want to proceed?")+'
                          \
                          \
                          \ - \ - \ + \ + \
                          \ '); @@ -646,17 +646,17 @@ function setupConfirmDialogs(){ return false; }); - dialogs_context.append('
                          '); + dialogs_context.append('
                          '); dialog = $('div#confirm_with_select_dialog',dialogs_context); dialog.html( '
                          \ -
                          You need to select something.
                          \ +
                          '+tr("You need to select something.")+'
                          \ \
                          \ - \ - \ + \ + \
                          \
                          '); diff --git a/src/sunstone/public/locale/ru/ru.js b/src/sunstone/public/locale/ru/ru.js new file mode 100644 index 0000000000..8b6cc28530 --- /dev/null +++ b/src/sunstone/public/locale/ru/ru.js @@ -0,0 +1,1036 @@ +//Переведено ЗАО «ВИВОСС и ОИ», 2011 +lang="ru" +datatable_lang = "ru_datatable.txt" +locale={ +"information":"информация", +"#VMS":"Кол-во ВМ", +"+ New Group":"Создать группу", +"+ New":"Добавить", +". No disk id or image name specified":". Не указано название образа или № диска", +"ACL Rules":"Правила контроля доступа", +"ACL String preview:":"Предпросмотр правила:", +"ACLs":"Списки контроля", +"ACPI":"ACPI", +//"ACTIVE":"", +"Accept (default)":"Принять (по умолчанию)", +"Acl create":"Список контроля создан", +"Acl delete":"Удален список контроля с номером ", +"Acl":"Список контроля доступа", +"Add Graphics":"Добавить графические устройства", +"Add Hypervisor raw options":"Добавить исходные опции гипервизора", +"Add context variables":"Добавить контекстные переменные", +"Add custom variables":"Добавить пользовательские переменные", +"Add disk/image":"Добавить диск/образ", +"Add disks/images":"Добавить диски/образы", +"Add inputs":"Добавить устройства ввода", +"Add lease":"Добавить адрес", +"Add network":"Добавить сеть", +"Add placement options":"Добавить опции размещения", +"Add to group":"Включить в группу", +"Add":"Добавить", +"Advanced mode":"Расширенный режим", +"Affected resources":"Затрагиваемые правилом ресурсы", +"All":"Все", +"Allowed operations":"Разрешенные действия", +"Amount of RAM required for the VM, in Megabytes.":"Объем ОЗУ (в МБ), необходимый для ВМ.", +"Applies to":"Применено к", +"ARCH":"Архитектура", +"Architecture:":"Архитектура:", +"Arguments for the booting kernel":"Параметры для загрузки ядра", +"BOOT":"Тип ус-ва загрузки", +"BRIDGE":"Шлюз", +"BUS":"Тип шины", +"Block":"Block", +"Boolean expression that rules out provisioning hosts from list of machines suitable to run this VM":"Логическое выражение, исключающее элементы из списка узлов, подходящих для запуска данной ВМ", +"Boot device type":"Тип устройства загрузки", +"Boot method:":"Метод загрузки:", +"Boot/OS options":"Загрузка и тип ОС", +"Boot:":"Загрузка:", +"Bootloader:":"Загрузчик:", +"Bridge":"Шлюз", +"Bus:":"Тип шины:", +"CD-ROM":"CD-ROM", +"CLONE":"Образ клонируется", +"CPU Monitoring information":"Мониторинг ЦП", +"CPU Use":"Использование ЦП", +"CPU architecture to virtualization":"Архитектура ЦП для виртуализации", +"CPU":"ЦП", +"CPUSPEED":"Тактовая частота ЦП", +"Cancel":"Отменить", +"Canvas not supported.":"Canvas не поддерживается.", +"Capacity options":"Настройки производительности", +"Capacity":"Производительность", +"Change group":"Сменить группу", +"Change owner":"Сменить владельца", +"Clone this image":"Клонировать образ", +"Clone:":"Образ клонируется:", +"Confirmation of action":"Подтверждение действия", +"Context variable name and value must be filled in":"Поля «Имя переменной» и «Значение» должны быть заполнены", +"Context":"Контекст", +"Create ACL":"Создать список контроля", +"Create VM Template":"Создать шаблон ВМ", +"Create Virtual Machine":"Создать виртуальную машину", +"Create Virtual Network":"Создать виртуальную сеть", +"Create an empty datablock":"Создать пустой блок данных", //!! +"Create group":"Создать группу", +"Create host":"Создать узел", +"Create user":"Создать пользователя", +"Create":"Создать", +"Current NICs:":"Текущие контроллеры сет. интерфейса:", +"Current disks:":"Текущие диски:", +"Current inputs:":"Текущие УВВ:", +"Current leases:":"Текущие адреса:", +"Current variables:":"Текущее значение:", +"Custom variable name and value must be filled in":"Поля «Имя переменной» и «Значение» должны быть заполнены", +"Custom variables":"Пользовательские переменные", +"DESCRIPTION":"Краткое описание", +"DEV_PREFIX":"Префикс устройства", +//"DISABLED":"", +"DISK":"Сведения о диске", +"DISK_ID":"№ диска", +"DRIVER":"Драйвер", +"Dashboard":"Инф. панель", +"Data:":"Данные:", +"Datablock":"Блок данных", +"Default":"По умолчанию", +"Delete from group":"Исключить из группы", +"Delete host":"Удалить узел", +"Delete":"Удалить", +"Deploy # VMs:":"Кол-во экземпляров ВМ для размещения:", +"Deploy ID":"№ размещения", +"Deploy":"Разместить на узле", +"Description:":"Описание:", +"Device prefix:":"Префикс устройства:", +"Device to be mounted as root":"Устройство, монтируемое как корневое", +"Device to map image disk. If set, it will overwrite the default device mapping":"Устройство для образа диска. Если установлено, то оно перезапищет устройсво картографирования по умолчанию.", +"Disable":"Отключить", +"Disallow access to the VM through the specified ports in the TCP protocol":"Запретить доступ к ВМ через указанные порты для TCP протокола", +"Disallow access to the VM through the specified ports in the UDP protocol":"Запретить доступ к ВМ через указанные порты для UDP протокола", +"Disk file location path or URL":"Путь расположения файла диска или URL", +"Disk type":"Тип диска", +"Disk":"Диск", +"Disks":"Диски", +"Do you want to proceed?":"Хотите продолжить?", +"Driver default":"Драйвер по умолчанию", +"Driver:":"Драйвер:", +"Drivers":"Драйверы", +"Drop":"Сбросить", +"Dummy":"Заглушка", +"EC2":"EC2", +"ERROR":"Сведения об ошибках", +"Enable":"Включить", +"Error":"Ошибка", +"FEATURES":"Особенности", +//"FIXED":"", +"FREECPU":"Незадействованный ресурс ЦП", +"FREEMEMORY":"Свободно ОЗУ", +"FS type:":"Тип ФС:", +"FS":"FS", +"Features":"Особенности", +"Fields marked with":"Поля помеченные", +"File":"Файл", +"Filesystem type for the fs images":"Тип файловой системы для образов ФС", +"Fixed network":"Фиксированные адреса", +"Floppy":"Floppy", +"Fold / Unfold all sections":"Свернуть/развернуть все разделы", +"Format:":"Формат:", +"GRAPHICS":"Параметры графического доступа", +"Get Information":"Получить информацию", +"Get Pool of my/group\'s resources":"Получить пул доступных мне/группе ресурсов", +"Get Pool of resources":"Получить пул ресурсов", +"Graphics type:":"Тип ГУ:", +"Graphics":"Графические устройства", +"Group create":"Группа создана", +"Group delete":"Группа удалена", +"Group name:":"Название группы:", +"Group":"Группа пользователей", +"Groups":"Группы", +"HOSTNAME":"Название узла", +"HW address associated with the network interface":"MAC-адрес, связанный с сетевым интерфейсом", +"HYPERVISOR":"Гипервизор", +"Hardware that will emulate this network interface. With Xen this is the type attribute of the vif.":"Аппаратное устройствое, которое будет отвечать за эмуляцию сетевого интерфейса. Для Xen это атрибут vif.", +"Historical monitoring information":"Мониторинг состояния", +"Hold":"Запретить размещение", +"Host information":"Состояние узла", +"Host parameters":"Параметры узла", +"Host shares":"Ресурсы узла", +"Host template":"Шаблон узла", +"Host":"Узел", +"Hostname":"Название узла", +"Hosts (total/active)":"Узлы (всего/из них активных)", +"Hosts CPU":"Загрузка ЦП", +"Hosts memory":"Загрузка ОЗУ", +"Hosts":"Узлы", +"Human readable description of the image for other users.":"Краткое описание образа.", +"ICMP policy":"Политика ICMP", +"ID":"№", +"IDE":"IDE", +"IM MAD":"Модуль ср-ва мониторинга", +"IMAGE":"Используемый образ", +"IMAGE_ID":"№ образа", +//"INIT":"", +"IP to listen on":"IP-адрес для прослушивания", +"IP":"IP-адрес", +"IP:":"IP:", +"Icmp:":"Icmp:", +"Image information":"Информация об образе", +"Image name:":"Название образа:", +"Image template":"Шаблон образа", +"Images (total/public)":"Образы (всего/из них открытых)", +"Images":"Образы ВМ", +"Image":"Образ", +"Info":"Информация", +"Information Manager:":"Cредство мониторинга:", +"Information":"Информация", +"information":" ", +"Initrd:":"Диск нач. иниц.(initrd):", +"Inputs":"Устройства ввода", +"Instantiate":"Создать экземпляр ВМ", +"KVM":"KVM", +"Kernel commands:":"Команды ядра:", +"Kernel:":"Ядро:", +"Keyboard configuration locale to use in the VNC display":"Раскладка клавиатуры, используемая при работе с VNC-дисплеем", +"Keymap":"Раскладка клавиатуры", +"LCM State":"Текущее состояние ВМ", +"LEASES":"АДРЕСА", +"LISTEN":"Прослушивать IP", +"Lease IP:":"IP-адрес:", +"Lease MAC (opt):":"MAC-адрес (необяз.):", +"Lease MAC:":"MAC-адрес:", +"Leases information":"Сведения по имеющимся адресам виртуальной сети", +"Listen IP:":"Прослушивать IP:", +"Live migrate":"Перенести запущенную ВМ", +"Loading":"Идет загрузка", +"MAC":"MAC-адрес", +"MAC:":"MAC-адрес:", +"MEMORY":"Объем ОЗУ", +"MESSAGE":"Сообщение", +"MODELNAME":"Модель ЦП", +//"MONITORED":"", +//"MONITORING":"", +"Make non persistent":"Сделать непостоянным", +"Make persistent":"Сделать постоянным", +"Manage":"Управлять", +"Manual":"В ручную", +"Max Mem":"Доступно ОЗУ", +"Memory monitoring information":"Мониторинг ОЗУ", +"Memory use":"Использование ОЗУ", +"Memory":"Память", +"Migrate":"Перенести ВМ", +"Model:":"Модель:", +"Monitoring information":"Мониторинг", +"Mount image as read-only":"Монтировать образ только для чтения", +"Mouse":"Мышь", +"NAME":"Название", +"Name for the context variable":"Имя контекстной переменной", +"Name for the custom variable":"Имя пользовательской переменной", +"Name for the tun device created for the VM":"Имя сетевого туннеля, созданного для ВМ", +"Name of a shell script to be executed after creating the tun device for the VM":"shell-скрипт, который будет выполнен после создания сетевого туннеля для ВМ", +"Name of the bridge the network device is going to be attached to":"Шлюз, с которым будет связано сетевое устройство", +"Name of the image to use":"Название образа для использования", +"Name of the network to attach this device":"Сеть, подключаемая к данному устройству", +"Name that the Image will get. Every image must have a unique name.":"Название, которое получит образ. Каждый образ должен обладать уникальным названием.", +"Name that the VM will get for description purposes. If NAME is not supplied a name generated by one will be in the form of one-<VID>.":"Название, которое получит ВМ. Если название не будет указано, то оно будет сгенерировано в формате one-<№ ВМ>.", +"Name":"Название", +"Net_RX":"Принято", +"Net_TX":"Отправлено", +"NETRX":"Принято по сети", +"NETTX":"Отправлено по сети", +"NETWORK":"Название вирт. сети", +"NETWORK_ADDRESS":"Адрес сети", +"NETWORK_ID":"№ вирт. сети", +"NETWORK_SIZE":"Размер сети", +"NIC":"Контроллер сетевого интерфейса", +"NO":"нет", +"Network Address:":"Адрес сети:", +"Network reception":"Сеть: принято", +"Network size:":"Размер сети:", +"Network transmission":"Сеть: отправлено", +"Network type:":"Тип сети:", +"Network":"Сеть", +"New: ":"Создать новый ресурс: ", +"No disks defined":"Дисков не обнаружено", +"No":"Нет", +"None":"Никакой", +"Number of virtual cpus. This value is optional, the default hypervisor behavior is used, usually one virtual CPU.":"Количество виртуальных процессоров. Это значение опционально, используется поведение гипервизора по умолчанию - один виртуальный ЦП.", +"OK":"OK", +"OS and Boot options":"Опции загрузки и ОС", +"OS":"ОС", +"Open VNC Session":"Открыть VNC-сессию", +"Optional, please select":"Опционально, пожалуйста выберите", +"Owned by group":"Принадлежит группе", +"Owner":"Владелец", +"PAE:":"PAE:", +"PATH":"ПУТЬ", +"PERSISTENT":"Постоянный", +"PORT":"Номер порта доступа", +"PS2":"PS/2", +"Password for the VNC server":"Пароль для VNC сервера", +"Password:":"Пароль:", +"Path to the OS kernel to boot the image":"Путь к ядру ОС для загрузки образа", +"Path to the bootloader executable":"Путь к исполняемому файлу загрузчика", +"Path to the initrd image":"Путь к образу initrd", +"Path to the original file that will be copied to the image repository. If not specified for a DATABLOCK type image, an empty image will be created.":"Путь к исходному файлу, который будет скопирован в хранилище образов. Если путь не указан для типа образа БЛОК ДАННЫХ, то будет создан пустой образ.", +"Path vs. source:":"Исходные данные образа:", +"Path:":"Путь к эталонному файлу образа:", +"Percentage of CPU divided by 100 required for the Virtual Machine. Half a processor is written 0.5.":"Процент процессорного времени ЦП, предоставлемого ВМ, разделенный на 100. Например, для выделения половины процессорного времени следует указать 0.5.", +"Permits access to the VM only through the specified ports in the TCP protocol":"Разрешить доступ к ВМ только через указанные порты протокола TCP", +"Permits access to the VM only through the specified ports in the UDP protocol":"Разрешить доступ к ВМ только через указанные порты протокола UPD", +"Persistence of the image":"Если образ является постоянным, то при каждом завершении работы с полученной на его основе виртуальной машиной все изменения будут сохранены в образе.\n\n Важно помнить, что сохранение выполнится только в случае завершения работы соответствующей ВМ при помощи операций «Выключить» и «Отменить».\n\nПостоянный образ всегда хранится в одном экземпляре.", +"Persistent":"Постоянный", +"Physical address extension mode allows 32-bit guests to address more than 4 GB of memory":"Режим расширенной физической адресации позволяет использовать 32-битным ВМ больше 4-х ГБ ", +"Placement":"Размещение", +"Please choose path if you have a file-based image. Choose source otherwise or create an empty datablock disk.":"«Путь к эталонному файлу образа» — образ создается путем копирования эталонного файла образа в хранилище образов.\n\n«Источник» — в данное поле следует указывать местоположение образа (в качестве образа будет использован ресурс, непосредственно указанный в поле «Источник», а не копия этого ресурса).", +"Please choose":"Пожалуйста выберите", +"Please provide a lease IP":"Необходимо указать IP-адрес", +"Please provide a network address":"Укажите адрес сети", +"Please provide a resource ID for the resource(s) in this rule":"Необходимо указать № ресурса(ов) для данного правила)", +"Please select a group to which the selected resources belong to":"Необходимо выбрать группу пользователей, которой принадлежат выбранные ресурсы", +"Please select at least one operation":"Необходимо выбрать по меньшей мере одну операцию", +"Please select at least one resource":"Необходимо выбрать по меньшей мере один ресурс", +"Please select":"Выберите", +"Please specify to who this ACL applies":"Необходимо указать, к кому применять данный список контроля", +"Please specify:":"Укажите:", +"Please, choose and modify the template you want to update:":"Укажите шаблон, который хотите обновить:", +"Port blacklist":"Список запрещенных портов", +"Port for the VNC server":"Порт для сервера VNC", +"Port whitelist":"Список разрешенных портов", +"Port:":"Порт:", +"Predefined":"По умолчанию", +"Prefix for the emulated device this image will be mounted at. For instance, “hd”, “sd”. If omitted, the default value is the one defined in oned.conf (installation default is “hd”).":"Префикс эмулируемого устройства, на которое будет смонтирован образ. Например, «hd» и «sd». Если не указать префикс, его значение будет считано из конфигурационного файла oned.conf (значение по умолчанию — «hd»).", +"Previous action":"Предыдущее действие", +"Provide a path":"Указать путь к эталонному файлу образа", +"Provide a source":"Указать источник для образа", +"Public scope of the image":"Информация о доступности образа", +"Public":"Открытый", +"Publish":"Сделать открытым", +"Quickstart":"Типовые операции", +//"RANGED":"" +"RAW":"RAW", +"READONLY":"Доступен только на чтение", +//"READY":"", +"Ranged network":"Диапазон адресов", +"Rank:":"Степень:", +"Raw data to be passed directly to the hypervisor":"Исходные данные, передаваемые напрямую гипервизору", +"Raw":"Исходная опция", +"Read only:":"Только чтение:", +"Refresh list":"Обновить список", +"Register time":"Время регистрации", +"Registration time":"Время регистрации", +"Release":"Разрешить размещение", +"Remove lease":"Удалить адрес", +"Remove selected":"Удалить выбранные", +"Request an specific IP from the Network":"Запросить определенный IP-адрес из сети", +"Requirements:":"Требования:", +"Reset":"Сбросить", +"Resource ID / Owned by":"№ ресурса / Принадлежит", +"Resource ID:":"№ ресурса:", +"Resource subset:":"Подмножество ресурсов:", +"Restart":"Перезапустить", +"Resubmit":"Разместить повторно", +"Resume":"Возобновить работу ВМ", +"Retrieving...":"Извлечение...", +"Root:":"Корень:", +"Running VMs":"Запущено ВМ", +"SAVE":"Сохранение изменений", +"SCSI":"SCSI", +"SDL":"SDL", +"SHARED":"Общий каталог", +"SOURCE":"Источник", +"Save as":"Сохранить как", +"Save this image after shutting down the VM":"Сохранить образ после выключения ВМ", +"Save:":"Сохранить:", +"Saveas for VM with ID":"Сохранить как для ВМ с №", +"Script:":"Скрипт:", +"Select a template":"Выберите шаблон", +"Select boot method":"Выберите метод загрузки", +"Select disk:":"Выберите диск:", +"Select template:":"Использовать шаблон:", +"Select the group from which to delete users:":"Выберите группу, из которой требуется исключить пользователей:", +"Select the new ":"Выбрать новую группу", +"Select the new group to add users:":"Выберите новую группу, в которую требуется включить пользователей:", +"Select the new group:":"Выберите новую группу:", +"Select the new owner:":"Выбрать нового владельца:", +"Setup Networks":"Настройка сетей", +"Shutdown":"Выключить", +"Size in MB":"Размер в МБ", +"Size of the datablock in MB.":"Размер блока данных в МБ.", +"Size:":"Размер:", +"Skipping VM ":"Пропуск ВМ ", +"Source to be used in the DISK attribute. Useful for not file-based images.":"В качестве источника указывается местоположение образа, который планируется использовать непосредственно.", +"Source":"Источник", +"Specific ID":"Ресурс с конкретным №", +"Specific image mapping driver. KVM: raw, qcow2. Xen:tap:aio:, file:. VMware unsupported":"Формат образа виртуального диска. Для KVM: raw, qcow2. Для Xen: tap:aio:, file:. Форматы VMware не поддерживаются", +"Start Time":"Время запуска", +"Start time":"Время запуска", +"State":"Состояние", +"Status":"Статус", +"Stop":"Остановить", +"Submitted":"Выполнено", +"Summary of resources":"Использование ресурсов", +"Suspend":"Приостановить работу ВМ", +"Swap":"Swap", +"TARGET":"Ус-во загрузки", +"TEMPLATE_ID":"№ шаблона ВМ", +"TM MAD":"Модуль ср-ва передачи", +"TYPE":"Тип", +"Tablet":"Планшетный ПК", +"Target:":"Ус-во загрузки:", +"Tcp black ports:":"Запрещенные TCP-порты:", +"Tcp firewall mode:":"TCP режим брандмауэра:", +"Tcp white ports:":"Разрешенные TCP-порты:", +"Template information":"Сведения о шаблоне", +"Template updated correctly":"Шаблон успешно обновлен", +"Template":"Шаблон", +"Templates":"Шаблоны ВМ", +"There are mandatory fields missing in the OS Boot options section":"В разделе «Загрузка и тип ОС» не заполнены некоторые обязательные поля", +"There are mandatory fields missing in the capacity section":"В разделе «Производительность» не заполнены некоторые обязательные поля", +"There are mandatory parameters missing in this section":"В данном разделе указаны не все обязательные параметры", +"There are mandatory parameters missing":"Указаны не все обязательные параметры", +"This field sets which attribute will be used to sort the suitable hosts for this VM. Basically, it defines which hosts are more suitable than others":"В данном поле устанавливается значение атрибута, используемое для ранжирования узлов, пригодных для размещения ВМ. Значение атрибута определяет, какие из узлов лучше подходят для размещения ВМ.", +"This rule applies to:":"Прим. правило к:", +"This will cancel selected VMs":"Прервать работу выбранных ВМ", +"This will change the main group of the selected users. Select the new group:":"Изменение основной группы для выбранных пользователей. Выберите новую группу:", +"This will delete the selected VMs from the database":"Удалить выбранные ВМ и связанные с ними образы дисков из базы данных и хранилища образов", +"This will deploy the selected VMs on the chosen host":"Разместить выбранные ВМ на определенном узле", +"This will hold selected pending VMs from being deployed":"Приостановить процедуру размещения ВМ на узле", +"This will initiate the shutdown process in the selected VMs":"Запустить процесс выключения выбранных ВМ", +"This will live-migrate the selected VMs to the chosen host":"Перенести выбранные запущенные ВМ, не завершая их работы, с текущих узлов на выбранный", +"This will migrate the selected VMs to the chosen host":"Перенести выбранные остановленные ВМ с текущих узлов на выбранный", +"This will redeploy selected VMs (in UNKNOWN or BOOT state)":"Повторно выполнить процедуру размещения выбранных ВМ, находящихся в состоянии UNKNOWN или BOOT, на узле", +"This will release held machines":"Продолжить ранее приостановленное размещение ВМ на узле", +"This will resubmits VMs to PENDING state":"Повторно выполнить попытку размещения выбранных ВМ на одном из доступных узлов системы виртуализации (перевод в состояние PENDING)", +"This will resume selected stopped or suspended VMs":"Возобновить работу выбранных остановленных или приостановленных ВМ", +"This will stop selected VMs":"Остановить выбранные ВМ", +"This will suspend selected machines":"Приостановить выбранные ВМ", +"TIMESTAMP":"Время", +"TOTALCPU":"Ресурс ЦП", +"TOTALMEMORY":"Объем ОЗУ", +"Total Leases":"Суммарное количество адресов", +"Total VM count":"Количество виртуальных машин", +"Transfer Manager:":"Средство передачи:", +"Type of disk device to emulate.":"Тип эмулируемого дискового устройства", +"Type of disk device to emulate: ide, scsi":"Тип эмулируемого дискового устройства: ide, scsi", +"Type of file system to be built. This can be any value understood by mkfs unix command.":"Тип создаваемой ФС. Может быть указан любой тип, который используется в unix-команде mkfs.", +"Type of the image, explained in detail in the following section. If omitted, the default value is the one defined in oned.conf (install default is OS).":"Тип. Если не указать тип образа, его значение будет считано из конфигурационного файла oned.conf (значение по умолчанию — «OS»).", +"Type":"Тип", +"USB":"USB", +//"USED":"", +"USEDCPU":"Использование ресурса ЦП", +"USEDMEMORY":"Используемый объем ОЗУ", +"USED_BY":"Экземпляров в использовании", +"Udp black ports:":"Запрещенные UPD-порты:", +"Udp firewall mode:":"UPD режим брандмауэра:", +"Udp white ports:":"Разрешенные UPD-порты:", +"Unpublish":"Отменить статус «Открытый»", +"Update a template":"Обновить шаблон", +"Update template":"Обновить шаблон", +"Update":"Обновить", +"Use":"Использовать", +"Used CPU (allocated)":"Использовано ОЗУ(реально)", +"Used CPU (real)":"Использовано ЦП(реально)", +"Used CPU":"Используется ЦП", +"Used Mem (allocated)":"Использовано ОЗУ(выделено)", +"Used Mem (real)":"Использовано ОЗУ(реально)", +"Used Memory":"Используется памяти", +"Useful for power management, for example, normally required for graceful shutdown to work":"Требуется для корректного завершения работы ВМ средствами системы виртуализации", +"User chgrp":"Изменение группы", +"User create":"Пользователь создан", +"User delete":"Пользователь удален", +"User name and password must be filled in":"Необходимо указать и имя пользователя, и пароль", +"User":"Пользователь", +"Username:":"Имя пользователя:", +"Users":"Пользователи", +"VCPU":"Кол-во вирт. ЦП", +"VCPU:":"Кол-во вирт. ЦП:", +"VID":"№ ВМ", +"VM Instance":"Экземпляр ВМ", +"VM Instances (":"Экземпляры ВМ (", +"VM MAD":"Модуль ср-ва виртуализации", +"VM Name:":"Название ВМ:", +"VM Network stats":"Статистика виртуальных сетей", +"VM Save As":"ВМ сохранить как", +"VM Template":"Шаблон ВМ", +"VM Templates (total/public)":"Шаблоны ВМ (всего/из них открытых)", +"VM Templates":"Шаблоны ВМ", +"VM information":"Информация о ВМ", +"VM log":"Журнал ВМ", +"VM template":"Шаблон ВМ", +"VM":"ВМ", +"VMID":"№ ВМ", +"VNC Access":"Доступ по VNC", +"VNC Disabled":"VNC недоступно", +"VNC Session":"VNC сессия", +"VNC connection":"VNC соединение", +"VNC":"VNC", +"Value of the context variable":"Значение контекстной переменной", +"Value of the custom variable":"Значение пользовательской перменной", +"Value:":"Значение:", +"Virtio (KVM)":"Virtio (KVM)", +"Virtio":"Virtio", +"Virtual Machine information":"Информация о виртуальной машине", +"Virtual Machines":"Вирт. машины", +"Virtual Network name missing!":"Отсутствует название виртуальной сети!", +"Virtual Network template":"Шаблон виртуальной сети", +"Virtual Networks (total/public)":"Виртуальные сети (всего/из них открытых)", +"Virtual Networks":"Вирт. сети", +"Virtual Network":"Виртуальная сеть", +"Virtual Network information":"Информация о виртуальной сети", +"Virtual network information":"Информация о виртуальной сети", +"Virtual network template":"Шаблон виртуальной сети", +"Virtualization Manager:":"Средство виртуализации:", +"Wizard KVM":"Шаблон KVM", +"Wizard VMware":"Шаблон VMware", +"Wizard XEN":"Шаблон XEN", +"Wizard":"Мастер настройки", +"Write the Virtual Machine template here":"Отредактируйте параметры шаблона ВМ вручную", +"Write the Virtual Network template here":"Отредактируйте параметры шаблона вирт. сети вручную", +"Write the image template here":"Отредактируйте параметры шаблона образа ВМ вручную", +"XEN":"XEN", +"Xen templates must specify a boot method":"В шаблон Xen необходимо указывать метод загрузки", +"YES":"да", +"Yes":"Да", +"You have not selected a template":"Вы не выбрали шаблон", +"You have to confirm this action.":"Необходимо подтвердить данную операцию.", +"You need to select something.":"Вы должны что-нибудь выбрать.", +"active":"активных", +"are mandatory":"обязательные", +"cdrom":"cdrom", +"cpu_usage":"использование", +"disk id :":"диск №: ", +"error":"ошибок", +"failed":"дефектных", +"fd":"fd", +"hd":"hd", +"id":"№", +"max_cpu":"максимально", +"max_mem":"максимально", +"mem_usage":"использование", +"net_rx":"принято", +"net_tx":"отправлено", +"network":"network", +"no":"никак нет", +"running":"запущенных", +"total":"всего", +"used_cpu":"использовано", +"used_mem":"использовано", +"yes":"да" +}; +//Переведено ЗАО «ВИВОСС и ОИ», 2011 + +datatable_lang = "ru_datatable.txt" +locale={ +"information":"информация", +"#VMS":"Кол-во ВМ", +"+ New Group":"Создать группу", +"+ New":"Добавить", +". No disk id or image name specified":". Не указано название образа или № диска", +"ACL Rules":"Правила контроля доступа", +"ACL String preview:":"Предпросмотр правила:", +"ACLs":"Списки контроля", +"ACPI":"ACPI", +//"ACTIVE":"", +"Accept (default)":"Принять (по умолчанию)", +"Acl create":"Список контроля создан", +"Acl delete":"Удален список контроля с номером ", +"Acl":"Список контроля доступа", +"Add Graphics":"Добавить графические устройства", +"Add Hypervisor raw options":"Добавить исходные опции гипервизора", +"Add context variables":"Добавить контекстные переменные", +"Add custom variables":"Добавить пользовательские переменные", +"Add disk/image":"Добавить диск/образ", +"Add disks/images":"Добавить диски/образы", +"Add inputs":"Добавить устройства ввода", +"Add lease":"Добавить адрес", +"Add network":"Добавить сеть", +"Add placement options":"Добавить опции размещения", +"Add to group":"Включить в группу", +"Add":"Добавить", +"Advanced mode":"Расширенный режим", +"Affected resources":"Затрагиваемые правилом ресурсы", +"All":"Все", +"Allowed operations":"Разрешенные действия", +"Amount of RAM required for the VM, in Megabytes.":"Объем ОЗУ (в МБ), необходимый для ВМ.", +"Applies to":"Применено к", +"ARCH":"Архитектура", +"Architecture:":"Архитектура:", +"Arguments for the booting kernel":"Параметры для загрузки ядра", +"BOOT":"Тип ус-ва загрузки", +"BRIDGE":"Шлюз", +"BUS":"Тип шины", +"Block":"Block", +"Boolean expression that rules out provisioning hosts from list of machines suitable to run this VM":"Логическое выражение, исключающее элементы из списка узлов, подходящих для запуска данной ВМ", +"Boot device type":"Тип устройства загрузки", +"Boot method:":"Метод загрузки:", +"Boot/OS options":"Загрузка и тип ОС", +"Boot:":"Загрузка:", +"Bootloader:":"Загрузчик:", +"Bridge":"Шлюз", +"Bus:":"Тип шины:", +"CD-ROM":"CD-ROM", +"CLONE":"Образ клонируется", +"CPU Monitoring information":"Мониторинг ЦП", +"CPU Use":"Использование ЦП", +"CPU architecture to virtualization":"Архитектура ЦП для виртуализации", +"CPU":"ЦП", +"CPUSPEED":"Тактовая частота ЦП", +"Cancel":"Отменить", +"Canvas not supported.":"Canvas не поддерживается.", +"Capacity options":"Настройки производительности", +"Capacity":"Производительность", +"Change group":"Сменить группу", +"Change owner":"Сменить владельца", +"Clone this image":"Клонировать образ", +"Clone:":"Образ клонируется:", +"Confirmation of action":"Подтверждение действия", +"Context variable name and value must be filled in":"Поля «Имя переменной» и «Значение» должны быть заполнены", +"Context":"Контекст", +"Create ACL":"Создать список контроля", +"Create VM Template":"Создать шаблон ВМ", +"Create Virtual Machine":"Создать виртуальную машину", +"Create Virtual Network":"Создать виртуальную сеть", +"Create an empty datablock":"Создать пустой блок данных", //!! +"Create group":"Создать группу", +"Create host":"Создать узел", +"Create user":"Создать пользователя", +"Create":"Создать", +"Current NICs:":"Текущие контроллеры сет. интерфейса:", +"Current disks:":"Текущие диски:", +"Current inputs:":"Текущие УВВ:", +"Current leases:":"Текущие адреса:", +"Current variables:":"Текущее значение:", +"Custom variable name and value must be filled in":"Поля «Имя переменной» и «Значение» должны быть заполнены", +"Custom variables":"Пользовательские переменные", +"DESCRIPTION":"Краткое описание", +"DEV_PREFIX":"Префикс устройства", +//"DISABLED":"", +"DISK":"Сведения о диске", +"DISK_ID":"№ диска", +"DRIVER":"Драйвер", +"Dashboard":"Инф. панель", +"Data:":"Данные:", +"Datablock":"Блок данных", +"Default":"По умолчанию", +"Delete from group":"Исключить из группы", +"Delete host":"Удалить узел", +"Delete":"Удалить", +"Deploy # VMs:":"Кол-во экземпляров ВМ для размещения:", +"Deploy ID":"№ размещения", +"Deploy":"Разместить на узле", +"Description:":"Описание:", +"Device prefix:":"Префикс устройства:", +"Device to be mounted as root":"Устройство, монтируемое как корневое", +"Device to map image disk. If set, it will overwrite the default device mapping":"Устройство для образа диска. Если установлено, то оно перезапищет устройсво картографирования по умолчанию.", +"Disable":"Отключить", +"Disallow access to the VM through the specified ports in the TCP protocol":"Запретить доступ к ВМ через указанные порты для TCP протокола", +"Disallow access to the VM through the specified ports in the UDP protocol":"Запретить доступ к ВМ через указанные порты для UDP протокола", +"Disk file location path or URL":"Путь расположения файла диска или URL", +"Disk type":"Тип диска", +"Disk":"Диск", +"Disks":"Диски", +"Do you want to proceed?":"Хотите продолжить?", +"Driver default":"Драйвер по умолчанию", +"Driver:":"Драйвер:", +"Drivers":"Драйверы", +"Drop":"Сбросить", +"Dummy":"Заглушка", +"EC2":"EC2", +"ERROR":"Сведения об ошибках", +"Enable":"Включить", +"Error":"Ошибка", +"FEATURES":"Особенности", +//"FIXED":"", +"FREECPU":"Незадействованный ресурс ЦП", +"FREEMEMORY":"Свободно ОЗУ", +"FS type:":"Тип ФС:", +"FS":"FS", +"Features":"Особенности", +"Fields marked with":"Поля помеченные", +"File":"Файл", +"Filesystem type for the fs images":"Тип файловой системы для образов ФС", +"Fixed network":"Фиксированные адреса", +"Floppy":"Floppy", +"Fold / Unfold all sections":"Свернуть/развернуть все разделы", +"Format:":"Формат:", +"GRAPHICS":"Параметры графического доступа", +"Get Information":"Получить информацию", +"Get Pool of my/group\'s resources":"Получить пул доступных мне/группе ресурсов", +"Get Pool of resources":"Получить пул ресурсов", +"Graphics type:":"Тип ГУ:", +"Graphics":"Графические устройства", +"Group create":"Группа создана", +"Group delete":"Группа удалена", +"Group name:":"Название группы:", +"Group":"Группа пользователей", +"Groups":"Группы", +"HOSTNAME":"Название узла", +"HW address associated with the network interface":"MAC-адрес, связанный с сетевым интерфейсом", +"HYPERVISOR":"Гипервизор", +"Hardware that will emulate this network interface. With Xen this is the type attribute of the vif.":"Аппаратное устройствое, которое будет отвечать за эмуляцию сетевого интерфейса. Для Xen это атрибут vif.", +"Historical monitoring information":"Мониторинг состояния", +"Hold":"Запретить размещение", +"Host information":"Состояние узла", +"Host parameters":"Параметры узла", +"Host shares":"Ресурсы узла", +"Host template":"Шаблон узла", +"Host":"Узел", +"Hostname":"Название узла", +"Hosts (total/active)":"Узлы (всего/из них активных)", +"Hosts CPU":"Загрузка ЦП", +"Hosts memory":"Загрузка ОЗУ", +"Hosts":"Узлы", +"Human readable description of the image for other users.":"Краткое описание образа.", +"ICMP policy":"Политика ICMP", +"ID":"№", +"IDE":"IDE", +"IM MAD":"Модуль ср-ва мониторинга", +"IMAGE":"Используемый образ", +"IMAGE_ID":"№ образа", +//"INIT":"", +"IP to listen on":"IP-адрес для прослушивания", +"IP":"IP-адрес", +"IP:":"IP:", +"Icmp:":"Icmp:", +"Image information":"Информация об образе", +"Image name:":"Название образа:", +"Image template":"Шаблон образа", +"Images (total/public)":"Образы (всего/из них открытых)", +"Images":"Образы ВМ", +"Image":"Образ", +"Info":"Информация", +"Information Manager:":"Cредство мониторинга:", +"Information":"Информация", +"information":" ", +"Initrd:":"Диск нач. иниц.(initrd):", +"Inputs":"Устройства ввода", +"Instantiate":"Создать экземпляр ВМ", +"KVM":"KVM", +"Kernel commands:":"Команды ядра:", +"Kernel:":"Ядро:", +"Keyboard configuration locale to use in the VNC display":"Раскладка клавиатуры, используемая при работе с VNC-дисплеем", +"Keymap":"Раскладка клавиатуры", +"LCM State":"Текущее состояние ВМ", +"LEASES":"АДРЕСА", +"LISTEN":"Прослушивать IP", +"Lease IP:":"IP-адрес:", +"Lease MAC (opt):":"MAC-адрес (необяз.):", +"Lease MAC:":"MAC-адрес:", +"Leases information":"Сведения по имеющимся адресам виртуальной сети", +"Listen IP:":"Прослушивать IP:", +"Live migrate":"Перенести запущенную ВМ", +"Loading":"Идет загрузка", +"MAC":"MAC-адрес", +"MAC:":"MAC-адрес:", +"MEMORY":"Объем ОЗУ", +"MESSAGE":"Сообщение", +"MODELNAME":"Модель ЦП", +//"MONITORED":"", +//"MONITORING":"", +"Make non persistent":"Сделать непостоянным", +"Make persistent":"Сделать постоянным", +"Manage":"Управлять", +"Manual":"В ручную", +"Max Mem":"Доступно ОЗУ", +"Memory monitoring information":"Мониторинг ОЗУ", +"Memory use":"Использование ОЗУ", +"Memory":"Память", +"Migrate":"Перенести ВМ", +"Model:":"Модель:", +"Monitoring information":"Мониторинг", +"Mount image as read-only":"Монтировать образ только для чтения", +"Mouse":"Мышь", +"NAME":"Название", +"Name for the context variable":"Имя контекстной переменной", +"Name for the custom variable":"Имя пользовательской переменной", +"Name for the tun device created for the VM":"Имя сетевого туннеля, созданного для ВМ", +"Name of a shell script to be executed after creating the tun device for the VM":"shell-скрипт, который будет выполнен после создания сетевого туннеля для ВМ", +"Name of the bridge the network device is going to be attached to":"Шлюз, с которым будет связано сетевое устройство", +"Name of the image to use":"Название образа для использования", +"Name of the network to attach this device":"Сеть, подключаемая к данному устройству", +"Name that the Image will get. Every image must have a unique name.":"Название, которое получит образ. Каждый образ должен обладать уникальным названием.", +"Name that the VM will get for description purposes. If NAME is not supplied a name generated by one will be in the form of one-<VID>.":"Название, которое получит ВМ. Если название не будет указано, то оно будет сгенерировано в формате one-<№ ВМ>.", +"Name":"Название", +"Net_RX":"Принято", +"Net_TX":"Отправлено", +"NETRX":"Принято по сети", +"NETTX":"Отправлено по сети", +"NETWORK":"Название вирт. сети", +"NETWORK_ADDRESS":"Адрес сети", +"NETWORK_ID":"№ вирт. сети", +"NETWORK_SIZE":"Размер сети", +"NIC":"Контроллер сетевого интерфейса", +"NO":"нет", +"Network Address:":"Адрес сети:", +"Network reception":"Сеть: принято", +"Network size:":"Размер сети:", +"Network transmission":"Сеть: отправлено", +"Network type:":"Тип сети:", +"Network":"Сеть", +"New: ":"Создать новый ресурс: ", +"No disks defined":"Дисков не обнаружено", +"No":"Нет", +"None":"Никакой", +"Number of virtual cpus. This value is optional, the default hypervisor behavior is used, usually one virtual CPU.":"Количество виртуальных процессоров. Это значение опционально, используется поведение гипервизора по умолчанию - один виртуальный ЦП.", +"OK":"OK", +"OS and Boot options":"Опции загрузки и ОС", +"OS":"ОС", +"Open VNC Session":"Открыть VNC-сессию", +"Optional, please select":"Опционально, пожалуйста выберите", +"Owned by group":"Принадлежит группе", +"Owner":"Владелец", +"PAE:":"PAE:", +"PATH":"ПУТЬ", +"PERSISTENT":"Постоянный", +"PORT":"Номер порта доступа", +"PS2":"PS/2", +"Password for the VNC server":"Пароль для VNC сервера", +"Password:":"Пароль:", +"Path to the OS kernel to boot the image":"Путь к ядру ОС для загрузки образа", +"Path to the bootloader executable":"Путь к исполняемому файлу загрузчика", +"Path to the initrd image":"Путь к образу initrd", +"Path to the original file that will be copied to the image repository. If not specified for a DATABLOCK type image, an empty image will be created.":"Путь к исходному файлу, который будет скопирован в хранилище образов. Если путь не указан для типа образа БЛОК ДАННЫХ, то будет создан пустой образ.", +"Path vs. source:":"Исходные данные образа:", +"Path:":"Путь к эталонному файлу образа:", +"Percentage of CPU divided by 100 required for the Virtual Machine. Half a processor is written 0.5.":"Процент процессорного времени ЦП, предоставлемого ВМ, разделенный на 100. Например, для выделения половины процессорного времени следует указать 0.5.", +"Permits access to the VM only through the specified ports in the TCP protocol":"Разрешить доступ к ВМ только через указанные порты протокола TCP", +"Permits access to the VM only through the specified ports in the UDP protocol":"Разрешить доступ к ВМ только через указанные порты протокола UPD", +"Persistence of the image":"Если образ является постоянным, то при каждом завершении работы с полученной на его основе виртуальной машиной все изменения будут сохранены в образе.\n\n Важно помнить, что сохранение выполнится только в случае завершения работы соответствующей ВМ при помощи операций «Выключить» и «Отменить».\n\nПостоянный образ всегда хранится в одном экземпляре.", +"Persistent":"Постоянный", +"Physical address extension mode allows 32-bit guests to address more than 4 GB of memory":"Режим расширенной физической адресации позволяет использовать 32-битным ВМ больше 4-х ГБ ", +"Placement":"Размещение", +"Please choose path if you have a file-based image. Choose source otherwise or create an empty datablock disk.":"«Путь к эталонному файлу образа» — образ создается путем копирования эталонного файла образа в хранилище образов.\n\n«Источник» — в данное поле следует указывать местоположение образа (в качестве образа будет использован ресурс, непосредственно указанный в поле «Источник», а не копия этого ресурса).", +"Please choose":"Пожалуйста выберите", +"Please provide a lease IP":"Необходимо указать IP-адрес", +"Please provide a network address":"Укажите адрес сети", +"Please provide a resource ID for the resource(s) in this rule":"Необходимо указать № ресурса(ов) для данного правила)", +"Please select a group to which the selected resources belong to":"Необходимо выбрать группу пользователей, которой принадлежат выбранные ресурсы", +"Please select at least one operation":"Необходимо выбрать по меньшей мере одну операцию", +"Please select at least one resource":"Необходимо выбрать по меньшей мере один ресурс", +"Please select":"Выберите", +"Please specify to who this ACL applies":"Необходимо указать, к кому применять данный список контроля", +"Please specify:":"Укажите:", +"Please, choose and modify the template you want to update:":"Укажите шаблон, который хотите обновить:", +"Port blacklist":"Список запрещенных портов", +"Port for the VNC server":"Порт для сервера VNC", +"Port whitelist":"Список разрешенных портов", +"Port:":"Порт:", +"Predefined":"По умолчанию", +"Prefix for the emulated device this image will be mounted at. For instance, “hd”, “sd”. If omitted, the default value is the one defined in oned.conf (installation default is “hd”).":"Префикс эмулируемого устройства, на которое будет смонтирован образ. Например, «hd» и «sd». Если не указать префикс, его значение будет считано из конфигурационного файла oned.conf (значение по умолчанию — «hd»).", +"Previous action":"Предыдущее действие", +"Provide a path":"Указать путь к эталонному файлу образа", +"Provide a source":"Указать источник для образа", +"Public scope of the image":"Информация о доступности образа", +"Public":"Открытый", +"Publish":"Сделать открытым", +"Quickstart":"Типовые операции", +//"RANGED":"" +"RAW":"RAW", +"READONLY":"Доступен только на чтение", +//"READY":"", +"Ranged network":"Диапазон адресов", +"Rank:":"Степень:", +"Raw data to be passed directly to the hypervisor":"Исходные данные, передаваемые напрямую гипервизору", +"Raw":"Исходная опция", +"Read only:":"Только чтение:", +"Refresh list":"Обновить список", +"Register time":"Время регистрации", +"Registration time":"Время регистрации", +"Release":"Разрешить размещение", +"Remove lease":"Удалить адрес", +"Remove selected":"Удалить выбранные", +"Request an specific IP from the Network":"Запросить определенный IP-адрес из сети", +"Requirements:":"Требования:", +"Reset":"Сбросить", +"Resource ID / Owned by":"№ ресурса / Принадлежит", +"Resource ID:":"№ ресурса:", +"Resource subset:":"Подмножество ресурсов:", +"Restart":"Перезапустить", +"Resubmit":"Разместить повторно", +"Resume":"Возобновить работу ВМ", +"Retrieving...":"Извлечение...", +"Root:":"Корень:", +"Running VMs":"Запущено ВМ", +"SAVE":"Сохранение изменений", +"SCSI":"SCSI", +"SDL":"SDL", +"SHARED":"Общий каталог", +"SOURCE":"Источник", +"Save as":"Сохранить как", +"Save this image after shutting down the VM":"Сохранить образ после выключения ВМ", +"Save:":"Сохранить:", +"Saveas for VM with ID":"Сохранить как для ВМ с №", +"Script:":"Скрипт:", +"Select a template":"Выберите шаблон", +"Select boot method":"Выберите метод загрузки", +"Select disk:":"Выберите диск:", +"Select template:":"Использовать шаблон:", +"Select the group from which to delete users:":"Выберите группу, из которой требуется исключить пользователей:", +"Select the new ":"Выбрать новую группу", +"Select the new group to add users:":"Выберите новую группу, в которую требуется включить пользователей:", +"Select the new group:":"Выберите новую группу:", +"Select the new owner:":"Выбрать нового владельца:", +"Setup Networks":"Настройка сетей", +"Shutdown":"Выключить", +"Size in MB":"Размер в МБ", +"Size of the datablock in MB.":"Размер блока данных в МБ.", +"Size:":"Размер:", +"Skipping VM ":"Пропуск ВМ ", +"Source to be used in the DISK attribute. Useful for not file-based images.":"В качестве источника указывается местоположение образа, который планируется использовать непосредственно.", +"Source":"Источник", +"Specific ID":"Ресурс с конкретным №", +"Specific image mapping driver. KVM: raw, qcow2. Xen:tap:aio:, file:. VMware unsupported":"Формат образа виртуального диска. Для KVM: raw, qcow2. Для Xen: tap:aio:, file:. Форматы VMware не поддерживаются", +"Start Time":"Время запуска", +"Start time":"Время запуска", +"State":"Состояние", +"Status":"Статус", +"Stop":"Остановить", +"Submitted":"Выполнено", +"Summary of resources":"Использование ресурсов", +"Suspend":"Приостановить работу ВМ", +"Swap":"Swap", +"TARGET":"Ус-во загрузки", +"TEMPLATE_ID":"№ шаблона ВМ", +"TM MAD":"Модуль ср-ва передачи", +"TYPE":"Тип", +"Tablet":"Планшетный ПК", +"Target:":"Ус-во загрузки:", +"Tcp black ports:":"Запрещенные TCP-порты:", +"Tcp firewall mode:":"TCP режим брандмауэра:", +"Tcp white ports:":"Разрешенные TCP-порты:", +"Template information":"Сведения о шаблоне", +"Template updated correctly":"Шаблон успешно обновлен", +"Template":"Шаблон", +"Templates":"Шаблоны ВМ", +"There are mandatory fields missing in the OS Boot options section":"В разделе «Загрузка и тип ОС» не заполнены некоторые обязательные поля", +"There are mandatory fields missing in the capacity section":"В разделе «Производительность» не заполнены некоторые обязательные поля", +"There are mandatory parameters missing in this section":"В данном разделе указаны не все обязательные параметры", +"There are mandatory parameters missing":"Указаны не все обязательные параметры", +"This field sets which attribute will be used to sort the suitable hosts for this VM. Basically, it defines which hosts are more suitable than others":"В данном поле устанавливается значение атрибута, используемое для ранжирования узлов, пригодных для размещения ВМ. Значение атрибута определяет, какие из узлов лучше подходят для размещения ВМ.", +"This rule applies to:":"Прим. правило к:", +"This will cancel selected VMs":"Прервать работу выбранных ВМ", +"This will change the main group of the selected users. Select the new group:":"Изменение основной группы для выбранных пользователей. Выберите новую группу:", +"This will delete the selected VMs from the database":"Удалить выбранные ВМ и связанные с ними образы дисков из базы данных и хранилища образов", +"This will deploy the selected VMs on the chosen host":"Разместить выбранные ВМ на определенном узле", +"This will hold selected pending VMs from being deployed":"Приостановить процедуру размещения ВМ на узле", +"This will initiate the shutdown process in the selected VMs":"Запустить процесс выключения выбранных ВМ", +"This will live-migrate the selected VMs to the chosen host":"Перенести выбранные запущенные ВМ, не завершая их работы, с текущих узлов на выбранный", +"This will migrate the selected VMs to the chosen host":"Перенести выбранные остановленные ВМ с текущих узлов на выбранный", +"This will redeploy selected VMs (in UNKNOWN or BOOT state)":"Повторно выполнить процедуру размещения выбранных ВМ, находящихся в состоянии UNKNOWN или BOOT, на узле", +"This will release held machines":"Продолжить ранее приостановленное размещение ВМ на узле", +"This will resubmits VMs to PENDING state":"Повторно выполнить попытку размещения выбранных ВМ на одном из доступных узлов системы виртуализации (перевод в состояние PENDING)", +"This will resume selected stopped or suspended VMs":"Возобновить работу выбранных остановленных или приостановленных ВМ", +"This will stop selected VMs":"Остановить выбранные ВМ", +"This will suspend selected machines":"Приостановить выбранные ВМ", +"TIMESTAMP":"Время", +"TOTALCPU":"Ресурс ЦП", +"TOTALMEMORY":"Объем ОЗУ", +"Total Leases":"Суммарное количество адресов", +"Total VM count":"Количество виртуальных машин", +"Transfer Manager:":"Средство передачи:", +"Type of disk device to emulate.":"Тип эмулируемого дискового устройства", +"Type of disk device to emulate: ide, scsi":"Тип эмулируемого дискового устройства: ide, scsi", +"Type of file system to be built. This can be any value understood by mkfs unix command.":"Тип создаваемой ФС. Может быть указан любой тип, который используется в unix-команде mkfs.", +"Type of the image, explained in detail in the following section. If omitted, the default value is the one defined in oned.conf (install default is OS).":"Тип. Если не указать тип образа, его значение будет считано из конфигурационного файла oned.conf (значение по умолчанию — «OS»).", +"Type":"Тип", +"USB":"USB", +//"USED":"", +"USEDCPU":"Использование ресурса ЦП", +"USEDMEMORY":"Используемый объем ОЗУ", +"USED_BY":"Экземпляров в использовании", +"Udp black ports:":"Запрещенные UPD-порты:", +"Udp firewall mode:":"UPD режим брандмауэра:", +"Udp white ports:":"Разрешенные UPD-порты:", +"Unpublish":"Отменить статус «Открытый»", +"Update a template":"Обновить шаблон", +"Update template":"Обновить шаблон", +"Update":"Обновить", +"Use":"Использовать", +"Used CPU (allocated)":"Использовано ОЗУ(реально)", +"Used CPU (real)":"Использовано ЦП(реально)", +"Used CPU":"Используется ЦП", +"Used Mem (allocated)":"Использовано ОЗУ(выделено)", +"Used Mem (real)":"Использовано ОЗУ(реально)", +"Used Memory":"Используется памяти", +"Useful for power management, for example, normally required for graceful shutdown to work":"Требуется для корректного завершения работы ВМ средствами системы виртуализации", +"User chgrp":"Изменение группы", +"User create":"Пользователь создан", +"User delete":"Пользователь удален", +"User name and password must be filled in":"Необходимо указать и имя пользователя, и пароль", +"User":"Пользователь", +"Username:":"Имя пользователя:", +"Users":"Пользователи", +"VCPU":"Кол-во вирт. ЦП", +"VCPU:":"Кол-во вирт. ЦП:", +"VID":"№ ВМ", +"VM Instance":"Экземпляр ВМ", +"VM Instances (":"Экземпляры ВМ (", +"VM MAD":"Модуль ср-ва виртуализации", +"VM Name:":"Название ВМ:", +"VM Network stats":"Статистика виртуальных сетей", +"VM Save As":"ВМ сохранить как", +"VM Template":"Шаблон ВМ", +"VM Templates (total/public)":"Шаблоны ВМ (всего/из них открытых)", +"VM Templates":"Шаблоны ВМ", +"VM information":"Информация о ВМ", +"VM log":"Журнал ВМ", +"VM template":"Шаблон ВМ", +"VM":"ВМ", +"VMID":"№ ВМ", +"VNC Access":"Доступ по VNC", +"VNC Disabled":"VNC недоступно", +"VNC Session":"VNC сессия", +"VNC connection":"VNC соединение", +"VNC":"VNC", +"Value of the context variable":"Значение контекстной переменной", +"Value of the custom variable":"Значение пользовательской перменной", +"Value:":"Значение:", +"Virtio (KVM)":"Virtio (KVM)", +"Virtio":"Virtio", +"Virtual Machine information":"Информация о виртуальной машине", +"Virtual Machines":"Вирт. машины", +"Virtual Network name missing!":"Отсутствует название виртуальной сети!", +"Virtual Network template":"Шаблон виртуальной сети", +"Virtual Networks (total/public)":"Виртуальные сети (всего/из них открытых)", +"Virtual Networks":"Вирт. сети", +"Virtual Network":"Виртуальная сеть", +"Virtual Network information":"Информация о виртуальной сети", +"Virtual network information":"Информация о виртуальной сети", +"Virtual network template":"Шаблон виртуальной сети", +"Virtualization Manager:":"Средство виртуализации:", +"Wizard KVM":"Шаблон KVM", +"Wizard VMware":"Шаблон VMware", +"Wizard XEN":"Шаблон XEN", +"Wizard":"Мастер настройки", +"Write the Virtual Machine template here":"Отредактируйте параметры шаблона ВМ вручную", +"Write the Virtual Network template here":"Отредактируйте параметры шаблона вирт. сети вручную", +"Write the image template here":"Отредактируйте параметры шаблона образа ВМ вручную", +"XEN":"XEN", +"Xen templates must specify a boot method":"В шаблон Xen необходимо указывать метод загрузки", +"YES":"да", +"Yes":"Да", +"You have not selected a template":"Вы не выбрали шаблон", +"You have to confirm this action.":"Необходимо подтвердить данную операцию.", +"You need to select something.":"Вы должны что-нибудь выбрать.", +"active":"активных", +"are mandatory":"обязательные", +"cdrom":"cdrom", +"cpu_usage":"использование", +"disk id :":"диск №: ", +"error":"ошибок", +"failed":"дефектных", +"fd":"fd", +"hd":"hd", +"id":"№", +"max_cpu":"максимально", +"max_mem":"максимально", +"mem_usage":"использование", +"net_rx":"принято", +"net_tx":"отправлено", +"network":"network", +"no":"никак нет", +"running":"запущенных", +"total":"всего", +"used_cpu":"использовано", +"used_mem":"использовано", +"yes":"да" +}; diff --git a/src/sunstone/public/locale/ru/ru_datatable.txt b/src/sunstone/public/locale/ru/ru_datatable.txt new file mode 100644 index 0000000000..a8d9b48c9b --- /dev/null +++ b/src/sunstone/public/locale/ru/ru_datatable.txt @@ -0,0 +1,17 @@ +{ + "sProcessing": "Ждите. Выполняется обработка...", + "sLengthMenu": "Показывать _MENU_ элементов списка", + "sZeroRecords": "Список пуст", + "sInfo": "Показаны элементы списка с _START_ по _END_ из _TOTAL_", + "sInfoEmpty": "Список пуст", + "sInfoFiltered": "(отфильтровано из _MAX_ элементов списка)", + "sInfoPostFix": "", + "sSearch": "Поиск:", + "sUrl": "", + "oPaginate": { + "sFirst": "Первая", + "sPrevious": "Предыдущая", + "sNext": "Следующая", + "sLast": "Последняя" + } +} \ No newline at end of file diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index e901caa82c..3be88d9db6 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -114,6 +114,12 @@ helpers do session[:ip] = request.ip session[:remember] = params[:remember] + if user['TEMPLATE/LANG'] + session[:lang] = user['TEMPLATE/LANG'] + else + session[:lang] = settings.config[:lang] + end + if params[:remember] env['rack.session.options'][:expire_after] = 30*60*60*24 end @@ -209,12 +215,26 @@ get '/config' do @SunstoneServer.get_configuration(session[:user_id]) end +post '/config' do + begin + body = JSON.parse(request.body.read) + rescue + [500, OpenNebula::Error.new(msg).to_json] + end + + body.each do | key,value | + case key + when "lang" then session[:lang]=value + end + end +end + get '/vm/:id/log' do @SunstoneServer.get_vm_log(params[:id]) end ############################################################################## -# Logs +# Monitoring ############################################################################## get '/:resource/monitor' do diff --git a/src/sunstone/views/index.erb b/src/sunstone/views/index.erb index 9140aafa6e..3e7d46cdda 100644 --- a/src/sunstone/views/index.erb +++ b/src/sunstone/views/index.erb @@ -2,7 +2,7 @@ OpenNebula Sunstone: Cloud Operations Center - + @@ -20,6 +20,13 @@ + + +<%if session[:lang]%> + +<%end%> + + @@ -42,6 +49,7 @@ +
                          @@ -60,6 +68,14 @@
                          Welcome  | Sign Out
                          +
                          +
                          + +
                          +