code
stringlengths 3
1.01M
| repo_name
stringlengths 5
116
| path
stringlengths 3
311
| language
stringclasses 30
values | license
stringclasses 15
values | size
int64 3
1.01M
|
|---|---|---|---|---|---|
#ifndef __ASM_MACH_IP32_KMALLOC_H
#define __ASM_MACH_IP32_KMALLOC_H
#if defined(CONFIG_CPU_R5000) || defined(CONFIG_CPU_RM7000)
#define ARCH_DMA_MINALIGN 32
#else
#define ARCH_DMA_MINALIGN 128
#endif
#endif /* __ASM_MACH_IP32_KMALLOC_H */
|
talnoah/android_kernel_htc_dlx
|
virt/arch/mips/include/asm/mach-ip32/kmalloc.h
|
C
|
gpl-2.0
| 242
|
/*
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.ci;
import java.lang.reflect.Constructor;
import java.util.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.utilities.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.types.*;
public class ciObjectFactory extends VMObject {
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
initialize(VM.getVM().getTypeDataBase());
}
});
}
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
Type type = db.lookupType("ciObjectFactory");
unloadedMethodsField = type.getAddressField("_unloaded_methods");
ciMetadataField = type.getAddressField("_ci_metadata");
symbolsField = type.getAddressField("_symbols");
ciObjectConstructor = new VirtualBaseConstructor<ciObject>(db, db.lookupType("ciObject"), "sun.jvm.hotspot.ci", ciObject.class);
ciMetadataConstructor = new VirtualBaseConstructor<ciMetadata>(db, db.lookupType("ciMetadata"), "sun.jvm.hotspot.ci", ciMetadata.class);
ciSymbolConstructor = new VirtualBaseConstructor<ciSymbol>(db, db.lookupType("ciSymbol"), "sun.jvm.hotspot.ci", ciSymbol.class);
}
private static AddressField unloadedMethodsField;
private static AddressField ciMetadataField;
private static AddressField symbolsField;
private static VirtualBaseConstructor<ciObject> ciObjectConstructor;
private static VirtualBaseConstructor<ciMetadata> ciMetadataConstructor;
private static VirtualBaseConstructor<ciSymbol> ciSymbolConstructor;
public static ciObject get(Address addr) {
if (addr == null) return null;
return (ciObject)ciObjectConstructor.instantiateWrapperFor(addr);
}
public static ciMetadata getMetadata(Address addr) {
if (addr == null) return null;
return (ciMetadata)ciMetadataConstructor.instantiateWrapperFor(addr);
}
public GrowableArray<ciMetadata> objects() {
return GrowableArray.create(ciMetadataField.getValue(getAddress()), ciMetadataConstructor);
}
public GrowableArray<ciSymbol> symbols() {
return GrowableArray.create(symbolsField.getValue(getAddress()), ciSymbolConstructor);
}
public ciObjectFactory(Address addr) {
super(addr);
}
}
|
rokn/Count_Words_2015
|
testing/openjdk2/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObjectFactory.java
|
Java
|
mit
| 3,346
|
### Install Fish
Using Homebrew, you can now install [Fish](http://fishshell.com/), a smart and user-friendly command line shell. Remember, a shell is simply the user interface between you and your computer's operating system.
There are many command line shells availabe to choose from, each with their own strengths. Since it's easy to switch back and forth at any time, we recommend you give Fish a try for this workshop.
To get started, run the following command.
```
brew install fish
```
Run the following command to let your computer know it's safe to use Fish as your default shell.
```
echo '/usr/local/bin/fish' | sudo tee -a /etc/shells
```
**TIP:** This will require your account password which **will not** appear on the screen as you type.
Finally, run this command to make Fish your default shell.
```
chsh -s /usr/local/bin/fish
```
**TIP:** This will also require your account password which **will not** appear on the screen as you type.
Now, relaunch your Terminal and you'll see something like this.

Welcome to Fish! :tropical_fish:
### Improve the prompt
The prompt is the visual cornerstone of any shell, so let's change it to be both functional and glamorous. :nail_care:
To download and install a better prompt, run the following command.
```
curl -fsSL http://git.io/beJs | ruby
```
To verify the new prompt is installed correctly, relaunch the Terminal. You'll see something like this.

Here's a quick break down of what you're seeing.
| Component | Description |
| --------------------- | -------------------------------------- |
| `Wed Jan 28 08:53:47` | Date of your last login |
| `ttys006` | Name of your last terminal session |
| `~` (home directory) | Name of your working directory |
| `$` | Prompt symbol |
### Update the auto-completions
Fish's auto-completions enhance the user experience of most command line tools.
To update fish's completions, run the following command.
```
fish_update_completions
```
And you'll see something like this.

To try out auto-completions, start typing the following command.
```
brew in
```
And press the Tab key and you'll see something like this.

Finish typing the following command and press the Enter key.
```
brew info fish
```
And you'll see something like this.

### Leverage your history
Fish keeps a record of every command you've ever run. You can use that history to your advantage.
Start by typing the following command one more time.
```
brew in
```
This time you'll see an auto-suggestion based on the most recent matching command.

To use the auto-suggestion, press the right arrow ➡ key and hit the Enter key.

**TIP:** Use the up arrow ⬆ and the down arrow ⬇ keys to cycle through your entire history of commands.
### [⇐ Previous](2_homebrew.md) | [Next ⇒](4_sublime_text.md)
|
codefellows/pdx-w7-uge
|
prework/mac/3_fish.md
|
Markdown
|
mit
| 3,195
|
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/platform_file.h"
#include "base/file_path.h"
#include "base/logging.h"
#include "base/threading/thread_restrictions.h"
namespace base {
PlatformFile CreatePlatformFile(const FilePath& name,
int flags,
bool* created,
PlatformFileError* error_code) {
base::ThreadRestrictions::AssertIOAllowed();
DWORD disposition = 0;
if (flags & PLATFORM_FILE_OPEN)
disposition = OPEN_EXISTING;
if (flags & PLATFORM_FILE_CREATE) {
DCHECK(!disposition);
disposition = CREATE_NEW;
}
if (flags & PLATFORM_FILE_OPEN_ALWAYS) {
DCHECK(!disposition);
disposition = OPEN_ALWAYS;
}
if (flags & PLATFORM_FILE_CREATE_ALWAYS) {
DCHECK(!disposition);
disposition = CREATE_ALWAYS;
}
if (flags & PLATFORM_FILE_TRUNCATE) {
DCHECK(!disposition);
DCHECK(flags & PLATFORM_FILE_WRITE);
disposition = TRUNCATE_EXISTING;
}
if (!disposition) {
NOTREACHED();
return NULL;
}
DWORD access = (flags & PLATFORM_FILE_READ) ? GENERIC_READ : 0;
if (flags & PLATFORM_FILE_WRITE)
access |= GENERIC_WRITE;
if (flags & PLATFORM_FILE_WRITE_ATTRIBUTES)
access |= FILE_WRITE_ATTRIBUTES;
DWORD sharing = (flags & PLATFORM_FILE_EXCLUSIVE_READ) ? 0 : FILE_SHARE_READ;
if (!(flags & PLATFORM_FILE_EXCLUSIVE_WRITE))
sharing |= FILE_SHARE_WRITE;
DWORD create_flags = 0;
if (flags & PLATFORM_FILE_ASYNC)
create_flags |= FILE_FLAG_OVERLAPPED;
if (flags & PLATFORM_FILE_TEMPORARY)
create_flags |= FILE_ATTRIBUTE_TEMPORARY;
if (flags & PLATFORM_FILE_HIDDEN)
create_flags |= FILE_ATTRIBUTE_HIDDEN;
if (flags & PLATFORM_FILE_DELETE_ON_CLOSE)
create_flags |= FILE_FLAG_DELETE_ON_CLOSE;
HANDLE file = CreateFile(name.value().c_str(), access, sharing, NULL,
disposition, create_flags, NULL);
if (created && (INVALID_HANDLE_VALUE != file)) {
if (flags & (PLATFORM_FILE_OPEN_ALWAYS))
*created = (ERROR_ALREADY_EXISTS != GetLastError());
else if (flags & (PLATFORM_FILE_CREATE_ALWAYS | PLATFORM_FILE_CREATE))
*created = true;
}
if (error_code) {
if (file != kInvalidPlatformFileValue)
*error_code = PLATFORM_FILE_OK;
else {
DWORD last_error = GetLastError();
switch (last_error) {
case ERROR_SHARING_VIOLATION:
*error_code = PLATFORM_FILE_ERROR_IN_USE;
break;
case ERROR_FILE_EXISTS:
*error_code = PLATFORM_FILE_ERROR_EXISTS;
break;
case ERROR_FILE_NOT_FOUND:
*error_code = PLATFORM_FILE_ERROR_NOT_FOUND;
break;
case ERROR_ACCESS_DENIED:
*error_code = PLATFORM_FILE_ERROR_ACCESS_DENIED;
break;
default:
*error_code = PLATFORM_FILE_ERROR_FAILED;
}
}
}
return file;
}
bool ClosePlatformFile(PlatformFile file) {
base::ThreadRestrictions::AssertIOAllowed();
return (CloseHandle(file) != 0);
}
int ReadPlatformFile(PlatformFile file, int64 offset, char* data, int size) {
base::ThreadRestrictions::AssertIOAllowed();
if (file == kInvalidPlatformFileValue)
return -1;
LARGE_INTEGER offset_li;
offset_li.QuadPart = offset;
OVERLAPPED overlapped = {0};
overlapped.Offset = offset_li.LowPart;
overlapped.OffsetHigh = offset_li.HighPart;
DWORD bytes_read;
if (::ReadFile(file, data, size, &bytes_read, &overlapped) != 0)
return bytes_read;
else if (ERROR_HANDLE_EOF == GetLastError())
return 0;
return -1;
}
int WritePlatformFile(PlatformFile file, int64 offset,
const char* data, int size) {
base::ThreadRestrictions::AssertIOAllowed();
if (file == kInvalidPlatformFileValue)
return -1;
LARGE_INTEGER offset_li;
offset_li.QuadPart = offset;
OVERLAPPED overlapped = {0};
overlapped.Offset = offset_li.LowPart;
overlapped.OffsetHigh = offset_li.HighPart;
DWORD bytes_written;
if (::WriteFile(file, data, size, &bytes_written, &overlapped) != 0)
return bytes_written;
return -1;
}
bool TruncatePlatformFile(PlatformFile file, int64 length) {
base::ThreadRestrictions::AssertIOAllowed();
if (file == kInvalidPlatformFileValue)
return false;
// Get the current file pointer.
LARGE_INTEGER file_pointer;
LARGE_INTEGER zero;
zero.QuadPart = 0;
if (::SetFilePointerEx(file, zero, &file_pointer, FILE_CURRENT) == 0)
return false;
LARGE_INTEGER length_li;
length_li.QuadPart = length;
// If length > file size, SetFilePointerEx() should extend the file
// with zeroes on all Windows standard file systems (NTFS, FATxx).
if (!::SetFilePointerEx(file, length_li, NULL, FILE_BEGIN))
return false;
// Set the new file length and move the file pointer to its old position.
// This is consistent with ftruncate()'s behavior, even when the file
// pointer points to a location beyond the end of the file.
return ((::SetEndOfFile(file) != 0) &&
(::SetFilePointerEx(file, file_pointer, NULL, FILE_BEGIN) != 0));
}
bool FlushPlatformFile(PlatformFile file) {
base::ThreadRestrictions::AssertIOAllowed();
return ((file != kInvalidPlatformFileValue) && ::FlushFileBuffers(file));
}
bool TouchPlatformFile(PlatformFile file, const base::Time& last_access_time,
const base::Time& last_modified_time) {
base::ThreadRestrictions::AssertIOAllowed();
if (file == kInvalidPlatformFileValue)
return false;
FILETIME last_access_filetime = last_access_time.ToFileTime();
FILETIME last_modified_filetime = last_modified_time.ToFileTime();
return (::SetFileTime(file, NULL, &last_access_filetime,
&last_modified_filetime) != 0);
}
bool GetPlatformFileInfo(PlatformFile file, PlatformFileInfo* info) {
base::ThreadRestrictions::AssertIOAllowed();
if (!info)
return false;
BY_HANDLE_FILE_INFORMATION file_info;
if (GetFileInformationByHandle(file, &file_info) == 0)
return false;
LARGE_INTEGER size;
size.HighPart = file_info.nFileSizeHigh;
size.LowPart = file_info.nFileSizeLow;
info->size = size.QuadPart;
info->is_directory =
file_info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY != 0;
info->is_symbolic_link = false; // Windows doesn't have symbolic links.
info->last_modified = base::Time::FromFileTime(file_info.ftLastWriteTime);
info->last_accessed = base::Time::FromFileTime(file_info.ftLastAccessTime);
info->creation_time = base::Time::FromFileTime(file_info.ftCreationTime);
return true;
}
} // namespace disk_cache
|
xdajog/samsung_sources_i927
|
external/chromium/base/platform_file_win.cc
|
C++
|
gpl-2.0
| 6,732
|
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --expose-debug-as debug --allow-natives-syntax
// Test debug events when we only listen to uncaught exceptions, the Promise
// throws, and a catch handler is installed right before throwing.
// We expect no debug event to be triggered.
Debug = debug.Debug;
var p = new Promise(function(resolve, reject) {
resolve();
});
var q = p.chain(
function() {
q.catch(function(e) {
assertEquals("caught", e.message);
});
throw new Error("caught");
});
function listener(event, exec_state, event_data, data) {
try {
assertTrue(event != Debug.DebugEvent.Exception);
} catch (e) {
%AbortJS(e + "\n" + e.stack);
}
}
Debug.setBreakOnUncaughtException();
Debug.setListener(listener);
|
victorzhao/miniblink49
|
v8_4_5/test/mjsunit/es6/debug-promises/throw-caught-late.js
|
JavaScript
|
gpl-3.0
| 890
|
/**********************************************************************************
* $URL:$
* $Id:$
***********************************************************************************
*
* Copyright (c) 2008 The Sakai Foundation
*
* Licensed under the Educational Community License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/ECL-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
**********************************************************************************/
package org.sakaiproject.content.metadata.logic;
import java.util.List;
import org.sakaiproject.content.metadata.model.MetadataType;
/**
* Service providing tools to handle metadata on Content
*
* @author Colin Hebert
*/
public interface MetadataService
{
/**
* Get all metadata groups available on the server
*
* @return A list of metadata fields, or an empty list if there is none.
* @param resourceType Restricts the returned values to those applicable to this resourceType. Empty string means all.
*/
List<MetadataType> getMetadataAvailable(String resourceType);
/**
* Get all metadata groups available on the server for a specific site and resourceType
*
* @param siteId Site identifier
* @param resourceType Restricts the returned values to those applicable to this resourceType. Empty string means all.
* @return A list of metadata fields, or an empty list if there is none.
*/
List<MetadataType> getMetadataAvailable(String siteId, String resourceType);
}
|
ouit0408/sakai
|
content/content-metadata/api/src/java/org/sakaiproject/content/metadata/logic/MetadataService.java
|
Java
|
apache-2.0
| 1,899
|
/*
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.externalDependencies;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;
import java.util.List;
/**
* Stores list of external dependencies which are required for project to operate normally. Currently only one kind of dependencies
* is supported ({@link DependencyOnPlugin}) but in future it may also store required JDKs, application servers and generic path variables.
*
* @author nik
*/
public abstract class ExternalDependenciesManager {
public static ExternalDependenciesManager getInstance(@NotNull Project project) {
return ServiceManager.getService(project, ExternalDependenciesManager.class);
}
@NotNull
public abstract <T extends ProjectExternalDependency> List<T> getDependencies(@NotNull Class<T> aClass);
@NotNull
public abstract List<ProjectExternalDependency> getAllDependencies();
public abstract void setAllDependencies(@NotNull List<ProjectExternalDependency> dependencies);
}
|
asedunov/intellij-community
|
platform/platform-impl/src/com/intellij/externalDependencies/ExternalDependenciesManager.java
|
Java
|
apache-2.0
| 1,636
|
// ------------------------------------------------------------------
// Copyright (c) 2004-2007 Atheros Corporation. All rights reserved.
//
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
//
// ------------------------------------------------------------------
//===================================================================
// Author(s): ="Atheros"
//===================================================================
#ifndef _MBOX_REG_REG_H_
#define _MBOX_REG_REG_H_
#define MBOX_FIFO_ADDRESS 0x00000000
#define MBOX_FIFO_OFFSET 0x00000000
#define MBOX_FIFO_DATA_MSB 19
#define MBOX_FIFO_DATA_LSB 0
#define MBOX_FIFO_DATA_MASK 0x000fffff
#define MBOX_FIFO_DATA_GET(x) (((x) & MBOX_FIFO_DATA_MASK) >> MBOX_FIFO_DATA_LSB)
#define MBOX_FIFO_DATA_SET(x) (((x) << MBOX_FIFO_DATA_LSB) & MBOX_FIFO_DATA_MASK)
#define MBOX_FIFO_STATUS_ADDRESS 0x00000004
#define MBOX_FIFO_STATUS_OFFSET 0x00000004
#define MBOX_FIFO_STATUS_EMPTY_MSB 2
#define MBOX_FIFO_STATUS_EMPTY_LSB 2
#define MBOX_FIFO_STATUS_EMPTY_MASK 0x00000004
#define MBOX_FIFO_STATUS_EMPTY_GET(x) (((x) & MBOX_FIFO_STATUS_EMPTY_MASK) >> MBOX_FIFO_STATUS_EMPTY_LSB)
#define MBOX_FIFO_STATUS_EMPTY_SET(x) (((x) << MBOX_FIFO_STATUS_EMPTY_LSB) & MBOX_FIFO_STATUS_EMPTY_MASK)
#define MBOX_FIFO_STATUS_FULL_MSB 0
#define MBOX_FIFO_STATUS_FULL_LSB 0
#define MBOX_FIFO_STATUS_FULL_MASK 0x00000001
#define MBOX_FIFO_STATUS_FULL_GET(x) (((x) & MBOX_FIFO_STATUS_FULL_MASK) >> MBOX_FIFO_STATUS_FULL_LSB)
#define MBOX_FIFO_STATUS_FULL_SET(x) (((x) << MBOX_FIFO_STATUS_FULL_LSB) & MBOX_FIFO_STATUS_FULL_MASK)
#define MBOX_DMA_POLICY_ADDRESS 0x00000008
#define MBOX_DMA_POLICY_OFFSET 0x00000008
#define MBOX_DMA_POLICY_TX_FIFO_THRESH0_MSB 7
#define MBOX_DMA_POLICY_TX_FIFO_THRESH0_LSB 4
#define MBOX_DMA_POLICY_TX_FIFO_THRESH0_MASK 0x000000f0
#define MBOX_DMA_POLICY_TX_FIFO_THRESH0_GET(x) (((x) & MBOX_DMA_POLICY_TX_FIFO_THRESH0_MASK) >> MBOX_DMA_POLICY_TX_FIFO_THRESH0_LSB)
#define MBOX_DMA_POLICY_TX_FIFO_THRESH0_SET(x) (((x) << MBOX_DMA_POLICY_TX_FIFO_THRESH0_LSB) & MBOX_DMA_POLICY_TX_FIFO_THRESH0_MASK)
#define MBOX_DMA_POLICY_TX_QUANTUM_MSB 3
#define MBOX_DMA_POLICY_TX_QUANTUM_LSB 3
#define MBOX_DMA_POLICY_TX_QUANTUM_MASK 0x00000008
#define MBOX_DMA_POLICY_TX_QUANTUM_GET(x) (((x) & MBOX_DMA_POLICY_TX_QUANTUM_MASK) >> MBOX_DMA_POLICY_TX_QUANTUM_LSB)
#define MBOX_DMA_POLICY_TX_QUANTUM_SET(x) (((x) << MBOX_DMA_POLICY_TX_QUANTUM_LSB) & MBOX_DMA_POLICY_TX_QUANTUM_MASK)
#define MBOX_DMA_POLICY_TX_ORDER_MSB 2
#define MBOX_DMA_POLICY_TX_ORDER_LSB 2
#define MBOX_DMA_POLICY_TX_ORDER_MASK 0x00000004
#define MBOX_DMA_POLICY_TX_ORDER_GET(x) (((x) & MBOX_DMA_POLICY_TX_ORDER_MASK) >> MBOX_DMA_POLICY_TX_ORDER_LSB)
#define MBOX_DMA_POLICY_TX_ORDER_SET(x) (((x) << MBOX_DMA_POLICY_TX_ORDER_LSB) & MBOX_DMA_POLICY_TX_ORDER_MASK)
#define MBOX_DMA_POLICY_RX_QUANTUM_MSB 1
#define MBOX_DMA_POLICY_RX_QUANTUM_LSB 1
#define MBOX_DMA_POLICY_RX_QUANTUM_MASK 0x00000002
#define MBOX_DMA_POLICY_RX_QUANTUM_GET(x) (((x) & MBOX_DMA_POLICY_RX_QUANTUM_MASK) >> MBOX_DMA_POLICY_RX_QUANTUM_LSB)
#define MBOX_DMA_POLICY_RX_QUANTUM_SET(x) (((x) << MBOX_DMA_POLICY_RX_QUANTUM_LSB) & MBOX_DMA_POLICY_RX_QUANTUM_MASK)
#define MBOX_DMA_POLICY_RX_ORDER_MSB 0
#define MBOX_DMA_POLICY_RX_ORDER_LSB 0
#define MBOX_DMA_POLICY_RX_ORDER_MASK 0x00000001
#define MBOX_DMA_POLICY_RX_ORDER_GET(x) (((x) & MBOX_DMA_POLICY_RX_ORDER_MASK) >> MBOX_DMA_POLICY_RX_ORDER_LSB)
#define MBOX_DMA_POLICY_RX_ORDER_SET(x) (((x) << MBOX_DMA_POLICY_RX_ORDER_LSB) & MBOX_DMA_POLICY_RX_ORDER_MASK)
#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS 0x0000000c
#define MBOX0_DMA_RX_DESCRIPTOR_BASE_OFFSET 0x0000000c
#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MSB 27
#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB 2
#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc
#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB)
#define MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX0_DMA_RX_DESCRIPTOR_BASE_ADDRESS_MASK)
#define MBOX0_DMA_RX_CONTROL_ADDRESS 0x00000010
#define MBOX0_DMA_RX_CONTROL_OFFSET 0x00000010
#define MBOX0_DMA_RX_CONTROL_RESUME_MSB 2
#define MBOX0_DMA_RX_CONTROL_RESUME_LSB 2
#define MBOX0_DMA_RX_CONTROL_RESUME_MASK 0x00000004
#define MBOX0_DMA_RX_CONTROL_RESUME_GET(x) (((x) & MBOX0_DMA_RX_CONTROL_RESUME_MASK) >> MBOX0_DMA_RX_CONTROL_RESUME_LSB)
#define MBOX0_DMA_RX_CONTROL_RESUME_SET(x) (((x) << MBOX0_DMA_RX_CONTROL_RESUME_LSB) & MBOX0_DMA_RX_CONTROL_RESUME_MASK)
#define MBOX0_DMA_RX_CONTROL_START_MSB 1
#define MBOX0_DMA_RX_CONTROL_START_LSB 1
#define MBOX0_DMA_RX_CONTROL_START_MASK 0x00000002
#define MBOX0_DMA_RX_CONTROL_START_GET(x) (((x) & MBOX0_DMA_RX_CONTROL_START_MASK) >> MBOX0_DMA_RX_CONTROL_START_LSB)
#define MBOX0_DMA_RX_CONTROL_START_SET(x) (((x) << MBOX0_DMA_RX_CONTROL_START_LSB) & MBOX0_DMA_RX_CONTROL_START_MASK)
#define MBOX0_DMA_RX_CONTROL_STOP_MSB 0
#define MBOX0_DMA_RX_CONTROL_STOP_LSB 0
#define MBOX0_DMA_RX_CONTROL_STOP_MASK 0x00000001
#define MBOX0_DMA_RX_CONTROL_STOP_GET(x) (((x) & MBOX0_DMA_RX_CONTROL_STOP_MASK) >> MBOX0_DMA_RX_CONTROL_STOP_LSB)
#define MBOX0_DMA_RX_CONTROL_STOP_SET(x) (((x) << MBOX0_DMA_RX_CONTROL_STOP_LSB) & MBOX0_DMA_RX_CONTROL_STOP_MASK)
#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS 0x00000014
#define MBOX0_DMA_TX_DESCRIPTOR_BASE_OFFSET 0x00000014
#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MSB 27
#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB 2
#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK 0x0ffffffc
#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_GET(x) (((x) & MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK) >> MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB)
#define MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_SET(x) (((x) << MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_LSB) & MBOX0_DMA_TX_DESCRIPTOR_BASE_ADDRESS_MASK)
#define MBOX0_DMA_TX_CONTROL_ADDRESS 0x00000018
#define MBOX0_DMA_TX_CONTROL_OFFSET 0x00000018
#define MBOX0_DMA_TX_CONTROL_RESUME_MSB 2
#define MBOX0_DMA_TX_CONTROL_RESUME_LSB 2
#define MBOX0_DMA_TX_CONTROL_RESUME_MASK 0x00000004
#define MBOX0_DMA_TX_CONTROL_RESUME_GET(x) (((x) & MBOX0_DMA_TX_CONTROL_RESUME_MASK) >> MBOX0_DMA_TX_CONTROL_RESUME_LSB)
#define MBOX0_DMA_TX_CONTROL_RESUME_SET(x) (((x) << MBOX0_DMA_TX_CONTROL_RESUME_LSB) & MBOX0_DMA_TX_CONTROL_RESUME_MASK)
#define MBOX0_DMA_TX_CONTROL_START_MSB 1
#define MBOX0_DMA_TX_CONTROL_START_LSB 1
#define MBOX0_DMA_TX_CONTROL_START_MASK 0x00000002
#define MBOX0_DMA_TX_CONTROL_START_GET(x) (((x) & MBOX0_DMA_TX_CONTROL_START_MASK) >> MBOX0_DMA_TX_CONTROL_START_LSB)
#define MBOX0_DMA_TX_CONTROL_START_SET(x) (((x) << MBOX0_DMA_TX_CONTROL_START_LSB) & MBOX0_DMA_TX_CONTROL_START_MASK)
#define MBOX0_DMA_TX_CONTROL_STOP_MSB 0
#define MBOX0_DMA_TX_CONTROL_STOP_LSB 0
#define MBOX0_DMA_TX_CONTROL_STOP_MASK 0x00000001
#define MBOX0_DMA_TX_CONTROL_STOP_GET(x) (((x) & MBOX0_DMA_TX_CONTROL_STOP_MASK) >> MBOX0_DMA_TX_CONTROL_STOP_LSB)
#define MBOX0_DMA_TX_CONTROL_STOP_SET(x) (((x) << MBOX0_DMA_TX_CONTROL_STOP_LSB) & MBOX0_DMA_TX_CONTROL_STOP_MASK)
#define MBOX_FRAME_ADDRESS 0x0000001c
#define MBOX_FRAME_OFFSET 0x0000001c
#define MBOX_FRAME_RX_EOM_MSB 2
#define MBOX_FRAME_RX_EOM_LSB 2
#define MBOX_FRAME_RX_EOM_MASK 0x00000004
#define MBOX_FRAME_RX_EOM_GET(x) (((x) & MBOX_FRAME_RX_EOM_MASK) >> MBOX_FRAME_RX_EOM_LSB)
#define MBOX_FRAME_RX_EOM_SET(x) (((x) << MBOX_FRAME_RX_EOM_LSB) & MBOX_FRAME_RX_EOM_MASK)
#define MBOX_FRAME_RX_SOM_MSB 0
#define MBOX_FRAME_RX_SOM_LSB 0
#define MBOX_FRAME_RX_SOM_MASK 0x00000001
#define MBOX_FRAME_RX_SOM_GET(x) (((x) & MBOX_FRAME_RX_SOM_MASK) >> MBOX_FRAME_RX_SOM_LSB)
#define MBOX_FRAME_RX_SOM_SET(x) (((x) << MBOX_FRAME_RX_SOM_LSB) & MBOX_FRAME_RX_SOM_MASK)
#define FIFO_TIMEOUT_ADDRESS 0x00000020
#define FIFO_TIMEOUT_OFFSET 0x00000020
#define FIFO_TIMEOUT_ENABLE_MSB 8
#define FIFO_TIMEOUT_ENABLE_LSB 8
#define FIFO_TIMEOUT_ENABLE_MASK 0x00000100
#define FIFO_TIMEOUT_ENABLE_GET(x) (((x) & FIFO_TIMEOUT_ENABLE_MASK) >> FIFO_TIMEOUT_ENABLE_LSB)
#define FIFO_TIMEOUT_ENABLE_SET(x) (((x) << FIFO_TIMEOUT_ENABLE_LSB) & FIFO_TIMEOUT_ENABLE_MASK)
#define FIFO_TIMEOUT_VALUE_MSB 7
#define FIFO_TIMEOUT_VALUE_LSB 0
#define FIFO_TIMEOUT_VALUE_MASK 0x000000ff
#define FIFO_TIMEOUT_VALUE_GET(x) (((x) & FIFO_TIMEOUT_VALUE_MASK) >> FIFO_TIMEOUT_VALUE_LSB)
#define FIFO_TIMEOUT_VALUE_SET(x) (((x) << FIFO_TIMEOUT_VALUE_LSB) & FIFO_TIMEOUT_VALUE_MASK)
#define MBOX_INT_STATUS_ADDRESS 0x00000024
#define MBOX_INT_STATUS_OFFSET 0x00000024
#define MBOX_INT_STATUS_RX_DMA_COMPLETE_MSB 10
#define MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB 10
#define MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK 0x00000400
#define MBOX_INT_STATUS_RX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK) >> MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB)
#define MBOX_INT_STATUS_RX_DMA_COMPLETE_SET(x) (((x) << MBOX_INT_STATUS_RX_DMA_COMPLETE_LSB) & MBOX_INT_STATUS_RX_DMA_COMPLETE_MASK)
#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MSB 8
#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB 8
#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK 0x00000100
#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_GET(x) (((x) & MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK) >> MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB)
#define MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_SET(x) (((x) << MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_LSB) & MBOX_INT_STATUS_TX_DMA_EOM_COMPLETE_MASK)
#define MBOX_INT_STATUS_TX_DMA_COMPLETE_MSB 6
#define MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB 6
#define MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK 0x00000040
#define MBOX_INT_STATUS_TX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK) >> MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB)
#define MBOX_INT_STATUS_TX_DMA_COMPLETE_SET(x) (((x) << MBOX_INT_STATUS_TX_DMA_COMPLETE_LSB) & MBOX_INT_STATUS_TX_DMA_COMPLETE_MASK)
#define MBOX_INT_STATUS_TX_OVERFLOW_MSB 5
#define MBOX_INT_STATUS_TX_OVERFLOW_LSB 5
#define MBOX_INT_STATUS_TX_OVERFLOW_MASK 0x00000020
#define MBOX_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & MBOX_INT_STATUS_TX_OVERFLOW_MASK) >> MBOX_INT_STATUS_TX_OVERFLOW_LSB)
#define MBOX_INT_STATUS_TX_OVERFLOW_SET(x) (((x) << MBOX_INT_STATUS_TX_OVERFLOW_LSB) & MBOX_INT_STATUS_TX_OVERFLOW_MASK)
#define MBOX_INT_STATUS_RX_UNDERFLOW_MSB 4
#define MBOX_INT_STATUS_RX_UNDERFLOW_LSB 4
#define MBOX_INT_STATUS_RX_UNDERFLOW_MASK 0x00000010
#define MBOX_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & MBOX_INT_STATUS_RX_UNDERFLOW_MASK) >> MBOX_INT_STATUS_RX_UNDERFLOW_LSB)
#define MBOX_INT_STATUS_RX_UNDERFLOW_SET(x) (((x) << MBOX_INT_STATUS_RX_UNDERFLOW_LSB) & MBOX_INT_STATUS_RX_UNDERFLOW_MASK)
#define MBOX_INT_STATUS_TX_NOT_EMPTY_MSB 2
#define MBOX_INT_STATUS_TX_NOT_EMPTY_LSB 2
#define MBOX_INT_STATUS_TX_NOT_EMPTY_MASK 0x00000004
#define MBOX_INT_STATUS_TX_NOT_EMPTY_GET(x) (((x) & MBOX_INT_STATUS_TX_NOT_EMPTY_MASK) >> MBOX_INT_STATUS_TX_NOT_EMPTY_LSB)
#define MBOX_INT_STATUS_TX_NOT_EMPTY_SET(x) (((x) << MBOX_INT_STATUS_TX_NOT_EMPTY_LSB) & MBOX_INT_STATUS_TX_NOT_EMPTY_MASK)
#define MBOX_INT_STATUS_RX_NOT_FULL_MSB 0
#define MBOX_INT_STATUS_RX_NOT_FULL_LSB 0
#define MBOX_INT_STATUS_RX_NOT_FULL_MASK 0x00000001
#define MBOX_INT_STATUS_RX_NOT_FULL_GET(x) (((x) & MBOX_INT_STATUS_RX_NOT_FULL_MASK) >> MBOX_INT_STATUS_RX_NOT_FULL_LSB)
#define MBOX_INT_STATUS_RX_NOT_FULL_SET(x) (((x) << MBOX_INT_STATUS_RX_NOT_FULL_LSB) & MBOX_INT_STATUS_RX_NOT_FULL_MASK)
#define MBOX_INT_ENABLE_ADDRESS 0x00000028
#define MBOX_INT_ENABLE_OFFSET 0x00000028
#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_MSB 10
#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB 10
#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK 0x00000400
#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK) >> MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB)
#define MBOX_INT_ENABLE_RX_DMA_COMPLETE_SET(x) (((x) << MBOX_INT_ENABLE_RX_DMA_COMPLETE_LSB) & MBOX_INT_ENABLE_RX_DMA_COMPLETE_MASK)
#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MSB 8
#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB 8
#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK 0x00000100
#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_GET(x) (((x) & MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK) >> MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB)
#define MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_SET(x) (((x) << MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_LSB) & MBOX_INT_ENABLE_TX_DMA_EOM_COMPLETE_MASK)
#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_MSB 6
#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB 6
#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK 0x00000040
#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_GET(x) (((x) & MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK) >> MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB)
#define MBOX_INT_ENABLE_TX_DMA_COMPLETE_SET(x) (((x) << MBOX_INT_ENABLE_TX_DMA_COMPLETE_LSB) & MBOX_INT_ENABLE_TX_DMA_COMPLETE_MASK)
#define MBOX_INT_ENABLE_TX_OVERFLOW_MSB 5
#define MBOX_INT_ENABLE_TX_OVERFLOW_LSB 5
#define MBOX_INT_ENABLE_TX_OVERFLOW_MASK 0x00000020
#define MBOX_INT_ENABLE_TX_OVERFLOW_GET(x) (((x) & MBOX_INT_ENABLE_TX_OVERFLOW_MASK) >> MBOX_INT_ENABLE_TX_OVERFLOW_LSB)
#define MBOX_INT_ENABLE_TX_OVERFLOW_SET(x) (((x) << MBOX_INT_ENABLE_TX_OVERFLOW_LSB) & MBOX_INT_ENABLE_TX_OVERFLOW_MASK)
#define MBOX_INT_ENABLE_RX_UNDERFLOW_MSB 4
#define MBOX_INT_ENABLE_RX_UNDERFLOW_LSB 4
#define MBOX_INT_ENABLE_RX_UNDERFLOW_MASK 0x00000010
#define MBOX_INT_ENABLE_RX_UNDERFLOW_GET(x) (((x) & MBOX_INT_ENABLE_RX_UNDERFLOW_MASK) >> MBOX_INT_ENABLE_RX_UNDERFLOW_LSB)
#define MBOX_INT_ENABLE_RX_UNDERFLOW_SET(x) (((x) << MBOX_INT_ENABLE_RX_UNDERFLOW_LSB) & MBOX_INT_ENABLE_RX_UNDERFLOW_MASK)
#define MBOX_INT_ENABLE_TX_NOT_EMPTY_MSB 2
#define MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB 2
#define MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK 0x00000004
#define MBOX_INT_ENABLE_TX_NOT_EMPTY_GET(x) (((x) & MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK) >> MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB)
#define MBOX_INT_ENABLE_TX_NOT_EMPTY_SET(x) (((x) << MBOX_INT_ENABLE_TX_NOT_EMPTY_LSB) & MBOX_INT_ENABLE_TX_NOT_EMPTY_MASK)
#define MBOX_INT_ENABLE_RX_NOT_FULL_MSB 0
#define MBOX_INT_ENABLE_RX_NOT_FULL_LSB 0
#define MBOX_INT_ENABLE_RX_NOT_FULL_MASK 0x00000001
#define MBOX_INT_ENABLE_RX_NOT_FULL_GET(x) (((x) & MBOX_INT_ENABLE_RX_NOT_FULL_MASK) >> MBOX_INT_ENABLE_RX_NOT_FULL_LSB)
#define MBOX_INT_ENABLE_RX_NOT_FULL_SET(x) (((x) << MBOX_INT_ENABLE_RX_NOT_FULL_LSB) & MBOX_INT_ENABLE_RX_NOT_FULL_MASK)
#define MBOX_FIFO_RESET_ADDRESS 0x0000002c
#define MBOX_FIFO_RESET_OFFSET 0x0000002c
#define MBOX_FIFO_RESET_RX_INIT_MSB 2
#define MBOX_FIFO_RESET_RX_INIT_LSB 2
#define MBOX_FIFO_RESET_RX_INIT_MASK 0x00000004
#define MBOX_FIFO_RESET_RX_INIT_GET(x) (((x) & MBOX_FIFO_RESET_RX_INIT_MASK) >> MBOX_FIFO_RESET_RX_INIT_LSB)
#define MBOX_FIFO_RESET_RX_INIT_SET(x) (((x) << MBOX_FIFO_RESET_RX_INIT_LSB) & MBOX_FIFO_RESET_RX_INIT_MASK)
#define MBOX_FIFO_RESET_TX_INIT_MSB 0
#define MBOX_FIFO_RESET_TX_INIT_LSB 0
#define MBOX_FIFO_RESET_TX_INIT_MASK 0x00000001
#define MBOX_FIFO_RESET_TX_INIT_GET(x) (((x) & MBOX_FIFO_RESET_TX_INIT_MASK) >> MBOX_FIFO_RESET_TX_INIT_LSB)
#define MBOX_FIFO_RESET_TX_INIT_SET(x) (((x) << MBOX_FIFO_RESET_TX_INIT_LSB) & MBOX_FIFO_RESET_TX_INIT_MASK)
#define MBOX_DEBUG_CHAIN0_ADDRESS 0x00000030
#define MBOX_DEBUG_CHAIN0_OFFSET 0x00000030
#define MBOX_DEBUG_CHAIN0_ADDRESS_MSB 31
#define MBOX_DEBUG_CHAIN0_ADDRESS_LSB 0
#define MBOX_DEBUG_CHAIN0_ADDRESS_MASK 0xffffffff
#define MBOX_DEBUG_CHAIN0_ADDRESS_GET(x) (((x) & MBOX_DEBUG_CHAIN0_ADDRESS_MASK) >> MBOX_DEBUG_CHAIN0_ADDRESS_LSB)
#define MBOX_DEBUG_CHAIN0_ADDRESS_SET(x) (((x) << MBOX_DEBUG_CHAIN0_ADDRESS_LSB) & MBOX_DEBUG_CHAIN0_ADDRESS_MASK)
#define MBOX_DEBUG_CHAIN1_ADDRESS 0x00000034
#define MBOX_DEBUG_CHAIN1_OFFSET 0x00000034
#define MBOX_DEBUG_CHAIN1_ADDRESS_MSB 31
#define MBOX_DEBUG_CHAIN1_ADDRESS_LSB 0
#define MBOX_DEBUG_CHAIN1_ADDRESS_MASK 0xffffffff
#define MBOX_DEBUG_CHAIN1_ADDRESS_GET(x) (((x) & MBOX_DEBUG_CHAIN1_ADDRESS_MASK) >> MBOX_DEBUG_CHAIN1_ADDRESS_LSB)
#define MBOX_DEBUG_CHAIN1_ADDRESS_SET(x) (((x) << MBOX_DEBUG_CHAIN1_ADDRESS_LSB) & MBOX_DEBUG_CHAIN1_ADDRESS_MASK)
#define MBOX_DEBUG_CHAIN0_SIGNALS_ADDRESS 0x00000038
#define MBOX_DEBUG_CHAIN0_SIGNALS_OFFSET 0x00000038
#define MBOX_DEBUG_CHAIN0_SIGNALS_COLLECTION_MSB 31
#define MBOX_DEBUG_CHAIN0_SIGNALS_COLLECTION_LSB 0
#define MBOX_DEBUG_CHAIN0_SIGNALS_COLLECTION_MASK 0xffffffff
#define MBOX_DEBUG_CHAIN0_SIGNALS_COLLECTION_GET(x) (((x) & MBOX_DEBUG_CHAIN0_SIGNALS_COLLECTION_MASK) >> MBOX_DEBUG_CHAIN0_SIGNALS_COLLECTION_LSB)
#define MBOX_DEBUG_CHAIN0_SIGNALS_COLLECTION_SET(x) (((x) << MBOX_DEBUG_CHAIN0_SIGNALS_COLLECTION_LSB) & MBOX_DEBUG_CHAIN0_SIGNALS_COLLECTION_MASK)
#define MBOX_DEBUG_CHAIN1_SIGNALS_ADDRESS 0x0000003c
#define MBOX_DEBUG_CHAIN1_SIGNALS_OFFSET 0x0000003c
#define MBOX_DEBUG_CHAIN1_SIGNALS_COLLECTION_MSB 31
#define MBOX_DEBUG_CHAIN1_SIGNALS_COLLECTION_LSB 0
#define MBOX_DEBUG_CHAIN1_SIGNALS_COLLECTION_MASK 0xffffffff
#define MBOX_DEBUG_CHAIN1_SIGNALS_COLLECTION_GET(x) (((x) & MBOX_DEBUG_CHAIN1_SIGNALS_COLLECTION_MASK) >> MBOX_DEBUG_CHAIN1_SIGNALS_COLLECTION_LSB)
#define MBOX_DEBUG_CHAIN1_SIGNALS_COLLECTION_SET(x) (((x) << MBOX_DEBUG_CHAIN1_SIGNALS_COLLECTION_LSB) & MBOX_DEBUG_CHAIN1_SIGNALS_COLLECTION_MASK)
#ifndef __ASSEMBLER__
typedef struct mbox_reg_reg_s {
volatile unsigned int mbox_fifo[1];
volatile unsigned int mbox_fifo_status;
volatile unsigned int mbox_dma_policy;
volatile unsigned int mbox0_dma_rx_descriptor_base;
volatile unsigned int mbox0_dma_rx_control;
volatile unsigned int mbox0_dma_tx_descriptor_base;
volatile unsigned int mbox0_dma_tx_control;
volatile unsigned int mbox_frame;
volatile unsigned int fifo_timeout;
volatile unsigned int mbox_int_status;
volatile unsigned int mbox_int_enable;
volatile unsigned int mbox_fifo_reset;
volatile unsigned int mbox_debug_chain0;
volatile unsigned int mbox_debug_chain1;
volatile unsigned int mbox_debug_chain0_signals;
volatile unsigned int mbox_debug_chain1_signals;
} mbox_reg_reg_t;
#endif /* __ASSEMBLER__ */
#endif /* _MBOX_REG_H_ */
|
Michael-Pizzileo/lichee-3.0.8-leaked
|
modules/wifi/ar6302/AR6K_SDK_ISC.build_3.1_RC.329/include/AR6002/hw6.0/hw/mbox_i2s_reg.h
|
C
|
gpl-2.0
| 20,584
|
/**
* Copyright (c) 2010-2015, openHAB.org and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.openhab.binding.homematic.internal.bus;
import java.util.Dictionary;
import java.util.TimerTask;
import org.openhab.binding.homematic.HomematicBindingProvider;
import org.openhab.binding.homematic.internal.common.HomematicContext;
import org.openhab.binding.homematic.internal.communicator.HomematicCommunicator;
import org.openhab.binding.homematic.internal.config.binding.HomematicBindingConfig;
import org.openhab.binding.homematic.internal.util.BindingChangedDelayedExecutor;
import org.openhab.core.binding.AbstractActiveBinding;
import org.openhab.core.binding.BindingProvider;
import org.openhab.core.events.EventPublisher;
import org.openhab.core.items.Item;
import org.openhab.core.types.Command;
import org.openhab.core.types.State;
import org.osgi.service.cm.ConfigurationException;
import org.osgi.service.cm.ManagedService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Homematic binding implementation.
*
* @author Gerhard Riegler
* @since 1.5.0
*/
public class HomematicBinding extends AbstractActiveBinding<HomematicBindingProvider> implements ManagedService {
private static final Logger logger = LoggerFactory.getLogger(HomematicBinding.class);
private HomematicContext context = HomematicContext.getInstance();
private HomematicCommunicator communicator = new HomematicCommunicator();
private BindingChangedDelayedExecutor delayedExecutor = new BindingChangedDelayedExecutor(communicator);
/**
* Adding shudown hook to stop the Homematic server communicator.
*/
public HomematicBinding() {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
communicator.stop();
}
});
}
/**
* Saves the eventPublisher in the Homematic context.
*/
@Override
public void setEventPublisher(EventPublisher eventPublisher) {
super.setEventPublisher(eventPublisher);
context.setEventPublisher(eventPublisher);
}
/**
* Saves the providers in the Homematic context.
*/
@Override
public void activate() {
context.setProviders(providers);
}
/**
* Stops the communicator.
*/
@Override
public void deactivate() {
communicator.stop();
}
/**
* Updates the configuration for the binding and (re-)starts the
* communicator.
*/
@Override
public void updated(Dictionary<String, ?> config) throws ConfigurationException {
if (config != null) {
setProperlyConfigured(false);
communicator.stop();
context.getConfig().parse(config);
logger.info(context.getConfig().toString());
if (context.getConfig().isValid()) {
communicator.start();
setProperlyConfigured(true);
for (HomematicBindingProvider hmProvider : providers) {
for (String itemName : hmProvider.getItemNames()) {
informCommunicator(hmProvider, itemName);
}
}
}
}
}
/**
* {@inheritDoc}
*/
@Override
public void allBindingsChanged(BindingProvider provider) {
super.allBindingsChanged(provider);
if (isProperlyConfigured()) {
if (provider instanceof HomematicBindingProvider) {
HomematicBindingProvider hmProvider = (HomematicBindingProvider) provider;
for (String itemName : hmProvider.getItemNames()) {
informCommunicator(hmProvider, itemName);
}
}
}
}
/**
* {@inheritDoc}
*/
@Override
public void bindingChanged(BindingProvider provider, String itemName) {
super.bindingChanged(provider, itemName);
if (isProperlyConfigured()) {
if (provider instanceof HomematicBindingProvider) {
HomematicBindingProvider hmProvider = (HomematicBindingProvider) provider;
informCommunicator(hmProvider, itemName);
}
}
}
/**
* Schedules a job with a short delay to populate changed items to openHAB
* after startup or an item reload.
*
* @see BindingChangedDelayedExecutor
*/
private void informCommunicator(HomematicBindingProvider hmProvider, String itemName) {
final Item item = hmProvider.getItem(itemName);
final HomematicBindingConfig bindingConfig = hmProvider.getBindingFor(itemName);
if (bindingConfig != null) {
delayedExecutor.cancel();
delayedExecutor.addBindingConfig(item, bindingConfig);
delayedExecutor.schedule(new TimerTask() {
@Override
public void run() {
delayedExecutor.publishChangedBindings();
}
}, 3000);
}
}
/**
* Receives a command and send it to the Homematic communicator.
*/
@Override
protected void internalReceiveCommand(String itemName, Command command) {
for (HomematicBindingProvider provider : providers) {
Item item = provider.getItem(itemName);
HomematicBindingConfig config = provider.getBindingFor(itemName);
communicator.receiveCommand(item, command, config);
}
}
/**
* Receives a state and send it to the Homematic communicator.
*/
@Override
protected void internalReceiveUpdate(String itemName, State newState) {
for (HomematicBindingProvider provider : providers) {
Item item = provider.getItem(itemName);
HomematicBindingConfig config = provider.getBindingFor(itemName);
communicator.receiveUpdate(item, newState, config);
}
}
/**
* Restarts the Homematic communicator if no messages arrive within a
* configured time or the reconnect interval is reached.
*/
@Override
protected void execute() {
if (context.getConfig().getReconnectInterval() == null) {
long timeSinceLastEvent = (System.currentTimeMillis() - communicator.getLastEventTime()) / 1000;
if (timeSinceLastEvent >= context.getConfig().getAliveInterval()) {
logger.info("No event since {} seconds, refreshing Homematic server connections", timeSinceLastEvent);
communicator.stop();
communicator.start();
}
} else {
long timeSinceLastReconnect = (System.currentTimeMillis() - communicator.getLastReconnectTime()) / 1000;
if (timeSinceLastReconnect >= context.getConfig().getReconnectInterval()) {
logger.info("Reconnect interval reached, refreshing Homematic server connections");
communicator.stop();
communicator.start();
}
}
}
/**
* {@inheritDoc}
*/
@Override
protected long getRefreshInterval() {
return 60000;
}
/**
* {@inheritDoc}
*/
@Override
protected String getName() {
return "Homematic server connection tracker";
}
}
|
Greblys/openhab
|
bundles/binding/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/bus/HomematicBinding.java
|
Java
|
epl-1.0
| 6,517
|
/*
* grunt
* http://gruntjs.com/
*
* Copyright (c) 2012 "Cowboy" Ben Alman
* Licensed under the MIT license.
* https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
*/
var grunt = require('../grunt');
// Nodejs libs.
var path = require('path');
var fs = require('fs');
// In Nodejs 0.8.0, existsSync moved from path -> fs.
var existsSync = fs.existsSync || path.existsSync;
// Extend generic "task" utils lib.
var parent = grunt.utils.task.create();
// The module to be exported.
var task = module.exports = Object.create(parent);
// An internal registry of tasks and handlers.
var registry = {};
// Keep track of the number of log.error() calls.
var errorcount;
// Override built-in registerTask.
task.registerTask = function(name, info, fn) {
// Add task to registry.
registry.tasks.push(name);
// Register task.
parent.registerTask.apply(task, arguments);
// This task, now that it's been registered.
var thisTask = task._tasks[name];
// Override task function.
var _fn = thisTask.fn;
thisTask.fn = function(arg) {
// Initialize the errorcount for this task.
errorcount = grunt.fail.errorcount;
// Return the number of errors logged during this task.
this.__defineGetter__('errorCount', function() {
return grunt.fail.errorcount - errorcount;
});
// Expose task.requires on `this`.
this.requires = task.requires.bind(task);
// Expose config.requires on `this`.
this.requiresConfig = grunt.config.requires;
// If this task was an alias or a multi task called without a target,
// only log if in verbose mode.
var logger = _fn.alias || (thisTask.multi && (!arg || arg === '*')) ? 'verbose' : 'log';
// Actually log.
grunt[logger].header('Running "' + this.nameArgs + '"' +
(this.name !== this.nameArgs ? ' (' + this.name + ')' : '') + ' task');
// Actually run the task.
return _fn.apply(this, arguments);
};
return task;
};
// This is the most common "multi task" pattern.
task.registerMultiTask = function(name, info, fn) {
// Store a reference to the task object, in case the task gets renamed.
var thisTask;
task.registerTask(name, info, function(target) {
// Guaranteed to always be the actual task name.
var name = thisTask.name;
// If a target wasn't specified, run this task once for each target.
if (!target || target === '*') {
return task.runAllTargets(name, grunt.utils.toArray(arguments).slice(1));
}
// Fail if any required config properties have been omitted.
this.requiresConfig([name, target]);
// Expose data on `this` (as well as task.current).
this.data = grunt.config([name, target]);
// Expose file object on `this` (as well as task.current).
this.file = {};
// Handle data structured like either:
// 'prop': [srcfiles]
// {prop: {src: [srcfiles], dest: 'destfile'}}.
if (grunt.utils.kindOf(this.data) === 'object') {
if ('src' in this.data) { this.file.src = this.data.src; }
if ('dest' in this.data) { this.file.dest = this.data.dest; }
} else {
this.file.src = this.data;
this.file.dest = target;
}
// Process src as a template (recursively, if necessary).
if (this.file.src) {
this.file.src = grunt.utils.recurse(this.file.src, function(src) {
if (typeof src !== 'string') { return src; }
return grunt.template.process(src);
});
}
// Process dest as a template.
if (this.file.dest) {
this.file.dest = grunt.template.process(this.file.dest);
}
// Expose the current target.
this.target = target;
// Remove target from args.
this.args = grunt.utils.toArray(arguments).slice(1);
// Recreate flags object so that the target isn't set as a flag.
this.flags = {};
this.args.forEach(function(arg) { this.flags[arg] = true; }, this);
// Call original task function, passing in the target and any other args.
return fn.apply(this, this.args);
});
thisTask = task._tasks[name];
thisTask.multi = true;
};
// Init tasks don't require properties in config, and as such will preempt
// config loading errors.
task.registerInitTask = function(name, info, fn) {
task.registerTask(name, info, fn);
task._tasks[name].init = true;
};
// Override built-in registerHelper to use the registry.
task.registerHelper = function(name, fn) {
// Add task to registry.
registry.helpers.push(name);
// Actually register task.
return parent.registerHelper.apply(task, arguments);
};
// If a property wasn't passed, run all task targets in turn.
task.runAllTargets = function(taskname, args) {
// Get an array of sub-property keys under the given config object.
var targets = Object.keys(grunt.config(taskname) || {});
// Fail if there are no actual properties to iterate over.
if (targets.length === 0) {
grunt.log.error('No "' + taskname + '" targets found.');
return false;
}
// Iterate over all properties not starting with _, running a task for each.
targets.filter(function(target) {
return !/^_/.test(target);
}).forEach(function(target) {
// Be sure to pass in any additionally specified args.
task.run([taskname, target].concat(args || []).join(':'));
});
};
// Load tasks and handlers from a given tasks file.
var loadTaskStack = [];
function loadTask(filepath) {
// In case this was called recursively, save registry for later.
loadTaskStack.push({tasks: registry.tasks, helpers: registry.helpers});
// Reset registry.
registry.tasks = [];
registry.helpers = [];
var filename = path.basename(filepath);
var msg = 'Loading "' + filename + '" tasks and helpers...';
var fn;
try {
// Load taskfile.
fn = require(path.resolve(filepath));
if (typeof fn === 'function') {
fn.call(grunt, grunt);
}
grunt.verbose.write(msg).ok();
if (registry.tasks.length === 0 && registry.helpers.length === 0) {
grunt.verbose.error('No new tasks or helpers found.');
} else {
if (registry.tasks.length > 0) {
grunt.verbose.writeln('Tasks: ' + grunt.log.wordlist(registry.tasks));
}
if (registry.helpers.length > 0) {
grunt.verbose.writeln('Helpers: ' + grunt.log.wordlist(registry.helpers));
}
}
} catch(e) {
// Something went wrong.
grunt.log.write(msg).error().verbose.error(e.stack).or.error(e);
}
// Restore registry.
var obj = loadTaskStack.pop() || {};
registry.tasks = obj.tasks || [];
registry.helpers = obj.helpers || [];
}
// Log a message when loading tasks.
function loadTasksMessage(info) {
grunt.verbose.subhead('Registering ' + info + ' tasks.');
}
// Load tasks and handlers from a given directory.
function loadTasks(tasksdir) {
try {
fs.readdirSync(tasksdir).filter(function(filename) {
// Filter out non-.js files.
return path.extname(filename).toLowerCase() === '.js';
}).forEach(function(filename) {
// Load task.
loadTask(path.join(tasksdir, filename));
});
} catch(e) {
grunt.log.verbose.error(e.stack).or.error(e);
}
}
// Directories to be searched for tasks files and "extra" files.
task.searchDirs = [];
// Return an array of all task-specific file paths that match the given
// wildcard patterns. Instead of returing a string for each file path, return
// an object with useful properties. When coerced to String, each object will
// yield its absolute path.
function expandByMethod(method) {
var args = grunt.utils.toArray(arguments).slice(1);
// If the first argument is an options object, remove and save it for later.
var options = grunt.utils.kindOf(args[0]) === 'object' ? args.shift() : {};
// Use the first argument if it's an Array, otherwise convert the arguments
// object to an array and use that.
var patterns = Array.isArray(args[0]) ? args[0] : args;
var filepaths = {};
// When any returned array item is used in a string context, return the
// absolute path.
var toString = function() { return this.abs; };
// Iterate over all searchDirs.
task.searchDirs.forEach(function(dirpath) {
// Create an array of absolute patterns.
var args = patterns.map(function(pattern) {
return path.join(dirpath, pattern);
});
// Add the options object back onto the beginning of the arguments array.
args.unshift(options);
// Expand the paths in case a wildcard was passed.
grunt.file[method].apply(null, args).forEach(function(abspath) {
var relpath = abspath.slice(dirpath.length + 1);
if (relpath in filepaths) { return; }
// Update object at this relpath only if it doesn't already exist.
filepaths[relpath] = {
abs: abspath,
rel: relpath,
base: abspath.slice(0, dirpath.length),
toString: toString
};
});
});
// Return an array of objects.
return Object.keys(filepaths).map(function(relpath) {
return filepaths[relpath];
});
}
// A few type-specific task expansion methods. These methods all return arrays
// of file objects.
task.expand = expandByMethod.bind(task, 'expand');
task.expandDirs = expandByMethod.bind(task, 'expandDirs');
task.expandFiles = expandByMethod.bind(task, 'expandFiles');
// Get a single task file path.
task.getFile = function() {
var filepath = path.join.apply(path, arguments);
var fileobj = task.expand(filepath)[0];
return fileobj ? String(fileobj) : null;
};
// Read JSON defaults from task files (if they exist), merging them into one.
// data object.
var readDefaults = {};
task.readDefaults = function() {
var filepath = path.join.apply(path, arguments);
var result = readDefaults[filepath];
var filepaths;
if (!result) {
result = readDefaults[filepath] = {};
// Find all matching taskfiles.
filepaths = task.searchDirs.map(function(dirpath) {
return path.join(dirpath, filepath);
}).filter(function(filepath) {
return existsSync(filepath) && fs.statSync(filepath).isFile();
});
// Load defaults data.
if (filepaths.length) {
grunt.verbose.subhead('Loading data from ' + filepath);
// Since extras path order goes from most-specific to least-specific, only
// add-in properties that don't already exist.
filepaths.forEach(function(filepath) {
grunt.utils._.defaults(result, grunt.file.readJSON(filepath));
});
}
}
return result;
};
// Load tasks and handlers from a given directory.
task.loadTasks = function(tasksdir) {
loadTasksMessage('"' + tasksdir + '"');
if (existsSync(tasksdir)) {
task.searchDirs.unshift(tasksdir);
loadTasks(tasksdir);
} else {
grunt.log.error('Tasks directory "' + tasksdir + '" not found.');
}
};
// Load tasks and handlers from a given locally-installed Npm module (installed
// relative to the base dir).
task.loadNpmTasks = function(name) {
loadTasksMessage('"' + name + '" local Npm module');
var root = path.resolve('node_modules');
var pkgfile = path.join(root, name, 'package.json');
var pkg = existsSync(pkgfile) ? grunt.file.readJSON(pkgfile) : {};
// Process collection plugins.
if (pkg.keywords && pkg.keywords.indexOf('gruntcollection') !== -1) {
Object.keys(pkg.dependencies).forEach(function(depName) {
// Npm sometimes pulls dependencies out if they're shared, so find
// upwards if not found locally.
var filepath = grunt.file.findup(path.resolve('node_modules', name),
'node_modules/' + depName);
if (filepath) {
// Load this task plugin recursively.
task.loadNpmTasks(path.relative(root, filepath));
}
});
return;
}
// Process task plugins.
var tasksdir = path.join(root, name, 'tasks');
if (existsSync(tasksdir)) {
task.searchDirs.unshift(tasksdir);
loadTasks(tasksdir);
} else {
grunt.log.error('Local Npm module "' + name + '" not found. Is it installed?');
}
};
// Load tasks and handlers from a given Npm module, installed relative to the
// version of grunt being run.
function loadNpmTasksWithRequire(name) {
loadTasksMessage('"' + name + '" npm module');
var dirpath;
try {
dirpath = require.resolve(name);
dirpath = path.resolve(path.join(path.dirname(dirpath), 'tasks'));
if (existsSync(dirpath)) {
task.searchDirs.unshift(dirpath);
loadTasks(dirpath);
return;
}
} catch (e) {}
grunt.log.error('Npm module "' + name + '" not found. Is it installed?');
}
// Initialize tasks.
task.init = function(tasks, options) {
if (!options) { options = {}; }
// Load all built-in tasks.
var tasksdir = path.resolve(__dirname, '../../tasks');
task.searchDirs.unshift(tasksdir);
loadTasksMessage('built-in');
loadTasks(tasksdir);
// Grunt was loaded from a Npm-installed plugin bin script. Load any tasks
// that were specified via grunt.npmTasks.
grunt._npmTasks.forEach(loadNpmTasksWithRequire);
// Were only init tasks specified?
var allInit = tasks.length > 0 && tasks.every(function(name) {
var obj = task._taskPlusArgs(name).task;
return obj && obj.init;
});
// Get any local configfile or tasks that might exist. Use --config override
// if specified, otherwise search the current directory or any parent.
var configfile = allInit ? null : grunt.option('config') ||
grunt.file.findup(process.cwd(), 'grunt.js');
var msg = 'Reading "' + path.basename(configfile) + '" config file...';
if (configfile && existsSync(configfile)) {
grunt.verbose.writeln().write(msg).ok();
// Change working directory so that all paths are relative to the
// configfile's location (or the --base option, if specified).
process.chdir(grunt.option('base') || path.dirname(configfile));
// Load local tasks, if the file exists.
loadTask(configfile);
} else if (options.help || allInit) {
// Don't complain about missing config file.
} else if (grunt.option('config')) {
// If --config override was specified and it doesn't exist, complain.
grunt.log.writeln().write(msg).error();
grunt.fatal('Unable to find "' + configfile + '" config file.', 2);
} else if (!grunt.option('help')) {
grunt.verbose.writeln().write(msg).error();
grunt.fatal('Unable to find "grunt.js" config file. Do you need any --help?', 2);
}
// Load all user-specified --npm tasks.
(grunt.option('npm') || []).forEach(task.loadNpmTasks);
// Load all user-specified --tasks.
(grunt.option('tasks') || []).forEach(task.loadTasks);
// Load user .grunt tasks.
tasksdir = grunt.file.userDir('tasks');
if (tasksdir) {
task.searchDirs.unshift(tasksdir);
loadTasksMessage('user');
loadTasks(tasksdir);
}
// Search dirs should be unique and fully normalized absolute paths.
task.searchDirs = grunt.utils._.uniq(task.searchDirs).map(function(filepath) {
return path.resolve(filepath);
});
};
|
Dilts/GruntworkflowWordpress
|
wp-content/themes/testGRUNT/src/node_modules/grunt-css/node_modules/grunt/lib/grunt/task.js
|
JavaScript
|
gpl-2.0
| 14,837
|
/******************************************************************************
*
* Copyright(c) 2009-2012 Realtek Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* 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.
*
* The full GNU General Public License is included in this distribution in the
* file called LICENSE.
*
* Contact Information:
* wlanfae <wlanfae@realtek.com>
* Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
* Hsinchu 300, Taiwan.
*
* Larry Finger <Larry.Finger@lwfinger.net>
*
*****************************************************************************/
#include "wifi.h"
#include "base.h"
#include "ps.h"
#include <linux/export.h>
#include "btcoexist/rtl_btc.h"
bool rtl_ps_enable_nic(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtl_mac *rtlmac = rtl_mac(rtl_priv(hw));
/*<1> reset trx ring */
if (rtlhal->interface == INTF_PCI)
rtlpriv->intf_ops->reset_trx_ring(hw);
if (is_hal_stop(rtlhal))
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
"Driver is already down!\n");
/*<2> Enable Adapter */
if (rtlpriv->cfg->ops->hw_init(hw))
return false;
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RETRY_LIMIT,
&rtlmac->retry_long);
RT_CLEAR_PS_LEVEL(ppsc, RT_RF_OFF_LEVL_HALT_NIC);
rtlpriv->cfg->ops->switch_channel(hw);
rtlpriv->cfg->ops->set_channel_access(hw);
rtlpriv->cfg->ops->set_bw_mode(hw,
cfg80211_get_chandef_type(&hw->conf.chandef));
/*<3> Enable Interrupt */
rtlpriv->cfg->ops->enable_interrupt(hw);
/*<enable timer> */
rtl_watch_dog_timer_callback(&rtlpriv->works.watchdog_timer);
return true;
}
EXPORT_SYMBOL(rtl_ps_enable_nic);
bool rtl_ps_disable_nic(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
/*<1> Stop all timer */
rtl_deinit_deferred_work(hw, true);
/*<2> Disable Interrupt */
rtlpriv->cfg->ops->disable_interrupt(hw);
tasklet_kill(&rtlpriv->works.irq_tasklet);
/*<3> Disable Adapter */
rtlpriv->cfg->ops->hw_disable(hw);
return true;
}
EXPORT_SYMBOL(rtl_ps_disable_nic);
static bool rtl_ps_set_rf_state(struct ieee80211_hw *hw,
enum rf_pwrstate state_toset,
u32 changesource)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
enum rf_pwrstate rtstate;
bool actionallowed = false;
u16 rfwait_cnt = 0;
/*Only one thread can change
*the RF state at one time, and others
*should wait to be executed.
*/
while (true) {
spin_lock(&rtlpriv->locks.rf_ps_lock);
if (ppsc->rfchange_inprogress) {
spin_unlock(&rtlpriv->locks.rf_ps_lock);
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
"RF Change in progress! Wait to set..state_toset(%d).\n",
state_toset);
/* Set RF after the previous action is done. */
while (ppsc->rfchange_inprogress) {
rfwait_cnt++;
mdelay(1);
/*Wait too long, return false to avoid
*to be stuck here.
*/
if (rfwait_cnt > 100)
return false;
}
} else {
ppsc->rfchange_inprogress = true;
spin_unlock(&rtlpriv->locks.rf_ps_lock);
break;
}
}
rtstate = ppsc->rfpwr_state;
switch (state_toset) {
case ERFON:
ppsc->rfoff_reason &= (~changesource);
if ((changesource == RF_CHANGE_BY_HW) &&
(ppsc->hwradiooff)) {
ppsc->hwradiooff = false;
}
if (!ppsc->rfoff_reason) {
ppsc->rfoff_reason = 0;
actionallowed = true;
}
break;
case ERFOFF:
if ((changesource == RF_CHANGE_BY_HW) && !ppsc->hwradiooff) {
ppsc->hwradiooff = true;
}
ppsc->rfoff_reason |= changesource;
actionallowed = true;
break;
case ERFSLEEP:
ppsc->rfoff_reason |= changesource;
actionallowed = true;
break;
default:
pr_err("switch case %#x not processed\n", state_toset);
break;
}
if (actionallowed)
rtlpriv->cfg->ops->set_rf_power_state(hw, state_toset);
spin_lock(&rtlpriv->locks.rf_ps_lock);
ppsc->rfchange_inprogress = false;
spin_unlock(&rtlpriv->locks.rf_ps_lock);
return actionallowed;
}
static void _rtl_ps_inactive_ps(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
ppsc->swrf_processing = true;
if (ppsc->inactive_pwrstate == ERFON &&
rtlhal->interface == INTF_PCI) {
if ((ppsc->reg_rfps_level & RT_RF_OFF_LEVL_ASPM) &&
RT_IN_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM) &&
rtlhal->interface == INTF_PCI) {
rtlpriv->intf_ops->disable_aspm(hw);
RT_CLEAR_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM);
}
}
rtl_ps_set_rf_state(hw, ppsc->inactive_pwrstate,
RF_CHANGE_BY_IPS);
if (ppsc->inactive_pwrstate == ERFOFF &&
rtlhal->interface == INTF_PCI) {
if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_ASPM &&
!RT_IN_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM)) {
rtlpriv->intf_ops->enable_aspm(hw);
RT_SET_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM);
}
}
ppsc->swrf_processing = false;
}
void rtl_ips_nic_off_wq_callback(void *data)
{
struct rtl_works *rtlworks =
container_of_dwork_rtl(data, struct rtl_works, ips_nic_off_wq);
struct ieee80211_hw *hw = rtlworks->hw;
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
enum rf_pwrstate rtstate;
if (mac->opmode != NL80211_IFTYPE_STATION) {
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
"not station return\n");
return;
}
if (mac->p2p_in_use)
return;
if (mac->link_state > MAC80211_NOLINK)
return;
if (is_hal_stop(rtlhal))
return;
if (rtlpriv->sec.being_setkey)
return;
if (rtlpriv->cfg->ops->bt_coex_off_before_lps)
rtlpriv->cfg->ops->bt_coex_off_before_lps(hw);
if (ppsc->inactiveps) {
rtstate = ppsc->rfpwr_state;
/*
*Do not enter IPS in the following conditions:
*(1) RF is already OFF or Sleep
*(2) swrf_processing (indicates the IPS is still under going)
*(3) Connectted (only disconnected can trigger IPS)
*(4) IBSS (send Beacon)
*(5) AP mode (send Beacon)
*(6) monitor mode (rcv packet)
*/
if (rtstate == ERFON &&
!ppsc->swrf_processing &&
(mac->link_state == MAC80211_NOLINK) &&
!mac->act_scanning) {
RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
"IPSEnter(): Turn off RF\n");
ppsc->inactive_pwrstate = ERFOFF;
ppsc->in_powersavemode = true;
/* call before RF off */
if (rtlpriv->cfg->ops->get_btc_status())
rtlpriv->btcoexist.btc_ops->btc_ips_notify(rtlpriv,
ppsc->inactive_pwrstate);
/*rtl_pci_reset_trx_ring(hw); */
_rtl_ps_inactive_ps(hw);
}
}
}
void rtl_ips_nic_off(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
/* because when link with ap, mac80211 will ask us
* to disable nic quickly after scan before linking,
* this will cause link failed, so we delay 100ms here
*/
queue_delayed_work(rtlpriv->works.rtl_wq,
&rtlpriv->works.ips_nic_off_wq, MSECS(100));
}
/* NOTICE: any opmode should exc nic_on, or disable without
* nic_on may something wrong, like adhoc TP
*/
void rtl_ips_nic_on(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
enum rf_pwrstate rtstate;
cancel_delayed_work_sync(&rtlpriv->works.ips_nic_off_wq);
mutex_lock(&rtlpriv->locks.ips_mutex);
if (ppsc->inactiveps) {
rtstate = ppsc->rfpwr_state;
if (rtstate != ERFON &&
!ppsc->swrf_processing &&
ppsc->rfoff_reason <= RF_CHANGE_BY_IPS) {
ppsc->inactive_pwrstate = ERFON;
ppsc->in_powersavemode = false;
_rtl_ps_inactive_ps(hw);
/* call after RF on */
if (rtlpriv->cfg->ops->get_btc_status())
rtlpriv->btcoexist.btc_ops->btc_ips_notify(rtlpriv,
ppsc->inactive_pwrstate);
}
}
mutex_unlock(&rtlpriv->locks.ips_mutex);
}
EXPORT_SYMBOL_GPL(rtl_ips_nic_on);
/*for FW LPS*/
/*
*Determine if we can set Fw into PS mode
*in current condition.Return TRUE if it
*can enter PS mode.
*/
static bool rtl_get_fwlps_doze(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
u32 ps_timediff;
ps_timediff = jiffies_to_msecs(jiffies -
ppsc->last_delaylps_stamp_jiffies);
if (ps_timediff < 2000) {
RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
"Delay enter Fw LPS for DHCP, ARP, or EAPOL exchanging state\n");
return false;
}
if (mac->link_state != MAC80211_LINKED)
return false;
if (mac->opmode == NL80211_IFTYPE_ADHOC)
return false;
return true;
}
/* Change current and default preamble mode.*/
void rtl_lps_set_psmode(struct ieee80211_hw *hw, u8 rt_psmode)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
bool enter_fwlps;
if (mac->opmode == NL80211_IFTYPE_ADHOC)
return;
if (mac->link_state != MAC80211_LINKED)
return;
if (ppsc->dot11_psmode == rt_psmode && rt_psmode == EACTIVE)
return;
/* Update power save mode configured. */
ppsc->dot11_psmode = rt_psmode;
/*
*<FW control LPS>
*1. Enter PS mode
* Set RPWM to Fw to turn RF off and send H2C fw_pwrmode
* cmd to set Fw into PS mode.
*2. Leave PS mode
* Send H2C fw_pwrmode cmd to Fw to set Fw into Active
* mode and set RPWM to turn RF on.
*/
if ((ppsc->fwctrl_lps) && ppsc->report_linked) {
if (ppsc->dot11_psmode == EACTIVE) {
RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
"FW LPS leave ps_mode:%x\n",
FW_PS_ACTIVE_MODE);
enter_fwlps = false;
ppsc->pwr_mode = FW_PS_ACTIVE_MODE;
ppsc->smart_ps = 0;
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_FW_LPS_ACTION,
(u8 *)(&enter_fwlps));
if (ppsc->p2p_ps_info.opp_ps)
rtl_p2p_ps_cmd(hw , P2P_PS_ENABLE);
if (rtlpriv->cfg->ops->get_btc_status())
rtlpriv->btcoexist.btc_ops->btc_lps_notify(rtlpriv, rt_psmode);
} else {
if (rtl_get_fwlps_doze(hw)) {
RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
"FW LPS enter ps_mode:%x\n",
ppsc->fwctrl_psmode);
if (rtlpriv->cfg->ops->get_btc_status())
rtlpriv->btcoexist.btc_ops->btc_lps_notify(rtlpriv, rt_psmode);
enter_fwlps = true;
ppsc->pwr_mode = ppsc->fwctrl_psmode;
ppsc->smart_ps = 2;
rtlpriv->cfg->ops->set_hw_reg(hw,
HW_VAR_FW_LPS_ACTION,
(u8 *)(&enter_fwlps));
} else {
/* Reset the power save related parameters. */
ppsc->dot11_psmode = EACTIVE;
}
}
}
}
/* Interrupt safe routine to enter the leisure power save mode.*/
static void rtl_lps_enter_core(struct ieee80211_hw *hw)
{
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
struct rtl_priv *rtlpriv = rtl_priv(hw);
if (!ppsc->fwctrl_lps)
return;
if (rtlpriv->sec.being_setkey)
return;
if (rtlpriv->link_info.busytraffic)
return;
/*sleep after linked 10s, to let DHCP and 4-way handshake ok enough!! */
if (mac->cnt_after_linked < 5)
return;
if (mac->opmode == NL80211_IFTYPE_ADHOC)
return;
if (mac->link_state != MAC80211_LINKED)
return;
mutex_lock(&rtlpriv->locks.lps_mutex);
/* Don't need to check (ppsc->dot11_psmode == EACTIVE), because
* bt_ccoexist may ask to enter lps.
* In normal case, this constraint move to rtl_lps_set_psmode().
*/
RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
"Enter 802.11 power save mode...\n");
rtl_lps_set_psmode(hw, EAUTOPS);
mutex_unlock(&rtlpriv->locks.lps_mutex);
}
/* Interrupt safe routine to leave the leisure power save mode.*/
static void rtl_lps_leave_core(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
mutex_lock(&rtlpriv->locks.lps_mutex);
if (ppsc->fwctrl_lps) {
if (ppsc->dot11_psmode != EACTIVE) {
/*FIX ME */
/*rtlpriv->cfg->ops->enable_interrupt(hw); */
if (ppsc->reg_rfps_level & RT_RF_LPS_LEVEL_ASPM &&
RT_IN_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM) &&
rtlhal->interface == INTF_PCI) {
rtlpriv->intf_ops->disable_aspm(hw);
RT_CLEAR_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM);
}
RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
"Busy Traffic,Leave 802.11 power save..\n");
rtl_lps_set_psmode(hw, EACTIVE);
}
}
mutex_unlock(&rtlpriv->locks.lps_mutex);
}
/* For sw LPS*/
void rtl_swlps_beacon(struct ieee80211_hw *hw, void *data, unsigned int len)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct ieee80211_hdr *hdr = data;
struct ieee80211_tim_ie *tim_ie;
u8 *tim;
u8 tim_len;
bool u_buffed;
bool m_buffed;
if (mac->opmode != NL80211_IFTYPE_STATION)
return;
if (!rtlpriv->psc.swctrl_lps)
return;
if (rtlpriv->mac80211.link_state != MAC80211_LINKED)
return;
if (!rtlpriv->psc.sw_ps_enabled)
return;
if (rtlpriv->psc.fwctrl_lps)
return;
if (likely(!(hw->conf.flags & IEEE80211_CONF_PS)))
return;
/* check if this really is a beacon */
if (!ieee80211_is_beacon(hdr->frame_control))
return;
/* min. beacon length + FCS_LEN */
if (len <= 40 + FCS_LEN)
return;
/* and only beacons from the associated BSSID, please */
if (!ether_addr_equal_64bits(hdr->addr3, rtlpriv->mac80211.bssid))
return;
rtlpriv->psc.last_beacon = jiffies;
tim = rtl_find_ie(data, len - FCS_LEN, WLAN_EID_TIM);
if (!tim)
return;
if (tim[1] < sizeof(*tim_ie))
return;
tim_len = tim[1];
tim_ie = (struct ieee80211_tim_ie *) &tim[2];
if (!WARN_ON_ONCE(!hw->conf.ps_dtim_period))
rtlpriv->psc.dtim_counter = tim_ie->dtim_count;
/* Check whenever the PHY can be turned off again. */
/* 1. What about buffered unicast traffic for our AID? */
u_buffed = ieee80211_check_tim(tim_ie, tim_len,
rtlpriv->mac80211.assoc_id);
/* 2. Maybe the AP wants to send multicast/broadcast data? */
m_buffed = tim_ie->bitmap_ctrl & 0x01;
rtlpriv->psc.multi_buffered = m_buffed;
/* unicast will process by mac80211 through
* set ~IEEE80211_CONF_PS, So we just check
* multicast frames here */
if (!m_buffed) {
/* back to low-power land. and delay is
* prevent null power save frame tx fail */
queue_delayed_work(rtlpriv->works.rtl_wq,
&rtlpriv->works.ps_work, MSECS(5));
} else {
RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG,
"u_bufferd: %x, m_buffered: %x\n", u_buffed, m_buffed);
}
}
EXPORT_SYMBOL_GPL(rtl_swlps_beacon);
void rtl_swlps_rf_awake(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
if (!rtlpriv->psc.swctrl_lps)
return;
if (mac->link_state != MAC80211_LINKED)
return;
if (ppsc->reg_rfps_level & RT_RF_LPS_LEVEL_ASPM &&
RT_IN_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM)) {
rtlpriv->intf_ops->disable_aspm(hw);
RT_CLEAR_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM);
}
mutex_lock(&rtlpriv->locks.lps_mutex);
rtl_ps_set_rf_state(hw, ERFON, RF_CHANGE_BY_PS);
mutex_unlock(&rtlpriv->locks.lps_mutex);
}
void rtl_swlps_rfon_wq_callback(void *data)
{
struct rtl_works *rtlworks =
container_of_dwork_rtl(data, struct rtl_works, ps_rfon_wq);
struct ieee80211_hw *hw = rtlworks->hw;
rtl_swlps_rf_awake(hw);
}
void rtl_swlps_rf_sleep(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
u8 sleep_intv;
if (!rtlpriv->psc.sw_ps_enabled)
return;
if ((rtlpriv->sec.being_setkey) ||
(mac->opmode == NL80211_IFTYPE_ADHOC))
return;
/*sleep after linked 10s, to let DHCP and 4-way handshake ok enough!! */
if ((mac->link_state != MAC80211_LINKED) || (mac->cnt_after_linked < 5))
return;
if (rtlpriv->link_info.busytraffic)
return;
spin_lock(&rtlpriv->locks.rf_ps_lock);
if (rtlpriv->psc.rfchange_inprogress) {
spin_unlock(&rtlpriv->locks.rf_ps_lock);
return;
}
spin_unlock(&rtlpriv->locks.rf_ps_lock);
mutex_lock(&rtlpriv->locks.lps_mutex);
rtl_ps_set_rf_state(hw, ERFSLEEP, RF_CHANGE_BY_PS);
mutex_unlock(&rtlpriv->locks.lps_mutex);
if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_ASPM &&
!RT_IN_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM)) {
rtlpriv->intf_ops->enable_aspm(hw);
RT_SET_PS_LEVEL(ppsc, RT_PS_LEVEL_ASPM);
}
/* here is power save alg, when this beacon is DTIM
* we will set sleep time to dtim_period * n;
* when this beacon is not DTIM, we will set sleep
* time to sleep_intv = rtlpriv->psc.dtim_counter or
* MAX_SW_LPS_SLEEP_INTV(default set to 5) */
if (rtlpriv->psc.dtim_counter == 0) {
if (hw->conf.ps_dtim_period == 1)
sleep_intv = hw->conf.ps_dtim_period * 2;
else
sleep_intv = hw->conf.ps_dtim_period;
} else {
sleep_intv = rtlpriv->psc.dtim_counter;
}
if (sleep_intv > MAX_SW_LPS_SLEEP_INTV)
sleep_intv = MAX_SW_LPS_SLEEP_INTV;
/* this print should always be dtim_conter = 0 &
* sleep = dtim_period, that meaons, we should
* awake before every dtim */
RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG,
"dtim_counter:%x will sleep :%d beacon_intv\n",
rtlpriv->psc.dtim_counter, sleep_intv);
/* we tested that 40ms is enough for sw & hw sw delay */
queue_delayed_work(rtlpriv->works.rtl_wq, &rtlpriv->works.ps_rfon_wq,
MSECS(sleep_intv * mac->vif->bss_conf.beacon_int - 40));
}
void rtl_lps_change_work_callback(struct work_struct *work)
{
struct rtl_works *rtlworks =
container_of(work, struct rtl_works, lps_change_work);
struct ieee80211_hw *hw = rtlworks->hw;
struct rtl_priv *rtlpriv = rtl_priv(hw);
if (rtlpriv->enter_ps)
rtl_lps_enter_core(hw);
else
rtl_lps_leave_core(hw);
}
EXPORT_SYMBOL_GPL(rtl_lps_change_work_callback);
void rtl_lps_enter(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
if (!in_interrupt())
return rtl_lps_enter_core(hw);
rtlpriv->enter_ps = true;
schedule_work(&rtlpriv->works.lps_change_work);
}
EXPORT_SYMBOL_GPL(rtl_lps_enter);
void rtl_lps_leave(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
if (!in_interrupt())
return rtl_lps_leave_core(hw);
rtlpriv->enter_ps = false;
schedule_work(&rtlpriv->works.lps_change_work);
}
EXPORT_SYMBOL_GPL(rtl_lps_leave);
void rtl_swlps_wq_callback(void *data)
{
struct rtl_works *rtlworks = container_of_dwork_rtl(data,
struct rtl_works,
ps_work);
struct ieee80211_hw *hw = rtlworks->hw;
struct rtl_priv *rtlpriv = rtl_priv(hw);
bool ps = false;
ps = (hw->conf.flags & IEEE80211_CONF_PS);
/* we can sleep after ps null send ok */
if (rtlpriv->psc.state_inap) {
rtl_swlps_rf_sleep(hw);
if (rtlpriv->psc.state && !ps) {
rtlpriv->psc.sleep_ms = jiffies_to_msecs(jiffies -
rtlpriv->psc.last_action);
}
if (ps)
rtlpriv->psc.last_slept = jiffies;
rtlpriv->psc.last_action = jiffies;
rtlpriv->psc.state = ps;
}
}
static void rtl_p2p_noa_ie(struct ieee80211_hw *hw, void *data,
unsigned int len)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct ieee80211_mgmt *mgmt = data;
struct rtl_p2p_ps_info *p2pinfo = &(rtlpriv->psc.p2p_ps_info);
u8 *pos, *end, *ie;
u16 noa_len;
static u8 p2p_oui_ie_type[4] = {0x50, 0x6f, 0x9a, 0x09};
u8 noa_num, index , i, noa_index = 0;
bool find_p2p_ie = false , find_p2p_ps_ie = false;
pos = (u8 *)mgmt->u.beacon.variable;
end = data + len;
ie = NULL;
while (pos + 1 < end) {
if (pos + 2 + pos[1] > end)
return;
if (pos[0] == 221 && pos[1] > 4) {
if (memcmp(&pos[2], p2p_oui_ie_type, 4) == 0) {
ie = pos + 2+4;
break;
}
}
pos += 2 + pos[1];
}
if (ie == NULL)
return;
find_p2p_ie = true;
/*to find noa ie*/
while (ie + 1 < end) {
noa_len = READEF2BYTE((__le16 *)&ie[1]);
if (ie + 3 + ie[1] > end)
return;
if (ie[0] == 12) {
find_p2p_ps_ie = true;
if ((noa_len - 2) % 13 != 0) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
"P2P notice of absence: invalid length.%d\n",
noa_len);
return;
} else {
noa_num = (noa_len - 2) / 13;
}
noa_index = ie[3];
if (rtlpriv->psc.p2p_ps_info.p2p_ps_mode ==
P2P_PS_NONE || noa_index != p2pinfo->noa_index) {
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD,
"update NOA ie.\n");
p2pinfo->noa_index = noa_index;
p2pinfo->opp_ps = (ie[4] >> 7);
p2pinfo->ctwindow = ie[4] & 0x7F;
p2pinfo->noa_num = noa_num;
index = 5;
for (i = 0; i < noa_num; i++) {
p2pinfo->noa_count_type[i] =
READEF1BYTE(ie+index);
index += 1;
p2pinfo->noa_duration[i] =
READEF4BYTE((__le32 *)ie+index);
index += 4;
p2pinfo->noa_interval[i] =
READEF4BYTE((__le32 *)ie+index);
index += 4;
p2pinfo->noa_start_time[i] =
READEF4BYTE((__le32 *)ie+index);
index += 4;
}
if (p2pinfo->opp_ps == 1) {
p2pinfo->p2p_ps_mode = P2P_PS_CTWINDOW;
/* Driver should wait LPS entering
* CTWindow
*/
if (rtlpriv->psc.fw_current_inpsmode)
rtl_p2p_ps_cmd(hw,
P2P_PS_ENABLE);
} else if (p2pinfo->noa_num > 0) {
p2pinfo->p2p_ps_mode = P2P_PS_NOA;
rtl_p2p_ps_cmd(hw, P2P_PS_ENABLE);
} else if (p2pinfo->p2p_ps_mode > P2P_PS_NONE) {
rtl_p2p_ps_cmd(hw, P2P_PS_DISABLE);
}
}
break;
}
ie += 3 + noa_len;
}
if (find_p2p_ie == true) {
if ((p2pinfo->p2p_ps_mode > P2P_PS_NONE) &&
(find_p2p_ps_ie == false))
rtl_p2p_ps_cmd(hw, P2P_PS_DISABLE);
}
}
static void rtl_p2p_action_ie(struct ieee80211_hw *hw, void *data,
unsigned int len)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct ieee80211_mgmt *mgmt = data;
struct rtl_p2p_ps_info *p2pinfo = &(rtlpriv->psc.p2p_ps_info);
u8 noa_num, index , i , noa_index = 0;
u8 *pos, *end, *ie;
u16 noa_len;
static u8 p2p_oui_ie_type[4] = {0x50, 0x6f, 0x9a, 0x09};
pos = (u8 *)&mgmt->u.action.category;
end = data + len;
ie = NULL;
if (pos[0] == 0x7f) {
if (memcmp(&pos[1], p2p_oui_ie_type, 4) == 0)
ie = pos + 3+4;
}
if (ie == NULL)
return;
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "action frame find P2P IE.\n");
/*to find noa ie*/
while (ie + 1 < end) {
noa_len = READEF2BYTE((__le16 *)&ie[1]);
if (ie + 3 + ie[1] > end)
return;
if (ie[0] == 12) {
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "find NOA IE.\n");
RT_PRINT_DATA(rtlpriv, COMP_FW, DBG_LOUD, "noa ie ",
ie, noa_len);
if ((noa_len - 2) % 13 != 0) {
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD,
"P2P notice of absence: invalid length.%d\n",
noa_len);
return;
} else {
noa_num = (noa_len - 2) / 13;
}
noa_index = ie[3];
if (rtlpriv->psc.p2p_ps_info.p2p_ps_mode ==
P2P_PS_NONE || noa_index != p2pinfo->noa_index) {
p2pinfo->noa_index = noa_index;
p2pinfo->opp_ps = (ie[4] >> 7);
p2pinfo->ctwindow = ie[4] & 0x7F;
p2pinfo->noa_num = noa_num;
index = 5;
for (i = 0; i < noa_num; i++) {
p2pinfo->noa_count_type[i] =
READEF1BYTE(ie+index);
index += 1;
p2pinfo->noa_duration[i] =
READEF4BYTE((__le32 *)ie+index);
index += 4;
p2pinfo->noa_interval[i] =
READEF4BYTE((__le32 *)ie+index);
index += 4;
p2pinfo->noa_start_time[i] =
READEF4BYTE((__le32 *)ie+index);
index += 4;
}
if (p2pinfo->opp_ps == 1) {
p2pinfo->p2p_ps_mode = P2P_PS_CTWINDOW;
/* Driver should wait LPS entering
* CTWindow
*/
if (rtlpriv->psc.fw_current_inpsmode)
rtl_p2p_ps_cmd(hw,
P2P_PS_ENABLE);
} else if (p2pinfo->noa_num > 0) {
p2pinfo->p2p_ps_mode = P2P_PS_NOA;
rtl_p2p_ps_cmd(hw, P2P_PS_ENABLE);
} else if (p2pinfo->p2p_ps_mode > P2P_PS_NONE) {
rtl_p2p_ps_cmd(hw, P2P_PS_DISABLE);
}
}
break;
}
ie += 3 + noa_len;
}
}
void rtl_p2p_ps_cmd(struct ieee80211_hw *hw , u8 p2p_ps_state)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_ps_ctl *rtlps = rtl_psc(rtl_priv(hw));
struct rtl_p2p_ps_info *p2pinfo = &(rtlpriv->psc.p2p_ps_info);
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, " p2p state %x\n" , p2p_ps_state);
switch (p2p_ps_state) {
case P2P_PS_DISABLE:
p2pinfo->p2p_ps_state = p2p_ps_state;
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_H2C_FW_P2P_PS_OFFLOAD,
&p2p_ps_state);
p2pinfo->noa_index = 0;
p2pinfo->ctwindow = 0;
p2pinfo->opp_ps = 0;
p2pinfo->noa_num = 0;
p2pinfo->p2p_ps_mode = P2P_PS_NONE;
if (rtlps->fw_current_inpsmode) {
if (rtlps->smart_ps == 0) {
rtlps->smart_ps = 2;
rtlpriv->cfg->ops->set_hw_reg(hw,
HW_VAR_H2C_FW_PWRMODE,
&rtlps->pwr_mode);
}
}
break;
case P2P_PS_ENABLE:
if (p2pinfo->p2p_ps_mode > P2P_PS_NONE) {
p2pinfo->p2p_ps_state = p2p_ps_state;
if (p2pinfo->ctwindow > 0) {
if (rtlps->smart_ps != 0) {
rtlps->smart_ps = 0;
rtlpriv->cfg->ops->set_hw_reg(hw,
HW_VAR_H2C_FW_PWRMODE,
&rtlps->pwr_mode);
}
}
rtlpriv->cfg->ops->set_hw_reg(hw,
HW_VAR_H2C_FW_P2P_PS_OFFLOAD,
&p2p_ps_state);
}
break;
case P2P_PS_SCAN:
case P2P_PS_SCAN_DONE:
case P2P_PS_ALLSTASLEEP:
if (p2pinfo->p2p_ps_mode > P2P_PS_NONE) {
p2pinfo->p2p_ps_state = p2p_ps_state;
rtlpriv->cfg->ops->set_hw_reg(hw,
HW_VAR_H2C_FW_P2P_PS_OFFLOAD,
&p2p_ps_state);
}
break;
default:
break;
}
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD,
"ctwindow %x oppps %x\n",
p2pinfo->ctwindow , p2pinfo->opp_ps);
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD,
"count %x duration %x index %x interval %x start time %x noa num %x\n",
p2pinfo->noa_count_type[0],
p2pinfo->noa_duration[0],
p2pinfo->noa_index,
p2pinfo->noa_interval[0],
p2pinfo->noa_start_time[0],
p2pinfo->noa_num);
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "end\n");
}
void rtl_p2p_info(struct ieee80211_hw *hw, void *data, unsigned int len)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct ieee80211_hdr *hdr = data;
if (!mac->p2p)
return;
if (mac->link_state != MAC80211_LINKED)
return;
/* min. beacon length + FCS_LEN */
if (len <= 40 + FCS_LEN)
return;
/* and only beacons from the associated BSSID, please */
if (!ether_addr_equal_64bits(hdr->addr3, rtlpriv->mac80211.bssid))
return;
/* check if this really is a beacon */
if (!(ieee80211_is_beacon(hdr->frame_control) ||
ieee80211_is_probe_resp(hdr->frame_control) ||
ieee80211_is_action(hdr->frame_control)))
return;
if (ieee80211_is_action(hdr->frame_control))
rtl_p2p_action_ie(hw , data , len - FCS_LEN);
else
rtl_p2p_noa_ie(hw , data , len - FCS_LEN);
}
EXPORT_SYMBOL_GPL(rtl_p2p_info);
|
BPI-SINOVOIP/BPI-Mainline-kernel
|
linux-4.19/drivers/net/wireless/realtek/rtlwifi/ps.c
|
C
|
gpl-2.0
| 26,871
|
---
title: Chart Configuration
anchor: chart-configuration
---
Chart.js provides a number of options for changing the behaviour of created charts. These configuration options can be changed on a per chart basis by passing in an options object when creating the chart. Alternatively, the global configuration can be changed which will be used by all charts created after that point.
### Chart Data
To display data, the chart must be passed a data object that contains all of the information needed by the chart. The data object can contain the following parameters
Name | Type | Description
--- | --- | ----
datasets | Array[object] | Contains data for each dataset. See the documentation for each chart type to determine the valid options that can be attached to the dataset
labels | Array[string] | Optional parameter that is used with the [category axis](#scales-category-scale).
xLabels | Array[string] | Optional parameter that is used with the category axis and is used if the axis is horizontal
yLabels | Array[string] | Optional parameter that is used with the category axis and is used if the axis is vertical
### Creating a Chart with Options
To create a chart with configuration options, simply pass an object containing your configuration to the constructor. In the example below, a line chart is created and configured to not be responsive.
```javascript
var chartInstance = new Chart(ctx, {
type: 'line',
data: data,
options: {
responsive: false
}
});
```
### Global Configuration
This concept was introduced in Chart.js 1.0 to keep configuration [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself), and allow for changing options globally across chart types, avoiding the need to specify options for each instance, or the default for a particular chart type.
Chart.js merges the options object passed to the chart with the global configuration using chart type defaults and scales defaults appropriately. This way you can be as specific as you would like in your individual chart configuration, while still changing the defaults for all chart types where applicable. The global general options are defined in `Chart.defaults.global`. The defaults for each chart type are discussed in the documentation for that chart type.
The following example would set the hover mode to 'nearest' for all charts where this was not overridden by the chart type defaults or the options passed to the constructor on creation.
```javascript
Chart.defaults.global.hover.mode = 'nearest';
// Hover mode is set to nearest because it was not overridden here
var chartInstanceHoverModeNearest = new Chart(ctx, {
type: 'line',
data: data,
});
// This chart would have the hover mode that was passed in
var chartInstanceDifferentHoverMode = new Chart(ctx, {
type: 'line',
data: data,
options: {
hover: {
// Overrides the global setting
mode: 'index'
}
}
})
```
#### Global Font Settings
There are 4 special global settings that can change all of the fonts on the chart. These options are in `Chart.defaults.global`.
Name | Type | Default | Description
--- | --- | --- | ---
defaultFontColor | Color | '#666' | Default font color for all text
defaultFontFamily | String | "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif" | Default font family for all text
defaultFontSize | Number | 12 | Default font size (in px) for text. Does not apply to radialLinear scale point labels
defaultFontStyle | String | 'normal' | Default font style. Does not apply to tooltip title or footer. Does not apply to chart title
### Common Chart Configuration
The following options are applicable to all charts. The can be set on the [global configuration](#chart-configuration-global-configuration), or they can be passed to the chart constructor.
Name | Type | Default | Description
--- | --- | --- | ---
responsive | Boolean | true | Resizes the chart canvas when its container does.
responsiveAnimationDuration | Number | 0 | Duration in milliseconds it takes to animate to new size after a resize event.
maintainAspectRatio | Boolean | true | Maintain the original canvas aspect ratio `(width / height)` when resizing
events | Array[String] | `["mousemove", "mouseout", "click", "touchstart", "touchmove", "touchend"]` | Events that the chart should listen to for tooltips and hovering
onClick | Function | null | Called if the event is of type 'mouseup' or 'click'. Called in the context of the chart and passed the event and an array of active elements
legendCallback | Function | ` function (chart) { }` | Function to generate a legend. Receives the chart object to generate a legend from. Default implementation returns an HTML string.
onResize | Function | null | Called when a resize occurs. Gets passed two arguments: the chart instance and the new size.
### Layout Configuration
The layout configuration is passed into the `options.layout` namespace. The global options for the chart layout is defined in `Chart.defaults.global.layout`.
Name | Type | Default | Description
--- | --- | --- | ---
padding | Number or Object | 0 | The padding to add inside the chart. If this value is a number, it is applied to all sides of the chart (left, top, right, bottom). If this value is an object, the `left` property defines the left padding. Similarly the `right`, `top`, and `bottom` properties can also be specified.
### Title Configuration
The title configuration is passed into the `options.title` namespace. The global options for the chart title is defined in `Chart.defaults.global.title`.
Name | Type | Default | Description
--- | --- | --- | ---
display | Boolean | false | Display the title block
position | String | 'top' | Position of the title. Possible values are 'top', 'left', 'bottom' and 'right'.
fullWidth | Boolean | true | Marks that this box should take the full width of the canvas (pushing down other boxes)
fontSize | Number | 12 | Font size inherited from global configuration
fontFamily | String | "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif" | Font family inherited from global configuration
fontColor | Color | "#666" | Font color inherited from global configuration
fontStyle | String | 'bold' | Font styling of the title.
padding | Number | 10 | Number of pixels to add above and below the title text
text | String | '' | Title text
#### Example Usage
The example below would enable a title of 'Custom Chart Title' on the chart that is created.
```javascript
var chartInstance = new Chart(ctx, {
type: 'line',
data: data,
options: {
title: {
display: true,
text: 'Custom Chart Title'
}
}
})
```
### Legend Configuration
The legend configuration is passed into the `options.legend` namespace. The global options for the chart legend is defined in `Chart.defaults.global.legend`.
Name | Type | Default | Description
--- | --- | --- | ---
display | Boolean | true | Is the legend displayed
position | String | 'top' | Position of the legend. Possible values are 'top', 'left', 'bottom' and 'right'.
fullWidth | Boolean | true | Marks that this box should take the full width of the canvas (pushing down other boxes)
onClick | Function | `function(event, legendItem) {}` | A callback that is called when a 'click' event is registered on top of a label item
onHover | Function | `function(event, legendItem) {}` | A callback that is called when a 'mousemove' event is registered on top of a label item
labels |Object|-| See the [Legend Label Configuration](#chart-configuration-legend-label-configuration) section below.
reverse | Boolean | false | Legend will show datasets in reverse order
#### Legend Label Configuration
The legend label configuration is nested below the legend configuration using the `labels` key.
Name | Type | Default | Description
--- | --- | --- | ---
boxWidth | Number | 40 | Width of coloured box
fontSize | Number | 12 | Font size inherited from global configuration
fontStyle | String | "normal" | Font style inherited from global configuration
fontColor | Color | "#666" | Font color inherited from global configuration
fontFamily | String | "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif" | Font family inherited from global configuration
padding | Number | 10 | Padding between rows of colored boxes
generateLabels: | Function | `function(chart) { }` | Generates legend items for each thing in the legend. Default implementation returns the text + styling for the color box. See [Legend Item](#chart-configuration-legend-item-interface) for details.
filter | Function | null | Filters legend items out of the legend. Receives 2 parameters, a [Legend Item](#chart-configuration-legend-item-interface) and the chart data
usePointStyle | Boolean | false | Label style will match corresponding point style (size is based on fontSize, boxWidth is not used in this case).
#### Legend Item Interface
Items passed to the legend `onClick` function are the ones returned from `labels.generateLabels`. These items must implement the following interface.
```javascript
{
// Label that will be displayed
text: String,
// Fill style of the legend box
fillStyle: Color,
// If true, this item represents a hidden dataset. Label will be rendered with a strike-through effect
hidden: Boolean,
// For box border. See https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap
lineCap: String,
// For box border. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash
lineDash: Array[Number],
// For box border. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset
lineDashOffset: Number,
// For box border. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin
lineJoin: String,
// Width of box border
lineWidth: Number,
// Stroke style of the legend box
strokeStyle: Color
// Point style of the legend box (only used if usePointStyle is true)
pointStyle: String
}
```
#### Example
The following example will create a chart with the legend enabled and turn all of the text red in color.
```javascript
var chartInstance = new Chart(ctx, {
type: 'bar',
data: data,
options: {
legend: {
display: true,
labels: {
fontColor: 'rgb(255, 99, 132)'
}
}
}
});
```
### Tooltip Configuration
The tooltip configuration is passed into the `options.tooltips` namespace. The global options for the chart tooltips is defined in `Chart.defaults.global.tooltips`.
Name | Type | Default | Description
--- | --- | --- | ---
enabled | Boolean | true | Are tooltips enabled
custom | Function | null | See [section](#advanced-usage-external-tooltips) below
mode | String | 'nearest' | Sets which elements appear in the tooltip. See [Interaction Modes](#interaction-modes) for details
intersect | Boolean | true | if true, the tooltip mode applies only when the mouse position intersects with an element. If false, the mode will be applied at all times.
position | String | 'average' | The mode for positioning the tooltip. 'average' mode will place the tooltip at the average position of the items displayed in the tooltip. 'nearest' will place the tooltip at the position of the element closest to the event position. New modes can be defined by adding functions to the Chart.Tooltip.positioners map.
itemSort | Function | undefined | Allows sorting of [tooltip items](#chart-configuration-tooltip-item-interface). Must implement at minimum a function that can be passed to [Array.prototype.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort). This function can also accept a third parameter that is the data object passed to the chart.
filter | Function | undefined | Allows filtering of [tooltip items](#chart-configuration-tooltip-item-interface). Must implement at minimum a function that can be passed to [Array.prototype.filter](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/filter). This function can also accept a second parameter that is the data object passed to the chart.
backgroundColor | Color | 'rgba(0,0,0,0.8)' | Background color of the tooltip
titleFontFamily | String | "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif" | Font family for tooltip title inherited from global font family
titleFontSize | Number | 12 | Font size for tooltip title inherited from global font size
titleFontStyle | String | "bold" |
titleFontColor | Color | "#fff" | Font color for tooltip title
titleSpacing | Number | 2 | Spacing to add to top and bottom of each title line.
titleMarginBottom | Number | 6 | Margin to add on bottom of title section
bodyFontFamily | String | "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif" | Font family for tooltip items inherited from global font family
bodyFontSize | Number | 12 | Font size for tooltip items inherited from global font size
bodyFontStyle | String | "normal" |
bodyFontColor | Color | "#fff" | Font color for tooltip items.
bodySpacing | Number | 2 | Spacing to add to top and bottom of each tooltip item
footerFontFamily | String | "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif" | Font family for tooltip footer inherited from global font family.
footerFontSize | Number | 12 | Font size for tooltip footer inherited from global font size.
footerFontStyle | String | "bold" | Font style for tooltip footer.
footerFontColor | Color | "#fff" | Font color for tooltip footer.
footerSpacing | Number | 2 | Spacing to add to top and bottom of each footer line.
footerMarginTop | Number | 6 | Margin to add before drawing the footer
xPadding | Number | 6 | Padding to add on left and right of tooltip
yPadding | Number | 6 | Padding to add on top and bottom of tooltip
caretSize | Number | 5 | Size, in px, of the tooltip arrow
cornerRadius | Number | 6 | Radius of tooltip corner curves
multiKeyBackground | Color | "#fff" | Color to draw behind the colored boxes when multiple items are in the tooltip
displayColors | Boolean | true | if true, color boxes are shown in the tooltip
callbacks | Object | | See the [callbacks section](#chart-configuration-tooltip-callbacks) below
#### Tooltip Callbacks
The tooltip label configuration is nested below the tooltip configuration using the `callbacks` key. The tooltip has the following callbacks for providing text. For all functions, 'this' will be the tooltip object created from the Chart.Tooltip constructor.
All functions are called with the same arguments: a [tooltip item](#chart-configuration-tooltip-item-interface) and the data object passed to the chart. All functions must return either a string or an array of strings. Arrays of strings are treated as multiple lines of text.
Callback | Arguments | Description
--- | --- | ---
beforeTitle | `Array[tooltipItem], data` | Text to render before the title
title | `Array[tooltipItem], data` | Text to render as the title
afterTitle | `Array[tooltipItem], data` | Text to render after the title
beforeBody | `Array[tooltipItem], data` | Text to render before the body section
beforeLabel | `tooltipItem, data` | Text to render before an individual label
label | `tooltipItem, data` | Text to render for an individual item in the tooltip
labelColor | `tooltipItem, chartInstance` | Returns the colors to render for the tooltip item. Return as an object containing two parameters: `borderColor` and `backgroundColor`.
afterLabel | `tooltipItem, data` | Text to render after an individual label
afterBody | `Array[tooltipItem], data` | Text to render after the body section
beforeFooter | `Array[tooltipItem], data` | Text to render before the footer section
footer | `Array[tooltipItem], data` | Text to render as the footer
afterFooter | `Array[tooltipItem], data` | Text to render after the footer section
dataPoints | `Array[tooltipItem]` | List of matching point informations.
#### Tooltip Item Interface
The tooltip items passed to the tooltip callbacks implement the following interface.
```javascript
{
// X Value of the tooltip as a string
xLabel: String,
// Y value of the tooltip as a string
yLabel: String,
// Index of the dataset the item comes from
datasetIndex: Number,
// Index of this data item in the dataset
index: Number,
// X position of matching point
x: Number,
// Y position of matching point
y: Number,
}
```
### Hover Configuration
The hover configuration is passed into the `options.hover` namespace. The global hover configuration is at `Chart.defaults.global.hover`.
Name | Type | Default | Description
--- | --- | --- | ---
mode | String | 'nearest' | Sets which elements appear in the tooltip. See [Interaction Modes](#interaction-modes) for details
intersect | Boolean | true | if true, the hover mode only applies when the mouse position intersects an item on the chart
animationDuration | Number | 400 | Duration in milliseconds it takes to animate hover style changes
onHover | Function | null | Called when any of the events fire. Called in the context of the chart and passed the event and an array of active elements (bars, points, etc)
### Interaction Modes
When configuring interaction with the graph via hover or tooltips, a number of different modes are available.
The following table details the modes and how they behave in conjunction with the `intersect` setting
Mode | Behaviour
--- | ---
point | Finds all of the items that intersect the point
nearest | Gets the item that is nearest to the point. The nearest item is determined based on the distance to the center of the chart item (point, bar). If 2 or more items are at the same distance, the one with the smallest area is used. If `intersect` is true, this is only triggered when the mouse position intersects an item in the graph. This is very useful for combo charts where points are hidden behind bars.
single (deprecated) | Finds the first item that intersects the point and returns it. Behaves like 'nearest' mode with intersect = true.
label (deprecated) | See `'index'` mode
index | Finds item at the same index. If the `intersect` setting is true, the first intersecting item is used to determine the index in the data. If `intersect` false the nearest item is used to determine the index.
x-axis (deprecated) | Behaves like `'index'` mode with `intersect = false`
dataset | Finds items in the same dataset. If the `intersect` setting is true, the first intersecting item is used to determine the index in the data. If `intersect` false the nearest item is used to determine the index.
x | Returns all items that would intersect based on the `X` coordinate of the position only. Would be useful for a vertical cursor implementation. Note that this only applies to cartesian charts
y | Returns all items that would intersect based on the `Y` coordinate of the position. This would be useful for a horizontal cursor implementation. Note that this only applies to cartesian charts.
### Animation Configuration
The following animation options are available. The global options for are defined in `Chart.defaults.global.animation`.
Name | Type | Default | Description
--- |:---:| --- | ---
duration | Number | 1000 | The number of milliseconds an animation takes.
easing | String | "easeOutQuart" | Easing function to use. Available options are: `'linear'`, `'easeInQuad'`, `'easeOutQuad'`, `'easeInOutQuad'`, `'easeInCubic'`, `'easeOutCubic'`, `'easeInOutCubic'`, `'easeInQuart'`, `'easeOutQuart'`, `'easeInOutQuart'`, `'easeInQuint'`, `'easeOutQuint'`, `'easeInOutQuint'`, `'easeInSine'`, `'easeOutSine'`, `'easeInOutSine'`, `'easeInExpo'`, `'easeOutExpo'`, `'easeInOutExpo'`, `'easeInCirc'`, `'easeOutCirc'`, `'easeInOutCirc'`, `'easeInElastic'`, `'easeOutElastic'`, `'easeInOutElastic'`, `'easeInBack'`, `'easeOutBack'`, `'easeInOutBack'`, `'easeInBounce'`, `'easeOutBounce'`, `'easeInOutBounce'`. See [Robert Penner's easing equations](http://robertpenner.com/easing/).
onProgress | Function | none | Callback called on each step of an animation. Passed a single argument, an object, containing the chart instance and an object with details of the animation.
onComplete | Function | none | Callback called at the end of an animation. Passed the same arguments as `onProgress`
#### Animation Callbacks
The `onProgress` and `onComplete` callbacks are useful for synchronizing an external draw to the chart animation. The callback is passed an object that implements the following interface. An example usage of these callbacks can be found on [Github](https://github.com/chartjs/Chart.js/blob/master/samples/animation/progress-bar.html). This sample displays a progress bar showing how far along the animation is.
```javascript
{
// Chart object
chartInstance,
// Contains details of the on-going animation
animationObject,
}
```
#### Animation Object
The animation object passed to the callbacks is of type `Chart.Animation`. The object has the following parameters.
```javascript
{
// Current Animation frame number
currentStep: Number,
// Number of animation frames
numSteps: Number,
// Animation easing to use
easing: String,
// Function that renders the chart
render: Function,
// User callback
onAnimationProgress: Function,
// User callback
onAnimationComplete: Function
}
```
### Element Configuration
The global options for elements are defined in `Chart.defaults.global.elements`.
Options can be configured for four different types of elements: arc, lines, points, and rectangles. When set, these options apply to all objects of that type unless specifically overridden by the configuration attached to a dataset.
#### Arc Configuration
Arcs are used in the polar area, doughnut and pie charts. They can be configured with the following options. The global arc options are stored in `Chart.defaults.global.elements.arc`.
Name | Type | Default | Description
--- | --- | --- | ---
backgroundColor | Color | 'rgba(0,0,0,0.1)' | Default fill color for arcs. Inherited from the global default
borderColor | Color | '#fff' | Default stroke color for arcs
borderWidth | Number | 2 | Default stroke width for arcs
#### Line Configuration
Line elements are used to represent the line in a line chart. The global line options are stored in `Chart.defaults.global.elements.line`.
Name | Type | Default | Description
--- | --- | --- | ---
tension | Number | 0.4 | Default bezier curve tension. Set to `0` for no bezier curves.
backgroundColor | Color | 'rgba(0,0,0,0.1)' | Default line fill color
borderWidth | Number | 3 | Default line stroke width
borderColor | Color | 'rgba(0,0,0,0.1)' | Default line stroke color
borderCapStyle | String | 'butt' | Default line cap style. See [MDN](https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap)
borderDash | Array | `[]` | Default line dash. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash)
borderDashOffset | Number | 0.0 | Default line dash offset. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset)
borderJoinStyle | String | 'miter' | Default line join style. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin)
capBezierPoints | Boolean | true | If true, bezier control points are kept inside the chart. If false, no restriction is enforced.
fill | Boolean or String | true | If true, the fill is assumed to be to zero. String values are 'zero', 'top', and 'bottom' to fill to different locations. If `false`, no fill is added
stepped | Boolean | false | If true, the line is shown as a stepped line and 'tension' will be ignored
#### Point Configuration
Point elements are used to represent the points in a line chart or a bubble chart. The global point options are stored in `Chart.defaults.global.elements.point`.
Name | Type | Default | Description
--- | --- | --- | ---
radius | Number | 3 | Default point radius
pointStyle | String | 'circle' | Default point style
backgroundColor | Color | 'rgba(0,0,0,0.1)' | Default point fill color
borderWidth | Number | 1 | Default point stroke width
borderColor | Color | 'rgba(0,0,0,0.1)' | Default point stroke color
hitRadius | Number | 1 | Extra radius added to point radius for hit detection
hoverRadius | Number | 4 | Default point radius when hovered
hoverBorderWidth | Number | 1 | Default stroke width when hovered
#### Rectangle Configuration
Rectangle elements are used to represent the bars in a bar chart. The global rectangle options are stored in `Chart.defaults.global.elements.rectangle`.
Name | Type | Default | Description
--- | --- | --- | ---
backgroundColor | Color | 'rgba(0,0,0,0.1)' | Default bar fill color
borderWidth | Number | 0 | Default bar stroke width
borderColor | Color | 'rgba(0,0,0,0.1)' | Default bar stroke color
borderSkipped | String | 'bottom' | Default skipped (excluded) border for rectangle. Can be one of `bottom`, `left`, `top`, `right`
### Colors
When supplying colors to Chart options, you can use a number of formats. You can specify the color as a string in hexadecimal, RGB, or HSL notations. If a color is needed, but not specified, Chart.js will use the global default color. This color is stored at `Chart.defaults.global.defaultColor`. It is initially set to 'rgba(0, 0, 0, 0.1)';
You can also pass a [CanvasGradient](https://developer.mozilla.org/en-US/docs/Web/API/CanvasGradient) object. You will need to create this before passing to the chart, but using it you can achieve some interesting effects.
### Patterns
An alternative option is to pass a [CanvasPattern](https://developer.mozilla.org/en-US/docs/Web/API/CanvasPattern) object. For example, if you wanted to fill a dataset with a pattern from an image you could do the following.
```javascript
var img = new Image();
img.src = 'https://example.com/my_image.png';
img.onload = function() {
var ctx = document.getElementById('canvas').getContext('2d');
var fillPattern = ctx.createPattern(img, 'repeat');
var chart = new Chart(ctx, {
data: {
labels: ['Item 1', 'Item 2', 'Item 3'],
datasets: [{
data: [10, 20, 30],
backgroundColor: fillPattern
}]
}
})
}
```
Using pattern fills for data graphics can help viewers with vision deficiencies (e.g. color-blindness or partial sight) to [more easily understand your data](http://betweentwobrackets.com/data-graphics-and-colour-vision/).
Using the [Patternomaly](https://github.com/ashiguruma/patternomaly) library you can generate patterns to fill datasets.
```javascript
var chartData = {
datasets: [{
data: [45, 25, 20, 10],
backgroundColor: [
pattern.draw('square', '#ff6384'),
pattern.draw('circle', '#36a2eb'),
pattern.draw('diamond', '#cc65fe'),
pattern.draw('triangle', '#ffce56'),
]
}],
labels: ['Red', 'Blue', 'Purple', 'Yellow']
};
```
### Mixed Chart Types
When creating a chart, you have the option to overlay different chart types on top of each other as separate datasets.
To do this, you must set a `type` for each dataset individually. You can create mixed chart types with bar and line chart types.
When creating the chart you must set the overall `type` as `bar`.
```javascript
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Item 1', 'Item 2', 'Item 3'],
datasets: [
{
type: 'bar',
label: 'Bar Component',
data: [10, 20, 30],
},
{
type: 'line',
label: 'Line Component',
data: [30, 20, 10],
}
]
}
});
```
|
balirwa/logs
|
www/lib/chart.js/docs/01-Chart-Configuration.md
|
Markdown
|
apache-2.0
| 27,894
|
/**
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#import <Foundation/Foundation.h>
@interface User : NSObject
@property (strong, nonatomic) NSString *email;
@property (strong, nonatomic) NSString *name;
@property (strong, nonatomic) NSString *family_name;
@property (strong, nonatomic) NSString *username;
@property (strong, nonatomic) NSString *given_name;
@end
|
kasungayan/product-is
|
modules/samples/mobile-proxy-idp/ios/ebuy/eBuy/User.h
|
C
|
apache-2.0
| 976
|
module Main where
import GHC
import MonadUtils
import System.Environment
main :: IO ()
main = do [libdir] <- getArgs
runGhc (Just libdir) doit
doit :: Ghc ()
doit = do
getSessionDynFlags >>= setSessionDynFlags
dyn <- dynCompileExpr "()"
liftIO $ print dyn
|
siddhanathan/ghc
|
testsuite/tests/ghc-api/dynCompileExpr/dynCompileExpr.hs
|
Haskell
|
bsd-3-clause
| 278
|
<!DOCTYPE html>
<html>
<head>
<title>CSS Test (Transforms): Simple Backface-Visibility, rotatex(180deg) on Table</title>
<link rel="author" title="Aryeh Gregor" href="mailto:ayg@aryeh.name">
<link rel="help" href="http://www.w3.org/TR/css-transforms-2/#propdef-backface-visibility">
<meta name="assert" content='This is identical to
transform3d-backface-visibility-001.html, except that display: table is
specified too. This is motivated by a real-world UA bug:
<https://bugzilla.mozilla.org/show_bug.cgi?id=724750>.'>
<link rel="match" href="transform-lime-square-ref.html">
</head>
<body>
<div style="height:100px;width:100px;background:lime">
<div style="height:100px;width:100px;background:red;
transform:rotatex(180deg);backface-visibility:hidden;display:table">
</div>
</div>
</body>
</html>
|
scheib/chromium
|
third_party/blink/web_tests/external/wpt/css/css-transforms/transform3d-backface-visibility-003.html
|
HTML
|
bsd-3-clause
| 867
|
// Karma configuration
// Generated on Fri Nov 08 2013 09:25:16 GMT-0600 (Central Standard Time)
var util = require('../lib/grunt/utils.js');
var grunt = require('grunt');
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '../',
// frameworks to use
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
// note that the karmangular setup from util.createKarmangularConfig seems
// to take precedence over this, but we can't remove this because then
// the karmangular task doesn't appear to run. So includes the features/**/test, but
// they don't get run if you've used the --fast or --core options
files: [
'bower_components/jquery/jquery.min.js',
'lib/test/jquery.simulate.js',
'bower_components/lodash/dist/lodash.min.js',
'src/js/core/bootstrap.js',
'src/js/**/*.js',
'src/features/**/js/**/*.js',
'test/unit/**/*.spec.js',
'src/features/**/test/**/*.spec.js',
'dist/release/ui-grid.css',
'.tmp/template.js' //templates
],
// list of files to exclude
exclude: [
],
// test results reporter to use
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
reporters: ['dots', 'coverage'],
preprocessors: {
// Cover source files but ignore any .spec.js files. Thanks goodness I found the pattern here: https://github.com/karma-runner/karma/pull/834#issuecomment-35626132
'src/**/!(*.spec)+(.js)': ['coverage']
},
coverageReporter: {
type: 'lcov',
dir: 'coverage',
subdir: '.'
},
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera (has to be installed with `npm install karma-opera-launcher`)
// - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`)
// - PhantomJS
// - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
browsers: ['PhantomJS'],
// If browser does not capture in given timeout [ms], kill it
captureTimeout: 60000,
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false,
browserDisconnectTimeout: 10000,
browserDisconnectTolerance: 2,
browserNoActivityTimeout: 45000, // 20000,
sauceLabs: {
username: 'nggrid',
startConnect: false,
testName: 'ui-grid unit tests'
},
// For more browsers on Sauce Labs see:
// https://saucelabs.com/docs/platforms/webdriver
customLaunchers: util.customLaunchers()
});
// TODO(c0bra): remove once SauceLabs supports websockets.
// This speeds up the capturing a bit, as browsers don't even try to use websocket. -- (thanks vojta)
if (process.env.TRAVIS) {
config.logLevel = config.LOG_INFO;
config.browserNoActivityTimeout = 120000; // NOTE: from angular.js, for socket.io buffer
config.reporters = ['dots', 'coverage'];
var buildLabel = 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')';
// config.transports = ['websocket', 'xhr-polling'];
config.sauceLabs.build = buildLabel;
config.sauceLabs.startConnect = false;
config.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
config.transports = ['xhr-polling'];
// Debug logging into a file, that we print out at the end of the build.
config.loggers.push({
type: 'file',
filename: process.env.LOGS_DIR + '/' + ('karma.log')
});
// NOTE: From angular.js project, only applies to SauceLabs -- (thanks Vojta again)
// Allocating a browser can take pretty long (eg. if we are out of capacity and need to wait
// for another build to finish) and so the `captureTimeout` typically kills
// an in-queue-pending request, which makes no sense.
config.captureTimeout = 0;
}
if (grunt.option('browsers')) {
var bs = grunt.option('browsers').split(/,/).map(function(b) { return b.trim(); });
config.browsers = bs;
}
};
|
bartkiewicz/ui-grid
|
test/karma.conf.js
|
JavaScript
|
mit
| 4,547
|
// Copyright 2004-present Facebook. All Rights Reserved.
#pragma once
#include <jschelpers/JavaScriptCore.h>
namespace facebook {
namespace react {
void initSamplingProfilerOnMainJSCThread(JSGlobalContextRef ctx);
}
}
|
prayuditb/tryout-01
|
websocket/client/Client/node_modules/react-native/ReactCommon/cxxreact/JSCSamplingProfiler.h
|
C
|
mit
| 222
|
/*
Project: angular-gantt v1.2.7 - Gantt chart component for AngularJS
Authors: Marco Schweighauser, Rémi Alvergnat
License: MIT
Homepage: https://www.angular-gantt.com
Github: https://github.com/angular-gantt/angular-gantt.git
*/
(function(){
'use strict';
angular.module('gantt.drawtask', ['gantt']).directive('ganttDrawTask', ['$document', 'ganttMouseOffset', 'moment', function(document, mouseOffset, moment) {
return {
restrict: 'E',
require: '^gantt',
scope: {
enabled: '=?',
moveThreshold: '=?',
taskModelFactory: '=taskFactory'
},
link: function(scope, element, attrs, ganttCtrl) {
var api = ganttCtrl.gantt.api;
if (scope.enabled === undefined) {
scope.enabled = true;
}
if (scope.moveThreshold === undefined) {
scope.moveThreshold = 0;
}
api.directives.on.new(scope, function(directiveName, directiveScope, element) {
if (directiveName === 'ganttRow') {
var addNewTask = function(x) {
var startDate = api.core.getDateByPosition(x, true);
var endDate = moment(startDate);
var taskModel = scope.taskModelFactory();
taskModel.from = startDate;
taskModel.to = endDate;
var task = directiveScope.row.addTask(taskModel);
task.isResizing = true;
task.updatePosAndSize();
directiveScope.row.updateVisibleTasks();
directiveScope.row.$scope.$digest();
};
var deferDrawing = function(startX) {
var moveTrigger = function(evt) {
var currentX = mouseOffset.getOffset(evt).x;
if (Math.abs(startX - currentX) >= scope.moveThreshold) {
element.off('mousemove', moveTrigger);
addNewTask(startX);
}
};
element.on('mousemove', moveTrigger);
document.one('mouseup', function() {
element.off('mousemove', moveTrigger);
});
};
var drawHandler = function(evt) {
var evtTarget = (evt.target ? evt.target : evt.srcElement);
var enabled = angular.isFunction(scope.enabled) ? scope.enabled(evt): scope.enabled;
if (enabled && evtTarget.className.indexOf('gantt-row') > -1) {
var x = mouseOffset.getOffset(evt).x;
if (scope.moveThreshold === 0) {
addNewTask(x, x);
} else {
deferDrawing(x);
}
}
};
element.on('mousedown', drawHandler);
directiveScope.drawTaskHandler = drawHandler;
}
});
api.directives.on.destroy(scope, function(directiveName, directiveScope, element) {
if (directiveName === 'ganttRow') {
element.off('mousedown', directiveScope.drawTaskHandler);
delete directiveScope.drawTaskHandler;
}
});
}
};
}]);
}());
angular.module('gantt.drawtask.templates', []).run(['$templateCache', function($templateCache) {
}]);
//# sourceMappingURL=angular-gantt-drawtask-plugin.js.map
|
JJediny/angular-gantt
|
dist/angular-gantt-drawtask-plugin.js
|
JavaScript
|
mit
| 4,070
|
/// <reference path="pgwmodal.d.ts" />
var $j: JQueryStatic;
var $z: ZeptoStatic;
function test_open(): void {
var r: boolean = $j.pgwModal({
content: 'Modal Example 1'
});
$j.pgwModal({
target: '#modalContent',
title: 'Modal title 2',
maxWidth: 800
});
$j.pgwModal({
url: 'modal-test.php',
loadingContent: '<span style="text-align:center">Loading in progress</span>',
closable: false,
titleBar: false
});
}
function test_action(): void {
var r1: boolean = $j.pgwModal('close');
var r2: boolean = $j.pgwModal('reposition');
var r3: boolean = $j.pgwModal('isOpen');
var r4: any = $j.pgwModal('getData');
}
function test_equal(): void {
$j.pgwModal == $z.pgwModal;
}
|
rodzewich/playground
|
types/pgwmodal/pgwmodal-test.ts
|
TypeScript
|
mit
| 779
|
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4721062
* @summary DA treatment of return statements in constructors
* @author Neal Gafter (gafter)
*
* @compile/fail T4721062a.java
*/
class T4721062a {
final int i;
T4721062a() {
if (true)
return;
i = 1;
}
}
|
rokn/Count_Words_2015
|
testing/openjdk2/langtools/test/tools/javac/DefiniteAssignment/T4721062a.java
|
Java
|
mit
| 1,328
|
#
# arch/x86/boot/Makefile
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1994 by Linus Torvalds
# Changed by many, many contributors over the years.
#
# If you want to preset the SVGA mode, uncomment the next line and
# set SVGA_MODE to whatever number you want.
# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
# The number is the same as you would ordinarily press at bootup.
SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
targets := vmlinux.bin setup.bin setup.elf bzImage
targets += fdimage fdimage144 fdimage288 image.iso mtools.conf
subdir- := compressed
setup-y += a20.o bioscall.o cmdline.o copy.o cpu.o cpucheck.o
setup-y += early_serial_console.o edd.o header.o main.o mca.o memory.o
setup-y += pm.o pmjump.o printf.o regs.o string.o tty.o video.o
setup-y += video-mode.o version.o
setup-$(CONFIG_X86_APM_BOOT) += apm.o
# The link order of the video-*.o modules can matter. In particular,
# video-vga.o *must* be listed first, followed by video-vesa.o.
# Hardware-specific drivers should follow in the order they should be
# probed, and video-bios.o should typically be last.
setup-y += video-vga.o
setup-y += video-vesa.o
setup-y += video-bios.o
targets += $(setup-y)
hostprogs-y := mkcpustr tools/build
HOST_EXTRACFLAGS += -I$(srctree)/tools/include $(LINUXINCLUDE) \
-D__EXPORTED_HEADERS__
$(obj)/cpu.o: $(obj)/cpustr.h
quiet_cmd_cpustr = CPUSTR $@
cmd_cpustr = $(obj)/mkcpustr > $@
targets += cpustr.h
$(obj)/cpustr.h: $(obj)/mkcpustr FORCE
$(call if_changed,cpustr)
# ---------------------------------------------------------------------------
# How to compile the 16-bit code. Note we always compile for -march=i386,
# that way we can complain to the user if the CPU is insufficient.
KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
-DDISABLE_BRANCH_PROFILING \
-Wall -Wstrict-prototypes \
-march=i386 -mregparm=3 \
-include $(srctree)/$(src)/code16gcc.h \
-fno-strict-aliasing -fomit-frame-pointer -fno-pic \
$(call cc-option, -ffreestanding) \
$(call cc-option, -fno-toplevel-reorder,\
$(call cc-option, -fno-unit-at-a-time)) \
$(call cc-option, -fno-stack-protector) \
$(call cc-option, -mpreferred-stack-boundary=2)
KBUILD_CFLAGS += $(call cc-option, -m32)
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
GCOV_PROFILE := n
$(obj)/bzImage: asflags-y := $(SVGA_MODE)
quiet_cmd_image = BUILD $@
cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin > $@
$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
$(call if_changed,image)
@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
OBJCOPYFLAGS_vmlinux.bin := -O binary -R .note -R .comment -S
$(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE
$(call if_changed,objcopy)
SETUP_OBJS = $(addprefix $(obj)/,$(setup-y))
sed-voffset := -e 's/^\([0-9a-fA-F]*\) . \(_text\|_end\)$$/\#define VO_\2 0x\1/p'
quiet_cmd_voffset = VOFFSET $@
cmd_voffset = $(NM) $< | sed -n $(sed-voffset) > $@
targets += voffset.h
$(obj)/voffset.h: vmlinux FORCE
$(call if_changed,voffset)
sed-zoffset := -e 's/^\([0-9a-fA-F]*\) . \(startup_32\|input_data\|_end\|z_.*\)$$/\#define ZO_\2 0x\1/p'
quiet_cmd_zoffset = ZOFFSET $@
cmd_zoffset = $(NM) $< | sed -n $(sed-zoffset) > $@
targets += zoffset.h
$(obj)/zoffset.h: $(obj)/compressed/vmlinux FORCE
$(call if_changed,zoffset)
AFLAGS_header.o += -I$(obj)
$(obj)/header.o: $(obj)/voffset.h $(obj)/zoffset.h
LDFLAGS_setup.elf := -T
$(obj)/setup.elf: $(src)/setup.ld $(SETUP_OBJS) FORCE
$(call if_changed,ld)
OBJCOPYFLAGS_setup.bin := -O binary
$(obj)/setup.bin: $(obj)/setup.elf FORCE
$(call if_changed,objcopy)
$(obj)/compressed/vmlinux: FORCE
$(Q)$(MAKE) $(build)=$(obj)/compressed $@
# Set this if you want to pass append arguments to the
# bzdisk/fdimage/isoimage kernel
FDARGS =
# Set this if you want an initrd included with the
# bzdisk/fdimage/isoimage kernel
FDINITRD =
image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,)
$(obj)/mtools.conf: $(src)/mtools.conf.in
sed -e 's|@OBJ@|$(obj)|g' < $< > $@
# This requires write access to /dev/fd0
bzdisk: $(obj)/bzImage $(obj)/mtools.conf
MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync
syslinux /dev/fd0 ; sync
echo '$(image_cmdline)' | \
MTOOLSRC=$(src)/mtools.conf mcopy - a:syslinux.cfg
if [ -f '$(FDINITRD)' ] ; then \
MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \
fi
MTOOLSRC=$(obj)/mtools.conf mcopy $(obj)/bzImage a:linux ; sync
# These require being root or having syslinux 2.02 or higher installed
fdimage fdimage144: $(obj)/bzImage $(obj)/mtools.conf
dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440
MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync
syslinux $(obj)/fdimage ; sync
echo '$(image_cmdline)' | \
MTOOLSRC=$(obj)/mtools.conf mcopy - v:syslinux.cfg
if [ -f '$(FDINITRD)' ] ; then \
MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \
fi
MTOOLSRC=$(obj)/mtools.conf mcopy $(obj)/bzImage v:linux ; sync
fdimage288: $(obj)/bzImage $(obj)/mtools.conf
dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880
MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync
syslinux $(obj)/fdimage ; sync
echo '$(image_cmdline)' | \
MTOOLSRC=$(obj)/mtools.conf mcopy - w:syslinux.cfg
if [ -f '$(FDINITRD)' ] ; then \
MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \
fi
MTOOLSRC=$(obj)/mtools.conf mcopy $(obj)/bzImage w:linux ; sync
isoimage: $(obj)/bzImage
-rm -rf $(obj)/isoimage
mkdir $(obj)/isoimage
for i in lib lib64 share end ; do \
if [ -f /usr/$$i/syslinux/isolinux.bin ] ; then \
cp /usr/$$i/syslinux/isolinux.bin $(obj)/isoimage ; \
break ; \
fi ; \
if [ $$i = end ] ; then exit 1 ; fi ; \
done
cp $(obj)/bzImage $(obj)/isoimage/linux
echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg
if [ -f '$(FDINITRD)' ] ; then \
cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \
fi
mkisofs -J -r -o $(obj)/image.iso -b isolinux.bin -c boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \
$(obj)/isoimage
isohybrid $(obj)/image.iso 2>/dev/null || true
rm -rf $(obj)/isoimage
bzlilo: $(obj)/bzImage
if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
cat $(obj)/bzImage > $(INSTALL_PATH)/vmlinuz
cp System.map $(INSTALL_PATH)/
if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
install:
sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
System.map "$(INSTALL_PATH)"
|
soap-DEIM/l4android
|
arch/x86/boot/Makefile
|
Makefile
|
gpl-2.0
| 6,801
|
module HTML
class Pipeline
# This filter rewrites image tags with a max-width inline style and also wraps
# the image in an <a> tag that causes the full size image to be opened in a
# new tab.
#
# The max-width inline styles are especially useful in HTML email which
# don't use a global stylesheets.
class ImageMaxWidthFilter < Filter
def call
doc.search('img').each do |element|
# Skip if there's already a style attribute. Not sure how this
# would happen but we can reconsider it in the future.
next if element['style']
# Bail out if src doesn't look like a valid http url. trying to avoid weird
# js injection via javascript: urls.
next if element['src'].to_s.strip =~ /\Ajavascript/i
element['style'] = "max-width:100%;"
if !has_ancestor?(element, %w(a))
link_image element
end
end
doc
end
def link_image(element)
link = doc.document.create_element('a', :href => element['src'], :target => '_blank')
link.add_child(element.dup)
element.replace(link)
end
end
end
end
|
fernandoandreotti/cibim
|
vendor/ruby/2.4.0/gems/html-pipeline-2.7.1/lib/html/pipeline/image_max_width_filter.rb
|
Ruby
|
apache-2.0
| 1,186
|
<?php
namespace Doctrine\Tests\Models\Cache;
/**
* @Entity
*/
class Bar extends Attraction
{
const CLASSNAME = __CLASS__;
}
|
tdutrion/rwe
|
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Cache/Bar.php
|
PHP
|
bsd-3-clause
| 134
|
/*
*
* (C) COPYRIGHT 2012-2013 ARM Limited. All rights reserved.
*
* This program is free software and is provided to you under the terms of the
* GNU General Public License version 2 as published by the Free Software
* Foundation, and any use by you of this program is subject to the terms
* of such GNU licence.
*
* A copy of the licence is included with the program, and can also be obtained
* from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
/**
* @file
* Software workarounds configuration for Hardware issues.
*/
#ifndef _BASE_HWCONFIG_H_
#define _BASE_HWCONFIG_H_
#include <malisw/mali_malisw.h>
/**
* List of all workarounds.
*
*/
typedef enum base_hw_issue {
/* The current version of the model doesn't support Soft-Stop */
BASE_HW_ISSUE_5736,
/* Need way to guarantee that all previously-translated memory accesses are commited */
BASE_HW_ISSUE_6367,
/* Unaligned load stores crossing 128 bit boundaries will fail */
BASE_HW_ISSUE_6402,
/* On job complete with non-done the cache is not flushed */
BASE_HW_ISSUE_6787,
/* WLS allocation does not respect the Instances field in the Thread Storage Descriptor */
BASE_HW_ISSUE_7027,
/* The clamp integer coordinate flag bit of the sampler descriptor is reserved */
BASE_HW_ISSUE_7144,
/* CRC computation can only happen when the bits per pixel is less than or equal to 32 */
BASE_HW_ISSUE_7393,
/* Write of PRFCNT_CONFIG_MODE_MANUAL to PRFCNT_CONFIG causes a instrumentation dump if
PRFCNT_TILER_EN is enabled */
BASE_HW_ISSUE_8186,
/* TIB: Reports faults from a vtile which has not yet been allocated */
BASE_HW_ISSUE_8245,
/* WLMA memory goes wrong when run on shader cores other than core 0. */
BASE_HW_ISSUE_8250,
/* Hierz doesn't work when stenciling is enabled */
BASE_HW_ISSUE_8260,
/* Livelock in L0 icache */
BASE_HW_ISSUE_8280,
/* uTLB deadlock could occur when writing to an invalid page at the same time as
* access to a valid page in the same uTLB cache line ( == 4 PTEs == 16K block of mapping) */
BASE_HW_ISSUE_8316,
/* TLS base address mismatch, must stay below 1MB TLS */
BASE_HW_ISSUE_8381,
/* HT: TERMINATE for RUN command ignored if previous LOAD_DESCRIPTOR is still executing */
BASE_HW_ISSUE_8394,
/* CSE : Sends a TERMINATED response for a task that should not be terminated */
/* (Note that PRLAM-8379 also uses this workaround) */
BASE_HW_ISSUE_8401,
/* Repeatedly Soft-stopping a job chain consisting of (Vertex Shader, Cache Flush, Tiler)
* jobs causes 0x58 error on tiler job. */
BASE_HW_ISSUE_8408,
/* Disable the Pause Buffer in the LS pipe. */
BASE_HW_ISSUE_8443,
/* Stencil test enable 1->0 sticks */
BASE_HW_ISSUE_8456,
/* Tiler heap issue using FBOs or multiple processes using the tiler simultaneously */
/* (Note that PRLAM-9049 also uses this work-around) */
BASE_HW_ISSUE_8564,
/* Livelock issue using atomic instructions (particularly when using atomic_cmpxchg as a spinlock) */
BASE_HW_ISSUE_8791,
/* Fused jobs are not supported (for various reasons) */
/* Jobs with relaxed dependencies do not support soft-stop */
/* (Note that PRLAM-8803, PRLAM-8393, PRLAM-8559, PRLAM-8601 & PRLAM-8607 all use this work-around) */
BASE_HW_ISSUE_8803,
/* Blend shader output is wrong for certain formats */
BASE_HW_ISSUE_8833,
/* Occlusion queries can create false 0 result in boolean and counter modes */
BASE_HW_ISSUE_8879,
/* Output has half intensity with blend shaders enabled on 8xMSAA. */
BASE_HW_ISSUE_8896,
/* 8xMSAA does not work with CRC */
BASE_HW_ISSUE_8975,
/* Boolean occlusion queries don't work properly due to sdc issue. */
BASE_HW_ISSUE_8986,
/* Change in RMUs in use causes problems related with the core's SDC */
BASE_HW_ISSUE_8987,
/* Occlusion query result is not updated if color writes are disabled. */
BASE_HW_ISSUE_9010,
/* Problem with number of work registers in the RSD if set to 0 */
BASE_HW_ISSUE_9275,
/* Incorrect coverage mask for 8xMSAA */
BASE_HW_ISSUE_9423,
/* Compute endpoint has a 4-deep queue of tasks, meaning a soft stop won't complete until all 4 tasks have completed */
BASE_HW_ISSUE_9435,
/* HT: Tiler returns TERMINATED for command that hasn't been terminated */
BASE_HW_ISSUE_9510,
/* Occasionally the GPU will issue multiple page faults for the same address before the MMU page table has been read by the GPU */
BASE_HW_ISSUE_9630,
/* Must clear the 64 byte private state of the tiler information */
BASE_HW_ISSUE_10127,
/* RA DCD load request to SDC returns invalid load ignore causing colour buffer mismatch */
BASE_HW_ISSUE_10327,
/* Occlusion query result may be updated prematurely when fragment shader alters coverage */
BASE_HW_ISSUE_10410,
/* MAG / MIN filter selection happens after image descriptor clamps were applied */
BASE_HW_ISSUE_10472,
/* GPU interprets sampler and image descriptor pointer array sizes as one bigger than they are defined in midg structures */
BASE_HW_ISSUE_10487,
/* LD_SPECIAL instruction reads incorrect RAW tile buffer value when internal tib format is R10G10B10A2 */
BASE_HW_ISSUE_10632,
/* MMU TLB invalidation hazards */
BASE_HW_ISSUE_10649,
/* Missing cache flush in multi core-group configuration */
BASE_HW_ISSUE_10676,
/* Indexed format 95 cannot be used with a component swizzle of "set to 1" when sampled as integer texture */
BASE_HW_ISSUE_10682,
/* sometimes HW doesn't invalidate cached VPDs when it has to */
BASE_HW_ISSUE_10684,
/* Soft-stopping fragment jobs might fail with TILE_RANGE_FAULT */
BASE_HW_ISSUE_10817,
/* Intermittent missing interrupt on job completion */
BASE_HW_ISSUE_10883,
/* Depth bounds incorrectly normalized in hierz depth bounds test */
BASE_HW_ISSUE_10931,
/* Soft-stopped fragment shader job can restart with out-of-bound restart index */
BASE_HW_ISSUE_10969,
/* The BASE_HW_ISSUE_END value must be the last issue listed in this enumeration
* and must be the last value in each array that contains the list of workarounds
* for a particular HW version.
*/
BASE_HW_ISSUE_END
} base_hw_issue;
/**
* Workarounds configuration for each HW revision
*/
/* Mali T60x r0p0-15dev0 - 2011-W39-stable-9 */
static const base_hw_issue base_hw_issues_t60x_r0p0_15dev0[] = {
BASE_HW_ISSUE_6367,
BASE_HW_ISSUE_6402,
BASE_HW_ISSUE_6787,
BASE_HW_ISSUE_7027,
BASE_HW_ISSUE_7144,
BASE_HW_ISSUE_7393,
BASE_HW_ISSUE_8186,
BASE_HW_ISSUE_8245,
BASE_HW_ISSUE_8250,
BASE_HW_ISSUE_8260,
BASE_HW_ISSUE_8280,
BASE_HW_ISSUE_8316,
BASE_HW_ISSUE_8381,
BASE_HW_ISSUE_8394,
BASE_HW_ISSUE_8401,
BASE_HW_ISSUE_8408,
BASE_HW_ISSUE_8443,
BASE_HW_ISSUE_8456,
BASE_HW_ISSUE_8564,
BASE_HW_ISSUE_8791,
BASE_HW_ISSUE_8803,
BASE_HW_ISSUE_8833,
BASE_HW_ISSUE_8896,
BASE_HW_ISSUE_8975,
BASE_HW_ISSUE_8986,
BASE_HW_ISSUE_8987,
BASE_HW_ISSUE_9010,
BASE_HW_ISSUE_9275,
BASE_HW_ISSUE_9423,
BASE_HW_ISSUE_9435,
BASE_HW_ISSUE_9510,
BASE_HW_ISSUE_9630,
BASE_HW_ISSUE_10410,
BASE_HW_ISSUE_10472,
BASE_HW_ISSUE_10487,
BASE_HW_ISSUE_10632,
BASE_HW_ISSUE_10649,
BASE_HW_ISSUE_10676,
BASE_HW_ISSUE_10682,
BASE_HW_ISSUE_10684,
BASE_HW_ISSUE_10883,
BASE_HW_ISSUE_10931,
BASE_HW_ISSUE_10969,
/* List of hardware issues must end with BASE_HW_ISSUE_END */
BASE_HW_ISSUE_END
};
/* Mali T60x r0p0-00rel0 - 2011-W46-stable-13c */
static const base_hw_issue base_hw_issues_t60x_r0p0_eac[] = {
BASE_HW_ISSUE_6367,
BASE_HW_ISSUE_6402,
BASE_HW_ISSUE_6787,
BASE_HW_ISSUE_7027,
BASE_HW_ISSUE_7393,
BASE_HW_ISSUE_8408,
BASE_HW_ISSUE_8564,
BASE_HW_ISSUE_8803,
BASE_HW_ISSUE_8975,
BASE_HW_ISSUE_9010,
BASE_HW_ISSUE_9275,
BASE_HW_ISSUE_9423,
BASE_HW_ISSUE_9435,
BASE_HW_ISSUE_9510,
BASE_HW_ISSUE_10410,
BASE_HW_ISSUE_10472,
BASE_HW_ISSUE_10487,
BASE_HW_ISSUE_10632,
BASE_HW_ISSUE_10649,
BASE_HW_ISSUE_10676,
BASE_HW_ISSUE_10682,
BASE_HW_ISSUE_10684,
BASE_HW_ISSUE_10883,
BASE_HW_ISSUE_10931,
BASE_HW_ISSUE_10969,
/* List of hardware issues must end with BASE_HW_ISSUE_END */
BASE_HW_ISSUE_END
};
/* Mali T60x r0p1 */
static const base_hw_issue base_hw_issues_t60x_r0p1[] = {
BASE_HW_ISSUE_6367,
BASE_HW_ISSUE_6402,
BASE_HW_ISSUE_6787,
BASE_HW_ISSUE_7027,
BASE_HW_ISSUE_7393,
BASE_HW_ISSUE_8408,
BASE_HW_ISSUE_8564,
BASE_HW_ISSUE_8803,
BASE_HW_ISSUE_8975,
BASE_HW_ISSUE_9010,
BASE_HW_ISSUE_9275,
BASE_HW_ISSUE_9435,
BASE_HW_ISSUE_9510,
BASE_HW_ISSUE_10410,
BASE_HW_ISSUE_10472,
BASE_HW_ISSUE_10487,
BASE_HW_ISSUE_10632,
BASE_HW_ISSUE_10649,
BASE_HW_ISSUE_10676,
BASE_HW_ISSUE_10682,
BASE_HW_ISSUE_10684,
BASE_HW_ISSUE_10883,
BASE_HW_ISSUE_10931,
/* List of hardware issues must end with BASE_HW_ISSUE_END */
BASE_HW_ISSUE_END
};
/* Mali T65x r0p1 */
static const base_hw_issue base_hw_issues_t65x_r0p1[] = {
BASE_HW_ISSUE_6367,
BASE_HW_ISSUE_6402,
BASE_HW_ISSUE_6787,
BASE_HW_ISSUE_7027,
BASE_HW_ISSUE_7393,
BASE_HW_ISSUE_8408,
BASE_HW_ISSUE_8564,
BASE_HW_ISSUE_8803,
BASE_HW_ISSUE_9010,
BASE_HW_ISSUE_9275,
BASE_HW_ISSUE_9435,
BASE_HW_ISSUE_9510,
BASE_HW_ISSUE_10410,
BASE_HW_ISSUE_10472,
BASE_HW_ISSUE_10487,
BASE_HW_ISSUE_10632,
BASE_HW_ISSUE_10649,
BASE_HW_ISSUE_10676,
BASE_HW_ISSUE_10682,
BASE_HW_ISSUE_10684,
BASE_HW_ISSUE_10883,
BASE_HW_ISSUE_10931,
/* List of hardware issues must end with BASE_HW_ISSUE_END */
BASE_HW_ISSUE_END
};
/* Mali T62x r0p0 */
static const base_hw_issue base_hw_issues_t62x_r0p0[] = {
BASE_HW_ISSUE_6402,
BASE_HW_ISSUE_7393,
BASE_HW_ISSUE_8803,
BASE_HW_ISSUE_9435,
BASE_HW_ISSUE_10127,
BASE_HW_ISSUE_10327,
BASE_HW_ISSUE_10410,
BASE_HW_ISSUE_10472,
BASE_HW_ISSUE_10487,
BASE_HW_ISSUE_10632,
BASE_HW_ISSUE_10649,
BASE_HW_ISSUE_10676,
BASE_HW_ISSUE_10682,
BASE_HW_ISSUE_10684,
BASE_HW_ISSUE_10817,
BASE_HW_ISSUE_10883,
BASE_HW_ISSUE_10931,
/* List of hardware issues must end with BASE_HW_ISSUE_END */
BASE_HW_ISSUE_END
};
/* Mali T67x r0p0 */
static const base_hw_issue base_hw_issues_t67x_r0p0[] = {
BASE_HW_ISSUE_6402,
BASE_HW_ISSUE_7393,
BASE_HW_ISSUE_8803,
BASE_HW_ISSUE_9435,
BASE_HW_ISSUE_10127,
BASE_HW_ISSUE_10327,
BASE_HW_ISSUE_10410,
BASE_HW_ISSUE_10472,
BASE_HW_ISSUE_10487,
BASE_HW_ISSUE_10632,
BASE_HW_ISSUE_10649,
BASE_HW_ISSUE_10676,
BASE_HW_ISSUE_10682,
BASE_HW_ISSUE_10684,
BASE_HW_ISSUE_10817,
BASE_HW_ISSUE_10883,
BASE_HW_ISSUE_10931,
/* List of hardware issues must end with BASE_HW_ISSUE_END */
BASE_HW_ISSUE_END
};
/* Mali T62x r0p1 */
static const base_hw_issue base_hw_issues_t62x_r0p1[] = {
BASE_HW_ISSUE_6402,
BASE_HW_ISSUE_7393,
BASE_HW_ISSUE_8803,
BASE_HW_ISSUE_9435,
BASE_HW_ISSUE_10127,
BASE_HW_ISSUE_10327,
BASE_HW_ISSUE_10410,
BASE_HW_ISSUE_10472,
BASE_HW_ISSUE_10487,
BASE_HW_ISSUE_10632,
BASE_HW_ISSUE_10649,
BASE_HW_ISSUE_10676,
BASE_HW_ISSUE_10682,
BASE_HW_ISSUE_10684,
BASE_HW_ISSUE_10817,
BASE_HW_ISSUE_10883,
BASE_HW_ISSUE_10931,
/* List of hardware issues must end with BASE_HW_ISSUE_END */
BASE_HW_ISSUE_END
};
/* Mali T67x r0p1 */
static const base_hw_issue base_hw_issues_t67x_r0p1[] = {
BASE_HW_ISSUE_6402,
BASE_HW_ISSUE_7393,
BASE_HW_ISSUE_8803,
BASE_HW_ISSUE_9435,
BASE_HW_ISSUE_10127,
BASE_HW_ISSUE_10327,
BASE_HW_ISSUE_10410,
BASE_HW_ISSUE_10472,
BASE_HW_ISSUE_10487,
BASE_HW_ISSUE_10632,
BASE_HW_ISSUE_10649,
BASE_HW_ISSUE_10676,
BASE_HW_ISSUE_10682,
BASE_HW_ISSUE_10684,
BASE_HW_ISSUE_10817,
BASE_HW_ISSUE_10883,
BASE_HW_ISSUE_10931,
/* List of hardware issues must end with BASE_HW_ISSUE_END */
BASE_HW_ISSUE_END
};
/* Mali T62x r1p0 */
static const base_hw_issue base_hw_issues_t62x_r1p0[] = {
BASE_HW_ISSUE_6402,
BASE_HW_ISSUE_7393,
BASE_HW_ISSUE_8803,
BASE_HW_ISSUE_9435,
BASE_HW_ISSUE_10472,
BASE_HW_ISSUE_10649,
BASE_HW_ISSUE_10684,
BASE_HW_ISSUE_10883,
BASE_HW_ISSUE_10931,
/* List of hardware issues must end with BASE_HW_ISSUE_END */
BASE_HW_ISSUE_END
};
/* Mali T67x r1p0 */
static const base_hw_issue base_hw_issues_t67x_r1p0[] = {
BASE_HW_ISSUE_6402,
BASE_HW_ISSUE_7393,
BASE_HW_ISSUE_8803,
BASE_HW_ISSUE_9435,
BASE_HW_ISSUE_10472,
BASE_HW_ISSUE_10649,
BASE_HW_ISSUE_10684,
BASE_HW_ISSUE_10883,
BASE_HW_ISSUE_10931,
/* List of hardware issues must end with BASE_HW_ISSUE_END */
BASE_HW_ISSUE_END
};
/* Mali T75x r0p0 */
static const base_hw_issue base_hw_issues_t75x_r0p0[] = {
BASE_HW_ISSUE_6402,
BASE_HW_ISSUE_8803,
BASE_HW_ISSUE_9435,
BASE_HW_ISSUE_10649,
BASE_HW_ISSUE_10883,
BASE_HW_ISSUE_10931,
/* List of hardware issues must end with BASE_HW_ISSUE_END */
BASE_HW_ISSUE_END
};
#endif /* _BASE_HWCONFIG_H_ */
|
nbars/Custom-Kernel-SM-P600
|
kernel-src/drivers/gpu/arm/t6xx/kbase/mali_base_hwconfig.h
|
C
|
gpl-2.0
| 12,540
|
/*
* Copyright 2014 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@import url("dialog.css");
@import url("inspectorStyle.css");
@import url("inspectorCommon.css");
@import url("inspectorSyntaxHighlight.css");
@import url("popover.css");
@import url("sidebarPane.css");
@import url("suggestBox.css");
@import url("tabbedPane.css");
|
wyicwx/bone-cli-proxy
|
public/inspector/inspector.css
|
CSS
|
mit
| 438
|
/*
A version of malloc/free/realloc written by Doug Lea and released to the
public domain. Send questions/comments/complaints/performance data
to dl@cs.oswego.edu
* VERSION 2.6.6 Sun Mar 5 19:10:03 2000 Doug Lea (dl at gee)
Note: There may be an updated version of this malloc obtainable at
ftp://g.oswego.edu/pub/misc/malloc.c
Check before installing!
* Why use this malloc?
This is not the fastest, most space-conserving, most portable, or
most tunable malloc ever written. However it is among the fastest
while also being among the most space-conserving, portable and tunable.
Consistent balance across these factors results in a good general-purpose
allocator. For a high-level description, see
http://g.oswego.edu/dl/html/malloc.html
* Synopsis of public routines
(Much fuller descriptions are contained in the program documentation below.)
malloc(size_t n);
Return a pointer to a newly allocated chunk of at least n bytes, or null
if no space is available.
free(Void_t* p);
Release the chunk of memory pointed to by p, or no effect if p is null.
realloc(Void_t* p, size_t n);
Return a pointer to a chunk of size n that contains the same data
as does chunk p up to the minimum of (n, p's size) bytes, or null
if no space is available. The returned pointer may or may not be
the same as p. If p is null, equivalent to malloc. Unless the
#define REALLOC_ZERO_BYTES_FREES below is set, realloc with a
size argument of zero (re)allocates a minimum-sized chunk.
memalign(size_t alignment, size_t n);
Return a pointer to a newly allocated chunk of n bytes, aligned
in accord with the alignment argument, which must be a power of
two.
valloc(size_t n);
Equivalent to memalign(pagesize, n), where pagesize is the page
size of the system (or as near to this as can be figured out from
all the includes/defines below.)
pvalloc(size_t n);
Equivalent to valloc(minimum-page-that-holds(n)), that is,
round up n to nearest pagesize.
calloc(size_t unit, size_t quantity);
Returns a pointer to quantity * unit bytes, with all locations
set to zero.
cfree(Void_t* p);
Equivalent to free(p).
malloc_trim(size_t pad);
Release all but pad bytes of freed top-most memory back
to the system. Return 1 if successful, else 0.
malloc_usable_size(Void_t* p);
Report the number usable allocated bytes associated with allocated
chunk p. This may or may not report more bytes than were requested,
due to alignment and minimum size constraints.
malloc_stats();
Prints brief summary statistics on stderr.
mallinfo()
Returns (by copy) a struct containing various summary statistics.
mallopt(int parameter_number, int parameter_value)
Changes one of the tunable parameters described below. Returns
1 if successful in changing the parameter, else 0.
* Vital statistics:
Alignment: 8-byte
8 byte alignment is currently hardwired into the design. This
seems to suffice for all current machines and C compilers.
Assumed pointer representation: 4 or 8 bytes
Code for 8-byte pointers is untested by me but has worked
reliably by Wolfram Gloger, who contributed most of the
changes supporting this.
Assumed size_t representation: 4 or 8 bytes
Note that size_t is allowed to be 4 bytes even if pointers are 8.
Minimum overhead per allocated chunk: 4 or 8 bytes
Each malloced chunk has a hidden overhead of 4 bytes holding size
and status information.
Minimum allocated size: 4-byte ptrs: 16 bytes (including 4 overhead)
8-byte ptrs: 24/32 bytes (including, 4/8 overhead)
When a chunk is freed, 12 (for 4byte ptrs) or 20 (for 8 byte
ptrs but 4 byte size) or 24 (for 8/8) additional bytes are
needed; 4 (8) for a trailing size field
and 8 (16) bytes for free list pointers. Thus, the minimum
allocatable size is 16/24/32 bytes.
Even a request for zero bytes (i.e., malloc(0)) returns a
pointer to something of the minimum allocatable size.
Maximum allocated size: 4-byte size_t: 2^31 - 8 bytes
8-byte size_t: 2^63 - 16 bytes
It is assumed that (possibly signed) size_t bit values suffice to
represent chunk sizes. `Possibly signed' is due to the fact
that `size_t' may be defined on a system as either a signed or
an unsigned type. To be conservative, values that would appear
as negative numbers are avoided.
Requests for sizes with a negative sign bit when the request
size is treaded as a long will return null.
Maximum overhead wastage per allocated chunk: normally 15 bytes
Alignnment demands, plus the minimum allocatable size restriction
make the normal worst-case wastage 15 bytes (i.e., up to 15
more bytes will be allocated than were requested in malloc), with
two exceptions:
1. Because requests for zero bytes allocate non-zero space,
the worst case wastage for a request of zero bytes is 24 bytes.
2. For requests >= mmap_threshold that are serviced via
mmap(), the worst case wastage is 8 bytes plus the remainder
from a system page (the minimal mmap unit); typically 4096 bytes.
* Limitations
Here are some features that are NOT currently supported
* No user-definable hooks for callbacks and the like.
* No automated mechanism for fully checking that all accesses
to malloced memory stay within their bounds.
* No support for compaction.
* Synopsis of compile-time options:
People have reported using previous versions of this malloc on all
versions of Unix, sometimes by tweaking some of the defines
below. It has been tested most extensively on Solaris and
Linux. It is also reported to work on WIN32 platforms.
People have also reported adapting this malloc for use in
stand-alone embedded systems.
The implementation is in straight, hand-tuned ANSI C. Among other
consequences, it uses a lot of macros. Because of this, to be at
all usable, this code should be compiled using an optimizing compiler
(for example gcc -O2) that can simplify expressions and control
paths.
__STD_C (default: derived from C compiler defines)
Nonzero if using ANSI-standard C compiler, a C++ compiler, or
a C compiler sufficiently close to ANSI to get away with it.
DEBUG (default: NOT defined)
Define to enable debugging. Adds fairly extensive assertion-based
checking to help track down memory errors, but noticeably slows down
execution.
REALLOC_ZERO_BYTES_FREES (default: NOT defined)
Define this if you think that realloc(p, 0) should be equivalent
to free(p). Otherwise, since malloc returns a unique pointer for
malloc(0), so does realloc(p, 0).
HAVE_MEMCPY (default: defined)
Define if you are not otherwise using ANSI STD C, but still
have memcpy and memset in your C library and want to use them.
Otherwise, simple internal versions are supplied.
USE_MEMCPY (default: 1 if HAVE_MEMCPY is defined, 0 otherwise)
Define as 1 if you want the C library versions of memset and
memcpy called in realloc and calloc (otherwise macro versions are used).
At least on some platforms, the simple macro versions usually
outperform libc versions.
HAVE_MMAP (default: defined as 1)
Define to non-zero to optionally make malloc() use mmap() to
allocate very large blocks.
HAVE_MREMAP (default: defined as 0 unless Linux libc set)
Define to non-zero to optionally make realloc() use mremap() to
reallocate very large blocks.
malloc_getpagesize (default: derived from system #includes)
Either a constant or routine call returning the system page size.
HAVE_USR_INCLUDE_MALLOC_H (default: NOT defined)
Optionally define if you are on a system with a /usr/include/malloc.h
that declares struct mallinfo. It is not at all necessary to
define this even if you do, but will ensure consistency.
INTERNAL_SIZE_T (default: size_t)
Define to a 32-bit type (probably `unsigned int') if you are on a
64-bit machine, yet do not want or need to allow malloc requests of
greater than 2^31 to be handled. This saves space, especially for
very small chunks.
INTERNAL_LINUX_C_LIB (default: NOT defined)
Defined only when compiled as part of Linux libc.
Also note that there is some odd internal name-mangling via defines
(for example, internally, `malloc' is named `mALLOc') needed
when compiling in this case. These look funny but don't otherwise
affect anything.
WIN32 (default: undefined)
Define this on MS win (95, nt) platforms to compile in sbrk emulation.
LACKS_UNISTD_H (default: undefined if not WIN32)
Define this if your system does not have a <unistd.h>.
LACKS_SYS_PARAM_H (default: undefined if not WIN32)
Define this if your system does not have a <sys/param.h>.
MORECORE (default: sbrk)
The name of the routine to call to obtain more memory from the system.
MORECORE_FAILURE (default: -1)
The value returned upon failure of MORECORE.
MORECORE_CLEARS (default 1)
true (1) if the routine mapped to MORECORE zeroes out memory (which
holds for sbrk).
DEFAULT_TRIM_THRESHOLD
DEFAULT_TOP_PAD
DEFAULT_MMAP_THRESHOLD
DEFAULT_MMAP_MAX
Default values of tunable parameters (described in detail below)
controlling interaction with host system routines (sbrk, mmap, etc).
These values may also be changed dynamically via mallopt(). The
preset defaults are those that give best performance for typical
programs/systems.
USE_DL_PREFIX (default: undefined)
Prefix all public routines with the string 'dl'. Useful to
quickly avoid procedure declaration conflicts and linker symbol
conflicts with existing memory allocation routines.
*/
#ifndef __MALLOC_H__
#define __MALLOC_H__
/* Preliminaries */
#ifndef __STD_C
#ifdef __STDC__
#define __STD_C 1
#else
#if __cplusplus
#define __STD_C 1
#else
#define __STD_C 0
#endif /*__cplusplus*/
#endif /*__STDC__*/
#endif /*__STD_C*/
#ifndef Void_t
#if (__STD_C || defined(WIN32))
#define Void_t void
#else
#define Void_t char
#endif
#endif /*Void_t*/
#if __STD_C
#include <linux/stddef.h> /* for size_t */
#else
#include <sys/types.h>
#endif /* __STD_C */
#ifdef __cplusplus
extern "C" {
#endif
#if 0 /* not for U-Boot */
#include <stdio.h> /* needed for malloc_stats */
#endif
/*
Compile-time options
*/
/*
Debugging:
Because freed chunks may be overwritten with link fields, this
malloc will often die when freed memory is overwritten by user
programs. This can be very effective (albeit in an annoying way)
in helping track down dangling pointers.
If you compile with -DDEBUG, a number of assertion checks are
enabled that will catch more memory errors. You probably won't be
able to make much sense of the actual assertion errors, but they
should help you locate incorrectly overwritten memory. The
checking is fairly extensive, and will slow down execution
noticeably. Calling malloc_stats or mallinfo with DEBUG set will
attempt to check every non-mmapped allocated and free chunk in the
course of computing the summmaries. (By nature, mmapped regions
cannot be checked very much automatically.)
Setting DEBUG may also be helpful if you are trying to modify
this code. The assertions in the check routines spell out in more
detail the assumptions and invariants underlying the algorithms.
*/
/*
INTERNAL_SIZE_T is the word-size used for internal bookkeeping
of chunk sizes. On a 64-bit machine, you can reduce malloc
overhead by defining INTERNAL_SIZE_T to be a 32 bit `unsigned int'
at the expense of not being able to handle requests greater than
2^31. This limitation is hardly ever a concern; you are encouraged
to set this. However, the default version is the same as size_t.
*/
#ifndef INTERNAL_SIZE_T
#define INTERNAL_SIZE_T size_t
#endif
/*
REALLOC_ZERO_BYTES_FREES should be set if a call to
realloc with zero bytes should be the same as a call to free.
Some people think it should. Otherwise, since this malloc
returns a unique pointer for malloc(0), so does realloc(p, 0).
*/
/* #define REALLOC_ZERO_BYTES_FREES */
/*
WIN32 causes an emulation of sbrk to be compiled in
mmap-based options are not currently supported in WIN32.
*/
/* #define WIN32 */
#ifdef WIN32
#define MORECORE wsbrk
#define HAVE_MMAP 0
#define LACKS_UNISTD_H
#define LACKS_SYS_PARAM_H
/*
Include 'windows.h' to get the necessary declarations for the
Microsoft Visual C++ data structures and routines used in the 'sbrk'
emulation.
Define WIN32_LEAN_AND_MEAN so that only the essential Microsoft
Visual C++ header files are included.
*/
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
/*
HAVE_MEMCPY should be defined if you are not otherwise using
ANSI STD C, but still have memcpy and memset in your C library
and want to use them in calloc and realloc. Otherwise simple
macro versions are defined here.
USE_MEMCPY should be defined as 1 if you actually want to
have memset and memcpy called. People report that the macro
versions are often enough faster than libc versions on many
systems that it is better to use them.
*/
#define HAVE_MEMCPY
#ifndef USE_MEMCPY
#ifdef HAVE_MEMCPY
#define USE_MEMCPY 1
#else
#define USE_MEMCPY 0
#endif
#endif
#if (__STD_C || defined(HAVE_MEMCPY))
#if __STD_C
void* memset(void*, int, size_t);
void* memcpy(void*, const void*, size_t);
#else
#ifdef WIN32
/* On Win32 platforms, 'memset()' and 'memcpy()' are already declared in */
/* 'windows.h' */
#else
Void_t* memset();
Void_t* memcpy();
#endif
#endif
#endif
#if USE_MEMCPY
/* The following macros are only invoked with (2n+1)-multiples of
INTERNAL_SIZE_T units, with a positive integer n. This is exploited
for fast inline execution when n is small. */
#define MALLOC_ZERO(charp, nbytes) \
do { \
INTERNAL_SIZE_T mzsz = (nbytes); \
if(mzsz <= 9*sizeof(mzsz)) { \
INTERNAL_SIZE_T* mz = (INTERNAL_SIZE_T*) (charp); \
if(mzsz >= 5*sizeof(mzsz)) { *mz++ = 0; \
*mz++ = 0; \
if(mzsz >= 7*sizeof(mzsz)) { *mz++ = 0; \
*mz++ = 0; \
if(mzsz >= 9*sizeof(mzsz)) { *mz++ = 0; \
*mz++ = 0; }}} \
*mz++ = 0; \
*mz++ = 0; \
*mz = 0; \
} else memset((charp), 0, mzsz); \
} while(0)
#define MALLOC_COPY(dest,src,nbytes) \
do { \
INTERNAL_SIZE_T mcsz = (nbytes); \
if(mcsz <= 9*sizeof(mcsz)) { \
INTERNAL_SIZE_T* mcsrc = (INTERNAL_SIZE_T*) (src); \
INTERNAL_SIZE_T* mcdst = (INTERNAL_SIZE_T*) (dest); \
if(mcsz >= 5*sizeof(mcsz)) { *mcdst++ = *mcsrc++; \
*mcdst++ = *mcsrc++; \
if(mcsz >= 7*sizeof(mcsz)) { *mcdst++ = *mcsrc++; \
*mcdst++ = *mcsrc++; \
if(mcsz >= 9*sizeof(mcsz)) { *mcdst++ = *mcsrc++; \
*mcdst++ = *mcsrc++; }}} \
*mcdst++ = *mcsrc++; \
*mcdst++ = *mcsrc++; \
*mcdst = *mcsrc ; \
} else memcpy(dest, src, mcsz); \
} while(0)
#else /* !USE_MEMCPY */
/* Use Duff's device for good zeroing/copying performance. */
#define MALLOC_ZERO(charp, nbytes) \
do { \
INTERNAL_SIZE_T* mzp = (INTERNAL_SIZE_T*)(charp); \
long mctmp = (nbytes)/sizeof(INTERNAL_SIZE_T), mcn; \
if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp %= 8; } \
switch (mctmp) { \
case 0: for(;;) { *mzp++ = 0; \
case 7: *mzp++ = 0; \
case 6: *mzp++ = 0; \
case 5: *mzp++ = 0; \
case 4: *mzp++ = 0; \
case 3: *mzp++ = 0; \
case 2: *mzp++ = 0; \
case 1: *mzp++ = 0; if(mcn <= 0) break; mcn--; } \
} \
} while(0)
#define MALLOC_COPY(dest,src,nbytes) \
do { \
INTERNAL_SIZE_T* mcsrc = (INTERNAL_SIZE_T*) src; \
INTERNAL_SIZE_T* mcdst = (INTERNAL_SIZE_T*) dest; \
long mctmp = (nbytes)/sizeof(INTERNAL_SIZE_T), mcn; \
if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp %= 8; } \
switch (mctmp) { \
case 0: for(;;) { *mcdst++ = *mcsrc++; \
case 7: *mcdst++ = *mcsrc++; \
case 6: *mcdst++ = *mcsrc++; \
case 5: *mcdst++ = *mcsrc++; \
case 4: *mcdst++ = *mcsrc++; \
case 3: *mcdst++ = *mcsrc++; \
case 2: *mcdst++ = *mcsrc++; \
case 1: *mcdst++ = *mcsrc++; if(mcn <= 0) break; mcn--; } \
} \
} while(0)
#endif
/*
Define HAVE_MMAP to optionally make malloc() use mmap() to
allocate very large blocks. These will be returned to the
operating system immediately after a free().
*/
/***
#ifndef HAVE_MMAP
#define HAVE_MMAP 1
#endif
***/
#undef HAVE_MMAP /* Not available for U-Boot */
/*
Define HAVE_MREMAP to make realloc() use mremap() to re-allocate
large blocks. This is currently only possible on Linux with
kernel versions newer than 1.3.77.
*/
/***
#ifndef HAVE_MREMAP
#ifdef INTERNAL_LINUX_C_LIB
#define HAVE_MREMAP 1
#else
#define HAVE_MREMAP 0
#endif
#endif
***/
#undef HAVE_MREMAP /* Not available for U-Boot */
#ifdef HAVE_MMAP
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
#define MAP_ANONYMOUS MAP_ANON
#endif
#endif /* HAVE_MMAP */
/*
Access to system page size. To the extent possible, this malloc
manages memory from the system in page-size units.
The following mechanics for getpagesize were adapted from
bsd/gnu getpagesize.h
*/
#define LACKS_UNISTD_H /* Shortcut for U-Boot */
#define malloc_getpagesize 4096
#ifndef LACKS_UNISTD_H
# include <unistd.h>
#endif
#ifndef malloc_getpagesize
# ifdef _SC_PAGESIZE /* some SVR4 systems omit an underscore */
# ifndef _SC_PAGE_SIZE
# define _SC_PAGE_SIZE _SC_PAGESIZE
# endif
# endif
# ifdef _SC_PAGE_SIZE
# define malloc_getpagesize sysconf(_SC_PAGE_SIZE)
# else
# if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE)
extern size_t getpagesize();
# define malloc_getpagesize getpagesize()
# else
# ifdef WIN32
# define malloc_getpagesize (4096) /* TBD: Use 'GetSystemInfo' instead */
# else
# ifndef LACKS_SYS_PARAM_H
# include <sys/param.h>
# endif
# ifdef EXEC_PAGESIZE
# define malloc_getpagesize EXEC_PAGESIZE
# else
# ifdef NBPG
# ifndef CLSIZE
# define malloc_getpagesize NBPG
# else
# define malloc_getpagesize (NBPG * CLSIZE)
# endif
# else
# ifdef NBPC
# define malloc_getpagesize NBPC
# else
# ifdef PAGESIZE
# define malloc_getpagesize PAGESIZE
# else
# define malloc_getpagesize (4096) /* just guess */
# endif
# endif
# endif
# endif
# endif
# endif
# endif
#endif
/*
This version of malloc supports the standard SVID/XPG mallinfo
routine that returns a struct containing the same kind of
information you can get from malloc_stats. It should work on
any SVID/XPG compliant system that has a /usr/include/malloc.h
defining struct mallinfo. (If you'd like to install such a thing
yourself, cut out the preliminary declarations as described above
and below and save them in a malloc.h file. But there's no
compelling reason to bother to do this.)
The main declaration needed is the mallinfo struct that is returned
(by-copy) by mallinfo(). The SVID/XPG malloinfo struct contains a
bunch of fields, most of which are not even meaningful in this
version of malloc. Some of these fields are are instead filled by
mallinfo() with other numbers that might possibly be of interest.
HAVE_USR_INCLUDE_MALLOC_H should be set if you have a
/usr/include/malloc.h file that includes a declaration of struct
mallinfo. If so, it is included; else an SVID2/XPG2 compliant
version is declared below. These must be precisely the same for
mallinfo() to work.
*/
/* #define HAVE_USR_INCLUDE_MALLOC_H */
#ifdef HAVE_USR_INCLUDE_MALLOC_H
#include "/usr/include/malloc.h"
#else
/* SVID2/XPG mallinfo structure */
struct mallinfo {
int arena; /* total space allocated from system */
int ordblks; /* number of non-inuse chunks */
int smblks; /* unused -- always zero */
int hblks; /* number of mmapped regions */
int hblkhd; /* total space in mmapped regions */
int usmblks; /* unused -- always zero */
int fsmblks; /* unused -- always zero */
int uordblks; /* total allocated space */
int fordblks; /* total non-inuse space */
int keepcost; /* top-most, releasable (via malloc_trim) space */
};
/* SVID2/XPG mallopt options */
#define M_MXFAST 1 /* UNUSED in this malloc */
#define M_NLBLKS 2 /* UNUSED in this malloc */
#define M_GRAIN 3 /* UNUSED in this malloc */
#define M_KEEP 4 /* UNUSED in this malloc */
#endif
/* mallopt options that actually do something */
#define M_TRIM_THRESHOLD -1
#define M_TOP_PAD -2
#define M_MMAP_THRESHOLD -3
#define M_MMAP_MAX -4
#ifndef DEFAULT_TRIM_THRESHOLD
#define DEFAULT_TRIM_THRESHOLD (128 * 1024)
#endif
/*
M_TRIM_THRESHOLD is the maximum amount of unused top-most memory
to keep before releasing via malloc_trim in free().
Automatic trimming is mainly useful in long-lived programs.
Because trimming via sbrk can be slow on some systems, and can
sometimes be wasteful (in cases where programs immediately
afterward allocate more large chunks) the value should be high
enough so that your overall system performance would improve by
releasing.
The trim threshold and the mmap control parameters (see below)
can be traded off with one another. Trimming and mmapping are
two different ways of releasing unused memory back to the
system. Between these two, it is often possible to keep
system-level demands of a long-lived program down to a bare
minimum. For example, in one test suite of sessions measuring
the XF86 X server on Linux, using a trim threshold of 128K and a
mmap threshold of 192K led to near-minimal long term resource
consumption.
If you are using this malloc in a long-lived program, it should
pay to experiment with these values. As a rough guide, you
might set to a value close to the average size of a process
(program) running on your system. Releasing this much memory
would allow such a process to run in memory. Generally, it's
worth it to tune for trimming rather tham memory mapping when a
program undergoes phases where several large chunks are
allocated and released in ways that can reuse each other's
storage, perhaps mixed with phases where there are no such
chunks at all. And in well-behaved long-lived programs,
controlling release of large blocks via trimming versus mapping
is usually faster.
However, in most programs, these parameters serve mainly as
protection against the system-level effects of carrying around
massive amounts of unneeded memory. Since frequent calls to
sbrk, mmap, and munmap otherwise degrade performance, the default
parameters are set to relatively high values that serve only as
safeguards.
The default trim value is high enough to cause trimming only in
fairly extreme (by current memory consumption standards) cases.
It must be greater than page size to have any useful effect. To
disable trimming completely, you can set to (unsigned long)(-1);
*/
#ifndef DEFAULT_TOP_PAD
#define DEFAULT_TOP_PAD (0)
#endif
/*
M_TOP_PAD is the amount of extra `padding' space to allocate or
retain whenever sbrk is called. It is used in two ways internally:
* When sbrk is called to extend the top of the arena to satisfy
a new malloc request, this much padding is added to the sbrk
request.
* When malloc_trim is called automatically from free(),
it is used as the `pad' argument.
In both cases, the actual amount of padding is rounded
so that the end of the arena is always a system page boundary.
The main reason for using padding is to avoid calling sbrk so
often. Having even a small pad greatly reduces the likelihood
that nearly every malloc request during program start-up (or
after trimming) will invoke sbrk, which needlessly wastes
time.
Automatic rounding-up to page-size units is normally sufficient
to avoid measurable overhead, so the default is 0. However, in
systems where sbrk is relatively slow, it can pay to increase
this value, at the expense of carrying around more memory than
the program needs.
*/
#ifndef DEFAULT_MMAP_THRESHOLD
#define DEFAULT_MMAP_THRESHOLD (128 * 1024)
#endif
/*
M_MMAP_THRESHOLD is the request size threshold for using mmap()
to service a request. Requests of at least this size that cannot
be allocated using already-existing space will be serviced via mmap.
(If enough normal freed space already exists it is used instead.)
Using mmap segregates relatively large chunks of memory so that
they can be individually obtained and released from the host
system. A request serviced through mmap is never reused by any
other request (at least not directly; the system may just so
happen to remap successive requests to the same locations).
Segregating space in this way has the benefit that mmapped space
can ALWAYS be individually released back to the system, which
helps keep the system level memory demands of a long-lived
program low. Mapped memory can never become `locked' between
other chunks, as can happen with normally allocated chunks, which
menas that even trimming via malloc_trim would not release them.
However, it has the disadvantages that:
1. The space cannot be reclaimed, consolidated, and then
used to service later requests, as happens with normal chunks.
2. It can lead to more wastage because of mmap page alignment
requirements
3. It causes malloc performance to be more dependent on host
system memory management support routines which may vary in
implementation quality and may impose arbitrary
limitations. Generally, servicing a request via normal
malloc steps is faster than going through a system's mmap.
All together, these considerations should lead you to use mmap
only for relatively large requests.
*/
#ifndef DEFAULT_MMAP_MAX
#ifdef HAVE_MMAP
#define DEFAULT_MMAP_MAX (64)
#else
#define DEFAULT_MMAP_MAX (0)
#endif
#endif
/*
M_MMAP_MAX is the maximum number of requests to simultaneously
service using mmap. This parameter exists because:
1. Some systems have a limited number of internal tables for
use by mmap.
2. In most systems, overreliance on mmap can degrade overall
performance.
3. If a program allocates many large regions, it is probably
better off using normal sbrk-based allocation routines that
can reclaim and reallocate normal heap memory. Using a
small value allows transition into this mode after the
first few allocations.
Setting to 0 disables all use of mmap. If HAVE_MMAP is not set,
the default value is 0, and attempts to set it to non-zero values
in mallopt will fail.
*/
/*
USE_DL_PREFIX will prefix all public routines with the string 'dl'.
Useful to quickly avoid procedure declaration conflicts and linker
symbol conflicts with existing memory allocation routines.
*/
/* #define USE_DL_PREFIX */
/*
Special defines for linux libc
Except when compiled using these special defines for Linux libc
using weak aliases, this malloc is NOT designed to work in
multithreaded applications. No semaphores or other concurrency
control are provided to ensure that multiple malloc or free calls
don't run at the same time, which could be disasterous. A single
semaphore could be used across malloc, realloc, and free (which is
essentially the effect of the linux weak alias approach). It would
be hard to obtain finer granularity.
*/
#ifdef INTERNAL_LINUX_C_LIB
#if __STD_C
Void_t * __default_morecore_init (ptrdiff_t);
Void_t *(*__morecore)(ptrdiff_t) = __default_morecore_init;
#else
Void_t * __default_morecore_init ();
Void_t *(*__morecore)() = __default_morecore_init;
#endif
#define MORECORE (*__morecore)
#define MORECORE_FAILURE 0
#define MORECORE_CLEARS 1
#else /* INTERNAL_LINUX_C_LIB */
#if __STD_C
extern Void_t* sbrk(ptrdiff_t);
#else
extern Void_t* sbrk();
#endif
#ifndef MORECORE
#define MORECORE sbrk
#endif
#ifndef MORECORE_FAILURE
#define MORECORE_FAILURE -1
#endif
#ifndef MORECORE_CLEARS
#define MORECORE_CLEARS 1
#endif
#endif /* INTERNAL_LINUX_C_LIB */
#if defined(INTERNAL_LINUX_C_LIB) && defined(__ELF__)
#define cALLOc __libc_calloc
#define fREe __libc_free
#define mALLOc __libc_malloc
#define mEMALIGn __libc_memalign
#define rEALLOc __libc_realloc
#define vALLOc __libc_valloc
#define pvALLOc __libc_pvalloc
#define mALLINFo __libc_mallinfo
#define mALLOPt __libc_mallopt
#pragma weak calloc = __libc_calloc
#pragma weak free = __libc_free
#pragma weak cfree = __libc_free
#pragma weak malloc = __libc_malloc
#pragma weak memalign = __libc_memalign
#pragma weak realloc = __libc_realloc
#pragma weak valloc = __libc_valloc
#pragma weak pvalloc = __libc_pvalloc
#pragma weak mallinfo = __libc_mallinfo
#pragma weak mallopt = __libc_mallopt
#else
#ifdef USE_DL_PREFIX
#define cALLOc dlcalloc
#define fREe dlfree
#define mALLOc dlmalloc
#define mEMALIGn dlmemalign
#define rEALLOc dlrealloc
#define vALLOc dlvalloc
#define pvALLOc dlpvalloc
#define mALLINFo dlmallinfo
#define mALLOPt dlmallopt
#else /* USE_DL_PREFIX */
#define cALLOc calloc
#define fREe free
#define mALLOc malloc
#define mEMALIGn memalign
#define rEALLOc realloc
#define vALLOc valloc
#define pvALLOc pvalloc
#define mALLINFo mallinfo
#define mALLOPt mallopt
#endif /* USE_DL_PREFIX */
#endif
/* Public routines */
#if __STD_C
Void_t* mALLOc(size_t);
void fREe(Void_t*);
Void_t* rEALLOc(Void_t*, size_t);
Void_t* mEMALIGn(size_t, size_t);
Void_t* vALLOc(size_t);
Void_t* pvALLOc(size_t);
Void_t* cALLOc(size_t, size_t);
void cfree(Void_t*);
int malloc_trim(size_t);
size_t malloc_usable_size(Void_t*);
void malloc_stats(void);
int mALLOPt(int, int);
struct mallinfo mALLINFo(void);
#else
Void_t* mALLOc();
void fREe();
Void_t* rEALLOc();
Void_t* mEMALIGn();
Void_t* vALLOc();
Void_t* pvALLOc();
Void_t* cALLOc();
void cfree();
int malloc_trim();
size_t malloc_usable_size();
void malloc_stats();
int mALLOPt();
struct mallinfo mALLINFo();
#endif
/*
* Begin and End of memory area for malloc(), and current "brk"
*/
extern ulong mem_malloc_start;
extern ulong mem_malloc_end;
extern ulong mem_malloc_brk;
void mem_malloc_init(ulong start, ulong size);
#ifdef __cplusplus
}; /* end of extern "C" */
#endif
#endif /* __MALLOC_H__ */
|
lxl1140989/dmsdk
|
uboot/u-boot-dm6291/include/malloc.h
|
C
|
gpl-2.0
| 33,862
|
#include "layout.h"
#include "../vgmstream.h"
/* set up for the block at the given offset */
void filp_block_update(off_t block_offset, VGMSTREAM * vgmstream) {
int i;
vgmstream->current_block_offset = block_offset;
vgmstream->current_block_size = read_32bitLE(
vgmstream->current_block_offset+0x18,
vgmstream->ch[0].streamfile)-0x800;
vgmstream->next_block_offset = vgmstream->current_block_offset+vgmstream->current_block_size+0x800;
vgmstream->current_block_size/=vgmstream->channels;
for (i=0;i<vgmstream->channels;i++) {
vgmstream->ch[i].offset = vgmstream->current_block_offset+0x800+(vgmstream->current_block_size*i);
}
}
|
xbmc/atv2
|
xbmc/cores/paplayer/vgmstream/src/layout/filp_blocked.c
|
C
|
gpl-2.0
| 662
|
/*
*
* Includes for cdc-acm.c
*
* Mainly take from usbnet's cdc-ether part
*
*/
/*
* CMSPAR, some architectures can't have space and mark parity.
*/
#ifndef CMSPAR
#define CMSPAR 0
#endif
/*
* Major and minor numbers.
*/
#define ACM_TTY_MAJOR 166
#define ACM_TTY_MINORS 256
/*
* Requests.
*/
#define USB_RT_ACM (USB_TYPE_CLASS | USB_RECIP_INTERFACE)
/*
* Output control lines.
*/
#define ACM_CTRL_DTR 0x01
#define ACM_CTRL_RTS 0x02
/*
* Input control lines and line errors.
*/
#define ACM_CTRL_DCD 0x01
#define ACM_CTRL_DSR 0x02
#define ACM_CTRL_BRK 0x04
#define ACM_CTRL_RI 0x08
#define ACM_CTRL_FRAMING 0x10
#define ACM_CTRL_PARITY 0x20
#define ACM_CTRL_OVERRUN 0x40
/*
* Internal driver structures.
*/
/*
* The only reason to have several buffers is to accommodate assumptions
* in line disciplines. They ask for empty space amount, receive our URB size,
* and proceed to issue several 1-character writes, assuming they will fit.
* The very first write takes a complete URB. Fortunately, this only happens
* when processing onlcr, so we only need 2 buffers. These values must be
* powers of 2.
*/
#define ACM_NW 16
#define ACM_NR 16
struct acm_wb {
unsigned char *buf;
dma_addr_t dmah;
int len;
int use;
struct urb *urb;
struct acm *instance;
};
struct acm_rb {
int size;
unsigned char *base;
dma_addr_t dma;
int index;
struct acm *instance;
};
struct acm {
struct usb_device *dev; /* the corresponding usb device */
struct usb_interface *control; /* control interface */
struct usb_interface *data; /* data interface */
unsigned in, out; /* i/o pipes */
struct tty_port port; /* our tty port data */
struct urb *ctrlurb; /* urbs */
u8 *ctrl_buffer; /* buffers of urbs */
dma_addr_t ctrl_dma; /* dma handles of buffers */
u8 *country_codes; /* country codes from device */
unsigned int country_code_size; /* size of this buffer */
unsigned int country_rel_date; /* release date of version */
struct acm_wb wb[ACM_NW];
unsigned long read_urbs_free;
struct urb *read_urbs[ACM_NR];
struct acm_rb read_buffers[ACM_NR];
struct acm_wb *putbuffer; /* for acm_tty_put_char() */
int rx_buflimit;
spinlock_t read_lock;
u8 *notification_buffer; /* to reassemble fragmented notifications */
unsigned int nb_index;
unsigned int nb_size;
int transmitting;
spinlock_t write_lock;
struct mutex mutex;
bool disconnected;
unsigned long flags;
# define EVENT_TTY_WAKEUP 0
# define EVENT_RX_STALL 1
struct usb_cdc_line_coding line; /* bits, stop, parity */
struct work_struct work; /* work queue entry for line discipline waking up */
unsigned int ctrlin; /* input control lines (DCD, DSR, RI, break, overruns) */
unsigned int ctrlout; /* output control lines (DTR, RTS) */
struct async_icount iocount; /* counters for control line changes */
struct async_icount oldcount; /* for comparison of counter */
wait_queue_head_t wioctl; /* for ioctl */
unsigned int writesize; /* max packet size for the output bulk endpoint */
unsigned int readsize,ctrlsize; /* buffer sizes for freeing */
unsigned int minor; /* acm minor number */
unsigned char clocal; /* termios CLOCAL */
unsigned int ctrl_caps; /* control capabilities from the class specific header */
unsigned int susp_count; /* number of suspended interfaces */
unsigned int combined_interfaces:1; /* control and data collapsed */
unsigned int throttled:1; /* actually throttled */
unsigned int throttle_req:1; /* throttle requested */
u8 bInterval;
struct usb_anchor delayed; /* writes queued for a device about to be woken */
unsigned long quirks;
};
#define CDC_DATA_INTERFACE_TYPE 0x0a
/* constants describing various quirks and errors */
#define NO_UNION_NORMAL BIT(0)
#define SINGLE_RX_URB BIT(1)
#define NO_CAP_LINE BIT(2)
#define NO_DATA_INTERFACE BIT(4)
#define IGNORE_DEVICE BIT(5)
#define QUIRK_CONTROL_LINE_STATE BIT(6)
#define CLEAR_HALT_CONDITIONS BIT(7)
#define SEND_ZERO_PACKET BIT(8)
|
mkvdv/au-linux-kernel-autumn-2017
|
linux/drivers/usb/class/cdc-acm.h
|
C
|
gpl-3.0
| 4,044
|
/* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 only,
* as published by the Free Software Foundation.
*
* 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 version 2 for more details (a copy is included
* in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see http://www.gnu.org/licenses
*
* Please visit http://www.xyratex.com/contact if you need additional
* information or have any questions.
*
* GPL HEADER END
*/
/*
* Copyright 2012 Xyratex Technology Limited
*/
/*
* This is crypto api shash wrappers to zlib_adler32.
*/
#include <linux/module.h>
#include <linux/zutil.h>
#include <crypto/internal/hash.h>
#define CHKSUM_BLOCK_SIZE 1
#define CHKSUM_DIGEST_SIZE 4
static u32 __adler32(u32 cksum, unsigned char const *p, size_t len)
{
return zlib_adler32(cksum, p, len);
}
static int adler32_cra_init(struct crypto_tfm *tfm)
{
u32 *key = crypto_tfm_ctx(tfm);
*key = 1;
return 0;
}
static int adler32_setkey(struct crypto_shash *hash, const u8 *key,
unsigned int keylen)
{
u32 *mctx = crypto_shash_ctx(hash);
if (keylen != sizeof(u32)) {
crypto_shash_set_flags(hash, CRYPTO_TFM_RES_BAD_KEY_LEN);
return -EINVAL;
}
*mctx = *(u32 *)key;
return 0;
}
static int adler32_init(struct shash_desc *desc)
{
u32 *mctx = crypto_shash_ctx(desc->tfm);
u32 *cksump = shash_desc_ctx(desc);
*cksump = *mctx;
return 0;
}
static int adler32_update(struct shash_desc *desc, const u8 *data,
unsigned int len)
{
u32 *cksump = shash_desc_ctx(desc);
*cksump = __adler32(*cksump, data, len);
return 0;
}
static int __adler32_finup(u32 *cksump, const u8 *data, unsigned int len,
u8 *out)
{
*(u32 *)out = __adler32(*cksump, data, len);
return 0;
}
static int adler32_finup(struct shash_desc *desc, const u8 *data,
unsigned int len, u8 *out)
{
return __adler32_finup(shash_desc_ctx(desc), data, len, out);
}
static int adler32_final(struct shash_desc *desc, u8 *out)
{
u32 *cksump = shash_desc_ctx(desc);
*(u32 *)out = *cksump;
return 0;
}
static int adler32_digest(struct shash_desc *desc, const u8 *data,
unsigned int len, u8 *out)
{
return __adler32_finup(crypto_shash_ctx(desc->tfm), data, len,
out);
}
static struct shash_alg alg = {
.setkey = adler32_setkey,
.init = adler32_init,
.update = adler32_update,
.final = adler32_final,
.finup = adler32_finup,
.digest = adler32_digest,
.descsize = sizeof(u32),
.digestsize = CHKSUM_DIGEST_SIZE,
.base = {
.cra_name = "adler32",
.cra_driver_name = "adler32-zlib",
.cra_priority = 100,
.cra_blocksize = CHKSUM_BLOCK_SIZE,
.cra_ctxsize = sizeof(u32),
.cra_module = THIS_MODULE,
.cra_init = adler32_cra_init,
}
};
int cfs_crypto_adler32_register(void)
{
return crypto_register_shash(&alg);
}
EXPORT_SYMBOL(cfs_crypto_adler32_register);
void cfs_crypto_adler32_unregister(void)
{
crypto_unregister_shash(&alg);
}
EXPORT_SYMBOL(cfs_crypto_adler32_unregister);
|
ziqiaozhou/cachebar
|
source/drivers/staging/lustre/lustre/libcfs/linux/linux-crypto-adler.c
|
C
|
gpl-2.0
| 3,391
|
/*
jqGrid 4.9.1 - free jqGrid: https://github.com/free-jqgrid/jqGrid
Copyright (c) 2008-2014, Tony Tomov, tony@trirand.com
Copyright (c) 2014-2015, Oleg Kiriljuk, oleg.kiriljuk@ok-soft-gmbh.com
Dual licensed under the MIT and GPL licenses
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl-2.0.html
Date: 2015-07-23
*/
(function(a){var p={name:"English (United States)",nameEnglish:"English (United States)",isRTL:!1,defaults:{recordtext:"View {0} - {1} of {2}",emptyrecords:"No records to view",loadtext:"Loading...",pgtext:"Page {0} of {1}",pgfirst:"First Page",pglast:"Last Page",pgnext:"Next Page",pgprev:"Previous Page",pgrecs:"Records per Page",showhide:"Toggle Expand Collapse Grid",savetext:"Saving..."},search:{caption:"Search...",Find:"Find",Reset:"Reset",odata:[{oper:"eq",text:"equal"},{oper:"ne",text:"not equal"},
{oper:"lt",text:"less"},{oper:"le",text:"less or equal"},{oper:"gt",text:"greater"},{oper:"ge",text:"greater or equal"},{oper:"bw",text:"begins with"},{oper:"bn",text:"does not begin with"},{oper:"in",text:"is in"},{oper:"ni",text:"is not in"},{oper:"ew",text:"ends with"},{oper:"en",text:"does not end with"},{oper:"cn",text:"contains"},{oper:"nc",text:"does not contain"},{oper:"nu",text:"is null"},{oper:"nn",text:"is not null"}],groupOps:[{op:"AND",text:"all"},{op:"OR",text:"any"}],operandTitle:"Click to select search operation.",
resetTitle:"Reset Search Value"},edit:{addCaption:"Add Record",editCaption:"Edit Record",bSubmit:"Submit",bCancel:"Cancel",bClose:"Close",saveData:"Data has been changed! Save changes?",bYes:"Yes",bNo:"No",bExit:"Cancel",msg:{required:"Field is required",number:"Please, enter valid number",minValue:"value must be greater than or equal to ",maxValue:"value must be less than or equal to",email:"is not a valid e-mail",integer:"Please, enter valid integer value",date:"Please, enter valid date value",
url:"is not a valid URL. Prefix required ('http://' or 'https://')",nodefined:" is not defined!",novalue:" return value is required!",customarray:"Custom function should return array!",customfcheck:"Custom function should be present in case of custom checking!"}},view:{caption:"View Record",bClose:"Close"},del:{caption:"Delete",msg:"Delete selected record(s)?",bSubmit:"Delete",bCancel:"Cancel"},nav:{edittext:"",edittitle:"Edit selected row",addtext:"",addtitle:"Add new row",deltext:"",deltitle:"Delete selected row",
searchtext:"",searchtitle:"Find records",refreshtext:"",refreshtitle:"Reload Grid",alertcap:"Warning",alerttext:"Please, select row",viewtext:"",viewtitle:"View selected row"},col:{caption:"Select columns",bSubmit:"Ok",bCancel:"Cancel"},errors:{errcap:"Error",nourl:"No url is set",norecords:"No records to process",model:"Length of colNames <> colModel!"},formatter:{integer:{thousandsSeparator:",",defaultValue:"0"},number:{decimalSeparator:".",thousandsSeparator:",",decimalPlaces:2,defaultValue:"0.00"},
currency:{decimalSeparator:".",thousandsSeparator:",",decimalPlaces:2,prefix:"",suffix:"",defaultValue:"0.00"},date:{dayNames:"Sun Mon Tue Wed Thr Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" "),AmPm:["am","pm","AM","PM"],S:function(a){var b=["st","nd","rd","th"];return 11>a||13<a?b[Math.min((a-1)%10,3)]:"th"},srcformat:"Y-m-d",
newformat:"n/j/Y",masks:{ShortDate:"n/j/Y",LongDate:"l, F d, Y",FullDateTime:"l, F d, Y g:i:s A",MonthDay:"F d",ShortTime:"g:i A",LongTime:"g:i:s A",YearMonth:"F, Y"}}}};a.jgrid=a.jgrid||{};var r=a.jgrid;r.locales=r.locales||{};var u=r.locales;if(null==r.defaults||a.isEmptyObject(u)||void 0===u["en-US"])void 0===u["en-US"]&&a.extend(!0,r,{locales:{"en-US":p}}),r.defaults=r.defaults||{},void 0===r.defaults.locale&&(r.defaults.locale="en-US");r.defaults=r.defaults||{};var n=r.defaults;a.extend(!0,r,
{version:"4.8.0",productName:"free jqGrid",defaults:{},search:{},edit:{},view:{},del:{},nav:{},col:{},errors:{},formatter:{unused:""},icons:{jQueryUI:{common:"ui-icon",pager:{first:"ui-icon-seek-first",prev:"ui-icon-seek-prev",next:"ui-icon-seek-next",last:"ui-icon-seek-end"},sort:{asc:"ui-icon-triangle-1-n",desc:"ui-icon-triangle-1-s"},gridMinimize:{visible:"ui-icon-circle-triangle-n",hidden:"ui-icon-circle-triangle-s"},nav:{edit:"ui-icon-pencil",add:"ui-icon-plus",del:"ui-icon-trash",search:"ui-icon-search",
refresh:"ui-icon-refresh",view:"ui-icon-document",save:"ui-icon-disk",cancel:"ui-icon-cancel",newbutton:"ui-icon-newwin"},actions:{edit:"ui-icon-pencil",del:"ui-icon-trash",save:"ui-icon-disk",cancel:"ui-icon-cancel"},form:{close:"ui-icon-closethick",prev:"ui-icon-triangle-1-w",next:"ui-icon-triangle-1-e",save:"ui-icon-disk",undo:"ui-icon-close",del:"ui-icon-scissors",cancel:"ui-icon-cancel",resizableLtr:"ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se"},search:{search:"ui-icon-search",reset:"ui-icon-arrowreturnthick-1-w",
query:"ui-icon-comment"},subgrid:{plus:"ui-icon-plus",minus:"ui-icon-minus",openLtr:"ui-icon-carat-1-sw",openRtl:"ui-icon-carat-1-se"},grouping:{plus:"ui-icon-circlesmall-plus",minus:"ui-icon-circlesmall-minus"},treeGrid:{minus:"ui-icon-triangle-1-s",leaf:"ui-icon-radio-off",plusLtr:"ui-icon-triangle-1-e",plusRtl:"ui-icon-triangle-1-w"}},fontAwesome:{common:"fa",pager:{common:"fa-fw",first:"fa-step-backward",prev:"fa-backward",next:"fa-forward",last:"fa-step-forward"},sort:{common:"fa-lg",asc:"fa-sort-asc",
desc:"fa-sort-desc"},gridMinimize:{visible:"fa-chevron-circle-up",hidden:"fa-chevron-circle-down"},nav:{common:"fa-lg fa-fw",edit:"fa-pencil",add:"fa-plus",del:"fa-trash-o",search:"fa-search",refresh:"fa-refresh",view:"fa-file-o",save:"fa-floppy-o",cancel:"fa-ban",newbutton:"fa-external-link"},actions:{common:"ui-state-default fa-fw",edit:"fa-pencil",del:"fa-trash-o",save:"fa-floppy-o",cancel:"fa-ban"},form:{close:"fa-times",prev:"fa-caret-left",next:"fa-caret-right",save:"fa-floppy-o",undo:"fa-undo",
del:"fa-trash-o",cancel:"fa-ban",resizableLtr:"ui-resizable-se ui-state-default fa fa-rss fa-rotate-270"},search:{search:"fa-search",reset:"fa-undo",query:"fa-comments-o"},subgrid:{common:"ui-state-default fa-fw",plus:"fa-plus",minus:"fa-minus",openLtr:"fa-reply fa-rotate-180",openRtl:"fa-share fa-rotate-180"},grouping:{common:"fa-fw",plus:"fa-plus-square-o",minus:"fa-minus-square-o"},treeGrid:{common:"fa-fw",minus:"fa-lg fa-sort-desc",leaf:"fa-dot-circle-o",plusLtr:"fa-lg fa-caret-right",plusRtl:"fa-lg fa-caret-left"}}},
guiStyles:{jQueryUI:{gBox:"ui-widget ui-widget-content ui-corner-all",overlay:"ui-widget-overlay",loading:"ui-state-default ui-state-active",hDiv:"ui-state-default ui-corner-top",hTable:"",colHeaders:"ui-state-default",states:{select:"ui-state-highlight",disabled:"ui-state-disabled ui-jqgrid-disablePointerEvents",hover:"ui-state-hover",error:"ui-state-error",active:"ui-state-active",textOfClickable:"ui-state-default"},dialog:{header:"ui-widget-header ui-dialog-titlebar ui-corner-all ui-helper-clearfix",
window:"ui-widget ui-widget-content ui-corner-all ui-front",content:"ui-widget-content",hr:"ui-widget-content",fmButton:"ui-state-default",dataField:"ui-widget-content ui-corner-all",viewLabel:"ui-widget-content",viewData:"ui-widget-content",leftCorner:"ui-corner-left",rightCorner:"ui-corner-right",defaultCorner:"ui-corner-all"},filterToolbar:{dataField:"ui-widget-content"},subgrid:{thSubgrid:"ui-state-default test",rowSubTable:"ui-widget-content",row:"ui-widget-content",tdStart:"",tdWithIcon:"ui-widget-content",
tdData:"ui-widget-content"},grid:"",gridRow:"ui-widget-content",rowNum:"ui-state-default",gridFooter:"",rowFooter:"ui-widget-content",gridTitle:"ui-widget-header ui-corner-top",titleButton:"ui-corner-all",toolbarUpper:"ui-state-default",toolbarBottom:"ui-state-default",pager:"ui-state-default",pagerButton:"ui-corner-all",pagerInput:"ui-widget-content",pagerSelect:"ui-widget-content",top:"ui-corner-top",bottom:"ui-corner-bottom",resizer:"ui-widget-header"}},htmlDecode:function(a){return a&&(" "===
a||" "===a||1===a.length&&160===a.charCodeAt(0))?"":a?String(a).replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&"):a},htmlEncode:function(a){return a?String(a).replace(/&/g,"&").replace(/\"/g,""").replace(/</g,"<").replace(/>/g,">"):a},clearArray:function(a){for(;0<a.length;)a.pop()},format:function(b){var c=a.makeArray(arguments).slice(1);null==b&&(b="");return b.replace(/\{(\d+)\}/g,function(a,b){return c[b]})},template:function(b){var c=a.makeArray(arguments).slice(1),
d,v=c.length;null==b&&(b="");return b.replace(/\{([\w\-]+)(?:\:([\w\.]*)(?:\((\.*?)?\))?)?\}/g,function(b,B){var e,l;if(!isNaN(parseInt(B,10)))return c[parseInt(B,10)];for(d=0;d<v;d++)if(a.isArray(c[d]))for(e=c[d],l=e.length;l--;)if(B===e[l].nm)return e[l].v})},msie:"Microsoft Internet Explorer"===navigator.appName,msiever:function(){var a=-1,b=/(MSIE) ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent);null!=b&&3===b.length&&(a=parseFloat(b[2]||-1));return a},fixMaxHeightOfDiv:function(a){return"Microsoft Internet Explorer"===
navigator.appName?Math.min(a,1533917):null!=/(Firefox)/.exec(navigator.userAgent)?Math.min(a,17895696):a},getCellIndex:function(b){b=a(b);if(b.is("tr"))return-1;b=(b.is("td")||b.is("th")?b:b.closest("td,th"))[0];return null==b?-1:r.msie?a.inArray(b,b.parentNode.cells):b.cellIndex},stripHtml:function(a){return(a=String(a))?(a=a.replace(/<("[^"]*"|'[^']*'|[^'">])*>/gi,""))&&" "!==a&&" "!==a?a.replace(/\"/g,"'"):"":a},stripPref:function(b,c){var d=a.type(b);if("string"===d||"number"===d)b=
String(b),c=""!==b?String(c).replace(String(b),""):c;return c},parse:function(b){"while(1);"===b.substr(0,9)&&(b=b.substr(9));"/*"===b.substr(0,2)&&(b=b.substr(2,b.length-4));b||(b="{}");return!0===r.useJSON&&"object"===typeof JSON&&a.isFunction(JSON.parse)?JSON.parse(b):eval("("+b+")")},getRes:function(a,b){var c=b.split("."),d=c.length,e;if(null!=a){for(e=0;e<d;e++){if(!c[e])return null;a=a[c[e]];if(void 0===a)break;if("string"===typeof a)break}return a}},parseDate:function(b,c,d,v){var e,l,f,g=
0,h=0;e="string"===typeof c?c.match(/^\/Date\((([\-+])?[0-9]+)(([\-+])([0-9]{2})([0-9]{2}))?\)\/$/):null;var m=function(a,b){a=String(a);for(b=parseInt(b,10)||2;a.length<b;)a="0"+a;return a},g={m:1,d:1,y:1970,h:0,i:0,s:0,u:0},t=function(a,b){0===a?12===b&&(b=0):12!==b&&(b+=12);return b};v=a.extend(!0,{},(r.formatter||{}).date,null!=this.p?r.getRes(u[this.p.locale],"formatter.date")||{}:{},v||{});void 0===v.parseRe&&(v.parseRe=/[#%\\\/:_;.,\t\s\-]/);v.masks.hasOwnProperty(b)&&(b=v.masks[b]);if(c&&
null!=c)if(isNaN(c)||"u"!==String(b).toLowerCase())if(c.constructor===Date)g=c;else if(null!==e)g=new Date(parseInt(e[1],10)),e[3]&&(h=60*Number(e[5])+Number(e[6]),h*="-"===e[4]?1:-1,h-=g.getTimezoneOffset(),g.setTime(Number(Number(g)+6E4*h)));else{"ISO8601Long"===v.srcformat&&"Z"===c.charAt(c.length-1)&&(h-=(new Date).getTimezoneOffset());c=String(c).replace(/\T/g,"#").replace(/\t/,"%").split(v.parseRe);b=b.replace(/\T/g,"#").replace(/\t/,"%").split(v.parseRe);l=0;for(f=Math.min(b.length,c.length);l<
f;l++){switch(b[l]){case "M":e=a.inArray(c[l],v.monthNames);-1!==e&&12>e&&(c[l]=e+1,g.m=c[l]);break;case "F":e=a.inArray(c[l],v.monthNames,12);-1!==e&&11<e&&(c[l]=e+1-12,g.m=c[l]);break;case "n":g.m=parseInt(c[l],10);break;case "j":g.d=parseInt(c[l],10);break;case "g":g.h=parseInt(c[l],10);break;case "a":e=a.inArray(c[l],v.AmPm);-1!==e&&2>e&&c[l]===v.AmPm[e]&&(c[l]=e,g.h=t(c[l],g.h));break;case "A":e=a.inArray(c[l],v.AmPm),-1!==e&&1<e&&c[l]===v.AmPm[e]&&(c[l]=e-2,g.h=t(c[l],g.h))}void 0!==c[l]&&(g[b[l].toLowerCase()]=
parseInt(c[l],10))}g.f&&(g.m=g.f);if(0===g.m&&0===g.y&&0===g.d)return" ";g.m=parseInt(g.m,10)-1;b=g.y;70<=b&&99>=b?g.y=1900+g.y:0<=b&&69>=b&&(g.y=2E3+g.y);g=new Date(g.y,g.m,g.d,g.h,g.i,g.s,g.u);0<h&&g.setTime(Number(Number(g)+6E4*h))}else g=new Date(1E3*parseFloat(c));else g=new Date(g.y,g.m,g.d,g.h,g.i,g.s,g.u);v.userLocalTime&&0===h&&(h-=(new Date).getTimezoneOffset(),0<h&&g.setTime(Number(Number(g)+6E4*h)));if(void 0===d)return g;v.masks.hasOwnProperty(d)?d=v.masks[d]:d||(d="Y-m-d");h=g.getHours();
b=g.getMinutes();c=g.getDate();t=g.getMonth()+1;e=g.getTimezoneOffset();l=g.getSeconds();f=g.getMilliseconds();var q=g.getDay(),n=g.getFullYear(),A=(q+6)%7+1,p=(new Date(n,t-1,c)-new Date(n,0,1))/864E5,w=5>A?Math.floor((p+A-1)/7)+1:Math.floor((p+A-1)/7)||(4>((new Date(n-1,0,1)).getDay()+6)%7?53:52),x={d:m(c),D:v.dayNames[q],j:c,l:v.dayNames[q+7],N:A,S:v.S(c),w:q,z:p,W:w,F:v.monthNames[t-1+12],m:m(t),M:v.monthNames[t-1],n:t,t:"?",L:"?",o:"?",Y:n,y:String(n).substring(2),a:12>h?v.AmPm[0]:v.AmPm[1],
A:12>h?v.AmPm[2]:v.AmPm[3],B:"?",g:h%12||12,G:h,h:m(h%12||12),H:m(h),i:m(b),s:m(l),u:f,e:"?",I:"?",O:(0<e?"-":"+")+m(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4),P:"?",T:(String(g).match(/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[\-+]\d{4})?)\b/g)||[""]).pop().replace(/[^\-+\dA-Z]/g,""),Z:"?",c:"?",r:"?",U:Math.floor(g/1E3)};return d.replace(/\\.|[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g,function(a){return x.hasOwnProperty(a)?
x[a]:a.substring(1)})},jqID:function(a){return String(a).replace(/[!"#$%&'()*+,.\/:; <=>?@\[\\\]\^`{|}~]/g,"\\$&")},getGridComponentId:function(a){if(null==this.p||!this.p.id)return"";var b=this.p.id;switch(a){case 21:return b;case 0:return"gbox_"+b;case 8:return"gview_"+b;case 3:return"alertmod_"+b;case 43:return"rs_m"+b;case 45:return"cb_"+b;case 46:return"sopt_menu";default:return""}},getGridComponentIdSelector:function(a){return(a=r.getGridComponentId.call(this,a))?"#"+r.jqID(a):""},isHTMLElement:function(a){return"object"===
typeof HTMLElement||"function"===typeof HTMLElement?a instanceof HTMLElement:null!=a&&"object"===typeof a&&1===a.nodeType&&"string"===typeof a.nodeName},getGridComponent:function(b,c){var d;if(c instanceof a||0<c.length)d=c[0];else if(r.isHTMLElement(c))d=c,c=a(d);else return a();switch(b){case 21:return c.hasClass("ui-jqgrid-bdiv")?c.find(">div>.ui-jqgrid-btable"):a();case 14:return c.hasClass("ui-jqgrid-hdiv")?c.find(">div>.ui-jqgrid-htable"):a();case 27:return c.hasClass("ui-jqgrid-sdiv")?c.find(">div>.ui-jqgrid-ftable"):
a();case 31:return c.hasClass("ui-jqgrid-hdiv")?c.children(".ui-jqgrid-htable"):a();case 36:return c.hasClass("ui-jqgrid-sdiv")?c.children(".ui-jqgrid-ftable"):a();case 18:return c.hasClass("ui-jqgrid-btable")&&null!=d.grid?a(d.grid.bDiv):a();case 12:return c.hasClass("ui-jqgrid-btable")&&null!=d.grid?a(d.grid.hDiv):a();case 25:return c.hasClass("ui-jqgrid-btable")&&null!=d.grid?a(d.grid.sDiv):a();default:return a()}},fixScrollOffsetAndhBoxPadding:function(){var b=this.grid;if(b){var c=this.p,d=b.bDiv,
e=function(b){var e=a(b).children("div").first();e.css(e.hasClass("ui-jqgrid-hbox-rtl")?"padding-left":"padding-right",c.scrollOffset);b.scrollLeft=d.scrollLeft};0<a(d).width()&&(c.scrollOffset=d.offsetWidth-d.clientWidth,e(b.hDiv),b.sDiv&&e(b.sDiv))}},mergeCssClasses:function(){var b=a.makeArray(arguments),c={},d,e,g,l,f=[];for(d=0;d<b.length;d++)for(g=String(b[d]).split(" "),e=0;e<g.length;e++)l=g[e],""===l||c.hasOwnProperty(l)||(c[l]=!0,f.push(l));return f.join(" ")},hasOneFromClasses:function(b,
c){var d=a(b),e=c.split(" "),g,l=e.length;for(g=0;g<l;g++)if(d.hasClass(e[g]))return!0;return!1},detectRowEditing:function(b){var c,d,e,g=this.rows,l=this.p,f=a.isFunction;if(!this.grid||null==g||null==l||void 0===l.savedRow||0===l.savedRow.length)return null;for(c=0;c<l.savedRow.length;c++)if(d=l.savedRow[c],"number"===typeof d.id&&"number"===typeof d.ic&&void 0!==d.name&&void 0!==d.v&&null!=g[d.id]&&g[d.id].id===b&&f(a.fn.jqGrid.restoreCell)){if(e=g[d.id],null!=e&&e.id===b)return{mode:"cellEditing",
savedRow:d}}else if(d.id===b&&f(a.fn.jqGrid.restoreRow))return{mode:"inlineEditing",savedRow:d};return null},getCell:function(b,c){var d=this.grid,e=this.p;if(!d||!e)return a();if(b instanceof a||0<b.length)b=b[0];if("object"!==typeof HTMLTableRowElement&&"function"!==typeof HTMLTableRowElement||!(b instanceof HTMLTableRowElement)||null==b.cells)return a();e=a(b.cells[c]);d=d.fbRows;return null!=d&&c<d[0].cells.length?e.add(d[b.rowIndex].cells[c]):e},getDataFieldOfCell:function(a,b){var c=this.p,
d=r.getCell.call(this,a,b);c.treeGrid&&0<d.children("div.tree-wrap").length&&(d=d.children("span.cell-wrapperleaf,span.cell-wrapper"));return c.colModel[b].autoResizable?d.children("span."+c.autoResizing.wrapperClassName):d},enumEditableCells:function(b,c,d){var e=this.grid,g=this.rows,l=this.p;if(null==e||null==g||null==l||null==b||null==b.rowIndex||!b.id||!a.isFunction(d))return null;var f,g=l.colModel,h=g.length,m,t,q=b.rowIndex,n,A,p;f=e.fbRows;var w=(e=null!=f)?f[q]:null;e&&(b=this.rows[q]);
for(f=0;f<h&&(m=g[f],t=m.name,"cb"===t||"subgrid"===t||"rn"===t||(e&&!m.frozen&&(e=!1),n=(e?w:b).cells[f],A=a(n),A.hasClass("not-editable-cell")||(p=A.width(),!0===l.treeGrid&&t===l.ExpandColumn?(p-=A.children("div.tree-wrap").outerWidth(),A=A.children("span.cell-wrapperleaf,span.cell-wrapper").first()):p=0,t={rowid:b.id,iCol:f,iRow:q,cmName:t,cm:m,mode:c,td:n,tr:b,trFrozen:w,dataElement:A[0],dataWidth:p},m.edittype||(m.edittype="text"),m=m.editable,m=a.isFunction(m)?m.call(this,t):m,!0!==m||!1!==
d.call(this,t))));f++);},getEditedValue:function(b,c,d){var e,g,l=d?"text":"val",f=c.formatoptions||{};d=c.editoptions||{};var h=d.custom_value,m="[name="+r.jqID(c.name)+"]",t=a(this);switch(c.edittype){case "checkbox":e=["Yes","No"];"string"===typeof d.value&&(e=d.value.split(":"));e=b.find("input[type=checkbox]").is(":checked")?e[0]:e[1];break;case "text":case "password":case "textarea":case "button":b=b.find("input"+m+",textarea"+m);e=b.val();"date"===b[this.p.propOrAttr]("type")&&3===String(e).split("-").length&&
(b=f.newformat||t.jqGrid("getGridRes","formatter.date.newformat"),e=r.parseDate.call(this,"Y-m-d",e,b));break;case "select":b=b.find("select option:selected");d.multiple?(g=[],b.each(function(){g.push(a(this)[l]())}),e=g.join(",")):e=b[l]();break;case "custom":try{if(a.isFunction(h)){if(e=h.call(this,b.find(".customelement"),"get"),void 0===e)throw"e2";}else throw"e1";}catch(q){b=r.info_dialog,d=function(a){t.jqGrid("getGridRes",a)},c=d("errors.errcap"),f=d("edit.bClose"),"e1"===q&&b.call(this,c,
"function 'custom_value' "+d("edit.msg.nodefined"),f),"e2"===q?b.call(this,c,"function 'custom_value' "+d("edit.msg.novalue"),f):b.call(this,c,q.message,f)}break;default:e=b.find("*"+m).text()}return e},guid:1,uidPref:"jqg",randId:function(a){return(a||r.uidPref)+r.guid++},getAccessor:function(b,c){var d,e,g=[],l;if(a.isFunction(c))return c(b);d=b[c];if(void 0===d)try{if("string"===typeof c&&(g=c.split(".")),l=g.length)for(d=b;d&&l--;)e=g.shift(),d=d[e]}catch(f){}return d},getXmlData:function(b,c,
d){var e="string"===typeof c?c.match(/^(.*)\[(\w+)\]$/):null;if(a.isFunction(c))return c(b);if(e&&e[2])return e[1]?a(e[1],b).attr(e[2]):a(b).attr(e[2]);void 0===b&&alert("expr");b=a(b).find(c);return d?b:0<b.length?a(b).text():void 0},cellWidth:function(){var b=a("<div class='ui-jqgrid' style='left:10000px'><div class='ui-jqgrid-view'><div class='ui-jqgrid-bdiv'><table class='ui-jqgrid-btable' style='width:5px;'><tr class='jqgrow'><td style='width:5px;display:block;'></td></tr></table></div></div></div>"),
c=b.appendTo("body").find("td").width();b.remove();return.1<Math.abs(c-5)},isCellClassHidden:function(b){b=a("<div class='ui-jqgrid' style='left:10000px'><div class='ui-jqgrid-view'><div class='ui-jqgrid-bdiv'><table class='ui-jqgrid-btable' style='width:5px;'><tr class='jqgrow'><td style='width:5px;' class='"+(b||"")+"'></td></tr></table></div></div></div>");var c=b.appendTo("body").find("td").is(":hidden");b.remove();return c},cell_width:!0,ajaxOptions:{},from:function(b){var c=this;return new function(b,
d){var e=this,g=b,l=!0,f=!1,h=d,m=/[\$,%]/g,B=null,t=null,q=0,n=!1,A="",p=[],w=Object.prototype.toString,C=!0;if("object"===typeof b&&b.push)0<b.length&&(C="object"!==typeof b[0]?!1:!0);else throw"data provides is not an array";this._hasData=function(){return null===g?!1:0===g.length?!1:!0};this._getStr=function(a){var b=[];f&&b.push("jQuery.trim(");b.push("String("+a+")");f&&b.push(")");l||b.push(".toUpperCase()");return b.join("")};this._strComp=function(a){return"string"===typeof a?".toString()":
""};this._group=function(a,b){return{field:a.toString(),unique:b,items:[]}};this._toStr=function(b){f&&(b=a.trim(b));b=b.toString().replace(/\\/g,"\\\\").replace(/\"/g,'\\"');return l?b:b.toUpperCase()};this._funcLoop=function(b){var c=[];a.each(g,function(a,e){c.push(b(e))});return c};this._append=function(a){var b;h=null===h?"":h+(""===A?" && ":A);for(b=0;b<q;b++)h+="(";n&&(h+="!");h+="("+a+")";n=!1;A="";q=0};this._setCommand=function(a,b){B=a;t=b};this._resetNegate=function(){n=!1};this._repeatCommand=
function(a,b){return null===B?e:null!==a&&null!==b?B(a,b):null!==t&&C?B(t,a):B(a)};this._equals=function(a,b){return 0===e._compare(a,b,1)};this._compare=function(a,b,c){void 0===c&&(c=1);void 0===a&&(a=null);void 0===b&&(b=null);if(null===a&&null===b)return 0;if(null===a&&null!==b)return 1;if(null!==a&&null===b)return-1;if("[object Date]"===w.call(a)&&"[object Date]"===w.call(b))return a<b?-c:a>b?c:0;l||"number"===typeof a||"number"===typeof b||(a=String(a),b=String(b));return a<b?-c:a>b?c:0};this._performSort=
function(){0!==p.length&&(g=e._doSort(g,0))};this._doSort=function(a,b){var c=p[b].by,d=p[b].dir,k=p[b].type,g=p[b].datefmt,l=p[b].sfunc;if(b===p.length-1)return e._getOrder(a,c,d,k,g,l);b++;c=e._getGroup(a,c,d,k,g);d=[];for(k=0;k<c.length;k++)for(l=e._doSort(c[k].items,b),g=0;g<l.length;g++)d.push(l[g]);return d};this._getOrder=function(b,d,g,f,k,v){var h=[],B=[],z="a"===g?1:-1,t,q;void 0===f&&(f="text");q="float"===f||"number"===f||"currency"===f||"numeric"===f?function(a){a=parseFloat(String(a).replace(m,
""));return isNaN(a)?Number.NEGATIVE_INFINITY:a}:"int"===f||"integer"===f?function(a){return a?parseFloat(String(a).replace(m,"")):Number.NEGATIVE_INFINITY}:"date"===f||"datetime"===f?function(a){return r.parseDate.call(c,k,a).getTime()}:a.isFunction(f)?f:function(b){b=null!=b?a.trim(String(b)):"";return l?b:b.toUpperCase()};a.each(b,function(a,b){t=""!==d?r.getAccessor(b,d):b;void 0===t&&(t="");t=q(t,b);B.push({vSort:t,index:a})});a.isFunction(v)?B.sort(function(a,b){a=a.vSort;b=b.vSort;return v.call(this,
a,b,z)}):B.sort(function(a,b){a=a.vSort;b=b.vSort;return e._compare(a,b,z)});f=0;for(var n=b.length;f<n;)g=B[f].index,h.push(b[g]),f++;return h};this._getGroup=function(b,c,d,g,k){var l=[],f=null,v=null;a.each(e._getOrder(b,c,d,g,k),function(a,b){var k=r.getAccessor(b,c);null==k&&(k="");e._equals(v,k)||(v=k,null!==f&&l.push(f),f=e._group(c,k));f.items.push(b)});null!==f&&l.push(f);return l};this.ignoreCase=function(){l=!1;return e};this.useCase=function(){l=!0;return e};this.trim=function(){f=!0;
return e};this.noTrim=function(){f=!1;return e};this.execute=function(){var b=h,c=[];if(null===b)return e;a.each(g,function(){eval(b)&&c.push(this)});g=c;return e};this.data=function(){return g};this.select=function(b){e._performSort();if(!e._hasData())return[];e.execute();if(a.isFunction(b)){var c=[];a.each(g,function(a,e){c.push(b(e))});return c}return g};this.hasMatch=function(){if(!e._hasData())return!1;e.execute();return 0<g.length};this.andNot=function(a,b,c){n=!n;return e.and(a,b,c)};this.orNot=
function(a,b,c){n=!n;return e.or(a,b,c)};this.not=function(a,b,c){return e.andNot(a,b,c)};this.and=function(a,b,c){A=" && ";return void 0===a?e:e._repeatCommand(a,b,c)};this.or=function(a,b,c){A=" || ";return void 0===a?e:e._repeatCommand(a,b,c)};this.orBegin=function(){q++;return e};this.orEnd=function(){null!==h&&(h+=")");return e};this.isNot=function(a){n=!n;return e.is(a)};this.is=function(a){e._append("this."+a);e._resetNegate();return e};this._compareValues=function(a,b,d,g,k){var l;l=C?b:"this";
void 0===d&&(d=null);var f=d,v=void 0===k.stype?"text":k.stype;if(null!==d)switch(v){case "int":case "integer":f=String(f).replace(m,"");f=isNaN(Number(f))||""===f?"0":Number(f);l="parseInt("+l+",10)";f=String(parseInt(f,10));break;case "float":case "number":case "currency":case "numeric":f=String(f).replace(m,"");f=isNaN(Number(f))||""===f?"0":Number(f);l="parseFloat("+l+")";f=String(f);break;case "date":case "datetime":f=String(r.parseDate.call(c,k.newfmt||"Y-m-d",f).getTime());l='jQuery.jgrid.parseDate.call(jQuery("'+
c.p.idSel+'")[0],"'+k.srcfmt+'",'+l+").getTime()";break;default:l=e._getStr(l),f=e._getStr('"'+e._toStr(f)+'"')}e._append(l+" "+g+" "+f);e._setCommand(a,b);e._resetNegate();return e};this.equals=function(a,b,c){return e._compareValues(e.equals,a,b,"==",c)};this.notEquals=function(a,b,c){return e._compareValues(e.equals,a,b,"!==",c)};this.isNull=function(a,b,c){return e._compareValues(e.equals,a,null,"===",c)};this.greater=function(a,b,c){return e._compareValues(e.greater,a,b,">",c)};this.less=function(a,
b,c){return e._compareValues(e.less,a,b,"<",c)};this.greaterOrEquals=function(a,b,c){return e._compareValues(e.greaterOrEquals,a,b,">=",c)};this.lessOrEquals=function(a,b,c){return e._compareValues(e.lessOrEquals,a,b,"<=",c)};this.startsWith=function(b,c){var d=null==c?b:c,d=f?a.trim(d.toString()).length:d.toString().length;C?e._append(e._getStr(b)+".substr(0,"+d+") == "+e._getStr('"'+e._toStr(c)+'"')):(null!=c&&(d=f?a.trim(c.toString()).length:c.toString().length),e._append(e._getStr("this")+".substr(0,"+
d+") == "+e._getStr('"'+e._toStr(b)+'"')));e._setCommand(e.startsWith,b);e._resetNegate();return e};this.endsWith=function(b,c){var d=null==c?b:c,d=f?a.trim(d.toString()).length:d.toString().length;C?e._append(e._getStr(b)+".substr("+e._getStr(b)+".length-"+d+","+d+') == "'+e._toStr(c)+'"'):e._append(e._getStr("this")+".substr("+e._getStr("this")+'.length-"'+e._toStr(b)+'".length,"'+e._toStr(b)+'".length) == "'+e._toStr(b)+'"');e._setCommand(e.endsWith,b);e._resetNegate();return e};this.contains=
function(a,b){C?e._append(e._getStr(a)+'.indexOf("'+e._toStr(b)+'",0) > -1'):e._append(e._getStr("this")+'.indexOf("'+e._toStr(a)+'",0) > -1');e._setCommand(e.contains,a);e._resetNegate();return e};this.groupBy=function(a,b,c,d){return e._hasData()?e._getGroup(g,a,b,c,d):null};this.orderBy=function(b,c,d,g,k){c=null==c?"a":a.trim(c.toString().toLowerCase());null==d&&(d="text");null==g&&(g="Y-m-d");null==k&&(k=!1);if("desc"===c||"descending"===c)c="d";if("asc"===c||"ascending"===c)c="a";p.push({by:b,
dir:c,type:d,datefmt:g,sfunc:k});return e};this.custom=function(a,b,d){e._append('jQuery("'+c.p.idSel+'")[0].p.customSortOperations.'+a+'.filter.call(jQuery("'+c.p.idSel+'")[0],{item:this,cmName:"'+b+'",searchValue:"'+d+'"})');e._setCommand(e.custom,b);e._resetNegate();return e};return e}("string"===typeof b?a.data(b):b,null)},serializeFeedback:function(b,c,d){var e=this;e instanceof a&&0<e.length&&(e=e[0]);if("string"===typeof d)return d;c=a(e).triggerHandler(c,d);if("string"===typeof c)return c;
if(null==c||"object"!==typeof c)c=d;return a.isFunction(b)?b.call(e,c):c},fullBoolFeedback:function(b,c){var d=a.makeArray(arguments).slice(2),e=a(this).triggerHandler(c,d),e=!1===e||"stop"===e?!1:!0;a.isFunction(b)&&(d=b.apply(this,d),!1===d||"stop"===d)&&(e=!1);return e},feedback:function(b,c,d,e){var g=this;g instanceof a&&0<g.length&&(g=g[0]);if(null==b||"string"!==typeof e||2>e.length)return null;var l="on"===e.substring(0,2)?"jqGrid"+c+e.charAt(2).toUpperCase()+e.substring(3):"jqGrid"+c+e.charAt(0).toUpperCase()+
e.substring(1),f=a.makeArray(arguments).slice(4),h=b[e+d];f.unshift(l);f.unshift(h);return r.fullBoolFeedback.apply(g,f)},getIconRes:function(a,b){var c=b.split("."),e,d=c.length,g,l,f=[];a=r.icons[a];if(null==a)return"";e=a;e.common&&f.push(e.common);for(l=0;l<d;l++){g=c[l];if(!g)break;e=e[g];if(void 0===e){if("common"===g)break;return""}if("string"===typeof e){f.push(e);break}null!=e&&e.common&&f.push(e.common)}return r.mergeCssClasses.apply(this,f)},builderSortIcons:function(){var a=this.p,b=r.getRes(r.guiStyles[a.guiStyle],
"states.disabled"),c=function(c){return r.mergeCssClasses("ui-grid-ico-sort","ui-icon-"+c,"horizontal"===a.viewsortcols[1]?"ui-i-"+c:"",b,r.getIconRes(a.iconSet,"sort."+c),"ui-sort-"+a.direction)};return"<span class='s-ico"+(a.sortIconsBeforeText?" jqgrid-icons-first":"")+"' style='display:none'><span class='"+c("asc")+"'></span><span class='"+c("desc")+"'></span></span>"},builderFmButon:function(a,b,c,e,d){var g=this.p;return null==g?"":"<a id='"+a+"' class='"+r.mergeCssClasses("fm-button",r.getRes(r.guiStyles[g.guiStyle],
"dialog.fmButton"),r.getRes(r.guiStyles[g.guiStyle],"dialog."+("right"===d?"rightCorner":"left"===d?"leftCorner":"defaultCorner")),"right"===e?"fm-button-icon-right":"left"===e?"fm-button-icon-left":"")+"' role='button' tabindex='0'>"+(c?"<span class='fm-button-icon "+(r.getIconRes(g.iconSet,c)||c)+"'></span>":"")+(b?"<span class='fm-button-text'>"+b+"</span>":"")+"</a>"},convertOnSaveLocally:function(b,c,e,d,g,l){if(null==this.p)return b;if(a.isFunction(c.convertOnSave))return c.convertOnSave.call(this,
{newValue:b,cm:c,oldValue:e,id:d,item:g,iCol:l});if("boolean"!==typeof e&&"number"!==typeof e)return b;"boolean"!==typeof e||"checkbox"!==c.edittype&&"checkbox"!==c.formatter?"number"!==typeof e||isNaN(b)||("number"===c.formatter||"currency"===c.formatter?b=parseFloat(b):"integer"===c.formatter&&(b=parseInt(b,10))):(e=String(b).toLowerCase(),c=null!=c.editoptions&&"string"===typeof c.editoptions.value?c.editoptions.value.split(":"):["yes","no"],0<=a.inArray(e,["1","true",c[0].toLowerCase()])?b=!0:
0<=a.inArray(e,["0","false",c[1].toLowerCase()])&&(b=!1));return b},parseDataToHtml:function(b,c,e,d,g,l,f){var h=this,m=h.p,t=a(h),q,n,A,p,w,C,x,E=!1,y=[],u=!0===m.altRows?m.altclass:"",K=[],L=m.grouping?!0===m.groupingView.groupCollapse:!1,k=parseInt(m.rowNum,10),R,W=a.fn.jqGrid,ba=!0===m.treeGrid&&-1<m.treeANode?h.rows[m.treeANode].rowIndex+1:h.rows.length,ca=h.formatCol,ha=function(a,b,c,k,e,d){b=h.formatter(a,b,c,e,"add",d);return"<td role='gridcell' "+ca(c,k,b,e,a,d)+">"+b+"</td>"},ja=function(a,
b,c,k){return"<td role='gridcell' "+ca(b,c,"",null,a,!0)+"><input role='checkbox' type='checkbox' id='jqg_"+m.id+"_"+a+"' class='cbox' name='jqg_"+m.id+"_"+a+"'"+(k?" checked='checked' aria-checked='true'":" aria-checked='false'")+"/></td>"},da=function(a,b,c,k){c=(parseInt(c,10)-1)*parseInt(k,10)+1+b;return"<td role='gridcell' class='"+W.getGuiStyles.call(t,"rowNum","jqgrid-rownum")+"' "+ca(a,b,c,null,b,!0)+">"+c+"</td>"};1>=ba&&(m.rowIndexes={});"local"!==m.datatype||m.deselectAfterSort||(E=!0);
l&&(k*=l+1);for(l=0;l<Math.min(b,k);l++){p=c[l];w=e[l];C=null!=d?d[l]:w;q=1===g?0:g;n=1===(q+l)%2?u:"";E&&(A=m.multiselect?-1!==a.inArray(p,m.selarrrow):p===m.selrow);x=y.length;y.push("");for(q=0;q<m.colModel.length;q++)switch(R=m.colModel[q].name,R){case "rn":y.push(da(q,l,m.page,m.rowNum));break;case "cb":y.push(ja(p,q,l,A));break;case "subgrid":y.push(W.addSubGridCell.call(t,q,l+g));break;default:y.push(ha(p,w[R],q,l+g,C,w))}y[x]=h.constructTr(p,L,n,w,C,A);y.push("</tr>");m.rowIndexes[p]=ba;ba++;
m.grouping&&(K.push(y),m.groupingView._locgr||W.groupingPrepare.call(t,w,l),y=[]);y.length>m.maxItemsToJoin&&(y=[y.join("")])}m.grouping&&(f&&(m.groupingView._locgr=!0),y=[W.groupingRender.call(t,K,m.colModel.length,m.page,k)],r.clearArray(K));return y},getMethod:function(b){return this.getAccessor(a.fn.jqGrid,b)},extend:function(b){a.extend(a.fn.jqGrid,b);this.no_legacy_api||a.fn.extend(b)}});var d=r.clearArray,f=r.jqID,h=r.getGridComponentIdSelector,b=r.getGridComponentId,c=r.getGridComponent,e=
r.stripPref,l=r.randId,m=r.getAccessor,g=r.convertOnSaveLocally,t=r.stripHtml,w=r.htmlEncode,A=r.htmlDecode,q=r.mergeCssClasses,y=r.hasOneFromClasses,E=function(){var b=a.makeArray(arguments);b.unshift("");b.unshift("");b.unshift(this.p);return r.feedback.apply(this,b)};a.fn.jqGrid=function(g){var D=a.fn.jqGrid,z;if("string"===typeof g){z=D[g];if(!z)throw"jqGrid - No such method: "+g;return z.apply(this,a.makeArray(arguments).slice(1))}return this.each(function(){if(!this.grid){var v=this,z,A,G=a(v),
p=a.isFunction,C=a.isArray,F=a.extend,J=a.inArray,H=a.trim,N=a.each,Y=D.setSelection,X=D.getGridRes,T=p(n.fatalError)?n.fatalError:alert,x=g.locale||n.locale||"en-US",O=null!=u[x]&&"boolean"===typeof u[x].isRTL?u[x].isRTL?"rtl":"ltr":"ltr",aa=g.iconSet||n.iconSet||"jQueryUI",Q=g.guiStyle||n.guiStyle||"jQueryUI",K=function(a){return r.getIconRes(aa,a)},L=function(a,b){return q(r.getRes(r.guiStyles[Q],a),b||"")};null==g&&(g={datatype:"local"});void 0!==g.datastr&&C(g.datastr)&&(A=g.datastr,g.datastr=
[]);void 0!==g.data&&(z=g.data,g.data=[]);null!=r.formatter&&null!=r.formatter.unused||T("CRITICAL ERROR!!!\n\n\nOne uses probably\n\n\t$.extend($.jgrid.defaults, {...});\n\nto set default settings of jqGrid instead of the usage the DEEP version of jQuery.extend (with true as the first parameter):\n\n\t$.extend(true, $.jgrid.defaults, {...});\n\nOne other possible reason:\n\nyou included some OLD version of language file (grid.locale-en.js for example) AFTER jquery.jqGrid.min.js. For example all language files of jqGrid 4.7.0 uses non-deep call of jQuery.extend.\n\n\nSome options of jqGrid could still work, but another one will be broken.");
void 0===g.datatype&&void 0!==g.dataType&&(g.datatype=g.dataType,delete g.dataType);void 0===g.mtype&&void 0!==g.type&&(g.mtype=g.type,delete g.type);var k=F(!0,{height:"auto",page:1,rowNum:20,maxRowNum:1E4,autoresizeOnLoad:!1,columnsToReResizing:[],autoResizing:{wrapperClassName:"ui-jqgrid-cell-wrapper",minColWidth:33,maxColWidth:300,adjustGridWidth:!0,compact:!1,fixWidthOnShrink:!1},doubleClickSensitivity:250,minResizingWidth:10,rowTotal:null,records:0,pager:"",pgbuttons:!0,pginput:!0,colModel:[],
additionalProperties:[],arrayReader:[],rowList:[],colNames:[],sortorder:"asc",sortname:"",mtype:"GET",altRows:!1,selarrrow:[],savedRow:[],shrinkToFit:!0,xmlReader:{},subGrid:!1,subGridModel:[],reccount:0,lastpage:0,lastsort:0,selrow:null,singleSelectClickMode:"toggle",beforeSelectRow:null,onSelectRow:null,onSortCol:null,ondblClickRow:null,onRightClickRow:null,onPaging:null,onSelectAll:null,onInitGrid:null,loadComplete:null,gridComplete:null,loadError:null,loadBeforeSend:null,afterInsertRow:null,beforeRequest:null,
beforeProcessing:null,onHeaderClick:null,viewrecords:!1,loadonce:!1,multiselect:!1,multikey:!1,editurl:"clientArray",search:!1,caption:"",hidegrid:!0,hiddengrid:!1,useUnformattedDataForCellAttr:!0,postData:{},userData:{},treeGrid:!1,treeGridModel:"nested",treeReader:{},treeANode:-1,ExpandColumn:null,tree_root_level:0,prmNames:{page:"page",rows:"rows",sort:"sidx",order:"sord",search:"_search",nd:"nd",id:"id",oper:"oper",editoper:"edit",addoper:"add",deloper:"del",subgridid:"id",npage:null,totalrows:"totalrows"},
forceFit:!1,gridstate:"visible",cellEdit:!1,iCol:-1,iRow:-1,nv:0,loadui:"enable",toolbar:[!1,""],scroll:!1,multiboxonly:!1,deselectAfterSort:!0,scrollrows:!1,autowidth:!1,scrollOffset:18,cellLayout:5,subGridWidth:16,multiselectWidth:16,multiselectPosition:"left",gridview:null==g||null==g.afterInsertRow,rownumWidth:25,rownumbers:!1,pagerpos:"center",footerrow:!1,userDataOnFooter:!1,hoverrows:!0,altclass:"ui-priority-secondary",viewsortcols:[!1,"vertical",!0],resizeclass:"",autoencode:!1,remapColumns:[],
cmNamesInputOrder:[],ajaxGridOptions:{},direction:O,toppager:!1,headertitles:!1,scrollTimeout:40,maxItemsToJoin:32768,data:[],lastSelectedData:[],quickEmpty:!0,_index:{},iColByName:{},iPropByName:{},reservedColumnNames:["rn","cb","subgrid"],grouping:!1,groupingView:{groupField:[],groupOrder:[],groupText:[],groupColumnShow:[],groupSummary:[],showSummaryOnHide:!1,sortitems:[],sortnames:[],summary:[],summaryval:[],displayField:[],groupSummaryPos:[],formatDisplayField:[],_locgr:!1,commonIconClass:K("grouping.common"),
plusicon:K("grouping.plus"),minusicon:K("grouping.minus")},ignoreCase:!0,cmTemplate:{},idPrefix:"",iconSet:aa,guiStyle:Q,locale:x,multiSort:!1,treeIcons:{commonIconClass:K("treeGrid.common"),plusLtr:K("treeGrid.plusLtr"),plusRtl:K("treeGrid.plusRtl"),minus:K("treeGrid.minus"),leaf:K("treeGrid.leaf")},subGridOptions:{commonIconClass:K("subgrid.common"),plusicon:K("subgrid.plus"),minusicon:K("subgrid.minus")}},n,{navOptions:F(!0,{commonIconClass:K("nav.common"),editicon:K("nav.edit"),addicon:K("nav.add"),
delicon:K("nav.del"),searchicon:K("nav.search"),refreshicon:K("nav.refresh"),viewicon:K("nav.view"),saveicon:K("nav.save"),cancelicon:K("nav.cancel"),buttonicon:K("nav.newbutton")},r.nav||{}),actionsNavOptions:F(!0,{commonIconClass:K("actions.common"),editicon:K("actions.edit"),delicon:K("actions.del"),saveicon:K("actions.save"),cancelicon:K("actions.cancel")},r.actionsNav||{}),formEditing:F(!0,{commonIconClass:K("form.common"),prevIcon:K("form.prev"),nextIcon:K("form.next"),saveicon:[!0,"left",K("form.save")],
closeicon:[!0,"left",K("form.undo")]},r.edit||{}),searching:F(!0,{commonIconClass:K("search.common"),findDialogIcon:K("search.search"),resetDialogIcon:K("search.reset"),queryDialogIcon:K("search.query")},r.search||{}),formViewing:F(!0,{commonIconClass:K("form.common"),prevIcon:K("form.prev"),nextIcon:K("form.next"),closeicon:[!0,"left",K("form.cancel")]},r.view||{}),formDeleting:F(!0,{commonIconClass:K("form.common"),delicon:[!0,"left",K("form.del")],cancelicon:[!0,"left",K("form.cancel")]},r.del||
{})},g||{}),R=function(a){var b=r.getRes(k,a);return void 0!==b?b:X.call(G,"defaults."+a)};k.recordpos=k.recordpos||("rtl"===k.direction?"left":"right");k.subGridOptions.openicon="rtl"===k.direction?K("subgrid.openRtl"):K("subgrid.openLtr");k.autoResizing.widthOfVisiblePartOfSortIcon=void 0!==k.autoResizing.widthOfVisiblePartOfSortIcon?k.autoResizing.widthOfVisiblePartOfSortIcon:"fontAwesome"===k.iconSet?13:12;k.datatype=void 0!==k.datatype?k.datatype:void 0!==z||null==k.url?"local":null!=k.jsonReader&&
"object"===typeof k.jsonReader?"json":"xml";k.jsonReader=k.jsonReader||{};k.url=k.url||"";k.cellsubmit=void 0!==k.cellsubmit?k.cellsubmit:void 0===k.cellurl?"clientArray":"remote";k.gridview=void 0!==k.gridview?k.gridview:null==k.afterInsertRow;void 0!==z&&(k.data=z,g.data=z);void 0!==A&&(k.datastr=A,g.datastr=A);if("TABLE"!==v.tagName.toUpperCase())T("Element is not a table!");else if(""===v.id&&G.attr("id",l()),void 0!==document.documentMode&&5>=document.documentMode)T("Grid can not be used in this ('quirks') mode!");
else{G.empty().attr("tabindex","0");v.p=k;k.id=v.id;k.idSel="#"+f(v.id);k.gBoxId=b.call(v,0);k.gBox=h.call(v,0);k.gViewId=b.call(v,8);k.gView=h.call(v,8);k.rsId=b.call(v,43);k.rs=h.call(v,43);k.cbId=b.call(v,45);k.cb=h.call(v,45);k.useProp=!!a.fn.prop;k.propOrAttr=k.useProp?"prop":"attr";var W=k.propOrAttr,ba=r.fixScrollOffsetAndhBoxPadding,ca=function(a){var b={},c,k=a.length;for(c=0;c<k;c++)b[a[c].name]=c;return b},ha=function(a){var b={},c,k=a.length,e;for(c=0;c<k;c++)e=a[c],b["string"===typeof e?
e:e.name]=c;return b},ja=function(){var b={},c,k;this.p.rowIndexes=b;for(k=0;k<this.rows.length;k++)c=this.rows[k],a(c).hasClass("jqgrow")&&(b[c.id]=c.rowIndex)},da=function(){var b,c=k.colModel;b=k.cmNamesInputOrder;var e=k.additionalProperties,d=b.length,g,l,f,h;k.arrayReaderInfos={};g=k.arrayReaderInfos;for(h=0;h<d;h++)l=b[h],0>J(l,k.reservedColumnNames)&&!g.hasOwnProperty(l)&&(f=k.iColByName[l],void 0!==f?g[l]={name:c[f].name,index:f,order:h,type:0}:(f=k.iPropByName[l],void 0!==f?g[l]={name:c[f].name,
index:f,order:h,type:1}:l===(k.prmNames.rowidName||"rowid")&&(g[l]={index:f,type:2})));d=c.length;for(b=0;b<d;b++)l=c[b].name,0>J(l,k.reservedColumnNames)&&!g.hasOwnProperty(l)&&(g[l]={name:l,index:b,order:h,type:0},h++);d=e.length;for(b=0;b<d;b++)l=e[b],null==l||g.hasOwnProperty(l)||("object"===typeof l&&"string"===a.type(l.name)&&(l=l.name),g[l]={name:l,index:b,order:h,type:1},h++)},P=function(b){var c=a(this).data("pageX");c?(c=String(c).split(";"),c=c[c.length-1],a(this).data("pageX",c+";"+b.pageX)):
a(this).data("pageX",b.pageX)},ea=function(a,b){a=parseInt(a,10);return isNaN(a)?b||0:a},M={headers:[],cols:[],footers:[],dragStart:function(b,e,d,g){var l=a(this.bDiv),f=l.closest(k.gBox).offset();g=g.offset().left+("rtl"===k.direction?0:this.headers[b].width+(r.cell_width?0:ea(k.cellLayout,0))-2);this.resizing={idx:b,startX:g,sOL:g,moved:!1,delta:g-e.pageX};this.curGbox=a(k.rs);this.curGbox.prependTo("body");this.curGbox.css({display:"block",left:g,top:d[1]+f.top,height:d[2]});this.curGbox.data("idx",
b);this.curGbox.data("delta",g-e.pageX);P.call(this.curGbox,e);E.call(c(21,l),"resizeStart",e,b);document.onselectstart=function(){return!1};a(document).bind("mousemove.jqGrid",function(a){if(M.resizing)return M.dragMove(a),!1}).bind("mouseup.jqGrid"+k.id,function(){if(M.resizing)return M.dragEnd(),!1})},dragMove:function(b){var c=this.resizing;if(c){var e=b.pageX+c.delta-c.startX,d=this.headers;b=d[c.idx];var g="ltr"===k.direction?b.width+e:b.width-e;c.moved=!0;g>k.minResizingWidth&&(null==this.curGbox&&
(this.curGbox=a(k.rs)),this.curGbox.css({left:c.sOL+e}),!0===k.forceFit?(c=d[c.idx+k.nv],e="ltr"===k.direction?c.width-e:c.width+e,e>k.autoResizing.minColWidth&&(b.newWidth=g,c.newWidth=e)):(this.newWidth="ltr"===k.direction?k.tblwidth+e:k.tblwidth-e,b.newWidth=g))}},resizeColumn:function(b,e,d){var g=this.headers,l=this.footers,f=g[b],h=f.newWidth||f.width,m=c(21,this.bDiv),v=c(14,this.hDiv).children("thead").children("tr").first()[0].cells,h=parseInt(h,10);k.colModel[b].width=h;f.width=h;v[b].style.width=
h+"px";this.cols[b].style.width=h+"px";this.fbRows&&(a(this.fbRows[0].cells[b]).css("width",h),a(c(31,this.fhDiv)[0].rows[0].cells[b]).css("width",h),k.footerrow&&a(c(36,this.fsDiv)[0].rows[0].cells[b]).css("width",h));0<l.length&&(l[b].style.width=h+"px");!0!==d&&ba.call(m[0]);!0===k.forceFit?(g=g[b+k.nv],h=g.newWidth||g.width,g.width=h,v[b+k.nv].style.width=h+"px",this.cols[b+k.nv].style.width=h+"px",0<l.length&&(l[b+k.nv].style.width=h+"px"),k.colModel[b+k.nv].width=h):(k.tblwidth=this.newWidth||
k.tblwidth,m.css("width",k.tblwidth+"px"),c(14,this.hDiv).css("width",k.tblwidth+"px"),!0!==d&&(this.hDiv.scrollLeft=this.bDiv.scrollLeft,k.footerrow&&(c(27,this.sDiv).css("width",k.tblwidth+"px"),this.sDiv.scrollLeft=this.bDiv.scrollLeft)));k.autowidth||void 0!==k.widthOrg&&"auto"!==k.widthOrg&&"100%"!==k.widthOrg||!0===d||D.setGridWidth.call(m,this.newWidth+k.scrollOffset,!1);e||E.call(m[0],"resizeStop",h,b)},dragEnd:function(){this.hDiv.style.cursor="default";this.resizing&&(null!==this.resizing&&
!0===this.resizing.moved&&(a(this.headers[this.resizing.idx].el).removeData("autoResized"),this.resizeColumn(this.resizing.idx,!1)),a(k.rs).removeData("pageX"),this.resizing=!1,setTimeout(function(){a(k.rs).css("display","none").prependTo(k.gBox)},k.doubleClickSensitivity));this.curGbox=null;document.onselectstart=function(){return!0};a(document).unbind("mousemove.jqGrid").unbind("mouseup.jqGrid"+k.id)},populateVisible:function(){var b=this,c=a(b),e=b.grid,d=e.bDiv,g=a(d);e.timer&&clearTimeout(e.timer);
e.timer=null;if(g=g.height()){var l,f;if(b.rows.length)try{f=(l=b.rows[1])?a(l).outerHeight()||e.prevRowHeight:e.prevRowHeight}catch(h){f=e.prevRowHeight}if(f){e.prevRowHeight=f;l=k.rowNum;e.scrollTop=d.scrollTop;var d=e.scrollTop,m=Math.round(c.position().top)-d,c=m+c.height();f*=l;var v,t,D;c<g&&0>=m&&(void 0===k.lastpage||(parseInt((c+d+f-1)/f,10)||0)<=k.lastpage)&&(t=parseInt((g-c+f-1)/f,10)||1,0<=c||2>t||!0===k.scroll?(v=(Math.round((c+d)/f)||0)+1,m=-1):m=1);0<m&&(v=(parseInt(d/f,10)||0)+1,t=
(parseInt((d+g)/f,10)||0)+2-v,D=!0);!t||k.lastpage&&(v>k.lastpage||1===k.lastpage||v===k.page&&v===k.lastpage)||(e.hDiv.loading?e.timer=setTimeout(function(){e.populateVisible.call(b)},k.scrollTimeout):(k.page=v,D&&(e.selectionPreserver.call(b),e.emptyRows.call(b,!1,!1)),e.populate.call(b,t)))}}},scrollGrid:function(a){var b=c(21,this);a&&a.stopPropagation();if(0===b.length)return!0;var e=b[0].grid;k.scroll&&(a=this.scrollTop,void 0===e.scrollTop&&(e.scrollTop=0),a!==e.scrollTop&&(e.scrollTop=a,e.timer&&
clearTimeout(e.timer),e.timer=setTimeout(function(){e.populateVisible.call(b[0])},k.scrollTimeout)));e.hDiv.scrollLeft=this.scrollLeft;k.footerrow&&(e.sDiv.scrollLeft=this.scrollLeft)},selectionPreserver:function(){var b=a(this),c=k.selrow,e=k.selarrrow?a.makeArray(k.selarrrow):null,g=this.grid.bDiv,l=g.scrollLeft,f=function(){var a;k.selrow=null;d(k.selarrrow);if(k.multiselect&&e&&0<e.length)for(a=0;a<e.length;a++)e[a]!==c&&Y.call(b,e[a],!1,null);c&&Y.call(b,c,!1,null);g.scrollLeft=l;b.unbind(".selectionPreserver",
f)};b.bind("jqGridGridComplete.selectionPreserver",f)}};v.grid=M;E.call(v,"beforeInitGrid");k.iColByName=ca(k.colModel);k.iPropByName=ha(k.additionalProperties);var Z,fa;if(0===k.colNames.length)for(Z=0;Z<k.colModel.length;Z++)k.colNames[Z]=void 0!==k.colModel[Z].label?k.colModel[Z].label:k.colModel[Z].name;if(k.colNames.length!==k.colModel.length)T(X.call(G,"errors.model"));else{var O=a("<div class='ui-jqgrid-view' role='grid' aria-multiselectable='"+!!k.multiselect+"'></div>"),ka=(x=r.msie)&&8>
r.msiever();k.direction=H(k.direction.toLowerCase());-1===J(k.direction,["ltr","rtl"])&&(k.direction="ltr");fa=k.direction;a(O).insertBefore(v);G.removeClass("scroll").appendTo(O);z=a("<div class='"+L("gBox","ui-jqgrid")+"'></div>");a(z).attr({id:k.gBoxId,dir:fa}).insertBefore(O);a(O).attr("id",k.gViewId).appendTo(z);a("<div class='"+L("overlay","jqgrid-overlay")+"' id='lui_"+k.id+"'></div>").insertBefore(O);a("<div class='"+L("loading","loading")+"' id='load_"+k.id+"'>"+R("loadtext")+"</div>").insertBefore(O);
ka&&G.attr({cellspacing:"0"});G.attr({role:"presentation","aria-labelledby":"gbox_"+v.id});var xa=function(a,b,c,e,d,g){var l=k.colModel[a],f=c,h="style='",m=l.classes,D=l.align?"text-align:"+l.align+";":"",z,B=function(a){return"string"===typeof a?a.replace(/\'/g,"'"):a},q=" aria-describedby='"+k.id+"_"+l.name+"'";!0===l.hidden&&(D+="display:none;");if(0===b)D+="width: "+M.headers[a].width+"px;";else if(p(l.cellattr)||"string"===typeof l.cellattr&&null!=r.cellattr&&p(r.cellattr[l.cellattr]))if(a=
p(l.cellattr)?l.cellattr:r.cellattr[l.cellattr],k.useUnformattedDataForCellAttr&&null!=g?f=g[l.name]:l.autoResizable&&(f="<span class='"+k.autoResizing.wrapperClassName+"'>",f=c.substring(f.length,c.length-7)),e=a.call(v,d,f,e,l,g),"string"===typeof e)for(e=e.replace(/\n/g,"
");;){c=/^\s*(\w+[\w|\-]*)\s*=\s*([\"|\'])(.*?)\2(.*)/.exec(e);if(null===c||5>c.length)return!z&&l.title&&(z=f),q+" style='"+B(D)+"'"+(m?" class='"+B(m)+"'":"")+(z?" title='"+B(z)+"'":"");h=c[3];e=c[4];switch(c[1].toLowerCase()){case "class":m=
m?m+(" "+h):h;break;case "title":z=h;break;case "style":D+=h;break;default:q+=" "+c[1]+"="+c[2]+h+c[2]}}h=h+(D+"'")+((void 0!==m?" class='"+m+"'":"")+(l.title&&f?' title="'+t(c)+'"':""));return h+=q},ga=function(a){return null==a||""===a?" ":k.autoencode?w(a):String(a)},za=function(a){var b=k.treeReader,c=b.loaded,e=b.leaf_field,d=b.expanded_field,g=function(a){return!0===a||"true"===a||"1"===a};if("nested"===k.treeGridModel&&!a[e]){var l=parseInt(a[b.left_field],10),b=parseInt(a[b.right_field],
10);a[e]=b===l+1?!0:!1}void 0!==a[c]&&(a[c]=g(a[c]));a[e]=g(a[e]);a[d]=g(a[d])},Ea=function(){var a=k.data,b=a.length,c,e,d,g,f,h,t,D=k.localReader,z=k.additionalProperties,B=D.cell,q,A,n,G=k.arrayReaderInfos;if("local"!==k.datatype||!0!==D.repeatitems){if(k.treeGrid)for(c=0;c<b;c++)za(a[c])}else for(g=!1===k.keyName?p(D.id)?D.id.call(v,a):D.id:k.keyName,isNaN(g)?p(g)||null==k.arrayReaderInfos[g]||(f=k.arrayReaderInfos[g].order):f=Number(g),c=0;c<b;c++){e=a[c];d=B?m(e,B)||e:e;A=C(d);t={};for(q in G)G.hasOwnProperty(q)&&
(n=G[q],h=m(d,A?n.order:n.name),1===n.type&&(n=z[n.index],null!=n&&p(n.convert)&&(h=n.convert(h,d))),void 0!==h&&(t[q]=h));void 0!==t[g]?e=void 0!==t[g]?t[g]:l():(e=m(e,C(e)?f:g),void 0===e&&(e=m(d,C(d)?f:g)),void 0===e&&(e=l()));e=String(e);t[D.id]=e;k.treeGrid&&za(t);F(a[c],t)}},ma=function(){var a=k.data.length,b,c,e;b=!1===k.keyName||k.loadonce?k.localReader.id:k.keyName;k._index={};for(c=0;c<a;c++)e=m(k.data[c],b),void 0===e&&(e=String(c+1)),k._index[e]=c},pa=function(){var b,c,e=a.fn.fmatter;
for(b=0;b<k.colModel.length;b++)c=k.colModel[b].formatter,"string"===typeof c&&null!=e&&p(e[c])&&p(e[c].pageFinalization)&&e[c].pageFinalization.call(this,b)},ta=function(b,c){var e,d,g=k.colModel,l=g.length,f,h=function(a){return null==a||""===a?" ":w(a)},m=function(a){return null==a||""===a?" ":String(a)};for(e=0;e<l;e++)d=g[e],d.cellBuilder=null,b||(f={colModel:d,gid:k.id,pos:e},void 0===d.formatter?d.cellBuilder=k.autoencode?h:m:"string"===typeof d.formatter?d.cellBuilder=a.fn.fmatter.getCellBuilder.call(v,
d.formatter,f,c||"add"):p(d.getCellBuilder)&&(d.cellBuilder=d.getCellBuilder.call(v,f,c||"add")))},la=function(b,c,e,g){var f=a(this),h=new Date,v=k.datatype,t="local"!==v&&k.loadonce||"xmlstring"===v||"jsonstring"===v,z=("xmlstring"===v||"xml"===v)&&a.isXMLDoc(b),B=k.localReader,q=m;if(b&&("xml"!==v||z)){-1!==k.treeANode||k.scroll?c=1<c?c:1:(M.emptyRows.call(this,!1,!0),c=1);t&&(d(k.data),d(k.lastSelectedData),k._index={},k.localReader.id="_id_");k.reccount=0;switch(v){case "xml":case "xmlstring":B=
k.xmlReader;q=r.getXmlData;break;case "json":case "jsonp":case "jsonstring":B=k.jsonReader}var n,A,G,w,x,I={},V,F=k.colModel,y=F.length,J,H,u,N,P,sa=k.arrayReaderInfos,X={},O=function(a){return function(b){b=b.getAttribute(a);return null!==b?b:void 0}},Y=function(a){return function(){var b=X[a];if(null!=b)return b=b.childNodes,0<b.length?b[0].nodeValue:void 0}};k.page=ea(q(b,B.page),k.page);k.lastpage=ea(q(b,B.total),1);k.records=ea(q(b,B.records));p(B.userdata)?k.userData=B.userdata.call(this,b)||
{}:z?q(b,B.userdata,!0).each(function(){k.userData[this.getAttribute("name")]=a(this).text()}):k.userData=q(b,B.userdata)||{};ta();var T={},L=k.additionalProperties,K=function(a){z&&"string"===typeof a&&(/^\w+$/.test(a)?T[a]=Y(a):/^\[\w+\]$/.test(a)&&(T[a]=O(a.substring(1,a.length-1))))};for(n=0;n<y;n++)if(I=F[n],J=I.name,"cb"!==J&&"subgrid"!==J&&"rn"!==J){G=z?I.xmlmap||J:"local"===v&&!k.dataTypeOrg||"json"===v||"jsonp"===v?I.jsonmap||J:J;!1!==k.keyName&&!0===I.key&&(k.keyName=J);if("string"===typeof G||
p(G))T[J]=G;K(J)}y=L.length;for(n=0;n<y;n++)H=L[n],"object"===typeof H&&null!=H&&(H=H.name),K(H);w=!1===k.keyName?p(B.id)?B.id.call(this,b):B.id:k.keyName;isNaN(w)?p(w)||(sa[J]&&(x=sa[J].order),z&&("string"===typeof w&&/^\[\w+\]$/.test(w)?w=O(w.substring(1,w.length-1)):"string"===typeof w&&/^\w+$/.test(w)&&(w=Y(w)))):x=Number(w);G=q(b,B.root,!0);if(B.row)if(1===G.length&&"string"===typeof B.row&&/^\w+$/.test(B.row)){v=[];u=G[0].childNodes;N=u.length;for(H=0;H<N;H++)P=u[H],1===P.nodeType&&P.nodeName===
B.row&&v.push(P);G=v}else G=q(G,B.row,!0);null==G&&C(b)&&(G=b);G||(G=[]);b=G.length;0<b&&0>=k.page&&(k.page=1);y=parseInt(k.rowNum,10);g&&(y*=g+1);var K=[],F=[],R,v=[];for(n=0;n<b;n++){R=G[n];A=B.repeatitems&&B.cell?q(R,B.cell,!0)||R:R;V=B.repeatitems&&(z||C(A));I={};X={};if(z&&!V&&null!=A)for(u=A.childNodes,N=u.length,H=0;H<N;H++)P=u[H],1===P.nodeType&&(X[P.nodeName]=P);for(J in sa)sa.hasOwnProperty(J)&&(H=sa[J],V?(u=A[H.order],z&&null!=u&&(u=u.textContent||u.text)):u=null!=T[J]&&"string"!==typeof T[J]?
T[J](A):q(A,"string"===typeof T[J]?T[J]:H.name),1===H.type&&(H=L[H.index],null!=H&&p(H.convert)&&(u=H.convert(u,A))),void 0!==u&&(I[J]=u));void 0!==I[w]?R=void 0!==I[w]?I[w]:l():(R=q(R,C(R)?x:w),void 0===R&&(R=q(A,C(A)?x:w)),void 0===R&&(R=l()));R=String(R);V=k.idPrefix+R;k.treeGrid&&za(I);if(n<y)F.push(V),K.push(A),v.push(I);else if(!t)break;if(t||!0===k.treeGrid)I._id_=R,k.data.push(I),k._index[I._id_]=k.data.length-1}c=r.parseDataToHtml.call(this,b,F,v,K,c,g,t);ta(!0);g=-1<k.treeANode?k.treeANode:
0;B=a(this.tBodies[0]);!0===k.treeGrid&&0<g?a(this.rows[g]).after(c.join("")):k.scroll?B.append(c.join("")):(null==this.firstElementChild||void 0!=document.documentMode&&9>=document.documentMode?B.html(B.html()+c.join("")):this.firstElementChild.innerHTML+=c.join(""),this.grid.cols=this.rows[0].cells);k.grouping&&ja.call(this);if(!0===k.subGrid)try{D.addSubGrid.call(f,k.iColByName.subgrid)}catch(Q){}if(!1===k.gridview||p(k.afterInsertRow))for(n=0;n<Math.min(b,y);n++)E.call(this,"afterInsertRow",F[n],
v[n],K[n]);k.totaltime=new Date-h;0<n&&0===k.records&&(k.records=b);d(c);if(!0===k.treeGrid)try{D.setTreeNode.call(f,g+1,n+g+1)}catch(W){}k.reccount=Math.min(b,y);k.treeANode=-1;k.userDataOnFooter&&D.footerData.call(f,"set",k.userData,!0);t&&(k.records=b,k.lastpage=Math.ceil(b/y));e||this.updatepager(!1,!0);pa.call(this)}},wa=function(){function b(a){var c=0,e,d,g,f,h,m,v;if(null!=a.groups){(d=a.groups.length&&"OR"===a.groupOp.toString().toUpperCase())&&w.orBegin();for(e=0;e<a.groups.length;e++){0<
c&&d&&w.or();try{b(a.groups[e])}catch(t){T(t)}c++}d&&w.orEnd()}if(null!=a.rules)try{(g=a.rules.length&&"OR"===a.groupOp.toString().toUpperCase())&&w.orBegin();for(e=0;e<a.rules.length;e++)h=a.rules[e],f=a.groupOp.toString().toUpperCase(),A[h.op]&&h.field?(0<c&&f&&"OR"===f&&(w=w.or()),v=l[h.field],m=v.reader,w=A[h.op](w,f)(p(m)?'jQuery.jgrid.getAccessor(this,jQuery("'+k.idSel+'")[0].p.colModel['+v.iCol+"].jsonmap)":"jQuery.jgrid.getAccessor(this,'"+m+"')",h.data,l[h.field])):null!=k.customSortOperations&&
null!=k.customSortOperations[h.op]&&p(k.customSortOperations[h.op].filter)&&(w=w.custom(h.op,h.field,h.data)),c++;g&&w.orEnd()}catch(D){T(D)}}var c=a(this),e=k.multiSort?[]:"",d=[],g=!1,l={},f=[],h=[],m,v,t,z=X.call(G,"formatter.date");if(!C(k.data))return{};var B=k.grouping?k.groupingView:!1,q,n;N(k.colModel,function(a){var b=this.index||this.name;v=this.sorttype||"text";l[this.name]={reader:k.dataTypeOrg?this.name:this.jsonmap||this.name,iCol:a,stype:v,srcfmt:"",newfmt:"",sfunc:this.sortfunc||null};
if("date"===v||"datetime"===v)this.formatter&&"string"===typeof this.formatter&&"date"===this.formatter?(m=this.formatoptions&&this.formatoptions.srcformat?this.formatoptions.srcformat:z.srcformat,t=this.formatoptions&&this.formatoptions.newformat?this.formatoptions.newformat:z.newformat):m=t=this.datefmt||"Y-m-d",l[this.name].srcfmt=m,l[this.name].newfmt=t;if(k.grouping)for(n=0,q=B.groupField.length;n<q;n++)this.name===B.groupField[n]&&(f[n]=l[b],h[n]=b);k.multiSort?this.lso&&(e.push(this.name),
a=this.lso.split("-"),d.push(a[a.length-1])):g||this.index!==k.sortname&&this.name!==k.sortname||(e=this.name,g=!0)});if(k.treeGrid)return D.SortTree.call(c,e,k.sortorder,null!=l[e]&&l[e].stype?l[e].stype:"text",null!=l[e]&&l[e].srcfmt?l[e].srcfmt:""),!1;var A={eq:function(a){return a.equals},ne:function(a){return a.notEquals},lt:function(a){return a.less},le:function(a){return a.lessOrEquals},gt:function(a){return a.greater},ge:function(a){return a.greaterOrEquals},cn:function(a){return a.contains},
nc:function(a,b){return"OR"===b?a.orNot().contains:a.andNot().contains},bw:function(a){return a.startsWith},bn:function(a,b){return"OR"===b?a.orNot().startsWith:a.andNot().startsWith},en:function(a,b){return"OR"===b?a.orNot().endsWith:a.andNot().endsWith},ew:function(a){return a.endsWith},ni:function(a,b){return"OR"===b?a.orNot().equals:a.andNot().equals},"in":function(a){return a.equals},nu:function(a){return a.isNull},nn:function(a,b){return"OR"===b?a.orNot().isNull:a.andNot().isNull}},w=r.from.call(this,
k.data);k.ignoreCase&&(w=w.ignoreCase());if(!0===k.search){var I=k.postData.filters;if(I)"string"===typeof I&&(I=r.parse(I)),b(I);else try{w=A[k.postData.searchOper](w)(k.postData.searchField,k.postData.searchString,l[k.postData.searchField])}catch(x){}}if(k.grouping)for(n=0;n<q;n++)w.orderBy(h[n],B.groupOrder[n],f[n].stype,f[n].srcfmt);k.multiSort?N(e,function(a){w.orderBy(this,d[a],l[this].stype,l[this].srcfmt,l[this].sfunc)}):e&&k.sortorder&&g&&("DESC"===k.sortorder.toUpperCase()?w.orderBy(k.sortname,
"d",l[e].stype,l[e].srcfmt,l[e].sfunc):w.orderBy(k.sortname,"a",l[e].stype,l[e].srcfmt,l[e].sfunc));k.lastSelectedData=w.select();var I=parseInt(k.rowNum,10),V=k.lastSelectedData.length,F=parseInt(k.page,10),E=Math.ceil(V/I),y={};if(k.grouping&&k.groupingView._locgr){k.groupingView.groups=[];var J,H,u;if(k.footerrow&&k.userDataOnFooter){for(H in k.userData)k.userData.hasOwnProperty(H)&&(k.userData[H]=0);u=!0}for(J=0;J<V;J++){if(u)for(H in k.userData)k.userData.hasOwnProperty(H)&&(k.userData[H]+=parseFloat(k.lastSelectedData[J][H]||
0));D.groupingPrepare.call(c,k.lastSelectedData[J],J,I)}}l=w=null;c=k.localReader;y[c.total]=E;y[c.page]=F;y[c.records]=V;y[c.root]=k.lastSelectedData.slice((F-1)*I,F*I);y[c.userdata]=k.userData;return y},Aa=function(b){var c=b.outerWidth();0>=c&&(c=a(this).closest(".ui-jqgrid>.ui-jqgrid-view").css("font-size")||"11px",a(document.body).append("<div id='testpg' class='"+L("gBox","ui-jqgrid")+"' style='font-size:"+c+";visibility:hidden;margin:0;padding:0;' ></div>"),a(b).clone().appendTo("#testpg"),
c=a("#testpg>.ui-pg-table").width(),a("#testpg").remove());0<c&&b.parent().width(c);return c},ua=function(){this.grid.hDiv.loading=!0;k.hiddengrid||D.progressBar.call(a(this),{method:"show",loadtype:k.loadui,htmlcontent:R("loadtext")})},va=function(){this.grid.hDiv.loading=!1;D.progressBar.call(a(this),{method:"hide",loadtype:k.loadui})},qa=function(b){var c=this,e=a(c),g=c.grid;if(!g.hDiv.loading){var l=k.scroll&&!1===b,f={},h,m=k.prmNames;0>=k.page&&(k.page=Math.min(1,k.lastpage));null!==m.search&&
(f[m.search]=k.search);null!==m.nd&&(f[m.nd]=(new Date).getTime());if(isNaN(parseInt(k.rowNum,10))||0>=parseInt(k.rowNum,10))k.rowNum=k.maxRowNum;null!==m.rows&&(f[m.rows]=k.rowNum);null!==m.page&&(f[m.page]=k.page);null!==m.sort&&(f[m.sort]=k.sortname);null!==m.order&&(f[m.order]=k.sortorder);null!==k.rowTotal&&null!==m.totalrows&&(f[m.totalrows]=k.rowTotal);var t=p(k.loadComplete),z=t?k.loadComplete:null,B=0;b=b||1;1<b?null!==m.npage?(f[m.npage]=b,B=b-1,b=1):z=function(a){k.page++;g.hDiv.loading=
!1;t&&k.loadComplete.call(c,a);qa.call(c,b-1)}:null!==m.npage&&delete k.postData[m.npage];if(k.grouping){D.groupingSetup.call(e);var q=k.groupingView,n,A="",G,w,I;for(n=0;n<q.groupField.length;n++){G=q.groupField[n];for(w=0;w<k.colModel.length;w++)I=k.colModel[w],I.name===G&&I.index&&(G=I.index);A+=G+" "+q.groupOrder[n]+", "}f[m.sort]=A+f[m.sort]}F(k.postData,f);var x=k.scroll?c.rows.length-1:1,V=function(){var a=e.width(),b=e.closest(".ui-jqgrid-view").width(),c=e.css("height");b<a&&0===k.reccount?
e.css("height","1px"):"0"!==c&&"0px"!==c&&e.css("height","")},C=function(){var a;if(k.autoresizeOnLoad)D.autoResizeAllColumns.call(e);else for(a=0;a<k.columnsToReResizing.length;a++)D.autoResizeColumn.call(e,k.columnsToReResizing[a]);d(k.columnsToReResizing)},m=function(){E.call(c,"loadComplete",h);C();e.triggerHandler("jqGridAfterLoadComplete",[h]);va.call(c);k.datatype="local";k.datastr=null;ba.call(c);V()},y=function(a){e.triggerHandler("jqGridLoadComplete",[a]);z&&z.call(c,a);C();e.triggerHandler("jqGridAfterLoadComplete",
[a]);l&&g.populateVisible.call(c);1===b&&va.call(c);ba.call(c);V()};if(E.call(c,"beforeRequest"))if(p(k.datatype))k.datatype.call(c,k.postData,"load_"+k.id,x,b,B);else switch(f=k.datatype.toLowerCase(),f){case "json":case "jsonp":case "xml":case "script":a.ajax(F({url:k.url,type:k.mtype,dataType:f,data:r.serializeFeedback.call(v,k.serializeGridData,"jqGridSerializeGridData",k.postData),success:function(a,e,d){if(p(k.beforeProcessing)&&!1===k.beforeProcessing.call(c,a,e,d))va.call(c);else if(la.call(c,
a,x,1<b,B),y(a),k.loadonce||k.treeGrid)k.dataTypeOrg=k.datatype,k.datatype="local"},error:function(a,e,d){p(k.loadError)&&k.loadError.call(c,a,e,d);1===b&&va.call(c)},beforeSend:function(a,b){var e=!0;p(k.loadBeforeSend)&&(e=k.loadBeforeSend.call(c,a,b));void 0===e&&(e=!0);if(!1===e)return!1;ua.call(c)}},r.ajaxOptions,k.ajaxGridOptions));break;case "xmlstring":ua.call(c);h="string"===typeof k.datastr?a.parseXML(k.datastr):k.datastr;la.call(c,h);m();break;case "jsonstring":ua.call(c);h="string"===
typeof k.datastr?r.parse(k.datastr):k.datastr;la.call(c,h);m();break;case "local":case "clientside":ua.call(c),k.datatype="local",f=wa.call(c),la.call(c,f,x,1<b,B),y(f)}}},sa=function(b){var c=this.grid;a(k.cb,c.hDiv)[k.propOrAttr]("checked",b);if(k.frozenColumns)a(k.cb,c.fhDiv)[k.propOrAttr]("checked",b)};A=function(b,c){var e=L("states.hover"),g=L("states.disabled"),l="<td class='ui-pg-button "+g+"'><span class='ui-separator'></span></td>",h="",m="<table "+(ka?"cellspacing='0' ":"")+"style='table-layout:auto;white-space: pre;"+
("left"===k.pagerpos?"margin-right:auto;":"right"===k.pagerpos?"margin-left:auto;":"margin-left:auto;margin-right:auto;")+"' class='ui-pg-table'><tbody><tr>",t="",D,z,B,q,n=function(a,b,c){if(!E.call(v,"onPaging",a,{newPage:b,currentPage:ea(k.page,1),lastPage:ea(k.lastpage,1),currentRowNum:ea(k.rowNum,10),newRowNum:c}))return!1;k.selrow=null;k.multiselect&&(d(k.selarrrow),sa.call(v,!1));d(k.savedRow);return!0};c+="_"+b;D="pg_"+b;z=b+"_left";B=b+"_center";q=b+"_right";a("#"+f(b)).append("<div id='"+
D+"' class='ui-pager-control' role='group'><table "+(ka?"cellspacing='0' ":"")+"class='ui-pg-table' style='width:100%;table-layout:fixed;height:100%;'><tbody><tr><td id='"+z+"' style='text-align:left;'></td><td id='"+B+"' style='text-align:center;white-space:pre;'></td><td id='"+q+"' style='text-align:right;'></td></tr></tbody></table></div>").attr("dir","ltr");D="#"+f(D);if(0<k.rowList.length){t="<td dir='"+fa+"'>";z=R("pgrecs");t+="<select class='"+L("pagerSelect","ui-pg-selbox")+"' role='listbox' "+
(z?"title='"+z+"'":"")+">";for(z=0;z<k.rowList.length;z++)B=k.rowList[z].toString().split(":"),1===B.length&&(B[1]=B[0]),t+='<option role="option" value="'+B[0]+'"'+(ea(k.rowNum,0)===ea(B[0],0)?' selected="selected"':"")+">"+B[1]+"</option>";t+="</select></td>"}"rtl"===fa&&(m+=t);!0===k.pginput&&(h="<td dir='"+fa+"'>"+r.format(R("pgtext")||"","<input class='"+L("pagerInput","ui-pg-input")+"' type='text' size='2' maxlength='7' value='0' role='textbox'/>","<span id='sp_1_"+b+"'>0</span>")+"</td>");
b="#"+f(b);if(!0===k.pgbuttons){B=["first","prev","next","last"];var G=L("pagerButton","ui-pg-button");q=function(a){var b=R("pg"+a);return"<td role='button' tabindex='0' id='"+a+c+"' class='"+G+"' "+(b?"title='"+b+"'":"")+"><span class='"+K("pager."+a)+"'></span></td>"};"rtl"===fa&&B.reverse();for(z=0;z<B.length;z++)m+=q(B[z]),1===z&&(m+=""!==h?l+h+l:"")}else""!==h&&(m+=h);"ltr"===fa&&(m+=t);m+="</tr></tbody></table>";!0===k.viewrecords&&a("td"+b+"_"+k.recordpos,D).append("<span dir='"+fa+"' style='text-align:"+
k.recordpos+"' class='ui-paging-info'></span>");var A=a("td"+b+"_"+k.pagerpos,D);A.append(m);l=Aa.call(this,A.children(".ui-pg-table"));k._nvtd=[];k._nvtd[0]=l?Math.floor((k.width-l)/2):Math.floor(k.width/3);k._nvtd[1]=0;m=null;a(".ui-pg-selbox",D).bind("change",function(){var b=ea(this.value,10),c=Math.round(k.rowNum*(k.page-1)/b-.5)+1;if(!n("records",c,b))return!1;k.page=c;k.rowNum=b;k.pager&&a(".ui-pg-selbox",k.pager).val(b);k.toppager&&a(".ui-pg-selbox",k.toppager).val(b);qa.call(v);return!1});
!0===k.pgbuttons&&(a(".ui-pg-button",D).hover(function(){y(this,g)?this.style.cursor="default":(a(this).addClass(e),this.style.cursor="pointer")},function(){y(this,g)||(a(this).removeClass(e),this.style.cursor="default")}),a("#first"+f(c)+", #prev"+f(c)+", #next"+f(c)+", #last"+f(c)).click(function(){if(y(this,g))return!1;var a=ea(k.page,1),b=a,e=this.id,d=ea(k.lastpage,1),l=!1,f=!0,h=!0,m=!0,t=!0;0===d||1===d?t=m=h=f=!1:1<d&&1<=a?1===a?h=f=!1:a===d&&(t=m=!1):1<d&&0===a&&(t=m=!1,a=d-1);this.id===
"first"+c&&f&&(e="first",b=1,l=!0);this.id==="prev"+c&&h&&(e="prev",b=a-1,l=!0);this.id==="next"+c&&m&&(e="next",b=a+1,l=!0);this.id==="last"+c&&t&&(e="last",b=d,l=!0);if(!n(e,b,ea(k.rowNum,10)))return!1;k.page=b;l&&qa.call(v);return!1}));!0===k.pginput&&a("input.ui-pg-input",D).bind("keypress.jqGrid",function(b){b=b.charCode||b.keyCode||0;var c=ea(a(this).val(),1);if(13===b){if(!n("user",c,ea(k.rowNum,10)))return!1;a(this).val(c);k.page=0<a(this).val()?a(this).val():k.page;qa.call(v);return!1}return this});
A.children(".ui-pg-table").bind("keydown.jqGrid",function(a){13===a.which&&(a=A.find(":focus"),0<a.length&&a.trigger("click"))})};var Ra=function(b,c){var e,d="",g=k.colModel,l=g[b],f=!1,h="",m=L("states.disabled"),t=k.frozenColumns?a(c):a(v.grid.headers[b].el),D=t.find("span.s-ico"),z=D.children("span.ui-icon-asc"),B=D.children("span.ui-icon-desc"),q=z,n=B;t.find("span.ui-grid-ico-sort").addClass(m);t.attr("aria-selected","false");if(l.lso)if("asc"===l.lso)l.lso+="-desc",h="desc",q=B,n=z;else if("desc"===
l.lso)l.lso+="-asc",h="asc";else{if("asc-desc"===l.lso||"desc-asc"===l.lso)l.lso="",k.viewsortcols[0]||D.hide()}else l.lso=h=l.firstsortorder||"asc",q=z,n=B;h&&(D.show(),q.removeClass(m).css("display",""),k.showOneSortIcon&&n.hide(),t.attr("aria-selected","true"));k.sortorder="";N(g,function(a){this.lso&&(0<a&&f&&(d+=", "),e=this.lso.split("-"),d+=g[a].index||g[a].name,d+=" "+e[e.length-1],f=!0,k.sortorder=e[e.length-1])});d=d.substring(0,d.lastIndexOf(k.sortorder));k.sortname=d},Oa=function(b,c,
e,g,l){var h=this.grid,m=L("states.disabled");if(k.colModel[c].sortable&&!(0<k.savedRow.length)){e||(k.lastsort===c&&""!==k.sortname?"asc"===k.sortorder?k.sortorder="desc":"desc"===k.sortorder&&(k.sortorder="asc"):k.sortorder=k.colModel[c].firstsortorder||"asc",k.page=1);if(k.multiSort)Ra(c,l);else{if(g){if(k.lastsort===c&&k.sortorder===g&&!e)return;k.sortorder=g}var v=h.headers;e=h.fhDiv;g=v[k.lastsort]?a(v[k.lastsort].el):a();l=k.frozenColumns?a(l):a(v[c].el);var v=l.find("span.s-ico"),t=k.colModel[k.lastsort],
z=v.children("span.ui-icon-"+k.sortorder),B=v.children("span.ui-icon-"+("asc"===k.sortorder?"desc":"asc"));g.find("span.ui-grid-ico-sort").addClass(m);g.attr("aria-selected","false");k.frozenColumns&&(e.find("span.ui-grid-ico-sort").addClass(m),e.find("th").attr("aria-selected","false"));z.removeClass(m).css("display","");k.showOneSortIcon&&B.removeClass(m).hide();l.attr("aria-selected","true");k.viewsortcols[0]||(k.lastsort!==c?(k.frozenColumns&&e.find("span.s-ico").hide(),g.find("span.s-ico").hide(),
v.show()):""===k.sortname&&v.show());k.lastsort!==c&&"true"===g.data("autoResized")&&(null!=t&&null!=t.autoResizing&&t.autoResizing.compact||k.autoResizing.compact)&&k.columnsToReResizing.push(k.lastsort);k.lastsort!==c&&"true"===l.data("autoResized")&&(t=k.colModel[c],(null!=t&&null!=t.autoResizing&&t.autoResizing.compact||k.autoResizing.compact)&&k.columnsToReResizing.push(c));b=b.substring(5+k.id.length+1);k.sortname=k.colModel[c].index||b}E.call(this,"onSortCol",k.sortname,c,k.sortorder)?("local"===
k.datatype?k.deselectAfterSort&&D.resetSelection.call(a(this)):(k.selrow=null,k.multiselect&&sa.call(this,!1),d(k.selarrrow),d(k.savedRow)),k.scroll&&(m=h.bDiv.scrollLeft,M.emptyRows.call(this,!0,!1),h.hDiv.scrollLeft=m),k.subGrid&&"local"===k.datatype&&a("td.sgexpanded","#"+f(k.id)).each(function(){a(this).trigger("click")}),qa.call(this),k.lastsort=c,k.sortname!==b&&c&&(k.lastsort=c)):k.lastsort=c}},Sa=function(a){var b=a,c;for(c=a+1;c<k.colModel.length;c++)if(!0!==k.colModel[c].hidden){b=c;break}return b-
a},ia;-1===J(k.multikey,["shiftKey","altKey","ctrlKey"])&&(k.multikey=!1);k.keyName=!1;k.sortorder=k.sortorder.toLowerCase();r.cell_width=r.cellWidth();var oa=r.cmTemplate;for(Z=0;Z<k.colModel.length;Z++)ia="string"===typeof k.colModel[Z].template?null==oa||"object"!==typeof oa[k.colModel[Z].template]&&!a.isFunction(oa[k.colModel[Z].template])?{}:oa[k.colModel[Z].template]:k.colModel[Z].template,p(ia)&&(ia=ia.call(v,{cm:k.colModel[Z],iCol:Z})),k.colModel[Z]=F(!0,{},k.cmTemplate,ia||{},k.colModel[Z]),
!1===k.keyName&&!0===k.colModel[Z].key&&(k.keyName=k.colModel[Z].name);!0===k.grouping&&(k.scroll=!1,k.rownumbers=!1,k.treeGrid=!1,k.gridview=!0);if(k.subGrid)try{D.setSubGrid.call(G)}catch(Ua){}!k.multiselect||"left"!==k.multiselectPosition&&"right"!==k.multiselectPosition||(Z="left"===k.multiselectPosition?"unshift":"push",k.colNames[Z]("<input role='checkbox' id='"+k.cbId+"' class='cbox' type='checkbox' aria-checked='false'/>"),k.colModel[Z]({name:"cb",width:r.cell_width?k.multiselectWidth+k.cellLayout:
k.multiselectWidth,labelClasses:"jqgh_cbox",classes:"td_cbox",sortable:!1,resizable:!1,hidedlg:!0,search:!1,align:"center",fixed:!0,frozen:!0}));k.rownumbers&&(k.colNames.unshift(""),k.colModel.unshift({name:"rn",width:r.cell_width?k.rownumWidth+k.cellLayout:k.rownumWidth,labelClasses:"jqgh_rn",classes:"td_rn",sortable:!1,resizable:!1,hidedlg:!0,search:!1,align:"center",fixed:!0,frozen:!0}));k.iColByName=ca(k.colModel);k.xmlReader=F(!0,{root:"rows",row:"row",page:"rows>page",total:"rows>total",records:"rows>records",
repeatitems:!0,cell:"cell",id:"[id]",userdata:"userdata",subgrid:{root:"rows",row:"row",repeatitems:!0,cell:"cell"}},k.xmlReader);k.jsonReader=F(!0,{root:"rows",page:"page",total:"total",records:"records",repeatitems:!0,cell:"cell",id:"id",userdata:"userdata",subgrid:{root:"rows",repeatitems:!0,cell:"cell"}},k.jsonReader);k.localReader=F(!0,{root:"rows",page:"page",total:"total",records:"records",repeatitems:!1,cell:"cell",id:"id",userdata:"userdata",subgrid:{root:"rows",repeatitems:!0,cell:"cell"}},
k.localReader);k.scroll&&(k.pgbuttons=!1,k.pginput=!1,k.rowList=[]);if(!0===k.treeGrid){try{D.setTreeGrid.call(G)}catch(Va){}"local"!==k.datatype&&(k.localReader={id:"_id_"});k.iPropByName=ha(k.additionalProperties)}(function(){var a=k.remapColumns,b=k.colModel,c=b.length,e=[],d,g;for(d=0;d<c;d++)g=b[d].name,0>J(g,k.reservedColumnNames)&&e.push(g);if(null!=a)for(b=e.slice(),d=0;d<a.length;d++)e[d]=b[a[d]];k.cmNamesInputOrder=e})();da();k.data.length&&(Ea.call(v),ma());if(!0===k.shrinkToFit&&!0===
k.forceFit)for(Z=k.colModel.length-1;0<=Z;Z--)if(!0!==k.colModel[Z].hidden){k.colModel[Z].resizable=!1;break}var Ia,Fa,Ga,Ha,ca=[],ha=[];ia=[];var da="<thead><tr class='ui-jqgrid-labels' role='row'>",Ba=L("states.hover"),Ca=L("states.disabled");if(k.multiSort)for(ca=k.sortname.split(","),Z=0;Z<ca.length;Z++)ia=H(ca[Z]).split(" "),ca[Z]=H(ia[0]),ha[Z]=ia[1]?H(ia[1]):k.sortorder||"asc";for(Z=0;Z<k.colNames.length;Z++){H=k.colModel[Z];ia=k.headertitles||H.headerTitle?' title="'+t("string"===typeof H.headerTitle?
H.headerTitle:k.colNames[Z])+'"':"";da+="<th id='"+k.id+"_"+H.name+"' role='columnheader' class='"+L("colHeaders","ui-th-column ui-th-"+fa+" "+(H.labelClasses||""))+"'"+ia+">";ia=H.index||H.name;switch(H.labelAlign){case "left":oa="text-align:left;";break;case "right":oa="text-align:right;"+(!1===H.sortable?"":"padding-right:"+k.autoResizing.widthOfVisiblePartOfSortIcon+"px;");break;case "likeData":oa=void 0===H.align||"left"===H.align?"text-align:left;":"right"===H.align?"text-align:right;"+(!1===
H.sortable?"":"padding-right:"+k.autoResizing.widthOfVisiblePartOfSortIcon+"px;"):"";break;default:oa=""}da+="<div id='jqgh_"+k.id+"_"+H.name+"'"+(x?" class='ui-th-div-ie'":"")+(""===oa?"":" style='"+oa+"'")+">";oa=H.autoResizable&&"actions"!==H.formatter?"<span class='"+k.autoResizing.wrapperClassName+"'>"+k.colNames[Z]+"</span>":k.colNames[Z];k.sortIconsBeforeText?(da+=(k.builderSortIcons||r.builderSortIcons).call(v,Z),da+=oa):(da+=oa,da+=(k.builderSortIcons||r.builderSortIcons).call(v,Z));da+=
"</div></th>";H.width=H.width?parseInt(H.width,10):150;"boolean"!==typeof H.title&&(H.title=!0);H.lso="";ia===k.sortname&&(k.lastsort=Z);k.multiSort&&(ia=J(ia,ca),-1!==ia&&(H.lso=ha[ia]))}G.append(da+"</tr></thead>");a(v.tHead).children("tr").children("th").hover(function(){a(this).addClass(Ba)},function(){a(this).removeClass(Ba)});k.multiselect&&a(k.cb,v).bind("click",function(){d(k.selarrrow);var b=L("states.select"),c,e=[],g=k.iColByName.cb,l=function(c,e){a(c)[e?"addClass":"removeClass"](b).attr(e?
{"aria-selected":"true",tabindex:"0"}:{"aria-selected":"false",tabindex:"-1"});if(void 0!==g)a(c.cells[g]).children("input.cbox")[k.propOrAttr]("checked",e)},f=M.fbRows,h=Ca+" ui-subgrid jqgroup jqfoot jqgfirstrow";this.checked?(c=!0,k.selrow=1<v.rows.length?v.rows[v.rows.length-1].id:null):(c=!1,k.selrow=null);a(v.rows).each(function(a){y(this,h)||(l(this,c),(c?k.selarrrow:e).push(this.id),f&&l(f[a],c))});E.call(v,"onSelectAll",c?k.selarrrow:e,c)}).closest("th.ui-th-column").css("padding","0");!0===
k.autowidth&&(H=Math.floor(a(z).innerWidth()),k.width=0<H?H:"nw");isNaN(k.width)?isNaN(parseFloat(k.width))||(k.width=parseFloat(k.width)):k.width=Number(k.width);k.widthOrg=k.width;(function(){var a=0,b=r.cell_width?0:ea(k.cellLayout,0),c=0,e,d=ea(k.scrollOffset,0),g,l=!1,f,h=0,m,v=r.isCellClassHidden;N(k.colModel,function(){void 0===this.hidden&&(this.hidden=!1);if(k.grouping&&k.autowidth){var e=J(this.name,k.groupingView.groupField);0<=e&&k.groupingView.groupColumnShow.length>e&&(this.hidden=!k.groupingView.groupColumnShow[e])}this.widthOrg=
g=ea(this.width,0);!1!==this.hidden||v(this.classes)||(a+=g+b,this.fixed?h+=g+b:c++)});isNaN(k.width)&&(k.width=a+(!1!==k.shrinkToFit||isNaN(k.height)?0:d));M.width=k.width;k.tblwidth=a;!1===k.shrinkToFit&&!0===k.forceFit&&(k.forceFit=!1);!0===k.shrinkToFit&&0<c&&(f=M.width-b*c-h,isNaN(k.height)||(f-=d,l=!0),a=0,N(k.colModel,function(d){!1!==this.hidden||v(this.classes)||this.fixed||(this.width=g=Math.round(f*this.width/(k.tblwidth-b*c-h)),a+=g,e=d)}),m=0,l?M.width-h-(a+b*c)!==d&&(m=M.width-h-(a+
b*c)-d):l||1===Math.abs(M.width-h-(a+b*c))||(m=M.width-h-(a+b*c)),k.colModel[e].width+=m,k.tblwidth=a+m+b*c+h,k.tblwidth>k.width&&(k.colModel[e].width-=k.tblwidth-parseInt(k.width,10),k.tblwidth=k.width))})();a(z).css("width",M.width+"px").append("<div class='"+L("resizer","ui-jqgrid-resize-mark")+"' id='"+k.rsId+"'> </div>");a(k.rs).bind("selectstart",function(){return!1}).click(P).dblclick(function(b){var c=a(this).data("idx"),e=a(this).data("pageX"),d=k.colModel[c];if(null==e)return!1;var e=
String(e).split(";"),g=parseFloat(e[0]),l=parseFloat(e[1]);if(2===e.length&&(5<Math.abs(g-l)||5<Math.abs(b.pageX-g)||5<Math.abs(b.pageX-l)))return!1;E.call(v,"resizeDblClick",c,d,b)&&null!=d&&d.autoResizable&&D.autoResizeColumn.call(G,c);return!1});a(O).css("width",M.width+"px");var ya="";k.footerrow&&(ya+="<table role='presentation' style='width:"+k.tblwidth+"px' class='ui-jqgrid-ftable'"+(ka?" cellspacing='0'":"")+"><tbody><tr role='row' class='"+L("rowFooter","footrow footrow-"+fa)+"'>");var Da=
"<tr class='jqgfirstrow' role='row' style='height:auto'>";k.disableClick=!1;a("th",v.tHead.rows[0]).each(function(b){var c=k.colModel[b],e=c.name,d=a(this),g=d.children("div"),l=g.children("span.s-ico"),f=k.showOneSortIcon;Ia=c.width;void 0===c.resizable&&(c.resizable=!0);c.resizable?(Fa=document.createElement("span"),a(Fa).html(" ").addClass("ui-jqgrid-resize ui-jqgrid-resize-"+fa).bind("selectstart",function(){return!1}),d.addClass(k.resizeclass)):Fa="";d.css("width",Ia+"px").prepend(Fa);Fa=
null;var h="";!0===c.hidden&&(d.css("display","none"),h="display:none;");Da+="<td role='gridcell' "+(c.classes?"class='"+c.classes+"' ":"")+"style='height:0;width:"+Ia+"px;"+h+"'></td>";M.headers[b]={width:Ia,el:this};Ga=c.sortable;"boolean"!==typeof Ga&&(Ga=c.sortable=!0);"cb"!==e&&"subgrid"!==e&&"rn"!==e&&Ga&&k.viewsortcols[2]&&g.addClass("ui-jqgrid-sortable");Ga&&(k.multiSort?(e="desc"===c.lso?"asc":"desc",k.viewsortcols[0]?(l.show(),c.lso&&(l.children("span.ui-icon-"+c.lso).removeClass(Ca),f&&
l.children("span.ui-icon-"+e).hide())):c.lso&&(l.show(),l.children("span.ui-icon-"+c.lso).removeClass(Ca),f&&l.children("span.ui-icon-"+e).hide())):(c="desc"===k.sortorder?"asc":"desc",k.viewsortcols[0]?(l.show(),b===k.lastsort&&(l.children("span.ui-icon-"+k.sortorder).removeClass(Ca),f&&l.children("span.ui-icon-"+c).hide())):b===k.lastsort&&""!==k.sortname&&(l.show(),l.children("span.ui-icon-"+k.sortorder).removeClass(Ca),f&&l.children("span.ui-icon-"+c).hide())));k.footerrow&&(ya+="<td role='gridcell' "+
xa(b,0,"",null,"",!1)+"> </td>")}).mousedown(function(b){var c=a(this),e=c.closest(".ui-jqgrid-hdiv").hasClass("frozen-div"),d=function(){var b=[c.position().left+c.outerWidth()];"rtl"===k.direction&&(b[0]=k.width-b[0]);b[0]-=e?0:M.bDiv.scrollLeft;b.push(a(M.hDiv).position().top);b.push(a(M.bDiv).offset().top-a(M.hDiv).offset().top+a(M.bDiv).height()+(M.sDiv?a(M.sDiv).height():0));return b},g;if(1===a(b.target).closest("th>span.ui-jqgrid-resize").length)return g=k.iColByName[(this.id||"").substring(k.id.length+
1)],null!=g&&(!0===k.forceFit&&(k.nv=Sa(g)),M.dragStart(g,b,d(),c)),!1}).click(function(b){if(k.disableClick)return k.disableClick=!1;var c="th.ui-th-column>div",e,d,c=k.viewsortcols[2]?c+".ui-jqgrid-sortable":c+">span.s-ico>span.ui-grid-ico-sort";b=a(b.target).closest(c);if(1===b.length)return k.viewsortcols[2]||(e=!0,d=b.hasClass("ui-icon-desc")?"desc":"asc"),b=k.iColByName[(this.id||"").substring(k.id.length+1)],null!=b&&Oa.call(v,a("div",this)[0].id,b,e,d,this),!1});if(k.sortable&&a.fn.sortable)try{D.sortableColumns.call(G,
a(v.tHead.rows[0]))}catch(Wa){}k.footerrow&&(ya+="</tr></tbody></table>");Da+="</tr>";O=document.createElement("tbody");v.appendChild(O);G.addClass(L("grid","ui-jqgrid-btable")).append(Da);var Da=null,O=a("<table class='"+L("hTable","ui-jqgrid-htable")+"' style='width:"+k.tblwidth+"px' role='presentation' aria-labelledby='gbox_"+k.id+"'"+(ka?" cellspacing='0'":"")+"></table>").append(v.tHead),ra=k.caption&&!0===k.hiddengrid?!0:!1,H=a("<div class='ui-jqgrid-hbox"+("rtl"===fa?"-rtl":"")+"'></div>"),
Ja=L("bottom");M.hDiv=document.createElement("div");a(M.hDiv).css({width:M.width+"px"}).addClass(L("hDiv","ui-jqgrid-hdiv")).append(H).scroll(function(){var b=a(this).next(".ui-jqgrid-bdiv")[0];b&&(b.scrollLeft=this.scrollLeft)});a(H).append(O);O=null;ra&&a(M.hDiv).hide();k.rowNum=parseInt(k.rowNum,10);if(isNaN(k.rowNum)||0>=k.rowNum)k.rowNum=k.maxRowNum;k.pager&&("string"===typeof k.pager&&"#"!==k.pager.substr(0,1)?(H=k.pager,O=a("#"+f(k.pager))):!0===k.pager?(H=l(),O=a("<div id='"+H+"'></div>"),
O.appendTo("body"),k.pager="#"+f(H)):(O=a(k.pager),H=O.attr("id")),0<O.length?(O.css({width:M.width+"px"}).addClass(L("pager","ui-jqgrid-pager "+Ja)).appendTo(z),ra&&O.hide(),A.call(v,H,""),k.pager="#"+f(H)):k.pager="");!1===k.cellEdit&&!0===k.hoverrows&&G.bind("mouseover",function(b){Ha=a(b.target).closest("tr.jqgrow");"ui-subgrid"!==a(Ha).attr("class")&&a(Ha).addClass(Ba)}).bind("mouseout",function(b){Ha=a(b.target).closest("tr.jqgrow");a(Ha).removeClass(Ba)});var na,Ka,Pa,La=function(b){var c,
e;do if(c=a(b).closest("td"),0<c.length){b=c.parent();e=b.parent().parent();if(b.is(".jqgrow")&&(e[0]===this||e.is("table.ui-jqgrid-btable")&&(e[0].id||"").replace("_frozen","")===this.id))break;b=c.parent()}while(0<c.length);return c};G.before(M.hDiv).click(function(b){var c=L("states.select"),e=b.target,g=La.call(this,e),l=g.parent();if(0!==l.length&&!y(l,Ca)){na=l[0].id;var h=a(e).hasClass("cbox"),m=E.call(v,"beforeSelectRow",na,b),t=r.detectRowEditing.call(v,na),t=null!=t&&"cellEditing"!==t.mode;
if("A"!==e.tagName&&(!t||h))if(Ka=g[0].cellIndex,Pa=g.html(),E.call(v,"onCellSelect",na,Ka,Pa,b),!0===k.cellEdit)if(k.multiselect&&h&&m)Y.call(G,na,!0,b);else{na=l[0].rowIndex;try{D.editCell.call(G,na,Ka,!0)}catch(z){}}else if(m)if(k.multikey)b[k.multikey]?Y.call(G,na,!0,b):k.multiselect&&h&&(h=a("#jqg_"+f(k.id)+"_"+na).is(":checked"),a("#jqg_"+f(k.id)+"_"+na)[W]("checked",!h));else if(k.multiselect&&k.multiboxonly){if(!h){var B=k.frozenColumns?k.id+"_frozen":"";a(k.selarrrow).each(function(b,e){var d=
D.getGridRowById.call(G,e);d&&a(d).removeClass(c);a("#jqg_"+f(k.id)+"_"+f(e))[k.propOrAttr]("checked",!1);B&&(a("#"+f(e),"#"+f(B)).removeClass(c),a("#jqg_"+f(k.id)+"_"+f(e),"#"+f(B))[k.propOrAttr]("checked",!1))});d(k.selarrrow)}Y.call(G,na,!0,b)}else e=k.selrow,Y.call(G,na,!0,b),"toggle"!==k.singleSelectClickMode||k.multiselect||e!==na||(this.grid.fbRows&&(l=l.add(this.grid.fbRows[na])),l.removeClass(c).attr({"aria-selected":"false",tabindex:"-1"}),k.selrow=null)}}).bind("reloadGrid",function(b,
c){var e=this.grid,g=a(this);!0===k.treeGrid&&(k.datatype=k.treedatatype);c=F({},n.reloadGridOptions||{},k.reloadGridOptions||{},c||{});"local"===k.datatype&&k.dataTypeOrg&&k.loadonce&&c.fromServer&&(k.datatype=k.dataTypeOrg,delete k.dataTypeOrg);c.current&&e.selectionPreserver.call(this);"local"===k.datatype?(D.resetSelection.call(g),k.data.length&&(Ea.call(this),ma())):k.treeGrid||(k.selrow=null,k.iRow=-1,k.iCol=-1,k.multiselect&&(d(k.selarrrow),sa.call(this,!1)),d(k.savedRow));k.scroll&&M.emptyRows.call(this,
!0,!1);if(c.page){var l=parseInt(c.page,10);l>k.lastpage&&(l=k.lastpage);1>l&&(l=1);k.page=l;e.bDiv.scrollTop=e.prevRowHeight?(l-1)*e.prevRowHeight*k.rowNum:0}e.prevRowHeight&&k.scroll&&void 0===c.page?(delete k.lastpage,e.populateVisible.call(this)):e.populate.call(this);!0===k._inlinenav&&g.jqGrid("showAddEditButtons",!1);return!1}).dblclick(function(a){var b=La.call(this,a.target),c=b.parent();if(0<b.length&&!E.call(v,"ondblClickRow",c.attr("id"),c[0].rowIndex,b[0].cellIndex,a))return!1}).bind("contextmenu",
function(a){var b=La.call(this,a.target),c=b.parent(),e=c.attr("id");if(0!==b.length&&(k.multiselect||Y.call(G,e,!0,a),!E.call(v,"onRightClickRow",e,c[0].rowIndex,b[0].cellIndex,a)))return!1});M.bDiv=document.createElement("div");x&&"auto"===String(k.height).toLowerCase()&&(k.height="100%");a(M.bDiv).append(a('<div style="position:relative;'+(ka?"height:0.01%;":"")+'"></div>').append("<div></div>").append(v)).addClass("ui-jqgrid-bdiv").css({height:k.height+(isNaN(k.height)?"":"px"),width:M.width+
"px"}).scroll(M.scrollGrid);G.css({width:k.tblwidth+"px"});a.support.tbody||2===a(">tbody",v).length&&a(">tbody:gt(0)",v).remove();k.multikey&&a(M.bDiv).bind(r.msie?"selectstart":"mousedown",function(){return!1});ra&&a(M.bDiv).hide();M.cDiv=document.createElement("div");var Ma=K("gridMinimize.visible"),Qa=K("gridMinimize.hidden"),x=R("showhide"),Na=!0===k.hidegrid?a("<a role='link' class='"+L("titleButton","ui-jqgrid-titlebar-close")+"'"+(x?" title='"+x+"'":"")+"/>").hover(function(){Na.addClass(Ba)},
function(){Na.removeClass(Ba)}).append("<span class='"+Ma+"'></span>"):"";a(M.cDiv).append("<span class='ui-jqgrid-title'>"+k.caption+"</span>").append(Na).addClass(L("gridTitle","ui-jqgrid-titlebar ui-jqgrid-caption"+("rtl"===fa?"-rtl":"")));a(M.cDiv).insertBefore(M.hDiv);k.toolbar[0]&&(M.uDiv=document.createElement("div"),"top"===k.toolbar[1]?a(M.uDiv).insertBefore(M.hDiv):"bottom"===k.toolbar[1]&&a(M.uDiv).insertAfter(M.hDiv),x=L("toolbarUpper","ui-userdata"),"both"===k.toolbar[1]?(M.ubDiv=document.createElement("div"),
a(M.uDiv).addClass(x).attr("id","t_"+k.id).insertBefore(M.hDiv),a(M.ubDiv).addClass(L("toolbarBottom","ui-userdata")).attr("id","tb_"+k.id).insertAfter(M.hDiv),ra&&a(M.ubDiv).hide()):a(M.uDiv).width(M.width).addClass(x).attr("id","t_"+k.id),ra&&a(M.uDiv).hide());"string"===typeof k.datatype&&(k.datatype=k.datatype.toLowerCase());k.toppager?(k.toppager=k.id+"_toppager",M.topDiv=a("<div id='"+k.toppager+"'></div>")[0],a(M.topDiv).addClass(L("pager","ui-jqgrid-toppager")).css({width:M.width+"px"}).insertBefore(M.hDiv),
A.call(v,k.toppager,"_t"),k.toppager="#"+f(k.toppager)):""!==k.pager||k.scroll||(k.rowNum=k.maxRowNum);k.footerrow&&(M.sDiv=a("<div class='ui-jqgrid-sdiv'></div>")[0],H=a("<div class='ui-jqgrid-hbox"+("rtl"===fa?"-rtl":"")+"'></div>"),a(M.sDiv).append(H).width(M.width).insertAfter(M.hDiv),a(H).append(ya),M.footers=a(".ui-jqgrid-ftable",M.sDiv)[0].rows[0].cells,k.rownumbers&&(M.footers[0].className=L("rowNum","jqgrid-rownum")),ra&&a(M.sDiv).hide());H=null;if(k.caption){var Ta=k.datatype;!0===k.hidegrid&&
(a(".ui-jqgrid-titlebar-close",M.cDiv).click(function(b){var c=".ui-jqgrid-bdiv,.ui-jqgrid-hdiv,.ui-jqgrid-pager,.ui-jqgrid-sdiv",e=this;!0===k.toolbar[0]&&("both"===k.toolbar[1]&&(c+=",#"+f(a(M.ubDiv).attr("id"))),c+=",#"+f(a(M.uDiv).attr("id")));var d=a(c,k.gView).length;k.toppager&&(c+=","+k.toppager);"visible"===k.gridstate?a(c,k.gBox).slideUp("fast",function(){d--;0===d&&(a("span",e).removeClass(Ma).addClass(Qa),k.gridstate="hidden",a(k.gBox).hasClass("ui-resizable")&&a(".ui-resizable-handle",
k.gBox).hide(),a(M.cDiv).addClass(Ja),ra||E.call(v,"onHeaderClick",k.gridstate,b))}):"hidden"===k.gridstate&&(a(M.cDiv).removeClass(Ja),a(c,k.gBox).slideDown("fast",function(){d--;0===d&&(a("span",e).removeClass(Qa).addClass(Ma),ra&&(k.datatype=Ta,qa.call(v),ra=!1),k.gridstate="visible",a(k.gBox).hasClass("ui-resizable")&&a(".ui-resizable-handle",k.gBox).show(),ra||E.call(v,"onHeaderClick",k.gridstate,b))}));return!1}),ra&&(k.datatype="local",a(".ui-jqgrid-titlebar-close",M.cDiv).trigger("click")))}else a(M.cDiv).hide(),
a(M.cDiv).nextAll("div:visible").first().addClass("ui-corner-top");a(M.hDiv).after(M.bDiv);a(z).click(P).dblclick(function(b){var c=a(k.rs),e=c.offset(),d=c.data("idx"),g=c.data("delta"),l=k.colModel[d],f=a(this).data("pageX")||c.data("pageX");if(null==f)return!1;var f=String(f).split(";"),h=parseFloat(f[0]),m=parseFloat(f[1]);if(2===f.length&&(5<Math.abs(h-m)||5<Math.abs(b.pageX-h)||5<Math.abs(b.pageX-m)))return!1;E.call(v,"resizeDblClick",d,l)&&e.left-1<=b.pageX+g&&b.pageX+g<=e.left+c.outerWidth()+
1&&null!=l&&l.autoResizable&&D.autoResizeColumn.call(G,d);return!1});k.pager||a(M.cDiv).nextAll("div:visible").filter(":last").addClass(Ja);a(".ui-jqgrid-labels",M.hDiv).bind("selectstart",function(){return!1});v.formatCol=xa;v.sortData=Oa;v.updatepager=function(b,e){var d=this,g=a(d),l=d.grid,f,h,m,v,t,z,D=k.pager||"",B=k.pager?"_"+k.pager.substr(1):"";f=l.bDiv;var q=a.fmatter?a.fmatter.NumberFormat:null,n=k.toppager?"_"+k.toppager.substr(1):"",A=L("states.hover"),p=L("states.disabled");h=parseInt(k.page,
10)-1;0>h&&(h=0);h*=parseInt(k.rowNum,10);v=h+k.reccount;if(k.scroll){z=a(c(21,f)[0].rows).slice(1);h=v-z.length;k.reccount=z.length;if(z=z.outerHeight()||l.prevRowHeight)m=h*z,t=r.fixMaxHeightOfDiv.call(d,parseInt(k.records,10)*z),a(f).children("div").first().css({height:t+"px"}).children("div").first().css({height:m+"px",display:m+"px"?"":"none"}),0===f.scrollTop&&1<k.page&&(f.scrollTop=k.rowNum*(k.page-1)*z);f.scrollLeft=l.hDiv.scrollLeft}if(D+=k.toppager?(D?",":"")+k.toppager:"")z=X.call(G,"formatter.integer")||
{},l=ea(k.page),f=ea(k.lastpage),a(".selbox",D)[W]("disabled",!1),!0===k.pginput&&(a(".ui-pg-input",D).val(k.page),m=k.toppager?"#sp_1"+B+",#sp_1"+n:"#sp_1"+B,a(m).html(a.fmatter?q(k.lastpage,z):k.lastpage).closest(".ui-pg-table").each(function(){Aa.call(d,a(this))})),k.viewrecords&&(0===k.reccount?a(".ui-paging-info",D).html(R("emptyrecords")):(m=h+1,t=k.records,a.fmatter&&(m=q(m,z),v=q(v,z),t=q(t,z)),a(".ui-paging-info",D).html(r.format(R("recordtext"),m,v,t)))),!0===k.pgbuttons&&(0>=l&&(l=f=0),
1===l||0===l?(a("#first"+B+", #prev"+B).addClass(p).removeClass(A),k.toppager&&a("#first_t"+n+", #prev_t"+n).addClass(p).removeClass(A)):(a("#first"+B+", #prev"+B).removeClass(p),k.toppager&&a("#first_t"+n+", #prev_t"+n).removeClass(p)),l===f||0===l?(a("#next"+B+", #last"+B).addClass(p).removeClass(A),k.toppager&&a("#next_t"+n+", #last_t"+n).addClass(p).removeClass(A)):(a("#next"+B+", #last"+B).removeClass(p),k.toppager&&a("#next_t"+n+", #last_t"+n).removeClass(p)));!0===b&&!0===k.rownumbers&&a(">td.jqgrid-rownum",
d.rows).each(function(b){a(this).html(h+1+b)});e&&k.jqgdnd&&g.jqGrid("gridDnD","updateDnD");E.call(d,"gridComplete");g.triggerHandler("jqGridAfterGridComplete")};v.refreshIndex=ma;v.setHeadCheckBox=sa;v.fixScrollOffsetAndhBoxPadding=ba;v.constructTr=function(b,c,e,d,g,l){var f="-1",h="",m,v=c?"display:none;":"";e=L("gridRow","jqgrow ui-row-"+k.direction)+(e?" "+e:"")+(l?" "+L("states.select"):"");l=a(this).triggerHandler("jqGridRowAttr",[d,g,b]);"object"!==typeof l&&(l=p(k.rowattr)?k.rowattr.call(this,
d,g,b):"string"===typeof k.rowattr&&null!=r.rowattr&&p(r.rowattr[k.rowattr])?r.rowattr[k.rowattr].call(this,d,g,b):{});if(null!=l&&!a.isEmptyObject(l)){l.hasOwnProperty("id")&&(b=l.id,delete l.id);l.hasOwnProperty("tabindex")&&(f=l.tabindex,delete l.tabindex);l.hasOwnProperty("style")&&(v+=l.style,delete l.style);l.hasOwnProperty("class")&&(e+=" "+l["class"],delete l["class"]);try{delete l.role}catch(t){}for(m in l)l.hasOwnProperty(m)&&(h+=" "+m+"="+l[m])}k.treeGrid&&parseInt(d[k.treeReader.level_field],
10)!==parseInt(k.tree_root_level,10)&&(((d=D.getNodeParent.call(a(this),d))&&d.hasOwnProperty(k.treeReader.expanded_field)?d[k.treeReader.expanded_field]:1)||c||(v+="display:none;"));return'<tr role="row" id="'+b+'" tabindex="'+f+'" class="'+e+'"'+(""===v?"":' style="'+v+'"')+h+">"};v.formatter=function(b,c,d,g,l,f){var h=k.colModel[d];if(void 0!==h.formatter){b=""!==String(k.idPrefix)?e(k.idPrefix,b):b;var m={rowId:b,colModel:h,gid:k.id,pos:d,rowData:f};c=p(h.cellBuilder)?h.cellBuilder.call(v,c,
m,g,l):p(h.formatter)?h.formatter.call(v,c,m,g,l):a.fmatter?a.fn.fmatter.call(v,h.formatter,c,m,g,l):ga(c)}else c=ga(c);c=h.autoResizable&&"actions"!==h.formatter?"<span class='"+k.autoResizing.wrapperClassName+"'>"+c+"</span>":c;k.treeGrid&&"edit"!==l&&(void 0===k.ExpandColumn&&0===d||k.ExpandColumn===h.name)&&(null==f&&(f=k.data[k._index[b]]),b=parseInt(f[k.treeReader.level_field]||0,10),b=0===parseInt(k.tree_root_level,10)?b:b-1,d=f[k.treeReader.leaf_field],l=f[k.treeReader.expanded_field],f=f[k.treeReader.icon_field],
c="<div class='tree-wrap tree-wrap-"+k.direction+"' style='width:"+18*(b+1)+"px;'><div class='"+q(k.treeIcons.commonIconClass,d?(void 0!==f&&""!==f?f:k.treeIcons.leaf)+" tree-leaf":l?k.treeIcons.minus+" tree-minus":k.treeIcons.plus+" tree-plus","treeclick")+"' style='"+(!0===k.ExpandColClick?"cursor:pointer;":"")+("rtl"===k.direction?"right:":"left:")+18*b+"px;'></div></div><span class='cell-wrapper"+(d?"leaf":"")+"'"+(k.ExpandColClick?" style='cursor:pointer;'":"")+">"+c+"</span>");return c};F(M,
{populate:qa,emptyRows:function(b,c){var e=M.bDiv,g=null!=M.fbDiv?M.fbDiv.children(".ui-jqgrid-btable")[0]:null,l=function(b){if(b){var c=b.rows;if(k.deepempty)c&&a(c).slice(1).remove();else if(k.quickEmpty)for(;1<c.length;)b.deleteRow(c.length-1);else c=c[0],a(b.firstChild).empty().append(c)}};a(this).unbind(".jqGridFormatter");l(this);l(g);b&&k.scroll&&(a(e.firstChild).css({height:"auto"}),a(e.firstChild.firstChild).css({height:0,display:"none"}),0!==e.scrollTop&&(e.scrollTop=0));!0===c&&k.treeGrid&&
(d(k.data),d(k.lastSelectedData),k._index={});k.rowIndexes={};k.iRow=-1;k.iCol=-1},beginReq:ua,endReq:va});v.addXmlData=la;v.addJSONData=la;v.rebuildRowIndexes=ja;v.grid.cols=v.rows[0].cells;E.call(v,"onInitGrid");k.treeGrid&&"local"===k.datatype&&null!=k.data&&0<k.data.length&&(k.datatype="jsonstring",k.datastr=k.data,k.data=[]);qa.call(v);k.hiddengrid=!1}}}})};var C=a.fn.jqGrid;r.extend({getGridRes:function(b){var c=this[0];if(!c||!c.grid||!c.p)return null;c=r.getRes(u[c.p.locale],b)||r.getRes(u["en-US"],
b);b=r.getRes(r,b);return"object"!==typeof c||null===c||a.isArray(c)?void 0!==b?b:c:a.extend(!0,{},c,b||{})},getGuiStyles:function(b,c){var e=this instanceof a&&0<this.length?this[0]:this;return e&&e.grid&&e.p?r.mergeCssClasses(r.getRes(r.guiStyles[e.p.guiStyle||r.defaults.guiStyle||"jQueryUI"],b),c||""):""},getGridParam:function(a){var b=this[0];return b&&b.grid?a?void 0!==b.p[a]?b.p[a]:null:b.p:null},setGridParam:function(b,c){return this.each(function(){null==c&&(c=!1);this.grid&&"object"===typeof b&&
(!0===c?this.p=a.extend({},this.p,b):a.extend(!0,this.p,b))})},getGridRowById:function(b){if(null==b)return null;var c,e=b.toString();this.each(function(){var d,l=this.rows,g;null!=this.p.rowIndexes&&(g=this.p.rowIndexes[e],(g=l[g])&&g.id===e&&(c=g));if(!c)try{for(d=l.length;d--;)if(g=l[d],e===g.id){c=g;break}}catch(h){c=a(this.grid.bDiv).find("#"+f(b)),c=0<c.length?c[0]:null}});return c},getDataIDs:function(){var b=[];this.each(function(){var c=this.rows,e=c.length,d,g;if(e&&0<e)for(d=0;d<e;d++)g=
c[d],a(g).hasClass("jqgrow")&&b.push(g.id)});return b},setSelection:function(b,c,e){return this.each(function(){function d(b,c){var e=c.clientHeight,g=c.scrollTop,l=a(b).position().top,f=b.clientHeight;l+f>=e+g?c.scrollTop=l-(e+g)+f+g:l<e+g&&l<g&&(c.scrollTop=l)}var g=a(this),l=this.p,f,h,m,t=C.getGuiStyles;m=C.getGridRowById;var n=t.call(g,"states.select"),q=t.call(g,"states.disabled"),A=this.grid.fbRows,t=function(b,c){var e=c?"addClass":"removeClass",d=l.iColByName.cb,g=c?{"aria-selected":"true",
tabindex:"0"}:{"aria-selected":"false",tabindex:"-1"},f=function(b){a(b)[e](n).attr(g);if(void 0!==d)a(b.cells[d]).children("input.cbox")[l.propOrAttr]("checked",c)};f(b);A&&f(A[b.rowIndex])};void 0!==b&&(c=!1===c?!1:!0,null!=e&&(h=a(e.target).closest("tr.jqgrow"),0<h.length&&(f=h[0],A&&(f=this.rows[f.rowIndex]))),null==f&&(f=m.call(g,b)),!f||!f.className||-1<f.className.indexOf(q)||(!0===l.scrollrows&&(h=m.call(g,b),null!=h&&(h=h.rowIndex,0<=h&&d(this.rows[h],this.grid.bDiv))),l.multiselect?(this.setHeadCheckBox(!1),
l.selrow=f.id,m=a.inArray(l.selrow,l.selarrrow),-1===m?(g=!0,l.selarrrow.push(l.selrow)):null!==r.detectRowEditing.call(this,f.id)?g=!0:(g=!1,l.selarrrow.splice(m,1),m=l.selarrrow[0],l.selrow=void 0===m?null:m),"ui-subgrid"!==f.className&&t(f,g),c&&E.call(this,"onSelectRow",f.id,g,e)):"ui-subgrid"!==f.className&&(l.selrow!==f.id?(null!==l.selrow&&(g=m.call(g,l.selrow))&&t(g,!1),t(f,!0),g=!0):g=!1,l.selrow=f.id,c&&E.call(this,"onSelectRow",f.id,g,e))))})},resetSelection:function(b){return this.each(function(){var c=
a(this),e=this.p,g=C.getGuiStyles,l=C.getGridRowById,f=g.call(c,"states.select"),h="edit-cell "+f,g="selected-row "+g.call(c,"states.hover"),m=e.iColByName.cb,t=void 0!==m,n=this.grid.fbRows,q=function(b){var c={"aria-selected":"false",tabindex:"-1"};a(b).removeClass(f).attr(c);if(t)a(b.cells[m]).children("input.cbox")[e.propOrAttr]("checked",!1);if(n&&(b=n[b.rowIndex],a(b).removeClass(f).attr(c),t))a(b.cells[m]).children("input.cbox")[e.propOrAttr]("checked",!1)};void 0!==b?(c=l.call(c,b),q(c),t&&
(this.setHeadCheckBox(!1),c=a.inArray(b,e.selarrrow),-1!==c&&e.selarrrow.splice(c,1))):e.multiselect?(a(this.rows).each(function(){var b=a.inArray(this.id,e.selarrrow);-1!==b&&(q(this),e.selarrrow.splice(b,1))}),this.setHeadCheckBox(!1),d(e.selarrrow),e.selrow=null):e.selrow&&(c=l.call(c,e.selrow),q(c),e.selrow=null);!0===e.cellEdit&&0<=parseInt(e.iCol,10)&&0<=parseInt(e.iRow,10)&&(c=this.rows[e.iRow],null!=c&&(a(c.cells[e.iCol]).removeClass(h),a(c).removeClass(g)),n&&(c=n[e.iRow],null!=c&&(a(c.cells[e.iCol]).removeClass(h),
a(c).removeClass(g))));d(e.savedRow)})},getRowData:function(b,c){var d={},g;"object"===typeof b&&(c=b,b=void 0);c=c||{};this.each(function(){var l=this.p,f=!1,h,m=2,t=0,n=this.rows,q,p,w,r,E;if(void 0===b)f=!0,g=[],m=n.length;else if(h=C.getGridRowById.call(a(this),b),!h)return d;for(;t<m;){f&&(h=n[t]);if(a(h).hasClass("jqgrow")){p=a("td[role=gridcell]",h);for(q=0;q<p.length;q++)if(w=l.colModel[q],r=w.name,!("cb"===r||"subgrid"===r||"rn"===r||"actions"===w.formatter||c.skipHidden&&w.hidden))if(E=
p[q],!0===l.treeGrid&&r===l.ExpandColumn)d[r]=A(a("span",E).first().html());else try{d[r]=a.unformat.call(this,E,{rowId:h.id,colModel:w},q)}catch(y){d[r]=A(a(E).html())}!c.includeId||!1!==l.keyName&&null!=d[l.keyName]||(d[l.prmNames.id]=e(l.idPrefix,h.id));f&&(g.push(d),d={})}t++}});return g||d},delRowData:function(b){var c=!1,d,g,l;this.each(function(){var f=this.p;d=C.getGridRowById.call(a(this),b);if(!d)return!1;f.subGrid&&(l=a(d).next(),l.hasClass("ui-subgrid")&&l.remove());a(d).remove();f.records--;
f.reccount--;this.updatepager(!0,!1);c=!0;f.multiselect&&(g=a.inArray(b,f.selarrrow),-1!==g&&f.selarrrow.splice(g,1));f.multiselect&&0<f.selarrrow.length?f.selrow=f.selarrrow[f.selarrrow.length-1]:f.selrow===b&&(f.selrow=null);if("local"===f.datatype){var h=e(f.idPrefix,b),h=f._index[h];void 0!==h&&(f.data.splice(h,1),this.refreshIndex())}this.rebuildRowIndexes();if(!0===f.altRows&&c){var m=f.altclass,t=this.grid.fbRows;a(this.rows).each(function(b){var c=a(this);t&&(c=c.add(t[this.rowIndex]));c[0===
b%2?"addClass":"removeClass"](m)})}E.call(this,"afterDelRow",b)});return c},setRowData:function(b,c,d){var l=!0;this.each(function(){var f=this,h=f.p,q,n,A=typeof d,p={};if(!f.grid)return!1;n=C.getGridRowById.call(a(f),b);if(!n)return!1;if(c)try{var w=e(h.idPrefix,b),r,y=h._index[w],u=null!=y?h.data[y]:void 0;a(h.colModel).each(function(e){var d=this.name,l;l=m(c,d);void 0!==l&&("local"===h.datatype&&null!=u&&(q=g.call(f,l,this,u[d],w,u,e),a.isFunction(this.saveLocally)?this.saveLocally.call(f,{newValue:q,
newItem:p,oldItem:u,id:w,cm:this,cmName:d,iCol:e}):p[d]=q),q=f.formatter(b,l,e,c,"edit"),l=this.title?{title:t(q)}:{},e=a(n.cells[e]),!0===h.treeGrid&&d===h.ExpandColumn&&(e=e.children("span.cell-wrapperleaf,span.cell-wrapper").first()),e.html(q).attr(l))});if("local"===h.datatype){if(h.treeGrid)for(r in h.treeReader)h.treeReader.hasOwnProperty(r)&&delete p[h.treeReader[r]];void 0!==u&&(h.data[y]=a.extend(!0,u,p));p=null}E.call(f,"afterSetRow",{rowid:b,inputData:c,iData:y,iRow:n.rowIndex,tr:n,localData:p,
cssProp:d})}catch(X){l=!1}l&&("string"===A?a(n).addClass(d):null!==d&&"object"===A&&a(n).css(d),a(f).triggerHandler("jqGridAfterGridComplete"))});return l},addRowData:function(b,c,e,d){0>a.inArray(e,"first last before after afterSelected beforeSelected".split(" "))&&(e="last");var f=!1,h,t,q,n,A,p,w,y,u,X,T;c&&(a.isArray(c)?(p=!0,w=b):(c=[c],p=!1),this.each(function(){var x=this.p,O=c.length,aa=a(this),Q=this.rows,K=0,L=C.getGridRowById,k=x.colModel,R={},W=x.additionalProperties;p||(void 0!==b?b=
String(b):(b=l(),!1!==x.keyName&&(w=x.keyName,void 0!==c[0][w]&&(b=c[0][w]))));for(y=x.altclass;K<O;){u=c[K];t=[];if(p)try{b=u[w],void 0===b&&(b=l())}catch(ba){b=l()}T=b;for(n=0;n<k.length;n++)X=k[n],h=X.name,"rn"!==h&&"cb"!==h&&"subgrid"!==h&&(A=g.call(this,u[h],X,void 0,T,{},n),a.isFunction(X.saveLocally)?X.saveLocally.call(this,{newValue:A,newItem:R,oldItem:{},id:T,cm:X,cmName:h,iCol:n}):void 0!==A&&(R[h]=A));for(n=0;n<W.length;n++)A=m(u,W[n]),void 0!==A&&(R[W[n]]=A);"local"===x.datatype&&(R[x.localReader.id]=
T,x._index[T]=x.data.length,x.data.push(R));t=r.parseDataToHtml.call(this,1,[b],[u]);t=t.join("");if(0===Q.length)a("table:first",this.grid.bDiv).append(t);else{if("afterSelected"===e||"beforeSelected"===e)void 0===d&&null!==x.selrow?(d=x.selrow,e="afterSelected"===e?"after":"before"):e="afterSelected"===e?"last":"first";switch(e){case "last":a(Q[Q.length-1]).after(t);q=Q.length-1;break;case "first":a(Q[0]).after(t);q=1;break;case "after":if(q=L.call(aa,d))a(Q[q.rowIndex+1]).hasClass("ui-subgrid")?
(a(Q[q.rowIndex+1]).after(t),q=q.rowIndex+2):(a(q).after(t),q=q.rowIndex+1);break;case "before":if(q=L.call(aa,d))a(q).before(t),q=q.rowIndex-1}}!0===x.subGrid&&C.addSubGrid.call(aa,x.iColByName.subgrid,q);x.records++;x.reccount++;0===x.lastpage&&(x.lastpage=1);E.call(this,"afterAddRow",{rowid:b,inputData:c,position:e,srcRowid:d,iRow:q,localData:R,iData:x.data.length-1});K++}!0!==x.altRows||p||("last"===e?0===(Q.length-1)%2&&a(Q[Q.length-1]).addClass(y):a(Q).each(function(b){1===b%2?a(this).addClass(y):
a(this).removeClass(y)}));this.rebuildRowIndexes();this.updatepager(!0,!0);f=!0}));return f},footerData:function(b,c,e){function d(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}var l,g=!1,f={},h;null==b&&(b="get");"boolean"!==typeof e&&(e=!0);b=b.toLowerCase();this.each(function(){var m=this,q=m.p,n;if(!m.grid||!q.footerrow||"set"===b&&d(c))return!1;g=!0;a(q.colModel).each(function(d){l=this.name;"set"===b?void 0!==c[l]&&(n=e?m.formatter("",c[l],d,c,"edit"):c[l],h=this.title?{title:t(n)}:
{},a("tr.footrow td:eq("+d+")",m.grid.sDiv).html(n).attr(h),g=!0):"get"===b&&(f[l]=a("tr.footrow td:eq("+d+")",m.grid.sDiv).html())})});return"get"===b?f:g},showHideCol:function(b,c){return this.each(function(){var e=this,d=a(e),l=e.grid,g=!1,f=e.p,h=r.cell_width?0:f.cellLayout,m;if(l){"string"===typeof b&&(b=[b]);c="none"!==c?"":"none";var t=""===c?!0:!1,q=f.groupHeader;(q=q&&("object"===typeof q||a.isFunction(q)))&&C.destroyGroupHeader.call(d,!1);a(f.colModel).each(function(d){if(-1!==a.inArray(this.name,
b)&&this.hidden===t){if(!0===f.frozenColumns&&!0===this.frozen)return!0;a("tr[role=row]",l.hDiv).each(function(){a(this.cells[d]).css("display",c)});a(e.rows).each(function(){var b=this.cells[d];(!a(this).hasClass("jqgroup")||null!=b&&1===b.colSpan)&&a(b).css("display",c)});f.footerrow&&a("tr.footrow td:eq("+d+")",l.sDiv).css("display",c);m=parseInt(this.width,10);f.tblwidth="none"===c?f.tblwidth-(m+h):f.tblwidth+(m+h);this.hidden=!t;g=!0;E.call(e,"onShowHideCol",t,this.name,d)}});!0===g&&C.setGridWidth.call(d,
(f.autowidth||void 0!==f.widthOrg&&"auto"!==f.widthOrg&&"100%"!==f.widthOrg?f.width:f.tblwidth)+parseInt(f.scrollOffset,10));if(q)if(null!=f.pivotOptions&&null!=f.pivotOptions.colHeaders&&1<f.pivotOptions.colHeaders.length)for(var n=f.pivotOptions.colHeaders,q=0;q<n.length;q++)n[q]&&n[q].groupHeaders.length&&C.setGroupHeaders.call(d,n[q]);else C.setGroupHeaders.call(d,f.groupHeader)}})},hideCol:function(b){return this.each(function(){C.showHideCol.call(a(this),b,"none")})},showCol:function(b){return this.each(function(){C.showHideCol.call(a(this),
b,"")})},remapColumns:function(b,c,e){function d(c){var e=c.length?t(c):a.extend({},c);a.each(b,function(a){c[a]=e[this]})}function l(c,e){(e?c.children(e):c.children()).each(function(){var c=this,e=t(c.cells);a.each(b,function(a){var b=e[this],d=c.cells[a];b.cellIndex!==a&&b.parentNode.insertBefore(b,d)})})}var g=this[0],f=g.p,h=g.grid,m,t=a.makeArray;if(null!=h&&null!=f){d(f.colModel);d(f.colNames);d(h.headers);l(a(h.hDiv).find(">div>.ui-jqgrid-htable>thead"),e&&":not(.ui-jqgrid-labels)");c&&l(a(g.tBodies[0]),
"tr.jqgfirstrow,tr.jqgrow,tr.jqfoot");f.footerrow&&l(a(h.sDiv).find(">div>.ui-jqgrid-ftable>tbody").first());f.remapColumns&&(f.remapColumns.length?d(f.remapColumns):f.remapColumns=t(b));f.lastsort=a.inArray(f.lastsort,b);f.iColByName={};h=0;for(m=f.colModel.length;h<m;h++)f.iColByName[f.colModel[h].name]=h;E.call(g,"onRemapColumns",b,c,e)}},remapColumnsByName:function(b,c,e){var d=this[0].p,l=[],g,f;b=b.slice();g=a.inArray;d.subGrid&&0>g("subgrid",b)&&b.unshift("subgrid");d.multiselect&&0>g("cb",
b)&&b.unshift("cb");d.rownumbers&&0>g("rn",b)&&b.unshift("rn");g=0;for(f=b.length;g<f;g++)l.push(d.iColByName[b[g]]);C.remapColumns.call(this,l,c,e);return this},setGridWidth:function(b,e){return this.each(function(){var d=this.p,g,l=this.grid,f=0,h,m=0,t=!1,q,n=0,A=r.isCellClassHidden;if(l&&null!=d){this.fixScrollOffsetAndhBoxPadding();var p=d.colModel,w=d.scrollOffset,C=r.cell_width?0:d.cellLayout,y=l.headers,x=l.footers,E=l.bDiv,u=l.hDiv,Q=l.sDiv,K=l.cols,L,k,R=a(u).find(">div>.ui-jqgrid-htable>thead>tr").first()[0].cells,
W=function(b){l.width=d.width=b;a(d.gBox).css("width",b+"px");a(d.gView).css("width",b+"px");a(E).css("width",b+"px");a(u).css("width",b+"px");d.pager&&a(d.pager).css("width",b+"px");d.toppager&&a(d.toppager).css("width",b+"px");!0===d.toolbar[0]&&(a(l.uDiv).css("width",b+"px"),"both"===d.toolbar[1]&&a(l.ubDiv).css("width",b+"px"));d.footerrow&&a(Q).css("width",b+"px")};"boolean"!==typeof e&&(e=d.shrinkToFit);if(!isNaN(b)){b=parseInt(b,10);W(b);!1===e&&!0===d.forceFit&&(d.forceFit=!1);if(!0===e){a.each(p,
function(){!1!==this.hidden||A(this.classes)||(g=this.widthOrg,f+=g+C,this.fixed?n+=this.width+C:m++)});if(0===m)return;d.tblwidth=parseInt(f,10);q=b-C*m-n;!isNaN(d.height)&&(E.clientHeight<E.scrollHeight||1===this.rows.length)&&(t=!0,q-=w);k=q/(d.tblwidth-C*m-n);if(0>k)return;f=0;L=0<K.length;a.each(p,function(a){!1!==this.hidden||A(this.classes)||this.fixed||(this.width=g=Math.round(this.widthOrg*k),f+=g,y[a].width=g,R[a].style.width=g+"px",d.footerrow&&(x[a].style.width=g+"px"),L&&(K[a].style.width=
g+"px"),h=a)});if(!h)return;q=0;t?b-n-(f+C*m)!==w&&(q=b-n-(f+C*m)-w):1!==Math.abs(b-n-(f+C*m))&&(q=b-n-(f+C*m));p=p[h];p.width+=q;d.tblwidth=parseInt(f+q+C*m+n,10);d.tblwidth>b&&(q=d.tblwidth-parseInt(b,10),d.tblwidth=b,p.width-=q);g=p.width;q=y[h];q.width=g;R[h].style.width=g+"px";L&&(K[h].style.width=g+"px");d.footerrow&&(x[h].style.width=g+"px");d.tblwidth+(t?w:0)<d.width&&W(d.tblwidth+(t?w:0));E.offsetWidth>E.clientWidth&&(d.autowidth||void 0!==d.widthOrg&&"auto"!==d.widthOrg&&"100%"!==d.widthOrg||
W(E.offsetWidth))}d.tblwidth&&(d.tblwidth=parseInt(d.tblwidth,10),b=d.tblwidth,a(this).css("width",b+"px"),c(14,u).css("width",b+"px"),u.scrollLeft=E.scrollLeft,d.footerrow&&c(27,Q).css("width",b+"px"),q=Math.abs(b-d.width),d.shrinkToFit&&!e&&3>q&&0<q&&(b<d.width&&W(b),E.offsetWidth>E.clientWidth&&(d.autowidth||void 0!==d.widthOrg&&"auto"!==d.widthOrg&&"100%"!==d.widthOrg||W(E.offsetWidth))));this.fixScrollOffsetAndhBoxPadding();a(this).triggerHandler("jqGridResetFrozenHeights")}}})},setGridHeight:function(b){return this.each(function(){var c=
this.grid,e=this.p;if(c){var d=a(c.bDiv);d.css({height:b+(isNaN(b)?"":"px")});!0===e.frozenColumns&&a(e.idSel+"_frozen").parent().height(d.height()-16);e.height=b;e.scroll&&c.populateVisible.call(this);this.fixScrollOffsetAndhBoxPadding();a(this).triggerHandler("jqGridResetFrozenHeights")}})},setCaption:function(b){return this.each(function(){var c=this.grid.cDiv;this.p.caption=b;a("span.ui-jqgrid-title, span.ui-jqgrid-title-rtl",c).html(b);a(c).show();a(c).nextAll("div").removeClass(C.getGuiStyles.call(this,
"top"));a(this).triggerHandler("jqGridResetFrozenHeights")})},setLabel:function(b,c,e,d){return this.each(function(){var g,l=this.p;if(this.grid){if(isNaN(b)){if(g=l.iColByName[b],void 0===g)return}else g=parseInt(b,10);if(0<=g){var f=a("tr.ui-jqgrid-labels th:eq("+g+")",this.grid.hDiv);if(c){var h=a(".s-ico",f);a("[id^=jqgh_]",f).empty().html(c).append(h);l.colNames[g]=c}e&&("string"===typeof e?a(f).addClass(e):a(f).css(e));"object"===typeof d&&a(f).attr(d)}}})},setCell:function(b,c,d,l,f,h){return this.each(function(){var m=
this.p,q=-1,n=m.colModel,p,w,E,y,u,X,T,x={},O;if(this.grid&&(q=isNaN(c)?m.iColByName[c]:parseInt(c,10),0<=q&&(y=C.getGridRowById.call(a(this),b)))){u=r.getCell.call(this,y,q);if(""!==d||!0===h){w=n[q];"local"===m.datatype&&(O=e(m.idPrefix,b),p=m._index[O],void 0!==p&&(E=m.data[p]));if(null==E)for(p=0;p<y.cells.length;p++){if(p!==q&&(X=r.getDataFieldOfCell.call(this,y,p),0<X.length)){try{T=a.unformat.call(this,X,{rowId:b,colModel:n[p]},p)}catch(aa){T=A(X[0].innerHTML)}x[n[p].name]=T}}else x=E;x[w.name]=
d;n=this.formatter(b,d,q,x,"edit");m=m.colModel[q].title?{title:t(n)}:{};u.html(n).attr(m);null!=E&&(n=g.call(this,d,w,E[w.name],O,E,q),a.isFunction(w.saveLocally)?w.saveLocally.call(this,{newValue:n,newItem:E,oldItem:E,id:O,cm:w,cmName:w.name,iCol:q}):E[w.name]=n)}if(l||f){u=r.getCell.call(this,y,q);if(l)u["string"===typeof l?"addClass":"css"](l);"object"===typeof f&&u.attr(f)}}})},getCell:function(b,c){var e=!1;this.each(function(){var d,g=this.p,l,f;if(this.grid&&(d=isNaN(c)?g.iColByName[c]:parseInt(c,
10),0<=d&&(l=C.getGridRowById.call(a(this),b)))){f=r.getDataFieldOfCell.call(this,l,d).first();try{e=a.unformat.call(this,f,{rowId:l.id,colModel:g.colModel[d]},d)}catch(h){e=A(f.html())}}});return e},getCol:function(b,c,e){var d=[],g,l=0,f,h,m;c="boolean"!==typeof c?!1:c;void 0===e&&(e=!1);this.each(function(){var t,q=this.p,n;if(this.grid&&(t=isNaN(b)?q.iColByName[b]:parseInt(b,10),0<=t)){var p=this.rows,w=p.length,C=0,E=0,x;if(w&&0<w){for(;C<w;){x=p[C];if(a(x).hasClass("jqgrow")){n=r.getDataFieldOfCell.call(this,
x,t).first();try{g=a.unformat.call(this,n,{rowId:x.id,colModel:q.colModel[t]},t)}catch(y){g=A(n.html())}e?(m=parseFloat(g),isNaN(m)||(l+=m,void 0===h&&(h=f=m),f=Math.min(f,m),h=Math.max(h,m),E++)):c?d.push({id:x.id,value:g}):d.push(g)}C++}if(e)switch(e.toLowerCase()){case "sum":d=l;break;case "avg":d=l/E;break;case "count":d=w-1;break;case "min":d=f;break;case "max":d=h}}}});return d},clearGridData:function(b){return this.each(function(){var c=this.p,e=this.rows,g=this.grid;g&&c&&e&&("boolean"!==
typeof b&&(b=!1),a(this).unbind(".jqGridFormatter"),g.emptyRows.call(this,!1,!0),c.footerrow&&b&&a(".ui-jqgrid-ftable td",g.sDiv).html(" "),c.selrow=null,d(c.selarrrow),d(c.savedRow),d(c.data),d(c.lastSelectedData),c._index={},c.rowIndexes={},c.records=0,c.page=1,c.lastpage=0,c.reccount=0,this.updatepager(!0,!1))})},getInd:function(b,c){var e=C.getGridRowById.call(a(this),b);return e?!0===c?e:e.rowIndex:!1},bindKeys:function(b){var c=a.extend({onEnter:null,onSpace:null,onLeftKey:null,onRightKey:null,
scrollingRows:!0},b||{});return this.each(function(){var b=this,d=b.p,g=a(b);a("body").is("[role]")||a("body").attr("role","application");d.scrollrows=c.scrollingRows;g.bind("keydown.jqGrid",function(l){var f=a(this).find("tr[tabindex=0]")[0],h=r.detectRowEditing.call(b,a(l.target).closest("tr.jqgrow").attr("id")),m=function(b){do if(f=f[b],null===f)return;while(a(f).is(":hidden")||!a(f).hasClass("jqgrow"));C.setSelection.call(g,f.id,!0);l.preventDefault()},t=function(e,l){var f=c["on"+e+(l||"")];
g.triggerHandler("jqGridKey"+e,[d.selrow]);a.isFunction(f)&&f.call(b,d.selrow)},q=function(b){if(d.treeGrid){var c=d.data[d._index[e(d.idPrefix,f.id)]][d.treeReader.expanded_field];"Right"===b&&(c=!c);c&&a(f).find("div.treeclick").trigger("click")}t(b,"Key")};if(f&&null===h)switch(l.keyCode){case 38:m("previousSibling");break;case 40:m("nextSibling");break;case 37:q("Left");break;case 39:q("Right");break;case 13:t("Enter");break;case 32:t("Space")}})})},unbindKeys:function(){return this.each(function(){a(this).unbind("keydown.jqGrid")})},
getLocalRow:function(a){var b=!1,c;this.each(function(){void 0!==a&&(c=this.p._index[e(this.p.idPrefix,a)],0<=c&&(b=this.p.data[c]))});return b},progressBar:function(b){b=a.extend({htmlcontent:"",method:"hide",loadtype:"disable"},b||{});return this.each(function(){var c="show"===b.method?!0:!1,e=f(this.p.id),d=a("#load_"+e);""!==b.htmlcontent&&d.html(b.htmlcontent);switch(b.loadtype){case "enable":d.toggle(c);break;case "block":a("#lui_"+e).toggle(c),d.toggle(c)}})},setColWidth:function(b,c,e,d){return this.each(function(){var g=
a(this),l=this.grid,f=this.p,h;if("string"===typeof b){if(b=f.iColByName[b],void 0===b)return}else if("number"!==typeof b)return;h=l.headers[b];null!=h&&(h.newWidth=c,l.newWidth=f.tblwidth+c-h.width,l.resizeColumn(b,!f.frozenColumns,d),!1===e||d||(this.fixScrollOffsetAndhBoxPadding(),C.setGridWidth.call(g,l.newWidth+f.scrollOffset,!1)))})},getAutoResizableWidth:function(b){var c=this;if(0===c.length)return-1;var c=c[0],e=c.rows,d,g,l,f=c.p,h=f.colModel[b],m=a(c.grid.headers[b].el),e=m.find(">div");
l=parseFloat(m.css("padding-left")||0);d=parseFloat(m.css("padding-right")||0);g=e.find("span.s-ico");var t=e.find(">."+f.autoResizing.wrapperClassName),q=t.outerWidth(),n=parseFloat(t.css("width")||0),p=m=0,w=null!=h.autoResizing&&void 0!==h.autoResizable.compact?h.autoResizable.compact:f.autoResizing.compact,A=f.autoResizing.wrapperClassName;if(null==h||!h.autoResizable||0===t.length||h.hidden||r.isCellClassHidden(h.classes)||h.fixed)return-1;if(!w||g.is(":visible")||"none"!==g.css("display"))p=
f.autoResizing.widthOfVisiblePartOfSortIcon,"center"===e.css("text-align")&&(p+=p),"horizontal"===f.viewsortcols[1]&&(p+=p);p+=q+l+(n===q?l+d:0)+parseFloat(e.css("margin-left")||0)+parseFloat(e.css("margin-right")||0);l=0;for(e=c.rows;l<e.length;l++)d=e[l],g=d.cells[b],c=a(d.cells[b]),null!=g&&(a(d).hasClass("jqgrow")||a(d).hasClass("jqgroup")&&1===g.colSpan)?(d=a(g.firstChild),d.hasClass(A)?p=Math.max(p,d.outerWidth()+m):f.treeGrid&&f.ExpandColumn===h.name&&(d=c.children(".cell-wrapper,.cell-wrapperleaf"),
p=Math.max(p,d.outerWidth()+m+c.children(".tree-wrap").outerWidth()))):a(d).hasClass("jqgfirstrow")&&(m=(r.cell_width?parseFloat(c.css("padding-left")||0)+parseFloat(c.css("padding-right")||0):0)+parseFloat(c.css("border-right")||0)+parseFloat(c.css("border-left")||0));p=Math.max(p,null!=h.autoResizing&&void 0!==h.autoResizing.minColWidth?h.autoResizing.minColWidth:f.autoResizing.minColWidth);return Math.min(p,null!=h.autoResizing&&void 0!==h.autoResizing.maxColWidth?h.autoResizing.maxColWidth:f.autoResizing.maxColWidth)},
autoResizeColumn:function(b,c){return this.each(function(){var e=a(this),d=this.p,g=d.colModel[b],l,f=a(this.grid.headers[b].el);l=C.getAutoResizableWidth.call(e,b);null==g||0>l||(C.setColWidth.call(e,b,l,d.autoResizing.adjustGridWidth&&!d.autoResizing.fixWidthOnShrink&&!c,c),d.autoResizing.fixWidthOnShrink&&d.shrinkToFit&&!c&&(g.fixed=!0,l=g.widthOrg,g.widthOrg=g.width,C.setGridWidth.call(e,d.width,!0),g.widthOrg=l,g.fixed=!1),f.data("autoResized","true"))})},autoResizeAllColumns:function(){return this.each(function(){var b=
a(this),c=this.p,e=c.colModel,d=e.length,g,l,f=c.shrinkToFit,h=c.autoResizing.adjustGridWidth,m=c.autoResizing.fixWidthOnShrink,t=parseInt(c.widthOrg,10),q=this.grid,n=C.autoResizeColumn;c.shrinkToFit=!1;c.autoResizing.adjustGridWidth=!0;c.autoResizing.fixWidthOnShrink=!1;for(g=0;g<d;g++)l=e[g],l.autoResizable&&"actions"!==l.formatter&&n.call(b,g,!0);q.hDiv.scrollLeft=q.bDiv.scrollLeft;c.footerrow&&(q.sDiv.scrollLeft=q.bDiv.scrollLeft);this.fixScrollOffsetAndhBoxPadding();isNaN(t)?h&&C.setGridWidth.call(b,
q.newWidth+c.scrollOffset,!1):C.setGridWidth.call(b,t,!1);c.autoResizing.fixWidthOnShrink=m;c.autoResizing.adjustGridWidth=h;c.shrinkToFit=f})}})})(jQuery);
(function(a){var p=a.jgrid,r=function(){var d=a.makeArray(arguments);d.unshift("");d.unshift("");d.unshift(this.p);return p.feedback.apply(this,d)},u=function(a,f){return p.mergeCssClasses(p.getRes(p.guiStyles[this.p.guiStyle],"states."+a),f||"")},n=function(d,f){var h=this.grid.fbRows;return a((null!=h&&h[0].cells.length>f?h[d.rowIndex]:d).cells[f])};p.extend({editCell:function(d,f,h){return this.each(function(){var b=this,c=a(b),e=b.p,l,m,g,t;l=b.rows;if(b.grid&&!0===e.cellEdit&&null!=l&&null!=
l[d]){d=parseInt(d,10);f=parseInt(f,10);var w=l[d],A=w.id,q=a(w),y=parseInt(e.iCol,10),E=parseInt(e.iRow,10),C=a(l[E]),B=e.savedRow;e.selrow=A;e.knv||c.jqGrid("GridNav");if(0<B.length){if(!0===h&&d===E&&f===y)return;c.jqGrid("saveCell",B[0].id,B[0].ic)}else setTimeout(function(){a("#"+p.jqID(e.knv)).attr("tabindex","-1").focus()},1);t=e.colModel[f];l=t.name;if("subgrid"!==l&&"cb"!==l&&"rn"!==l){g=n.call(b,w,f);w=t.editable;a.isFunction(w)&&(w=w.call(b,{rowid:A,iCol:f,iRow:d,name:l,cm:t,mode:"cell"}));
var D=u.call(b,"select","edit-cell"),z=u.call(b,"hover","selected-row");if(!0!==w||!0!==h||g.hasClass("not-editable-cell"))0<=y&&0<=E&&(n.call(b,C[0],y).removeClass(D),C.removeClass(z)),g.addClass(D),q.addClass(z),m=g.html().replace(/\ \;/ig,""),r.call(b,"onSelectCell",A,l,m,d,f);else{0<=y&&0<=E&&(n.call(b,C[0],y).removeClass(D),C.removeClass(z));g.addClass(D);q.addClass(z);t.edittype||(t.edittype="text");q=t.edittype;try{m=a.unformat.call(b,g,{rowId:A,colModel:t},f)}catch(v){m="textarea"===q?
g.text():g.html()}e.autoencode&&(m=p.htmlDecode(m));B.push({id:d,ic:f,name:l,v:m});if(" "===m||" "===m||1===m.length&&160===m.charCodeAt(0))m="";a.isFunction(e.formatCell)&&(y=e.formatCell.call(b,A,l,m,d,f),void 0!==y&&(m=y));r.call(b,"beforeEditCell",A,l,m,d,f);t=a.extend({},t.editoptions||{},{id:d+"_"+l,name:l,rowId:A,mode:"cell"});var V=p.createEl.call(b,q,t,m,!0,a.extend({},p.ajaxOptions,e.ajaxSelectOptions||{})),q=g;(y=!0===e.treeGrid&&l===e.ExpandColumn)&&(q=g.children("span.cell-wrapperleaf,span.cell-wrapper"));
q.html("").append(V).attr("tabindex","0");y&&a(V).width(g.width()-g.children("div.tree-wrap").outerWidth());p.bindEv.call(b,V,t);setTimeout(function(){a(V).focus()},1);a("input, select, textarea",g).bind("keydown",function(e){27===e.keyCode&&(0<a("input.hasDatepicker",g).length?a(".ui-datepicker").is(":hidden")?c.jqGrid("restoreCell",d,f):a("input.hasDatepicker",g).datepicker("hide"):c.jqGrid("restoreCell",d,f));if(13===e.keyCode&&!e.shiftKey)return c.jqGrid("saveCell",d,f),!1;if(9===e.keyCode){if(b.grid.hDiv.loading)return!1;
e.shiftKey?c.jqGrid("prevCell",d,f):c.jqGrid("nextCell",d,f)}e.stopPropagation()});r.call(b,"afterEditCell",A,l,m,d,f);c.triggerHandler("jqGridAfterEditCell",[A,l,m,d,f])}e.iCol=f;e.iRow=d}}})},saveCell:function(d,f){return this.each(function(){var h=this,b=a(h),c=h.p,e=p.info_dialog,l=p.jqID;if(h.grid&&!0===c.cellEdit){var m=b.jqGrid("getGridRes","errors"),g=m.errcap,t=b.jqGrid("getGridRes","edit").bClose,w=c.savedRow,A=1<=w.length?0:null;if(null!==A){var q=h.rows[d],y=q.id,E=a(q),C=c.colModel[f],
B=C.name,D,z=n.call(h,q,f);D=p.getEditedValue.call(h,z,C,!C.formatter);if(D!==w[A].v){A=b.triggerHandler("jqGridBeforeSaveCell",[y,B,D,d,f]);void 0!==A&&(D=A);a.isFunction(c.beforeSaveCell)&&(A=c.beforeSaveCell.call(h,y,B,D,d,f),void 0!==A&&(D=A));var v=p.checkValues.call(h,D,f),q=C.formatoptions||{};if(!0===v[0]){A=b.triggerHandler("jqGridBeforeSubmitCell",[y,B,D,d,f])||{};a.isFunction(c.beforeSubmitCell)&&((A=c.beforeSubmitCell.call(h,y,B,D,d,f))||(A={}));0<a("input.hasDatepicker",z).length&&a("input.hasDatepicker",
z).datepicker("hide");"date"===C.formatter&&!0!==q.sendFormatted&&(D=a.unformat.date.call(h,D,C));if("remote"===c.cellsubmit)if(c.cellurl){var u={};c.autoencode&&(D=p.htmlEncode(D));u[B]=D;var m=c.prmNames,C=m.oper,I=h.grid.hDiv;u[m.id]=p.stripPref(c.idPrefix,y);u[C]=m.editoper;u=a.extend(A,u);b.jqGrid("progressBar",{method:"show",loadtype:c.loadui,htmlcontent:p.defaults.savetext||"Saving..."});I.loading=!0;a.ajax(a.extend({url:c.cellurl,data:p.serializeFeedback.call(h,c.serializeCellData,"jqGridSerializeCellData",
u),type:"POST",complete:function(l){b.jqGrid("progressBar",{method:"hide",loadtype:c.loadui});I.loading=!1;if((300>l.status||304===l.status)&&(0!==l.status||4!==l.readyState)){var m=b.triggerHandler("jqGridAfterSubmitCell",[h,l,u.id,B,D,d,f])||[!0,""];!0===m[0]&&a.isFunction(c.afterSubmitCell)&&(m=c.afterSubmitCell.call(h,l,u.id,B,D,d,f));!0===m[0]?(b.jqGrid("setCell",y,f,D,!1,!1,!0),z.addClass("dirty-cell"),E.addClass("edited"),r.call(h,"afterSaveCell",y,B,D,d,f),w.splice(0,1)):(e.call(h,g,m[1],
t),b.jqGrid("restoreCell",d,f))}},error:function(m,q,n){a("#lui_"+l(c.id)).hide();I.loading=!1;b.triggerHandler("jqGridErrorCell",[m,q,n]);a.isFunction(c.errorCell)?c.errorCell.call(h,m,q,n):e.call(h,g,m.status+" : "+m.statusText+"<br/>"+q,t);b.jqGrid("restoreCell",d,f)}},p.ajaxOptions,c.ajaxCellOptions||{}))}else try{e.call(h,g,m.nourl,t),b.jqGrid("restoreCell",d,f)}catch(G){}"clientArray"===c.cellsubmit&&(b.jqGrid("setCell",y,f,D,!1,!1,!0),z.addClass("dirty-cell"),E.addClass("edited"),r.call(h,
"afterSaveCell",y,B,D,d,f),w.splice(0,1))}else try{setTimeout(function(){e.call(h,g,D+" "+v[1],t)},100),b.jqGrid("restoreCell",d,f)}catch(S){}}else b.jqGrid("restoreCell",d,f)}setTimeout(function(){a("#"+l(c.knv)).attr("tabindex","-1").focus()},0)}})},restoreCell:function(d,f){return this.each(function(){var h=this.p,b=this.rows[d],c=b.id,e,l;if(this.grid&&!0===h.cellEdit){var m=h.savedRow;e=n.call(this,b,f);if(1<=m.length){if(a.isFunction(a.fn.datepicker))try{a("input.hasDatepicker",e).datepicker("hide")}catch(g){}b=
h.colModel[f];!0===h.treeGrid&&b.name===h.ExpandColumn?e.children("span.cell-wrapperleaf,span.cell-wrapper").empty():e.empty();e.attr("tabindex","-1");e=m[0].v;l=b.formatoptions||{};"date"===b.formatter&&!0!==l.sendFormatted&&(e=a.unformat.date.call(this,e,b));a(this).jqGrid("setCell",c,f,e,!1,!1,!0);r.call(this,"afterRestoreCell",c,e,d,f);m.splice(0,1)}setTimeout(function(){a("#"+h.knv).attr("tabindex","-1").focus()},0)}})},nextCell:function(d,f){return this.each(function(){var h=a(this),b=this.p,
c=!1,e,l,m,g=this.rows;if(this.grid&&!0===b.cellEdit&&null!=g&&null!=g[d]){for(e=f+1;e<b.colModel.length;e++)if(m=b.colModel[e],l=m.editable,a.isFunction(l)&&(l=l.call(this,{rowid:g[d].id,iCol:e,iRow:d,name:m.name,cm:m,mode:"cell"})),!0===l){c=e;break}!1!==c?h.jqGrid("editCell",d,c,!0):0<b.savedRow.length&&h.jqGrid("saveCell",d,f)}})},prevCell:function(d,f){return this.each(function(){var h=a(this),b=this.p,c=!1,e,l,m,g=this.rows;if(this.grid&&!0===b.cellEdit&&null!=g&&null!=g[d]){for(e=f-1;0<=e;e--)if(m=
b.colModel[e],l=m.editable,a.isFunction(l)&&(l=l.call(this,{rowid:g[d].id,iCol:e,iRow:d,name:m.name,cm:m,mode:"cell"})),!0===l){c=e;break}!1!==c?h.jqGrid("editCell",d,c,!0):0<b.savedRow.length&&h.jqGrid("saveCell",d,f)}})},GridNav:function(){return this.each(function(){function d(a,b,c){a=h.rows[a];if("v"===c.substr(0,1)){var e=g.clientHeight,d=g.scrollTop,l=a.offsetTop+a.clientHeight,f=a.offsetTop;"vd"===c&&l>=e&&(g.scrollTop+=a.clientHeight);"vu"===c&&f<d&&(g.scrollTop-=a.clientHeight)}"h"===c&&
(c=g.scrollLeft,b=a.cells[b],a=b.offsetLeft,b.offsetLeft+b.clientWidth>=g.clientWidth+parseInt(c,10)?g.scrollLeft+=b.clientWidth:a<c&&(g.scrollLeft-=b.clientWidth))}function f(a,b){var e=0,d,l=c.colModel;if("lft"===b)for(e=a+1,d=a;0<=d;d--)if(!0!==l[d].hidden){e=d;break}if("rgt"===b)for(e=a-1,d=a;d<l.length;d++)if(!0!==l[d].hidden){e=d;break}return e}var h=this,b=a(h),c=h.p,e=h.grid,l,m;if(e&&!0===c.cellEdit){var g=e.bDiv;c.knv=c.id+"_kn";var t=a("<div style='position:fixed;top:0px;width:1px;height:1px;' tabindex='0'><div tabindex='-1' style='width:1px;height:1px;' id='"+
c.knv+"'></div></div>");a(t).insertBefore(e.cDiv);a("#"+c.knv).focus().keydown(function(a){var e=parseInt(c.iRow,10),g=parseInt(c.iCol,10);m=a.keyCode;"rtl"===c.direction&&(37===m?m=39:39===m&&(m=37));switch(m){case 38:0<e-1&&(d(e-1,g,"vu"),b.jqGrid("editCell",e-1,g,!1));break;case 40:e+1<=h.rows.length-1&&(d(e+1,g,"vd"),b.jqGrid("editCell",e+1,g,!1));break;case 37:0<=g-1&&(l=f(g-1,"lft"),d(e,l,"h"),b.jqGrid("editCell",e,l,!1));break;case 39:g+1<=c.colModel.length-1&&(l=f(g+1,"rgt"),d(e,l,"h"),b.jqGrid("editCell",
e,l,!1));break;case 13:0<=g&&0<=e&&b.jqGrid("editCell",e,g,!0);break;default:return!0}return!1})}})},getChangedCells:function(d){var f=[];d||(d="all");this.each(function(){var h=this,b=h.p,c=p.htmlDecode,e=h.rows;h.grid&&!0===b.cellEdit&&a(e).each(function(l){var m={};if(a(this).hasClass("edited")){var g=this;a(this.cells).each(function(f){var p=b.colModel[f],A=p.name,q=n.call(h,g,f);if("cb"!==A&&"subgrid"!==A&&"rn"!==A&&("dirty"!==d||q.hasClass("dirty-cell")))try{m[A]=a.unformat.call(h,q[0],{rowId:e[l].id,
colModel:p},f)}catch(r){m[A]=c(q.html())}});m.id=this.id;f.push(m)}})});return f}})})(jQuery);
(function(a){var p=a.jgrid,r=p.getMethod("getGridRes"),u=function(a,d){return p.mergeCssClasses(p.getRes(p.guiStyles[this.p.guiStyle],a),d||"")};p.jqModal=p.jqModal||{};a.extend(!0,p.jqModal,{toTop:!0});a.extend(p,{showModal:function(a){a.w.show()},closeModal:function(a){a.w.hide().attr("aria-hidden","true");a.o&&a.o.remove()},hideModal:function(n,d){d=a.extend({jqm:!0,gb:"",removemodal:!1,formprop:!1,form:""},d||{});var f=d.gb&&"string"===typeof d.gb&&"#gbox_"===d.gb.substr(0,6)?a("#"+d.gb.substr(6))[0]:
!1;if(d.onClose){var h=f?d.onClose.call(f,n):d.onClose(n);if("boolean"===typeof h&&!h)return}if(d.formprop&&f&&d.form){h=a(n)[0].style.height;-1<h.indexOf("px")&&(h=parseFloat(h));var b,c;"edit"===d.form?(b="#"+p.jqID("FrmGrid_"+d.gb.substr(6)),c="formProp"):"view"===d.form&&(b="#"+p.jqID("ViewGrid_"+d.gb.substr(6)),c="viewProp");a(f).data(c,{top:parseFloat(a(n).css("top")),left:parseFloat(a(n).css("left")),width:a(n).width(),height:h,dataheight:a(b).height(),datawidth:a(b).width()})}if(a.fn.jqm&&
!0===d.jqm)a(n).attr("aria-hidden","true").jqmHide();else{if(""!==d.gb)try{a(">.jqgrid-overlay",d.gb).filter(":first").hide()}catch(e){}a(n).hide().attr("aria-hidden","true")}d.removemodal&&a(n).remove()},findPos:function(a){var d=0,f=0;if(a.offsetParent){do d+=a.offsetLeft,f+=a.offsetTop,a=a.offsetParent;while(a)}return[d,f]},createModal:function(n,d,f,h,b,c,e){var l=p.jqID,m=this.p;f=a.extend(!0,{resizingRightBottomIcon:"ui-icon ui-icon-gripsmall-diagonal-se"},p.jqModal||{},null!=m?m.jqModal||{}:
{},f);var g=document.createElement("div"),t="#"+l(n.themodal),w="rtl"===a(f.gbox).attr("dir")?!0:!1,A=n.resizeAlso?"#"+l(n.resizeAlso):!1;e=a.extend({},e||{});g.className=u.call(this,"dialog.window","ui-jqdialog");g.id=n.themodal;g.dir=w?"rtl":"ltr";var q=document.createElement("div");q.className=u.call(this,"dialog.header","ui-jqdialog-titlebar "+(w?"ui-jqdialog-titlebar-rtl":"ui-jqdialog-titlebar-ltr"));q.id=n.modalhead;a(q).append("<span class='ui-jqdialog-title'>"+f.caption+"</span>");var r=u.call(this,
"states.hover"),E=a("<a class='ui-jqdialog-titlebar-close ui-corner-all'></a>").hover(function(){E.addClass(r)},function(){E.removeClass(r)}).append("<span class='"+p.getIconRes(m.iconSet,"form.close")+"'></span>");a(q).append(E);m=document.createElement("div");a(m).addClass(u.call(this,"dialog.content","ui-jqdialog-content")).attr("id",n.modalcontent);a(m).append(d);g.appendChild(m);a(g).prepend(q);!0===c?a("body").append(g):"string"===typeof c?a(c).append(g):a(g).insertBefore(h);a(g).css(e);void 0===
f.jqModal&&(f.jqModal=!0);d={};if(a.fn.jqm&&!0===f.jqModal)0===f.left&&0===f.top&&f.overlay&&(c=[],c=p.findPos(b),f.left=c[0]+4,f.top=c[1]+4),d.top=f.top+"px",d.left=f.left;else if(0!==f.left||0!==f.top)d.left=f.left,d.top=f.top+"px";a("a.ui-jqdialog-titlebar-close",q).click(function(){var b=a(t).data("onClose")||f.onClose,c=a(t).data("gbox")||f.gbox;p.hideModal(t,{gb:c,jqm:f.jqModal,onClose:b,removemodal:f.removemodal||!1,formprop:!f.recreateForm||!1,form:f.form||""});return!1});0!==f.width&&f.width||
(f.width=300);0!==f.height&&f.height||(f.height=200);f.zIndex||((h=a(h).parents("*[role=dialog]").filter(":first").css("z-index"))?(f.zIndex=parseInt(h,10)+2,f.toTop=!0):f.zIndex=950);d.left&&(d.left+="px");a(g).css(a.extend({width:isNaN(f.width)?"auto":f.width+"px",height:isNaN(f.height)?"auto":f.height+"px",zIndex:f.zIndex,overflow:"hidden"},d)).attr({tabIndex:"-1",role:"dialog","aria-labelledby":n.modalhead,"aria-hidden":"true"});void 0===f.drag&&(f.drag=!0);void 0===f.resize&&(f.resize=!0);if(f.drag)if(a.fn.jqDrag)a(q).css("cursor",
"move"),a(g).jqDrag(q);else try{a(g).draggable({handle:a("#"+l(q.id))})}catch(C){}if(f.resize)if(a.fn.jqResize)a(g).append("<div class='jqResize ui-resizable-handle ui-resizable-se "+f.resizingRightBottomIcon+"'></div>"),a(t).jqResize(".jqResize",A);else try{a(g).resizable({handles:"se, sw",alsoResize:A})}catch(B){}!0===f.closeOnEscape&&a(g).keydown(function(b){27===b.which&&(b=a(t).data("onClose")||f.onClose,p.hideModal(t,{gb:f.gbox,jqm:f.jqModal,onClose:b,removemodal:f.removemodal||!1,formprop:!f.recreateForm||
!1,form:f.form||""}))})},viewModal:function(n,d){d=a.extend(!0,{overlay:30,modal:!1,overlayClass:"ui-widget-overlay",onShow:p.showModal,onHide:p.closeModal,gbox:"",jqm:!0,jqM:!0},p.jqModal||{},d||{});if(a.fn.jqm&&!0===d.jqm)d.jqM?a(n).attr("aria-hidden","false").jqm(d).jqmShow():a(n).attr("aria-hidden","false").jqmShow();else{""!==d.gbox&&(a(">.jqgrid-overlay",d.gbox).filter(":first").show(),a(n).data("gbox",d.gbox));a(n).show().attr("aria-hidden","false");try{a(":input:visible",n)[0].focus()}catch(f){}}},
info_dialog:function(n,d,f,h){var b=this,c=b.p,e=a.extend(!0,{width:290,height:"auto",dataheight:"auto",drag:!0,resize:!1,left:250,top:170,zIndex:1E3,jqModal:!0,modal:!1,closeOnEscape:!0,align:"center",buttonalign:"center",buttons:[]},p.jqModal||{},null!=c?c.jqModal||{}:{},{caption:"<b>"+n+"</b>"},h||{}),l=e.jqModal;a.fn.jqm&&!l&&(l=!1);n="";var m=u.call(b,"states.hover");if(0<e.buttons.length)for(h=0;h<e.buttons.length;h++)void 0===e.buttons[h].id&&(e.buttons[h].id="info_button_"+h),n+=p.builderFmButon.call(b,
e.buttons[h].id,e.buttons[h].text);h=isNaN(e.dataheight)?e.dataheight:e.dataheight+"px";d="<div id='info_id'>"+("<div id='infocnt' style='margin:0px;padding-bottom:1em;width:100%;overflow:auto;position:relative;height:"+h+";"+("text-align:"+e.align+";")+"'>"+d+"</div>");if(f||""!==n)d+="<hr class='"+u.call(b,"dialog.hr")+"' style='margin:1px'/><div style='text-align:"+e.buttonalign+";padding:.8em 0 .5em 0;background-image:none;border-width: 1px 0 0 0;'>"+(f?p.builderFmButon.call(b,"closedialog",f):
"")+n+"</div>";d+="</div>";try{"false"===a("#info_dialog").attr("aria-hidden")&&p.hideModal("#info_dialog",{jqm:l}),a("#info_dialog").remove()}catch(g){}p.createModal.call(b,{themodal:"info_dialog",modalhead:"info_head",modalcontent:"info_content",resizeAlso:"infocnt"},d,e,"","",!0);n&&a.each(e.buttons,function(c){a("#"+p.jqID(b.id),"#info_id").bind("click",function(){e.buttons[c].onClick.call(a("#info_dialog"));return!1})});a("#closedialog","#info_id").click(function(){p.hideModal("#info_dialog",
{jqm:l,onClose:a("#info_dialog").data("onClose")||e.onClose,gb:a("#info_dialog").data("gbox")||e.gbox});return!1});a(".fm-button","#info_dialog").hover(function(){a(this).addClass(m)},function(){a(this).removeClass(m)});a.isFunction(e.beforeOpen)&&e.beforeOpen();p.viewModal("#info_dialog",{onHide:function(a){a.w.hide().remove();a.o&&a.o.remove()},modal:e.modal,jqm:l});a.isFunction(e.afterOpen)&&e.afterOpen();try{a("#info_dialog").focus()}catch(t){}},bindEv:function(n,d){a.isFunction(d.dataInit)&&
d.dataInit.call(this,n,d);d.dataEvents&&a.each(d.dataEvents,function(){void 0!==this.data?a(n).bind(this.type,this.data,this.fn):a(n).bind(this.type,this.fn)})},createEl:function(n,d,f,h,b){function c(b,c,e){var d="dataInit dataEvents dataUrl buildSelect sopt searchhidden defaultValue attr custom_element custom_value selectFilled rowId mode".split(" ");void 0!==e&&a.isArray(e)&&a.merge(d,e);a.each(c,function(c,e){-1===a.inArray(c,d)&&a(b).attr(c,e)});c.hasOwnProperty("id")||a(b).attr("id",p.randId())}
var e="",l=this,m=l.p,g=p.info_dialog,t=r.call(a(l),"errors.errcap"),w=r.call(a(l),"edit"),A=w.msg,w=w.bClose;switch(n){case "textarea":e=document.createElement("textarea");h?d.cols||a(e).css({width:"100%","box-sizing":"border-box"}):d.cols||(d.cols=20);d.rows||(d.rows=2);if(" "===f||" "===f||1===f.length&&160===f.charCodeAt(0))f="";e.value=f;c(e,d);a(e).attr({role:"textbox"});break;case "checkbox":e=document.createElement("input");e.type="checkbox";if(d.value){var q=d.value.split(":");
f===q[0]&&(e.checked=!0,e.defaultChecked=!0);e.value=q[0];a(e).data("offval",q[1])}else q=String(f).toLowerCase(),0>q.search(/(false|f|0|no|n|off|undefined)/i)&&""!==q?(e.checked=!0,e.defaultChecked=!0,e.value=f):e.value="on",a(e).data("offval","off");c(e,d,["value"]);a(e).attr({role:"checkbox","aria-checked":e.checked?"true":"false"});break;case "select":e=document.createElement("select");e.setAttribute("role","listbox");t=[];h=m.iColByName[d.name];n=m.colModel[h];!0===d.multiple?(g=!0,e.multiple=
"multiple",a(e).attr("aria-multiselectable","true")):g=!1;if(void 0!==d.dataUrl){var q=null,y=d.postData||b.postData;try{q=d.rowId}catch(E){}m&&m.idPrefix&&(q=p.stripPref(m.idPrefix,q));a.ajax(a.extend({url:a.isFunction(d.dataUrl)?d.dataUrl.call(l,q,f,String(d.name)):d.dataUrl,type:"GET",dataType:"html",data:a.isFunction(y)?y.call(l,q,f,String(d.name)):y,context:{elem:e,options:d,vl:f,cm:n,iCol:h},success:function(b,e,d){var g=[],f=this.elem;e=this.vl;var h=this.cm,m=this.iCol,t=a.extend({},this.options),
q=!0===t.multiple;b=a.isFunction(t.buildSelect)?t.buildSelect.call(l,b,d,h,m):b;"string"===typeof b&&(b=a(a.trim(b)).html());b&&(a(f).append(b),c(f,t,y?["postData"]:void 0),void 0===t.size&&(t.size=q?3:1),q?(g=e.split(","),g=a.map(g,function(b){return a.trim(b)})):g[0]=a.trim(e),setTimeout(function(){a("option",f).each(function(b){0===b&&f.multiple&&(this.selected=!1);a(this).attr("role","option");if(-1<a.inArray(a.trim(a(this).text()),g)||-1<a.inArray(a.trim(a(this).val()),g))this.selected="selected"});
p.fullBoolFeedback.call(l,t.selectFilled,"jqGridSelectFilled",{elem:f,options:t,cm:h,cmName:h.name,iCol:m})},0))}},b||{}))}else if(d.value){void 0===d.size&&(d.size=g?3:1);g&&(t=f.split(","),t=a.map(t,function(b){return a.trim(b)}));"function"===typeof d.value&&(d.value=d.value());var C,B,m=void 0===d.separator?":":d.separator;b=void 0===d.delimiter?";":d.delimiter;A=function(a,b){if(0<b)return a};if("string"===typeof d.value)for(C=d.value.split(b),q=0;q<C.length;q++)B=C[q].split(m),2<B.length&&(B[1]=
a.map(B,A).join(m)),b=document.createElement("option"),b.setAttribute("role","option"),b.value=B[0],b.innerHTML=B[1],e.appendChild(b),w=a.trim(B[0]),B=a.trim(B[1]),g||w!==a.trim(f)&&B!==a.trim(f)||(b.selected="selected"),g&&(-1<a.inArray(B,t)||-1<a.inArray(w,t))&&(b.selected="selected");else if("object"===typeof d.value)for(q in m=d.value,m)m.hasOwnProperty(q)&&(b=document.createElement("option"),b.setAttribute("role","option"),b.value=q,b.innerHTML=m[q],e.appendChild(b),g||a.trim(q)!==a.trim(f)&&
a.trim(m[q])!==a.trim(f)||(b.selected="selected"),g&&(-1<a.inArray(a.trim(m[q]),t)||-1<a.inArray(a.trim(q),t))&&(b.selected="selected"));c(e,d,["value"]);p.fullBoolFeedback.call(l,d.selectFilled,"jqGridSelectFilled",{elem:e,options:d,cm:n,cmName:n.name,iCol:h})}break;case "text":case "password":case "button":q="button"===n?"button":"textbox";e=document.createElement("input");e.type=n;e.value=f;c(e,d);"button"!==n&&(h?d.size||a(e).css({width:"100%","box-sizing":"border-box"}):d.size||(d.size=20));
a(e).attr("role",q);break;case "image":case "file":e=document.createElement("input");e.type=n;c(e,d);break;case "custom":e=document.createElement("span");try{if(a.isFunction(d.custom_element))if(C=d.custom_element.call(l,f,d),C instanceof jQuery||p.isHTMLElement(C)||"string"===typeof C)C=a(C).addClass("customelement").attr({id:d.id,name:d.name}),a(e).empty().append(C);else throw"editoptions.custom_element returns value of a wrong type";else throw"editoptions.custom_element is not a function";}catch(D){"e1"===
D&&g.call(l,t,"function 'custom_element' "+A.nodefined,w),"e2"===D?g.call(l,t,"function 'custom_element' "+A.novalue,w):g.call(l,t,"string"===typeof D?D:D.message,w)}}return e},checkDate:function(a,d){var f={},h;a=a.toLowerCase();h=-1!==a.indexOf("/")?"/":-1!==a.indexOf("-")?"-":-1!==a.indexOf(".")?".":"/";a=a.split(h);d=d.split(h);if(3!==d.length)return!1;var b=-1,c,e=h=-1,l;for(l=0;l<a.length;l++)c=isNaN(d[l])?0:parseInt(d[l],10),f[a[l]]=c,c=a[l],-1!==c.indexOf("y")&&(b=l),-1!==c.indexOf("m")&&
(e=l),-1!==c.indexOf("d")&&(h=l);c="y"===a[b]||"yyyy"===a[b]?4:"yy"===a[b]?2:-1;var m;l=[0,31,29,31,30,31,30,31,31,30,31,30,31];if(-1===b)return!1;m=f[a[b]].toString();2===c&&1===m.length&&(c=1);if(m.length!==c||0===f[a[b]]&&"00"!==d[b]||-1===e)return!1;m=f[a[e]].toString();if(1>m.length||1>f[a[e]]||12<f[a[e]]||-1===h)return!1;m=f[a[h]].toString();!(c=1>m.length||1>f[a[h]]||31<f[a[h]])&&(c=2===f[a[e]])&&(b=f[a[b]],c=f[a[h]]>(0!==b%4||0===b%100&&0!==b%400?28:29));return c||f[a[h]]>l[f[a[e]]]?!1:!0},
isEmpty:function(a){return a.match(/^\s+$/)||""===a?!0:!1},checkTime:function(a){var d=/^(\d{1,2}):(\d{2})([apAP][Mm])?$/;if(!p.isEmpty(a))if(a=a.match(d)){if(a[3]){if(1>a[1]||12<a[1])return!1}else if(23<a[1])return!1;if(59<a[2])return!1}else return!1;return!0},checkValues:function(n,d,f,h){var b,c,e=this.p;c=e.colModel;var l=p.isEmpty,m=r.call(a(this),"edit.msg"),g=r.call(a(this),"formatter.date.masks");if(void 0===f){"string"===typeof d&&(d=e.iColByName[d]);if(void 0===d||0>d)return[!0,"",""];h=
c[d];f=h.editrules;null!=h.formoptions&&(b=h.formoptions.label)}else b=void 0===h?"_":h,h=c[d];if(f){b||(b=null!=e.colNames?e.colNames[d]:h.label);if(!0===f.required&&l(n))return[!1,b+": "+m.required,""];e=!1===f.required?!1:!0;if(!0===f.number&&(!1!==e||!l(n))&&isNaN(n))return[!1,b+": "+m.number,""];if(void 0!==f.minValue&&!isNaN(f.minValue)&&parseFloat(n)<parseFloat(f.minValue))return[!1,b+": "+m.minValue+" "+f.minValue,""];if(void 0!==f.maxValue&&!isNaN(f.maxValue)&&parseFloat(n)>parseFloat(f.maxValue))return[!1,
b+": "+m.maxValue+" "+f.maxValue,""];var t;if(!(!0!==f.email||!1===e&&l(n)||(t=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,
t.test(n))))return[!1,b+": "+m.email,""];if(!(!0!==f.integer||!1===e&&l(n)||!isNaN(n)&&0===n%1&&-1===n.indexOf(".")))return[!1,b+": "+m.integer,""];if(!(!0!==f.date||!1===e&&l(n)||(h.formatoptions&&h.formatoptions.newformat?(c=h.formatoptions.newformat,g.hasOwnProperty(c)&&(c=g[c])):c=c[d].datefmt||"Y-m-d",p.checkDate(c,n))))return[!1,b+": "+m.date+" - "+c,""];if(!0===f.time&&!(!1===e&&l(n)||p.checkTime(n)))return[!1,b+": "+m.date+" - hh:mm (am/pm)",""];if(!(!0!==f.url||!1===e&&l(n)||(t=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i,
t.test(n))))return[!1,b+": "+m.url,""];if(!0===f.custom&&(!1!==e||!l(n)))return a.isFunction(f.custom_func)?(n=f.custom_func.call(this,n,b,d),a.isArray(n)?n:[!1,m.customarray,""]):[!1,m.customfcheck,""]}return[!0,"",""]}})})(jQuery);
(function(a){var p=a.jgrid,r=p.getMethod("getGridRes"),u=p.jqID,n=function(a,f){return p.mergeCssClasses(p.getRes(p.guiStyles[this.p.guiStyle||p.defaults.guiStyle||"jQueryUI"],a),f||"")};p.extend({getColProp:function(a){var f=this[0];return null!=f&&f.grid&&(a=f.p.iColByName[a],void 0!==a)?f.p.colModel[a]:{}},setColProp:function(d,f){return this.each(function(){var h=this.p,b;this.grid&&null!=h&&f&&(b=h.iColByName[d],void 0!==b&&a.extend(!0,h.colModel[b],f))})},sortGrid:function(a,f,h){return this.each(function(){var b=
this.grid,c=this.p,e=c.colModel,l=e.length,m,g,t=!1;if(b)for(a||(a=c.sortname),"boolean"!==typeof f&&(f=!1),g=0;g<l;g++)if(m=e[g],m.index===a||m.name===a){!0===c.frozenColumns&&!0===m.frozen&&(t=b.fhDiv.find("#"+c.id+"_"+a));t&&0!==t.length||(t=b.headers[g].el);b=m.sortable;("boolean"!==typeof b||b)&&this.sortData("jqgh_"+c.id+"_"+a,g,f,h,t);break}})},clearBeforeUnload:function(){return this.each(function(){var d=this.p,f=this.grid,h,b=p.clearArray,c=Object.prototype.hasOwnProperty;a.isFunction(f.emptyRows)&&
f.emptyRows.call(this,!0,!0);a(document).unbind("mouseup.jqGrid"+d.id);a(f.hDiv).unbind("mousemove");a(this).unbind();var e,l=f.headers.length;for(e=0;e<l;e++)f.headers[e].el=null;for(h in f)f.hasOwnProperty(h)&&(f.propOrMethod=null);f="formatCol sortData updatepager refreshIndex setHeadCheckBox constructTr clearToolbar fixScrollOffsetAndhBoxPadding rebuildRowIndexes modalAlert toggleToolbar triggerToolbar formatter addXmlData addJSONData ftoolbar _inlinenav nav grid p".split(" ");l=f.length;for(e=
0;e<l;e++)c.call(this,f[e])&&(this[f[e]]=null);this._index={};b(d.data);b(d.lastSelectedData);b(d.selarrrow);b(d.savedRow)})},GridDestroy:function(){return this.each(function(){var d=this.p;if(this.grid&&null!=d){d.pager&&a(d.pager).remove();try{a("#alertmod_"+d.idSel).remove(),a(this).jqGrid("clearBeforeUnload"),a(d.gBox).remove()}catch(f){}}})},GridUnload:function(){return this.each(function(){var d=a(this),f=this.p,h=a.fn.jqGrid;this.grid&&(d.removeClass(h.getGuiStyles.call(d,"grid","ui-jqgrid-btable")),
f.pager&&a(f.pager).empty().removeClass(h.getGuiStyles.call(d,"pagerBottom","ui-jqgrid-pager")).removeAttr("style").removeAttr("dir"),d.jqGrid("clearBeforeUnload"),d.removeAttr("style").removeAttr("tabindex").removeAttr("role").removeAttr("aria-labelledby").removeAttr("style"),d.empty(),d.insertBefore(f.gBox).show(),a(f.pager).insertBefore(f.gBox).show(),a(f.gBox).remove())})},setGridState:function(d){return this.each(function(){var f=this.p,h=this.grid,b=h.cDiv,c=a(h.uDiv),e=a(h.ubDiv);if(h&&null!=
f){var l=f.iconSet||p.defaults.iconSet||"jQueryUI",h=p.getIconRes(l,"gridMinimize.visible"),l=p.getIconRes(l,"gridMinimize.hidden");"hidden"===d?(a(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv",f.gView).slideUp("fast"),f.pager&&a(f.pager).slideUp("fast"),f.toppager&&a(f.toppager).slideUp("fast"),!0===f.toolbar[0]&&("both"===f.toolbar[1]&&e.slideUp("fast"),c.slideUp("fast")),f.footerrow&&a(".ui-jqgrid-sdiv",f.gBox).slideUp("fast"),a(".ui-jqgrid-titlebar-close span",b).removeClass(h).addClass(l),f.gridstate="hidden"):
"visible"===d&&(a(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv",f.gView).slideDown("fast"),f.pager&&a(f.pager).slideDown("fast"),f.toppager&&a(f.toppager).slideDown("fast"),!0===f.toolbar[0]&&("both"===f.toolbar[1]&&e.slideDown("fast"),c.slideDown("fast")),f.footerrow&&a(".ui-jqgrid-sdiv",f.gBox).slideDown("fast"),a(".ui-jqgrid-titlebar-close span",b).removeClass(l).addClass(h),f.gridstate="visible")}})},filterToolbar:function(d){return this.each(function(){var f=this,h=f.grid,b=a(f),c=f.p,e=p.bindEv,l=p.info_dialog;
if(!this.ftoolbar){var m=a.extend(!0,{autosearch:!0,autosearchDelay:500,searchOnEnter:!0,beforeSearch:null,afterSearch:null,beforeClear:null,afterClear:null,searchurl:"",stringResult:!1,groupOp:"AND",defaultSearch:"bw",searchOperators:!1,resetIcon:"x",applyLabelClasses:!0,operands:{eq:"==",ne:"!",lt:"<",le:"<=",gt:">",ge:">=",bw:"^",bn:"!^","in":"=",ni:"!=",ew:"|",en:"!@",cn:"~",nc:"!~",nu:"#",nn:"!#"}},p.search,c.searching||{},d||{}),g=c.colModel,t=function(a){return r.call(b,a)},w=t("errors.errcap"),
A=t("edit.bClose"),q=t("edit.msg"),y=n.call(f,"states.hover"),E=n.call(f,"states.select"),C=n.call(f,"filterToolbar.dataField"),B=function(){var e={},d=0,l={};a.each(g,function(){var b=this,g=b.index||b.name,q,p;q=b.searchoptions||{};var n=a("#gs_"+u(b.name),!0===b.frozen&&!0===c.frozenColumns?h.fhDiv:h.hDiv),v=function(a,c){var e=b.formatoptions||{};return void 0!==e[a]?e[a]:t("formatter."+(c||b.formatter)+"."+a)},A=function(a){var b=v("thousandsSeparator").replace(/([\.\*\_\'\(\)\{\}\+\?\\])/g,
"\\$1");return a.replace(new RegExp(b,"g"),"")};p=m.searchOperators?n.parent().prev().children("a").data("soper")||m.defaultSearch:q.sopt?q.sopt[0]:"select"===b.stype?"eq":m.defaultSearch;if("custom"===b.stype&&a.isFunction(q.custom_value)&&0<n.length&&"SPAN"===n[0].nodeName.toUpperCase())q=q.custom_value.call(f,n.children(".customelement").filter(":first"),"get");else switch(q=a.trim(n.val()),b.formatter){case "integer":q=A(q).replace(v("decimalSeparator","number"),".");""!==q&&(q=String(parseInt(q,
10)));break;case "number":q=A(q).replace(v("decimalSeparator"),".");""!==q&&(q=String(parseFloat(q)));break;case "currency":var n=v("prefix"),w=v("suffix");n&&n.length&&(q=q.substr(n.length));w&&w.length&&(q=q.substr(0,q.length-w.length));q=A(q).replace(v("decimalSeparator"),".");""!==q&&(q=String(parseFloat(q)))}if(q||"nu"===p||"nn"===p)e[g]=q,l[g]=p,d++;else try{delete c.postData[g]}catch(k){}});var q=0<d?!0:!1;if(m.stringResult||m.searchOperators||"local"===c.datatype){var p='{"groupOp":"'+m.groupOp+
'","rules":[',n=0;a.each(e,function(a,b){0<n&&(p+=",");p+='{"field":"'+a+'",';p+='"op":"'+l[a]+'",';p+='"data":"'+(b+"").replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"}';n++});p+="]}";a.extend(c.postData,{filters:p});a.each(["searchField","searchString","searchOper"],function(a,b){c.postData.hasOwnProperty(b)&&delete c.postData[b]})}else a.extend(c.postData,e);var v;c.searchurl&&(v=c.url,b.jqGrid("setGridParam",{url:c.searchurl}));var A="stop"===b.triggerHandler("jqGridToolbarBeforeSearch")?!0:!1;
!A&&a.isFunction(m.beforeSearch)&&(A=m.beforeSearch.call(f));A||b.jqGrid("setGridParam",{search:q}).trigger("reloadGrid",[a.extend({page:1},m.reloadGridSearchOptions||{})]);v&&b.jqGrid("setGridParam",{url:v});b.triggerHandler("jqGridToolbarAfterSearch");a.isFunction(m.afterSearch)&&m.afterSearch.call(f)},D=t("search.odata")||[],z=c.customSortOperations,v=function(e,d,l){a("#sopt_menu").remove();d=parseInt(d,10);l=parseInt(l,10)+18;var f,h=0,t=[],q=a(e).data("soper"),h=a(e).data("colname");d='<ul id="sopt_menu" class="ui-search-menu" role="menu" tabindex="0" style="z-index:9999;font-size:'+
(a(".ui-jqgrid-view").css("font-size")||"11px")+";left:"+d+"px;top:"+l+'px;">';h=c.iColByName[h];if(void 0!==h){h=g[h];l=a.extend({},h.searchoptions);var n,v,A;l.sopt||(l.sopt=[],l.sopt[0]="select"===h.stype?"eq":m.defaultSearch);a.each(D,function(){t.push(this.oper)});null!=z&&a.each(z,function(a){t.push(a)});for(h=0;h<l.sopt.length;h++)v=l.sopt[h],f=a.inArray(v,t),-1!==f&&(f=D[f],void 0!==f?(A=m.operands[v],n=f.text):null!=z&&(n=z[v],A=n.operand,n=n.text),f=q===v?E:"",d+='<li class="ui-menu-item '+
f+'" role="presentation"><a class="ui-corner-all g-menu-item" tabindex="0" role="menuitem" value="'+v+'" data-oper="'+A+'"><table'+(p.msie&&8>p.msiever()?' cellspacing="0"':"")+'><tr><td style="width:25px">'+A+"</td><td>"+n+"</td></tr></table></a></li>");d+="</ul>";a("body").append(d);a("#sopt_menu").addClass("ui-menu ui-widget ui-widget-content ui-corner-all");a("#sopt_menu > li > a").hover(function(){a(this).addClass(y)},function(){a(this).removeClass(y)}).click(function(){var c=a(this).attr("value"),
d=a(this).data("oper");b.triggerHandler("jqGridToolbarSelectOper",[c,d,e]);a("#sopt_menu").hide();a(e).text(d).data("soper",c);!0===m.autosearch&&(d=a(e).parent().next().children()[0],(a(d).val()||"nu"===c||"nn"===c)&&B())})}},V,I=a("<tr class='ui-search-toolbar' role='row'></tr>");a.each(g,function(b){var d,g;g="";var h,v,r=this.searchoptions,E=this.editoptions,y=a("<th role='columnheader' class='"+n.call(f,"colHeaders","ui-th-column ui-th-"+c.direction+" "+(m.applyLabelClasses?this.labelClasses||
"":""))+"'></th>"),u=a("<div style='position:relative;height:auto;'></div>"),T=a("<table class='ui-search-table'"+(p.msie&&8>p.msiever()?" cellspacing='0'":"")+"><tr><td class='ui-search-oper'></td><td class='ui-search-input'></td><td class='ui-search-clear' style='width:1px'></td></tr></table>");!0===this.hidden&&a(y).css("display","none");this.search=!1===this.search?!1:!0;void 0===this.stype&&(this.stype="text");d=a.extend({mode:"filter"},r||{});if(this.search){if(m.searchOperators){g=d.sopt?d.sopt[0]:
"select"===this.stype?"eq":m.defaultSearch;for(v=0;v<D.length;v++)if(D[v].oper===g){h=m.operands[g]||"";break}if(void 0===h&&null!=z)for(var x in z)if(z.hasOwnProperty(x)&&x===g){h=z[x].operand;break}void 0===h&&(h="=");g="<a title='"+(null!=d.searchtitle?d.searchtitle:t("search.operandTitle"))+"' style='padding-right: 0.5em;' data-soper='"+g+"' class='soptclass' data-colname='"+this.name+"'>"+h+"</a>"}a("td",T).filter(":first").data("colindex",b).append(g);null!=d.sopt&&1!==d.sopt.length||a("td.ui-search-oper",
T).hide();void 0===d.clearSearch&&(d.clearSearch="text"===this.stype?!0:!1);d.clearSearch?(g=t("search.resetTitle")||"Clear Search Value",a("td",T).eq(2).append("<a title='"+g+"' style='padding-right: 0.2em;padding-left: 0.3em;' class='clearsearchclass'>"+m.resetIcon+"</a>")):a("td",T).eq(2).hide();switch(this.stype){case "select":if(g=this.surl||d.dataUrl)a(u).append(T),a.ajax(a.extend({url:g,context:{stbl:T,options:d,cm:this,iCol:b},dataType:"html",success:function(b,c,d){c=this.cm;var g=this.iCol,
l=this.options,k=this.stbl,h=k.find("td.ui-search-input>select");void 0!==l.buildSelect?(b=l.buildSelect.call(f,b,d,c,g))&&a("td",k).eq(1).append(b):a("td",k).eq(1).append(b);void 0!==l.defaultValue&&h.val(l.defaultValue);h.attr({name:c.index||c.name,id:"gs_"+c.name});l.attr&&h.attr(l.attr);h.addClass(C);h.css({width:"100%"});e.call(f,h[0],l);p.fullBoolFeedback.call(f,l.selectFilled,"jqGridSelectFilled",{elem:h[0],options:l,cm:c,cmName:c.name,iCol:g,mode:"filter"});!0===m.autosearch&&h.change(function(){B();
return!1})}},p.ajaxOptions,c.ajaxSelectOptions||{}));else{var O,aa,Q;r?(O=void 0===r.value?"":r.value,aa=void 0===r.separator?":":r.separator,Q=void 0===r.delimiter?";":r.delimiter):E&&(O=void 0===E.value?"":E.value,aa=void 0===E.separator?":":E.separator,Q=void 0===E.delimiter?";":E.delimiter);if(O){var K=document.createElement("select");K.style.width="100%";a(K).attr({name:this.index||this.name,id:"gs_"+this.name,role:"listbox"});var L;if("string"===typeof O)for(g=O.split(Q),L=0;L<g.length;L++)O=
g[L].split(aa),Q=document.createElement("option"),Q.value=O[0],Q.innerHTML=O[1],K.appendChild(Q);else if("object"===typeof O)for(L in O)O.hasOwnProperty(L)&&(Q=document.createElement("option"),Q.value=L,Q.innerHTML=O[L],K.appendChild(Q));void 0!==d.defaultValue&&a(K).val(d.defaultValue);d.attr&&a(K).attr(d.attr);a(K).addClass(C);a(u).append(T);e.call(f,K,d);a("td",T).eq(1).append(K);p.fullBoolFeedback.call(f,d.selectFilled,"jqGridSelectFilled",{elem:K,options:r||E||{},cm:this,cmName:this.name,iCol:b,
mode:"filter"});!0===m.autosearch&&a(K).change(function(){B();return!1})}}break;case "text":b=void 0!==d.defaultValue?d.defaultValue:"";a("td",T).eq(1).append("<input type='text' role='textbox' class='"+C+"' style='width:100%;padding:0;' name='"+(this.index||this.name)+"' id='gs_"+this.name+"' value='"+b+"'/>");a(u).append(T);d.attr&&a("input",u).attr(d.attr);e.call(f,a("input",u)[0],d);!0===m.autosearch&&(m.searchOnEnter?a("input",u).keypress(function(a){return 13===(a.charCode||a.keyCode||0)?(B(),
!1):this}):a("input",u).keydown(function(a){switch(a.which){case 13:return!1;case 9:case 16:case 37:case 38:case 39:case 40:case 27:break;default:V&&clearTimeout(V),V=setTimeout(function(){B()},m.autosearchDelay)}}));break;case "custom":a("td",T).eq(1).append("<span style='width:95%;padding:0;' class='"+C+"' name='"+(this.index||this.name)+"' id='gs_"+this.name+"'/>");a(u).append(T);try{if(a.isFunction(d.custom_element))if(K=d.custom_element.call(f,void 0!==d.defaultValue?d.defaultValue:"",d))K=a(K).addClass("customelement"),
a(u).find("span[name='"+(this.index||this.name)+"']").append(K);else throw"e2";else throw"e1";}catch(k){"e1"===k&&l.call(f,w,"function 'custom_element' "+q.nodefined,A),"e2"===k?l.call(f,w,"function 'custom_element' "+q.novalue,A):l.call(f,w,"string"===typeof k?k:k.message,A)}}}a(y).append(u);a(I).append(y);m.searchOperators||a("td",T).eq(0).hide()});a(h.hDiv).find(">div>.ui-jqgrid-htable>thead").append(I);m.searchOperators&&(a(".soptclass",I).click(function(b){var c=a(this).offset();v(this,c.left,
c.top);b.stopPropagation()}),a("body").on("click",function(b){"soptclass"!==b.target.className&&a("#sopt_menu").hide()}));a(".clearsearchclass",I).click(function(){var b=a(this).parents("tr").filter(":first"),c=parseInt(a("td.ui-search-oper",b).data("colindex"),10),e=a.extend({},g[c].searchoptions||{}).defaultValue||"";"select"===g[c].stype?e?a("td.ui-search-input select",b).val(e):a("td.ui-search-input select",b)[0].selectedIndex=0:a("td.ui-search-input input",b).val(e);!0===m.autosearch&&B()});
f.ftoolbar=!0;f.triggerToolbar=B;f.clearToolbar=function(e){var d={},l=0,t;e="boolean"!==typeof e?!0:e;a.each(g,function(){var b,e=a("#gs_"+u(this.name),!0===this.frozen&&!0===c.frozenColumns?h.fhDiv:h.hDiv),g,m=this.searchoptions||{};void 0!==m.defaultValue&&(b=m.defaultValue);t=this.index||this.name;switch(this.stype){case "select":g=0<e.length?!e[0].multiple:!0;e.find("option").each(function(c){this.selected=0===c&&g;if(a(this).val()===b)return this.selected=!0,!1});if(void 0!==b)d[t]=b,l++;else try{delete c.postData[t]}catch(q){}break;
case "text":e.val(b||"");if(void 0!==b)d[t]=b,l++;else try{delete c.postData[t]}catch(p){}break;case "custom":a.isFunction(m.custom_value)&&0<e.length&&"SPAN"===e[0].nodeName.toUpperCase()&&m.custom_value.call(f,e.children(".customelement").filter(":first"),"set",b||"")}});var q=0<l?!0:!1;c.resetsearch=!0;if(m.stringResult||m.searchOperators||"local"===c.datatype){var p='{"groupOp":"'+m.groupOp+'","rules":[',n=0;a.each(d,function(a,b){0<n&&(p+=",");p+='{"field":"'+a+'",';p+='"op":"eq",';p+='"data":"'+
(b+"").replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"}';n++});p+="]}";a.extend(c.postData,{filters:p});a.each(["searchField","searchString","searchOper"],function(a,b){c.postData.hasOwnProperty(b)&&delete c.postData[b]})}else a.extend(c.postData,d);var v;c.searchurl&&(v=c.url,b.jqGrid("setGridParam",{url:c.searchurl}));var A="stop"===b.triggerHandler("jqGridToolbarBeforeClear")?!0:!1;!A&&a.isFunction(m.beforeClear)&&(A=m.beforeClear.call(f));A||e&&b.jqGrid("setGridParam",{search:q}).trigger("reloadGrid",
[a.extend({page:1},m.reloadGridResetOptions||{})]);v&&b.jqGrid("setGridParam",{url:v});b.triggerHandler("jqGridToolbarAfterClear");a.isFunction(m.afterClear)&&m.afterClear()};f.toggleToolbar=function(){var b=a("tr.ui-search-toolbar",h.hDiv),e=!0===c.frozenColumns?a("tr.ui-search-toolbar",h.fhDiv):!1;"none"===b.css("display")?(b.show(),e&&e.show()):(b.hide(),e&&e.hide())}}})},destroyFilterToolbar:function(){return this.each(function(){this.ftoolbar&&(this.toggleToolbar=this.clearToolbar=this.triggerToolbar=
null,this.ftoolbar=!1,a(this.grid.hDiv).find("table thead tr.ui-search-toolbar").remove())})},destroyGroupHeader:function(d){void 0===d&&(d=!0);return this.each(function(){var f,h,b,c;f=this.grid;var e=this.p.colModel,l=a("table.ui-jqgrid-htable thead",f.hDiv);if(f){a(this).unbind(".setGroupHeaders");var m=a("<tr>",{role:"row"}).addClass("ui-jqgrid-labels"),g=f.headers;f=0;for(h=g.length;f<h;f++){b=e[f].hidden?"none":"";b=a(g[f].el).width(g[f].width).css("display",b);try{b.removeAttr("rowSpan")}catch(t){b.attr("rowSpan",
1)}m.append(b);c=b.children("span.ui-jqgrid-resize");0<c.length&&(c[0].style.height="");b.children("div")[0].style.top=""}a(l).children("tr.ui-jqgrid-labels").remove();a(l).prepend(m);!0===d&&a(this).jqGrid("setGridParam",{groupHeader:null})}})},setGroupHeaders:function(d){d=a.extend({useColSpanStyle:!1,applyLabelClasses:!0,groupHeaders:[]},d||{});return this.each(function(){this.p.groupHeader=d;var f,h,b=0,c,e,l,m,g,t,w=this.p.colModel,A=w.length,q=this.grid.headers,r=a("table.ui-jqgrid-htable",
this.grid.hDiv),E=p.isCellClassHidden,C=r.children("thead").children("tr.ui-jqgrid-labels"),B=C.last().addClass("jqg-second-row-header");c=r.children("thead");var D=r.find(".jqg-first-row-header");void 0===D[0]?D=a("<tr>",{role:"row","aria-hidden":"true"}).addClass("jqg-first-row-header").css("height","auto"):D.empty();var z=function(a,b){var c=b.length,e;for(e=0;e<c;e++)if(b[e].startColumnName===a)return e;return-1};a(this).prepend(c);c=a("<tr>",{role:"row"}).addClass("ui-jqgrid-labels jqg-third-row-header");
for(f=0;f<A;f++)if(l=q[f].el,m=a(l),h=w[f],e={height:"0",width:q[f].width+"px",display:h.hidden?"none":""},a("<th>",{role:"gridcell"}).css(e).addClass("ui-first-th-"+this.p.direction+(d.applyLabelClasses?" "+(h.labelClasses||""):"")).appendTo(D),l.style.width="",e=n.call(this,"colHeaders","ui-th-column-header ui-th-"+this.p.direction+" "+(d.applyLabelClasses?h.labelClasses||"":"")),g=z(h.name,d.groupHeaders),0<=g){g=d.groupHeaders[g];b=g.numberOfColumns;t=g.titleText;for(g=h=0;g<b&&f+g<A;g++)w[f+
g].hidden||E(w[f+g].classes)||a(q[f+g].el).is(":hidden")||h++;e=a("<th>").attr({role:"columnheader"}).addClass(e).css({height:"22px","border-top":"0 none"}).html(t);0<h&&e.attr("colspan",String(h));this.p.headertitles&&e.attr("title",e.text());0===h&&e.hide();m.before(e);c.append(l);--b}else 0===b?d.useColSpanStyle?m.attr("rowspan",C.length+1):(a("<th>",{role:"columnheader"}).addClass(e).css({display:h.hidden?"none":"","border-top":"0 none"}).insertBefore(m),c.append(l)):(c.append(l),b--);w=a(this).children("thead");
w.prepend(D);c.insertAfter(B);r.append(w);d.useColSpanStyle&&(r.find("span.ui-jqgrid-resize").each(function(){var b=a(this).parent();b.is(":visible")&&(this.style.cssText="height: "+b.height()+"px !important; cursor: col-resize;")}),r.find(".ui-th-column>div").each(function(){var b=a(this),c=b.parent();c.is(":visible")&&c.is(":has(span.ui-jqgrid-resize)")&&!b.hasClass("ui-jqgrid-rotate")&&!b.hasClass("ui-jqgrid-rotateOldIE")&&b.css("top",(c.height()-b.outerHeight(!0))/2+"px")}));a(this).triggerHandler("jqGridAfterSetGroupHeaders")})},
setFrozenColumns:function(){return this.each(function(){var d=this,f=a(d),h=d.p,b=d.grid;if(b&&null!=h&&!0!==h.frozenColumns){var c=h.colModel,e,l=c.length,m=-1,g=!1,t=[],p=u(h.id),A=n.call(d,"states.hover"),q=n.call(d,"states.disabled");if(!0!==h.subGrid&&!0!==h.treeGrid&&!h.scroll){for(e=0;e<l&&!0===c[e].frozen;e++)g=!0,m=e,t.push("#jqgh_"+p+"_"+u(c[e].name));h.sortable&&(c=a(b.hDiv).find(".ui-jqgrid-htable .ui-jqgrid-labels"),c.sortable("destroy"),f.jqGrid("setGridParam",{sortable:{options:{items:0<
t.length?">th:not(:has("+t.join(",")+"),:hidden)":">th:not(:hidden)"}}}),f.jqGrid("sortableColumns",c));if(0<=m&&g){g=h.caption?a(b.cDiv).outerHeight():0;t=a(".ui-jqgrid-htable",h.gView).height();h.toppager&&(g+=a(b.topDiv).outerHeight());!0===h.toolbar[0]&&"bottom"!==h.toolbar[1]&&(g+=a(b.uDiv).outerHeight());b.fhDiv=a('<div style="position:absolute;overflow:hidden;" + (p.direction === "rtl" ? "right:0;" : "left:0;") + "top:'+g+"px;height:"+t+'px;" class="'+n.call(d,"hDiv","frozen-div ui-jqgrid-hdiv")+
'"></div>');b.fbDiv=a('<div style="position:absolute;overflow:hidden;" + (p.direction === "rtl" ? "right:0;" : "left:0;") + "top:'+(parseInt(g,10)+parseInt(t,10)+1)+'px;overflow:hidden" class="frozen-bdiv ui-jqgrid-bdiv"></div>');a(h.gView).append(b.fhDiv);c=a(".ui-jqgrid-htable",h.gView).clone(!0);if(h.groupHeader){a("tr.jqg-first-row-header",c).each(function(){a("th:gt("+m+")",this).remove()});a("tr.jqg-third-row-header",c).each(function(){a(this).children("th[id]").each(function(){var b=a(this).attr("id");
b&&b.substr(0,d.id.length+1)===d.id+"_"&&(b=b.substr(d.id.length+1),h.iColByName[b]>m&&a(this).remove())})});var r=-1,E=-1,C,B;a("tr.jqg-second-row-header th",c).each(function(){C=parseInt(a(this).attr("colspan")||1,10);B=parseInt(a(this).attr("rowspan")||1,10);1<B?(r++,E++):C&&(r+=C,E++);if(r===m)return!1});r!==m&&(E=m);a("tr.jqg-second-row-header",c).each(function(){a("th:gt("+E+")",this).remove()})}else a("tr",c).each(function(){a("th:gt("+m+")",this).remove()});a(c).width(1);a(b.fhDiv).append(c).mousemove(function(a){if(b.resizing)return b.dragMove(a),
!1}).scroll(function(){this.scrollLeft=0});h.footerrow&&(c=a(".ui-jqgrid-bdiv",h.gView).height(),b.fsDiv=a('<div style="position:absolute;" + (p.direction === "rtl" ? "right:0;" : "left:0;") + "top:'+(parseInt(g,10)+parseInt(t,10)+parseInt(c,10)+1)+'px;" class="frozen-sdiv ui-jqgrid-sdiv"></div>'),a(h.gView).append(b.fsDiv),g=a(".ui-jqgrid-ftable",h.gView).clone(!0),a("tr",g).each(function(){a("td:gt("+m+")",this).remove()}),a(g).width(1),a(b.fsDiv).append(g));f.bind("jqGridSortCol.setFrozenColumns",
function(c,e,d){c=a("tr.ui-jqgrid-labels:last th:eq("+h.lastsort+")",b.fhDiv);e=a("tr.ui-jqgrid-labels:last th:eq("+d+")",b.fhDiv);a("span.ui-grid-ico-sort",c).addClass(q);a(c).attr("aria-selected","false");a("span.ui-icon-"+h.sortorder,e).removeClass(q);a(e).attr("aria-selected","true");h.viewsortcols[0]||h.lastsort===d||(a("span.s-ico",c).hide(),a("span.s-ico",e).show())});a(h.gView).append(b.fbDiv);a(b.bDiv).scroll(function(){a(b.fbDiv).scrollTop(a(this).scrollTop())});!0===h.hoverrows&&a(h.idSel).unbind("mouseover").unbind("mouseout");
var D=function(a,b){var c=a.height();1<=Math.abs(c-b)&&(a.height(b),c=a.height(),1<=Math.abs(b-c)&&a.height(b+Math.round(b-c)))},z=function(a,b){var c=a.width();1<=Math.abs(c-b)&&(a.width(b),c=a.width(),1<=Math.abs(b-c)&&a.width(b+Math.round(b-c)))},v=function(b,c){var d,g,l,f,t,q,p,n,v=a(c).position().top,A,w;if(null!=b&&0<b.length){b.css("rtl"===h.direction?{top:v,right:0}:{top:v,left:0});l=b.children("table").children("tbody,thead").children("tr");f=a(c).children("div").children("table").children("tbody,thead").children("tr");
g=Math.min(l.length,f.length);A=0<g?a(l[0]).position().top:0;w=0<g?a(f[0]).position().top:0;for(d=0;d<g;d++){t=a(f[d]);v=t.position().top;q=a(l[d]);p=q.position().top;n=t.height();if(null!=h.groupHeader&&h.groupHeader.useColSpanStyle&&0===n)for(e=n=0;e<m;e++)"TH"===t[0].cells[e].nodeName.toUpperCase()&&(n=Math.max(n,a(t[0].cells[e]).height()));t=n+(v-w)+(A-p);D(q,t)}D(b,c.clientHeight)}};f.bind("jqGridAfterGridComplete.setFrozenColumns",function(){a(h.idSel+"_frozen").remove();a(b.fbDiv).height(b.hDiv.clientHeight);
var c=a(this).clone(!0),e=c[0].rows,d=f[0].rows;a(e).filter("tr[role=row]").each(function(){a(this.cells).filter("td[role=gridcell]:gt("+m+")").remove()});b.fbRows=e;c.width(1).attr("id",h.id+"_frozen");c.appendTo(b.fbDiv);if(!0===h.hoverrows){var g=function(b,c,e){a(b)[c](A);a(e[b.rowIndex])[c](A)};a(e).filter(".jqgrow").hover(function(){g(this,"addClass",d)},function(){g(this,"removeClass",d)});a(d).filter(".jqgrow").hover(function(){g(this,"addClass",e)},function(){g(this,"removeClass",e)})}v(b.fhDiv,
b.hDiv);v(b.fbDiv,b.bDiv);b.sDiv&&v(b.fsDiv,b.sDiv)});var V=function(){a(b.fbDiv).scrollTop(a(b.bDiv).scrollTop());v(b.fhDiv,b.hDiv);v(b.fbDiv,b.bDiv);b.sDiv&&v(b.fsDiv,b.sDiv);var c=b.fhDiv[0].clientWidth;null!=b.fhDiv&&1<=b.fhDiv.length&&D(a(b.fhDiv),b.hDiv.clientHeight);null!=b.fbDiv&&0<b.fbDiv.length&&z(a(b.fbDiv),c);null!=b.fsDiv&&0<=b.fsDiv.length&&z(a(b.fsDiv),c)};a(h.gBox).bind("resizestop.setFrozenColumns",function(){setTimeout(function(){V()},50)});f.bind("jqGridInlineEditRow.setFrozenColumns jqGridAfterEditCell.setFrozenColumns jqGridAfterRestoreCell.setFrozenColumns jqGridInlineAfterRestoreRow.setFrozenColumns jqGridAfterSaveCell.setFrozenColumns jqGridInlineAfterSaveRow.setFrozenColumns jqGridResetFrozenHeights.setFrozenColumns jqGridGroupingClickGroup.setFrozenColumns jqGridResizeStop.setFrozenColumns",
V);b.hDiv.loading||f.triggerHandler("jqGridAfterGridComplete");h.frozenColumns=!0}}}})},destroyFrozenColumns:function(){return this.each(function(){var d=a(this),f=this.grid,h=this.p,b=u(h.id);if(f&&!0===h.frozenColumns){a(f.fhDiv).remove();a(f.fbDiv).remove();f.fhDiv=null;f.fbDiv=null;f.fbRows=null;h.footerrow&&(a(f.fsDiv).remove(),f.fsDiv=null);d.unbind(".setFrozenColumns");if(!0===h.hoverrows){var c,e=n.call(this,"states.hover");d.bind("mouseover",function(b){c=a(b.target).closest("tr.jqgrow");
"ui-subgrid"!==a(c).attr("class")&&a(c).addClass(e)}).bind("mouseout",function(b){c=a(b.target).closest("tr.jqgrow");a(c).removeClass(e)})}h.frozenColumns=!1;h.sortable&&(f=a(f.hDiv).find(".ui-jqgrid-htable .ui-jqgrid-labels"),f.sortable("destroy"),d.jqGrid("setGridParam",{sortable:{options:{items:">th:not(:has(#jqgh_"+b+"_cb,#jqgh_"+b+"_rn,#jqgh_"+b+"_subgrid),:hidden)"}}}),d.jqGrid("sortableColumns",f))}})}})})(jQuery);
(function(a){var p=a.jgrid;a.fn.jqFilter=function(r){if("string"===typeof r){var u=a.fn.jqFilter[r];if(!u)throw"jqFilter - No such method: "+r;var n=a.makeArray(arguments).slice(1);return u.apply(this,n)}var d=a.extend(!0,{filter:null,columns:[],onChange:null,afterRedraw:null,checkValues:null,error:!1,errmsg:"",errorcheck:!0,showQuery:!0,sopt:null,ops:[],operands:null,numopts:"eq ne lt le gt ge nu nn in ni".split(" "),stropts:"eq ne bw bn ew en cn nc nu nn in ni".split(" "),strarr:["text","string",
"blob"],groupOps:[{op:"AND",text:"AND"},{op:"OR",text:"OR"}],groupButton:!0,ruleButtons:!0,direction:"ltr"},p.filter,r||{});return this.each(function(){if(!this.filter){this.p=d;if(null===d.filter||void 0===d.filter)d.filter={groupOp:d.groupOps[0].op,rules:[],groups:[]};var f,h=d.columns.length,b,c=/msie/i.test(navigator.userAgent)&&!window.opera,e=function(){return a("#"+p.jqID(d.id))[0]||null},l=p.getRes(p.guiStyles[e().p.guiStyle],"states.error"),m=p.getRes(p.guiStyles[e().p.guiStyle],"dialog.content");
d.initFilter=a.extend(!0,{},d.filter);if(h){for(f=0;f<h;f++)b=d.columns[f],b.stype?b.inputtype=b.stype:b.inputtype||(b.inputtype="text"),b.sorttype?b.searchtype=b.sorttype:b.searchtype||(b.searchtype="string"),void 0===b.hidden&&(b.hidden=!1),b.label||(b.label=b.name),b.index&&(b.name=b.index),b.hasOwnProperty("searchoptions")||(b.searchoptions={}),b.hasOwnProperty("searchrules")||(b.searchrules={});d.showQuery&&a(this).append("<table class='queryresult "+m+"' style='display:block;max-width:440px;border:0px none;' dir='"+
d.direction+"'><tbody><tr><td class='query'></td></tr></tbody></table>");var g=function(b,c){var g=[!0,""],l=e();if(a.isFunction(c.searchrules))g=c.searchrules.call(l,b,c);else if(p&&p.checkValues)try{g=p.checkValues.call(l,b,-1,c.searchrules,c.label)}catch(f){}g&&g.length&&!1===g[0]&&(d.error=!g[0],d.errmsg=g[1])};this.onchange=function(){d.error=!1;d.errmsg="";return a.isFunction(d.onChange)?d.onChange.call(this,d):!1};this.reDraw=function(){a("table.group:first",this).remove();var b=this.createTableForGroup(d.filter,
null);a(this).append(b);a.isFunction(d.afterRedraw)&&d.afterRedraw.call(this,d)};this.createTableForGroup=function(b,c){var e=this,g,f=a("<table class='group "+m+"' style='border:0px none;'><tbody></tbody></table>"),h="left";"rtl"===d.direction&&(h="right",f.attr("dir","rtl"));null===c&&f.append("<tr class='error' style='display:none;'><th colspan='5' class='"+l+"' align='"+h+"'></th></tr>");var p=a("<tr></tr>");f.append(p);h=a("<th colspan='5' align='"+h+"'></th>");p.append(h);if(!0===d.ruleButtons){var n=
a("<select class='opsel'></select>");h.append(n);var p="",r;for(g=0;g<d.groupOps.length;g++)r=b.groupOp===e.p.groupOps[g].op?" selected='selected'":"",p+="<option value='"+e.p.groupOps[g].op+"'"+r+">"+e.p.groupOps[g].text+"</option>";n.append(p).bind("change",function(){b.groupOp=a(n).val();e.onchange()})}p="<span></span>";d.groupButton&&(p=a("<input type='button' value='+ {}' title='Add subgroup' class='add-group'/>"),p.bind("click",function(){void 0===b.groups&&(b.groups=[]);b.groups.push({groupOp:d.groupOps[0].op,
rules:[],groups:[]});e.reDraw();e.onchange();return!1}));h.append(p);if(!0===d.ruleButtons){var p=a("<input type='button' value='+' title='Add rule' class='add-rule ui-add'/>"),z;p.bind("click",function(){var c,d,l;void 0===b.rules&&(b.rules=[]);for(g=0;g<e.p.columns.length;g++)if(c=void 0===e.p.columns[g].search?!0:e.p.columns[g].search,d=!0===e.p.columns[g].hidden,(l=!0===e.p.columns[g].searchoptions.searchhidden)&&c||c&&!d){z=e.p.columns[g];break}c=z.searchoptions.sopt?z.searchoptions.sopt:e.p.sopt?
e.p.sopt:-1!==a.inArray(z.searchtype,e.p.strarr)?e.p.stropts:e.p.numopts;b.rules.push({field:z.name,op:c[0],data:""});e.reDraw();return!1});h.append(p)}null!==c&&(p=a("<input type='button' value='-' title='Delete group' class='delete-group'/>"),h.append(p),p.bind("click",function(){for(g=0;g<c.groups.length;g++)if(c.groups[g]===b){c.groups.splice(g,1);break}e.reDraw();e.onchange();return!1}));if(void 0!==b.groups)for(g=0;g<b.groups.length;g++)h=a("<tr></tr>"),f.append(h),p=a("<td class='first'></td>"),
h.append(p),p=a("<td colspan='4'></td>"),p.append(this.createTableForGroup(b.groups[g],b)),h.append(p);void 0===b.groupOp&&(b.groupOp=e.p.groupOps[0].op);if(void 0!==b.rules)for(g=0;g<b.rules.length;g++)f.append(this.createTableRowForRule(b.rules[g],b));return f};this.createTableRowForRule=function(b,g){var l=this,f=e(),h=a("<tr></tr>"),m,n,B,r="",z;h.append("<td class='first'></td>");var v=a("<td class='columns'></td>");h.append(v);var u=a("<select></select>"),I,G=[];v.append(u);u.bind("change",
function(){b.field=a(u).val();var e=a(this).parents("tr:first"),d,g;for(g=0;g<l.p.columns.length;g++)if(l.p.columns[g].name===b.field){d=l.p.columns[g];break}if(d){var h=a.extend({},d.searchoptions||{},{id:p.randId(),name:d.name,mode:"search"});c&&"text"===d.inputtype&&!h.size&&(h.size=10);var m=p.createEl.call(f,d.inputtype,h,"",!0,l.p.ajaxSelectOptions||{},!0);a(m).addClass("input-elm");n=h.sopt?h.sopt:l.p.sopt?l.p.sopt:-1!==a.inArray(d.searchtype,l.p.strarr)?l.p.stropts:l.p.numopts;d="";var v=
0,w,r;G=[];a.each(l.p.ops,function(){G.push(this.oper)});l.p.cops&&a.each(l.p.cops,function(a){G.push(a)});for(g=0;g<n.length;g++)r=n[g],I=a.inArray(n[g],G),-1!==I&&(w=l.p.ops[I],w=void 0!==w?w.text:l.p.cops[r].text,0===v&&(b.op=r),d+="<option value='"+r+"'>"+w+"</option>",v++);a(".selectopts",e).empty().append(d);a(".selectopts",e)[0].selectedIndex=0;p.msie&&9>p.msiever()&&(g=parseInt(a("select.selectopts",e)[0].offsetWidth,10)+1,a(".selectopts",e).width(g),a(".selectopts",e).css("width","auto"));
a(".data",e).empty().append(m);p.bindEv.call(f,m,h);a(".input-elm",e).bind("change",function(c){c=c.target;b.data="SPAN"===c.nodeName.toUpperCase()&&h&&a.isFunction(h.custom_value)?h.custom_value.call(f,a(c).children(".customelement:first"),"get"):c.value;l.onchange()});setTimeout(function(){b.data=a(m).val();l.onchange()},0)}});var v=0,S,U;for(m=0;m<l.p.columns.length;m++)if(z=void 0===l.p.columns[m].search?!0:l.p.columns[m].search,S=!0===l.p.columns[m].hidden,(U=!0===l.p.columns[m].searchoptions.searchhidden)&&
z||z&&!S)z="",b.field===l.p.columns[m].name&&(z=" selected='selected'",v=m),r+="<option value='"+l.p.columns[m].name+"'"+z+">"+l.p.columns[m].label+"</option>";u.append(r);r=a("<td class='operators'></td>");h.append(r);B=d.columns[v];c&&"text"===B.inputtype&&!B.searchoptions.size&&(B.searchoptions.size=10);v=p.createEl.call(f,B.inputtype,a.extend({},B.searchoptions||{},{id:p.randId(),name:B.name}),b.data,!0,l.p.ajaxSelectOptions||{},!0);if("nu"===b.op||"nn"===b.op)a(v).attr("readonly","true"),a(v).attr("disabled",
"true");var F=a("<select class='selectopts'></select>");r.append(F);F.bind("change",function(){b.op=a(F).val();var c=a(this).parents("tr:first"),c=a(".input-elm",c)[0];"nu"===b.op||"nn"===b.op?(b.data="","SELECT"!==c.tagName.toUpperCase()&&(c.value=""),c.setAttribute("readonly","true"),c.setAttribute("disabled","true")):("SELECT"===c.tagName.toUpperCase()&&(b.data=c.value),c.removeAttribute("readonly"),c.removeAttribute("disabled"));l.onchange()});n=B.searchoptions.sopt?B.searchoptions.sopt:l.p.sopt?
l.p.sopt:-1!==a.inArray(B.searchtype,l.p.strarr)?l.p.stropts:l.p.numopts;r="";a.each(l.p.ops,function(){G.push(this.oper)});l.p.cops&&a.each(l.p.cops,function(a){G.push(a)});for(m=0;m<n.length;m++)U=n[m],I=a.inArray(n[m],G),-1!==I&&(S=l.p.ops[I],z=b.op===U?" selected='selected'":"",r+="<option value='"+U+"'"+z+">"+(void 0!==S?S.text:l.p.cops[U].text)+"</option>");F.append(r);r=a("<td class='data'></td>");h.append(r);r.append(v);p.bindEv.call(f,v,B.searchoptions);a(v).addClass("input-elm").bind("change",
function(){b.data="custom"===B.inputtype?B.searchoptions.custom_value.call(f,a(this).children(".customelement:first"),"get"):a(this).val();l.onchange()});r=a("<td></td>");h.append(r);!0===d.ruleButtons&&(v=a("<input type='button' value='-' title='Delete rule' class='delete-rule ui-del'/>"),r.append(v),v.bind("click",function(){for(m=0;m<g.rules.length;m++)if(g.rules[m]===b){g.rules.splice(m,1);break}l.reDraw();l.onchange();return!1}));return h};this.getStringForGroup=function(a){var b="(",c;if(void 0!==
a.groups)for(c=0;c<a.groups.length;c++){1<b.length&&(b+=" "+a.groupOp+" ");try{b+=this.getStringForGroup(a.groups[c])}catch(e){alert(e)}}if(void 0!==a.rules)try{for(c=0;c<a.rules.length;c++)1<b.length&&(b+=" "+a.groupOp+" "),b+=this.getStringForRule(a.rules[c])}catch(d){alert(d)}b+=")";return"()"===b?"":b};this.getStringForRule=function(b){var c="",e="",l,f,h=b.data,m;for(l=0;l<d.ops.length;l++)if(d.ops[l].oper===b.op){c=d.operands.hasOwnProperty(b.op)?d.operands[b.op]:"";e=d.ops[l].oper;break}if(""===
e&&null!=d.cops)for(m in d.cops)if(d.cops.hasOwnProperty(m)&&(e=m,c=d.cops[m].operand,a.isFunction(d.cops[m].buildQueryValue)))return d.cops[m].buildQueryValue.call(d,{cmName:b.field,searchValue:h,operand:c});for(l=0;l<d.columns.length;l++)if(d.columns[l].name===b.field){f=d.columns[l];break}if(null==f)return"";if("bw"===e||"bn"===e)h+="%";if("ew"===e||"en"===e)h="%"+h;if("cn"===e||"nc"===e)h="%"+h+"%";if("in"===e||"ni"===e)h=" ("+h+")";d.errorcheck&&g(b.data,f);return-1!==a.inArray(f.searchtype,
["int","integer","float","number","currency"])||"nn"===e||"nu"===e?b.field+" "+c+" "+h:b.field+" "+c+' "'+h+'"'};this.resetFilter=function(){d.filter=a.extend(!0,{},d.initFilter);this.reDraw();this.onchange()};this.hideError=function(){a("th."+l,this).html("");a("tr.error",this).hide()};this.showError=function(){a("th."+l,this).html(d.errmsg);a("tr.error",this).show()};this.toUserFriendlyString=function(){return this.getStringForGroup(d.filter)};this.toString=function(){function a(c){var e="(",d;
if(void 0!==c.groups)for(d=0;d<c.groups.length;d++)1<e.length&&(e="OR"===c.groupOp?e+" || ":e+" && "),e+=a(c.groups[d]);if(void 0!==c.rules)for(d=0;d<c.rules.length;d++){1<e.length&&(e="OR"===c.groupOp?e+" || ":e+" && ");var l=c.rules[d];if(b.p.errorcheck){for(var f=void 0,h=void 0,f=0;f<b.p.columns.length;f++)if(b.p.columns[f].name===l.field){h=b.p.columns[f];break}h&&g(l.data,h)}e+=l.op+"(item."+l.field+",'"+l.data+"')"}e+=")";return"()"===e?"":e}var b=this;return a(d.filter)};this.reDraw();if(d.showQuery)this.onchange();
this.filter=!0}}})};a.extend(a.fn.jqFilter,{toSQLString:function(){var a="";this.each(function(){a=this.toUserFriendlyString()});return a},filterData:function(){var a;this.each(function(){a=this.p.filter});return a},getParameter:function(a){return void 0!==a&&this.p.hasOwnProperty(a)?this.p[a]:this.p},resetFilter:function(){return this.each(function(){this.resetFilter()})},addFilter:function(a){"string"===typeof a&&(a=p.parse(a));this.each(function(){this.p.filter=a;this.reDraw();this.onchange()})}})})(jQuery);
(function(a){var p=a.jgrid,r=p.feedback,u=p.fullBoolFeedback,n=p.jqID,d=p.hideModal,f=p.viewModal,h=p.createModal,b=p.info_dialog,c=p.mergeCssClasses,e=p.hasOneFromClasses,l=a.fn.jqGrid,m=p.builderFmButon,g=function(a,b){var c=a[0].style[b];return 0<=c.indexOf("px")?parseFloat(c):c},t=function(b,c,e){var d=e.w;c=a(c);var l,f,h;e.c.toTop?(l=this.closest(".ui-jqgrid").offset(),f=d.offset(),h=f.top-l.top,l=f.left-l.left):(h=g(d,"top"),l=g(d,"left"));this.data(b,{top:h,left:l,width:g(d,"width"),height:g(d,
"height"),dataheight:g(c,"height")||"auto",datawidth:g(c,"width")||"auto"});d.remove();e.o&&e.o.remove()},w=function(a,b,e){!0===b[0]&&(e="<span class='"+c("fm-button-icon",e,b[2])+"'></span>","right"===b[1]?a.addClass("fm-button-icon-right").append(e):a.addClass("fm-button-icon-left").prepend(e))},A=function(a,b){return p.mergeCssClasses(p.getRes(p.guiStyles[this.p.guiStyle],a),b||"")},q=function(a){return A.call(this,"states."+a)},y=function(a){return" "===a||" "===a||1===a.length&&160===
a.charCodeAt(0)};p.extend({searchGrid:function(b){return this.each(function(){function e(b){H("beforeShow",b)&&(a(S).data("onClose",v.onClose),f(S,{gbox:U,jqm:v.jqModal,overlay:v.overlay,modal:v.modal,overlayClass:v.overlayClass,toTop:v.toTop,onHide:function(a){t.call(w,"searchProp",y,a)}}),H("afterShow",b))}var g=this,w=a(g),z=g.p;if(g.grid&&null!=z){var v=a.extend(!0,{recreateFilter:!1,drag:!0,sField:"searchField",sValue:"searchString",sOper:"searchOper",sFilter:"filters",loadDefaults:!0,beforeShowSearch:null,
afterShowSearch:null,onInitializeSearch:null,afterRedraw:null,afterChange:null,closeAfterSearch:!1,closeAfterReset:!1,closeOnEscape:!1,searchOnEnter:!1,multipleSearch:!1,multipleGroup:!1,top:0,left:0,removemodal:!0,resize:!0,width:450,height:"auto",dataheight:"auto",showQuery:!1,errorcheck:!0,sopt:null,stringResult:void 0,onClose:null,onSearch:null,onReset:null,columns:[],tmplNames:null,tmplFilters:null,tmplLabel:" Template: ",showOnLoad:!1,layer:null,operands:{eq:"=",ne:"<>",lt:"<",le:"<=",gt:">",
ge:">=",bw:"LIKE",bn:"NOT LIKE","in":"IN",ni:"NOT IN",ew:"LIKE",en:"NOT LIKE",cn:"LIKE",nc:"NOT LIKE",nu:"IS NULL",nn:"IS NOT NULL"}},l.getGridRes.call(w,"search"),p.search||{},z.searching||{},b||{}),y="fbox_"+z.id,I=v.commonIconClass,G={themodal:"searchmod"+y,modalhead:"searchhd"+y,modalcontent:"searchcnt"+y,resizeAlso:y},S="#"+n(G.themodal),U=z.gBox,F=z.gView,J=z.postData[v.sFilter],H=function(){var b=a.makeArray(arguments);b.unshift("Search");b.unshift("Filter");b.unshift(v);return r.apply(g,b)};
"string"===typeof J&&(J=p.parse(J));!0===v.recreateFilter?a(S).remove():w.data("searchProp")&&a.extend(v,w.data("searchProp"));if(void 0!==a(S)[0])e(a("#fbox_"+z.idSel));else{var N=a("<div><div id='"+y+"' class='searchFilter' style='overflow:auto'></div></div>").insertBefore(F);"rtl"===z.direction&&N.attr("dir","rtl");var Y="",X="",T,x=!1,O,aa=-1,Q=a.extend([],z.colModel);O=m.call(g,y+"_search",v.Find,c(I,v.findDialogIcon),"right");var K=m.call(g,y+"_reset",v.Reset,c(I,v.resetDialogIcon),"left");
v.showQuery&&(Y=m.call(g,y+"_query","Query",c(I,v.queryDialogIcon),"left")+" ");v.columns.length?(Q=v.columns,aa=0,T=Q[0].index||Q[0].name):a.each(Q,function(a,b){b.label||(b.label=z.colNames[a]);if(!x){var c=void 0===b.search?!0:b.search,e=!0===b.hidden;if(b.searchoptions&&!0===b.searchoptions.searchhidden&&c||c&&!e)x=!0,T=b.index||b.name,aa=a}});if(!J&&T||!1===v.multipleSearch)I="eq",0<=aa&&Q[aa].searchoptions&&Q[aa].searchoptions.sopt?I=Q[aa].searchoptions.sopt[0]:v.sopt&&v.sopt.length&&(I=
v.sopt[0]),J={groupOp:"AND",rules:[{field:T,op:I,data:""}]};x=!1;v.tmplNames&&v.tmplNames.length&&(x=!0,X=v.tmplLabel,X+="<select class='ui-template'>",X+="<option value='default'>Default</option>",a.each(v.tmplNames,function(a,b){X+="<option value='"+a+"'>"+b+"</option>"}),X+="</select>");O="<table class='EditTable' style='border:0px none;margin-top:5px' id='"+y+"_2'><tbody><tr><td colspan='2'><hr class='"+A.call(g,"dialog.hr")+"' style='margin:1px'/></td></tr><tr><td class='EditButton EditButton-"+
z.direction+"' style='float:"+("rtl"===z.direction?"right":"left")+";'>"+K+X+"</td><td class='EditButton EditButton-"+z.direction+"'>"+Y+O+"</td></tr></tbody></table>";y=n(y);v.gbox="#gbox_"+y;v.height="auto";y="#"+y;a(y).jqFilter({columns:Q,filter:v.loadDefaults?J:null,showQuery:v.showQuery,errorcheck:v.errorcheck,sopt:v.sopt,groupButton:v.multipleGroup,ruleButtons:v.multipleSearch,afterRedraw:v.afterRedraw,ops:v.odata,cops:z.customSortOperations,operands:v.operands,ajaxSelectOptions:z.ajaxSelectOptions,
groupOps:v.groupOps,onChange:function(){this.p.showQuery&&a(".query",this).html(this.toUserFriendlyString());u.call(g,v.afterChange,"jqGridFilterAfterChange",a(y),v)},direction:z.direction,id:z.id});N.append(O);x&&v.tmplFilters&&v.tmplFilters.length&&a(".ui-template",N).bind("change",function(){var b=a(this).val();"default"===b?a(y).jqFilter("addFilter",J):a(y).jqFilter("addFilter",v.tmplFilters[parseInt(b,10)]);return!1});!0===v.multipleGroup&&(v.multipleSearch=!0);H("onInitialize",a(y));v.layer?
h.call(g,G,N,v,F,a(U)[0],"#"+n(v.layer),{position:"relative"}):h.call(g,G,N,v,F,a(U)[0]);(v.searchOnEnter||v.closeOnEscape)&&a(S).keydown(function(b){var c=a(b.target);if(!(!v.searchOnEnter||13!==b.which||c.hasClass("add-group")||c.hasClass("add-rule")||c.hasClass("delete-group")||c.hasClass("delete-rule")||c.hasClass("fm-button")&&c.is("[id$=_query]")))return a(y+"_search").click(),!1;if(v.closeOnEscape&&27===b.which)return a("#"+n(G.modalhead)).find(".ui-jqdialog-titlebar-close").click(),!1});Y&&
a(y+"_query").bind("click",function(){a(".queryresult",N).toggle();return!1});void 0===v.stringResult&&(v.stringResult=v.multipleSearch);a(y+"_search").bind("click",function(){var b={},c,e,l=a(y);e=l.find(".input-elm");e.filter(":focus")&&(e=e.filter(":focus"));e.change();e=l.jqFilter("filterData");if(v.errorcheck&&(l[0].hideError(),v.showQuery||l.jqFilter("toSQLString"),l[0].p.error))return l[0].showError(),!1;if(v.stringResult||"local"===z.datatype){try{c=xmlJsonClass.toJson(e,"","",!1)}catch(f){try{c=
JSON.stringify(e)}catch(h){}}"string"===typeof c&&(b[v.sFilter]=c,a.each([v.sField,v.sValue,v.sOper],function(){b[this]=""}))}else v.multipleSearch?(b[v.sFilter]=e,a.each([v.sField,v.sValue,v.sOper],function(){b[this]=""})):(b[v.sField]=e.rules[0].field,b[v.sValue]=e.rules[0].data,b[v.sOper]=e.rules[0].op,b[v.sFilter]="");z.search=!0;a.extend(z.postData,b);u.call(g,v.onSearch,"jqGridFilterSearch",z.filters)&&w.trigger("reloadGrid",[a.extend({page:1},v.reloadGridSearchOptions||{})]);v.closeAfterSearch&&
d(S,{gb:U,jqm:v.jqModal,onClose:v.onClose,removemodal:v.removemodal});return!1});a(y+"_reset").bind("click",function(){var b={},c=a(y);z.search=!1;z.resetsearch=!0;!1===v.multipleSearch?b[v.sField]=b[v.sValue]=b[v.sOper]="":b[v.sFilter]="";c[0].resetFilter();x&&a(".ui-template",N).val("default");a.extend(z.postData,b);u.call(g,v.onReset,"jqGridFilterReset")&&w.trigger("reloadGrid",[a.extend({page:1},v.reloadGridResetOptions||{})]);v.closeAfterReset&&d(S,{gb:U,jqm:v.jqModal,onClose:v.onClose,removemodal:v.removemodal});
return!1});e(a(y));var L=q.call(g,"hover");a(".fm-button:not(."+q.call(g,"disabled").split(" ").join(".")+")",N).hover(function(){a(this).addClass(L)},function(){a(this).removeClass(L)})}}})},editGridRow:function(g,u){return this.each(function(){function B(){a(K+" > tbody > tr > td .FormElement").each(function(){var c=a(".customelement",this),e=this.name;if(c.length){if(e=c.attr("name"),c=ha[e],void 0!==c&&(c=ca[c],c=c.editoptions||{},a.isFunction(c.custom_value))){try{if(P[e]=c.custom_value.call(J,
a("#"+n(e),K),"get"),void 0===P[e])throw"e1";}catch(d){"e1"===d?b.call(J,fa,"function 'custom_value' "+x.msg.novalue,x.bClose):b.call(J,fa,d.message,x.bClose)}return!0}}else{switch(a(this)[0].type){case "checkbox":P[e]=a(this).is(":checked")?a(this).val():a(this).data("offval");break;case "select-one":P[e]=a("option:selected",this).val();break;case "select-multiple":P[e]=a(this).val();P[e]=P[e]?P[e].join(","):"";a("option:selected",this).each(function(b,c){a(c).text()});break;case "password":case "text":case "textarea":case "button":P[e]=
a(this).val();break;case "date":P[e]=a(this).val(),3===String(P[e]).split("-").length&&(c=ha[e],void 0!==c&&(c=ca[c],c=c.formatoptions||{},c=c.newformat||X.call(H,"formatter.date.newformat"),P[e]=p.parseDate.call(H[0],"Y-m-d",P[e],c)))}N.autoencode&&(P[e]=p.htmlEncode(P[e]))}});return!0}function D(b,c,e){var d=0,g=[],f=!1,h="",k;for(k=1;k<=e;k++)h+="<td class='CaptionTD'> </td><td class='DataTD'> </td>";"_empty"!==b&&(f=l.getInd.call(H,b));a(ca).each(function(l){var k=this.name,m,t,q,v,
w;m=this.editable;var r=!1,z=!1;w="_empty"===b?"addForm":"editForm";a.isFunction(m)&&(m=m.call(J,{rowid:b,iCol:l,iRow:f,cmName:k,cm:this,mode:w}));v=(this.editrules&&!0===this.editrules.edithidden?0:!0===this.hidden||"hidden"===m)?"style='display:none'":"";switch(String(m).toLowerCase()){case "hidden":m=!0;break;case "disabled":r=m=!0;break;case "readonly":z=m=!0}if("cb"!==k&&"subgrid"!==k&&!0===m&&"rn"!==k){if(!1===f)q="";else{m=a(J.rows[f].cells[l]);try{q=a.unformat.call(J,m,{rowId:b,colModel:this},
l)}catch(B){q=this.edittype&&"textarea"===this.edittype?m.text():m.html()}y(q)&&(q="")}m=a.extend({},this.editoptions||{},{id:k,name:k,rowId:b,mode:w});var D=a.extend({},{elmprefix:"",elmsuffix:"",rowabove:!1,rowcontent:""},this.formoptions||{}),u=parseInt(D.rowpos,10)||d+1,C=parseInt(2*(parseInt(D.colpos,10)||1),10);"_empty"===b&&m.defaultValue&&(q=a.isFunction(m.defaultValue)?m.defaultValue.call(J):m.defaultValue);this.edittype||(this.edittype="text");N.autoencode&&(q=p.htmlDecode(q));w=p.createEl.call(J,
this.edittype,m,q,!1,a.extend({},p.ajaxOptions,N.ajaxSelectOptions||{}));if(x.checkOnSubmit||x.checkOnUpdate)x._savedData[k]=q;a(w).addClass("FormElement");-1<a.inArray(this.edittype,["text","textarea","password","select"])&&a(w).addClass(A.call(J,"dialog.dataField"));t=a(c).find("tr[data-rowpos="+u+"]");if(D.rowabove){var E=a("<tr><td class='contentinfo' colspan='"+2*e+"'>"+D.rowcontent+"</td></tr>");a(c).append(E);E[0].rp=u}0===t.length&&(t=a("<tr "+v+" data-rowpos='"+u+"'></tr>").addClass("FormData").attr("id",
"tr_"+k),a(t).append(h),a(c).append(t),t[0].rp=u);v=a("td:eq("+(C-2)+")",t[0]);t=a("td:eq("+(C-1)+")",t[0]);v.html(void 0===D.label?N.colNames[l]:D.label||" ");t[y(t.html())?"html":"append"](D.elmprefix).append(w).append(D.elmsuffix);r?(v.addClass(ga),t.addClass(ga),a(w).prop("readonly",!0),a(w).prop("disabled",!0)):z&&a(w).prop("readonly",!0);"custom"===this.edittype&&a.isFunction(m.custom_value)&&m.custom_value.call(J,a("#"+n(k),O),"set",q);p.bindEv.call(J,w,m);g[d]=l;d++}});0<d&&(k=a("<tr class='FormData' style='display:none'><td class='CaptionTD'> </td><td colspan='"+
(2*e-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='"+Y+"_id' value='"+b+"'/></td></tr>"),k[0].rp=d+999,a(c).append(k),x.checkOnSubmit||x.checkOnUpdate)&&(x._savedData[Y+"_id"]=b);return g}function z(c,e){var d,g=0,f,k,h,m,t;if(x.checkOnSubmit||x.checkOnUpdate)x._savedData={},x._savedData[Y+"_id"]=c;var q=N.colModel;if("_empty"===c)a(q).each(function(){d=this.name;h=a.extend({},this.editoptions||{});(k=a("#"+n(d),e))&&k.length&&null!==k[0]&&(m="","custom"===this.edittype&&
a.isFunction(h.custom_value)?h.custom_value.call(J,k,"set",m):h.defaultValue?(m=a.isFunction(h.defaultValue)?h.defaultValue.call(J):h.defaultValue,"checkbox"===k[0].type?(t=m.toLowerCase(),0>t.search(/(false|f|0|no|n|off|undefined)/i)&&""!==t?(k[0].checked=!0,k[0].defaultChecked=!0,k[0].value=m):(k[0].checked=!1,k[0].defaultChecked=!1)):k.val(m)):"checkbox"===k[0].type?(k[0].checked=!1,k[0].defaultChecked=!1,m=a(k).data("offval")):k[0].type&&"select"===k[0].type.substr(0,6)?k[0].selectedIndex=0:k.val(m),
!0===x.checkOnSubmit||x.checkOnUpdate)&&(x._savedData[d]=m)}),a("#id_g",e).val(c);else{var v=l.getInd.call(H,c,!0);v&&(a(v.cells).filter("td[role=gridcell]").each(function(l){d=q[l].name;if("cb"!==d&&"subgrid"!==d&&"rn"!==d&&!0===q[l].editable){try{f=a.unformat.call(J,a(this),{rowId:c,colModel:q[l]},l)}catch(k){f="textarea"===q[l].edittype?a(this).text():a(this).html()}N.autoencode&&(f=p.htmlDecode(f));if(!0===x.checkOnSubmit||x.checkOnUpdate)x._savedData[d]=f;d="#"+n(d);switch(q[l].edittype){case "password":case "text":case "button":case "image":case "textarea":y(f)&&
(f="");a(d,e).val(f);break;case "select":var h=f.split(","),h=a.map(h,function(b){return a.trim(b)});a(d+" option",e).each(function(){var b=a(this),c=a.trim(b.val()),b=a.trim(b.text());q[l].editoptions.multiple||a.trim(f)!==b&&h[0]!==b&&h[0]!==c?q[l].editoptions.multiple?-1<a.inArray(b,h)||-1<a.inArray(c,h)?this.selected=!0:this.selected=!1:this.selected=!1:this.selected=!0});break;case "checkbox":f=String(f);if(q[l].editoptions&&q[l].editoptions.value)if(q[l].editoptions.value.split(":")[0]===f)a(d,
e)[ba]({checked:!0,defaultChecked:!0});else a(d,e)[ba]({checked:!1,defaultChecked:!1});else f=f.toLowerCase(),0>f.search(/(false|f|0|no|n|off|undefined)/i)&&""!==f?(a(d,e)[ba]("checked",!0),a(d,e)[ba]("defaultChecked",!0)):(a(d,e)[ba]("checked",!1),a(d,e)[ba]("defaultChecked",!1));break;case "custom":try{if(q[l].editoptions&&a.isFunction(q[l].editoptions.custom_value))q[l].editoptions.custom_value.call(J,a(d,e),"set",f);else throw"e1";}catch(m){"e1"===m?b.call(J,fa,"function 'custom_value' "+x.msg.nodefined,
x.bClose):b.call(J,fa,m.message,x.bClose)}}g++}}),0<g&&a("#id_g",K).val(c))}}function v(){var b=x.url||N.editurl;a.each(ca,function(c,e){var d=e.name,g=P[d];"date"!==e.formatter||null!=e.formatoptions&&!0===e.formatoptions.sendFormatted||(P[d]=a.unformat.date.call(J,g,e));"clientArray"!==b&&e.editoptions&&!0===e.editoptions.NullIfEmpty&&P.hasOwnProperty(d)&&""===g&&(P[d]="null")})}function V(){var b=[!0,"",""],c={},e=N.prmNames,g,f,k,h,m,t=H.triggerHandler("jqGridAddEditBeforeCheckValues",[a(O),M]);
t&&"object"===typeof t&&(P=t);a.isFunction(x.beforeCheckValues)&&(t=x.beforeCheckValues.call(J,P,a(O),M))&&"object"===typeof t&&(P=t);for(k in P)if(P.hasOwnProperty(k)&&(b=p.checkValues.call(J,P[k],k),!1===b[0]))break;v();b[0]&&(c=H.triggerHandler("jqGridAddEditClickSubmit",[x,P,M]),void 0===c&&a.isFunction(x.onclickSubmit)&&(c=x.onclickSubmit.call(J,x,P,M)||{}),b=H.triggerHandler("jqGridAddEditBeforeSubmit",[P,a(O),M]),void 0===b&&(b=[!0,"",""]),b[0]&&a.isFunction(x.beforeSubmit)&&(b=x.beforeSubmit.call(J,
P,a(O),M)));if(b[0]&&!x.processing){x.processing=!0;a("#sData",L).addClass(Ea);k=x.url||N.editurl;f=e.oper;g="clientArray"===k&&!1!==N.keyName?N.keyName:e.id;P[f]="_empty"===a.trim(P[Y+"_id"])?e.addoper:e.editoper;P[f]!==e.addoper?P[g]=P[Y+"_id"]:void 0===P[g]&&(P[g]=P[Y+"_id"]);delete P[Y+"_id"];P=a.extend(P,x.editData,c);if(!0===N.treeGrid)for(m in P[f]===e.addoper&&(h=N.selrow,P["adjacency"===N.treeGridModel?N.treeReader.parent_id_field:"parent_id"]=h),N.treeReader)N.treeReader.hasOwnProperty(m)&&
(c=N.treeReader[m],!P.hasOwnProperty(c)||P[f]===e.addoper&&"parent_id_field"===m||delete P[c]);P[g]=p.stripPref(N.idPrefix,P[g]);m=a.extend({url:k,type:x.mtype,data:p.serializeFeedback.call(J,a.isFunction(x.serializeEditData)?x.serializeEditData:N.serializeEditData,"jqGridAddEditSerializeEditData",P),complete:function(c,k){a("#sData",L).removeClass(Ea);P[g]=N.idPrefix+a("#id_g",K).val();300<=c.status&&304!==c.status||0===c.status&&4===c.readyState?(b[0]=!1,b[1]=H.triggerHandler("jqGridAddEditErrorTextFormat",
[c,M]),a.isFunction(x.errorTextFormat)?b[1]=x.errorTextFormat.call(J,c,M):b[1]=k+" Status: '"+c.statusText+"'. Error code: "+c.status):(b=H.triggerHandler("jqGridAddEditAfterSubmit",[c,P,M]),void 0===b&&(b=[!0,"",""]),b[0]&&a.isFunction(x.afterSubmit)&&(b=x.afterSubmit.call(J,c,P,M)));if(!1===b[0])a("#FormError>td",K).html(b[1]),a("#FormError",K).show();else{N.autoencode&&a.each(P,function(a,b){P[a]=p.htmlDecode(b)});var m=[a.extend({},x.reloadGridOptions||{})];P[f]===e.addoper?(b[2]||(b[2]=p.randId()),
null==P[g]||"_empty"===P[g]||P[f]===e.addoper?P[g]=b[2]:b[2]=P[g],x.reloadAfterSubmit?H.trigger("reloadGrid",m):!0===N.treeGrid?l.addChildNode.call(H,b[2],h,P):l.addRowData.call(H,b[2],P,x.addedrow),x.closeAfterAdd?(!0!==N.treeGrid&&T.call(H,b[2]),d(R,{gb:W,jqm:x.jqModal,onClose:x.onClose,removemodal:x.removemodal,formprop:!x.recreateForm,form:x.form})):x.clearAfterAdd&&z("_empty",O)):(x.reloadAfterSubmit?(H.trigger("reloadGrid",m),x.closeAfterEdit||setTimeout(function(){T.call(H,P[g])},1E3)):!0===
N.treeGrid?l.setTreeRow.call(H,P[g],P):l.setRowData.call(H,P[g],P),x.closeAfterEdit&&d(R,{gb:W,jqm:x.jqModal,onClose:x.onClose,removemodal:x.removemodal,formprop:!x.recreateForm,form:x.form}));if(a.isFunction(x.afterComplete)){var t=c;setTimeout(function(){H.triggerHandler("jqGridAddEditAfterComplete",[t,P,a(O),M]);x.afterComplete.call(J,t,P,a(O),M);t=null},50)}if(x.checkOnSubmit||x.checkOnUpdate)if(a(O).data("disabled",!1),"_empty"!==x._savedData[Y+"_id"])for(var q in x._savedData)x._savedData.hasOwnProperty(q)&&
P[q]&&(x._savedData[q]=P[q])}x.processing=!1;try{a(":input:visible",O)[0].focus()}catch(n){}}},p.ajaxOptions,x.ajaxEditOptions);m.url||x.useDataProxy||(a.isFunction(N.dataProxy)?x.useDataProxy=!0:(b[0]=!1,b[1]+=" "+p.errors.nourl));b[0]&&(x.useDataProxy?(c=N.dataProxy.call(J,m,"set_"+Y),void 0===c&&(c=[!0,""]),!1===c[0]?(b[0]=!1,b[1]=c[1]||"Error deleting the selected row!"):(m.data.oper===e.addoper&&x.closeAfterAdd&&d(R,{gb:W,jqm:x.jqModal,onClose:x.onClose,removemodal:x.removemodal,formprop:!x.recreateForm,
form:x.form}),m.data.oper===e.editoper&&x.closeAfterEdit&&d(R,{gb:W,jqm:x.jqModal,onClose:x.onClose,removemodal:x.removemodal,formprop:!x.recreateForm,form:x.form}))):"clientArray"===m.url?(x.reloadAfterSubmit=!1,P=m.data,m.complete({status:200,statusText:""},"")):a.ajax(m))}!1===b[0]&&(a("#FormError>td",K).html(b[1]),a("#FormError",K).show())}function I(a,b){var c=!1,e;for(e in a)if(a.hasOwnProperty(e)&&String(a[e])!==String(b[e])){c=!0;break}return c}function G(){var b=!0;a("#FormError",K).hide();
x.checkOnUpdate&&(P={},B(),ea=I(P,x._savedData))&&(a(O).data("disabled",!0),a(".confirm",R).show(),b=!1);return b}function S(){var b=p.detectRowEditing.call(J,g);if(null!=b)if("inlineEditing"===b.mode)l.restoreRow.call(H,g);else{var b=b.savedRow,c=J.rows[b.id];l.restoreCell.call(H,b.id,b.ic);a(c.cells[b.ic]).removeClass("edit-cell "+za);a(c).addClass(za).attr({"aria-selected":"true",tabindex:"0"})}}function U(b,c){var d=c[1].length-1;0===b?a("#pData",L).addClass(ga):void 0!==c[1][b-1]&&e(a("#"+n(c[1][b-
1])),ga)?a("#pData",L).addClass(ga):a("#pData",L).removeClass(ga);b===d?a("#nData",L).addClass(ga):void 0!==c[1][b+1]&&e(a("#"+n(c[1][b+1])),ga)?a("#nData",L).addClass(ga):a("#nData",L).removeClass(ga)}function F(){var b=l.getDataIDs.call(H),c=a("#id_g",K).val();return[a.inArray(c,b),b]}var J=this,H=a(J),N=J.p;if(J.grid&&null!=N&&g){var Y=N.id,X=l.getGridRes,T=l.setSelection,x=a.extend(!0,{top:0,left:0,width:300,datawidth:"auto",height:"auto",dataheight:"auto",drag:!0,resize:!0,url:null,mtype:"POST",
clearAfterAdd:!0,closeAfterEdit:!1,reloadAfterSubmit:!0,onInitializeForm:null,beforeInitData:null,beforeShowForm:null,afterShowForm:null,beforeSubmit:null,afterSubmit:null,onclickSubmit:null,afterComplete:null,onclickPgButtons:null,afterclickPgButtons:null,editData:{},recreateForm:!1,closeOnEscape:!1,addedrow:"first",topinfo:"",bottominfo:"",savekey:[!1,13],navkeys:[!1,38,40],checkOnSubmit:!1,checkOnUpdate:!1,_savedData:{},processing:!1,onClose:null,ajaxEditOptions:{},serializeEditData:null,viewPagerButtons:!0,
overlayClass:"ui-widget-overlay",removemodal:!0,form:"edit"},X.call(H,"edit"),p.edit,N.formEditing||{},u||{}),O="FrmGrid_"+Y,aa=O,Q="TblGrid_"+Y,K="#"+n(Q),L=K+"_2",k={themodal:"editmod"+Y,modalhead:"edithd"+Y,modalcontent:"editcnt"+Y,resizeAlso:O},R="#"+n(k.themodal),W=N.gBox,ba=N.propOrAttr,ca=N.colModel,ha=N.iColByName,ja=1,da=0,P,ea,M,Z=x.commonIconClass,fa=X.call(H,"errors.errcap"),ka=function(){var b=a.makeArray(arguments);b.unshift("");b.unshift("AddEdit");b.unshift(x);return r.apply(J,b)},
xa=q.call(J,"hover"),ga=q.call(J,"disabled"),za=q.call(J,"select"),Ea=q.call(J,"active"),ma=q.call(J,"error"),O="#"+n(O);"new"===g?(g="_empty",M="add",x.caption=x.addCaption):(x.caption=x.editCaption,M="edit");if(!x.recreateForm){var pa=H.data("formProp");pa&&(pa.top=Math.max(pa.top,0),pa.left=Math.max(pa.left,0),a.extend(x,pa))}pa=!0;!x.checkOnUpdate||!0!==x.jqModal&&void 0!==x.jqModal||x.modal||(pa=!1);var ta=isNaN(x.dataheight)?x.dataheight:x.dataheight+"px",la=isNaN(x.datawidth)?x.datawidth:x.datawidth+
"px",aa=a("<form name='FormPost' id='"+aa+"' class='FormGrid' onSubmit='return false;' style='width:"+la+";overflow:auto;position:relative;height:"+ta+";'></form>").data("disabled",!1),wa=a("<table id='"+Q+"' class='EditTable'"+(p.msie&&8>p.msiever()?" cellspacing='0'":"")+"><tbody></tbody></table>");a(ca).each(function(){var a=this.formoptions;ja=Math.max(ja,a?a.colpos||0:0);da=Math.max(da,a?a.rowpos||0:0)});a(aa).append(wa);ma=a("<tr id='FormError' style='display:none'><td class='"+ma+"' colspan='"+
2*ja+"'> </td></tr>");ma[0].rp=0;a(wa).append(ma);ma=a("<tr style='display:none' class='tinfo'><td class='topinfo' colspan='"+2*ja+"'>"+(x.topinfo||" ")+"</td></tr>");ma[0].rp=0;a(wa).append(ma);if(ka("beforeInitData",aa,M)){S();ta=(ma="rtl"===N.direction?!0:!1)?"nData":"pData";la=ma?"pData":"nData";D(g,wa,ja);var ta=m.call(J,ta,"",c(Z,x.prevIcon),"","left"),la=m.call(J,la,"",c(Z,x.nextIcon),"","right"),Aa=m.call(J,"sData",x.bSubmit),ua=m.call(J,"cData",x.bCancel),Q="<table"+(p.msie&&8>
p.msiever()?" cellspacing='0'":"")+" class='EditTable' id='"+Q+"_2'><tbody><tr><td colspan='2'><hr class='"+A.call(J,"dialog.hr")+"' style='margin:1px'/></td></tr><tr id='Act_Buttons'><td class='navButton navButton-"+N.direction+"'>"+(ma?la+ta:ta+la)+"</td><td class='EditButton EditButton-"+N.direction+"'>"+Aa+" "+ua+"</td></tr>",Q=Q+("<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>"+(x.bottominfo||" ")+"</td></tr>"),Q=Q+"</tbody></table>";if(0<da){var va=[];a.each(a(wa)[0].rows,
function(a,b){va[a]=b});va.sort(function(a,b){return a.rp>b.rp?1:a.rp<b.rp?-1:0});a.each(va,function(b,c){a("tbody",wa).append(c)})}x.gbox=W;var qa=!1;!0===x.closeOnEscape&&(x.closeOnEscape=!1,qa=!0);Q=a("<div></div>").append(aa).append(Q);h.call(J,k,Q,x,N.gView,a(W)[0]);x.topinfo&&a(".tinfo",K).show();x.bottominfo&&a(".binfo",L).show();Q=Q=null;a(R).keydown(function(b){var c=(b.target.tagName||"").toUpperCase(),e,g;if(!0===a(O).data("disabled"))return!1;if(13===b.which&&"TEXTAREA"!==c){e=a(L).find(":focus");
g=e.attr("id");if(0<e.length&&0<=a.inArray(g,["pData","nData","cData"]))return e.trigger("click"),!1;if(!0===x.savekey[0]&&13===x.savekey[1])return a("#sData",L).trigger("click"),!1}if(!0===x.savekey[0]&&b.which===x.savekey[1]&&"TEXTAREA"!==c)return a("#sData",L).trigger("click"),!1;if(27===b.which){if(!G())return!1;qa&&d(R,{gb:x.gbox,jqm:x.jqModal,onClose:x.onClose,removemodal:x.removemodal,formprop:!x.recreateForm,form:x.form});return!1}if(!0===x.navkeys[0]){if("_empty"===a("#id_g",K).val())return!0;
if(b.which===x.navkeys[1])return a("#pData",L).trigger("click"),!1;if(b.which===x.navkeys[2])return a("#nData",L).trigger("click"),!1}});x.checkOnUpdate&&(a("a.ui-jqdialog-titlebar-close span",R).removeClass("jqmClose"),a("a.ui-jqdialog-titlebar-close",R).unbind("click").click(function(){if(!G())return!1;d(R,{gb:W,jqm:x.jqModal,onClose:x.onClose,removemodal:x.removemodal,formprop:!x.recreateForm,form:x.form});return!1}));w(a("#sData",L),x.saveicon,Z);w(a("#cData",L),x.closeicon,Z);if(x.checkOnSubmit||
x.checkOnUpdate)Aa=m.call(J,"sNew",x.bYes),la=m.call(J,"nNew",x.bNo),ua=m.call(J,"cNew",x.bExit),k=x.zIndex||999,k++,a("<div class='"+x.overlayClass+" jqgrid-overlay confirm' style='z-index:"+k+";display:none;'> </div><div class='"+A.call(J,"dialog.content","confirm ui-jqconfirm")+"' style='z-index:"+(k+1)+"'>"+x.saveData+"<br/><br/>"+Aa+la+ua+"</div>").insertAfter(O),a("#sNew",R).click(function(){V();a(O).data("disabled",!1);a(".confirm",R).hide();return!1}),a("#nNew",R).click(function(){a(".confirm",
R).hide();a(O).data("disabled",!1);setTimeout(function(){a(":input:visible",O)[0].focus()},0);return!1}),a("#cNew",R).click(function(){a(".confirm",R).hide();a(O).data("disabled",!1);d(R,{gb:W,jqm:x.jqModal,onClose:x.onClose,removemodal:x.removemodal,formprop:!x.recreateForm,form:x.form});return!1});ka("onInitializeForm",a(O),M);"_empty"!==g&&x.viewPagerButtons?a("#pData,#nData",L).show():a("#pData,#nData",L).hide();ka("beforeShowForm",a(O),M);a(R).data("onClose",x.onClose);f(R,{gbox:W,jqm:x.jqModal,
overlay:x.overlay,modal:x.modal,overlayClass:x.overlayClass,toTop:x.toTop,onHide:function(a){t.call(H,"formProp",O,a)}});pa||a("."+n(x.overlayClass)).click(function(){if(!G())return!1;d(R,{gb:W,jqm:x.jqModal,onClose:x.onClose,removemodal:x.removemodal,formprop:!x.recreateForm,form:x.form});return!1});a(".fm-button",R).hover(function(){a(this).addClass(xa)},function(){a(this).removeClass(xa)});a("#sData",L).click(function(){P={};a("#FormError",K).hide();B();"_empty"===P[Y+"_id"]?V():!0===x.checkOnSubmit?
(ea=I(P,x._savedData))?(a(O).data("disabled",!0),a(".confirm",R).show()):V():V();return!1});a("#cData",L).click(function(){if(!G())return!1;d(R,{gb:W,jqm:x.jqModal,onClose:x.onClose,removemodal:x.removemodal,formprop:!x.recreateForm,form:x.form});return!1});a("#nData",L).click(function(){if(!G())return!1;a("#FormError",K).hide();var b=F();b[0]=parseInt(b[0],10);if(-1!==b[0]&&b[1][b[0]+1]){if(!ka("onclickPgButtons","next",a(O),b[1][b[0]]))return!1;z(b[1][b[0]+1],O);T.call(H,b[1][b[0]+1]);ka("afterclickPgButtons",
"next",a(O),b[1][b[0]+1]);U(b[0]+1,b)}return!1});a("#pData",L).click(function(){if(!G())return!1;a("#FormError",K).hide();var b=F();if(-1!==b[0]&&b[1][b[0]-1]){if(!ka("onclickPgButtons","prev",a(O),b[1][b[0]])||e(a("#"+n(b[1][b[0]-1])),ga))return!1;z(b[1][b[0]-1],O);T.call(H,b[1][b[0]-1]);ka("afterclickPgButtons","prev",a(O),b[1][b[0]-1]);U(b[0]-1,b)}return!1});ka("afterShowForm",a(O),M);k=F();U(k[0],k)}}})},viewGridRow:function(b,g){return this.each(function(){function B(){!0!==F.closeOnEscape&&
!0!==F.navkeys[0]||setTimeout(function(){a(".ui-jqdialog-titlebar-close","#"+n(x.modalhead)).attr("tabindex","-1").focus()},0)}function D(b,c,e){var d,g,f,k=0,h,m,t=[],q=l.getInd.call(G,b),n;n=A.call(I,"dialog.viewData","DataTD form-view-data");var v=A.call(I,"dialog.viewLabel","CaptionTD form-view-label"),w="<td class='"+v+"' width='"+F.labelswidth+"'> </td><td class='"+n+" ui-helper-reset'> </td>",r="",v="<td class='"+v+"'></td><td class='"+n+"'></td>",z=["integer","number","currency"],
x=0,B=0,D,u,C;for(n=1;n<=e;n++)r+=1===n?w:v;a(Q).each(function(){(g=this.editrules&&!0===this.editrules.edithidden?!1:!0===this.hidden?!0:!1)||"right"!==this.align||(this.formatter&&-1!==a.inArray(this.formatter,z)?x=Math.max(x,parseInt(this.width,10)):B=Math.max(B,parseInt(this.width,10)))});D=0!==x?x:0!==B?B:0;a(Q).each(function(b){d=this.name;u=!1;m=(g=this.editrules&&!0===this.editrules.edithidden?!1:!0===this.hidden?!0:!1)?"style='display:none'":"";C="boolean"!==typeof this.viewable?!0:this.viewable;
if("cb"!==d&&"subgrid"!==d&&"rn"!==d&&C){h=!1===q?"":p.getDataFieldOfCell.call(I,I.rows[q],b).html();u="right"===this.align&&0!==D?!0:!1;var l=a.extend({},{rowabove:!1,rowcontent:""},this.formoptions||{}),n=parseInt(l.rowpos,10)||k+1,v=parseInt(2*(parseInt(l.colpos,10)||1),10);if(l.rowabove){var w=a("<tr><td class='contentinfo' colspan='"+2*e+"'>"+l.rowcontent+"</td></tr>");a(c).append(w);w[0].rp=n}f=a(c).find("tr[data-rowpos="+n+"]");0===f.length&&(f=a("<tr "+m+" data-rowpos='"+n+"'></tr>").addClass("FormData").attr("id",
"trv_"+d),a(f).append(r),a(c).append(f),f[0].rp=n);l=void 0===l.label?S.colNames[b]:l.label;n=a("td:eq("+(v-1)+")",f[0]);a("td:eq("+(v-2)+")",f[0]).html("<b>"+(l||" ")+"</b>");n[y(n.html())?"html":"append"]("<span>"+(h||" ")+"</span>").attr("id","v_"+d);u&&a("td:eq("+(v-1)+") span",f[0]).css({"text-align":"right",width:D+"px"});t[k]=b;k++}});0<k&&(b=a("<tr class='FormData' style='display:none'><td class='CaptionTD'> </td><td colspan='"+(2*e-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='id' value='"+
b+"'/></td></tr>"),b[0].rp=k+99,a(c).append(b));return t}function z(b){var c,e,d=0,g=l.getInd.call(G,b,!0),f;g&&(a("td",g).each(function(b){f=Q[b];c=f.name;e=f.editrules&&!0===f.editrules.edithidden?!1:!0===f.hidden?!0:!1;"cb"!==c&&"subgrid"!==c&&"rn"!==c&&(c=n("v_"+c),a("#"+c+" span",H).html(p.getDataFieldOfCell.call(I,g,b).html()),e&&a("#"+c,H).parents("tr:first").hide(),d++)}),0<d&&a("#id_g",H).val(b))}function v(b,c){var d=c[1].length-1;0===b?a("#pData",N).addClass(W):void 0!==c[1][b-1]&&e(a("#"+
n(c[1][b-1])),W)?a("#pData",N).addClass(W):a("#pData",N).removeClass(W);b===d?a("#nData",N).addClass(W):void 0!==c[1][b+1]&&e(a("#"+n(c[1][b+1])),W)?a("#nData",N).addClass(W):a("#nData",N).removeClass(W)}function u(){var b=l.getDataIDs.call(G),c=a("#id_g",H).val();return[a.inArray(c,b),b]}var I=this,G=a(I),S=I.p;if(I.grid&&null!=S&&b){var U=S.id,F=a.extend(!0,{top:0,left:0,width:0,datawidth:"auto",height:"auto",dataheight:"auto",drag:!0,resize:!0,closeOnEscape:!1,labelswidth:"30%",navkeys:[!1,38,
40],onClose:null,beforeShowForm:null,beforeInitData:null,viewPagerButtons:!0,recreateForm:!1,removemodal:!0,form:"view"},l.getGridRes.call(G,"view"),p.view||{},S.formViewing||{},g||{}),J="#ViewGrid_"+n(U),H="#ViewTbl_"+n(U),N=H+"_2",Y="ViewGrid_"+U,X="ViewTbl_"+U,T=F.commonIconClass,x={themodal:"viewmod"+U,modalhead:"viewhd"+U,modalcontent:"viewcnt"+U,resizeAlso:Y},O="#"+n(x.themodal),aa=S.gBox,Q=S.colModel,K=1,L=0,k=function(){var b=a.makeArray(arguments);b.unshift("");b.unshift("View");b.unshift(F);
return r.apply(I,b)},R=q.call(I,"hover"),W=q.call(I,"disabled");F.recreateForm||G.data("viewProp")&&a.extend(F,G.data("viewProp"));var U=isNaN(F.dataheight)?F.dataheight:F.dataheight+"px",ba=isNaN(F.datawidth)?F.datawidth:F.datawidth+"px",Y=a("<form name='FormPost' id='"+Y+"' class='FormGrid' style='width:"+ba+";overflow:auto;position:relative;height:"+U+";'></form>"),ca=a("<table id='"+X+"' class='EditTable' cellspacing='1' cellpadding='2' border='0' style='table-layout:fixed'><tbody></tbody></table>");
a(Q).each(function(){var a=this.formoptions;K=Math.max(K,a?a.colpos||0:0);L=Math.max(L,a?a.rowpos||0:0)});Y.append(ca);if(k("beforeInitData",Y)){D(b,ca,K);var ha=(U="rtl"===S.direction?!0:!1)?"pData":"nData",ba=m.call(I,U?"nData":"pData","",c(T,F.prevIcon),"","left"),ha=m.call(I,ha,"",c(T,F.nextIcon),"","right"),ja=m.call(I,"cData",F.bClose);if(0<L){var da=[];a.each(a(ca)[0].rows,function(a,b){da[a]=b});da.sort(function(a,b){return a.rp>b.rp?1:a.rp<b.rp?-1:0});a.each(da,function(b,c){a("tbody",ca).append(c)})}F.gbox=
aa;X=a("<div></div>").append(Y).append("<table border='0' class='EditTable' id='"+X+"_2'><tbody><tr id='Act_Buttons'><td class='navButton navButton-"+S.direction+"' width='"+(F.labelswidth||"auto")+"'>"+(U?ha+ba:ba+ha)+"</td><td class='EditButton EditButton-"+S.direction+"'>"+ja+"</td></tr></tbody></table>");h.call(I,x,X,F,S.gView,a(S.gView)[0]);F.viewPagerButtons||a("#pData, #nData",N).hide();X=null;a(O).keydown(function(b){var c,e;if(!0===a(J).data("disabled"))return!1;if(13===b.which&&(c=a(N).find(":focus"),
e=c.attr("id"),0<c.length&&0<=a.inArray(e,["pData","nData","cData"])))return c.trigger("click"),!1;if(27===b.which)return F.closeOnEscape&&d(O,{gb:aa,jqm:F.jqModal,onClose:F.onClose,removemodal:F.removemodal,formprop:!F.recreateForm,form:F.form}),!1;if(!0===F.navkeys[0]){if(b.which===F.navkeys[1])return a("#pData",N).trigger("click"),!1;if(b.which===F.navkeys[2])return a("#nData",N).trigger("click"),!1}});w(a("#cData",N),F.closeicon,T);k("beforeShowForm",a(J));f(O,{gbox:aa,jqm:F.jqModal,overlay:F.overlay,
toTop:F.toTop,modal:F.modal,onHide:function(a){t.call(G,"viewProp",J,a)}});a(".fm-button:not(."+W.split(" ").join(".")+")",N).hover(function(){a(this).addClass(R)},function(){a(this).removeClass(R)});B();a("#cData",N).click(function(){d(O,{gb:aa,jqm:F.jqModal,onClose:F.onClose,removemodal:F.removemodal,formprop:!F.recreateForm,form:F.form});return!1});a("#nData",N).click(function(){a("#FormError",H).hide();var b=u();b[0]=parseInt(b[0],10);if(-1!==b[0]&&b[1][b[0]+1]){if(!k("onclickPgButtons","next",
a(J),b[1][b[0]]))return!1;z(b[1][b[0]+1]);l.setSelection.call(G,b[1][b[0]+1]);k("afterclickPgButtons","next",a(J),b[1][b[0]+1]);v(b[0]+1,b)}B();return!1});a("#pData",N).click(function(){a("#FormError",H).hide();var b=u();if(-1!==b[0]&&b[1][b[0]-1]){if(!k("onclickPgButtons","prev",a(J),b[1][b[0]]))return!1;z(b[1][b[0]-1]);l.setSelection.call(G,b[1][b[0]-1]);k("afterclickPgButtons","prev",a(J),b[1][b[0]-1]);v(b[0]-1,b)}B();return!1});T=u();v(T[0],T)}}})},delGridRow:function(b,c){return this.each(function(){var e=
this,g=e.p,t=a(e);if(e.grid&&null!=g&&b){var v=g.id,u=a.extend(!0,{top:0,left:0,width:240,removemodal:!0,height:"auto",dataheight:"auto",drag:!0,resize:!0,url:"",mtype:"POST",reloadAfterSubmit:!0,beforeShowForm:null,beforeInitData:null,afterShowForm:null,beforeSubmit:null,onclickSubmit:null,afterSubmit:null,closeOnEscape:!1,delData:{},onClose:null,ajaxDelOptions:{},processing:!1,serializeDelData:null,useDataProxy:!1},l.getGridRes.call(t,"del"),p.del||{},g.formDeleting||{},c||{}),y="DelTbl_"+v,G="#DelTbl_"+
n(v),S,U,F,J,H={themodal:"delmod"+v,modalhead:"delhd"+v,modalcontent:"delcnt"+v,resizeAlso:y},N="#"+n(H.themodal),Y=g.gBox,X=u.commonIconClass,T=function(){var b=a.makeArray(arguments);b.unshift("");b.unshift("Delete");b.unshift(u);return r.apply(e,b)},x=q.call(e,"hover"),O=q.call(e,"active"),aa=q.call(e,"error");a.isArray(b)||(b=[String(b)]);if(void 0!==a(N)[0]){if(!T("beforeInitData",a(G)))return;a("#DelData>td",G).text(b.join()).data("rowids",b);a("#DelError",G).hide();!0===u.processing&&(u.processing=
!1,a("#dData",G).removeClass(O));T("beforeShowForm",a(G));f(N,{gbox:Y,jqm:u.jqModal,jqM:!1,overlay:u.overlay,toTop:u.toTop,modal:u.modal})}else{var Q=isNaN(u.dataheight)?u.dataheight:u.dataheight+"px",K=isNaN(u.datawidth)?u.datawidth:u.datawidth+"px",Q="<div id='"+y+"' class='formdata' style='width:"+K+";overflow:auto;position:relative;height:"+Q+";'><table class='DelTable'><tbody>",Q=Q+("<tr id='DelError' style='display:none'><td class='"+aa+"'></td></tr>"),Q=Q+("<tr id='DelData' style='display:none'><td >"+
b.join()+"</td></tr>"),Q=Q+('<tr><td class="delmsg" style="white-space:pre;">'+u.msg+"</td></tr><tr><td > </td></tr>"),Q=Q+"</tbody></table></div>",aa=m.call(e,"dData",u.bSubmit),K=m.call(e,"eData",u.bCancel),Q=Q+("<table"+(p.msie&&8>p.msiever()?" cellspacing='0'":"")+" class='EditTable' id='"+y+"_2'><tbody><tr><td><hr class='"+A.call(e,"dialog.hr")+"' style='margin:1px'/></td></tr><tr><td class='DelButton EditButton EditButton-"+g.direction+"'>"+aa+" "+K+"</td></tr></tbody></table>");u.gbox=
Y;h.call(e,H,Q,u,g.gView,a(g.gView)[0]);a("#DelData>td",G).data("rowids",b);if(!T("beforeInitData",a(Q)))return;a(".fm-button",G+"_2").hover(function(){a(this).addClass(x)},function(){a(this).removeClass(x)});w(a("#dData",G+"_2"),u.delicon,X);w(a("#eData",G+"_2"),u.cancelicon,X);a("#dData",G+"_2").click(function(){var b=[!0,""],c,f=a("#DelData>td",G),h=f.text(),m=f.data("rowids"),f={};a.isFunction(u.onclickSubmit)&&(f=u.onclickSubmit.call(e,u,h)||{});a.isFunction(u.beforeSubmit)&&(b=u.beforeSubmit.call(e,
h));if(b[0]&&!u.processing){u.processing=!0;F=g.prmNames;S=a.extend({},u.delData,f);J=F.oper;S[J]=F.deloper;U=F.id;h=m.slice();if(!h.length)return!1;for(c in h)h.hasOwnProperty(c)&&(h[c]=p.stripPref(g.idPrefix,h[c]));S[U]=h.join();a(this).addClass(O);c=a.extend({url:u.url||g.editurl,type:u.mtype,data:a.isFunction(u.serializeDelData)?u.serializeDelData.call(e,S):S,complete:function(c,f){var k;a("#dData",G+"_2").removeClass(O);300<=c.status&&304!==c.status||0===c.status&&4===c.readyState?(b[0]=!1,a.isFunction(u.errorTextFormat)?
b[1]=u.errorTextFormat.call(e,c):b[1]=f+" Status: '"+c.statusText+"'. Error code: "+c.status):a.isFunction(u.afterSubmit)&&(b=u.afterSubmit.call(e,c,S));if(!1===b[0])a("#DelError>td",G).html(b[1]),a("#DelError",G).show();else{if(u.reloadAfterSubmit&&"local"!==g.datatype)t.trigger("reloadGrid",[a.extend({},u.reloadGridOptions||{})]);else if(!0===g.treeGrid)try{l.delTreeNode.call(t,m[0])}catch(q){}else for(m=m.slice(),k=0;k<m.length;k++)l.delRowData.call(t,m[k]);setTimeout(function(){T("afterComplete",
c,h,a(G))},50)}u.processing=!1;b[0]&&d(N,{gb:Y,jqm:u.jqModal,onClose:u.onClose,removemodal:u.removemodal})}},p.ajaxOptions,u.ajaxDelOptions);c.url||u.useDataProxy||(a.isFunction(g.dataProxy)?u.useDataProxy=!0:(b[0]=!1,b[1]+=" "+p.errors.nourl));b[0]&&(u.useDataProxy?(c=g.dataProxy.call(e,c,"del_"+v),void 0===c&&(c=[!0,""]),!1===c[0]?(b[0]=!1,b[1]=c[1]||"Error deleting the selected row!"):d(N,{gb:Y,jqm:u.jqModal,onClose:u.onClose,removemodal:u.removemodal})):"clientArray"===c.url?(S=c.data,c.complete({status:200,
statusText:""},"")):a.ajax(c))}!1===b[0]&&(a("#DelError>td",G).html(b[1]),a("#DelError",G).show());return!1});a("#eData",G+"_2").click(function(){d(N,{gb:Y,jqm:u.jqModal,onClose:u.onClose,removemodal:u.removemodal});return!1});T("beforeShowForm",a(G));f(N,{gbox:Y,jqm:u.jqModal,overlay:u.overlay,toTop:u.toTop,modal:u.modal})}T("afterShowForm",a(G));!0===u.closeOnEscape&&setTimeout(function(){a(".ui-jqdialog-titlebar-close","#"+n(H.modalhead)).attr("tabindex","-1").focus()},0)}})},navGrid:function(b,
d,g,m,t,v,w){"object"===typeof b&&(w=v,v=t,t=m,m=g,g=d,d=b,b=void 0);m=m||{};g=g||{};w=w||{};t=t||{};v=v||{};return this.each(function(){var u=this,r=u.p,y=a(u);if(u.grid&&null!=r&&!(u.nav&&0<a(b).find(".navtable").length)){var U=r.id,F=a.extend({edit:!0,add:!0,del:!0,search:!0,refresh:!0,refreshstate:"firstpage",view:!1,closeOnEscape:!0,beforeRefresh:null,afterRefresh:null,cloneToTop:!1,hideEmptyPagerParts:!0,alertwidth:200,alertheight:"auto",alerttop:null,removemodal:!0,alertleft:null,alertzIndex:null,
iconsOverText:!1},l.getGridRes.call(y,"nav"),p.nav||{},r.navOptions||{},d||{});F.position=F.position||("rtl"===r.direction?"right":"left");var J,H=r.idSel,N=r.gBox,Y=F.commonIconClass,X={themodal:"alertmod_"+U,modalhead:"alerthd_"+U,modalcontent:"alertcnt_"+U},T=function(){return function(){var b=document.documentElement,c=window,e=1024,d=768,g=y.closest(".ui-jqgrid").offset();void 0===a("#"+n(X.themodal))[0]&&(F.alerttop||F.alertleft||(void 0!==c.innerWidth?(e=c.innerWidth,d=c.innerHeight):null!=
b&&void 0!==b.clientWidth&&0!==b.clientWidth&&(e=b.clientWidth,d=b.clientHeight),e=e/2-parseInt(F.alertwidth,10)/2-g.left,d=d/2-25-g.top),h.call(u,X,"<div>"+F.alerttext+"</div><span tabindex='0'><span tabindex='-1' id='"+U+"_jqg_alrt'></span></span>",{gbox:N,jqModal:F.jqModal,drag:!0,resize:!0,caption:F.alertcap,top:null!=F.alerttop?F.alerttop:d,left:null!=F.alertleft?F.alertleft:e,width:F.alertwidth,height:F.alertheight,closeOnEscape:F.closeOnEscape,zIndex:F.alertzIndex,removemodal:F.removemodal},
r.gView,a(N)[0],!1));f("#"+n(X.themodal),{gbox:N,toTop:F.alertToTop,jqm:F.jqModal});var l=a("#"+n(X.modalhead)).find(".ui-jqdialog-titlebar-close");l.attr({tabindex:"0",href:"#",role:"button"});setTimeout(function(){l.focus()},50)}}(),x,O=function(b){if(13===b.which&&(b=a(this).find(":focus"),0<b.length))return b.trigger("click"),!1},aa=q.call(u,"hover"),Q=q.call(u,"disabled");if(u.grid){u.modalAlert=T;void 0===b&&(r.pager?(b=r.pager,r.toppager&&(F.cloneToTop=!0)):r.toppager&&(b=r.toppager));var K=
1,L,k,R,W,ba,ca=["left","center","right"],ha="<div class='ui-pg-button "+Q+"'><span class='ui-separator'></span></div>",ja=function(){e(this,Q)||a(this).addClass(aa)},da=function(){a(this).removeClass(aa)},P=function(){e(this,Q)||(a.isFunction(F.addfunc)?F.addfunc.call(u):l.editGridRow.call(y,"new",m));return!1},ea=function(b,c,d){if(!e(this,Q)){var g=r.selrow;g?a.isFunction(b)?b.call(u,g):l[c].call(y,g,d):T()}return!1},M=function(){return ea.call(this,F.editfunc,"editGridRow",g)},Z=function(){return ea.call(this,
F.viewfunc,"viewGridRow",w)},fa=function(){var b;e(this,Q)||(r.multiselect?(b=r.selarrrow,0===b.length&&(b=null)):b=r.selrow,b?a.isFunction(F.delfunc)?F.delfunc.call(u,b):l.delGridRow.call(y,b,t):T());return!1},ka=function(){e(this,Q)||(a.isFunction(F.searchfunc)?F.searchfunc.call(u,v):l.searchGrid.call(y,v));return!1},xa=function(){if(!e(this,Q)){a.isFunction(F.beforeRefresh)&&F.beforeRefresh.call(u);r.search=!1;r.resetsearch=!0;try{if("currentfilter"!==F.refreshstate){r.postData.filters="";try{a("#fbox_"+
H).jqFilter("resetFilter")}catch(b){}a.isFunction(u.clearToolbar)&&u.clearToolbar(!1)}}catch(c){}switch(F.refreshstate){case "firstpage":y.trigger("reloadGrid",[a.extend({},F.reloadGridOptions||{},{page:1})]);break;case "current":case "currentfilter":y.trigger("reloadGrid",[a.extend({},F.reloadGridOptions||{},{current:!0})])}a.isFunction(F.afterRefresh)&&F.afterRefresh.call(u)}return!1},ga=function(b,e,d,g,l){var f=a("<div class='ui-pg-button ui-corner-all' tabindex='0' role='button'></div>"),k=F[b+
"icon"],h=a.trim(F[b+"text"]);f.append("<div class='ui-pg-div'><span class='"+(F.iconsOverText?c("ui-pg-button-icon-over-text",Y,k):c(Y,k))+"'></span>"+(h?"<span class='ui-pg-button-text"+(F.iconsOverText?" ui-pg-button-icon-over-text":"")+"'>"+h+"</span>":"")+"</div>");a(g).append(f);f.attr({title:F[b+"title"]||"",id:e||b+"_"+l}).click(d).hover(ja,da);return f};F.cloneToTop&&r.toppager&&(K=2);for(L=0;L<K;L++){x=a("<div class='ui-pg-table navtable' role='toolbar' style='float:"+("rtl"===r.direction?
"right":"left")+";table-layout:auto;'></div>");0===L?(k=b,R=U,k===r.toppager&&(R+="_top",K=1)):(k=r.toppager,R=U+"_top");F.add&&ga("add",m.id,P,x,R);F.edit&&ga("edit",g.id,M,x,R);F.view&&ga("view",w.id,Z,x,R);F.del&&ga("del",t.id,fa,x,R);(F.add||F.edit||F.del||F.view)&&a(x).append(ha);F.search&&(J=ga("search",v.id,ka,x,R),v.showOnLoad&&!0===v.showOnLoad&&a(J,x).click());F.refresh&&ga("refresh","",xa,x,R);J=a(".ui-jqgrid>.ui-jqgrid-view").css("font-size")||"11px";a("body").append("<div id='testpg2' class='"+
A.call(u,"gBox","ui-jqgrid")+"' style='font-size:"+J+";visibility:hidden;' ></div>");J=a(x).clone().appendTo("#testpg2").width();a("#testpg2").remove();a(k+"_"+F.position,k).append(x);if(F.hideEmptyPagerParts)for(R=0;R<ca.length;R++)ca[R]!==F.position&&(ba=a(k+"_"+ca[R],k),0===ba.length||0===ba[0].childNodes.length?ba.hide():1===ba[0].childNodes.length&&(W=ba[0].firstChild,!a(W).is("table.ui-pg-table")||0!==W.rows&&0!==W.rows[0].cells.length||ba.hide()));r._nvtd&&(J>r._nvtd[0]&&(a(k+"_"+F.position,
k).width(J),r._nvtd[0]=J),r._nvtd[1]=J);u.nav=!0;x.bind("keydown.jqGrid",O)}y.triggerHandler("jqGridResetFrozenHeights")}}})},navButtonAdd:function(b,d){"object"===typeof b&&(d=b,b=void 0);return this.each(function(){var g=this,f=g.p;if(g.grid){var h=a.extend({caption:"newButton",title:"",onClickButton:null,position:"last",cursor:"pointer",iconsOverText:!1},l.getGridRes.call(a(g),"nav"),p.nav||{},f.navOptions||{},d||{}),m=q.call(g,"hover"),t=q.call(g,"disabled");if(void 0===b)if(f.pager)if(l.navButtonAdd.call(a(g),
f.pager,h),f.toppager)b=f.toppager;else return;else f.toppager&&(b=f.toppager);"string"===typeof b&&0!==b.indexOf("#")&&(b="#"+n(b));var f=a(".navtable",b),w=h.commonIconClass;if(0<f.length&&!(h.id&&0<f.find("#"+n(h.id)).length)){var u=a("<div tabindex='0' role='button'></div>");"NONE"===h.buttonicon.toString().toUpperCase()?a(u).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'>"+(h.caption?"<span class='ui-pg-button-text"+(h.iconsOverText?" ui-pg-button-icon-over-text":"")+"'>"+
h.caption+"</span>":"")+"</div>"):a(u).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'><span class='"+(h.iconsOverText?c("ui-pg-button-icon-over-text",w,h.buttonicon):c(w,h.buttonicon))+"'></span>"+(h.caption?"<span class='ui-pg-button-text"+(h.iconsOverText?" ui-pg-button-icon-over-text":"")+"'>"+h.caption+"</span>":"")+"</div>");h.id&&a(u).attr("id",h.id);"first"===h.position&&0<f.children("div.ui-pg-button").length?f.children("div.ui-pg-button").filter(":first").before(u):
f.append(u);a(u,f).attr("title",h.title||"").click(function(b){e(this,t)||a.isFunction(h.onClickButton)&&h.onClickButton.call(g,h,b);return!1}).hover(function(){e(this,t)||a(this).addClass(m)},function(){a(this).removeClass(m)});a(g).triggerHandler("jqGridResetFrozenHeights")}}})},navSeparatorAdd:function(b,c){c=a.extend({sepclass:"ui-separator",sepcontent:"",position:"last"},c||{});return this.each(function(){if(this.grid){"string"===typeof b&&0!==b.indexOf("#")&&(b="#"+n(b));var e=a(".navtable",
b)[0];if(0<e.length){var d="<div class='ui-pg-button "+q.call(this,"disabled")+"'><span class='"+c.sepclass+"'></span>"+c.sepcontent+"</div>";"first"===c.position?0===a(">div.ui-pg-button",e).length?e.append(d):a(">div.ui-pg-button",e).filter(":first").before(d):e.append(d)}}})},GridToForm:function(b,c){return this.each(function(){var e,d,g,f;if(this.grid){var h=l.getRowData.call(a(this),b),m=this.p.propOrAttr;if(h)for(e in h)if(h.hasOwnProperty(e))if(d=a("[name="+n(e)+"]",c),d.is("input:radio")||
d.is("input:checkbox"))for(g=0;g<d.length;g++)f=a(d[g]),f[m]("checked",f.val()===String(h[e]));else d.val(h[e])}})},FormToGrid:function(b,c,e,d){return this.each(function(){if(this.grid){e||(e="set");d||(d="first");var g=a(c).serializeArray(),f={};a.each(g,function(a,b){f[b.name]=b.value});"add"===e?l.addRowData.call(a(this),b,f,d):"set"===e&&l.setRowData.call(a(this),b,f)}})}})})(jQuery);
(function(a){var p=a.jgrid,r=a.fn.jqGrid;p.extend({groupingSetup:function(){return this.each(function(){var u,n;n=this.p;var d=n.colModel,f=n.groupingView,h,b,c=function(){return""};if(null===f||"object"!==typeof f&&!a.isFunction(f))n.grouping=!1;else if(f.groupField.length){void 0===f.visibiltyOnNextGrouping&&(f.visibiltyOnNextGrouping=[]);f.lastvalues=[];f._locgr||(f.groups=[]);f.counters=[];for(u=0;u<f.groupField.length;u++)f.groupOrder[u]||(f.groupOrder[u]="asc"),f.groupText[u]||(f.groupText[u]=
"{0}"),"boolean"!==typeof f.groupColumnShow[u]&&(f.groupColumnShow[u]=!0),"boolean"!==typeof f.groupSummary[u]&&(f.groupSummary[u]=!1),f.groupSummaryPos[u]||(f.groupSummaryPos[u]="footer"),h=d[n.iColByName[f.groupField[u]]],!0===f.groupColumnShow[u]?(f.visibiltyOnNextGrouping[u]=!0,null!=h&&!0===h.hidden&&r.showCol.call(a(this),f.groupField[u])):(f.visibiltyOnNextGrouping[u]=a("#"+p.jqID(n.id+"_"+f.groupField[u])).is(":visible"),null!=h&&!0!==h.hidden&&r.hideCol.call(a(this),f.groupField[u]));f.summary=
[];f.hideFirstGroupCol&&(f.formatDisplayField[0]=function(a){return a});u=0;for(n=d.length;u<n;u++)h=d[u],f.hideFirstGroupCol&&!h.hidden&&f.groupField[0]===h.name&&(h.formatter=c),h.summaryType&&(b={nm:h.name,st:h.summaryType,v:"",sr:h.summaryRound,srt:h.summaryRoundType||"round"},h.summaryDivider&&(b.sd=h.summaryDivider,b.vd=""),f.summary.push(b))}else n.grouping=!1})},groupingPrepare:function(p,n){this.each(function(){var d=this,f=d.p.groupingView,h=f.groups,b=f.counters,c=f.lastvalues,e=f.isInTheSameGroup,
l=f.groupField.length,m,g,t,w,A=0,q=r.groupingCalculations.handler,y=function(){a.isFunction(this.st)?this.v=this.st.call(d,this.v,this.nm,p):(this.v=q.call(a(d),this.st,this.v,this.nm,this.sr,this.srt,p),"avg"===this.st.toLowerCase()&&this.sd&&(this.vd=q.call(a(d),this.st,this.vd,this.sd,this.sr,this.srt,p)))};for(m=0;m<l;m++)g=f.groupField[m],t=f.displayField[m],w=p[g],t=null==t?null:p[t],null==t&&(t=w),void 0!==w&&(g={idx:m,dataIndex:g,value:w,displayValue:t,startRow:n,cnt:1,summary:[]},0===n?
(h.push(g),c[m]=w,b[m]={cnt:1,pos:h.length-1,summary:a.extend(!0,[],f.summary)}):(t={cnt:1,pos:h.length,summary:a.extend(!0,[],f.summary)},"object"===typeof w||(a.isArray(e)&&a.isFunction(e[m])?e[m].call(d,c[m],w,m,f):c[m]===w)?1===A?(h.push(g),c[m]=w,b[m]=t):(b[m].cnt+=1,h[b[m].pos].cnt=b[m].cnt):(h.push(g),c[m]=w,A=1,b[m]=t)),a.each(b[m].summary,y),h[b[m].pos].summary=b[m].summary)});return this},groupingToggle:function(u){this.each(function(){var n=this.p,d=p.jqID,f=n.groupingView,h=f.minusicon,
b=f.plusicon,c=a("#"+d(u)),c=c.length?c[0].nextSibling:null,e=a("#"+d(u)+" span.tree-wrap-"+n.direction),l,m,g=!1,t=n.frozenColumns?n.id+"_frozen":!1,d=(d=t?a("#"+d(u),"#"+d(t)):!1)&&d.length?d[0].nextSibling:null;l=u.split("_");var w=parseInt(l[l.length-2],10),r,q=function(b){b=a.map(b.split(" "),function(a){if(a.substring(0,r.length+1)===r+"_")return parseInt(a.substring(r.length+1),10)});return 0<b.length?b[0]:void 0};l.splice(l.length-2,2);r=l.join("_");if(e.hasClass(h)){for(;c;){if(a(c).hasClass("jqfoot")){l=
parseInt(a(c).data("jqfootlevel"),10);if(!f.showSummaryOnHide&&l===w||l>w)a(c).hide(),t&&a(d).hide();if(l<w)break}else{l=q(c.className);if(void 0!==l&&l<=w)break;a(c).hide();t&&a(d).hide()}c=c.nextSibling;t&&(d=d.nextSibling)}e.removeClass(h).addClass(b);g=!0}else{for(m=void 0;c;){if(a(c).hasClass("jqfoot")){l=parseInt(a(c).data("jqfootlevel"),10);if(l===w||f.showSummaryOnHide&&l===w+1)a(c).show(),t&&a(d).show();if(l<=w)break}l=q(c.className);void 0===m&&(m=void 0===l);if(void 0!==l){if(l<=w)break;
l===w+1&&(a(c).show().find(">td>span.tree-wrap-"+n.direction).removeClass(h).addClass(b),t&&a(d).show().find(">td>span.tree-wrap-"+n.direction).removeClass(h).addClass(b))}else m&&(a(c).show(),t&&a(d).show());c=c.nextSibling;t&&(d=d.nextSibling)}e.removeClass(b).addClass(h)}a(this).triggerHandler("jqGridGroupingClickGroup",[u,g]);a.isFunction(n.onClickGroup)&&n.onClickGroup.call(this,u,g)});return!1},groupingRender:function(r,n,d,f){function h(a,b,c){var e=!1,d;if(0===b)e=c[a];else if(d=c[a].idx,
0===d)e=c[a];else for(;0<=a;a--)if(c[a].idx===d-b){e=c[a];break}return e}function b(b,c,d,g){var f=h(b,c,d),m=l.colModel,t=f.cnt;b="";var q,w,r;c=function(){var a;if(this.nm===m[q].name){r=m[q].summaryTpl||"{0}";"string"===typeof this.st&&"avg"===this.st.toLowerCase()&&(this.sd&&this.vd?this.v/=this.vd:this.v&&0<t&&(this.v/=t));try{this.groupCount=f.cnt,this.groupIndex=f.dataIndex,this.groupValue=f.value,a=e.formatter("",this.v,q,this)}catch(b){a=this.v}w="<td "+e.formatCol(q,1,"")+">"+p.format(r,
a)+"</td>";return!1}};for(q=g;q<n;q++)w="<td "+e.formatCol(q,1,"")+"> </td>",a.each(f.summary,c),b+=w;return b}var c="",e=this[0],l=e.p,m=0,g=l.groupingView,t=a.makeArray(g.groupSummary),w,A=[],q="",y,E,C=(g.groupCollapse?g.plusicon:g.minusicon)+" tree-wrap-"+l.direction,B=g.groupField.length;a.each(l.colModel,function(a,b){var c;for(c=0;c<B;c++)if(g.groupField[c]===b.name){A[c]=a;break}});t.reverse();a.each(g.groups,function(h,z){if(g._locgr&&!(z.startRow+z.cnt>(d-1)*f&&z.startRow<d*f))return!0;
m++;E=l.id+"ghead_"+z.idx;y=E+"_"+h;q="<span style='cursor:pointer;' class='"+g.commonIconClass+" "+C+"' onclick=\"jQuery('#"+p.jqID(l.id).replace("\\","\\\\")+"').jqGrid('groupingToggle','"+y+"');return false;\"></span>";try{a.isArray(g.formatDisplayField)&&a.isFunction(g.formatDisplayField[z.idx])?(z.displayValue=g.formatDisplayField[z.idx].call(e,z.displayValue,z.value,l.colModel[A[z.idx]],z.idx,g),w=z.displayValue):w=e.formatter(y,z.displayValue,A[z.idx],z.value)}catch(v){w=z.displayValue}c+=
'<tr id="'+y+'"'+(g.groupCollapse&&0<z.idx?' style="display:none;" ':" ")+'role="row" class="ui-widget-content jqgroup ui-row-'+l.direction+" "+E+'"><td style="padding-left:'+12*z.idx+'px;"';var V=a.isFunction(g.groupText[z.idx])?g.groupText[z.idx].call(e,w,z.cnt,z.summary):p.template(g.groupText[z.idx],w,z.cnt,z.summary),I=1,G,S,U;S=0;U=B-1===z.idx;"string"!==typeof V&&"number"!==typeof V&&(V=w);"header"===g.groupSummaryPos[z.idx]?(I=1,"cb"!==l.colModel[0].name&&"cb"!==l.colModel[1].name||I++,"subgrid"!==
l.colModel[0].name&&"subgrid"!==l.colModel[1].name||I++,c+=(1<I?" colspan='"+I+"'":"")+">"+q+V+"</td>",c+=b(h,0,g.groups,!1===g.groupColumnShow[z.idx]?I-1:I)):c+=' colspan="'+(!1===g.groupColumnShow[z.idx]?n-1:n)+'">'+q+V+"</td>";c+="</tr>";if(U){V=g.groups[h+1];U=z.startRow;I=void 0!==V?V.startRow:g.groups[h].startRow+g.groups[h].cnt;g._locgr&&(S=(d-1)*f,S>z.startRow&&(U=S));for(;U<I&&r[U-S];U++)c+=r[U-S].join("");if("header"!==g.groupSummaryPos[z.idx]){if(void 0!==V){for(G=0;G<g.groupField.length&&
V.dataIndex!==g.groupField[G];G++);m=g.groupField.length-G}for(V=0;V<m;V++)t[V]&&(S="",g.groupCollapse&&!g.showSummaryOnHide&&(S=' style="display:none;"'),c+="<tr"+S+' data-jqfootlevel="'+(z.idx-V)+'" role="row" class="ui-widget-content jqfoot ui-row-'+l.direction+'">',c+=b(h,V,g.groups,0),c+="</tr>");m=G}}});return c},groupingGroupBy:function(u,n){return this.each(function(){var d=this.p,f=d.groupingView,h,b;"string"===typeof u&&(u=[u]);d.grouping=!0;f._locgr=!1;void 0===f.visibiltyOnNextGrouping&&
(f.visibiltyOnNextGrouping=[]);for(h=0;h<f.groupField.length;h++)b=d.colModel[d.iColByName[f.groupField[h]]],!f.groupColumnShow[h]&&f.visibiltyOnNextGrouping[h]&&null!=b&&!0===b.hidden&&r.showCol.call(a(this),f.groupField[h]);for(h=0;h<u.length;h++)f.visibiltyOnNextGrouping[h]=a(d.idSel+"_"+p.jqID(u[h])).is(":visible");d.groupingView=a.extend(d.groupingView,n||{});f.groupField=u;a(this).trigger("reloadGrid")})},groupingRemove:function(p){return this.each(function(){var n=this.p,d=this.tBodies[0],
f=n.groupingView;void 0===p&&(p=!0);n.grouping=!1;if(!0===p){for(n=0;n<f.groupField.length;n++)!f.groupColumnShow[n]&&f.visibiltyOnNextGrouping[n]&&r.showCol.call(a(this),f.groupField);a("tr.jqgroup, tr.jqfoot",d).remove();a("tr.jqgrow:hidden",d).show()}else a(this).trigger("reloadGrid")})},groupingCalculations:{handler:function(a,p,d,f,h,b){var c={sum:function(){return parseFloat(p||0)+parseFloat(b[d]||0)},min:function(){return""===p?parseFloat(b[d]||0):Math.min(parseFloat(p),parseFloat(b[d]||0))},
max:function(){return""===p?parseFloat(b[d]||0):Math.max(parseFloat(p),parseFloat(b[d]||0))},count:function(){""===p&&(p=0);return b.hasOwnProperty(d)?p+1:0},avg:function(){return c.sum()}};if(!c[a])throw"jqGrid Grouping No such method: "+a;a=c[a]();null!=f&&("fixed"===h?a=a.toFixed(f):(f=Math.pow(10,f),a=Math.round(a*f)/f));return a}}})})(jQuery);
(function(a){a.jgrid.extend({jqGridImport:function(p){p=a.extend({imptype:"xml",impstring:"",impurl:"",mtype:"GET",impData:{},xmlGrid:{config:"roots>grid",data:"roots>rows"},jsonGrid:{config:"grid",data:"data"},ajaxOptions:{}},p||{});return this.each(function(){var r=this,u=function(d,h){var b=a(h.xmlGrid.config,d)[0],c=a(h.xmlGrid.data,d)[0],e,l;if(xmlJsonClass.xml2json&&a.jgrid.parse){b=xmlJsonClass.xml2json(b," ");b=a.jgrid.parse(b);for(l in b)b.hasOwnProperty(l)&&(e=b[l]);void 0!==e&&(c?(c=b.grid.datatype,
b.grid.datatype="xmlstring",b.grid.datastr=d,a(r).jqGrid(e).jqGrid("setGridParam",{datatype:c})):a(r).jqGrid(e))}else alert("xml2json or parse are not present")},n=function(d,h){if(d&&"string"===typeof d){var b=!1,c,e;a.jgrid.useJSON&&(a.jgrid.useJSON=!1,b=!0);c=a.jgrid.parse(d);b&&(a.jgrid.useJSON=!0);b=c[h.jsonGrid.config];(c=c[h.jsonGrid.data])?(e=b.datatype,b.datatype="jsonstring",b.datastr=c,a(r).jqGrid(b).jqGrid("setGridParam",{datatype:e})):a(r).jqGrid(b)}},d;switch(p.imptype){case "xml":a.ajax(a.extend({url:p.impurl,
type:p.mtype,data:p.impData,dataType:"xml",complete:function(d){!(300>d.status||304===d.status)||0===d.status&&4===d.readyState||(u(d.responseXML,p),a(r).triggerHandler("jqGridImportComplete",[d,p]),a.isFunction(p.importComplete)&&p.importComplete(d))}},p.ajaxOptions));break;case "xmlstring":p.impstring&&"string"===typeof p.impstring&&(d=a.parseXML(p.impstring))&&(u(d,p),a(r).triggerHandler("jqGridImportComplete",[d,p]),a.isFunction(p.importComplete)&&p.importComplete(d),p.impstring=null);break;case "json":a.ajax(a.extend({url:p.impurl,
type:p.mtype,data:p.impData,dataType:"json",complete:function(d){try{!(300>d.status||304===d.status)||0===d.status&&4===d.readyState||(n(d.responseText,p),a(r).triggerHandler("jqGridImportComplete",[d,p]),a.isFunction(p.importComplete)&&p.importComplete(d))}catch(h){}}},p.ajaxOptions));break;case "jsonstring":p.impstring&&"string"===typeof p.impstring&&(n(p.impstring,p),a(r).triggerHandler("jqGridImportComplete",[p.impstring,p]),a.isFunction(p.importComplete)&&p.importComplete(p.impstring),p.impstring=
null)}})},jqGridExport:function(p){p=a.extend({exptype:"xmlstring",root:"grid",ident:"\t"},p||{});var r=null;this.each(function(){if(this.grid){var u,n=a.extend(!0,{},a(this).jqGrid("getGridParam"));n.rownumbers&&(n.colNames.splice(0,1),n.colModel.splice(0,1));n.multiselect&&(n.colNames.splice(0,1),n.colModel.splice(0,1));n.subGrid&&(n.colNames.splice(0,1),n.colModel.splice(0,1));n.knv=null;if(n.treeGrid)for(u in n.treeReader)n.treeReader.hasOwnProperty(u)&&(n.colNames.splice(n.colNames.length-1),
n.colModel.splice(n.colModel.length-1));switch(p.exptype){case "xmlstring":r="<"+p.root+">"+xmlJsonClass.json2xml(n,p.ident)+"</"+p.root+">";break;case "jsonstring":r="{"+xmlJsonClass.toJson(n,p.root,p.ident,!1)+"}",void 0!==n.postData.filters&&(r=r.replace(/filters":"/,'filters":'),r=r.replace(/\}\]\}"/,"}]}"))}}});return r},excelExport:function(p){p=a.extend({exptype:"remote",url:null,oper:"oper",tag:"excel",exportOptions:{}},p||{});return this.each(function(){var r;this.grid&&"remote"===p.exptype&&
(r=a.extend({},this.p.postData),r[p.oper]=p.tag,r=jQuery.param(r),r=-1!==p.url.indexOf("?")?p.url+"&"+r:p.url+"?"+r,window.location=r)})}})})(jQuery);
(function(a){var p=a.jgrid,r=p.fullBoolFeedback,u=p.hasOneFromClasses,n=p.enumEditableCells,d=p.info_dialog,f=function(b){var c=a.makeArray(arguments).slice(1);c.unshift("");c.unshift("Inline");c.unshift(b);return p.feedback.apply(this,c)},h=function(a){return p.getRes(p.guiStyles[this.p.guiStyle],"states."+a)};p.inlineEdit=p.inlineEdit||{};p.extend({editRow:function(b,c,e,d,m,g,t,w,u,q){var y={},E=a.makeArray(arguments).slice(1);"object"===a.type(E[0])?y=E[0]:(void 0!==c&&(y.keys=c),a.isFunction(e)&&
(y.oneditfunc=e),a.isFunction(d)&&(y.successfunc=d),void 0!==m&&(y.url=m),null!=g&&(y.extraparam=g),a.isFunction(t)&&(y.aftersavefunc=t),a.isFunction(w)&&(y.errorfunc=w),a.isFunction(u)&&(y.afterrestorefunc=u),a.isFunction(q)&&(y.beforeEditRow=q));return this.each(function(){var c=this,e=a(c),d=c.p,g=0,l=null,m={},t=d.colModel,q=d.prmNames;if(c.grid){var w=a.extend(!0,{keys:!1,oneditfunc:null,successfunc:null,url:null,extraparam:{},aftersavefunc:null,errorfunc:null,afterrestorefunc:null,restoreAfterError:!0,
beforeEditRow:null,mtype:"POST",focusField:!0},p.inlineEdit,d.inlineEditing||{},y),u=e.jqGrid("getInd",b,!0),A=w.focusField;if(!1!==u&&(w.extraparam[q.oper]===q.addoper||f.call(c,w,"beforeEditRow",w,b))&&"0"===(a(u).attr("editable")||"0")&&!a(u).hasClass("not-editable-row")){q=p.detectRowEditing.call(c,b);if(null!=q&&"cellEditing"===q.mode){var q=q.savedRow,E=c.rows[q.id],H=h.call(c,"select");e.jqGrid("restoreCell",q.id,q.ic);a(E.cells[q.ic]).removeClass("edit-cell "+H);a(E).addClass(H).attr({"aria-selected":"true",
tabindex:"0"})}n.call(c,u,a(u).hasClass("jqgrid-new-row")?"add":"edit",function(e){var f=e.cm,h=a(e.dataElement),t=e.dataWidth,q,n=f.name,w=f.edittype,r=e.iCol,u=f.editoptions||{};try{q=a.unformat.call(this,e.td,{rowId:b,colModel:f},r)}catch(A){q="textarea"===w?h.text():h.html()}m[n]=q;h.html("");f=a.extend({},u,{id:b+"_"+n,name:n,rowId:b,mode:e.mode});if(" "===q||" "===q||1===q.length&&160===q.charCodeAt(0))q="";q=p.createEl.call(c,w,f,q,!0,a.extend({},p.ajaxOptions,d.ajaxSelectOptions||
{}));a(q).addClass("editable");h.append(q);t&&a(q).width(e.dataWidth);p.bindEv.call(c,q,f);"select"===w&&!0===u.multiple&&void 0===u.dataUrl&&p.msie&&a(q).width(a(q).width());null===l&&(l=r);g++});0<g&&(m.id=b,d.savedRow.push(m),a(u).attr("editable","1"),A&&("number"===typeof A&&parseInt(A,10)<=t.length?l=A:"string"===typeof A&&(l=d.iColByName[A]),setTimeout(function(){var b=a(u.cells[l]).find("input,textarea,select,button,object,*[tabindex]").filter(":input:visible:not(:disabled)");0<b.length&&b.focus()},
0)),!0===w.keys&&a(u).bind("keydown",function(a){if(27===a.keyCode)return e.jqGrid("restoreRow",b,w.afterrestorefunc),!1;if(13===a.keyCode){if("TEXTAREA"===a.target.tagName)return!0;e.jqGrid("saveRow",b,w);return!1}}),r.call(c,w.oneditfunc,"jqGridInlineEditRow",b,w))}}})},saveRow:function(b,c,e,l,m,g,t,w){var u=a.makeArray(arguments).slice(1),q={},y=this[0],E=a(y),C=null!=y?y.p:null,B;if(y.grid&&null!=C){"object"===a.type(u[0])?q=u[0]:(a.isFunction(c)&&(q.successfunc=c),void 0!==e&&(q.url=e),void 0!==
l&&(q.extraparam=l),a.isFunction(m)&&(q.aftersavefunc=m),a.isFunction(g)&&(q.errorfunc=g),a.isFunction(t)&&(q.afterrestorefunc=t),a.isFunction(w)&&(q.beforeSaveRow=w));var D=function(a){return E.jqGrid("getGridRes",a)},q=a.extend(!0,{successfunc:null,url:null,extraparam:{},aftersavefunc:null,errorfunc:null,afterrestorefunc:null,restoreAfterError:!0,beforeSaveRow:null,ajaxSaveOptions:{},serializeSaveData:null,mtype:"POST",saveui:"enable",savetext:D("defaults.savetext")||"Saving..."},p.inlineEdit,C.inlineEditing||
{},q),z={},v={},u={},V,I,G;I=E.jqGrid("getInd",b,!0);var S=a(I);B=C.prmNames;var U=D("errors.errcap"),F=D("edit.bClose"),J;if(!1!==I&&(B=q.extraparam[B.oper]===B.addoper?"add":"edit",f.call(y,q,"beforeSaveRow",q,b,B)&&(B=S.attr("editable"),q.url=q.url||C.editurl,J="clientArray"!==q.url,"1"===B)))if(n.call(y,I,S.hasClass("jqgrid-new-row")?"add":"edit",function(b){var c=b.cm,e,d=c.formatter,g=c.editoptions||{},l=c.formatoptions||{};e=p.getEditedValue.call(y,a(b.dataElement),c,!d);G=p.checkValues.call(y,
e,b.iCol);if(!1===G[0])return!1;J&&C.autoencode&&(e=p.htmlEncode(e));"date"===d&&!0!==l.sendFormatted&&(e=a.unformat.date.call(y,e,c));J&&!0===g.NullIfEmpty&&""===e&&(e="null");z[c.name]=e}),!1===G[0])try{var H=E.jqGrid("getGridRowById",b),N=p.findPos(H);d.call(y,U,G[1],F,{left:N[0],top:N[1]+a(H).outerHeight()})}catch(Y){alert(G[1])}else if(H=b,B=C.prmNames,N=!1===C.keyName?B.id:C.keyName,z&&(z[B.oper]=B.editoper,void 0===z[N]||""===z[N]?z[N]=b:I.id!==C.idPrefix+z[N]&&(I=p.stripPref(C.idPrefix,b),
void 0!==C._index[I]&&(C._index[z[N]]=C._index[I],delete C._index[I]),b=C.idPrefix+z[N],S.attr("id",b),C.selrow===H&&(C.selrow=b),a.isArray(C.selarrrow)&&(I=a.inArray(H,C.selarrrow),0<=I&&(C.selarrrow[I]=b)),C.multiselect&&(I="jqg_"+C.id+"_"+b,S.find("input.cbox").attr("id",I).attr("name",I))),z=a.extend({},z,C.inlineData||{},q.extraparam)),J)E.jqGrid("progressBar",{method:"show",loadtype:q.saveui,htmlcontent:q.savetext}),u=a.extend({},z,u),u[N]=p.stripPref(C.idPrefix,u[N]),a.ajax(a.extend({url:q.url,
data:p.serializeFeedback.call(y,a.isFunction(q.serializeSaveData)?q.serializeSaveData:C.serializeRowData,"jqGridInlineSerializeSaveData",u),type:q.mtype,complete:function(c,e){E.jqGrid("progressBar",{method:"hide",loadtype:q.saveui,htmlcontent:q.savetext});if((300>c.status||304===c.status)&&(0!==c.status||4!==c.readyState)){var d,g;g=E.triggerHandler("jqGridInlineSuccessSaveRow",[c,b,q]);a.isArray(g)||(g=[!0,z]);g[0]&&a.isFunction(q.successfunc)&&(g=q.successfunc.call(y,c));a.isArray(g)?(d=g[0],z=
g[1]||z):d=g;if(!0===d){C.autoencode&&a.each(z,function(a,b){z[a]=p.htmlDecode(b)});z=a.extend({},z,v);E.jqGrid("setRowData",b,z);S.attr("editable","0");for(d=0;d<C.savedRow.length;d++)if(String(C.savedRow[d].id)===String(b)){V=d;break}0<=V&&C.savedRow.splice(V,1);r.call(y,q.aftersavefunc,"jqGridInlineAfterSaveRow",b,c,z,q);S.removeClass("jqgrid-new-row").unbind("keydown")}else r.call(y,q.errorfunc,"jqGridInlineErrorSaveRow",b,c,e,null,q),!0===q.restoreAfterError&&E.jqGrid("restoreRow",b,q.afterrestorefunc)}},
error:function(c,e,g){a("#lui_"+p.jqID(C.id)).hide();E.triggerHandler("jqGridInlineErrorSaveRow",[b,c,e,g,q]);if(a.isFunction(q.errorfunc))q.errorfunc.call(y,b,c,e,g);else{c=c.responseText||c.statusText;try{d.call(y,U,'<div class="'+h.call(y,"error")+'">'+c+"</div>",F,{buttonalign:"right"})}catch(l){alert(c)}}!0===q.restoreAfterError&&E.jqGrid("restoreRow",b,q.afterrestorefunc)}},p.ajaxOptions,C.ajaxRowOptions,q.ajaxSaveOptions||{}));else{z=a.extend({},z,v);I=E.jqGrid("setRowData",b,z);S.attr("editable",
"0");for(u=0;u<C.savedRow.length;u++)if(String(C.savedRow[u].id)===String(H)){V=u;break}0<=V&&C.savedRow.splice(V,1);r.call(y,q.aftersavefunc,"jqGridInlineAfterSaveRow",b,I,z,q);S.removeClass("jqgrid-new-row").unbind("keydown")}}},restoreRow:function(b,c){var e=a.makeArray(arguments).slice(1),d={};"object"===a.type(e[0])?d=e[0]:a.isFunction(c)&&(d.afterrestorefunc=c);return this.each(function(){var c=this,e=a(c),h=c.p,n=-1,u={},q;if(c.grid){var y=a.extend(!0,{},p.inlineEdit,h.inlineEditing||{},d),
E=e.jqGrid("getInd",b,!0);if(!1!==E&&f.call(c,y,"beforeCancelRow",y,b)){for(q=0;q<h.savedRow.length;q++)if(String(h.savedRow[q].id)===String(b)){n=q;break}if(0<=n){if(a.isFunction(a.fn.datepicker))try{a("input.hasDatepicker","#"+p.jqID(E.id)).datepicker("hide")}catch(C){}a.each(h.colModel,function(){var b=this.name;h.savedRow[n].hasOwnProperty(b)&&(u[b]=h.savedRow[n][b],!this.formatter||"date"!==this.formatter||null!=this.formatoptions&&!0===this.formatoptions.sendFormatted||(u[b]=a.unformat.date.call(c,
u[b],this)))});e.jqGrid("setRowData",b,u);a(E).attr("editable","0").unbind("keydown");h.savedRow.splice(n,1);a("#"+p.jqID(b),c).hasClass("jqgrid-new-row")&&setTimeout(function(){e.jqGrid("delRowData",b);e.jqGrid("showAddEditButtons",!1)},0)}r.call(c,y.afterrestorefunc,"jqGridInlineAfterRestoreRow",b)}}})},addRow:function(b){return this.each(function(){if(this.grid){var c=this,e=a(c),d=c.p,h=a.extend(!0,{rowID:null,initdata:{},position:"first",useDefValues:!0,useFormatter:!1,beforeAddRow:null,addRowParams:{extraparam:{}}},
p.inlineEdit,d.inlineEditing||{},b||{});f.call(c,h,"beforeAddRow",h.addRowParams)&&(h.rowID=a.isFunction(h.rowID)?h.rowID.call(c,h):null!=h.rowID?h.rowID:p.randId(),!0===h.useDefValues&&a(d.colModel).each(function(){if(this.editoptions&&this.editoptions.defaultValue){var b=this.editoptions.defaultValue;h.initdata[this.name]=a.isFunction(b)?b.call(c):b}}),h.rowID=d.idPrefix+h.rowID,e.jqGrid("addRowData",h.rowID,h.initdata,h.position),a("#"+p.jqID(h.rowID),c).addClass("jqgrid-new-row"),h.useFormatter?
a("#"+p.jqID(h.rowID)+" .ui-inline-edit",c).click():(d=d.prmNames,h.addRowParams.extraparam[d.oper]=d.addoper,e.jqGrid("editRow",h.rowID,h.addRowParams),e.jqGrid("setSelection",h.rowID)))}})},inlineNav:function(b,c){"object"===typeof b&&(c=b,b=void 0);return this.each(function(){var e=this,d=a(e),f=e.p;if(this.grid&&null!=f){var g,t=b===f.toppager?f.idSel+"_top":f.idSel,n=b===f.toppager?f.id+"_top":f.id,r=h.call(e,"disabled"),q=a.extend(!0,{edit:!0,editicon:"ui-icon-pencil",add:!0,addicon:"ui-icon-plus",
save:!0,saveicon:"ui-icon-disk",cancel:!0,cancelicon:"ui-icon-cancel",commonIconClass:"ui-icon",iconsOverText:!1,addParams:{addRowParams:{extraparam:{}}},editParams:{},restoreAfterSelect:!0},d.jqGrid("getGridRes","nav"),p.nav||{},f.navOptions||{},c||{});if(void 0===b)if(f.pager)if(d.jqGrid("inlineNav",f.pager,q),f.toppager)b=f.toppager,t=f.idSel+"_top",n=f.id+"_top";else return;else f.toppager&&(b=f.toppager,t=f.idSel+"_top",n=f.id+"_top");if(void 0!==b&&(g=a(b),!(0>=g.length))){0>=g.find(".navtable").length&&
d.jqGrid("navGrid",b,{add:!1,edit:!1,del:!1,search:!1,refresh:!1,view:!1});f._inlinenav=!0;if(!0===q.addParams.useFormatter){g=f.colModel;var y,E;for(y=0;y<g.length;y++)if(g[y].formatter&&"actions"===g[y].formatter){g[y].formatoptions&&(E={keys:!1,onEdit:null,onSuccess:null,afterSave:null,onError:null,afterRestore:null,extraparam:{},url:null},g=a.extend(E,g[y].formatoptions),q.addParams.addRowParams={keys:g.keys,oneditfunc:g.onEdit,successfunc:g.onSuccess,url:g.url,extraparam:g.extraparam,aftersavefunc:g.afterSave,
errorfunc:g.onError,afterrestorefunc:g.afterRestore});break}}q.add&&d.jqGrid("navButtonAdd",b,{caption:q.addtext,title:q.addtitle,commonIconClass:q.commonIconClass,buttonicon:q.addicon,iconsOverText:q.iconsOverText,id:n+"_iladd",onClickButton:function(){u(this,r)||d.jqGrid("addRow",q.addParams)}});q.edit&&d.jqGrid("navButtonAdd",b,{caption:q.edittext,title:q.edittitle,commonIconClass:q.commonIconClass,buttonicon:q.editicon,iconsOverText:q.iconsOverText,id:n+"_iledit",onClickButton:function(){if(!u(this,
r)){var a=f.selrow;a?d.jqGrid("editRow",a,q.editParams):e.modalAlert()}}});q.save&&(d.jqGrid("navButtonAdd",b,{caption:q.savetext||"",title:q.savetitle||"Save row",commonIconClass:q.commonIconClass,buttonicon:q.saveicon,iconsOverText:q.iconsOverText,id:n+"_ilsave",onClickButton:function(){if(!u(this,r)){var b=f.savedRow[0].id;if(b){var c=f.prmNames,g=c.oper,h=q.editParams;a("#"+p.jqID(b),e).hasClass("jqgrid-new-row")?(q.addParams.addRowParams.extraparam[g]=c.addoper,h=q.addParams.addRowParams):(q.editParams.extraparam||
(q.editParams.extraparam={}),q.editParams.extraparam[g]=c.editoper);d.jqGrid("saveRow",b,h)}else e.modalAlert()}}}),a(t+"_ilsave").addClass(r));q.cancel&&(d.jqGrid("navButtonAdd",b,{caption:q.canceltext||"",title:q.canceltitle||"Cancel row editing",commonIconClass:q.commonIconClass,buttonicon:q.cancelicon,iconsOverText:q.iconsOverText,id:n+"_ilcancel",onClickButton:function(){if(!u(this,r)){var b=f.savedRow[0].id,c=q.editParams;b?(a("#"+p.jqID(b),e).hasClass("jqgrid-new-row")&&(c=q.addParams.addRowParams),
d.jqGrid("restoreRow",b,c)):e.modalAlert()}}}),a(t+"_ilcancel").addClass(r));!0===q.restoreAfterSelect&&d.bind("jqGridSelectRow",function(a,b){if(0<f.savedRow.length&&!0===f._inlinenav){var c=f.savedRow[0].id;b!==c&&"number"!==typeof c&&d.jqGrid("restoreRow",c,q.editParams)}});d.bind("jqGridInlineAfterRestoreRow jqGridInlineAfterSaveRow",function(){d.jqGrid("showAddEditButtons",!1)});d.bind("jqGridInlineEditRow",function(a,b){d.jqGrid("showAddEditButtons",!0,b)})}}})},showAddEditButtons:function(b){return this.each(function(){if(this.grid){var c=
this.p,e=c.idSel,d=h.call(this,"disabled"),f=e+"_ilsave,"+e+"_ilcancel"+(c.toppager?","+e+"_top_ilsave,"+e+"_top_ilcancel":""),c=e+"_iladd,"+e+"_iledit"+(c.toppager?","+e+"_top_iladd,"+e+"_top_iledit":"");a(b?c:f).addClass(d);a(b?f:c).removeClass(d)}})}})})(jQuery);
(function(a){var p=a.jgrid,r=null!=a.ui?a.ui.multiselect:null,u=p.jqID;p.msie&&8===p.msiever()&&(a.expr[":"].hidden=function(a){return 0===a.offsetWidth||0===a.offsetHeight||"none"===a.style.display});p._multiselect=!1;if(a.ui&&r){if(r.prototype._setSelected){var n=r.prototype._setSelected;r.prototype._setSelected=function(d,f){var h=this,b=n.call(h,d,f);if(f&&h.selectedList){var c=h.element;h.selectedList.find("li").each(function(){a(h).data("optionLink")&&a(h).data("optionLink").remove().appendTo(c)})}return b}}r.prototype.destroy&&
(r.prototype.destroy=function(){this.element.show();this.container.remove();void 0===a.Widget?a.widget.prototype.destroy.apply(this,arguments):a.Widget.prototype.destroy.apply(this,arguments)});p._multiselect=!0}p.extend({sortableColumns:function(d){return this.each(function(){function f(){b.disableClick=!0}var h=this,b=h.p,c=u(b.id),c={tolerance:"pointer",axis:"x",scrollSensitivity:"1",items:">th:not(:has(#jqgh_"+c+"_cb,#jqgh_"+c+"_rn,#jqgh_"+c+"_subgrid),:hidden)",placeholder:{element:function(b){return a(document.createElement(b[0].nodeName)).addClass(b[0].className+
" ui-sortable-placeholder ui-state-highlight").removeClass("ui-sortable-helper")[0]},update:function(a,b){b.height(a.currentItem.innerHeight()-parseInt(a.currentItem.css("paddingTop")||0,10)-parseInt(a.currentItem.css("paddingBottom")||0,10));b.width(a.currentItem.innerWidth()-parseInt(a.currentItem.css("paddingLeft")||0,10)-parseInt(a.currentItem.css("paddingRight")||0,10))}},update:function(c,e){var d=a(">th",a(e.item).parent()),f=b.id+"_",p=[];d.each(function(){var c=a(">div",this).get(0).id.replace(/^jqgh_/,
"").replace(f,""),c=b.iColByName[c];void 0!==c&&p.push(c)});a(h).jqGrid("remapColumns",p,!0,!0);a.isFunction(b.sortable.update)&&b.sortable.update(p);setTimeout(function(){b.disableClick=!1},50)}};b.sortable.options?a.extend(c,b.sortable.options):a.isFunction(b.sortable)&&(b.sortable={update:b.sortable});if(c.start){var e=c.start;c.start=function(a,b){f();e.call(this,a,b)}}else c.start=f;b.sortable.exclude&&(c.items+=":not("+b.sortable.exclude+")");c=d.sortable(c);c=c.data("sortable")||c.data("uiSortable")||
c.data("ui-sortable");null!=c&&(c.floating=!0)})},columnChooser:function(d){function f(b,c){b&&("string"===typeof b?a.fn[b]&&a.fn[b].apply(c,a.makeArray(arguments).slice(2)):a.isFunction(b)&&b.apply(c,a.makeArray(arguments).slice(2)))}var h=this,b=h[0].p,c,e,l={},m=[],g,t,n=b.colModel;g=n.length;t=b.colNames;var A=function(a){return r&&r.prototype&&a.data(r.prototype.widgetFullName||r.prototype.widgetName)||a.data("ui-multiselect")||a.data("multiselect")};if(!a("#colchooser_"+u(b.id)).length){c=a('<div id="colchooser_'+
b.id+'" style="position:relative;overflow:hidden"><div><select multiple="multiple"></select></div></div>');e=a("select",c);d=a.extend({width:400,height:240,classname:null,done:function(a){a&&null==b.groupHeader&&h.jqGrid("remapColumns",a,!0)},msel:"multiselect",dlog:"dialog",dialog_opts:{minWidth:470,dialogClass:"ui-jqdialog"},dlog_opts:function(b){var c={};c[b.bSubmit]=function(){b.apply_perm();b.cleanup(!1)};c[b.bCancel]=function(){b.cleanup(!0)};return a.extend(!0,{buttons:c,close:function(){b.cleanup(!0)},
modal:b.modal||!1,resizable:b.resizable||!0,width:b.width+70,resize:function(){var a=A(e),b=a.container.closest(".ui-dialog-content");0<b.length&&"object"===typeof b[0].style?b[0].style.width="":b.css("width","");a.selectedList.height(Math.max(a.selectedContainer.height()-a.selectedActions.outerHeight()-1,1));a.availableList.height(Math.max(a.availableContainer.height()-a.availableActions.outerHeight()-1,1))}},b.dialog_opts||{})},apply_perm:function(){var c=[];a("option",e).each(function(){a(this).is(":selected")?
h.jqGrid("showCol",n[this.value].name):h.jqGrid("hideCol",n[this.value].name)});a("option",e).filter(":selected").each(function(){c.push(parseInt(this.value,10))});a.each(c,function(){delete l[n[parseInt(this,10)].name]});a.each(l,function(){var a=parseInt(this,10);var b=c,e=a,d,g;0<=e?(d=b.slice(),g=d.splice(e,Math.max(b.length-e,e)),e>b.length&&(e=b.length),d[e]=a,c=d.concat(g)):c=b});d.done&&d.done.call(h,c);h.jqGrid("setGridWidth",b.autowidth||void 0!==b.widthOrg&&"auto"!==b.widthOrg&&"100%"!==
b.widthOrg?b.width:b.tblwidth,b.shrinkToFit)},cleanup:function(a){f(d.dlog,c,"destroy");f(d.msel,e,"destroy");c.remove();a&&d.done&&d.done.call(h)},msel_opts:{}},h.jqGrid("getGridRes","col"),p.col,d||{});if(a.ui&&r&&r.defaults){if(!p._multiselect){alert("Multiselect plugin loaded after jqGrid. Please load the plugin before the jqGrid!");return}d.msel_opts=a.extend(r.defaults,d.msel_opts)}d.caption&&c.attr("title",d.caption);d.classname&&(c.addClass(d.classname),e.addClass(d.classname));d.width&&(a(">div",
c).css({width:d.width,margin:"0 auto"}),e.css("width",d.width));d.height&&(a(">div",c).css("height",d.height),e.css("height",d.height-10));e.empty();var q=b.groupHeader,y={},E,C,B,D,z;if(null!=q&&null!=q.groupHeaders)for(E=0,B=q.groupHeaders.length;E<B;E++)for(z=q.groupHeaders[E],C=0;C<z.numberOfColumns;C++)D=b.iColByName[z.startColumnName]+C,y[D]=a.isFunction(d.buildItemText)?d.buildItemText.call(h[0],{iCol:D,cm:n[D],cmName:n[D].name,colName:t[D],groupTitleText:z.titleText}):a.jgrid.stripHtml(z.titleText)+
": "+a.jgrid.stripHtml(""===t[D]?n[D].name:t[D]);for(D=0;D<g;D++)void 0===y[D]&&(y[D]=a.isFunction(d.buildItemText)?d.buildItemText.call(h[0],{iCol:D,cm:n[D],cmName:n[D].name,colName:t[D],groupTitleText:null}):a.jgrid.stripHtml(t[D]));a.each(n,function(a){l[this.name]=a;this.hidedlg?this.hidden||m.push(a):e.append("<option value='"+a+"'"+(b.headertitles||this.headerTitle?' title="'+p.stripHtml("string"===typeof this.headerTitle?this.headerTitle:y[a])+'"':"")+(this.hidden?"":" selected='selected'")+
">"+y[a]+"</option>")});g=a.isFunction(d.dlog_opts)?d.dlog_opts.call(h,d):d.dlog_opts;f(d.dlog,c,g);g=a.isFunction(d.msel_opts)?d.msel_opts.call(h,d):d.msel_opts;f(d.msel,e,g);g=a("#colchooser_"+u(b.id));g.css({margin:"auto"});g.find(">div").css({width:"100%",height:"100%",margin:"auto"});if(g=A(e))g.container.css({width:"100%",height:"100%",margin:"auto"}),g.selectedContainer.css({width:100*g.options.dividerLocation+"%",height:"100%",margin:"auto",boxSizing:"border-box"}),g.availableContainer.css({width:100-
100*g.options.dividerLocation+"%",height:"100%",margin:"auto",boxSizing:"border-box"}),g.selectedList.css("height","auto"),g.availableList.css("height","auto"),t=Math.max(g.selectedList.height(),g.availableList.height()),t=Math.min(t,a(window).height()),g.selectedList.css("height",t),g.availableList.css("height",t)}},sortableRows:function(d){return this.each(function(){var f=this,h=f.grid,b=f.p;h&&!b.treeGrid&&a.fn.sortable&&(d=a.extend({cursor:"move",axis:"y",items:">.jqgrow"},d||{}),d.start&&a.isFunction(d.start)?
(d._start_=d.start,delete d.start):d._start_=!1,d.update&&a.isFunction(d.update)?(d._update_=d.update,delete d.update):d._update_=!1,d.start=function(c,e){a(e.item).css("border-width","0");a("td",e.item).each(function(a){this.style.width=h.cols[a].style.width});if(b.subGrid){var l=a(e.item).attr("id");try{a(f).jqGrid("collapseSubGridRow",l)}catch(m){}}d._start_&&d._start_.apply(this,[c,e])},d.update=function(c,e){a(e.item).css("border-width","");!0===b.rownumbers&&a("td.jqgrid-rownum",f.rows).each(function(c){a(this).html(c+
1+(parseInt(b.page,10)-1)*parseInt(b.rowNum,10))});d._update_&&d._update_.apply(this,[c,e])},a("tbody:first",f).sortable(d),a.isFunction(a.fn.disableSelection)&&a("tbody:first>.jqgrow",f).disableSelection())})},gridDnD:function(d){return this.each(function(){function f(){var b=a.data(h,"dnd");a("tr.jqgrow:not(.ui-draggable)",h).draggable(a.isFunction(b.drag)?b.drag.call(a(h),b):b.drag)}var h=this,b,c;if(h.grid&&!h.p.treeGrid&&a.fn.draggable&&a.fn.droppable)if(void 0===a("#jqgrid_dnd")[0]&&a("body").append("<table id='jqgrid_dnd' class='ui-jqgrid-dnd'></table>"),
"string"===typeof d&&"updateDnD"===d&&!0===h.p.jqgdnd)f();else if(d=a.extend({drag:function(b){return a.extend({start:function(c,d){var g;if(h.p.subGrid){g=a(d.helper).attr("id");try{a(h).jqGrid("collapseSubGridRow",g)}catch(f){}}for(g=0;g<a.data(h,"dnd").connectWith.length;g++)0===a(a.data(h,"dnd").connectWith[g]).jqGrid("getGridParam","reccount")&&a(a.data(h,"dnd").connectWith[g]).jqGrid("addRowData","jqg_empty_row",{});d.helper.addClass("ui-state-highlight");a("td",d.helper).each(function(a){this.style.width=
h.grid.headers[a].width+"px"});b.onstart&&a.isFunction(b.onstart)&&b.onstart.call(a(h),c,d)},stop:function(c,d){var g;d.helper.dropped&&!b.dragcopy&&(g=a(d.helper).attr("id"),void 0===g&&(g=a(this).attr("id")),a(h).jqGrid("delRowData",g));for(g=0;g<a.data(h,"dnd").connectWith.length;g++)a(a.data(h,"dnd").connectWith[g]).jqGrid("delRowData","jqg_empty_row");b.onstop&&a.isFunction(b.onstop)&&b.onstop.call(a(h),c,d)}},b.drag_opts||{})},drop:function(b){return a.extend({accept:function(b){if(!a(b).hasClass("jqgrow"))return b;
b=a(b).closest("table.ui-jqgrid-btable");return 0<b.length&&void 0!==a.data(b[0],"dnd")?(b=a.data(b[0],"dnd").connectWith,-1!==a.inArray("#"+u(this.id),b)?!0:!1):!1},drop:function(c,d){if(a(d.draggable).hasClass("jqgrow")){var g=a(d.draggable).attr("id"),g=d.draggable.parent().parent().jqGrid("getRowData",g);if(!b.dropbyname){var f=0,p={},n,q,r=a("#"+u(this.id)).jqGrid("getGridParam","colModel");try{for(q in g)g.hasOwnProperty(q)&&(n=r[f].name,"cb"!==n&&"rn"!==n&&"subgrid"!==n&&g.hasOwnProperty(q)&&
r[f]&&(p[n]=g[q]),f++);g=p}catch(E){}}d.helper.dropped=!0;b.beforedrop&&a.isFunction(b.beforedrop)&&(n=b.beforedrop.call(this,c,d,g,a("#"+u(h.p.id)),a(this)),void 0!==n&&null!==n&&"object"===typeof n&&(g=n));if(d.helper.dropped){var C;b.autoid&&(a.isFunction(b.autoid)?C=b.autoid.call(this,g):(C=Math.ceil(1E3*Math.random()),C=b.autoidprefix+C));a("#"+u(this.id)).jqGrid("addRowData",C,g,b.droppos);g[h.p.localReader.id]=C}b.ondrop&&a.isFunction(b.ondrop)&&b.ondrop.call(this,c,d,g)}}},b.drop_opts||{})},
onstart:null,onstop:null,beforedrop:null,ondrop:null,drop_opts:{},drag_opts:{revert:"invalid",helper:"clone",cursor:"move",appendTo:"#jqgrid_dnd",zIndex:5E3},dragcopy:!1,dropbyname:!1,droppos:"first",autoid:!0,autoidprefix:"dnd_"},d||{}),d.connectWith)for(d.connectWith=d.connectWith.split(","),d.connectWith=a.map(d.connectWith,function(b){return a.trim(b)}),a.data(h,"dnd",d),0===h.p.reccount||h.p.jqgdnd||f(),h.p.jqgdnd=!0,b=0;b<d.connectWith.length;b++)c=d.connectWith[b],a(c).droppable(a.isFunction(d.drop)?
d.drop.call(a(h),d):d.drop)})},gridResize:function(d){return this.each(function(){var f=this,h=f.grid,b=f.p,c=b.gView+">.ui-jqgrid-bdiv",e=!1,l,m=b.height;if(h&&a.fn.resizable){d=a.extend({},d||{});d.alsoResize?(d._alsoResize_=d.alsoResize,delete d.alsoResize):d._alsoResize_=!1;d.stop&&a.isFunction(d.stop)?(d._stop_=d.stop,delete d.stop):d._stop_=!1;d.stop=function(g,n){a(f).jqGrid("setGridWidth",n.size.width,d.shrinkToFit);a(b.gView+">.ui-jqgrid-titlebar").css("width","");e?(a(l).each(function(){a(this).css("height",
"")}),"auto"!==m&&"100%"!==m||a(h.bDiv).css("height",m)):a(f).jqGrid("setGridParam",{height:a(c).height()});f.fixScrollOffsetAndhBoxPadding&&f.fixScrollOffsetAndhBoxPadding();d._stop_&&d._stop_.call(f,g,n)};l=c;"auto"!==m&&"100%"!==m||void 0!==d.handles||(d.handles="e,w");if(d.handles){var g=a.map(String(d.handles).split(","),function(b){return a.trim(b)});2===g.length&&("e"===g[0]&&"w"===g[1]||"e"===g[1]&&"w"===g[1])&&(l=b.gView+">div:not(.frozen-div)",e=!0,b.pager&&(l+=","+b.pager))}d.alsoResize=
d._alsoResize_?l+","+d._alsoResize_:l;delete d._alsoResize_;a(b.gBox).resizable(d)}})}})})(jQuery);
(function(a){function p(a,d,f){if(!(this instanceof p))return new p(a);this.aggregator=a;this.finilized=!1;this.context=d;this.pivotOptions=f}function r(n,d,f,h,b){var c=h.length,e=function(a,b){var c=a,e=b;null==c&&(c="");null==e&&(e="");c=String(c);e=String(e);this.caseSensitive||(c=c.toUpperCase(),e=e.toUpperCase());if(c===e){if(a===b)return 0;if(void 0===a)return-1;if(void 0===b)return 1;if(null===a)return-1;if(null===b)return 1}return c<e?-1:1},l=function(a,b){a=Number(a);b=Number(b);return a===
b?0:a<b?-1:1},m=function(a,b){a=Math.floor(Number(a));b=Math.floor(Number(b));return a===b?0:a<b?-1:1};this.items=[];this.indexesOfSourceData=[];this.trimByCollect=n;this.caseSensitive=d;this.skipSort=f;this.fieldLength=c;this.fieldNames=Array(c);this.fieldSortDirection=Array(c);this.fieldCompare=Array(c);for(n=0;n<c;n++){d=h[n];this.fieldNames[n]=d[b||"dataName"];switch(d.sorttype){case "integer":case "int":this.fieldCompare[n]=m;break;case "number":case "currency":case "float":this.fieldCompare[n]=
l;break;default:this.fieldCompare[n]=a.isFunction(d.compare)?d.compare:e}this.fieldSortDirection[n]="desc"===d.sortorder?-1:1}}p.prototype.calc=function(n,d,f,h,b){if(void 0!==n)switch(this.result=this.result||0,n=parseFloat(n),this.aggregator){case "sum":this.result+=n;break;case "count":this.result++;break;case "avg":this.finilized?(this.count=this.count||0,this.result=(this.result*this.count+n)/(this.count+1)):(this.result+=n,this.count=this.count||0);this.count++;break;case "min":this.result=
Math.min(this.result,n);break;case "max":this.result=Math.max(this.result,n);break;default:a.isFunction(this.aggregator)&&(this.result=this.aggregator.call(this.context,{previousResult:this.result,value:n,fieldName:d,item:f,iItem:h,items:b}))}};p.prototype.getResult=function(a,d,f){if(void 0!==this.result||f)f&&void 0!==this.result&&(this.count=this.result=0),void 0===this.result||this.finilized||"avg"!==this.aggregator||(this.result/=this.count,this.finilized=!0),a[d]=this.result};r.prototype.compareVectorsEx=
function(a,d){var f=this.fieldLength,h,b;for(h=0;h<f;h++)if(b=this.fieldCompare[h](a[h],d[h]),0!==b)return{index:h,result:b};return{index:-1,result:0}};r.prototype.getIndexOfDifferences=function(a,d){return null===d||null===a?0:this.compareVectorsEx(a,d).index};r.prototype.compareVectors=function(a,d){var f=this.compareVectorsEx(a,d);return 0<(0<=f.index?this.fieldSortDirection[f.index]:1)?f.result:-f.result};r.prototype.getItem=function(a){return this.items[a]};r.prototype.getIndexLength=function(){return this.items.length};
r.prototype.getIndexesOfSourceData=function(a){return this.indexesOfSourceData[a]};r.prototype.createDataIndex=function(p){var d,f=p.length,h=this.fieldLength,b,c,e=this.fieldNames,l=this.indexesOfSourceData,m,g,t=this.items,w;for(d=0;d<f;d++){g=p[d];b=Array(h);for(m=0;m<h;m++)c=g[e[m]],void 0!==c&&("string"===typeof c&&this.trimByCollect&&(c=a.trim(c)),b[m]=c);g=0;w=t.length-1;if(0>w)t.push(b),l.push([d]);else if(c=this.compareVectors(b,t[w]),0===c)l[w].push(d);else if(1===c||this.skipSort)t.push(b),
l.push([d]);else if(c=this.compareVectors(t[0],b),1===c)t.unshift(b),l.unshift([d]);else if(0===c)l[0].push(d);else for(;;){if(2>w-g){t.splice(w,0,b);l.splice(w,0,[d]);break}m=Math.floor((g+w)/2);c=this.compareVectors(t[m],b);if(0===c){l[m].push(d);break}1===c?w=m:g=m}}};var u=a.jgrid;u.extend({pivotSetup:function(n,d){var f=this[0],h=a.isArray,b={},c={groupField:[],groupSummary:[],groupSummaryPos:[]},e={grouping:!0,groupingView:c},l=a.extend({totals:!1,useColSpanStyle:!1,trimByCollect:!0,skipSortByX:!1,
skipSortByY:!1,caseSensitive:!1,footerTotals:!1,groupSummary:!0,groupSummaryPos:"header",frozenStaticCols:!1,defaultFormatting:!0,data:n},d||{}),m,g,t,w=n.length,A,q,y,E,C,B,D=l.xDimension,z=l.yDimension,v=l.aggregates,V,w=l.totalText||l.totals||l.rowTotals||l.totalHeader,I,G=h(D)?D.length:0;E=h(z)?z.length:0;var S=h(v)?v.length:0,U=E-(1===S?1:0),F=[],J=[],H=[],h=[],N=Array(S),Y=Array(E),X,T,x,O,aa,Q,K,L,k,R,W;g=function(b,c,e){b=new r(l.trimByCollect,l.caseSensitive,c,b);a.isFunction(e)&&(b.compareVectorsEx=
e);b.createDataIndex(n);return b};var ba=function(b,c,e,d,g){var h,k;switch(b){case 1:h=z[d].totalText||"{0} {1} {2}";k="y"+g+"t"+d;break;case 2:h=l.totalText||"{0}";k="t";break;default:h=1<S?c.label||"{0}":W.getItem(g)[d],k="y"+g}b=a.extend({},c,{name:k+(1<S?"a"+e:""),label:a.isFunction(h)?h.call(f,2===b?{aggregate:c,iAggregate:e,pivotOptions:l}:{yIndex:W.getItem(g),aggregate:c,iAggregate:e,yLevel:d,pivotOptions:l}):u.template.apply(f,2===b?[h,c.aggregator,c.member,e]:[h,c.aggregator,c.member,W.getItem(g)[d],
d])});delete b.member;delete b.aggregator;return b};C=function(a,b,c){var e,d;for(e=0;e<S;e++)d=v[e],void 0===d.template&&void 0===d.formatter&&l.defaultFormatting&&(d.template="count"===d.aggregator?"integer":"number"),H.push(ba(a,d,e,b,c))};X=function(b,c,e){var d,g,l,h;for(d=U-1;d>=c;d--)if(J[d]){for(g=0;g<=d;g++)k=F[g].groupHeaders,k[k.length-1].numberOfColumns+=S;A=z[d];l=A.totalHeader;h=A.headerOnTop;for(g=d+1;g<=U-1;g++)F[g].groupHeaders.push({titleText:h&&g===d+1||!h&&g===U-1?a.isFunction(l)?
l.call(f,e,d):u.template.call(f,l||"",e[d],d):"",startColumnName:"y"+(b-1)+"t"+d+(1===S?"":"a0"),numberOfColumns:S})}};var ca=function(a){a=new p("count"===v[a].aggregator?"sum":v[a].aggregator,f,d);a.groupInfo={iRows:[],rows:[],ys:[],iYs:[]};return a},ha=function(){var a,b;for(a=U-1;0<=a;a--)if(J[a])for(null==Y[a]&&(Y[a]=Array(S)),b=0;b<S;b++)Y[a][b]=ca(b)},ja=function(a,b,c,e){var d,g=W.getIndexOfDifferences(b,c),f,l;if(null!==c)for(g=Math.max(g,0),d=U-1;d>=g;d--)f="y"+a+"t"+d+(1<S?"a"+e:""),J[d]&&
void 0===K[f]&&(l=Y[d][e],l.getResult(K,f),K.pivotInfos[f]={colType:1,iA:e,a:v[e],level:d,iRows:l.groupInfo.iRows,rows:l.groupInfo.rows,ys:l.groupInfo.ys,iYs:l.groupInfo.iYs},b!==c&&(Y[d][e]=ca(e)))},da=function(b,c,e,d,g,f,l){var h;if(b!==c)for(c=U-1;0<=c;c--)J[c]&&(h=Y[c][d],h.calc(g[e.member],e.member,g,f,n),h=h.groupInfo,0>a.inArray(l,h.iYs)&&(h.iYs.push(l),h.ys.push(b)),0>a.inArray(f,h.iRows)&&(h.iRows.push(f),h.rows.push(g)))};if(0===G||0===S)throw"xDimension or aggregates options are not set!";
R=g(D,l.skipSortByX,l.compareVectorsByX);W=g(z,l.skipSortByY,l.compareVectorsByY);d.xIndex=R;d.yIndex=W;for(g=0;g<G;g++)t=D[g],q={name:"x"+g,label:null!=t.label?a.isFunction(t.label)?t.label.call(f,t,g,l):t.label:t.dataName,frozen:l.frozenStaticCols},g<G-1&&(c.groupField.push(q.name),c.groupSummary.push(l.groupSummary),c.groupSummaryPos.push(l.groupSummaryPos)),q=a.extend(q,t),delete q.dataName,delete q.footerText,H.push(q);2>G&&(e.grouping=!1);e.sortname=H[G-1].name;c.hideFirstGroupCol=!0;for(g=
0;g<E;g++)A=z[g],J.push(A.totals||A.rowTotals||A.totalText||A.totalHeader?!0:!1);L=W.getItem(0);C(0,E-1,0);c=W.getIndexLength();for(q=1;q<c;q++){x=W.getItem(q);g=W.getIndexOfDifferences(x,L);for(t=U-1;t>=g;t--)J[t]&&C(1,t,q-1);L=x;C(0,E-1,q)}for(g=U-1;0<=g;g--)J[g]&&C(1,g,c-1);w&&C(2);L=W.getItem(0);for(t=0;t<U;t++)F.push({useColSpanStyle:l.useColSpanStyle,groupHeaders:[{titleText:L[t],startColumnName:1===S?"y0":"y0a0",numberOfColumns:S}]});for(q=1;q<c;q++){x=W.getItem(q);g=W.getIndexOfDifferences(x,
L);X(q,g,L);for(t=U-1;t>=g;t--)F[t].groupHeaders.push({titleText:x[t],startColumnName:"y"+q+(1===S?"":"a0"),numberOfColumns:S});for(t=0;t<g;t++)k=F[t].groupHeaders,k[k.length-1].numberOfColumns+=S;L=x}X(c,0,L);if(w)for(g=0;g<U;g++)F[g].groupHeaders.push({titleText:g<U-1?"":l.totalHeader||"",startColumnName:"t"+(1===S?"":"a0"),numberOfColumns:S});X=R.getIndexLength();for(E=0;E<X;E++){t=R.getItem(E);C={iX:E,x:t};K={pivotInfos:C};for(g=0;g<G;g++)K["x"+g]=t[g];T=R.getIndexesOfSourceData(E);if(w)for(t=
0;t<S;t++)N[t]=ca(t);L=null;ha();for(q=0;q<c;q++){x=W.getItem(q);O=W.getIndexesOfSourceData(q);for(t=0;t<S;t++){null!==L&&ja(q-1,x,L,t);aa=[];for(g=0;g<O.length;g++)y=O[g],0<=a.inArray(y,T)&&aa.push(y);if(0<aa.length){B=Array(aa.length);Q=v[t];V=new p(Q.aggregator,f,d);for(y=0;y<aa.length;y++)g=aa[y],m=n[g],B[y]=m,V.calc(m[Q.member],Q.member,m,g,n),w&&(I=N[t],I.calc(m[Q.member],Q.member,m,g,n),I=I.groupInfo,0>a.inArray(g,I.iYs)&&(I.iYs.push(q),I.ys.push(x)),0>a.inArray(g,I.iRows)&&(I.iRows.push(g),
I.rows.push(m))),da(x,L,Q,t,m,g,q);m="y"+q+(1===S?"":"a"+t);V.getResult(K,m);C[m]={colType:0,iY:q,y:x,iA:t,a:Q,iRows:aa,rows:B}}}L=x}if(null!==L)for(t=0;t<S;t++)ja(c-1,L,L,t);if(w)for(t=0;t<S;t++)m="t"+(1===S?"":"a"+t),I=N[t],I.getResult(K,m),I=I.groupInfo,C[m]={colType:2,iA:t,a:v[t],iRows:I.iRows,rows:I.rows,iYs:I.iYs,ys:I.ys};h.push(K)}if(l.footerTotals||l.colTotals){w=h.length;for(g=0;g<G;g++)b["x"+g]=D[g].footerText||"";for(g=G;g<H.length;g++){m=H[g].name;V=new p(l.footerAggregator||"sum",f,d);
for(y=0;y<w;y++)K=h[y],V.calc(K[m],m,K,y,h);V.getResult(b,m)}}d.colHeaders=F;return{colModel:H,options:d,rows:h,groupOptions:e,groupHeaders:F,summary:b}},jqPivot:function(p,d,f,h){return this.each(function(){function b(b){var g=l.pivotSetup.call(e,b,d),h=g.groupHeaders,p=g.summary,n=0,q;for(q in p)p.hasOwnProperty(q)&&n++;p=0<n?!0:!1;n=g.groupOptions.groupingView;q=u.from.call(c,g.rows);var r;if(d.skipSortByX)for(r=0;r<n.groupField.length;r++)q.orderBy(n.groupField[r],null!=f&&f.groupingView&&null!=
f.groupingView.groupOrder&&"desc"===f.groupingView.groupOrder[r]?"d":"a","text","");d.data=b;l.call(e,a.extend(!0,{datastr:a.extend(q.select(),p?{userdata:g.summary}:{}),datatype:"jsonstring",footerrow:p,userDataOnFooter:p,colModel:g.colModel,pivotOptions:g.options,additionalProperties:["pivotInfos"],viewrecords:!0,sortname:d.xDimension[0].dataName},g.groupOptions,f||{}));if(h.length)for(r=0;r<h.length;r++)h[r]&&h[r].groupHeaders.length&&l.setGroupHeaders.call(e,h[r]);d.frozenStaticCols&&l.setFrozenColumns.call(e)}
var c=this,e=a(c),l=a.fn.jqGrid;"string"===typeof p?a.ajax(a.extend({url:p,dataType:"json",success:function(a){b(u.getAccessor(a,h&&h.reader?h.reader:"rows"))}},h||{})):b(p)})}})})(jQuery);
(function(a){var p=a.jgrid,r=p.jqID,u=a.fn.jqGrid,n=function(){var d=a.makeArray(arguments);d[0]="subGrid"+d[0].charAt(0).toUpperCase()+d[0].substring(1);d.unshift("");d.unshift("");d.unshift(this.p);return p.feedback.apply(this,d)};p.extend({setSubGrid:function(){return this.each(function(){var d=this.p,f=d.subGridModel[0];d.subGridOptions=a.extend({expandOnLoad:!1,delayOnLoad:50,selectOnExpand:!1,selectOnCollapse:!1,reloadOnExpand:!0},d.subGridOptions||{});d.colNames.unshift("");d.colModel.unshift({name:"subgrid",
width:p.cell_width?d.subGridWidth+d.cellLayout:d.subGridWidth,labelClasses:"jqgh_subgrid",sortable:!1,resizable:!1,hidedlg:!0,search:!1,fixed:!0,frozen:!0});if(f)for(f.align=a.extend([],f.align||[]),d=0;d<f.name.length;d++)f.align[d]=f.align[d]||"left"})},addSubGridCell:function(a,f){var h=this[0],b=h.p.subGridOptions;return null==h||null==h.p||null==b?"":'<td role="gridcell" aria-describedby="'+h.p.id+"_subgrid\" class='"+u.getGuiStyles.call(this,"subgrid.tdStart","ui-sgcollapsed sgcollapsed")+"' "+
h.formatCol(a,f)+"><a style='cursor:pointer;'><span class='"+p.mergeCssClasses(b.commonIconClass,b.plusicon)+"'></span></a></td>"},addSubGrid:function(d,f){return this.each(function(){var h=this,b=h.p,c=function(a,b){return u.getGuiStyles.call(h,"subgrid."+a,b||"")},e=c("thSubgrid","ui-th-subgrid ui-th-column ui-th-"+b.direction),l=c("rowSubTable","ui-subtblcell"),m=c("row","ui-subgrid ui-row-"+b.direction),g=c("tdWithIcon","subgrid-cell"),t=c("tdData","subgrid-data"),w=function(c,e,d){e=a("<td align='"+
b.subGridModel[0].align[d]+"'></td>").html(e);a(c).append(e)},A=function(c,d){var g,f,m,q,t=a("<table"+(p.msie&&8>p.msiever()?" cellspacing='0'":"")+"><tbody></tbody></table>"),n=a("<tr></tr>");for(f=0;f<b.subGridModel[0].name.length;f++)g=a("<th class='"+e+"'></th>"),a(g).html(b.subGridModel[0].name[f]),a(g).width(b.subGridModel[0].width[f]),a(n).append(g);a(t).append(n);c&&(m=b.xmlReader.subgrid,a(m.root+" "+m.row,c).each(function(){n=a("<tr class='"+l+"'></tr>");if(!0===m.repeatitems)a(m.cell,
this).each(function(b){w(n,a(this).text()||" ",b)});else if(q=b.subGridModel[0].mapping||b.subGridModel[0].name)for(f=0;f<q.length;f++)w(n,a(q[f],this).text()||" ",f);a(t).append(n)}));a("#"+r(b.id+"_"+d)).append(t);h.grid.hDiv.loading=!1;a("#load_"+r(b.id)).hide();return!1},q=function(c,d){var g,f,m,q,t,n,u=a("<table"+(p.msie&&8>p.msiever()?" cellspacing='0'":"")+"><tbody></tbody></table>"),A=a("<tr></tr>");for(f=0;f<b.subGridModel[0].name.length;f++)g=a("<th class='"+e+"'></th>"),a(g).html(b.subGridModel[0].name[f]),
a(g).width(b.subGridModel[0].width[f]),a(A).append(g);a(u).append(A);if(c&&(q=b.jsonReader.subgrid,g=p.getAccessor(c,q.root),void 0!==g))for(f=0;f<g.length;f++){m=g[f];A=a("<tr class='"+l+"'></tr>");if(!0===q.repeatitems)for(q.cell&&(m=m[q.cell]),t=0;t<m.length;t++)w(A,m[t]||" ",t);else if(n=b.subGridModel[0].mapping||b.subGridModel[0].name,n.length)for(t=0;t<n.length;t++)w(A,m[n[t]]||" ",t);a(u).append(A)}a("#"+r(b.id+"_"+d)).append(u);h.grid.hDiv.loading=!1;a("#load_"+r(b.id)).hide();
return!1},y=function(c){var e=a(c).attr("id"),d={nd_:(new Date).getTime()},g,f;d[b.prmNames.subgridid]=e;if(!b.subGridModel[0])return!1;if(b.subGridModel[0].params)for(f=0;f<b.subGridModel[0].params.length;f++)g=b.iColByName[b.subGridModel[0].params[f]],void 0!==g&&(d[b.colModel[g].name]=a(c.cells[g]).text().replace(/\ \;/ig,""));if(!h.grid.hDiv.loading)switch(h.grid.hDiv.loading=!0,a("#load_"+r(b.id)).show(),b.subgridtype||(b.subgridtype=b.datatype),a.isFunction(b.subgridtype)?b.subgridtype.call(h,
d):b.subgridtype=b.subgridtype.toLowerCase(),b.subgridtype){case "xml":case "json":a.ajax(a.extend({type:b.mtype,url:a.isFunction(b.subGridUrl)?b.subGridUrl.call(h,d):b.subGridUrl,dataType:b.subgridtype,data:p.serializeFeedback.call(h,b.serializeSubGridData,"jqGridSerializeSubGridData",d),complete:function(a){"xml"===b.subgridtype?A(a.responseXML,e):q(p.parse(a.responseText),e)}},p.ajaxOptions,b.ajaxSubgridOptions||{}))}return!1},c=function(){var c=a(this).parent("tr")[0],e=c.nextSibling,f=c.id,l=
b.id+"_"+f,q=function(a){return[b.subGridOptions.commonIconClass,b.subGridOptions[a]].join(" ")},p=1;a.each(b.colModel,function(){!0!==this.hidden&&"rn"!==this.name&&"cb"!==this.name||p++});if(a(this).hasClass("sgcollapsed")){if(!0===b.subGridOptions.reloadOnExpand||!1===b.subGridOptions.reloadOnExpand&&!a(e).hasClass("ui-subgrid")){e=1<=d?"<td colspan='"+d+"'> </td>":"";if(!n.call(h,"beforeExpand",l,f))return;a(c).after("<tr role='row' class='"+m+"'>"+e+"<td class='"+g+"'><span class='"+q("openicon")+
"'></span></td><td colspan='"+parseInt(b.colNames.length-p,10)+"' class='"+t+"'><div id="+l+" class='tablediv'></div></td></tr>");a(h).triggerHandler("jqGridSubGridRowExpanded",[l,f]);a.isFunction(b.subGridRowExpanded)?b.subGridRowExpanded.call(h,l,f):y(c)}else a(e).show();a(this).html("<a style='cursor:pointer;'><span class='"+q("minusicon")+"'></span></a>").removeClass("sgcollapsed").addClass("sgexpanded");b.subGridOptions.selectOnExpand&&a(h).jqGrid("setSelection",f)}else if(a(this).hasClass("sgexpanded")){if(!n.call(h,
"beforeCollapse",l,f))return;!0===b.subGridOptions.reloadOnExpand?a(e).remove(".ui-subgrid"):a(e).hasClass("ui-subgrid")&&a(e).hide();a(this).html("<a style='cursor:pointer;'><span class='"+q("plusicon")+"'></span></a>").removeClass("sgexpanded").addClass("sgcollapsed");b.subGridOptions.selectOnCollapse&&a(h).jqGrid("setSelection",f)}return!1},E,C=1;if(h.grid){E=h.rows.length;void 0!==f&&0<f&&(C=f,E=f+1);for(;C<E;)a(h.rows[C]).hasClass("jqgrow")&&(b.scroll&&a(h.rows[C].cells[d]).unbind("click"),a(h.rows[C].cells[d]).bind("click",
c)),C++;!0===b.subGridOptions.expandOnLoad&&a(h.rows).filter(".jqgrow").each(function(b,c){a(c.cells[0]).click()});h.subGridXml=function(a,b){A(a,b)};h.subGridJson=function(a,b){q(a,b)}}})},expandSubGridRow:function(d){return this.each(function(){var f;(this.grid||d)&&!0===this.p.subGrid&&(f=a(this).jqGrid("getInd",d,!0),a(f).find(">td.sgcollapsed").trigger("click"))})},collapseSubGridRow:function(d){return this.each(function(){var f;(this.grid||d)&&!0===this.p.subGrid&&(f=a(this).jqGrid("getInd",
d,!0),a(f).find(">td.sgexpanded").trigger("click"))})},toggleSubGridRow:function(d){return this.each(function(){var f;(this.grid||d)&&!0===this.p.subGrid&&(f=a(this).jqGrid("getInd",d,!0),a(f).find(">td.ui-sgcollapsed").trigger("click"))})}})})(jQuery);
(function(a){window.tableToGrid=function(p,r){a(p).each(function(){var p=a(this),n,d,f,h,b=[],c=[],e=[],l=[],m=[];if(!this.grid){p.width("99%");n=p.width();d=a("tr td:first-child input[type=checkbox]:first",p);f=a("tr td:first-child input[type=radio]:first",p);d=0<d.length;f=!d&&0<f.length;h=d||f;a("th",p).each(function(){0===b.length&&h?(b.push({name:"__selection__",index:"__selection__",width:0,hidden:!0}),c.push("__selection__")):(b.push({name:a(this).attr("id")||a.trim(a.jgrid.stripHtml(a(this).html())).split(" ").join("_"),
index:a(this).attr("id")||a.trim(a.jgrid.stripHtml(a(this).html())).split(" ").join("_"),width:a(this).width()||150}),c.push(a(this).html()))});a("tbody > tr",p).each(function(){var c={},d=0;a("td",a(this)).each(function(){if(0===d&&h){var f=a("input",a(this)),p=f.attr("value");l.push(p||e.length);f.is(":checked")&&m.push(p);c[b[d].name]=f.attr("value")}else c[b[d].name]=a(this).html();d++});0<d&&e.push(c)});p.empty();p.jqGrid(a.extend({datatype:"local",width:n,colNames:c,colModel:b,multiselect:d},
r||{}));for(n=0;n<e.length;n++)f=null,0<l.length&&(f=l[n])&&f.replace&&(f=encodeURIComponent(f).replace(/[.\-%]/g,"_")),null===f&&(f=a.jgrid.randId()),p.jqGrid("addRowData",f,e[n]);for(n=0;n<m.length;n++)p.jqGrid("setSelection",m[n])}})}})(jQuery);
(function(a){var p=a.jgrid,r=p.getAccessor,u=p.stripPref,n=p.jqID,d=a.fn.jqGrid,f=function(){var d=a.makeArray(arguments);d[0]="treeGrid"+d[0].charAt(0).toUpperCase()+d[0].substring(1);d.unshift("");d.unshift("");d.unshift(this.p);return p.feedback.apply(this,d)};p.extend({setTreeNode:function(){return this.each(function(){var f=a(this),b=this.p;if(this.grid&&b.treeGrid){var c=b.treeReader.expanded_field,e=b.treeReader.leaf_field,l=function(l,g,p){if(null!=p){l=a(p.target);p=l.closest("tr.jqgrow>td");
var n=p.parent(),r=function(a){a=b.data[b._index[u(b.idPrefix,a)]];var g=a[c]?"collapse":"expand";a[e]||(d[g+"Row"].call(f,a,n),d[g+"Node"].call(f,a,n))};l.is("div.treeclick")?r(g):b.ExpandColClick&&0<p.length&&0<l.closest("span.ui-jqgrid-cell-wrapper",p).length&&r(g);return!0}};f.unbind("jqGridBeforeSelectRow.setTreeNode",l);f.bind("jqGridBeforeSelectRow.setTreeNode",l)}})},setTreeGrid:function(){return this.each(function(){var d=this.p,b,c,e,f=[],m=["leaf_field","expanded_field","loaded"];if(d.treeGrid){d.treedatatype||
a.extend(this.p,{treedatatype:d.datatype});d.subGrid=!1;d.altRows=!1;d.pgbuttons=!1;d.pginput=!1;d.gridview=!0;null===d.rowTotal&&(d.rowNum=d.maxRowNum);d.rowList=[];d.treeIcons.plus="rtl"===d.direction?d.treeIcons.plusRtl:d.treeIcons.plusLtr;"nested"===d.treeGridModel?d.treeReader=a.extend({level_field:"level",left_field:"lft",right_field:"rgt",leaf_field:"isLeaf",expanded_field:"expanded",loaded:"loaded",icon_field:"icon"},d.treeReader):"adjacency"===d.treeGridModel&&(d.treeReader=a.extend({level_field:"level",
parent_id_field:"parent",leaf_field:"isLeaf",expanded_field:"expanded",loaded:"loaded",icon_field:"icon"},d.treeReader));for(c in d.colModel)if(d.colModel.hasOwnProperty(c))for(e in b=d.colModel[c].name,d.treeReader)d.treeReader.hasOwnProperty(e)&&d.treeReader[e]===b&&f.push(b);a.each(d.treeReader,function(b){var c=String(this);c&&-1===a.inArray(c,f)&&(0<=a.inArray(b,m)?d.additionalProperties.push({name:c,convert:function(a){return!0===a||"true"===String(a).toLowerCase()||"1"===String(a)?!0:a}}):
d.additionalProperties.push(c))})}})},expandRow:function(h){this.each(function(){var b=a(this),c=this.p;if(this.grid&&c.treeGrid){var e=c.treeReader.expanded_field,l=h[c.localReader.id];if(f.call(this,"beforeExpandRow",{rowid:l,item:h})){var m=d.getNodeChildren.call(b,h);a(m).each(function(){var g=c.idPrefix+r(this,c.localReader.id);a(d.getGridRowById.call(b,g)).css("display","");this[e]&&d.expandRow.call(b,this)});f.call(this,"afterExpandRow",{rowid:l,item:h})}}})},collapseRow:function(h){this.each(function(){var b=
a(this),c=this.p;if(this.grid&&c.treeGrid){var e=c.treeReader.expanded_field,l=h[c.localReader.id];if(f.call(this,"beforeCollapseRow",{rowid:l,item:h})){var m=d.getNodeChildren.call(b,h);a(m).each(function(){var g=c.idPrefix+r(this,c.localReader.id);a(d.getGridRowById.call(b,g)).css("display","none");this[e]&&d.collapseRow.call(b,this)});f.call(this,"afterCollapseRow",{rowid:l,item:h})}}})},getRootNodes:function(){var d=[];this.each(function(){var b=this.p;if(this.grid&&b.treeGrid)switch(b.treeGridModel){case "nested":var c=
b.treeReader.level_field;a(b.data).each(function(){parseInt(this[c],10)===parseInt(b.tree_root_level,10)&&d.push(this)});break;case "adjacency":var e=b.treeReader.parent_id_field;a(b.data).each(function(){null!==this[e]&&"null"!==String(this[e]).toLowerCase()||d.push(this)})}});return d},getNodeDepth:function(f){var b=null;this.each(function(){var c=this.p;if(this.grid&&c.treeGrid)switch(c.treeGridModel){case "nested":b=parseInt(f[c.treeReader.level_field],10)-parseInt(c.tree_root_level,10);break;
case "adjacency":b=d.getNodeAncestors.call(a(this),f).length}});return b},getNodeParent:function(d){var b=this[0];if(!b||!b.grid||null==b.p||!b.p.treeGrid||null==d)return null;var b=b.p,c=b.treeReader,e=d[c.parent_id_field];if("nested"===b.treeGridModel){var f=null,m=c.left_field,g=c.right_field,p=c.level_field,n=parseInt(d[m],10),r=parseInt(d[g],10),q=parseInt(d[p],10);a(b.data).each(function(){if(parseInt(this[p],10)===q-1&&parseInt(this[m],10)<n&&parseInt(this[g],10)>r)return f=this,!1});return f}if(null===
e||"null"===e)return null;d=b._index[e];return void 0!=d?b.data[d]:null},getNodeChildren:function(d){var b=[];this.each(function(){var c=this.p;if(this.grid&&c.treeGrid)switch(c.treeGridModel){case "nested":var e=c.treeReader.left_field,f=c.treeReader.right_field,m=c.treeReader.level_field,g=parseInt(d[e],10),p=parseInt(d[f],10),n=parseInt(d[m],10);a(c.data).each(function(){parseInt(this[m],10)===n+1&&parseInt(this[e],10)>g&&parseInt(this[f],10)<p&&b.push(this)});break;case "adjacency":var r=c.treeReader.parent_id_field,
q=c.localReader.id;a(c.data).each(function(){String(this[r])===String(d[q])&&b.push(this)})}});return b},getFullTreeNode:function(d){var b=[];this.each(function(){var c=this.p,e;if(this.grid&&c.treeGrid)switch(c.treeGridModel){case "nested":var f=c.treeReader.left_field,m=c.treeReader.right_field,g=c.treeReader.level_field,p=parseInt(d[f],10),n=parseInt(d[m],10),r=parseInt(d[g],10);a(c.data).each(function(){parseInt(this[g],10)>=r&&parseInt(this[f],10)>=p&&parseInt(this[f],10)<=n&&b.push(this)});
break;case "adjacency":if(d){b.push(d);var q=c.treeReader.parent_id_field,u=c.localReader.id;a(c.data).each(function(){var a;e=b.length;for(a=0;a<e;a++)if(b[a][u]===this[q]){b.push(this);break}})}}});return b},getNodeAncestors:function(f){var b=[];this.each(function(){var c=a(this),e=d.getNodeParent;if(this.grid&&this.p.treeGrid)for(var l=e.call(c,f);l;)b.push(l),l=e.call(c,l)});return b},isVisibleNode:function(f){var b=!0;this.each(function(){var c=this.p;if(this.grid&&c.treeGrid){var e=d.getNodeAncestors.call(a(this),
f),l=c.treeReader.expanded_field;a(e).each(function(){b=b&&this[l];if(!b)return!1})}});return b},isNodeLoaded:function(f){var b;this.each(function(){var c=this.p;if(this.grid&&c.treeGrid){var e=c.treeReader.leaf_field,c=c.treeReader.loaded;b=void 0!==f?void 0!==f[c]?f[c]:f[e]||0<d.getNodeChildren.call(a(this),f).length?!0:!1:!1}});return b},expandNode:function(h){return this.each(function(){var b=this.p;if(this.grid&&b.treeGrid){var c=b.treeReader.expanded_field,e=b.treeReader.parent_id_field,l=b.treeReader.loaded,
m=b.treeReader.level_field,g=b.treeReader.left_field,p=b.treeReader.right_field;if(!h[c]){var w=r(h,b.localReader.id);if(f.call(this,"beforeExpandNode",{rowid:w,item:h})){var u=a("#"+b.idPrefix+n(w),this.grid.bDiv)[0],q=b._index[w];"local"===b.treedatatype||d.isNodeLoaded.call(a(this),b.data[q])?(h[c]=!0,a("div.treeclick",u).removeClass(b.treeIcons.plus+" tree-plus").addClass(b.treeIcons.commonIconClass).addClass(b.treeIcons.minus+" tree-minus")):this.grid.hDiv.loading||(h[c]=!0,a("div.treeclick",
u).removeClass(b.treeIcons.plus+" tree-plus").addClass(b.treeIcons.commonIconClass).addClass(b.treeIcons.minus+" tree-minus"),b.treeANode=u.rowIndex,b.datatype=b.treedatatype,d.setGridParam.call(a(this),{postData:"nested"===b.treeGridModel?{nodeid:w,n_level:h[m],n_left:h[g],n_right:h[p]}:{nodeid:w,n_level:h[m],parentid:h[e]}}),a(this).trigger("reloadGrid"),h[l]=!0,d.setGridParam.call(a(this),{postData:"nested"===b.treeGridModel?{nodeid:"",n_level:"",n_left:"",n_right:""}:{nodeid:"",n_level:"",parentid:""}}));
f.call(this,"afterExpandNode",{rowid:w,item:h})}}}})},collapseNode:function(d){return this.each(function(){var b=this.p;if(this.grid&&b.treeGrid){var c=b.treeReader.expanded_field;if(d[c]){var e=r(d,b.localReader.id);f.call(this,"beforeCollapseNode",{rowid:e,item:d})&&(d[c]=!1,c=a("#"+b.idPrefix+n(e),this.grid.bDiv)[0],a("div.treeclick",c).removeClass(b.treeIcons.minus+" tree-minus").addClass(b.treeIcons.commonIconClass).addClass(b.treeIcons.plus+" tree-plus"),f.call(this,"afterCollapseNode",{rowid:e,
item:d}))}}})},SortTree:function(f,b,c,e){return this.each(function(){var l=this,m=l.p,g=a(l);if(l.grid&&m.treeGrid){var t,u,A,q=[];t=d.getRootNodes.call(g);t=p.from.call(l,t);t.orderBy(f,b,c,e);var y=t.select();t=0;for(u=y.length;t<u;t++)A=y[t],q.push(A),d.collectChildrenSortTree.call(g,q,A,f,b,c,e);a.each(q,function(b){var c=r(this,m.localReader.id);a(l.rows[b]).after(g.find(">tbody>tr#"+n(c)))})}})},collectChildrenSortTree:function(f,b,c,e,l,m){return this.each(function(){var g=a(this);if(this.grid&&
this.p.treeGrid){var n,r,u;n=d.getNodeChildren.call(g,b);n=p.from.call(this,n);n.orderBy(c,e,l,m);var q=n.select();n=0;for(r=q.length;n<r;n++)u=q[n],f.push(u),d.collectChildrenSortTree.call(g,f,u,c,e,l,m)}})},setTreeRow:function(f,b){var c=!1;this.each(function(){this.grid&&this.p.treeGrid&&(c=d.setRowData.call(a(this),f,b))});return c},delTreeNode:function(f){return this.each(function(){var b=this.p,c,e,l,m;l=b.localReader.id;var g,n=a(this),r=b.treeReader.left_field,u=b.treeReader.right_field;if(this.grid&&
b.treeGrid&&(g=b._index[f],void 0!==g)){c=parseInt(b.data[g][u],10);e=c-parseInt(b.data[g][r],10)+1;var q=d.getFullTreeNode.call(n,b.data[g]);if(0<q.length)for(g=0;g<q.length;g++)d.delRowData.call(n,q[g][l]);if("nested"===b.treeGridModel){l=p.from.call(this,b.data).greater(r,c,{stype:"integer"}).select();if(l.length)for(m in l)l.hasOwnProperty(m)&&(l[m][r]=parseInt(l[m][r],10)-e);l=p.from.call(this,b.data).greater(u,c,{stype:"integer"}).select();if(l.length)for(m in l)l.hasOwnProperty(m)&&(l[m][u]=
parseInt(l[m][u],10)-e)}}})},addChildNode:function(f,b,c,e){var l=a(this),m=l[0],g=m.p,n=d.getInd;if(c){var r,u,q,y,E;r=0;var C=b,B,D,z=g.treeReader.expanded_field;D=g.treeReader.leaf_field;var v=g.treeReader.level_field,V=g.treeReader.parent_id_field,I=g.treeReader.left_field,G=g.treeReader.right_field,S=g.treeReader.loaded;void 0===e&&(e=!1);if(null==f){E=g.data.length-1;if(0<=E)for(;0<=E;)r=Math.max(r,parseInt(g.data[E][g.localReader.id],10)),E--;f=r+1}var U=n.call(l,b);B=!1;void 0===b||null===
b||""===b?(C=b=null,r="last",y=g.tree_root_level,E=g.data.length+1):(r="after",u=g._index[b],q=g.data[u],b=q[g.localReader.id],y=parseInt(q[v],10)+1,E=d.getFullTreeNode.call(l,q),E.length?(C=E=E[E.length-1][g.localReader.id],E=n.call(l,C)+1):E=n.call(l,b)+1,q[D]&&(B=!0,q[z]=!0,a(m.rows[U]).find("span.cell-wrapperleaf").removeClass("cell-wrapperleaf").addClass("cell-wrapper").end().find("div.tree-leaf").removeClass(g.treeIcons.leaf+" tree-leaf").addClass(g.treeIcons.commonIconClass).addClass(g.treeIcons.minus+
" tree-minus"),g.data[u][D]=!1,q[S]=!0));n=E+1;void 0===c[z]&&(c[z]=!1);void 0===c[S]&&(c[S]=!1);c[v]=y;void 0===c[D]&&(c[D]=!0);"adjacency"===g.treeGridModel&&(c[V]=b);if("nested"===g.treeGridModel){var F;if(null!==b){D=parseInt(q[G],10);g=p.from.call(m,g.data);g=g.greaterOrEquals(G,D,{stype:"integer"});v=g.select();if(v.length)for(F in v)v.hasOwnProperty(F)&&(v[F][I]=v[F][I]>D?parseInt(v[F][I],10)+2:v[F][I],v[F][G]=v[F][G]>=D?parseInt(v[F][G],10)+2:v[F][G]);c[I]=D;c[G]=D+1}else{D=parseInt(d.getCol.call(l,
G,!1,"max"),10);v=p.from.call(m,g.data).greater(I,D,{stype:"integer"}).select();if(v.length)for(F in v)v.hasOwnProperty(F)&&(v[F][I]=parseInt(v[F][I],10)+2);v=p.from.call(m,g.data).greater(G,D,{stype:"integer"}).select();if(v.length)for(F in v)v.hasOwnProperty(F)&&(v[F][G]=parseInt(v[F][G],10)+2);c[I]=D+1;c[G]=D+2}}if(null===b||d.isNodeLoaded.call(l,q)||B)d.addRowData.call(l,f,c,r,C),d.setTreeNode.call(l,E,n);q&&!q[z]&&e&&a(m.rows[U]).find("div.treeclick").click()}}})})(jQuery);
(function(a){var p="mousedown",r="mousemove",u="mouseup",n=function(a){var b=a.originalEvent.targetTouches;return b?(b=b[0],{x:b.pageX,y:b.pageY}):{x:a.pageX,y:a.pageY}},d={drag:function(a){var b=a.data,c=b.e,e=b.dnr,d=b.ar,b=b.dnrAr;a=n(a);"move"===e.k?c.css({left:e.X+a.x-e.pX,top:e.Y+a.y-e.pY}):(c.css({width:Math.max(a.x-e.pX+e.W,0),height:Math.max(a.y-e.pY+e.H,0)}),b&&d.css({width:Math.max(a.x-b.pX+b.W,0),height:Math.max(a.y-b.pY+b.H,0)}));return!1},stop:function(){a(document).unbind(r,d.drag).unbind(u,
d.stop)}},f=function(f,b,c,e){return f.each(function(){b=b?a(b,f):f;b.bind(p,{e:f,k:c},function(b){var c=b.data,g={},f,h,p=function(a,b){return parseInt(a.css(b),10)||!1},q=n(b);if(a(b.target).hasClass("ui-jqdialog-titlebar-close")||a(b.target).parent().hasClass("ui-jqdialog-titlebar-close"))a(b.target).click();else{b=c.e;h=e?a(e):!1;if("relative"!==b.css("position"))try{b.position(g)}catch(y){}f={X:g.left||p(b,"left")||0,Y:g.top||p(b,"top")||0,W:p(b,"width")||b[0].scrollWidth||0,H:p(b,"height")||
b[0].scrollHeight||0,pX:q.x,pY:q.y,k:c.k};g=h&&"move"!==c.k?{X:g.left||p(h,"left")||0,Y:g.top||p(h,"top")||0,W:h[0].offsetWidth||p(h,"width")||0,H:h[0].offsetHeight||p(h,"height")||0,pX:q.x,pY:q.y,k:c.k}:!1;c=b.find("input.hasDatepicker");if(0<c.length)try{c.datepicker("hide")}catch(E){}b={e:b,dnr:f,ar:h,dnrAr:g};a(document).bind(r,b,d.drag);a(document).bind(u,b,d.stop);return!1}})})};window.PointerEvent?(p+=".jqGrid pointerdown.jqGrid",r+=".jqGrid pointermove.jqGrid",u+=".jqGrid pointerup.jqGrid"):
window.MSPointerEvent?(p+=".jqGrid mspointerdown.jqGrid",r+=".jqGrid mspointermove.jqGrid",u+=".jqGrid mspointerup"):(p+=".jqGrid touchstart.jqGrid",r+=".jqGrid touchmove.jqGrid",u+=".jqGrid touchend.jqGrid");a.jqDnR=d;a.fn.jqDrag=function(a){return f(this,a,"move")};a.fn.jqResize=function(a,b){return f(this,a,"resize",b)}})(jQuery);
(function(a){var p=0,r,u=[],n=function(b){try{a(":input:visible",b.w).first().focus()}catch(c){}},d=function(b){var c=r[u[u.length-1]],e=!a(b.target).parents(".jqmID"+c.s)[0],d=a(b.target).offset(),f=void 0!==b.pageX?b.pageX:d.left,g=void 0!==b.pageY?b.pageY:d.top,d=function(){var b=!1;a(".jqmID"+c.s).each(function(){var c=a(this),e=c.offset();if(e.top<=g&&g<=e.top+c.height()&&e.left<=f&&f<=e.left+c.width())return b=!0,!1});return b};if("mousedown"!==b.type&&d())return!0;"mousedown"===b.type&&e&&
(d()&&(e=!1),e&&!a(b.target).is(":input")&&n(c));return!e},f=function(b){a(document)[b]("keypress keydown mousedown",d)},h=function(b,c,e){return b.each(function(){var b=this._jqm;a(c).each(function(){this[e]||(this[e]=[],a(this).click(function(){var a,b,c,e=["jqmShow","jqmHide"];for(a=0;a<e.length;a++)for(c in b=e[a],this[b])if(this[b].hasOwnProperty(c)&&r[this[b][c]])r[this[b][c]].w[b](this);return!1}));this[e].push(b)})})};a.fn.jqm=function(b){var c={overlay:50,closeoverlay:!1,overlayClass:"jqmOverlay",
closeClass:"jqmClose",trigger:".jqModal",ajax:!1,ajaxText:"",target:!1,modal:!1,toTop:!1,onShow:!1,onHide:!1,onLoad:!1};return this.each(function(){if(this._jqm)return r[this._jqm].c=a.extend({},r[this._jqm].c,b),r[this._jqm].c;p++;this._jqm=p;r[p]={c:a.extend(c,a.jqm.params,b),a:!1,w:a(this).addClass("jqmID"+p),s:p};c.trigger&&a(this).jqmAddTrigger(c.trigger)})};a.fn.jqmAddClose=function(a){return h(this,a,"jqmHide")};a.fn.jqmAddTrigger=function(a){return h(this,a,"jqmShow")};a.fn.jqmShow=function(b){return this.each(function(){a.jqm.open(this._jqm,
b)})};a.fn.jqmHide=function(b){return this.each(function(){a.jqm.close(this._jqm,b)})};a.jqm={hash:{},open:function(b,c){var e=r[b],d,h,g=e.c;d=e.w.parent().offset();var p,w="."+g.closeClass;h=parseInt(e.w.css("z-index"),10);h=0<h?h:3E3;d=a("<div></div>").css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":h-1,opacity:g.overlay/100});if(e.a)return!1;e.t=c;e.a=!0;e.w.css("z-index",h);g.modal?(u[0]||setTimeout(function(){f("bind")},1),u.push(b)):0<g.overlay?g.closeoverlay&&e.w.jqmAddClose(d):
d=!1;e.o=d?d.addClass(g.overlayClass).prependTo("body"):!1;g.ajax?(d=g.target||e.w,h=g.ajax,d="string"===typeof d?a(d,e.w):a(d),h="@"===h.substr(0,1)?a(c).attr(h.substring(1)):h,d.html(g.ajaxText).load(h,function(){g.onLoad&&g.onLoad.call(this,e);w&&e.w.jqmAddClose(a(w,e.w));n(e)})):w&&e.w.jqmAddClose(a(w,e.w));g.toTop&&e.o&&(d=e.w.parent().offset(),h=parseFloat(e.w.css("left")||0),p=parseFloat(e.w.css("top")||0),e.w.before('<span id="jqmP'+e.w[0]._jqm+'"></span>').insertAfter(e.o),e.w.css({top:d.top+
p,left:d.left+h}));if(g.onShow)g.onShow(e);else e.w.show();n(e);return!1},close:function(b){b=r[b];if(!b.a)return!1;b.a=!1;u[0]&&(u.pop(),u[0]||f("unbind"));b.c.toTop&&b.o&&a("#jqmP"+b.w[0]._jqm).after(b.w).remove();if(b.c.onHide)b.c.onHide(b);else b.w.hide(),b.o&&b.o.remove();return!1},params:{}};r=a.jqm.hash})(jQuery);
(function(a){a.fmatter=a.fmatter||{};a.jgrid=a.jgrid||{};var p=a.fmatter,r=a.jgrid,u=r.getMethod("getGridRes");a.extend(!0,r,{formatter:{date:{parseRe:/[#%\\\/:_;.,\t\s\-]/,masks:{ISO8601Long:"Y-m-d H:i:s",ISO8601Short:"Y-m-d",SortableDateTime:"Y-m-d\\TH:i:s",UniversalSortableDateTime:"Y-m-d H:i:sO"},reformatAfterEdit:!0,userLocalTime:!1},baseLinkUrl:"",showAction:"",target:"",checkbox:{disabled:!0},idName:"id"},cmTemplate:{integerStr:{formatter:"integer",align:"right",sorttype:"integer",searchoptions:{sopt:"eq ne lt le gt ge".split(" ")}},
integer:{formatter:"integer",align:"right",sorttype:"integer",convertOnSave:function(a){a=a.newValue;return isNaN(a)?a:parseInt(a,10)},searchoptions:{sopt:"eq ne lt le gt ge".split(" ")}},numberStr:{formatter:"number",align:"right",sorttype:"number",searchoptions:{sopt:"eq ne lt le gt ge".split(" ")}},number:{formatter:"number",align:"right",sorttype:"number",convertOnSave:function(a){a=a.newValue;return isNaN(a)?a:parseFloat(a)},searchoptions:{sopt:"eq ne lt le gt ge".split(" ")}},booleanCheckbox:{align:"center",
formatter:"checkbox",edittype:"checkbox",editoptions:{value:"true:false",defaultValue:"false"},convertOnSave:function(b){var e=b.newValue,d=b.cm;b=String(e).toLowerCase();d=null!=d.editoptions&&"string"===typeof d.editoptions.value?d.editoptions.value.split(":"):["yes","no"];0<=a.inArray(b,["1","true",d[0].toLowerCase()])?e=!0:0<=a.inArray(b,["0","false",d[1].toLowerCase()])&&(e=!1);return e},stype:"select",searchoptions:{sopt:["eq","ne"],value:":Any;true:Yes;false:No"}},booleanCheckboxFa:{align:"center",
formatter:"checkboxFontAwesome4",edittype:"checkbox",editoptions:{value:"true:false",defaultValue:"false"},convertOnSave:function(b){var e=b.newValue,d=b.cm;b=String(e).toLowerCase();d=null!=d.editoptions&&"string"===typeof d.editoptions.value?d.editoptions.value.split(":"):["yes","no"];0<=a.inArray(b,["1","true",d[0].toLowerCase()])?e=!0:0<=a.inArray(b,["0","false",d[1].toLowerCase()])&&(e=!1);return e},stype:"select",searchoptions:{sopt:["eq","ne"],value:":Any;true:Yes;false:No"}},actions:function(){return{formatter:"actions",
width:(null!=this.p&&this.p.fontAwesomeIcons?33:36)+(r.cellWidth()?5:0),align:"center",label:"",autoResizable:!1,frozen:!0,fixed:!0,hidedlg:!0,resizable:!1,sortable:!1,search:!1,editable:!1,viewable:!1}}}});a.extend(p,{isObject:function(b){return b&&("object"===typeof b||a.isFunction(b))||!1},isNumber:function(a){return"number"===typeof a&&isFinite(a)},isValue:function(a){return this.isObject(a)||"string"===typeof a||this.isNumber(a)||"boolean"===typeof a},isEmpty:function(b){if("string"!==typeof b&&
this.isValue(b))return!1;if(!this.isValue(b))return!0;b=a.trim(b).replace(/\ \;/ig,"").replace(/\ \;/ig,"");return""===b},NumberFormat:function(a,b){var d=p.isNumber;d(a)||(a*=1);if(d(a)){var f=0>a,g=String(a),h=b.decimalSeparator||".";if(d(b.decimalPlaces)){var n=b.decimalPlaces,g=Math.pow(10,n),g=String(Math.round(a*g)/g),d=g.lastIndexOf(".");if(0<n)for(0>d?(g+=h,d=g.length-1):"."!==h&&(g=g.replace(".",h));g.length-1-d<n;)g+="0"}if(b.thousandsSeparator){var n=b.thousandsSeparator,d=g.lastIndexOf(h),
d=-1<d?d:g.length,h=void 0===b.decimalSeparator?"":g.substring(d),r=-1,q;for(q=d;0<q;q--)r++,0===r%3&&q!==d&&(!f||1<q)&&(h=n+h),h=g.charAt(q-1)+h;g=h}return g}return a}});var n=function(b,e,d,f,g){var h=e;d=a.extend({},u.call(a(this),"formatter"),d);try{h=a.fn.fmatter[b].call(this,e,d,f,g)}catch(p){}return h};a.fn.fmatter=n;n.getCellBuilder=function(b,e,d){b=null!=a.fn.fmatter[b]?a.fn.fmatter[b].getCellBuilder:null;return a.isFunction(b)?b.call(this,a.extend({},u.call(a(this),"formatter"),e),d):null};
n.defaultFormat=function(a,b){return p.isValue(a)&&""!==a?a:b.defaultValue||" "};var d=n.defaultFormat;n.email=function(a,b){return p.isEmpty(a)?d(a,b):'<a href="mailto:'+a+'">'+a+"</a>"};n.checkbox=function(b,e){var f=e.colModel,h=a.extend({},e.checkbox);null!=f&&(h=a.extend({},h,f.formatoptions||{}));f=!0===h.disabled?'disabled="disabled"':"";if(p.isEmpty(b)||void 0===b)b=d(b,h);b=String(b);b=String(b).toLowerCase();return'<input type="checkbox" '+(0>b.search(/(false|f|0|no|n|off|undefined)/i)?
" checked='checked' ":"")+' value="'+b+'" data-offval="no" '+f+"/>"};n.checkbox.getCellBuilder=function(b){var e=b.colModel,f=a.extend({},b.checkbox),h;null!=e&&(f=a.extend({},f,e.formatoptions||{}));h='" data-offval="no" '+(!0===f.disabled?'disabled="disabled"':"")+"/>";return function(a){if(p.isEmpty(a)||void 0===a)a=d(a,f);a=String(a).toLowerCase();return'<input type="checkbox" '+(0>a.search(/(false|f|0|no|n|off|undefined)/i)?" checked='checked' ":"")+' value="'+a+h}};n.checkboxFontAwesome4=function(a,
b){var d=b.colModel,f=!1!==d.title?' title="'+(b.colName||d.label||d.name)+'"':"",g=String(a).toLowerCase(),d=d.editoptions||{},d="string"===typeof d.value?d.value.split(":")[0]:"yes";return 1===a||"1"===g||"x"===g||!0===a||"true"===g||"yes"===g||g===d?'<i class="fa fa-check-square-o fa-lg"'+f+"></i>":'<i class="fa fa-square-o fa-lg"'+f+"></i>"};n.checkboxFontAwesome4.getCellBuilder=function(a){var b=a.colModel;a=!1!==b.title?' title="'+(a.colName||b.label||b.name)+'"':"";var b=b.editoptions||{},
d="string"===typeof b.value?b.value.split(":")[0]:"yes",f='<i class="fa fa-check-square-o fa-lg"'+a+"></i>",g='<i class="fa fa-square-o fa-lg"'+a+"></i>";return function(a){var b=String(a).toLowerCase();return!0===a||1===a||"1"===b||"x"===b||"true"===b||"yes"===b||b===d?f:g}};n.checkboxFontAwesome4.unformat=function(b,d,f){b=d.colModel.editoptions||{};b="string"===typeof b.value?b.value.split(":"):["Yes","No"];return a(">i",f).hasClass("fa-check-square-o")?b[0]:b[1]};n.link=function(b,e){var f=e.colModel,
h="",g={target:e.target};null!=f&&(g=a.extend({},g,f.formatoptions||{}));g.target&&(h="target="+g.target);return p.isEmpty(b)?d(b,g):"<a "+h+' href="'+b+'">'+b+"</a>"};n.showlink=function(b,e,f){var h=this,g=e.colModel,n={baseLinkUrl:e.baseLinkUrl,showAction:e.showAction,addParam:e.addParam||"",target:e.target,idName:e.idName,hrefDefaultValue:"#"},r="",u,q,y=function(d){return a.isFunction(d)?d.call(h,{cellValue:b,rowid:e.rowId,rowData:f,options:n}):d||""};null!=g&&(n=a.extend({},n,g.formatoptions||
{}));n.target&&(r="target="+y(n.target));g=y(n.baseLinkUrl)+y(n.showAction);u=n.idName?encodeURIComponent(y(n.idName))+"="+encodeURIComponent(y(n.rowId)||e.rowId):"";q=y(n.addParam);"object"===typeof q&&null!==q&&(q=(""!==u?"&":"")+a.param(q));g+=u||q?"?"+u+q:"";""===g&&(g=y(n.hrefDefaultValue));return"string"===typeof b||p.isNumber(b)||a.isFunction(n.cellValue)?"<a "+r+' href="'+g+'">'+(a.isFunction(n.cellValue)?y(n.cellValue):b)+"</a>":d(b,n)};n.showlink.getCellBuilder=function(b){var e={baseLinkUrl:b.baseLinkUrl,
showAction:b.showAction,addParam:b.addParam||"",target:b.target,idName:b.idName,hrefDefaultValue:"#"};b=b.colModel;null!=b&&(e=a.extend({},e,b.formatoptions||{}));return function(b,c,f){var h=this,n=c.rowId,r="",q,u,E=function(c){return a.isFunction(c)?c.call(h,{cellValue:b,rowid:n,rowData:f,options:e}):c||""};e.target&&(r="target="+E(e.target));q=E(e.baseLinkUrl)+E(e.showAction);c=e.idName?encodeURIComponent(E(e.idName))+"="+encodeURIComponent(E(n)||c.rowId):"";u=E(e.addParam);"object"===typeof u&&
null!==u&&(u=(""!==c?"&":"")+a.param(u));q+=c||u?"?"+c+u:"";""===q&&(q=E(e.hrefDefaultValue));return"string"===typeof b||p.isNumber(b)||a.isFunction(e.cellValue)?"<a "+r+' href="'+q+'">'+(a.isFunction(e.cellValue)?E(e.cellValue):b)+"</a>":d(b,e)}};n.showlink.pageFinalization=function(b){var d=a(this),f=this.p,h=f.colModel[b],g,p=this.rows,n=p.length,r,q=function(f){var g=a(this).closest(".jqgrow");if(0<g.length)return h.formatoptions.onClick.call(d[0],{iCol:b,iRow:g[0].rowIndex,rowid:g.attr("id"),
cm:h,cmName:h.name,cellValue:a(this).text(),a:this,event:f})};if(null!=h.formatoptions&&a.isFunction(h.formatoptions.onClick))for(g=0;g<n;g++)r=p[g],a(r).hasClass("jqgrow")&&(r=r.cells[b],h.autoResizable&&null!=r&&a(r.firstChild).hasClass(f.autoResizing.wrapperClassName)&&(r=r.firstChild),a(r.firstChild).bind("click",q))};var f=function(a,b){a=b.prefix?b.prefix+a:a;return b.suffix?a+b.suffix:a},h=function(b,d,h){var m=d.colModel;d=a.extend({},d[h]);null!=m&&(d=a.extend({},d,m.formatoptions||{}));
return p.isEmpty(b)?f(d.defaultValue,d):f(p.NumberFormat(b,d),d)};n.integer=function(a,b){return h(a,b,"integer")};n.number=function(a,b){return h(a,b,"number")};n.currency=function(a,b){return h(a,b,"currency")};var b=function(b,d){var h=b.colModel,m=a.extend({},b[d]);null!=h&&(m=a.extend({},m,h.formatoptions||{}));var g=p.NumberFormat,n=m.defaultValue?f(m.defaultValue,m):"";return function(a){return p.isEmpty(a)?n:f(g(a,m),m)}};n.integer.getCellBuilder=function(a){return b(a,"integer")};n.number.getCellBuilder=
function(a){return b(a,"number")};n.currency.getCellBuilder=function(a){return b(a,"currency")};n.date=function(b,e,f,h){f=e.colModel;e=a.extend({},e.date);null!=f&&(e=a.extend({},e,f.formatoptions||{}));return e.reformatAfterEdit||"edit"!==h?p.isEmpty(b)?d(b,e):r.parseDate.call(this,e.srcformat,b,e.newformat,e):d(b,e)};n.date.getCellBuilder=function(b,e){var f=a.extend({},b.date);null!=b.colModel&&(f=a.extend({},f,b.colModel.formatoptions||{}));var h=r.parseDate,g=f.srcformat,n=f.newformat;return f.reformatAfterEdit||
"edit"!==e?function(a){return p.isEmpty(a)?d(a,f):h.call(this,g,a,n,f)}:function(a){return d(a,f)}};n.select=function(b,e){var f=[],h=e.colModel,g,h=a.extend({},h.editoptions||{},h.formatoptions||{}),n=h.value,r=h.separator||":",u=h.delimiter||";";if(n){var q=!0===h.multiple?!0:!1,y=[],E=function(a,b){if(0<b)return a};q&&(y=a.map(String(b).split(","),function(b){return a.trim(b)}));if("string"===typeof n){var C=n.split(u),B,D;for(B=0;B<C.length;B++)if(u=C[B].split(r),2<u.length&&(u[1]=a.map(u,E).join(r)),
D=a.trim(u[0]),h.defaultValue===D&&(g=u[1]),q)-1<a.inArray(D,y)&&f.push(u[1]);else if(D===a.trim(b)){f=[u[1]];break}}else p.isObject(n)&&(g=n[h.defaultValue],f=q?a.map(y,function(a){return n[a]}):[void 0===n[b]?"":n[b]])}b=f.join(", ");return""!==b?b:void 0!==h.defaultValue?g:d(b,h)};n.select.getCellBuilder=function(b){b=b.colModel;var d=n.defaultFormat,f=a.extend({},b.editoptions||{},b.formatoptions||{}),h=f.value;b=f.separator||":";var g=f.delimiter||";",t,r=void 0!==f.defaultValue,u=!0===f.multiple?
!0:!1,q,y={},E=function(a,b){if(0<b)return a};if("string"===typeof h)for(h=h.split(g),g=h.length,q=g-1;0<=q;q--)g=h[q].split(b),2<g.length&&(g[1]=a.map(g,E).join(b)),y[a.trim(g[0])]=g[1];else if(p.isObject(h))y=h;else return function(a){return a?String(a):d(a,f)};r&&(t=y[f.defaultValue]);return u?function(b){var c=[],g,h=a.map(String(b).split(","),function(b){return a.trim(b)});for(g=0;g<h.length;g++)b=h[g],y.hasOwnProperty(b)&&c.push(y[b]);b=c.join(", ");return""!==b?b:r?t:d(b,f)}:function(a){var b=
y[String(a)];return""!==b&&void 0!==b?b:r?t:d(a,f)}};n.rowactions=function(b,d){var f=a(this).closest("tr.jqgrow"),h=f.attr("id"),g=a(this).closest("table.ui-jqgrid-btable").attr("id").replace(/_frozen([^_]*)$/,"$1"),n=a("#"+r.jqID(g)),g=n[0],p=g.p,u=p.colModel[r.getCellIndex(this)],u=a.extend(!0,{extraparam:{}},r.actionsNav||{},p.actionsNavOptions||{},u.formatoptions||{});void 0!==p.editOptions&&(u.editOptions=p.editOptions);void 0!==p.delOptions&&(u.delOptions=p.delOptions);f.hasClass("jqgrid-new-row")&&
(u.extraparam[p.prmNames.oper]=p.prmNames.addoper);var q={keys:u.keys,oneditfunc:u.onEdit,successfunc:u.onSuccess,url:u.url,extraparam:u.extraparam,aftersavefunc:u.afterSave,errorfunc:u.onError,afterrestorefunc:u.afterRestore,restoreAfterError:u.restoreAfterError,mtype:u.mtype};!p.multiselect&&h!==p.selrow||p.multiselect&&0>a.inArray(h,p.selarrrow)?n.jqGrid("setSelection",h,!0,b):r.fullBoolFeedback.call(g,"onSelectRow","jqGridSelectRow",h,!0,b);switch(d){case "edit":n.jqGrid("editRow",h,q);break;
case "save":n.jqGrid("saveRow",h,q);break;case "cancel":n.jqGrid("restoreRow",h,u.afterRestore);break;case "del":u.delOptions=u.delOptions||{};void 0===u.delOptions.top&&(u.delOptions.top=f.offset().top+f.outerHeight()-n.closest(".ui-jqgrid").offset().top);n.jqGrid("delGridRow",h,u.delOptions);break;case "formedit":u.editOptions=u.editOptions||{};void 0===u.editOptions.top&&(u.editOptions.top=f.offset().top+f.outerHeight()-n.closest(".ui-jqgrid").offset().top,u.editOptions.recreateForm=!0);n.jqGrid("editGridRow",
h,u.editOptions);break;default:if(null!=u.custom&&0<u.custom.length)for(n=u.custom.length,f=0;f<n;f++)p=u.custom[f],p.action===d&&a.isFunction(p.onClick)&&p.onClick.call(g,{rowid:h,event:b,action:d,options:p})}b.stopPropagation&&b.stopPropagation();return!1};n.actions=function(b,d,f,h){b=d.rowId;var g="",n=this.p,w=a(this),A={},q=u.call(w,"edit")||{},w=a.extend({editbutton:!0,delbutton:!0,editformbutton:!1,commonIconClass:"ui-icon",editicon:"ui-icon-pencil",delicon:"ui-icon-trash",saveicon:"ui-icon-disk",
cancelicon:"ui-icon-cancel",savetitle:q.bSubmit||"",canceltitle:q.bCancel||""},u.call(w,"nav")||{},r.nav||{},n.navOptions||{},u.call(w,"actionsNav")||{},r.actionsNav||{},n.actionsNavOptions||{},d.colModel.formatoptions||{}),q=r.mergeCssClasses,n=q(r.getRes(r.guiStyles[n.guiStyle],"states.hover")),n="onmouseover=jQuery(this).addClass('"+n+"'); onmouseout=jQuery(this).removeClass('"+n+"'); ",y=[{action:"edit",actionName:"formedit",display:w.editformbutton},{action:"edit",display:!w.editformbutton&&
w.editbutton},{action:"del",idPrefix:"Delete",display:w.delbutton},{action:"save",display:w.editformbutton||w.editbutton,hidden:!0},{action:"cancel",display:w.editformbutton||w.editbutton,hidden:!0}],E=null!=w.custom?w.custom.length-1:-1;if(void 0===b||p.isEmpty(b))return"";if(a.isFunction(w.isDisplayButtons))try{A=w.isDisplayButtons.call(this,d,f,h)||{}}catch(C){}for(;0<=E;)d=w.custom[E--],y["first"===d.position?"unshift":"push"](d);d=0;for(E=y.length;d<E;d++)if(f=a.extend({},y[d],A[y[d].action]||
{}),!1!==f.display){h=f.action;var B=f.actionName||h,D=void 0!==f.idPrefix?f.idPrefix:h.charAt(0).toUpperCase()+h.substring(1);f="<div title='"+w[h+"title"]+(f.hidden?"' style='display:none;":"")+"' class='ui-pg-div ui-inline-"+h+"' "+(null!==D?"id='j"+D+"Button_"+b:"")+"' onclick=\"return jQuery.fn.fmatter.rowactions.call(this,event,'"+B+"');\" "+(f.noHovering?"":n)+"><span class='"+q(w.commonIconClass,w[h+"icon"])+"'></span></div>";g+=f}return"<div class='ui-jqgrid-actions'>"+g+"</div>"};n.actions.pageFinalization=
function(b){var d=a(this),f=this.p,h=f.colModel,g=h[b],n=function(n,p){var u=0,t,r;t=h.length;for(r=0;r<t&&!0===h[r].frozen;r++)u=r;t=d.jqGrid("getGridRowById",p);null!=t&&null!=t.cells&&(b=f.iColByName[g.name],r=a(t.cells[b]).children(".ui-jqgrid-actions"),g.frozen&&f.frozenColumns&&b<=u&&(r=r.add(a(d[0].grid.fbRows[t.rowIndex].cells[b]).children(".ui-jqgrid-actions"))),n?(r.find(">.ui-inline-edit,>.ui-inline-del").show(),r.find(">.ui-inline-save,>.ui-inline-cancel").hide()):(r.find(">.ui-inline-edit,>.ui-inline-del").hide(),
r.find(">.ui-inline-save,>.ui-inline-cancel").show()))},p=function(a,b){n(!0,b);return!1},u=function(a,b){n(!1,b);return!1};null!=g.formatoptions&&g.formatoptions.editformbutton||(d.unbind("jqGridInlineAfterRestoreRow.jqGridFormatter jqGridInlineAfterSaveRow.jqGridFormatter",p),d.bind("jqGridInlineAfterRestoreRow.jqGridFormatter jqGridInlineAfterSaveRow.jqGridFormatter",p),d.unbind("jqGridInlineEditRow.jqGridFormatter",u),d.bind("jqGridInlineEditRow.jqGridFormatter",u))};a.unformat=function(b,d,f,
h){var g,p=d.colModel,w=p.formatter,A=this.p,q=p.formatoptions||{},y=p.unformat||n[w]&&n[w].unformat;b instanceof jQuery&&0<b.length&&(b=b[0]);A.treeGrid&&null!=b&&a(b.firstChild).hasClass("tree-wrap")&&(a(b.lastChild).hasClass("cell-wrapper")||a(b.lastChild).hasClass("cell-wrapperleaf"))&&(b=b.lastChild);p.autoResizable&&null!=b&&a(b.firstChild).hasClass(A.autoResizing.wrapperClassName)&&(b=b.firstChild);if(void 0!==y&&a.isFunction(y))g=y.call(this,a(b).text(),d,b);else if(void 0!==w&&"string"===
typeof w){var E=a(this),C=function(a,b){return void 0!==q[b]?q[b]:u.call(E,"formatter."+a+"."+b)},A=function(a,b){var c=C(a,"thousandsSeparator").replace(/([\.\*\_\'\(\)\{\}\+\?\\])/g,"\\$1");return b.replace(new RegExp(c,"g"),"")};switch(w){case "integer":g=A("integer",a(b).text());break;case "number":g=A("number",a(b).text()).replace(C("number","decimalSeparator"),".");break;case "currency":g=a(b).text();d=C("currency","prefix");f=C("currency","suffix");d&&d.length&&(g=g.substr(d.length));f&&f.length&&
(g=g.substr(0,g.length-f.length));g=A("number",g).replace(C("number","decimalSeparator"),".");break;case "checkbox":g=null!=p.editoptions&&"string"===typeof p.editoptions.value?p.editoptions.value.split(":"):["Yes","No"];g=a("input",b).is(":checked")?g[0]:g[1];break;case "select":g=a.unformat.select(b,d,f,h);break;case "actions":return"";default:g=a(b).text()}}return g=void 0!==g?g:!0===h?a(b).text():r.htmlDecode(a(b).html())};a.unformat.select=function(b,d,f,h){f=[];b=a(b).text();d=d.colModel;if(!0===
h)return b;d=a.extend({},d.editoptions||{},d.formatoptions||{});h=void 0===d.separator?":":d.separator;var g=void 0===d.delimiter?";":d.delimiter;if(d.value){var n=d.value;d=!0===d.multiple?!0:!1;var r=[],u=function(a,b){if(0<b)return a};d&&(r=b.split(","),r=a.map(r,function(b){return a.trim(b)}));if("string"===typeof n){var q=n.split(g),y=0,E;for(E=0;E<q.length;E++)if(g=q[E].split(h),2<g.length&&(g[1]=a.map(g,u).join(h)),d)-1<a.inArray(a.trim(g[1]),r)&&(f[y]=g[0],y++);else if(a.trim(g[1])===a.trim(b)){f[0]=
g[0];break}}else if(p.isObject(n)||a.isArray(n))d||(r[0]=b),f=a.map(r,function(b){var c;a.each(n,function(a,d){if(d===b)return c=a,!1});if(void 0!==c)return c});return f.join(", ")}return b||""};a.unformat.date=function(b,d){var f=a.extend(!0,{},u.call(a(this),"formatter.date"),r.formatter.date||{},d.formatoptions||{});return p.isEmpty(b)?"":r.parseDate.call(this,f.newformat,b,f.srcformat,f)}})(jQuery);
(function(){window.xmlJsonClass={xml2json:function(a,p){9===a.nodeType&&(a=a.documentElement);var r=this.removeWhite(a),r=this.toObj(r),r=this.toJson(r,a.nodeName,"\t");return"{\n"+p+(p?r.replace(/\t/g,p):r.replace(/\t|\n/g,""))+"\n}"},json2xml:function(a,p){var r=function(a,f,h){var b="",c,e,l;if(a instanceof Array)if(0===a.length)b+=h+"<"+f+">__EMPTY_ARRAY_</"+f+">\n";else for(c=0,e=a.length;c<e;c+=1)l=h+r(a[c],f,h+"\t")+"\n",b+=l;else if("object"===typeof a){c=!1;b+=h+"<"+f;for(e in a)a.hasOwnProperty(e)&&
("@"===e.charAt(0)?b+=" "+e.substr(1)+'="'+a[e].toString()+'"':c=!0);b+=c?">":"/>";if(c){for(e in a)a.hasOwnProperty(e)&&("#text"===e?b+=a[e]:"#cdata"===e?b+="<![CDATA["+a[e]+"]]\x3e":"@"!==e.charAt(0)&&(b+=r(a[e],e,h+"\t")));b+=("\n"===b.charAt(b.length-1)?h:"")+"</"+f+">"}}else"function"===typeof a?b+=h+"<"+f+"><![CDATA["+a+"]]\x3e</"+f+">":(void 0===a&&(a=""),b='""'===a.toString()||0===a.toString().length?b+(h+"<"+f+">__EMPTY_STRING_</"+f+">"):b+(h+"<"+f+">"+a.toString()+"</"+f+">"));return b},
u="",n;for(n in a)a.hasOwnProperty(n)&&(u+=r(a[n],n,""));return p?u.replace(/\t/g,p):u.replace(/\t|\n/g,"")},toObj:function(a){var p={},r=/function/i,u,n=0,d=0,f=!1;if(1===a.nodeType){if(a.attributes.length)for(u=0;u<a.attributes.length;u+=1)p["@"+a.attributes[u].nodeName]=(a.attributes[u].nodeValue||"").toString();if(a.firstChild){for(u=a.firstChild;u;u=u.nextSibling)1===u.nodeType?f=!0:3===u.nodeType&&u.nodeValue.match(/[^ \f\n\r\t\v]/)?n+=1:4===u.nodeType&&(d+=1);if(f)if(2>n&&2>d)for(this.removeWhite(a),
u=a.firstChild;u;u=u.nextSibling)3===u.nodeType?p["#text"]=this.escape(u.nodeValue):4===u.nodeType?r.test(u.nodeValue)?p[u.nodeName]=[p[u.nodeName],u.nodeValue]:p["#cdata"]=this.escape(u.nodeValue):p[u.nodeName]?p[u.nodeName]instanceof Array?p[u.nodeName][p[u.nodeName].length]=this.toObj(u):p[u.nodeName]=[p[u.nodeName],this.toObj(u)]:p[u.nodeName]=this.toObj(u);else a.attributes.length?p["#text"]=this.escape(this.innerXml(a)):p=this.escape(this.innerXml(a));else if(n)a.attributes.length?p["#text"]=
this.escape(this.innerXml(a)):(p=this.escape(this.innerXml(a)),"__EMPTY_ARRAY_"===p?p="[]":"__EMPTY_STRING_"===p&&(p=""));else if(d)if(1<d)p=this.escape(this.innerXml(a));else for(u=a.firstChild;u;u=u.nextSibling){if(r.test(a.firstChild.nodeValue)){p=a.firstChild.nodeValue;break}p["#cdata"]=this.escape(u.nodeValue)}}a.attributes.length||a.firstChild||(p=null)}else 9===a.nodeType?p=this.toObj(a.documentElement):alert("unhandled node type: "+a.nodeType);return p},toJson:function(a,p,r,u){void 0===u&&
(u=!0);var n=p?'"'+p+'"':"",d="\t",f="\n",h,b,c=[];h=[];u||(f=d="");if("[]"===a)n+=p?":[]":"[]";else if(a instanceof Array){b=0;for(h=a.length;b<h;b+=1)c[b]=this.toJson(a[b],"",r+d,u);n+=(p?":[":"[")+(1<c.length?f+r+d+c.join(","+f+r+d)+f+r:c.join(""))+"]"}else if(null===a)n+=(p&&":")+"null";else if("object"===typeof a){for(b in a)a.hasOwnProperty(b)&&(h[h.length]=this.toJson(a[b],b,r+d,u));n+=(p?":{":"{")+(1<h.length?f+r+d+h.join(","+f+r+d)+f+r:h.join(""))+"}"}else n="string"===typeof a?n+((p&&":")+
'"'+a.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"'):n+((p&&":")+a.toString());return n},innerXml:function(a){var p="",r=function(a){var n="",d;if(1===a.nodeType){n+="<"+a.nodeName;for(d=0;d<a.attributes.length;d+=1)n+=" "+a.attributes[d].nodeName+'="'+(a.attributes[d].nodeValue||"").toString()+'"';if(a.firstChild){n+=">";for(d=a.firstChild;d;d=d.nextSibling)n+=r(d);n+="</"+a.nodeName+">"}else n+="/>"}else 3===a.nodeType?n+=a.nodeValue:4===a.nodeType&&(n+="<![CDATA["+a.nodeValue+"]]\x3e");return n};
if(a.hasOwnProperty("innerHTML"))p=a.innerHTML;else for(a=a.firstChild;a;a=a.nextSibling)p+=r(a);return p},escape:function(a){return a.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(a){a.normalize();for(var p=a.firstChild,r;p;)3===p.nodeType?p.nodeValue.match(/[^ \f\n\r\t\v]/)?p=p.nextSibling:(r=p.nextSibling,a.removeChild(p),p=r):(1===p.nodeType&&this.removeWhite(p),p=p.nextSibling);return a}}})();
//@ sourceMappingURL=jquery.jqgrid.min.map
|
CTres/jsdelivr
|
files/free-jqgrid/4.9.1/js/jquery.jqgrid.min.js
|
JavaScript
|
mit
| 309,414
|
<!DOCTYPE html><html><head><link rel="canonical" href="../../"/><meta http-equiv="content-type" content="text/html; charset=utf-8" /><meta http-equiv="refresh" content="0;url=../../" /></head></html>
|
RobertMyles/RobertMyles.github.io
|
tags/webscraping/page/1/index.html
|
HTML
|
mit
| 199
|
class HostAggregateHost < ApplicationRecord
belongs_to :host
belongs_to :host_aggregate
end
|
borod108/manageiq
|
app/models/host_aggregate_host.rb
|
Ruby
|
apache-2.0
| 96
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(unused_variables)]
#![deny(dead_code)]
enum Enum1 {
Variant1(isize),
Variant2 //~ ERROR: variant is never used
}
enum Enum2 {
Variant3(bool),
#[allow(dead_code)]
Variant4(isize),
Variant5 { _x: isize }, //~ ERROR: variant is never used: `Variant5`
Variant6(isize), //~ ERROR: variant is never used: `Variant6`
_Variant7,
}
enum Enum3 { //~ ERROR: enum is never used
Variant8,
Variant9
}
fn main() {
let v = Enum1::Variant1(1);
match v {
Enum1::Variant1(_) => (),
Enum1::Variant2 => ()
}
let x = Enum2::Variant3(true);
}
|
KokaKiwi/rust
|
src/test/compile-fail/lint-dead-code-5.rs
|
Rust
|
apache-2.0
| 1,072
|
{-# LANGUAGE TypeFamilies #-}
module T1897b where
import Control.Monad
import Data.Maybe
class Bug s where
type Depend s
next :: s -> Depend s -> Maybe s
start :: s
-- isValid :: (Bug s) => [Depend s] -> Bool
-- Inferred type should be rejected as ambiguous
isValid ds = isJust $ foldM next start ds
|
forked-upstream-packages-for-ghcjs/ghc
|
testsuite/tests/indexed-types/should_fail/T1897b.hs
|
Haskell
|
bsd-3-clause
| 316
|
#!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies simple rules when using an explicit build target of 'all'.
"""
import TestGyp
import os
import sys
test = TestGyp.TestGyp(formats=['make', 'ninja', 'android', 'xcode', 'msvs'])
test.run_gyp('actions.gyp', chdir='src')
test.relocate('src', 'relocate/src')
test.build('actions.gyp', chdir='relocate/src')
expect = """\
no dir here
hi c
hello baz
"""
if test.format == 'xcode':
chdir = 'relocate/src/subdir'
else:
chdir = 'relocate/src'
test.run_built_executable('gencc_int_output', chdir=chdir, stdout=expect)
if test.format == 'msvs':
test.run_built_executable('gencc_int_output_external', chdir=chdir,
stdout=expect)
test.must_match('relocate/src/subdir/foo/bar/baz.dirname',
os.path.join('foo', 'bar'))
test.must_match('relocate/src/subdir/a/b/c.dirname',
os.path.join('a', 'b'))
# FIXME the xcode and make generators incorrectly convert RULE_INPUT_PATH
# to an absolute path, making the tests below fail!
if test.format != 'xcode' and test.format != 'make':
test.must_match('relocate/src/subdir/foo/bar/baz.path',
os.path.join('foo', 'bar', 'baz.printvars'))
test.must_match('relocate/src/subdir/a/b/c.path',
os.path.join('a', 'b', 'c.printvars'))
test.pass_test()
|
sgraham/nope
|
tools/gyp/test/rules-dirname/gyptest-dirname.py
|
Python
|
bsd-3-clause
| 1,475
|
{-# OPTIONS_GHC -fno-safe-infer #-}
-- | Basic test to see if no safe infer flag compiles
-- This module would usually infer safely, so it shouldn't be safe now.
-- We don't actually check that here though, see test '' for that.
module SafeFlags27 where
f :: Int
f = 1
|
wxwxwwxxx/ghc
|
testsuite/tests/safeHaskell/flags/SafeFlags27.hs
|
Haskell
|
bsd-3-clause
| 271
|
@font-face {
font-family: 'aller';
src: url('http://vader.binaryelysium.com/fonts/aller_rg-webfont.eot');
src: url('http://vader.binaryelysium.com/fonts/aller_rg-webfont.eot?#iefix') format('embedded-opentype'), url('http://vader.binaryelysium.com/fonts/aller_rg-webfont.woff') format('woff'), url('http://vader.binaryelysium.com/fonts/aller_rg-webfont.ttf') format('truetype'), url('http://vader.binaryelysium.com/fonts/aller_rg-webfont.svg#allerregular') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'aller';
src: url('http://vader.binaryelysium.com/fonts/aller_bd-webfont.eot');
src: url('http://vader.binaryelysium.com/fonts/aller_bd-webfont.eot?#iefix') format('embedded-opentype'), url('http://vader.binaryelysium.com/fonts/aller_bd-webfont.woff') format('woff'), url('http://vader.binaryelysium.com/fonts/aller_bd-webfont.ttf') format('truetype'), url('http://vader.binaryelysium.com/fonts/aller_bd-webfont.svg#allerbold') format('svg');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'aller';
src: url('http://vader.binaryelysium.com/fonts/aller_it-webfont.eot');
src: url('http://vader.binaryelysium.com/fonts/aller_it-webfont.eot?#iefix') format('embedded-opentype'), url('http://vader.binaryelysium.com/fonts/aller_it-webfont.woff') format('woff'), url('http://vader.binaryelysium.com/fonts/aller_it-webfont.ttf') format('truetype'), url('http://vader.binaryelysium.com/fonts/aller_it-webfont.svg#alleritalic') format('svg');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'Jura';
font-style: normal;
font-weight: 400;
src: local('Jura Regular'), local('Jura-Regular'), url(https://themes.googleusercontent.com/static/fonts/jura/v5/pqMzP52_r6zHbOILcX8h-A.woff) format('woff');
}
/*
@-webkit-keyframes fadeAnim {
0% { opacity: 0; }
100% { opacity: 1; }
}
@-moz-keyframes fadeAnim {
0% { opacity: 0; }
100% { opacity: 1; }
}
@-o-keyframes fadeAnim {
0% { opacity: 0; }
100% { opacity: 1; }
}
@keyframes fadeAnim {
0% { opacity: 0; }
100% { opacity: 1; }
}
*/
/** apply to input[type=radio/checkbox] */
/**
CSS only dropdowns
based off of http://jsfiddle.net/A664f/4/
*/
.sheet-dropdown {
position: relative;
}
/**
CSS only dropdowns
based off of http://jsfiddle.net/A664f/4/
*/
.sheet-d12-s {
background-position: -302px -1px;
width: 23px;
height: 23px;
background-image: url("https://i.imgur.com/zkgyBOi.png");
background-repeat: no-repeat;
color: transparent;
display: inline-block;
}
.sheet-d10-s {
background-position: -156px -1px;
width: 23px;
height: 23px;
background-image: url("https://i.imgur.com/zkgyBOi.png");
background-repeat: no-repeat;
color: transparent;
display: inline-block;
}
.sheet-d8-s {
background-position: -740px -1px;
width: 23px;
height: 23px;
background-image: url("https://i.imgur.com/zkgyBOi.png");
background-repeat: no-repeat;
color: transparent;
display: inline-block;
}
.sheet-d6-s {
background-position: -594px -1px;
width: 23px;
height: 23px;
background-image: url("https://i.imgur.com/zkgyBOi.png");
background-repeat: no-repeat;
color: transparent;
display: inline-block;
}
.sheet-d4-s {
background-position: -448px -1px;
width: 23px;
height: 23px;
background-image: url("https://i.imgur.com/zkgyBOi.png");
background-repeat: no-repeat;
color: transparent;
display: inline-block;
}
.sheet-d12 {
background-position: -265px -1px;
width: 35px;
height: 35px;
background-image: url("https://i.imgur.com/zkgyBOi.png");
background-repeat: no-repeat;
color: transparent;
display: inline-block;
}
.sheet-d10 {
background-position: -119px -1px;
width: 35px;
height: 35px;
background-image: url("https://i.imgur.com/zkgyBOi.png");
background-repeat: no-repeat;
color: transparent;
display: inline-block;
}
.sheet-d8 {
background-position: -703px -1px;
width: 35px;
height: 35px;
background-image: url("https://i.imgur.com/zkgyBOi.png");
background-repeat: no-repeat;
color: transparent;
display: inline-block;
}
.sheet-d6 {
background-position: -557px -1px;
width: 35px;
height: 35px;
background-image: url("https://i.imgur.com/zkgyBOi.png");
background-repeat: no-repeat;
color: transparent;
display: inline-block;
}
.sheet-d4 {
background-position: -411px -1px;
width: 35px;
height: 35px;
background-image: url("https://i.imgur.com/zkgyBOi.png");
background-repeat: no-repeat;
color: transparent;
display: inline-block;
}
/* Sheet-wide styles */
.sheet-main-outer {
background: url("https://i.imgur.com/WTTBLUo.png") top left no-repeat, url("https://i.imgur.com/hwYnUHT.png") bottom left no-repeat, #ffffff;
border-style: solid;
border-width: 1px;
border-color: #a7a5a6;
margin-top: 50px;
}
.sheet-main {
position: relative;
min-height: 795px;
background-position: top left;
background-repeat: no-repeat;
width: 713px;
background: white;
margin: 125px 30px 90px 30px;
border: none;
border-left: 2px solid #a7a5a6;
border-right: 2px solid #a7a5a6;
padding: 0;
font-family: 'aller', palatino, Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", serif;
font-size: 16px;
line-height: 14px;
color: #000000;
}
.sheet-page {
padding: 5px 5px;
}
.sheet-page .sheet-section {
display: inline-block;
width: 100%;
padding: 0px 0px 0px 0px;
margin: 0px 0px 2px 1px;
min-height: 50px;
}
.sheet-page .sheet-section h2 {
border-bottom: none;
background-color: #a1a8c2;
color: white;
margin-top: 3px;
font-size: 18px;
font-weight: normal;
letter-spacing: 3px;
margin-bottom: 5px;
font-variant: small-caps;
width: 300px;
position: relative;
left: 7px;
padding: 0;
line-height: 28px;
}
.sheet-page .sheet-section h2:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-page .sheet-section h2:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-page .sheet-section button[type=roll] {
display: inline-block;
margin-bottom: 0;
font-weight: normal;
text-align: center;
vertical-align: middle;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
color: #333333;
background-color: #ffffff;
border-color: #cccccc;
font-family: Jura, Calibri, Candara, Segoe, "Segoe UI", Optima, "Liberation Sans", Arial, sans-serif;
border: 0px solid transparent;
font-weight: bold;
}
.sheet-page .sheet-section button[type=roll]:focus,
.sheet-page .sheet-section button[type=roll]:active:focus,
.sheet-page .sheet-section button[type=roll].active:focus {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.sheet-page .sheet-section button[type=roll]:hover,
.sheet-page .sheet-section button[type=roll]:focus {
color: #333333;
text-decoration: none;
}
.sheet-page .sheet-section button[type=roll]:active,
.sheet-page .sheet-section button[type=roll].active {
outline: 0;
background-image: none;
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.sheet-page .sheet-section button[type=roll].disabled,
.sheet-page .sheet-section button[type=roll][disabled],
fieldset[disabled] .sheet-page .sheet-section button[type=roll] {
cursor: not-allowed;
pointer-events: none;
opacity: 0.65;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
}
.sheet-page .sheet-section button[type=roll]:hover,
.sheet-page .sheet-section button[type=roll]:focus,
.sheet-page .sheet-section button[type=roll]:active,
.sheet-page .sheet-section button[type=roll].active,
.open .dropdown-toggle.sheet-page .sheet-section button[type=roll] {
color: #333333;
background-color: #ebebeb;
border-color: #adadad;
}
.sheet-page .sheet-section button[type=roll]:active,
.sheet-page .sheet-section button[type=roll].active,
.open .dropdown-toggle.sheet-page .sheet-section button[type=roll] {
background-image: none;
}
.sheet-page .sheet-section button[type=roll].disabled,
.sheet-page .sheet-section button[type=roll][disabled],
fieldset[disabled] .sheet-page .sheet-section button[type=roll],
.sheet-page .sheet-section button[type=roll].disabled:hover,
.sheet-page .sheet-section button[type=roll][disabled]:hover,
fieldset[disabled] .sheet-page .sheet-section button[type=roll]:hover,
.sheet-page .sheet-section button[type=roll].disabled:focus,
.sheet-page .sheet-section button[type=roll][disabled]:focus,
fieldset[disabled] .sheet-page .sheet-section button[type=roll]:focus,
.sheet-page .sheet-section button[type=roll].disabled:active,
.sheet-page .sheet-section button[type=roll][disabled]:active,
fieldset[disabled] .sheet-page .sheet-section button[type=roll]:active,
.sheet-page .sheet-section button[type=roll].disabled.active,
.sheet-page .sheet-section button[type=roll][disabled].active,
fieldset[disabled] .sheet-page .sheet-section button[type=roll].active {
background-color: #ffffff;
border-color: #cccccc;
}
.sheet-page .sheet-section button[type=roll] .badge {
color: #ffffff;
background-color: #333333;
}
.sheet-page .sheet-section button[type=roll]:before {
content: "";
}
.sheet-page .sheet-section button:not([type=roll]) {
font-family: Jura, Calibri, Candara, Segoe, "Segoe UI", Optima, "Liberation Sans", Arial, sans-serif;
}
.sheet-page .sheet-section input,
.sheet-page .sheet-section textarea {
font-family: 'aller', palatino, Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", serif;
}
.sheet-page .sheet-section .sheet-dropdown > div:hover {
-webkit-animation: fadeAnim 0.5s 1;
/* Safari 4+ */
-moz-animation: fadeAnim 0.5s 1;
/* Fx 5+ */
-o-animation: fadeAnim 0.5s 1;
/* Opera 12+ */
animation: fadeAnim 0.5s 1;
/* IE 10+ */
}
.sheet-page .sheet-section input {
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
outline: 0;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
background-color: transparent;
border: 1px solid #a7a5a6;
border-width: 0 0 1px 0;
}
.sheet-page .sheet-section input[type=text] {
-ms-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-box-sizing: border-box;
border: 1px solid #a7a5a6;
border-width: 0 0 1px 0;
padding: 0;
font-size: 13px;
background: transparent;
max-width: 100%;
}
.sheet-page .sheet-section input[type=checkbox] {
/* Hide actual radio/checkbox */
opacity: 0;
width: 16px;
height: 16px;
position: relative;
top: 5px;
left: 6px;
margin: -10px;
cursor: pointer;
z-index: 1;
top: 0;
}
.sheet-page .sheet-section input[type=checkbox] + span:before {
/* Fake radio/checkbox */
margin-right: 4px;
line-height: 14px;
text-align: center;
display: inline-block;
vertical-align: middle;
}
.sheet-page .sheet-section input[type=checkbox] + span::before {
content: "";
background-position: -1px -1px;
width: 15px;
height: 15px;
background-image: url("https://i.imgur.com/zkgyBOi.png");
background-repeat: no-repeat;
vertical-align: middle;
color: transparent;
display: inline-block;
height: 16px;
width: 16px;
}
.sheet-page .sheet-section input[type=checkbox]:checked + span::before {
background-position: -18px -1px;
width: 15px;
height: 15px;
background-image: url("https://i.imgur.com/zkgyBOi.png");
background-repeat: no-repeat;
display: inline-block;
height: 16px;
width: 16px;
}
/* Section: Header */
.sheet-pagehead {
margin: 22px auto 30px auto;
width: 510px;
position: absolute;
top: -95px;
left: 180px;
text-align: left;
}
.sheet-pagehead input {
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
outline: 0;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
background-color: transparent;
border: 1px solid #a7a5a6;
border-width: 0 0 1px 0;
}
.sheet-pagehead input[type=text] {
-ms-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-box-sizing: border-box;
border: 1px solid #a7a5a6;
border-width: 0 0 1px 0;
padding: 0;
font-size: 13px;
background: transparent;
max-width: 100%;
}
.sheet-pagehead .attr_ID {
font-family: 'aller', palatino, Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", serif;
font-size: 20pt;
text-align: left;
font-variant: small-caps;
margin: 0px 0px 9px 0px;
display: inline-block;
width: 65%;
display: block;
}
.sheet-pagehead .attr_Desc {
font-family: 'aller', palatino, Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", serif;
text-align: left;
font-size: 14px;
display: inline-block;
line-height: 14px;
padding-bottom: 3px;
width: 100%;
display: block;
}
.sheet-pagehead .sheet-portraitholder {
display: inline-block;
position: relative;
float: right;
z-index: 1;
top: -30px;
right: 0;
margin: 0;
padding: 0;
border: none;
}
/* Section: Attributes */
.sheet-attributes {
width: 100%;
height: 35px;
margin-left: 18%;
}
.sheet-attributes .sheet-attribute {
display: inline-block;
clear: both;
width: 18%;
margin-left: 0px;
margin-right: 30px;
}
.sheet-attributes .sheet-attribute > div {
float: left;
vertical-align: middle;
margin: 0;
}
.sheet-attributes .sheet-attribute > button {
float: right;
display: inline-block;
height: 35px;
margin: 0px;
}
/* Section: Skills */
.sheet-skills table {
margin: 0 auto;
border-collapse: separate;
}
.sheet-skills table td {
border-bottom: 1px solid black;
min-width: 90px;
}
.sheet-skills table td:nth-child(2n) {
border-right: 10px solid white;
}
.sheet-skills table td:last-child {
border-right: none;
}
.sheet-skills table td input.sheet-skill-spec {
width: 80px;
font-size: 12px;
line-height: 1.5;
}
.sheet-skills table td input.sheet-skill-spec + button[type=roll] {
min-width: 0;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
padding: 1px 1px;
font-weight: normal;
height: 23px;
}
.sheet-skills table td input.sheet-skill-spec + button[type=roll]:before {
content: "t";
}
.sheet-skills table td .sheet-dropdown button[type=roll] {
display: inline-block;
margin-bottom: 0;
font-weight: normal;
text-align: center;
vertical-align: middle;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
color: #333333;
background-color: #ffffff;
border-color: #cccccc;
font-family: Jura, Calibri, Candara, Segoe, "Segoe UI", Optima, "Liberation Sans", Arial, sans-serif;
border: 0px solid transparent;
font-weight: bold;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
min-width: 80px;
font-size: 0.75em;
}
.sheet-skills table td .sheet-dropdown button[type=roll]:focus,
.sheet-skills table td .sheet-dropdown button[type=roll]:active:focus,
.sheet-skills table td .sheet-dropdown button[type=roll].active:focus {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.sheet-skills table td .sheet-dropdown button[type=roll]:hover,
.sheet-skills table td .sheet-dropdown button[type=roll]:focus {
color: #333333;
text-decoration: none;
}
.sheet-skills table td .sheet-dropdown button[type=roll]:active,
.sheet-skills table td .sheet-dropdown button[type=roll].active {
outline: 0;
background-image: none;
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.sheet-skills table td .sheet-dropdown button[type=roll].disabled,
.sheet-skills table td .sheet-dropdown button[type=roll][disabled],
fieldset[disabled] .sheet-skills table td .sheet-dropdown button[type=roll] {
cursor: not-allowed;
pointer-events: none;
opacity: 0.65;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
}
.sheet-skills table td .sheet-dropdown button[type=roll]:hover,
.sheet-skills table td .sheet-dropdown button[type=roll]:focus,
.sheet-skills table td .sheet-dropdown button[type=roll]:active,
.sheet-skills table td .sheet-dropdown button[type=roll].active,
.open .dropdown-toggle.sheet-skills table td .sheet-dropdown button[type=roll] {
color: #333333;
background-color: #ebebeb;
border-color: #adadad;
}
.sheet-skills table td .sheet-dropdown button[type=roll]:active,
.sheet-skills table td .sheet-dropdown button[type=roll].active,
.open .dropdown-toggle.sheet-skills table td .sheet-dropdown button[type=roll] {
background-image: none;
}
.sheet-skills table td .sheet-dropdown button[type=roll].disabled,
.sheet-skills table td .sheet-dropdown button[type=roll][disabled],
fieldset[disabled] .sheet-skills table td .sheet-dropdown button[type=roll],
.sheet-skills table td .sheet-dropdown button[type=roll].disabled:hover,
.sheet-skills table td .sheet-dropdown button[type=roll][disabled]:hover,
fieldset[disabled] .sheet-skills table td .sheet-dropdown button[type=roll]:hover,
.sheet-skills table td .sheet-dropdown button[type=roll].disabled:focus,
.sheet-skills table td .sheet-dropdown button[type=roll][disabled]:focus,
fieldset[disabled] .sheet-skills table td .sheet-dropdown button[type=roll]:focus,
.sheet-skills table td .sheet-dropdown button[type=roll].disabled:active,
.sheet-skills table td .sheet-dropdown button[type=roll][disabled]:active,
fieldset[disabled] .sheet-skills table td .sheet-dropdown button[type=roll]:active,
.sheet-skills table td .sheet-dropdown button[type=roll].disabled.active,
.sheet-skills table td .sheet-dropdown button[type=roll][disabled].active,
fieldset[disabled] .sheet-skills table td .sheet-dropdown button[type=roll].active {
background-color: #ffffff;
border-color: #cccccc;
}
.sheet-skills table td .sheet-dropdown button[type=roll] .badge {
color: #ffffff;
background-color: #333333;
}
.sheet-skills table .sheet-dropdown {
display: inline-block;
}
/* Section: Shared Distinctions and Sig Assets*/
.sheet-sigassets,
.sheet-distinctions {
margin-bottom: 50px;
}
.sheet-sigassets:last-of-type,
.sheet-distinctions:last-of-type {
margin-bottom: 5px;
}
.sheet-sigassets .sheet-ul,
.sheet-distinctions .sheet-ul,
.sheet-sigassets ul,
.sheet-distinctions ul {
list-style: none;
margin: 0 0 0 25px;
}
.sheet-sigassets .sheet-ul .sheet-li,
.sheet-distinctions .sheet-ul .sheet-li,
.sheet-sigassets ul .sheet-li,
.sheet-distinctions ul .sheet-li,
.sheet-sigassets .sheet-ul li,
.sheet-distinctions .sheet-ul li,
.sheet-sigassets ul li,
.sheet-distinctions ul li {
margin-bottom: 5px;
}
.sheet-sigassets .sheet-ul .sheet-li textarea,
.sheet-distinctions .sheet-ul .sheet-li textarea,
.sheet-sigassets ul .sheet-li textarea,
.sheet-distinctions ul .sheet-li textarea,
.sheet-sigassets .sheet-ul li textarea,
.sheet-distinctions .sheet-ul li textarea,
.sheet-sigassets ul li textarea,
.sheet-distinctions ul li textarea {
height: auto;
width: 90%;
margin: 0;
}
/* Section: Distinctions */
.sheet-distinctions > input[type=text].sheet-lore {
width: 100%;
font-style: italic;
margin-bottom: 5px;
}
.sheet-distinctions .sheet-distinct-head input[type=text] {
font-variant: small-caps;
display: inline-block;
margin-bottom: 5px;
font-size: 18px;
}
.sheet-distinctions .sheet-distinct-head:before {
background-position: -703px -1px;
width: 35px;
height: 35px;
background-image: url("https://i.imgur.com/zkgyBOi.png");
background-repeat: no-repeat;
content: ' ';
display: inline-block;
vertical-align: middle;
}
.sheet-distinctions .sheet-distinct-head button[type=roll] {
min-width: 0;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
padding: 1px 1px;
font-weight: normal;
width: 35px;
height: 35px;
}
.sheet-distinctions .sheet-distinct-head button[type=roll]:before {
content: "t";
}
.sheet-distinctions .sheet-distinction-skills {
font-variant: small-caps;
margin: 0;
}
.sheet-distinctions .sheet-distinction-skills input[type=text] {
font-family: Jura, Calibri, Candara, Segoe, "Segoe UI", Optima, "Liberation Sans", Arial, sans-serif;
width: 73px;
margin-left: 2px;
font-weight: bolder;
line-height: 1.5;
}
/* Section: Signature Assets*/
.sheet-sigassets .sheet-sigasset-head {
height: 35px;
}
.sheet-sigassets .sheet-sigasset-head .sheet-dropdown {
width: 41%;
}
.sheet-sigassets .sheet-sigasset-head .sheet-dropdown > div {
float: left;
vertical-align: middle;
}
.sheet-sigassets .sheet-sigasset-head .sheet-dropdown > input[type=text] {
font-size: 18px;
font-variant: small-caps;
margin-bottom: 5px;
float: right;
display: inline-block;
}
.sheet-sigassets .sheet-sigasset-head button[type=roll] {
min-width: 0;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
padding: 1px 1px;
font-weight: normal;
display: inline-block;
float: right;
width: 35px;
height: 35px;
}
.sheet-sigassets .sheet-sigasset-head button[type=roll]:before {
content: "t";
}
.sheet-sigassets textarea {
height: auto;
width: 90%;
margin: 0;
margin-bottom: 5px;
}
/* Create pseudo-dropdowns CSS */
.sheet-dropdown .sheet-drop-attr_Mental {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Mental .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Mental .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Mental .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Mental .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Mental .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Mental"],
.sheet-dropdown input[name="attr_Mental"] + span,
.sheet-dropdown input[name="attr_Mental"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Mental"],
.sheet-dropdown input[name="attr_Mental"] + span,
.sheet-dropdown input[name="attr_Mental"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Mental:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Mental:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Mental:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Mental:hover input[name="attr_Mental"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Mental:hover input[name="attr_Mental"] + span,
.sheet-dropdown .sheet-drop-attr_Mental:hover input[name="attr_Mental"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Mental:hover input[name="attr_Mental"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Mental:hover input[name="attr_Mental"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Mental:hover input[name="attr_Mental"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Mental"]:checked,
.sheet-dropdown input[name="attr_Mental"]:checked + span + label,
.sheet-dropdown input[name="attr_Mental"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Mental:not(:hover) input[name="attr_Mental"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Mental:not(:hover) input[name="attr_Mental"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Mental:not(:hover) input[name="attr_Mental"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Mental:not(:hover) input[name="attr_Mental"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Mental:not(:hover) input[name="attr_Mental"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Physical {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Physical .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Physical .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Physical .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Physical .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Physical .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Physical"],
.sheet-dropdown input[name="attr_Physical"] + span,
.sheet-dropdown input[name="attr_Physical"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Physical"],
.sheet-dropdown input[name="attr_Physical"] + span,
.sheet-dropdown input[name="attr_Physical"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Physical:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Physical:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Physical:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Physical:hover input[name="attr_Physical"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Physical:hover input[name="attr_Physical"] + span,
.sheet-dropdown .sheet-drop-attr_Physical:hover input[name="attr_Physical"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Physical:hover input[name="attr_Physical"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Physical:hover input[name="attr_Physical"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Physical:hover input[name="attr_Physical"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Physical"]:checked,
.sheet-dropdown input[name="attr_Physical"]:checked + span + label,
.sheet-dropdown input[name="attr_Physical"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Physical:not(:hover) input[name="attr_Physical"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Physical:not(:hover) input[name="attr_Physical"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Physical:not(:hover) input[name="attr_Physical"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Physical:not(:hover) input[name="attr_Physical"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Physical:not(:hover) input[name="attr_Physical"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Social {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Social .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Social .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Social .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Social .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Social .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Social"],
.sheet-dropdown input[name="attr_Social"] + span,
.sheet-dropdown input[name="attr_Social"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Social"],
.sheet-dropdown input[name="attr_Social"] + span,
.sheet-dropdown input[name="attr_Social"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Social:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Social:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Social:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Social:hover input[name="attr_Social"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Social:hover input[name="attr_Social"] + span,
.sheet-dropdown .sheet-drop-attr_Social:hover input[name="attr_Social"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Social:hover input[name="attr_Social"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Social:hover input[name="attr_Social"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Social:hover input[name="attr_Social"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Social"]:checked,
.sheet-dropdown input[name="attr_Social"]:checked + span + label,
.sheet-dropdown input[name="attr_Social"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Social:not(:hover) input[name="attr_Social"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Social:not(:hover) input[name="attr_Social"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Social:not(:hover) input[name="attr_Social"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Social:not(:hover) input[name="attr_Social"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Social:not(:hover) input[name="attr_Social"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Craft {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Craft .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Craft .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Craft .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Craft .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Craft .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Craft"],
.sheet-dropdown input[name="attr_Craft"] + span,
.sheet-dropdown input[name="attr_Craft"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Craft"],
.sheet-dropdown input[name="attr_Craft"] + span,
.sheet-dropdown input[name="attr_Craft"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Craft:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Craft:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Craft:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Craft:hover input[name="attr_Craft"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Craft:hover input[name="attr_Craft"] + span,
.sheet-dropdown .sheet-drop-attr_Craft:hover input[name="attr_Craft"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Craft:hover input[name="attr_Craft"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Craft:hover input[name="attr_Craft"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Craft:hover input[name="attr_Craft"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Craft"]:checked,
.sheet-dropdown input[name="attr_Craft"]:checked + span + label,
.sheet-dropdown input[name="attr_Craft"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Craft:not(:hover) input[name="attr_Craft"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Craft:not(:hover) input[name="attr_Craft"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Craft:not(:hover) input[name="attr_Craft"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Craft:not(:hover) input[name="attr_Craft"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Craft:not(:hover) input[name="attr_Craft"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Drive {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Drive .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Drive .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Drive .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Drive .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Drive .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Drive"],
.sheet-dropdown input[name="attr_Drive"] + span,
.sheet-dropdown input[name="attr_Drive"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Drive"],
.sheet-dropdown input[name="attr_Drive"] + span,
.sheet-dropdown input[name="attr_Drive"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Drive:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Drive:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Drive:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Drive:hover input[name="attr_Drive"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Drive:hover input[name="attr_Drive"] + span,
.sheet-dropdown .sheet-drop-attr_Drive:hover input[name="attr_Drive"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Drive:hover input[name="attr_Drive"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Drive:hover input[name="attr_Drive"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Drive:hover input[name="attr_Drive"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Drive"]:checked,
.sheet-dropdown input[name="attr_Drive"]:checked + span + label,
.sheet-dropdown input[name="attr_Drive"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Drive:not(:hover) input[name="attr_Drive"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Drive:not(:hover) input[name="attr_Drive"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Drive:not(:hover) input[name="attr_Drive"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Drive:not(:hover) input[name="attr_Drive"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Drive:not(:hover) input[name="attr_Drive"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Fight {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Fight .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Fight .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Fight .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Fight .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Fight .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Fight"],
.sheet-dropdown input[name="attr_Fight"] + span,
.sheet-dropdown input[name="attr_Fight"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Fight"],
.sheet-dropdown input[name="attr_Fight"] + span,
.sheet-dropdown input[name="attr_Fight"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Fight:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Fight:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Fight:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Fight:hover input[name="attr_Fight"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Fight:hover input[name="attr_Fight"] + span,
.sheet-dropdown .sheet-drop-attr_Fight:hover input[name="attr_Fight"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Fight:hover input[name="attr_Fight"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Fight:hover input[name="attr_Fight"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Fight:hover input[name="attr_Fight"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Fight"]:checked,
.sheet-dropdown input[name="attr_Fight"]:checked + span + label,
.sheet-dropdown input[name="attr_Fight"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Fight:not(:hover) input[name="attr_Fight"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Fight:not(:hover) input[name="attr_Fight"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Fight:not(:hover) input[name="attr_Fight"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Fight:not(:hover) input[name="attr_Fight"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Fight:not(:hover) input[name="attr_Fight"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Fix {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Fix .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Fix .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Fix .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Fix .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Fix .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Fix"],
.sheet-dropdown input[name="attr_Fix"] + span,
.sheet-dropdown input[name="attr_Fix"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Fix"],
.sheet-dropdown input[name="attr_Fix"] + span,
.sheet-dropdown input[name="attr_Fix"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Fix:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Fix:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Fix:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Fix:hover input[name="attr_Fix"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Fix:hover input[name="attr_Fix"] + span,
.sheet-dropdown .sheet-drop-attr_Fix:hover input[name="attr_Fix"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Fix:hover input[name="attr_Fix"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Fix:hover input[name="attr_Fix"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Fix:hover input[name="attr_Fix"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Fix"]:checked,
.sheet-dropdown input[name="attr_Fix"]:checked + span + label,
.sheet-dropdown input[name="attr_Fix"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Fix:not(:hover) input[name="attr_Fix"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Fix:not(:hover) input[name="attr_Fix"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Fix:not(:hover) input[name="attr_Fix"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Fix:not(:hover) input[name="attr_Fix"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Fix:not(:hover) input[name="attr_Fix"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Fly {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Fly .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Fly .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Fly .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Fly .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Fly .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Fly"],
.sheet-dropdown input[name="attr_Fly"] + span,
.sheet-dropdown input[name="attr_Fly"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Fly"],
.sheet-dropdown input[name="attr_Fly"] + span,
.sheet-dropdown input[name="attr_Fly"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Fly:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Fly:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Fly:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Fly:hover input[name="attr_Fly"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Fly:hover input[name="attr_Fly"] + span,
.sheet-dropdown .sheet-drop-attr_Fly:hover input[name="attr_Fly"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Fly:hover input[name="attr_Fly"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Fly:hover input[name="attr_Fly"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Fly:hover input[name="attr_Fly"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Fly"]:checked,
.sheet-dropdown input[name="attr_Fly"]:checked + span + label,
.sheet-dropdown input[name="attr_Fly"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Fly:not(:hover) input[name="attr_Fly"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Fly:not(:hover) input[name="attr_Fly"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Fly:not(:hover) input[name="attr_Fly"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Fly:not(:hover) input[name="attr_Fly"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Fly:not(:hover) input[name="attr_Fly"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Focus {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Focus .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Focus .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Focus .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Focus .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Focus .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Focus"],
.sheet-dropdown input[name="attr_Focus"] + span,
.sheet-dropdown input[name="attr_Focus"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Focus"],
.sheet-dropdown input[name="attr_Focus"] + span,
.sheet-dropdown input[name="attr_Focus"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Focus:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Focus:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Focus:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Focus:hover input[name="attr_Focus"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Focus:hover input[name="attr_Focus"] + span,
.sheet-dropdown .sheet-drop-attr_Focus:hover input[name="attr_Focus"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Focus:hover input[name="attr_Focus"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Focus:hover input[name="attr_Focus"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Focus:hover input[name="attr_Focus"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Focus"]:checked,
.sheet-dropdown input[name="attr_Focus"]:checked + span + label,
.sheet-dropdown input[name="attr_Focus"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Focus:not(:hover) input[name="attr_Focus"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Focus:not(:hover) input[name="attr_Focus"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Focus:not(:hover) input[name="attr_Focus"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Focus:not(:hover) input[name="attr_Focus"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Focus:not(:hover) input[name="attr_Focus"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Influence {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Influence .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Influence .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Influence .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Influence .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Influence .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Influence"],
.sheet-dropdown input[name="attr_Influence"] + span,
.sheet-dropdown input[name="attr_Influence"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Influence"],
.sheet-dropdown input[name="attr_Influence"] + span,
.sheet-dropdown input[name="attr_Influence"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Influence:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Influence:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Influence:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Influence:hover input[name="attr_Influence"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Influence:hover input[name="attr_Influence"] + span,
.sheet-dropdown .sheet-drop-attr_Influence:hover input[name="attr_Influence"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Influence:hover input[name="attr_Influence"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Influence:hover input[name="attr_Influence"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Influence:hover input[name="attr_Influence"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Influence"]:checked,
.sheet-dropdown input[name="attr_Influence"]:checked + span + label,
.sheet-dropdown input[name="attr_Influence"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Influence:not(:hover) input[name="attr_Influence"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Influence:not(:hover) input[name="attr_Influence"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Influence:not(:hover) input[name="attr_Influence"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Influence:not(:hover) input[name="attr_Influence"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Influence:not(:hover) input[name="attr_Influence"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Know {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Know .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Know .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Know .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Know .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Know .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Know"],
.sheet-dropdown input[name="attr_Know"] + span,
.sheet-dropdown input[name="attr_Know"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Know"],
.sheet-dropdown input[name="attr_Know"] + span,
.sheet-dropdown input[name="attr_Know"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Know:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Know:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Know:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Know:hover input[name="attr_Know"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Know:hover input[name="attr_Know"] + span,
.sheet-dropdown .sheet-drop-attr_Know:hover input[name="attr_Know"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Know:hover input[name="attr_Know"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Know:hover input[name="attr_Know"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Know:hover input[name="attr_Know"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Know"]:checked,
.sheet-dropdown input[name="attr_Know"]:checked + span + label,
.sheet-dropdown input[name="attr_Know"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Know:not(:hover) input[name="attr_Know"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Know:not(:hover) input[name="attr_Know"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Know:not(:hover) input[name="attr_Know"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Know:not(:hover) input[name="attr_Know"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Know:not(:hover) input[name="attr_Know"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Labor {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Labor .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Labor .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Labor .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Labor .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Labor .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Labor"],
.sheet-dropdown input[name="attr_Labor"] + span,
.sheet-dropdown input[name="attr_Labor"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Labor"],
.sheet-dropdown input[name="attr_Labor"] + span,
.sheet-dropdown input[name="attr_Labor"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Labor:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Labor:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Labor:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Labor:hover input[name="attr_Labor"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Labor:hover input[name="attr_Labor"] + span,
.sheet-dropdown .sheet-drop-attr_Labor:hover input[name="attr_Labor"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Labor:hover input[name="attr_Labor"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Labor:hover input[name="attr_Labor"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Labor:hover input[name="attr_Labor"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Labor"]:checked,
.sheet-dropdown input[name="attr_Labor"]:checked + span + label,
.sheet-dropdown input[name="attr_Labor"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Labor:not(:hover) input[name="attr_Labor"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Labor:not(:hover) input[name="attr_Labor"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Labor:not(:hover) input[name="attr_Labor"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Labor:not(:hover) input[name="attr_Labor"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Labor:not(:hover) input[name="attr_Labor"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Move {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Move .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Move .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Move .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Move .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Move .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Move"],
.sheet-dropdown input[name="attr_Move"] + span,
.sheet-dropdown input[name="attr_Move"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Move"],
.sheet-dropdown input[name="attr_Move"] + span,
.sheet-dropdown input[name="attr_Move"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Move:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Move:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Move:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Move:hover input[name="attr_Move"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Move:hover input[name="attr_Move"] + span,
.sheet-dropdown .sheet-drop-attr_Move:hover input[name="attr_Move"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Move:hover input[name="attr_Move"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Move:hover input[name="attr_Move"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Move:hover input[name="attr_Move"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Move"]:checked,
.sheet-dropdown input[name="attr_Move"]:checked + span + label,
.sheet-dropdown input[name="attr_Move"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Move:not(:hover) input[name="attr_Move"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Move:not(:hover) input[name="attr_Move"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Move:not(:hover) input[name="attr_Move"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Move:not(:hover) input[name="attr_Move"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Move:not(:hover) input[name="attr_Move"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Notice {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Notice .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Notice .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Notice .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Notice .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Notice .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Notice"],
.sheet-dropdown input[name="attr_Notice"] + span,
.sheet-dropdown input[name="attr_Notice"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Notice"],
.sheet-dropdown input[name="attr_Notice"] + span,
.sheet-dropdown input[name="attr_Notice"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Notice:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Notice:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Notice:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Notice:hover input[name="attr_Notice"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Notice:hover input[name="attr_Notice"] + span,
.sheet-dropdown .sheet-drop-attr_Notice:hover input[name="attr_Notice"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Notice:hover input[name="attr_Notice"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Notice:hover input[name="attr_Notice"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Notice:hover input[name="attr_Notice"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Notice"]:checked,
.sheet-dropdown input[name="attr_Notice"]:checked + span + label,
.sheet-dropdown input[name="attr_Notice"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Notice:not(:hover) input[name="attr_Notice"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Notice:not(:hover) input[name="attr_Notice"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Notice:not(:hover) input[name="attr_Notice"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Notice:not(:hover) input[name="attr_Notice"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Notice:not(:hover) input[name="attr_Notice"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Operate {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Operate .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Operate .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Operate .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Operate .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Operate .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Operate"],
.sheet-dropdown input[name="attr_Operate"] + span,
.sheet-dropdown input[name="attr_Operate"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Operate"],
.sheet-dropdown input[name="attr_Operate"] + span,
.sheet-dropdown input[name="attr_Operate"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Operate:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Operate:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Operate:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Operate:hover input[name="attr_Operate"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Operate:hover input[name="attr_Operate"] + span,
.sheet-dropdown .sheet-drop-attr_Operate:hover input[name="attr_Operate"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Operate:hover input[name="attr_Operate"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Operate:hover input[name="attr_Operate"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Operate:hover input[name="attr_Operate"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Operate"]:checked,
.sheet-dropdown input[name="attr_Operate"]:checked + span + label,
.sheet-dropdown input[name="attr_Operate"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Operate:not(:hover) input[name="attr_Operate"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Operate:not(:hover) input[name="attr_Operate"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Operate:not(:hover) input[name="attr_Operate"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Operate:not(:hover) input[name="attr_Operate"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Operate:not(:hover) input[name="attr_Operate"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Perform {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Perform .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Perform .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Perform .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Perform .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Perform .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Perform"],
.sheet-dropdown input[name="attr_Perform"] + span,
.sheet-dropdown input[name="attr_Perform"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Perform"],
.sheet-dropdown input[name="attr_Perform"] + span,
.sheet-dropdown input[name="attr_Perform"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Perform:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Perform:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Perform:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Perform:hover input[name="attr_Perform"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Perform:hover input[name="attr_Perform"] + span,
.sheet-dropdown .sheet-drop-attr_Perform:hover input[name="attr_Perform"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Perform:hover input[name="attr_Perform"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Perform:hover input[name="attr_Perform"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Perform:hover input[name="attr_Perform"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Perform"]:checked,
.sheet-dropdown input[name="attr_Perform"]:checked + span + label,
.sheet-dropdown input[name="attr_Perform"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Perform:not(:hover) input[name="attr_Perform"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Perform:not(:hover) input[name="attr_Perform"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Perform:not(:hover) input[name="attr_Perform"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Perform:not(:hover) input[name="attr_Perform"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Perform:not(:hover) input[name="attr_Perform"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Shoot {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Shoot .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Shoot .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Shoot .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Shoot .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Shoot .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Shoot"],
.sheet-dropdown input[name="attr_Shoot"] + span,
.sheet-dropdown input[name="attr_Shoot"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Shoot"],
.sheet-dropdown input[name="attr_Shoot"] + span,
.sheet-dropdown input[name="attr_Shoot"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Shoot:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Shoot:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Shoot:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Shoot:hover input[name="attr_Shoot"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Shoot:hover input[name="attr_Shoot"] + span,
.sheet-dropdown .sheet-drop-attr_Shoot:hover input[name="attr_Shoot"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Shoot:hover input[name="attr_Shoot"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Shoot:hover input[name="attr_Shoot"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Shoot:hover input[name="attr_Shoot"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Shoot"]:checked,
.sheet-dropdown input[name="attr_Shoot"]:checked + span + label,
.sheet-dropdown input[name="attr_Shoot"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Shoot:not(:hover) input[name="attr_Shoot"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Shoot:not(:hover) input[name="attr_Shoot"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Shoot:not(:hover) input[name="attr_Shoot"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Shoot:not(:hover) input[name="attr_Shoot"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Shoot:not(:hover) input[name="attr_Shoot"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Sneak {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Sneak .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Sneak .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Sneak .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Sneak .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Sneak .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Sneak"],
.sheet-dropdown input[name="attr_Sneak"] + span,
.sheet-dropdown input[name="attr_Sneak"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Sneak"],
.sheet-dropdown input[name="attr_Sneak"] + span,
.sheet-dropdown input[name="attr_Sneak"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Sneak:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Sneak:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Sneak:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Sneak:hover input[name="attr_Sneak"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Sneak:hover input[name="attr_Sneak"] + span,
.sheet-dropdown .sheet-drop-attr_Sneak:hover input[name="attr_Sneak"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Sneak:hover input[name="attr_Sneak"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Sneak:hover input[name="attr_Sneak"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Sneak:hover input[name="attr_Sneak"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Sneak"]:checked,
.sheet-dropdown input[name="attr_Sneak"]:checked + span + label,
.sheet-dropdown input[name="attr_Sneak"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Sneak:not(:hover) input[name="attr_Sneak"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Sneak:not(:hover) input[name="attr_Sneak"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Sneak:not(:hover) input[name="attr_Sneak"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Sneak:not(:hover) input[name="attr_Sneak"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Sneak:not(:hover) input[name="attr_Sneak"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Survive {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Survive .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Survive .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Survive .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Survive .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Survive .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Survive"],
.sheet-dropdown input[name="attr_Survive"] + span,
.sheet-dropdown input[name="attr_Survive"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Survive"],
.sheet-dropdown input[name="attr_Survive"] + span,
.sheet-dropdown input[name="attr_Survive"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Survive:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Survive:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Survive:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Survive:hover input[name="attr_Survive"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Survive:hover input[name="attr_Survive"] + span,
.sheet-dropdown .sheet-drop-attr_Survive:hover input[name="attr_Survive"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Survive:hover input[name="attr_Survive"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Survive:hover input[name="attr_Survive"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Survive:hover input[name="attr_Survive"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Survive"]:checked,
.sheet-dropdown input[name="attr_Survive"]:checked + span + label,
.sheet-dropdown input[name="attr_Survive"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Survive:not(:hover) input[name="attr_Survive"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Survive:not(:hover) input[name="attr_Survive"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Survive:not(:hover) input[name="attr_Survive"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Survive:not(:hover) input[name="attr_Survive"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Survive:not(:hover) input[name="attr_Survive"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Throw {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Throw .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Throw .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Throw .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Throw .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Throw .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Throw"],
.sheet-dropdown input[name="attr_Throw"] + span,
.sheet-dropdown input[name="attr_Throw"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Throw"],
.sheet-dropdown input[name="attr_Throw"] + span,
.sheet-dropdown input[name="attr_Throw"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Throw:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Throw:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Throw:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Throw:hover input[name="attr_Throw"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Throw:hover input[name="attr_Throw"] + span,
.sheet-dropdown .sheet-drop-attr_Throw:hover input[name="attr_Throw"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Throw:hover input[name="attr_Throw"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Throw:hover input[name="attr_Throw"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Throw:hover input[name="attr_Throw"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Throw"]:checked,
.sheet-dropdown input[name="attr_Throw"]:checked + span + label,
.sheet-dropdown input[name="attr_Throw"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Throw:not(:hover) input[name="attr_Throw"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Throw:not(:hover) input[name="attr_Throw"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Throw:not(:hover) input[name="attr_Throw"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Throw:not(:hover) input[name="attr_Throw"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Throw:not(:hover) input[name="attr_Throw"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Treat {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Treat .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Treat .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Treat .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Treat .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Treat .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Treat"],
.sheet-dropdown input[name="attr_Treat"] + span,
.sheet-dropdown input[name="attr_Treat"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Treat"],
.sheet-dropdown input[name="attr_Treat"] + span,
.sheet-dropdown input[name="attr_Treat"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Treat:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Treat:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Treat:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Treat:hover input[name="attr_Treat"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Treat:hover input[name="attr_Treat"] + span,
.sheet-dropdown .sheet-drop-attr_Treat:hover input[name="attr_Treat"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Treat:hover input[name="attr_Treat"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Treat:hover input[name="attr_Treat"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Treat:hover input[name="attr_Treat"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Treat"]:checked,
.sheet-dropdown input[name="attr_Treat"]:checked + span + label,
.sheet-dropdown input[name="attr_Treat"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Treat:not(:hover) input[name="attr_Treat"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Treat:not(:hover) input[name="attr_Treat"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Treat:not(:hover) input[name="attr_Treat"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Treat:not(:hover) input[name="attr_Treat"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Treat:not(:hover) input[name="attr_Treat"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Trick {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-attr_Trick .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Trick .sheet-value-2 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Trick .sheet-value-3 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Trick .sheet-value-4 {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Trick .sheet-value-5 {
display: none;
}
.sheet-dropdown input[name="attr_Trick"],
.sheet-dropdown input[name="attr_Trick"] + span,
.sheet-dropdown input[name="attr_Trick"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_Trick"],
.sheet-dropdown input[name="attr_Trick"] + span,
.sheet-dropdown input[name="attr_Trick"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-attr_Trick:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-attr_Trick:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Trick:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-attr_Trick:hover input[name="attr_Trick"] {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Trick:hover input[name="attr_Trick"] + span,
.sheet-dropdown .sheet-drop-attr_Trick:hover input[name="attr_Trick"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Trick:hover input[name="attr_Trick"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-attr_Trick:hover input[name="attr_Trick"]:checked + span,
.sheet-dropdown .sheet-drop-attr_Trick:hover input[name="attr_Trick"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_Trick"]:checked,
.sheet-dropdown input[name="attr_Trick"]:checked + span + label,
.sheet-dropdown input[name="attr_Trick"]:checked + label {
display: none;
}
.sheet-dropdown .sheet-drop-attr_Trick:not(:hover) input[name="attr_Trick"][value="4"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Trick:not(:hover) input[name="attr_Trick"][value="6"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Trick:not(:hover) input[name="attr_Trick"][value="8"]:checked ~ .sheet-value-3 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Trick:not(:hover) input[name="attr_Trick"][value="10"]:checked ~ .sheet-value-4 {
display: block;
}
.sheet-dropdown .sheet-drop-attr_Trick:not(:hover) input[name="attr_Trick"][value="12"]:checked ~ .sheet-value-5 {
display: block;
}
.sheet-dropdown .sheet-drop-sigasset {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-sigasset .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-sigasset .sheet-value-2 {
display: none;
}
.sheet-dropdown input[name="attr_sigasset_value"],
.sheet-dropdown input[name="attr_sigasset_value"] + span,
.sheet-dropdown input[name="attr_sigasset_value"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_sigasset_value"],
.sheet-dropdown input[name="attr_sigasset_value"] + span,
.sheet-dropdown input[name="attr_sigasset_value"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-sigasset:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-sigasset:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-sigasset:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_sigasset_value"] {
display: inline;
}
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_sigasset_value"] + span,
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_sigasset_value"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_sigasset_value"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_sigasset_value"]:checked + span,
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_sigasset_value"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_sigasset_value"]:checked,
.sheet-dropdown input[name="attr_sigasset_value"]:checked + span,
.sheet-dropdown input[name="attr_sigasset_value"]:checked + span + label {
display: none;
}
.sheet-dropdown .sheet-drop-sigasset:not(:hover) input[name="attr_sigasset_mark"] ~ input[name="attr_sigasset_value"][value="6"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-sigasset:not(:hover) input[name="attr_sigasset_mark"] ~ input[name="attr_sigasset_value"][value="8"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-sigasset {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-sigasset .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-sigasset .sheet-value-2 {
display: none;
}
.sheet-dropdown input[name="attr_0_repeating_sigassets_sigasset_value"],
.sheet-dropdown input[name="attr_0_repeating_sigassets_sigasset_value"] + span,
.sheet-dropdown input[name="attr_0_repeating_sigassets_sigasset_value"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_0_repeating_sigassets_sigasset_value"],
.sheet-dropdown input[name="attr_0_repeating_sigassets_sigasset_value"] + span,
.sheet-dropdown input[name="attr_0_repeating_sigassets_sigasset_value"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-sigasset:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-sigasset:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-sigasset:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_0_repeating_sigassets_sigasset_value"] {
display: inline;
}
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_0_repeating_sigassets_sigasset_value"] + span,
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_0_repeating_sigassets_sigasset_value"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_0_repeating_sigassets_sigasset_value"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_0_repeating_sigassets_sigasset_value"]:checked + span,
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_0_repeating_sigassets_sigasset_value"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_0_repeating_sigassets_sigasset_value"]:checked,
.sheet-dropdown input[name="attr_0_repeating_sigassets_sigasset_value"]:checked + span,
.sheet-dropdown input[name="attr_0_repeating_sigassets_sigasset_value"]:checked + span + label {
display: none;
}
.sheet-dropdown .sheet-drop-sigasset:not(:hover) input[name="attr_0_repeating_sigassets_sigasset_mark"] ~ input[name="attr_0_repeating_sigassets_sigasset_value"][value="6"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-sigasset:not(:hover) input[name="attr_0_repeating_sigassets_sigasset_mark"] ~ input[name="attr_0_repeating_sigassets_sigasset_value"][value="8"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-sigasset {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-sigasset .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-sigasset .sheet-value-2 {
display: none;
}
.sheet-dropdown input[name="attr_1_repeating_sigassets_sigasset_value"],
.sheet-dropdown input[name="attr_1_repeating_sigassets_sigasset_value"] + span,
.sheet-dropdown input[name="attr_1_repeating_sigassets_sigasset_value"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_1_repeating_sigassets_sigasset_value"],
.sheet-dropdown input[name="attr_1_repeating_sigassets_sigasset_value"] + span,
.sheet-dropdown input[name="attr_1_repeating_sigassets_sigasset_value"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-sigasset:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-sigasset:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-sigasset:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_1_repeating_sigassets_sigasset_value"] {
display: inline;
}
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_1_repeating_sigassets_sigasset_value"] + span,
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_1_repeating_sigassets_sigasset_value"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_1_repeating_sigassets_sigasset_value"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_1_repeating_sigassets_sigasset_value"]:checked + span,
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_1_repeating_sigassets_sigasset_value"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_1_repeating_sigassets_sigasset_value"]:checked,
.sheet-dropdown input[name="attr_1_repeating_sigassets_sigasset_value"]:checked + span,
.sheet-dropdown input[name="attr_1_repeating_sigassets_sigasset_value"]:checked + span + label {
display: none;
}
.sheet-dropdown .sheet-drop-sigasset:not(:hover) input[name="attr_1_repeating_sigassets_sigasset_mark"] ~ input[name="attr_1_repeating_sigassets_sigasset_value"][value="6"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-sigasset:not(:hover) input[name="attr_1_repeating_sigassets_sigasset_mark"] ~ input[name="attr_1_repeating_sigassets_sigasset_value"][value="8"]:checked ~ .sheet-value-2 {
display: block;
}
.sheet-dropdown .sheet-drop-sigasset {
display: inline-block;
vertical-align: middle;
text-align: left;
}
.sheet-dropdown .sheet-drop-sigasset .sheet-value-1 {
display: none;
}
.sheet-dropdown .sheet-drop-sigasset .sheet-value-2 {
display: none;
}
.sheet-dropdown input[name="attr_2_repeating_sigassets_sigasset_value"],
.sheet-dropdown input[name="attr_2_repeating_sigassets_sigasset_value"] + span,
.sheet-dropdown input[name="attr_2_repeating_sigassets_sigasset_value"] + span + label {
display: none;
}
.sheet-dropdown input[name="attr_2_repeating_sigassets_sigasset_value"],
.sheet-dropdown input[name="attr_2_repeating_sigassets_sigasset_value"] + span,
.sheet-dropdown input[name="attr_2_repeating_sigassets_sigasset_value"] + span + label {
z-index: 1;
}
.sheet-dropdown .sheet-drop-sigasset:hover {
position: absolute;
width: 80px;
z-index: 1;
background-color: #a1a8c2;
padding: 5px;
}
.sheet-dropdown .sheet-drop-sigasset:hover:before {
content: "";
position: absolute;
top: 0px;
left: -7px;
bottom: 0;
border-top: 7px solid transparent;
border-right: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-sigasset:hover:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
right: -7px;
border-top: 7px solid transparent;
border-left: 8px solid #a1a8c2;
border-bottom: 7px solid transparent;
}
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_2_repeating_sigassets_sigasset_value"] {
display: inline;
}
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_2_repeating_sigassets_sigasset_value"] + span,
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_2_repeating_sigassets_sigasset_value"] + span + label {
display: inline;
}
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_2_repeating_sigassets_sigasset_value"]:checked {
display: inline;
}
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_2_repeating_sigassets_sigasset_value"]:checked + span,
.sheet-dropdown .sheet-drop-sigasset:hover input[name="attr_2_repeating_sigassets_sigasset_value"]:checked + span + label {
display: inline;
}
.sheet-dropdown input[name="attr_2_repeating_sigassets_sigasset_value"]:checked,
.sheet-dropdown input[name="attr_2_repeating_sigassets_sigasset_value"]:checked + span,
.sheet-dropdown input[name="attr_2_repeating_sigassets_sigasset_value"]:checked + span + label {
display: none;
}
.sheet-dropdown .sheet-drop-sigasset:not(:hover) input[name="attr_2_repeating_sigassets_sigasset_mark"] ~ input[name="attr_2_repeating_sigassets_sigasset_value"][value="6"]:checked ~ .sheet-value-1 {
display: block;
}
.sheet-dropdown .sheet-drop-sigasset:not(:hover) input[name="attr_2_repeating_sigassets_sigasset_mark"] ~ input[name="attr_2_repeating_sigassets_sigasset_value"][value="8"]:checked ~ .sheet-value-2 {
display: block;
}
|
kcopper8/RPGSheet
|
sheets/Firefly/firefly.css
|
CSS
|
mit
| 97,088
|
<?php
/**
* @file
* Contains \Drupal\ckeditor\Plugin\CKEditorPlugin\Internal.
*/
namespace Drupal\ckeditor\Plugin\CKEditorPlugin;
use Drupal\ckeditor\CKEditorPluginBase;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\editor\Entity\Editor;
use Drupal\filter\Plugin\FilterInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Defines the "internal" plugin (i.e. core plugins part of our CKEditor build).
*
* @CKEditorPlugin(
* id = "internal",
* label = @Translation("CKEditor core")
* )
*/
class Internal extends CKEditorPluginBase implements ContainerFactoryPluginInterface {
/**
* The cache backend.
*
* @var \Drupal\Core\Cache\CacheBackendInterface
*/
protected $cache;
/**
* Constructs a \Drupal\ckeditor\Plugin\CKEditorPlugin\Internal object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
* The cache backend.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, CacheBackendInterface $cache_backend) {
$this->cache = $cache_backend;
parent::__construct($configuration, $plugin_id, $plugin_definition);
}
/**
* Creates an instance of the plugin.
*
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container
* The container to pull out services used in the plugin.
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin ID for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
*
* @return static
* Returns an instance of this plugin.
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('cache.default')
);
}
/**
* Implements \Drupal\ckeditor\Plugin\CKEditorPluginInterface::isInternal().
*/
public function isInternal() {
return TRUE;
}
/**
* Implements \Drupal\ckeditor\Plugin\CKEditorPluginInterface::getFile().
*/
public function getFile() {
// This plugin is already part of Drupal core's CKEditor build.
return FALSE;
}
/**
* Implements \Drupal\ckeditor\Plugin\CKEditorPluginInterface::getConfig().
*/
public function getConfig(Editor $editor) {
// Reasonable defaults that provide expected basic behavior.
$config = array(
'customConfig' => '', // Don't load CKEditor's config.js file.
'pasteFromWordPromptCleanup' => TRUE,
'resize_dir' => 'vertical',
'justifyClasses' => array('text-align-left', 'text-align-center', 'text-align-right', 'text-align-justify'),
'entities' => FALSE,
);
// Add the allowedContent setting, which ensures CKEditor only allows tags
// and attributes that are allowed by the text format for this text editor.
list($config['allowedContent'], $config['disallowedContent']) = $this->generateACFSettings($editor);
// Add the format_tags setting, if its button is enabled.
$toolbar_rows = array();
$settings = $editor->getSettings();
foreach ($settings['toolbar']['rows'] as $row_number => $row) {
$toolbar_rows[] = array_reduce($settings['toolbar']['rows'][$row_number], function (&$result, $button_group) {
return array_merge($result, $button_group['items']);
}, array());
}
$toolbar_buttons = array_unique(NestedArray::mergeDeepArray($toolbar_rows));
if (in_array('Format', $toolbar_buttons)) {
$config['format_tags'] = $this->generateFormatTagsSetting($editor);
}
return $config;
}
/**
* Implements \Drupal\ckeditor\Plugin\CKEditorPluginButtonsInterface::getButtons().
*/
public function getButtons() {
$button = function($name, $direction = 'ltr') {
return '<a href="#" class="cke-icon-only cke_' . $direction . '" role="button" title="' . $name . '" aria-label="' . $name . '"><span class="cke_button_icon cke_button__' . str_replace(' ', '', $name) . '_icon">' . $name . '</span></a>';
};
return array(
// "basicstyles" plugin.
'Bold' => array(
'label' => t('Bold'),
'image_alternative' => $button('bold'),
),
'Italic' => array(
'label' => t('Italic'),
'image_alternative' => $button('italic'),
),
'Underline' => array(
'label' => t('Underline'),
'image_alternative' => $button('underline'),
),
'Strike' => array(
'label' => t('Strike-through'),
'image_alternative' => $button('strike'),
),
'Superscript' => array(
'label' => t('Superscript'),
'image_alternative' => $button('super script'),
),
'Subscript' => array(
'label' => t('Subscript'),
'image_alternative' => $button('sub script'),
),
// "removeformat" plugin.
'RemoveFormat' => array(
'label' => t('Remove format'),
'image_alternative' => $button('remove format'),
),
// "justify" plugin.
'JustifyLeft' => array(
'label' => t('Align left'),
'image_alternative' => $button('justify left'),
),
'JustifyCenter' => array(
'label' => t('Align center'),
'image_alternative' => $button('justify center'),
),
'JustifyRight' => array(
'label' => t('Align right'),
'image_alternative' => $button('justify right'),
),
'JustifyBlock' => array(
'label' => t('Justify'),
'image_alternative' => $button('justify block'),
),
// "list" plugin.
'BulletedList' => array(
'label' => t('Bullet list'),
'image_alternative' => $button('bulleted list'),
'image_alternative_rtl' => $button('bulleted list', 'rtl'),
),
'NumberedList' => array(
'label' => t('Numbered list'),
'image_alternative' => $button('numbered list'),
'image_alternative_rtl' => $button('numbered list', 'rtl'),
),
// "indent" plugin.
'Outdent' => array(
'label' => t('Outdent'),
'image_alternative' => $button('outdent'),
'image_alternative_rtl' => $button('outdent', 'rtl'),
),
'Indent' => array(
'label' => t('Indent'),
'image_alternative' => $button('indent'),
'image_alternative_rtl' => $button('indent', 'rtl'),
),
// "undo" plugin.
'Undo' => array(
'label' => t('Undo'),
'image_alternative' => $button('undo'),
'image_alternative_rtl' => $button('undo', 'rtl'),
),
'Redo' => array(
'label' => t('Redo'),
'image_alternative' => $button('redo'),
'image_alternative_rtl' => $button('redo', 'rtl'),
),
// "blockquote" plugin.
'Blockquote' => array(
'label' => t('Blockquote'),
'image_alternative' => $button('blockquote'),
),
// "horizontalrule" plugin
'HorizontalRule' => array(
'label' => t('Horizontal rule'),
'image_alternative' => $button('horizontal rule'),
),
// "clipboard" plugin.
'Cut' => array(
'label' => t('Cut'),
'image_alternative' => $button('cut'),
'image_alternative_rtl' => $button('cut', 'rtl'),
),
'Copy' => array(
'label' => t('Copy'),
'image_alternative' => $button('copy'),
'image_alternative_rtl' => $button('copy', 'rtl'),
),
'Paste' => array(
'label' => t('Paste'),
'image_alternative' => $button('paste'),
'image_alternative_rtl' => $button('paste', 'rtl'),
),
// "pastetext" plugin.
'PasteText' => array(
'label' => t('Paste Text'),
'image_alternative' => $button('paste text'),
'image_alternative_rtl' => $button('paste text', 'rtl'),
),
// "pastefromword" plugin.
'PasteFromWord' => array(
'label' => t('Paste from Word'),
'image_alternative' => $button('paste from word'),
'image_alternative_rtl' => $button('paste from word', 'rtl'),
),
// "specialchar" plugin.
'SpecialChar' => array(
'label' => t('Character map'),
'image_alternative' => $button('special char'),
),
'Format' => array(
'label' => t('HTML block format'),
'image_alternative' => '<a href="#" role="button" aria-label="' . t('Format') . '"><span class="ckeditor-button-dropdown">' . t('Format') . '<span class="ckeditor-button-arrow"></span></span></a>',
),
// "table" plugin.
'Table' => array(
'label' => t('Table'),
'image_alternative' => $button('table'),
),
// "showblocks" plugin.
'ShowBlocks' => array(
'label' => t('Show blocks'),
'image_alternative' => $button('show blocks'),
'image_alternative_rtl' => $button('show blocks', 'rtl'),
),
// "sourcearea" plugin.
'Source' => array(
'label' => t('Source code'),
'image_alternative' => $button('source'),
),
// "maximize" plugin.
'Maximize' => array(
'label' => t('Maximize'),
'image_alternative' => $button('maximize'),
),
// No plugin, separator "button" for toolbar builder UI use only.
'-' => array(
'label' => t('Separator'),
'image_alternative' => '<a href="#" role="button" aria-label="' . t('Button separator') . '" class="ckeditor-separator"></a>',
'attributes' => array(
'class' => array('ckeditor-button-separator'),
'data-drupal-ckeditor-type' => 'separator',
),
'multiple' => TRUE,
),
);
}
/**
* Builds the "format_tags" configuration part of the CKEditor JS settings.
*
* @see getConfig()
*
* @param \Drupal\editor\Entity\Editor $editor
* A configured text editor object.
*
* @return array
* An array containing the "format_tags" configuration.
*
* @see ckeditor_rebuild()
* @see ckeditor_filter_format_insert()
* @see ckeditor_filter_format_update()
*/
protected function generateFormatTagsSetting(Editor $editor) {
// When no text format is associated yet, assume no tag is allowed.
// @see \Drupal\Editor\EditorInterface::hasAssociatedFilterFormat()
if (!$editor->hasAssociatedFilterFormat()) {
return array();
}
$format = $editor->getFilterFormat();
// The <p> tag is always allowed — HTML without <p> tags is nonsensical.
$default = 'p';
return \Drupal::state()->get('ckeditor_internal_format_tags:' . $format->id(), $default);
}
/**
* Builds the ACF part of the CKEditor JS settings.
*
* This ensures that CKEditor obeys the HTML restrictions defined by Drupal's
* filter system, by enabling CKEditor's Advanced Content Filter (ACF)
* functionality: http://ckeditor.com/blog/CKEditor-4.1-RC-Released.
*
* @see getConfig()
*
* @param \Drupal\editor\Entity\Editor $editor
* A configured text editor object.
*
* @return array
* An array with two values:
* - the first value is the "allowedContent" setting: a well-formatted array
* or TRUE. The latter indicates that anything is allowed.
* - the second value is the "disallowedContent" setting: a well-formatted
* array or FALSE. The latter indicates that nothing is disallowed.
*/
protected function generateACFSettings(Editor $editor) {
// When no text format is associated yet, assume nothing is disallowed, so
// set allowedContent to true.
if (!$editor->hasAssociatedFilterFormat()) {
return TRUE;
}
$format = $editor->getFilterFormat();
$filter_types = $format->getFilterTypes();
// When nothing is disallowed, set allowedContent to true.
if (!in_array(FilterInterface::TYPE_HTML_RESTRICTOR, $filter_types)) {
return array(TRUE, FALSE);
}
// Generate setting that accurately reflects allowed tags and attributes.
else {
$get_attribute_values = function($attribute_values, $allowed_values) {
$values = array_keys(array_filter($attribute_values, function($value) use ($allowed_values) {
if ($allowed_values) {
return $value !== FALSE;
}
else {
return $value === FALSE;
}
}));
if (count($values)) {
return implode(',', $values);
}
else {
return NULL;
}
};
$html_restrictions = $format->getHtmlRestrictions();
// When all HTML is allowed, also set allowedContent to true and
// disallowedContent to false.
if ($html_restrictions === FALSE) {
return array(TRUE, FALSE);
}
$allowed = array();
$disallowed = array();
if (isset($html_restrictions['forbidden_tags'])) {
foreach ($html_restrictions['forbidden_tags'] as $tag) {
$disallowed[$tag] = TRUE;
}
}
foreach ($html_restrictions['allowed'] as $tag => $attributes) {
// Tell CKEditor the tag is allowed, but no attributes.
if ($attributes === FALSE) {
$allowed[$tag] = array(
'attributes' => FALSE,
'styles' => FALSE,
'classes' => FALSE,
);
}
// Tell CKEditor the tag is allowed, as well as any attribute on it. The
// "style" and "class" attributes are handled separately by CKEditor:
// they are disallowed even if you specify it in the list of allowed
// attributes, unless you state specific values for them that are
// allowed. Or, in this case: any value for them is allowed.
elseif ($attributes === TRUE) {
$allowed[$tag] = array(
'attributes' => TRUE,
'styles' => TRUE,
'classes' => TRUE,
);
// We've just marked that any value for the "style" and "class"
// attributes is allowed. However, that may not be the case: the "*"
// tag may still apply restrictions.
// Since CKEditor's ACF follows the following principle:
// Once validated, an element or its property cannot be
// invalidated by another rule.
// That means that the most permissive setting wins. Which means that
// it will still be allowed by CKEditor to e.g. define any style, no
// matter what the "*" tag's restrictions may be. If there's a setting
// for either the "style" or "class" attribute, it cannot possibly be
// more permissive than what was set above. Hence: inherit from the
// "*" tag where possible.
if (isset($html_restrictions['allowed']['*'])) {
$wildcard = $html_restrictions['allowed']['*'];
if (isset($wildcard['style'])) {
if (!is_array($wildcard['style'])) {
$allowed[$tag]['styles'] = $wildcard['style'];
}
else {
$allowed_styles = $get_attribute_values($wildcard['style'], TRUE);
if (isset($allowed_styles)) {
$allowed[$tag]['styles'] = $allowed_styles;
}
else {
unset($allowed[$tag]['styles']);
}
}
}
if (isset($wildcard['class'])) {
if (!is_array($wildcard['class'])) {
$allowed[$tag]['classes'] = $wildcard['class'];
}
else {
$allowed_classes = $get_attribute_values($wildcard['class'], TRUE);
if (isset($allowed_classes)) {
$allowed[$tag]['classes'] = $allowed_classes;
}
else {
unset($allowed[$tag]['classes']);
}
}
}
}
}
// Tell CKEditor the tag is allowed, along with some tags.
elseif (is_array($attributes)) {
// Configure allowed attributes, allowed "style" attribute values and
// allowed "class" attribute values.
// CKEditor only allows specific values for the "class" and "style"
// attributes; so ignore restrictions on other attributes, which
// Drupal filters may provide.
// NOTE: A Drupal contrib module can subclass this class, override the
// getConfig() method, and override the JavaScript at
// Drupal.editors.ckeditor to somehow make validation of values for
// attributes other than "class" and "style" work.
$allowed_attributes = array_filter($attributes, function($value) {
return $value !== FALSE;
});
if (count($allowed_attributes)) {
$allowed[$tag]['attributes'] = implode(',', array_keys($allowed_attributes));
}
if (isset($allowed_attributes['style']) && is_array($allowed_attributes['style'])) {
$allowed_styles = $get_attribute_values($allowed_attributes['style'], TRUE);
if (isset($allowed_styles)) {
$allowed[$tag]['styles'] = $allowed_styles;
}
}
if (isset($allowed_attributes['class']) && is_array($allowed_attributes['class'])) {
$allowed_classes = $get_attribute_values($allowed_attributes['class'], TRUE);
if (isset($allowed_classes)) {
$allowed[$tag]['classes'] = $allowed_classes;
}
}
// Handle disallowed attributes analogously. However, to handle *dis-
// allowed* attribute values, we must look at *allowed* attributes'
// disallowed attribute values! After all, a disallowed attribute
// implies that all of its possible attribute values are disallowed,
// thus we must look at the disallowed attribute values on allowed
// attributes.
$disallowed_attributes = array_filter($attributes, function($value) {
return $value === FALSE;
});
if (count($disallowed_attributes)) {
// No need to blacklist the 'class' or 'style' attributes; CKEditor
// handles them separately (if no specific class or style attribute
// values are allowed, then those attributes are disallowed).
if (isset($disallowed_attributes['class'])) {
unset($disallowed_attributes['class']);
}
if (isset($disallowed_attributes['style'])) {
unset($disallowed_attributes['style']);
}
$disallowed[$tag]['attributes'] = implode(',', array_keys($disallowed_attributes));
}
if (isset($allowed_attributes['style']) && is_array($allowed_attributes['style'])) {
$disallowed_styles = $get_attribute_values($allowed_attributes['style'], FALSE);
if (isset($disallowed_styles)) {
$disallowed[$tag]['styles'] = $disallowed_styles;
}
}
if (isset($allowed_attributes['class']) && is_array($allowed_attributes['class'])) {
$disallowed_classes = $get_attribute_values($allowed_attributes['class'], FALSE);
if (isset($disallowed_classes)) {
$disallowed[$tag]['classes'] = $disallowed_classes;
}
}
}
}
return array($allowed, $disallowed);
}
}
}
|
casivaagustin/drupalcon-mentoring
|
src/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php
|
PHP
|
mit
| 19,873
|
/** @file mlan_join.h
*
* @brief This file defines the interface for the WLAN infrastructure
* and adhoc join routines.
*
* Driver interface functions and type declarations for the join module
* implemented in mlan_join.c. Process all start/join requests for
* both adhoc and infrastructure networks
*
* Copyright (C) 2008-2011, Marvell International Ltd.
*
* This software file (the "File") is distributed by Marvell International
* Ltd. under the terms of the GNU General Public License Version 2, June 1991
* (the "License"). You may use, redistribute and/or modify this File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*/
/******************************************************
Change log:
10/13/2008: initial version
******************************************************/
#ifndef _MLAN_JOIN_H_
#define _MLAN_JOIN_H_
/** Size of buffer allocated to store the association response from firmware */
#define MRVDRV_ASSOC_RSP_BUF_SIZE 500
/** Size of buffer allocated to store IEs passed to firmware in the assoc req */
#define MRVDRV_GENIE_BUF_SIZE 256
#endif /* _MLAN_JOIN_H_ */
|
FG6Q-Dev/android_kernel_quanta_fg6q
|
drivers/net/wireless/sd8897/mlan/mlan_join.h
|
C
|
gpl-2.0
| 1,634
|
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package fake
import (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
extensions "k8s.io/kubernetes/pkg/apis/extensions"
core "k8s.io/kubernetes/pkg/client/testing/core"
labels "k8s.io/kubernetes/pkg/labels"
watch "k8s.io/kubernetes/pkg/watch"
)
// FakeIngresses implements IngressInterface
type FakeIngresses struct {
Fake *FakeExtensions
ns string
}
var ingressesResource = unversioned.GroupVersionResource{Group: "extensions", Version: "", Resource: "ingresses"}
func (c *FakeIngresses) Create(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(ingressesResource, c.ns, ingress), &extensions.Ingress{})
if obj == nil {
return nil, err
}
return obj.(*extensions.Ingress), err
}
func (c *FakeIngresses) Update(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(ingressesResource, c.ns, ingress), &extensions.Ingress{})
if obj == nil {
return nil, err
}
return obj.(*extensions.Ingress), err
}
func (c *FakeIngresses) UpdateStatus(ingress *extensions.Ingress) (*extensions.Ingress, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(ingressesResource, "status", c.ns, ingress), &extensions.Ingress{})
if obj == nil {
return nil, err
}
return obj.(*extensions.Ingress), err
}
func (c *FakeIngresses) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(ingressesResource, c.ns, name), &extensions.Ingress{})
return err
}
func (c *FakeIngresses) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := core.NewDeleteCollectionAction(ingressesResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &extensions.IngressList{})
return err
}
func (c *FakeIngresses) Get(name string) (result *extensions.Ingress, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(ingressesResource, c.ns, name), &extensions.Ingress{})
if obj == nil {
return nil, err
}
return obj.(*extensions.Ingress), err
}
func (c *FakeIngresses) List(opts api.ListOptions) (result *extensions.IngressList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(ingressesResource, c.ns, opts), &extensions.IngressList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &extensions.IngressList{}
for _, item := range obj.(*extensions.IngressList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested ingresses.
func (c *FakeIngresses) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(ingressesResource, c.ns, opts))
}
// Patch applies the patch and returns the patched ingress.
func (c *FakeIngresses) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *extensions.Ingress, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(ingressesResource, c.ns, name, data, subresources...), &extensions.Ingress{})
if obj == nil {
return nil, err
}
return obj.(*extensions.Ingress), err
}
|
tangfeixiong/dashboard
|
vendor/k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/internalversion/fake/fake_ingress.go
|
GO
|
apache-2.0
| 3,931
|
/*
* Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2009 Anthony Ricaud <rik@webkit.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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.
*/
.panel-enabler-view {
z-index: 1000;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: white;
font-size: 13px;
text-align: center;
overflow-x: hidden;
overflow-y: overlay;
display: none;
}
.panel-enabler-view.visible {
display: block;
}
.panel-enabler-view .panel-enabler-view-content {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
max-height: 390px;
margin: auto;
white-space: nowrap;
}
.panel-enabler-view h1 {
color: rgb(110, 116, 128);
font-size: 16px;
line-height: 20px;
font-weight: normal;
margin-top: 0;
}
.panel-enabler-disclaimer {
font-size: 10px;
color: rgb(110, 116, 128);
margin-bottom: 12px;
margin-left: 20px;
}
.panel-enabler-disclaimer:empty {
display: none;
}
.panel-enabler-view img {
height: 100%;
min-height: 200px;
max-width: 100%;
top: 0;
bottom: 0;
padding: 20px 0 20px 20px;
margin: auto;
vertical-align: middle;
}
.panel-enabler-view img.hidden {
display: initial !important;
width: 0;
}
.panel-enabler-view .flexible-space {
-webkit-box-flex: 1;
}
.panel-enabler-view form {
display: inline-block;
vertical-align: middle;
width: 330px;
margin: 0;
padding: 15px;
white-space: normal;
}
.panel-enabler-view label {
position: relative;
display: block;
text-align: left;
word-break: break-word;
margin: 0 0 5px 20px;
}
.panel-enabler-view button:not(.status-bar-item) {
font-size: 13px;
margin: 6px 0 0 0;
padding: 3px 20px;
height: 24px;
color: rgb(6, 6, 6);
background-color: transparent;
border: 1px solid rgb(165, 165, 165);
background-color: rgb(237, 237, 237);
background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(252, 252, 252)), to(rgb(223, 223, 223)));
-webkit-border-radius: 12px;
-webkit-appearance: none;
}
body.inactive .panel-enabler-view button, .panel-enabler-view button:disabled {
color: rgb(130, 130, 130);
border-color: rgb(212, 212, 212);
background-color: rgb(239, 239, 239);
background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(250, 250, 250)), to(rgb(235, 235, 235)));
}
.panel-enabler-view input[type="radio"] {
height: 17px;
width: 17px;
border: 1px solid rgb(165, 165, 165);
background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(252, 252, 252)), to(rgb(223, 223, 223)));
-webkit-border-radius: 8px;
-webkit-appearance: none;
vertical-align: middle;
margin: 0 5px 5px 0;
}
.panel-enabler-view input[type="radio"]:active:not(:disabled) {
background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(194, 194, 194)), to(rgb(239, 239, 239)));
}
.panel-enabler-view input[type="radio"]:checked {
background: url(Images/radioDot.png) center no-repeat,
-webkit-gradient(linear, left top, left bottom, from(rgb(252, 252, 252)), to(rgb(223, 223, 223)));
}
.panel-enabler-view input[type="radio"]:checked:active {
background: url(Images/radioDot.png) center no-repeat,
-webkit-gradient(linear, left top, left bottom, from(rgb(194, 194, 194)), to(rgb(239, 239, 239)));
}
.panel-enabler-view.scripts img {
content: url(Images/scriptsSilhouette.png);
}
.panel-enabler-view.profiles img {
content: url(Images/profilesSilhouette.png);
}
|
VikingsYip/webkitdotnet
|
webkit/WebKit.resources/inspector/panelEnablerView.css
|
CSS
|
bsd-2-clause
| 5,100
|
/*
* Copyright 2015 Simon Arlott
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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.
*
* Derived from bcm63138_nand.c:
* Copyright © 2015 Broadcom Corporation
*
* Derived from bcm963xx_4.12L.06B_consumer/shared/opensource/include/bcm963xx/63268_map_part.h:
* Copyright 2000-2010 Broadcom Corporation
*
* Derived from bcm963xx_4.12L.06B_consumer/shared/opensource/flash/nandflash.c:
* Copyright 2000-2010 Broadcom Corporation
*/
#include <linux/device.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include "brcmnand.h"
struct bcm6368_nand_soc {
struct brcmnand_soc soc;
void __iomem *base;
};
#define BCM6368_NAND_INT 0x00
#define BCM6368_NAND_STATUS_SHIFT 0
#define BCM6368_NAND_STATUS_MASK (0xfff << BCM6368_NAND_STATUS_SHIFT)
#define BCM6368_NAND_ENABLE_SHIFT 16
#define BCM6368_NAND_ENABLE_MASK (0xffff << BCM6368_NAND_ENABLE_SHIFT)
#define BCM6368_NAND_BASE_ADDR0 0x04
#define BCM6368_NAND_BASE_ADDR1 0x0c
enum {
BCM6368_NP_READ = BIT(0),
BCM6368_BLOCK_ERASE = BIT(1),
BCM6368_COPY_BACK = BIT(2),
BCM6368_PAGE_PGM = BIT(3),
BCM6368_CTRL_READY = BIT(4),
BCM6368_DEV_RBPIN = BIT(5),
BCM6368_ECC_ERR_UNC = BIT(6),
BCM6368_ECC_ERR_CORR = BIT(7),
};
static bool bcm6368_nand_intc_ack(struct brcmnand_soc *soc)
{
struct bcm6368_nand_soc *priv =
container_of(soc, struct bcm6368_nand_soc, soc);
void __iomem *mmio = priv->base + BCM6368_NAND_INT;
u32 val = brcmnand_readl(mmio);
if (val & (BCM6368_CTRL_READY << BCM6368_NAND_STATUS_SHIFT)) {
/* Ack interrupt */
val &= ~BCM6368_NAND_STATUS_MASK;
val |= BCM6368_CTRL_READY << BCM6368_NAND_STATUS_SHIFT;
brcmnand_writel(val, mmio);
return true;
}
return false;
}
static void bcm6368_nand_intc_set(struct brcmnand_soc *soc, bool en)
{
struct bcm6368_nand_soc *priv =
container_of(soc, struct bcm6368_nand_soc, soc);
void __iomem *mmio = priv->base + BCM6368_NAND_INT;
u32 val = brcmnand_readl(mmio);
/* Don't ack any interrupts */
val &= ~BCM6368_NAND_STATUS_MASK;
if (en)
val |= BCM6368_CTRL_READY << BCM6368_NAND_ENABLE_SHIFT;
else
val &= ~(BCM6368_CTRL_READY << BCM6368_NAND_ENABLE_SHIFT);
brcmnand_writel(val, mmio);
}
static int bcm6368_nand_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct bcm6368_nand_soc *priv;
struct brcmnand_soc *soc;
struct resource *res;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
soc = &priv->soc;
res = platform_get_resource_byname(pdev,
IORESOURCE_MEM, "nand-int-base");
priv->base = devm_ioremap_resource(dev, res);
if (IS_ERR(priv->base))
return PTR_ERR(priv->base);
soc->ctlrdy_ack = bcm6368_nand_intc_ack;
soc->ctlrdy_set_enabled = bcm6368_nand_intc_set;
/* Disable and ack all interrupts */
brcmnand_writel(0, priv->base + BCM6368_NAND_INT);
brcmnand_writel(BCM6368_NAND_STATUS_MASK,
priv->base + BCM6368_NAND_INT);
return brcmnand_probe(pdev, soc);
}
static const struct of_device_id bcm6368_nand_of_match[] = {
{ .compatible = "brcm,nand-bcm6368" },
{},
};
MODULE_DEVICE_TABLE(of, bcm6368_nand_of_match);
static struct platform_driver bcm6368_nand_driver = {
.probe = bcm6368_nand_probe,
.remove = brcmnand_remove,
.driver = {
.name = "bcm6368_nand",
.pm = &brcmnand_pm_ops,
.of_match_table = bcm6368_nand_of_match,
}
};
module_platform_driver(bcm6368_nand_driver);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Simon Arlott");
MODULE_DESCRIPTION("NAND driver for BCM6368");
|
mikedlowis-prototypes/albase
|
source/kernel/drivers/mtd/nand/brcmnand/bcm6368_nand.c
|
C
|
bsd-2-clause
| 3,973
|
// functional_hash.h header -*- C++ -*-
// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library 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, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/** @file bits/functional_hash.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
#ifndef _FUNCTIONAL_HASH_H
#define _FUNCTIONAL_HASH_H 1
#pragma GCC system_header
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include <c++0x_warning.h>
#endif
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
#endif
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/functional_hash.h>
#else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/functional_hash.h>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
#endif
namespace std
{
struct error_code;
template<>
size_t
hash<error_code>::operator()(error_code) const;
}
#endif // _FUNCTIONAL_HASH_H
|
chcbaram/FPGA
|
zap-2.3.0-windows/papilio-zap-ide/hardware/tools/g++_arm_none_eabi/arm-none-eabi/include/c++/4.4.1/bits/functional_hash.h
|
C
|
mit
| 2,043
|
// Copyright (c) 2013 Google Inc.
// 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.
// exploitability_linux.h: Linux specific exploitability engine.
//
// Provides a guess at the exploitability of the crash for the Linux
// platform given a minidump and process_state.
//
// Author: Matthew Riley
#ifndef GOOGLE_BREAKPAD_PROCESSOR_EXPLOITABILITY_LINUX_H_
#define GOOGLE_BREAKPAD_PROCESSOR_EXPLOITABILITY_LINUX_H_
#include "google_breakpad/common/breakpad_types.h"
#include "google_breakpad/processor/exploitability.h"
namespace google_breakpad {
class ExploitabilityLinux : public Exploitability {
public:
ExploitabilityLinux(Minidump *dump,
ProcessState *process_state);
virtual ExploitabilityRating CheckPlatformExploitability();
};
} // namespace google_breakpad
#endif // GOOGLE_BREAKPAD_PROCESSOR_EXPLOITABILITY_LINUX_H_
|
BozhkoAlexander/mtasa-blue
|
vendor/google-breakpad/src/processor/exploitability_linux.h
|
C
|
gpl-3.0
| 2,338
|
;
; jfsseflt-64.asm - floating-point FDCT (64-bit SSE)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright 2009 D. R. Commander
;
; Based on
; x86 SIMD extension for IJG JPEG library
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
;
; This file contains a floating-point implementation of the forward DCT
; (Discrete Cosine Transform). The following code is based directly on
; the IJG's original jfdctflt.c; see the jfdctflt.c for more details.
;
; [TAB8]
%include "jsimdext.inc"
%include "jdct.inc"
; --------------------------------------------------------------------------
%macro unpcklps2 2 ; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(0 1 4 5)
shufps %1,%2,0x44
%endmacro
%macro unpckhps2 2 ; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(2 3 6 7)
shufps %1,%2,0xEE
%endmacro
; --------------------------------------------------------------------------
SECTION SEG_CONST
alignz 16
global EXTN(jconst_fdct_float_sse)
EXTN(jconst_fdct_float_sse):
PD_0_382 times 4 dd 0.382683432365089771728460
PD_0_707 times 4 dd 0.707106781186547524400844
PD_0_541 times 4 dd 0.541196100146196984399723
PD_1_306 times 4 dd 1.306562964876376527856643
alignz 16
; --------------------------------------------------------------------------
SECTION SEG_TEXT
BITS 64
;
; Perform the forward DCT on one block of samples.
;
; GLOBAL(void)
; jsimd_fdct_float_sse (FAST_FLOAT * data)
;
; r10 = FAST_FLOAT * data
%define wk(i) rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]
%define WK_NUM 2
align 16
global EXTN(jsimd_fdct_float_sse)
EXTN(jsimd_fdct_float_sse):
push rbp
mov rax,rsp ; rax = original rbp
sub rsp, byte 4
and rsp, byte (-SIZEOF_XMMWORD) ; align to 128 bits
mov [rsp],rax
mov rbp,rsp ; rbp = aligned rbp
lea rsp, [wk(0)]
collect_args
; ---- Pass 1: process rows.
mov rdx, r10 ; (FAST_FLOAT *)
mov rcx, DCTSIZE/4
.rowloop:
movaps xmm0, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_FAST_FLOAT)]
movaps xmm1, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_FAST_FLOAT)]
movaps xmm2, XMMWORD [XMMBLOCK(2,1,rdx,SIZEOF_FAST_FLOAT)]
movaps xmm3, XMMWORD [XMMBLOCK(3,1,rdx,SIZEOF_FAST_FLOAT)]
; xmm0=(20 21 22 23), xmm2=(24 25 26 27)
; xmm1=(30 31 32 33), xmm3=(34 35 36 37)
movaps xmm4,xmm0 ; transpose coefficients(phase 1)
unpcklps xmm0,xmm1 ; xmm0=(20 30 21 31)
unpckhps xmm4,xmm1 ; xmm4=(22 32 23 33)
movaps xmm5,xmm2 ; transpose coefficients(phase 1)
unpcklps xmm2,xmm3 ; xmm2=(24 34 25 35)
unpckhps xmm5,xmm3 ; xmm5=(26 36 27 37)
movaps xmm6, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FAST_FLOAT)]
movaps xmm7, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FAST_FLOAT)]
movaps xmm1, XMMWORD [XMMBLOCK(0,1,rdx,SIZEOF_FAST_FLOAT)]
movaps xmm3, XMMWORD [XMMBLOCK(1,1,rdx,SIZEOF_FAST_FLOAT)]
; xmm6=(00 01 02 03), xmm1=(04 05 06 07)
; xmm7=(10 11 12 13), xmm3=(14 15 16 17)
movaps XMMWORD [wk(0)], xmm4 ; wk(0)=(22 32 23 33)
movaps XMMWORD [wk(1)], xmm2 ; wk(1)=(24 34 25 35)
movaps xmm4,xmm6 ; transpose coefficients(phase 1)
unpcklps xmm6,xmm7 ; xmm6=(00 10 01 11)
unpckhps xmm4,xmm7 ; xmm4=(02 12 03 13)
movaps xmm2,xmm1 ; transpose coefficients(phase 1)
unpcklps xmm1,xmm3 ; xmm1=(04 14 05 15)
unpckhps xmm2,xmm3 ; xmm2=(06 16 07 17)
movaps xmm7,xmm6 ; transpose coefficients(phase 2)
unpcklps2 xmm6,xmm0 ; xmm6=(00 10 20 30)=data0
unpckhps2 xmm7,xmm0 ; xmm7=(01 11 21 31)=data1
movaps xmm3,xmm2 ; transpose coefficients(phase 2)
unpcklps2 xmm2,xmm5 ; xmm2=(06 16 26 36)=data6
unpckhps2 xmm3,xmm5 ; xmm3=(07 17 27 37)=data7
movaps xmm0,xmm7
movaps xmm5,xmm6
subps xmm7,xmm2 ; xmm7=data1-data6=tmp6
subps xmm6,xmm3 ; xmm6=data0-data7=tmp7
addps xmm0,xmm2 ; xmm0=data1+data6=tmp1
addps xmm5,xmm3 ; xmm5=data0+data7=tmp0
movaps xmm2, XMMWORD [wk(0)] ; xmm2=(22 32 23 33)
movaps xmm3, XMMWORD [wk(1)] ; xmm3=(24 34 25 35)
movaps XMMWORD [wk(0)], xmm7 ; wk(0)=tmp6
movaps XMMWORD [wk(1)], xmm6 ; wk(1)=tmp7
movaps xmm7,xmm4 ; transpose coefficients(phase 2)
unpcklps2 xmm4,xmm2 ; xmm4=(02 12 22 32)=data2
unpckhps2 xmm7,xmm2 ; xmm7=(03 13 23 33)=data3
movaps xmm6,xmm1 ; transpose coefficients(phase 2)
unpcklps2 xmm1,xmm3 ; xmm1=(04 14 24 34)=data4
unpckhps2 xmm6,xmm3 ; xmm6=(05 15 25 35)=data5
movaps xmm2,xmm7
movaps xmm3,xmm4
addps xmm7,xmm1 ; xmm7=data3+data4=tmp3
addps xmm4,xmm6 ; xmm4=data2+data5=tmp2
subps xmm2,xmm1 ; xmm2=data3-data4=tmp4
subps xmm3,xmm6 ; xmm3=data2-data5=tmp5
; -- Even part
movaps xmm1,xmm5
movaps xmm6,xmm0
subps xmm5,xmm7 ; xmm5=tmp13
subps xmm0,xmm4 ; xmm0=tmp12
addps xmm1,xmm7 ; xmm1=tmp10
addps xmm6,xmm4 ; xmm6=tmp11
addps xmm0,xmm5
mulps xmm0,[rel PD_0_707] ; xmm0=z1
movaps xmm7,xmm1
movaps xmm4,xmm5
subps xmm1,xmm6 ; xmm1=data4
subps xmm5,xmm0 ; xmm5=data6
addps xmm7,xmm6 ; xmm7=data0
addps xmm4,xmm0 ; xmm4=data2
movaps XMMWORD [XMMBLOCK(0,1,rdx,SIZEOF_FAST_FLOAT)], xmm1
movaps XMMWORD [XMMBLOCK(2,1,rdx,SIZEOF_FAST_FLOAT)], xmm5
movaps XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FAST_FLOAT)], xmm7
movaps XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_FAST_FLOAT)], xmm4
; -- Odd part
movaps xmm6, XMMWORD [wk(0)] ; xmm6=tmp6
movaps xmm0, XMMWORD [wk(1)] ; xmm0=tmp7
addps xmm2,xmm3 ; xmm2=tmp10
addps xmm3,xmm6 ; xmm3=tmp11
addps xmm6,xmm0 ; xmm6=tmp12, xmm0=tmp7
mulps xmm3,[rel PD_0_707] ; xmm3=z3
movaps xmm1,xmm2 ; xmm1=tmp10
subps xmm2,xmm6
mulps xmm2,[rel PD_0_382] ; xmm2=z5
mulps xmm1,[rel PD_0_541] ; xmm1=MULTIPLY(tmp10,FIX_0_541196)
mulps xmm6,[rel PD_1_306] ; xmm6=MULTIPLY(tmp12,FIX_1_306562)
addps xmm1,xmm2 ; xmm1=z2
addps xmm6,xmm2 ; xmm6=z4
movaps xmm5,xmm0
subps xmm0,xmm3 ; xmm0=z13
addps xmm5,xmm3 ; xmm5=z11
movaps xmm7,xmm0
movaps xmm4,xmm5
subps xmm0,xmm1 ; xmm0=data3
subps xmm5,xmm6 ; xmm5=data7
addps xmm7,xmm1 ; xmm7=data5
addps xmm4,xmm6 ; xmm4=data1
movaps XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_FAST_FLOAT)], xmm0
movaps XMMWORD [XMMBLOCK(3,1,rdx,SIZEOF_FAST_FLOAT)], xmm5
movaps XMMWORD [XMMBLOCK(1,1,rdx,SIZEOF_FAST_FLOAT)], xmm7
movaps XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FAST_FLOAT)], xmm4
add rdx, 4*DCTSIZE*SIZEOF_FAST_FLOAT
dec rcx
jnz near .rowloop
; ---- Pass 2: process columns.
mov rdx, r10 ; (FAST_FLOAT *)
mov rcx, DCTSIZE/4
.columnloop:
movaps xmm0, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_FAST_FLOAT)]
movaps xmm1, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_FAST_FLOAT)]
movaps xmm2, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_FAST_FLOAT)]
movaps xmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_FAST_FLOAT)]
; xmm0=(02 12 22 32), xmm2=(42 52 62 72)
; xmm1=(03 13 23 33), xmm3=(43 53 63 73)
movaps xmm4,xmm0 ; transpose coefficients(phase 1)
unpcklps xmm0,xmm1 ; xmm0=(02 03 12 13)
unpckhps xmm4,xmm1 ; xmm4=(22 23 32 33)
movaps xmm5,xmm2 ; transpose coefficients(phase 1)
unpcklps xmm2,xmm3 ; xmm2=(42 43 52 53)
unpckhps xmm5,xmm3 ; xmm5=(62 63 72 73)
movaps xmm6, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FAST_FLOAT)]
movaps xmm7, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FAST_FLOAT)]
movaps xmm1, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_FAST_FLOAT)]
movaps xmm3, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_FAST_FLOAT)]
; xmm6=(00 10 20 30), xmm1=(40 50 60 70)
; xmm7=(01 11 21 31), xmm3=(41 51 61 71)
movaps XMMWORD [wk(0)], xmm4 ; wk(0)=(22 23 32 33)
movaps XMMWORD [wk(1)], xmm2 ; wk(1)=(42 43 52 53)
movaps xmm4,xmm6 ; transpose coefficients(phase 1)
unpcklps xmm6,xmm7 ; xmm6=(00 01 10 11)
unpckhps xmm4,xmm7 ; xmm4=(20 21 30 31)
movaps xmm2,xmm1 ; transpose coefficients(phase 1)
unpcklps xmm1,xmm3 ; xmm1=(40 41 50 51)
unpckhps xmm2,xmm3 ; xmm2=(60 61 70 71)
movaps xmm7,xmm6 ; transpose coefficients(phase 2)
unpcklps2 xmm6,xmm0 ; xmm6=(00 01 02 03)=data0
unpckhps2 xmm7,xmm0 ; xmm7=(10 11 12 13)=data1
movaps xmm3,xmm2 ; transpose coefficients(phase 2)
unpcklps2 xmm2,xmm5 ; xmm2=(60 61 62 63)=data6
unpckhps2 xmm3,xmm5 ; xmm3=(70 71 72 73)=data7
movaps xmm0,xmm7
movaps xmm5,xmm6
subps xmm7,xmm2 ; xmm7=data1-data6=tmp6
subps xmm6,xmm3 ; xmm6=data0-data7=tmp7
addps xmm0,xmm2 ; xmm0=data1+data6=tmp1
addps xmm5,xmm3 ; xmm5=data0+data7=tmp0
movaps xmm2, XMMWORD [wk(0)] ; xmm2=(22 23 32 33)
movaps xmm3, XMMWORD [wk(1)] ; xmm3=(42 43 52 53)
movaps XMMWORD [wk(0)], xmm7 ; wk(0)=tmp6
movaps XMMWORD [wk(1)], xmm6 ; wk(1)=tmp7
movaps xmm7,xmm4 ; transpose coefficients(phase 2)
unpcklps2 xmm4,xmm2 ; xmm4=(20 21 22 23)=data2
unpckhps2 xmm7,xmm2 ; xmm7=(30 31 32 33)=data3
movaps xmm6,xmm1 ; transpose coefficients(phase 2)
unpcklps2 xmm1,xmm3 ; xmm1=(40 41 42 43)=data4
unpckhps2 xmm6,xmm3 ; xmm6=(50 51 52 53)=data5
movaps xmm2,xmm7
movaps xmm3,xmm4
addps xmm7,xmm1 ; xmm7=data3+data4=tmp3
addps xmm4,xmm6 ; xmm4=data2+data5=tmp2
subps xmm2,xmm1 ; xmm2=data3-data4=tmp4
subps xmm3,xmm6 ; xmm3=data2-data5=tmp5
; -- Even part
movaps xmm1,xmm5
movaps xmm6,xmm0
subps xmm5,xmm7 ; xmm5=tmp13
subps xmm0,xmm4 ; xmm0=tmp12
addps xmm1,xmm7 ; xmm1=tmp10
addps xmm6,xmm4 ; xmm6=tmp11
addps xmm0,xmm5
mulps xmm0,[rel PD_0_707] ; xmm0=z1
movaps xmm7,xmm1
movaps xmm4,xmm5
subps xmm1,xmm6 ; xmm1=data4
subps xmm5,xmm0 ; xmm5=data6
addps xmm7,xmm6 ; xmm7=data0
addps xmm4,xmm0 ; xmm4=data2
movaps XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_FAST_FLOAT)], xmm1
movaps XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_FAST_FLOAT)], xmm5
movaps XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FAST_FLOAT)], xmm7
movaps XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_FAST_FLOAT)], xmm4
; -- Odd part
movaps xmm6, XMMWORD [wk(0)] ; xmm6=tmp6
movaps xmm0, XMMWORD [wk(1)] ; xmm0=tmp7
addps xmm2,xmm3 ; xmm2=tmp10
addps xmm3,xmm6 ; xmm3=tmp11
addps xmm6,xmm0 ; xmm6=tmp12, xmm0=tmp7
mulps xmm3,[rel PD_0_707] ; xmm3=z3
movaps xmm1,xmm2 ; xmm1=tmp10
subps xmm2,xmm6
mulps xmm2,[rel PD_0_382] ; xmm2=z5
mulps xmm1,[rel PD_0_541] ; xmm1=MULTIPLY(tmp10,FIX_0_541196)
mulps xmm6,[rel PD_1_306] ; xmm6=MULTIPLY(tmp12,FIX_1_306562)
addps xmm1,xmm2 ; xmm1=z2
addps xmm6,xmm2 ; xmm6=z4
movaps xmm5,xmm0
subps xmm0,xmm3 ; xmm0=z13
addps xmm5,xmm3 ; xmm5=z11
movaps xmm7,xmm0
movaps xmm4,xmm5
subps xmm0,xmm1 ; xmm0=data3
subps xmm5,xmm6 ; xmm5=data7
addps xmm7,xmm1 ; xmm7=data5
addps xmm4,xmm6 ; xmm4=data1
movaps XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_FAST_FLOAT)], xmm0
movaps XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_FAST_FLOAT)], xmm5
movaps XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_FAST_FLOAT)], xmm7
movaps XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FAST_FLOAT)], xmm4
add rdx, byte 4*SIZEOF_FAST_FLOAT
dec rcx
jnz near .columnloop
uncollect_args
mov rsp,rbp ; rsp <- aligned rbp
pop rsp ; rsp <- original rbp
pop rbp
ret
; For some reason, the OS X linker does not honor the request to align the
; segment unless we do this.
align 16
|
zarboz/XBMC-PVR-mac
|
tools/darwin/depends/libjpeg-turbo/simd/jfsseflt-64.asm
|
Assembly
|
gpl-2.0
| 11,016
|
// Copyright (c) 2009-2014 Vladimir Batov.
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. See http://www.boost.org/LICENSE_1_0.txt.
#ifndef BOOST_CONVERT_DETAIL_IS_CHAR_HPP
#define BOOST_CONVERT_DETAIL_IS_CHAR_HPP
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/remove_const.hpp>
namespace boost { namespace cnv
{
namespace detail
{
template<typename T> struct is_char : mpl::false_ {};
template<> struct is_char<char> : mpl:: true_ {};
template<> struct is_char<wchar_t> : mpl:: true_ {};
}
template <typename T> struct is_char : detail::is_char<typename remove_const<T>::type> {};
}}
#endif // BOOST_CONVERT_DETAIL_IS_CHAR_HPP
|
gwq5210/litlib
|
thirdparty/sources/boost_1_60_0/boost/convert/detail/char.hpp
|
C++
|
gpl-3.0
| 766
|
// TinyMCE helper, checks to see if TinyMCE editors in the given form are dirty
// Support for UMD: https://github.com/umdjs/umd/blob/master/jqueryPluginCommonjs.js
// This allows for tools such as Browserify to compose the components together into a single HTTP request.
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS
module.exports = factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
// Create a new object, with an isDirty method
var tinymce = {
ignoreAnchorSelector: '.mceEditor a,.mceMenu a',
isDirty: function (form) {
var isDirty = false;
if (formHasTinyMCE(form)) {
//..alert('in finder');
// Search for all tinymce elements inside the given form
$(form).find(':tinymce').each(function () {
$.DirtyForms.dirtylog('Checking node ' + $(this).attr('id'));
if ($(this).tinymce().isDirty()) {
isDirty = true;
$.DirtyForms.dirtylog('Node was totally dirty.');
// Return false to break out of the .each() function
return false;
}
});
}
return isDirty;
},
setClean: function (form) {
if (formHasTinyMCE(form)) {
// Search for all tinymce elements inside the given form
$(form).find(':tinymce').each(function () {
if ($(this).tinymce().isDirty()) {
$.DirtyForms.dirtylog('Resetting isDirty on node ' + $(this).attr('id'));
$(this).tinymce().isNotDirty = 1; //Force not dirty state
}
});
}
}
};
// Fix: tinymce throws an error if the selector doesn't match anything
// (such as when there are no textareas on the current page)
var formHasTinyMCE = function (form) {
try {
return $(form).find(':tinymce').length > 0;
}
catch (e) {
return false;
}
};
// Push the new object onto the helpers array
$.DirtyForms.helpers.push(tinymce);
// Create a pre refire binding to trigger the tinymce save
//$(document).bind('beforeRefire.dirtyforms', function(){
// This is no longer needed, but kept here to remind me.
// tinyMCE.triggerSave();
//});
}));
|
NightOwl888/jquery.dirtyforms
|
helpers/tinymce.js
|
JavaScript
|
mit
| 2,691
|
"""
This module implements connections for MySQLdb. Presently there is
only one class: Connection. Others are unlikely. However, you might
want to make your own subclasses. In most cases, you will probably
override Connection.default_cursor with a non-standard Cursor class.
"""
from MySQLdb import cursors
from _mysql_exceptions import Warning, Error, InterfaceError, DataError, \
DatabaseError, OperationalError, IntegrityError, InternalError, \
NotSupportedError, ProgrammingError
import types, _mysql
import re
def defaulterrorhandler(connection, cursor, errorclass, errorvalue):
"""
If cursor is not None, (errorclass, errorvalue) is appended to
cursor.messages; otherwise it is appended to
connection.messages. Then errorclass is raised with errorvalue as
the value.
You can override this with your own error handler by assigning it
to the instance.
"""
error = errorclass, errorvalue
if cursor:
cursor.messages.append(error)
else:
connection.messages.append(error)
del cursor
del connection
raise errorclass, errorvalue
re_numeric_part = re.compile(r"^(\d+)")
def numeric_part(s):
"""Returns the leading numeric part of a string.
>>> numeric_part("20-alpha")
20
>>> numeric_part("foo")
>>> numeric_part("16b")
16
"""
m = re_numeric_part.match(s)
if m:
return int(m.group(1))
return None
class Connection(_mysql.connection):
"""MySQL Database Connection Object"""
default_cursor = cursors.Cursor
def __init__(self, *args, **kwargs):
"""
Create a connection to the database. It is strongly recommended
that you only use keyword parameters. Consult the MySQL C API
documentation for more information.
host
string, host to connect
user
string, user to connect as
passwd
string, password to use
db
string, database to use
port
integer, TCP/IP port to connect to
unix_socket
string, location of unix_socket to use
conv
conversion dictionary, see MySQLdb.converters
connect_timeout
number of seconds to wait before the connection attempt
fails.
compress
if set, compression is enabled
named_pipe
if set, a named pipe is used to connect (Windows only)
init_command
command which is run once the connection is created
read_default_file
file from which default client values are read
read_default_group
configuration group to use from the default file
cursorclass
class object, used to create cursors (keyword only)
use_unicode
If True, text-like columns are returned as unicode objects
using the connection's character set. Otherwise, text-like
columns are returned as strings. columns are returned as
normal strings. Unicode objects will always be encoded to
the connection's character set regardless of this setting.
charset
If supplied, the connection character set will be changed
to this character set (MySQL-4.1 and newer). This implies
use_unicode=True.
sql_mode
If supplied, the session SQL mode will be changed to this
setting (MySQL-4.1 and newer). For more details and legal
values, see the MySQL documentation.
client_flag
integer, flags to use or 0
(see MySQL docs or constants/CLIENTS.py)
ssl
dictionary or mapping, contains SSL connection parameters;
see the MySQL documentation for more details
(mysql_ssl_set()). If this is set, and the client does not
support SSL, NotSupportedError will be raised.
local_infile
integer, non-zero enables LOAD LOCAL INFILE; zero disables
autocommit
If False (default), autocommit is disabled.
If True, autocommit is enabled.
If None, autocommit isn't set and server default is used.
There are a number of undocumented, non-standard methods. See the
documentation for the MySQL C API for some hints on what they do.
"""
from MySQLdb.constants import CLIENT, FIELD_TYPE
from MySQLdb.converters import conversions
from weakref import proxy
kwargs2 = kwargs.copy()
if 'conv' in kwargs:
conv = kwargs['conv']
else:
conv = conversions
conv2 = {}
for k, v in conv.items():
if isinstance(k, int) and isinstance(v, list):
conv2[k] = v[:]
else:
conv2[k] = v
kwargs2['conv'] = conv2
cursorclass = kwargs2.pop('cursorclass', self.default_cursor)
charset = kwargs2.pop('charset', '')
if charset:
use_unicode = True
else:
use_unicode = False
use_unicode = kwargs2.pop('use_unicode', use_unicode)
sql_mode = kwargs2.pop('sql_mode', '')
client_flag = kwargs.get('client_flag', 0)
client_version = tuple([ numeric_part(n) for n in _mysql.get_client_info().split('.')[:2] ])
if client_version >= (4, 1):
client_flag |= CLIENT.MULTI_STATEMENTS
if client_version >= (5, 0):
client_flag |= CLIENT.MULTI_RESULTS
kwargs2['client_flag'] = client_flag
# PEP-249 requires autocommit to be initially off
autocommit = kwargs2.pop('autocommit', False)
super(Connection, self).__init__(*args, **kwargs2)
self.cursorclass = cursorclass
self.encoders = dict([ (k, v) for k, v in conv.items()
if type(k) is not int ])
self._server_version = tuple([ numeric_part(n) for n in self.get_server_info().split('.')[:2] ])
db = proxy(self)
def _get_string_literal():
def string_literal(obj, dummy=None):
return db.string_literal(obj)
return string_literal
def _get_unicode_literal():
def unicode_literal(u, dummy=None):
return db.literal(u.encode(unicode_literal.charset))
return unicode_literal
def _get_string_decoder():
def string_decoder(s):
return s.decode(string_decoder.charset)
return string_decoder
string_literal = _get_string_literal()
self.unicode_literal = unicode_literal = _get_unicode_literal()
self.string_decoder = string_decoder = _get_string_decoder()
if not charset:
charset = self.character_set_name()
self.set_character_set(charset)
if sql_mode:
self.set_sql_mode(sql_mode)
if use_unicode:
self.converter[FIELD_TYPE.STRING].append((None, string_decoder))
self.converter[FIELD_TYPE.VAR_STRING].append((None, string_decoder))
self.converter[FIELD_TYPE.VARCHAR].append((None, string_decoder))
self.converter[FIELD_TYPE.BLOB].append((None, string_decoder))
self.encoders[types.StringType] = string_literal
self.encoders[types.UnicodeType] = unicode_literal
self._transactional = self.server_capabilities & CLIENT.TRANSACTIONS
if self._transactional:
if autocommit is not None:
self.autocommit(autocommit)
self.messages = []
def autocommit(self, on):
on = bool(on)
if self.get_autocommit() != on:
_mysql.connection.autocommit(self, on)
def cursor(self, cursorclass=None):
"""
Create a cursor on which queries may be performed. The
optional cursorclass parameter is used to create the
Cursor. By default, self.cursorclass=cursors.Cursor is
used.
"""
return (cursorclass or self.cursorclass)(self)
def __enter__(self):
if self.get_autocommit():
self.query("BEGIN")
return self.cursor()
def __exit__(self, exc, value, tb):
if exc:
self.rollback()
else:
self.commit()
def literal(self, o):
"""
If o is a single object, returns an SQL literal as a string.
If o is a non-string sequence, the items of the sequence are
converted and returned as a sequence.
Non-standard. For internal use; do not use this in your
applications.
"""
return self.escape(o, self.encoders)
def begin(self):
"""Explicitly begin a connection. Non-standard.
DEPRECATED: Will be removed in 1.3.
Use an SQL BEGIN statement instead."""
from warnings import warn
warn("begin() is non-standard and will be removed in 1.3",
DeprecationWarning, 2)
self.query("BEGIN")
if not hasattr(_mysql.connection, 'warning_count'):
def warning_count(self):
"""Return the number of warnings generated from the
last query. This is derived from the info() method."""
from string import atoi
info = self.info()
if info:
return atoi(info.split()[-1])
else:
return 0
def set_character_set(self, charset):
"""Set the connection character set to charset. The character
set can only be changed in MySQL-4.1 and newer. If you try
to change the character set from the current value in an
older version, NotSupportedError will be raised."""
if charset == "utf8mb4":
py_charset = "utf8"
else:
py_charset = charset
if self.character_set_name() != charset:
try:
super(Connection, self).set_character_set(charset)
except AttributeError:
if self._server_version < (4, 1):
raise NotSupportedError("server is too old to set charset")
self.query('SET NAMES %s' % charset)
self.store_result()
self.string_decoder.charset = py_charset
self.unicode_literal.charset = py_charset
def set_sql_mode(self, sql_mode):
"""Set the connection sql_mode. See MySQL documentation for
legal values."""
if self._server_version < (4, 1):
raise NotSupportedError("server is too old to set sql_mode")
self.query("SET SESSION sql_mode='%s'" % sql_mode)
self.store_result()
def show_warnings(self):
"""Return detailed information about warnings as a
sequence of tuples of (Level, Code, Message). This
is only supported in MySQL-4.1 and up. If your server
is an earlier version, an empty sequence is returned."""
if self._server_version < (4,1): return ()
self.query("SHOW WARNINGS")
r = self.store_result()
warnings = r.fetch_row(0)
return warnings
Warning = Warning
Error = Error
InterfaceError = InterfaceError
DatabaseError = DatabaseError
DataError = DataError
OperationalError = OperationalError
IntegrityError = IntegrityError
InternalError = InternalError
ProgrammingError = ProgrammingError
NotSupportedError = NotSupportedError
errorhandler = defaulterrorhandler
|
skycucumber/Messaging-Gateway
|
webapp/venv/lib/python2.7/site-packages/MySQLdb/connections.py
|
Python
|
gpl-2.0
| 11,777
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
using System.Diagnostics;
using System.Threading;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
using System.Collections.Generic;
using System;
namespace Microsoft.CodeAnalysis.CSharp.Symbols
{
internal abstract class SourceDelegateMethodSymbol : SourceMethodSymbol
{
private ImmutableArray<ParameterSymbol> _parameters;
private readonly TypeSymbol _returnType;
protected SourceDelegateMethodSymbol(
SourceMemberContainerTypeSymbol delegateType,
TypeSymbol returnType,
DelegateDeclarationSyntax syntax,
MethodKind methodKind,
DeclarationModifiers declarationModifiers)
: base(delegateType, syntax.GetReference(), bodySyntaxReferenceOpt: null, location: syntax.Identifier.GetLocation())
{
_returnType = returnType;
this.MakeFlags(methodKind, declarationModifiers, _returnType.SpecialType == SpecialType.System_Void, isExtensionMethod: false);
}
protected void InitializeParameters(ImmutableArray<ParameterSymbol> parameters)
{
Debug.Assert(_parameters.IsDefault);
_parameters = parameters;
}
internal static void AddDelegateMembers(
SourceMemberContainerTypeSymbol delegateType,
ArrayBuilder<Symbol> symbols,
DelegateDeclarationSyntax syntax,
DiagnosticBag diagnostics)
{
Binder binder = delegateType.GetBinder(syntax.ParameterList);
TypeSymbol returnType = binder.BindType(syntax.ReturnType, diagnostics);
// reuse types to avoid reporting duplicate errors if missing:
var voidType = binder.GetSpecialType(SpecialType.System_Void, diagnostics, syntax);
var objectType = binder.GetSpecialType(SpecialType.System_Object, diagnostics, syntax);
var intPtrType = binder.GetSpecialType(SpecialType.System_IntPtr, diagnostics, syntax);
if (returnType.IsRestrictedType())
{
// Method or delegate cannot return type '{0}'
diagnostics.Add(ErrorCode.ERR_MethodReturnCantBeRefAny, syntax.ReturnType.Location, returnType);
}
// A delegate has the following members: (see CLI spec 13.6)
// (1) a method named Invoke with the specified signature
var invoke = new InvokeMethod(delegateType, returnType, syntax, binder, diagnostics);
invoke.CheckDelegateVarianceSafety(diagnostics);
symbols.Add(invoke);
// (2) a constructor with argument types (object, System.IntPtr)
symbols.Add(new Constructor(delegateType, voidType, objectType, intPtrType, syntax));
if (binder.Compilation.GetSpecialType(SpecialType.System_IAsyncResult).TypeKind != TypeKind.Error &&
binder.Compilation.GetSpecialType(SpecialType.System_AsyncCallback).TypeKind != TypeKind.Error &&
// WinRT delegates don't have Begin/EndInvoke methods
!delegateType.IsCompilationOutputWinMdObj())
{
var iAsyncResultType = binder.GetSpecialType(SpecialType.System_IAsyncResult, diagnostics, syntax);
var asyncCallbackType = binder.GetSpecialType(SpecialType.System_AsyncCallback, diagnostics, syntax);
// (3) BeginInvoke
symbols.Add(new BeginInvokeMethod(invoke, iAsyncResultType, objectType, asyncCallbackType, syntax));
// and (4) EndInvoke methods
symbols.Add(new EndInvokeMethod(invoke, iAsyncResultType, syntax));
}
if (delegateType.DeclaredAccessibility <= Accessibility.Private)
{
return;
}
HashSet<DiagnosticInfo> useSiteDiagnostics = null;
if (!delegateType.IsNoMoreVisibleThan(invoke.ReturnType, ref useSiteDiagnostics))
{
// Inconsistent accessibility: return type '{1}' is less accessible than delegate '{0}'
diagnostics.Add(ErrorCode.ERR_BadVisDelegateReturn, delegateType.Locations[0], delegateType, invoke.ReturnType);
}
foreach (var parameter in invoke.Parameters)
{
if (!parameter.Type.IsAtLeastAsVisibleAs(delegateType, ref useSiteDiagnostics))
{
// Inconsistent accessibility: parameter type '{1}' is less accessible than delegate '{0}'
diagnostics.Add(ErrorCode.ERR_BadVisDelegateParam, delegateType.Locations[0], delegateType, parameter.Type);
}
}
diagnostics.Add(delegateType.Locations[0], useSiteDiagnostics);
}
protected override void MethodChecks(DiagnosticBag diagnostics)
{
// TODO: move more functionality into here, making these symbols more lazy
}
public sealed override bool IsVararg
{
get
{
return false;
}
}
public sealed override ImmutableArray<ParameterSymbol> Parameters
{
get
{
return _parameters;
}
}
public override ImmutableArray<TypeParameterSymbol> TypeParameters
{
get
{
return ImmutableArray<TypeParameterSymbol>.Empty;
}
}
public sealed override TypeSymbol ReturnType
{
get
{
return _returnType;
}
}
public sealed override bool IsImplicitlyDeclared
{
get
{
return true;
}
}
internal override bool IsExpressionBodied
{
get { return false; }
}
internal override bool GenerateDebugInfo
{
get { return false; }
}
protected sealed override IAttributeTargetSymbol AttributeOwner
{
get
{
return (SourceNamedTypeSymbol)ContainingSymbol;
}
}
internal sealed override System.Reflection.MethodImplAttributes ImplementationAttributes
{
get { return System.Reflection.MethodImplAttributes.Runtime; }
}
internal sealed override OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations()
{
// TODO: This implementation looks strange. It might make sense for the Invoke method, but
// not for constructor and other methods.
return OneOrMany.Create(((SourceNamedTypeSymbol)ContainingSymbol).GetAttributeDeclarations());
}
internal sealed override System.AttributeTargets GetAttributeTarget()
{
return System.AttributeTargets.Delegate;
}
private sealed class Constructor : SourceDelegateMethodSymbol
{
internal Constructor(
SourceMemberContainerTypeSymbol delegateType,
TypeSymbol voidType,
TypeSymbol objectType,
TypeSymbol intPtrType,
DelegateDeclarationSyntax syntax)
: base(delegateType, voidType, syntax, MethodKind.Constructor, DeclarationModifiers.Public)
{
InitializeParameters(ImmutableArray.Create<ParameterSymbol>(
new SynthesizedParameterSymbol(this, objectType, 0, RefKind.None, "object"),
new SynthesizedParameterSymbol(this, intPtrType, 1, RefKind.None, "method")));
}
public override string Name
{
get { return WellKnownMemberNames.InstanceConstructorName; }
}
internal override OneOrMany<SyntaxList<AttributeListSyntax>> GetReturnTypeAttributeDeclarations()
{
// Constructors don't have return type attributes
return OneOrMany.Create(default(SyntaxList<AttributeListSyntax>));
}
internal override LexicalSortKey GetLexicalSortKey()
{
// associate "Invoke and .ctor" with whole delegate declaration for the sorting purposes
// other methods will be associated with delegate's identifier
// we want this just to keep the order of synthesized methods the same as in Dev12
// Dev12 order is not strictly alphabetical - .ctor and Invoke go before other members.
// there are no real reasons for emitting the members in one order or another,
// so we will keep them the same.
return new LexicalSortKey(this.syntaxReferenceOpt.GetLocation(), this.DeclaringCompilation);
}
}
private sealed class InvokeMethod : SourceDelegateMethodSymbol
{
internal InvokeMethod(
SourceMemberContainerTypeSymbol delegateType,
TypeSymbol returnType,
DelegateDeclarationSyntax syntax,
Binder binder,
DiagnosticBag diagnostics)
: base(delegateType, returnType, syntax, MethodKind.DelegateInvoke, DeclarationModifiers.Virtual | DeclarationModifiers.Public)
{
SyntaxToken arglistToken;
var parameters = ParameterHelpers.MakeParameters(binder, this, syntax.ParameterList, true, out arglistToken, diagnostics);
if (arglistToken.Kind() == SyntaxKind.ArgListKeyword)
{
// This is a parse-time error in the native compiler; it is a semantic analysis error in Roslyn.
// error CS1669: __arglist is not valid in this context
diagnostics.Add(ErrorCode.ERR_IllegalVarArgs, new SourceLocation(arglistToken));
}
InitializeParameters(parameters);
}
public override string Name
{
get { return WellKnownMemberNames.DelegateInvokeName; }
}
internal override LexicalSortKey GetLexicalSortKey()
{
// associate "Invoke and .ctor" with whole delegate declaration for the sorting purposes
// other methods will be associated with delegate's identifier
// we want this just to keep the order of synthesized methods the same as in Dev12
// Dev12 order is not strictly alphabetical - .ctor and Invoke go before other members.
// there are no real reasons for emitting the members in one order or another,
// so we will keep them the same.
return new LexicalSortKey(this.syntaxReferenceOpt.GetLocation(), this.DeclaringCompilation);
}
}
private sealed class BeginInvokeMethod : SourceDelegateMethodSymbol
{
internal BeginInvokeMethod(
InvokeMethod invoke,
TypeSymbol iAsyncResultType,
TypeSymbol objectType,
TypeSymbol asyncCallbackType,
DelegateDeclarationSyntax syntax)
: base((SourceNamedTypeSymbol)invoke.ContainingType, iAsyncResultType, syntax, MethodKind.Ordinary, DeclarationModifiers.Virtual | DeclarationModifiers.Public)
{
var parameters = ArrayBuilder<ParameterSymbol>.GetInstance();
foreach (SourceParameterSymbol p in invoke.Parameters)
{
var synthesizedParam = new SourceClonedParameterSymbol(originalParam: p, newOwner: this, newOrdinal: p.Ordinal, suppressOptional: true);
parameters.Add(synthesizedParam);
}
int paramCount = invoke.ParameterCount;
parameters.Add(new SynthesizedParameterSymbol(this, asyncCallbackType, paramCount, RefKind.None, GetUniqueParameterName(parameters, "callback")));
parameters.Add(new SynthesizedParameterSymbol(this, objectType, paramCount + 1, RefKind.None, GetUniqueParameterName(parameters, "object")));
InitializeParameters(parameters.ToImmutableAndFree());
}
public override string Name
{
get { return WellKnownMemberNames.DelegateBeginInvokeName; }
}
internal override OneOrMany<SyntaxList<AttributeListSyntax>> GetReturnTypeAttributeDeclarations()
{
// BeginInvoke method doesn't have return type attributes
// because it doesn't inherit Delegate declaration's return type.
// It has a special return type: SpecialType.System.IAsyncResult.
return OneOrMany.Create(default(SyntaxList<AttributeListSyntax>));
}
}
private sealed class EndInvokeMethod : SourceDelegateMethodSymbol
{
internal EndInvokeMethod(
InvokeMethod invoke,
TypeSymbol iAsyncResultType,
DelegateDeclarationSyntax syntax)
: base((SourceNamedTypeSymbol)invoke.ContainingType, invoke.ReturnType, syntax, MethodKind.Ordinary, DeclarationModifiers.Virtual | DeclarationModifiers.Public)
{
var parameters = ArrayBuilder<ParameterSymbol>.GetInstance();
int ordinal = 0;
foreach (SourceParameterSymbol p in invoke.Parameters)
{
if (p.RefKind != RefKind.None)
{
var synthesizedParam = new SourceClonedParameterSymbol(originalParam: p, newOwner: this, newOrdinal: ordinal++, suppressOptional: true);
parameters.Add(synthesizedParam);
}
}
parameters.Add(new SynthesizedParameterSymbol(this, iAsyncResultType, ordinal++, RefKind.None, GetUniqueParameterName(parameters, "result")));
InitializeParameters(parameters.ToImmutableAndFree());
}
protected override SourceMethodSymbol BoundAttributesSource
{
get
{
// copy return attributes from InvokeMethod
return (SourceMethodSymbol)((SourceNamedTypeSymbol)this.ContainingSymbol).DelegateInvokeMethod;
}
}
public override string Name
{
get { return WellKnownMemberNames.DelegateEndInvokeName; }
}
}
private static string GetUniqueParameterName(ArrayBuilder<ParameterSymbol> currentParameters, string name)
{
while (!IsUnique(currentParameters, name))
{
name = "__" + name;
}
return name;
}
private static bool IsUnique(ArrayBuilder<ParameterSymbol> currentParameters, string name)
{
foreach (var p in currentParameters)
{
if (string.CompareOrdinal(p.Name, name) == 0)
{
return false;
}
}
return true;
}
}
}
|
v-codeel/roslyn
|
src/Compilers/CSharp/Portable/Symbols/Source/SourceDelegateMethodSymbol.cs
|
C#
|
apache-2.0
| 15,517
|
package google
import (
"fmt"
"testing"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
)
func TestAccDnsRecordSet_basic(t *testing.T) {
zoneName := fmt.Sprintf("dnszone-test-%s", acctest.RandString(10))
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckDnsRecordSetDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccDnsRecordSet_basic(zoneName, "127.0.0.10", 300),
Check: resource.ComposeTestCheckFunc(
testAccCheckDnsRecordSetExists(
"google_dns_record_set.foobar", zoneName),
),
},
},
})
}
func TestAccDnsRecordSet_modify(t *testing.T) {
zoneName := fmt.Sprintf("dnszone-test-%s", acctest.RandString(10))
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckDnsRecordSetDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccDnsRecordSet_basic(zoneName, "127.0.0.10", 300),
Check: resource.ComposeTestCheckFunc(
testAccCheckDnsRecordSetExists(
"google_dns_record_set.foobar", zoneName),
),
},
resource.TestStep{
Config: testAccDnsRecordSet_basic(zoneName, "127.0.0.11", 300),
Check: resource.ComposeTestCheckFunc(
testAccCheckDnsRecordSetExists(
"google_dns_record_set.foobar", zoneName),
),
},
resource.TestStep{
Config: testAccDnsRecordSet_basic(zoneName, "127.0.0.11", 600),
Check: resource.ComposeTestCheckFunc(
testAccCheckDnsRecordSetExists(
"google_dns_record_set.foobar", zoneName),
),
},
},
})
}
func TestAccDnsRecordSet_changeType(t *testing.T) {
zoneName := fmt.Sprintf("dnszone-test-%s", acctest.RandString(10))
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckDnsRecordSetDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccDnsRecordSet_basic(zoneName, "127.0.0.10", 300),
Check: resource.ComposeTestCheckFunc(
testAccCheckDnsRecordSetExists(
"google_dns_record_set.foobar", zoneName),
),
},
resource.TestStep{
Config: testAccDnsRecordSet_bigChange(zoneName, 600),
Check: resource.ComposeTestCheckFunc(
testAccCheckDnsRecordSetExists(
"google_dns_record_set.foobar", zoneName),
),
},
},
})
}
func testAccCheckDnsRecordSetDestroy(s *terraform.State) error {
config := testAccProvider.Meta().(*Config)
for _, rs := range s.RootModule().Resources {
// Deletion of the managed_zone implies everything is gone
if rs.Type == "google_dns_managed_zone" {
_, err := config.clientDns.ManagedZones.Get(
config.Project, rs.Primary.ID).Do()
if err == nil {
return fmt.Errorf("DNS ManagedZone still exists")
}
}
}
return nil
}
func testAccCheckDnsRecordSetExists(resourceType, resourceName string) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[resourceType]
if !ok {
return fmt.Errorf("Not found: %s", resourceName)
}
dnsName := rs.Primary.Attributes["name"]
dnsType := rs.Primary.Attributes["type"]
if rs.Primary.ID == "" {
return fmt.Errorf("No ID is set")
}
config := testAccProvider.Meta().(*Config)
resp, err := config.clientDns.ResourceRecordSets.List(
config.Project, resourceName).Name(dnsName).Type(dnsType).Do()
if err != nil {
return fmt.Errorf("Error confirming DNS RecordSet existence: %#v", err)
}
switch len(resp.Rrsets) {
case 0:
// The resource doesn't exist anymore
return fmt.Errorf("DNS RecordSet not found")
case 1:
return nil
default:
return fmt.Errorf("Only expected 1 record set, got %d", len(resp.Rrsets))
}
}
}
func testAccDnsRecordSet_basic(zoneName string, addr2 string, ttl int) string {
return fmt.Sprintf(`
resource "google_dns_managed_zone" "parent-zone" {
name = "%s"
dns_name = "hashicorptest.com."
description = "Test Description"
}
resource "google_dns_record_set" "foobar" {
managed_zone = "${google_dns_managed_zone.parent-zone.name}"
name = "test-record.hashicorptest.com."
type = "A"
rrdatas = ["127.0.0.1", "%s"]
ttl = %d
}
`, zoneName, addr2, ttl)
}
func testAccDnsRecordSet_bigChange(zoneName string, ttl int) string {
return fmt.Sprintf(`
resource "google_dns_managed_zone" "parent-zone" {
name = "%s"
dns_name = "hashicorptest.com."
description = "Test Description"
}
resource "google_dns_record_set" "foobar" {
managed_zone = "${google_dns_managed_zone.parent-zone.name}"
name = "test-record.hashicorptest.com."
type = "CNAME"
rrdatas = ["www.terraform.io."]
ttl = %d
}
`, zoneName, ttl)
}
|
stardog-union/stardog-graviton
|
vendor/github.com/hashicorp/terraform/builtin/providers/google/resource_dns_record_set_test.go
|
GO
|
apache-2.0
| 4,866
|
/**
* @fileoverview A rule to disallow negated left operands of the `in` operator
* @author Michael Ficarra
* @deprecated in ESLint v3.3.0
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = {
meta: {
docs: {
description: "disallow negating the left operand in `in` expressions",
category: "Possible Errors",
recommended: true,
replacedBy: ["no-unsafe-negation"]
},
deprecated: true,
schema: []
},
create(context) {
return {
BinaryExpression(node) {
if (node.operator === "in" && node.left.type === "UnaryExpression" && node.left.operator === "!") {
context.report({ node, message: "The 'in' expression's left operand is negated." });
}
}
};
}
};
|
hellokidder/js-studying
|
微信小程序/wxtest/node_modules/eslint/lib/rules/no-negated-in-lhs.js
|
JavaScript
|
mit
| 1,010
|
<!--[metadata]>
+++
title = "Amazon CloudWatch Logs logging driver"
description = "Describes how to use the Amazon CloudWatch Logs logging driver."
keywords = ["AWS, Amazon, CloudWatch, logging, driver"]
[menu.main]
parent = "smn_logging"
+++
<![end-metadata]-->
# Amazon CloudWatch Logs logging driver
The `awslogs` logging driver sends container logs to
[Amazon CloudWatch Logs](https://aws.amazon.com/cloudwatch/details/#log-monitoring).
Log entries can be retrieved through the [AWS Management
Console](https://console.aws.amazon.com/cloudwatch/home#logs:) or the [AWS SDKs
and Command Line Tools](http://docs.aws.amazon.com/cli/latest/reference/logs/index.html).
## Usage
You can configure the default logging driver by passing the `--log-driver`
option to the Docker daemon:
docker daemon --log-driver=awslogs
You can set the logging driver for a specific container by using the
`--log-driver` option to `docker run`:
docker run --log-driver=awslogs ...
## Amazon CloudWatch Logs options
You can use the `--log-opt NAME=VALUE` flag to specify Amazon CloudWatch Logs logging driver options.
### awslogs-region
The `awslogs` logging driver sends your Docker logs to a specific region. Use
the `awslogs-region` log option or the `AWS_REGION` environment variable to set
the region. By default, if your Docker daemon is running on an EC2 instance
and no region is set, the driver uses the instance's region.
docker run --log-driver=awslogs --log-opt awslogs-region=us-east-1 ...
### awslogs-group
You must specify a
[log group](http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/WhatIsCloudWatchLogs.html)
for the `awslogs` logging driver. You can specify the log group with the
`awslogs-group` log option:
docker run --log-driver=awslogs --log-opt awslogs-region=us-east-1 --log-opt awslogs-group=myLogGroup ...
### awslogs-stream
To configure which
[log stream](http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/WhatIsCloudWatchLogs.html)
should be used, you can specify the `awslogs-stream` log option. If not
specified, the container ID is used as the log stream.
> **Note:**
> Log streams within a given log group should only be used by one container
> at a time. Using the same log stream for multiple containers concurrently
> can cause reduced logging performance.
## Credentials
You must provide AWS credentials to the Docker daemon to use the `awslogs`
logging driver. You can provide these credentials with the `AWS_ACCESS_KEY_ID`,
`AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN` environment variables, the
default AWS shared credentials file (`~/.aws/credentials` of the root user), or
(if you are running the Docker daemon on an Amazon EC2 instance) the Amazon EC2
instance profile.
Credentials must have a policy applied that allows the `logs:CreateLogStream`
and `logs:PutLogEvents` actions, as shown in the following example.
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
|
ulrichSchreiner/dockmon
|
vendor/github.com/docker/docker/docs/reference/logging/awslogs.md
|
Markdown
|
mit
| 3,170
|
/***
* Copyright 2002-2010 jamod development team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
***/
package net.wimpi.modbus.procimg;
/**
* Interface defining a register.
* <p>
* A register is read-write from slave and
* master or device side.<br>
* Therefor implementations have to be carefully
* designed for concurrency.
*
* @author Dieter Wimberger
* @version @version@ (@date@)
*/
public interface Register extends InputRegister {
/**
* Sets the content of this <tt>Register</tt> from the given
* unsigned 16-bit value (unsigned short).
*
* @param v the value as unsigned short (<tt>int</tt>).
*/
public void setValue(int v);
/**
* Sets the content of this register from the given
* signed 16-bit value (short).
*
* @param s the value as <tt>short</tt>.
*/
public void setValue(short s);
/**
* Sets the content of this register from the given
* raw bytes.
*
* @param bytes the raw data as <tt>byte[]</tt>.
*/
public void setValue(byte[] bytes);
}// interface Register
|
paolodenti/openhab
|
bundles/binding/org.openhab.binding.modbus/src/main/java/net/wimpi/modbus/procimg/Register.java
|
Java
|
epl-1.0
| 1,599
|
/*
* Context tracking: Probe on high level context boundaries such as kernel
* and userspace. This includes syscalls and exceptions entry/exit.
*
* This is used by RCU to remove its dependency on the timer tick while a CPU
* runs in userspace.
*
* Started by Frederic Weisbecker:
*
* Copyright (C) 2012 Red Hat, Inc., Frederic Weisbecker <fweisbec@redhat.com>
*
* Many thanks to Gilad Ben-Yossef, Paul McKenney, Ingo Molnar, Andrew Morton,
* Steven Rostedt, Peter Zijlstra for suggestions and improvements.
*
*/
#include <linux/context_tracking.h>
#include <linux/rcupdate.h>
#include <linux/sched.h>
#include <linux/hardirq.h>
#include <linux/export.h>
#define CREATE_TRACE_POINTS
#include <trace/events/context_tracking.h>
struct static_key context_tracking_enabled = STATIC_KEY_INIT_FALSE;
EXPORT_SYMBOL_GPL(context_tracking_enabled);
DEFINE_PER_CPU(struct context_tracking, context_tracking);
EXPORT_SYMBOL_GPL(context_tracking);
void context_tracking_cpu_set(int cpu)
{
if (!per_cpu(context_tracking.active, cpu)) {
per_cpu(context_tracking.active, cpu) = true;
static_key_slow_inc(&context_tracking_enabled);
}
}
/**
* context_tracking_user_enter - Inform the context tracking that the CPU is going to
* enter userspace mode.
*
* This function must be called right before we switch from the kernel
* to userspace, when it's guaranteed the remaining kernel instructions
* to execute won't use any RCU read side critical section because this
* function sets RCU in extended quiescent state.
*/
void context_tracking_user_enter(void)
{
unsigned long flags;
/*
* Repeat the user_enter() check here because some archs may be calling
* this from asm and if no CPU needs context tracking, they shouldn't
* go further. Repeat the check here until they support the static key
* check.
*/
if (!static_key_false(&context_tracking_enabled))
return;
/*
* Some contexts may involve an exception occuring in an irq,
* leading to that nesting:
* rcu_irq_enter() rcu_user_exit() rcu_user_exit() rcu_irq_exit()
* This would mess up the dyntick_nesting count though. And rcu_irq_*()
* helpers are enough to protect RCU uses inside the exception. So
* just return immediately if we detect we are in an IRQ.
*/
if (in_interrupt())
return;
/* Kernel threads aren't supposed to go to userspace */
WARN_ON_ONCE(!current->mm);
local_irq_save(flags);
if ( __this_cpu_read(context_tracking.state) != IN_USER) {
if (__this_cpu_read(context_tracking.active)) {
trace_user_enter(0);
/*
* At this stage, only low level arch entry code remains and
* then we'll run in userspace. We can assume there won't be
* any RCU read-side critical section until the next call to
* user_exit() or rcu_irq_enter(). Let's remove RCU's dependency
* on the tick.
*/
vtime_user_enter(current);
rcu_user_enter();
}
/*
* Even if context tracking is disabled on this CPU, because it's outside
* the full dynticks mask for example, we still have to keep track of the
* context transitions and states to prevent inconsistency on those of
* other CPUs.
* If a task triggers an exception in userspace, sleep on the exception
* handler and then migrate to another CPU, that new CPU must know where
* the exception returns by the time we call exception_exit().
* This information can only be provided by the previous CPU when it called
* exception_enter().
* OTOH we can spare the calls to vtime and RCU when context_tracking.active
* is false because we know that CPU is not tickless.
*/
__this_cpu_write(context_tracking.state, IN_USER);
}
local_irq_restore(flags);
}
#ifdef CONFIG_PREEMPT
/**
* preempt_schedule_context - preempt_schedule called by tracing
*
* The tracing infrastructure uses preempt_enable_notrace to prevent
* recursion and tracing preempt enabling caused by the tracing
* infrastructure itself. But as tracing can happen in areas coming
* from userspace or just about to enter userspace, a preempt enable
* can occur before user_exit() is called. This will cause the scheduler
* to be called when the system is still in usermode.
*
* To prevent this, the preempt_enable_notrace will use this function
* instead of preempt_schedule() to exit user context if needed before
* calling the scheduler.
*/
asmlinkage void __sched notrace preempt_schedule_context(void)
{
enum ctx_state prev_ctx;
if (likely(!preemptible()))
return;
/*
* Need to disable preemption in case user_exit() is traced
* and the tracer calls preempt_enable_notrace() causing
* an infinite recursion.
*/
preempt_disable_notrace();
prev_ctx = exception_enter();
preempt_enable_no_resched_notrace();
preempt_schedule();
preempt_disable_notrace();
exception_exit(prev_ctx);
preempt_enable_notrace();
}
EXPORT_SYMBOL_GPL(preempt_schedule_context);
#endif /* CONFIG_PREEMPT */
/**
* context_tracking_user_exit - Inform the context tracking that the CPU is
* exiting userspace mode and entering the kernel.
*
* This function must be called after we entered the kernel from userspace
* before any use of RCU read side critical section. This potentially include
* any high level kernel code like syscalls, exceptions, signal handling, etc...
*
* This call supports re-entrancy. This way it can be called from any exception
* handler without needing to know if we came from userspace or not.
*/
void context_tracking_user_exit(void)
{
unsigned long flags;
if (!static_key_false(&context_tracking_enabled))
return;
if (in_interrupt())
return;
local_irq_save(flags);
if (__this_cpu_read(context_tracking.state) == IN_USER) {
if (__this_cpu_read(context_tracking.active)) {
/*
* We are going to run code that may use RCU. Inform
* RCU core about that (ie: we may need the tick again).
*/
rcu_user_exit();
vtime_user_exit(current);
trace_user_exit(0);
}
__this_cpu_write(context_tracking.state, IN_KERNEL);
}
local_irq_restore(flags);
}
/**
* __context_tracking_task_switch - context switch the syscall callbacks
* @prev: the task that is being switched out
* @next: the task that is being switched in
*
* The context tracking uses the syscall slow path to implement its user-kernel
* boundaries probes on syscalls. This way it doesn't impact the syscall fast
* path on CPUs that don't do context tracking.
*
* But we need to clear the flag on the previous task because it may later
* migrate to some CPU that doesn't do the context tracking. As such the TIF
* flag may not be desired there.
*/
void __context_tracking_task_switch(struct task_struct *prev,
struct task_struct *next)
{
clear_tsk_thread_flag(prev, TIF_NOHZ);
set_tsk_thread_flag(next, TIF_NOHZ);
}
#ifdef CONFIG_CONTEXT_TRACKING_FORCE
void __init context_tracking_init(void)
{
int cpu;
for_each_possible_cpu(cpu)
context_tracking_cpu_set(cpu);
}
#endif
|
ziqiaozhou/cachebar
|
source/kernel/context_tracking.c
|
C
|
gpl-2.0
| 6,982
|
// ParsleyConfig definition if not already set
window.ParsleyConfig = window.ParsleyConfig || {};
window.ParsleyConfig.i18n = window.ParsleyConfig.i18n || {};
// Define then the messages
window.ParsleyConfig.i18n.nl = jQuery.extend(window.ParsleyConfig.i18n.nl || {}, {
defaultMessage: "Deze waarde lijkt onjuist.",
type: {
email: "Dit lijkt geen geldig e-mail adres te zijn.",
url: "Dit lijkt geen geldige URL te zijn.",
number: "Deze waarde moet een nummer zijn.",
integer: "Deze waarde moet een nummer zijn.",
digits: "Deze waarde moet numeriek zijn.",
alphanum: "Deze waarde moet alfanumeriek zijn."
},
notblank: "Deze waarde mag niet leeg zijn.",
required: "Dit veld is verplicht.",
pattern: "Deze waarde lijkt onjuist te zijn.",
min: "Deze waarde mag niet lager zijn dan %s.",
max: "Deze waarde mag niet groter zijn dan %s.",
range: "Deze waarde moet tussen %s en %s liggen.",
minlength: "Deze tekst is te kort. Deze moet uit minimaal %s karakters bestaan.",
maxlength: "Deze waarde is te lang. Deze mag maximaal %s karakters lang zijn.",
length: "Deze waarde moet tussen %s en %s karakters lang zijn.",
equalto: "Deze waardes moeten identiek zijn."
});
// If file is loaded after Parsley main file, auto-load locale
if ('undefined' !== typeof window.ParsleyValidator)
window.ParsleyValidator.addCatalog('nl', window.ParsleyConfig.i18n.nl, true);
|
thebykov/trufit
|
wp-content/themes/sportify/tesla_framework/static/js/parsley/locales/nl.js
|
JavaScript
|
gpl-3.0
| 1,519
|
//! moment.js locale configuration
//! locale : Luxembourgish [lb]
//! author : mweimerskirch : https://github.com/mweimerskirch
//! author : David Raison : https://github.com/kwisatz
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
'm': ['eng Minutt', 'enger Minutt'],
'h': ['eng Stonn', 'enger Stonn'],
'd': ['een Dag', 'engem Dag'],
'M': ['ee Mount', 'engem Mount'],
'y': ['ee Joer', 'engem Joer']
};
return withoutSuffix ? format[key][0] : format[key][1];
}
function processFutureTime(string) {
var number = string.substr(0, string.indexOf(' '));
if (eifelerRegelAppliesToNumber(number)) {
return 'a ' + string;
}
return 'an ' + string;
}
function processPastTime(string) {
var number = string.substr(0, string.indexOf(' '));
if (eifelerRegelAppliesToNumber(number)) {
return 'viru ' + string;
}
return 'virun ' + string;
}
/**
* Returns true if the word before the given number loses the '-n' ending.
* e.g. 'an 10 Deeg' but 'a 5 Deeg'
*
* @param number {integer}
* @returns {boolean}
*/
function eifelerRegelAppliesToNumber(number) {
number = parseInt(number, 10);
if (isNaN(number)) {
return false;
}
if (number < 0) {
// Negative Number --> always true
return true;
} else if (number < 10) {
// Only 1 digit
if (4 <= number && number <= 7) {
return true;
}
return false;
} else if (number < 100) {
// 2 digits
var lastDigit = number % 10, firstDigit = number / 10;
if (lastDigit === 0) {
return eifelerRegelAppliesToNumber(firstDigit);
}
return eifelerRegelAppliesToNumber(lastDigit);
} else if (number < 10000) {
// 3 or 4 digits --> recursively check first digit
while (number >= 10) {
number = number / 10;
}
return eifelerRegelAppliesToNumber(number);
} else {
// Anything larger than 4 digits: recursively check first n-3 digits
number = number / 1000;
return eifelerRegelAppliesToNumber(number);
}
}
var lb = moment.defineLocale('lb', {
months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
monthsParseExact : true,
weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'),
weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),
weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),
weekdaysParseExact : true,
longDateFormat: {
LT: 'H:mm [Auer]',
LTS: 'H:mm:ss [Auer]',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY H:mm [Auer]',
LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]'
},
calendar: {
sameDay: '[Haut um] LT',
sameElse: 'L',
nextDay: '[Muer um] LT',
nextWeek: 'dddd [um] LT',
lastDay: '[Gëschter um] LT',
lastWeek: function () {
// Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule
switch (this.day()) {
case 2:
case 4:
return '[Leschten] dddd [um] LT';
default:
return '[Leschte] dddd [um] LT';
}
}
},
relativeTime : {
future : processFutureTime,
past : processPastTime,
s : 'e puer Sekonnen',
ss : '%d Sekonnen',
m : processRelativeTime,
mm : '%d Minutten',
h : processRelativeTime,
hh : '%d Stonnen',
d : processRelativeTime,
dd : '%d Deeg',
M : processRelativeTime,
MM : '%d Méint',
y : processRelativeTime,
yy : '%d Joer'
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1, // Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return lb;
})));
|
gitee2008/glaf
|
webapps/glaf/static/AdminLTE/bower_components/moment/locale/lb.js
|
JavaScript
|
apache-2.0
| 4,506
|
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import (
"k8s.io/kubernetes/pkg/runtime"
)
func addDefaultingFuncs(scheme *runtime.Scheme) {
scheme.AddDefaultingFuncs(
SetDefaults_Job,
)
}
func SetDefaults_Job(obj *Job) {
// For a non-parallel job, you can leave both `.spec.completions` and
// `.spec.parallelism` unset. When both are unset, both are defaulted to 1.
if obj.Spec.Completions == nil && obj.Spec.Parallelism == nil {
obj.Spec.Completions = new(int32)
*obj.Spec.Completions = 1
obj.Spec.Parallelism = new(int32)
*obj.Spec.Parallelism = 1
}
if obj.Spec.Parallelism == nil {
obj.Spec.Parallelism = new(int32)
*obj.Spec.Parallelism = 1
}
}
|
mwringe/heapster
|
vendor/k8s.io/kubernetes/pkg/apis/batch/v1/defaults.go
|
GO
|
apache-2.0
| 1,212
|
<style>
div { width: 0px; }
span { text-decoration: underline; cursor: hand; }
</style>
<script>
function toggleFullScreen() {
if (document.webkitIsFullScreen)
document.webkitCancelFullScreen();
else
document.getElementsByTagName('div')[0].webkitRequestFullscreen();
}
</script>
<body>
This tests that an element with a 0px width will not cause the window to disappear when entering full screen. <span onclick="toggleFullScreen()">Click to toggle full screen.</span>
<div>
</div>
</body>
|
nwjs/chromium.src
|
third_party/blink/manual_tests/fullscreen/full-screen-zero-width.html
|
HTML
|
bsd-3-clause
| 531
|
/**************************************************************************
*
* isapnp.h -- Etherboot isapnp support for the 3Com 3c515
* Written 2002-2003 by Timothy Legge <tlegge@rogers.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 2 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, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Portions of this code:
* Copyright (C) 2001 P.J.H.Fox (fox@roestock.demon.co.uk)
*
*
*
* REVISION HISTORY:
* ================
* Version 0.1 April 26, 2002 TJL
* Version 0.2 01/08/2003 TJL Renamed from 3c515_isapnp.h
*
*
* Generalised into an ISAPnP bus that can be used by more than just
* the 3c515 by Michael Brown <mbrown@fensystems.co.uk>
*
***************************************************************************/
FILE_LICENCE ( GPL2_OR_LATER );
#ifndef ISAPNP_H
#define ISAPNP_H
#include <stdint.h>
#include <ipxe/isa_ids.h>
#include <ipxe/device.h>
#include <ipxe/tables.h>
/*
* ISAPnP constants
*
*/
/* Port addresses */
#define ISAPNP_ADDRESS 0x279
#define ISAPNP_WRITE_DATA 0xa79
#define ISAPNP_READ_PORT_MIN 0x203
#define ISAPNP_READ_PORT_START 0x213 /* ISAPnP spec says 0x203, but
* Linux ISAPnP starts at
* 0x213 with no explanatory
* comment. 0x203 probably
* clashes with something. */
#define ISAPNP_READ_PORT_MAX 0x3ff
#define ISAPNP_READ_PORT_STEP 0x10 /* Can be any multiple of 4
* according to the spec, but
* since ISA I/O addresses are
* allocated in blocks of 16,
* it makes no sense to use
* any value less than 16.
*/
/* Card select numbers */
#define ISAPNP_CSN_MIN 0x01
#define ISAPNP_CSN_MAX 0x0f
/* Registers */
#define ISAPNP_READPORT 0x00
#define ISAPNP_SERIALISOLATION 0x01
#define ISAPNP_CONFIGCONTROL 0x02
#define ISAPNP_WAKE 0x03
#define ISAPNP_RESOURCEDATA 0x04
#define ISAPNP_STATUS 0x05
#define ISAPNP_CARDSELECTNUMBER 0x06
#define ISAPNP_LOGICALDEVICENUMBER 0x07
#define ISAPNP_ACTIVATE 0x30
#define ISAPNP_IORANGECHECK 0x31
#define ISAPNP_IOBASE(n) ( 0x60 + ( (n) * 2 ) )
#define ISAPNP_IRQNO(n) ( 0x70 + ( (n) * 2 ) )
#define ISAPNP_IRQTYPE(n) ( 0x71 + ( (n) * 2 ) )
/* Bits in the CONFIGCONTROL register */
#define ISAPNP_CONFIG_RESET ( 1 << 0 )
#define ISAPNP_CONFIG_WAIT_FOR_KEY ( 1 << 1 )
#define ISAPNP_CONFIG_RESET_CSN ( 1 << 2 )
#define ISAPNP_CONFIG_RESET_DRV ( ISAPNP_CONFIG_RESET | \
ISAPNP_CONFIG_WAIT_FOR_KEY | \
ISAPNP_CONFIG_RESET_CSN )
/* The LFSR used for the initiation key and for checksumming */
#define ISAPNP_LFSR_SEED 0x6a
/* Small tags */
#define ISAPNP_IS_SMALL_TAG(tag) ( ! ( (tag) & 0x80 ) )
#define ISAPNP_SMALL_TAG_NAME(tag) ( ( (tag) >> 3 ) & 0xf )
#define ISAPNP_SMALL_TAG_LEN(tag) ( ( (tag) & 0x7 ) )
#define ISAPNP_TAG_PNPVERNO 0x01
#define ISAPNP_TAG_LOGDEVID 0x02
#define ISAPNP_TAG_COMPATDEVID 0x03
#define ISAPNP_TAG_IRQ 0x04
#define ISAPNP_TAG_DMA 0x05
#define ISAPNP_TAG_STARTDEP 0x06
#define ISAPNP_TAG_ENDDEP 0x07
#define ISAPNP_TAG_IOPORT 0x08
#define ISAPNP_TAG_FIXEDIO 0x09
#define ISAPNP_TAG_RSVDSHORTA 0x0A
#define ISAPNP_TAG_RSVDSHORTB 0x0B
#define ISAPNP_TAG_RSVDSHORTC 0x0C
#define ISAPNP_TAG_RSVDSHORTD 0x0D
#define ISAPNP_TAG_VENDORSHORT 0x0E
#define ISAPNP_TAG_END 0x0F
/* Large tags */
#define ISAPNP_IS_LARGE_TAG(tag) ( ( (tag) & 0x80 ) )
#define ISAPNP_LARGE_TAG_NAME(tag) (tag)
#define ISAPNP_TAG_MEMRANGE 0x81
#define ISAPNP_TAG_ANSISTR 0x82
#define ISAPNP_TAG_UNICODESTR 0x83
#define ISAPNP_TAG_VENDORLONG 0x84
#define ISAPNP_TAG_MEM32RANGE 0x85
#define ISAPNP_TAG_FIXEDMEM32RANGE 0x86
#define ISAPNP_TAG_RSVDLONG0 0xF0
#define ISAPNP_TAG_RSVDLONG1 0xF1
#define ISAPNP_TAG_RSVDLONG2 0xF2
#define ISAPNP_TAG_RSVDLONG3 0xF3
#define ISAPNP_TAG_RSVDLONG4 0xF4
#define ISAPNP_TAG_RSVDLONG5 0xF5
#define ISAPNP_TAG_RSVDLONG6 0xF6
#define ISAPNP_TAG_RSVDLONG7 0xF7
#define ISAPNP_TAG_RSVDLONG8 0xF8
#define ISAPNP_TAG_RSVDLONG9 0xF9
#define ISAPNP_TAG_RSVDLONGA 0xFA
#define ISAPNP_TAG_RSVDLONGB 0xFB
#define ISAPNP_TAG_RSVDLONGC 0xFC
#define ISAPNP_TAG_RSVDLONGD 0xFD
#define ISAPNP_TAG_RSVDLONGE 0xFE
#define ISAPNP_TAG_RSVDLONGF 0xFF
#define ISAPNP_TAG_PSEUDO_NEWBOARD 0x100
/** An ISAPnP serial identifier */
struct isapnp_identifier {
/** Vendor ID */
uint16_t vendor_id;
/** Product ID */
uint16_t prod_id;
/** Serial number */
uint32_t serial;
/** Checksum */
uint8_t checksum;
} __attribute__ (( packed ));
/** An ISAPnP logical device ID structure */
struct isapnp_logdevid {
/** Vendor ID */
uint16_t vendor_id;
/** Product ID */
uint16_t prod_id;
/** Flags */
uint16_t flags;
} __attribute__ (( packed ));
/** An ISAPnP device ID list entry */
struct isapnp_device_id {
/** Name */
const char *name;
/** Vendor ID */
uint16_t vendor_id;
/** Product ID */
uint16_t prod_id;
};
/** An ISAPnP device */
struct isapnp_device {
/** Generic device */
struct device dev;
/** Vendor ID */
uint16_t vendor_id;
/** Product ID */
uint16_t prod_id;
/** I/O address */
uint16_t ioaddr;
/** Interrupt number */
uint8_t irqno;
/** Card Select Number */
uint8_t csn;
/** Logical Device ID */
uint8_t logdev;
/** Driver for this device */
struct isapnp_driver *driver;
/** Driver-private data
*
* Use isapnp_set_drvdata() and isapnp_get_drvdata() to access
* this field.
*/
void *priv;
};
/** An ISAPnP driver */
struct isapnp_driver {
/** ISAPnP ID table */
struct isapnp_device_id *ids;
/** Number of entries in ISAPnP ID table */
unsigned int id_count;
/**
* Probe device
*
* @v isapnp ISAPnP device
* @v id Matching entry in ID table
* @ret rc Return status code
*/
int ( * probe ) ( struct isapnp_device *isapnp,
const struct isapnp_device_id *id );
/**
* Remove device
*
* @v isapnp ISAPnP device
*/
void ( * remove ) ( struct isapnp_device *isapnp );
};
/** ISAPnP driver table */
#define ISAPNP_DRIVERS __table ( struct isapnp_driver, "isapnp_drivers" )
/** Declare an ISAPnP driver */
#define __isapnp_driver __table_entry ( ISAPNP_DRIVERS, 01 )
extern uint16_t isapnp_read_port;
extern void isapnp_device_activation ( struct isapnp_device *isapnp,
int activation );
/**
* Activate ISAPnP device
*
* @v isapnp ISAPnP device
*/
static inline void activate_isapnp_device ( struct isapnp_device *isapnp ) {
isapnp_device_activation ( isapnp, 1 );
}
/**
* Deactivate ISAPnP device
*
* @v isapnp ISAPnP device
*/
static inline void deactivate_isapnp_device ( struct isapnp_device *isapnp ) {
isapnp_device_activation ( isapnp, 0 );
}
/**
* Set ISAPnP driver-private data
*
* @v isapnp ISAPnP device
* @v priv Private data
*/
static inline void isapnp_set_drvdata ( struct isapnp_device *isapnp,
void *priv ) {
isapnp->priv = priv;
}
/**
* Get ISAPnP driver-private data
*
* @v isapnp ISAPnP device
* @ret priv Private data
*/
static inline void * isapnp_get_drvdata ( struct isapnp_device *isapnp ) {
return isapnp->priv;
}
#endif /* ISAPNP_H */
|
KernelAnalysisPlatform/KlareDbg
|
tracers/qemu/decaf/roms/ipxe/src/include/ipxe/isapnp.h
|
C
|
gpl-3.0
| 7,594
|
/*
Copyright 2015 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package network
// Tests network performance using iperf or other containers.
import (
"bytes"
"encoding/json"
"fmt"
"math"
"strconv"
"strings"
"k8s.io/kubernetes/test/e2e/framework"
)
const (
megabyte = 1024 * 1024
)
// IPerfResults is a struct that stores some IPerfCSVResult
type IPerfResults struct {
BandwidthMap map[string]int64
}
// IPerfCSVResult struct modelling an iperf record....
// 20160314154239,172.17.0.3,34152,172.17.0.2,5001,3,0.0-10.0,33843707904,27074774092
type IPerfCSVResult struct {
date string // field 1 in the csv
cli string // field 2 in the csv
cliPort int64 // ...
server string
servPort int64
id string
interval string
transferBits int64
bandwidthBits int64
}
func (i *IPerfCSVResult) bandwidthMB() int64 {
return int64(math.Round(float64(i.bandwidthBits) / float64(megabyte) / 8))
}
// Add adds a new result to the Results struct.
func (i *IPerfResults) Add(ipr *IPerfCSVResult) {
if i.BandwidthMap == nil {
i.BandwidthMap = map[string]int64{}
}
i.BandwidthMap[ipr.cli] = ipr.bandwidthBits
}
// ToTSV exports an easily readable tab delimited format of all IPerfResults.
func (i *IPerfResults) ToTSV() string {
if len(i.BandwidthMap) < 1 {
framework.Logf("Warning: no data in bandwidth map")
}
var buffer bytes.Buffer
for node, bandwidth := range i.BandwidthMap {
asJSON, _ := json.Marshal(node)
buffer.WriteString("\t " + string(asJSON) + "\t " + fmt.Sprintf("%E", float64(bandwidth)))
}
return buffer.String()
}
// NewIPerf parses an IPerf CSV output line into an IPerfCSVResult.
func NewIPerf(csvLine string) (*IPerfCSVResult, error) {
if len(csvLine) == 0 {
return nil, fmt.Errorf("No iperf output received in csv line")
}
csvLine = strings.Trim(csvLine, "\n")
slice := StrSlice(strings.Split(csvLine, ","))
if len(slice) != 9 {
return nil, fmt.Errorf("Incorrect fields in the output: %v (%v out of 9)", slice, len(slice))
}
i := IPerfCSVResult{}
i.date = slice.get(0)
i.cli = slice.get(1)
i.cliPort = intOrFail("client port", slice.get(2))
i.server = slice.get(3)
i.servPort = intOrFail("server port", slice.get(4))
i.id = slice.get(5)
i.interval = slice.get(6)
i.transferBits = intOrFail("transfer port", slice.get(7))
i.bandwidthBits = intOrFail("bandwidth port", slice.get(8))
return &i, nil
}
// StrSlice represents a string slice
type StrSlice []string
func (s StrSlice) get(i int) string {
if i >= 0 && i < len(s) {
return s[i]
}
return ""
}
// intOrFail is a convenience function for parsing integers.
func intOrFail(debugName string, rawValue string) int64 {
value, err := strconv.ParseInt(rawValue, 10, 64)
if err != nil {
framework.Failf("Failed parsing value %v from the string '%v' as an integer", debugName, rawValue)
}
return value
}
// IPerf2EnhancedCSVResults models the results produced by iperf2 when run with the -e (--enhancedreports) flag.
type IPerf2EnhancedCSVResults struct {
Intervals []*IPerfCSVResult
Total *IPerfCSVResult
}
// ParseIPerf2EnhancedResultsFromCSV parses results from iperf2 when given the -e (--enhancedreports)
// and `--reportstyle C` options.
// Example output:
// 20201210141800.884,10.244.2.24,47880,10.96.114.79,6789,3,0.0-1.0,1677852672,13422821376
// 20201210141801.881,10.244.2.24,47880,10.96.114.79,6789,3,1.0-2.0,1980760064,15846080512
// 20201210141802.883,10.244.2.24,47880,10.96.114.79,6789,3,2.0-3.0,1886650368,15093202944
// 20201210141803.882,10.244.2.24,47880,10.96.114.79,6789,3,3.0-4.0,2035417088,16283336704
// 20201210141804.879,10.244.2.24,47880,10.96.114.79,6789,3,4.0-5.0,1922957312,15383658496
// 20201210141805.881,10.244.2.24,47880,10.96.114.79,6789,3,5.0-6.0,2095316992,16762535936
// 20201210141806.882,10.244.2.24,47880,10.96.114.79,6789,3,6.0-7.0,1741291520,13930332160
// 20201210141807.879,10.244.2.24,47880,10.96.114.79,6789,3,7.0-8.0,1862926336,14903410688
// 20201210141808.878,10.244.2.24,47880,10.96.114.79,6789,3,8.0-9.0,1821245440,14569963520
// 20201210141809.849,10.244.2.24,47880,10.96.114.79,6789,3,0.0-10.0,18752208896,15052492511
func ParseIPerf2EnhancedResultsFromCSV(output string) (*IPerf2EnhancedCSVResults, error) {
var parsedResults []*IPerfCSVResult
for _, line := range strings.Split(output, "\n") {
parsed, err := NewIPerf(line)
if err != nil {
return nil, err
}
parsedResults = append(parsedResults, parsed)
}
if parsedResults == nil || len(parsedResults) == 0 {
return nil, fmt.Errorf("no results parsed from iperf2 output")
}
// format:
// all but last lines are intervals
intervals := parsedResults[:len(parsedResults)-1]
// last line is an aggregation
total := parsedResults[len(parsedResults)-1]
return &IPerf2EnhancedCSVResults{
Intervals: intervals,
Total: total,
}, nil
}
// IPerf2NodeToNodeCSVResults models the results of running iperf2 between a daemonset of clients and
// a single server. The node name of the server is captured, along with a map of client node name
// to iperf2 results.
type IPerf2NodeToNodeCSVResults struct {
ServerNode string
Results map[string]*IPerf2EnhancedCSVResults
}
|
sallyom/origin
|
vendor/k8s.io/kubernetes/test/e2e/network/util_iperf.go
|
GO
|
apache-2.0
| 5,698
|
/*
* Copyright (c) 2005-2006 Intel Corporation. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* 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.
*
* 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.
*/
#ifndef RDMA_USER_CM_H
#define RDMA_USER_CM_H
#include <linux/types.h>
#include <linux/in6.h>
#include <rdma/ib_user_verbs.h>
#include <rdma/ib_user_sa.h>
#define RDMA_USER_CM_ABI_VERSION 4
#define RDMA_MAX_PRIVATE_DATA 256
enum {
RDMA_USER_CM_CMD_CREATE_ID,
RDMA_USER_CM_CMD_DESTROY_ID,
RDMA_USER_CM_CMD_BIND_ADDR,
RDMA_USER_CM_CMD_RESOLVE_ADDR,
RDMA_USER_CM_CMD_RESOLVE_ROUTE,
RDMA_USER_CM_CMD_QUERY_ROUTE,
RDMA_USER_CM_CMD_CONNECT,
RDMA_USER_CM_CMD_LISTEN,
RDMA_USER_CM_CMD_ACCEPT,
RDMA_USER_CM_CMD_REJECT,
RDMA_USER_CM_CMD_DISCONNECT,
RDMA_USER_CM_CMD_INIT_QP_ATTR,
RDMA_USER_CM_CMD_GET_EVENT,
RDMA_USER_CM_CMD_GET_OPTION,
RDMA_USER_CM_CMD_SET_OPTION,
RDMA_USER_CM_CMD_NOTIFY,
RDMA_USER_CM_CMD_JOIN_MCAST,
RDMA_USER_CM_CMD_LEAVE_MCAST,
RDMA_USER_CM_CMD_MIGRATE_ID
};
/*
* command ABI structures.
*/
struct rdma_ucm_cmd_hdr {
__u32 cmd;
__u16 in;
__u16 out;
};
struct rdma_ucm_create_id {
__u64 uid;
__u64 response;
__u16 ps;
__u8 qp_type;
__u8 reserved[5];
};
struct rdma_ucm_create_id_resp {
__u32 id;
};
struct rdma_ucm_destroy_id {
__u64 response;
__u32 id;
__u32 reserved;
};
struct rdma_ucm_destroy_id_resp {
__u32 events_reported;
};
struct rdma_ucm_bind_addr {
__u64 response;
struct sockaddr_in6 addr;
__u32 id;
};
struct rdma_ucm_resolve_addr {
struct sockaddr_in6 src_addr;
struct sockaddr_in6 dst_addr;
__u32 id;
__u32 timeout_ms;
};
struct rdma_ucm_resolve_route {
__u32 id;
__u32 timeout_ms;
};
struct rdma_ucm_query_route {
__u64 response;
__u32 id;
__u32 reserved;
};
struct rdma_ucm_query_route_resp {
__u64 node_guid;
struct ib_user_path_rec ib_route[2];
struct sockaddr_in6 src_addr;
struct sockaddr_in6 dst_addr;
__u32 num_paths;
__u8 port_num;
__u8 reserved[3];
};
struct rdma_ucm_conn_param {
__u32 qp_num;
__u32 reserved;
__u8 private_data[RDMA_MAX_PRIVATE_DATA];
__u8 private_data_len;
__u8 srq;
__u8 responder_resources;
__u8 initiator_depth;
__u8 flow_control;
__u8 retry_count;
__u8 rnr_retry_count;
__u8 valid;
};
struct rdma_ucm_ud_param {
__u32 qp_num;
__u32 qkey;
struct ib_uverbs_ah_attr ah_attr;
__u8 private_data[RDMA_MAX_PRIVATE_DATA];
__u8 private_data_len;
__u8 reserved[7];
};
struct rdma_ucm_connect {
struct rdma_ucm_conn_param conn_param;
__u32 id;
__u32 reserved;
};
struct rdma_ucm_listen {
__u32 id;
__u32 backlog;
};
struct rdma_ucm_accept {
__u64 uid;
struct rdma_ucm_conn_param conn_param;
__u32 id;
__u32 reserved;
};
struct rdma_ucm_reject {
__u32 id;
__u8 private_data_len;
__u8 reserved[3];
__u8 private_data[RDMA_MAX_PRIVATE_DATA];
};
struct rdma_ucm_disconnect {
__u32 id;
};
struct rdma_ucm_init_qp_attr {
__u64 response;
__u32 id;
__u32 qp_state;
};
struct rdma_ucm_notify {
__u32 id;
__u32 event;
};
struct rdma_ucm_join_mcast {
__u64 response; /* rdma_ucm_create_id_resp */
__u64 uid;
struct sockaddr_in6 addr;
__u32 id;
};
struct rdma_ucm_get_event {
__u64 response;
};
struct rdma_ucm_event_resp {
__u64 uid;
__u32 id;
__u32 event;
__u32 status;
union {
struct rdma_ucm_conn_param conn;
struct rdma_ucm_ud_param ud;
} param;
};
/* Option levels */
enum {
RDMA_OPTION_ID = 0,
RDMA_OPTION_IB = 1
};
/* Option details */
enum {
RDMA_OPTION_ID_TOS = 0,
RDMA_OPTION_ID_REUSEADDR = 1,
RDMA_OPTION_IB_PATH = 1
};
struct rdma_ucm_set_option {
__u64 optval;
__u32 id;
__u32 level;
__u32 optname;
__u32 optlen;
};
struct rdma_ucm_migrate_id {
__u64 response;
__u32 id;
__u32 fd;
};
struct rdma_ucm_migrate_resp {
__u32 events_reported;
};
#endif /* RDMA_USER_CM_H */
|
talnoah/android_kernel_htc_dlx
|
virt/include/rdma/rdma_user_cm.h
|
C
|
gpl-2.0
| 5,030
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="robots" content="index, follow, all" />
<title>Thelia\Model\Base\ProductI18nQuery | </title>
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css">
</head>
<body id="class">
<div class="header">
<ul>
<li><a href="../../../classes.html">Classes</a></li>
<li><a href="../../../namespaces.html">Namespaces</a></li>
<li><a href="../../../interfaces.html">Interfaces</a></li>
<li><a href="../../../traits.html">Traits</a></li>
<li><a href="../../../doc-index.html">Index</a></li>
</ul>
<div id="title"></div>
<div class="type">Class</div>
<h1><a href="../../../Thelia/Model/Base.html">Thelia\Model\Base</a>\ProductI18nQuery</h1>
</div>
<div class="content">
<p>abstract class
<strong>ProductI18nQuery</strong> extends <abbr title="Propel\Runtime\ActiveQuery\ModelCriteria">ModelCriteria</abbr></p>
<div class="description">
<p>Base class that represents a query for the 'product_i18n' table.</p>
<p>
</p>
</div>
<h2>Methods</h2>
<table>
<tr>
<td class="type">
</td>
<td class="last">
<a href="#method___construct">__construct</a>(string $dbName = 'thelia', string $modelName = '\\Thelia\\Model\\ProductI18n', string $modelAlias = null)
<p>Initializes internal state of \Thelia\Model\Base\ProductI18nQuery object.</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
static <a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
</td>
<td class="last">
<a href="#method_create">create</a>(string $modelAlias = null, <abbr title="Propel\Runtime\ActiveQuery\Criteria">Criteria</abbr> $criteria = null)
<p>Returns a new ChildProductI18nQuery object.</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<a href="../../../Thelia/Model/ProductI18n.html"><abbr title="Thelia\Model\ProductI18n">ProductI18n</abbr></a>|array|mixed
</td>
<td class="last">
<a href="#method_findPk">findPk</a>($key, $con = null)
<p>Find object by primary key.</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="Propel\Runtime\Collection\ObjectCollection">ObjectCollection</abbr>|array|mixed
</td>
<td class="last">
<a href="#method_findPks">findPks</a>(array $keys, <abbr title="Propel\Runtime\Connection\ConnectionInterface">ConnectionInterface</abbr> $con = null)
<p>Find objects by primary key <code> $objs = $c->findPks(array(array(12, 56), array(832, 123), array(123, 456)), $con); </code></p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
</td>
<td class="last">
<a href="#method_filterByPrimaryKey">filterByPrimaryKey</a>(mixed $key)
<p>Filter the query by primary key</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
</td>
<td class="last">
<a href="#method_filterByPrimaryKeys">filterByPrimaryKeys</a>(array $keys)
<p>Filter the query by a list of primary keys</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
</td>
<td class="last">
<a href="#method_filterById">filterById</a>(mixed $id = null, string $comparison = null)
<p>Filter the query on the id column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
</td>
<td class="last">
<a href="#method_filterByLocale">filterByLocale</a>(string $locale = null, string $comparison = null)
<p>Filter the query on the locale column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
</td>
<td class="last">
<a href="#method_filterByTitle">filterByTitle</a>(string $title = null, string $comparison = null)
<p>Filter the query on the title column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
</td>
<td class="last">
<a href="#method_filterByDescription">filterByDescription</a>(string $description = null, string $comparison = null)
<p>Filter the query on the description column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
</td>
<td class="last">
<a href="#method_filterByChapo">filterByChapo</a>(string $chapo = null, string $comparison = null)
<p>Filter the query on the chapo column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
</td>
<td class="last">
<a href="#method_filterByPostscriptum">filterByPostscriptum</a>(string $postscriptum = null, string $comparison = null)
<p>Filter the query on the postscriptum column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
</td>
<td class="last">
<a href="#method_filterByMetaTitle">filterByMetaTitle</a>(string $metaTitle = null, string $comparison = null)
<p>Filter the query on the meta_title column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
</td>
<td class="last">
<a href="#method_filterByMetaDescription">filterByMetaDescription</a>(string $metaDescription = null, string $comparison = null)
<p>Filter the query on the meta_description column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
</td>
<td class="last">
<a href="#method_filterByMetaKeywords">filterByMetaKeywords</a>(string $metaKeywords = null, string $comparison = null)
<p>Filter the query on the meta_keywords column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
</td>
<td class="last">
<a href="#method_filterByProduct">filterByProduct</a>(<a href="../../../Thelia/Model/Product.html"><abbr title="Thelia\Model\Product">Product</abbr></a>|<abbr title="Propel\Runtime\Collection\ObjectCollection">ObjectCollection</abbr> $product, string $comparison = null)
<p>Filter the query by a related \Thelia\Model\Product object</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
</td>
<td class="last">
<a href="#method_joinProduct">joinProduct</a>(string $relationAlias = null, string $joinType = 'LEFT JOIN')
<p>Adds a JOIN clause to the query using the Product relation</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<a href="../../../Thelia/Model/ProductQuery.html"><abbr title="Thelia\Model\ProductQuery">ProductQuery</abbr></a>
</td>
<td class="last">
<a href="#method_useProductQuery">useProductQuery</a>(string $relationAlias = null, string $joinType = 'LEFT JOIN')
<p>Use the Product relation Product object</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
</td>
<td class="last">
<a href="#method_prune">prune</a>(<a href="../../../Thelia/Model/ProductI18n.html"><abbr title="Thelia\Model\ProductI18n">ProductI18n</abbr></a> $productI18n = null)
<p>Exclude object from result</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
int
</td>
<td class="last">
<a href="#method_doDeleteAll">doDeleteAll</a>(<abbr title="Propel\Runtime\Connection\ConnectionInterface">ConnectionInterface</abbr> $con = null)
<p>Deletes all rows from the product_i18n table.</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
int
</td>
<td class="last">
<a href="#method_delete">delete</a>(<abbr title="Propel\Runtime\Connection\ConnectionInterface">ConnectionInterface</abbr> $con = null)
<p>Performs a DELETE on the database, given a ChildProductI18n or Criteria object OR a primary key value.</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_orderById">orderById</a>($order = Criteria::ASC)
<p>Order by the id column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_orderByLocale">orderByLocale</a>($order = Criteria::ASC)
<p>Order by the locale column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_orderByTitle">orderByTitle</a>($order = Criteria::ASC)
<p>Order by the title column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_orderByDescription">orderByDescription</a>($order = Criteria::ASC)
<p>Order by the description column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_orderByChapo">orderByChapo</a>($order = Criteria::ASC)
<p>Order by the chapo column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_orderByPostscriptum">orderByPostscriptum</a>($order = Criteria::ASC)
<p>Order by the postscriptum column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_orderByMetaTitle">orderByMetaTitle</a>($order = Criteria::ASC)
<p>Order by the meta_title column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_orderByMetaDescription">orderByMetaDescription</a>($order = Criteria::ASC)
<p>Order by the meta_description column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_orderByMetaKeywords">orderByMetaKeywords</a>($order = Criteria::ASC)
<p>Order by the meta_keywords column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_groupById">groupById</a>()
<p>Group by the id column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_groupByLocale">groupByLocale</a>()
<p>Group by the locale column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_groupByTitle">groupByTitle</a>()
<p>Group by the title column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_groupByDescription">groupByDescription</a>()
<p>Group by the description column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_groupByChapo">groupByChapo</a>()
<p>Group by the chapo column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_groupByPostscriptum">groupByPostscriptum</a>()
<p>Group by the postscriptum column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_groupByMetaTitle">groupByMetaTitle</a>()
<p>Group by the meta_title column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_groupByMetaDescription">groupByMetaDescription</a>()
<p>Group by the meta_description column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_groupByMetaKeywords">groupByMetaKeywords</a>()
<p>Group by the meta_keywords column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_leftJoin">leftJoin</a>($relation)
<p>Adds a LEFT JOIN clause to the query</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_rightJoin">rightJoin</a>($relation)
<p>Adds a RIGHT JOIN clause to the query</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_innerJoin">innerJoin</a>($relation)
<p>Adds a INNER JOIN clause to the query</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_leftJoinProduct">leftJoinProduct</a>($relationAlias = null)
<p>Adds a LEFT JOIN clause to the query using the Product relation</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_rightJoinProduct">rightJoinProduct</a>($relationAlias = null)
<p>Adds a RIGHT JOIN clause to the query using the Product relation</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
</td>
<td class="last">
<a href="#method_innerJoinProduct">innerJoinProduct</a>($relationAlias = null)
<p>Adds a INNER JOIN clause to the query using the Product relation</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18n">ChildProductI18n</abbr>
</td>
<td class="last">
<a href="#method_findOne">findOne</a>(<abbr title="ConnectionInterface ">ConnectionInterface </abbr> $con = null)
<p>Return the first ChildProductI18n matching the query</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18n">ChildProductI18n</abbr>
</td>
<td class="last">
<a href="#method_findOneOrCreate">findOneOrCreate</a>(<abbr title="ConnectionInterface ">ConnectionInterface </abbr> $con = null)
<p>Return the first ChildProductI18n matching the query, or a new ChildProductI18n object populated from the query conditions when no match is found</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18n">ChildProductI18n</abbr>
</td>
<td class="last">
<a href="#method_findOneById">findOneById</a>(<abbr title="int ">int </abbr> $id)
<p>Return the first ChildProductI18n filtered by the id column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18n">ChildProductI18n</abbr>
</td>
<td class="last">
<a href="#method_findOneByLocale">findOneByLocale</a>(<abbr title="string ">string </abbr> $locale)
<p>Return the first ChildProductI18n filtered by the locale column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18n">ChildProductI18n</abbr>
</td>
<td class="last">
<a href="#method_findOneByTitle">findOneByTitle</a>(<abbr title="string ">string </abbr> $title)
<p>Return the first ChildProductI18n filtered by the title column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18n">ChildProductI18n</abbr>
</td>
<td class="last">
<a href="#method_findOneByDescription">findOneByDescription</a>(<abbr title="string ">string </abbr> $description)
<p>Return the first ChildProductI18n filtered by the description column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18n">ChildProductI18n</abbr>
</td>
<td class="last">
<a href="#method_findOneByChapo">findOneByChapo</a>(<abbr title="string ">string </abbr> $chapo)
<p>Return the first ChildProductI18n filtered by the chapo column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18n">ChildProductI18n</abbr>
</td>
<td class="last">
<a href="#method_findOneByPostscriptum">findOneByPostscriptum</a>(<abbr title="string ">string </abbr> $postscriptum)
<p>Return the first ChildProductI18n filtered by the postscriptum column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18n">ChildProductI18n</abbr>
</td>
<td class="last">
<a href="#method_findOneByMetaTitle">findOneByMetaTitle</a>(<abbr title="string ">string </abbr> $meta_title)
<p>Return the first ChildProductI18n filtered by the meta_title column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18n">ChildProductI18n</abbr>
</td>
<td class="last">
<a href="#method_findOneByMetaDescription">findOneByMetaDescription</a>(<abbr title="string ">string </abbr> $meta_description)
<p>Return the first ChildProductI18n filtered by the meta_description column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
<abbr title="ChildProductI18n">ChildProductI18n</abbr>
</td>
<td class="last">
<a href="#method_findOneByMetaKeywords">findOneByMetaKeywords</a>(<abbr title="string ">string </abbr> $meta_keywords)
<p>Return the first ChildProductI18n filtered by the meta_keywords column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
array
</td>
<td class="last">
<a href="#method_findById">findById</a>(<abbr title="int ">int </abbr> $id)
<p>Return ChildProductI18n objects filtered by the id column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
array
</td>
<td class="last">
<a href="#method_findByLocale">findByLocale</a>(<abbr title="string ">string </abbr> $locale)
<p>Return ChildProductI18n objects filtered by the locale column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
array
</td>
<td class="last">
<a href="#method_findByTitle">findByTitle</a>(<abbr title="string ">string </abbr> $title)
<p>Return ChildProductI18n objects filtered by the title column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
array
</td>
<td class="last">
<a href="#method_findByDescription">findByDescription</a>(<abbr title="string ">string </abbr> $description)
<p>Return ChildProductI18n objects filtered by the description column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
array
</td>
<td class="last">
<a href="#method_findByChapo">findByChapo</a>(<abbr title="string ">string </abbr> $chapo)
<p>Return ChildProductI18n objects filtered by the chapo column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
array
</td>
<td class="last">
<a href="#method_findByPostscriptum">findByPostscriptum</a>(<abbr title="string ">string </abbr> $postscriptum)
<p>Return ChildProductI18n objects filtered by the postscriptum column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
array
</td>
<td class="last">
<a href="#method_findByMetaTitle">findByMetaTitle</a>(<abbr title="string ">string </abbr> $meta_title)
<p>Return ChildProductI18n objects filtered by the meta_title column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
array
</td>
<td class="last">
<a href="#method_findByMetaDescription">findByMetaDescription</a>(<abbr title="string ">string </abbr> $meta_description)
<p>Return ChildProductI18n objects filtered by the meta_description column</p>
</td>
<td></td>
</tr>
<tr>
<td class="type">
array
</td>
<td class="last">
<a href="#method_findByMetaKeywords">findByMetaKeywords</a>(<abbr title="string ">string </abbr> $meta_keywords)
<p>Return ChildProductI18n objects filtered by the meta_keywords column</p>
</td>
<td></td>
</tr>
</table>
<h2>Details</h2>
<h3 id="method___construct">
<div class="location">at line 86</div>
<code> public
<strong>__construct</strong>(string $dbName = 'thelia', string $modelName = '\\Thelia\\Model\\ProductI18n', string $modelAlias = null)</code>
</h3>
<div class="details">
<p>Initializes internal state of \Thelia\Model\Base\ProductI18nQuery object.</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td>string</td>
<td>$dbName</td>
<td>The database name</td>
</tr>
<tr>
<td>string</td>
<td>$modelName</td>
<td>The phpName of a model, e.g. 'Book'</td>
</tr>
<tr>
<td>string</td>
<td>$modelAlias</td>
<td>The alias for the model in this query, e.g. 'b'</td>
</tr>
</table>
</div>
</div>
<h3 id="method_create">
<div class="location">at line 99</div>
<code> static public <a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
<strong>create</strong>(string $modelAlias = null, <abbr title="Propel\Runtime\ActiveQuery\Criteria">Criteria</abbr> $criteria = null)</code>
</h3>
<div class="details">
<p>Returns a new ChildProductI18nQuery object.</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td>string</td>
<td>$modelAlias</td>
<td>The alias of a model in the query</td>
</tr>
<tr>
<td><abbr title="Propel\Runtime\ActiveQuery\Criteria">Criteria</abbr></td>
<td>$criteria</td>
<td>Optional Criteria to build the query from</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findPk">
<div class="location">at line 129</div>
<code> public <a href="../../../Thelia/Model/ProductI18n.html"><abbr title="Thelia\Model\ProductI18n">ProductI18n</abbr></a>|array|mixed
<strong>findPk</strong>($key, $con = null)</code>
</h3>
<div class="details">
<p>Find object by primary key.</p>
<p>Propel uses the instance pool to skip the database if the object exists.
Go fast if the query is untouched.</p>
<p><code>
$obj = $c->findPk(array(12, 34), $con);
</code></p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td></td>
<td>$key</td>
<td>
</td>
</tr>
<tr>
<td></td>
<td>$con</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/ProductI18n.html"><abbr title="Thelia\Model\ProductI18n">ProductI18n</abbr></a>|array|mixed</td>
<td>the result, formatted by the current formatter</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findPks">
<div class="location">at line 212</div>
<code> public <abbr title="Propel\Runtime\Collection\ObjectCollection">ObjectCollection</abbr>|array|mixed
<strong>findPks</strong>(array $keys, <abbr title="Propel\Runtime\Connection\ConnectionInterface">ConnectionInterface</abbr> $con = null)</code>
</h3>
<div class="details">
<p>Find objects by primary key <code> $objs = $c->findPks(array(array(12, 56), array(832, 123), array(123, 456)), $con); </code></p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td>array</td>
<td>$keys</td>
<td>Primary keys to use for the query</td>
</tr>
<tr>
<td><abbr title="Propel\Runtime\Connection\ConnectionInterface">ConnectionInterface</abbr></td>
<td>$con</td>
<td>an optional connection object</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="Propel\Runtime\Collection\ObjectCollection">ObjectCollection</abbr>|array|mixed</td>
<td>the list of results, formatted by the current formatter</td>
</tr>
</table>
</div>
</div>
<h3 id="method_filterByPrimaryKey">
<div class="location">at line 233</div>
<code> public <a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
<strong>filterByPrimaryKey</strong>(mixed $key)</code>
</h3>
<div class="details">
<p>Filter the query by primary key</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td>mixed</td>
<td>$key</td>
<td>Primary key to use for the query</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a></td>
<td>The current query, for fluid interface</td>
</tr>
</table>
</div>
</div>
<h3 id="method_filterByPrimaryKeys">
<div class="location">at line 248</div>
<code> public <a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
<strong>filterByPrimaryKeys</strong>(array $keys)</code>
</h3>
<div class="details">
<p>Filter the query by a list of primary keys</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td>array</td>
<td>$keys</td>
<td>The list of primary key to use for the query</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a></td>
<td>The current query, for fluid interface</td>
</tr>
</table>
</div>
</div>
<h3 id="method_filterById">
<div class="location">at line 283</div>
<code> public <a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
<strong>filterById</strong>(mixed $id = null, string $comparison = null)</code>
</h3>
<div class="details">
<p>Filter the query on the id column</p>
<p>Example usage:
<code>
$query->filterById(1234); // WHERE id = 1234
$query->filterById(array(12, 34)); // WHERE id IN (12, 34)
$query->filterById(array('min' => 12)); // WHERE id > 12
</code></p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td>mixed</td>
<td>$id</td>
<td>The value to use as filter. Use scalar values for equality. Use array values for in_array() equivalent. Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.</td>
</tr>
<tr>
<td>string</td>
<td>$comparison</td>
<td>Operator to use for the column comparison, defaults to Criteria::EQUAL</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a></td>
<td>The current query, for fluid interface</td>
</tr>
</table>
<h4>See also</h4>
<table>
<tr>
<td>filterByProduct()</td>
<td></td>
</tr>
</table>
</div>
</div>
<h3 id="method_filterByLocale">
<div class="location">at line 321</div>
<code> public <a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
<strong>filterByLocale</strong>(string $locale = null, string $comparison = null)</code>
</h3>
<div class="details">
<p>Filter the query on the locale column</p>
<p>Example usage:
<code>
$query->filterByLocale('fooValue'); // WHERE locale = 'fooValue'
$query->filterByLocale('%fooValue%'); // WHERE locale LIKE '%fooValue%'
</code></p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td>string</td>
<td>$locale</td>
<td>The value to use as filter. Accepts wildcards (* and % trigger a LIKE)</td>
</tr>
<tr>
<td>string</td>
<td>$comparison</td>
<td>Operator to use for the column comparison, defaults to Criteria::EQUAL</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a></td>
<td>The current query, for fluid interface</td>
</tr>
</table>
</div>
</div>
<h3 id="method_filterByTitle">
<div class="location">at line 350</div>
<code> public <a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
<strong>filterByTitle</strong>(string $title = null, string $comparison = null)</code>
</h3>
<div class="details">
<p>Filter the query on the title column</p>
<p>Example usage:
<code>
$query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
$query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
</code></p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td>string</td>
<td>$title</td>
<td>The value to use as filter. Accepts wildcards (* and % trigger a LIKE)</td>
</tr>
<tr>
<td>string</td>
<td>$comparison</td>
<td>Operator to use for the column comparison, defaults to Criteria::EQUAL</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a></td>
<td>The current query, for fluid interface</td>
</tr>
</table>
</div>
</div>
<h3 id="method_filterByDescription">
<div class="location">at line 379</div>
<code> public <a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
<strong>filterByDescription</strong>(string $description = null, string $comparison = null)</code>
</h3>
<div class="details">
<p>Filter the query on the description column</p>
<p>Example usage:
<code>
$query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
$query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
</code></p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td>string</td>
<td>$description</td>
<td>The value to use as filter. Accepts wildcards (* and % trigger a LIKE)</td>
</tr>
<tr>
<td>string</td>
<td>$comparison</td>
<td>Operator to use for the column comparison, defaults to Criteria::EQUAL</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a></td>
<td>The current query, for fluid interface</td>
</tr>
</table>
</div>
</div>
<h3 id="method_filterByChapo">
<div class="location">at line 408</div>
<code> public <a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
<strong>filterByChapo</strong>(string $chapo = null, string $comparison = null)</code>
</h3>
<div class="details">
<p>Filter the query on the chapo column</p>
<p>Example usage:
<code>
$query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
$query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
</code></p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td>string</td>
<td>$chapo</td>
<td>The value to use as filter. Accepts wildcards (* and % trigger a LIKE)</td>
</tr>
<tr>
<td>string</td>
<td>$comparison</td>
<td>Operator to use for the column comparison, defaults to Criteria::EQUAL</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a></td>
<td>The current query, for fluid interface</td>
</tr>
</table>
</div>
</div>
<h3 id="method_filterByPostscriptum">
<div class="location">at line 437</div>
<code> public <a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
<strong>filterByPostscriptum</strong>(string $postscriptum = null, string $comparison = null)</code>
</h3>
<div class="details">
<p>Filter the query on the postscriptum column</p>
<p>Example usage:
<code>
$query->filterByPostscriptum('fooValue'); // WHERE postscriptum = 'fooValue'
$query->filterByPostscriptum('%fooValue%'); // WHERE postscriptum LIKE '%fooValue%'
</code></p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td>string</td>
<td>$postscriptum</td>
<td>The value to use as filter. Accepts wildcards (* and % trigger a LIKE)</td>
</tr>
<tr>
<td>string</td>
<td>$comparison</td>
<td>Operator to use for the column comparison, defaults to Criteria::EQUAL</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a></td>
<td>The current query, for fluid interface</td>
</tr>
</table>
</div>
</div>
<h3 id="method_filterByMetaTitle">
<div class="location">at line 466</div>
<code> public <a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
<strong>filterByMetaTitle</strong>(string $metaTitle = null, string $comparison = null)</code>
</h3>
<div class="details">
<p>Filter the query on the meta_title column</p>
<p>Example usage:
<code>
$query->filterByMetaTitle('fooValue'); // WHERE meta<em>title = 'fooValue'
$query->filterByMetaTitle('%fooValue%'); // WHERE meta</em>title LIKE '%fooValue%'
</code></p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td>string</td>
<td>$metaTitle</td>
<td>The value to use as filter. Accepts wildcards (* and % trigger a LIKE)</td>
</tr>
<tr>
<td>string</td>
<td>$comparison</td>
<td>Operator to use for the column comparison, defaults to Criteria::EQUAL</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a></td>
<td>The current query, for fluid interface</td>
</tr>
</table>
</div>
</div>
<h3 id="method_filterByMetaDescription">
<div class="location">at line 495</div>
<code> public <a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
<strong>filterByMetaDescription</strong>(string $metaDescription = null, string $comparison = null)</code>
</h3>
<div class="details">
<p>Filter the query on the meta_description column</p>
<p>Example usage:
<code>
$query->filterByMetaDescription('fooValue'); // WHERE meta<em>description = 'fooValue'
$query->filterByMetaDescription('%fooValue%'); // WHERE meta</em>description LIKE '%fooValue%'
</code></p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td>string</td>
<td>$metaDescription</td>
<td>The value to use as filter. Accepts wildcards (* and % trigger a LIKE)</td>
</tr>
<tr>
<td>string</td>
<td>$comparison</td>
<td>Operator to use for the column comparison, defaults to Criteria::EQUAL</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a></td>
<td>The current query, for fluid interface</td>
</tr>
</table>
</div>
</div>
<h3 id="method_filterByMetaKeywords">
<div class="location">at line 524</div>
<code> public <a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
<strong>filterByMetaKeywords</strong>(string $metaKeywords = null, string $comparison = null)</code>
</h3>
<div class="details">
<p>Filter the query on the meta_keywords column</p>
<p>Example usage:
<code>
$query->filterByMetaKeywords('fooValue'); // WHERE meta<em>keywords = 'fooValue'
$query->filterByMetaKeywords('%fooValue%'); // WHERE meta</em>keywords LIKE '%fooValue%'
</code></p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td>string</td>
<td>$metaKeywords</td>
<td>The value to use as filter. Accepts wildcards (* and % trigger a LIKE)</td>
</tr>
<tr>
<td>string</td>
<td>$comparison</td>
<td>Operator to use for the column comparison, defaults to Criteria::EQUAL</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a></td>
<td>The current query, for fluid interface</td>
</tr>
</table>
</div>
</div>
<h3 id="method_filterByProduct">
<div class="location">at line 546</div>
<code> public <a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
<strong>filterByProduct</strong>(<a href="../../../Thelia/Model/Product.html"><abbr title="Thelia\Model\Product">Product</abbr></a>|<abbr title="Propel\Runtime\Collection\ObjectCollection">ObjectCollection</abbr> $product, string $comparison = null)</code>
</h3>
<div class="details">
<p>Filter the query by a related \Thelia\Model\Product object</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/Product.html"><abbr title="Thelia\Model\Product">Product</abbr></a>|<abbr title="Propel\Runtime\Collection\ObjectCollection">ObjectCollection</abbr></td>
<td>$product</td>
<td>The related object(s) to use as filter</td>
</tr>
<tr>
<td>string</td>
<td>$comparison</td>
<td>Operator to use for the column comparison, defaults to Criteria::EQUAL</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a></td>
<td>The current query, for fluid interface</td>
</tr>
</table>
</div>
</div>
<h3 id="method_joinProduct">
<div class="location">at line 571</div>
<code> public <a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
<strong>joinProduct</strong>(string $relationAlias = null, string $joinType = 'LEFT JOIN')</code>
</h3>
<div class="details">
<p>Adds a JOIN clause to the query using the Product relation</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td>string</td>
<td>$relationAlias</td>
<td>optional alias for the relation</td>
</tr>
<tr>
<td>string</td>
<td>$joinType</td>
<td>Accepted values are null, 'left join', 'right join', 'inner join'</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a></td>
<td>The current query, for fluid interface</td>
</tr>
</table>
</div>
</div>
<h3 id="method_useProductQuery">
<div class="location">at line 606</div>
<code> public <a href="../../../Thelia/Model/ProductQuery.html"><abbr title="Thelia\Model\ProductQuery">ProductQuery</abbr></a>
<strong>useProductQuery</strong>(string $relationAlias = null, string $joinType = 'LEFT JOIN')</code>
</h3>
<div class="details">
<p>Use the Product relation Product object</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td>string</td>
<td>$relationAlias</td>
<td>optional alias for the relation, to be used as main alias in the secondary query</td>
</tr>
<tr>
<td>string</td>
<td>$joinType</td>
<td>Accepted values are null, 'left join', 'right join', 'inner join'</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/ProductQuery.html"><abbr title="Thelia\Model\ProductQuery">ProductQuery</abbr></a></td>
<td>A secondary query class using the current class as primary query</td>
</tr>
</table>
<h4>See also</h4>
<table>
<tr>
<td>useQuery()</td>
<td></td>
</tr>
</table>
</div>
</div>
<h3 id="method_prune">
<div class="location">at line 620</div>
<code> public <a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a>
<strong>prune</strong>(<a href="../../../Thelia/Model/ProductI18n.html"><abbr title="Thelia\Model\ProductI18n">ProductI18n</abbr></a> $productI18n = null)</code>
</h3>
<div class="details">
<p>Exclude object from result</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/ProductI18n.html"><abbr title="Thelia\Model\ProductI18n">ProductI18n</abbr></a></td>
<td>$productI18n</td>
<td>Object to remove from the list of results</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><a href="../../../Thelia/Model/ProductI18nQuery.html"><abbr title="Thelia\Model\ProductI18nQuery">ProductI18nQuery</abbr></a></td>
<td>The current query, for fluid interface</td>
</tr>
</table>
</div>
</div>
<h3 id="method_doDeleteAll">
<div class="location">at line 637</div>
<code> public int
<strong>doDeleteAll</strong>(<abbr title="Propel\Runtime\Connection\ConnectionInterface">ConnectionInterface</abbr> $con = null)</code>
</h3>
<div class="details">
<p>Deletes all rows from the product_i18n table.</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="Propel\Runtime\Connection\ConnectionInterface">ConnectionInterface</abbr></td>
<td>$con</td>
<td>the connection to use</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td>int</td>
<td>The number of affected rows (if supported by underlying database driver).</td>
</tr>
</table>
</div>
</div>
<h3 id="method_delete">
<div class="location">at line 674</div>
<code> public int
<strong>delete</strong>(<abbr title="Propel\Runtime\Connection\ConnectionInterface">ConnectionInterface</abbr> $con = null)</code>
</h3>
<div class="details">
<p>Performs a DELETE on the database, given a ChildProductI18n or Criteria object OR a primary key value.</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="Propel\Runtime\Connection\ConnectionInterface">ConnectionInterface</abbr></td>
<td>$con</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td>int</td>
<td>The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows if supported by native driver or if emulated using Propel.</td>
</tr>
</table>
<h4>Exceptions</h4>
<table>
<tr>
<td><abbr title="PropelException">PropelException</abbr></td>
<td>Any exceptions caught during processing will be rethrown wrapped into a PropelException.</td>
</tr>
</table>
</div>
</div>
<h3 id="method_orderById">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>orderById</strong>($order = Criteria::ASC)</code>
</h3>
<div class="details">
<p>Order by the id column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td></td>
<td>$order</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_orderByLocale">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>orderByLocale</strong>($order = Criteria::ASC)</code>
</h3>
<div class="details">
<p>Order by the locale column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td></td>
<td>$order</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_orderByTitle">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>orderByTitle</strong>($order = Criteria::ASC)</code>
</h3>
<div class="details">
<p>Order by the title column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td></td>
<td>$order</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_orderByDescription">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>orderByDescription</strong>($order = Criteria::ASC)</code>
</h3>
<div class="details">
<p>Order by the description column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td></td>
<td>$order</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_orderByChapo">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>orderByChapo</strong>($order = Criteria::ASC)</code>
</h3>
<div class="details">
<p>Order by the chapo column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td></td>
<td>$order</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_orderByPostscriptum">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>orderByPostscriptum</strong>($order = Criteria::ASC)</code>
</h3>
<div class="details">
<p>Order by the postscriptum column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td></td>
<td>$order</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_orderByMetaTitle">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>orderByMetaTitle</strong>($order = Criteria::ASC)</code>
</h3>
<div class="details">
<p>Order by the meta_title column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td></td>
<td>$order</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_orderByMetaDescription">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>orderByMetaDescription</strong>($order = Criteria::ASC)</code>
</h3>
<div class="details">
<p>Order by the meta_description column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td></td>
<td>$order</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_orderByMetaKeywords">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>orderByMetaKeywords</strong>($order = Criteria::ASC)</code>
</h3>
<div class="details">
<p>Order by the meta_keywords column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td></td>
<td>$order</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_groupById">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>groupById</strong>()</code>
</h3>
<div class="details">
<p>Group by the id column</p>
<p>
</p>
<div class="tags">
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_groupByLocale">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>groupByLocale</strong>()</code>
</h3>
<div class="details">
<p>Group by the locale column</p>
<p>
</p>
<div class="tags">
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_groupByTitle">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>groupByTitle</strong>()</code>
</h3>
<div class="details">
<p>Group by the title column</p>
<p>
</p>
<div class="tags">
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_groupByDescription">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>groupByDescription</strong>()</code>
</h3>
<div class="details">
<p>Group by the description column</p>
<p>
</p>
<div class="tags">
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_groupByChapo">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>groupByChapo</strong>()</code>
</h3>
<div class="details">
<p>Group by the chapo column</p>
<p>
</p>
<div class="tags">
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_groupByPostscriptum">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>groupByPostscriptum</strong>()</code>
</h3>
<div class="details">
<p>Group by the postscriptum column</p>
<p>
</p>
<div class="tags">
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_groupByMetaTitle">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>groupByMetaTitle</strong>()</code>
</h3>
<div class="details">
<p>Group by the meta_title column</p>
<p>
</p>
<div class="tags">
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_groupByMetaDescription">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>groupByMetaDescription</strong>()</code>
</h3>
<div class="details">
<p>Group by the meta_description column</p>
<p>
</p>
<div class="tags">
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_groupByMetaKeywords">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>groupByMetaKeywords</strong>()</code>
</h3>
<div class="details">
<p>Group by the meta_keywords column</p>
<p>
</p>
<div class="tags">
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_leftJoin">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>leftJoin</strong>($relation)</code>
</h3>
<div class="details">
<p>Adds a LEFT JOIN clause to the query</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td></td>
<td>$relation</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_rightJoin">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>rightJoin</strong>($relation)</code>
</h3>
<div class="details">
<p>Adds a RIGHT JOIN clause to the query</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td></td>
<td>$relation</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_innerJoin">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>innerJoin</strong>($relation)</code>
</h3>
<div class="details">
<p>Adds a INNER JOIN clause to the query</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td></td>
<td>$relation</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_leftJoinProduct">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>leftJoinProduct</strong>($relationAlias = null)</code>
</h3>
<div class="details">
<p>Adds a LEFT JOIN clause to the query using the Product relation</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td></td>
<td>$relationAlias</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_rightJoinProduct">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>rightJoinProduct</strong>($relationAlias = null)</code>
</h3>
<div class="details">
<p>Adds a RIGHT JOIN clause to the query using the Product relation</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td></td>
<td>$relationAlias</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_innerJoinProduct">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr>
<strong>innerJoinProduct</strong>($relationAlias = null)</code>
</h3>
<div class="details">
<p>Adds a INNER JOIN clause to the query using the Product relation</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td></td>
<td>$relationAlias</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18nQuery">ChildProductI18nQuery</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findOne">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18n">ChildProductI18n</abbr>
<strong>findOne</strong>(<abbr title="ConnectionInterface ">ConnectionInterface </abbr> $con = null)</code>
</h3>
<div class="details">
<p>Return the first ChildProductI18n matching the query</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="ConnectionInterface ">ConnectionInterface </abbr></td>
<td>$con</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18n">ChildProductI18n</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findOneOrCreate">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18n">ChildProductI18n</abbr>
<strong>findOneOrCreate</strong>(<abbr title="ConnectionInterface ">ConnectionInterface </abbr> $con = null)</code>
</h3>
<div class="details">
<p>Return the first ChildProductI18n matching the query, or a new ChildProductI18n object populated from the query conditions when no match is found</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="ConnectionInterface ">ConnectionInterface </abbr></td>
<td>$con</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18n">ChildProductI18n</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findOneById">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18n">ChildProductI18n</abbr>
<strong>findOneById</strong>(<abbr title="int ">int </abbr> $id)</code>
</h3>
<div class="details">
<p>Return the first ChildProductI18n filtered by the id column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="int ">int </abbr></td>
<td>$id</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18n">ChildProductI18n</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findOneByLocale">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18n">ChildProductI18n</abbr>
<strong>findOneByLocale</strong>(<abbr title="string ">string </abbr> $locale)</code>
</h3>
<div class="details">
<p>Return the first ChildProductI18n filtered by the locale column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="string ">string </abbr></td>
<td>$locale</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18n">ChildProductI18n</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findOneByTitle">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18n">ChildProductI18n</abbr>
<strong>findOneByTitle</strong>(<abbr title="string ">string </abbr> $title)</code>
</h3>
<div class="details">
<p>Return the first ChildProductI18n filtered by the title column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="string ">string </abbr></td>
<td>$title</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18n">ChildProductI18n</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findOneByDescription">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18n">ChildProductI18n</abbr>
<strong>findOneByDescription</strong>(<abbr title="string ">string </abbr> $description)</code>
</h3>
<div class="details">
<p>Return the first ChildProductI18n filtered by the description column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="string ">string </abbr></td>
<td>$description</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18n">ChildProductI18n</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findOneByChapo">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18n">ChildProductI18n</abbr>
<strong>findOneByChapo</strong>(<abbr title="string ">string </abbr> $chapo)</code>
</h3>
<div class="details">
<p>Return the first ChildProductI18n filtered by the chapo column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="string ">string </abbr></td>
<td>$chapo</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18n">ChildProductI18n</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findOneByPostscriptum">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18n">ChildProductI18n</abbr>
<strong>findOneByPostscriptum</strong>(<abbr title="string ">string </abbr> $postscriptum)</code>
</h3>
<div class="details">
<p>Return the first ChildProductI18n filtered by the postscriptum column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="string ">string </abbr></td>
<td>$postscriptum</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18n">ChildProductI18n</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findOneByMetaTitle">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18n">ChildProductI18n</abbr>
<strong>findOneByMetaTitle</strong>(<abbr title="string ">string </abbr> $meta_title)</code>
</h3>
<div class="details">
<p>Return the first ChildProductI18n filtered by the meta_title column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="string ">string </abbr></td>
<td>$meta_title</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18n">ChildProductI18n</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findOneByMetaDescription">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18n">ChildProductI18n</abbr>
<strong>findOneByMetaDescription</strong>(<abbr title="string ">string </abbr> $meta_description)</code>
</h3>
<div class="details">
<p>Return the first ChildProductI18n filtered by the meta_description column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="string ">string </abbr></td>
<td>$meta_description</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18n">ChildProductI18n</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findOneByMetaKeywords">
<div class="location">at line 76</div>
<code> <abbr title="ChildProductI18n">ChildProductI18n</abbr>
<strong>findOneByMetaKeywords</strong>(<abbr title="string ">string </abbr> $meta_keywords)</code>
</h3>
<div class="details">
<p>Return the first ChildProductI18n filtered by the meta_keywords column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="string ">string </abbr></td>
<td>$meta_keywords</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td><abbr title="ChildProductI18n">ChildProductI18n</abbr></td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findById">
<div class="location">at line 76</div>
<code> array
<strong>findById</strong>(<abbr title="int ">int </abbr> $id)</code>
</h3>
<div class="details">
<p>Return ChildProductI18n objects filtered by the id column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="int ">int </abbr></td>
<td>$id</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td>array</td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findByLocale">
<div class="location">at line 76</div>
<code> array
<strong>findByLocale</strong>(<abbr title="string ">string </abbr> $locale)</code>
</h3>
<div class="details">
<p>Return ChildProductI18n objects filtered by the locale column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="string ">string </abbr></td>
<td>$locale</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td>array</td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findByTitle">
<div class="location">at line 76</div>
<code> array
<strong>findByTitle</strong>(<abbr title="string ">string </abbr> $title)</code>
</h3>
<div class="details">
<p>Return ChildProductI18n objects filtered by the title column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="string ">string </abbr></td>
<td>$title</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td>array</td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findByDescription">
<div class="location">at line 76</div>
<code> array
<strong>findByDescription</strong>(<abbr title="string ">string </abbr> $description)</code>
</h3>
<div class="details">
<p>Return ChildProductI18n objects filtered by the description column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="string ">string </abbr></td>
<td>$description</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td>array</td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findByChapo">
<div class="location">at line 76</div>
<code> array
<strong>findByChapo</strong>(<abbr title="string ">string </abbr> $chapo)</code>
</h3>
<div class="details">
<p>Return ChildProductI18n objects filtered by the chapo column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="string ">string </abbr></td>
<td>$chapo</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td>array</td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findByPostscriptum">
<div class="location">at line 76</div>
<code> array
<strong>findByPostscriptum</strong>(<abbr title="string ">string </abbr> $postscriptum)</code>
</h3>
<div class="details">
<p>Return ChildProductI18n objects filtered by the postscriptum column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="string ">string </abbr></td>
<td>$postscriptum</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td>array</td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findByMetaTitle">
<div class="location">at line 76</div>
<code> array
<strong>findByMetaTitle</strong>(<abbr title="string ">string </abbr> $meta_title)</code>
</h3>
<div class="details">
<p>Return ChildProductI18n objects filtered by the meta_title column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="string ">string </abbr></td>
<td>$meta_title</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td>array</td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findByMetaDescription">
<div class="location">at line 76</div>
<code> array
<strong>findByMetaDescription</strong>(<abbr title="string ">string </abbr> $meta_description)</code>
</h3>
<div class="details">
<p>Return ChildProductI18n objects filtered by the meta_description column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="string ">string </abbr></td>
<td>$meta_description</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td>array</td>
<td>
</td>
</tr>
</table>
</div>
</div>
<h3 id="method_findByMetaKeywords">
<div class="location">at line 76</div>
<code> array
<strong>findByMetaKeywords</strong>(<abbr title="string ">string </abbr> $meta_keywords)</code>
</h3>
<div class="details">
<p>Return ChildProductI18n objects filtered by the meta_keywords column</p>
<p>
</p>
<div class="tags">
<h4>Parameters</h4>
<table>
<tr>
<td><abbr title="string ">string </abbr></td>
<td>$meta_keywords</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table>
<tr>
<td>array</td>
<td>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated by <a href="http://sami.sensiolabs.org/" target="_top">Sami, the API Documentation Generator</a>.
</div>
</body>
</html>
|
Mertiozys/thelia.github.io
|
api/master/Thelia/Model/Base/ProductI18nQuery.html
|
HTML
|
mit
| 102,558
|
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/leds.h>
#include <linux/err.h>
#include <linux/clk.h> /* only needed for hacked clk rate change */
#include <asm/hardware/scoop.h>
#include <asm/mach-types.h>
static void hacked_arm_clk_rate_change(enum led_brightness value)
{
#define LED_OFF_ARM_CLK_RATE 100000000
static unsigned long max_arm_clk_rate = LED_OFF_ARM_CLK_RATE;
static unsigned long min_arm_clk_rate = LED_OFF_ARM_CLK_RATE;
struct clk * arm_clk;
unsigned long old_arm_clk_rate;
unsigned long new_arm_clk_rate;
int rc;
arm_clk = clk_get(NULL, "arm_clk");
BUG_ON(IS_ERR(arm_clk));
old_arm_clk_rate = clk_get_rate(arm_clk);
// remember the current "maximum" so we can restore it when backlight is
// back on
max_arm_clk_rate = max(old_arm_clk_rate, max_arm_clk_rate);
if( value == LED_OFF )
{
new_arm_clk_rate = min_arm_clk_rate;
}
else
{
new_arm_clk_rate = max_arm_clk_rate;
}
if (new_arm_clk_rate != old_arm_clk_rate)
{
rc = clk_set_rate(arm_clk, new_arm_clk_rate);
if (rc < 0 )
{
printk(KERN_WARNING \
"Warning: %s(): HACK: setting arm clock rate to %ld Hz failed, rc=%d\n",
__FUNCTION__, new_arm_clk_rate, rc);
}
else
{
printk(KERN_INFO \
"Info: %s(): HACK: set arm clock rate to %ld Hz, got %ld Hz\n",
__FUNCTION__, new_arm_clk_rate, clk_get_rate(arm_clk));
}
}
clk_put(arm_clk);
}
extern int vc_gencmd(char *response, int maxlen, const char *format, ...);
static void islands_ff_led_lcdbacklight_set(struct led_classdev *led_cdev,
enum led_brightness value)
{
char response_buffer[32];
unsigned int brightness = (unsigned int)value;
/* Restrict brighness level as 0 = 0, 1 - 90 = 90, 91-255 = 91-255
* We did this because, with brightness below 90 the display is barely
* visible.
* ssp
*/
if (brightness && brightness < 90)
brightness = 90;
vc_gencmd(response_buffer, 32,
"set_backlight %i", brightness);
hacked_arm_clk_rate_change(value);
}
static void islands_ff_led_buttonbacklight_set(struct led_classdev *led_cdev,
enum led_brightness value)
{
}
static void islands_ff_led_keyboardbacklight_set(struct led_classdev *led_cdev,
enum led_brightness value)
{
}
static struct led_classdev islands_ff_lcdbacklight_led = {
.name = "lcd-backlight",
.default_trigger = "lcd-backlight",
.brightness_set = islands_ff_led_lcdbacklight_set,
};
static struct led_classdev islands_ff_buttonbacklight_led = {
.name = "button-backlight",
.default_trigger = "button-backlight",
.brightness_set = islands_ff_led_buttonbacklight_set,
};
static struct led_classdev islands_ff_keyboardbacklight_led = {
.name = "keyboard-backlight",
.default_trigger = "keyboard-backlight",
.brightness_set = islands_ff_led_keyboardbacklight_set,
};
#ifdef CONFIG_PM
static int islands_ff_led_suspend(struct platform_device *dev, pm_message_t state)
{
#ifdef CONFIG_LEDS_TRIGGERS
if (islands_ff_lcdbacklight_led.trigger && strcmp(islands_ff_lcdbacklight_led.trigger->name,
"sharpsl-charge"))
#endif
led_classdev_suspend(&islands_ff_lcdbacklight_led);
led_classdev_suspend(&islands_ff_buttonbacklight_led);
led_classdev_suspend(&islands_ff_keyboardbacklight_led);
return 0;
}
static int islands_ff_led_resume(struct platform_device *dev)
{
led_classdev_resume(&islands_ff_lcdbacklight_led);
led_classdev_resume(&islands_ff_buttonbacklight_led);
led_classdev_resume(&islands_ff_keyboardbacklight_led);
return 0;
}
#else
#define islands_ff_led_suspend NULL
#define islands_ff_led_resume NULL
#endif
static int islands_ff_led_probe(struct platform_device *pdev)
{
int ret;
ret = led_classdev_register(&pdev->dev, &islands_ff_lcdbacklight_led);
if (ret < 0)
return ret;
ret = led_classdev_register(&pdev->dev, &islands_ff_buttonbacklight_led);
if (ret < 0)
return ret;
led_classdev_register(&pdev->dev, &islands_ff_keyboardbacklight_led);
return ret;
}
static int islands_ff_led_remove(struct platform_device *pdev)
{
led_classdev_unregister(&islands_ff_lcdbacklight_led);
led_classdev_unregister(&islands_ff_buttonbacklight_led);
led_classdev_unregister(&islands_ff_keyboardbacklight_led);
return 0;
}
static struct platform_driver islands_ff_led_driver = {
.probe = islands_ff_led_probe,
.remove = islands_ff_led_remove,
.suspend = islands_ff_led_suspend,
.resume = islands_ff_led_resume,
.driver = {
.name = "islands_ff-led",
.owner = THIS_MODULE,
},
};
static int __init islands_ff_led_init(void)
{
return platform_driver_register(&islands_ff_led_driver);
}
static void __exit islands_ff_led_exit(void)
{
platform_driver_unregister(&islands_ff_led_driver);
}
module_init(islands_ff_led_init);
module_exit(islands_ff_led_exit);
|
Grace5921/android_kernel_kylevexx
|
drivers/leds/leds-islands_ff.c
|
C
|
gpl-2.0
| 5,012
|
/*
* include/linux/writeback.h
*/
#ifndef WRITEBACK_H
#define WRITEBACK_H
#include <linux/sched.h>
#include <linux/fs.h>
DECLARE_PER_CPU(int, dirty_throttle_leaks);
/*
* The 1/4 region under the global dirty thresh is for smooth dirty throttling:
*
* (thresh - thresh/DIRTY_FULL_SCOPE, thresh)
*
* Further beyond, all dirtier tasks will enter a loop waiting (possibly long
* time) for the dirty pages to drop, unless written enough pages.
*
* The global dirty threshold is normally equal to the global dirty limit,
* except when the system suddenly allocates a lot of anonymous memory and
* knocks down the global dirty threshold quickly, in which case the global
* dirty limit will follow down slowly to prevent livelocking all dirtier tasks.
*/
#define DIRTY_SCOPE 8
#define DIRTY_FULL_SCOPE (DIRTY_SCOPE / 2)
struct backing_dev_info;
/*
* fs/fs-writeback.c
*/
enum writeback_sync_modes {
WB_SYNC_NONE, /* Don't wait on anything */
WB_SYNC_ALL, /* Wait on every mapping */
};
/*
* why some writeback work was initiated
*/
enum wb_reason {
WB_REASON_BACKGROUND,
WB_REASON_TRY_TO_FREE_PAGES,
WB_REASON_SYNC,
WB_REASON_PERIODIC,
WB_REASON_LAPTOP_TIMER,
WB_REASON_FREE_MORE_MEM,
WB_REASON_FS_FREE_SPACE,
WB_REASON_FORKER_THREAD,
WB_REASON_MAX,
};
extern const char *wb_reason_name[];
/*
* A control structure which tells the writeback code what to do. These are
* always on the stack, and hence need no locking. They are always initialised
* in a manner such that unspecified fields are set to zero.
*/
struct writeback_control {
enum writeback_sync_modes sync_mode;
long nr_to_write; /* Write this many pages, and decrement
this for each page written */
long pages_skipped; /* Pages which were not written */
/*
* For a_ops->writepages(): if start or end are non-zero then this is
* a hint that the filesystem need only write out the pages inside that
* byterange. The byte at `end' is included in the writeout request.
*/
loff_t range_start;
loff_t range_end;
unsigned for_kupdate:1; /* A kupdate writeback */
unsigned for_background:1; /* A background writeback */
unsigned tagged_writepages:1; /* tag-and-write to avoid livelock */
unsigned for_reclaim:1; /* Invoked from the page allocator */
unsigned range_cyclic:1; /* range_start is cyclic */
unsigned for_sync:1; /* sync(2) WB_SYNC_ALL writeback */
};
/*
* fs/fs-writeback.c
*/
struct bdi_writeback;
int inode_wait(void *);
void writeback_inodes_sb(struct super_block *, enum wb_reason reason);
void writeback_inodes_sb_nr(struct super_block *, unsigned long nr,
enum wb_reason reason);
int writeback_inodes_sb_if_idle(struct super_block *, enum wb_reason reason);
int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr,
enum wb_reason reason);
void sync_inodes_sb(struct super_block *);
long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages,
enum wb_reason reason);
long wb_do_writeback(struct bdi_writeback *wb, int force_wait);
void wakeup_flusher_threads(long nr_pages, enum wb_reason reason);
/* writeback.h requires fs.h; it, too, is not included from here. */
static inline void wait_on_inode(struct inode *inode)
{
might_sleep();
wait_on_bit(&inode->i_state, __I_NEW, inode_wait, TASK_UNINTERRUPTIBLE);
}
static inline void inode_sync_wait(struct inode *inode)
{
might_sleep();
wait_on_bit(&inode->i_state, __I_SYNC, inode_wait,
TASK_UNINTERRUPTIBLE);
}
/*
* mm/page-writeback.c
*/
#ifdef CONFIG_BLOCK
void laptop_io_completion(struct backing_dev_info *info);
void laptop_sync_completion(void);
void laptop_mode_sync(struct work_struct *work);
void laptop_mode_timer_fn(unsigned long data);
#else
static inline void laptop_sync_completion(void) { }
#endif
void throttle_vm_writeout(gfp_t gfp_mask);
bool zone_dirty_ok(struct zone *zone);
extern unsigned long global_dirty_limit;
/* These are exported to sysctl. */
extern int dirty_background_ratio;
extern unsigned long dirty_background_bytes;
extern int vm_dirty_ratio;
extern unsigned long vm_dirty_bytes;
extern unsigned int dirty_writeback_interval;
extern unsigned int dirty_expire_interval;
extern int vm_highmem_is_dirtyable;
extern int block_dump;
extern int laptop_mode;
extern int dirty_background_ratio_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp,
loff_t *ppos);
extern int dirty_background_bytes_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp,
loff_t *ppos);
extern int dirty_ratio_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp,
loff_t *ppos);
extern int dirty_bytes_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp,
loff_t *ppos);
struct ctl_table;
int dirty_writeback_centisecs_handler(struct ctl_table *, int,
void __user *, size_t *, loff_t *);
void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty);
unsigned long bdi_dirty_limit(struct backing_dev_info *bdi,
unsigned long dirty);
void __bdi_update_bandwidth(struct backing_dev_info *bdi,
unsigned long thresh,
unsigned long bg_thresh,
unsigned long dirty,
unsigned long bdi_thresh,
unsigned long bdi_dirty,
unsigned long start_time);
void page_writeback_init(void);
void balance_dirty_pages_ratelimited(struct address_space *mapping);
typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc,
void *data);
int generic_writepages(struct address_space *mapping,
struct writeback_control *wbc);
void tag_pages_for_writeback(struct address_space *mapping,
pgoff_t start, pgoff_t end);
int write_cache_pages(struct address_space *mapping,
struct writeback_control *wbc, writepage_t writepage,
void *data);
int do_writepages(struct address_space *mapping, struct writeback_control *wbc);
void set_page_dirty_balance(struct page *page, int page_mkwrite);
void writeback_set_ratelimit(void);
void tag_pages_for_writeback(struct address_space *mapping,
pgoff_t start, pgoff_t end);
void account_page_redirty(struct page *page);
/* pdflush.c */
extern int nr_pdflush_threads; /* Global so it can be exported to sysctl
read-only. */
#endif /* WRITEBACK_H */
|
AOSPA-legacy/android_kernel_lge_msm8974
|
include/linux/writeback.h
|
C
|
gpl-2.0
| 6,290
|
<?php
require_once '_inc.php';
function test_Minify_Cache_Memcache()
{
$prefix = 'Minify_Cache_Memcache : ';
$thisFileActive = (__FILE__ === realpath($_SERVER['SCRIPT_FILENAME']));
if (! function_exists('memcache_set')) {
if ($thisFileActive) {
echo " {$prefix}To test this component, install memcache in PHP\n";
}
return;
}
$mc = new Memcache;
if (! @$mc->connect('localhost', 11211)) {
if ($thisFileActive) {
echo " {$prefix}Memcache server not found on localhost:11211\n";
}
return;
}
$data = str_repeat(md5(time()) . 'í', 100); // 3400 bytes in UTF-8
$id = 'Minify_test_memcache';
$cache = new Minify_Cache_Memcache($mc);
assertTrue(true === $cache->store($id, $data), $prefix . 'store');
assertTrue(countBytes($data) === $cache->getSize($id), $prefix . 'getSize');
assertTrue(true === $cache->isValid($id, $_SERVER['REQUEST_TIME'] - 10), $prefix . 'isValid');
ob_start();
$cache->display($id);
$displayed = ob_get_contents();
ob_end_clean();
assertTrue($data === $displayed, $prefix . 'display');
assertTrue($data === $cache->fetch($id), $prefix . 'fetch');
if (function_exists('gzencode')) {
$data = gzencode($data);
$id .= ".gz";
$cache->store($id, $data);
assertTrue($data === $cache->fetch($id), $prefix . 'store/fetch gzencoded string');
}
}
test_Minify_Cache_Memcache();
|
ellipsonic/thebuggenige_app
|
vendor/mrclay/minify/min_unit_tests/test_Minify_Cache_Memcache.php
|
PHP
|
mpl-2.0
| 1,495
|
/*
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.jetbrains.commandInterface.console;
import com.intellij.execution.console.ProcessBackedConsoleExecuteActionHandler;
import com.intellij.execution.process.ProcessHandler;
import com.intellij.util.Consumer;
import org.jetbrains.annotations.NotNull;
/**
* Supports {@link CommandConsole} in "process-mode"
* Delegates console streams to process
*
* @author Ilya.Kazakevich
*/
final class ProcessModeConsumer implements Consumer<String> {
@NotNull
private final ProcessBackedConsoleExecuteActionHandler myHandler;
ProcessModeConsumer(@NotNull final ProcessHandler processHandler) {
myHandler = new ProcessBackedConsoleExecuteActionHandler(processHandler, true);
}
@Override
public void consume(final String t) {
myHandler.processLine(t);
}
}
|
caot/intellij-community
|
python/src/com/jetbrains/commandInterface/console/ProcessModeConsumer.java
|
Java
|
apache-2.0
| 1,382
|
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.0
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
|
f14n/code-cracker
|
test/VisualBasic/CodeCracker.Test/My Project/Application.Designer.vb
|
Visual Basic
|
apache-2.0
| 424
|
class A:
def __init__(self, a:int, b:float, *args:tuple, c:complex, **kwargs:dict) -> None:
pass
class B(A):
def <warning descr="Call to __init__ of super class is missed">__i<caret>nit__</warning>(self, d:str, *, e:bytes) -> list:
pass
|
idea4bsd/idea4bsd
|
python/testData/inspections/AddCallSuperTypeAnnotationsPreserved.py
|
Python
|
apache-2.0
| 261
|
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.dialog.add( 'radio', function( editor )
{
return {
title : editor.lang.checkboxAndRadio.radioTitle,
minWidth : 350,
minHeight : 140,
onShow : function()
{
delete this.radioButton;
var element = this.getParentEditor().getSelection().getSelectedElement();
if ( element && element.getName() == 'input' && element.getAttribute( 'type' ) == 'radio' )
{
this.radioButton = element;
this.setupContent( element );
}
},
onOk : function()
{
var editor,
element = this.radioButton,
isInsertMode = !element;
if ( isInsertMode )
{
editor = this.getParentEditor();
element = editor.document.createElement( 'input' );
element.setAttribute( 'type', 'radio' );
}
if ( isInsertMode )
editor.insertElement( element );
this.commitContent( { element : element } );
},
contents : [
{
id : 'info',
label : editor.lang.checkboxAndRadio.radioTitle,
title : editor.lang.checkboxAndRadio.radioTitle,
elements : [
{
id : 'name',
type : 'text',
label : editor.lang.common.name,
'default' : '',
accessKey : 'N',
setup : function( element )
{
this.setValue(
element.data( 'cke-saved-name' ) ||
element.getAttribute( 'name' ) ||
'' );
},
commit : function( data )
{
var element = data.element;
if ( this.getValue() )
element.data( 'cke-saved-name', this.getValue() );
else
{
element.data( 'cke-saved-name', false );
element.removeAttribute( 'name' );
}
}
},
{
id : 'value',
type : 'text',
label : editor.lang.checkboxAndRadio.value,
'default' : '',
accessKey : 'V',
setup : function( element )
{
this.setValue( element.getAttribute( 'value' ) || '' );
},
commit : function( data )
{
var element = data.element;
if ( this.getValue() )
element.setAttribute( 'value', this.getValue() );
else
element.removeAttribute( 'value' );
}
},
{
id : 'checked',
type : 'checkbox',
label : editor.lang.checkboxAndRadio.selected,
'default' : '',
accessKey : 'S',
value : "checked",
setup : function( element )
{
this.setValue( element.getAttribute( 'checked' ) );
},
commit : function( data )
{
var element = data.element;
if ( !( CKEDITOR.env.ie || CKEDITOR.env.opera ) )
{
if ( this.getValue() )
element.setAttribute( 'checked', 'checked' );
else
element.removeAttribute( 'checked' );
}
else
{
var isElementChecked = element.getAttribute( 'checked' );
var isChecked = !!this.getValue();
if ( isElementChecked != isChecked )
{
var replace = CKEDITOR.dom.element.createFromHtml( '<input type="radio"'
+ ( isChecked ? ' checked="checked"' : '' )
+ '></input>', editor.document );
element.copyAttributes( replace, { type : 1, checked : 1 } );
replace.replace( element );
editor.getSelection().selectElement( replace );
data.element = replace;
}
}
}
}
]
}
]
};
});
|
shridharsahil/libraryweb-site
|
www/sites/all/libraries/ckeditor/_source/plugins/forms/dialogs/radio.js
|
JavaScript
|
bsd-3-clause
| 3,596
|
module.exports = function (obj, opts) {
if (!opts) opts = {};
if (typeof opts === 'function') opts = { cmp: opts };
var space = opts.space || '';
if (typeof space === 'number') space = Array(space+1).join(' ');
var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;
var replacer = opts.replacer || function(key, value) { return value; };
var cmp = opts.cmp && (function (f) {
return function (node) {
return function (a, b) {
var aobj = { key: a, value: node[a] };
var bobj = { key: b, value: node[b] };
return f(aobj, bobj);
};
};
})(opts.cmp);
var seen = [];
return (function stringify (parent, key, node, level) {
var indent = space ? ('\n' + new Array(level + 1).join(space)) : '';
var colonSeparator = space ? ': ' : ':';
if (node && node.toJSON && typeof node.toJSON === 'function') {
node = node.toJSON();
}
node = replacer.call(parent, key, node);
if (node === undefined) {
return;
}
if (typeof node !== 'object' || node === null) {
return JSON.stringify(node);
}
if (isArray(node)) {
var out = [];
for (var i = 0; i < node.length; i++) {
var item = stringify(node, i, node[i], level+1) || JSON.stringify(null);
out.push(indent + space + item);
}
return '[' + out.join(',') + indent + ']';
}
else {
if (seen.indexOf(node) !== -1) {
if (cycles) return JSON.stringify('__cycle__');
throw new TypeError('Converting circular structure to JSON');
}
else seen.push(node);
var keys = objectKeys(node).sort(cmp && cmp(node));
var out = [];
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var value = stringify(node, key, node[key], level+1);
if(!value) continue;
var keyValue = JSON.stringify(key)
+ colonSeparator
+ value;
;
out.push(indent + space + keyValue);
}
seen.splice(seen.indexOf(node), 1);
return '{' + out.join(',') + indent + '}';
}
})({ '': obj }, '', obj, 0);
};
var isArray = Array.isArray || function (x) {
return {}.toString.call(x) === '[object Array]';
};
var objectKeys = Object.keys || function (obj) {
var has = Object.prototype.hasOwnProperty || function () { return true };
var keys = [];
for (var key in obj) {
if (has.call(obj, key)) keys.push(key);
}
return keys;
};
|
february29/Learning
|
web/vue/AccountBook-Express/node_modules/json-stable-stringify-without-jsonify/index.js
|
JavaScript
|
mit
| 2,792
|
# Generated from 'Aliases.h'
def FOUR_CHAR_CODE(x): return x
true = True
false = False
rAliasType = FOUR_CHAR_CODE('alis')
kARMMountVol = 0x00000001
kARMNoUI = 0x00000002
kARMMultVols = 0x00000008
kARMSearch = 0x00000100
kARMSearchMore = 0x00000200
kARMSearchRelFirst = 0x00000400
asiZoneName = -3
asiServerName = -2
asiVolumeName = -1
asiAliasName = 0
asiParentName = 1
kResolveAliasFileNoUI = 0x00000001
|
xbmc/atv2
|
xbmc/lib/libPython/Python/Lib/plat-mac/Carbon/Aliases.py
|
Python
|
gpl-2.0
| 407
|
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5045147
* @summary Test handling of null with empty Map
* @author Mike Duigou
*/
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
import java.lang.reflect.*;
public class EmptyMapAndNulls {
@SuppressWarnings("rawtypes")
static void realMain(String[] args) throws Throwable {
// No comparator
Map<String,String> comparable = new TreeMap<>();
// insert null into empty map (5045147 failure)
try {
comparable.put(null, "anything");
fail("null shouldn't be accepted");
} catch (NullPointerException failed) {
pass();
}
// insert non-null into empty map
try {
comparable.put("test", "anything");
pass();
} catch (NullPointerException failed) {
fail();
}
// insert null into non-empty map
try {
comparable.put(null, "anything");
fail("null shouldn't be accepted");
} catch (NullPointerException failed) {
pass();
}
// Comparator (String.CASE_INSENSITIVE_ORDER). Intentionally a raw type.
Map comparator = new TreeMap(String.CASE_INSENSITIVE_ORDER);
// insert null into empty map (5045147 failure)
try {
comparator.put(null, "anything");
fail("null shouldn't be accepted");
} catch (NullPointerException failed) {
pass();
}
// insert non-null into empty map
try {
comparator.put("test", "anything");
pass();
} catch (NullPointerException failed) {
fail();
}
// insert null into non-empty map
try {
comparator.put(null, "anything");
fail("null shouldn't be accepted");
} catch (NullPointerException failed) {
pass();
}
comparator.clear();
// insert non-String into empty map (5045147 failure)
try {
comparator.put(new Object(), "anything");
fail("Object shouldn't be accepted");
} catch (ClassCastException failed) {
pass();
}
}
//--------------------- Infrastructure ---------------------------
static volatile int passed = 0, failed = 0;
static void pass() {passed++;}
static void fail() {failed++; Thread.dumpStack();}
static void fail(String msg) {System.out.println(msg); fail();}
static void unexpected(Throwable t) {failed++; t.printStackTrace();}
static void check(boolean cond) {if (cond) pass(); else fail();}
static void equal(Object x, Object y) {
if (x == null ? y == null : x.equals(y)) pass();
else fail(x + " not equal to " + y);}
public static void main(String[] args) throws Throwable {
try {realMain(args);} catch (Throwable t) {unexpected(t);}
System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
if (failed > 0) throw new AssertionError("Some tests failed");}
}
|
rokn/Count_Words_2015
|
testing/openjdk2/jdk/test/java/util/TreeMap/EmptyMapAndNulls.java
|
Java
|
mit
| 4,124
|
/*
* This file is part of Cleanflight.
*
* Cleanflight 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.
*
* Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* telemetry_MSP.h
*
* Created on: 22 Apr 2014
* Author: trey marc
*/
#ifndef TELEMETRY_MSP_H_
#define TELEMETRY_MSP_H_
void initMSPTelemetry(telemetryConfig_t *initialTelemetryConfig);
void handleMSPTelemetry(void);
void checkMSPTelemetryState(void);
void freeMSPTelemetryPort(void);
void configureMSPTelemetryPort(void);
#endif /* TELEMETRY_MSP_H_ */
|
opsidao/cleanflight
|
src/main/telemetry/msp.h
|
C
|
gpl-3.0
| 1,061
|
/*
* Copyright (C) 2005 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_SHARED_BUFFER_H
#define ANDROID_SHARED_BUFFER_H
#include <stdint.h>
#include <sys/types.h>
// ---------------------------------------------------------------------------
namespace android {
class SharedBuffer
{
public:
/* flags to use with release() */
enum {
eKeepStorage = 0x00000001
};
/*! allocate a buffer of size 'size' and acquire() it.
* call release() to free it.
*/
static SharedBuffer* alloc(size_t size);
/*! free the memory associated with the SharedBuffer.
* Fails if there are any users associated with this SharedBuffer.
* In other words, the buffer must have been release by all its
* users.
*/
static ssize_t dealloc(const SharedBuffer* released);
//! access the data for read
inline const void* data() const;
//! access the data for read/write
inline void* data();
//! get size of the buffer
inline size_t size() const;
//! get back a SharedBuffer object from its data
static inline SharedBuffer* bufferFromData(void* data);
//! get back a SharedBuffer object from its data
static inline const SharedBuffer* bufferFromData(const void* data);
//! get the size of a SharedBuffer object from its data
static inline size_t sizeFromData(const void* data);
//! edit the buffer (get a writtable, or non-const, version of it)
SharedBuffer* edit() const;
//! edit the buffer, resizing if needed
SharedBuffer* editResize(size_t size) const;
//! like edit() but fails if a copy is required
SharedBuffer* attemptEdit() const;
//! resize and edit the buffer, loose it's content.
SharedBuffer* reset(size_t size) const;
//! acquire/release a reference on this buffer
void acquire() const;
/*! release a reference on this buffer, with the option of not
* freeing the memory associated with it if it was the last reference
* returns the previous reference count
*/
int32_t release(uint32_t flags = 0) const;
//! returns wether or not we're the only owner
inline bool onlyOwner() const;
private:
inline SharedBuffer() { }
inline ~SharedBuffer() { }
SharedBuffer(const SharedBuffer&);
SharedBuffer& operator = (const SharedBuffer&);
// 16 bytes. must be sized to preserve correct alignment.
mutable int32_t mRefs;
size_t mSize;
uint32_t mReserved[2];
};
// ---------------------------------------------------------------------------
const void* SharedBuffer::data() const {
return this + 1;
}
void* SharedBuffer::data() {
return this + 1;
}
size_t SharedBuffer::size() const {
return mSize;
}
SharedBuffer* SharedBuffer::bufferFromData(void* data) {
return data ? static_cast<SharedBuffer *>(data)-1 : 0;
}
const SharedBuffer* SharedBuffer::bufferFromData(const void* data) {
return data ? static_cast<const SharedBuffer *>(data)-1 : 0;
}
size_t SharedBuffer::sizeFromData(const void* data) {
return data ? bufferFromData(data)->mSize : 0;
}
bool SharedBuffer::onlyOwner() const {
return (mRefs == 1);
}
}; // namespace android
// ---------------------------------------------------------------------------
#endif // ANDROID_VECTOR_H
|
zhangximin/rk_jpeg
|
vpu_linux_dec_enc_user/libion/utils/SharedBuffer.h
|
C
|
apache-2.0
| 4,334
|
<html>
<frameset cols="50%,*">
<frame src="full_tab_sub_frame1.html" />
<frame src="full_tab_sub_frame2.html" />
</frameset>
</html>
|
plxaye/chromium
|
src/chrome_frame/test/data/full_tab_sub_frame_main.html
|
HTML
|
apache-2.0
| 136
|
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
]]--
m = Map("system", translate("<abbr title=\"Light Emitting Diode\">LED</abbr> Configuration"), translate("Customizes the behaviour of the device <abbr title=\"Light Emitting Diode\">LED</abbr>s if possible."))
local sysfs_path = "/sys/class/leds/"
local leds = {}
local fs = require "nixio.fs"
local util = require "nixio.util"
if fs.access(sysfs_path) then
leds = util.consume((fs.dir(sysfs_path)))
end
if #leds == 0 then
return m
end
s = m:section(TypedSection, "led", "")
s.anonymous = true
s.addremove = true
function s.parse(self, ...)
TypedSection.parse(self, ...)
os.execute("/etc/init.d/led enable")
end
s:option(Value, "name", translate("Name"))
sysfs = s:option(ListValue, "sysfs", translate("<abbr title=\"Light Emitting Diode\">LED</abbr> Name"))
for k, v in ipairs(leds) do
sysfs:value(v)
end
s:option(Flag, "default", translate("Default state")).rmempty = false
trigger = s:option(ListValue, "trigger", translate("Trigger"))
local triggers = fs.readfile(sysfs_path .. leds[1] .. "/trigger")
for t in triggers:gmatch("[%w-]+") do
trigger:value(t, translate(t:gsub("-", "")))
end
delayon = s:option(Value, "delayon", translate ("On-State Delay"))
delayon:depends("trigger", "timer")
delayoff = s:option(Value, "delayoff", translate ("Off-State Delay"))
delayoff:depends("trigger", "timer")
dev = s:option(ListValue, "_net_dev", translate("Device"))
dev.rmempty = true
dev:value("")
dev:depends("trigger", "netdev")
function dev.cfgvalue(self, section)
return m.uci:get("system", section, "dev")
end
function dev.write(self, section, value)
m.uci:set("system", section, "dev", value)
end
function dev.remove(self, section)
local t = trigger:formvalue(section)
if t ~= "netdev" and t ~= "usbdev" then
m.uci:delete("system", section, "dev")
end
end
for k, v in pairs(luci.sys.net.devices()) do
if v ~= "lo" then
dev:value(v)
end
end
mode = s:option(MultiValue, "mode", translate("Trigger Mode"))
mode.rmempty = true
mode:depends("trigger", "netdev")
mode:value("link", translate("Link On"))
mode:value("tx", translate("Transmit"))
mode:value("rx", translate("Receive"))
usbdev = s:option(ListValue, "_usb_dev", translate("USB Device"))
usbdev:depends("trigger", "usbdev")
usbdev.rmempty = true
usbdev:value("")
function usbdev.cfgvalue(self, section)
return m.uci:get("system", section, "dev")
end
function usbdev.write(self, section, value)
m.uci:set("system", section, "dev", value)
end
function usbdev.remove(self, section)
local t = trigger:formvalue(section)
if t ~= "netdev" and t ~= "usbdev" then
m.uci:delete("system", section, "dev")
end
end
for p in nixio.fs.glob("/sys/bus/usb/devices/[0-9]*/manufacturer") do
local id = p:match("%d+-%d+")
local mf = nixio.fs.readfile("/sys/bus/usb/devices/" .. id .. "/manufacturer") or "?"
local pr = nixio.fs.readfile("/sys/bus/usb/devices/" .. id .. "/product") or "?"
usbdev:value(id, "%s (%s - %s)" %{ id, mf, pr })
end
return m
|
shizhai/wprobe
|
staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/usr/lib/lua/luci/model/cbi/admin_system/leds.lua
|
Lua
|
gpl-2.0
| 3,272
|
/*
* Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifndef JAVA_MAIN_MD_H
#define JAVA_MAIN_MD_H
#define PATH_SEPARATOR ";"
#define LOCAL_DIR_SEPARATOR '\\'
#define DIR_SEPARATOR '/'
#endif
|
andreagenso/java2scala
|
test/J2s/java/openjdk-6-src-b27/jdk/src/windows/native/common/java_main_md.h
|
C
|
apache-2.0
| 1,349
|
// Copyright 2015 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package etcdserver
import (
"bytes"
"context"
"encoding/base64"
"encoding/binary"
"strconv"
"time"
pb "go.etcd.io/etcd/api/v3/etcdserverpb"
"go.etcd.io/etcd/api/v3/membershippb"
"go.etcd.io/etcd/pkg/v3/traceutil"
"go.etcd.io/etcd/raft/v3"
"go.etcd.io/etcd/server/v3/auth"
"go.etcd.io/etcd/server/v3/etcdserver/api/membership"
"go.etcd.io/etcd/server/v3/lease"
"go.etcd.io/etcd/server/v3/lease/leasehttp"
"go.etcd.io/etcd/server/v3/mvcc"
"github.com/gogo/protobuf/proto"
"go.uber.org/zap"
"golang.org/x/crypto/bcrypt"
)
const (
// In the health case, there might be a small gap (10s of entries) between
// the applied index and committed index.
// However, if the committed entries are very heavy to apply, the gap might grow.
// We should stop accepting new proposals if the gap growing to a certain point.
maxGapBetweenApplyAndCommitIndex = 5000
traceThreshold = 100 * time.Millisecond
readIndexRetryTime = 500 * time.Millisecond
)
type RaftKV interface {
Range(ctx context.Context, r *pb.RangeRequest) (*pb.RangeResponse, error)
Put(ctx context.Context, r *pb.PutRequest) (*pb.PutResponse, error)
DeleteRange(ctx context.Context, r *pb.DeleteRangeRequest) (*pb.DeleteRangeResponse, error)
Txn(ctx context.Context, r *pb.TxnRequest) (*pb.TxnResponse, error)
Compact(ctx context.Context, r *pb.CompactionRequest) (*pb.CompactionResponse, error)
}
type Lessor interface {
// LeaseGrant sends LeaseGrant request to raft and apply it after committed.
LeaseGrant(ctx context.Context, r *pb.LeaseGrantRequest) (*pb.LeaseGrantResponse, error)
// LeaseRevoke sends LeaseRevoke request to raft and apply it after committed.
LeaseRevoke(ctx context.Context, r *pb.LeaseRevokeRequest) (*pb.LeaseRevokeResponse, error)
// LeaseRenew renews the lease with given ID. The renewed TTL is returned. Or an error
// is returned.
LeaseRenew(ctx context.Context, id lease.LeaseID) (int64, error)
// LeaseTimeToLive retrieves lease information.
LeaseTimeToLive(ctx context.Context, r *pb.LeaseTimeToLiveRequest) (*pb.LeaseTimeToLiveResponse, error)
// LeaseLeases lists all leases.
LeaseLeases(ctx context.Context, r *pb.LeaseLeasesRequest) (*pb.LeaseLeasesResponse, error)
}
type Authenticator interface {
AuthEnable(ctx context.Context, r *pb.AuthEnableRequest) (*pb.AuthEnableResponse, error)
AuthDisable(ctx context.Context, r *pb.AuthDisableRequest) (*pb.AuthDisableResponse, error)
AuthStatus(ctx context.Context, r *pb.AuthStatusRequest) (*pb.AuthStatusResponse, error)
Authenticate(ctx context.Context, r *pb.AuthenticateRequest) (*pb.AuthenticateResponse, error)
UserAdd(ctx context.Context, r *pb.AuthUserAddRequest) (*pb.AuthUserAddResponse, error)
UserDelete(ctx context.Context, r *pb.AuthUserDeleteRequest) (*pb.AuthUserDeleteResponse, error)
UserChangePassword(ctx context.Context, r *pb.AuthUserChangePasswordRequest) (*pb.AuthUserChangePasswordResponse, error)
UserGrantRole(ctx context.Context, r *pb.AuthUserGrantRoleRequest) (*pb.AuthUserGrantRoleResponse, error)
UserGet(ctx context.Context, r *pb.AuthUserGetRequest) (*pb.AuthUserGetResponse, error)
UserRevokeRole(ctx context.Context, r *pb.AuthUserRevokeRoleRequest) (*pb.AuthUserRevokeRoleResponse, error)
RoleAdd(ctx context.Context, r *pb.AuthRoleAddRequest) (*pb.AuthRoleAddResponse, error)
RoleGrantPermission(ctx context.Context, r *pb.AuthRoleGrantPermissionRequest) (*pb.AuthRoleGrantPermissionResponse, error)
RoleGet(ctx context.Context, r *pb.AuthRoleGetRequest) (*pb.AuthRoleGetResponse, error)
RoleRevokePermission(ctx context.Context, r *pb.AuthRoleRevokePermissionRequest) (*pb.AuthRoleRevokePermissionResponse, error)
RoleDelete(ctx context.Context, r *pb.AuthRoleDeleteRequest) (*pb.AuthRoleDeleteResponse, error)
UserList(ctx context.Context, r *pb.AuthUserListRequest) (*pb.AuthUserListResponse, error)
RoleList(ctx context.Context, r *pb.AuthRoleListRequest) (*pb.AuthRoleListResponse, error)
}
func (s *EtcdServer) Range(ctx context.Context, r *pb.RangeRequest) (*pb.RangeResponse, error) {
trace := traceutil.New("range",
s.Logger(),
traceutil.Field{Key: "range_begin", Value: string(r.Key)},
traceutil.Field{Key: "range_end", Value: string(r.RangeEnd)},
)
ctx = context.WithValue(ctx, traceutil.TraceKey, trace)
var resp *pb.RangeResponse
var err error
defer func(start time.Time) {
warnOfExpensiveReadOnlyRangeRequest(s.Logger(), s.Cfg.WarningApplyDuration, start, r, resp, err)
if resp != nil {
trace.AddField(
traceutil.Field{Key: "response_count", Value: len(resp.Kvs)},
traceutil.Field{Key: "response_revision", Value: resp.Header.Revision},
)
}
trace.LogIfLong(traceThreshold)
}(time.Now())
if !r.Serializable {
err = s.linearizableReadNotify(ctx)
trace.Step("agreement among raft nodes before linearized reading")
if err != nil {
return nil, err
}
}
chk := func(ai *auth.AuthInfo) error {
return s.authStore.IsRangePermitted(ai, r.Key, r.RangeEnd)
}
get := func() { resp, err = s.applyV3Base.Range(ctx, nil, r) }
if serr := s.doSerialize(ctx, chk, get); serr != nil {
err = serr
return nil, err
}
return resp, err
}
func (s *EtcdServer) Put(ctx context.Context, r *pb.PutRequest) (*pb.PutResponse, error) {
ctx = context.WithValue(ctx, traceutil.StartTimeKey, time.Now())
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{Put: r})
if err != nil {
return nil, err
}
return resp.(*pb.PutResponse), nil
}
func (s *EtcdServer) DeleteRange(ctx context.Context, r *pb.DeleteRangeRequest) (*pb.DeleteRangeResponse, error) {
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{DeleteRange: r})
if err != nil {
return nil, err
}
return resp.(*pb.DeleteRangeResponse), nil
}
func (s *EtcdServer) Txn(ctx context.Context, r *pb.TxnRequest) (*pb.TxnResponse, error) {
if isTxnReadonly(r) {
trace := traceutil.New("transaction",
s.Logger(),
traceutil.Field{Key: "read_only", Value: true},
)
ctx = context.WithValue(ctx, traceutil.TraceKey, trace)
if !isTxnSerializable(r) {
err := s.linearizableReadNotify(ctx)
trace.Step("agreement among raft nodes before linearized reading")
if err != nil {
return nil, err
}
}
var resp *pb.TxnResponse
var err error
chk := func(ai *auth.AuthInfo) error {
return checkTxnAuth(s.authStore, ai, r)
}
defer func(start time.Time) {
warnOfExpensiveReadOnlyTxnRequest(s.Logger(), s.Cfg.WarningApplyDuration, start, r, resp, err)
trace.LogIfLong(traceThreshold)
}(time.Now())
get := func() { resp, _, err = s.applyV3Base.Txn(ctx, r) }
if serr := s.doSerialize(ctx, chk, get); serr != nil {
return nil, serr
}
return resp, err
}
ctx = context.WithValue(ctx, traceutil.StartTimeKey, time.Now())
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{Txn: r})
if err != nil {
return nil, err
}
return resp.(*pb.TxnResponse), nil
}
func isTxnSerializable(r *pb.TxnRequest) bool {
for _, u := range r.Success {
if r := u.GetRequestRange(); r == nil || !r.Serializable {
return false
}
}
for _, u := range r.Failure {
if r := u.GetRequestRange(); r == nil || !r.Serializable {
return false
}
}
return true
}
func isTxnReadonly(r *pb.TxnRequest) bool {
for _, u := range r.Success {
if r := u.GetRequestRange(); r == nil {
return false
}
}
for _, u := range r.Failure {
if r := u.GetRequestRange(); r == nil {
return false
}
}
return true
}
func (s *EtcdServer) Compact(ctx context.Context, r *pb.CompactionRequest) (*pb.CompactionResponse, error) {
startTime := time.Now()
result, err := s.processInternalRaftRequestOnce(ctx, pb.InternalRaftRequest{Compaction: r})
trace := traceutil.TODO()
if result != nil && result.trace != nil {
trace = result.trace
defer func() {
trace.LogIfLong(traceThreshold)
}()
applyStart := result.trace.GetStartTime()
result.trace.SetStartTime(startTime)
trace.InsertStep(0, applyStart, "process raft request")
}
if r.Physical && result != nil && result.physc != nil {
<-result.physc
// The compaction is done deleting keys; the hash is now settled
// but the data is not necessarily committed. If there's a crash,
// the hash may revert to a hash prior to compaction completing
// if the compaction resumes. Force the finished compaction to
// commit so it won't resume following a crash.
s.be.ForceCommit()
trace.Step("physically apply compaction")
}
if err != nil {
return nil, err
}
if result.err != nil {
return nil, result.err
}
resp := result.resp.(*pb.CompactionResponse)
if resp == nil {
resp = &pb.CompactionResponse{}
}
if resp.Header == nil {
resp.Header = &pb.ResponseHeader{}
}
resp.Header.Revision = s.kv.Rev()
trace.AddField(traceutil.Field{Key: "response_revision", Value: resp.Header.Revision})
return resp, nil
}
func (s *EtcdServer) LeaseGrant(ctx context.Context, r *pb.LeaseGrantRequest) (*pb.LeaseGrantResponse, error) {
// no id given? choose one
for r.ID == int64(lease.NoLease) {
// only use positive int64 id's
r.ID = int64(s.reqIDGen.Next() & ((1 << 63) - 1))
}
resp, err := s.raftRequestOnce(ctx, pb.InternalRaftRequest{LeaseGrant: r})
if err != nil {
return nil, err
}
return resp.(*pb.LeaseGrantResponse), nil
}
func (s *EtcdServer) LeaseRevoke(ctx context.Context, r *pb.LeaseRevokeRequest) (*pb.LeaseRevokeResponse, error) {
resp, err := s.raftRequestOnce(ctx, pb.InternalRaftRequest{LeaseRevoke: r})
if err != nil {
return nil, err
}
return resp.(*pb.LeaseRevokeResponse), nil
}
func (s *EtcdServer) LeaseRenew(ctx context.Context, id lease.LeaseID) (int64, error) {
ttl, err := s.lessor.Renew(id)
if err == nil { // already requested to primary lessor(leader)
return ttl, nil
}
if err != lease.ErrNotPrimary {
return -1, err
}
cctx, cancel := context.WithTimeout(ctx, s.Cfg.ReqTimeout())
defer cancel()
// renewals don't go through raft; forward to leader manually
for cctx.Err() == nil && err != nil {
leader, lerr := s.waitLeader(cctx)
if lerr != nil {
return -1, lerr
}
for _, url := range leader.PeerURLs {
lurl := url + leasehttp.LeasePrefix
ttl, err = leasehttp.RenewHTTP(cctx, id, lurl, s.peerRt)
if err == nil || err == lease.ErrLeaseNotFound {
return ttl, err
}
}
// Throttle in case of e.g. connection problems.
time.Sleep(50 * time.Millisecond)
}
if cctx.Err() == context.DeadlineExceeded {
return -1, ErrTimeout
}
return -1, ErrCanceled
}
func (s *EtcdServer) LeaseTimeToLive(ctx context.Context, r *pb.LeaseTimeToLiveRequest) (*pb.LeaseTimeToLiveResponse, error) {
if s.Leader() == s.ID() {
// primary; timetolive directly from leader
le := s.lessor.Lookup(lease.LeaseID(r.ID))
if le == nil {
return nil, lease.ErrLeaseNotFound
}
// TODO: fill out ResponseHeader
resp := &pb.LeaseTimeToLiveResponse{Header: &pb.ResponseHeader{}, ID: r.ID, TTL: int64(le.Remaining().Seconds()), GrantedTTL: le.TTL()}
if r.Keys {
ks := le.Keys()
kbs := make([][]byte, len(ks))
for i := range ks {
kbs[i] = []byte(ks[i])
}
resp.Keys = kbs
}
return resp, nil
}
cctx, cancel := context.WithTimeout(ctx, s.Cfg.ReqTimeout())
defer cancel()
// forward to leader
for cctx.Err() == nil {
leader, err := s.waitLeader(cctx)
if err != nil {
return nil, err
}
for _, url := range leader.PeerURLs {
lurl := url + leasehttp.LeaseInternalPrefix
resp, err := leasehttp.TimeToLiveHTTP(cctx, lease.LeaseID(r.ID), r.Keys, lurl, s.peerRt)
if err == nil {
return resp.LeaseTimeToLiveResponse, nil
}
if err == lease.ErrLeaseNotFound {
return nil, err
}
}
}
if cctx.Err() == context.DeadlineExceeded {
return nil, ErrTimeout
}
return nil, ErrCanceled
}
func (s *EtcdServer) LeaseLeases(ctx context.Context, r *pb.LeaseLeasesRequest) (*pb.LeaseLeasesResponse, error) {
ls := s.lessor.Leases()
lss := make([]*pb.LeaseStatus, len(ls))
for i := range ls {
lss[i] = &pb.LeaseStatus{ID: int64(ls[i].ID)}
}
return &pb.LeaseLeasesResponse{Header: newHeader(s), Leases: lss}, nil
}
func (s *EtcdServer) waitLeader(ctx context.Context) (*membership.Member, error) {
leader := s.cluster.Member(s.Leader())
for leader == nil {
// wait an election
dur := time.Duration(s.Cfg.ElectionTicks) * time.Duration(s.Cfg.TickMs) * time.Millisecond
select {
case <-time.After(dur):
leader = s.cluster.Member(s.Leader())
case <-s.stopping:
return nil, ErrStopped
case <-ctx.Done():
return nil, ErrNoLeader
}
}
if leader == nil || len(leader.PeerURLs) == 0 {
return nil, ErrNoLeader
}
return leader, nil
}
func (s *EtcdServer) Alarm(ctx context.Context, r *pb.AlarmRequest) (*pb.AlarmResponse, error) {
resp, err := s.raftRequestOnce(ctx, pb.InternalRaftRequest{Alarm: r})
if err != nil {
return nil, err
}
return resp.(*pb.AlarmResponse), nil
}
func (s *EtcdServer) AuthEnable(ctx context.Context, r *pb.AuthEnableRequest) (*pb.AuthEnableResponse, error) {
resp, err := s.raftRequestOnce(ctx, pb.InternalRaftRequest{AuthEnable: r})
if err != nil {
return nil, err
}
return resp.(*pb.AuthEnableResponse), nil
}
func (s *EtcdServer) AuthDisable(ctx context.Context, r *pb.AuthDisableRequest) (*pb.AuthDisableResponse, error) {
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{AuthDisable: r})
if err != nil {
return nil, err
}
return resp.(*pb.AuthDisableResponse), nil
}
func (s *EtcdServer) AuthStatus(ctx context.Context, r *pb.AuthStatusRequest) (*pb.AuthStatusResponse, error) {
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{AuthStatus: r})
if err != nil {
return nil, err
}
return resp.(*pb.AuthStatusResponse), nil
}
func (s *EtcdServer) Authenticate(ctx context.Context, r *pb.AuthenticateRequest) (*pb.AuthenticateResponse, error) {
if err := s.linearizableReadNotify(ctx); err != nil {
return nil, err
}
lg := s.Logger()
var resp proto.Message
for {
checkedRevision, err := s.AuthStore().CheckPassword(r.Name, r.Password)
if err != nil {
if err != auth.ErrAuthNotEnabled {
lg.Warn(
"invalid authentication was requested",
zap.String("user", r.Name),
zap.Error(err),
)
}
return nil, err
}
st, err := s.AuthStore().GenTokenPrefix()
if err != nil {
return nil, err
}
// internalReq doesn't need to have Password because the above s.AuthStore().CheckPassword() already did it.
// In addition, it will let a WAL entry not record password as a plain text.
internalReq := &pb.InternalAuthenticateRequest{
Name: r.Name,
SimpleToken: st,
}
resp, err = s.raftRequestOnce(ctx, pb.InternalRaftRequest{Authenticate: internalReq})
if err != nil {
return nil, err
}
if checkedRevision == s.AuthStore().Revision() {
break
}
lg.Info("revision when password checked became stale; retrying")
}
return resp.(*pb.AuthenticateResponse), nil
}
func (s *EtcdServer) UserAdd(ctx context.Context, r *pb.AuthUserAddRequest) (*pb.AuthUserAddResponse, error) {
if r.Options == nil || !r.Options.NoPassword {
hashedPassword, err := bcrypt.GenerateFromPassword([]byte(r.Password), s.authStore.BcryptCost())
if err != nil {
return nil, err
}
r.HashedPassword = base64.StdEncoding.EncodeToString(hashedPassword)
r.Password = ""
}
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{AuthUserAdd: r})
if err != nil {
return nil, err
}
return resp.(*pb.AuthUserAddResponse), nil
}
func (s *EtcdServer) UserDelete(ctx context.Context, r *pb.AuthUserDeleteRequest) (*pb.AuthUserDeleteResponse, error) {
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{AuthUserDelete: r})
if err != nil {
return nil, err
}
return resp.(*pb.AuthUserDeleteResponse), nil
}
func (s *EtcdServer) UserChangePassword(ctx context.Context, r *pb.AuthUserChangePasswordRequest) (*pb.AuthUserChangePasswordResponse, error) {
if r.Password != "" {
hashedPassword, err := bcrypt.GenerateFromPassword([]byte(r.Password), s.authStore.BcryptCost())
if err != nil {
return nil, err
}
r.HashedPassword = base64.StdEncoding.EncodeToString(hashedPassword)
r.Password = ""
}
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{AuthUserChangePassword: r})
if err != nil {
return nil, err
}
return resp.(*pb.AuthUserChangePasswordResponse), nil
}
func (s *EtcdServer) UserGrantRole(ctx context.Context, r *pb.AuthUserGrantRoleRequest) (*pb.AuthUserGrantRoleResponse, error) {
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{AuthUserGrantRole: r})
if err != nil {
return nil, err
}
return resp.(*pb.AuthUserGrantRoleResponse), nil
}
func (s *EtcdServer) UserGet(ctx context.Context, r *pb.AuthUserGetRequest) (*pb.AuthUserGetResponse, error) {
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{AuthUserGet: r})
if err != nil {
return nil, err
}
return resp.(*pb.AuthUserGetResponse), nil
}
func (s *EtcdServer) UserList(ctx context.Context, r *pb.AuthUserListRequest) (*pb.AuthUserListResponse, error) {
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{AuthUserList: r})
if err != nil {
return nil, err
}
return resp.(*pb.AuthUserListResponse), nil
}
func (s *EtcdServer) UserRevokeRole(ctx context.Context, r *pb.AuthUserRevokeRoleRequest) (*pb.AuthUserRevokeRoleResponse, error) {
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{AuthUserRevokeRole: r})
if err != nil {
return nil, err
}
return resp.(*pb.AuthUserRevokeRoleResponse), nil
}
func (s *EtcdServer) RoleAdd(ctx context.Context, r *pb.AuthRoleAddRequest) (*pb.AuthRoleAddResponse, error) {
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{AuthRoleAdd: r})
if err != nil {
return nil, err
}
return resp.(*pb.AuthRoleAddResponse), nil
}
func (s *EtcdServer) RoleGrantPermission(ctx context.Context, r *pb.AuthRoleGrantPermissionRequest) (*pb.AuthRoleGrantPermissionResponse, error) {
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{AuthRoleGrantPermission: r})
if err != nil {
return nil, err
}
return resp.(*pb.AuthRoleGrantPermissionResponse), nil
}
func (s *EtcdServer) RoleGet(ctx context.Context, r *pb.AuthRoleGetRequest) (*pb.AuthRoleGetResponse, error) {
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{AuthRoleGet: r})
if err != nil {
return nil, err
}
return resp.(*pb.AuthRoleGetResponse), nil
}
func (s *EtcdServer) RoleList(ctx context.Context, r *pb.AuthRoleListRequest) (*pb.AuthRoleListResponse, error) {
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{AuthRoleList: r})
if err != nil {
return nil, err
}
return resp.(*pb.AuthRoleListResponse), nil
}
func (s *EtcdServer) RoleRevokePermission(ctx context.Context, r *pb.AuthRoleRevokePermissionRequest) (*pb.AuthRoleRevokePermissionResponse, error) {
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{AuthRoleRevokePermission: r})
if err != nil {
return nil, err
}
return resp.(*pb.AuthRoleRevokePermissionResponse), nil
}
func (s *EtcdServer) RoleDelete(ctx context.Context, r *pb.AuthRoleDeleteRequest) (*pb.AuthRoleDeleteResponse, error) {
resp, err := s.raftRequest(ctx, pb.InternalRaftRequest{AuthRoleDelete: r})
if err != nil {
return nil, err
}
return resp.(*pb.AuthRoleDeleteResponse), nil
}
func (s *EtcdServer) raftRequestOnce(ctx context.Context, r pb.InternalRaftRequest) (proto.Message, error) {
result, err := s.processInternalRaftRequestOnce(ctx, r)
if err != nil {
return nil, err
}
if result.err != nil {
return nil, result.err
}
if startTime, ok := ctx.Value(traceutil.StartTimeKey).(time.Time); ok && result.trace != nil {
applyStart := result.trace.GetStartTime()
// The trace object is created in apply. Here reset the start time to trace
// the raft request time by the difference between the request start time
// and apply start time
result.trace.SetStartTime(startTime)
result.trace.InsertStep(0, applyStart, "process raft request")
result.trace.LogIfLong(traceThreshold)
}
return result.resp, nil
}
func (s *EtcdServer) raftRequest(ctx context.Context, r pb.InternalRaftRequest) (proto.Message, error) {
return s.raftRequestOnce(ctx, r)
}
// doSerialize handles the auth logic, with permissions checked by "chk", for a serialized request "get". Returns a non-nil error on authentication failure.
func (s *EtcdServer) doSerialize(ctx context.Context, chk func(*auth.AuthInfo) error, get func()) error {
trace := traceutil.Get(ctx)
ai, err := s.AuthInfoFromCtx(ctx)
if err != nil {
return err
}
if ai == nil {
// chk expects non-nil AuthInfo; use empty credentials
ai = &auth.AuthInfo{}
}
if err = chk(ai); err != nil {
return err
}
trace.Step("get authentication metadata")
// fetch response for serialized request
get()
// check for stale token revision in case the auth store was updated while
// the request has been handled.
if ai.Revision != 0 && ai.Revision != s.authStore.Revision() {
return auth.ErrAuthOldRevision
}
return nil
}
func (s *EtcdServer) processInternalRaftRequestOnce(ctx context.Context, r pb.InternalRaftRequest) (*applyResult, error) {
ai := s.getAppliedIndex()
ci := s.getCommittedIndex()
if ci > ai+maxGapBetweenApplyAndCommitIndex {
return nil, ErrTooManyRequests
}
r.Header = &pb.RequestHeader{
ID: s.reqIDGen.Next(),
}
// check authinfo if it is not InternalAuthenticateRequest
if r.Authenticate == nil {
authInfo, err := s.AuthInfoFromCtx(ctx)
if err != nil {
return nil, err
}
if authInfo != nil {
r.Header.Username = authInfo.Username
r.Header.AuthRevision = authInfo.Revision
}
}
data, err := r.Marshal()
if err != nil {
return nil, err
}
if len(data) > int(s.Cfg.MaxRequestBytes) {
return nil, ErrRequestTooLarge
}
id := r.ID
if id == 0 {
id = r.Header.ID
}
ch := s.w.Register(id)
cctx, cancel := context.WithTimeout(ctx, s.Cfg.ReqTimeout())
defer cancel()
start := time.Now()
err = s.r.Propose(cctx, data)
if err != nil {
proposalsFailed.Inc()
s.w.Trigger(id, nil) // GC wait
return nil, err
}
proposalsPending.Inc()
defer proposalsPending.Dec()
select {
case x := <-ch:
return x.(*applyResult), nil
case <-cctx.Done():
proposalsFailed.Inc()
s.w.Trigger(id, nil) // GC wait
return nil, s.parseProposeCtxErr(cctx.Err(), start)
case <-s.done:
return nil, ErrStopped
}
}
// Watchable returns a watchable interface attached to the etcdserver.
func (s *EtcdServer) Watchable() mvcc.WatchableKV { return s.KV() }
func (s *EtcdServer) linearizableReadLoop() {
for {
requestId := s.reqIDGen.Next()
leaderChangedNotifier := s.LeaderChangedNotify()
select {
case <-leaderChangedNotifier:
continue
case <-s.readwaitc:
case <-s.stopping:
return
}
// as a single loop is can unlock multiple reads, it is not very useful
// to propagate the trace from Txn or Range.
trace := traceutil.New("linearizableReadLoop", s.Logger())
nextnr := newNotifier()
s.readMu.Lock()
nr := s.readNotifier
s.readNotifier = nextnr
s.readMu.Unlock()
confirmedIndex, err := s.requestCurrentIndex(leaderChangedNotifier, requestId)
if isStopped(err) {
return
}
if err != nil {
nr.notify(err)
continue
}
trace.Step("read index received")
trace.AddField(traceutil.Field{Key: "readStateIndex", Value: confirmedIndex})
appliedIndex := s.getAppliedIndex()
trace.AddField(traceutil.Field{Key: "appliedIndex", Value: strconv.FormatUint(appliedIndex, 10)})
if appliedIndex < confirmedIndex {
select {
case <-s.applyWait.Wait(confirmedIndex):
case <-s.stopping:
return
}
}
// unblock all l-reads requested at indices before confirmedIndex
nr.notify(nil)
trace.Step("applied index is now lower than readState.Index")
trace.LogAllStepsIfLong(traceThreshold)
}
}
func isStopped(err error) bool {
return err == raft.ErrStopped || err == ErrStopped
}
func (s *EtcdServer) requestCurrentIndex(leaderChangedNotifier <-chan struct{}, requestId uint64) (uint64, error) {
err := s.sendReadIndex(requestId)
if err != nil {
return 0, err
}
lg := s.Logger()
errorTimer := time.NewTimer(s.Cfg.ReqTimeout())
defer errorTimer.Stop()
retryTimer := time.NewTimer(readIndexRetryTime)
defer retryTimer.Stop()
firstCommitInTermNotifier := s.FirstCommitInTermNotify()
for {
select {
case rs := <-s.r.readStateC:
requestIdBytes := uint64ToBigEndianBytes(requestId)
gotOwnResponse := bytes.Equal(rs.RequestCtx, requestIdBytes)
if !gotOwnResponse {
// a previous request might time out. now we should ignore the response of it and
// continue waiting for the response of the current requests.
responseId := uint64(0)
if len(rs.RequestCtx) == 8 {
responseId = binary.BigEndian.Uint64(rs.RequestCtx)
}
lg.Warn(
"ignored out-of-date read index response; local node read indexes queueing up and waiting to be in sync with leader",
zap.Uint64("sent-request-id", requestId),
zap.Uint64("received-request-id", responseId),
)
slowReadIndex.Inc()
continue
}
return rs.Index, nil
case <-leaderChangedNotifier:
readIndexFailed.Inc()
// return a retryable error.
return 0, ErrLeaderChanged
case <-firstCommitInTermNotifier:
firstCommitInTermNotifier = s.FirstCommitInTermNotify()
lg.Info("first commit in current term: resending ReadIndex request")
err := s.sendReadIndex(requestId)
if err != nil {
return 0, err
}
retryTimer.Reset(readIndexRetryTime)
continue
case <-retryTimer.C:
lg.Warn(
"waiting for ReadIndex response took too long, retrying",
zap.Uint64("sent-request-id", requestId),
zap.Duration("retry-timeout", readIndexRetryTime),
)
err := s.sendReadIndex(requestId)
if err != nil {
return 0, err
}
retryTimer.Reset(readIndexRetryTime)
continue
case <-errorTimer.C:
lg.Warn(
"timed out waiting for read index response (local node might have slow network)",
zap.Duration("timeout", s.Cfg.ReqTimeout()),
)
slowReadIndex.Inc()
return 0, ErrTimeout
case <-s.stopping:
return 0, ErrStopped
}
}
}
func uint64ToBigEndianBytes(number uint64) []byte {
byteResult := make([]byte, 8)
binary.BigEndian.PutUint64(byteResult, number)
return byteResult
}
func (s *EtcdServer) sendReadIndex(requestIndex uint64) error {
ctxToSend := uint64ToBigEndianBytes(requestIndex)
cctx, cancel := context.WithTimeout(context.Background(), s.Cfg.ReqTimeout())
err := s.r.ReadIndex(cctx, ctxToSend)
cancel()
if err == raft.ErrStopped {
return err
}
if err != nil {
lg := s.Logger()
lg.Warn("failed to get read index from Raft", zap.Error(err))
readIndexFailed.Inc()
return err
}
return nil
}
func (s *EtcdServer) LinearizableReadNotify(ctx context.Context) error {
return s.linearizableReadNotify(ctx)
}
func (s *EtcdServer) linearizableReadNotify(ctx context.Context) error {
s.readMu.RLock()
nc := s.readNotifier
s.readMu.RUnlock()
// signal linearizable loop for current notify if it hasn't been already
select {
case s.readwaitc <- struct{}{}:
default:
}
// wait for read state notification
select {
case <-nc.c:
return nc.err
case <-ctx.Done():
return ctx.Err()
case <-s.done:
return ErrStopped
}
}
func (s *EtcdServer) AuthInfoFromCtx(ctx context.Context) (*auth.AuthInfo, error) {
authInfo, err := s.AuthStore().AuthInfoFromCtx(ctx)
if authInfo != nil || err != nil {
return authInfo, err
}
if !s.Cfg.ClientCertAuthEnabled {
return nil, nil
}
authInfo = s.AuthStore().AuthInfoFromTLS(ctx)
return authInfo, nil
}
func (s *EtcdServer) Downgrade(ctx context.Context, r *pb.DowngradeRequest) (*pb.DowngradeResponse, error) {
switch r.Action {
case pb.DowngradeRequest_VALIDATE:
return s.downgradeValidate(ctx, r.Version)
case pb.DowngradeRequest_ENABLE:
return s.downgradeEnable(ctx, r)
case pb.DowngradeRequest_CANCEL:
return s.downgradeCancel(ctx)
default:
return nil, ErrUnknownMethod
}
}
func (s *EtcdServer) downgradeValidate(ctx context.Context, v string) (*pb.DowngradeResponse, error) {
resp := &pb.DowngradeResponse{}
targetVersion, err := convertToClusterVersion(v)
if err != nil {
return nil, err
}
// gets leaders commit index and wait for local store to finish applying that index
// to avoid using stale downgrade information
err = s.linearizableReadNotify(ctx)
if err != nil {
return nil, err
}
cv := s.ClusterVersion()
if cv == nil {
return nil, ErrClusterVersionUnavailable
}
resp.Version = cv.String()
allowedTargetVersion := membership.AllowedDowngradeVersion(cv)
if !targetVersion.Equal(*allowedTargetVersion) {
return nil, ErrInvalidDowngradeTargetVersion
}
downgradeInfo := s.cluster.DowngradeInfo()
if downgradeInfo.Enabled {
// Todo: return the downgrade status along with the error msg
return nil, ErrDowngradeInProcess
}
return resp, nil
}
func (s *EtcdServer) downgradeEnable(ctx context.Context, r *pb.DowngradeRequest) (*pb.DowngradeResponse, error) {
// validate downgrade capability before starting downgrade
v := r.Version
lg := s.Logger()
if resp, err := s.downgradeValidate(ctx, v); err != nil {
lg.Warn("reject downgrade request", zap.Error(err))
return resp, err
}
targetVersion, err := convertToClusterVersion(v)
if err != nil {
lg.Warn("reject downgrade request", zap.Error(err))
return nil, err
}
raftRequest := membershippb.DowngradeInfoSetRequest{Enabled: true, Ver: targetVersion.String()}
_, err = s.raftRequest(ctx, pb.InternalRaftRequest{DowngradeInfoSet: &raftRequest})
if err != nil {
lg.Warn("reject downgrade request", zap.Error(err))
return nil, err
}
resp := pb.DowngradeResponse{Version: s.ClusterVersion().String()}
return &resp, nil
}
func (s *EtcdServer) downgradeCancel(ctx context.Context) (*pb.DowngradeResponse, error) {
// gets leaders commit index and wait for local store to finish applying that index
// to avoid using stale downgrade information
if err := s.linearizableReadNotify(ctx); err != nil {
return nil, err
}
downgradeInfo := s.cluster.DowngradeInfo()
if !downgradeInfo.Enabled {
return nil, ErrNoInflightDowngrade
}
raftRequest := membershippb.DowngradeInfoSetRequest{Enabled: false}
_, err := s.raftRequest(ctx, pb.InternalRaftRequest{DowngradeInfoSet: &raftRequest})
if err != nil {
return nil, err
}
resp := pb.DowngradeResponse{Version: s.ClusterVersion().String()}
return &resp, nil
}
|
mahak/origin
|
vendor/go.etcd.io/etcd/server/v3/etcdserver/v3_server.go
|
GO
|
apache-2.0
| 30,901
|
describe("module:ng.directive:ngList", function() {
beforeEach(function() {
browser.get("./examples/example-ngList-directive/index.html");
});
var listInput = element(by.model('names'));
var names = element(by.binding('{{names}}'));
var valid = element(by.binding('myForm.namesInput.$valid'));
var error = element(by.css('span.error'));
it('should initialize to model', function() {
expect(names.getText()).toContain('["igor","misko","vojta"]');
expect(valid.getText()).toContain('true');
expect(error.getCssValue('display')).toBe('none');
});
it('should be invalid if empty', function() {
listInput.clear();
listInput.sendKeys('');
expect(names.getText()).toContain('');
expect(valid.getText()).toContain('false');
expect(error.getCssValue('display')).not.toBe('none'); });
});
|
cjlyth/golang-resume
|
webapp/lib/angular/docs/ptore2e/example-ngList-directive/jqlite_test.js
|
JavaScript
|
apache-2.0
| 843
|
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
if (typeof define !== 'function') {
var define = require('amdefine')(module, require);
}
define(function (require, exports, module) {
/**
* This is a helper function for getting values from parameter/options
* objects.
*
* @param args The object we are extracting values from
* @param name The name of the property we are getting.
* @param defaultValue An optional value to return if the property is missing
* from the object. If this is not specified and the property is missing, an
* error will be thrown.
*/
function getArg(aArgs, aName, aDefaultValue) {
if (aName in aArgs) {
return aArgs[aName];
} else if (arguments.length === 3) {
return aDefaultValue;
} else {
throw new Error('"' + aName + '" is a required argument.');
}
}
exports.getArg = getArg;
var urlRegexp = /([\w+\-.]+):\/\/((\w+:\w+)@)?([\w.]+)?(:(\d+))?(\S+)?/;
var dataUrlRegexp = /^data:.+\,.+/;
function urlParse(aUrl) {
var match = aUrl.match(urlRegexp);
if (!match) {
return null;
}
return {
scheme: match[1],
auth: match[3],
host: match[4],
port: match[6],
path: match[7]
};
}
exports.urlParse = urlParse;
function urlGenerate(aParsedUrl) {
var url = aParsedUrl.scheme + "://";
if (aParsedUrl.auth) {
url += aParsedUrl.auth + "@"
}
if (aParsedUrl.host) {
url += aParsedUrl.host;
}
if (aParsedUrl.port) {
url += ":" + aParsedUrl.port
}
if (aParsedUrl.path) {
url += aParsedUrl.path;
}
return url;
}
exports.urlGenerate = urlGenerate;
function join(aRoot, aPath) {
var url;
if (aPath.match(urlRegexp) || aPath.match(dataUrlRegexp)) {
return aPath;
}
if (aPath.charAt(0) === '/' && (url = urlParse(aRoot))) {
url.path = aPath;
return urlGenerate(url);
}
return aRoot.replace(/\/$/, '') + '/' + aPath;
}
exports.join = join;
/**
* Because behavior goes wacky when you set `__proto__` on objects, we
* have to prefix all the strings in our set with an arbitrary character.
*
* See https://github.com/mozilla/source-map/pull/31 and
* https://github.com/mozilla/source-map/issues/30
*
* @param String aStr
*/
function toSetString(aStr) {
return '$' + aStr;
}
exports.toSetString = toSetString;
function fromSetString(aStr) {
return aStr.substr(1);
}
exports.fromSetString = fromSetString;
function relative(aRoot, aPath) {
aRoot = aRoot.replace(/\/$/, '');
var url = urlParse(aRoot);
if (aPath.charAt(0) == "/" && url && url.path == "/") {
return aPath.slice(1);
}
return aPath.indexOf(aRoot + '/') === 0
? aPath.substr(aRoot.length + 1)
: aPath;
}
exports.relative = relative;
function strcmp(aStr1, aStr2) {
var s1 = aStr1 || "";
var s2 = aStr2 || "";
return (s1 > s2) - (s1 < s2);
}
/**
* Comparator between two mappings where the original positions are compared.
*
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
* mappings with the same original source/line/column, but different generated
* line and column the same. Useful when searching for a mapping with a
* stubbed out mapping.
*/
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
var cmp;
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp || onlyCompareOriginal) {
return cmp;
}
cmp = strcmp(mappingA.name, mappingB.name);
if (cmp) {
return cmp;
}
cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp) {
return cmp;
}
return mappingA.generatedColumn - mappingB.generatedColumn;
};
exports.compareByOriginalPositions = compareByOriginalPositions;
/**
* Comparator between two mappings where the generated positions are
* compared.
*
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
* mappings with the same generated line and column, but different
* source/name/original line and column the same. Useful when searching for a
* mapping with a stubbed out mapping.
*/
function compareByGeneratedPositions(mappingA, mappingB, onlyCompareGenerated) {
var cmp;
cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp || onlyCompareGenerated) {
return cmp;
}
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
};
exports.compareByGeneratedPositions = compareByGeneratedPositions;
});
|
yuyang545262477/Resume
|
项目三jQueryMobile/node_modules/source-map-support/node_modules/source-map/lib/source-map/util.js
|
JavaScript
|
mit
| 5,329
|
import * as React from 'react';
import { IconBaseProps } from 'react-icon-base';
export default class TiBatteryCharge extends React.Component<IconBaseProps> { }
|
zuzusik/DefinitelyTyped
|
types/react-icons/ti/battery-charge.d.ts
|
TypeScript
|
mit
| 161
|
/*
* class.c - basic device class management
*
* Copyright (c) 2002-3 Patrick Mochel
* Copyright (c) 2002-3 Open Source Development Labs
* Copyright (c) 2003-2004 Greg Kroah-Hartman
* Copyright (c) 2003-2004 IBM Corp.
*
* This file is released under the GPLv2
*
*/
#include <linux/device.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/string.h>
#include <linux/kdev_t.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/genhd.h>
#include <linux/mutex.h>
#include "base.h"
#define to_class_attr(_attr) container_of(_attr, struct class_attribute, attr)
static ssize_t class_attr_show(struct kobject *kobj, struct attribute *attr,
char *buf)
{
struct class_attribute *class_attr = to_class_attr(attr);
struct subsys_private *cp = to_subsys_private(kobj);
ssize_t ret = -EIO;
if (class_attr->show)
ret = class_attr->show(cp->class, class_attr, buf);
return ret;
}
static ssize_t class_attr_store(struct kobject *kobj, struct attribute *attr,
const char *buf, size_t count)
{
struct class_attribute *class_attr = to_class_attr(attr);
struct subsys_private *cp = to_subsys_private(kobj);
ssize_t ret = -EIO;
if (class_attr->store)
ret = class_attr->store(cp->class, class_attr, buf, count);
return ret;
}
static const void *class_attr_namespace(struct kobject *kobj,
const struct attribute *attr)
{
struct class_attribute *class_attr = to_class_attr(attr);
struct subsys_private *cp = to_subsys_private(kobj);
const void *ns = NULL;
if (class_attr->namespace)
ns = class_attr->namespace(cp->class, class_attr);
return ns;
}
static void class_release(struct kobject *kobj)
{
struct subsys_private *cp = to_subsys_private(kobj);
struct class *class = cp->class;
pr_debug("class '%s': release.\n", class->name);
if (class->class_release)
class->class_release(class);
else
pr_debug("class '%s' does not have a release() function, "
"be careful\n", class->name);
kfree(cp);
}
static const struct kobj_ns_type_operations *class_child_ns_type(struct kobject *kobj)
{
struct subsys_private *cp = to_subsys_private(kobj);
struct class *class = cp->class;
return class->ns_type;
}
static const struct sysfs_ops class_sysfs_ops = {
.show = class_attr_show,
.store = class_attr_store,
.namespace = class_attr_namespace,
};
static struct kobj_type class_ktype = {
.sysfs_ops = &class_sysfs_ops,
.release = class_release,
.child_ns_type = class_child_ns_type,
};
/* Hotplug events for classes go to the class subsys */
static struct kset *class_kset;
int class_create_file(struct class *cls, const struct class_attribute *attr)
{
int error;
if (cls)
error = sysfs_create_file(&cls->p->subsys.kobj,
&attr->attr);
else
error = -EINVAL;
return error;
}
void class_remove_file(struct class *cls, const struct class_attribute *attr)
{
if (cls)
sysfs_remove_file(&cls->p->subsys.kobj, &attr->attr);
}
static struct class *class_get(struct class *cls)
{
if (cls)
kset_get(&cls->p->subsys);
return cls;
}
static void class_put(struct class *cls)
{
if (cls)
kset_put(&cls->p->subsys);
}
static int add_class_attrs(struct class *cls)
{
int i;
int error = 0;
if (cls->class_attrs) {
for (i = 0; cls->class_attrs[i].attr.name; i++) {
error = class_create_file(cls, &cls->class_attrs[i]);
if (error)
goto error;
}
}
done:
return error;
error:
while (--i >= 0)
class_remove_file(cls, &cls->class_attrs[i]);
goto done;
}
static void remove_class_attrs(struct class *cls)
{
int i;
if (cls->class_attrs) {
for (i = 0; cls->class_attrs[i].attr.name; i++)
class_remove_file(cls, &cls->class_attrs[i]);
}
}
static void klist_class_dev_get(struct klist_node *n)
{
struct device *dev = container_of(n, struct device, knode_class);
get_device(dev);
}
static void klist_class_dev_put(struct klist_node *n)
{
struct device *dev = container_of(n, struct device, knode_class);
put_device(dev);
}
int __class_register(struct class *cls, struct lock_class_key *key)
{
struct subsys_private *cp;
int error;
pr_debug("device class '%s': registering\n", cls->name);
cp = kzalloc(sizeof(*cp), GFP_KERNEL);
if (!cp)
return -ENOMEM;
klist_init(&cp->klist_devices, klist_class_dev_get, klist_class_dev_put);
INIT_LIST_HEAD(&cp->interfaces);
kset_init(&cp->glue_dirs);
__mutex_init(&cp->mutex, "subsys mutex", key);
error = kobject_set_name(&cp->subsys.kobj, "%s", cls->name);
if (error) {
kfree(cp);
return error;
}
/* set the default /sys/dev directory for devices of this class */
if (!cls->dev_kobj)
cls->dev_kobj = sysfs_dev_char_kobj;
#if defined(CONFIG_BLOCK)
/* let the block class directory show up in the root of sysfs */
if (!sysfs_deprecated || cls != &block_class)
cp->subsys.kobj.kset = class_kset;
#else
cp->subsys.kobj.kset = class_kset;
#endif
cp->subsys.kobj.ktype = &class_ktype;
cp->class = cls;
cls->p = cp;
error = kset_register(&cp->subsys);
if (error) {
kfree(cp);
return error;
}
error = add_class_attrs(class_get(cls));
class_put(cls);
return error;
}
EXPORT_SYMBOL_GPL(__class_register);
void class_unregister(struct class *cls)
{
pr_debug("device class '%s': unregistering\n", cls->name);
remove_class_attrs(cls);
kset_unregister(&cls->p->subsys);
}
static void class_create_release(struct class *cls)
{
pr_debug("%s called for %s\n", __func__, cls->name);
kfree(cls);
}
/**
* class_create - create a struct class structure
* @owner: pointer to the module that is to "own" this struct class
* @name: pointer to a string for the name of this class.
* @key: the lock_class_key for this class; used by mutex lock debugging
*
* This is used to create a struct class pointer that can then be used
* in calls to device_create().
*
* Returns &struct class pointer on success, or ERR_PTR() on error.
*
* Note, the pointer created here is to be destroyed when finished by
* making a call to class_destroy().
*/
struct class *__class_create(struct module *owner, const char *name,
struct lock_class_key *key)
{
struct class *cls;
int retval;
cls = kzalloc(sizeof(*cls), GFP_KERNEL);
if (!cls) {
retval = -ENOMEM;
goto error;
}
cls->name = name;
cls->owner = owner;
cls->class_release = class_create_release;
retval = __class_register(cls, key);
if (retval)
goto error;
return cls;
error:
kfree(cls);
return ERR_PTR(retval);
}
EXPORT_SYMBOL_GPL(__class_create);
/**
* class_destroy - destroys a struct class structure
* @cls: pointer to the struct class that is to be destroyed
*
* Note, the pointer to be destroyed must have been created with a call
* to class_create().
*/
void class_destroy(struct class *cls)
{
if ((cls == NULL) || (IS_ERR(cls)))
return;
class_unregister(cls);
}
/**
* class_dev_iter_init - initialize class device iterator
* @iter: class iterator to initialize
* @class: the class we wanna iterate over
* @start: the device to start iterating from, if any
* @type: device_type of the devices to iterate over, NULL for all
*
* Initialize class iterator @iter such that it iterates over devices
* of @class. If @start is set, the list iteration will start there,
* otherwise if it is NULL, the iteration starts at the beginning of
* the list.
*/
void class_dev_iter_init(struct class_dev_iter *iter, struct class *class,
struct device *start, const struct device_type *type)
{
struct klist_node *start_knode = NULL;
if (start)
start_knode = &start->knode_class;
klist_iter_init_node(&class->p->klist_devices, &iter->ki, start_knode);
iter->type = type;
}
EXPORT_SYMBOL_GPL(class_dev_iter_init);
/**
* class_dev_iter_next - iterate to the next device
* @iter: class iterator to proceed
*
* Proceed @iter to the next device and return it. Returns NULL if
* iteration is complete.
*
* The returned device is referenced and won't be released till
* iterator is proceed to the next device or exited. The caller is
* free to do whatever it wants to do with the device including
* calling back into class code.
*/
struct device *class_dev_iter_next(struct class_dev_iter *iter)
{
struct klist_node *knode;
struct device *dev;
while (1) {
knode = klist_next(&iter->ki);
if (!knode)
return NULL;
dev = container_of(knode, struct device, knode_class);
if (!iter->type || iter->type == dev->type)
return dev;
}
}
EXPORT_SYMBOL_GPL(class_dev_iter_next);
/**
* class_dev_iter_exit - finish iteration
* @iter: class iterator to finish
*
* Finish an iteration. Always call this function after iteration is
* complete whether the iteration ran till the end or not.
*/
void class_dev_iter_exit(struct class_dev_iter *iter)
{
klist_iter_exit(&iter->ki);
}
EXPORT_SYMBOL_GPL(class_dev_iter_exit);
/**
* class_for_each_device - device iterator
* @class: the class we're iterating
* @start: the device to start with in the list, if any.
* @data: data for the callback
* @fn: function to be called for each device
*
* Iterate over @class's list of devices, and call @fn for each,
* passing it @data. If @start is set, the list iteration will start
* there, otherwise if it is NULL, the iteration starts at the
* beginning of the list.
*
* We check the return of @fn each time. If it returns anything
* other than 0, we break out and return that value.
*
* @fn is allowed to do anything including calling back into class
* code. There's no locking restriction.
*/
int class_for_each_device(struct class *class, struct device *start,
void *data, int (*fn)(struct device *, void *))
{
struct class_dev_iter iter;
struct device *dev;
int error = 0;
if (!class)
return -EINVAL;
if (!class->p) {
WARN(1, "%s called for class '%s' before it was initialized",
__func__, class->name);
return -EINVAL;
}
class_dev_iter_init(&iter, class, start, NULL);
while ((dev = class_dev_iter_next(&iter))) {
error = fn(dev, data);
if (error)
break;
}
class_dev_iter_exit(&iter);
return error;
}
EXPORT_SYMBOL_GPL(class_for_each_device);
/**
* class_find_device - device iterator for locating a particular device
* @class: the class we're iterating
* @start: Device to begin with
* @data: data for the match function
* @match: function to check device
*
* This is similar to the class_for_each_dev() function above, but it
* returns a reference to a device that is 'found' for later use, as
* determined by the @match callback.
*
* The callback should return 0 if the device doesn't match and non-zero
* if it does. If the callback returns non-zero, this function will
* return to the caller and not iterate over any more devices.
*
* Note, you will need to drop the reference with put_device() after use.
*
* @fn is allowed to do anything including calling back into class
* code. There's no locking restriction.
*/
struct device *class_find_device(struct class *class, struct device *start,
const void *data,
int (*match)(struct device *, const void *))
{
struct class_dev_iter iter;
struct device *dev;
if (!class)
return NULL;
if (!class->p) {
WARN(1, "%s called for class '%s' before it was initialized",
__func__, class->name);
return NULL;
}
class_dev_iter_init(&iter, class, start, NULL);
while ((dev = class_dev_iter_next(&iter))) {
if (match(dev, data)) {
get_device(dev);
break;
}
}
class_dev_iter_exit(&iter);
return dev;
}
EXPORT_SYMBOL_GPL(class_find_device);
int class_interface_register(struct class_interface *class_intf)
{
struct class *parent;
struct class_dev_iter iter;
struct device *dev;
if (!class_intf || !class_intf->class)
return -ENODEV;
parent = class_get(class_intf->class);
if (!parent)
return -EINVAL;
mutex_lock(&parent->p->mutex);
list_add_tail(&class_intf->node, &parent->p->interfaces);
if (class_intf->add_dev) {
class_dev_iter_init(&iter, parent, NULL, NULL);
while ((dev = class_dev_iter_next(&iter)))
class_intf->add_dev(dev, class_intf);
class_dev_iter_exit(&iter);
}
mutex_unlock(&parent->p->mutex);
return 0;
}
void class_interface_unregister(struct class_interface *class_intf)
{
struct class *parent = class_intf->class;
struct class_dev_iter iter;
struct device *dev;
if (!parent)
return;
mutex_lock(&parent->p->mutex);
list_del_init(&class_intf->node);
if (class_intf->remove_dev) {
class_dev_iter_init(&iter, parent, NULL, NULL);
while ((dev = class_dev_iter_next(&iter)))
class_intf->remove_dev(dev, class_intf);
class_dev_iter_exit(&iter);
}
mutex_unlock(&parent->p->mutex);
class_put(parent);
}
ssize_t show_class_attr_string(struct class *class,
struct class_attribute *attr, char *buf)
{
struct class_attribute_string *cs;
cs = container_of(attr, struct class_attribute_string, attr);
return snprintf(buf, PAGE_SIZE, "%s\n", cs->str);
}
EXPORT_SYMBOL_GPL(show_class_attr_string);
struct class_compat {
struct kobject *kobj;
};
/**
* class_compat_register - register a compatibility class
* @name: the name of the class
*
* Compatibility class are meant as a temporary user-space compatibility
* workaround when converting a family of class devices to a bus devices.
*/
struct class_compat *class_compat_register(const char *name)
{
struct class_compat *cls;
cls = kmalloc(sizeof(struct class_compat), GFP_KERNEL);
if (!cls)
return NULL;
cls->kobj = kobject_create_and_add(name, &class_kset->kobj);
if (!cls->kobj) {
kfree(cls);
return NULL;
}
return cls;
}
EXPORT_SYMBOL_GPL(class_compat_register);
/**
* class_compat_unregister - unregister a compatibility class
* @cls: the class to unregister
*/
void class_compat_unregister(struct class_compat *cls)
{
kobject_put(cls->kobj);
kfree(cls);
}
EXPORT_SYMBOL_GPL(class_compat_unregister);
/**
* class_compat_create_link - create a compatibility class device link to
* a bus device
* @cls: the compatibility class
* @dev: the target bus device
* @device_link: an optional device to which a "device" link should be created
*/
int class_compat_create_link(struct class_compat *cls, struct device *dev,
struct device *device_link)
{
int error;
error = sysfs_create_link(cls->kobj, &dev->kobj, dev_name(dev));
if (error)
return error;
/*
* Optionally add a "device" link (typically to the parent), as a
* class device would have one and we want to provide as much
* backwards compatibility as possible.
*/
if (device_link) {
error = sysfs_create_link(&dev->kobj, &device_link->kobj,
"device");
if (error)
sysfs_remove_link(cls->kobj, dev_name(dev));
}
return error;
}
EXPORT_SYMBOL_GPL(class_compat_create_link);
/**
* class_compat_remove_link - remove a compatibility class device link to
* a bus device
* @cls: the compatibility class
* @dev: the target bus device
* @device_link: an optional device to which a "device" link was previously
* created
*/
void class_compat_remove_link(struct class_compat *cls, struct device *dev,
struct device *device_link)
{
if (device_link)
sysfs_remove_link(&dev->kobj, "device");
sysfs_remove_link(cls->kobj, dev_name(dev));
}
EXPORT_SYMBOL_GPL(class_compat_remove_link);
int __init classes_init(void)
{
class_kset = kset_create_and_add("class", NULL, NULL);
if (!class_kset)
return -ENOMEM;
return 0;
}
EXPORT_SYMBOL_GPL(class_create_file);
EXPORT_SYMBOL_GPL(class_remove_file);
EXPORT_SYMBOL_GPL(class_unregister);
EXPORT_SYMBOL_GPL(class_destroy);
EXPORT_SYMBOL_GPL(class_interface_register);
EXPORT_SYMBOL_GPL(class_interface_unregister);
|
ychoijy/linux-3.12.24-custom
|
drivers/base/class.c
|
C
|
gpl-2.0
| 15,520
|
/*
* LuCI Template - Utility header
*
* Copyright (C) 2010-2012 Jo-Philipp Wich <jow@openwrt.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _TEMPLATE_UTILS_H_
#define _TEMPLATE_UTILS_H_
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
/* buffer object */
struct template_buffer {
char *data;
char *dptr;
unsigned int size;
unsigned int fill;
};
struct template_buffer * buf_init(int size);
int buf_grow(struct template_buffer *buf, int size);
int buf_putchar(struct template_buffer *buf, char c);
int buf_append(struct template_buffer *buf, const char *s, int len);
int buf_length(struct template_buffer *buf);
char * buf_destroy(struct template_buffer *buf);
char * utf8(const char *s, unsigned int l);
char * pcdata(const char *s, unsigned int l);
char * striptags(const char *s, unsigned int l);
void luastr_escape(struct template_buffer *out, const char *s, unsigned int l, int escape_xml);
void luastr_translate(struct template_buffer *out, const char *s, unsigned int l, int escape_xml);
#endif
|
zhaoxin54430/zhaoxin_test
|
src_luci/modules/luci-base/src/template_utils.h
|
C
|
gpl-2.0
| 1,565
|
/*
Highcharts JS v5.0.10 (2017-03-31)
3D features for Highcharts JS
@license: www.highcharts.com/license
*/
(function(E){"object"===typeof module&&module.exports?module.exports=E:E(Highcharts)})(function(E){(function(a){var q=a.deg2rad,k=a.pick;a.perspective=function(p,n,u){var m=n.options.chart.options3d,g=u?n.inverted:!1,h=n.plotWidth/2,r=n.plotHeight/2,e=m.depth/2,f=k(m.depth,1)*k(m.viewDistance,0),d=n.scale3d||1,b=q*m.beta*(g?-1:1),m=q*m.alpha*(g?-1:1),c=Math.cos(m),w=Math.cos(-b),x=Math.sin(m),y=Math.sin(-b);u||(h+=n.plotLeft,r+=n.plotTop);return a.map(p,function(b){var a,m;m=(g?b.y:b.x)-h;var n=(g?
b.x:b.y)-r,k=(b.z||0)-e;a=w*m-y*k;b=-x*y*m+c*n-w*x*k;m=c*y*m+x*n+c*w*k;n=0<f&&f<Number.POSITIVE_INFINITY?f/(m+e+f):1;a=a*n*d+h;b=b*n*d+r;return{x:g?b:a,y:g?a:b,z:m*d+e}})};a.pointCameraDistance=function(a,n){var p=n.options.chart.options3d,m=n.plotWidth/2;n=n.plotHeight/2;p=k(p.depth,1)*k(p.viewDistance,0)+p.depth;return Math.sqrt(Math.pow(m-a.plotX,2)+Math.pow(n-a.plotY,2)+Math.pow(p-a.plotZ,2))}})(E);(function(a){function q(b){var d=0,l,C;for(l=0;l<b.length;l++)C=(l+1)%b.length,d+=b[l].x*b[C].y-
b[C].x*b[l].y;return d/2}function k(b){var d=0,l;for(l=0;l<b.length;l++)d+=b[l].z;return b.length?d/b.length:0}function p(b,d,l,C,a,c,e,f){var g=[],H=c-a;return c>a&&c-a>Math.PI/2+.0001?(g=g.concat(p(b,d,l,C,a,a+Math.PI/2,e,f)),g=g.concat(p(b,d,l,C,a+Math.PI/2,c,e,f))):c<a&&a-c>Math.PI/2+.0001?(g=g.concat(p(b,d,l,C,a,a-Math.PI/2,e,f)),g=g.concat(p(b,d,l,C,a-Math.PI/2,c,e,f))):["C",b+l*Math.cos(a)-l*t*H*Math.sin(a)+e,d+C*Math.sin(a)+C*t*H*Math.cos(a)+f,b+l*Math.cos(c)+l*t*H*Math.sin(c)+e,d+C*Math.sin(c)-
C*t*H*Math.cos(c)+f,b+l*Math.cos(c)+e,d+C*Math.sin(c)+f]}var n=Math.cos,u=Math.PI,m=Math.sin,g=a.animObject,h=a.charts,r=a.color,e=a.defined,f=a.deg2rad,d=a.each,b=a.extend,c=a.inArray,w=a.map,x=a.merge,y=a.perspective,F=a.pick,A=a.SVGElement,G=a.SVGRenderer,B=a.wrap,t=4*(Math.sqrt(2)-1)/3/(u/2);G.prototype.toLinePath=function(b,a){var c=[];d(b,function(b){c.push("L",b.x,b.y)});b.length&&(c[0]="M",a&&c.push("Z"));return c};G.prototype.cuboid=function(b){var d=this.g(),c=d.destroy;b=this.cuboidPath(b);
d.attr({"stroke-linejoin":"round"});d.front=this.path(b[0]).attr({"class":"highcharts-3d-front",zIndex:b[3]}).add(d);d.top=this.path(b[1]).attr({"class":"highcharts-3d-top",zIndex:b[4]}).add(d);d.side=this.path(b[2]).attr({"class":"highcharts-3d-side",zIndex:b[5]}).add(d);d.fillSetter=function(b){this.front.attr({fill:b});this.top.attr({fill:r(b).brighten(.1).get()});this.side.attr({fill:r(b).brighten(-.1).get()});this.color=b;return this};d.opacitySetter=function(b){this.front.attr({opacity:b});
this.top.attr({opacity:b});this.side.attr({opacity:b});return this};d.attr=function(b,d){if("string"===typeof b&&"undefined"!==typeof d){var c=b;b={};b[c]=d}if(b.shapeArgs||e(b.x))b=this.renderer.cuboidPath(b.shapeArgs||b),this.front.attr({d:b[0],zIndex:b[3]}),this.top.attr({d:b[1],zIndex:b[4]}),this.side.attr({d:b[2],zIndex:b[5]});else return a.SVGElement.prototype.attr.call(this,b);return this};d.animate=function(b,d,c){e(b.x)&&e(b.y)?(b=this.renderer.cuboidPath(b),this.front.attr({zIndex:b[3]}).animate({d:b[0]},
d,c),this.top.attr({zIndex:b[4]}).animate({d:b[1]},d,c),this.side.attr({zIndex:b[5]}).animate({d:b[2]},d,c),this.attr({zIndex:-b[6]})):b.opacity?(this.front.animate(b,d,c),this.top.animate(b,d,c),this.side.animate(b,d,c)):A.prototype.animate.call(this,b,d,c);return this};d.destroy=function(){this.front.destroy();this.top.destroy();this.side.destroy();return c.call(this)};d.attr({zIndex:-b[6]});return d};G.prototype.cuboidPath=function(b){function d(b){return m[b]}var c=b.x,a=b.y,e=b.z,f=b.height,
g=b.width,r=b.depth,m=[{x:c,y:a,z:e},{x:c+g,y:a,z:e},{x:c+g,y:a+f,z:e},{x:c,y:a+f,z:e},{x:c,y:a+f,z:e+r},{x:c+g,y:a+f,z:e+r},{x:c+g,y:a,z:e+r},{x:c,y:a,z:e+r}],m=y(m,h[this.chartIndex],b.insidePlotArea),e=function(b,c){var a=[];b=w(b,d);c=w(c,d);0>q(b)?a=b:0>q(c)&&(a=c);return a};b=e([3,2,1,0],[7,6,5,4]);c=[4,5,2,3];a=e([1,6,7,0],c);e=e([1,2,5,6],[0,7,4,3]);return[this.toLinePath(b,!0),this.toLinePath(a,!0),this.toLinePath(e,!0),k(b),k(a),k(e),9E9*k(w(c,d))]};a.SVGRenderer.prototype.arc3d=function(a){function e(b){var d=
!1,a={};b=x(b);for(var e in b)-1!==c(e,n)&&(a[e]=b[e],delete b[e],d=!0);return d?a:!1}var l=this.g(),m=l.renderer,n="x y r innerR start end".split(" ");a=x(a);a.alpha*=f;a.beta*=f;l.top=m.path();l.side1=m.path();l.side2=m.path();l.inn=m.path();l.out=m.path();l.onAdd=function(){var b=l.parentGroup,a=l.attr("class");l.top.add(l);d(["out","inn","side1","side2"],function(d){l[d].addClass(a+" highcharts-3d-side").add(b)})};l.setPaths=function(b){var d=l.renderer.arc3dPath(b),a=100*d.zTop;l.attribs=b;l.top.attr({d:d.top,
zIndex:d.zTop});l.inn.attr({d:d.inn,zIndex:d.zInn});l.out.attr({d:d.out,zIndex:d.zOut});l.side1.attr({d:d.side1,zIndex:d.zSide1});l.side2.attr({d:d.side2,zIndex:d.zSide2});l.zIndex=a;l.attr({zIndex:a});b.center&&(l.top.setRadialReference(b.center),delete b.center)};l.setPaths(a);l.fillSetter=function(b){var d=r(b).brighten(-.1).get();this.fill=b;this.side1.attr({fill:d});this.side2.attr({fill:d});this.inn.attr({fill:d});this.out.attr({fill:d});this.top.attr({fill:b});return this};d(["opacity","translateX",
"translateY","visibility"],function(b){l[b+"Setter"]=function(b,a){l[a]=b;d(["out","inn","side1","side2","top"],function(d){l[d].attr(a,b)})}});B(l,"attr",function(d,a){var c;"object"===typeof a&&(c=e(a))&&(b(l.attribs,c),l.setPaths(l.attribs));return d.apply(this,[].slice.call(arguments,1))});B(l,"animate",function(b,d,a,c){var l,f=this.attribs,m;delete d.center;delete d.z;delete d.depth;delete d.alpha;delete d.beta;m=g(F(a,this.renderer.globalAnimation));m.duration&&(l=e(d),d.dummy=1,l&&(m.step=
function(b,d){function a(b){return f[b]+(F(l[b],f[b])-f[b])*d.pos}"dummy"===d.prop&&d.elem.setPaths(x(f,{x:a("x"),y:a("y"),r:a("r"),innerR:a("innerR"),start:a("start"),end:a("end")}))}),a=m);return b.call(this,d,a,c)});l.destroy=function(){this.top.destroy();this.out.destroy();this.inn.destroy();this.side1.destroy();this.side2.destroy();A.prototype.destroy.call(this)};l.hide=function(){this.top.hide();this.out.hide();this.inn.hide();this.side1.hide();this.side2.hide()};l.show=function(){this.top.show();
this.out.show();this.inn.show();this.side1.show();this.side2.show()};return l};G.prototype.arc3dPath=function(b){function d(b){b%=2*Math.PI;b>Math.PI&&(b=2*Math.PI-b);return b}var a=b.x,c=b.y,e=b.start,f=b.end-.00001,g=b.r,r=b.innerR,w=b.depth,h=b.alpha,k=b.beta,x=Math.cos(e),q=Math.sin(e);b=Math.cos(f);var y=Math.sin(f),v=g*Math.cos(k),g=g*Math.cos(h),t=r*Math.cos(k),B=r*Math.cos(h),r=w*Math.sin(k),z=w*Math.sin(h),w=["M",a+v*x,c+g*q],w=w.concat(p(a,c,v,g,e,f,0,0)),w=w.concat(["L",a+t*b,c+B*y]),w=
w.concat(p(a,c,t,B,f,e,0,0)),w=w.concat(["Z"]),F=0<k?Math.PI/2:0,k=0<h?0:Math.PI/2,F=e>-F?e:f>-F?-F:e,D=f<u-k?f:e<u-k?u-k:f,A=2*u-k,h=["M",a+v*n(F),c+g*m(F)],h=h.concat(p(a,c,v,g,F,D,0,0));f>A&&e<A?(h=h.concat(["L",a+v*n(D)+r,c+g*m(D)+z]),h=h.concat(p(a,c,v,g,D,A,r,z)),h=h.concat(["L",a+v*n(A),c+g*m(A)]),h=h.concat(p(a,c,v,g,A,f,0,0)),h=h.concat(["L",a+v*n(f)+r,c+g*m(f)+z]),h=h.concat(p(a,c,v,g,f,A,r,z)),h=h.concat(["L",a+v*n(A),c+g*m(A)]),h=h.concat(p(a,c,v,g,A,D,0,0))):f>u-k&&e<u-k&&(h=h.concat(["L",
a+v*Math.cos(D)+r,c+g*Math.sin(D)+z]),h=h.concat(p(a,c,v,g,D,f,r,z)),h=h.concat(["L",a+v*Math.cos(f),c+g*Math.sin(f)]),h=h.concat(p(a,c,v,g,f,D,0,0)));h=h.concat(["L",a+v*Math.cos(D)+r,c+g*Math.sin(D)+z]);h=h.concat(p(a,c,v,g,D,F,r,z));h=h.concat(["Z"]);k=["M",a+t*x,c+B*q];k=k.concat(p(a,c,t,B,e,f,0,0));k=k.concat(["L",a+t*Math.cos(f)+r,c+B*Math.sin(f)+z]);k=k.concat(p(a,c,t,B,f,e,r,z));k=k.concat(["Z"]);x=["M",a+v*x,c+g*q,"L",a+v*x+r,c+g*q+z,"L",a+t*x+r,c+B*q+z,"L",a+t*x,c+B*q,"Z"];a=["M",a+v*b,
c+g*y,"L",a+v*b+r,c+g*y+z,"L",a+t*b+r,c+B*y+z,"L",a+t*b,c+B*y,"Z"];y=Math.atan2(z,-r);c=Math.abs(f+y);b=Math.abs(e+y);e=Math.abs((e+f)/2+y);c=d(c);b=d(b);e=d(e);e*=1E5;f=1E5*b;c*=1E5;return{top:w,zTop:1E5*Math.PI+1,out:h,zOut:Math.max(e,f,c),inn:k,zInn:Math.max(e,f,c),side1:x,zSide1:.99*c,side2:a,zSide2:.99*f}}})(E);(function(a){function q(a,e){var f=a.plotLeft,d=a.plotWidth+f,b=a.plotTop,c=a.plotHeight+b,g=f+a.plotWidth/2,h=b+a.plotHeight/2,r=Number.MAX_VALUE,m=-Number.MAX_VALUE,k=Number.MAX_VALUE,
n=-Number.MAX_VALUE,q,t=1;q=[{x:f,y:b,z:0},{x:f,y:b,z:e}];p([0,1],function(b){q.push({x:d,y:q[b].y,z:q[b].z})});p([0,1,2,3],function(b){q.push({x:q[b].x,y:c,z:q[b].z})});q=u(q,a,!1);p(q,function(b){r=Math.min(r,b.x);m=Math.max(m,b.x);k=Math.min(k,b.y);n=Math.max(n,b.y)});f>r&&(t=Math.min(t,1-Math.abs((f+g)/(r+g))%1));d<m&&(t=Math.min(t,(d-g)/(m-g)));b>k&&(t=0>k?Math.min(t,(b+h)/(-k+b+h)):Math.min(t,1-(b+h)/(k+h)%1));c<n&&(t=Math.min(t,Math.abs((c-h)/(n-h))));return t}var k=a.Chart,p=a.each,n=a.merge,
u=a.perspective,m=a.pick,g=a.wrap;k.prototype.is3d=function(){return this.options.chart.options3d&&this.options.chart.options3d.enabled};k.prototype.propsRequireDirtyBox.push("chart.options3d");k.prototype.propsRequireUpdateSeries.push("chart.options3d");a.wrap(a.Chart.prototype,"isInsidePlot",function(a){return this.is3d()||a.apply(this,[].slice.call(arguments,1))});var h=a.getOptions();n(!0,h,{chart:{options3d:{enabled:!1,alpha:0,beta:0,depth:100,fitToPlot:!0,viewDistance:25,frame:{bottom:{size:1},
side:{size:1},back:{size:1}}}}});g(k.prototype,"setClassName",function(a){a.apply(this,[].slice.call(arguments,1));this.is3d()&&(this.container.className+=" highcharts-3d-chart")});a.wrap(a.Chart.prototype,"setChartSize",function(a){var e=this.options.chart.options3d;a.apply(this,[].slice.call(arguments,1));if(this.is3d()){var f=this.inverted,d=this.clipBox,b=this.margin;d[f?"y":"x"]=-(b[3]||0);d[f?"x":"y"]=-(b[0]||0);d[f?"height":"width"]=this.chartWidth+(b[3]||0)+(b[1]||0);d[f?"width":"height"]=
this.chartHeight+(b[0]||0)+(b[2]||0);this.scale3d=1;!0===e.fitToPlot&&(this.scale3d=q(this,e.depth))}});g(k.prototype,"redraw",function(a){this.is3d()&&(this.isDirtyBox=!0);a.apply(this,[].slice.call(arguments,1))});g(k.prototype,"renderSeries",function(a){var e=this.series.length;if(this.is3d())for(;e--;)a=this.series[e],a.translate(),a.render();else a.call(this)});k.prototype.retrieveStacks=function(a){var e=this.series,f={},d,b=1;p(this.series,function(c){d=m(c.options.stack,a?0:e.length-1-c.index);
f[d]?f[d].series.push(c):(f[d]={series:[c],position:b},b++)});f.totalStacks=b+1;return f}})(E);(function(a){var q,k=a.Axis,p=a.Chart,n=a.each,u=a.extend,m=a.merge,g=a.perspective,h=a.pick,r=a.splat,e=a.Tick,f=a.wrap;f(k.prototype,"setOptions",function(a,b){a.call(this,b);this.chart.is3d()&&"colorAxis"!==this.coll&&(a=this.options,a.tickWidth=h(a.tickWidth,0),a.gridLineWidth=h(a.gridLineWidth,1))});f(k.prototype,"render",function(a){a.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()&&"colorAxis"!==
this.coll){var b=this.chart,c=b.renderer,d=b.options.chart.options3d,e=d.frame,f=e.bottom,g=e.back,e=e.side,h=d.depth,k=this.height,m=this.width,r=this.left,n=this.top;this.isZAxis||(this.horiz?(g={x:r,y:n+(b.xAxis[0].opposite?-f.size:k),z:0,width:m,height:f.size,depth:h,insidePlotArea:!1},this.bottomFrame?this.bottomFrame.animate(g):(this.bottomFrame=c.cuboid(g).attr({"class":"highcharts-3d-frame highcharts-3d-frame-bottom",zIndex:b.yAxis[0].reversed&&0<d.alpha?4:-1}).add(),this.bottomFrame.attr({fill:f.color||
"none",stroke:f.color||"none"}))):(d={x:r+(b.yAxis[0].opposite?0:-e.size),y:n+(b.xAxis[0].opposite?-f.size:0),z:h,width:m+e.size,height:k+f.size,depth:g.size,insidePlotArea:!1},this.backFrame?this.backFrame.animate(d):(this.backFrame=c.cuboid(d).attr({"class":"highcharts-3d-frame highcharts-3d-frame-back",zIndex:-3}).add(),this.backFrame.attr({fill:g.color||"none",stroke:g.color||"none"})),b={x:r+(b.yAxis[0].opposite?m:-e.size),y:n+(b.xAxis[0].opposite?-f.size:0),z:0,width:e.size,height:k+f.size,
depth:h,insidePlotArea:!1},this.sideFrame?this.sideFrame.animate(b):(this.sideFrame=c.cuboid(b).attr({"class":"highcharts-3d-frame highcharts-3d-frame-side",zIndex:-2}).add(),this.sideFrame.attr({fill:e.color||"none",stroke:e.color||"none"}))))}});f(k.prototype,"getPlotLinePath",function(a){var b=a.apply(this,[].slice.call(arguments,1));if(!this.chart.is3d()||"colorAxis"===this.coll||null===b)return b;var c=this.chart,d=c.options.chart.options3d,c=this.isZAxis?c.plotWidth:d.depth,d=this.opposite;
this.horiz&&(d=!d);b=[this.swapZ({x:b[1],y:b[2],z:d?c:0}),this.swapZ({x:b[1],y:b[2],z:c}),this.swapZ({x:b[4],y:b[5],z:c}),this.swapZ({x:b[4],y:b[5],z:d?0:c})];b=g(b,this.chart,!1);return b=this.chart.renderer.toLinePath(b,!1)});f(k.prototype,"getLinePath",function(a){return this.chart.is3d()?[]:a.apply(this,[].slice.call(arguments,1))});f(k.prototype,"getPlotBandPath",function(a){if(!this.chart.is3d()||"colorAxis"===this.coll)return a.apply(this,[].slice.call(arguments,1));var b=arguments,c=b[1],
b=this.getPlotLinePath(b[2]);(c=this.getPlotLinePath(c))&&b?c.push("L",b[10],b[11],"L",b[7],b[8],"L",b[4],b[5],"L",b[1],b[2]):c=null;return c});f(e.prototype,"getMarkPath",function(a){var b=a.apply(this,[].slice.call(arguments,1));if(!this.axis.chart.is3d()||"colorAxis"===this.coll)return b;b=[this.axis.swapZ({x:b[1],y:b[2],z:0}),this.axis.swapZ({x:b[4],y:b[5],z:0})];b=g(b,this.axis.chart,!1);return b=["M",b[0].x,b[0].y,"L",b[1].x,b[1].y]});f(e.prototype,"getLabelPosition",function(a){var b=a.apply(this,
[].slice.call(arguments,1));this.axis.chart.is3d()&&"colorAxis"!==this.coll&&(b=g([this.axis.swapZ({x:b.x,y:b.y,z:0})],this.axis.chart,!1)[0]);return b});a.wrap(k.prototype,"getTitlePosition",function(a){var b=this.chart.is3d()&&"colorAxis"!==this.coll,c,d;b&&(d=this.axisTitleMargin,this.axisTitleMargin=0);c=a.apply(this,[].slice.call(arguments,1));b&&(c=g([this.swapZ({x:c.x,y:c.y,z:0})],this.chart,!1)[0],c[this.horiz?"y":"x"]+=(this.horiz?1:-1)*(this.opposite?-1:1)*d,this.axisTitleMargin=d);return c});
f(k.prototype,"drawCrosshair",function(a){var b=arguments;this.chart.is3d()&&b[2]&&(b[2]={plotX:b[2].plotXold||b[2].plotX,plotY:b[2].plotYold||b[2].plotY});a.apply(this,[].slice.call(b,1))});f(k.prototype,"destroy",function(a){n(["backFrame","bottomFrame","sideFrame"],function(b){this[b]&&(this[b]=this[b].destroy())},this);a.apply(this,[].slice.call(arguments,1))});k.prototype.swapZ=function(a,b){if(this.isZAxis){b=b?0:this.chart.plotLeft;var c=this.chart;return{x:b+(c.yAxis[0].opposite?a.z:c.xAxis[0].width-
a.z),y:a.y,z:a.x-b}}return a};q=a.ZAxis=function(){this.init.apply(this,arguments)};u(q.prototype,k.prototype);u(q.prototype,{isZAxis:!0,setOptions:function(a){a=m({offset:0,lineWidth:0},a);k.prototype.setOptions.call(this,a);this.coll="zAxis"},setAxisSize:function(){k.prototype.setAxisSize.call(this);this.width=this.len=this.chart.options.chart.options3d.depth;this.right=this.chart.chartWidth-this.width-this.left},getSeriesExtremes:function(){var a=this,b=a.chart;a.hasVisibleSeries=!1;a.dataMin=
a.dataMax=a.ignoreMinPadding=a.ignoreMaxPadding=null;a.buildStacks&&a.buildStacks();n(a.series,function(c){if(c.visible||!b.options.chart.ignoreHiddenSeries)a.hasVisibleSeries=!0,c=c.zData,c.length&&(a.dataMin=Math.min(h(a.dataMin,c[0]),Math.min.apply(null,c)),a.dataMax=Math.max(h(a.dataMax,c[0]),Math.max.apply(null,c)))})}});f(p.prototype,"getAxes",function(a){var b=this,c=this.options,c=c.zAxis=r(c.zAxis||{});a.call(this);b.is3d()&&(this.zAxis=[],n(c,function(a,c){a.index=c;a.isX=!0;(new q(b,a)).setScale()}))})})(E);
(function(a){function q(a){var e=a.apply(this,[].slice.call(arguments,1));this.chart.is3d()&&(e.stroke=this.options.edgeColor||e.fill,e["stroke-width"]=u(this.options.edgeWidth,1));return e}function k(a){if(this.chart.is3d()){var e=this.chart.options.plotOptions.column.grouping;void 0===e||e||void 0===this.group.zIndex||this.zIndexSet||(this.group.attr({zIndex:10*this.group.zIndex}),this.zIndexSet=!0)}a.apply(this,[].slice.call(arguments,1))}var p=a.each,n=a.perspective,u=a.pick,m=a.Series,g=a.seriesTypes,
h=a.svg;a=a.wrap;a(g.column.prototype,"translate",function(a){a.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var e=this.chart,f=this.options,d=f.depth||25,b=(f.stacking?f.stack||0:this._i)*(d+(f.groupZPadding||1));!1!==f.grouping&&(b=0);b+=f.groupZPadding||1;p(this.data,function(a){if(null!==a.y){var c=a.shapeArgs,f=a.tooltipPos;a.shapeType="cuboid";c.z=b;c.depth=d;c.insidePlotArea=!0;f=n([{x:f[0],y:f[1],z:b}],e,!0)[0];a.tooltipPos=[f.x,f.y]}});this.z=b}});a(g.column.prototype,"animate",
function(a){if(this.chart.is3d()){var e=arguments[1],f=this.yAxis,d=this,b=this.yAxis.reversed;h&&(e?p(d.data,function(a){null!==a.y&&(a.height=a.shapeArgs.height,a.shapey=a.shapeArgs.y,a.shapeArgs.height=1,b||(a.shapeArgs.y=a.stackY?a.plotY+f.translate(a.stackY):a.plotY+(a.negative?-a.height:a.height)))}):(p(d.data,function(a){null!==a.y&&(a.shapeArgs.height=a.height,a.shapeArgs.y=a.shapey,a.graphic&&a.graphic.animate(a.shapeArgs,d.options.animation))}),this.drawDataLabels(),d.animate=null))}else a.apply(this,
[].slice.call(arguments,1))});a(g.column.prototype,"init",function(a){a.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var e=this.options,f=e.grouping,d=e.stacking,b=u(this.yAxis.options.reversedStacks,!0),c=0;if(void 0===f||f){f=this.chart.retrieveStacks(d);c=e.stack||0;for(d=0;d<f[c].series.length&&f[c].series[d]!==this;d++);c=10*(f.totalStacks-f[c].position)+(b?d:-d);this.xAxis.reversed||(c=10*f.totalStacks-c)}e.zIndex=c}});a(g.column.prototype,"pointAttribs",q);g.columnrange&&a(g.columnrange.prototype,
"pointAttribs",q);a(m.prototype,"alignDataLabel",function(a){if(this.chart.is3d()&&("column"===this.type||"columnrange"===this.type)){var e=arguments[4],f={x:e.x,y:e.y,z:this.z},f=n([f],this.chart,!0)[0];e.x=f.x;e.y=f.y}a.apply(this,[].slice.call(arguments,1))});g.columnrange&&a(g.columnrange.prototype,"drawPoints",k);a(g.column.prototype,"drawPoints",k)})(E);(function(a){var q=a.deg2rad,k=a.each,p=a.pick,n=a.seriesTypes,u=a.svg;a=a.wrap;a(n.pie.prototype,"translate",function(a){a.apply(this,[].slice.call(arguments,
1));if(this.chart.is3d()){var g=this,h=g.options,m=h.depth||0,e=g.chart.options.chart.options3d,f=e.alpha,d=e.beta,b=h.stacking?(h.stack||0)*m:g._i*m,b=b+m/2;!1!==h.grouping&&(b=0);k(g.data,function(a){var c=a.shapeArgs;a.shapeType="arc3d";c.z=b;c.depth=.75*m;c.alpha=f;c.beta=d;c.center=g.center;c=(c.end+c.start)/2;a.slicedTranslation={translateX:Math.round(Math.cos(c)*h.slicedOffset*Math.cos(f*q)),translateY:Math.round(Math.sin(c)*h.slicedOffset*Math.cos(f*q))}})}});a(n.pie.prototype.pointClass.prototype,
"haloPath",function(a){var g=arguments;return this.series.chart.is3d()?[]:a.call(this,g[1])});a(n.pie.prototype,"pointAttribs",function(a,g,h){a=a.call(this,g,h);h=this.options;this.chart.is3d()&&(a.stroke=h.edgeColor||g.color||this.color,a["stroke-width"]=p(h.edgeWidth,1));return a});a(n.pie.prototype,"drawPoints",function(a){a.apply(this,[].slice.call(arguments,1));this.chart.is3d()&&k(this.points,function(a){var g=a.graphic;if(g)g[a.y&&a.visible?"show":"hide"]()})});a(n.pie.prototype,"drawDataLabels",
function(a){if(this.chart.is3d()){var g=this.chart.options.chart.options3d;k(this.data,function(a){var h=a.shapeArgs,e=h.r,f=(h.start+h.end)/2,d=a.labelPos,b=-e*(1-Math.cos((h.alpha||g.alpha)*q))*Math.sin(f),c=e*(Math.cos((h.beta||g.beta)*q)-1)*Math.cos(f);k([0,2,4],function(a){d[a]+=c;d[a+1]+=b})})}a.apply(this,[].slice.call(arguments,1))});a(n.pie.prototype,"addPoint",function(a){a.apply(this,[].slice.call(arguments,1));this.chart.is3d()&&this.update(this.userOptions,!0)});a(n.pie.prototype,"animate",
function(a){if(this.chart.is3d()){var g=arguments[1],h=this.options.animation,k=this.center,e=this.group,f=this.markerGroup;u&&(!0===h&&(h={}),g?(e.oldtranslateX=e.translateX,e.oldtranslateY=e.translateY,g={translateX:k[0],translateY:k[1],scaleX:.001,scaleY:.001},e.attr(g),f&&(f.attrSetters=e.attrSetters,f.attr(g))):(g={translateX:e.oldtranslateX,translateY:e.oldtranslateY,scaleX:1,scaleY:1},e.animate(g,h),f&&f.animate(g,h),this.animate=null))}else a.apply(this,[].slice.call(arguments,1))})})(E);
(function(a){var q=a.perspective,k=a.pick,p=a.Point,n=a.seriesTypes,u=a.wrap;u(n.scatter.prototype,"translate",function(a){a.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var g=this.chart,h=k(this.zAxis,g.options.zAxis[0]),m=[],e,f,d;for(d=0;d<this.data.length;d++)e=this.data[d],f=h.isLog&&h.val2lin?h.val2lin(e.z):e.z,e.plotZ=h.translate(f),e.isInside=e.isInside?f>=h.min&&f<=h.max:!1,m.push({x:e.plotX,y:e.plotY,z:e.plotZ});g=q(m,g,!0);for(d=0;d<this.data.length;d++)e=this.data[d],h=
g[d],e.plotXold=e.plotX,e.plotYold=e.plotY,e.plotZold=e.plotZ,e.plotX=h.x,e.plotY=h.y,e.plotZ=h.z}});u(n.scatter.prototype,"init",function(a,g,h){g.is3d()&&(this.axisTypes=["xAxis","yAxis","zAxis"],this.pointArrayMap=["x","y","z"],this.parallelArrays=["x","y","z"],this.directTouch=!0);a=a.apply(this,[g,h]);this.chart.is3d()&&(this.tooltipOptions.pointFormat=this.userOptions.tooltip?this.userOptions.tooltip.pointFormat||"x: \x3cb\x3e{point.x}\x3c/b\x3e\x3cbr/\x3ey: \x3cb\x3e{point.y}\x3c/b\x3e\x3cbr/\x3ez: \x3cb\x3e{point.z}\x3c/b\x3e\x3cbr/\x3e":
"x: \x3cb\x3e{point.x}\x3c/b\x3e\x3cbr/\x3ey: \x3cb\x3e{point.y}\x3c/b\x3e\x3cbr/\x3ez: \x3cb\x3e{point.z}\x3c/b\x3e\x3cbr/\x3e");return a});u(n.scatter.prototype,"pointAttribs",function(k,g){var h=k.apply(this,[].slice.call(arguments,1));this.chart.is3d()&&g&&(h.zIndex=a.pointCameraDistance(g,this.chart));return h});u(p.prototype,"applyOptions",function(a){var g=a.apply(this,[].slice.call(arguments,1));this.series.chart.is3d()&&void 0===g.z&&(g.z=0);return g})})(E);(function(a){var q=a.Axis,k=a.SVGRenderer,
p=a.VMLRenderer;p&&(a.setOptions({animate:!1}),p.prototype.cuboid=k.prototype.cuboid,p.prototype.cuboidPath=k.prototype.cuboidPath,p.prototype.toLinePath=k.prototype.toLinePath,p.prototype.createElement3D=k.prototype.createElement3D,p.prototype.arc3d=function(a){a=k.prototype.arc3d.call(this,a);a.css({zIndex:a.zIndex});return a},a.VMLRenderer.prototype.arc3dPath=a.SVGRenderer.prototype.arc3dPath,a.wrap(q.prototype,"render",function(a){a.apply(this,[].slice.call(arguments,1));this.sideFrame&&(this.sideFrame.css({zIndex:0}),
this.sideFrame.front.attr({fill:this.sideFrame.color}));this.bottomFrame&&(this.bottomFrame.css({zIndex:1}),this.bottomFrame.front.attr({fill:this.bottomFrame.color}));this.backFrame&&(this.backFrame.css({zIndex:0}),this.backFrame.front.attr({fill:this.backFrame.color}))}))})(E)});
|
OfficialBAMM/PrIS
|
webapp/app/bower_components/highcharts/highcharts-3d.js
|
JavaScript
|
gpl-3.0
| 22,373
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
var test = require('tape');
var binary = require('thrift/binary');
var cases = {
"Should read signed byte": function(assert){
assert.equal(1, binary.readByte(0x01));
assert.equal(-1, binary.readByte(0xFF));
assert.equal(127, binary.readByte(0x7F));
assert.equal(-128, binary.readByte(0x80));
assert.end();
},
"Should write byte": function(assert){
//Protocol simply writes to the buffer. Nothing to test.. yet.
assert.ok(true);
assert.end();
},
"Should read I16": function(assert) {
assert.equal(0, binary.readI16([0x00, 0x00]));
assert.equal(1, binary.readI16([0x00, 0x01]));
assert.equal(-1, binary.readI16([0xff, 0xff]));
// Min I16
assert.equal(-32768, binary.readI16([0x80, 0x00]));
// Max I16
assert.equal(32767, binary.readI16([0x7f, 0xff]));
assert.end();
},
"Should write I16": function(assert) {
assert.deepEqual([0x00, 0x00], binary.writeI16([], 0));
assert.deepEqual([0x00, 0x01], binary.writeI16([], 1));
assert.deepEqual([0xff, 0xff], binary.writeI16([], -1));
// Min I16
assert.deepEqual([0x80, 0x00], binary.writeI16([], -32768));
// Max I16
assert.deepEqual([0x7f, 0xff], binary.writeI16([], 32767));
assert.end();
},
"Should read I32": function(assert) {
assert.equal(0, binary.readI32([0x00, 0x00, 0x00, 0x00]));
assert.equal(1, binary.readI32([0x00, 0x00, 0x00, 0x01]));
assert.equal(-1, binary.readI32([0xff, 0xff, 0xff, 0xff]));
// Min I32
assert.equal(-2147483648, binary.readI32([0x80, 0x00, 0x00, 0x00]));
// Max I32
assert.equal(2147483647, binary.readI32([0x7f, 0xff, 0xff, 0xff]));
assert.end();
},
"Should write I32": function(assert) {
assert.deepEqual([0x00, 0x00, 0x00, 0x00], binary.writeI32([], 0));
assert.deepEqual([0x00, 0x00, 0x00, 0x01], binary.writeI32([], 1));
assert.deepEqual([0xff, 0xff, 0xff, 0xff], binary.writeI32([], -1));
// Min I32
assert.deepEqual([0x80, 0x00, 0x00, 0x00], binary.writeI32([], -2147483648));
// Max I32
assert.deepEqual([0x7f, 0xff, 0xff, 0xff], binary.writeI32([], 2147483647));
assert.end();
},
"Should read doubles": function(assert) {
assert.equal(0, binary.readDouble([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
assert.equal(0, binary.readDouble([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
assert.equal(1, binary.readDouble([0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
assert.equal(2, binary.readDouble([0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
assert.equal(-2, binary.readDouble([0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
assert.equal(Math.PI, binary.readDouble([0x40, 0x9, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18]))
assert.equal(Infinity, binary.readDouble([0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
assert.equal(-Infinity, binary.readDouble([0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
assert.ok(isNaN(binary.readDouble([0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])))
assert.equal(1/3, binary.readDouble([0x3f, 0xd5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55]))
// Min subnormal positive double
assert.equal(4.9406564584124654e-324, binary.readDouble([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]))
// Min normal positive double
assert.equal(2.2250738585072014e-308, binary.readDouble([0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
// Max positive double
assert.equal(1.7976931348623157e308, binary.readDouble([0x7f, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]))
assert.end();
},
"Should write doubles": function(assert) {
assert.deepEqual([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], 0));
assert.deepEqual([0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], 1));
assert.deepEqual([0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], 2));
assert.deepEqual([0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], -2));
assert.deepEqual([0x40, 0x9, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18], binary.writeDouble([], Math.PI));
assert.deepEqual([0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], Infinity));
assert.deepEqual([0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], -Infinity));
assert.deepEqual([0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], NaN));
assert.deepEqual([0x3f, 0xd5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55], binary.writeDouble([], 1/3));
// Min subnormal positive double
assert.deepEqual([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01], binary.writeDouble([], 4.9406564584124654e-324));
// Min normal positive double
assert.deepEqual([0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], 2.2250738585072014e-308));
// Max positive double
assert.deepEqual([0x7f, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff], binary.writeDouble([], 1.7976931348623157e308));
assert.end();
}
};
Object.keys(cases).forEach(function(caseName) {
test(caseName, cases[caseName]);
});
|
jcgruenhage/dendrite
|
vendor/src/github.com/apache/thrift/lib/nodejs/test/binary.test.js
|
JavaScript
|
apache-2.0
| 5,920
|
class C(object):
def f(self, name):
return name
__getattr__ = f
c = C()
print(c.foo) #pass
|
asedunov/intellij-community
|
python/testData/inspections/PyUnresolvedReferencesInspection/getattrAttribute.py
|
Python
|
apache-2.0
| 108
|
a = [1 2 3]
|
smmribeiro/intellij-community
|
python/testData/psi/MissingListSeparators.py
|
Python
|
apache-2.0
| 11
|
class A:
def <weak_warning descr="Function name should be lowercase">fooBar</weak_warning>(self): pass
class B(A):
def fooBar(self): pass
|
kdwink/intellij-community
|
python/testData/inspections/PyPep8NamingInspection/overridden.py
|
Python
|
apache-2.0
| 142
|
alter table CM_COURSE_SET_CANON_ASSOC_T drop constraint FKBFCBD9AE7F976CD6;
alter table CM_COURSE_SET_CANON_ASSOC_T drop constraint FKBFCBD9AE2D306E01;
alter table CM_COURSE_SET_OFFERING_ASSOC_T drop constraint FK5B9A5CFD26827043;
alter table CM_COURSE_SET_OFFERING_ASSOC_T drop constraint FK5B9A5CFD2D306E01;
alter table CM_ENROLLMENT_SET_T drop constraint FK99479DD126827043;
alter table CM_ENROLLMENT_T drop constraint FK7A7F878E456D3EA1;
alter table CM_MEETING_T drop constraint FKE15DCD9BD0506F16;
alter table CM_MEMBERSHIP_T drop constraint FK9FBBBFE067131463;
alter table CM_MEMBER_CONTAINER_T drop constraint FKD96A9BC6661E50E9;
alter table CM_MEMBER_CONTAINER_T drop constraint FKD96A9BC6456D3EA1;
alter table CM_MEMBER_CONTAINER_T drop constraint FKD96A9BC626827043;
alter table CM_MEMBER_CONTAINER_T drop constraint FKD96A9BC63B0306B1;
alter table CM_MEMBER_CONTAINER_T drop constraint FKD96A9BC64F7C8841;
alter table CM_MEMBER_CONTAINER_T drop constraint FKD96A9BC6D05F59F1;
alter table CM_MEMBER_CONTAINER_T drop constraint FKD96A9BC649A68CB6;
alter table CM_OFFICIAL_INSTRUCTORS_T drop constraint FK470F8ACCC28CC1AD;
drop table CM_ACADEMIC_SESSION_T if exists;
drop table CM_COURSE_SET_CANON_ASSOC_T if exists;
drop table CM_COURSE_SET_OFFERING_ASSOC_T if exists;
drop table CM_CROSS_LISTING_T if exists;
drop table CM_ENROLLMENT_SET_T if exists;
drop table CM_ENROLLMENT_T if exists;
drop table CM_MEETING_T if exists;
drop table CM_MEMBERSHIP_T if exists;
drop table CM_MEMBER_CONTAINER_T if exists;
drop table CM_OFFICIAL_INSTRUCTORS_T if exists;
drop table CM_SEC_CATEGORY_T if exists;
create table CM_ACADEMIC_SESSION_T (ACADEMIC_SESSION_ID bigint generated by default as identity (start with 1), VERSION integer not null, LAST_MODIFIED_BY varchar(255), LAST_MODIFIED_DATE date, CREATED_BY varchar(255), CREATED_DATE date, ENTERPRISE_ID varchar(255) not null, TITLE varchar(255) not null, DESCRIPTION varchar(255) not null, START_DATE date, END_DATE date, primary key (ACADEMIC_SESSION_ID), unique (ENTERPRISE_ID));
create table CM_COURSE_SET_CANON_ASSOC_T (COURSE_SET bigint not null, CANON_COURSE bigint not null, primary key (COURSE_SET, CANON_COURSE));
create table CM_COURSE_SET_OFFERING_ASSOC_T (COURSE_SET bigint not null, COURSE_OFFERING bigint not null, primary key (COURSE_SET, COURSE_OFFERING));
create table CM_CROSS_LISTING_T (CROSS_LISTING_ID bigint generated by default as identity (start with 1), VERSION integer not null, LAST_MODIFIED_BY varchar(255), LAST_MODIFIED_DATE date, CREATED_BY varchar(255), CREATED_DATE date, primary key (CROSS_LISTING_ID));
create table CM_ENROLLMENT_SET_T (ENROLLMENT_SET_ID bigint generated by default as identity (start with 1), VERSION integer not null, LAST_MODIFIED_BY varchar(255), LAST_MODIFIED_DATE date, CREATED_BY varchar(255), CREATED_DATE date, ENTERPRISE_ID varchar(255) not null, TITLE varchar(255) not null, DESCRIPTION varchar(255) not null, CATEGORY varchar(255) not null, DEFAULT_CREDITS varchar(255) not null, COURSE_OFFERING bigint, primary key (ENROLLMENT_SET_ID), unique (ENTERPRISE_ID));
create table CM_ENROLLMENT_T (ENROLLMENT_ID bigint generated by default as identity (start with 1), VERSION integer not null, LAST_MODIFIED_BY varchar(255), LAST_MODIFIED_DATE date, CREATED_BY varchar(255), CREATED_DATE date, USER_ID varchar(255) not null, STATUS varchar(255) not null, CREDITS varchar(255) not null, GRADING_SCHEME varchar(255) not null, DROPPED bit, ENROLLMENT_SET bigint, primary key (ENROLLMENT_ID), unique (USER_ID, ENROLLMENT_SET));
create table CM_MEETING_T (MEETING_ID bigint generated by default as identity (start with 1), LOCATION varchar(255), START_TIME time, FINISH_TIME time, NOTES varchar(255), MONDAY bit, TUESDAY bit, WEDNESDAY bit, THURSDAY bit, FRIDAY bit, SATURDAY bit, SUNDAY bit, SECTION_ID bigint not null, primary key (MEETING_ID));
create table CM_MEMBERSHIP_T (MEMBER_ID bigint generated by default as identity (start with 1), VERSION integer not null, USER_ID varchar(255) not null, ROLE varchar(255) not null, MEMBER_CONTAINER_ID bigint, STATUS varchar(255), primary key (MEMBER_ID), unique (USER_ID, MEMBER_CONTAINER_ID));
create table CM_MEMBER_CONTAINER_T (MEMBER_CONTAINER_ID bigint generated by default as identity (start with 1), CLASS_DISCR varchar(100) not null, VERSION integer not null, LAST_MODIFIED_BY varchar(255), LAST_MODIFIED_DATE date, CREATED_BY varchar(255), CREATED_DATE date, ENTERPRISE_ID varchar(100) not null, TITLE varchar(255) not null, DESCRIPTION varchar(255) not null, CATEGORY varchar(255), COURSE_OFFERING bigint, ENROLLMENT_SET bigint, PARENT_SECTION bigint, MAXSIZE integer, PARENT_COURSE_SET bigint, CROSS_LISTING bigint, STATUS varchar(255), START_DATE date, END_DATE date, CANONICAL_COURSE bigint, ACADEMIC_SESSION bigint, primary key (MEMBER_CONTAINER_ID), unique (CLASS_DISCR, ENTERPRISE_ID));
create table CM_OFFICIAL_INSTRUCTORS_T (ENROLLMENT_SET_ID bigint not null, INSTRUCTOR_ID varchar(255), unique (ENROLLMENT_SET_ID, INSTRUCTOR_ID));
create table CM_SEC_CATEGORY_T (CAT_CODE varchar(255) not null, CAT_DESCR varchar(255), primary key (CAT_CODE));
alter table CM_COURSE_SET_CANON_ASSOC_T add constraint FKBFCBD9AE7F976CD6 foreign key (CANON_COURSE) references CM_MEMBER_CONTAINER_T;
alter table CM_COURSE_SET_CANON_ASSOC_T add constraint FKBFCBD9AE2D306E01 foreign key (COURSE_SET) references CM_MEMBER_CONTAINER_T;
alter table CM_COURSE_SET_OFFERING_ASSOC_T add constraint FK5B9A5CFD26827043 foreign key (COURSE_OFFERING) references CM_MEMBER_CONTAINER_T;
alter table CM_COURSE_SET_OFFERING_ASSOC_T add constraint FK5B9A5CFD2D306E01 foreign key (COURSE_SET) references CM_MEMBER_CONTAINER_T;
create index CM_ENR_SET_CO_IDX on CM_ENROLLMENT_SET_T (COURSE_OFFERING);
alter table CM_ENROLLMENT_SET_T add constraint FK99479DD126827043 foreign key (COURSE_OFFERING) references CM_MEMBER_CONTAINER_T;
create index CM_ENR_ENR_SET_IDX on CM_ENROLLMENT_T (ENROLLMENT_SET);
create index CM_ENR_USER on CM_ENROLLMENT_T (USER_ID);
alter table CM_ENROLLMENT_T add constraint FK7A7F878E456D3EA1 foreign key (ENROLLMENT_SET) references CM_ENROLLMENT_SET_T;
alter table CM_MEETING_T add constraint FKE15DCD9BD0506F16 foreign key (SECTION_ID) references CM_MEMBER_CONTAINER_T;
create index CM_MBR_CTR on CM_MEMBERSHIP_T (MEMBER_CONTAINER_ID);
create index CM_MBR_USER on CM_MEMBERSHIP_T (USER_ID);
alter table CM_MEMBERSHIP_T add constraint FK9FBBBFE067131463 foreign key (MEMBER_CONTAINER_ID) references CM_MEMBER_CONTAINER_T;
create index CM_SECTION_PARENT_IDX on CM_MEMBER_CONTAINER_T (PARENT_SECTION);
create index CM_SECTION_ENR_SET_IDX on CM_MEMBER_CONTAINER_T (ENROLLMENT_SET);
create index CM_COURSE_SET_PARENT_IDX on CM_MEMBER_CONTAINER_T (PARENT_COURSE_SET);
create index CM_CO_ACADEMIC_SESS_IDX on CM_MEMBER_CONTAINER_T (ACADEMIC_SESSION);
create index CM_CO_CANON_COURSE_IDX on CM_MEMBER_CONTAINER_T (CANONICAL_COURSE);
create index CM_SECTION_COURSE_IDX on CM_MEMBER_CONTAINER_T (COURSE_OFFERING);
alter table CM_MEMBER_CONTAINER_T add constraint FKD96A9BC6661E50E9 foreign key (ACADEMIC_SESSION) references CM_ACADEMIC_SESSION_T;
alter table CM_MEMBER_CONTAINER_T add constraint FKD96A9BC6456D3EA1 foreign key (ENROLLMENT_SET) references CM_ENROLLMENT_SET_T;
alter table CM_MEMBER_CONTAINER_T add constraint FKD96A9BC626827043 foreign key (COURSE_OFFERING) references CM_MEMBER_CONTAINER_T;
alter table CM_MEMBER_CONTAINER_T add constraint FKD96A9BC63B0306B1 foreign key (PARENT_SECTION) references CM_MEMBER_CONTAINER_T;
alter table CM_MEMBER_CONTAINER_T add constraint FKD96A9BC64F7C8841 foreign key (CROSS_LISTING) references CM_CROSS_LISTING_T;
alter table CM_MEMBER_CONTAINER_T add constraint FKD96A9BC6D05F59F1 foreign key (CANONICAL_COURSE) references CM_MEMBER_CONTAINER_T;
alter table CM_MEMBER_CONTAINER_T add constraint FKD96A9BC649A68CB6 foreign key (PARENT_COURSE_SET) references CM_MEMBER_CONTAINER_T;
create index CM_INSTR_IDX on CM_OFFICIAL_INSTRUCTORS_T (INSTRUCTOR_ID);
alter table CM_OFFICIAL_INSTRUCTORS_T add constraint FK470F8ACCC28CC1AD foreign key (ENROLLMENT_SET_ID) references CM_ENROLLMENT_SET_T;
|
harfalm/Sakai-10.1
|
edu-services/cm-service/xdocs/db-conversion-2.3.1-2.4.0/hsql/cm-2.4-hsql.sql
|
SQL
|
apache-2.0
| 8,091
|
def x():
print "bar"
print "foo"
print "xyzzy"
|
asedunov/intellij-community
|
python/testData/copyPaste/SingleLine.after.py
|
Python
|
apache-2.0
| 58
|
// Context Menu Plugin for HTMLArea-3.0
// Sponsored by www.americanbible.org
// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
//
// (c) dynarch.com 2003.
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).
//
// $Id$
HTMLArea.loadStyle("menu.css", "ContextMenu");
function ContextMenu(editor) {
this.editor = editor;
};
ContextMenu._pluginInfo = {
name : "ContextMenu",
version : "1.0",
developer : "Mihai Bazon",
developer_url : "http://dynarch.com/mishoo/",
c_owner : "dynarch.com",
sponsor : "American Bible Society",
sponsor_url : "http://www.americanbible.org",
license : "htmlArea"
};
ContextMenu.prototype.onGenerate = function() {
var self = this;
var doc = this.editordoc = this.editor._iframe.contentWindow.document;
HTMLArea._addEvents(doc, ["contextmenu"],
function (event) {
return self.popupMenu(HTMLArea.is_ie ? self.editor._iframe.contentWindow.event : event);
});
this.currentMenu = null;
};
ContextMenu.prototype.getContextMenu = function(target) {
var self = this;
var editor = this.editor;
var config = editor.config;
var menu = [];
var tbo = this.editor.plugins.TableOperations;
if (tbo) tbo = tbo.instance;
var i18n = ContextMenu.I18N;
var selection = editor.hasSelectedText();
if (selection)
menu.push([ i18n["Cut"], function() { editor.execCommand("cut"); }, null, config.btnList["cut"][1] ],
[ i18n["Copy"], function() { editor.execCommand("copy"); }, null, config.btnList["copy"][1] ]);
menu.push([ i18n["Paste"], function() { editor.execCommand("paste"); }, null, config.btnList["paste"][1] ]);
var currentTarget = target;
var elmenus = [];
var link = null;
var table = null;
var tr = null;
var td = null;
var img = null;
function tableOperation(opcode) {
tbo.buttonPress(editor, opcode);
};
for (; target; target = target.parentNode) {
var tag = target.tagName;
if (!tag)
continue;
tag = tag.toLowerCase();
switch (tag) {
case "img":
img = target;
elmenus.push(null,
[ i18n["Image Properties"],
function() {
editor._insertImage(img);
},
i18n["Show the image properties dialog"],
config.btnList["insertimage"][1] ]
);
break;
case "a":
link = target;
elmenus.push(null,
[ i18n["Modify Link"],
function() { editor.execCommand("createlink", true); },
i18n["Current URL is"] + ': ' + link.href,
config.btnList["createlink"][1] ],
[ i18n["Check Link"],
function() { window.open(link.href); },
i18n["Opens this link in a new window"] ],
[ i18n["Remove Link"],
function() {
if (confirm(i18n["Please confirm that you want to unlink this element."] + "\n" +
i18n["Link points to:"] + " " + link.href)) {
while (link.firstChild)
link.parentNode.insertBefore(link.firstChild, link);
link.parentNode.removeChild(link);
}
},
i18n["Unlink the current element"] ]
);
break;
case "td":
td = target;
if (!tbo) break;
elmenus.push(null,
[ i18n["Cell Properties"],
function() { tableOperation("TO-cell-prop"); },
i18n["Show the Table Cell Properties dialog"],
config.btnList["TO-cell-prop"][1] ]
);
break;
case "tr":
tr = target;
if (!tbo) break;
elmenus.push(null,
[ i18n["Row Properties"],
function() { tableOperation("TO-row-prop"); },
i18n["Show the Table Row Properties dialog"],
config.btnList["TO-row-prop"][1] ],
[ i18n["Insert Row Before"],
function() { tableOperation("TO-row-insert-above"); },
i18n["Insert a new row before the current one"],
config.btnList["TO-row-insert-above"][1] ],
[ i18n["Insert Row After"],
function() { tableOperation("TO-row-insert-under"); },
i18n["Insert a new row after the current one"],
config.btnList["TO-row-insert-under"][1] ],
[ i18n["Delete Row"],
function() { tableOperation("TO-row-delete"); },
i18n["Delete the current row"],
config.btnList["TO-row-delete"][1] ]
);
break;
case "table":
table = target;
if (!tbo) break;
elmenus.push(null,
[ i18n["Table Properties"],
function() { tableOperation("TO-table-prop"); },
i18n["Show the Table Properties dialog"],
config.btnList["TO-table-prop"][1] ],
[ i18n["Insert Column Before"],
function() { tableOperation("TO-col-insert-before"); },
i18n["Insert a new column before the current one"],
config.btnList["TO-col-insert-before"][1] ],
[ i18n["Insert Column After"],
function() { tableOperation("TO-col-insert-after"); },
i18n["Insert a new column after the current one"],
config.btnList["TO-col-insert-after"][1] ],
[ i18n["Delete Column"],
function() { tableOperation("TO-col-delete"); },
i18n["Delete the current column"],
config.btnList["TO-col-delete"][1] ]
);
break;
case "body":
elmenus.push(null,
[ i18n["Justify Left"],
function() { editor.execCommand("justifyleft"); }, null,
config.btnList["justifyleft"][1] ],
[ i18n["Justify Center"],
function() { editor.execCommand("justifycenter"); }, null,
config.btnList["justifycenter"][1] ],
[ i18n["Justify Right"],
function() { editor.execCommand("justifyright"); }, null,
config.btnList["justifyright"][1] ],
[ i18n["Justify Full"],
function() { editor.execCommand("justifyfull"); }, null,
config.btnList["justifyfull"][1] ]
);
break;
}
}
if (selection && !link)
menu.push(null, [ i18n["Make link"],
function() { editor.execCommand("createlink", true); },
i18n["Create a link"],
config.btnList["createlink"][1] ]);
for (var i in elmenus)
menu.push(elmenus[i]);
menu.push(null,
[ i18n["Remove the"] + " <" + currentTarget.tagName + "> " + i18n["Element"],
function() {
if (confirm(i18n["Please confirm that you want to remove this element:"] + " " + currentTarget.tagName)) {
var el = currentTarget;
var p = el.parentNode;
p.removeChild(el);
if (HTMLArea.is_gecko) {
if (p.tagName.toLowerCase() == "td" && !p.hasChildNodes())
p.appendChild(editor._doc.createElement("br"));
editor.forceRedraw();
editor.focusEditor();
editor.updateToolbar();
if (table) {
var save_collapse = table.style.borderCollapse;
table.style.borderCollapse = "collapse";
table.style.borderCollapse = "separate";
table.style.borderCollapse = save_collapse;
}
}
}
},
i18n["Remove this node from the document"] ]);
return menu;
};
ContextMenu.prototype.popupMenu = function(ev) {
var self = this;
var i18n = ContextMenu.I18N;
if (this.currentMenu)
this.currentMenu.parentNode.removeChild(this.currentMenu);
function getPos(el) {
var r = { x: el.offsetLeft, y: el.offsetTop };
if (el.offsetParent) {
var tmp = getPos(el.offsetParent);
r.x += tmp.x;
r.y += tmp.y;
}
return r;
};
function documentClick(ev) {
ev || (ev = window.event);
if (!self.currentMenu) {
alert(i18n["How did you get here? (Please report!)"]);
return false;
}
var el = HTMLArea.is_ie ? ev.srcElement : ev.target;
for (; el != null && el != self.currentMenu; el = el.parentNode);
if (el == null)
self.closeMenu();
//HTMLArea._stopEvent(ev);
//return false;
};
var keys = [];
function keyPress(ev) {
ev || (ev = window.event);
HTMLArea._stopEvent(ev);
if (ev.keyCode == 27) {
self.closeMenu();
return false;
}
var key = String.fromCharCode(HTMLArea.is_ie ? ev.keyCode : ev.charCode).toLowerCase();
for (var i = keys.length; --i >= 0;) {
var k = keys[i];
if (k[0].toLowerCase() == key)
k[1].__msh.activate();
}
};
self.closeMenu = function() {
self.currentMenu.parentNode.removeChild(self.currentMenu);
self.currentMenu = null;
HTMLArea._removeEvent(document, "mousedown", documentClick);
HTMLArea._removeEvent(self.editordoc, "mousedown", documentClick);
if (keys.length > 0)
HTMLArea._removeEvent(self.editordoc, "keypress", keyPress);
if (HTMLArea.is_ie)
self.iePopup.hide();
};
var target = HTMLArea.is_ie ? ev.srcElement : ev.target;
var ifpos = getPos(self.editor._iframe);
var x = ev.clientX + ifpos.x;
var y = ev.clientY + ifpos.y;
var div;
var doc;
if (!HTMLArea.is_ie) {
doc = document;
} else {
// IE stinks
var popup = this.iePopup = window.createPopup();
doc = popup.document;
doc.open();
doc.write("<html><head><style type='text/css'>@import url(" + _editor_url + "plugins/ContextMenu/menu.css); html, body { padding: 0px; margin: 0px; overflow: hidden; border: 0px; }</style></head><body unselectable='yes'></body></html>");
doc.close();
}
div = doc.createElement("div");
if (HTMLArea.is_ie)
div.unselectable = "on";
div.oncontextmenu = function() { return false; };
div.className = "htmlarea-context-menu";
if (!HTMLArea.is_ie)
div.style.left = div.style.top = "0px";
doc.body.appendChild(div);
var table = doc.createElement("table");
div.appendChild(table);
table.cellSpacing = 0;
table.cellPadding = 0;
var parent = doc.createElement("tbody");
table.appendChild(parent);
var options = this.getContextMenu(target);
for (var i = 0; i < options.length; ++i) {
var option = options[i];
var item = doc.createElement("tr");
parent.appendChild(item);
if (HTMLArea.is_ie)
item.unselectable = "on";
else item.onmousedown = function(ev) {
HTMLArea._stopEvent(ev);
return false;
};
if (!option) {
item.className = "separator";
var td = doc.createElement("td");
td.className = "icon";
var IE_IS_A_FUCKING_SHIT = '>';
if (HTMLArea.is_ie) {
td.unselectable = "on";
IE_IS_A_FUCKING_SHIT = " unselectable='on' style='height=1px'> ";
}
td.innerHTML = "<div" + IE_IS_A_FUCKING_SHIT + "</div>";
var td1 = td.cloneNode(true);
td1.className = "label";
item.appendChild(td);
item.appendChild(td1);
} else {
var label = option[0];
item.className = "item";
item.__msh = {
item: item,
label: label,
action: option[1],
tooltip: option[2] || null,
icon: option[3] || null,
activate: function() {
self.closeMenu();
self.editor.focusEditor();
this.action();
}
};
label = label.replace(/_([a-zA-Z0-9])/, "<u>$1</u>");
if (label != option[0])
keys.push([ RegExp.$1, item ]);
label = label.replace(/__/, "_");
var td1 = doc.createElement("td");
if (HTMLArea.is_ie)
td1.unselectable = "on";
item.appendChild(td1);
td1.className = "icon";
if (item.__msh.icon)
td1.innerHTML = "<img align='middle' src='" + item.__msh.icon + "' />";
var td2 = doc.createElement("td");
if (HTMLArea.is_ie)
td2.unselectable = "on";
item.appendChild(td2);
td2.className = "label";
td2.innerHTML = label;
item.onmouseover = function() {
this.className += " hover";
self.editor._statusBarTree.innerHTML = this.__msh.tooltip || ' ';
};
item.onmouseout = function() { this.className = "item"; };
item.oncontextmenu = function(ev) {
this.__msh.activate();
if (!HTMLArea.is_ie)
HTMLArea._stopEvent(ev);
return false;
};
item.onmouseup = function(ev) {
var timeStamp = (new Date()).getTime();
if (timeStamp - self.timeStamp > 500)
this.__msh.activate();
if (!HTMLArea.is_ie)
HTMLArea._stopEvent(ev);
return false;
};
//if (typeof option[2] == "string")
//item.title = option[2];
}
}
if (!HTMLArea.is_ie) {
var dx = x + div.offsetWidth - window.innerWidth + 4;
var dy = y + div.offsetHeight - window.innerHeight + 4;
if (dx > 0) x -= dx;
if (dy > 0) y -= dy;
div.style.left = x + "px";
div.style.top = y + "px";
} else {
// determine the size (did I mention that IE stinks?)
var foobar = document.createElement("div");
foobar.className = "htmlarea-context-menu";
foobar.innerHTML = div.innerHTML;
document.body.appendChild(foobar);
var w = foobar.offsetWidth;
var h = foobar.offsetHeight;
document.body.removeChild(foobar);
this.iePopup.show(ev.screenX, ev.screenY, w, h);
}
this.currentMenu = div;
this.timeStamp = (new Date()).getTime();
HTMLArea._addEvent(document, "mousedown", documentClick);
HTMLArea._addEvent(this.editordoc, "mousedown", documentClick);
if (keys.length > 0)
HTMLArea._addEvent(this.editordoc, "keypress", keyPress);
HTMLArea._stopEvent(ev);
return false;
};
|
ouit0408/sakai
|
jsf/jsf-resource/src/webapp/inputRichText/htmlarea/plugins/ContextMenu/context-menu.js
|
JavaScript
|
apache-2.0
| 12,996
|
/*
* Copyright (c) 2006 Oracle. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* 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.
*
* 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.
*
*/
#include <linux/kernel.h>
#include <linux/in.h>
#include <linux/device.h>
#include <linux/dmapool.h>
#include "rds.h"
#include "rdma.h"
#include "ib.h"
static void rds_ib_send_rdma_complete(struct rds_message *rm,
int wc_status)
{
int notify_status;
switch (wc_status) {
case IB_WC_WR_FLUSH_ERR:
return;
case IB_WC_SUCCESS:
notify_status = RDS_RDMA_SUCCESS;
break;
case IB_WC_REM_ACCESS_ERR:
notify_status = RDS_RDMA_REMOTE_ERROR;
break;
default:
notify_status = RDS_RDMA_OTHER_ERROR;
break;
}
rds_rdma_send_complete(rm, notify_status);
}
static void rds_ib_send_unmap_rdma(struct rds_ib_connection *ic,
struct rds_rdma_op *op)
{
if (op->r_mapped) {
ib_dma_unmap_sg(ic->i_cm_id->device,
op->r_sg, op->r_nents,
op->r_write ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
op->r_mapped = 0;
}
}
static void rds_ib_send_unmap_rm(struct rds_ib_connection *ic,
struct rds_ib_send_work *send,
int wc_status)
{
struct rds_message *rm = send->s_rm;
rdsdebug("ic %p send %p rm %p\n", ic, send, rm);
ib_dma_unmap_sg(ic->i_cm_id->device,
rm->m_sg, rm->m_nents,
DMA_TO_DEVICE);
if (rm->m_rdma_op != NULL) {
rds_ib_send_unmap_rdma(ic, rm->m_rdma_op);
/* If the user asked for a completion notification on this
* message, we can implement three different semantics:
* 1. Notify when we received the ACK on the RDS message
* that was queued with the RDMA. This provides reliable
* notification of RDMA status at the expense of a one-way
* packet delay.
* 2. Notify when the IB stack gives us the completion event for
* the RDMA operation.
* 3. Notify when the IB stack gives us the completion event for
* the accompanying RDS messages.
* Here, we implement approach #3. To implement approach #2,
* call rds_rdma_send_complete from the cq_handler. To implement #1,
* don't call rds_rdma_send_complete at all, and fall back to the notify
* handling in the ACK processing code.
*
* Note: There's no need to explicitly sync any RDMA buffers using
* ib_dma_sync_sg_for_cpu - the completion for the RDMA
* operation itself unmapped the RDMA buffers, which takes care
* of synching.
*/
rds_ib_send_rdma_complete(rm, wc_status);
if (rm->m_rdma_op->r_write)
rds_stats_add(s_send_rdma_bytes, rm->m_rdma_op->r_bytes);
else
rds_stats_add(s_recv_rdma_bytes, rm->m_rdma_op->r_bytes);
}
/* If anyone waited for this message to get flushed out, wake
* them up now */
rds_message_unmapped(rm);
rds_message_put(rm);
send->s_rm = NULL;
}
void rds_ib_send_init_ring(struct rds_ib_connection *ic)
{
struct rds_ib_send_work *send;
u32 i;
for (i = 0, send = ic->i_sends; i < ic->i_send_ring.w_nr; i++, send++) {
struct ib_sge *sge;
send->s_rm = NULL;
send->s_op = NULL;
send->s_wr.wr_id = i;
send->s_wr.sg_list = send->s_sge;
send->s_wr.num_sge = 1;
send->s_wr.opcode = IB_WR_SEND;
send->s_wr.send_flags = 0;
send->s_wr.ex.imm_data = 0;
sge = rds_ib_data_sge(ic, send->s_sge);
sge->lkey = ic->i_mr->lkey;
sge = rds_ib_header_sge(ic, send->s_sge);
sge->addr = ic->i_send_hdrs_dma + (i * sizeof(struct rds_header));
sge->length = sizeof(struct rds_header);
sge->lkey = ic->i_mr->lkey;
}
}
void rds_ib_send_clear_ring(struct rds_ib_connection *ic)
{
struct rds_ib_send_work *send;
u32 i;
for (i = 0, send = ic->i_sends; i < ic->i_send_ring.w_nr; i++, send++) {
if (send->s_wr.opcode == 0xdead)
continue;
if (send->s_rm)
rds_ib_send_unmap_rm(ic, send, IB_WC_WR_FLUSH_ERR);
if (send->s_op)
rds_ib_send_unmap_rdma(ic, send->s_op);
}
}
/*
* The _oldest/_free ring operations here race cleanly with the alloc/unalloc
* operations performed in the send path. As the sender allocs and potentially
* unallocs the next free entry in the ring it doesn't alter which is
* the next to be freed, which is what this is concerned with.
*/
void rds_ib_send_cq_comp_handler(struct ib_cq *cq, void *context)
{
struct rds_connection *conn = context;
struct rds_ib_connection *ic = conn->c_transport_data;
struct ib_wc wc;
struct rds_ib_send_work *send;
u32 completed;
u32 oldest;
u32 i = 0;
int ret;
rdsdebug("cq %p conn %p\n", cq, conn);
rds_ib_stats_inc(s_ib_tx_cq_call);
ret = ib_req_notify_cq(cq, IB_CQ_NEXT_COMP);
if (ret)
rdsdebug("ib_req_notify_cq send failed: %d\n", ret);
while (ib_poll_cq(cq, 1, &wc) > 0) {
rdsdebug("wc wr_id 0x%llx status %u byte_len %u imm_data %u\n",
(unsigned long long)wc.wr_id, wc.status, wc.byte_len,
be32_to_cpu(wc.ex.imm_data));
rds_ib_stats_inc(s_ib_tx_cq_event);
if (wc.wr_id == RDS_IB_ACK_WR_ID) {
if (ic->i_ack_queued + HZ/2 < jiffies)
rds_ib_stats_inc(s_ib_tx_stalled);
rds_ib_ack_send_complete(ic);
continue;
}
oldest = rds_ib_ring_oldest(&ic->i_send_ring);
completed = rds_ib_ring_completed(&ic->i_send_ring, wc.wr_id, oldest);
for (i = 0; i < completed; i++) {
send = &ic->i_sends[oldest];
/* In the error case, wc.opcode sometimes contains garbage */
switch (send->s_wr.opcode) {
case IB_WR_SEND:
if (send->s_rm)
rds_ib_send_unmap_rm(ic, send, wc.status);
break;
case IB_WR_RDMA_WRITE:
case IB_WR_RDMA_READ:
/* Nothing to be done - the SG list will be unmapped
* when the SEND completes. */
break;
default:
if (printk_ratelimit())
printk(KERN_NOTICE
"RDS/IB: %s: unexpected opcode 0x%x in WR!\n",
__func__, send->s_wr.opcode);
break;
}
send->s_wr.opcode = 0xdead;
send->s_wr.num_sge = 1;
if (send->s_queued + HZ/2 < jiffies)
rds_ib_stats_inc(s_ib_tx_stalled);
/* If a RDMA operation produced an error, signal this right
* away. If we don't, the subsequent SEND that goes with this
* RDMA will be canceled with ERR_WFLUSH, and the application
* never learn that the RDMA failed. */
if (unlikely(wc.status == IB_WC_REM_ACCESS_ERR && send->s_op)) {
struct rds_message *rm;
rm = rds_send_get_message(conn, send->s_op);
if (rm) {
if (rm->m_rdma_op)
rds_ib_send_unmap_rdma(ic, rm->m_rdma_op);
rds_ib_send_rdma_complete(rm, wc.status);
rds_message_put(rm);
}
}
oldest = (oldest + 1) % ic->i_send_ring.w_nr;
}
rds_ib_ring_free(&ic->i_send_ring, completed);
if (test_and_clear_bit(RDS_LL_SEND_FULL, &conn->c_flags) ||
test_bit(0, &conn->c_map_queued))
queue_delayed_work(rds_wq, &conn->c_send_w, 0);
/* We expect errors as the qp is drained during shutdown */
if (wc.status != IB_WC_SUCCESS && rds_conn_up(conn)) {
rds_ib_conn_error(conn,
"send completion on %pI4 "
"had status %u, disconnecting and reconnecting\n",
&conn->c_faddr, wc.status);
}
}
}
/*
* This is the main function for allocating credits when sending
* messages.
*
* Conceptually, we have two counters:
* - send credits: this tells us how many WRs we're allowed
* to submit without overruning the reciever's queue. For
* each SEND WR we post, we decrement this by one.
*
* - posted credits: this tells us how many WRs we recently
* posted to the receive queue. This value is transferred
* to the peer as a "credit update" in a RDS header field.
* Every time we transmit credits to the peer, we subtract
* the amount of transferred credits from this counter.
*
* It is essential that we avoid situations where both sides have
* exhausted their send credits, and are unable to send new credits
* to the peer. We achieve this by requiring that we send at least
* one credit update to the peer before exhausting our credits.
* When new credits arrive, we subtract one credit that is withheld
* until we've posted new buffers and are ready to transmit these
* credits (see rds_ib_send_add_credits below).
*
* The RDS send code is essentially single-threaded; rds_send_xmit
* grabs c_send_lock to ensure exclusive access to the send ring.
* However, the ACK sending code is independent and can race with
* message SENDs.
*
* In the send path, we need to update the counters for send credits
* and the counter of posted buffers atomically - when we use the
* last available credit, we cannot allow another thread to race us
* and grab the posted credits counter. Hence, we have to use a
* spinlock to protect the credit counter, or use atomics.
*
* Spinlocks shared between the send and the receive path are bad,
* because they create unnecessary delays. An early implementation
* using a spinlock showed a 5% degradation in throughput at some
* loads.
*
* This implementation avoids spinlocks completely, putting both
* counters into a single atomic, and updating that atomic using
* atomic_add (in the receive path, when receiving fresh credits),
* and using atomic_cmpxchg when updating the two counters.
*/
int rds_ib_send_grab_credits(struct rds_ib_connection *ic,
u32 wanted, u32 *adv_credits, int need_posted, int max_posted)
{
unsigned int avail, posted, got = 0, advertise;
long oldval, newval;
*adv_credits = 0;
if (!ic->i_flowctl)
return wanted;
try_again:
advertise = 0;
oldval = newval = atomic_read(&ic->i_credits);
posted = IB_GET_POST_CREDITS(oldval);
avail = IB_GET_SEND_CREDITS(oldval);
rdsdebug("rds_ib_send_grab_credits(%u): credits=%u posted=%u\n",
wanted, avail, posted);
/* The last credit must be used to send a credit update. */
if (avail && !posted)
avail--;
if (avail < wanted) {
struct rds_connection *conn = ic->i_cm_id->context;
/* Oops, there aren't that many credits left! */
set_bit(RDS_LL_SEND_FULL, &conn->c_flags);
got = avail;
} else {
/* Sometimes you get what you want, lalala. */
got = wanted;
}
newval -= IB_SET_SEND_CREDITS(got);
/*
* If need_posted is non-zero, then the caller wants
* the posted regardless of whether any send credits are
* available.
*/
if (posted && (got || need_posted)) {
advertise = min_t(unsigned int, posted, max_posted);
newval -= IB_SET_POST_CREDITS(advertise);
}
/* Finally bill everything */
if (atomic_cmpxchg(&ic->i_credits, oldval, newval) != oldval)
goto try_again;
*adv_credits = advertise;
return got;
}
void rds_ib_send_add_credits(struct rds_connection *conn, unsigned int credits)
{
struct rds_ib_connection *ic = conn->c_transport_data;
if (credits == 0)
return;
rdsdebug("rds_ib_send_add_credits(%u): current=%u%s\n",
credits,
IB_GET_SEND_CREDITS(atomic_read(&ic->i_credits)),
test_bit(RDS_LL_SEND_FULL, &conn->c_flags) ? ", ll_send_full" : "");
atomic_add(IB_SET_SEND_CREDITS(credits), &ic->i_credits);
if (test_and_clear_bit(RDS_LL_SEND_FULL, &conn->c_flags))
queue_delayed_work(rds_wq, &conn->c_send_w, 0);
WARN_ON(IB_GET_SEND_CREDITS(credits) >= 16384);
rds_ib_stats_inc(s_ib_rx_credit_updates);
}
void rds_ib_advertise_credits(struct rds_connection *conn, unsigned int posted)
{
struct rds_ib_connection *ic = conn->c_transport_data;
if (posted == 0)
return;
atomic_add(IB_SET_POST_CREDITS(posted), &ic->i_credits);
/* Decide whether to send an update to the peer now.
* If we would send a credit update for every single buffer we
* post, we would end up with an ACK storm (ACK arrives,
* consumes buffer, we refill the ring, send ACK to remote
* advertising the newly posted buffer... ad inf)
*
* Performance pretty much depends on how often we send
* credit updates - too frequent updates mean lots of ACKs.
* Too infrequent updates, and the peer will run out of
* credits and has to throttle.
* For the time being, 16 seems to be a good compromise.
*/
if (IB_GET_POST_CREDITS(atomic_read(&ic->i_credits)) >= 16)
set_bit(IB_ACK_REQUESTED, &ic->i_ack_flags);
}
static inline void
rds_ib_xmit_populate_wr(struct rds_ib_connection *ic,
struct rds_ib_send_work *send, unsigned int pos,
unsigned long buffer, unsigned int length,
int send_flags)
{
struct ib_sge *sge;
WARN_ON(pos != send - ic->i_sends);
send->s_wr.send_flags = send_flags;
send->s_wr.opcode = IB_WR_SEND;
send->s_wr.num_sge = 2;
send->s_wr.next = NULL;
send->s_queued = jiffies;
send->s_op = NULL;
if (length != 0) {
sge = rds_ib_data_sge(ic, send->s_sge);
sge->addr = buffer;
sge->length = length;
sge->lkey = ic->i_mr->lkey;
sge = rds_ib_header_sge(ic, send->s_sge);
} else {
/* We're sending a packet with no payload. There is only
* one SGE */
send->s_wr.num_sge = 1;
sge = &send->s_sge[0];
}
sge->addr = ic->i_send_hdrs_dma + (pos * sizeof(struct rds_header));
sge->length = sizeof(struct rds_header);
sge->lkey = ic->i_mr->lkey;
}
/*
* This can be called multiple times for a given message. The first time
* we see a message we map its scatterlist into the IB device so that
* we can provide that mapped address to the IB scatter gather entries
* in the IB work requests. We translate the scatterlist into a series
* of work requests that fragment the message. These work requests complete
* in order so we pass ownership of the message to the completion handler
* once we send the final fragment.
*
* The RDS core uses the c_send_lock to only enter this function once
* per connection. This makes sure that the tx ring alloc/unalloc pairs
* don't get out of sync and confuse the ring.
*/
int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
unsigned int hdr_off, unsigned int sg, unsigned int off)
{
struct rds_ib_connection *ic = conn->c_transport_data;
struct ib_device *dev = ic->i_cm_id->device;
struct rds_ib_send_work *send = NULL;
struct rds_ib_send_work *first;
struct rds_ib_send_work *prev;
struct ib_send_wr *failed_wr;
struct scatterlist *scat;
u32 pos;
u32 i;
u32 work_alloc;
u32 credit_alloc;
u32 posted;
u32 adv_credits = 0;
int send_flags = 0;
int sent;
int ret;
int flow_controlled = 0;
BUG_ON(off % RDS_FRAG_SIZE);
BUG_ON(hdr_off != 0 && hdr_off != sizeof(struct rds_header));
/* Do not send cong updates to IB loopback */
if (conn->c_loopback
&& rm->m_inc.i_hdr.h_flags & RDS_FLAG_CONG_BITMAP) {
rds_cong_map_updated(conn->c_fcong, ~(u64) 0);
return sizeof(struct rds_header) + RDS_CONG_MAP_BYTES;
}
/* FIXME we may overallocate here */
if (be32_to_cpu(rm->m_inc.i_hdr.h_len) == 0)
i = 1;
else
i = ceil(be32_to_cpu(rm->m_inc.i_hdr.h_len), RDS_FRAG_SIZE);
work_alloc = rds_ib_ring_alloc(&ic->i_send_ring, i, &pos);
if (work_alloc == 0) {
set_bit(RDS_LL_SEND_FULL, &conn->c_flags);
rds_ib_stats_inc(s_ib_tx_ring_full);
ret = -ENOMEM;
goto out;
}
credit_alloc = work_alloc;
if (ic->i_flowctl) {
credit_alloc = rds_ib_send_grab_credits(ic, work_alloc, &posted, 0, RDS_MAX_ADV_CREDIT);
adv_credits += posted;
if (credit_alloc < work_alloc) {
rds_ib_ring_unalloc(&ic->i_send_ring, work_alloc - credit_alloc);
work_alloc = credit_alloc;
flow_controlled++;
}
if (work_alloc == 0) {
set_bit(RDS_LL_SEND_FULL, &conn->c_flags);
rds_ib_stats_inc(s_ib_tx_throttle);
ret = -ENOMEM;
goto out;
}
}
/* map the message the first time we see it */
if (ic->i_rm == NULL) {
/*
printk(KERN_NOTICE "rds_ib_xmit prep msg dport=%u flags=0x%x len=%d\n",
be16_to_cpu(rm->m_inc.i_hdr.h_dport),
rm->m_inc.i_hdr.h_flags,
be32_to_cpu(rm->m_inc.i_hdr.h_len));
*/
if (rm->m_nents) {
rm->m_count = ib_dma_map_sg(dev,
rm->m_sg, rm->m_nents, DMA_TO_DEVICE);
rdsdebug("ic %p mapping rm %p: %d\n", ic, rm, rm->m_count);
if (rm->m_count == 0) {
rds_ib_stats_inc(s_ib_tx_sg_mapping_failure);
rds_ib_ring_unalloc(&ic->i_send_ring, work_alloc);
ret = -ENOMEM; /* XXX ? */
goto out;
}
} else {
rm->m_count = 0;
}
ic->i_unsignaled_wrs = rds_ib_sysctl_max_unsig_wrs;
ic->i_unsignaled_bytes = rds_ib_sysctl_max_unsig_bytes;
rds_message_addref(rm);
ic->i_rm = rm;
/* Finalize the header */
if (test_bit(RDS_MSG_ACK_REQUIRED, &rm->m_flags))
rm->m_inc.i_hdr.h_flags |= RDS_FLAG_ACK_REQUIRED;
if (test_bit(RDS_MSG_RETRANSMITTED, &rm->m_flags))
rm->m_inc.i_hdr.h_flags |= RDS_FLAG_RETRANSMITTED;
/* If it has a RDMA op, tell the peer we did it. This is
* used by the peer to release use-once RDMA MRs. */
if (rm->m_rdma_op) {
struct rds_ext_header_rdma ext_hdr;
ext_hdr.h_rdma_rkey = cpu_to_be32(rm->m_rdma_op->r_key);
rds_message_add_extension(&rm->m_inc.i_hdr,
RDS_EXTHDR_RDMA, &ext_hdr, sizeof(ext_hdr));
}
if (rm->m_rdma_cookie) {
rds_message_add_rdma_dest_extension(&rm->m_inc.i_hdr,
rds_rdma_cookie_key(rm->m_rdma_cookie),
rds_rdma_cookie_offset(rm->m_rdma_cookie));
}
/* Note - rds_ib_piggyb_ack clears the ACK_REQUIRED bit, so
* we should not do this unless we have a chance of at least
* sticking the header into the send ring. Which is why we
* should call rds_ib_ring_alloc first. */
rm->m_inc.i_hdr.h_ack = cpu_to_be64(rds_ib_piggyb_ack(ic));
rds_message_make_checksum(&rm->m_inc.i_hdr);
/*
* Update adv_credits since we reset the ACK_REQUIRED bit.
*/
rds_ib_send_grab_credits(ic, 0, &posted, 1, RDS_MAX_ADV_CREDIT - adv_credits);
adv_credits += posted;
BUG_ON(adv_credits > 255);
}
send = &ic->i_sends[pos];
first = send;
prev = NULL;
scat = &rm->m_sg[sg];
sent = 0;
i = 0;
/* Sometimes you want to put a fence between an RDMA
* READ and the following SEND.
* We could either do this all the time
* or when requested by the user. Right now, we let
* the application choose.
*/
if (rm->m_rdma_op && rm->m_rdma_op->r_fence)
send_flags = IB_SEND_FENCE;
/*
* We could be copying the header into the unused tail of the page.
* That would need to be changed in the future when those pages might
* be mapped userspace pages or page cache pages. So instead we always
* use a second sge and our long-lived ring of mapped headers. We send
* the header after the data so that the data payload can be aligned on
* the receiver.
*/
/* handle a 0-len message */
if (be32_to_cpu(rm->m_inc.i_hdr.h_len) == 0) {
rds_ib_xmit_populate_wr(ic, send, pos, 0, 0, send_flags);
goto add_header;
}
/* if there's data reference it with a chain of work reqs */
for (; i < work_alloc && scat != &rm->m_sg[rm->m_count]; i++) {
unsigned int len;
send = &ic->i_sends[pos];
len = min(RDS_FRAG_SIZE, ib_sg_dma_len(dev, scat) - off);
rds_ib_xmit_populate_wr(ic, send, pos,
ib_sg_dma_address(dev, scat) + off, len,
send_flags);
/*
* We want to delay signaling completions just enough to get
* the batching benefits but not so much that we create dead time
* on the wire.
*/
if (ic->i_unsignaled_wrs-- == 0) {
ic->i_unsignaled_wrs = rds_ib_sysctl_max_unsig_wrs;
send->s_wr.send_flags |= IB_SEND_SIGNALED | IB_SEND_SOLICITED;
}
ic->i_unsignaled_bytes -= len;
if (ic->i_unsignaled_bytes <= 0) {
ic->i_unsignaled_bytes = rds_ib_sysctl_max_unsig_bytes;
send->s_wr.send_flags |= IB_SEND_SIGNALED | IB_SEND_SOLICITED;
}
/*
* Always signal the last one if we're stopping due to flow control.
*/
if (flow_controlled && i == (work_alloc-1))
send->s_wr.send_flags |= IB_SEND_SIGNALED | IB_SEND_SOLICITED;
rdsdebug("send %p wr %p num_sge %u next %p\n", send,
&send->s_wr, send->s_wr.num_sge, send->s_wr.next);
sent += len;
off += len;
if (off == ib_sg_dma_len(dev, scat)) {
scat++;
off = 0;
}
add_header:
/* Tack on the header after the data. The header SGE should already
* have been set up to point to the right header buffer. */
memcpy(&ic->i_send_hdrs[pos], &rm->m_inc.i_hdr, sizeof(struct rds_header));
if (0) {
struct rds_header *hdr = &ic->i_send_hdrs[pos];
printk(KERN_NOTICE "send WR dport=%u flags=0x%x len=%d\n",
be16_to_cpu(hdr->h_dport),
hdr->h_flags,
be32_to_cpu(hdr->h_len));
}
if (adv_credits) {
struct rds_header *hdr = &ic->i_send_hdrs[pos];
/* add credit and redo the header checksum */
hdr->h_credit = adv_credits;
rds_message_make_checksum(hdr);
adv_credits = 0;
rds_ib_stats_inc(s_ib_tx_credit_updates);
}
if (prev)
prev->s_wr.next = &send->s_wr;
prev = send;
pos = (pos + 1) % ic->i_send_ring.w_nr;
}
/* Account the RDS header in the number of bytes we sent, but just once.
* The caller has no concept of fragmentation. */
if (hdr_off == 0)
sent += sizeof(struct rds_header);
/* if we finished the message then send completion owns it */
if (scat == &rm->m_sg[rm->m_count]) {
prev->s_rm = ic->i_rm;
prev->s_wr.send_flags |= IB_SEND_SIGNALED | IB_SEND_SOLICITED;
ic->i_rm = NULL;
}
if (i < work_alloc) {
rds_ib_ring_unalloc(&ic->i_send_ring, work_alloc - i);
work_alloc = i;
}
if (ic->i_flowctl && i < credit_alloc)
rds_ib_send_add_credits(conn, credit_alloc - i);
/* XXX need to worry about failed_wr and partial sends. */
failed_wr = &first->s_wr;
ret = ib_post_send(ic->i_cm_id->qp, &first->s_wr, &failed_wr);
rdsdebug("ic %p first %p (wr %p) ret %d wr %p\n", ic,
first, &first->s_wr, ret, failed_wr);
BUG_ON(failed_wr != &first->s_wr);
if (ret) {
printk(KERN_WARNING "RDS/IB: ib_post_send to %pI4 "
"returned %d\n", &conn->c_faddr, ret);
rds_ib_ring_unalloc(&ic->i_send_ring, work_alloc);
if (prev->s_rm) {
ic->i_rm = prev->s_rm;
prev->s_rm = NULL;
}
rds_ib_conn_error(ic->conn, "ib_post_send failed\n");
goto out;
}
ret = sent;
out:
BUG_ON(adv_credits);
return ret;
}
int rds_ib_xmit_rdma(struct rds_connection *conn, struct rds_rdma_op *op)
{
struct rds_ib_connection *ic = conn->c_transport_data;
struct rds_ib_send_work *send = NULL;
struct rds_ib_send_work *first;
struct rds_ib_send_work *prev;
struct ib_send_wr *failed_wr;
struct rds_ib_device *rds_ibdev;
struct scatterlist *scat;
unsigned long len;
u64 remote_addr = op->r_remote_addr;
u32 pos;
u32 work_alloc;
u32 i;
u32 j;
int sent;
int ret;
int num_sge;
rds_ibdev = ib_get_client_data(ic->i_cm_id->device, &rds_ib_client);
/* map the message the first time we see it */
if (!op->r_mapped) {
op->r_count = ib_dma_map_sg(ic->i_cm_id->device,
op->r_sg, op->r_nents, (op->r_write) ?
DMA_TO_DEVICE : DMA_FROM_DEVICE);
rdsdebug("ic %p mapping op %p: %d\n", ic, op, op->r_count);
if (op->r_count == 0) {
rds_ib_stats_inc(s_ib_tx_sg_mapping_failure);
ret = -ENOMEM; /* XXX ? */
goto out;
}
op->r_mapped = 1;
}
/*
* Instead of knowing how to return a partial rdma read/write we insist that there
* be enough work requests to send the entire message.
*/
i = ceil(op->r_count, rds_ibdev->max_sge);
work_alloc = rds_ib_ring_alloc(&ic->i_send_ring, i, &pos);
if (work_alloc != i) {
rds_ib_ring_unalloc(&ic->i_send_ring, work_alloc);
rds_ib_stats_inc(s_ib_tx_ring_full);
ret = -ENOMEM;
goto out;
}
send = &ic->i_sends[pos];
first = send;
prev = NULL;
scat = &op->r_sg[0];
sent = 0;
num_sge = op->r_count;
for (i = 0; i < work_alloc && scat != &op->r_sg[op->r_count]; i++) {
send->s_wr.send_flags = 0;
send->s_queued = jiffies;
/*
* We want to delay signaling completions just enough to get
* the batching benefits but not so much that we create dead time on the wire.
*/
if (ic->i_unsignaled_wrs-- == 0) {
ic->i_unsignaled_wrs = rds_ib_sysctl_max_unsig_wrs;
send->s_wr.send_flags = IB_SEND_SIGNALED;
}
send->s_wr.opcode = op->r_write ? IB_WR_RDMA_WRITE : IB_WR_RDMA_READ;
send->s_wr.wr.rdma.remote_addr = remote_addr;
send->s_wr.wr.rdma.rkey = op->r_key;
send->s_op = op;
if (num_sge > rds_ibdev->max_sge) {
send->s_wr.num_sge = rds_ibdev->max_sge;
num_sge -= rds_ibdev->max_sge;
} else {
send->s_wr.num_sge = num_sge;
}
send->s_wr.next = NULL;
if (prev)
prev->s_wr.next = &send->s_wr;
for (j = 0; j < send->s_wr.num_sge && scat != &op->r_sg[op->r_count]; j++) {
len = ib_sg_dma_len(ic->i_cm_id->device, scat);
send->s_sge[j].addr =
ib_sg_dma_address(ic->i_cm_id->device, scat);
send->s_sge[j].length = len;
send->s_sge[j].lkey = ic->i_mr->lkey;
sent += len;
rdsdebug("ic %p sent %d remote_addr %llu\n", ic, sent, remote_addr);
remote_addr += len;
scat++;
}
rdsdebug("send %p wr %p num_sge %u next %p\n", send,
&send->s_wr, send->s_wr.num_sge, send->s_wr.next);
prev = send;
if (++send == &ic->i_sends[ic->i_send_ring.w_nr])
send = ic->i_sends;
}
/* if we finished the message then send completion owns it */
if (scat == &op->r_sg[op->r_count])
prev->s_wr.send_flags = IB_SEND_SIGNALED;
if (i < work_alloc) {
rds_ib_ring_unalloc(&ic->i_send_ring, work_alloc - i);
work_alloc = i;
}
failed_wr = &first->s_wr;
ret = ib_post_send(ic->i_cm_id->qp, &first->s_wr, &failed_wr);
rdsdebug("ic %p first %p (wr %p) ret %d wr %p\n", ic,
first, &first->s_wr, ret, failed_wr);
BUG_ON(failed_wr != &first->s_wr);
if (ret) {
printk(KERN_WARNING "RDS/IB: rdma ib_post_send to %pI4 "
"returned %d\n", &conn->c_faddr, ret);
rds_ib_ring_unalloc(&ic->i_send_ring, work_alloc);
goto out;
}
if (unlikely(failed_wr != &first->s_wr)) {
printk(KERN_WARNING "RDS/IB: ib_post_send() rc=%d, but failed_wqe updated!\n", ret);
BUG_ON(failed_wr != &first->s_wr);
}
out:
return ret;
}
void rds_ib_xmit_complete(struct rds_connection *conn)
{
struct rds_ib_connection *ic = conn->c_transport_data;
/* We may have a pending ACK or window update we were unable
* to send previously (due to flow control). Try again. */
rds_ib_attempt_ack(ic);
}
|
sktjdgns1189/android_kernel_samsung_SHW-M290S
|
netasdf/rds/ib_send.c
|
C
|
gpl-2.0
| 26,757
|
/*
* linux/mm/page_io.c
*
* Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
*
* Swap reorganised 29.12.95,
* Asynchronous swapping added 30.12.95. Stephen Tweedie
* Removed race in async swapping. 14.4.1996. Bruno Haible
* Add swap of shared pages through the page cache. 20.2.1998. Stephen Tweedie
* Always use brw_page, life becomes simpler. 12 May 1998 Eric Biederman
*/
#include <linux/mm.h>
#include <linux/kernel_stat.h>
#include <linux/gfp.h>
#include <linux/pagemap.h>
#include <linux/swap.h>
#include <linux/bio.h>
#include <linux/swapops.h>
#include <linux/writeback.h>
#include <linux/ratelimit.h>
#include <asm/pgtable.h>
/*
* We don't need to see swap errors more than once every 1 second to know
* that a problem is occurring.
*/
#define SWAP_ERROR_LOG_RATE_MS 1000
static struct bio *get_swap_bio(gfp_t gfp_flags,
struct page *page, bio_end_io_t end_io)
{
struct bio *bio;
bio = bio_alloc(gfp_flags, 1);
if (bio) {
bio->bi_sector = map_swap_page(page, &bio->bi_bdev);
bio->bi_sector <<= PAGE_SHIFT - 9;
bio->bi_io_vec[0].bv_page = page;
bio->bi_io_vec[0].bv_len = PAGE_SIZE;
bio->bi_io_vec[0].bv_offset = 0;
bio->bi_vcnt = 1;
bio->bi_idx = 0;
bio->bi_size = PAGE_SIZE;
bio->bi_end_io = end_io;
}
return bio;
}
static void end_swap_bio_write(struct bio *bio, int err)
{
const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
struct page *page = bio->bi_io_vec[0].bv_page;
static unsigned long swap_error_rs_time;
if (!uptodate) {
SetPageError(page);
/*
* We failed to write the page out to swap-space.
* Re-dirty the page in order to avoid it being reclaimed.
* Also print a dire warning that things will go BAD (tm)
* very quickly.
*
* Also clear PG_reclaim to avoid rotate_reclaimable_page()
*/
set_page_dirty(page);
if (printk_timed_ratelimit(&swap_error_rs_time,
SWAP_ERROR_LOG_RATE_MS))
printk(KERN_ALERT "Write-error on swap-device (%u:%u:%Lu)\n",
imajor(bio->bi_bdev->bd_inode),
iminor(bio->bi_bdev->bd_inode),
(unsigned long long)bio->bi_sector);
ClearPageReclaim(page);
}
end_page_writeback(page);
bio_put(bio);
}
void end_swap_bio_read(struct bio *bio, int err)
{
const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
struct page *page = bio->bi_io_vec[0].bv_page;
if (!uptodate) {
SetPageError(page);
ClearPageUptodate(page);
printk(KERN_ALERT "Read-error on swap-device (%u:%u:%Lu)\n",
imajor(bio->bi_bdev->bd_inode),
iminor(bio->bi_bdev->bd_inode),
(unsigned long long)bio->bi_sector);
} else {
SetPageUptodate(page);
}
unlock_page(page);
bio_put(bio);
}
/*
* We may have stale swap cache pages in memory: notice
* them here and get rid of the unnecessary final write.
*/
int swap_writepage(struct page *page, struct writeback_control *wbc)
{
struct bio *bio;
int ret = 0, rw = WRITE;
if (try_to_free_swap(page)) {
unlock_page(page);
goto out;
}
bio = get_swap_bio(GFP_NOIO, page, end_swap_bio_write);
if (bio == NULL) {
set_page_dirty(page);
unlock_page(page);
ret = -ENOMEM;
goto out;
}
if (wbc->sync_mode == WB_SYNC_ALL)
rw |= REQ_SYNC;
count_vm_event(PSWPOUT);
set_page_writeback(page);
unlock_page(page);
submit_bio(rw, bio);
out:
return ret;
}
int swap_readpage(struct page *page)
{
struct bio *bio;
int ret = 0;
VM_BUG_ON(!PageLocked(page));
VM_BUG_ON(PageUptodate(page));
bio = get_swap_bio(GFP_KERNEL, page, end_swap_bio_read);
if (bio == NULL) {
unlock_page(page);
ret = -ENOMEM;
goto out;
}
count_vm_event(PSWPIN);
submit_bio(READ, bio);
out:
return ret;
}
|
DirtyUnicorns/android_kernel_htc_m4
|
mm/page_io.c
|
C
|
gpl-2.0
| 3,607
|
/*
* Copyright (C) 2007 Ben Skeggs.
* 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 (including the
* next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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.
*
*/
#include "drmP.h"
#include "drm.h"
#include "nouveau_drv.h"
#include "nouveau_ramht.h"
#include "nouveau_util.h"
#define NV04_RAMFC(c) (dev_priv->ramfc->pinst + ((c) * NV04_RAMFC__SIZE))
#define NV04_RAMFC__SIZE 32
#define NV04_RAMFC_DMA_PUT 0x00
#define NV04_RAMFC_DMA_GET 0x04
#define NV04_RAMFC_DMA_INSTANCE 0x08
#define NV04_RAMFC_DMA_STATE 0x0C
#define NV04_RAMFC_DMA_FETCH 0x10
#define NV04_RAMFC_ENGINE 0x14
#define NV04_RAMFC_PULL1_ENGINE 0x18
#define RAMFC_WR(offset, val) nv_wo32(chan->ramfc, NV04_RAMFC_##offset, (val))
#define RAMFC_RD(offset) nv_ro32(chan->ramfc, NV04_RAMFC_##offset)
void
nv04_fifo_disable(struct drm_device *dev)
{
uint32_t tmp;
tmp = nv_rd32(dev, NV04_PFIFO_CACHE1_DMA_PUSH);
nv_wr32(dev, NV04_PFIFO_CACHE1_DMA_PUSH, tmp & ~1);
nv_wr32(dev, NV03_PFIFO_CACHE1_PUSH0, 0);
tmp = nv_rd32(dev, NV03_PFIFO_CACHE1_PULL1);
nv_wr32(dev, NV04_PFIFO_CACHE1_PULL0, tmp & ~1);
}
void
nv04_fifo_enable(struct drm_device *dev)
{
nv_wr32(dev, NV03_PFIFO_CACHE1_PUSH0, 1);
nv_wr32(dev, NV04_PFIFO_CACHE1_PULL0, 1);
}
bool
nv04_fifo_reassign(struct drm_device *dev, bool enable)
{
uint32_t reassign = nv_rd32(dev, NV03_PFIFO_CACHES);
nv_wr32(dev, NV03_PFIFO_CACHES, enable ? 1 : 0);
return (reassign == 1);
}
bool
nv04_fifo_cache_pull(struct drm_device *dev, bool enable)
{
int pull = nv_mask(dev, NV04_PFIFO_CACHE1_PULL0, 1, enable);
if (!enable) {
/* In some cases the PFIFO puller may be left in an
* inconsistent state if you try to stop it when it's
* busy translating handles. Sometimes you get a
* PFIFO_CACHE_ERROR, sometimes it just fails silently
* sending incorrect instance offsets to PGRAPH after
* it's started up again. To avoid the latter we
* invalidate the most recently calculated instance.
*/
if (!nv_wait(dev, NV04_PFIFO_CACHE1_PULL0,
NV04_PFIFO_CACHE1_PULL0_HASH_BUSY, 0))
NV_ERROR(dev, "Timeout idling the PFIFO puller.\n");
if (nv_rd32(dev, NV04_PFIFO_CACHE1_PULL0) &
NV04_PFIFO_CACHE1_PULL0_HASH_FAILED)
nv_wr32(dev, NV03_PFIFO_INTR_0,
NV_PFIFO_INTR_CACHE_ERROR);
nv_wr32(dev, NV04_PFIFO_CACHE1_HASH, 0);
}
return pull & 1;
}
int
nv04_fifo_channel_id(struct drm_device *dev)
{
return nv_rd32(dev, NV03_PFIFO_CACHE1_PUSH1) &
NV03_PFIFO_CACHE1_PUSH1_CHID_MASK;
}
#ifdef __BIG_ENDIAN
#define DMA_FETCH_ENDIANNESS NV_PFIFO_CACHE1_BIG_ENDIAN
#else
#define DMA_FETCH_ENDIANNESS 0
#endif
int
nv04_fifo_create_context(struct nouveau_channel *chan)
{
struct drm_device *dev = chan->dev;
struct drm_nouveau_private *dev_priv = dev->dev_private;
unsigned long flags;
int ret;
ret = nouveau_gpuobj_new_fake(dev, NV04_RAMFC(chan->id), ~0,
NV04_RAMFC__SIZE,
NVOBJ_FLAG_ZERO_ALLOC |
NVOBJ_FLAG_ZERO_FREE,
&chan->ramfc);
if (ret)
return ret;
chan->user = ioremap(pci_resource_start(dev->pdev, 0) +
NV03_USER(chan->id), PAGE_SIZE);
if (!chan->user)
return -ENOMEM;
spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
/* Setup initial state */
RAMFC_WR(DMA_PUT, chan->pushbuf_base);
RAMFC_WR(DMA_GET, chan->pushbuf_base);
RAMFC_WR(DMA_INSTANCE, chan->pushbuf->pinst >> 4);
RAMFC_WR(DMA_FETCH, (NV_PFIFO_CACHE1_DMA_FETCH_TRIG_128_BYTES |
NV_PFIFO_CACHE1_DMA_FETCH_SIZE_128_BYTES |
NV_PFIFO_CACHE1_DMA_FETCH_MAX_REQS_8 |
DMA_FETCH_ENDIANNESS));
/* enable the fifo dma operation */
nv_wr32(dev, NV04_PFIFO_MODE,
nv_rd32(dev, NV04_PFIFO_MODE) | (1 << chan->id));
spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags);
return 0;
}
void
nv04_fifo_destroy_context(struct nouveau_channel *chan)
{
struct drm_device *dev = chan->dev;
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
unsigned long flags;
spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
pfifo->reassign(dev, false);
/* Unload the context if it's the currently active one */
if (pfifo->channel_id(dev) == chan->id) {
pfifo->disable(dev);
pfifo->unload_context(dev);
pfifo->enable(dev);
}
/* Keep it from being rescheduled */
nv_mask(dev, NV04_PFIFO_MODE, 1 << chan->id, 0);
pfifo->reassign(dev, true);
spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags);
/* Free the channel resources */
if (chan->user) {
iounmap(chan->user);
chan->user = NULL;
}
nouveau_gpuobj_ref(NULL, &chan->ramfc);
}
static void
nv04_fifo_do_load_context(struct drm_device *dev, int chid)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
uint32_t fc = NV04_RAMFC(chid), tmp;
nv_wr32(dev, NV04_PFIFO_CACHE1_DMA_PUT, nv_ri32(dev, fc + 0));
nv_wr32(dev, NV04_PFIFO_CACHE1_DMA_GET, nv_ri32(dev, fc + 4));
tmp = nv_ri32(dev, fc + 8);
nv_wr32(dev, NV04_PFIFO_CACHE1_DMA_INSTANCE, tmp & 0xFFFF);
nv_wr32(dev, NV04_PFIFO_CACHE1_DMA_DCOUNT, tmp >> 16);
nv_wr32(dev, NV04_PFIFO_CACHE1_DMA_STATE, nv_ri32(dev, fc + 12));
nv_wr32(dev, NV04_PFIFO_CACHE1_DMA_FETCH, nv_ri32(dev, fc + 16));
nv_wr32(dev, NV04_PFIFO_CACHE1_ENGINE, nv_ri32(dev, fc + 20));
nv_wr32(dev, NV04_PFIFO_CACHE1_PULL1, nv_ri32(dev, fc + 24));
nv_wr32(dev, NV03_PFIFO_CACHE1_GET, 0);
nv_wr32(dev, NV03_PFIFO_CACHE1_PUT, 0);
}
int
nv04_fifo_load_context(struct nouveau_channel *chan)
{
uint32_t tmp;
nv_wr32(chan->dev, NV03_PFIFO_CACHE1_PUSH1,
NV03_PFIFO_CACHE1_PUSH1_DMA | chan->id);
nv04_fifo_do_load_context(chan->dev, chan->id);
nv_wr32(chan->dev, NV04_PFIFO_CACHE1_DMA_PUSH, 1);
/* Reset NV04_PFIFO_CACHE1_DMA_CTL_AT_INFO to INVALID */
tmp = nv_rd32(chan->dev, NV04_PFIFO_CACHE1_DMA_CTL) & ~(1 << 31);
nv_wr32(chan->dev, NV04_PFIFO_CACHE1_DMA_CTL, tmp);
return 0;
}
int
nv04_fifo_unload_context(struct drm_device *dev)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
struct nouveau_channel *chan = NULL;
uint32_t tmp;
int chid;
chid = pfifo->channel_id(dev);
if (chid < 0 || chid >= dev_priv->engine.fifo.channels)
return 0;
chan = dev_priv->channels.ptr[chid];
if (!chan) {
NV_ERROR(dev, "Inactive channel on PFIFO: %d\n", chid);
return -EINVAL;
}
RAMFC_WR(DMA_PUT, nv_rd32(dev, NV04_PFIFO_CACHE1_DMA_PUT));
RAMFC_WR(DMA_GET, nv_rd32(dev, NV04_PFIFO_CACHE1_DMA_GET));
tmp = nv_rd32(dev, NV04_PFIFO_CACHE1_DMA_DCOUNT) << 16;
tmp |= nv_rd32(dev, NV04_PFIFO_CACHE1_DMA_INSTANCE);
RAMFC_WR(DMA_INSTANCE, tmp);
RAMFC_WR(DMA_STATE, nv_rd32(dev, NV04_PFIFO_CACHE1_DMA_STATE));
RAMFC_WR(DMA_FETCH, nv_rd32(dev, NV04_PFIFO_CACHE1_DMA_FETCH));
RAMFC_WR(ENGINE, nv_rd32(dev, NV04_PFIFO_CACHE1_ENGINE));
RAMFC_WR(PULL1_ENGINE, nv_rd32(dev, NV04_PFIFO_CACHE1_PULL1));
nv04_fifo_do_load_context(dev, pfifo->channels - 1);
nv_wr32(dev, NV03_PFIFO_CACHE1_PUSH1, pfifo->channels - 1);
return 0;
}
static void
nv04_fifo_init_reset(struct drm_device *dev)
{
nv_wr32(dev, NV03_PMC_ENABLE,
nv_rd32(dev, NV03_PMC_ENABLE) & ~NV_PMC_ENABLE_PFIFO);
nv_wr32(dev, NV03_PMC_ENABLE,
nv_rd32(dev, NV03_PMC_ENABLE) | NV_PMC_ENABLE_PFIFO);
nv_wr32(dev, 0x003224, 0x000f0078);
nv_wr32(dev, 0x002044, 0x0101ffff);
nv_wr32(dev, 0x002040, 0x000000ff);
nv_wr32(dev, 0x002500, 0x00000000);
nv_wr32(dev, 0x003000, 0x00000000);
nv_wr32(dev, 0x003050, 0x00000000);
nv_wr32(dev, 0x003200, 0x00000000);
nv_wr32(dev, 0x003250, 0x00000000);
nv_wr32(dev, 0x003220, 0x00000000);
nv_wr32(dev, 0x003250, 0x00000000);
nv_wr32(dev, 0x003270, 0x00000000);
nv_wr32(dev, 0x003210, 0x00000000);
}
static void
nv04_fifo_init_ramxx(struct drm_device *dev)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
nv_wr32(dev, NV03_PFIFO_RAMHT, (0x03 << 24) /* search 128 */ |
((dev_priv->ramht->bits - 9) << 16) |
(dev_priv->ramht->gpuobj->pinst >> 8));
nv_wr32(dev, NV03_PFIFO_RAMRO, dev_priv->ramro->pinst >> 8);
nv_wr32(dev, NV03_PFIFO_RAMFC, dev_priv->ramfc->pinst >> 8);
}
static void
nv04_fifo_init_intr(struct drm_device *dev)
{
nouveau_irq_register(dev, 8, nv04_fifo_isr);
nv_wr32(dev, 0x002100, 0xffffffff);
nv_wr32(dev, 0x002140, 0xffffffff);
}
int
nv04_fifo_init(struct drm_device *dev)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
int i;
nv04_fifo_init_reset(dev);
nv04_fifo_init_ramxx(dev);
nv04_fifo_do_load_context(dev, pfifo->channels - 1);
nv_wr32(dev, NV03_PFIFO_CACHE1_PUSH1, pfifo->channels - 1);
nv04_fifo_init_intr(dev);
pfifo->enable(dev);
pfifo->reassign(dev, true);
for (i = 0; i < dev_priv->engine.fifo.channels; i++) {
if (dev_priv->channels.ptr[i]) {
uint32_t mode = nv_rd32(dev, NV04_PFIFO_MODE);
nv_wr32(dev, NV04_PFIFO_MODE, mode | (1 << i));
}
}
return 0;
}
void
nv04_fifo_fini(struct drm_device *dev)
{
nv_wr32(dev, 0x2140, 0x00000000);
nouveau_irq_unregister(dev, 8);
}
static bool
nouveau_fifo_swmthd(struct drm_device *dev, u32 chid, u32 addr, u32 data)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_channel *chan = NULL;
struct nouveau_gpuobj *obj;
unsigned long flags;
const int subc = (addr >> 13) & 0x7;
const int mthd = addr & 0x1ffc;
bool handled = false;
u32 engine;
spin_lock_irqsave(&dev_priv->channels.lock, flags);
if (likely(chid >= 0 && chid < dev_priv->engine.fifo.channels))
chan = dev_priv->channels.ptr[chid];
if (unlikely(!chan))
goto out;
switch (mthd) {
case 0x0000: /* bind object to subchannel */
obj = nouveau_ramht_find(chan, data);
if (unlikely(!obj || obj->engine != NVOBJ_ENGINE_SW))
break;
chan->sw_subchannel[subc] = obj->class;
engine = 0x0000000f << (subc * 4);
nv_mask(dev, NV04_PFIFO_CACHE1_ENGINE, engine, 0x00000000);
handled = true;
break;
default:
engine = nv_rd32(dev, NV04_PFIFO_CACHE1_ENGINE);
if (unlikely(((engine >> (subc * 4)) & 0xf) != 0))
break;
if (!nouveau_gpuobj_mthd_call(chan, chan->sw_subchannel[subc],
mthd, data))
handled = true;
break;
}
out:
spin_unlock_irqrestore(&dev_priv->channels.lock, flags);
return handled;
}
static const char *nv_dma_state_err(u32 state)
{
static const char * const desc[] = {
"NONE", "CALL_SUBR_ACTIVE", "INVALID_MTHD", "RET_SUBR_INACTIVE",
"INVALID_CMD", "IB_EMPTY"/* NV50+ */, "MEM_FAULT", "UNK"
};
return desc[(state >> 29) & 0x7];
}
void
nv04_fifo_isr(struct drm_device *dev)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_engine *engine = &dev_priv->engine;
uint32_t status, reassign;
int cnt = 0;
reassign = nv_rd32(dev, NV03_PFIFO_CACHES) & 1;
while ((status = nv_rd32(dev, NV03_PFIFO_INTR_0)) && (cnt++ < 100)) {
uint32_t chid, get;
nv_wr32(dev, NV03_PFIFO_CACHES, 0);
chid = engine->fifo.channel_id(dev);
get = nv_rd32(dev, NV03_PFIFO_CACHE1_GET);
if (status & NV_PFIFO_INTR_CACHE_ERROR) {
uint32_t mthd, data;
int ptr;
/* NV_PFIFO_CACHE1_GET actually goes to 0xffc before
* wrapping on my G80 chips, but CACHE1 isn't big
* enough for this much data.. Tests show that it
* wraps around to the start at GET=0x800.. No clue
* as to why..
*/
ptr = (get & 0x7ff) >> 2;
if (dev_priv->card_type < NV_40) {
mthd = nv_rd32(dev,
NV04_PFIFO_CACHE1_METHOD(ptr));
data = nv_rd32(dev,
NV04_PFIFO_CACHE1_DATA(ptr));
} else {
mthd = nv_rd32(dev,
NV40_PFIFO_CACHE1_METHOD(ptr));
data = nv_rd32(dev,
NV40_PFIFO_CACHE1_DATA(ptr));
}
if (!nouveau_fifo_swmthd(dev, chid, mthd, data)) {
NV_INFO(dev, "PFIFO_CACHE_ERROR - Ch %d/%d "
"Mthd 0x%04x Data 0x%08x\n",
chid, (mthd >> 13) & 7, mthd & 0x1ffc,
data);
}
nv_wr32(dev, NV04_PFIFO_CACHE1_DMA_PUSH, 0);
nv_wr32(dev, NV03_PFIFO_INTR_0,
NV_PFIFO_INTR_CACHE_ERROR);
nv_wr32(dev, NV03_PFIFO_CACHE1_PUSH0,
nv_rd32(dev, NV03_PFIFO_CACHE1_PUSH0) & ~1);
nv_wr32(dev, NV03_PFIFO_CACHE1_GET, get + 4);
nv_wr32(dev, NV03_PFIFO_CACHE1_PUSH0,
nv_rd32(dev, NV03_PFIFO_CACHE1_PUSH0) | 1);
nv_wr32(dev, NV04_PFIFO_CACHE1_HASH, 0);
nv_wr32(dev, NV04_PFIFO_CACHE1_DMA_PUSH,
nv_rd32(dev, NV04_PFIFO_CACHE1_DMA_PUSH) | 1);
nv_wr32(dev, NV04_PFIFO_CACHE1_PULL0, 1);
status &= ~NV_PFIFO_INTR_CACHE_ERROR;
}
if (status & NV_PFIFO_INTR_DMA_PUSHER) {
u32 dma_get = nv_rd32(dev, 0x003244);
u32 dma_put = nv_rd32(dev, 0x003240);
u32 push = nv_rd32(dev, 0x003220);
u32 state = nv_rd32(dev, 0x003228);
if (dev_priv->card_type == NV_50) {
u32 ho_get = nv_rd32(dev, 0x003328);
u32 ho_put = nv_rd32(dev, 0x003320);
u32 ib_get = nv_rd32(dev, 0x003334);
u32 ib_put = nv_rd32(dev, 0x003330);
if (nouveau_ratelimit())
NV_INFO(dev, "PFIFO_DMA_PUSHER - Ch %d Get 0x%02x%08x "
"Put 0x%02x%08x IbGet 0x%08x IbPut 0x%08x "
"State 0x%08x (err: %s) Push 0x%08x\n",
chid, ho_get, dma_get, ho_put,
dma_put, ib_get, ib_put, state,
nv_dma_state_err(state),
push);
/* METHOD_COUNT, in DMA_STATE on earlier chipsets */
nv_wr32(dev, 0x003364, 0x00000000);
if (dma_get != dma_put || ho_get != ho_put) {
nv_wr32(dev, 0x003244, dma_put);
nv_wr32(dev, 0x003328, ho_put);
} else
if (ib_get != ib_put) {
nv_wr32(dev, 0x003334, ib_put);
}
} else {
NV_INFO(dev, "PFIFO_DMA_PUSHER - Ch %d Get 0x%08x "
"Put 0x%08x State 0x%08x (err: %s) Push 0x%08x\n",
chid, dma_get, dma_put, state,
nv_dma_state_err(state), push);
if (dma_get != dma_put)
nv_wr32(dev, 0x003244, dma_put);
}
nv_wr32(dev, 0x003228, 0x00000000);
nv_wr32(dev, 0x003220, 0x00000001);
nv_wr32(dev, 0x002100, NV_PFIFO_INTR_DMA_PUSHER);
status &= ~NV_PFIFO_INTR_DMA_PUSHER;
}
if (status & NV_PFIFO_INTR_SEMAPHORE) {
uint32_t sem;
status &= ~NV_PFIFO_INTR_SEMAPHORE;
nv_wr32(dev, NV03_PFIFO_INTR_0,
NV_PFIFO_INTR_SEMAPHORE);
sem = nv_rd32(dev, NV10_PFIFO_CACHE1_SEMAPHORE);
nv_wr32(dev, NV10_PFIFO_CACHE1_SEMAPHORE, sem | 0x1);
nv_wr32(dev, NV03_PFIFO_CACHE1_GET, get + 4);
nv_wr32(dev, NV04_PFIFO_CACHE1_PULL0, 1);
}
if (dev_priv->card_type == NV_50) {
if (status & 0x00000010) {
nv50_fb_vm_trap(dev, nouveau_ratelimit());
status &= ~0x00000010;
nv_wr32(dev, 0x002100, 0x00000010);
}
}
if (status) {
if (nouveau_ratelimit())
NV_INFO(dev, "PFIFO_INTR 0x%08x - Ch %d\n",
status, chid);
nv_wr32(dev, NV03_PFIFO_INTR_0, status);
status = 0;
}
nv_wr32(dev, NV03_PFIFO_CACHES, reassign);
}
if (status) {
NV_INFO(dev, "PFIFO still angry after %d spins, halt\n", cnt);
nv_wr32(dev, 0x2140, 0);
nv_wr32(dev, 0x140, 0);
}
nv_wr32(dev, NV03_PMC_INTR_0, NV_PMC_INTR_0_PFIFO_PENDING);
}
|
talnoah/android_kernel_htc_dlx
|
virt/drivers/gpu/drm/nouveau/nv04_fifo.c
|
C
|
gpl-2.0
| 16,051
|
#ifndef SPI_ADIS16240_H_
#define SPI_ADIS16240_H_
#define ADIS16240_STARTUP_DELAY 220 /* ms */
/* Flash memory write count */
#define ADIS16240_FLASH_CNT 0x00
/* Output, power supply */
#define ADIS16240_SUPPLY_OUT 0x02
/* Output, x-axis accelerometer */
#define ADIS16240_XACCL_OUT 0x04
/* Output, y-axis accelerometer */
#define ADIS16240_YACCL_OUT 0x06
/* Output, z-axis accelerometer */
#define ADIS16240_ZACCL_OUT 0x08
/* Output, auxiliary ADC input */
#define ADIS16240_AUX_ADC 0x0A
/* Output, temperature */
#define ADIS16240_TEMP_OUT 0x0C
/* Output, x-axis acceleration peak */
#define ADIS16240_XPEAK_OUT 0x0E
/* Output, y-axis acceleration peak */
#define ADIS16240_YPEAK_OUT 0x10
/* Output, z-axis acceleration peak */
#define ADIS16240_ZPEAK_OUT 0x12
/* Output, sum-of-squares acceleration peak */
#define ADIS16240_XYZPEAK_OUT 0x14
/* Output, Capture Buffer 1, X and Y acceleration */
#define ADIS16240_CAPT_BUF1 0x16
/* Output, Capture Buffer 2, Z acceleration */
#define ADIS16240_CAPT_BUF2 0x18
/* Diagnostic, error flags */
#define ADIS16240_DIAG_STAT 0x1A
/* Diagnostic, event counter */
#define ADIS16240_EVNT_CNTR 0x1C
/* Diagnostic, check sum value from firmware test */
#define ADIS16240_CHK_SUM 0x1E
/* Calibration, x-axis acceleration offset adjustment */
#define ADIS16240_XACCL_OFF 0x20
/* Calibration, y-axis acceleration offset adjustment */
#define ADIS16240_YACCL_OFF 0x22
/* Calibration, z-axis acceleration offset adjustment */
#define ADIS16240_ZACCL_OFF 0x24
/* Clock, hour and minute */
#define ADIS16240_CLK_TIME 0x2E
/* Clock, month and day */
#define ADIS16240_CLK_DATE 0x30
/* Clock, year */
#define ADIS16240_CLK_YEAR 0x32
/* Wake-up setting, hour and minute */
#define ADIS16240_WAKE_TIME 0x34
/* Wake-up setting, month and day */
#define ADIS16240_WAKE_DATE 0x36
/* Alarm 1 amplitude threshold */
#define ADIS16240_ALM_MAG1 0x38
/* Alarm 2 amplitude threshold */
#define ADIS16240_ALM_MAG2 0x3A
/* Alarm control */
#define ADIS16240_ALM_CTRL 0x3C
/* Capture, external trigger control */
#define ADIS16240_XTRIG_CTRL 0x3E
/* Capture, address pointer */
#define ADIS16240_CAPT_PNTR 0x40
/* Capture, configuration and control */
#define ADIS16240_CAPT_CTRL 0x42
/* General-purpose digital input/output control */
#define ADIS16240_GPIO_CTRL 0x44
/* Miscellaneous control */
#define ADIS16240_MSC_CTRL 0x46
/* Internal sample period (rate) control */
#define ADIS16240_SMPL_PRD 0x48
/* System command */
#define ADIS16240_GLOB_CMD 0x4A
/* MSC_CTRL */
/* Enables sum-of-squares output (XYZPEAK_OUT) */
#define ADIS16240_MSC_CTRL_XYZPEAK_OUT_EN BIT(15)
/* Enables peak tracking output (XPEAK_OUT, YPEAK_OUT, and ZPEAK_OUT) */
#define ADIS16240_MSC_CTRL_X_Y_ZPEAK_OUT_EN BIT(14)
/* Self-test enable: 1 = apply electrostatic force, 0 = disabled */
#define ADIS16240_MSC_CTRL_SELF_TEST_EN BIT(8)
/* Data-ready enable: 1 = enabled, 0 = disabled */
#define ADIS16240_MSC_CTRL_DATA_RDY_EN BIT(2)
/* Data-ready polarity: 1 = active high, 0 = active low */
#define ADIS16240_MSC_CTRL_ACTIVE_HIGH BIT(1)
/* Data-ready line selection: 1 = DIO2, 0 = DIO1 */
#define ADIS16240_MSC_CTRL_DATA_RDY_DIO2 BIT(0)
/* DIAG_STAT */
/* Alarm 2 status: 1 = alarm active, 0 = alarm inactive */
#define ADIS16240_DIAG_STAT_ALARM2 BIT(9)
/* Alarm 1 status: 1 = alarm active, 0 = alarm inactive */
#define ADIS16240_DIAG_STAT_ALARM1 BIT(8)
/* Capture buffer full: 1 = capture buffer is full */
#define ADIS16240_DIAG_STAT_CPT_BUF_FUL BIT(7)
/* Flash test, checksum flag: 1 = mismatch, 0 = match */
#define ADIS16240_DIAG_STAT_CHKSUM BIT(6)
/* Power-on, self-test flag: 1 = failure, 0 = pass */
#define ADIS16240_DIAG_STAT_PWRON_FAIL_BIT 5
/* Power-on self-test: 1 = in-progress, 0 = complete */
#define ADIS16240_DIAG_STAT_PWRON_BUSY BIT(4)
/* SPI communications failure */
#define ADIS16240_DIAG_STAT_SPI_FAIL_BIT 3
/* Flash update failure */
#define ADIS16240_DIAG_STAT_FLASH_UPT_BIT 2
/* Power supply above 3.625 V */
#define ADIS16240_DIAG_STAT_POWER_HIGH_BIT 1
/* Power supply below 3.15 V */
#define ADIS16240_DIAG_STAT_POWER_LOW_BIT 0
/* GLOB_CMD */
#define ADIS16240_GLOB_CMD_RESUME BIT(8)
#define ADIS16240_GLOB_CMD_SW_RESET BIT(7)
#define ADIS16240_GLOB_CMD_STANDBY BIT(2)
#define ADIS16240_ERROR_ACTIVE BIT(14)
/* At the moment triggers are only used for ring buffer
* filling. This may change!
*/
#define ADIS16240_SCAN_ACC_X 0
#define ADIS16240_SCAN_ACC_Y 1
#define ADIS16240_SCAN_ACC_Z 2
#define ADIS16240_SCAN_SUPPLY 3
#define ADIS16240_SCAN_AUX_ADC 4
#define ADIS16240_SCAN_TEMP 5
#endif /* SPI_ADIS16240_H_ */
|
AiJiaZone/linux-4.0
|
virt/drivers/staging/iio/accel/adis16240.h
|
C
|
gpl-2.0
| 4,778
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
/*=====================================================================
**
** Source: test3.c
**
** Purpose: Tests the PAL implementation of the GetFullPathNameW API.
** GetFullPathW will be passed a directory that contains '..'.
** Example: test_directory\level1\..\testing.tmp.
** To add to this test, we will also call SetCurrentDirectory to
** ensure this is handled properly.
** The test will create a file with in the parent directory
** to verify that the returned directory is valid.
**
** Depends: SetCurrentDirectory,
** CreateDirectory,
** strcat,
** memset,
** CreateFile,
** CloseHandle,
** strcmp,
** DeleteFileW,
** RemoveDirectory.
**
**
**===================================================================*/
#define UNICODE
#include <palsuite.h>
#ifdef WIN32
const WCHAR szSeperator[] = {'\\','\\','\0'};
#else
const WCHAR szSeperator[] = {'/','/','\0'};
#endif
const WCHAR szDotDot[] = {'.','.','\0'};
const WCHAR szFileName[] = {'t','e','s','t','i','n','g','.','t','m','p','\0'};
int __cdecl main(int argc, char *argv[])
{
DWORD dwRc = 0;
WCHAR szReturnedPath[_MAX_DIR+1];
WCHAR szFullFileName[_MAX_DIR+1];
WCHAR szDirectory[256];
WCHAR szCreatedDir[] = {'t','e','s','t','_','d','i','r','\0'};
WCHAR szCreatedNextDir[] = {'l','e','v','e','l','1','\0'};
LPWSTR pPathPtr;
HANDLE hFile = NULL;
BOOL bRetVal = FAIL;
/* Initialize the PAL.
*/
if ( 0 != PAL_Initialize(argc,argv) )
{
return (FAIL);
}
/* Initialize the buffer.
*/
memset( szDirectory, '\0', 256 );
/* Change the current working directory.
*/
if ( !SetCurrentDirectoryW(szDotDot) )
{
Fail("ERROR: SetCurrentDirectoryA failed with error code %u "
"when passed \"%S\".\n",
GetLastError(),
szDotDot);
}
/* Create the path to the next level of directory to create.
*/
wcscat(szDirectory, szCreatedDir); /* test_dir */
/* Create a test directory.
*/
if (!CreateDirectoryW(szDirectory, NULL))
{
Fail("ERROR:%u: Unable to create directories \"%S\".\n",
GetLastError(),
szDirectory);
}
/* Create the path to the next level of directory to create.
*/
wcscat(szDirectory, szSeperator); /* / */
wcscat(szDirectory, szCreatedNextDir); /* /level1 */
/* Create a test directory.
*/
if (!CreateDirectoryW(szDirectory, NULL))
{
Trace("ERROR:%u: Unable to create directories \"%S\".\n",
GetLastError(),
szDirectory);
bRetVal = FAIL;
goto cleanUpOne;
}
/* Initialize the receiving char buffers.
*/
memset(szReturnedPath, 0, _MAX_DIR+1);
memset(szFullFileName, 0, _MAX_DIR+1);
/* Create Full filename to pass, will include '..\'
* in the middle of the path.
*/
wcscat(szFullFileName, szCreatedDir); /*test_dir */
wcscat(szFullFileName, szSeperator); /*test_dir/ */
wcscat(szFullFileName, szCreatedNextDir);/*test_dir/level1 */
wcscat(szFullFileName, szSeperator); /*test_dir/level1/ */
wcscat(szFullFileName, szDotDot); /*test_dir/level1/.. */
wcscat(szFullFileName, szSeperator); /*test_dir/level1/../ */
wcscat(szFullFileName, szFileName); /*test_dir/level1/../testing.tmp */
/* Get the full path to the filename.
*/
dwRc = GetFullPathNameW(szFullFileName,
_MAX_DIR,
szReturnedPath,
&pPathPtr);
if (dwRc == 0)
{
Trace("ERROR :%ld: GetFullPathNameW failed to "
"retrieve the path of \"%S\".\n",
GetLastError(),
szFileName);
bRetVal = FAIL;
goto cleanUpTwo;
}
/* The returned value should be the parent directory with the
* file name appended. */
hFile = CreateFileW(szReturnedPath,
GENERIC_READ,
FILE_SHARE_READ,
NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
Trace("ERROR :%ld: CreateFileA failed to create \"%S\".\n",
GetLastError(),
szReturnedPath);
bRetVal = FAIL;
goto cleanUpTwo;
}
/* Close the handle to the created file.
*/
if (CloseHandle(hFile) != TRUE)
{
Trace("ERROR :%ld: CloseHandle failed close hFile=0x%lx.\n",
GetLastError());
bRetVal = FAIL;
goto cleanUpThree;
}
/* Verify that the file was created, attempt to create
* the file again. */
hFile = CreateFileW(szReturnedPath,
GENERIC_READ,
FILE_SHARE_READ,
NULL,
CREATE_NEW,
FILE_ATTRIBUTE_NORMAL,
NULL);
if ((hFile != INVALID_HANDLE_VALUE) &&
(GetLastError() != ERROR_ALREADY_EXISTS))
{
Trace("ERROR :%ld: CreateFileA succeeded to create file "
"\"%S\", that already existed.\n",
GetLastError(),
szFullFileName);
bRetVal = FAIL;
goto cleanUpThree;
}
/* Verify that the returned filename is the same as the supplied.
*/
if (wcscmp(pPathPtr, szFileName) != 0)
{
Trace("ERROR : Returned filename \"%s\" is not equal to "
"supplied filename \"%s\".\n",
pPathPtr,
szFileName);
bRetVal = FAIL;
goto cleanUpThree;
}
/* Successful test.
*/
bRetVal = PASS;
cleanUpThree:
/* Delete the create file.
*/
if (DeleteFileW(szReturnedPath) != TRUE)
{
Fail("ERROR :%ld: DeleteFileA failed to delete \"%S\".\n",
GetLastError(),
szFileName);
}
cleanUpTwo:
/* Remove the empty directory.
*/
if (!RemoveDirectoryW(szDirectory))
{
Fail("ERROR:%u: Unable to remove directory \"%S\".\n",
GetLastError(),
szCreatedDir);
}
cleanUpOne:
/* Remove the empty directory.
*/
if (!RemoveDirectoryW(szCreatedDir))
{
Fail("ERROR:%u: Unable to remove directory \"%s\".\n",
GetLastError(),
szCreatedDir);
}
/* Terminate the PAL.*/
PAL_TerminateEx(bRetVal);
return bRetVal;
}
|
cmckinsey/coreclr
|
src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/test3.cpp
|
C++
|
mit
| 6,894
|
--
UPDATE `creature_loot_template` SET `Chance`=100 WHERE `Item` IN (6250, 6251, 6252);
|
sidneeginger/TrinityCore
|
sql/updates/world/master/2017_02_28_02_world_2016_09_15_07_world.sql
|
SQL
|
gpl-2.0
| 88
|
package cascadia
import (
"bytes"
"fmt"
"regexp"
"strings"
"golang.org/x/net/html"
)
// the Selector type, and functions for creating them
// A Selector is a function which tells whether a node matches or not.
type Selector func(*html.Node) bool
// hasChildMatch returns whether n has any child that matches a.
func hasChildMatch(n *html.Node, a Selector) bool {
for c := n.FirstChild; c != nil; c = c.NextSibling {
if a(c) {
return true
}
}
return false
}
// hasDescendantMatch performs a depth-first search of n's descendants,
// testing whether any of them match a. It returns true as soon as a match is
// found, or false if no match is found.
func hasDescendantMatch(n *html.Node, a Selector) bool {
for c := n.FirstChild; c != nil; c = c.NextSibling {
if a(c) || (c.Type == html.ElementNode && hasDescendantMatch(c, a)) {
return true
}
}
return false
}
// Compile parses a selector and returns, if successful, a Selector object
// that can be used to match against html.Node objects.
func Compile(sel string) (Selector, error) {
p := &parser{s: sel}
compiled, err := p.parseSelectorGroup()
if err != nil {
return nil, err
}
if p.i < len(sel) {
return nil, fmt.Errorf("parsing %q: %d bytes left over", sel, len(sel)-p.i)
}
return compiled, nil
}
// MustCompile is like Compile, but panics instead of returning an error.
func MustCompile(sel string) Selector {
compiled, err := Compile(sel)
if err != nil {
panic(err)
}
return compiled
}
// MatchAll returns a slice of the nodes that match the selector,
// from n and its children.
func (s Selector) MatchAll(n *html.Node) []*html.Node {
return s.matchAllInto(n, nil)
}
func (s Selector) matchAllInto(n *html.Node, storage []*html.Node) []*html.Node {
if s(n) {
storage = append(storage, n)
}
for child := n.FirstChild; child != nil; child = child.NextSibling {
storage = s.matchAllInto(child, storage)
}
return storage
}
// Match returns true if the node matches the selector.
func (s Selector) Match(n *html.Node) bool {
return s(n)
}
// MatchFirst returns the first node that matches s, from n and its children.
func (s Selector) MatchFirst(n *html.Node) *html.Node {
if s.Match(n) {
return n
}
for c := n.FirstChild; c != nil; c = c.NextSibling {
m := s.MatchFirst(c)
if m != nil {
return m
}
}
return nil
}
// Filter returns the nodes in nodes that match the selector.
func (s Selector) Filter(nodes []*html.Node) (result []*html.Node) {
for _, n := range nodes {
if s(n) {
result = append(result, n)
}
}
return result
}
// typeSelector returns a Selector that matches elements with a given tag name.
func typeSelector(tag string) Selector {
tag = toLowerASCII(tag)
return func(n *html.Node) bool {
return n.Type == html.ElementNode && n.Data == tag
}
}
// toLowerASCII returns s with all ASCII capital letters lowercased.
func toLowerASCII(s string) string {
var b []byte
for i := 0; i < len(s); i++ {
if c := s[i]; 'A' <= c && c <= 'Z' {
if b == nil {
b = make([]byte, len(s))
copy(b, s)
}
b[i] = s[i] + ('a' - 'A')
}
}
if b == nil {
return s
}
return string(b)
}
// attributeSelector returns a Selector that matches elements
// where the attribute named key satisifes the function f.
func attributeSelector(key string, f func(string) bool) Selector {
key = toLowerASCII(key)
return func(n *html.Node) bool {
if n.Type != html.ElementNode {
return false
}
for _, a := range n.Attr {
if a.Key == key && f(a.Val) {
return true
}
}
return false
}
}
// attributeExistsSelector returns a Selector that matches elements that have
// an attribute named key.
func attributeExistsSelector(key string) Selector {
return attributeSelector(key, func(string) bool { return true })
}
// attributeEqualsSelector returns a Selector that matches elements where
// the attribute named key has the value val.
func attributeEqualsSelector(key, val string) Selector {
return attributeSelector(key,
func(s string) bool {
return s == val
})
}
// attributeNotEqualSelector returns a Selector that matches elements where
// the attribute named key does not have the value val.
func attributeNotEqualSelector(key, val string) Selector {
key = toLowerASCII(key)
return func(n *html.Node) bool {
if n.Type != html.ElementNode {
return false
}
for _, a := range n.Attr {
if a.Key == key && a.Val == val {
return false
}
}
return true
}
}
// attributeIncludesSelector returns a Selector that matches elements where
// the attribute named key is a whitespace-separated list that includes val.
func attributeIncludesSelector(key, val string) Selector {
return attributeSelector(key,
func(s string) bool {
for s != "" {
i := strings.IndexAny(s, " \t\r\n\f")
if i == -1 {
return s == val
}
if s[:i] == val {
return true
}
s = s[i+1:]
}
return false
})
}
// attributeDashmatchSelector returns a Selector that matches elements where
// the attribute named key equals val or starts with val plus a hyphen.
func attributeDashmatchSelector(key, val string) Selector {
return attributeSelector(key,
func(s string) bool {
if s == val {
return true
}
if len(s) <= len(val) {
return false
}
if s[:len(val)] == val && s[len(val)] == '-' {
return true
}
return false
})
}
// attributePrefixSelector returns a Selector that matches elements where
// the attribute named key starts with val.
func attributePrefixSelector(key, val string) Selector {
return attributeSelector(key,
func(s string) bool {
if strings.TrimSpace(s) == "" {
return false
}
return strings.HasPrefix(s, val)
})
}
// attributeSuffixSelector returns a Selector that matches elements where
// the attribute named key ends with val.
func attributeSuffixSelector(key, val string) Selector {
return attributeSelector(key,
func(s string) bool {
if strings.TrimSpace(s) == "" {
return false
}
return strings.HasSuffix(s, val)
})
}
// attributeSubstringSelector returns a Selector that matches nodes where
// the attribute named key contains val.
func attributeSubstringSelector(key, val string) Selector {
return attributeSelector(key,
func(s string) bool {
if strings.TrimSpace(s) == "" {
return false
}
return strings.Contains(s, val)
})
}
// attributeRegexSelector returns a Selector that matches nodes where
// the attribute named key matches the regular expression rx
func attributeRegexSelector(key string, rx *regexp.Regexp) Selector {
return attributeSelector(key,
func(s string) bool {
return rx.MatchString(s)
})
}
// intersectionSelector returns a selector that matches nodes that match
// both a and b.
func intersectionSelector(a, b Selector) Selector {
return func(n *html.Node) bool {
return a(n) && b(n)
}
}
// unionSelector returns a selector that matches elements that match
// either a or b.
func unionSelector(a, b Selector) Selector {
return func(n *html.Node) bool {
return a(n) || b(n)
}
}
// negatedSelector returns a selector that matches elements that do not match a.
func negatedSelector(a Selector) Selector {
return func(n *html.Node) bool {
if n.Type != html.ElementNode {
return false
}
return !a(n)
}
}
// writeNodeText writes the text contained in n and its descendants to b.
func writeNodeText(n *html.Node, b *bytes.Buffer) {
switch n.Type {
case html.TextNode:
b.WriteString(n.Data)
case html.ElementNode:
for c := n.FirstChild; c != nil; c = c.NextSibling {
writeNodeText(c, b)
}
}
}
// nodeText returns the text contained in n and its descendants.
func nodeText(n *html.Node) string {
var b bytes.Buffer
writeNodeText(n, &b)
return b.String()
}
// nodeOwnText returns the contents of the text nodes that are direct
// children of n.
func nodeOwnText(n *html.Node) string {
var b bytes.Buffer
for c := n.FirstChild; c != nil; c = c.NextSibling {
if c.Type == html.TextNode {
b.WriteString(c.Data)
}
}
return b.String()
}
// textSubstrSelector returns a selector that matches nodes that
// contain the given text.
func textSubstrSelector(val string) Selector {
return func(n *html.Node) bool {
text := strings.ToLower(nodeText(n))
return strings.Contains(text, val)
}
}
// ownTextSubstrSelector returns a selector that matches nodes that
// directly contain the given text
func ownTextSubstrSelector(val string) Selector {
return func(n *html.Node) bool {
text := strings.ToLower(nodeOwnText(n))
return strings.Contains(text, val)
}
}
// textRegexSelector returns a selector that matches nodes whose text matches
// the specified regular expression
func textRegexSelector(rx *regexp.Regexp) Selector {
return func(n *html.Node) bool {
return rx.MatchString(nodeText(n))
}
}
// ownTextRegexSelector returns a selector that matches nodes whose text
// directly matches the specified regular expression
func ownTextRegexSelector(rx *regexp.Regexp) Selector {
return func(n *html.Node) bool {
return rx.MatchString(nodeOwnText(n))
}
}
// hasChildSelector returns a selector that matches elements
// with a child that matches a.
func hasChildSelector(a Selector) Selector {
return func(n *html.Node) bool {
if n.Type != html.ElementNode {
return false
}
return hasChildMatch(n, a)
}
}
// hasDescendantSelector returns a selector that matches elements
// with any descendant that matches a.
func hasDescendantSelector(a Selector) Selector {
return func(n *html.Node) bool {
if n.Type != html.ElementNode {
return false
}
return hasDescendantMatch(n, a)
}
}
// nthChildSelector returns a selector that implements :nth-child(an+b).
// If last is true, implements :nth-last-child instead.
// If ofType is true, implements :nth-of-type instead.
func nthChildSelector(a, b int, last, ofType bool) Selector {
return func(n *html.Node) bool {
if n.Type != html.ElementNode {
return false
}
parent := n.Parent
if parent == nil {
return false
}
if parent.Type == html.DocumentNode {
return false
}
i := -1
count := 0
for c := parent.FirstChild; c != nil; c = c.NextSibling {
if (c.Type != html.ElementNode) || (ofType && c.Data != n.Data) {
continue
}
count++
if c == n {
i = count
if !last {
break
}
}
}
if i == -1 {
// This shouldn't happen, since n should always be one of its parent's children.
return false
}
if last {
i = count - i + 1
}
i -= b
if a == 0 {
return i == 0
}
return i%a == 0 && i/a >= 0
}
}
// simpleNthChildSelector returns a selector that implements :nth-child(b).
// If ofType is true, implements :nth-of-type instead.
func simpleNthChildSelector(b int, ofType bool) Selector {
return func(n *html.Node) bool {
if n.Type != html.ElementNode {
return false
}
parent := n.Parent
if parent == nil {
return false
}
if parent.Type == html.DocumentNode {
return false
}
count := 0
for c := parent.FirstChild; c != nil; c = c.NextSibling {
if c.Type != html.ElementNode || (ofType && c.Data != n.Data) {
continue
}
count++
if c == n {
return count == b
}
if count >= b {
return false
}
}
return false
}
}
// simpleNthLastChildSelector returns a selector that implements
// :nth-last-child(b). If ofType is true, implements :nth-last-of-type
// instead.
func simpleNthLastChildSelector(b int, ofType bool) Selector {
return func(n *html.Node) bool {
if n.Type != html.ElementNode {
return false
}
parent := n.Parent
if parent == nil {
return false
}
if parent.Type == html.DocumentNode {
return false
}
count := 0
for c := parent.LastChild; c != nil; c = c.PrevSibling {
if c.Type != html.ElementNode || (ofType && c.Data != n.Data) {
continue
}
count++
if c == n {
return count == b
}
if count >= b {
return false
}
}
return false
}
}
// onlyChildSelector returns a selector that implements :only-child.
// If ofType is true, it implements :only-of-type instead.
func onlyChildSelector(ofType bool) Selector {
return func(n *html.Node) bool {
if n.Type != html.ElementNode {
return false
}
parent := n.Parent
if parent == nil {
return false
}
if parent.Type == html.DocumentNode {
return false
}
count := 0
for c := parent.FirstChild; c != nil; c = c.NextSibling {
if (c.Type != html.ElementNode) || (ofType && c.Data != n.Data) {
continue
}
count++
if count > 1 {
return false
}
}
return count == 1
}
}
// inputSelector is a Selector that matches input, select, textarea and button elements.
func inputSelector(n *html.Node) bool {
return n.Type == html.ElementNode && (n.Data == "input" || n.Data == "select" || n.Data == "textarea" || n.Data == "button")
}
// emptyElementSelector is a Selector that matches empty elements.
func emptyElementSelector(n *html.Node) bool {
if n.Type != html.ElementNode {
return false
}
for c := n.FirstChild; c != nil; c = c.NextSibling {
switch c.Type {
case html.ElementNode, html.TextNode:
return false
}
}
return true
}
// descendantSelector returns a Selector that matches an element if
// it matches d and has an ancestor that matches a.
func descendantSelector(a, d Selector) Selector {
return func(n *html.Node) bool {
if !d(n) {
return false
}
for p := n.Parent; p != nil; p = p.Parent {
if a(p) {
return true
}
}
return false
}
}
// childSelector returns a Selector that matches an element if
// it matches d and its parent matches a.
func childSelector(a, d Selector) Selector {
return func(n *html.Node) bool {
return d(n) && n.Parent != nil && a(n.Parent)
}
}
// siblingSelector returns a Selector that matches an element
// if it matches s2 and in is preceded by an element that matches s1.
// If adjacent is true, the sibling must be immediately before the element.
func siblingSelector(s1, s2 Selector, adjacent bool) Selector {
return func(n *html.Node) bool {
if !s2(n) {
return false
}
if adjacent {
for n = n.PrevSibling; n != nil; n = n.PrevSibling {
if n.Type == html.TextNode || n.Type == html.CommentNode {
continue
}
return s1(n)
}
return false
}
// Walk backwards looking for element that matches s1
for c := n.PrevSibling; c != nil; c = c.PrevSibling {
if s1(c) {
return true
}
}
return false
}
}
// rootSelector implements :root
func rootSelector(n *html.Node) bool {
if n.Type != html.ElementNode {
return false
}
if n.Parent == nil {
return false
}
return n.Parent.Type == html.DocumentNode
}
|
henrylee2cn/pholcus
|
vendor/github.com/andybalholm/cascadia/selector.go
|
GO
|
apache-2.0
| 14,659
|
require 'test_helper'
class ExpiryDateTest < Test::Unit::TestCase
def test_should_be_expired
last_month = 2.months.ago
date = CreditCard::ExpiryDate.new(last_month.month, last_month.year)
assert date.expired?
end
def test_today_should_not_be_expired
today = Time.now.utc
date = CreditCard::ExpiryDate.new(today.month, today.year)
assert_false date.expired?
end
def test_dates_in_the_future_should_not_be_expired
next_month = 1.month.from_now
date = CreditCard::ExpiryDate.new(next_month.month, next_month.year)
assert_false date.expired?
end
def test_invalid_date
expiry = CreditCard::ExpiryDate.new(13, 2009)
assert_equal Time.at(0).utc, expiry.expiration
end
def test_month_and_year_coerced_to_integer
expiry = CreditCard::ExpiryDate.new("13", "2009")
assert_equal 13, expiry.month
assert_equal 2009, expiry.year
end
end
|
ashrafuzzaman/stips
|
vendor/plugins/active_merchant/test/unit/expiry_date_test.rb
|
Ruby
|
mit
| 911
|
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
<title>OffscreenCanvas test: 2d.pattern.paint.repeatx.basic</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>
<h1>2d.pattern.paint.repeatx.basic</h1>
<p class="desc"></p>
<script>
var t = async_test("");
t.step(function() {
var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');
ctx.fillStyle = '#0f0';
ctx.fillRect(0, 0, 100, 50);
ctx.fillStyle = '#f00';
ctx.fillRect(0, 0, 100, 16);
var promise = new Promise(function(resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open("GET", '/images/green-16x16.png');
xhr.responseType = 'blob';
xhr.send();
xhr.onload = function() {
resolve(xhr.response);
};
});
promise.then(function(response) {
var pattern = ctx.createPattern(response, 'repeat-x');
ctx.fillStyle = pattern;
ctx.fillRect(0, 0, 100, 50);
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
});
t.done();
});
</script>
|
shinglyu/servo
|
tests/wpt/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.paint.repeatx.basic.html
|
HTML
|
mpl-2.0
| 1,381
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.