code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
#! /usr/bin/env perl # Copyright 2014-2017 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy # in the file LICENSE in the source distribution or at # https://www.openssl.org/source/license.html use strict; use warnings; my ($cflags, $platform) = @ARGV; $cflags = "compiler: $cflags"; my $date = gmtime($ENV{'SOURCE_DATE_EPOCH'} || time()) . " UTC"; print <<"END_OUTPUT"; /* * WARNING: do not edit! * Generated by util/mkbuildinf.pl * * Copyright 2014-2017 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at https://www.openssl.org/source/license.html */ #define PLATFORM "platform: $platform" #define DATE "built on: $date" /* * Generate compiler_flags as an array of individual characters. This is a * workaround for the situation where CFLAGS gets too long for a C90 string * literal */ static const char compiler_flags[] = { END_OUTPUT my $ctr = 0; foreach my $c (split //, $cflags) { $c =~ s|([\\'])|\\$1|; # Max 16 characters per line if (($ctr++ % 16) == 0) { if ($ctr != 1) { print "\n"; } print " "; } print "'$c',"; } print <<"END_OUTPUT"; '\\0' }; END_OUTPUT
papyrussolution/OpenPapyrus
Src/OSF/OpenSSL-111/util/mkbuildinf.pl
Perl
agpl-3.0
1,498
'use strict'; angular.module('impactApp') .factory('initQuestionScope', function() { return function(scope, question, prevStep, nextStep, data, previousModel, sectionModel) { scope.question = question; scope.nextStep = nextStep; scope.hideBack = data && data.hideBack; scope.isFirstQuestion = data && data.isFirstQuestion; scope.isLastQuestion = data && data.isLastQuestion; scope.prevStep = function() { // suppression de la reponse courrente delete sectionModel[question.model]; if (question.answers) { question.answers.map(function(answer) { if (sectionModel[answer.detailModel]) { delete sectionModel[answer.detailModel]; } }); } return prevStep(); }; // Si pas encore de réponse, on reprend la dernière if (previousModel && !sectionModel[question.model]) { sectionModel[question.model] = previousModel[question.model]; if (question.answers) { question.answers.map(function(answer) { sectionModel[answer.detailModel] = previousModel[answer.detailModel]; }); } } if (!previousModel && !sectionModel[question.model] && question.model === 'employeur') { sectionModel[question.model] = { nom: {label: 'Nom', value: ''}, adresse: {label: 'Adresse', value: ''}, medecin: {label: 'Service/Médecin', value: ''} }; } }; }) .controller('QuestionCtrl', function($scope, $state, question, previousModel, sectionModel, nextStep, initQuestionScope, prevStep) { initQuestionScope($scope, question, prevStep, nextStep, $state.current.data, previousModel, sectionModel); $scope.verifyPattern = function(form, field, pattern) { if (form[field].$viewValue.trim().length > 0) { if (new RegExp(pattern).test(form[field].$viewValue)) { form[field].$setValidity('pattern', true); } else { form[field].$setValidity('pattern', false); } } else { form[field].$setValidity('pattern', true); } }; }) .controller('CvQuestionCtrl', function($scope, question, nextStep, initQuestionScope, previousModel, sectionModel, prevStep) { initQuestionScope($scope, question, prevStep, nextStep, null, previousModel, sectionModel); $scope.ajoutEnCours = false; var modification = false; var index = -1; if (angular.isUndefined($scope.sectionModel[question.model])) { $scope.sectionModel[$scope.question.model] = { experiences: [] }; } $scope.experiences = $scope.sectionModel[$scope.question.model].experiences; $scope.ajouterExperience = function() { $scope.ajoutEnCours = true; $scope.tempExp = {}; }; $scope.modifierExperience = function(experience) { $scope.tempExp = experience; modification = true; $scope.ajoutEnCours = true; index = $scope.experiences.indexOf(experience); }; $scope.validerExperience = function(form) { if (form.$valid) { if (modification) { $scope.experiences.splice(index, 1); modification = false; } var lastIndex = _.findLastIndex($scope.experiences); $scope.experiences[lastIndex + 1] = $scope.tempExp; $scope.tempExp = {}; $scope.ajoutEnCours = false; } else { form.showError = true; } }; $scope.supprimerExperience = function(experience) { index = $scope.experiences.indexOf(experience); $scope.experiences.splice(index, 1); }; $scope.annuler = function() { $scope.ajoutEnCours = false; }; $scope.open = function($event, number) { $event.preventDefault(); $event.stopPropagation(); switch (number){ case 1 : $scope.opened1 = true; break; case 2: $scope.opened2 = true; break; } }; }) .controller('RenseignementsQuestionCtrl', function($scope, $state, question, nextStep, initQuestionScope, previousModel, sectionModel, prevStep) { initQuestionScope($scope, question, prevStep, nextStep, $state.current.data, previousModel, sectionModel); $scope.placeholder = 'Autres renseignements'; if (angular.isUndefined($scope.sectionModel.autresRenseignements)) { $scope.sectionModel.autresRenseignements = ''; } }) .controller('ListQuestionCtrl', function($scope, $state, question, nextStep, initQuestionScope, listName, previousModel, sectionModel, prevStep) { initQuestionScope($scope, question, prevStep, nextStep, $state.current.data, previousModel, sectionModel); if (angular.isUndefined($scope.sectionModel[question.model])) { $scope.sectionModel[question.model] = {}; $scope.sectionModel[question.model][listName] = []; } $scope.model = $scope.sectionModel[question.model]; $scope.open = function($event) { $event.preventDefault(); $event.stopPropagation(); $scope.opened = true; }; $scope.addLine = function() { $scope.model[listName].push({}); }; $scope.removeLine = function() { $scope.model[listName].pop(); }; }) .controller('ListFraisCtrl', function($scope, $state, question, nextStep, initQuestionScope, listName, previousModel, sectionModel, prevStep) { initQuestionScope($scope, question, prevStep, nextStep, $state.current.data, previousModel, sectionModel); if (angular.isUndefined($scope.sectionModel[question.model])) { $scope.sectionModel[question.model] = {}; $scope.sectionModel[question.model][listName] = []; } $scope.model = $scope.sectionModel[question.model]; $scope.open = function($event) { $event.preventDefault(); $event.stopPropagation(); $scope.opened = true; }; $scope.addLine = function(isRecurrent) { $scope.model[listName].push({recurrent: isRecurrent}); }; $scope.removeLine = function() { $scope.model[listName].pop(); }; }) .controller('EmploiDuTempsCtrl', function($scope, $state, question, nextStep, initQuestionScope, previousModel, sectionModel, prevStep) { initQuestionScope($scope, question, prevStep, nextStep, $state.current.data, previousModel, sectionModel); $scope.jours = ['Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi', 'Dimanche']; $scope.currentModel = question.model; if (angular.isUndefined($scope.sectionModel[$scope.currentModel])) { $scope.sectionModel[$scope.currentModel] = { jours: [] }; _.forEach($scope.jours, function(jour) { $scope.sectionModel[$scope.currentModel].jours.push({ jour: jour, matin: '', midi: '', aprem: '', soir: '' }); }); } $scope.model = $scope.sectionModel[$scope.currentModel]; }) .controller('SimpleSectionQuestionCtrl', function($scope, $state, sectionModel, question, nextStep, initQuestionScope, previousModel, prevStep) { initQuestionScope($scope, question, prevStep, nextStep, $state.current.data, previousModel, sectionModel); $scope.sectionModel = sectionModel; }) .controller('AdresseCtrl', function($scope, $state, question, nextStep, initQuestionScope, previousModel, sectionModel, prevStep, AdressService, currentMdph) { initQuestionScope($scope, question, prevStep, nextStep, $state.current.data, previousModel, sectionModel); $scope.currentMdph = currentMdph; $scope.getAdress = AdressService.getAdress; $scope.fillAdressOnSelect = AdressService.fillAdressOnSelect; $scope.maskOptions = {clearOnBlur: false, allowInvalidValue: true}; $scope.sectionModel = sectionModel; });
sgmap/impact
client/components/question/question.controller.js
JavaScript
agpl-3.0
7,773
package org.singinst.uf.presenter; public class UfHelp { public static String getMainHelpString() { return "TODO: initial help text"; } }
kanzure/uncertainfuture
java/src/org/singinst/uf/presenter/UfHelp.java
Java
agpl-3.0
154
<?php /** * Copyright 2015-2018 ppy Pty. Ltd. * * This file is part of osu!web. osu!web is distributed with the hope of * attracting more community contributions to the core ecosystem of osu!. * * osu!web is free software: you can redistribute it and/or modify * it under the terms of the Affero GNU General Public License version 3 * as published by the Free Software Foundation. * * osu!web is distributed WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with osu!web. If not, see <http://www.gnu.org/licenses/>. */ return [ 'beatmap_discussion' => [ 'destroy' => [ 'is_hype' => 'Hurrausta ei voi peruuttaa.', 'has_reply' => 'Keskustelua, jossa on vastauksia, ei voi poistaa', ], 'nominate' => [ 'exhausted' => 'Olet saavuttanut suosittelurajan tälle päivälle, yritä huomenna uudelleen.', 'incorrect_state' => 'Virhe toiminnon suorittamisessa, kokeile päivittää sivu.', 'owner' => "Omaa beatmappia ei voi suositella.", ], 'resolve' => [ 'not_owner' => 'Vain aiheen aloittaja sekä beatmapin omistaja voivat ratkaista keskustelun.', ], 'store' => [ 'mapper_note_wrong_user' => '', ], 'vote' => [ 'limit_exceeded' => 'Odota hetki ennen uusien äänien antamista', 'owner' => "Omia keskusteluja ei voi äänestää.", 'wrong_beatmapset_state' => 'Voit äänestää vain vireillä olevien beatmappien keskusteluissa.', ], ], 'beatmap_discussion_post' => [ 'edit' => [ 'system_generated' => 'Automaattisesti luotua viestiä ei voi muokata.', 'not_owner' => 'Vain lähettäjä voi muokata viestiä.', ], ], 'chat' => [ 'channel' => [ 'read' => [ 'no_access' => 'Pääsy kohdekanavalle ei ole sallittu.', ], ], 'message' => [ 'send' => [ 'channel' => [ 'no_access' => 'Pääsy kohdekanavaan vaaditaan.', 'moderated' => 'Kanava on tällä hetkellä valvotussa tilassa.', 'not_lazer' => 'Voit puhua toistaiseksi vain #lazer kanavalla.', ], 'not_allowed' => 'Viestiä ei voi lähettää porttikiellossa, rajoitetussa tilassa tai mykistettynä.', ], ], ], 'contest' => [ 'voting_over' => 'Et voi muuttaa ääntäsi tälle kilpailulle äänestysajan loppumisen jälkeen.', ], 'forum' => [ 'post' => [ 'delete' => [ 'only_last_post' => 'Vain viimeinen viesti voidaan poistaa.', 'locked' => 'Lukitun aiheen viestejä ei voi poistaa.', 'no_forum_access' => 'Pääsy kyseiselle foorumille vaaditaan.', 'not_owner' => 'Vain lähettäjä voi poistaa viestin.', ], 'edit' => [ 'deleted' => 'Poistettua viestiä ei voi muokata.', 'locked' => 'Viestin muokkaaminen on estetty.', 'no_forum_access' => 'Pääsy kyseiselle foorumille vaaditaan.', 'not_owner' => 'Vain lähettäjä voi muokata viestiä.', 'topic_locked' => 'Lukitun aiheen viestiä ei voi muokata.', ], 'store' => [ 'play_more' => 'Pyydämme, että kokeilet peliä ennen viestin lähettämistä foorumeille! Jos kohtaat ongelmia pelatessasi, lähetä viesti foorumin apu- ja tukialueelle.', 'too_many_help_posts' => "Sinun on pelattava peliä enemmän, ennen kuin voit luoda useampia viestejä. Jos sinulla on edelleen ongelmia pelin kanssa, lähetä sähköpostia osoitteeseen support@ppy.sh", // FIXME: unhardcode email address. ], ], 'topic' => [ 'reply' => [ 'double_post' => 'Muokkaa entistä postaustasi sen sijaan kun postaat uuden.', 'locked' => 'Et voi vastata lukittuun aiheeseen.', 'no_forum_access' => 'Pääsy kyseiselle foorumille vaaditaan.', 'no_permission' => 'Ei oikeutta vastata.', 'user' => [ 'require_login' => 'Kirjaudu sisään vastataksesi.', 'restricted' => "Et voi vastata rajoitettuna.", 'silenced' => "Et voi vastata mykistettynä.", ], ], 'store' => [ 'no_forum_access' => 'Pääsy kyseiselle foorumille vaaditaan.', 'no_permission' => 'Uuden aiheen luontiin ei ole oikeuksia.', 'forum_closed' => 'Foorumi on suljettu, eikä siihen voi lähettää viestejä.', ], 'vote' => [ 'no_forum_access' => 'Pääsy kyseiselle foorumille vaaditaan.', 'over' => 'Äänestys on ohi eikä siinä voi enää äänestää.', 'voted' => 'Äänen muuttamista ei ole sallittu.', 'user' => [ 'require_login' => 'Kirjaudu sisään äänestääksesi.', 'restricted' => "Et voi äänestää rajoitettuna.", 'silenced' => "Et voi äänestää mykistettynä.", ], ], 'watch' => [ 'no_forum_access' => 'Pääsy kyseiselle foorumille vaaditaan.', ], ], 'topic_cover' => [ 'edit' => [ 'uneditable' => 'Virheellinen kansikuva valittu.', 'not_owner' => 'Vain omistaja voi muuttaa kansikuvaa.', ], ], 'view' => [ 'admin_only' => 'Vain ylläpitäjä voi nähdä tämän foorumin.', ], ], 'require_login' => 'Kirjaudu sisään jatkaaksesi.', 'unauthorized' => 'Pääsy evätty.', 'silenced' => "Et voi tehdä tätä mykistettynä.", 'restricted' => "Et voi tehdä tätä rajoitettuna.", 'user' => [ 'page' => [ 'edit' => [ 'locked' => 'Käyttäjäsivu on lukittu.', 'not_owner' => 'Voit muokata vain omaa käyttäjäsivuasi.', 'require_supporter_tag' => 'osu!tukija tägi tarvitaan.', ], ], ], ];
kj415j45/osu-web
resources/lang/fi/authorization.php
PHP
agpl-3.0
6,571
chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('index.html', { 'bounds': { 'width': 400, 'height': 425 } }); });
nmunro/Jerusalem
background.js
JavaScript
agpl-3.0
169
<?php /** * @author Jaap Jansma (CiviCooP) <jaap.jansma@civicoop.org> * @license http://www.gnu.org/licenses/agpl-3.0.html */ class CRM_Myemma_Page_MyEmmaFieldMap extends CRM_Core_Page_Basic { /** * The action links that we need to display for the browse screen * * @var array * @static */ static $_links = null; protected $account_id; /** * Class constructor. * * @param string $title * Title of the page. * @param int $mode * Mode of the page. * */ public function __construct($title = NULL, $mode = NULL) { parent::__construct($title, $mode); $this->account_id = CRM_Utils_Request::retrieve('account_id', 'Integer', CRM_Core_DAO::$_nullObject, true); $this->assign('account_id', $this->account_id); $this->assign('civicrm_fields', CRM_Myemma_Utils::buildCiviCRMFieldList()); $this->assign('location_types', CRM_Myemma_Utils::locationTypes()); $this->assign('my_emma_fields', CRM_Myemma_Utils::buildMyEmmaFieldList($this->account_id)); } function getBAOName() { return 'CRM_Myemma_BAO_MyEmmaFieldMap'; } /** * Get action Links * * @return array (reference) of action links */ function &links() { if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( 'name' => ts('Edit'), 'url' => 'civicrm/admin/my_emma_account/field_map', 'qs' => 'action=update&id=%%id%%&reset=1&account_id='.$this->account_id, 'title' => ts('Edit Financial Type'), ), CRM_Core_Action::DELETE => array( 'name' => ts('Delete'), 'url' => 'civicrm/admin/my_emma_account/field_map', 'qs' => 'action=delete&id=%%id%%&account_id='.$this->account_id, 'title' => ts('Delete Financial Type'), ), ); } return self::$_links; } /** * Get name of edit form * * @return string Classname of edit form. */ function editForm() { return 'CRM_Myemma_Form_MyEmmaFieldMap'; } /** * Get edit form name * * @return string name of this page. */ function editName() { return 'CRM_Myemma_Form_MyEmmaFieldMap'; } /** * Get user context. * * @return string user context. */ function userContext($mode = null) { return 'civicrm/admin/my_emma_account/field_map'; } /** * Get userContext params. * * @param int $mode * Mode that we are in. * * @return string */ public function userContextParams($mode = NULL) { return 'reset=1&action=browse&account_id='.$this->account_id; } }
CiviCooP/org.civicoop.myemma
CRM/Myemma/Page/MyEmmaFieldMap.php
PHP
agpl-3.0
2,910
/* * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) * From ASN.1 module "S1AP-IEs" * found in "../support/s1ap-r16.4.0/36413-g40.asn" * `asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps -no-gen-BER -no-gen-XER -no-gen-OER -no-gen-UPER` */ #include "S1AP_BluetoothName.h" int S1AP_BluetoothName_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; size_t size; if(!sptr) { ASN__CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if((size >= 1UL && size <= 248UL)) { /* Constraint check succeeded */ return 0; } else { ASN__CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) asn_per_constraints_t asn_PER_type_S1AP_BluetoothName_constr_1 CC_NOTUSED = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 8, 8, 1, 248 } /* (SIZE(1..248)) */, 0, 0 /* No PER value map */ }; #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_S1AP_BluetoothName_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_S1AP_BluetoothName = { "BluetoothName", "BluetoothName", &asn_OP_OCTET_STRING, asn_DEF_S1AP_BluetoothName_tags_1, sizeof(asn_DEF_S1AP_BluetoothName_tags_1) /sizeof(asn_DEF_S1AP_BluetoothName_tags_1[0]), /* 1 */ asn_DEF_S1AP_BluetoothName_tags_1, /* Same as above */ sizeof(asn_DEF_S1AP_BluetoothName_tags_1) /sizeof(asn_DEF_S1AP_BluetoothName_tags_1[0]), /* 1 */ { #if !defined(ASN_DISABLE_OER_SUPPORT) 0, #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) &asn_PER_type_S1AP_BluetoothName_constr_1, #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ S1AP_BluetoothName_constraint }, 0, 0, /* No members */ &asn_SPC_OCTET_STRING_specs /* Additional specs */ };
acetcom/nextepc
lib/asn1c/s1ap/S1AP_BluetoothName.c
C
agpl-3.0
2,295
# Stripe Payments When an attendees pays through Stripe, they stop interacting with Ubersystem itself and interact directly through Stripe's servers. There are two ways Ubersystem can then finish processing the payment and mark attendees as paid: 1. An automated task running every 30 minutes called **check_missed_stripe_payments()**, located in `uber > tasks > registration.py`. This task polls Stripe's servers via the Stripe API and checks all payment_intent.succeeded events within the last hour to see if they match any attendees whose payments are pending. 2. A webhook integration called **stripe_webhook_handler()**, located in `uber > api.py`, which marks payments as complete as soon as the attendee successfully pays. ## Webhook Integration ### Adding Webhooks to Stripe In order to make use of the webhook integration, your organization's Stripe account must have a webhook endpoint set up: 1. Follow the instructions at https://stripe.com/docs/webhooks/go-live to add a new webhook endpoint. - Set up the webhook for the **payment_intent.succeeded** event and point it to `/api/stripe_webhook_handler` on your server (e.g., `www.example.com/api/stripe_webhook_handler`) 2. Copy the signing secret from the new webhook endpoint into the **stripe_endpoint_secret** value for your server, found in the configuration file (e.g., `development.ini`) under **[secret]**. ### Local Server Testing Developers can set up Stripe to forward to their localhost server using the Stripe CLI. Follow the instructions at https://stripe.com/docs/webhooks/test to install and run Stripe CLI. Note that as of this writing, Stripe CLI may stop properly forwarding events when you restart the application. Simply stop and restart the `stripe listen` command to work around this bug.
magfest/ubersystem
STRIPE.md
Markdown
agpl-3.0
1,782
# frozen_string_literal: true require 'test_helper' require 'integration/concerns/pagination' class PersonalAdListingTest < ActionDispatch::IntegrationTest include Pagination before do @user = create(:user) create(:ad, :available, user: @user, title: 'ava1', published_at: 1.hour.ago) create(:ad, :available, user: @user, title: 'ava2', published_at: 1.day.ago) create(:ad, :booked, user: @user, title: 'res1') create(:ad, :delivered, user: @user, title: 'del1') create(:ad, :want, user: @user, title: 'wan1') create(:ad, title: "something else to ensure it's filtered out") visit profile_path(@user) end it 'lists all ads in a separate tab in user profile' do click_link 'todos' assert_selector '.ad_excerpt', count: 5 end it 'lists petitions in a separate tab in user profile' do click_link 'peticiones' assert_selector '.ad_excerpt', count: 1, text: 'wan1' end it 'lists first page of user available ads in user profile' do with_pagination(1) { click_link 'disponible' } assert_selector '.ad_excerpt', count: 1, text: 'ava1' end it 'lists other pages of user available ads in user profile' do with_pagination(1) do click_link 'disponible' click_link 'siguiente' end assert_selector '.ad_excerpt', count: 1, text: 'ava2' end it 'lists user reserved ads in users profile' do click_link 'reservado' assert_selector '.ad_excerpt', count: 1, text: 'res1' end it 'lists user delivered ads in users profile' do click_link 'entregado' assert_selector '.ad_excerpt', count: 1, text: 'del1' end end
alabs/nolotiro.org
test/integration/personal_ad_listing_test.rb
Ruby
agpl-3.0
1,636
<?php /** * Zend Framework * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://framework.zend.com/license/new-bsd * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@zend.com so we can send you a copy immediately. * * @category Zend * @package Zend_Search_Lucene * @subpackage Search * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** Zend_Search_Lucene_Search_Query_Processing */ //$1 'Zend/Search/Lucene/Search/Query/Preprocessing.php'; /** * It's an internal abstract class intended to finalize ase a query processing after query parsing. * This type of query is not actually involved into query execution. * * @category Zend * @package Zend_Search_Lucene * @subpackage Search * @internal * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Search_Lucene_Search_Query_Preprocessing_Term extends Zend_Search_Lucene_Search_Query_Preprocessing { /** * word (query parser lexeme) to find. * * @var string */ private $_word; /** * Word encoding (field name is always provided using UTF-8 encoding since it may be retrieved from index). * * @var string */ private $_encoding; /** * Field name. * * @var string */ private $_field; /** * Class constructor. Create a new preprocessing object for prase query. * * @param string $word Non-tokenized word (query parser lexeme) to search. * @param string $encoding Word encoding. * @param string $fieldName Field name. */ public function __construct($word, $encoding, $fieldName) { $this->_word = $word; $this->_encoding = $encoding; $this->_field = $fieldName; } /** * Re-write query into primitive queries in the context of specified index * * @param Zend_Search_Lucene_Interface $index * @return Zend_Search_Lucene_Search_Query */ public function rewrite(Zend_Search_Lucene_Interface $index) { if ($this->_field === null) { //$1 'Zend/Search/Lucene/Search/Query/MultiTerm.php'; $query = new Zend_Search_Lucene_Search_Query_MultiTerm(); $query->setBoost($this->getBoost()); $hasInsignificantSubqueries = false; //$1 'Zend/Search/Lucene.php'; if (Zend_Search_Lucene::getDefaultSearchField() === null) { $searchFields = $index->getFieldNames(true); } else { $searchFields = array(Zend_Search_Lucene::getDefaultSearchField()); } //$1 'Zend/Search/Lucene/Search/Query/Preprocessing/Term.php'; foreach ($searchFields as $fieldName) { $subquery = new Zend_Search_Lucene_Search_Query_Preprocessing_Term($this->_word, $this->_encoding, $fieldName); $rewrittenSubquery = $subquery->rewrite($index); foreach ($rewrittenSubquery->getQueryTerms() as $term) { $query->addTerm($term); } if ($rewrittenSubquery instanceof Zend_Search_Lucene_Search_Query_Insignificant) { $hasInsignificantSubqueries = true; } } if (count($query->getTerms()) == 0) { $this->_matches = array(); if ($hasInsignificantSubqueries) { //$1 'Zend/Search/Lucene/Search/Query/Insignificant.php'; return new Zend_Search_Lucene_Search_Query_Insignificant(); } else { //$1 'Zend/Search/Lucene/Search/Query/Empty.php'; return new Zend_Search_Lucene_Search_Query_Empty(); } } $this->_matches = $query->getQueryTerms(); return $query; } // ------------------------------------- // Recognize exact term matching (it corresponds to Keyword fields stored in the index) // encoding is not used since we expect binary matching //$1 'Zend/Search/Lucene/Index/Term.php'; $term = new Zend_Search_Lucene_Index_Term($this->_word, $this->_field); if ($index->hasTerm($term)) { //$1 'Zend/Search/Lucene/Search/Query/Term.php'; $query = new Zend_Search_Lucene_Search_Query_Term($term); $query->setBoost($this->getBoost()); $this->_matches = $query->getQueryTerms(); return $query; } // ------------------------------------- // Recognize wildcard queries /** @todo check for PCRE unicode support may be performed through Zend_Environment in some future */ if (@preg_match('/\pL/u', 'a') == 1) { $word = iconv($this->_encoding, 'UTF-8', $this->_word); $wildcardsPattern = '/[*?]/u'; $subPatternsEncoding = 'UTF-8'; } else { $word = $this->_word; $wildcardsPattern = '/[*?]/'; $subPatternsEncoding = $this->_encoding; } $subPatterns = preg_split($wildcardsPattern, $word, -1, PREG_SPLIT_OFFSET_CAPTURE); if (count($subPatterns) > 1) { // Wildcard query is recognized $pattern = ''; //$1 'Zend/Search/Lucene/Analysis/Analyzer.php'; foreach ($subPatterns as $id => $subPattern) { // Append corresponding wildcard character to the pattern before each sub-pattern (except first) if ($id != 0) { $pattern .= $word[ $subPattern[1] - 1 ]; } // Check if each subputtern is a single word in terms of current analyzer $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($subPattern[0], $subPatternsEncoding); if (count($tokens) > 1) { //$1 'Zend/Search/Lucene/Search/QueryParserException.php'; throw new Zend_Search_Lucene_Search_QueryParserException('Wildcard search is supported only for non-multiple word terms'); } foreach ($tokens as $token) { $pattern .= $token->getTermText(); } } //$1 'Zend/Search/Lucene/Index/Term.php'; $term = new Zend_Search_Lucene_Index_Term($pattern, $this->_field); //$1 'Zend/Search/Lucene/Search/Query/Wildcard.php'; $query = new Zend_Search_Lucene_Search_Query_Wildcard($term); $query->setBoost($this->getBoost()); // Get rewritten query. Important! It also fills terms matching container. $rewrittenQuery = $query->rewrite($index); $this->_matches = $query->getQueryTerms(); return $rewrittenQuery; } // ------------------------------------- // Recognize one-term multi-term and "insignificant" queries //$1 'Zend/Search/Lucene/Analysis/Analyzer.php'; $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($this->_word, $this->_encoding); if (count($tokens) == 0) { $this->_matches = array(); //$1 'Zend/Search/Lucene/Search/Query/Insignificant.php'; return new Zend_Search_Lucene_Search_Query_Insignificant(); } if (count($tokens) == 1) { //$1 'Zend/Search/Lucene/Index/Term.php'; $term = new Zend_Search_Lucene_Index_Term($tokens[0]->getTermText(), $this->_field); //$1 'Zend/Search/Lucene/Search/Query/Term.php'; $query = new Zend_Search_Lucene_Search_Query_Term($term); $query->setBoost($this->getBoost()); $this->_matches = $query->getQueryTerms(); return $query; } //It's not insignificant or one term query //$1 'Zend/Search/Lucene/Search/Query/MultiTerm.php'; $query = new Zend_Search_Lucene_Search_Query_MultiTerm(); /** * @todo Process $token->getPositionIncrement() to support stemming, synonyms and other * analizer design features */ //$1 'Zend/Search/Lucene/Index/Term.php'; foreach ($tokens as $token) { $term = new Zend_Search_Lucene_Index_Term($token->getTermText(), $this->_field); $query->addTerm($term, true); // all subterms are required } $query->setBoost($this->getBoost()); $this->_matches = $query->getQueryTerms(); return $query; } /** * Query specific matches highlighting * * @param Zend_Search_Lucene_Search_Highlighter_Interface $highlighter Highlighter object (also contains doc for highlighting) */ protected function _highlightMatches(Zend_Search_Lucene_Search_Highlighter_Interface $highlighter) { /** Skip fields detection. We don't need it, since we expect all fields presented in the HTML body and don't differentiate them */ /** Skip exact term matching recognition, keyword fields highlighting is not supported */ // ------------------------------------- // Recognize wildcard queries /** @todo check for PCRE unicode support may be performed through Zend_Environment in some future */ if (@preg_match('/\pL/u', 'a') == 1) { $word = iconv($this->_encoding, 'UTF-8', $this->_word); $wildcardsPattern = '/[*?]/u'; $subPatternsEncoding = 'UTF-8'; } else { $word = $this->_word; $wildcardsPattern = '/[*?]/'; $subPatternsEncoding = $this->_encoding; } $subPatterns = preg_split($wildcardsPattern, $word, -1, PREG_SPLIT_OFFSET_CAPTURE); if (count($subPatterns) > 1) { // Wildcard query is recognized $pattern = ''; //$1 'Zend/Search/Lucene/Analysis/Analyzer.php'; foreach ($subPatterns as $id => $subPattern) { // Append corresponding wildcard character to the pattern before each sub-pattern (except first) if ($id != 0) { $pattern .= $word[ $subPattern[1] - 1 ]; } // Check if each subputtern is a single word in terms of current analyzer $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($subPattern[0], $subPatternsEncoding); if (count($tokens) > 1) { // Do nothing (nothing is highlighted) return; } foreach ($tokens as $token) { $pattern .= $token->getTermText(); } } //$1 'Zend/Search/Lucene/Index/Term.php'; $term = new Zend_Search_Lucene_Index_Term($pattern, $this->_field); //$1 'Zend/Search/Lucene/Search/Query/Wildcard.php'; $query = new Zend_Search_Lucene_Search_Query_Wildcard($term); $query->_highlightMatches($highlighter); return; } // ------------------------------------- // Recognize one-term multi-term and "insignificant" queries //$1 'Zend/Search/Lucene/Analysis/Analyzer.php'; $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($this->_word, $this->_encoding); if (count($tokens) == 0) { // Do nothing return; } if (count($tokens) == 1) { $highlighter->highlight($tokens[0]->getTermText()); return; } //It's not insignificant or one term query $words = array(); foreach ($tokens as $token) { $words[] = $token->getTermText(); } $highlighter->highlight($words); } /** * Print a query * * @return string */ public function __toString() { // It's used only for query visualisation, so we don't care about characters escaping if ($this->_field !== null) { $query = $this->_field . ':'; } else { $query = ''; } $query .= $this->_word; if ($this->getBoost() != 1) { $query .= '^' . round($this->getBoost(), 4); } return $query; } }
Sparfel/iTop-s-Portal
library/Zend/Search/Lucene/Search/Query/Preprocessing/Term.php
PHP
agpl-3.0
12,865
from disco.core import Disco, result_iterator from disco.settings import DiscoSettings from disco.func import chain_reader from discodex.objects import DataSet from freequery.document import docparse from freequery.document.docset import Docset from freequery.index.tf_idf import TfIdf class IndexJob(object): def __init__(self, spec, discodex, disco_addr="disco://localhost", profile=False): # TODO(sqs): refactoring potential with PagerankJob self.spec = spec self.discodex = discodex self.docset = Docset(spec.docset_name) self.disco = Disco(DiscoSettings()['DISCO_MASTER']) self.nr_partitions = 8 self.profile = profile def start(self): results = self.__run_job(self.__index_job()) self.__run_discodex_index(results) def __run_job(self, job): results = job.wait() if self.profile: self.__profile_job(job) return results def __index_job(self): return self.disco.new_job( name="index_tfidf", input=['tag://' + self.docset.ddfs_tag], map_reader=docparse, map=TfIdf.map, reduce=TfIdf.reduce, sort=True, partitions=self.nr_partitions, partition=TfIdf.partition, merge_partitions=False, profile=self.profile, params=dict(doc_count=self.docset.doc_count)) def __run_discodex_index(self, results): opts = { 'parser': 'disco.func.chain_reader', 'demuxer': 'freequery.index.tf_idf.TfIdf_demux', 'nr_ichunks': 1, # TODO(sqs): after disco#181 fixed, increase this } ds = DataSet(input=results, options=opts) origname = self.discodex.index(ds) self.disco.wait(origname) # origname is also the disco job name self.discodex.clone(origname, self.spec.invindex_name)
sqs/freequery
freequery/index/job.py
Python
agpl-3.0
1,947
<?php /* * Copyright 2004-2017, AfterLogic Corp. * Licensed under AGPLv3 license or AfterLogic license * if commercial version of the product was purchased. * See the LICENSE file for a full license statement. */ namespace MailSo\Imap\Enumerations; /** * @category MailSo * @package Imap * @subpackage Enumerations */ class FetchType { const ALL = 'ALL'; const FAST = 'FAST'; const FULL = 'FULL'; const BODY = 'BODY'; const BODY_PEEK = 'BODY.PEEK'; const BODY_HEADER = 'BODY[HEADER]'; const BODY_HEADER_PEEK = 'BODY.PEEK[HEADER]'; const BODYSTRUCTURE = 'BODYSTRUCTURE'; const ENVELOPE = 'ENVELOPE'; const FLAGS = 'FLAGS'; const INTERNALDATE = 'INTERNALDATE'; const RFC822 = 'RFC822'; const RFC822_HEADER = 'RFC822.HEADER'; const RFC822_SIZE = 'RFC822.SIZE'; const RFC822_TEXT = 'RFC822.TEXT'; const UID = 'UID'; const INDEX = 'INDEX'; const GMAIL_MSGID = 'X-GM-MSGID'; const GMAIL_THRID = 'X-GM-THRID'; const GMAIL_LABELS = 'X-GM-LABELS'; /** * @param array $aReturn * * @param string|array $mType */ private static function addHelper(&$aReturn, $mType) { if (\is_string($mType)) { $aReturn[$mType] = ''; } else if (\is_array($mType) && 2 === count($mType) && \is_string($mType[0]) && is_callable($mType[1])) { $aReturn[$mType[0]] = $mType[1]; } } /** * @param array $aHeaders * @param bool $bPeek = true * * @return string */ public static function BuildBodyCustomHeaderRequest(array $aHeaders, $bPeek = true) { $sResult = ''; if (0 < \count($aHeaders)) { $aHeaders = \array_map('trim', $aHeaders); $aHeaders = \array_map('strtoupper', $aHeaders); $sResult = $bPeek ? self::BODY_PEEK : self::BODY; $sResult .= '[HEADER.FIELDS ('.\implode(' ', $aHeaders).')]'; } return $sResult; } /** * @param array $aFetchItems * * @return array */ public static function ChangeFetchItemsBefourRequest(array $aFetchItems) { $aReturn = array(); self::addHelper($aReturn, self::UID); self::addHelper($aReturn, self::RFC822_SIZE); foreach ($aFetchItems as $mFetchKey) { switch ($mFetchKey) { default: if (is_string($mFetchKey) || is_array($mFetchKey)) { self::addHelper($aReturn, $mFetchKey); } break; case self::INDEX: case self::UID: case self::RFC822_SIZE: break; case self::ALL: self::addHelper($aReturn, self::FLAGS); self::addHelper($aReturn, self::INTERNALDATE); self::addHelper($aReturn, self::ENVELOPE); break; case self::FAST: self::addHelper($aReturn, self::FLAGS); self::addHelper($aReturn, self::INTERNALDATE); break; case self::FULL: self::addHelper($aReturn, self::FLAGS); self::addHelper($aReturn, self::INTERNALDATE); self::addHelper($aReturn, self::ENVELOPE); self::addHelper($aReturn, self::BODY); break; } } return $aReturn; } }
afterlogic/webmail-lite
libraries/MailSo/Imap/Enumerations/FetchType.php
PHP
agpl-3.0
3,021
<?php if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); /********************************************************************************* * SugarCRM Community Edition is a customer relationship management program developed by * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License version 3 as published by the * Free Software Foundation with the addition of the following permission added * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License along with * this program; if not, see http://www.gnu.org/licenses or write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA. * * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by * SugarCRM" logo. If the display of the logo is not reasonably feasible for * technical reasons, the Appropriate Legal Notices must display the words * "Powered by SugarCRM". ********************************************************************************/ /********************************************************************************* * Description: Defines the Account SugarBean Account entity with the necessary * methods and variables. ********************************************************************************/ require_once("include/SugarObjects/templates/company/Company.php"); // Account is used to store account information. class Account extends Company { var $field_name_map = array(); // Stored fields var $date_entered; var $date_modified; var $modified_user_id; var $assigned_user_id; var $annual_revenue; var $billing_address_street; var $billing_address_city; var $billing_address_state; var $billing_address_country; var $billing_address_postalcode; var $billing_address_street_2; var $billing_address_street_3; var $billing_address_street_4; var $description; var $email1; var $email2; var $email_opt_out; var $invalid_email; var $employees; var $id; var $industry; var $name; var $ownership; var $parent_id; var $phone_alternate; var $phone_fax; var $phone_office; var $rating; var $shipping_address_street; var $shipping_address_city; var $shipping_address_state; var $shipping_address_country; var $shipping_address_postalcode; var $shipping_address_street_2; var $shipping_address_street_3; var $shipping_address_street_4; var $campaign_id; var $sic_code; var $ticker_symbol; var $account_type; var $website; var $custom_fields; var $created_by; var $created_by_name; var $modified_by_name; // These are for related fields var $opportunity_id; var $case_id; var $contact_id; var $task_id; var $note_id; var $meeting_id; var $call_id; var $email_id; var $member_id; var $parent_name; var $assigned_user_name; var $account_id = ''; var $account_name = ''; var $bug_id =''; var $module_dir = 'Accounts'; var $emailAddress; var $table_name = "accounts"; var $object_name = "Account"; var $importable = true; var $new_schema = true; // This is used to retrieve related fields from form posts. var $additional_column_fields = Array('assigned_user_name', 'assigned_user_id', 'opportunity_id', 'bug_id', 'case_id', 'contact_id', 'task_id', 'note_id', 'meeting_id', 'call_id', 'email_id', 'parent_name', 'member_id' ); var $relationship_fields = Array('opportunity_id'=>'opportunities', 'bug_id' => 'bugs', 'case_id'=>'cases', 'contact_id'=>'contacts', 'task_id'=>'tasks', 'note_id'=>'notes', 'meeting_id'=>'meetings', 'call_id'=>'calls', 'email_id'=>'emails','member_id'=>'members', 'project_id'=>'project', ); //Meta-Data Framework fields var $push_billing; var $push_shipping; function Account() { parent::Company(); $this->setupCustomFields('Accounts'); foreach ($this->field_defs as $field) { if(isset($field['name'])) { $this->field_name_map[$field['name']] = $field; } } //Combine the email logic original here with bug #26450. if( (!empty($_REQUEST['parent_id']) && !empty($_REQUEST['parent_type']) && $_REQUEST['parent_type'] == 'Emails' && !empty($_REQUEST['return_module']) && $_REQUEST['return_module'] == 'Emails' ) || (!empty($_REQUEST['parent_type']) && $_REQUEST['parent_type'] != 'Accounts' && !empty($_REQUEST['return_module']) && $_REQUEST['return_module'] != 'Accounts') ){ $_REQUEST['parent_name'] = ''; $_REQUEST['parent_id'] = ''; } } function get_summary_text() { return $this->name; } function get_contacts() { return $this->get_linked_beans('contacts','Contact'); } function clear_account_case_relationship($account_id='', $case_id='') { if (empty($case_id)) $where = ''; else $where = " and id = '$case_id'"; $query = "UPDATE cases SET account_name = '', account_id = '' WHERE account_id = '$account_id' AND deleted = 0 " . $where; $this->db->query($query,true,"Error clearing account to case relationship: "); } /** * This method is used to provide backward compatibility with old data that was prefixed with http:// * We now automatically prefix http:// * @deprecated. */ function remove_redundant_http() { /* if(preg_match("@http://@", $this->website)) { $this->website = substr($this->website, 7); } */ } function fill_in_additional_list_fields() { parent::fill_in_additional_list_fields(); // Fill in the assigned_user_name // $this->assigned_user_name = get_assigned_user_name($this->assigned_user_id); } function fill_in_additional_detail_fields() { parent::fill_in_additional_detail_fields(); //rrs bug: 28184 - instead of removing this code altogether just adding this check to ensure that if the parent_name //is empty then go ahead and fill it. if(empty($this->parent_name) && !empty($this->id)){ $query = "SELECT a1.name from accounts a1, accounts a2 where a1.id = a2.parent_id and a2.id = '$this->id' and a1.deleted=0"; $result = $this->db->query($query,true," Error filling in additional detail fields: "); // Get the id and the name. $row = $this->db->fetchByAssoc($result); if($row != null) { $this->parent_name = $row['name']; } else { $this->parent_name = ''; } } // Set campaign name if there is a campaign id if( !empty($this->campaign_id)){ $camp = new Campaign(); $where = "campaigns.id='{$this->campaign_id}'"; $campaign_list = $camp->get_full_list("campaigns.name", $where, true); $this->campaign_name = $campaign_list[0]->name; } } function get_list_view_data(){ global $system_config,$current_user; $temp_array = $this->get_list_view_array(); $temp_array["ENCODED_NAME"]=$this->name; // $temp_array["ENCODED_NAME"]=htmlspecialchars($this->name, ENT_QUOTES); if(!empty($this->billing_address_state)) { $temp_array["CITY"] = $this->billing_address_city . ', '. $this->billing_address_state; } else { $temp_array["CITY"] = $this->billing_address_city; } $temp_array["BILLING_ADDRESS_STREET"] = $this->billing_address_street; $temp_array["SHIPPING_ADDRESS_STREET"] = $this->shipping_address_street; if(isset($system_config->settings['system_skypeout_on']) && $system_config->settings['system_skypeout_on'] == 1){ if(!empty($temp_array['PHONE_OFFICE']) && skype_formatted($temp_array['PHONE_OFFICE'])){ $temp_array['PHONE_OFFICE'] = '<a href="callto://' . $temp_array['PHONE_OFFICE']. '">'.$temp_array['PHONE_OFFICE']. '</a>' ; }} $temp_array["EMAIL1"] = $this->emailAddress->getPrimaryAddress($this); $this->email1 = $temp_array['EMAIL1']; $temp_array["EMAIL1_LINK"] = $current_user->getEmailLink('email1', $this, '', '', 'ListView'); return $temp_array; } /** builds a generic search based on the query string using or do not include any $this-> because this is called on without having the class instantiated */ function build_generic_where_clause ($the_query_string) { $where_clauses = Array(); $the_query_string = $this->db->quote($the_query_string); array_push($where_clauses, "accounts.name like '$the_query_string%'"); if (is_numeric($the_query_string)) { array_push($where_clauses, "accounts.phone_alternate like '%$the_query_string%'"); array_push($where_clauses, "accounts.phone_fax like '%$the_query_string%'"); array_push($where_clauses, "accounts.phone_office like '%$the_query_string%'"); } $the_where = ""; foreach($where_clauses as $clause) { if(!empty($the_where)) $the_where .= " or "; $the_where .= $clause; } return $the_where; } function create_export_query(&$order_by, &$where, $relate_link_join='') { $custom_join = $this->custom_fields->getJOIN(true, true,$where); if($custom_join) $custom_join['join'] .= $relate_link_join; $query = "SELECT accounts.*,email_addresses.email_address email_address, accounts.name as account_name, users.user_name as assigned_user_name "; if($custom_join){ $query .= $custom_join['select']; } $query .= " FROM accounts "; $query .= "LEFT JOIN users ON accounts.assigned_user_id=users.id "; //join email address table too. $query .= ' LEFT JOIN email_addr_bean_rel on accounts.id = email_addr_bean_rel.bean_id and email_addr_bean_rel.bean_module=\'Accounts\' and email_addr_bean_rel.deleted=0 and email_addr_bean_rel.primary_address=1 '; $query .= ' LEFT JOIN email_addresses on email_addresses.id = email_addr_bean_rel.email_address_id ' ; if($custom_join){ $query .= $custom_join['join']; } $where_auto = "( accounts.deleted IS NULL OR accounts.deleted=0 )"; if($where != "") $query .= "where ($where) AND ".$where_auto; else $query .= "where ".$where_auto; if(!empty($order_by)) $query .= " ORDER BY ". $this->process_order_by($order_by, null); return $query; } function set_notification_body($xtpl, $account) { $xtpl->assign("ACCOUNT_NAME", $account->name); $xtpl->assign("ACCOUNT_TYPE", $account->account_type); $xtpl->assign("ACCOUNT_DESCRIPTION", $account->description); return $xtpl; } function bean_implements($interface){ switch($interface){ case 'ACL':return true; } return false; } function get_unlinked_email_query($type=array()) { return get_unlinked_email_query($type, $this); } // Added By Basudeba Rath. // Date : 18-Jun-2012. function create_new_list_query($order_by, $where,$filter=array(),$params=array(), $show_deleted = 0,$join_type='', $return_array = false, $parentbean = null, $singleSelect = false){ global $current_user; $table_name = $this->table_name; $ret_array = parent::create_new_list_query($order_by, $where, $filter, $params, $show_deleted, $join_type, true, $parentbean, $singleSelect); if($_REQUEST['query_string'] == ""){ //$ret_array['from_min'] = ""; $ret_array['where'] = ""; $ret_array['from'] ="" ; //$ret_array['order_by'] = ""; $ret_array['select'] = " "; } //$ret_array['select'] = " SELECT * FROM accounts WHERE deleted = '0' "; //by anuradha 5-7-2012: placing if condition & FROM accounts & accounts.date_entered & assigned_user_id if($_REQUEST['accountfilter_basic'][0] == 'all_clients'){ $ret_array['select'] = " SELECT * FROM accounts "; $ret_array['where'] = " WHERE accounts.deleted = '0' "; if(!empty($_REQUEST['name_basic'])){ //by anuradha on 14-7-2012 $ret_array['where'].= " AND accounts.name like '%".$_REQUEST['name_basic']."%' "; } } elseif($_REQUEST['accountfilter_basic'][0] == 'all_leads'){ $ret_array['select'] = " SELECT distinct accounts.id, accounts.`name`, accounts.date_entered, accounts.assigned_user_id, accounts.billing_address_city, accounts.billing_address_country, accounts.phone_office, accounts.phone_alternate, accounts.parent_id, accounts.first_name, accounts.last_name, accounts.mobile from accounts LEFT JOIN cases ON cases.account_id = accounts.id LEFT JOIN c_case_status ON cases.status = c_case_status.id "; /*$ret_array['where'] = " where c_case_status.order_no < 20 AND accounts.id not in (select accounts.id from accounts LEFT JOIN cases ON cases.account_id = accounts.id LEFT JOIN c_case_status ON cases.status = c_case_status.id where c_case_status.order_no >= 20 AND accounts.deleted = '0' AND cases.deleted = '0' AND c_case_status.deleted = '0') AND accounts.deleted = '0' AND cases.deleted = '0' AND c_case_status.deleted = '0' ";*/ $ret_array['where'] = " WHERE (c_case_status.order_no < 20 AND accounts.id not in (select accounts.id from accounts LEFT JOIN cases ON cases.account_id = accounts.id LEFT JOIN c_case_status ON cases.status = c_case_status.id where c_case_status.order_no >= 20 AND accounts.deleted = '0' AND cases.deleted = '0' AND c_case_status.deleted = '0') AND cases.deleted = '0' AND c_case_status.deleted = '0') || (accounts.id not in(select cases.account_id from cases where cases.deleted = '0')) AND accounts.deleted = '0' "; if(!empty($_REQUEST['name_basic'])){ //by anuradha on 14-7-2012 $ret_array['where'].= " AND accounts.name like '%".$_REQUEST['name_basic']."%' "; } #Rajesh G - 24/07/12 if($_REQUEST['viewasfilter_basic'][0] != "" && $_REQUEST['viewasfilter_basic'][0] != "all" ){ $ret_array['where'] .= " AND accounts.assigned_user_id = '".$_REQUEST['viewasfilter_basic'][0]."'"; } } return $ret_array; } }
acuteventures/CRM
modules/Accounts/Account_16-08-2012.php
PHP
agpl-3.0
15,380
/* * ArcEmu MMORPG Server * Copyright (C) 2005-2007 Ascent Team <http://www.ascentemu.com/> * Copyright (C) 2008-2012 <http://www.ArcEmu.org/> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ /* English Worldstrings as of 08.16.2009 entry text 1 I would like to browse your goods. 2 I seek 3 mage 4 shaman 5 warrior 6 paladin 7 warlock 8 hunter 9 rogue 10 druid 11 priest 12 training 13 Train me in the ways of the beast. 14 Give me a ride. 15 I would like to make a bid. 16 Make this inn your home. 17 I would like to check my deposit box. 18 Bring me back to life. 19 How do I create a guild/arena team? 20 I want to create a guild crest. 21 I would like to go to the battleground. 22 I would like to reset my talents. 23 I wish to untrain my pet. 24 I understand, continue. 25 Yes, please do. 26 This instance is unavailable. 27 You must have The Burning Crusade Expansion to access this content. 28 Heroic mode unavailable for this instance. 29 You must be in a raid group to pass through here. 30 You do not have the required attunement to pass through here. 31 You must be at least level %u to pass through here. 32 You must be in a party to pass through here. 33 You must be level 70 to enter heroic mode. 34 - 35 You must have the item, `%s` to pass through here. 36 You must have the item, UNKNOWN to pass through here. 37 What can I teach you, $N? 38 Alterac Valley 39 Warsong Gulch 40 Arathi Basin 41 Arena 2v2 42 Arena 3v3 43 Arena 5v5 44 Eye of the Storm 45 Unknown Battleground 46 One minute until the battle for %s begins! 47 Thirty seconds until the battle for %s begins! 48 Fifteen seconds until the battle for %s begins! 49 The battle for %s has begun! 50 Arena 51 You have tried to join an invalid instance id. 52 Your queue on battleground instance id %u is no longer valid. Reason: Instance Deleted. 53 You cannot join this battleground as it has already ended. 54 Your queue on battleground instance %u is no longer valid, the instance no longer exists. 55 Sorry, raid groups joining battlegrounds are currently unsupported. 56 You must be the party leader to add a group to an arena. 57 You must be in a team to join rated arena. 58 You have too many players in your party to join this type of arena. 59 Sorry, some of your party members are not level 70. 60 One or more of your party members are already queued or inside a battleground. 61 One or more of your party members are not members of your team. 62 Welcome to 63 Horde 64 Alliance 65 [ |cff00ccffAttention|r ] Welcome! A new challenger (|cff00ff00{%d}|r - |cffff0000%s|r) has arrived and joined into |cffff0000%s|r,their force has already been increased. 66 This instance is scheduled to reset on 67 Auto loot passing is now %s 68 On 69 Off 70 Hey there, $N. How can I help you? 71 You are already in an arena team. 72 That name is already in use. 73 You already have an arena charter. 74 A guild with that name already exists. 75 You already have a guild charter. 76 Item not found. 77 Target is of the wrong faction. 78 Target player cannot sign your charter for one or more reasons. 79 You have already signed that charter. 80 You don't have the required amount of signatures to turn in this petition. 81 You must have Wrath of the Lich King Expansion to access this content. 82 Deathknight */ #include "StdAfx.h" #include <git_version.h> namespace worldstring { } initialiseSingleton(ScriptMgr); initialiseSingleton(HookInterface); ScriptMgr::ScriptMgr() { } ScriptMgr::~ScriptMgr() { } struct ScriptingEngine_dl { Arcemu::DynLib* dl; exp_script_register InitializeCall; uint32 Type; ScriptingEngine_dl() { dl = NULL; InitializeCall = NULL; Type = 0; } }; void ScriptMgr::LoadScripts() { if(HookInterface::getSingletonPtr() == NULL) new HookInterface; Log.Success("Server", "Loading External Script Libraries..."); std::string Path; std::string FileMask; Path = PREFIX; Path += '/'; #ifdef WIN32 /*Path = Config.MainConfig.GetStringDefault( "Script", "BinaryLocation", "script_bin" ); Path += "\\";*/ FileMask = ".dll"; #else #ifndef __APPLE__ FileMask = ".so"; #else FileMask = ".dylib"; #endif #endif Arcemu::FindFilesResult findres; std::vector< ScriptingEngine_dl > Engines; Arcemu::FindFiles(Path.c_str(), FileMask.c_str(), findres); uint32 count = 0; while(findres.HasNext()) { std::stringstream loadmessage; std::string fname = Path + findres.GetNext(); Arcemu::DynLib* dl = new Arcemu::DynLib(fname.c_str()); loadmessage << " " << dl->GetName() << " : "; if(!dl->Load()) { loadmessage << "ERROR: Cannot open library."; LOG_DETAIL(loadmessage.str().c_str()); delete dl; continue; } else { exp_get_version vcall = reinterpret_cast< exp_get_version >(dl->GetAddressForSymbol("_exp_get_version")); exp_script_register rcall = reinterpret_cast< exp_script_register >(dl->GetAddressForSymbol("_exp_script_register")); exp_get_script_type scall = reinterpret_cast< exp_get_script_type >(dl->GetAddressForSymbol("_exp_get_script_type")); if((vcall == NULL) || (rcall == NULL) || (scall == NULL)) { loadmessage << "ERROR: Cannot find version functions."; LOG_DETAIL(loadmessage.str().c_str()); delete dl; continue; } else { const char *version = vcall(); uint32 stype = scall(); if( strcmp( version, BUILD_HASH_STR ) != 0 ) { loadmessage << "ERROR: Version mismatch."; LOG_DETAIL(loadmessage.str().c_str()); delete dl; continue; } else { loadmessage << ' ' << std::string( BUILD_HASH_STR ) << " : "; if((stype & SCRIPT_TYPE_SCRIPT_ENGINE) != 0) { ScriptingEngine_dl se; se.dl = dl; se.InitializeCall = rcall; se.Type = stype; Engines.push_back(se); loadmessage << "delayed load"; } else { rcall(this); dynamiclibs.push_back(dl); loadmessage << "loaded"; } LOG_DETAIL(loadmessage.str().c_str()); count++; } } } } if(count == 0) { LOG_DETAIL("ERROR: No external scripts found! Server will continue to function with limited functionality."); } else { Log.Success("Server", "Loaded %u external libraries.", count); Log.Success("Server", "Loading optional scripting engine(s)..."); for(std::vector< ScriptingEngine_dl >::iterator itr = Engines.begin(); itr != Engines.end(); ++itr) { itr->InitializeCall(this); dynamiclibs.push_back(itr->dl); } Log.Success("Server", "Done loading scripting engine(s)..."); } } void ScriptMgr::UnloadScripts() { if(HookInterface::getSingletonPtr()) delete HookInterface::getSingletonPtr(); for(CustomGossipScripts::iterator itr = _customgossipscripts.begin(); itr != _customgossipscripts.end(); ++itr) (*itr)->Destroy(); _customgossipscripts.clear(); for(QuestScripts::iterator itr = _questscripts.begin(); itr != _questscripts.end(); ++itr) delete *itr; _questscripts.clear(); UnloadScriptEngines(); for(DynamicLibraryMap::iterator itr = dynamiclibs.begin(); itr != dynamiclibs.end(); ++itr) delete *itr; dynamiclibs.clear(); } void ScriptMgr::DumpUnimplementedSpells() { std::ofstream of; LOG_DETAIL("BASIC: Dumping IDs for spells with unimplemented dummy/script effect(s)"); uint32 count = 0; of.open("unimplemented1.txt"); for(DBCStorage< SpellEntry >::iterator itr = dbcSpell.begin(); itr != dbcSpell.end(); ++itr) { SpellEntry* sp = *itr; if(!sp->HasEffect(SPELL_EFFECT_DUMMY) && !sp->HasEffect(SPELL_EFFECT_SCRIPT_EFFECT) && !sp->HasEffect(SPELL_EFFECT_SEND_EVENT)) continue; HandleDummySpellMap::iterator sitr = _spells.find(sp->Id); if(sitr != _spells.end()) continue; HandleScriptEffectMap::iterator seitr = SpellScriptEffects.find(sp->Id); if(seitr != SpellScriptEffects.end()) continue; std::stringstream ss; ss << sp->Id; ss << std::endl; of.write(ss.str().c_str(), ss.str().length()); count++; } of.close(); LOG_DETAIL("BASIC: Dumped %u IDs.", count); LOG_DETAIL("BASIC: Dumping IDs for spells with unimplemented dummy aura effect."); std::ofstream of2; of2.open("unimplemented2.txt"); count = 0; for(DBCStorage< SpellEntry >::iterator itr = dbcSpell.begin(); itr != dbcSpell.end(); ++itr) { SpellEntry* sp = *itr; if(!sp->AppliesAura(SPELL_AURA_DUMMY)) continue; HandleDummyAuraMap::iterator ditr = _auras.find(sp->Id); if(ditr != _auras.end()) continue; std::stringstream ss; ss << sp->Id; ss << std::endl; of2.write(ss.str().c_str(), ss.str().length()); count++; } of2.close(); LOG_DETAIL("BASIC: Dumped %u IDs.", count); } void ScriptMgr::register_creature_script(uint32 entry, exp_create_creature_ai callback) { if(_creatures.find(entry) != _creatures.end()) LOG_DETAIL("ERROR: ScriptMgr is trying to register a script for Creature ID: %u even if there's already one for that Creature. Remove one of those scripts.", entry); _creatures.insert(CreatureCreateMap::value_type(entry, callback)); } void ScriptMgr::register_gameobject_script(uint32 entry, exp_create_gameobject_ai callback) { if(_gameobjects.find(entry) != _gameobjects.end()) LOG_DETAIL("ERROR: ScriptMgr is trying to register a script for GameObject ID: %u even if there's already one for that GameObject. Remove one of those scripts.", entry); _gameobjects.insert(GameObjectCreateMap::value_type(entry, callback)); } void ScriptMgr::register_dummy_aura(uint32 entry, exp_handle_dummy_aura callback) { if(_auras.find(entry) != _auras.end()) { LOG_DETAIL("ERROR: ScriptMgr is trying to register a script for Aura ID: %u even if there's already one for that Aura. Remove one of those scripts.", entry); } SpellEntry* sp = dbcSpell.LookupEntryForced(entry); if(sp == NULL) { LOG_DETAIL("ERROR: ScriptMgr is trying to register a dummy aura handler for Spell ID: %u which is invalid.", entry); return; } if(!sp->AppliesAura(SPELL_AURA_DUMMY) && !sp->AppliesAura(SPELL_AURA_PERIODIC_TRIGGER_DUMMY)) LOG_DETAIL("ERROR: ScriptMgr has registered a dummy aura handler for Spell ID: %u ( %s ), but spell has no dummy aura!", entry, sp->Name); _auras.insert(HandleDummyAuraMap::value_type(entry, callback)); } void ScriptMgr::register_dummy_spell(uint32 entry, exp_handle_dummy_spell callback) { if(_spells.find(entry) != _spells.end()) { LOG_DETAIL("ERROR: ScriptMgr is trying to register a script for Spell ID: %u even if there's already one for that Spell. Remove one of those scripts.", entry); return; } SpellEntry* sp = dbcSpell.LookupEntryForced(entry); if(sp == NULL) { LOG_DETAIL("ERROR: ScriptMgr is trying to register a dummy handler for Spell ID: %u which is invalid.", entry); return; } if(!sp->HasEffect(SPELL_EFFECT_DUMMY) && !sp->HasEffect(SPELL_EFFECT_SCRIPT_EFFECT) && !sp->HasEffect(SPELL_EFFECT_SEND_EVENT)) LOG_DETAIL("ERROR: ScriptMgr has registered a dummy handler for Spell ID: %u ( %s ), but spell has no dummy/script/send event effect!", entry, sp->Name); _spells.insert(HandleDummySpellMap::value_type(entry, callback)); } void ScriptMgr::register_gossip_script(uint32 entry, GossipScript* gs) { register_creature_gossip(entry, gs); } void ScriptMgr::register_go_gossip_script(uint32 entry, GossipScript* gs) { register_go_gossip(entry, gs); } void ScriptMgr::register_quest_script(uint32 entry, QuestScript* qs) { Quest* q = QuestStorage.LookupEntry(entry); if(q != NULL) { if(q->pQuestScript != NULL) LOG_DETAIL("ERROR: ScriptMgr is trying to register a script for Quest ID: %u even if there's already one for that Quest. Remove one of those scripts.", entry); q->pQuestScript = qs; } _questscripts.insert(qs); } void ScriptMgr::register_instance_script(uint32 pMapId, exp_create_instance_ai pCallback) { if(mInstances.find(pMapId) != mInstances.end()) LOG_DETAIL("ERROR: ScriptMgr is trying to register a script for Instance ID: %u even if there's already one for that Instance. Remove one of those scripts.", pMapId); mInstances.insert(InstanceCreateMap::value_type(pMapId, pCallback)); }; void ScriptMgr::register_creature_script(uint32* entries, exp_create_creature_ai callback) { for(uint32 y = 0; entries[y] != 0; y++) { register_creature_script(entries[y], callback); } }; void ScriptMgr::register_gameobject_script(uint32* entries, exp_create_gameobject_ai callback) { for(uint32 y = 0; entries[y] != 0; y++) { register_gameobject_script(entries[y], callback); } }; void ScriptMgr::register_dummy_aura(uint32* entries, exp_handle_dummy_aura callback) { for(uint32 y = 0; entries[y] != 0; y++) { register_dummy_aura(entries[y], callback); } }; void ScriptMgr::register_dummy_spell(uint32* entries, exp_handle_dummy_spell callback) { for(uint32 y = 0; entries[y] != 0; y++) { register_dummy_spell(entries[y], callback); } }; void ScriptMgr::register_script_effect(uint32* entries, exp_handle_script_effect callback) { for(uint32 y = 0; entries[y] != 0; y++) { register_script_effect(entries[y], callback); } }; void ScriptMgr::register_script_effect(uint32 entry, exp_handle_script_effect callback) { HandleScriptEffectMap::iterator itr = SpellScriptEffects.find(entry); if(itr != SpellScriptEffects.end()) { LOG_DETAIL("ERROR: ScriptMgr tried to register more than 1 script effect handlers for Spell %u", entry); return; } SpellEntry* sp = dbcSpell.LookupEntryForced(entry); if(sp == NULL) { LOG_DETAIL("ERROR: ScriptMgr tried to register a script effect handler for Spell %u, which is invalid.", entry); return; } if(!sp->HasEffect(SPELL_EFFECT_SCRIPT_EFFECT) && !sp->HasEffect(SPELL_EFFECT_SEND_EVENT)) LOG_DETAIL("ERROR: ScriptMgr has registered a script effect handler for Spell ID: %u ( %s ), but spell has no scripted effect!", entry, sp->Name); SpellScriptEffects.insert(std::pair< uint32, exp_handle_script_effect >(entry, callback)); } CreatureAIScript* ScriptMgr::CreateAIScriptClassForEntry(Creature* pCreature) { CreatureCreateMap::iterator itr = _creatures.find(pCreature->GetEntry()); if(itr == _creatures.end()) return NULL; exp_create_creature_ai function_ptr = itr->second; return (function_ptr)(pCreature); } GameObjectAIScript* ScriptMgr::CreateAIScriptClassForGameObject(uint32 uEntryId, GameObject* pGameObject) { GameObjectCreateMap::iterator itr = _gameobjects.find(pGameObject->GetEntry()); if(itr == _gameobjects.end()) return NULL; exp_create_gameobject_ai function_ptr = itr->second; return (function_ptr)(pGameObject); } InstanceScript* ScriptMgr::CreateScriptClassForInstance(uint32 pMapId, MapMgr* pMapMgr) { InstanceCreateMap::iterator Iter = mInstances.find(pMapMgr->GetMapId()); if(Iter == mInstances.end()) return NULL; exp_create_instance_ai function_ptr = Iter->second; return (function_ptr)(pMapMgr); }; bool ScriptMgr::CallScriptedDummySpell(uint32 uSpellId, uint32 i, Spell* pSpell) { HandleDummySpellMap::iterator itr = _spells.find(uSpellId); if(itr == _spells.end()) return false; exp_handle_dummy_spell function_ptr = itr->second; return (function_ptr)(i, pSpell); } bool ScriptMgr::HandleScriptedSpellEffect(uint32 SpellId, uint32 i, Spell* s) { HandleScriptEffectMap::iterator itr = SpellScriptEffects.find(SpellId); if(itr == SpellScriptEffects.end()) return false; exp_handle_script_effect ptr = itr->second; return (ptr)(i, s); } bool ScriptMgr::CallScriptedDummyAura(uint32 uSpellId, uint32 i, Aura* pAura, bool apply) { HandleDummyAuraMap::iterator itr = _auras.find(uSpellId); if(itr == _auras.end()) return false; exp_handle_dummy_aura function_ptr = itr->second; return (function_ptr)(i, pAura, apply); } bool ScriptMgr::CallScriptedItem(Item* pItem, Player* pPlayer) { Arcemu::Gossip::Script* script = this->get_item_gossip(pItem->GetEntry()); if(script != NULL) { script->OnHello(pItem, pPlayer); return true; } return false; } void ScriptMgr::register_item_gossip_script(uint32 entry, GossipScript* gs) { register_item_gossip(entry, gs); } /* CreatureAI Stuff */ CreatureAIScript::CreatureAIScript(Creature* creature) : _unit(creature), linkedCreatureAI(NULL) { } CreatureAIScript::~CreatureAIScript() { //notify our linked creature that we are being deleted. if(linkedCreatureAI != NULL) linkedCreatureAI->LinkedCreatureDeleted(); } void CreatureAIScript::RegisterAIUpdateEvent(uint32 frequency) { //sEventMgr.AddEvent(_unit, &Creature::CallScriptUpdate, EVENT_SCRIPT_UPDATE_EVENT, frequency, 0,0); sEventMgr.AddEvent(_unit, &Creature::CallScriptUpdate, EVENT_SCRIPT_UPDATE_EVENT, frequency, 0, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT); } void CreatureAIScript::ModifyAIUpdateEvent(uint32 newfrequency) { sEventMgr.ModifyEventTimeAndTimeLeft(_unit, EVENT_SCRIPT_UPDATE_EVENT, newfrequency); } void CreatureAIScript::RemoveAIUpdateEvent() { sEventMgr.RemoveEvents(_unit, EVENT_SCRIPT_UPDATE_EVENT); } void CreatureAIScript::LinkedCreatureDeleted() { linkedCreatureAI = NULL; } void CreatureAIScript::SetLinkedCreature(CreatureAIScript* creatureAI) { //notify our linked creature that we are not more linked if(linkedCreatureAI != NULL) linkedCreatureAI->LinkedCreatureDeleted(); //link to the new creature linkedCreatureAI = creatureAI; } bool CreatureAIScript::IsAlive() { return _unit->isAlive(); } /* GameObjectAI Stuff */ GameObjectAIScript::GameObjectAIScript(GameObject* goinstance) : _gameobject(goinstance) { } void GameObjectAIScript::ModifyAIUpdateEvent(uint32 newfrequency) { sEventMgr.ModifyEventTimeAndTimeLeft(_gameobject, EVENT_SCRIPT_UPDATE_EVENT, newfrequency); } void GameObjectAIScript::RemoveAIUpdateEvent() { sEventMgr.RemoveEvents(_gameobject, EVENT_SCRIPT_UPDATE_EVENT); } void GameObjectAIScript::RegisterAIUpdateEvent(uint32 frequency) { sEventMgr.AddEvent(_gameobject, &GameObject::CallScriptUpdate, EVENT_SCRIPT_UPDATE_EVENT, frequency, 0, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT); } /* InstanceAI Stuff */ InstanceScript::InstanceScript(MapMgr* pMapMgr) : mInstance(pMapMgr) { }; void InstanceScript::RegisterUpdateEvent(uint32 pFrequency) { sEventMgr.AddEvent(mInstance, &MapMgr::CallScriptUpdate, EVENT_SCRIPT_UPDATE_EVENT, pFrequency, 0, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT); }; void InstanceScript::ModifyUpdateEvent(uint32 pNewFrequency) { sEventMgr.ModifyEventTimeAndTimeLeft(mInstance, EVENT_SCRIPT_UPDATE_EVENT, pNewFrequency); }; void InstanceScript::RemoveUpdateEvent() { sEventMgr.RemoveEvents(mInstance, EVENT_SCRIPT_UPDATE_EVENT); }; /* Hook Stuff */ void ScriptMgr::register_hook(ServerHookEvents event, void* function_pointer) { ARCEMU_ASSERT(event < NUM_SERVER_HOOKS); _hooks[event].insert(function_pointer); } bool ScriptMgr::has_creature_script(uint32 entry) const { return (_creatures.find(entry) != _creatures.end()); } bool ScriptMgr::has_gameobject_script(uint32 entry) const { return (_gameobjects.find(entry) != _gameobjects.end()); } bool ScriptMgr::has_dummy_aura_script(uint32 entry) const { return (_auras.find(entry) != _auras.end()); } bool ScriptMgr::has_dummy_spell_script(uint32 entry) const { return (_spells.find(entry) != _spells.end()); } bool ScriptMgr::has_script_effect(uint32 entry) const { return (SpellScriptEffects.find(entry) != SpellScriptEffects.end()); } bool ScriptMgr::has_instance_script(uint32 id) const { return (mInstances.find(id) != mInstances.end()); } bool ScriptMgr::has_hook(ServerHookEvents evt, void* ptr) const { return (_hooks[evt].size() != 0 && _hooks[evt].find(ptr) != _hooks[evt].end()); } bool ScriptMgr::has_quest_script(uint32 entry) const { Quest* q = QuestStorage.LookupEntry(entry); return (q == NULL || q->pQuestScript != NULL); } void ScriptMgr::register_creature_gossip(uint32 entry, Arcemu::Gossip::Script* script) { GossipMap::iterator itr = creaturegossip_.find(entry); if(itr == creaturegossip_.end()) creaturegossip_.insert(make_pair(entry, script)); //keeping track of all created gossips to delete them all on shutdown _customgossipscripts.insert(script); } bool ScriptMgr::has_creature_gossip(uint32 entry) const { return creaturegossip_.find(entry) != creaturegossip_.end(); } Arcemu::Gossip::Script* ScriptMgr::get_creature_gossip(uint32 entry) const { GossipMap::const_iterator itr = creaturegossip_.find(entry); if(itr != creaturegossip_.end()) return itr->second; return NULL; } void ScriptMgr::register_item_gossip(uint32 entry, Arcemu::Gossip::Script* script) { GossipMap::iterator itr = itemgossip_.find(entry); if(itr == itemgossip_.end()) itemgossip_.insert(make_pair(entry, script)); //keeping track of all created gossips to delete them all on shutdown _customgossipscripts.insert(script); } void ScriptMgr::register_go_gossip(uint32 entry, Arcemu::Gossip::Script* script) { GossipMap::iterator itr = gogossip_.find(entry); if(itr == gogossip_.end()) gogossip_.insert(make_pair(entry, script)); //keeping track of all created gossips to delete them all on shutdown _customgossipscripts.insert(script); } bool ScriptMgr::has_item_gossip(uint32 entry) const { return itemgossip_.find(entry) != itemgossip_.end(); } bool ScriptMgr::has_go_gossip(uint32 entry) const { return gogossip_.find(entry) != gogossip_.end(); } Arcemu::Gossip::Script* ScriptMgr::get_go_gossip(uint32 entry) const { GossipMap::const_iterator itr = gogossip_.find(entry); if(itr != gogossip_.end()) return itr->second; return NULL; } Arcemu::Gossip::Script* ScriptMgr::get_item_gossip(uint32 entry) const { GossipMap::const_iterator itr = itemgossip_.find(entry); if(itr != itemgossip_.end()) return itr->second; return NULL; } void ScriptMgr::ReloadScriptEngines() { //for all scripting engines that allow reloading, assuming there will be new scripting engines. exp_get_script_type version_function; exp_engine_reload engine_reloadfunc; for(DynamicLibraryMap::iterator itr = dynamiclibs.begin(); itr != dynamiclibs.end(); ++itr) { Arcemu::DynLib* dl = *itr; version_function = reinterpret_cast< exp_get_script_type >(dl->GetAddressForSymbol("_exp_get_script_type")); if(version_function == NULL) continue; if((version_function() & SCRIPT_TYPE_SCRIPT_ENGINE) != 0) { engine_reloadfunc = reinterpret_cast< exp_engine_reload >(dl->GetAddressForSymbol("_export_engine_reload")); if(engine_reloadfunc != NULL) engine_reloadfunc(); } } } void ScriptMgr::UnloadScriptEngines() { //for all scripting engines that allow unloading, assuming there will be new scripting engines. exp_get_script_type version_function; exp_engine_unload engine_unloadfunc; for(DynamicLibraryMap::iterator itr = dynamiclibs.begin(); itr != dynamiclibs.end(); ++itr) { Arcemu::DynLib* dl = *itr; version_function = reinterpret_cast< exp_get_script_type >(dl->GetAddressForSymbol("_exp_get_script_type")); if(version_function == NULL) continue; if((version_function() & SCRIPT_TYPE_SCRIPT_ENGINE) != 0) { engine_unloadfunc = reinterpret_cast< exp_engine_unload >(dl->GetAddressForSymbol("_exp_engine_unload")); if(engine_unloadfunc != NULL) engine_unloadfunc(); } } } //support for Gossip scripts added before r4106 changes void GossipScript::OnHello(Object* pObject, Player* Plr) { GossipHello(pObject, Plr); } void GossipScript::OnSelectOption(Object* pObject, Player* Plr, uint32 Id, const char* EnteredCode) { uint32 IntId = Id; if(Plr->CurrentGossipMenu != NULL) { GossipMenuItem item = Plr->CurrentGossipMenu->GetItem(Id); IntId = item.IntId; } GossipSelectOption(pObject, Plr, Id , IntId, EnteredCode); } void GossipScript::OnEnd(Object* pObject, Player* Plr) { GossipEnd(pObject, Plr); } /* Hook Implementations */ bool HookInterface::OnNewCharacter(uint32 Race, uint32 Class, WorldSession* Session, const char* Name) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_NEW_CHARACTER]; bool ret_val = true; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) { bool rv = ((tOnNewCharacter) * itr)(Race, Class, Session, Name); if(rv == false) // never set ret_val back to true, once it's false ret_val = false; } return ret_val; } void HookInterface::OnKillPlayer(Player* pPlayer, Player* pVictim) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_KILL_PLAYER]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnKillPlayer)*itr)(pPlayer, pVictim); } void HookInterface::OnFirstEnterWorld(Player* pPlayer) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_FIRST_ENTER_WORLD]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnFirstEnterWorld)*itr)(pPlayer); } void HookInterface::OnCharacterCreate(Player* pPlayer) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_CHARACTER_CREATE]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOCharacterCreate)*itr)(pPlayer); } void HookInterface::OnEnterWorld(Player* pPlayer) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_ENTER_WORLD]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnEnterWorld)*itr)(pPlayer); } void HookInterface::OnGuildCreate(Player* pLeader, Guild* pGuild) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_GUILD_CREATE]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnGuildCreate)*itr)(pLeader, pGuild); } void HookInterface::OnGuildJoin(Player* pPlayer, Guild* pGuild) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_GUILD_JOIN]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnGuildJoin)*itr)(pPlayer, pGuild); } void HookInterface::OnDeath(Player* pPlayer) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_DEATH]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnDeath)*itr)(pPlayer); } bool HookInterface::OnRepop(Player* pPlayer) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_REPOP]; bool ret_val = true; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) { bool rv = ((tOnRepop) * itr)(pPlayer); if(rv == false) // never set ret_val back to true, once it's false ret_val = false; } return ret_val; } void HookInterface::OnEmote(Player* pPlayer, uint32 Emote, Unit* pUnit) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_EMOTE]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnEmote)*itr)(pPlayer, Emote, pUnit); } void HookInterface::OnEnterCombat(Player* pPlayer, Unit* pTarget) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_ENTER_COMBAT]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnEnterCombat)*itr)(pPlayer, pTarget); } bool HookInterface::OnCastSpell(Player* pPlayer, SpellEntry* pSpell, Spell* spell) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_CAST_SPELL]; bool ret_val = true; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) { bool rv = ((tOnCastSpell) * itr)(pPlayer, pSpell, spell); if(rv == false) // never set ret_val back to true, once it's false ret_val = false; } return ret_val; } bool HookInterface::OnLogoutRequest(Player* pPlayer) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_LOGOUT_REQUEST]; bool ret_val = true; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) { bool rv = ((tOnLogoutRequest) * itr)(pPlayer); if(rv == false) // never set ret_val back to true, once it's false ret_val = false; } return ret_val; } void HookInterface::OnLogout(Player* pPlayer) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_LOGOUT]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnLogout)*itr)(pPlayer); } void HookInterface::OnQuestAccept(Player* pPlayer, Quest* pQuest, Object* pQuestGiver) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_QUEST_ACCEPT]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnQuestAccept)*itr)(pPlayer, pQuest, pQuestGiver); } void HookInterface::OnZone(Player* pPlayer, uint32 zone, uint32 oldZone) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_ZONE]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnZone)*itr)(pPlayer, zone, oldZone); } bool HookInterface::OnChat(Player* pPlayer, uint32 type, uint32 lang, const char* message, const char* misc) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_CHAT]; bool ret_val = true; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) { bool rv = ((tOnChat) * itr)(pPlayer, type, lang, message, misc); if(rv == false) // never set ret_val back to true, once it's false ret_val = false; } return ret_val; } void HookInterface::OnLoot(Player* pPlayer, Unit* pTarget, uint32 money, uint32 itemId) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_LOOT]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnLoot)*itr)(pPlayer, pTarget, money, itemId); } void HookInterface::OnObjectLoot(Player* pPlayer, Object* pTarget, uint32 money, uint32 itemId) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_OBJECTLOOT]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnObjectLoot)*itr)(pPlayer, pTarget, money, itemId); } void HookInterface::OnFullLogin(Player* pPlayer) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_FULL_LOGIN]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnEnterWorld)*itr)(pPlayer); } void HookInterface::OnQuestCancelled(Player* pPlayer, Quest* pQuest) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_QUEST_CANCELLED]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnQuestCancel)*itr)(pPlayer, pQuest); } void HookInterface::OnQuestFinished(Player* pPlayer, Quest* pQuest, Object* pQuestGiver) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_QUEST_FINISHED]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnQuestFinished)*itr)(pPlayer, pQuest, pQuestGiver); } void HookInterface::OnHonorableKill(Player* pPlayer, Player* pKilled) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_HONORABLE_KILL]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnHonorableKill)*itr)(pPlayer, pKilled); } void HookInterface::OnArenaFinish(Player* pPlayer, ArenaTeam* pTeam, bool victory, bool rated) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_ARENA_FINISH]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnArenaFinish)*itr)(pPlayer, pTeam, victory, rated); } void HookInterface::OnAreaTrigger(Player* pPlayer, uint32 areaTrigger) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_AREATRIGGER]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnAreaTrigger)*itr)(pPlayer, areaTrigger); } void HookInterface::OnPostLevelUp(Player* pPlayer) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_POST_LEVELUP]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnPostLevelUp)*itr)(pPlayer); } bool HookInterface::OnPreUnitDie(Unit* killer, Unit* victim) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_PRE_DIE]; bool ret_val = true; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) { bool rv = ((tOnPreUnitDie) * itr)(killer, victim); if(rv == false) // never set ret_val back to true, once it's false ret_val = false; } return ret_val; } void HookInterface::OnAdvanceSkillLine(Player* pPlayer, uint32 skillLine, uint32 current) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_ADVANCE_SKILLLINE]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnAdvanceSkillLine)*itr)(pPlayer, skillLine, current); } void HookInterface::OnDuelFinished(Player* Winner, Player* Looser) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_DUEL_FINISHED]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnDuelFinished)*itr)(Winner, Looser); } void HookInterface::OnAuraRemove(Aura* aura) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_AURA_REMOVE]; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) ((tOnAuraRemove)*itr)(aura); } bool HookInterface::OnResurrect(Player* pPlayer) { ServerHookList hookList = sScriptMgr._hooks[SERVER_HOOK_EVENT_ON_RESURRECT]; bool ret_val = true; for(ServerHookList::iterator itr = hookList.begin(); itr != hookList.end(); ++itr) { bool rv = ((tOnResurrect) * itr)(pPlayer); if(rv == false) // never set ret_val back to true, once it's false ret_val = false; } return ret_val; }
dberga/arcbliz
src/arcemu-world/ScriptMgr.cpp
C++
agpl-3.0
34,035
# -*- coding: utf-8 -*- from __future__ import unicode_literals import sys from intelmq.lib import utils from intelmq.lib.bot import Bot from intelmq.lib.message import Event class MalwareGroupIPsParserBot(Bot): def process(self): report = self.receive_message() if not report: self.acknowledge_message() return if not report.contains("raw"): self.acknowledge_message() raw_report = utils.base64_decode(report.value("raw")) raw_report = raw_report.split("<tbody>")[1] raw_report = raw_report.split("</tbody>")[0] raw_report_splitted = raw_report.split("<tr>") for row in raw_report_splitted: row = row.strip() if row == "": continue row_splitted = row.split("<td>") ip = row_splitted[1].split('">')[1].split("<")[0].strip() time_source = row_splitted[6].replace("</td></tr>", "").strip() time_source = time_source + " 00:00:00 UTC" event = Event(report) event.add('time.source', time_source, sanitize=True) event.add('classification.type', u'malware') event.add('source.ip', ip, sanitize=True) event.add('raw', row, sanitize=True) self.send_message(event) self.acknowledge_message() if __name__ == "__main__": bot = MalwareGroupIPsParserBot(sys.argv[1]) bot.start()
sch3m4/intelmq
intelmq/bots/parsers/malwaregroup/parser_ips.py
Python
agpl-3.0
1,460
group :test do gem 'testingbot', require: false gem 'testbot', github: 'smeredith0506/testbot', branch: 'master', ref: '47fbf057ab40f8a6e24b1ae780c3f1a176621892' gem 'simplecov', '0.9.2', require: false gem 'docile', '1.1.3', require: false gem 'simplecov-rcov', '0.2.3', require: false gem 'bluecloth', '2.2.0' # for generating api docs gem 'redcarpet', '3.2.3', require: false gem 'github-markdown', '0.6.8', require: false gem 'bullet_instructure', '4.14.8', require: 'bullet' gem 'mocha', github: 'maneframe/mocha', ref: 'bb8813fbb4cc589d7c58073d93983722d61b6919', require: false gem 'metaclass', '0.0.2', require: false gem 'thin', '1.6.3' gem 'eventmachine', '1.0.4', require: false gem 'rspec', '3.2.0' gem 'rspec-rails', '3.2.3' gem 'rspec-legacy_formatters', '1.0.0' gem 'rspec-collection_matchers', '1.1.2' gem 'rubocop', require: false gem 'rubocop-rspec', require: false gem 'rubocop-canvas', require: false, path: 'gems/rubocop-canvas' gem 'once-ler', '0.0.15' gem 'sequel', '4.5.0', require: false gem 'selenium-webdriver', '2.43.0' gem 'childprocess', '0.5.0', require: false gem 'websocket', '1.0.7', require: false gem 'test_after_commit', '0.4.0' gem 'test-unit', '~> 3.0', require: false, platform: :ruby_22 gem 'webmock', '1.16.1', require: false gem 'addressable', '2.3.5', require: false gem 'crack', '0.4.1', require: false gem 'yard', '0.8.7.6' gem 'yard-appendix', '>=0.1.8' gem 'timecop', '0.6.3' end
shidao-fm/canvas-lms
Gemfile.d/test.rb
Ruby
agpl-3.0
1,517
/* Copyright contributors as noted in the AUTHORS file. This file is part of PLATANOS. PLATANOS is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. PLATANOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "action.h" //action is only created by a received msg void action_minit (action_t ** action, char *key, zmsg_t * msg) { *action = calloc (1, sizeof (action_t)); memcpy ((*action)->key, key, 17); zframe_t *frame = zmsg_first (msg); memcpy (&((*action)->start), zframe_data (frame), zframe_size (frame)); frame = zmsg_next (msg); memcpy (&((*action)->end), zframe_data (frame), zframe_size (frame)); }
xekoukou/platanos
action.c
C
agpl-3.0
1,240
/** * @license MIT */ (function(window, document, undefined) {'use strict'; /** * Flow.js is a library providing multiple simultaneous, stable and * resumable uploads via the HTML5 File API. * @param [opts] * @param {number} [opts.chunkSize] * @param {bool} [opts.forceChunkSize] * @param {number} [opts.simultaneousUploads] * @param {bool} [opts.singleFile] * @param {string} [opts.fileParameterName] * @param {number} [opts.progressCallbacksInterval] * @param {number} [opts.speedSmoothingFactor] * @param {Object|Function} [opts.query] * @param {Object} [opts.headers] * @param {bool} [opts.withCredentials] * @param {Function} [opts.preprocess] * @param {string} [opts.method] * @param {bool} [opts.prioritizeFirstAndLastChunk] * @param {string} [opts.target] * @param {number} [opts.maxChunkRetries] * @param {number} [opts.chunkRetryInterval] * @param {Array.<number>} [opts.permanentErrors] * @param {Function} [opts.generateUniqueIdentifier] * @constructor */ function Flow(opts) { /** * Supported by browser? * @type {boolean} */ this.support = ( typeof File !== 'undefined' && typeof Blob !== 'undefined' && typeof FileList !== 'undefined' && ( !!Blob.prototype.slice || !!Blob.prototype.webkitSlice || !!Blob.prototype.mozSlice || false ) // slicing files support ); if (!this.support) { return ; } /** * Check if directory upload is supported * @type {boolean} */ this.supportDirectory = /WebKit/.test(window.navigator.userAgent); /** * List of FlowFile objects * @type {Array.<FlowFile>} */ this.files = []; /** * Default options for flow.js * @type {Object} */ this.defaults = { chunkSize: 1024 * 1024, forceChunkSize: false, simultaneousUploads: 3, singleFile: false, fileParameterName: 'file', progressCallbacksInterval: 500, speedSmoothingFactor: 0.1, query: {}, headers: {}, withCredentials: false, preprocess: null, method: 'multipart', prioritizeFirstAndLastChunk: false, target: '/', testChunks: true, generateUniqueIdentifier: null, maxChunkRetries: 0, chunkRetryInterval: null, permanentErrors: [404, 415, 500, 501] }; /** * Current options * @type {Object} */ this.opts = {}; /** * List of events: * key stands for event name * value array list of callbacks * @type {} */ this.events = {}; var $ = this; /** * On drop event * @function * @param {MouseEvent} event */ this.onDrop = function (event) { event.stopPropagation(); event.preventDefault(); var dataTransfer = event.dataTransfer; if (dataTransfer.items && dataTransfer.items[0] && dataTransfer.items[0].webkitGetAsEntry) { $.webkitReadDataTransfer(event); } else { $.addFiles(dataTransfer.files, event); } }; /** * Prevent default * @function * @param {MouseEvent} event */ this.preventEvent = function (event) { event.preventDefault(); }; /** * Current options * @type {Object} */ this.opts = Flow.extend({}, this.defaults, opts || {}); } Flow.prototype = { /** * Set a callback for an event, possible events: * fileSuccess(file), fileProgress(file), fileAdded(file, event), * fileRetry(file), fileError(file, message), complete(), * progress(), error(message, file), pause() * @function * @param {string} event * @param {Function} callback */ on: function (event, callback) { event = event.toLowerCase(); if (!this.events.hasOwnProperty(event)) { this.events[event] = []; } this.events[event].push(callback); }, /** * Remove event callback * @function * @param {string} [event] removes all events if not specified * @param {Function} [fn] removes all callbacks of event if not specified */ off: function (event, fn) { if (event !== undefined) { event = event.toLowerCase(); if (fn !== undefined) { if (this.events.hasOwnProperty(event)) { arrayRemove(this.events[event], fn); } } else { delete this.events[event]; } } else { this.events = {}; } }, /** * Fire an event * @function * @param {string} event event name * @param {...} args arguments of a callback * @return {bool} value is false if at least one of the event handlers which handled this event * returned false. Otherwise it returns true. */ fire: function (event, args) { // `arguments` is an object, not array, in FF, so: args = Array.prototype.slice.call(arguments); event = event.toLowerCase(); var preventDefault = false; if (this.events.hasOwnProperty(event)) { each(this.events[event], function (callback) { preventDefault = callback.apply(this, args.slice(1)) === false || preventDefault; }); } if (event != 'catchall') { args.unshift('catchAll'); preventDefault = this.fire.apply(this, args) === false || preventDefault; } return !preventDefault; }, /** * Read webkit dataTransfer object * @param event */ webkitReadDataTransfer: function (event) { var $ = this; var queue = event.dataTransfer.items.length; var files = []; each(event.dataTransfer.items, function (item) { var entry = item.webkitGetAsEntry(); if (!entry) { decrement(); return ; } if (entry.isFile) { // due to a bug in Chrome's File System API impl - #149735 fileReadSuccess(item.getAsFile(), entry.fullPath); } else { entry.createReader().readEntries(readSuccess, readError); } }); function readSuccess(entries) { queue += entries.length; each(entries, function(entry) { if (entry.isFile) { var fullPath = entry.fullPath; entry.file(function (file) { fileReadSuccess(file, fullPath); }, readError); } else if (entry.isDirectory) { entry.createReader().readEntries(readSuccess, readError); } }); decrement(); } function fileReadSuccess(file, fullPath) { // relative path should not start with "/" file.relativePath = fullPath.substring(1); files.push(file); decrement(); } function readError(fileError) { throw fileError; } function decrement() { if (--queue == 0) { $.addFiles(files, event); } } }, /** * Generate unique identifier for a file * @function * @param {FlowFile} file * @returns {string} */ generateUniqueIdentifier: function (file) { var custom = this.opts.generateUniqueIdentifier; if (typeof custom === 'function') { return custom(file); } // Some confusion in different versions of Firefox var relativePath = file.relativePath || file.webkitRelativePath || file.fileName || file.name; return file.size + '-' + relativePath.replace(/[^0-9a-zA-Z_-]/img, ''); }, /** * Upload next chunk from the queue * @function * @returns {boolean} * @private */ uploadNextChunk: function (preventEvents) { // In some cases (such as videos) it's really handy to upload the first // and last chunk of a file quickly; this let's the server check the file's // metadata and determine if there's even a point in continuing. var found = false; if (this.opts.prioritizeFirstAndLastChunk) { each(this.files, function (file) { if (!file.paused && file.chunks.length && file.chunks[0].status() === 'pending' && file.chunks[0].preprocessState === 0) { file.chunks[0].send(); found = true; return false; } if (!file.paused && file.chunks.length > 1 && file.chunks[file.chunks.length - 1].status() === 'pending' && file.chunks[0].preprocessState === 0) { file.chunks[file.chunks.length - 1].send(); found = true; return false; } }); if (found) { return found; } } // Now, simply look for the next, best thing to upload each(this.files, function (file) { if (!file.paused) { each(file.chunks, function (chunk) { if (chunk.status() === 'pending' && chunk.preprocessState === 0) { chunk.send(); found = true; return false; } }); } if (found) { return false; } }); if (found) { return true; } // The are no more outstanding chunks to upload, check is everything is done var outstanding = false; each(this.files, function (file) { if (!file.isComplete()) { outstanding = true; return false; } }); if (!outstanding && !preventEvents) { // All chunks have been uploaded, complete this.fire('complete'); } return false; }, /** * Assign a browse action to one or more DOM nodes. * @function * @param {Element|Array.<Element>} domNodes * @param {boolean} isDirectory Pass in true to allow directories to * @param {boolean} singleFile prevent multi file upload * be selected (Chrome only). */ assignBrowse: function (domNodes, isDirectory, singleFile) { if (typeof domNodes.length === 'undefined') { domNodes = [domNodes]; } // We will create an <input> and overlay it on the domNode // (crappy, but since HTML5 doesn't have a cross-browser.browse() method // we haven't a choice. FF4+ allows click() for this though: // https://developer.mozilla.org/en/using_files_from_web_applications) each(domNodes, function (domNode) { var input; if (domNode.tagName === 'INPUT' && domNode.type === 'file') { input = domNode; } else { input = document.createElement('input'); input.setAttribute('type', 'file'); // input fill entire dom node extend(domNode.style, { display: 'inline-block', position: 'relative', overflow: 'hidden', verticalAlign: 'top' }); // in Opera only 'browse' button // is clickable and it is located at // the right side of the input extend(input.style, { position: 'absolute', top: 0, right: 0, fontFamily: 'Arial', // 4 persons reported this, the max values that worked for them were 243, 236, 236, 118 fontSize: '118px', margin: 0, padding: 0, opacity: 0, cursor: 'pointer' }); domNode.appendChild(input); } if (!this.opts.singleFile && !singleFile) { input.setAttribute('multiple', 'multiple'); } if (isDirectory) { input.setAttribute('webkitdirectory', 'webkitdirectory'); } // When new files are added, simply append them to the overall list var $ = this; input.addEventListener('change', function (e) { $.addFiles(e.target.files, e); e.target.value = ''; }, false); }, this); }, /** * Assign one or more DOM nodes as a drop target. * @function * @param {Element|Array.<Element>} domNodes */ assignDrop: function (domNodes) { if (typeof domNodes.length === 'undefined') { domNodes = [domNodes]; } each(domNodes, function (domNode) { domNode.addEventListener('dragover', this.preventEvent, false); domNode.addEventListener('dragenter', this.preventEvent, false); domNode.addEventListener('drop', this.onDrop, false); }, this); }, /** * Un-assign drop event from DOM nodes * @function * @param domNodes */ unAssignDrop: function (domNodes) { if (typeof domNodes.length === 'undefined') { domNodes = [domNodes]; } each(domNodes, function (domNode) { domNode.removeEventListener('dragover', this.preventEvent); domNode.removeEventListener('dragenter', this.preventEvent); domNode.removeEventListener('drop', this.onDrop); }, this); }, /** * Returns a boolean indicating whether or not the instance is currently * uploading anything. * @function * @returns {boolean} */ isUploading: function () { var uploading = false; each(this.files, function (file) { if (file.isUploading()) { uploading = true; return false; } }); return uploading; }, /** * Start or resume uploading. * @function */ upload: function () { // Make sure we don't start too many uploads at once if (this.isUploading()) { return; } // Kick off the queue this.fire('uploadStart'); var started = false; for (var num = 1; num <= this.opts.simultaneousUploads; num++) { started = this.uploadNextChunk(true) || started; } if (!started) { this.fire('complete'); } }, /** * Resume uploading. * @function */ resume: function () { each(this.files, function (file) { file.resume(); }); }, /** * Pause uploading. * @function */ pause: function () { each(this.files, function (file) { file.pause(); }); }, /** * Cancel upload of all FlowFile objects and remove them from the list. * @function */ cancel: function () { for (var i = this.files.length - 1; i >= 0; i--) { this.files[i].cancel(); } }, /** * Returns a number between 0 and 1 indicating the current upload progress * of all files. * @function * @returns {number} */ progress: function () { var totalDone = 0; var totalSize = 0; // Resume all chunks currently being uploaded each(this.files, function (file) { totalDone += file.progress() * file.size; totalSize += file.size; }); return totalSize > 0 ? totalDone / totalSize : 0; }, /** * Add a HTML5 File object to the list of files. * @function * @param {File} file * @param {Event} [event] event is optional */ addFile: function (file, event) { this.addFiles([file], event); }, /** * Add a HTML5 File object to the list of files. * @function * @param {FileList|Array} fileList * @param {Event} [event] event is optional */ addFiles: function (fileList, event) { var files = []; each(fileList, function (file) { // Directories have size `0` and name `.` // Ignore already added files if (!(file.size % 4096 === 0 && (file.name === '.' || file.fileName === '.')) && !this.getFromUniqueIdentifier(this.generateUniqueIdentifier(file))) { var f = new FlowFile(this, file); if (this.fire('fileAdded', f, event)) { files.push(f); } } }, this); if (this.fire('filesAdded', files, event)) { each(files, function (file) { if (this.opts.singleFile && this.files.length > 0) { this.removeFile(this.files[0]); } this.files.push(file); }, this); } this.fire('filesSubmitted', files, event); }, /** * Cancel upload of a specific FlowFile object from the list. * @function * @param {FlowFile} file */ removeFile: function (file) { for (var i = this.files.length - 1; i >= 0; i--) { if (this.files[i] === file) { this.files.splice(i, 1); file.abort(); } } }, /** * Look up a FlowFile object by its unique identifier. * @function * @param {string} uniqueIdentifier * @returns {boolean|FlowFile} false if file was not found */ getFromUniqueIdentifier: function (uniqueIdentifier) { var ret = false; each(this.files, function (file) { if (file.uniqueIdentifier === uniqueIdentifier) { ret = file; } }); return ret; }, /** * Returns the total size of all files in bytes. * @function * @returns {number} */ getSize: function () { var totalSize = 0; each(this.files, function (file) { totalSize += file.size; }); return totalSize; }, /** * Returns the total size uploaded of all files in bytes. * @function * @returns {number} */ sizeUploaded: function () { var size = 0; each(this.files, function (file) { size += file.sizeUploaded(); }); return size; }, /** * Returns remaining time to upload all files in seconds. Accuracy is based on average speed. * If speed is zero, time remaining will be equal to positive infinity `Number.POSITIVE_INFINITY` * @function * @returns {number} */ timeRemaining: function () { var sizeDelta = 0; var averageSpeed = 0; each(this.files, function (file) { if (!file.paused && !file.error) { sizeDelta += file.size - file.sizeUploaded(); averageSpeed += file.averageSpeed; } }); if (sizeDelta && !averageSpeed) { return Number.POSITIVE_INFINITY; } if (!sizeDelta && !averageSpeed) { return 0; } return Math.floor(sizeDelta / averageSpeed); } }; /** * FlowFile class * @name FlowFile * @param {Flow} flowObj * @param {File} file * @constructor */ function FlowFile(flowObj, file) { /** * Reference to parent Flow instance * @type {Flow} */ this.flowObj = flowObj; /** * Reference to file * @type {File} */ this.file = file; /** * File name. Some confusion in different versions of Firefox * @type {string} */ this.name = file.fileName || file.name; /** * File size * @type {number} */ this.size = file.size; /** * Relative file path * @type {string} */ this.relativePath = file.relativePath || file.webkitRelativePath || this.name; /** * File unique identifier * @type {string} */ this.uniqueIdentifier = flowObj.generateUniqueIdentifier(file); /** * List of chunks * @type {Array.<FlowChunk>} */ this.chunks = []; /** * Indicated if file is paused * @type {boolean} */ this.paused = false; /** * Indicated if file has encountered an error * @type {boolean} */ this.error = false; /** * Average upload speed * @type {number} */ this.averageSpeed = 0; /** * Current upload speed * @type {number} */ this.currentSpeed = 0; /** * Date then progress was called last time * @type {number} * @private */ this._lastProgressCallback = Date.now(); /** * Previously uploaded file size * @type {number} * @private */ this._prevUploadedSize = 0; /** * Holds previous progress * @type {number} * @private */ this._prevProgress = 0; this.bootstrap(); } FlowFile.prototype = { /** * Update speed parameters * @link http://stackoverflow.com/questions/2779600/how-to-estimate-download-time-remaining-accurately * @function */ measureSpeed: function () { var timeSpan = Date.now() - this._lastProgressCallback; if (!timeSpan) { return ; } var smoothingFactor = this.flowObj.opts.speedSmoothingFactor; var uploaded = this.sizeUploaded(); // Prevent negative upload speed after file upload resume this.currentSpeed = Math.max((uploaded - this._prevUploadedSize) / timeSpan * 1000, 0); this.averageSpeed = smoothingFactor * this.currentSpeed + (1 - smoothingFactor) * this.averageSpeed; this._prevUploadedSize = uploaded; }, /** * For internal usage only. * Callback when something happens within the chunk. * @function * @param {string} event can be 'progress', 'success', 'error' or 'retry' * @param {string} [message] */ chunkEvent: function (event, message) { switch (event) { case 'progress': if (Date.now() - this._lastProgressCallback < this.flowObj.opts.progressCallbacksInterval) { break; } this.measureSpeed(); this.flowObj.fire('fileProgress', this); this.flowObj.fire('progress'); this._lastProgressCallback = Date.now(); break; case 'error': this.error = true; this.abort(true); this.flowObj.fire('fileError', this, message); this.flowObj.fire('error', message, this); break; case 'success': if (this.error) { return; } this.measureSpeed(); this.flowObj.fire('fileProgress', this); this.flowObj.fire('progress'); this._lastProgressCallback = Date.now(); if (this.isComplete()) { this.currentSpeed = 0; this.averageSpeed = 0; this.flowObj.fire('fileSuccess', this, message); } break; case 'retry': this.flowObj.fire('fileRetry', this); break; } }, /** * Pause file upload * @function */ pause: function() { this.paused = true; this.abort(); }, /** * Resume file upload * @function */ resume: function() { this.paused = false; this.flowObj.upload(); }, /** * Abort current upload * @function */ abort: function (reset) { this.currentSpeed = 0; this.averageSpeed = 0; var chunks = this.chunks; if (reset) { this.chunks = []; } each(chunks, function (c) { if (c.status() === 'uploading') { c.abort(); this.flowObj.uploadNextChunk(); } }, this); }, /** * Cancel current upload and remove from a list * @function */ cancel: function () { this.flowObj.removeFile(this); }, /** * Retry aborted file upload * @function */ retry: function () { this.bootstrap(); this.flowObj.upload(); }, /** * Clear current chunks and slice file again * @function */ bootstrap: function () { this.abort(true); this.error = false; // Rebuild stack of chunks from file this._prevProgress = 0; var round = this.flowObj.opts.forceChunkSize ? Math.ceil : Math.floor; var chunks = Math.max( round(this.file.size / this.flowObj.opts.chunkSize), 1 ); for (var offset = 0; offset < chunks; offset++) { this.chunks.push( new FlowChunk(this.flowObj, this, offset) ); } }, /** * Get current upload progress status * @function * @returns {number} from 0 to 1 */ progress: function () { if (this.error) { return 1; } if (this.chunks.length === 1) { this._prevProgress = Math.max(this._prevProgress, this.chunks[0].progress()); return this._prevProgress; } // Sum up progress across everything var bytesLoaded = 0; each(this.chunks, function (c) { // get chunk progress relative to entire file bytesLoaded += c.progress() * (c.endByte - c.startByte); }); var percent = bytesLoaded / this.size; // We don't want to lose percentages when an upload is paused this._prevProgress = Math.max(this._prevProgress, percent > 0.999 ? 1 : percent); return this._prevProgress; }, /** * Indicates if file is being uploaded at the moment * @function * @returns {boolean} */ isUploading: function () { var uploading = false; each(this.chunks, function (chunk) { if (chunk.status() === 'uploading') { uploading = true; return false; } }); return uploading; }, /** * Indicates if file is has finished uploading and received a response * @function * @returns {boolean} */ isComplete: function () { var outstanding = false; each(this.chunks, function (chunk) { var status = chunk.status(); if (status === 'pending' || status === 'uploading' || chunk.preprocessState === 1) { outstanding = true; return false; } }); return !outstanding; }, /** * Count total size uploaded * @function * @returns {number} */ sizeUploaded: function () { var size = 0; each(this.chunks, function (chunk) { size += chunk.sizeUploaded(); }); return size; }, /** * Returns remaining time to finish upload file in seconds. Accuracy is based on average speed. * If speed is zero, time remaining will be equal to positive infinity `Number.POSITIVE_INFINITY` * @function * @returns {number} */ timeRemaining: function () { if (this.paused || this.error) { return 0; } var delta = this.size - this.sizeUploaded(); if (delta && !this.averageSpeed) { return Number.POSITIVE_INFINITY; } if (!delta && !this.averageSpeed) { return 0; } return Math.floor(delta / this.averageSpeed); }, /** * Get file type * @function * @returns {string} */ getType: function () { return this.file.type && this.file.type.split('/')[1]; }, /** * Get file extension * @function * @returns {string} */ getExtension: function () { return this.name.substr((~-this.name.lastIndexOf(".") >>> 0) + 2).toLowerCase(); } }; /** * Class for storing a single chunk * @name FlowChunk * @param {Flow} flowObj * @param {FlowFile} fileObj * @param {number} offset * @constructor */ function FlowChunk(flowObj, fileObj, offset) { /** * Reference to parent flow object * @type {Flow} */ this.flowObj = flowObj; /** * Reference to parent FlowFile object * @type {FlowFile} */ this.fileObj = fileObj; /** * File size * @type {number} */ this.fileObjSize = fileObj.size; /** * File offset * @type {number} */ this.offset = offset; /** * Indicates if chunk existence was checked on the server * @type {boolean} */ this.tested = false; /** * Number of retries performed * @type {number} */ this.retries = 0; /** * Pending retry * @type {boolean} */ this.pendingRetry = false; /** * Preprocess state * @type {number} 0 = unprocessed, 1 = processing, 2 = finished */ this.preprocessState = 0; /** * Bytes transferred from total request size * @type {number} */ this.loaded = 0; /** * Total request size * @type {number} */ this.total = 0; /** * Size of a chunk * @type {number} */ var chunkSize = this.flowObj.opts.chunkSize; /** * Chunk start byte in a file * @type {number} */ this.startByte = this.offset * chunkSize; /** * Chunk end byte in a file * @type {number} */ this.endByte = Math.min(this.fileObjSize, (this.offset + 1) * chunkSize); /** * XMLHttpRequest * @type {XMLHttpRequest} */ this.xhr = null; if (this.fileObjSize - this.endByte < chunkSize && !this.flowObj.opts.forceChunkSize) { // The last chunk will be bigger than the chunk size, // but less than 2*chunkSize this.endByte = this.fileObjSize; } var $ = this; /** * Catch progress event * @param {ProgressEvent} event */ this.progressHandler = function(event) { if (event.lengthComputable) { $.loaded = event.loaded ; $.total = event.total; } $.fileObj.chunkEvent('progress'); }; /** * Catch test event * @param {Event} event */ this.testHandler = function(event) { var status = $.status(); if (status === 'success') { $.tested = true; $.fileObj.chunkEvent(status, $.message()); $.flowObj.uploadNextChunk(); } else if (!$.fileObj.paused) {// Error might be caused by file pause method $.tested = true; $.send(); } }; /** * Upload has stopped * @param {Event} event */ this.doneHandler = function(event) { var status = $.status(); if (status === 'success' || status === 'error') { $.fileObj.chunkEvent(status, $.message()); $.flowObj.uploadNextChunk(); } else { $.fileObj.chunkEvent('retry', $.message()); $.pendingRetry = true; $.abort(); $.retries++; var retryInterval = $.flowObj.opts.chunkRetryInterval; if (retryInterval !== null) { setTimeout(function () { $.send(); }, retryInterval); } else { $.send(); } } }; } FlowChunk.prototype = { /** * Get params for a request * @function */ getParams: function () { return { flowChunkNumber: this.offset + 1, flowChunkSize: this.flowObj.opts.chunkSize, flowCurrentChunkSize: this.endByte - this.startByte, flowTotalSize: this.fileObjSize, flowIdentifier: this.fileObj.uniqueIdentifier, flowFilename: this.fileObj.name, flowRelativePath: this.fileObj.relativePath, flowTotalChunks: this.fileObj.chunks.length }; }, /** * Get target option with query params * @function * @param params * @returns {string} */ getTarget: function(params){ var target = this.flowObj.opts.target; if(target.indexOf('?') < 0) { target += '?'; } else { target += '&'; } return target + params.join('&'); }, /** * Makes a GET request without any data to see if the chunk has already * been uploaded in a previous session * @function */ test: function () { // Set up request and listen for event this.xhr = new XMLHttpRequest(); this.xhr.addEventListener("load", this.testHandler, false); this.xhr.addEventListener("error", this.testHandler, false); var data = this.prepareXhrRequest('GET'); this.xhr.send(data); }, /** * Finish preprocess state * @function */ preprocessFinished: function () { this.preprocessState = 2; this.send(); }, /** * Uploads the actual data in a POST call * @function */ send: function () { var preprocess = this.flowObj.opts.preprocess; if (typeof preprocess === 'function') { switch (this.preprocessState) { case 0: preprocess(this); this.preprocessState = 1; return; case 1: return; case 2: break; } } if (this.flowObj.opts.testChunks && !this.tested) { this.test(); return; } this.loaded = 0; this.total = 0; this.pendingRetry = false; var func = (this.fileObj.file.slice ? 'slice' : (this.fileObj.file.mozSlice ? 'mozSlice' : (this.fileObj.file.webkitSlice ? 'webkitSlice' : 'slice'))); var bytes = this.fileObj.file[func](this.startByte, this.endByte); // Set up request and listen for event this.xhr = new XMLHttpRequest(); this.xhr.upload.addEventListener('progress', this.progressHandler, false); this.xhr.addEventListener("load", this.doneHandler, false); this.xhr.addEventListener("error", this.doneHandler, false); var data = this.prepareXhrRequest('POST', this.flowObj.opts.method, bytes); this.xhr.send(data); }, /** * Abort current xhr request * @function */ abort: function () { // Abort and reset var xhr = this.xhr; this.xhr = null; if (xhr) { xhr.abort(); } }, /** * Retrieve current chunk upload status * @function * @returns {string} 'pending', 'uploading', 'success', 'error' */ status: function () { if (this.pendingRetry) { // if pending retry then that's effectively the same as actively uploading, // there might just be a slight delay before the retry starts return 'uploading'; } else if (!this.xhr) { return 'pending'; } else if (this.xhr.readyState < 4) { // Status is really 'OPENED', 'HEADERS_RECEIVED' // or 'LOADING' - meaning that stuff is happening return 'uploading'; } else { if (this.xhr.status == 200) { // HTTP 200, perfect return 'success'; } else if (this.flowObj.opts.permanentErrors.indexOf(this.xhr.status) > -1 || this.retries >= this.flowObj.opts.maxChunkRetries) { // HTTP 415/500/501, permanent error return 'error'; } else { // this should never happen, but we'll reset and queue a retry // a likely case for this would be 503 service unavailable this.abort(); return 'pending'; } } }, /** * Get response from xhr request * @function * @returns {String} */ message: function () { return this.xhr ? this.xhr.responseText : ''; }, /** * Get upload progress * @function * @returns {number} */ progress: function () { if (this.pendingRetry) { return 0; } var s = this.status(); if (s === 'success' || s === 'error') { return 1; } else if (s === 'pending') { return 0; } else { return this.total > 0 ? this.loaded / this.total : 0; } }, /** * Count total size uploaded * @function * @returns {number} */ sizeUploaded: function () { var size = this.endByte - this.startByte; // can't return only chunk.loaded value, because it is bigger than chunk size if (this.status() !== 'success') { size = this.progress() * size; } return size; }, /** * Prepare Xhr request. Set query, headers and data * @param {string} method GET or POST * @param {string} [paramsMethod] octet or form * @param {Blob} [blob] to send * @returns {FormData|Blob|Null} data to send */ prepareXhrRequest: function(method, paramsMethod, blob) { // Add data from the query options var query = this.flowObj.opts.query; if (typeof query === "function") { query = query(this.fileObj, this); } query = extend(this.getParams(), query); var target = this.flowObj.opts.target; var data = null; if (method === 'GET' || paramsMethod === 'octet') { // Add data from the query options var params = []; each(query, function (v, k) { params.push([encodeURIComponent(k), encodeURIComponent(v)].join('=')); }); target = this.getTarget(params); data = blob || null; } else { // Add data from the query options data = new FormData(); each(query, function (v, k) { data.append(k, v); }); data.append(this.flowObj.opts.fileParameterName, blob); } this.xhr.open(method, target); this.xhr.withCredentials = this.flowObj.opts.withCredentials; // Add data from header options each(this.flowObj.opts.headers, function (v, k) { this.xhr.setRequestHeader(k, v); }, this); return data; } }; /** * Remove value from array * @param array * @param value */ function arrayRemove(array, value) { var index = array.indexOf(value); if (index > -1) { array.splice(index, 1); } } /** * Extends the destination object `dst` by copying all of the properties from * the `src` object(s) to `dst`. You can specify multiple `src` objects. * @function * @param {Object} dst Destination object. * @param {...Object} src Source object(s). * @returns {Object} Reference to `dst`. */ function extend(dst, src) { each(arguments, function(obj) { if (obj !== dst) { each(obj, function(value, key){ dst[key] = value; }); } }); return dst; } Flow.extend = extend; /** * Iterate each element of an object * @function * @param {Array|Object} obj object or an array to iterate * @param {Function} callback first argument is a value and second is a key. * @param {Object=} context Object to become context (`this`) for the iterator function. */ function each(obj, callback, context) { if (!obj) { return ; } var key; // Is Array? if (typeof(obj.length) !== 'undefined') { for (key = 0; key < obj.length; key++) { if (callback.call(context, obj[key], key) === false) { return ; } } } else { for (key in obj) { if (obj.hasOwnProperty(key) && callback.call(context, obj[key], key) === false) { return ; } } } } Flow.each = each; /** * FlowFile constructor * @type {FlowFile} */ Flow.FlowFile = FlowFile; /** * FlowFile constructor * @type {FlowChunk} */ Flow.FlowChunk = FlowChunk; /** * Library version * @type {string} */ Flow.version = '2.1.0'; if ( typeof module === "object" && module && typeof module.exports === "object" ) { // Expose Flow as module.exports in loaders that implement the Node // module pattern (including browserify). Do not create the global, since // the user will be storing it themselves locally, and globals are frowned // upon in the Node module world. module.exports = Flow; } else { // Otherwise expose Flow to the global object as usual window.Flow = Flow; // Register as a named AMD module, since Flow can be concatenated with other // files that may use define, but not via a proper concatenation script that // understands anonymous AMD modules. A named AMD is safest and most robust // way to register. Lowercase flow is used because AMD module names are // derived from file names, and Flow is normally delivered in a lowercase // file name. Do this after creating the global so that if an AMD module wants // to call noConflict to hide this version of Flow, it will work. if ( typeof define === "function" && define.amd ) { define( "flow", [], function () { return Flow; } ); } } })(window, document); /** * @description * var app = angular.module('App', ['flow.provider'], function(flowFactoryProvider){ * flowFactoryProvider.defaults = {target: '/'}; * }); * @name flowFactoryProvider */ angular.module('flow.provider', []) .provider('flowFactory', function() { 'use strict'; /** * Define the default properties for flow.js * @name flowFactoryProvider.defaults * @type {Object} */ this.defaults = {}; /** * Flow, MaybeFlow or NotFlow * @name flowFactoryProvider.factory * @type {function} * @return {Flow} */ this.factory = function (options) { return new Flow(options); }; /** * Define the default events * @name flowFactoryProvider.events * @type {Array} * @private */ this.events = []; /** * Add default events * @name flowFactoryProvider.on * @function * @param {string} event * @param {Function} callback */ this.on = function (event, callback) { this.events.push([event, callback]); }; this.$get = function() { var fn = this.factory; var defaults = this.defaults; var events = this.events; return { 'create': function(opts) { // combine default options with global options and options var flow = fn(angular.extend({}, defaults, opts)); angular.forEach(events, function (event) { flow.on(event[0], event[1]); }); return flow; } }; }; }); angular.module('flow.init', ['flow.provider']) .controller('flowCtrl', ['$scope', '$attrs', '$parse', 'flowFactory', function ($scope, $attrs, $parse, flowFactory) { // create the flow object var options = angular.extend({}, $scope.$eval($attrs.flowInit)); var flow = flowFactory.create(options); flow.on('catchAll', function (eventName) { var args = Array.prototype.slice.call(arguments); args.shift(); var event = $scope.$broadcast.apply($scope, ['flow::' + eventName, flow].concat(args)); if ({ 'progress':1, 'filesSubmitted':1, 'fileSuccess': 1, 'fileError': 1 }[eventName]) { $scope.$apply(); } if (event.defaultPrevented) { return false; } }); $scope.$flow = flow; if ($attrs.hasOwnProperty('flowName')) { $parse($attrs.flowName).assign($scope, flow); $scope.$on('$destroy', function () { $parse($attrs.flowName).assign($scope); }); } }]) .directive('flowInit', [function() { return { scope: true, controller: 'flowCtrl' }; }]); angular.module('flow.btn', ['flow.init']) .directive('flowBtn', [function() { return { 'restrict': 'EA', 'scope': false, 'require': '^flowInit', 'link': function(scope, element, attrs) { var isDirectory = attrs.hasOwnProperty('flowDirectory'); var isSingleFile = attrs.hasOwnProperty('flowSingleFile'); scope.$flow.assignBrowse(element, isDirectory, isSingleFile); } }; }]); angular.module('flow.drop', ['flow.init']) .directive('flowDrop', function() { return { 'scope': false, 'require': '^flowInit', 'link': function(scope, element, attrs) { if (attrs.flowDropEnabled) { scope.$watch(attrs.flowDropEnabled, function (value) { if (value) { assignDrop(); } else { unAssignDrop(); } }); } else { assignDrop(); } function assignDrop() { scope.$flow.assignDrop(element); } function unAssignDrop() { scope.$flow.unAssignDrop(element); } } }; }); angular.module('flow.img', ['flow.init']) .directive('flowImg', [function() { return { 'scope': false, 'require': '^flowInit', 'link': function(scope, element, attrs) { var file = attrs.flowImg; scope.$watch(file, function (file) { if (!file) { return ; } var fileReader = new FileReader(); fileReader.readAsDataURL(file.file); fileReader.onload = function (event) { scope.$apply(function () { attrs.$set('src', event.target.result); }); }; }); } }; }]); angular.module('flow.transfers', ['flow.init']) .directive('flowTransfers', [function() { return { 'scope': true, 'require': '^flowInit', 'link': function(scope) { scope.transfers = scope.$flow.files; } }; }]); angular.module('flow', ['flow.btn', 'flow.drop', 'flow.img', 'flow.transfers']);
XIMDEX/ximdex
public_xmd/vendors/flow/ng-flow.js
JavaScript
agpl-3.0
44,312
.crmb-wizard-body { margin-top: 0.7em; }
rocxa/uk.co.vedaconsulting.mosaico
ang/crmbWizard.css
CSS
agpl-3.0
45
# WickedPDF Global Configuration # # Use this to set up shared configuration options for your entire application. # Any of the configuration options shown here can also be applied to single # models by passing arguments to the `render :pdf` call. # # To learn more, check out the README: # # https://github.com/mileszs/wicked_pdf/blob/master/README.md WickedPdf.config = { layout: 'pdf.html', encoding: 'UTF-8', page_size: 'A4', print_media_type: true, no_background: true }
panter/aoz-003
config/initializers/wicked_pdf.rb
Ruby
agpl-3.0
486
<?php namespace Zeropingheroes\LanagerCore\Models; class PlaylistItem extends BaseModel { public static $rules = array( 'url' => 'required|url|playlist_compatible_url', 'playlist_id' => 'numeric|exists:playlists,id' ); public function beforeSave() { // Get title and duration data from YouTube parse_str( parse_url( $this->url, PHP_URL_QUERY ), $youtube_url ); // Retrieve video metadata $response = file_get_contents('http://gdata.youtube.com/feeds/api/videos/'.$youtube_url['v'].'?format=5&alt=json'); $response = json_decode($response, true); // convert JSON response to array $this->title = $response['entry']['title']['$t']; $this->duration = $response['entry']['media$group']['yt$duration']['seconds']; } public function playlist() { return $this->belongsTo('Zeropingheroes\LanagerCore\Models\Playlist'); } public function user() { return $this->belongsTo('Zeropingheroes\LanagerCore\Models\User'); } }
zeropingheroes/lanager-core
src/Zeropingheroes/LanagerCore/Models/PlaylistItem.php
PHP
agpl-3.0
949
/* * Copyright (C) Igor Sysoev * Copyright (C) Nginx, Inc. */ #include <ngx_config.h> #include <ngx_core.h> #pragma hdrstop //#include <ngx_event.h> static void ngx_destroy_cycle_pools(ngx_conf_t * conf); static ngx_int_t ngx_init_zone_pool(ngx_cycle_t * cycle, ngx_shm_zone_t * shm_zone); static ngx_int_t ngx_test_lockfile(u_char * file, ngx_log_t * log); static void ngx_clean_old_cycles(ngx_event_t * ev); static void ngx_shutdown_timer_handler(ngx_event_t * ev); volatile ngx_cycle_t * ngx_cycle; // @global ngx_array_t ngx_old_cycles; // @global static ngx_pool_t * ngx_temp_pool; // @global static ngx_event_t ngx_cleaner_event; // @global static ngx_event_t ngx_shutdown_event; // @global ngx_uint_t ngx_test_config__; // @global ngx_uint_t ngx_dump_config__; // @global //ngx_uint_t ngx_quiet_mode; /* STUB NAME */ static ngx_connection_t dumb; // @global /* STUB */ ngx_cycle_t * ngx_init_cycle(ngx_cycle_t * old_cycle, const NgxStartUpOptions & rO) { ngx_cycle_t * cycle = 0; //ngx_cycle_t ** old; //void * rv; //char ** senv; //ngx_uint_t i; //ngx_uint_t n; ngx_conf_t conf; //ngx_shm_zone_t * shm_zone; //ngx_shm_zone_t * oshm_zone; //ngx_list_part_t * part; //ngx_list_part_t * opart; //ngx_open_file_t * file; //ngx_listening_t * ls; //ngx_listening_t * nls; //ngx_core_conf_t * ccf; char hostname[NGX_MAXHOSTNAMELEN]; ngx_timezone_update(); // force localtime update with a new timezone ngx_time_t * tp = ngx_timeofday(); tp->sec = 0; ngx_time_update(); ngx_log_t * p_log = old_cycle->log; ngx_pool_t * p_pool = ngx_create_pool(NGX_CYCLE_POOL_SIZE, p_log); if(p_pool == NULL) { return NULL; } p_pool->log = p_log; cycle = (ngx_cycle_t *)ngx_pcalloc(p_pool, sizeof(ngx_cycle_t)); if(cycle == NULL) { ngx_destroy_pool(p_pool); return NULL; } cycle->pool = p_pool; cycle->log = p_log; cycle->old_cycle = old_cycle; cycle->conf_prefix.len = old_cycle->conf_prefix.len; cycle->conf_prefix.data = ngx_pstrdup(p_pool, &old_cycle->conf_prefix); if(cycle->conf_prefix.data == NULL) { ngx_destroy_pool(p_pool); return NULL; } cycle->prefix.len = old_cycle->prefix.len; cycle->prefix.data = ngx_pstrdup(p_pool, &old_cycle->prefix); if(cycle->prefix.data == NULL) { ngx_destroy_pool(p_pool); return NULL; } cycle->conf_file.len = old_cycle->conf_file.len; cycle->conf_file.data = (u_char *)ngx_pnalloc(p_pool, old_cycle->conf_file.len + 1); if(cycle->conf_file.data == NULL) { ngx_destroy_pool(p_pool); return NULL; } ngx_cpystrn(cycle->conf_file.data, old_cycle->conf_file.data, old_cycle->conf_file.len + 1); cycle->conf_param.len = old_cycle->conf_param.len; cycle->conf_param.data = ngx_pstrdup(p_pool, &old_cycle->conf_param); if(cycle->conf_param.data == NULL) { ngx_destroy_pool(p_pool); return NULL; } { const ngx_uint_t n = old_cycle->paths.nelts ? old_cycle->paths.nelts : 10; if(ngx_array_init(&cycle->paths, p_pool, n, sizeof(ngx_path_t *)) != NGX_OK) { ngx_destroy_pool(p_pool); return NULL; } memzero(cycle->paths.elts, n * sizeof(ngx_path_t *)); if(ngx_array_init(&cycle->config_dump, p_pool, 1, sizeof(ngx_conf_dump_t)) != NGX_OK) { ngx_destroy_pool(p_pool); return NULL; } } { ngx_uint_t n = 20; ngx_rbtree_init(&cycle->config_dump_rbtree, &cycle->config_dump_sentinel, ngx_str_rbtree_insert_value); if(old_cycle->open_files.part.nelts) { n = old_cycle->open_files.part.nelts; for(ngx_list_part_t * part = old_cycle->open_files.part.next; part; part = part->next) { n += part->nelts; } } else { n = 20; } if(ngx_list_init(&cycle->open_files, p_pool, n, sizeof(ngx_open_file_t)) != NGX_OK) { ngx_destroy_pool(p_pool); return NULL; } } { ngx_uint_t n = 1; if(old_cycle->shared_memory.part.nelts) { n = old_cycle->shared_memory.part.nelts; for(ngx_list_part_t * part = old_cycle->shared_memory.part.next; part; part = part->next) { n += part->nelts; } } else { n = 1; } if(ngx_list_init(&cycle->shared_memory, p_pool, n, sizeof(ngx_shm_zone_t)) != NGX_OK) { ngx_destroy_pool(p_pool); return NULL; } } { const ngx_uint_t n = old_cycle->listening.nelts ? old_cycle->listening.nelts : 10; if(ngx_array_init(&cycle->listening, p_pool, n, sizeof(ngx_listening_t)) != NGX_OK) { ngx_destroy_pool(p_pool); return NULL; } memzero(cycle->listening.elts, n * sizeof(ngx_listening_t)); } { ngx_queue_init(&cycle->reusable_connections_queue); cycle->conf_ctx = (void ****)ngx_pcalloc(p_pool, ngx_max_module * sizeof(void *)); if(cycle->conf_ctx == NULL) { ngx_destroy_pool(p_pool); return NULL; } } if(gethostname(hostname, NGX_MAXHOSTNAMELEN) == -1) { ngx_log_error(NGX_LOG_EMERG, p_log, ngx_errno, "gethostname() failed"); ngx_destroy_pool(p_pool); return NULL; } // // on Linux gethostname() silently truncates name that does not fit // hostname[NGX_MAXHOSTNAMELEN-1] = '\0'; cycle->hostname.len = ngx_strlen(hostname); cycle->hostname.data = (u_char *)ngx_pnalloc(p_pool, cycle->hostname.len); if(cycle->hostname.data == NULL) { ngx_destroy_pool(p_pool); return NULL; } ngx_strlow(cycle->hostname.data, (u_char *)hostname, cycle->hostname.len); { if(ngx_cycle_modules(cycle) != NGX_OK) { ngx_destroy_pool(p_pool); return NULL; } for(ngx_uint_t i = 0; cycle->modules[i]; i++) { if(cycle->modules[i]->type == NGX_CORE_MODULE) { ngx_core_module_t * p_module = (ngx_core_module_t *)cycle->modules[i]->ctx; if(p_module->create_conf) { void * rv = p_module->create_conf(cycle); if(rv == NULL) { ngx_destroy_pool(p_pool); return NULL; } cycle->conf_ctx[cycle->modules[i]->index] = (void ***)rv; } } } } { char ** pp_senv = environ; memzero(&conf, sizeof(ngx_conf_t)); // STUB: init array ? conf.args = ngx_array_create(p_pool, 10, sizeof(ngx_str_t)); if(conf.args == NULL) { ngx_destroy_pool(p_pool); return NULL; } conf.temp_pool = ngx_create_pool(NGX_CYCLE_POOL_SIZE, p_log); if(conf.temp_pool == NULL) { ngx_destroy_pool(p_pool); return NULL; } conf.ctx = cycle->conf_ctx; conf.cycle = cycle; conf.pool = p_pool; conf.log = p_log; conf.module_type = NGX_CORE_MODULE; conf.cmd_type = NGX_MAIN_CONF; #if 0 log->log_level = NGX_LOG_DEBUG_ALL; #endif if(ngx_conf_param(&conf) != NGX_CONF_OK) { environ = pp_senv; ngx_destroy_cycle_pools(&conf); return NULL; } if(ngx_conf_parse(&conf, &cycle->conf_file) != NGX_CONF_OK) { environ = pp_senv; ngx_destroy_cycle_pools(&conf); return NULL; } //if(ngx_test_config && !ngx_quiet_mode) { if(rO.Flags & rO.fTestConf && !(rO.Flags & rO.fQuietMode)) { ngx_log_stderr(0, "the configuration file %s syntax is ok", cycle->conf_file.data); } { for(ngx_uint_t i = 0; cycle->modules[i]; i++) { if(cycle->modules[i]->type == NGX_CORE_MODULE) { ngx_core_module_t * module = (ngx_core_module_t *)cycle->modules[i]->ctx; if(module->F_InitConf) { if(module->F_InitConf(cycle, cycle->conf_ctx[cycle->modules[i]->index]) == NGX_CONF_ERROR) { environ = pp_senv; ngx_destroy_cycle_pools(&conf); return NULL; } } } } } } if(ngx_process == NGX_PROCESS_SIGNALLER) { return cycle; } { ngx_core_conf_t * ccf = (ngx_core_conf_t*)ngx_get_conf(cycle->conf_ctx, ngx_core_module); if(/*ngx_test_config*/rO.Flags & rO.fTestConf) { if(ngx_create_pidfile(&ccf->pid, p_log, rO) != NGX_OK) { goto failed; } } else if(!ngx_is_init_cycle(old_cycle)) { // // we do not create the pid file in the first ngx_init_cycle() call // because we need to write the demonized process pid // ngx_core_conf_t * old_ccf = (ngx_core_conf_t*)ngx_get_conf(old_cycle->conf_ctx, ngx_core_module); if(ccf->pid.len != old_ccf->pid.len || !sstreq(ccf->pid.data, old_ccf->pid.data)) { // new pid file name if(ngx_create_pidfile(&ccf->pid, p_log, rO) != NGX_OK) { goto failed; } ngx_delete_pidfile(old_cycle); } } if(ngx_test_lockfile(cycle->lock_file.data, p_log) != NGX_OK) { goto failed; } if(ngx_create_paths(cycle, ccf->user) != NGX_OK) { goto failed; } if(ngx_log_open_default(cycle) != NGX_OK) { goto failed; } } { // open the new files ngx_list_part_t * part = &cycle->open_files.part; ngx_open_file_t * file = (ngx_open_file_t *)part->elts; for(ngx_uint_t i = 0; /* void */; i++) { if(i >= part->nelts) { if(part->next == NULL) { break; } part = part->next; file = (ngx_open_file_t *)part->elts; i = 0; } if(file[i].name.len) { file[i].fd = ngx_open_file(file[i].name.data, NGX_FILE_APPEND, NGX_FILE_CREATE_OR_OPEN, NGX_FILE_DEFAULT_ACCESS); ngx_log_debug3(NGX_LOG_DEBUG_CORE, p_log, 0, "log: %p %d \"%s\"", &file[i], file[i].fd, file[i].name.data); if(file[i].fd == NGX_INVALID_FILE) { ngx_log_error(NGX_LOG_EMERG, p_log, ngx_errno, ngx_open_file_n " \"%s\" failed", file[i].name.data); goto failed; } #if !(NGX_WIN32) if(fcntl(file[i].fd, F_SETFD, FD_CLOEXEC) == -1) { ngx_log_error(NGX_LOG_EMERG, p_log, ngx_errno, "fcntl(FD_CLOEXEC) \"%s\" failed", file[i].name.data); goto failed; } #endif } } } cycle->log = &cycle->new_log; p_pool->log = &cycle->new_log; { // // create shared memory // ngx_list_part_t * part = &cycle->shared_memory.part; ngx_shm_zone_t * shm_zone = (ngx_shm_zone_t *)part->elts; for(ngx_uint_t i = 0; /* void */; i++) { if(i >= part->nelts) { if(part->next == NULL) { break; } part = part->next; shm_zone = (ngx_shm_zone_t *)part->elts; i = 0; } if(shm_zone[i].shm.size == 0) { ngx_log_error(NGX_LOG_EMERG, p_log, 0, "zero size shared memory zone \"%V\"", &shm_zone[i].shm.name); goto failed; } shm_zone[i].shm.log = cycle->log; { ngx_list_part_t * opart = &old_cycle->shared_memory.part; ngx_shm_zone_t * oshm_zone = (ngx_shm_zone_t *)opart->elts; for(ngx_uint_t n = 0; /* void */; n++) { if(n >= opart->nelts) { if(opart->next == NULL) { break; } opart = opart->next; oshm_zone = (ngx_shm_zone_t *)opart->elts; n = 0; } if(shm_zone[i].shm.name.len == oshm_zone[n].shm.name.len && ngx_strncmp(shm_zone[i].shm.name.data, oshm_zone[n].shm.name.data, shm_zone[i].shm.name.len) == 0) { if(shm_zone[i].tag == oshm_zone[n].tag && shm_zone[i].shm.size == oshm_zone[n].shm.size && !shm_zone[i].noreuse) { shm_zone[i].shm.addr = oshm_zone[n].shm.addr; #if (NGX_WIN32) shm_zone[i].shm.handle = oshm_zone[n].shm.handle; #endif if(shm_zone[i].F_Init(&shm_zone[i], oshm_zone[n].data) != NGX_OK) { goto failed; } goto shm_zone_found; } ngx_shm_free(&oshm_zone[n].shm); break; } } } if(ngx_shm_alloc(&shm_zone[i].shm) != NGX_OK) { goto failed; } if(ngx_init_zone_pool(cycle, &shm_zone[i]) != NGX_OK) { goto failed; } if(shm_zone[i].F_Init(&shm_zone[i], NULL) != NGX_OK) { goto failed; } shm_zone_found: continue; } } // // handle the listening sockets // if(old_cycle->listening.nelts) { ngx_listening_t * ls = (ngx_listening_t *)old_cycle->listening.elts; { for(ngx_uint_t i = 0; i < old_cycle->listening.nelts; i++) { ls[i].remain = 0; } } ngx_listening_t * nls = (ngx_listening_t *)cycle->listening.elts; for(ngx_uint_t n = 0; n < cycle->listening.nelts; n++) { for(ngx_uint_t i = 0; i < old_cycle->listening.nelts; i++) { if(!ls[i].ignore && !ls[i].remain && ls[i].type == nls[n].type) { if(ngx_cmp_sockaddr(nls[n].sockaddr, nls[n].socklen, ls[i].sockaddr, ls[i].socklen, 1) == NGX_OK) { nls[n].fd = ls[i].fd; nls[n].previous = &ls[i]; ls[i].remain = 1; if(ls[i].backlog != nls[n].backlog) { nls[n].listen = 1; } #if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER) // // FreeBSD, except the most recent versions, could not remove accept filter // nls[n].deferred_accept = ls[i].deferred_accept; if(ls[i].accept_filter && nls[n].accept_filter) { if(!sstreq(ls[i].accept_filter, nls[n].accept_filter)) { nls[n].delete_deferred = 1; nls[n].add_deferred = 1; } } else if(ls[i].accept_filter) { nls[n].delete_deferred = 1; } else if(nls[n].accept_filter) { nls[n].add_deferred = 1; } #endif #if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT) if(ls[i].deferred_accept && !nls[n].deferred_accept) { nls[n].delete_deferred = 1; } else if(ls[i].deferred_accept != nls[n].deferred_accept) { nls[n].add_deferred = 1; } #endif #if (NGX_HAVE_REUSEPORT) if(nls[n].reuseport && !ls[i].reuseport) { nls[n].add_reuseport = 1; } #endif break; } } } if(nls[n].fd == (ngx_socket_t)-1) { nls[n].open = 1; #if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER) if(nls[n].accept_filter) { nls[n].add_deferred = 1; } #endif #if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT) if(nls[n].deferred_accept) { nls[n].add_deferred = 1; } #endif } } } else { ngx_listening_t * ls = (ngx_listening_t *)cycle->listening.elts; for(ngx_uint_t i = 0; i < cycle->listening.nelts; i++) { ls[i].open = 1; #if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER) if(ls[i].accept_filter) { ls[i].add_deferred = 1; } #endif #if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT) if(ls[i].deferred_accept) { ls[i].add_deferred = 1; } #endif } } if(ngx_open_listening_sockets(cycle, rO) != NGX_OK) { goto failed; } if(!/*ngx_test_config*/(rO.Flags & rO.fTestConf)) { ngx_configure_listening_sockets(cycle); } // commit the new cycle configuration if(!ngx_use_stderr) { (void)ngx_log_redirect_stderr(cycle); } p_pool->log = cycle->log; if(ngx_init_modules(cycle) != NGX_OK) { exit(1); // fatal } { // close and delete stuff that lefts from an old cycle // free the unnecessary shared memory ngx_list_part_t * opart = &old_cycle->shared_memory.part; ngx_shm_zone_t * oshm_zone = (ngx_shm_zone_t *)opart->elts; for(ngx_uint_t i = 0; /* void */; i++) { if(i >= opart->nelts) { if(opart->next == NULL) { goto old_shm_zone_done; } opart = opart->next; oshm_zone = (ngx_shm_zone_t *)opart->elts; i = 0; } { ngx_list_part_t * part = &cycle->shared_memory.part; ngx_shm_zone_t * shm_zone = (ngx_shm_zone_t *)part->elts; for(ngx_uint_t n = 0; /* void */; n++) { if(n >= part->nelts) { if(part->next == NULL) { break; } part = part->next; shm_zone = (ngx_shm_zone_t *)part->elts; n = 0; } if(oshm_zone[i].shm.name.len == shm_zone[n].shm.name.len && ngx_strncmp(oshm_zone[i].shm.name.data, shm_zone[n].shm.name.data, oshm_zone[i].shm.name.len) == 0) { goto live_shm_zone; } } } ngx_shm_free(&oshm_zone[i].shm); live_shm_zone: continue; } } old_shm_zone_done: { // // close the unnecessary listening sockets // ngx_listening_t * ls = (ngx_listening_t *)old_cycle->listening.elts; for(ngx_uint_t i = 0; i < old_cycle->listening.nelts; i++) { if(!ls[i].remain && ls[i].fd != (ngx_socket_t)-1) { if(ngx_close_socket(ls[i].fd) == -1) { ngx_log_error(NGX_LOG_EMERG, p_log, ngx_socket_errno, ngx_close_socket_n " listening socket on %V failed", &ls[i].addr_text); } #if (NGX_HAVE_UNIX_DOMAIN) if(ls[i].sockaddr->sa_family == AF_UNIX) { u_char * name = ls[i].addr_text.data + sizeof("unix:") - 1; ngx_log_error(NGX_LOG_WARN, cycle->log, 0, "deleting socket %s", name); if(ngx_delete_file(name) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_socket_errno, ngx_delete_file_n " %s failed", name); } } #endif } } } { // // close the unnecessary open files // ngx_list_part_t * part = &old_cycle->open_files.part; ngx_open_file_t * file = (ngx_open_file_t *)part->elts; for(ngx_uint_t i = 0; /* void */; i++) { if(i >= part->nelts) { if(part->next == NULL) { break; } part = part->next; file = (ngx_open_file_t *)part->elts; i = 0; } if(file[i].fd != NGX_INVALID_FILE && file[i].fd != ngx_stderr) { if(ngx_close_file(file[i].fd) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_EMERG, p_log, ngx_errno, ngx_close_file_n " \"%s\" failed", file[i].name.data); } } } } ngx_destroy_pool(conf.temp_pool); if(ngx_process == NGX_PROCESS_MASTER || ngx_is_init_cycle(old_cycle)) { ngx_destroy_pool(old_cycle->pool); cycle->old_cycle = NULL; } else { if(ngx_temp_pool == NULL) { ngx_temp_pool = ngx_create_pool(128, cycle->log); if(ngx_temp_pool == NULL) { ngx_log_error(NGX_LOG_EMERG, cycle->log, 0, "could not create ngx_temp_pool"); exit(1); } { const ngx_uint_t n = 10; if(ngx_array_init(&ngx_old_cycles, ngx_temp_pool, n, sizeof(ngx_cycle_t *)) != NGX_OK) { exit(1); } memzero(ngx_old_cycles.elts, n * sizeof(ngx_cycle_t *)); ngx_cleaner_event.F_EvHandler = ngx_clean_old_cycles; ngx_cleaner_event.log = cycle->log; ngx_cleaner_event.P_Data = &dumb; dumb.fd = (ngx_socket_t)-1; } } ngx_temp_pool->log = cycle->log; { ngx_cycle_t ** pp_old = (ngx_cycle_t **)ngx_array_push(&ngx_old_cycles); if(pp_old == NULL) { exit(1); } *pp_old = old_cycle; } if(!ngx_cleaner_event.timer_set) { ngx_add_timer(&ngx_cleaner_event, 30000); ngx_cleaner_event.timer_set = 1; } } return cycle; failed: if(!ngx_is_init_cycle(old_cycle)) { ngx_core_conf_t * old_ccf = (ngx_core_conf_t*)ngx_get_conf(old_cycle->conf_ctx, ngx_core_module); if(old_ccf->environment) { environ = old_ccf->environment; } } { // // rollback the new cycle configuration // ngx_list_part_t * part = &cycle->open_files.part; ngx_open_file_t * file = (ngx_open_file_t *)part->elts; for(ngx_uint_t i = 0; /* void */; i++) { if(i >= part->nelts) { if(part->next == NULL) { break; } part = part->next; file = (ngx_open_file_t *)part->elts; i = 0; } if(!oneof2(file[i].fd, NGX_INVALID_FILE, ngx_stderr)) { if(ngx_close_file(file[i].fd) == NGX_FILE_ERROR) ngx_log_error(NGX_LOG_EMERG, p_log, ngx_errno, ngx_close_file_n " \"%s\" failed", file[i].name.data); } } } if(!/*ngx_test_config*/(rO.Flags & rO.fTestConf)) { ngx_listening_t * ls = (ngx_listening_t *)cycle->listening.elts; for(ngx_uint_t i = 0; i < cycle->listening.nelts; i++) { if(ls[i].fd != (ngx_socket_t)-1 && ls[i].open) { if(ngx_close_socket(ls[i].fd) == -1) ngx_log_error(NGX_LOG_EMERG, p_log, ngx_socket_errno, ngx_close_socket_n " %V failed", &ls[i].addr_text); } } } ngx_destroy_cycle_pools(&conf); return NULL; } static void ngx_destroy_cycle_pools(ngx_conf_t * conf) { ngx_destroy_pool(conf->temp_pool); ngx_destroy_pool(conf->pool); } static ngx_int_t ngx_init_zone_pool(ngx_cycle_t * cycle, ngx_shm_zone_t * zn) { u_char * file; ngx_slab_pool_t * sp = (ngx_slab_pool_t*)zn->shm.addr; if(zn->shm.exists) { if(sp == sp->addr) { return NGX_OK; } #if (NGX_WIN32) /* remap at the required address */ if(ngx_shm_remap(&zn->shm, (u_char *)sp->addr) != NGX_OK) { return NGX_ERROR; } sp = (ngx_slab_pool_t*)zn->shm.addr; if(sp == sp->addr) { return NGX_OK; } #endif ngx_log_error(NGX_LOG_EMERG, cycle->log, 0, "shared zone \"%V\" has no equal addresses: %p vs %p", &zn->shm.name, sp->addr, sp); return NGX_ERROR; } sp->end = zn->shm.addr + zn->shm.size; sp->min_shift = 3; sp->addr = zn->shm.addr; #if (NGX_HAVE_ATOMIC_OPS) file = NULL; #else file = ngx_pnalloc(cycle->pool, cycle->lock_file.len + zn->shm.name.len); if(file == NULL) { return NGX_ERROR; } (void)ngx_sprintf(file, "%V%V%Z", &cycle->lock_file, &zn->shm.name); #endif if(ngx_shmtx_create(&sp->mutex, &sp->lock, file) != NGX_OK) { return NGX_ERROR; } ngx_slab_init(sp); return NGX_OK; } ngx_int_t ngx_create_pidfile(ngx_str_t * name, ngx_log_t * log, const NgxStartUpOptions & rO) { if(ngx_process <= NGX_PROCESS_MASTER) { size_t len; ngx_uint_t create; u_char pid[NGX_INT64_LEN + 2]; ngx_file_t file; memzero(&file, sizeof(ngx_file_t)); file.name = *name; file.log = log; create = (/*ngx_test_config*/rO.Flags & rO.fTestConf) ? NGX_FILE_CREATE_OR_OPEN : NGX_FILE_TRUNCATE; file.fd = ngx_open_file(file.name.data, NGX_FILE_RDWR, create, NGX_FILE_DEFAULT_ACCESS); if(file.fd == NGX_INVALID_FILE) { ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, ngx_open_file_n " \"%s\" failed", file.name.data); return NGX_ERROR; } if(!(/*ngx_test_config*/rO.Flags & rO.fTestConf)) { len = ngx_snprintf(pid, NGX_INT64_LEN + 2, "%P%N", ngx_pid) - pid; if(ngx_write_file(&file, pid, len, 0) == NGX_ERROR) { return NGX_ERROR; } } if(ngx_close_file(file.fd) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, ngx_close_file_n " \"%s\" failed", file.name.data); } } return NGX_OK; } void ngx_delete_pidfile(ngx_cycle_t * cycle) { ngx_core_conf_t * ccf = (ngx_core_conf_t*)ngx_get_conf(cycle->conf_ctx, ngx_core_module); u_char * name = ngx_new_binary ? ccf->oldpid.data : ccf->pid.data; if(ngx_delete_file(name) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, ngx_delete_file_n " \"%s\" failed", name); } } static ngx_int_t ngx_test_lockfile(u_char * file, ngx_log_t * log) { #if !(NGX_HAVE_ATOMIC_OPS) ngx_fd_t fd = ngx_open_file(file, NGX_FILE_RDWR, NGX_FILE_CREATE_OR_OPEN, NGX_FILE_DEFAULT_ACCESS); if(fd == NGX_INVALID_FILE) { ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, ngx_open_file_n " \"%s\" failed", file); return NGX_ERROR; } if(ngx_close_file(fd) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, ngx_close_file_n " \"%s\" failed", file); } if(ngx_delete_file(file) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, ngx_delete_file_n " \"%s\" failed", file); } #endif return NGX_OK; } void ngx_reopen_files(ngx_cycle_t * cycle, ngx_uid_t user) { ngx_fd_t fd; ngx_uint_t i; ngx_list_part_t * part = &cycle->open_files.part; ngx_open_file_t * file = (ngx_open_file_t *)part->elts; for(i = 0; /* void */; i++) { if(i >= part->nelts) { if(part->next == NULL) { break; } part = part->next; file = (ngx_open_file_t *)part->elts; i = 0; } if(file[i].name.len == 0) { continue; } if(file[i].flush) { file[i].flush(&file[i], cycle->log); } fd = ngx_open_file(file[i].name.data, NGX_FILE_APPEND, NGX_FILE_CREATE_OR_OPEN, NGX_FILE_DEFAULT_ACCESS); ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "reopen file \"%s\", old:%d new:%d", file[i].name.data, file[i].fd, fd); if(fd == NGX_INVALID_FILE) { ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, ngx_open_file_n " \"%s\" failed", file[i].name.data); continue; } #if !(NGX_WIN32) if(user != (ngx_uid_t)NGX_CONF_UNSET_UINT) { ngx_file_info_t fi; if(ngx_file_info(file[i].name.data, &fi) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, ngx_file_info_n " \"%s\" failed", file[i].name.data); if(ngx_close_file(fd) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, ngx_close_file_n " \"%s\" failed", file[i].name.data); } continue; } if(fi.st_uid != user) { if(chown((const char *)file[i].name.data, user, -1) == -1) { ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, "chown(\"%s\", %d) failed", file[i].name.data, user); if(ngx_close_file(fd) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, ngx_close_file_n " \"%s\" failed", file[i].name.data); } continue; } } if((fi.st_mode & (S_IRUSR|S_IWUSR)) != (S_IRUSR|S_IWUSR)) { fi.st_mode |= (S_IRUSR|S_IWUSR); if(chmod((const char *)file[i].name.data, fi.st_mode) == -1) { ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, "chmod() \"%s\" failed", file[i].name.data); if(ngx_close_file(fd) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, ngx_close_file_n " \"%s\" failed", file[i].name.data); } continue; } } } if(fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) { ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, "fcntl(FD_CLOEXEC) \"%s\" failed", file[i].name.data); if(ngx_close_file(fd) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, ngx_close_file_n " \"%s\" failed", file[i].name.data); } continue; } #endif if(ngx_close_file(file[i].fd) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, ngx_close_file_n " \"%s\" failed", file[i].name.data); } file[i].fd = fd; } (void)ngx_log_redirect_stderr(cycle); } ngx_shm_zone_t * ngx_shared_memory_add(ngx_conf_t * cf, ngx_str_t * name, size_t size, void * tag) { ngx_uint_t i; ngx_list_part_t * part = &cf->cycle->shared_memory.part; ngx_shm_zone_t * shm_zone = (ngx_shm_zone_t *)part->elts; for(i = 0; /* void */; i++) { if(i >= part->nelts) { if(part->next == NULL) { break; } part = part->next; shm_zone = (ngx_shm_zone_t *)part->elts; i = 0; } if(name->len == shm_zone[i].shm.name.len && ngx_strncmp(name->data, shm_zone[i].shm.name.data, name->len) == 0) { if(tag != shm_zone[i].tag) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "the shared memory zone \"%V\" is already declared for a different use", &shm_zone[i].shm.name); return NULL; } SETIFZ(shm_zone[i].shm.size, size); if(size && size != shm_zone[i].shm.size) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "the size %uz of shared memory zone \"%V\" conflicts with already declared size %uz", size, &shm_zone[i].shm.name, shm_zone[i].shm.size); return NULL; } return &shm_zone[i]; } } shm_zone = (ngx_shm_zone_t *)ngx_list_push(&cf->cycle->shared_memory); if(shm_zone) { shm_zone->data = NULL; shm_zone->shm.log = cf->cycle->log; shm_zone->shm.size = size; shm_zone->shm.name = *name; shm_zone->shm.exists = 0; shm_zone->F_Init = NULL; shm_zone->tag = tag; shm_zone->noreuse = 0; } return shm_zone; } static void ngx_clean_old_cycles(ngx_event_t * ev) { ngx_uint_t i, n, found, live; ngx_cycle_t ** cycle; ngx_log_t * log = ngx_cycle->log; ngx_temp_pool->log = log; ngx_log_debug0(NGX_LOG_DEBUG_CORE, log, 0, "clean old cycles"); live = 0; cycle = (ngx_cycle_t **)ngx_old_cycles.elts; for(i = 0; i < ngx_old_cycles.nelts; i++) { if(cycle[i]) { found = 0; for(n = 0; n < cycle[i]->connection_n; n++) { if(cycle[i]->connections[n].fd != (ngx_socket_t)-1) { found = 1; ngx_log_debug1(NGX_LOG_DEBUG_CORE, log, 0, "live fd:%ui", n); break; } } if(found) { live = 1; } else { ngx_log_debug1(NGX_LOG_DEBUG_CORE, log, 0, "clean old cycle: %ui", i); ngx_destroy_pool(cycle[i]->pool); cycle[i] = NULL; } } } ngx_log_debug1(NGX_LOG_DEBUG_CORE, log, 0, "old cycles status: %ui", live); if(live) { ngx_add_timer(ev, 30000); } else { ngx_destroy_pool(ngx_temp_pool); ngx_temp_pool = NULL; ngx_old_cycles.nelts = 0; } } void ngx_set_shutdown_timer(ngx_cycle_t * cycle) { ngx_core_conf_t * ccf = (ngx_core_conf_t*)ngx_get_conf(cycle->conf_ctx, ngx_core_module); if(ccf->shutdown_timeout) { ngx_shutdown_event.F_EvHandler = ngx_shutdown_timer_handler; ngx_shutdown_event.P_Data = cycle; ngx_shutdown_event.log = cycle->log; ngx_shutdown_event.cancelable = 1; ngx_add_timer(&ngx_shutdown_event, ccf->shutdown_timeout); } } static void ngx_shutdown_timer_handler(ngx_event_t * ev) { ngx_cycle_t * cycle = (ngx_cycle_t *)ev->P_Data; ngx_connection_t * c = cycle->connections; for(ngx_uint_t i = 0; i < cycle->connection_n; i++) { if(c[i].fd == (ngx_socket_t)-1 || c[i].P_EvRd == NULL || c[i].P_EvRd->accept || c[i].P_EvRd->channel || c[i].P_EvRd->resolver) { continue; } ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, "*%uA shutdown timeout", c[i].number); c[i].close = 1; c[i].error = 1; c[i].P_EvRd->F_EvHandler(c[i].P_EvRd); } }
papyrussolution/OpenPapyrus
Src/OSF/nginx/src/core/ngx_cycle.c
C
agpl-3.0
28,224
# Simple script to run required operations to # 1. Download FASTAs from database # 2. Copy FASTAs to nextflu directory # 3. Download titer tables from database # 4. Copy titer tables to nextflu directory # Run from base fauna directory with python flu/download_all.py # Assumes that nextflu/, nextflu-cdc/ and nextflu-cdc-fra/ are # sister directories to fauna/ import os, subprocess import argparse parser = argparse.ArgumentParser() parser.add_argument('--virus', default="flu", help="virus to download; default is flu") parser.add_argument('--flu_lineages', default=["h3n2", "h1n1pdm", "vic", "yam"], nargs='+', type = str, help ="seasonal flu lineages to download, options are h3n2, h1n1pdm, vic and yam") parser.add_argument('--segments', type=str, default=['ha', 'na'], nargs='+', help="specify segment(s) to download") parser.add_argument('--sequences', default=False, action="store_true", help="download sequences from vdb") parser.add_argument('--titers', default=False, action="store_true", help="download titers from tdb") parser.add_argument('--titers_sources', default=["base", "crick", "cdc", "niid", "vidrl"], nargs='+', type = str, help ="titer sources to download, options are base, cdc, crick, niid and vidrl") parser.add_argument('--titers_passages', default=["egg", "cell"], nargs='+', type = str, help ="titer passage types to download, options are egg and cell") def concatenate_titers(params, passage, assay): for lineage in params.flu_lineages: out = 'data/%s_who_%s_%s_titers.tsv'%(lineage, assay, passage) hi_titers = [] for source in params.titers_sources: hi_titers_file = 'data/%s_%s_%s_%s_titers.tsv'%(lineage, source, assay, passage) if os.path.isfile(hi_titers_file): hi_titers.append(hi_titers_file) if len(hi_titers) > 0: with open(out, 'w+') as f: call = ['cat'] + hi_titers print call subprocess.call(call, stdout=f) for lineage in params.flu_lineages: out = 'data/%s_public_%s_%s_titers.tsv'%(lineage, assay, passage) hi_titers = [] for source in ["base", "cdc"]: hi_titers_file = 'data/%s_%s_%s_%s_titers.tsv'%(lineage, source, assay, passage) if os.path.isfile(hi_titers_file): hi_titers.append(hi_titers_file) if len(hi_titers) > 0: with open(out, 'w+') as f: call = ['cat'] + hi_titers print call subprocess.call(call, stdout=f) if __name__=="__main__": params = parser.parse_args() if params.virus == "flu": # Download FASTAs from database if params.sequences: segments = params.segments for segment in segments: for lineage in params.flu_lineages: call = "python vdb/flu_download.py -db vdb -v flu --select locus:%s lineage:seasonal_%s --fstem %s_%s --resolve_method split_passage"%(segment.upper(), lineage, lineage, segment) print(call) os.system(call) if params.titers: # download titers for source in params.titers_sources: if source == "base": for lineage in params.flu_lineages: call = "python tdb/download.py -db tdb -v flu --subtype %s --select assay_type:hi --fstem %s_base_hi_cell"%(lineage, lineage) print(call) os.system(call) if source in ["cdc", "crick", "niid", "vidrl"]: for passage in params.titers_passages: for lineage in params.flu_lineages: call = "python tdb/download.py -db %s_tdb -v flu --subtype %s --select assay_type:hi serum_passage_category:%s --fstem %s_%s_hi_%s"%(source, lineage, passage, lineage, source, passage) print(call) os.system(call) lineage = 'h3n2' call = "python tdb/download.py -db %s_tdb -v flu --subtype %s --select assay_type:fra serum_passage_category:%s --fstem %s_%s_fra_%s"%(source, lineage, passage, lineage, source, passage) print(call) os.system(call) if source == "cdc": for lineage in params.flu_lineages: call = "python tdb/download.py -db %s_tdb -v flu --subtype %s --select assay_type:hi serum_host:human --fstem %s_%s_hi_%s_human"%(source, lineage, lineage, source, passage) print(call) os.system(call) lineage = 'h3n2' call = "python tdb/download.py -db %s_tdb -v flu --subtype %s --select assay_type:fra serum_host:human --fstem %s_%s_fra_%s_human"%(source, lineage, lineage, source, passage) print(call) os.system(call) # concatenate to create default HI strain TSVs for each subtype concatenate_titers(params, "cell", "hi") concatenate_titers(params, "cell", "fra") concatenate_titers(params, "egg", "hi") concatenate_titers(params, "egg", "fra") elif params.virus == "ebola": call = "python vdb/ebola_download.py -db vdb -v ebola --fstem ebola" print(call) os.system(call) elif params.virus == "dengue": # Download all serotypes together. call = "python vdb/dengue_download.py" print(call) os.system(call) # Download individual serotypes. serotypes = [1, 2, 3, 4] for serotype in serotypes: call = "python vdb/dengue_download.py --select serotype:%i" % serotype print(call) os.system(call) # Download titers. if params.titers: call = "python tdb/download.py -db tdb -v dengue --fstem dengue" print(call) os.system(call) elif params.virus == "zika": call = "python vdb/zika_download.py -db vdb -v zika --fstem zika" print(call) os.system(call) elif params.virus == "mumps": call = "python vdb/mumps_download.py -db vdb -v mumps --fstem mumps --resolve_method choose_genbank" print(call) os.system(call) elif params.virus == "h7n9" or params.virus == "avian": os.system("python vdb/h7n9_download.py -db vdb -v h7n9 --select locus:PB2 --fstem h7n9_pb2") os.system("python vdb/h7n9_download.py -db vdb -v h7n9 --select locus:PB1 --fstem h7n9_pb1") os.system("python vdb/h7n9_download.py -db vdb -v h7n9 --select locus:PA --fstem h7n9_pa") os.system("python vdb/h7n9_download.py -db vdb -v h7n9 --select locus:HA --fstem h7n9_ha") os.system("python vdb/h7n9_download.py -db vdb -v h7n9 --select locus:NP --fstem h7n9_np") os.system("python vdb/h7n9_download.py -db vdb -v h7n9 --select locus:NA --fstem h7n9_na") os.system("python vdb/h7n9_download.py -db vdb -v h7n9 --select locus:MP --fstem h7n9_mp") os.system("python vdb/h7n9_download.py -db vdb -v h7n9 --select locus:NS --fstem h7n9_ns") else: print("%s is an invalid virus type.\nValid viruses are flu, ebola, dengue, zika, mumps, h7n9, and avian."%(params.virus)) sys.exit(2)
blab/nextstrain-db
download_all.py
Python
agpl-3.0
7,407
/* * ################################################################ * * ProActive Parallel Suite(TM): The Java(TM) library for * Parallel, Distributed, Multi-Core Computing for * Enterprise Grids & Clouds * * Copyright (C) 1997-2011 INRIA/University of * Nice-Sophia Antipolis/ActiveEon * Contact: proactive@ow2.org or contact@activeeon.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Affero General Public License * as published by the Free Software Foundation; version 3 of * the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * If needed, contact us to obtain a release under GPL Version 2 or 3 * or a different license than the AGPL. * * Initial developer(s): The ProActive Team * http://proactive.inria.fr/team_members.htm * Contributor(s): ActiveEon Team - http://www.activeeon.com * * ################################################################ * $$ACTIVEEON_CONTRIBUTOR$$ */ package functionaltests.dataspaces; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import org.objectweb.proactive.utils.OperatingSystem; import org.ow2.proactive.process_tree_killer.ProcessTree; import functionaltests.utils.SchedulerFunctionalTest; import org.junit.Assert; import static org.junit.Assume.assumeTrue; /** * This class tests a job submission using Dataspaces. It verifies that the transfer to and from dataspaces are functional with special characters. * * @author The ProActive Team * @date 31 aug 15 * @since ProActive Scheduling 1.0 */ public class TestSpecialCharacterFileName extends SchedulerFunctionalTest { private static String fileNameWithAccent = "myfile-é"; private static String inputSpace = "data\\defaultinput\\user"; private static String outputSpace = "data\\defaultoutput\\user"; private static String schedulerStarterBatPath = "bin\\proactive-server.bat"; private static String clientBatPath = "bin\\proactive-client.bat"; private static String jobXmlPath = "scheduler\\scheduler-server\\src\\test\\resources\\functionaltests\\dataspaces\\Job_SpecialCharacterFileName.xml"; private static int TIMEOUT = 300; // in seconds private static final String ERROR_COMMAND_EXECUTION = "Error command execution"; private static String returnExprInResultBeforeTimeout(InputStream inputStream, String expr, int timeout) throws Exception { StringBuilder sb = new StringBuilder(); BufferedReader br = new BufferedReader(new InputStreamReader(inputStream)); String line; long startTime = System.currentTimeMillis(); while ((line = br.readLine()) != null && (System.currentTimeMillis() - startTime) / 1000 < timeout) { sb.append(line + System.getProperty("line.separator")); System.out.println(line); if (line.contains(expr)) { br.close(); return sb.toString(); } } br.close(); return null; } File fileWithAccentIn; File fileWithAccentOut; @org.junit.Before public void OnlyOnWindows() throws IOException { assumeTrue(OperatingSystem.getOperatingSystem() == OperatingSystem.windows); // In some cases, the current directory can be scheduler-server/. // So we have to set it to the project root dir if(new File(".").getAbsolutePath().contains("scheduler-server")) { String pathCorrector = ".." + File.separator + ".." + File.separator; inputSpace = pathCorrector + inputSpace; schedulerStarterBatPath = pathCorrector + schedulerStarterBatPath; clientBatPath = pathCorrector + clientBatPath; jobXmlPath = pathCorrector + jobXmlPath; outputSpace = pathCorrector + outputSpace; } File inputSpaceDir = new File(inputSpace); inputSpaceDir.mkdirs(); String inputSpaceDirPath = inputSpaceDir.getAbsolutePath(); fileWithAccentIn = new File(inputSpaceDirPath + File.separator + fileNameWithAccent); fileWithAccentIn.createNewFile(); } /** * Tests start here. * * @throws Throwable any exception that can be thrown during the test. */ @org.junit.Test public void run() throws Throwable { // Now we launch the scheduler from the generated script, to consider the -Dfile.encoding parameter schedulerHelper.killScheduler(); // Start the scheduler ArrayList<String> schedulerCommand = new ArrayList<>(); schedulerCommand.add(schedulerStarterBatPath); ProcessBuilder schedulerProcessBuilder = new ProcessBuilder(schedulerCommand); schedulerProcessBuilder.environment().put("processID", "0"); long startTime = System.currentTimeMillis(); if(returnExprInResultBeforeTimeout(schedulerProcessBuilder.start().getInputStream(), "started", TIMEOUT) == null) { long duration = (System.currentTimeMillis() - startTime) / 1000; // Kill & Clean ProcessTree.get().killAll(Collections.singletonMap("processID", "0")); fileWithAccentIn.delete(); throw new Exception(ERROR_COMMAND_EXECUTION + " after " + duration + "s"); } System.out.println("scheduler started!"); // Start the proactive client to submit the job ArrayList<String> clientCommand = new ArrayList<>(); clientCommand.add(clientBatPath); clientCommand.add("-l"); clientCommand.add("user"); clientCommand.add("-p"); clientCommand.add("pwd"); clientCommand.add("-s"); clientCommand.add(jobXmlPath); ProcessBuilder jobSubmissionProcessBuilder = new ProcessBuilder(clientCommand); String jobSubmissionStr; startTime = System.currentTimeMillis(); if ((jobSubmissionStr= returnExprInResultBeforeTimeout(jobSubmissionProcessBuilder.start().getInputStream(), "submitted", TIMEOUT))==null) { long duration = (System.currentTimeMillis() - startTime) / 1000; // Kill & Clean ProcessTree.get().killAll(Collections.singletonMap("processID", "0")); fileWithAccentIn.delete(); throw new Exception(ERROR_COMMAND_EXECUTION + " after " + duration + "s"); } System.out.println("job submitted!"); // Retrieve the jobId String[] result = jobSubmissionStr.split("'"); String jobId = result[result.length - 2]; // Ensure the job is finished ArrayList<String> jobStatusCommand = new ArrayList<>(); jobStatusCommand.add(clientBatPath); jobStatusCommand.add("-js"); jobStatusCommand.add(jobId); ProcessBuilder jobStatusProcessBuilder = new ProcessBuilder(jobStatusCommand); startTime = System.currentTimeMillis(); boolean jobFinished = false; while (!jobFinished && ((System.currentTimeMillis() - startTime) / 1000) < 5 * TIMEOUT) { System.out.println("SLEEP"); Thread.sleep(5000); jobFinished = (returnExprInResultBeforeTimeout(jobStatusProcessBuilder.start().getInputStream(), "FINISHED", TIMEOUT) != null); } if (!jobFinished) { // Kill & Clean ProcessTree.get().killAll(Collections.singletonMap("processID", "0")); fileWithAccentIn.delete(); throw new Exception(ERROR_COMMAND_EXECUTION); } System.out.println("job finished!"); // Assertion File outputSpaceDir = new File(outputSpace); fileWithAccentOut = new File(outputSpaceDir.getAbsolutePath() + File.separator + fileNameWithAccent); try { Assert.assertTrue(fileWithAccentOut.exists()); }finally { // Kill & Clean ProcessTree.get().killAll(Collections.singletonMap("processID", "0")); fileWithAccentIn.delete(); fileWithAccentOut.delete(); } } }
sandrineBeauche/scheduling
scheduler/scheduler-server/src/test/java/functionaltests/dataspaces/TestSpecialCharacterFileName.java
Java
agpl-3.0
8,685
<h1>Velkommen til <% print( CONFIG.APP_NAME ) %></h1> <p> Ved å bruke denne appen kan du rapportere vanlige problemer, som hull i veien og ødelagte gatelys, til myndighetene i Norge. </p> <p> Den fungerer både med og uten internett, siden vi vet at det ikke er dekning når du trenger det. </p>
FiksGataMi/fixmystreet-mobile
www/templates/nb/initial_help.html
HTML
agpl-3.0
299
/* * Copyright (c) 2010-2014 Achim 'ahzf' Friedland <achim@graphdefined.org> * This file is part of Duron <http://www.github.com/Vanaheimr/Duron> * * Licensed under the Affero GPL license, Version 3.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.gnu.org/licenses/agpl.html * * 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. */ #region Usings using System; using System.Text; using System.Reflection; #endregion namespace org.GraphDefined.Vanaheimr.Duron { internal static class InternalHelpers { internal static void AppendFieldInfo(this StringBuilder StringBuilder, FieldInfo FieldInfo, UInt32 Position, UInt32 Size) { StringBuilder.AppendLine("\"" + FieldInfo.Name + "\"" + " : { \"type\" : " + "\"" + FieldInfo.FieldType + "\", \"position\": \"" + Position + "\", \"size\": \"" + Size + "\" },"); } } }
Vanaheimr/Duron
Duron/SchemaSerializer/InternalHelpers.cs
C#
agpl-3.0
1,247
using System; using System.Collections.Generic; using Offr.Common; using Offr.Json; using Offr.Location; using Offr.Message; using Offr.Text; using NUnit.Framework; namespace Offr.Tests { [TestFixture] public class TestGoogleLocation { #region test json data const string _testJSON = @"{ ""name"": ""1500 Amphitheatre Parkway, Mountain View, CA"", ""Status"": { ""code"": 200, ""request"": ""geocode"" }, ""Placemark"": [ { ""id"": ""p1"", ""address"": ""1500 Amphitheatre Pkwy, Mountain View, CA 94043, USA"", ""AddressDetails"": { ""Accuracy"" : 8, ""Country"" : { ""AdministrativeArea"" : { ""AdministrativeAreaName"" : ""CA"", ""SubAdministrativeArea"" : { ""Locality"" : { ""LocalityName"" : ""Mountain View"", ""PostalCode"" : { ""PostalCodeNumber"" : ""94043"" }, ""Thoroughfare"" : { ""ThoroughfareName"" : ""1500 Amphitheatre Pkwy"" } }, ""SubAdministrativeAreaName"" : ""Santa Clara"" } }, ""CountryName"" : ""USA"", ""CountryNameCode"" : ""US"" } }, ""ExtendedData"": { ""LatLonBox"": { ""north"": 37.4264181, ""south"": 37.4201229, ""east"": -122.0773318, ""west"": -122.0836270 } }, ""Point"": { ""coordinates"": [ -122.0804822, 37.4232890, 0 ] } } ] }"; #endregion private SortedList<string, ILocation> _addressToExpectedTags; private ILocationProvider _target; [TestFixtureSetUp] public void SetupTestData() { _addressToExpectedTags = new SortedList<string, ILocation>(); _target = new GoogleLocationProvider(new WebRequestFactory()); string address = "1600 Amphitheatre Parkway, Mountain View, CA"; ILocation google = new Location.Location { GeoLat = (decimal)37.4217590, GeoLong = (decimal)-122.0843700, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "Mountain View")), (new Tag(TagType.loc, "CA")), (new Tag(TagType.loc, "USA"))/*, (new Tag(TagType.loc, "US"))*/ } }; _addressToExpectedTags.Add(address, google); address = "30 Fitzroy Street, New Plymouth"; ILocation fitzroy = new Location.Location { GeoLat = (decimal)-39.0443597, GeoLong = (decimal)174.1080569, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "Taranaki")), (new Tag(TagType.loc, "Fitzroy")), (new Tag(TagType.loc, "New Zealand")) /*, (new Tag(TagType.loc, "NZ"))*/ } }; _addressToExpectedTags.Add(address, fitzroy); address = "20 Lambton Quay"; ILocation lambton = new Location.Location { GeoLat = (decimal)-41.2786929, GeoLong = (decimal)174.7785322, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "Wellington")), (new Tag(TagType.loc, "Wellington Central")), (new Tag(TagType.loc, "New Zealand")),/*, (new Tag(TagType.loc, "NZ"))*/ } }; _addressToExpectedTags.Add(address, lambton); address = "20 Pitt Street,Sydney"; ILocation sydney = new Location.Location { GeoLat = (decimal)-33.816636, GeoLong = (decimal)150.997453, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "New South Wales")), (new Tag(TagType.loc, "Sydney")), (new Tag(TagType.loc, "Australia"))/*, (new Tag(TagType.loc, "AU"))*/ } }; _addressToExpectedTags.Add(address, sydney); address = "Sheikh+Zayed+Road,+Dubai,+UAE"; ILocation uae = new Location.Location { GeoLat = (decimal) /*25.2286509*/25.0621743, GeoLong = (decimal) /*55.2876798*/55.1302461, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "Dubai")), (new Tag(TagType.loc, "Dubai")), (new Tag(TagType.loc, "United Arab Emirates"))/*, (new Tag(TagType.loc, "AE"))*/ } }; _addressToExpectedTags.Add(address, uae); address = "30+Rue+Baudin,+Paris,+France"; ILocation france = new Location.Location { GeoLat = (decimal)48.895, GeoLong = (decimal)2.2520471, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "Courbevoie")), (new Tag(TagType.loc, "île-de-france")), (new Tag(TagType.loc, "France"))/*, (new Tag(TagType.loc, "Fr"))*/ } }; _addressToExpectedTags.Add(address, france); address = "30 Borough Rd, London"; ILocation uk = new Location.Location { GeoLat = (decimal)51.4988744, GeoLong = (decimal)-0.1018722, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "Camberwell")), (new Tag(TagType.loc, "Greater London")), (new Tag(TagType.loc, "UK"))/*, (new Tag(TagType.loc, "GB"))*/ } }; _addressToExpectedTags.Add(address, uk); address = "halswell"; ILocation halswell = new Location.Location { GeoLat = (decimal)-43.5854361, GeoLong = (decimal)172.5710715, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "Halswell")), (new Tag(TagType.loc, "Canterbury")), (new Tag(TagType.loc, "New Zealand")) /*, (new Tag(TagType.loc, "GB"))*/ } }; _addressToExpectedTags.Add(address, halswell); address = "Dilworth street"; ILocation dilworth = new Location.Location { GeoLat = (decimal)-43.5317993, GeoLong = (decimal)172.6019896, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "Riccarton")), (new Tag(TagType.loc, "Canterbury")), (new Tag(TagType.loc, "New Zealand"))/*, (new Tag(TagType.loc, "GB"))*/ } }; _addressToExpectedTags.Add(address, dilworth); address = "Saint Martins"; ILocation stMartins = new Location.Location { GeoLat = (decimal)-43.555463, GeoLong = (decimal)172.6517792, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "St Martins")), (new Tag(TagType.loc, "Canterbury")), (new Tag(TagType.loc, "New Zealand"))/*, (new Tag(TagType.loc, "GB"))*/ } }; _addressToExpectedTags.Add(address, stMartins); } [Test] public void TestDeserialize() { GoogleResultSet resultSet = JSON.Deserialize<GoogleResultSet>(_testJSON); Assert.AreEqual("1500 Amphitheatre Parkway, Mountain View, CA", resultSet.name, "name did not serialize correctly"); } [Test] public void TestLiveGoogleParse() { foreach (string address in _addressToExpectedTags.Keys) { ILocation location = _target.Parse(address); Console.Out.WriteLine("Parsed:"); Console.Out.WriteLine(JSON.Serialize(location)); ILocation expected = _addressToExpectedTags[address]; AssertLocationEquality(address, expected, location); } } //[Test] //public void TestLiveGoogleParseWithTwitterLocation() //{ // String address = "30 Borough Rd"; // ILocation nonSpecific = new Location.Location // { // GeoLat = (decimal)51.4989035, // GeoLong = (decimal)-0.101, // Address = address, // Tags = new List<ITag> // { // (new Tag(TagType.loc, "Camberwell")), // (new Tag(TagType.loc, "Greater London")), // (new Tag(TagType.loc, "United Kingdom"))/*, // (new Tag(TagType.loc, "GB"))*/ // } // }; // // Normally the result london is not the first result for this query // ILocation location = _target.Parse(address, "Greater London"); // ILocation expected = nonSpecific; // AssertLocationEquality(address, expected, location); //} private static void AssertLocationEquality(string forAddress, ILocation expected, ILocation actual) { //because of the fact that google coordinates like moving around for some reason lower the precision Assert.AreEqual(expected.Address, actual.Address, "Address for '" + forAddress + "' was not as expected"); foreach (ITag locationTag in expected.Tags) { if (!actual.Tags.Contains(locationTag)) { Console.Out.WriteLine("Expected:"); Console.Out.WriteLine(JSON.Serialize(expected)); Console.Out.WriteLine("Actual:"); Console.Out.WriteLine(JSON.Serialize(actual)); } Assert.That(actual.Tags.Contains(locationTag), "Expected tag " + locationTag + " was not contained in result for " + forAddress); } foreach (ITag locationTag in actual.Tags) { Assert.That(expected.Tags.Contains(locationTag), locationTag + " unexpectedly contained in result for " + forAddress); } Assert.AreEqual(expected.Tags.Count, actual.Tags.Count, "Somehow, inexplicably, the counts for expected vs actual location tags are different even though they contain the exact same set of tags"); Assert.AreEqual(Decimal.Parse(expected.GeoLat.ToString().Substring(0, 6)), Decimal.Parse(actual.GeoLat.ToString().Substring(0, 6)), "GeoLat for '" + forAddress + "' was not as expected"); Assert.AreEqual(Decimal.Parse(expected.GeoLong.ToString().Substring(0, 6)), Decimal.Parse(actual.GeoLong.ToString().Substring(0, 6)), "GeoLong for '" + forAddress + "' was not as expected"); } [Test] public void TestNonStrictLColon() { // a specific real example for which i know the query was failing ILocation location = _target.ParseFromApproxText("Paekakariki for #free http://bit.ly/message0Info pic http://twitpic.com/r5aon #mulch"); Assert.AreEqual("Paekakariki", location.AddressText); } [Test] public void TestLandMarkLocation() { String address = "Little Oneroa"; ILocation expected = new Location.Location { GeoLat = (decimal)-36.7845550, GeoLong = (decimal)175.027010, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "New Zealand")), (new Tag(TagType.loc, "Auckland")), (new Tag(TagType.loc, "Oneroa")), //(new Tag(TagType.loc, "United Kingdom"))/*, //(new Tag(TagType.loc, "GB"))*/ } }; ILocation location = _target.Parse(address); AssertLocationEquality(address, expected, location); } } }
utunga/Tradeify
Offr.Tests/TestGoogleLocation.cs
C#
agpl-3.0
15,813
class Activity < ApplicationRecord belongs_to :program, inverse_of: :activities belongs_to :dance, optional: true end
dcmorse/contra
app/models/activity.rb
Ruby
agpl-3.0
122
<!DOCTYPE html> <html lang="en" > <head> <title>連桿機構-2 - 40523122的個人作業網誌</title> <!-- Using the latest rendering mode for IE --> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style type="text/css"> /*some stuff for output/input prompts*/ div.cell{border:1px solid transparent;display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:vertical;-moz-box-align:stretch;display:box;box-orient:vertical;box-align:stretch;display:flex;flex-direction:column;align-items:stretch}div.cell.selected{border-radius:4px;border:thin #ababab solid} div.cell.edit_mode{border-radius:4px;border:thin #008000 solid} div.cell{width:100%;padding:5px 5px 5px 0;margin:0;outline:none} div.prompt{min-width:11ex;padding:.4em;margin:0;font-family:monospace;text-align:right;line-height:1.21429em} @media (max-width:480px){div.prompt{text-align:left}}div.inner_cell{display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:vertical;-moz-box-align:stretch;display:box;box-orient:vertical;box-align:stretch;display:flex;flex-direction:column;align-items:stretch;-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;flex:1} div.input_area{border:1px solid #cfcfcf;border-radius:4px;background:#f7f7f7;line-height:1.21429em} div.prompt:empty{padding-top:0;padding-bottom:0} div.input{page-break-inside:avoid;display:-webkit-box;-webkit-box-orient:horizontal;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:horizontal;-moz-box-align:stretch;display:box;box-orient:horizontal;box-align:stretch;} div.inner_cell{width:90%;} div.input_area{border:1px solid #cfcfcf;border-radius:4px;background:#f7f7f7;} div.input_prompt{color:navy;border-top:1px solid transparent;} div.output_wrapper{margin-top:5px;position:relative;display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:vertical;-moz-box-align:stretch;display:box;box-orient:vertical;box-align:stretch;width:100%;} div.output_scroll{height:24em;width:100%;overflow:auto;border-radius:4px;-webkit-box-shadow:inset 0 2px 8px rgba(0, 0, 0, 0.8);-moz-box-shadow:inset 0 2px 8px rgba(0, 0, 0, 0.8);box-shadow:inset 0 2px 8px rgba(0, 0, 0, 0.8);} div.output_collapsed{margin:0px;padding:0px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:vertical;-moz-box-align:stretch;display:box;box-orient:vertical;box-align:stretch;width:100%;} div.out_prompt_overlay{height:100%;padding:0px 0.4em;position:absolute;border-radius:4px;} div.out_prompt_overlay:hover{-webkit-box-shadow:inset 0 0 1px #000000;-moz-box-shadow:inset 0 0 1px #000000;box-shadow:inset 0 0 1px #000000;background:rgba(240, 240, 240, 0.5);} div.output_prompt{color:darkred;} a.anchor-link:link{text-decoration:none;padding:0px 20px;visibility:hidden;} h1:hover .anchor-link,h2:hover .anchor-link,h3:hover .anchor-link,h4:hover .anchor-link,h5:hover .anchor-link,h6:hover .anchor-link{visibility:visible;} /* end stuff for output/input prompts*/ .highlight-ipynb .hll { background-color: #ffffcc } .highlight-ipynb { background: #f8f8f8; } .highlight-ipynb .c { color: #408080; font-style: italic } /* Comment */ .highlight-ipynb .err { border: 1px solid #FF0000 } /* Error */ .highlight-ipynb .k { color: #008000; font-weight: bold } /* Keyword */ .highlight-ipynb .o { color: #666666 } /* Operator */ .highlight-ipynb .cm { color: #408080; font-style: italic } /* Comment.Multiline */ .highlight-ipynb .cp { color: #BC7A00 } /* Comment.Preproc */ .highlight-ipynb .c1 { color: #408080; font-style: italic } /* Comment.Single */ .highlight-ipynb .cs { color: #408080; font-style: italic } /* Comment.Special */ .highlight-ipynb .gd { color: #A00000 } /* Generic.Deleted */ .highlight-ipynb .ge { font-style: italic } /* Generic.Emph */ .highlight-ipynb .gr { color: #FF0000 } /* Generic.Error */ .highlight-ipynb .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .highlight-ipynb .gi { color: #00A000 } /* Generic.Inserted */ .highlight-ipynb .go { color: #888888 } /* Generic.Output */ .highlight-ipynb .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ .highlight-ipynb .gs { font-weight: bold } /* Generic.Strong */ .highlight-ipynb .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ .highlight-ipynb .gt { color: #0044DD } /* Generic.Traceback */ .highlight-ipynb .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ .highlight-ipynb .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ .highlight-ipynb .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ .highlight-ipynb .kp { color: #008000 } /* Keyword.Pseudo */ .highlight-ipynb .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ .highlight-ipynb .kt { color: #B00040 } /* Keyword.Type */ .highlight-ipynb .m { color: #666666 } /* Literal.Number */ .highlight-ipynb .s { color: #BA2121 } /* Literal.String */ .highlight-ipynb .na { color: #7D9029 } /* Name.Attribute */ .highlight-ipynb .nb { color: #008000 } /* Name.Builtin */ .highlight-ipynb .nc { color: #0000FF; font-weight: bold } /* Name.Class */ .highlight-ipynb .no { color: #880000 } /* Name.Constant */ .highlight-ipynb .nd { color: #AA22FF } /* Name.Decorator */ .highlight-ipynb .ni { color: #999999; font-weight: bold } /* Name.Entity */ .highlight-ipynb .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ .highlight-ipynb .nf { color: #0000FF } /* Name.Function */ .highlight-ipynb .nl { color: #A0A000 } /* Name.Label */ .highlight-ipynb .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ .highlight-ipynb .nt { color: #008000; font-weight: bold } /* Name.Tag */ .highlight-ipynb .nv { color: #19177C } /* Name.Variable */ .highlight-ipynb .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ .highlight-ipynb .w { color: #bbbbbb } /* Text.Whitespace */ .highlight-ipynb .mf { color: #666666 } /* Literal.Number.Float */ .highlight-ipynb .mh { color: #666666 } /* Literal.Number.Hex */ .highlight-ipynb .mi { color: #666666 } /* Literal.Number.Integer */ .highlight-ipynb .mo { color: #666666 } /* Literal.Number.Oct */ .highlight-ipynb .sb { color: #BA2121 } /* Literal.String.Backtick */ .highlight-ipynb .sc { color: #BA2121 } /* Literal.String.Char */ .highlight-ipynb .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ .highlight-ipynb .s2 { color: #BA2121 } /* Literal.String.Double */ .highlight-ipynb .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ .highlight-ipynb .sh { color: #BA2121 } /* Literal.String.Heredoc */ .highlight-ipynb .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ .highlight-ipynb .sx { color: #008000 } /* Literal.String.Other */ .highlight-ipynb .sr { color: #BB6688 } /* Literal.String.Regex */ .highlight-ipynb .s1 { color: #BA2121 } /* Literal.String.Single */ .highlight-ipynb .ss { color: #19177C } /* Literal.String.Symbol */ .highlight-ipynb .bp { color: #008000 } /* Name.Builtin.Pseudo */ .highlight-ipynb .vc { color: #19177C } /* Name.Variable.Class */ .highlight-ipynb .vg { color: #19177C } /* Name.Variable.Global */ .highlight-ipynb .vi { color: #19177C } /* Name.Variable.Instance */ .highlight-ipynb .il { color: #666666 } /* Literal.Number.Integer.Long */ </style> <style type="text/css"> /* Overrides of notebook CSS for static HTML export */ div.entry-content { overflow: visible; padding: 8px; } .input_area { padding: 0.2em; } a.heading-anchor { white-space: normal; } .rendered_html code { font-size: .8em; } pre.ipynb { color: black; background: #f7f7f7; border: none; box-shadow: none; margin-bottom: 0; padding: 0; margin: 0px; font-size: 13px; } /* remove the prompt div from text cells */ div.text_cell .prompt { display: none; } /* remove horizontal padding from text cells, */ /* so it aligns with outer body text */ div.text_cell_render { padding: 0.5em 0em; } img.anim_icon{padding:0; border:0; vertical-align:middle; -webkit-box-shadow:none; -box-shadow:none} </style> <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" type="text/javascript"></script> <script type="text/javascript"> init_mathjax = function() { if (window.MathJax) { // MathJax loaded MathJax.Hub.Config({ tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ], displayMath: [ ['$$','$$'], ["\\[","\\]"] ] }, displayAlign: 'left', // Change this to 'center' to center equations. "HTML-CSS": { styles: {'.MathJax_Display': {"margin": 0}} } }); MathJax.Hub.Queue(["Typeset",MathJax.Hub]); } } init_mathjax(); </script> <link rel="canonical" href="./lian-gan-ji-gou-2.html"> <meta name="author" content="40523122" /> <meta name="keywords" content="練習" /> <meta property="og:site_name" content="40523122的個人作業網誌" /> <meta property="og:type" content="article"/> <meta property="og:title" content="連桿機構-2"/> <meta property="og:url" content="./lian-gan-ji-gou-2.html"/> <meta property="og:description" content=""/> <meta property="article:published_time" content="2017-01-13" /> <meta property="article:section" content="practice" /> <meta property="article:tag" content="練習" /> <meta property="article:author" content="40523122" /> <!-- Bootstrap --> <link rel="stylesheet" href="./theme/css/bootstrap.united.min.css" type="text/css"/> <link href="./theme/css/font-awesome.min.css" rel="stylesheet"> <link href="./theme/css/pygments/monokai.css" rel="stylesheet"> <link href="./theme/tipuesearch/tipuesearch.css" rel="stylesheet"> <link rel="stylesheet" href="./theme/css/style.css" type="text/css"/> <link href="./feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="40523122的個人作業網誌 ATOM Feed"/> <script type="text/javascript" src="http://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shCore.js"></script> <script type="text/javascript" src="http://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushJScript.js"></script> <script type="text/javascript" src="http://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushJava.js"></script> <script type="text/javascript" src="http://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushPython.js"></script> <script type="text/javascript" src="http://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushSql.js"></script> <script type="text/javascript" src="http://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushXml.js"></script> <script type="text/javascript" src="http://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushPhp.js"></script> <script type="text/javascript" src="http://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushCpp.js"></script> <script type="text/javascript" src="http://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushCss.js"></script> <script type="text/javascript" src="http://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushCSharp.js"></script> <script type="text/javascript" src="http://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushBash.js"></script> <script type='text/javascript'> (function(){ var corecss = document.createElement('link'); var themecss = document.createElement('link'); var corecssurl = "http://chiamingyen.github.io/kmolab_data/files/syntaxhighlighter/css/shCore.css"; if ( corecss.setAttribute ) { corecss.setAttribute( "rel", "stylesheet" ); corecss.setAttribute( "type", "text/css" ); corecss.setAttribute( "href", corecssurl ); } else { corecss.rel = "stylesheet"; corecss.href = corecssurl; } document.getElementsByTagName("head")[0].insertBefore( corecss, document.getElementById("syntaxhighlighteranchor") ); var themecssurl = "http://chiamingyen.github.io/kmolab_data/files/syntaxhighlighter/css/shThemeDefault.css?ver=3.0.9b"; if ( themecss.setAttribute ) { themecss.setAttribute( "rel", "stylesheet" ); themecss.setAttribute( "type", "text/css" ); themecss.setAttribute( "href", themecssurl ); } else { themecss.rel = "stylesheet"; themecss.href = themecssurl; } //document.getElementById("syntaxhighlighteranchor").appendChild(themecss); document.getElementsByTagName("head")[0].insertBefore( themecss, document.getElementById("syntaxhighlighteranchor") ); })(); SyntaxHighlighter.config.strings.expandSource = '+ expand source'; SyntaxHighlighter.config.strings.help = '?'; SyntaxHighlighter.config.strings.alert = 'SyntaxHighlighter\n\n'; SyntaxHighlighter.config.strings.noBrush = 'Can\'t find brush for: '; SyntaxHighlighter.config.strings.brushNotHtmlScript = 'Brush wasn\'t configured for html-script option: '; SyntaxHighlighter.defaults['pad-line-numbers'] = false; SyntaxHighlighter.defaults['toolbar'] = false; SyntaxHighlighter.all(); </script> </head> <body> <div class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a href="./" class="navbar-brand"> 40523122的個人作業網誌 </a> </div> <div class="collapse navbar-collapse navbar-ex1-collapse"> <ul class="nav navbar-nav"> <li><a href="./pages/about/"> About </a></li> <li > <a href="./category/hw.html">Hw</a> </li> <li class="active"> <a href="./category/practice.html">Practice</a> </li> </ul> <ul class="nav navbar-nav navbar-right"> <li><span> <form class="navbar-search" action="./search.html"> <input type="text" class="search-query" placeholder="Search" name="q" id="tipue_search_input" required> </form></span> </li> <li><a href="./archives.html"><i class="fa fa-th-list"></i><span class="icon-label">Archives</span></a></li> </ul> </div> <!-- /.navbar-collapse --> </div> </div> <!-- /.navbar --> <!-- Banner --> <!-- End Banner --> <div class="container"> <div class="row"> <div class="col-sm-9"> <section id="content"> <article> <header class="page-header"> <h1> <a href="./lian-gan-ji-gou-2.html" rel="bookmark" title="Permalink to 連桿機構-2"> 連桿機構-2 </a> </h1> </header> <div class="entry-content"> <div class="panel"> <div class="panel-body"> <footer class="post-info"> <span class="label label-default">Date</span> <span class="published"> <i class="fa fa-calendar"></i><time datetime="2017-01-13T14:00:00+08:00"> 週五 13 一月 2017</time> </span> <span class="label label-default">By</span> <a href="./author/40523122.html"><i class="fa fa-user"></i> 40523122</a> <span class="label label-default">Tags</span> <a href="./tag/lian-xi.html">練習</a> </footer><!-- /.post-info --> </div> </div> <!-- PELICAN_END_SUMMARY --> <!-- 導入 Brython 標準程式庫 --> <script type="text/javascript" src="https://cdn.rawgit.com/brython-dev/brython/master/www/src/brython_dist.js"> </script> <!-- 啟動 Brython --> <script> window.onload=function(){ brython(1); } </script> <!-- 以下可以執行 Brython 程式 --> <canvas id="onebar" width="800" height="400"></canvas> <script type="text/python3"> from browser import document from browser import window from browser import timer import math canvas = document["onebar"] ctx = canvas.getContext("2d") # 畫圓函式 def circle(x,y,r): ctx.beginPath() ctx.arc(x, y, r, 0, math.pi*2, True) ctx.fill() ctx.closePath() #畫直線函式 def line(x1, y1, x2, y2): # 以下可以利用 ctx 物件進行畫圖 # 先畫一條直線 ctx.beginPath() # 設定線的寬度為 1 個單位 ctx.lineWidth = 1 # 將畫筆移動到 (x1, y1) 座標點 ctx.moveTo(x1, y1) # 然後畫直線到 (x2, y2) 座標點 ctx.lineTo(x2, y2) # 設定顏色為藍色, 也可以使用 "rgb(0, 0, 255)" 字串設定顏色值 ctx.strokeStyle = "blue" # 實際執行畫線 ctx.stroke() ctx.closePath() line(200, 200, 200, 300) circle(200, 200, 5) x1 = 200 y1 = 200 r = 100 deg = math.pi/180 theta = 0 def animate(): global theta # 刷新畫布 ctx.clearRect(0, 0, canvas.width, canvas.height) # 逐一重新繪製直線與圓心球 x2 = x1 + r*math.cos(theta*deg) y2 = y1 + r*math.sin(theta*deg) line(x1, y1, x2, y2) x3 = 400 y3 = 200 x4 = x3 + r*math.cos(theta*deg) y4 = y3 + r*math.sin(theta*deg) line(x3, y3, x4, y4) # 再加一條小線段 x5 = x2 + 200 y5 = x2 + 200 x5 = x4 y5 = y4 line(x2, y2, x5, y5) circle(x1, y1, 5) circle(400, y1, 5) theta += 1 timer.set_interval(animate, 50) </script> <pre class="brush: python"> # 畫圓函式 def circle(x,y,r): ctx.beginPath() ctx.arc(x, y, r, 0, math.pi*2, True) ctx.fill() ctx.closePath() #畫直線函式 def line(x1, y1, x2, y2): # 以下可以利用 ctx 物件進行畫圖 # 先畫一條直線 ctx.beginPath() # 設定線的寬度為 1 個單位 ctx.lineWidth = 1 # 將畫筆移動到 (x1, y1) 座標點 ctx.moveTo(x1, y1) # 然後畫直線到 (x2, y2) 座標點 ctx.lineTo(x2, y2) # 設定顏色為藍色, 也可以使用 "rgb(0, 0, 255)" 字串設定顏色值 ctx.strokeStyle = "blue" # 實際執行畫線 ctx.stroke() ctx.closePath() line(200, 200, 200, 300) circle(200, 200, 5) x1 = 200 y1 = 200 r = 100 deg = math.pi/180 theta = 0 def animate(): global theta # 刷新畫布 ctx.clearRect(0, 0, canvas.width, canvas.height) # 逐一重新繪製直線與圓心球 x2 = x1 + r*math.cos(theta*deg) y2 = y1 + r*math.sin(theta*deg) line(x1, y1, x2, y2) x3 = 400 y3 = 200 x4 = x3 + r*math.cos(theta*deg) y4 = y3 + r*math.sin(theta*deg) line(x3, y3, x4, y4) # 再加一條小線段 x5 = x2 + 200 y5 = x2 + 200 x5 = x4 y5 = y4 line(x2, y2, x5, y5) circle(x1, y1, 5) circle(400, y1, 5) theta += 1 timer.set_interval(animate, 50) </script> </pre> <p>將上一次學得連桿發揮成為更像真實狀況 雖然還有些狀況 但多加強依定能多改善</p> </div> <!-- /.entry-content --> </article> </section> </div> <div class="col-sm-3" id="sidebar"> <aside> <section class="well well-sm"> <ul class="list-group list-group-flush"> <li class="list-group-item"><h4><i class="fa fa-home fa-lg"></i><span class="icon-label">Recent Posts</span></h4> <ul class="list-group" id="recentposts"> <li class="list-group-item"> <a href="./lian-gan-ji-gou-2.html"> 連桿機構-2 </a> </li> <li class="list-group-item"> <a href="./lian-gan-ji-gou.html"> 連桿機構 </a> </li> <li class="list-group-item"> <a href="./buttonchan-sheng-luan-shu.html"> button產生亂數 </a> </li> <li class="list-group-item"> <a href="./buttonlian-xi.html"> button練習 </a> </li> <li class="list-group-item"> <a href="./ji-ta-he-xian.html"> 吉他和弦 </a> </li> </ul> </li> <li class="list-group-item"><a href="./categories.html"><h4><i class="fa fa-home fa-lg"></i><span class="icon-label">Categories</span></h4></a> <ul class="list-group" id="categories"> <li class="list-group-item"> <a href="./category/hw.html"> <i class="fa fa-folder-open fa-lg"></i> hw </a> </li> <li class="list-group-item"> <a href="./category/practice.html"> <i class="fa fa-folder-open fa-lg"></i> practice </a> </li> </ul> </li> <li class="list-group-item"><a href="./tags.html"><h4><i class="fa fa-tags fa-lg"></i><span class="icon-label">Tags</span></h4></a> <ul class="list-group list-inline tagcloud" id="tags"> </ul> </li> <li class="list-group-item"><h4><i class="fa fa-external-link-square fa-lg"></i><span class="icon-label">Links</span></h4> <ul class="list-group" id="links"> <li class="list-group-item"> <a href="http://getpelican.com/" target="_blank"> Pelican </a> </li> <li class="list-group-item"> <a href="https://github.com/DandyDev/pelican-bootstrap3/" target="_blank"> pelican-bootstrap3 </a> </li> <li class="list-group-item"> <a href="https://github.com/getpelican/pelican-plugins" target="_blank"> pelican-plugins </a> </li> <li class="list-group-item"> <a href="https://github.com/Tipue/Tipue-Search" target="_blank"> Tipue search </a> </li> </ul> </li> </ul> </section> </aside> </div> </div> </div> <footer> <div class="container"> <hr> <div class="row"> <div class="col-xs-10">&copy; 2017 紀錦川 &middot; Powered by <a href="https://github.com/DandyDev/pelican-bootstrap3" target="_blank">pelican-bootstrap3</a>, <a href="http://docs.getpelican.com/" target="_blank">Pelican</a>, <a href="http://getbootstrap.com" target="_blank">Bootstrap</a> </div> <div class="col-xs-2"><p class="pull-right"><i class="fa fa-arrow-up"></i> <a href="#">Back to top</a></p></div> </div> </div> </footer> <script src="./theme/js/jquery.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="./theme/js/bootstrap.min.js"></script> <!-- Enable responsive features in IE8 with Respond.js (https://github.com/scottjehl/Respond) --> <script src="./theme/js/respond.min.js"></script> </body> </html>
s40523122/2016fallcp_hw
blog/lian-gan-ji-gou-2.html
HTML
agpl-3.0
24,004
package org.cmdbuild.config; import java.util.Arrays; import java.util.Collections; import java.util.Set; import org.cmdbuild.auth.CasAuthenticator; import org.cmdbuild.auth.DefaultAuthenticationService; import org.cmdbuild.auth.HeaderAuthenticator; import org.cmdbuild.auth.LdapAuthenticator; import org.cmdbuild.services.Settings; import com.google.common.collect.Sets; public class AuthProperties extends DefaultProperties implements HeaderAuthenticator.Configuration, CasAuthenticator.Configuration, LdapAuthenticator.Configuration, DefaultAuthenticationService.Configuration { private static final long serialVersionUID = 1L; private static final String MODULE_NAME = "auth"; private static final String SERVICE_USERS = "serviceusers"; private static final String PRIVILEGED_SERVICE_USERS = "serviceusers.privileged"; private static final String FORCE_WS_PASSWORD_DIGEST = "force.ws.password.digest"; private static final String HEADER_ATTRIBUTE_NAME = "header.attribute.name"; private static final String CAS_SERVER_URL = "cas.server.url"; private static final String CAS_LOGIN_PAGE = "cas.login.page"; private static final String CAS_SERVICE_PARAM = "cas.service.param"; private static final String CAS_TICKET_PARAM = "cas.ticket.param"; private static final String LDAP_SERVER_ADDRESS = "ldap.server.address"; private static final String LDAP_SERVER_PORT = "ldap.server.port"; private static final String LDAP_USE_SSL = "ldap.use.ssl"; private static final String LDAP_BASEDN = "ldap.basedn"; private static final String LDAP_BIND_ATTRIBUTE = "ldap.bind.attribute"; private static final String LDAP_SEARCH_FILTER = "ldap.search.filter"; private static final String LDAP_AUTHENTICATION_METHOD = "ldap.search.auth.method"; private static final String LDAP_AUTHENTICATION_PRINCIPAL = "ldap.search.auth.principal"; private static final String LDAP_AUTHENTICATION_PASSWORD = "ldap.search.auth.password"; private static final String AUTH_METHODS = "auth.methods"; private static final String AUTO_LOGIN = "autologin"; public AuthProperties() { super(); setProperty(SERVICE_USERS, ""); setProperty(PRIVILEGED_SERVICE_USERS, ""); setProperty(FORCE_WS_PASSWORD_DIGEST, String.valueOf(true)); setProperty(AUTH_METHODS, "DBAuthenticator"); setProperty(HEADER_ATTRIBUTE_NAME, "username"); setProperty(CAS_SERVER_URL, ""); setProperty(CAS_LOGIN_PAGE, "/login"); setProperty(LDAP_BASEDN, ""); setProperty(LDAP_SERVER_ADDRESS, ""); setProperty(LDAP_SERVER_PORT, "389"); setProperty(LDAP_USE_SSL, String.valueOf(false)); setProperty(LDAP_BIND_ATTRIBUTE, ""); setProperty(LDAP_SEARCH_FILTER, ""); setProperty(LDAP_AUTHENTICATION_METHOD, ""); setProperty(LDAP_AUTHENTICATION_PRINCIPAL, ""); setProperty(LDAP_AUTHENTICATION_PASSWORD, ""); } public boolean isLdapConfigured() { return !("".equals(getLdapBindAttribute()) || "".equals(getLdapBaseDN()) || "".equals(getLdapServerAddress())); } public boolean isHeaderConfigured() { return !("".equals(getHeaderAttributeName())); } public boolean isCasConfigured() { return !("".equals(getCasServerUrl())); } public static AuthProperties getInstance() { return (AuthProperties) Settings.getInstance().getModule(MODULE_NAME); } @Override public Set<String> getServiceUsers() { final String commaSeparatedUsers = getProperty(SERVICE_USERS); if (commaSeparatedUsers.isEmpty()) { return Collections.emptySet(); } else { final Set<String> serviceUsers = Sets.newHashSet(); final String[] simpleServiceUsers = commaSeparatedUsers.split(","); serviceUsers.addAll(Arrays.asList(simpleServiceUsers)); serviceUsers.addAll(getPrivilegedServiceUsers()); return serviceUsers; } } public Set<String> getPrivilegedServiceUsers() { final String commaSeparatedUsers = getProperty(PRIVILEGED_SERVICE_USERS); if (commaSeparatedUsers.isEmpty()) { return Collections.emptySet(); } else { final String[] privilegedServiceUsers = commaSeparatedUsers.split(","); return Sets.newHashSet(Arrays.asList(privilegedServiceUsers)); } } public boolean getForceWSPasswordDigest() { return Boolean.parseBoolean(getProperty(FORCE_WS_PASSWORD_DIGEST)); } @Override public String getHeaderAttributeName() { return getProperty(HEADER_ATTRIBUTE_NAME); } @Override public String getCasServerUrl() { return getProperty(CAS_SERVER_URL); } @Override public String getCasLoginPage() { return getProperty(CAS_LOGIN_PAGE); } @Override public String getCasTicketParam() { return getProperty(CAS_TICKET_PARAM, "ticket"); } @Override public String getCasServiceParam() { return getProperty(CAS_SERVICE_PARAM, "service"); } @Override public String getLdapUrl() { return String.format("%s://%s:%s", getLdapProtocol(), getLdapServerAddress(), getLdapServerPort()); } private String getLdapServerAddress() { return getProperty(LDAP_SERVER_ADDRESS); } private String getLdapServerPort() { return getProperty(LDAP_SERVER_PORT); } private String getLdapProtocol() { return getLdapUseSsl() ? "ldaps" : "ldap"; } private boolean getLdapUseSsl() { return Boolean.parseBoolean(getProperty(LDAP_USE_SSL)); } @Override public String getLdapBaseDN() { return getProperty(LDAP_BASEDN); } @Override public String getLdapBindAttribute() { return getProperty(LDAP_BIND_ATTRIBUTE); } @Override public String getLdapSearchFilter() { return getProperty(LDAP_SEARCH_FILTER); } @Override public String getLdapAuthenticationMethod() { return getProperty(LDAP_AUTHENTICATION_METHOD); } @Override public String getLdapPrincipal() { return getProperty(LDAP_AUTHENTICATION_PRINCIPAL); } @Override public String getLdapPrincipalCredentials() { return getProperty(LDAP_AUTHENTICATION_PASSWORD); } @Override public Set<String> getActiveAuthenticators() { final String csMethods = getProperty(AUTH_METHODS); if (csMethods.isEmpty()) { return Collections.emptySet(); } else { return Sets.newHashSet(csMethods.split(",")); } } public String getAutologin() { return getProperty(AUTO_LOGIN, ""); } }
jzinedine/CMDBuild
cmdbuild/src/main/java/org/cmdbuild/config/AuthProperties.java
Java
agpl-3.0
6,106
<?php class ItemModel extends CFormModel { public $id; public $description; public $original_description; public $shared; public $user_id; public $username; public $quantity; public $expiration_date; public $creation_date; public $hisLove; public $project_id; public $project_name; public function rules() { return array( array('id, shared, description, quantity, expiration_date, creation_date', 'required'), array('username, user_id, original_description, hisLove, project_id, project_name', 'safe'), ); } /** * Declares attribute labels. */ public function attributeLabels() { return array( 'id'=>Yii::t('item', 'id'), 'description'=>Yii::t('item', 'description'), 'quantity'=>Yii::t('item', 'quantity'), ); } public function browse($tags, $shared = 1, $minLove = 1, $options = '', $pageCurrent = 1, $pageSize = 10 , $includedUserId = null, $excludeId = null) { $sixMonthAgo = new DateTime('-6 month'); $sixMonthAgo = $sixMonthAgo->format('Y-m-d'); $command = Yii::app()->db->createCommand(); $offset = ($pageCurrent - 1) * $pageSize; $userId = Yii::app()->user->getState('user_id'); $sql = "select i.*, coalesce(u.real_name, username) as user_name "; if ($userId > 0) $sql .= ', love_ab.love, p.name as project_name, p.id as project_id '; else $sql .= ', 1 as love '; $sql .= 'from item i inner join user u on u.id = i.user_id '; $sql .= 'left join project p on p.id = i.project_id '; if ($userId > 0) { $sql .= "left join user_heart love_ab on love_ab.from_user_id = $userId and love_ab.to_user_id = i.user_id "; $sql .= "left join user_heart love_ba on love_ba.from_user_id = i.user_id and love_ba.to_user_id = $userId "; } if ($includedUserId > 0) { $sql .= "left join user_heart love_ac on love_ac.from_user_id = $userId and love_ac.to_user_id = $includedUserId "; $sql .= "left join user_heart love_ca on love_ca.from_user_id = $includedUserId and love_ca.to_user_id = $userId "; $sql .= "left join user_heart love_bc on love_bc.from_user_id = i.user_id and love_bc.to_user_id = $includedUserId "; $sql .= "left join user_heart love_cb on love_cb.from_user_id = $includedUserId and love_cb.to_user_id = i.user_id "; } $sql .= 'where i.quantity > 0 '; $sql .= "and i.expiration_date >= curdate() "; $sql .= "and i.creation_date >= '$sixMonthAgo' "; $sql .= "and i.shared = $shared "; if ($userId > 0) $sql .= "and (coalesce(love_ab.love, 1) >= $minLove) and (coalesce(love_ba.love, 1) > 0) "; if ($includedUserId > 0) { $sql .= 'and (love_ac.love > 0 or love_ac.love is null) and (love_ca.love > 0 or love_ca.love is null) '; $sql .= 'and (love_bc.love > 0 or love_bc.love is null) and (love_cb.love > 0 or love_cb.love is null) '; } if (isset($tags) && trim($tags) != '') { $splitTags = explode(' ', $tags); foreach($splitTags as $splitTag) { if (substr($splitTag, 0, 1) == '+') $sql .= 'and i.description like \'%'.substr($splitTag, 1, strlen ($splitTag) - 1) .'%\' '; else $sql .= 'and i.description not like \'%'.substr($splitTag, 1, strlen ($splitTag) - 1) .'%\' '; } } if ($options != '') { $sql .= 'and ( 1 = 0 '; if (substr_count($options,'newItem') > 0) $sql .= "or not exists(select 1 from solution s where s.item_id = i.id) "; if (substr_count($options,'draftSolutions') > 0) $sql .= "or exists(select 1 from solution s where s.status = 1 and s.item_id = i.id) "; if (substr_count($options,'mine') > 0 and $userId > 0) $sql .= "or i.user_id = $userId "; $sql .= ')'; } if ($excludeId != '') $sql .= "and i.id not in ($excludeId)"; $sql .= 'order by id desc '; $sql .= "limit $pageSize offset $offset"; $items = $command->setText($sql)->queryAll(); return $items; } public function browseCount($tags,$shared = 1, $minLove = 1, $options = '' , $includedUserId = null, $excludeId = null) { $sixMonthAgo = new DateTime('-6 month'); $sixMonthAgo = $sixMonthAgo->format('Y-m-d'); $userId = Yii::app()->user->getState('user_id'); $command = Yii::app()->db->createCommand(); $sql = 'select count(*) '; $sql .= 'from item i '; if ($userId > 0) { $sql .= "left join user_heart love_ab on love_ab.from_user_id = $userId and love_ab.to_user_id = i.user_id "; $sql .= "left join user_heart love_ba on love_ba.from_user_id = i.user_id and love_ba.to_user_id = $userId "; } if ($includedUserId > 0) { $sql .= "left join user_heart love_ac on love_ac.from_user_id = $userId and love_ac.to_user_id = $includedUserId "; $sql .= "left join user_heart love_ca on love_ca.from_user_id = $includedUserId and love_ca.to_user_id = $userId "; $sql .= "left join user_heart love_bc on love_bc.from_user_id = i.user_id and love_bc.to_user_id = $includedUserId "; $sql .= "left join user_heart love_cb on love_cb.from_user_id = $includedUserId and love_cb.to_user_id = i.user_id "; } $sql .= 'where i.quantity > 0 '; $sql .= "and i.expiration_date >= curdate() "; $sql .= "and i.creation_date >= '$sixMonthAgo' "; $sql .= "and i.shared = $shared "; if ($userId > 0) $sql .= "and (coalesce(love_ab.love, 1) >= $minLove) and (coalesce(love_ba.love, 1) > 0) "; if ($includedUserId > 0) { $sql .= 'and (love_ac.love > 0 or love_ac.love is null) and (love_ca.love > 0 or love_ca.love is null) '; $sql .= 'and (love_bc.love > 0 or love_bc.love is null) and (love_cb.love > 0 or love_cb.love is null) '; } if (isset($tags) && trim($tags) != '') { $splitTags = explode(' ', $tags); foreach($splitTags as $splitTag) { if (substr($splitTag, 0, 1) == '+') $sql .= 'and i.description like \'%'.substr($splitTag, 1, strlen ($splitTag) - 1) .'%\' '; else $sql .= 'and i.description not like \'%'.substr($splitTag, 1, strlen ($splitTag) - 1) .'%\' '; } } if ($options != '') { $sql .= 'and ( 1 = 0 '; if (substr_count($options,'newItem') > 0) $sql .= "or not exists(select 1 from solution s where s.item_id = i.id) "; if (substr_count($options,'draftSolutions') > 0) $sql .= "or exists(select 1 from solution s where s.status = 1 and s.item_id = i.id) "; if (substr_count($options,'mine') > 0 and $userId > 0) $sql .= "or i.user_id = $userId "; $sql .= ')'; } if ($excludeId != '') $sql .= "and i.id not in ($excludeId)"; $count = $command->setText($sql)->queryScalar(); return $count; } public function load($id) { $command = Yii::app()->db->createCommand(); $userId = Yii::app()->user->getState('user_id'); $sql = 'select i.*, p.name as project_name, coalesce(u.real_name, u.username) as username '; if ($userId > 0) $sql .= ', coalesce(uh.love, 1) as hisLove '; else $sql .= ', 1 as hisLove '; $sql .= 'from item i inner join `user` u on u.id = i.user_id left join project p on p.id = i.project_id '; if ($userId > 0) $sql .= "left join user_heart uh on uh.from_user_id = i.user_id and uh.to_user_id = $userId "; $sql .= "where i.id = $id "; $row = $command->setText($sql)->queryRow(); if($row === null) throw new CHttpException(404,'The requested page does not exist.'); $this->attributes = $row; } public function loadSolutions() { $itemId = $this->id; $command = Yii::app()->db->createCommand(); $solutions = $command->setText("select s.*, coalesce(u.real_name, u.username) as user_name from solution s inner join user u on u.id = s.user_id where s.item_id = $itemId")->queryAll(); for($i = 0; $i < count($solutions); $i++) { $solutionId = $solutions[$i]['id']; $command = Yii::app()->db->createCommand(); $solutionItems = $command->select('si.id, si.solution_id, si.item_id, i.description') ->from('(solution_item si inner join item i on i.id = si.item_id)') ->where('si.solution_id = ' . $solutionId) ->queryAll(); $solutions[$i]['items'] = $solutionItems; $command = Yii::app()->db->createCommand(); $missingEmails = $command->setText("select coalesce(u.real_name, u.username) as user_name from item i inner join user u on u.id = i.user_id where i.id = $itemId and (u.email is null or u.email = '') union select coalesce(u.real_name, u.username) as user_name from solution_item si inner join item i on i.id = si.item_id inner join user u on u.id = i.user_id where si.solution_id = $solutionId and (u.email is null or u.email = '') ")->queryColumn(); if (count($missingEmails) > 0) { $users = implode(', ', $missingEmails); $solutions[$i]['canbetaken'] = false; $solutions[$i]['message'] = sprintf(Yii::t('item','missing emails'), $users); } else $solutions[$i]['canbetaken'] = true; } $userId = Yii::app()->user->getState('user_id'); if ($userId > 0) { $command = Yii::app()->db->createCommand(); $command->setText("update solution set `read` = 1 where item_id = $itemId and exists ( select 1 from item i where i.user_id = $userId and i.id = $itemId )")->execute(); } return $solutions; } public function loadComments() { $itemId = $this->id; $command = Yii::app()->db->createCommand(); $comments = $command->setText("select ic.*, coalesce(u.real_name, u.username) as user_name from item_comment ic inner join user u on u.id = ic.user_id where ic.item_id = $itemId order by id ")->queryAll(); $userId = Yii::app()->user->getState('user_id'); if ($userId > 0) { $command = Yii::app()->db->createCommand(); $command->setText("delete from unread_comment where user_id = $userId and comment_id in ( select c.id from item_comment c where c.item_id = $itemId )")->execute(); } return $comments; } public function save() { $command = Yii::app()->db->createCommand(); $today = date('Y-m-d'); if (!isset($this->id)) { $userId = Yii::app()->user->getState('user_id'); $command->insert('item', array( 'description' => $this->description, 'original_description' => $this->description, 'shared' => $this->shared, 'user_id' => $userId, 'quantity' => $this->quantity, 'expiration_date' => $this->expiration_date, 'creation_date' => $today, 'project_id' => ($this->project_id == 0 ? null : $this->project_id), )); $this->id = $command->connection->lastInsertID; } else { $command->update('item', array( 'description' => $this->description, 'shared' => $this->shared, 'quantity' => $this->quantity, 'expiration_date' => $this->expiration_date, 'project_id' => ($this->project_id == 0 ? null : $this->project_id), ), 'id = :id', array(':id'=> $this->id) ); } return true; } public function delete() { $command = Yii::app()->db->createCommand(); $itemUserId = $command->select('user_id') ->from('item') ->where("id = " . $this->id) ->queryScalar(); if ($itemUserId != Yii::app()->user->getState('user_id')) return; $command = Yii::app()->db->createCommand(); $command->delete('item', 'id = :id', array(':id'=> $this->id)); // Detail is deleted too due to foreign key cascade restriction } public function newSolution($itemId) { $userId = Yii::app()->user->getState('user_id'); $command = Yii::app()->db->createCommand(); $command->insert('solution', array( 'item_id' => $itemId, 'user_id' => $userId, )); return $command->connection->lastInsertID; } public function deleteSolution($solutionId) { $command = Yii::app()->db->createCommand(); $commentUserId = $command->select('user_id') ->from('solution') ->where("id = $solutionId") ->queryScalar(); if ($commentUserId != Yii::app()->user->getState('user_id')) return; $command = Yii::app()->db->createCommand(); $command->delete('solution', 'id = :id', array(':id' => $solutionId) ); // Detail is deleted too due to foreign key cascade restriction } public function markAsDraft($solutionId) { $command = Yii::app()->db->createCommand(); $command->update('solution', array( 'status' => 1, ), 'id = :id', array(':id'=> $solutionId) ); } public function markAsComplete($solutionId) { $previousStatus = Yii::app()->db->createCommand() ->setText('select status from solution where id = '.$solutionId) ->queryScalar(); // Mark as complete $command = Yii::app()->db->createCommand(); $command->update('solution', array('status' => 2,'read'=>''), 'id = :id', array(':id'=> $solutionId) ); //Check for notification $needId = Yii::app()->db->createCommand() ->setText('select s.item_id from solution s where s.id = '.$solutionId) ->queryScalar(); $alreadyNotified = Yii::app()->db->createCommand() ->setText('select i.notified from item i where i.id = '.$needId) ->queryScalar(); if ($alreadyNotified > 0) return; if ($previousStatus > 1) return; // Notify $need = Yii::app()->db->createCommand() ->setText('select u.email, coalesce(u.real_name, u.username) as user_name, i.id as need_id from user u inner join item i on i.user_id = u.id where i.id = '.$needId) ->queryRow(); $needUrl = 'http://'.$_SERVER["HTTP_HOST"] . Yii::app()->baseUrl . '/index.php/need/view/' . $need['need_id']; $subjectTemplate = Yii::t('interaction', 'subject complete template'); $headerTemplate = Yii::t('interaction', 'header template'); $completeTemplate = Yii::t('interaction', 'complete template'); $footerTemplate = Yii::t('interaction', 'footer template'); $mailHeader = sprintf($headerTemplate, $need['user_name']). "\n\n"; $mailBody = sprintf($completeTemplate , $needUrl) . "\n\n"; $mailFooter = $footerTemplate; $mail = $mailHeader . $mailBody . $mailFooter; $this->mailTo($need['email'], $need['user_name'], $subjectTemplate, $mail); Yii::app()->db->createCommand() ->setText('update item set notified = 1 where id = '.$needId) ->execute(); } public function take($solutionId) { $notified = array(); $command = Yii::app()->db->createCommand(); $needId = $command->select('item_id') ->from('solution') ->where ('id = ' . $solutionId) ->queryScalar(); if (!isset($needId)) return; // Update quantities to need $command = Yii::app()->db->createCommand(); $command->setText("update item set quantity = quantity - 1 where id = $needId")->execute(); $command = Yii::app()->db->createCommand(); $need = $command->select('i.description, coalesce(u.real_name, u.username) as user_name, u.email') ->from('item i` inner join `user` `u` on `u.id` = `i.user_id') ->where('i.id = '.$needId) ->queryRow(); $command = Yii::app()->db->createCommand(); $solution = $command->setText("select s.*, coalesce(u.real_name, u.username) as user_name, u.email from solution s inner join user u on u.id = s.user_id where s.id = $solutionId") ->queryRow(); $command = Yii::app()->db->createCommand(); $solutionItems = $command->setText('select i.id, i.description, coalesce(u.real_name, u.username) as user_name, u.email from item i inner join solution_item si on si.item_id = i.id inner join user u on u.id = i.user_id where si.solution_id = ' . $solutionId) ->queryAll(); $subjectTemplate = Yii::t('interaction', 'subject taken template'); $headerTemplate = Yii::t('interaction', 'header template'); $takeTemplate = Yii::t('interaction', 'take template'); $needTemplate = Yii::t('interaction', 'need template'); $solutionTemplate = Yii::t('interaction', 'solution template'); $solutionItemTemplate = Yii::t('interaction', 'solution item template'); $footerTemplate = Yii::t('interaction', 'footer template'); $needDescription = sprintf($needTemplate, $need['user_name'], $need['email'], $need['description'] ). "\n"; $solutionDescription = sprintf($solutionTemplate, $solution['user_name'], $solution['email'] ). "\n"; $solutionItemsDescription = ''; foreach($solutionItems as $solutionItem) { $command = Yii::app()->db->createCommand(); $command->setText("update item set quantity = quantity - 1 where id = " . $solutionItem['id'])->execute(); $solutionItemDescription = sprintf($solutionItemTemplate, $solutionItem['user_name'], $solutionItem['email'], $solutionItem['description']); $solutionItemsDescription .= '- ' . $solutionItemDescription . "\n"; } // Send mails // // Need mail $mailHeader = sprintf($headerTemplate, $need['user_name']). "\n"; $mailBody = sprintf($takeTemplate , $needDescription."\n".$solutionDescription.$solutionItemsDescription). "\n"; $mailFooter = $footerTemplate; $mail = $mailHeader . $mailBody . $mailFooter; $this->mailTo($need['email'], $need['user_name'], $subjectTemplate, $mail); $notified[] = $need['email']; //Solution mail $mailHeader = sprintf($headerTemplate, $solution['user_name']). "\n"; $mail = $mailHeader . $mailBody . $mailFooter; $alreadyNotified = false; foreach($notified as $m) if ($m == $solution['email']) $alreadyNotified = true; if (!$alreadyNotified) { $this->mailTo($solution['email'], $solution['user_name'], $subjectTemplate, $mail); $notified[] = $solution['email']; } //Solution mails foreach($solutionItems as $solutionItem) { $mailHeader = sprintf($headerTemplate, $solutionItem['user_name']); $mail = $mailHeader. "\n" . $mailBody . "\n" . $mailFooter; $alreadyNotified = false; foreach($notified as $m) if ($m == $solutionItem['email']) $alreadyNotified = true; if (!$alreadyNotified) { $this->mailTo($solutionItem['email'], $solutionItem['user_name'], $subjectTemplate, $mail); $notified[] = $solutionItem['email']; } } //Archive solution $archiveDescrition = Yii::t('interaction','date') . ':' . date('Y-m-d') ."\n" . $need['user_name']. ' ' . Yii::t('interaction','needed') . "\n" . $need['description'] . "\n\n" . $solution['user_name'] . ' ' . Yii::t('interaction','proposed') . "\n" ; foreach($solutionItems as $solutionItem) { $archiveDescrition .= '- ' . $solutionItem['user_name'] . ' ' . Yii::t('interaction', 'shared'). ' ' . $solutionItem['description'] . "\n"; } Yii::app()->db->createCommand()->insert('solution_archive', array('description'=>$archiveDescrition)); // Delete fulfilled need $itemForm = new ItemModel(); $itemForm->id = $needId; $itemForm->delete(); // Roll back solutions which items are no longer available $command = Yii::app()->db->createCommand(); $command->setText("update solution set status = 1 where status = 2 and id in ( select si.solution_id from solution_item si inner join item i on i.id = si.item_id where i.quantity < 1 )")->execute(); // Delete unavailable items. This may be long. $command = Yii::app()->db->createCommand(); $command->setText("delete from item where quantity < 1")->execute(); } public static function mailTo($toEmail, $toName, $subject, $body) { if (!ConfigurationModel::instance()->send_emails) return; if (!isset($toEmail)) return; Yii::import('application.extensions.phpmailer.JPhpMailer'); $mail = new JPhpMailer(); $mail->IsSMTP(); $mail->Timeout = ConfigurationModel::instance()->smtp_timeout; $mail->Host = ConfigurationModel::instance()->smtp_server; $mail->Port = ConfigurationModel::instance()->smtp_port; $mail->Username = ConfigurationModel::instance()->smtp_username; $mail->Password = ConfigurationModel::instance()->smtp_password; $mail->From = ConfigurationModel::instance()->smtp_from_email; $mail->FromName = ConfigurationModel::instance()->smtp_from_name; if (ConfigurationModel::instance()->include_title_in_email) { if (ConfigurationModel::instance()->app_title == '') $mail->Subject = $subject . ' - ' . Yii::t('global', 'title'); else $mail->Subject = $subject . ' - ' . ConfigurationModel::instance()->app_title; } else $mail->Subject = $subject; $mail->Body = utf8_decode($body); $mail->AddAddress($toEmail, $toName); $mail->IsHTML(false); $mail->SMTPAuth = true; $mail->SMTPSecure = ConfigurationModel::instance()->smtp_secure; $result = $mail->Send(); $message = $mail->ErrorInfo; return $result; } function comment($itemId, $userId, $comment) { $command = Yii::app()->db->createCommand(); $command->insert('item_comment', array( 'item_id' => $itemId, 'user_id' => $userId, 'comment' => $comment )); $commentId = $command->connection->pdoInstance->lastInsertId(); // Notifying other users. $command = Yii::app()->db->createCommand(); $command->setText("insert into unread_comment (user_id, comment_id) select i.user_id, $commentId from item i where i.id = $itemId union select s.user_id, $commentId from solution s where s.item_id = $itemId union select c.user_id, $commentId from item_comment c where c.item_id = $itemId ")->execute(); } function deleteComment($id) { $command = Yii::app()->db->createCommand(); $commentUserId = $command->select('user_id') ->from('item_comment') ->where("id = $id") ->queryScalar(); if ($commentUserId != Yii::app()->user->getState('user_id')) return; $command = Yii::app()->db->createCommand(); $command->delete('item_comment', "id = $id"); } public static function sharpTags($tags) { $allowed = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_ "; $tags = explode(' ', $tags); $sharpTags = ''; foreach($tags as $tag) { $trimedTag = trim($tag); if (isset($trimedTag) && $trimedTag != '') { for ($i=0; $i<strlen($trimedTag); $i++) { if ($i == 0) { if (substr($trimedTag,$i,1) !== '-' && substr($trimedTag,$i,1) !== '+' ) $sharpTags .= '+'; else { $sharpTags .= substr($trimedTag,$i,1); $i++; } $sharpTags .= '#'; if (substr($trimedTag,$i,1)== '#') $i++; } $char = substr($trimedTag,$i,1); if (strpos($allowed, $char) > -1) $sharpTags .= $char; } $sharpTags .= ' '; } } $sharpTags = rtrim($sharpTags); return $sharpTags; } public static function GetUserId($itemId) { $command = Yii::app()->db->createCommand(); return $command->select('user_id') ->from('item') ->where("id = :id") ->queryScalar(array('id'=>$itemId)); } }
margori/Global-Abundance-System
protected/models/ItemModel.php
PHP
agpl-3.0
23,078
/* * Copyright 2020. Huawei Technologies Co., Ltd. All rights reserved. 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. */ package com.x.jpush.assemble.control.huawei.android; import com.x.jpush.assemble.control.huawei.ValidatorUtils; import org.apache.commons.lang3.StringUtils; public class ClickAction { private static final String PATTERN = "^https.*"; private Integer type; private String intent; private String url; private String rich_resource; private String action; private ClickAction(Builder builder) { this.type = builder.type; switch (this.type) { case 1: this.intent = builder.intent; this.action = builder.action; break; case 2: this.url = builder.url; break; case 4: this.rich_resource = builder.richResource; break; } } /** * check clickAction's parameters */ public void check() { boolean isTrue = this.type == 1 || this.type == 2 || this.type == 3 || this.type == 4; ValidatorUtils.checkArgument(isTrue, "click type should be one of 1: customize action, 2: open url, 3: open app, 4: open rich media"); switch (this.type) { case 1: ValidatorUtils.checkArgument(StringUtils.isNotEmpty(this.intent) || StringUtils.isNotEmpty(this.action), "intent or action is required when click type=1"); break; case 2: ValidatorUtils.checkArgument(StringUtils.isNotEmpty(this.url), "url is required when click type=2"); ValidatorUtils.checkArgument(this.url.matches(PATTERN), "url must start with https"); break; case 4: ValidatorUtils.checkArgument(StringUtils.isNotEmpty(this.rich_resource), "richResource is required when click type=4"); ValidatorUtils.checkArgument(this.rich_resource.matches(PATTERN), "richResource must start with https"); break; } } /** * getter */ public int getType() { return type; } public String getIntent() { return intent; } public String getUrl() { return url; } public String getRich_resource() { return rich_resource; } public String getAction() { return action; } /** * builder */ public static Builder builder() { return new Builder(); } public static class Builder { private Integer type; private String intent; private String url; private String richResource; private String action; private Builder() { } public Builder setType(Integer type) { this.type = type; return this; } public Builder setIntent(String intent) { this.intent = intent; return this; } public Builder setUrl(String url) { this.url = url; return this; } public Builder setRichResource(String richResource) { this.richResource = richResource; return this; } public Builder setAction(String action) { this.action = action; return this; } public ClickAction build() { return new ClickAction(this); } } }
o2oa/o2oa
o2server/x_jpush_assemble_control/src/main/java/com/x/jpush/assemble/control/huawei/android/ClickAction.java
Java
agpl-3.0
4,024
package org.hatdex.hat.she.mappers import java.util.UUID import org.hatdex.hat.api.models.{ EndpointQuery, EndpointQueryFilter, FilterOperator, PropertyQuery } import org.hatdex.hat.api.models.applications.{ DataFeedItem, DataFeedItemContent, DataFeedItemLocation, DataFeedItemTitle, LocationAddress } import org.joda.time.{ DateTime, DateTimeZone } import play.api.libs.json.{ JsValue, Json } import scala.util.Try class GoogleCalendarMapper extends DataEndpointMapper { override protected val dataDeduplicationField: Option[String] = Some("id") def dataQueries( fromDate: Option[DateTime], untilDate: Option[DateTime] ): Seq[PropertyQuery] = { val eventDateTimePropertyQuery = PropertyQuery( List( EndpointQuery( "calendar/google/events", None, Some( Seq( dateFilter(fromDate, untilDate).map(f => EndpointQueryFilter("start.dateTime", None, f) ) ).flatten ), None ) ), Some("start.dateTime"), Some("descending"), None ) val dateOnlyFilter = if (fromDate.isDefined) { Some( FilterOperator.Between( Json.toJson(fromDate.map(_.toString("yyyy-MM-dd"))), Json.toJson(untilDate.map(_.toString("yyyy-MM-dd"))) ) ) } else { None } val eventDatePropertyQuery = PropertyQuery( List( EndpointQuery( "calendar/google/events", None, Some( Seq( dateOnlyFilter.map(f => EndpointQueryFilter("start.date", None, f) ) ).flatten ), None ) ), Some("start.date"), Some("descending"), None ) Seq(eventDateTimePropertyQuery, eventDatePropertyQuery) } def cleanHtmlTags(input: String): String = { input .replaceAll("<br/?>", "\n") .replaceAll("&nbsp;", " ") .replaceAll("<a [^>]*>([^<]*)</a>", "$1") } def mapDataRecord( recordId: UUID, content: JsValue, tailRecordId: Option[UUID] = None, tailContent: Option[JsValue] = None ): Try[DataFeedItem] = { for { startDate <- Try( (content \ "start" \ "dateTime") .asOpt[DateTime] .getOrElse((content \ "start" \ "date").as[DateTime]) .withZone( (content \ "start" \ "timeZone") .asOpt[String] .flatMap(z => Try(DateTimeZone.forID(z)).toOption) .getOrElse(DateTimeZone.getDefault) ) ) endDate <- Try( (content \ "end" \ "dateTime") .asOpt[DateTime] .getOrElse((content \ "end" \ "date").as[DateTime]) .withZone( (content \ "end" \ "timeZone") .asOpt[String] .flatMap(z => Try(DateTimeZone.forID(z)).toOption) .getOrElse(DateTimeZone.getDefault) ) ) timeIntervalString <- Try( eventTimeIntervalString(startDate, Some(endDate)) ) itemContent <- Try( DataFeedItemContent( (content \ "description").asOpt[String].map(cleanHtmlTags), None, None, None ) ) location <- Try( DataFeedItemLocation( geo = None, address = (content \ "location") .asOpt[String] .map(l => LocationAddress(None, None, Some(l), None, None) ), // TODO integrate with geocoding API for full location information? tags = None ) ) } yield { val title = DataFeedItemTitle( s"${(content \ "summary").as[String]}", Some( s"${timeIntervalString._1} ${timeIntervalString._2.getOrElse("")}" ), Some("event") ) val loc = Some(location).filter(l => l.address.isDefined || l.geo.isDefined || l.tags.isDefined ) DataFeedItem( "google", startDate, Seq("event"), Some(title), Some(itemContent), loc ) } } }
Hub-of-all-Things/HAT2.0
hat/app/org/hatdex/hat/she/mappers/GoogleCalendarMappers.scala
Scala
agpl-3.0
4,173
/* * * k6 - a next-generation load testing tool * Copyright (C) 2019 Load Impact * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ package influxdb import ( "io" "io/ioutil" "net/http" "testing" "time" "go.k6.io/k6/stats" ) func benchmarkInfluxdb(b *testing.B, t time.Duration) { testOutputCycle(b, func(rw http.ResponseWriter, r *http.Request) { for { time.Sleep(t) m, _ := io.CopyN(ioutil.Discard, r.Body, 1<<18) // read 1/4 mb a time if m == 0 { break } } rw.WriteHeader(204) }, func(tb testing.TB, c *Output) { b = tb.(*testing.B) b.ResetTimer() samples := make(stats.Samples, 10) for i := 0; i < len(samples); i++ { samples[i] = stats.Sample{ Metric: stats.New("testGauge", stats.Gauge), Time: time.Now(), Tags: stats.NewSampleTags(map[string]string{ "something": "else", "VU": "21", "else": "something", }), Value: 2.0, } } b.ResetTimer() for i := 0; i < b.N; i++ { c.AddMetricSamples([]stats.SampleContainer{samples}) time.Sleep(time.Nanosecond * 20) } }) } func BenchmarkInfluxdb1Second(b *testing.B) { benchmarkInfluxdb(b, time.Second) } func BenchmarkInfluxdb2Second(b *testing.B) { benchmarkInfluxdb(b, 2*time.Second) } func BenchmarkInfluxdb100Milliseconds(b *testing.B) { benchmarkInfluxdb(b, 100*time.Millisecond) }
loadimpact/k6
output/influxdb/bench_test.go
GO
agpl-3.0
1,980
# -*- coding: utf-8 -*- # © <YEAR(S)> <AUTHOR(S)> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Product Code Unique", "summary": "Add the unique property to default_code field", "version": "9.0.1.0.0", "category": "Product", "website": "https://odoo-community.org/", "author": "<Deysy Mascorro>, Odoo Community Association (OCA)", "license": "AGPL-3", "application": False, "installable": True, "external_dependencies": { "python": [], "bin": [], }, "depends": [ "base", "product", ], "data": [ "views/product_view.xml" ], "demo": [ ], "qweb": [ ] }
Gebesa-Dev/Addons-gebesa
product_code_unique/__openerp__.py
Python
agpl-3.0
701
import ddt from django.contrib.auth import login, authenticate from importlib import import_module from django_lti_tool_provider import AbstractApplicationHookManager from mock import patch, Mock from oauth2 import Request, Consumer, SignatureMethod_HMAC_SHA1 from django.contrib.auth.models import User from django.test.utils import override_settings from django.test import Client, TestCase, RequestFactory from django.conf import settings from django_lti_tool_provider.models import LtiUserData from django_lti_tool_provider.views import LTIView @override_settings( LTI_CLIENT_KEY='qertyuiop1234567890!@#$%^&*()_+[];', LTI_CLIENT_SECRET='1234567890!@#$%^&*()_+[];./,;qwertyuiop' ) class LtiRequestsTestBase(TestCase): _data = { "lis_result_sourcedid": "lis_result_sourcedid", "context_id": "LTIX/LTI-101/now", "user_id": "1234567890", "roles": ["Student"], "lis_outcome_service_url": "lis_outcome_service_url", "resource_link_id": "resource_link_id", "lti_version": "LTI-1p0", 'lis_person_sourcedid': 'username', 'lis_person_contact_email_primary': 'username@email.com' } _url_base = 'http://testserver' DEFAULT_REDIRECT = '/home' def setUp(self): self.client = Client() self.hook_manager = Mock(spec=AbstractApplicationHookManager) self.hook_manager.vary_by_key = Mock(return_value=None) self.hook_manager.optional_lti_parameters = Mock(return_value={}) LTIView.register_authentication_manager(self.hook_manager) @property def consumer(self): return Consumer(settings.LTI_CLIENT_KEY, settings.LTI_CLIENT_SECRET) def _get_signed_oauth_request(self, path, method, data=None): data = data if data is not None else self._data url = self._url_base + path method = method if method else 'GET' req = Request.from_consumer_and_token(self.consumer, {}, method, url, data) req.sign_request(SignatureMethod_HMAC_SHA1(), self.consumer, None) return req def get_correct_lti_payload(self, path='/lti/', method='POST', data=None): req = self._get_signed_oauth_request(path, method, data) return req.to_postdata() def get_incorrect_lti_payload(self, path='/lti/', method='POST', data=None): req = self._get_signed_oauth_request(path, method, data) req['oauth_signature'] += '_broken' return req.to_postdata() def send_lti_request(self, payload, client=None): client = client or self.client return client.post('/lti/', payload, content_type='application/x-www-form-urlencoded') def _authenticate(self, username='test'): self.client = Client() user = User.objects.get(username=username) logged_in = self.client.login(username=username, password='test') self.assertTrue(logged_in) return user def _logout(self): self.client.logout() def _verify_redirected_to(self, response, expected_url): self.assertEqual(response.status_code, 302) self.assertEqual(response.url, expected_url) def _verify_session_lti_contents(self, session, expected): self.assertIn('lti_parameters', session) self._verify_lti_data(session['lti_parameters'], expected) def _verify_lti_data(self, actual, expected): for key, value in expected.items(): self.assertEqual(value, actual[key]) def _verify_lti_created(self, user, expected_lti_data, custom_key=None): key = custom_key if custom_key else '' lti_data = LtiUserData.objects.get(user=user, custom_key=key) self.assertIsNotNone(lti_data) self.assertEqual(lti_data.custom_key, key) for key, value in expected_lti_data.items(): self.assertEqual(value, lti_data.edx_lti_parameters[key]) class AnonymousLtiRequestTests(LtiRequestsTestBase): def setUp(self): super(AnonymousLtiRequestTests, self).setUp() self.hook_manager.anonymous_redirect_to = Mock(return_value=self.DEFAULT_REDIRECT) def test_given_incorrect_payload_throws_bad_request(self): response = self.send_lti_request(self.get_incorrect_lti_payload()) self.assertEqual(response.status_code, 400) self.assertIn("Invalid LTI Request", response.content) def test_given_correct_requests_sets_session_variable(self): response = self.send_lti_request(self.get_correct_lti_payload()) self._verify_redirected_to(response, self.DEFAULT_REDIRECT) self._verify_session_lti_contents(self.client.session, self._data) @ddt.ddt @patch('django_lti_tool_provider.views.Signals.LTI.received.send') class AuthenticatedLtiRequestTests(LtiRequestsTestBase): def _authentication_hook(self, request, user_id=None, username=None, email=None, **kwargs): user = User.objects.create_user(username or user_id, password='1234', email=email) user.save() authenticated_user = authenticate(request, username=user.username, password='1234') login(request, authenticated_user) return user def setUp(self): super(AuthenticatedLtiRequestTests, self).setUp() self.hook_manager.authenticated_redirect_to = Mock(return_value=self.DEFAULT_REDIRECT) self.hook_manager.authentication_hook = self._authentication_hook def _verify_lti_updated_signal_is_sent(self, patched_send_lti_received, expected_user): expected_lti_data = LtiUserData.objects.get(user=expected_user) patched_send_lti_received.assert_called_once_with(LTIView, user=expected_user, lti_data=expected_lti_data) def test_no_session_given_incorrect_payload_throws_bad_request(self, _): response = self.send_lti_request(self.get_incorrect_lti_payload()) self.assertEqual(response.status_code, 400) self.assertIn("Invalid LTI Request", response.content) def test_no_session_correct_payload_processes_lti_request(self, patched_send_lti_received): # Precondition check self.assertFalse(LtiUserData.objects.all()) response = self.send_lti_request(self.get_correct_lti_payload()) # Should have been created. user = User.objects.all()[0] self._verify_lti_created(user, self._data) self._verify_redirected_to(response, self.DEFAULT_REDIRECT) self._verify_lti_updated_signal_is_sent(patched_send_lti_received, user) def test_given_session_and_lti_uses_lti(self, patched_send_lti_received): # Precondition check self.assertFalse(LtiUserData.objects.all()) session = self.client.session session['lti_parameters'] = {} session.save() response = self.send_lti_request(self.get_correct_lti_payload()) # Should have been created. user = User.objects.all()[0] self._verify_lti_created(user, self._data) self._verify_redirected_to(response, self.DEFAULT_REDIRECT) self._verify_lti_updated_signal_is_sent(patched_send_lti_received, user) def test_force_login_change(self, patched_send_lti_received): self.assertFalse(User.objects.exclude(id=1)) payload = self.get_correct_lti_payload() request = self.send_lti_request(payload, client=RequestFactory()) engine = import_module(settings.SESSION_ENGINE) request.session = engine.SessionStore() request.user = None user = self._authentication_hook(request, username='goober') request.session.save() self.assertEqual(request.user, user) LTIView.as_view()(request) # New user creation not actually available during tests. self.assertTrue(request.user) new_user = User.objects.exclude(username='goober')[0] self.assertEqual(request.user, new_user) # Verify a new user is not created with the same data if re-visiting. request = self.send_lti_request(payload, client=RequestFactory()) request.session = engine.SessionStore() request.user = None authenticated_user = authenticate(request, username=new_user.username, password='1234') self.assertTrue(authenticated_user) login(request, authenticated_user) LTIView.as_view()(request) self.assertEqual(request.user, authenticated_user) self.assertEqual(authenticated_user, new_user) self.assertEqual(LtiUserData.objects.all().count(), 1) @ddt.ddt class AuthenticationManagerIntegrationTests(LtiRequestsTestBase): TEST_URLS = "/some_url", "/some_other_url", "http://qwe.asd.zxc.com" def setUp(self): super(AuthenticationManagerIntegrationTests, self).setUp() def tearDown(self): LTIView.authentication_manager = None self._logout() def _authenticate_user(self, request, user_id=None, username=None, email=None, **kwargs): if not username: username = "test_username" password = "test_password" user = User.objects.create_user(username=username, email=email, password=password) authenticated_user = authenticate(request, username=username, password=password) login(request, authenticated_user) self.addCleanup(lambda: user.delete()) def test_authentication_hook_executed_if_not_authenticated(self): payload = self.get_correct_lti_payload() self.send_lti_request(payload) args, user_data = self.hook_manager.authentication_hook.call_args request = args[0] self.assertEqual(request.body, payload) self.assertFalse(request.user.is_authenticated) expected_user_data = { 'username': self._data['lis_person_sourcedid'], 'email': self._data['lis_person_contact_email_primary'], 'user_id': self._data['user_id'], 'extra_params': {} } self.assertEqual(user_data, expected_user_data) def test_authentication_hook_passes_optional_lti_data(self): payload = self.get_correct_lti_payload() self.hook_manager.optional_lti_parameters.return_value = {'resource_link_id': 'link_id', 'roles': 'roles'} self.send_lti_request(payload) args, user_data = self.hook_manager.authentication_hook.call_args request = args[0] self.assertEqual(request.body, payload) self.assertFalse(request.user.is_authenticated) expected_user_data = { 'username': self._data['lis_person_sourcedid'], 'email': self._data['lis_person_contact_email_primary'], 'user_id': self._data['user_id'], 'extra_params': { 'roles': ['Student'], 'link_id': 'resource_link_id', } } self.assertEqual(user_data, expected_user_data) @ddt.data(*TEST_URLS) def test_anonymous_lti_is_processed_if_hook_does_not_authenticate_user(self, expected_url): self.hook_manager.anonymous_redirect_to.return_value = expected_url response = self.send_lti_request(self.get_correct_lti_payload()) self._verify_redirected_to(response, expected_url) self._verify_session_lti_contents(self.client.session, self._data) # verifying correct parameters were passed to auth manager hook request, lti_data = self.hook_manager.anonymous_redirect_to.call_args[0] self._verify_session_lti_contents(request.session, self._data) self._verify_lti_data(lti_data, self._data) @ddt.data(*TEST_URLS) def test_authenticated_lti_is_processed_if_hook_authenticates_user(self, expected_url): self.hook_manager.authentication_hook.side_effect = self._authenticate_user self.hook_manager.authenticated_redirect_to.return_value = expected_url response = self.send_lti_request(self.get_correct_lti_payload()) self._verify_redirected_to(response, expected_url) # verifying correct parameters were passed to auth manager hook request, lti_data = self.hook_manager.authenticated_redirect_to.call_args[0] user = request.user self._verify_lti_created(user, self._data) self._verify_lti_data(lti_data, self._data) @ddt.data('custom', 'very custom', 'extremely custom') def test_authenticated_lti_saves_custom_key_if_specified(self, key): self.hook_manager.vary_by_key.return_value = key self.hook_manager.authentication_hook.side_effect = self._authenticate_user self.send_lti_request(self.get_correct_lti_payload()) request, lti_data = self.hook_manager.authenticated_redirect_to.call_args[0] user = request.user self._verify_lti_created(user, self._data, key)
open-craft/django-lti-tool-provider
django_lti_tool_provider/tests/test_views.py
Python
agpl-3.0
12,681
#include "Backend.h" #include "DebugMacros.h" #include <stdint.h> #include <string.h> // PRIVATE FUNCTIONS void Backend::WriteChannelUpdate(unsigned int in_channel, double & in_val) { debug4("Write channel update to Backend.\n"); unsigned int loc = 0; char buffer[1024]; std::string buffer_write; buffer_write.assign(buffer, loc); } void Backend::WriteChannelUpdate(unsigned int in_channel, std::string & in_val) { debug4("Write channel update to Backend.\n"); unsigned int loc = 0; char buffer[1024]; std::string buffer_write; buffer_write.assign(buffer, loc); } void Backend::CreateChannelUpdate(std::string & out_buffer, unsigned int in_channel, double & in_val) { debug4("Create channel update to buffer.\n"); unsigned int loc = 0; char channel_buffer[1024]; channel_buffer[loc++] = 'b'; channel_buffer[loc++] = 'c'; memmove(&channel_buffer[loc], &in_channel, sizeof(unsigned int)); loc += sizeof(unsigned int); channel_buffer[loc++] = 'v'; channel_buffer[loc++] = 'd'; memmove(&channel_buffer[loc], &in_val, sizeof(double)); loc += sizeof(double); out_buffer.assign(channel_buffer, loc); #if DEBUG_SYSTEM >= 7 debug7("Buffer contents:\n"); for (unsigned int i = 0; i < out_buffer.size(); ++i) { printf("[%u]",out_buffer[i] & 0xFF); } printf("\n"); #endif } void Backend::CreateChannelUpdate(std::string & out_buffer, unsigned int in_channel, std::string & in_val) { debug4("Create channel update to buffer.\n"); out_buffer.clear(); unsigned int loc = 0; if (in_val.size() > 1020) { debug2("Input string is too large.\n"); return; } char channel_buffer[1024]; channel_buffer[loc++] = 'b'; channel_buffer[loc++] = 'c'; memmove(&channel_buffer[loc], &in_channel, sizeof(unsigned int)); loc += sizeof(unsigned int); channel_buffer[loc++] = 'v'; channel_buffer[loc++] = 's'; memmove(&channel_buffer[loc], in_val.c_str(), in_val.size()); loc += in_val.size(); out_buffer.assign(channel_buffer, loc); #if DEBUG_SYSTEM >= 7 debug7("Buffer contents:\n"); for (unsigned int i = 0; i < out_buffer.size(); ++i) { printf("[%i]",out_buffer[i]); } printf("\n"); #endif } void Backend::ReadChannelUpdate(std::string & in_buffer) { debug7("Read channel update from buffer.\n"); unsigned int loc = 0, loc2 = 0; unsigned int channel_number = 0; double channel_double = 0.0f; char channel_buffer[1024]; unsigned char channel_type = 0; std::string channel_string; debug7x2("Parsing buffer contents(sizeof dbl[%lu] chr[%lu]).\n", sizeof(double), sizeof(char)); if (loc >= in_buffer.size()) { debug5("Buffer is invalid.\n"); return; } while(loc < in_buffer.size()) { debug7x1("Reading Character at position %u.\n",loc); switch(in_buffer[loc]) { case 'c': case 'C': if (in_buffer.size() < loc + sizeof(unsigned int)) { debug5("Invalid channel buffer. Channel entry is corrupted.\n"); return; } memmove(&channel_number, &in_buffer.c_str()[++loc], sizeof(unsigned int)); debug7x1("Channel number is %u.\n",channel_number); loc += sizeof(unsigned int) - 1; break; case 'v': case 'V': debug7("Reading channel value.\n"); loc++; if (loc >= in_buffer.size()) { debug5("Invalid channel buffer. Value entry is broken.\n"); return; } switch(in_buffer[loc]) { case 'd': case 'D': // Double/Float entry value memmove(&channel_double, &in_buffer.c_str()[++loc],sizeof(double)); loc += sizeof(double) - 1; debug7x2("Update to channel %u with value (%f).\n",channel_number, channel_double); break; case 's': case 'S': loc2 = loc + 1; while(loc2 <= in_buffer.size()) { switch(in_buffer[loc2]) { case '\0': case '\n': case '\r': // End of string, take the full section from [loc,loc2]. memmove(channel_buffer, &in_buffer.c_str()[loc+1], (loc2 - loc) * sizeof (char)); channel_string.assign(channel_buffer, loc2); loc = loc2 + 1; loc2 = in_buffer.size(); debug7x3("Update to channel %u with string (%s)[%u].\n",channel_number, channel_string.c_str(),loc-1); break; default: break; } loc2++; } break; default: break; } break; default: break; } loc++; } } // PUBLIC FUNCTIONS Backend::Backend() { data = new DataStorage(255); } Backend::~Backend() { delete(data); } void Backend::AddChannelUpdate(unsigned int in_channel, double & in_val) { } void Backend::AddChannelUpdate(unsigned int in_channel, std::string & in_val) { }
SarahVictoria/IOConnection
Case 17/EndSystem/Backend.cpp
C++
agpl-3.0
6,003
import pytest from django.urls import reverse from adhocracy4.dashboard import components from adhocracy4.test.helpers import assert_template_response from adhocracy4.test.helpers import redirect_target from adhocracy4.test.helpers import setup_phase from meinberlin.apps.topicprio.models import Topic from meinberlin.apps.topicprio.phases import PrioritizePhase component = components.modules.get('topic_edit') @pytest.mark.django_db def test_edit_view(client, phase_factory, topic_factory): phase, module, project, item = setup_phase( phase_factory, topic_factory, PrioritizePhase) initiator = module.project.organisation.initiators.first() url = component.get_base_url(module) client.login(username=initiator.email, password='password') response = client.get(url) assert_template_response(response, 'meinberlin_topicprio/topic_dashboard_list.html') @pytest.mark.django_db def test_topic_create_view(client, phase_factory, category_factory): phase, module, project, item = setup_phase( phase_factory, None, PrioritizePhase) initiator = module.project.organisation.initiators.first() category = category_factory(module=module) url = reverse('a4dashboard:topic-create', kwargs={'module_slug': module.slug}) data = { 'name': 'test', 'description': 'test', 'category': category.pk } client.login(username=initiator.email, password='password') response = client.post(url, data) assert redirect_target(response) == 'topic-list' topic = Topic.objects.get(name=data.get('name')) assert topic.description == data.get('description') assert topic.category.pk == data.get('category') @pytest.mark.django_db def test_topic_update_view( client, phase_factory, topic_factory, category_factory): phase, module, project, item = setup_phase( phase_factory, topic_factory, PrioritizePhase) initiator = module.project.organisation.initiators.first() category = category_factory(module=module) url = reverse('a4dashboard:topic-update', kwargs={'pk': item.pk, 'year': item.created.year}) data = { 'name': 'test', 'description': 'test', 'category': category.pk } client.login(username=initiator.email, password='password') response = client.post(url, data) assert redirect_target(response) == 'topic-list' item.refresh_from_db() assert item.description == data.get('description') assert item.category.pk == data.get('category') @pytest.mark.django_db def test_topic_delete_view(client, phase_factory, topic_factory): phase, module, project, item = setup_phase( phase_factory, topic_factory, PrioritizePhase) initiator = module.project.organisation.initiators.first() url = reverse('a4dashboard:topic-delete', kwargs={'pk': item.pk, 'year': item.created.year}) client.login(username=initiator.email, password='password') response = client.delete(url) assert redirect_target(response) == 'topic-list' assert not Topic.objects.exists()
liqd/a4-meinberlin
tests/topicprio/dashboard_components/test_views_module_topics.py
Python
agpl-3.0
3,141
#region Licence // Copyright (c) 2016 Tomas Bosek // // This file is part of PluginLoader. // // PluginLoader is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. #endregion using Mono.Cecil; using Mono.Cecil.Cil; using System.Linq; namespace Patcher { static class Helpers { public static FieldDefinition GetFieldByName(FieldDefinition[] fields, string name) { return fields.Single(field => field.Name == name); } public static Instruction GetInstructionByOffset(MethodBody method, int offset) { return method.Instructions.Single(instruction => instruction.Offset == offset); } public static MethodDefinition GetMethodByName(MethodDefinition[] methods, string name) { return methods.Single(method => method.Name == name); } public static void InjectInstructionsAfter(ILProcessor processor, Instruction[] instructions, int offset) { var lastInstruction = GetInstructionByOffset(processor.Body, offset); foreach (Instruction instruction in instructions) { processor.InsertAfter(lastInstruction, instruction); lastInstruction = instruction; } } public static void InjectInstructionsBefore(ILProcessor processor, Instruction[] instructions, int offset) { Instruction lastInstruction = null; foreach (Instruction instruction in instructions) { if(lastInstruction == null) { processor.InsertBefore(GetInstructionByOffset(processor.Body, offset), instruction); } else { processor.InsertAfter(lastInstruction, instruction); } lastInstruction = instruction; } } public static void InjectInstructionsToEnd(ILProcessor processor, Instruction[] instructions) { var lastInstruction = processor.Body.Instructions.Last(); processor.Replace(lastInstruction, instructions.First()); if (instructions.Length > 0) instructions.ToList().GetRange(1, instructions.Length - 1).ForEach(instruction => processor.Append(instruction)); processor.Append(Instruction.Create(OpCodes.Ret)); } public static string ExecuteCmd(string command) { var cmd = new System.Diagnostics.Process(); cmd.StartInfo.FileName = "cmd.exe"; cmd.StartInfo.RedirectStandardInput = true; cmd.StartInfo.RedirectStandardOutput = true; cmd.StartInfo.CreateNoWindow = true; cmd.StartInfo.UseShellExecute = false; cmd.Start(); cmd.StandardInput.WriteLine(command); cmd.StandardInput.WriteLine("exit"); cmd.StandardInput.Flush(); cmd.WaitForExit(); var output = cmd.StandardOutput.ReadToEnd(); cmd.Dispose(); return output; } } }
Zinal001/pluginloader
Patcher/Helpers.cs
C#
agpl-3.0
3,713
<?php namespace Poli\VotosBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * Voto * * @ORM\Table() * @ORM\Entity(repositoryClass="Poli\VotosBundle\Entity\VotoRepository") */ class Voto { /** * @var integer * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var \DateTime * * @ORM\Column(name="fecha", type="datetime") */ private $fecha; /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set fecha * * @param \DateTime $fecha * @return Voto */ public function setFecha($fecha) { $this->fecha = $fecha; return $this; } /** * Get fecha * * @return \DateTime */ public function getFecha() { return $this->fecha; } }
jag2kn/votacion-patrones
Entity/Voto.php
PHP
agpl-3.0
944
/* Variable Grid System (Fluid Version). Learn more ~ http://www.spry-soft.com/grids/ Based on 960 Grid System - http://960.gs/ & 960 Fluid - http://www.designinfluences.com/ Licensed under GPL and MIT. */ /* Containers ----------------------------------------------------------------------------------------------------*/ .container_12 { width: 92%; margin-left: 4%; margin-right: 4%; height: 100%; } /* Grid >> Global ----------------------------------------------------------------------------------------------------*/ .grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6, .grid_7, .grid_8, .grid_9, .grid_10, .grid_11, .grid_12 { display:inline; float: left; position: relative; margin-left: 1%; margin-right: 1%; height: 100%; } /* Grid >> Children (Alpha ~ First, Omega ~ Last) ----------------------------------------------------------------------------------------------------*/ .alpha { margin-left: 0; } .omega { margin-right: 0; } /* Grid >> 12 Columns ----------------------------------------------------------------------------------------------------*/ .container_12 .grid_1 { width:6.333%; } .container_12 .grid_2 { width:14.667%; } .container_12 .grid_3 { width:23.0%; } .container_12 .grid_4 { width:31.333%; } .container_12 .grid_5 { width:39.667%; } .container_12 .grid_6 { width:48.0%; } .container_12 .grid_7 { width:56.333%; } .container_12 .grid_8 { width:64.667%; } .container_12 .grid_9 { width:73.0%; } .container_12 .grid_10 { width:81.333%; } .container_12 .grid_11 { width:89.667%; } .container_12 .grid_12 { width:98.0%; } /* Prefix Extra Space >> 12 Columns ----------------------------------------------------------------------------------------------------*/ .container_12 .prefix_1 { padding-left:8.333%; } .container_12 .prefix_2 { padding-left:16.667%; } .container_12 .prefix_3 { padding-left:25.0%; } .container_12 .prefix_4 { padding-left:33.333%; } .container_12 .prefix_5 { padding-left:41.667%; } .container_12 .prefix_6 { padding-left:50.0%; } .container_12 .prefix_7 { padding-left:58.333%; } .container_12 .prefix_8 { padding-left:66.667%; } .container_12 .prefix_9 { padding-left:75.0%; } .container_12 .prefix_10 { padding-left:83.333%; } .container_12 .prefix_11 { padding-left:91.667%; } /* Suffix Extra Space >> 12 Columns ----------------------------------------------------------------------------------------------------*/ .container_12 .suffix_1 { padding-right:8.333%; } .container_12 .suffix_2 { padding-right:16.667%; } .container_12 .suffix_3 { padding-right:25.0%; } .container_12 .suffix_4 { padding-right:33.333%; } .container_12 .suffix_5 { padding-right:41.667%; } .container_12 .suffix_6 { padding-right:50.0%; } .container_12 .suffix_7 { padding-right:58.333%; } .container_12 .suffix_8 { padding-right:66.667%; } .container_12 .suffix_9 { padding-right:75.0%; } .container_12 .suffix_10 { padding-right:83.333%; } .container_12 .suffix_11 { padding-right:91.667%; } /* Push Space >> 12 Columns ----------------------------------------------------------------------------------------------------*/ .container_12 .push_1 { left:8.333%; } .container_12 .push_2 { left:16.667%; } .container_12 .push_3 { left:25.0%; } .container_12 .push_4 { left:33.333%; } .container_12 .push_5 { left:41.667%; } .container_12 .push_6 { left:50.0%; } .container_12 .push_7 { left:58.333%; } .container_12 .push_8 { left:66.667%; } .container_12 .push_9 { left:75.0%; } .container_12 .push_10 { left:83.333%; } .container_12 .push_11 { left:91.667%; } /* Pull Space >> 12 Columns ----------------------------------------------------------------------------------------------------*/ .container_12 .pull_1 { left:-8.333%; } .container_12 .pull_2 { left:-16.667%; } .container_12 .pull_3 { left:-25.0%; } .container_12 .pull_4 { left:-33.333%; } .container_12 .pull_5 { left:-41.667%; } .container_12 .pull_6 { left:-50.0%; } .container_12 .pull_7 { left:-58.333%; } .container_12 .pull_8 { left:-66.667%; } .container_12 .pull_9 { left:-75.0%; } .container_12 .pull_10 { left:-83.333%; } .container_12 .pull_11 { left:-91.667%; } /* Clear Floated Elements ----------------------------------------------------------------------------------------------------*/ /* http://sonspring.com/journal/clearing-floats */ .clear { clear: both; display: block; overflow: hidden; visibility: hidden; width: 0; height: 0; } /* http://perishablepress.com/press/2008/02/05/lessons-learned-concerning-the-clearfix-css-hack */ .clearfix:after { clear: both; content: ' '; display: block; font-size: 0; line-height: 0; visibility: hidden; width: 0; height: 0; } .clearfix { display: inline-block; } * html .clearfix { height: 1%; } .clearfix { display: block; }
stfp/memopol2
memopol2/static/css/fluid_grid.css
CSS
agpl-3.0
4,876
/* * The Kuali Financial System, a comprehensive financial management system for higher education. * * Copyright 2005-2014 The Kuali Foundation * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.kuali.kfs.module.ar.document.validation.event; import org.kuali.kfs.module.ar.businessobject.CustomerCreditMemoDetail; import org.kuali.rice.krad.rules.rule.event.KualiDocumentEvent; public interface CustomerCreditMemoDetailEvent extends KualiDocumentEvent { /** * This method returns a customer invoice detail * @return */ public CustomerCreditMemoDetail getCustomerCreditMemoDetail(); }
ua-eas/ua-kfs-5.3
work/src/org/kuali/kfs/module/ar/document/validation/event/CustomerCreditMemoDetailEvent.java
Java
agpl-3.0
1,283
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://selenium-ide.openqa.org/profiles/test-case"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="selenium.base" href="http://localhost/" /> <title>CreateModifyRole</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> <thead> <tr> <td rowspan="1" colspan="3">Create Modify Role</td> </tr> </thead> <tbody> <tr> <td>setTimeout</td> <td>45000</td> <td></td> </tr> <tr> <td>store</td> <td>javascript{Math.floor(Math.random()*11000)}</td> <td>randomSuffix</td> </tr> <tr> <td>store</td> <td>javascript{Math.floor(Math.random()*11000)}</td> <td>randomSuffix2</td> </tr> <tr> <td>open</td> <td>index.php/configuration</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertTextPresent</td> <td>Roles</td> <td></td> </tr> <tr> <td>assertTextPresent</td> <td>Manage Roles</td> <td></td> </tr> <tr> <td>clickAndWait</td> <td>//div[@id='ConfigureModulesMenuView']/ul/li[15]/a/span</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>clickAndWait</td> <td>//div[@id='ActionBarForRolesTreeListView']/div[1]/nav[1]/div/a/span</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>type</td> <td>Role_name</td> <td>testRole${randomSuffix}</td> </tr> <tr> <td>clickAndWait</td> <td>save</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>waitForTextPresent</td> <td>Roles</td> <td></td> </tr> <tr> <td>assertTextPresent</td> <td>testRole${randomSuffix}</td> <td></td> </tr> <tr> <td>assertElementPresent</td> <td>link=testRole${randomSuffix}</td> <td></td> </tr> <tr> <td>clickAndWait</td> <td>link=testRole${randomSuffix}</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertValue</td> <td>Role_name</td> <td>testRole${randomSuffix}</td> </tr> <tr> <td>assertElementPresent</td> <td>link=Cancel</td> <td></td> </tr> <tr> <td>clickAndWait</td> <td>link=Cancel</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertTextPresent</td> <td>Roles</td> <td></td> </tr> <tr> <td>clickAndWait</td> <td>//div[@id='ActionBarForRolesTreeListView']/div[1]/nav[1]/div/a/span</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>type</td> <td>Role_name</td> <td>testRole${randomSuffix2}</td> </tr> <tr> <td>click</td> <td>Role_role_SelectLink</td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>waitForTextPresent</td> <td>Select a Parent Role</td> <td></td> </tr> <tr> <td>assertElementPresent</td> <td>link=testRole${randomSuffix}</td> <td></td> </tr> <tr> <td>click</td> <td>link=testRole${randomSuffix}</td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>waitForValue</td> <td>Role_role_name</td> <td>testRole${randomSuffix}</td> </tr> <tr> <td>clickAndWait</td> <td>save</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>waitForTextPresent</td> <td>Roles</td> <td></td> </tr> <tr> <td>assertTextPresent</td> <td>Roles</td> <td></td> </tr> <tr> <td>assertElementPresent</td> <td>link=testRole${randomSuffix}</td> <td></td> </tr> <tr> <td>clickAndWait</td> <td>link=testRole${randomSuffix2}</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertValue</td> <td>Role_name</td> <td>testRole${randomSuffix2}</td> </tr> <tr> <td>assertValue</td> <td>Role_role_name</td> <td>testRole${randomSuffix}</td> </tr> <tr> <td>clickAndWait</td> <td>save</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <!-- Create a User --> <tr> <td>open</td> <td>index.php/configuration</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertTextPresent</td> <td>Users - Manage Users</td> <td></td> </tr> <tr> <td>clickAndWait</td> <td>//div[@id='ConfigureModulesMenuView']/ul/li[19]/a/span</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>clickAndWait</td> <td>//div[@id='UsersActionBarForSearchAndListView']/div/nav/div/a/span</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>select</td> <td>UserPasswordForm_title_value</td> <td>label=Mr.</td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>type</td> <td>UserPasswordForm_firstName</td> <td>Jhon</td> </tr> <tr> <td>type</td> <td>UserPasswordForm_lastName</td> <td>Smith${randomSuffix}</td> </tr> <tr> <td>type</td> <td>UserPasswordForm_username</td> <td>jhon smith${randomSuffix}</td> </tr> <tr> <td>type</td> <td>UserPasswordForm_newPassword</td> <td>abc123</td> </tr> <tr> <td>type</td> <td>UserPasswordForm_newPassword_repeat</td> <td>abc123</td> </tr> <tr> <td>clickAndWait</td> <td>save</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>click</td> <td>//div[@id='UserDetailsView']/div/a</td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertText</td> <td>//div[@id='zurmoView']/div[1]/table/tbody/tr[7]/td</td> <td>jhon smith${randomSuffix}</td> </tr> <!-- Create of a User completes here--> <tr> <td>open</td> <td>index.php/users/default</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <!-- Search for a user --> <tr> <td>verifyTextPresent</td> <td>Advanced</td> <td></td> </tr> <tr> <td>type</td> <td>UsersSearchForm_anyMixedAttributes</td> <td>jhon smith${randomSuffix}</td> </tr> <tr> <td>keyUp</td> <td>UsersSearchForm_anyMixedAttributes</td> <td>\10</td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>waitForTextPresent</td> <td>Jhon Smith${randomSuffix}</td> <td></td> </tr> <tr> <td>assertElementPresent</td> <td>link=Jhon Smith${randomSuffix}</td> <td></td> </tr> <tr> <td>clickAndWait</td> <td>link=Jhon Smith${randomSuffix}</td> <td></td> </tr> <!-- Search for a user ends here--> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertText</td> <td>//div[@id='zurmoView']/div[1]/table/tbody/tr[2]/th</td> <td>Department</td> </tr> <tr> <td>waitForTextPresent</td> <td>Jhon Smith${randomSuffix}</td> <td></td> </tr> <tr> <td>clickAndWait</td> <td>link=Edit</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>click</td> <td>User_role_SelectLink</td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>waitForTextPresent</td> <td>Select a Role</td> <td></td> </tr> <tr> <td>click</td> <td>link=testRole${randomSuffix2}</td> <td></td> </tr> <tr> <td>waitForValue</td> <td>User_role_name</td> <td>testRole${randomSuffix2}</td> </tr> <tr> <td>clickAndWait</td> <td>save</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertText</td> <td>//div[@id='zurmoView']/div[2]/table/tbody/tr[1]/td/a</td> <td>testRole${randomSuffix2}</td> </tr> <tr> <td>open</td> <td>index.php/zurmo/role</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>clickAndWait</td> <td>link=testRole${randomSuffix}</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>click</td> <td>link=Delete Role</td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertConfirmation</td> <td>Are you sure you want to delete this role?</td> <td></td> </tr> <tr> <td>chooseOkOnNextConfirmationAndWait</td> <td></td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertTextPresent</td> <td>Roles</td> <td></td> </tr> <tr> <td>assertTextNotPresent</td> <td>link=testRole${randomSuffix}</td> <td></td> </tr> <tr> <td>clickAndWait</td> <td>link=testRole${randomSuffix2}</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertValue</td> <td>Role_role_name</td> <td></td> </tr> <tr> <td>click</td> <td>link=Delete Role</td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertConfirmation</td> <td>Are you sure you want to delete this role?</td> <td></td> </tr> <tr> <td>chooseOkOnNextConfirmationAndWait</td> <td></td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertTextPresent</td> <td>Roles</td> <td></td> </tr> <tr> <td>assertTextNotPresent</td> <td>link=testRole${randomSuffix2}</td> <td></td> </tr> <tr> <td>open</td> <td>index.php/users/default</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>type</td> <td>UsersSearchForm_anyMixedAttributes</td> <td>Jhon Smith${randomSuffix}</td> </tr> <tr> <td>keyUp</td> <td>UsersSearchForm_anyMixedAttributes</td> <td>\10</td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>waitForTextPresent</td> <td>Jhon Smith${randomSuffix}</td> <td></td> </tr> <tr> <td>assertElementPresent</td> <td>link=Jhon Smith${randomSuffix}</td> <td></td> </tr> <tr> <td>clickAndWait</td> <td>link=Jhon Smith${randomSuffix}</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().jQuery.active == 0</td> <td>30000</td> </tr> <tr> <td>assertText</td> <td>//div[@id='zurmoView']/div[1]/table/tbody/tr[2]/th</td> <td>Department</td> </tr> </tr> </tbody> </table> </body> </html>
ralphkretzschmar/zurmohuf
app/protected/modules/zurmo/tests/functional/cases/CreateModifyRole.html
HTML
agpl-3.0
23,401
// Package dotsql provides a way to separate your code from SQL queries. // // It is not an ORM, it is not a query builder. // Dotsql is a library that helps you keep sql files in one place and use it with ease. // // For more usage examples see https://github.com/gchaincl/dotsql package dotsql import ( "bufio" "bytes" "database/sql" "fmt" "io" "os" ) // Preparer is an interface used by Prepare. type Preparer interface { Prepare(query string) (*sql.Stmt, error) } // Queryer is an interface used by Query. type Queryer interface { Query(query string, args ...interface{}) (*sql.Rows, error) } // QueryRower is an interface used by QueryRow type QueryRower interface { QueryRow(query string, args ...interface{}) *sql.Row } // Execer is an interface used by Exec. type Execer interface { Exec(query string, args ...interface{}) (sql.Result, error) } // DotSql represents a dotSQL queries holder. type DotSql struct { queries map[string]string } func (d DotSql) lookupQuery(name string) (query string, err error) { query, ok := d.queries[name] if !ok { err = fmt.Errorf("dotsql: '%s' could not be found", name) } return } // Query is a wrapper for database/sql's Prepare(), using dotsql named query. func (d DotSql) Prepare(db Preparer, name string) (*sql.Stmt, error) { query, err := d.lookupQuery(name) if err != nil { return nil, err } return db.Prepare(query) } // Query is a wrapper for database/sql's Query(), using dotsql named query. func (d DotSql) Query(db Queryer, name string, args ...interface{}) (*sql.Rows, error) { query, err := d.lookupQuery(name) if err != nil { return nil, err } return db.Query(query, args...) } // QueryRow is a wrapper for database/sql's QueryRow(), using dotsql named query. func (d DotSql) QueryRow(db QueryRower, name string, args ...interface{}) (*sql.Row, error) { query, err := d.lookupQuery(name) if err != nil { return nil, err } return db.QueryRow(query, args...), nil } // Exec is a wrapper for database/sql's Exec(), using dotsql named query. func (d DotSql) Exec(db Execer, name string, args ...interface{}) (sql.Result, error) { query, err := d.lookupQuery(name) if err != nil { return nil, err } return db.Exec(query, args...) } // Raw returns the query, everything after the --name tag func (d DotSql) Raw(name string) (string, error) { return d.lookupQuery(name) } // QueryMap returns a map[string]string of loaded queries func (d DotSql) QueryMap() map[string]string { return d.queries } // Load imports sql queries from any io.Reader. func Load(r io.Reader) (*DotSql, error) { scanner := &Scanner{} queries := scanner.Run(bufio.NewScanner(r)) dotsql := &DotSql{ queries: queries, } return dotsql, nil } // LoadFromFile imports SQL queries from the file. func LoadFromFile(sqlFile string) (*DotSql, error) { f, err := os.Open(sqlFile) if err != nil { return nil, err } defer f.Close() return Load(f) } // LoadFromString imports SQL queries from the string. func LoadFromString(sql string) (*DotSql, error) { buf := bytes.NewBufferString(sql) return Load(buf) } // Merge takes one or more *DotSql and merge its queries // It's in-order, so the last source will override queries with the same name // in the previous arguments if any. func Merge(dots ...*DotSql) *DotSql { queries := make(map[string]string) for _, dot := range dots { for k, v := range dot.QueryMap() { queries[k] = v } } return &DotSql{ queries: queries, } }
archivers-space/archivers-api
vendor/github.com/gchaincl/dotsql/dotsql.go
GO
agpl-3.0
3,483
/* * (c) Copyright Ascensio System SIA 2010-2014 * * This program is a free software product. You can redistribute it and/or * modify it under the terms of the GNU Affero General Public License (AGPL) * version 3 as published by the Free Software Foundation. In accordance with * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect * that Ascensio System SIA expressly excludes the warranty of non-infringement * of any third-party rights. * * This program is distributed WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html * * You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, * EU, LV-1021. * * The interactive user interfaces in modified source and object code versions * of the Program must display Appropriate Legal Notices, as required under * Section 5 of the GNU AGPL version 3. * * Pursuant to Section 7(b) of the License you must retain the original Product * logo when distributing the program. Pursuant to Section 7(e) we decline to * grant you any rights under trademark law for use of our trademarks. * * All the Product's GUI elements, including illustrations and icon sets, as * well as technical writing content are licensed under the terms of the * Creative Commons Attribution-ShareAlike 4.0 International. See the License * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ #include "precompiled_docxformat.h" #include "FootnotePr.h" namespace OOX { namespace Settings { FootnotePr::FootnotePr() { } FootnotePr::~FootnotePr() { } FootnotePr::FootnotePr(const XML::XNode& node) { fromXML(node); } const FootnotePr& FootnotePr::operator =(const XML::XNode& node) { fromXML(node); return *this; } void FootnotePr::fromXML(const XML::XNode& node) { const XML::XElement element(node); XML::Fill(m_footnotes, element, "footnote"); } const XML::XNode FootnotePr::toXML() const { return XML::XElement(); } } } // namespace OOX
devsarr/ONLYOFFICE-OnlineEditors
ActiveX/Common/ASCDocxFormat/Source/DocxFormat/Settings/FootnotePr.cpp
C++
agpl-3.0
2,162
package main import ( "os" "fmt" "path/filepath" // "launchpad.net/juju-core/agent" "launchpad.net/juju-core/worker" // "launchpad.net/juju-core/worker/authenticationworker" "launchpad.net/juju-core/worker/charmrevisionworker" "launchpad.net/juju-core/worker/deployer" "launchpad.net/juju-core/worker/firewaller" workerlogger "launchpad.net/juju-core/worker/logger" // "launchpad.net/juju-core/worker/machineenvironmentworker" "launchpad.net/juju-core/worker/machiner" // "launchpad.net/juju-core/worker/rsyslog" "launchpad.net/juju-core/worker/upgrader" "launchpad.net/juju-core/state/api/params" // "launchpad.net/juju-core/provider" "launchpad.net/juju-core/worker/provisioner" "launchpad.net/juju-core/utils" ) func (a *MachineAgent) initAgent() error { if err := os.Remove(jujuRun); err != nil && !os.IsNotExist(err) { return err } jujud := filepath.Join(a.Conf.dataDir, "tools", a.Tag(), "jujud.exe") return utils.Symlink(jujud, jujuRun) } // APIWorker returns a Worker that connects to the API and starts any // workers that need an API connection. // // If a state worker is necessary, APIWorker calls ensureStateWorker. func (a *MachineAgent) APIWorker(ensureStateWorker func()) (worker.Worker, error) { agentConfig := a.Conf.config st, entity, err := openAPIState(agentConfig, a) if err != nil { return nil, err } reportOpenedAPI(st) for _, job := range entity.Jobs() { if job.NeedsState() { ensureStateWorker() break } } /* rsyslogMode := rsyslog.RsyslogModeForwarding for _, job := range entity.Jobs() { if job == params.JobManageEnviron { rsyslogMode = rsyslog.RsyslogModeAccumulate break } } */ runner := newRunner(connectionIsFatal(st), moreImportant) // Run the upgrader and the upgrade-steps worker without waiting for the upgrade steps to complete. runner.StartWorker("upgrader", func() (worker.Worker, error) { return upgrader.NewUpgrader(st.Upgrader(), agentConfig), nil }) runner.StartWorker("upgrade-steps", func() (worker.Worker, error) { return a.upgradeWorker(st, entity.Jobs()), nil }) // All other workers must wait for the upgrade steps to complete before starting. a.startWorkerAfterUpgrade(runner, "machiner", func() (worker.Worker, error) { return machiner.NewMachiner(st.Machiner(), agentConfig), nil }) a.startWorkerAfterUpgrade(runner, "logger", func() (worker.Worker, error) { return workerlogger.NewLogger(st.Logger(), agentConfig), nil }) // TODO: gsamfira: Port machineenvironmentworker to windows. Proxy settings can be written // in the registry /* a.startWorkerAfterUpgrade(runner, "machineenvironmentworker", func() (worker.Worker, error) { return machineenvironmentworker.NewMachineEnvironmentWorker(st.Environment(), agentConfig), nil }) */ // gsamfira: No syslog support on windows (yet) /* a.startWorkerAfterUpgrade(runner, "rsyslog", func() (worker.Worker, error) { return newRsyslogConfigWorker(st.Rsyslog(), agentConfig, rsyslogMode) }) */ // If not a local provider bootstrap machine, start the worker to manage SSH keys. // TODO: gsamfira: This will need to be ported at a later time to setup x509 keys for // WinRm /* providerType := agentConfig.Value(agent.ProviderType) if providerType != provider.Local || a.MachineId != bootstrapMachineId { a.startWorkerAfterUpgrade(runner, "authenticationworker", func() (worker.Worker, error) { return authenticationworker.NewWorker(st.KeyUpdater(), agentConfig), nil }) } */ // Perform the operations needed to set up hosting for containers. if err := a.setupContainerSupport(runner, st, entity); err != nil { return nil, fmt.Errorf("setting up container support: %v", err) } for _, job := range entity.Jobs() { switch job { case params.JobHostUnits: a.startWorkerAfterUpgrade(runner, "deployer", func() (worker.Worker, error) { apiDeployer := st.Deployer() context := newDeployContext(apiDeployer, agentConfig) return deployer.NewDeployer(apiDeployer, context), nil }) case params.JobManageEnviron: a.startWorkerAfterUpgrade(runner, "environ-provisioner", func() (worker.Worker, error) { return provisioner.NewEnvironProvisioner(st.Provisioner(), agentConfig), nil }) // TODO(axw) 2013-09-24 bug #1229506 // Make another job to enable the firewaller. Not all environments // are capable of managing ports centrally. a.startWorkerAfterUpgrade(runner, "firewaller", func() (worker.Worker, error) { return firewaller.NewFirewaller(st.Firewaller()) }) a.startWorkerAfterUpgrade(runner, "charm-revision-updater", func() (worker.Worker, error) { return charmrevisionworker.NewRevisionUpdateWorker(st.CharmRevisionUpdater()), nil }) case params.JobManageStateDeprecated: // Legacy environments may set this, but we ignore it. default: // TODO(dimitern): Once all workers moved over to using // the API, report "unknown job type" here. } } return newCloseWorker(runner, st), nil // Note: a worker.Runner is itself a worker.Worker. }
cloudbase/juju-core
cmd/jujud/machine_windows.go
GO
agpl-3.0
5,585
/********************************************************************************* * Ephesoft is a Intelligent Document Capture and Mailroom Automation program * developed by Ephesoft, Inc. Copyright (C) 2015 Ephesoft Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License version 3 as published by the * Free Software Foundation with the addition of the following permission added * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK * IN WHICH THE COPYRIGHT IS OWNED BY EPHESOFT, EPHESOFT DISCLAIMS THE WARRANTY * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License along with * this program; if not, see http://www.gnu.org/licenses or write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA. * * You can contact Ephesoft, Inc. headquarters at 111 Academy Way, * Irvine, CA 92617, USA. or at email address info@ephesoft.com. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Ephesoft" logo. * If the display of the logo is not reasonably feasible for * technical reasons, the Appropriate Legal Notices must display the words * "Powered by Ephesoft". ********************************************************************************/ package com.ephesoft.gxt.admin.client.presenter.indexFiled; import java.util.List; import com.ephesoft.gxt.admin.client.controller.BatchClassManagementController; import com.ephesoft.gxt.admin.client.controller.BatchClassManagementController.BatchClassManagementEventBus; import com.ephesoft.gxt.admin.client.event.AddIndexFieldEvent; import com.ephesoft.gxt.admin.client.event.CopyIndexFieldsEvent; import com.ephesoft.gxt.admin.client.event.DeleteIndexFieldsEvent; import com.ephesoft.gxt.admin.client.event.ExportSelectedIndexFieldEvent; import com.ephesoft.gxt.admin.client.event.RetrieveSelectedIndexFieldListEvent; import com.ephesoft.gxt.admin.client.i18n.BatchClassConstants; import com.ephesoft.gxt.admin.client.i18n.BatchClassMessages; import com.ephesoft.gxt.admin.client.presenter.BatchClassInlinePresenter; import com.ephesoft.gxt.admin.client.view.indexFields.IndexFieldsMenuView; import com.ephesoft.gxt.core.client.i18n.LocaleDictionary; import com.ephesoft.gxt.core.client.ui.widget.DialogWindow; import com.ephesoft.gxt.core.client.ui.widget.window.DialogIcon; import com.ephesoft.gxt.core.client.util.DialogUtil; import com.ephesoft.gxt.core.client.util.WidgetUtil; import com.ephesoft.gxt.core.shared.dto.FieldTypeDTO; import com.google.gwt.core.shared.GWT; import com.google.gwt.event.shared.EventBus; import com.google.gwt.user.client.ui.FormPanel; import com.google.web.bindery.event.shared.binder.EventBinder; import com.google.web.bindery.event.shared.binder.EventHandler; public class IndexFieldMenuPresenter extends BatchClassInlinePresenter<IndexFieldsMenuView> { /** * The Interface CustomEventBinder. */ interface CustomEventBinder extends EventBinder<IndexFieldMenuPresenter> { } /** The Constant eventBinder. */ private static final CustomEventBinder eventBinder = GWT.create(CustomEventBinder.class); public IndexFieldMenuPresenter(BatchClassManagementController controller, IndexFieldsMenuView view) { super(controller, view); } /* * (non-Javadoc) * * @see com.ephesoft.gxt.admin.client.presenter.BatchClassManagementMenuPresenter#bind() */ @Override public void bind() { } /* * (non-Javadoc) * * @see * com.ephesoft.gxt.admin.client.presenter.BatchClassManagementMenuPresenter#injectEvents(com.google.gwt.event.shared.EventBus) */ @Override public void injectEvents(final EventBus eventBus) { eventBinder.bindEventHandlers(this, eventBus); } public void addIndexField() { controller.getEventBus().fireEvent(new AddIndexFieldEvent()); } public void deleteIndexField() { controller.getEventBus().fireEvent(new DeleteIndexFieldsEvent()); } public void exportIndexField() { BatchClassManagementEventBus.fireEvent(new RetrieveSelectedIndexFieldListEvent()); } @EventHandler public void handleExportIndexField(ExportSelectedIndexFieldEvent exportSelectedIndexFields) { if (null != exportSelectedIndexFields) { List<FieldTypeDTO> indexFieldList = exportSelectedIndexFields.getIndexFieldDTOList(); if (null != indexFieldList) { if (!controller.getSelectedBatchClass().isDirty()) { StringBuilder identifierList = new StringBuilder(); for (FieldTypeDTO fieldTypeDTO : indexFieldList) { identifierList.append(fieldTypeDTO.getIdentifier() + ";"); } final DialogWindow dialogWindow = new DialogWindow(); WidgetUtil.setID(dialogWindow, "exportIndexField_view"); final FormPanel exportPanel = new FormPanel(); view.setExportFormPanel(exportPanel); view.addFormPanelEvents(identifierList.toString()); exportPanel.submit(); controller.getIndexFieldView().getIndexFieldGridView().deSelectAllModels(); controller.setSelectedFieldType(null); controller.getIndexFieldView().getIndexFieldGridView().refresh(); } else { applyBatchClassBeforeOperation(LocaleDictionary.getConstantValue(BatchClassConstants.EXPORT_INDEX_FIELD)); } } else { DialogUtil.showMessageDialog(LocaleDictionary.getConstantValue(BatchClassConstants.WARNING_TITLE), LocaleDictionary.getMessageValue(BatchClassMessages.PLEASE_SELECT_INDEX_FIELDS_TO_EXPORT), DialogIcon.WARNING); } } } public void applyBatchClassBeforeOperation(String operationName) { DialogUtil.showMessageDialog(LocaleDictionary.getConstantValue(BatchClassConstants.INFO_TITLE), LocaleDictionary.getMessageValue(BatchClassMessages.PLEASE_SAVE_PENDING_CHANGES_FIRST_TO_EXPORT_INDEX_FIELD), DialogIcon.INFO); } public void copyIndexField() { controller.getEventBus().fireEvent(new CopyIndexFieldsEvent()); } }
ungerik/ephesoft
Ephesoft_Community_Release_4.0.2.0/source/gxt/gxt-admin/src/main/java/com/ephesoft/gxt/admin/client/presenter/indexFiled/IndexFieldMenuPresenter.java
Java
agpl-3.0
6,528
# -*- coding: utf-8 -*- from flask import Blueprint, render_template from flask.ext.security import current_user mod = Blueprint('documentation', __name__) @mod.route('/documentation') @mod.route('/documentation/index') def doc_index(): return render_template('documentation/index.html', apikey='token' if current_user.is_anonymous else current_user.apikey)
odtvince/APITaxi
APITaxi/documentation/index.py
Python
agpl-3.0
381
var clover = new Object(); // JSON: {classes : [{name, id, sl, el, methods : [{sl, el}, ...]}, ...]} clover.pageData = {"classes":[{"el":119,"id":216512,"methods":[{"el":48,"sc":2,"sl":47},{"el":53,"sc":2,"sl":50},{"el":58,"sc":2,"sl":55},{"el":62,"sc":2,"sl":60},{"el":66,"sc":2,"sl":64},{"el":71,"sc":2,"sl":68},{"el":76,"sc":2,"sl":73},{"el":81,"sc":2,"sl":78},{"el":90,"sc":2,"sl":83},{"el":108,"sc":2,"sl":92},{"el":113,"sc":2,"sl":110},{"el":118,"sc":2,"sl":115}],"name":"RegressionFunction","sl":37}]} // JSON: {test_ID : {"methods": [ID1, ID2, ID3...], "name" : "testXXX() void"}, ...}; clover.testTargets = {} // JSON: { lines : [{tests : [testid1, testid2, testid3, ...]}, ...]}; clover.srcFileLines = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []]
cm-is-dog/rapidminer-studio-core
report/html/com/rapidminer/operator/generator/RegressionFunction.js
JavaScript
agpl-3.0
1,197
# Correzione ## FASE 1 e FASE 2 Identico a quello di Cesari. Calabrò ha consegnato dopo. Si veda la correzione su [[../cesari/README.md]] ### sha1sum calcola gli hash dei files ``` $ cat elenco-files.txt | while read a; do sha1sum $a; done a553a6a721497946ba876ad844a8633f72ca78ed cesari/footer.php a553a6a721497946ba876ad844a8633f72ca78ed calabro/footer.php 7198625f079906abee2d5220875d711debd80048 cesari/read_me_persistent.php 7198625f079906abee2d5220875d711debd80048 calabro/read_me_persistent.php 750c75b8756e1afc200c7e0f280e537c01783ac2 cesari/index.php 750c75b8756e1afc200c7e0f280e537c01783ac2 calabro/index.php e2f54dd368bbf04ad1965910e59e9d4a631fd92b cesari/list.php e2f54dd368bbf04ad1965910e59e9d4a631fd92b calabro/list.php 6a9a1c7796c0d42a38aeb26eba5c3bebeadaafa5 cesari/login.php 6a9a1c7796c0d42a38aeb26eba5c3bebeadaafa5 calabro/login.php 56097ea45dd0d23c180df42309b17b398f708a3a cesari/header-1.php 56097ea45dd0d23c180df42309b17b398f708a3a calabro/header-1.php 690d33b6212a87223f4485a3665e333747804af9 cesari/header-2.php 690d33b6212a87223f4485a3665e333747804af9 calabro/header-2.php 6a21f490e71d621c0e72100da413341af776e39a cesari/input.php 6a21f490e71d621c0e72100da413341af776e39a calabro/input.php 22f93531fd60a0b619ee4fa8de0a116c6a4d2d7c cesari/logout.php 22f93531fd60a0b619ee4fa8de0a116c6a4d2d7c calabro/logout.php eabc148463c45e51101e3f28116c734f1d6f5028 cesari/create_me_persistent.php eabc148463c45e51101e3f28116c734f1d6f5028 calabro/create_me_persistent.php ``` ### rmlint individua i files duplicati ``` rmlint cesari calabro # Duplicate(s): ls '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/cesari/create_me_persistent.php' rm '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/calabro/create_me_persistent.php' ls '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/cesari/footer.php' rm '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/calabro/footer.php' ls '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/cesari/header-1.php' rm '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/calabro/header-1.php' ls '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/cesari/input.php' rm '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/calabro/input.php' ls '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/cesari/login.php' rm '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/calabro/login.php' ls '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/cesari/read_me_persistent.php' rm '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/calabro/read_me_persistent.php' ls '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/cesari/logout.php' rm '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/calabro/logout.php' ls '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/cesari/header-2.php' rm '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/calabro/header-2.php' ls '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/cesari/list.php' rm '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/calabro/list.php' ls '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/cesari/index.php' rm '/home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/calabro/index.php' ==> Note: Please use the saved script below for removal, not the above output. ==> In total 23 files, whereof 10 are duplicates in 10 groups. ==> This equals 8.15 KB of duplicates which could be removed. Wrote a sh file to: /home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/rmlint.sh Wrote a json file to: /home/fero/src/feroda/lessons-itis/2016-5BI/PHP/ex/CONSEGNE-2017-05-06/rmlint.json ```
feroda/lessons-itis
2016-5BI/PHP/ex/CONSEGNE-2017-05-06/calabro/README.md
Markdown
agpl-3.0
4,029
// // PayPalOAuthScopes.h // // Version 2.11.1 // // Copyright (c) 2014, PayPal // All rights reserved. // // Currently available scope-values to which the user can be asked to consent. // @see https://developer.paypal.com/docs/integration/direct/identity/attributes/ for more details /// Authorize charges for future purchases paid for with PayPal. extern NSString *const kPayPalOAuth2ScopeFuturePayments; /// Share basic account information. extern NSString *const kPayPalOAuth2ScopeProfile; /// Basic Authentication. extern NSString *const kPayPalOAuth2ScopeOpenId; /// Share your personal and account information. extern NSString *const kPayPalOAuth2ScopePayPalAttributes; /// Share your email address. extern NSString *const kPayPalOAuth2ScopeEmail; /// Share your account address. extern NSString *const kPayPalOAuth2ScopeAddress; /// Share your phone number. extern NSString *const kPayPalOAuth2ScopePhone;
wesley1001/mobile
plugins/com.paypal.cordova.mobilesdk/src/ios/PayPalMobile/PayPalOAuthScopes.h
C
agpl-3.0
921
import Controller from '@ember/controller'; import modal from '../utils/modal'; import i18n from '../utils/i18n'; import session from '../utils/session'; import persistence from '../utils/persistence'; import CoughDrop from '../app'; import { later as runLater } from '@ember/runloop'; export default Controller.extend({ actions: { update_org: function() { var org = this.get('model'); org.save().then(null, function(err) { console.log(err); modal.error(i18n.t('org_update_failed', 'Organization update failed unexpectedly')); }); }, jobs: function() { persistence.ajax('/api/v1/auth/admin', {type: 'POST', data: {}}).then(function(res) { location.href = '/jobby'; }, function(err) { alert('Not authorized'); }) }, masquerade: function() { if(this.get('model.admin') && this.get('model.permissions.manage')) { var user_name = this.get('masquerade_user_name'); var _this = this; this.store.findRecord('user', user_name).then(function(u) { var data = session.restore(); data.original_user_name = data.user_name; data.as_user_id = user_name; data.user_name = user_name; session.persist(data).then(function() { _this.transitionToRoute('index'); runLater(function() { location.reload(); }); }); }, function() { modal.error(i18n.t('couldnt_find_user', "Couldn't retrieve user \"%{user_name}\" for masquerading", {user_name: user_name})); }); } }, find_board: function() { var key = this.get('search_board'); var _this = this; if(key) { CoughDrop.store.findRecord('board', key).then(function(res) { _this.transitionToRoute('board', res.get('key')); }, function(err) { if(err.deleted && err.key) { _this.transitionToRoute('board', err.key); } else { modal.error(i18n.t('no_boards_found', "No boards found matching that lookup")); } }); } }, find_user: function() { var q = this.get('search_user'); var _this = this; if(q) { var opts = {q: q}; if(!this.get('model.admin')) { opts.org_id = this.get('model.id'); } CoughDrop.store.query('user', opts).then(function(res) { if(res.content.length === 0) { modal.warning(i18n.t('no_user_result', "No results found for \"%{q}\"", {q: q})); } else if(res.content.length == 1) { _this.transitionToRoute('user.index', res.map(function(i) { return i; })[0].get('user_name')); } else { modal.open('user-results', {list: res, q: q}); } }, function() { modal.error(i18n.t('error_searching', "There was an unexpected error while search for the user")); }); } } } });
CoughDrop/coughdrop
app/frontend/app/controllers/organization.js
JavaScript
agpl-3.0
2,958
/** * Commons Cloud CSS Library * * * * */ /** * Fonts */ /*! * Bootstrap v3.0.0 * * Copyright 2013 Twitter, Inc * Licensed under the Apache License v2.0 * http://www.apache.org/licenses/LICENSE-2.0 * * Designed and built with all the love in the world @twitter by @mdo and @fat. */ article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { display: block; } audio, canvas, video { display: inline-block; } audio:not([controls]) { display: none; height: 0; } [hidden] { display: none; } html { font-family: sans-serif; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } body { margin: 0; } a:focus { outline: thin dotted; } a:active, a:hover { outline: 0; } h1 { font-size: 2em; margin: 0.67em 0; } abbr[title] { border-bottom: 1px dotted; } b, strong { font-weight: bold; } dfn { font-style: italic; } hr { -moz-box-sizing: content-box; box-sizing: content-box; height: 0; } mark { background: #ff0; color: #000; } code, kbd, pre, samp { font-family: monospace, serif; font-size: 1em; } pre { white-space: pre-wrap; } q { quotes: "\201C" "\201D" "\2018" "\2019"; } small { font-size: 80%; } sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sup { top: -0.5em; } sub { bottom: -0.25em; } img { border: 0; } svg:not(:root) { overflow: hidden; } figure { margin: 0; } fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; } legend { border: 0; padding: 0; } button, input, select, textarea { font-family: inherit; font-size: 100%; margin: 0; } button, input { line-height: normal; } button, select { text-transform: none; } button, html input[type="button"], input[type="reset"], input[type="submit"] { -webkit-appearance: button; cursor: pointer; } button[disabled], html input[disabled] { cursor: default; } input[type="checkbox"], input[type="radio"] { box-sizing: border-box; padding: 0; } input[type="search"] { -webkit-appearance: textfield; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; } input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } textarea { overflow: auto; vertical-align: top; } table { border-collapse: collapse; border-spacing: 0; } *, *:before, *:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } html { font-size: 62.5%; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } body { background-color: rgb(33, 39, 41); font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 14px; line-height: 1.428571429; color: rgb(242,242,242); } input, button, select, textarea { font-family: inherit; font-size: inherit; line-height: inherit; } button, input, select[multiple], textarea { background-image: none; } a { color: #428bca; text-decoration: none; } a:hover, a:focus { color: #2a6496; text-decoration: underline; } a:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } img { vertical-align: middle; } .img-responsive { display: block; max-width: 100%; height: auto; } .img-thumbnail { padding: 4px; line-height: 1.428571429; background-color: #ffffff; border: 1px solid #dddddd; -webkit-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; display: inline-block; max-width: 100%; height: auto; } .img-circle { border-radius: 50%; } hr { margin-top: 20px; margin-bottom: 20px; border: 0; border-top: 1px solid #eeeeee; } .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; } @media print { * { text-shadow: none !important; color: #000 !important; background: transparent !important; box-shadow: none !important; } a, a:visited { text-decoration: underline; } a[href]:after { content: " (" attr(href) ")"; } abbr[title]:after { content: " (" attr(title) ")"; } .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } thead { display: table-header-group; } tr, img { page-break-inside: avoid; } img { max-width: 100% !important; } @page { margin: 2cm .5cm; } p, h2, h3 { orphans: 3; widows: 3; } h2, h3 { page-break-after: avoid; } .navbar { display: none; } .table td, .table th { background-color: #fff !important; } .btn > .caret, .dropup > .btn > .caret { border-top-color: #000 !important; } .label { border: 1px solid #000; } .table { border-collapse: collapse !important; } .table-bordered th, .table-bordered td { border: 1px solid #ddd !important; } } p { margin: 0 0 10px; } .lead { margin-bottom: 20px; font-size: 16.099999999999998px; font-weight: 200; line-height: 1.4; } @media (min-width: 768px) { .lead { font-size: 21px; } } small { font-size: 85%; } cite { font-style: normal; } .text-muted { color: #999999; } .text-primary { color: #428bca; } .text-warning { color: #c09853; } .text-danger { color: #b94a48; } .text-success { color: #468847; } .text-info { color: #3a87ad; } .text-left { text-align: left; } .text-right { text-align: right; } .text-center { text-align: center; } h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: 500; line-height: 1.1; } h1 small, h2 small, h3 small, h4 small, h5 small, h6 small, .h1 small, .h2 small, .h3 small, .h4 small, .h5 small, .h6 small { font-weight: normal; line-height: 1; color: #999999; } h1, h2, h3 { margin-top: 20px; margin-bottom: 10px; } h4, h5, h6 { margin-top: 10px; margin-bottom: 10px; } h1, .h1 { font-size: 36px; } h2, .h2 { font-size: 30px; } h3, .h3 { font-size: 24px; } h4, .h4 { font-size: 18px; } h5, .h5 { font-size: 14px; } h6, .h6 { font-size: 12px; } h1 small, .h1 small { font-size: 24px; } h2 small, .h2 small { font-size: 18px; } h3 small, .h3 small, h4 small, .h4 small { font-size: 14px; } .page-header { padding-bottom: 9px; margin: 40px 0 20px; border-bottom: 1px solid #eeeeee; } ul, ol { margin-top: 0; margin-bottom: 10px; } ul ul, ol ul, ul ol, ol ol { margin-bottom: 0; } .list-unstyled { padding-left: 0; list-style: none; } .list-inline { padding-left: 0; list-style: none; } .list-inline > li { display: inline-block; padding-left: 5px; padding-right: 5px; } dl { margin-bottom: 20px; } dt, dd { line-height: 1.428571429; } dt { font-weight: bold; } dd { margin-left: 0; } @media (min-width: 768px) { .dl-horizontal dt { float: left; width: 160px; clear: left; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dl-horizontal dd { margin-left: 180px; } .dl-horizontal dd:before, .dl-horizontal dd:after { content: " "; display: table; } .dl-horizontal dd:after { clear: both; } .dl-horizontal dd:before, .dl-horizontal dd:after { content: " "; display: table; } .dl-horizontal dd:after { clear: both; } } abbr[title], abbr[data-original-title] { cursor: help; border-bottom: 1px dotted #999999; } abbr.initialism { font-size: 90%; text-transform: uppercase; } blockquote { padding: 10px 20px; margin: 0 0 20px; border-left: 5px solid #eeeeee; } blockquote p { font-size: 17.5px; font-weight: 300; line-height: 1.25; } blockquote p:last-child { margin-bottom: 0; } blockquote small { display: block; line-height: 1.428571429; color: #999999; } blockquote small:before { content: '\2014 \00A0'; } blockquote.pull-right { padding-right: 15px; padding-left: 0; border-right: 5px solid #eeeeee; border-left: 0; } blockquote.pull-right p, blockquote.pull-right small { text-align: right; } blockquote.pull-right small:before { content: ''; } blockquote.pull-right small:after { content: '\00A0 \2014'; } q:before, q:after, blockquote:before, blockquote:after { content: ""; } address { display: block; margin-bottom: 20px; font-style: normal; line-height: 1.428571429; } code, pre { font-family: Monaco,Menlo,Consolas,"Courier New",monospace; } code { padding: 2px 4px; font-size: 90%; color: #c7254e; background-color: #f9f2f4; white-space: nowrap; } pre { display: block; padding: 9.5px; margin: 0 0 10px; font-size: 13px; line-height: 1.428571429; word-break: break-all; word-wrap: break-word; color: #333333; background-color: #f5f5f5; border: 1px solid #cccccc; } pre.prettyprint { margin-bottom: 20px; } pre code { padding: 0; font-size: inherit; color: inherit; white-space: pre-wrap; background-color: transparent; border: 0; } .pre-scrollable { max-height: 340px; overflow-y: scroll; } .container { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } .container:before, .container:after { content: " "; display: table; } .container:after { clear: both; } .container:before, .container:after { content: " "; display: table; } .container:after { clear: both; } .row { margin-left: -15px; margin-right: -15px; } .row:before, .row:after { content: " "; display: table; } .row:after { clear: both; } .row:before, .row:after { content: " "; display: table; } .row:after { clear: both; } .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { position: relative; min-height: 1px; padding-left: 0; padding-right: 0; } .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11 { float: left; } .col-xs-1 { width: 8.333333333333332%; } .col-xs-2 { width: 16.666666666666664%; } .col-xs-3 { width: 25%; } .col-xs-4 { width: 33.33333333333333%; } .col-xs-5 { width: 41.66666666666667%; } .col-xs-6 { width: 50%; } .col-xs-7 { width: 58.333333333333336%; } .col-xs-8 { width: 66.66666666666666%; } .col-xs-9 { width: 75%; } .col-xs-10 { width: 83.33333333333334%; } .col-xs-11 { width: 91.66666666666666%; } .col-xs-12 { width: 100%; } @media (min-width: 768px) { .container { max-width: 750px; } .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11 { float: left; } .col-sm-1 { width: 8.333333333333332%; } .col-sm-2 { width: 16.666666666666664%; } .col-sm-3 { width: 25%; } .col-sm-4 { width: 33.33333333333333%; } .col-sm-5 { width: 41.66666666666667%; } .col-sm-6 { width: 50%; } .col-sm-7 { width: 58.333333333333336%; } .col-sm-8 { width: 66.66666666666666%; } .col-sm-9 { width: 75%; } .col-sm-10 { width: 83.33333333333334%; } .col-sm-11 { width: 91.66666666666666%; } .col-sm-12 { width: 100%; } .col-sm-push-1 { left: 8.333333333333332%; } .col-sm-push-2 { left: 16.666666666666664%; } .col-sm-push-3 { left: 25%; } .col-sm-push-4 { left: 33.33333333333333%; } .col-sm-push-5 { left: 41.66666666666667%; } .col-sm-push-6 { left: 50%; } .col-sm-push-7 { left: 58.333333333333336%; } .col-sm-push-8 { left: 66.66666666666666%; } .col-sm-push-9 { left: 75%; } .col-sm-push-10 { left: 83.33333333333334%; } .col-sm-push-11 { left: 91.66666666666666%; } .col-sm-pull-1 { right: 8.333333333333332%; } .col-sm-pull-2 { right: 16.666666666666664%; } .col-sm-pull-3 { right: 25%; } .col-sm-pull-4 { right: 33.33333333333333%; } .col-sm-pull-5 { right: 41.66666666666667%; } .col-sm-pull-6 { right: 50%; } .col-sm-pull-7 { right: 58.333333333333336%; } .col-sm-pull-8 { right: 66.66666666666666%; } .col-sm-pull-9 { right: 75%; } .col-sm-pull-10 { right: 83.33333333333334%; } .col-sm-pull-11 { right: 91.66666666666666%; } .col-sm-offset-1 { margin-left: 8.333333333333332%; } .col-sm-offset-2 { margin-left: 16.666666666666664%; } .col-sm-offset-3 { margin-left: 25%; } .col-sm-offset-4 { margin-left: 33.33333333333333%; } .col-sm-offset-5 { margin-left: 41.66666666666667%; } .col-sm-offset-6 { margin-left: 50%; } .col-sm-offset-7 { margin-left: 58.333333333333336%; } .col-sm-offset-8 { margin-left: 66.66666666666666%; } .col-sm-offset-9 { margin-left: 75%; } .col-sm-offset-10 { margin-left: 83.33333333333334%; } .col-sm-offset-11 { margin-left: 91.66666666666666%; } } @media (min-width: 992px) { .container { max-width: 970px; } .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11 { float: left; } .col-md-1 { width: 8.333333333333332%; } .col-md-2 { width: 16.666666666666664%; } .col-md-3 { width: 25%; } .col-md-4 { width: 33.33333333333333%; } .col-md-5 { width: 41.66666666666667%; } .col-md-6 { width: 50%; } .col-md-7 { width: 58.333333333333336%; } .col-md-8 { width: 66.66666666666666%; } .col-md-9 { width: 75%; } .col-md-10 { width: 83.33333333333334%; } .col-md-11 { width: 91.66666666666666%; } .col-md-12 { width: 100%; } .col-md-push-0 { left: auto; } .col-md-push-1 { left: 8.333333333333332%; } .col-md-push-2 { left: 16.666666666666664%; } .col-md-push-3 { left: 25%; } .col-md-push-4 { left: 33.33333333333333%; } .col-md-push-5 { left: 41.66666666666667%; } .col-md-push-6 { left: 50%; } .col-md-push-7 { left: 58.333333333333336%; } .col-md-push-8 { left: 66.66666666666666%; } .col-md-push-9 { left: 75%; } .col-md-push-10 { left: 83.33333333333334%; } .col-md-push-11 { left: 91.66666666666666%; } .col-md-pull-0 { right: auto; } .col-md-pull-1 { right: 8.333333333333332%; } .col-md-pull-2 { right: 16.666666666666664%; } .col-md-pull-3 { right: 25%; } .col-md-pull-4 { right: 33.33333333333333%; } .col-md-pull-5 { right: 41.66666666666667%; } .col-md-pull-6 { right: 50%; } .col-md-pull-7 { right: 58.333333333333336%; } .col-md-pull-8 { right: 66.66666666666666%; } .col-md-pull-9 { right: 75%; } .col-md-pull-10 { right: 83.33333333333334%; } .col-md-pull-11 { right: 91.66666666666666%; } .col-md-offset-0 { margin-left: 0; } .col-md-offset-1 { margin-left: 8.333333333333332%; } .col-md-offset-2 { margin-left: 16.666666666666664%; } .col-md-offset-3 { margin-left: 25%; } .col-md-offset-4 { margin-left: 33.33333333333333%; } .col-md-offset-5 { margin-left: 41.66666666666667%; } .col-md-offset-6 { margin-left: 50%; } .col-md-offset-7 { margin-left: 58.333333333333336%; } .col-md-offset-8 { margin-left: 66.66666666666666%; } .col-md-offset-9 { margin-left: 75%; } .col-md-offset-10 { margin-left: 83.33333333333334%; } .col-md-offset-11 { margin-left: 91.66666666666666%; } } @media (min-width: 1200px) { .container { max-width: 1170px; } .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11 { float: left; } .col-lg-1 { width: 8.333333333333332%; } .col-lg-2 { width: 16.666666666666664%; } .col-lg-3 { width: 25%; } .col-lg-4 { width: 33.33333333333333%; } .col-lg-5 { width: 41.66666666666667%; } .col-lg-6 { width: 50%; } .col-lg-7 { width: 58.333333333333336%; } .col-lg-8 { width: 66.66666666666666%; } .col-lg-9 { width: 75%; } .col-lg-10 { width: 83.33333333333334%; } .col-lg-11 { width: 91.66666666666666%; } .col-lg-12 { width: 100%; } .col-lg-push-0 { left: auto; } .col-lg-push-1 { left: 8.333333333333332%; } .col-lg-push-2 { left: 16.666666666666664%; } .col-lg-push-3 { left: 25%; } .col-lg-push-4 { left: 33.33333333333333%; } .col-lg-push-5 { left: 41.66666666666667%; } .col-lg-push-6 { left: 50%; } .col-lg-push-7 { left: 58.333333333333336%; } .col-lg-push-8 { left: 66.66666666666666%; } .col-lg-push-9 { left: 75%; } .col-lg-push-10 { left: 83.33333333333334%; } .col-lg-push-11 { left: 91.66666666666666%; } .col-lg-pull-0 { right: auto; } .col-lg-pull-1 { right: 8.333333333333332%; } .col-lg-pull-2 { right: 16.666666666666664%; } .col-lg-pull-3 { right: 25%; } .col-lg-pull-4 { right: 33.33333333333333%; } .col-lg-pull-5 { right: 41.66666666666667%; } .col-lg-pull-6 { right: 50%; } .col-lg-pull-7 { right: 58.333333333333336%; } .col-lg-pull-8 { right: 66.66666666666666%; } .col-lg-pull-9 { right: 75%; } .col-lg-pull-10 { right: 83.33333333333334%; } .col-lg-pull-11 { right: 91.66666666666666%; } .col-lg-offset-0 { margin-left: 0; } .col-lg-offset-1 { margin-left: 8.333333333333332%; } .col-lg-offset-2 { margin-left: 16.666666666666664%; } .col-lg-offset-3 { margin-left: 25%; } .col-lg-offset-4 { margin-left: 33.33333333333333%; } .col-lg-offset-5 { margin-left: 41.66666666666667%; } .col-lg-offset-6 { margin-left: 50%; } .col-lg-offset-7 { margin-left: 58.333333333333336%; } .col-lg-offset-8 { margin-left: 66.66666666666666%; } .col-lg-offset-9 { margin-left: 75%; } .col-lg-offset-10 { margin-left: 83.33333333333334%; } .col-lg-offset-11 { margin-left: 91.66666666666666%; } } table { max-width: 100%; background-color: transparent; } th { text-align: left; } .table { width: 100%; margin-bottom: 20px; } .table thead > tr > th, .table tbody > tr > th, .table tfoot > tr > th, .table thead > tr > td, .table tbody > tr > td, .table tfoot > tr > td { padding: 8px; line-height: 1.428571429; vertical-align: top; border-top: 1px solid #dddddd; } .table thead > tr > th { vertical-align: bottom; border-bottom: 2px solid #dddddd; } .table caption + thead tr:first-child th, .table colgroup + thead tr:first-child th, .table thead:first-child tr:first-child th, .table caption + thead tr:first-child td, .table colgroup + thead tr:first-child td, .table thead:first-child tr:first-child td { border-top: 0; } .table tbody + tbody { border-top: 2px solid #dddddd; } .table .table { background-color: #ffffff; } .table-condensed thead > tr > th, .table-condensed tbody > tr > th, .table-condensed tfoot > tr > th, .table-condensed thead > tr > td, .table-condensed tbody > tr > td, .table-condensed tfoot > tr > td { padding: 5px; } .table-bordered { border: 1px solid #dddddd; } .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td { border: 1px solid #dddddd; } .table-bordered > thead > tr > th, .table-bordered > thead > tr > td { border-bottom-width: 2px; } .table-striped > tbody > tr:nth-child(odd) > td, .table-striped > tbody > tr:nth-child(odd) > th { background-color: #f9f9f9; } .table-hover > tbody > tr:hover > td, .table-hover > tbody > tr:hover > th { background-color: #f5f5f5; } table col[class*="col-"] { float: none; display: table-column; } table td[class*="col-"], table th[class*="col-"] { float: none; display: table-cell; } .table > thead > tr > td.active, .table > tbody > tr > td.active, .table > tfoot > tr > td.active, .table > thead > tr > th.active, .table > tbody > tr > th.active, .table > tfoot > tr > th.active, .table > thead > tr.active > td, .table > tbody > tr.active > td, .table > tfoot > tr.active > td, .table > thead > tr.active > th, .table > tbody > tr.active > th, .table > tfoot > tr.active > th { background-color: #f5f5f5; } .table > thead > tr > td.success, .table > tbody > tr > td.success, .table > tfoot > tr > td.success, .table > thead > tr > th.success, .table > tbody > tr > th.success, .table > tfoot > tr > th.success, .table > thead > tr.success > td, .table > tbody > tr.success > td, .table > tfoot > tr.success > td, .table > thead > tr.success > th, .table > tbody > tr.success > th, .table > tfoot > tr.success > th { background-color: #dff0d8; border-color: #d6e9c6; } .table-hover > tbody > tr > td.success:hover, .table-hover > tbody > tr > th.success:hover, .table-hover > tbody > tr.success:hover > td { background-color: #d0e9c6; border-color: #c9e2b3; } .table > thead > tr > td.danger, .table > tbody > tr > td.danger, .table > tfoot > tr > td.danger, .table > thead > tr > th.danger, .table > tbody > tr > th.danger, .table > tfoot > tr > th.danger, .table > thead > tr.danger > td, .table > tbody > tr.danger > td, .table > tfoot > tr.danger > td, .table > thead > tr.danger > th, .table > tbody > tr.danger > th, .table > tfoot > tr.danger > th { background-color: #f2dede; border-color: #eed3d7; } .table-hover > tbody > tr > td.danger:hover, .table-hover > tbody > tr > th.danger:hover, .table-hover > tbody > tr.danger:hover > td { background-color: #ebcccc; border-color: #e6c1c7; } .table > thead > tr > td.warning, .table > tbody > tr > td.warning, .table > tfoot > tr > td.warning, .table > thead > tr > th.warning, .table > tbody > tr > th.warning, .table > tfoot > tr > th.warning, .table > thead > tr.warning > td, .table > tbody > tr.warning > td, .table > tfoot > tr.warning > td, .table > thead > tr.warning > th, .table > tbody > tr.warning > th, .table > tfoot > tr.warning > th { background-color: #fcf8e3; border-color: #fbeed5; } .table-hover > tbody > tr > td.warning:hover, .table-hover > tbody > tr > th.warning:hover, .table-hover > tbody > tr.warning:hover > td { background-color: #faf2cc; border-color: #f8e5be; } @media (max-width: 768px) { .table-responsive { width: 100%; margin-bottom: 15px; overflow-y: hidden; overflow-x: scroll; border: 1px solid #dddddd; } .table-responsive > .table { margin-bottom: 0; background-color: #fff; } .table-responsive > .table > thead > tr > th, .table-responsive > .table > tbody > tr > th, .table-responsive > .table > tfoot > tr > th, .table-responsive > .table > thead > tr > td, .table-responsive > .table > tbody > tr > td, .table-responsive > .table > tfoot > tr > td { white-space: nowrap; } .table-responsive > .table-bordered { border: 0; } .table-responsive > .table-bordered > thead > tr > th:first-child, .table-responsive > .table-bordered > tbody > tr > th:first-child, .table-responsive > .table-bordered > tfoot > tr > th:first-child, .table-responsive > .table-bordered > thead > tr > td:first-child, .table-responsive > .table-bordered > tbody > tr > td:first-child, .table-responsive > .table-bordered > tfoot > tr > td:first-child { border-left: 0; } .table-responsive > .table-bordered > thead > tr > th:last-child, .table-responsive > .table-bordered > tbody > tr > th:last-child, .table-responsive > .table-bordered > tfoot > tr > th:last-child, .table-responsive > .table-bordered > thead > tr > td:last-child, .table-responsive > .table-bordered > tbody > tr > td:last-child, .table-responsive > .table-bordered > tfoot > tr > td:last-child { border-right: 0; } .table-responsive > .table-bordered > thead > tr:last-child > th, .table-responsive > .table-bordered > tbody > tr:last-child > th, .table-responsive > .table-bordered > tfoot > tr:last-child > th, .table-responsive > .table-bordered > thead > tr:last-child > td, .table-responsive > .table-bordered > tbody > tr:last-child > td, .table-responsive > .table-bordered > tfoot > tr:last-child > td { border-bottom: 0; } } fieldset { padding: 0; margin: 0; border: 0; } legend { display: block; width: 100%; padding: 0; margin-bottom: 20px; font-size: 21px; line-height: inherit; color: #333333; border: 0; border-bottom: 1px solid #e5e5e5; } legend small { font-size: 60%; font-weight: 200; color: rgb(252, 252, 252); color: rgba(252, 252, 252,0.8); margin-top: 8px; } label { display: inline-block; margin-bottom: 5px; font-weight: bold; } input[type="search"] { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } input[type="radio"], input[type="checkbox"] { margin: 4px 0 0; margin-top: 1px \9; line-height: normal; } input[type="file"] { display: block; } select[multiple], select[size] { height: auto; } select optgroup { font-size: inherit; font-style: inherit; font-family: inherit; } input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { height: auto; } .form-control:-moz-placeholder { color: #999999; } .form-control::-moz-placeholder { color: #999999; } .form-control:-ms-input-placeholder { color: #999999; } .form-control::-webkit-input-placeholder { color: #999999; } .form-control { display: block; width: 100%; padding: 0; font-size: 1em; line-height: 1.428571429; color: rgb(232,232,232); vertical-align: middle; background-color: transparent; border: 0; border-bottom: 1px solid rgb(128, 128, 128); -webkit-box-shadow: none; -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; box-shadow: none; } .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { cursor: not-allowed; background-color: #eeeeee; } textarea.form-control { height: auto; } .form-group { margin-bottom: 15px; } .radio, .checkbox { display: block; min-height: 20px; margin-top: 10px; margin-bottom: 10px; padding-left: 20px; vertical-align: middle; } .radio label, .checkbox label { display: inline; margin-bottom: 0; font-weight: normal; cursor: pointer; } .radio input[type="radio"], .radio-inline input[type="radio"], .checkbox input[type="checkbox"], .checkbox-inline input[type="checkbox"] { float: left; margin-left: -20px; } .radio + .radio, .checkbox + .checkbox { margin-top: -5px; } .radio-inline, .checkbox-inline { display: inline-block; padding-left: 20px; margin-bottom: 0; vertical-align: middle; font-weight: normal; cursor: pointer; } .radio-inline + .radio-inline, .checkbox-inline + .checkbox-inline { margin-top: 0; margin-left: 10px; } input[type="radio"][disabled], input[type="checkbox"][disabled], .radio[disabled], .radio-inline[disabled], .checkbox[disabled], .checkbox-inline[disabled], fieldset[disabled] input[type="radio"], fieldset[disabled] input[type="checkbox"], fieldset[disabled] .radio, fieldset[disabled] .radio-inline, fieldset[disabled] .checkbox, fieldset[disabled] .checkbox-inline { cursor: not-allowed; } .input-sm { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; } select.input-sm { height: 30px; line-height: 30px; } textarea.input-sm { height: auto; } .input-lg { height: 34px; padding: 0; font-size: 18px; line-height: 1.5; } .input-lg.text { padding: 10px 0 2px; background-color: rgba(0, 0, 0, 0); border-left: 0; border-bottom-width: 1px; border-right: 0; border-top: 0; box-shadow: none; } select.input-lg { height: 45px; line-height: 45px; } textarea.input-lg { height: auto; } .has-warning .help-block, .has-warning .control-label { color: #c09853; } .has-warning .form-control { border-color: #c09853; -webkit-box-shadow: none; box-shadow: none; } .has-warning .form-control:focus { border-color: #a47e3c; -webkit-box-shadow: none; box-shadow: none; } .has-warning .input-group-addon { color: #c09853; border-color: #c09853; background-color: #fcf8e3; } .has-error .help-block, .has-error .control-label { color: #F44336; } .has-error .form-control { border-color: #F44336; -webkit-box-shadow: none; box-shadow: none; } .has-error .form-control:focus { border-color: #953b39; -webkit-box-shadow: none; box-shadow: none; } .has-error .input-group-addon { color: #F44336; border-color: #F44336; background-color: #f2dede; } .card .has-error .help-block, .card .has-error .help-block a, .card .has-error .help-block a:hover { color: #F44336; } .has-success .help-block, .has-success .control-label { color: #468847; } .has-success .form-control { border-color: #468847; -webkit-box-shadow: none; box-shadow: none; } .has-success .form-control:focus { border-color: #356635; -webkit-box-shadow: none; box-shadow: none; } .has-success .input-group-addon { color: #468847; border-color: #468847; background-color: #dff0d8; } .form-control-static { margin-bottom: 0; padding-top: 7px; } .help-block { display: block; margin-top: 5px; margin-bottom: 10px; color: #737373; } @media (min-width: 768px) { .form-inline .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; } .form-inline .form-control { display: inline-block; } .form-inline .radio, .form-inline .checkbox { display: inline-block; margin-top: 0; margin-bottom: 0; padding-left: 0; } .form-inline .radio input[type="radio"], .form-inline .checkbox input[type="checkbox"] { float: none; margin-left: 0; } } .form-horizontal .control-label, .form-horizontal .radio, .form-horizontal .checkbox, .form-horizontal .radio-inline, .form-horizontal .checkbox-inline { margin-top: 0; margin-bottom: 0; padding-top: 7px; } .form-horizontal .form-group { margin-left: -15px; margin-right: -15px; } .form-horizontal .form-group:before, .form-horizontal .form-group:after { content: " "; display: table; } .form-horizontal .form-group:after { clear: both; } .form-horizontal .form-group:before, .form-horizontal .form-group:after { content: " "; display: table; } .form-horizontal .form-group:after { clear: both; } @media (min-width: 768px) { .form-horizontal .control-label { text-align: right; } } .btn { display: inline-block; padding: 6px 12px; margin-bottom: 0; font-size: 14px; font-weight: normal; line-height: 1.428571429; text-align: center; vertical-align: middle; cursor: pointer; border: 1px solid transparent; white-space: nowrap; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none; } .btn:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .btn:hover, .btn:focus { color: #333333; text-decoration: none; } .btn:active, .btn.active { outline: 0; background-image: none; -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } .btn.disabled, .btn[disabled], fieldset[disabled] .btn { cursor: not-allowed; pointer-events: none; opacity: 0.65; filter: alpha(opacity=65); -webkit-box-shadow: none; box-shadow: none; } .btn-default { color: #333333; background-color: #ffffff; border-color: #cccccc; } .btn-default:hover, .btn-default:focus, .btn-default:active, .btn-default.active, .open .dropdown-toggle.btn-default { color: #333333; background-color: #ebebeb; border-color: #adadad; } .btn-default:active, .btn-default.active, .open .dropdown-toggle.btn-default { background-image: none; } .btn-default.disabled, .btn-default[disabled], fieldset[disabled] .btn-default, .btn-default.disabled:hover, .btn-default[disabled]:hover, fieldset[disabled] .btn-default:hover, .btn-default.disabled:focus, .btn-default[disabled]:focus, fieldset[disabled] .btn-default:focus, .btn-default.disabled:active, .btn-default[disabled]:active, fieldset[disabled] .btn-default:active, .btn-default.disabled.active, .btn-default[disabled].active, fieldset[disabled] .btn-default.active { background-color: #ffffff; border-color: #cccccc; } .btn-primary { color: #ffffff; background-color: #428bca; border-color: #357ebd; } .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary { color: #ffffff; background-color: #3276b1; border-color: #285e8e; } .btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary { background-image: none; } .btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary.active { background-color: #428bca; border-color: #357ebd; } .btn-warning { color: #ffffff; background-color: #f0ad4e; border-color: #eea236; } .btn-warning:hover, .btn-warning:focus, .btn-warning:active, .btn-warning.active, .open .dropdown-toggle.btn-warning { color: #ffffff; background-color: #ed9c28; border-color: #d58512; } .btn-warning:active, .btn-warning.active, .open .dropdown-toggle.btn-warning { background-image: none; } .btn-warning.disabled, .btn-warning[disabled], fieldset[disabled] .btn-warning, .btn-warning.disabled:hover, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning:hover, .btn-warning.disabled:focus, .btn-warning[disabled]:focus, fieldset[disabled] .btn-warning:focus, .btn-warning.disabled:active, .btn-warning[disabled]:active, fieldset[disabled] .btn-warning:active, .btn-warning.disabled.active, .btn-warning[disabled].active, fieldset[disabled] .btn-warning.active { background-color: #f0ad4e; border-color: #eea236; } .btn-danger { color: #ffffff; background-color: #d9534f; border-color: #d43f3a; } .btn-danger:hover, .btn-danger:focus, .btn-danger:active, .btn-danger.active, .open .dropdown-toggle.btn-danger { color: #ffffff; background-color: #d2322d; border-color: #ac2925; } .btn-danger:active, .btn-danger.active, .open .dropdown-toggle.btn-danger { background-image: none; } .btn-danger.disabled, .btn-danger[disabled], fieldset[disabled] .btn-danger, .btn-danger.disabled:hover, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger:hover, .btn-danger.disabled:focus, .btn-danger[disabled]:focus, fieldset[disabled] .btn-danger:focus, .btn-danger.disabled:active, .btn-danger[disabled]:active, fieldset[disabled] .btn-danger:active, .btn-danger.disabled.active, .btn-danger[disabled].active, fieldset[disabled] .btn-danger.active { background-color: #d9534f; border-color: #d43f3a; } .btn-success { color: #ffffff; background-color: #5cb85c; border-color: #4cae4c; } .btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active, .open .dropdown-toggle.btn-success { color: #ffffff; background-color: #47a447; border-color: #398439; } .btn-success:active, .btn-success.active, .open .dropdown-toggle.btn-success { background-image: none; } .btn-success.disabled, .btn-success[disabled], fieldset[disabled] .btn-success, .btn-success.disabled:hover, .btn-success[disabled]:hover, fieldset[disabled] .btn-success:hover, .btn-success.disabled:focus, .btn-success[disabled]:focus, fieldset[disabled] .btn-success:focus, .btn-success.disabled:active, .btn-success[disabled]:active, fieldset[disabled] .btn-success:active, .btn-success.disabled.active, .btn-success[disabled].active, fieldset[disabled] .btn-success.active { background-color: #5cb85c; border-color: #4cae4c; } .btn-info { color: #ffffff; background-color: #5bc0de; border-color: #46b8da; } .btn-info:hover, .btn-info:focus, .btn-info:active, .btn-info.active, .open .dropdown-toggle.btn-info { color: #ffffff; background-color: #39b3d7; border-color: #269abc; } .btn-info:active, .btn-info.active, .open .dropdown-toggle.btn-info { background-image: none; } .btn-info.disabled, .btn-info[disabled], fieldset[disabled] .btn-info, .btn-info.disabled:hover, .btn-info[disabled]:hover, fieldset[disabled] .btn-info:hover, .btn-info.disabled:focus, .btn-info[disabled]:focus, fieldset[disabled] .btn-info:focus, .btn-info.disabled:active, .btn-info[disabled]:active, fieldset[disabled] .btn-info:active, .btn-info.disabled.active, .btn-info[disabled].active, fieldset[disabled] .btn-info.active { background-color: #5bc0de; border-color: #46b8da; } .btn-link { color: #428bca; font-weight: normal; cursor: pointer; } .btn-link, .btn-link:active, .btn-link[disabled], fieldset[disabled] .btn-link { background-color: transparent; -webkit-box-shadow: none; box-shadow: none; } .btn-link, .btn-link:hover, .btn-link:focus, .btn-link:active { border-color: transparent; } .btn-link:hover, .btn-link:focus { color: #2a6496; text-decoration: underline; background-color: transparent; } .btn-link[disabled]:hover, fieldset[disabled] .btn-link:hover, .btn-link[disabled]:focus, fieldset[disabled] .btn-link:focus { color: #999999; text-decoration: none; } .btn-lg { padding: 10px 16px; font-size: 18px; line-height: 1.33; } .btn-sm, .btn-xs { padding: 5px 10px; font-size: 12px; line-height: 1.5; } .btn-xs { padding: 1px 5px; } .btn-block { display: block; width: 100%; padding-left: 0; padding-right: 0; } .btn-block + .btn-block { margin-top: 5px; } input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="button"].btn-block { width: 100%; } @font-face { font-family: 'Glyphicons Halflings'; src: url("glyphicons-halflings-regular.eot"); src: url("glyphicons-halflings-regular.eot?#iefix") format("embedded-opentype"), url("glyphicons-halflings-regular.woff") format("woff"), url("glyphicons-halflings-regular.ttf") format("truetype"), url("glyphicons-halflings-regular.svg#glyphicons-halflingsregular") format("svg"); } .glyphicon { position: relative; top: 1px; display: inline-block; font-family: 'Glyphicons Halflings'; font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; } .glyphicon-asterisk:before { content: "\2a"; } .glyphicon-plus:before { content: "\2b"; } .glyphicon-euro:before { content: "\20ac"; } .glyphicon-minus:before { content: "\2212"; } .glyphicon-cloud:before { content: "\2601"; } .glyphicon-envelope:before { content: "\2709"; } .glyphicon-pencil:before { content: "\270f"; } .glyphicon-glass:before { content: "\e001"; } .glyphicon-music:before { content: "\e002"; } .glyphicon-search:before { content: "\e003"; } .glyphicon-heart:before { content: "\e005"; } .glyphicon-star:before { content: "\e006"; } .glyphicon-star-empty:before { content: "\e007"; } .glyphicon-user:before { content: "\e008"; } .glyphicon-film:before { content: "\e009"; } .glyphicon-th-large:before { content: "\e010"; } .glyphicon-th:before { content: "\e011"; } .glyphicon-th-list:before { content: "\e012"; } .glyphicon-ok:before { content: "\e013"; } .glyphicon-remove:before { content: "\e014"; } .glyphicon-zoom-in:before { content: "\e015"; } .glyphicon-zoom-out:before { content: "\e016"; } .glyphicon-off:before { content: "\e017"; } .glyphicon-signal:before { content: "\e018"; } .glyphicon-cog:before { content: "\e019"; } .glyphicon-trash:before { content: "\e020"; } .glyphicon-home:before { content: "\e021"; } .glyphicon-file:before { content: "\e022"; } .glyphicon-time:before { content: "\e023"; } .glyphicon-road:before { content: "\e024"; } .glyphicon-download-alt:before { content: "\e025"; } .glyphicon-download:before { content: "\e026"; } .glyphicon-upload:before { content: "\e027"; } .glyphicon-inbox:before { content: "\e028"; } .glyphicon-play-circle:before { content: "\e029"; } .glyphicon-repeat:before { content: "\e030"; } .glyphicon-refresh:before { content: "\e031"; } .glyphicon-list-alt:before { content: "\e032"; } .glyphicon-flag:before { content: "\e034"; } .glyphicon-headphones:before { content: "\e035"; } .glyphicon-volume-off:before { content: "\e036"; } .glyphicon-volume-down:before { content: "\e037"; } .glyphicon-volume-up:before { content: "\e038"; } .glyphicon-qrcode:before { content: "\e039"; } .glyphicon-barcode:before { content: "\e040"; } .glyphicon-tag:before { content: "\e041"; } .glyphicon-tags:before { content: "\e042"; } .glyphicon-book:before { content: "\e043"; } .glyphicon-print:before { content: "\e045"; } .glyphicon-font:before { content: "\e047"; } .glyphicon-bold:before { content: "\e048"; } .glyphicon-italic:before { content: "\e049"; } .glyphicon-text-height:before { content: "\e050"; } .glyphicon-text-width:before { content: "\e051"; } .glyphicon-align-left:before { content: "\e052"; } .glyphicon-align-center:before { content: "\e053"; } .glyphicon-align-right:before { content: "\e054"; } .glyphicon-align-justify:before { content: "\e055"; } .glyphicon-list:before { content: "\e056"; } .glyphicon-indent-left:before { content: "\e057"; } .glyphicon-indent-right:before { content: "\e058"; } .glyphicon-facetime-video:before { content: "\e059"; } .glyphicon-picture:before { content: "\e060"; } .glyphicon-map-marker:before { content: "\e062"; } .glyphicon-adjust:before { content: "\e063"; } .glyphicon-tint:before { content: "\e064"; } .glyphicon-edit:before { content: "\e065"; } .glyphicon-share:before { content: "\e066"; } .glyphicon-check:before { content: "\e067"; } .glyphicon-move:before { content: "\e068"; } .glyphicon-step-backward:before { content: "\e069"; } .glyphicon-fast-backward:before { content: "\e070"; } .glyphicon-backward:before { content: "\e071"; } .glyphicon-play:before { content: "\e072"; } .glyphicon-pause:before { content: "\e073"; } .glyphicon-stop:before { content: "\e074"; } .glyphicon-forward:before { content: "\e075"; } .glyphicon-fast-forward:before { content: "\e076"; } .glyphicon-step-forward:before { content: "\e077"; } .glyphicon-eject:before { content: "\e078"; } .glyphicon-chevron-left:before { content: "\e079"; } .glyphicon-chevron-right:before { content: "\e080"; } .glyphicon-plus-sign:before { content: "\e081"; } .glyphicon-minus-sign:before { content: "\e082"; } .glyphicon-remove-sign:before { content: "\e083"; } .glyphicon-ok-sign:before { content: "\e084"; } .glyphicon-question-sign:before { content: "\e085"; } .glyphicon-info-sign:before { content: "\e086"; } .glyphicon-screenshot:before { content: "\e087"; } .glyphicon-remove-circle:before { content: "\e088"; } .glyphicon-ok-circle:before { content: "\e089"; } .glyphicon-ban-circle:before { content: "\e090"; } .glyphicon-arrow-left:before { content: "\e091"; } .glyphicon-arrow-right:before { content: "\e092"; } .glyphicon-arrow-up:before { content: "\e093"; } .glyphicon-arrow-down:before { content: "\e094"; } .glyphicon-share-alt:before { content: "\e095"; } .glyphicon-resize-full:before { content: "\e096"; } .glyphicon-resize-small:before { content: "\e097"; } .glyphicon-exclamation-sign:before { content: "\e101"; } .glyphicon-gift:before { content: "\e102"; } .glyphicon-leaf:before { content: "\e103"; } .glyphicon-eye-open:before { content: "\e105"; } .glyphicon-eye-close:before { content: "\e106"; } .glyphicon-warning-sign:before { content: "\e107"; } .glyphicon-plane:before { content: "\e108"; } .glyphicon-random:before { content: "\e110"; } .glyphicon-comment:before { content: "\e111"; } .glyphicon-magnet:before { content: "\e112"; } .glyphicon-chevron-up:before { content: "\e113"; } .glyphicon-chevron-down:before { content: "\e114"; } .glyphicon-retweet:before { content: "\e115"; } .glyphicon-shopping-cart:before { content: "\e116"; } .glyphicon-folder-close:before { content: "\e117"; } .glyphicon-folder-open:before { content: "\e118"; } .glyphicon-resize-vertical:before { content: "\e119"; } .glyphicon-resize-horizontal:before { content: "\e120"; } .glyphicon-hdd:before { content: "\e121"; } .glyphicon-bullhorn:before { content: "\e122"; } .glyphicon-certificate:before { content: "\e124"; } .glyphicon-thumbs-up:before { content: "\e125"; } .glyphicon-thumbs-down:before { content: "\e126"; } .glyphicon-hand-right:before { content: "\e127"; } .glyphicon-hand-left:before { content: "\e128"; } .glyphicon-hand-up:before { content: "\e129"; } .glyphicon-hand-down:before { content: "\e130"; } .glyphicon-circle-arrow-right:before { content: "\e131"; } .glyphicon-circle-arrow-left:before { content: "\e132"; } .glyphicon-circle-arrow-up:before { content: "\e133"; } .glyphicon-circle-arrow-down:before { content: "\e134"; } .glyphicon-globe:before { content: "\e135"; } .glyphicon-tasks:before { content: "\e137"; } .glyphicon-filter:before { content: "\e138"; } .glyphicon-fullscreen:before { content: "\e140"; } .glyphicon-dashboard:before { content: "\e141"; } .glyphicon-heart-empty:before { content: "\e143"; } .glyphicon-link:before { content: "\e144"; } .glyphicon-phone:before { content: "\e145"; } .glyphicon-usd:before { content: "\e148"; } .glyphicon-gbp:before { content: "\e149"; } .glyphicon-sort:before { content: "\e150"; } .glyphicon-sort-by-alphabet:before { content: "\e151"; } .glyphicon-sort-by-alphabet-alt:before { content: "\e152"; } .glyphicon-sort-by-order:before { content: "\e153"; } .glyphicon-sort-by-order-alt:before { content: "\e154"; } .glyphicon-sort-by-attributes:before { content: "\e155"; } .glyphicon-sort-by-attributes-alt:before { content: "\e156"; } .glyphicon-unchecked:before { content: "\e157"; } .glyphicon-expand:before { content: "\e158"; } .glyphicon-collapse-down:before { content: "\e159"; } .glyphicon-collapse-up:before { content: "\e160"; } .glyphicon-log-in:before { content: "\e161"; } .glyphicon-flash:before { content: "\e162"; } .glyphicon-log-out:before { content: "\e163"; } .glyphicon-new-window:before { content: "\e164"; } .glyphicon-record:before { content: "\e165"; } .glyphicon-save:before { content: "\e166"; } .glyphicon-open:before { content: "\e167"; } .glyphicon-saved:before { content: "\e168"; } .glyphicon-import:before { content: "\e169"; } .glyphicon-export:before { content: "\e170"; } .glyphicon-send:before { content: "\e171"; } .glyphicon-floppy-disk:before { content: "\e172"; } .glyphicon-floppy-saved:before { content: "\e173"; } .glyphicon-floppy-remove:before { content: "\e174"; } .glyphicon-floppy-save:before { content: "\e175"; } .glyphicon-floppy-open:before { content: "\e176"; } .glyphicon-credit-card:before { content: "\e177"; } .glyphicon-transfer:before { content: "\e178"; } .glyphicon-cutlery:before { content: "\e179"; } .glyphicon-header:before { content: "\e180"; } .glyphicon-compressed:before { content: "\e181"; } .glyphicon-earphone:before { content: "\e182"; } .glyphicon-phone-alt:before { content: "\e183"; } .glyphicon-tower:before { content: "\e184"; } .glyphicon-stats:before { content: "\e185"; } .glyphicon-sd-video:before { content: "\e186"; } .glyphicon-hd-video:before { content: "\e187"; } .glyphicon-subtitles:before { content: "\e188"; } .glyphicon-sound-stereo:before { content: "\e189"; } .glyphicon-sound-dolby:before { content: "\e190"; } .glyphicon-sound-5-1:before { content: "\e191"; } .glyphicon-sound-6-1:before { content: "\e192"; } .glyphicon-sound-7-1:before { content: "\e193"; } .glyphicon-copyright-mark:before { content: "\e194"; } .glyphicon-registration-mark:before { content: "\e195"; } .glyphicon-cloud-download:before { content: "\e197"; } .glyphicon-cloud-upload:before { content: "\e198"; } .glyphicon-tree-conifer:before { content: "\e199"; } .glyphicon-tree-deciduous:before { content: "\e200"; } .glyphicon-briefcase:before { content: "\1f4bc"; } .glyphicon-calendar:before { content: "\1f4c5"; } .glyphicon-pushpin:before { content: "\1f4cc"; } .glyphicon-paperclip:before { content: "\1f4ce"; } .glyphicon-camera:before { content: "\1f4f7"; } .glyphicon-lock:before { content: "\1f512"; } .glyphicon-bell:before { content: "\1f514"; } .glyphicon-bookmark:before { content: "\1f516"; } .glyphicon-fire:before { content: "\1f525"; } .glyphicon-wrench:before { content: "\1f527"; } .btn-default .caret { border-top-color: #333333; } .btn-primary .caret, .btn-success .caret, .btn-warning .caret, .btn-danger .caret, .btn-info .caret { border-top-color: #fff; } .dropup .btn-default .caret { border-bottom-color: #333333; } .dropup .btn-primary .caret, .dropup .btn-success .caret, .dropup .btn-warning .caret, .dropup .btn-danger .caret, .dropup .btn-info .caret { border-bottom-color: #fff; } .btn-group, .btn-group-vertical { position: relative; display: inline-block; vertical-align: middle; } .btn-group > .btn, .btn-group-vertical > .btn { position: relative; float: left; } .btn-group > .btn:hover, .btn-group-vertical > .btn:hover, .btn-group > .btn:focus, .btn-group-vertical > .btn:focus, .btn-group > .btn:active, .btn-group-vertical > .btn:active, .btn-group > .btn.active, .btn-group-vertical > .btn.active { z-index: 2; } .btn-group > .btn:focus, .btn-group-vertical > .btn:focus { outline: none; } .btn-group .btn + .btn, .btn-group .btn + .btn-group, .btn-group .btn-group + .btn, .btn-group .btn-group + .btn-group { margin-left: -1px; } .btn-toolbar:before, .btn-toolbar:after { content: " "; display: table; } .btn-toolbar:after { clear: both; } .btn-toolbar:before, .btn-toolbar:after { content: " "; display: table; } .btn-toolbar:after { clear: both; } .btn-toolbar .btn-group { float: left; } .btn-toolbar > .btn + .btn, .btn-toolbar > .btn-group + .btn, .btn-toolbar > .btn + .btn-group, .btn-toolbar > .btn-group + .btn-group { margin-left: 5px; } .btn-group > .btn:first-child { margin-left: 0; } .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { border-bottom-right-radius: 0; border-top-right-radius: 0; } .btn-group > .btn:last-child:not(:first-child), .btn-group > .dropdown-toggle:not(:first-child) { border-bottom-left-radius: 0; border-top-left-radius: 0; } .btn-group > .btn-group { float: left; } .btn-group > .btn-group:first-child > .btn:last-child, .btn-group > .btn-group:first-child > .dropdown-toggle { border-bottom-right-radius: 0; border-top-right-radius: 0; } .btn-group > .btn-group:last-child > .btn:first-child { border-bottom-left-radius: 0; border-top-left-radius: 0; } .btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { outline: 0; } .btn-group-xs > .btn { padding: 5px 10px; font-size: 12px; line-height: 1.5; padding: 1px 5px; } .btn-group-sm > .btn { padding: 5px 10px; font-size: 12px; line-height: 1.5; } .btn-group-lg > .btn { padding: 10px 16px; font-size: 18px; line-height: 1.33; } .btn-group > .btn + .dropdown-toggle { padding-left: 8px; padding-right: 8px; } .btn-group > .btn-lg + .dropdown-toggle { padding-left: 12px; padding-right: 12px; } .btn-group.open .dropdown-toggle { -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } .btn .caret { margin-left: 0; } .btn-lg .caret { border-width: 5px 5px 0; border-bottom-width: 0; } .dropup .btn-lg .caret { border-width: 0 5px 5px; } .btn-group-vertical > .btn, .btn-group-vertical > .btn-group { display: block; float: none; width: 100%; max-width: 100%; } .btn-group-vertical > .btn-group:before, .btn-group-vertical > .btn-group:after { content: " "; display: table; } .btn-group-vertical > .btn-group:after { clear: both; } .btn-group-vertical > .btn-group:before, .btn-group-vertical > .btn-group:after { content: " "; display: table; } .btn-group-vertical > .btn-group:after { clear: both; } .btn-group-vertical > .btn-group > .btn { float: none; } .btn-group-vertical > .btn + .btn, .btn-group-vertical > .btn + .btn-group, .btn-group-vertical > .btn-group + .btn, .btn-group-vertical > .btn-group + .btn-group { margin-top: -1px; margin-left: 0; } .btn-group-vertical > .btn:first-child:not(:last-child) { border-top-right-radius: 4px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .btn-group-vertical > .btn:last-child:not(:first-child) { border-bottom-left-radius: 4px; border-top-right-radius: 0; border-top-left-radius: 0; } .btn-group-vertical > .btn-group:first-child > .btn:last-child, .btn-group-vertical > .btn-group:first-child > .dropdown-toggle { border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .btn-group-vertical > .btn-group:last-child > .btn:first-child { border-top-right-radius: 0; border-top-left-radius: 0; } .btn-group-justified { display: table; width: 100%; table-layout: fixed; border-collapse: separate; } .btn-group-justified .btn { float: none; display: table-cell; width: 1%; } [data-toggle="buttons"] > .btn > input[type="radio"], [data-toggle="buttons"] > .btn > input[type="checkbox"] { display: none; } .input-group { position: relative; display: table; border-collapse: separate; } .input-group.col { float: none; padding-left: 0; padding-right: 0; } .input-group .form-control { width: 100%; margin-bottom: 0; } .input-group-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn { height: 34px; padding: 0; font-size: 18px; line-height: 1.5; } select.input-group-lg > .form-control, select.input-group-lg > .input-group-addon, select.input-group-lg > .input-group-btn > .btn { height: 34px; line-height: 45px; } textarea.input-group-lg > .form-control, textarea.input-group-lg > .input-group-addon, textarea.input-group-lg > .input-group-btn > .btn { height: auto; } .input-group-sm > .form-control, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .btn { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; } select.input-group-sm > .form-control, select.input-group-sm > .input-group-addon, select.input-group-sm > .input-group-btn > .btn { height: 30px; line-height: 30px; } textarea.input-group-sm > .form-control, textarea.input-group-sm > .input-group-addon, textarea.input-group-sm > .input-group-btn > .btn { height: auto; } .input-group-addon, .input-group-btn, .input-group .form-control { display: table-cell; } .input-group-addon, .input-group-btn { width: 1%; white-space: nowrap; vertical-align: middle; } .input-group-addon { padding: 6px 12px; font-size: 14px; font-weight: normal; line-height: 1; text-align: center; background-color: #eeeeee; border: 1px solid #cccccc; } .input-group-addon.input-sm { padding: 5px 10px; font-size: 12px; } .input-group-addon.input-lg { padding: 10px 16px; font-size: 18px; } .input-group-addon input[type="radio"], .input-group-addon input[type="checkbox"] { margin-top: 0; } .input-group .form-control:first-child, .input-group-addon:first-child, .input-group-btn:first-child > .btn, .input-group-btn:first-child > .dropdown-toggle, .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) { border-bottom-right-radius: 0; border-top-right-radius: 0; } .input-group-addon:first-child { border-right: 0; } .input-group .form-control:last-child, .input-group-addon:last-child, .input-group-btn:last-child > .btn, .input-group-btn:last-child > .dropdown-toggle, .input-group-btn:first-child > .btn:not(:first-child) { border-bottom-left-radius: 0; border-top-left-radius: 0; } .input-group-addon:last-child { border-left: 0; } .input-group-btn { position: relative; white-space: nowrap; } .input-group-btn > .btn { position: relative; } .input-group-btn > .btn + .btn { margin-left: -4px; } .input-group-btn > .btn:hover, .input-group-btn > .btn:active { z-index: 2; } .nav { margin-bottom: 0; padding-left: 0; list-style: none; } .nav:before, .nav:after { content: " "; display: table; } .nav:after { clear: both; } .nav:before, .nav:after { content: " "; display: table; } .nav:after { clear: both; } .nav > li { position: relative; display: block; } .nav > li > a { position: relative; display: block; padding: 10px 15px; } .nav > li > a:hover, .nav > li > a:focus { text-decoration: none; background-color: #eeeeee; } .nav > li.disabled > a { color: #999999; } .nav > li.disabled > a:hover, .nav > li.disabled > a:focus { color: #999999; text-decoration: none; background-color: transparent; cursor: not-allowed; } .nav .open > a, .nav .open > a:hover, .nav .open > a:focus { background-color: #eeeeee; border-color: #428bca; } .nav .nav-divider { height: 1px; margin: 9px 0; overflow: hidden; background-color: #e5e5e5; } .nav > li > a > img { max-width: none; } .nav-tabs { border-bottom: 1px solid #dddddd; } .nav-tabs > li { float: left; margin-bottom: -1px; } .nav-tabs > li > a { margin-right: 2px; line-height: 1.428571429; border: 1px solid transparent; } .nav-tabs > li > a:hover { border-color: #eeeeee #eeeeee #dddddd; } .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { color: #555555; background-color: #ffffff; border: 1px solid #dddddd; border-bottom-color: transparent; cursor: default; } .nav-tabs.nav-justified { width: 100%; border-bottom: 0; } .nav-tabs.nav-justified > li { float: none; } .nav-tabs.nav-justified > li > a { text-align: center; } @media (min-width: 768px) { .nav-tabs.nav-justified > li { display: table-cell; width: 1%; } } .nav-tabs.nav-justified > li > a { border-bottom: 1px solid #dddddd; margin-right: 0; } .nav-tabs.nav-justified > .active > a { border-bottom-color: #ffffff; } .nav-pills > li { float: left; } .nav-pills > li + li { margin-left: 2px; } .nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus { color: #ffffff; background-color: #428bca; } .nav-stacked > li { float: none; } .nav-stacked > li + li { margin-top: 2px; margin-left: 0; } .nav-justified { width: 100%; } .nav-justified > li { float: none; } .nav-justified > li > a { text-align: center; } @media (min-width: 768px) { .nav-justified > li { display: table-cell; width: 1%; } } .nav-tabs-justified { border-bottom: 0; } .nav-tabs-justified > li > a { border-bottom: 1px solid #dddddd; margin-right: 0; } .nav-tabs-justified > .active > a { border-bottom-color: #ffffff; } .tabbable:before, .tabbable:after { content: " "; display: table; } .tabbable:after { clear: both; } .tabbable:before, .tabbable:after { content: " "; display: table; } .tabbable:after { clear: both; } .tab-content > .tab-pane, .pill-content > .pill-pane { display: none; } .tab-content > .active, .pill-content > .active { display: block; } .nav .caret { border-top-color: #428bca; border-bottom-color: #428bca; } .nav a:hover .caret { border-top-color: #2a6496; border-bottom-color: #2a6496; } .nav-tabs .dropdown-menu { margin-top: -1px; border-top-right-radius: 0; border-top-left-radius: 0; } .navbar { position: relative; z-index: 1000; min-height: 50px; margin-bottom: 20px; border: 1px solid transparent; } .navbar:before, .navbar:after { content: " "; display: table; } .navbar:after { clear: both; } .navbar:before, .navbar:after { content: " "; display: table; } .navbar:after { clear: both; } .navbar-header:before, .navbar-header:after { content: " "; display: table; } .navbar-header:after { clear: both; } .navbar-header:before, .navbar-header:after { content: " "; display: table; } .navbar-header:after { clear: both; } @media (min-width: 768px) { .navbar-header { float: left; } } .navbar-collapse { max-height: 340px; overflow-x: visible; padding-right: 15px; padding-left: 15px; border-top: 1px solid transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); -webkit-overflow-scrolling: touch; } .navbar-collapse:before, .navbar-collapse:after { content: " "; display: table; } .navbar-collapse:after { clear: both; } .navbar-collapse:before, .navbar-collapse:after { content: " "; display: table; } .navbar-collapse:after { clear: both; } .navbar-collapse.in { overflow-y: auto; } @media (min-width: 768px) { .navbar-collapse { width: auto; border-top: 0; box-shadow: none; } .navbar-collapse.collapse { display: block !important; height: auto !important; padding-bottom: 0; overflow: visible !important; } .navbar-collapse.in { overflow-y: visible; } .navbar-collapse .navbar-nav.navbar-left:first-child { margin-left: -15px; } .navbar-collapse .navbar-nav.navbar-right:last-child { margin-right: -15px; } .navbar-collapse .navbar-text:last-child { margin-right: 0; } } .container > .navbar-header, .container > .navbar-collapse { margin-right: -15px; margin-left: -15px; } @media (min-width: 768px) { .container > .navbar-header, .container > .navbar-collapse { margin-right: 0; margin-left: 0; } } .navbar-static-top { border-width: 0 0 1px; } .navbar-fixed-top, .navbar-fixed-bottom { position: fixed; right: 0; left: 0; border-width: 0 0 1px; } .navbar-fixed-top { z-index: 1030; top: 0; } .navbar-fixed-bottom { bottom: 0; margin-bottom: 0; } .navbar-brand { float: left; padding: 15px 15px; font-size: 18px; line-height: 20px; } .navbar-brand:hover, .navbar-brand:focus { text-decoration: none; } @media (min-width: 768px) { .navbar > .container .navbar-brand { margin-left: -15px; } } .navbar-toggle { position: relative; float: right; margin-right: 15px; padding: 9px 10px; margin-top: 8px; margin-bottom: 8px; background-color: transparent; border: 1px solid transparent; } .navbar-toggle .icon-bar { display: block; width: 22px; height: 2px; } .navbar-toggle .icon-bar + .icon-bar { margin-top: 4px; } @media (min-width: 768px) { .navbar-toggle { display: none; } } .navbar-nav { margin: 7.5px -15px; } .navbar-nav > li > a { padding-top: 10px; padding-bottom: 10px; line-height: 20px; } @media (max-width: 767px) { .navbar-nav .open .dropdown-menu { position: static; float: none; width: auto; margin-top: 0; background-color: transparent; border: 0; box-shadow: none; } .navbar-nav .open .dropdown-menu > li > a, .navbar-nav .open .dropdown-menu .dropdown-header { padding: 5px 15px 5px 25px; } .navbar-nav .open .dropdown-menu > li > a { line-height: 20px; } .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-nav .open .dropdown-menu > li > a:focus { background-image: none; } } @media (min-width: 768px) { .navbar-nav { float: left; margin: 0; } .navbar-nav > li { float: left; } .navbar-nav > li > a { padding-top: 15px; padding-bottom: 15px; } } @media (min-width: 768px) { .navbar-left { float: left !important; } .navbar-right { float: right !important; } } .navbar-form { margin-left: -15px; margin-right: -15px; padding: 10px 15px; border-top: 1px solid transparent; border-bottom: 1px solid transparent; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); margin-top: 8px; margin-bottom: 8px; } @media (min-width: 768px) { .navbar-form .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; } .navbar-form .form-control { display: inline-block; } .navbar-form .radio, .navbar-form .checkbox { display: inline-block; margin-top: 0; margin-bottom: 0; padding-left: 0; } .navbar-form .radio input[type="radio"], .navbar-form .checkbox input[type="checkbox"] { float: none; margin-left: 0; } } @media (max-width: 767px) { .navbar-form .form-group { margin-bottom: 5px; } } @media (min-width: 768px) { .navbar-form { width: auto; border: 0; margin-left: 0; margin-right: 0; padding-top: 0; padding-bottom: 0; -webkit-box-shadow: none; box-shadow: none; } } .navbar-nav > li > .dropdown-menu { margin-top: 0; border-top-right-radius: 0; border-top-left-radius: 0; } .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .navbar-nav.pull-right > li > .dropdown-menu, .navbar-nav > li > .dropdown-menu.pull-right { left: auto; right: 0; } .navbar-btn { margin-top: 8px; margin-bottom: 8px; } .navbar-text { float: left; margin-top: 15px; margin-bottom: 15px; } @media (min-width: 768px) { .navbar-text { margin-left: 15px; margin-right: 15px; } } .navbar-default { background-color: #f8f8f8; border-color: #e7e7e7; } .navbar-default .navbar-brand { color: #777777; } .navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus { color: #5e5e5e; background-color: transparent; } .navbar-default .navbar-text { color: #777777; } .navbar-default .navbar-nav > li > a { color: #777777; } .navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus { color: #333333; background-color: transparent; } .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus { color: #555555; background-color: #e7e7e7; } .navbar-default .navbar-nav > .disabled > a, .navbar-default .navbar-nav > .disabled > a:hover, .navbar-default .navbar-nav > .disabled > a:focus { color: #cccccc; background-color: transparent; } .navbar-default .navbar-toggle { border-color: #dddddd; } .navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus { background-color: #dddddd; } .navbar-default .navbar-toggle .icon-bar { background-color: #cccccc; } .navbar-default .navbar-collapse, .navbar-default .navbar-form { border-color: #e6e6e6; } .navbar-default .navbar-nav > .dropdown > a:hover .caret, .navbar-default .navbar-nav > .dropdown > a:focus .caret { border-top-color: #333333; border-bottom-color: #333333; } .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus { background-color: #e7e7e7; color: #555555; } .navbar-default .navbar-nav > .open > a .caret, .navbar-default .navbar-nav > .open > a:hover .caret, .navbar-default .navbar-nav > .open > a:focus .caret { border-top-color: #555555; border-bottom-color: #555555; } .navbar-default .navbar-nav > .dropdown > a .caret { border-top-color: #777777; border-bottom-color: #777777; } @media (max-width: 767px) { .navbar-default .navbar-nav .open .dropdown-menu > li > a { color: #777777; } .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { color: #333333; background-color: transparent; } .navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { color: #555555; background-color: #e7e7e7; } .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { color: #cccccc; background-color: transparent; } } .navbar-default .navbar-link { color: #777777; } .navbar-default .navbar-link:hover { color: #333333; } .navbar-inverse { background-color: #222222; border-color: #080808; } .navbar-inverse .navbar-brand { color: #999999; } .navbar-inverse .navbar-brand:hover, .navbar-inverse .navbar-brand:focus { color: #ffffff; background-color: transparent; } .navbar-inverse .navbar-text { color: #999999; } .navbar-inverse .navbar-nav > li > a { color: #999999; } .navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:focus { color: #ffffff; background-color: transparent; } .navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus { color: #ffffff; background-color: #080808; } .navbar-inverse .navbar-nav > .disabled > a, .navbar-inverse .navbar-nav > .disabled > a:hover, .navbar-inverse .navbar-nav > .disabled > a:focus { color: #444444; background-color: transparent; } .navbar-inverse .navbar-toggle { border-color: #333333; } .navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus { background-color: #333333; } .navbar-inverse .navbar-toggle .icon-bar { background-color: #ffffff; } .navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form { border-color: #101010; } .navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus { background-color: #080808; color: #ffffff; } .navbar-inverse .navbar-nav > .dropdown > a:hover .caret { border-top-color: #ffffff; border-bottom-color: #ffffff; } .navbar-inverse .navbar-nav > .dropdown > a .caret { border-top-color: #999999; border-bottom-color: #999999; } .navbar-inverse .navbar-nav > .open > a .caret, .navbar-inverse .navbar-nav > .open > a:hover .caret, .navbar-inverse .navbar-nav > .open > a:focus .caret { border-top-color: #ffffff; border-bottom-color: #ffffff; } @media (max-width: 767px) { .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { border-color: #080808; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { color: #999999; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { color: #ffffff; background-color: transparent; } .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { color: #ffffff; background-color: #080808; } .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { color: #444444; background-color: transparent; } } .navbar-inverse .navbar-link { color: #999999; } .navbar-inverse .navbar-link:hover { color: #ffffff; } .breadcrumb { padding: 8px 15px; margin-bottom: 20px; list-style: none; background-color: #f5f5f5; } .breadcrumb > li { display: inline-block; } .breadcrumb > li + li:before { content: "/\00a0"; padding: 0 5px; color: #cccccc; } .breadcrumb > .active { color: #999999; } .pagination { display: inline-block; padding-left: 0; margin: 20px 0; } .pagination > li { display: inline; } .pagination > li > a, .pagination > li > span { position: relative; float: left; padding: 6px 12px; line-height: 1.428571429; text-decoration: none; background-color: #ffffff; border: 1px solid #dddddd; margin-left: -1px; } .pagination > li:first-child > a, .pagination > li:first-child > span { margin-left: 0; border-bottom-left-radius: 4px; border-top-left-radius: 4px; } .pagination > li:last-child > a, .pagination > li:last-child > span { border-bottom-right-radius: 4px; border-top-right-radius: 4px; } .pagination > li > a:hover, .pagination > li > span:hover, .pagination > li > a:focus, .pagination > li > span:focus { background-color: #eeeeee; } .pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover, .pagination > .active > span:hover, .pagination > .active > a:focus, .pagination > .active > span:focus { z-index: 2; color: #ffffff; background-color: #428bca; border-color: #428bca; cursor: default; } .pagination > .disabled > span, .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus { color: #999999; background-color: #ffffff; border-color: #dddddd; cursor: not-allowed; } .pagination-lg > li > a, .pagination-lg > li > span { padding: 10px 16px; font-size: 18px; } .pagination-lg > li:first-child > a, .pagination-lg > li:first-child > span { border-bottom-left-radius: 6px; border-top-left-radius: 6px; } .pagination-lg > li:last-child > a, .pagination-lg > li:last-child > span { border-bottom-right-radius: 6px; border-top-right-radius: 6px; } .pagination-sm > li > a, .pagination-sm > li > span { padding: 5px 10px; font-size: 12px; } .pagination-sm > li:first-child > a, .pagination-sm > li:first-child > span { border-bottom-left-radius: 3px; border-top-left-radius: 3px; } .pagination-sm > li:last-child > a, .pagination-sm > li:last-child > span { border-bottom-right-radius: 3px; border-top-right-radius: 3px; } .pager { padding-left: 0; margin: 20px 0; list-style: none; text-align: center; } .pager:before, .pager:after { content: " "; display: table; } .pager:after { clear: both; } .pager:before, .pager:after { content: " "; display: table; } .pager:after { clear: both; } .pager li { display: inline; } .pager li > a, .pager li > span { display: inline-block; padding: 5px 14px; background-color: #ffffff; border: 1px solid #dddddd; } .pager li > a:hover, .pager li > a:focus { text-decoration: none; background-color: #eeeeee; } .pager .next > a, .pager .next > span { float: right; } .pager .previous > a, .pager .previous > span { float: left; } .pager .disabled > a, .pager .disabled > a:hover, .pager .disabled > a:focus, .pager .disabled > span { color: #999999; background-color: #ffffff; cursor: not-allowed; } .label { display: inline; padding: .2em .6em .3em; font-size: 75%; font-weight: bold; line-height: 1; color: #ffffff; text-align: center; white-space: nowrap; vertical-align: baseline; } .label[href]:hover, .label[href]:focus { color: #ffffff; text-decoration: none; cursor: pointer; } .label:empty { display: none; } .label-default { background-color: #999999; } .label-default[href]:hover, .label-default[href]:focus { background-color: #808080; } .label-primary { background-color: #428bca; } .label-primary[href]:hover, .label-primary[href]:focus { background-color: #3071a9; } .label-success { background-color: #5cb85c; } .label-success[href]:hover, .label-success[href]:focus { background-color: #449d44; } .label-info { background-color: #5bc0de; } .label-info[href]:hover, .label-info[href]:focus { background-color: #31b0d5; } .label-warning { background-color: #f0ad4e; } .label-warning[href]:hover, .label-warning[href]:focus { background-color: #ec971f; } .label-danger { background-color: #d9534f; } .label-danger[href]:hover, .label-danger[href]:focus { background-color: #c9302c; } .badge { display: inline-block; min-width: 10px; padding: 3px 7px; font-size: 12px; font-weight: bold; color: #ffffff; line-height: 1; vertical-align: baseline; white-space: nowrap; text-align: center; background-color: #999999; } .badge:empty { display: none; } a.badge:hover, a.badge:focus { color: #ffffff; text-decoration: none; cursor: pointer; } .btn .badge { position: relative; top: -1px; } a.list-group-item.active > .badge, .nav-pills > .active > a > .badge { color: #428bca; background-color: #ffffff; } .nav-pills > li > a > .badge { margin-left: 3px; } .jumbotron { padding: 30px; margin-bottom: 30px; font-size: 21px; font-weight: 200; line-height: 2.1428571435; color: inherit; background-color: #eeeeee; } .jumbotron h1 { line-height: 1; color: inherit; } .jumbotron p { line-height: 1.4; } @media screen and (min-width: 768px) { .jumbotron { padding-top: 48px; padding-bottom: 48px; } .container .jumbotron { padding-left: 60px; padding-right: 60px; } .jumbotron h1 { font-size: 63px; } } .thumbnail { padding: 4px; line-height: 1.428571429; background-color: #ffffff; border: 1px solid #dddddd; -webkit-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; display: inline-block; max-width: 100%; height: auto; display: block; } .thumbnail > img { display: block; max-width: 100%; height: auto; } a.thumbnail:hover, a.thumbnail:focus { border-color: #428bca; } .thumbnail > img { margin-left: auto; margin-right: auto; } .thumbnail .caption { padding: 9px; color: #333333; } .alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; } .alert h4 { margin-top: 0; color: inherit; } .alert .alert-link { font-weight: bold; } .alert > p, .alert > ul { margin-bottom: 0; } .alert > p + p { margin-top: 5px; } .alert-dismissable { padding-right: 35px; } .alert-dismissable .close { position: relative; top: -2px; right: -21px; color: inherit; } .alert-success { background-color: #dff0d8; border-color: #d6e9c6; color: #468847; } .alert-success hr { border-top-color: #c9e2b3; } .alert-success .alert-link { color: #356635; } .alert-info { background-color: #d9edf7; border-color: #bce8f1; color: #3a87ad; } .alert-info hr { border-top-color: #a6e1ec; } .alert-info .alert-link { color: #2d6987; } .alert-warning { background-color: #fcf8e3; border-color: #fbeed5; color: #c09853; } .alert-warning hr { border-top-color: #f8e5be; } .alert-warning .alert-link { color: #a47e3c; } .alert-danger { background-color: #f2dede; border-color: #eed3d7; color: #b94a48; } .alert-danger hr { border-top-color: #e6c1c7; } .alert-danger .alert-link { color: #953b39; } @-webkit-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @-moz-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @-o-keyframes progress-bar-stripes { from { background-position: 0 0; } to { background-position: 40px 0; } } @keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } .progress { overflow: hidden; height: 20px; margin-bottom: 20px; background-color: #f5f5f5; -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); } .progress-bar { float: left; width: 0%; height: 100%; font-size: 12px; color: #ffffff; text-align: center; background-color: #428bca; -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); -webkit-transition: width 0.6s ease; transition: width 0.6s ease; } .progress-striped .progress-bar { background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-size: 40px 40px; } .progress.active .progress-bar { -webkit-animation: progress-bar-stripes 2s linear infinite; -moz-animation: progress-bar-stripes 2s linear infinite; -ms-animation: progress-bar-stripes 2s linear infinite; -o-animation: progress-bar-stripes 2s linear infinite; animation: progress-bar-stripes 2s linear infinite; } .progress-bar-success { background-color: #5cb85c; } .progress-striped .progress-bar-success { background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-info { background-color: #5bc0de; } .progress-striped .progress-bar-info { background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-warning { background-color: #f0ad4e; } .progress-striped .progress-bar-warning { background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-danger { background-color: #d9534f; } .progress-striped .progress-bar-danger { background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .media, .media-body { overflow: hidden; zoom: 1; } .media, .media .media { margin-top: 15px; } .media:first-child { margin-top: 0; } .media-object { display: block; } .media-heading { margin: 0 0 5px; } .media > .pull-left { margin-right: 10px; } .media > .pull-right { margin-left: 10px; } .media-list { padding-left: 0; list-style: none; } .list-group { margin-bottom: 20px; padding-left: 0; } .list-group-item { position: relative; display: block; padding: 10px 15px; margin-bottom: -1px; background-color: #ffffff; border: 1px solid #dddddd; } .list-group-item:first-child { border-top-right-radius: 4px; border-top-left-radius: 4px; } .list-group-item:last-child { margin-bottom: 0; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; } .list-group-item > .badge { float: right; } .list-group-item > .badge + .badge { margin-right: 5px; } a.list-group-item { color: #555555; } a.list-group-item .list-group-item-heading { color: #333333; } a.list-group-item:hover, a.list-group-item:focus { text-decoration: none; background-color: #f5f5f5; } .list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus { z-index: 2; color: #ffffff; background-color: #428bca; border-color: #428bca; } .list-group-item.active .list-group-item-heading, .list-group-item.active:hover .list-group-item-heading, .list-group-item.active:focus .list-group-item-heading { color: inherit; } .list-group-item.active .list-group-item-text, .list-group-item.active:hover .list-group-item-text, .list-group-item.active:focus .list-group-item-text { color: #e1edf7; } .list-group-item-heading { margin-top: 0; margin-bottom: 5px; } .list-group-item-text { margin-bottom: 0; line-height: 1.3; } .panel { margin-bottom: 20px; background-color: #ffffff; border: 1px solid transparent; -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); } .panel-body { padding: 15px; } .panel-body:before, .panel-body:after { content: " "; display: table; } .panel-body:after { clear: both; } .panel-body:before, .panel-body:after { content: " "; display: table; } .panel-body:after { clear: both; } .panel > .list-group { margin-bottom: 0; } .panel > .list-group .list-group-item { border-width: 1px 0; } .panel > .list-group .list-group-item:first-child { border-top-right-radius: 0; border-top-left-radius: 0; } .panel > .list-group .list-group-item:last-child { border-bottom: 0; } .panel-heading + .list-group .list-group-item:first-child { border-top-width: 0; } .panel > .table { margin-bottom: 0; } .panel > .panel-body + .table { border-top: 1px solid #dddddd; } .panel-heading { padding: 10px 15px; border-bottom: 1px solid transparent; border-top-right-radius: 3px; border-top-left-radius: 3px; } .panel-title { margin-top: 0; margin-bottom: 0; font-size: 16px; } .panel-title > a { color: inherit; } .panel-footer { padding: 10px 15px; background-color: #f5f5f5; border-top: 1px solid #dddddd; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel-group .panel { margin-bottom: 0; overflow: hidden; } .panel-group .panel + .panel { margin-top: 5px; } .panel-group .panel-heading { border-bottom: 0; } .panel-group .panel-heading + .panel-collapse .panel-body { border-top: 1px solid #dddddd; } .panel-group .panel-footer { border-top: 0; } .panel-group .panel-footer + .panel-collapse .panel-body { border-bottom: 1px solid #dddddd; } .panel-default { border-color: #dddddd; } .panel-default > .panel-heading { color: #333333; background-color: #f5f5f5; border-color: #dddddd; } .panel-default > .panel-heading + .panel-collapse .panel-body { border-top-color: #dddddd; } .panel-default > .panel-footer + .panel-collapse .panel-body { border-bottom-color: #dddddd; } .panel-primary { border-color: #428bca; } .panel-primary > .panel-heading { color: #ffffff; background-color: #428bca; border-color: #428bca; } .panel-primary > .panel-heading + .panel-collapse .panel-body { border-top-color: #428bca; } .panel-primary > .panel-footer + .panel-collapse .panel-body { border-bottom-color: #428bca; } .panel-success { border-color: #d6e9c6; } .panel-success > .panel-heading { color: #468847; background-color: #dff0d8; border-color: #d6e9c6; } .panel-success > .panel-heading + .panel-collapse .panel-body { border-top-color: #d6e9c6; } .panel-success > .panel-footer + .panel-collapse .panel-body { border-bottom-color: #d6e9c6; } .panel-warning { border-color: #fbeed5; } .panel-warning > .panel-heading { color: #c09853; background-color: #fcf8e3; border-color: #fbeed5; } .panel-warning > .panel-heading + .panel-collapse .panel-body { border-top-color: #fbeed5; } .panel-warning > .panel-footer + .panel-collapse .panel-body { border-bottom-color: #fbeed5; } .panel-danger { border-color: #eed3d7; } .panel-danger > .panel-heading { color: #b94a48; background-color: #f2dede; border-color: #eed3d7; } .panel-danger > .panel-heading + .panel-collapse .panel-body { border-top-color: #eed3d7; } .panel-danger > .panel-footer + .panel-collapse .panel-body { border-bottom-color: #eed3d7; } .panel-info { border-color: #bce8f1; } .panel-info > .panel-heading { color: #3a87ad; background-color: #d9edf7; border-color: #bce8f1; } .panel-info > .panel-heading + .panel-collapse .panel-body { border-top-color: #bce8f1; } .panel-info > .panel-footer + .panel-collapse .panel-body { border-bottom-color: #bce8f1; } .well { min-height: 20px; padding: 19px; margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #e3e3e3; -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 blockquote { border-color: #ddd; border-color: rgba(0, 0, 0, 0.15); } .well-lg { padding: 24px; } .well-sm { padding: 9px; } .close { float: right; font-size: 21px; font-weight: bold; line-height: 1; color: #000000; text-shadow: 0 1px 0 #ffffff; opacity: 0.2; filter: alpha(opacity=20); } .close:hover, .close:focus { color: #000000; text-decoration: none; cursor: pointer; opacity: 0.5; filter: alpha(opacity=50); } button.close { padding: 0; cursor: pointer; background: transparent; border: 0; -webkit-appearance: none; } .caret { display: inline-block; width: 0; height: 0; margin-left: 2px; vertical-align: middle; border-top: 4px solid #000000; border-right: 4px solid transparent; border-left: 4px solid transparent; border-bottom: 0 dotted; content: ""; } .dropdown { position: relative; } .dropdown-toggle:focus { outline: 0; } .dropdown-menu { position: absolute; top: 100%; left: 0; z-index: 1000; display: none; float: left; min-width: 160px; padding: 5px 0; margin: 2px 0 0; list-style: none; font-size: 14px; background-color: #ffffff; border: 1px solid #cccccc; border: 1px solid rgba(0, 0, 0, 0.15); -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); background-clip: padding-box; } .dropdown-menu.pull-right { right: 0; left: auto; } .dropdown-menu .divider { height: 1px; margin: 9px 0; overflow: hidden; background-color: #e5e5e5; } .dropdown-menu > li > a { display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.428571429; color: #333333; white-space: nowrap; } .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { text-decoration: none; color: #ffffff; background-color: #428bca; } .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { color: #ffffff; text-decoration: none; outline: 0; background-color: #428bca; } .dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { color: #999999; } .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { text-decoration: none; background-color: transparent; background-image: none; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); cursor: not-allowed; } .open > .dropdown-menu { display: block; } .open > a { outline: 0; } .dropdown-header { display: block; padding: 3px 20px; font-size: 12px; line-height: 1.428571429; color: #999999; } .dropdown-backdrop { position: fixed; left: 0; right: 0; bottom: 0; top: 0; z-index: 990; } .pull-right > .dropdown-menu { right: 0; left: auto; } .dropup .caret, .navbar-fixed-bottom .dropdown .caret { border-top: 0 dotted; border-bottom: 4px solid #000000; content: ""; } .dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { top: auto; bottom: 100%; margin-bottom: 1px; } @media (min-width: 768px) { .navbar-right .dropdown-menu { right: 0; left: auto; } } .tooltip { position: absolute; z-index: 1030; display: block; visibility: visible; font-size: 12px; line-height: 1.4; opacity: 0; filter: alpha(opacity=0); } .tooltip.in { opacity: 0.9; filter: alpha(opacity=90); } .tooltip.top { margin-top: -3px; padding: 5px 0; } .tooltip.right { margin-left: 3px; padding: 0 5px; } .tooltip.bottom { margin-top: 3px; padding: 5px 0; } .tooltip.left { margin-left: -3px; padding: 0 5px; } .tooltip-inner { max-width: 200px; padding: 3px 8px; color: #ffffff; text-align: center; text-decoration: none; background-color: #000000; } .tooltip-arrow { position: absolute; width: 0; height: 0; border-color: transparent; border-style: solid; } .tooltip.top .tooltip-arrow { bottom: 0; left: 50%; margin-left: -5px; border-width: 5px 5px 0; border-top-color: #000000; } .tooltip.top-left .tooltip-arrow { bottom: 0; left: 5px; border-width: 5px 5px 0; border-top-color: #000000; } .tooltip.top-right .tooltip-arrow { bottom: 0; right: 5px; border-width: 5px 5px 0; border-top-color: #000000; } .tooltip.right .tooltip-arrow { top: 50%; left: 0; margin-top: -5px; border-width: 5px 5px 5px 0; border-right-color: #000000; } .tooltip.left .tooltip-arrow { top: 50%; right: 0; margin-top: -5px; border-width: 5px 0 5px 5px; border-left-color: #000000; } .tooltip.bottom .tooltip-arrow { top: 0; left: 50%; margin-left: -5px; border-width: 0 5px 5px; border-bottom-color: #000000; } .tooltip.bottom-left .tooltip-arrow { top: 0; left: 5px; border-width: 0 5px 5px; border-bottom-color: #000000; } .tooltip.bottom-right .tooltip-arrow { top: 0; right: 5px; border-width: 0 5px 5px; border-bottom-color: #000000; } .popover { position: absolute; top: 0; left: 0; z-index: 1010; display: none; max-width: 276px; padding: 1px; text-align: left; background-color: #ffffff; background-clip: padding-box; border: 1px solid #cccccc; border: 1px solid rgba(0, 0, 0, 0.2); -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); white-space: normal; } .popover.top { margin-top: -10px; } .popover.right { margin-left: 10px; } .popover.bottom { margin-top: 10px; } .popover.left { margin-left: -10px; } .popover-title { margin: 0; padding: 8px 14px; font-size: 14px; font-weight: normal; line-height: 18px; background-color: #f7f7f7; border-bottom: 1px solid #ebebeb; } .popover-content { padding: 9px 14px; } .popover .arrow, .popover .arrow:after { position: absolute; display: block; width: 0; height: 0; border-color: transparent; border-style: solid; } .popover .arrow { border-width: 11px; } .popover .arrow:after { border-width: 10px; content: ""; } .popover.top .arrow { left: 50%; margin-left: -11px; border-bottom-width: 0; border-top-color: #999999; border-top-color: rgba(0, 0, 0, 0.25); bottom: -11px; } .popover.top .arrow:after { content: " "; bottom: 1px; margin-left: -10px; border-bottom-width: 0; border-top-color: #ffffff; } .popover.right .arrow { top: 50%; left: -11px; margin-top: -11px; border-left-width: 0; border-right-color: #999999; border-right-color: rgba(0, 0, 0, 0.25); } .popover.right .arrow:after { content: " "; left: 1px; bottom: -10px; border-left-width: 0; border-right-color: #ffffff; } .popover.bottom .arrow { left: 50%; margin-left: -11px; border-top-width: 0; border-bottom-color: #999999; border-bottom-color: rgba(0, 0, 0, 0.25); top: -11px; } .popover.bottom .arrow:after { content: " "; top: 1px; margin-left: -10px; border-top-width: 0; border-bottom-color: #ffffff; } .popover.left .arrow { top: 50%; right: -11px; margin-top: -11px; border-right-width: 0; border-left-color: #999999; border-left-color: rgba(0, 0, 0, 0.25); } .popover.left .arrow:after { content: " "; right: 1px; border-right-width: 0; border-left-color: #ffffff; bottom: -10px; } .modal-open { overflow: hidden; } body.modal-open, .modal-open .navbar-fixed-top, .modal-open .navbar-fixed-bottom { margin-right: 15px; } .modal { display: none; overflow: auto; overflow-y: scroll; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; } .modal.fade .modal-dialog { -webkit-transform: translate(0, -25%); -ms-transform: translate(0, -25%); transform: translate(0, -25%); -webkit-transition: -webkit-transform 0.3s ease-out; -moz-transition: -moz-transform 0.3s ease-out; -o-transition: -o-transform 0.3s ease-out; transition: transform 0.3s ease-out; } .modal.in .modal-dialog { -webkit-transform: translate(0, 0); -ms-transform: translate(0, 0); transform: translate(0, 0); } .modal-dialog { margin-left: auto; margin-right: auto; width: auto; padding: 10px; z-index: 1050; } .modal-content { position: relative; background-color: #ffffff; border: 1px solid #999999; border: 1px solid rgba(0, 0, 0, 0.2); -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); background-clip: padding-box; outline: none; } .modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1030; background-color: #000000; } .modal-backdrop.fade { opacity: 0; filter: alpha(opacity=0); } .modal-backdrop.in { opacity: 0.5; filter: alpha(opacity=50); } .modal-header { padding: 15px; border-bottom: 1px solid #e5e5e5; min-height: 16.428571429px; } .modal-header .close { margin-top: -2px; } .modal-title { margin: 0; line-height: 1.428571429; } .modal-body { position: relative; padding: 20px; } .modal-footer { margin-top: 15px; padding: 19px 20px 20px; text-align: right; border-top: 1px solid #e5e5e5; } .modal-footer:before, .modal-footer:after { content: " "; display: table; } .modal-footer:after { clear: both; } .modal-footer:before, .modal-footer:after { content: " "; display: table; } .modal-footer:after { clear: both; } .modal-footer .btn + .btn { margin-left: 5px; margin-bottom: 0; } .modal-footer .btn-group .btn + .btn { margin-left: -1px; } .modal-footer .btn-block + .btn-block { margin-left: 0; } @media screen and (min-width: 768px) { .modal-dialog { left: 50%; right: auto; width: 600px; padding-top: 30px; padding-bottom: 30px; } .modal-content { -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); } } .carousel { position: relative; } .carousel-inner { position: relative; overflow: hidden; width: 100%; } .carousel-inner > .item { display: none; position: relative; -webkit-transition: 0.6s ease-in-out left; transition: 0.6s ease-in-out left; } .carousel-inner > .item > img, .carousel-inner > .item > a > img { display: block; max-width: 100%; height: auto; line-height: 1; } .carousel-inner > .active, .carousel-inner > .next, .carousel-inner > .prev { display: block; } .carousel-inner > .active { left: 0; } .carousel-inner > .next, .carousel-inner > .prev { position: absolute; top: 0; width: 100%; } .carousel-inner > .next { left: 100%; } .carousel-inner > .prev { left: -100%; } .carousel-inner > .next.left, .carousel-inner > .prev.right { left: 0; } .carousel-inner > .active.left { left: -100%; } .carousel-inner > .active.right { left: 100%; } .carousel-control { position: absolute; top: 0; left: 0; bottom: 0; width: 15%; opacity: 0.5; filter: alpha(opacity=50); font-size: 20px; color: #ffffff; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); } .carousel-control.left { background-image: -webkit-gradient(linear, 0% top, 100% top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.0001))); background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.5) 0%), color-stop(rgba(0, 0, 0, 0.0001) 100%)); background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); } .carousel-control.right { left: auto; right: 0; background-image: -webkit-gradient(linear, 0% top, 100% top, from(rgba(0, 0, 0, 0.0001)), to(rgba(0, 0, 0, 0.5))); background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.0001) 0%), color-stop(rgba(0, 0, 0, 0.5) 100%)); background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); } .carousel-control:hover, .carousel-control:focus { color: #ffffff; text-decoration: none; opacity: 0.9; filter: alpha(opacity=90); } .carousel-control .icon-prev, .carousel-control .icon-next, .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right { position: absolute; top: 50%; left: 50%; z-index: 5; display: inline-block; } .carousel-control .icon-prev, .carousel-control .icon-next { width: 20px; height: 20px; margin-top: -10px; margin-left: -10px; font-family: serif; } .carousel-control .icon-prev:before { content: '\2039'; } .carousel-control .icon-next:before { content: '\203a'; } .carousel-indicators { position: absolute; bottom: 10px; left: 50%; z-index: 15; width: 60%; margin-left: -30%; padding-left: 0; list-style: none; text-align: center; } .carousel-indicators li { display: inline-block; width: 10px; height: 10px; margin: 1px; text-indent: -999px; border: 1px solid #ffffff; cursor: pointer; } .carousel-indicators .active { margin: 0; width: 12px; height: 12px; background-color: #ffffff; } .carousel-caption { position: absolute; left: 15%; right: 15%; bottom: 20px; z-index: 10; padding-top: 20px; padding-bottom: 20px; color: #ffffff; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); } .carousel-caption .btn { text-shadow: none; } @media screen and (min-width: 768px) { .carousel-control .icon-prev, .carousel-control .icon-next { width: 30px; height: 30px; margin-top: -15px; margin-left: -15px; font-size: 30px; } .carousel-caption { left: 20%; right: 20%; padding-bottom: 30px; } .carousel-indicators { bottom: 20px; } } .clearfix:before, .clearfix:after { content: " "; display: table; } .clearfix:after { clear: both; } .pull-right { float: right !important; } .pull-left { float: left !important; } .hide { display: none !important; } .show { display: block !important; } .invisible { visibility: hidden; } .text-hide { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0; } .affix { position: fixed; } @-ms-viewport { width: device-width; } @media screen and (max-width: 400px) { @-ms-viewport { width: 320px; } } .hidden { display: none !important; visibility: hidden !important; } .visible-xs { display: none !important; } tr.visible-xs { display: none !important; } th.visible-xs, td.visible-xs { display: none !important; } @media (max-width: 767px) { .visible-xs { display: block !important; } tr.visible-xs { display: table-row !important; } th.visible-xs, td.visible-xs { display: table-cell !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-xs.visible-sm { display: block !important; } tr.visible-xs.visible-sm { display: table-row !important; } th.visible-xs.visible-sm, td.visible-xs.visible-sm { display: table-cell !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-xs.visible-md { display: block !important; } tr.visible-xs.visible-md { display: table-row !important; } th.visible-xs.visible-md, td.visible-xs.visible-md { display: table-cell !important; } } @media (min-width: 1200px) { .visible-xs.visible-lg { display: block !important; } tr.visible-xs.visible-lg { display: table-row !important; } th.visible-xs.visible-lg, td.visible-xs.visible-lg { display: table-cell !important; } } .visible-sm { display: none !important; } tr.visible-sm { display: none !important; } th.visible-sm, td.visible-sm { display: none !important; } @media (max-width: 767px) { .visible-sm.visible-xs { display: block !important; } tr.visible-sm.visible-xs { display: table-row !important; } th.visible-sm.visible-xs, td.visible-sm.visible-xs { display: table-cell !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm { display: block !important; } tr.visible-sm { display: table-row !important; } th.visible-sm, td.visible-sm { display: table-cell !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-sm.visible-md { display: block !important; } tr.visible-sm.visible-md { display: table-row !important; } th.visible-sm.visible-md, td.visible-sm.visible-md { display: table-cell !important; } } @media (min-width: 1200px) { .visible-sm.visible-lg { display: block !important; } tr.visible-sm.visible-lg { display: table-row !important; } th.visible-sm.visible-lg, td.visible-sm.visible-lg { display: table-cell !important; } } .visible-md { display: none !important; } tr.visible-md { display: none !important; } th.visible-md, td.visible-md { display: none !important; } @media (max-width: 767px) { .visible-md.visible-xs { display: block !important; } tr.visible-md.visible-xs { display: table-row !important; } th.visible-md.visible-xs, td.visible-md.visible-xs { display: table-cell !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-md.visible-sm { display: block !important; } tr.visible-md.visible-sm { display: table-row !important; } th.visible-md.visible-sm, td.visible-md.visible-sm { display: table-cell !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md { display: block !important; } tr.visible-md { display: table-row !important; } th.visible-md, td.visible-md { display: table-cell !important; } } @media (min-width: 1200px) { .visible-md.visible-lg { display: block !important; } tr.visible-md.visible-lg { display: table-row !important; } th.visible-md.visible-lg, td.visible-md.visible-lg { display: table-cell !important; } } .visible-lg { display: none !important; } tr.visible-lg { display: none !important; } th.visible-lg, td.visible-lg { display: none !important; } @media (max-width: 767px) { .visible-lg.visible-xs { display: block !important; } tr.visible-lg.visible-xs { display: table-row !important; } th.visible-lg.visible-xs, td.visible-lg.visible-xs { display: table-cell !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-lg.visible-sm { display: block !important; } tr.visible-lg.visible-sm { display: table-row !important; } th.visible-lg.visible-sm, td.visible-lg.visible-sm { display: table-cell !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-lg.visible-md { display: block !important; } tr.visible-lg.visible-md { display: table-row !important; } th.visible-lg.visible-md, td.visible-lg.visible-md { display: table-cell !important; } } @media (min-width: 1200px) { .visible-lg { display: block !important; } tr.visible-lg { display: table-row !important; } th.visible-lg, td.visible-lg { display: table-cell !important; } } .hidden-xs { display: block !important; } tr.hidden-xs { display: table-row !important; } th.hidden-xs, td.hidden-xs { display: table-cell !important; } @media (max-width: 767px) { .hidden-xs { display: none !important; } tr.hidden-xs { display: none !important; } th.hidden-xs, td.hidden-xs { display: none !important; } } @media (min-width: 768px) and (max-width: 991px) { .hidden-xs.hidden-sm { display: none !important; } tr.hidden-xs.hidden-sm { display: none !important; } th.hidden-xs.hidden-sm, td.hidden-xs.hidden-sm { display: none !important; } } @media (min-width: 992px) and (max-width: 1199px) { .hidden-xs.hidden-md { display: none !important; } tr.hidden-xs.hidden-md { display: none !important; } th.hidden-xs.hidden-md, td.hidden-xs.hidden-md { display: none !important; } } @media (min-width: 1200px) { .hidden-xs.hidden-lg { display: none !important; } tr.hidden-xs.hidden-lg { display: none !important; } th.hidden-xs.hidden-lg, td.hidden-xs.hidden-lg { display: none !important; } } .hidden-sm { display: block !important; } tr.hidden-sm { display: table-row !important; } th.hidden-sm, td.hidden-sm { display: table-cell !important; } @media (max-width: 767px) { .hidden-sm.hidden-xs { display: none !important; } tr.hidden-sm.hidden-xs { display: none !important; } th.hidden-sm.hidden-xs, td.hidden-sm.hidden-xs { display: none !important; } } @media (min-width: 768px) and (max-width: 991px) { .hidden-sm { display: none !important; } tr.hidden-sm { display: none !important; } th.hidden-sm, td.hidden-sm { display: none !important; } } @media (min-width: 992px) and (max-width: 1199px) { .hidden-sm.hidden-md { display: none !important; } tr.hidden-sm.hidden-md { display: none !important; } th.hidden-sm.hidden-md, td.hidden-sm.hidden-md { display: none !important; } } @media (min-width: 1200px) { .hidden-sm.hidden-lg { display: none !important; } tr.hidden-sm.hidden-lg { display: none !important; } th.hidden-sm.hidden-lg, td.hidden-sm.hidden-lg { display: none !important; } } .hidden-md { display: block !important; } tr.hidden-md { display: table-row !important; } th.hidden-md, td.hidden-md { display: table-cell !important; } @media (max-width: 767px) { .hidden-md.hidden-xs { display: none !important; } tr.hidden-md.hidden-xs { display: none !important; } th.hidden-md.hidden-xs, td.hidden-md.hidden-xs { display: none !important; } } @media (min-width: 768px) and (max-width: 991px) { .hidden-md.hidden-sm { display: none !important; } tr.hidden-md.hidden-sm { display: none !important; } th.hidden-md.hidden-sm, td.hidden-md.hidden-sm { display: none !important; } } @media (min-width: 992px) and (max-width: 1199px) { .hidden-md { display: none !important; } tr.hidden-md { display: none !important; } th.hidden-md, td.hidden-md { display: none !important; } } @media (min-width: 1200px) { .hidden-md.hidden-lg { display: none !important; } tr.hidden-md.hidden-lg { display: none !important; } th.hidden-md.hidden-lg, td.hidden-md.hidden-lg { display: none !important; } } .hidden-lg { display: block !important; } tr.hidden-lg { display: table-row !important; } th.hidden-lg, td.hidden-lg { display: table-cell !important; } @media (max-width: 767px) { .hidden-lg.hidden-xs { display: none !important; } tr.hidden-lg.hidden-xs { display: none !important; } th.hidden-lg.hidden-xs, td.hidden-lg.hidden-xs { display: none !important; } } @media (min-width: 768px) and (max-width: 991px) { .hidden-lg.hidden-sm { display: none !important; } tr.hidden-lg.hidden-sm { display: none !important; } th.hidden-lg.hidden-sm, td.hidden-lg.hidden-sm { display: none !important; } } @media (min-width: 992px) and (max-width: 1199px) { .hidden-lg.hidden-md { display: none !important; } tr.hidden-lg.hidden-md { display: none !important; } th.hidden-lg.hidden-md, td.hidden-lg.hidden-md { display: none !important; } } @media (min-width: 1200px) { .hidden-lg { display: none !important; } tr.hidden-lg { display: none !important; } th.hidden-lg, td.hidden-lg { display: none !important; } } .visible-print { display: none !important; } tr.visible-print { display: none !important; } th.visible-print, td.visible-print { display: none !important; } @media print { .visible-print { display: block !important; } tr.visible-print { display: table-row !important; } th.visible-print, td.visible-print { display: table-cell !important; } .hidden-print { display: none !important; } tr.hidden-print { display: none !important; } th.hidden-print, td.hidden-print { display: none !important; } } .fade { opacity: 0; -webkit-transition: opacity 0.15s linear; transition: opacity 0.15s linear; } .fade.in { opacity: 1; } .collapse { display: none; } .collapse.in { display: block; } .collapsing { position: relative; height: 0; overflow: hidden; -webkit-transition: height 0.35s ease; transition: height 0.35s ease; } /* @group Base */ .chosen-container { position: relative; display: block; vertical-align: middle; font-size: 13px; zoom: 1; *display: inline; -webkit-user-select: none; -moz-user-select: none; user-select: none; } .chosen-container .chosen-drop { position: absolute; top: 100%; left: -9999px; z-index: 1010; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; width: 100%; border: 1px solid #aaa; border-top: 0; background: #fff; box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15); } .chosen-container.chosen-with-drop .chosen-drop { left: 0; } .chosen-container a { cursor: pointer; } /* @end */ /* @group Single Chosen */ .chosen-container-single .chosen-single { position: relative; display: block; overflow: hidden; padding: 0 0 0 8px; height: 23px; border: 1px solid #aaa; border-radius: 5px; background-color: #fff; background-clip: padding-box; box-shadow: 0 0 3px white inset, 0 1px 1px rgba(0, 0, 0, 0.1); color: #444; text-decoration: none; white-space: nowrap; line-height: 24px; } .chosen-container-single .chosen-default { color: #999; } .chosen-container-single .chosen-single span { display: block; overflow: hidden; margin-right: 26px; text-overflow: ellipsis; white-space: nowrap; } .chosen-container-single .chosen-single-with-deselect span { margin-right: 38px; } .chosen-container-single .chosen-single abbr { position: absolute; top: 6px; right: 26px; display: block; width: 12px; height: 12px; background: url("chosen-sprite.png") -42px 1px no-repeat; font-size: 1px; } .chosen-container-single .chosen-single abbr:hover { background-position: -42px -10px; } .chosen-container-single.chosen-disabled .chosen-single abbr:hover { background-position: -42px -10px; } .chosen-container-single .chosen-single div { position: absolute; top: 0; right: 0; display: block; width: 18px; height: 100%; } .chosen-container-single .chosen-single div b { display: block; width: 100%; height: 100%; background: url("chosen-sprite.png") no-repeat 0px 2px; } .chosen-container-single .chosen-search { position: relative; z-index: 1010; margin: 0; padding: 3px 4px; white-space: nowrap; } .chosen-container-single .chosen-drop { margin-top: -1px; border-radius: 0 0 4px 4px; background-clip: padding-box; } .chosen-container-single.chosen-container-single-nosearch .chosen-search { position: absolute; left: -9999px; } /* @end */ /* @group Results */ .chosen-container .chosen-results { position: relative; overflow-x: hidden; overflow-y: auto; margin: 0 4px 4px 0; padding: 0 0 0 4px; max-height: 240px; -webkit-overflow-scrolling: touch; } .chosen-container .chosen-results li { display: none; margin: 0; padding: 5px 6px; list-style: none; line-height: 15px; } .chosen-container .chosen-results li.active-result { display: list-item; cursor: pointer; } .chosen-container .chosen-results li.disabled-result { display: list-item; color: #ccc; cursor: default; } .chosen-container .chosen-results li.highlighted { background-color: #3875d7; color: #fff; } .chosen-container .chosen-results li.no-results { display: list-item; background: #f4f4f4; } .chosen-container .chosen-results li.group-result { display: list-item; font-weight: bold; cursor: default; } .chosen-container .chosen-results li.group-option { padding-left: 15px; } .chosen-container .chosen-results li em { font-style: normal; text-decoration: underline; } /* @end */ /* @group Multi Chosen */ .chosen-container-multi .chosen-choices { position: relative; overflow: hidden; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; margin: 0; padding: 0; width: 100%; height: auto !important; height: 1%; border: 1px solid #aaa; background-color: #fff; cursor: text; padding: 1px 0 0; font-size: 1em; line-height: 1.428571429; color: #555555; vertical-align: middle; background-color: white; border: 1px solid #cccccc; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -webkit-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; } .chosen-container-multi .chosen-choices li { float: left; list-style: none; } .chosen-container-multi .chosen-choices li.search-field { margin: 0; padding: 0; white-space: nowrap; } .chosen-container-multi .chosen-choices li.search-field input[type="text"] { margin: 1px 0; padding: 5px; outline: 0; border: 0 !important; background: transparent !important; box-shadow: none; color: #666; font-size: 100%; font-family: sans-serif; line-height: 1.5; border-radius: 0; } .chosen-container-multi .chosen-choices li.search-field .default { color: #999; } .chosen-container-multi .chosen-choices li.search-choice { position: relative; margin: 3px 0 3px 5px; padding: 7px 20px 7px 9px; border: 0; border-radius: 0; background-color: #e4e4e4; background-clip: padding-box; box-shadow: none; color: #333333; line-height: 13px; cursor: default; } .chosen-container-multi .chosen-choices li.search-choice .search-choice-close { position: absolute; top: 8px; right: 3px; display: block; width: 12px; height: 12px; background: url("chosen-sprite.png") -42px 1px no-repeat; font-size: 1px; } .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover { background-position: -42px -10px; } .chosen-container-multi .chosen-choices li.search-choice-disabled { padding-right: 5px; border: 1px solid #ccc; background-color: #e4e4e4; color: #666; } .chosen-container-multi .chosen-results { margin: 0; padding: 0; } .chosen-container-multi .chosen-drop .result-selected { display: list-item; color: #ccc; cursor: default; } /* @end */ /* @group Disabled Support */ .chosen-disabled { opacity: 0.5 !important; cursor: default; } .chosen-disabled .chosen-single { cursor: default; } .chosen-disabled .chosen-choices .search-choice .search-choice-close { cursor: default; } /* @end */ /* @group Right to Left */ .chosen-rtl { text-align: right; } .chosen-rtl .chosen-single { overflow: visible; padding: 0 8px 0 0; } .chosen-rtl .chosen-single span { margin-right: 0; margin-left: 26px; direction: rtl; } .chosen-rtl .chosen-single-with-deselect span { margin-left: 38px; } .chosen-rtl .chosen-single div { right: auto; left: 3px; } .chosen-rtl .chosen-single abbr { right: auto; left: 26px; } .chosen-rtl .chosen-choices li { float: right; } .chosen-rtl .chosen-choices li.search-field input[type="text"] { direction: rtl; } .chosen-rtl .chosen-choices li.search-choice { margin: 3px 5px 3px 0; padding: 3px 5px 3px 19px; } .chosen-rtl .chosen-choices li.search-choice .search-choice-close { right: auto; left: 4px; } .chosen-rtl.chosen-container-single-nosearch .chosen-search, .chosen-rtl .chosen-drop { left: 9999px; } .chosen-rtl.chosen-container-single .chosen-results { margin: 0 0 4px 4px; padding: 0 4px 0 0; } .chosen-rtl .chosen-results li.group-option { padding-right: 15px; padding-left: 0; } .chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div { border-right: none; } .chosen-rtl .chosen-search input[type="text"] { padding: 4px 5px 4px 20px; background: white url("chosen-sprite.png") no-repeat -30px -20px; background: url("chosen-sprite.png") no-repeat -30px -20px; direction: rtl; } .chosen-rtl.chosen-container-single .chosen-single div b { background-position: 6px 2px; } .chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b { background-position: -12px 2px; } /* @end */ /* @group Retina compatibility */ @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) { .chosen-rtl .chosen-search input[type="text"], .chosen-container-single .chosen-single abbr, .chosen-container-single .chosen-single div b, .chosen-container-single .chosen-search input[type="text"], .chosen-container-multi .chosen-choices .search-choice .search-choice-close, .chosen-container .chosen-results-scroll-down span, .chosen-container .chosen-results-scroll-up span { background-image: url("chosen-sprite@2x.png") !important; background-size: 52px 37px !important; background-repeat: no-repeat !important; } } /* @end */ /** **/ .element-invisible { display: none; } .element-hidden { visibility: hidden; } body.modal-open { background-color: #fcfcfc; color: #333333; margin: 0 auto 60px; } .site-content { margin: 0; padding: 0; } .site-content .row { margin-left: 0; margin-right: 0; } .sidebar { background-color: #212729; border-right: 8px solid #171d1f; height: 100%; min-height: 100%; height: auto; position: fixed; z-index: 9; } .hidden-sidebar .sidebar { left: -999999px; } .visible-sidebar .sidebar { left: 0; } .page-content { margin-left: 25%; position: relative; } .hidden-sidebar .page-content { margin-left: 0; width: 100%; } .page-content > header { background-color: #fcfcfc; background-color: rgba(252, 252, 252, 0.95); margin-left: -15px; margin-right: -15px; position: fixed; width: 100%; z-index: 9; } .page-content > .inner { margin: 0 auto; max-width: 75%; padding-top: 96px; } .page-content > .inner.wide { max-width: 95%; } /** * Messages */ .alert { font-size: 14px; } .alert-error { background-color: #f2dede; border-color: #eed3d7; color: #b94a48; } .alert-error hr { border-top-color: #e6c1c7; } .alert-error .alert-link { color: #953b39; } /** * Icons */ .glyphicon { top: 2px; } /** * Modal window overrides */ .modal-backdrop { background-color: transparent; } .modal-fullscreen .modal-dialog { box-shadow: none; margin: 0; padding: 0; width: 100%; height: 100%; min-height: 100%; overflow: scroll; } .modal-fullscreen .modal-content { height: 100%; border-radius: 0; } body { font-family: "Helvetica Neue", Helvetica, 'Helvetica W01 Roman', Arial, sans-serif; font-size: 100%; } h1, h2, h3, h4, h5, h6 { letter-spacing: -0.025em; line-height: 1.2; margin-top: 0; margin-bottom: 16px; } h1 { font-size: 24px; line-height: 1; margin-bottom: 16px; } h2 { font-size: 24px; margin-bottom: 16px; } h3 { font-size: 1.8em; } h5, p, li, main { font-size: 14px; } a { color: #1ebec3; text-decoration: none; } a:hover { color: #179397; text-decoration: underline; } .inline-label { font-weight: 500; } .sidebar hr { border: 0; border-top: 1px solid #171d1f; } .sidebar p.heading { color: #4f5e63; text-transform: uppercase; font-size: 11px; } /** * Brand & Breadcrumb Navigation */ .brand { display: block; margin-left: -15px; margin-right: -15px; } .breadcrumb-container { padding-left: 0; } .breadcrumb { background-color: transparent; margin-bottom: 0; padding: 0; } .breadcrumb > li { font-size: 16px; vertical-align: middle; } .brand, .breadcrumb > li.front-page { background-color: #171d1f; font-size: 24px; padding: 8px 16px; } .breadcrumb > li.active { font-weight: bold; } .breadcrumb > li + li:before { color: #dddddd; } /** * Tables */ th { font-size: 11px; font-weight: 900; text-transform: uppercase; } .nav.stacked { margin: 40px 20px; } .nav.stacked li { border-top: 2px solid #0c94b8; display: block; float: left; clear: left; width: 240px; } .nav.stacked li a:hover { border-bottom: 0; } /** * Lists */ .sortable { padding-left: 0; } .sortable li { list-style: none; } .sortable .ui-state-highlight { background-color: #ffff37; height: 108px; } tr.ui-sortable-helper td { opacity: 0.8; filter: alpha(opacity=80); -khtml-opacity: 0.8; -moz-opacity: 0.8; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; } /** * Dropdown */ .site-navigation { border: 0; border-radius: 7px; -moz-border-radius: 7px; -webkit-border-radius: 7px; top: -10px; left: -20px; min-width: 50px; } .site-navigation > li { text-align: center; } .site-navigation > li > a { border-radius: 7px; -moz-border-radius: 7px; -webkit-border-radius: 7px; clear: both; color: #333333; display: block; font-size: 24px; font-weight: normal; line-height: 1.428571429; margin: 0 4px; padding: 0; white-space: nowrap; } .site-navigation > li > a:hover, .site-navigation > li > a:focus { background-color: #428bca; color: white; text-decoration: none; } /** * Main Form Element styles that change based on where in * the application workflow they appear. Login forms operate * differently than do forms to add new Templates and new * Features within the application. */ form { background-color: transparent; box-shadow: none; margin: 0 auto; padding: 0; max-width: 660px; } .card { background-color: rgba(242, 242, 242, 0.1); padding: 48px; margin-bottom: 16px; box-shadow: none; margin: 0 auto; max-width: 480px; padding: 48px; } .card hr { display: none; } .card legend { border-bottom: 0; } .card legend, .card label, .card .label-control, .card .help-block, .card a, .card a:active, .card a:focus, .card a:hover, .card a:visited { color: rgb(128,128,128); font-weight: 200; } .card ::-webkit-input-placeholder { color: rgb(182,182,182); } .card :-moz-placeholder { /* Firefox 18- */ color: rgb(182,182,182); } .card ::-moz-placeholder { /* Firefox 19+ */ color: rgb(182,182,182); } .card :-ms-input-placeholder { color: rgb(182,182,182); } .form-actions { margin-top: 32px; } .form-actions small { margin-right: 16px; } .site-header .card { background-color: transparent; border-bottom: none; padding: 48px; } .site-footer .card { background-color: transparent; border-bottom: none; padding: 16px 48px; } /** * Styling for the labels for our various forms */ label, label.control-label { font-size: 14px; font-weight: 500; } label.alt { font-weight: normal; letter-spacing: -0.025em; font-size: 16px; font-family: "DIN Next W01 Medium"; color: #585858; } .helper.glyphicon { color: #dddddd; font-size: 48px; } .help-block { font-size: 12px; margin-bottom: 16px; } .non-label { margin-bottom: 4px; margin-top: 16px; } /** * Overrides for the generic <fieldset> element to behave how we * need it to for our application */ /** * Button styles based on the individual needs of the forms within * our application. */ .button, .button:hover { background-color: rgb(118, 189, 0); border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; border: none; color: white; display: inline-block; font-size: 14px; font-weight: 200; font-style: normal; letter-spacing: 0.05em; padding: 6px 24px 7px; text-decoration: none; text-align: center; text-shadow: none; border-bottom: 0; } .button:active { position: relative; top: 1px; } .button-cancel, .button-cancel:hover { color: #7c7c7c; font-size: 1em; margin-top: 8px; text-decoration: underline; } .button-cancel:hover { text-decoration: none; } .button.small { font-size: 12px; padding: 2px 10px 3px; } .checkbox.inline { margin-top: 32px; } .table td.reorder { color: #c4c4c4; vertical-align: middle; } .table td.reorder:hover { color: #404040; } .sidebar .button { display: block; margin: 16px auto 0; } /** * Button Colors */ .button.success { background-color: #6cc40e; box-shadow: 0 0.2em 0 #52940b; } .button.success:active, .button.success:focus { box-shadow: 0 0.1em 0 #52940b; } .button.danger { background-color: #bb1111; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border: 1px solid #931111; } select { height: 35px; } textarea { max-width: 100%; width: 100%; } input:focus, select:focus, textarea:focus { border-color: #0082a8; outline: none !important; } /** * A sheet form is a special kind of form that is intended to be a minimal, * digital representation of a standard form, as found in the world of print * It is not intended to be realistic, just a digital reprenstation, no * skeuomorphism is intended. * * The styles in the section following are intended to help us better * distinguish this form from other "administration" or "settings" style forms * as are often found in applications. */ .sheet-form .fieldset { background-color: #fefefe; box-shadow: 0px 1px 3px #c4c4c4; margin: 0 auto 40px; padding: 30px 0; } .sheet-form legend { background-color: #e0e0e0; margin: 0; padding: 0 40px; } .sheet-form .detailed-label { color: #c4c4c4; font-size: 12px; font-weight: 300; letter-spacing: 0.025em; } .sheet-form input:focus + .detailed-label { color: gray; } .sheet-form .title { background-color: transparent; border: 0; border-bottom: 1px dotted gray; box-shadow: none; color: #181818; font-size: 36px; padding: 0; text-shadow: 1px 1px 1px #e8e8e8; } .sheet-form .description { border: 0; border-bottom: 1px dotted gray; box-shadow: none; font-size: 18px; padding: 0; } /** * Parsley: Form parsing success/error styles */ .parsley-error-list { list-style: none; padding: 0; } .parsley-error { background-color: #fdf7f7; border-color: #eed3d7; } .parsley-error-list li { background-color: #fdf7f7; border-left: 3px solid #eed3d7; font-size: 11px; margin: 4px 0; padding: 4px; } .form-control.parsley-error { border-color: #b94a48; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .form-control.parsley-success { border-color: #468847; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } /** * Remove the spinner on number and date fields */ input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } .template { background-color: whitesmoke; border: 1px solid #ececec; border-bottom: 3px solid gainsboro; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; margin: 0 0 48px; min-height: 285px; padding: 30px 40px; position: relative; } .template-instance { background: gainsboro; margin: 0 0 16px; padding: 8px 0 0; } .application { background-color: transparent; border: 0; border-top: 3px solid gainsboro; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; margin: 0; min-height: 256px; padding: 30px 0 0; position: relative; } .highlight { border-bottom-color: #f4ca00; } h1 { font-size: 24px; font-weight: 300; letter-spacing: 0; margin-bottom: 16px; margin-top: 6px; } h1 a, h1 a:hover { color: #404040; text-decoration: none; } h1 a .glyphicon { color: #40ac18; display: none; font-size: 14px; top: -1px; } h1 a:hover .glyphicon { display: inline-block; } h2 { font-size: 16px; font-weight: 300; } h3 { border-bottom: 1px solid #e4e4e4; border-top: 1px solid #e4e4e4; font-size: 48px; font-weight: 700; } h3 .stat-label { font-size: 16px; font-weight: 300; letter-spacing: 0; text-transform: lowercase; } .services { color: #acacac; } .services .service { margin-right: 6px; } .service.highlight { color: #f4ca00; } .new.template { text-align: center; } .new.template .button { margin-top: 85px; } .table-viewer .table-scroller { overflow: scroll; } .table-viewer .table th:first-child { min-width: 60px; } .table-viewer .table td:first-child .edit { visibility: hidden; } .table-viewer .table tr:hover > td:first-child .edit { visibility: visible; } .table-viewer .table th { min-width: 160px; } .pending-submissions-wrapper { position: absolute; top: -4px; right: -4px; overflow: hidden; height: 100px; width: 100px; } .pending-submissions { background: gold; display: block; height: 80px; overflow: hidden; padding: 42px 26px 0 0; position: absolute; right: -80px; top: -16px; width: 180px; text-align: center; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -ms-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); } .pending-submissions .moderation-count { color: #fcfcfc; display: inline-block; font-size: 22px; font-weight: 900; letter-spacing: -0.05em; margin-left: 4px; margin-top: -2px; -webkit-transform: rotate(-45deg); -moz-transform: rotate(-45deg); -ms-transform: rotate(-45deg); -o-transform: rotate(-45deg); transform: rotate(-45deg); text-shadow: 0 0 4px #f2b100; width: 30px; } .tooltip.bottom { margin-top: 8px; } .tooltip-inner { background-color: #404040; padding: 8px; } /** * Sidebar navigation */ .sidebar .nav > li > a { background-color: transparent; border-radius: 5px; } .sidebar .nav > li > a:hover, .sidebar .nav > li > a:focus { text-decoration: none; background-color: #0a0c0d; color: #34dbe0; } .sidebar .nav > li.active > a { background-color: #f2f2f2; } /** * Field Builder */ .unselectable { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .unselectable input, .unselectable select, .unselectable textarea { cursor: default; } /** * Collaborators Page */ .collaborators .checkbox { -webkit-appearance: none; color: red; top: -4px; font-size: 16px; } .collaborators input.checkbox[checked="checked"] { color: green; } .collaborators td { text-align: center; vertical-align: middle; } .table thead > tr > th, .table tbody > tr > th, .table tfoot > tr > th, .table thead > tr > td, .table tbody > tr > td, .table tfoot > tr > td { border-top: none; } .card img.decorate { border: 4px solid rgb(252,252,252); border-top-color: rgb(232,232,232); border-right-color: rgb(232,232,232); border-radius: 86px; -moz-border-radius: 86px; -webkit-border-radius: 86px; } .form-group.scope { background-color: rgb(252,252,252); background-color: rgba(252, 252, 252, 0.9); padding: 32px 16px; } .form-group.scope p { color: rgb(32,32,32); margin: 0; } .form-group.scope .glyphicon { font-size: 16px; margin-right: 8px; } @media (min-width: 767px) { .page-content { margin-left: 25%; position: relative; } } @media (max-width: 640px) { .page-content { margin-left: 0; } .sheet-form { max-width: 100%; } } .account.container { margin-left: auto; margin-right: auto;padding-left: 15px; padding-right: 15px; width: 100%;} .account.nav,.breadcrumb{margin-top:8px;background-color:transparent;border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;margin-bottom:0;padding:0;margin-right:32px;}.account.nav>li,.breadcrumb>li{font-size:14px;font-weight:400;-webkit-font-smoothing:antialiased;vertical-align:middle}.account.nav>li{display:inline;display:inline-block}.account.nav>li>a,.breadcrumb>li>a{background-color:transparent;color:#e5e4e0;padding:0}.account.nav>li>a:hover,.breadcrumb>li>a:hover{color:#fcfcfc;text-decoration:none}.account.nav>li>a:hover{background-color:#212729}.account.nav>li{font-size:12px;margin-left:8px}.account>li .glyphicon{font-size:16px;margin-right:8px}.breadcrumb>li .glyphicon{top:5px}.account.nav .user img{border-radius:24px;-moz-border-radius:24px;-webkit-border-radius:24px;margin-top:-4px;vertical-align:text-top}.account.nav>li.active,.breadcrumb>li.active{font-weight:700}.breadcrumb>li+li:before{color:lightgrey;content:"\00bb"}
CommonsCloud/Core-API
CommonsCloudAPI/static/css/application.min.css
CSS
agpl-3.0
140,301
# Copyright (C) 2020 OpenMotics BV # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from __future__ import absolute_import import unittest from gateway.dto import SensorDTO, SensorSourceDTO from gateway.api.serializers import SensorSerializer class SensorSerializerTest(unittest.TestCase): def test_serialize(self): # Valid room data = SensorSerializer.serialize(SensorDTO(id=1, name='foo', room=5), fields=['id', 'name', 'room']) self.assertEqual({'id': 1, 'name': 'foo', 'room': 5}, data) # Empty room data = SensorSerializer.serialize(SensorDTO(id=1, name='foo'), fields=['id', 'name', 'room']) self.assertEqual({'id': 1, 'name': 'foo', 'room': 255}, data) # No room data = SensorSerializer.serialize(SensorDTO(id=1, name='foo', room=5), fields=['id', 'name']) self.assertEqual({'id': 1, 'name': 'foo'}, data) def test_deserialize(self): # Valid room dto = SensorSerializer.deserialize({'id': 5, 'external_id': '0', 'source': {'type': 'master'}, 'physical_quantity': 'temperature', 'unit': 'celcius', 'name': 'bar', 'room': 10}) expected_dto = SensorDTO(id=5, external_id='0', source=SensorSourceDTO('master', name=None), physical_quantity='temperature', unit='celcius', name='bar', room=10) assert expected_dto == dto self.assertEqual(expected_dto, dto) self.assertEqual(['external_id', 'id', 'name', 'physical_quantity', 'room', 'source', 'unit'], sorted(dto.loaded_fields)) # Empty room dto = SensorSerializer.deserialize({'id': 5, 'name': 'bar', 'room': 255}) self.assertEqual(SensorDTO(id=5, name='bar'), dto) self.assertEqual(['id', 'name', 'room'], sorted(dto.loaded_fields)) # No room dto = SensorSerializer.deserialize({'id': 5, 'name': 'bar'}) self.assertEqual(SensorDTO(id=5, name='bar'), dto) self.assertEqual(['id', 'name'], sorted(dto.loaded_fields)) # Invalid physical_quantity with self.assertRaises(ValueError): _ = SensorSerializer.deserialize({'id': 5, 'physical_quantity': 'something', 'unit': 'celcius', 'name': 'bar'}) # Invalid unit with self.assertRaises(ValueError): _ = SensorSerializer.deserialize({'id': 5, 'physical_quantity': 'temperature', 'unit': 'unicorns', 'name': 'bar'})
openmotics/gateway
testing/unittests/api_tests/serializers/sensor_test.py
Python
agpl-3.0
4,097
<?php namespace ERP\Domain; class ErpInfos { private $id; private $id_erp; private $titre; private $texte; private $type; private $x; private $y; private $ponctuel; private $source; public function getId() { return $this->id; } public function setId($id) { $this->id = $id; } public function getId_erp() { return $this->id_erp; } public function setId_erp($id_erp) { $this->id_erp = $id_erp; } public function getTitre() { return $this->titre; } public function setTitre($titre) { $this->titre = $titre; } public function getTexte() { return $this->texte; } public function setDesc($texte) { $this->texte = $texte; } public function getType() { return $this->type; } public function setType($type) { $this->type = $type; } public function getX() { return $this->x; } public function setX($x) { $this->x = $x; } public function getY() { return $this->y; } public function setY($y) { $this->y = $y; } public function getPonctuel() { return $this->ponctuel; } public function setPonctuel($ponctuel) { $this->ponctuel = $ponctuel; } public function getSource() { return $this->source; } public function setSource($source) { $this->source = $source; } }
bjperson/erp
src/Domain/ErpInfos.php
PHP
agpl-3.0
1,475
/* * This program is part of the OpenLMIS logistics management information system platform software. * Copyright © 2013 VillageReach * * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. *   * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License along with this program.  If not, see http://www.gnu.org/licenses.  For additional information contact info@OpenLMIS.org.  */ package org.openlmis.core.domain; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.Predicate; import org.openlmis.core.exception.DataException; import org.openlmis.core.serializer.DateDeserializer; import org.openlmis.upload.Importable; import org.openlmis.upload.annotation.ImportField; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; /** * ProgramSupported represents the Program supported by a Facility. Defines the contract for upload of such mapping like program code, * facility code and if program is active for facility are mandatory for such mapping. It also provides methods to calculate * whoRatio, packSize etc for a given ProgramSupported. */ @Data @AllArgsConstructor @NoArgsConstructor @EqualsAndHashCode(callSuper = false) @JsonSerialize(include = JsonSerialize.Inclusion.NON_EMPTY) @JsonIgnoreProperties(ignoreUnknown = true) public class ProgramSupported extends BaseModel implements Importable { private Long facilityId; @ImportField(mandatory = true, name = "Program Code", nested = "code") private Program program; @ImportField(mandatory = true, name = "Facility Code") private String facilityCode; @ImportField(mandatory = true, name = "Program Is Active", type = "boolean") private Boolean active = false; @ImportField(name = "Program Start Date", type = "Date") @JsonDeserialize(using = DateDeserializer.class) private Date startDate; private List<FacilityProgramProduct> programProducts; public void isValid() { if (this.active && this.startDate == null) throw new DataException("supported.programs.invalid"); } public ProgramSupported(Long programId, Boolean active, Date startDate) { this.program = new Program(programId); this.active = active; this.startDate = startDate; } @SuppressWarnings("unused") public String getStringStartDate() throws ParseException { SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); return this.startDate == null ? null : simpleDateFormat.format(this.startDate); } @JsonIgnore public Double getWhoRatioFor(final String productCode) { FacilityProgramProduct facilityProgramProduct = (FacilityProgramProduct) CollectionUtils.find(this.getProgramProducts(), new Predicate() { @Override public boolean evaluate(Object o) { return ((FacilityProgramProduct) o).getProduct().getCode().equals(productCode); } }); return (facilityProgramProduct == null) ? null : facilityProgramProduct.getWhoRatio(productCode); } @JsonIgnore public Integer getPackSizeFor(final String productCode) { FacilityProgramProduct facilityProgramProduct = (FacilityProgramProduct) CollectionUtils.find(this.getProgramProducts(), new Predicate() { @Override public boolean evaluate(Object o) { return ((FacilityProgramProduct) o).getProduct().getCode().equals(productCode); } }); return (facilityProgramProduct == null) ? null : facilityProgramProduct.getProduct().getPackSize(); } }
kelvinmbwilo/vims
modules/core/src/main/java/org/openlmis/core/domain/ProgramSupported.java
Java
agpl-3.0
4,322
DELETE FROM `weenie` WHERE `class_Id` = 46943; INSERT INTO `weenie` (`class_Id`, `class_Name`, `type`, `last_Modified`) VALUES (46943, 'ace46943-modifiedtaulandoi', 35, '2019-02-10 00:00:00') /* Caster */; INSERT INTO `weenie_properties_int` (`object_Id`, `type`, `value`) VALUES (46943, 1, 32768) /* ItemType - Caster */ , (46943, 5, 120) /* EncumbranceVal */ , (46943, 9, 16777216) /* ValidLocations - Held */ , (46943, 16, 6291460) /* ItemUseable - SourceWieldedTargetRemoteNeverWalk */ , (46943, 18, 128) /* UiEffects - Frost */ , (46943, 19, 4000) /* Value */ , (46943, 33, 1) /* Bonded - Bonded */ , (46943, 45, 8) /* DamageType - Cold */ , (46943, 93, 1044) /* PhysicsState - Ethereal, IgnoreCollisions, Gravity */ , (46943, 94, 16) /* TargetType - Creature */ , (46943, 106, 400) /* ItemSpellcraft */ , (46943, 107, 9999) /* ItemCurMana */ , (46943, 108, 10000) /* ItemMaxMana */ , (46943, 109, 200) /* ItemDifficulty */ , (46943, 110, 0) /* ItemAllegianceRankLimit */ , (46943, 114, 1) /* Attuned - Attuned */ , (46943, 151, 2) /* HookType - Wall */ , (46943, 158, 8) /* WieldRequirements - Training */ , (46943, 159, 34) /* WieldSkillType - WarMagic */ , (46943, 160, 2) /* WieldDifficulty */ , (46943, 263, 8) /* ResistanceModifierType */ , (46943, 8041, 101) /* PCAPRecordedPlacement - Resting */; INSERT INTO `weenie_properties_bool` (`object_Id`, `type`, `value`) VALUES (46943, 22, True ) /* Inscribable */ , (46943, 69, False) /* IsSellable */ , (46943, 99, True ) /* Ivoryable */; INSERT INTO `weenie_properties_float` (`object_Id`, `type`, `value`) VALUES (46943, 5, -1) /* ManaRate */ , (46943, 29, 1.35) /* WeaponDefense */ , (46943, 144, 0.18) /* ManaConversionMod */ , (46943, 147, 1) /* CriticalFrequency */ , (46943, 152, 1.18) /* ElementalDamageMod */ , (46943, 157, 1) /* ResistanceModifier */; INSERT INTO `weenie_properties_string` (`object_Id`, `type`, `value`) VALUES (46943, 1, 'Modified Taulandoi') /* Name */ , (46943, 15, 'A stave carved from obsidian, a large sapphire rests at the tip.') /* ShortDesc */; INSERT INTO `weenie_properties_d_i_d` (`object_Id`, `type`, `value`) VALUES (46943, 1, 33557963) /* Setup */ , (46943, 3, 536870932) /* SoundTable */ , (46943, 6, 67111919) /* PaletteBase */ , (46943, 8, 100673490) /* Icon */ , (46943, 22, 872415275) /* PhysicsEffectTable */ , (46943, 28, 2783) /* Spell - LesserElementalFuryFrost */ , (46943, 8001, 275333272) /* PCAPRecordedWeenieHeader - Value, Usable, UiEffects, Container, ValidLocations, TargetType, Burden, Spell, HookType */ , (46943, 8003, 18) /* PCAPRecordedObjectDesc - Inscribable, Attackable */ , (46943, 8005, 137217) /* PCAPRecordedPhysicsDesc - CSetup, STable, PeTable, AnimationFrame */; INSERT INTO `weenie_properties_i_i_d` (`object_Id`, `type`, `value`) VALUES (46943, 8000, 3359484482) /* PCAPRecordedObjectIID */; INSERT INTO `weenie_properties_spell_book` (`object_Id`, `spell`, `probability`) VALUES (46943, 4637, 2) /* WarMagicMasteryOther8 */ , (46943, 4715, 2) /* CANTRIPWARMAGICAPTITUDE3 */; INSERT INTO `weenie_properties_palette` (`object_Id`, `sub_Palette_Id`, `offset`, `length`) VALUES (46943, 67111919, 0, 0); INSERT INTO `weenie_properties_texture_map` (`object_Id`, `index`, `old_Id`, `new_Id`) VALUES (46943, 0, 83894279, 83894279) , (46943, 0, 83894277, 83894277); INSERT INTO `weenie_properties_anim_part` (`object_Id`, `index`, `animation_Id`) VALUES (46943, 0, 16788368);
LtRipley36706/ACE-World
Database/3-Core/9 WeenieDefaults/SQL/Caster/Caster/46943 Modified Taulandoi.sql
SQL
agpl-3.0
3,865
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace MVCSample.Web.Controllers { public class HomeController : Controller { public ActionResult Index() { return View(); } public ActionResult About() { ViewBag.Message = "Your application description page."; return View(); } public ActionResult Contact() { ViewBag.Message = "Your contact page."; return View(); } } }
Evilazaro/MCSDAzureTraining
Implement and Design Websites/HOL/Master/HOL-ASPNETAzureWebSites/Source/Assets/MVCSample.Web/MVCSample.Web/Controllers/HomeController.cs
C#
agpl-3.0
582
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2010-2012 Associazione OpenERP Italia # (<http://www.openerp-italia.org>). # Copyright (C) 2014 Didotech srl # (<http://www.didotech.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but 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 Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## import logging from datetime import datetime from openerp import SUPERUSER_ID from openerp.osv import orm, fields from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT _logger = logging.getLogger(__name__) _logger.setLevel(logging.DEBUG) class stock_location(orm.Model): _inherit = "stock.location" _columns = { 'update_product_bylocation': fields.boolean('Show Product location quantity on db', help='If check create a columns on product_product table for get product for this location'), 'product_related_columns': fields.char('Columns Name on product_product') } def update_product_by_location(self, cr, uid, context=None): context = context or self.pool['res.users'].context_get(cr, uid) location_ids = self.search(cr, uid, [('update_product_bylocation', '=', True)], context=context) location_vals = {} start_time = datetime.now() date_product_by_location_update = start_time.strftime(DEFAULT_SERVER_DATETIME_FORMAT) if location_ids: product_obj = self.pool['product.product'] for location in self.browse(cr, uid, location_ids, context): location_vals[location.id] = location.product_related_columns product_ids = product_obj.search(cr, uid, [('type', '!=', 'service')], context=context) product_context = context.copy() product_vals = {} for product_id in product_ids: product_vals[product_id] = {} for location_keys in location_vals.keys(): product_context['location'] = location_keys for product in product_obj.browse(cr, uid, product_ids, product_context): if location_vals[location_keys] and (product[location_vals[location_keys]] != product.qty_available): product_vals[product.id][location_vals[location_keys]] = product.qty_available if product_vals: for product_id in product_vals.keys(): product_val = product_vals[product_id] if product_val: product_val['date_product_by_location_update'] = date_product_by_location_update product_obj.write(cr, uid, product_id, product_val, context) end_time = datetime.now() duration_seconds = (end_time - start_time) duration = '{sec}'.format(sec=duration_seconds) _logger.info(u'update_product_by_location get in {duration}'.format(duration=duration)) return True def create_product_by_location(self, cr, location_name, context): model_id = self.pool['ir.model.data'].get_object_reference(cr, SUPERUSER_ID, 'product', 'model_product_product')[1] fields_value = { 'field_description': location_name, 'groups': [[6, False, []]], 'model_id': model_id, 'name': 'x_{location_name}'.format(location_name=location_name).lower().replace(' ', '_'), 'readonly': False, 'required': False, 'select_level': '0', 'serialization_field_id': False, 'translate': False, 'ttype': 'float', } context_field = context.copy() context_field.update( { 'department_id': False, 'lang': 'it_IT', 'manual': True, # required for create columns on table 'uid': 1 } ) fields_id = self.pool['ir.model.fields'].create(cr, SUPERUSER_ID, fields_value, context_field) return fields_id, fields_value['name'] def write(self, cr, uid, ids, vals, context=None): context = context or self.pool['res.users'].context_get(cr, uid) if vals.get('update_product_bylocation', False): for location in self.browse(cr, uid, ids, context): field_id, field_name = self.create_product_by_location(cr, location.name, context) vals['product_related_columns'] = field_name return super(stock_location, self).write(cr, uid, ids, vals, context)
iw3hxn/LibrERP
stock_picking_extended/models/inherit_stock_location.py
Python
agpl-3.0
5,169
/** * Created by * Pratish Shrestha <pratishshrestha@lftechnology.com> * on 2/15/16. */ ;(function () { 'use strict'; //React and Redux dependencies var React = require('react'); var Link = require('react-router').Link; var connect = require('react-redux').connect; var bindActionCreators = require('redux').bindActionCreators; //constants var resourceConstants = require('../../constants/resourceConstants'); var urlConstants = require('../../constants/urlConstants'); var messageConstants = require('../../constants/messageConstants'); //components var BudgetTypeRow = require('./BudgetTypeRow'); var EntityHeader = require('../common/header/EntityHeader'); var Pagination = require('../common/pagination/Pagination'); //utils var alertBox = require('../../utils/alertBox'); //services var listService = require('../../services/listService'); //actions var apiActions = require('../../actions/apiActions'); var crudActions = require('../../actions/crudActions'); //libraries var _ = require('lodash'); var sortBy = ''; var BudgetTypeList = React.createClass({ getDefaultProps: function () { return { offset: parseInt(resourceConstants.OFFSET) } }, componentWillMount: function () { this.fetchData(this.props.pagination.startPage); }, componentWillUnmount: function () { this.props.actions.clearPagination(); this.props.actions.clearList(resourceConstants.BUDGET_TYPES); this.props.actions.apiClearState(); }, fetchData: function (start) { this.props.actions.fetch(resourceConstants.BUDGET_TYPES, resourceConstants.BUDGET_TYPES, { sort: sortBy, start: start || 1, offset: this.props.offset }); }, refreshList: function (index) { var start = 1 + (index - 1) * this.props.offset; this.fetchData(start); }, deleteBudgetType: function (id) { var that = this; alertBox.confirm(messageConstants.DELETE_MESSAGE, function () { that.props.actions.deleteItem(resourceConstants.BUDGET_TYPES, resourceConstants.BUDGET_TYPES, id, { sort: sortBy, start: that.props.pagination.startPage || 1, offset: that.props.offset }, that.props.pagination.count); }); }, //sorts data in ascending or descending order according to clicked field sort: function (field) { var isAscending = listService.changeSortDisplay(field); sortBy = (isAscending) ? field : '-' + field; this.fetchData(this.props.pagination.startPage); }, renderBudgetType: function (key) { var startIndex = this.props.pagination.startPage + parseInt(key); return ( <BudgetTypeRow key={key} index={startIndex || 1 + parseInt(key)} budgetType={this.props.budgetTypes[key]} deleteBudgetType={this.deleteBudgetType}/> ) }, render: function () { return ( <div> <EntityHeader header="Budget Types" routes={this.props.routes} title="Budget Types" apiState={this.props.apiState}/> <div className="block full"> <div className="block-title"> <h2>Budget Type Details</h2> <div className="block-options pull-right"> <Link to={urlConstants.BUDGET_TYPES.NEW} title="Add Budget Type" className="btn btn-sm btn-success btn-ghost text-uppercase"><i className="fa fa-plus"></i> Add Budget Type</Link> </div> </div> <div className="table-responsive"> <table className="table table-vcenter table-bordered table-hover table-striped"> <thead> <tr> <th>S.No.</th> <th className="cursor-pointer sort noselect col-400" data-sort="none" id="title" onClick={this.sort.bind(null, 'title')}> Budget Type <i className="fa fa-sort pull-right"></i> </th> <th className="text-center">Actions</th> </tr> </thead> <tbody> {this.props.budgetTypes.length ? Object.keys(this.props.budgetTypes).map(this.renderBudgetType) : listService.displayNoRecordFound()} </tbody> </table> </div> <Pagination maxPages={Math.ceil(this.props.pagination.count / this.props.offset)} selectedPage={parseInt(this.props.pagination.startPage / 10) + 1} refreshList={this.refreshList}/> </div> </div> ) } }); var mapStateToProps = function (state) { return { budgetTypes: state.crudReducer.budgetTypes, pagination: state.crudReducer.pagination, apiState: state.apiReducer } }; var mapDispatchToProps = function (dispatch) { return { actions: bindActionCreators(_.assign({}, crudActions, apiActions), dispatch) } }; module.exports = connect(mapStateToProps, mapDispatchToProps)(BudgetTypeList); })();
leapfrogtechnology/vyaguta-resource
frontend/src/js/components/budget-type/BudgetTypeList.js
JavaScript
agpl-3.0
6,104
<?php // created: 2019-08-05 16:02:34 $mod_strings = array ( 'LBL_TEAM' => 'Team', 'LBL_TEAM_ID' => 'Team Id', 'LBL_ASSIGNED_TO_ID' => 'Assigned User Id', 'LBL_ASSIGNED_TO_NAME' => 'Assigned to', 'LBL_ID' => 'ID', 'LBL_DATE_ENTERED' => 'Date Created', 'LBL_DATE_MODIFIED' => 'Date Modified', 'LBL_MODIFIED' => 'Modified By', 'LBL_MODIFIED_ID' => 'Modified By Id', 'LBL_MODIFIED_NAME' => 'Modified By Name', 'LBL_CREATED' => 'Created By', 'LBL_CREATED_ID' => 'Created By Id', 'LBL_DESCRIPTION' => 'Description', 'LBL_DELETED' => 'Deleted', 'LBL_NAME' => 'Name', 'LBL_SAVING' => 'Saving...', 'LBL_SAVED' => 'Saved', 'LBL_CREATED_USER' => 'Created by User', 'LBL_MODIFIED_USER' => 'Modified by User', 'LBL_LIST_FORM_TITLE' => 'Feed List', 'LBL_MODULE_NAME' => 'Activity Streams', 'LBL_MODULE_TITLE' => 'Activity Streams', 'LBL_DASHLET_DISABLED' => 'Warning: The Feed system is disabled, no new feed entries will be posted until it is activated', 'LBL_ADMIN_SETTINGS' => 'Feed Settings', 'LBL_RECORDS_DELETED' => 'All previous Feed entries have been removed, if the Feed system is enabled, new entries will be generated automatically.', 'LBL_CONFIRM_DELETE_RECORDS' => 'Are you sure you wish to delete all of the Feed entries?', 'LBL_FLUSH_RECORDS' => 'Delete Feed Entries', 'LBL_ENABLE_FEED' => 'Enable My Activity Stream Dashlet', 'LBL_ENABLE_MODULE_LIST' => 'Activate Feeds For', 'LBL_HOMEPAGE_TITLE' => 'My Activity Stream', 'LNK_NEW_RECORD' => 'Create Feed', 'LNK_LIST' => 'Feed', 'LBL_SEARCH_FORM_TITLE' => 'Search Feed', 'LBL_HISTORY_SUBPANEL_TITLE' => 'View History', 'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Activities', 'LBL_SUGAR_FEED_SUBPANEL_TITLE' => 'Feed', 'LBL_NEW_FORM_TITLE' => 'New Feed', 'LBL_ALL' => 'All', 'LBL_USER_FEED' => 'User Feed', 'LBL_ENABLE_USER_FEED' => 'Activate User Feed', 'LBL_TO' => 'Visible to Team', 'LBL_IS' => 'is', 'LBL_DONE' => 'Done', 'LBL_TITLE' => 'Title', 'LBL_ROWS' => 'Rows', 'LBL_CATEGORIES' => 'Modules', 'LBL_TIME_LAST_WEEK' => 'Last Week', 'LBL_TIME_WEEKS' => 'Weeks', 'LBL_TIME_DAYS' => 'Days', 'LBL_TIME_YESTERDAY' => 'Yesterday', 'LBL_TIME_HOURS' => 'Hours', 'LBL_TIME_HOUR' => 'Hours', 'LBL_TIME_MINUTES' => 'Minutes', 'LBL_TIME_MINUTE' => 'Minute', 'LBL_TIME_SECONDS' => 'Seconds', 'LBL_TIME_SECOND' => 'Second', 'LBL_TIME_AGO' => 'ago', 'CREATED_CONTACT' => 'created a <b>NEW</b> {0}', 'CREATED_OPPORTUNITY' => 'created a <b>NEW</b> {0}', 'CREATED_CASE' => 'created a <b>NEW</b> {0}', 'CREATED_LEAD' => 'created a <b>NEW</b> {0}', 'FOR' => 'for', 'CLOSED_CASE' => '<b>CLOSED</b> a {0} ', 'CONVERTED_LEAD' => '<b>CONVERTED</b> a {0}', 'WON_OPPORTUNITY' => 'has <b>WON</b> an {0}', 'WITH' => 'with', 'LBL_LINK_TYPE_Link' => 'Link', 'LBL_LINK_TYPE_Image' => 'Image', 'LBL_LINK_TYPE_YouTube' => 'YouTube&#153;', 'LBL_SELECT' => 'Select', 'LBL_POST' => 'Post', 'LBL_EXTERNAL_PREFIX' => 'External: ', 'LBL_EXTERNAL_WARNING' => 'Items labeled "external" require an <a href="?module=EAPM">external account</a>.', 'LBL_AUTHENTICATE' => 'Connect to', 'LBL_AUTHENTICATION_PENDING' => 'Not all of the external accounts you have selected have been authenticated. Click \'Cancel\' to return to the Options window to authenticate the external accounts, or click \'Ok\' to proceed without authenticating.', 'LBL_ADVANCED_SEARCH' => 'Advanced Search', 'LBL_BASICSEARCH' => 'Basic Search', 'LBL_SHOW_MORE_OPTIONS' => 'Show More Options', 'LBL_HIDE_OPTIONS' => 'Hide Options', 'LBL_VIEW' => 'View', 'LBL_POST_TITLE' => 'Post Status Update for ', 'LBL_URL_LINK_TITLE' => 'URL Link to use', 'LBL_TEAM_VISIBILITY_TITLE' => 'team that can see this post', );
ExpandeNegocio/crm
cache/modules/SugarFeed/language/en_us.lang.php
PHP
agpl-3.0
3,751
<?php /* ------------------------------------------------------------------------ FusionInventory Copyright (C) 2010-2016 by the FusionInventory Development Team. http://www.fusioninventory.org/ http://forge.fusioninventory.org/ ------------------------------------------------------------------------ LICENSE This file is part of FusionInventory project. FusionInventory is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. FusionInventory is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with FusionInventory. If not, see <http://www.gnu.org/licenses/>. ------------------------------------------------------------------------ @package FusionInventory @author David Durieux @co-author @copyright Copyright (c) 2010-2016 FusionInventory team @license AGPL License 3.0 or (at your option) any later version http://www.gnu.org/licenses/agpl-3.0-standalone.html @link http://www.fusioninventory.org/ @link http://forge.fusioninventory.org/projects/fusioninventory-for-glpi/ @since 2010 ------------------------------------------------------------------------ */ include ("../../../inc/includes.php"); Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"], "plugins", "pluginfusioninventorymenu", "taskjob"); Session::checkRight('plugin_fusioninventory_task', READ); PluginFusioninventoryMenu::displayMenu("mini"); echo "<div class='monitoring-logs'>"; $pfTask = new PluginFusioninventoryTask(); $pfTask->showJobLogs(); echo "</div>"; Html::footer(); ?>
orthagh/fusioninventory-for-glpi
front/taskjob.php
PHP
agpl-3.0
2,099
/* * The Kuali Financial System, a comprehensive financial management system for higher education. * * Copyright 2005-2014 The Kuali Foundation * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.kuali.kfs.module.purap.businessobject.options; import java.util.ArrayList; import java.util.List; import org.kuali.kfs.module.purap.PurapConstants; import org.kuali.kfs.module.purap.PurapConstants.QuoteTypeDescriptions; import org.kuali.rice.core.api.util.ConcreteKeyValue; import org.kuali.rice.krad.keyvalues.KeyValuesBase; /** * Value Finder for Purchase Order Quote Types. */ public class PurchaseOrderQuoteTypeValuesFinder extends KeyValuesBase { /** * Returns code/description pairs of all Purchase Order Quote Types. * * @see org.kuali.rice.kns.lookup.keyvalues.KeyValuesFinder#getKeyValues() */ public List getKeyValues() { List keyValues = new ArrayList(); keyValues.add(new ConcreteKeyValue(PurapConstants.QuoteTypes.COMPETITIVE, QuoteTypeDescriptions.COMPETITIVE)); keyValues.add(new ConcreteKeyValue(PurapConstants.QuoteTypes.PRICE_CONFIRMATION, QuoteTypeDescriptions.PRICE_CONFIRMATION)); return keyValues; } }
ua-eas/ua-kfs-5.3
work/src/org/kuali/kfs/module/purap/businessobject/options/PurchaseOrderQuoteTypeValuesFinder.java
Java
agpl-3.0
1,877
DELETE FROM `weenie` WHERE `class_Id` = 33897; INSERT INTO `weenie` (`class_Id`, `class_Name`, `type`, `last_Modified`) VALUES (33897, 'ace33897-hastarthemisbegotten', 10, '2019-02-10 00:00:00') /* Creature */; INSERT INTO `weenie_properties_int` (`object_Id`, `type`, `value`) VALUES (33897, 1, 16) /* ItemType - Creature */ , (33897, 2, 22) /* CreatureType - Shadow */ , (33897, 6, -1) /* ItemsCapacity */ , (33897, 7, -1) /* ContainersCapacity */ , (33897, 16, 1) /* ItemUseable - No */ , (33897, 25, 185) /* Level */ , (33897, 93, 1032) /* PhysicsState - ReportCollisions, Gravity */ , (33897, 113, 2) /* Gender - Female */ , (33897, 133, 2) /* ShowableOnRadar - ShowMovement */ , (33897, 188, 1) /* HeritageGroup - Aluvian */ , (33897, 8007, 0) /* PCAPRecordedAutonomousMovement */; INSERT INTO `weenie_properties_bool` (`object_Id`, `type`, `value`) VALUES (33897, 1, True ) /* Stuck */; INSERT INTO `weenie_properties_float` (`object_Id`, `type`, `value`) VALUES (33897, 39, 1.2) /* DefaultScale */ , (33897, 76, 0.5) /* Translucency */; INSERT INTO `weenie_properties_string` (`object_Id`, `type`, `value`) VALUES (33897, 1, 'Hastar the Misbegotten') /* Name */ , (33897, 8006, 'AAA9AAAAAAA=') /* PCAPRecordedCurrentMotionState */; INSERT INTO `weenie_properties_d_i_d` (`object_Id`, `type`, `value`) VALUES (33897, 1, 0x0200071B) /* Setup */ , (33897, 2, 0x09000093) /* MotionTable */ , (33897, 3, 0x20000002) /* SoundTable */ , (33897, 6, 0x0400007E) /* PaletteBase */ , (33897, 8, 0x06001BBE) /* Icon */ , (33897, 9, 0x0500106B) /* EyesTexture */ , (33897, 10, 0x05001089) /* NoseTexture */ , (33897, 11, 0x050010AF) /* MouthTexture */ , (33897, 15, 0x04001FC4) /* HairPalette */ , (33897, 16, 0x040002BE) /* EyesPalette */ , (33897, 17, 0x040002B8) /* SkinPalette */ , (33897, 22, 0x34000063) /* PhysicsEffectTable */ , (33897, 8001, 8388630) /* PCAPRecordedWeenieHeader - ItemsCapacity, ContainersCapacity, Usable, RadarBehavior */ , (33897, 8003, 20) /* PCAPRecordedObjectDesc - Stuck, Attackable */ , (33897, 8005, 366723) /* PCAPRecordedPhysicsDesc - CSetup, MTable, ObjScale, STable, PeTable, Position, Movement, Translucency */; INSERT INTO `weenie_properties_position` (`object_Id`, `position_Type`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`) VALUES (33897, 8040, 0x090B0003, 13.1896, 60.4853, 16.006, 1, 0, 0, 0) /* PCAPRecordedLocation */ /* @teleloc 0x090B0003 [13.189600 60.485300 16.006000] 1.000000 0.000000 0.000000 0.000000 */; INSERT INTO `weenie_properties_i_i_d` (`object_Id`, `type`, `value`) VALUES (33897, 8000, 0xDBE0F6FB) /* PCAPRecordedObjectIID */; INSERT INTO `weenie_properties_attribute_2nd` (`object_Id`, `type`, `init_Level`, `level_From_C_P`, `c_P_Spent`, `current_Level`) VALUES (33897, 1, 0, 0, 0, 8000) /* MaxHealth */; INSERT INTO `weenie_properties_palette` (`object_Id`, `sub_Palette_Id`, `offset`, `length`) VALUES (33897, 67112860, 0, 0); INSERT INTO `weenie_properties_anim_part` (`object_Id`, `index`, `animation_Id`) VALUES (33897, 0, 16778359) , (33897, 1, 16777708) , (33897, 2, 16777708) , (33897, 3, 16777708) , (33897, 4, 16777708) , (33897, 5, 16777708) , (33897, 6, 16777708) , (33897, 7, 16777708) , (33897, 8, 16777708) , (33897, 9, 16778425) , (33897, 10, 16778431) , (33897, 11, 16778429) , (33897, 12, 16777304) , (33897, 13, 16778434) , (33897, 14, 16778424) , (33897, 15, 16777307) , (33897, 16, 16778407);
ACEmulator/ACE-World
Database/3-Core/9 WeenieDefaults/SQL/Creature/Shadow/33897 Hastar the Misbegotten.sql
SQL
agpl-3.0
3,806
/** Copyright (C) 2016 Scott Lenser - Released under terms of the AGPLv3 License */ #ifndef UTILS_SPARSE_GRID_H #define UTILS_SPARSE_GRID_H #include "intpoint.h" #include <cassert> #include <unordered_map> #include <vector> #include <functional> namespace cura { /*! \brief Sparse grid which can locate spatially nearby elements efficiently. * * \note This is an abstract template class which doesn't have any functions to insert elements. * \see SparsePointGrid * * \tparam ElemT The element type to store. */ template<class ElemT> class SparseGrid { public: using Elem = ElemT; /*! \brief Constructs a sparse grid with the specified cell size. * * \param[in] cell_size The size to use for a cell (square) in the grid. * Typical values would be around 0.5-2x of expected query radius. * \param[in] elem_reserve Number of elements to research space for. * \param[in] max_load_factor Maximum average load factor before rehashing. */ SparseGrid(coord_t cell_size, size_t elem_reserve=0U, float max_load_factor=1.0f); /*! \brief Returns all data within radius of query_pt. * * Finds all elements with location within radius of \p query_pt. May * return additional elements that are beyond radius. * * Average running time is a*(1 + 2 * radius / cell_size)**2 + * b*cnt where a and b are proportionality constance and cnt is * the number of returned items. The search will return items in * an area of (2*radius + cell_size)**2 on average. The max range * of an item from the query_point is radius + cell_size. * * \param[in] query_pt The point to search around. * \param[in] radius The search radius. * \return Vector of elements found */ std::vector<Elem> getNearby(const Point &query_pt, coord_t radius) const; static const std::function<bool(const Elem&)> no_precondition; /*! * Find the nearest element to a given \p query_pt within \p radius. * * \param[in] query_pt The point for which to find the nearest object. * \param[in] radius The search radius. * \param[out] elem_nearest the nearest element. Only valid if function returns true. * \param[in] precondition A precondition which must return true for an element * to be considered for output * \return True if and only if an object has been found within the radius. */ bool getNearest(const Point &query_pt, coord_t radius, Elem &elem_nearest, const std::function<bool(const Elem& elem)> precondition = no_precondition) const; /*! \brief Process elements from cells that might contain sought after points. * * Processes elements from cell that might have elements within \p * radius of \p query_pt. Processes all elements that are within * radius of query_pt. May process elements that are up to radius + * cell_size from query_pt. * * \param[in] query_pt The point to search around. * \param[in] radius The search radius. * \param[in] process_func Processes each element. process_func(elem) is * called for each element in the cell. Processing stops if function returns false. */ void processNearby(const Point &query_pt, coord_t radius, const std::function<bool (const ElemT&)>& process_func) const; /*! \brief Process elements from cells that might contain sought after points along a line. * * Processes elements from cells that cross the line \p query_line. * May process elements that are up to sqrt(2) * cell_size from \p query_line. * * \param[in] query_line The line along which to check each cell * \param[in] process_func Processes each element. process_func(elem) is * called for each element in the cells. Processing stops if function returns false. */ void processLine(const std::pair<Point, Point> query_line, const std::function<bool (const Elem&)>& process_elem_func) const; coord_t getCellSize() const; protected: using GridPoint = Point; using grid_coord_t = coord_t; using GridMap = std::unordered_multimap<GridPoint, Elem>; /*! \brief Process elements from the cell indicated by \p grid_pt. * * \param[in] grid_pt The grid coordinates of the cell. * \param[in] process_func Processes each element. process_func(elem) is * called for each element in the cell. Processing stops if function returns false. * \return Whether we need to continue processing a next cell. */ bool processFromCell(const GridPoint &grid_pt, const std::function<bool (const Elem&)>& process_func) const; /*! \brief Process cells along a line indicated by \p line. * * \param[in] line The line along which to process cells * \param[in] process_func Processes each cell. process_func(elem) is * called for each cell. Processing stops if function returns false. */ void processLineCells(const std::pair<Point, Point> line, const std::function<bool (GridPoint)>& process_cell_func); /*! \brief Process cells along a line indicated by \p line. * * \param[in] line The line along which to process cells * \param[in] process_func Processes each cell. process_func(elem) is * called for each cell. Processing stops if function returns false. */ void processLineCells(const std::pair<Point, Point> line, const std::function<bool (GridPoint)>& process_cell_func) const; /*! \brief Compute the grid coordinates of a point. * * \param[in] point The actual location. * \return The grid coordinates that correspond to \p point. */ GridPoint toGridPoint(const Point& point) const; /*! \brief Compute the grid coordinate of a print space coordinate. * * \param[in] coord The actual location. * \return The grid coordinate that corresponds to \p coord. */ grid_coord_t toGridCoord(const coord_t& coord) const; /*! \brief Compute the lowest point in a grid cell. * The lowest point is the point in the grid cell closest to the origin. * * \param[in] location The grid location. * \return The print space coordinates that correspond to \p location. */ Point toLowerCorner(const GridPoint& location) const; /*! \brief Compute the lowest coord in a grid cell. * The lowest point is the point in the grid cell closest to the origin. * * \param[in] grid_coord The grid coordinate. * \return The print space coordinate that corresponds to \p grid_coord. */ coord_t toLowerCoord(const grid_coord_t& grid_coord) const; /*! \brief Map from grid locations (GridPoint) to elements (Elem). */ GridMap m_grid; /*! \brief The cell (square) size. */ coord_t m_cell_size; grid_coord_t nonzero_sign(const grid_coord_t z) const; }; #define SGI_TEMPLATE template<class ElemT> #define SGI_THIS SparseGrid<ElemT> SGI_TEMPLATE SGI_THIS::SparseGrid(coord_t cell_size, size_t elem_reserve, float max_load_factor) { assert(cell_size > 0U); m_cell_size = cell_size; // Must be before the reserve call. m_grid.max_load_factor(max_load_factor); if (elem_reserve != 0U) { m_grid.reserve(elem_reserve); } } SGI_TEMPLATE typename SGI_THIS::GridPoint SGI_THIS::toGridPoint(const Point &point) const { return Point(toGridCoord(point.X), toGridCoord(point.Y)); } SGI_TEMPLATE typename SGI_THIS::grid_coord_t SGI_THIS::toGridCoord(const coord_t& coord) const { // This mapping via truncation results in the cells with // GridPoint.x==0 being twice as large and similarly for // GridPoint.y==0. This doesn't cause any incorrect behavior, // just changes the running time slightly. The change in running // time from this is probably not worth doing a proper floor // operation. return coord / m_cell_size; } SGI_TEMPLATE typename cura::Point SGI_THIS::toLowerCorner(const GridPoint& location) const { return cura::Point(toLowerCoord(location.X), toLowerCoord(location.Y)); } SGI_TEMPLATE typename cura::coord_t SGI_THIS::toLowerCoord(const grid_coord_t& grid_coord) const { // This mapping via truncation results in the cells with // GridPoint.x==0 being twice as large and similarly for // GridPoint.y==0. This doesn't cause any incorrect behavior, // just changes the running time slightly. The change in running // time from this is probably not worth doing a proper floor // operation. return grid_coord * m_cell_size; } SGI_TEMPLATE bool SGI_THIS::processFromCell( const GridPoint &grid_pt, const std::function<bool (const Elem&)>& process_func) const { auto grid_range = m_grid.equal_range(grid_pt); for (auto iter = grid_range.first; iter != grid_range.second; ++iter) { if (!process_func(iter->second)) { return false; } } return true; } SGI_TEMPLATE void SGI_THIS::processLineCells( const std::pair<Point, Point> line, const std::function<bool (GridPoint)>& process_cell_func) { static_cast<const SGI_THIS*>(this)->processLineCells(line, process_cell_func); } SGI_TEMPLATE void SGI_THIS::processLineCells( const std::pair<Point, Point> line, const std::function<bool (GridPoint)>& process_cell_func) const { Point start = line.first; Point end = line.second; if (end.X < start.X) { // make sure X increases between start and end std::swap(start, end); } const GridPoint start_cell = toGridPoint(start); const GridPoint end_cell = toGridPoint(end); const coord_t y_diff = end.Y - start.Y; const grid_coord_t y_dir = nonzero_sign(y_diff); grid_coord_t x_cell_start = start_cell.X; for (grid_coord_t cell_y = start_cell.Y; cell_y * y_dir <= end_cell.Y * y_dir; cell_y += y_dir) { // for all Y from start to end // nearest y coordinate of the cells in the next row coord_t nearest_next_y = toLowerCoord(cell_y + ((nonzero_sign(cell_y) == y_dir || cell_y == 0) ? y_dir : coord_t(0))); grid_coord_t x_cell_end; // the X coord of the last cell to include from this row if (y_diff == 0) { x_cell_end = end_cell.X; } else { coord_t area = (end.X - start.X) * (nearest_next_y - start.Y); // corresponding_x: the x coordinate corresponding to nearest_next_y coord_t corresponding_x = start.X + area / y_diff; x_cell_end = toGridCoord(corresponding_x + ((corresponding_x < 0) && ((area % y_diff) != 0))); if (x_cell_end < start_cell.X) { // process at least one cell! x_cell_end = x_cell_start; } } for (grid_coord_t cell_x = x_cell_start; cell_x <= x_cell_end; ++cell_x) { GridPoint grid_loc(cell_x, cell_y); bool continue_ = process_cell_func(grid_loc); if (!continue_) { return; } if (grid_loc == end_cell) { return; } } // TODO: this causes at least a one cell overlap for each row, which // includes extra cells when crossing precisely on the corners // where positive slope where x > 0 and negative slope where x < 0 x_cell_start = x_cell_end; } assert(false && "We should have returned already before here!"); } SGI_TEMPLATE typename SGI_THIS::grid_coord_t SGI_THIS::nonzero_sign(const grid_coord_t z) const { return (z >= 0) - (z < 0); } SGI_TEMPLATE void SGI_THIS::processNearby(const Point &query_pt, coord_t radius, const std::function<bool (const Elem&)>& process_func) const { Point min_loc(query_pt.X - radius, query_pt.Y - radius); Point max_loc(query_pt.X + radius, query_pt.Y + radius); GridPoint min_grid = toGridPoint(min_loc); GridPoint max_grid = toGridPoint(max_loc); for (coord_t grid_y = min_grid.Y; grid_y <= max_grid.Y; ++grid_y) { for (coord_t grid_x = min_grid.X; grid_x <= max_grid.X; ++grid_x) { GridPoint grid_pt(grid_x,grid_y); bool continue_ = processFromCell(grid_pt, process_func); if (!continue_) { return; } } } } SGI_TEMPLATE void SGI_THIS::processLine(const std::pair<Point, Point> query_line, const std::function<bool (const Elem&)>& process_elem_func) const { const std::function<bool (const GridPoint&)> process_cell_func = [&process_elem_func, this](GridPoint grid_loc) { return processFromCell(grid_loc, process_elem_func); }; processLineCells(query_line, process_cell_func); } SGI_TEMPLATE std::vector<typename SGI_THIS::Elem> SGI_THIS::getNearby(const Point &query_pt, coord_t radius) const { std::vector<Elem> ret; const std::function<bool (const Elem&)> process_func = [&ret](const Elem &elem) { ret.push_back(elem); return true; }; processNearby(query_pt, radius, process_func); return ret; } SGI_TEMPLATE const std::function<bool(const typename SGI_THIS::Elem &)> SGI_THIS::no_precondition = [](const typename SGI_THIS::Elem &) { return true; }; SGI_TEMPLATE bool SGI_THIS::getNearest( const Point &query_pt, coord_t radius, Elem &elem_nearest, const std::function<bool(const Elem& elem)> precondition) const { bool found = false; int64_t best_dist2 = static_cast<int64_t>(radius) * radius; const std::function<bool (const Elem&)> process_func = [&query_pt, &elem_nearest, &found, &best_dist2, &precondition](const Elem &elem) { if (!precondition(elem)) { return true; } int64_t dist2 = vSize2(elem.point - query_pt); if (dist2 < best_dist2) { found = true; elem_nearest = elem; best_dist2 = dist2; } return true; }; processNearby(query_pt, radius, process_func); return found; } SGI_TEMPLATE coord_t SGI_THIS::getCellSize() const { return m_cell_size; } #undef SGI_TEMPLATE #undef SGI_THIS } // namespace cura #endif // UTILS_SPARSE_GRID_H
alephobjects/CuraEngine
src/utils/SparseGrid.h
C
agpl-3.0
14,509
define({ input: { eingabe: { gegenstandswert: 0 }, gebuehr: 0, hebesatz: { mittelwert: "", nenner: undefined, zaehler: undefined, zaehler_max: undefined, zaehler_min: undefined }, paragraph: "8", paragraph16: { checked: false }, tabelle: "Pauschal", taetigkeit: "Vorschuss (netto)" }, expectedOutput: { eingabe: { gegenstandswert: 0 }, gebuehr: 0, hebesatz: { mittelwert: "", nenner: undefined, zaehler: undefined, zaehler_max: undefined, zaehler_min: undefined }, paragraph: "8", paragraph16: { checked: false, value: 0 }, tabelle: "Pauschal", taetigkeit: "Vorschuss (netto)" } });
ohaz/amos-ss15-proj1
FlaskWebProject/static/scripts/rechner/spec/steuerberater-verguetung/testData1.js
JavaScript
agpl-3.0
763
<?php use yii\helpers\Url; \humhub\modules\space\assets\SpaceAsset::register($this); ?> <div class="modal-dialog modal-dialog-medium animated fadeIn"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title" id="myModalLabel"><?php echo Yii::t('SpaceModule.views_create_modules', 'Add <strong>Modules</strong>') ?></h4> </div> <div class="modal-body"> <br><br> <div class="row"> <?php foreach ($availableModules as $moduleId => $module): ?> <div class="col-md-6"> <div class="media well well-small "> <img class="media-object img-rounded pull-left" data-src="holder.js/64x64" alt="64x64" style="width: 64px; height: 64px;" src="<?php echo $module->getContentContainerImage($space); ?>"> <div class="media-body"> <h4 class="media-heading"><?php echo $module->getContentContainerName($space); ?> </h4> <p style="height: 35px;"><?php echo \humhub\libs\Helpers::truncateText($module->getContentContainerDescription($space), 75); ?></p> <?php $enable = ""; $disable = "hidden"; if ($space->isModuleEnabled($moduleId)) { $enable = "hidden"; if (!$space->canDisableModule($moduleId)) { $disable = "disabled"; } else { $disable = ""; } } ?> <a href="#" class="btn btn-sm btn-primary enable" data-action-click="content.container.enableModule" data-ui-loader data-action-url="<?= $space->createUrl('/space/manage/module/enable', ['moduleId' => $moduleId]) ?>"> <?= Yii::t('SpaceModule.views_admin_modules', 'Enable'); ?> </a> <a href="#" class="btn btn-sm btn-primary disable" style="display:none" data-action-click="content.container.disableModule" data-ui-loader data-action-url="<?= $space->createUrl('/space/manage/module/disable', ['moduleId' => $moduleId]) ?>"> <?= Yii::t('SpaceModule.views_admin_modules', 'Disable'); ?> </a> </div> </div> <br> </div> <?php endforeach; ?> </div> </div> <div class="modal-footer"> <a href="#" class="btn btn-primary" data-action-click="ui.modal.post" data-ui-loader data-action-url="<?= Url::to(['/space/create/invite', 'spaceId' => $space->id]) ?>"> <?= Yii::t('SpaceModule.views_create_create', 'Next'); ?> </a> </div> </div> </div>
GreenVolume/humhub-themes-MadeHub
views/space/create/modules.php
PHP
agpl-3.0
3,607
class RemoveUnnecessaryFieldsFromNlmodel < ActiveRecord::Migration def self.up remove_column :nlmodels, :contents remove_column :nlmodels, :note rename_column :nlmodels, :person_id, :creator_id end def self.down rename_column :nlmodels, :creator_id, :person_id add_column :nlmodels, :contents, :text add_column :nlmodels, :note, :text end end
reuven/modelingcommons
db/migrate/012_remove_unnecessary_fields_from_nlmodel.rb
Ruby
agpl-3.0
378
!function($, wysi) { "use strict"; var tpl = { "font-styles": function(locale, options) { var size = (options && options.size) ? ' btn-'+options.size : ''; return "<li class='dropdown'>" + "<a class='btn dropdown-toggle" + size + "' data-toggle='dropdown' href='#'>" + "<i class='icon-font'></i>&nbsp;<span class='current-font'>" + locale.font_styles.normal + "</span>&nbsp;<b class='caret'></b>" + "</a>" + "<ul class='dropdown-menu'>" + "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='div' tabindex='-1'>" + locale.font_styles.normal + "</a></li>" + "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h1' tabindex='-1'>" + locale.font_styles.h1 + "</a></li>" + "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h2' tabindex='-1'>" + locale.font_styles.h2 + "</a></li>" + "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h3' tabindex='-1'>" + locale.font_styles.h3 + "</a></li>" + "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h4'>" + locale.font_styles.h4 + "</a></li>" + "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h5'>" + locale.font_styles.h5 + "</a></li>" + "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h6'>" + locale.font_styles.h6 + "</a></li>" + "</ul>" + "</li>"; }, "emphasis": function(locale, options) { var size = (options && options.size) ? ' btn-'+options.size : ''; return "<li>" + "<div class='btn-group'>" + "<a class='btn" + size + "' data-wysihtml5-command='bold' title='CTRL+B' tabindex='-1'>" + locale.emphasis.bold + "</a>" + "<a class='btn" + size + "' data-wysihtml5-command='italic' title='CTRL+I' tabindex='-1'>" + locale.emphasis.italic + "</a>" + "<a class='btn" + size + "' data-wysihtml5-command='underline' title='CTRL+U' tabindex='-1'>" + locale.emphasis.underline + "</a>" + "</div>" + "</li>"; }, "lists": function(locale, options) { var size = (options && options.size) ? ' btn-'+options.size : ''; return "<li>" + "<div class='btn-group'>" + "<a class='btn" + size + "' data-wysihtml5-command='insertUnorderedList' title='" + locale.lists.unordered + "' tabindex='-1'><i class='icon-list'></i></a>" + "<a class='btn" + size + "' data-wysihtml5-command='insertOrderedList' title='" + locale.lists.ordered + "' tabindex='-1'><i class='icon-th-list'></i></a>" + "<a class='btn" + size + "' data-wysihtml5-command='Outdent' title='" + locale.lists.outdent + "' tabindex='-1'><i class='icon-indent-right'></i></a>" + "<a class='btn" + size + "' data-wysihtml5-command='Indent' title='" + locale.lists.indent + "' tabindex='-1'><i class='icon-indent-left'></i></a>" + "</div>" + "</li>"; }, "link": function(locale, options) { var size = (options && options.size) ? ' btn-'+options.size : ''; return "<li>" + "<div class='bootstrap-wysihtml5-insert-link-modal modal hide fade'>" + "<div class='modal-header'>" + "<a class='close' data-dismiss='modal'>&times;</a>" + "<h3>" + locale.link.insert + "</h3>" + "</div>" + "<div class='modal-body'>" + "<input value='http://' class='bootstrap-wysihtml5-insert-link-url input-xlarge'>" + "<label class='checkbox'> <input type='checkbox' class='bootstrap-wysihtml5-insert-link-target' checked>" + locale.link.target + "</label>" + "</div>" + "<div class='modal-footer'>" + "<a href='#' class='btn' data-dismiss='modal'>" + locale.link.cancel + "</a>" + "<a href='#' class='btn btn-primary' data-dismiss='modal'>" + locale.link.insert + "</a>" + "</div>" + "</div>" + "<a class='btn" + size + "' data-wysihtml5-command='createLink' title='" + locale.link.insert + "' tabindex='-1'><i class='icon-share'></i></a>" + "</li>"; }, "image": function(locale, options) { var size = (options && options.size) ? ' btn-'+options.size : ''; return "<li>" + "<div class='bootstrap-wysihtml5-insert-image-modal modal hide fade'>" + "<div class='modal-header'>" + "<a class='close' data-dismiss='modal'>&times;</a>" + "<h3>" + locale.image.insert + "</h3>" + "</div>" + "<div class='modal-body'>" + "<input value='http://' class='bootstrap-wysihtml5-insert-image-url input-xlarge'>" + "</div>" + "<div class='modal-footer'>" + "<a href='#' class='btn' data-dismiss='modal'>" + locale.image.cancel + "</a>" + "<a href='#' class='btn btn-primary' data-dismiss='modal'>" + locale.image.insert + "</a>" + "</div>" + "</div>" + "<a class='btn" + size + "' data-wysihtml5-command='insertImage' title='" + locale.image.insert + "' tabindex='-1'><i class='icon-picture'></i></a>" + "</li>"; }, "html": function(locale, options) { var size = (options && options.size) ? ' btn-'+options.size : ''; return "<li>" + "<div class='btn-group'>" + "<a class='btn" + size + "' data-wysihtml5-action='change_view' title='" + locale.html.edit + "' tabindex='-1'><i class='icon-pencil'></i></a>" + "</div>" + "</li>"; }, "color": function(locale, options) { var size = (options && options.size) ? ' btn-'+options.size : ''; return "<li class='dropdown'>" + "<a class='btn dropdown-toggle" + size + "' data-toggle='dropdown' href='#' tabindex='-1'>" + "<span class='current-color'>" + locale.colours.black + "</span>&nbsp;<b class='caret'></b>" + "</a>" + "<ul class='dropdown-menu'>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='black'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='black'>" + locale.colours.black + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='silver'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='silver'>" + locale.colours.silver + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='gray'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='gray'>" + locale.colours.gray + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='maroon'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='maroon'>" + locale.colours.maroon + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='red'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='red'>" + locale.colours.red + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='purple'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='purple'>" + locale.colours.purple + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='green'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='green'>" + locale.colours.green + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='olive'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='olive'>" + locale.colours.olive + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='navy'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='navy'>" + locale.colours.navy + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='blue'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='blue'>" + locale.colours.blue + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='orange'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='orange'>" + locale.colours.orange + "</a></li>" + "</ul>" + "</li>"; } }; var templates = function(key, locale, options) { return tpl[key](locale, options); }; var Wysihtml5 = function(el, options) { this.el = el; var toolbarOpts = options || defaultOptions; for(var t in toolbarOpts.customTemplates) { tpl[t] = toolbarOpts.customTemplates[t]; } this.toolbar = this.createToolbar(el, toolbarOpts); this.editor = this.createEditor(options); window.editor = this.editor; $('iframe.wysihtml5-sandbox').each(function(i, el){ $(el.contentWindow).off('focus.wysihtml5').on({ 'focus.wysihtml5' : function(){ $('li.dropdown').removeClass('open'); } }); }); }; Wysihtml5.prototype = { constructor: Wysihtml5, createEditor: function(options) { options = options || {}; // Add the toolbar to a clone of the options object so multiple instances // of the WYISYWG don't break because "toolbar" is already defined options = $.extend(true, {}, options); options.toolbar = this.toolbar[0]; var editor = new wysi.Editor(this.el[0], options); if(options && options.events) { for(var eventName in options.events) { editor.on(eventName, options.events[eventName]); } } return editor; }, createToolbar: function(el, options) { var self = this; var toolbar = $("<ul/>", { 'class' : "wysihtml5-toolbar", 'style': "display:none" }); var culture = options.locale || defaultOptions.locale || "en"; for(var key in defaultOptions) { var value = false; if(options[key] !== undefined) { if(options[key] === true) { value = true; } } else { value = defaultOptions[key]; } if(value === true) { toolbar.append(templates(key, locale[culture], options)); if(key === "html") { this.initHtml(toolbar); } if(key === "link") { this.initInsertLink(toolbar); } if(key === "image") { this.initInsertImage(toolbar); } } } if(options.toolbar) { for(key in options.toolbar) { toolbar.append(options.toolbar[key]); } } toolbar.find("a[data-wysihtml5-command='formatBlock']").click(function(e) { var target = e.target || e.srcElement; var el = $(target); self.toolbar.find('.current-font').text(el.html()); }); toolbar.find("a[data-wysihtml5-command='foreColor']").click(function(e) { var target = e.target || e.srcElement; var el = $(target); self.toolbar.find('.current-color').text(el.html()); }); this.el.before(toolbar); return toolbar; }, initHtml: function(toolbar) { var changeViewSelector = "a[data-wysihtml5-action='change_view']"; toolbar.find(changeViewSelector).click(function(e) { toolbar.find('a.btn').not(changeViewSelector).toggleClass('disabled'); }); }, initInsertImage: function(toolbar) { var self = this; var insertImageModal = toolbar.find('.bootstrap-wysihtml5-insert-image-modal'); var urlInput = insertImageModal.find('.bootstrap-wysihtml5-insert-image-url'); var insertButton = insertImageModal.find('a.btn-primary'); var initialValue = urlInput.val(); var caretBookmark; var insertImage = function() { var url = urlInput.val(); urlInput.val(initialValue); self.editor.currentView.element.focus(); if (caretBookmark) { self.editor.composer.selection.setBookmark(caretBookmark); caretBookmark = null; } self.editor.composer.commands.exec("insertImage", url); }; urlInput.keypress(function(e) { if(e.which == 13) { insertImage(); insertImageModal.modal('hide'); } }); insertButton.click(insertImage); insertImageModal.on('shown', function() { urlInput.focus(); }); insertImageModal.on('hide', function() { self.editor.currentView.element.focus(); }); toolbar.find('a[data-wysihtml5-command=insertImage]').click(function() { var activeButton = $(this).hasClass("wysihtml5-command-active"); if (!activeButton) { self.editor.currentView.element.focus(false); caretBookmark = self.editor.composer.selection.getBookmark(); insertImageModal.appendTo('body').modal('show'); insertImageModal.on('click.dismiss.modal', '[data-dismiss="modal"]', function(e) { e.stopPropagation(); }); return false; } else { return true; } }); }, initInsertLink: function(toolbar) { var self = this; var insertLinkModal = toolbar.find('.bootstrap-wysihtml5-insert-link-modal'); var urlInput = insertLinkModal.find('.bootstrap-wysihtml5-insert-link-url'); var targetInput = insertLinkModal.find('.bootstrap-wysihtml5-insert-link-target'); var insertButton = insertLinkModal.find('a.btn-primary'); var initialValue = urlInput.val(); var caretBookmark; var insertLink = function() { var url = urlInput.val(); urlInput.val(initialValue); self.editor.currentView.element.focus(); if (caretBookmark) { self.editor.composer.selection.setBookmark(caretBookmark); caretBookmark = null; } var newWindow = targetInput.prop("checked"); self.editor.composer.commands.exec("createLink", { 'href' : url, 'target' : (newWindow ? '_blank' : '_self'), 'rel' : (newWindow ? 'nofollow' : '') }); }; var pressedEnter = false; urlInput.keypress(function(e) { if(e.which == 13) { insertLink(); insertLinkModal.modal('hide'); } }); insertButton.click(insertLink); insertLinkModal.on('shown', function() { urlInput.focus(); }); insertLinkModal.on('hide', function() { self.editor.currentView.element.focus(); }); toolbar.find('a[data-wysihtml5-command=createLink]').click(function() { var activeButton = $(this).hasClass("wysihtml5-command-active"); if (!activeButton) { self.editor.currentView.element.focus(false); caretBookmark = self.editor.composer.selection.getBookmark(); insertLinkModal.appendTo('body').modal('show'); insertLinkModal.on('click.dismiss.modal', '[data-dismiss="modal"]', function(e) { e.stopPropagation(); }); return false; } else { return true; } }); } }; // these define our public api var methods = { resetDefaults: function() { $.fn.wysihtml5.defaultOptions = $.extend(true, {}, $.fn.wysihtml5.defaultOptionsCache); }, bypassDefaults: function(options) { return this.each(function () { var $this = $(this); $this.data('wysihtml5', new Wysihtml5($this, options)); }); }, shallowExtend: function (options) { var settings = $.extend({}, $.fn.wysihtml5.defaultOptions, options || {}, $(this).data()); var that = this; return methods.bypassDefaults.apply(that, [settings]); }, deepExtend: function(options) { var settings = $.extend(true, {}, $.fn.wysihtml5.defaultOptions, options || {}); var that = this; return methods.bypassDefaults.apply(that, [settings]); }, init: function(options) { var that = this; return methods.shallowExtend.apply(that, [options]); } }; $.fn.wysihtml5 = function ( method ) { if ( methods[method] ) { return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { return methods.init.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does not exist on jQuery.wysihtml5' ); } }; $.fn.wysihtml5.Constructor = Wysihtml5; var defaultOptions = $.fn.wysihtml5.defaultOptions = { "font-styles": true, "color": false, "emphasis": true, "lists": true, "html": false, "link": true, "image": true, events: {}, parserRules: { classes: { // (path_to_project/lib/css/wysiwyg-color.css) "wysiwyg-color-silver" : 1, "wysiwyg-color-gray" : 1, "wysiwyg-color-white" : 1, "wysiwyg-color-maroon" : 1, "wysiwyg-color-red" : 1, "wysiwyg-color-purple" : 1, "wysiwyg-color-fuchsia" : 1, "wysiwyg-color-green" : 1, "wysiwyg-color-lime" : 1, "wysiwyg-color-olive" : 1, "wysiwyg-color-yellow" : 1, "wysiwyg-color-navy" : 1, "wysiwyg-color-blue" : 1, "wysiwyg-color-teal" : 1, "wysiwyg-color-aqua" : 1, "wysiwyg-color-orange" : 1 }, tags: { "b": {}, "i": {}, "br": {}, "ol": {}, "ul": {}, "li": {}, "h1": {}, "h2": {}, "h3": {}, "h4": {}, "h5": {}, "h6": {}, "blockquote": {}, "u": 1, "img": { "check_attributes": { "width": "numbers", "alt": "alt", "src": "url", "height": "numbers" } }, "a": { check_attributes: { 'href': "url", // important to avoid XSS 'target': 'alt', 'rel': 'alt' } }, "span": 1, "div": 1, // to allow save and edit files with code tag hacks "code": 1, "pre": 1 } }, stylesheets: ["/assets/wysiwyg-color.css"], // (path_to_project/lib/css/wysiwyg-color.css) locale: "en" }; if (typeof $.fn.wysihtml5.defaultOptionsCache === 'undefined') { $.fn.wysihtml5.defaultOptionsCache = $.extend(true, {}, $.fn.wysihtml5.defaultOptions); } var locale = $.fn.wysihtml5.locale = { en: { font_styles: { normal: "Normal text", h1: "Heading 1", h2: "Heading 2", h3: "Heading 3", h4: "Heading 4", h5: "Heading 5", h6: "Heading 6" }, emphasis: { bold: "Bold", italic: "Italic", underline: "Underline" }, lists: { unordered: "Unordered list", ordered: "Ordered list", outdent: "Outdent", indent: "Indent" }, link: { insert: "Insert link", cancel: "Cancel", target: "Open link in new window" }, image: { insert: "Insert image", cancel: "Cancel" }, html: { edit: "Edit HTML" }, colours: { black: "Black", silver: "Silver", gray: "Grey", maroon: "Maroon", red: "Red", purple: "Purple", green: "Green", olive: "Olive", navy: "Navy", blue: "Blue", orange: "Orange" } } }; }(window.jQuery, window.wysihtml5);
andrewkrug/artfully_ose
app/assets/javascripts/bootstrap-wysihtml5.js
JavaScript
agpl-3.0
22,846
<?php /*$Id: MRPReschedules.php 6310 2013-08-29 10:42:50Z daintree $ */ // MRPReschedules.php - Report of purchase orders and work orders that MRP determines should be // rescheduled. include('includes/session.inc'); $sql="SHOW TABLES WHERE Tables_in_" . $_SESSION['DatabaseName'] . "='mrprequirements'"; $result=DB_query($sql,$db); if (DB_num_rows($result)==0) { $Title='MRP error'; include('includes/header.inc'); echo '<br />'; prnMsg( _('The MRP calculation must be run before you can run this report') . '<br />' . _('To run the MRP calculation click').' ' . '<a href='.$RootPath .'/MRP.php?' . SID .'>' . _('here') . '</a>', 'error'); include('includes/footer.inc'); exit; } if (isset($_POST['PrintPDF'])) { include('includes/PDFStarter.php'); $pdf->addInfo('Title',_('MRP Reschedule Report')); $pdf->addInfo('Subject',_('MRP Reschedules')); $FontSize=9; $PageNumber=1; $line_height=12; /*Find mrpsupplies records where the duedate is not the same as the mrpdate */ $selecttype = " "; if ($_POST['Selection'] != 'All') { $selecttype = " AND ordertype = '" . $_POST['Selection'] . "'"; } $sql = "SELECT mrpsupplies.*, stockmaster.description, stockmaster.decimalplaces FROM mrpsupplies,stockmaster WHERE mrpsupplies.part = stockmaster.stockid AND duedate <> mrpdate $selecttype ORDER BY mrpsupplies.part"; $result = DB_query($sql,$db,'','',false,true); if (DB_error_no($db) !=0) { $Title = _('MRP Reschedules') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The MRP reschedules could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $sql; } include('includes/footer.inc'); exit; } if (DB_num_rows($result) == 0) { $Title = _('MRP Reschedules') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('No MRP reschedule retrieved'), 'warn'); echo '<br /><a href="' .$RootPath .'/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $sql; } include('includes/footer.inc'); exit; } PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin); $Tot_Val=0; $fill = false; $pdf->SetFillColor(224,235,255); While ($myrow = DB_fetch_array($result,$db)){ $YPos -=$line_height; $FontSize=8; $FormatedDueDate = ConvertSQLDate($myrow['duedate']); $FormatedMRPDate = ConvertSQLDate($myrow['mrpdate']); if ($myrow['mrpdate'] == '2050-12-31') { $FormatedMRPDate = 'Cancel'; } // Use to alternate between lines with transparent and painted background if ($_POST['Fill'] == 'yes'){ $fill=!$fill; } // Parameters for addTextWrap are defined in /includes/class.pdf.php // 1) X position 2) Y position 3) Width // 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor // and False to set to transparent $pdf->addTextWrap($Left_Margin,$YPos,90,$FontSize,$myrow['part'],'',0,$fill); $pdf->addTextWrap(130,$YPos,200,$FontSize,$myrow['description'],'',0,$fill); $pdf->addTextWrap(330,$YPos,50,$FontSize,$myrow['orderno'],'right',0,$fill); $pdf->addTextWrap(380,$YPos,30,$FontSize,$myrow['ordertype'],'right',0,$fill); $pdf->addTextWrap(410,$YPos,50,$FontSize,locale_number_format($myrow['supplyquantity'], $myrow['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(460,$YPos,55,$FontSize,$FormatedDueDate,'right',0,$fill); $pdf->addTextWrap(515,$YPos,50,$FontSize,$FormatedMRPDate,'right',0,$fill); if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin); } } /*end while loop */ $FontSize =10; $YPos -= (2*$line_height); if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin); } $pdf->OutputD($_SESSION['DatabaseName'] . '_MRPReschedules_' . date('Y-m-d').'.pdf'); $pdf->__destruct(); } else { /*The option to print PDF was not hit so display form */ $Title=_('MRP Reschedule Reporting'); include('includes/header.inc'); echo '<p class="page_title_text"> <img src="'.$RootPath.'/css/'.$Theme.'/images/inventory.png" title="' . _('Stock') . '" alt="" />' . ' ' . $Title . ' </p>'; echo '<br /> <br /> <form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post"> <div> <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> <table class="selection"> <tr> <td>' . _('Print Option') . ':</td> <td><select name="Fill"> <option selected="selected" value="yes">' . _('Print With Alternating Highlighted Lines') . '</option> <option value="no">' . _('Plain Print') . '</option> </select></td> </tr> <tr> <td>' . _('Selection') . ':</td> <td><select name="Selection"> <option selected="selected" value="All">' . _('All') . '</option> <option value="WO">' . _('Work Orders Only') . '</option> <option value="PO">' . _('Purchase Orders Only') . '</option> </select></td> </tr> </table> <br /> <div class="centre"> <input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" /> </div> </div> </form>'; include('includes/footer.inc'); } /*end of else not PrintPDF */ function PrintHeader(&$pdf,&$YPos,&$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, $Page_Width,$Right_Margin) { $line_height=12; /*PDF page header for MRP Reschedule report */ if ($PageNumber>1){ $pdf->newPage(); } $FontSize=9; $YPos= $Page_Height-$Top_Margin; $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,$_SESSION['CompanyRecord']['coyname']); $YPos -=$line_height; $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,_('MRP Reschedule Report')); $pdf->addTextWrap($Page_Width-$Right_Margin-115,$YPos,160,$FontSize,_('Printed') . ': ' . Date($_SESSION['DefaultDateFormat']) . ' ' . _('Page') . ' ' . $PageNumber); $YPos -=$line_height; $pdf->addTextWrap($Left_Margin,$YPos,70,$FontSize,_('Selection:')); $pdf->addTextWrap(90,$YPos,15,$FontSize,$_POST['Selection']); $YPos -=(2*$line_height); /*set up the headings */ $Xpos = $Left_Margin+1; $pdf->addTextWrap($Xpos,$YPos,135,$FontSize,_('Part Number'), 'left'); $pdf->addTextWrap(135,$YPos,195,$FontSize,_('Description'), 'left'); $pdf->addTextWrap(330,$YPos,50,$FontSize,_('Order No.'), 'right'); $pdf->addTextWrap(380,$YPos,35,$FontSize,_('Type'), 'right'); $pdf->addTextWrap(415,$YPos,45,$FontSize,_('Quantity'), 'right'); $pdf->addTextWrap(460,$YPos,55,$FontSize,_('Order Date'), 'right'); $pdf->addTextWrap(515,$YPos,50,$FontSize,_('MRP Date'), 'right'); $FontSize=8; $YPos =$YPos - (2*$line_height); $PageNumber++; } // End of PrintHeader function ?>
RajkumarSelvaraju/FixNix_CRM
erp/MRPReschedules.php
PHP
agpl-3.0
7,165
/****************************************************************************** Copyright Härnösands kommun(C) 2014 This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Affero General Public License * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/agpl-3.0.html ******************************************************************************/ /** * Full extent configuration details */ Ext.define('AdmClient.view.mapconfiguration.tools.details.FullExtent', { extend : 'Ext.panel.Panel', alias : 'widget.fullextent', initComponent : function() { this.items = [ { xtype : 'button', text : 'FullExtent' } ]; this.callParent(arguments); } });
Sundsvallskommun/OpenEMap-Admin-WebUserInterface
src/main/javascript/view/mapconfiguration/tools/details/FullExtent.js
JavaScript
agpl-3.0
1,441
# Copyright 2016 Cloudbase Solutions Srl # All Rights Reserved. from coriolis import utils from coriolis.conductor.rpc import client as rpc_conductor_client from coriolis.minion_manager.rpc import client as rpc_minion_manager_client class API(object): def __init__(self): self._rpc_conductor_client = rpc_conductor_client.ConductorClient() self._rpc_minion_manager_client = ( rpc_minion_manager_client.MinionManagerClient()) def create(self, ctxt, name, endpoint_type, description, connection_info, mapped_regions): return self._rpc_conductor_client.create_endpoint( ctxt, name, endpoint_type, description, connection_info, mapped_regions) def update(self, ctxt, endpoint_id, properties): return self._rpc_conductor_client.update_endpoint( ctxt, endpoint_id, properties) def delete(self, ctxt, endpoint_id): self._rpc_conductor_client.delete_endpoint(ctxt, endpoint_id) def get_endpoints(self, ctxt): return self._rpc_conductor_client.get_endpoints(ctxt) def get_endpoint(self, ctxt, endpoint_id): return self._rpc_conductor_client.get_endpoint(ctxt, endpoint_id) def validate_connection(self, ctxt, endpoint_id): return self._rpc_conductor_client.validate_endpoint_connection( ctxt, endpoint_id) @utils.bad_request_on_error("Invalid destination environment: %s") def validate_target_environment(self, ctxt, endpoint_id, target_env): return self._rpc_conductor_client.validate_endpoint_target_environment( ctxt, endpoint_id, target_env) @utils.bad_request_on_error("Invalid source environment: %s") def validate_source_environment(self, ctxt, endpoint_id, source_env): return self._rpc_conductor_client.validate_endpoint_source_environment( ctxt, endpoint_id, source_env) @utils.bad_request_on_error("Invalid source minion pool environment: %s") def validate_endpoint_source_minion_pool_options( self, ctxt, endpoint_id, pool_environment): return self._rpc_minion_manager_client.validate_endpoint_source_minion_pool_options( ctxt, endpoint_id, pool_environment) @utils.bad_request_on_error( "Invalid destination minion pool environment: %s") def validate_endpoint_destination_minion_pool_options( self, ctxt, endpoint_id, pool_environment): return self._rpc_minion_manager_client.validate_endpoint_destination_minion_pool_options( ctxt, endpoint_id, pool_environment)
cloudbase/coriolis
coriolis/endpoints/api.py
Python
agpl-3.0
2,592
require 'rails_helper' RSpec.describe "competence_matrices/new", :type => :view do before(:each) do assign(:competence_matrix, FactoryGirl.build(:competence_matrix)) end it "renders new competence_matrix form" do render assert_select "form[action=?][method=?]", competence_matrices_path, "post" do assert_select "input#competence_matrix_name[name=?]", "competence_matrix[name]" end end end
SYSCOMA/SYSCOMA
spec/views/competence_matrices/new.html.erb_spec.rb
Ruby
agpl-3.0
422
// Copyright 2012, 2013 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package main import ( "errors" "fmt" "launchpad.net/gnuflag" "launchpad.net/juju-core/cmd" "launchpad.net/juju-core/juju" "launchpad.net/juju-core/state/api/params" "launchpad.net/juju-core/state/statecmd" ) // UnitCommandBase provides support for commands which deploy units. It handles the parsing // and validation of --to and --num-units arguments. type UnitCommandBase struct { ToMachineSpec string NumUnits int } func (c *UnitCommandBase) SetFlags(f *gnuflag.FlagSet) { f.IntVar(&c.NumUnits, "num-units", 1, "") f.StringVar(&c.ToMachineSpec, "to", "", "the machine or container to deploy the unit in, bypasses constraints") } func (c *UnitCommandBase) Init(args []string) error { if c.NumUnits < 1 { return errors.New("--num-units must be a positive integer") } if c.ToMachineSpec != "" { if c.NumUnits > 1 { return errors.New("cannot use --num-units > 1 with --to") } if !cmd.IsMachineOrNewContainer(c.ToMachineSpec) { return fmt.Errorf("invalid --to parameter %q", c.ToMachineSpec) } } return nil } // AddUnitCommand is responsible adding additional units to a service. type AddUnitCommand struct { cmd.EnvCommandBase UnitCommandBase ServiceName string } const addUnitDoc = ` Service units can be added to a specific machine using the --to argument. Examples: juju add-unit mysql --to 23 (Add unit to machine 23) juju add-unit mysql --to 24/lxc/3 (Add unit to lxc container 3 on host machine 24) juju add-unit mysql --to lxc:25 (Add unit to a new lxc container on host machine 25) ` func (c *AddUnitCommand) Info() *cmd.Info { return &cmd.Info{ Name: "add-unit", Args: "<service name>", Purpose: "add a service unit", Doc: addUnitDoc, } } func (c *AddUnitCommand) SetFlags(f *gnuflag.FlagSet) { c.EnvCommandBase.SetFlags(f) c.UnitCommandBase.SetFlags(f) f.IntVar(&c.NumUnits, "n", 1, "number of service units to add") } func (c *AddUnitCommand) Init(args []string) error { switch len(args) { case 1: c.ServiceName = args[0] case 0: return errors.New("no service specified") } if err := cmd.CheckEmpty(args[1:]); err != nil { return err } return c.UnitCommandBase.Init(args) } // Run connects to the environment specified on the command line // and calls conn.AddUnits. func (c *AddUnitCommand) Run(_ *cmd.Context) error { conn, err := juju.NewConnFromName(c.EnvName) if err != nil { return err } defer conn.Close() params := params.AddServiceUnits{ ServiceName: c.ServiceName, NumUnits: c.NumUnits, ToMachineSpec: c.ToMachineSpec, } _, err = statecmd.AddServiceUnits(conn.State, params) return err }
hivetech/judo
juju-core/cmd/juju/addunit.go
GO
agpl-3.0
2,731
""" Global settings file. Everything in here is imported *before* everything in settings.py. This means that this file is used for default, fixed and global varibles, and then settings.py is used to overwrite anything here as well as adding settings particular to the install. Note that there are no tuples here, as they are immutable. Please use lists, so that in settings.py we can do list.append() """ import os from os.path import exists, join # This shouldn't be needed, however in some cases the buildout version of # django (in bin/django) may not make the paths correctly import sys sys.path.append('web') # Django settings for scraperwiki project. DEBUG = True TIME_ZONE = 'Europe/London' LANGUAGE_CODE = 'en_GB' SITE_ID = 1 # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. USE_I18N = False # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" HOME_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # the parent directory of SCRAPERWIKI_DIR SCRAPERWIKI_DIR = HOME_DIR + '/web/' MEDIA_DIR = SCRAPERWIKI_DIR + 'media' MEDIA_URL = 'http://media.scraperwiki.com/' MEDIA_ADMIN_DIR = SCRAPERWIKI_DIR + '/media-admin' LOGIN_URL = '/login/' HOME_DIR = "" # MySQL default overdue scraper query OVERDUE_SQL = "(DATE_ADD(last_run, INTERVAL run_interval SECOND) < NOW() or last_run is null)" OVERDUE_SQL_PARAMS = [] # URL that handles the media served from MEDIA_ROOT. Make sure to use a trailing slash. URL_ROOT = "" MEDIA_ROOT = URL_ROOT + 'media/' # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a trailing slash. ADMIN_MEDIA_PREFIX = URL_ROOT + '/media-admin/' # Make this unique, and don't share it with anybody. SECRET_KEY = 'x*#sb54li2y_+b-ibgyl!lnd^*#=bzv7bj_ypr2jvon9mwii@z' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( ('django.template.loaders.cached.Loader', ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', )), ) MIDDLEWARE_CLASSES = [ 'middleware.exception_logging.ExceptionLoggingMiddleware', 'middleware.improved_gzip.ImprovedGZipMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django_notify.middleware.NotificationsMiddleware', 'pagination.middleware.PaginationMiddleware', 'middleware.csrfcookie.CsrfAlwaysSetCookieMiddleware', 'api.middleware.CORSMiddleware' ] AUTHENTICATION_BACKENDS = [ 'frontend.email_auth.EmailOrUsernameModelBackend', 'django.contrib.auth.backends.ModelBackend' ] ROOT_URLCONF = 'urls' TEMPLATE_DIRS = [ join(SCRAPERWIKI_DIR, 'templates'), ] TEMPLATE_CONTEXT_PROCESSORS = [ 'django.contrib.auth.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'django.core.context_processors.request', 'django.contrib.messages.context_processors.messages', 'django_notify.context_processors.notifications', 'frontend.context_processors.site', 'frontend.context_processors.template_settings', 'frontend.context_processors.vault_info', # 'frontend.context_processors.site_messages', # disabled as not used since design revamp April 2011 ] SCRAPERWIKI_APPS = [ # the following are scraperwiki apps 'frontend', 'codewiki', 'api', 'cropper', 'kpi', 'documentation', #'devserver', ] INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.comments', 'django.contrib.markup', 'registration', 'south', 'profiles', 'django.contrib.humanize', 'django.contrib.messages', 'django_notify', 'tagging', 'contact_form', 'captcha', 'pagination', 'compressor', ] + SCRAPERWIKI_APPS TEST_RUNNER = 'scraperwiki_tests.run_tests' ACCOUNT_ACTIVATION_DAYS = 3650 # If you haven't activated in 10 years then tough luck! # tell Django that the frontent user_profile model is to be attached to the # user model in the admin side. AUTH_PROFILE_MODULE = 'frontend.UserProfile' INTERNAL_IPS = ['127.0.0.1',] NOTIFICATIONS_STORAGE = 'session.SessionStorage' REGISTRATION_BACKEND = "frontend.backends.UserWithNameBackend" #tagging FORCE_LOWERCASE_TAGS = True # define default directories needed for paths to run scrapers SCRAPER_LIBS_DIR = join(HOME_DIR, "scraperlibs") #send broken link emails SEND_BROKEN_LINK_EMAILS = DEBUG == False #pagingation SCRAPERS_PER_PAGE = 50 #API MAX_API_ITEMS = 500 DEFAULT_API_ITEMS = 100 # Make "view on site" work for user models # https://docs.djangoproject.com/en/dev/ref/settings/?#absolute-url-overrides ABSOLUTE_URL_OVERRIDES = { 'auth.user': lambda o: o.get_profile().get_absolute_url() } # Required for the template_settings context processor. Each varible listed # here will be made availible in all templates that are passed the # RequestContext. Be careful of listing database and other private settings # here TEMPLATE_SETTINGS = [ 'API_URL', 'ORBITED_URL', 'MAX_DATA_POINTS', 'MAX_MAP_POINTS', 'REVISION', 'VIEW_URL', 'CODEMIRROR_URL' ] try: REVISION = open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'revision.txt')).read()[:-1] except: REVISION = "" MAX_DATA_POINTS = 500 BLOG_FEED = 'http://blog.scraperwiki.com/feed/atom' DATA_TABLE_ROWS = 10 RSS_ITEMS = 50 VIEW_SCREENSHOT_SIZES = {'small': (110, 73), 'medium': (220, 145), 'large': (800, 600)} SCRAPER_SCREENSHOT_SIZES = {'small': (110, 73), 'medium': (220, 145) } CODEMIRROR_VERSION = "0.94" CODEMIRROR_URL = "CodeMirror-%s/" % CODEMIRROR_VERSION APPROXLENOUTPUTLIMIT = 3000 CONFIGFILE = "/var/www/scraperwiki/uml/uml.cfg" HTTPPROXYURL = "http://localhost:9005" DISPATCHERURL = "http://localhost:9000" PAGINATION_DEFAULT_PAGINATION=20 # tell south to do migrations when doing tests SOUTH_TESTS_MIGRATE = True # To be overridden in actual settings files SESSION_COOKIE_SECURE = False # Enable logging of errors to text file, taken from: # http://stackoverflow.com/questions/238081/how-do-you-log-server-errors-on-django-sites import logging from middleware import exception_logging logging.custom_handlers = exception_logging LOGGING = { 'version': 1, 'disable_existing_loggers': True, 'formatters': { 'simple': { 'format' : '%(asctime)s %(name)s %(filename)s:%(lineno)s %(levelname)s: %(message)s' } }, 'handlers': { # Include the default Django email handler for errors # This is what you'd get without configuring logging at all. 'mail_admins': { 'class': 'django.utils.log.AdminEmailHandler', 'level': 'ERROR', # But the emails are plain text by default - HTML is nicer 'include_html': True, }, # Log to a text file that can be rotated by logrotate 'logfile': { 'class': 'logging.custom_handlers.WorldWriteRotatingFileHandler', 'filename': '/var/log/scraperwiki/django-www.log', 'mode': 'a', 'maxBytes': 100000, 'backupCount': 5, 'formatter': 'simple' }, }, 'loggers': { # Again, default Django configuration to email unhandled exceptions 'django.request': { 'handlers': ['mail_admins'], 'level': 'ERROR', 'propagate': True, }, # Might as well log any errors anywhere else in Django # (so use empty string for name here to catch anything) '': { 'handlers': ['logfile'], 'level': DEBUG and 'DEBUG' or 'ERROR', 'propagate': False, }, # Your own app - this assumes all your logger names start with "myapp." #'myapp': { # 'handlers': ['logfile'], # 'level': 'WARNING', # Or maybe INFO or DEBUG # 'propagate': False #}, }, } # Javascript templating INSTALLED_APPS += ['icanhaz'] ICANHAZ_DIRS = [SCRAPERWIKI_DIR + 'templates/codewiki/js/']
lkundrak/scraperwiki
web/global_settings.py
Python
agpl-3.0
8,733
<?php declare(strict_types=1); namespace App\Controller; use App\Repository\AccountRepository; use App\Service\PageParamsService; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Doctrine\DBAL\Connection as Db; use Doctrine\DBAL\Types\Types; use Symfony\Component\Routing\Annotation\Route; class WeightedBalancesController extends AbstractController { #[Route( '/{system}/{role_short}/weighted-balances/{days}', name: 'weighted_balances', methods: ['GET'], requirements: [ 'days' => '%assert.id%', 'system' => '%assert.system%', 'role_short' => '%assert.role_short.admin%', ], defaults: [ 'module' => 'transactions', ], )] public function __invoke( int $days, Db $db, AccountRepository $account_repository, PageParamsService $pp ):Response { $end_unix = time(); $begin_unix = $end_unix - ($days * 86400); $begin_datetime = \DateTimeImmutable::createFromFormat('U', (string) $begin_unix); $balance_ary = $account_repository->get_balance_ary($pp->schema()); $balance = []; $stmt = $db->prepare('select id from ' . $pp->schema() . '.users'); $res = $stmt->executeQuery(); while ($row = $res->fetchAssociative()) { $balance[$row['id']] = $balance_ary[$row['id']] ?? 0; } $next = array_map(function () use ($end_unix){ return $end_unix; }, $balance); $acc = array_map(function (){ return 0; }, $balance); $trans = $db->fetchAllAssociative('select id_to, id_from, amount, created_at from ' . $pp->schema() . '.transactions where created_at >= ? order by created_at desc', [$begin_datetime], [Types::DATETIME_IMMUTABLE]); foreach ($trans as $t) { $id_to = $t['id_to']; $id_from = $t['id_from']; $time = strtotime($t['created_at'] . ' UTC'); $period_to = $next[$id_to] - $time; $period_from = $next[$id_from] - $time; $acc[$id_to] += ($period_to) * $balance[$id_to]; $next[$id_to] = $time; $balance[$id_to] -= $t['amount']; $acc[$id_from] += ($period_from) * $balance[$id_from]; $next[$id_from] = $time; $balance[$id_from] += $t['amount']; } $weighted = []; foreach ($balance as $user_id => $b) { $acc[$user_id] += ($next[$user_id] - $begin_unix) * $b; $weighted[$user_id] = round($acc[$user_id] / ($days * 86400)); } return $this->json($weighted); } }
eeemarv/eland
src/Controller/WeightedBalancesController.php
PHP
agpl-3.0
2,822
<?php //WARNING: The contents of this file are auto-generated include('custom/metadata/aos_products_bh_case_compound_1MetaData.php'); ?>
ByersHouse/crmwork
custom/Extension/application/Ext/TableDictionary/aos_products_bh_case_compound_1.php
PHP
agpl-3.0
139
<?php class Users_Device_Chrome extends Users_Device { /** * You can use this method to send push notifications. * It is far better, however, to use the Qbix Platform's offline notification * mechanisms using Node.js instead of PHP. That way, you can be sure of re-using * the same persistent connection. * @method pushNotification * @param {array} $notification See Users_Device->pushNotification parameters * @param {array} [$options] See Users_Device->pushNotification parameters */ function handlePushNotification($notification, $options = array()) { self::$push[] = Users_Device_Web::prepare($notification); } /** * Sends all scheduled push notifications * @method sendPushNotifications * @static * @throws Users_Exception_DeviceNotification */ static function sendPushNotifications() { if (!self::$push) { return; } Users_Device_Web::send(self::$device, self::$push); self::$push = []; } static protected $push = []; static $device = null; }
jkokh/Platform
platform/plugins/Users/classes/Users/Device/Chrome.php
PHP
agpl-3.0
1,002
body { padding-top: 0; } #jasmine_content { width: 1000px; height: 1000px; position: absolute; -webkit-transform: rotateY(-90deg); -moz-transform: rotateY(-90deg); -ms-transform: rotateY(-90deg); transform: rotateY(-90deg); }
maco/growstuff
spec/javascripts/support/jasmine.css
CSS
agpl-3.0
258
#!/bin/env ruby # encoding: utf-8 #07-2013 Migration in Ruby On Rails 3.2 by Benjamin Ninassi class Echeancier < ActiveRecord::Base belongs_to :echeanciable, :polymorphic => true has_many :echeancier_periodes, :dependent => :destroy validates_presence_of :global_depenses_frais_gestion, :message => "Le champ <strong>frais de gestion</strong> est un champ obligatoire, merci de le renseigner" validates_numericality_of :global_depenses_frais_gestion, :message => "Le champ <strong>frais de gestion</strong> doit être un nombre" validates_each :echeancier_periodes do |echeancier, attr, value| echeancier.errors.add_to_base "Un échancier ne peut avoir plus de " + MAX_PERIODS_COUNT.to_s + " périodes" if echeancier.echeancier_periodes.size > MAX_PERIODS_COUNT end attr_accessible :global_depenses_frais_gestion, :echeanciable_type, :echeanciable_id before_update 'self.updated_by = User.current_user.id' before_create 'self.created_by = User.current_user.id', 'self.updated_by = User.current_user.id' #Surcharge de la methode de copie def clone new_echeancier = self.dup for periode in self.echeancier_periodes do new_periode= periode.dup new_periode.verrou = 'Aucun' new_periode.verrou_listchamps = nil new_echeancier.echeancier_periodes << new_periode end new_echeancier.verrou = 'Aucun' new_echeancier.verrou_listchamps = nil return new_echeancier end # ---- credit & solde_credit def credit if self.echeanciable_type == "Contrat" Contrat.find_by_id(self.echeanciable_id).notification.ma_total else SousContrat.find_by_id(self.echeanciable_id).sous_contrat_notification.ma_total end end def solde_credit if !self.echeancier_periodes.sum(:credit).nil? self.credit - self.echeancier_periodes.sum(:credit) else self.credit end end # ---- depenses_non_ventile & solde_depenses_non_ventile def depenses_non_ventile if self.echeanciable_type == "Contrat" Contrat.find_by_id(self.echeanciable_id).notification.ma_non_ventile else SousContrat.find_by_id(self.echeanciable_id).sous_contrat_notification.ma_non_ventile end end def solde_depenses_non_ventile if !self.echeancier_periodes.sum(:depenses_non_ventile).nil? self.depenses_non_ventile - self.echeancier_periodes.sum(:depenses_non_ventile) else self.depenses_non_ventile end end # ---- depenses_commun & solde_depenses_commun def depenses_commun if self.echeanciable_type == "Contrat" Contrat.find_by_id(self.echeanciable_id).notification.ma_total else SousContrat.find_by_id(self.echeanciable_id).sous_contrat_notification.ma_total end end def solde_depenses_commun if !self.echeancier_periodes.sum(:depenses_commun).nil? self.depenses_commun - self.echeancier_periodes.sum(:depenses_commun) else self.depenses_commun end end # ---- depenses_fonctionnement & solde_depenses_fonctionnement def depenses_fonctionnement if self.echeanciable_type == "Contrat" Contrat.find_by_id(self.echeanciable_id).notification.ma_fonctionnement else SousContrat.find_by_id(self.echeanciable_id).sous_contrat_notification.ma_fonctionnement end end def solde_depenses_fonctionnement if !self.echeancier_periodes.sum(:depenses_fonctionnement).nil? self.depenses_fonctionnement - self.echeancier_periodes.sum(:depenses_fonctionnement) else self.depenses_fonctionnement end end # --- depenses_equipement & solde_depenses_equipement def depenses_equipement if self.echeanciable_type == "Contrat" Contrat.find_by_id(self.echeanciable_id).notification.ma_equipement else SousContrat.find_by_id(self.echeanciable_id).sous_contrat_notification.ma_equipement end end def solde_depenses_equipement if !self.echeancier_periodes.sum(:depenses_equipement).nil? self.depenses_equipement - self.echeancier_periodes.sum(:depenses_equipement) else self.depenses_equipement end end # ---- depenses_salaires & solde_depenses_salaires def depenses_salaires if self.echeanciable_type == "Contrat" Contrat.find_by_id(self.echeanciable_id).notification.ma_salaire else SousContrat.find_by_id(self.echeanciable_id).sous_contrat_notification.ma_salaire end end def solde_depenses_salaires if !self.echeancier_periodes.sum(:depenses_salaires).nil? self.depenses_salaires - self.echeancier_periodes.sum(:depenses_salaires) else self.depenses_salaires end end # ---- depenses_missions & solde_depenses_missions def depenses_missions if self.echeanciable_type == "Contrat" Contrat.find_by_id(self.echeanciable_id).notification.ma_mission else SousContrat.find_by_id(self.echeanciable_id).sous_contrat_notification.ma_mission end end def solde_depenses_missions if !self.echeancier_periodes.sum(:depenses_missions).nil? self.depenses_missions - self.echeancier_periodes.sum(:depenses_missions) else self.depenses_missions end end # ---- depenses_couts_indirects & solde_depenses_couts_indirects def depenses_couts_indirects if self.echeanciable_type == "Contrat" Contrat.find_by_id(self.echeanciable_id).notification.ma_couts_indirects else SousContrat.find_by_id(self.echeanciable_id).sous_contrat_notification.ma_couts_indirects end end def solde_depenses_couts_indirects if !self.echeancier_periodes.sum(:depenses_couts_indirects).nil? self.depenses_couts_indirects - self.echeancier_periodes.sum(:depenses_couts_indirects) else self.depenses_couts_indirects end end # ---- depenses_frais_gestion_mut & solde_depenses_frais_gestion_mut def depenses_frais_gestion_mut if self.echeanciable_type == "Contrat" Contrat.find_by_id(self.echeanciable_id).notification.ma_frais_gestion_mutualises else SousContrat.find_by_id(self.echeanciable_id).sous_contrat_notification.ma_frais_gestion_mutualises end end def solde_depenses_frais_gestion_mut if !self.echeancier_periodes.sum(:depenses_frais_gestion_mut).nil? self.depenses_frais_gestion_mut - self.echeancier_periodes.sum(:depenses_frais_gestion_mut) else self.depenses_frais_gestion_mut end end def depenses_frais_gestion_mut_local if self.echeanciable_type == "Contrat" Contrat.find_by_id(self.echeanciable_id).notification.ma_frais_gestion_mutualises_local else SousContrat.find_by_id(self.echeanciable_id).sous_contrat_notification.ma_frais_gestion_mutualises_local end end def solde_depenses_frais_gestion_mut_local if !self.echeancier_periodes.sum(:depenses_frais_gestion_mut_local).nil? self.depenses_frais_gestion_mut_local - self.echeancier_periodes.sum(:depenses_frais_gestion_mut_local) else self.depenses_frais_gestion_mut_local end end # ---- solde_depenses_frais_gestion def solde_depenses_frais_gestion if !self.echeancier_periodes.sum(:depenses_frais_gestion).nil? self.global_depenses_frais_gestion - self.echeancier_periodes.sum(:depenses_frais_gestion) else self.global_depenses_frais_gestion end end # ---- allocations & solde_allocations def allocations if self.echeanciable_type == "Contrat" Contrat.find_by_id(self.echeanciable_id).notification.ma_allocation else SousContrat.find_by_id(self.echeanciable_id).sous_contrat_notification.ma_allocation end end def solde_allocations if !self.echeancier_periodes.sum(:allocations).nil? self.allocations.to_i - self.echeancier_periodes.sum(:allocations) else self.allocations.to_i end end end
INRIA/osc
app/models/echeancier.rb
Ruby
agpl-3.0
7,950
DELETE FROM `weenie` WHERE `class_Id` = 10287; INSERT INTO `weenie` (`class_Id`, `class_Name`, `type`, `last_Modified`) VALUES (10287, 'housecottage595', 53, '2019-02-10 00:00:00') /* House */; INSERT INTO `weenie_properties_int` (`object_Id`, `type`, `value`) VALUES (10287, 1, 128) /* ItemType - Misc */ , (10287, 5, 10) /* EncumbranceVal */ , (10287, 16, 1) /* ItemUseable - No */ , (10287, 93, 52) /* PhysicsState - Ethereal, IgnoreCollisions, NoDraw */ , (10287, 155, 1) /* HouseType - Cottage */ , (10287, 8041, 101) /* PCAPRecordedPlacement - Resting */; INSERT INTO `weenie_properties_bool` (`object_Id`, `type`, `value`) VALUES (10287, 1, True ) /* Stuck */ , (10287, 24, True ) /* UiHidden */; INSERT INTO `weenie_properties_float` (`object_Id`, `type`, `value`) VALUES (10287, 39, 0.1) /* DefaultScale */; INSERT INTO `weenie_properties_string` (`object_Id`, `type`, `value`) VALUES (10287, 1, 'Cottage') /* Name */; INSERT INTO `weenie_properties_d_i_d` (`object_Id`, `type`, `value`) VALUES (10287, 1, 33557058) /* Setup */ , (10287, 8, 100671873) /* Icon */ , (10287, 30, 152) /* PhysicsScript - RestrictionEffectBlue */ , (10287, 8001, 203423760) /* PCAPRecordedWeenieHeader - Usable, Burden, HouseRestrictions, PScript */ , (10287, 8003, 148) /* PCAPRecordedObjectDesc - Stuck, Attackable, UiHidden */ , (10287, 8005, 163969) /* PCAPRecordedPhysicsDesc - CSetup, ObjScale, Position, AnimationFrame */; INSERT INTO `weenie_properties_position` (`object_Id`, `position_Type`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`) VALUES (10287, 8040, 2973434130, 82.0102, 36.385, 33.9995, -1.00517E-05, 0, 0, -1) /* PCAPRecordedLocation */ /* @teleloc 0xB13B0112 [82.010200 36.385000 33.999500] -0.000010 0.000000 0.000000 -1.000000 */; INSERT INTO `weenie_properties_i_i_d` (`object_Id`, `type`, `value`) VALUES (10287, 8000, 2064887968) /* PCAPRecordedObjectIID */;
LtRipley36706/ACE-World
Database/3-Core/9 WeenieDefaults/SQL/House/Cottage/10287 Cottage.sql
SQL
agpl-3.0
2,081
import logging, logging.handlers import sys logging.handlers.HTTPHandler('','',method='GET') logger = logging.getLogger('simple_example') # http_handler = logging.handlers.HTTPHandler('127.0.0.1:9022', '/event', method='GET') http_handler = logging.handlers.HTTPHandler('127.0.0.1:9999', '/httpevent', method='GET') logger.addHandler(http_handler) #logger.setLevel(logging.DEBUG) f=open(sys.argv[1]) for i in range(10): line = f.readline() print line logger.critical(line) ## For reference, the exert of the relevant Python logger # import errno, logging, socket, os, pickle, struct, time, re # from codecs import BOM_UTF8 # from stat import ST_DEV, ST_INO, ST_MTIME # import queue # try: # import threading # except ImportError: #pragma: no cover # threading = None # import http.client, urllib.parse # port = 9022 # method = "GET" # host = "127.0.0.1" # url = "/" # h = http.client.HTTPConnection(host) # url = url + "?%s" % (sep, data) # for item in lines: # data = urllib.parse.urlencode(record) # h.putrequest(method, url) # h.putheader("Host", host) # if method == "POST": # h.putheader("Content-type", # "application/x-www-form-urlencoded") # h.putheader("Content-length", str(len(data))) # h.send(data.encode('utf-8')) # h.getresponse() #can't do anything with the result
edx/edxanalytics
src/util/playback.py
Python
agpl-3.0
1,385
package de.uvwxy.xbee.apimode; import android.util.Log; public class FrameData { private int cmdID; private byte[] cmdData; private int dataPtr = 0; public FrameData(int dataLength) { dataPtr = 0; // -1 as cmd id is included in data length cmdData = new byte[dataLength - 1]; } public FrameData(int cmdID, byte[] cmdData) { this.cmdID = cmdID; this.cmdData = cmdData; } public int getCmdID() { return cmdID; } public byte[] getCmdData() { return cmdData; } public void setCmdID(int cmdID) { Log.i("XBEE", "Setting CMD ID " + cmdID); this.cmdID = cmdID; } public void setCmdData(byte[] cmdData) { this.cmdData = cmdData; } /** * This function adds the next byte to the cmd data byte array. * * @param b * the byte to write into the array * @return If the last byte is written true is returned, else false. */ public boolean putByteToCmdData(byte b) { if (cmdData == null || dataPtr == cmdData.length) { return false; } cmdData[dataPtr] = b; dataPtr++; if (dataPtr == cmdData.length) return true; return false; } }
uvwxy/libxbee
src/de/uvwxy/xbee/apimode/FrameData.java
Java
agpl-3.0
1,106
#ifndef JSON_WRITER_H_INCLUDED # define JSON_WRITER_H_INCLUDED # include "value.h" # include <vector> # include <string> # include <iostream> namespace Json { class Value; /** \brief Abstract class for writers. */ class JSON_API Writer { public: virtual ~Writer(); virtual std::string write( const Value &root ) = 0; }; /** \brief Outputs a Value in <a HREF="http://www.json.org">JSON</a> format without formatting (not human friendly). * * The JSON document is written in a single line. It is not intended for 'human' consumption, * but may be usefull to support feature such as RPC where bandwith is limited. * \sa Reader, Value */ class JSON_API FastWriter : public Writer { public: FastWriter(); virtual ~FastWriter(){} void enableYAMLCompatibility(); public: // overridden from Writer virtual std::string write( const Value &root ); private: void writeValue( const Value &value ); std::string document_; bool yamlCompatiblityEnabled_; }; /** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a human friendly way. * * The rules for line break and indent are as follow: * - Object value: * - if empty then print {} without indent and line break * - if not empty the print '{', line break & indent, print one value per line * and then unindent and line break and print '}'. * - Array value: * - if empty then print [] without indent and line break * - if the array contains no object value, empty array or some other value types, * and all the values fit on one lines, then print the array on a single line. * - otherwise, it the values do not fit on one line, or the array contains * object or non empty array, then print one value per line. * * If the Value have comments then they are outputed according to their #CommentPlacement. * * \sa Reader, Value, Value::setComment() */ class JSON_API StyledWriter: public Writer { public: StyledWriter(); virtual ~StyledWriter(){} public: // overridden from Writer /** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format. * \param root Value to serialize. * \return String containing the JSON document that represents the root value. */ virtual std::string write( const Value &root ); private: void writeValue( const Value &value ); void writeArrayValue( const Value &value ); bool isMultineArray( const Value &value ); void pushValue( const std::string &value ); void writeIndent(); void writeWithIndent( const std::string &value ); void indent(); void unindent(); void writeCommentBeforeValue( const Value &root ); void writeCommentAfterValueOnSameLine( const Value &root ); bool hasCommentForValue( const Value &value ); static std::string normalizeEOL( const std::string &text ); typedef std::vector<std::string> ChildValues; ChildValues childValues_; std::string document_; std::string indentString_; int rightMargin_; int indentSize_; bool addChildValues_; }; /** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a human friendly way, to a stream rather than to a string. * * The rules for line break and indent are as follow: * - Object value: * - if empty then print {} without indent and line break * - if not empty the print '{', line break & indent, print one value per line * and then unindent and line break and print '}'. * - Array value: * - if empty then print [] without indent and line break * - if the array contains no object value, empty array or some other value types, * and all the values fit on one lines, then print the array on a single line. * - otherwise, it the values do not fit on one line, or the array contains * object or non empty array, then print one value per line. * * If the Value have comments then they are outputed according to their #CommentPlacement. * * \param indentation Each level will be indented by this amount extra. * \sa Reader, Value, Value::setComment() */ class JSON_API StyledStreamWriter { public: StyledStreamWriter( std::string indentation="\t" ); ~StyledStreamWriter(){} public: /** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format. * \param out Stream to write to. (Can be ostringstream, e.g.) * \param root Value to serialize. * \note There is no point in deriving from Writer, since write() should not return a value. */ void write( std::ostream &out, const Value &root ); private: void writeValue( const Value &value ); void writeArrayValue( const Value &value ); bool isMultineArray( const Value &value ); void pushValue( const std::string &value ); void writeIndent(); void writeWithIndent( const std::string &value ); void indent(); void unindent(); void writeCommentBeforeValue( const Value &root ); void writeCommentAfterValueOnSameLine( const Value &root ); bool hasCommentForValue( const Value &value ); static std::string normalizeEOL( const std::string &text ); typedef std::vector<std::string> ChildValues; ChildValues childValues_; std::ostream* document_; std::string indentString_; int rightMargin_; std::string indentation_; bool addChildValues_; }; std::string JSON_API valueToString( Int value ); std::string JSON_API valueToString( UInt value ); std::string JSON_API valueToString( double value ); std::string JSON_API valueToString( bool value ); std::string JSON_API valueToQuotedString( const char *value ); /// \brief Output using the StyledStreamWriter. /// \see Json::operator>>() std::ostream& operator<<( std::ostream&, const Value &root ); } // namespace Json #endif // JSON_WRITER_H_INCLUDED
aknight1-uva/jasp-desktop
JASP-Common/lib_json/writer.h
C
agpl-3.0
5,729
/* * The OGC API - Processes * * WARNING - THIS IS WORK IN PROGRESS * * OpenAPI spec version: 1.0-draft.5 * Contact: b.pross@52north.org * Generated by: https://github.com/swagger-api/swagger-codegen.git */ using System.Runtime.Serialization; namespace IO.Swagger.Model { public interface IOneOfInput { [DataMember(Name="value")] object Value { get; set; } } }
Terradue/DotNetTep
Terradue.Tep/Terradue/Tep/IO.Swagger/Model/IOneOfInput.cs
C#
agpl-3.0
399
// ---------------------------------------------------------------------------- // Copyright (C) Aynu Evolution Laboratory. All rights reserved. // GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 // http://www.gnu.org/licenses/gpl-3.0-standalone.html // ---------------------------------------------------------------------------- package com.github.aynu.mosir.core.enterprise.lang; import static org.hamcrest.Matchers.*; import static org.junit.Assert.*; import org.junit.Test; import com.github.aynu.mosir.core.enterprise.lang.EnterpriseRuntimeException; /** * @see EnterpriseRuntimeException * @author nilcy */ @SuppressWarnings("static-method") public class EnterpriseRuntimeExceptionTest { /** * @see EnterpriseRuntimeException#EnterpriseRuntimeException() * @see EnterpriseRuntimeException#EnterpriseRuntimeException(String) * @see EnterpriseRuntimeException#EnterpriseRuntimeException(Throwable) * @see EnterpriseRuntimeException#EnterpriseRuntimeException(String, Throwable) * @see EnterpriseRuntimeException#EnterpriseRuntimeException(String, Throwable, boolean, * boolean) */ @Test public final void test() { try { throw new EnterpriseRuntimeException(); } catch (final EnterpriseRuntimeException e) { assertThat(e.getLocalizedMessage(), is(nullValue())); } try { throw new EnterpriseRuntimeException("testee"); } catch (final EnterpriseRuntimeException e) { assertThat(e.getLocalizedMessage(), is("testee")); } try { throw new EnterpriseRuntimeException(new UnsupportedOperationException()); } catch (final EnterpriseRuntimeException e) { assertThat(e.getLocalizedMessage(), is("java.lang.UnsupportedOperationException")); } try { throw new EnterpriseRuntimeException("testee", new UnsupportedOperationException()); } catch (final EnterpriseRuntimeException e) { assertThat(e.getLocalizedMessage(), is("testee")); } try { throw new EnterpriseRuntimeException("testee", new UnsupportedOperationException(), true, true); } catch (final EnterpriseRuntimeException e) { assertThat(e.getLocalizedMessage(), is("testee")); } } }
aynu/mosir
mosir-core/mosir-core-enterprise/src/test/java/com/github/aynu/mosir/core/enterprise/lang/EnterpriseRuntimeExceptionTest.java
Java
agpl-3.0
2,406
# ############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core business involves the administration of students, teachers, # courses, programs and so on. # # Copyright (C) 2015-2021 Université catholique de Louvain (http://www.uclouvain.be) # # 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 # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but 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. # # A copy of this license - GNU General Public License - is available # at the root of the source code of this program. If not, # see http://www.gnu.org/licenses/. # # ############################################################################## import attr from osis_common.ddd import interface @attr.s(frozen=True, slots=True) class EntiteUclDTO(interface.DTO): sigle = attr.ib(type=str) intitule = attr.ib(type=str)
uclouvain/osis
infrastructure/shared_kernel/entite/dtos.py
Python
agpl-3.0
1,467
DELETE FROM `weenie` WHERE `class_Id` = 36113; INSERT INTO `weenie` (`class_Id`, `class_Name`, `type`, `last_Modified`) VALUES (36113, 'ace36113-aunkelauri', 10, '2019-02-10 00:00:00') /* Creature */; INSERT INTO `weenie_properties_int` (`object_Id`, `type`, `value`) VALUES (36113, 1, 16) /* ItemType - Creature */ , (36113, 2, 57) /* CreatureType - AunTumerok */ , (36113, 6, -1) /* ItemsCapacity */ , (36113, 7, -1) /* ContainersCapacity */ , (36113, 16, 32) /* ItemUseable - Remote */ , (36113, 25, 54) /* Level */ , (36113, 93, 6292504) /* PhysicsState - ReportCollisions, IgnoreCollisions, Gravity, ReportCollisionsAsEnvironment, EdgeSlide */ , (36113, 95, 8) /* RadarBlipColor - Yellow */ , (36113, 133, 4) /* ShowableOnRadar - ShowAlways */ , (36113, 134, 16) /* PlayerKillerStatus - RubberGlue */ , (36113, 8007, 0) /* PCAPRecordedAutonomousMovement */; INSERT INTO `weenie_properties_bool` (`object_Id`, `type`, `value`) VALUES (36113, 1, True ) /* Stuck */ , (36113, 19, False) /* Attackable */; INSERT INTO `weenie_properties_float` (`object_Id`, `type`, `value`) VALUES (36113, 39, 1.5) /* DefaultScale */ , (36113, 54, 3) /* UseRadius */; INSERT INTO `weenie_properties_string` (`object_Id`, `type`, `value`) VALUES (36113, 1, 'Aun Kelauri') /* Name */ , (36113, 8006, 'AAA9AAIAAAAbAQAA') /* PCAPRecordedCurrentMotionState */; INSERT INTO `weenie_properties_d_i_d` (`object_Id`, `type`, `value`) VALUES (36113, 1, 33557175) /* Setup */ , (36113, 2, 150995136) /* MotionTable */ , (36113, 3, 536871030) /* SoundTable */ , (36113, 6, 67113280) /* PaletteBase */ , (36113, 8, 100671756) /* Icon */ , (36113, 8001, 9437238) /* PCAPRecordedWeenieHeader - ItemsCapacity, ContainersCapacity, Usable, UseRadius, RadarBlipColor, RadarBehavior */ , (36113, 8003, 4) /* PCAPRecordedObjectDesc - Stuck */ , (36113, 8005, 100547) /* PCAPRecordedPhysicsDesc - CSetup, MTable, Children, ObjScale, STable, Position, Movement */; INSERT INTO `weenie_properties_position` (`object_Id`, `position_Type`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`) VALUES (36113, 8040, 482476074, 131.29, 39.5737, 20.0075, 0.7071068, 0, 0, -0.7071068) /* PCAPRecordedLocation */ /* @teleloc 0x1CC2002A [131.290000 39.573700 20.007500] 0.707107 0.000000 0.000000 -0.707107 */; INSERT INTO `weenie_properties_i_i_d` (`object_Id`, `type`, `value`) VALUES (36113, 8000, 3706151704) /* PCAPRecordedObjectIID */; INSERT INTO `weenie_properties_attribute_2nd` (`object_Id`, `type`, `init_Level`, `level_From_C_P`, `c_P_Spent`, `current_Level`) VALUES (36113, 1, 0, 0, 0, 425) /* MaxHealth */; INSERT INTO `weenie_properties_create_list` (`object_Id`, `destination_Type`, `weenie_Class_Id`, `stack_Size`, `palette`, `shade`, `try_To_Bond`) VALUES (36113, 2, 11971, 1, 0, 0, False) /* Create Buadren (11971) for Wield */; INSERT INTO `weenie_properties_palette` (`object_Id`, `sub_Palette_Id`, `offset`, `length`) VALUES (36113, 67113367, 0, 0);
LtRipley36706/ACE-World
Database/3-Core/9 WeenieDefaults/SQL/Creature/AunTumerok/36113 Aun Kelauri.sql
SQL
agpl-3.0
3,236
<!DOCTYPE html> <html lang="eu"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>PODEMOS. Mendekotasunaren arretarako zerbitzu publikoek erabateko autonomia funtzionala emateko eskubidea unibertsalizatu</title> <meta property="og:title" content="PODEMOS: Mendekotasunaren arretarako zerbitzu publikoek erabateko autonomia funtzionala emateko eskubidea unibertsalizatu" /> <meta property="og:description" content="Mendekotasunaren arretarako zerbitzu publikoek erabateko autonomia funtzionala emateko eskubidea unibertsalizatuko dugu, plana modu mailakatuan ezarriz. Gainera, etxeko langileen lan baldintza gainerako langileenarekin parekatuko dugu." /> <meta property="og:image" content="http://lasonrisadeunpais.es/wp-content/plugins/programa/data/meta-programa.png" /> </head> <body> <script type="text/javascript"> var url_base = '/eu/programa/?medida=105'; window.location = url_base; </script> <h1>Mendekotasunaren arretarako zerbitzu publikoek erabateko autonomia funtzionala emateko eskubidea unibertsalizatu</h1> <div> <p>Mendekotasunaren arretarako zerbitzu publikoek erabateko autonomia funtzionala emateko eskubidea unibertsalizatuko dugu, plana modu mailakatuan ezarriz. Gainera, etxeko langileen lan baldintza gainerako langileenarekin parekatuko dugu.</p> </div> </body> </html>
joker-x/programa-podemos-2015
web/fb-share/programa/eu/105.html
HTML
agpl-3.0
1,350
/** * Babel JavaScript Support * * Copyright (C) 2008-2011 Edgewall Software * All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://babel.edgewall.org/wiki/License. * * This software consists of voluntary contributions made by many * individuals. For the exact contribution history, see the revision * history and logs, available at http://babel.edgewall.org/log/. */ /** * A simple module that provides a gettext like translation interface. * The catalog passed to load() must be a object conforming to this * interface:: * * { * messages: an object of {msgid: translations} items where * translations is an array of messages or a single * string if the message is not pluralizable. * plural_expr: the plural expression for the language. * locale: the identifier for this locale. * domain: the name of the domain. * } * * Missing elements in the object are ignored. * * Typical usage:: * * var translations = babel.Translations.load(...).install(); */ var babel = new function() { var defaultPluralExpr = function(n) { return n == 1 ? 0 : 1; }; var formatRegex = /%?%(?:\(([^\)]+)\))?([disr])/g; /** * A translations object implementing the gettext interface */ var Translations = this.Translations = function(locale, domain) { this.messages = {}; this.locale = locale || 'unknown'; this.domain = domain || 'messages'; this.pluralexpr = defaultPluralExpr; }; /** * Create a new translations object from the catalog and return it. * See the babel-module comment for more details. */ Translations.load = function(catalog) { var rv = new Translations(); rv.load(catalog); return rv; }; Translations.prototype = { /** * translate a single string. */ gettext: function(string) { var translated = this.messages[string]; if (typeof translated == 'undefined') return string; return (typeof translated == 'string') ? translated : translated[0]; }, /** * translate a pluralizable string */ ngettext: function(singular, plural, n) { var translated = this.messages[singular]; if (typeof translated == 'undefined') return (n == 1) ? singular : plural; return translated[this.pluralexpr(n)]; }, /** * Install this translation document wide. After this call, there are * three new methods on the window object: _, gettext and ngettext */ install: function() { var self = this; window.gettext = function(string) { return self.gettext(string); }; window.ngettext = function(singular, plural, n) { return self.ngettext(singular, plural, n); }; return this; }, /** * Works like Translations.load but updates the instance rather * then creating a new one. */ load: function(catalog) { if (catalog.messages) this.update(catalog.messages); if (catalog.plural_expr) this.setPluralExpr(catalog.plural_expr); if (catalog.locale) this.locale = catalog.locale; if (catalog.domain) this.domain = catalog.domain; return this; }, /** * Updates the translations with the object of messages. */ update: function(mapping) { for (var key in mapping) if (mapping.hasOwnProperty(key)) this.messages[key] = mapping[key]; return this; }, /** * Sets the plural expression */ setPluralExpr: function(expr) { this.pluralexpr = new Function('n', 'return +(' + expr + ')'); return this; } }; /** * A python inspired string formatting function. Supports named and * positional placeholders and "s", "d" and "i" as type characters * without any formatting specifications. * * Examples:: * * babel.format(_('Hello %s'), name) * babel.format(_('Progress: %(percent)s%%'), {percent: 100}) */ this.format = function() { var arg, string = arguments[0], idx = 0; if (arguments.length == 1) return string; else if (arguments.length == 2 && typeof arguments[1] == 'object') arg = arguments[1]; else { arg = []; for (var i = 1, n = arguments.length; i != n; ++i) arg[i - 1] = arguments[i]; } return string.replace(formatRegex, function(all, name, type) { if (all[0] == all[1]) return all.substring(1); var value = arg[name || idx++]; return (type == 'i' || type == 'd') ? +value : value; }); } };
beeverycreative/BEEweb
src/octoprint/static/js/lib/babel.js
JavaScript
agpl-3.0
4,740
# Flask modules from flask import ( Blueprint, render_template, redirect, url_for, request, flash, current_app, g, ) # FLask Login from flask_login import ( current_user, ) # WTForms from flask_wtf import Form from wtforms import ( SubmitField, BooleanField, DecimalField, ) from wtforms.validators import DataRequired # Mail from flask_mail import Message # Modules required for communication with pypayd import requests import json # Other modules from datetime import datetime from datetime import timedelta # Our own modules from topitup import db from frontend import login_required from nav import ( nav, top_nav ) # Let's start! class Payd(db.Model): __bind_key__ = "topitup" id = db.Column(db.Integer, primary_key=True) user_id = db.Column(db.Integer) time_creation = db.Column(db.DateTime) time_payment = db.Column(db.DateTime) order_id = db.Column(db.String(35), unique=True) native_price = db.Column(db.Integer) native_currency = db.Column(db.String(3)) btc_price = db.Column(db.Integer) address = db.Column(db.String(35)) txn = db.Column(db.Integer, default=0) def __init__(self, id, user_id, time_creation, time_payment, order_id, native_price, native_currency, btc_price, address, txn): self.id = id self.user_id = user_id self.time_creation = time_creation self.time_payment = time_payment self.order_id = order_id self.native_price = native_price self.native_currency = native_currency self.btc_price = btc_price self.address = address self.txn = txn def __repr__(self): return '<Payd %r>' % self.id # create sqlite database if it does not exist try: db.create_all(bind='topitup') except: pass # Blueprint siema = Blueprint('siema', __name__) # Buy credits Form class LoginForm(Form): amount = DecimalField('Amount of Credits', validators=[DataRequired()]) confirm_me = BooleanField('Please confirm you agree to TOC', validators=[DataRequired()]) submit = SubmitField("Buy Credits") @siema.before_request def before_request(): try: g.user = current_user.username.decode('utf-8') g.email = current_user.email.decode('utf-8') # amount of Credits in user's account g.credits = current_user.neuro g.user_id = current_user.id except: g.user = None g.credits = None nav.register_element('top_nav', top_nav(g.user, g.credits)) # run every minute from cron to check for payments @siema.route('/invoices/checkitup') def checkitup(): # we collect all invoices which are not paid sql_query = Payd.query.filter_by( time_payment=datetime.fromtimestamp(0)).all() for invoice in sql_query: print(invoice) howold = current_app.config['WARRANTY_TIME'] # ignore all invoices which are older than WARRANTY_TIME days if invoice.time_creation + timedelta(days=howold) > datetime.now(): print(invoice.order_id) # initiate conversation with pypayd pypayd_headers = {'content-type': 'application/json'} pypayd_payload = { "method": "check_order_status", "params": {"order_id": invoice.order_id}, "jsonrpc": "2.0", "id": 0, } #pypayd_response = requests.post( # current_app.config['PYPAYD_URI'], # data=json.dumps(pypayd_payload), # headers=pypayd_headers).json() #print(pypayd_response) #invoice.txn = 0 howmanyconfirmations = current_app.config['CONFIRMATIONS'] confirmations = pypayd_response['result']['amount'] # Huhu! We have a new payment! if invoice.txn == 0 and confirmations > howmanyconfirmations: # Send an email message if payment was registered # From: DEFAULT_MAIL_SENDER msg = Message() msg.add_recipient(current_user.email) msg.subject = "Payment confirmation" msg.body = "" # Register payment invoice.time_payment = datetime.now() # Register paid amount in the main database balance = current_user.credits current_user.credits = balance + pypayd_response['result']['amount'] # Housekeeping invoice.txn = confirmations # register all transactions in databases db.session.commit() flash('Thank you.', 'info') return redirect(url_for('frontend.index')) @siema.route('/invoices/id/<orderid>') @login_required def showinvoice(orderid): sql_query = Payd.query.filter_by( order_id=orderid).first() return render_template('invoice-id.html', invoice=sql_query, ) @siema.route('/invoices/new', methods=('GET', 'POST')) @login_required def new(): form = LoginForm() if form.validate_on_submit(): amount = request.form['amount'] confirm_me = False if 'confirm_me' in request.form: confirm_me = True if confirm_me is False: pass # get a new transaction id sql_query = Payd.query.all() new_local_transaction_id = len(sql_query) # TODO: deal with an unlikely event of concurrency # initiate conversation with pypayd pypayd_headers = {'content-type': 'application/json'} pypayd_payload = { "method": "create_order", "params": {"amount": amount, "qr_code": True}, "jsonrpc": "2.0", "id": new_local_transaction_id, } pypayd_response = requests.post( current_app.config['PYPAYD_URI'], data=json.dumps(pypayd_payload), headers=pypayd_headers).json() print(pypayd_response) # insert stuff into our transaction database to_db = Payd( None, g.user_id, datetime.utcnow(), datetime.fromtimestamp(0), # this is not a paid invoice, yet pypayd_response['result']['order_id'], amount, "EUR", pypayd_response['result']['amount'], pypayd_response['result']['receiving_address'], 0, ) db.session.add(to_db) db.session.commit() payme = { 'credits': amount, 'btc': pypayd_response['result']['amount'], 'address': pypayd_response['result']['receiving_address'], 'image': pypayd_response['result']['qr_image'], } # generate approximate time to pay the invoice pay_time = datetime.now() + timedelta(minutes=45) # and finally show an invoice to the customer return render_template('invoice-payme.html', payme=payme, pay_time=pay_time) return render_template('invoice-new.html', form=form) # user has access to his own invoices only @siema.route('/invoices/', defaults={'page': 1}) @siema.route('/invoices/page/<int:page>') @login_required def index(page): # downloading all records related to user sql_query = Payd.query.filter_by( user_id=g.user_id).paginate(page, current_app.config['INVOICES_PER_PAGE']) return render_template('invoices.html', invoices=sql_query, ) # admin has access to all invoices @siema.route('/admin/', defaults={'page': 1}) @siema.route('/admin/page/<int:page>') @login_required def admin(page): # only user with id = 666 can enter this route if g.user_id == 666: sql_query = Payd.query.paginate(page, 50) return render_template('invoices.html', invoices=sql_query, ) else: flash('You are not admin and you can see your own invoices only!', 'warning') return redirect(url_for('siema.index'))
ser/topitup
siema.py
Python
agpl-3.0
8,241
<?php return array( '_language_name' => 'Deutsch', '_ext_language_file' => 'ext-lang-de-min.js', ); ?>
yanlingling/xnjs
language/de_de/_config.php
PHP
agpl-3.0
109
<?php App::uses('AppModel', 'Model'); class TaxonomyPredicate extends AppModel{ public $useTable = 'taxonomy_predicates'; public $recursive = -1; public $actsAs = array( 'Containable', ); public $validate = array( 'value' => array( 'rule' => array('stringNotEmpty'), ), 'expanded' => array( 'rule' => array('stringNotEmpty'), ), ); public $hasMany = array( 'TaxonomyEntry' => array( 'dependent' => true ) ); public function beforeValidate($options = array()) { parent::beforeValidate(); return true; } }
RichieB2B/MISP
app/Model/TaxonomyPredicate.php
PHP
agpl-3.0
548
@extends('welcome') @section('news') <div class="post ground feel"> <div class="main-center"> <button type="button" class="buttonViwe right-margin">general</button> <button type="button" class="buttonViwe right-margin">recommend</button> <button type="button" class="buttonViwe right-margin">my</button> <button type="button" class="buttonViwe right-margin">group</button> </div> </div> <div class="post post-box ground"> <div class="R_block"> <img src="/img/logo02.png" alt="avatar" name="avatar" class="imagePost"> <textarea placeholder="max post lentght is 5000 characters" name="postMessage" maxlength="5000" class="margin-left textarea"></textarea> <button type="button" class="buttonViwe align-right top-margin-hard right-margin">Post</button> </div> </div> @endsection
OwlHex/OwlNet
resources/views/news.blade.php
PHP
agpl-3.0
847
/** ****************************************************************************** * @file DMA2D/DMA2D_MemToMemWithPFC/Inc/main.h * @author MCD Application Team * @version V1.2.5 * @date 29-January-2016 * @brief Header for main.c module ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __MAIN_H #define __MAIN_H /* Includes ------------------------------------------------------------------*/ #include "stm32f429i_discovery.h" #include "stm32f429i_discovery_lcd.h" /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ #endif /* __MAIN_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
mariobarbareschi/stm32-compiler-docker
STM32Cube_FW_F4_V1.11.0/Projects/STM32F429I-Discovery/Examples/DMA2D/DMA2D_MemToMemWithPFC/Inc/main.h
C
agpl-3.0
2,820
DELETE FROM `weenie` WHERE `class_Id` = 53191; INSERT INTO `weenie` (`class_Id`, `class_Name`, `type`, `last_Modified`) VALUES (53191, 'ace53191-luminousamberofthe46thtierparagon', 44, '2019-02-10 00:00:00') /* CraftTool */; INSERT INTO `weenie_properties_int` (`object_Id`, `type`, `value`) VALUES (53191, 1, 2048) /* ItemType - Gem */ , (53191, 5, 100) /* EncumbranceVal */ , (53191, 11, 1) /* MaxStackSize */ , (53191, 12, 1) /* StackSize */ , (53191, 13, 100) /* StackUnitEncumbrance */ , (53191, 15, 25) /* StackUnitValue */ , (53191, 16, 524296) /* ItemUseable - SourceContainedTargetContained */ , (53191, 18, 256) /* UiEffects - Acid */ , (53191, 19, 25) /* Value */ , (53191, 33, 1) /* Bonded - Bonded */ , (53191, 93, 1044) /* PhysicsState - Ethereal, IgnoreCollisions, Gravity */ , (53191, 94, 33025) /* TargetType - WeaponOrCaster */ , (53191, 8041, 101) /* PCAPRecordedPlacement - Resting */; INSERT INTO `weenie_properties_bool` (`object_Id`, `type`, `value`) VALUES (53191, 22, True ) /* Inscribable */ , (53191, 69, False) /* IsSellable */; INSERT INTO `weenie_properties_string` (`object_Id`, `type`, `value`) VALUES (53191, 1, 'Luminous Amber of the 46th Tier Paragon') /* Name */ , (53191, 14, 'Use this on any 45th Tier Paragon Weapon to raise its maximum level to 46.') /* Use */ , (53191, 16, 'A chunk of amber imbued with the energies of the Deru.') /* LongDesc */ , (53191, 20, 'Luminous Ambers of the 46th Tier Paragon') /* PluralName */; INSERT INTO `weenie_properties_d_i_d` (`object_Id`, `type`, `value`) VALUES (53191, 1, 33554809) /* Setup */ , (53191, 3, 536870932) /* SoundTable */ , (53191, 6, 67111919) /* PaletteBase */ , (53191, 8, 100693327) /* Icon */ , (53191, 22, 872415275) /* PhysicsEffectTable */ , (53191, 52, 100691593) /* IconUnderlay */ , (53191, 8001, 2650265) /* PCAPRecordedWeenieHeader - PluralName, Value, Usable, UiEffects, StackSize, MaxStackSize, Container, TargetType, Burden */ , (53191, 8002, 1) /* PCAPRecordedWeenieHeader2 - IconUnderlay */ , (53191, 8003, 67108882) /* PCAPRecordedObjectDesc - Inscribable, Attackable, IncludesSecondHeader */ , (53191, 8005, 137217) /* PCAPRecordedPhysicsDesc - CSetup, STable, PeTable, AnimationFrame */; INSERT INTO `weenie_properties_i_i_d` (`object_Id`, `type`, `value`) VALUES (53191, 8000, 3434237474) /* PCAPRecordedObjectIID */; INSERT INTO `weenie_properties_palette` (`object_Id`, `sub_Palette_Id`, `offset`, `length`) VALUES (53191, 67111921, 0, 0); INSERT INTO `weenie_properties_texture_map` (`object_Id`, `index`, `old_Id`, `new_Id`) VALUES (53191, 0, 83890391, 83890391); INSERT INTO `weenie_properties_anim_part` (`object_Id`, `index`, `animation_Id`) VALUES (53191, 0, 16779181);
LtRipley36706/ACE-World
Database/3-Core/9 WeenieDefaults/SQL/CraftTool/Gem/53191 Luminous Amber of the 46th Tier Paragon.sql
SQL
agpl-3.0
2,975
require 'test_helper' class PassportPictureTest < ActiveSupport::TestCase # test "the truth" do # assert true # end end
myplaceonline/myplaceonline_rails
test/models/passport_picture_test.rb
Ruby
agpl-3.0
129
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core business involves the administration of students, teachers, # courses, programs and so on. # # Copyright (C) 2015-2018 Université catholique de Louvain (http://www.uclouvain.be) # # 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 # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but 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. # # A copy of this license - GNU General Public License - is available # at the root of the source code of this program. If not, # see http://www.gnu.org/licenses/. # ############################################################################## from django.dispatch import receiver from assessments.business import scores_encodings_deadline from base.signals import publisher @receiver(publisher.compute_scores_encodings_deadlines) def compute_scores_encodings_deadlines(sender, **kwargs): scores_encodings_deadline.compute_deadline(kwargs['offer_year_calendar']) @receiver(publisher.compute_student_score_encoding_deadline) def compute_student_score_encoding_deadline(sender, **kwargs): scores_encodings_deadline.compute_deadline_by_student(kwargs['session_exam_deadline']) @receiver(publisher.compute_all_scores_encodings_deadlines) def compute_all_scores_encodings_deadlines(sender, **kwargs): scores_encodings_deadline.recompute_all_deadlines(kwargs['academic_calendar'])
uclouvain/osis_louvain
assessments/signals/subscribers.py
Python
agpl-3.0
2,029
from django.contrib import auth from django.contrib.auth.models import User from django.test import TestCase from django.urls.base import reverse class TestAccountRegistration(TestCase): def setUp(self): # create one user for convenience response = self.client.post( reverse('account:register'), { 'username': 'Alice', 'email': 'alice@localhost', 'password': 'supasecret', 'password2': 'supasecret', }, follow=True ) self.assertEqual(response.redirect_chain[0][1], 302) self.assertEqual(response.redirect_chain[0][0], reverse('account:login')) self.assertEqual(response.status_code, 200) def test_registration(self): self.assertEqual(len(User.objects.all()), 1) user = User.objects.get(username='Alice') self.assertEqual(user.email, 'alice@localhost') response = self.client.post( reverse('account:register'), { 'username': 'Bob', 'email': 'bob@localhost', 'password': 'foo', 'password2': 'foo', }, follow=True ) self.assertEqual(response.redirect_chain[0][1], 302) self.assertEqual(response.redirect_chain[0][0], reverse('account:login')) self.assertEqual(response.status_code, 200) self.assertEqual(len(User.objects.all()), 2) def test_duplicate_username(self): response = self.client.post( reverse('account:register'), { 'username': 'Alice', 'email': 'alice2@localhost', 'password': 'supasecret', 'password2': 'supasecret', }, follow=True ) self.assertEqual(response.redirect_chain[0][1], 302) self.assertEqual(response.redirect_chain[0][0], reverse('account:register')) self.assertEqual(response.status_code, 200) self.assertEqual(len(User.objects.all()), 1) def test_duplicate_email(self): response = self.client.post( reverse('account:register'), { 'username': 'Alice2000', 'email': 'alice@localhost', 'password': 'supasecret', 'password2': 'supasecret', }, follow=True ) self.assertEqual(response.redirect_chain[0][1], 302) self.assertEqual(response.redirect_chain[0][0], reverse('account:register')) self.assertEqual(response.status_code, 200) self.assertEqual(len(User.objects.all()), 1) def test_non_matching_passwords(self): response = self.client.post( reverse('account:register'), { 'username': 'Bob', 'email': 'bob@localhost', 'password': 'foo', 'password2': 'bar', }, follow=True ) self.assertEqual(response.redirect_chain[0][1], 302) self.assertEqual(response.redirect_chain[0][0], reverse('account:register')) self.assertEqual(response.status_code, 200) self.assertEqual(len(User.objects.all()), 1) def test_form_view(self): response = self.client.get(reverse('account:register')) self.assertEqual(response.status_code, 200) class TestLogin(TestCase): def setUp(self): # create one user for convenience response = self.client.post( reverse('account:register'), { 'username': 'Alice', 'email': 'alice@localhost', 'password': 'supasecret', 'password2': 'supasecret', }, follow=True ) self.assertEqual(response.redirect_chain[0][1], 302) self.assertEqual(response.redirect_chain[0][0], reverse('account:login')) self.assertEqual(response.status_code, 200) def test_login(self): response = self.client.post( reverse('account:login'), {'username': 'Alice', 'password': 'supasecret'}, follow=True ) self.assertEqual(response.redirect_chain[0][1], 302) self.assertEqual(response.redirect_chain[0][0], reverse('account:home')) self.assertEqual(response.status_code, 200) def test_disabled_login(self): user = User.objects.all().update(is_active=False) response = self.client.post( reverse('account:login'), {'username': 'Alice', 'password': 'supasecret'}, follow=True ) self.assertEqual(response.redirect_chain[0][1], 302) self.assertEqual(response.redirect_chain[0][0], reverse('account:login')) self.assertEqual(response.status_code, 200) def test_wrong_credentials(self): response = self.client.post( reverse('account:login'), {'username': 'Alice', 'password': 'wrong'}, follow=True ) self.assertEqual(response.redirect_chain[0][1], 302) self.assertEqual(response.redirect_chain[0][0], reverse('account:login')) self.assertEqual(response.status_code, 200) def test_wrong_user(self): response = self.client.post( reverse('account:login'), {'username': 'Bob', 'password': 'supasecret'}, follow=True ) self.assertEqual(response.redirect_chain[0][1], 302) self.assertEqual(response.redirect_chain[0][0], reverse('account:login')) self.assertEqual(response.status_code, 200) def test_login_view(self): response = self.client.get(reverse('account:login')) self.assertEqual(response.status_code, 200) def test_login_view_being_logged_in(self): response = self.client.post( reverse('account:login'), {'username': 'Alice', 'password': 'supasecret'}, follow=True ) response = self.client.get( reverse('account:login'), follow=True ) self.assertEqual(response.redirect_chain[0][1], 302) self.assertEqual(response.redirect_chain[0][0], reverse('account:home')) self.assertEqual(response.status_code, 200) response = self.client.post( reverse('account:login'), {'username': 'Alice', 'password': 'supasecret'}, follow=True ) self.assertEqual(response.redirect_chain[0][1], 302) self.assertEqual(response.redirect_chain[0][0], reverse('account:home')) self.assertEqual(response.status_code, 200) def test_home_view_while_not_logged_in(self): response = self.client.get(reverse('account:home'), follow=True) self.assertEqual(response.redirect_chain[0][1], 302) self.assertTrue(response.redirect_chain[0][0].startswith(reverse('account:login'))) self.assertEqual(response.status_code, 200) def test_home_view_while_logged_in(self): response = self.client.post( reverse('account:login'), {'username': 'Alice', 'password': 'supasecret'}, follow=True ) response = self.client.get(reverse('account:home')) self.assertEqual(response.status_code, 200) def test_register_view_while_logged_in(self): response = self.client.post( reverse('account:login'), {'username': 'Alice', 'password': 'supasecret'}, follow=True ) response = self.client.get(reverse('account:register'), follow=True) self.assertEqual(response.redirect_chain[0][1], 302) self.assertTrue(response.redirect_chain[0][0].startswith(reverse('account:home'))) self.assertEqual(response.status_code, 200) def test_logout(self): response = self.client.post( reverse('account:login'), {'username': 'Alice', 'password': 'supasecret'}, follow=True ) user = auth.get_user(self.client) self.assertTrue(user.is_authenticated) response = self.client.get(reverse('account:logout'), follow=True) self.assertEqual(response.redirect_chain[0][1], 302) self.assertTrue(response.redirect_chain[0][0].startswith(reverse('base:home'))) self.assertEqual(response.status_code, 200) user = auth.get_user(self.client) self.assertFalse(user.is_authenticated)
jardiacaj/finem_imperii
account/tests.py
Python
agpl-3.0
8,495
Room.prototype.checkBlocked = function() { let exits = Game.map.describeExits(this.name); let room = this; let roomCallback = function(roomName) { let costMatrix = new PathFinder.CostMatrix(); let structures = room.find(FIND_STRUCTURES); for (let structure of structures) { costMatrix.set(structure.pos.x, structure.pos.y, 0xFF); } return costMatrix; }; for (let fromDirection in exits) { let fromExitDirection = this.findExitTo(exits[fromDirection]); let fromExitPoss = this.find(fromExitDirection); let fromNextExit = fromExitPoss[Math.floor(fromExitPoss.length / 2)]; for (let toDirection in exits) { if (fromDirection == toDirection) { continue; } let toExitDirection = this.findExitTo(exits[toDirection]); let toExitPoss = this.find(toExitDirection); let toNextExit = toExitPoss[Math.floor(toExitPoss.length / 2)]; let search = PathFinder.search(fromNextExit, toNextExit, { maxRooms: 0, roomCallback: roomCallback }); if (search.incomplete) { return true; } } } return false; }; Room.prototype.externalHandleRoom = function() { if (!this.controller) { var nameSplit = this.splitRoomName(); if (nameSplit[2] % 10 === 0 || nameSplit[4] % 10 === 0) { return this.externalHandleHighwayRoom(); } } else { if (this.controller.owner) { return this.handleOccupiedRoom(); } if (this.controller.reservation && this.controller.reservation.username == Memory.username) { return this.handleReservedRoom(); } } if (!this.memory.blockedCheck || Game.time - this.memory.blockedCheck > 100000) { this.memory.blockedCheck = Game.time; let blocked = this.checkBlocked(); if (blocked) { this.memory.lastSeen = Game.time; this.memory.state = 'Blocked'; } } if (this.controller && !this.controller.reservation) { if (this.handleUnreservedRoom()) { return false; } } if (!this.controller) { var sourceKeeper = this.find(FIND_HOSTILE_STRUCTURES, { filter: function(object) { return object.owner.username == 'Source Keeper'; } }); if (sourceKeeper.length > 0) { this.memory.lastSeen = Game.time; this.handleSourceKeeperRoom(); return false; } } delete Memory.rooms[this.roomName]; return false; }; Room.prototype.externalHandleHighwayRoom = function() { if (config.power.disabled) { return false; } //this.log('handle Highwayroom'); var structures = this.find(FIND_STRUCTURES, { filter: { structureType: STRUCTURE_POWER_BANK } }); if (structures.length === 0) { if (Memory.powerBanks) { delete Memory.powerBanks[this.name]; } return false; } if (Memory.powerBanks && Memory.powerBanks[this.name]) { if (Memory.powerBanks[this.name].target && Memory.powerBanks[this.name] !== null) { if (Memory.powerBanks[this.name].transporter_called) { return; } if (structures[0].hits < 300000) { for (var i = 0; i < Math.ceil(structures[0].power / 1000); i++) { this.log('Adding powertransporter at ' + Memory.powerBanks[this.name].target); Game.rooms[Memory.powerBanks[this.name].target].memory.queue.push({ role: 'powertransporter', routing: { targetRoom: this.name } }); } Memory.powerBanks[this.name].transporter_called = true; } } return; } if (structures[0].ticksToDecay < 3000) { Memory.powerBanks[this.name] = { target: null }; return true; } else { var min_route = 6; var target = null; var route; for (var room_id in Memory.myRooms) { var room = Game.rooms[Memory.myRooms[room_id]]; if (!room || !room.storage || room.storage.store.energy < config.power.energyForCreeps) { continue; } var route_to_test = Game.map.findRoute(this.name, room.name); if (route_to_test.length < min_route) { min_route = route_to_test.length; target = room; route = route_to_test; } } if (!Memory.powerBanks) { Memory.powerBanks = {}; } if (target !== null) { Memory.powerBanks[this.name] = { target: target.name, min_route: min_route }; this.log('--------------> Start power harvesting in: ' + target.name + ' <----------------'); Game.rooms[target.name].memory.queue.push({ role: 'powerattacker', routing: { targetRoom: this.name } }); Game.rooms[target.name].memory.queue.push({ role: 'powerhealer', routing: { targetRoom: this.name } }); Game.rooms[target.name].memory.queue.push({ role: 'powerhealer', routing: { targetRoom: this.name } }); } else { Memory.powerBanks[this.name] = { target: null }; } } }; Room.prototype.handleOccupiedRoom = function() { this.memory.lastSeen = Game.time; var hostiles = this.find(FIND_HOSTILE_CREEPS); if (hostiles.length > 0) { // TODO replace with enum this.memory.state = 'Occupied'; this.memory.player = this.controller.owner.username; // TODO trigger everytime? if (!this.controller.safeMode) { let myCreeps = this.find(FIND_MY_CREEPS, { filter: function(object) { let creep = Game.getObjectById(object.id); if (creep.memory.role == 'scout') { return false; } return true; } }); if (myCreeps.length > 0) { return false; } var spawns = this.find(FIND_HOSTILE_STRUCTURES, { filter: function(object) { return object.structureType == STRUCTURE_SPAWN; } }); var squads = _.filter(Memory.squads, function(object) { return object.target == this.name; } ); if (spawns.length > 0 && squads.length === 0) { this.attackRoom(); } } return false; } }; Room.prototype.checkBlockedPath = function() { for (let pathName in this.getMemoryPaths()) { let path = this.getMemoryPath(pathName); for (let pos of path) { let roomPos = new RoomPosition(pos.x, pos.y, this.name); let structures = roomPos.lookFor('structure'); for (let structure of structures) { if (structure.structureType == STRUCTURE_ROAD) { continue; } if (structure.structureType == STRUCTURE_RAMPART) { continue; } if (structure.structureType == STRUCTURE_CONTAINER) { continue; } this.log(`Path ${pathName} blocked on ${pos} due to ${structure.structureType}`); return true; } } } }; Room.prototype.checkAndSpawnReserver = function() { let reservation = this.memory.reservation; if (reservation === undefined) { // TODO Check the closest room and set reservation this.log('No reservation'); return false; } let baseRoom = Game.rooms[reservation.base]; if (baseRoom === undefined) { delete this.memory.reservation; return false; } if (this.checkBlockedPath()) { if (Game.time % config.creep.structurerInterval === 0) { this.log('Call structurer from ' + baseRoom.name); Game.rooms[creep.memory.base].checkRoleToSpawn('structurer', 1, undefined, this.name); return; } } let reserverSpawn = { role: 'reserver', level: 2, routing: { targetRoom: this.name, targetId: this.controller.id, reached: false, routePos: 0, pathPos: 0 } }; // TODO move the creep check from the reserver to here and spawn only sourcer (or one part reserver) when controller.level < 4 let energyNeeded = 1300; if (baseRoom.misplacedSpawn) { energyNeeded += 300; } if (baseRoom.getEnergyCapacityAvailable() >= energyNeeded) { if (!baseRoom.inQueue(reserverSpawn)) { baseRoom.checkRoleToSpawn('reserver', 1, this.controller.id, this.name, 2); } } }; Room.prototype.handleReservedRoom = function() { this.memory.state = 'Reserved'; this.memory.lastSeen = Game.time; if (this.memory.lastChecked !== undefined && Game.time - this.memory.lastChecked < 500) { return false; } this.memory.lastChecked = Game.time; let idiotCreeps = this.find(FIND_HOSTILE_CREEPS, { filter: this.findAttackCreeps }); for (let idiotCreep of idiotCreeps) { brain.increaseIdiot(idiotCreep.owner.username); } let reservers = this.find(FIND_MY_CREEPS, { filter: (c) => c.memory.role == 'reserver', }); if (reservers.length === 0) { this.checkAndSpawnReserver(); } return false; }; Room.prototype.handleUnreservedRoom = function() { this.memory.state = 'Unreserved'; this.memory.lastSeen = Game.time; if (this.memory.lastChecked !== undefined && Game.time - this.memory.lastChecked < 500) { return true; } // TODO: Don't check every tick. if (this.memory.reservation === undefined) { let isReservedBy = (roomName) => { return (roomMemory) => { return roomMemory.reservation !== undefined && roomMemory.state === 'Reserved' && roomMemory.reservation.base == roomName; }; }; checkRoomsLabel: for (let roomName of Memory.myRooms) { let room = Game.rooms[roomName]; if (!room) { continue; } let distance = Game.map.getRoomLinearDistance(this.name, room.name); if (distance > config.external.distance) { continue; } let route = Game.map.findRoute(this.name, room.name); distance = route.length; if (distance > config.external.distance) { continue; } // Only allow pathing through owned rooms or already reserved rooms. for (let routeEntry of route) { let routeRoomName = routeEntry.room; if (Game.rooms[routeRoomName] === undefined) { continue checkRoomsLabel; } let routeRoom = Game.rooms[routeRoomName]; if (routeRoom.controller === undefined) { continue checkRoomsLabel; } if (!routeRoom.controller.my && routeRoom.memory.state !== 'Reserved') { continue checkRoomsLabel; } } if (room.memory.queue && room.memory.queue.length === 0 && room.energyAvailable >= room.getEnergyCapacityAvailable()) { let reservedRooms = _.filter(Memory.rooms, isReservedBy(room.name)); // RCL: target reserved rooms let numRooms = config.room.reservedRCL; if (reservedRooms.length < numRooms[room.controller.level]) { this.log('Would start to spawn'); this.memory.reservation = { base: room.name, }; this.memory.state = 'Reserved'; break; } } } } if (this.memory.reservation !== undefined) { this.memory.lastChecked = Game.time; let reservation = this.memory.reservation; if (this.name == reservation.base) { this.log('Want to spawn reserver for the base room, why?'); delete this.memory.reservation; return false; } this.memory.state = 'Reserved'; this.checkAndSpawnReserver(); } return true; }; Room.prototype.handleSourceKeeperRoom = function() { if (!config.room.skMining) { return false; } if (this.memory.reservation === undefined) { let isReservedBy = (roomName) => { return (roomMemory) => { return roomMemory.reservation !== undefined && roomMemory.state === 'Reserved' && roomMemory.reservation.base == roomName; }; }; checkRoomsLabel: for (let roomName of Memory.myRooms) { let room = Game.rooms[roomName]; if (!room) { continue; } let distance = Game.map.getRoomLinearDistance(this.name, room.name); if (distance > config.external.distance) { continue; } let route = Game.map.findRoute(this.name, room.name); distance = route.length; if (distance > config.external.distance) { continue; } // Only allow pathing through owned rooms or already reserved rooms. for (let routeEntry of route) { let routeRoomName = routeEntry.room; if (Game.rooms[routeRoomName] === undefined) { continue checkRoomsLabel; } let routeRoom = Game.rooms[routeRoomName]; if (routeRoom.controller === undefined) { continue checkRoomsLabel; } if (!routeRoom.controller.my && routeRoom.memory.state !== 'Reserved') { continue checkRoomsLabel; } } if (room.memory.queue && room.memory.queue.length === 0 && room.energyAvailable >= room.getEnergyCapacityAvailable()) { let reservedRooms = _.filter(Memory.rooms, isReservedBy(room.name)); // RCL: target reserved rooms let numRooms = config.room.reservedRCL; if (reservedRooms.length < numRooms[room.controller.level] + config.room.numberOfSkRooms && room.controller.level > 4) { this.memory.reservation = { base: room.name, }; this.memory.state = 'Reserved'; break; } } } } if (this.memory.reservation !== undefined) { this.memory.lastChecked = Game.time; let reservation = this.memory.reservation; this.memory.state = 'Reserved'; //this.log('handle source keeper room'); let myCreeps = this.find(FIND_MY_CREEPS); let sourcer = 0; let melee = 0; for (let object of myCreeps) { let creep = Game.getObjectById(object.id); if (creep.memory.role == 'sourcer') { sourcer++; continue; } if (creep.memory.role == 'atkeeper') { melee++; continue; } } if (melee < 3) { var spawn = { role: 'atkeeper', routing: { targetRoom: this.name } }; //this.log(`!!!!!!!!!!!! ${JSON.stringify(spawn)}`); Game.rooms[reservation.base].checkRoleToSpawn('atkeeper', 1, '', this.name); } if (sourcer < 3) { let getSourcer = function(object) { let creep = Game.getObjectById(object.id); if (creep.memory.role == 'sourcer') { return true; } return false; }; for (let source of this.find(FIND_SOURCES)) { let sourcer = source.pos.findClosestByRange(FIND_MY_CREEPS, { filter: getSourcer }); if (sourcer !== null) { let range = source.pos.getRangeTo(sourcer.pos); if (range < 7) { continue; } } let spawn = { role: 'sourcer', routing: { targetId: source.id, targetRoom: source.pos.roomName } }; //this.log(`!!!!!!!!!!!! ${JSON.stringify(spawn)}`); Game.rooms[reservation.base].checkRoleToSpawn('sourcer', 1, source.id, source.pos.roomName); } } } };
Somotaw/screeps
src/prototype_room_external.js
JavaScript
agpl-3.0
15,080