From: Loic Baron Date: Tue, 22 Jul 2014 17:10:56 +0000 (-0300) Subject: FIBRE: updated to the new version, wip on institution page X-Git-Url: http://git.onelab.eu/?p=unfold.git;a=commitdiff_plain;h=594732ab461c6a75a8778f41724f4224839b26a6 FIBRE: updated to the new version, wip on institution page --- diff --git a/manifoldapi/manifoldproxy.py b/manifoldapi/manifoldproxy.py index 99959aee..76f61654 100644 --- a/manifoldapi/manifoldproxy.py +++ b/manifoldapi/manifoldproxy.py @@ -55,6 +55,7 @@ with the query passed using POST""" admin_user, admin_password = ConfigEngine().manifold_admin_user_password() manifold_api_session_auth = {'AuthMethod': 'password', 'Username': admin_user, 'AuthString': admin_password} else: + print manifold_query print request.session['manifold'] manifold_api_session_auth = request.session['manifold']['auth'] diff --git a/manifoldapi/static/js/manifold.js b/manifoldapi/static/js/manifold.js index 7dfcb4db..fe76629b 100644 --- a/manifoldapi/static/js/manifold.js +++ b/manifoldapi/static/js/manifold.js @@ -320,12 +320,13 @@ function QueryStore() { var self = this; var query_ext = this.find_analyzed_query_ext(query_uuid); var record_key = manifold.metadata.get_key(query_ext.query.object); + $.each(records, function(i, record) { - var key = manifold.metadata.get_key(query_ext.query.object); + //var key = manifold.metadata.get_key(query_ext.query.object); // ["start_time", "resource", "end_time"] // ["urn"] - var record_key_value = manifold.record_get_value(record, record_key); + query_ext.records.put(record_key_value, record); if (!(query_ext.state.get(record_key_value))) diff --git a/plugins/cafe b/plugins/cafe deleted file mode 120000 index 818c1c65..00000000 --- a/plugins/cafe +++ /dev/null @@ -1 +0,0 @@ -cafe-1.0/ \ No newline at end of file diff --git a/plugins/cafe-1.0/__init__.py b/plugins/cafe-1.0/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/plugins/cafe-1.0/cafe b/plugins/cafe-1.0/cafe deleted file mode 120000 index 47de4c7d..00000000 --- a/plugins/cafe-1.0/cafe +++ /dev/null @@ -1 +0,0 @@ -cafe/ \ No newline at end of file diff --git a/plugins/cafe-1.0/cafe.zip b/plugins/cafe-1.0/cafe.zip deleted file mode 100644 index b58f144b..00000000 Binary files a/plugins/cafe-1.0/cafe.zip and /dev/null differ diff --git a/plugins/cafe-1.0/edelberto-120314.py b/plugins/cafe-1.0/edelberto-120314.py deleted file mode 100644 index a3ec0b42..00000000 --- a/plugins/cafe-1.0/edelberto-120314.py +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env python - -from portal.models import PendingUser -#from portal.actions import create_pending_user -# Edelberto - LDAP -from portal.actions import create_pending_user, ldap_create_user - -#Edelberto from manifoldauth -import os,sys -import subprocess -import shlex -import getpass -from hashlib import md5 -import time -from random import randint -import crypt - -import re -#from manifold.manifold.core.router import Router -from manifold.core.query import Query -from manifoldapi.manifoldapi import execute_admin_query -#from portal.actions import manifold_add_user, manifold_add_account, manifold_update_account -from portal.actions import manifold_add_account, manifold_add_reference_user_accounts, sfa_create_user, create_pending_user -from manifold.core.query import Query -# add user to manifold - -from portal.models import PendingUser - -from django.views.generic import View -from django.core.context_processors import csrf -from django.contrib.auth import authenticate, login, logout -from django.template import RequestContext -from django.shortcuts import render_to_response - -from manifold.manifoldresult import ManifoldResult -from ui.topmenu import topmenu_items, the_user -from myslice.configengine import ConfigEngine - -#from django.http import HttpResponse HttpResponseRedirect -from django.http import HttpResponse -#from django.http import HttpResponseRedirect -#from django.template import RequestContext -from django.contrib.sessions.backends.db import SessionStore - -def index(request): -#class EdelbertoView (View): - -# XXX We use cookie! -# Test cookie support - if request.session.test_cookie_worked(): - #if session.test_cookie_worked(): - return HttpResponse("Please enable cookies and try again.") - #return - print "Please enable cookies and try again." - else: - request.session['cn'] = request.META['Shib-inetOrgPerson-cn'] - request.session['sn'] = request.META['Shib-inetOrgPerson-sn'] - request.session['mail'] = request.META['Shib-inetOrgPerson-mail'] - request.session['eppn'] = request.META['Shib-eduPerson-eduPersonPrincipalName'] - #request.session['aff'] = request.META['Shib-brEduPerson-brEduAffiliationType'] - request.session['aff'] = request.META['Shib-eduPerson-eduPersonAffiliation'] - request.session['shib'] = request.META['Shib-Session-ID'] - - if 'mail' in request.session.keys(): - print "Cookie: OK -> Content: cn:" + request.session["cn"] + " sn " +request.session["sn"] + " mail: " + request.session["mail"] + " eppn: " + request.session["eppn"] - #ip += "Cookie: OK -> Content: cn:" + request.session["cn"] + " mail: " + request.session["mail"] + " eppn: " + request.session["eppn"] + "" - else: - print "Cookie: nothing/clear" - #ip += "Cookie: nothing/clear " - - # return HttpResponse(ip) - - - # XXX It's only to test the association of pi and esilva@uff.br - if request.session["eppn"] == 'esilva@uff.br': - username = 'rezende@ufrj' - password = 'fibre2014' - # pass request within the token, so manifold session key can be attached to the request session. - token = {'username': username, 'password': password, 'request': request} - # . a ManifoldResult - when something has gone wrong, like e.g. backend is unreachable - # For all users - Verifying if he exists in MySlice/Manifold - else: - username = request.session["mail"] - # this is ugly. We generate a simple password merging mail "fibre" and sn. - password = request.session["mail"] + "fibre" + request.session["sn"] - - # If we have " we remove - username = username.replace('"','').strip() - password = password.replace('"','').strip() - - # pass request within the token, so manifold session key can be attached to the request session. - token = {'username': username, 'password': password, 'request': request} - # . a ManifoldResult - when something has gone wrong, like e.g. backend is unreachable - # . a django User in case of success - # . or None if the backend could be reached but the authentication failed - auth_result = authenticate(token=token) - print auth_result - print token - # high-level errors, like connection refused or the like - - if isinstance (auth_result, ManifoldResult): - manifoldresult = auth_result - htm = "" - return HttpResponse (htm) - # user was authenticated at the backend - elif auth_result is not None: - user=auth_result - - # Verifying if user is active to logging in - if user.is_active: - print "LOGGING IN" - login(request, user) - htm = "" - #return HttpResponseRedirect ('/login-ok') - return HttpResponse (htm) - else: - # Today all CAFe accounts are actived - htm = "Your account is not active, please contact the site admin." - return HttpResponse (htm) - - - # otherwise - # Creating the user at manifold, myslice and sfa - else: - user_params = { 'email': username, 'password': password } - user_request = {} - - user_request['auth_type'] = 'managed' - - # XXX Common code, dependency ? - from Crypto.PublicKey import RSA - private = RSA.generate(1024) - - # Example: private_key = '-----BEGIN RSA PRIVATE KEY-----\nMIIC...' - # Example: public_key = 'ssh-rsa AAAAB3...' - user_request['private_key'] = private.exportKey() - user_request['public_key'] = private.publickey().exportKey(format='OpenSSH') - - splitmail = username.split("@")[0] - user = splitmail.replace('"','').strip() - hrn = "fibre." + user + str(randint(1,100000)) - - user_request['user_hrn'] = hrn - - user_request['first_name'] = request.session['cn'] - user_request['last_name'] = request.session['sn'] - user_request['authority_hrn'] = "fibre" - user_request['email'] = username - user_request['password'] = password - user_request['public_key'] = user_request['public_key'] - user_request['private_key'] = user_request['private_key'] - - # Verify in django - if PendingUser.objects.filter(email__iexact = user_request['email']): - htm = "Erro - User with same email from CAFe exists in Django" - # verify in manifol - user_query = Query().get('local:user').select('user_id','email') - user_details = execute_admin_query(request, user_query) - for user_detail in user_details: - if user_detail['email'] == user_request['email']: - htm = "Erro - user exist in SFA Registry" - try: - if user_detail['user_hrn'] == user_request['user_hrn']: - htm = "Erro - user with the same hrn in SFA Registry" - except: - continue - - - create_pending_user(user_request, user_request, user_detail) - - return HttpResponse(htm) - return HttpResponse(htm) diff --git a/plugins/cafe-1.0/edelberto-140314.py b/plugins/cafe-1.0/edelberto-140314.py deleted file mode 100644 index dc07b37a..00000000 --- a/plugins/cafe-1.0/edelberto-140314.py +++ /dev/null @@ -1,211 +0,0 @@ -#!/usr/bin/env python - -from portal.models import PendingUser -#from portal.actions import create_pending_user -# Edelberto - LDAP -from portal.actions import create_pending_user, ldap_create_user - -#Edelberto from manifoldauth -import os,sys -import subprocess -import shlex -import getpass -from hashlib import md5 -import time -from random import randint -import crypt - -import re -#from manifold.manifold.core.router import Router -from manifold.core.query import Query -from manifoldapi.manifoldapi import execute_admin_query, execute_query -#from portal.actions import manifold_add_user, manifold_add_account, manifold_update_account -from portal.actions import manifold_add_account, manifold_add_reference_user_accounts, sfa_create_user, create_pending_user -from manifold.core.query import Query -# add user to manifold - -from unfold.loginrequired import FreeAccessView - -from portal.models import PendingUser - -from django.views.generic import View -from django.core.context_processors import csrf -from django.contrib.auth import authenticate, login, logout -from django.template import RequestContext -from django.shortcuts import render_to_response - -from manifoldapi.manifoldresult import ManifoldResult -from ui.topmenu import topmenu_items, the_user -from myslice.configengine import ConfigEngine - -#from django.http import HttpResponse HttpResponseRedirect -from django.http import HttpResponse -#from django.http import HttpResponseRedirect -#from django.template import RequestContext -from django.contrib.sessions.backends.db import SessionStore - -def index(request): -#class EdelbertoView (View): - -# XXX We use cookie! -# Test cookie support - if request.session.test_cookie_worked(): - #if session.test_cookie_worked(): - return HttpResponse("Please enable cookies and try again.") - #return - print "Please enable cookies and try again." - else: - request.session['cn'] = request.META['Shib-inetOrgPerson-cn'] - request.session['sn'] = request.META['Shib-inetOrgPerson-sn'] - request.session['mail'] = request.META['Shib-inetOrgPerson-mail'] - request.session['eppn'] = request.META['Shib-eduPerson-eduPersonPrincipalName'] - #request.session['aff'] = request.META['Shib-brEduPerson-brEduAffiliationType'] - request.session['aff'] = request.META['Shib-eduPerson-eduPersonAffiliation'] - request.session['shib'] = request.META['Shib-Session-ID'] - - if 'mail' in request.session.keys(): - print "Cookie: OK -> Content: cn:" + request.session["cn"] + " sn " +request.session["sn"] + " mail: " + request.session["mail"] + " eppn: " + request.session["eppn"] - #ip += "Cookie: OK -> Content: cn:" + request.session["cn"] + " mail: " + request.session["mail"] + " eppn: " + request.session["eppn"] + "" - else: - print "Cookie: nothing/clear" - #ip += "Cookie: nothing/clear " - - # return HttpResponse(ip) - - # expose this so we can mention the backend URL on the welcome page - def default_env (self): - return { - 'MANIFOLD_URL':ConfigEngine().manifold_url(), - } - - # expose this so we can mention the backend URL on the welcome page - #def default_env (self): - # config=Config() - # return { - # 'MANIFOLD_URL':ConfigEngine().manifold_url(), - # #'MANIFOLD_URL':config.manifold_url(), - # } - - # XXX It's only to test the association of pi and esilva@uff.br - if request.session["eppn"] == 'esilva@uff.br': - username = 'rezende@ufrj' - password = 'fibre2014' - print "eppn OK" - else: - username = request.session["mail"] - # this is ugly. We generate a simple password merging mail "fibre" and sn. - password = request.session["mail"] + "fibre" + request.session["sn"] - - # If we have " we remove - username = username.replace('"','').strip() - password = password.replace('"','').strip() - - # pass request within the token, so manifold session key can be attached to the request session. - #token = {'username': username, 'password': password, 'request': request} - #token = {'username': username, 'password': password} - - # . a ManifoldResult - when something has gone wrong, like e.g. backend is unreachable - # . a django User in case of success - # . or None if the backend could be reached but the authentication failed - print "token CAFe" - #print token - #auth_result = authenticate(token=token) - #auth_result = authenticate(username=username, password=password) - auth_result = authenticate(username='rezende@ufrj', password='fibre2014', request=request) - print "Auth Result CAFe" - print auth_result - # high-level errors, like connection refused or the like - - if isinstance (auth_result, ManifoldResult): - manifoldresult = auth_result - print ManifoldResult - print manifoldresult - #htm = "" - htm = "not authenticated" - return HttpResponse (htm) - # user was authenticated at the backend - elif auth_result is not None: - user=auth_result - - # Verifying if user is active to logging in - if user.is_active: - print "LOGGING IN" - login(request, user) - - #if request.user.is_authenticated(): - # env['person'] = username - # env['username'] = username - #else: - # env['person'] = None - - htm = "" - #return HttpResponseRedirect ('/login-ok') - return HttpResponse (htm) - else: - # Today all CAFe accounts are actived - htm = "Your account is not active, please contact the site admin." - return HttpResponse (htm) - - # otherwise - # Creating the user at manifold, myslice and sfa - else: - user_params = { 'email': username, 'password': password } - user_request = {} - - user_request['auth_type'] = 'managed' - - # XXX Common code, dependency ? - from Crypto.PublicKey import RSA - private = RSA.generate(1024) - - # Example: private_key = '-----BEGIN RSA PRIVATE KEY-----\nMIIC...' - # Example: public_key = 'ssh-rsa AAAAB3...' - user_request['private_key'] = private.exportKey() - user_request['public_key'] = private.publickey().exportKey(format='OpenSSH') - - splitmail = username.split("@")[0] - user = splitmail.replace('"','').strip() - hrn = "fibre." + user + str(randint(1,100000)) - - user_request['user_hrn'] = hrn - - user_request['first_name'] = request.session['cn'] - user_request['last_name'] = request.session['sn'] - user_request['authority_hrn'] = "fibre" - user_request['email'] = username - user_request['password'] = password - user_request['public_key'] = user_request['public_key'] - user_request['private_key'] = user_request['private_key'] - - # Verify in django - if PendingUser.objects.filter(email__iexact = user_request['email']): - htm = "Erro - User with same email from CAFe exists in Django" - # verify in manifol - user_query = Query().get('local:user').select('user_id','email') - user_details = execute_admin_query(request, user_query) - for user_detail in user_details: - if user_detail['email'] == user_request['email']: - htm = "Erro - user exist in SFA Registry" - try: - if user_detail['user_hrn'] == user_request['user_hrn']: - htm = "Erro - user with the same hrn in SFA Registry" - except: - continue - - - #create_pending_user(user_request, user_request, user_detail) - - htm = "Now your CAFe user is associated with a MySlice account - Please login-ok in CAFe again." - return HttpResponse(htm) - # return HttpResponse(htm) - - # login-ok sets state="Welcome to MySlice" in urls.py - def get (self, request, state=None): - env = self.default_env() - env['username']=the_user(request) - env['topmenu_items'] = topmenu_items(None, request) - if state: env['state'] = state - elif not env['username']: env['state'] = "Please sign in" - return HttpResponseRedirect ('/login-ok') - #return render_to_response('home-view.html',env, context_instance=RequestContext(request)) - diff --git a/plugins/cafe-1.0/edelberto.py b/plugins/cafe-1.0/edelberto.py deleted file mode 100644 index 19be099f..00000000 --- a/plugins/cafe-1.0/edelberto.py +++ /dev/null @@ -1,208 +0,0 @@ -#!/usr/bin/env python - - -# XXX We need to clean it!! -from portal.models import PendingUser - -#Edelberto from manifoldauth -import os,sys -import subprocess -import shlex -import getpass -from hashlib import md5 -import time -from random import randint -import crypt - -import re -#from manifold.manifold.core.router import Router -from manifold.core.query import Query -from manifoldapi.manifoldapi import execute_admin_query, execute_query -#from portal.actions import manifold_add_user, manifold_add_account, manifold_update_account -#from portal.actions import manifold_add_account, manifold_add_reference_user_accounts, sfa_create_user, create_pending_user -from portal.actions import create_pending_user, create_user -from manifold.core.query import Query -# add user to manifold - -from unfold.loginrequired import FreeAccessView - -from django.views.generic import View -from django.core.context_processors import csrf -from django.contrib.auth import authenticate, login, logout -from django.template import RequestContext -from django.shortcuts import render_to_response - -from manifoldapi.manifoldresult import ManifoldResult, ManifoldCode, ManifoldException -from ui.topmenu import topmenu_items, the_user -from myslice.configengine import ConfigEngine - -#from django.http import HttpResponse HttpResponseRedirect -from django.http import HttpResponse -#from django.http import HttpResponseRedirect -#from django.template import RequestContext -from django.contrib.sessions.backends.db import SessionStore - -from portal.homeview import HomeView - -# View for authenticate the user -class EdelbertoView (HomeView): - def get(self,request): - env = self.default_env() - env['theme'] = self.theme - print "EdelbertoView" - - # XXX We use cookie! - # Test cookie support - if request.session.test_cookie_worked(): - #if session.test_cookie_worked(): - return HttpResponse("Please enable cookies and try again.") - #return - print "Please enable cookies and try again." - else: - request.session['cn'] = request.META['Shib-inetOrgPerson-cn'] - request.session['sn'] = request.META['Shib-inetOrgPerson-sn'] - request.session['mail'] = request.META['Shib-inetOrgPerson-mail'] - request.session['eppn'] = request.META['Shib-eduPerson-eduPersonPrincipalName'] - #request.session['aff'] = request.META['Shib-brEduPerson-brEduAffiliationType'] - request.session['aff'] = request.META['Shib-eduPerson-eduPersonAffiliation'] - request.session['shib'] = request.META['Shib-Session-ID'] - - if 'mail' in request.session.keys(): - print "Cookie: OK -> Content: cn:" + request.session["cn"] + " sn " +request.session["sn"] + " mail: " + request.session["mail"] + " eppn: " + request.session["eppn"] - #ip += "Cookie: OK -> Content: cn:" + request.session["cn"] + " mail: " + request.session["mail"] + " eppn: " + request.session["eppn"] + "" - else: - print "Cookie: nothing/clear" - #ip += "Cookie: nothing/clear " - # Cookies test finish - # return HttpResponse(ip) - - # expose this so we can mention the backend URL on the welcome page - def default_env (self): - return { - 'MANIFOLD_URL':ConfigEngine().manifold_url(), - } - - - # XXX It's only to test the association of pi and esilva@uff.br - if request.session["eppn"] == 'esilva@uff.br': - username = 'rezende@ufrj' - password = 'fibre2014' - print "eppn OK" - # If the user is not esilva@uff.br, so run the normal authentication - else: - username = request.session["mail"] - # XXX this is ugly. We generate a simple password merging mail "fibre" and sn. - password = request.session["mail"] + "fibre" + request.session["sn"] - - # If we have " we remove - username = username.replace('"','').strip() - password = password.replace('"','').strip() - - # pass request within the token, so manifold session key can be attached to the request session. - token = {'username': username, 'password': password, 'request': request} - - # . a ManifoldResult - when something has gone wrong, like e.g. backend is unreachable - # . a django User in case of success - # . or None if the backend could be reached but the authentication failed - auth_result = authenticate(token=token) - - # XXX Error - We need a toke, not send parameters directly! - #auth_result = authenticate(username='rezende@ufrj', password='fibre2014', request=request) - print "Auth Result CAFe" - print type(auth_result) - # high-level errors, like connection refused or the like - - if isinstance (auth_result, ManifoldResult): - manifoldresult = auth_result - #htm = "" - htm = "not authenticated" - return HttpResponse (htm) - # user was authenticated at the backend - elif auth_result is not None: - user=auth_result - - # Verifying if user is active to logging in - if user.is_active: - print "LOGGING IN" - login(request, user) - - #if request.user.is_authenticated(): - # env['person'] = username - # env['username'] = username - #else: - # env['person'] = None - - htm = "" - #return HttpResponseRedirect ('/login-ok') - return HttpResponse (htm) - #return render_to_response(self.template,env, context_instance=RequestContext(request)) - else: - # Today all CAFe accounts are actived - htm = "Your account is not active, please contact the site admin." - return HttpResponse (htm) - - # otherwise - # Creating the user at manifold, myslice and sfa - # XXX It's the first of CAFe user in MySlice! - else: - # Get the username and password - user_params = { 'email': username, 'password': password } - user_request = {} - - # set the auth_type = managed - user_request['auth_type'] = 'managed' - - # XXX Generating the key pairs for CAFe user - from Crypto.PublicKey import RSA - private = RSA.generate(1024) - - # Example: private_key = '-----BEGIN RSA PRIVATE KEY-----\nMIIC...' - # Example: public_key = 'ssh-rsa AAAAB3...' - user_request['private_key'] = private.exportKey() - user_request['public_key'] = private.publickey().exportKey(format='OpenSSH') - - # Generate a HRN different for all users (plus random int) - # Getting the username - splitmail = username.split("@")[0] - # Getting the organization. The same of authority - # testbed name - org = username.split('@')[1] - o = org.split('.')[-2] - user = splitmail.replace('"','').strip() - # Finally creating the HRN - hrn = "fibre." + o + "." + user + str(randint(1,100000)) - - user_request['user_hrn'] = hrn - - # Others fields we can get from CAFe database - user_request['first_name'] = request.session['cn'] - user_request['last_name'] = request.session['sn'] - # We need to put the user below its authority - user_request['authority_hrn'] = "fibre." + o - user_request['email'] = username - user_request['password'] = password - user_request['public_key'] = user_request['public_key'] - user_request['private_key'] = user_request['private_key'] - - # Verify in django if user exist - if PendingUser.objects.filter(email__iexact = user_request['email']): - htm = "Erro - User with same email from CAFe exists in Django" - # verify in manifold and SFA if user exist - user_query = Query().get('local:user').select('user_id','email') - user_details = execute_admin_query(request, user_query) - for user_detail in user_details: - if user_detail['email'] == user_request['email']: - htm = "Erro - user exist in SFA Registry" - try: - if user_detail['user_hrn'] == user_request['user_hrn']: - htm = "Erro - user with the same hrn in SFA Registry" - except: - continue - - # first we create a uer with pending flag - create_pending_user(user_request, user_request, user_detail) - # after we enable this user and put in SFA - create_user(user_request, user_request) - - htm = "Now your CAFe user is associated with a MySlice account - Please return to the home and log in CAFe again." - return HttpResponse(htm) diff --git a/plugins/cafe-1.0/manifoldbackend.py b/plugins/cafe-1.0/manifoldbackend.py deleted file mode 100644 index 14abb748..00000000 --- a/plugins/cafe-1.0/manifoldbackend.py +++ /dev/null @@ -1,76 +0,0 @@ -import time - -from django.contrib.auth.models import User - -from manifold.manifoldapi import ManifoldAPI, ManifoldException, ManifoldResult -from manifold.core.query import Query - -# Name my backend 'ManifoldBackend' -class ManifoldBackend: - - # Create an authentication method - # This is called by the standard Django login procedure - def authenticate(self, token=None): - if not token: - return None - - try: - username = token['username'] - password = token['password'] - request = token['request'] - - auth = {'AuthMethod': 'password', 'Username': username, 'AuthString': password} - api = ManifoldAPI(auth) - sessions_result = api.forward(Query.create('local:session').to_dict()) - print "result" - sessions = sessions_result.ok_value() - print "ok" - if not sessions: - print "GetSession failed", sessions_result.error() - return - print "first", sessions - session = sessions[0] - - # Change to session authentication - api.auth = {'AuthMethod': 'session', 'session': session['session']} - self.api = api - - # Get account details - # the new API would expect Get('local:user') instead - persons_result = api.forward(Query.get('local:user').to_dict()) - persons = persons_result.ok_value() - if not persons: - print "GetPersons failed",persons_result.error() - return - person = persons[0] - print "PERSON=", person - - request.session['manifold'] = {'auth': api.auth, 'person': person, 'expires': session['expires']} - except ManifoldException, e: - print "Caught ManifoldException, returning corresponding ManifoldResult" - return e.manifold_result - except Exception, e: - print "E: manifoldbackend", e - import traceback - traceback.print_exc() - return None - - try: - # Check if the user exists in Django's local database - user = User.objects.get(username=username) - except User.DoesNotExist: - # Create a user in Django's local database - user = User.objects.create_user(username, username, 'passworddoesntmatter') - user.first_name = "DUMMY_FIRST_NAME" #person['first_name'] - user.last_name = "DUMMY LAST NAME" # person['last_name'] - user.email = person['email'] - return user - - # Required for your backend to work properly - unchanged in most scenarios - def get_user(self, user_id): - try: - return User.objects.get(pk=user_id) - except User.DoesNotExist: - return None - - diff --git a/plugins/cafe-1.0/sub.py b/plugins/cafe-1.0/sub.py deleted file mode 100755 index ec19a5aa..00000000 --- a/plugins/cafe-1.0/sub.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python - -#Edelberto from manifoldauth -import os,sys -import subprocess -import shlex -import getpass -from hashlib import md5 -import time -from random import Random -import crypt - -username = 'teste' -password = '123' - -command = '/var/www/manifold/manifold/bin/adduser.py ' + username + ' ' + password - #command = 'ls -la' -args = shlex.split(command) -p = subprocess.Popen(args, stdin=subprocess.PIPE).communicate()[0] -print command -print args -print p diff --git a/plugins/scheduler2/templates/scheduler.html b/plugins/scheduler2/templates/scheduler.html index e07637ac..0cb9698e 100755 --- a/plugins/scheduler2/templates/scheduler.html +++ b/plugins/scheduler2/templates/scheduler.html @@ -130,3 +130,4 @@ //alert("1"); + diff --git a/portal/homeview.py b/portal/homeview.py index 858c887e..c4a99ca3 100644 --- a/portal/homeview.py +++ b/portal/homeview.py @@ -111,13 +111,14 @@ class HomeView (FreeAccessView, ThemeView): # XXX Something like an invalid session seems to make the execute fail sometimes, and thus gives an error on the main page platform_details = execute_query(self.request, platform_query) account_details = execute_query(self.request, account_query) - for platform_detail in platform_details: - for account_detail in account_details: - if platform_detail['platform_id'] == account_detail['platform_id']: - if 'config' in account_detail and account_detail['config'] is not '': - account_config = json.loads(account_detail['config']) - if 'myslice' in platform_detail['platform']: - acc_auth_cred = account_config.get('delegated_authority_credentials','N/A') + if platform_details: + for platform_detail in platform_details: + for account_detail in account_details: + if platform_detail['platform_id'] == account_detail['platform_id']: + if 'config' in account_detail and account_detail['config'] is not '': + account_config = json.loads(account_detail['config']) + if 'myslice' in platform_detail['platform']: + acc_auth_cred = account_config.get('delegated_authority_credentials','N/A') # assigning values if acc_auth_cred=={} or acc_auth_cred=='N/A': pi = "is_not_pi" diff --git a/portal/registrationview.py b/portal/registrationview.py index 0bccac96..199c1730 100644 --- a/portal/registrationview.py +++ b/portal/registrationview.py @@ -40,7 +40,7 @@ class RegistrationView (FreeAccessView, ThemeView): """ errors = [] - authorities_query = Query.get('authority').select('name', 'authority_hrn') + authorities_query = Query.get('authority').select('name','authority_hrn') authorities = execute_admin_query(wsgi_request, authorities_query) if authorities is not None: authorities = sorted(authorities) @@ -59,13 +59,17 @@ class RegistrationView (FreeAccessView, ThemeView): current_site = Site.objects.get_current() current_site = current_site.domain - authorities_query = Query.get('authority').select('name', 'authority_hrn') - authorities = execute_admin_query(wsgi_request, authorities_query) + #authorities_query = Query.get('authority').select('name', 'authority_hrn') + #authorities = execute_admin_query(wsgi_request, authorities_query) for authority in authorities: if authority['name'] == wsgi_request.POST.get('org_name', ''): authority_hrn = authority['authority_hrn'] + # Handle the case when the template uses only hrn and not name + if not authority_hrn: + authority_hrn = wsgi_request.POST.get('org_name', '') + post_email = wsgi_request.POST.get('email','').lower() salt = randint(1,100000) email_hash = md5(str(salt)+post_email).hexdigest() diff --git a/portal/slicerequestview.py b/portal/slicerequestview.py index 449147ca..bd711d5c 100644 --- a/portal/slicerequestview.py +++ b/portal/slicerequestview.py @@ -83,6 +83,7 @@ class SliceRequestView (LoginRequiredAutoLogoutView, ThemeView): page = Page(wsgi_request) page.add_js_files ( [ "js/jquery.validate.js", "js/jquery-ui.js" ] ) page.add_css_files ( [ "https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" ] ) + page.expose_js_metadata() if method == 'POST': # The form has been submitted @@ -92,12 +93,13 @@ class SliceRequestView (LoginRequiredAutoLogoutView, ThemeView): current_site = current_site.domain # getting the authority_hrn from the selected organization - authority_hrn = '' for authority in authorities: if authority['name'] == wsgi_request.POST.get('org_name', ''): authority_hrn = authority['authority_hrn'] - + # Handle the case when the template uses only hrn and not name + if not authority_hrn: + authority_hrn = wsgi_request.POST.get('org_name', '') slice_request = { 'type' : 'slice', @@ -168,6 +170,7 @@ class SliceRequestView (LoginRequiredAutoLogoutView, ThemeView): 'exp_url': exp_url, 'pi': pi, 'authority_name': authority_name, + 'authority_hrn': user_authority, 'cc_myself': True, 'authorities': authorities, 'theme': self.theme, diff --git a/portal/sliceresourceview.py b/portal/sliceresourceview.py index db7413d1..621ad5c2 100644 --- a/portal/sliceresourceview.py +++ b/portal/sliceresourceview.py @@ -22,6 +22,12 @@ from plugins.googlemap import GoogleMap from plugins.filter_status import FilterStatusPlugin from plugins.testbeds import TestbedsPlugin from plugins.scheduler2 import Scheduler2 + +# Bristol plugin +from plugins.univbrisfoam import UnivbrisFoam +from plugins.univbrisfv import UnivbrisFv +from plugins.univbrisfvf import UnivbrisFvf + from plugins.columns_editor import ColumnsEditor from plugins.sladialog import SlaDialog from plugins.lists.simplelist import SimpleList @@ -42,6 +48,11 @@ class SliceResourceView (LoginRequiredView, ThemeView): metadata = page.get_metadata() page.expose_js_metadata() + # Bristol + univbrisfoam_query=Query().get('ofelia-bristol-of:resource').select('urn') + page.enqueue_query(univbrisfoam_query) + + resource_md = metadata.details_by_object('resource') resource_fields = [column['name'] for column in resource_md['column']] @@ -234,6 +245,50 @@ class SliceResourceView (LoginRequiredView, ThemeView): query = main_query, username = request.user, ) + + # Bristol plugin + univbrisfoamlist = UnivbrisFoam( + page = page, + title = 'univbris_foam_ports_selection', + domid = 'univbris_foam_ports_selection', + query = univbrisfoam_query, + query_all = univbrisfoam_query, + checkboxes = False, + datatables_options = { + 'iDisplayLength': 10, + 'bLengthChange' : True, + 'bAutoWidth' : True, + }, + ) + + #plugin which manages the different flowspaces that the user creates, and also sends flowspaces to manifold + univbrisfvlist = UnivbrisFv( + page = page, + title = 'univbris_flowspace_selection', + domid = 'univbris_flowspace_selection', + query = None, + query_all = None, + datatables_options = { + 'iDisplayLength': 5, + 'bLengthChange' : True, + 'bAutoWidth' : True, + }, + ) + + #plugin which allows the definition of a single flowspace + univbrisfvform = UnivbrisFvf( + page = page, + title = 'univbris_flowspace_form', + domid = 'univbris_flowspace_form', + query = None, + query_all = None, + datatables_options = { + 'iDisplayLength': 3, + 'bLengthChange' : True, + 'bAutoWidth' : True, + }, + ) + # -------------------------------------------------------------------------- @@ -284,6 +339,13 @@ class SliceResourceView (LoginRequiredView, ThemeView): template_env['map_resources'] = map_resources.render(self.request) template_env['scheduler'] = resources_as_scheduler2.render(self.request) + + # Bristol plugin + template_env['resources'] = univbrisfoamlist.render(self.request) + template_env['flowspaces']= univbrisfvlist.render(self.request) + template_env['flowspaces_form']= univbrisfvform.render(self.request) + + # template_env['pending_resources'] = pending_resources.render(self.request) template_env['sla_dialog'] = '' # sla_dialog.render(self.request) template_env["theme"] = self.theme diff --git a/portal/static/css/fibre.css b/portal/static/css/fibre.css index ef27a2e9..639b0402 100644 --- a/portal/static/css/fibre.css +++ b/portal/static/css/fibre.css @@ -1,22 +1,29 @@ +@import url("../fonts/opensans_bold_macroman/stylesheet.css"); + +html { height: 100% } + body { background-color:white; color:black; margin:0; padding:0; + height: 100%; } a, a:active, a:focus { outline: 0; + text-decoration:none; } h1 { border-bottom:1px solid #DDDDDD; - padding:0 0 5px 0; - margin:0 0 15px 0; - font-size:18pt; + padding:0 0 0 0; + margin:15px 0 15px 0; + font-size:14pt; } h1 img { vertical-align:middle; margin-bottom:4px; + margin-right:10px; } h2 { font-size:14pt; @@ -26,18 +33,18 @@ h3 { font-size:13pt; color:#201E62; } -div.wrapper { - width:980px; - margin:0 auto; - position:relative; -} -div.container { - width:80%; - margin:25px auto; +input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number], select, option { + min-width:260px; + padding:6px; + border:1pt solid #22606D; + vertical-align:bottom; + border-radius:0; } -div.wide { - margin:25px auto; - padding:0 25px; + +textarea { + padding:6px; + border:1pt solid #22606D !important; + border-radius:0 !important; } span.label { @@ -46,85 +53,107 @@ span.label { font-weight:normal; padding:0; } -/***** Notifications *****/ -.warning { - border: 1px solid red; - margin: 20px 60px; - padding: 10px 20px; - color: red; - background-color: #f2dbdb; - text-align: center; +div.el { + padding-bottom:15px; } -/* HEADER */ -div#header { - height:100px; - background-color:white; -} - -div#secondary { - -} - -div#secondary ul { - position:absolute; - top:20px; - right:0; +div.breadcrumbs { + margin:15px 0; + color:gray; + font-size:10pt; } - -div#secondary li { +/* buttons */ +button.btn, input.btn { + padding:6px 10px; + border-radius:5px; font-size:10pt; - float:left; - list-style:none; - margin-right:30px; + font-weight:normal; } -div#secondary li a { - color:black; +button.btn span.glyphicon { + margin-right:6px; } -div#secondary li a:hover { - color:#270A5A; - text-decoration:none; +button.btn-default { + border-bottom:3px solid #cccccc; } -div#secondary li:last-child { - margin-right:0; +button.btn-default:hover { + background-color:white; + border:1px solid #ADADAD; + border-bottom:3px solid #ADADAD; } - -div#navigation { - background-color:rgb(30, 88, 111); - width:100%; - height:40px; +button.btn-default:active { + background-color:white; + border:1px solid #ADADAD; + border-bottom:1px solid #ADADAD; + margin-top:2px; + box-shadow:none; +} +button.btn-primary { + border-bottom:3px solid #3071A9; +} +button.btn-primary:hover { + box-shadow:none; + background-color:#428bca; + border:1px solid #357ebd; + border-bottom:3px solid #3071A9; +} +button.btn-primary:active { + box-shadow:none; + border-bottom:1px solid #3071A9; + margin-top:2px; +} +button.btn-danger { + border-bottom:3px solid #A13F3A; +} +button.btn-danger:hover { + box-shadow:none; + background-color:#d9534f; + border:1px solid #d43f3a; + border-bottom:3px solid #A13F3A; +} +button.btn-danger:active { + border:1px solid #d43f3a; + box-shadow:none; + margin-top:2px; +} +button.btn-onelab, input.btn-onelab { + border:0; + border-bottom:3px solid #760073; + background-color:#302562; + color:white; } -div#navigation div.wrapper { - text-align:center; +button.btn-onelab:hover, input.btn-onelab:hover { + border:0; + border-bottom:3px solid #760073; + background-color:#302562; + color:white; } -div#navigation ul { - margin:0; - padding:0; - display: inline-block; - list-style-type: none; - white-space: nowrap; +button.btn-onelab:active, input.btn-onelab:active { + box-shadow:none; + border-bottom:1px solid #760073; + margin-top:2px; } -div#navigation li { - color:white; - font-family:helvetica, sans-serif; - font-size:10pt ; +.container-resource button { + padding:2px 4px; + border-radius:3px; + font-size:9pt; font-weight:normal; - line-height:0.8em; - letter-spacing:0.6pt; - list-style:none; - float:left; - padding:0; - margin:15px 50px 0 0; } -div#navigation li a { - color:white; +.container-resource select,.container-resource option, .container-resource input { + padding:2px 4px; + font-size:9pt; } -div#navigation li a:hover { - text-decoration:none; - color:#B8B2FF; +.badge { + font-size:9pt; + margin-left:4px; } -div#navigation li:last-child { - margin-right:0; +/***** Notifications *****/ +.warning { + border: 1px solid red; + margin: 20px 60px; + padding: 10px 20px; + color: red; + background-color: #f2dbdb; + text-align: center; } /* HOME DASHBOARD */ @@ -133,8 +162,8 @@ div#home-dashboard { margin:0 auto 25px auto; } div#home-dashboard table { -/* margin:25px; */ - width:100% !important; + margin:25px; + width:100%; } div#home-dashboard table td { text-align:center; @@ -151,11 +180,11 @@ div#home-dashboard table tr:last-child td { padding:25px 0; } div#home-dashboard table tr:last-child td.logged-in { - /* border-right:1px solid #DDDDDD; */ + border-right:1px solid #DDDDDD; padding:25px; } div#home-dashboard table tr:last-child td.support { - /* border-left:1px solid #DDDDDD; */ + border-left:1px solid #DDDDDD; padding:25px; } div#home-dashboard table tr:last-child td:first-child { @@ -171,37 +200,6 @@ div#home-dashboard table tr:last-child td.support div { text-align:left; padding:25px 0; } - -/* Edelberto */ -.bar1 { - width: 100%; - background: #FCFCFC; - border: 1px; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); -} - -.well { - width: 350px !important; -} - -#footer { - width: 100%; - float: left; - background-color: rgb(65, 119, 139); - height: 30px; - padding: 5px; - text-align: center; - color: white; -} - -.logo { - padding-bottom: 5px; -} - -/* Edelberto end */ - div#home-dashboard div.login-widget { padding:20px; } @@ -231,56 +229,13 @@ div#home-dashboard div#home-slice-list li { } -.login-submit { - vertical-align:middle; - padding:0; -} -.lost-password { - font-size:10pt; - color:#CCCCCC; - text-align:right; - padding:0px; -} -.lost-password a { -} -.login-signup { - border-top:1px solid #CCCCCC; - text-align:center; - margin-top:15px; - padding:5px 0 0 0; -} /**/ -/* NAV TABS */ - -.nav.nav-tabs { - margin-bottom:25px; -} - -.nav.nav-tabs li.active a { - -} - -.nav.nav-tabs li a { -} - -.nav.nav-tabs li a:hover { -} - /**/ /* WELL */ div.well { } /**/ -/* BUTTON */ -.btn.btn-default { - font-weight: bold; -} - -.btn.btn-default:hover { - font-weight: bold; -} -/**/ /* TABLE */ table.table { margin:0; @@ -329,28 +284,112 @@ div#ticket-request p { margin:20px 0; } +ul.nav-tabs { + margin:0 0 15px 0; +} +ul.nav-tabs ul {} +ul.nav-tabs li {} + +ul.nav-section li a { + color:black; + border-bottom:0; +} +ul.nav-section li:first-child { + padding:0; +} +ul.nav-section li:first-child a { +} +ul.nav-section li:first-child.active a { +} + +ul.nav-resources { + margin:15px 0; +} +ul.nav-resources a { + padding: 4px 10px 5px 10px; +} + /* SLICE VIEW */ +div.container-resource, div.container-slice { + padding-right:15px; + padding-left:15px; +} +.table th { + border-top:0 !important; +} div#slice-view { margin:0; } div.list-group-item { border:0; + -moz-border-radius: 0; + border-radius: 0; background-color:white; font-weight:bold; padding-left:0; } a.list-group-item { + -moz-border-radius: 0; + border-radius: 0; border:0; background-color:white; - padding:3px 0 3px 10px; + padding:3px 2px 3px 10px; border-left:2pt white solid; } -a.list-group-item.active, a.list-group-item:hover { +a.list-group-item.active, a.list-group-item.active:hover, a.list-group-item.active:focus { + -moz-border-radius: 0; + border-radius: 0; + font-weight: bold; + color:black; + background-color:#F5F5F5; + border-left:2pt blue solid; +} + +a.list-group-item:hover { + -moz-border-radius: 0; + border-radius: 0; border-left:2pt blue solid; } a.list-group-item p.list-group-item-text { + -moz-border-radius: 0; + border-radius: 0; font-size:9pt; font-style:italic; + font-weight: normal; + color: black !important; +} + +span.sl-resources { + font-size:9pt; + color:gray; +} +a.sl-resources, a.sl-resources:hover { + font-size:9pt; + border:0; + padding:2px 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +a.sl-resources.active, a.sl-resources.active:hover, a.sl-resources.active:focus { + border:0; + -moz-border-radius: 4px; + border-radius: 4px; +} + +div#slice-info { + margin-top:25px; +} +div#slice-info table { + width:100%; + margin:0 auto; +} +div#slice-info table td:first-child { + text-align:right; + font-weight:bold; + padding-right:15px; +} +div#slice-info td { + padding:5px; } /* SLICE VIEW sections */ @@ -418,3 +457,240 @@ a.list-group-item p.list-group-item-text { } .slice-pending button.clear { } +tr.active, tr.active td { + background-color:#FFFFCC !important; +} +div.dataTables_filter label{ + float:left; + width:400px; +} + +/* HEADER */ + + +.header { + -moz-box-shadow: 0 0 1px rgba(82,82,82,0.6); + -webkit-box-shadow: 0 0 1px rgba(82,82,82,0.6); + box-shadow: 0 0 1px rgba(82,82,82,0.6); + height:61px; + background-color:white; + margin-bottom: 35px; +} + +div.navigation { + +} +div.navigation ul { + margin:26px 0 0 0; + padding:0; + display: inline-block; + list-style-type: none; + white-space: nowrap; +} + +div.navigation li { + color:#0C0047; + font-family:open_sansbold, sans-serif; + font-size:9pt; + font-weight:normal; + line-height:0.8em; + letter-spacing:0.4pt; + list-style:none; + float:left; + padding:0 15px; + margin:0; + text-transform:uppercase; +} +div.navigation li:hover { +} +div.navigation li a { + color:#0C0047; +} +div.navigation li a:hover, div.navigation li a.current { + color:#760073; + text-decoration:none; +} + +div.navigation li:last-child { + margin-right:0; +} + + +div.navigation .dropdown-menu { + color:black; + -moz-box-shadow: 1px 1px 0px 0 rgba(58, 48, 100,0.8); + -webkit-box-shadow: 1px 1px 0px 0 rgba(58, 48, 100,0.8); + box-shadow: 1px 1px 0px 0 rgba(58, 48, 100,0.8); + border-radius:2px; + padding:0 5px 5px 5px; + margin-top:5px; + margin-left:20px; +} +div.navigation .dropdown-menu ul { + margin:0; + padding:15px 5px 5px 5px; + display:list-item; +} +div.navigation .dropdown-menu li { + margin:0 10px 0 0; + padding:0 0 8px 0; + display:list-item; + float:none; + text-transform: none; +} + +div.navigation .dropdown-menu a { + font-family:Helvetica,sans-serif; + font-size:10pt; + color:black; +} +div.navigation .dropdown-menu li.title { + margin-bottom:10px; +} +div.navigation .dropdown-menu li.title a { + font-family:open_sansbold, sans-serif; +} + + +div.navigation .dropdown-menu li:first-child { + border-bottom:1px solid white; + padding-bottom:5px; + +} + +div.secondary { + text-align:right; +} + +div.secondary ul { + margin:6px 0 0 0; + padding:0; +} + +div.secondary li { + font-size:9pt; + display:inline; + list-style:none; + margin:0px; + padding:0; + margin-right:15px; + color:#747474; + letter-spacing:0.4px; +} +div.secondary li:last-child { + margin-right:0; +} +div.secondary li a { + color:#747474; +} +div.secondary li a:hover { + text-decoration:none; +} +div.secondary .button { + width:300px; + margin-top:15px; +} +div.secondary .account { + margin-top:10px; + padding:0; + font-size:9pt; + color:gray; + text-align:right; +} +div.secondary .account span { + font-size:8pt; +} +div.secondary .account a { + color:black; +} +div.home { + font-size:11pt; + line-height:1.2em; + letter-spacing:0.3pt; + min-height:500px; + background-image: url('../img/optical_fibre.jpg'); + background-repeat:no-repeat; + background-size:cover; + background-position:center top; + background-color:#013ADF; + padding:100px 0; +} +div.home h2 { + color:white; + line-height:1.2em; + font-size:18pt; +} +div.home h3 { + color:white; + line-height:1.4em; +} +div.dashboard { + text-align:center; +} +div.dashboard div { + margin:25px 0; +} +div.dashboard ul { + text-align:left; + margin-left:24px; + list-style:none; +} +div.registration-form { + padding-top:150px; + text-align:center; +} + +.login-form input { + width:320px; +} +.login-form input[type=submit] { + width:108px; +} + +.login-submit { + vertical-align:middle; + padding:0; +} +.lost-password { + font-size:10pt; + color:black; + text-align:right; + padding:0px; +} +.lost-password a { + color:white; + text-shadow:0.5px 0.5px black; +} +.login-signup { + font-size:12pt; + color:white; + text-shadow:0.5px 0.5px black; + margin-top:45px; + padding:5px 0 0 4px; + +} +.login-signup a { + color:white; + text-shadow:0.5px 0.5px black; + padding-bottom:2px; + border-bottom:2pt solid white; +} +.login-signup a:hover { + text-decoration:none; +} +.login-signup button { + padding:8px; + border:0; + border-bottom:2px solid #540086; + background-color:#302562; + color:white; + width:100px; + border-radius:5px; + font-size:12pt; +} +div.slogan { + text-align:center; + color:white; + padding-top:60px; + text-shadow: 1px 1px #013540; +} diff --git a/portal/static/img/optical_fibre.jpg b/portal/static/img/optical_fibre.jpg new file mode 100644 index 00000000..a62eb25f Binary files /dev/null and b/portal/static/img/optical_fibre.jpg differ diff --git a/portal/static/js/jquery.qtip.min.js b/portal/static/js/jquery.qtip.min.js index 3ae7bbe3..dc74d29d 100644 --- a/portal/static/js/jquery.qtip.min.js +++ b/portal/static/js/jquery.qtip.min.js @@ -1,4 +1,4 @@ /* qTip2 v2.2.0 tips modal viewport svg imagemap ie6 | qtip2.com | Licensed MIT, GPL | Thu Nov 21 2013 20:34:59 */ (function(t,e,i){(function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):jQuery&&!jQuery.fn.qtip&&t(jQuery)})(function(s){"use strict";function o(t,e,i,o){this.id=i,this.target=t,this.tooltip=E,this.elements={target:t},this._id=X+"-"+i,this.timers={img:{}},this.options=e,this.plugins={},this.cache={event:{},target:s(),disabled:k,attr:o,onTooltip:k,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=k}function n(t){return t===E||"object"!==s.type(t)}function r(t){return!(s.isFunction(t)||t&&t.attr||t.length||"object"===s.type(t)&&(t.jquery||t.then))}function a(t){var e,i,o,a;return n(t)?k:(n(t.metadata)&&(t.metadata={type:t.metadata}),"content"in t&&(e=t.content,n(e)||e.jquery||e.done?e=t.content={text:i=r(e)?k:e}:i=e.text,"ajax"in e&&(o=e.ajax,a=o&&o.once!==k,delete e.ajax,e.text=function(t,e){var n=i||s(this).attr(e.options.content.attr)||"Loading...",r=s.ajax(s.extend({},o,{context:e})).then(o.success,E,o.error).then(function(t){return t&&a&&e.set("content.text",t),t},function(t,i,s){e.destroyed||0===t.status||e.set("content.text",i+": "+s)});return a?n:(e.set("content.text",n),r)}),"title"in e&&(n(e.title)||(e.button=e.title.button,e.title=e.title.text),r(e.title||k)&&(e.title=k))),"position"in t&&n(t.position)&&(t.position={my:t.position,at:t.position}),"show"in t&&n(t.show)&&(t.show=t.show.jquery?{target:t.show}:t.show===W?{ready:W}:{event:t.show}),"hide"in t&&n(t.hide)&&(t.hide=t.hide.jquery?{target:t.hide}:{event:t.hide}),"style"in t&&n(t.style)&&(t.style={classes:t.style}),s.each(R,function(){this.sanitize&&this.sanitize(t)}),t)}function h(t,e){for(var i,s=0,o=t,n=e.split(".");o=o[n[s++]];)n.length>s&&(i=o);return[i||t,n.pop()]}function l(t,e){var i,s,o;for(i in this.checks)for(s in this.checks[i])(o=RegExp(s,"i").exec(t))&&(e.push(o),("builtin"===i||this.plugins[i])&&this.checks[i][s].apply(this.plugins[i]||this,e))}function c(t){return G.concat("").join(t?"-"+t+" ":" ")}function d(i){return i&&{type:i.type,pageX:i.pageX,pageY:i.pageY,target:i.target,relatedTarget:i.relatedTarget,scrollX:i.scrollX||t.pageXOffset||e.body.scrollLeft||e.documentElement.scrollLeft,scrollY:i.scrollY||t.pageYOffset||e.body.scrollTop||e.documentElement.scrollTop}||{}}function p(t,e){return e>0?setTimeout(s.proxy(t,this),e):(t.call(this),i)}function u(t){return this.tooltip.hasClass(ee)?k:(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=p.call(this,function(){this.toggle(W,t)},this.options.show.delay),i)}function f(t){if(this.tooltip.hasClass(ee))return k;var e=s(t.relatedTarget),i=e.closest(U)[0]===this.tooltip[0],o=e[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==e[0]&&"mouse"===this.options.position.target&&i||this.options.hide.fixed&&/mouse(out|leave|move)/.test(t.type)&&(i||o))try{t.preventDefault(),t.stopImmediatePropagation()}catch(n){}else this.timers.hide=p.call(this,function(){this.toggle(k,t)},this.options.hide.delay,this)}function g(t){return this.tooltip.hasClass(ee)||!this.options.hide.inactive?k:(clearTimeout(this.timers.inactive),this.timers.inactive=p.call(this,function(){this.hide(t)},this.options.hide.inactive),i)}function m(t){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(t)}function v(t,i,o){s(e.body).delegate(t,(i.split?i:i.join(he+" "))+he,function(){var t=T.api[s.attr(this,H)];t&&!t.disabled&&o.apply(t,arguments)})}function y(t,i,n){var r,h,l,c,d,p=s(e.body),u=t[0]===e?p:t,f=t.metadata?t.metadata(n.metadata):E,g="html5"===n.metadata.type&&f?f[n.metadata.name]:E,m=t.data(n.metadata.name||"qtipopts");try{m="string"==typeof m?s.parseJSON(m):m}catch(v){}if(c=s.extend(W,{},T.defaults,n,"object"==typeof m?a(m):E,a(g||f)),h=c.position,c.id=i,"boolean"==typeof c.content.text){if(l=t.attr(c.content.attr),c.content.attr===k||!l)return k;c.content.text=l}if(h.container.length||(h.container=p),h.target===k&&(h.target=u),c.show.target===k&&(c.show.target=u),c.show.solo===W&&(c.show.solo=h.container.closest("body")),c.hide.target===k&&(c.hide.target=u),c.position.viewport===W&&(c.position.viewport=h.container),h.container=h.container.eq(0),h.at=new z(h.at,W),h.my=new z(h.my),t.data(X))if(c.overwrite)t.qtip("destroy",!0);else if(c.overwrite===k)return k;return t.attr(Y,i),c.suppress&&(d=t.attr("title"))&&t.removeAttr("title").attr(se,d).attr("title",""),r=new o(t,c,i,!!l),t.data(X,r),t.one("remove.qtip-"+i+" removeqtip.qtip-"+i,function(){var t;(t=s(this).data(X))&&t.destroy(!0)}),r}function b(t){return t.charAt(0).toUpperCase()+t.slice(1)}function w(t,e){var s,o,n=e.charAt(0).toUpperCase()+e.slice(1),r=(e+" "+be.join(n+" ")+n).split(" "),a=0;if(ye[e])return t.css(ye[e]);for(;s=r[a++];)if((o=t.css(s))!==i)return ye[e]=s,o}function _(t,e){return Math.ceil(parseFloat(w(t,e)))}function x(t,e){this._ns="tip",this.options=e,this.offset=e.offset,this.size=[e.width,e.height],this.init(this.qtip=t)}function q(t,e){this.options=e,this._ns="-modal",this.init(this.qtip=t)}function C(t){this._ns="ie6",this.init(this.qtip=t)}var T,j,z,M,I,W=!0,k=!1,E=null,S="x",L="y",A="width",B="height",D="top",F="left",O="bottom",P="right",N="center",$="flipinvert",V="shift",R={},X="qtip",Y="data-hasqtip",H="data-qtip-id",G=["ui-widget","ui-tooltip"],U="."+X,Q="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),J=X+"-fixed",K=X+"-default",Z=X+"-focus",te=X+"-hover",ee=X+"-disabled",ie="_replacedByqTip",se="oldtitle",oe={ie:function(){for(var t=3,i=e.createElement("div");(i.innerHTML="")&&i.getElementsByTagName("i")[0];);return t>4?t:0/0}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||k};j=o.prototype,j._when=function(t){return s.when.apply(s,t)},j.render=function(t){if(this.rendered||this.destroyed)return this;var e,i=this,o=this.options,n=this.cache,r=this.elements,a=o.content.text,h=o.content.title,l=o.content.button,c=o.position,d=("."+this._id+" ",[]);return s.attr(this.target[0],"aria-describedby",this._id),this.tooltip=r.tooltip=e=s("
",{id:this._id,"class":[X,K,o.style.classes,X+"-pos-"+o.position.my.abbrev()].join(" "),width:o.style.width||"",height:o.style.height||"",tracking:"mouse"===c.target&&c.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":k,"aria-describedby":this._id+"-content","aria-hidden":W}).toggleClass(ee,this.disabled).attr(H,this.id).data(X,this).appendTo(c.container).append(r.content=s("
",{"class":X+"-content",id:this._id+"-content","aria-atomic":W})),this.rendered=-1,this.positioning=W,h&&(this._createTitle(),s.isFunction(h)||d.push(this._updateTitle(h,k))),l&&this._createButton(),s.isFunction(a)||d.push(this._updateContent(a,k)),this.rendered=W,this._setWidget(),s.each(R,function(t){var e;"render"===this.initialize&&(e=this(i))&&(i.plugins[t]=e)}),this._unassignEvents(),this._assignEvents(),this._when(d).then(function(){i._trigger("render"),i.positioning=k,i.hiddenDuringWait||!o.show.ready&&!t||i.toggle(W,n.event,k),i.hiddenDuringWait=k}),T.api[this.id]=this,this},j.destroy=function(t){function e(){if(!this.destroyed){this.destroyed=W;var t=this.target,e=t.attr(se);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),s.each(this.plugins,function(){this.destroy&&this.destroy()}),clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this._unassignEvents(),t.removeData(X).removeAttr(H).removeAttr(Y).removeAttr("aria-describedby"),this.options.suppress&&e&&t.attr("title",e).removeAttr(se),this._unbind(t),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=E,delete T.api[this.id]}}return this.destroyed?this.target:(t===W&&"hide"!==this.triggering||!this.rendered?e.call(this):(this.tooltip.one("tooltiphidden",s.proxy(e,this)),!this.triggering&&this.hide()),this.target)},M=j.checks={builtin:{"^id$":function(t,e,i,o){var n=i===W?T.nextid:i,r=X+"-"+n;n!==k&&n.length>0&&!s("#"+r).length?(this._id=r,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):t[e]=o},"^prerender":function(t,e,i){i&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(t,e,i){this._updateContent(i)},"^content.attr$":function(t,e,i,s){this.options.content.text===this.target.attr(s)&&this._updateContent(this.target.attr(i))},"^content.title$":function(t,e,s){return s?(s&&!this.elements.title&&this._createTitle(),this._updateTitle(s),i):this._removeTitle()},"^content.button$":function(t,e,i){this._updateButton(i)},"^content.title.(text|button)$":function(t,e,i){this.set("content."+e,i)},"^position.(my|at)$":function(t,e,i){"string"==typeof i&&(t[e]=new z(i,"at"===e))},"^position.container$":function(t,e,i){this.rendered&&this.tooltip.appendTo(i)},"^show.ready$":function(t,e,i){i&&(!this.rendered&&this.render(W)||this.toggle(W))},"^style.classes$":function(t,e,i,s){this.rendered&&this.tooltip.removeClass(s).addClass(i)},"^style.(width|height)":function(t,e,i){this.rendered&&this.tooltip.css(e,i)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(t,e,i){this.rendered&&this.tooltip.toggleClass(K,!!i)},"^events.(render|show|move|hide|focus|blur)$":function(t,e,i){this.rendered&&this.tooltip[(s.isFunction(i)?"":"un")+"bind"]("tooltip"+e,i)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var t=this.options.position;this.tooltip.attr("tracking","mouse"===t.target&&t.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},j.get=function(t){if(this.destroyed)return this;var e=h(this.options,t.toLowerCase()),i=e[0][e[1]];return i.precedance?i.string():i};var ne=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,re=/^prerender|show\.ready/i;j.set=function(t,e){if(this.destroyed)return this;var o,n=this.rendered,r=k,c=this.options;return this.checks,"string"==typeof t?(o=t,t={},t[o]=e):t=s.extend({},t),s.each(t,function(e,o){if(n&&re.test(e))return delete t[e],i;var a,l=h(c,e.toLowerCase());a=l[0][l[1]],l[0][l[1]]=o&&o.nodeType?s(o):o,r=ne.test(e)||r,t[e]=[l[0],l[1],o,a]}),a(c),this.positioning=W,s.each(t,s.proxy(l,this)),this.positioning=k,this.rendered&&this.tooltip[0].offsetWidth>0&&r&&this.reposition("mouse"===c.position.target?E:this.cache.event),this},j._update=function(t,e){var i=this,o=this.cache;return this.rendered&&t?(s.isFunction(t)&&(t=t.call(this.elements.target,o.event,this)||""),s.isFunction(t.then)?(o.waiting=W,t.then(function(t){return o.waiting=k,i._update(t,e)},E,function(t){return i._update(t,e)})):t===k||!t&&""!==t?k:(t.jquery&&t.length>0?e.empty().append(t.css({display:"block",visibility:"visible"})):e.html(t),this._waitForContent(e).then(function(t){t.images&&t.images.length&&i.rendered&&i.tooltip[0].offsetWidth>0&&i.reposition(o.event,!t.length)}))):k},j._waitForContent=function(t){var e=this.cache;return e.waiting=W,(s.fn.imagesLoaded?t.imagesLoaded():s.Deferred().resolve([])).done(function(){e.waiting=k}).promise()},j._updateContent=function(t,e){this._update(t,this.elements.content,e)},j._updateTitle=function(t,e){this._update(t,this.elements.title,e)===k&&this._removeTitle(k)},j._createTitle=function(){var t=this.elements,e=this._id+"-title";t.titlebar&&this._removeTitle(),t.titlebar=s("
",{"class":X+"-titlebar "+(this.options.style.widget?c("header"):"")}).append(t.title=s("
",{id:e,"class":X+"-title","aria-atomic":W})).insertBefore(t.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(t){s(this).toggleClass("ui-state-active ui-state-focus","down"===t.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(t){s(this).toggleClass("ui-state-hover","mouseover"===t.type)}),this.options.content.button&&this._createButton()},j._removeTitle=function(t){var e=this.elements;e.title&&(e.titlebar.remove(),e.titlebar=e.title=e.button=E,t!==k&&this.reposition())},j.reposition=function(i,o){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=W;var n,r,a=this.cache,h=this.tooltip,l=this.options.position,c=l.target,d=l.my,p=l.at,u=l.viewport,f=l.container,g=l.adjust,m=g.method.split(" "),v=h.outerWidth(k),y=h.outerHeight(k),b=0,w=0,_=h.css("position"),x={left:0,top:0},q=h[0].offsetWidth>0,C=i&&"scroll"===i.type,T=s(t),j=f[0].ownerDocument,z=this.mouse;if(s.isArray(c)&&2===c.length)p={x:F,y:D},x={left:c[0],top:c[1]};else if("mouse"===c)p={x:F,y:D},!z||!z.pageX||!g.mouse&&i&&i.pageX?i&&i.pageX||((!g.mouse||this.options.show.distance)&&a.origin&&a.origin.pageX?i=a.origin:(!i||i&&("resize"===i.type||"scroll"===i.type))&&(i=a.event)):i=z,"static"!==_&&(x=f.offset()),j.body.offsetWidth!==(t.innerWidth||j.documentElement.clientWidth)&&(r=s(e.body).offset()),x={left:i.pageX-x.left+(r&&r.left||0),top:i.pageY-x.top+(r&&r.top||0)},g.mouse&&C&&z&&(x.left-=(z.scrollX||0)-T.scrollLeft(),x.top-=(z.scrollY||0)-T.scrollTop());else{if("event"===c?i&&i.target&&"scroll"!==i.type&&"resize"!==i.type?a.target=s(i.target):i.target||(a.target=this.elements.target):"event"!==c&&(a.target=s(c.jquery?c:this.elements.target)),c=a.target,c=s(c).eq(0),0===c.length)return this;c[0]===e||c[0]===t?(b=oe.iOS?t.innerWidth:c.width(),w=oe.iOS?t.innerHeight:c.height(),c[0]===t&&(x={top:(u||c).scrollTop(),left:(u||c).scrollLeft()})):R.imagemap&&c.is("area")?n=R.imagemap(this,c,p,R.viewport?m:k):R.svg&&c&&c[0].ownerSVGElement?n=R.svg(this,c,p,R.viewport?m:k):(b=c.outerWidth(k),w=c.outerHeight(k),x=c.offset()),n&&(b=n.width,w=n.height,r=n.offset,x=n.position),x=this.reposition.offset(c,x,f),(oe.iOS>3.1&&4.1>oe.iOS||oe.iOS>=4.3&&4.33>oe.iOS||!oe.iOS&&"fixed"===_)&&(x.left-=T.scrollLeft(),x.top-=T.scrollTop()),(!n||n&&n.adjustable!==k)&&(x.left+=p.x===P?b:p.x===N?b/2:0,x.top+=p.y===O?w:p.y===N?w/2:0)}return x.left+=g.x+(d.x===P?-v:d.x===N?-v/2:0),x.top+=g.y+(d.y===O?-y:d.y===N?-y/2:0),R.viewport?(x.adjusted=R.viewport(this,x,l,b,w,v,y),r&&x.adjusted.left&&(x.left+=r.left),r&&x.adjusted.top&&(x.top+=r.top)):x.adjusted={left:0,top:0},this._trigger("move",[x,u.elem||u],i)?(delete x.adjusted,o===k||!q||isNaN(x.left)||isNaN(x.top)||"mouse"===c||!s.isFunction(l.effect)?h.css(x):s.isFunction(l.effect)&&(l.effect.call(h,this,s.extend({},x)),h.queue(function(t){s(this).css({opacity:"",height:""}),oe.ie&&this.style.removeAttribute("filter"),t()})),this.positioning=k,this):this},j.reposition.offset=function(t,i,o){function n(t,e){i.left+=e*t.scrollLeft(),i.top+=e*t.scrollTop()}if(!o[0])return i;var r,a,h,l,c=s(t[0].ownerDocument),d=!!oe.ie&&"CSS1Compat"!==e.compatMode,p=o[0];do"static"!==(a=s.css(p,"position"))&&("fixed"===a?(h=p.getBoundingClientRect(),n(c,-1)):(h=s(p).position(),h.left+=parseFloat(s.css(p,"borderLeftWidth"))||0,h.top+=parseFloat(s.css(p,"borderTopWidth"))||0),i.left-=h.left+(parseFloat(s.css(p,"marginLeft"))||0),i.top-=h.top+(parseFloat(s.css(p,"marginTop"))||0),r||"hidden"===(l=s.css(p,"overflow"))||"visible"===l||(r=s(p)));while(p=p.offsetParent);return r&&(r[0]!==c[0]||d)&&n(r,1),i};var ae=(z=j.reposition.Corner=function(t,e){t=(""+t).replace(/([A-Z])/," $1").replace(/middle/gi,N).toLowerCase(),this.x=(t.match(/left|right/i)||t.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(t.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!e;var i=t.charAt(0);this.precedance="t"===i||"b"===i?L:S}).prototype;ae.invert=function(t,e){this[t]=this[t]===F?P:this[t]===P?F:e||this[t]},ae.string=function(){var t=this.x,e=this.y;return t===e?t:this.precedance===L||this.forceY&&"center"!==e?e+" "+t:t+" "+e},ae.abbrev=function(){var t=this.string().split(" ");return t[0].charAt(0)+(t[1]&&t[1].charAt(0)||"")},ae.clone=function(){return new z(this.string(),this.forceY)},j.toggle=function(t,i){var o=this.cache,n=this.options,r=this.tooltip;if(i){if(/over|enter/.test(i.type)&&/out|leave/.test(o.event.type)&&n.show.target.add(i.target).length===n.show.target.length&&r.has(i.relatedTarget).length)return this;o.event=d(i)}if(this.waiting&&!t&&(this.hiddenDuringWait=W),!this.rendered)return t?this.render(1):this;if(this.destroyed||this.disabled)return this;var a,h,l,c=t?"show":"hide",p=this.options[c],u=(this.options[t?"hide":"show"],this.options.position),f=this.options.content,g=this.tooltip.css("width"),m=this.tooltip.is(":visible"),v=t||1===p.target.length,y=!i||2>p.target.length||o.target[0]===i.target;return(typeof t).search("boolean|number")&&(t=!m),a=!r.is(":animated")&&m===t&&y,h=a?E:!!this._trigger(c,[90]),this.destroyed?this:(h!==k&&t&&this.focus(i),!h||a?this:(s.attr(r[0],"aria-hidden",!t),t?(o.origin=d(this.mouse),s.isFunction(f.text)&&this._updateContent(f.text,k),s.isFunction(f.title)&&this._updateTitle(f.title,k),!I&&"mouse"===u.target&&u.adjust.mouse&&(s(e).bind("mousemove."+X,this._storeMouse),I=W),g||r.css("width",r.outerWidth(k)),this.reposition(i,arguments[2]),g||r.css("width",""),p.solo&&("string"==typeof p.solo?s(p.solo):s(U,p.solo)).not(r).not(p.target).qtip("hide",s.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete o.origin,I&&!s(U+'[tracking="true"]:visible',p.solo).not(r).length&&(s(e).unbind("mousemove."+X),I=k),this.blur(i)),l=s.proxy(function(){t?(oe.ie&&r[0].style.removeAttribute("filter"),r.css("overflow",""),"string"==typeof p.autofocus&&s(this.options.show.autofocus,r).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):r.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(t?"visible":"hidden")},this),p.effect===k||v===k?(r[c](),l()):s.isFunction(p.effect)?(r.stop(1,1),p.effect.call(r,this),r.queue("fx",function(t){l(),t()})):r.fadeTo(90,t?1:0,l),t&&p.target.trigger("qtip-"+this.id+"-inactive"),this))},j.show=function(t){return this.toggle(W,t)},j.hide=function(t){return this.toggle(k,t)},j.focus=function(t){if(!this.rendered||this.destroyed)return this;var e=s(U),i=this.tooltip,o=parseInt(i[0].style.zIndex,10),n=T.zindex+e.length;return i.hasClass(Z)||this._trigger("focus",[n],t)&&(o!==n&&(e.each(function(){this.style.zIndex>o&&(this.style.zIndex=this.style.zIndex-1)}),e.filter("."+Z).qtip("blur",t)),i.addClass(Z)[0].style.zIndex=n),this},j.blur=function(t){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(Z),this._trigger("blur",[this.tooltip.css("zIndex")],t),this)},j.disable=function(t){return this.destroyed?this:("toggle"===t?t=!(this.rendered?this.tooltip.hasClass(ee):this.disabled):"boolean"!=typeof t&&(t=W),this.rendered&&this.tooltip.toggleClass(ee,t).attr("aria-disabled",t),this.disabled=!!t,this)},j.enable=function(){return this.disable(k)},j._createButton=function(){var t=this,e=this.elements,i=e.tooltip,o=this.options.content.button,n="string"==typeof o,r=n?o:"Close tooltip";e.button&&e.button.remove(),e.button=o.jquery?o:s("",{"class":"qtip-close "+(this.options.style.widget?"":X+"-icon"),title:r,"aria-label":r}).prepend(s("",{"class":"ui-icon ui-icon-close",html:"×"})),e.button.appendTo(e.titlebar||i).attr("role","button").click(function(e){return i.hasClass(ee)||t.hide(e),k})},j._updateButton=function(t){if(!this.rendered)return k;var e=this.elements.button;t?this._createButton():e.remove()},j._setWidget=function(){var t=this.options.style.widget,e=this.elements,i=e.tooltip,s=i.hasClass(ee);i.removeClass(ee),ee=t?"ui-state-disabled":"qtip-disabled",i.toggleClass(ee,s),i.toggleClass("ui-helper-reset "+c(),t).toggleClass(K,this.options.style.def&&!t),e.content&&e.content.toggleClass(c("content"),t),e.titlebar&&e.titlebar.toggleClass(c("header"),t),e.button&&e.button.toggleClass(X+"-icon",!t)},j._storeMouse=function(t){(this.mouse=d(t)).type="mousemove"},j._bind=function(t,e,i,o,n){var r="."+this._id+(o?"-"+o:"");e.length&&s(t).bind((e.split?e:e.join(r+" "))+r,s.proxy(i,n||this))},j._unbind=function(t,e){s(t).unbind("."+this._id+(e?"-"+e:""))};var he="."+X;s(function(){v(U,["mouseenter","mouseleave"],function(t){var e="mouseenter"===t.type,i=s(t.currentTarget),o=s(t.relatedTarget||t.target),n=this.options;e?(this.focus(t),i.hasClass(J)&&!i.hasClass(ee)&&clearTimeout(this.timers.hide)):"mouse"===n.position.target&&n.hide.event&&n.show.target&&!o.closest(n.show.target[0]).length&&this.hide(t),i.toggleClass(te,e)}),v("["+H+"]",Q,g)}),j._trigger=function(t,e,i){var o=s.Event("tooltip"+t);return o.originalEvent=i&&s.extend({},i)||this.cache.event||E,this.triggering=t,this.tooltip.trigger(o,[this].concat(e||[])),this.triggering=k,!o.isDefaultPrevented()},j._bindEvents=function(t,e,o,n,r,a){if(n.add(o).length===n.length){var h=[];e=s.map(e,function(e){var o=s.inArray(e,t);return o>-1?(h.push(t.splice(o,1)[0]),i):e}),h.length&&this._bind(o,h,function(t){var e=this.rendered?this.tooltip[0].offsetWidth>0:!1;(e?a:r).call(this,t)})}this._bind(o,t,r),this._bind(n,e,a)},j._assignInitialEvents=function(t){function e(t){return this.disabled||this.destroyed?k:(this.cache.event=d(t),this.cache.target=t?s(t.target):[i],clearTimeout(this.timers.show),this.timers.show=p.call(this,function(){this.render("object"==typeof t||o.show.ready)},o.show.delay),i)}var o=this.options,n=o.show.target,r=o.hide.target,a=o.show.event?s.trim(""+o.show.event).split(" "):[],h=o.hide.event?s.trim(""+o.hide.event).split(" "):[];/mouse(over|enter)/i.test(o.show.event)&&!/mouse(out|leave)/i.test(o.hide.event)&&h.push("mouseleave"),this._bind(n,"mousemove",function(t){this._storeMouse(t),this.cache.onTarget=W}),this._bindEvents(a,h,n,r,e,function(){clearTimeout(this.timers.show)}),(o.show.ready||o.prerender)&&e.call(this,t)},j._assignEvents=function(){var i=this,o=this.options,n=o.position,r=this.tooltip,a=o.show.target,h=o.hide.target,l=n.container,c=n.viewport,d=s(e),p=(s(e.body),s(t)),v=o.show.event?s.trim(""+o.show.event).split(" "):[],y=o.hide.event?s.trim(""+o.hide.event).split(" "):[];s.each(o.events,function(t,e){i._bind(r,"toggle"===t?["tooltipshow","tooltiphide"]:["tooltip"+t],e,null,r)}),/mouse(out|leave)/i.test(o.hide.event)&&"window"===o.hide.leave&&this._bind(d,["mouseout","blur"],function(t){/select|option/.test(t.target.nodeName)||t.relatedTarget||this.hide(t)}),o.hide.fixed?h=h.add(r.addClass(J)):/mouse(over|enter)/i.test(o.show.event)&&this._bind(h,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+o.hide.event).indexOf("unfocus")>-1&&this._bind(l.closest("html"),["mousedown","touchstart"],function(t){var e=s(t.target),i=this.rendered&&!this.tooltip.hasClass(ee)&&this.tooltip[0].offsetWidth>0,o=e.parents(U).filter(this.tooltip[0]).length>0;e[0]===this.target[0]||e[0]===this.tooltip[0]||o||this.target.has(e[0]).length||!i||this.hide(t)}),"number"==typeof o.hide.inactive&&(this._bind(a,"qtip-"+this.id+"-inactive",g),this._bind(h.add(r),T.inactiveEvents,g,"-inactive")),this._bindEvents(v,y,a,h,u,f),this._bind(a.add(r),"mousemove",function(t){if("number"==typeof o.hide.distance){var e=this.cache.origin||{},i=this.options.hide.distance,s=Math.abs;(s(t.pageX-e.pageX)>=i||s(t.pageY-e.pageY)>=i)&&this.hide(t)}this._storeMouse(t)}),"mouse"===n.target&&n.adjust.mouse&&(o.hide.event&&this._bind(a,["mouseenter","mouseleave"],function(t){this.cache.onTarget="mouseenter"===t.type}),this._bind(d,"mousemove",function(t){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(ee)&&this.tooltip[0].offsetWidth>0&&this.reposition(t)})),(n.adjust.resize||c.length)&&this._bind(s.event.special.resize?c:p,"resize",m),n.adjust.scroll&&this._bind(p.add(n.container),"scroll",m)},j._unassignEvents=function(){var i=[this.options.show.target[0],this.options.hide.target[0],this.rendered&&this.tooltip[0],this.options.position.container[0],this.options.position.viewport[0],this.options.position.container.closest("html")[0],t,e];this._unbind(s([]).pushStack(s.grep(i,function(t){return"object"==typeof t})))},T=s.fn.qtip=function(t,e,o){var n=(""+t).toLowerCase(),r=E,h=s.makeArray(arguments).slice(1),l=h[h.length-1],c=this[0]?s.data(this[0],X):E;return!arguments.length&&c||"api"===n?c:"string"==typeof t?(this.each(function(){var t=s.data(this,X);if(!t)return W;if(l&&l.timeStamp&&(t.cache.event=l),!e||"option"!==n&&"options"!==n)t[n]&&t[n].apply(t,h);else{if(o===i&&!s.isPlainObject(e))return r=t.get(e),k;t.set(e,o)}}),r!==E?r:this):"object"!=typeof t&&arguments.length?i:(c=a(s.extend(W,{},t)),this.each(function(t){var e,o;return o=s.isArray(c.id)?c.id[t]:c.id,o=!o||o===k||1>o.length||T.api[o]?T.nextid++:o,e=y(s(this),o,c),e===k?W:(T.api[o]=e,s.each(R,function(){"initialize"===this.initialize&&this(e)}),e._assignInitialEvents(l),i)}))},s.qtip=o,T.api={},s.each({attr:function(t,e){if(this.length){var i=this[0],o="title",n=s.data(i,"qtip");if(t===o&&n&&"object"==typeof n&&n.options.suppress)return 2>arguments.length?s.attr(i,se):(n&&n.options.content.attr===o&&n.cache.attr&&n.set("content.text",e),this.attr(se,e))}return s.fn["attr"+ie].apply(this,arguments)},clone:function(t){var e=(s([]),s.fn["clone"+ie].apply(this,arguments));return t||e.filter("["+se+"]").attr("title",function(){return s.attr(this,se)}).removeAttr(se),e}},function(t,e){if(!e||s.fn[t+ie])return W;var i=s.fn[t+ie]=s.fn[t];s.fn[t]=function(){return e.apply(this,arguments)||i.apply(this,arguments)}}),s.ui||(s["cleanData"+ie]=s.cleanData,s.cleanData=function(t){for(var e,i=0;(e=s(t[i])).length;i++)if(e.attr(Y))try{e.triggerHandler("removeqtip")}catch(o){}s["cleanData"+ie].apply(this,arguments)}),T.version="2.2.0",T.nextid=0,T.inactiveEvents=Q,T.zindex=15e3,T.defaults={prerender:k,id:k,overwrite:W,suppress:W,content:{text:W,attr:"title",title:k,button:k},position:{my:"top left",at:"bottom right",target:k,container:k,viewport:k,adjust:{x:0,y:0,mouse:W,scroll:W,resize:W,method:"flipinvert flipinvert"},effect:function(t,e){s(this).animate(e,{duration:200,queue:k})}},show:{target:k,event:"mouseenter",effect:W,delay:90,solo:k,ready:k,autofocus:k},hide:{target:k,event:"mouseleave",effect:W,delay:0,fixed:k,inactive:k,leave:"window",distance:k},style:{classes:"",widget:k,width:k,height:k,def:W},events:{render:E,move:E,show:E,hide:E,toggle:E,visible:E,hidden:E,focus:E,blur:E}};var le,ce="margin",de="border",pe="color",ue="background-color",fe="transparent",ge=" !important",me=!!e.createElement("canvas").getContext,ve=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,ye={},be=["Webkit","O","Moz","ms"];if(me)var we=t.devicePixelRatio||1,_e=function(){var t=e.createElement("canvas").getContext("2d");return t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||1}(),xe=we/_e;else var qe=function(t,e,i){return"'};s.extend(x.prototype,{init:function(t){var e,i;i=this.element=t.elements.tip=s("
",{"class":X+"-tip"}).prependTo(t.tooltip),me?(e=s("").appendTo(this.element)[0].getContext("2d"),e.lineJoin="miter",e.miterLimit=1e5,e.save()):(e=qe("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(e+e),t._bind(s("*",i).add(i),["click","mousedown"],function(t){t.stopPropagation()},this._ns)),t._bind(t.tooltip,"tooltipmove",this.reposition,this._ns,this),this.create()},_swapDimensions:function(){this.size[0]=this.options.height,this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width,this.size[1]=this.options.height},_useTitle:function(t){var e=this.qtip.elements.titlebar;return e&&(t.y===D||t.y===N&&this.element.position().top+this.size[1]/2+this.options.offsetoe.ie?0:_(this._useTitle(t)&&e.titlebar||e.content,i)||_(e.tooltip,i)||0},_invalidColour:function(t,e,i){var s=t.css(e);return!s||i&&s===t.css(i)||ve.test(s)?k:s},_parseColours:function(t){var e=this.qtip.elements,i=this.element.css("cssText",""),o=de+b(t[t.precedance])+b(pe),n=this._useTitle(t)&&e.titlebar||e.content,r=this._invalidColour,a=[];return a[0]=r(i,ue)||r(n,ue)||r(e.content,ue)||r(e.tooltip,ue)||i.css(ue),a[1]=r(i,o,pe)||r(n,o,pe)||r(e.content,o,pe)||r(e.tooltip,o,pe)||e.tooltip.css(o),s("*",i).add(i).css("cssText",ue+":"+fe+ge+";"+de+":0"+ge+";"),a},_calculateSize:function(t){var e,i,s,o=t.precedance===L,n=this.options.width,r=this.options.height,a="c"===t.abbrev(),h=(o?n:r)*(a?.5:1),l=Math.pow,c=Math.round,d=Math.sqrt(l(h,2)+l(r,2)),p=[this.border/h*d,this.border/r*d];return p[2]=Math.sqrt(l(p[0],2)-l(this.border,2)),p[3]=Math.sqrt(l(p[1],2)-l(this.border,2)),e=d+p[2]+p[3]+(a?0:p[0]),i=e/d,s=[c(i*n),c(i*r)],o?s:s.reverse()},_calculateTip:function(t,e,i){i=i||1,e=e||this.size;var s=e[0]*i,o=e[1]*i,n=Math.ceil(s/2),r=Math.ceil(o/2),a={br:[0,0,s,o,s,0],bl:[0,0,s,0,0,o],tr:[0,o,s,0,s,o],tl:[0,0,0,o,s,o],tc:[0,o,n,0,s,o],bc:[0,0,s,0,n,o],rc:[0,0,s,r,0,o],lc:[s,0,s,o,0,r]};return a.lt=a.br,a.rt=a.bl,a.lb=a.tr,a.rb=a.tl,a[t.abbrev()]},_drawCoords:function(t,e){t.beginPath(),t.moveTo(e[0],e[1]),t.lineTo(e[2],e[3]),t.lineTo(e[4],e[5]),t.closePath()},create:function(){var t=this.corner=(me||oe.ie)&&this._parseCorner(this.options.corner);return(this.enabled=!!this.corner&&"c"!==this.corner.abbrev())&&(this.qtip.cache.corner=t.clone(),this.update()),this.element.toggle(this.enabled),this.corner},update:function(e,i){if(!this.enabled)return this;var o,n,r,a,h,l,c,d,p=this.qtip.elements,u=this.element,f=u.children(),g=this.options,m=this.size,v=g.mimic,y=Math.round;e||(e=this.qtip.cache.corner||this.corner),v===k?v=e:(v=new z(v),v.precedance=e.precedance,"inherit"===v.x?v.x=e.x:"inherit"===v.y?v.y=e.y:v.x===v.y&&(v[e.precedance]=e[e.precedance])),n=v.precedance,e.precedance===S?this._swapDimensions():this._resetDimensions(),o=this.color=this._parseColours(e),o[1]!==fe?(d=this.border=this._parseWidth(e,e[e.precedance]),g.border&&1>d&&!ve.test(o[1])&&(o[0]=o[1]),this.border=d=g.border!==W?g.border:d):this.border=d=0,c=this.size=this._calculateSize(e),u.css({width:c[0],height:c[1],lineHeight:c[1]+"px"}),l=e.precedance===L?[y(v.x===F?d:v.x===P?c[0]-m[0]-d:(c[0]-m[0])/2),y(v.y===D?c[1]-m[1]:0)]:[y(v.x===F?c[0]-m[0]:0),y(v.y===D?d:v.y===O?c[1]-m[1]-d:(c[1]-m[1])/2)],me?(r=f[0].getContext("2d"),r.restore(),r.save(),r.clearRect(0,0,6e3,6e3),a=this._calculateTip(v,m,xe),h=this._calculateTip(v,this.size,xe),f.attr(A,c[0]*xe).attr(B,c[1]*xe),f.css(A,c[0]).css(B,c[1]),this._drawCoords(r,h),r.fillStyle=o[1],r.fill(),r.translate(l[0]*xe,l[1]*xe),this._drawCoords(r,a),r.fillStyle=o[0],r.fill()):(a=this._calculateTip(v),a="m"+a[0]+","+a[1]+" l"+a[2]+","+a[3]+" "+a[4]+","+a[5]+" xe",l[2]=d&&/^(r|b)/i.test(e.string())?8===oe.ie?2:1:0,f.css({coordsize:c[0]+d+" "+(c[1]+d),antialias:""+(v.string().indexOf(N)>-1),left:l[0]-l[2]*Number(n===S),top:l[1]-l[2]*Number(n===L),width:c[0]+d,height:c[1]+d}).each(function(t){var e=s(this);e[e.prop?"prop":"attr"]({coordsize:c[0]+d+" "+(c[1]+d),path:a,fillcolor:o[0],filled:!!t,stroked:!t}).toggle(!(!d&&!t)),!t&&e.html(qe("stroke",'weight="'+2*d+'px" color="'+o[1]+'" miterlimit="1000" joinstyle="miter"'))})),t.opera&&setTimeout(function(){p.tip.css({display:"inline-block",visibility:"visible"})},1),i!==k&&this.calculate(e,c)},calculate:function(t,e){if(!this.enabled)return k;var i,o,n=this,r=this.qtip.elements,a=this.element,h=this.options.offset,l=(r.tooltip.hasClass("ui-widget"),{});return t=t||this.corner,i=t.precedance,e=e||this._calculateSize(t),o=[t.x,t.y],i===S&&o.reverse(),s.each(o,function(s,o){var a,c,d;o===N?(a=i===L?F:D,l[a]="50%",l[ce+"-"+a]=-Math.round(e[i===L?0:1]/2)+h):(a=n._parseWidth(t,o,r.tooltip),c=n._parseWidth(t,o,r.content),d=n._parseRadius(t),l[o]=Math.max(-n.border,s?c:h+(d>a?d:-a))) }),l[t[i]]-=e[i===S?0:1],a.css({margin:"",top:"",bottom:"",left:"",right:""}).css(l),l},reposition:function(t,e,s){function o(t,e,i,s,o){t===V&&l.precedance===e&&c[s]&&l[i]!==N?l.precedance=l.precedance===S?L:S:t!==V&&c[s]&&(l[e]=l[e]===N?c[s]>0?s:o:l[e]===s?o:s)}function n(t,e,o){l[t]===N?g[ce+"-"+e]=f[t]=r[ce+"-"+e]-c[e]:(a=r[o]!==i?[c[e],-r[e]]:[-c[e],r[e]],(f[t]=Math.max(a[0],a[1]))>a[0]&&(s[e]-=c[e],f[e]=k),g[r[o]!==i?o:e]=f[t])}if(this.enabled){var r,a,h=e.cache,l=this.corner.clone(),c=s.adjusted,d=e.options.position.adjust.method.split(" "),p=d[0],u=d[1]||d[0],f={left:k,top:k,x:0,y:0},g={};this.corner.fixed!==W&&(o(p,S,L,F,P),o(u,L,S,D,O),l.string()===h.corner.string()||h.cornerTop===c.top&&h.cornerLeft===c.left||this.update(l,k)),r=this.calculate(l),r.right!==i&&(r.left=-r.right),r.bottom!==i&&(r.top=-r.bottom),r.user=this.offset,(f.left=p===V&&!!c.left)&&n(S,F,P),(f.top=u===V&&!!c.top)&&n(L,D,O),this.element.css(g).toggle(!(f.x&&f.y||l.x===N&&f.y||l.y===N&&f.x)),s.left-=r.left.charAt?r.user:p!==V||f.top||!f.left&&!f.top?r.left+this.border:0,s.top-=r.top.charAt?r.user:u!==V||f.left||!f.left&&!f.top?r.top+this.border:0,h.cornerLeft=c.left,h.cornerTop=c.top,h.corner=l.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),le=R.tip=function(t){return new x(t,t.options.style.tip)},le.initialize="render",le.sanitize=function(t){if(t.style&&"tip"in t.style){var e=t.style.tip;"object"!=typeof e&&(e=t.style.tip={corner:e}),/string|boolean/i.test(typeof e.corner)||(e.corner=W)}},M.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(t){this.size=[t.width,t.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},s.extend(W,T.defaults,{style:{tip:{corner:W,mimic:k,width:6,height:6,border:W,offset:0}}});var Ce,Te,je="qtip-modal",ze="."+je;Te=function(){function t(t){if(s.expr[":"].focusable)return s.expr[":"].focusable;var e,i,o,n=!isNaN(s.attr(t,"tabindex")),r=t.nodeName&&t.nodeName.toLowerCase();return"area"===r?(e=t.parentNode,i=e.name,t.href&&i&&"map"===e.nodeName.toLowerCase()?(o=s("img[usemap=#"+i+"]")[0],!!o&&o.is(":visible")):!1):/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||n:n}function i(t){1>c.length&&t.length?t.not("body").blur():c.first().focus()}function o(t){if(h.is(":visible")){var e,o=s(t.target),a=n.tooltip,l=o.closest(U);e=1>l.length?k:parseInt(l[0].style.zIndex,10)>parseInt(a[0].style.zIndex,10),e||o.closest(U)[0]===a[0]||i(o),r=t.target===c[c.length-1]}}var n,r,a,h,l=this,c={};s.extend(l,{init:function(){return h=l.elem=s("
",{id:"qtip-overlay",html:"
",mousedown:function(){return k}}).hide(),s(e.body).bind("focusin"+ze,o),s(e).bind("keydown"+ze,function(t){n&&n.options.show.modal.escape&&27===t.keyCode&&n.hide(t)}),h.bind("click"+ze,function(t){n&&n.options.show.modal.blur&&n.hide(t)}),l},update:function(e){n=e,c=e.options.show.modal.stealfocus!==k?e.tooltip.find("*").filter(function(){return t(this)}):[]},toggle:function(t,o,r){var c=(s(e.body),t.tooltip),d=t.options.show.modal,p=d.effect,u=o?"show":"hide",f=h.is(":visible"),g=s(ze).filter(":visible:not(:animated)").not(c);return l.update(t),o&&d.stealfocus!==k&&i(s(":focus")),h.toggleClass("blurs",d.blur),o&&h.appendTo(e.body),h.is(":animated")&&f===o&&a!==k||!o&&g.length?l:(h.stop(W,k),s.isFunction(p)?p.call(h,o):p===k?h[u]():h.fadeTo(parseInt(r,10)||90,o?1:0,function(){o||h.hide()}),o||h.queue(function(t){h.css({left:"",top:""}),s(ze).length||h.detach(),t()}),a=o,n.destroyed&&(n=E),l)}}),l.init()},Te=new Te,s.extend(q.prototype,{init:function(t){var e=t.tooltip;return this.options.on?(t.elements.overlay=Te.elem,e.addClass(je).css("z-index",T.modal_zindex+s(ze).length),t._bind(e,["tooltipshow","tooltiphide"],function(t,i,o){var n=t.originalEvent;if(t.target===e[0])if(n&&"tooltiphide"===t.type&&/mouse(leave|enter)/.test(n.type)&&s(n.relatedTarget).closest(Te.elem[0]).length)try{t.preventDefault()}catch(r){}else(!n||n&&"tooltipsolo"!==n.type)&&this.toggle(t,"tooltipshow"===t.type,o)},this._ns,this),t._bind(e,"tooltipfocus",function(t,i){if(!t.isDefaultPrevented()&&t.target===e[0]){var o=s(ze),n=T.modal_zindex+o.length,r=parseInt(e[0].style.zIndex,10);Te.elem[0].style.zIndex=n-1,o.each(function(){this.style.zIndex>r&&(this.style.zIndex-=1)}),o.filter("."+Z).qtip("blur",t.originalEvent),e.addClass(Z)[0].style.zIndex=n,Te.update(i);try{t.preventDefault()}catch(a){}}},this._ns,this),t._bind(e,"tooltiphide",function(t){t.target===e[0]&&s(ze).filter(":visible").not(e).last().qtip("focus",t)},this._ns,this),i):this},toggle:function(t,e,s){return t&&t.isDefaultPrevented()?this:(Te.toggle(this.qtip,!!e,s),i)},destroy:function(){this.qtip.tooltip.removeClass(je),this.qtip._unbind(this.qtip.tooltip,this._ns),Te.toggle(this.qtip,k),delete this.qtip.elements.overlay}}),Ce=R.modal=function(t){return new q(t,t.options.show.modal)},Ce.sanitize=function(t){t.show&&("object"!=typeof t.show.modal?t.show.modal={on:!!t.show.modal}:t.show.modal.on===i&&(t.show.modal.on=W))},T.modal_zindex=T.zindex-200,Ce.initialize="render",M.modal={"^show.modal.(on|blur)$":function(){this.destroy(),this.init(),this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth>0)}},s.extend(W,T.defaults,{show:{modal:{on:k,effect:W,blur:W,stealfocus:W,escape:W}}}),R.viewport=function(i,s,o,n,r,a,h){function l(t,e,i,o,n,r,a,h,l){var c=s[n],p=_[t],b=x[t],w=i===V,q=p===n?l:p===r?-l:-l/2,C=b===n?h:b===r?-h:-h/2,T=v[n]+y[n]-(f?0:u[n]),j=T-c,z=c+l-(a===A?g:m)-T,M=q-(_.precedance===t||p===_[e]?C:0)-(b===N?h/2:0);return w?(M=(p===n?1:-1)*q,s[n]+=j>0?j:z>0?-z:0,s[n]=Math.max(-u[n]+y[n],c-M,Math.min(Math.max(-u[n]+y[n]+(a===A?g:m),c+M),s[n],"center"===p?c-q:1e9))):(o*=i===$?2:0,j>0&&(p!==n||z>0)?(s[n]-=M+o,d.invert(t,n)):z>0&&(p!==r||j>0)&&(s[n]-=(p===N?-M:M)+o,d.invert(t,r)),v>s[n]&&-s[n]>z&&(s[n]=c,d=_.clone())),s[n]-c}var c,d,p,u,f,g,m,v,y,b=o.target,w=i.elements.tooltip,_=o.my,x=o.at,q=o.adjust,C=q.method.split(" "),T=C[0],j=C[1]||C[0],z=o.viewport,M=o.container,I=i.cache,W={left:0,top:0};return z.jquery&&b[0]!==t&&b[0]!==e.body&&"none"!==q.method?(u=M.offset()||W,f="static"===M.css("position"),c="fixed"===w.css("position"),g=z[0]===t?z.width():z.outerWidth(k),m=z[0]===t?z.height():z.outerHeight(k),v={left:c?0:z.scrollLeft(),top:c?0:z.scrollTop()},y=z.offset()||W,("shift"!==T||"shift"!==j)&&(d=_.clone()),W={left:"none"!==T?l(S,L,T,q.x,F,P,A,n,a):0,top:"none"!==j?l(L,S,j,q.y,D,O,B,r,h):0},d&&I.lastClass!==(p=X+"-pos-"+d.abbrev())&&w.removeClass(i.cache.lastClass).addClass(i.cache.lastClass=p),W):W},R.polys={polygon:function(t,e){var i,s,o,n={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10},adjustable:k},r=0,a=[],h=1,l=1,c=0,d=0;for(r=t.length;r--;)i=[parseInt(t[--r],10),parseInt(t[r+1],10)],i[0]>n.position.right&&(n.position.right=i[0]),i[0]n.position.bottom&&(n.position.bottom=i[1]),i[1]0&&o>0&&h>0&&l>0;)for(s=Math.floor(s/2),o=Math.floor(o/2),e.x===F?h=s:e.x===P?h=n.width-s:h+=Math.floor(s/2),e.y===D?l=o:e.y===O?l=n.height-o:l+=Math.floor(o/2),r=a.length;r--&&!(2>a.length);)c=a[r][0]-n.position.left,d=a[r][1]-n.position.top,(e.x===F&&c>=h||e.x===P&&h>=c||e.x===N&&(h>c||c>n.width-h)||e.y===D&&d>=l||e.y===O&&l>=d||e.y===N&&(l>d||d>n.height-l))&&a.splice(r,1);n.position={left:a[0][0],top:a[0][1]}}return n},rect:function(t,e,i,s){return{width:Math.abs(i-t),height:Math.abs(s-e),position:{left:Math.min(t,i),top:Math.min(e,s)}}},_angles:{tc:1.5,tr:7/4,tl:5/4,bc:.5,br:.25,bl:.75,rc:2,lc:1,c:0},ellipse:function(t,e,i,s,o){var n=R.polys._angles[o.abbrev()],r=0===n?0:i*Math.cos(n*Math.PI),a=s*Math.sin(n*Math.PI);return{width:2*i-Math.abs(r),height:2*s-Math.abs(a),position:{left:t+r,top:e+a},adjustable:k}},circle:function(t,e,i,s){return R.polys.ellipse(t,e,i,i,s)}},R.svg=function(t,i,o){for(var n,r,a,h,l,c,d,p,u,f,g,m=s(e),v=i[0],y=s(v.ownerSVGElement),b=1,w=1,_=!0;!v.getBBox;)v=v.parentNode;if(!v.getBBox||!v.parentNode)return k;n=y.attr("width")||y.width()||parseInt(y.css("width"),10),r=y.attr("height")||y.height()||parseInt(y.css("height"),10);var x=(parseInt(i.css("stroke-width"),10)||0)/2;switch(x&&(b+=x/n,w+=x/r),v.nodeName){case"ellipse":case"circle":f=R.polys.ellipse(v.cx.baseVal.value,v.cy.baseVal.value,(v.rx||v.r).baseVal.value+x,(v.ry||v.r).baseVal.value+x,o);break;case"line":case"polygon":case"polyline":for(u=v.points||[{x:v.x1.baseVal.value,y:v.y1.baseVal.value},{x:v.x2.baseVal.value,y:v.y2.baseVal.value}],f=[],p=-1,c=u.numberOfItems||u.length;c>++p;)d=u.getItem?u.getItem(p):u[p],f.push.apply(f,[d.x,d.y]);f=R.polys.polygon(f,o);break;default:f=v.getBoundingClientRect(),f={width:f.width,height:f.height,position:{left:f.left,top:f.top}},_=!1}return g=f.position,y=y[0],_&&(y.createSVGPoint&&(a=v.getScreenCTM(),u=y.createSVGPoint(),u.x=g.left,u.y=g.top,h=u.matrixTransform(a),g.left=h.x,g.top=h.y),y.viewBox&&(l=y.viewBox.baseVal)&&l.width&&l.height&&(b*=n/l.width,w*=r/l.height)),g.left+=m.scrollLeft(),g.top+=m.scrollTop(),f},R.imagemap=function(t,e,i){e.jquery||(e=s(e));var o,n,r,a,h,l=e.attr("shape").toLowerCase().replace("poly","polygon"),c=s('img[usemap="#'+e.parent("map").attr("name")+'"]'),d=s.trim(e.attr("coords")),p=d.replace(/,$/,"").split(",");if(!c.length)return k;if("polygon"===l)a=R.polys.polygon(p,i);else{if(!R.polys[l])return k;for(r=-1,h=p.length,n=[];h>++r;)n.push(parseInt(p[r],10));a=R.polys[l].apply(this,n.concat(i))}return o=c.offset(),o.left+=Math.ceil((c.outerWidth(k)-c.width())/2),o.top+=Math.ceil((c.outerHeight(k)-c.height())/2),a.position.left+=o.left,a.position.top+=o.top,a};var Me,Ie='';s.extend(C.prototype,{_scroll:function(){var e=this.qtip.elements.overlay;e&&(e[0].style.top=s(t).scrollTop()+"px")},init:function(i){var o=i.tooltip;1>s("select, object").length&&(this.bgiframe=i.elements.bgiframe=s(Ie).appendTo(o),i._bind(o,"tooltipmove",this.adjustBGIFrame,this._ns,this)),this.redrawContainer=s("
",{id:X+"-rcontainer"}).appendTo(e.body),i.elements.overlay&&i.elements.overlay.addClass("qtipmodal-ie6fix")&&(i._bind(t,["scroll","resize"],this._scroll,this._ns,this),i._bind(o,["tooltipshow"],this._scroll,this._ns,this)),this.redraw()},adjustBGIFrame:function(){var t,e,i=this.qtip.tooltip,s={height:i.outerHeight(k),width:i.outerWidth(k)},o=this.qtip.plugins.tip,n=this.qtip.elements.tip;e=parseInt(i.css("borderLeftWidth"),10)||0,e={left:-e,top:-e},o&&n&&(t="x"===o.corner.precedance?[A,F]:[B,D],e[t[1]]-=n[t[0]]()),this.bgiframe.css(e).css(s)},redraw:function(){if(1>this.qtip.rendered||this.drawing)return this;var t,e,i,s,o=this.qtip.tooltip,n=this.qtip.options.style,r=this.qtip.options.position.container;return this.qtip.drawing=1,n.height&&o.css(B,n.height),n.width?o.css(A,n.width):(o.css(A,"").appendTo(this.redrawContainer),e=o.width(),1>e%2&&(e+=1),i=o.css("maxWidth")||"",s=o.css("minWidth")||"",t=(i+s).indexOf("%")>-1?r.width()/100:0,i=(i.indexOf("%")>-1?t:1)*parseInt(i,10)||e,s=(s.indexOf("%")>-1?t:1)*parseInt(s,10)||0,e=i+s?Math.min(Math.max(e,s),i):e,o.css(A,Math.round(e)).appendTo(r)),this.drawing=0,this},destroy:function(){this.bgiframe&&this.bgiframe.remove(),this.qtip._unbind([t,this.qtip.tooltip],this._ns)}}),Me=R.ie6=function(t){return 6===oe.ie?new C(t):k},Me.initialize="render",M.ie6={"^content|style$":function(){this.redraw()}}})})(window,document); -//@ sourceMappingURL=http://cdnjs.cloudflare.com/ajax/libs/qtip2/2.2.0/jquery.qtip.min.map \ No newline at end of file +//@ sourceMappingURL=https://cdnjs.cloudflare.com/ajax/libs/qtip2/2.2.0/jquery.qtip.min.map diff --git a/portal/templates/_widget-topmenu.html b/portal/templates/_widget-topmenu.html index 6236344a..01a0c912 100644 --- a/portal/templates/_widget-topmenu.html +++ b/portal/templates/_widget-topmenu.html @@ -2,15 +2,13 @@